html_url
stringlengths
48
51
title
stringlengths
5
280
comments
stringlengths
63
51.8k
body
stringlengths
0
36.2k
comment_length
int64
16
1.52k
text
stringlengths
159
54.1k
embeddings
listlengths
768
768
https://github.com/huggingface/datasets/issues/5083
Support numpy/torch/tf/jax formatting for IterableDataset
Hi @zutarich ! This issue was fixed by #5852 - sorry I forgot to close it Feel free to look for other issues and ping me or @mariosasko if you have questions :) Also let us know if we can help find an issue that can correspond to what you're looking for
Right now `IterableDataset` doesn't do any formatting. In particular this code should return a numpy array: ```python from datasets import load_dataset ds = load_dataset("imagenet-1k", split="train", streaming=True).with_format("np") print(next(iter(ds))["image"]) ``` Right now it returns a PIL.Image. Setting `streaming=False` does return a numpy array after #5072
52
Support numpy/torch/tf/jax formatting for IterableDataset Right now `IterableDataset` doesn't do any formatting. In particular this code should return a numpy array: ```python from datasets import load_dataset ds = load_dataset("imagenet-1k", split="train", streaming=True).with_format("np") print(next(iter(ds))["image"]) ``` Right now it returns a PIL.Image. Setting `streaming=False` does return a numpy array after #5072 Hi @zutarich ! This issue was fixed by #5852 - sorry I forgot to close it Feel free to look for other issues and ping me or @mariosasko if you have questions :) Also let us know if we can help find an issue that can correspond to what you're looking for
[ -0.2871096730232239, -0.28445765376091003, -0.0814630463719368, 0.03790094330906868, 0.3299255967140198, 0.054992325603961945, 0.5919589400291443, 0.4232988953590393, -0.13432030379772186, -0.030175939202308655, -0.13997267186641693, 0.3614840507507324, -0.1710081845521927, 0.07982974499464035, 0.004459815099835396, -0.18800455331802368, 0.00472259521484375, 0.4073454737663269, -0.15585319697856903, 0.10094207525253296, -0.1703968346118927, 0.17022833228111267, -0.14870840311050415, -0.10074277222156525, -0.3336917459964752, -0.06259983032941818, -0.04200420901179314, -0.02611956000328064, -0.012697393074631691, -0.3241035044193268, 0.33178719878196716, 0.19612151384353638, 0.10885018855333328, 0.3636905252933502, -0.00010630240285536274, 0.0776999443769455, 0.09940040111541748, -0.12341950088739395, -0.18811681866645813, 0.12271749973297119, 0.0750761404633522, -0.2639111280441284, 0.12744958698749542, -0.2983238995075226, -0.3781709372997284, -0.40503746271133423, 0.138981893658638, -0.1197446957230568, 0.3687303066253662, 0.2719630300998688, 0.2693324387073517, 0.1909109354019165, -0.11575594544410706, 0.22217565774917603, -0.3111678957939148, 0.0810556411743164, -0.3253726661205292, 0.01738635078072548, 0.4375387132167816, 0.21704214811325073, 0.02963971346616745, 0.4791540503501892, -0.004257744178175926, 0.24563251435756683, 0.09247433394193649, 0.07007249444723129, -0.172392338514328, -0.17491906881332397, 0.10461405664682388, 0.11571203172206879, 0.41682595014572144, -0.21640780568122864, -0.12796196341514587, -0.3391360938549042, -0.08667929470539093, -0.5073742270469666, -0.024463653564453125, 0.17064575850963593, -0.22154876589775085, -0.00917564332485199, -0.3615191578865051, 0.14724454283714294, -0.41534119844436646, 0.26729607582092285, -0.02385905012488365, 0.31797581911087036, 0.0021837675012648106, 0.1348126083612442, -0.2311801165342331, 0.1080775037407875, 0.629285454750061, -0.05848304182291031, 0.11424830555915833, 0.14446522295475006, -0.07460522651672363, -0.15189045667648315, -0.011400841176509857, -0.3855002224445343, -0.07481575012207031, 0.025130286812782288, 0.1855573207139969, 0.14898082613945007, -0.2508479356765747, -0.002007942646741867, 0.3703153729438782, -0.01540347095578909, -0.1535344421863556, 0.2477913647890091, 0.17479576170444489, 0.15366271138191223, 0.15405231714248657, -0.2006925344467163, 0.0878429189324379, -0.0726332813501358, 0.26124727725982666, -0.02635771408677101, 0.09084175527095795, 0.0021718181669712067, -0.06489019095897675, -0.2654516100883484, -0.1449335217475891, -0.10667659342288971, -0.09415920078754425, -0.009407959878444672, 0.07532627135515213, 0.3077770173549652, 0.04223577678203583, -0.006710957735776901, -0.08055885881185532, -0.22845174372196198, -0.1478869467973709, -0.17158475518226624, -0.22951950132846832, -0.10573012381792068, 0.07941687107086182, -0.18922695517539978, 0.09877689927816391, -0.19209620356559753, -0.007377907633781433, 0.2816011905670166, 0.2356777787208557, -0.23052087426185608, 0.7113775610923767, 0.12678198516368866, -0.11447946727275848, 0.03521675616502762, 0.22442030906677246, 0.23084907233715057, -0.09423770010471344, 0.11050573736429214, -0.11196761578321457, -0.13622839748859406, -0.18129505217075348, 0.1748647391796112, -0.026800068095326424, -0.04988233745098114, 0.06967274844646454, 0.12047970294952393, 0.2117956131696701, -0.42379292845726013, 0.24100840091705322, -0.30756282806396484, -0.3864891827106476, -0.12269193679094315, 0.21740156412124634, 0.04742203652858734, -0.33420440554618835, -0.047914858907461166, 0.14635628461837769, -0.14254528284072876, 0.3993349075317383, 0.2460298389196396, -0.002704602899029851, 0.1626797318458557, -0.361714243888855, 0.06904414296150208, 0.2831132709980011, -0.07099809497594833, -0.30479663610458374, 0.26745179295539856, 0.2022392898797989, 0.31459903717041016, -0.03669712692499161, 0.3735172748565674, 0.14003263413906097, 0.10693098604679108, 0.025566495954990387, 0.5394333600997925, -0.2618960440158844, 0.10925517231225967, -0.14381729066371918, -0.012643671594560146, 0.12098135054111481, 0.28046396374702454, 0.21226757764816284, 0.09116914123296738, -0.1268417239189148, 0.012028674595057964, 0.5702876448631287, -0.09250842034816742, 0.03468295559287071, -0.0525837168097496, 0.2171737402677536, -0.029667988419532776, 0.12241892516613007, -0.15191158652305603, -0.16670382022857666, 0.12168023735284805, 0.3638727068901062, -0.08280391991138458, -0.22805900871753693, 0.04972650110721588, -0.12487894296646118, 0.027160247787833214, -0.4709987938404083, -0.3814210593700409, 0.19857211410999298, 0.2782708406448364, -0.07479876279830933, -0.18344788253307343, -0.34965476393699646, 0.3985016644001007, -0.2128942608833313, -0.22785411775112152, -0.4114099442958832, 0.4944077730178833, 0.14313222467899323, -0.31653469800949097, -0.07748948782682419, 0.33994385600090027, -0.1683466136455536, -0.14879994094371796, -0.13750672340393066, 0.6266992092132568, -0.03604673594236374, 0.04922601953148842, -0.19284522533416748, 0.1377468705177307, 0.2687303125858307, -0.3529437184333801, -0.12414438277482986, 0.5388009548187256, -0.06489524990320206, -0.14771777391433716, -0.4327870309352875, 0.4217754006385803, -0.30932027101516724, 0.2759641706943512, 0.08092480897903442, 0.029067909345030785, 0.18950119614601135, 0.2256934940814972, -0.28092923760414124, -0.31483665108680725, -0.09959501028060913, -0.20676545798778534, -0.17470258474349976, -0.3163607716560364, -0.42551520466804504, 0.073517806828022, 0.4915856420993805, 0.12995515763759613, -0.02150162309408188, -0.005724787712097168, -0.06726206094026566, -0.15457451343536377, 0.39505282044410706, -0.014187153428792953, 0.21526378393173218, 0.20833376049995422, -0.09042829275131226, 0.02253178507089615, 0.032108381390571594, -0.13395625352859497, 0.1293850541114807, 0.07425285875797272, 0.2178785353899002, 0.2651679813861847, 0.2030966877937317, -0.17326074838638306, -0.40573224425315857, -0.29359880089759827, -0.3374561667442322, 0.08070088177919388, -0.008814025670289993, 0.12181732803583145, -0.16220243275165558, -0.5199548602104187, -0.22414834797382355, -0.04576476290822029, 0.07320418953895569, -0.43853646516799927, -0.02520034834742546, 0.4191415011882782, 0.16132669150829315, 0.24890553951263428, -0.3949408233165741, 0.020685002207756042, 0.4200982451438904, -0.14405716955661774, -0.27632206678390503, -0.1531912237405777, 0.0330590158700943, 0.1477804332971573, -0.009759783744812012, -0.35853302478790283, 0.521744966506958, 0.04681000858545303, 0.063140869140625, -0.2716934382915497, -0.22819221019744873, 0.29399147629737854, -0.12089374661445618, -0.09553437680006027, 0.3948456943035126, 0.4640271067619324, 0.016495976597070694, 0.019427631050348282, 0.3511691987514496, -0.24874098598957062, -0.006255391053855419, 0.18409013748168945, -0.0729803815484047, 0.1045776978135109, -0.02628638967871666, -0.31736958026885986, -0.06251803785562515, -0.26718083024024963, 0.025632783770561218, 0.13846702873706818, 0.26603031158447266, 0.5058831572532654, 0.1972816437482834, 0.14401164650917053, 0.39849892258644104, -0.2890942096710205, -0.06865252554416656, -0.004474282264709473, 0.34779104590415955, -0.22990025579929352, -0.17287148535251617, -0.10812422633171082, 0.20994429290294647, 0.3208613991737366, 0.15911619365215302, -0.26809263229370117, -0.29481270909309387, -0.04261557012796402, 0.17014862596988678, -0.034676842391490936, -0.20653344690799713, 0.198761984705925, 0.0816132128238678, -0.18285560607910156, -0.17432695627212524, 0.20052894949913025, -0.15026432275772095, -0.011193998157978058, 0.23259910941123962, 0.3944941461086273, 0.37890926003456116, 0.2379731833934784, 0.435360312461853, 0.20121441781520844, -0.22324945032596588, 0.46496477723121643, -0.314266175031662, 0.27051064372062683, -0.29142627120018005, -0.35907211899757385, 0.1715025007724762, 0.08518300205469131, -0.017517555505037308, 0.20337052643299103, -0.03918025270104408, -0.17780570685863495, -0.10729730129241943, 0.29211390018463135, -0.1251479685306549, -0.0177774578332901, 0.16298095881938934, -0.0044190362095832825, 0.19314944744110107, -0.20567519962787628, 0.19114002585411072, -0.035063616931438446, -0.4638109505176544, -0.12523294985294342, -0.14114336669445038, 0.1391119360923767, -0.02340821363031864, -0.14838863909244537, -0.1675989031791687, -0.35960814356803894, 0.12525859475135803, 0.10731997340917587, 0.4780886769294739, -0.04604099318385124, -0.1542583853006363, 0.20677945017814636, -0.08455101400613785, 0.6165840029716492, -0.3618081510066986, -0.23575536906719208, 0.16773611307144165, 0.07492273300886154, -0.551748514175415, -0.12106382846832275, -0.24202968180179596, 0.3888796269893646, 0.24483411014080048, 0.5979419946670532, 0.005592308938503265, -0.2727179229259491, 0.1736115664243698, -0.07628566026687622, -0.15046726167201996, -0.11209280043840408, -0.3696894347667694, -0.1575087010860443, -0.19167768955230713, -0.009845703840255737, 0.021914532408118248, 0.12208577245473862, 0.1740991473197937, -0.3357461094856262, -0.1575150340795517, -0.27319610118865967, -0.1668248027563095, 0.16135329008102417, 0.23810520768165588, 0.12337218225002289, 0.02097053825855255, 0.3097068965435028, 0.39424821734428406, 0.1598832905292511, 0.17032842338085175, -0.28261688351631165, 0.09209764003753662, 0.22049564123153687, -0.313892126083374, 0.17727795243263245, 0.4029225707054138, -0.026071012020111084, -0.2226322889328003, 0.010405655950307846, 0.13593149185180664, -0.09481094032526016, -0.013468679040670395, 0.33850839734077454, -0.17699037492275238, -0.2376139760017395, -0.5182338356971741, 0.22474068403244019, 0.03254849091172218, 0.03428015112876892, 0.5620729327201843, -0.2434978038072586, -0.23061302304267883, 0.09762653708457947, 0.40135329961776733, 0.7466648817062378, -0.08575493097305298, 0.38295888900756836, 0.3225475549697876, -0.2880685329437256, 0.06547722965478897, -0.17698988318443298, 0.23510295152664185, -0.27664467692375183, -0.2837134301662445, -0.13734345138072968, 0.1129174679517746, -0.04110029339790344, 0.07575250416994095, -0.26924341917037964, 0.3185783624649048, 0.024880141019821167, 0.12448656558990479, -0.10453824698925018, 0.10800409317016602, -0.14272238314151764, -0.2648266851902008, -0.35740897059440613, 0.19466239213943481, -0.2640518546104431, -0.109023317694664, -0.05947371944785118, -0.15178345143795013, 0.31325972080230713, 0.09665626287460327, -0.05048756301403046, 0.0981355831027031, -0.2716200053691864, 0.11952506750822067, 0.02986126020550728, -0.45237070322036743, -0.331175833940506, 0.3910675644874573, 0.2239225059747696, -0.29098790884017944, -0.2210482954978943, 0.1735105961561203, 0.16593828797340393, 0.1589805632829666, -0.3019258975982666, 0.07312286645174026, 0.5023760795593262, -0.15324078500270844, 0.048770107328891754, 0.10992632806301117, 0.09296846389770508, -0.29559633135795593, -0.18161773681640625, -0.010059691965579987, 0.4461092948913574, -0.2740743160247803, -0.16607002913951874, -0.13176760077476501, -0.11804123222827911, -0.2190459668636322, 0.15479277074337006, -0.10254248976707458, 0.05678528547286987, 0.14570774137973785, 0.023359064012765884, -0.16862621903419495, -0.024510905146598816, 0.43407636880874634, 0.2162986695766449, -0.18350107967853546, 0.5096251964569092, 0.2940915822982788, -0.1857120543718338, -0.25010940432548523, 0.08151745051145554, 0.35696566104888916, -0.17213746905326843, 0.1009044423699379, -0.08738750964403152, 0.28221064805984497, -0.08095190674066544, 0.3111991286277771, -0.15989603102207184, 0.034289248287677765, -0.2886303961277008, 0.04131104052066803, -0.44053277373313904, -0.008124493062496185, 0.07021011412143707, 0.6002077460289001, -0.14097291231155396, -0.22199712693691254, 0.24111920595169067, -0.11514714360237122, -0.39490431547164917, -0.2507362961769104, 0.010234842076897621, 0.030275171622633934, 0.13763701915740967, 0.14644992351531982, 0.2731899619102478, -0.12471634149551392, 0.15800397098064423, 0.2314336597919464, -0.18806606531143188, -0.2822427749633789, -0.05284973978996277, 0.09404691308736801, 0.2757304012775421, -0.388313353061676, -0.11347085237503052, 0.03726346790790558, -0.4482016861438751, -0.35858938097953796, 0.14128193259239197, -0.04072097688913345, -0.0488438755273819, 0.18838386237621307, 0.18868884444236755, -0.013551868498325348, 0.03135782480239868, -0.43845149874687195, 0.012578867375850677, 0.2761121392250061, 0.1497388631105423, 0.011577405035495758, 0.137001171708107, -0.1308523416519165, -0.02436528354883194, 0.24231168627738953, 0.30069419741630554, 0.08949873596429825, 0.29565009474754333, -0.3299393057823181, 0.06260180473327637, 0.009699452668428421, 0.5447607040405273, 0.11323017627000809, -0.25171521306037903, -0.33452627062797546, -0.06207912415266037, 0.28333616256713867, -0.10943404585123062, 0.04428763687610626, 0.06996233016252518, 0.053916085511446, -0.04155942052602768, 0.12914907932281494, 0.07085107266902924, 0.008411906659603119, -0.03017698973417282, 0.122972272336483, 0.16569803655147552, -0.6926818490028381, -0.023413825780153275, 0.4529452919960022, 0.012193877249956131, -0.05881708487868309, -0.015464382246136665, -0.14409442245960236, -0.044773586094379425, 0.6001790165901184, -0.10826285928487778, 0.42970243096351624, 0.4060579538345337, -0.16539309918880463, 0.04738106206059456, -0.11075228452682495, -0.3299519717693329, -0.17124620079994202, -0.12641316652297974, 0.4576977789402008, 0.16103698313236237, 0.38304057717323303, -0.05250895395874977, -0.30003249645233154, -0.09385175257921219, 0.013474740087985992, 0.011622285470366478, 0.11666736006736755, -0.414826899766922, 0.0509452298283577, -0.3224555253982544, 0.048983294516801834, -0.02056393399834633, 0.011800568550825119, 0.05840396508574486, 0.33396708965301514, -0.025961212813854218, -0.437867134809494, 0.3737892210483551, -0.044248826801776886, 0.5120630860328674, -0.21674229204654694, 0.1596083790063858, 0.165839284658432, 0.10629787296056747, 0.03447404131293297, 0.12229172885417938, 0.259859174489975, 0.17859385907649994, 0.0008716005831956863, 0.007073791231960058, -0.21194352209568024, -0.20266081392765045, 0.04317279905080795, 0.15659233927726746, 0.04124418646097183, -0.18786102533340454, 0.24131686985492706, 0.17352354526519775, -0.1201566532254219, 0.21066153049468994, 0.14470748603343964, 0.10625819861888885, -0.025316480547189713, 0.13469931483268738, -0.0716562494635582, -0.23717951774597168, -0.13313232362270355, -0.26308149099349976, -0.32950204610824585, -0.12426358461380005, 0.2226603478193283, -0.1029154360294342, 0.10946366935968399, 0.012075482867658138, 0.09483575820922852, -0.07199834287166595, 0.3583831191062927, 0.14926846325397491, -0.023338831961154938, -0.0006812429055571556, -0.22363734245300293, -0.28686803579330444, -0.04906921833753586, -0.03134447708725929, -0.15414337813854218, -0.015550119802355766, 0.19067145884037018, 0.02477334439754486, -0.09655183553695679, 0.19883066415786743, -0.1617772877216339, 0.21742887794971466, 0.49527472257614136, -0.22927537560462952, -0.1975582391023636, 0.08474478870630264, 0.19997160136699677, -0.06373606622219086, -0.23952451348304749, 0.02677863836288452, -0.3013114333152771, 0.1957533359527588, 0.09728419035673141, -0.2639670968055725, -0.24930979311466217, 0.033020518720149994, 0.45445895195007324, 0.0739518254995346, 0.1212361752986908, -0.13254323601722717, -0.01812664605677128, -0.16749835014343262, -0.05654997006058693, -0.2744671404361725, 0.4368991255760193, 0.07391750812530518, 0.553329348564148, 0.14504268765449524, -0.18029002845287323, -0.326075941324234, 0.38518139719963074, 0.035487525165081024, -0.19777050614356995, -0.0306729543954134, 0.023000797256827354, -0.10070743411779404, 0.18646647036075592, -0.14916148781776428, 0.17849719524383545, 0.034444957971572876, 0.08712343871593475, -0.45313042402267456, -0.5382144451141357, 0.3971877098083496, -0.2703803777694702, -0.43172553181648254, 0.037430375814437866, -0.1267894208431244, 0.23426303267478943, 0.31303662061691284, -0.5493330955505371, -0.02964194118976593, 0.2782194912433624, -0.13060534000396729, -0.1897323876619339, 0.26597657799720764, 0.3790602385997772, 0.2594560384750366, -0.048988256603479385, 0.13965943455696106, 0.1784864366054535, -0.2708428204059601, -0.16376997530460358, -0.1827293187379837 ]
https://github.com/huggingface/datasets/issues/5081
Bug loading `sentence-transformers/parallel-sentences`
The dataset is sadly not really compatible to be loaded with `load_dataset`. So far it is better to git clone it and to use the files directly. A data loading script would be needed to be added to this dataset. But this was too much overhead / not really intuitive how to create it.
## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2
54
Bug loading `sentence-transformers/parallel-sentences` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2 The dataset is sadly not really compatible to be loaded with `load_dataset`. So far it is better to git clone it and to use the files directly. A data loading script would be needed to be added to this dataset. But this was too much overhead / not really intuitive how to create it.
[ -0.0064447298645973206, -0.30189454555511475, -0.07506976276636124, 0.1588544398546219, 0.19041398167610168, 0.014945738017559052, 0.5312554240226746, 0.17734768986701965, -0.1279134452342987, 0.1705007553100586, -0.08514212816953659, 0.3792472183704376, 0.0759563222527504, -0.5006234049797058, -0.1747632771730423, -0.23892077803611755, 0.1334494650363922, 0.023917123675346375, -0.08517459034919739, -0.060156408697366714, -0.2757093608379364, 0.3060179650783539, -0.3254345655441284, -0.14870671927928925, -0.052077699452638626, 0.10794337838888168, -0.15572910010814667, 0.18705973029136658, -0.11709804087877274, -0.3488713502883911, -0.1775350719690323, 0.17408081889152527, 0.0308830589056015, 0.5999956130981445, -0.0001066906625055708, -0.013138141483068466, 0.35849058628082275, -0.02927335351705551, -0.3431011736392975, -0.3456762433052063, 0.08296071738004684, -0.20873510837554932, 0.17962966859340668, -0.23282426595687866, 0.024374503642320633, -0.028689008206129074, -0.05301748216152191, -0.1924591064453125, 0.4333108067512512, 0.2688455283641815, 0.26302194595336914, 0.4947151839733124, 0.049459923058748245, -0.34784436225891113, 0.17156118154525757, -0.4469722509384155, -0.004480578005313873, 0.32126885652542114, 0.23900829255580902, -0.006804360076785088, -0.18007001280784607, 0.23720405995845795, -0.2235061377286911, 0.10836274921894073, -0.05765172839164734, -0.1336098611354828, 0.1073879599571228, -0.12355479598045349, -0.022797882556915283, 0.09546566009521484, 0.14273759722709656, -0.19485753774642944, -0.306570440530777, -0.2380044162273407, -0.12717358767986298, 0.07430771738290787, -0.045722149312496185, 0.06358306854963303, -0.1463688611984253, 0.21348771452903748, -0.0801163837313652, 0.04967768117785454, 0.024496935307979584, 0.042993150651454926, -0.18713317811489105, 0.6275644302368164, -0.03261946886777878, 0.06727271527051926, 0.457787424325943, 0.13827495276927948, 0.2553781270980835, 0.1064307764172554, -0.09224765002727509, 0.04941602423787117, -0.40965428948402405, -0.017700523138046265, 0.03441757336258888, -0.6007848978042603, 0.06016311049461365, -0.038165442645549774, 0.26910069584846497, -0.11763546615839005, 0.27582451701164246, 0.27960091829299927, 0.16723188757896423, 0.4024121165275574, -0.0980280265212059, 0.27040770649909973, 0.09447477757930756, 0.20300757884979248, 0.1548592448234558, -0.023763880133628845, -0.2978023290634155, -0.05027379095554352, 0.13370530307292938, 0.25796759128570557, 0.15892677009105682, 0.02456102892756462, -0.2529754340648651, -0.033022500574588776, -0.17613235116004944, 0.08163989335298538, -0.14542058110237122, 0.31668218970298767, 0.061993639916181564, 0.5051547288894653, -0.01410311833024025, 0.33983278274536133, -0.21555368602275848, -0.3661046326160431, -0.302417516708374, -0.010695889592170715, -0.08157778531312943, -0.03117014281451702, 0.08639980852603912, 0.3753650188446045, 0.3308446705341339, -0.01330053061246872, 0.03540246933698654, -0.3427397906780243, -0.1832977831363678, -0.18738315999507904, -0.1596876084804535, 0.14377273619174957, 0.054959144443273544, 0.04971867799758911, 0.28612813353538513, -0.0885724201798439, 0.10844973474740982, 0.20334583520889282, -0.1913335919380188, -0.1652156412601471, -0.2204935997724533, 0.2975698709487915, -0.11682407557964325, -0.17014102637767792, 0.034467048943042755, 0.12843842804431915, 0.4836467206478119, -0.007964514195919037, 0.07959575206041336, -0.07703724503517151, -0.25884878635406494, -0.1898820698261261, -0.028599631041288376, 0.3697071671485901, -0.5592251420021057, -0.2589382529258728, 0.08216510713100433, 0.0875033587217331, 0.3078323006629944, 0.4528600573539734, -0.16454672813415527, -0.003662019968032837, -0.046266309916973114, 0.24651966989040375, 0.13833880424499512, -0.32555127143859863, -0.18328382074832916, 0.3252902626991272, -0.35065513849258423, 0.21282456815242767, 0.2190699577331543, -0.1586511731147766, 0.44434502720832825, -0.019075818359851837, 0.35723721981048584, 0.11952225863933563, 0.27844271063804626, 0.06714479625225067, -0.44459158182144165, -0.19816458225250244, -0.08778113126754761, -0.0606895349919796, 0.1802307665348053, 0.14801663160324097, 0.030956752598285675, -0.08406280726194382, 0.2860587537288666, 0.0157117061316967, -0.02305910550057888, 0.17892995476722717, 0.09859849512577057, 0.19263958930969238, 0.16923725605010986, 0.07405708730220795, -0.21406376361846924, 0.16752099990844727, -0.021393198519945145, 0.16068170964717865, -0.17302627861499786, -0.20577766001224518, -0.26034513115882874, -0.0595531091094017, 0.010040607303380966, -0.24764618277549744, 0.2318798303604126, 0.18702788650989532, -0.19989201426506042, -0.009462399408221245, -0.03356189280748367, 0.13236963748931885, -0.033775247633457184, -0.014331025071442127, -0.20233172178268433, 0.1880408525466919, -0.2555640935897827, -0.18967482447624207, -0.10879766196012497, 0.1271921843290329, 0.22016745805740356, -0.008416512049734592, -0.16948577761650085, 0.5179384350776672, -0.07714782655239105, 0.42850208282470703, -0.20941001176834106, -0.41302382946014404, 0.1095525398850441, -0.20821787416934967, 0.08409634977579117, 0.1855996698141098, 0.28604772686958313, -0.08314019441604614, 0.039018213748931885, 0.16519086062908173, 0.3459412455558777, -0.008625894784927368, 0.20085613429546356, -0.05550290644168854, 0.1962692141532898, -0.06609953939914703, -0.2026567906141281, -0.3105357587337494, 0.31442755460739136, -0.01715729385614395, -0.100227952003479, 0.12180323898792267, -0.1993052214384079, -0.06901096552610397, 0.2973478138446808, -0.1381823867559433, 0.12708324193954468, 0.01250055804848671, -0.12484712153673172, 0.0374254509806633, -0.1139940619468689, 0.1930995136499405, 0.3166133165359497, 0.254481703042984, 0.030798280611634254, 0.18100950121879578, -0.015278699807822704, -0.31333714723587036, 0.11153178662061691, 0.4160482883453369, 0.27414727210998535, 0.3199387788772583, 0.26635900139808655, 0.130859836935997, -0.3311670422554016, 0.0025771334767341614, 0.12468057125806808, 0.13432946801185608, -0.3879118263721466, 0.14147841930389404, -0.17230919003486633, 0.010895006358623505, -0.1655905842781067, -0.015731576830148697, 0.13711194694042206, -0.3592996895313263, 0.14831137657165527, 0.273460328578949, -0.18036800622940063, 0.22691547870635986, 0.17204934358596802, 0.19493010640144348, 0.11537089943885803, 0.01341309491544962, -0.14815177023410797, -0.288126677274704, -0.11784292012453079, 0.12480472028255463, -0.01985805295407772, -0.10284179449081421, -0.06958602368831635, -0.1179654523730278, -0.2728992700576782, -0.07235228270292282, -0.18258056044578552, 0.01067289337515831, -0.24637232720851898, 0.2902805507183075, 0.08194570988416672, 0.00995829701423645, -0.03466431424021721, -0.1664343774318695, 0.18160048127174377, -0.32624027132987976, -0.19395191967487335, 0.1671670526266098, 0.17241717875003815, -0.14634469151496887, -0.32961583137512207, -0.4586903750896454, -0.2527227997779846, -0.5875048041343689, 0.17562900483608246, -0.02663426660001278, 0.006818272173404694, 0.14953084290027618, 0.1508965790271759, -0.0795726329088211, 0.18683522939682007, 0.0265592522919178, -0.3225563168525696, -0.029219377785921097, 0.17992329597473145, -0.1308939903974533, -0.3285573124885559, -0.39009106159210205, 0.04171757400035858, 0.10503949224948883, -0.17820963263511658, -0.36624854803085327, -0.0844118595123291, -0.19923530519008636, -0.1024317815899849, -0.10577760636806488, -0.1867249757051468, 0.2444489598274231, -0.015652183443307877, -0.18163836002349854, -0.08130162954330444, 0.1175263375043869, 0.19603069126605988, 0.23335763812065125, -0.021858297288417816, -0.14194154739379883, 0.5061035752296448, 0.3703949749469757, 0.6176100373268127, 0.18731552362442017, 0.10551994293928146, 0.31445759534835815, 0.045079849660396576, 0.14763498306274414, -0.08469656854867935, -0.27763649821281433, -0.09981369972229004, -0.2564239799976349, -0.1070144921541214, 0.22404229640960693, -0.18322545289993286, -0.3932807147502899, -0.11363831162452698, -0.08527061343193054, -0.2626449167728424, -0.1321532279253006, 0.0074043432250618935, -0.05339924246072769, -0.06944894045591354, 0.0784478485584259, 0.14056819677352905, -0.03160110488533974, 0.13968169689178467, -0.11147348582744598, -0.00953596830368042, -0.061862967908382416, -0.12010931223630905, 0.2260674089193344, 0.3311765193939209, -0.3378653824329376, 0.16203844547271729, 0.19699810445308685, 0.5000758767127991, 0.10469935834407806, -0.27812886238098145, 0.08922618627548218, -0.14332261681556702, 0.683061420917511, 0.09304533153772354, -0.008257400244474411, 0.28827419877052307, 0.08569151163101196, -0.43444404006004333, -0.28601425886154175, -0.4717509150505066, -0.3482973575592041, 0.4689933955669403, 0.3483321964740753, -0.18084532022476196, 0.0684838742017746, 0.2937740981578827, -0.14978620409965515, -0.053392473608255386, -0.3663918673992157, -0.41720080375671387, -0.2109774351119995, -0.540665328502655, 0.15704020857810974, 0.24083773791790009, 0.060615453869104385, -0.26505860686302185, -0.223136305809021, 0.18832024931907654, -0.38938987255096436, -0.07040467858314514, 0.12069748342037201, 0.02509170211851597, -0.2181113064289093, 0.13499368727207184, 0.11031056940555573, -0.2780015766620636, 0.11094211786985397, 0.38355860114097595, 0.1404254138469696, -0.22586748003959656, 0.151200532913208, -0.0967918336391449, 0.17665965855121613, 0.2134207785129547, -0.1662386804819107, 0.10676384717226028, 0.22716759145259857, 0.25544291734695435, -0.06773935258388519, -0.2768837511539459, 0.4240023195743561, 0.09464451670646667, -0.055547475814819336, -0.2262602150440216, 0.29104486107826233, 0.11152954399585724, -0.013021104037761688, -0.25638431310653687, -0.3841747045516968, -0.17401766777038574, 0.5088536739349365, -0.05592695623636246, 0.971862256526947, -0.0076797232031822205, 0.10415945947170258, 0.23423710465431213, 0.013515152037143707, 0.22324314713478088, -0.5320963859558105, 0.2104571908712387, -0.1830863505601883, -0.2170652598142624, -0.0929083451628685, 0.0023523159325122833, 0.2818467915058136, 0.028335709124803543, -0.6256151795387268, 0.3931393623352051, -0.22754831612110138, 0.2500980794429779, 0.27581965923309326, -0.15813735127449036, -0.11348823457956314, 0.01143665798008442, 0.10786044597625732, 0.15361687541007996, 0.22152669727802277, 0.014906490221619606, -0.026207419112324715, -0.049496978521347046, 0.024307433515787125, -0.3104557991027832, -0.28512173891067505, 0.21061545610427856, -0.1768827885389328, 0.27332621812820435, -0.14647580683231354, -0.01131325215101242, -0.10746991634368896, 0.0769825130701065, 0.11276520788669586, 0.12540489435195923, 0.03372062370181084, 0.2948944866657257, 0.4090304672718048, -0.11201118677854538, -0.07986444979906082, -0.006996858865022659, 0.28204259276390076, -0.17962563037872314, -0.44541695713996887, 0.15054713189601898, 0.029592856764793396, -0.2683076858520508, -0.06669247895479202, 0.07839103043079376, 0.12780694663524628, -0.14203524589538574, 0.03676588460803032, -0.05468052625656128, -0.10566820204257965, -0.5616085529327393, 0.20474843680858612, -0.16554909944534302, -0.5234267711639404, -0.004801549017429352, -0.09438218176364899, -0.26396992802619934, -0.1703684777021408, 0.5786184072494507, 0.2982688248157501, 0.1315900981426239, 0.27890992164611816, 0.27079856395721436, -0.22617106139659882, -0.3052178919315338, -0.3912286162376404, -0.3081105947494507, -0.461759090423584, 0.3227306306362152, -0.29286015033721924, -0.32891321182250977, -0.019378436729311943, 0.30101504921913147, 0.2527630925178528, 0.19093114137649536, -0.3937869369983673, -0.4043690264225006, -0.03405047208070755, -0.0690455436706543, -0.24763821065425873, 0.09390382468700409, 0.3461208641529083, 0.1024467796087265, -0.14520372450351715, 0.22513316571712494, -0.43451938033103943, 0.0762353166937828, -0.43732601404190063, 0.08421843498945236, -0.03311122953891754, -0.43270573019981384, 0.016001472249627113, 0.05985153838992119, 0.28517448902130127, 0.5130840539932251, 0.03883949667215347, -0.29860132932662964, -0.14648394286632538, 0.07246381789445877, -0.0516030415892601, 0.218061625957489, 0.04447653144598007, 0.23123915493488312, -0.0924171507358551, 0.004134578630328178, 0.11229236423969269, 0.12910735607147217, 0.1253066509962082, 0.25788986682891846, 0.21300938725471497, 0.19094128906726837, 0.06911253184080124, 0.14945060014724731, -0.1460007131099701, 0.07199487090110779, 0.04776063188910484, 0.2505287826061249, 0.032356638461351395, 0.057240188121795654, -0.19702650606632233, 0.07830027490854263, 0.24139823019504547, 0.29544559121131897, 0.19695264101028442, -0.30904608964920044, -0.06407971680164337, -0.2424384504556656, 0.3684192895889282, 0.2857248783111572, -0.27671435475349426, -0.32796308398246765, 0.05144408717751503, 0.29178792238235474, -0.3037309944629669, -0.10747355967760086, 0.2246273308992386, 0.031188301742076874, 0.2117120325565338, 0.41002216935157776, 0.26558831334114075, -0.13050410151481628, 0.07893200218677521, 0.2028208076953888, 0.44677507877349854, 0.11475654691457748, 0.23355360329151154, 0.20922213792800903, 0.033410411328077316, -0.045159462839365005, -0.03142236918210983, -0.12502267956733704, 0.38584938645362854, 0.208402618765831, -0.22703707218170166, 0.18513816595077515, 0.0763770043849945, 0.2714921832084656, -0.036041513085365295, -0.2030750960111618, 0.42012134194374084, 0.17322880029678345, -0.18913891911506653, 0.17515435814857483, -0.030213937163352966, 0.32499536871910095, 0.09029513597488403, 0.04042845591902733, -0.36864638328552246, 0.4470277428627014, -0.3067397475242615, -0.25827091932296753, 0.029104582965373993, -0.16409489512443542, -0.36657798290252686, -0.07430056482553482, 0.14301669597625732, 0.15732279419898987, 0.18077853322029114, -0.1745488941669464, -0.0007301047444343567, -0.4493136703968048, 0.01668662391602993, -0.14539042115211487, 0.15366558730602264, -0.331662118434906, 0.36883246898651123, 0.3560248017311096, -0.04831826686859131, 0.03861309587955475, 0.2497933954000473, 0.5516515970230103, 0.23689085245132446, 0.08863411843776703, -0.10070597380399704, -0.133080393075943, -0.17963407933712006, 0.02156105637550354, 0.29737335443496704, 0.05469891428947449, 0.2801862359046936, 0.25292640924453735, 0.2499992847442627, -0.3064158856868744, 0.17817546427249908, 0.166832834482193, 0.08231629431247711, -0.35169434547424316, 0.3654627501964569, -0.13889198005199432, -0.07995457947254181, 0.037232521921396255, -0.006004847586154938, -0.621313214302063, 0.20344184339046478, 0.17056331038475037, -0.13540591299533844, 0.27483704686164856, 0.10236739367246628, 0.14151276648044586, 0.128398135304451, 0.2728537321090698, 0.430616170167923, -0.023931309580802917, -0.12735368311405182, 0.04614618420600891, -0.5907896757125854, 0.29000166058540344, -0.010655440390110016, 0.15430760383605957, 0.031294893473386765, 0.17628179490566254, 0.06476154923439026, 0.25365176796913147, 0.020691461861133575, 0.19806261360645294, -0.23743607103824615, 0.1772514283657074, -0.3172696530818939, -0.09884749352931976, 0.1656845211982727, -0.18855687975883484, 0.16580583155155182, -0.2474755048751831, -0.10105453431606293, -0.0411364883184433, 0.1542104184627533, 0.05016300082206726, -0.11118286848068237, 0.0512753389775753, -0.5227717161178589, 0.2405424267053604, -0.07049909979104996, 0.39244720339775085, -0.06398584693670273, 0.0052165742963552475, -0.10991664230823517, -0.18604923784732819, -0.15770651400089264, -0.14378789067268372, 0.267167329788208, 0.28911763429641724, -0.20842835307121277, 0.0029532015323638916, -0.16105230152606964, 0.2793019413948059, 0.11473460495471954, -0.27989405393600464, -0.2739177346229553, 0.23141004145145416, -0.07681458443403244, 0.04042689874768257, -0.11915448307991028, 0.07027163356542587, -0.02242901921272278, 0.14966709911823273, -0.09503009170293808, -0.6964723467826843, 0.5653486251831055, -0.17772148549556732, -0.32815852761268616, -0.1417374163866043, 0.02804725617170334, 0.15118417143821716, 0.10477596521377563, -0.6984158754348755, 0.06565704196691513, 0.3078497648239136, 0.08973857015371323, -0.25737428665161133, 0.38224923610687256, -0.04869890958070755, -0.156285360455513, -0.14871789515018463, -0.032942041754722595, 0.1751323640346527, -0.12118873000144958, 0.15606079995632172, -0.33095985651016235 ]
https://github.com/huggingface/datasets/issues/5081
Bug loading `sentence-transformers/parallel-sentences`
Since the dataset is a bunch of TSVs we should not need a dataset script I think. By default it tries to load all the TSVs at once, which fails here because they don't all have the same columns (pd.read_csv uses the first line as header by default). But those files have no header ! So, to properly load any TSV file in this repo, one has to pass `names=[...]` for pd.read_csv to know which column names to use. To fix this situation, we can either do 1. replace the TSVs by TSV with column names 2. OR specify the pd.read_csv kwargs as YAML in the dataset card - and `datasets` would use that by default WDTY ?
## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2
118
Bug loading `sentence-transformers/parallel-sentences` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2 Since the dataset is a bunch of TSVs we should not need a dataset script I think. By default it tries to load all the TSVs at once, which fails here because they don't all have the same columns (pd.read_csv uses the first line as header by default). But those files have no header ! So, to properly load any TSV file in this repo, one has to pass `names=[...]` for pd.read_csv to know which column names to use. To fix this situation, we can either do 1. replace the TSVs by TSV with column names 2. OR specify the pd.read_csv kwargs as YAML in the dataset card - and `datasets` would use that by default WDTY ?
[ -0.0064447298645973206, -0.30189454555511475, -0.07506976276636124, 0.1588544398546219, 0.19041398167610168, 0.014945738017559052, 0.5312554240226746, 0.17734768986701965, -0.1279134452342987, 0.1705007553100586, -0.08514212816953659, 0.3792472183704376, 0.0759563222527504, -0.5006234049797058, -0.1747632771730423, -0.23892077803611755, 0.1334494650363922, 0.023917123675346375, -0.08517459034919739, -0.060156408697366714, -0.2757093608379364, 0.3060179650783539, -0.3254345655441284, -0.14870671927928925, -0.052077699452638626, 0.10794337838888168, -0.15572910010814667, 0.18705973029136658, -0.11709804087877274, -0.3488713502883911, -0.1775350719690323, 0.17408081889152527, 0.0308830589056015, 0.5999956130981445, -0.0001066906625055708, -0.013138141483068466, 0.35849058628082275, -0.02927335351705551, -0.3431011736392975, -0.3456762433052063, 0.08296071738004684, -0.20873510837554932, 0.17962966859340668, -0.23282426595687866, 0.024374503642320633, -0.028689008206129074, -0.05301748216152191, -0.1924591064453125, 0.4333108067512512, 0.2688455283641815, 0.26302194595336914, 0.4947151839733124, 0.049459923058748245, -0.34784436225891113, 0.17156118154525757, -0.4469722509384155, -0.004480578005313873, 0.32126885652542114, 0.23900829255580902, -0.006804360076785088, -0.18007001280784607, 0.23720405995845795, -0.2235061377286911, 0.10836274921894073, -0.05765172839164734, -0.1336098611354828, 0.1073879599571228, -0.12355479598045349, -0.022797882556915283, 0.09546566009521484, 0.14273759722709656, -0.19485753774642944, -0.306570440530777, -0.2380044162273407, -0.12717358767986298, 0.07430771738290787, -0.045722149312496185, 0.06358306854963303, -0.1463688611984253, 0.21348771452903748, -0.0801163837313652, 0.04967768117785454, 0.024496935307979584, 0.042993150651454926, -0.18713317811489105, 0.6275644302368164, -0.03261946886777878, 0.06727271527051926, 0.457787424325943, 0.13827495276927948, 0.2553781270980835, 0.1064307764172554, -0.09224765002727509, 0.04941602423787117, -0.40965428948402405, -0.017700523138046265, 0.03441757336258888, -0.6007848978042603, 0.06016311049461365, -0.038165442645549774, 0.26910069584846497, -0.11763546615839005, 0.27582451701164246, 0.27960091829299927, 0.16723188757896423, 0.4024121165275574, -0.0980280265212059, 0.27040770649909973, 0.09447477757930756, 0.20300757884979248, 0.1548592448234558, -0.023763880133628845, -0.2978023290634155, -0.05027379095554352, 0.13370530307292938, 0.25796759128570557, 0.15892677009105682, 0.02456102892756462, -0.2529754340648651, -0.033022500574588776, -0.17613235116004944, 0.08163989335298538, -0.14542058110237122, 0.31668218970298767, 0.061993639916181564, 0.5051547288894653, -0.01410311833024025, 0.33983278274536133, -0.21555368602275848, -0.3661046326160431, -0.302417516708374, -0.010695889592170715, -0.08157778531312943, -0.03117014281451702, 0.08639980852603912, 0.3753650188446045, 0.3308446705341339, -0.01330053061246872, 0.03540246933698654, -0.3427397906780243, -0.1832977831363678, -0.18738315999507904, -0.1596876084804535, 0.14377273619174957, 0.054959144443273544, 0.04971867799758911, 0.28612813353538513, -0.0885724201798439, 0.10844973474740982, 0.20334583520889282, -0.1913335919380188, -0.1652156412601471, -0.2204935997724533, 0.2975698709487915, -0.11682407557964325, -0.17014102637767792, 0.034467048943042755, 0.12843842804431915, 0.4836467206478119, -0.007964514195919037, 0.07959575206041336, -0.07703724503517151, -0.25884878635406494, -0.1898820698261261, -0.028599631041288376, 0.3697071671485901, -0.5592251420021057, -0.2589382529258728, 0.08216510713100433, 0.0875033587217331, 0.3078323006629944, 0.4528600573539734, -0.16454672813415527, -0.003662019968032837, -0.046266309916973114, 0.24651966989040375, 0.13833880424499512, -0.32555127143859863, -0.18328382074832916, 0.3252902626991272, -0.35065513849258423, 0.21282456815242767, 0.2190699577331543, -0.1586511731147766, 0.44434502720832825, -0.019075818359851837, 0.35723721981048584, 0.11952225863933563, 0.27844271063804626, 0.06714479625225067, -0.44459158182144165, -0.19816458225250244, -0.08778113126754761, -0.0606895349919796, 0.1802307665348053, 0.14801663160324097, 0.030956752598285675, -0.08406280726194382, 0.2860587537288666, 0.0157117061316967, -0.02305910550057888, 0.17892995476722717, 0.09859849512577057, 0.19263958930969238, 0.16923725605010986, 0.07405708730220795, -0.21406376361846924, 0.16752099990844727, -0.021393198519945145, 0.16068170964717865, -0.17302627861499786, -0.20577766001224518, -0.26034513115882874, -0.0595531091094017, 0.010040607303380966, -0.24764618277549744, 0.2318798303604126, 0.18702788650989532, -0.19989201426506042, -0.009462399408221245, -0.03356189280748367, 0.13236963748931885, -0.033775247633457184, -0.014331025071442127, -0.20233172178268433, 0.1880408525466919, -0.2555640935897827, -0.18967482447624207, -0.10879766196012497, 0.1271921843290329, 0.22016745805740356, -0.008416512049734592, -0.16948577761650085, 0.5179384350776672, -0.07714782655239105, 0.42850208282470703, -0.20941001176834106, -0.41302382946014404, 0.1095525398850441, -0.20821787416934967, 0.08409634977579117, 0.1855996698141098, 0.28604772686958313, -0.08314019441604614, 0.039018213748931885, 0.16519086062908173, 0.3459412455558777, -0.008625894784927368, 0.20085613429546356, -0.05550290644168854, 0.1962692141532898, -0.06609953939914703, -0.2026567906141281, -0.3105357587337494, 0.31442755460739136, -0.01715729385614395, -0.100227952003479, 0.12180323898792267, -0.1993052214384079, -0.06901096552610397, 0.2973478138446808, -0.1381823867559433, 0.12708324193954468, 0.01250055804848671, -0.12484712153673172, 0.0374254509806633, -0.1139940619468689, 0.1930995136499405, 0.3166133165359497, 0.254481703042984, 0.030798280611634254, 0.18100950121879578, -0.015278699807822704, -0.31333714723587036, 0.11153178662061691, 0.4160482883453369, 0.27414727210998535, 0.3199387788772583, 0.26635900139808655, 0.130859836935997, -0.3311670422554016, 0.0025771334767341614, 0.12468057125806808, 0.13432946801185608, -0.3879118263721466, 0.14147841930389404, -0.17230919003486633, 0.010895006358623505, -0.1655905842781067, -0.015731576830148697, 0.13711194694042206, -0.3592996895313263, 0.14831137657165527, 0.273460328578949, -0.18036800622940063, 0.22691547870635986, 0.17204934358596802, 0.19493010640144348, 0.11537089943885803, 0.01341309491544962, -0.14815177023410797, -0.288126677274704, -0.11784292012453079, 0.12480472028255463, -0.01985805295407772, -0.10284179449081421, -0.06958602368831635, -0.1179654523730278, -0.2728992700576782, -0.07235228270292282, -0.18258056044578552, 0.01067289337515831, -0.24637232720851898, 0.2902805507183075, 0.08194570988416672, 0.00995829701423645, -0.03466431424021721, -0.1664343774318695, 0.18160048127174377, -0.32624027132987976, -0.19395191967487335, 0.1671670526266098, 0.17241717875003815, -0.14634469151496887, -0.32961583137512207, -0.4586903750896454, -0.2527227997779846, -0.5875048041343689, 0.17562900483608246, -0.02663426660001278, 0.006818272173404694, 0.14953084290027618, 0.1508965790271759, -0.0795726329088211, 0.18683522939682007, 0.0265592522919178, -0.3225563168525696, -0.029219377785921097, 0.17992329597473145, -0.1308939903974533, -0.3285573124885559, -0.39009106159210205, 0.04171757400035858, 0.10503949224948883, -0.17820963263511658, -0.36624854803085327, -0.0844118595123291, -0.19923530519008636, -0.1024317815899849, -0.10577760636806488, -0.1867249757051468, 0.2444489598274231, -0.015652183443307877, -0.18163836002349854, -0.08130162954330444, 0.1175263375043869, 0.19603069126605988, 0.23335763812065125, -0.021858297288417816, -0.14194154739379883, 0.5061035752296448, 0.3703949749469757, 0.6176100373268127, 0.18731552362442017, 0.10551994293928146, 0.31445759534835815, 0.045079849660396576, 0.14763498306274414, -0.08469656854867935, -0.27763649821281433, -0.09981369972229004, -0.2564239799976349, -0.1070144921541214, 0.22404229640960693, -0.18322545289993286, -0.3932807147502899, -0.11363831162452698, -0.08527061343193054, -0.2626449167728424, -0.1321532279253006, 0.0074043432250618935, -0.05339924246072769, -0.06944894045591354, 0.0784478485584259, 0.14056819677352905, -0.03160110488533974, 0.13968169689178467, -0.11147348582744598, -0.00953596830368042, -0.061862967908382416, -0.12010931223630905, 0.2260674089193344, 0.3311765193939209, -0.3378653824329376, 0.16203844547271729, 0.19699810445308685, 0.5000758767127991, 0.10469935834407806, -0.27812886238098145, 0.08922618627548218, -0.14332261681556702, 0.683061420917511, 0.09304533153772354, -0.008257400244474411, 0.28827419877052307, 0.08569151163101196, -0.43444404006004333, -0.28601425886154175, -0.4717509150505066, -0.3482973575592041, 0.4689933955669403, 0.3483321964740753, -0.18084532022476196, 0.0684838742017746, 0.2937740981578827, -0.14978620409965515, -0.053392473608255386, -0.3663918673992157, -0.41720080375671387, -0.2109774351119995, -0.540665328502655, 0.15704020857810974, 0.24083773791790009, 0.060615453869104385, -0.26505860686302185, -0.223136305809021, 0.18832024931907654, -0.38938987255096436, -0.07040467858314514, 0.12069748342037201, 0.02509170211851597, -0.2181113064289093, 0.13499368727207184, 0.11031056940555573, -0.2780015766620636, 0.11094211786985397, 0.38355860114097595, 0.1404254138469696, -0.22586748003959656, 0.151200532913208, -0.0967918336391449, 0.17665965855121613, 0.2134207785129547, -0.1662386804819107, 0.10676384717226028, 0.22716759145259857, 0.25544291734695435, -0.06773935258388519, -0.2768837511539459, 0.4240023195743561, 0.09464451670646667, -0.055547475814819336, -0.2262602150440216, 0.29104486107826233, 0.11152954399585724, -0.013021104037761688, -0.25638431310653687, -0.3841747045516968, -0.17401766777038574, 0.5088536739349365, -0.05592695623636246, 0.971862256526947, -0.0076797232031822205, 0.10415945947170258, 0.23423710465431213, 0.013515152037143707, 0.22324314713478088, -0.5320963859558105, 0.2104571908712387, -0.1830863505601883, -0.2170652598142624, -0.0929083451628685, 0.0023523159325122833, 0.2818467915058136, 0.028335709124803543, -0.6256151795387268, 0.3931393623352051, -0.22754831612110138, 0.2500980794429779, 0.27581965923309326, -0.15813735127449036, -0.11348823457956314, 0.01143665798008442, 0.10786044597625732, 0.15361687541007996, 0.22152669727802277, 0.014906490221619606, -0.026207419112324715, -0.049496978521347046, 0.024307433515787125, -0.3104557991027832, -0.28512173891067505, 0.21061545610427856, -0.1768827885389328, 0.27332621812820435, -0.14647580683231354, -0.01131325215101242, -0.10746991634368896, 0.0769825130701065, 0.11276520788669586, 0.12540489435195923, 0.03372062370181084, 0.2948944866657257, 0.4090304672718048, -0.11201118677854538, -0.07986444979906082, -0.006996858865022659, 0.28204259276390076, -0.17962563037872314, -0.44541695713996887, 0.15054713189601898, 0.029592856764793396, -0.2683076858520508, -0.06669247895479202, 0.07839103043079376, 0.12780694663524628, -0.14203524589538574, 0.03676588460803032, -0.05468052625656128, -0.10566820204257965, -0.5616085529327393, 0.20474843680858612, -0.16554909944534302, -0.5234267711639404, -0.004801549017429352, -0.09438218176364899, -0.26396992802619934, -0.1703684777021408, 0.5786184072494507, 0.2982688248157501, 0.1315900981426239, 0.27890992164611816, 0.27079856395721436, -0.22617106139659882, -0.3052178919315338, -0.3912286162376404, -0.3081105947494507, -0.461759090423584, 0.3227306306362152, -0.29286015033721924, -0.32891321182250977, -0.019378436729311943, 0.30101504921913147, 0.2527630925178528, 0.19093114137649536, -0.3937869369983673, -0.4043690264225006, -0.03405047208070755, -0.0690455436706543, -0.24763821065425873, 0.09390382468700409, 0.3461208641529083, 0.1024467796087265, -0.14520372450351715, 0.22513316571712494, -0.43451938033103943, 0.0762353166937828, -0.43732601404190063, 0.08421843498945236, -0.03311122953891754, -0.43270573019981384, 0.016001472249627113, 0.05985153838992119, 0.28517448902130127, 0.5130840539932251, 0.03883949667215347, -0.29860132932662964, -0.14648394286632538, 0.07246381789445877, -0.0516030415892601, 0.218061625957489, 0.04447653144598007, 0.23123915493488312, -0.0924171507358551, 0.004134578630328178, 0.11229236423969269, 0.12910735607147217, 0.1253066509962082, 0.25788986682891846, 0.21300938725471497, 0.19094128906726837, 0.06911253184080124, 0.14945060014724731, -0.1460007131099701, 0.07199487090110779, 0.04776063188910484, 0.2505287826061249, 0.032356638461351395, 0.057240188121795654, -0.19702650606632233, 0.07830027490854263, 0.24139823019504547, 0.29544559121131897, 0.19695264101028442, -0.30904608964920044, -0.06407971680164337, -0.2424384504556656, 0.3684192895889282, 0.2857248783111572, -0.27671435475349426, -0.32796308398246765, 0.05144408717751503, 0.29178792238235474, -0.3037309944629669, -0.10747355967760086, 0.2246273308992386, 0.031188301742076874, 0.2117120325565338, 0.41002216935157776, 0.26558831334114075, -0.13050410151481628, 0.07893200218677521, 0.2028208076953888, 0.44677507877349854, 0.11475654691457748, 0.23355360329151154, 0.20922213792800903, 0.033410411328077316, -0.045159462839365005, -0.03142236918210983, -0.12502267956733704, 0.38584938645362854, 0.208402618765831, -0.22703707218170166, 0.18513816595077515, 0.0763770043849945, 0.2714921832084656, -0.036041513085365295, -0.2030750960111618, 0.42012134194374084, 0.17322880029678345, -0.18913891911506653, 0.17515435814857483, -0.030213937163352966, 0.32499536871910095, 0.09029513597488403, 0.04042845591902733, -0.36864638328552246, 0.4470277428627014, -0.3067397475242615, -0.25827091932296753, 0.029104582965373993, -0.16409489512443542, -0.36657798290252686, -0.07430056482553482, 0.14301669597625732, 0.15732279419898987, 0.18077853322029114, -0.1745488941669464, -0.0007301047444343567, -0.4493136703968048, 0.01668662391602993, -0.14539042115211487, 0.15366558730602264, -0.331662118434906, 0.36883246898651123, 0.3560248017311096, -0.04831826686859131, 0.03861309587955475, 0.2497933954000473, 0.5516515970230103, 0.23689085245132446, 0.08863411843776703, -0.10070597380399704, -0.133080393075943, -0.17963407933712006, 0.02156105637550354, 0.29737335443496704, 0.05469891428947449, 0.2801862359046936, 0.25292640924453735, 0.2499992847442627, -0.3064158856868744, 0.17817546427249908, 0.166832834482193, 0.08231629431247711, -0.35169434547424316, 0.3654627501964569, -0.13889198005199432, -0.07995457947254181, 0.037232521921396255, -0.006004847586154938, -0.621313214302063, 0.20344184339046478, 0.17056331038475037, -0.13540591299533844, 0.27483704686164856, 0.10236739367246628, 0.14151276648044586, 0.128398135304451, 0.2728537321090698, 0.430616170167923, -0.023931309580802917, -0.12735368311405182, 0.04614618420600891, -0.5907896757125854, 0.29000166058540344, -0.010655440390110016, 0.15430760383605957, 0.031294893473386765, 0.17628179490566254, 0.06476154923439026, 0.25365176796913147, 0.020691461861133575, 0.19806261360645294, -0.23743607103824615, 0.1772514283657074, -0.3172696530818939, -0.09884749352931976, 0.1656845211982727, -0.18855687975883484, 0.16580583155155182, -0.2474755048751831, -0.10105453431606293, -0.0411364883184433, 0.1542104184627533, 0.05016300082206726, -0.11118286848068237, 0.0512753389775753, -0.5227717161178589, 0.2405424267053604, -0.07049909979104996, 0.39244720339775085, -0.06398584693670273, 0.0052165742963552475, -0.10991664230823517, -0.18604923784732819, -0.15770651400089264, -0.14378789067268372, 0.267167329788208, 0.28911763429641724, -0.20842835307121277, 0.0029532015323638916, -0.16105230152606964, 0.2793019413948059, 0.11473460495471954, -0.27989405393600464, -0.2739177346229553, 0.23141004145145416, -0.07681458443403244, 0.04042689874768257, -0.11915448307991028, 0.07027163356542587, -0.02242901921272278, 0.14966709911823273, -0.09503009170293808, -0.6964723467826843, 0.5653486251831055, -0.17772148549556732, -0.32815852761268616, -0.1417374163866043, 0.02804725617170334, 0.15118417143821716, 0.10477596521377563, -0.6984158754348755, 0.06565704196691513, 0.3078497648239136, 0.08973857015371323, -0.25737428665161133, 0.38224923610687256, -0.04869890958070755, -0.156285360455513, -0.14871789515018463, -0.032942041754722595, 0.1751323640346527, -0.12118873000144958, 0.15606079995632172, -0.33095985651016235 ]
https://github.com/huggingface/datasets/issues/5081
Bug loading `sentence-transformers/parallel-sentences`
There are more issues in the dataset. To load OpenSubtitles I have to provide this (see `skiprows`): ```python df_os = pd.read_csv( "./parallel-sentences/OpenSubtitles/OpenSubtitles-en-de-train.tsv.gz", sep="\t", quoting=csv.QUOTE_NONE, header=None, names=["en", "de"], skiprows=[540344, 9151700, 10040173, 10040199, 11314673, 11338258, 11869223, 12159297, 12251078, 12303334], ) ```
## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2
39
Bug loading `sentence-transformers/parallel-sentences` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2 There are more issues in the dataset. To load OpenSubtitles I have to provide this (see `skiprows`): ```python df_os = pd.read_csv( "./parallel-sentences/OpenSubtitles/OpenSubtitles-en-de-train.tsv.gz", sep="\t", quoting=csv.QUOTE_NONE, header=None, names=["en", "de"], skiprows=[540344, 9151700, 10040173, 10040199, 11314673, 11338258, 11869223, 12159297, 12251078, 12303334], ) ```
[ -0.0064447298645973206, -0.30189454555511475, -0.07506976276636124, 0.1588544398546219, 0.19041398167610168, 0.014945738017559052, 0.5312554240226746, 0.17734768986701965, -0.1279134452342987, 0.1705007553100586, -0.08514212816953659, 0.3792472183704376, 0.0759563222527504, -0.5006234049797058, -0.1747632771730423, -0.23892077803611755, 0.1334494650363922, 0.023917123675346375, -0.08517459034919739, -0.060156408697366714, -0.2757093608379364, 0.3060179650783539, -0.3254345655441284, -0.14870671927928925, -0.052077699452638626, 0.10794337838888168, -0.15572910010814667, 0.18705973029136658, -0.11709804087877274, -0.3488713502883911, -0.1775350719690323, 0.17408081889152527, 0.0308830589056015, 0.5999956130981445, -0.0001066906625055708, -0.013138141483068466, 0.35849058628082275, -0.02927335351705551, -0.3431011736392975, -0.3456762433052063, 0.08296071738004684, -0.20873510837554932, 0.17962966859340668, -0.23282426595687866, 0.024374503642320633, -0.028689008206129074, -0.05301748216152191, -0.1924591064453125, 0.4333108067512512, 0.2688455283641815, 0.26302194595336914, 0.4947151839733124, 0.049459923058748245, -0.34784436225891113, 0.17156118154525757, -0.4469722509384155, -0.004480578005313873, 0.32126885652542114, 0.23900829255580902, -0.006804360076785088, -0.18007001280784607, 0.23720405995845795, -0.2235061377286911, 0.10836274921894073, -0.05765172839164734, -0.1336098611354828, 0.1073879599571228, -0.12355479598045349, -0.022797882556915283, 0.09546566009521484, 0.14273759722709656, -0.19485753774642944, -0.306570440530777, -0.2380044162273407, -0.12717358767986298, 0.07430771738290787, -0.045722149312496185, 0.06358306854963303, -0.1463688611984253, 0.21348771452903748, -0.0801163837313652, 0.04967768117785454, 0.024496935307979584, 0.042993150651454926, -0.18713317811489105, 0.6275644302368164, -0.03261946886777878, 0.06727271527051926, 0.457787424325943, 0.13827495276927948, 0.2553781270980835, 0.1064307764172554, -0.09224765002727509, 0.04941602423787117, -0.40965428948402405, -0.017700523138046265, 0.03441757336258888, -0.6007848978042603, 0.06016311049461365, -0.038165442645549774, 0.26910069584846497, -0.11763546615839005, 0.27582451701164246, 0.27960091829299927, 0.16723188757896423, 0.4024121165275574, -0.0980280265212059, 0.27040770649909973, 0.09447477757930756, 0.20300757884979248, 0.1548592448234558, -0.023763880133628845, -0.2978023290634155, -0.05027379095554352, 0.13370530307292938, 0.25796759128570557, 0.15892677009105682, 0.02456102892756462, -0.2529754340648651, -0.033022500574588776, -0.17613235116004944, 0.08163989335298538, -0.14542058110237122, 0.31668218970298767, 0.061993639916181564, 0.5051547288894653, -0.01410311833024025, 0.33983278274536133, -0.21555368602275848, -0.3661046326160431, -0.302417516708374, -0.010695889592170715, -0.08157778531312943, -0.03117014281451702, 0.08639980852603912, 0.3753650188446045, 0.3308446705341339, -0.01330053061246872, 0.03540246933698654, -0.3427397906780243, -0.1832977831363678, -0.18738315999507904, -0.1596876084804535, 0.14377273619174957, 0.054959144443273544, 0.04971867799758911, 0.28612813353538513, -0.0885724201798439, 0.10844973474740982, 0.20334583520889282, -0.1913335919380188, -0.1652156412601471, -0.2204935997724533, 0.2975698709487915, -0.11682407557964325, -0.17014102637767792, 0.034467048943042755, 0.12843842804431915, 0.4836467206478119, -0.007964514195919037, 0.07959575206041336, -0.07703724503517151, -0.25884878635406494, -0.1898820698261261, -0.028599631041288376, 0.3697071671485901, -0.5592251420021057, -0.2589382529258728, 0.08216510713100433, 0.0875033587217331, 0.3078323006629944, 0.4528600573539734, -0.16454672813415527, -0.003662019968032837, -0.046266309916973114, 0.24651966989040375, 0.13833880424499512, -0.32555127143859863, -0.18328382074832916, 0.3252902626991272, -0.35065513849258423, 0.21282456815242767, 0.2190699577331543, -0.1586511731147766, 0.44434502720832825, -0.019075818359851837, 0.35723721981048584, 0.11952225863933563, 0.27844271063804626, 0.06714479625225067, -0.44459158182144165, -0.19816458225250244, -0.08778113126754761, -0.0606895349919796, 0.1802307665348053, 0.14801663160324097, 0.030956752598285675, -0.08406280726194382, 0.2860587537288666, 0.0157117061316967, -0.02305910550057888, 0.17892995476722717, 0.09859849512577057, 0.19263958930969238, 0.16923725605010986, 0.07405708730220795, -0.21406376361846924, 0.16752099990844727, -0.021393198519945145, 0.16068170964717865, -0.17302627861499786, -0.20577766001224518, -0.26034513115882874, -0.0595531091094017, 0.010040607303380966, -0.24764618277549744, 0.2318798303604126, 0.18702788650989532, -0.19989201426506042, -0.009462399408221245, -0.03356189280748367, 0.13236963748931885, -0.033775247633457184, -0.014331025071442127, -0.20233172178268433, 0.1880408525466919, -0.2555640935897827, -0.18967482447624207, -0.10879766196012497, 0.1271921843290329, 0.22016745805740356, -0.008416512049734592, -0.16948577761650085, 0.5179384350776672, -0.07714782655239105, 0.42850208282470703, -0.20941001176834106, -0.41302382946014404, 0.1095525398850441, -0.20821787416934967, 0.08409634977579117, 0.1855996698141098, 0.28604772686958313, -0.08314019441604614, 0.039018213748931885, 0.16519086062908173, 0.3459412455558777, -0.008625894784927368, 0.20085613429546356, -0.05550290644168854, 0.1962692141532898, -0.06609953939914703, -0.2026567906141281, -0.3105357587337494, 0.31442755460739136, -0.01715729385614395, -0.100227952003479, 0.12180323898792267, -0.1993052214384079, -0.06901096552610397, 0.2973478138446808, -0.1381823867559433, 0.12708324193954468, 0.01250055804848671, -0.12484712153673172, 0.0374254509806633, -0.1139940619468689, 0.1930995136499405, 0.3166133165359497, 0.254481703042984, 0.030798280611634254, 0.18100950121879578, -0.015278699807822704, -0.31333714723587036, 0.11153178662061691, 0.4160482883453369, 0.27414727210998535, 0.3199387788772583, 0.26635900139808655, 0.130859836935997, -0.3311670422554016, 0.0025771334767341614, 0.12468057125806808, 0.13432946801185608, -0.3879118263721466, 0.14147841930389404, -0.17230919003486633, 0.010895006358623505, -0.1655905842781067, -0.015731576830148697, 0.13711194694042206, -0.3592996895313263, 0.14831137657165527, 0.273460328578949, -0.18036800622940063, 0.22691547870635986, 0.17204934358596802, 0.19493010640144348, 0.11537089943885803, 0.01341309491544962, -0.14815177023410797, -0.288126677274704, -0.11784292012453079, 0.12480472028255463, -0.01985805295407772, -0.10284179449081421, -0.06958602368831635, -0.1179654523730278, -0.2728992700576782, -0.07235228270292282, -0.18258056044578552, 0.01067289337515831, -0.24637232720851898, 0.2902805507183075, 0.08194570988416672, 0.00995829701423645, -0.03466431424021721, -0.1664343774318695, 0.18160048127174377, -0.32624027132987976, -0.19395191967487335, 0.1671670526266098, 0.17241717875003815, -0.14634469151496887, -0.32961583137512207, -0.4586903750896454, -0.2527227997779846, -0.5875048041343689, 0.17562900483608246, -0.02663426660001278, 0.006818272173404694, 0.14953084290027618, 0.1508965790271759, -0.0795726329088211, 0.18683522939682007, 0.0265592522919178, -0.3225563168525696, -0.029219377785921097, 0.17992329597473145, -0.1308939903974533, -0.3285573124885559, -0.39009106159210205, 0.04171757400035858, 0.10503949224948883, -0.17820963263511658, -0.36624854803085327, -0.0844118595123291, -0.19923530519008636, -0.1024317815899849, -0.10577760636806488, -0.1867249757051468, 0.2444489598274231, -0.015652183443307877, -0.18163836002349854, -0.08130162954330444, 0.1175263375043869, 0.19603069126605988, 0.23335763812065125, -0.021858297288417816, -0.14194154739379883, 0.5061035752296448, 0.3703949749469757, 0.6176100373268127, 0.18731552362442017, 0.10551994293928146, 0.31445759534835815, 0.045079849660396576, 0.14763498306274414, -0.08469656854867935, -0.27763649821281433, -0.09981369972229004, -0.2564239799976349, -0.1070144921541214, 0.22404229640960693, -0.18322545289993286, -0.3932807147502899, -0.11363831162452698, -0.08527061343193054, -0.2626449167728424, -0.1321532279253006, 0.0074043432250618935, -0.05339924246072769, -0.06944894045591354, 0.0784478485584259, 0.14056819677352905, -0.03160110488533974, 0.13968169689178467, -0.11147348582744598, -0.00953596830368042, -0.061862967908382416, -0.12010931223630905, 0.2260674089193344, 0.3311765193939209, -0.3378653824329376, 0.16203844547271729, 0.19699810445308685, 0.5000758767127991, 0.10469935834407806, -0.27812886238098145, 0.08922618627548218, -0.14332261681556702, 0.683061420917511, 0.09304533153772354, -0.008257400244474411, 0.28827419877052307, 0.08569151163101196, -0.43444404006004333, -0.28601425886154175, -0.4717509150505066, -0.3482973575592041, 0.4689933955669403, 0.3483321964740753, -0.18084532022476196, 0.0684838742017746, 0.2937740981578827, -0.14978620409965515, -0.053392473608255386, -0.3663918673992157, -0.41720080375671387, -0.2109774351119995, -0.540665328502655, 0.15704020857810974, 0.24083773791790009, 0.060615453869104385, -0.26505860686302185, -0.223136305809021, 0.18832024931907654, -0.38938987255096436, -0.07040467858314514, 0.12069748342037201, 0.02509170211851597, -0.2181113064289093, 0.13499368727207184, 0.11031056940555573, -0.2780015766620636, 0.11094211786985397, 0.38355860114097595, 0.1404254138469696, -0.22586748003959656, 0.151200532913208, -0.0967918336391449, 0.17665965855121613, 0.2134207785129547, -0.1662386804819107, 0.10676384717226028, 0.22716759145259857, 0.25544291734695435, -0.06773935258388519, -0.2768837511539459, 0.4240023195743561, 0.09464451670646667, -0.055547475814819336, -0.2262602150440216, 0.29104486107826233, 0.11152954399585724, -0.013021104037761688, -0.25638431310653687, -0.3841747045516968, -0.17401766777038574, 0.5088536739349365, -0.05592695623636246, 0.971862256526947, -0.0076797232031822205, 0.10415945947170258, 0.23423710465431213, 0.013515152037143707, 0.22324314713478088, -0.5320963859558105, 0.2104571908712387, -0.1830863505601883, -0.2170652598142624, -0.0929083451628685, 0.0023523159325122833, 0.2818467915058136, 0.028335709124803543, -0.6256151795387268, 0.3931393623352051, -0.22754831612110138, 0.2500980794429779, 0.27581965923309326, -0.15813735127449036, -0.11348823457956314, 0.01143665798008442, 0.10786044597625732, 0.15361687541007996, 0.22152669727802277, 0.014906490221619606, -0.026207419112324715, -0.049496978521347046, 0.024307433515787125, -0.3104557991027832, -0.28512173891067505, 0.21061545610427856, -0.1768827885389328, 0.27332621812820435, -0.14647580683231354, -0.01131325215101242, -0.10746991634368896, 0.0769825130701065, 0.11276520788669586, 0.12540489435195923, 0.03372062370181084, 0.2948944866657257, 0.4090304672718048, -0.11201118677854538, -0.07986444979906082, -0.006996858865022659, 0.28204259276390076, -0.17962563037872314, -0.44541695713996887, 0.15054713189601898, 0.029592856764793396, -0.2683076858520508, -0.06669247895479202, 0.07839103043079376, 0.12780694663524628, -0.14203524589538574, 0.03676588460803032, -0.05468052625656128, -0.10566820204257965, -0.5616085529327393, 0.20474843680858612, -0.16554909944534302, -0.5234267711639404, -0.004801549017429352, -0.09438218176364899, -0.26396992802619934, -0.1703684777021408, 0.5786184072494507, 0.2982688248157501, 0.1315900981426239, 0.27890992164611816, 0.27079856395721436, -0.22617106139659882, -0.3052178919315338, -0.3912286162376404, -0.3081105947494507, -0.461759090423584, 0.3227306306362152, -0.29286015033721924, -0.32891321182250977, -0.019378436729311943, 0.30101504921913147, 0.2527630925178528, 0.19093114137649536, -0.3937869369983673, -0.4043690264225006, -0.03405047208070755, -0.0690455436706543, -0.24763821065425873, 0.09390382468700409, 0.3461208641529083, 0.1024467796087265, -0.14520372450351715, 0.22513316571712494, -0.43451938033103943, 0.0762353166937828, -0.43732601404190063, 0.08421843498945236, -0.03311122953891754, -0.43270573019981384, 0.016001472249627113, 0.05985153838992119, 0.28517448902130127, 0.5130840539932251, 0.03883949667215347, -0.29860132932662964, -0.14648394286632538, 0.07246381789445877, -0.0516030415892601, 0.218061625957489, 0.04447653144598007, 0.23123915493488312, -0.0924171507358551, 0.004134578630328178, 0.11229236423969269, 0.12910735607147217, 0.1253066509962082, 0.25788986682891846, 0.21300938725471497, 0.19094128906726837, 0.06911253184080124, 0.14945060014724731, -0.1460007131099701, 0.07199487090110779, 0.04776063188910484, 0.2505287826061249, 0.032356638461351395, 0.057240188121795654, -0.19702650606632233, 0.07830027490854263, 0.24139823019504547, 0.29544559121131897, 0.19695264101028442, -0.30904608964920044, -0.06407971680164337, -0.2424384504556656, 0.3684192895889282, 0.2857248783111572, -0.27671435475349426, -0.32796308398246765, 0.05144408717751503, 0.29178792238235474, -0.3037309944629669, -0.10747355967760086, 0.2246273308992386, 0.031188301742076874, 0.2117120325565338, 0.41002216935157776, 0.26558831334114075, -0.13050410151481628, 0.07893200218677521, 0.2028208076953888, 0.44677507877349854, 0.11475654691457748, 0.23355360329151154, 0.20922213792800903, 0.033410411328077316, -0.045159462839365005, -0.03142236918210983, -0.12502267956733704, 0.38584938645362854, 0.208402618765831, -0.22703707218170166, 0.18513816595077515, 0.0763770043849945, 0.2714921832084656, -0.036041513085365295, -0.2030750960111618, 0.42012134194374084, 0.17322880029678345, -0.18913891911506653, 0.17515435814857483, -0.030213937163352966, 0.32499536871910095, 0.09029513597488403, 0.04042845591902733, -0.36864638328552246, 0.4470277428627014, -0.3067397475242615, -0.25827091932296753, 0.029104582965373993, -0.16409489512443542, -0.36657798290252686, -0.07430056482553482, 0.14301669597625732, 0.15732279419898987, 0.18077853322029114, -0.1745488941669464, -0.0007301047444343567, -0.4493136703968048, 0.01668662391602993, -0.14539042115211487, 0.15366558730602264, -0.331662118434906, 0.36883246898651123, 0.3560248017311096, -0.04831826686859131, 0.03861309587955475, 0.2497933954000473, 0.5516515970230103, 0.23689085245132446, 0.08863411843776703, -0.10070597380399704, -0.133080393075943, -0.17963407933712006, 0.02156105637550354, 0.29737335443496704, 0.05469891428947449, 0.2801862359046936, 0.25292640924453735, 0.2499992847442627, -0.3064158856868744, 0.17817546427249908, 0.166832834482193, 0.08231629431247711, -0.35169434547424316, 0.3654627501964569, -0.13889198005199432, -0.07995457947254181, 0.037232521921396255, -0.006004847586154938, -0.621313214302063, 0.20344184339046478, 0.17056331038475037, -0.13540591299533844, 0.27483704686164856, 0.10236739367246628, 0.14151276648044586, 0.128398135304451, 0.2728537321090698, 0.430616170167923, -0.023931309580802917, -0.12735368311405182, 0.04614618420600891, -0.5907896757125854, 0.29000166058540344, -0.010655440390110016, 0.15430760383605957, 0.031294893473386765, 0.17628179490566254, 0.06476154923439026, 0.25365176796913147, 0.020691461861133575, 0.19806261360645294, -0.23743607103824615, 0.1772514283657074, -0.3172696530818939, -0.09884749352931976, 0.1656845211982727, -0.18855687975883484, 0.16580583155155182, -0.2474755048751831, -0.10105453431606293, -0.0411364883184433, 0.1542104184627533, 0.05016300082206726, -0.11118286848068237, 0.0512753389775753, -0.5227717161178589, 0.2405424267053604, -0.07049909979104996, 0.39244720339775085, -0.06398584693670273, 0.0052165742963552475, -0.10991664230823517, -0.18604923784732819, -0.15770651400089264, -0.14378789067268372, 0.267167329788208, 0.28911763429641724, -0.20842835307121277, 0.0029532015323638916, -0.16105230152606964, 0.2793019413948059, 0.11473460495471954, -0.27989405393600464, -0.2739177346229553, 0.23141004145145416, -0.07681458443403244, 0.04042689874768257, -0.11915448307991028, 0.07027163356542587, -0.02242901921272278, 0.14966709911823273, -0.09503009170293808, -0.6964723467826843, 0.5653486251831055, -0.17772148549556732, -0.32815852761268616, -0.1417374163866043, 0.02804725617170334, 0.15118417143821716, 0.10477596521377563, -0.6984158754348755, 0.06565704196691513, 0.3078497648239136, 0.08973857015371323, -0.25737428665161133, 0.38224923610687256, -0.04869890958070755, -0.156285360455513, -0.14871789515018463, -0.032942041754722595, 0.1751323640346527, -0.12118873000144958, 0.15606079995632172, -0.33095985651016235 ]
https://github.com/huggingface/datasets/issues/5081
Bug loading `sentence-transformers/parallel-sentences`
What's wrong with those lines exactly ? Maybe passing `error_bad_lines=False` (and maybe `warn_bad_lines=True`) can be helpful
## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2
16
Bug loading `sentence-transformers/parallel-sentences` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2 What's wrong with those lines exactly ? Maybe passing `error_bad_lines=False` (and maybe `warn_bad_lines=True`) can be helpful
[ -0.0064447298645973206, -0.30189454555511475, -0.07506976276636124, 0.1588544398546219, 0.19041398167610168, 0.014945738017559052, 0.5312554240226746, 0.17734768986701965, -0.1279134452342987, 0.1705007553100586, -0.08514212816953659, 0.3792472183704376, 0.0759563222527504, -0.5006234049797058, -0.1747632771730423, -0.23892077803611755, 0.1334494650363922, 0.023917123675346375, -0.08517459034919739, -0.060156408697366714, -0.2757093608379364, 0.3060179650783539, -0.3254345655441284, -0.14870671927928925, -0.052077699452638626, 0.10794337838888168, -0.15572910010814667, 0.18705973029136658, -0.11709804087877274, -0.3488713502883911, -0.1775350719690323, 0.17408081889152527, 0.0308830589056015, 0.5999956130981445, -0.0001066906625055708, -0.013138141483068466, 0.35849058628082275, -0.02927335351705551, -0.3431011736392975, -0.3456762433052063, 0.08296071738004684, -0.20873510837554932, 0.17962966859340668, -0.23282426595687866, 0.024374503642320633, -0.028689008206129074, -0.05301748216152191, -0.1924591064453125, 0.4333108067512512, 0.2688455283641815, 0.26302194595336914, 0.4947151839733124, 0.049459923058748245, -0.34784436225891113, 0.17156118154525757, -0.4469722509384155, -0.004480578005313873, 0.32126885652542114, 0.23900829255580902, -0.006804360076785088, -0.18007001280784607, 0.23720405995845795, -0.2235061377286911, 0.10836274921894073, -0.05765172839164734, -0.1336098611354828, 0.1073879599571228, -0.12355479598045349, -0.022797882556915283, 0.09546566009521484, 0.14273759722709656, -0.19485753774642944, -0.306570440530777, -0.2380044162273407, -0.12717358767986298, 0.07430771738290787, -0.045722149312496185, 0.06358306854963303, -0.1463688611984253, 0.21348771452903748, -0.0801163837313652, 0.04967768117785454, 0.024496935307979584, 0.042993150651454926, -0.18713317811489105, 0.6275644302368164, -0.03261946886777878, 0.06727271527051926, 0.457787424325943, 0.13827495276927948, 0.2553781270980835, 0.1064307764172554, -0.09224765002727509, 0.04941602423787117, -0.40965428948402405, -0.017700523138046265, 0.03441757336258888, -0.6007848978042603, 0.06016311049461365, -0.038165442645549774, 0.26910069584846497, -0.11763546615839005, 0.27582451701164246, 0.27960091829299927, 0.16723188757896423, 0.4024121165275574, -0.0980280265212059, 0.27040770649909973, 0.09447477757930756, 0.20300757884979248, 0.1548592448234558, -0.023763880133628845, -0.2978023290634155, -0.05027379095554352, 0.13370530307292938, 0.25796759128570557, 0.15892677009105682, 0.02456102892756462, -0.2529754340648651, -0.033022500574588776, -0.17613235116004944, 0.08163989335298538, -0.14542058110237122, 0.31668218970298767, 0.061993639916181564, 0.5051547288894653, -0.01410311833024025, 0.33983278274536133, -0.21555368602275848, -0.3661046326160431, -0.302417516708374, -0.010695889592170715, -0.08157778531312943, -0.03117014281451702, 0.08639980852603912, 0.3753650188446045, 0.3308446705341339, -0.01330053061246872, 0.03540246933698654, -0.3427397906780243, -0.1832977831363678, -0.18738315999507904, -0.1596876084804535, 0.14377273619174957, 0.054959144443273544, 0.04971867799758911, 0.28612813353538513, -0.0885724201798439, 0.10844973474740982, 0.20334583520889282, -0.1913335919380188, -0.1652156412601471, -0.2204935997724533, 0.2975698709487915, -0.11682407557964325, -0.17014102637767792, 0.034467048943042755, 0.12843842804431915, 0.4836467206478119, -0.007964514195919037, 0.07959575206041336, -0.07703724503517151, -0.25884878635406494, -0.1898820698261261, -0.028599631041288376, 0.3697071671485901, -0.5592251420021057, -0.2589382529258728, 0.08216510713100433, 0.0875033587217331, 0.3078323006629944, 0.4528600573539734, -0.16454672813415527, -0.003662019968032837, -0.046266309916973114, 0.24651966989040375, 0.13833880424499512, -0.32555127143859863, -0.18328382074832916, 0.3252902626991272, -0.35065513849258423, 0.21282456815242767, 0.2190699577331543, -0.1586511731147766, 0.44434502720832825, -0.019075818359851837, 0.35723721981048584, 0.11952225863933563, 0.27844271063804626, 0.06714479625225067, -0.44459158182144165, -0.19816458225250244, -0.08778113126754761, -0.0606895349919796, 0.1802307665348053, 0.14801663160324097, 0.030956752598285675, -0.08406280726194382, 0.2860587537288666, 0.0157117061316967, -0.02305910550057888, 0.17892995476722717, 0.09859849512577057, 0.19263958930969238, 0.16923725605010986, 0.07405708730220795, -0.21406376361846924, 0.16752099990844727, -0.021393198519945145, 0.16068170964717865, -0.17302627861499786, -0.20577766001224518, -0.26034513115882874, -0.0595531091094017, 0.010040607303380966, -0.24764618277549744, 0.2318798303604126, 0.18702788650989532, -0.19989201426506042, -0.009462399408221245, -0.03356189280748367, 0.13236963748931885, -0.033775247633457184, -0.014331025071442127, -0.20233172178268433, 0.1880408525466919, -0.2555640935897827, -0.18967482447624207, -0.10879766196012497, 0.1271921843290329, 0.22016745805740356, -0.008416512049734592, -0.16948577761650085, 0.5179384350776672, -0.07714782655239105, 0.42850208282470703, -0.20941001176834106, -0.41302382946014404, 0.1095525398850441, -0.20821787416934967, 0.08409634977579117, 0.1855996698141098, 0.28604772686958313, -0.08314019441604614, 0.039018213748931885, 0.16519086062908173, 0.3459412455558777, -0.008625894784927368, 0.20085613429546356, -0.05550290644168854, 0.1962692141532898, -0.06609953939914703, -0.2026567906141281, -0.3105357587337494, 0.31442755460739136, -0.01715729385614395, -0.100227952003479, 0.12180323898792267, -0.1993052214384079, -0.06901096552610397, 0.2973478138446808, -0.1381823867559433, 0.12708324193954468, 0.01250055804848671, -0.12484712153673172, 0.0374254509806633, -0.1139940619468689, 0.1930995136499405, 0.3166133165359497, 0.254481703042984, 0.030798280611634254, 0.18100950121879578, -0.015278699807822704, -0.31333714723587036, 0.11153178662061691, 0.4160482883453369, 0.27414727210998535, 0.3199387788772583, 0.26635900139808655, 0.130859836935997, -0.3311670422554016, 0.0025771334767341614, 0.12468057125806808, 0.13432946801185608, -0.3879118263721466, 0.14147841930389404, -0.17230919003486633, 0.010895006358623505, -0.1655905842781067, -0.015731576830148697, 0.13711194694042206, -0.3592996895313263, 0.14831137657165527, 0.273460328578949, -0.18036800622940063, 0.22691547870635986, 0.17204934358596802, 0.19493010640144348, 0.11537089943885803, 0.01341309491544962, -0.14815177023410797, -0.288126677274704, -0.11784292012453079, 0.12480472028255463, -0.01985805295407772, -0.10284179449081421, -0.06958602368831635, -0.1179654523730278, -0.2728992700576782, -0.07235228270292282, -0.18258056044578552, 0.01067289337515831, -0.24637232720851898, 0.2902805507183075, 0.08194570988416672, 0.00995829701423645, -0.03466431424021721, -0.1664343774318695, 0.18160048127174377, -0.32624027132987976, -0.19395191967487335, 0.1671670526266098, 0.17241717875003815, -0.14634469151496887, -0.32961583137512207, -0.4586903750896454, -0.2527227997779846, -0.5875048041343689, 0.17562900483608246, -0.02663426660001278, 0.006818272173404694, 0.14953084290027618, 0.1508965790271759, -0.0795726329088211, 0.18683522939682007, 0.0265592522919178, -0.3225563168525696, -0.029219377785921097, 0.17992329597473145, -0.1308939903974533, -0.3285573124885559, -0.39009106159210205, 0.04171757400035858, 0.10503949224948883, -0.17820963263511658, -0.36624854803085327, -0.0844118595123291, -0.19923530519008636, -0.1024317815899849, -0.10577760636806488, -0.1867249757051468, 0.2444489598274231, -0.015652183443307877, -0.18163836002349854, -0.08130162954330444, 0.1175263375043869, 0.19603069126605988, 0.23335763812065125, -0.021858297288417816, -0.14194154739379883, 0.5061035752296448, 0.3703949749469757, 0.6176100373268127, 0.18731552362442017, 0.10551994293928146, 0.31445759534835815, 0.045079849660396576, 0.14763498306274414, -0.08469656854867935, -0.27763649821281433, -0.09981369972229004, -0.2564239799976349, -0.1070144921541214, 0.22404229640960693, -0.18322545289993286, -0.3932807147502899, -0.11363831162452698, -0.08527061343193054, -0.2626449167728424, -0.1321532279253006, 0.0074043432250618935, -0.05339924246072769, -0.06944894045591354, 0.0784478485584259, 0.14056819677352905, -0.03160110488533974, 0.13968169689178467, -0.11147348582744598, -0.00953596830368042, -0.061862967908382416, -0.12010931223630905, 0.2260674089193344, 0.3311765193939209, -0.3378653824329376, 0.16203844547271729, 0.19699810445308685, 0.5000758767127991, 0.10469935834407806, -0.27812886238098145, 0.08922618627548218, -0.14332261681556702, 0.683061420917511, 0.09304533153772354, -0.008257400244474411, 0.28827419877052307, 0.08569151163101196, -0.43444404006004333, -0.28601425886154175, -0.4717509150505066, -0.3482973575592041, 0.4689933955669403, 0.3483321964740753, -0.18084532022476196, 0.0684838742017746, 0.2937740981578827, -0.14978620409965515, -0.053392473608255386, -0.3663918673992157, -0.41720080375671387, -0.2109774351119995, -0.540665328502655, 0.15704020857810974, 0.24083773791790009, 0.060615453869104385, -0.26505860686302185, -0.223136305809021, 0.18832024931907654, -0.38938987255096436, -0.07040467858314514, 0.12069748342037201, 0.02509170211851597, -0.2181113064289093, 0.13499368727207184, 0.11031056940555573, -0.2780015766620636, 0.11094211786985397, 0.38355860114097595, 0.1404254138469696, -0.22586748003959656, 0.151200532913208, -0.0967918336391449, 0.17665965855121613, 0.2134207785129547, -0.1662386804819107, 0.10676384717226028, 0.22716759145259857, 0.25544291734695435, -0.06773935258388519, -0.2768837511539459, 0.4240023195743561, 0.09464451670646667, -0.055547475814819336, -0.2262602150440216, 0.29104486107826233, 0.11152954399585724, -0.013021104037761688, -0.25638431310653687, -0.3841747045516968, -0.17401766777038574, 0.5088536739349365, -0.05592695623636246, 0.971862256526947, -0.0076797232031822205, 0.10415945947170258, 0.23423710465431213, 0.013515152037143707, 0.22324314713478088, -0.5320963859558105, 0.2104571908712387, -0.1830863505601883, -0.2170652598142624, -0.0929083451628685, 0.0023523159325122833, 0.2818467915058136, 0.028335709124803543, -0.6256151795387268, 0.3931393623352051, -0.22754831612110138, 0.2500980794429779, 0.27581965923309326, -0.15813735127449036, -0.11348823457956314, 0.01143665798008442, 0.10786044597625732, 0.15361687541007996, 0.22152669727802277, 0.014906490221619606, -0.026207419112324715, -0.049496978521347046, 0.024307433515787125, -0.3104557991027832, -0.28512173891067505, 0.21061545610427856, -0.1768827885389328, 0.27332621812820435, -0.14647580683231354, -0.01131325215101242, -0.10746991634368896, 0.0769825130701065, 0.11276520788669586, 0.12540489435195923, 0.03372062370181084, 0.2948944866657257, 0.4090304672718048, -0.11201118677854538, -0.07986444979906082, -0.006996858865022659, 0.28204259276390076, -0.17962563037872314, -0.44541695713996887, 0.15054713189601898, 0.029592856764793396, -0.2683076858520508, -0.06669247895479202, 0.07839103043079376, 0.12780694663524628, -0.14203524589538574, 0.03676588460803032, -0.05468052625656128, -0.10566820204257965, -0.5616085529327393, 0.20474843680858612, -0.16554909944534302, -0.5234267711639404, -0.004801549017429352, -0.09438218176364899, -0.26396992802619934, -0.1703684777021408, 0.5786184072494507, 0.2982688248157501, 0.1315900981426239, 0.27890992164611816, 0.27079856395721436, -0.22617106139659882, -0.3052178919315338, -0.3912286162376404, -0.3081105947494507, -0.461759090423584, 0.3227306306362152, -0.29286015033721924, -0.32891321182250977, -0.019378436729311943, 0.30101504921913147, 0.2527630925178528, 0.19093114137649536, -0.3937869369983673, -0.4043690264225006, -0.03405047208070755, -0.0690455436706543, -0.24763821065425873, 0.09390382468700409, 0.3461208641529083, 0.1024467796087265, -0.14520372450351715, 0.22513316571712494, -0.43451938033103943, 0.0762353166937828, -0.43732601404190063, 0.08421843498945236, -0.03311122953891754, -0.43270573019981384, 0.016001472249627113, 0.05985153838992119, 0.28517448902130127, 0.5130840539932251, 0.03883949667215347, -0.29860132932662964, -0.14648394286632538, 0.07246381789445877, -0.0516030415892601, 0.218061625957489, 0.04447653144598007, 0.23123915493488312, -0.0924171507358551, 0.004134578630328178, 0.11229236423969269, 0.12910735607147217, 0.1253066509962082, 0.25788986682891846, 0.21300938725471497, 0.19094128906726837, 0.06911253184080124, 0.14945060014724731, -0.1460007131099701, 0.07199487090110779, 0.04776063188910484, 0.2505287826061249, 0.032356638461351395, 0.057240188121795654, -0.19702650606632233, 0.07830027490854263, 0.24139823019504547, 0.29544559121131897, 0.19695264101028442, -0.30904608964920044, -0.06407971680164337, -0.2424384504556656, 0.3684192895889282, 0.2857248783111572, -0.27671435475349426, -0.32796308398246765, 0.05144408717751503, 0.29178792238235474, -0.3037309944629669, -0.10747355967760086, 0.2246273308992386, 0.031188301742076874, 0.2117120325565338, 0.41002216935157776, 0.26558831334114075, -0.13050410151481628, 0.07893200218677521, 0.2028208076953888, 0.44677507877349854, 0.11475654691457748, 0.23355360329151154, 0.20922213792800903, 0.033410411328077316, -0.045159462839365005, -0.03142236918210983, -0.12502267956733704, 0.38584938645362854, 0.208402618765831, -0.22703707218170166, 0.18513816595077515, 0.0763770043849945, 0.2714921832084656, -0.036041513085365295, -0.2030750960111618, 0.42012134194374084, 0.17322880029678345, -0.18913891911506653, 0.17515435814857483, -0.030213937163352966, 0.32499536871910095, 0.09029513597488403, 0.04042845591902733, -0.36864638328552246, 0.4470277428627014, -0.3067397475242615, -0.25827091932296753, 0.029104582965373993, -0.16409489512443542, -0.36657798290252686, -0.07430056482553482, 0.14301669597625732, 0.15732279419898987, 0.18077853322029114, -0.1745488941669464, -0.0007301047444343567, -0.4493136703968048, 0.01668662391602993, -0.14539042115211487, 0.15366558730602264, -0.331662118434906, 0.36883246898651123, 0.3560248017311096, -0.04831826686859131, 0.03861309587955475, 0.2497933954000473, 0.5516515970230103, 0.23689085245132446, 0.08863411843776703, -0.10070597380399704, -0.133080393075943, -0.17963407933712006, 0.02156105637550354, 0.29737335443496704, 0.05469891428947449, 0.2801862359046936, 0.25292640924453735, 0.2499992847442627, -0.3064158856868744, 0.17817546427249908, 0.166832834482193, 0.08231629431247711, -0.35169434547424316, 0.3654627501964569, -0.13889198005199432, -0.07995457947254181, 0.037232521921396255, -0.006004847586154938, -0.621313214302063, 0.20344184339046478, 0.17056331038475037, -0.13540591299533844, 0.27483704686164856, 0.10236739367246628, 0.14151276648044586, 0.128398135304451, 0.2728537321090698, 0.430616170167923, -0.023931309580802917, -0.12735368311405182, 0.04614618420600891, -0.5907896757125854, 0.29000166058540344, -0.010655440390110016, 0.15430760383605957, 0.031294893473386765, 0.17628179490566254, 0.06476154923439026, 0.25365176796913147, 0.020691461861133575, 0.19806261360645294, -0.23743607103824615, 0.1772514283657074, -0.3172696530818939, -0.09884749352931976, 0.1656845211982727, -0.18855687975883484, 0.16580583155155182, -0.2474755048751831, -0.10105453431606293, -0.0411364883184433, 0.1542104184627533, 0.05016300082206726, -0.11118286848068237, 0.0512753389775753, -0.5227717161178589, 0.2405424267053604, -0.07049909979104996, 0.39244720339775085, -0.06398584693670273, 0.0052165742963552475, -0.10991664230823517, -0.18604923784732819, -0.15770651400089264, -0.14378789067268372, 0.267167329788208, 0.28911763429641724, -0.20842835307121277, 0.0029532015323638916, -0.16105230152606964, 0.2793019413948059, 0.11473460495471954, -0.27989405393600464, -0.2739177346229553, 0.23141004145145416, -0.07681458443403244, 0.04042689874768257, -0.11915448307991028, 0.07027163356542587, -0.02242901921272278, 0.14966709911823273, -0.09503009170293808, -0.6964723467826843, 0.5653486251831055, -0.17772148549556732, -0.32815852761268616, -0.1417374163866043, 0.02804725617170334, 0.15118417143821716, 0.10477596521377563, -0.6984158754348755, 0.06565704196691513, 0.3078497648239136, 0.08973857015371323, -0.25737428665161133, 0.38224923610687256, -0.04869890958070755, -0.156285360455513, -0.14871789515018463, -0.032942041754722595, 0.1751323640346527, -0.12118873000144958, 0.15606079995632172, -0.33095985651016235 ]
https://github.com/huggingface/datasets/issues/5081
Bug loading `sentence-transformers/parallel-sentences`
> What's wrong with those lines exactly ? Stuff like this: `ParserError: Error tokenizing data. C error: Expected 2 fields in line 540345, saw 3`
## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2
25
Bug loading `sentence-transformers/parallel-sentences` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2 > What's wrong with those lines exactly ? Stuff like this: `ParserError: Error tokenizing data. C error: Expected 2 fields in line 540345, saw 3`
[ -0.0064447298645973206, -0.30189454555511475, -0.07506976276636124, 0.1588544398546219, 0.19041398167610168, 0.014945738017559052, 0.5312554240226746, 0.17734768986701965, -0.1279134452342987, 0.1705007553100586, -0.08514212816953659, 0.3792472183704376, 0.0759563222527504, -0.5006234049797058, -0.1747632771730423, -0.23892077803611755, 0.1334494650363922, 0.023917123675346375, -0.08517459034919739, -0.060156408697366714, -0.2757093608379364, 0.3060179650783539, -0.3254345655441284, -0.14870671927928925, -0.052077699452638626, 0.10794337838888168, -0.15572910010814667, 0.18705973029136658, -0.11709804087877274, -0.3488713502883911, -0.1775350719690323, 0.17408081889152527, 0.0308830589056015, 0.5999956130981445, -0.0001066906625055708, -0.013138141483068466, 0.35849058628082275, -0.02927335351705551, -0.3431011736392975, -0.3456762433052063, 0.08296071738004684, -0.20873510837554932, 0.17962966859340668, -0.23282426595687866, 0.024374503642320633, -0.028689008206129074, -0.05301748216152191, -0.1924591064453125, 0.4333108067512512, 0.2688455283641815, 0.26302194595336914, 0.4947151839733124, 0.049459923058748245, -0.34784436225891113, 0.17156118154525757, -0.4469722509384155, -0.004480578005313873, 0.32126885652542114, 0.23900829255580902, -0.006804360076785088, -0.18007001280784607, 0.23720405995845795, -0.2235061377286911, 0.10836274921894073, -0.05765172839164734, -0.1336098611354828, 0.1073879599571228, -0.12355479598045349, -0.022797882556915283, 0.09546566009521484, 0.14273759722709656, -0.19485753774642944, -0.306570440530777, -0.2380044162273407, -0.12717358767986298, 0.07430771738290787, -0.045722149312496185, 0.06358306854963303, -0.1463688611984253, 0.21348771452903748, -0.0801163837313652, 0.04967768117785454, 0.024496935307979584, 0.042993150651454926, -0.18713317811489105, 0.6275644302368164, -0.03261946886777878, 0.06727271527051926, 0.457787424325943, 0.13827495276927948, 0.2553781270980835, 0.1064307764172554, -0.09224765002727509, 0.04941602423787117, -0.40965428948402405, -0.017700523138046265, 0.03441757336258888, -0.6007848978042603, 0.06016311049461365, -0.038165442645549774, 0.26910069584846497, -0.11763546615839005, 0.27582451701164246, 0.27960091829299927, 0.16723188757896423, 0.4024121165275574, -0.0980280265212059, 0.27040770649909973, 0.09447477757930756, 0.20300757884979248, 0.1548592448234558, -0.023763880133628845, -0.2978023290634155, -0.05027379095554352, 0.13370530307292938, 0.25796759128570557, 0.15892677009105682, 0.02456102892756462, -0.2529754340648651, -0.033022500574588776, -0.17613235116004944, 0.08163989335298538, -0.14542058110237122, 0.31668218970298767, 0.061993639916181564, 0.5051547288894653, -0.01410311833024025, 0.33983278274536133, -0.21555368602275848, -0.3661046326160431, -0.302417516708374, -0.010695889592170715, -0.08157778531312943, -0.03117014281451702, 0.08639980852603912, 0.3753650188446045, 0.3308446705341339, -0.01330053061246872, 0.03540246933698654, -0.3427397906780243, -0.1832977831363678, -0.18738315999507904, -0.1596876084804535, 0.14377273619174957, 0.054959144443273544, 0.04971867799758911, 0.28612813353538513, -0.0885724201798439, 0.10844973474740982, 0.20334583520889282, -0.1913335919380188, -0.1652156412601471, -0.2204935997724533, 0.2975698709487915, -0.11682407557964325, -0.17014102637767792, 0.034467048943042755, 0.12843842804431915, 0.4836467206478119, -0.007964514195919037, 0.07959575206041336, -0.07703724503517151, -0.25884878635406494, -0.1898820698261261, -0.028599631041288376, 0.3697071671485901, -0.5592251420021057, -0.2589382529258728, 0.08216510713100433, 0.0875033587217331, 0.3078323006629944, 0.4528600573539734, -0.16454672813415527, -0.003662019968032837, -0.046266309916973114, 0.24651966989040375, 0.13833880424499512, -0.32555127143859863, -0.18328382074832916, 0.3252902626991272, -0.35065513849258423, 0.21282456815242767, 0.2190699577331543, -0.1586511731147766, 0.44434502720832825, -0.019075818359851837, 0.35723721981048584, 0.11952225863933563, 0.27844271063804626, 0.06714479625225067, -0.44459158182144165, -0.19816458225250244, -0.08778113126754761, -0.0606895349919796, 0.1802307665348053, 0.14801663160324097, 0.030956752598285675, -0.08406280726194382, 0.2860587537288666, 0.0157117061316967, -0.02305910550057888, 0.17892995476722717, 0.09859849512577057, 0.19263958930969238, 0.16923725605010986, 0.07405708730220795, -0.21406376361846924, 0.16752099990844727, -0.021393198519945145, 0.16068170964717865, -0.17302627861499786, -0.20577766001224518, -0.26034513115882874, -0.0595531091094017, 0.010040607303380966, -0.24764618277549744, 0.2318798303604126, 0.18702788650989532, -0.19989201426506042, -0.009462399408221245, -0.03356189280748367, 0.13236963748931885, -0.033775247633457184, -0.014331025071442127, -0.20233172178268433, 0.1880408525466919, -0.2555640935897827, -0.18967482447624207, -0.10879766196012497, 0.1271921843290329, 0.22016745805740356, -0.008416512049734592, -0.16948577761650085, 0.5179384350776672, -0.07714782655239105, 0.42850208282470703, -0.20941001176834106, -0.41302382946014404, 0.1095525398850441, -0.20821787416934967, 0.08409634977579117, 0.1855996698141098, 0.28604772686958313, -0.08314019441604614, 0.039018213748931885, 0.16519086062908173, 0.3459412455558777, -0.008625894784927368, 0.20085613429546356, -0.05550290644168854, 0.1962692141532898, -0.06609953939914703, -0.2026567906141281, -0.3105357587337494, 0.31442755460739136, -0.01715729385614395, -0.100227952003479, 0.12180323898792267, -0.1993052214384079, -0.06901096552610397, 0.2973478138446808, -0.1381823867559433, 0.12708324193954468, 0.01250055804848671, -0.12484712153673172, 0.0374254509806633, -0.1139940619468689, 0.1930995136499405, 0.3166133165359497, 0.254481703042984, 0.030798280611634254, 0.18100950121879578, -0.015278699807822704, -0.31333714723587036, 0.11153178662061691, 0.4160482883453369, 0.27414727210998535, 0.3199387788772583, 0.26635900139808655, 0.130859836935997, -0.3311670422554016, 0.0025771334767341614, 0.12468057125806808, 0.13432946801185608, -0.3879118263721466, 0.14147841930389404, -0.17230919003486633, 0.010895006358623505, -0.1655905842781067, -0.015731576830148697, 0.13711194694042206, -0.3592996895313263, 0.14831137657165527, 0.273460328578949, -0.18036800622940063, 0.22691547870635986, 0.17204934358596802, 0.19493010640144348, 0.11537089943885803, 0.01341309491544962, -0.14815177023410797, -0.288126677274704, -0.11784292012453079, 0.12480472028255463, -0.01985805295407772, -0.10284179449081421, -0.06958602368831635, -0.1179654523730278, -0.2728992700576782, -0.07235228270292282, -0.18258056044578552, 0.01067289337515831, -0.24637232720851898, 0.2902805507183075, 0.08194570988416672, 0.00995829701423645, -0.03466431424021721, -0.1664343774318695, 0.18160048127174377, -0.32624027132987976, -0.19395191967487335, 0.1671670526266098, 0.17241717875003815, -0.14634469151496887, -0.32961583137512207, -0.4586903750896454, -0.2527227997779846, -0.5875048041343689, 0.17562900483608246, -0.02663426660001278, 0.006818272173404694, 0.14953084290027618, 0.1508965790271759, -0.0795726329088211, 0.18683522939682007, 0.0265592522919178, -0.3225563168525696, -0.029219377785921097, 0.17992329597473145, -0.1308939903974533, -0.3285573124885559, -0.39009106159210205, 0.04171757400035858, 0.10503949224948883, -0.17820963263511658, -0.36624854803085327, -0.0844118595123291, -0.19923530519008636, -0.1024317815899849, -0.10577760636806488, -0.1867249757051468, 0.2444489598274231, -0.015652183443307877, -0.18163836002349854, -0.08130162954330444, 0.1175263375043869, 0.19603069126605988, 0.23335763812065125, -0.021858297288417816, -0.14194154739379883, 0.5061035752296448, 0.3703949749469757, 0.6176100373268127, 0.18731552362442017, 0.10551994293928146, 0.31445759534835815, 0.045079849660396576, 0.14763498306274414, -0.08469656854867935, -0.27763649821281433, -0.09981369972229004, -0.2564239799976349, -0.1070144921541214, 0.22404229640960693, -0.18322545289993286, -0.3932807147502899, -0.11363831162452698, -0.08527061343193054, -0.2626449167728424, -0.1321532279253006, 0.0074043432250618935, -0.05339924246072769, -0.06944894045591354, 0.0784478485584259, 0.14056819677352905, -0.03160110488533974, 0.13968169689178467, -0.11147348582744598, -0.00953596830368042, -0.061862967908382416, -0.12010931223630905, 0.2260674089193344, 0.3311765193939209, -0.3378653824329376, 0.16203844547271729, 0.19699810445308685, 0.5000758767127991, 0.10469935834407806, -0.27812886238098145, 0.08922618627548218, -0.14332261681556702, 0.683061420917511, 0.09304533153772354, -0.008257400244474411, 0.28827419877052307, 0.08569151163101196, -0.43444404006004333, -0.28601425886154175, -0.4717509150505066, -0.3482973575592041, 0.4689933955669403, 0.3483321964740753, -0.18084532022476196, 0.0684838742017746, 0.2937740981578827, -0.14978620409965515, -0.053392473608255386, -0.3663918673992157, -0.41720080375671387, -0.2109774351119995, -0.540665328502655, 0.15704020857810974, 0.24083773791790009, 0.060615453869104385, -0.26505860686302185, -0.223136305809021, 0.18832024931907654, -0.38938987255096436, -0.07040467858314514, 0.12069748342037201, 0.02509170211851597, -0.2181113064289093, 0.13499368727207184, 0.11031056940555573, -0.2780015766620636, 0.11094211786985397, 0.38355860114097595, 0.1404254138469696, -0.22586748003959656, 0.151200532913208, -0.0967918336391449, 0.17665965855121613, 0.2134207785129547, -0.1662386804819107, 0.10676384717226028, 0.22716759145259857, 0.25544291734695435, -0.06773935258388519, -0.2768837511539459, 0.4240023195743561, 0.09464451670646667, -0.055547475814819336, -0.2262602150440216, 0.29104486107826233, 0.11152954399585724, -0.013021104037761688, -0.25638431310653687, -0.3841747045516968, -0.17401766777038574, 0.5088536739349365, -0.05592695623636246, 0.971862256526947, -0.0076797232031822205, 0.10415945947170258, 0.23423710465431213, 0.013515152037143707, 0.22324314713478088, -0.5320963859558105, 0.2104571908712387, -0.1830863505601883, -0.2170652598142624, -0.0929083451628685, 0.0023523159325122833, 0.2818467915058136, 0.028335709124803543, -0.6256151795387268, 0.3931393623352051, -0.22754831612110138, 0.2500980794429779, 0.27581965923309326, -0.15813735127449036, -0.11348823457956314, 0.01143665798008442, 0.10786044597625732, 0.15361687541007996, 0.22152669727802277, 0.014906490221619606, -0.026207419112324715, -0.049496978521347046, 0.024307433515787125, -0.3104557991027832, -0.28512173891067505, 0.21061545610427856, -0.1768827885389328, 0.27332621812820435, -0.14647580683231354, -0.01131325215101242, -0.10746991634368896, 0.0769825130701065, 0.11276520788669586, 0.12540489435195923, 0.03372062370181084, 0.2948944866657257, 0.4090304672718048, -0.11201118677854538, -0.07986444979906082, -0.006996858865022659, 0.28204259276390076, -0.17962563037872314, -0.44541695713996887, 0.15054713189601898, 0.029592856764793396, -0.2683076858520508, -0.06669247895479202, 0.07839103043079376, 0.12780694663524628, -0.14203524589538574, 0.03676588460803032, -0.05468052625656128, -0.10566820204257965, -0.5616085529327393, 0.20474843680858612, -0.16554909944534302, -0.5234267711639404, -0.004801549017429352, -0.09438218176364899, -0.26396992802619934, -0.1703684777021408, 0.5786184072494507, 0.2982688248157501, 0.1315900981426239, 0.27890992164611816, 0.27079856395721436, -0.22617106139659882, -0.3052178919315338, -0.3912286162376404, -0.3081105947494507, -0.461759090423584, 0.3227306306362152, -0.29286015033721924, -0.32891321182250977, -0.019378436729311943, 0.30101504921913147, 0.2527630925178528, 0.19093114137649536, -0.3937869369983673, -0.4043690264225006, -0.03405047208070755, -0.0690455436706543, -0.24763821065425873, 0.09390382468700409, 0.3461208641529083, 0.1024467796087265, -0.14520372450351715, 0.22513316571712494, -0.43451938033103943, 0.0762353166937828, -0.43732601404190063, 0.08421843498945236, -0.03311122953891754, -0.43270573019981384, 0.016001472249627113, 0.05985153838992119, 0.28517448902130127, 0.5130840539932251, 0.03883949667215347, -0.29860132932662964, -0.14648394286632538, 0.07246381789445877, -0.0516030415892601, 0.218061625957489, 0.04447653144598007, 0.23123915493488312, -0.0924171507358551, 0.004134578630328178, 0.11229236423969269, 0.12910735607147217, 0.1253066509962082, 0.25788986682891846, 0.21300938725471497, 0.19094128906726837, 0.06911253184080124, 0.14945060014724731, -0.1460007131099701, 0.07199487090110779, 0.04776063188910484, 0.2505287826061249, 0.032356638461351395, 0.057240188121795654, -0.19702650606632233, 0.07830027490854263, 0.24139823019504547, 0.29544559121131897, 0.19695264101028442, -0.30904608964920044, -0.06407971680164337, -0.2424384504556656, 0.3684192895889282, 0.2857248783111572, -0.27671435475349426, -0.32796308398246765, 0.05144408717751503, 0.29178792238235474, -0.3037309944629669, -0.10747355967760086, 0.2246273308992386, 0.031188301742076874, 0.2117120325565338, 0.41002216935157776, 0.26558831334114075, -0.13050410151481628, 0.07893200218677521, 0.2028208076953888, 0.44677507877349854, 0.11475654691457748, 0.23355360329151154, 0.20922213792800903, 0.033410411328077316, -0.045159462839365005, -0.03142236918210983, -0.12502267956733704, 0.38584938645362854, 0.208402618765831, -0.22703707218170166, 0.18513816595077515, 0.0763770043849945, 0.2714921832084656, -0.036041513085365295, -0.2030750960111618, 0.42012134194374084, 0.17322880029678345, -0.18913891911506653, 0.17515435814857483, -0.030213937163352966, 0.32499536871910095, 0.09029513597488403, 0.04042845591902733, -0.36864638328552246, 0.4470277428627014, -0.3067397475242615, -0.25827091932296753, 0.029104582965373993, -0.16409489512443542, -0.36657798290252686, -0.07430056482553482, 0.14301669597625732, 0.15732279419898987, 0.18077853322029114, -0.1745488941669464, -0.0007301047444343567, -0.4493136703968048, 0.01668662391602993, -0.14539042115211487, 0.15366558730602264, -0.331662118434906, 0.36883246898651123, 0.3560248017311096, -0.04831826686859131, 0.03861309587955475, 0.2497933954000473, 0.5516515970230103, 0.23689085245132446, 0.08863411843776703, -0.10070597380399704, -0.133080393075943, -0.17963407933712006, 0.02156105637550354, 0.29737335443496704, 0.05469891428947449, 0.2801862359046936, 0.25292640924453735, 0.2499992847442627, -0.3064158856868744, 0.17817546427249908, 0.166832834482193, 0.08231629431247711, -0.35169434547424316, 0.3654627501964569, -0.13889198005199432, -0.07995457947254181, 0.037232521921396255, -0.006004847586154938, -0.621313214302063, 0.20344184339046478, 0.17056331038475037, -0.13540591299533844, 0.27483704686164856, 0.10236739367246628, 0.14151276648044586, 0.128398135304451, 0.2728537321090698, 0.430616170167923, -0.023931309580802917, -0.12735368311405182, 0.04614618420600891, -0.5907896757125854, 0.29000166058540344, -0.010655440390110016, 0.15430760383605957, 0.031294893473386765, 0.17628179490566254, 0.06476154923439026, 0.25365176796913147, 0.020691461861133575, 0.19806261360645294, -0.23743607103824615, 0.1772514283657074, -0.3172696530818939, -0.09884749352931976, 0.1656845211982727, -0.18855687975883484, 0.16580583155155182, -0.2474755048751831, -0.10105453431606293, -0.0411364883184433, 0.1542104184627533, 0.05016300082206726, -0.11118286848068237, 0.0512753389775753, -0.5227717161178589, 0.2405424267053604, -0.07049909979104996, 0.39244720339775085, -0.06398584693670273, 0.0052165742963552475, -0.10991664230823517, -0.18604923784732819, -0.15770651400089264, -0.14378789067268372, 0.267167329788208, 0.28911763429641724, -0.20842835307121277, 0.0029532015323638916, -0.16105230152606964, 0.2793019413948059, 0.11473460495471954, -0.27989405393600464, -0.2739177346229553, 0.23141004145145416, -0.07681458443403244, 0.04042689874768257, -0.11915448307991028, 0.07027163356542587, -0.02242901921272278, 0.14966709911823273, -0.09503009170293808, -0.6964723467826843, 0.5653486251831055, -0.17772148549556732, -0.32815852761268616, -0.1417374163866043, 0.02804725617170334, 0.15118417143821716, 0.10477596521377563, -0.6984158754348755, 0.06565704196691513, 0.3078497648239136, 0.08973857015371323, -0.25737428665161133, 0.38224923610687256, -0.04869890958070755, -0.156285360455513, -0.14871789515018463, -0.032942041754722595, 0.1751323640346527, -0.12118873000144958, 0.15606079995632172, -0.33095985651016235 ]
https://github.com/huggingface/datasets/issues/5081
Bug loading `sentence-transformers/parallel-sentences`
> Maybe passing error_bad_lines=False (and maybe warn_bad_lines=True) can be helpful Yes. That would hide the issue but not solve it.
## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2
20
Bug loading `sentence-transformers/parallel-sentences` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("sentence-transformers/parallel-sentences") ``` raises this: ``` /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) /home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: 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' return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [4], line 1 ----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train") File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1692 # Download and prepare data -> 1693 builder_instance.download_and_prepare( 1694 download_config=download_config, 1695 download_mode=download_mode, 1696 ignore_verifications=ignore_verifications, 1697 try_from_hf_gcs=try_from_hf_gcs, 1698 use_auth_token=use_auth_token, 1699 ) 1701 # Build dataset for splits 1702 keep_in_memory = ( 1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1704 ) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs) 801 if not downloaded_from_gcs: 802 prepare_split_kwargs = { 803 "file_format": file_format, 804 "max_shard_size": max_shard_size, 805 **download_and_prepare_kwargs, 806 } --> 807 self._download_and_prepare( 808 dl_manager=dl_manager, 809 verify_infos=verify_infos, 810 **prepare_split_kwargs, 811 **download_and_prepare_kwargs, 812 ) 813 # Sync info 814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 894 split_dict.add(split_generator.split_info) 896 try: 897 # Prepare split will record examples associated to the split --> 898 self._prepare_split(split_generator, **prepare_split_kwargs) 899 except OSError as e: 900 raise OSError( 901 "Cannot find data file. " 902 + (self.manual_download_instructions or "") 903 + "\nOriginal error:\n" 904 + str(e) 905 ) from None File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size) 1506 shard_id += 1 1507 writer = writer_class( 1508 features=writer._features, 1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"), 1510 storage_options=self._fs.storage_options, 1511 embed_local_files=embed_local_files, 1512 ) -> 1513 writer.write_table(table) 1514 finally: 1515 num_shards = shard_id + 1 File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size) 538 if self.pa_writer is None: 539 self._build_writer(inferred_schema=pa_table.schema) --> 540 pa_table = table_cast(pa_table, self._schema) 541 if self.embed_local_files: 542 pa_table = embed_table_storage(pa_table) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema) 2032 """Improved version of pa.Table.cast. 2033 2034 It supports casting to feature types stored in the schema metadata. (...) 2041 table (:obj:`pyarrow.Table`): the casted table 2042 """ 2043 if table.schema != schema: -> 2044 return cast_table_to_schema(table, schema) 2045 elif table.schema.metadata != schema.metadata: 2046 return table.replace_schema_metadata(schema.metadata) File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema) 2003 features = Features.from_arrow_schema(schema) 2004 if sorted(table.column_names) != sorted(features): -> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] 2007 return pa.Table.from_arrays(arrays, schema=schema) ValueError: Couldn't cast Action taken on Parliament's resolutions: see Minutes: string Následný postup na základě usnesení Parlamentu: viz zápis: string -- schema metadata -- pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742 to {'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)} because column names don't match ``` ## Expected results no error ## Actual results error ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: Python 3.9.13 - PyArrow version: pyarrow 9.0.0 - transformers 4.22.2 - datasets 2.5.2 > Maybe passing error_bad_lines=False (and maybe warn_bad_lines=True) can be helpful Yes. That would hide the issue but not solve it.
[ -0.0064447298645973206, -0.30189454555511475, -0.07506976276636124, 0.1588544398546219, 0.19041398167610168, 0.014945738017559052, 0.5312554240226746, 0.17734768986701965, -0.1279134452342987, 0.1705007553100586, -0.08514212816953659, 0.3792472183704376, 0.0759563222527504, -0.5006234049797058, -0.1747632771730423, -0.23892077803611755, 0.1334494650363922, 0.023917123675346375, -0.08517459034919739, -0.060156408697366714, -0.2757093608379364, 0.3060179650783539, -0.3254345655441284, -0.14870671927928925, -0.052077699452638626, 0.10794337838888168, -0.15572910010814667, 0.18705973029136658, -0.11709804087877274, -0.3488713502883911, -0.1775350719690323, 0.17408081889152527, 0.0308830589056015, 0.5999956130981445, -0.0001066906625055708, -0.013138141483068466, 0.35849058628082275, -0.02927335351705551, -0.3431011736392975, -0.3456762433052063, 0.08296071738004684, -0.20873510837554932, 0.17962966859340668, -0.23282426595687866, 0.024374503642320633, -0.028689008206129074, -0.05301748216152191, -0.1924591064453125, 0.4333108067512512, 0.2688455283641815, 0.26302194595336914, 0.4947151839733124, 0.049459923058748245, -0.34784436225891113, 0.17156118154525757, -0.4469722509384155, -0.004480578005313873, 0.32126885652542114, 0.23900829255580902, -0.006804360076785088, -0.18007001280784607, 0.23720405995845795, -0.2235061377286911, 0.10836274921894073, -0.05765172839164734, -0.1336098611354828, 0.1073879599571228, -0.12355479598045349, -0.022797882556915283, 0.09546566009521484, 0.14273759722709656, -0.19485753774642944, -0.306570440530777, -0.2380044162273407, -0.12717358767986298, 0.07430771738290787, -0.045722149312496185, 0.06358306854963303, -0.1463688611984253, 0.21348771452903748, -0.0801163837313652, 0.04967768117785454, 0.024496935307979584, 0.042993150651454926, -0.18713317811489105, 0.6275644302368164, -0.03261946886777878, 0.06727271527051926, 0.457787424325943, 0.13827495276927948, 0.2553781270980835, 0.1064307764172554, -0.09224765002727509, 0.04941602423787117, -0.40965428948402405, -0.017700523138046265, 0.03441757336258888, -0.6007848978042603, 0.06016311049461365, -0.038165442645549774, 0.26910069584846497, -0.11763546615839005, 0.27582451701164246, 0.27960091829299927, 0.16723188757896423, 0.4024121165275574, -0.0980280265212059, 0.27040770649909973, 0.09447477757930756, 0.20300757884979248, 0.1548592448234558, -0.023763880133628845, -0.2978023290634155, -0.05027379095554352, 0.13370530307292938, 0.25796759128570557, 0.15892677009105682, 0.02456102892756462, -0.2529754340648651, -0.033022500574588776, -0.17613235116004944, 0.08163989335298538, -0.14542058110237122, 0.31668218970298767, 0.061993639916181564, 0.5051547288894653, -0.01410311833024025, 0.33983278274536133, -0.21555368602275848, -0.3661046326160431, -0.302417516708374, -0.010695889592170715, -0.08157778531312943, -0.03117014281451702, 0.08639980852603912, 0.3753650188446045, 0.3308446705341339, -0.01330053061246872, 0.03540246933698654, -0.3427397906780243, -0.1832977831363678, -0.18738315999507904, -0.1596876084804535, 0.14377273619174957, 0.054959144443273544, 0.04971867799758911, 0.28612813353538513, -0.0885724201798439, 0.10844973474740982, 0.20334583520889282, -0.1913335919380188, -0.1652156412601471, -0.2204935997724533, 0.2975698709487915, -0.11682407557964325, -0.17014102637767792, 0.034467048943042755, 0.12843842804431915, 0.4836467206478119, -0.007964514195919037, 0.07959575206041336, -0.07703724503517151, -0.25884878635406494, -0.1898820698261261, -0.028599631041288376, 0.3697071671485901, -0.5592251420021057, -0.2589382529258728, 0.08216510713100433, 0.0875033587217331, 0.3078323006629944, 0.4528600573539734, -0.16454672813415527, -0.003662019968032837, -0.046266309916973114, 0.24651966989040375, 0.13833880424499512, -0.32555127143859863, -0.18328382074832916, 0.3252902626991272, -0.35065513849258423, 0.21282456815242767, 0.2190699577331543, -0.1586511731147766, 0.44434502720832825, -0.019075818359851837, 0.35723721981048584, 0.11952225863933563, 0.27844271063804626, 0.06714479625225067, -0.44459158182144165, -0.19816458225250244, -0.08778113126754761, -0.0606895349919796, 0.1802307665348053, 0.14801663160324097, 0.030956752598285675, -0.08406280726194382, 0.2860587537288666, 0.0157117061316967, -0.02305910550057888, 0.17892995476722717, 0.09859849512577057, 0.19263958930969238, 0.16923725605010986, 0.07405708730220795, -0.21406376361846924, 0.16752099990844727, -0.021393198519945145, 0.16068170964717865, -0.17302627861499786, -0.20577766001224518, -0.26034513115882874, -0.0595531091094017, 0.010040607303380966, -0.24764618277549744, 0.2318798303604126, 0.18702788650989532, -0.19989201426506042, -0.009462399408221245, -0.03356189280748367, 0.13236963748931885, -0.033775247633457184, -0.014331025071442127, -0.20233172178268433, 0.1880408525466919, -0.2555640935897827, -0.18967482447624207, -0.10879766196012497, 0.1271921843290329, 0.22016745805740356, -0.008416512049734592, -0.16948577761650085, 0.5179384350776672, -0.07714782655239105, 0.42850208282470703, -0.20941001176834106, -0.41302382946014404, 0.1095525398850441, -0.20821787416934967, 0.08409634977579117, 0.1855996698141098, 0.28604772686958313, -0.08314019441604614, 0.039018213748931885, 0.16519086062908173, 0.3459412455558777, -0.008625894784927368, 0.20085613429546356, -0.05550290644168854, 0.1962692141532898, -0.06609953939914703, -0.2026567906141281, -0.3105357587337494, 0.31442755460739136, -0.01715729385614395, -0.100227952003479, 0.12180323898792267, -0.1993052214384079, -0.06901096552610397, 0.2973478138446808, -0.1381823867559433, 0.12708324193954468, 0.01250055804848671, -0.12484712153673172, 0.0374254509806633, -0.1139940619468689, 0.1930995136499405, 0.3166133165359497, 0.254481703042984, 0.030798280611634254, 0.18100950121879578, -0.015278699807822704, -0.31333714723587036, 0.11153178662061691, 0.4160482883453369, 0.27414727210998535, 0.3199387788772583, 0.26635900139808655, 0.130859836935997, -0.3311670422554016, 0.0025771334767341614, 0.12468057125806808, 0.13432946801185608, -0.3879118263721466, 0.14147841930389404, -0.17230919003486633, 0.010895006358623505, -0.1655905842781067, -0.015731576830148697, 0.13711194694042206, -0.3592996895313263, 0.14831137657165527, 0.273460328578949, -0.18036800622940063, 0.22691547870635986, 0.17204934358596802, 0.19493010640144348, 0.11537089943885803, 0.01341309491544962, -0.14815177023410797, -0.288126677274704, -0.11784292012453079, 0.12480472028255463, -0.01985805295407772, -0.10284179449081421, -0.06958602368831635, -0.1179654523730278, -0.2728992700576782, -0.07235228270292282, -0.18258056044578552, 0.01067289337515831, -0.24637232720851898, 0.2902805507183075, 0.08194570988416672, 0.00995829701423645, -0.03466431424021721, -0.1664343774318695, 0.18160048127174377, -0.32624027132987976, -0.19395191967487335, 0.1671670526266098, 0.17241717875003815, -0.14634469151496887, -0.32961583137512207, -0.4586903750896454, -0.2527227997779846, -0.5875048041343689, 0.17562900483608246, -0.02663426660001278, 0.006818272173404694, 0.14953084290027618, 0.1508965790271759, -0.0795726329088211, 0.18683522939682007, 0.0265592522919178, -0.3225563168525696, -0.029219377785921097, 0.17992329597473145, -0.1308939903974533, -0.3285573124885559, -0.39009106159210205, 0.04171757400035858, 0.10503949224948883, -0.17820963263511658, -0.36624854803085327, -0.0844118595123291, -0.19923530519008636, -0.1024317815899849, -0.10577760636806488, -0.1867249757051468, 0.2444489598274231, -0.015652183443307877, -0.18163836002349854, -0.08130162954330444, 0.1175263375043869, 0.19603069126605988, 0.23335763812065125, -0.021858297288417816, -0.14194154739379883, 0.5061035752296448, 0.3703949749469757, 0.6176100373268127, 0.18731552362442017, 0.10551994293928146, 0.31445759534835815, 0.045079849660396576, 0.14763498306274414, -0.08469656854867935, -0.27763649821281433, -0.09981369972229004, -0.2564239799976349, -0.1070144921541214, 0.22404229640960693, -0.18322545289993286, -0.3932807147502899, -0.11363831162452698, -0.08527061343193054, -0.2626449167728424, -0.1321532279253006, 0.0074043432250618935, -0.05339924246072769, -0.06944894045591354, 0.0784478485584259, 0.14056819677352905, -0.03160110488533974, 0.13968169689178467, -0.11147348582744598, -0.00953596830368042, -0.061862967908382416, -0.12010931223630905, 0.2260674089193344, 0.3311765193939209, -0.3378653824329376, 0.16203844547271729, 0.19699810445308685, 0.5000758767127991, 0.10469935834407806, -0.27812886238098145, 0.08922618627548218, -0.14332261681556702, 0.683061420917511, 0.09304533153772354, -0.008257400244474411, 0.28827419877052307, 0.08569151163101196, -0.43444404006004333, -0.28601425886154175, -0.4717509150505066, -0.3482973575592041, 0.4689933955669403, 0.3483321964740753, -0.18084532022476196, 0.0684838742017746, 0.2937740981578827, -0.14978620409965515, -0.053392473608255386, -0.3663918673992157, -0.41720080375671387, -0.2109774351119995, -0.540665328502655, 0.15704020857810974, 0.24083773791790009, 0.060615453869104385, -0.26505860686302185, -0.223136305809021, 0.18832024931907654, -0.38938987255096436, -0.07040467858314514, 0.12069748342037201, 0.02509170211851597, -0.2181113064289093, 0.13499368727207184, 0.11031056940555573, -0.2780015766620636, 0.11094211786985397, 0.38355860114097595, 0.1404254138469696, -0.22586748003959656, 0.151200532913208, -0.0967918336391449, 0.17665965855121613, 0.2134207785129547, -0.1662386804819107, 0.10676384717226028, 0.22716759145259857, 0.25544291734695435, -0.06773935258388519, -0.2768837511539459, 0.4240023195743561, 0.09464451670646667, -0.055547475814819336, -0.2262602150440216, 0.29104486107826233, 0.11152954399585724, -0.013021104037761688, -0.25638431310653687, -0.3841747045516968, -0.17401766777038574, 0.5088536739349365, -0.05592695623636246, 0.971862256526947, -0.0076797232031822205, 0.10415945947170258, 0.23423710465431213, 0.013515152037143707, 0.22324314713478088, -0.5320963859558105, 0.2104571908712387, -0.1830863505601883, -0.2170652598142624, -0.0929083451628685, 0.0023523159325122833, 0.2818467915058136, 0.028335709124803543, -0.6256151795387268, 0.3931393623352051, -0.22754831612110138, 0.2500980794429779, 0.27581965923309326, -0.15813735127449036, -0.11348823457956314, 0.01143665798008442, 0.10786044597625732, 0.15361687541007996, 0.22152669727802277, 0.014906490221619606, -0.026207419112324715, -0.049496978521347046, 0.024307433515787125, -0.3104557991027832, -0.28512173891067505, 0.21061545610427856, -0.1768827885389328, 0.27332621812820435, -0.14647580683231354, -0.01131325215101242, -0.10746991634368896, 0.0769825130701065, 0.11276520788669586, 0.12540489435195923, 0.03372062370181084, 0.2948944866657257, 0.4090304672718048, -0.11201118677854538, -0.07986444979906082, -0.006996858865022659, 0.28204259276390076, -0.17962563037872314, -0.44541695713996887, 0.15054713189601898, 0.029592856764793396, -0.2683076858520508, -0.06669247895479202, 0.07839103043079376, 0.12780694663524628, -0.14203524589538574, 0.03676588460803032, -0.05468052625656128, -0.10566820204257965, -0.5616085529327393, 0.20474843680858612, -0.16554909944534302, -0.5234267711639404, -0.004801549017429352, -0.09438218176364899, -0.26396992802619934, -0.1703684777021408, 0.5786184072494507, 0.2982688248157501, 0.1315900981426239, 0.27890992164611816, 0.27079856395721436, -0.22617106139659882, -0.3052178919315338, -0.3912286162376404, -0.3081105947494507, -0.461759090423584, 0.3227306306362152, -0.29286015033721924, -0.32891321182250977, -0.019378436729311943, 0.30101504921913147, 0.2527630925178528, 0.19093114137649536, -0.3937869369983673, -0.4043690264225006, -0.03405047208070755, -0.0690455436706543, -0.24763821065425873, 0.09390382468700409, 0.3461208641529083, 0.1024467796087265, -0.14520372450351715, 0.22513316571712494, -0.43451938033103943, 0.0762353166937828, -0.43732601404190063, 0.08421843498945236, -0.03311122953891754, -0.43270573019981384, 0.016001472249627113, 0.05985153838992119, 0.28517448902130127, 0.5130840539932251, 0.03883949667215347, -0.29860132932662964, -0.14648394286632538, 0.07246381789445877, -0.0516030415892601, 0.218061625957489, 0.04447653144598007, 0.23123915493488312, -0.0924171507358551, 0.004134578630328178, 0.11229236423969269, 0.12910735607147217, 0.1253066509962082, 0.25788986682891846, 0.21300938725471497, 0.19094128906726837, 0.06911253184080124, 0.14945060014724731, -0.1460007131099701, 0.07199487090110779, 0.04776063188910484, 0.2505287826061249, 0.032356638461351395, 0.057240188121795654, -0.19702650606632233, 0.07830027490854263, 0.24139823019504547, 0.29544559121131897, 0.19695264101028442, -0.30904608964920044, -0.06407971680164337, -0.2424384504556656, 0.3684192895889282, 0.2857248783111572, -0.27671435475349426, -0.32796308398246765, 0.05144408717751503, 0.29178792238235474, -0.3037309944629669, -0.10747355967760086, 0.2246273308992386, 0.031188301742076874, 0.2117120325565338, 0.41002216935157776, 0.26558831334114075, -0.13050410151481628, 0.07893200218677521, 0.2028208076953888, 0.44677507877349854, 0.11475654691457748, 0.23355360329151154, 0.20922213792800903, 0.033410411328077316, -0.045159462839365005, -0.03142236918210983, -0.12502267956733704, 0.38584938645362854, 0.208402618765831, -0.22703707218170166, 0.18513816595077515, 0.0763770043849945, 0.2714921832084656, -0.036041513085365295, -0.2030750960111618, 0.42012134194374084, 0.17322880029678345, -0.18913891911506653, 0.17515435814857483, -0.030213937163352966, 0.32499536871910095, 0.09029513597488403, 0.04042845591902733, -0.36864638328552246, 0.4470277428627014, -0.3067397475242615, -0.25827091932296753, 0.029104582965373993, -0.16409489512443542, -0.36657798290252686, -0.07430056482553482, 0.14301669597625732, 0.15732279419898987, 0.18077853322029114, -0.1745488941669464, -0.0007301047444343567, -0.4493136703968048, 0.01668662391602993, -0.14539042115211487, 0.15366558730602264, -0.331662118434906, 0.36883246898651123, 0.3560248017311096, -0.04831826686859131, 0.03861309587955475, 0.2497933954000473, 0.5516515970230103, 0.23689085245132446, 0.08863411843776703, -0.10070597380399704, -0.133080393075943, -0.17963407933712006, 0.02156105637550354, 0.29737335443496704, 0.05469891428947449, 0.2801862359046936, 0.25292640924453735, 0.2499992847442627, -0.3064158856868744, 0.17817546427249908, 0.166832834482193, 0.08231629431247711, -0.35169434547424316, 0.3654627501964569, -0.13889198005199432, -0.07995457947254181, 0.037232521921396255, -0.006004847586154938, -0.621313214302063, 0.20344184339046478, 0.17056331038475037, -0.13540591299533844, 0.27483704686164856, 0.10236739367246628, 0.14151276648044586, 0.128398135304451, 0.2728537321090698, 0.430616170167923, -0.023931309580802917, -0.12735368311405182, 0.04614618420600891, -0.5907896757125854, 0.29000166058540344, -0.010655440390110016, 0.15430760383605957, 0.031294893473386765, 0.17628179490566254, 0.06476154923439026, 0.25365176796913147, 0.020691461861133575, 0.19806261360645294, -0.23743607103824615, 0.1772514283657074, -0.3172696530818939, -0.09884749352931976, 0.1656845211982727, -0.18855687975883484, 0.16580583155155182, -0.2474755048751831, -0.10105453431606293, -0.0411364883184433, 0.1542104184627533, 0.05016300082206726, -0.11118286848068237, 0.0512753389775753, -0.5227717161178589, 0.2405424267053604, -0.07049909979104996, 0.39244720339775085, -0.06398584693670273, 0.0052165742963552475, -0.10991664230823517, -0.18604923784732819, -0.15770651400089264, -0.14378789067268372, 0.267167329788208, 0.28911763429641724, -0.20842835307121277, 0.0029532015323638916, -0.16105230152606964, 0.2793019413948059, 0.11473460495471954, -0.27989405393600464, -0.2739177346229553, 0.23141004145145416, -0.07681458443403244, 0.04042689874768257, -0.11915448307991028, 0.07027163356542587, -0.02242901921272278, 0.14966709911823273, -0.09503009170293808, -0.6964723467826843, 0.5653486251831055, -0.17772148549556732, -0.32815852761268616, -0.1417374163866043, 0.02804725617170334, 0.15118417143821716, 0.10477596521377563, -0.6984158754348755, 0.06565704196691513, 0.3078497648239136, 0.08973857015371323, -0.25737428665161133, 0.38224923610687256, -0.04869890958070755, -0.156285360455513, -0.14871789515018463, -0.032942041754722595, 0.1751323640346527, -0.12118873000144958, 0.15606079995632172, -0.33095985651016235 ]
https://github.com/huggingface/datasets/issues/5074
Replace AssertionErrors with more meaningful errors
Looks like the top-level `datasource` directory was removed when https://github.com/huggingface/datasets/pull/4974 was merged, so there are 3 source files to fix.
Replace the AssertionErrors with more meaningful errors such as ValueError, TypeError, etc. The files with AssertionErrors that need to be replaced: ``` src/datasets/arrow_reader.py src/datasets/builder.py src/datasets/utils/version.py ```
20
Replace AssertionErrors with more meaningful errors Replace the AssertionErrors with more meaningful errors such as ValueError, TypeError, etc. The files with AssertionErrors that need to be replaced: ``` src/datasets/arrow_reader.py src/datasets/builder.py src/datasets/utils/version.py ``` Looks like the top-level `datasource` directory was removed when https://github.com/huggingface/datasets/pull/4974 was merged, so there are 3 source files to fix.
[ -0.2089221030473709, -0.052662283182144165, -0.11660823225975037, 0.2008512020111084, 0.28648054599761963, 0.05914171785116196, 0.11856641620397568, 0.3406085968017578, -0.029903745278716087, 0.22852090001106262, -0.024910518899559975, 0.23046879470348358, -0.028467722237110138, 0.055955126881599426, -0.20300491154193878, -0.0444653257727623, -0.054169200360774994, 0.2577754855155945, -0.06649808585643768, -0.013706736266613007, -0.11096706241369247, 0.0773935616016388, -0.12853750586509705, 0.12298346310853958, -0.25368189811706543, -0.13484756648540497, 0.031682685017585754, 0.2593141496181488, -0.3379579782485962, -0.7656668424606323, 0.17759092152118683, 0.1337175816297531, -0.07240709662437439, 0.5225086212158203, -0.00009940207382896915, 0.03503028303384781, 0.4175613522529602, 0.08268517255783081, -0.2697877287864685, 0.08269774913787842, -0.1469108760356903, -0.2733536660671234, 0.19353535771369934, -0.024424411356449127, 0.029453538358211517, -0.44538554549217224, -0.12608343362808228, 0.004563998430967331, 0.3746579885482788, 0.37480881810188293, 0.3488759398460388, 0.3433683216571808, 0.22861330211162567, -0.11465666443109512, -0.04068710654973984, 0.026771172881126404, -0.012506498023867607, 0.26399239897727966, 0.09972507506608963, 0.07711226493120193, -0.09228447824716568, 0.3948957026004791, 0.018320104107260704, -0.05927368625998497, 0.11733378469944, -0.20917312800884247, -0.1504187285900116, -0.1808536946773529, -0.04791618138551712, 0.19453883171081543, 0.3290521204471588, -0.2639828026294708, -0.4712343215942383, -0.2606295347213745, 0.0038424914237111807, -0.17148563265800476, 0.19251848757266998, 0.044508256018161774, -0.09198065102100372, 0.18271011114120483, -0.05709757283329964, -0.21028079092502594, -0.16712725162506104, -0.10294783115386963, -0.23042310774326324, 0.15336674451828003, -0.17576710879802704, 0.00033154338598251343, 0.2861267626285553, -0.1648055762052536, 0.007013222668319941, 0.16556130349636078, -0.17332187294960022, -0.12351617217063904, -0.22643543779850006, -0.11821421980857849, 0.00777454674243927, 0.06868883967399597, 0.310538113117218, 0.1222444698214531, 0.009530560113489628, 0.1435614377260208, -0.33935388922691345, 0.1324792504310608, 0.057237714529037476, 0.022207733243703842, 0.21101537346839905, 0.028405670076608658, 0.2915148138999939, 0.3670511543750763, 0.09670160710811615, -0.07784229516983032, 0.10412640124559402, -0.374175488948822, -0.006645776331424713, 0.1999056041240692, 0.3947538733482361, -0.2972000241279602, -0.07614795863628387, 0.1407054364681244, -0.0521206334233284, -0.06023577228188515, 0.017554357647895813, 0.23100441694259644, -0.009891152381896973, 0.162234365940094, 0.08920769393444061, 0.2043551653623581, -0.05994003266096115, -0.31503593921661377, -0.23482771217823029, 0.04568594694137573, -0.08015896379947662, 0.06351672112941742, -0.005388084799051285, -0.14363008737564087, 0.33743512630462646, 0.024030063301324844, -0.13888725638389587, -0.03817101567983627, 0.00196198932826519, -0.05699458345770836, 0.011218026280403137, 0.2688588798046112, -0.21214473247528076, 0.07270468771457672, 0.2301361858844757, -0.07214853167533875, 0.0845831111073494, -0.10626520961523056, -0.08204374462366104, -0.2337624728679657, -0.1855918914079666, 0.3171277344226837, -0.1062808632850647, -0.03429460525512695, -0.15353909134864807, -0.040181804448366165, -0.12646949291229248, -0.28121253848075867, 0.0997677817940712, -0.19683045148849487, 0.14910390973091125, -0.1772284060716629, 0.28686004877090454, 0.5126093029975891, -0.18553034961223602, 0.0339943990111351, -0.08050337433815002, -0.28656205534935, -0.14318272471427917, 0.40815475583076477, -0.1487157642841339, 0.19609767198562622, -0.3082500100135803, 0.28349173069000244, 0.16945266723632812, -0.35060885548591614, -0.22107349336147308, 0.11141688376665115, 0.046467073261737823, 0.09408815205097198, -0.09758960455656052, -0.16960959136486053, -0.07421232014894485, -0.11547289043664932, -0.06963309645652771, -0.1795234978199005, 0.17057044804096222, 0.009503951296210289, -0.26207682490348816, -0.21403594315052032, -0.06151033192873001, -0.06544332206249237, 0.07899104058742523, -0.035687096416950226, 0.1091962531208992, -0.3709656000137329, 0.3084013760089874, -0.2832593023777008, -0.08071272075176239, 0.30585813522338867, 0.38392168283462524, -0.21332930028438568, -0.0754757672548294, -0.20414531230926514, -0.23563745617866516, 0.13847562670707703, -0.0052164215594530106, 0.11564510315656662, -0.2840224504470825, -0.17719373106956482, -0.2155458927154541, 0.0735723152756691, -0.17834223806858063, -0.22317928075790405, 0.2835434079170227, 0.07636358588933945, 0.07517001032829285, 0.08525930345058441, -0.2832847237586975, 0.10336098819971085, -0.35054463148117065, 0.3895169198513031, -0.2576262950897217, 0.14392498135566711, -0.12453661113977432, -0.12554143369197845, 0.13774347305297852, 0.14214441180229187, -0.000051353126764297485, -0.12020293623209, -0.15244519710540771, 0.5788697600364685, -0.1321372389793396, 0.2691153287887573, 0.09786130487918854, -0.0003079026937484741, 0.1632772833108902, -0.2563164532184601, -0.015953151509165764, -0.07965536415576935, -0.025212641805410385, 0.22651562094688416, -0.24015316367149353, 0.19223517179489136, -0.040712062269449234, 0.1412474513053894, 0.14887858927249908, 0.15940147638320923, 0.2787788510322571, 0.019670072942972183, -0.14871428906917572, -0.12392888963222504, 0.03646985441446304, -0.06907135248184204, 0.2204136997461319, 0.11007635295391083, -0.27120834589004517, 0.0531841441988945, 0.217591792345047, -0.050014495849609375, 0.07292772829532623, 0.12825307250022888, -0.27822989225387573, 0.05125492066144943, 0.26960253715515137, 0.29858091473579407, 0.14061352610588074, 0.3244110643863678, -0.11050622165203094, 0.11526128649711609, -0.016613010317087173, -0.23475508391857147, 0.28554242849349976, 0.29104357957839966, 0.15205493569374084, 0.17889559268951416, 0.09996911883354187, 0.03868313878774643, -0.4662404954433441, -0.1737203299999237, -0.2974582016468048, 0.2836745083332062, -0.3798160254955292, 0.044480837881565094, -0.44671544432640076, -0.17086952924728394, -0.13979218900203705, -0.14072342216968536, -0.2670761048793793, -0.4109087288379669, 0.13529592752456665, 0.05073007196187973, -0.3932707607746124, 0.29608991742134094, -0.06220913678407669, 0.21158447861671448, 0.19482655823230743, 0.2552836537361145, -0.19113846123218536, -0.12119156122207642, 0.03739626333117485, 0.14223018288612366, 0.1178789883852005, 0.1518765389919281, 0.283568799495697, -0.2541680932044983, 0.09001431614160538, -0.51276695728302, -0.2880239188671112, 0.05661546438932419, -0.24460650980472565, 0.24540649354457855, 0.39827296137809753, 0.25481241941452026, 0.05421324819326401, -0.19579002261161804, 0.28574976325035095, -0.31422853469848633, -0.1403297334909439, -0.03124566376209259, 0.11198054254055023, -0.05807378143072128, 0.0049634650349617004, -0.3368496298789978, -0.09279537945985794, -0.5627031326293945, 0.31844162940979004, 0.09012044966220856, 0.057638540863990784, 0.3424498438835144, 0.28110846877098083, 0.23119181394577026, -0.300338476896286, 0.2757571339607239, -0.0459480844438076, -0.3892533481121063, 0.14986783266067505, -0.20609188079833984, -0.262716144323349, -0.046726807951927185, -0.00280708447098732, 0.1389208287000656, -0.05642490088939667, -0.46391594409942627, -0.49849894642829895, -0.24887369573116302, 0.07532310485839844, 0.01306840404868126, 0.19512172043323517, 0.22663140296936035, 0.17568716406822205, -0.25331681966781616, -0.06211027503013611, -0.2759822607040405, 0.008237890899181366, -0.20730751752853394, 0.11882994323968887, -0.08967604488134384, 0.3535138666629791, 0.10346904397010803, 0.5145737528800964, 0.24857228994369507, -0.07682596147060394, 0.14879785478115082, -0.13404688239097595, 0.5323278307914734, -0.04541657119989395, -0.3075738549232483, 0.12392627447843552, 0.06614337861537933, 0.1468592882156372, 0.17375077307224274, -0.009694945067167282, 0.3661082684993744, 0.05991063266992569, -0.2862441837787628, -0.3014763593673706, -0.47503331303596497, -0.08671240508556366, 0.04307563230395317, 0.18472149968147278, -0.005390044301748276, 0.053294651210308075, -0.12091079354286194, 0.14919716119766235, 0.23291878402233124, 0.24201320111751556, 0.21091759204864502, -0.10202465206384659, -0.40924879908561707, -0.12845279276371002, -0.35392114520072937, 0.40559422969818115, -0.06232379376888275, 0.16944555938243866, 0.09483237564563751, -0.14070594310760498, -0.14666126668453217, -0.03858008608222008, 0.35167020559310913, -0.21527230739593506, -0.3468400239944458, 0.028907477855682373, -0.030019361525774002, -0.344295471906662, -0.09034821391105652, -0.21813392639160156, 0.3216968774795532, 0.08150876313447952, 0.2957535982131958, -0.31424635648727417, -0.26863691210746765, 0.3184225559234619, 0.29641613364219666, -0.028979044407606125, 0.01324837002903223, -0.08845983445644379, -0.2011510133743286, -0.5192661285400391, 0.10013614594936371, -0.03067128360271454, -0.0873660072684288, -0.030981527641415596, -0.04828124865889549, -0.09260924905538559, -0.17715862393379211, 0.1379724144935608, 0.16596390306949615, 0.36601749062538147, -0.12361438572406769, 0.00428420677781105, 0.14772704243659973, 0.24072201550006866, 0.4432603716850281, 0.6053474545478821, -0.041304949671030045, -0.30695101618766785, -0.19824182987213135, -0.07739075273275375, 0.2574378252029419, 0.2890996038913727, -0.129988893866539, 0.18378429114818573, 0.08896230161190033, 0.23204688727855682, -0.21331718564033508, 0.182298943400383, 0.30174553394317627, 0.127483069896698, -0.09096299111843109, 0.07301346957683563, 0.32321202754974365, 0.057248327881097794, -0.12557128071784973, 0.19962623715400696, 0.5533812642097473, -0.13667993247509003, 0.14397390186786652, 0.04677894338965416, 0.8003940582275391, 0.04031015932559967, -0.11995664238929749, 0.36146080493927, -0.0025366470217704773, 0.3991503119468689, 0.06509510427713394, 0.028908029198646545, -0.3264361619949341, -0.2815926969051361, 0.020060742273926735, -0.08601313829421997, 0.26694780588150024, -0.2120160013437271, -0.17077209055423737, 0.27241653203964233, -0.016306661069393158, -0.015141353011131287, -0.039142511785030365, 0.18157817423343658, -0.12359701842069626, -0.14947113394737244, -0.3690328598022461, 0.3043552041053772, -0.0046807825565338135, 0.09495145082473755, -0.1698182225227356, -0.07375864684581757, 0.10221946239471436, -0.3469100594520569, -0.2927998900413513, -0.06105031445622444, -0.09294282644987106, -0.06420651078224182, 0.38447678089141846, -0.1269107609987259, 0.07726113498210907, 0.13990812003612518, 0.24720695614814758, 0.2729153633117676, -0.2420404553413391, 0.051587097346782684, -0.17248106002807617, -0.042462725192308426, 0.08366400748491287, 0.116249680519104, 0.3300396502017975, -0.07930038869380951, -0.21394246816635132, 0.15412446856498718, -0.08806796371936798, -0.2949092388153076, 0.05189940333366394, -0.2506691813468933, -0.12246643006801605, -0.39146584272384644, 0.046731382608413696, -0.2539188265800476, -0.20656895637512207, -0.37448880076408386, 0.22634485363960266, 0.16006426513195038, -0.04061068966984749, 0.13576102256774902, 0.38095206022262573, -0.17221856117248535, -0.017944078892469406, 0.18509863317012787, -0.19002076983451843, -0.08910845965147018, 0.5770113468170166, 0.1365772932767868, -0.16234910488128662, -0.4259888529777527, -0.1927737593650818, 0.2125997096300125, -0.30708712339401245, 0.26190775632858276, -0.14732244610786438, -0.09774462878704071, 0.07983221858739853, 0.24742870032787323, 0.30860817432403564, 0.03682196885347366, -0.0983130931854248, -0.3773013651371002, -0.3069669008255005, 0.4574158191680908, -0.12449124455451965, 0.3503984808921814, -0.008984118700027466, 0.04459711164236069, -0.13588187098503113, 0.08836372196674347, -0.47257357835769653, 0.1526627242565155, -0.29561612010002136, -0.023008767515420914, -0.020963463932275772, -0.10297811776399612, 0.11168119311332703, -0.09232598543167114, 0.24185791611671448, 0.13384127616882324, -0.1355564147233963, -0.30029726028442383, 0.048168908804655075, 0.0687454417347908, -0.07821031659841537, -0.06456717848777771, 0.28186777234077454, 0.023778874427080154, 0.03131260722875595, -0.2135525941848755, -0.029569748789072037, -0.026982605457305908, -0.003551773726940155, 0.11503048241138458, -0.0049834586679935455, -0.09013935178518295, -0.012434884905815125, 0.06979835778474808, 0.04891548678278923, 0.052621323615312576, -0.10976413637399673, 0.05358880013227463, -0.2548917233943939, -0.20611655712127686, 0.3405177891254425, 0.21380063891410828, -0.01646967977285385, 0.21057143807411194, 0.29036659002304077, -0.04728393256664276, -0.1324620246887207, 0.1964002549648285, 0.6202715635299683, 0.2763388752937317, -0.2109309434890747, 0.13691404461860657, 0.05185019224882126, 0.33887916803359985, -0.3950304090976715, 0.03931177780032158, 0.14460299909114838, -0.08970427513122559, 0.20361846685409546, 0.2379964292049408, 0.07786513864994049, -0.16111886501312256, 0.2555355131626129, 0.2750909626483917, 0.14843903481960297, -0.09923315048217773, 0.08428861200809479, 0.025486120954155922, -0.2666907012462616, -0.21744398772716522, 0.3167886734008789, 0.005914492532610893, 0.44620639085769653, 0.23279961943626404, -0.2981754243373871, 0.21997800469398499, -0.03320259600877762, -0.034304406493902206, 0.12574070692062378, -0.1991206258535385, 0.30728185176849365, 0.028329573571681976, 0.12282201647758484, -0.168821781873703, 0.14662814140319824, 0.4850577116012573, -0.22735051810741425, -0.2788400948047638, -0.22042633593082428, 0.292411744594574, -0.16790270805358887, -0.07745328545570374, -0.17464342713356018, -0.17172983288764954, 0.055725157260894775, -0.18642708659172058, -0.03200390562415123, -0.23962904512882233, 0.2383461743593216, -0.027859598398208618, -0.10548374056816101, -0.5654128789901733, 0.07723940908908844, 0.12940575182437897, 0.37120166420936584, -0.14929816126823425, 0.18020762503147125, 0.3680660128593445, -0.11641581356525421, 0.07496362179517746, 0.657891571521759, 0.5198897123336792, 0.24778695404529572, -0.01676928997039795, 0.18431249260902405, -0.2687760889530182, -0.033189281821250916, 0.06409990042448044, 0.14463888108730316, -0.05468304455280304, -0.01256200298666954, 0.3865070641040802, 0.31688374280929565, -0.27063503861427307, 0.08986193686723709, -0.3376349210739136, 0.11725373566150665, -0.2665080726146698, 0.3187965750694275, 0.08273090422153473, -0.12427134811878204, -0.2788083553314209, -0.15374144911766052, -0.3970859944820404, -0.01461698953062296, 0.25944164395332336, -0.10463214665651321, 0.05994195491075516, -0.09872929751873016, 0.16600938141345978, -0.015091069042682648, 0.39238178730010986, 0.5781338810920715, 0.09648922085762024, -0.13470247387886047, -0.07865750044584274, -0.586921215057373, 0.07317493855953217, -0.02449968084692955, -0.14437416195869446, 0.0026865839026868343, 0.03202486038208008, 0.08196455240249634, 0.1873023509979248, 0.34747594594955444, -0.10072178393602371, 0.11765599995851517, -0.22068694233894348, -0.4999425709247589, 0.04188317432999611, 0.174239382147789, -0.20522399246692657, 0.18201594054698944, -0.047242410480976105, 0.3163224458694458, -0.15666334331035614, 0.1858472228050232, 0.2842932939529419, 0.2287938892841339, -0.033482786267995834, -0.37028825283050537, 0.3115532100200653, 0.3276892304420471, 0.12821227312088013, -0.15377187728881836, -0.15847370028495789, -0.3568763732910156, -0.34595268964767456, -0.19947977364063263, 0.32544058561325073, 0.11452461779117584, 0.4746561646461487, 0.041545167565345764, -0.1759931892156601, -0.31876346468925476, 0.10595623403787613, 0.14743909239768982, 0.16857126355171204, -0.3294524550437927, 0.38600975275039673, 0.03846203535795212, -0.06929642707109451, 0.057566847652196884, 0.059781260788440704, 0.0034734681248664856, 0.1642296463251114, -0.3594399094581604, -0.5794206261634827, 0.6390572190284729, -0.11440987884998322, -0.09404630959033966, 0.006696643307805061, 0.388427734375, 0.3299329876899719, -0.21795213222503662, -0.7061642408370972, 0.04562961310148239, 0.20746400952339172, -0.006472624838352203, -0.25425010919570923, 0.08593595027923584, -0.12021592259407043, 0.03826192393898964, 0.05691931024193764, 0.41415685415267944, 0.048789553344249725, -0.1610022932291031, 0.08372722566127777, -0.059512946754693985 ]
https://github.com/huggingface/datasets/issues/5070
Support default config name when no builder configs
Thank you for creating this feature request, Albert. For context this is the datatest where Albert has been helping me to switch to on-the-fly split config https://huggingface.co/datasets/HuggingFaceM4/cm4-synthetic-testing and the attempt to switch on-the-fly splits was here: https://huggingface.co/datasets/HuggingFaceM4/cm4-synthetic-testing/discussions/2/files but which I had to revert since providing no split breaks at run time.
**Is your feature request related to a problem? Please describe.** As discussed with @stas00, we could support defining a default config name, even if no predefined allowed config names are set. That is, support `DEFAULT_CONFIG_NAME`, even when `BUILDER_CONFIGS` is not defined. **Additional context** In order to support creating configs on the fly **by name** (not using kwargs), the list of allowed builder configs `BUILDER_CONFIGS` must not be set. However, if so, then `DEFAULT_CONFIG_NAME` is not supported.
51
Support default config name when no builder configs **Is your feature request related to a problem? Please describe.** As discussed with @stas00, we could support defining a default config name, even if no predefined allowed config names are set. That is, support `DEFAULT_CONFIG_NAME`, even when `BUILDER_CONFIGS` is not defined. **Additional context** In order to support creating configs on the fly **by name** (not using kwargs), the list of allowed builder configs `BUILDER_CONFIGS` must not be set. However, if so, then `DEFAULT_CONFIG_NAME` is not supported. Thank you for creating this feature request, Albert. For context this is the datatest where Albert has been helping me to switch to on-the-fly split config https://huggingface.co/datasets/HuggingFaceM4/cm4-synthetic-testing and the attempt to switch on-the-fly splits was here: https://huggingface.co/datasets/HuggingFaceM4/cm4-synthetic-testing/discussions/2/files but which I had to revert since providing no split breaks at run time.
[ -0.380891352891922, -0.5076113939285278, 0.1077537089586258, -0.23501767218112946, 0.14683619141578674, -0.03946516290307045, 0.2953703999519348, 0.22066837549209595, -0.009172571823000908, 0.6741185784339905, 0.3586374521255493, 0.0971921905875206, -0.2537311017513275, 0.5454229116439819, -0.03837740421295166, 0.030619893223047256, -0.3051670491695404, 0.19856968522071838, 0.29893845319747925, 0.31762832403182983, -0.32403501868247986, 0.04663226008415222, 0.025476939976215363, 0.08341910690069199, -0.4266083538532257, 0.08747594803571701, 0.09253314882516861, 0.14642100036144257, -0.0990990400314331, -0.46506068110466003, 0.18172593414783478, 0.147887721657753, -0.3476592004299164, 0.0728306770324707, -0.00011106202873634174, 0.1401950716972351, 0.4051780104637146, -0.15056154131889343, -0.3249293267726898, -0.16938571631908417, -0.28615888953208923, -0.11514689773321152, 0.01471349224448204, -0.24621418118476868, -0.4069588780403137, 0.1697777956724167, 0.0738719254732132, -0.25501030683517456, 0.09472818672657013, -0.054562196135520935, 0.16991093754768372, -0.06028226390480995, -0.21642066538333893, -0.27195632457733154, -0.12669295072555542, 0.3047407865524292, -0.3853438198566437, -0.0012972615659236908, -0.02085179090499878, 0.020484240725636482, 0.1477396935224533, 0.01864859089255333, -0.0050011295825243, -0.06326249241828918, 0.18089881539344788, -0.03871108219027519, 0.1835225522518158, -0.37113049626350403, 0.034184858202934265, 0.7130419611930847, 0.22235676646232605, -0.31486666202545166, -0.11914501339197159, -0.4089481830596924, 0.3165920078754425, -0.07723796367645264, 0.21138373017311096, 0.20200619101524353, -0.5585371255874634, 0.09650491178035736, -0.2207655906677246, -0.4166480302810669, 0.046307697892189026, -0.14841081202030182, -0.22897778451442719, 0.27948957681655884, -0.08145632594823837, 0.0719558522105217, 0.14385612308979034, -0.16199897229671478, -0.25181055068969727, -0.19429221749305725, -0.13816237449645996, 0.029376208782196045, -0.09858725965023041, -0.33853012323379517, -0.08255619555711746, 0.07411787658929825, 0.22809135913848877, 0.10043658316135406, -0.0261773020029068, 0.07442817091941833, 0.24595919251441956, 0.06867125630378723, -0.4557848572731018, 0.12536384165287018, 0.5337664484977722, -0.12179132550954819, 0.28421640396118164, 0.25464755296707153, -0.13977769017219543, 0.029758933931589127, 0.2954288721084595, -0.19086435437202454, -0.5098459124565125, -0.10922694951295853, 0.16029007732868195, 0.17550541460514069, 0.11799570173025131, -0.03952595591545105, 0.1577530801296234, 0.09780082106590271, 0.2112184315919876, 0.5031334161758423, 0.005303737707436085, -0.37991297245025635, 0.12859231233596802, -0.00008388236165046692, -0.04351925849914551, -0.24146975576877594, -0.11664249002933502, -0.31577005982398987, -0.22833406925201416, 0.2198885679244995, 0.24010275304317474, -0.23111096024513245, 0.3540251851081848, 0.2749154269695282, 0.21656951308250427, 0.08025889098644257, 0.05251727253198624, 0.4393116235733032, 0.12009464204311371, 0.30386221408843994, -0.167266845703125, -0.22377675771713257, 0.11086861789226532, -0.10256333649158478, -0.22218045592308044, 0.034926000982522964, -0.21794727444648743, -0.4642929136753082, 0.04117833077907562, 0.15458236634731293, -0.2622218132019043, 0.30248546600341797, 0.16606058180332184, 0.22741803526878357, -0.10594693571329117, 0.07170656323432922, 0.14161063730716705, 0.19638238847255707, 0.135055810213089, -0.1298927217721939, 0.3304983675479889, 0.375801682472229, 0.12395375967025757, -0.5218662023544312, 0.08541452139616013, -0.15566600859165192, -0.10489744693040848, -0.4269559681415558, -0.24563804268836975, -0.16989970207214355, -0.12238292396068573, -0.0801348015666008, 0.34188827872276306, 0.22639256715774536, 0.27066951990127563, 0.06946466863155365, -0.1445116400718689, 0.006514763459563255, 0.3995155096054077, -0.2859187722206116, -0.20731490850448608, 0.22324681282043457, 0.022968057543039322, 0.04853808879852295, -0.031819894909858704, 0.07124557346105576, -0.16550154983997345, -0.6348063349723816, -0.2888292074203491, 0.023007832467556, -0.11923268437385559, 0.0016311034560203552, -0.0169370174407959, -0.11810509860515594, 0.05940002575516701, -0.1943466067314148, -0.05391830950975418, -0.027871374040842056, 0.13207057118415833, -0.01765233278274536, -0.008270267397165298, -0.04340222850441933, -0.6075846552848816, 0.45169439911842346, -0.22191202640533447, 0.17820186913013458, 0.23751652240753174, -0.31553328037261963, 0.12451206892728806, -0.18027794361114502, -0.03928708657622337, -0.027761928737163544, 0.10172908008098602, 0.22546608746051788, -0.08665692806243896, -0.12509915232658386, -0.5236242413520813, 0.036983296275138855, -0.38901063799858093, 0.43354177474975586, -0.03800855949521065, 0.040844038128852844, 0.23553621768951416, -0.10256905108690262, -0.1543584167957306, 0.17151516675949097, -0.09455540031194687, -0.08400681614875793, 0.17590540647506714, 0.5046544075012207, 0.03104773908853531, 0.11189783364534378, -0.16943144798278809, 0.018420815467834473, 0.054176561534404755, 0.038170475512742996, 0.009647391736507416, 0.03590358421206474, -0.18854419887065887, -0.025202780961990356, -0.2109718918800354, 0.5702484846115112, 0.1577044278383255, 0.24623480439186096, 0.04797421395778656, -0.12578754127025604, -0.135934978723526, -0.3768216669559479, -0.30104127526283264, -0.2496269792318344, 0.07310030609369278, -0.2567158639431, 0.404245525598526, -0.11590124666690826, -0.3532545268535614, -0.3764480948448181, 0.17593351006507874, 0.0905982255935669, -0.1519281268119812, 0.0034567788243293762, 0.17001691460609436, 0.18669357895851135, -0.03907614201307297, 0.05485646799206734, 0.3040114641189575, 0.3257681429386139, -0.2557065188884735, 0.05248178914189339, -0.29092782735824585, -0.08971651643514633, 0.38798630237579346, -0.06140910089015961, 0.14952850341796875, 0.26511114835739136, -0.020343191921710968, -0.2426251918077469, -0.17234444618225098, -0.09155265986919403, 0.3382430076599121, -0.27095386385917664, -0.22166460752487183, -0.09510926902294159, -0.10137855261564255, -0.12585392594337463, -0.21963003277778625, -0.32033827900886536, -0.4867295026779175, -0.11747568845748901, 0.18348844349384308, -0.16080403327941895, -0.23219594359397888, 0.35139361023902893, -0.20417621731758118, 0.6930553317070007, -0.22102254629135132, -0.38587889075279236, -0.31677916646003723, 0.22291143238544464, 0.17279642820358276, 0.022845596075057983, -0.07647103071212769, -0.30072247982025146, 0.1467362344264984, 0.04146520048379898, -0.16071772575378418, 0.08108416944742203, -0.3805786967277527, 0.3361937999725342, 0.08921819925308228, 0.4939478039741516, 0.5686809420585632, -0.10315890610218048, 0.6224694848060608, -0.5298707485198975, 0.3675946891307831, 0.16462720930576324, 0.11023354530334473, -0.2295992523431778, 0.31759777665138245, 0.09521469473838806, -0.3910473883152008, 0.1323901116847992, 0.06538901478052139, -0.33965325355529785, 0.21460330486297607, -0.01012321375310421, 0.0008670054376125336, 0.32654744386672974, -0.12397746741771698, 0.011924603022634983, -0.4762266278266907, 0.18630889058113098, -0.007012084126472473, -0.3137986660003662, -0.04329164698719978, -0.08081718534231186, 0.2799757421016693, -0.07233018428087234, -0.2595612406730652, 0.28453370928764343, -0.14010481536388397, -0.20293858647346497, 0.10142987221479416, -0.26387855410575867, 0.549053966999054, 0.02219310589134693, -0.06932049244642258, 0.26082009077072144, 0.3548920750617981, -0.10319313406944275, -0.05480286851525307, -0.1855180561542511, 0.27283480763435364, 0.03532892093062401, 0.3217836916446686, 0.33083340525627136, -0.07480000704526901, -0.07548932731151581, 0.710297703742981, -0.03504615277051926, -0.1450604945421219, -0.01952385902404785, -0.28903940320014954, 0.1927655041217804, -0.20446684956550598, -0.1835625022649765, 0.05740891024470329, 0.23863378167152405, 0.024205628782510757, 0.3693857192993164, 0.07028169184923172, -0.014031501486897469, -0.47008877992630005, 0.08867806196212769, 0.3248884975910187, -0.4616330862045288, -0.15892116725444794, -0.0137254036962986, 0.27283382415771484, -0.10330374538898468, 0.14377936720848083, -0.17619968950748444, 0.015923792496323586, 0.05379697307944298, 0.5677909851074219, 0.09882625192403793, -0.036793384701013565, -0.3272818624973297, 0.037295807152986526, -0.12049286812543869, 0.1872580647468567, -0.010433035902678967, -0.1422865241765976, -0.04032515734434128, -0.15328767895698547, 0.16584569215774536, 0.1536371111869812, 0.38389289379119873, -0.1693856567144394, -0.16627736389636993, 0.3910093307495117, 0.05687671899795532, 0.12746483087539673, -0.11549122631549835, 0.3456465005874634, 0.05354505032300949, 0.28725603222846985, 0.45764702558517456, -0.3732524514198303, -0.47548559308052063, 0.11695504188537598, 0.01851239986717701, -0.15924879908561707, -0.159833624958992, -0.31335684657096863, 0.1525585651397705, 0.012899523600935936, 0.03478586673736572, -0.21439403295516968, 0.13067981600761414, -0.12211442738771439, 0.2650318145751953, -0.09256753325462341, -0.07158426195383072, 0.048728447407484055, 0.2752173840999603, 0.08828939497470856, -0.12231608480215073, 0.22164133191108704, 0.21061035990715027, 0.0920950397849083, -0.025901222601532936, 0.09957800805568695, -0.17519550025463104, -0.074704110622406, -0.1242903396487236, 0.07046084851026535, 0.4782666862010956, 0.5844141244888306, 0.07601872831583023, 0.34408214688301086, 0.06946511566638947, 0.3761257529258728, -0.3531835973262787, 0.08030165731906891, 0.16103266179561615, -0.2280701845884323, -0.18326883018016815, -0.2626027762889862, 0.5199111700057983, -0.2911060154438019, 0.10383337736129761, 0.45084723830223083, 0.5117689967155457, -0.4248191714286804, 0.09716355055570602, 0.016001716256141663, 0.8909463882446289, 0.44143539667129517, 0.022432593628764153, 0.04383350908756256, -0.016608301550149918, 0.07775263488292694, -0.05991271883249283, 0.3826417326927185, -0.2738910913467407, 0.05270729213953018, 0.07989253848791122, -0.1973276436328888, 0.5920778512954712, 0.18196764588356018, -0.26121169328689575, 0.00825541839003563, 0.15935803949832916, 0.2474450021982193, 0.02788855880498886, 0.18422681093215942, -0.3317068815231323, -0.34822919964790344, -0.08093312382698059, 0.004892174154520035, -0.09034891426563263, 0.4088917374610901, 0.12624356150627136, -0.19320905208587646, 0.37765341997146606, 0.00034141913056373596, -0.09856383502483368, -0.17407330870628357, -0.36698344349861145, -0.41946256160736084, 0.37534117698669434, 0.19452480971813202, 0.2042250782251358, 0.024220621213316917, 0.15554070472717285, 0.5939760804176331, -0.2363661229610443, 0.3134708106517792, 0.08700457960367203, 0.19976545870304108, -0.06108798831701279, -0.003829440101981163, 0.4616345763206482, -0.02328656055033207, -0.18624597787857056, 0.08110619336366653, -0.20950335264205933, -0.11251434683799744, -0.05298002064228058, -0.17982931435108185, 0.03817281126976013, -0.49210208654403687, 0.08722388744354248, 0.06695304811000824, 0.3709811568260193, -0.14831514656543732, 0.14968430995941162, -0.3093600869178772, -0.29352059960365295, 0.03231571987271309, -0.1108807921409607, -0.2517520487308502, -0.22359029948711395, -0.012961529195308685, -0.19420844316482544, 0.12869954109191895, 0.13189315795898438, -0.41079095005989075, -0.049614109098911285, -0.06189403310418129, 0.3223154842853546, 0.02892048843204975, -0.3305180072784424, 0.19364359974861145, 0.36907923221588135, -0.36573711037635803, 0.11074455827474594, 0.5101174116134644, 0.14723041653633118, 0.24570518732070923, -0.1466846913099289, 0.06748728454113007, -0.07044053077697754, 0.0901629775762558, -0.06814877688884735, 0.4022112488746643, 0.12106835097074509, 0.5318856239318848, -0.004633631557226181, -0.06394392251968384, -0.35530605912208557, 0.0318753644824028, -0.14555662870407104, 0.1708364635705948, -0.13213767111301422, 0.03730406612157822, 0.021333303302526474, -0.017045576125383377, 0.18496887385845184, -0.23115478456020355, -0.18446099758148193, -0.19185087084770203, -0.236631378531456, 0.18862710893154144, -0.19887715578079224, 0.2558186650276184, 0.10051947087049484, -0.15148530900478363, -0.06306970119476318, -0.16763222217559814, 0.3518221974372864, 0.06897931545972824, -0.0721539855003357, -0.011186514981091022, 0.20704010128974915, 0.14991283416748047, -0.2850133776664734, 0.2000994086265564, 0.11476145684719086, 0.22581788897514343, 0.0039787753485143185, 0.07712632417678833, -0.7702797651290894, 0.030792199075222015, 0.4483330547809601, 0.22296655178070068, -0.25794070959091187, 0.14977248013019562, 0.18795394897460938, 0.13343596458435059, -0.22233444452285767, -0.04622931778430939, 0.24409684538841248, 0.06112099438905716, -0.15142032504081726, 0.12607619166374207, 0.3827712833881378, 0.19663792848587036, -0.1439085155725479, -0.024572020396590233, 0.06974955648183823, -0.025436565279960632, 0.5261229872703552, 0.4161255955696106, 0.40924641489982605, -0.07638617604970932, 0.2197008579969406, 0.020371947437524796, -0.036803584545850754, -0.19009818136692047, 0.26640528440475464, 0.6332343816757202, -0.022546634078025818, 0.11190995573997498, 0.5254308581352234, 0.025568868964910507, 0.22648656368255615, -0.13722003996372223, 0.07089641690254211, 0.1925356239080429, -0.008824899792671204, -0.050053562968969345, 0.24284952878952026, -0.19493786990642548, 0.29991835355758667, -0.22825762629508972, -0.293981671333313, 0.21649357676506042, -0.14095889031887054, 0.3358854055404663, -0.5508541464805603, 0.06029261648654938, -0.238084614276886, 0.06125809997320175, -0.2641465663909912, -0.3355052173137665, -0.07323907315731049, -0.27265244722366333, -0.0964365154504776, 0.009300872683525085, 0.07761619985103607, -0.07634787261486053, 0.20707452297210693, -0.13383916020393372, 0.3004586100578308, 0.3373704254627228, -0.0061494410037994385, 0.22425112128257751, 0.3479205071926117, -0.39344173669815063, 0.2645963430404663, 0.13298232853412628, -0.07201802730560303, 0.18071161210536957, 0.3206939399242401, 0.11940327286720276, -0.08324059098958969, -0.03208783268928528, -0.13385409116744995, 0.1740516871213913, 0.04235394299030304, -0.1625630408525467, -0.03954190015792847, 0.2687470316886902, -0.05047046020627022, 0.34820231795310974, 0.1952279657125473, -0.18820315599441528, -0.3794015049934387, -0.17167922854423523, 0.18591761589050293, -0.47708696126937866, 0.19618961215019226, 0.26054078340530396, 0.10197841376066208, -0.013544641435146332, 0.05630610138177872, -0.2660963237285614, -0.02819099649786949, 0.08425858616828918, 0.020785193890333176, -0.05052788183093071, 0.09512452036142349, 0.07376774400472641, 0.032801151275634766, 0.33990034461021423, -0.39031437039375305, -0.4191618859767914, -0.21346598863601685, -0.28594183921813965, 0.048200823366642, -0.25417518615722656, 0.24443121254444122, -0.18619270622730255, 0.040094248950481415, -0.1791333258152008, 0.24569296836853027, -0.1351306140422821, -0.17591895163059235, -0.14988207817077637, 0.4127907454967499, 0.11025387048721313, -0.08419471234083176, -0.29657354950904846, 0.07972162216901779, -0.13658885657787323, 0.1103762835264206, -0.27657169103622437, 0.0034989453852176666, 0.19568245112895966, -0.07539834082126617, 0.05158237740397453, 0.1449676901102066, 0.494596004486084, -0.18500526249408722, 0.006854906678199768, -0.07116274535655975, 0.0007072985172271729, -0.12601903080940247, -0.3166464567184448, -0.09851424396038055, -0.1494087278842926, -0.23080740869045258, -0.030488692224025726, 0.06925424933433533, 0.09194213896989822, -0.08617832511663437, -0.24387545883655548, -0.4176885187625885, -0.0032379217445850372, 0.32843518257141113, 0.14043721556663513, -0.07273406535387039, -0.05322028696537018, -0.2605706751346588, -0.031395893543958664, 0.4112100601196289, 0.39177271723747253, -0.11970865726470947, 0.07921826094388962, -0.08602238446474075, -0.19466178119182587, 0.6963403820991516, 0.21047501266002655, -0.19978171586990356, -0.29618754982948303, 0.30471187829971313, 0.18727169930934906, 0.13922551274299622, -0.21540018916130066, -0.06454041600227356, 0.378471314907074, -0.14772742986679077, -0.03855248540639877, 0.20398253202438354, -0.04043305292725563, -0.14790846407413483, -0.16054010391235352, 0.07773223519325256, 0.23260733485221863, 0.009385460987687111, -0.33023226261138916, -0.12372343987226486 ]
https://github.com/huggingface/datasets/issues/5061
`_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map`
This is maybe related to python 3.10, do you think you could try on 3.8 ? In the meantime we'll keep improving the support for 3.10. Let me add a dedicated CI
## Describe the bug When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`. ``` File "~/project/dataset.py", line 204, in <dictcomp> split: dataset.map( File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map transformed_shards[index] = async_result.get() File ".../site-packages/multiprocess/pool.py", line 771, in get raise self._value File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks put(task) File ".../site-packages/multiprocess/connection.py", line 214, in send self._send_bytes(_ForkingPickler.dumps(obj)) File ".../site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File ".../site-packages/dill/_dill.py", line 620, in dump StockPickler.dump(self, obj) File ".../pickle.py", line 487, in dump self.save(obj) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 902, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 578, in save rv = reduce(self.proto) File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') _pickle.PicklingError: logger cannot be pickled ``` ## Steps to reproduce the bug Sorry I failed to have a minimal reproducible example, but the offending line on my end is ```python dataset.map( lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda batched=True, num_proc=4, ) ``` This does work when `num_proc=1`, so it's likely a multiprocessing thing. ## Expected results `map` succeeds ## Actual results The error trace above. ## Environment info - `datasets` version: 1.16.1 and 2.5.1 both failed - Platform: Ubuntu 20.04.4 LTS - Python version: 3.10.4 - PyArrow version: 9.0.0
32
`_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map` ## Describe the bug When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`. ``` File "~/project/dataset.py", line 204, in <dictcomp> split: dataset.map( File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map transformed_shards[index] = async_result.get() File ".../site-packages/multiprocess/pool.py", line 771, in get raise self._value File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks put(task) File ".../site-packages/multiprocess/connection.py", line 214, in send self._send_bytes(_ForkingPickler.dumps(obj)) File ".../site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File ".../site-packages/dill/_dill.py", line 620, in dump StockPickler.dump(self, obj) File ".../pickle.py", line 487, in dump self.save(obj) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 902, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 578, in save rv = reduce(self.proto) File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') _pickle.PicklingError: logger cannot be pickled ``` ## Steps to reproduce the bug Sorry I failed to have a minimal reproducible example, but the offending line on my end is ```python dataset.map( lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda batched=True, num_proc=4, ) ``` This does work when `num_proc=1`, so it's likely a multiprocessing thing. ## Expected results `map` succeeds ## Actual results The error trace above. ## Environment info - `datasets` version: 1.16.1 and 2.5.1 both failed - Platform: Ubuntu 20.04.4 LTS - Python version: 3.10.4 - PyArrow version: 9.0.0 This is maybe related to python 3.10, do you think you could try on 3.8 ? In the meantime we'll keep improving the support for 3.10. Let me add a dedicated CI
[ -0.1704784780740738, -0.24004438519477844, -0.041077468544244766, 0.14504089951515198, -0.08370185643434525, 0.0011461451649665833, 0.33660608530044556, 0.16821591556072235, 0.6493862867355347, 0.165668785572052, -0.03523249924182892, 0.6121383905410767, -0.26885202527046204, 0.08796777576208115, -0.32229945063591003, -0.17099377512931824, -0.050248272716999054, -0.013430632650852203, -0.3029886484146118, 0.16521316766738892, -0.1052873358130455, 0.2245742529630661, -0.1888790726661682, 0.11316327750682831, -0.3706149160861969, -0.21305814385414124, -0.12412317842245102, 0.24962061643600464, 0.11869160830974579, -0.40181857347488403, -0.20109935104846954, -0.2191820740699768, -0.233134925365448, 0.6415014266967773, -0.00011209521471755579, 0.059975892305374146, 0.18194103240966797, 0.06277265399694443, -0.07400974631309509, -0.3015989065170288, -0.1970399022102356, -0.19252793490886688, 0.10213652998209, -0.21372488141059875, 0.3513124883174896, -0.07654386013746262, 0.28693756461143494, -0.19967922568321228, 0.42255210876464844, -0.05262758210301399, 0.19537729024887085, 0.17559655010700226, 0.23653610050678253, -0.02188122645020485, -0.2125009298324585, 0.10003500431776047, -0.07670257240533829, 0.2840968072414398, 0.06711253523826599, -0.07933622598648071, -0.35391995310783386, 0.2236059159040451, -0.11019428819417953, 0.08235591650009155, -0.1474463939666748, -0.0642785057425499, 0.3382282257080078, -0.2574777603149414, 0.08554404973983765, 0.18800252676010132, -0.013699673116207123, -0.23369437456130981, -0.20503021776676178, -0.1721433848142624, -0.2121858298778534, -0.29711228609085083, 0.09739673137664795, 0.05006092041730881, -0.17859503626823425, -0.073691725730896, 0.3107518255710602, -0.31532108783721924, 0.1311245858669281, -0.0046231746673583984, 0.12821543216705322, 0.35646528005599976, -0.017335616052150726, 0.32920873165130615, 0.37990784645080566, 0.09955599904060364, -0.37651002407073975, 0.0625389814376831, 0.03858529031276703, -0.10501561313867569, -0.3200284242630005, 0.094119131565094, 0.15197762846946716, -0.11490125209093094, -0.22326987981796265, 0.12216465175151825, -0.11910201609134674, 0.058067500591278076, 0.15117327868938446, 0.3639531433582306, 0.48530733585357666, -0.3401527404785156, -0.017741382122039795, 0.650530219078064, 0.3552256226539612, -0.13898347318172455, -0.2885074317455292, 0.05969662219285965, 0.21884877979755402, -0.41348645091056824, 0.1373370736837387, 0.19189900159835815, 0.10112026333808899, 0.032825175672769547, 0.034688644111156464, -0.16664724051952362, -0.08020608127117157, -0.11547708511352539, 0.07847858965396881, 0.28991973400115967, -0.10086510330438614, 0.03433104604482651, 0.08395908027887344, 0.16173996031284332, -0.13077692687511444, 0.18028850853443146, -0.2946016192436218, 0.15217413008213043, -0.13166822493076324, 0.039721034467220306, -0.21121437847614288, -0.14016932249069214, 0.24856489896774292, 0.07455906271934509, -0.19074587523937225, -0.016593609005212784, 0.1955927610397339, -0.3056179881095886, -0.07898259907960892, 0.1841895580291748, 0.16997776925563812, -0.03085997700691223, 0.18571153283119202, -0.35464662313461304, -0.08246448636054993, -0.11294164508581161, -0.2949376702308655, -0.16296789050102234, -0.3751789331436157, 0.1034005880355835, 0.1424638032913208, 0.16409282386302948, -0.3851533532142639, -0.16978953778743744, 0.3694053590297699, -0.05189821124076843, -0.07502084225416183, -0.37109988927841187, -0.05157666653394699, -0.32638344168663025, 0.030750853940844536, 0.3205620050430298, 0.007628709077835083, -0.08481844514608383, -0.4513487219810486, -0.16425520181655884, 0.5453606247901917, 0.20331457257270813, 0.046673428267240524, 0.12039972841739655, -0.2639197111129761, 0.6925797462463379, 0.1258644461631775, -0.15644218027591705, 0.004957291763275862, 0.18578147888183594, -0.24214044213294983, 0.12166822701692581, 0.3669721186161041, -0.23800630867481232, -0.021666960790753365, 0.01562727615237236, 0.14275163412094116, 0.06817124783992767, 0.09340783208608627, 0.10989224165678024, -0.2171785831451416, 0.10519155859947205, 0.07313521206378937, 0.0005865395069122314, 0.19426564872264862, -0.24931734800338745, 0.10300279408693314, -0.3087391257286072, 0.37112903594970703, -0.028194207698106766, 0.128870889544487, 0.01668398827314377, 0.17829589545726776, 0.09072443097829819, -0.09015759825706482, -0.22090619802474976, -0.2847069203853607, 0.16988784074783325, -0.45585817098617554, -0.18209438025951385, -0.15979187190532684, 0.05297170579433441, 0.2339477837085724, 0.0603041797876358, -0.36281201243400574, 0.03362007811665535, 0.20383162796497345, 0.35447758436203003, -0.062169238924980164, -0.08158120512962341, -0.011951450258493423, 0.00007910653948783875, -0.05918613821268082, 0.018251318484544754, -0.1544666290283203, 0.1030149906873703, -0.43285852670669556, -0.28121405839920044, -0.14611659944057465, 0.1256284862756729, 0.13000482320785522, 0.015225597657263279, 0.007780698128044605, 0.10461007803678513, 0.29907065629959106, 0.28983452916145325, 0.2601819634437561, -0.24916206300258636, -0.0427132248878479, -0.07894128561019897, -0.09569526463747025, 0.2436741590499878, 0.033528413623571396, -0.23261338472366333, 0.21345335245132446, -0.02391098439693451, 0.39122241735458374, 0.21630007028579712, -0.11306619644165039, 0.29020455479621887, -0.10698237270116806, -0.0774587094783783, 0.17940960824489594, -0.05177346616983414, 0.13702775537967682, -0.27100610733032227, 0.31787440180778503, -0.1485898345708847, -0.4968014657497406, -0.08835072070360184, 0.2608257234096527, 0.29720985889434814, 0.4398045539855957, -0.08921501785516739, -0.09573722630739212, -0.07763515412807465, 0.13454033434391022, -0.04596628248691559, 0.2742013931274414, 0.07877156138420105, 0.01847153529524803, -0.13915075361728668, 0.17491433024406433, -0.07709453999996185, 0.0656047910451889, -0.0784899890422821, 0.1917261779308319, 0.5188334584236145, 0.08646082133054733, -0.010545103810727596, -0.009708825498819351, -0.2665615975856781, -0.025392204523086548, 0.01778111606836319, -0.1376716047525406, -0.018247229978442192, -0.3838404715061188, 0.22477436065673828, -0.14697276055812836, 0.08258221298456192, -0.10104474425315857, -0.35736018419265747, -0.020907144993543625, 0.24943436682224274, -0.4651641249656677, 0.254553884267807, -0.09384000301361084, -0.14038391411304474, -0.24442891776561737, 0.1275293231010437, -0.11448819935321808, -0.24123941361904144, 0.0132768414914608, 0.0045743584632873535, 0.353376179933548, -0.026737568899989128, 0.29966962337493896, 0.3109329342842102, -0.4942317605018616, -0.23676267266273499, 0.015579476952552795, 0.016226187348365784, -0.11317919194698334, 0.07046642154455185, 0.42205506563186646, 0.12781038880348206, -0.09805849194526672, -0.3609545826911926, 0.20968253910541534, -0.1687198430299759, -0.19041189551353455, -0.045019276440143585, -0.050574593245983124, 0.006988425739109516, 0.006827730685472488, -0.17888352274894714, -0.6229405403137207, -0.45987996459007263, 0.49268555641174316, -0.08657306432723999, 0.2919169068336487, 0.183648020029068, 0.0261395201086998, 0.17058147490024567, -0.16887253522872925, 0.16290172934532166, -0.0648624375462532, 0.12947431206703186, -0.05898791179060936, -0.17726168036460876, -0.06883369386196136, -0.1580818146467209, 0.04024672508239746, -0.06813861429691315, -0.32513004541397095, -0.28763726353645325, 0.10712376236915588, -0.214109405875206, 0.2494438886642456, -0.025885500013828278, 0.1951064020395279, 0.1918053925037384, 0.3971101939678192, -0.1702331006526947, 0.02347293496131897, -0.15227752923965454, 0.14785027503967285, 0.34795916080474854, 0.32204338908195496, 0.19725927710533142, -0.1253865361213684, 0.06685128808021545, 0.9068630337715149, 0.25261855125427246, -0.04650525376200676, 0.23119208216667175, 0.02998652681708336, -0.026535604149103165, 0.029561471194028854, -0.46304112672805786, 0.06973449140787125, -0.212996244430542, 0.057243719696998596, -0.0741211473941803, -0.2855481505393982, -0.16521118581295013, -0.004921872168779373, 0.21444925665855408, -0.284965455532074, -0.2162206918001175, 0.2168060839176178, -0.06855296343564987, -0.2032662332057953, -0.3249015808105469, -0.1985834240913391, -0.06658226251602173, 0.17310655117034912, -0.01710101217031479, -0.024665862321853638, 0.32053351402282715, -0.0872030183672905, 0.1267101764678955, -0.3690234422683716, -0.46367478370666504, 0.36173945665359497, 0.06265253573656082, -0.08774380385875702, -0.2605329751968384, -0.1760990023612976, -0.09211824834346771, 0.021505506709218025, 0.40400266647338867, -0.159867063164711, 0.10531842708587646, 0.22696155309677124, -0.13349038362503052, 0.015870748087763786, -0.061867401003837585, -0.1209435909986496, 0.7046935558319092, 0.26756858825683594, 0.20654919743537903, -0.2737477719783783, -0.14233803749084473, 0.02356860600411892, 0.14196276664733887, -0.08466936647891998, -0.038889236748218536, -0.24659842252731323, -0.07768283039331436, -0.13849525153636932, 0.15510980784893036, 0.08232703804969788, 0.25174278020858765, 0.09778950363397598, -0.09174385666847229, 0.17398591339588165, -0.14940081536769867, -0.18939439952373505, -0.18034522235393524, 0.23600459098815918, -0.29632458090782166, 0.10126610100269318, 0.13477107882499695, 0.39963310956954956, 0.22752058506011963, 0.3450799584388733, -0.42172396183013916, 0.03918100893497467, 0.2157452404499054, 0.02340482920408249, 0.1936129927635193, 0.03251489996910095, 0.002387627027928829, 0.27431073784828186, 0.05858875811100006, 0.42277395725250244, 0.03989139944314957, -0.1367851346731186, 0.2579230070114136, 0.04706263914704323, -0.15529747307300568, 0.18694356083869934, 0.47681519389152527, 0.28563281893730164, 0.10260093212127686, 0.6579890847206116, -0.4336269497871399, -0.18972976505756378, 0.2837598919868469, -0.1231168881058693, 0.7337725758552551, 0.022805269807577133, -0.013860125094652176, 0.0023871324956417084, -0.06097327917814255, 0.0003734568599611521, 0.28470945358276367, 0.036073699593544006, -0.3258834779262543, -0.00584940891712904, 0.1026209145784378, -0.1991177648305893, 0.1262008547782898, 0.05941850692033768, -0.3438444137573242, 0.19911083579063416, -0.3975822329521179, -0.33620885014533997, -0.18486736714839935, 0.2708461284637451, 0.08969013392925262, -0.08295276761054993, 0.18736021220684052, 0.10115489363670349, 0.03846631944179535, 0.23466795682907104, 0.04233868420124054, -0.12158203125, 0.19061152637004852, -0.22102682292461395, -0.42906486988067627, 0.07426125556230545, 0.00719881197437644, 0.4756898880004883, 0.16636714339256287, -0.02970362827181816, -0.09443017840385437, 0.10736368596553802, -0.5213296413421631, -0.14292313158512115, 0.1034640222787857, 0.04158322140574455, 0.17803692817687988, -0.01904110796749592, -0.13567335903644562, 0.11099568009376526, 0.19868721067905426, -0.10856305062770844, -0.2663596570491791, 0.10721215605735779, -0.2340518832206726, -0.7553526759147644, -0.04188697785139084, 0.33403706550598145, -0.029433615505695343, 0.2158505916595459, -0.07697153091430664, -0.06427580118179321, -0.3720512390136719, -0.28051528334617615, 0.140474334359169, 0.22988319396972656, -0.2416871190071106, 0.5183645486831665, -0.37618523836135864, -0.06297776103019714, 0.07730042934417725, 0.3479664921760559, -0.002854354679584503, 0.34368351101875305, 0.3331749439239502, 0.32585233449935913, -0.19133631885051727, -0.305093377828598, -0.22743266820907593, -0.12431257218122482, 0.16755327582359314, 0.48446527123451233, -0.11688634753227234, 0.03310732543468475, -0.1379634439945221, 0.25070545077323914, 0.15605010092258453, 0.2012852132320404, -0.18768815696239471, -0.4076804220676422, -0.2377675324678421, 0.18597200512886047, -0.15692231059074402, 0.18495303392410278, -0.013951374217867851, 0.3558984100818634, 0.015717899426817894, 0.48014140129089355, -0.29436564445495605, 0.05423825979232788, -0.4230455160140991, 0.03771335259079933, 0.2523268461227417, -0.09448010474443436, 0.015360996127128601, 0.17075799405574799, 0.2082729935646057, 0.22203350067138672, -0.049618806689977646, -0.23021200299263, 0.04354168102145195, 0.08486846089363098, 0.14167004823684692, 0.0698947012424469, 0.0670560672879219, 0.05648791790008545, 0.03253840655088425, -0.03740871697664261, 0.011158071458339691, 0.2606784403324127, -0.11184777319431305, 0.10307959467172623, 0.11549834907054901, 0.007746703922748566, 0.1670437604188919, 0.12410443276166916, -0.050254493951797485, -0.15430258214473724, -0.12794823944568634, 0.35805073380470276, 0.11390269547700882, -0.0791548565030098, 0.12324996292591095, -0.23201268911361694, -0.08424265682697296, -0.0035069361329078674, 0.14964710175991058, -0.0651816800236702, -0.4138964116573334, 0.004696729127317667, 0.461696982383728, 0.2218674272298813, -0.16660986840724945, 0.16210173070430756, 0.011004989966750145, 0.22539377212524414, -0.22132508456707, -0.04274721071124077, 0.20037661492824554, 0.13664564490318298, 0.11758999526500702, 0.0076933354139328, -0.14028231799602509, -0.09212825447320938, -0.21149493753910065, 0.23746836185455322, -0.13890720903873444, -0.4486119747161865, 0.25004780292510986, -0.06480343639850616, -0.09609659016132355, 0.021168682724237442, 0.4194360673427582, 0.14149287343025208, 0.2939731776714325, 0.08178657293319702, -0.147874116897583, 0.14870670437812805, -0.270449697971344, -0.18264369666576385, 0.11831251531839371, -0.4652427136898041, 0.5194094181060791, 0.3894754648208618, -0.18036982417106628, 0.05610617622733116, -0.1623348891735077, 0.6842086911201477, -0.6786056160926819, -0.25967535376548767, 0.0027586277574300766, 0.4400864839553833, -0.27193543314933777, -0.06336300820112228, -0.13350346684455872, -0.027554411441087723, -0.09364712983369827, -0.04399257153272629, 0.2462596744298935, 0.03162171319127083, 0.653125524520874, 0.1571011245250702, -0.2743206024169922, -0.1304512619972229, -0.42904531955718994, 0.12086652964353561, 0.37495240569114685, -0.32881373167037964, -0.15235480666160583, 0.22777822613716125, -0.13894091546535492, -0.4794405996799469, 0.2785640060901642, 0.583191454410553, 0.225002720952034, -0.3686278164386749, -0.04382682964205742, 0.07692733407020569, -0.04976961761713028, -0.11938832700252533, 0.19530227780342102, -0.1265898495912552, -0.32472604513168335, 0.44099289178848267, 0.11402396857738495, -0.21896013617515564, -0.002197299152612686, 0.29075244069099426, 0.5587812662124634, 0.19746507704257965, 0.312686026096344, 0.016303444281220436, -0.32658258080482483, 0.3178251087665558, -0.21372252702713013, -0.4146823585033417, -0.09911505877971649, 0.3258882761001587, -0.15123684704303741, 0.1396869719028473, -0.17479492723941803, 0.12294220924377441, 0.05640238896012306, 0.22463740408420563, 0.3077670633792877, 0.003821704536676407, -0.38448822498321533, 0.17235194146633148, -0.14357419312000275, 0.32169708609580994, -0.3216906785964966, -0.3851219117641449, -0.2629864811897278, 0.284455269575119, 0.02686571329832077, 0.11633354425430298, 0.3460359573364258, -0.018508749082684517, 0.3481579124927521, 0.458171546459198, -0.20159243047237396, 0.11421741545200348, 0.06446155160665512, -0.3000822067260742, 0.3950977325439453, -0.3944608271121979, 0.14359638094902039, 0.08267617970705032, 0.12491969019174576, -0.21823792159557343, -0.20626670122146606, 0.2417985498905182, 0.018207397311925888, 0.29933685064315796, -0.06259022653102875, 0.37658268213272095, -0.35516253113746643, -0.22531291842460632, 0.10164898633956909, -0.09849686175584793, -0.23874546587467194, -0.30215856432914734, 0.027998294681310654, 0.385017991065979, -0.23117336630821228, 0.16636092960834503, -0.5321101546287537, 0.3899178206920624, -0.21830613911151886, -0.040129244327545166, 0.22905944287776947, -0.0058150216937065125, 0.29226526618003845, -0.19208471477031708, 0.09730932861566544, 0.26122817397117615, -0.14023292064666748, 0.04375508427619934, -0.3807435631752014, -0.4251602590084076, 0.4777180254459381, -0.2350882887840271, -0.1449417918920517, -0.3279189467430115, 0.32750052213668823, -0.3646610677242279, 0.2586278021335602, -0.27319929003715515, -0.05824128910899162, 0.2463684380054474, 0.09073108434677124, -0.1478208601474762, 0.011269538663327694, -0.011063281446695328, -0.08079221099615097, 0.09312708675861359, 0.4482799470424652, 0.06931573152542114, -0.1364249587059021, 0.18685446679592133, -0.20622846484184265 ]
https://github.com/huggingface/datasets/issues/5061
`_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map`
I did some binary search and seems like the root cause is either `multiprocess` or `dill`. python 3.10 is fine. Specifically: - `multiprocess==0.70.12.2, dill==0.3.4`: works - `multiprocess==0.70.12.2, dill==0.3.5.1`: doesn't work - `multiprocess==0.70.13, dill==0.3.5.1`: doesn't work - `multiprocess==0.70.13, dill==0.3.4`: can't test, `multiprocess==0.70.13` requires `dill>=0.3.5.1` I will pin their versions on my end. I don't have enough knowledge of how python multiprocessing works to debug this, but ideally there could be a fix. It's also possible that I'm doing something wrong in my code, but again the `.name` of the logger that failed to pickle is `datasets.fingerprint`, which I'm not using directly.
## Describe the bug When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`. ``` File "~/project/dataset.py", line 204, in <dictcomp> split: dataset.map( File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map transformed_shards[index] = async_result.get() File ".../site-packages/multiprocess/pool.py", line 771, in get raise self._value File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks put(task) File ".../site-packages/multiprocess/connection.py", line 214, in send self._send_bytes(_ForkingPickler.dumps(obj)) File ".../site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File ".../site-packages/dill/_dill.py", line 620, in dump StockPickler.dump(self, obj) File ".../pickle.py", line 487, in dump self.save(obj) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 902, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 578, in save rv = reduce(self.proto) File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') _pickle.PicklingError: logger cannot be pickled ``` ## Steps to reproduce the bug Sorry I failed to have a minimal reproducible example, but the offending line on my end is ```python dataset.map( lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda batched=True, num_proc=4, ) ``` This does work when `num_proc=1`, so it's likely a multiprocessing thing. ## Expected results `map` succeeds ## Actual results The error trace above. ## Environment info - `datasets` version: 1.16.1 and 2.5.1 both failed - Platform: Ubuntu 20.04.4 LTS - Python version: 3.10.4 - PyArrow version: 9.0.0
100
`_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map` ## Describe the bug When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`. ``` File "~/project/dataset.py", line 204, in <dictcomp> split: dataset.map( File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map transformed_shards[index] = async_result.get() File ".../site-packages/multiprocess/pool.py", line 771, in get raise self._value File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks put(task) File ".../site-packages/multiprocess/connection.py", line 214, in send self._send_bytes(_ForkingPickler.dumps(obj)) File ".../site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File ".../site-packages/dill/_dill.py", line 620, in dump StockPickler.dump(self, obj) File ".../pickle.py", line 487, in dump self.save(obj) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 902, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 578, in save rv = reduce(self.proto) File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') _pickle.PicklingError: logger cannot be pickled ``` ## Steps to reproduce the bug Sorry I failed to have a minimal reproducible example, but the offending line on my end is ```python dataset.map( lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda batched=True, num_proc=4, ) ``` This does work when `num_proc=1`, so it's likely a multiprocessing thing. ## Expected results `map` succeeds ## Actual results The error trace above. ## Environment info - `datasets` version: 1.16.1 and 2.5.1 both failed - Platform: Ubuntu 20.04.4 LTS - Python version: 3.10.4 - PyArrow version: 9.0.0 I did some binary search and seems like the root cause is either `multiprocess` or `dill`. python 3.10 is fine. Specifically: - `multiprocess==0.70.12.2, dill==0.3.4`: works - `multiprocess==0.70.12.2, dill==0.3.5.1`: doesn't work - `multiprocess==0.70.13, dill==0.3.5.1`: doesn't work - `multiprocess==0.70.13, dill==0.3.4`: can't test, `multiprocess==0.70.13` requires `dill>=0.3.5.1` I will pin their versions on my end. I don't have enough knowledge of how python multiprocessing works to debug this, but ideally there could be a fix. It's also possible that I'm doing something wrong in my code, but again the `.name` of the logger that failed to pickle is `datasets.fingerprint`, which I'm not using directly.
[ -0.1704784780740738, -0.24004438519477844, -0.041077468544244766, 0.14504089951515198, -0.08370185643434525, 0.0011461451649665833, 0.33660608530044556, 0.16821591556072235, 0.6493862867355347, 0.165668785572052, -0.03523249924182892, 0.6121383905410767, -0.26885202527046204, 0.08796777576208115, -0.32229945063591003, -0.17099377512931824, -0.050248272716999054, -0.013430632650852203, -0.3029886484146118, 0.16521316766738892, -0.1052873358130455, 0.2245742529630661, -0.1888790726661682, 0.11316327750682831, -0.3706149160861969, -0.21305814385414124, -0.12412317842245102, 0.24962061643600464, 0.11869160830974579, -0.40181857347488403, -0.20109935104846954, -0.2191820740699768, -0.233134925365448, 0.6415014266967773, -0.00011209521471755579, 0.059975892305374146, 0.18194103240966797, 0.06277265399694443, -0.07400974631309509, -0.3015989065170288, -0.1970399022102356, -0.19252793490886688, 0.10213652998209, -0.21372488141059875, 0.3513124883174896, -0.07654386013746262, 0.28693756461143494, -0.19967922568321228, 0.42255210876464844, -0.05262758210301399, 0.19537729024887085, 0.17559655010700226, 0.23653610050678253, -0.02188122645020485, -0.2125009298324585, 0.10003500431776047, -0.07670257240533829, 0.2840968072414398, 0.06711253523826599, -0.07933622598648071, -0.35391995310783386, 0.2236059159040451, -0.11019428819417953, 0.08235591650009155, -0.1474463939666748, -0.0642785057425499, 0.3382282257080078, -0.2574777603149414, 0.08554404973983765, 0.18800252676010132, -0.013699673116207123, -0.23369437456130981, -0.20503021776676178, -0.1721433848142624, -0.2121858298778534, -0.29711228609085083, 0.09739673137664795, 0.05006092041730881, -0.17859503626823425, -0.073691725730896, 0.3107518255710602, -0.31532108783721924, 0.1311245858669281, -0.0046231746673583984, 0.12821543216705322, 0.35646528005599976, -0.017335616052150726, 0.32920873165130615, 0.37990784645080566, 0.09955599904060364, -0.37651002407073975, 0.0625389814376831, 0.03858529031276703, -0.10501561313867569, -0.3200284242630005, 0.094119131565094, 0.15197762846946716, -0.11490125209093094, -0.22326987981796265, 0.12216465175151825, -0.11910201609134674, 0.058067500591278076, 0.15117327868938446, 0.3639531433582306, 0.48530733585357666, -0.3401527404785156, -0.017741382122039795, 0.650530219078064, 0.3552256226539612, -0.13898347318172455, -0.2885074317455292, 0.05969662219285965, 0.21884877979755402, -0.41348645091056824, 0.1373370736837387, 0.19189900159835815, 0.10112026333808899, 0.032825175672769547, 0.034688644111156464, -0.16664724051952362, -0.08020608127117157, -0.11547708511352539, 0.07847858965396881, 0.28991973400115967, -0.10086510330438614, 0.03433104604482651, 0.08395908027887344, 0.16173996031284332, -0.13077692687511444, 0.18028850853443146, -0.2946016192436218, 0.15217413008213043, -0.13166822493076324, 0.039721034467220306, -0.21121437847614288, -0.14016932249069214, 0.24856489896774292, 0.07455906271934509, -0.19074587523937225, -0.016593609005212784, 0.1955927610397339, -0.3056179881095886, -0.07898259907960892, 0.1841895580291748, 0.16997776925563812, -0.03085997700691223, 0.18571153283119202, -0.35464662313461304, -0.08246448636054993, -0.11294164508581161, -0.2949376702308655, -0.16296789050102234, -0.3751789331436157, 0.1034005880355835, 0.1424638032913208, 0.16409282386302948, -0.3851533532142639, -0.16978953778743744, 0.3694053590297699, -0.05189821124076843, -0.07502084225416183, -0.37109988927841187, -0.05157666653394699, -0.32638344168663025, 0.030750853940844536, 0.3205620050430298, 0.007628709077835083, -0.08481844514608383, -0.4513487219810486, -0.16425520181655884, 0.5453606247901917, 0.20331457257270813, 0.046673428267240524, 0.12039972841739655, -0.2639197111129761, 0.6925797462463379, 0.1258644461631775, -0.15644218027591705, 0.004957291763275862, 0.18578147888183594, -0.24214044213294983, 0.12166822701692581, 0.3669721186161041, -0.23800630867481232, -0.021666960790753365, 0.01562727615237236, 0.14275163412094116, 0.06817124783992767, 0.09340783208608627, 0.10989224165678024, -0.2171785831451416, 0.10519155859947205, 0.07313521206378937, 0.0005865395069122314, 0.19426564872264862, -0.24931734800338745, 0.10300279408693314, -0.3087391257286072, 0.37112903594970703, -0.028194207698106766, 0.128870889544487, 0.01668398827314377, 0.17829589545726776, 0.09072443097829819, -0.09015759825706482, -0.22090619802474976, -0.2847069203853607, 0.16988784074783325, -0.45585817098617554, -0.18209438025951385, -0.15979187190532684, 0.05297170579433441, 0.2339477837085724, 0.0603041797876358, -0.36281201243400574, 0.03362007811665535, 0.20383162796497345, 0.35447758436203003, -0.062169238924980164, -0.08158120512962341, -0.011951450258493423, 0.00007910653948783875, -0.05918613821268082, 0.018251318484544754, -0.1544666290283203, 0.1030149906873703, -0.43285852670669556, -0.28121405839920044, -0.14611659944057465, 0.1256284862756729, 0.13000482320785522, 0.015225597657263279, 0.007780698128044605, 0.10461007803678513, 0.29907065629959106, 0.28983452916145325, 0.2601819634437561, -0.24916206300258636, -0.0427132248878479, -0.07894128561019897, -0.09569526463747025, 0.2436741590499878, 0.033528413623571396, -0.23261338472366333, 0.21345335245132446, -0.02391098439693451, 0.39122241735458374, 0.21630007028579712, -0.11306619644165039, 0.29020455479621887, -0.10698237270116806, -0.0774587094783783, 0.17940960824489594, -0.05177346616983414, 0.13702775537967682, -0.27100610733032227, 0.31787440180778503, -0.1485898345708847, -0.4968014657497406, -0.08835072070360184, 0.2608257234096527, 0.29720985889434814, 0.4398045539855957, -0.08921501785516739, -0.09573722630739212, -0.07763515412807465, 0.13454033434391022, -0.04596628248691559, 0.2742013931274414, 0.07877156138420105, 0.01847153529524803, -0.13915075361728668, 0.17491433024406433, -0.07709453999996185, 0.0656047910451889, -0.0784899890422821, 0.1917261779308319, 0.5188334584236145, 0.08646082133054733, -0.010545103810727596, -0.009708825498819351, -0.2665615975856781, -0.025392204523086548, 0.01778111606836319, -0.1376716047525406, -0.018247229978442192, -0.3838404715061188, 0.22477436065673828, -0.14697276055812836, 0.08258221298456192, -0.10104474425315857, -0.35736018419265747, -0.020907144993543625, 0.24943436682224274, -0.4651641249656677, 0.254553884267807, -0.09384000301361084, -0.14038391411304474, -0.24442891776561737, 0.1275293231010437, -0.11448819935321808, -0.24123941361904144, 0.0132768414914608, 0.0045743584632873535, 0.353376179933548, -0.026737568899989128, 0.29966962337493896, 0.3109329342842102, -0.4942317605018616, -0.23676267266273499, 0.015579476952552795, 0.016226187348365784, -0.11317919194698334, 0.07046642154455185, 0.42205506563186646, 0.12781038880348206, -0.09805849194526672, -0.3609545826911926, 0.20968253910541534, -0.1687198430299759, -0.19041189551353455, -0.045019276440143585, -0.050574593245983124, 0.006988425739109516, 0.006827730685472488, -0.17888352274894714, -0.6229405403137207, -0.45987996459007263, 0.49268555641174316, -0.08657306432723999, 0.2919169068336487, 0.183648020029068, 0.0261395201086998, 0.17058147490024567, -0.16887253522872925, 0.16290172934532166, -0.0648624375462532, 0.12947431206703186, -0.05898791179060936, -0.17726168036460876, -0.06883369386196136, -0.1580818146467209, 0.04024672508239746, -0.06813861429691315, -0.32513004541397095, -0.28763726353645325, 0.10712376236915588, -0.214109405875206, 0.2494438886642456, -0.025885500013828278, 0.1951064020395279, 0.1918053925037384, 0.3971101939678192, -0.1702331006526947, 0.02347293496131897, -0.15227752923965454, 0.14785027503967285, 0.34795916080474854, 0.32204338908195496, 0.19725927710533142, -0.1253865361213684, 0.06685128808021545, 0.9068630337715149, 0.25261855125427246, -0.04650525376200676, 0.23119208216667175, 0.02998652681708336, -0.026535604149103165, 0.029561471194028854, -0.46304112672805786, 0.06973449140787125, -0.212996244430542, 0.057243719696998596, -0.0741211473941803, -0.2855481505393982, -0.16521118581295013, -0.004921872168779373, 0.21444925665855408, -0.284965455532074, -0.2162206918001175, 0.2168060839176178, -0.06855296343564987, -0.2032662332057953, -0.3249015808105469, -0.1985834240913391, -0.06658226251602173, 0.17310655117034912, -0.01710101217031479, -0.024665862321853638, 0.32053351402282715, -0.0872030183672905, 0.1267101764678955, -0.3690234422683716, -0.46367478370666504, 0.36173945665359497, 0.06265253573656082, -0.08774380385875702, -0.2605329751968384, -0.1760990023612976, -0.09211824834346771, 0.021505506709218025, 0.40400266647338867, -0.159867063164711, 0.10531842708587646, 0.22696155309677124, -0.13349038362503052, 0.015870748087763786, -0.061867401003837585, -0.1209435909986496, 0.7046935558319092, 0.26756858825683594, 0.20654919743537903, -0.2737477719783783, -0.14233803749084473, 0.02356860600411892, 0.14196276664733887, -0.08466936647891998, -0.038889236748218536, -0.24659842252731323, -0.07768283039331436, -0.13849525153636932, 0.15510980784893036, 0.08232703804969788, 0.25174278020858765, 0.09778950363397598, -0.09174385666847229, 0.17398591339588165, -0.14940081536769867, -0.18939439952373505, -0.18034522235393524, 0.23600459098815918, -0.29632458090782166, 0.10126610100269318, 0.13477107882499695, 0.39963310956954956, 0.22752058506011963, 0.3450799584388733, -0.42172396183013916, 0.03918100893497467, 0.2157452404499054, 0.02340482920408249, 0.1936129927635193, 0.03251489996910095, 0.002387627027928829, 0.27431073784828186, 0.05858875811100006, 0.42277395725250244, 0.03989139944314957, -0.1367851346731186, 0.2579230070114136, 0.04706263914704323, -0.15529747307300568, 0.18694356083869934, 0.47681519389152527, 0.28563281893730164, 0.10260093212127686, 0.6579890847206116, -0.4336269497871399, -0.18972976505756378, 0.2837598919868469, -0.1231168881058693, 0.7337725758552551, 0.022805269807577133, -0.013860125094652176, 0.0023871324956417084, -0.06097327917814255, 0.0003734568599611521, 0.28470945358276367, 0.036073699593544006, -0.3258834779262543, -0.00584940891712904, 0.1026209145784378, -0.1991177648305893, 0.1262008547782898, 0.05941850692033768, -0.3438444137573242, 0.19911083579063416, -0.3975822329521179, -0.33620885014533997, -0.18486736714839935, 0.2708461284637451, 0.08969013392925262, -0.08295276761054993, 0.18736021220684052, 0.10115489363670349, 0.03846631944179535, 0.23466795682907104, 0.04233868420124054, -0.12158203125, 0.19061152637004852, -0.22102682292461395, -0.42906486988067627, 0.07426125556230545, 0.00719881197437644, 0.4756898880004883, 0.16636714339256287, -0.02970362827181816, -0.09443017840385437, 0.10736368596553802, -0.5213296413421631, -0.14292313158512115, 0.1034640222787857, 0.04158322140574455, 0.17803692817687988, -0.01904110796749592, -0.13567335903644562, 0.11099568009376526, 0.19868721067905426, -0.10856305062770844, -0.2663596570491791, 0.10721215605735779, -0.2340518832206726, -0.7553526759147644, -0.04188697785139084, 0.33403706550598145, -0.029433615505695343, 0.2158505916595459, -0.07697153091430664, -0.06427580118179321, -0.3720512390136719, -0.28051528334617615, 0.140474334359169, 0.22988319396972656, -0.2416871190071106, 0.5183645486831665, -0.37618523836135864, -0.06297776103019714, 0.07730042934417725, 0.3479664921760559, -0.002854354679584503, 0.34368351101875305, 0.3331749439239502, 0.32585233449935913, -0.19133631885051727, -0.305093377828598, -0.22743266820907593, -0.12431257218122482, 0.16755327582359314, 0.48446527123451233, -0.11688634753227234, 0.03310732543468475, -0.1379634439945221, 0.25070545077323914, 0.15605010092258453, 0.2012852132320404, -0.18768815696239471, -0.4076804220676422, -0.2377675324678421, 0.18597200512886047, -0.15692231059074402, 0.18495303392410278, -0.013951374217867851, 0.3558984100818634, 0.015717899426817894, 0.48014140129089355, -0.29436564445495605, 0.05423825979232788, -0.4230455160140991, 0.03771335259079933, 0.2523268461227417, -0.09448010474443436, 0.015360996127128601, 0.17075799405574799, 0.2082729935646057, 0.22203350067138672, -0.049618806689977646, -0.23021200299263, 0.04354168102145195, 0.08486846089363098, 0.14167004823684692, 0.0698947012424469, 0.0670560672879219, 0.05648791790008545, 0.03253840655088425, -0.03740871697664261, 0.011158071458339691, 0.2606784403324127, -0.11184777319431305, 0.10307959467172623, 0.11549834907054901, 0.007746703922748566, 0.1670437604188919, 0.12410443276166916, -0.050254493951797485, -0.15430258214473724, -0.12794823944568634, 0.35805073380470276, 0.11390269547700882, -0.0791548565030098, 0.12324996292591095, -0.23201268911361694, -0.08424265682697296, -0.0035069361329078674, 0.14964710175991058, -0.0651816800236702, -0.4138964116573334, 0.004696729127317667, 0.461696982383728, 0.2218674272298813, -0.16660986840724945, 0.16210173070430756, 0.011004989966750145, 0.22539377212524414, -0.22132508456707, -0.04274721071124077, 0.20037661492824554, 0.13664564490318298, 0.11758999526500702, 0.0076933354139328, -0.14028231799602509, -0.09212825447320938, -0.21149493753910065, 0.23746836185455322, -0.13890720903873444, -0.4486119747161865, 0.25004780292510986, -0.06480343639850616, -0.09609659016132355, 0.021168682724237442, 0.4194360673427582, 0.14149287343025208, 0.2939731776714325, 0.08178657293319702, -0.147874116897583, 0.14870670437812805, -0.270449697971344, -0.18264369666576385, 0.11831251531839371, -0.4652427136898041, 0.5194094181060791, 0.3894754648208618, -0.18036982417106628, 0.05610617622733116, -0.1623348891735077, 0.6842086911201477, -0.6786056160926819, -0.25967535376548767, 0.0027586277574300766, 0.4400864839553833, -0.27193543314933777, -0.06336300820112228, -0.13350346684455872, -0.027554411441087723, -0.09364712983369827, -0.04399257153272629, 0.2462596744298935, 0.03162171319127083, 0.653125524520874, 0.1571011245250702, -0.2743206024169922, -0.1304512619972229, -0.42904531955718994, 0.12086652964353561, 0.37495240569114685, -0.32881373167037964, -0.15235480666160583, 0.22777822613716125, -0.13894091546535492, -0.4794405996799469, 0.2785640060901642, 0.583191454410553, 0.225002720952034, -0.3686278164386749, -0.04382682964205742, 0.07692733407020569, -0.04976961761713028, -0.11938832700252533, 0.19530227780342102, -0.1265898495912552, -0.32472604513168335, 0.44099289178848267, 0.11402396857738495, -0.21896013617515564, -0.002197299152612686, 0.29075244069099426, 0.5587812662124634, 0.19746507704257965, 0.312686026096344, 0.016303444281220436, -0.32658258080482483, 0.3178251087665558, -0.21372252702713013, -0.4146823585033417, -0.09911505877971649, 0.3258882761001587, -0.15123684704303741, 0.1396869719028473, -0.17479492723941803, 0.12294220924377441, 0.05640238896012306, 0.22463740408420563, 0.3077670633792877, 0.003821704536676407, -0.38448822498321533, 0.17235194146633148, -0.14357419312000275, 0.32169708609580994, -0.3216906785964966, -0.3851219117641449, -0.2629864811897278, 0.284455269575119, 0.02686571329832077, 0.11633354425430298, 0.3460359573364258, -0.018508749082684517, 0.3481579124927521, 0.458171546459198, -0.20159243047237396, 0.11421741545200348, 0.06446155160665512, -0.3000822067260742, 0.3950977325439453, -0.3944608271121979, 0.14359638094902039, 0.08267617970705032, 0.12491969019174576, -0.21823792159557343, -0.20626670122146606, 0.2417985498905182, 0.018207397311925888, 0.29933685064315796, -0.06259022653102875, 0.37658268213272095, -0.35516253113746643, -0.22531291842460632, 0.10164898633956909, -0.09849686175584793, -0.23874546587467194, -0.30215856432914734, 0.027998294681310654, 0.385017991065979, -0.23117336630821228, 0.16636092960834503, -0.5321101546287537, 0.3899178206920624, -0.21830613911151886, -0.040129244327545166, 0.22905944287776947, -0.0058150216937065125, 0.29226526618003845, -0.19208471477031708, 0.09730932861566544, 0.26122817397117615, -0.14023292064666748, 0.04375508427619934, -0.3807435631752014, -0.4251602590084076, 0.4777180254459381, -0.2350882887840271, -0.1449417918920517, -0.3279189467430115, 0.32750052213668823, -0.3646610677242279, 0.2586278021335602, -0.27319929003715515, -0.05824128910899162, 0.2463684380054474, 0.09073108434677124, -0.1478208601474762, 0.011269538663327694, -0.011063281446695328, -0.08079221099615097, 0.09312708675861359, 0.4482799470424652, 0.06931573152542114, -0.1364249587059021, 0.18685446679592133, -0.20622846484184265 ]
https://github.com/huggingface/datasets/issues/5061
`_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map`
I'm not 100% sure how to figure it out -- the stack trace above doesn't clearly give me a place where I can print out who owns the logger, etc. I only found out its `.name` is `datasets.fingerprint` by printing right before ``` File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') ``` If you have any idea on how to find it out, please let me know.
## Describe the bug When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`. ``` File "~/project/dataset.py", line 204, in <dictcomp> split: dataset.map( File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map transformed_shards[index] = async_result.get() File ".../site-packages/multiprocess/pool.py", line 771, in get raise self._value File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks put(task) File ".../site-packages/multiprocess/connection.py", line 214, in send self._send_bytes(_ForkingPickler.dumps(obj)) File ".../site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File ".../site-packages/dill/_dill.py", line 620, in dump StockPickler.dump(self, obj) File ".../pickle.py", line 487, in dump self.save(obj) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 902, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 578, in save rv = reduce(self.proto) File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') _pickle.PicklingError: logger cannot be pickled ``` ## Steps to reproduce the bug Sorry I failed to have a minimal reproducible example, but the offending line on my end is ```python dataset.map( lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda batched=True, num_proc=4, ) ``` This does work when `num_proc=1`, so it's likely a multiprocessing thing. ## Expected results `map` succeeds ## Actual results The error trace above. ## Environment info - `datasets` version: 1.16.1 and 2.5.1 both failed - Platform: Ubuntu 20.04.4 LTS - Python version: 3.10.4 - PyArrow version: 9.0.0
70
`_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map` ## Describe the bug When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`. ``` File "~/project/dataset.py", line 204, in <dictcomp> split: dataset.map( File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map transformed_shards[index] = async_result.get() File ".../site-packages/multiprocess/pool.py", line 771, in get raise self._value File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks put(task) File ".../site-packages/multiprocess/connection.py", line 214, in send self._send_bytes(_ForkingPickler.dumps(obj)) File ".../site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File ".../site-packages/dill/_dill.py", line 620, in dump StockPickler.dump(self, obj) File ".../pickle.py", line 487, in dump self.save(obj) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 902, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 578, in save rv = reduce(self.proto) File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') _pickle.PicklingError: logger cannot be pickled ``` ## Steps to reproduce the bug Sorry I failed to have a minimal reproducible example, but the offending line on my end is ```python dataset.map( lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda batched=True, num_proc=4, ) ``` This does work when `num_proc=1`, so it's likely a multiprocessing thing. ## Expected results `map` succeeds ## Actual results The error trace above. ## Environment info - `datasets` version: 1.16.1 and 2.5.1 both failed - Platform: Ubuntu 20.04.4 LTS - Python version: 3.10.4 - PyArrow version: 9.0.0 I'm not 100% sure how to figure it out -- the stack trace above doesn't clearly give me a place where I can print out who owns the logger, etc. I only found out its `.name` is `datasets.fingerprint` by printing right before ``` File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') ``` If you have any idea on how to find it out, please let me know.
[ -0.1704784780740738, -0.24004438519477844, -0.041077468544244766, 0.14504089951515198, -0.08370185643434525, 0.0011461451649665833, 0.33660608530044556, 0.16821591556072235, 0.6493862867355347, 0.165668785572052, -0.03523249924182892, 0.6121383905410767, -0.26885202527046204, 0.08796777576208115, -0.32229945063591003, -0.17099377512931824, -0.050248272716999054, -0.013430632650852203, -0.3029886484146118, 0.16521316766738892, -0.1052873358130455, 0.2245742529630661, -0.1888790726661682, 0.11316327750682831, -0.3706149160861969, -0.21305814385414124, -0.12412317842245102, 0.24962061643600464, 0.11869160830974579, -0.40181857347488403, -0.20109935104846954, -0.2191820740699768, -0.233134925365448, 0.6415014266967773, -0.00011209521471755579, 0.059975892305374146, 0.18194103240966797, 0.06277265399694443, -0.07400974631309509, -0.3015989065170288, -0.1970399022102356, -0.19252793490886688, 0.10213652998209, -0.21372488141059875, 0.3513124883174896, -0.07654386013746262, 0.28693756461143494, -0.19967922568321228, 0.42255210876464844, -0.05262758210301399, 0.19537729024887085, 0.17559655010700226, 0.23653610050678253, -0.02188122645020485, -0.2125009298324585, 0.10003500431776047, -0.07670257240533829, 0.2840968072414398, 0.06711253523826599, -0.07933622598648071, -0.35391995310783386, 0.2236059159040451, -0.11019428819417953, 0.08235591650009155, -0.1474463939666748, -0.0642785057425499, 0.3382282257080078, -0.2574777603149414, 0.08554404973983765, 0.18800252676010132, -0.013699673116207123, -0.23369437456130981, -0.20503021776676178, -0.1721433848142624, -0.2121858298778534, -0.29711228609085083, 0.09739673137664795, 0.05006092041730881, -0.17859503626823425, -0.073691725730896, 0.3107518255710602, -0.31532108783721924, 0.1311245858669281, -0.0046231746673583984, 0.12821543216705322, 0.35646528005599976, -0.017335616052150726, 0.32920873165130615, 0.37990784645080566, 0.09955599904060364, -0.37651002407073975, 0.0625389814376831, 0.03858529031276703, -0.10501561313867569, -0.3200284242630005, 0.094119131565094, 0.15197762846946716, -0.11490125209093094, -0.22326987981796265, 0.12216465175151825, -0.11910201609134674, 0.058067500591278076, 0.15117327868938446, 0.3639531433582306, 0.48530733585357666, -0.3401527404785156, -0.017741382122039795, 0.650530219078064, 0.3552256226539612, -0.13898347318172455, -0.2885074317455292, 0.05969662219285965, 0.21884877979755402, -0.41348645091056824, 0.1373370736837387, 0.19189900159835815, 0.10112026333808899, 0.032825175672769547, 0.034688644111156464, -0.16664724051952362, -0.08020608127117157, -0.11547708511352539, 0.07847858965396881, 0.28991973400115967, -0.10086510330438614, 0.03433104604482651, 0.08395908027887344, 0.16173996031284332, -0.13077692687511444, 0.18028850853443146, -0.2946016192436218, 0.15217413008213043, -0.13166822493076324, 0.039721034467220306, -0.21121437847614288, -0.14016932249069214, 0.24856489896774292, 0.07455906271934509, -0.19074587523937225, -0.016593609005212784, 0.1955927610397339, -0.3056179881095886, -0.07898259907960892, 0.1841895580291748, 0.16997776925563812, -0.03085997700691223, 0.18571153283119202, -0.35464662313461304, -0.08246448636054993, -0.11294164508581161, -0.2949376702308655, -0.16296789050102234, -0.3751789331436157, 0.1034005880355835, 0.1424638032913208, 0.16409282386302948, -0.3851533532142639, -0.16978953778743744, 0.3694053590297699, -0.05189821124076843, -0.07502084225416183, -0.37109988927841187, -0.05157666653394699, -0.32638344168663025, 0.030750853940844536, 0.3205620050430298, 0.007628709077835083, -0.08481844514608383, -0.4513487219810486, -0.16425520181655884, 0.5453606247901917, 0.20331457257270813, 0.046673428267240524, 0.12039972841739655, -0.2639197111129761, 0.6925797462463379, 0.1258644461631775, -0.15644218027591705, 0.004957291763275862, 0.18578147888183594, -0.24214044213294983, 0.12166822701692581, 0.3669721186161041, -0.23800630867481232, -0.021666960790753365, 0.01562727615237236, 0.14275163412094116, 0.06817124783992767, 0.09340783208608627, 0.10989224165678024, -0.2171785831451416, 0.10519155859947205, 0.07313521206378937, 0.0005865395069122314, 0.19426564872264862, -0.24931734800338745, 0.10300279408693314, -0.3087391257286072, 0.37112903594970703, -0.028194207698106766, 0.128870889544487, 0.01668398827314377, 0.17829589545726776, 0.09072443097829819, -0.09015759825706482, -0.22090619802474976, -0.2847069203853607, 0.16988784074783325, -0.45585817098617554, -0.18209438025951385, -0.15979187190532684, 0.05297170579433441, 0.2339477837085724, 0.0603041797876358, -0.36281201243400574, 0.03362007811665535, 0.20383162796497345, 0.35447758436203003, -0.062169238924980164, -0.08158120512962341, -0.011951450258493423, 0.00007910653948783875, -0.05918613821268082, 0.018251318484544754, -0.1544666290283203, 0.1030149906873703, -0.43285852670669556, -0.28121405839920044, -0.14611659944057465, 0.1256284862756729, 0.13000482320785522, 0.015225597657263279, 0.007780698128044605, 0.10461007803678513, 0.29907065629959106, 0.28983452916145325, 0.2601819634437561, -0.24916206300258636, -0.0427132248878479, -0.07894128561019897, -0.09569526463747025, 0.2436741590499878, 0.033528413623571396, -0.23261338472366333, 0.21345335245132446, -0.02391098439693451, 0.39122241735458374, 0.21630007028579712, -0.11306619644165039, 0.29020455479621887, -0.10698237270116806, -0.0774587094783783, 0.17940960824489594, -0.05177346616983414, 0.13702775537967682, -0.27100610733032227, 0.31787440180778503, -0.1485898345708847, -0.4968014657497406, -0.08835072070360184, 0.2608257234096527, 0.29720985889434814, 0.4398045539855957, -0.08921501785516739, -0.09573722630739212, -0.07763515412807465, 0.13454033434391022, -0.04596628248691559, 0.2742013931274414, 0.07877156138420105, 0.01847153529524803, -0.13915075361728668, 0.17491433024406433, -0.07709453999996185, 0.0656047910451889, -0.0784899890422821, 0.1917261779308319, 0.5188334584236145, 0.08646082133054733, -0.010545103810727596, -0.009708825498819351, -0.2665615975856781, -0.025392204523086548, 0.01778111606836319, -0.1376716047525406, -0.018247229978442192, -0.3838404715061188, 0.22477436065673828, -0.14697276055812836, 0.08258221298456192, -0.10104474425315857, -0.35736018419265747, -0.020907144993543625, 0.24943436682224274, -0.4651641249656677, 0.254553884267807, -0.09384000301361084, -0.14038391411304474, -0.24442891776561737, 0.1275293231010437, -0.11448819935321808, -0.24123941361904144, 0.0132768414914608, 0.0045743584632873535, 0.353376179933548, -0.026737568899989128, 0.29966962337493896, 0.3109329342842102, -0.4942317605018616, -0.23676267266273499, 0.015579476952552795, 0.016226187348365784, -0.11317919194698334, 0.07046642154455185, 0.42205506563186646, 0.12781038880348206, -0.09805849194526672, -0.3609545826911926, 0.20968253910541534, -0.1687198430299759, -0.19041189551353455, -0.045019276440143585, -0.050574593245983124, 0.006988425739109516, 0.006827730685472488, -0.17888352274894714, -0.6229405403137207, -0.45987996459007263, 0.49268555641174316, -0.08657306432723999, 0.2919169068336487, 0.183648020029068, 0.0261395201086998, 0.17058147490024567, -0.16887253522872925, 0.16290172934532166, -0.0648624375462532, 0.12947431206703186, -0.05898791179060936, -0.17726168036460876, -0.06883369386196136, -0.1580818146467209, 0.04024672508239746, -0.06813861429691315, -0.32513004541397095, -0.28763726353645325, 0.10712376236915588, -0.214109405875206, 0.2494438886642456, -0.025885500013828278, 0.1951064020395279, 0.1918053925037384, 0.3971101939678192, -0.1702331006526947, 0.02347293496131897, -0.15227752923965454, 0.14785027503967285, 0.34795916080474854, 0.32204338908195496, 0.19725927710533142, -0.1253865361213684, 0.06685128808021545, 0.9068630337715149, 0.25261855125427246, -0.04650525376200676, 0.23119208216667175, 0.02998652681708336, -0.026535604149103165, 0.029561471194028854, -0.46304112672805786, 0.06973449140787125, -0.212996244430542, 0.057243719696998596, -0.0741211473941803, -0.2855481505393982, -0.16521118581295013, -0.004921872168779373, 0.21444925665855408, -0.284965455532074, -0.2162206918001175, 0.2168060839176178, -0.06855296343564987, -0.2032662332057953, -0.3249015808105469, -0.1985834240913391, -0.06658226251602173, 0.17310655117034912, -0.01710101217031479, -0.024665862321853638, 0.32053351402282715, -0.0872030183672905, 0.1267101764678955, -0.3690234422683716, -0.46367478370666504, 0.36173945665359497, 0.06265253573656082, -0.08774380385875702, -0.2605329751968384, -0.1760990023612976, -0.09211824834346771, 0.021505506709218025, 0.40400266647338867, -0.159867063164711, 0.10531842708587646, 0.22696155309677124, -0.13349038362503052, 0.015870748087763786, -0.061867401003837585, -0.1209435909986496, 0.7046935558319092, 0.26756858825683594, 0.20654919743537903, -0.2737477719783783, -0.14233803749084473, 0.02356860600411892, 0.14196276664733887, -0.08466936647891998, -0.038889236748218536, -0.24659842252731323, -0.07768283039331436, -0.13849525153636932, 0.15510980784893036, 0.08232703804969788, 0.25174278020858765, 0.09778950363397598, -0.09174385666847229, 0.17398591339588165, -0.14940081536769867, -0.18939439952373505, -0.18034522235393524, 0.23600459098815918, -0.29632458090782166, 0.10126610100269318, 0.13477107882499695, 0.39963310956954956, 0.22752058506011963, 0.3450799584388733, -0.42172396183013916, 0.03918100893497467, 0.2157452404499054, 0.02340482920408249, 0.1936129927635193, 0.03251489996910095, 0.002387627027928829, 0.27431073784828186, 0.05858875811100006, 0.42277395725250244, 0.03989139944314957, -0.1367851346731186, 0.2579230070114136, 0.04706263914704323, -0.15529747307300568, 0.18694356083869934, 0.47681519389152527, 0.28563281893730164, 0.10260093212127686, 0.6579890847206116, -0.4336269497871399, -0.18972976505756378, 0.2837598919868469, -0.1231168881058693, 0.7337725758552551, 0.022805269807577133, -0.013860125094652176, 0.0023871324956417084, -0.06097327917814255, 0.0003734568599611521, 0.28470945358276367, 0.036073699593544006, -0.3258834779262543, -0.00584940891712904, 0.1026209145784378, -0.1991177648305893, 0.1262008547782898, 0.05941850692033768, -0.3438444137573242, 0.19911083579063416, -0.3975822329521179, -0.33620885014533997, -0.18486736714839935, 0.2708461284637451, 0.08969013392925262, -0.08295276761054993, 0.18736021220684052, 0.10115489363670349, 0.03846631944179535, 0.23466795682907104, 0.04233868420124054, -0.12158203125, 0.19061152637004852, -0.22102682292461395, -0.42906486988067627, 0.07426125556230545, 0.00719881197437644, 0.4756898880004883, 0.16636714339256287, -0.02970362827181816, -0.09443017840385437, 0.10736368596553802, -0.5213296413421631, -0.14292313158512115, 0.1034640222787857, 0.04158322140574455, 0.17803692817687988, -0.01904110796749592, -0.13567335903644562, 0.11099568009376526, 0.19868721067905426, -0.10856305062770844, -0.2663596570491791, 0.10721215605735779, -0.2340518832206726, -0.7553526759147644, -0.04188697785139084, 0.33403706550598145, -0.029433615505695343, 0.2158505916595459, -0.07697153091430664, -0.06427580118179321, -0.3720512390136719, -0.28051528334617615, 0.140474334359169, 0.22988319396972656, -0.2416871190071106, 0.5183645486831665, -0.37618523836135864, -0.06297776103019714, 0.07730042934417725, 0.3479664921760559, -0.002854354679584503, 0.34368351101875305, 0.3331749439239502, 0.32585233449935913, -0.19133631885051727, -0.305093377828598, -0.22743266820907593, -0.12431257218122482, 0.16755327582359314, 0.48446527123451233, -0.11688634753227234, 0.03310732543468475, -0.1379634439945221, 0.25070545077323914, 0.15605010092258453, 0.2012852132320404, -0.18768815696239471, -0.4076804220676422, -0.2377675324678421, 0.18597200512886047, -0.15692231059074402, 0.18495303392410278, -0.013951374217867851, 0.3558984100818634, 0.015717899426817894, 0.48014140129089355, -0.29436564445495605, 0.05423825979232788, -0.4230455160140991, 0.03771335259079933, 0.2523268461227417, -0.09448010474443436, 0.015360996127128601, 0.17075799405574799, 0.2082729935646057, 0.22203350067138672, -0.049618806689977646, -0.23021200299263, 0.04354168102145195, 0.08486846089363098, 0.14167004823684692, 0.0698947012424469, 0.0670560672879219, 0.05648791790008545, 0.03253840655088425, -0.03740871697664261, 0.011158071458339691, 0.2606784403324127, -0.11184777319431305, 0.10307959467172623, 0.11549834907054901, 0.007746703922748566, 0.1670437604188919, 0.12410443276166916, -0.050254493951797485, -0.15430258214473724, -0.12794823944568634, 0.35805073380470276, 0.11390269547700882, -0.0791548565030098, 0.12324996292591095, -0.23201268911361694, -0.08424265682697296, -0.0035069361329078674, 0.14964710175991058, -0.0651816800236702, -0.4138964116573334, 0.004696729127317667, 0.461696982383728, 0.2218674272298813, -0.16660986840724945, 0.16210173070430756, 0.011004989966750145, 0.22539377212524414, -0.22132508456707, -0.04274721071124077, 0.20037661492824554, 0.13664564490318298, 0.11758999526500702, 0.0076933354139328, -0.14028231799602509, -0.09212825447320938, -0.21149493753910065, 0.23746836185455322, -0.13890720903873444, -0.4486119747161865, 0.25004780292510986, -0.06480343639850616, -0.09609659016132355, 0.021168682724237442, 0.4194360673427582, 0.14149287343025208, 0.2939731776714325, 0.08178657293319702, -0.147874116897583, 0.14870670437812805, -0.270449697971344, -0.18264369666576385, 0.11831251531839371, -0.4652427136898041, 0.5194094181060791, 0.3894754648208618, -0.18036982417106628, 0.05610617622733116, -0.1623348891735077, 0.6842086911201477, -0.6786056160926819, -0.25967535376548767, 0.0027586277574300766, 0.4400864839553833, -0.27193543314933777, -0.06336300820112228, -0.13350346684455872, -0.027554411441087723, -0.09364712983369827, -0.04399257153272629, 0.2462596744298935, 0.03162171319127083, 0.653125524520874, 0.1571011245250702, -0.2743206024169922, -0.1304512619972229, -0.42904531955718994, 0.12086652964353561, 0.37495240569114685, -0.32881373167037964, -0.15235480666160583, 0.22777822613716125, -0.13894091546535492, -0.4794405996799469, 0.2785640060901642, 0.583191454410553, 0.225002720952034, -0.3686278164386749, -0.04382682964205742, 0.07692733407020569, -0.04976961761713028, -0.11938832700252533, 0.19530227780342102, -0.1265898495912552, -0.32472604513168335, 0.44099289178848267, 0.11402396857738495, -0.21896013617515564, -0.002197299152612686, 0.29075244069099426, 0.5587812662124634, 0.19746507704257965, 0.312686026096344, 0.016303444281220436, -0.32658258080482483, 0.3178251087665558, -0.21372252702713013, -0.4146823585033417, -0.09911505877971649, 0.3258882761001587, -0.15123684704303741, 0.1396869719028473, -0.17479492723941803, 0.12294220924377441, 0.05640238896012306, 0.22463740408420563, 0.3077670633792877, 0.003821704536676407, -0.38448822498321533, 0.17235194146633148, -0.14357419312000275, 0.32169708609580994, -0.3216906785964966, -0.3851219117641449, -0.2629864811897278, 0.284455269575119, 0.02686571329832077, 0.11633354425430298, 0.3460359573364258, -0.018508749082684517, 0.3481579124927521, 0.458171546459198, -0.20159243047237396, 0.11421741545200348, 0.06446155160665512, -0.3000822067260742, 0.3950977325439453, -0.3944608271121979, 0.14359638094902039, 0.08267617970705032, 0.12491969019174576, -0.21823792159557343, -0.20626670122146606, 0.2417985498905182, 0.018207397311925888, 0.29933685064315796, -0.06259022653102875, 0.37658268213272095, -0.35516253113746643, -0.22531291842460632, 0.10164898633956909, -0.09849686175584793, -0.23874546587467194, -0.30215856432914734, 0.027998294681310654, 0.385017991065979, -0.23117336630821228, 0.16636092960834503, -0.5321101546287537, 0.3899178206920624, -0.21830613911151886, -0.040129244327545166, 0.22905944287776947, -0.0058150216937065125, 0.29226526618003845, -0.19208471477031708, 0.09730932861566544, 0.26122817397117615, -0.14023292064666748, 0.04375508427619934, -0.3807435631752014, -0.4251602590084076, 0.4777180254459381, -0.2350882887840271, -0.1449417918920517, -0.3279189467430115, 0.32750052213668823, -0.3646610677242279, 0.2586278021335602, -0.27319929003715515, -0.05824128910899162, 0.2463684380054474, 0.09073108434677124, -0.1478208601474762, 0.011269538663327694, -0.011063281446695328, -0.08079221099615097, 0.09312708675861359, 0.4482799470424652, 0.06931573152542114, -0.1364249587059021, 0.18685446679592133, -0.20622846484184265 ]
https://github.com/huggingface/datasets/issues/5061
`_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map`
Ok I see, not sure why it triggers this error though, in `logging.py` the code is https://github.com/python/cpython/blob/c9da063e32725a66495e4047b8a5ed13e72d9e8e/Lib/logging/__init__.py#L1769-L1775 and on my side it works on 3.10 with dill 0.3.5.1 and multiprocess 0.70.13 ```python >>> datasets.fingerprint.logger.__reduce__() (<function logging.getLogger(name=None)>, ('datasets.fingerprint',)) ``` Could you try to run this code ? Are you in an environment where the loggers are instantiated differently ? Can you check the source code of `logging.Logger.__reduce__` in `".../logging/__init__.py", line 1774` ?
## Describe the bug When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`. ``` File "~/project/dataset.py", line 204, in <dictcomp> split: dataset.map( File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map transformed_shards[index] = async_result.get() File ".../site-packages/multiprocess/pool.py", line 771, in get raise self._value File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks put(task) File ".../site-packages/multiprocess/connection.py", line 214, in send self._send_bytes(_ForkingPickler.dumps(obj)) File ".../site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File ".../site-packages/dill/_dill.py", line 620, in dump StockPickler.dump(self, obj) File ".../pickle.py", line 487, in dump self.save(obj) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 902, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 578, in save rv = reduce(self.proto) File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') _pickle.PicklingError: logger cannot be pickled ``` ## Steps to reproduce the bug Sorry I failed to have a minimal reproducible example, but the offending line on my end is ```python dataset.map( lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda batched=True, num_proc=4, ) ``` This does work when `num_proc=1`, so it's likely a multiprocessing thing. ## Expected results `map` succeeds ## Actual results The error trace above. ## Environment info - `datasets` version: 1.16.1 and 2.5.1 both failed - Platform: Ubuntu 20.04.4 LTS - Python version: 3.10.4 - PyArrow version: 9.0.0
71
`_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map` ## Describe the bug When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`. ``` File "~/project/dataset.py", line 204, in <dictcomp> split: dataset.map( File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map transformed_shards[index] = async_result.get() File ".../site-packages/multiprocess/pool.py", line 771, in get raise self._value File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks put(task) File ".../site-packages/multiprocess/connection.py", line 214, in send self._send_bytes(_ForkingPickler.dumps(obj)) File ".../site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File ".../site-packages/dill/_dill.py", line 620, in dump StockPickler.dump(self, obj) File ".../pickle.py", line 487, in dump self.save(obj) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 902, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File ".../pickle.py", line 717, in save_reduce save(state) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../pickle.py", line 887, in save_tuple save(element) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict StockPickler.save_dict(pickler, obj) File ".../pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File ".../site-packages/dill/_dill.py", line 1963, in save_function _save_with_postproc(pickler, (_create_function, ( File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File ".../pickle.py", line 998, in _batch_setitems save(v) File ".../pickle.py", line 578, in save rv = reduce(self.proto) File ".../logging/__init__.py", line 1774, in __reduce__ raise pickle.PicklingError('logger cannot be pickled') _pickle.PicklingError: logger cannot be pickled ``` ## Steps to reproduce the bug Sorry I failed to have a minimal reproducible example, but the offending line on my end is ```python dataset.map( lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda batched=True, num_proc=4, ) ``` This does work when `num_proc=1`, so it's likely a multiprocessing thing. ## Expected results `map` succeeds ## Actual results The error trace above. ## Environment info - `datasets` version: 1.16.1 and 2.5.1 both failed - Platform: Ubuntu 20.04.4 LTS - Python version: 3.10.4 - PyArrow version: 9.0.0 Ok I see, not sure why it triggers this error though, in `logging.py` the code is https://github.com/python/cpython/blob/c9da063e32725a66495e4047b8a5ed13e72d9e8e/Lib/logging/__init__.py#L1769-L1775 and on my side it works on 3.10 with dill 0.3.5.1 and multiprocess 0.70.13 ```python >>> datasets.fingerprint.logger.__reduce__() (<function logging.getLogger(name=None)>, ('datasets.fingerprint',)) ``` Could you try to run this code ? Are you in an environment where the loggers are instantiated differently ? Can you check the source code of `logging.Logger.__reduce__` in `".../logging/__init__.py", line 1774` ?
[ -0.1704784780740738, -0.24004438519477844, -0.041077468544244766, 0.14504089951515198, -0.08370185643434525, 0.0011461451649665833, 0.33660608530044556, 0.16821591556072235, 0.6493862867355347, 0.165668785572052, -0.03523249924182892, 0.6121383905410767, -0.26885202527046204, 0.08796777576208115, -0.32229945063591003, -0.17099377512931824, -0.050248272716999054, -0.013430632650852203, -0.3029886484146118, 0.16521316766738892, -0.1052873358130455, 0.2245742529630661, -0.1888790726661682, 0.11316327750682831, -0.3706149160861969, -0.21305814385414124, -0.12412317842245102, 0.24962061643600464, 0.11869160830974579, -0.40181857347488403, -0.20109935104846954, -0.2191820740699768, -0.233134925365448, 0.6415014266967773, -0.00011209521471755579, 0.059975892305374146, 0.18194103240966797, 0.06277265399694443, -0.07400974631309509, -0.3015989065170288, -0.1970399022102356, -0.19252793490886688, 0.10213652998209, -0.21372488141059875, 0.3513124883174896, -0.07654386013746262, 0.28693756461143494, -0.19967922568321228, 0.42255210876464844, -0.05262758210301399, 0.19537729024887085, 0.17559655010700226, 0.23653610050678253, -0.02188122645020485, -0.2125009298324585, 0.10003500431776047, -0.07670257240533829, 0.2840968072414398, 0.06711253523826599, -0.07933622598648071, -0.35391995310783386, 0.2236059159040451, -0.11019428819417953, 0.08235591650009155, -0.1474463939666748, -0.0642785057425499, 0.3382282257080078, -0.2574777603149414, 0.08554404973983765, 0.18800252676010132, -0.013699673116207123, -0.23369437456130981, -0.20503021776676178, -0.1721433848142624, -0.2121858298778534, -0.29711228609085083, 0.09739673137664795, 0.05006092041730881, -0.17859503626823425, -0.073691725730896, 0.3107518255710602, -0.31532108783721924, 0.1311245858669281, -0.0046231746673583984, 0.12821543216705322, 0.35646528005599976, -0.017335616052150726, 0.32920873165130615, 0.37990784645080566, 0.09955599904060364, -0.37651002407073975, 0.0625389814376831, 0.03858529031276703, -0.10501561313867569, -0.3200284242630005, 0.094119131565094, 0.15197762846946716, -0.11490125209093094, -0.22326987981796265, 0.12216465175151825, -0.11910201609134674, 0.058067500591278076, 0.15117327868938446, 0.3639531433582306, 0.48530733585357666, -0.3401527404785156, -0.017741382122039795, 0.650530219078064, 0.3552256226539612, -0.13898347318172455, -0.2885074317455292, 0.05969662219285965, 0.21884877979755402, -0.41348645091056824, 0.1373370736837387, 0.19189900159835815, 0.10112026333808899, 0.032825175672769547, 0.034688644111156464, -0.16664724051952362, -0.08020608127117157, -0.11547708511352539, 0.07847858965396881, 0.28991973400115967, -0.10086510330438614, 0.03433104604482651, 0.08395908027887344, 0.16173996031284332, -0.13077692687511444, 0.18028850853443146, -0.2946016192436218, 0.15217413008213043, -0.13166822493076324, 0.039721034467220306, -0.21121437847614288, -0.14016932249069214, 0.24856489896774292, 0.07455906271934509, -0.19074587523937225, -0.016593609005212784, 0.1955927610397339, -0.3056179881095886, -0.07898259907960892, 0.1841895580291748, 0.16997776925563812, -0.03085997700691223, 0.18571153283119202, -0.35464662313461304, -0.08246448636054993, -0.11294164508581161, -0.2949376702308655, -0.16296789050102234, -0.3751789331436157, 0.1034005880355835, 0.1424638032913208, 0.16409282386302948, -0.3851533532142639, -0.16978953778743744, 0.3694053590297699, -0.05189821124076843, -0.07502084225416183, -0.37109988927841187, -0.05157666653394699, -0.32638344168663025, 0.030750853940844536, 0.3205620050430298, 0.007628709077835083, -0.08481844514608383, -0.4513487219810486, -0.16425520181655884, 0.5453606247901917, 0.20331457257270813, 0.046673428267240524, 0.12039972841739655, -0.2639197111129761, 0.6925797462463379, 0.1258644461631775, -0.15644218027591705, 0.004957291763275862, 0.18578147888183594, -0.24214044213294983, 0.12166822701692581, 0.3669721186161041, -0.23800630867481232, -0.021666960790753365, 0.01562727615237236, 0.14275163412094116, 0.06817124783992767, 0.09340783208608627, 0.10989224165678024, -0.2171785831451416, 0.10519155859947205, 0.07313521206378937, 0.0005865395069122314, 0.19426564872264862, -0.24931734800338745, 0.10300279408693314, -0.3087391257286072, 0.37112903594970703, -0.028194207698106766, 0.128870889544487, 0.01668398827314377, 0.17829589545726776, 0.09072443097829819, -0.09015759825706482, -0.22090619802474976, -0.2847069203853607, 0.16988784074783325, -0.45585817098617554, -0.18209438025951385, -0.15979187190532684, 0.05297170579433441, 0.2339477837085724, 0.0603041797876358, -0.36281201243400574, 0.03362007811665535, 0.20383162796497345, 0.35447758436203003, -0.062169238924980164, -0.08158120512962341, -0.011951450258493423, 0.00007910653948783875, -0.05918613821268082, 0.018251318484544754, -0.1544666290283203, 0.1030149906873703, -0.43285852670669556, -0.28121405839920044, -0.14611659944057465, 0.1256284862756729, 0.13000482320785522, 0.015225597657263279, 0.007780698128044605, 0.10461007803678513, 0.29907065629959106, 0.28983452916145325, 0.2601819634437561, -0.24916206300258636, -0.0427132248878479, -0.07894128561019897, -0.09569526463747025, 0.2436741590499878, 0.033528413623571396, -0.23261338472366333, 0.21345335245132446, -0.02391098439693451, 0.39122241735458374, 0.21630007028579712, -0.11306619644165039, 0.29020455479621887, -0.10698237270116806, -0.0774587094783783, 0.17940960824489594, -0.05177346616983414, 0.13702775537967682, -0.27100610733032227, 0.31787440180778503, -0.1485898345708847, -0.4968014657497406, -0.08835072070360184, 0.2608257234096527, 0.29720985889434814, 0.4398045539855957, -0.08921501785516739, -0.09573722630739212, -0.07763515412807465, 0.13454033434391022, -0.04596628248691559, 0.2742013931274414, 0.07877156138420105, 0.01847153529524803, -0.13915075361728668, 0.17491433024406433, -0.07709453999996185, 0.0656047910451889, -0.0784899890422821, 0.1917261779308319, 0.5188334584236145, 0.08646082133054733, -0.010545103810727596, -0.009708825498819351, -0.2665615975856781, -0.025392204523086548, 0.01778111606836319, -0.1376716047525406, -0.018247229978442192, -0.3838404715061188, 0.22477436065673828, -0.14697276055812836, 0.08258221298456192, -0.10104474425315857, -0.35736018419265747, -0.020907144993543625, 0.24943436682224274, -0.4651641249656677, 0.254553884267807, -0.09384000301361084, -0.14038391411304474, -0.24442891776561737, 0.1275293231010437, -0.11448819935321808, -0.24123941361904144, 0.0132768414914608, 0.0045743584632873535, 0.353376179933548, -0.026737568899989128, 0.29966962337493896, 0.3109329342842102, -0.4942317605018616, -0.23676267266273499, 0.015579476952552795, 0.016226187348365784, -0.11317919194698334, 0.07046642154455185, 0.42205506563186646, 0.12781038880348206, -0.09805849194526672, -0.3609545826911926, 0.20968253910541534, -0.1687198430299759, -0.19041189551353455, -0.045019276440143585, -0.050574593245983124, 0.006988425739109516, 0.006827730685472488, -0.17888352274894714, -0.6229405403137207, -0.45987996459007263, 0.49268555641174316, -0.08657306432723999, 0.2919169068336487, 0.183648020029068, 0.0261395201086998, 0.17058147490024567, -0.16887253522872925, 0.16290172934532166, -0.0648624375462532, 0.12947431206703186, -0.05898791179060936, -0.17726168036460876, -0.06883369386196136, -0.1580818146467209, 0.04024672508239746, -0.06813861429691315, -0.32513004541397095, -0.28763726353645325, 0.10712376236915588, -0.214109405875206, 0.2494438886642456, -0.025885500013828278, 0.1951064020395279, 0.1918053925037384, 0.3971101939678192, -0.1702331006526947, 0.02347293496131897, -0.15227752923965454, 0.14785027503967285, 0.34795916080474854, 0.32204338908195496, 0.19725927710533142, -0.1253865361213684, 0.06685128808021545, 0.9068630337715149, 0.25261855125427246, -0.04650525376200676, 0.23119208216667175, 0.02998652681708336, -0.026535604149103165, 0.029561471194028854, -0.46304112672805786, 0.06973449140787125, -0.212996244430542, 0.057243719696998596, -0.0741211473941803, -0.2855481505393982, -0.16521118581295013, -0.004921872168779373, 0.21444925665855408, -0.284965455532074, -0.2162206918001175, 0.2168060839176178, -0.06855296343564987, -0.2032662332057953, -0.3249015808105469, -0.1985834240913391, -0.06658226251602173, 0.17310655117034912, -0.01710101217031479, -0.024665862321853638, 0.32053351402282715, -0.0872030183672905, 0.1267101764678955, -0.3690234422683716, -0.46367478370666504, 0.36173945665359497, 0.06265253573656082, -0.08774380385875702, -0.2605329751968384, -0.1760990023612976, -0.09211824834346771, 0.021505506709218025, 0.40400266647338867, -0.159867063164711, 0.10531842708587646, 0.22696155309677124, -0.13349038362503052, 0.015870748087763786, -0.061867401003837585, -0.1209435909986496, 0.7046935558319092, 0.26756858825683594, 0.20654919743537903, -0.2737477719783783, -0.14233803749084473, 0.02356860600411892, 0.14196276664733887, -0.08466936647891998, -0.038889236748218536, -0.24659842252731323, -0.07768283039331436, -0.13849525153636932, 0.15510980784893036, 0.08232703804969788, 0.25174278020858765, 0.09778950363397598, -0.09174385666847229, 0.17398591339588165, -0.14940081536769867, -0.18939439952373505, -0.18034522235393524, 0.23600459098815918, -0.29632458090782166, 0.10126610100269318, 0.13477107882499695, 0.39963310956954956, 0.22752058506011963, 0.3450799584388733, -0.42172396183013916, 0.03918100893497467, 0.2157452404499054, 0.02340482920408249, 0.1936129927635193, 0.03251489996910095, 0.002387627027928829, 0.27431073784828186, 0.05858875811100006, 0.42277395725250244, 0.03989139944314957, -0.1367851346731186, 0.2579230070114136, 0.04706263914704323, -0.15529747307300568, 0.18694356083869934, 0.47681519389152527, 0.28563281893730164, 0.10260093212127686, 0.6579890847206116, -0.4336269497871399, -0.18972976505756378, 0.2837598919868469, -0.1231168881058693, 0.7337725758552551, 0.022805269807577133, -0.013860125094652176, 0.0023871324956417084, -0.06097327917814255, 0.0003734568599611521, 0.28470945358276367, 0.036073699593544006, -0.3258834779262543, -0.00584940891712904, 0.1026209145784378, -0.1991177648305893, 0.1262008547782898, 0.05941850692033768, -0.3438444137573242, 0.19911083579063416, -0.3975822329521179, -0.33620885014533997, -0.18486736714839935, 0.2708461284637451, 0.08969013392925262, -0.08295276761054993, 0.18736021220684052, 0.10115489363670349, 0.03846631944179535, 0.23466795682907104, 0.04233868420124054, -0.12158203125, 0.19061152637004852, -0.22102682292461395, -0.42906486988067627, 0.07426125556230545, 0.00719881197437644, 0.4756898880004883, 0.16636714339256287, -0.02970362827181816, -0.09443017840385437, 0.10736368596553802, -0.5213296413421631, -0.14292313158512115, 0.1034640222787857, 0.04158322140574455, 0.17803692817687988, -0.01904110796749592, -0.13567335903644562, 0.11099568009376526, 0.19868721067905426, -0.10856305062770844, -0.2663596570491791, 0.10721215605735779, -0.2340518832206726, -0.7553526759147644, -0.04188697785139084, 0.33403706550598145, -0.029433615505695343, 0.2158505916595459, -0.07697153091430664, -0.06427580118179321, -0.3720512390136719, -0.28051528334617615, 0.140474334359169, 0.22988319396972656, -0.2416871190071106, 0.5183645486831665, -0.37618523836135864, -0.06297776103019714, 0.07730042934417725, 0.3479664921760559, -0.002854354679584503, 0.34368351101875305, 0.3331749439239502, 0.32585233449935913, -0.19133631885051727, -0.305093377828598, -0.22743266820907593, -0.12431257218122482, 0.16755327582359314, 0.48446527123451233, -0.11688634753227234, 0.03310732543468475, -0.1379634439945221, 0.25070545077323914, 0.15605010092258453, 0.2012852132320404, -0.18768815696239471, -0.4076804220676422, -0.2377675324678421, 0.18597200512886047, -0.15692231059074402, 0.18495303392410278, -0.013951374217867851, 0.3558984100818634, 0.015717899426817894, 0.48014140129089355, -0.29436564445495605, 0.05423825979232788, -0.4230455160140991, 0.03771335259079933, 0.2523268461227417, -0.09448010474443436, 0.015360996127128601, 0.17075799405574799, 0.2082729935646057, 0.22203350067138672, -0.049618806689977646, -0.23021200299263, 0.04354168102145195, 0.08486846089363098, 0.14167004823684692, 0.0698947012424469, 0.0670560672879219, 0.05648791790008545, 0.03253840655088425, -0.03740871697664261, 0.011158071458339691, 0.2606784403324127, -0.11184777319431305, 0.10307959467172623, 0.11549834907054901, 0.007746703922748566, 0.1670437604188919, 0.12410443276166916, -0.050254493951797485, -0.15430258214473724, -0.12794823944568634, 0.35805073380470276, 0.11390269547700882, -0.0791548565030098, 0.12324996292591095, -0.23201268911361694, -0.08424265682697296, -0.0035069361329078674, 0.14964710175991058, -0.0651816800236702, -0.4138964116573334, 0.004696729127317667, 0.461696982383728, 0.2218674272298813, -0.16660986840724945, 0.16210173070430756, 0.011004989966750145, 0.22539377212524414, -0.22132508456707, -0.04274721071124077, 0.20037661492824554, 0.13664564490318298, 0.11758999526500702, 0.0076933354139328, -0.14028231799602509, -0.09212825447320938, -0.21149493753910065, 0.23746836185455322, -0.13890720903873444, -0.4486119747161865, 0.25004780292510986, -0.06480343639850616, -0.09609659016132355, 0.021168682724237442, 0.4194360673427582, 0.14149287343025208, 0.2939731776714325, 0.08178657293319702, -0.147874116897583, 0.14870670437812805, -0.270449697971344, -0.18264369666576385, 0.11831251531839371, -0.4652427136898041, 0.5194094181060791, 0.3894754648208618, -0.18036982417106628, 0.05610617622733116, -0.1623348891735077, 0.6842086911201477, -0.6786056160926819, -0.25967535376548767, 0.0027586277574300766, 0.4400864839553833, -0.27193543314933777, -0.06336300820112228, -0.13350346684455872, -0.027554411441087723, -0.09364712983369827, -0.04399257153272629, 0.2462596744298935, 0.03162171319127083, 0.653125524520874, 0.1571011245250702, -0.2743206024169922, -0.1304512619972229, -0.42904531955718994, 0.12086652964353561, 0.37495240569114685, -0.32881373167037964, -0.15235480666160583, 0.22777822613716125, -0.13894091546535492, -0.4794405996799469, 0.2785640060901642, 0.583191454410553, 0.225002720952034, -0.3686278164386749, -0.04382682964205742, 0.07692733407020569, -0.04976961761713028, -0.11938832700252533, 0.19530227780342102, -0.1265898495912552, -0.32472604513168335, 0.44099289178848267, 0.11402396857738495, -0.21896013617515564, -0.002197299152612686, 0.29075244069099426, 0.5587812662124634, 0.19746507704257965, 0.312686026096344, 0.016303444281220436, -0.32658258080482483, 0.3178251087665558, -0.21372252702713013, -0.4146823585033417, -0.09911505877971649, 0.3258882761001587, -0.15123684704303741, 0.1396869719028473, -0.17479492723941803, 0.12294220924377441, 0.05640238896012306, 0.22463740408420563, 0.3077670633792877, 0.003821704536676407, -0.38448822498321533, 0.17235194146633148, -0.14357419312000275, 0.32169708609580994, -0.3216906785964966, -0.3851219117641449, -0.2629864811897278, 0.284455269575119, 0.02686571329832077, 0.11633354425430298, 0.3460359573364258, -0.018508749082684517, 0.3481579124927521, 0.458171546459198, -0.20159243047237396, 0.11421741545200348, 0.06446155160665512, -0.3000822067260742, 0.3950977325439453, -0.3944608271121979, 0.14359638094902039, 0.08267617970705032, 0.12491969019174576, -0.21823792159557343, -0.20626670122146606, 0.2417985498905182, 0.018207397311925888, 0.29933685064315796, -0.06259022653102875, 0.37658268213272095, -0.35516253113746643, -0.22531291842460632, 0.10164898633956909, -0.09849686175584793, -0.23874546587467194, -0.30215856432914734, 0.027998294681310654, 0.385017991065979, -0.23117336630821228, 0.16636092960834503, -0.5321101546287537, 0.3899178206920624, -0.21830613911151886, -0.040129244327545166, 0.22905944287776947, -0.0058150216937065125, 0.29226526618003845, -0.19208471477031708, 0.09730932861566544, 0.26122817397117615, -0.14023292064666748, 0.04375508427619934, -0.3807435631752014, -0.4251602590084076, 0.4777180254459381, -0.2350882887840271, -0.1449417918920517, -0.3279189467430115, 0.32750052213668823, -0.3646610677242279, 0.2586278021335602, -0.27319929003715515, -0.05824128910899162, 0.2463684380054474, 0.09073108434677124, -0.1478208601474762, 0.011269538663327694, -0.011063281446695328, -0.08079221099615097, 0.09312708675861359, 0.4482799470424652, 0.06931573152542114, -0.1364249587059021, 0.18685446679592133, -0.20622846484184265 ]
https://github.com/huggingface/datasets/issues/5060
Unable to Use Custom Dataset Locally
Hi ! I opened a PR in your repo to fix this :) https://huggingface.co/datasets/zpn/pubchem_selfies/discussions/7 basically you need to use `open` for streaming to work properly
## Describe the bug I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says ``` If the data files live in the same folder or repository of the dataset script, you can just pass the relative paths to the files instead of URLs. ``` Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs` However, if I try to load the data using `load_dataset`, I get the following error ``` with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ``` ## Steps to reproduce the bug ```python >>> from datasets import load_dataset >>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True) >>> t = dataset["train"] >>> for item in t: ...... print(item) ...... break Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__ for key, example in self._iter(): File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter yield from ex_iterable File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ```` ``` ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.9.7 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
25
Unable to Use Custom Dataset Locally ## Describe the bug I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says ``` If the data files live in the same folder or repository of the dataset script, you can just pass the relative paths to the files instead of URLs. ``` Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs` However, if I try to load the data using `load_dataset`, I get the following error ``` with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ``` ## Steps to reproduce the bug ```python >>> from datasets import load_dataset >>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True) >>> t = dataset["train"] >>> for item in t: ...... print(item) ...... break Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__ for key, example in self._iter(): File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter yield from ex_iterable File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ```` ``` ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.9.7 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 Hi ! I opened a PR in your repo to fix this :) https://huggingface.co/datasets/zpn/pubchem_selfies/discussions/7 basically you need to use `open` for streaming to work properly
[ -0.14774192869663239, 0.22815263271331787, 0.11311464011669159, 0.2891523838043213, 0.1840389370918274, 0.03914976865053177, 0.32221031188964844, 0.1039482057094574, 0.1223006546497345, 0.01048971712589264, -0.20797914266586304, 0.34354206919670105, -0.08664333820343018, 0.039404623210430145, 0.05319129675626755, -0.027673490345478058, -0.29052940011024475, 0.012357957661151886, -0.14548681676387787, 0.0017373822629451752, -0.19799089431762695, 0.3178074061870575, -0.0014573261141777039, 0.2268088459968567, -0.203174889087677, 0.10714571177959442, -0.08888936787843704, 0.6540964245796204, -0.0025918688625097275, -0.3605932295322418, 0.37094688415527344, 0.14108949899673462, 0.21925760805606842, 0.7598578333854675, -0.00011639561125775799, 0.2962762117385864, 0.21074031293392181, -0.18241922557353973, -0.39055687189102173, -0.5160663723945618, -0.0836353525519371, -0.022730734199285507, 0.09532078355550766, -0.1828378140926361, -0.13667087256908417, -0.34082385897636414, -0.11468394100666046, -0.7036355137825012, 0.10361054539680481, 0.30279287695884705, 0.14758983254432678, 0.11822326481342316, -0.1641567200422287, -0.2605118155479431, 0.101752869784832, 0.41765695810317993, -0.14627353847026825, 0.39043450355529785, 0.43779295682907104, -0.22280067205429077, -0.13528379797935486, 0.012143842875957489, 0.10222378373146057, 0.15883851051330566, 0.41771915555000305, 0.21893222630023956, -0.10147447139024734, -0.048230960965156555, 0.1712629795074463, 0.34746256470680237, 0.5257089138031006, -0.5059864521026611, -0.4955179691314697, -0.3011617064476013, -0.06628445535898209, 0.07202373445034027, 0.22545546293258667, 0.38347727060317993, -0.2295857071876526, 0.36198705434799194, -0.3491271734237671, -0.06503274291753769, -0.39318814873695374, 0.22901450097560883, 0.07640621066093445, -0.037044912576675415, -0.1409837156534195, 0.06837453693151474, -0.0014018453657627106, -0.02992602437734604, -0.01595444604754448, -0.07739545404911041, 0.09787870943546295, 0.21520641446113586, 0.14174866676330566, 0.22384127974510193, 0.08715209364891052, 0.010392196476459503, 0.4301603138446808, 0.11862228065729141, 0.27147433161735535, -0.003631729632616043, -0.36226558685302734, -0.033734627068042755, 0.22737038135528564, 0.23632539808750153, 0.23541688919067383, 0.16212701797485352, 0.2539922893047333, 0.3929443359375, -0.024424288421869278, -0.11862040311098099, -0.10788501799106598, -0.12851601839065552, -0.28346237540245056, -0.029763709753751755, 0.3388298749923706, -0.2749098241329193, -0.02932746335864067, -0.06395818293094635, 0.17423167824745178, -0.014754233881831169, 0.16966630518436432, 0.28222134709358215, 0.09809371083974838, -0.1686033308506012, -0.16046760976314545, 0.28520262241363525, -0.015170466154813766, -0.13575942814350128, -0.15317034721374512, -0.029672667384147644, -0.2124924510717392, 0.21397747099399567, 0.3518708050251007, -0.45841675996780396, 0.32380765676498413, -0.05864137038588524, 0.06594207137823105, 0.08646723628044128, -0.1470913290977478, 0.011152476072311401, -0.05471213907003403, 0.1842706948518753, -0.11616295576095581, 0.2227948009967804, 0.23466354608535767, -0.13960003852844238, -0.20726943016052246, 0.0019038356840610504, -0.1304033100605011, -0.5140136480331421, -0.34317389130592346, 0.042182859033346176, -0.39120644330978394, 0.016637373715639114, 0.10799770802259445, -0.16770516335964203, 0.0029881149530410767, -0.23648788034915924, -0.25867635011672974, 0.13365386426448822, -0.40543702244758606, -0.1970476359128952, 0.2967877984046936, 0.6850590705871582, -0.6251212358474731, -0.004171915352344513, -0.22063663601875305, -0.20308473706245422, 0.23697996139526367, 0.34779468178749084, -0.32971689105033875, 0.2274113893508911, -0.3879077732563019, 0.1135612279176712, 0.14341741800308228, -0.3578098714351654, -0.39088326692581177, 0.4649062752723694, -0.22547093033790588, 0.07805454730987549, 0.06284437328577042, -0.18510423600673676, -0.03929196298122406, -0.05544660612940788, 0.11041195690631866, 0.4766849875450134, 0.06408653408288956, 0.07678951323032379, -0.2719554901123047, -0.2993334233760834, 0.20040446519851685, 0.21279384195804596, -0.22838853299617767, 0.2108287215232849, 0.32145339250564575, -0.2554897964000702, 0.10885888338088989, -0.14385946094989777, 0.09037338197231293, 0.1573421061038971, 0.1934085339307785, 0.17279964685440063, 0.02478969097137451, 0.1400390863418579, -0.6741921305656433, 0.5493412613868713, -0.24143514037132263, -0.056576162576675415, -0.5214758515357971, -0.13640734553337097, -0.4017457365989685, 0.06301122158765793, -0.3654536008834839, -0.27459245920181274, 0.010053854435682297, 0.23782478272914886, 0.37213778495788574, 0.04157305136322975, -0.30290135741233826, 0.3100840449333191, -0.11241202056407928, 0.04303235933184624, -0.2997550368309021, 0.35134610533714294, 0.024318935349583626, 0.00828234851360321, 0.03138532489538193, 0.1360715627670288, 0.20594120025634766, -0.28852492570877075, -0.08444135636091232, 0.46435946226119995, 0.002376454882323742, 0.297264963388443, 0.2284599244594574, 0.01193702220916748, 0.2096441686153412, -0.21548663079738617, 0.30152323842048645, 0.10362452268600464, 0.10494199395179749, 0.011748671531677246, -0.5547345876693726, 0.19006597995758057, -0.2789188027381897, 0.2731272280216217, 0.13464932143688202, 0.00974210910499096, 0.23952621221542358, -0.14701201021671295, -0.08964608609676361, -0.3355770707130432, 0.12704774737358093, -0.0219106562435627, 0.43800994753837585, 0.1399545818567276, -0.16126373410224915, 0.02513856440782547, 0.14693710207939148, 0.02128731459379196, 0.006796851754188538, 0.2436341941356659, -0.15929782390594482, 0.02560340240597725, 0.1446293592453003, 0.27072057127952576, 0.5614980459213257, 0.1428878754377365, 0.05572459474205971, 0.3010491132736206, -0.0946185365319252, -0.23172318935394287, -0.21965020895004272, -0.09012749791145325, 0.0066721271723508835, 0.389434278011322, -0.026012519374489784, 0.09610110521316528, -0.18135130405426025, -0.13856130838394165, 0.08914660662412643, 0.2785303294658661, -0.43755605816841125, 0.019248956814408302, -0.4984584152698517, -0.27969828248023987, -0.13194318115711212, -0.25426384806632996, -0.18268758058547974, -0.12605614960193634, -0.14632725715637207, -0.033110182732343674, -0.020526500418782234, -0.028537625446915627, -0.02376323565840721, 0.31083619594573975, -0.12204668670892715, -0.5242055058479309, -0.17923010885715485, -0.2669130265712738, -0.21477749943733215, -0.06111915782094002, 0.4058837294578552, 0.17188207805156708, 0.19786304235458374, -0.055198945105075836, -0.11218489706516266, -0.39748725295066833, 0.026960574090480804, 0.09207119047641754, 0.2387041449546814, 0.4137413501739502, 0.30182915925979614, 0.18121162056922913, 0.3629189729690552, -0.009677644819021225, 0.5721977949142456, -0.2026982456445694, 0.0009588785469532013, 0.07477584481239319, 0.041434332728385925, -0.005547592416405678, -0.3482074737548828, -0.2588573694229126, -0.5313045382499695, -0.376592755317688, 0.28937846422195435, 0.16247709095478058, 0.24276085197925568, 0.547076404094696, 0.23148128390312195, 0.1766888052225113, -0.08230306953191757, -0.02580299787223339, -0.10959767550230026, -0.6073430180549622, 0.3390645384788513, -0.3669832646846771, -0.41761085391044617, -0.19278472661972046, -0.03036903589963913, 0.167524054646492, 0.229636088013649, -0.3712770938873291, -0.11389420926570892, -0.14523836970329285, 0.3367961645126343, 0.1392749696969986, 0.04666779190301895, 0.16852658987045288, -0.08198661357164383, -0.007531879469752312, -0.18824705481529236, -0.2242298573255539, 0.18827462196350098, 0.06686460226774216, 0.10534433275461197, 0.519917905330658, 0.1916157305240631, 0.06656831502914429, 0.6709776520729065, 0.10378637909889221, -0.19324739277362823, 0.5168952941894531, -0.3139179050922394, 0.4040679335594177, -0.06972364336252213, -0.39872318506240845, -0.08727758377790451, 0.11552981287240982, -0.216402068734169, 0.1423327475786209, 0.23191392421722412, 0.09314771741628647, -0.28133267164230347, 0.010159283876419067, -0.2629203796386719, -0.14396065473556519, 0.11088353395462036, 0.3082285523414612, 0.174795463681221, 0.06325666606426239, 0.011737234890460968, -0.16395550966262817, -0.05409757420420647, 0.24750009179115295, 0.2055811583995819, 0.10025348514318466, 0.17941345274448395, -0.12763842940330505, 0.18492893874645233, -0.3162916302680969, 0.2858819365501404, -0.01564016379415989, 0.29352936148643494, -0.16682973504066467, -0.01572905108332634, 0.0670502781867981, 0.022746119648218155, 0.3118233382701874, -0.27774778008461, 0.1353980004787445, 0.2075015902519226, -0.16316983103752136, -0.7035887241363525, -0.07505781948566437, 0.21330526471138, 0.29087042808532715, -0.11141163110733032, 0.5893503427505493, -0.07934406399726868, -0.2190539389848709, 0.010964326560497284, 0.14959214627742767, -0.14737553894519806, -0.23681026697158813, -0.05906996503472328, -0.32749316096305847, -0.2660464942455292, -0.3278684914112091, -0.2566682994365692, 0.16723492741584778, 0.14234524965286255, 0.06851199269294739, 0.18131139874458313, 0.11024390906095505, -0.08036315441131592, 0.02454885095357895, 0.14417389035224915, 0.054468583315610886, 0.13292719423770905, 0.4319189786911011, 0.13056311011314392, 0.31297093629837036, 0.8803198337554932, -0.19700461626052856, -0.2667502164840698, -0.027637392282485962, -0.033380892127752304, 0.09729818254709244, 0.24443712830543518, -0.10025731474161148, -0.2507837414741516, 0.1471187323331833, -0.014302551746368408, -0.34723153710365295, 0.16798658668994904, 0.04585295915603638, -0.4456365406513214, -0.0017109168693423271, -0.41788235306739807, 0.44207286834716797, 0.07410840690135956, -0.026381611824035645, 0.37342536449432373, -0.040553897619247437, -0.29128557443618774, 0.1609092801809311, -0.013810895383358002, 0.5378240346908569, -0.24397192895412445, 0.06396973878145218, 0.09317585825920105, -0.004720672965049744, 0.2131064236164093, -0.19144593179225922, -0.059101447463035583, -0.3430425226688385, -0.17802581191062927, -0.02967933937907219, -0.18828029930591583, 0.4919232428073883, 0.25869694352149963, 0.0433589331805706, 0.17121662199497223, -0.18572872877120972, 0.16926231980323792, 0.1806732714176178, 0.3919188976287842, -0.007999056950211525, -0.378935843706131, -0.21075348556041718, 0.11738422513008118, -0.20947794616222382, 0.43608394265174866, 0.08880481868982315, -0.13551028072834015, -0.35800063610076904, -0.027829278260469437, -0.10280480235815048, 0.27825212478637695, -0.4024510979652405, 0.059423934668302536, -0.024682525545358658, -0.2673807740211487, 0.09344601631164551, 0.37841033935546875, 0.15441292524337769, 0.006476543843746185, -0.2708664834499359, 0.02432389371097088, -0.2838473320007324, -0.012078803963959217, -0.03614640235900879, 0.1575290858745575, 0.07320721447467804, 0.012532498687505722, -0.1254349797964096, -0.1693505048751831, -0.06638913601636887, -0.17670199275016785, 0.03887243568897247, -0.10442063212394714, 0.15111780166625977, -0.2036810666322708, -0.21113193035125732, -0.2353917956352234, 0.24859192967414856, -0.018821988254785538, 0.04048745334148407, 0.2323617935180664, -0.10965808480978012, -0.002984181046485901, -0.1714666336774826, -0.23707233369350433, -0.08884191513061523, 0.4640698730945587, -0.37544476985931396, 0.18466992676258087, 0.2380610853433609, 0.2472645789384842, 0.10423578321933746, -0.09094306826591492, 0.1830291450023651, 0.16691063344478607, -0.4189229905605316, -0.056805167347192764, 0.15996558964252472, 0.18408741056919098, -0.05888335779309273, 0.13166238367557526, 0.2457897961139679, -0.08542364090681076, -0.008601989597082138, -0.39231234788894653, -0.27788838744163513, -0.04903422296047211, 0.036914996802806854, 0.17406103014945984, 0.06035567820072174, -0.1059381365776062, 0.187737837433815, -0.08540687710046768, -0.2331668883562088, 0.16486692428588867, -0.013812612742185593, -0.1999129056930542, 0.49136883020401, 0.08314152806997299, 0.24968412518501282, -0.15046170353889465, 0.06197410821914673, 0.013537222519516945, -0.2096427083015442, -0.1350058913230896, -0.18188276886940002, 0.1661507487297058, 0.15244227647781372, -0.234444722533226, -0.15155255794525146, -0.2164982259273529, -0.08532583713531494, -0.10497898608446121, 0.22756750881671906, 0.38290849328041077, -0.06531353294849396, 0.14149664342403412, -0.00013371184468269348, -0.046706974506378174, -0.2388816773891449, 0.15277940034866333, -0.04523329436779022, 0.2539670467376709, 0.18609942495822906, 0.07490120828151703, -0.26913371682167053, -0.0718773901462555, -0.12121398001909256, -0.002610251307487488, 0.08518888056278229, 0.08599036931991577, 0.36354517936706543, -0.2988777160644531, 0.17978444695472717, 0.1804981380701065, 0.41735634207725525, 0.17312774062156677, -0.4020504653453827, 0.0520329549908638, 0.42868757247924805, 0.06516074389219284, -0.09172400832176208, -0.1564934253692627, 0.4773811101913452, 0.1035056933760643, -0.03257739171385765, 0.2691800892353058, 0.3142149746417999, -0.0282115675508976, -0.06881426274776459, -0.1748625636100769, 0.6545155644416809, 0.14086318016052246, 0.04342231526970863, 0.3303062915802002, -0.1686801314353943, -0.021343041211366653, -0.06665988266468048, 0.39314818382263184, 0.2547786831855774, 0.3704516291618347, -0.2331191897392273, 0.0676703080534935, -0.19406312704086304, 0.14667245745658875, 0.0893646776676178, -0.7359635829925537, 0.18974260985851288, 0.10342392325401306, 0.08250164985656738, -0.06599941104650497, -0.24800047278404236, 0.7226849794387817, -0.3406696915626526, 0.07596659660339355, -0.07030854374170303, 0.2421882152557373, 0.07961012423038483, -0.07831500470638275, -0.34049832820892334, -0.21672165393829346, -0.10975511372089386, 0.05131320282816887, -0.053543251007795334, -0.282148540019989, -0.034219786524772644, -0.10597142577171326, -0.1357426941394806, -0.28897133469581604, 0.0008101873099803925, 0.0997609794139862, -0.05815703421831131, -0.21477539837360382, 0.23097631335258484, 0.23182013630867004, 0.019426748156547546, 0.18149518966674805, 0.13652583956718445, 0.3472554683685303, 0.37549546360969543, 0.09005337953567505, -0.020928047597408295, -0.1490778923034668, 0.06464362889528275, -0.08169916272163391, 0.19330687820911407, -0.20756855607032776, -0.02765892818570137, 0.48321351408958435, 0.08986879140138626, -0.12957842648029327, 0.038325872272253036, 0.06823612004518509, 0.5128048062324524, -0.06261473894119263, 0.15377891063690186, -0.1386251151561737, -0.0890827476978302, 0.16149555146694183, -0.015103451907634735, -0.34740546345710754, -0.21248067915439606, 0.4200247824192047, 0.16904138028621674, 0.29934972524642944, -0.1497328132390976, 0.042325280606746674, 0.06769298017024994, 0.4938631057739258, 0.3871385455131531, 0.07023516297340393, -0.21125714480876923, -0.23263324797153473, -0.814149022102356, 0.03119872510433197, -0.1126236617565155, -0.1680378019809723, 0.03198758512735367, 0.033236563205718994, 0.012562982738018036, 0.24859914183616638, -0.04399479925632477, 0.04361063241958618, -0.03276507183909416, 0.2224646955728531, -0.08437667042016983, -0.050924304872751236, -0.3216569423675537, 0.06788165867328644, 0.10105469822883606, -0.32358023524284363, 0.0032800473272800446, -0.22992457449436188, 0.021700888872146606, 0.036181144416332245, 0.09507676959037781, 0.05342039093375206, -0.2816546559333801, 0.299191951751709, -0.08052434772253036, 0.310680091381073, 0.19736754894256592, 0.06462816894054413, -0.37531983852386475, 0.06256607174873352, -0.06438836455345154, 0.1036750078201294, -0.045041825622320175, 0.3556042015552521, -0.3657347857952118, -0.4172280430793762, -0.5886316895484924, -0.09017019718885422, 0.11824561655521393, 0.2499103993177414, -0.0008514970541000366, 0.1402365267276764, -0.18251197040081024, -0.0669185221195221, 0.34020745754241943, 0.03586284816265106, -0.11240096390247345, 0.15939563512802124, -0.11288753896951675, -0.2132677286863327, 0.6130944490432739, -0.3164016008377075, -0.1498405635356903, 0.280373215675354, 0.04799722135066986, -0.19556885957717896, -0.3039144277572632, -0.17782175540924072, 0.22873783111572266, 0.34796881675720215, -0.07837413251399994, -0.015338307246565819, -0.07470342516899109, -0.21744592487812042, -0.019580423831939697, -0.010437063872814178, 0.00908765196800232, 0.029275555163621902, -0.02939760498702526, 0.05374734476208687, -0.025405069813132286 ]
https://github.com/huggingface/datasets/issues/5060
Unable to Use Custom Dataset Locally
Thank you so much for this! Naive question, is this a feature of `open` or have you all overloaded it to be able to read from a URL? Any links to code/documentation would be greatly appreciated, I'd love to learn more
## Describe the bug I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says ``` If the data files live in the same folder or repository of the dataset script, you can just pass the relative paths to the files instead of URLs. ``` Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs` However, if I try to load the data using `load_dataset`, I get the following error ``` with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ``` ## Steps to reproduce the bug ```python >>> from datasets import load_dataset >>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True) >>> t = dataset["train"] >>> for item in t: ...... print(item) ...... break Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__ for key, example in self._iter(): File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter yield from ex_iterable File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ```` ``` ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.9.7 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
41
Unable to Use Custom Dataset Locally ## Describe the bug I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says ``` If the data files live in the same folder or repository of the dataset script, you can just pass the relative paths to the files instead of URLs. ``` Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs` However, if I try to load the data using `load_dataset`, I get the following error ``` with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ``` ## Steps to reproduce the bug ```python >>> from datasets import load_dataset >>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True) >>> t = dataset["train"] >>> for item in t: ...... print(item) ...... break Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__ for key, example in self._iter(): File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter yield from ex_iterable File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ```` ``` ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.9.7 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 Thank you so much for this! Naive question, is this a feature of `open` or have you all overloaded it to be able to read from a URL? Any links to code/documentation would be greatly appreciated, I'd love to learn more
[ -0.14774192869663239, 0.22815263271331787, 0.11311464011669159, 0.2891523838043213, 0.1840389370918274, 0.03914976865053177, 0.32221031188964844, 0.1039482057094574, 0.1223006546497345, 0.01048971712589264, -0.20797914266586304, 0.34354206919670105, -0.08664333820343018, 0.039404623210430145, 0.05319129675626755, -0.027673490345478058, -0.29052940011024475, 0.012357957661151886, -0.14548681676387787, 0.0017373822629451752, -0.19799089431762695, 0.3178074061870575, -0.0014573261141777039, 0.2268088459968567, -0.203174889087677, 0.10714571177959442, -0.08888936787843704, 0.6540964245796204, -0.0025918688625097275, -0.3605932295322418, 0.37094688415527344, 0.14108949899673462, 0.21925760805606842, 0.7598578333854675, -0.00011639561125775799, 0.2962762117385864, 0.21074031293392181, -0.18241922557353973, -0.39055687189102173, -0.5160663723945618, -0.0836353525519371, -0.022730734199285507, 0.09532078355550766, -0.1828378140926361, -0.13667087256908417, -0.34082385897636414, -0.11468394100666046, -0.7036355137825012, 0.10361054539680481, 0.30279287695884705, 0.14758983254432678, 0.11822326481342316, -0.1641567200422287, -0.2605118155479431, 0.101752869784832, 0.41765695810317993, -0.14627353847026825, 0.39043450355529785, 0.43779295682907104, -0.22280067205429077, -0.13528379797935486, 0.012143842875957489, 0.10222378373146057, 0.15883851051330566, 0.41771915555000305, 0.21893222630023956, -0.10147447139024734, -0.048230960965156555, 0.1712629795074463, 0.34746256470680237, 0.5257089138031006, -0.5059864521026611, -0.4955179691314697, -0.3011617064476013, -0.06628445535898209, 0.07202373445034027, 0.22545546293258667, 0.38347727060317993, -0.2295857071876526, 0.36198705434799194, -0.3491271734237671, -0.06503274291753769, -0.39318814873695374, 0.22901450097560883, 0.07640621066093445, -0.037044912576675415, -0.1409837156534195, 0.06837453693151474, -0.0014018453657627106, -0.02992602437734604, -0.01595444604754448, -0.07739545404911041, 0.09787870943546295, 0.21520641446113586, 0.14174866676330566, 0.22384127974510193, 0.08715209364891052, 0.010392196476459503, 0.4301603138446808, 0.11862228065729141, 0.27147433161735535, -0.003631729632616043, -0.36226558685302734, -0.033734627068042755, 0.22737038135528564, 0.23632539808750153, 0.23541688919067383, 0.16212701797485352, 0.2539922893047333, 0.3929443359375, -0.024424288421869278, -0.11862040311098099, -0.10788501799106598, -0.12851601839065552, -0.28346237540245056, -0.029763709753751755, 0.3388298749923706, -0.2749098241329193, -0.02932746335864067, -0.06395818293094635, 0.17423167824745178, -0.014754233881831169, 0.16966630518436432, 0.28222134709358215, 0.09809371083974838, -0.1686033308506012, -0.16046760976314545, 0.28520262241363525, -0.015170466154813766, -0.13575942814350128, -0.15317034721374512, -0.029672667384147644, -0.2124924510717392, 0.21397747099399567, 0.3518708050251007, -0.45841675996780396, 0.32380765676498413, -0.05864137038588524, 0.06594207137823105, 0.08646723628044128, -0.1470913290977478, 0.011152476072311401, -0.05471213907003403, 0.1842706948518753, -0.11616295576095581, 0.2227948009967804, 0.23466354608535767, -0.13960003852844238, -0.20726943016052246, 0.0019038356840610504, -0.1304033100605011, -0.5140136480331421, -0.34317389130592346, 0.042182859033346176, -0.39120644330978394, 0.016637373715639114, 0.10799770802259445, -0.16770516335964203, 0.0029881149530410767, -0.23648788034915924, -0.25867635011672974, 0.13365386426448822, -0.40543702244758606, -0.1970476359128952, 0.2967877984046936, 0.6850590705871582, -0.6251212358474731, -0.004171915352344513, -0.22063663601875305, -0.20308473706245422, 0.23697996139526367, 0.34779468178749084, -0.32971689105033875, 0.2274113893508911, -0.3879077732563019, 0.1135612279176712, 0.14341741800308228, -0.3578098714351654, -0.39088326692581177, 0.4649062752723694, -0.22547093033790588, 0.07805454730987549, 0.06284437328577042, -0.18510423600673676, -0.03929196298122406, -0.05544660612940788, 0.11041195690631866, 0.4766849875450134, 0.06408653408288956, 0.07678951323032379, -0.2719554901123047, -0.2993334233760834, 0.20040446519851685, 0.21279384195804596, -0.22838853299617767, 0.2108287215232849, 0.32145339250564575, -0.2554897964000702, 0.10885888338088989, -0.14385946094989777, 0.09037338197231293, 0.1573421061038971, 0.1934085339307785, 0.17279964685440063, 0.02478969097137451, 0.1400390863418579, -0.6741921305656433, 0.5493412613868713, -0.24143514037132263, -0.056576162576675415, -0.5214758515357971, -0.13640734553337097, -0.4017457365989685, 0.06301122158765793, -0.3654536008834839, -0.27459245920181274, 0.010053854435682297, 0.23782478272914886, 0.37213778495788574, 0.04157305136322975, -0.30290135741233826, 0.3100840449333191, -0.11241202056407928, 0.04303235933184624, -0.2997550368309021, 0.35134610533714294, 0.024318935349583626, 0.00828234851360321, 0.03138532489538193, 0.1360715627670288, 0.20594120025634766, -0.28852492570877075, -0.08444135636091232, 0.46435946226119995, 0.002376454882323742, 0.297264963388443, 0.2284599244594574, 0.01193702220916748, 0.2096441686153412, -0.21548663079738617, 0.30152323842048645, 0.10362452268600464, 0.10494199395179749, 0.011748671531677246, -0.5547345876693726, 0.19006597995758057, -0.2789188027381897, 0.2731272280216217, 0.13464932143688202, 0.00974210910499096, 0.23952621221542358, -0.14701201021671295, -0.08964608609676361, -0.3355770707130432, 0.12704774737358093, -0.0219106562435627, 0.43800994753837585, 0.1399545818567276, -0.16126373410224915, 0.02513856440782547, 0.14693710207939148, 0.02128731459379196, 0.006796851754188538, 0.2436341941356659, -0.15929782390594482, 0.02560340240597725, 0.1446293592453003, 0.27072057127952576, 0.5614980459213257, 0.1428878754377365, 0.05572459474205971, 0.3010491132736206, -0.0946185365319252, -0.23172318935394287, -0.21965020895004272, -0.09012749791145325, 0.0066721271723508835, 0.389434278011322, -0.026012519374489784, 0.09610110521316528, -0.18135130405426025, -0.13856130838394165, 0.08914660662412643, 0.2785303294658661, -0.43755605816841125, 0.019248956814408302, -0.4984584152698517, -0.27969828248023987, -0.13194318115711212, -0.25426384806632996, -0.18268758058547974, -0.12605614960193634, -0.14632725715637207, -0.033110182732343674, -0.020526500418782234, -0.028537625446915627, -0.02376323565840721, 0.31083619594573975, -0.12204668670892715, -0.5242055058479309, -0.17923010885715485, -0.2669130265712738, -0.21477749943733215, -0.06111915782094002, 0.4058837294578552, 0.17188207805156708, 0.19786304235458374, -0.055198945105075836, -0.11218489706516266, -0.39748725295066833, 0.026960574090480804, 0.09207119047641754, 0.2387041449546814, 0.4137413501739502, 0.30182915925979614, 0.18121162056922913, 0.3629189729690552, -0.009677644819021225, 0.5721977949142456, -0.2026982456445694, 0.0009588785469532013, 0.07477584481239319, 0.041434332728385925, -0.005547592416405678, -0.3482074737548828, -0.2588573694229126, -0.5313045382499695, -0.376592755317688, 0.28937846422195435, 0.16247709095478058, 0.24276085197925568, 0.547076404094696, 0.23148128390312195, 0.1766888052225113, -0.08230306953191757, -0.02580299787223339, -0.10959767550230026, -0.6073430180549622, 0.3390645384788513, -0.3669832646846771, -0.41761085391044617, -0.19278472661972046, -0.03036903589963913, 0.167524054646492, 0.229636088013649, -0.3712770938873291, -0.11389420926570892, -0.14523836970329285, 0.3367961645126343, 0.1392749696969986, 0.04666779190301895, 0.16852658987045288, -0.08198661357164383, -0.007531879469752312, -0.18824705481529236, -0.2242298573255539, 0.18827462196350098, 0.06686460226774216, 0.10534433275461197, 0.519917905330658, 0.1916157305240631, 0.06656831502914429, 0.6709776520729065, 0.10378637909889221, -0.19324739277362823, 0.5168952941894531, -0.3139179050922394, 0.4040679335594177, -0.06972364336252213, -0.39872318506240845, -0.08727758377790451, 0.11552981287240982, -0.216402068734169, 0.1423327475786209, 0.23191392421722412, 0.09314771741628647, -0.28133267164230347, 0.010159283876419067, -0.2629203796386719, -0.14396065473556519, 0.11088353395462036, 0.3082285523414612, 0.174795463681221, 0.06325666606426239, 0.011737234890460968, -0.16395550966262817, -0.05409757420420647, 0.24750009179115295, 0.2055811583995819, 0.10025348514318466, 0.17941345274448395, -0.12763842940330505, 0.18492893874645233, -0.3162916302680969, 0.2858819365501404, -0.01564016379415989, 0.29352936148643494, -0.16682973504066467, -0.01572905108332634, 0.0670502781867981, 0.022746119648218155, 0.3118233382701874, -0.27774778008461, 0.1353980004787445, 0.2075015902519226, -0.16316983103752136, -0.7035887241363525, -0.07505781948566437, 0.21330526471138, 0.29087042808532715, -0.11141163110733032, 0.5893503427505493, -0.07934406399726868, -0.2190539389848709, 0.010964326560497284, 0.14959214627742767, -0.14737553894519806, -0.23681026697158813, -0.05906996503472328, -0.32749316096305847, -0.2660464942455292, -0.3278684914112091, -0.2566682994365692, 0.16723492741584778, 0.14234524965286255, 0.06851199269294739, 0.18131139874458313, 0.11024390906095505, -0.08036315441131592, 0.02454885095357895, 0.14417389035224915, 0.054468583315610886, 0.13292719423770905, 0.4319189786911011, 0.13056311011314392, 0.31297093629837036, 0.8803198337554932, -0.19700461626052856, -0.2667502164840698, -0.027637392282485962, -0.033380892127752304, 0.09729818254709244, 0.24443712830543518, -0.10025731474161148, -0.2507837414741516, 0.1471187323331833, -0.014302551746368408, -0.34723153710365295, 0.16798658668994904, 0.04585295915603638, -0.4456365406513214, -0.0017109168693423271, -0.41788235306739807, 0.44207286834716797, 0.07410840690135956, -0.026381611824035645, 0.37342536449432373, -0.040553897619247437, -0.29128557443618774, 0.1609092801809311, -0.013810895383358002, 0.5378240346908569, -0.24397192895412445, 0.06396973878145218, 0.09317585825920105, -0.004720672965049744, 0.2131064236164093, -0.19144593179225922, -0.059101447463035583, -0.3430425226688385, -0.17802581191062927, -0.02967933937907219, -0.18828029930591583, 0.4919232428073883, 0.25869694352149963, 0.0433589331805706, 0.17121662199497223, -0.18572872877120972, 0.16926231980323792, 0.1806732714176178, 0.3919188976287842, -0.007999056950211525, -0.378935843706131, -0.21075348556041718, 0.11738422513008118, -0.20947794616222382, 0.43608394265174866, 0.08880481868982315, -0.13551028072834015, -0.35800063610076904, -0.027829278260469437, -0.10280480235815048, 0.27825212478637695, -0.4024510979652405, 0.059423934668302536, -0.024682525545358658, -0.2673807740211487, 0.09344601631164551, 0.37841033935546875, 0.15441292524337769, 0.006476543843746185, -0.2708664834499359, 0.02432389371097088, -0.2838473320007324, -0.012078803963959217, -0.03614640235900879, 0.1575290858745575, 0.07320721447467804, 0.012532498687505722, -0.1254349797964096, -0.1693505048751831, -0.06638913601636887, -0.17670199275016785, 0.03887243568897247, -0.10442063212394714, 0.15111780166625977, -0.2036810666322708, -0.21113193035125732, -0.2353917956352234, 0.24859192967414856, -0.018821988254785538, 0.04048745334148407, 0.2323617935180664, -0.10965808480978012, -0.002984181046485901, -0.1714666336774826, -0.23707233369350433, -0.08884191513061523, 0.4640698730945587, -0.37544476985931396, 0.18466992676258087, 0.2380610853433609, 0.2472645789384842, 0.10423578321933746, -0.09094306826591492, 0.1830291450023651, 0.16691063344478607, -0.4189229905605316, -0.056805167347192764, 0.15996558964252472, 0.18408741056919098, -0.05888335779309273, 0.13166238367557526, 0.2457897961139679, -0.08542364090681076, -0.008601989597082138, -0.39231234788894653, -0.27788838744163513, -0.04903422296047211, 0.036914996802806854, 0.17406103014945984, 0.06035567820072174, -0.1059381365776062, 0.187737837433815, -0.08540687710046768, -0.2331668883562088, 0.16486692428588867, -0.013812612742185593, -0.1999129056930542, 0.49136883020401, 0.08314152806997299, 0.24968412518501282, -0.15046170353889465, 0.06197410821914673, 0.013537222519516945, -0.2096427083015442, -0.1350058913230896, -0.18188276886940002, 0.1661507487297058, 0.15244227647781372, -0.234444722533226, -0.15155255794525146, -0.2164982259273529, -0.08532583713531494, -0.10497898608446121, 0.22756750881671906, 0.38290849328041077, -0.06531353294849396, 0.14149664342403412, -0.00013371184468269348, -0.046706974506378174, -0.2388816773891449, 0.15277940034866333, -0.04523329436779022, 0.2539670467376709, 0.18609942495822906, 0.07490120828151703, -0.26913371682167053, -0.0718773901462555, -0.12121398001909256, -0.002610251307487488, 0.08518888056278229, 0.08599036931991577, 0.36354517936706543, -0.2988777160644531, 0.17978444695472717, 0.1804981380701065, 0.41735634207725525, 0.17312774062156677, -0.4020504653453827, 0.0520329549908638, 0.42868757247924805, 0.06516074389219284, -0.09172400832176208, -0.1564934253692627, 0.4773811101913452, 0.1035056933760643, -0.03257739171385765, 0.2691800892353058, 0.3142149746417999, -0.0282115675508976, -0.06881426274776459, -0.1748625636100769, 0.6545155644416809, 0.14086318016052246, 0.04342231526970863, 0.3303062915802002, -0.1686801314353943, -0.021343041211366653, -0.06665988266468048, 0.39314818382263184, 0.2547786831855774, 0.3704516291618347, -0.2331191897392273, 0.0676703080534935, -0.19406312704086304, 0.14667245745658875, 0.0893646776676178, -0.7359635829925537, 0.18974260985851288, 0.10342392325401306, 0.08250164985656738, -0.06599941104650497, -0.24800047278404236, 0.7226849794387817, -0.3406696915626526, 0.07596659660339355, -0.07030854374170303, 0.2421882152557373, 0.07961012423038483, -0.07831500470638275, -0.34049832820892334, -0.21672165393829346, -0.10975511372089386, 0.05131320282816887, -0.053543251007795334, -0.282148540019989, -0.034219786524772644, -0.10597142577171326, -0.1357426941394806, -0.28897133469581604, 0.0008101873099803925, 0.0997609794139862, -0.05815703421831131, -0.21477539837360382, 0.23097631335258484, 0.23182013630867004, 0.019426748156547546, 0.18149518966674805, 0.13652583956718445, 0.3472554683685303, 0.37549546360969543, 0.09005337953567505, -0.020928047597408295, -0.1490778923034668, 0.06464362889528275, -0.08169916272163391, 0.19330687820911407, -0.20756855607032776, -0.02765892818570137, 0.48321351408958435, 0.08986879140138626, -0.12957842648029327, 0.038325872272253036, 0.06823612004518509, 0.5128048062324524, -0.06261473894119263, 0.15377891063690186, -0.1386251151561737, -0.0890827476978302, 0.16149555146694183, -0.015103451907634735, -0.34740546345710754, -0.21248067915439606, 0.4200247824192047, 0.16904138028621674, 0.29934972524642944, -0.1497328132390976, 0.042325280606746674, 0.06769298017024994, 0.4938631057739258, 0.3871385455131531, 0.07023516297340393, -0.21125714480876923, -0.23263324797153473, -0.814149022102356, 0.03119872510433197, -0.1126236617565155, -0.1680378019809723, 0.03198758512735367, 0.033236563205718994, 0.012562982738018036, 0.24859914183616638, -0.04399479925632477, 0.04361063241958618, -0.03276507183909416, 0.2224646955728531, -0.08437667042016983, -0.050924304872751236, -0.3216569423675537, 0.06788165867328644, 0.10105469822883606, -0.32358023524284363, 0.0032800473272800446, -0.22992457449436188, 0.021700888872146606, 0.036181144416332245, 0.09507676959037781, 0.05342039093375206, -0.2816546559333801, 0.299191951751709, -0.08052434772253036, 0.310680091381073, 0.19736754894256592, 0.06462816894054413, -0.37531983852386475, 0.06256607174873352, -0.06438836455345154, 0.1036750078201294, -0.045041825622320175, 0.3556042015552521, -0.3657347857952118, -0.4172280430793762, -0.5886316895484924, -0.09017019718885422, 0.11824561655521393, 0.2499103993177414, -0.0008514970541000366, 0.1402365267276764, -0.18251197040081024, -0.0669185221195221, 0.34020745754241943, 0.03586284816265106, -0.11240096390247345, 0.15939563512802124, -0.11288753896951675, -0.2132677286863327, 0.6130944490432739, -0.3164016008377075, -0.1498405635356903, 0.280373215675354, 0.04799722135066986, -0.19556885957717896, -0.3039144277572632, -0.17782175540924072, 0.22873783111572266, 0.34796881675720215, -0.07837413251399994, -0.015338307246565819, -0.07470342516899109, -0.21744592487812042, -0.019580423831939697, -0.010437063872814178, 0.00908765196800232, 0.029275555163621902, -0.02939760498702526, 0.05374734476208687, -0.025405069813132286 ]
https://github.com/huggingface/datasets/issues/5060
Unable to Use Custom Dataset Locally
`datasets` extends `open` in dataset scripts to work with URLs. The builtin `open` from python only works with local files. You can find the extension here: https://github.com/huggingface/datasets/blob/6ad430ba0cdeeb601170f732d4bd977f5c04594d/src/datasets/download/streaming_download_manager.py#L435-L451 I think we can create a docs section dedicated to streaming to explain how this works
## Describe the bug I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says ``` If the data files live in the same folder or repository of the dataset script, you can just pass the relative paths to the files instead of URLs. ``` Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs` However, if I try to load the data using `load_dataset`, I get the following error ``` with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ``` ## Steps to reproduce the bug ```python >>> from datasets import load_dataset >>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True) >>> t = dataset["train"] >>> for item in t: ...... print(item) ...... break Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__ for key, example in self._iter(): File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter yield from ex_iterable File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ```` ``` ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.9.7 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
43
Unable to Use Custom Dataset Locally ## Describe the bug I have uploaded a [dataset](https://huggingface.co/datasets/zpn/pubchem_selfies) and followed the instructions from the [dataset_loader](https://huggingface.co/docs/datasets/dataset_script#download-data-files-and-organize-splits) tutorial. In that tutorial, it says ``` If the data files live in the same folder or repository of the dataset script, you can just pass the relative paths to the files instead of URLs. ``` Accordingly, I put the [relative path](https://huggingface.co/datasets/zpn/pubchem_selfies/blob/main/pubchem_selfies.py#L76) to the data to be used. I was able to test the dataset and generate the metadata locally with `datasets-cli test path/to/<your-dataset-loading-script> --save_infos --all_configs` However, if I try to load the data using `load_dataset`, I get the following error ``` with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ``` ## Steps to reproduce the bug ```python >>> from datasets import load_dataset >>> dataset = load_dataset("zpn/pubchem_selfies", streaming=True) >>> t = dataset["train"] >>> for item in t: ...... print(item) ...... break Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 723, in __iter__ for key, example in self._iter(): File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 713, in _iter yield from ex_iterable File "/Users/zachnussbaum/env/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 113, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/Users/zachnussbaum/.cache/huggingface/modules/datasets_modules/datasets/zpn--pubchem_selfies/d2571f35996765aea70fd3f3f8e3882d59c401fb738615c79282e2eb1d9f7a25/pubchem_selfies.py", line 475, in _generate_examples with gzip.open(filepath, mode="rt") as f: File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'https://huggingface.co/datasets/zpn/pubchem_selfies/resolve/main/data/Compound_021000001_021500000/Compound_021000001_021500000_SELFIES.jsonl.gz' ```` ``` ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.9.7 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 `datasets` extends `open` in dataset scripts to work with URLs. The builtin `open` from python only works with local files. You can find the extension here: https://github.com/huggingface/datasets/blob/6ad430ba0cdeeb601170f732d4bd977f5c04594d/src/datasets/download/streaming_download_manager.py#L435-L451 I think we can create a docs section dedicated to streaming to explain how this works
[ -0.14774192869663239, 0.22815263271331787, 0.11311464011669159, 0.2891523838043213, 0.1840389370918274, 0.03914976865053177, 0.32221031188964844, 0.1039482057094574, 0.1223006546497345, 0.01048971712589264, -0.20797914266586304, 0.34354206919670105, -0.08664333820343018, 0.039404623210430145, 0.05319129675626755, -0.027673490345478058, -0.29052940011024475, 0.012357957661151886, -0.14548681676387787, 0.0017373822629451752, -0.19799089431762695, 0.3178074061870575, -0.0014573261141777039, 0.2268088459968567, -0.203174889087677, 0.10714571177959442, -0.08888936787843704, 0.6540964245796204, -0.0025918688625097275, -0.3605932295322418, 0.37094688415527344, 0.14108949899673462, 0.21925760805606842, 0.7598578333854675, -0.00011639561125775799, 0.2962762117385864, 0.21074031293392181, -0.18241922557353973, -0.39055687189102173, -0.5160663723945618, -0.0836353525519371, -0.022730734199285507, 0.09532078355550766, -0.1828378140926361, -0.13667087256908417, -0.34082385897636414, -0.11468394100666046, -0.7036355137825012, 0.10361054539680481, 0.30279287695884705, 0.14758983254432678, 0.11822326481342316, -0.1641567200422287, -0.2605118155479431, 0.101752869784832, 0.41765695810317993, -0.14627353847026825, 0.39043450355529785, 0.43779295682907104, -0.22280067205429077, -0.13528379797935486, 0.012143842875957489, 0.10222378373146057, 0.15883851051330566, 0.41771915555000305, 0.21893222630023956, -0.10147447139024734, -0.048230960965156555, 0.1712629795074463, 0.34746256470680237, 0.5257089138031006, -0.5059864521026611, -0.4955179691314697, -0.3011617064476013, -0.06628445535898209, 0.07202373445034027, 0.22545546293258667, 0.38347727060317993, -0.2295857071876526, 0.36198705434799194, -0.3491271734237671, -0.06503274291753769, -0.39318814873695374, 0.22901450097560883, 0.07640621066093445, -0.037044912576675415, -0.1409837156534195, 0.06837453693151474, -0.0014018453657627106, -0.02992602437734604, -0.01595444604754448, -0.07739545404911041, 0.09787870943546295, 0.21520641446113586, 0.14174866676330566, 0.22384127974510193, 0.08715209364891052, 0.010392196476459503, 0.4301603138446808, 0.11862228065729141, 0.27147433161735535, -0.003631729632616043, -0.36226558685302734, -0.033734627068042755, 0.22737038135528564, 0.23632539808750153, 0.23541688919067383, 0.16212701797485352, 0.2539922893047333, 0.3929443359375, -0.024424288421869278, -0.11862040311098099, -0.10788501799106598, -0.12851601839065552, -0.28346237540245056, -0.029763709753751755, 0.3388298749923706, -0.2749098241329193, -0.02932746335864067, -0.06395818293094635, 0.17423167824745178, -0.014754233881831169, 0.16966630518436432, 0.28222134709358215, 0.09809371083974838, -0.1686033308506012, -0.16046760976314545, 0.28520262241363525, -0.015170466154813766, -0.13575942814350128, -0.15317034721374512, -0.029672667384147644, -0.2124924510717392, 0.21397747099399567, 0.3518708050251007, -0.45841675996780396, 0.32380765676498413, -0.05864137038588524, 0.06594207137823105, 0.08646723628044128, -0.1470913290977478, 0.011152476072311401, -0.05471213907003403, 0.1842706948518753, -0.11616295576095581, 0.2227948009967804, 0.23466354608535767, -0.13960003852844238, -0.20726943016052246, 0.0019038356840610504, -0.1304033100605011, -0.5140136480331421, -0.34317389130592346, 0.042182859033346176, -0.39120644330978394, 0.016637373715639114, 0.10799770802259445, -0.16770516335964203, 0.0029881149530410767, -0.23648788034915924, -0.25867635011672974, 0.13365386426448822, -0.40543702244758606, -0.1970476359128952, 0.2967877984046936, 0.6850590705871582, -0.6251212358474731, -0.004171915352344513, -0.22063663601875305, -0.20308473706245422, 0.23697996139526367, 0.34779468178749084, -0.32971689105033875, 0.2274113893508911, -0.3879077732563019, 0.1135612279176712, 0.14341741800308228, -0.3578098714351654, -0.39088326692581177, 0.4649062752723694, -0.22547093033790588, 0.07805454730987549, 0.06284437328577042, -0.18510423600673676, -0.03929196298122406, -0.05544660612940788, 0.11041195690631866, 0.4766849875450134, 0.06408653408288956, 0.07678951323032379, -0.2719554901123047, -0.2993334233760834, 0.20040446519851685, 0.21279384195804596, -0.22838853299617767, 0.2108287215232849, 0.32145339250564575, -0.2554897964000702, 0.10885888338088989, -0.14385946094989777, 0.09037338197231293, 0.1573421061038971, 0.1934085339307785, 0.17279964685440063, 0.02478969097137451, 0.1400390863418579, -0.6741921305656433, 0.5493412613868713, -0.24143514037132263, -0.056576162576675415, -0.5214758515357971, -0.13640734553337097, -0.4017457365989685, 0.06301122158765793, -0.3654536008834839, -0.27459245920181274, 0.010053854435682297, 0.23782478272914886, 0.37213778495788574, 0.04157305136322975, -0.30290135741233826, 0.3100840449333191, -0.11241202056407928, 0.04303235933184624, -0.2997550368309021, 0.35134610533714294, 0.024318935349583626, 0.00828234851360321, 0.03138532489538193, 0.1360715627670288, 0.20594120025634766, -0.28852492570877075, -0.08444135636091232, 0.46435946226119995, 0.002376454882323742, 0.297264963388443, 0.2284599244594574, 0.01193702220916748, 0.2096441686153412, -0.21548663079738617, 0.30152323842048645, 0.10362452268600464, 0.10494199395179749, 0.011748671531677246, -0.5547345876693726, 0.19006597995758057, -0.2789188027381897, 0.2731272280216217, 0.13464932143688202, 0.00974210910499096, 0.23952621221542358, -0.14701201021671295, -0.08964608609676361, -0.3355770707130432, 0.12704774737358093, -0.0219106562435627, 0.43800994753837585, 0.1399545818567276, -0.16126373410224915, 0.02513856440782547, 0.14693710207939148, 0.02128731459379196, 0.006796851754188538, 0.2436341941356659, -0.15929782390594482, 0.02560340240597725, 0.1446293592453003, 0.27072057127952576, 0.5614980459213257, 0.1428878754377365, 0.05572459474205971, 0.3010491132736206, -0.0946185365319252, -0.23172318935394287, -0.21965020895004272, -0.09012749791145325, 0.0066721271723508835, 0.389434278011322, -0.026012519374489784, 0.09610110521316528, -0.18135130405426025, -0.13856130838394165, 0.08914660662412643, 0.2785303294658661, -0.43755605816841125, 0.019248956814408302, -0.4984584152698517, -0.27969828248023987, -0.13194318115711212, -0.25426384806632996, -0.18268758058547974, -0.12605614960193634, -0.14632725715637207, -0.033110182732343674, -0.020526500418782234, -0.028537625446915627, -0.02376323565840721, 0.31083619594573975, -0.12204668670892715, -0.5242055058479309, -0.17923010885715485, -0.2669130265712738, -0.21477749943733215, -0.06111915782094002, 0.4058837294578552, 0.17188207805156708, 0.19786304235458374, -0.055198945105075836, -0.11218489706516266, -0.39748725295066833, 0.026960574090480804, 0.09207119047641754, 0.2387041449546814, 0.4137413501739502, 0.30182915925979614, 0.18121162056922913, 0.3629189729690552, -0.009677644819021225, 0.5721977949142456, -0.2026982456445694, 0.0009588785469532013, 0.07477584481239319, 0.041434332728385925, -0.005547592416405678, -0.3482074737548828, -0.2588573694229126, -0.5313045382499695, -0.376592755317688, 0.28937846422195435, 0.16247709095478058, 0.24276085197925568, 0.547076404094696, 0.23148128390312195, 0.1766888052225113, -0.08230306953191757, -0.02580299787223339, -0.10959767550230026, -0.6073430180549622, 0.3390645384788513, -0.3669832646846771, -0.41761085391044617, -0.19278472661972046, -0.03036903589963913, 0.167524054646492, 0.229636088013649, -0.3712770938873291, -0.11389420926570892, -0.14523836970329285, 0.3367961645126343, 0.1392749696969986, 0.04666779190301895, 0.16852658987045288, -0.08198661357164383, -0.007531879469752312, -0.18824705481529236, -0.2242298573255539, 0.18827462196350098, 0.06686460226774216, 0.10534433275461197, 0.519917905330658, 0.1916157305240631, 0.06656831502914429, 0.6709776520729065, 0.10378637909889221, -0.19324739277362823, 0.5168952941894531, -0.3139179050922394, 0.4040679335594177, -0.06972364336252213, -0.39872318506240845, -0.08727758377790451, 0.11552981287240982, -0.216402068734169, 0.1423327475786209, 0.23191392421722412, 0.09314771741628647, -0.28133267164230347, 0.010159283876419067, -0.2629203796386719, -0.14396065473556519, 0.11088353395462036, 0.3082285523414612, 0.174795463681221, 0.06325666606426239, 0.011737234890460968, -0.16395550966262817, -0.05409757420420647, 0.24750009179115295, 0.2055811583995819, 0.10025348514318466, 0.17941345274448395, -0.12763842940330505, 0.18492893874645233, -0.3162916302680969, 0.2858819365501404, -0.01564016379415989, 0.29352936148643494, -0.16682973504066467, -0.01572905108332634, 0.0670502781867981, 0.022746119648218155, 0.3118233382701874, -0.27774778008461, 0.1353980004787445, 0.2075015902519226, -0.16316983103752136, -0.7035887241363525, -0.07505781948566437, 0.21330526471138, 0.29087042808532715, -0.11141163110733032, 0.5893503427505493, -0.07934406399726868, -0.2190539389848709, 0.010964326560497284, 0.14959214627742767, -0.14737553894519806, -0.23681026697158813, -0.05906996503472328, -0.32749316096305847, -0.2660464942455292, -0.3278684914112091, -0.2566682994365692, 0.16723492741584778, 0.14234524965286255, 0.06851199269294739, 0.18131139874458313, 0.11024390906095505, -0.08036315441131592, 0.02454885095357895, 0.14417389035224915, 0.054468583315610886, 0.13292719423770905, 0.4319189786911011, 0.13056311011314392, 0.31297093629837036, 0.8803198337554932, -0.19700461626052856, -0.2667502164840698, -0.027637392282485962, -0.033380892127752304, 0.09729818254709244, 0.24443712830543518, -0.10025731474161148, -0.2507837414741516, 0.1471187323331833, -0.014302551746368408, -0.34723153710365295, 0.16798658668994904, 0.04585295915603638, -0.4456365406513214, -0.0017109168693423271, -0.41788235306739807, 0.44207286834716797, 0.07410840690135956, -0.026381611824035645, 0.37342536449432373, -0.040553897619247437, -0.29128557443618774, 0.1609092801809311, -0.013810895383358002, 0.5378240346908569, -0.24397192895412445, 0.06396973878145218, 0.09317585825920105, -0.004720672965049744, 0.2131064236164093, -0.19144593179225922, -0.059101447463035583, -0.3430425226688385, -0.17802581191062927, -0.02967933937907219, -0.18828029930591583, 0.4919232428073883, 0.25869694352149963, 0.0433589331805706, 0.17121662199497223, -0.18572872877120972, 0.16926231980323792, 0.1806732714176178, 0.3919188976287842, -0.007999056950211525, -0.378935843706131, -0.21075348556041718, 0.11738422513008118, -0.20947794616222382, 0.43608394265174866, 0.08880481868982315, -0.13551028072834015, -0.35800063610076904, -0.027829278260469437, -0.10280480235815048, 0.27825212478637695, -0.4024510979652405, 0.059423934668302536, -0.024682525545358658, -0.2673807740211487, 0.09344601631164551, 0.37841033935546875, 0.15441292524337769, 0.006476543843746185, -0.2708664834499359, 0.02432389371097088, -0.2838473320007324, -0.012078803963959217, -0.03614640235900879, 0.1575290858745575, 0.07320721447467804, 0.012532498687505722, -0.1254349797964096, -0.1693505048751831, -0.06638913601636887, -0.17670199275016785, 0.03887243568897247, -0.10442063212394714, 0.15111780166625977, -0.2036810666322708, -0.21113193035125732, -0.2353917956352234, 0.24859192967414856, -0.018821988254785538, 0.04048745334148407, 0.2323617935180664, -0.10965808480978012, -0.002984181046485901, -0.1714666336774826, -0.23707233369350433, -0.08884191513061523, 0.4640698730945587, -0.37544476985931396, 0.18466992676258087, 0.2380610853433609, 0.2472645789384842, 0.10423578321933746, -0.09094306826591492, 0.1830291450023651, 0.16691063344478607, -0.4189229905605316, -0.056805167347192764, 0.15996558964252472, 0.18408741056919098, -0.05888335779309273, 0.13166238367557526, 0.2457897961139679, -0.08542364090681076, -0.008601989597082138, -0.39231234788894653, -0.27788838744163513, -0.04903422296047211, 0.036914996802806854, 0.17406103014945984, 0.06035567820072174, -0.1059381365776062, 0.187737837433815, -0.08540687710046768, -0.2331668883562088, 0.16486692428588867, -0.013812612742185593, -0.1999129056930542, 0.49136883020401, 0.08314152806997299, 0.24968412518501282, -0.15046170353889465, 0.06197410821914673, 0.013537222519516945, -0.2096427083015442, -0.1350058913230896, -0.18188276886940002, 0.1661507487297058, 0.15244227647781372, -0.234444722533226, -0.15155255794525146, -0.2164982259273529, -0.08532583713531494, -0.10497898608446121, 0.22756750881671906, 0.38290849328041077, -0.06531353294849396, 0.14149664342403412, -0.00013371184468269348, -0.046706974506378174, -0.2388816773891449, 0.15277940034866333, -0.04523329436779022, 0.2539670467376709, 0.18609942495822906, 0.07490120828151703, -0.26913371682167053, -0.0718773901462555, -0.12121398001909256, -0.002610251307487488, 0.08518888056278229, 0.08599036931991577, 0.36354517936706543, -0.2988777160644531, 0.17978444695472717, 0.1804981380701065, 0.41735634207725525, 0.17312774062156677, -0.4020504653453827, 0.0520329549908638, 0.42868757247924805, 0.06516074389219284, -0.09172400832176208, -0.1564934253692627, 0.4773811101913452, 0.1035056933760643, -0.03257739171385765, 0.2691800892353058, 0.3142149746417999, -0.0282115675508976, -0.06881426274776459, -0.1748625636100769, 0.6545155644416809, 0.14086318016052246, 0.04342231526970863, 0.3303062915802002, -0.1686801314353943, -0.021343041211366653, -0.06665988266468048, 0.39314818382263184, 0.2547786831855774, 0.3704516291618347, -0.2331191897392273, 0.0676703080534935, -0.19406312704086304, 0.14667245745658875, 0.0893646776676178, -0.7359635829925537, 0.18974260985851288, 0.10342392325401306, 0.08250164985656738, -0.06599941104650497, -0.24800047278404236, 0.7226849794387817, -0.3406696915626526, 0.07596659660339355, -0.07030854374170303, 0.2421882152557373, 0.07961012423038483, -0.07831500470638275, -0.34049832820892334, -0.21672165393829346, -0.10975511372089386, 0.05131320282816887, -0.053543251007795334, -0.282148540019989, -0.034219786524772644, -0.10597142577171326, -0.1357426941394806, -0.28897133469581604, 0.0008101873099803925, 0.0997609794139862, -0.05815703421831131, -0.21477539837360382, 0.23097631335258484, 0.23182013630867004, 0.019426748156547546, 0.18149518966674805, 0.13652583956718445, 0.3472554683685303, 0.37549546360969543, 0.09005337953567505, -0.020928047597408295, -0.1490778923034668, 0.06464362889528275, -0.08169916272163391, 0.19330687820911407, -0.20756855607032776, -0.02765892818570137, 0.48321351408958435, 0.08986879140138626, -0.12957842648029327, 0.038325872272253036, 0.06823612004518509, 0.5128048062324524, -0.06261473894119263, 0.15377891063690186, -0.1386251151561737, -0.0890827476978302, 0.16149555146694183, -0.015103451907634735, -0.34740546345710754, -0.21248067915439606, 0.4200247824192047, 0.16904138028621674, 0.29934972524642944, -0.1497328132390976, 0.042325280606746674, 0.06769298017024994, 0.4938631057739258, 0.3871385455131531, 0.07023516297340393, -0.21125714480876923, -0.23263324797153473, -0.814149022102356, 0.03119872510433197, -0.1126236617565155, -0.1680378019809723, 0.03198758512735367, 0.033236563205718994, 0.012562982738018036, 0.24859914183616638, -0.04399479925632477, 0.04361063241958618, -0.03276507183909416, 0.2224646955728531, -0.08437667042016983, -0.050924304872751236, -0.3216569423675537, 0.06788165867328644, 0.10105469822883606, -0.32358023524284363, 0.0032800473272800446, -0.22992457449436188, 0.021700888872146606, 0.036181144416332245, 0.09507676959037781, 0.05342039093375206, -0.2816546559333801, 0.299191951751709, -0.08052434772253036, 0.310680091381073, 0.19736754894256592, 0.06462816894054413, -0.37531983852386475, 0.06256607174873352, -0.06438836455345154, 0.1036750078201294, -0.045041825622320175, 0.3556042015552521, -0.3657347857952118, -0.4172280430793762, -0.5886316895484924, -0.09017019718885422, 0.11824561655521393, 0.2499103993177414, -0.0008514970541000366, 0.1402365267276764, -0.18251197040081024, -0.0669185221195221, 0.34020745754241943, 0.03586284816265106, -0.11240096390247345, 0.15939563512802124, -0.11288753896951675, -0.2132677286863327, 0.6130944490432739, -0.3164016008377075, -0.1498405635356903, 0.280373215675354, 0.04799722135066986, -0.19556885957717896, -0.3039144277572632, -0.17782175540924072, 0.22873783111572266, 0.34796881675720215, -0.07837413251399994, -0.015338307246565819, -0.07470342516899109, -0.21744592487812042, -0.019580423831939697, -0.010437063872814178, 0.00908765196800232, 0.029275555163621902, -0.02939760498702526, 0.05374734476208687, -0.025405069813132286 ]
https://github.com/huggingface/datasets/issues/5053
Intermittent JSON parse error when streaming the Pile
Maybe #2838 can help. In this PR we allow to skip bad chunks of JSON data to not crash the training Did you have warning messages before the error ? something like this maybe ? ``` 03/24/2022 02:19:46 - WARNING - datasets.utils.streaming_download_manager - Got disconnected from remote data host. Retrying in 5sec [1/20] 03/24/2022 02:20:01 - WARNING - datasets.utils.streaming_download_manager - Got disconnected from remote data host. Retrying in 5sec [2/20] 03/24/2022 02:20:09 - ERROR - datasets.packaged_modules.json.json - Failed to read file 'gzip://file-000000000007.json::https://huggingface.co/datasets/lvwerra/codeparrot-clean-train/resolve/1d740acb9d09cf7a3307553323e2c677a6535407/file-000000000007.json.gz' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0 ```
## Describe the bug I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash. This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it. I'm using a remote machine with 8 A6000 GPUs via runpod.io ## Expected results I have a DataLoader which can iterate through the whole Pile ## Actual results Stack trace: ``` Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0 ``` I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation ``` Traceback (most recent call last): File "ddp_script.py", line 1258, in <module> main() File "ddp_script.py", line 1143, in main for c, batch in tqdm.tqdm(enumerate(data_iter)): File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__ for obj in iterable: File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__ next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator) File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches broadcast_object_list(batch_info) File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list torch.distributed.broadcast_object_list(object_list, src=from_process) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list object_list[i] = _tensor_to_object(obj_view, obj_size) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object return _unpickler(io.BytesIO(buf)).load() _pickle.UnpicklingError: invalid load key, '@'. ``` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset( cfg["dataset_name"], streaming=True, split="train") dataset = dataset.remove_columns("meta") dataset = dataset.map(tokenize_and_concatenate, batched=True) dataset = dataset.with_format(type="torch") train_data_loader = DataLoader( dataset, batch_size=cfg["batch_size"], num_workers=3) for batch in train_data_loader: continue ``` `tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization: ``` import numpy as np import einops import torch def tokenize_and_concatenate(examples): texts = examples["text"] full_text = tokenizer.eos_token.join(texts) div = 20 length = len(full_text) // div text_list = [full_text[i * length: (i + 1) * length] for i in range(div)] tokens = tokenizer(text_list, return_tensors="np", padding=True)[ "input_ids" ].flatten() tokens = tokens[tokens != tokenizer.pad_token_id] n = len(tokens) curr_batch_size = n // (seq_len - 1) tokens = tokens[: (seq_len - 1) * curr_batch_size] tokens = einops.rearrange( tokens, "(batch_size seq) -> batch_size seq", batch_size=curr_batch_size, seq=seq_len - 1, ) prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \ tokenizer.bos_token_id return { "text": np.concatenate([prefix, tokens], axis=1) } ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid - Python version: 3.7.13 - PyArrow version: 9.0.0 - Pandas version: 1.3.5 ZStandard data: Version: 0.18.0 Summary: Zstandard bindings for Python Home-page: https://github.com/indygreg/python-zstandard Author: Gregory Szorc Author-email: gregory.szorc@gmail.com License: BSD Location: /opt/conda/lib/python3.7/site-packages Requires: Required-by:
95
Intermittent JSON parse error when streaming the Pile ## Describe the bug I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash. This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it. I'm using a remote machine with 8 A6000 GPUs via runpod.io ## Expected results I have a DataLoader which can iterate through the whole Pile ## Actual results Stack trace: ``` Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0 ``` I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation ``` Traceback (most recent call last): File "ddp_script.py", line 1258, in <module> main() File "ddp_script.py", line 1143, in main for c, batch in tqdm.tqdm(enumerate(data_iter)): File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__ for obj in iterable: File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__ next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator) File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches broadcast_object_list(batch_info) File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list torch.distributed.broadcast_object_list(object_list, src=from_process) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list object_list[i] = _tensor_to_object(obj_view, obj_size) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object return _unpickler(io.BytesIO(buf)).load() _pickle.UnpicklingError: invalid load key, '@'. ``` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset( cfg["dataset_name"], streaming=True, split="train") dataset = dataset.remove_columns("meta") dataset = dataset.map(tokenize_and_concatenate, batched=True) dataset = dataset.with_format(type="torch") train_data_loader = DataLoader( dataset, batch_size=cfg["batch_size"], num_workers=3) for batch in train_data_loader: continue ``` `tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization: ``` import numpy as np import einops import torch def tokenize_and_concatenate(examples): texts = examples["text"] full_text = tokenizer.eos_token.join(texts) div = 20 length = len(full_text) // div text_list = [full_text[i * length: (i + 1) * length] for i in range(div)] tokens = tokenizer(text_list, return_tensors="np", padding=True)[ "input_ids" ].flatten() tokens = tokens[tokens != tokenizer.pad_token_id] n = len(tokens) curr_batch_size = n // (seq_len - 1) tokens = tokens[: (seq_len - 1) * curr_batch_size] tokens = einops.rearrange( tokens, "(batch_size seq) -> batch_size seq", batch_size=curr_batch_size, seq=seq_len - 1, ) prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \ tokenizer.bos_token_id return { "text": np.concatenate([prefix, tokens], axis=1) } ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid - Python version: 3.7.13 - PyArrow version: 9.0.0 - Pandas version: 1.3.5 ZStandard data: Version: 0.18.0 Summary: Zstandard bindings for Python Home-page: https://github.com/indygreg/python-zstandard Author: Gregory Szorc Author-email: gregory.szorc@gmail.com License: BSD Location: /opt/conda/lib/python3.7/site-packages Requires: Required-by: Maybe #2838 can help. In this PR we allow to skip bad chunks of JSON data to not crash the training Did you have warning messages before the error ? something like this maybe ? ``` 03/24/2022 02:19:46 - WARNING - datasets.utils.streaming_download_manager - Got disconnected from remote data host. Retrying in 5sec [1/20] 03/24/2022 02:20:01 - WARNING - datasets.utils.streaming_download_manager - Got disconnected from remote data host. Retrying in 5sec [2/20] 03/24/2022 02:20:09 - ERROR - datasets.packaged_modules.json.json - Failed to read file 'gzip://file-000000000007.json::https://huggingface.co/datasets/lvwerra/codeparrot-clean-train/resolve/1d740acb9d09cf7a3307553323e2c677a6535407/file-000000000007.json.gz' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0 ```
[ -0.2561558187007904, 0.08614398539066315, 0.10274158418178558, 0.3511009216308594, 0.23096978664398193, -0.03777889907360077, 0.19184640049934387, 0.42057377099990845, -0.2875746488571167, 0.1298532783985138, 0.32849112153053284, 0.34214913845062256, 0.023091211915016174, -0.1828186810016632, -0.3692393898963928, -0.25744789838790894, 0.038922764360904694, 0.05399181321263313, 0.4175361394882202, 0.1883118897676468, -0.113750159740448, -0.0694500282406807, -0.21130125224590302, -0.04884730279445648, -0.08136585354804993, -0.26931115984916687, 0.08838589489459991, -0.0359443798661232, 0.17213894426822662, -0.4016888439655304, -0.033648453652858734, -0.18951702117919922, 0.1225176602602005, 0.43511566519737244, -0.00012148170208092779, 0.1110675185918808, 0.41098952293395996, -0.12862510979175568, -0.36584192514419556, -0.0014963001012802124, 0.12271950393915176, -0.013563637621700764, 0.02399587072432041, -0.2755300998687744, 0.023587800562381744, -0.33100324869155884, 0.04277389124035835, -0.0975939929485321, 0.5755047798156738, -0.04484032094478607, 0.09562548249959946, 0.3156019449234009, -0.07562600076198578, 0.07377219200134277, 0.09740452468395233, -0.18393804132938385, -0.08497781306505203, 0.42899948358535767, 0.23063482344150543, 0.16213971376419067, -0.268823504447937, 0.17358748614788055, 0.13886812329292297, -0.09518946707248688, -0.0029714852571487427, 0.18564008176326752, 0.356539249420166, -0.12998349964618683, -0.06376870721578598, 0.13410232961177826, 0.08853975683450699, -0.18771988153457642, -0.2374507486820221, -0.2689366638660431, -0.2383795529603958, -0.21212050318717957, 0.09057086706161499, 0.3751358985900879, -0.20708253979682922, 0.1962946057319641, 0.3669745922088623, 0.16919417679309845, -0.1562282294034958, 0.04277210310101509, 0.2387470006942749, 0.11793385446071625, 0.051976896822452545, 0.20751553773880005, 0.1217920184135437, -0.1718684881925583, 0.020211994647979736, -0.029305171221494675, -0.38364121317863464, -0.005618485622107983, -0.5126287937164307, -0.05946936458349228, -0.05029686540365219, -0.7193992733955383, -0.05941396206617355, -0.04866716265678406, 0.5387861728668213, 0.026705099269747734, 0.3007067143917084, 0.38549402356147766, 0.724206805229187, -0.056469544768333435, 0.20696601271629333, -0.2660492956638336, 0.10813078284263611, 0.22020521759986877, 0.23500698804855347, -0.11864029616117477, 0.06870495527982712, 0.10637744516134262, 0.1433265656232834, -0.14925509691238403, 0.07900420576334, -0.04469229280948639, -0.3453634977340698, 0.1697087436914444, -0.46740686893463135, 0.16509971022605896, 0.05496864765882492, 0.11877593398094177, 0.14187517762184143, 0.479332834482193, -0.0037923380732536316, 0.31587088108062744, 0.15601231157779694, -0.26464444398880005, -0.06747321784496307, 0.03942523151636124, -0.09333589673042297, -0.1006908044219017, -0.0006698593497276306, -0.10704948008060455, 0.06490360200405121, 0.033773574978113174, -0.11906945705413818, -0.565350353717804, -0.14607873558998108, -0.21696579456329346, -0.14654004573822021, 0.216521754860878, -0.020651385188102722, -0.015463419258594513, -0.09312665462493896, 0.20435212552547455, -0.1644517183303833, 0.23286360502243042, -0.0346800833940506, -0.15588001906871796, 0.0825602263212204, 0.11952795833349228, 0.08810415118932724, 0.15737250447273254, -0.2668241858482361, 0.13056407868862152, -0.17996296286582947, -0.20249183475971222, 0.08642783015966415, -0.19626793265342712, 0.289751261472702, -0.18685126304626465, -0.18926550447940826, 0.1485237032175064, -0.3757283091545105, -0.08034390211105347, 0.05624246597290039, 0.07491059601306915, 0.36628076434135437, 0.557062029838562, -0.332457035779953, -0.007757619023323059, 0.05727037042379379, 0.35333096981048584, 0.4497258961200714, -0.24799832701683044, -0.2387014925479889, 0.27323925495147705, -0.22702966630458832, 0.11516308039426804, -0.054262228310108185, 0.12382912635803223, 0.290979266166687, -0.20996825397014618, 0.17795538902282715, 0.426802396774292, -0.1053149551153183, 0.24018293619155884, -0.3648030161857605, -0.13888593018054962, 0.13037434220314026, 0.30443426966667175, -0.09839597344398499, -0.2405124008655548, 0.0825786143541336, 0.12608826160430908, 0.25044795870780945, -0.0629359781742096, 0.043864279985427856, 0.11909114569425583, 0.5551363229751587, -0.09020502865314484, 0.11300990730524063, 0.07291160523891449, -0.46848785877227783, 0.09649307280778885, 0.10243098437786102, -0.2694050669670105, -0.14995251595973969, -0.009576871991157532, 0.16747123003005981, 0.15981201827526093, 0.08069460839033127, 0.00022541731595993042, 0.08046918362379074, 0.028938036412000656, -0.08101983368396759, 0.0257243849337101, -0.3555496335029602, 0.15688453614711761, -0.2098114788532257, 0.1300904005765915, -0.21103666722774506, 0.24682582914829254, -0.004973826929926872, -0.4886092245578766, 0.10322177410125732, -0.09515557438135147, 0.20688647031784058, -0.32900866866111755, -0.03400404751300812, 0.4016558825969696, -0.04037997126579285, 0.1224832534790039, -0.08183764666318893, -0.05662095546722412, 0.38079679012298584, -0.12158876657485962, -0.03613338619470596, 0.36100953817367554, 0.1487177461385727, -0.24369794130325317, 0.1560877561569214, 0.1190158799290657, -0.053964968770742416, 0.14660871028900146, -0.09062852710485458, -0.12699013948440552, 0.2693760395050049, 0.004339385777711868, -0.0504210963845253, 0.15984198451042175, 0.31162258982658386, 0.17470195889472961, -0.18541210889816284, -0.20729990303516388, -0.5658314824104309, -0.05268227308988571, 0.2758288085460663, -0.13022565841674805, -0.004298277199268341, 0.27954572439193726, 0.04735463112592697, -0.002501619979739189, 0.04782838374376297, 0.009706918150186539, 0.17609834671020508, -0.05879088491201401, -0.06370283663272858, 0.15071676671504974, -0.1224810853600502, -0.05066230520606041, 0.10645091533660889, 0.22410494089126587, 0.1384776383638382, 0.34873899817466736, 0.5141457915306091, 0.18580690026283264, -0.24881088733673096, -0.48621147871017456, 0.17804931104183197, 0.2095343917608261, -0.10638531297445297, 0.20851850509643555, -0.2349678874015808, 0.06952948123216629, -0.30574968457221985, -0.17656125128269196, -0.1860896646976471, -0.15396654605865479, -0.033259354531764984, 0.48721179366111755, -0.4299772083759308, 0.07032869011163712, -0.045499783009290695, 0.5747166872024536, 0.11964084208011627, 0.051907796412706375, -0.32110166549682617, -0.3779347538948059, -0.4286295175552368, -0.12055656313896179, 0.07939587533473969, 0.021742012351751328, 0.12653161585330963, -0.01675516366958618, -0.1582944095134735, -0.0015080682933330536, -0.1326380968093872, 0.12263840436935425, 0.05238361656665802, 0.22278232872486115, -0.10587610304355621, 0.3791202902793884, 0.06660124659538269, -0.5029315948486328, 0.3532450199127197, -0.4742515981197357, -0.09131782501935959, 0.24588340520858765, 0.194252148270607, -0.1378716230392456, -0.1767071634531021, -0.09486103802919388, -0.11735077947378159, -0.3107854723930359, 0.3357887268066406, -0.4692120850086212, -0.017544865608215332, -0.09665898233652115, 0.10365893691778183, -0.03870590776205063, -0.06629707664251328, -0.2888754606246948, 0.032945238053798676, -0.15279759466648102, 0.12307736277580261, 0.11288201063871384, -0.20943790674209595, 0.025985341519117355, -0.005127895623445511, -0.09252394735813141, 0.33807486295700073, -0.38531506061553955, 0.07096368819475174, -0.09656482934951782, 0.10823549330234528, -0.3471495509147644, -0.18392068147659302, 0.038818199187517166, -0.14911091327667236, 0.11643284559249878, 0.04758722335100174, -0.29992932081222534, 0.27412402629852295, 0.5116568803787231, 0.4078819453716278, 0.24857905507087708, 0.7960271239280701, 0.25757962465286255, 0.49000728130340576, -0.08869284391403198, -0.26206326484680176, 0.19069239497184753, 0.05988959223031998, 0.08360641449689865, 0.12391474843025208, 0.19319292902946472, 0.23487462103366852, -0.1274941861629486, -0.6472883820533752, -0.03252546489238739, -0.2508366107940674, -0.4081689715385437, -0.24340564012527466, -0.05757296457886696, -0.22607174515724182, -0.2576170563697815, 0.1757056713104248, 0.0665280818939209, -0.048583678901195526, -0.17173993587493896, 0.11247066408395767, 0.16302801668643951, 0.010819675400853157, 0.16094690561294556, 0.1711568385362625, -0.01648629456758499, 0.024100564420223236, 0.15709076821804047, 0.06516626477241516, -0.1896144151687622, 0.10280502587556839, 0.01612817868590355, 0.8037557601928711, -0.008760981261730194, -0.01702287048101425, 0.23367127776145935, -0.10723023861646652, 0.48512518405914307, 0.0032739005982875824, 0.3914981484413147, -0.08760742843151093, 0.0023093074560165405, -0.27265071868896484, -0.33118578791618347, -0.41825875639915466, -0.08900896459817886, 0.5825633406639099, 0.1650465428829193, -0.4720887541770935, 0.17330703139305115, 0.02531535178422928, -0.19940024614334106, 0.045911114662885666, -0.23570337891578674, -0.03258974105119705, -0.27653828263282776, -0.03787172585725784, 0.2790272533893585, 0.4737463891506195, 0.1085844412446022, 0.102411188185215, 0.025052282959222794, 0.008401617407798767, -0.006025480106472969, -0.04683999717235565, 0.1615464836359024, 0.18140682578086853, -0.3911893367767334, 0.169320210814476, 0.20390281081199646, 0.09970861673355103, 0.5534881949424744, 0.23927021026611328, 0.7231228947639465, -0.5313827395439148, 0.18609240651130676, -0.1320594996213913, 0.26912957429885864, 0.5005062818527222, 0.07869533449411392, 0.05168438330292702, -0.19290214776992798, 0.14615394175052643, 0.03930839151144028, -0.13435231149196625, 0.4368985593318939, -0.2619606554508209, -0.2757311165332794, 0.18261878192424774, 0.4483537971973419, -0.11962264776229858, 0.1134646087884903, 0.37076589465141296, -0.47908902168273926, -0.1311618983745575, 0.5909104943275452, 0.16320133209228516, 0.9231064915657043, 0.18735520541667938, -0.04408624395728111, 0.31043291091918945, -0.6668705344200134, 0.2799985110759735, -0.6335206627845764, 0.3520659804344177, -0.3372737169265747, 0.053203035145998, 0.0032735709100961685, -0.15270133316516876, 0.07647169381380081, 0.297349750995636, -0.12191370129585266, 0.18232034146785736, -0.25220590829849243, 0.07466531544923782, -0.008512765169143677, -0.10196161270141602, -0.22146745026111603, -0.13641001284122467, -0.5114125609397888, 0.051019087433815, -0.3271510601043701, -0.09242729842662811, -0.15249261260032654, -0.4227348566055298, 0.09111417829990387, -0.2660674452781677, -0.46857398748397827, 0.33210206031799316, -0.002366473898291588, -0.1111658364534378, 0.4556851387023926, -0.16294540464878082, -0.18535898625850677, -0.26752251386642456, -0.22943930327892303, -0.18394465744495392, 0.07558245211839676, 0.20424579083919525, -0.19197210669517517, -0.009709096513688564, 0.056117817759513855, 0.15669937431812286, 0.2605879306793213, -0.07313534617424011, -0.20319205522537231, 0.3462938666343689, -0.36175456643104553, -0.30932116508483887, -0.07736323028802872, 0.11957722902297974, -0.3637089729309082, 0.23011180758476257, -0.09782727062702179, -0.04913763701915741, -0.1342276781797409, 0.0189446322619915, 0.04089196026325226, -0.009817786514759064, -0.19844785332679749, -0.12042141705751419, -0.04605311527848244, -0.036634694784879684, -0.023060012608766556, 0.2529442310333252, -0.14060568809509277, 0.18031026422977448, 0.18894492089748383, 0.2254382222890854, -0.1178591176867485, -0.12254859507083893, -0.32209575176239014, 0.06316343694925308, -0.15663856267929077, 0.13232693076133728, -0.5286906957626343, -0.06657859683036804, 0.1384078562259674, 0.06094089895486832, 0.32766735553741455, -0.027262873947620392, -0.15701080858707428, -0.5140572786331177, 0.05114169418811798, -0.0030231326818466187, 0.07488812506198883, 0.06408193707466125, -0.06934528797864914, 0.34780633449554443, -0.09364053606987, -0.13880084455013275, -0.18573522567749023, 0.1688190996646881, -0.11697028577327728, 0.21077460050582886, -0.4917851984500885, -0.028253033757209778, 0.2220311462879181, 0.04289708659052849, -0.05060051381587982, 0.3804548978805542, 0.035209015011787415, 0.039697326719760895, -0.2687934637069702, 0.15745103359222412, 0.1722152829170227, 0.23584681749343872, -0.33502545952796936, -0.1945299208164215, -0.037279609590768814, -0.021188732236623764, 0.13949716091156006, -0.007756059989333153, 0.05372156947851181, 0.14344358444213867, 0.6160906553268433, 0.2319720983505249, 0.01792290434241295, 0.17727193236351013, 0.013237148523330688, 0.43517357110977173, -0.026361949741840363, 0.04396238923072815, -0.11481017619371414, 0.08942462503910065, -0.3741612434387207, -0.07965167611837387, -0.10649827122688293, 0.10764322429895401, 0.23206502199172974, -0.41843366622924805, 0.028435800224542618, -0.10806035995483398, 0.3406761586666107, 0.8475201725959778, -0.1909337192773819, -0.2885679304599762, 0.041805386543273926, 0.10045894235372543, 0.12503032386302948, -0.07028269022703171, 0.22271272540092468, 0.4534458816051483, -0.2942667007446289, 0.21131910383701324, 0.005613889545202255, -0.39273878931999207, -0.13076938688755035, 0.14464855194091797, 0.5682131052017212, -0.17217382788658142, 0.05700254440307617, 0.1704598367214203, -0.10250774025917053, 0.03962048888206482, 0.004870669916272163, -0.07237012684345245, 0.49794021248817444, -0.10832424461841583, -0.05568558722734451, -0.08009935915470123, 0.35908517241477966, -0.017640355974435806, -0.30935704708099365, -0.14496758580207825, -0.5492125749588013, 0.6763902902603149, 0.18569481372833252, 0.18329480290412903, 0.1265070140361786, 0.2589319348335266, 0.11720965057611465, -0.10783740878105164, -0.368559330701828, 0.015019332990050316, -0.21502089500427246, 0.15145574510097504, 0.1866971254348755, -0.13960200548171997, -0.2783185839653015, 0.18481096625328064, 0.11333008110523224, 0.3485478162765503, 0.14508603513240814, 0.29510819911956787, -0.06715530157089233, -0.460239440202713, -0.23480892181396484, 0.10592380911111832, 0.2759687006473541, -0.3590737581253052, 0.2809329628944397, 0.1427876353263855, -0.35150665044784546, 0.2021944522857666, -0.02125103957951069, 0.32491469383239746, 0.42859718203544617, -0.21501316130161285, -0.0005077468231320381, -0.13837218284606934, 0.05885295569896698, 0.09782716631889343, 0.24131055176258087, 0.20297646522521973, 0.028925560414791107, 0.34059852361679077, 0.10028251260519028, -0.08297238498926163, 0.30822229385375977, -0.013356108218431473, 0.2731994688510895, -0.199623242020607, 0.042398083955049515, -0.14756427705287933, 0.15375813841819763, -0.041529230773448944, -0.4076935946941376, -0.2352587878704071, -0.30639031529426575, 0.009035025723278522, -0.1687973439693451, -0.016874970868229866, 0.2185376137495041, 0.005476705729961395, -0.15044257044792175, 0.5013429522514343, 0.43888694047927856, -0.5666945576667786, -0.05324208736419678, -0.15473559498786926, -0.2818000912666321, 0.32385170459747314, -0.23802298307418823, 0.08928713202476501, 0.3593538999557495, 0.3160090446472168, -0.11307815462350845, 0.25571030378341675, 0.20042674243450165, 0.0038190102204680443, -0.5376740097999573, 0.5083566904067993, -0.5262646675109863, -0.03039279207587242, -0.054844267666339874, 0.13686439394950867, 0.11544455587863922, 0.012202497571706772, 0.2355571687221527, 0.09160502254962921, -0.02702759951353073, 0.09452903270721436, -0.24443212151527405, -0.20880179107189178, -0.36356106400489807, 0.3369070291519165, 0.009840689599514008, -0.07494911551475525, 0.15920954942703247, -0.21481969952583313, -0.2848833203315735, -0.3307192623615265, -0.026365522295236588, 0.11554358899593353, -0.14557301998138428, 0.5383402109146118, -0.029586311429739, 0.3757931888103485, -0.4464378356933594, 0.03607591986656189, -0.10142969340085983, -0.23152758181095123, -0.255508691072464, 0.10201922804117203, -0.003713451325893402, 0.2907176613807678, 0.133406400680542, 0.16073980927467346, 0.09411224722862244, 0.27178165316581726, -0.32129454612731934, -0.2652219235897064, 0.36098238825798035, -0.3994565010070801, -0.39809128642082214, 0.21667297184467316, 0.11018086224794388, -0.023769080638885498, 0.1671910583972931, -0.5742965936660767, 0.0893440917134285, 0.0638585090637207, -0.21147459745407104, -0.12039424479007721, -0.29854536056518555, 0.031448617577552795, -0.1686364710330963, 0.11707989871501923, -0.10127706825733185, 0.09503746032714844, -0.039002906531095505, 0.12893036007881165, -0.150892972946167 ]
https://github.com/huggingface/datasets/issues/5053
Intermittent JSON parse error when streaming the Pile
Ah, thanks! I did get errors like that. Sad that PR wasn't merged in! I'm currently just downloading 200GB of the Pile locally to avoid streaming (I have space and it's faster anyway), but that's really useful! I can probably apply the dumb patch of just commenting out the bits that raise the JSON Parse Error lol, based on your code - if I continue the loop should it be fine?
## Describe the bug I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash. This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it. I'm using a remote machine with 8 A6000 GPUs via runpod.io ## Expected results I have a DataLoader which can iterate through the whole Pile ## Actual results Stack trace: ``` Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0 ``` I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation ``` Traceback (most recent call last): File "ddp_script.py", line 1258, in <module> main() File "ddp_script.py", line 1143, in main for c, batch in tqdm.tqdm(enumerate(data_iter)): File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__ for obj in iterable: File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__ next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator) File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches broadcast_object_list(batch_info) File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list torch.distributed.broadcast_object_list(object_list, src=from_process) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list object_list[i] = _tensor_to_object(obj_view, obj_size) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object return _unpickler(io.BytesIO(buf)).load() _pickle.UnpicklingError: invalid load key, '@'. ``` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset( cfg["dataset_name"], streaming=True, split="train") dataset = dataset.remove_columns("meta") dataset = dataset.map(tokenize_and_concatenate, batched=True) dataset = dataset.with_format(type="torch") train_data_loader = DataLoader( dataset, batch_size=cfg["batch_size"], num_workers=3) for batch in train_data_loader: continue ``` `tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization: ``` import numpy as np import einops import torch def tokenize_and_concatenate(examples): texts = examples["text"] full_text = tokenizer.eos_token.join(texts) div = 20 length = len(full_text) // div text_list = [full_text[i * length: (i + 1) * length] for i in range(div)] tokens = tokenizer(text_list, return_tensors="np", padding=True)[ "input_ids" ].flatten() tokens = tokens[tokens != tokenizer.pad_token_id] n = len(tokens) curr_batch_size = n // (seq_len - 1) tokens = tokens[: (seq_len - 1) * curr_batch_size] tokens = einops.rearrange( tokens, "(batch_size seq) -> batch_size seq", batch_size=curr_batch_size, seq=seq_len - 1, ) prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \ tokenizer.bos_token_id return { "text": np.concatenate([prefix, tokens], axis=1) } ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid - Python version: 3.7.13 - PyArrow version: 9.0.0 - Pandas version: 1.3.5 ZStandard data: Version: 0.18.0 Summary: Zstandard bindings for Python Home-page: https://github.com/indygreg/python-zstandard Author: Gregory Szorc Author-email: gregory.szorc@gmail.com License: BSD Location: /opt/conda/lib/python3.7/site-packages Requires: Required-by:
71
Intermittent JSON parse error when streaming the Pile ## Describe the bug I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash. This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it. I'm using a remote machine with 8 A6000 GPUs via runpod.io ## Expected results I have a DataLoader which can iterate through the whole Pile ## Actual results Stack trace: ``` Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0 ``` I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation ``` Traceback (most recent call last): File "ddp_script.py", line 1258, in <module> main() File "ddp_script.py", line 1143, in main for c, batch in tqdm.tqdm(enumerate(data_iter)): File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__ for obj in iterable: File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__ next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator) File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches broadcast_object_list(batch_info) File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list torch.distributed.broadcast_object_list(object_list, src=from_process) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list object_list[i] = _tensor_to_object(obj_view, obj_size) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object return _unpickler(io.BytesIO(buf)).load() _pickle.UnpicklingError: invalid load key, '@'. ``` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset( cfg["dataset_name"], streaming=True, split="train") dataset = dataset.remove_columns("meta") dataset = dataset.map(tokenize_and_concatenate, batched=True) dataset = dataset.with_format(type="torch") train_data_loader = DataLoader( dataset, batch_size=cfg["batch_size"], num_workers=3) for batch in train_data_loader: continue ``` `tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization: ``` import numpy as np import einops import torch def tokenize_and_concatenate(examples): texts = examples["text"] full_text = tokenizer.eos_token.join(texts) div = 20 length = len(full_text) // div text_list = [full_text[i * length: (i + 1) * length] for i in range(div)] tokens = tokenizer(text_list, return_tensors="np", padding=True)[ "input_ids" ].flatten() tokens = tokens[tokens != tokenizer.pad_token_id] n = len(tokens) curr_batch_size = n // (seq_len - 1) tokens = tokens[: (seq_len - 1) * curr_batch_size] tokens = einops.rearrange( tokens, "(batch_size seq) -> batch_size seq", batch_size=curr_batch_size, seq=seq_len - 1, ) prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \ tokenizer.bos_token_id return { "text": np.concatenate([prefix, tokens], axis=1) } ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid - Python version: 3.7.13 - PyArrow version: 9.0.0 - Pandas version: 1.3.5 ZStandard data: Version: 0.18.0 Summary: Zstandard bindings for Python Home-page: https://github.com/indygreg/python-zstandard Author: Gregory Szorc Author-email: gregory.szorc@gmail.com License: BSD Location: /opt/conda/lib/python3.7/site-packages Requires: Required-by: Ah, thanks! I did get errors like that. Sad that PR wasn't merged in! I'm currently just downloading 200GB of the Pile locally to avoid streaming (I have space and it's faster anyway), but that's really useful! I can probably apply the dumb patch of just commenting out the bits that raise the JSON Parse Error lol, based on your code - if I continue the loop should it be fine?
[ -0.2561558187007904, 0.08614398539066315, 0.10274158418178558, 0.3511009216308594, 0.23096978664398193, -0.03777889907360077, 0.19184640049934387, 0.42057377099990845, -0.2875746488571167, 0.1298532783985138, 0.32849112153053284, 0.34214913845062256, 0.023091211915016174, -0.1828186810016632, -0.3692393898963928, -0.25744789838790894, 0.038922764360904694, 0.05399181321263313, 0.4175361394882202, 0.1883118897676468, -0.113750159740448, -0.0694500282406807, -0.21130125224590302, -0.04884730279445648, -0.08136585354804993, -0.26931115984916687, 0.08838589489459991, -0.0359443798661232, 0.17213894426822662, -0.4016888439655304, -0.033648453652858734, -0.18951702117919922, 0.1225176602602005, 0.43511566519737244, -0.00012148170208092779, 0.1110675185918808, 0.41098952293395996, -0.12862510979175568, -0.36584192514419556, -0.0014963001012802124, 0.12271950393915176, -0.013563637621700764, 0.02399587072432041, -0.2755300998687744, 0.023587800562381744, -0.33100324869155884, 0.04277389124035835, -0.0975939929485321, 0.5755047798156738, -0.04484032094478607, 0.09562548249959946, 0.3156019449234009, -0.07562600076198578, 0.07377219200134277, 0.09740452468395233, -0.18393804132938385, -0.08497781306505203, 0.42899948358535767, 0.23063482344150543, 0.16213971376419067, -0.268823504447937, 0.17358748614788055, 0.13886812329292297, -0.09518946707248688, -0.0029714852571487427, 0.18564008176326752, 0.356539249420166, -0.12998349964618683, -0.06376870721578598, 0.13410232961177826, 0.08853975683450699, -0.18771988153457642, -0.2374507486820221, -0.2689366638660431, -0.2383795529603958, -0.21212050318717957, 0.09057086706161499, 0.3751358985900879, -0.20708253979682922, 0.1962946057319641, 0.3669745922088623, 0.16919417679309845, -0.1562282294034958, 0.04277210310101509, 0.2387470006942749, 0.11793385446071625, 0.051976896822452545, 0.20751553773880005, 0.1217920184135437, -0.1718684881925583, 0.020211994647979736, -0.029305171221494675, -0.38364121317863464, -0.005618485622107983, -0.5126287937164307, -0.05946936458349228, -0.05029686540365219, -0.7193992733955383, -0.05941396206617355, -0.04866716265678406, 0.5387861728668213, 0.026705099269747734, 0.3007067143917084, 0.38549402356147766, 0.724206805229187, -0.056469544768333435, 0.20696601271629333, -0.2660492956638336, 0.10813078284263611, 0.22020521759986877, 0.23500698804855347, -0.11864029616117477, 0.06870495527982712, 0.10637744516134262, 0.1433265656232834, -0.14925509691238403, 0.07900420576334, -0.04469229280948639, -0.3453634977340698, 0.1697087436914444, -0.46740686893463135, 0.16509971022605896, 0.05496864765882492, 0.11877593398094177, 0.14187517762184143, 0.479332834482193, -0.0037923380732536316, 0.31587088108062744, 0.15601231157779694, -0.26464444398880005, -0.06747321784496307, 0.03942523151636124, -0.09333589673042297, -0.1006908044219017, -0.0006698593497276306, -0.10704948008060455, 0.06490360200405121, 0.033773574978113174, -0.11906945705413818, -0.565350353717804, -0.14607873558998108, -0.21696579456329346, -0.14654004573822021, 0.216521754860878, -0.020651385188102722, -0.015463419258594513, -0.09312665462493896, 0.20435212552547455, -0.1644517183303833, 0.23286360502243042, -0.0346800833940506, -0.15588001906871796, 0.0825602263212204, 0.11952795833349228, 0.08810415118932724, 0.15737250447273254, -0.2668241858482361, 0.13056407868862152, -0.17996296286582947, -0.20249183475971222, 0.08642783015966415, -0.19626793265342712, 0.289751261472702, -0.18685126304626465, -0.18926550447940826, 0.1485237032175064, -0.3757283091545105, -0.08034390211105347, 0.05624246597290039, 0.07491059601306915, 0.36628076434135437, 0.557062029838562, -0.332457035779953, -0.007757619023323059, 0.05727037042379379, 0.35333096981048584, 0.4497258961200714, -0.24799832701683044, -0.2387014925479889, 0.27323925495147705, -0.22702966630458832, 0.11516308039426804, -0.054262228310108185, 0.12382912635803223, 0.290979266166687, -0.20996825397014618, 0.17795538902282715, 0.426802396774292, -0.1053149551153183, 0.24018293619155884, -0.3648030161857605, -0.13888593018054962, 0.13037434220314026, 0.30443426966667175, -0.09839597344398499, -0.2405124008655548, 0.0825786143541336, 0.12608826160430908, 0.25044795870780945, -0.0629359781742096, 0.043864279985427856, 0.11909114569425583, 0.5551363229751587, -0.09020502865314484, 0.11300990730524063, 0.07291160523891449, -0.46848785877227783, 0.09649307280778885, 0.10243098437786102, -0.2694050669670105, -0.14995251595973969, -0.009576871991157532, 0.16747123003005981, 0.15981201827526093, 0.08069460839033127, 0.00022541731595993042, 0.08046918362379074, 0.028938036412000656, -0.08101983368396759, 0.0257243849337101, -0.3555496335029602, 0.15688453614711761, -0.2098114788532257, 0.1300904005765915, -0.21103666722774506, 0.24682582914829254, -0.004973826929926872, -0.4886092245578766, 0.10322177410125732, -0.09515557438135147, 0.20688647031784058, -0.32900866866111755, -0.03400404751300812, 0.4016558825969696, -0.04037997126579285, 0.1224832534790039, -0.08183764666318893, -0.05662095546722412, 0.38079679012298584, -0.12158876657485962, -0.03613338619470596, 0.36100953817367554, 0.1487177461385727, -0.24369794130325317, 0.1560877561569214, 0.1190158799290657, -0.053964968770742416, 0.14660871028900146, -0.09062852710485458, -0.12699013948440552, 0.2693760395050049, 0.004339385777711868, -0.0504210963845253, 0.15984198451042175, 0.31162258982658386, 0.17470195889472961, -0.18541210889816284, -0.20729990303516388, -0.5658314824104309, -0.05268227308988571, 0.2758288085460663, -0.13022565841674805, -0.004298277199268341, 0.27954572439193726, 0.04735463112592697, -0.002501619979739189, 0.04782838374376297, 0.009706918150186539, 0.17609834671020508, -0.05879088491201401, -0.06370283663272858, 0.15071676671504974, -0.1224810853600502, -0.05066230520606041, 0.10645091533660889, 0.22410494089126587, 0.1384776383638382, 0.34873899817466736, 0.5141457915306091, 0.18580690026283264, -0.24881088733673096, -0.48621147871017456, 0.17804931104183197, 0.2095343917608261, -0.10638531297445297, 0.20851850509643555, -0.2349678874015808, 0.06952948123216629, -0.30574968457221985, -0.17656125128269196, -0.1860896646976471, -0.15396654605865479, -0.033259354531764984, 0.48721179366111755, -0.4299772083759308, 0.07032869011163712, -0.045499783009290695, 0.5747166872024536, 0.11964084208011627, 0.051907796412706375, -0.32110166549682617, -0.3779347538948059, -0.4286295175552368, -0.12055656313896179, 0.07939587533473969, 0.021742012351751328, 0.12653161585330963, -0.01675516366958618, -0.1582944095134735, -0.0015080682933330536, -0.1326380968093872, 0.12263840436935425, 0.05238361656665802, 0.22278232872486115, -0.10587610304355621, 0.3791202902793884, 0.06660124659538269, -0.5029315948486328, 0.3532450199127197, -0.4742515981197357, -0.09131782501935959, 0.24588340520858765, 0.194252148270607, -0.1378716230392456, -0.1767071634531021, -0.09486103802919388, -0.11735077947378159, -0.3107854723930359, 0.3357887268066406, -0.4692120850086212, -0.017544865608215332, -0.09665898233652115, 0.10365893691778183, -0.03870590776205063, -0.06629707664251328, -0.2888754606246948, 0.032945238053798676, -0.15279759466648102, 0.12307736277580261, 0.11288201063871384, -0.20943790674209595, 0.025985341519117355, -0.005127895623445511, -0.09252394735813141, 0.33807486295700073, -0.38531506061553955, 0.07096368819475174, -0.09656482934951782, 0.10823549330234528, -0.3471495509147644, -0.18392068147659302, 0.038818199187517166, -0.14911091327667236, 0.11643284559249878, 0.04758722335100174, -0.29992932081222534, 0.27412402629852295, 0.5116568803787231, 0.4078819453716278, 0.24857905507087708, 0.7960271239280701, 0.25757962465286255, 0.49000728130340576, -0.08869284391403198, -0.26206326484680176, 0.19069239497184753, 0.05988959223031998, 0.08360641449689865, 0.12391474843025208, 0.19319292902946472, 0.23487462103366852, -0.1274941861629486, -0.6472883820533752, -0.03252546489238739, -0.2508366107940674, -0.4081689715385437, -0.24340564012527466, -0.05757296457886696, -0.22607174515724182, -0.2576170563697815, 0.1757056713104248, 0.0665280818939209, -0.048583678901195526, -0.17173993587493896, 0.11247066408395767, 0.16302801668643951, 0.010819675400853157, 0.16094690561294556, 0.1711568385362625, -0.01648629456758499, 0.024100564420223236, 0.15709076821804047, 0.06516626477241516, -0.1896144151687622, 0.10280502587556839, 0.01612817868590355, 0.8037557601928711, -0.008760981261730194, -0.01702287048101425, 0.23367127776145935, -0.10723023861646652, 0.48512518405914307, 0.0032739005982875824, 0.3914981484413147, -0.08760742843151093, 0.0023093074560165405, -0.27265071868896484, -0.33118578791618347, -0.41825875639915466, -0.08900896459817886, 0.5825633406639099, 0.1650465428829193, -0.4720887541770935, 0.17330703139305115, 0.02531535178422928, -0.19940024614334106, 0.045911114662885666, -0.23570337891578674, -0.03258974105119705, -0.27653828263282776, -0.03787172585725784, 0.2790272533893585, 0.4737463891506195, 0.1085844412446022, 0.102411188185215, 0.025052282959222794, 0.008401617407798767, -0.006025480106472969, -0.04683999717235565, 0.1615464836359024, 0.18140682578086853, -0.3911893367767334, 0.169320210814476, 0.20390281081199646, 0.09970861673355103, 0.5534881949424744, 0.23927021026611328, 0.7231228947639465, -0.5313827395439148, 0.18609240651130676, -0.1320594996213913, 0.26912957429885864, 0.5005062818527222, 0.07869533449411392, 0.05168438330292702, -0.19290214776992798, 0.14615394175052643, 0.03930839151144028, -0.13435231149196625, 0.4368985593318939, -0.2619606554508209, -0.2757311165332794, 0.18261878192424774, 0.4483537971973419, -0.11962264776229858, 0.1134646087884903, 0.37076589465141296, -0.47908902168273926, -0.1311618983745575, 0.5909104943275452, 0.16320133209228516, 0.9231064915657043, 0.18735520541667938, -0.04408624395728111, 0.31043291091918945, -0.6668705344200134, 0.2799985110759735, -0.6335206627845764, 0.3520659804344177, -0.3372737169265747, 0.053203035145998, 0.0032735709100961685, -0.15270133316516876, 0.07647169381380081, 0.297349750995636, -0.12191370129585266, 0.18232034146785736, -0.25220590829849243, 0.07466531544923782, -0.008512765169143677, -0.10196161270141602, -0.22146745026111603, -0.13641001284122467, -0.5114125609397888, 0.051019087433815, -0.3271510601043701, -0.09242729842662811, -0.15249261260032654, -0.4227348566055298, 0.09111417829990387, -0.2660674452781677, -0.46857398748397827, 0.33210206031799316, -0.002366473898291588, -0.1111658364534378, 0.4556851387023926, -0.16294540464878082, -0.18535898625850677, -0.26752251386642456, -0.22943930327892303, -0.18394465744495392, 0.07558245211839676, 0.20424579083919525, -0.19197210669517517, -0.009709096513688564, 0.056117817759513855, 0.15669937431812286, 0.2605879306793213, -0.07313534617424011, -0.20319205522537231, 0.3462938666343689, -0.36175456643104553, -0.30932116508483887, -0.07736323028802872, 0.11957722902297974, -0.3637089729309082, 0.23011180758476257, -0.09782727062702179, -0.04913763701915741, -0.1342276781797409, 0.0189446322619915, 0.04089196026325226, -0.009817786514759064, -0.19844785332679749, -0.12042141705751419, -0.04605311527848244, -0.036634694784879684, -0.023060012608766556, 0.2529442310333252, -0.14060568809509277, 0.18031026422977448, 0.18894492089748383, 0.2254382222890854, -0.1178591176867485, -0.12254859507083893, -0.32209575176239014, 0.06316343694925308, -0.15663856267929077, 0.13232693076133728, -0.5286906957626343, -0.06657859683036804, 0.1384078562259674, 0.06094089895486832, 0.32766735553741455, -0.027262873947620392, -0.15701080858707428, -0.5140572786331177, 0.05114169418811798, -0.0030231326818466187, 0.07488812506198883, 0.06408193707466125, -0.06934528797864914, 0.34780633449554443, -0.09364053606987, -0.13880084455013275, -0.18573522567749023, 0.1688190996646881, -0.11697028577327728, 0.21077460050582886, -0.4917851984500885, -0.028253033757209778, 0.2220311462879181, 0.04289708659052849, -0.05060051381587982, 0.3804548978805542, 0.035209015011787415, 0.039697326719760895, -0.2687934637069702, 0.15745103359222412, 0.1722152829170227, 0.23584681749343872, -0.33502545952796936, -0.1945299208164215, -0.037279609590768814, -0.021188732236623764, 0.13949716091156006, -0.007756059989333153, 0.05372156947851181, 0.14344358444213867, 0.6160906553268433, 0.2319720983505249, 0.01792290434241295, 0.17727193236351013, 0.013237148523330688, 0.43517357110977173, -0.026361949741840363, 0.04396238923072815, -0.11481017619371414, 0.08942462503910065, -0.3741612434387207, -0.07965167611837387, -0.10649827122688293, 0.10764322429895401, 0.23206502199172974, -0.41843366622924805, 0.028435800224542618, -0.10806035995483398, 0.3406761586666107, 0.8475201725959778, -0.1909337192773819, -0.2885679304599762, 0.041805386543273926, 0.10045894235372543, 0.12503032386302948, -0.07028269022703171, 0.22271272540092468, 0.4534458816051483, -0.2942667007446289, 0.21131910383701324, 0.005613889545202255, -0.39273878931999207, -0.13076938688755035, 0.14464855194091797, 0.5682131052017212, -0.17217382788658142, 0.05700254440307617, 0.1704598367214203, -0.10250774025917053, 0.03962048888206482, 0.004870669916272163, -0.07237012684345245, 0.49794021248817444, -0.10832424461841583, -0.05568558722734451, -0.08009935915470123, 0.35908517241477966, -0.017640355974435806, -0.30935704708099365, -0.14496758580207825, -0.5492125749588013, 0.6763902902603149, 0.18569481372833252, 0.18329480290412903, 0.1265070140361786, 0.2589319348335266, 0.11720965057611465, -0.10783740878105164, -0.368559330701828, 0.015019332990050316, -0.21502089500427246, 0.15145574510097504, 0.1866971254348755, -0.13960200548171997, -0.2783185839653015, 0.18481096625328064, 0.11333008110523224, 0.3485478162765503, 0.14508603513240814, 0.29510819911956787, -0.06715530157089233, -0.460239440202713, -0.23480892181396484, 0.10592380911111832, 0.2759687006473541, -0.3590737581253052, 0.2809329628944397, 0.1427876353263855, -0.35150665044784546, 0.2021944522857666, -0.02125103957951069, 0.32491469383239746, 0.42859718203544617, -0.21501316130161285, -0.0005077468231320381, -0.13837218284606934, 0.05885295569896698, 0.09782716631889343, 0.24131055176258087, 0.20297646522521973, 0.028925560414791107, 0.34059852361679077, 0.10028251260519028, -0.08297238498926163, 0.30822229385375977, -0.013356108218431473, 0.2731994688510895, -0.199623242020607, 0.042398083955049515, -0.14756427705287933, 0.15375813841819763, -0.041529230773448944, -0.4076935946941376, -0.2352587878704071, -0.30639031529426575, 0.009035025723278522, -0.1687973439693451, -0.016874970868229866, 0.2185376137495041, 0.005476705729961395, -0.15044257044792175, 0.5013429522514343, 0.43888694047927856, -0.5666945576667786, -0.05324208736419678, -0.15473559498786926, -0.2818000912666321, 0.32385170459747314, -0.23802298307418823, 0.08928713202476501, 0.3593538999557495, 0.3160090446472168, -0.11307815462350845, 0.25571030378341675, 0.20042674243450165, 0.0038190102204680443, -0.5376740097999573, 0.5083566904067993, -0.5262646675109863, -0.03039279207587242, -0.054844267666339874, 0.13686439394950867, 0.11544455587863922, 0.012202497571706772, 0.2355571687221527, 0.09160502254962921, -0.02702759951353073, 0.09452903270721436, -0.24443212151527405, -0.20880179107189178, -0.36356106400489807, 0.3369070291519165, 0.009840689599514008, -0.07494911551475525, 0.15920954942703247, -0.21481969952583313, -0.2848833203315735, -0.3307192623615265, -0.026365522295236588, 0.11554358899593353, -0.14557301998138428, 0.5383402109146118, -0.029586311429739, 0.3757931888103485, -0.4464378356933594, 0.03607591986656189, -0.10142969340085983, -0.23152758181095123, -0.255508691072464, 0.10201922804117203, -0.003713451325893402, 0.2907176613807678, 0.133406400680542, 0.16073980927467346, 0.09411224722862244, 0.27178165316581726, -0.32129454612731934, -0.2652219235897064, 0.36098238825798035, -0.3994565010070801, -0.39809128642082214, 0.21667297184467316, 0.11018086224794388, -0.023769080638885498, 0.1671910583972931, -0.5742965936660767, 0.0893440917134285, 0.0638585090637207, -0.21147459745407104, -0.12039424479007721, -0.29854536056518555, 0.031448617577552795, -0.1686364710330963, 0.11707989871501923, -0.10127706825733185, 0.09503746032714844, -0.039002906531095505, 0.12893036007881165, -0.150892972946167 ]
https://github.com/huggingface/datasets/issues/5053
Intermittent JSON parse error when streaming the Pile
Yup you can get some inspiration from this PR. It simply ignores the bad chunks (a chunk is ~a few MBs of data). We'll try to merge this PR soon
## Describe the bug I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash. This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it. I'm using a remote machine with 8 A6000 GPUs via runpod.io ## Expected results I have a DataLoader which can iterate through the whole Pile ## Actual results Stack trace: ``` Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0 ``` I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation ``` Traceback (most recent call last): File "ddp_script.py", line 1258, in <module> main() File "ddp_script.py", line 1143, in main for c, batch in tqdm.tqdm(enumerate(data_iter)): File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__ for obj in iterable: File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__ next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator) File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches broadcast_object_list(batch_info) File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list torch.distributed.broadcast_object_list(object_list, src=from_process) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list object_list[i] = _tensor_to_object(obj_view, obj_size) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object return _unpickler(io.BytesIO(buf)).load() _pickle.UnpicklingError: invalid load key, '@'. ``` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset( cfg["dataset_name"], streaming=True, split="train") dataset = dataset.remove_columns("meta") dataset = dataset.map(tokenize_and_concatenate, batched=True) dataset = dataset.with_format(type="torch") train_data_loader = DataLoader( dataset, batch_size=cfg["batch_size"], num_workers=3) for batch in train_data_loader: continue ``` `tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization: ``` import numpy as np import einops import torch def tokenize_and_concatenate(examples): texts = examples["text"] full_text = tokenizer.eos_token.join(texts) div = 20 length = len(full_text) // div text_list = [full_text[i * length: (i + 1) * length] for i in range(div)] tokens = tokenizer(text_list, return_tensors="np", padding=True)[ "input_ids" ].flatten() tokens = tokens[tokens != tokenizer.pad_token_id] n = len(tokens) curr_batch_size = n // (seq_len - 1) tokens = tokens[: (seq_len - 1) * curr_batch_size] tokens = einops.rearrange( tokens, "(batch_size seq) -> batch_size seq", batch_size=curr_batch_size, seq=seq_len - 1, ) prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \ tokenizer.bos_token_id return { "text": np.concatenate([prefix, tokens], axis=1) } ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid - Python version: 3.7.13 - PyArrow version: 9.0.0 - Pandas version: 1.3.5 ZStandard data: Version: 0.18.0 Summary: Zstandard bindings for Python Home-page: https://github.com/indygreg/python-zstandard Author: Gregory Szorc Author-email: gregory.szorc@gmail.com License: BSD Location: /opt/conda/lib/python3.7/site-packages Requires: Required-by:
30
Intermittent JSON parse error when streaming the Pile ## Describe the bug I have an intermittent error when streaming the Pile, where I get a JSON parse error which causes my program to crash. This is intermittent - when I rerun the program with the same random seed it does not crash in the same way. The exact point this happens also varied - it happened to me 11B tokens and 4 days into a training run, and now just happened 2 minutes into one, but I can't reliably reproduce it. I'm using a remote machine with 8 A6000 GPUs via runpod.io ## Expected results I have a DataLoader which can iterate through the whole Pile ## Actual results Stack trace: ``` Failed to read file 'zstd://12.jsonl::https://the-eye.eu/public/AI/pile/train/12.jsonl.zst' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Invalid value. in row 0 ``` I'm currently using HuggingFace accelerate, which also gave me the following stack trace, but I've also experienced this problem intermittently when using DataParallel, so I don't think it's to do with parallelisation ``` Traceback (most recent call last): File "ddp_script.py", line 1258, in <module> main() File "ddp_script.py", line 1143, in main for c, batch in tqdm.tqdm(enumerate(data_iter)): File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__ for obj in iterable: File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 503, in __iter__ next_batch, next_batch_info, next_skip = self._fetch_batches(main_iterator) File "/opt/conda/lib/python3.7/site-packages/accelerate/data_loader.py", line 454, in _fetch_batches broadcast_object_list(batch_info) File "/opt/conda/lib/python3.7/site-packages/accelerate/utils/operations.py", line 333, in broadcast_object_list torch.distributed.broadcast_object_list(object_list, src=from_process) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1900, in broadcast_object_list object_list[i] = _tensor_to_object(obj_view, obj_size) File "/opt/conda/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 1571, in _tensor_to_object return _unpickler(io.BytesIO(buf)).load() _pickle.UnpicklingError: invalid load key, '@'. ``` ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset( cfg["dataset_name"], streaming=True, split="train") dataset = dataset.remove_columns("meta") dataset = dataset.map(tokenize_and_concatenate, batched=True) dataset = dataset.with_format(type="torch") train_data_loader = DataLoader( dataset, batch_size=cfg["batch_size"], num_workers=3) for batch in train_data_loader: continue ``` `tokenize_and_concatenate` is a custom tokenization function I defined on the GPT-NeoX tokenizer to tokenize the text, separated by endoftext tokens, and reshape to have length batch_size, I don't think this is related to tokenization: ``` import numpy as np import einops import torch def tokenize_and_concatenate(examples): texts = examples["text"] full_text = tokenizer.eos_token.join(texts) div = 20 length = len(full_text) // div text_list = [full_text[i * length: (i + 1) * length] for i in range(div)] tokens = tokenizer(text_list, return_tensors="np", padding=True)[ "input_ids" ].flatten() tokens = tokens[tokens != tokenizer.pad_token_id] n = len(tokens) curr_batch_size = n // (seq_len - 1) tokens = tokens[: (seq_len - 1) * curr_batch_size] tokens = einops.rearrange( tokens, "(batch_size seq) -> batch_size seq", batch_size=curr_batch_size, seq=seq_len - 1, ) prefix = np.ones((curr_batch_size, 1), dtype=np.int64) * \ tokenizer.bos_token_id return { "text": np.concatenate([prefix, tokens], axis=1) } ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-5.4.0-105-generic-x86_64-with-debian-buster-sid - Python version: 3.7.13 - PyArrow version: 9.0.0 - Pandas version: 1.3.5 ZStandard data: Version: 0.18.0 Summary: Zstandard bindings for Python Home-page: https://github.com/indygreg/python-zstandard Author: Gregory Szorc Author-email: gregory.szorc@gmail.com License: BSD Location: /opt/conda/lib/python3.7/site-packages Requires: Required-by: Yup you can get some inspiration from this PR. It simply ignores the bad chunks (a chunk is ~a few MBs of data). We'll try to merge this PR soon
[ -0.2561558187007904, 0.08614398539066315, 0.10274158418178558, 0.3511009216308594, 0.23096978664398193, -0.03777889907360077, 0.19184640049934387, 0.42057377099990845, -0.2875746488571167, 0.1298532783985138, 0.32849112153053284, 0.34214913845062256, 0.023091211915016174, -0.1828186810016632, -0.3692393898963928, -0.25744789838790894, 0.038922764360904694, 0.05399181321263313, 0.4175361394882202, 0.1883118897676468, -0.113750159740448, -0.0694500282406807, -0.21130125224590302, -0.04884730279445648, -0.08136585354804993, -0.26931115984916687, 0.08838589489459991, -0.0359443798661232, 0.17213894426822662, -0.4016888439655304, -0.033648453652858734, -0.18951702117919922, 0.1225176602602005, 0.43511566519737244, -0.00012148170208092779, 0.1110675185918808, 0.41098952293395996, -0.12862510979175568, -0.36584192514419556, -0.0014963001012802124, 0.12271950393915176, -0.013563637621700764, 0.02399587072432041, -0.2755300998687744, 0.023587800562381744, -0.33100324869155884, 0.04277389124035835, -0.0975939929485321, 0.5755047798156738, -0.04484032094478607, 0.09562548249959946, 0.3156019449234009, -0.07562600076198578, 0.07377219200134277, 0.09740452468395233, -0.18393804132938385, -0.08497781306505203, 0.42899948358535767, 0.23063482344150543, 0.16213971376419067, -0.268823504447937, 0.17358748614788055, 0.13886812329292297, -0.09518946707248688, -0.0029714852571487427, 0.18564008176326752, 0.356539249420166, -0.12998349964618683, -0.06376870721578598, 0.13410232961177826, 0.08853975683450699, -0.18771988153457642, -0.2374507486820221, -0.2689366638660431, -0.2383795529603958, -0.21212050318717957, 0.09057086706161499, 0.3751358985900879, -0.20708253979682922, 0.1962946057319641, 0.3669745922088623, 0.16919417679309845, -0.1562282294034958, 0.04277210310101509, 0.2387470006942749, 0.11793385446071625, 0.051976896822452545, 0.20751553773880005, 0.1217920184135437, -0.1718684881925583, 0.020211994647979736, -0.029305171221494675, -0.38364121317863464, -0.005618485622107983, -0.5126287937164307, -0.05946936458349228, -0.05029686540365219, -0.7193992733955383, -0.05941396206617355, -0.04866716265678406, 0.5387861728668213, 0.026705099269747734, 0.3007067143917084, 0.38549402356147766, 0.724206805229187, -0.056469544768333435, 0.20696601271629333, -0.2660492956638336, 0.10813078284263611, 0.22020521759986877, 0.23500698804855347, -0.11864029616117477, 0.06870495527982712, 0.10637744516134262, 0.1433265656232834, -0.14925509691238403, 0.07900420576334, -0.04469229280948639, -0.3453634977340698, 0.1697087436914444, -0.46740686893463135, 0.16509971022605896, 0.05496864765882492, 0.11877593398094177, 0.14187517762184143, 0.479332834482193, -0.0037923380732536316, 0.31587088108062744, 0.15601231157779694, -0.26464444398880005, -0.06747321784496307, 0.03942523151636124, -0.09333589673042297, -0.1006908044219017, -0.0006698593497276306, -0.10704948008060455, 0.06490360200405121, 0.033773574978113174, -0.11906945705413818, -0.565350353717804, -0.14607873558998108, -0.21696579456329346, -0.14654004573822021, 0.216521754860878, -0.020651385188102722, -0.015463419258594513, -0.09312665462493896, 0.20435212552547455, -0.1644517183303833, 0.23286360502243042, -0.0346800833940506, -0.15588001906871796, 0.0825602263212204, 0.11952795833349228, 0.08810415118932724, 0.15737250447273254, -0.2668241858482361, 0.13056407868862152, -0.17996296286582947, -0.20249183475971222, 0.08642783015966415, -0.19626793265342712, 0.289751261472702, -0.18685126304626465, -0.18926550447940826, 0.1485237032175064, -0.3757283091545105, -0.08034390211105347, 0.05624246597290039, 0.07491059601306915, 0.36628076434135437, 0.557062029838562, -0.332457035779953, -0.007757619023323059, 0.05727037042379379, 0.35333096981048584, 0.4497258961200714, -0.24799832701683044, -0.2387014925479889, 0.27323925495147705, -0.22702966630458832, 0.11516308039426804, -0.054262228310108185, 0.12382912635803223, 0.290979266166687, -0.20996825397014618, 0.17795538902282715, 0.426802396774292, -0.1053149551153183, 0.24018293619155884, -0.3648030161857605, -0.13888593018054962, 0.13037434220314026, 0.30443426966667175, -0.09839597344398499, -0.2405124008655548, 0.0825786143541336, 0.12608826160430908, 0.25044795870780945, -0.0629359781742096, 0.043864279985427856, 0.11909114569425583, 0.5551363229751587, -0.09020502865314484, 0.11300990730524063, 0.07291160523891449, -0.46848785877227783, 0.09649307280778885, 0.10243098437786102, -0.2694050669670105, -0.14995251595973969, -0.009576871991157532, 0.16747123003005981, 0.15981201827526093, 0.08069460839033127, 0.00022541731595993042, 0.08046918362379074, 0.028938036412000656, -0.08101983368396759, 0.0257243849337101, -0.3555496335029602, 0.15688453614711761, -0.2098114788532257, 0.1300904005765915, -0.21103666722774506, 0.24682582914829254, -0.004973826929926872, -0.4886092245578766, 0.10322177410125732, -0.09515557438135147, 0.20688647031784058, -0.32900866866111755, -0.03400404751300812, 0.4016558825969696, -0.04037997126579285, 0.1224832534790039, -0.08183764666318893, -0.05662095546722412, 0.38079679012298584, -0.12158876657485962, -0.03613338619470596, 0.36100953817367554, 0.1487177461385727, -0.24369794130325317, 0.1560877561569214, 0.1190158799290657, -0.053964968770742416, 0.14660871028900146, -0.09062852710485458, -0.12699013948440552, 0.2693760395050049, 0.004339385777711868, -0.0504210963845253, 0.15984198451042175, 0.31162258982658386, 0.17470195889472961, -0.18541210889816284, -0.20729990303516388, -0.5658314824104309, -0.05268227308988571, 0.2758288085460663, -0.13022565841674805, -0.004298277199268341, 0.27954572439193726, 0.04735463112592697, -0.002501619979739189, 0.04782838374376297, 0.009706918150186539, 0.17609834671020508, -0.05879088491201401, -0.06370283663272858, 0.15071676671504974, -0.1224810853600502, -0.05066230520606041, 0.10645091533660889, 0.22410494089126587, 0.1384776383638382, 0.34873899817466736, 0.5141457915306091, 0.18580690026283264, -0.24881088733673096, -0.48621147871017456, 0.17804931104183197, 0.2095343917608261, -0.10638531297445297, 0.20851850509643555, -0.2349678874015808, 0.06952948123216629, -0.30574968457221985, -0.17656125128269196, -0.1860896646976471, -0.15396654605865479, -0.033259354531764984, 0.48721179366111755, -0.4299772083759308, 0.07032869011163712, -0.045499783009290695, 0.5747166872024536, 0.11964084208011627, 0.051907796412706375, -0.32110166549682617, -0.3779347538948059, -0.4286295175552368, -0.12055656313896179, 0.07939587533473969, 0.021742012351751328, 0.12653161585330963, -0.01675516366958618, -0.1582944095134735, -0.0015080682933330536, -0.1326380968093872, 0.12263840436935425, 0.05238361656665802, 0.22278232872486115, -0.10587610304355621, 0.3791202902793884, 0.06660124659538269, -0.5029315948486328, 0.3532450199127197, -0.4742515981197357, -0.09131782501935959, 0.24588340520858765, 0.194252148270607, -0.1378716230392456, -0.1767071634531021, -0.09486103802919388, -0.11735077947378159, -0.3107854723930359, 0.3357887268066406, -0.4692120850086212, -0.017544865608215332, -0.09665898233652115, 0.10365893691778183, -0.03870590776205063, -0.06629707664251328, -0.2888754606246948, 0.032945238053798676, -0.15279759466648102, 0.12307736277580261, 0.11288201063871384, -0.20943790674209595, 0.025985341519117355, -0.005127895623445511, -0.09252394735813141, 0.33807486295700073, -0.38531506061553955, 0.07096368819475174, -0.09656482934951782, 0.10823549330234528, -0.3471495509147644, -0.18392068147659302, 0.038818199187517166, -0.14911091327667236, 0.11643284559249878, 0.04758722335100174, -0.29992932081222534, 0.27412402629852295, 0.5116568803787231, 0.4078819453716278, 0.24857905507087708, 0.7960271239280701, 0.25757962465286255, 0.49000728130340576, -0.08869284391403198, -0.26206326484680176, 0.19069239497184753, 0.05988959223031998, 0.08360641449689865, 0.12391474843025208, 0.19319292902946472, 0.23487462103366852, -0.1274941861629486, -0.6472883820533752, -0.03252546489238739, -0.2508366107940674, -0.4081689715385437, -0.24340564012527466, -0.05757296457886696, -0.22607174515724182, -0.2576170563697815, 0.1757056713104248, 0.0665280818939209, -0.048583678901195526, -0.17173993587493896, 0.11247066408395767, 0.16302801668643951, 0.010819675400853157, 0.16094690561294556, 0.1711568385362625, -0.01648629456758499, 0.024100564420223236, 0.15709076821804047, 0.06516626477241516, -0.1896144151687622, 0.10280502587556839, 0.01612817868590355, 0.8037557601928711, -0.008760981261730194, -0.01702287048101425, 0.23367127776145935, -0.10723023861646652, 0.48512518405914307, 0.0032739005982875824, 0.3914981484413147, -0.08760742843151093, 0.0023093074560165405, -0.27265071868896484, -0.33118578791618347, -0.41825875639915466, -0.08900896459817886, 0.5825633406639099, 0.1650465428829193, -0.4720887541770935, 0.17330703139305115, 0.02531535178422928, -0.19940024614334106, 0.045911114662885666, -0.23570337891578674, -0.03258974105119705, -0.27653828263282776, -0.03787172585725784, 0.2790272533893585, 0.4737463891506195, 0.1085844412446022, 0.102411188185215, 0.025052282959222794, 0.008401617407798767, -0.006025480106472969, -0.04683999717235565, 0.1615464836359024, 0.18140682578086853, -0.3911893367767334, 0.169320210814476, 0.20390281081199646, 0.09970861673355103, 0.5534881949424744, 0.23927021026611328, 0.7231228947639465, -0.5313827395439148, 0.18609240651130676, -0.1320594996213913, 0.26912957429885864, 0.5005062818527222, 0.07869533449411392, 0.05168438330292702, -0.19290214776992798, 0.14615394175052643, 0.03930839151144028, -0.13435231149196625, 0.4368985593318939, -0.2619606554508209, -0.2757311165332794, 0.18261878192424774, 0.4483537971973419, -0.11962264776229858, 0.1134646087884903, 0.37076589465141296, -0.47908902168273926, -0.1311618983745575, 0.5909104943275452, 0.16320133209228516, 0.9231064915657043, 0.18735520541667938, -0.04408624395728111, 0.31043291091918945, -0.6668705344200134, 0.2799985110759735, -0.6335206627845764, 0.3520659804344177, -0.3372737169265747, 0.053203035145998, 0.0032735709100961685, -0.15270133316516876, 0.07647169381380081, 0.297349750995636, -0.12191370129585266, 0.18232034146785736, -0.25220590829849243, 0.07466531544923782, -0.008512765169143677, -0.10196161270141602, -0.22146745026111603, -0.13641001284122467, -0.5114125609397888, 0.051019087433815, -0.3271510601043701, -0.09242729842662811, -0.15249261260032654, -0.4227348566055298, 0.09111417829990387, -0.2660674452781677, -0.46857398748397827, 0.33210206031799316, -0.002366473898291588, -0.1111658364534378, 0.4556851387023926, -0.16294540464878082, -0.18535898625850677, -0.26752251386642456, -0.22943930327892303, -0.18394465744495392, 0.07558245211839676, 0.20424579083919525, -0.19197210669517517, -0.009709096513688564, 0.056117817759513855, 0.15669937431812286, 0.2605879306793213, -0.07313534617424011, -0.20319205522537231, 0.3462938666343689, -0.36175456643104553, -0.30932116508483887, -0.07736323028802872, 0.11957722902297974, -0.3637089729309082, 0.23011180758476257, -0.09782727062702179, -0.04913763701915741, -0.1342276781797409, 0.0189446322619915, 0.04089196026325226, -0.009817786514759064, -0.19844785332679749, -0.12042141705751419, -0.04605311527848244, -0.036634694784879684, -0.023060012608766556, 0.2529442310333252, -0.14060568809509277, 0.18031026422977448, 0.18894492089748383, 0.2254382222890854, -0.1178591176867485, -0.12254859507083893, -0.32209575176239014, 0.06316343694925308, -0.15663856267929077, 0.13232693076133728, -0.5286906957626343, -0.06657859683036804, 0.1384078562259674, 0.06094089895486832, 0.32766735553741455, -0.027262873947620392, -0.15701080858707428, -0.5140572786331177, 0.05114169418811798, -0.0030231326818466187, 0.07488812506198883, 0.06408193707466125, -0.06934528797864914, 0.34780633449554443, -0.09364053606987, -0.13880084455013275, -0.18573522567749023, 0.1688190996646881, -0.11697028577327728, 0.21077460050582886, -0.4917851984500885, -0.028253033757209778, 0.2220311462879181, 0.04289708659052849, -0.05060051381587982, 0.3804548978805542, 0.035209015011787415, 0.039697326719760895, -0.2687934637069702, 0.15745103359222412, 0.1722152829170227, 0.23584681749343872, -0.33502545952796936, -0.1945299208164215, -0.037279609590768814, -0.021188732236623764, 0.13949716091156006, -0.007756059989333153, 0.05372156947851181, 0.14344358444213867, 0.6160906553268433, 0.2319720983505249, 0.01792290434241295, 0.17727193236351013, 0.013237148523330688, 0.43517357110977173, -0.026361949741840363, 0.04396238923072815, -0.11481017619371414, 0.08942462503910065, -0.3741612434387207, -0.07965167611837387, -0.10649827122688293, 0.10764322429895401, 0.23206502199172974, -0.41843366622924805, 0.028435800224542618, -0.10806035995483398, 0.3406761586666107, 0.8475201725959778, -0.1909337192773819, -0.2885679304599762, 0.041805386543273926, 0.10045894235372543, 0.12503032386302948, -0.07028269022703171, 0.22271272540092468, 0.4534458816051483, -0.2942667007446289, 0.21131910383701324, 0.005613889545202255, -0.39273878931999207, -0.13076938688755035, 0.14464855194091797, 0.5682131052017212, -0.17217382788658142, 0.05700254440307617, 0.1704598367214203, -0.10250774025917053, 0.03962048888206482, 0.004870669916272163, -0.07237012684345245, 0.49794021248817444, -0.10832424461841583, -0.05568558722734451, -0.08009935915470123, 0.35908517241477966, -0.017640355974435806, -0.30935704708099365, -0.14496758580207825, -0.5492125749588013, 0.6763902902603149, 0.18569481372833252, 0.18329480290412903, 0.1265070140361786, 0.2589319348335266, 0.11720965057611465, -0.10783740878105164, -0.368559330701828, 0.015019332990050316, -0.21502089500427246, 0.15145574510097504, 0.1866971254348755, -0.13960200548171997, -0.2783185839653015, 0.18481096625328064, 0.11333008110523224, 0.3485478162765503, 0.14508603513240814, 0.29510819911956787, -0.06715530157089233, -0.460239440202713, -0.23480892181396484, 0.10592380911111832, 0.2759687006473541, -0.3590737581253052, 0.2809329628944397, 0.1427876353263855, -0.35150665044784546, 0.2021944522857666, -0.02125103957951069, 0.32491469383239746, 0.42859718203544617, -0.21501316130161285, -0.0005077468231320381, -0.13837218284606934, 0.05885295569896698, 0.09782716631889343, 0.24131055176258087, 0.20297646522521973, 0.028925560414791107, 0.34059852361679077, 0.10028251260519028, -0.08297238498926163, 0.30822229385375977, -0.013356108218431473, 0.2731994688510895, -0.199623242020607, 0.042398083955049515, -0.14756427705287933, 0.15375813841819763, -0.041529230773448944, -0.4076935946941376, -0.2352587878704071, -0.30639031529426575, 0.009035025723278522, -0.1687973439693451, -0.016874970868229866, 0.2185376137495041, 0.005476705729961395, -0.15044257044792175, 0.5013429522514343, 0.43888694047927856, -0.5666945576667786, -0.05324208736419678, -0.15473559498786926, -0.2818000912666321, 0.32385170459747314, -0.23802298307418823, 0.08928713202476501, 0.3593538999557495, 0.3160090446472168, -0.11307815462350845, 0.25571030378341675, 0.20042674243450165, 0.0038190102204680443, -0.5376740097999573, 0.5083566904067993, -0.5262646675109863, -0.03039279207587242, -0.054844267666339874, 0.13686439394950867, 0.11544455587863922, 0.012202497571706772, 0.2355571687221527, 0.09160502254962921, -0.02702759951353073, 0.09452903270721436, -0.24443212151527405, -0.20880179107189178, -0.36356106400489807, 0.3369070291519165, 0.009840689599514008, -0.07494911551475525, 0.15920954942703247, -0.21481969952583313, -0.2848833203315735, -0.3307192623615265, -0.026365522295236588, 0.11554358899593353, -0.14557301998138428, 0.5383402109146118, -0.029586311429739, 0.3757931888103485, -0.4464378356933594, 0.03607591986656189, -0.10142969340085983, -0.23152758181095123, -0.255508691072464, 0.10201922804117203, -0.003713451325893402, 0.2907176613807678, 0.133406400680542, 0.16073980927467346, 0.09411224722862244, 0.27178165316581726, -0.32129454612731934, -0.2652219235897064, 0.36098238825798035, -0.3994565010070801, -0.39809128642082214, 0.21667297184467316, 0.11018086224794388, -0.023769080638885498, 0.1671910583972931, -0.5742965936660767, 0.0893440917134285, 0.0638585090637207, -0.21147459745407104, -0.12039424479007721, -0.29854536056518555, 0.031448617577552795, -0.1686364710330963, 0.11707989871501923, -0.10127706825733185, 0.09503746032714844, -0.039002906531095505, 0.12893036007881165, -0.150892972946167 ]
https://github.com/huggingface/datasets/issues/5046
Audiofolder creates empty Dataset if files same level as metadata
Hi! Unfortunately, I can't reproduce this behavior. Instead, I get `ValueError: audio at 2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav doesn't have metadata in /audio-data/metadata.csv`, which can be fixed by removing the `./` from the file name. (Link to a Colab that tries to reproduce this behavior: https://colab.research.google.com/drive/1IhQzULYi0Van1xLrN_SddBX1JF7mLZZK?usp=sharing)
## Describe the bug When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns. https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88 ## Steps to reproduce the bug `metadata.csv`: ```csv file_name,duration,transcription ./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello ``` ```python >>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/") >>> audio_dataset DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` I've tried, with no success,: - setting `split` to something else so I don't get a `DatasetDict`, - removing the `./`, - using `.jsonl`. ## Expected results ``` Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 1 }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` ## Environment info - `datasets` version: 2.5.1 - Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
42
Audiofolder creates empty Dataset if files same level as metadata ## Describe the bug When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns. https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88 ## Steps to reproduce the bug `metadata.csv`: ```csv file_name,duration,transcription ./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello ``` ```python >>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/") >>> audio_dataset DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` I've tried, with no success,: - setting `split` to something else so I don't get a `DatasetDict`, - removing the `./`, - using `.jsonl`. ## Expected results ``` Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 1 }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` ## Environment info - `datasets` version: 2.5.1 - Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 Hi! Unfortunately, I can't reproduce this behavior. Instead, I get `ValueError: audio at 2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav doesn't have metadata in /audio-data/metadata.csv`, which can be fixed by removing the `./` from the file name. (Link to a Colab that tries to reproduce this behavior: https://colab.research.google.com/drive/1IhQzULYi0Van1xLrN_SddBX1JF7mLZZK?usp=sharing)
[ -0.04184511676430702, 0.18840721249580383, -0.0120816919952631, 0.5899380445480347, 0.19426529109477997, 0.05188984423875809, 0.3689001202583313, 0.2723320424556732, 0.009522948414087296, 0.28956693410873413, -0.08250927925109863, 0.33010607957839966, -0.4205990731716156, 0.1189064010977745, -0.1743796169757843, -0.04421093314886093, -0.105026014149189, 0.27093908190727234, -0.20948120951652527, -0.2220722883939743, -0.32904377579689026, 0.0993759036064148, -0.3726891875267029, -0.21719549596309662, -0.27974236011505127, 0.12135381996631622, 0.009036390110850334, 0.27739813923835754, -0.3133001923561096, -0.18832914531230927, 0.2564588785171509, -0.1165282130241394, 0.0020182766020298004, 0.6328850388526917, -0.0001168588423752226, 0.00758834183216095, 0.3566819429397583, -0.2432050108909607, -0.21852931380271912, -0.5194230079650879, -0.47880521416664124, 0.08653274178504944, -0.25727975368499756, -0.017112471163272858, -0.050987932831048965, -0.23994652926921844, -0.2576325833797455, -0.35994768142700195, 0.0435296967625618, 0.19968830049037933, 0.12817317247390747, 0.043911922723054886, 0.07383131980895996, 0.25074300169944763, 0.26681551337242126, 0.20708025991916656, -0.0893518254160881, 0.33068016171455383, 0.054549261927604675, 0.00826697051525116, 0.10012512654066086, 0.21003374457359314, -0.13792046904563904, 0.006079183891415596, 0.23729529976844788, 0.2345905900001526, -0.1884939968585968, -0.30956190824508667, 0.13442648947238922, 0.33056899905204773, 0.6613385081291199, -0.309682160615921, -0.4042522609233856, -0.30500271916389465, 0.015136373229324818, -0.3553973138332367, 0.236525297164917, 0.4609679579734802, -0.03980531170964241, 0.1184728741645813, -0.05899729207158089, 0.31618744134902954, -0.1929490864276886, 0.0357074998319149, -0.0023949071764945984, 0.30458950996398926, -0.01098520029336214, -0.08895643800497055, 0.24243102967739105, -0.06637390702962875, 0.11261195689439774, -0.33865201473236084, -0.17135308682918549, 0.39608851075172424, -0.5739942193031311, -0.28999340534210205, 0.1674284189939499, -0.17232415080070496, 0.20174524188041687, 0.010892502963542938, 0.06519276648759842, -0.08864667266607285, -0.3894643783569336, 0.17220550775527954, 0.44987058639526367, 0.0627528727054596, 0.2679443657398224, 0.19535022974014282, 0.11837392300367355, -0.000898654805496335, 0.2792646884918213, -0.01062062382698059, -0.17895792424678802, 0.11634528636932373, 0.06876273453235626, 0.15117952227592468, 0.4965669512748718, -0.2557803690433502, -0.4179885685443878, 0.2892879545688629, -0.49770957231521606, -0.040668562054634094, -0.050589825958013535, 0.1627403199672699, 0.17624178528785706, 0.2524886727333069, -0.03883465379476547, 0.27742964029312134, 0.017205363139510155, 0.16540977358818054, -0.042042553424835205, 0.01497877947986126, 0.019985947757959366, -0.04754263162612915, 0.3953097462654114, 0.007417070679366589, 0.3780185580253601, 0.2746703624725342, -0.29109644889831543, -0.3326309025287628, 0.17760339379310608, -0.16180942952632904, -0.10720793157815933, 0.17466364800930023, 0.1856362670660019, 0.21825572848320007, -0.1122206598520279, -0.06014341115951538, -0.17848676443099976, 0.2663354277610779, -0.3470289409160614, -0.03858315199613571, 0.10594844818115234, 0.1671217978000641, -0.338922917842865, 0.3282851278781891, -0.5273737907409668, -0.09745721518993378, -0.13018104434013367, -0.09604403376579285, 0.12668906152248383, -0.16633328795433044, -0.26556622982025146, -0.044424328953027725, 0.17983131110668182, 0.34903788566589355, -0.5758572220802307, 0.008965089917182922, 0.1834244728088379, 0.09002883732318878, 0.05933719873428345, 0.11741836369037628, 0.1074347123503685, 0.2667917013168335, -0.3692564070224762, 0.18270288407802582, 0.14924684166908264, -0.35647788643836975, -0.2759946882724762, 0.03984628990292549, -0.11773459613323212, 0.37566691637039185, 0.14470860362052917, -0.10784664005041122, 0.1312914490699768, -0.0957324206829071, 0.27002936601638794, 0.1599854826927185, 0.019204510375857353, 0.1285199671983719, -0.12341520190238953, -0.14265252649784088, 0.04505150392651558, 0.03718749061226845, -0.24043892323970795, 0.044827062636613846, -0.008300736546516418, 0.03960573300719261, 0.38922175765037537, -0.24702605605125427, 0.16843397915363312, 0.30431121587753296, 0.46268925070762634, -0.02385425567626953, 0.005298606585711241, -0.31980228424072266, -0.40188801288604736, 0.17394202947616577, 0.3070582449436188, 0.3131365180015564, -0.0669480413198471, -0.24438613653182983, -0.19638296961784363, -0.18551844358444214, -0.48747339844703674, -0.2858995199203491, 0.03869662433862686, 0.18433406949043274, 0.007122080773115158, -0.061775367707014084, -0.33970212936401367, -0.03717675805091858, -0.0814654678106308, 0.051856279373168945, -0.7035751938819885, 0.36170610785484314, 0.16508471965789795, 0.03439068794250488, 0.34485000371932983, 0.34709179401397705, 0.13241755962371826, -0.08951529860496521, 0.025690224021673203, 0.2543489634990692, 0.3738356828689575, 0.012185700237751007, -0.2723625898361206, 0.43832921981811523, 0.07080259919166565, -0.08907771855592728, -0.051766298711299896, 0.12276031076908112, 0.3710210621356964, 0.05701500177383423, -0.40677550435066223, 0.4836602210998535, -0.020536862313747406, 0.3586310148239136, 0.04887284338474274, -0.24354028701782227, 0.142591193318367, -0.01791299879550934, -0.1742766946554184, -0.17950478196144104, -0.04656233265995979, -0.05950819328427315, 0.34604713320732117, 0.24186676740646362, -0.0815737396478653, -0.0333089604973793, 0.4678483009338379, -0.22817133367061615, 0.07583421468734741, -0.04049696773290634, -0.24782535433769226, 0.08992499858140945, -0.07616987079381943, 0.35708969831466675, 0.43391740322113037, 0.22100959718227386, 0.009102713316679, 0.14612095057964325, 0.08740946650505066, -0.1459542065858841, 0.21725274622440338, 0.015839189291000366, -0.06533105671405792, 0.642471194267273, -0.043512385338544846, -0.021432198584079742, -0.4071342349052429, -0.20896266400814056, -0.1611633449792862, 0.3905290365219116, -0.37994828820228577, -0.1018538847565651, -0.36696964502334595, 0.03980462998151779, -0.28018805384635925, -0.3773574233055115, -0.16527841985225677, -0.0011745793744921684, -0.14258748292922974, 0.545098066329956, -0.2912302017211914, 0.11684538424015045, -0.325611412525177, 0.23001742362976074, 0.401265949010849, -0.166341170668602, -0.0033487677574157715, 0.14944599568843842, -0.0867287665605545, 0.05442341789603233, 0.2748137414455414, 0.07684803009033203, -0.0038394127041101456, -0.14648419618606567, -0.104662224650383, -0.17326530814170837, -0.1001305878162384, 0.15175804495811462, -0.145341157913208, 0.2307228147983551, 0.10512127727270126, 0.21395346522331238, 0.41461604833602905, -0.3306328058242798, 0.05101598799228668, 0.1733824461698532, -0.269795686006546, 0.10601401329040527, 0.2590559422969818, 0.14576761424541473, -0.32222485542297363, -0.4701942503452301, 0.04937146231532097, -0.44652143120765686, 0.16732606291770935, -0.13777713477611542, 0.2336706817150116, 0.2034006267786026, -0.015738271176815033, 0.032065507024526596, -0.04839443787932396, 0.025917261838912964, -0.10728693753480911, -0.26729995012283325, 0.4132111668586731, 0.03862656652927399, -0.26793766021728516, -0.0988464504480362, -0.27365031838417053, 0.24569158256053925, 0.08889555931091309, -0.25012409687042236, -0.14885690808296204, 0.0010458659380674362, -0.1310436874628067, -0.06174040585756302, 0.09010068327188492, 0.2636726498603821, 0.27632564306259155, 0.04508453607559204, -0.2856703996658325, -0.14012755453586578, -0.10319054871797562, -0.03285929560661316, 0.19192320108413696, -0.016610722988843918, 0.4644133746623993, -0.13692161440849304, 0.33465147018432617, 0.10615292191505432, 0.07621032744646072, 0.13713517785072327, -0.18150201439857483, 0.50281822681427, -0.21485650539398193, -0.13234059512615204, -0.01300415862351656, 0.17676271498203278, -0.12921030819416046, 0.337626188993454, 0.20133045315742493, 0.19214779138565063, -0.020364968106150627, 0.025132976472377777, -0.29704001545906067, -0.1873016059398651, 0.14214816689491272, -0.23080143332481384, 0.1747472584247589, 0.07385596632957458, 0.3550533950328827, 0.2819344103336334, -0.041563816368579865, -0.02697068080306053, 0.371410608291626, 0.22414630651474, -0.053251344710588455, -0.49812111258506775, -0.022502752020955086, -0.129853755235672, -0.030016973614692688, 0.12010438740253448, 0.6720412373542786, 0.06024450436234474, -0.15611115097999573, -0.208405539393425, -0.00832875445485115, 0.6891217231750488, -0.026710765436291695, 0.43856483697891235, -0.10563351213932037, 0.25454187393188477, -0.183514803647995, -0.07842554152011871, -0.4079679250717163, -0.061301685869693756, -0.10539057850837708, 0.6149431467056274, -0.1611155867576599, -0.048961326479911804, -0.005577273666858673, 0.209132120013237, 0.009037330746650696, -0.1667245477437973, -0.29603490233421326, -0.04027638956904411, -0.125721737742424, -0.000350169837474823, -0.008696252480149269, 0.19243136048316956, -0.25278130173683167, -0.14299559593200684, 0.18388332426548004, -0.35705262422561646, 0.3607282042503357, 0.19986754655838013, 0.5285165309906006, 0.022669930011034012, 0.2883107364177704, 0.137292742729187, -0.17202411592006683, 0.5076037049293518, 0.6007961630821228, -0.0028727464377880096, -0.19607090950012207, 0.352428674697876, -0.2829144299030304, 0.21083354949951172, 0.1506110280752182, -0.03462129086256027, 0.1292254477739334, -0.07855160534381866, -0.023607127368450165, -0.477456659078598, 0.04222235828638077, 0.32028359174728394, 0.17770710587501526, -0.17636260390281677, -0.518925130367279, 0.3443337082862854, 0.05311226472258568, 0.021006375551223755, 0.35411956906318665, 0.38221168518066406, -0.3397715985774994, 0.31419676542282104, -0.35557448863983154, 0.5377671718597412, 0.5448538064956665, 0.13581405580043793, 0.4645295739173889, -0.22848409414291382, 0.1540498435497284, -0.2621113657951355, 0.17077919840812683, -0.1888175755739212, -0.20412160456180573, -0.16517838835716248, -0.09309627115726471, -0.03807516396045685, 0.30617570877075195, 0.02037801966071129, 0.417174756526947, 0.10786010324954987, 0.0071676671504974365, 0.1137307658791542, 0.053798556327819824, -0.15108931064605713, -0.013330675661563873, -0.4142380952835083, 0.03302672505378723, 0.005478847771883011, 0.24118301272392273, 0.04495910555124283, 0.0249912329018116, -0.2784208059310913, -0.490683376789093, -0.19126197695732117, 0.16174614429473877, 0.0422564297914505, -0.19719411432743073, 0.1750241219997406, -0.1459074318408966, 0.18127748370170593, -0.2773919999599457, -0.24048446118831635, 0.4110356569290161, -0.1756678819656372, -0.01154833659529686, 0.06354295462369919, 0.5188695788383484, 0.006723820697516203, -0.012303298339247704, 0.11925790458917618, 0.13572433590888977, -0.10491900891065598, -0.11523037403821945, -0.14918135106563568, -0.11138729006052017, -0.013617590069770813, -0.012655772268772125, -0.10642130672931671, -0.2051699161529541, -0.3258900046348572, -0.02659992128610611, 0.22163009643554688, -0.1558285802602768, 0.1252518594264984, -0.05394497513771057, -0.30500730872154236, -0.05144355446100235, 0.10306140780448914, -0.2767863869667053, -0.007699955254793167, 0.33965399861335754, 0.1120588406920433, 0.08792749047279358, 0.55497145652771, -0.13448430597782135, 0.10948042571544647, -0.14912721514701843, 0.31280672550201416, 0.32513001561164856, -0.1761661171913147, 0.052658069878816605, 0.04344173148274422, -0.10144615173339844, 0.05222053825855255, -0.06602086126804352, 0.10818558931350708, -0.011686146259307861, -0.10104434192180634, -0.5861691236495972, -0.035433992743492126, 0.41530656814575195, -0.009332668036222458, 0.2625746428966522, -0.12865395843982697, 0.032628752291202545, -0.09522760659456253, -0.17173656821250916, -0.2321583330631256, -0.03328271955251694, -0.033243775367736816, 0.32938525080680847, 0.39702117443084717, -0.053376637399196625, 0.09715793281793594, -0.28871357440948486, 0.10586206614971161, -0.12242414057254791, -0.2163468450307846, -0.12375348806381226, -0.2789045572280884, 0.16058191657066345, 0.10484296828508377, 0.335262656211853, -0.029808949679136276, -0.07794132828712463, -0.1967347413301468, -0.21062368154525757, 0.09127569198608398, 0.02561534196138382, -0.041187599301338196, 0.28438350558280945, 0.08898419886827469, 0.009655926376581192, -0.2501908540725708, 0.104953333735466, -0.15218451619148254, -0.23587416112422943, 0.14714643359184265, 0.1252099871635437, -0.23456132411956787, 0.14312885701656342, -0.22509080171585083, 0.09632930159568787, -0.11494764685630798, -0.036376163363456726, 0.3153282701969147, -0.19089363515377045, 0.18797878921031952, 0.10177789628505707, 0.3987952768802643, 0.42596134543418884, -0.14499200880527496, -0.14142513275146484, 0.06774885952472687, 0.20376411080360413, -0.2533935308456421, 0.021831750869750977, -0.06758145987987518, -0.0037896689027547836, 0.1991390585899353, 0.22445663809776306, -0.14853830635547638, -0.30564987659454346, -0.03378049284219742, 0.019064240157604218, 0.4407491683959961, -0.07984313368797302, 0.3118149936199188, 0.4679664969444275, -0.2639157474040985, 0.1264704465866089, 0.19694004952907562, -0.31158527731895447, 0.050840605050325394, 0.6134163737297058, 0.15626029670238495, 0.22526855766773224, 0.1815490424633026, -0.2332797348499298, -0.12224411219358444, -0.3195420801639557, -0.4742017984390259, 0.19579145312309265, 0.007089845836162567, 0.19923940300941467, 0.1363234668970108, -0.003089398145675659, -0.180426687002182, -0.18083199858665466, 0.10671719163656235, -0.2946268618106842, -0.10310334712266922, -0.02956097573041916, -0.24426867067813873, -0.32921093702316284, -0.0793602243065834, -0.0020168907940387726, 0.04911172762513161, -0.09304127097129822, -0.10505764186382294, -0.14516565203666687, -0.2595604658126831, -0.23252999782562256, -0.1701284945011139, 0.5325813293457031, 0.06662863492965698, -0.2011861354112625, 0.5179359316825867, 0.30568915605545044, -0.022222444415092468, 0.25445348024368286, 0.305105596780777, 0.39823123812675476, 0.3389618396759033, 0.347216933965683, -0.06599445641040802, -0.07227927446365356, -0.11457746475934982, 0.0019513443112373352, 0.32206282019615173, -0.08219733834266663, -0.06533345580101013, 0.02527359500527382, 0.1677696704864502, -0.1258406639099121, 0.1478562206029892, 0.1018502414226532, -0.03299393504858017, -0.49097201228141785, 0.33755573630332947, -0.1320507526397705, -0.08399511873722076, -0.1151997298002243, -0.09583302587270737, -0.49259325861930847, -0.2770296633243561, 0.2347699999809265, 0.34944382309913635, 0.17432209849357605, 0.03473913297057152, 0.0566285103559494, -0.13751953840255737, 0.11680233478546143, 0.3675087094306946, -0.13686230778694153, -0.048049286007881165, -0.024810709059238434, -0.8919185400009155, 0.03462681919336319, -0.15916229784488678, -0.059510163962841034, -0.12980526685714722, 0.028371190652251244, 0.27292826771736145, 0.13375374674797058, -0.024670541286468506, 0.4044521450996399, -0.20374056696891785, -0.09110388159751892, -0.5500498414039612, -0.23242883384227753, -0.16539691388607025, 0.09662798047065735, -0.2515075206756592, -0.6229763627052307, 0.004068750888109207, -0.037526246160268784, -0.04784519225358963, 0.25658902525901794, 0.19566112756729126, -0.3368351459503174, 0.28684157133102417, 0.06253160536289215, 0.1921064257621765, 0.41246068477630615, -0.20461136102676392, -0.03309733420610428, -0.5476499795913696, 0.08181305229663849, -0.1000603437423706, 0.08077395707368851, 0.2464301735162735, 0.5594117641448975, -0.10855048894882202, -0.20194821059703827, -0.19792912900447845, 0.07431183010339737, -0.016435010358691216, -0.1821136772632599, -0.4922492206096649, 0.42348983883857727, -0.3225325644016266, 0.1464705914258957, -0.1771354228258133, 0.031225943937897682, 0.0033221207559108734, -0.0296894870698452, -0.2798101305961609, -0.3282169997692108, 0.4339722990989685, -0.320294052362442, -0.37445253133773804, -0.05570235103368759, 0.3338279128074646, 0.11931617558002472, -0.20194315910339355, -0.42120009660720825, 0.2521117627620697, 0.3443164825439453, -0.1491784155368805, -0.052231840789318085, -0.042036741971969604, -0.36021220684051514, -0.03952682763338089, -0.005339272320270538, 0.14346259832382202, 0.2585483193397522, -0.42771852016448975, 0.3879603445529938, -0.35132932662963867 ]
https://github.com/huggingface/datasets/issues/5046
Audiofolder creates empty Dataset if files same level as metadata
I think we can make the file name matching part more robust by replacing `file_name` with `os.path.normpath(file_name)`, to ignore "./" among other things, in these two places: * https://github.com/huggingface/datasets/blob/85cd129bde605cd9acacdff0d065fc02e39e09b1/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L319 * https://github.com/huggingface/datasets/blob/85cd129bde605cd9acacdff0d065fc02e39e09b1/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L388
## Describe the bug When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns. https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88 ## Steps to reproduce the bug `metadata.csv`: ```csv file_name,duration,transcription ./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello ``` ```python >>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/") >>> audio_dataset DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` I've tried, with no success,: - setting `split` to something else so I don't get a `DatasetDict`, - removing the `./`, - using `.jsonl`. ## Expected results ``` Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 1 }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` ## Environment info - `datasets` version: 2.5.1 - Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
31
Audiofolder creates empty Dataset if files same level as metadata ## Describe the bug When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns. https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88 ## Steps to reproduce the bug `metadata.csv`: ```csv file_name,duration,transcription ./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello ``` ```python >>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/") >>> audio_dataset DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` I've tried, with no success,: - setting `split` to something else so I don't get a `DatasetDict`, - removing the `./`, - using `.jsonl`. ## Expected results ``` Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 1 }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` ## Environment info - `datasets` version: 2.5.1 - Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 I think we can make the file name matching part more robust by replacing `file_name` with `os.path.normpath(file_name)`, to ignore "./" among other things, in these two places: * https://github.com/huggingface/datasets/blob/85cd129bde605cd9acacdff0d065fc02e39e09b1/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L319 * https://github.com/huggingface/datasets/blob/85cd129bde605cd9acacdff0d065fc02e39e09b1/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L388
[ -0.04184511676430702, 0.18840721249580383, -0.0120816919952631, 0.5899380445480347, 0.19426529109477997, 0.05188984423875809, 0.3689001202583313, 0.2723320424556732, 0.009522948414087296, 0.28956693410873413, -0.08250927925109863, 0.33010607957839966, -0.4205990731716156, 0.1189064010977745, -0.1743796169757843, -0.04421093314886093, -0.105026014149189, 0.27093908190727234, -0.20948120951652527, -0.2220722883939743, -0.32904377579689026, 0.0993759036064148, -0.3726891875267029, -0.21719549596309662, -0.27974236011505127, 0.12135381996631622, 0.009036390110850334, 0.27739813923835754, -0.3133001923561096, -0.18832914531230927, 0.2564588785171509, -0.1165282130241394, 0.0020182766020298004, 0.6328850388526917, -0.0001168588423752226, 0.00758834183216095, 0.3566819429397583, -0.2432050108909607, -0.21852931380271912, -0.5194230079650879, -0.47880521416664124, 0.08653274178504944, -0.25727975368499756, -0.017112471163272858, -0.050987932831048965, -0.23994652926921844, -0.2576325833797455, -0.35994768142700195, 0.0435296967625618, 0.19968830049037933, 0.12817317247390747, 0.043911922723054886, 0.07383131980895996, 0.25074300169944763, 0.26681551337242126, 0.20708025991916656, -0.0893518254160881, 0.33068016171455383, 0.054549261927604675, 0.00826697051525116, 0.10012512654066086, 0.21003374457359314, -0.13792046904563904, 0.006079183891415596, 0.23729529976844788, 0.2345905900001526, -0.1884939968585968, -0.30956190824508667, 0.13442648947238922, 0.33056899905204773, 0.6613385081291199, -0.309682160615921, -0.4042522609233856, -0.30500271916389465, 0.015136373229324818, -0.3553973138332367, 0.236525297164917, 0.4609679579734802, -0.03980531170964241, 0.1184728741645813, -0.05899729207158089, 0.31618744134902954, -0.1929490864276886, 0.0357074998319149, -0.0023949071764945984, 0.30458950996398926, -0.01098520029336214, -0.08895643800497055, 0.24243102967739105, -0.06637390702962875, 0.11261195689439774, -0.33865201473236084, -0.17135308682918549, 0.39608851075172424, -0.5739942193031311, -0.28999340534210205, 0.1674284189939499, -0.17232415080070496, 0.20174524188041687, 0.010892502963542938, 0.06519276648759842, -0.08864667266607285, -0.3894643783569336, 0.17220550775527954, 0.44987058639526367, 0.0627528727054596, 0.2679443657398224, 0.19535022974014282, 0.11837392300367355, -0.000898654805496335, 0.2792646884918213, -0.01062062382698059, -0.17895792424678802, 0.11634528636932373, 0.06876273453235626, 0.15117952227592468, 0.4965669512748718, -0.2557803690433502, -0.4179885685443878, 0.2892879545688629, -0.49770957231521606, -0.040668562054634094, -0.050589825958013535, 0.1627403199672699, 0.17624178528785706, 0.2524886727333069, -0.03883465379476547, 0.27742964029312134, 0.017205363139510155, 0.16540977358818054, -0.042042553424835205, 0.01497877947986126, 0.019985947757959366, -0.04754263162612915, 0.3953097462654114, 0.007417070679366589, 0.3780185580253601, 0.2746703624725342, -0.29109644889831543, -0.3326309025287628, 0.17760339379310608, -0.16180942952632904, -0.10720793157815933, 0.17466364800930023, 0.1856362670660019, 0.21825572848320007, -0.1122206598520279, -0.06014341115951538, -0.17848676443099976, 0.2663354277610779, -0.3470289409160614, -0.03858315199613571, 0.10594844818115234, 0.1671217978000641, -0.338922917842865, 0.3282851278781891, -0.5273737907409668, -0.09745721518993378, -0.13018104434013367, -0.09604403376579285, 0.12668906152248383, -0.16633328795433044, -0.26556622982025146, -0.044424328953027725, 0.17983131110668182, 0.34903788566589355, -0.5758572220802307, 0.008965089917182922, 0.1834244728088379, 0.09002883732318878, 0.05933719873428345, 0.11741836369037628, 0.1074347123503685, 0.2667917013168335, -0.3692564070224762, 0.18270288407802582, 0.14924684166908264, -0.35647788643836975, -0.2759946882724762, 0.03984628990292549, -0.11773459613323212, 0.37566691637039185, 0.14470860362052917, -0.10784664005041122, 0.1312914490699768, -0.0957324206829071, 0.27002936601638794, 0.1599854826927185, 0.019204510375857353, 0.1285199671983719, -0.12341520190238953, -0.14265252649784088, 0.04505150392651558, 0.03718749061226845, -0.24043892323970795, 0.044827062636613846, -0.008300736546516418, 0.03960573300719261, 0.38922175765037537, -0.24702605605125427, 0.16843397915363312, 0.30431121587753296, 0.46268925070762634, -0.02385425567626953, 0.005298606585711241, -0.31980228424072266, -0.40188801288604736, 0.17394202947616577, 0.3070582449436188, 0.3131365180015564, -0.0669480413198471, -0.24438613653182983, -0.19638296961784363, -0.18551844358444214, -0.48747339844703674, -0.2858995199203491, 0.03869662433862686, 0.18433406949043274, 0.007122080773115158, -0.061775367707014084, -0.33970212936401367, -0.03717675805091858, -0.0814654678106308, 0.051856279373168945, -0.7035751938819885, 0.36170610785484314, 0.16508471965789795, 0.03439068794250488, 0.34485000371932983, 0.34709179401397705, 0.13241755962371826, -0.08951529860496521, 0.025690224021673203, 0.2543489634990692, 0.3738356828689575, 0.012185700237751007, -0.2723625898361206, 0.43832921981811523, 0.07080259919166565, -0.08907771855592728, -0.051766298711299896, 0.12276031076908112, 0.3710210621356964, 0.05701500177383423, -0.40677550435066223, 0.4836602210998535, -0.020536862313747406, 0.3586310148239136, 0.04887284338474274, -0.24354028701782227, 0.142591193318367, -0.01791299879550934, -0.1742766946554184, -0.17950478196144104, -0.04656233265995979, -0.05950819328427315, 0.34604713320732117, 0.24186676740646362, -0.0815737396478653, -0.0333089604973793, 0.4678483009338379, -0.22817133367061615, 0.07583421468734741, -0.04049696773290634, -0.24782535433769226, 0.08992499858140945, -0.07616987079381943, 0.35708969831466675, 0.43391740322113037, 0.22100959718227386, 0.009102713316679, 0.14612095057964325, 0.08740946650505066, -0.1459542065858841, 0.21725274622440338, 0.015839189291000366, -0.06533105671405792, 0.642471194267273, -0.043512385338544846, -0.021432198584079742, -0.4071342349052429, -0.20896266400814056, -0.1611633449792862, 0.3905290365219116, -0.37994828820228577, -0.1018538847565651, -0.36696964502334595, 0.03980462998151779, -0.28018805384635925, -0.3773574233055115, -0.16527841985225677, -0.0011745793744921684, -0.14258748292922974, 0.545098066329956, -0.2912302017211914, 0.11684538424015045, -0.325611412525177, 0.23001742362976074, 0.401265949010849, -0.166341170668602, -0.0033487677574157715, 0.14944599568843842, -0.0867287665605545, 0.05442341789603233, 0.2748137414455414, 0.07684803009033203, -0.0038394127041101456, -0.14648419618606567, -0.104662224650383, -0.17326530814170837, -0.1001305878162384, 0.15175804495811462, -0.145341157913208, 0.2307228147983551, 0.10512127727270126, 0.21395346522331238, 0.41461604833602905, -0.3306328058242798, 0.05101598799228668, 0.1733824461698532, -0.269795686006546, 0.10601401329040527, 0.2590559422969818, 0.14576761424541473, -0.32222485542297363, -0.4701942503452301, 0.04937146231532097, -0.44652143120765686, 0.16732606291770935, -0.13777713477611542, 0.2336706817150116, 0.2034006267786026, -0.015738271176815033, 0.032065507024526596, -0.04839443787932396, 0.025917261838912964, -0.10728693753480911, -0.26729995012283325, 0.4132111668586731, 0.03862656652927399, -0.26793766021728516, -0.0988464504480362, -0.27365031838417053, 0.24569158256053925, 0.08889555931091309, -0.25012409687042236, -0.14885690808296204, 0.0010458659380674362, -0.1310436874628067, -0.06174040585756302, 0.09010068327188492, 0.2636726498603821, 0.27632564306259155, 0.04508453607559204, -0.2856703996658325, -0.14012755453586578, -0.10319054871797562, -0.03285929560661316, 0.19192320108413696, -0.016610722988843918, 0.4644133746623993, -0.13692161440849304, 0.33465147018432617, 0.10615292191505432, 0.07621032744646072, 0.13713517785072327, -0.18150201439857483, 0.50281822681427, -0.21485650539398193, -0.13234059512615204, -0.01300415862351656, 0.17676271498203278, -0.12921030819416046, 0.337626188993454, 0.20133045315742493, 0.19214779138565063, -0.020364968106150627, 0.025132976472377777, -0.29704001545906067, -0.1873016059398651, 0.14214816689491272, -0.23080143332481384, 0.1747472584247589, 0.07385596632957458, 0.3550533950328827, 0.2819344103336334, -0.041563816368579865, -0.02697068080306053, 0.371410608291626, 0.22414630651474, -0.053251344710588455, -0.49812111258506775, -0.022502752020955086, -0.129853755235672, -0.030016973614692688, 0.12010438740253448, 0.6720412373542786, 0.06024450436234474, -0.15611115097999573, -0.208405539393425, -0.00832875445485115, 0.6891217231750488, -0.026710765436291695, 0.43856483697891235, -0.10563351213932037, 0.25454187393188477, -0.183514803647995, -0.07842554152011871, -0.4079679250717163, -0.061301685869693756, -0.10539057850837708, 0.6149431467056274, -0.1611155867576599, -0.048961326479911804, -0.005577273666858673, 0.209132120013237, 0.009037330746650696, -0.1667245477437973, -0.29603490233421326, -0.04027638956904411, -0.125721737742424, -0.000350169837474823, -0.008696252480149269, 0.19243136048316956, -0.25278130173683167, -0.14299559593200684, 0.18388332426548004, -0.35705262422561646, 0.3607282042503357, 0.19986754655838013, 0.5285165309906006, 0.022669930011034012, 0.2883107364177704, 0.137292742729187, -0.17202411592006683, 0.5076037049293518, 0.6007961630821228, -0.0028727464377880096, -0.19607090950012207, 0.352428674697876, -0.2829144299030304, 0.21083354949951172, 0.1506110280752182, -0.03462129086256027, 0.1292254477739334, -0.07855160534381866, -0.023607127368450165, -0.477456659078598, 0.04222235828638077, 0.32028359174728394, 0.17770710587501526, -0.17636260390281677, -0.518925130367279, 0.3443337082862854, 0.05311226472258568, 0.021006375551223755, 0.35411956906318665, 0.38221168518066406, -0.3397715985774994, 0.31419676542282104, -0.35557448863983154, 0.5377671718597412, 0.5448538064956665, 0.13581405580043793, 0.4645295739173889, -0.22848409414291382, 0.1540498435497284, -0.2621113657951355, 0.17077919840812683, -0.1888175755739212, -0.20412160456180573, -0.16517838835716248, -0.09309627115726471, -0.03807516396045685, 0.30617570877075195, 0.02037801966071129, 0.417174756526947, 0.10786010324954987, 0.0071676671504974365, 0.1137307658791542, 0.053798556327819824, -0.15108931064605713, -0.013330675661563873, -0.4142380952835083, 0.03302672505378723, 0.005478847771883011, 0.24118301272392273, 0.04495910555124283, 0.0249912329018116, -0.2784208059310913, -0.490683376789093, -0.19126197695732117, 0.16174614429473877, 0.0422564297914505, -0.19719411432743073, 0.1750241219997406, -0.1459074318408966, 0.18127748370170593, -0.2773919999599457, -0.24048446118831635, 0.4110356569290161, -0.1756678819656372, -0.01154833659529686, 0.06354295462369919, 0.5188695788383484, 0.006723820697516203, -0.012303298339247704, 0.11925790458917618, 0.13572433590888977, -0.10491900891065598, -0.11523037403821945, -0.14918135106563568, -0.11138729006052017, -0.013617590069770813, -0.012655772268772125, -0.10642130672931671, -0.2051699161529541, -0.3258900046348572, -0.02659992128610611, 0.22163009643554688, -0.1558285802602768, 0.1252518594264984, -0.05394497513771057, -0.30500730872154236, -0.05144355446100235, 0.10306140780448914, -0.2767863869667053, -0.007699955254793167, 0.33965399861335754, 0.1120588406920433, 0.08792749047279358, 0.55497145652771, -0.13448430597782135, 0.10948042571544647, -0.14912721514701843, 0.31280672550201416, 0.32513001561164856, -0.1761661171913147, 0.052658069878816605, 0.04344173148274422, -0.10144615173339844, 0.05222053825855255, -0.06602086126804352, 0.10818558931350708, -0.011686146259307861, -0.10104434192180634, -0.5861691236495972, -0.035433992743492126, 0.41530656814575195, -0.009332668036222458, 0.2625746428966522, -0.12865395843982697, 0.032628752291202545, -0.09522760659456253, -0.17173656821250916, -0.2321583330631256, -0.03328271955251694, -0.033243775367736816, 0.32938525080680847, 0.39702117443084717, -0.053376637399196625, 0.09715793281793594, -0.28871357440948486, 0.10586206614971161, -0.12242414057254791, -0.2163468450307846, -0.12375348806381226, -0.2789045572280884, 0.16058191657066345, 0.10484296828508377, 0.335262656211853, -0.029808949679136276, -0.07794132828712463, -0.1967347413301468, -0.21062368154525757, 0.09127569198608398, 0.02561534196138382, -0.041187599301338196, 0.28438350558280945, 0.08898419886827469, 0.009655926376581192, -0.2501908540725708, 0.104953333735466, -0.15218451619148254, -0.23587416112422943, 0.14714643359184265, 0.1252099871635437, -0.23456132411956787, 0.14312885701656342, -0.22509080171585083, 0.09632930159568787, -0.11494764685630798, -0.036376163363456726, 0.3153282701969147, -0.19089363515377045, 0.18797878921031952, 0.10177789628505707, 0.3987952768802643, 0.42596134543418884, -0.14499200880527496, -0.14142513275146484, 0.06774885952472687, 0.20376411080360413, -0.2533935308456421, 0.021831750869750977, -0.06758145987987518, -0.0037896689027547836, 0.1991390585899353, 0.22445663809776306, -0.14853830635547638, -0.30564987659454346, -0.03378049284219742, 0.019064240157604218, 0.4407491683959961, -0.07984313368797302, 0.3118149936199188, 0.4679664969444275, -0.2639157474040985, 0.1264704465866089, 0.19694004952907562, -0.31158527731895447, 0.050840605050325394, 0.6134163737297058, 0.15626029670238495, 0.22526855766773224, 0.1815490424633026, -0.2332797348499298, -0.12224411219358444, -0.3195420801639557, -0.4742017984390259, 0.19579145312309265, 0.007089845836162567, 0.19923940300941467, 0.1363234668970108, -0.003089398145675659, -0.180426687002182, -0.18083199858665466, 0.10671719163656235, -0.2946268618106842, -0.10310334712266922, -0.02956097573041916, -0.24426867067813873, -0.32921093702316284, -0.0793602243065834, -0.0020168907940387726, 0.04911172762513161, -0.09304127097129822, -0.10505764186382294, -0.14516565203666687, -0.2595604658126831, -0.23252999782562256, -0.1701284945011139, 0.5325813293457031, 0.06662863492965698, -0.2011861354112625, 0.5179359316825867, 0.30568915605545044, -0.022222444415092468, 0.25445348024368286, 0.305105596780777, 0.39823123812675476, 0.3389618396759033, 0.347216933965683, -0.06599445641040802, -0.07227927446365356, -0.11457746475934982, 0.0019513443112373352, 0.32206282019615173, -0.08219733834266663, -0.06533345580101013, 0.02527359500527382, 0.1677696704864502, -0.1258406639099121, 0.1478562206029892, 0.1018502414226532, -0.03299393504858017, -0.49097201228141785, 0.33755573630332947, -0.1320507526397705, -0.08399511873722076, -0.1151997298002243, -0.09583302587270737, -0.49259325861930847, -0.2770296633243561, 0.2347699999809265, 0.34944382309913635, 0.17432209849357605, 0.03473913297057152, 0.0566285103559494, -0.13751953840255737, 0.11680233478546143, 0.3675087094306946, -0.13686230778694153, -0.048049286007881165, -0.024810709059238434, -0.8919185400009155, 0.03462681919336319, -0.15916229784488678, -0.059510163962841034, -0.12980526685714722, 0.028371190652251244, 0.27292826771736145, 0.13375374674797058, -0.024670541286468506, 0.4044521450996399, -0.20374056696891785, -0.09110388159751892, -0.5500498414039612, -0.23242883384227753, -0.16539691388607025, 0.09662798047065735, -0.2515075206756592, -0.6229763627052307, 0.004068750888109207, -0.037526246160268784, -0.04784519225358963, 0.25658902525901794, 0.19566112756729126, -0.3368351459503174, 0.28684157133102417, 0.06253160536289215, 0.1921064257621765, 0.41246068477630615, -0.20461136102676392, -0.03309733420610428, -0.5476499795913696, 0.08181305229663849, -0.1000603437423706, 0.08077395707368851, 0.2464301735162735, 0.5594117641448975, -0.10855048894882202, -0.20194821059703827, -0.19792912900447845, 0.07431183010339737, -0.016435010358691216, -0.1821136772632599, -0.4922492206096649, 0.42348983883857727, -0.3225325644016266, 0.1464705914258957, -0.1771354228258133, 0.031225943937897682, 0.0033221207559108734, -0.0296894870698452, -0.2798101305961609, -0.3282169997692108, 0.4339722990989685, -0.320294052362442, -0.37445253133773804, -0.05570235103368759, 0.3338279128074646, 0.11931617558002472, -0.20194315910339355, -0.42120009660720825, 0.2521117627620697, 0.3443164825439453, -0.1491784155368805, -0.052231840789318085, -0.042036741971969604, -0.36021220684051514, -0.03952682763338089, -0.005339272320270538, 0.14346259832382202, 0.2585483193397522, -0.42771852016448975, 0.3879603445529938, -0.35132932662963867 ]
https://github.com/huggingface/datasets/issues/5046
Audiofolder creates empty Dataset if files same level as metadata
I realized what I was doing wrong. The documentation puts the files in a subfolder. Once I have done that, it worked. But l agree that this should be handled better if possible.
## Describe the bug When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns. https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88 ## Steps to reproduce the bug `metadata.csv`: ```csv file_name,duration,transcription ./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello ``` ```python >>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/") >>> audio_dataset DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` I've tried, with no success,: - setting `split` to something else so I don't get a `DatasetDict`, - removing the `./`, - using `.jsonl`. ## Expected results ``` Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 1 }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` ## Environment info - `datasets` version: 2.5.1 - Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
33
Audiofolder creates empty Dataset if files same level as metadata ## Describe the bug When audio files are at the same level as the metadata (`metadata.csv` or `metadata.jsonl` ), the `load_dataset` returns a `DatasetDict` with no rows but the correct columns. https://github.com/huggingface/datasets/blob/1ea4d091b7a4b83a85b2eeb8df65115d39af3766/docs/source/audio_dataset.mdx?plain=1#L88 ## Steps to reproduce the bug `metadata.csv`: ```csv file_name,duration,transcription ./2063_fe9936e7-62b2-4e62-a276-acbd344480ce_1.wav,10.768,hello ``` ```python >>> audio_dataset = load_dataset("audiofolder", data_dir="/audio-data/") >>> audio_dataset DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` I've tried, with no success,: - setting `split` to something else so I don't get a `DatasetDict`, - removing the `./`, - using `.jsonl`. ## Expected results ``` Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 1 }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) validation: Dataset({ features: ['audio', 'duration', 'transcription'], num_rows: 0 }) }) ``` ## Environment info - `datasets` version: 2.5.1 - Platform: Linux-5.13.0-1025-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 I realized what I was doing wrong. The documentation puts the files in a subfolder. Once I have done that, it worked. But l agree that this should be handled better if possible.
[ -0.04184511676430702, 0.18840721249580383, -0.0120816919952631, 0.5899380445480347, 0.19426529109477997, 0.05188984423875809, 0.3689001202583313, 0.2723320424556732, 0.009522948414087296, 0.28956693410873413, -0.08250927925109863, 0.33010607957839966, -0.4205990731716156, 0.1189064010977745, -0.1743796169757843, -0.04421093314886093, -0.105026014149189, 0.27093908190727234, -0.20948120951652527, -0.2220722883939743, -0.32904377579689026, 0.0993759036064148, -0.3726891875267029, -0.21719549596309662, -0.27974236011505127, 0.12135381996631622, 0.009036390110850334, 0.27739813923835754, -0.3133001923561096, -0.18832914531230927, 0.2564588785171509, -0.1165282130241394, 0.0020182766020298004, 0.6328850388526917, -0.0001168588423752226, 0.00758834183216095, 0.3566819429397583, -0.2432050108909607, -0.21852931380271912, -0.5194230079650879, -0.47880521416664124, 0.08653274178504944, -0.25727975368499756, -0.017112471163272858, -0.050987932831048965, -0.23994652926921844, -0.2576325833797455, -0.35994768142700195, 0.0435296967625618, 0.19968830049037933, 0.12817317247390747, 0.043911922723054886, 0.07383131980895996, 0.25074300169944763, 0.26681551337242126, 0.20708025991916656, -0.0893518254160881, 0.33068016171455383, 0.054549261927604675, 0.00826697051525116, 0.10012512654066086, 0.21003374457359314, -0.13792046904563904, 0.006079183891415596, 0.23729529976844788, 0.2345905900001526, -0.1884939968585968, -0.30956190824508667, 0.13442648947238922, 0.33056899905204773, 0.6613385081291199, -0.309682160615921, -0.4042522609233856, -0.30500271916389465, 0.015136373229324818, -0.3553973138332367, 0.236525297164917, 0.4609679579734802, -0.03980531170964241, 0.1184728741645813, -0.05899729207158089, 0.31618744134902954, -0.1929490864276886, 0.0357074998319149, -0.0023949071764945984, 0.30458950996398926, -0.01098520029336214, -0.08895643800497055, 0.24243102967739105, -0.06637390702962875, 0.11261195689439774, -0.33865201473236084, -0.17135308682918549, 0.39608851075172424, -0.5739942193031311, -0.28999340534210205, 0.1674284189939499, -0.17232415080070496, 0.20174524188041687, 0.010892502963542938, 0.06519276648759842, -0.08864667266607285, -0.3894643783569336, 0.17220550775527954, 0.44987058639526367, 0.0627528727054596, 0.2679443657398224, 0.19535022974014282, 0.11837392300367355, -0.000898654805496335, 0.2792646884918213, -0.01062062382698059, -0.17895792424678802, 0.11634528636932373, 0.06876273453235626, 0.15117952227592468, 0.4965669512748718, -0.2557803690433502, -0.4179885685443878, 0.2892879545688629, -0.49770957231521606, -0.040668562054634094, -0.050589825958013535, 0.1627403199672699, 0.17624178528785706, 0.2524886727333069, -0.03883465379476547, 0.27742964029312134, 0.017205363139510155, 0.16540977358818054, -0.042042553424835205, 0.01497877947986126, 0.019985947757959366, -0.04754263162612915, 0.3953097462654114, 0.007417070679366589, 0.3780185580253601, 0.2746703624725342, -0.29109644889831543, -0.3326309025287628, 0.17760339379310608, -0.16180942952632904, -0.10720793157815933, 0.17466364800930023, 0.1856362670660019, 0.21825572848320007, -0.1122206598520279, -0.06014341115951538, -0.17848676443099976, 0.2663354277610779, -0.3470289409160614, -0.03858315199613571, 0.10594844818115234, 0.1671217978000641, -0.338922917842865, 0.3282851278781891, -0.5273737907409668, -0.09745721518993378, -0.13018104434013367, -0.09604403376579285, 0.12668906152248383, -0.16633328795433044, -0.26556622982025146, -0.044424328953027725, 0.17983131110668182, 0.34903788566589355, -0.5758572220802307, 0.008965089917182922, 0.1834244728088379, 0.09002883732318878, 0.05933719873428345, 0.11741836369037628, 0.1074347123503685, 0.2667917013168335, -0.3692564070224762, 0.18270288407802582, 0.14924684166908264, -0.35647788643836975, -0.2759946882724762, 0.03984628990292549, -0.11773459613323212, 0.37566691637039185, 0.14470860362052917, -0.10784664005041122, 0.1312914490699768, -0.0957324206829071, 0.27002936601638794, 0.1599854826927185, 0.019204510375857353, 0.1285199671983719, -0.12341520190238953, -0.14265252649784088, 0.04505150392651558, 0.03718749061226845, -0.24043892323970795, 0.044827062636613846, -0.008300736546516418, 0.03960573300719261, 0.38922175765037537, -0.24702605605125427, 0.16843397915363312, 0.30431121587753296, 0.46268925070762634, -0.02385425567626953, 0.005298606585711241, -0.31980228424072266, -0.40188801288604736, 0.17394202947616577, 0.3070582449436188, 0.3131365180015564, -0.0669480413198471, -0.24438613653182983, -0.19638296961784363, -0.18551844358444214, -0.48747339844703674, -0.2858995199203491, 0.03869662433862686, 0.18433406949043274, 0.007122080773115158, -0.061775367707014084, -0.33970212936401367, -0.03717675805091858, -0.0814654678106308, 0.051856279373168945, -0.7035751938819885, 0.36170610785484314, 0.16508471965789795, 0.03439068794250488, 0.34485000371932983, 0.34709179401397705, 0.13241755962371826, -0.08951529860496521, 0.025690224021673203, 0.2543489634990692, 0.3738356828689575, 0.012185700237751007, -0.2723625898361206, 0.43832921981811523, 0.07080259919166565, -0.08907771855592728, -0.051766298711299896, 0.12276031076908112, 0.3710210621356964, 0.05701500177383423, -0.40677550435066223, 0.4836602210998535, -0.020536862313747406, 0.3586310148239136, 0.04887284338474274, -0.24354028701782227, 0.142591193318367, -0.01791299879550934, -0.1742766946554184, -0.17950478196144104, -0.04656233265995979, -0.05950819328427315, 0.34604713320732117, 0.24186676740646362, -0.0815737396478653, -0.0333089604973793, 0.4678483009338379, -0.22817133367061615, 0.07583421468734741, -0.04049696773290634, -0.24782535433769226, 0.08992499858140945, -0.07616987079381943, 0.35708969831466675, 0.43391740322113037, 0.22100959718227386, 0.009102713316679, 0.14612095057964325, 0.08740946650505066, -0.1459542065858841, 0.21725274622440338, 0.015839189291000366, -0.06533105671405792, 0.642471194267273, -0.043512385338544846, -0.021432198584079742, -0.4071342349052429, -0.20896266400814056, -0.1611633449792862, 0.3905290365219116, -0.37994828820228577, -0.1018538847565651, -0.36696964502334595, 0.03980462998151779, -0.28018805384635925, -0.3773574233055115, -0.16527841985225677, -0.0011745793744921684, -0.14258748292922974, 0.545098066329956, -0.2912302017211914, 0.11684538424015045, -0.325611412525177, 0.23001742362976074, 0.401265949010849, -0.166341170668602, -0.0033487677574157715, 0.14944599568843842, -0.0867287665605545, 0.05442341789603233, 0.2748137414455414, 0.07684803009033203, -0.0038394127041101456, -0.14648419618606567, -0.104662224650383, -0.17326530814170837, -0.1001305878162384, 0.15175804495811462, -0.145341157913208, 0.2307228147983551, 0.10512127727270126, 0.21395346522331238, 0.41461604833602905, -0.3306328058242798, 0.05101598799228668, 0.1733824461698532, -0.269795686006546, 0.10601401329040527, 0.2590559422969818, 0.14576761424541473, -0.32222485542297363, -0.4701942503452301, 0.04937146231532097, -0.44652143120765686, 0.16732606291770935, -0.13777713477611542, 0.2336706817150116, 0.2034006267786026, -0.015738271176815033, 0.032065507024526596, -0.04839443787932396, 0.025917261838912964, -0.10728693753480911, -0.26729995012283325, 0.4132111668586731, 0.03862656652927399, -0.26793766021728516, -0.0988464504480362, -0.27365031838417053, 0.24569158256053925, 0.08889555931091309, -0.25012409687042236, -0.14885690808296204, 0.0010458659380674362, -0.1310436874628067, -0.06174040585756302, 0.09010068327188492, 0.2636726498603821, 0.27632564306259155, 0.04508453607559204, -0.2856703996658325, -0.14012755453586578, -0.10319054871797562, -0.03285929560661316, 0.19192320108413696, -0.016610722988843918, 0.4644133746623993, -0.13692161440849304, 0.33465147018432617, 0.10615292191505432, 0.07621032744646072, 0.13713517785072327, -0.18150201439857483, 0.50281822681427, -0.21485650539398193, -0.13234059512615204, -0.01300415862351656, 0.17676271498203278, -0.12921030819416046, 0.337626188993454, 0.20133045315742493, 0.19214779138565063, -0.020364968106150627, 0.025132976472377777, -0.29704001545906067, -0.1873016059398651, 0.14214816689491272, -0.23080143332481384, 0.1747472584247589, 0.07385596632957458, 0.3550533950328827, 0.2819344103336334, -0.041563816368579865, -0.02697068080306053, 0.371410608291626, 0.22414630651474, -0.053251344710588455, -0.49812111258506775, -0.022502752020955086, -0.129853755235672, -0.030016973614692688, 0.12010438740253448, 0.6720412373542786, 0.06024450436234474, -0.15611115097999573, -0.208405539393425, -0.00832875445485115, 0.6891217231750488, -0.026710765436291695, 0.43856483697891235, -0.10563351213932037, 0.25454187393188477, -0.183514803647995, -0.07842554152011871, -0.4079679250717163, -0.061301685869693756, -0.10539057850837708, 0.6149431467056274, -0.1611155867576599, -0.048961326479911804, -0.005577273666858673, 0.209132120013237, 0.009037330746650696, -0.1667245477437973, -0.29603490233421326, -0.04027638956904411, -0.125721737742424, -0.000350169837474823, -0.008696252480149269, 0.19243136048316956, -0.25278130173683167, -0.14299559593200684, 0.18388332426548004, -0.35705262422561646, 0.3607282042503357, 0.19986754655838013, 0.5285165309906006, 0.022669930011034012, 0.2883107364177704, 0.137292742729187, -0.17202411592006683, 0.5076037049293518, 0.6007961630821228, -0.0028727464377880096, -0.19607090950012207, 0.352428674697876, -0.2829144299030304, 0.21083354949951172, 0.1506110280752182, -0.03462129086256027, 0.1292254477739334, -0.07855160534381866, -0.023607127368450165, -0.477456659078598, 0.04222235828638077, 0.32028359174728394, 0.17770710587501526, -0.17636260390281677, -0.518925130367279, 0.3443337082862854, 0.05311226472258568, 0.021006375551223755, 0.35411956906318665, 0.38221168518066406, -0.3397715985774994, 0.31419676542282104, -0.35557448863983154, 0.5377671718597412, 0.5448538064956665, 0.13581405580043793, 0.4645295739173889, -0.22848409414291382, 0.1540498435497284, -0.2621113657951355, 0.17077919840812683, -0.1888175755739212, -0.20412160456180573, -0.16517838835716248, -0.09309627115726471, -0.03807516396045685, 0.30617570877075195, 0.02037801966071129, 0.417174756526947, 0.10786010324954987, 0.0071676671504974365, 0.1137307658791542, 0.053798556327819824, -0.15108931064605713, -0.013330675661563873, -0.4142380952835083, 0.03302672505378723, 0.005478847771883011, 0.24118301272392273, 0.04495910555124283, 0.0249912329018116, -0.2784208059310913, -0.490683376789093, -0.19126197695732117, 0.16174614429473877, 0.0422564297914505, -0.19719411432743073, 0.1750241219997406, -0.1459074318408966, 0.18127748370170593, -0.2773919999599457, -0.24048446118831635, 0.4110356569290161, -0.1756678819656372, -0.01154833659529686, 0.06354295462369919, 0.5188695788383484, 0.006723820697516203, -0.012303298339247704, 0.11925790458917618, 0.13572433590888977, -0.10491900891065598, -0.11523037403821945, -0.14918135106563568, -0.11138729006052017, -0.013617590069770813, -0.012655772268772125, -0.10642130672931671, -0.2051699161529541, -0.3258900046348572, -0.02659992128610611, 0.22163009643554688, -0.1558285802602768, 0.1252518594264984, -0.05394497513771057, -0.30500730872154236, -0.05144355446100235, 0.10306140780448914, -0.2767863869667053, -0.007699955254793167, 0.33965399861335754, 0.1120588406920433, 0.08792749047279358, 0.55497145652771, -0.13448430597782135, 0.10948042571544647, -0.14912721514701843, 0.31280672550201416, 0.32513001561164856, -0.1761661171913147, 0.052658069878816605, 0.04344173148274422, -0.10144615173339844, 0.05222053825855255, -0.06602086126804352, 0.10818558931350708, -0.011686146259307861, -0.10104434192180634, -0.5861691236495972, -0.035433992743492126, 0.41530656814575195, -0.009332668036222458, 0.2625746428966522, -0.12865395843982697, 0.032628752291202545, -0.09522760659456253, -0.17173656821250916, -0.2321583330631256, -0.03328271955251694, -0.033243775367736816, 0.32938525080680847, 0.39702117443084717, -0.053376637399196625, 0.09715793281793594, -0.28871357440948486, 0.10586206614971161, -0.12242414057254791, -0.2163468450307846, -0.12375348806381226, -0.2789045572280884, 0.16058191657066345, 0.10484296828508377, 0.335262656211853, -0.029808949679136276, -0.07794132828712463, -0.1967347413301468, -0.21062368154525757, 0.09127569198608398, 0.02561534196138382, -0.041187599301338196, 0.28438350558280945, 0.08898419886827469, 0.009655926376581192, -0.2501908540725708, 0.104953333735466, -0.15218451619148254, -0.23587416112422943, 0.14714643359184265, 0.1252099871635437, -0.23456132411956787, 0.14312885701656342, -0.22509080171585083, 0.09632930159568787, -0.11494764685630798, -0.036376163363456726, 0.3153282701969147, -0.19089363515377045, 0.18797878921031952, 0.10177789628505707, 0.3987952768802643, 0.42596134543418884, -0.14499200880527496, -0.14142513275146484, 0.06774885952472687, 0.20376411080360413, -0.2533935308456421, 0.021831750869750977, -0.06758145987987518, -0.0037896689027547836, 0.1991390585899353, 0.22445663809776306, -0.14853830635547638, -0.30564987659454346, -0.03378049284219742, 0.019064240157604218, 0.4407491683959961, -0.07984313368797302, 0.3118149936199188, 0.4679664969444275, -0.2639157474040985, 0.1264704465866089, 0.19694004952907562, -0.31158527731895447, 0.050840605050325394, 0.6134163737297058, 0.15626029670238495, 0.22526855766773224, 0.1815490424633026, -0.2332797348499298, -0.12224411219358444, -0.3195420801639557, -0.4742017984390259, 0.19579145312309265, 0.007089845836162567, 0.19923940300941467, 0.1363234668970108, -0.003089398145675659, -0.180426687002182, -0.18083199858665466, 0.10671719163656235, -0.2946268618106842, -0.10310334712266922, -0.02956097573041916, -0.24426867067813873, -0.32921093702316284, -0.0793602243065834, -0.0020168907940387726, 0.04911172762513161, -0.09304127097129822, -0.10505764186382294, -0.14516565203666687, -0.2595604658126831, -0.23252999782562256, -0.1701284945011139, 0.5325813293457031, 0.06662863492965698, -0.2011861354112625, 0.5179359316825867, 0.30568915605545044, -0.022222444415092468, 0.25445348024368286, 0.305105596780777, 0.39823123812675476, 0.3389618396759033, 0.347216933965683, -0.06599445641040802, -0.07227927446365356, -0.11457746475934982, 0.0019513443112373352, 0.32206282019615173, -0.08219733834266663, -0.06533345580101013, 0.02527359500527382, 0.1677696704864502, -0.1258406639099121, 0.1478562206029892, 0.1018502414226532, -0.03299393504858017, -0.49097201228141785, 0.33755573630332947, -0.1320507526397705, -0.08399511873722076, -0.1151997298002243, -0.09583302587270737, -0.49259325861930847, -0.2770296633243561, 0.2347699999809265, 0.34944382309913635, 0.17432209849357605, 0.03473913297057152, 0.0566285103559494, -0.13751953840255737, 0.11680233478546143, 0.3675087094306946, -0.13686230778694153, -0.048049286007881165, -0.024810709059238434, -0.8919185400009155, 0.03462681919336319, -0.15916229784488678, -0.059510163962841034, -0.12980526685714722, 0.028371190652251244, 0.27292826771736145, 0.13375374674797058, -0.024670541286468506, 0.4044521450996399, -0.20374056696891785, -0.09110388159751892, -0.5500498414039612, -0.23242883384227753, -0.16539691388607025, 0.09662798047065735, -0.2515075206756592, -0.6229763627052307, 0.004068750888109207, -0.037526246160268784, -0.04784519225358963, 0.25658902525901794, 0.19566112756729126, -0.3368351459503174, 0.28684157133102417, 0.06253160536289215, 0.1921064257621765, 0.41246068477630615, -0.20461136102676392, -0.03309733420610428, -0.5476499795913696, 0.08181305229663849, -0.1000603437423706, 0.08077395707368851, 0.2464301735162735, 0.5594117641448975, -0.10855048894882202, -0.20194821059703827, -0.19792912900447845, 0.07431183010339737, -0.016435010358691216, -0.1821136772632599, -0.4922492206096649, 0.42348983883857727, -0.3225325644016266, 0.1464705914258957, -0.1771354228258133, 0.031225943937897682, 0.0033221207559108734, -0.0296894870698452, -0.2798101305961609, -0.3282169997692108, 0.4339722990989685, -0.320294052362442, -0.37445253133773804, -0.05570235103368759, 0.3338279128074646, 0.11931617558002472, -0.20194315910339355, -0.42120009660720825, 0.2521117627620697, 0.3443164825439453, -0.1491784155368805, -0.052231840789318085, -0.042036741971969604, -0.36021220684051514, -0.03952682763338089, -0.005339272320270538, 0.14346259832382202, 0.2585483193397522, -0.42771852016448975, 0.3879603445529938, -0.35132932662963867 ]
https://github.com/huggingface/datasets/issues/5045
Automatically revert to last successful commit to hub when a push_to_hub is interrupted
Could you share the error you got please ? Maybe the full stack trace if you have it ? Maybe `push_to_hub` be implemented as a single commit @Wauplin ? This way if it fails, the repo is still at the previous (valid) state instead of ending-up in an invalid/incimplete state.
**Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults
50
Automatically revert to last successful commit to hub when a push_to_hub is interrupted **Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults Could you share the error you got please ? Maybe the full stack trace if you have it ? Maybe `push_to_hub` be implemented as a single commit @Wauplin ? This way if it fails, the repo is still at the previous (valid) state instead of ending-up in an invalid/incimplete state.
[ -0.557437002658844, -0.14015455543994904, -0.025222836062312126, -0.32825714349746704, 0.12634941935539246, -0.21481463313102722, -0.028438713401556015, 0.3787873089313507, 0.024059370160102844, 0.37196671962738037, 0.3590063154697418, 0.22657276690006256, -0.010694938711822033, 0.23487956821918488, 0.002594420686364174, 0.21256102621555328, -0.027940697968006134, 0.32767564058303833, 0.2561092972755432, -0.042942654341459274, -0.07166134566068649, -0.12550966441631317, 0.07423217594623566, -0.045706793665885925, -0.22171075642108917, 0.13695953786373138, 0.10323090851306915, 0.14743834733963013, -0.015488976612687111, -0.3301953375339508, 0.4102124571800232, 0.38897445797920227, -0.012763718143105507, 0.14462552964687347, -0.000117545023385901, -0.01834011822938919, 0.30765533447265625, -0.14844663441181183, -0.36067306995391846, -0.13119159638881683, -0.5772534608840942, -0.1325402557849884, -0.13197872042655945, -0.1154124066233635, 0.099298857152462, 0.5809285640716553, 0.12018059194087982, 0.06423116475343704, 0.33472922444343567, -0.0088246064260602, 0.1116732656955719, -0.04113956540822983, 0.2002088874578476, -0.2983057498931885, 0.19688791036605835, 0.24946504831314087, 0.03278721868991852, 0.3281933665275574, 0.2773415744304657, -0.028688421472907066, -0.12347552925348282, 0.24981854856014252, 0.09071395546197891, -0.1738208532333374, 0.019302114844322205, -0.20388257503509521, 0.35973790287971497, -0.0031739920377731323, -0.15920543670654297, -0.049025245010852814, 0.36037394404411316, -0.5253956913948059, -0.3278047740459442, -0.42471471428871155, 0.18429137766361237, -0.13762933015823364, -0.16057610511779785, -0.30442994832992554, -0.02429846301674843, 0.21960581839084625, -0.1702665239572525, -0.5556389689445496, -0.2431335747241974, 0.005346223711967468, -0.18781793117523193, -0.07214289903640747, 0.1739908754825592, 0.016519520431756973, 0.040323492139577866, 0.24409931898117065, 0.16883008182048798, 0.04793250560760498, -0.030559737235307693, 0.00321450037881732, -0.35514339804649353, -0.5275773406028748, 0.0356828011572361, -0.03225947171449661, 0.3094089925289154, 0.32278430461883545, -0.05820050835609436, 0.3157191872596741, -0.24642157554626465, 0.008019417524337769, 0.15455956757068634, 0.327254056930542, 0.38639652729034424, -0.057295504957437515, 0.35826992988586426, 0.021117333322763443, -0.12151886522769928, 0.1535353809595108, 0.003116497304290533, -0.013330752961337566, 0.4468618333339691, 0.3586263656616211, 0.28124260902404785, -0.14172834157943726, -0.07600268721580505, 0.15109406411647797, -0.10769689083099365, -0.011064490303397179, -0.14064647257328033, 0.0798693299293518, 0.13952884078025818, 0.37145453691482544, -0.16747909784317017, -0.06646320223808289, -0.04563974216580391, 0.01893789693713188, -0.11624594032764435, -0.37180548906326294, -0.2520869970321655, 0.28745901584625244, 0.3069150149822235, -0.4730456471443176, 0.05661401152610779, -0.04199403151869774, -0.19049449265003204, -0.1230158805847168, -0.15408799052238464, 0.16922631859779358, -0.060217492282390594, 0.0712241381406784, 0.02031400427222252, 0.04016697406768799, -0.01216885820031166, -0.060370318591594696, -0.333834707736969, 0.32729947566986084, -0.44476914405822754, -0.5830329656600952, 0.2259887307882309, 0.13233783841133118, -0.42544031143188477, 0.1365596204996109, -0.5039470195770264, 0.012857282534241676, -0.2271084487438202, 0.1541643589735031, 0.1727757453918457, 0.03139224648475647, -0.02355937287211418, 0.012462093494832516, 0.08189777284860611, 0.43196171522140503, 0.009441476315259933, -0.23369435966014862, 0.16356121003627777, -0.2617664933204651, -0.24698275327682495, -0.206003338098526, -0.10368596762418747, 0.2463165819644928, -0.05364952236413956, -0.043480873107910156, 0.15758457779884338, -0.5950124859809875, -0.4541272521018982, -0.2116575837135315, -0.3556748628616333, 0.04974296689033508, -0.6045697927474976, 0.31538039445877075, 0.1652246117591858, 0.029778199270367622, 0.14507628977298737, 0.2802390456199646, -0.11988373100757599, 0.02839050628244877, -0.2211834341287613, -0.27818936109542847, -0.4160301089286804, 0.3200768232345581, 0.34713712334632874, 0.3300563395023346, 0.22358518838882446, 0.40090468525886536, 0.09192716330289841, 0.3142401874065399, 0.15727746486663818, 0.06582126021385193, 0.49452656507492065, -0.4251598119735718, 0.0488627590239048, -0.4085283875465393, -0.34080013632774353, 0.21153298020362854, 0.35661181807518005, -0.2556559443473816, 0.00675654411315918, -0.18038702011108398, -0.3907085955142975, 0.028694765642285347, -0.10912394523620605, 0.5257846713066101, 0.061374448239803314, -0.2050483524799347, -0.29024025797843933, 0.09598158299922943, -0.36856609582901, 0.3545491397380829, -0.22199903428554535, 0.24327068030834198, -0.07800285518169403, 0.4858841300010681, 0.12686219811439514, -0.31465113162994385, 0.0030697807669639587, 0.15917976200580597, 0.3261091113090515, -0.12935557961463928, 0.08321656286716461, 0.35313400626182556, -0.06085943803191185, 0.5892978310585022, 0.1232084259390831, 0.10764046758413315, 0.23469039797782898, 0.2575013041496277, -0.01695040799677372, -0.1765674501657486, -0.08516798913478851, -0.2168651521205902, -0.15322256088256836, 0.23707525432109833, -0.06875874102115631, 0.1368481069803238, -0.1443166732788086, -0.06040444225072861, -0.12322960048913956, -0.30019810795783997, -0.27184727787971497, -0.23406241834163666, 0.0760936290025711, 0.014057505875825882, -0.23462004959583282, -0.1865934282541275, -0.09167005121707916, 0.22942385077476501, 0.36208462715148926, -0.19939394295215607, 0.09672381728887558, 0.3805994987487793, -0.1762332022190094, 0.12903687357902527, 0.16664834320545197, 0.2804896831512451, 0.042825885117053986, -0.004836199339479208, -0.1361459344625473, -0.04945319890975952, -0.005596260540187359, 0.03318316489458084, -0.09163673967123032, 0.05517953634262085, 0.5402311682701111, 0.4363984763622284, 0.2641063928604126, -0.05206332728266716, -0.09039343893527985, -0.14357946813106537, 0.08393406122922897, 0.21478873491287231, -0.07301630824804306, -0.3926072418689728, -0.21314720809459686, 0.05169861763715744, -0.12263543903827667, -0.5229921936988831, -0.16762815415859222, -0.20411288738250732, 0.1361745148897171, 0.3111706078052521, -0.17370033264160156, 0.09972815960645676, 0.028331592679023743, 0.5448604226112366, 0.05076759308576584, -0.30792567133903503, -0.008868705481290817, -0.21026013791561127, 0.24046635627746582, -0.0035090427845716476, -0.0920005738735199, -0.21427622437477112, 0.24630607664585114, -0.117324598133564, 0.14727894961833954, -0.26451244950294495, -0.007819272577762604, 0.16967996954917908, 0.09606525301933289, -0.08409428596496582, 0.02802877128124237, 0.05523856356739998, 0.4045436382293701, -0.22335310280323029, 0.07093828916549683, -0.08999563008546829, -0.1695605367422104, 0.18169967830181122, 0.10718359053134918, 0.27182018756866455, -0.07083253562450409, 0.1308111548423767, 0.14136986434459686, -0.36571255326271057, 0.12241581082344055, 0.08657300472259521, 0.1569756269454956, -0.06979966908693314, 0.022310882806777954, -0.17854593694210052, 0.19650080800056458, -0.555586040019989, -0.05040084943175316, -0.243277445435524, 0.06335940957069397, -0.04555995389819145, 0.1964113414287567, 0.08457490801811218, 0.025282196700572968, -0.06713370978832245, 0.27781176567077637, -0.38490062952041626, -0.46280184388160706, 0.023626714944839478, 0.44964754581451416, -0.2736485004425049, -0.2777926027774811, 0.3080883324146271, 0.41815707087516785, -0.1047319546341896, 0.1241050586104393, -0.2861254811286926, 0.127776637673378, 0.47817185521125793, 0.17540249228477478, -0.0707145556807518, -0.017577461898326874, 0.204593226313591, 0.451682448387146, -0.15463490784168243, -0.10217437148094177, -0.007750906050205231, 0.3806946575641632, -0.025813672691583633, -0.10680980235338211, 0.012981956824660301, -0.03426964953541756, -0.307435005903244, 0.09255638718605042, 0.012109212577342987, 0.20554658770561218, -0.061313219368457794, -0.09891662001609802, -0.6795758008956909, 0.046865418553352356, -0.5169810056686401, -0.16933979094028473, -0.534948468208313, 0.05799216032028198, 0.026730872690677643, 0.034742385149002075, -0.24506211280822754, -0.019295087084174156, 0.39351293444633484, 0.1783704310655594, 0.5034408569335938, -0.0893925204873085, -0.21449217200279236, 0.007139993831515312, -0.37472468614578247, -0.07805980741977692, -0.16676460206508636, 0.04873191937804222, 0.14580507576465607, 0.051317207515239716, -0.21592392027378082, -0.07308929413557053, 0.6332658529281616, -0.08153712004423141, 0.3829922080039978, -0.03269742801785469, -0.0008661076426506042, 0.1570766568183899, -0.203606978058815, 0.26089972257614136, 0.25809532403945923, -0.035495880991220474, 0.6023630499839783, -0.11264920979738235, 0.08782428503036499, -0.02332141250371933, 0.08596360683441162, -0.2286638617515564, -0.030989564955234528, 0.1724940538406372, 0.09478794783353806, -0.3506714403629303, 0.23993727564811707, -0.04403626546263695, -0.10428515076637268, -0.24063920974731445, -0.2866522967815399, -0.1630057543516159, 0.014658264815807343, -0.17205007374286652, -0.10099603235721588, 0.04353705421090126, -0.18274392187595367, 0.204484760761261, 0.09825199842453003, -0.10742895305156708, 0.3622897267341614, 0.121819868683815, 0.10411278903484344, -0.08476081490516663, -0.09283028542995453, -0.19414657354354858, 0.0729571282863617, 0.3648005425930023, 0.2649516463279724, 0.5009655952453613, -0.1546952724456787, 0.029206521809101105, -0.6454635858535767, -0.12564095854759216, -0.1590195745229721, 0.017278991639614105, -0.5974567532539368, -0.06941458582878113, 0.3993585705757141, -0.39822253584861755, -0.2080320417881012, 0.2193853259086609, 0.41857272386550903, -0.2098255455493927, 0.31653058528900146, 0.13319902122020721, 1.080089807510376, 0.09097929298877716, -0.1322442889213562, -0.3406754732131958, -0.16087934374809265, 0.21022529900074005, -0.3818122148513794, 0.10072049498558044, -0.13321241736412048, -0.24361906945705414, -0.14565600454807281, -0.05805198848247528, -0.2418515384197235, 0.05669890716671944, -0.3803589344024658, 0.19835737347602844, 0.13025447726249695, 0.35925382375717163, -0.08932390064001083, 0.16886022686958313, -0.2843998670578003, -0.15926241874694824, -0.03419990837574005, 0.11638529598712921, -0.06852002441883087, 0.35080575942993164, -0.17629173398017883, -0.057731449604034424, 0.2653545141220093, 0.19580142199993134, -0.4966467022895813, 0.013856615871191025, 0.03055211901664734, -0.2892569303512573, -0.18141861259937286, -0.3376166820526123, 0.026745963841676712, -0.1672973334789276, 0.6038219928741455, 0.35925501585006714, -0.32903891801834106, 0.18565063178539276, -0.005749545991420746, 0.36931854486465454, 0.03172473981976509, -0.25798091292381287, 0.3605048954486847, -0.17595762014389038, -0.5229928493499756, 0.12800145149230957, 0.12606500089168549, -0.5852581858634949, -0.0748462826013565, -0.04635145515203476, 0.015569675713777542, 0.0282155629247427, 0.13530491292476654, 0.31876617670059204, 0.03442015126347542, -0.37372854351997375, 0.052923910319805145, 0.17634886503219604, 0.08099682629108429, 0.2052968144416809, -0.10558438301086426, -0.025117140263319016, 0.07241837680339813, 0.2903016209602356, 0.04094579815864563, -0.3332575261592865, -0.00420103594660759, -0.23615047335624695, -0.16776582598686218, -0.11121220141649246, -0.27573519945144653, -0.011288641951978207, -0.35099664330482483, 0.07443445175886154, -0.4499436318874359, -0.020294636487960815, 0.2894108295440674, 0.16666580736637115, -0.049889951944351196, 0.1744612753391266, -0.2308470606803894, -0.29081645607948303, -0.24162326753139496, 0.061882879585027695, 0.29678604006767273, 0.42749616503715515, 0.018781639635562897, 0.08228780329227448, -0.26059937477111816, 0.18149174749851227, -0.2835628390312195, 0.1795375943183899, -0.3508412837982178, 0.3513074219226837, -0.5697329044342041, 0.024289056658744812, -0.1993202120065689, -0.4951821267604828, -0.08475039154291153, 0.24623161554336548, -0.06721904128789902, -0.11299334466457367, -0.11147016286849976, 0.20970399677753448, -0.1472044587135315, 0.4187183678150177, 0.01814723014831543, -0.07855124771595001, 0.4035297632217407, -0.15740366280078888, 0.3202415704727173, 0.4058288633823395, 0.025037281215190887, -0.006259624846279621, 0.8217065930366516, 0.42887288331985474, 0.035554490983486176, 0.26299843192100525, 0.13227267563343048, 0.24131445586681366, -0.05517422780394554, 0.21040502190589905, -0.3956785202026367, 0.2317918837070465, -0.06344890594482422, 0.1566241979598999, 0.40619874000549316, 0.4214394986629486, 0.4741017818450928, 0.060939062386751175, -0.3040882349014282, -0.0173012837767601, 0.4126374125480652, -0.12855271995067596, -0.28887200355529785, -0.08329653739929199, 0.1409212052822113, 0.22550971806049347, -0.22599659860134125, -0.24219287931919098, 0.28117620944976807, -0.2290140837430954, -0.005547311156988144, 0.05435137450695038, 0.22203633189201355, 0.08579927682876587, 0.18006271123886108, 0.22439634799957275, 0.49816834926605225, -0.10562796890735626, 0.04666801542043686, 0.276470810174942, 0.192426860332489, -0.05738360062241554, 0.03871391713619232, 0.03985130041837692, 0.15579746663570404, 0.09515528380870819, 0.056985944509506226, 0.18967436254024506, 0.48991888761520386, 0.05441552773118019, 0.22880935668945312, 0.15031760931015015, 0.015003630891442299, 0.10499446094036102, -0.17749947309494019, 0.19270643591880798, 0.3992927074432373, 0.032252900302410126, 0.0853511393070221, -0.165322408080101, -0.2925216555595398, -0.05814831331372261, 0.012448156252503395, 0.04801473394036293, -0.08387874066829681, -0.24414438009262085, -0.048103123903274536, 0.05990790203213692, -0.09752431511878967, -0.10101133584976196, 0.23499706387519836, 0.17463666200637817, 0.07910185307264328, 0.12495124340057373, 0.2082415223121643, 0.11633522808551788, 0.584922194480896, -0.16281884908676147, -0.20258840918540955, 0.1558219939470291, -0.1036192774772644, -0.01771208643913269, 0.2609419524669647, 0.020999599248170853, -0.020141836255788803, -0.1409984678030014, 0.5591748952865601, 0.5023330450057983, 0.008625654503703117, -0.01870723068714142, 0.002965737134218216, -0.07487484812736511, -0.08436603844165802, 0.22942233085632324, 0.24497589468955994, -0.0719907358288765, 0.1975143998861313, 0.015849195420742035, -0.06839244067668915, -0.08365347981452942, 0.2973405420780182, 0.5383641719818115, -0.35722413659095764, -0.10789154469966888, 0.10901790857315063, 0.28230294585227966, 0.04253431409597397, -0.13587422668933868, -0.31065237522125244, 0.08460406213998795, -0.02066855877637863, 0.09057250618934631, -0.1686849743127823, 0.17231304943561554, 0.1442042738199234, -0.03855903446674347, -0.20466089248657227, -0.2887263894081116, 0.030616767704486847, 0.14121568202972412, 0.02304374799132347, 0.2599111497402191, 0.3328443765640259, -0.3088465631008148, -0.010255560278892517, 0.14332564175128937, -0.2402012199163437, -0.31128281354904175, -0.05725279822945595, 0.5742354393005371, -0.28418606519699097, -0.22016926109790802, 0.24351061880588531, -0.33900463581085205, -0.08642216771841049, -0.18237373232841492, 0.26648738980293274, 0.39243295788764954, 0.007731299847364426, 0.06359092146158218, -0.03614814952015877, 0.4140426814556122, -0.00975959375500679, 0.5140839219093323, -0.14440476894378662, -0.2625229060649872, -0.13563129305839539, 0.05704493075609207, -0.1775294542312622, -0.18827120959758759, -0.21703360974788666, -0.623000979423523, -0.13517600297927856, 0.03242722153663635, 0.13006125390529633, 0.07459640502929688, -0.20307661592960358, 0.07678515464067459, 0.2338627725839615, 0.42008209228515625, -0.4343552887439728, -0.07527415454387665, -0.08449031412601471, -0.16412757337093353, 0.11008714884519577, 0.0699327290058136, 0.2009786069393158, 0.3866846263408661, -0.14244039356708527, -0.10860137641429901, 0.21068528294563293, 0.18214483559131622, -0.11365978419780731, -0.1639561951160431, 0.27908921241760254, 0.2206229567527771, -0.03332214802503586, -0.6424278020858765, -0.16049471497535706, 0.3328816294670105, 0.07954176515340805, -0.2809218466281891, 0.40517380833625793, 0.20830947160720825, -0.12421007454395294, -0.17573818564414978, 0.21252907812595367, 0.08195807784795761, -0.054199278354644775, 0.01551266759634018, -0.2348947525024414 ]
https://github.com/huggingface/datasets/issues/5045
Automatically revert to last successful commit to hub when a push_to_hub is interrupted
> Maybe push_to_hub be implemented as a single commit ? I think that would definitely be the way to go. Do you know the reasons why not implementing it like this in the first place ? I guess it is because of not been able to upload all at once with `huggingface_hub` but if there was another reason, please let me know. About pushing all at once, it seems to be a more and more requested feature. I have created this issue https://github.com/huggingface/huggingface_hub/issues/1085 recently but other discussions already happened in the past. The `moon-landing` team is working on it (cc @coyotte508). The `huggingface_hub` integration will come afterwards. For now, maybe it's best to wait for a proper implementation instead of creating a temporary workaround :)
**Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults
125
Automatically revert to last successful commit to hub when a push_to_hub is interrupted **Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults > Maybe push_to_hub be implemented as a single commit ? I think that would definitely be the way to go. Do you know the reasons why not implementing it like this in the first place ? I guess it is because of not been able to upload all at once with `huggingface_hub` but if there was another reason, please let me know. About pushing all at once, it seems to be a more and more requested feature. I have created this issue https://github.com/huggingface/huggingface_hub/issues/1085 recently but other discussions already happened in the past. The `moon-landing` team is working on it (cc @coyotte508). The `huggingface_hub` integration will come afterwards. For now, maybe it's best to wait for a proper implementation instead of creating a temporary workaround :)
[ -0.3658261299133301, -0.4249005913734436, -0.0063218530267477036, -0.21672146022319794, 0.08757202327251434, -0.3276037275791168, 0.04989784210920334, 0.3058956563472748, 0.1087958812713623, 0.4126579165458679, 0.2971027195453644, 0.060209281742572784, -0.16505025327205658, 0.4147825837135315, 0.02061360329389572, 0.21471235156059265, 0.07720731943845749, 0.26363620162010193, 0.16909848153591156, 0.01629168540239334, -0.03184535726904869, -0.1058235764503479, 0.1400865614414215, -0.059110283851623535, -0.325605571269989, 0.14123959839344025, 0.12599098682403564, 0.17486494779586792, 0.01991843618452549, -0.37386608123779297, 0.3881939649581909, 0.40667879581451416, 0.0006882678717374802, 0.24751576781272888, -0.00011932985944440588, -0.04880262538790703, 0.1934935748577118, -0.11607546359300613, -0.40516045689582825, -0.19475392997264862, -0.26589879393577576, -0.12663733959197998, -0.028929108753800392, -0.14201627671718597, 0.004591938108205795, 0.46522256731987, 0.20083723962306976, 0.15659736096858978, 0.46729928255081177, -0.16187268495559692, 0.11390440911054611, 0.13878479599952698, 0.1612945944070816, -0.20220519602298737, 0.07699821144342422, 0.484086811542511, 0.009526429697871208, 0.2873179018497467, 0.335783988237381, 0.05300317704677582, -0.15756213665008545, 0.22731928527355194, 0.14320537447929382, -0.2059440314769745, 0.22275149822235107, -0.2048100084066391, 0.08335138112306595, -0.17815108597278595, -0.18527841567993164, -0.10020550340414047, 0.14490753412246704, -0.535935640335083, -0.4326895773410797, -0.5453616976737976, 0.1729748696088791, -0.1584334820508957, -0.06928268820047379, -0.2668933570384979, -0.00558245275169611, 0.10756395757198334, -0.25253668427467346, -0.5220561623573303, -0.20608480274677277, -0.07789336144924164, -0.011533603072166443, -0.19529813528060913, -0.049683768302202225, 0.02397673949599266, 0.08309199661016464, 0.14086267352104187, -0.05993906781077385, 0.06470547616481781, 0.12371118366718292, -0.002892661839723587, -0.329816609621048, -0.4922712445259094, 0.0856846421957016, 0.1908159852027893, 0.34412434697151184, 0.3096832036972046, -0.0060048578307032585, 0.28621363639831543, -0.29837000370025635, -0.007592983543872833, 0.1437450349330902, 0.26329851150512695, 0.3443322777748108, -0.26687321066856384, 0.42396730184555054, 0.22909146547317505, 0.016801204532384872, 0.18573716282844543, 0.052700214087963104, 0.014344663359224796, 0.29351934790611267, 0.31712305545806885, 0.2566525340080261, -0.07466883957386017, -0.016980692744255066, 0.0578782856464386, 0.06037602573633194, 0.009615132585167885, -0.11091502755880356, 0.010465025901794434, 0.0641789510846138, 0.3178955018520355, -0.14236287772655487, -0.04491538554430008, -0.041843391954898834, 0.016349654644727707, -0.0945398136973381, -0.2179020196199417, -0.194624125957489, 0.40796345472335815, 0.3523234724998474, -0.6612669825553894, 0.04111555963754654, 0.10268217325210571, -0.09042243659496307, -0.09757925570011139, -0.3190890848636627, 0.1572853922843933, -0.13316309452056885, 0.03970743715763092, 0.04764685407280922, 0.1759982705116272, -0.049041565507650375, -0.07666316628456116, -0.3353850543498993, 0.18125435709953308, -0.35892584919929504, -0.523503303527832, 0.22410552203655243, 0.08057348430156708, -0.4288780689239502, 0.209039106965065, -0.5994043946266174, 0.063770592212677, -0.33876553177833557, 0.25137561559677124, 0.17620070278644562, 0.18962374329566956, -0.10054769366979599, -0.03374633565545082, 0.19292376935482025, 0.4981688857078552, 0.07526928186416626, -0.2270507514476776, 0.21580585837364197, -0.26586565375328064, -0.2767845094203949, -0.03883714601397514, -0.08301251381635666, 0.2450309693813324, -0.22821100056171417, 0.0014140084385871887, -0.028225280344486237, -0.5370515584945679, -0.3514363169670105, -0.25057360529899597, -0.45102185010910034, 0.15348723530769348, -0.4417227506637573, 0.27954259514808655, 0.1139996275305748, 0.034015264362096786, 0.16939745843410492, 0.30237311124801636, -0.06939329206943512, 0.11723334342241287, -0.28680935502052307, -0.3458768129348755, -0.2856737971305847, 0.33150139451026917, 0.13861466944217682, 0.2855311334133148, 0.2203144133090973, 0.3158148229122162, 0.09595978260040283, 0.17842744290828705, 0.13495482504367828, 0.10147874057292938, 0.43243762850761414, -0.3868759274482727, -0.062011994421482086, -0.4167160987854004, -0.518264651298523, 0.2749853730201721, 0.3482540547847748, -0.25231680274009705, -0.07163958251476288, -0.24649359285831451, -0.33346498012542725, -0.03895873576402664, -0.05109876021742821, 0.44566309452056885, 0.0035624541342258453, -0.1732730269432068, -0.14028817415237427, 0.15950563549995422, -0.4451916515827179, 0.47485238313674927, -0.25354093313217163, 0.3335520923137665, -0.3484407961368561, 0.46801960468292236, 0.055251117795705795, -0.27806520462036133, 0.041829124093055725, 0.1416546255350113, 0.24312502145767212, -0.2520923614501953, 0.16936594247817993, 0.3103852868080139, -0.1439017951488495, 0.673703670501709, 0.10756558179855347, 0.14544393122196198, 0.3193981647491455, 0.2539643943309784, -0.10298461467027664, -0.22414524853229523, -0.05074155330657959, -0.2330034375190735, -0.16252446174621582, 0.38676923513412476, -0.1571592539548874, 0.10169363766908646, 0.001961078494787216, -0.1781190186738968, -0.3255700170993805, -0.19323652982711792, -0.2884540557861328, -0.12942922115325928, 0.1444283425807953, 0.047825783491134644, -0.12910330295562744, -0.07451804727315903, -0.1762085258960724, 0.16919207572937012, 0.5017485618591309, -0.08007834851741791, -0.020652711391448975, 0.45852822065353394, -0.16423889994621277, 0.1079317256808281, 0.20843806862831116, 0.0979442298412323, 0.0668073445558548, -0.039684031158685684, -0.21047738194465637, 0.016300329938530922, 0.12797866761684418, 0.014851301908493042, -0.12228814512491226, 0.008909814059734344, 0.3832760453224182, 0.3221724033355713, 0.3193435072898865, 0.11410443484783173, -0.19853141903877258, -0.012787144631147385, -0.02257024124264717, 0.07281193882226944, -0.1351785659790039, -0.3521110713481903, -0.03159338980913162, -0.06533452123403549, -0.2100333720445633, -0.42622441053390503, -0.32701975107192993, -0.11703624576330185, 0.11279569566249847, 0.3026077151298523, -0.13996118307113647, 0.020220745354890823, 0.23913490772247314, 0.6900643110275269, -0.08628383278846741, -0.283984899520874, -0.11601529270410538, -0.118465855717659, 0.27113401889801025, -0.07921414077281952, -0.07789279520511627, -0.2457139641046524, 0.30546653270721436, -0.05643512308597565, 0.11705811321735382, -0.32419052720069885, -0.1772099733352661, 0.08429066836833954, -0.00787406787276268, -0.14919541776180267, 0.008100137114524841, 0.10051223635673523, 0.3361314535140991, -0.29901212453842163, 0.10627980530261993, -0.16800101101398468, -0.26003387570381165, 0.10304859280586243, 0.11685173213481903, 0.29745250940322876, -0.1301698088645935, 0.18258556723594666, 0.10904892534017563, -0.4103858470916748, 0.45200294256210327, 0.06473329663276672, 0.17820361256599426, 0.000024573877453804016, -0.024861305952072144, -0.17993691563606262, 0.04134930297732353, -0.3669394850730896, 0.0056937141343951225, -0.35776567459106445, 0.014157082885503769, -0.017839612439274788, 0.07517543435096741, 0.03468835726380348, 0.08590470999479294, -0.11699678003787994, 0.15368923544883728, -0.4460434913635254, -0.6532519459724426, -0.08879850059747696, 0.4413837492465973, -0.1409374326467514, -0.0936240553855896, 0.2742214798927307, 0.3518259525299072, -0.07375416904687881, 0.20035400986671448, -0.37719738483428955, 0.15048089623451233, 0.47115543484687805, 0.023485839366912842, 0.03332948312163353, -0.024032432585954666, 0.27743956446647644, 0.5398524403572083, 0.02499614655971527, -0.095857173204422, 0.12732763588428497, 0.3740241527557373, 0.08802136778831482, -0.18410980701446533, -0.153494194149971, 0.05277799814939499, -0.3367576003074646, 0.18764910101890564, 0.07771439850330353, 0.17261654138565063, 0.22570323944091797, -0.20442014932632446, -0.6013474464416504, -0.030643217265605927, -0.4860878586769104, -0.2612581253051758, -0.2824868857860565, -0.06090671569108963, -0.09367428719997406, -0.11843295395374298, -0.14440447092056274, -0.021601609885692596, 0.43429407477378845, 0.25694823265075684, 0.5943205952644348, -0.019145920872688293, -0.28054407238960266, -0.009914741851389408, -0.5574682354927063, -0.051101818680763245, -0.1857103705406189, -0.023196667432785034, 0.07596142590045929, 0.06098773330450058, -0.06763368844985962, -0.07919392734766006, 0.7673689126968384, 0.07938078045845032, 0.28831344842910767, -0.2850745618343353, -0.22207573056221008, -0.06839275360107422, -0.10329428315162659, 0.2365308403968811, 0.23527279496192932, 0.07989653199911118, 0.8172904253005981, -0.27819013595581055, -0.01778547093272209, -0.08091271668672562, 0.17247304320335388, -0.17704622447490692, -0.012255193665623665, 0.09655842185020447, 0.008474361151456833, -0.4094116687774658, 0.136455699801445, 0.028400352224707603, -0.018969092518091202, -0.15564613044261932, -0.2895910143852234, -0.021681899204850197, -0.05476180464029312, -0.14653480052947998, -0.20379137992858887, 0.05894757807254791, -0.12284217774868011, 0.20585598051548004, 0.22642658650875092, -0.02496553212404251, 0.2310083508491516, 0.32832109928131104, -0.004855804145336151, -0.1805121898651123, -0.07323334366083145, -0.07243461161851883, 0.10837072134017944, 0.6426860094070435, 0.2871883511543274, 0.7026863694190979, -0.04398253560066223, 0.16247551143169403, -0.7800528407096863, -0.09325029700994492, -0.06892253458499908, -0.01774800568819046, -0.48602503538131714, 0.07550207525491714, 0.39743444323539734, -0.28784605860710144, -0.06133183091878891, 0.22429676353931427, 0.6296458840370178, -0.16570399701595306, 0.2002003937959671, -0.01868823915719986, 1.111607551574707, 0.13387234508991241, 0.06517183780670166, -0.3353256583213806, -0.1894216388463974, 0.46235689520835876, -0.28389275074005127, 0.06031438708305359, -0.214969664812088, -0.26419177651405334, -0.07235673069953918, -0.044896308332681656, -0.24465861916542053, -0.0641891285777092, -0.237294003367424, 0.2958313524723053, 0.0675375908613205, 0.3739715814590454, -0.19104325771331787, 0.2892490029335022, -0.28693631291389465, -0.29624274373054504, -0.21082180738449097, 0.07617416977882385, -0.06994166970252991, 0.5187188982963562, -0.146584153175354, -0.12562143802642822, 0.3005151152610779, 0.06230586767196655, -0.43217188119888306, -0.06485059857368469, 0.013168437406420708, -0.3230821490287781, -0.0025450512766838074, -0.2673226594924927, 0.123776376247406, -0.14559660851955414, 0.7403772473335266, 0.2703096866607666, -0.314606249332428, 0.030431266874074936, -0.1864815354347229, 0.33582913875579834, -0.09947823733091354, -0.20241227746009827, 0.4234313666820526, -0.13147419691085815, -0.3345596194267273, 0.11356517672538757, 0.11367696523666382, -0.4822940230369568, -0.1355973780155182, 0.006888791918754578, -0.15910077095031738, 0.015819139778614044, 0.07004426419734955, 0.25086790323257446, 0.09616634249687195, -0.3191576302051544, 0.026646265760064125, 0.1311057060956955, 0.09573276340961456, 0.13287530839443207, 0.004027761518955231, -0.018426746129989624, 0.002088533714413643, 0.4305446445941925, -0.12911978363990784, -0.4895339608192444, -0.027352280914783478, -0.1351737380027771, -0.19428011775016785, -0.03299757093191147, -0.2867548167705536, 0.15112663805484772, -0.4854845702648163, 0.09174397587776184, -0.3342018127441406, 0.09657692909240723, 0.12506763637065887, 0.20350219309329987, 0.08441641926765442, 0.0554819218814373, -0.09093724191188812, -0.2168351411819458, -0.2710898220539093, 0.13674984872341156, 0.2605227530002594, 0.4129354655742645, 0.15076446533203125, 0.07198114693164825, -0.1371065080165863, 0.2407776415348053, -0.2840617597103119, 0.21015837788581848, -0.27821826934814453, 0.22999419271945953, -0.4113529324531555, -0.09447678178548813, -0.09119392186403275, -0.3943438231945038, -0.07325660437345505, 0.2688961327075958, -0.172920361161232, -0.08045092225074768, -0.14761130511760712, 0.2200782746076584, -0.05999542772769928, 0.2909940779209137, -0.00401283847168088, -0.06999191641807556, 0.32740992307662964, -0.16807250678539276, 0.428816556930542, 0.37758609652519226, 0.04192895442247391, -0.07251680642366409, 0.7498601078987122, 0.43939825892448425, 0.04101455211639404, 0.2121349275112152, 0.24718447029590607, 0.3870750665664673, 0.0031487992964684963, 0.12334743142127991, -0.4630764424800873, 0.1971893012523651, -0.1277438998222351, 0.22042948007583618, 0.5171991586685181, 0.3030921518802643, 0.34387630224227905, 0.049759283661842346, -0.3254706859588623, -0.15833081305027008, 0.5298376083374023, -0.10473521053791046, -0.31373682618141174, -0.0195583738386631, 0.15256014466285706, 0.17125511169433594, -0.1238132193684578, -0.17051216959953308, 0.23325644433498383, -0.23369452357292175, -0.02878650091588497, 0.1959621012210846, 0.30589359998703003, 0.17168915271759033, 0.23300403356552124, 0.14729052782058716, 0.4901184141635895, -0.07328896969556808, -0.018827680498361588, 0.02465973049402237, 0.15066419541835785, -0.14051039516925812, 0.1646929234266281, 0.17249974608421326, 0.1601853221654892, 0.09324784576892853, -0.03793969005346298, 0.20758257806301117, 0.26780903339385986, 0.027348119765520096, 0.23280763626098633, 0.05232089385390282, 0.14128313958644867, 0.08302208036184311, -0.09765899181365967, 0.08187844604253769, 0.3133668899536133, 0.18573249876499176, -0.07816527783870697, -0.2654804289340973, -0.21427766978740692, 0.028611114248633385, 0.1070019006729126, 0.10532216727733612, 0.06569921970367432, -0.16474801301956177, -0.14535316824913025, 0.12942960858345032, -0.1275346875190735, -0.21220235526561737, 0.20999297499656677, 0.23145034909248352, 0.10190197825431824, -0.008336039260029793, 0.07541216909885406, 0.17169734835624695, 0.7202063202857971, -0.09786639362573624, -0.03322615474462509, 0.1847863793373108, -0.03054455667734146, -0.0543024055659771, 0.2925051152706146, 0.049013543874025345, -0.009882118552923203, -0.08337496221065521, 0.6041007041931152, 0.42881184816360474, 0.06614477932453156, 0.06256648898124695, -0.055988527834415436, -0.10681435465812683, -0.0479387529194355, 0.2127326875925064, 0.2024133801460266, -0.06879013776779175, 0.0927821546792984, -0.056633297353982925, -0.0018976330757141113, -0.2424655705690384, 0.2889172434806824, 0.2615227997303009, -0.26274099946022034, -0.1649712324142456, 0.03726940602064133, 0.06889013200998306, -0.0153149189427495, -0.20207634568214417, -0.2576758563518524, 0.08709938824176788, -0.10516874492168427, 0.08366011083126068, -0.13826888799667358, 0.17844343185424805, 0.24472156167030334, 0.010528601706027985, -0.15997357666492462, -0.26867473125457764, -0.018591586500406265, 0.10203284025192261, 0.20687666535377502, 0.40129467844963074, 0.32529157400131226, -0.3146530091762543, -0.19466957449913025, 0.07400597631931305, -0.17570005357265472, -0.3288313150405884, 0.005878171883523464, 0.38660213351249695, -0.24247244000434875, -0.058733854442834854, 0.2064674347639084, -0.36371782422065735, -0.06304734945297241, -0.047610342502593994, 0.33373475074768066, 0.2354004830121994, -0.03991393372416496, -0.025761432945728302, 0.1181313693523407, 0.24636870622634888, -0.14782851934432983, 0.5102270841598511, -0.16257701814174652, -0.3079310655593872, -0.12236093729734421, -0.1377680003643036, -0.098828986287117, -0.20544956624507904, -0.25728335976600647, -0.5026917457580566, -0.16173522174358368, 0.17763574421405792, 0.09626588970422745, -0.20048865675926208, -0.24799908697605133, 0.14040642976760864, 0.21397359669208527, 0.22854039072990417, -0.23652544617652893, -0.07672061026096344, -0.0679689571261406, -0.1284482181072235, 0.24581585824489594, 0.14032016694545746, 0.1842445433139801, 0.32672303915023804, -0.3013177514076233, -0.11789844930171967, 0.24716585874557495, 0.23341667652130127, -0.061102259904146194, -0.07994023710489273, 0.35939711332321167, 0.2160341441631317, -0.13778002560138702, -0.7643287777900696, -0.13595010340213776, 0.23287680745124817, 0.07063736021518707, -0.20139960944652557, 0.5121364593505859, 0.0005345921963453293, -0.16900217533111572, -0.14653053879737854, 0.10341208428144455, 0.13584958016872406, -0.054615795612335205, 0.15443800389766693, -0.23435242474079132 ]
https://github.com/huggingface/datasets/issues/5045
Automatically revert to last successful commit to hub when a push_to_hub is interrupted
> I think that would definitely be the way to go. Do you know the reasons why not implementing it like this in the first place ? I guess it is because of not been able to upload all at once with huggingface_hub but if there was another reason, please let me know. Ideally we would want to upload the files iteratively - and then once everything is uploaded we proceed to commit. When we implemented `push_to_hub`, using `upload_file` for each shard was the only option. For more context: for each shard to upload we do: 1. load the arrow shard in memory 2. convert to parquet 3. upload So to avoid OOM we need to upload the files iteratively. > For now, maybe it's best to wait for a proper implementation instead of creating a temporary workaround :) Let us know if we can help !
**Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults
147
Automatically revert to last successful commit to hub when a push_to_hub is interrupted **Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults > I think that would definitely be the way to go. Do you know the reasons why not implementing it like this in the first place ? I guess it is because of not been able to upload all at once with huggingface_hub but if there was another reason, please let me know. Ideally we would want to upload the files iteratively - and then once everything is uploaded we proceed to commit. When we implemented `push_to_hub`, using `upload_file` for each shard was the only option. For more context: for each shard to upload we do: 1. load the arrow shard in memory 2. convert to parquet 3. upload So to avoid OOM we need to upload the files iteratively. > For now, maybe it's best to wait for a proper implementation instead of creating a temporary workaround :) Let us know if we can help !
[ -0.5348613262176514, -0.31370609998703003, 0.038736533373594284, -0.25577032566070557, 0.015381718054413795, -0.3755161464214325, 0.08382456749677658, 0.31598690152168274, -0.018812939524650574, 0.42596060037612915, 0.34443020820617676, 0.11366371810436249, -0.08638172596693039, 0.3823527991771698, 0.05699414759874344, 0.2269344925880432, 0.08419828861951828, 0.323388934135437, 0.07986708730459213, -0.03491026908159256, 0.07283817231655121, -0.08384530246257782, 0.09462465345859528, -0.04035772383213043, -0.3725564181804657, 0.1672506332397461, 0.03033261187374592, 0.23099449276924133, -0.040092773735523224, -0.29732203483581543, 0.34536439180374146, 0.37037333846092224, 0.04784645140171051, 0.13513144850730896, -0.0001228354376507923, -0.00033930689096450806, 0.2691345810890198, -0.19352832436561584, -0.3129127621650696, -0.12775196135044098, -0.41022855043411255, -0.14273038506507874, -0.13509339094161987, -0.22263827919960022, 0.11191659420728683, 0.5555291175842285, 0.24469153583049774, 0.19408097863197327, 0.37192898988723755, -0.19375456869602203, 0.07411082088947296, 0.09991274029016495, 0.2469279021024704, -0.1787906289100647, 0.2092011570930481, 0.3999216556549072, -0.009692678228020668, 0.20183148980140686, 0.2031461000442505, 0.020664511248469353, -0.31474417448043823, 0.3018397092819214, 0.1485918015241623, -0.18992763757705688, 0.14424821734428406, -0.0790797546505928, 0.15785638988018036, -0.04162271320819855, -0.2307989001274109, -0.023709014058113098, 0.20378649234771729, -0.5078984498977661, -0.33706748485565186, -0.48412832617759705, 0.15202519297599792, -0.22091910243034363, -0.04113144427537918, -0.2510835528373718, -0.012213008478283882, 0.16620667278766632, -0.13642217218875885, -0.5426731705665588, -0.23708777129650116, 0.0029751136898994446, 0.003816954791545868, -0.35079288482666016, 0.08094456046819687, 0.05477798730134964, 0.11116048693656921, 0.15094533562660217, 0.0012821415439248085, 0.029389066621661186, -0.0123249851167202, -0.017175279557704926, -0.4136807322502136, -0.451061874628067, 0.0517042800784111, 0.2501354217529297, 0.35633307695388794, 0.3232465386390686, 0.0686345025897026, 0.3331940174102783, -0.2810435891151428, 0.03086243011057377, 0.11605420708656311, 0.30420756340026855, 0.4458378553390503, -0.2271486222743988, 0.2943391799926758, 0.2606920897960663, -0.039766162633895874, 0.15745878219604492, 0.11051221191883087, -0.05838368833065033, 0.3973890244960785, 0.30390727519989014, 0.2584996819496155, -0.028456848114728928, 0.0738665983080864, 0.10779620707035065, 0.1288648545742035, -0.020653843879699707, -0.11246944218873978, 0.046423155814409256, 0.09601711481809616, 0.19035235047340393, -0.22645606100559235, -0.09101016819477081, -0.08517090976238251, -0.08998314291238785, -0.09234324842691422, -0.1704593449831009, -0.2445930540561676, 0.39394229650497437, 0.3037504255771637, -0.5193387866020203, -0.02683958038687706, 0.005716261453926563, -0.0014269575476646423, -0.015958338975906372, -0.3317134380340576, 0.12961915135383606, -0.013923712074756622, 0.08134453743696213, 0.019972175359725952, 0.03518984466791153, -0.04357412829995155, -0.19944287836551666, -0.29803916811943054, 0.25889748334884644, -0.498607873916626, -0.5948008298873901, 0.18780122697353363, 0.06073033809661865, -0.44299763441085815, 0.16307124495506287, -0.7794891595840454, 0.03924103081226349, -0.34503230452537537, 0.06278395652770996, 0.08368341624736786, 0.09132588654756546, -0.08585608005523682, -0.03197097033262253, 0.19749665260314941, 0.4733007550239563, -0.014245947822928429, -0.16337567567825317, 0.1232086643576622, -0.251151978969574, -0.21424251794815063, -0.07408344745635986, -0.051589485257864, 0.12311479449272156, -0.21514692902565002, 0.2062295526266098, 0.1478026807308197, -0.49819645285606384, -0.49082931876182556, -0.30620715022087097, -0.372666597366333, 0.08634597063064575, -0.457136869430542, 0.2873268127441406, 0.21381400525569916, 0.06900389492511749, -0.0376601442694664, 0.22585220634937286, -0.04070744663476944, 0.0613710880279541, -0.2398025542497635, -0.2661148011684418, -0.4810866117477417, 0.305959016084671, 0.22484339773654938, 0.34811103343963623, 0.3260571360588074, 0.24780158698558807, 0.1454339325428009, 0.20050033926963806, 0.19702112674713135, 0.024531826376914978, 0.5070973038673401, -0.47894948720932007, 0.04579486697912216, -0.37295737862586975, -0.5485325455665588, 0.29821497201919556, 0.28844356536865234, -0.20754221081733704, -0.1668316274881363, -0.1593574434518814, -0.2860695719718933, -0.02957374043762684, -0.07582378387451172, 0.5572341680526733, -0.004628833383321762, -0.19862419366836548, -0.20660071074962616, 0.09900373220443726, -0.39907535910606384, 0.3372097611427307, -0.32827332615852356, 0.25179383158683777, -0.28768983483314514, 0.5484585762023926, 0.12425484508275986, -0.33420708775520325, -0.05216865986585617, 0.04212922975420952, 0.24597960710525513, -0.23927682638168335, 0.1750836968421936, 0.3596198260784149, -0.09528389573097229, 0.6790225505828857, 0.12193572521209717, 0.2289574146270752, 0.24814394116401672, 0.19109854102134705, -0.09981735795736313, -0.3559432029724121, -0.05492964759469032, -0.2114173173904419, -0.1476946473121643, 0.293891966342926, -0.14884614944458008, 0.15982653200626373, -0.07841033488512039, -0.14144055545330048, -0.23102404177188873, -0.26775169372558594, -0.27582672238349915, -0.17478886246681213, 0.08723916858434677, 0.13360317051410675, -0.28596431016921997, -0.07756850123405457, -0.10770431160926819, 0.21652354300022125, 0.5838701128959656, -0.15962688624858856, 0.04070909321308136, 0.4544784724712372, -0.071384958922863, 0.11085399240255356, 0.25589627027511597, 0.24643291532993317, 0.072378009557724, -0.04412347823381424, -0.12117122113704681, 0.020634479820728302, 0.015850793570280075, 0.032518479973077774, -0.09617456048727036, -0.0023482590913772583, 0.49989548325538635, 0.41331568360328674, 0.3024856448173523, 0.05576334148645401, -0.25513896346092224, -0.15399649739265442, 0.024965910241007805, 0.12278532981872559, -0.08550212532281876, -0.37559518218040466, -0.21813614666461945, 0.13356974720954895, -0.13425800204277039, -0.30072280764579773, -0.3021763861179352, -0.12836003303527832, 0.11250356584787369, 0.35617882013320923, -0.20007938146591187, 0.05326509475708008, 0.2848774194717407, 0.609424889087677, -0.011430935934185982, -0.2801719903945923, -0.15985864400863647, -0.17570585012435913, 0.2561565041542053, -0.10341000556945801, 0.04014909639954567, -0.23040474951267242, 0.2047004997730255, -0.15336570143699646, 0.14666679501533508, -0.35930177569389343, -0.11131608486175537, 0.18264134228229523, 0.002884436398744583, -0.0669306069612503, -0.0013970062136650085, 0.11935564130544662, 0.19407394528388977, -0.24844759702682495, 0.12022332847118378, -0.14735665917396545, -0.3205965757369995, 0.23733878135681152, 0.08027447015047073, 0.2891013026237488, -0.05331844836473465, 0.1911754608154297, 0.16457663476467133, -0.35484015941619873, 0.3050243854522705, 0.13061290979385376, 0.236994668841362, -0.05124606564640999, 0.021417781710624695, -0.17405332624912262, -0.04977653920650482, -0.38264232873916626, 0.04438267648220062, -0.383831650018692, 0.14411360025405884, -0.030052801594138145, 0.06336787343025208, 0.09017330408096313, -0.022433331236243248, -0.08375155925750732, 0.25043123960494995, -0.45935481786727905, -0.5043969750404358, -0.010479660704731941, 0.38219645619392395, -0.19290827214717865, -0.13939619064331055, 0.3706809878349304, 0.3441140949726105, -0.028260566294193268, 0.18569669127464294, -0.21986104547977448, 0.15206633508205414, 0.5833989977836609, 0.10978198051452637, 0.04193737730383873, 0.08725561201572418, 0.30751344561576843, 0.6082648038864136, -0.20363716781139374, -0.07219679653644562, 0.20752297341823578, 0.3256775438785553, 0.004549466073513031, -0.2568005919456482, -0.02302831970155239, -0.033919256180524826, -0.3534332811832428, 0.08629262447357178, -0.038332000374794006, 0.08087228238582611, 0.09687618911266327, -0.13215532898902893, -0.5990386009216309, -0.01549697108566761, -0.5097255706787109, -0.1808106005191803, -0.2931586503982544, -0.03497561812400818, -0.03508451581001282, -0.1354110836982727, -0.13954958319664001, -0.04903659597039223, 0.4240240752696991, 0.3111572861671448, 0.6156298518180847, 0.00047467133845202625, -0.3172290027141571, 0.03344021737575531, -0.45219099521636963, -0.04490561783313751, -0.15870262682437897, -0.08007307350635529, 0.0812760591506958, -0.039323776960372925, -0.07077185809612274, -0.10269426554441452, 0.6993871331214905, 0.03298439085483551, 0.33492982387542725, -0.26086047291755676, -0.12208771705627441, 0.007769355550408363, -0.2163400799036026, 0.2428782880306244, 0.22106356918811798, -0.026155199855566025, 0.7414140701293945, -0.2853372097015381, 0.09582438319921494, -0.07719714939594269, 0.0634639635682106, -0.23913949728012085, -0.06443680822849274, 0.10149568319320679, 0.10442391782999039, -0.44418099522590637, 0.14145201444625854, 0.016375800594687462, 0.033716700971126556, -0.18009477853775024, -0.21966372430324554, -0.07552038878202438, -0.04252878576517105, -0.17950473725795746, -0.16785253584384918, 0.07444220036268234, -0.11168581247329712, 0.18091265857219696, 0.08904585242271423, 0.041873473674058914, 0.2653954029083252, 0.219394251704216, 0.06907866895198822, -0.09152744710445404, -0.07310767471790314, -0.1335344910621643, 0.1517040729522705, 0.4727312922477722, 0.2445884495973587, 0.6258405447006226, -0.06333640217781067, 0.0700390636920929, -0.7317873239517212, -0.12619759142398834, -0.11728973686695099, -0.024710047990083694, -0.46603915095329285, 0.18749572336673737, 0.5177103877067566, -0.45113420486450195, -0.1179753988981247, 0.19982001185417175, 0.7338230013847351, -0.14848840236663818, 0.34970545768737793, 0.04514729976654053, 1.1383004188537598, 0.08280716091394424, 0.05438027158379555, -0.30179890990257263, -0.08324035257101059, 0.40459108352661133, -0.28218233585357666, 0.07034692168235779, -0.18962876498699188, -0.2945810854434967, -0.1177239939570427, -0.05847400054335594, -0.18222463130950928, 0.13080760836601257, -0.2579401135444641, 0.2828822135925293, 0.1324509233236313, 0.38529402017593384, -0.1810600757598877, 0.20221365988254547, -0.3054297864437103, -0.2898135781288147, -0.13645794987678528, 0.025879524648189545, -0.009253278374671936, 0.3421352207660675, -0.16539138555526733, -0.08003340661525726, 0.2518443465232849, 0.1472957581281662, -0.3680601716041565, 0.000049754977226257324, 0.15319910645484924, -0.27522408962249756, -0.021198943257331848, -0.3989129662513733, 0.06275469064712524, -0.044428352266550064, 0.5750153064727783, 0.24615705013275146, -0.29128125309944153, 0.11382792890071869, -0.12183231860399246, 0.35202229022979736, -0.020961567759513855, -0.3246304988861084, 0.41537928581237793, -0.13131733238697052, -0.4220821261405945, 0.057716112583875656, 0.09357115626335144, -0.5596901178359985, -0.07746928185224533, -0.006390787661075592, -0.03184118866920471, 0.06734123826026917, 0.023014836013317108, 0.221612811088562, 0.0027813948690891266, -0.27729707956314087, 0.0029950719326734543, 0.18752354383468628, 0.07664483785629272, 0.20239129662513733, 0.02247019298374653, 0.014641821384429932, 0.08523471653461456, 0.4019047021865845, -0.14437121152877808, -0.31375327706336975, -0.014170695096254349, -0.16986685991287231, -0.19676990807056427, -0.014989811927080154, -0.26350000500679016, 0.1720948964357376, -0.468727171421051, -0.03685760125517845, -0.37194573879241943, 0.14148978888988495, 0.10417445749044418, 0.17868921160697937, 0.03275240585207939, 0.11568598449230194, -0.2133907526731491, -0.2585986256599426, -0.24614949524402618, 0.15041488409042358, 0.20990897715091705, 0.3782636523246765, 0.18735262751579285, -0.008862758055329323, -0.20295467972755432, 0.2419992983341217, -0.2434924989938736, 0.2606935203075409, -0.26725876331329346, 0.35581445693969727, -0.3535565733909607, 0.024858703836798668, -0.10651331394910812, -0.4734644591808319, -0.09888294339179993, 0.33999526500701904, -0.1552719920873642, -0.05244109779596329, -0.13757701218128204, 0.21411770582199097, -0.08045531809329987, 0.43743008375167847, -0.10139965265989304, -0.10890741646289825, 0.305050790309906, -0.19999560713768005, 0.32413020730018616, 0.3380802869796753, 0.025387100875377655, -0.05923496559262276, 0.922021210193634, 0.35119134187698364, -0.03033394366502762, 0.19791969656944275, 0.23772551119327545, 0.3052321672439575, -0.07119502127170563, 0.21262268722057343, -0.4946760833263397, 0.2143641710281372, 0.007016435265541077, 0.1878286898136139, 0.4686557650566101, 0.24955719709396362, 0.48610177636146545, 0.026341326534748077, -0.31643885374069214, -0.23740501701831818, 0.6070176362991333, -0.14444538950920105, -0.2661588191986084, -0.1298363357782364, 0.16141295433044434, 0.15632688999176025, -0.16467580199241638, -0.3179016411304474, 0.3662657141685486, -0.1288829743862152, -0.025289347395300865, 0.058352403342723846, 0.23612365126609802, 0.12331399321556091, 0.13189268112182617, 0.19008216261863708, 0.37867605686187744, -0.24154014885425568, -0.10340607166290283, -0.029131513088941574, 0.02791459485888481, -0.02583559975028038, 0.21388709545135498, 0.009752187877893448, 0.14303603768348694, 0.1534055769443512, -0.0496615394949913, 0.23969364166259766, 0.28219014406204224, 0.1160990446805954, 0.22293782234191895, -0.01532263495028019, 0.02689322829246521, 0.1244889423251152, -0.031290456652641296, 0.1636674404144287, 0.2990538477897644, 0.1453256905078888, 0.19863452017307281, -0.138816237449646, -0.2957797646522522, -0.04466361179947853, 0.07689164578914642, 0.032202839851379395, -0.014529863372445107, -0.20714899897575378, -0.100645050406456, 0.06895706057548523, -0.1116887778043747, -0.11996783316135406, 0.23779819905757904, 0.2872747778892517, 0.16375312209129333, 0.20436009764671326, 0.08055439591407776, 0.15519589185714722, 0.677666962146759, -0.18473787605762482, -0.09923367947340012, 0.12978385388851166, -0.05664391815662384, -0.024430815130472183, 0.23534728586673737, 0.01645667850971222, -0.10954388976097107, 0.0009030364453792572, 0.6090216636657715, 0.43698811531066895, 0.06641793251037598, -0.008881913498044014, -0.009848743677139282, -0.06223045289516449, -0.016710955649614334, 0.2657349705696106, 0.1699448674917221, -0.07318990677595139, 0.07205542922019958, 0.06501219421625137, 0.03195638209581375, -0.2338007092475891, 0.17857998609542847, 0.37435710430145264, -0.30801740288734436, -0.13157641887664795, 0.10399314761161804, 0.12289392203092575, -0.04113095626235008, -0.07131233811378479, -0.3807711601257324, 0.04651153087615967, -0.12398142367601395, 0.05833966284990311, -0.18834933638572693, 0.22222235798835754, 0.17615102231502533, -0.02038378268480301, -0.22284840047359467, -0.2828137278556824, -0.0980309545993805, 0.13902325928211212, 0.18369139730930328, 0.4263661205768585, 0.41294461488723755, -0.1484239250421524, -0.09192883223295212, 0.10472764819860458, -0.07410147786140442, -0.3765905499458313, -0.17990320920944214, 0.5708885192871094, -0.23772390186786652, -0.1006874293088913, 0.17531821131706238, -0.4162878096103668, -0.12066556513309479, -0.09474784135818481, 0.3733549416065216, 0.3486863970756531, -0.04860943183302879, 0.05144571512937546, 0.05495364964008331, 0.2878798544406891, -0.14209844172000885, 0.4958762228488922, -0.14059433341026306, -0.27598288655281067, -0.18607103824615479, -0.0303511880338192, -0.09966468811035156, -0.2720146179199219, -0.2018643617630005, -0.48336872458457947, -0.22544550895690918, 0.20532222092151642, 0.14943978190422058, -0.00005222484469413757, -0.20661622285842896, 0.085301473736763, 0.20935551822185516, 0.29661110043525696, -0.4087130129337311, -0.11095336079597473, -0.0453345961868763, -0.10835473239421844, 0.14608637988567352, 0.08935725688934326, 0.24478745460510254, 0.3445291817188263, -0.18834775686264038, -0.14085902273654938, 0.2614946961402893, 0.1419232338666916, -0.024049699306488037, -0.044479191303253174, 0.29872915148735046, 0.27267295122146606, -0.0371863916516304, -0.6739285588264465, -0.21115145087242126, 0.2433878779411316, 0.09534433484077454, -0.21454335749149323, 0.4039159119129181, 0.08226270973682404, -0.09083925187587738, -0.18330173194408417, 0.15539424121379852, 0.07624094188213348, -0.05651722103357315, 0.048177916556596756, -0.32499849796295166 ]
https://github.com/huggingface/datasets/issues/5045
Automatically revert to last successful commit to hub when a push_to_hub is interrupted
> Ideally we would want to upload the files iteratively - and then once everything is uploaded we proceed to commit. Oh I see. So maybe this has to be done in an implementation specific to `datasets/` as it is not a very common case (upload a bunch of files on the fly). You can maybe have a look at how `huggingface_hub` is implemented for LFS files (arrow shards are LFS anyway, right?). In [`upload_lfs_files`](https://github.com/huggingface/huggingface_hub/blob/e28646c977fc9304a4c3576ce61ff07f9778950b/src/huggingface_hub/_commit_api.py#L164) LFS files are uploaded 1 by 1 (multithreaded) and then [the commit is pushed](https://github.com/huggingface/huggingface_hub/blob/e28646c977fc9304a4c3576ce61ff07f9778950b/src/huggingface_hub/hf_api.py#L1926) to the Hub once all files have been uploaded. This is pretty much what you need, right ? I can help you if you have questions how to do it in `datasets`. If that makes sense we could then move the implementation from `datasets` to `huggingface_hub` once it's mature. Next week I'm on holidays but feel free to start without my input. (also cc @coyotte508 and @SBrandeis who implemented LFS upload in `hfh`)
**Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults
162
Automatically revert to last successful commit to hub when a push_to_hub is interrupted **Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults > Ideally we would want to upload the files iteratively - and then once everything is uploaded we proceed to commit. Oh I see. So maybe this has to be done in an implementation specific to `datasets/` as it is not a very common case (upload a bunch of files on the fly). You can maybe have a look at how `huggingface_hub` is implemented for LFS files (arrow shards are LFS anyway, right?). In [`upload_lfs_files`](https://github.com/huggingface/huggingface_hub/blob/e28646c977fc9304a4c3576ce61ff07f9778950b/src/huggingface_hub/_commit_api.py#L164) LFS files are uploaded 1 by 1 (multithreaded) and then [the commit is pushed](https://github.com/huggingface/huggingface_hub/blob/e28646c977fc9304a4c3576ce61ff07f9778950b/src/huggingface_hub/hf_api.py#L1926) to the Hub once all files have been uploaded. This is pretty much what you need, right ? I can help you if you have questions how to do it in `datasets`. If that makes sense we could then move the implementation from `datasets` to `huggingface_hub` once it's mature. Next week I'm on holidays but feel free to start without my input. (also cc @coyotte508 and @SBrandeis who implemented LFS upload in `hfh`)
[ -0.5546017289161682, -0.16547493636608124, 0.006455536931753159, -0.1427696794271469, 0.022968517616391182, -0.258360356092453, 0.06754394620656967, 0.32462063431739807, 0.07754281163215637, 0.2990718483924866, 0.24885298311710358, 0.17172139883041382, -0.17607930302619934, 0.2414623349905014, -0.012743479572236538, 0.23787134885787964, -0.06234309822320938, 0.27574050426483154, 0.06446728855371475, -0.07147389650344849, 0.004503067582845688, -0.14757564663887024, 0.1458006650209427, -0.09865275025367737, -0.3404361605644226, 0.11347092688083649, 0.08062396198511124, 0.24710121750831604, 0.052567094564437866, -0.2925834059715271, 0.30536752939224243, 0.3331063985824585, -0.02232222631573677, 0.22772735357284546, -0.00011708713282132521, 0.00040924549102783203, 0.27584898471832275, -0.1655120849609375, -0.48088499903678894, -0.23558838665485382, -0.4354436695575714, -0.27508705854415894, -0.07179778814315796, -0.1967342495918274, 0.09339102357625961, 0.28119683265686035, 0.20564152300357819, 0.05650089681148529, 0.4553987979888916, -0.20847584307193756, 0.12277747690677643, 0.07173946499824524, 0.21719421446323395, -0.07417765259742737, 0.21811369061470032, 0.4106283187866211, 0.04935963451862335, 0.18259114027023315, 0.08310297131538391, -0.03673919290304184, -0.30312398076057434, 0.3208314776420593, 0.14372515678405762, -0.1925487220287323, 0.18735787272453308, -0.16581769287586212, -0.08290524035692215, -0.11222213506698608, -0.25304415822029114, 0.06101052835583687, 0.24393415451049805, -0.5966530442237854, -0.44024956226348877, -0.5927343368530273, 0.16768985986709595, -0.16239877045154572, -0.10328312963247299, -0.18716561794281006, 0.041947782039642334, 0.03936883807182312, -0.07278604805469513, -0.5811381340026855, -0.16062647104263306, -0.04533261060714722, 0.022262178361415863, -0.12815073132514954, 0.105030857026577, 0.0900358110666275, 0.11614328622817993, 0.13717475533485413, -0.053698763251304626, 0.0238896943628788, -0.04840804263949394, 0.09683234244585037, -0.5009793639183044, -0.369450181722641, 0.032777007669210434, 0.1417282670736313, 0.20551788806915283, 0.2589724063873291, 0.02005220577120781, 0.2603420913219452, -0.31488358974456787, 0.0889596939086914, 0.1672798991203308, 0.17468762397766113, 0.5080252885818481, -0.06264814734458923, 0.35229694843292236, 0.1471765637397766, -0.0864940732717514, 0.17611709237098694, 0.04975501447916031, -0.14132308959960938, 0.3436938524246216, 0.29828768968582153, 0.19801001250743866, 0.03845393285155296, -0.05886489152908325, 0.13301576673984528, 0.060624778270721436, -0.00021068193018436432, -0.03914535418152809, -0.01876939833164215, 0.10605880618095398, 0.22872406244277954, -0.13939526677131653, -0.12895597517490387, -0.009299741126596928, 0.05758706107735634, -0.09999674558639526, -0.22890867292881012, -0.18908222019672394, 0.3353145718574524, 0.2698327898979187, -0.4847829341888428, -0.02383062057197094, -0.042368289083242416, -0.2395610362291336, -0.07759183645248413, -0.14761996269226074, 0.0850355476140976, -0.08359315246343613, 0.06686464697122574, -0.0039170123636722565, 0.06966535747051239, 0.009542342275381088, -0.1689581573009491, -0.2854706645011902, 0.23215538263320923, -0.48181796073913574, -0.39797115325927734, 0.16203279793262482, 0.11205995082855225, -0.41526150703430176, 0.1914384514093399, -0.6528773903846741, 0.07354234158992767, -0.33187681436538696, 0.1220090389251709, 0.2755885124206543, 0.07040415704250336, -0.046732041984796524, 0.015388192608952522, 0.14256106317043304, 0.5343683362007141, -0.10037188231945038, -0.29157453775405884, 0.09632989764213562, -0.27527013421058655, -0.34518322348594666, -0.010573316365480423, -0.10546566545963287, 0.14131146669387817, -0.16595786809921265, 0.2406225949525833, 0.25588515400886536, -0.5227936506271362, -0.4600065052509308, -0.2064163088798523, -0.34524208307266235, 0.0851568952202797, -0.5471476912498474, 0.3799586892127991, 0.11821272224187851, 0.035603057593107224, -0.11616972088813782, 0.24351349472999573, 0.02614790014922619, -0.043821316212415695, -0.20467409491539001, -0.3055925965309143, -0.47433507442474365, 0.27199849486351013, 0.1973651945590973, 0.1746888905763626, 0.37712445855140686, 0.2880537509918213, 0.20767509937286377, 0.1967761218547821, 0.2239387035369873, 0.18124991655349731, 0.5831384658813477, -0.3247449994087219, 0.07058188319206238, -0.40656861662864685, -0.5618939399719238, 0.280557245016098, 0.27209222316741943, -0.3362538516521454, -0.22590212523937225, -0.20268796384334564, -0.281724750995636, 0.036881864070892334, -0.08181288838386536, 0.5286717414855957, 0.04350636899471283, -0.2807018458843231, -0.2811795771121979, 0.08812960982322693, -0.32923439145088196, 0.3837886452674866, -0.3509848415851593, 0.2807517945766449, -0.27695122361183167, 0.5028408169746399, 0.23457366228103638, -0.3045157492160797, -0.04074540734291077, 0.11270247399806976, 0.16959357261657715, -0.22141064703464508, 0.13550031185150146, 0.450315922498703, -0.05486403778195381, 0.787433922290802, 0.21130964159965515, 0.24597418308258057, 0.20526334643363953, 0.2800428867340088, -0.10506691783666611, -0.28392210602760315, -0.06729758530855179, -0.15595576167106628, -0.15961751341819763, 0.2939583659172058, -0.12393137812614441, 0.2117883861064911, -0.07366237044334412, -0.1439702808856964, -0.28731855750083923, -0.17666231095790863, -0.32568031549453735, -0.26072508096694946, 0.10324881225824356, 0.03522266820073128, 0.007889553904533386, -0.06962641328573227, -0.04756710305809975, 0.16661566495895386, 0.4716692268848419, -0.0923464298248291, 0.16979357600212097, 0.4259827136993408, -0.19728043675422668, 0.2238752543926239, 0.26278746128082275, 0.3842623829841614, 0.03175743669271469, -0.032456427812576294, -0.11266517639160156, 0.01538858376443386, -0.0005630897358059883, -0.030224690213799477, -0.045173995196819305, -0.08273513615131378, 0.5442606210708618, 0.47104525566101074, 0.28999558091163635, 0.00817793607711792, -0.2698850929737091, -0.19204561412334442, -0.012116136029362679, 0.14371061325073242, -0.04122598469257355, -0.282651424407959, -0.23484332859516144, -0.02157706208527088, -0.22698557376861572, -0.3806626498699188, -0.29858148097991943, -0.19826875627040863, 0.04777105525135994, 0.28122884035110474, -0.24835804104804993, 0.07455921918153763, 0.07126365602016449, 0.47701096534729004, 0.10738642513751984, -0.36764082312583923, -0.16429662704467773, -0.2420780062675476, 0.2984616160392761, -0.04157404601573944, 0.09043196588754654, -0.19735610485076904, 0.20973561704158783, -0.017027445137500763, 0.19250066578388214, -0.38832467794418335, -0.0889478251338005, 0.14243291318416595, 0.03926355019211769, -0.05327039211988449, 0.14028400182724, 0.022519998252391815, 0.23063479363918304, -0.27836209535598755, 0.1552104353904724, -0.1323184221982956, -0.19827386736869812, 0.07454410940408707, 0.08410213887691498, 0.38904333114624023, -0.060561247169971466, 0.20825061202049255, 0.09168097376823425, -0.4086465537548065, 0.3614867329597473, 0.06970798969268799, 0.20595526695251465, 0.11705825477838516, 0.03955803066492081, -0.04180464521050453, -0.000005102250725030899, -0.4761638939380646, 0.05019385367631912, -0.1879602074623108, 0.0851767361164093, -0.008179045282304287, 0.09557625651359558, 0.019332263618707657, -0.0040091704577207565, -0.03581387922167778, 0.32299357652664185, -0.5678500533103943, -0.5232201218605042, -0.0037240181118249893, 0.42853426933288574, -0.26251429319381714, -0.11265155673027039, 0.23317250609397888, 0.3755928575992584, -0.06086765229701996, 0.1415015459060669, -0.0727338045835495, 0.16909673810005188, 0.4192824959754944, 0.14096912741661072, -0.06252779811620712, 0.1351611614227295, 0.2677771747112274, 0.6059735417366028, -0.0940602719783783, -0.15270985662937164, 0.18055883049964905, 0.36554256081581116, 0.11463825404644012, -0.14556488394737244, 0.020943360403180122, -0.007763311266899109, -0.32147255539894104, 0.12604311108589172, -0.008759059011936188, 0.1421908736228943, 0.029576465487480164, -0.04100460931658745, -0.6004119515419006, -0.052224449813365936, -0.5038923621177673, -0.14222344756126404, -0.38541996479034424, -0.02232588827610016, 0.0017766635864973068, -0.14360781013965607, -0.14230595529079437, -0.06983193755149841, 0.38960322737693787, 0.2605697810649872, 0.6973925828933716, -0.08518420904874802, -0.11661118268966675, -0.036278314888477325, -0.41899579763412476, -0.04954010248184204, -0.1711832582950592, 0.021076537668704987, 0.1340005248785019, -0.04710177704691887, -0.18442825973033905, -0.14016304910182953, 0.6269508004188538, 0.08011709153652191, 0.2505919933319092, -0.26863425970077515, 0.06821782886981964, -0.14117492735385895, -0.12966205179691315, 0.14707708358764648, 0.24893881380558014, 0.006597505882382393, 0.7845739722251892, -0.23989984393119812, 0.05695051699876785, -0.1834430992603302, 0.12025099992752075, -0.2521995007991791, -0.05559966713190079, 0.1524733453989029, 0.1094227209687233, -0.3954969048500061, 0.1462620198726654, -0.014793583191931248, -0.026902303099632263, -0.13084203004837036, -0.1841060072183609, -0.16888031363487244, -0.17388278245925903, -0.18928410112857819, -0.13938647508621216, 0.10303831100463867, -0.11084269732236862, 0.14571796357631683, 0.11457408219575882, 0.03137081116437912, 0.24211053550243378, 0.3122860789299011, -0.008850540965795517, -0.0009260699152946472, -0.10297396034002304, -0.09921460598707199, 0.06725546717643738, 0.45681333541870117, 0.1501917690038681, 0.6464122533798218, -0.16452538967132568, 0.08956820517778397, -0.74657142162323, -0.09296140819787979, -0.12896248698234558, 0.1575012356042862, -0.42482301592826843, 0.05016958713531494, 0.5502787232398987, -0.31675228476524353, -0.15704256296157837, 0.34501954913139343, 0.6126415729522705, -0.21767990291118622, 0.27849817276000977, 0.15299922227859497, 0.9273783564567566, 0.15288636088371277, -0.024041492491960526, -0.28458213806152344, -0.13324829936027527, 0.44402459263801575, -0.2950702905654907, 0.0012315046042203903, -0.23881277441978455, -0.3435328006744385, -0.08475034683942795, 0.023638833314180374, -0.18909630179405212, 0.2082037776708603, -0.09982723742723465, 0.2931721806526184, 0.12109456956386566, 0.2574174702167511, -0.22340427339076996, 0.2762962579727173, -0.39545610547065735, -0.2677556574344635, -0.25881174206733704, 0.10470734536647797, 0.028236720710992813, 0.3738434314727783, -0.24549946188926697, -0.04053639993071556, 0.25828251242637634, 0.10805724561214447, -0.38838136196136475, 0.011275678873062134, 0.021362585946917534, -0.20586982369422913, -0.061371009796857834, -0.4282302260398865, 0.08570791780948639, -0.06275148689746857, 0.47901594638824463, 0.31094247102737427, -0.22200599312782288, 0.16707397997379303, -0.10345891863107681, 0.3868417739868164, 0.003664283314719796, -0.25394174456596375, 0.4168350398540497, -0.09221374243497849, -0.3221764862537384, 0.02906990423798561, 0.11784610152244568, -0.5686897039413452, 0.05237247049808502, 0.01380600780248642, -0.1820058971643448, 0.12202202528715134, -0.003585304832085967, 0.18321824073791504, -0.058590468019247055, -0.25679174065589905, 0.025723133236169815, 0.18253493309020996, 0.08848433941602707, 0.16059069335460663, -0.06381908059120178, -0.018151067197322845, 0.06625892966985703, 0.38650500774383545, -0.17025965452194214, -0.30515074729919434, 0.1355566680431366, -0.10276971757411957, -0.11966861039400101, -0.09451185911893845, -0.18430134654045105, 0.2433309555053711, -0.5004079341888428, 0.01856578141450882, -0.3913928270339966, 0.09457021951675415, 0.12992212176322937, 0.07305397093296051, 0.04556768015027046, 0.2118755280971527, -0.24670186638832092, -0.36627712845802307, -0.22100356221199036, 0.19288261234760284, 0.286746621131897, 0.39984744787216187, 0.01836298033595085, 0.003823762759566307, -0.16080866754055023, 0.340531587600708, -0.28794217109680176, 0.2576759159564972, -0.2344079464673996, 0.30597734451293945, -0.32141944766044617, 0.002740532159805298, -0.029167933389544487, -0.35805365443229675, -0.050537265837192535, 0.26547855138778687, -0.14273834228515625, -0.11143834888935089, -0.20079343020915985, 0.17480921745300293, -0.09777551889419556, 0.3852912485599518, -0.058215487748384476, -0.20447729527950287, 0.31493496894836426, -0.233949214220047, 0.2674722969532013, 0.30689284205436707, 0.030321180820465088, -0.025309968739748, 0.916094958782196, 0.3653893768787384, 0.017175674438476562, 0.2700732946395874, 0.20347248017787933, 0.2198692262172699, -0.07027199864387512, 0.25081706047058105, -0.29837390780448914, 0.2477680742740631, -0.11449489742517471, 0.13359206914901733, 0.5036085247993469, 0.3055381178855896, 0.40392643213272095, 0.0568944551050663, -0.3688283860683441, -0.1412903517484665, 0.7473149299621582, -0.06356729567050934, -0.21019162237644196, -0.18978898227214813, 0.15819051861763, 0.20260988175868988, -0.23098866641521454, -0.2575382888317108, 0.23858702182769775, -0.14815039932727814, 0.1040283739566803, 0.0724061131477356, 0.1961503028869629, 0.1858844757080078, 0.058315474539995193, 0.17630839347839355, 0.38993576169013977, -0.19544386863708496, -0.011712884530425072, 0.06540613621473312, 0.11413885653018951, -0.07179398834705353, 0.23643885552883148, -0.08234706521034241, 0.23288294672966003, 0.1513993889093399, -0.02290865033864975, 0.2791338264942169, 0.40250006318092346, 0.01384718343615532, 0.2721827030181885, -0.020890843123197556, 0.017727384343743324, 0.030299648642539978, -0.07392922043800354, 0.23577886819839478, 0.21503368020057678, 0.23071503639221191, 0.04252905398607254, -0.18483443558216095, -0.12007228285074234, 0.12383560836315155, 0.007901772856712341, -0.11248999834060669, -0.0004412233829498291, -0.2295781672000885, -0.09990683197975159, -0.013050343841314316, -0.13432587683200836, -0.1664922684431076, 0.09874576330184937, 0.2348330020904541, 0.21921126544475555, 0.08898056298494339, 0.07676476985216141, 0.2359693944454193, 0.6574288606643677, -0.17406222224235535, -0.047399573028087616, 0.2254326343536377, -0.06203605234622955, -0.09528230130672455, 0.23725628852844238, -0.004945877939462662, -0.06899602711200714, -0.033433519303798676, 0.6244643330574036, 0.4222980737686157, 0.056996360421180725, -0.09293795377016068, -0.02033357322216034, -0.14200197160243988, -0.1873323917388916, 0.33605191111564636, 0.21698936820030212, -0.12849017977714539, 0.14238271117210388, -0.04759981855750084, 0.000038933008909225464, -0.2283451110124588, 0.3231503665447235, 0.28509238362312317, -0.23715102672576904, -0.22252240777015686, 0.11846785992383957, 0.09019844979047775, -0.0068090250715613365, 0.04706403613090515, -0.3935569226741791, 0.11242078989744186, -0.12366339564323425, 0.08498618006706238, -0.24245691299438477, 0.22513659298419952, 0.24664337933063507, 0.07355491816997528, -0.09835799038410187, -0.22991539537906647, -0.24381086230278015, 0.12307235598564148, 0.06544914841651917, 0.2823707163333893, 0.2806161642074585, -0.16544975340366364, -0.13062748312950134, 0.04562229663133621, -0.06143946945667267, -0.21841281652450562, -0.08972145617008209, 0.43568533658981323, -0.284290075302124, -0.19095228612422943, -0.10055792331695557, -0.3403695821762085, -0.11607201397418976, -0.07414092868566513, 0.24901477992534637, 0.36016732454299927, -0.013498064130544662, 0.03439091145992279, -0.03372567147016525, 0.329664945602417, -0.16723711788654327, 0.5508984923362732, -0.14749829471111298, -0.2426970899105072, -0.2698674499988556, -0.12429579347372055, -0.2589738965034485, -0.33275508880615234, -0.2822999060153961, -0.4894910156726837, -0.19782279431819916, 0.3178804814815521, 0.09133946895599365, -0.045995455235242844, -0.2187929004430771, 0.11978423595428467, 0.19493885338306427, 0.26686516404151917, -0.31570908427238464, -0.014875966124236584, -0.12318623065948486, -0.07863041758537292, 0.12533172965049744, 0.24043035507202148, 0.2899016737937927, 0.40357744693756104, -0.12293116003274918, -0.2486741840839386, 0.28681322932243347, 0.09951833635568619, 0.0028277412056922913, -0.042409494519233704, 0.2654677629470825, 0.22543194890022278, -0.09150870889425278, -0.6676734089851379, -0.16763821244239807, 0.314488023519516, 0.15307390689849854, -0.16371281445026398, 0.28448182344436646, 0.13706770539283752, -0.07172991335391998, -0.19567851722240448, 0.16970285773277283, 0.11727990955114365, -0.06456853449344635, 0.17312060296535492, -0.27678313851356506 ]
https://github.com/huggingface/datasets/issues/5045
Automatically revert to last successful commit to hub when a push_to_hub is interrupted
> Could you share the error you got please ? Maybe the full stack trace if you have it ? Here’s part of the stack trace, that I can reproduce at the moment from a photo I took (potential typos from OCR): ``` ValueError Traceback (most recent call last) <ipython-input-4-274613b7d3f5> in <module> from datasets import load dataset ds = load_dataset('jrahn/chessv6', use_auth_token-True) /us/local/1ib/python3.7/dist-packages/datasets/table.py in cast_table _to_schema (table, schema) Line 2005 raise ValueError() ValueError: Couldn't cast fen: string move: string res: string eco: string move_id: int64 res_num: int64 to { 'fen': Value(dtype='string', id=None), 'move': Value(dtype=' string', id=None), 'res': Value(dtype='string', id=None), 'eco': Value(dtype='string', id=None), 'hc': Value(dtype='string', id=None), 'move_ id': Value(dtype='int64', id=None), 'res_num': Value(dtype= 'int64' , id=None) } because column names don't match ``` The column 'hc' was removed before the interrupted push_to_hub(). It appears in the column list in curly brackets but not in the column list above. Let me know, if I can be of any help.
**Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults
155
Automatically revert to last successful commit to hub when a push_to_hub is interrupted **Is your feature request related to a problem? Please describe.** I pushed a modification of a large dataset (remove a column) to the hub. The push was interrupted after some files were committed to the repo. This left the dataset to raise an error on load_dataset() (ValueError couldn’t cast … because column names don’t match). Only by specifying the previous (complete) commit as revision=commit_hash in load_data(), I was able to repair this and after a successful, complete push, the dataset loads without error again. **Describe the solution you'd like** Would it make sense to detect an incomplete push_to_hub() and automatically revert to the previous commit/revision? **Describe alternatives you've considered** Leave everything as is, the revision parameter in load_dataset() allows to manually fix this problem. **Additional context** Provide useful defaults > Could you share the error you got please ? Maybe the full stack trace if you have it ? Here’s part of the stack trace, that I can reproduce at the moment from a photo I took (potential typos from OCR): ``` ValueError Traceback (most recent call last) <ipython-input-4-274613b7d3f5> in <module> from datasets import load dataset ds = load_dataset('jrahn/chessv6', use_auth_token-True) /us/local/1ib/python3.7/dist-packages/datasets/table.py in cast_table _to_schema (table, schema) Line 2005 raise ValueError() ValueError: Couldn't cast fen: string move: string res: string eco: string move_id: int64 res_num: int64 to { 'fen': Value(dtype='string', id=None), 'move': Value(dtype=' string', id=None), 'res': Value(dtype='string', id=None), 'eco': Value(dtype='string', id=None), 'hc': Value(dtype='string', id=None), 'move_ id': Value(dtype='int64', id=None), 'res_num': Value(dtype= 'int64' , id=None) } because column names don't match ``` The column 'hc' was removed before the interrupted push_to_hub(). It appears in the column list in curly brackets but not in the column list above. Let me know, if I can be of any help.
[ -0.48917585611343384, -0.2021462619304657, 0.02700600028038025, -0.23982305824756622, 0.19127099215984344, -0.20218759775161743, 0.07046350836753845, 0.40349459648132324, 0.09972336888313293, 0.3640482723712921, 0.24140499532222748, 0.25706785917282104, -0.0666167214512825, 0.12714925408363342, -0.01622099056839943, 0.19649742543697357, 0.03554400056600571, 0.3466387987136841, 0.10400575399398804, 0.01608353853225708, -0.11482049524784088, -0.13737468421459198, 0.007286489009857178, 0.1406952142715454, -0.21263086795806885, 0.17334552109241486, 0.09431631118059158, 0.0716659352183342, 0.01989169977605343, -0.39722517132759094, 0.369661808013916, 0.2639821469783783, -0.03804541379213333, 0.3283917009830475, -0.00012580060865730047, 0.06582401692867279, 0.1954677850008011, -0.14725452661514282, -0.44025567173957825, -0.25126218795776367, -0.570479154586792, -0.1600547581911087, -0.0745604857802391, -0.3322295844554901, 0.07057907432317734, 0.5876429677009583, 0.03979526087641716, -0.02211124449968338, 0.33572399616241455, 0.06361149251461029, 0.06637149304151535, 0.13676851987838745, 0.17981934547424316, -0.14382638037204742, 0.1608821153640747, 0.26764339208602905, -0.027757151052355766, 0.24290136992931366, 0.06240593641996384, -0.02020120620727539, -0.04891935735940933, 0.33388787508010864, -0.031800687313079834, -0.08857311308383942, 0.19196930527687073, -0.193191260099411, 0.2884451448917389, -0.11258447170257568, -0.17863041162490845, -0.08693220466375351, 0.23387852311134338, -0.5758069753646851, -0.3127533793449402, -0.5133851766586304, 0.2631075978279114, -0.22058093547821045, -0.0836915597319603, -0.22607937455177307, -0.012252227403223515, 0.03316766768693924, -0.2515648603439331, -0.43905413150787354, -0.16273191571235657, -0.011287696659564972, -0.18042317032814026, -0.04338543117046356, 0.1730034351348877, 0.15433862805366516, 0.000636804848909378, 0.19925354421138763, 0.20990927517414093, -0.08852928876876831, 0.01550067588686943, 0.0788879320025444, -0.40732261538505554, -0.4508160650730133, 0.13127611577510834, -0.10279903560876846, 0.06150660663843155, 0.11649225652217865, 0.02224145643413067, 0.19222933053970337, -0.19759778678417206, 0.04900544136762619, 0.3227190375328064, 0.14195992052555084, 0.3449966013431549, 0.18783579766750336, 0.33056163787841797, 0.16741910576820374, -0.18753275275230408, 0.26401960849761963, -0.041332896798849106, 0.0060420408844947815, 0.5525647401809692, 0.3937963843345642, 0.35166120529174805, -0.0268096961081028, -0.18249250948429108, 0.3737393021583557, -0.13433828949928284, -0.025330757722258568, -0.11460622400045395, 0.07062166929244995, 0.06222597137093544, 0.29685357213020325, -0.09936942160129547, -0.057735539972782135, -0.08482182025909424, 0.04797178506851196, -0.08652402460575104, -0.19304625689983368, -0.2539680302143097, 0.14386995136737823, 0.29964306950569153, -0.3660028576850891, -0.028793396428227425, -0.03446413204073906, -0.07474024593830109, -0.13411276042461395, -0.2257893979549408, 0.05656531825661659, 0.002852797508239746, 0.15880811214447021, -0.02908647432923317, 0.029263338074088097, 0.1447572112083435, -0.19745290279388428, -0.363147497177124, 0.35917508602142334, -0.4400638937950134, -0.4595543444156647, 0.26116976141929626, 0.05797545239329338, -0.484356164932251, 0.11884350329637527, -0.5175350904464722, -0.09620891511440277, -0.15170875191688538, 0.013359662145376205, 0.16119594871997833, -0.16619016230106354, 0.040849488228559494, -0.028458300977945328, 0.2725721299648285, 0.4248638153076172, -0.06443625688552856, -0.3022170662879944, 0.08997881412506104, -0.14106735587120056, -0.3348524272441864, -0.05480606481432915, -0.040352582931518555, 0.3358946144580841, -0.06733874976634979, -0.07971903681755066, 0.26882535219192505, -0.4273025393486023, -0.4528392553329468, -0.306331068277359, -0.37265968322753906, 0.11689547449350357, -0.5822932720184326, 0.32831746339797974, 0.3226650059223175, 0.04616982862353325, 0.20840638875961304, 0.2961314916610718, -0.13112767040729523, 0.03485104441642761, -0.1334231048822403, -0.21704982221126556, -0.3549988269805908, 0.2579711377620697, 0.3468722403049469, 0.3166879713535309, 0.2225635051727295, 0.3550892472267151, 0.11289781332015991, 0.1645052134990692, 0.12709684669971466, 0.1791526824235916, 0.5430057644844055, -0.33931320905685425, 0.001649908721446991, -0.5240923762321472, -0.2526422441005707, 0.1703428328037262, 0.42812061309814453, -0.24628198146820068, -0.27939558029174805, -0.08980454504489899, -0.45593228936195374, 0.08633608371019363, -0.1496174931526184, 0.5894239544868469, -0.0015284828841686249, -0.18721354007720947, -0.28228357434272766, 0.06773681938648224, -0.2948559820652008, 0.2691311240196228, -0.25524941086769104, 0.18117453157901764, -0.1289025843143463, 0.617903470993042, 0.11793830990791321, -0.34042760729789734, -0.04376734048128128, 0.24921375513076782, 0.24877884984016418, -0.158569797873497, 0.03861702233552933, 0.3607986867427826, -0.08205298334360123, 0.4642205834388733, 0.0006892122328281403, 0.14717911183834076, 0.11834942549467087, 0.32962289452552795, 0.03747302666306496, -0.207881897687912, -0.018160104751586914, -0.20214635133743286, -0.17837974429130554, 0.47465991973876953, -0.11257636547088623, 0.27677685022354126, -0.11636203527450562, -0.13929179310798645, -0.09683749079704285, -0.16669736802577972, -0.28274083137512207, -0.31019750237464905, 0.10478818416595459, 0.01804976537823677, -0.30089712142944336, -0.12364009022712708, -0.28228604793548584, 0.14408433437347412, 0.46524250507354736, -0.17602205276489258, 0.10468130558729172, 0.38893601298332214, -0.19108575582504272, 0.2050667107105255, 0.1593177318572998, 0.24216897785663605, 0.1420067697763443, -0.050053272396326065, -0.24954754114151, 0.019875235855579376, -0.13927651941776276, 0.13743038475513458, 0.045511722564697266, 0.035026077181100845, 0.46753284335136414, 0.4432487189769745, 0.28351879119873047, -0.020226795226335526, -0.14870798587799072, -0.1601998209953308, 0.1337505578994751, 0.3195270001888275, -0.1739601492881775, -0.20698006451129913, -0.25286880135536194, -0.013586286455392838, -0.17882882058620453, -0.44654393196105957, -0.09567771852016449, -0.32793673872947693, 0.01707146316766739, 0.35026615858078003, -0.13243120908737183, 0.1778745800256729, -0.15369564294815063, 0.33471983671188354, 0.1670249104499817, -0.44605863094329834, 0.051564618945121765, -0.35145139694213867, 0.2847365736961365, -0.09837083518505096, -0.05975285544991493, -0.2689642906188965, 0.3003671169281006, -0.14757230877876282, 0.1285790055990219, -0.36517834663391113, -0.15161985158920288, 0.16208839416503906, -0.08404404670000076, -0.10352711379528046, 0.12681668996810913, 0.21049630641937256, 0.2824172377586365, -0.41201674938201904, 0.2699703276157379, -0.07196488976478577, -0.19044996798038483, 0.36574047803878784, 0.08618488162755966, 0.14065198600292206, 0.02772783860564232, 0.01727955788373947, 0.12469714879989624, -0.3230694532394409, 0.1615532785654068, 0.06201822683215141, 0.1308038979768753, 0.040901992470026016, 0.041931379586458206, -0.12153931707143784, 0.06446720659732819, -0.4086568355560303, 0.06702045351266861, -0.13435974717140198, 0.2267841398715973, 0.047869205474853516, 0.22182494401931763, 0.07202038168907166, -0.08828035742044449, -0.09175501763820648, 0.1959955096244812, -0.5621936917304993, -0.2875511944293976, -0.05353716015815735, 0.5024648308753967, -0.24085262417793274, -0.10174863040447235, 0.2581351399421692, 0.4531010091304779, 0.0023679714649915695, 0.1500769555568695, -0.35512176156044006, -0.07342257350683212, 0.6165291666984558, 0.15819652378559113, -0.043829262256622314, 0.42216572165489197, 0.16153782606124878, 0.48248016834259033, -0.26643723249435425, -0.21207179129123688, 0.11113237589597702, 0.2735060751438141, 0.09474889934062958, -0.28527724742889404, -0.17151112854480743, -0.06590158492326736, -0.3587705194950104, -0.0014034360647201538, -0.11268322169780731, 0.061259083449840546, -0.12937992811203003, -0.11790112406015396, -0.5102794170379639, -0.007965978235006332, -0.6524313688278198, -0.13933414220809937, -0.5525228381156921, 0.07845509797334671, 0.0558863990008831, 0.022733114659786224, -0.4643462598323822, -0.038526203483343124, 0.20148241519927979, 0.13601133227348328, 0.5168858766555786, -0.11628267914056778, -0.21969614923000336, -0.045278821140527725, -0.2987319827079773, -0.017126381397247314, -0.1259346753358841, 0.2776409983634949, 0.07960833609104156, 0.020854949951171875, -0.17404915392398834, -0.01378299854695797, 0.5421413779258728, 0.0021361559629440308, 0.3540536165237427, 0.0323263481259346, 0.048680923879146576, -0.04648636654019356, -0.1951216757297516, 0.15499331057071686, 0.37822744250297546, 0.13376858830451965, 0.7651045322418213, -0.16988684237003326, 0.09894782304763794, 0.16704034805297852, 0.30863988399505615, -0.25954318046569824, -0.07573333382606506, 0.047754738479852676, 0.06602226197719574, -0.49730420112609863, 0.35238078236579895, 0.054804861545562744, 0.049470990896224976, -0.1277729719877243, -0.14992593228816986, -0.12416966259479523, -0.05512728542089462, -0.10664576292037964, -0.03575584664940834, 0.06047619879245758, -0.09172600507736206, 0.41692572832107544, 0.03725162893533707, -0.10960438847541809, 0.21222077310085297, 0.2968556880950928, 0.03001241572201252, -0.27236855030059814, -0.11157432943582535, -0.13384419679641724, 0.13966591656208038, 0.4268094599246979, 0.2921234667301178, 0.5481847524642944, -0.13561482727527618, 0.16170629858970642, -0.4793913960456848, -0.03483617305755615, -0.021062565967440605, 0.1045319065451622, -0.7660967707633972, -0.15096515417099, 0.34198468923568726, -0.43414801359176636, -0.14485614001750946, 0.33943191170692444, 0.48809874057769775, -0.17316682636737823, 0.24356456100940704, 0.13313104212284088, 1.200181007385254, 0.13105106353759766, 0.010208278894424438, -0.21911349892616272, -0.22789067029953003, 0.30866482853889465, -0.2881965637207031, 0.04706382006406784, -0.26168331503868103, -0.30506932735443115, -0.0780586525797844, -0.09765845537185669, -0.18969601392745972, 0.03322836384177208, -0.25502586364746094, 0.35508084297180176, 0.05768929421901703, 0.43181920051574707, -0.12937183678150177, 0.11552362143993378, -0.17753365635871887, -0.16507960855960846, -0.12929199635982513, 0.046741485595703125, -0.11147896945476532, 0.22184886038303375, -0.09919967502355576, 0.06078501045703888, 0.21752479672431946, 0.13161642849445343, -0.5649148225784302, 0.061873942613601685, 0.09315069019794464, -0.17276114225387573, -0.20135951042175293, -0.4869731068611145, 0.1256936639547348, -0.1292201280593872, 0.4545014500617981, 0.3816905915737152, -0.1874377727508545, 0.19092002511024475, 0.02243936061859131, 0.4028679132461548, 0.06804783642292023, -0.17329490184783936, 0.26173722743988037, -0.04773908108472824, -0.5266377329826355, 0.15936866402626038, 0.049658697098493576, -0.6355763673782349, -0.07006847113370895, 0.11365754157304764, -0.017214931547641754, -0.0764855444431305, -0.06184167042374611, 0.07635950297117233, 0.05113990232348442, -0.35657429695129395, 0.0028165262192487717, 0.05584406852722168, 0.12527452409267426, 0.28643614053726196, -0.16477341949939728, -0.20711049437522888, 0.06261612474918365, 0.4944004714488983, 0.017627308145165443, -0.2549743056297302, 0.20814962685108185, -0.15206366777420044, -0.23774150013923645, -0.04963485896587372, -0.12805235385894775, 0.02710283361375332, -0.4259002208709717, 0.027535613626241684, -0.4155508875846863, 0.035698071122169495, 0.18757571280002594, 0.17095665633678436, 0.019253967329859734, 0.08854398131370544, -0.2790985107421875, -0.342349648475647, -0.3019615113735199, 0.19221797585487366, 0.34485873579978943, 0.4086350202560425, 0.1785321831703186, 0.20449231564998627, -0.2988210916519165, 0.13667617738246918, -0.21388885378837585, 0.16277852654457092, -0.2882225215435028, 0.48408088088035583, -0.33834877610206604, 0.014991972595453262, -0.20331399142742157, -0.5361707806587219, -0.03314625471830368, 0.15753288567066193, -0.004451405256986618, -0.06398455798625946, -0.11702185869216919, 0.23124757409095764, -0.11308718472719193, 0.36158978939056396, -0.12040314823389053, -0.2695823907852173, 0.3766595423221588, -0.27193722128868103, 0.18499743938446045, 0.5079262852668762, 0.03145699203014374, -0.03698282316327095, 0.7627041339874268, 0.30402398109436035, 0.09947870671749115, 0.2205866426229477, 0.07564624398946762, 0.2400580793619156, -0.12366016209125519, 0.3001886308193207, -0.28179311752319336, 0.22884613275527954, -0.29583683609962463, 0.16550125181674957, 0.3781868815422058, 0.29334625601768494, 0.5596409440040588, -0.0409567728638649, -0.21342456340789795, 0.0009178542532026768, 0.4859935939311981, 0.11660614609718323, -0.28667011857032776, -0.19104449450969696, 0.18400010466575623, 0.12828697264194489, -0.31164371967315674, -0.31296423077583313, 0.3097985088825226, -0.14527036249637604, 0.022556599229574203, 0.044378213584423065, -0.007628489285707474, 0.08637885749340057, 0.1086498498916626, 0.25504153966903687, 0.525076687335968, -0.21262891590595245, 0.07402808964252472, 0.33458325266838074, 0.21857981383800507, -0.18559987843036652, 0.17601974308490753, 0.0013134349137544632, 0.1528698354959488, 0.17163580656051636, 0.07064098119735718, -0.06309450417757034, 0.4747822880744934, 0.002515442669391632, 0.20852875709533691, 0.13361001014709473, 0.021938137710094452, -0.09856730699539185, -0.24948501586914062, 0.17850542068481445, 0.4436357915401459, 0.026622481644153595, -0.040605101734399796, -0.139942467212677, -0.3701367676258087, 0.03602461516857147, -0.07384856790304184, 0.1054072231054306, -0.11598198115825653, -0.2773829698562622, -0.055159926414489746, 0.01477765291929245, -0.16626274585723877, -0.03932688385248184, 0.2251080572605133, 0.2361161857843399, 0.13789594173431396, 0.01290727686136961, 0.2632316052913666, 0.14569002389907837, 0.5802143812179565, -0.2863302528858185, -0.046061329543590546, 0.2639358937740326, -0.07752616703510284, -0.009552866220474243, 0.09071413427591324, 0.26025402545928955, 0.08336999267339706, -0.1679326742887497, 0.5883517265319824, 0.46208855509757996, -0.12694746255874634, 0.05426943302154541, -0.009519226849079132, -0.1197599470615387, -0.07691079378128052, 0.27413007616996765, 0.21428872644901276, -0.07563149929046631, 0.2011396288871765, 0.04184873402118683, -0.011244658380746841, -0.13562233746051788, 0.4511556327342987, 0.4354937970638275, -0.3611292541027069, -0.005924992263317108, 0.06168920546770096, 0.12389203161001205, 0.058743204921483994, -0.04454962536692619, -0.1876893788576126, 0.0452825091779232, -0.0028634327463805676, 0.050936684012413025, -0.1511741280555725, 0.13770517706871033, 0.17836900055408478, -0.05371253937482834, -0.34035736322402954, -0.1387699693441391, -0.22595494985580444, 0.02956371009349823, -0.015592437237501144, 0.05014204978942871, 0.47357285022735596, -0.30463021993637085, 0.012913167476654053, 0.05047816038131714, -0.11867044866085052, -0.26661381125450134, -0.18674388527870178, 0.6426206827163696, -0.3067256212234497, -0.29152631759643555, 0.19865664839744568, -0.28109410405158997, -0.11057408899068832, -0.15391671657562256, 0.28778818249702454, 0.3254711627960205, -0.028969448059797287, -0.039025869220495224, -0.08854077011346817, 0.43109598755836487, 0.010363265872001648, 0.41656458377838135, -0.15094251930713654, 0.07426349818706512, -0.1516275703907013, -0.04025600850582123, -0.07703649997711182, -0.4298071265220642, -0.24969355762004852, -0.281220406293869, -0.11855468153953552, 0.2484746277332306, 0.1631058156490326, -0.07669688761234283, -0.2500778138637543, 0.13882292807102203, 0.08228251338005066, 0.30649667978286743, -0.4047096371650696, -0.07707133144140244, -0.09725044667720795, 0.05782343074679375, -0.03976263105869293, 0.1269441694021225, 0.2156861424446106, 0.6031395196914673, -0.08486457169055939, -0.22336143255233765, 0.3923489451408386, 0.1163652166724205, -0.2961714267730713, -0.06973481178283691, 0.270175963640213, 0.1080034002661705, 0.00483190082013607, -0.7043026685714722, -0.14519774913787842, 0.3819715082645416, 0.032752625644207, -0.3223319947719574, 0.28981706500053406, 0.15684756636619568, 0.019871633499860764, -0.16998480260372162, 0.34628260135650635, 0.038935355842113495, -0.08198754489421844, 0.0020991340279579163, -0.19620180130004883 ]
https://github.com/huggingface/datasets/issues/5044
integrate `load_from_disk` into `load_dataset`
I agree the situation is not ideal and it would be awesome to use `load_dataset` to reload a dataset saved locally ! For context: - `load_dataset` works in three steps: download the dataset, then prepare it as an arrow dataset, and finally return a memory mapped arrow dataset. In particular it creates a cache directory to store the arrow data and the subsequent cache files for `map`. - `load_from_disk` directly returns a memory mapped dataset from the arrow file (similar to `Dataset.from_file`). It doesn't create a cache diretory, instead all the subsequent `map` calls write in the same directory as the original data. If we want to keep the download_and_prepare step for consistency, it would unnecessarily copy the arrow data into the datasets cache. On the other hand if we don't do this step, the cache directory doesn't exist which is inconsistent. I'm curious, what would you expect to happen in this situation ?
**Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you!
154
integrate `load_from_disk` into `load_dataset` **Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you! I agree the situation is not ideal and it would be awesome to use `load_dataset` to reload a dataset saved locally ! For context: - `load_dataset` works in three steps: download the dataset, then prepare it as an arrow dataset, and finally return a memory mapped arrow dataset. In particular it creates a cache directory to store the arrow data and the subsequent cache files for `map`. - `load_from_disk` directly returns a memory mapped dataset from the arrow file (similar to `Dataset.from_file`). It doesn't create a cache diretory, instead all the subsequent `map` calls write in the same directory as the original data. If we want to keep the download_and_prepare step for consistency, it would unnecessarily copy the arrow data into the datasets cache. On the other hand if we don't do this step, the cache directory doesn't exist which is inconsistent. I'm curious, what would you expect to happen in this situation ?
[ -0.44635680317878723, -0.2547794580459595, 0.010255537927150726, 0.2019416093826294, 0.2771260142326355, -0.06415087729692459, 0.34563735127449036, 0.05371537804603577, 0.18767482042312622, 0.0032595768570899963, -0.12003012001514435, 0.4315917193889618, -0.21891242265701294, 0.3659507930278778, 0.1304887980222702, -0.031987108290195465, 0.09322202950716019, 0.14932434260845184, -0.19573140144348145, -0.06984389573335648, -0.18395498394966125, 0.2209053486585617, 0.11793144047260284, -0.04411688446998596, -0.11173413693904877, 0.18309085071086884, -0.1365537941455841, 0.11326459050178528, 0.0197085440158844, -0.3285708427429199, 0.6284780502319336, 0.2716442942619324, 0.3341926038265228, 0.3633251190185547, -0.00011232155520701781, 0.1923799067735672, 0.25741714239120483, -0.21307030320167542, -0.507559597492218, -0.34604889154434204, -0.06604377925395966, -0.15244938433170319, 0.3846595883369446, -0.30427679419517517, -0.11516166478395462, 0.09200955927371979, -0.11395889520645142, -0.26704615354537964, 0.35503774881362915, 0.12621402740478516, 0.19490507245063782, 0.4610063135623932, -0.11474540829658508, -0.15635262429714203, -0.04331285506486893, 0.41405385732650757, -0.15227332711219788, 0.19862477481365204, 0.3236578702926636, 0.11076841503381729, 0.03542458266019821, -0.1009954959154129, 0.017977194860577583, -0.07209663093090057, 0.42302027344703674, -0.006927105598151684, 0.30070945620536804, -0.0844963937997818, -0.2096083164215088, 0.17899908125400543, 0.5157183408737183, -0.39214658737182617, -0.3643263876438141, -0.5026596188545227, -0.13282747566699982, -0.16695989668369293, 0.09329231828451157, 0.07267232239246368, -0.17898188531398773, 0.2149742841720581, -0.1521054059267044, -0.26146239042282104, -0.25491923093795776, -0.11651460826396942, -0.2542811930179596, 0.353007048368454, 0.016999797895550728, 0.04191915690898895, 0.13370166718959808, 0.07342766225337982, 0.38972190022468567, -0.19089065492153168, 0.24229104816913605, 0.09421911835670471, -0.24278558790683746, -0.2565828859806061, 0.00013849884271621704, 0.022671040147542953, 0.06363434344530106, 0.4243124723434448, 0.21719910204410553, -0.008537530899047852, -0.06446804851293564, 0.23400971293449402, 0.4109697639942169, 0.12736648321151733, -0.14713141322135925, 0.15610776841640472, 0.2063167840242386, 0.12792259454727173, -0.11544084548950195, -0.010730881243944168, -0.08807200938463211, 0.01640136167407036, 0.1928263008594513, -0.07598569244146347, 0.19586119055747986, -0.0835166946053505, -0.03711214289069176, -0.3383900821208954, 0.5547189116477966, -0.10464300215244293, 0.20493869483470917, 0.19755050539970398, 0.039358384907245636, 0.4786982834339142, -0.1625950187444687, 0.36062055826187134, -0.10504639148712158, -0.1225094348192215, -0.19547757506370544, -0.20724661648273468, -0.05705943703651428, 0.07984813302755356, 0.1456216722726822, 0.13923588395118713, 0.1787695586681366, -0.08057089895009995, 0.12609204649925232, 0.3008764982223511, -0.0651334896683693, -0.1567111313343048, -0.11627800017595291, 0.0743706077337265, 0.02845492586493492, 0.07488644123077393, 0.007411450147628784, -0.06409267336130142, -0.5090036988258362, 0.03482671082019806, -0.32618337869644165, -0.5912933349609375, -0.0531468391418457, 0.1748252660036087, -0.42324018478393555, -0.1719433218240738, -0.6718006730079651, -0.0013164989650249481, -0.1686438024044037, -0.021299472078680992, -0.351436972618103, -0.14789262413978577, -0.1053205281496048, -0.17409346997737885, 0.2638726234436035, 0.3069562315940857, -0.16854628920555115, -0.22903068363666534, -0.19985440373420715, -0.18032598495483398, 0.1715085804462433, 0.18886588513851166, -0.49015718698501587, 0.4394935071468353, -0.32368141412734985, -0.11375617980957031, 0.5816370248794556, -0.46631279587745667, -0.17346875369548798, 0.3063003122806549, -0.004085011780261993, 0.18480293452739716, 0.17696386575698853, -0.07677151262760162, 0.36583709716796875, -0.13408268988132477, 0.062091559171676636, 0.8756173253059387, -0.08790656924247742, 0.012081073597073555, -0.26748332381248474, -0.36589357256889343, 0.19966517388820648, 0.3545733094215393, 0.13553869724273682, 0.15401285886764526, 0.06548722833395004, 0.26369303464889526, 0.2032966911792755, -0.11974361538887024, 0.07608792185783386, 0.3086537718772888, 0.2587825357913971, 0.020028751343488693, 0.0749732181429863, -0.12356842309236526, -0.5101427435874939, 0.3351292014122009, -0.04241221770644188, 0.04525567963719368, -0.35736173391342163, -0.1276521384716034, -0.2051618993282318, 0.07006523013114929, -0.402789443731308, -0.03613338991999626, 0.09424085915088654, 0.320743590593338, 0.2164677530527115, -0.25024017691612244, -0.20365463197231293, 0.36225786805152893, 0.11425057053565979, 0.0784664899110794, -0.18529000878334045, 0.6780503988265991, 0.05842384696006775, -0.17809078097343445, -0.11496548354625702, 0.20946887135505676, 0.06569327414035797, -0.2769717574119568, -0.0019130511209368706, 0.41317614912986755, 0.01691555045545101, 0.4686205983161926, 0.08684127777814865, 0.19327223300933838, 0.29106444120407104, -0.12490731477737427, 0.02991207130253315, -0.052397336810827255, -0.026940561830997467, 0.08976993709802628, -0.2633309066295624, 0.34643715620040894, -0.2256009727716446, 0.35073456168174744, 0.15957507491111755, -0.08943828195333481, 0.3817696273326874, -0.03592948243021965, -0.09725683927536011, -0.012870822101831436, -0.13044533133506775, 0.19207707047462463, 0.3649320602416992, 0.06154238432645798, -0.09770414978265762, -0.03998810797929764, 0.18714404106140137, -0.05229029059410095, -0.0068887099623680115, 0.0551593191921711, -0.05352272838354111, -0.114099882543087, -0.004792971536517143, 0.2650071978569031, 0.5078422427177429, 0.25574028491973877, 0.13561353087425232, 0.029122304171323776, -0.05348417907953262, -0.0044463276863098145, 0.2727358639240265, 0.15648561716079712, 0.2832987606525421, 0.22360223531723022, 0.08554264903068542, 0.001394379884004593, -0.24136313796043396, -0.11256392300128937, 0.09717651456594467, 0.06341761350631714, -0.1743958294391632, 0.10756804794073105, -0.10832475125789642, 0.3231523334980011, -0.4029679000377655, 0.12365640699863434, -0.2643119990825653, -0.2780287563800812, -0.12783154845237732, 0.43217888474464417, -0.13963592052459717, 0.06651127338409424, -0.05474238842725754, 0.3567827343940735, -0.19424554705619812, -0.5460314154624939, -0.11555740982294083, -0.15722528100013733, 0.04737017676234245, 0.05962352082133293, 0.26577135920524597, -0.08804608136415482, 0.2218966782093048, -0.12120706588029861, 0.13066045939922333, -0.31196463108062744, -0.04999452456831932, 0.24415245652198792, 0.03282300755381584, 0.24287989735603333, -0.020855620503425598, 0.0546271838247776, 0.3534201979637146, -0.41475048661231995, 0.22856643795967102, -0.22334110736846924, 0.04618947207927704, 0.0909002423286438, -0.08078381419181824, 0.13392207026481628, 0.034338001161813736, -0.18621358275413513, -0.4795096814632416, -0.49520695209503174, 0.02438276633620262, 0.19314533472061157, 0.11455674469470978, -0.05418621748685837, -0.04496750235557556, -0.2407151311635971, 0.20901910960674286, 0.040081992745399475, -0.02571972645819187, -0.3220134377479553, 0.3622100055217743, -0.22657334804534912, -0.021448589861392975, -0.1730392575263977, -0.20893403887748718, 0.5292026400566101, 0.15419845283031464, -0.26064491271972656, 0.013997708447277546, -0.11693300306797028, 0.32866713404655457, -0.12168198823928833, 0.10848649591207504, 0.5181266665458679, 0.17484226822853088, 0.05513863265514374, 0.040927954018116, -0.16978640854358673, 0.09216197580099106, 0.266749769449234, 0.06145615130662918, 0.15790295600891113, 0.07257144153118134, -0.1676817536354065, 0.555962860584259, -0.24796606600284576, -0.014482926577329636, 0.4367142617702484, -0.00707339309155941, 0.3039678633213043, -0.15355917811393738, -0.1745140254497528, -0.22952595353126526, -0.159481942653656, -0.18393154442310333, 0.23068228363990784, 0.021490607410669327, -0.2576240599155426, -0.2860363721847534, -0.2756473422050476, -0.22154268622398376, -0.40828120708465576, 0.07740157842636108, -0.10831275582313538, 0.18559147417545319, -0.20079222321510315, -0.0963144600391388, -0.34154218435287476, 0.2236352264881134, 0.1560320407152176, 0.14862287044525146, 0.14841599762439728, -0.10120325535535812, -0.44438299536705017, 0.20654186606407166, -0.06448983401060104, -0.024373352527618408, -0.2539956569671631, -0.043826647102832794, 0.1102249026298523, -0.38202598690986633, -0.05243155360221863, -0.11291380226612091, 0.6925046443939209, -0.1487998217344284, 0.07244062423706055, 0.1441841572523117, -0.2381795048713684, -0.4339340031147003, -0.15819118916988373, -0.019874073565006256, -0.11790519952774048, -0.13296207785606384, 0.7781628370285034, -0.3752445876598358, -0.3503108024597168, 0.014953960664570332, 0.3343563377857208, -0.3301933705806732, -0.22293058037757874, -0.11541154980659485, -0.018907874822616577, -0.42401599884033203, -0.02010314166545868, 0.03919621556997299, 0.5152043700218201, -0.06419570744037628, 0.06195631995797157, -0.262861967086792, -0.12685132026672363, 0.18433785438537598, 0.13128621876239777, 0.4869297742843628, -0.20634543895721436, 0.1716470718383789, 0.09666740894317627, 0.17354756593704224, 0.010909421369433403, 0.5878550410270691, -0.4166441261768341, -0.38498586416244507, 0.17078185081481934, 0.11818462610244751, 0.3106299638748169, 0.2799059748649597, 0.2124951332807541, -0.09007295221090317, -0.2287084460258484, 0.027336660772562027, -0.4892085790634155, 0.11135415732860565, 0.0208892785012722, -0.24927948415279388, -0.2533024549484253, -0.4165888726711273, 0.37520936131477356, 0.01329738274216652, -0.18447232246398926, -0.013009496033191681, 0.17294646799564362, -0.5654257535934448, 0.7654725909233093, 0.10811246931552887, 1.0762717723846436, -0.08449025452136993, 0.19236940145492554, 0.07936131954193115, -0.05317005142569542, 0.13354940712451935, -0.47980332374572754, -0.09020555764436722, -0.272105872631073, -0.01984579861164093, -0.01482574362307787, -0.1463787853717804, 0.06868007779121399, 0.3221193552017212, -0.15726931393146515, 0.21274662017822266, 0.03786298632621765, 0.3206479549407959, -0.10975240170955658, 0.44978487491607666, -0.07123956084251404, -0.3768266439437866, -0.35179704427719116, 0.08640873432159424, 0.03135126084089279, 0.05805563926696777, -0.09666197746992111, -0.23444068431854248, 0.07901136577129364, -0.1303843855857849, -0.07102790474891663, 0.03004295751452446, 0.016758928075432777, 0.27765733003616333, -0.016413003206253052, -0.18902552127838135, -0.06169592961668968, 0.28057631850242615, 0.39831119775772095, 0.04825753718614578, -0.2552574574947357, 0.15702950954437256, -0.2528713345527649, 0.1653604954481125, -0.2355550080537796, -0.1318996399641037, 0.2529473900794983, -0.1598481833934784, -0.15855461359024048, -0.11422396451234818, -0.10054569691419601, -0.5470198392868042, -0.0015972256660461426, -0.19661857187747955, 0.4353283643722534, -0.3088325262069702, -0.14616338908672333, 0.010558739304542542, 0.18924707174301147, -0.23926067352294922, 0.12412962317466736, -0.00006886571645736694, -0.2327844649553299, 0.14909079670906067, -0.1261010468006134, -0.2104520946741104, -0.17303366959095, 0.2493118941783905, 0.1888887882232666, -0.103535957634449, 0.340328574180603, -0.21679043769836426, -0.1301937699317932, -0.2267143726348877, 0.0807984247803688, 0.43595272302627563, -0.5757875442504883, 0.13046427071094513, -0.12201034277677536, -0.24642229080200195, 0.02744143083691597, 0.1900179237127304, 0.3461090326309204, 0.05377016216516495, -0.17301024496555328, -0.1801491379737854, -0.30108100175857544, 0.192154660820961, 0.028963914141058922, 0.33730021119117737, 0.3006258010864258, -0.16995719075202942, -0.15235352516174316, 0.08808407187461853, -0.35984429717063904, 0.012989822775125504, 0.00891035608947277, 0.060173407196998596, 0.027343953028321266, -0.1890716254711151, 0.14774224162101746, -0.047961749136447906, 0.14852771162986755, -0.17874091863632202, -0.22836725413799286, -0.18087583780288696, -0.14006628096103668, 0.18307878077030182, -0.008933380246162415, 0.1126115545630455, -0.14918673038482666, -0.04932999610900879, -0.0011450499296188354, -0.258667916059494, 0.3044569492340088, -0.03704662621021271, -0.01837693154811859, 0.05806856229901314, 0.6921906471252441, 0.17879469692707062, -0.5141153335571289, 0.170199453830719, 0.0167253240942955, 0.2880464494228363, 0.11172565817832947, 0.22138269245624542, -0.21298643946647644, -0.15958267450332642, -0.16861216723918915, 0.07311073690652847, 0.34964221715927124, 0.24428337812423706, 0.32692936062812805, 0.024572134017944336, -0.09133671224117279, 0.25539952516555786, 0.31845101714134216, 0.20176856219768524, -0.060763854533433914, -0.03617577999830246, 0.19780904054641724, 0.23562799394130707, -0.13119199872016907, -0.2981404662132263, 0.05216755345463753, -0.28235483169555664, 0.021306347101926804, 0.3129137456417084, 0.4901920258998871, 0.08255104720592499, 0.11415432393550873, 0.09087301045656204, 0.7566288113594055, 0.09686536341905594, 0.4155884087085724, 0.5809623599052429, -0.007922150194644928, 0.07643285393714905, 0.02077232301235199, 0.09227995574474335, 0.2834266126155853, 0.36343812942504883, -0.3660525381565094, 0.3207661509513855, -0.028866581618785858, -0.09551835060119629, 0.44780492782592773, -0.2291102558374405, 0.3065493106842041, -0.17596173286437988, 0.12076015025377274, -0.06330106407403946, -0.09754307568073273, 0.1002073884010315, -0.18346334993839264, -0.1987266093492508, -0.3162199556827545, 0.23890076577663422, -0.140419602394104, -0.16168685257434845, 0.00785701721906662, -0.35848623514175415, -0.3371201455593109, 0.052717406302690506, -0.12283122539520264, -0.38275158405303955, -0.16168129444122314, 0.03428258001804352, 0.10821253806352615, 0.1425507664680481, 0.29631945490837097, 0.12118813395500183, -0.06681763380765915, -0.21467286348342896, 0.08437417447566986, 0.12648995220661163, -0.14913976192474365, 0.01960539072751999, 0.10228769481182098, 0.30416712164878845, 0.26150232553482056, -0.18514487147331238, 0.020711258053779602, 0.1828697770833969, -0.049578793346881866, -0.0643029659986496, -0.2310541272163391, -0.25104179978370667, 0.2603314220905304, 0.32346171140670776, 0.24166876077651978, -0.15432365238666534, -0.22904740273952484, 0.06345412135124207, -0.0774478167295456, -0.3546738028526306, 0.5693658590316772, 0.4232792854309082, -0.12103712558746338, -0.04968319088220596, 0.2309744954109192, -0.3346366882324219, -0.2563340961933136, 0.2961485981941223, -0.025216270238161087, 0.08879446238279343, 0.12702716886997223, 0.0644230917096138, 0.2957174777984619, 0.4273761212825775, 0.13151849806308746, -0.2547123432159424, -0.2710290253162384, -0.109520323574543, -0.6645974516868591, 0.09170443564653397, 0.19731557369232178, 0.015124021098017693, 0.15634942054748535, 0.14242543280124664, 0.1695193648338318, 0.10438861697912216, -0.26488226652145386, 0.13104674220085144, 0.12282956391572952, 0.11511606723070145, -0.24585993587970734, -0.07127031683921814, 0.16522875428199768, -0.009497348219156265, -0.05606988072395325, -0.4509021043777466, 0.12379391491413116, 0.2107381373643875, 0.045994848012924194, 0.036740742623806, -0.05714438855648041, 0.1454569548368454, -0.10483528673648834, 0.3091553747653961, 0.0046236347407102585, 0.22573257982730865, -0.02979375049471855, -0.09562757611274719, -0.055181872099637985, -0.219339519739151, -0.17952467501163483, 0.025959666818380356, -0.1300913244485855, 0.22439365088939667, -0.3003731667995453, -0.06647798418998718, -0.5604401230812073, -0.1374882459640503, 0.06442072242498398, -0.12863434851169586, -0.33148112893104553, -0.05586916208267212, -0.09558835625648499, 0.055165499448776245, 0.26136094331741333, 0.09064044058322906, 0.03209859877824783, 0.07005362212657928, -0.1296963095664978, -0.10992955416440964, 0.34600475430488586, 0.007060510106384754, -0.36722949147224426, -0.2807070016860962, 0.16200673580169678, -0.02105461061000824, 0.2317579835653305, -0.49114397168159485, 0.0998496487736702, 0.39197808504104614, -0.09789378196001053, 0.14764398336410522, 0.42608001828193665, 0.283956378698349, -0.023566262796521187, -0.1957942694425583, 0.06433487683534622, 0.017916889861226082, -0.2120840847492218, -0.19637879729270935, -0.2507069706916809 ]
https://github.com/huggingface/datasets/issues/5044
integrate `load_from_disk` into `load_dataset`
Thank you for the detailed breakdown, @lhoestq > I'm curious, what would you expect to happen in this situation ? 1. the simplest solution is to add a flag to the dataset saved by `save_to_disk` and have `load_dataset` check that flag - if it's set simply switch control to `load_from_disk` behind the scenes. So `load_dataset` detects it's a local filesystem, looks inside to see whether it's something it can cache or whether it should use it directly as is and continues accordingly with one of the 2 dataset-type specific APIs. 2. the more evolved solution is to look at a dataset produced by `save_to_disk` as a remote resource like hub. So the first time `load_dataset` sees it, it'll take a fingerprint and create a normal cached dataset. On subsequent uses it'll again discover it as a remote resource, validate that it has it cached via the fingerprint and serve as a normal dataset. As you said the cons of approach 2 is that if the dataset is huge it'll make 2 copies on the same machine. So it's possible that both approaches can be integrated. Say if `save_to_disc(do_not_cache=True)` is passed it'll use solution 1, otherwise solution 2. or could even symlink the huge arrow files to the cache instead? or perhaps it's more intuitive to use `load_dataset(do_not_cache=True)` instead. So that one can choose whether to make a cached copy or not for the locally saved dataset. i.e. a simple at use point user control. Surely there are other ways to handle it, this is just one possibility.
**Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you!
257
integrate `load_from_disk` into `load_dataset` **Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you! Thank you for the detailed breakdown, @lhoestq > I'm curious, what would you expect to happen in this situation ? 1. the simplest solution is to add a flag to the dataset saved by `save_to_disk` and have `load_dataset` check that flag - if it's set simply switch control to `load_from_disk` behind the scenes. So `load_dataset` detects it's a local filesystem, looks inside to see whether it's something it can cache or whether it should use it directly as is and continues accordingly with one of the 2 dataset-type specific APIs. 2. the more evolved solution is to look at a dataset produced by `save_to_disk` as a remote resource like hub. So the first time `load_dataset` sees it, it'll take a fingerprint and create a normal cached dataset. On subsequent uses it'll again discover it as a remote resource, validate that it has it cached via the fingerprint and serve as a normal dataset. As you said the cons of approach 2 is that if the dataset is huge it'll make 2 copies on the same machine. So it's possible that both approaches can be integrated. Say if `save_to_disc(do_not_cache=True)` is passed it'll use solution 1, otherwise solution 2. or could even symlink the huge arrow files to the cache instead? or perhaps it's more intuitive to use `load_dataset(do_not_cache=True)` instead. So that one can choose whether to make a cached copy or not for the locally saved dataset. i.e. a simple at use point user control. Surely there are other ways to handle it, this is just one possibility.
[ -0.44635680317878723, -0.2547794580459595, 0.010255537927150726, 0.2019416093826294, 0.2771260142326355, -0.06415087729692459, 0.34563735127449036, 0.05371537804603577, 0.18767482042312622, 0.0032595768570899963, -0.12003012001514435, 0.4315917193889618, -0.21891242265701294, 0.3659507930278778, 0.1304887980222702, -0.031987108290195465, 0.09322202950716019, 0.14932434260845184, -0.19573140144348145, -0.06984389573335648, -0.18395498394966125, 0.2209053486585617, 0.11793144047260284, -0.04411688446998596, -0.11173413693904877, 0.18309085071086884, -0.1365537941455841, 0.11326459050178528, 0.0197085440158844, -0.3285708427429199, 0.6284780502319336, 0.2716442942619324, 0.3341926038265228, 0.3633251190185547, -0.00011232155520701781, 0.1923799067735672, 0.25741714239120483, -0.21307030320167542, -0.507559597492218, -0.34604889154434204, -0.06604377925395966, -0.15244938433170319, 0.3846595883369446, -0.30427679419517517, -0.11516166478395462, 0.09200955927371979, -0.11395889520645142, -0.26704615354537964, 0.35503774881362915, 0.12621402740478516, 0.19490507245063782, 0.4610063135623932, -0.11474540829658508, -0.15635262429714203, -0.04331285506486893, 0.41405385732650757, -0.15227332711219788, 0.19862477481365204, 0.3236578702926636, 0.11076841503381729, 0.03542458266019821, -0.1009954959154129, 0.017977194860577583, -0.07209663093090057, 0.42302027344703674, -0.006927105598151684, 0.30070945620536804, -0.0844963937997818, -0.2096083164215088, 0.17899908125400543, 0.5157183408737183, -0.39214658737182617, -0.3643263876438141, -0.5026596188545227, -0.13282747566699982, -0.16695989668369293, 0.09329231828451157, 0.07267232239246368, -0.17898188531398773, 0.2149742841720581, -0.1521054059267044, -0.26146239042282104, -0.25491923093795776, -0.11651460826396942, -0.2542811930179596, 0.353007048368454, 0.016999797895550728, 0.04191915690898895, 0.13370166718959808, 0.07342766225337982, 0.38972190022468567, -0.19089065492153168, 0.24229104816913605, 0.09421911835670471, -0.24278558790683746, -0.2565828859806061, 0.00013849884271621704, 0.022671040147542953, 0.06363434344530106, 0.4243124723434448, 0.21719910204410553, -0.008537530899047852, -0.06446804851293564, 0.23400971293449402, 0.4109697639942169, 0.12736648321151733, -0.14713141322135925, 0.15610776841640472, 0.2063167840242386, 0.12792259454727173, -0.11544084548950195, -0.010730881243944168, -0.08807200938463211, 0.01640136167407036, 0.1928263008594513, -0.07598569244146347, 0.19586119055747986, -0.0835166946053505, -0.03711214289069176, -0.3383900821208954, 0.5547189116477966, -0.10464300215244293, 0.20493869483470917, 0.19755050539970398, 0.039358384907245636, 0.4786982834339142, -0.1625950187444687, 0.36062055826187134, -0.10504639148712158, -0.1225094348192215, -0.19547757506370544, -0.20724661648273468, -0.05705943703651428, 0.07984813302755356, 0.1456216722726822, 0.13923588395118713, 0.1787695586681366, -0.08057089895009995, 0.12609204649925232, 0.3008764982223511, -0.0651334896683693, -0.1567111313343048, -0.11627800017595291, 0.0743706077337265, 0.02845492586493492, 0.07488644123077393, 0.007411450147628784, -0.06409267336130142, -0.5090036988258362, 0.03482671082019806, -0.32618337869644165, -0.5912933349609375, -0.0531468391418457, 0.1748252660036087, -0.42324018478393555, -0.1719433218240738, -0.6718006730079651, -0.0013164989650249481, -0.1686438024044037, -0.021299472078680992, -0.351436972618103, -0.14789262413978577, -0.1053205281496048, -0.17409346997737885, 0.2638726234436035, 0.3069562315940857, -0.16854628920555115, -0.22903068363666534, -0.19985440373420715, -0.18032598495483398, 0.1715085804462433, 0.18886588513851166, -0.49015718698501587, 0.4394935071468353, -0.32368141412734985, -0.11375617980957031, 0.5816370248794556, -0.46631279587745667, -0.17346875369548798, 0.3063003122806549, -0.004085011780261993, 0.18480293452739716, 0.17696386575698853, -0.07677151262760162, 0.36583709716796875, -0.13408268988132477, 0.062091559171676636, 0.8756173253059387, -0.08790656924247742, 0.012081073597073555, -0.26748332381248474, -0.36589357256889343, 0.19966517388820648, 0.3545733094215393, 0.13553869724273682, 0.15401285886764526, 0.06548722833395004, 0.26369303464889526, 0.2032966911792755, -0.11974361538887024, 0.07608792185783386, 0.3086537718772888, 0.2587825357913971, 0.020028751343488693, 0.0749732181429863, -0.12356842309236526, -0.5101427435874939, 0.3351292014122009, -0.04241221770644188, 0.04525567963719368, -0.35736173391342163, -0.1276521384716034, -0.2051618993282318, 0.07006523013114929, -0.402789443731308, -0.03613338991999626, 0.09424085915088654, 0.320743590593338, 0.2164677530527115, -0.25024017691612244, -0.20365463197231293, 0.36225786805152893, 0.11425057053565979, 0.0784664899110794, -0.18529000878334045, 0.6780503988265991, 0.05842384696006775, -0.17809078097343445, -0.11496548354625702, 0.20946887135505676, 0.06569327414035797, -0.2769717574119568, -0.0019130511209368706, 0.41317614912986755, 0.01691555045545101, 0.4686205983161926, 0.08684127777814865, 0.19327223300933838, 0.29106444120407104, -0.12490731477737427, 0.02991207130253315, -0.052397336810827255, -0.026940561830997467, 0.08976993709802628, -0.2633309066295624, 0.34643715620040894, -0.2256009727716446, 0.35073456168174744, 0.15957507491111755, -0.08943828195333481, 0.3817696273326874, -0.03592948243021965, -0.09725683927536011, -0.012870822101831436, -0.13044533133506775, 0.19207707047462463, 0.3649320602416992, 0.06154238432645798, -0.09770414978265762, -0.03998810797929764, 0.18714404106140137, -0.05229029059410095, -0.0068887099623680115, 0.0551593191921711, -0.05352272838354111, -0.114099882543087, -0.004792971536517143, 0.2650071978569031, 0.5078422427177429, 0.25574028491973877, 0.13561353087425232, 0.029122304171323776, -0.05348417907953262, -0.0044463276863098145, 0.2727358639240265, 0.15648561716079712, 0.2832987606525421, 0.22360223531723022, 0.08554264903068542, 0.001394379884004593, -0.24136313796043396, -0.11256392300128937, 0.09717651456594467, 0.06341761350631714, -0.1743958294391632, 0.10756804794073105, -0.10832475125789642, 0.3231523334980011, -0.4029679000377655, 0.12365640699863434, -0.2643119990825653, -0.2780287563800812, -0.12783154845237732, 0.43217888474464417, -0.13963592052459717, 0.06651127338409424, -0.05474238842725754, 0.3567827343940735, -0.19424554705619812, -0.5460314154624939, -0.11555740982294083, -0.15722528100013733, 0.04737017676234245, 0.05962352082133293, 0.26577135920524597, -0.08804608136415482, 0.2218966782093048, -0.12120706588029861, 0.13066045939922333, -0.31196463108062744, -0.04999452456831932, 0.24415245652198792, 0.03282300755381584, 0.24287989735603333, -0.020855620503425598, 0.0546271838247776, 0.3534201979637146, -0.41475048661231995, 0.22856643795967102, -0.22334110736846924, 0.04618947207927704, 0.0909002423286438, -0.08078381419181824, 0.13392207026481628, 0.034338001161813736, -0.18621358275413513, -0.4795096814632416, -0.49520695209503174, 0.02438276633620262, 0.19314533472061157, 0.11455674469470978, -0.05418621748685837, -0.04496750235557556, -0.2407151311635971, 0.20901910960674286, 0.040081992745399475, -0.02571972645819187, -0.3220134377479553, 0.3622100055217743, -0.22657334804534912, -0.021448589861392975, -0.1730392575263977, -0.20893403887748718, 0.5292026400566101, 0.15419845283031464, -0.26064491271972656, 0.013997708447277546, -0.11693300306797028, 0.32866713404655457, -0.12168198823928833, 0.10848649591207504, 0.5181266665458679, 0.17484226822853088, 0.05513863265514374, 0.040927954018116, -0.16978640854358673, 0.09216197580099106, 0.266749769449234, 0.06145615130662918, 0.15790295600891113, 0.07257144153118134, -0.1676817536354065, 0.555962860584259, -0.24796606600284576, -0.014482926577329636, 0.4367142617702484, -0.00707339309155941, 0.3039678633213043, -0.15355917811393738, -0.1745140254497528, -0.22952595353126526, -0.159481942653656, -0.18393154442310333, 0.23068228363990784, 0.021490607410669327, -0.2576240599155426, -0.2860363721847534, -0.2756473422050476, -0.22154268622398376, -0.40828120708465576, 0.07740157842636108, -0.10831275582313538, 0.18559147417545319, -0.20079222321510315, -0.0963144600391388, -0.34154218435287476, 0.2236352264881134, 0.1560320407152176, 0.14862287044525146, 0.14841599762439728, -0.10120325535535812, -0.44438299536705017, 0.20654186606407166, -0.06448983401060104, -0.024373352527618408, -0.2539956569671631, -0.043826647102832794, 0.1102249026298523, -0.38202598690986633, -0.05243155360221863, -0.11291380226612091, 0.6925046443939209, -0.1487998217344284, 0.07244062423706055, 0.1441841572523117, -0.2381795048713684, -0.4339340031147003, -0.15819118916988373, -0.019874073565006256, -0.11790519952774048, -0.13296207785606384, 0.7781628370285034, -0.3752445876598358, -0.3503108024597168, 0.014953960664570332, 0.3343563377857208, -0.3301933705806732, -0.22293058037757874, -0.11541154980659485, -0.018907874822616577, -0.42401599884033203, -0.02010314166545868, 0.03919621556997299, 0.5152043700218201, -0.06419570744037628, 0.06195631995797157, -0.262861967086792, -0.12685132026672363, 0.18433785438537598, 0.13128621876239777, 0.4869297742843628, -0.20634543895721436, 0.1716470718383789, 0.09666740894317627, 0.17354756593704224, 0.010909421369433403, 0.5878550410270691, -0.4166441261768341, -0.38498586416244507, 0.17078185081481934, 0.11818462610244751, 0.3106299638748169, 0.2799059748649597, 0.2124951332807541, -0.09007295221090317, -0.2287084460258484, 0.027336660772562027, -0.4892085790634155, 0.11135415732860565, 0.0208892785012722, -0.24927948415279388, -0.2533024549484253, -0.4165888726711273, 0.37520936131477356, 0.01329738274216652, -0.18447232246398926, -0.013009496033191681, 0.17294646799564362, -0.5654257535934448, 0.7654725909233093, 0.10811246931552887, 1.0762717723846436, -0.08449025452136993, 0.19236940145492554, 0.07936131954193115, -0.05317005142569542, 0.13354940712451935, -0.47980332374572754, -0.09020555764436722, -0.272105872631073, -0.01984579861164093, -0.01482574362307787, -0.1463787853717804, 0.06868007779121399, 0.3221193552017212, -0.15726931393146515, 0.21274662017822266, 0.03786298632621765, 0.3206479549407959, -0.10975240170955658, 0.44978487491607666, -0.07123956084251404, -0.3768266439437866, -0.35179704427719116, 0.08640873432159424, 0.03135126084089279, 0.05805563926696777, -0.09666197746992111, -0.23444068431854248, 0.07901136577129364, -0.1303843855857849, -0.07102790474891663, 0.03004295751452446, 0.016758928075432777, 0.27765733003616333, -0.016413003206253052, -0.18902552127838135, -0.06169592961668968, 0.28057631850242615, 0.39831119775772095, 0.04825753718614578, -0.2552574574947357, 0.15702950954437256, -0.2528713345527649, 0.1653604954481125, -0.2355550080537796, -0.1318996399641037, 0.2529473900794983, -0.1598481833934784, -0.15855461359024048, -0.11422396451234818, -0.10054569691419601, -0.5470198392868042, -0.0015972256660461426, -0.19661857187747955, 0.4353283643722534, -0.3088325262069702, -0.14616338908672333, 0.010558739304542542, 0.18924707174301147, -0.23926067352294922, 0.12412962317466736, -0.00006886571645736694, -0.2327844649553299, 0.14909079670906067, -0.1261010468006134, -0.2104520946741104, -0.17303366959095, 0.2493118941783905, 0.1888887882232666, -0.103535957634449, 0.340328574180603, -0.21679043769836426, -0.1301937699317932, -0.2267143726348877, 0.0807984247803688, 0.43595272302627563, -0.5757875442504883, 0.13046427071094513, -0.12201034277677536, -0.24642229080200195, 0.02744143083691597, 0.1900179237127304, 0.3461090326309204, 0.05377016216516495, -0.17301024496555328, -0.1801491379737854, -0.30108100175857544, 0.192154660820961, 0.028963914141058922, 0.33730021119117737, 0.3006258010864258, -0.16995719075202942, -0.15235352516174316, 0.08808407187461853, -0.35984429717063904, 0.012989822775125504, 0.00891035608947277, 0.060173407196998596, 0.027343953028321266, -0.1890716254711151, 0.14774224162101746, -0.047961749136447906, 0.14852771162986755, -0.17874091863632202, -0.22836725413799286, -0.18087583780288696, -0.14006628096103668, 0.18307878077030182, -0.008933380246162415, 0.1126115545630455, -0.14918673038482666, -0.04932999610900879, -0.0011450499296188354, -0.258667916059494, 0.3044569492340088, -0.03704662621021271, -0.01837693154811859, 0.05806856229901314, 0.6921906471252441, 0.17879469692707062, -0.5141153335571289, 0.170199453830719, 0.0167253240942955, 0.2880464494228363, 0.11172565817832947, 0.22138269245624542, -0.21298643946647644, -0.15958267450332642, -0.16861216723918915, 0.07311073690652847, 0.34964221715927124, 0.24428337812423706, 0.32692936062812805, 0.024572134017944336, -0.09133671224117279, 0.25539952516555786, 0.31845101714134216, 0.20176856219768524, -0.060763854533433914, -0.03617577999830246, 0.19780904054641724, 0.23562799394130707, -0.13119199872016907, -0.2981404662132263, 0.05216755345463753, -0.28235483169555664, 0.021306347101926804, 0.3129137456417084, 0.4901920258998871, 0.08255104720592499, 0.11415432393550873, 0.09087301045656204, 0.7566288113594055, 0.09686536341905594, 0.4155884087085724, 0.5809623599052429, -0.007922150194644928, 0.07643285393714905, 0.02077232301235199, 0.09227995574474335, 0.2834266126155853, 0.36343812942504883, -0.3660525381565094, 0.3207661509513855, -0.028866581618785858, -0.09551835060119629, 0.44780492782592773, -0.2291102558374405, 0.3065493106842041, -0.17596173286437988, 0.12076015025377274, -0.06330106407403946, -0.09754307568073273, 0.1002073884010315, -0.18346334993839264, -0.1987266093492508, -0.3162199556827545, 0.23890076577663422, -0.140419602394104, -0.16168685257434845, 0.00785701721906662, -0.35848623514175415, -0.3371201455593109, 0.052717406302690506, -0.12283122539520264, -0.38275158405303955, -0.16168129444122314, 0.03428258001804352, 0.10821253806352615, 0.1425507664680481, 0.29631945490837097, 0.12118813395500183, -0.06681763380765915, -0.21467286348342896, 0.08437417447566986, 0.12648995220661163, -0.14913976192474365, 0.01960539072751999, 0.10228769481182098, 0.30416712164878845, 0.26150232553482056, -0.18514487147331238, 0.020711258053779602, 0.1828697770833969, -0.049578793346881866, -0.0643029659986496, -0.2310541272163391, -0.25104179978370667, 0.2603314220905304, 0.32346171140670776, 0.24166876077651978, -0.15432365238666534, -0.22904740273952484, 0.06345412135124207, -0.0774478167295456, -0.3546738028526306, 0.5693658590316772, 0.4232792854309082, -0.12103712558746338, -0.04968319088220596, 0.2309744954109192, -0.3346366882324219, -0.2563340961933136, 0.2961485981941223, -0.025216270238161087, 0.08879446238279343, 0.12702716886997223, 0.0644230917096138, 0.2957174777984619, 0.4273761212825775, 0.13151849806308746, -0.2547123432159424, -0.2710290253162384, -0.109520323574543, -0.6645974516868591, 0.09170443564653397, 0.19731557369232178, 0.015124021098017693, 0.15634942054748535, 0.14242543280124664, 0.1695193648338318, 0.10438861697912216, -0.26488226652145386, 0.13104674220085144, 0.12282956391572952, 0.11511606723070145, -0.24585993587970734, -0.07127031683921814, 0.16522875428199768, -0.009497348219156265, -0.05606988072395325, -0.4509021043777466, 0.12379391491413116, 0.2107381373643875, 0.045994848012924194, 0.036740742623806, -0.05714438855648041, 0.1454569548368454, -0.10483528673648834, 0.3091553747653961, 0.0046236347407102585, 0.22573257982730865, -0.02979375049471855, -0.09562757611274719, -0.055181872099637985, -0.219339519739151, -0.17952467501163483, 0.025959666818380356, -0.1300913244485855, 0.22439365088939667, -0.3003731667995453, -0.06647798418998718, -0.5604401230812073, -0.1374882459640503, 0.06442072242498398, -0.12863434851169586, -0.33148112893104553, -0.05586916208267212, -0.09558835625648499, 0.055165499448776245, 0.26136094331741333, 0.09064044058322906, 0.03209859877824783, 0.07005362212657928, -0.1296963095664978, -0.10992955416440964, 0.34600475430488586, 0.007060510106384754, -0.36722949147224426, -0.2807070016860962, 0.16200673580169678, -0.02105461061000824, 0.2317579835653305, -0.49114397168159485, 0.0998496487736702, 0.39197808504104614, -0.09789378196001053, 0.14764398336410522, 0.42608001828193665, 0.283956378698349, -0.023566262796521187, -0.1957942694425583, 0.06433487683534622, 0.017916889861226082, -0.2120840847492218, -0.19637879729270935, -0.2507069706916809 ]
https://github.com/huggingface/datasets/issues/5044
integrate `load_from_disk` into `load_dataset`
I think the simplest is to always memory map the local file without copy, but still have a cached directory in the cache at `~/.cache/huggingface` instead of saving `map` results next to the original data. In practice we can even use symlinks if it makes the implementation simpler
**Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you!
48
integrate `load_from_disk` into `load_dataset` **Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you! I think the simplest is to always memory map the local file without copy, but still have a cached directory in the cache at `~/.cache/huggingface` instead of saving `map` results next to the original data. In practice we can even use symlinks if it makes the implementation simpler
[ -0.44635680317878723, -0.2547794580459595, 0.010255537927150726, 0.2019416093826294, 0.2771260142326355, -0.06415087729692459, 0.34563735127449036, 0.05371537804603577, 0.18767482042312622, 0.0032595768570899963, -0.12003012001514435, 0.4315917193889618, -0.21891242265701294, 0.3659507930278778, 0.1304887980222702, -0.031987108290195465, 0.09322202950716019, 0.14932434260845184, -0.19573140144348145, -0.06984389573335648, -0.18395498394966125, 0.2209053486585617, 0.11793144047260284, -0.04411688446998596, -0.11173413693904877, 0.18309085071086884, -0.1365537941455841, 0.11326459050178528, 0.0197085440158844, -0.3285708427429199, 0.6284780502319336, 0.2716442942619324, 0.3341926038265228, 0.3633251190185547, -0.00011232155520701781, 0.1923799067735672, 0.25741714239120483, -0.21307030320167542, -0.507559597492218, -0.34604889154434204, -0.06604377925395966, -0.15244938433170319, 0.3846595883369446, -0.30427679419517517, -0.11516166478395462, 0.09200955927371979, -0.11395889520645142, -0.26704615354537964, 0.35503774881362915, 0.12621402740478516, 0.19490507245063782, 0.4610063135623932, -0.11474540829658508, -0.15635262429714203, -0.04331285506486893, 0.41405385732650757, -0.15227332711219788, 0.19862477481365204, 0.3236578702926636, 0.11076841503381729, 0.03542458266019821, -0.1009954959154129, 0.017977194860577583, -0.07209663093090057, 0.42302027344703674, -0.006927105598151684, 0.30070945620536804, -0.0844963937997818, -0.2096083164215088, 0.17899908125400543, 0.5157183408737183, -0.39214658737182617, -0.3643263876438141, -0.5026596188545227, -0.13282747566699982, -0.16695989668369293, 0.09329231828451157, 0.07267232239246368, -0.17898188531398773, 0.2149742841720581, -0.1521054059267044, -0.26146239042282104, -0.25491923093795776, -0.11651460826396942, -0.2542811930179596, 0.353007048368454, 0.016999797895550728, 0.04191915690898895, 0.13370166718959808, 0.07342766225337982, 0.38972190022468567, -0.19089065492153168, 0.24229104816913605, 0.09421911835670471, -0.24278558790683746, -0.2565828859806061, 0.00013849884271621704, 0.022671040147542953, 0.06363434344530106, 0.4243124723434448, 0.21719910204410553, -0.008537530899047852, -0.06446804851293564, 0.23400971293449402, 0.4109697639942169, 0.12736648321151733, -0.14713141322135925, 0.15610776841640472, 0.2063167840242386, 0.12792259454727173, -0.11544084548950195, -0.010730881243944168, -0.08807200938463211, 0.01640136167407036, 0.1928263008594513, -0.07598569244146347, 0.19586119055747986, -0.0835166946053505, -0.03711214289069176, -0.3383900821208954, 0.5547189116477966, -0.10464300215244293, 0.20493869483470917, 0.19755050539970398, 0.039358384907245636, 0.4786982834339142, -0.1625950187444687, 0.36062055826187134, -0.10504639148712158, -0.1225094348192215, -0.19547757506370544, -0.20724661648273468, -0.05705943703651428, 0.07984813302755356, 0.1456216722726822, 0.13923588395118713, 0.1787695586681366, -0.08057089895009995, 0.12609204649925232, 0.3008764982223511, -0.0651334896683693, -0.1567111313343048, -0.11627800017595291, 0.0743706077337265, 0.02845492586493492, 0.07488644123077393, 0.007411450147628784, -0.06409267336130142, -0.5090036988258362, 0.03482671082019806, -0.32618337869644165, -0.5912933349609375, -0.0531468391418457, 0.1748252660036087, -0.42324018478393555, -0.1719433218240738, -0.6718006730079651, -0.0013164989650249481, -0.1686438024044037, -0.021299472078680992, -0.351436972618103, -0.14789262413978577, -0.1053205281496048, -0.17409346997737885, 0.2638726234436035, 0.3069562315940857, -0.16854628920555115, -0.22903068363666534, -0.19985440373420715, -0.18032598495483398, 0.1715085804462433, 0.18886588513851166, -0.49015718698501587, 0.4394935071468353, -0.32368141412734985, -0.11375617980957031, 0.5816370248794556, -0.46631279587745667, -0.17346875369548798, 0.3063003122806549, -0.004085011780261993, 0.18480293452739716, 0.17696386575698853, -0.07677151262760162, 0.36583709716796875, -0.13408268988132477, 0.062091559171676636, 0.8756173253059387, -0.08790656924247742, 0.012081073597073555, -0.26748332381248474, -0.36589357256889343, 0.19966517388820648, 0.3545733094215393, 0.13553869724273682, 0.15401285886764526, 0.06548722833395004, 0.26369303464889526, 0.2032966911792755, -0.11974361538887024, 0.07608792185783386, 0.3086537718772888, 0.2587825357913971, 0.020028751343488693, 0.0749732181429863, -0.12356842309236526, -0.5101427435874939, 0.3351292014122009, -0.04241221770644188, 0.04525567963719368, -0.35736173391342163, -0.1276521384716034, -0.2051618993282318, 0.07006523013114929, -0.402789443731308, -0.03613338991999626, 0.09424085915088654, 0.320743590593338, 0.2164677530527115, -0.25024017691612244, -0.20365463197231293, 0.36225786805152893, 0.11425057053565979, 0.0784664899110794, -0.18529000878334045, 0.6780503988265991, 0.05842384696006775, -0.17809078097343445, -0.11496548354625702, 0.20946887135505676, 0.06569327414035797, -0.2769717574119568, -0.0019130511209368706, 0.41317614912986755, 0.01691555045545101, 0.4686205983161926, 0.08684127777814865, 0.19327223300933838, 0.29106444120407104, -0.12490731477737427, 0.02991207130253315, -0.052397336810827255, -0.026940561830997467, 0.08976993709802628, -0.2633309066295624, 0.34643715620040894, -0.2256009727716446, 0.35073456168174744, 0.15957507491111755, -0.08943828195333481, 0.3817696273326874, -0.03592948243021965, -0.09725683927536011, -0.012870822101831436, -0.13044533133506775, 0.19207707047462463, 0.3649320602416992, 0.06154238432645798, -0.09770414978265762, -0.03998810797929764, 0.18714404106140137, -0.05229029059410095, -0.0068887099623680115, 0.0551593191921711, -0.05352272838354111, -0.114099882543087, -0.004792971536517143, 0.2650071978569031, 0.5078422427177429, 0.25574028491973877, 0.13561353087425232, 0.029122304171323776, -0.05348417907953262, -0.0044463276863098145, 0.2727358639240265, 0.15648561716079712, 0.2832987606525421, 0.22360223531723022, 0.08554264903068542, 0.001394379884004593, -0.24136313796043396, -0.11256392300128937, 0.09717651456594467, 0.06341761350631714, -0.1743958294391632, 0.10756804794073105, -0.10832475125789642, 0.3231523334980011, -0.4029679000377655, 0.12365640699863434, -0.2643119990825653, -0.2780287563800812, -0.12783154845237732, 0.43217888474464417, -0.13963592052459717, 0.06651127338409424, -0.05474238842725754, 0.3567827343940735, -0.19424554705619812, -0.5460314154624939, -0.11555740982294083, -0.15722528100013733, 0.04737017676234245, 0.05962352082133293, 0.26577135920524597, -0.08804608136415482, 0.2218966782093048, -0.12120706588029861, 0.13066045939922333, -0.31196463108062744, -0.04999452456831932, 0.24415245652198792, 0.03282300755381584, 0.24287989735603333, -0.020855620503425598, 0.0546271838247776, 0.3534201979637146, -0.41475048661231995, 0.22856643795967102, -0.22334110736846924, 0.04618947207927704, 0.0909002423286438, -0.08078381419181824, 0.13392207026481628, 0.034338001161813736, -0.18621358275413513, -0.4795096814632416, -0.49520695209503174, 0.02438276633620262, 0.19314533472061157, 0.11455674469470978, -0.05418621748685837, -0.04496750235557556, -0.2407151311635971, 0.20901910960674286, 0.040081992745399475, -0.02571972645819187, -0.3220134377479553, 0.3622100055217743, -0.22657334804534912, -0.021448589861392975, -0.1730392575263977, -0.20893403887748718, 0.5292026400566101, 0.15419845283031464, -0.26064491271972656, 0.013997708447277546, -0.11693300306797028, 0.32866713404655457, -0.12168198823928833, 0.10848649591207504, 0.5181266665458679, 0.17484226822853088, 0.05513863265514374, 0.040927954018116, -0.16978640854358673, 0.09216197580099106, 0.266749769449234, 0.06145615130662918, 0.15790295600891113, 0.07257144153118134, -0.1676817536354065, 0.555962860584259, -0.24796606600284576, -0.014482926577329636, 0.4367142617702484, -0.00707339309155941, 0.3039678633213043, -0.15355917811393738, -0.1745140254497528, -0.22952595353126526, -0.159481942653656, -0.18393154442310333, 0.23068228363990784, 0.021490607410669327, -0.2576240599155426, -0.2860363721847534, -0.2756473422050476, -0.22154268622398376, -0.40828120708465576, 0.07740157842636108, -0.10831275582313538, 0.18559147417545319, -0.20079222321510315, -0.0963144600391388, -0.34154218435287476, 0.2236352264881134, 0.1560320407152176, 0.14862287044525146, 0.14841599762439728, -0.10120325535535812, -0.44438299536705017, 0.20654186606407166, -0.06448983401060104, -0.024373352527618408, -0.2539956569671631, -0.043826647102832794, 0.1102249026298523, -0.38202598690986633, -0.05243155360221863, -0.11291380226612091, 0.6925046443939209, -0.1487998217344284, 0.07244062423706055, 0.1441841572523117, -0.2381795048713684, -0.4339340031147003, -0.15819118916988373, -0.019874073565006256, -0.11790519952774048, -0.13296207785606384, 0.7781628370285034, -0.3752445876598358, -0.3503108024597168, 0.014953960664570332, 0.3343563377857208, -0.3301933705806732, -0.22293058037757874, -0.11541154980659485, -0.018907874822616577, -0.42401599884033203, -0.02010314166545868, 0.03919621556997299, 0.5152043700218201, -0.06419570744037628, 0.06195631995797157, -0.262861967086792, -0.12685132026672363, 0.18433785438537598, 0.13128621876239777, 0.4869297742843628, -0.20634543895721436, 0.1716470718383789, 0.09666740894317627, 0.17354756593704224, 0.010909421369433403, 0.5878550410270691, -0.4166441261768341, -0.38498586416244507, 0.17078185081481934, 0.11818462610244751, 0.3106299638748169, 0.2799059748649597, 0.2124951332807541, -0.09007295221090317, -0.2287084460258484, 0.027336660772562027, -0.4892085790634155, 0.11135415732860565, 0.0208892785012722, -0.24927948415279388, -0.2533024549484253, -0.4165888726711273, 0.37520936131477356, 0.01329738274216652, -0.18447232246398926, -0.013009496033191681, 0.17294646799564362, -0.5654257535934448, 0.7654725909233093, 0.10811246931552887, 1.0762717723846436, -0.08449025452136993, 0.19236940145492554, 0.07936131954193115, -0.05317005142569542, 0.13354940712451935, -0.47980332374572754, -0.09020555764436722, -0.272105872631073, -0.01984579861164093, -0.01482574362307787, -0.1463787853717804, 0.06868007779121399, 0.3221193552017212, -0.15726931393146515, 0.21274662017822266, 0.03786298632621765, 0.3206479549407959, -0.10975240170955658, 0.44978487491607666, -0.07123956084251404, -0.3768266439437866, -0.35179704427719116, 0.08640873432159424, 0.03135126084089279, 0.05805563926696777, -0.09666197746992111, -0.23444068431854248, 0.07901136577129364, -0.1303843855857849, -0.07102790474891663, 0.03004295751452446, 0.016758928075432777, 0.27765733003616333, -0.016413003206253052, -0.18902552127838135, -0.06169592961668968, 0.28057631850242615, 0.39831119775772095, 0.04825753718614578, -0.2552574574947357, 0.15702950954437256, -0.2528713345527649, 0.1653604954481125, -0.2355550080537796, -0.1318996399641037, 0.2529473900794983, -0.1598481833934784, -0.15855461359024048, -0.11422396451234818, -0.10054569691419601, -0.5470198392868042, -0.0015972256660461426, -0.19661857187747955, 0.4353283643722534, -0.3088325262069702, -0.14616338908672333, 0.010558739304542542, 0.18924707174301147, -0.23926067352294922, 0.12412962317466736, -0.00006886571645736694, -0.2327844649553299, 0.14909079670906067, -0.1261010468006134, -0.2104520946741104, -0.17303366959095, 0.2493118941783905, 0.1888887882232666, -0.103535957634449, 0.340328574180603, -0.21679043769836426, -0.1301937699317932, -0.2267143726348877, 0.0807984247803688, 0.43595272302627563, -0.5757875442504883, 0.13046427071094513, -0.12201034277677536, -0.24642229080200195, 0.02744143083691597, 0.1900179237127304, 0.3461090326309204, 0.05377016216516495, -0.17301024496555328, -0.1801491379737854, -0.30108100175857544, 0.192154660820961, 0.028963914141058922, 0.33730021119117737, 0.3006258010864258, -0.16995719075202942, -0.15235352516174316, 0.08808407187461853, -0.35984429717063904, 0.012989822775125504, 0.00891035608947277, 0.060173407196998596, 0.027343953028321266, -0.1890716254711151, 0.14774224162101746, -0.047961749136447906, 0.14852771162986755, -0.17874091863632202, -0.22836725413799286, -0.18087583780288696, -0.14006628096103668, 0.18307878077030182, -0.008933380246162415, 0.1126115545630455, -0.14918673038482666, -0.04932999610900879, -0.0011450499296188354, -0.258667916059494, 0.3044569492340088, -0.03704662621021271, -0.01837693154811859, 0.05806856229901314, 0.6921906471252441, 0.17879469692707062, -0.5141153335571289, 0.170199453830719, 0.0167253240942955, 0.2880464494228363, 0.11172565817832947, 0.22138269245624542, -0.21298643946647644, -0.15958267450332642, -0.16861216723918915, 0.07311073690652847, 0.34964221715927124, 0.24428337812423706, 0.32692936062812805, 0.024572134017944336, -0.09133671224117279, 0.25539952516555786, 0.31845101714134216, 0.20176856219768524, -0.060763854533433914, -0.03617577999830246, 0.19780904054641724, 0.23562799394130707, -0.13119199872016907, -0.2981404662132263, 0.05216755345463753, -0.28235483169555664, 0.021306347101926804, 0.3129137456417084, 0.4901920258998871, 0.08255104720592499, 0.11415432393550873, 0.09087301045656204, 0.7566288113594055, 0.09686536341905594, 0.4155884087085724, 0.5809623599052429, -0.007922150194644928, 0.07643285393714905, 0.02077232301235199, 0.09227995574474335, 0.2834266126155853, 0.36343812942504883, -0.3660525381565094, 0.3207661509513855, -0.028866581618785858, -0.09551835060119629, 0.44780492782592773, -0.2291102558374405, 0.3065493106842041, -0.17596173286437988, 0.12076015025377274, -0.06330106407403946, -0.09754307568073273, 0.1002073884010315, -0.18346334993839264, -0.1987266093492508, -0.3162199556827545, 0.23890076577663422, -0.140419602394104, -0.16168685257434845, 0.00785701721906662, -0.35848623514175415, -0.3371201455593109, 0.052717406302690506, -0.12283122539520264, -0.38275158405303955, -0.16168129444122314, 0.03428258001804352, 0.10821253806352615, 0.1425507664680481, 0.29631945490837097, 0.12118813395500183, -0.06681763380765915, -0.21467286348342896, 0.08437417447566986, 0.12648995220661163, -0.14913976192474365, 0.01960539072751999, 0.10228769481182098, 0.30416712164878845, 0.26150232553482056, -0.18514487147331238, 0.020711258053779602, 0.1828697770833969, -0.049578793346881866, -0.0643029659986496, -0.2310541272163391, -0.25104179978370667, 0.2603314220905304, 0.32346171140670776, 0.24166876077651978, -0.15432365238666534, -0.22904740273952484, 0.06345412135124207, -0.0774478167295456, -0.3546738028526306, 0.5693658590316772, 0.4232792854309082, -0.12103712558746338, -0.04968319088220596, 0.2309744954109192, -0.3346366882324219, -0.2563340961933136, 0.2961485981941223, -0.025216270238161087, 0.08879446238279343, 0.12702716886997223, 0.0644230917096138, 0.2957174777984619, 0.4273761212825775, 0.13151849806308746, -0.2547123432159424, -0.2710290253162384, -0.109520323574543, -0.6645974516868591, 0.09170443564653397, 0.19731557369232178, 0.015124021098017693, 0.15634942054748535, 0.14242543280124664, 0.1695193648338318, 0.10438861697912216, -0.26488226652145386, 0.13104674220085144, 0.12282956391572952, 0.11511606723070145, -0.24585993587970734, -0.07127031683921814, 0.16522875428199768, -0.009497348219156265, -0.05606988072395325, -0.4509021043777466, 0.12379391491413116, 0.2107381373643875, 0.045994848012924194, 0.036740742623806, -0.05714438855648041, 0.1454569548368454, -0.10483528673648834, 0.3091553747653961, 0.0046236347407102585, 0.22573257982730865, -0.02979375049471855, -0.09562757611274719, -0.055181872099637985, -0.219339519739151, -0.17952467501163483, 0.025959666818380356, -0.1300913244485855, 0.22439365088939667, -0.3003731667995453, -0.06647798418998718, -0.5604401230812073, -0.1374882459640503, 0.06442072242498398, -0.12863434851169586, -0.33148112893104553, -0.05586916208267212, -0.09558835625648499, 0.055165499448776245, 0.26136094331741333, 0.09064044058322906, 0.03209859877824783, 0.07005362212657928, -0.1296963095664978, -0.10992955416440964, 0.34600475430488586, 0.007060510106384754, -0.36722949147224426, -0.2807070016860962, 0.16200673580169678, -0.02105461061000824, 0.2317579835653305, -0.49114397168159485, 0.0998496487736702, 0.39197808504104614, -0.09789378196001053, 0.14764398336410522, 0.42608001828193665, 0.283956378698349, -0.023566262796521187, -0.1957942694425583, 0.06433487683534622, 0.017916889861226082, -0.2120840847492218, -0.19637879729270935, -0.2507069706916809 ]
https://github.com/huggingface/datasets/issues/5044
integrate `load_from_disk` into `load_dataset`
Yes, so that you always have the cached entry for any dataset, but the "payload" doesn't have to be physically in the cache if it's already on the local filesystem. As you said a symlink will do.
**Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you!
37
integrate `load_from_disk` into `load_dataset` **Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you! Yes, so that you always have the cached entry for any dataset, but the "payload" doesn't have to be physically in the cache if it's already on the local filesystem. As you said a symlink will do.
[ -0.44635680317878723, -0.2547794580459595, 0.010255537927150726, 0.2019416093826294, 0.2771260142326355, -0.06415087729692459, 0.34563735127449036, 0.05371537804603577, 0.18767482042312622, 0.0032595768570899963, -0.12003012001514435, 0.4315917193889618, -0.21891242265701294, 0.3659507930278778, 0.1304887980222702, -0.031987108290195465, 0.09322202950716019, 0.14932434260845184, -0.19573140144348145, -0.06984389573335648, -0.18395498394966125, 0.2209053486585617, 0.11793144047260284, -0.04411688446998596, -0.11173413693904877, 0.18309085071086884, -0.1365537941455841, 0.11326459050178528, 0.0197085440158844, -0.3285708427429199, 0.6284780502319336, 0.2716442942619324, 0.3341926038265228, 0.3633251190185547, -0.00011232155520701781, 0.1923799067735672, 0.25741714239120483, -0.21307030320167542, -0.507559597492218, -0.34604889154434204, -0.06604377925395966, -0.15244938433170319, 0.3846595883369446, -0.30427679419517517, -0.11516166478395462, 0.09200955927371979, -0.11395889520645142, -0.26704615354537964, 0.35503774881362915, 0.12621402740478516, 0.19490507245063782, 0.4610063135623932, -0.11474540829658508, -0.15635262429714203, -0.04331285506486893, 0.41405385732650757, -0.15227332711219788, 0.19862477481365204, 0.3236578702926636, 0.11076841503381729, 0.03542458266019821, -0.1009954959154129, 0.017977194860577583, -0.07209663093090057, 0.42302027344703674, -0.006927105598151684, 0.30070945620536804, -0.0844963937997818, -0.2096083164215088, 0.17899908125400543, 0.5157183408737183, -0.39214658737182617, -0.3643263876438141, -0.5026596188545227, -0.13282747566699982, -0.16695989668369293, 0.09329231828451157, 0.07267232239246368, -0.17898188531398773, 0.2149742841720581, -0.1521054059267044, -0.26146239042282104, -0.25491923093795776, -0.11651460826396942, -0.2542811930179596, 0.353007048368454, 0.016999797895550728, 0.04191915690898895, 0.13370166718959808, 0.07342766225337982, 0.38972190022468567, -0.19089065492153168, 0.24229104816913605, 0.09421911835670471, -0.24278558790683746, -0.2565828859806061, 0.00013849884271621704, 0.022671040147542953, 0.06363434344530106, 0.4243124723434448, 0.21719910204410553, -0.008537530899047852, -0.06446804851293564, 0.23400971293449402, 0.4109697639942169, 0.12736648321151733, -0.14713141322135925, 0.15610776841640472, 0.2063167840242386, 0.12792259454727173, -0.11544084548950195, -0.010730881243944168, -0.08807200938463211, 0.01640136167407036, 0.1928263008594513, -0.07598569244146347, 0.19586119055747986, -0.0835166946053505, -0.03711214289069176, -0.3383900821208954, 0.5547189116477966, -0.10464300215244293, 0.20493869483470917, 0.19755050539970398, 0.039358384907245636, 0.4786982834339142, -0.1625950187444687, 0.36062055826187134, -0.10504639148712158, -0.1225094348192215, -0.19547757506370544, -0.20724661648273468, -0.05705943703651428, 0.07984813302755356, 0.1456216722726822, 0.13923588395118713, 0.1787695586681366, -0.08057089895009995, 0.12609204649925232, 0.3008764982223511, -0.0651334896683693, -0.1567111313343048, -0.11627800017595291, 0.0743706077337265, 0.02845492586493492, 0.07488644123077393, 0.007411450147628784, -0.06409267336130142, -0.5090036988258362, 0.03482671082019806, -0.32618337869644165, -0.5912933349609375, -0.0531468391418457, 0.1748252660036087, -0.42324018478393555, -0.1719433218240738, -0.6718006730079651, -0.0013164989650249481, -0.1686438024044037, -0.021299472078680992, -0.351436972618103, -0.14789262413978577, -0.1053205281496048, -0.17409346997737885, 0.2638726234436035, 0.3069562315940857, -0.16854628920555115, -0.22903068363666534, -0.19985440373420715, -0.18032598495483398, 0.1715085804462433, 0.18886588513851166, -0.49015718698501587, 0.4394935071468353, -0.32368141412734985, -0.11375617980957031, 0.5816370248794556, -0.46631279587745667, -0.17346875369548798, 0.3063003122806549, -0.004085011780261993, 0.18480293452739716, 0.17696386575698853, -0.07677151262760162, 0.36583709716796875, -0.13408268988132477, 0.062091559171676636, 0.8756173253059387, -0.08790656924247742, 0.012081073597073555, -0.26748332381248474, -0.36589357256889343, 0.19966517388820648, 0.3545733094215393, 0.13553869724273682, 0.15401285886764526, 0.06548722833395004, 0.26369303464889526, 0.2032966911792755, -0.11974361538887024, 0.07608792185783386, 0.3086537718772888, 0.2587825357913971, 0.020028751343488693, 0.0749732181429863, -0.12356842309236526, -0.5101427435874939, 0.3351292014122009, -0.04241221770644188, 0.04525567963719368, -0.35736173391342163, -0.1276521384716034, -0.2051618993282318, 0.07006523013114929, -0.402789443731308, -0.03613338991999626, 0.09424085915088654, 0.320743590593338, 0.2164677530527115, -0.25024017691612244, -0.20365463197231293, 0.36225786805152893, 0.11425057053565979, 0.0784664899110794, -0.18529000878334045, 0.6780503988265991, 0.05842384696006775, -0.17809078097343445, -0.11496548354625702, 0.20946887135505676, 0.06569327414035797, -0.2769717574119568, -0.0019130511209368706, 0.41317614912986755, 0.01691555045545101, 0.4686205983161926, 0.08684127777814865, 0.19327223300933838, 0.29106444120407104, -0.12490731477737427, 0.02991207130253315, -0.052397336810827255, -0.026940561830997467, 0.08976993709802628, -0.2633309066295624, 0.34643715620040894, -0.2256009727716446, 0.35073456168174744, 0.15957507491111755, -0.08943828195333481, 0.3817696273326874, -0.03592948243021965, -0.09725683927536011, -0.012870822101831436, -0.13044533133506775, 0.19207707047462463, 0.3649320602416992, 0.06154238432645798, -0.09770414978265762, -0.03998810797929764, 0.18714404106140137, -0.05229029059410095, -0.0068887099623680115, 0.0551593191921711, -0.05352272838354111, -0.114099882543087, -0.004792971536517143, 0.2650071978569031, 0.5078422427177429, 0.25574028491973877, 0.13561353087425232, 0.029122304171323776, -0.05348417907953262, -0.0044463276863098145, 0.2727358639240265, 0.15648561716079712, 0.2832987606525421, 0.22360223531723022, 0.08554264903068542, 0.001394379884004593, -0.24136313796043396, -0.11256392300128937, 0.09717651456594467, 0.06341761350631714, -0.1743958294391632, 0.10756804794073105, -0.10832475125789642, 0.3231523334980011, -0.4029679000377655, 0.12365640699863434, -0.2643119990825653, -0.2780287563800812, -0.12783154845237732, 0.43217888474464417, -0.13963592052459717, 0.06651127338409424, -0.05474238842725754, 0.3567827343940735, -0.19424554705619812, -0.5460314154624939, -0.11555740982294083, -0.15722528100013733, 0.04737017676234245, 0.05962352082133293, 0.26577135920524597, -0.08804608136415482, 0.2218966782093048, -0.12120706588029861, 0.13066045939922333, -0.31196463108062744, -0.04999452456831932, 0.24415245652198792, 0.03282300755381584, 0.24287989735603333, -0.020855620503425598, 0.0546271838247776, 0.3534201979637146, -0.41475048661231995, 0.22856643795967102, -0.22334110736846924, 0.04618947207927704, 0.0909002423286438, -0.08078381419181824, 0.13392207026481628, 0.034338001161813736, -0.18621358275413513, -0.4795096814632416, -0.49520695209503174, 0.02438276633620262, 0.19314533472061157, 0.11455674469470978, -0.05418621748685837, -0.04496750235557556, -0.2407151311635971, 0.20901910960674286, 0.040081992745399475, -0.02571972645819187, -0.3220134377479553, 0.3622100055217743, -0.22657334804534912, -0.021448589861392975, -0.1730392575263977, -0.20893403887748718, 0.5292026400566101, 0.15419845283031464, -0.26064491271972656, 0.013997708447277546, -0.11693300306797028, 0.32866713404655457, -0.12168198823928833, 0.10848649591207504, 0.5181266665458679, 0.17484226822853088, 0.05513863265514374, 0.040927954018116, -0.16978640854358673, 0.09216197580099106, 0.266749769449234, 0.06145615130662918, 0.15790295600891113, 0.07257144153118134, -0.1676817536354065, 0.555962860584259, -0.24796606600284576, -0.014482926577329636, 0.4367142617702484, -0.00707339309155941, 0.3039678633213043, -0.15355917811393738, -0.1745140254497528, -0.22952595353126526, -0.159481942653656, -0.18393154442310333, 0.23068228363990784, 0.021490607410669327, -0.2576240599155426, -0.2860363721847534, -0.2756473422050476, -0.22154268622398376, -0.40828120708465576, 0.07740157842636108, -0.10831275582313538, 0.18559147417545319, -0.20079222321510315, -0.0963144600391388, -0.34154218435287476, 0.2236352264881134, 0.1560320407152176, 0.14862287044525146, 0.14841599762439728, -0.10120325535535812, -0.44438299536705017, 0.20654186606407166, -0.06448983401060104, -0.024373352527618408, -0.2539956569671631, -0.043826647102832794, 0.1102249026298523, -0.38202598690986633, -0.05243155360221863, -0.11291380226612091, 0.6925046443939209, -0.1487998217344284, 0.07244062423706055, 0.1441841572523117, -0.2381795048713684, -0.4339340031147003, -0.15819118916988373, -0.019874073565006256, -0.11790519952774048, -0.13296207785606384, 0.7781628370285034, -0.3752445876598358, -0.3503108024597168, 0.014953960664570332, 0.3343563377857208, -0.3301933705806732, -0.22293058037757874, -0.11541154980659485, -0.018907874822616577, -0.42401599884033203, -0.02010314166545868, 0.03919621556997299, 0.5152043700218201, -0.06419570744037628, 0.06195631995797157, -0.262861967086792, -0.12685132026672363, 0.18433785438537598, 0.13128621876239777, 0.4869297742843628, -0.20634543895721436, 0.1716470718383789, 0.09666740894317627, 0.17354756593704224, 0.010909421369433403, 0.5878550410270691, -0.4166441261768341, -0.38498586416244507, 0.17078185081481934, 0.11818462610244751, 0.3106299638748169, 0.2799059748649597, 0.2124951332807541, -0.09007295221090317, -0.2287084460258484, 0.027336660772562027, -0.4892085790634155, 0.11135415732860565, 0.0208892785012722, -0.24927948415279388, -0.2533024549484253, -0.4165888726711273, 0.37520936131477356, 0.01329738274216652, -0.18447232246398926, -0.013009496033191681, 0.17294646799564362, -0.5654257535934448, 0.7654725909233093, 0.10811246931552887, 1.0762717723846436, -0.08449025452136993, 0.19236940145492554, 0.07936131954193115, -0.05317005142569542, 0.13354940712451935, -0.47980332374572754, -0.09020555764436722, -0.272105872631073, -0.01984579861164093, -0.01482574362307787, -0.1463787853717804, 0.06868007779121399, 0.3221193552017212, -0.15726931393146515, 0.21274662017822266, 0.03786298632621765, 0.3206479549407959, -0.10975240170955658, 0.44978487491607666, -0.07123956084251404, -0.3768266439437866, -0.35179704427719116, 0.08640873432159424, 0.03135126084089279, 0.05805563926696777, -0.09666197746992111, -0.23444068431854248, 0.07901136577129364, -0.1303843855857849, -0.07102790474891663, 0.03004295751452446, 0.016758928075432777, 0.27765733003616333, -0.016413003206253052, -0.18902552127838135, -0.06169592961668968, 0.28057631850242615, 0.39831119775772095, 0.04825753718614578, -0.2552574574947357, 0.15702950954437256, -0.2528713345527649, 0.1653604954481125, -0.2355550080537796, -0.1318996399641037, 0.2529473900794983, -0.1598481833934784, -0.15855461359024048, -0.11422396451234818, -0.10054569691419601, -0.5470198392868042, -0.0015972256660461426, -0.19661857187747955, 0.4353283643722534, -0.3088325262069702, -0.14616338908672333, 0.010558739304542542, 0.18924707174301147, -0.23926067352294922, 0.12412962317466736, -0.00006886571645736694, -0.2327844649553299, 0.14909079670906067, -0.1261010468006134, -0.2104520946741104, -0.17303366959095, 0.2493118941783905, 0.1888887882232666, -0.103535957634449, 0.340328574180603, -0.21679043769836426, -0.1301937699317932, -0.2267143726348877, 0.0807984247803688, 0.43595272302627563, -0.5757875442504883, 0.13046427071094513, -0.12201034277677536, -0.24642229080200195, 0.02744143083691597, 0.1900179237127304, 0.3461090326309204, 0.05377016216516495, -0.17301024496555328, -0.1801491379737854, -0.30108100175857544, 0.192154660820961, 0.028963914141058922, 0.33730021119117737, 0.3006258010864258, -0.16995719075202942, -0.15235352516174316, 0.08808407187461853, -0.35984429717063904, 0.012989822775125504, 0.00891035608947277, 0.060173407196998596, 0.027343953028321266, -0.1890716254711151, 0.14774224162101746, -0.047961749136447906, 0.14852771162986755, -0.17874091863632202, -0.22836725413799286, -0.18087583780288696, -0.14006628096103668, 0.18307878077030182, -0.008933380246162415, 0.1126115545630455, -0.14918673038482666, -0.04932999610900879, -0.0011450499296188354, -0.258667916059494, 0.3044569492340088, -0.03704662621021271, -0.01837693154811859, 0.05806856229901314, 0.6921906471252441, 0.17879469692707062, -0.5141153335571289, 0.170199453830719, 0.0167253240942955, 0.2880464494228363, 0.11172565817832947, 0.22138269245624542, -0.21298643946647644, -0.15958267450332642, -0.16861216723918915, 0.07311073690652847, 0.34964221715927124, 0.24428337812423706, 0.32692936062812805, 0.024572134017944336, -0.09133671224117279, 0.25539952516555786, 0.31845101714134216, 0.20176856219768524, -0.060763854533433914, -0.03617577999830246, 0.19780904054641724, 0.23562799394130707, -0.13119199872016907, -0.2981404662132263, 0.05216755345463753, -0.28235483169555664, 0.021306347101926804, 0.3129137456417084, 0.4901920258998871, 0.08255104720592499, 0.11415432393550873, 0.09087301045656204, 0.7566288113594055, 0.09686536341905594, 0.4155884087085724, 0.5809623599052429, -0.007922150194644928, 0.07643285393714905, 0.02077232301235199, 0.09227995574474335, 0.2834266126155853, 0.36343812942504883, -0.3660525381565094, 0.3207661509513855, -0.028866581618785858, -0.09551835060119629, 0.44780492782592773, -0.2291102558374405, 0.3065493106842041, -0.17596173286437988, 0.12076015025377274, -0.06330106407403946, -0.09754307568073273, 0.1002073884010315, -0.18346334993839264, -0.1987266093492508, -0.3162199556827545, 0.23890076577663422, -0.140419602394104, -0.16168685257434845, 0.00785701721906662, -0.35848623514175415, -0.3371201455593109, 0.052717406302690506, -0.12283122539520264, -0.38275158405303955, -0.16168129444122314, 0.03428258001804352, 0.10821253806352615, 0.1425507664680481, 0.29631945490837097, 0.12118813395500183, -0.06681763380765915, -0.21467286348342896, 0.08437417447566986, 0.12648995220661163, -0.14913976192474365, 0.01960539072751999, 0.10228769481182098, 0.30416712164878845, 0.26150232553482056, -0.18514487147331238, 0.020711258053779602, 0.1828697770833969, -0.049578793346881866, -0.0643029659986496, -0.2310541272163391, -0.25104179978370667, 0.2603314220905304, 0.32346171140670776, 0.24166876077651978, -0.15432365238666534, -0.22904740273952484, 0.06345412135124207, -0.0774478167295456, -0.3546738028526306, 0.5693658590316772, 0.4232792854309082, -0.12103712558746338, -0.04968319088220596, 0.2309744954109192, -0.3346366882324219, -0.2563340961933136, 0.2961485981941223, -0.025216270238161087, 0.08879446238279343, 0.12702716886997223, 0.0644230917096138, 0.2957174777984619, 0.4273761212825775, 0.13151849806308746, -0.2547123432159424, -0.2710290253162384, -0.109520323574543, -0.6645974516868591, 0.09170443564653397, 0.19731557369232178, 0.015124021098017693, 0.15634942054748535, 0.14242543280124664, 0.1695193648338318, 0.10438861697912216, -0.26488226652145386, 0.13104674220085144, 0.12282956391572952, 0.11511606723070145, -0.24585993587970734, -0.07127031683921814, 0.16522875428199768, -0.009497348219156265, -0.05606988072395325, -0.4509021043777466, 0.12379391491413116, 0.2107381373643875, 0.045994848012924194, 0.036740742623806, -0.05714438855648041, 0.1454569548368454, -0.10483528673648834, 0.3091553747653961, 0.0046236347407102585, 0.22573257982730865, -0.02979375049471855, -0.09562757611274719, -0.055181872099637985, -0.219339519739151, -0.17952467501163483, 0.025959666818380356, -0.1300913244485855, 0.22439365088939667, -0.3003731667995453, -0.06647798418998718, -0.5604401230812073, -0.1374882459640503, 0.06442072242498398, -0.12863434851169586, -0.33148112893104553, -0.05586916208267212, -0.09558835625648499, 0.055165499448776245, 0.26136094331741333, 0.09064044058322906, 0.03209859877824783, 0.07005362212657928, -0.1296963095664978, -0.10992955416440964, 0.34600475430488586, 0.007060510106384754, -0.36722949147224426, -0.2807070016860962, 0.16200673580169678, -0.02105461061000824, 0.2317579835653305, -0.49114397168159485, 0.0998496487736702, 0.39197808504104614, -0.09789378196001053, 0.14764398336410522, 0.42608001828193665, 0.283956378698349, -0.023566262796521187, -0.1957942694425583, 0.06433487683534622, 0.017916889861226082, -0.2120840847492218, -0.19637879729270935, -0.2507069706916809 ]
https://github.com/huggingface/datasets/issues/5044
integrate `load_from_disk` into `load_dataset`
We haven't had the bandwidth to implement this so far. Let me know if you'd be interested in contributing this feature :)
**Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you!
22
integrate `load_from_disk` into `load_dataset` **Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you! We haven't had the bandwidth to implement this so far. Let me know if you'd be interested in contributing this feature :)
[ -0.44635680317878723, -0.2547794580459595, 0.010255537927150726, 0.2019416093826294, 0.2771260142326355, -0.06415087729692459, 0.34563735127449036, 0.05371537804603577, 0.18767482042312622, 0.0032595768570899963, -0.12003012001514435, 0.4315917193889618, -0.21891242265701294, 0.3659507930278778, 0.1304887980222702, -0.031987108290195465, 0.09322202950716019, 0.14932434260845184, -0.19573140144348145, -0.06984389573335648, -0.18395498394966125, 0.2209053486585617, 0.11793144047260284, -0.04411688446998596, -0.11173413693904877, 0.18309085071086884, -0.1365537941455841, 0.11326459050178528, 0.0197085440158844, -0.3285708427429199, 0.6284780502319336, 0.2716442942619324, 0.3341926038265228, 0.3633251190185547, -0.00011232155520701781, 0.1923799067735672, 0.25741714239120483, -0.21307030320167542, -0.507559597492218, -0.34604889154434204, -0.06604377925395966, -0.15244938433170319, 0.3846595883369446, -0.30427679419517517, -0.11516166478395462, 0.09200955927371979, -0.11395889520645142, -0.26704615354537964, 0.35503774881362915, 0.12621402740478516, 0.19490507245063782, 0.4610063135623932, -0.11474540829658508, -0.15635262429714203, -0.04331285506486893, 0.41405385732650757, -0.15227332711219788, 0.19862477481365204, 0.3236578702926636, 0.11076841503381729, 0.03542458266019821, -0.1009954959154129, 0.017977194860577583, -0.07209663093090057, 0.42302027344703674, -0.006927105598151684, 0.30070945620536804, -0.0844963937997818, -0.2096083164215088, 0.17899908125400543, 0.5157183408737183, -0.39214658737182617, -0.3643263876438141, -0.5026596188545227, -0.13282747566699982, -0.16695989668369293, 0.09329231828451157, 0.07267232239246368, -0.17898188531398773, 0.2149742841720581, -0.1521054059267044, -0.26146239042282104, -0.25491923093795776, -0.11651460826396942, -0.2542811930179596, 0.353007048368454, 0.016999797895550728, 0.04191915690898895, 0.13370166718959808, 0.07342766225337982, 0.38972190022468567, -0.19089065492153168, 0.24229104816913605, 0.09421911835670471, -0.24278558790683746, -0.2565828859806061, 0.00013849884271621704, 0.022671040147542953, 0.06363434344530106, 0.4243124723434448, 0.21719910204410553, -0.008537530899047852, -0.06446804851293564, 0.23400971293449402, 0.4109697639942169, 0.12736648321151733, -0.14713141322135925, 0.15610776841640472, 0.2063167840242386, 0.12792259454727173, -0.11544084548950195, -0.010730881243944168, -0.08807200938463211, 0.01640136167407036, 0.1928263008594513, -0.07598569244146347, 0.19586119055747986, -0.0835166946053505, -0.03711214289069176, -0.3383900821208954, 0.5547189116477966, -0.10464300215244293, 0.20493869483470917, 0.19755050539970398, 0.039358384907245636, 0.4786982834339142, -0.1625950187444687, 0.36062055826187134, -0.10504639148712158, -0.1225094348192215, -0.19547757506370544, -0.20724661648273468, -0.05705943703651428, 0.07984813302755356, 0.1456216722726822, 0.13923588395118713, 0.1787695586681366, -0.08057089895009995, 0.12609204649925232, 0.3008764982223511, -0.0651334896683693, -0.1567111313343048, -0.11627800017595291, 0.0743706077337265, 0.02845492586493492, 0.07488644123077393, 0.007411450147628784, -0.06409267336130142, -0.5090036988258362, 0.03482671082019806, -0.32618337869644165, -0.5912933349609375, -0.0531468391418457, 0.1748252660036087, -0.42324018478393555, -0.1719433218240738, -0.6718006730079651, -0.0013164989650249481, -0.1686438024044037, -0.021299472078680992, -0.351436972618103, -0.14789262413978577, -0.1053205281496048, -0.17409346997737885, 0.2638726234436035, 0.3069562315940857, -0.16854628920555115, -0.22903068363666534, -0.19985440373420715, -0.18032598495483398, 0.1715085804462433, 0.18886588513851166, -0.49015718698501587, 0.4394935071468353, -0.32368141412734985, -0.11375617980957031, 0.5816370248794556, -0.46631279587745667, -0.17346875369548798, 0.3063003122806549, -0.004085011780261993, 0.18480293452739716, 0.17696386575698853, -0.07677151262760162, 0.36583709716796875, -0.13408268988132477, 0.062091559171676636, 0.8756173253059387, -0.08790656924247742, 0.012081073597073555, -0.26748332381248474, -0.36589357256889343, 0.19966517388820648, 0.3545733094215393, 0.13553869724273682, 0.15401285886764526, 0.06548722833395004, 0.26369303464889526, 0.2032966911792755, -0.11974361538887024, 0.07608792185783386, 0.3086537718772888, 0.2587825357913971, 0.020028751343488693, 0.0749732181429863, -0.12356842309236526, -0.5101427435874939, 0.3351292014122009, -0.04241221770644188, 0.04525567963719368, -0.35736173391342163, -0.1276521384716034, -0.2051618993282318, 0.07006523013114929, -0.402789443731308, -0.03613338991999626, 0.09424085915088654, 0.320743590593338, 0.2164677530527115, -0.25024017691612244, -0.20365463197231293, 0.36225786805152893, 0.11425057053565979, 0.0784664899110794, -0.18529000878334045, 0.6780503988265991, 0.05842384696006775, -0.17809078097343445, -0.11496548354625702, 0.20946887135505676, 0.06569327414035797, -0.2769717574119568, -0.0019130511209368706, 0.41317614912986755, 0.01691555045545101, 0.4686205983161926, 0.08684127777814865, 0.19327223300933838, 0.29106444120407104, -0.12490731477737427, 0.02991207130253315, -0.052397336810827255, -0.026940561830997467, 0.08976993709802628, -0.2633309066295624, 0.34643715620040894, -0.2256009727716446, 0.35073456168174744, 0.15957507491111755, -0.08943828195333481, 0.3817696273326874, -0.03592948243021965, -0.09725683927536011, -0.012870822101831436, -0.13044533133506775, 0.19207707047462463, 0.3649320602416992, 0.06154238432645798, -0.09770414978265762, -0.03998810797929764, 0.18714404106140137, -0.05229029059410095, -0.0068887099623680115, 0.0551593191921711, -0.05352272838354111, -0.114099882543087, -0.004792971536517143, 0.2650071978569031, 0.5078422427177429, 0.25574028491973877, 0.13561353087425232, 0.029122304171323776, -0.05348417907953262, -0.0044463276863098145, 0.2727358639240265, 0.15648561716079712, 0.2832987606525421, 0.22360223531723022, 0.08554264903068542, 0.001394379884004593, -0.24136313796043396, -0.11256392300128937, 0.09717651456594467, 0.06341761350631714, -0.1743958294391632, 0.10756804794073105, -0.10832475125789642, 0.3231523334980011, -0.4029679000377655, 0.12365640699863434, -0.2643119990825653, -0.2780287563800812, -0.12783154845237732, 0.43217888474464417, -0.13963592052459717, 0.06651127338409424, -0.05474238842725754, 0.3567827343940735, -0.19424554705619812, -0.5460314154624939, -0.11555740982294083, -0.15722528100013733, 0.04737017676234245, 0.05962352082133293, 0.26577135920524597, -0.08804608136415482, 0.2218966782093048, -0.12120706588029861, 0.13066045939922333, -0.31196463108062744, -0.04999452456831932, 0.24415245652198792, 0.03282300755381584, 0.24287989735603333, -0.020855620503425598, 0.0546271838247776, 0.3534201979637146, -0.41475048661231995, 0.22856643795967102, -0.22334110736846924, 0.04618947207927704, 0.0909002423286438, -0.08078381419181824, 0.13392207026481628, 0.034338001161813736, -0.18621358275413513, -0.4795096814632416, -0.49520695209503174, 0.02438276633620262, 0.19314533472061157, 0.11455674469470978, -0.05418621748685837, -0.04496750235557556, -0.2407151311635971, 0.20901910960674286, 0.040081992745399475, -0.02571972645819187, -0.3220134377479553, 0.3622100055217743, -0.22657334804534912, -0.021448589861392975, -0.1730392575263977, -0.20893403887748718, 0.5292026400566101, 0.15419845283031464, -0.26064491271972656, 0.013997708447277546, -0.11693300306797028, 0.32866713404655457, -0.12168198823928833, 0.10848649591207504, 0.5181266665458679, 0.17484226822853088, 0.05513863265514374, 0.040927954018116, -0.16978640854358673, 0.09216197580099106, 0.266749769449234, 0.06145615130662918, 0.15790295600891113, 0.07257144153118134, -0.1676817536354065, 0.555962860584259, -0.24796606600284576, -0.014482926577329636, 0.4367142617702484, -0.00707339309155941, 0.3039678633213043, -0.15355917811393738, -0.1745140254497528, -0.22952595353126526, -0.159481942653656, -0.18393154442310333, 0.23068228363990784, 0.021490607410669327, -0.2576240599155426, -0.2860363721847534, -0.2756473422050476, -0.22154268622398376, -0.40828120708465576, 0.07740157842636108, -0.10831275582313538, 0.18559147417545319, -0.20079222321510315, -0.0963144600391388, -0.34154218435287476, 0.2236352264881134, 0.1560320407152176, 0.14862287044525146, 0.14841599762439728, -0.10120325535535812, -0.44438299536705017, 0.20654186606407166, -0.06448983401060104, -0.024373352527618408, -0.2539956569671631, -0.043826647102832794, 0.1102249026298523, -0.38202598690986633, -0.05243155360221863, -0.11291380226612091, 0.6925046443939209, -0.1487998217344284, 0.07244062423706055, 0.1441841572523117, -0.2381795048713684, -0.4339340031147003, -0.15819118916988373, -0.019874073565006256, -0.11790519952774048, -0.13296207785606384, 0.7781628370285034, -0.3752445876598358, -0.3503108024597168, 0.014953960664570332, 0.3343563377857208, -0.3301933705806732, -0.22293058037757874, -0.11541154980659485, -0.018907874822616577, -0.42401599884033203, -0.02010314166545868, 0.03919621556997299, 0.5152043700218201, -0.06419570744037628, 0.06195631995797157, -0.262861967086792, -0.12685132026672363, 0.18433785438537598, 0.13128621876239777, 0.4869297742843628, -0.20634543895721436, 0.1716470718383789, 0.09666740894317627, 0.17354756593704224, 0.010909421369433403, 0.5878550410270691, -0.4166441261768341, -0.38498586416244507, 0.17078185081481934, 0.11818462610244751, 0.3106299638748169, 0.2799059748649597, 0.2124951332807541, -0.09007295221090317, -0.2287084460258484, 0.027336660772562027, -0.4892085790634155, 0.11135415732860565, 0.0208892785012722, -0.24927948415279388, -0.2533024549484253, -0.4165888726711273, 0.37520936131477356, 0.01329738274216652, -0.18447232246398926, -0.013009496033191681, 0.17294646799564362, -0.5654257535934448, 0.7654725909233093, 0.10811246931552887, 1.0762717723846436, -0.08449025452136993, 0.19236940145492554, 0.07936131954193115, -0.05317005142569542, 0.13354940712451935, -0.47980332374572754, -0.09020555764436722, -0.272105872631073, -0.01984579861164093, -0.01482574362307787, -0.1463787853717804, 0.06868007779121399, 0.3221193552017212, -0.15726931393146515, 0.21274662017822266, 0.03786298632621765, 0.3206479549407959, -0.10975240170955658, 0.44978487491607666, -0.07123956084251404, -0.3768266439437866, -0.35179704427719116, 0.08640873432159424, 0.03135126084089279, 0.05805563926696777, -0.09666197746992111, -0.23444068431854248, 0.07901136577129364, -0.1303843855857849, -0.07102790474891663, 0.03004295751452446, 0.016758928075432777, 0.27765733003616333, -0.016413003206253052, -0.18902552127838135, -0.06169592961668968, 0.28057631850242615, 0.39831119775772095, 0.04825753718614578, -0.2552574574947357, 0.15702950954437256, -0.2528713345527649, 0.1653604954481125, -0.2355550080537796, -0.1318996399641037, 0.2529473900794983, -0.1598481833934784, -0.15855461359024048, -0.11422396451234818, -0.10054569691419601, -0.5470198392868042, -0.0015972256660461426, -0.19661857187747955, 0.4353283643722534, -0.3088325262069702, -0.14616338908672333, 0.010558739304542542, 0.18924707174301147, -0.23926067352294922, 0.12412962317466736, -0.00006886571645736694, -0.2327844649553299, 0.14909079670906067, -0.1261010468006134, -0.2104520946741104, -0.17303366959095, 0.2493118941783905, 0.1888887882232666, -0.103535957634449, 0.340328574180603, -0.21679043769836426, -0.1301937699317932, -0.2267143726348877, 0.0807984247803688, 0.43595272302627563, -0.5757875442504883, 0.13046427071094513, -0.12201034277677536, -0.24642229080200195, 0.02744143083691597, 0.1900179237127304, 0.3461090326309204, 0.05377016216516495, -0.17301024496555328, -0.1801491379737854, -0.30108100175857544, 0.192154660820961, 0.028963914141058922, 0.33730021119117737, 0.3006258010864258, -0.16995719075202942, -0.15235352516174316, 0.08808407187461853, -0.35984429717063904, 0.012989822775125504, 0.00891035608947277, 0.060173407196998596, 0.027343953028321266, -0.1890716254711151, 0.14774224162101746, -0.047961749136447906, 0.14852771162986755, -0.17874091863632202, -0.22836725413799286, -0.18087583780288696, -0.14006628096103668, 0.18307878077030182, -0.008933380246162415, 0.1126115545630455, -0.14918673038482666, -0.04932999610900879, -0.0011450499296188354, -0.258667916059494, 0.3044569492340088, -0.03704662621021271, -0.01837693154811859, 0.05806856229901314, 0.6921906471252441, 0.17879469692707062, -0.5141153335571289, 0.170199453830719, 0.0167253240942955, 0.2880464494228363, 0.11172565817832947, 0.22138269245624542, -0.21298643946647644, -0.15958267450332642, -0.16861216723918915, 0.07311073690652847, 0.34964221715927124, 0.24428337812423706, 0.32692936062812805, 0.024572134017944336, -0.09133671224117279, 0.25539952516555786, 0.31845101714134216, 0.20176856219768524, -0.060763854533433914, -0.03617577999830246, 0.19780904054641724, 0.23562799394130707, -0.13119199872016907, -0.2981404662132263, 0.05216755345463753, -0.28235483169555664, 0.021306347101926804, 0.3129137456417084, 0.4901920258998871, 0.08255104720592499, 0.11415432393550873, 0.09087301045656204, 0.7566288113594055, 0.09686536341905594, 0.4155884087085724, 0.5809623599052429, -0.007922150194644928, 0.07643285393714905, 0.02077232301235199, 0.09227995574474335, 0.2834266126155853, 0.36343812942504883, -0.3660525381565094, 0.3207661509513855, -0.028866581618785858, -0.09551835060119629, 0.44780492782592773, -0.2291102558374405, 0.3065493106842041, -0.17596173286437988, 0.12076015025377274, -0.06330106407403946, -0.09754307568073273, 0.1002073884010315, -0.18346334993839264, -0.1987266093492508, -0.3162199556827545, 0.23890076577663422, -0.140419602394104, -0.16168685257434845, 0.00785701721906662, -0.35848623514175415, -0.3371201455593109, 0.052717406302690506, -0.12283122539520264, -0.38275158405303955, -0.16168129444122314, 0.03428258001804352, 0.10821253806352615, 0.1425507664680481, 0.29631945490837097, 0.12118813395500183, -0.06681763380765915, -0.21467286348342896, 0.08437417447566986, 0.12648995220661163, -0.14913976192474365, 0.01960539072751999, 0.10228769481182098, 0.30416712164878845, 0.26150232553482056, -0.18514487147331238, 0.020711258053779602, 0.1828697770833969, -0.049578793346881866, -0.0643029659986496, -0.2310541272163391, -0.25104179978370667, 0.2603314220905304, 0.32346171140670776, 0.24166876077651978, -0.15432365238666534, -0.22904740273952484, 0.06345412135124207, -0.0774478167295456, -0.3546738028526306, 0.5693658590316772, 0.4232792854309082, -0.12103712558746338, -0.04968319088220596, 0.2309744954109192, -0.3346366882324219, -0.2563340961933136, 0.2961485981941223, -0.025216270238161087, 0.08879446238279343, 0.12702716886997223, 0.0644230917096138, 0.2957174777984619, 0.4273761212825775, 0.13151849806308746, -0.2547123432159424, -0.2710290253162384, -0.109520323574543, -0.6645974516868591, 0.09170443564653397, 0.19731557369232178, 0.015124021098017693, 0.15634942054748535, 0.14242543280124664, 0.1695193648338318, 0.10438861697912216, -0.26488226652145386, 0.13104674220085144, 0.12282956391572952, 0.11511606723070145, -0.24585993587970734, -0.07127031683921814, 0.16522875428199768, -0.009497348219156265, -0.05606988072395325, -0.4509021043777466, 0.12379391491413116, 0.2107381373643875, 0.045994848012924194, 0.036740742623806, -0.05714438855648041, 0.1454569548368454, -0.10483528673648834, 0.3091553747653961, 0.0046236347407102585, 0.22573257982730865, -0.02979375049471855, -0.09562757611274719, -0.055181872099637985, -0.219339519739151, -0.17952467501163483, 0.025959666818380356, -0.1300913244485855, 0.22439365088939667, -0.3003731667995453, -0.06647798418998718, -0.5604401230812073, -0.1374882459640503, 0.06442072242498398, -0.12863434851169586, -0.33148112893104553, -0.05586916208267212, -0.09558835625648499, 0.055165499448776245, 0.26136094331741333, 0.09064044058322906, 0.03209859877824783, 0.07005362212657928, -0.1296963095664978, -0.10992955416440964, 0.34600475430488586, 0.007060510106384754, -0.36722949147224426, -0.2807070016860962, 0.16200673580169678, -0.02105461061000824, 0.2317579835653305, -0.49114397168159485, 0.0998496487736702, 0.39197808504104614, -0.09789378196001053, 0.14764398336410522, 0.42608001828193665, 0.283956378698349, -0.023566262796521187, -0.1957942694425583, 0.06433487683534622, 0.017916889861226082, -0.2120840847492218, -0.19637879729270935, -0.2507069706916809 ]
https://github.com/huggingface/datasets/issues/5044
integrate `load_from_disk` into `load_dataset`
@lhoestq I can jump into that. What I don't like is having functions with many parameters input. Even though they are optional, it's always harder to reason about and test such cases. If there are more features worth to work on, feel free to ping me. It's a lot of fun to help :smile:
**Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you!
54
integrate `load_from_disk` into `load_dataset` **Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you! @lhoestq I can jump into that. What I don't like is having functions with many parameters input. Even though they are optional, it's always harder to reason about and test such cases. If there are more features worth to work on, feel free to ping me. It's a lot of fun to help :smile:
[ -0.44635680317878723, -0.2547794580459595, 0.010255537927150726, 0.2019416093826294, 0.2771260142326355, -0.06415087729692459, 0.34563735127449036, 0.05371537804603577, 0.18767482042312622, 0.0032595768570899963, -0.12003012001514435, 0.4315917193889618, -0.21891242265701294, 0.3659507930278778, 0.1304887980222702, -0.031987108290195465, 0.09322202950716019, 0.14932434260845184, -0.19573140144348145, -0.06984389573335648, -0.18395498394966125, 0.2209053486585617, 0.11793144047260284, -0.04411688446998596, -0.11173413693904877, 0.18309085071086884, -0.1365537941455841, 0.11326459050178528, 0.0197085440158844, -0.3285708427429199, 0.6284780502319336, 0.2716442942619324, 0.3341926038265228, 0.3633251190185547, -0.00011232155520701781, 0.1923799067735672, 0.25741714239120483, -0.21307030320167542, -0.507559597492218, -0.34604889154434204, -0.06604377925395966, -0.15244938433170319, 0.3846595883369446, -0.30427679419517517, -0.11516166478395462, 0.09200955927371979, -0.11395889520645142, -0.26704615354537964, 0.35503774881362915, 0.12621402740478516, 0.19490507245063782, 0.4610063135623932, -0.11474540829658508, -0.15635262429714203, -0.04331285506486893, 0.41405385732650757, -0.15227332711219788, 0.19862477481365204, 0.3236578702926636, 0.11076841503381729, 0.03542458266019821, -0.1009954959154129, 0.017977194860577583, -0.07209663093090057, 0.42302027344703674, -0.006927105598151684, 0.30070945620536804, -0.0844963937997818, -0.2096083164215088, 0.17899908125400543, 0.5157183408737183, -0.39214658737182617, -0.3643263876438141, -0.5026596188545227, -0.13282747566699982, -0.16695989668369293, 0.09329231828451157, 0.07267232239246368, -0.17898188531398773, 0.2149742841720581, -0.1521054059267044, -0.26146239042282104, -0.25491923093795776, -0.11651460826396942, -0.2542811930179596, 0.353007048368454, 0.016999797895550728, 0.04191915690898895, 0.13370166718959808, 0.07342766225337982, 0.38972190022468567, -0.19089065492153168, 0.24229104816913605, 0.09421911835670471, -0.24278558790683746, -0.2565828859806061, 0.00013849884271621704, 0.022671040147542953, 0.06363434344530106, 0.4243124723434448, 0.21719910204410553, -0.008537530899047852, -0.06446804851293564, 0.23400971293449402, 0.4109697639942169, 0.12736648321151733, -0.14713141322135925, 0.15610776841640472, 0.2063167840242386, 0.12792259454727173, -0.11544084548950195, -0.010730881243944168, -0.08807200938463211, 0.01640136167407036, 0.1928263008594513, -0.07598569244146347, 0.19586119055747986, -0.0835166946053505, -0.03711214289069176, -0.3383900821208954, 0.5547189116477966, -0.10464300215244293, 0.20493869483470917, 0.19755050539970398, 0.039358384907245636, 0.4786982834339142, -0.1625950187444687, 0.36062055826187134, -0.10504639148712158, -0.1225094348192215, -0.19547757506370544, -0.20724661648273468, -0.05705943703651428, 0.07984813302755356, 0.1456216722726822, 0.13923588395118713, 0.1787695586681366, -0.08057089895009995, 0.12609204649925232, 0.3008764982223511, -0.0651334896683693, -0.1567111313343048, -0.11627800017595291, 0.0743706077337265, 0.02845492586493492, 0.07488644123077393, 0.007411450147628784, -0.06409267336130142, -0.5090036988258362, 0.03482671082019806, -0.32618337869644165, -0.5912933349609375, -0.0531468391418457, 0.1748252660036087, -0.42324018478393555, -0.1719433218240738, -0.6718006730079651, -0.0013164989650249481, -0.1686438024044037, -0.021299472078680992, -0.351436972618103, -0.14789262413978577, -0.1053205281496048, -0.17409346997737885, 0.2638726234436035, 0.3069562315940857, -0.16854628920555115, -0.22903068363666534, -0.19985440373420715, -0.18032598495483398, 0.1715085804462433, 0.18886588513851166, -0.49015718698501587, 0.4394935071468353, -0.32368141412734985, -0.11375617980957031, 0.5816370248794556, -0.46631279587745667, -0.17346875369548798, 0.3063003122806549, -0.004085011780261993, 0.18480293452739716, 0.17696386575698853, -0.07677151262760162, 0.36583709716796875, -0.13408268988132477, 0.062091559171676636, 0.8756173253059387, -0.08790656924247742, 0.012081073597073555, -0.26748332381248474, -0.36589357256889343, 0.19966517388820648, 0.3545733094215393, 0.13553869724273682, 0.15401285886764526, 0.06548722833395004, 0.26369303464889526, 0.2032966911792755, -0.11974361538887024, 0.07608792185783386, 0.3086537718772888, 0.2587825357913971, 0.020028751343488693, 0.0749732181429863, -0.12356842309236526, -0.5101427435874939, 0.3351292014122009, -0.04241221770644188, 0.04525567963719368, -0.35736173391342163, -0.1276521384716034, -0.2051618993282318, 0.07006523013114929, -0.402789443731308, -0.03613338991999626, 0.09424085915088654, 0.320743590593338, 0.2164677530527115, -0.25024017691612244, -0.20365463197231293, 0.36225786805152893, 0.11425057053565979, 0.0784664899110794, -0.18529000878334045, 0.6780503988265991, 0.05842384696006775, -0.17809078097343445, -0.11496548354625702, 0.20946887135505676, 0.06569327414035797, -0.2769717574119568, -0.0019130511209368706, 0.41317614912986755, 0.01691555045545101, 0.4686205983161926, 0.08684127777814865, 0.19327223300933838, 0.29106444120407104, -0.12490731477737427, 0.02991207130253315, -0.052397336810827255, -0.026940561830997467, 0.08976993709802628, -0.2633309066295624, 0.34643715620040894, -0.2256009727716446, 0.35073456168174744, 0.15957507491111755, -0.08943828195333481, 0.3817696273326874, -0.03592948243021965, -0.09725683927536011, -0.012870822101831436, -0.13044533133506775, 0.19207707047462463, 0.3649320602416992, 0.06154238432645798, -0.09770414978265762, -0.03998810797929764, 0.18714404106140137, -0.05229029059410095, -0.0068887099623680115, 0.0551593191921711, -0.05352272838354111, -0.114099882543087, -0.004792971536517143, 0.2650071978569031, 0.5078422427177429, 0.25574028491973877, 0.13561353087425232, 0.029122304171323776, -0.05348417907953262, -0.0044463276863098145, 0.2727358639240265, 0.15648561716079712, 0.2832987606525421, 0.22360223531723022, 0.08554264903068542, 0.001394379884004593, -0.24136313796043396, -0.11256392300128937, 0.09717651456594467, 0.06341761350631714, -0.1743958294391632, 0.10756804794073105, -0.10832475125789642, 0.3231523334980011, -0.4029679000377655, 0.12365640699863434, -0.2643119990825653, -0.2780287563800812, -0.12783154845237732, 0.43217888474464417, -0.13963592052459717, 0.06651127338409424, -0.05474238842725754, 0.3567827343940735, -0.19424554705619812, -0.5460314154624939, -0.11555740982294083, -0.15722528100013733, 0.04737017676234245, 0.05962352082133293, 0.26577135920524597, -0.08804608136415482, 0.2218966782093048, -0.12120706588029861, 0.13066045939922333, -0.31196463108062744, -0.04999452456831932, 0.24415245652198792, 0.03282300755381584, 0.24287989735603333, -0.020855620503425598, 0.0546271838247776, 0.3534201979637146, -0.41475048661231995, 0.22856643795967102, -0.22334110736846924, 0.04618947207927704, 0.0909002423286438, -0.08078381419181824, 0.13392207026481628, 0.034338001161813736, -0.18621358275413513, -0.4795096814632416, -0.49520695209503174, 0.02438276633620262, 0.19314533472061157, 0.11455674469470978, -0.05418621748685837, -0.04496750235557556, -0.2407151311635971, 0.20901910960674286, 0.040081992745399475, -0.02571972645819187, -0.3220134377479553, 0.3622100055217743, -0.22657334804534912, -0.021448589861392975, -0.1730392575263977, -0.20893403887748718, 0.5292026400566101, 0.15419845283031464, -0.26064491271972656, 0.013997708447277546, -0.11693300306797028, 0.32866713404655457, -0.12168198823928833, 0.10848649591207504, 0.5181266665458679, 0.17484226822853088, 0.05513863265514374, 0.040927954018116, -0.16978640854358673, 0.09216197580099106, 0.266749769449234, 0.06145615130662918, 0.15790295600891113, 0.07257144153118134, -0.1676817536354065, 0.555962860584259, -0.24796606600284576, -0.014482926577329636, 0.4367142617702484, -0.00707339309155941, 0.3039678633213043, -0.15355917811393738, -0.1745140254497528, -0.22952595353126526, -0.159481942653656, -0.18393154442310333, 0.23068228363990784, 0.021490607410669327, -0.2576240599155426, -0.2860363721847534, -0.2756473422050476, -0.22154268622398376, -0.40828120708465576, 0.07740157842636108, -0.10831275582313538, 0.18559147417545319, -0.20079222321510315, -0.0963144600391388, -0.34154218435287476, 0.2236352264881134, 0.1560320407152176, 0.14862287044525146, 0.14841599762439728, -0.10120325535535812, -0.44438299536705017, 0.20654186606407166, -0.06448983401060104, -0.024373352527618408, -0.2539956569671631, -0.043826647102832794, 0.1102249026298523, -0.38202598690986633, -0.05243155360221863, -0.11291380226612091, 0.6925046443939209, -0.1487998217344284, 0.07244062423706055, 0.1441841572523117, -0.2381795048713684, -0.4339340031147003, -0.15819118916988373, -0.019874073565006256, -0.11790519952774048, -0.13296207785606384, 0.7781628370285034, -0.3752445876598358, -0.3503108024597168, 0.014953960664570332, 0.3343563377857208, -0.3301933705806732, -0.22293058037757874, -0.11541154980659485, -0.018907874822616577, -0.42401599884033203, -0.02010314166545868, 0.03919621556997299, 0.5152043700218201, -0.06419570744037628, 0.06195631995797157, -0.262861967086792, -0.12685132026672363, 0.18433785438537598, 0.13128621876239777, 0.4869297742843628, -0.20634543895721436, 0.1716470718383789, 0.09666740894317627, 0.17354756593704224, 0.010909421369433403, 0.5878550410270691, -0.4166441261768341, -0.38498586416244507, 0.17078185081481934, 0.11818462610244751, 0.3106299638748169, 0.2799059748649597, 0.2124951332807541, -0.09007295221090317, -0.2287084460258484, 0.027336660772562027, -0.4892085790634155, 0.11135415732860565, 0.0208892785012722, -0.24927948415279388, -0.2533024549484253, -0.4165888726711273, 0.37520936131477356, 0.01329738274216652, -0.18447232246398926, -0.013009496033191681, 0.17294646799564362, -0.5654257535934448, 0.7654725909233093, 0.10811246931552887, 1.0762717723846436, -0.08449025452136993, 0.19236940145492554, 0.07936131954193115, -0.05317005142569542, 0.13354940712451935, -0.47980332374572754, -0.09020555764436722, -0.272105872631073, -0.01984579861164093, -0.01482574362307787, -0.1463787853717804, 0.06868007779121399, 0.3221193552017212, -0.15726931393146515, 0.21274662017822266, 0.03786298632621765, 0.3206479549407959, -0.10975240170955658, 0.44978487491607666, -0.07123956084251404, -0.3768266439437866, -0.35179704427719116, 0.08640873432159424, 0.03135126084089279, 0.05805563926696777, -0.09666197746992111, -0.23444068431854248, 0.07901136577129364, -0.1303843855857849, -0.07102790474891663, 0.03004295751452446, 0.016758928075432777, 0.27765733003616333, -0.016413003206253052, -0.18902552127838135, -0.06169592961668968, 0.28057631850242615, 0.39831119775772095, 0.04825753718614578, -0.2552574574947357, 0.15702950954437256, -0.2528713345527649, 0.1653604954481125, -0.2355550080537796, -0.1318996399641037, 0.2529473900794983, -0.1598481833934784, -0.15855461359024048, -0.11422396451234818, -0.10054569691419601, -0.5470198392868042, -0.0015972256660461426, -0.19661857187747955, 0.4353283643722534, -0.3088325262069702, -0.14616338908672333, 0.010558739304542542, 0.18924707174301147, -0.23926067352294922, 0.12412962317466736, -0.00006886571645736694, -0.2327844649553299, 0.14909079670906067, -0.1261010468006134, -0.2104520946741104, -0.17303366959095, 0.2493118941783905, 0.1888887882232666, -0.103535957634449, 0.340328574180603, -0.21679043769836426, -0.1301937699317932, -0.2267143726348877, 0.0807984247803688, 0.43595272302627563, -0.5757875442504883, 0.13046427071094513, -0.12201034277677536, -0.24642229080200195, 0.02744143083691597, 0.1900179237127304, 0.3461090326309204, 0.05377016216516495, -0.17301024496555328, -0.1801491379737854, -0.30108100175857544, 0.192154660820961, 0.028963914141058922, 0.33730021119117737, 0.3006258010864258, -0.16995719075202942, -0.15235352516174316, 0.08808407187461853, -0.35984429717063904, 0.012989822775125504, 0.00891035608947277, 0.060173407196998596, 0.027343953028321266, -0.1890716254711151, 0.14774224162101746, -0.047961749136447906, 0.14852771162986755, -0.17874091863632202, -0.22836725413799286, -0.18087583780288696, -0.14006628096103668, 0.18307878077030182, -0.008933380246162415, 0.1126115545630455, -0.14918673038482666, -0.04932999610900879, -0.0011450499296188354, -0.258667916059494, 0.3044569492340088, -0.03704662621021271, -0.01837693154811859, 0.05806856229901314, 0.6921906471252441, 0.17879469692707062, -0.5141153335571289, 0.170199453830719, 0.0167253240942955, 0.2880464494228363, 0.11172565817832947, 0.22138269245624542, -0.21298643946647644, -0.15958267450332642, -0.16861216723918915, 0.07311073690652847, 0.34964221715927124, 0.24428337812423706, 0.32692936062812805, 0.024572134017944336, -0.09133671224117279, 0.25539952516555786, 0.31845101714134216, 0.20176856219768524, -0.060763854533433914, -0.03617577999830246, 0.19780904054641724, 0.23562799394130707, -0.13119199872016907, -0.2981404662132263, 0.05216755345463753, -0.28235483169555664, 0.021306347101926804, 0.3129137456417084, 0.4901920258998871, 0.08255104720592499, 0.11415432393550873, 0.09087301045656204, 0.7566288113594055, 0.09686536341905594, 0.4155884087085724, 0.5809623599052429, -0.007922150194644928, 0.07643285393714905, 0.02077232301235199, 0.09227995574474335, 0.2834266126155853, 0.36343812942504883, -0.3660525381565094, 0.3207661509513855, -0.028866581618785858, -0.09551835060119629, 0.44780492782592773, -0.2291102558374405, 0.3065493106842041, -0.17596173286437988, 0.12076015025377274, -0.06330106407403946, -0.09754307568073273, 0.1002073884010315, -0.18346334993839264, -0.1987266093492508, -0.3162199556827545, 0.23890076577663422, -0.140419602394104, -0.16168685257434845, 0.00785701721906662, -0.35848623514175415, -0.3371201455593109, 0.052717406302690506, -0.12283122539520264, -0.38275158405303955, -0.16168129444122314, 0.03428258001804352, 0.10821253806352615, 0.1425507664680481, 0.29631945490837097, 0.12118813395500183, -0.06681763380765915, -0.21467286348342896, 0.08437417447566986, 0.12648995220661163, -0.14913976192474365, 0.01960539072751999, 0.10228769481182098, 0.30416712164878845, 0.26150232553482056, -0.18514487147331238, 0.020711258053779602, 0.1828697770833969, -0.049578793346881866, -0.0643029659986496, -0.2310541272163391, -0.25104179978370667, 0.2603314220905304, 0.32346171140670776, 0.24166876077651978, -0.15432365238666534, -0.22904740273952484, 0.06345412135124207, -0.0774478167295456, -0.3546738028526306, 0.5693658590316772, 0.4232792854309082, -0.12103712558746338, -0.04968319088220596, 0.2309744954109192, -0.3346366882324219, -0.2563340961933136, 0.2961485981941223, -0.025216270238161087, 0.08879446238279343, 0.12702716886997223, 0.0644230917096138, 0.2957174777984619, 0.4273761212825775, 0.13151849806308746, -0.2547123432159424, -0.2710290253162384, -0.109520323574543, -0.6645974516868591, 0.09170443564653397, 0.19731557369232178, 0.015124021098017693, 0.15634942054748535, 0.14242543280124664, 0.1695193648338318, 0.10438861697912216, -0.26488226652145386, 0.13104674220085144, 0.12282956391572952, 0.11511606723070145, -0.24585993587970734, -0.07127031683921814, 0.16522875428199768, -0.009497348219156265, -0.05606988072395325, -0.4509021043777466, 0.12379391491413116, 0.2107381373643875, 0.045994848012924194, 0.036740742623806, -0.05714438855648041, 0.1454569548368454, -0.10483528673648834, 0.3091553747653961, 0.0046236347407102585, 0.22573257982730865, -0.02979375049471855, -0.09562757611274719, -0.055181872099637985, -0.219339519739151, -0.17952467501163483, 0.025959666818380356, -0.1300913244485855, 0.22439365088939667, -0.3003731667995453, -0.06647798418998718, -0.5604401230812073, -0.1374882459640503, 0.06442072242498398, -0.12863434851169586, -0.33148112893104553, -0.05586916208267212, -0.09558835625648499, 0.055165499448776245, 0.26136094331741333, 0.09064044058322906, 0.03209859877824783, 0.07005362212657928, -0.1296963095664978, -0.10992955416440964, 0.34600475430488586, 0.007060510106384754, -0.36722949147224426, -0.2807070016860962, 0.16200673580169678, -0.02105461061000824, 0.2317579835653305, -0.49114397168159485, 0.0998496487736702, 0.39197808504104614, -0.09789378196001053, 0.14764398336410522, 0.42608001828193665, 0.283956378698349, -0.023566262796521187, -0.1957942694425583, 0.06433487683534622, 0.017916889861226082, -0.2120840847492218, -0.19637879729270935, -0.2507069706916809 ]
https://github.com/huggingface/datasets/issues/5044
integrate `load_from_disk` into `load_dataset`
Thanks a lot for your help @mariusz-jachimowicz-83 :) I think as a first step we could implement an Arrow dataset builder to be able to load and stream Arrow datasets locally or from Hugging Face. Maybe something similar to the Parquet builder at [src/datasets/packaged_modules/parquet/parquet.py](https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/parquet/parquet.py) ? And we can deal with the disk space optimization as a second step. What do you think ? (this issue is also related to https://github.com/huggingface/datasets/issues/3035)
**Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you!
70
integrate `load_from_disk` into `load_dataset` **Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you! Thanks a lot for your help @mariusz-jachimowicz-83 :) I think as a first step we could implement an Arrow dataset builder to be able to load and stream Arrow datasets locally or from Hugging Face. Maybe something similar to the Parquet builder at [src/datasets/packaged_modules/parquet/parquet.py](https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/parquet/parquet.py) ? And we can deal with the disk space optimization as a second step. What do you think ? (this issue is also related to https://github.com/huggingface/datasets/issues/3035)
[ -0.44635680317878723, -0.2547794580459595, 0.010255537927150726, 0.2019416093826294, 0.2771260142326355, -0.06415087729692459, 0.34563735127449036, 0.05371537804603577, 0.18767482042312622, 0.0032595768570899963, -0.12003012001514435, 0.4315917193889618, -0.21891242265701294, 0.3659507930278778, 0.1304887980222702, -0.031987108290195465, 0.09322202950716019, 0.14932434260845184, -0.19573140144348145, -0.06984389573335648, -0.18395498394966125, 0.2209053486585617, 0.11793144047260284, -0.04411688446998596, -0.11173413693904877, 0.18309085071086884, -0.1365537941455841, 0.11326459050178528, 0.0197085440158844, -0.3285708427429199, 0.6284780502319336, 0.2716442942619324, 0.3341926038265228, 0.3633251190185547, -0.00011232155520701781, 0.1923799067735672, 0.25741714239120483, -0.21307030320167542, -0.507559597492218, -0.34604889154434204, -0.06604377925395966, -0.15244938433170319, 0.3846595883369446, -0.30427679419517517, -0.11516166478395462, 0.09200955927371979, -0.11395889520645142, -0.26704615354537964, 0.35503774881362915, 0.12621402740478516, 0.19490507245063782, 0.4610063135623932, -0.11474540829658508, -0.15635262429714203, -0.04331285506486893, 0.41405385732650757, -0.15227332711219788, 0.19862477481365204, 0.3236578702926636, 0.11076841503381729, 0.03542458266019821, -0.1009954959154129, 0.017977194860577583, -0.07209663093090057, 0.42302027344703674, -0.006927105598151684, 0.30070945620536804, -0.0844963937997818, -0.2096083164215088, 0.17899908125400543, 0.5157183408737183, -0.39214658737182617, -0.3643263876438141, -0.5026596188545227, -0.13282747566699982, -0.16695989668369293, 0.09329231828451157, 0.07267232239246368, -0.17898188531398773, 0.2149742841720581, -0.1521054059267044, -0.26146239042282104, -0.25491923093795776, -0.11651460826396942, -0.2542811930179596, 0.353007048368454, 0.016999797895550728, 0.04191915690898895, 0.13370166718959808, 0.07342766225337982, 0.38972190022468567, -0.19089065492153168, 0.24229104816913605, 0.09421911835670471, -0.24278558790683746, -0.2565828859806061, 0.00013849884271621704, 0.022671040147542953, 0.06363434344530106, 0.4243124723434448, 0.21719910204410553, -0.008537530899047852, -0.06446804851293564, 0.23400971293449402, 0.4109697639942169, 0.12736648321151733, -0.14713141322135925, 0.15610776841640472, 0.2063167840242386, 0.12792259454727173, -0.11544084548950195, -0.010730881243944168, -0.08807200938463211, 0.01640136167407036, 0.1928263008594513, -0.07598569244146347, 0.19586119055747986, -0.0835166946053505, -0.03711214289069176, -0.3383900821208954, 0.5547189116477966, -0.10464300215244293, 0.20493869483470917, 0.19755050539970398, 0.039358384907245636, 0.4786982834339142, -0.1625950187444687, 0.36062055826187134, -0.10504639148712158, -0.1225094348192215, -0.19547757506370544, -0.20724661648273468, -0.05705943703651428, 0.07984813302755356, 0.1456216722726822, 0.13923588395118713, 0.1787695586681366, -0.08057089895009995, 0.12609204649925232, 0.3008764982223511, -0.0651334896683693, -0.1567111313343048, -0.11627800017595291, 0.0743706077337265, 0.02845492586493492, 0.07488644123077393, 0.007411450147628784, -0.06409267336130142, -0.5090036988258362, 0.03482671082019806, -0.32618337869644165, -0.5912933349609375, -0.0531468391418457, 0.1748252660036087, -0.42324018478393555, -0.1719433218240738, -0.6718006730079651, -0.0013164989650249481, -0.1686438024044037, -0.021299472078680992, -0.351436972618103, -0.14789262413978577, -0.1053205281496048, -0.17409346997737885, 0.2638726234436035, 0.3069562315940857, -0.16854628920555115, -0.22903068363666534, -0.19985440373420715, -0.18032598495483398, 0.1715085804462433, 0.18886588513851166, -0.49015718698501587, 0.4394935071468353, -0.32368141412734985, -0.11375617980957031, 0.5816370248794556, -0.46631279587745667, -0.17346875369548798, 0.3063003122806549, -0.004085011780261993, 0.18480293452739716, 0.17696386575698853, -0.07677151262760162, 0.36583709716796875, -0.13408268988132477, 0.062091559171676636, 0.8756173253059387, -0.08790656924247742, 0.012081073597073555, -0.26748332381248474, -0.36589357256889343, 0.19966517388820648, 0.3545733094215393, 0.13553869724273682, 0.15401285886764526, 0.06548722833395004, 0.26369303464889526, 0.2032966911792755, -0.11974361538887024, 0.07608792185783386, 0.3086537718772888, 0.2587825357913971, 0.020028751343488693, 0.0749732181429863, -0.12356842309236526, -0.5101427435874939, 0.3351292014122009, -0.04241221770644188, 0.04525567963719368, -0.35736173391342163, -0.1276521384716034, -0.2051618993282318, 0.07006523013114929, -0.402789443731308, -0.03613338991999626, 0.09424085915088654, 0.320743590593338, 0.2164677530527115, -0.25024017691612244, -0.20365463197231293, 0.36225786805152893, 0.11425057053565979, 0.0784664899110794, -0.18529000878334045, 0.6780503988265991, 0.05842384696006775, -0.17809078097343445, -0.11496548354625702, 0.20946887135505676, 0.06569327414035797, -0.2769717574119568, -0.0019130511209368706, 0.41317614912986755, 0.01691555045545101, 0.4686205983161926, 0.08684127777814865, 0.19327223300933838, 0.29106444120407104, -0.12490731477737427, 0.02991207130253315, -0.052397336810827255, -0.026940561830997467, 0.08976993709802628, -0.2633309066295624, 0.34643715620040894, -0.2256009727716446, 0.35073456168174744, 0.15957507491111755, -0.08943828195333481, 0.3817696273326874, -0.03592948243021965, -0.09725683927536011, -0.012870822101831436, -0.13044533133506775, 0.19207707047462463, 0.3649320602416992, 0.06154238432645798, -0.09770414978265762, -0.03998810797929764, 0.18714404106140137, -0.05229029059410095, -0.0068887099623680115, 0.0551593191921711, -0.05352272838354111, -0.114099882543087, -0.004792971536517143, 0.2650071978569031, 0.5078422427177429, 0.25574028491973877, 0.13561353087425232, 0.029122304171323776, -0.05348417907953262, -0.0044463276863098145, 0.2727358639240265, 0.15648561716079712, 0.2832987606525421, 0.22360223531723022, 0.08554264903068542, 0.001394379884004593, -0.24136313796043396, -0.11256392300128937, 0.09717651456594467, 0.06341761350631714, -0.1743958294391632, 0.10756804794073105, -0.10832475125789642, 0.3231523334980011, -0.4029679000377655, 0.12365640699863434, -0.2643119990825653, -0.2780287563800812, -0.12783154845237732, 0.43217888474464417, -0.13963592052459717, 0.06651127338409424, -0.05474238842725754, 0.3567827343940735, -0.19424554705619812, -0.5460314154624939, -0.11555740982294083, -0.15722528100013733, 0.04737017676234245, 0.05962352082133293, 0.26577135920524597, -0.08804608136415482, 0.2218966782093048, -0.12120706588029861, 0.13066045939922333, -0.31196463108062744, -0.04999452456831932, 0.24415245652198792, 0.03282300755381584, 0.24287989735603333, -0.020855620503425598, 0.0546271838247776, 0.3534201979637146, -0.41475048661231995, 0.22856643795967102, -0.22334110736846924, 0.04618947207927704, 0.0909002423286438, -0.08078381419181824, 0.13392207026481628, 0.034338001161813736, -0.18621358275413513, -0.4795096814632416, -0.49520695209503174, 0.02438276633620262, 0.19314533472061157, 0.11455674469470978, -0.05418621748685837, -0.04496750235557556, -0.2407151311635971, 0.20901910960674286, 0.040081992745399475, -0.02571972645819187, -0.3220134377479553, 0.3622100055217743, -0.22657334804534912, -0.021448589861392975, -0.1730392575263977, -0.20893403887748718, 0.5292026400566101, 0.15419845283031464, -0.26064491271972656, 0.013997708447277546, -0.11693300306797028, 0.32866713404655457, -0.12168198823928833, 0.10848649591207504, 0.5181266665458679, 0.17484226822853088, 0.05513863265514374, 0.040927954018116, -0.16978640854358673, 0.09216197580099106, 0.266749769449234, 0.06145615130662918, 0.15790295600891113, 0.07257144153118134, -0.1676817536354065, 0.555962860584259, -0.24796606600284576, -0.014482926577329636, 0.4367142617702484, -0.00707339309155941, 0.3039678633213043, -0.15355917811393738, -0.1745140254497528, -0.22952595353126526, -0.159481942653656, -0.18393154442310333, 0.23068228363990784, 0.021490607410669327, -0.2576240599155426, -0.2860363721847534, -0.2756473422050476, -0.22154268622398376, -0.40828120708465576, 0.07740157842636108, -0.10831275582313538, 0.18559147417545319, -0.20079222321510315, -0.0963144600391388, -0.34154218435287476, 0.2236352264881134, 0.1560320407152176, 0.14862287044525146, 0.14841599762439728, -0.10120325535535812, -0.44438299536705017, 0.20654186606407166, -0.06448983401060104, -0.024373352527618408, -0.2539956569671631, -0.043826647102832794, 0.1102249026298523, -0.38202598690986633, -0.05243155360221863, -0.11291380226612091, 0.6925046443939209, -0.1487998217344284, 0.07244062423706055, 0.1441841572523117, -0.2381795048713684, -0.4339340031147003, -0.15819118916988373, -0.019874073565006256, -0.11790519952774048, -0.13296207785606384, 0.7781628370285034, -0.3752445876598358, -0.3503108024597168, 0.014953960664570332, 0.3343563377857208, -0.3301933705806732, -0.22293058037757874, -0.11541154980659485, -0.018907874822616577, -0.42401599884033203, -0.02010314166545868, 0.03919621556997299, 0.5152043700218201, -0.06419570744037628, 0.06195631995797157, -0.262861967086792, -0.12685132026672363, 0.18433785438537598, 0.13128621876239777, 0.4869297742843628, -0.20634543895721436, 0.1716470718383789, 0.09666740894317627, 0.17354756593704224, 0.010909421369433403, 0.5878550410270691, -0.4166441261768341, -0.38498586416244507, 0.17078185081481934, 0.11818462610244751, 0.3106299638748169, 0.2799059748649597, 0.2124951332807541, -0.09007295221090317, -0.2287084460258484, 0.027336660772562027, -0.4892085790634155, 0.11135415732860565, 0.0208892785012722, -0.24927948415279388, -0.2533024549484253, -0.4165888726711273, 0.37520936131477356, 0.01329738274216652, -0.18447232246398926, -0.013009496033191681, 0.17294646799564362, -0.5654257535934448, 0.7654725909233093, 0.10811246931552887, 1.0762717723846436, -0.08449025452136993, 0.19236940145492554, 0.07936131954193115, -0.05317005142569542, 0.13354940712451935, -0.47980332374572754, -0.09020555764436722, -0.272105872631073, -0.01984579861164093, -0.01482574362307787, -0.1463787853717804, 0.06868007779121399, 0.3221193552017212, -0.15726931393146515, 0.21274662017822266, 0.03786298632621765, 0.3206479549407959, -0.10975240170955658, 0.44978487491607666, -0.07123956084251404, -0.3768266439437866, -0.35179704427719116, 0.08640873432159424, 0.03135126084089279, 0.05805563926696777, -0.09666197746992111, -0.23444068431854248, 0.07901136577129364, -0.1303843855857849, -0.07102790474891663, 0.03004295751452446, 0.016758928075432777, 0.27765733003616333, -0.016413003206253052, -0.18902552127838135, -0.06169592961668968, 0.28057631850242615, 0.39831119775772095, 0.04825753718614578, -0.2552574574947357, 0.15702950954437256, -0.2528713345527649, 0.1653604954481125, -0.2355550080537796, -0.1318996399641037, 0.2529473900794983, -0.1598481833934784, -0.15855461359024048, -0.11422396451234818, -0.10054569691419601, -0.5470198392868042, -0.0015972256660461426, -0.19661857187747955, 0.4353283643722534, -0.3088325262069702, -0.14616338908672333, 0.010558739304542542, 0.18924707174301147, -0.23926067352294922, 0.12412962317466736, -0.00006886571645736694, -0.2327844649553299, 0.14909079670906067, -0.1261010468006134, -0.2104520946741104, -0.17303366959095, 0.2493118941783905, 0.1888887882232666, -0.103535957634449, 0.340328574180603, -0.21679043769836426, -0.1301937699317932, -0.2267143726348877, 0.0807984247803688, 0.43595272302627563, -0.5757875442504883, 0.13046427071094513, -0.12201034277677536, -0.24642229080200195, 0.02744143083691597, 0.1900179237127304, 0.3461090326309204, 0.05377016216516495, -0.17301024496555328, -0.1801491379737854, -0.30108100175857544, 0.192154660820961, 0.028963914141058922, 0.33730021119117737, 0.3006258010864258, -0.16995719075202942, -0.15235352516174316, 0.08808407187461853, -0.35984429717063904, 0.012989822775125504, 0.00891035608947277, 0.060173407196998596, 0.027343953028321266, -0.1890716254711151, 0.14774224162101746, -0.047961749136447906, 0.14852771162986755, -0.17874091863632202, -0.22836725413799286, -0.18087583780288696, -0.14006628096103668, 0.18307878077030182, -0.008933380246162415, 0.1126115545630455, -0.14918673038482666, -0.04932999610900879, -0.0011450499296188354, -0.258667916059494, 0.3044569492340088, -0.03704662621021271, -0.01837693154811859, 0.05806856229901314, 0.6921906471252441, 0.17879469692707062, -0.5141153335571289, 0.170199453830719, 0.0167253240942955, 0.2880464494228363, 0.11172565817832947, 0.22138269245624542, -0.21298643946647644, -0.15958267450332642, -0.16861216723918915, 0.07311073690652847, 0.34964221715927124, 0.24428337812423706, 0.32692936062812805, 0.024572134017944336, -0.09133671224117279, 0.25539952516555786, 0.31845101714134216, 0.20176856219768524, -0.060763854533433914, -0.03617577999830246, 0.19780904054641724, 0.23562799394130707, -0.13119199872016907, -0.2981404662132263, 0.05216755345463753, -0.28235483169555664, 0.021306347101926804, 0.3129137456417084, 0.4901920258998871, 0.08255104720592499, 0.11415432393550873, 0.09087301045656204, 0.7566288113594055, 0.09686536341905594, 0.4155884087085724, 0.5809623599052429, -0.007922150194644928, 0.07643285393714905, 0.02077232301235199, 0.09227995574474335, 0.2834266126155853, 0.36343812942504883, -0.3660525381565094, 0.3207661509513855, -0.028866581618785858, -0.09551835060119629, 0.44780492782592773, -0.2291102558374405, 0.3065493106842041, -0.17596173286437988, 0.12076015025377274, -0.06330106407403946, -0.09754307568073273, 0.1002073884010315, -0.18346334993839264, -0.1987266093492508, -0.3162199556827545, 0.23890076577663422, -0.140419602394104, -0.16168685257434845, 0.00785701721906662, -0.35848623514175415, -0.3371201455593109, 0.052717406302690506, -0.12283122539520264, -0.38275158405303955, -0.16168129444122314, 0.03428258001804352, 0.10821253806352615, 0.1425507664680481, 0.29631945490837097, 0.12118813395500183, -0.06681763380765915, -0.21467286348342896, 0.08437417447566986, 0.12648995220661163, -0.14913976192474365, 0.01960539072751999, 0.10228769481182098, 0.30416712164878845, 0.26150232553482056, -0.18514487147331238, 0.020711258053779602, 0.1828697770833969, -0.049578793346881866, -0.0643029659986496, -0.2310541272163391, -0.25104179978370667, 0.2603314220905304, 0.32346171140670776, 0.24166876077651978, -0.15432365238666534, -0.22904740273952484, 0.06345412135124207, -0.0774478167295456, -0.3546738028526306, 0.5693658590316772, 0.4232792854309082, -0.12103712558746338, -0.04968319088220596, 0.2309744954109192, -0.3346366882324219, -0.2563340961933136, 0.2961485981941223, -0.025216270238161087, 0.08879446238279343, 0.12702716886997223, 0.0644230917096138, 0.2957174777984619, 0.4273761212825775, 0.13151849806308746, -0.2547123432159424, -0.2710290253162384, -0.109520323574543, -0.6645974516868591, 0.09170443564653397, 0.19731557369232178, 0.015124021098017693, 0.15634942054748535, 0.14242543280124664, 0.1695193648338318, 0.10438861697912216, -0.26488226652145386, 0.13104674220085144, 0.12282956391572952, 0.11511606723070145, -0.24585993587970734, -0.07127031683921814, 0.16522875428199768, -0.009497348219156265, -0.05606988072395325, -0.4509021043777466, 0.12379391491413116, 0.2107381373643875, 0.045994848012924194, 0.036740742623806, -0.05714438855648041, 0.1454569548368454, -0.10483528673648834, 0.3091553747653961, 0.0046236347407102585, 0.22573257982730865, -0.02979375049471855, -0.09562757611274719, -0.055181872099637985, -0.219339519739151, -0.17952467501163483, 0.025959666818380356, -0.1300913244485855, 0.22439365088939667, -0.3003731667995453, -0.06647798418998718, -0.5604401230812073, -0.1374882459640503, 0.06442072242498398, -0.12863434851169586, -0.33148112893104553, -0.05586916208267212, -0.09558835625648499, 0.055165499448776245, 0.26136094331741333, 0.09064044058322906, 0.03209859877824783, 0.07005362212657928, -0.1296963095664978, -0.10992955416440964, 0.34600475430488586, 0.007060510106384754, -0.36722949147224426, -0.2807070016860962, 0.16200673580169678, -0.02105461061000824, 0.2317579835653305, -0.49114397168159485, 0.0998496487736702, 0.39197808504104614, -0.09789378196001053, 0.14764398336410522, 0.42608001828193665, 0.283956378698349, -0.023566262796521187, -0.1957942694425583, 0.06433487683534622, 0.017916889861226082, -0.2120840847492218, -0.19637879729270935, -0.2507069706916809 ]
https://github.com/huggingface/datasets/issues/5044
integrate `load_from_disk` into `load_dataset`
@lhoestq Let me know if you have further recommendations or anything that you would like to add but you don't have bandwith for.
**Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you!
23
integrate `load_from_disk` into `load_dataset` **Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you! @lhoestq Let me know if you have further recommendations or anything that you would like to add but you don't have bandwith for.
[ -0.44635680317878723, -0.2547794580459595, 0.010255537927150726, 0.2019416093826294, 0.2771260142326355, -0.06415087729692459, 0.34563735127449036, 0.05371537804603577, 0.18767482042312622, 0.0032595768570899963, -0.12003012001514435, 0.4315917193889618, -0.21891242265701294, 0.3659507930278778, 0.1304887980222702, -0.031987108290195465, 0.09322202950716019, 0.14932434260845184, -0.19573140144348145, -0.06984389573335648, -0.18395498394966125, 0.2209053486585617, 0.11793144047260284, -0.04411688446998596, -0.11173413693904877, 0.18309085071086884, -0.1365537941455841, 0.11326459050178528, 0.0197085440158844, -0.3285708427429199, 0.6284780502319336, 0.2716442942619324, 0.3341926038265228, 0.3633251190185547, -0.00011232155520701781, 0.1923799067735672, 0.25741714239120483, -0.21307030320167542, -0.507559597492218, -0.34604889154434204, -0.06604377925395966, -0.15244938433170319, 0.3846595883369446, -0.30427679419517517, -0.11516166478395462, 0.09200955927371979, -0.11395889520645142, -0.26704615354537964, 0.35503774881362915, 0.12621402740478516, 0.19490507245063782, 0.4610063135623932, -0.11474540829658508, -0.15635262429714203, -0.04331285506486893, 0.41405385732650757, -0.15227332711219788, 0.19862477481365204, 0.3236578702926636, 0.11076841503381729, 0.03542458266019821, -0.1009954959154129, 0.017977194860577583, -0.07209663093090057, 0.42302027344703674, -0.006927105598151684, 0.30070945620536804, -0.0844963937997818, -0.2096083164215088, 0.17899908125400543, 0.5157183408737183, -0.39214658737182617, -0.3643263876438141, -0.5026596188545227, -0.13282747566699982, -0.16695989668369293, 0.09329231828451157, 0.07267232239246368, -0.17898188531398773, 0.2149742841720581, -0.1521054059267044, -0.26146239042282104, -0.25491923093795776, -0.11651460826396942, -0.2542811930179596, 0.353007048368454, 0.016999797895550728, 0.04191915690898895, 0.13370166718959808, 0.07342766225337982, 0.38972190022468567, -0.19089065492153168, 0.24229104816913605, 0.09421911835670471, -0.24278558790683746, -0.2565828859806061, 0.00013849884271621704, 0.022671040147542953, 0.06363434344530106, 0.4243124723434448, 0.21719910204410553, -0.008537530899047852, -0.06446804851293564, 0.23400971293449402, 0.4109697639942169, 0.12736648321151733, -0.14713141322135925, 0.15610776841640472, 0.2063167840242386, 0.12792259454727173, -0.11544084548950195, -0.010730881243944168, -0.08807200938463211, 0.01640136167407036, 0.1928263008594513, -0.07598569244146347, 0.19586119055747986, -0.0835166946053505, -0.03711214289069176, -0.3383900821208954, 0.5547189116477966, -0.10464300215244293, 0.20493869483470917, 0.19755050539970398, 0.039358384907245636, 0.4786982834339142, -0.1625950187444687, 0.36062055826187134, -0.10504639148712158, -0.1225094348192215, -0.19547757506370544, -0.20724661648273468, -0.05705943703651428, 0.07984813302755356, 0.1456216722726822, 0.13923588395118713, 0.1787695586681366, -0.08057089895009995, 0.12609204649925232, 0.3008764982223511, -0.0651334896683693, -0.1567111313343048, -0.11627800017595291, 0.0743706077337265, 0.02845492586493492, 0.07488644123077393, 0.007411450147628784, -0.06409267336130142, -0.5090036988258362, 0.03482671082019806, -0.32618337869644165, -0.5912933349609375, -0.0531468391418457, 0.1748252660036087, -0.42324018478393555, -0.1719433218240738, -0.6718006730079651, -0.0013164989650249481, -0.1686438024044037, -0.021299472078680992, -0.351436972618103, -0.14789262413978577, -0.1053205281496048, -0.17409346997737885, 0.2638726234436035, 0.3069562315940857, -0.16854628920555115, -0.22903068363666534, -0.19985440373420715, -0.18032598495483398, 0.1715085804462433, 0.18886588513851166, -0.49015718698501587, 0.4394935071468353, -0.32368141412734985, -0.11375617980957031, 0.5816370248794556, -0.46631279587745667, -0.17346875369548798, 0.3063003122806549, -0.004085011780261993, 0.18480293452739716, 0.17696386575698853, -0.07677151262760162, 0.36583709716796875, -0.13408268988132477, 0.062091559171676636, 0.8756173253059387, -0.08790656924247742, 0.012081073597073555, -0.26748332381248474, -0.36589357256889343, 0.19966517388820648, 0.3545733094215393, 0.13553869724273682, 0.15401285886764526, 0.06548722833395004, 0.26369303464889526, 0.2032966911792755, -0.11974361538887024, 0.07608792185783386, 0.3086537718772888, 0.2587825357913971, 0.020028751343488693, 0.0749732181429863, -0.12356842309236526, -0.5101427435874939, 0.3351292014122009, -0.04241221770644188, 0.04525567963719368, -0.35736173391342163, -0.1276521384716034, -0.2051618993282318, 0.07006523013114929, -0.402789443731308, -0.03613338991999626, 0.09424085915088654, 0.320743590593338, 0.2164677530527115, -0.25024017691612244, -0.20365463197231293, 0.36225786805152893, 0.11425057053565979, 0.0784664899110794, -0.18529000878334045, 0.6780503988265991, 0.05842384696006775, -0.17809078097343445, -0.11496548354625702, 0.20946887135505676, 0.06569327414035797, -0.2769717574119568, -0.0019130511209368706, 0.41317614912986755, 0.01691555045545101, 0.4686205983161926, 0.08684127777814865, 0.19327223300933838, 0.29106444120407104, -0.12490731477737427, 0.02991207130253315, -0.052397336810827255, -0.026940561830997467, 0.08976993709802628, -0.2633309066295624, 0.34643715620040894, -0.2256009727716446, 0.35073456168174744, 0.15957507491111755, -0.08943828195333481, 0.3817696273326874, -0.03592948243021965, -0.09725683927536011, -0.012870822101831436, -0.13044533133506775, 0.19207707047462463, 0.3649320602416992, 0.06154238432645798, -0.09770414978265762, -0.03998810797929764, 0.18714404106140137, -0.05229029059410095, -0.0068887099623680115, 0.0551593191921711, -0.05352272838354111, -0.114099882543087, -0.004792971536517143, 0.2650071978569031, 0.5078422427177429, 0.25574028491973877, 0.13561353087425232, 0.029122304171323776, -0.05348417907953262, -0.0044463276863098145, 0.2727358639240265, 0.15648561716079712, 0.2832987606525421, 0.22360223531723022, 0.08554264903068542, 0.001394379884004593, -0.24136313796043396, -0.11256392300128937, 0.09717651456594467, 0.06341761350631714, -0.1743958294391632, 0.10756804794073105, -0.10832475125789642, 0.3231523334980011, -0.4029679000377655, 0.12365640699863434, -0.2643119990825653, -0.2780287563800812, -0.12783154845237732, 0.43217888474464417, -0.13963592052459717, 0.06651127338409424, -0.05474238842725754, 0.3567827343940735, -0.19424554705619812, -0.5460314154624939, -0.11555740982294083, -0.15722528100013733, 0.04737017676234245, 0.05962352082133293, 0.26577135920524597, -0.08804608136415482, 0.2218966782093048, -0.12120706588029861, 0.13066045939922333, -0.31196463108062744, -0.04999452456831932, 0.24415245652198792, 0.03282300755381584, 0.24287989735603333, -0.020855620503425598, 0.0546271838247776, 0.3534201979637146, -0.41475048661231995, 0.22856643795967102, -0.22334110736846924, 0.04618947207927704, 0.0909002423286438, -0.08078381419181824, 0.13392207026481628, 0.034338001161813736, -0.18621358275413513, -0.4795096814632416, -0.49520695209503174, 0.02438276633620262, 0.19314533472061157, 0.11455674469470978, -0.05418621748685837, -0.04496750235557556, -0.2407151311635971, 0.20901910960674286, 0.040081992745399475, -0.02571972645819187, -0.3220134377479553, 0.3622100055217743, -0.22657334804534912, -0.021448589861392975, -0.1730392575263977, -0.20893403887748718, 0.5292026400566101, 0.15419845283031464, -0.26064491271972656, 0.013997708447277546, -0.11693300306797028, 0.32866713404655457, -0.12168198823928833, 0.10848649591207504, 0.5181266665458679, 0.17484226822853088, 0.05513863265514374, 0.040927954018116, -0.16978640854358673, 0.09216197580099106, 0.266749769449234, 0.06145615130662918, 0.15790295600891113, 0.07257144153118134, -0.1676817536354065, 0.555962860584259, -0.24796606600284576, -0.014482926577329636, 0.4367142617702484, -0.00707339309155941, 0.3039678633213043, -0.15355917811393738, -0.1745140254497528, -0.22952595353126526, -0.159481942653656, -0.18393154442310333, 0.23068228363990784, 0.021490607410669327, -0.2576240599155426, -0.2860363721847534, -0.2756473422050476, -0.22154268622398376, -0.40828120708465576, 0.07740157842636108, -0.10831275582313538, 0.18559147417545319, -0.20079222321510315, -0.0963144600391388, -0.34154218435287476, 0.2236352264881134, 0.1560320407152176, 0.14862287044525146, 0.14841599762439728, -0.10120325535535812, -0.44438299536705017, 0.20654186606407166, -0.06448983401060104, -0.024373352527618408, -0.2539956569671631, -0.043826647102832794, 0.1102249026298523, -0.38202598690986633, -0.05243155360221863, -0.11291380226612091, 0.6925046443939209, -0.1487998217344284, 0.07244062423706055, 0.1441841572523117, -0.2381795048713684, -0.4339340031147003, -0.15819118916988373, -0.019874073565006256, -0.11790519952774048, -0.13296207785606384, 0.7781628370285034, -0.3752445876598358, -0.3503108024597168, 0.014953960664570332, 0.3343563377857208, -0.3301933705806732, -0.22293058037757874, -0.11541154980659485, -0.018907874822616577, -0.42401599884033203, -0.02010314166545868, 0.03919621556997299, 0.5152043700218201, -0.06419570744037628, 0.06195631995797157, -0.262861967086792, -0.12685132026672363, 0.18433785438537598, 0.13128621876239777, 0.4869297742843628, -0.20634543895721436, 0.1716470718383789, 0.09666740894317627, 0.17354756593704224, 0.010909421369433403, 0.5878550410270691, -0.4166441261768341, -0.38498586416244507, 0.17078185081481934, 0.11818462610244751, 0.3106299638748169, 0.2799059748649597, 0.2124951332807541, -0.09007295221090317, -0.2287084460258484, 0.027336660772562027, -0.4892085790634155, 0.11135415732860565, 0.0208892785012722, -0.24927948415279388, -0.2533024549484253, -0.4165888726711273, 0.37520936131477356, 0.01329738274216652, -0.18447232246398926, -0.013009496033191681, 0.17294646799564362, -0.5654257535934448, 0.7654725909233093, 0.10811246931552887, 1.0762717723846436, -0.08449025452136993, 0.19236940145492554, 0.07936131954193115, -0.05317005142569542, 0.13354940712451935, -0.47980332374572754, -0.09020555764436722, -0.272105872631073, -0.01984579861164093, -0.01482574362307787, -0.1463787853717804, 0.06868007779121399, 0.3221193552017212, -0.15726931393146515, 0.21274662017822266, 0.03786298632621765, 0.3206479549407959, -0.10975240170955658, 0.44978487491607666, -0.07123956084251404, -0.3768266439437866, -0.35179704427719116, 0.08640873432159424, 0.03135126084089279, 0.05805563926696777, -0.09666197746992111, -0.23444068431854248, 0.07901136577129364, -0.1303843855857849, -0.07102790474891663, 0.03004295751452446, 0.016758928075432777, 0.27765733003616333, -0.016413003206253052, -0.18902552127838135, -0.06169592961668968, 0.28057631850242615, 0.39831119775772095, 0.04825753718614578, -0.2552574574947357, 0.15702950954437256, -0.2528713345527649, 0.1653604954481125, -0.2355550080537796, -0.1318996399641037, 0.2529473900794983, -0.1598481833934784, -0.15855461359024048, -0.11422396451234818, -0.10054569691419601, -0.5470198392868042, -0.0015972256660461426, -0.19661857187747955, 0.4353283643722534, -0.3088325262069702, -0.14616338908672333, 0.010558739304542542, 0.18924707174301147, -0.23926067352294922, 0.12412962317466736, -0.00006886571645736694, -0.2327844649553299, 0.14909079670906067, -0.1261010468006134, -0.2104520946741104, -0.17303366959095, 0.2493118941783905, 0.1888887882232666, -0.103535957634449, 0.340328574180603, -0.21679043769836426, -0.1301937699317932, -0.2267143726348877, 0.0807984247803688, 0.43595272302627563, -0.5757875442504883, 0.13046427071094513, -0.12201034277677536, -0.24642229080200195, 0.02744143083691597, 0.1900179237127304, 0.3461090326309204, 0.05377016216516495, -0.17301024496555328, -0.1801491379737854, -0.30108100175857544, 0.192154660820961, 0.028963914141058922, 0.33730021119117737, 0.3006258010864258, -0.16995719075202942, -0.15235352516174316, 0.08808407187461853, -0.35984429717063904, 0.012989822775125504, 0.00891035608947277, 0.060173407196998596, 0.027343953028321266, -0.1890716254711151, 0.14774224162101746, -0.047961749136447906, 0.14852771162986755, -0.17874091863632202, -0.22836725413799286, -0.18087583780288696, -0.14006628096103668, 0.18307878077030182, -0.008933380246162415, 0.1126115545630455, -0.14918673038482666, -0.04932999610900879, -0.0011450499296188354, -0.258667916059494, 0.3044569492340088, -0.03704662621021271, -0.01837693154811859, 0.05806856229901314, 0.6921906471252441, 0.17879469692707062, -0.5141153335571289, 0.170199453830719, 0.0167253240942955, 0.2880464494228363, 0.11172565817832947, 0.22138269245624542, -0.21298643946647644, -0.15958267450332642, -0.16861216723918915, 0.07311073690652847, 0.34964221715927124, 0.24428337812423706, 0.32692936062812805, 0.024572134017944336, -0.09133671224117279, 0.25539952516555786, 0.31845101714134216, 0.20176856219768524, -0.060763854533433914, -0.03617577999830246, 0.19780904054641724, 0.23562799394130707, -0.13119199872016907, -0.2981404662132263, 0.05216755345463753, -0.28235483169555664, 0.021306347101926804, 0.3129137456417084, 0.4901920258998871, 0.08255104720592499, 0.11415432393550873, 0.09087301045656204, 0.7566288113594055, 0.09686536341905594, 0.4155884087085724, 0.5809623599052429, -0.007922150194644928, 0.07643285393714905, 0.02077232301235199, 0.09227995574474335, 0.2834266126155853, 0.36343812942504883, -0.3660525381565094, 0.3207661509513855, -0.028866581618785858, -0.09551835060119629, 0.44780492782592773, -0.2291102558374405, 0.3065493106842041, -0.17596173286437988, 0.12076015025377274, -0.06330106407403946, -0.09754307568073273, 0.1002073884010315, -0.18346334993839264, -0.1987266093492508, -0.3162199556827545, 0.23890076577663422, -0.140419602394104, -0.16168685257434845, 0.00785701721906662, -0.35848623514175415, -0.3371201455593109, 0.052717406302690506, -0.12283122539520264, -0.38275158405303955, -0.16168129444122314, 0.03428258001804352, 0.10821253806352615, 0.1425507664680481, 0.29631945490837097, 0.12118813395500183, -0.06681763380765915, -0.21467286348342896, 0.08437417447566986, 0.12648995220661163, -0.14913976192474365, 0.01960539072751999, 0.10228769481182098, 0.30416712164878845, 0.26150232553482056, -0.18514487147331238, 0.020711258053779602, 0.1828697770833969, -0.049578793346881866, -0.0643029659986496, -0.2310541272163391, -0.25104179978370667, 0.2603314220905304, 0.32346171140670776, 0.24166876077651978, -0.15432365238666534, -0.22904740273952484, 0.06345412135124207, -0.0774478167295456, -0.3546738028526306, 0.5693658590316772, 0.4232792854309082, -0.12103712558746338, -0.04968319088220596, 0.2309744954109192, -0.3346366882324219, -0.2563340961933136, 0.2961485981941223, -0.025216270238161087, 0.08879446238279343, 0.12702716886997223, 0.0644230917096138, 0.2957174777984619, 0.4273761212825775, 0.13151849806308746, -0.2547123432159424, -0.2710290253162384, -0.109520323574543, -0.6645974516868591, 0.09170443564653397, 0.19731557369232178, 0.015124021098017693, 0.15634942054748535, 0.14242543280124664, 0.1695193648338318, 0.10438861697912216, -0.26488226652145386, 0.13104674220085144, 0.12282956391572952, 0.11511606723070145, -0.24585993587970734, -0.07127031683921814, 0.16522875428199768, -0.009497348219156265, -0.05606988072395325, -0.4509021043777466, 0.12379391491413116, 0.2107381373643875, 0.045994848012924194, 0.036740742623806, -0.05714438855648041, 0.1454569548368454, -0.10483528673648834, 0.3091553747653961, 0.0046236347407102585, 0.22573257982730865, -0.02979375049471855, -0.09562757611274719, -0.055181872099637985, -0.219339519739151, -0.17952467501163483, 0.025959666818380356, -0.1300913244485855, 0.22439365088939667, -0.3003731667995453, -0.06647798418998718, -0.5604401230812073, -0.1374882459640503, 0.06442072242498398, -0.12863434851169586, -0.33148112893104553, -0.05586916208267212, -0.09558835625648499, 0.055165499448776245, 0.26136094331741333, 0.09064044058322906, 0.03209859877824783, 0.07005362212657928, -0.1296963095664978, -0.10992955416440964, 0.34600475430488586, 0.007060510106384754, -0.36722949147224426, -0.2807070016860962, 0.16200673580169678, -0.02105461061000824, 0.2317579835653305, -0.49114397168159485, 0.0998496487736702, 0.39197808504104614, -0.09789378196001053, 0.14764398336410522, 0.42608001828193665, 0.283956378698349, -0.023566262796521187, -0.1957942694425583, 0.06433487683534622, 0.017916889861226082, -0.2120840847492218, -0.19637879729270935, -0.2507069706916809 ]
https://github.com/huggingface/datasets/issues/5044
integrate `load_from_disk` into `load_dataset`
Any update on this issue? It makes existing scripts and examples fall flat when provided with a customized/preprocessed dataset saved to disk.
**Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you!
22
integrate `load_from_disk` into `load_dataset` **Is your feature request related to a problem? Please describe.** Is it possible to make `load_dataset` more universal similar to `from_pretrained` in `transformers` so that it can handle the hub, and the local path datasets of all supported types? Currently one has to choose a different loader depending on how the dataset has been created. e.g. this won't work: ``` $ git clone https://huggingface.co/datasets/severo/test-parquet $ python -c 'from datasets import load_dataset; ds=load_dataset("test-parquet"); \ ds.save_to_disk("my_dataset"); load_dataset("my_dataset")' [...] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/stas/anaconda3/envs/py38-pt112/lib/python3.8/site-packages/datasets/table.py", line 1968, in cast_table_to_schema raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string ``` both times the dataset is being loaded from disk. Why does it fail the second time? Why can't `save_to_disk` generate a dataset that can be immediately loaded by `load_dataset`? e.g. the simplest hack would be to have `save_to_disk` add some flag to the saved dataset, that tells `load_dataset` to internally call `load_from_disk`. like having `save_to_disk` create a `load_me_with_load_from_disk.txt` file ;) and `load_dataset` will support that feature from saved datasets from new `datasets` versions. The old ones will still need to use `load_from_disk` explicitly. Unless the flag is not needed and one can immediately tell by looking at the saved dataset that it was saved via `save_to_disk` and thus use `load_from_disk` internally. The use-case is defining a simple API where the user only ever needs to pass a `dataset_name_or_path` and it will always just work. Currently one needs to manually add additional switches telling the system whether to use one loading method or the other which works but it's not smooth. Thank you! Any update on this issue? It makes existing scripts and examples fall flat when provided with a customized/preprocessed dataset saved to disk.
[ -0.44635680317878723, -0.2547794580459595, 0.010255537927150726, 0.2019416093826294, 0.2771260142326355, -0.06415087729692459, 0.34563735127449036, 0.05371537804603577, 0.18767482042312622, 0.0032595768570899963, -0.12003012001514435, 0.4315917193889618, -0.21891242265701294, 0.3659507930278778, 0.1304887980222702, -0.031987108290195465, 0.09322202950716019, 0.14932434260845184, -0.19573140144348145, -0.06984389573335648, -0.18395498394966125, 0.2209053486585617, 0.11793144047260284, -0.04411688446998596, -0.11173413693904877, 0.18309085071086884, -0.1365537941455841, 0.11326459050178528, 0.0197085440158844, -0.3285708427429199, 0.6284780502319336, 0.2716442942619324, 0.3341926038265228, 0.3633251190185547, -0.00011232155520701781, 0.1923799067735672, 0.25741714239120483, -0.21307030320167542, -0.507559597492218, -0.34604889154434204, -0.06604377925395966, -0.15244938433170319, 0.3846595883369446, -0.30427679419517517, -0.11516166478395462, 0.09200955927371979, -0.11395889520645142, -0.26704615354537964, 0.35503774881362915, 0.12621402740478516, 0.19490507245063782, 0.4610063135623932, -0.11474540829658508, -0.15635262429714203, -0.04331285506486893, 0.41405385732650757, -0.15227332711219788, 0.19862477481365204, 0.3236578702926636, 0.11076841503381729, 0.03542458266019821, -0.1009954959154129, 0.017977194860577583, -0.07209663093090057, 0.42302027344703674, -0.006927105598151684, 0.30070945620536804, -0.0844963937997818, -0.2096083164215088, 0.17899908125400543, 0.5157183408737183, -0.39214658737182617, -0.3643263876438141, -0.5026596188545227, -0.13282747566699982, -0.16695989668369293, 0.09329231828451157, 0.07267232239246368, -0.17898188531398773, 0.2149742841720581, -0.1521054059267044, -0.26146239042282104, -0.25491923093795776, -0.11651460826396942, -0.2542811930179596, 0.353007048368454, 0.016999797895550728, 0.04191915690898895, 0.13370166718959808, 0.07342766225337982, 0.38972190022468567, -0.19089065492153168, 0.24229104816913605, 0.09421911835670471, -0.24278558790683746, -0.2565828859806061, 0.00013849884271621704, 0.022671040147542953, 0.06363434344530106, 0.4243124723434448, 0.21719910204410553, -0.008537530899047852, -0.06446804851293564, 0.23400971293449402, 0.4109697639942169, 0.12736648321151733, -0.14713141322135925, 0.15610776841640472, 0.2063167840242386, 0.12792259454727173, -0.11544084548950195, -0.010730881243944168, -0.08807200938463211, 0.01640136167407036, 0.1928263008594513, -0.07598569244146347, 0.19586119055747986, -0.0835166946053505, -0.03711214289069176, -0.3383900821208954, 0.5547189116477966, -0.10464300215244293, 0.20493869483470917, 0.19755050539970398, 0.039358384907245636, 0.4786982834339142, -0.1625950187444687, 0.36062055826187134, -0.10504639148712158, -0.1225094348192215, -0.19547757506370544, -0.20724661648273468, -0.05705943703651428, 0.07984813302755356, 0.1456216722726822, 0.13923588395118713, 0.1787695586681366, -0.08057089895009995, 0.12609204649925232, 0.3008764982223511, -0.0651334896683693, -0.1567111313343048, -0.11627800017595291, 0.0743706077337265, 0.02845492586493492, 0.07488644123077393, 0.007411450147628784, -0.06409267336130142, -0.5090036988258362, 0.03482671082019806, -0.32618337869644165, -0.5912933349609375, -0.0531468391418457, 0.1748252660036087, -0.42324018478393555, -0.1719433218240738, -0.6718006730079651, -0.0013164989650249481, -0.1686438024044037, -0.021299472078680992, -0.351436972618103, -0.14789262413978577, -0.1053205281496048, -0.17409346997737885, 0.2638726234436035, 0.3069562315940857, -0.16854628920555115, -0.22903068363666534, -0.19985440373420715, -0.18032598495483398, 0.1715085804462433, 0.18886588513851166, -0.49015718698501587, 0.4394935071468353, -0.32368141412734985, -0.11375617980957031, 0.5816370248794556, -0.46631279587745667, -0.17346875369548798, 0.3063003122806549, -0.004085011780261993, 0.18480293452739716, 0.17696386575698853, -0.07677151262760162, 0.36583709716796875, -0.13408268988132477, 0.062091559171676636, 0.8756173253059387, -0.08790656924247742, 0.012081073597073555, -0.26748332381248474, -0.36589357256889343, 0.19966517388820648, 0.3545733094215393, 0.13553869724273682, 0.15401285886764526, 0.06548722833395004, 0.26369303464889526, 0.2032966911792755, -0.11974361538887024, 0.07608792185783386, 0.3086537718772888, 0.2587825357913971, 0.020028751343488693, 0.0749732181429863, -0.12356842309236526, -0.5101427435874939, 0.3351292014122009, -0.04241221770644188, 0.04525567963719368, -0.35736173391342163, -0.1276521384716034, -0.2051618993282318, 0.07006523013114929, -0.402789443731308, -0.03613338991999626, 0.09424085915088654, 0.320743590593338, 0.2164677530527115, -0.25024017691612244, -0.20365463197231293, 0.36225786805152893, 0.11425057053565979, 0.0784664899110794, -0.18529000878334045, 0.6780503988265991, 0.05842384696006775, -0.17809078097343445, -0.11496548354625702, 0.20946887135505676, 0.06569327414035797, -0.2769717574119568, -0.0019130511209368706, 0.41317614912986755, 0.01691555045545101, 0.4686205983161926, 0.08684127777814865, 0.19327223300933838, 0.29106444120407104, -0.12490731477737427, 0.02991207130253315, -0.052397336810827255, -0.026940561830997467, 0.08976993709802628, -0.2633309066295624, 0.34643715620040894, -0.2256009727716446, 0.35073456168174744, 0.15957507491111755, -0.08943828195333481, 0.3817696273326874, -0.03592948243021965, -0.09725683927536011, -0.012870822101831436, -0.13044533133506775, 0.19207707047462463, 0.3649320602416992, 0.06154238432645798, -0.09770414978265762, -0.03998810797929764, 0.18714404106140137, -0.05229029059410095, -0.0068887099623680115, 0.0551593191921711, -0.05352272838354111, -0.114099882543087, -0.004792971536517143, 0.2650071978569031, 0.5078422427177429, 0.25574028491973877, 0.13561353087425232, 0.029122304171323776, -0.05348417907953262, -0.0044463276863098145, 0.2727358639240265, 0.15648561716079712, 0.2832987606525421, 0.22360223531723022, 0.08554264903068542, 0.001394379884004593, -0.24136313796043396, -0.11256392300128937, 0.09717651456594467, 0.06341761350631714, -0.1743958294391632, 0.10756804794073105, -0.10832475125789642, 0.3231523334980011, -0.4029679000377655, 0.12365640699863434, -0.2643119990825653, -0.2780287563800812, -0.12783154845237732, 0.43217888474464417, -0.13963592052459717, 0.06651127338409424, -0.05474238842725754, 0.3567827343940735, -0.19424554705619812, -0.5460314154624939, -0.11555740982294083, -0.15722528100013733, 0.04737017676234245, 0.05962352082133293, 0.26577135920524597, -0.08804608136415482, 0.2218966782093048, -0.12120706588029861, 0.13066045939922333, -0.31196463108062744, -0.04999452456831932, 0.24415245652198792, 0.03282300755381584, 0.24287989735603333, -0.020855620503425598, 0.0546271838247776, 0.3534201979637146, -0.41475048661231995, 0.22856643795967102, -0.22334110736846924, 0.04618947207927704, 0.0909002423286438, -0.08078381419181824, 0.13392207026481628, 0.034338001161813736, -0.18621358275413513, -0.4795096814632416, -0.49520695209503174, 0.02438276633620262, 0.19314533472061157, 0.11455674469470978, -0.05418621748685837, -0.04496750235557556, -0.2407151311635971, 0.20901910960674286, 0.040081992745399475, -0.02571972645819187, -0.3220134377479553, 0.3622100055217743, -0.22657334804534912, -0.021448589861392975, -0.1730392575263977, -0.20893403887748718, 0.5292026400566101, 0.15419845283031464, -0.26064491271972656, 0.013997708447277546, -0.11693300306797028, 0.32866713404655457, -0.12168198823928833, 0.10848649591207504, 0.5181266665458679, 0.17484226822853088, 0.05513863265514374, 0.040927954018116, -0.16978640854358673, 0.09216197580099106, 0.266749769449234, 0.06145615130662918, 0.15790295600891113, 0.07257144153118134, -0.1676817536354065, 0.555962860584259, -0.24796606600284576, -0.014482926577329636, 0.4367142617702484, -0.00707339309155941, 0.3039678633213043, -0.15355917811393738, -0.1745140254497528, -0.22952595353126526, -0.159481942653656, -0.18393154442310333, 0.23068228363990784, 0.021490607410669327, -0.2576240599155426, -0.2860363721847534, -0.2756473422050476, -0.22154268622398376, -0.40828120708465576, 0.07740157842636108, -0.10831275582313538, 0.18559147417545319, -0.20079222321510315, -0.0963144600391388, -0.34154218435287476, 0.2236352264881134, 0.1560320407152176, 0.14862287044525146, 0.14841599762439728, -0.10120325535535812, -0.44438299536705017, 0.20654186606407166, -0.06448983401060104, -0.024373352527618408, -0.2539956569671631, -0.043826647102832794, 0.1102249026298523, -0.38202598690986633, -0.05243155360221863, -0.11291380226612091, 0.6925046443939209, -0.1487998217344284, 0.07244062423706055, 0.1441841572523117, -0.2381795048713684, -0.4339340031147003, -0.15819118916988373, -0.019874073565006256, -0.11790519952774048, -0.13296207785606384, 0.7781628370285034, -0.3752445876598358, -0.3503108024597168, 0.014953960664570332, 0.3343563377857208, -0.3301933705806732, -0.22293058037757874, -0.11541154980659485, -0.018907874822616577, -0.42401599884033203, -0.02010314166545868, 0.03919621556997299, 0.5152043700218201, -0.06419570744037628, 0.06195631995797157, -0.262861967086792, -0.12685132026672363, 0.18433785438537598, 0.13128621876239777, 0.4869297742843628, -0.20634543895721436, 0.1716470718383789, 0.09666740894317627, 0.17354756593704224, 0.010909421369433403, 0.5878550410270691, -0.4166441261768341, -0.38498586416244507, 0.17078185081481934, 0.11818462610244751, 0.3106299638748169, 0.2799059748649597, 0.2124951332807541, -0.09007295221090317, -0.2287084460258484, 0.027336660772562027, -0.4892085790634155, 0.11135415732860565, 0.0208892785012722, -0.24927948415279388, -0.2533024549484253, -0.4165888726711273, 0.37520936131477356, 0.01329738274216652, -0.18447232246398926, -0.013009496033191681, 0.17294646799564362, -0.5654257535934448, 0.7654725909233093, 0.10811246931552887, 1.0762717723846436, -0.08449025452136993, 0.19236940145492554, 0.07936131954193115, -0.05317005142569542, 0.13354940712451935, -0.47980332374572754, -0.09020555764436722, -0.272105872631073, -0.01984579861164093, -0.01482574362307787, -0.1463787853717804, 0.06868007779121399, 0.3221193552017212, -0.15726931393146515, 0.21274662017822266, 0.03786298632621765, 0.3206479549407959, -0.10975240170955658, 0.44978487491607666, -0.07123956084251404, -0.3768266439437866, -0.35179704427719116, 0.08640873432159424, 0.03135126084089279, 0.05805563926696777, -0.09666197746992111, -0.23444068431854248, 0.07901136577129364, -0.1303843855857849, -0.07102790474891663, 0.03004295751452446, 0.016758928075432777, 0.27765733003616333, -0.016413003206253052, -0.18902552127838135, -0.06169592961668968, 0.28057631850242615, 0.39831119775772095, 0.04825753718614578, -0.2552574574947357, 0.15702950954437256, -0.2528713345527649, 0.1653604954481125, -0.2355550080537796, -0.1318996399641037, 0.2529473900794983, -0.1598481833934784, -0.15855461359024048, -0.11422396451234818, -0.10054569691419601, -0.5470198392868042, -0.0015972256660461426, -0.19661857187747955, 0.4353283643722534, -0.3088325262069702, -0.14616338908672333, 0.010558739304542542, 0.18924707174301147, -0.23926067352294922, 0.12412962317466736, -0.00006886571645736694, -0.2327844649553299, 0.14909079670906067, -0.1261010468006134, -0.2104520946741104, -0.17303366959095, 0.2493118941783905, 0.1888887882232666, -0.103535957634449, 0.340328574180603, -0.21679043769836426, -0.1301937699317932, -0.2267143726348877, 0.0807984247803688, 0.43595272302627563, -0.5757875442504883, 0.13046427071094513, -0.12201034277677536, -0.24642229080200195, 0.02744143083691597, 0.1900179237127304, 0.3461090326309204, 0.05377016216516495, -0.17301024496555328, -0.1801491379737854, -0.30108100175857544, 0.192154660820961, 0.028963914141058922, 0.33730021119117737, 0.3006258010864258, -0.16995719075202942, -0.15235352516174316, 0.08808407187461853, -0.35984429717063904, 0.012989822775125504, 0.00891035608947277, 0.060173407196998596, 0.027343953028321266, -0.1890716254711151, 0.14774224162101746, -0.047961749136447906, 0.14852771162986755, -0.17874091863632202, -0.22836725413799286, -0.18087583780288696, -0.14006628096103668, 0.18307878077030182, -0.008933380246162415, 0.1126115545630455, -0.14918673038482666, -0.04932999610900879, -0.0011450499296188354, -0.258667916059494, 0.3044569492340088, -0.03704662621021271, -0.01837693154811859, 0.05806856229901314, 0.6921906471252441, 0.17879469692707062, -0.5141153335571289, 0.170199453830719, 0.0167253240942955, 0.2880464494228363, 0.11172565817832947, 0.22138269245624542, -0.21298643946647644, -0.15958267450332642, -0.16861216723918915, 0.07311073690652847, 0.34964221715927124, 0.24428337812423706, 0.32692936062812805, 0.024572134017944336, -0.09133671224117279, 0.25539952516555786, 0.31845101714134216, 0.20176856219768524, -0.060763854533433914, -0.03617577999830246, 0.19780904054641724, 0.23562799394130707, -0.13119199872016907, -0.2981404662132263, 0.05216755345463753, -0.28235483169555664, 0.021306347101926804, 0.3129137456417084, 0.4901920258998871, 0.08255104720592499, 0.11415432393550873, 0.09087301045656204, 0.7566288113594055, 0.09686536341905594, 0.4155884087085724, 0.5809623599052429, -0.007922150194644928, 0.07643285393714905, 0.02077232301235199, 0.09227995574474335, 0.2834266126155853, 0.36343812942504883, -0.3660525381565094, 0.3207661509513855, -0.028866581618785858, -0.09551835060119629, 0.44780492782592773, -0.2291102558374405, 0.3065493106842041, -0.17596173286437988, 0.12076015025377274, -0.06330106407403946, -0.09754307568073273, 0.1002073884010315, -0.18346334993839264, -0.1987266093492508, -0.3162199556827545, 0.23890076577663422, -0.140419602394104, -0.16168685257434845, 0.00785701721906662, -0.35848623514175415, -0.3371201455593109, 0.052717406302690506, -0.12283122539520264, -0.38275158405303955, -0.16168129444122314, 0.03428258001804352, 0.10821253806352615, 0.1425507664680481, 0.29631945490837097, 0.12118813395500183, -0.06681763380765915, -0.21467286348342896, 0.08437417447566986, 0.12648995220661163, -0.14913976192474365, 0.01960539072751999, 0.10228769481182098, 0.30416712164878845, 0.26150232553482056, -0.18514487147331238, 0.020711258053779602, 0.1828697770833969, -0.049578793346881866, -0.0643029659986496, -0.2310541272163391, -0.25104179978370667, 0.2603314220905304, 0.32346171140670776, 0.24166876077651978, -0.15432365238666534, -0.22904740273952484, 0.06345412135124207, -0.0774478167295456, -0.3546738028526306, 0.5693658590316772, 0.4232792854309082, -0.12103712558746338, -0.04968319088220596, 0.2309744954109192, -0.3346366882324219, -0.2563340961933136, 0.2961485981941223, -0.025216270238161087, 0.08879446238279343, 0.12702716886997223, 0.0644230917096138, 0.2957174777984619, 0.4273761212825775, 0.13151849806308746, -0.2547123432159424, -0.2710290253162384, -0.109520323574543, -0.6645974516868591, 0.09170443564653397, 0.19731557369232178, 0.015124021098017693, 0.15634942054748535, 0.14242543280124664, 0.1695193648338318, 0.10438861697912216, -0.26488226652145386, 0.13104674220085144, 0.12282956391572952, 0.11511606723070145, -0.24585993587970734, -0.07127031683921814, 0.16522875428199768, -0.009497348219156265, -0.05606988072395325, -0.4509021043777466, 0.12379391491413116, 0.2107381373643875, 0.045994848012924194, 0.036740742623806, -0.05714438855648041, 0.1454569548368454, -0.10483528673648834, 0.3091553747653961, 0.0046236347407102585, 0.22573257982730865, -0.02979375049471855, -0.09562757611274719, -0.055181872099637985, -0.219339519739151, -0.17952467501163483, 0.025959666818380356, -0.1300913244485855, 0.22439365088939667, -0.3003731667995453, -0.06647798418998718, -0.5604401230812073, -0.1374882459640503, 0.06442072242498398, -0.12863434851169586, -0.33148112893104553, -0.05586916208267212, -0.09558835625648499, 0.055165499448776245, 0.26136094331741333, 0.09064044058322906, 0.03209859877824783, 0.07005362212657928, -0.1296963095664978, -0.10992955416440964, 0.34600475430488586, 0.007060510106384754, -0.36722949147224426, -0.2807070016860962, 0.16200673580169678, -0.02105461061000824, 0.2317579835653305, -0.49114397168159485, 0.0998496487736702, 0.39197808504104614, -0.09789378196001053, 0.14764398336410522, 0.42608001828193665, 0.283956378698349, -0.023566262796521187, -0.1957942694425583, 0.06433487683534622, 0.017916889861226082, -0.2120840847492218, -0.19637879729270935, -0.2507069706916809 ]
https://github.com/huggingface/datasets/issues/5038
`Dataset.unique` showing wrong output after filtering
Hi! It seems like `flatten_indices` (called in `unique`) doesn't know how to handle empty indices mappings. I'm working on the fix.
## Describe the bug After filtering a dataset, and if no samples remain, `Dataset.unique` will return the unique values of the unfiltered dataset. ## Steps to reproduce the bug ```python from datasets import Dataset dataset = Dataset.from_dict({'id': [0]}) dataset = dataset.filter(lambda _: False) print(dataset.unique('id')) ``` ## Expected results The above code should return an empty list since the dataset is empty. ## Actual results ```bash [0] ``` ## Environment info - `datasets` version: 2.5.1 - Platform: Linux-5.18.19-100.fc35.x86_64-x86_64-with-glibc2.34 - Python version: 3.9.14 - PyArrow version: 7.0.0 - Pandas version: 1.3.5
21
`Dataset.unique` showing wrong output after filtering ## Describe the bug After filtering a dataset, and if no samples remain, `Dataset.unique` will return the unique values of the unfiltered dataset. ## Steps to reproduce the bug ```python from datasets import Dataset dataset = Dataset.from_dict({'id': [0]}) dataset = dataset.filter(lambda _: False) print(dataset.unique('id')) ``` ## Expected results The above code should return an empty list since the dataset is empty. ## Actual results ```bash [0] ``` ## Environment info - `datasets` version: 2.5.1 - Platform: Linux-5.18.19-100.fc35.x86_64-x86_64-with-glibc2.34 - Python version: 3.9.14 - PyArrow version: 7.0.0 - Pandas version: 1.3.5 Hi! It seems like `flatten_indices` (called in `unique`) doesn't know how to handle empty indices mappings. I'm working on the fix.
[ 0.12757061421871185, -0.3022191524505615, -0.04662945866584778, 0.1432720273733139, 0.10523290932178497, 0.12954023480415344, 0.3957524001598358, 0.08936876058578491, -0.03021814301609993, 0.13340350985527039, -0.03949206322431564, 0.5570560693740845, -0.03645673766732216, -0.009144306182861328, -0.18362680077552795, 0.3060201108455658, 0.02516130357980728, 0.2715955376625061, 0.21527162194252014, -0.49691522121429443, -0.3574926555156708, 0.1930018961429596, -0.46736764907836914, -0.12569554150104523, -0.17535889148712158, -0.09154163300991058, 0.1743774116039276, 0.04102913290262222, -0.06418152153491974, -0.19125546514987946, 0.37654465436935425, 0.08640986680984497, -0.3576509654521942, 0.5003676414489746, -0.00011554720549611375, 0.006596170365810394, 0.2500288486480713, -0.04786199703812599, -0.15771682560443878, -0.33675122261047363, -0.35564687848091125, 0.059094011783599854, 0.1665748953819275, -0.24835005402565002, -0.22222396731376648, -0.24283568561077118, -0.3176892399787903, -0.33316633105278015, 0.22426247596740723, -0.015711376443505287, 0.1598607301712036, -0.05921019986271858, -0.06900596618652344, 0.0584404319524765, 0.13302332162857056, 0.16097095608711243, 0.09317655861377716, -0.06095591560006142, -0.02712441235780716, -0.009155979380011559, 0.19659936428070068, 0.38220423460006714, -0.38185277581214905, 0.17806635797023773, -0.18790876865386963, 0.21197807788848877, 0.04369122534990311, -0.1585679054260254, 0.11870024353265762, 0.2702837586402893, 0.14724647998809814, -0.20232924818992615, -0.40935084223747253, -0.22039446234703064, 0.09356369823217392, -0.35819169878959656, -0.23047500848770142, 0.15828028321266174, -0.009135572239756584, 0.14274488389492035, -0.1669732630252838, 0.23472446203231812, 0.15773063898086548, 0.08686002343893051, -0.22079023718833923, 0.3414306044578552, 0.0010817195288836956, 0.13317039608955383, -0.27696067094802856, 0.09360544383525848, 0.2080177217721939, -0.21719206869602203, 0.1235923022031784, 0.1495363563299179, -0.1665678471326828, -0.07407255470752716, 0.26955825090408325, -0.42395949363708496, 0.03914269059896469, -0.17288023233413696, 0.12109121680259705, -0.0017004609107971191, 0.04294854775071144, 0.08540360629558563, 0.16366781294345856, 0.2618872821331024, 0.251772403717041, 0.41180744767189026, -0.052730828523635864, -0.0667518898844719, -0.3439663052558899, -0.0674566850066185, 0.2924640476703644, 0.41642412543296814, 0.34110820293426514, 0.2489173710346222, 0.3674788475036621, -0.015343055129051208, -0.5812259912490845, 0.22465144097805023, -0.4782768785953522, -0.08830206841230392, 0.05265485867857933, -0.1311611831188202, 0.05616100877523422, 0.031631600111722946, 0.0150216706097126, -0.1654956340789795, -0.3362252116203308, -0.20962518453598022, -0.24498890340328217, -0.3208499550819397, -0.06342682987451553, -0.140047088265419, 0.009940322488546371, -0.23173868656158447, 0.359142929315567, 0.35299599170684814, 0.023248150944709778, -0.06741300225257874, 0.14555403590202332, 0.02355310693383217, 0.3879201412200928, 0.21866503357887268, -0.02935265749692917, 0.41213110089302063, 0.3791663944721222, -0.48773056268692017, -0.07530475407838821, 0.2984555661678314, -0.20741522312164307, -0.1672411561012268, -0.08986926078796387, 0.23422177135944366, -0.0961492508649826, 0.1713322252035141, 0.10858816653490067, 0.13707007467746735, 0.18138569593429565, -0.1956281214952469, -0.012474142014980316, -0.1111312210559845, -0.22102123498916626, -0.1852673888206482, 0.15607450902462006, 0.28922098875045776, -0.44955742359161377, -0.011012859642505646, -0.3643946945667267, 0.24865856766700745, 0.3327336311340332, 0.2791620194911957, -0.04895765334367752, 0.0022416114807128906, -0.17442725598812103, 0.06280815601348877, -0.03054969757795334, -0.004119940102100372, -0.35077226161956787, 0.14650100469589233, 0.11952586472034454, 0.4225994646549225, -0.14557644724845886, 0.0743078961968422, 0.5520502328872681, 0.18576660752296448, 0.426242470741272, -0.12590259313583374, -0.038374342024326324, -0.21996097266674042, -0.3061681389808655, -0.05705806612968445, 0.3799540400505066, -0.27380213141441345, -0.12274564802646637, 0.26820385456085205, -0.020724043250083923, -0.21884779632091522, 0.4228069484233856, 0.09175457060337067, -0.06702836602926254, 0.08047962188720703, 0.6034042239189148, -0.006824783980846405, 0.25214987993240356, -0.042527586221694946, -0.3499763309955597, 0.12008234113454819, -0.22299590706825256, 0.029511887580156326, -0.200843945145607, -0.5702276229858398, -0.24766859412193298, 0.09775646775960922, -0.20467035472393036, -0.18398046493530273, 0.11727111041545868, -0.07410493493080139, 0.10906240344047546, -0.006256284192204475, -0.2802462875843048, -0.005284879356622696, -0.14736337959766388, 0.029236212372779846, -0.30438750982284546, 0.35838472843170166, 0.2312229871749878, -0.028592150658369064, -0.08599202334880829, 0.12051898241043091, 0.29253754019737244, -0.006873567588627338, -0.14355209469795227, 0.17591050267219543, 0.172236368060112, -0.2724671959877014, 0.013273783028125763, -0.13782794773578644, 0.07305221259593964, -0.15319384634494781, -0.15750716626644135, 0.7290530800819397, 0.3124501407146454, 0.02225898951292038, -0.25255197286605835, 0.5749772787094116, -0.3129368722438812, -0.006606429815292358, -0.24155129492282867, 0.07324545830488205, 0.33095255494117737, -0.06567689031362534, -0.028776567429304123, -0.5023983716964722, -0.024075593799352646, -0.08812215924263, -0.11507371068000793, 0.11378598213195801, -0.31463199853897095, 0.19672054052352905, 0.048468466848134995, -0.15105365216732025, -0.003874465823173523, -0.014746498316526413, 0.22730693221092224, 0.060755789279937744, 0.30740201473236084, -0.016166619956493378, 0.2973235845565796, 0.3325604498386383, -0.05098159238696098, 0.03017674759030342, -0.15990200638771057, -0.08526064455509186, 0.18110015988349915, -0.019009314477443695, -0.2671777606010437, 0.23526224493980408, -0.009422501549124718, -0.10750924795866013, -0.3110259473323822, 0.1806165724992752, 0.0589413195848465, 0.2707134783267975, -0.2550273537635803, 0.0013904180377721786, -0.42013055086135864, -0.2787218987941742, 0.1164444088935852, -0.29130667448043823, -0.058711107820272446, -0.239137664437294, 0.1788758933544159, 0.3402535319328308, 0.013370338827371597, 0.23044967651367188, -0.06111343204975128, 0.08554814755916595, 0.5231841206550598, -0.20074212551116943, -0.1637246310710907, -0.09981883317232132, -0.3146509826183319, 0.0792098343372345, -0.19688335061073303, 0.1351434737443924, 0.13943003118038177, 0.06765741109848022, -0.041037365794181824, -0.2718072831630707, -0.45801684260368347, -0.04577356576919556, -0.16155463457107544, 0.372364342212677, 0.08453596383333206, -0.029498226940631866, -0.3494875431060791, 0.12897376716136932, 0.21655882894992828, -0.21778491139411926, -0.016834551468491554, 0.047486670315265656, -0.09372559189796448, 0.12143824249505997, -0.2744078040122986, -0.213177889585495, -0.02177976630628109, -0.09977717697620392, -0.27490365505218506, -0.18844202160835266, 0.2292528748512268, -0.15602774918079376, 0.06319934874773026, -0.2867166996002197, 0.01765800267457962, -0.10227706283330917, -0.4262368381023407, -0.2380911111831665, 0.2265767604112625, -0.05994464084506035, -0.11507314443588257, -0.23087237775325775, -0.3961779475212097, -0.1332951784133911, 0.19462618231773376, -0.3362746834754944, -0.34468063712120056, 0.008463293313980103, 0.060840342193841934, 0.1842188537120819, 0.20356710255146027, 0.023881956934928894, 0.08503405749797821, -0.1142013743519783, -0.038085512816905975, -0.1833467334508896, -0.020459607243537903, 0.23273003101348877, 0.17686662077903748, 0.05710224062204361, 0.2392684519290924, -0.05433408543467522, 0.1950458437204361, 0.7471779584884644, 0.08781787753105164, 0.06236657500267029, -0.18698056042194366, 0.31707319617271423, -0.20853787660598755, -0.40980076789855957, -0.5318771004676819, 0.17755931615829468, -0.24087108671665192, 0.1230519711971283, 0.10239368677139282, -0.022582294419407845, 0.11333821713924408, 0.09477360546588898, -0.6771894693374634, -0.22909945249557495, 0.015971137210726738, -0.003192458301782608, 0.02302388846874237, 0.2185051590204239, 0.19551846385002136, -0.1378501057624817, -0.262897789478302, -0.19592012465000153, 0.008363381028175354, 0.3265847861766815, 0.04296956583857536, 0.16008661687374115, -0.1267825961112976, -0.044596076011657715, 0.27727097272872925, 0.1523205041885376, 0.19783899188041687, 0.14628808200359344, -0.012368438765406609, 0.23255689442157745, 0.31369537115097046, 0.8319494724273682, -0.1944303959608078, -0.14993204176425934, 0.3818475902080536, -0.17996583878993988, -0.45759350061416626, -0.030146760866045952, -0.134015291929245, 0.213173970580101, -0.09165997803211212, 0.3276043236255646, -0.17634384334087372, 0.0075857629999518394, -0.053578898310661316, 0.3616466522216797, -0.3057176172733307, -0.23915068805217743, -0.13168703019618988, -0.18501636385917664, -0.12470534443855286, -0.12799209356307983, -0.24341453611850739, 0.20029082894325256, 0.08321832865476608, -0.18734273314476013, -0.13470369577407837, -0.18627327680587769, 0.1557614654302597, 0.07786841690540314, 0.4131369888782501, 0.11420806497335434, 0.2910838723182678, 0.01600932702422142, -0.08689011633396149, -0.028931571170687675, 0.5636003017425537, -0.3199557960033417, 0.10358273237943649, -0.2309013307094574, -0.21243180334568024, -0.12490924447774887, 0.22500832378864288, 0.036335527896881104, 0.31158068776130676, -0.16294454038143158, 0.18640995025634766, -0.010302499867975712, -0.18460609018802643, -0.08058799058198929, 0.09406587481498718, -0.25777262449264526, -0.4899729788303375, 0.2601259648799896, -0.18816830217838287, -0.07463593780994415, 0.7736446261405945, 0.37362223863601685, -0.28943541646003723, 0.3329172730445862, -0.11644086986780167, 0.6168432831764221, 0.0856514424085617, -0.0620257668197155, 0.12452379614114761, 0.13116832077503204, 0.163412407040596, 0.29103487730026245, 0.30291682481765747, -0.14809180796146393, -0.2701282799243927, -0.04132929816842079, 0.13794487714767456, -0.05130590498447418, 0.08726895600557327, -0.03236336261034012, 0.40254268050193787, -0.1851867288351059, 0.13757629692554474, 0.024280209094285965, -0.006993412971496582, 0.34683212637901306, 0.24529343843460083, -0.004275083541870117, 0.01977083459496498, 0.010742314159870148, 0.2941562831401825, 0.10456324368715286, -0.030633054673671722, 0.04319040849804878, -0.07900990545749664, 0.14265838265419006, -0.1883281171321869, 0.09382601082324982, 0.3734893202781677, 0.04768708348274231, -0.6024190783500671, -0.3443906605243683, -0.3492487072944641, -0.11259564757347107, 0.1178073137998581, 0.07862977683544159, -0.2043951153755188, 0.5640525221824646, 0.47365590929985046, -0.1709321290254593, -0.12174631655216217, 0.3331615924835205, 0.2731807231903076, -0.2135666310787201, 0.1029079407453537, -0.021153409034013748, -0.17695237696170807, 0.013058975338935852, 0.06055889651179314, 0.04143716022372246, -0.3425860106945038, 0.14099831879138947, -0.12119828164577484, 0.10161668062210083, -0.19193536043167114, 0.06027517840266228, 0.10750041157007217, -0.18264466524124146, 0.30334392189979553, -0.07468220591545105, -0.2206154465675354, -0.2668704390525818, 0.1053042784333229, 0.47464263439178467, 0.29249095916748047, 0.12640704214572906, -0.21862557530403137, -0.02390715479850769, -0.12470167130231857, 0.1173931434750557, 0.06870604306459427, -0.12588664889335632, 0.5231022834777832, -0.2734277844429016, 0.44829338788986206, 0.12447787821292877, 0.15925759077072144, 0.2095794826745987, 0.5025885701179504, -0.21305006742477417, -0.23372027277946472, -0.03490055352449417, 0.01368047297000885, 0.17857255041599274, 0.201033353805542, 0.05834445357322693, -0.025647297501564026, -0.03194187581539154, -0.2750459313392639, -0.303729772567749, 0.21258054673671722, 0.08124624937772751, 0.16535820066928864, -0.0462285652756691, 0.08466188609600067, 0.08313900977373123, -0.12944954633712769, 0.20446579158306122, -0.11484146118164062, 0.03566650301218033, -0.2610985040664673, -0.14490537345409393, 0.12051080912351608, -0.004658168181777, -0.11261981725692749, 0.15336471796035767, -0.04259945824742317, -0.10001887381076813, -0.2616763710975647, 0.14227086305618286, 0.24015310406684875, 0.05534655600786209, 0.2847864031791687, 0.004704460501670837, -0.18790319561958313, -0.4322124123573303, -0.032046839594841, -0.20572727918624878, -0.1772242933511734, 0.10001736134290695, 0.2401098906993866, -0.011338718235492706, 0.0768003761768341, -0.1381748914718628, -0.21097368001937866, -0.5879254937171936, -0.2658388614654541, 0.5325239896774292, -0.23414133489131927, 0.09591752290725708, 0.3432099521160126, 0.4711605906486511, -0.15264903008937836, -0.05344540998339653, -0.16968375444412231, 0.055730536580085754, 0.22143197059631348, -0.355742871761322, 0.05590389296412468, 0.26084885001182556, 0.47666066884994507, 0.3293367028236389, 0.33492815494537354, 0.029041912406682968, -0.23505862057209015, -0.16439476609230042, 0.0032159611582756042, 0.38151490688323975, -0.13451826572418213, 0.28404760360717773, 0.35403022170066833, 0.2965981662273407, 0.1556973159313202, 0.026921991258859634, 0.011330636218190193, -0.2513643205165863, 0.5304450988769531, 0.12149938195943832, 0.4596298336982727, 0.07702382653951645, 0.06148025020956993, -0.1661531925201416, -0.2000758796930313, 0.4118155837059021, 0.05190056562423706, -0.26505401730537415, 0.14867888391017914, 0.39498844742774963, 0.004946544766426086, -0.20739006996154785, -0.03349999338388443, -0.04722213000059128, 0.07596383988857269, -0.13336408138275146, 0.1307254433631897, -0.11662273108959198, -0.14499738812446594, 0.3492657244205475, -0.11591960489749908, 0.11413046717643738, -0.20090727508068085, 0.17106756567955017, -0.22375763952732086, -0.15651071071624756, -0.2652604877948761, -0.11017581075429916, 0.05301452428102493, 0.37901073694229126, -0.14393828809261322, 0.046441227197647095, 0.5817443132400513, -0.08916129171848297, 0.13409043848514557, 0.24950316548347473, 0.36358803510665894, 0.1792638599872589, 0.058038804680109024, 0.1021527573466301, 0.18489636480808258, -0.18673665821552277, -0.014692406170070171, 0.37845784425735474, 0.03204616159200668, 0.08592935651540756, -0.07684384286403656, 0.1148691326379776, -0.23320704698562622, 0.09616915136575699, 0.4363742470741272, 0.32439035177230835, -0.23235709965229034, 0.14436432719230652, 0.08630907535552979, -0.01048336923122406, -0.14482782781124115, -0.13941600918769836, -0.18431931734085083, 0.014578619971871376, 0.5008683204650879, 0.1786859929561615, 0.12953835725784302, 0.1822613924741745, 0.09737622737884521, -0.26166796684265137, -0.33013471961021423, -0.019356954842805862, -0.11936124414205551, -0.20890143513679504, 0.18464739620685577, -0.5205844640731812, 0.31205588579177856, -0.16611231863498688, 0.10093504190444946, 0.2544930577278137, 0.3026737868785858, -0.03564033657312393, 0.06828562915325165, 0.11194395273923874, -0.20646348595619202, -0.237442284822464, 0.21904334425926208, -0.14669233560562134, -0.149911567568779, -0.37218862771987915, -0.21827423572540283, -0.16697771847248077, -0.2529849410057068, 0.11931123584508896, -0.38328054547309875, 0.15170198678970337, 0.1319638192653656, 0.12856531143188477, 0.2041885107755661, 0.18034017086029053, -0.2149520218372345, 0.39822664856910706, 0.14775709807872772, -0.05059231072664261, 0.2399580478668213, 0.13158322870731354, 0.14025196433067322, -0.24453754723072052, 0.36976125836372375, 0.2798062562942505, 0.3020647466182709, 0.0987773984670639, -0.4997884929180145, -0.14343243837356567, 0.23816166818141937, 0.15107329189777374, -0.3162270486354828, -0.2883119583129883, 0.3497031033039093, -0.3423209488391876, -0.03724812716245651, -0.04569747671484947, 0.31200286746025085, 0.10849033296108246, 0.20344975590705872, 0.049498528242111206, -0.38799023628234863, 0.4435853660106659, -0.9022755026817322, -0.22127974033355713, -0.2703796923160553, 0.17934930324554443, 0.02060532197356224, -0.24056467413902283, -0.07810235768556595, -0.0687638372182846, 0.6103036999702454, -0.5008876919746399, 0.07812099158763885, -0.04759644344449043, -0.06528125703334808, 0.06548358500003815, -0.09729450941085815, -0.24732252955436707, 0.3141196370124817, -0.39666566252708435, 0.42093363404273987, -0.38231486082077026 ]
https://github.com/huggingface/datasets/issues/5032
new dataset type: single-label and multi-label video classification
Hi ! You can in the `features` folder how we implemented the audio and image feature types. We can have something similar to videos. What we need to decide: - the video loading library to use - the output format when a user accesses a video type object - what parameters a `Video()` feature type needs also cc @nateraw who also took a look at what we can do for video
**Is your feature request related to a problem? Please describe.** In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset. **Describe the solution you'd like** Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model. **Describe alternatives you've considered** Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative. **Additional context** I am wiling to open a PR but don't know where to start.
71
new dataset type: single-label and multi-label video classification **Is your feature request related to a problem? Please describe.** In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset. **Describe the solution you'd like** Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model. **Describe alternatives you've considered** Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative. **Additional context** I am wiling to open a PR but don't know where to start. Hi ! You can in the `features` folder how we implemented the audio and image feature types. We can have something similar to videos. What we need to decide: - the video loading library to use - the output format when a user accesses a video type object - what parameters a `Video()` feature type needs also cc @nateraw who also took a look at what we can do for video
[ -0.20656846463680267, -0.17477481067180634, -0.009809169918298721, -0.021113231778144836, 0.05933540314435959, -0.1979742795228958, 0.6924853324890137, 0.036978788673877716, -0.5309857130050659, -0.1518697291612625, -0.16085143387317657, 0.004332573153078556, -0.6190938949584961, 0.4993412494659424, 0.1203634962439537, -0.6150176525115967, 0.0634712278842926, 0.01224256306886673, 0.28913623094558716, -0.15311971306800842, -0.11246354877948761, -0.26842573285102844, -0.19859585165977478, 0.004074856638908386, -0.747003972530365, -0.07086104899644852, -0.16012029349803925, -0.2519204616546631, -0.1270264834165573, -0.4886370599269867, 0.040830567479133606, 0.016183074563741684, 0.4447450339794159, 0.550681471824646, -0.00011767181422328576, -0.3141753673553467, 0.05348248407244682, -0.1527387946844101, 0.04508893936872482, 0.03169950842857361, -0.3084430694580078, -0.28386595845222473, 0.21760644018650055, -0.15480777621269226, 0.0415874719619751, -0.3793567419052124, 0.0089179165661335, -0.23056857287883759, 0.2090144157409668, 0.08050353080034256, 0.11276669055223465, -0.14551801979541779, -0.19589152932167053, -0.04206854850053787, 0.3888416290283203, 0.5158923864364624, -0.21900665760040283, -0.0910109132528305, 0.8021165132522583, -0.049177005887031555, -0.24759125709533691, 0.37357601523399353, -0.09391140192747116, -0.2673184871673584, 0.1803177297115326, 0.04897576570510864, -0.04106259346008301, -0.5627049207687378, -0.2923724353313446, 0.2689003646373749, 0.7468147277832031, -0.1514689028263092, -0.5293691754341125, -0.13907968997955322, 0.20109544694423676, -0.05725836753845215, -0.24772164225578308, 0.4249643087387085, -0.31826117634773254, -0.12480686604976654, 0.010894170962274075, -0.12440051883459091, -0.343569815158844, 0.10144758224487305, 0.3260303735733032, -0.08746783435344696, 0.11597158759832382, 0.04963073134422302, 0.103788822889328, -0.1255570948123932, 0.26551538705825806, -0.1777803748846054, 0.44187089800834656, 0.3821881413459778, -0.08270914852619171, -0.2064109593629837, -0.3351004123687744, -0.11355423182249069, 0.05392070114612579, -0.024820201098918915, -0.109743632376194, -0.007702019065618515, -0.5459744334220886, 0.17373038828372955, 0.16691723465919495, -0.027961308136582375, 0.09616003185510635, 0.1110454723238945, 0.11855994910001755, 0.09689867496490479, -0.22955520451068878, 0.011162420734763145, -0.22736074030399323, 0.040349263697862625, 0.3434527516365051, 0.4980044364929199, 0.04342310130596161, -0.13219505548477173, 0.0006706453859806061, -0.23756517469882965, -0.11609284579753876, -0.16327911615371704, 0.1988128423690796, -0.06477514654397964, 0.034868139773607254, 0.46299123764038086, -0.14631213247776031, 0.3422378897666931, -0.07670482248067856, -0.363714337348938, 0.14958010613918304, 0.28773629665374756, -0.4103967547416687, 0.1268707662820816, 0.48791584372520447, 0.060219548642635345, -0.2744951844215393, 0.1462809294462204, 0.012791898101568222, -0.006468981504440308, 0.09774570912122726, -0.07321058213710785, 0.04394637793302536, -0.10757701098918915, -0.13470260798931122, 0.08694016933441162, -0.009452365338802338, 0.46927541494369507, -0.11008280515670776, -0.037345848977565765, -0.13521331548690796, -0.1817832589149475, -0.13576070964336395, 0.06586992740631104, 0.30905693769454956, 0.10096172243356705, -0.039377935230731964, 0.4509011507034302, 0.0007987916469573975, -0.18267510831356049, -0.06190437823534012, -0.044218406081199646, 0.15077191591262817, -0.25290048122406006, -0.23911340534687042, 0.351468026638031, -0.5752089619636536, -0.20073650777339935, -0.11438925564289093, -0.11519694328308105, 0.18296167254447937, 0.3185312747955322, -0.2228323221206665, -0.08869440108537674, 0.03864189237356186, -0.26571884751319885, 0.24621176719665527, -0.6903237104415894, 0.3030703663825989, 0.22963647544384003, -0.10864461958408356, 0.07927580922842026, 0.44631367921829224, 0.45466145873069763, 0.15686346590518951, -0.3076636791229248, 0.13246773183345795, 0.2319735884666443, -0.3161715567111969, -0.17164139449596405, 0.007549170404672623, -0.31966888904571533, -0.05184602737426758, 0.2303130179643631, 0.3360689878463745, 0.0993875116109848, -0.07512947171926498, 0.09898491203784943, 0.053447067737579346, -0.02461342141032219, 0.43614107370376587, -0.19009122252464294, 0.4397803246974945, -0.11374838650226593, -0.10932069271802902, -0.5059652924537659, -0.4424670934677124, 0.060899995267391205, -0.33308330178260803, 0.2065955400466919, 0.25087571144104004, -0.34664011001586914, 0.2532573342323303, -0.1789155900478363, 0.015376195311546326, -0.03486425057053566, 0.0019232779741287231, 0.2707397937774658, -0.2606094479560852, -0.15404242277145386, -0.435304194688797, -0.010478643700480461, 0.375792920589447, 0.060206200927495956, 0.1267116218805313, 0.21152028441429138, 0.19695384800434113, 0.060122013092041016, -0.0907667875289917, 0.3957476019859314, 0.1922195851802826, 0.041569214314222336, 0.26154476404190063, 0.10309746861457825, 0.11736670881509781, 0.04995838552713394, 0.03860390931367874, 0.2253381907939911, 0.36910438537597656, -0.5055734515190125, 0.24312028288841248, -0.24429507553577423, 0.19213558733463287, -0.2234702706336975, -0.09549125283956528, 0.3728465437889099, -0.029855776578187943, 0.06673508882522583, -0.014612354338169098, 0.2401193082332611, 0.1373641937971115, -0.01311781257390976, -0.01778186857700348, -0.2058773934841156, -0.0567190907895565, 0.05183136835694313, -0.10078282654285431, -0.04301781952381134, -0.42626094818115234, -0.083827443420887, 0.396912544965744, -0.20298230648040771, 0.11079666763544083, 0.15726390480995178, -0.13109585642814636, 0.075803741812706, -0.016231445595622063, 0.06895235180854797, 0.23349109292030334, 0.09237723052501678, -0.1707855463027954, -0.2229599505662918, -0.06390725076198578, -0.04987748712301254, 0.0981798991560936, 0.05082572251558304, -0.016902422532439232, 0.02128567546606064, 0.016782157123088837, 0.09740214049816132, 0.22319620847702026, -0.4642457067966461, 0.11590593308210373, -0.2554154694080353, -0.03476821631193161, -0.13802535831928253, -0.04845084249973297, -0.1285388469696045, -0.24798676371574402, -0.25818783044815063, 0.05638989433646202, 0.11894606053829193, 0.21784168481826782, 0.02807137370109558, 0.24145829677581787, 0.22772721946239471, 0.009892888367176056, 0.5559192895889282, -0.07514340430498123, 0.011514533311128616, 0.15397733449935913, -0.04524145647883415, -0.2193160355091095, 0.10577727854251862, 0.24943365156650543, -0.0937085747718811, 0.17231352627277374, 0.21205532550811768, 0.07553303241729736, -0.43765199184417725, -0.037095412611961365, 0.1095455139875412, 0.1023610383272171, 0.1962282508611679, 0.13847652077674866, -0.1839834302663803, 0.006285954266786575, -0.22480857372283936, 0.017728019505739212, -0.04731467738747597, 0.1646953523159027, -0.15341348946094513, -0.17890000343322754, 0.1527712047100067, -0.05137646198272705, -0.08486444503068924, -0.5000702738761902, -0.1458839327096939, 0.25357407331466675, 0.18363790214061737, 0.08312850445508957, 0.045035358518362045, -0.03198682516813278, -0.042542751878499985, 0.1280423253774643, 0.08343661576509476, 0.08932361751794815, 0.00890306755900383, 0.06906402111053467, -0.12593156099319458, -0.30215513706207275, -0.21858364343643188, -0.16138197481632233, -0.12550218403339386, 0.23846010863780975, 0.05105628818273544, -0.0982525646686554, 0.07410341501235962, 0.08241143822669983, 0.024442268535494804, -0.027024680748581886, 0.2189348042011261, 0.1658460944890976, -0.004438063129782677, -0.02651008777320385, 0.11805182695388794, 0.13102255761623383, -0.0036796480417251587, 0.06252497434616089, 0.10936533659696579, 0.16301998496055603, -0.08817027509212494, 0.8065080046653748, -0.019651520997285843, -0.2737516462802887, 0.1946139633655548, 0.16014842689037323, -0.2254079133272171, -0.027849651873111725, -0.4047704041004181, 0.03195510432124138, -0.4463166892528534, 0.12435226142406464, 0.10895373672246933, 0.0021755844354629517, -0.26198282837867737, -0.35802748799324036, 0.39283159375190735, -0.19002383947372437, -0.013640029355883598, 0.29572412371635437, -0.2804349660873413, 0.2911655604839325, -0.16391420364379883, -0.2938581705093384, -0.4229680299758911, -0.02745017781853676, -0.14052729308605194, 0.25112101435661316, 0.13412714004516602, -0.19965414702892303, -0.41116467118263245, 0.07306107133626938, 0.07903395593166351, 0.20730850100517273, 0.4810294210910797, 0.1121373102068901, -0.13069623708724976, 0.1949252486228943, 0.04484591260552406, 0.2642074227333069, 0.3633439540863037, -0.18664972484111786, 0.07405362278223038, 0.09149867296218872, 0.08080624043941498, 0.14286309480667114, -0.08537082374095917, -0.5171857476234436, 0.09315216541290283, -0.0358351431787014, 0.24968041479587555, 0.06763718277215958, -0.35226744413375854, 0.08218429982662201, 0.09644418209791183, 0.1423952728509903, -0.002055961638689041, 0.22434358298778534, 0.3967146575450897, -0.13690997660160065, -0.08140004426240921, 0.3985971212387085, 0.013254856690764427, -0.23189067840576172, -0.2522451877593994, 0.07634209841489792, 0.16681140661239624, 0.5012727975845337, -0.2471923530101776, -0.09711865335702896, 0.07241332530975342, 0.08801203966140747, -0.26920098066329956, -0.023970693349838257, 0.24425429105758667, 0.13128039240837097, -0.19387412071228027, -0.21895942091941833, 0.3974837362766266, -0.0309206023812294, 0.40617045760154724, 0.39156439900398254, 0.11419347673654556, 0.2543942332267761, -0.05579055845737457, 0.0008971095085144043, -0.23164890706539154, -0.006064760964363813, 0.46147751808166504, -0.19931137561798096, -0.7016438245773315, -0.4743860960006714, 0.5233628153800964, -0.0045393723994493484, -0.23195050656795502, 0.09368237853050232, -0.09641461074352264, -0.26063671708106995, 0.2527453303337097, 0.3149714171886444, 0.8348076939582825, -0.11421433091163635, 0.3710939586162567, -0.130178302526474, 0.18833474814891815, 0.41025784611701965, -0.23417207598686218, 0.07265667617321014, -0.12496387958526611, -0.14043617248535156, -0.23825041949748993, -0.0003291293978691101, 0.04064611345529556, 0.43762195110321045, -0.26319119334220886, 0.0819564089179039, -0.069692462682724, -0.024007227271795273, 0.17387670278549194, 0.3060125708580017, 0.2954729199409485, -0.5074764490127563, -0.11139264702796936, 0.08774226158857346, 0.1138962060213089, -0.035312023013830185, -0.04550408571958542, -0.16328634321689606, 0.1214597076177597, 0.1581130176782608, -0.5868532657623291, 0.06045115739107132, -0.04788753017783165, 0.2059134691953659, -0.024496305733919144, 0.19070713222026825, 0.24275639653205872, 0.02269473485648632, 0.21787407994270325, -0.249498650431633, -0.04961618781089783, 0.08135232329368591, 0.27452370524406433, 0.17951348423957825, -0.12326548248529434, -0.43970954418182373, 0.8340519070625305, -0.14378684759140015, -0.16759845614433289, 0.31478118896484375, 0.03180970251560211, -0.023397671058773994, -0.16859868168830872, -0.10074482858181, 0.40789365768432617, -0.24879790842533112, -0.29318931698799133, -0.12375390529632568, -0.05298423022031784, -0.01780572347342968, 0.01969573274254799, 0.3990445137023926, -0.187278151512146, 0.1683245301246643, 0.10415856540203094, 0.3052874207496643, -0.09212656319141388, 0.1366109848022461, 0.5520647168159485, -0.22731351852416992, 0.1963973343372345, 0.31296682357788086, 0.15528550744056702, -0.23595091700553894, 0.44979149103164673, 0.255511075258255, -0.5546246767044067, 0.08946090191602707, 0.21775156259536743, -0.3588268756866455, 0.43903425335884094, 0.1966569572687149, 0.19412587583065033, 0.16483557224273682, -0.06126854196190834, -0.2273268699645996, -0.2851256728172302, 0.05102144181728363, -0.3513394892215729, 0.03874174505472183, -0.11409348249435425, 0.4093117117881775, 0.2877163887023926, 0.08425264060497284, -0.23347873985767365, -0.0762152373790741, 0.14707322418689728, 0.11916909366846085, 0.08388727903366089, -0.07297459989786148, -0.05912623926997185, 0.473336786031723, 0.10099460929632187, -0.17028717696666718, -0.09714674949645996, -0.025920812040567398, -0.15479975938796997, 0.21428601443767548, 0.014088214375078678, 0.02143676020205021, -0.11695799976587296, -0.04302611202001572, -0.32721003890037537, 0.18332307040691376, -0.055088333785533905, 0.008752536028623581, 0.05424736440181732, 0.3128068447113037, -0.24418585002422333, -0.2147553265094757, -0.08541712909936905, 0.05260368436574936, -0.12392933666706085, -0.045888155698776245, 0.26380228996276855, 0.17819154262542725, 0.06120067834854126, -0.22916744649410248, -0.6144227981567383, 0.1368475705385208, 0.041339922696352005, 0.3382974863052368, 0.2456395924091339, 0.16630154848098755, 0.12426823377609253, 0.15794572234153748, -0.009660482406616211, -0.18834596872329712, 0.06107738986611366, 0.0030139628797769547, 0.18306535482406616, 0.15111994743347168, -0.20281782746315002, -0.1593111753463745, -0.023034323006868362, -0.32525792717933655, 0.085306316614151, 0.36172932386398315, 0.21422410011291504, 0.2920594811439514, 0.21374303102493286, -0.10433530807495117, -0.09121906012296677, -0.18876269459724426, 0.41393402218818665, 0.22254304587841034, 0.19563890993595123, 0.059917934238910675, 0.1627824455499649, 0.16190320253372192, 0.1792767345905304, 0.2060791403055191, -0.3195435702800751, 0.2228277325630188, 0.09148067981004715, -0.1179327666759491, 0.5171372294425964, -0.2793416678905487, -0.06252092123031616, 0.48634499311447144, -0.03655233979225159, 0.3912457227706909, -0.23228362202644348, 0.20171919465065002, -0.46285057067871094, -0.2619019150733948, -0.1918977051973343, 0.3628992736339569, 0.07489478588104248, -0.067713662981987, -0.12102082371711731, -0.10424089431762695, -0.31919974088668823, -0.17044121026992798, -0.23031747341156006, 0.26581400632858276, 0.17304110527038574, 0.16148704290390015, 0.365630567073822, 0.09900041669607162, -0.15130949020385742, 0.1816500425338745, 0.47264403104782104, -0.05575701594352722, 0.1143733486533165, 0.08683659136295319, -0.08266468346118927, 0.29819104075431824, 0.2193000167608261, 0.16313089430332184, 0.38115188479423523, -0.20807062089443207, 0.06294602900743484, -0.1593058556318283, -0.07364881783723831, 0.37020954489707947, 0.024818936362862587, 0.2381226271390915, 0.21958492696285248, 0.21035216748714447, 0.08827906101942062, -0.061491936445236206, 0.15929251909255981, 0.21046778559684753, -0.13466955721378326, -0.3983662724494934, -0.08836173266172409, 0.13997189700603485, -0.02285199612379074, -0.24274903535842896, 0.15514205396175385, -0.39606088399887085, -0.5562837719917297, 0.432795912027359, -0.38770055770874023, -0.007546856068074703, 0.02704019472002983, 0.05328109860420227, -0.20115359127521515, 0.1651654988527298, 0.22236287593841553, -0.21229347586631775, -0.06412241607904434, 0.14280568063259125, -0.26855629682540894, -0.145530104637146, 0.2956157624721527, -0.5302584171295166, -0.15301688015460968, 0.08246102929115295, -0.021203823387622833, 0.10398944467306137, -0.04268757998943329, -0.2415686547756195, 0.08992045372724533, 0.3107849955558777, -0.511039137840271, 0.20547990500926971, 0.17243480682373047, 0.6061858534812927, -0.06877611577510834, -0.2605065107345581, -0.07374672591686249, 0.15208552777767181, -0.06148970499634743, -0.010359864681959152, -0.5607490539550781, 0.3088754415512085, 0.1712506264448166, 0.23784932494163513, 0.002018280327320099, 0.4668065309524536, -0.08170894533395767, -0.264617919921875, -0.10424160957336426, 0.033678166568279266, 0.07054898887872696, -0.1508132517337799, 0.24696296453475952, 0.9247415065765381, -0.3071426451206207, 0.6449898481369019, -0.010100027546286583, 0.37314778566360474, -0.07595448195934296, -0.21673516929149628, -0.3916529417037964, 0.2683015465736389, -0.2554638981819153, -0.2638019323348999, 0.4872063100337982, 0.29033154249191284, -0.16567309200763702, 0.17305250465869904, -0.19182467460632324, -0.17558066546916962, 0.3200365900993347, -0.35772505402565, -0.27381187677383423, -0.08114151656627655, 0.3197333812713623, -0.0312226340174675, 0.37045517563819885, -0.22019532322883606, -0.13585279881954193, 0.23157821595668793, 0.09340421855449677, 0.010659079998731613, -0.059399235993623734, -0.018959874287247658, -0.352854460477829, -0.2894415855407715, -0.4240546226501465, -0.10602561384439468, -0.16298174858093262, -0.038265302777290344, -0.20880717039108276 ]
https://github.com/huggingface/datasets/issues/5032
new dataset type: single-label and multi-label video classification
Hi ! I think we just missing which lib we're going to use to decode the videos + which parameters must go in the `Video` type
**Is your feature request related to a problem? Please describe.** In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset. **Describe the solution you'd like** Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model. **Describe alternatives you've considered** Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative. **Additional context** I am wiling to open a PR but don't know where to start.
26
new dataset type: single-label and multi-label video classification **Is your feature request related to a problem? Please describe.** In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset. **Describe the solution you'd like** Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model. **Describe alternatives you've considered** Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative. **Additional context** I am wiling to open a PR but don't know where to start. Hi ! I think we just missing which lib we're going to use to decode the videos + which parameters must go in the `Video` type
[ -0.241469606757164, -0.13443975150585175, 0.002186466008424759, -0.002054169774055481, 0.04629543423652649, -0.21092137694358826, 0.6544625163078308, 0.040859200060367584, -0.5185300707817078, -0.10220308601856232, -0.1690843254327774, 0.07043944299221039, -0.6277961730957031, 0.4078499376773834, 0.09373436123132706, -0.5924074649810791, 0.06936664879322052, 0.037426114082336426, 0.297441303730011, -0.1680242270231247, -0.13652488589286804, -0.24222500622272491, -0.25259894132614136, -0.04801061749458313, -0.6737860441207886, -0.07736514508724213, -0.14903870224952698, -0.28048673272132874, -0.08445820957422256, -0.5339059829711914, 0.048545703291893005, 0.0072821639478206635, 0.47287315130233765, 0.5943052172660828, -0.00011822849046438932, -0.29774463176727295, 0.04602522403001785, -0.16662099957466125, 0.004002083092927933, 0.03787459433078766, -0.31966912746429443, -0.2586873173713684, 0.21788440644741058, -0.1430007368326187, 0.006803344935178757, -0.37130364775657654, 0.020407825708389282, -0.31578120589256287, 0.2296755164861679, 0.09979709982872009, 0.11472028493881226, -0.12623342871665955, -0.21727354824543, -0.04000021517276764, 0.3769044578075409, 0.4225306510925293, -0.18917052447795868, -0.0576246939599514, 0.8412096500396729, 0.025981446728110313, -0.2828374207019806, 0.3567245304584503, -0.10465005040168762, -0.2501857876777649, 0.12268725782632828, 0.03794952109456062, -0.053603462874889374, -0.5713589191436768, -0.23837235569953918, 0.29019367694854736, 0.7248234748840332, -0.214900940656662, -0.5585654377937317, -0.1356133371591568, 0.19742411375045776, -0.023091506212949753, -0.25866255164146423, 0.42298123240470886, -0.35921555757522583, -0.0647934228181839, 0.05533529818058014, -0.10793674737215042, -0.35925325751304626, 0.0676070973277092, 0.3431538939476013, -0.06048598885536194, 0.14666669070720673, 0.013846438378095627, 0.1658152937889099, -0.11866685748100281, 0.2831476032733917, -0.18462464213371277, 0.41089296340942383, 0.38557741045951843, -0.11336645483970642, -0.19119621813297272, -0.40720751881599426, -0.13269317150115967, 0.03177770972251892, -0.0434589758515358, -0.12289083003997803, 0.040979061275720596, -0.5025078654289246, 0.1667778491973877, 0.12599527835845947, -0.08236116170883179, 0.09098803251981735, 0.15619312226772308, 0.18521322309970856, 0.037287306040525436, -0.19290275871753693, 0.0473683625459671, -0.29530325531959534, 0.0190637968480587, 0.2360904961824417, 0.5436859726905823, -0.039922166615724564, -0.11425253748893738, -0.0343768373131752, -0.23470854759216309, -0.1912950873374939, -0.15690039098262787, 0.19877593219280243, -0.05241542309522629, 0.056520987302064896, 0.46132856607437134, -0.16496963798999786, 0.3040544390678406, -0.10225321352481842, -0.44022485613822937, 0.11808712035417557, 0.30254682898521423, -0.3355250358581543, 0.07484183460474014, 0.4727366268634796, 0.017979295924305916, -0.27478447556495667, 0.16281850636005402, -0.012242637574672699, 0.0195603147149086, 0.10426410287618637, -0.09238633513450623, 0.04950622469186783, -0.09263329207897186, -0.07242389023303986, 0.10910027474164963, -0.026006821542978287, 0.39443516731262207, -0.10015086084604263, 0.015474308282136917, -0.14339026808738708, -0.16609437763690948, -0.16938257217407227, 0.056317754089832306, 0.31921446323394775, 0.08158456534147263, -0.021709002554416656, 0.4520665407180786, 0.01602606475353241, -0.19978609681129456, -0.07250339537858963, -0.03972025215625763, 0.18743035197257996, -0.24562135338783264, -0.2082839459180832, 0.36473792791366577, -0.6209385395050049, -0.18382984399795532, -0.06457023322582245, -0.1367885321378708, 0.1985001564025879, 0.3309146761894226, -0.24711789190769196, -0.11097704619169235, 0.0500498041510582, -0.2608967423439026, 0.24467450380325317, -0.7313750386238098, 0.2611149549484253, 0.271072655916214, -0.06495214253664017, 0.05362287908792496, 0.4529840052127838, 0.4443054795265198, 0.18079343438148499, -0.304113507270813, 0.08076304942369461, 0.264245867729187, -0.2790791094303131, -0.15479591488838196, -0.007980924099683762, -0.3271358013153076, -0.051784396171569824, 0.24605078995227814, 0.3852500319480896, 0.07251440733671188, -0.06840699166059494, 0.13583427667617798, 0.12937793135643005, -0.054779548197984695, 0.481549471616745, -0.14224101603031158, 0.44081974029541016, -0.19506557285785675, -0.081075020134449, -0.4962279498577118, -0.4733309745788574, 0.06773011386394501, -0.3490428626537323, 0.23041769862174988, 0.25426748394966125, -0.32919490337371826, 0.3166917860507965, -0.22058352828025818, 0.0014141164720058441, -0.029709625989198685, 0.001513894647359848, 0.29030823707580566, -0.26585152745246887, -0.14955852925777435, -0.4650499224662781, 0.014479715377092361, 0.38153696060180664, 0.0435016006231308, 0.1340409517288208, 0.23300398886203766, 0.17538262903690338, 0.048676323145627975, -0.08304677158594131, 0.355366587638855, 0.1774578094482422, -0.008647983893752098, 0.24176126718521118, 0.06928317248821259, 0.12744146585464478, 0.06917435675859451, 0.026469385251402855, 0.12378691136837006, 0.3827228546142578, -0.4915076792240143, 0.19605691730976105, -0.2095920592546463, 0.16512179374694824, -0.24279558658599854, -0.06370799243450165, 0.36087357997894287, -0.024866726249456406, 0.09495501965284348, -0.01345621794462204, 0.21156132221221924, 0.17449556291103363, -0.03494924306869507, 0.009564504027366638, -0.24716101586818695, -0.04418186470866203, 0.03402944654226303, 0.011523857712745667, -0.008476315066218376, -0.37038734555244446, -0.11038447171449661, 0.3838530480861664, -0.20355720818042755, 0.08136023581027985, 0.14487698674201965, -0.13200059533119202, 0.06309420615434647, -0.0545409694314003, 0.14607550203800201, 0.19092202186584473, 0.09480667114257812, -0.12140077352523804, -0.22123722732067108, -0.027702949941158295, -0.08035850524902344, 0.07713578641414642, 0.07435016334056854, -0.0024073973763734102, 0.056630611419677734, -0.042951926589012146, 0.10690037906169891, 0.2096351683139801, -0.45224717259407043, 0.16320104897022247, -0.20208589732646942, -0.002998068928718567, -0.11520945280790329, -0.12427965551614761, -0.10630906373262405, -0.28038400411605835, -0.33085864782333374, 0.044076189398765564, 0.1320381760597229, 0.1876903921365738, 0.020964430645108223, 0.2326328456401825, 0.2718975245952606, 0.03125740960240364, 0.5697027444839478, -0.06972452998161316, -0.019944990053772926, 0.14533990621566772, -0.094659723341465, -0.23776841163635254, 0.11164306104183197, 0.2783847451210022, -0.18140287697315216, 0.12775106728076935, 0.1975209265947342, 0.09354718029499054, -0.38115403056144714, -0.017910942435264587, 0.12872430682182312, 0.13390180468559265, 0.1541188359260559, 0.10357533395290375, -0.2193029671907425, 0.0027796998620033264, -0.22288672626018524, -0.01663065142929554, -0.05928301811218262, 0.1423269361257553, -0.18926730751991272, -0.19333113729953766, 0.14629009366035461, -0.06706695258617401, -0.08225629478693008, -0.5271577835083008, -0.16998298466205597, 0.175717294216156, 0.16692937910556793, 0.10607638955116272, 0.04247012361884117, -0.03143986687064171, 0.02082202211022377, 0.11029395461082458, 0.0949961319565773, 0.13304810225963593, -0.006839938461780548, 0.10619822889566422, -0.12812411785125732, -0.35055339336395264, -0.2079194188117981, -0.18418125808238983, -0.08021119236946106, 0.23737159371376038, 0.03906184434890747, 0.01603960245847702, 0.08450040221214294, 0.009698137640953064, 0.017526203766465187, -0.00412391684949398, 0.21366937458515167, 0.1465633362531662, 0.012612251564860344, -0.07027694582939148, 0.11032652854919434, 0.13753870129585266, -0.048576101660728455, 0.12732161581516266, 0.09860232472419739, 0.18398112058639526, -0.03979480266571045, 0.8502922058105469, 0.012339826673269272, -0.3088532090187073, 0.14193296432495117, 0.14373387396335602, -0.21222363412380219, 0.029397375881671906, -0.3765456974506378, 0.004093002527952194, -0.4017198979854584, 0.16085843741893768, 0.17122307419776917, -0.013896342366933823, -0.26122936606407166, -0.37368151545524597, 0.31972450017929077, -0.16418898105621338, -0.02831936441361904, 0.2993031442165375, -0.28285568952560425, 0.23812925815582275, -0.12973374128341675, -0.25079554319381714, -0.3411084711551666, -0.02037423849105835, -0.1591634452342987, 0.24515803158283234, 0.13094541430473328, -0.19527962803840637, -0.320939302444458, 0.06973158568143845, 0.04222456365823746, 0.24354448914527893, 0.48862892389297485, 0.1588192731142044, -0.1148788183927536, 0.22622522711753845, 0.07776396721601486, 0.23466114699840546, 0.3497841954231262, -0.17954380810260773, 0.06526143848896027, 0.06968767940998077, 0.08676326274871826, 0.0637921467423439, -0.05919208750128746, -0.5320417881011963, 0.09457492083311081, 0.010316085070371628, 0.18091216683387756, 0.060365013778209686, -0.3859955966472626, 0.07393892109394073, 0.058802273124456406, 0.1335669755935669, -0.043191250413656235, 0.19674699008464813, 0.38241058588027954, -0.1665741205215454, -0.08599700778722763, 0.44321465492248535, 0.010054921731352806, -0.2093891203403473, -0.22941432893276215, 0.09721718728542328, 0.15743142366409302, 0.5533615350723267, -0.26667076349258423, -0.10267511010169983, 0.12026377022266388, 0.1257050484418869, -0.2954128086566925, -0.06615433841943741, 0.3213861882686615, 0.12299901247024536, -0.24415883421897888, -0.22144600749015808, 0.39715975522994995, -0.06003332883119583, 0.44214436411857605, 0.35966944694519043, 0.11646313220262527, 0.2826991677284241, 0.010553160682320595, -0.015085436403751373, -0.20391681790351868, -0.0007561654783785343, 0.4215673506259918, -0.26172417402267456, -0.7574295997619629, -0.4863492250442505, 0.5321533679962158, 0.013134855777025223, -0.22672154009342194, 0.10255108773708344, -0.05180478096008301, -0.2845933139324188, 0.29616403579711914, 0.3167603611946106, 0.8427040576934814, -0.10058657824993134, 0.3758104741573334, -0.1655365228652954, 0.13515223562717438, 0.4357341527938843, -0.18674255907535553, 0.08784565329551697, -0.17965763807296753, -0.07002351433038712, -0.23971787095069885, 0.005639512091875076, 0.04237285256385803, 0.46210891008377075, -0.2528795897960663, 0.07615739852190018, -0.0394233763217926, -0.0014393255114555359, 0.22992399334907532, 0.32907482981681824, 0.322204053401947, -0.5046995282173157, -0.06929754465818405, 0.09084940701723099, 0.09277229756116867, -0.034921545535326004, -0.05675728619098663, -0.21511591970920563, 0.11737482249736786, 0.14037524163722992, -0.613957405090332, 0.10657928138971329, -0.014455679804086685, 0.24516378343105316, 0.005361244082450867, 0.14528898894786835, 0.27575504779815674, 0.019251730293035507, 0.23805095255374908, -0.21586661040782928, -0.054669089615345, 0.08702553808689117, 0.2449760138988495, 0.17995962500572205, -0.10857993364334106, -0.4228864312171936, 0.8250088691711426, -0.17170459032058716, -0.20327864587306976, 0.28938785195350647, 0.03685949370265007, -0.10375098884105682, -0.0858849510550499, -0.06188693642616272, 0.39332789182662964, -0.1808679699897766, -0.23103652894496918, -0.12370344996452332, -0.07205808162689209, -0.03562194108963013, 0.0235725250095129, 0.38681232929229736, -0.24097687005996704, 0.18652001023292542, 0.07245872914791107, 0.28760501742362976, -0.10422182083129883, 0.19078734517097473, 0.5612504482269287, -0.2608290910720825, 0.21977227926254272, 0.32695019245147705, 0.10979820787906647, -0.23068463802337646, 0.44988566637039185, 0.2355458289384842, -0.55507493019104, 0.08271065354347229, 0.20983931422233582, -0.34369009733200073, 0.4698708951473236, 0.13468262553215027, 0.17588567733764648, 0.17935854196548462, -0.09065625071525574, -0.2506253719329834, -0.3157743215560913, 0.00197649747133255, -0.3568536639213562, 0.04820237308740616, -0.0876636654138565, 0.394795686006546, 0.2748098075389862, 0.10597667843103409, -0.22982029616832733, -0.053919851779937744, 0.17307494580745697, 0.1146681159734726, 0.03930118680000305, -0.0874360129237175, -0.06739415228366852, 0.494526207447052, 0.08161121606826782, -0.11895662546157837, -0.05336035043001175, -0.02545369789004326, -0.1885305643081665, 0.21576839685440063, 0.029057959094643593, 0.0184631384909153, -0.13879108428955078, -0.052568987011909485, -0.3608646094799042, 0.18342486023902893, -0.024171866476535797, 0.055843204259872437, 0.0874348133802414, 0.34719282388687134, -0.17336739599704742, -0.1942203938961029, -0.11606266349554062, 0.05604087561368942, -0.12026235461235046, 0.0038355812430381775, 0.25873294472694397, 0.2013944834470749, 0.08136897534132004, -0.21090324223041534, -0.559190034866333, 0.12161815911531448, 0.0754537284374237, 0.31783679127693176, 0.2302197515964508, 0.10082533955574036, 0.15529493987560272, 0.18787993490695953, 0.019335493445396423, -0.17023327946662903, 0.010590258985757828, -0.01593288965523243, 0.2321975827217102, 0.1359039545059204, -0.2021075040102005, -0.1575791984796524, -0.03435997664928436, -0.34284546971321106, 0.08369134366512299, 0.33335235714912415, 0.1867121011018753, 0.26748427748680115, 0.20464254915714264, -0.10359148681163788, -0.042602285742759705, -0.1451505422592163, 0.4175474941730499, 0.23965789377689362, 0.14853276312351227, 0.06464505940675735, 0.14279505610466003, 0.13967154920101166, 0.1720600724220276, 0.2235262393951416, -0.38998401165008545, 0.2317366600036621, 0.07260003685951233, -0.14447470009326935, 0.5224692225456238, -0.2794448137283325, -0.029815200716257095, 0.5275646448135376, -0.038532838225364685, 0.3448057472705841, -0.22250398993492126, 0.2331792414188385, -0.4751492142677307, -0.21809539198875427, -0.2137698084115982, 0.39662840962409973, 0.05465813726186752, -0.07666769623756409, -0.10530886054039001, -0.0634663850069046, -0.28800925612449646, -0.1835443377494812, -0.19568392634391785, 0.2524200677871704, 0.09875179827213287, 0.23015201091766357, 0.38562244176864624, 0.13483133912086487, -0.21989920735359192, 0.17838725447654724, 0.4431508481502533, -0.05927694961428642, 0.16094215214252472, 0.139515221118927, -0.0593252032995224, 0.2946609854698181, 0.169255793094635, 0.1640741378068924, 0.3875610828399658, -0.230752095580101, 0.03830084577202797, -0.182012677192688, -0.06483866274356842, 0.3639177083969116, 0.07098190486431122, 0.2312590628862381, 0.24355898797512054, 0.2535248398780823, 0.07687199115753174, -0.073750339448452, 0.14562053978443146, 0.2711910903453827, -0.07398271560668945, -0.3494514524936676, -0.023397378623485565, 0.1323481798171997, -0.007660131901502609, -0.23528563976287842, 0.12070993334054947, -0.4141426682472229, -0.5331445336341858, 0.41677841544151306, -0.45652222633361816, -0.012923922389745712, 0.027474071830511093, 0.047965362668037415, -0.16534365713596344, 0.2264811247587204, 0.19077135622501373, -0.21231931447982788, -0.0599667951464653, 0.13316710293293, -0.2907823920249939, -0.1262383759021759, 0.2754337191581726, -0.5107108354568481, -0.24560055136680603, 0.0870363786816597, 0.009887993335723877, 0.08552397787570953, 0.00779174268245697, -0.19460001587867737, 0.1058199554681778, 0.25479286909103394, -0.49969998002052307, 0.20171990990638733, 0.15805494785308838, 0.5365853905677795, -0.05298980697989464, -0.28957778215408325, -0.029074039310216904, 0.18405598402023315, -0.06644807010889053, -0.03758135065436363, -0.5460610389709473, 0.35952988266944885, 0.1590636670589447, 0.18794429302215576, -0.019469475373625755, 0.5089161396026611, -0.10738054662942886, -0.24547253549098969, -0.07824105024337769, 0.05780986696481705, 0.062422145158052444, -0.14239978790283203, 0.2799244523048401, 0.8843214511871338, -0.3232159912586212, 0.5655852556228638, -0.012762408703565598, 0.3324965238571167, -0.10891252756118774, -0.17683148384094238, -0.4512377977371216, 0.2735316753387451, -0.27230191230773926, -0.22326955199241638, 0.469568133354187, 0.2620948851108551, -0.17667841911315918, 0.21290315687656403, -0.24949109554290771, -0.22190196812152863, 0.3628801107406616, -0.4375811517238617, -0.26829537749290466, -0.09222979843616486, 0.33627668023109436, -0.0676630511879921, 0.35574641823768616, -0.21337834000587463, -0.07240423560142517, 0.22436849772930145, 0.09824434667825699, -0.024351786822080612, -0.0608532540500164, -0.04094121605157852, -0.30044326186180115, -0.2871220111846924, -0.4122908413410187, -0.0468129888176918, -0.21768344938755035, -0.02363339252769947, -0.21200965344905853 ]
https://github.com/huggingface/datasets/issues/5032
new dataset type: single-label and multi-label video classification
pytorchvideo uses [pyav](https://github.com/PyAV-Org/PyAV) as the default decoder: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/labeled_video_dataset.py#L37 Also it would be great if `optionally` audio can also be decoded from the video as in pytorchvideo: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/labeled_video_dataset.py#L35 Here are the other decoders supported in pytorchvideo: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/encoded_video.py#L17
**Is your feature request related to a problem? Please describe.** In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset. **Describe the solution you'd like** Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model. **Describe alternatives you've considered** Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative. **Additional context** I am wiling to open a PR but don't know where to start.
36
new dataset type: single-label and multi-label video classification **Is your feature request related to a problem? Please describe.** In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset. **Describe the solution you'd like** Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model. **Describe alternatives you've considered** Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative. **Additional context** I am wiling to open a PR but don't know where to start. pytorchvideo uses [pyav](https://github.com/PyAV-Org/PyAV) as the default decoder: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/labeled_video_dataset.py#L37 Also it would be great if `optionally` audio can also be decoded from the video as in pytorchvideo: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/labeled_video_dataset.py#L35 Here are the other decoders supported in pytorchvideo: https://github.com/facebookresearch/pytorchvideo/blob/c8d23d8b7e597586a9e2d18f6ed31ad8aa379a7a/pytorchvideo/data/encoded_video.py#L17
[ -0.24553118646144867, -0.1273702085018158, 0.0012589897960424423, -0.029612600803375244, 0.10663260519504547, -0.21920770406723022, 0.6609010696411133, 0.02041279524564743, -0.5795267224311829, -0.08067630231380463, -0.18881264328956604, 0.14815093576908112, -0.5741210579872131, 0.2800966203212738, 0.03189188241958618, -0.5908774137496948, 0.0029495134949684143, 0.058780305087566376, 0.3232532739639282, -0.20286156237125397, -0.10898473113775253, -0.25966113805770874, -0.20387901365756989, -0.022319167852401733, -0.6468807458877563, -0.04663199186325073, -0.13420063257217407, -0.29452306032180786, 0.025476107373833656, -0.5507187247276306, 0.037028223276138306, 0.03189609572291374, 0.3590209484100342, 0.5451710820198059, -0.00011995461682090536, -0.25342875719070435, 0.038885895162820816, -0.10164852440357208, -0.008911424316465855, 0.01926104724407196, -0.29620161652565, -0.2646119296550751, 0.20187722146511078, -0.09807591140270233, 0.043081142008304596, -0.4177281856536865, 0.04113268852233887, -0.3304580748081207, 0.3021298050880432, 0.08986932039260864, 0.08813458681106567, -0.11593657732009888, -0.22734269499778748, 0.03501134738326073, 0.3404509127140045, 0.45500731468200684, -0.16134950518608093, -0.020601756870746613, 0.8112809658050537, -0.06879124790430069, -0.31887802481651306, 0.3554843068122864, -0.12969914078712463, -0.18556205928325653, 0.12056226283311844, 0.04976757988333702, -0.008374050259590149, -0.5754374265670776, -0.25221189856529236, 0.3324298560619354, 0.6875989437103271, -0.22118234634399414, -0.6603711247444153, -0.22713017463684082, 0.16877226531505585, -0.03533310070633888, -0.2484523057937622, 0.45700153708457947, -0.32442912459373474, -0.03152688220143318, -0.01287391409277916, -0.09268227964639664, -0.37266701459884644, 0.05941912904381752, 0.26081353425979614, -0.00792577862739563, 0.2080823928117752, 0.011725325137376785, 0.19626015424728394, -0.09487012028694153, 0.2886550724506378, -0.1996934860944748, 0.41171595454216003, 0.4032464325428009, -0.16412410140037537, -0.16838300228118896, -0.4283205270767212, -0.2552124559879303, 0.007993869483470917, -0.046709440648555756, -0.11655363440513611, 0.07715311646461487, -0.46562066674232483, 0.1675892025232315, 0.1417703479528427, -0.06592520326375961, 0.0044502392411231995, 0.23162758350372314, 0.23061400651931763, 0.04582681134343147, -0.18729282915592194, 0.08889129012823105, -0.27708736062049866, 0.03727742284536362, 0.24172647297382355, 0.5357329845428467, -0.04916597157716751, -0.09560658037662506, -0.11271251738071442, -0.24640995264053345, -0.25369730591773987, -0.1759345978498459, 0.21017931401729584, -0.01708577573299408, 0.06835796684026718, 0.4880284368991852, -0.20033486187458038, 0.356639564037323, -0.0782841295003891, -0.4068984389305115, 0.11840314418077469, 0.2806951105594635, -0.2894401252269745, 0.06648373603820801, 0.44878846406936646, -0.00569513812661171, -0.25465133786201477, 0.16724318265914917, 0.08299543708562851, -0.04891858249902725, 0.1325731873512268, -0.12929698824882507, 0.05140513554215431, -0.06002172455191612, -0.06184746325016022, 0.1277085393667221, 0.01686227321624756, 0.45163530111312866, -0.054929472506046295, 0.003051362931728363, -0.0936293825507164, -0.1568479686975479, -0.08632982522249222, 0.045206304639577866, 0.3079022765159607, 0.06023887172341347, 0.05538932606577873, 0.44480639696121216, 0.05891113355755806, -0.20291948318481445, -0.06582612544298172, -0.10024020075798035, 0.05386902764439583, -0.22225040197372437, -0.13031895458698273, 0.3487478494644165, -0.5952229499816895, -0.21647068858146667, -0.025834960862994194, -0.12269812822341919, 0.12760217487812042, 0.3512730300426483, -0.2731163799762726, -0.08327468484640121, 0.06153103709220886, -0.2935131788253784, 0.18057578802108765, -0.8635855317115784, 0.18001703917980194, 0.24755942821502686, -0.0584087148308754, 0.13906647264957428, 0.4496874511241913, 0.41339853405952454, 0.18856193125247955, -0.32586321234703064, 0.12895400822162628, 0.2661297917366028, -0.26634302735328674, -0.15534788370132446, 0.006448868662118912, -0.3336828052997589, -0.06717059016227722, 0.33456555008888245, 0.3746708929538727, 0.05285312980413437, -0.13439854979515076, 0.0966213122010231, 0.1484079658985138, -0.10655374825000763, 0.4662492573261261, -0.09948660433292389, 0.44012776017189026, -0.20387102663516998, -0.058056555688381195, -0.4580976665019989, -0.3532926142215729, 0.11178193241357803, -0.38067159056663513, 0.18219205737113953, 0.21911582350730896, -0.32576560974121094, 0.38178902864456177, -0.1715961992740631, -0.06299625337123871, -0.016813114285469055, -0.009689927101135254, 0.32142704725265503, -0.22231724858283997, -0.158891499042511, -0.42742595076560974, 0.05663502216339111, 0.3748539388179779, 0.07849051058292389, 0.2043852061033249, 0.258398175239563, 0.23245052993297577, 0.09159182012081146, -0.07859178632497787, 0.4369558095932007, 0.1524314284324646, 0.009243084117770195, 0.2714037299156189, 0.07841484248638153, 0.19836819171905518, 0.1465725600719452, -0.09157990664243698, 0.10681881755590439, 0.43644508719444275, -0.5524701476097107, 0.2384078949689865, -0.17122326791286469, 0.1022670567035675, -0.26120930910110474, -0.04629744589328766, 0.3733225464820862, 0.05276922881603241, 0.15704436600208282, 0.021198153495788574, 0.2059345543384552, 0.22262388467788696, -0.010011572390794754, -0.0530460923910141, -0.23077599704265594, -0.05083351209759712, -0.024075206369161606, 0.09573714435100555, -0.08842350542545319, -0.371357798576355, -0.15060684084892273, 0.3281501829624176, -0.18427935242652893, 0.0574645921587944, 0.10477818548679352, -0.1833493411540985, 0.06826359778642654, -0.039685167372226715, 0.12114636600017548, 0.17556127905845642, 0.06645652651786804, -0.12054967880249023, -0.19052071869373322, -0.10569214075803757, -0.035452086478471756, 0.08991730958223343, 0.16944855451583862, 0.033323660492897034, 0.09392108023166656, 0.03968100622296333, 0.1454876959323883, 0.19863027334213257, -0.46363723278045654, 0.14910276234149933, -0.25290611386299133, 0.0076966844499111176, -0.07379859685897827, -0.10447593033313751, -0.141994446516037, -0.24926689267158508, -0.36446741223335266, 0.05151571333408356, 0.10512172430753708, 0.1712629199028015, 0.036700859665870667, 0.19192077219486237, 0.3264704942703247, 0.03719380870461464, 0.48423147201538086, -0.13200663030147552, -0.03472860902547836, 0.14116531610488892, -0.11161867529153824, -0.154965341091156, 0.08207942545413971, 0.2460419088602066, -0.20390723645687103, 0.10620339959859848, 0.26491570472717285, 0.0029312539845705032, -0.3385472297668457, 0.010236680507659912, 0.16393831372261047, 0.15668877959251404, 0.11330195516347885, 0.026166923344135284, -0.27990907430648804, 0.030775927007198334, -0.26574239134788513, 0.03384840115904808, -0.03764575347304344, 0.13101887702941895, -0.21161089837551117, -0.12452257424592972, 0.15464770793914795, -0.040452782064676285, 0.03206906095147133, -0.5804650187492371, -0.19413265585899353, 0.12342895567417145, 0.14798109233379364, 0.06251931190490723, 0.0993613451719284, -0.07068023830652237, -0.019548626616597176, 0.0612790547311306, 0.09079685062170029, 0.15302719175815582, 0.11230117082595825, 0.10003621131181717, -0.10775577276945114, -0.3523288667201996, -0.2091606855392456, -0.22256337106227875, -0.03753528371453285, 0.32192349433898926, 0.021479912102222443, 0.008287106640636921, 0.08168016374111176, -0.06357384473085403, -0.043727852404117584, -0.07511890679597855, 0.16568207740783691, 0.18442220985889435, 0.04524514824151993, -0.0437791645526886, 0.09805557131767273, 0.16500476002693176, 0.01981871761381626, 0.07615858316421509, 0.01620751991868019, 0.20053347945213318, -0.026685746386647224, 0.9248886704444885, 0.054225679486989975, -0.2419671267271042, 0.058550070971250534, 0.0965675637125969, -0.22006921470165253, 0.07272069156169891, -0.3323322534561157, -0.028700023889541626, -0.40220388770103455, 0.1537158340215683, 0.20263215899467468, -0.02697981894016266, -0.28771114349365234, -0.38389134407043457, 0.3112223446369171, -0.15571561455726624, -0.0876537561416626, 0.23852594196796417, -0.32631784677505493, 0.2967880666255951, -0.10824821889400482, -0.17865483462810516, -0.2871909737586975, 0.0018821116536855698, -0.19094423949718475, 0.18850405514240265, 0.1756739616394043, -0.20452408492565155, -0.3510701656341553, 0.018793124705553055, 0.04628162086009979, 0.1907569169998169, 0.5104040503501892, 0.22818957269191742, -0.10924992710351944, 0.21648815274238586, 0.09113369882106781, 0.1683368682861328, 0.3317319452762604, -0.11168768256902695, 0.1180182471871376, 0.05733587220311165, 0.02756562829017639, 0.08089897036552429, -0.08832899481058121, -0.5321048498153687, 0.06166557967662811, -0.019207622855901718, 0.18483291566371918, 0.06561649590730667, -0.3583117127418518, 0.06604168564081192, 0.12927569448947906, 0.1292823851108551, 0.03402974084019661, 0.17071126401424408, 0.38941308856010437, -0.18328140676021576, -0.07915689796209335, 0.4151335656642914, 0.032605625689029694, -0.19642113149166107, -0.19927652180194855, 0.12982502579689026, 0.08508896082639694, 0.518669068813324, -0.24201659858226776, -0.09115215390920639, -0.00787627324461937, 0.2124675065279007, -0.19060878455638885, -0.06568380445241928, 0.37672990560531616, 0.1374863088130951, -0.22431528568267822, -0.34051936864852905, 0.3218754529953003, -0.010084864683449268, 0.48164793848991394, 0.35219430923461914, 0.1514071822166443, 0.26642683148384094, 0.0218333899974823, -0.027099303901195526, -0.24137231707572937, -0.040191374719142914, 0.41879189014434814, -0.24328216910362244, -0.7544866800308228, -0.4644514322280884, 0.5025438666343689, -0.03901411592960358, -0.2619292736053467, 0.12043371051549911, -0.06142356991767883, -0.31535279750823975, 0.24424247443675995, 0.30737364292144775, 0.8326232433319092, -0.07288192212581635, 0.3848341405391693, -0.12960398197174072, 0.10963359475135803, 0.3944278061389923, -0.1521773338317871, 0.18121472001075745, -0.21478302776813507, -0.08549507707357407, -0.2240397185087204, -0.022841807454824448, -0.0013013631105422974, 0.489551842212677, -0.22295129299163818, 0.08909416943788528, -0.01229637861251831, 0.06072288751602173, 0.2594098746776581, 0.33938631415367126, 0.3104674816131592, -0.49110010266304016, -0.02708243951201439, 0.05235781520605087, 0.13973231613636017, -0.03138638660311699, -0.029879139736294746, -0.20282167196273804, 0.15146812796592712, 0.17136551439762115, -0.6385704278945923, 0.13741374015808105, -0.0867343619465828, 0.24000470340251923, -0.03150562569499016, 0.13904431462287903, 0.28370872139930725, 0.010527025908231735, 0.21326611936092377, -0.25050559639930725, -0.00908123143017292, 0.1338285654783249, 0.18561923503875732, 0.24290575087070465, -0.053675781935453415, -0.4045007824897766, 0.7714702486991882, -0.1680593490600586, -0.1894521266222, 0.3267208933830261, 0.02584143728017807, -0.10562442243099213, -0.09522737562656403, -0.03889933228492737, 0.38555675745010376, -0.08965076506137848, -0.15831147134304047, -0.09787605702877045, -0.1014757752418518, -0.045898642390966415, 0.0033607203513383865, 0.3423727750778198, -0.23940213024616241, 0.17953017354011536, -0.030353497713804245, 0.26391032338142395, -0.08843405544757843, 0.19422897696495056, 0.4862135946750641, -0.306700736284256, 0.2875089645385742, 0.21449105441570282, 0.12238940596580505, -0.21748384833335876, 0.37646883726119995, 0.12076592445373535, -0.5368819832801819, 0.05739905312657356, 0.18089580535888672, -0.325933039188385, 0.4902883470058441, 0.06583176553249359, 0.13610896468162537, 0.13817358016967773, -0.1766272634267807, -0.3206556439399719, -0.3114210367202759, -0.014153026044368744, -0.30883654952049255, -0.005375556647777557, -0.09653331339359283, 0.3725492060184479, 0.21863196790218353, 0.17627014219760895, -0.20488083362579346, -0.07466381788253784, 0.22298002243041992, 0.07982926815748215, -0.009003523737192154, -0.10374163836240768, -0.06575022637844086, 0.5069714784622192, 0.08102773874998093, -0.15093474090099335, -0.0086278785020113, -0.0026418454945087433, -0.20525206625461578, 0.21736286580562592, 0.041109081357717514, -0.033342279493808746, -0.11854562163352966, -0.08618226647377014, -0.37788620591163635, 0.13583870232105255, -0.023166343569755554, 0.08670283108949661, 0.07271858304738998, 0.31186556816101074, -0.17353075742721558, -0.1144823506474495, -0.11972873657941818, 0.032181549817323685, -0.10408157110214233, -0.04131360352039337, 0.28762009739875793, 0.26259371638298035, 0.11414258927106857, -0.21639473736286163, -0.5713739395141602, 0.0897086039185524, 0.060626156628131866, 0.2366776168346405, 0.26378557085990906, 0.13940933346748352, 0.1509258896112442, 0.14121125638484955, 0.07552829384803772, -0.089247927069664, -0.009892412461340427, -0.004359737038612366, 0.20996490120887756, 0.12486013025045395, -0.24029859900474548, -0.23343299329280853, -0.06711465120315552, -0.38196590542793274, 0.12839460372924805, 0.3086838126182556, 0.24928072094917297, 0.21856406331062317, 0.28236889839172363, -0.09063147008419037, 0.046299438923597336, -0.1670982837677002, 0.423827201128006, 0.31730976700782776, 0.16459502279758453, 0.01762373372912407, 0.1306205540895462, 0.17646078765392303, 0.28877323865890503, 0.25303247570991516, -0.42082351446151733, 0.26313284039497375, 0.07306432723999023, -0.24914824962615967, 0.5958874225616455, -0.24442557990550995, -0.15386870503425598, 0.4825277328491211, -0.10002090036869049, 0.31294959783554077, -0.23836281895637512, 0.18786218762397766, -0.4934955835342407, -0.18289624154567719, -0.2293841540813446, 0.47493037581443787, 0.1210370808839798, -0.0989149957895279, -0.06259173154830933, -0.08985663205385208, -0.2655287981033325, -0.17919619381427765, -0.16645994782447815, 0.19855797290802002, 0.02137746661901474, 0.21345604956150055, 0.36340850591659546, 0.20359919965267181, -0.21005135774612427, 0.20192474126815796, 0.4420064389705658, -0.0683598518371582, 0.10271982103586197, 0.22219856083393097, -0.014396384358406067, 0.358812153339386, 0.0961141437292099, 0.197168231010437, 0.33880001306533813, -0.3331449031829834, 0.05922301113605499, -0.2138618677854538, -0.06105997413396835, 0.3484930992126465, 0.10848968476057053, 0.202041894197464, 0.19739508628845215, 0.32100898027420044, 0.061559341847896576, -0.0542142279446125, 0.07206873595714569, 0.3180753290653229, -0.05473906919360161, -0.3609734773635864, 0.07571901381015778, 0.1845586895942688, -0.03899277374148369, -0.11387637257575989, 0.12153974175453186, -0.3744547367095947, -0.5242739915847778, 0.40591534972190857, -0.4041568636894226, -0.01594606228172779, 0.14393939077854156, 0.029846951365470886, -0.17917390167713165, 0.1649366021156311, 0.23011092841625214, -0.24011999368667603, -0.04373955354094505, 0.12196165323257446, -0.3236822783946991, -0.14610400795936584, 0.2309153527021408, -0.6082748174667358, -0.21284636855125427, 0.06481742113828659, 0.03276043385267258, 0.07996243238449097, 0.034554511308670044, -0.21175050735473633, 0.12120730429887772, 0.2003791481256485, -0.43041837215423584, 0.1889810860157013, 0.1412842869758606, 0.544277548789978, -0.06469765305519104, -0.313103049993515, -0.0037583671510219574, 0.2415185272693634, -0.0644359216094017, -0.0009440798312425613, -0.4777795970439911, 0.31141039729118347, 0.07782958447933197, 0.1026844009757042, -0.06012486666440964, 0.4955733120441437, -0.09676586836576462, -0.19248513877391815, -0.07413104176521301, 0.06091046333312988, 0.03047659993171692, -0.168900728225708, 0.25053730607032776, 0.9040189981460571, -0.2993296980857849, 0.5262624621391296, -0.027449579909443855, 0.30374380946159363, -0.12054001539945602, -0.2408747673034668, -0.428778737783432, 0.33382076025009155, -0.2593010663986206, -0.16394074261188507, 0.4841507077217102, 0.2510423958301544, -0.1482084095478058, 0.18874874711036682, -0.30613529682159424, -0.19302283227443695, 0.31485095620155334, -0.4698559641838074, -0.26380547881126404, -0.14989051222801208, 0.3809041678905487, -0.0981348529458046, 0.40182948112487793, -0.18713173270225525, -0.10433751344680786, 0.26906445622444153, 0.06312432140111923, -0.047629304230213165, -0.09104758501052856, 0.017213182523846626, -0.3196547329425812, -0.30050763487815857, -0.4388332664966583, -0.036652155220508575, -0.21897634863853455, -0.04597780108451843, -0.211083322763443 ]
https://github.com/huggingface/datasets/issues/5032
new dataset type: single-label and multi-label video classification
@sayakpaul I did do quite a bit of work on [this PR](https://github.com/huggingface/datasets/pull/4532) a while back to add a video feature. It's outdated, but uses my `encoded_video` [package](https://github.com/nateraw/encoded-video) under the hood, which is basically a wrapper around PyAV stolen from [pytorchvideo](https://github.com/facebookresearch/pytorchvideo/) that gets rid of the `torch` dependency. would be really great to get something like this in...it's just a really tricky and time consuming feature to add.
**Is your feature request related to a problem? Please describe.** In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset. **Describe the solution you'd like** Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model. **Describe alternatives you've considered** Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative. **Additional context** I am wiling to open a PR but don't know where to start.
67
new dataset type: single-label and multi-label video classification **Is your feature request related to a problem? Please describe.** In my research, I am dealing with multi-modal (audio+text+frame sequence) video classification. It would be great if the datasets library supported generating multi-modal batches from a video dataset. **Describe the solution you'd like** Assume I have video files having single/multiple labels. I want to train a single/multi-label video classification model. I want datasets to support generating multi-modal batches (audio+frame sequence) from video files. Audio waveform and frame sequence can be extracted from each video clip then I can use any audio, image and video model from transformers library to extract features which will be fed into my model. **Describe alternatives you've considered** Currently, I am using https://github.com/facebookresearch/pytorchvideo dataloaders. There seems to be not much alternative. **Additional context** I am wiling to open a PR but don't know where to start. @sayakpaul I did do quite a bit of work on [this PR](https://github.com/huggingface/datasets/pull/4532) a while back to add a video feature. It's outdated, but uses my `encoded_video` [package](https://github.com/nateraw/encoded-video) under the hood, which is basically a wrapper around PyAV stolen from [pytorchvideo](https://github.com/facebookresearch/pytorchvideo/) that gets rid of the `torch` dependency. would be really great to get something like this in...it's just a really tricky and time consuming feature to add.
[ -0.29071953892707825, -0.12987607717514038, 0.0008971914649009705, -0.0838012546300888, 0.032520733773708344, -0.15826797485351562, 0.7191748023033142, 0.06242666020989418, -0.5241206884384155, -0.1024882048368454, -0.08797046542167664, 0.08317109197378159, -0.6178998351097107, 0.3780311048030853, 0.09508610516786575, -0.5689414739608765, 0.06313616037368774, -0.0016958564519882202, 0.35825222730636597, -0.14145350456237793, -0.08624196797609329, -0.2526909112930298, -0.16992652416229248, -0.040598027408123016, -0.7505611777305603, -0.04258943349123001, -0.16302886605262756, -0.29431238770484924, -0.04435903578996658, -0.4988780915737152, 0.06037759780883789, 0.043523456901311874, 0.40823987126350403, 0.5399168133735657, -0.00011873082257807255, -0.3509265184402466, 0.030756553635001183, -0.08815660327672958, -0.04377596080303192, 0.039245471358299255, -0.2138824462890625, -0.25447890162467957, 0.20055899024009705, -0.08126476407051086, 0.04067128896713257, -0.3132803738117218, 0.014907066710293293, -0.3452698290348053, 0.20895466208457947, 0.03927197307348251, 0.09413810074329376, -0.06867615133523941, -0.26007822155952454, -0.06843078881502151, 0.3938915729522705, 0.4938792586326599, -0.2338196039199829, -0.06891608238220215, 0.8324573040008545, -0.11841917037963867, -0.25732356309890747, 0.4146183729171753, -0.11510073393583298, -0.2689025104045868, 0.1308196485042572, 0.05030301213264465, -0.07228954881429672, -0.5284287929534912, -0.270749032497406, 0.27071717381477356, 0.6975956559181213, -0.2055971622467041, -0.635917067527771, -0.25727570056915283, 0.21743156015872955, -0.10368902236223221, -0.22981378436088562, 0.424649715423584, -0.3129097521305084, -0.0881100744009018, -0.001167352544143796, -0.16853544116020203, -0.3197285532951355, 0.08219087868928909, 0.3368723690509796, -0.01608727127313614, 0.19665607810020447, 0.02434907853603363, 0.21064068377017975, -0.062919020652771, 0.3573928475379944, -0.19985756278038025, 0.4047127366065979, 0.3963157534599304, -0.13881239295005798, -0.18749235570430756, -0.32555755972862244, -0.14186379313468933, 0.02693786844611168, 0.009636139497160912, -0.12404321134090424, 0.0014315582811832428, -0.5166160464286804, 0.14335447549819946, 0.1281370371580124, -0.0703529343008995, 0.049604304134845734, 0.19821153581142426, 0.18630647659301758, 0.05443954840302467, -0.12995025515556335, 0.06147247552871704, -0.2508462965488434, 0.02732977643609047, 0.2561151385307312, 0.513683557510376, -0.035925790667533875, -0.11096198856830597, -0.05847053602337837, -0.22964629530906677, -0.19742858409881592, -0.1925738900899887, 0.19802621006965637, -0.10604815930128098, 0.07004202902317047, 0.45864570140838623, -0.16896043717861176, 0.3318077325820923, -0.11912117153406143, -0.40185824036598206, 0.13063795864582062, 0.28934165835380554, -0.3936604857444763, 0.15213674306869507, 0.5051230788230896, -0.02626873180270195, -0.31019383668899536, 0.12930643558502197, 0.05067863315343857, 0.06839670985937119, 0.061223141849040985, -0.060000550001859665, 0.04490792006254196, -0.07121793925762177, -0.11304512619972229, 0.13029690086841583, 0.0023722127079963684, 0.4622202515602112, -0.07898835837841034, -0.011825062334537506, -0.08388372510671616, -0.17425668239593506, -0.13590899109840393, 0.048520270735025406, 0.29144954681396484, 0.05715476721525192, 0.027016818523406982, 0.46972420811653137, 0.0310366228222847, -0.18708331882953644, -0.04293783754110336, -0.06359145790338516, 0.10033740103244781, -0.2051960676908493, -0.1900365799665451, 0.4207437038421631, -0.6138809323310852, -0.19800147414207458, -0.09454856812953949, -0.08611521124839783, 0.08490089327096939, 0.288567453622818, -0.24876326322555542, -0.06780577450990677, 0.02969123236835003, -0.30374324321746826, 0.1556219756603241, -0.7339752912521362, 0.2571578025817871, 0.22849246859550476, -0.15240783989429474, 0.10586238652467728, 0.4457694888114929, 0.4851337671279907, 0.1418604701757431, -0.30736014246940613, 0.14779238402843475, 0.2679465413093567, -0.30502232909202576, -0.20473453402519226, 0.014297474175691605, -0.3033614456653595, -0.08003006875514984, 0.2968367636203766, 0.38323572278022766, 0.08445688337087631, -0.09481988102197647, 0.11477146297693253, 0.11670452356338501, -0.0695602148771286, 0.48710897564888, -0.16156628727912903, 0.42386898398399353, -0.15888598561286926, -0.12633337080478668, -0.46698254346847534, -0.43419575691223145, 0.09207434207201004, -0.28257641196250916, 0.20027244091033936, 0.23534244298934937, -0.3271530866622925, 0.41161417961120605, -0.14613306522369385, -0.006159242242574692, -0.0906943529844284, -0.033371392637491226, 0.29208314418792725, -0.2530299723148346, -0.17047174274921417, -0.42129066586494446, 0.056007809937000275, 0.37070512771606445, 0.08071541786193848, 0.10825957357883453, 0.237313374876976, 0.2146202027797699, 0.08704029023647308, -0.0872836709022522, 0.4078945517539978, 0.15959259867668152, 0.03716227412223816, 0.271738737821579, 0.07855536043643951, 0.06179342791438103, 0.0761553943157196, 0.06514044106006622, 0.16013596951961517, 0.38002243638038635, -0.471458375453949, 0.20759432017803192, -0.27656251192092896, 0.10573802143335342, -0.2597827613353729, -0.14028388261795044, 0.3895162343978882, -0.056162167340517044, 0.08577018976211548, -0.03639588505029678, 0.24606487154960632, 0.14509160816669464, -0.011291835457086563, -0.04534139484167099, -0.2010233849287033, -0.026546109467744827, 0.024042749777436256, -0.01503387838602066, -0.10164472460746765, -0.40438786149024963, -0.08433496206998825, 0.26529377698898315, -0.1735873967409134, 0.03618575260043144, 0.13221029937267303, -0.09866706281900406, 0.1251317858695984, -0.016854019835591316, 0.10147905349731445, 0.237919420003891, 0.13623252511024475, -0.11111333966255188, -0.23149505257606506, -0.06766883283853531, -0.06813319027423859, 0.09558753669261932, 0.12767499685287476, -0.020463062450289726, 0.05679754912853241, 0.0394759438931942, 0.15250596404075623, 0.2106407880783081, -0.4586614668369293, 0.135035902261734, -0.2544551491737366, -0.007845479995012283, -0.11919769644737244, -0.08679729700088501, -0.07533503323793411, -0.2619432210922241, -0.331478089094162, 0.024121448397636414, 0.07969886809587479, 0.23910920321941376, 0.06028394773602486, 0.22997349500656128, 0.28536954522132874, 0.006589062511920929, 0.5677880644798279, -0.11207860708236694, -0.08038906753063202, 0.14137941598892212, -0.10760286450386047, -0.1596759557723999, 0.10270519554615021, 0.24284113943576813, -0.2186058908700943, 0.19250598549842834, 0.29098764061927795, 0.07628229260444641, -0.4737761616706848, -0.04299321398139, 0.15180082619190216, 0.08891647309064865, 0.1080615296959877, 0.127118319272995, -0.2788706421852112, 0.03678152710199356, -0.19331693649291992, -0.02964826487004757, -0.10104917734861374, 0.15651868283748627, -0.22813238203525543, -0.12131103873252869, 0.1512385904788971, -0.09312477707862854, -0.033233851194381714, -0.48727691173553467, -0.15498597919940948, 0.1965411901473999, 0.15906062722206116, 0.037537746131420135, 0.05130060017108917, 0.008882191963493824, -0.03531489148736, 0.06577974557876587, 0.027016526088118553, 0.12460856139659882, 0.027991916984319687, 0.08389439433813095, -0.12641660869121552, -0.3203849196434021, -0.2064715325832367, -0.19533899426460266, -0.1410328894853592, 0.2958003282546997, -0.008088123053312302, -0.02977386862039566, 0.1282290518283844, 0.038481127470731735, -0.007419716566801071, -0.029920032247900963, 0.27840328216552734, 0.19798718392848969, 0.007166700437664986, -0.04288920760154724, 0.058064330369234085, 0.11536403000354767, -0.056308403611183167, 0.11377621442079544, 0.055741965770721436, 0.1963549256324768, -0.003529079258441925, 0.8889097571372986, -0.012490564957261086, -0.2643718123435974, 0.11198535561561584, 0.1134132444858551, -0.13949818909168243, 0.015847235918045044, -0.3912433683872223, -0.015527013689279556, -0.422259122133255, 0.14775633811950684, 0.15165205299854279, 0.007396521978080273, -0.24295808374881744, -0.38905587792396545, 0.3605510890483856, -0.1121416836977005, -0.012742599472403526, 0.2559718191623688, -0.392577201128006, 0.27886733412742615, -0.10122933983802795, -0.22637289762496948, -0.38275113701820374, -0.017655888572335243, -0.1394946575164795, 0.15113209187984467, 0.18925154209136963, -0.22834117710590363, -0.34455862641334534, 0.11455364525318146, 0.024269379675388336, 0.22644981741905212, 0.47860950231552124, 0.1170596107840538, -0.1429961919784546, 0.16853922605514526, 0.035728275775909424, 0.2257062941789627, 0.41115522384643555, -0.1899958699941635, 0.05254409462213516, 0.08620350062847137, 0.04386207461357117, 0.06949609518051147, -0.1051936000585556, -0.4635782241821289, 0.11447615921497345, -0.036630671471357346, 0.19461047649383545, 0.09783124178647995, -0.353772908449173, 0.16051052510738373, 0.08214101195335388, 0.1357513964176178, -0.013452763669192791, 0.20342080295085907, 0.44552040100097656, -0.15723471343517303, -0.026889249682426453, 0.4108845591545105, 0.031251028180122375, -0.23250605165958405, -0.1665928214788437, 0.11855665594339371, 0.14820179343223572, 0.49224573373794556, -0.32426342368125916, -0.12172409147024155, 0.06415285170078278, 0.19686298072338104, -0.21741905808448792, -0.048655882477760315, 0.2740687131881714, 0.17793940007686615, -0.27615630626678467, -0.23428410291671753, 0.3647429943084717, -0.04733080416917801, 0.4767436683177948, 0.44081565737724304, 0.1777046173810959, 0.2607961893081665, -0.018128424882888794, 0.011719442903995514, -0.18942871689796448, -0.050099361687898636, 0.41472381353378296, -0.2533864974975586, -0.7288167476654053, -0.4596770703792572, 0.473711758852005, 0.029198434203863144, -0.22690244019031525, 0.15501141548156738, -0.10336755216121674, -0.28582990169525146, 0.22614797949790955, 0.287675678730011, 0.8460802435874939, -0.10676473379135132, 0.4509921073913574, -0.17531532049179077, 0.15088076889514923, 0.3913329839706421, -0.2417454719543457, 0.11260870844125748, -0.1776389181613922, -0.11922258138656616, -0.24842385947704315, -0.014784123748540878, 0.02616550773382187, 0.43175435066223145, -0.1998472362756729, 0.08567720651626587, -0.015531621873378754, 0.09509718418121338, 0.20142309367656708, 0.269377201795578, 0.310971200466156, -0.5576372742652893, -0.05954114347696304, 0.08054008334875107, 0.17473028600215912, -0.003475543111562729, -0.05591275915503502, -0.18016548454761505, 0.09031100571155548, 0.10941006243228912, -0.6244988441467285, 0.11519325524568558, 0.0026366026140749454, 0.20962825417518616, 0.0024622194468975067, 0.17115463316440582, 0.27114051580429077, 0.01104101911187172, 0.28490906953811646, -0.25378766655921936, -0.06607784330844879, 0.13320757448673248, 0.20022499561309814, 0.21011009812355042, -0.1298709511756897, -0.49362683296203613, 0.8222084641456604, -0.1234135702252388, -0.16188497841358185, 0.3195241391658783, 0.04630995914340019, -0.10731126368045807, -0.17266853153705597, -0.0435960590839386, 0.4426414370536804, -0.15684190392494202, -0.18171237409114838, -0.051501765847206116, -0.004473518580198288, -0.08906258642673492, 0.0119683388620615, 0.3887866139411926, -0.1976720243692398, 0.12849858403205872, -0.0009749382734298706, 0.3058004081249237, -0.11986567080020905, 0.2891997992992401, 0.4531877934932709, -0.27131497859954834, 0.21835556626319885, 0.34522366523742676, 0.12581698596477509, -0.2126505970954895, 0.3602190315723419, 0.24803854525089264, -0.6016437411308289, 0.049007806926965714, 0.18498212099075317, -0.35204803943634033, 0.509507417678833, 0.11779829859733582, 0.15932920575141907, 0.13520634174346924, -0.0823821946978569, -0.21850350499153137, -0.2906627655029297, -0.03434138745069504, -0.3920010030269623, 0.06468181312084198, -0.08694246411323547, 0.40724480152130127, 0.269145131111145, 0.0974465161561966, -0.22139453887939453, -0.11380847543478012, 0.2413557767868042, 0.09170955419540405, 0.09014026075601578, -0.05009116232395172, -0.048754289746284485, 0.4250395596027374, 0.07183526456356049, -0.13729926943778992, -0.059871457517147064, -0.022408559918403625, -0.1593485176563263, 0.21769705414772034, 0.03133971989154816, 0.034554801881313324, -0.08555494248867035, -0.02938971109688282, -0.3688920736312866, 0.14954625070095062, -0.023330776020884514, 0.06306003034114838, 0.05476975813508034, 0.26702144742012024, -0.19622521102428436, -0.165487140417099, -0.05846383795142174, 0.03173798322677612, -0.10254737734794617, -0.011044584214687347, 0.2902679443359375, 0.2314816266298294, 0.09201425313949585, -0.19641683995723724, -0.579656183719635, 0.13068674504756927, 0.09735036641359329, 0.32677099108695984, 0.21848341822624207, 0.10572004318237305, 0.09392771124839783, 0.1685982197523117, 0.09676738828420639, -0.16511991620063782, 0.012592354789376259, -0.018318627029657364, 0.24588996171951294, 0.12354698032140732, -0.24822606146335602, -0.20311497151851654, -0.02767004817724228, -0.3441915214061737, 0.07250984013080597, 0.2921700179576874, 0.27240434288978577, 0.2380726933479309, 0.18634817004203796, -0.04152347147464752, -0.0463685505092144, -0.21915297210216522, 0.3872973322868347, 0.2564093768596649, 0.18716686964035034, 0.02648458629846573, 0.18228620290756226, 0.13373026251792908, 0.18960848450660706, 0.2592177391052246, -0.3820301294326782, 0.27857038378715515, 0.06809882819652557, -0.1594683974981308, 0.513410747051239, -0.2921551764011383, -0.017710085958242416, 0.4099738299846649, -0.0015259385108947754, 0.3121272325515747, -0.2222241461277008, 0.25026917457580566, -0.4417327642440796, -0.21105042099952698, -0.2199995368719101, 0.45689502358436584, 0.13879117369651794, -0.08369797468185425, -0.07903198897838593, -0.08534234762191772, -0.24203839898109436, -0.12117819488048553, -0.1813478320837021, 0.22675016522407532, 0.18190616369247437, 0.16625547409057617, 0.33919012546539307, 0.10606148093938828, -0.17713075876235962, 0.17172470688819885, 0.45774346590042114, -0.06330640614032745, 0.052894823253154755, 0.11187837272882462, -0.0954732894897461, 0.3157239556312561, 0.1463591605424881, 0.2016882449388504, 0.3282542824745178, -0.2180987447500229, 0.06663765758275986, -0.25346630811691284, -0.036386873573064804, 0.37640589475631714, 0.09287066757678986, 0.18959280848503113, 0.17525413632392883, 0.25908172130584717, 0.0649947002530098, -0.06385861337184906, 0.16627801954746246, 0.2598373591899872, -0.060154590755701065, -0.40303680300712585, -0.05899076908826828, 0.2233733981847763, -0.07469791918992996, -0.2368912696838379, 0.17740631103515625, -0.34440821409225464, -0.5519843101501465, 0.4422719478607178, -0.39704465866088867, -0.049502041190862656, 0.016228385269641876, 0.04288192838430405, -0.12529774010181427, 0.18322448432445526, 0.22858162224292755, -0.26319998502731323, -0.07714654505252838, 0.17393560707569122, -0.3240981996059418, -0.18746218085289001, 0.22429358959197998, -0.5198338627815247, -0.19850760698318481, 0.06344261020421982, 0.03792894259095192, 0.08079950511455536, 0.01598389446735382, -0.2576519250869751, 0.15580643713474274, 0.261235773563385, -0.4902590811252594, 0.2009669989347458, 0.16935156285762787, 0.5490070581436157, -0.04840683192014694, -0.23819884657859802, -0.0941934734582901, 0.1602548062801361, -0.07239554822444916, -0.028040364384651184, -0.5337146520614624, 0.3236536383628845, 0.1554136872291565, 0.2159302979707718, -0.05463860183954239, 0.46533679962158203, -0.0626947358250618, -0.22696691751480103, -0.18884381651878357, 0.07076326757669449, 0.0395049974322319, -0.1576440930366516, 0.2477421909570694, 0.8607430458068848, -0.3494756519794464, 0.5100104212760925, -0.043936122208833694, 0.36367473006248474, -0.07979364693164825, -0.20274144411087036, -0.43580305576324463, 0.33672261238098145, -0.26576802134513855, -0.1391775757074356, 0.45679208636283875, 0.2786986827850342, -0.18134741485118866, 0.22318314015865326, -0.2698509693145752, -0.2311934530735016, 0.3425357937812805, -0.44808876514434814, -0.24690237641334534, -0.0770367681980133, 0.334900438785553, -0.0004869326949119568, 0.3543601334095001, -0.24708425998687744, -0.10106074064970016, 0.20801372826099396, 0.08175278455018997, -0.012188419699668884, -0.012997357174754143, -0.01414143294095993, -0.3149679899215698, -0.29541659355163574, -0.4452126920223236, -0.07893022149801254, -0.1905229687690735, -0.003139495849609375, -0.23622985184192657 ]
https://github.com/huggingface/datasets/issues/5028
passing parameters to the method passed to Dataset.from_generator()
Hi! Yes, you can either use the `gen_kwargs` param in `Dataset.from_generator` (`ds = Dataset.from_generator(gen, gen_kwargs={"param1": val})`) or wrap the generator function with `functools.partial` (`ds = Dataset.from_generator(functools.partial(gen, param1="val"))`) to pass custom parameters to it.
Big thanks for providing dataset creation via a generator. I want to ask whether there is any way that parameters can be passed to the method Dataset.from_generator() method, like as follows. ``` from datasets import Dataset def gen(param1): for idx in len(custom_dataset): yield custom_dataset[idx] + param1 ds = Dataset.from_generator(gen(param1)) ```
33
passing parameters to the method passed to Dataset.from_generator() Big thanks for providing dataset creation via a generator. I want to ask whether there is any way that parameters can be passed to the method Dataset.from_generator() method, like as follows. ``` from datasets import Dataset def gen(param1): for idx in len(custom_dataset): yield custom_dataset[idx] + param1 ds = Dataset.from_generator(gen(param1)) ``` Hi! Yes, you can either use the `gen_kwargs` param in `Dataset.from_generator` (`ds = Dataset.from_generator(gen, gen_kwargs={"param1": val})`) or wrap the generator function with `functools.partial` (`ds = Dataset.from_generator(functools.partial(gen, param1="val"))`) to pass custom parameters to it.
[ 0.03988085314631462, 0.19671323895454407, -0.03208833560347557, 0.20860078930854797, 0.3242540955543518, -0.18615511059761047, 0.1362990140914917, 0.20249298214912415, -0.3697400987148285, 0.039925575256347656, 0.2710016369819641, 0.5735809803009033, -0.18443849682807922, -0.1891733705997467, 0.3384527564048767, -0.3299151360988617, -0.13020393252372742, -0.19393426179885864, 0.04701666161417961, -0.03277348354458809, -0.2185736745595932, -0.11595268547534943, -0.08758880198001862, 0.1844223141670227, 0.20448294281959534, 0.17174462974071503, -0.053388237953186035, 0.1251591145992279, -0.009597495198249817, -0.18092569708824158, -0.09643030911684036, 0.3341676890850067, 0.03673138841986656, 0.04937468469142914, -0.0001180704784928821, -0.06813986599445343, 0.2626304626464844, -0.18774648010730743, -0.3373168706893921, 0.07059469074010849, -0.21622416377067566, 0.34025904536247253, -0.13150185346603394, -0.22522670030593872, -0.07194648683071136, -0.2503858506679535, -0.3099212944507599, -0.38306012749671936, 0.2313518524169922, 0.35075509548187256, 0.1847287267446518, 0.06343355774879456, 0.2806982100009918, -0.01866834983229637, -0.035871610045433044, 0.28395941853523254, -0.24377793073654175, -0.1684035062789917, 0.10872503370046616, 0.08093424886465073, 0.26283517479896545, 0.04879360273480415, -0.096250519156456, -0.09268862009048462, 0.558123767375946, -0.01956552267074585, 0.15877671539783478, -0.10979002714157104, 0.14036458730697632, -0.040551550686359406, 0.46087098121643066, -0.38650813698768616, -0.5843487977981567, -0.08572830259799957, 0.14157608151435852, -0.23088359832763672, -0.1834922730922699, 0.192864790558815, -0.6517452597618103, 0.15234270691871643, -0.1716310977935791, -0.5236441493034363, -0.33106228709220886, -0.1520501971244812, 0.15001335740089417, 0.16859272122383118, 0.05367470532655716, 0.14069905877113342, 0.06769494712352753, 0.02088409662246704, 0.3438807427883148, -0.402130663394928, 0.20952516794204712, 0.34235456585884094, 0.21068081259727478, -0.044377200305461884, 0.0034257322549819946, 0.22135645151138306, 0.21737754344940186, 0.10878780484199524, -0.1559416800737381, -0.11855006963014603, 0.04048639535903931, -0.0435074120759964, 0.4177703559398651, -0.29086408019065857, 0.1525810807943344, 0.331274151802063, -0.11036315560340881, -0.3886428773403168, -0.06981834024190903, -0.2128610610961914, 0.08343016356229782, -0.36119434237480164, 0.6062086820602417, 0.24256294965744019, 0.17920072376728058, -0.11538061499595642, 0.18891176581382751, -0.4724593460559845, -0.0006838254630565643, -0.2933422029018402, 0.25808918476104736, 0.04819435626268387, 0.07532575726509094, 0.2816509008407593, 0.002364799380302429, 0.048348844051361084, -0.07668127864599228, -0.47298482060432434, -0.19957749545574188, -0.0322989895939827, -0.03267829120159149, 0.33957961201667786, -0.19104520976543427, -0.4197370707988739, 0.11039946973323822, 0.19706641137599945, 0.3872731328010559, -0.07498779892921448, 0.296312540769577, 0.12245135009288788, 0.00017767399549484253, 0.1708633154630661, -0.1252261847257614, 0.13368810713291168, 0.09242374449968338, -0.1836272031068802, -0.13702982664108276, 0.4426193833351135, -0.27625906467437744, -0.41461941599845886, 0.08246281743049622, 0.08017152547836304, -0.0367983914911747, 0.27200907468795776, -0.23125499486923218, 0.10756340622901917, 0.2845957279205322, 0.08597081899642944, -0.07231604307889938, -0.17424647510051727, -0.17128777503967285, -0.4507262110710144, 0.2751021683216095, 0.2535790205001831, -0.4170604944229126, -0.17836232483386993, -0.24094218015670776, 0.03179736062884331, 0.26940444111824036, -0.019080061465501785, -0.42337170243263245, 0.34401288628578186, -0.06943084299564362, -0.1848602592945099, 0.8318276405334473, 0.06267152726650238, -0.11651061475276947, 0.14511239528656006, 0.3015405535697937, 0.06355805695056915, 0.14397093653678894, -0.141001895070076, -0.08900121599435806, -0.16243593394756317, 0.5368355512619019, 0.2999325394630432, -0.31217479705810547, 0.10740377753973007, -0.10871590673923492, 0.1383182406425476, 0.03314037621021271, 0.09091873466968536, 0.12910428643226624, 0.48070991039276123, -0.0987309142947197, -0.2653641104698181, 0.22746485471725464, -0.33594176173210144, -0.08732036501169205, -0.022197365760803223, 0.23762843012809753, -0.07542294263839722, 0.09777180105447769, 0.045182518661022186, -0.1238856241106987, 0.07998016476631165, 0.43614789843559265, -0.12088972330093384, -0.07892034947872162, -0.16014060378074646, -0.10201310366392136, 0.27366742491722107, -0.014978263527154922, 0.09283728897571564, -0.02096841298043728, 0.05253284424543381, 0.04719851538538933, -0.2720421552658081, -0.29516705870628357, 0.14485502243041992, -0.058236099779605865, -0.013779271394014359, -0.24767552316188812, 0.18398593366146088, 0.2891859710216522, 0.0009378595277667046, -0.21991859376430511, -0.16690969467163086, 0.3101497292518616, 0.251431941986084, -0.10393358767032623, 0.20799261331558228, 0.28182274103164673, 0.1666785627603531, -0.25156694650650024, 0.21715348958969116, -0.08109515905380249, 0.048830997198820114, 0.16714589297771454, -0.1359337717294693, 0.06290286779403687, 0.04807492345571518, 0.18628227710723877, 0.45429790019989014, -0.1540037840604782, 0.3870825171470642, 0.18395458161830902, 0.1638830006122589, 0.10360164940357208, 0.15592129528522491, -0.3240821659564972, 0.1086062341928482, -0.07509322464466095, 0.1887100636959076, 0.25828292965888977, 0.07416921108961105, -0.33646276593208313, 0.2851681113243103, 0.2947391867637634, 0.021878965198993683, -0.17586806416511536, -0.12693029642105103, -0.1333397924900055, 0.11504272371530533, -0.09727668017148972, 0.3868541419506073, 0.4836878180503845, 0.05674520507454872, 0.026261575520038605, 0.08788793534040451, -0.0012304820120334625, -0.09878268837928772, 0.2615271210670471, 0.06499683111906052, 0.113387331366539, -0.11096642166376114, -0.2895323932170868, -0.2261769324541092, -0.02663978561758995, 0.15518119931221008, 0.1575758308172226, 0.04612644761800766, -0.5277953147888184, 0.27350127696990967, 0.05867113918066025, 0.21819192171096802, -0.24138060212135315, -0.17594091594219208, -0.05081500485539436, -0.056112922728061676, -0.22273887693881989, 0.13985174894332886, -0.1315397173166275, -0.28320425748825073, -0.14721612632274628, 0.155482679605484, 0.06997129321098328, -0.10158022493124008, -0.2305678427219391, -0.03919170796871185, 0.20481735467910767, 0.02553090825676918, 0.021988533437252045, -0.28009507060050964, 0.43864962458610535, 0.18125835061073303, 0.07840452343225479, -0.065078005194664, 0.03951212018728256, 0.09637904167175293, 0.03128456324338913, 0.7965365648269653, 0.27583804726600647, 0.1280575841665268, 0.16188688576221466, 0.02780059352517128, 0.32041600346565247, -0.053229883313179016, 0.228845477104187, -0.28978314995765686, 0.061675507575273514, 0.23223163187503815, -0.18308056890964508, 0.11166926473379135, -0.3115541934967041, -0.03210293874144554, -0.06779466569423676, 0.043428439646959305, 0.24050216376781464, 0.22747379541397095, 0.13783647119998932, -0.13579043745994568, 0.4857737720012665, -0.11030783504247665, -0.058014143258333206, -0.4764115512371063, 0.3904878795146942, -0.5310428142547607, 0.09409765899181366, -0.13285480439662933, -0.11514180153608322, 0.25305700302124023, 0.5991907715797424, -0.008393719792366028, -0.22566105425357819, 0.13575881719589233, 0.05424252524971962, -0.09813818335533142, 0.14157366752624512, -0.21103239059448242, 0.09637825191020966, 0.09508495032787323, -0.11919217556715012, -0.17181909084320068, -0.12799584865570068, 0.028172876685857773, 0.1596968024969101, 0.48158520460128784, 0.47148269414901733, -0.2250920832157135, 0.975511372089386, -0.051820047199726105, 0.028475835919380188, 0.1463862806558609, -0.14114537835121155, 0.0966479703783989, 0.31256943941116333, -0.27432188391685486, -0.14848841726779938, 0.3091059625148773, -0.3687136769294739, -0.14411629736423492, 0.07830972224473953, 0.06546151638031006, -0.08707833290100098, -0.1571369767189026, -0.017826106399297714, -0.29080188274383545, 0.029093993827700615, -0.02252185344696045, 0.6591715216636658, -0.10508736968040466, 0.42268452048301697, -0.5938161015510559, 0.15009313821792603, -0.11222527921199799, -0.0496990829706192, 0.5847822427749634, -0.26752346754074097, -0.27107515931129456, -0.11347120255231857, -0.4348919987678528, 0.09775495529174805, 0.2210332155227661, -0.11220880597829819, 0.04869413748383522, 0.11458878964185715, 0.026908420026302338, 0.003806716063991189, 0.5801204442977905, -0.49957311153411865, -0.30159682035446167, 0.2047000229358673, -0.24593570828437805, -0.3938263952732086, 0.18907791376113892, 0.3161754906177521, 0.14308330416679382, -0.2300499826669693, -0.18704116344451904, -0.2422712743282318, -0.25719505548477173, -0.03213738650083542, 0.07333894073963165, -0.3704756796360016, 0.02443172037601471, -0.11820583045482635, -0.5557295083999634, 0.15393708646297455, -0.2074020802974701, -0.08741628378629684, 0.27067801356315613, -0.17737232148647308, 0.14496685564517975, 0.03653504699468613, 0.13681671023368835, 0.1404941976070404, 0.0016228202730417252, 0.382399320602417, 0.0046591609716415405, -0.09827058017253876, 0.09285673499107361, -0.2974691390991211, 0.029735207557678223, 0.1920890063047409, -0.20584462583065033, -0.2655138671398163, -0.44826844334602356, -0.21752743422985077, 0.5602708458900452, 0.1873627007007599, -0.3130719065666199, 0.25998103618621826, -0.27196618914604187, -0.033564597368240356, -0.08194807916879654, -0.12548138201236725, 0.23211337625980377, -0.3328329622745514, -0.0440816804766655, -1.1095548868179321, 0.09573493897914886, 0.13838450610637665, -0.0156024768948555, 0.47605642676353455, -0.02360346168279648, -0.5012810826301575, 0.010729927569627762, 0.2621711492538452, 0.7492897510528564, 0.07911136001348495, -0.01680469885468483, -0.017399519681930542, 0.07485158741474152, 0.25179538130760193, 0.2993417978286743, -0.1702459156513214, -0.32031115889549255, -0.08323994278907776, -0.03794927895069122, -0.21104460954666138, 0.20144987106323242, 0.2570176422595978, -0.05044763535261154, 0.103575699031353, -0.48971277475357056, -0.027363870292901993, 0.22713010013103485, 0.07833491265773773, 0.04631735756993294, -0.1290019154548645, -0.36056938767433167, 0.09180879592895508, -0.155326709151268, -0.31623753905296326, 0.13339492678642273, -0.42051923274993896, 0.29128316044807434, -0.2723371386528015, -0.16791969537734985, 0.07023034244775772, -0.2977581322193146, -0.13471902906894684, 0.37984395027160645, -0.13972240686416626, 0.29829683899879456, 0.2615114152431488, 0.6190782785415649, 0.03203033283352852, -0.04078001528978348, 0.2656882107257843, -0.2143280804157257, 0.23960578441619873, -0.22249339520931244, 0.18675878643989563, 0.22773008048534393, 0.13065564632415771, -0.20562683045864105, 0.49908629059791565, 0.008499418385326862, -0.7002885341644287, -0.5669271945953369, -0.46323490142822266, 0.39178794622421265, -0.28321582078933716, 0.09538502991199493, -0.231160968542099, -0.0005022846162319183, -0.011753963306546211, 0.149088054895401, 0.21233707666397095, -0.1481858193874359, 0.35947588086128235, -0.14047852158546448, 0.0257742777466774, 0.20183618366718292, 0.08205710351467133, 0.05325610190629959, 0.26120346784591675, 0.42036116123199463, -0.14926837384700775, 0.10831022262573242, -0.010231968015432358, -0.06803138554096222, 0.1036488488316536, -0.2116747796535492, 0.35069021582603455, 0.33180636167526245, 0.5259586572647095, 0.05368707701563835, 0.07810188084840775, -0.48858320713043213, 0.331181138753891, -0.2725287079811096, -0.03566529229283333, 0.003658607602119446, -0.06899707019329071, 0.20665006339550018, 0.19994871318340302, -0.008603973314166069, -0.19271273910999298, -0.21178701519966125, 0.15221890807151794, -0.2910221219062805, -0.26403117179870605, 0.28610989451408386, 0.13142070174217224, 0.3881436884403229, 0.1764429807662964, -0.3188975155353546, -0.1272629350423813, 0.13832077383995056, 0.05415458232164383, -0.044657349586486816, -0.21050319075584412, -0.2554062306880951, 0.1670847237110138, -0.00918082520365715, -0.24508218467235565, -0.04840695485472679, -0.22137713432312012, -0.1705547273159027, 0.02380494587123394, 0.26205089688301086, 0.018977269530296326, -0.019651509821414948, 0.29776713252067566, 0.22037988901138306, 0.29902905225753784, -0.20268991589546204, 0.2422380894422531, 0.05802157521247864, 0.5258409380912781, 0.018353836610913277, 0.19126638770103455, -0.15116427838802338, -0.14343833923339844, -0.23672069609165192, -0.02920808643102646, 0.10321518778800964, 0.1440654695034027, 0.2240956723690033, 0.022255215793848038, 0.08106681704521179, -0.013264943845570087, 0.06990271806716919, 0.19277191162109375, -0.3978196978569031, 0.5046646595001221, 0.18049278855323792, 0.1260477751493454, 0.0733763575553894, -0.14601445198059082, -0.11865341663360596, 0.015077555552124977, -0.1217566728591919, 0.35622942447662354, -0.2136813998222351, -0.06944621354341507, 0.2784729301929474, -0.4299207925796509, 0.141678124666214, -0.023651156574487686, -0.005647279322147369, 0.7101852893829346, 0.07575199007987976, -0.006937582045793533, 0.040519438683986664, 0.23192112147808075, -0.09019637852907181, 0.2269960194826126, -0.00410199910402298, 0.06073490530252457, 0.09003016352653503, -0.3225361108779907, 0.2702937722206116, -0.10893522202968597, 0.07505226880311966, 0.3170742392539978, 0.02394828200340271, 0.324555903673172, -0.08399336040019989, -0.10307445377111435, 0.2790384888648987, -0.11648868024349213, -0.005119701847434044, 0.33028364181518555, 0.26245933771133423, -0.12681858241558075, -0.4969532787799835, -0.09724688529968262, -0.10637795180082321, 0.12005648016929626, -0.12795034050941467, -0.26849615573883057, -0.011082157492637634, -0.10497787594795227, 0.30948418378829956, 0.0028996476903557777, 0.1334439516067505, -0.01812894269824028, 0.0911046713590622, -0.25952330231666565, -0.3452831506729126, -0.15906207263469696, -0.0008404552936553955, 0.19480852782726288, 0.11729095876216888, -0.004865974187850952, 0.3622172176837921, -0.142487034201622, -0.10467274487018585, 0.01818085089325905, -0.06545528769493103, 0.11962264776229858, -0.18369019031524658, -0.0672893226146698, 0.03911407291889191, 0.16704042255878448, 0.09593037515878677, -0.02223009616136551, -0.22195865213871002, 0.022705581039190292, 0.32175785303115845, -0.5377604961395264, 0.6657972931861877, 0.16506154835224152, -0.15337343513965607, -0.10694195330142975, -0.05959712713956833, -0.04750605672597885, -0.3383045494556427, 0.26889568567276, -0.04625619575381279, -0.04376469552516937, -0.08856883645057678, 0.019915655255317688, -0.20923292636871338, 0.4494536221027374, -0.07833047211170197, 0.29792559146881104, -0.18790973722934723, -0.4122816324234009, -0.27606138586997986, -0.09964365512132645, 0.1491640955209732, -0.03720656782388687, 0.15783776342868805, 0.06006453186273575, 0.1582602858543396, 0.06286126375198364, -0.25037121772766113, -0.32351577281951904, -0.07331260293722153, 0.4004485011100769, -0.027057597413659096, -0.3799697458744049, -0.001464150846004486, -0.007949601858854294, 0.010242991149425507, -0.22303974628448486, 0.0794202983379364, -0.2294793426990509, 0.057812079787254333, -0.1718919426202774, 0.06077489256858826, 0.3533657193183899, 0.48732057213783264, 0.04335011541843414, -0.2093714028596878, 0.29624465107917786, 0.03730236738920212, 0.09270986914634705, 0.10319745540618896, 0.1477293074131012, -0.1557343453168869, -0.0015038475394248962, -0.27464359998703003, 0.15645676851272583, 0.08573570847511292, -0.1866122931241989, -0.546074390411377, 0.011526786722242832, 0.008913841098546982, 0.13994018733501434, 0.124104343354702, 0.1208425983786583, -0.24175924062728882, -0.25183847546577454, 0.12902110815048218, -0.11112501472234726, -0.15412163734436035, 0.0931519865989685, -0.12562072277069092, 0.25452595949172974, 0.4229179322719574, -0.5899127125740051, -0.3641769587993622, -0.2753838300704956, 0.1072251945734024, -0.08661990612745285, -0.27154698967933655, -0.09839875251054764, -0.08805208653211594, 0.5123313069343567, -0.05160370469093323, 0.0918564647436142, 0.36472782492637634, 0.31975314021110535, 0.24569569528102875, -0.06810007989406586, 0.11693407595157623, -0.06452071666717529, 0.03326335549354553, -0.10245465487241745, -0.09877549111843109 ]
https://github.com/huggingface/datasets/issues/5025
Custom Json Dataset Throwing Error when batch is False
Hi! Our processors are meant to be used in `batched` mode, so if `batched` is `False`, you need to drop the batch dimension (the error message warns you that the array has an extra dimension meaning it's 4D instead of 3D) to avoid the error: ```python def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud #For this reason I couldn't set the batch to True. encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length", return_tensors="np") # drop extra dim for k in encoding.items(): encoding[k]=encoding[k][0] return encoding ```
## Describe the bug A clear and concise description of what the bug is. I tried to create my custom dataset using below code ``` from datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D from torchvision import transforms from transformers import AutoProcessor # we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes, # based on the checkpoint we provide from the hub from datasets import load_dataset def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud #For this reason I couldn't set the batch to True. encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length") # encoding['pixel_values']=np.array(encoding['pixel_values']) return encoding dataset = load_dataset("json", data_files='issues.jsonl') processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) features = dataset["train"].features column_names = dataset["train"].column_names # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) train_dataset = dataset["train"].map( prepare_examples, batched=False, remove_columns=column_names, features=features ) ``` It throws below error. ``` /opt/conda/lib/python3.7/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 172 storage = to_pyarrow_listarray(data, pa_type) --> 173 return pa.ExtensionArray.from_storage(pa_type, storage) 174 /opt/conda/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.ExtensionArray.from_storage() TypeError: Incompatible storage type list<item: list<item: list<item: list<item: float>>>> for extension type extension<arrow.py_extension_type<Array3DExtensionType>> ``` ## Steps to reproduce the bug ```python # Sample code to reproduce the bug ``` rom datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D from torchvision import transforms from transformers import AutoProcessor # we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes, # based on the checkpoint we provide from the hub from datasets import load_dataset def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length") # encoding['pixel_values']=np.array(encoding['pixel_values']) return encoding dataset = load_dataset("json", data_files='issues.jsonl') processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) features = dataset["train"].features column_names = dataset["train"].column_names # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) train_dataset = dataset["train"].map( prepare_examples, batched=False, remove_columns=column_names, features=features ) ## Expected results A clear and concise description of the expected results. Expected would be similar to all the otherdatasets with no error. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Unix - Python version: 3.9 - PyArrow version: 9.0.0
93
Custom Json Dataset Throwing Error when batch is False ## Describe the bug A clear and concise description of what the bug is. I tried to create my custom dataset using below code ``` from datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D from torchvision import transforms from transformers import AutoProcessor # we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes, # based on the checkpoint we provide from the hub from datasets import load_dataset def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud #For this reason I couldn't set the batch to True. encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length") # encoding['pixel_values']=np.array(encoding['pixel_values']) return encoding dataset = load_dataset("json", data_files='issues.jsonl') processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) features = dataset["train"].features column_names = dataset["train"].column_names # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) train_dataset = dataset["train"].map( prepare_examples, batched=False, remove_columns=column_names, features=features ) ``` It throws below error. ``` /opt/conda/lib/python3.7/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 172 storage = to_pyarrow_listarray(data, pa_type) --> 173 return pa.ExtensionArray.from_storage(pa_type, storage) 174 /opt/conda/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.ExtensionArray.from_storage() TypeError: Incompatible storage type list<item: list<item: list<item: list<item: float>>>> for extension type extension<arrow.py_extension_type<Array3DExtensionType>> ``` ## Steps to reproduce the bug ```python # Sample code to reproduce the bug ``` rom datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D from torchvision import transforms from transformers import AutoProcessor # we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes, # based on the checkpoint we provide from the hub from datasets import load_dataset def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length") # encoding['pixel_values']=np.array(encoding['pixel_values']) return encoding dataset = load_dataset("json", data_files='issues.jsonl') processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) features = dataset["train"].features column_names = dataset["train"].column_names # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) train_dataset = dataset["train"].map( prepare_examples, batched=False, remove_columns=column_names, features=features ) ## Expected results A clear and concise description of the expected results. Expected would be similar to all the otherdatasets with no error. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Unix - Python version: 3.9 - PyArrow version: 9.0.0 Hi! Our processors are meant to be used in `batched` mode, so if `batched` is `False`, you need to drop the batch dimension (the error message warns you that the array has an extra dimension meaning it's 4D instead of 3D) to avoid the error: ```python def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud #For this reason I couldn't set the batch to True. encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length", return_tensors="np") # drop extra dim for k in encoding.items(): encoding[k]=encoding[k][0] return encoding ```
[ -0.20834654569625854, -0.19214779138565063, -0.07093651592731476, 0.3017364740371704, 0.1363687813282013, 0.010352909564971924, 0.46729496121406555, 0.29022735357284546, -0.006736405193805695, 0.08248203992843628, 0.2620529234409332, 0.2601095139980316, -0.3658747375011444, 0.10612642019987106, -0.1939835101366043, -0.13611891865730286, 0.12819717824459076, 0.15568187832832336, 0.08351049572229385, -0.05229887738823891, -0.37254640460014343, 0.2696443498134613, -0.39679962396621704, -0.01995871216058731, -0.27080968022346497, -0.26611143350601196, 0.11320774257183075, 0.06582117825746536, 0.021621333435177803, -0.4727208912372589, 0.2019696682691574, -0.144547700881958, 0.0927063524723053, 0.5755273699760437, -0.00010804566409206018, 0.07630796730518341, 0.39184027910232544, -0.14079859852790833, -0.17180173099040985, 0.029579997062683105, -0.23113948106765747, -0.2274019569158554, -0.09832475334405899, -0.2862984836101532, -0.14945164322853088, -0.10565191507339478, -0.41946789622306824, -0.48956555128097534, 0.4759349226951599, 0.4369571805000305, 0.20677442848682404, 0.23184296488761902, -0.1861504167318344, 0.04440690204501152, 0.14138147234916687, 0.4534000754356384, -0.24079476296901703, -0.004695327952504158, 0.20504504442214966, -0.12778590619564056, 0.09078855067491531, 0.3688371777534485, -0.2788374125957489, 0.06656855344772339, 0.08570162951946259, 0.011253011412918568, -0.16816192865371704, -0.35695984959602356, -0.03806723654270172, 0.08807631582021713, 0.3638947904109955, -0.3429868817329407, -0.15481840074062347, -0.3195023238658905, -0.044954441487789154, -0.4049772322177887, 0.21028468012809753, 0.23783430457115173, -0.21513110399246216, 0.0018149949610233307, -0.432066947221756, 0.16449326276779175, -0.3063034415245056, 0.013380330055952072, 0.12626132369041443, 0.24812236428260803, -0.009195948950946331, 0.18141603469848633, -0.1814432442188263, -0.161227285861969, 0.5357674956321716, -0.09318196773529053, -0.28945720195770264, 0.11888296157121658, -0.18007497489452362, -0.3342793881893158, -0.03645903617143631, -0.5437409281730652, 0.1920487880706787, -0.05011401325464249, 0.2795565724372864, -0.14336836338043213, 0.07942043244838715, 0.0795736312866211, 0.07147060334682465, 0.42397648096084595, 0.10471753776073456, 0.12171638756990433, 0.18481141328811646, 0.025746487081050873, 0.05112322047352791, 0.14913195371627808, 0.09935939311981201, -0.22360117733478546, -0.03261203318834305, 0.400411456823349, 0.3135186433792114, 0.21025779843330383, -0.3193154036998749, 0.2186751365661621, -0.1607549786567688, 0.019563594833016396, 0.1178876981139183, 0.10181137919425964, 0.07698488980531693, -0.22379738092422485, 0.09639282524585724, 0.32166945934295654, -0.16262935101985931, 0.05986349657177925, -0.059476204216480255, 0.12578050792217255, -0.13638249039649963, -0.1594495326280594, 0.3256594240665436, 0.16812492907047272, 0.44578057527542114, -0.06256001442670822, -0.11642684042453766, -0.036149632185697556, 0.05964340269565582, -0.11973477900028229, 0.06922812759876251, 0.1519615650177002, 0.07959865033626556, -0.009830078110098839, 0.1567259132862091, 0.29287004470825195, -0.17962409555912018, 0.26285669207572937, -0.1264159083366394, -0.22301636636257172, -0.17060723900794983, 0.15860126912593842, -0.10535285621881485, -0.0814821645617485, -0.22615715861320496, 0.007721152156591415, 0.1267121285200119, 0.24386441707611084, 0.2728036344051361, -0.1522001326084137, -0.035966984927654266, -0.20363731682300568, -0.2271828055381775, 0.3908078670501709, -0.5186535120010376, 0.23437079787254333, 0.21900995075702667, -0.11158283054828644, 0.045043304562568665, 0.10966777801513672, -0.20696839690208435, 0.4299637973308563, -0.20896723866462708, 0.1115490198135376, 0.18395821750164032, -0.5709853768348694, -0.30601972341537476, 0.2569400370121002, -0.03263310343027115, -0.055586934089660645, 0.08930642902851105, 0.08096133172512054, 0.23541618883609772, 0.03387339040637016, 0.36932775378227234, 0.39139753580093384, 0.03693417087197304, 0.28912967443466187, 0.005873978137969971, -0.23992067575454712, -0.016278032213449478, 0.11636357009410858, -0.116042360663414, 0.07869885116815567, 0.07106658816337585, -0.16949647665023804, 0.03757098317146301, -0.19792026281356812, 0.08371791988611221, 0.3743463158607483, 0.20749638974666595, -0.14828000962734222, -0.0642460435628891, 0.12911638617515564, -0.7534002065658569, 0.19592386484146118, -0.03274986147880554, 0.07853801548480988, -0.21649764478206635, 0.00868198648095131, -0.20862337946891785, 0.03560841828584671, -0.32380762696266174, -0.29122886061668396, 0.19709932804107666, 0.11013610661029816, 0.009491514414548874, -0.14032599329948425, -0.19408561289310455, 0.1287812441587448, 0.13352636992931366, 0.008249578066170216, -0.34945976734161377, 0.05603761225938797, 0.00913565419614315, -0.3722446858882904, 0.04881006479263306, 0.2996279001235962, 0.2768683135509491, -0.18727046251296997, -0.2445860207080841, 0.2293699085712433, 0.1388987898826599, -0.18653149902820587, -0.18364283442497253, -0.2543954849243164, 0.08427365124225616, -0.06153004616498947, 0.18674351274967194, 0.12191079556941986, -0.0334421843290329, -0.015909194946289062, -0.2986679971218109, 0.41117894649505615, 0.03412310406565666, -0.017292805016040802, -0.2736964225769043, 0.04516681283712387, 0.43860071897506714, -0.04134425148367882, -0.17421665787696838, -0.42699190974235535, 0.09095332026481628, 0.2326970398426056, 0.12580065429210663, -0.029633285477757454, -0.284757524728775, -0.11058209091424942, 0.4891364276409149, 0.10176534950733185, 0.13756796717643738, 0.11007325351238251, -0.1256922483444214, 0.07284912467002869, 0.1824343204498291, 0.06590375304222107, 0.4652823805809021, 0.15108954906463623, -0.4143766760826111, 0.139946848154068, -0.049406129866838455, 0.031450819224119186, 0.06584928929805756, -0.05780142545700073, 0.3956039249897003, 0.1328897327184677, 0.47336775064468384, -0.1183888241648674, -0.18921422958374023, -0.5483927130699158, -0.010478222742676735, 0.21131183207035065, -0.24281570315361023, -0.009387149475514889, -0.05035515874624252, 0.04363229125738144, -0.1274692863225937, -0.35825300216674805, -0.08179472386837006, 0.017021212726831436, 0.10702860355377197, 0.16851931810379028, -0.13589462637901306, 0.20866800844669342, -0.1280115842819214, 0.2778323292732239, 0.29283997416496277, -0.594900906085968, -0.1209394782781601, -0.06480485945940018, -0.13302379846572876, -0.024397797882556915, 0.005179575644433498, -0.1078273132443428, 0.3854863941669464, 0.09968343377113342, -0.07971950620412827, -0.32521092891693115, 0.13888922333717346, 0.17672526836395264, -0.35716408491134644, 0.3303596079349518, 0.3128097653388977, 0.025522761046886444, 0.1640569269657135, -0.22523042559623718, 0.3480716347694397, 0.14525030553340912, -0.14485511183738708, 0.08590930700302124, 0.1203513890504837, -0.22649969160556793, -0.1332072764635086, -0.17669221758842468, -0.1454014927148819, -0.25570496916770935, -0.013021118938922882, 0.02585618570446968, 0.21563716232776642, 0.08814852684736252, 0.3850661516189575, 0.02004145458340645, 0.2704215347766876, -0.3319969177246094, -0.0863732323050499, -0.41752177476882935, 0.156704843044281, -0.44044870138168335, -0.1116388738155365, 0.04503782466053963, -0.14177864789962769, 0.3090337812900543, 0.1711735874414444, -0.4524582028388977, -0.15686659514904022, -0.09798514097929001, 0.3559427559375763, -0.1606745719909668, -0.25012773275375366, 0.44078031182289124, 0.2652813494205475, -0.06718600541353226, -0.3844296932220459, -0.25547754764556885, 0.14842453598976135, 0.22818848490715027, 0.36362871527671814, 0.18093299865722656, 0.5892195701599121, -0.12106968462467194, 0.6568952798843384, 0.259938508272171, -0.41289475560188293, 0.5111069679260254, -0.0746266171336174, 0.06048297509551048, -0.12420115619897842, -0.3102731704711914, -0.02877429872751236, 0.1793432980775833, 0.021856438368558884, 0.049327436834573746, -0.12574484944343567, -0.21492107212543488, -0.042923279106616974, 0.1364699751138687, -0.4556695222854614, 0.08083271980285645, 0.10206983983516693, -0.14893968403339386, 0.26005545258522034, -0.20809850096702576, 0.15303358435630798, -0.34948858618736267, -0.05537877604365349, -0.06537947058677673, -0.14477692544460297, 0.018386751413345337, -0.07778855413198471, -0.41003671288490295, -0.18795126676559448, -0.4413605332374573, 0.34768426418304443, 0.03623579442501068, 0.572516918182373, -0.14343073964118958, 0.2559962570667267, -0.03991454839706421, 0.03585869446396828, 0.8049381375312805, -0.5426613688468933, 0.11000578850507736, 0.1841660737991333, 0.09138570725917816, -0.21188269555568695, -0.16434721648693085, -0.12373973429203033, 0.27879321575164795, 0.2554120719432831, 0.6133710145950317, -0.013485051691532135, -0.28337427973747253, 0.27491068840026855, -0.11965545266866684, -0.04593884199857712, -0.2571573853492737, -0.28374409675598145, -0.4256570339202881, -0.3298899829387665, 0.09290305525064468, 0.31202390789985657, 0.27389460802078247, -0.008262614719569683, -0.3633234202861786, -0.19935119152069092, -0.17285767197608948, -0.1626768261194229, 0.08727498352527618, 0.22620102763175964, 0.09738802909851074, 0.10662855207920074, -0.17533664405345917, 0.34966593980789185, 0.4076649248600006, 0.3062269687652588, 0.20573346316814423, -0.2564646005630493, -0.04935961961746216, -0.14870822429656982, 0.16115155816078186, 0.22502678632736206, -0.10586478561162949, -0.15959569811820984, -0.21014809608459473, 0.12016314268112183, -0.2307363897562027, -0.04610789194703102, 0.3829733431339264, -0.024834129959344864, -0.36855974793434143, -0.10074363648891449, 0.3651706576347351, -0.039949070662260056, 0.1765245944261551, 0.02727779746055603, -0.24407131969928741, -0.3984123766422272, 0.5601291656494141, 0.3253641426563263, 0.47756069898605347, 0.2457612305879593, 0.041420161724090576, 0.38753542304039, 0.09479540586471558, 0.37535443902015686, -0.13222211599349976, 0.3745805025100708, -0.32352232933044434, 0.25527000427246094, -0.09772588312625885, -0.22534310817718506, 0.32168906927108765, 0.160474956035614, -0.12076312303543091, 0.14376558363437653, -0.07795383781194687, 0.03470053896307945, -0.26684805750846863, 0.02091488242149353, 0.008805959485471249, -0.3459343910217285, -0.26492708921432495, 0.13968536257743835, -0.13051271438598633, 0.24520383775234222, -0.08179689198732376, -0.23828715085983276, -0.30025365948677063, -0.38303661346435547, -0.28509753942489624, 0.13862836360931396, -0.2189042568206787, 0.060671787708997726, -0.0362403579056263, -0.434359073638916, 0.09043765068054199, 0.2632535398006439, 0.4742158055305481, 0.015775039792060852, -0.1252250075340271, 0.04983271658420563, 0.18035611510276794, 0.11503283679485321, 0.009035337716341019, -0.16265572607517242, 0.19068625569343567, -0.09258969873189926, -0.25753843784332275, 0.11541678011417389, -0.13926292955875397, -0.16851545870304108, -0.09177722036838531, 0.052764393389225006, -0.043492287397384644, -0.35326841473579407, -0.32816189527511597, -0.18584555387496948, 0.09419982135295868, -0.17635893821716309, 0.12344034016132355, -0.09434086084365845, 0.07123906165361404, 0.392794668674469, -0.37039628624916077, -0.2595943212509155, -0.07336318492889404, 0.12303553521633148, 0.0893418937921524, -0.2129756212234497, 0.5406461954116821, 0.20943309366703033, 0.011971559375524521, -0.3053429424762726, 0.29945042729377747, 0.261603444814682, -0.35770854353904724, 0.2695651650428772, -0.031007038429379463, -0.2926179766654968, 0.10998999327421188, 0.4537999927997589, -0.09300720691680908, 0.0828007310628891, 0.3605426847934723, -0.25307244062423706, -0.2551656663417816, 0.004023268818855286, -0.12120814621448517, 0.3238060772418976, 0.17638632655143738, 0.5300185680389404, 0.05003637820482254, -0.15856094658374786, -0.3236534595489502, 0.010787565261125565, -0.23462481796741486, 0.1670340895652771, -0.11640970408916473, 0.3176345229148865, 0.01570024900138378, 0.2905556857585907, 0.09155797213315964, 0.1326434314250946, -0.19401614367961884, -0.22999730706214905, -0.1537979692220688, 0.10144331306219101, 0.19233477115631104, -0.17737962305545807, -0.10853802412748337, -0.2009650468826294, -0.23456668853759766, -0.11592116951942444, 0.08597080409526825, 0.10292146354913712, 0.05103979632258415, 0.24005244672298431, -0.04930954799056053, 0.20448246598243713, 0.29770660400390625, -0.10206423699855804, -0.061047837138175964, 0.09994375705718994, 0.09457984566688538, 0.0813211053609848, -0.00904393196105957, -0.010632447898387909, -0.28637269139289856, -0.10534193366765976, 0.07549796998500824, 0.5330377221107483, -0.0036313384771347046, -0.4115622639656067, -0.1598648875951767, 0.08657187968492508, 0.2531382739543915, -0.13967782258987427, -0.5220974683761597, -0.3394886553287506, 0.3919987380504608, 0.20369276404380798, -0.22652658820152283, -0.1971469223499298, 0.11845444142818451, 0.032385725528001785, 0.12936770915985107, 0.3150278925895691, 0.060308050364255905, 0.09094606339931488, -0.19757179915905, 0.0758059024810791, 0.6225699782371521, -0.17217867076396942, 0.1936982274055481, 0.1631033718585968, -0.3004089295864105, 0.01502186432480812, 0.3513562083244324, 0.14950478076934814, 0.33896318078041077, 0.7323397994041443, 0.2295255959033966, 0.15372058749198914, 0.5350487232208252, 0.08491761982440948, -0.21041962504386902, -0.17815379798412323, 0.039907198399305344, -0.23651579022407532, 0.1692606806755066, 0.25735095143318176, 0.014513477683067322, -0.11349117010831833, -0.16036538779735565, 0.0035423061344772577, -0.3032759428024292, 0.15552422404289246, -0.11628460139036179, -0.013694358058273792, -0.37638741731643677, -0.03385843709111214, 0.45155641436576843, -0.020104987546801567, -0.10755947232246399, -0.04503718018531799, -0.009694121778011322, -0.05090038478374481, -0.31461429595947266, -0.1736508160829544, 0.18212494254112244, 0.1847776472568512, -0.0684497281908989, -0.222757026553154, 0.2622445523738861, 0.08474477380514145, -0.020030878484249115, -0.02714904025197029, 0.348085880279541, 0.36781594157218933, 0.5542567372322083, -0.15402692556381226, -0.10761629045009613, -0.1661897897720337, -0.02515983209013939, -0.06698839366436005, 0.1202908307313919, 0.09949395805597305, -0.12716734409332275, 0.16114702820777893, 0.14388513565063477, -0.10940659791231155, 0.13278624415397644, 0.24005095660686493, -0.023366030305624008, 0.004610367119312286, 0.06100033223628998, -0.07642585784196854, -0.08519071340560913, -0.07230351865291595, -0.1258021891117096, -0.3717544674873352, -0.016557063907384872, 0.393812358379364, 0.08481835573911667, 0.3812922239303589, 0.015302238054573536, 0.0997445285320282, -0.40397199988365173, 0.43727579712867737, 0.07520665228366852, -0.1323000192642212, -0.31263303756713867, 0.03149130940437317, -0.20256134867668152, -0.0034139081835746765, -0.2711534798145294, -0.17578694224357605, 0.021727006882429123, 0.11864674091339111, -0.176477313041687, -0.08381404727697372, 0.10569775849580765, 0.14373837411403656, -0.016002142801880836, 0.35659778118133545, -0.4804363250732422, -0.10293926298618317, -0.10372503101825714, 0.26788389682769775, 0.25916391611099243, -0.3572003245353699, 0.04965674877166748, 0.30527955293655396, 0.04706701636314392, -0.2713106870651245, -0.013190243393182755, 0.094137042760849, 0.1266779899597168, 0.477376788854599, 0.19683845341205597, 0.20216359198093414, -0.039194732904434204, -0.06011325120925903, -0.404623806476593, -0.23112092912197113, -0.231686070561409, -0.043915025889873505, 0.41292282938957214, 0.5470551252365112, -0.15337976813316345, 0.12948167324066162, -0.3442254960536957, 0.20304009318351746, 0.1459338217973709, 0.04875688999891281, -0.18787792325019836, 0.42801806330680847, -0.1697850227355957, 0.12457779794931412, -0.008480104617774487, 0.10869412124156952, -0.0032558180391788483, 0.45111122727394104, -0.41650038957595825, -0.34833794832229614, 0.5640298128128052, -0.36351481080055237, -0.4746747612953186, 0.27521437406539917, 0.0920015424489975, -0.0281054750084877, -0.08454521000385284, -0.181911438703537, 0.25886884331703186, 0.26475173234939575, -0.04366642236709595, -0.12926360964775085, 0.1684519350528717, -0.08182874321937561, -0.15253320336341858, 0.18053440749645233, 0.16559015214443207, 0.20223397016525269, -0.12274423986673355, 0.07835143804550171, -0.06589241325855255 ]
https://github.com/huggingface/datasets/issues/5025
Custom Json Dataset Throwing Error when batch is False
> Hi! Our processors are meant to be used in `batched` mode, so if `batched` is `False`, you need to drop the batch dimension (the error message warns you that the array has an extra dimension meaning it's 4D instead of 3D) to avoid the error: > > ```python > def prepare_examples(examples): > #Some preporcessing for each image and text as all my data saved in cloud > #For this reason I couldn't set the batch to True. > encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, > truncation=True, padding="max_length", return_tensors="np") > # drop extra dim > for k in encoding.items(): > encoding[k]=encoding[k][0] > return encoding > ``` Thank you it did work ``` for k,v in encoding.items(): encoding[k]=encoding[k][0] ```
## Describe the bug A clear and concise description of what the bug is. I tried to create my custom dataset using below code ``` from datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D from torchvision import transforms from transformers import AutoProcessor # we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes, # based on the checkpoint we provide from the hub from datasets import load_dataset def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud #For this reason I couldn't set the batch to True. encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length") # encoding['pixel_values']=np.array(encoding['pixel_values']) return encoding dataset = load_dataset("json", data_files='issues.jsonl') processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) features = dataset["train"].features column_names = dataset["train"].column_names # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) train_dataset = dataset["train"].map( prepare_examples, batched=False, remove_columns=column_names, features=features ) ``` It throws below error. ``` /opt/conda/lib/python3.7/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 172 storage = to_pyarrow_listarray(data, pa_type) --> 173 return pa.ExtensionArray.from_storage(pa_type, storage) 174 /opt/conda/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.ExtensionArray.from_storage() TypeError: Incompatible storage type list<item: list<item: list<item: list<item: float>>>> for extension type extension<arrow.py_extension_type<Array3DExtensionType>> ``` ## Steps to reproduce the bug ```python # Sample code to reproduce the bug ``` rom datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D from torchvision import transforms from transformers import AutoProcessor # we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes, # based on the checkpoint we provide from the hub from datasets import load_dataset def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length") # encoding['pixel_values']=np.array(encoding['pixel_values']) return encoding dataset = load_dataset("json", data_files='issues.jsonl') processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) features = dataset["train"].features column_names = dataset["train"].column_names # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) train_dataset = dataset["train"].map( prepare_examples, batched=False, remove_columns=column_names, features=features ) ## Expected results A clear and concise description of the expected results. Expected would be similar to all the otherdatasets with no error. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Unix - Python version: 3.9 - PyArrow version: 9.0.0
118
Custom Json Dataset Throwing Error when batch is False ## Describe the bug A clear and concise description of what the bug is. I tried to create my custom dataset using below code ``` from datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D from torchvision import transforms from transformers import AutoProcessor # we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes, # based on the checkpoint we provide from the hub from datasets import load_dataset def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud #For this reason I couldn't set the batch to True. encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length") # encoding['pixel_values']=np.array(encoding['pixel_values']) return encoding dataset = load_dataset("json", data_files='issues.jsonl') processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) features = dataset["train"].features column_names = dataset["train"].column_names # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) train_dataset = dataset["train"].map( prepare_examples, batched=False, remove_columns=column_names, features=features ) ``` It throws below error. ``` /opt/conda/lib/python3.7/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 172 storage = to_pyarrow_listarray(data, pa_type) --> 173 return pa.ExtensionArray.from_storage(pa_type, storage) 174 /opt/conda/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.ExtensionArray.from_storage() TypeError: Incompatible storage type list<item: list<item: list<item: list<item: float>>>> for extension type extension<arrow.py_extension_type<Array3DExtensionType>> ``` ## Steps to reproduce the bug ```python # Sample code to reproduce the bug ``` rom datasets import Features, Sequence, ClassLabel, Value, Array2D, Array3D from torchvision import transforms from transformers import AutoProcessor # we'll use the Auto API here - it will load LayoutLMv3Processor behind the scenes, # based on the checkpoint we provide from the hub from datasets import load_dataset def prepare_examples(examples): #Some preporcessing for each image and text as all my data saved in cloud encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, truncation=True, padding="max_length") # encoding['pixel_values']=np.array(encoding['pixel_values']) return encoding dataset = load_dataset("json", data_files='issues.jsonl') processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) features = dataset["train"].features column_names = dataset["train"].column_names # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) train_dataset = dataset["train"].map( prepare_examples, batched=False, remove_columns=column_names, features=features ) ## Expected results A clear and concise description of the expected results. Expected would be similar to all the otherdatasets with no error. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Unix - Python version: 3.9 - PyArrow version: 9.0.0 > Hi! Our processors are meant to be used in `batched` mode, so if `batched` is `False`, you need to drop the batch dimension (the error message warns you that the array has an extra dimension meaning it's 4D instead of 3D) to avoid the error: > > ```python > def prepare_examples(examples): > #Some preporcessing for each image and text as all my data saved in cloud > #For this reason I couldn't set the batch to True. > encoding = processor(img_as_tensor, words, boxes=boxes, word_labels=labels, > truncation=True, padding="max_length", return_tensors="np") > # drop extra dim > for k in encoding.items(): > encoding[k]=encoding[k][0] > return encoding > ``` Thank you it did work ``` for k,v in encoding.items(): encoding[k]=encoding[k][0] ```
[ -0.20834654569625854, -0.19214779138565063, -0.07093651592731476, 0.3017364740371704, 0.1363687813282013, 0.010352909564971924, 0.46729496121406555, 0.29022735357284546, -0.006736405193805695, 0.08248203992843628, 0.2620529234409332, 0.2601095139980316, -0.3658747375011444, 0.10612642019987106, -0.1939835101366043, -0.13611891865730286, 0.12819717824459076, 0.15568187832832336, 0.08351049572229385, -0.05229887738823891, -0.37254640460014343, 0.2696443498134613, -0.39679962396621704, -0.01995871216058731, -0.27080968022346497, -0.26611143350601196, 0.11320774257183075, 0.06582117825746536, 0.021621333435177803, -0.4727208912372589, 0.2019696682691574, -0.144547700881958, 0.0927063524723053, 0.5755273699760437, -0.00010804566409206018, 0.07630796730518341, 0.39184027910232544, -0.14079859852790833, -0.17180173099040985, 0.029579997062683105, -0.23113948106765747, -0.2274019569158554, -0.09832475334405899, -0.2862984836101532, -0.14945164322853088, -0.10565191507339478, -0.41946789622306824, -0.48956555128097534, 0.4759349226951599, 0.4369571805000305, 0.20677442848682404, 0.23184296488761902, -0.1861504167318344, 0.04440690204501152, 0.14138147234916687, 0.4534000754356384, -0.24079476296901703, -0.004695327952504158, 0.20504504442214966, -0.12778590619564056, 0.09078855067491531, 0.3688371777534485, -0.2788374125957489, 0.06656855344772339, 0.08570162951946259, 0.011253011412918568, -0.16816192865371704, -0.35695984959602356, -0.03806723654270172, 0.08807631582021713, 0.3638947904109955, -0.3429868817329407, -0.15481840074062347, -0.3195023238658905, -0.044954441487789154, -0.4049772322177887, 0.21028468012809753, 0.23783430457115173, -0.21513110399246216, 0.0018149949610233307, -0.432066947221756, 0.16449326276779175, -0.3063034415245056, 0.013380330055952072, 0.12626132369041443, 0.24812236428260803, -0.009195948950946331, 0.18141603469848633, -0.1814432442188263, -0.161227285861969, 0.5357674956321716, -0.09318196773529053, -0.28945720195770264, 0.11888296157121658, -0.18007497489452362, -0.3342793881893158, -0.03645903617143631, -0.5437409281730652, 0.1920487880706787, -0.05011401325464249, 0.2795565724372864, -0.14336836338043213, 0.07942043244838715, 0.0795736312866211, 0.07147060334682465, 0.42397648096084595, 0.10471753776073456, 0.12171638756990433, 0.18481141328811646, 0.025746487081050873, 0.05112322047352791, 0.14913195371627808, 0.09935939311981201, -0.22360117733478546, -0.03261203318834305, 0.400411456823349, 0.3135186433792114, 0.21025779843330383, -0.3193154036998749, 0.2186751365661621, -0.1607549786567688, 0.019563594833016396, 0.1178876981139183, 0.10181137919425964, 0.07698488980531693, -0.22379738092422485, 0.09639282524585724, 0.32166945934295654, -0.16262935101985931, 0.05986349657177925, -0.059476204216480255, 0.12578050792217255, -0.13638249039649963, -0.1594495326280594, 0.3256594240665436, 0.16812492907047272, 0.44578057527542114, -0.06256001442670822, -0.11642684042453766, -0.036149632185697556, 0.05964340269565582, -0.11973477900028229, 0.06922812759876251, 0.1519615650177002, 0.07959865033626556, -0.009830078110098839, 0.1567259132862091, 0.29287004470825195, -0.17962409555912018, 0.26285669207572937, -0.1264159083366394, -0.22301636636257172, -0.17060723900794983, 0.15860126912593842, -0.10535285621881485, -0.0814821645617485, -0.22615715861320496, 0.007721152156591415, 0.1267121285200119, 0.24386441707611084, 0.2728036344051361, -0.1522001326084137, -0.035966984927654266, -0.20363731682300568, -0.2271828055381775, 0.3908078670501709, -0.5186535120010376, 0.23437079787254333, 0.21900995075702667, -0.11158283054828644, 0.045043304562568665, 0.10966777801513672, -0.20696839690208435, 0.4299637973308563, -0.20896723866462708, 0.1115490198135376, 0.18395821750164032, -0.5709853768348694, -0.30601972341537476, 0.2569400370121002, -0.03263310343027115, -0.055586934089660645, 0.08930642902851105, 0.08096133172512054, 0.23541618883609772, 0.03387339040637016, 0.36932775378227234, 0.39139753580093384, 0.03693417087197304, 0.28912967443466187, 0.005873978137969971, -0.23992067575454712, -0.016278032213449478, 0.11636357009410858, -0.116042360663414, 0.07869885116815567, 0.07106658816337585, -0.16949647665023804, 0.03757098317146301, -0.19792026281356812, 0.08371791988611221, 0.3743463158607483, 0.20749638974666595, -0.14828000962734222, -0.0642460435628891, 0.12911638617515564, -0.7534002065658569, 0.19592386484146118, -0.03274986147880554, 0.07853801548480988, -0.21649764478206635, 0.00868198648095131, -0.20862337946891785, 0.03560841828584671, -0.32380762696266174, -0.29122886061668396, 0.19709932804107666, 0.11013610661029816, 0.009491514414548874, -0.14032599329948425, -0.19408561289310455, 0.1287812441587448, 0.13352636992931366, 0.008249578066170216, -0.34945976734161377, 0.05603761225938797, 0.00913565419614315, -0.3722446858882904, 0.04881006479263306, 0.2996279001235962, 0.2768683135509491, -0.18727046251296997, -0.2445860207080841, 0.2293699085712433, 0.1388987898826599, -0.18653149902820587, -0.18364283442497253, -0.2543954849243164, 0.08427365124225616, -0.06153004616498947, 0.18674351274967194, 0.12191079556941986, -0.0334421843290329, -0.015909194946289062, -0.2986679971218109, 0.41117894649505615, 0.03412310406565666, -0.017292805016040802, -0.2736964225769043, 0.04516681283712387, 0.43860071897506714, -0.04134425148367882, -0.17421665787696838, -0.42699190974235535, 0.09095332026481628, 0.2326970398426056, 0.12580065429210663, -0.029633285477757454, -0.284757524728775, -0.11058209091424942, 0.4891364276409149, 0.10176534950733185, 0.13756796717643738, 0.11007325351238251, -0.1256922483444214, 0.07284912467002869, 0.1824343204498291, 0.06590375304222107, 0.4652823805809021, 0.15108954906463623, -0.4143766760826111, 0.139946848154068, -0.049406129866838455, 0.031450819224119186, 0.06584928929805756, -0.05780142545700073, 0.3956039249897003, 0.1328897327184677, 0.47336775064468384, -0.1183888241648674, -0.18921422958374023, -0.5483927130699158, -0.010478222742676735, 0.21131183207035065, -0.24281570315361023, -0.009387149475514889, -0.05035515874624252, 0.04363229125738144, -0.1274692863225937, -0.35825300216674805, -0.08179472386837006, 0.017021212726831436, 0.10702860355377197, 0.16851931810379028, -0.13589462637901306, 0.20866800844669342, -0.1280115842819214, 0.2778323292732239, 0.29283997416496277, -0.594900906085968, -0.1209394782781601, -0.06480485945940018, -0.13302379846572876, -0.024397797882556915, 0.005179575644433498, -0.1078273132443428, 0.3854863941669464, 0.09968343377113342, -0.07971950620412827, -0.32521092891693115, 0.13888922333717346, 0.17672526836395264, -0.35716408491134644, 0.3303596079349518, 0.3128097653388977, 0.025522761046886444, 0.1640569269657135, -0.22523042559623718, 0.3480716347694397, 0.14525030553340912, -0.14485511183738708, 0.08590930700302124, 0.1203513890504837, -0.22649969160556793, -0.1332072764635086, -0.17669221758842468, -0.1454014927148819, -0.25570496916770935, -0.013021118938922882, 0.02585618570446968, 0.21563716232776642, 0.08814852684736252, 0.3850661516189575, 0.02004145458340645, 0.2704215347766876, -0.3319969177246094, -0.0863732323050499, -0.41752177476882935, 0.156704843044281, -0.44044870138168335, -0.1116388738155365, 0.04503782466053963, -0.14177864789962769, 0.3090337812900543, 0.1711735874414444, -0.4524582028388977, -0.15686659514904022, -0.09798514097929001, 0.3559427559375763, -0.1606745719909668, -0.25012773275375366, 0.44078031182289124, 0.2652813494205475, -0.06718600541353226, -0.3844296932220459, -0.25547754764556885, 0.14842453598976135, 0.22818848490715027, 0.36362871527671814, 0.18093299865722656, 0.5892195701599121, -0.12106968462467194, 0.6568952798843384, 0.259938508272171, -0.41289475560188293, 0.5111069679260254, -0.0746266171336174, 0.06048297509551048, -0.12420115619897842, -0.3102731704711914, -0.02877429872751236, 0.1793432980775833, 0.021856438368558884, 0.049327436834573746, -0.12574484944343567, -0.21492107212543488, -0.042923279106616974, 0.1364699751138687, -0.4556695222854614, 0.08083271980285645, 0.10206983983516693, -0.14893968403339386, 0.26005545258522034, -0.20809850096702576, 0.15303358435630798, -0.34948858618736267, -0.05537877604365349, -0.06537947058677673, -0.14477692544460297, 0.018386751413345337, -0.07778855413198471, -0.41003671288490295, -0.18795126676559448, -0.4413605332374573, 0.34768426418304443, 0.03623579442501068, 0.572516918182373, -0.14343073964118958, 0.2559962570667267, -0.03991454839706421, 0.03585869446396828, 0.8049381375312805, -0.5426613688468933, 0.11000578850507736, 0.1841660737991333, 0.09138570725917816, -0.21188269555568695, -0.16434721648693085, -0.12373973429203033, 0.27879321575164795, 0.2554120719432831, 0.6133710145950317, -0.013485051691532135, -0.28337427973747253, 0.27491068840026855, -0.11965545266866684, -0.04593884199857712, -0.2571573853492737, -0.28374409675598145, -0.4256570339202881, -0.3298899829387665, 0.09290305525064468, 0.31202390789985657, 0.27389460802078247, -0.008262614719569683, -0.3633234202861786, -0.19935119152069092, -0.17285767197608948, -0.1626768261194229, 0.08727498352527618, 0.22620102763175964, 0.09738802909851074, 0.10662855207920074, -0.17533664405345917, 0.34966593980789185, 0.4076649248600006, 0.3062269687652588, 0.20573346316814423, -0.2564646005630493, -0.04935961961746216, -0.14870822429656982, 0.16115155816078186, 0.22502678632736206, -0.10586478561162949, -0.15959569811820984, -0.21014809608459473, 0.12016314268112183, -0.2307363897562027, -0.04610789194703102, 0.3829733431339264, -0.024834129959344864, -0.36855974793434143, -0.10074363648891449, 0.3651706576347351, -0.039949070662260056, 0.1765245944261551, 0.02727779746055603, -0.24407131969928741, -0.3984123766422272, 0.5601291656494141, 0.3253641426563263, 0.47756069898605347, 0.2457612305879593, 0.041420161724090576, 0.38753542304039, 0.09479540586471558, 0.37535443902015686, -0.13222211599349976, 0.3745805025100708, -0.32352232933044434, 0.25527000427246094, -0.09772588312625885, -0.22534310817718506, 0.32168906927108765, 0.160474956035614, -0.12076312303543091, 0.14376558363437653, -0.07795383781194687, 0.03470053896307945, -0.26684805750846863, 0.02091488242149353, 0.008805959485471249, -0.3459343910217285, -0.26492708921432495, 0.13968536257743835, -0.13051271438598633, 0.24520383775234222, -0.08179689198732376, -0.23828715085983276, -0.30025365948677063, -0.38303661346435547, -0.28509753942489624, 0.13862836360931396, -0.2189042568206787, 0.060671787708997726, -0.0362403579056263, -0.434359073638916, 0.09043765068054199, 0.2632535398006439, 0.4742158055305481, 0.015775039792060852, -0.1252250075340271, 0.04983271658420563, 0.18035611510276794, 0.11503283679485321, 0.009035337716341019, -0.16265572607517242, 0.19068625569343567, -0.09258969873189926, -0.25753843784332275, 0.11541678011417389, -0.13926292955875397, -0.16851545870304108, -0.09177722036838531, 0.052764393389225006, -0.043492287397384644, -0.35326841473579407, -0.32816189527511597, -0.18584555387496948, 0.09419982135295868, -0.17635893821716309, 0.12344034016132355, -0.09434086084365845, 0.07123906165361404, 0.392794668674469, -0.37039628624916077, -0.2595943212509155, -0.07336318492889404, 0.12303553521633148, 0.0893418937921524, -0.2129756212234497, 0.5406461954116821, 0.20943309366703033, 0.011971559375524521, -0.3053429424762726, 0.29945042729377747, 0.261603444814682, -0.35770854353904724, 0.2695651650428772, -0.031007038429379463, -0.2926179766654968, 0.10998999327421188, 0.4537999927997589, -0.09300720691680908, 0.0828007310628891, 0.3605426847934723, -0.25307244062423706, -0.2551656663417816, 0.004023268818855286, -0.12120814621448517, 0.3238060772418976, 0.17638632655143738, 0.5300185680389404, 0.05003637820482254, -0.15856094658374786, -0.3236534595489502, 0.010787565261125565, -0.23462481796741486, 0.1670340895652771, -0.11640970408916473, 0.3176345229148865, 0.01570024900138378, 0.2905556857585907, 0.09155797213315964, 0.1326434314250946, -0.19401614367961884, -0.22999730706214905, -0.1537979692220688, 0.10144331306219101, 0.19233477115631104, -0.17737962305545807, -0.10853802412748337, -0.2009650468826294, -0.23456668853759766, -0.11592116951942444, 0.08597080409526825, 0.10292146354913712, 0.05103979632258415, 0.24005244672298431, -0.04930954799056053, 0.20448246598243713, 0.29770660400390625, -0.10206423699855804, -0.061047837138175964, 0.09994375705718994, 0.09457984566688538, 0.0813211053609848, -0.00904393196105957, -0.010632447898387909, -0.28637269139289856, -0.10534193366765976, 0.07549796998500824, 0.5330377221107483, -0.0036313384771347046, -0.4115622639656067, -0.1598648875951767, 0.08657187968492508, 0.2531382739543915, -0.13967782258987427, -0.5220974683761597, -0.3394886553287506, 0.3919987380504608, 0.20369276404380798, -0.22652658820152283, -0.1971469223499298, 0.11845444142818451, 0.032385725528001785, 0.12936770915985107, 0.3150278925895691, 0.060308050364255905, 0.09094606339931488, -0.19757179915905, 0.0758059024810791, 0.6225699782371521, -0.17217867076396942, 0.1936982274055481, 0.1631033718585968, -0.3004089295864105, 0.01502186432480812, 0.3513562083244324, 0.14950478076934814, 0.33896318078041077, 0.7323397994041443, 0.2295255959033966, 0.15372058749198914, 0.5350487232208252, 0.08491761982440948, -0.21041962504386902, -0.17815379798412323, 0.039907198399305344, -0.23651579022407532, 0.1692606806755066, 0.25735095143318176, 0.014513477683067322, -0.11349117010831833, -0.16036538779735565, 0.0035423061344772577, -0.3032759428024292, 0.15552422404289246, -0.11628460139036179, -0.013694358058273792, -0.37638741731643677, -0.03385843709111214, 0.45155641436576843, -0.020104987546801567, -0.10755947232246399, -0.04503718018531799, -0.009694121778011322, -0.05090038478374481, -0.31461429595947266, -0.1736508160829544, 0.18212494254112244, 0.1847776472568512, -0.0684497281908989, -0.222757026553154, 0.2622445523738861, 0.08474477380514145, -0.020030878484249115, -0.02714904025197029, 0.348085880279541, 0.36781594157218933, 0.5542567372322083, -0.15402692556381226, -0.10761629045009613, -0.1661897897720337, -0.02515983209013939, -0.06698839366436005, 0.1202908307313919, 0.09949395805597305, -0.12716734409332275, 0.16114702820777893, 0.14388513565063477, -0.10940659791231155, 0.13278624415397644, 0.24005095660686493, -0.023366030305624008, 0.004610367119312286, 0.06100033223628998, -0.07642585784196854, -0.08519071340560913, -0.07230351865291595, -0.1258021891117096, -0.3717544674873352, -0.016557063907384872, 0.393812358379364, 0.08481835573911667, 0.3812922239303589, 0.015302238054573536, 0.0997445285320282, -0.40397199988365173, 0.43727579712867737, 0.07520665228366852, -0.1323000192642212, -0.31263303756713867, 0.03149130940437317, -0.20256134867668152, -0.0034139081835746765, -0.2711534798145294, -0.17578694224357605, 0.021727006882429123, 0.11864674091339111, -0.176477313041687, -0.08381404727697372, 0.10569775849580765, 0.14373837411403656, -0.016002142801880836, 0.35659778118133545, -0.4804363250732422, -0.10293926298618317, -0.10372503101825714, 0.26788389682769775, 0.25916391611099243, -0.3572003245353699, 0.04965674877166748, 0.30527955293655396, 0.04706701636314392, -0.2713106870651245, -0.013190243393182755, 0.094137042760849, 0.1266779899597168, 0.477376788854599, 0.19683845341205597, 0.20216359198093414, -0.039194732904434204, -0.06011325120925903, -0.404623806476593, -0.23112092912197113, -0.231686070561409, -0.043915025889873505, 0.41292282938957214, 0.5470551252365112, -0.15337976813316345, 0.12948167324066162, -0.3442254960536957, 0.20304009318351746, 0.1459338217973709, 0.04875688999891281, -0.18787792325019836, 0.42801806330680847, -0.1697850227355957, 0.12457779794931412, -0.008480104617774487, 0.10869412124156952, -0.0032558180391788483, 0.45111122727394104, -0.41650038957595825, -0.34833794832229614, 0.5640298128128052, -0.36351481080055237, -0.4746747612953186, 0.27521437406539917, 0.0920015424489975, -0.0281054750084877, -0.08454521000385284, -0.181911438703537, 0.25886884331703186, 0.26475173234939575, -0.04366642236709595, -0.12926360964775085, 0.1684519350528717, -0.08182874321937561, -0.15253320336341858, 0.18053440749645233, 0.16559015214443207, 0.20223397016525269, -0.12274423986673355, 0.07835143804550171, -0.06589241325855255 ]
https://github.com/huggingface/datasets/issues/5021
Split is inferred from filename and overrides metadata.jsonl
Hi! What's the structure of your image folder? `datasets` by default tries to infer to what split each file belongs based on directory/file names. If it's OK to load all the images inside the `dataset` folder in the `train` split, you can do the following: ```python dataset = load_dataset("imagefolder", data_files="dataset/**") ```
## Describe the bug Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files. This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder ## Steps to reproduce the bug `metadata.jsonl` ```json {"file_name": "photo of a cat.jpg", "text": "a photo of a cat"} {"file_name": "photo of a dog.jpg", "text": "a photo of a dog"} {"file_name": "photo of a train.jpg", "text": "a photo of a train"} {"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"} ``` `bug.py` ```python from datasets import load_dataset dataset = load_dataset("dataset") print(dataset) # DatasetDict({ # train: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # test: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # }) for split in dataset: for n in dataset[split]: print(n['text']) # a photo of a train # a photo of test tubes ``` ## Expected results One single dataset with all four images / a warning for unused files / documentation of this behavior ## Actual results Only the images with "test" or "train" in the name are loaded ## Environment info - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.10.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
51
Split is inferred from filename and overrides metadata.jsonl ## Describe the bug Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files. This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder ## Steps to reproduce the bug `metadata.jsonl` ```json {"file_name": "photo of a cat.jpg", "text": "a photo of a cat"} {"file_name": "photo of a dog.jpg", "text": "a photo of a dog"} {"file_name": "photo of a train.jpg", "text": "a photo of a train"} {"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"} ``` `bug.py` ```python from datasets import load_dataset dataset = load_dataset("dataset") print(dataset) # DatasetDict({ # train: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # test: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # }) for split in dataset: for n in dataset[split]: print(n['text']) # a photo of a train # a photo of test tubes ``` ## Expected results One single dataset with all four images / a warning for unused files / documentation of this behavior ## Actual results Only the images with "test" or "train" in the name are loaded ## Environment info - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.10.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 Hi! What's the structure of your image folder? `datasets` by default tries to infer to what split each file belongs based on directory/file names. If it's OK to load all the images inside the `dataset` folder in the `train` split, you can do the following: ```python dataset = load_dataset("imagefolder", data_files="dataset/**") ```
[ 0.05747763440012932, 0.021085694432258606, -0.06381215155124664, 0.5179053544998169, 0.11288314312696457, 0.1870461404323578, 0.3881393074989319, 0.3922385573387146, 0.016799572855234146, 0.21734026074409485, -0.12034709006547928, 0.39183947443962097, -0.20038187503814697, 0.042342640459537506, -0.34279578924179077, -0.07467302680015564, -0.003667764365673065, 0.2427329421043396, 0.07496612519025803, -0.08889970928430557, -0.35554030537605286, 0.2770126461982727, -0.06338109821081161, -0.218137726187706, -0.46282467246055603, -0.04630987346172333, -0.12433178722858429, 0.3151033818721771, -0.1720346212387085, -0.08873078972101212, -0.18981219828128815, 0.03990451246500015, -0.207044318318367, 0.466690331697464, -0.00011107699538115412, -0.07286176830530167, 0.11430801451206207, -0.08789561688899994, -0.22021484375, -0.49817782640457153, -0.20613300800323486, 0.04604344815015793, 0.12108072638511658, -0.4429154396057129, 0.08787446469068527, -0.3503355383872986, 0.05725259706377983, -0.2713488042354584, 0.4142521023750305, 0.00044132210314273834, 0.19227781891822815, -0.056293148547410965, -0.18009936809539795, 0.15787982940673828, 0.24891984462738037, 0.5415292382240295, -0.019718743860721588, 0.08122038841247559, -0.16562551259994507, -0.04460292309522629, -0.1433131992816925, 0.5199835896492004, -0.05556552857160568, 0.20492424070835114, 0.046317584812641144, 0.31117409467697144, -0.37996402382850647, -0.4601993262767792, 0.061803288757801056, 0.21646615862846375, 0.08608956634998322, -0.015440031886100769, -0.31407269835472107, -0.602224588394165, -0.15821054577827454, -0.10143065452575684, 0.28337886929512024, 0.3541104793548584, 0.03270908445119858, 0.039022862911224365, -0.21681807935237885, 0.05785766988992691, 0.03713817894458771, 0.20816390216350555, -0.07204194366931915, 0.1607273519039154, -0.24058891832828522, 0.2044692039489746, 0.1320171058177948, -0.0034442581236362457, -0.1441357284784317, -0.3300612270832062, 0.010079465806484222, -0.06821074336767197, -0.011338185518980026, 0.06254047900438309, 0.03646131604909897, -0.1307072937488556, 0.2125367820262909, 0.0732395127415657, -0.0794973224401474, -0.20242351293563843, -0.2866383492946625, 0.19752678275108337, 0.35495901107788086, -0.10363122820854187, 0.10305395722389221, 0.24303196370601654, 0.18582604825496674, 0.20866790413856506, -0.14863520860671997, -0.13814863562583923, 0.11575917899608612, -0.02059280127286911, -0.08321788907051086, -0.27787137031555176, 0.48244112730026245, 0.09070922434329987, -0.3937476575374603, -0.2964401841163635, -0.3645518720149994, -0.2740849256515503, -0.005333405919373035, 0.2232641577720642, 0.10231465846300125, 0.18430030345916748, 0.11272367835044861, 0.14304202795028687, -0.06562870740890503, 0.1170768216252327, -0.28488194942474365, 0.06356946378946304, -0.04705391451716423, 0.07596798986196518, 0.09193825721740723, -0.015579946339130402, 0.33016327023506165, -0.04480989649891853, 0.03717854991555214, -0.20417021214962006, 0.06915995478630066, -0.29865190386772156, 0.19646495580673218, 0.23653511703014374, 0.05609618499875069, 0.2998049557209015, 0.14124582707881927, -0.11469599604606628, -0.15417706966400146, -0.03757321089506149, -0.3838989734649658, 0.13199292123317719, 0.05962798744440079, 0.1878306269645691, -0.24304814636707306, 0.10208284854888916, -0.44596776366233826, 0.11686225235462189, -0.04516906291246414, 0.1688832938671112, 0.13471995294094086, 0.002605719491839409, -0.12116877734661102, -0.2375427633523941, 0.1332901567220688, 0.4482770562171936, -0.21641209721565247, -0.1602398157119751, -0.033279456198215485, -0.1756151020526886, 0.000347137451171875, 0.3090393543243408, -0.0678906962275505, 0.16513004899024963, -0.3426954746246338, 0.33874350786209106, 0.13945019245147705, -0.43411675095558167, -0.1253013014793396, 0.28581032156944275, -0.11771764606237411, 0.25711584091186523, 0.123627670109272, 0.03770062327384949, 0.04415415972471237, 0.14200663566589355, -0.026526376605033875, 0.48463648557662964, -0.03833014518022537, 0.13532571494579315, 0.05356065556406975, -0.312089741230011, 0.004691861569881439, 0.16926369071006775, -0.14969024062156677, -0.04326934367418289, 0.07147252559661865, 0.003248918801546097, 0.41855183243751526, -0.052827414125204086, 0.2530817985534668, 0.2626890540122986, 0.26849427819252014, 0.16508382558822632, 0.18230608105659485, -0.3306855857372284, -0.4760946035385132, 0.07609102874994278, 0.42500489950180054, -0.068548783659935, -0.6294102668762207, -0.101532943546772, -0.05780414119362831, -0.13792113959789276, -0.42206522822380066, -0.2116616666316986, 0.1266424059867859, 0.29318153858184814, -0.13206270337104797, 0.05462469533085823, -0.2514204978942871, 0.37581899762153625, 0.004005784168839455, 0.3947492241859436, -0.3341997563838959, 0.2608239948749542, -0.045638494193553925, 0.006036181468516588, -0.008029639720916748, -0.00975840538740158, -0.0074908435344696045, -0.29206591844558716, -0.004007790237665176, 0.5726562142372131, 0.3680267035961151, 0.17900502681732178, 0.09460742026567459, -0.0630059540271759, 0.18652930855751038, -0.22976543009281158, -0.14692933857440948, 0.1618511974811554, 0.22276414930820465, -0.10377291589975357, -0.4484464228153229, 0.2689477205276489, -0.37283480167388916, 0.2778524160385132, -0.030750125646591187, -0.20319192111492157, 0.09412708878517151, -0.1491980403661728, -0.1389015167951584, -0.5212666988372803, -0.10026079416275024, -0.01930815726518631, 0.29058197140693665, 0.08991840481758118, -0.1914834976196289, -0.18673783540725708, 0.8372687697410583, 0.006339244544506073, 0.0009278655052185059, 0.04193941131234169, 0.00508745014667511, 0.0695391520857811, -0.02227078191936016, 0.36319005489349365, 0.4943411350250244, 0.25952062010765076, 0.07076375931501389, -0.013255910947918892, 0.2111763060092926, -0.25319695472717285, 0.19080904126167297, 0.28084129095077515, 0.10568010061979294, 0.11141982674598694, 0.355936199426651, -0.020737018436193466, -0.495705246925354, -0.30710747838020325, 0.09068960696458817, 0.009625730104744434, -0.06658703833818436, 0.18438322842121124, -0.3597046434879303, -0.17450138926506042, -0.18586155772209167, -0.175789937376976, -0.3200402855873108, -0.23709596693515778, 0.04661568999290466, 0.09355923533439636, -0.1796061098575592, 0.09374158829450607, -0.011441079899668694, 0.14546191692352295, 0.1153344213962555, -0.29685863852500916, -0.36835965514183044, 0.16477841138839722, -0.10955937951803207, 0.0664634108543396, 0.0926215872168541, 0.04030534252524376, 0.3231256306171417, -0.09374134242534637, -0.11976021528244019, -0.22395895421504974, -0.33885860443115234, 0.23985958099365234, -0.4298744201660156, 0.12927475571632385, 0.3096836805343628, 0.04632749408483505, 0.18518191576004028, -0.22654782235622406, 0.3319515585899353, 0.012488773092627525, -0.2111017107963562, -0.19586089253425598, 0.2988160252571106, 0.2606916129589081, -0.36461472511291504, -0.424640029668808, 0.008376752957701683, -0.38766512274742126, 0.5470055341720581, 0.15439638495445251, 0.08390071988105774, 0.28310781717300415, 0.0529237799346447, 0.07051777839660645, -0.37770503759384155, 0.014340423978865147, -0.1888081133365631, -0.343743234872818, 0.23464831709861755, 0.03177477419376373, -0.07289053499698639, 0.03279339149594307, 0.028874460607767105, -0.024345573037862778, 0.0463196337223053, -0.44180548191070557, -0.4737880527973175, -0.24628545343875885, 0.20184332132339478, -0.028665758669376373, 0.10237883031368256, 0.04081333056092262, 0.15305764973163605, -0.0964195504784584, -0.34678128361701965, -0.12770798802375793, 0.13735386729240417, -0.08700259774923325, 0.13787046074867249, -0.11421702057123184, 0.3337746560573578, 0.230811208486557, 0.24072682857513428, -0.0008759107440710068, 0.09650532901287079, 0.3416297733783722, -0.18517576158046722, 0.4192868769168854, 0.021000325679779053, -0.31482061743736267, 0.03468133509159088, 0.08926982432603836, 0.07875417172908783, 0.346233993768692, 0.015015799552202225, 0.1661774218082428, -0.08263307809829712, 0.08887526392936707, -0.5361402034759521, -0.284934401512146, 0.02728429064154625, 0.3749415874481201, -0.026868171989917755, 0.0199846513569355, 0.0015348121523857117, 0.0344042032957077, 0.018309831619262695, -0.20230917632579803, 0.3428531289100647, 0.15810944139957428, -0.014954239130020142, -0.3727811872959137, 0.033377550542354584, 0.05218180641531944, 0.13005958497524261, -0.0317913182079792, 0.07439624518156052, -0.027582764625549316, -0.09396587312221527, 0.19034500420093536, -0.12603354454040527, 1.0326789617538452, -0.1018228605389595, -0.021033935248851776, 0.02267652377486229, -0.06782207638025284, -0.18031124770641327, 0.14917205274105072, -0.36498406529426575, 0.055562444031238556, 0.24299375712871552, 0.8519175052642822, -0.34228771924972534, -0.3192138075828552, 0.3183213770389557, 0.042949941009283066, -0.026976635679602623, -0.18755507469177246, -0.2973615229129791, -0.2827166020870209, -0.29100310802459717, -0.1460973024368286, 0.17873263359069824, 0.23612229526042938, 0.08196199685335159, -0.08597232401371002, 0.07862791419029236, -0.3835076093673706, 0.0778278261423111, 0.18675297498703003, 0.2096688151359558, -0.15309834480285645, 0.07413619756698608, 0.1909768432378769, 0.10794013738632202, 0.4459514021873474, 0.561138391494751, -0.27901461720466614, -0.3909221291542053, 0.11123403161764145, -0.29596009850502014, 0.19154596328735352, 0.3692795932292938, -0.22098122537136078, 0.042089007794857025, -0.11479805409908295, 0.28736376762390137, -0.2794158160686493, 0.3141663074493408, 0.605243980884552, -0.17092366516590118, -0.13894999027252197, -0.3696308732032776, 0.48263007402420044, 0.1931033581495285, 0.016577519476413727, 0.16833488643169403, 0.2101246863603592, -0.4745892882347107, 0.25309979915618896, -0.19752582907676697, 0.7504578828811646, 0.13982859253883362, 0.23992383480072021, 0.31348130106925964, -0.29568883776664734, 0.635811984539032, -0.14059343934059143, 0.10739676654338837, -0.16066808998584747, -0.04719733074307442, -0.009548379108309746, -0.052288759499788284, 0.20816871523857117, 0.27274954319000244, -0.02086612954735756, 0.23210810124874115, -0.14002211391925812, 0.13512204587459564, -0.21843957901000977, 0.2871305048465729, -0.36219730973243713, -0.23386234045028687, -0.3150324821472168, 0.15110887587070465, -0.04967449605464935, 0.10414929687976837, 0.17565885186195374, -0.1612294465303421, -0.1946597695350647, -0.31596672534942627, 0.10949181020259857, 0.11330116540193558, -0.08876916021108627, 0.0676451176404953, -0.016267843544483185, -0.14070534706115723, -0.03671472147107124, 0.017002888023853302, -0.03770909458398819, 0.05467600002884865, -0.019996384158730507, 0.29330214858055115, -0.2562694847583771, 0.17475304007530212, -0.18870888650417328, -0.10203232616186142, 0.24094875156879425, 0.17276442050933838, 0.10602623969316483, -0.2411850392818451, 0.0036198627203702927, -0.11633043736219406, -0.23194479942321777, 0.29312899708747864, -0.2397560030221939, -0.4110555052757263, -0.140613853931427, -0.12831102311611176, -0.02642633020877838, -0.2746678590774536, 0.12321940064430237, -0.07200877368450165, -0.13137678802013397, 0.277488112449646, -0.22881506383419037, -0.3935079574584961, -0.2563718855381012, 0.22789105772972107, 0.019082844257354736, 0.11246795952320099, 0.40503719449043274, -0.01853594183921814, -0.028347443789243698, -0.2873031795024872, 0.30978789925575256, 0.23369093239307404, -0.28975003957748413, 0.3005957305431366, 0.0875355675816536, -0.020499400794506073, 0.049908269196748734, 0.033810365945100784, -0.03871811181306839, 0.07939820736646652, -0.028770197182893753, -0.43904367089271545, 0.06338173896074295, 0.4021257162094116, -0.12914986908435822, 0.2151561826467514, 0.018488440662622452, 0.3614360988140106, 0.021038515493273735, 0.05534791946411133, -0.31270116567611694, 0.3244163393974304, -0.13541428744792938, 0.13744747638702393, 0.17052148282527924, 0.06332843005657196, 0.5320212244987488, 0.03367722034454346, 0.20110411942005157, 0.18319369852542877, -0.07800617069005966, -0.1823481321334839, -0.3242979347705841, 0.11616680771112442, 0.09457211941480637, 0.1743592619895935, -0.039199553430080414, -0.1889248788356781, -0.09116202592849731, -0.23204711079597473, 0.19605255126953125, 0.022468145936727524, 0.08614487946033478, 0.20842643082141876, 0.10524002462625504, -0.07624687999486923, 0.21861647069454193, -0.028805308043956757, -0.30881595611572266, 0.1720280945301056, 0.1772838830947876, 0.23852050304412842, -0.21520134806632996, 0.06084302067756653, -0.12513096630573273, -0.16130104660987854, 0.009902991354465485, 0.11445384472608566, 0.06371806561946869, -0.11560191214084625, -0.024872351437807083, -0.023134522140026093, 0.6420226097106934, 0.4044486880302429, -0.1932900846004486, -0.03884957358241081, -0.02336803823709488, 0.20935095846652985, -0.1262531578540802, -0.0410371869802475, 0.3092389702796936, 0.02822556346654892, 0.32845041155815125, 0.32050251960754395, -0.16571319103240967, 0.35163962841033936, -0.34438031911849976, -0.10367364436388016, 0.6769863367080688, -0.02889903634786606, 0.1781618893146515, 0.42280855774879456, -0.2421281635761261, 0.125732883810997, 0.4443724751472473, 0.196013405919075, 0.21794214844703674, 0.719531774520874, -0.025827810168266296, 0.3736288845539093, -0.0750005915760994, -0.009702619165182114, 0.29963403940200806, -0.12364324927330017, -0.07584133744239807, 0.1964234858751297, 0.006667397916316986, 0.15597546100616455, -0.23731592297554016, 0.31194427609443665, -0.2893785238265991, 0.07207963615655899, 0.1549168825149536, 0.27992305159568787, -0.01071716845035553, -0.11526679992675781, -0.07003330439329147, -0.20941656827926636, -0.32874730229377747, -0.05627427250146866, 0.040670379996299744, -0.41933512687683105, 0.22921858727931976, 0.14208146929740906, -0.0946846753358841, -0.316484659910202, -0.1872355043888092, -0.017956994473934174, 0.19783776998519897, -0.36788424849510193, 0.13661795854568481, 0.21472612023353577, 0.037320785224437714, 0.25064894556999207, 0.2805437445640564, 0.21515028178691864, -0.007622525095939636, 0.22481361031532288, -0.16816629469394684, -0.2563675045967102, -0.23095890879631042, -0.18071024119853973, 0.14744240045547485, -0.027926936745643616, 0.054874055087566376, 0.3049025535583496, 0.24904793500900269, -0.24900470674037933, -0.14703898131847382, 0.2124233990907669, 0.034363001585006714, -0.493092805147171, 0.35258328914642334, -0.35422638058662415, 0.03446625918149948, -0.12864090502262115, -0.28144949674606323, -0.5879395604133606, -0.12084050476551056, 0.16206352412700653, -0.06049337610602379, 0.1279735565185547, 0.033648792654275894, 0.08273665606975555, -0.028955280780792236, 0.12748229503631592, 0.07149813324213028, 0.00923721119761467, 0.022052930667996407, -0.13140428066253662, -0.5373345613479614, -0.08689824491739273, -0.24775174260139465, -0.30807939171791077, -0.14350810647010803, 0.3566555082798004, 0.01925913244485855, -0.06980754435062408, 0.1567242294549942, 0.15833544731140137, 0.06325113028287888, 0.07480999827384949, -0.3020098805427551, -0.08573111891746521, -0.00022251158952713013, 0.010317095555365086, 0.11712493002414703, -0.2695121765136719, 0.10490407049655914, -0.009743355214595795, -0.03571055829524994, -0.12415206432342529, 0.05030181258916855, 0.003980476409196854, -0.0443519726395607, 0.005823269486427307, 0.2204216569662094, 0.1961817741394043, -0.2195580005645752, -0.2678424119949341, -0.3654858469963074, -0.24446894228458405, -0.38805314898490906, 0.2891182005405426, 0.20547328889369965, 0.73970627784729, -0.26586368680000305, -0.1036059707403183, -0.33254197239875793, 0.3625168800354004, -0.08440451323986053, 0.03811746463179588, -0.1905003786087036, 0.336739718914032, -0.15207767486572266, 0.2023870348930359, 0.0663532242178917, 0.38911527395248413, -0.07573944330215454, -0.0622042715549469, -0.33010393381118774, -0.5559859871864319, 0.4484957754611969, -0.34555289149284363, -0.44039186835289, 0.10553307086229324, 0.12380751222372055, 0.20981112122535706, -0.0382467582821846, -0.4275020658969879, 0.032512761652469635, 0.47391194105148315, 0.049179308116436005, -0.3151956796646118, 0.15219339728355408, 0.17445644736289978, -0.13712529838085175, -0.004530392587184906, -0.15129458904266357, 0.43408429622650146, -0.42760494351387024, 0.5718709230422974, -0.06142853945493698 ]
https://github.com/huggingface/datasets/issues/5021
Split is inferred from filename and overrides metadata.jsonl
Thanks! Specifying `data_files` worked for that case. I'm new to the library, so let me try rephrasing the issue. If there's no actual bug here, sorry for the trouble. I've uploaded an example [here](https://files.catbox.moe/nfj2pd.zip) with the following files: ``` . ├── bug.py └── imagefolder ├── test │ ├── metadata.jsonl │ ├── dog.jpg │ └── personal trainer.jpg └── train ├── metadata.jsonl ├── cat.jpg └── testing center.jpg ``` `bug.py` ``` from datasets import load_dataset dataset = load_dataset("imagefolder") print(dataset) # DatasetDict({ # test: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # }) for split in dataset: print("Split:", split) for n in dataset[split]: print(n['text']) # Split: test # testing center ``` As far as I can tell, this conforms with the example given here: https://huggingface.co/docs/datasets/image_dataset#imagefolder. It appears to me that, even though `metadata.jsonl` is present, the inferred labels from the path are taking precedent. Does this sound like a bug/undocumented behavior?
## Describe the bug Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files. This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder ## Steps to reproduce the bug `metadata.jsonl` ```json {"file_name": "photo of a cat.jpg", "text": "a photo of a cat"} {"file_name": "photo of a dog.jpg", "text": "a photo of a dog"} {"file_name": "photo of a train.jpg", "text": "a photo of a train"} {"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"} ``` `bug.py` ```python from datasets import load_dataset dataset = load_dataset("dataset") print(dataset) # DatasetDict({ # train: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # test: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # }) for split in dataset: for n in dataset[split]: print(n['text']) # a photo of a train # a photo of test tubes ``` ## Expected results One single dataset with all four images / a warning for unused files / documentation of this behavior ## Actual results Only the images with "test" or "train" in the name are loaded ## Environment info - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.10.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
150
Split is inferred from filename and overrides metadata.jsonl ## Describe the bug Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files. This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder ## Steps to reproduce the bug `metadata.jsonl` ```json {"file_name": "photo of a cat.jpg", "text": "a photo of a cat"} {"file_name": "photo of a dog.jpg", "text": "a photo of a dog"} {"file_name": "photo of a train.jpg", "text": "a photo of a train"} {"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"} ``` `bug.py` ```python from datasets import load_dataset dataset = load_dataset("dataset") print(dataset) # DatasetDict({ # train: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # test: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # }) for split in dataset: for n in dataset[split]: print(n['text']) # a photo of a train # a photo of test tubes ``` ## Expected results One single dataset with all four images / a warning for unused files / documentation of this behavior ## Actual results Only the images with "test" or "train" in the name are loaded ## Environment info - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.10.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 Thanks! Specifying `data_files` worked for that case. I'm new to the library, so let me try rephrasing the issue. If there's no actual bug here, sorry for the trouble. I've uploaded an example [here](https://files.catbox.moe/nfj2pd.zip) with the following files: ``` . ├── bug.py └── imagefolder ├── test │ ├── metadata.jsonl │ ├── dog.jpg │ └── personal trainer.jpg └── train ├── metadata.jsonl ├── cat.jpg └── testing center.jpg ``` `bug.py` ``` from datasets import load_dataset dataset = load_dataset("imagefolder") print(dataset) # DatasetDict({ # test: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # }) for split in dataset: print("Split:", split) for n in dataset[split]: print(n['text']) # Split: test # testing center ``` As far as I can tell, this conforms with the example given here: https://huggingface.co/docs/datasets/image_dataset#imagefolder. It appears to me that, even though `metadata.jsonl` is present, the inferred labels from the path are taking precedent. Does this sound like a bug/undocumented behavior?
[ 0.04267481341958046, 0.006399407982826233, -0.03466195985674858, 0.49726682901382446, 0.09559257328510284, 0.18740200996398926, 0.3946736752986908, 0.39690443873405457, -0.014018054120242596, 0.17116570472717285, -0.17858774960041046, 0.39359697699546814, -0.19119973480701447, 0.019231697544455528, -0.26419270038604736, -0.0905008465051651, 0.04315159469842911, 0.2224949449300766, 0.05234391242265701, -0.059688180685043335, -0.3422093987464905, 0.30404725670814514, -0.0928216427564621, -0.2301984578371048, -0.4732065200805664, -0.021391501650214195, -0.12883681058883667, 0.30325639247894287, -0.1526121199131012, -0.076637402176857, -0.14317181706428528, 0.03767959773540497, -0.22855126857757568, 0.45650824904441833, -0.00011316750897094607, -0.09429425001144409, 0.07911825180053711, -0.09720587730407715, -0.2306709587574005, -0.4894288182258606, -0.12126850336790085, 0.04631233215332031, 0.11909616738557816, -0.44025981426239014, 0.07031073421239853, -0.35868358612060547, 0.05732465162873268, -0.2216673195362091, 0.42090266942977905, 0.013824447058141232, 0.177606001496315, -0.01548338495194912, -0.1296197474002838, 0.15953128039836884, 0.29158392548561096, 0.5523689985275269, -0.03803423419594765, 0.12088434398174286, -0.09367027878761292, -0.019632777199149132, -0.1810908317565918, 0.4938274323940277, -0.08498397469520569, 0.2158437967300415, 0.0813426598906517, 0.32404541969299316, -0.4388374090194702, -0.3954206705093384, 0.05701378732919693, 0.27883195877075195, 0.05407039448618889, -0.06529604643583298, -0.33251360058784485, -0.6526978015899658, -0.18163436651229858, -0.11218974739313126, 0.29433539509773254, 0.3657354414463043, 0.01530740037560463, 0.02531217783689499, -0.21248877048492432, 0.08889205008745193, 0.03541870415210724, 0.1907997727394104, -0.03359798341989517, 0.12379324436187744, -0.2584648132324219, 0.2412228286266327, 0.15021325647830963, -0.003997813910245895, -0.2119790017604828, -0.27962443232536316, 0.036449678242206573, -0.04756997898221016, -0.05103461071848869, 0.07850883901119232, 0.046952344477176666, -0.11862017959356308, 0.29842644929885864, 0.0670037642121315, -0.12223061919212341, -0.18514114618301392, -0.2770479619503021, 0.18606314063072205, 0.3535069227218628, -0.088857501745224, 0.07164793461561203, 0.18146835267543793, 0.19943130016326904, 0.26583757996559143, -0.09390631318092346, -0.1362978219985962, 0.12693393230438232, -0.006546998396515846, -0.13388574123382568, -0.2941126823425293, 0.4738428592681885, 0.04159930720925331, -0.3712314963340759, -0.25072094798088074, -0.3744785487651825, -0.2469877302646637, -0.0074663711711764336, 0.24524354934692383, 0.09043382108211517, 0.15374916791915894, 0.13490186631679535, 0.12371314316987991, -0.08591396361589432, 0.063287153840065, -0.2813428044319153, 0.09285850822925568, -0.06361231207847595, 0.09003180265426636, 0.1329994797706604, -0.05093966796994209, 0.34945565462112427, 0.006440245546400547, 0.029448367655277252, -0.21730951964855194, 0.03400348126888275, -0.2757142186164856, 0.21498531103134155, 0.23136158287525177, 0.03556014969944954, 0.29663053154945374, 0.13564471900463104, -0.14335185289382935, -0.15688413381576538, -0.043478041887283325, -0.33951666951179504, 0.10304808616638184, 0.02960127964615822, 0.15435265004634857, -0.3118686079978943, 0.14600211381912231, -0.45593497157096863, 0.18143294751644135, -0.011457294225692749, 0.1460585743188858, 0.15206700563430786, 0.05737828463315964, -0.12364906072616577, -0.21870364248752594, 0.15690945088863373, 0.476223349571228, -0.20571017265319824, -0.20524346828460693, 0.036714106798172, -0.17352181673049927, -0.022327184677124023, 0.301795095205307, -0.06589073687791824, 0.10805001854896545, -0.3476220369338989, 0.3756740689277649, 0.09689127653837204, -0.39903801679611206, -0.07969562709331512, 0.2660788893699646, -0.11048050224781036, 0.32485681772232056, 0.1412484347820282, -0.022600790485739708, 0.014314781874418259, 0.12002295255661011, -0.009772434830665588, 0.45702552795410156, -0.029215099290013313, 0.09156874567270279, 0.033004116266965866, -0.3233735263347626, 0.010649019852280617, 0.1762002855539322, -0.10921788215637207, -0.060670457780361176, 0.06269513815641403, -0.015984201803803444, 0.4378066658973694, -0.06992997229099274, 0.2778674066066742, 0.23967526853084564, 0.24498821794986725, 0.2340787947177887, 0.17972253262996674, -0.3673408627510071, -0.5099923610687256, 0.0784650444984436, 0.4179258942604065, -0.05906452238559723, -0.6073468327522278, -0.14976371824741364, -0.02606426179409027, -0.14032384753227234, -0.3559325337409973, -0.2660404443740845, 0.09526310861110687, 0.27859777212142944, -0.1082543283700943, 0.11220787465572357, -0.2655613124370575, 0.35793137550354004, -0.018163543194532394, 0.4089415669441223, -0.42147424817085266, 0.23747675120830536, -0.0264053363353014, -0.012110418640077114, -0.03622330725193024, 0.0432153046131134, -0.010499320924282074, -0.304700642824173, 0.015589446760714054, 0.5949036478996277, 0.3212391436100006, 0.16340383887290955, 0.03606853634119034, -0.02174961566925049, 0.21560965478420258, -0.20907734334468842, -0.1665734499692917, 0.11646950244903564, 0.19022150337696075, -0.08676221966743469, -0.4294103682041168, 0.283389687538147, -0.38374269008636475, 0.2882617712020874, -0.02975044958293438, -0.1644611358642578, 0.08533632010221481, -0.17096570134162903, -0.1381138563156128, -0.4920114278793335, -0.0363435335457325, -0.07424846291542053, 0.2976847290992737, 0.08281560987234116, -0.25373804569244385, -0.18360984325408936, 0.8563569784164429, -0.015483828261494637, -0.011512115597724915, 0.038196295499801636, -0.009320557117462158, 0.05446325242519379, 0.034683432430028915, 0.3190042972564697, 0.4769025444984436, 0.23141354322433472, 0.039051271975040436, -0.007141368463635445, 0.20883232355117798, -0.23742462694644928, 0.19988584518432617, 0.3047913610935211, 0.01994488202035427, 0.09747353196144104, 0.3286292254924774, -0.022777222096920013, -0.5147771239280701, -0.2953588664531708, 0.10551849007606506, -0.008943511173129082, -0.11844637989997864, 0.18762576580047607, -0.34779369831085205, -0.1870775818824768, -0.21084924042224884, -0.17342133820056915, -0.35261768102645874, -0.2443103790283203, 0.039676483720541, 0.12522119283676147, -0.1997891664505005, 0.13828536868095398, 0.01736324280500412, 0.13672108948230743, 0.055155858397483826, -0.28040173649787903, -0.36191585659980774, 0.18386167287826538, -0.12886688113212585, 0.04945265129208565, 0.12701287865638733, 0.07226493954658508, 0.31332290172576904, -0.09887214004993439, -0.12524473667144775, -0.2567639648914337, -0.38938599824905396, 0.2540384531021118, -0.4625905752182007, 0.20712663233280182, 0.3439621329307556, 0.011455245316028595, 0.10492528975009918, -0.22588135302066803, 0.3467678129673004, -0.021227652207016945, -0.1691613346338272, -0.15693458914756775, 0.2897951602935791, 0.23818570375442505, -0.40264892578125, -0.3953913450241089, 0.0568515807390213, -0.39583438634872437, 0.6000741720199585, 0.09257355332374573, 0.0667206197977066, 0.3331535756587982, 0.02460062876343727, 0.1407000571489334, -0.38464125990867615, 0.05636115372180939, -0.21508465707302094, -0.3393198549747467, 0.22871331870555878, -0.004768822342157364, -0.0881069153547287, 0.03875039890408516, 0.04280858486890793, -0.03786386176943779, 0.042324140667915344, -0.45414525270462036, -0.4638526141643524, -0.20424993336200714, 0.19154822826385498, -0.009914238005876541, 0.11124688386917114, 0.03529631718993187, 0.1074754074215889, -0.06333934515714645, -0.370954304933548, -0.14857089519500732, 0.16757287085056305, -0.10999829322099686, 0.12643688917160034, -0.08057451248168945, 0.31361979246139526, 0.25362953543663025, 0.27869272232055664, 0.008997637778520584, 0.08517426252365112, 0.3287668526172638, -0.21007457375526428, 0.44421565532684326, 0.002989336848258972, -0.31952372193336487, 0.059470679610967636, 0.06732559204101562, 0.10795877873897552, 0.35184580087661743, 0.01882682740688324, 0.21554389595985413, -0.10072452574968338, 0.09350790083408356, -0.4879923462867737, -0.3402348458766937, 0.05845467746257782, 0.3990999758243561, -0.04366299510002136, 0.04601713642477989, -0.008905932307243347, 0.06294074654579163, -0.012729573994874954, -0.19042718410491943, 0.3584370017051697, 0.19444727897644043, 0.004892226308584213, -0.34087812900543213, 0.07338232547044754, -0.022962108254432678, 0.13720791041851044, -0.03354208916425705, 0.04764053225517273, -0.039737507700920105, -0.12728707492351532, 0.16948263347148895, -0.11154668033123016, 1.054085373878479, -0.019205132499337196, -0.02848341315984726, -0.00614914670586586, -0.10556583851575851, -0.22724026441574097, 0.13988980650901794, -0.32348012924194336, 0.022002125158905983, 0.2443029135465622, 0.8269380927085876, -0.42400217056274414, -0.32601842284202576, 0.3303943872451782, 0.05675823614001274, 0.03034902736544609, -0.19145925343036652, -0.28346335887908936, -0.2926904857158661, -0.30172139406204224, -0.13450321555137634, 0.2211289256811142, 0.22489915788173676, 0.05398734658956528, -0.11060956120491028, 0.0943838581442833, -0.34767499566078186, 0.11785078048706055, 0.16185683012008667, 0.21321389079093933, -0.13764090836048126, 0.10145176947116852, 0.19196757674217224, 0.1093163788318634, 0.4053398072719574, 0.5577152967453003, -0.2696840167045593, -0.4148879647254944, 0.11578232795000076, -0.264288067817688, 0.18870630860328674, 0.3947826325893402, -0.24903738498687744, 0.10169141739606857, -0.0939650908112526, 0.2855895757675171, -0.2836512327194214, 0.3247433602809906, 0.5603919625282288, -0.14688077569007874, -0.16414371132850647, -0.3514995872974396, 0.49180689454078674, 0.1995881050825119, 0.01831802725791931, 0.21944889426231384, 0.27835482358932495, -0.46147358417510986, 0.23180413246154785, -0.20382237434387207, 0.8087916970252991, 0.09916139394044876, 0.24976149201393127, 0.3399726152420044, -0.2715868055820465, 0.7078906297683716, -0.15469136834144592, 0.10015863925218582, -0.1602301448583603, -0.04167555645108223, -0.006269950419664383, -0.03906647115945816, 0.18197616934776306, 0.2080657035112381, -0.037520162761211395, 0.2251463234424591, -0.09439870715141296, 0.22458672523498535, -0.21774613857269287, 0.25084298849105835, -0.3302302360534668, -0.297858327627182, -0.32980066537857056, 0.1228468269109726, -0.05724663287401199, 0.09505917131900787, 0.18485084176063538, -0.1748146265745163, -0.21203166246414185, -0.33322060108184814, 0.08729642629623413, 0.10664885491132736, -0.09993423521518707, 0.05389903113245964, 0.028726473450660706, -0.13853153586387634, -0.014493390917778015, 0.018152404576539993, -0.0533825159072876, 0.06787199527025223, -0.04801506549119949, 0.2743002474308014, -0.29275184869766235, 0.16225272417068481, -0.16118274629116058, -0.10629983246326447, 0.2538406252861023, 0.17234644293785095, 0.133449524641037, -0.26618796586990356, -0.01697581633925438, -0.08635649085044861, -0.1994776427745819, 0.2914365530014038, -0.24979190528392792, -0.4389322102069855, -0.1342345029115677, -0.1421794891357422, 0.017556626349687576, -0.2812516987323761, 0.10527531802654266, -0.053542494773864746, -0.16132287681102753, 0.1994202435016632, -0.23537223041057587, -0.34806233644485474, -0.2844409644603729, 0.22397086024284363, -0.054067082703113556, 0.09742844104766846, 0.371225506067276, 0.01920628920197487, -0.019862795248627663, -0.23508703708648682, 0.23246514797210693, 0.270661860704422, -0.4219677448272705, 0.30116578936576843, 0.085988849401474, -0.023489728569984436, 0.027329448610544205, 0.07168680429458618, -0.05770353227853775, 0.08088207989931107, 0.008225634694099426, -0.420877069234848, 0.01833648420870304, 0.4243161082267761, -0.13598160445690155, 0.19460155069828033, 0.06561531871557236, 0.36968904733657837, 0.0036071892827749252, 0.05811426788568497, -0.28731441497802734, 0.3440821170806885, -0.1297205090522766, 0.18437716364860535, 0.18515419960021973, 0.04625958204269409, 0.5397271513938904, 0.031924426555633545, 0.16265077888965607, 0.24368171393871307, -0.10047263652086258, -0.1598741114139557, -0.37125256657600403, 0.1232001930475235, 0.10697487741708755, 0.12541070580482483, -0.01794184371829033, -0.13689857721328735, -0.10537616908550262, -0.2780095636844635, 0.2514176070690155, 0.04831188917160034, 0.07732564955949783, 0.18479007482528687, 0.0999438464641571, -0.07235594838857651, 0.1627381294965744, -0.03038032352924347, -0.2638426721096039, 0.15620803833007812, 0.19162330031394958, 0.22346194088459015, -0.29190677404403687, 0.09065952897071838, -0.10217731446027756, -0.1134461835026741, 0.00042179226875305176, 0.08756592124700546, 0.0656367614865303, -0.11584264039993286, -0.07553088665008545, 0.002514725085347891, 0.6499762535095215, 0.414570689201355, -0.18076355755329132, 0.011332137510180473, -0.021970093250274658, 0.17102383077144623, -0.1171875149011612, -0.008301768451929092, 0.37160325050354004, 0.03606163337826729, 0.3176090121269226, 0.33309420943260193, -0.09455656260251999, 0.3121356964111328, -0.2803148627281189, -0.10685235261917114, 0.644132673740387, 0.005930338054895401, 0.19491314888000488, 0.4521541893482208, -0.26461124420166016, 0.1500168889760971, 0.4135512411594391, 0.20099936425685883, 0.25908443331718445, 0.7015129327774048, -0.09951218217611313, 0.35201624035835266, -0.13691064715385437, 0.020736224949359894, 0.30565205216407776, -0.16891168057918549, -0.09126025438308716, 0.2298811674118042, 0.02381662279367447, 0.19205611944198608, -0.2736318111419678, 0.42251935601234436, -0.31247326731681824, 0.06190912052989006, 0.14343734085559845, 0.3045973777770996, -0.03823845833539963, -0.11932222545146942, -0.0017828084528446198, -0.19137930870056152, -0.341460257768631, -0.025524068623781204, 0.04788515344262123, -0.4383924603462219, 0.2626504600048065, 0.12614589929580688, -0.07587119936943054, -0.3251633942127228, -0.18479660153388977, -0.010286714881658554, 0.25280678272247314, -0.3479073941707611, 0.14866794645786285, 0.2785791754722595, -0.018211662769317627, 0.27711063623428345, 0.24977225065231323, 0.2454645186662674, -0.04428110271692276, 0.2651520073413849, -0.14526642858982086, -0.26604336500167847, -0.18770049512386322, -0.16533933579921722, 0.20145051181316376, 0.017620563507080078, 0.05820877104997635, 0.33646583557128906, 0.21088775992393494, -0.23272043466567993, -0.1802033931016922, 0.1735565960407257, 0.07887876033782959, -0.5221047401428223, 0.30986154079437256, -0.3994707465171814, 0.042916759848594666, -0.16878578066825867, -0.30184292793273926, -0.5412551760673523, -0.11290790885686874, 0.17703141272068024, -0.02564595453441143, 0.12671536207199097, 0.045298270881175995, 0.07257138937711716, -0.049868110567331314, 0.09092506766319275, 0.06128189340233803, 0.02640312910079956, -0.01022315863519907, -0.15396036207675934, -0.5214287042617798, -0.08503509312868118, -0.16833069920539856, -0.25533410906791687, -0.12250664830207825, 0.3319244086742401, -0.010131597518920898, -0.09599088132381439, 0.1018332913517952, 0.09538637846708298, 0.13899001479148865, 0.05743549019098282, -0.27507323026657104, -0.09611587226390839, -0.06048671901226044, -0.02646590583026409, 0.14721201360225677, -0.21531438827514648, 0.09633198380470276, -0.010556543245911598, -0.08543117344379425, -0.15708884596824646, 0.06848901510238647, -0.0038343220949172974, -0.0510118305683136, 0.020915541797876358, 0.2121933549642563, 0.21006616950035095, -0.20789644122123718, -0.2763267457485199, -0.4054567813873291, -0.22798530757427216, -0.36221423745155334, 0.3058658838272095, 0.1385904997587204, 0.7099870443344116, -0.27298709750175476, -0.09667468070983887, -0.308828204870224, 0.3757925033569336, -0.0523720346391201, 0.025484537705779076, -0.22152775526046753, 0.34181705117225647, -0.20957082509994507, 0.21121151745319366, 0.09907349944114685, 0.4478466212749481, -0.10967762768268585, -0.030620452016592026, -0.3326909840106964, -0.5562482476234436, 0.5085307359695435, -0.3880896270275116, -0.3858766257762909, 0.11193200200796127, 0.11669743061065674, 0.2571723163127899, -0.10938922315835953, -0.510901689529419, 0.015936262905597687, 0.4476376473903656, 0.09306545555591583, -0.3317541778087616, 0.18474966287612915, 0.10575178265571594, -0.14503739774227142, -0.01049921102821827, -0.12680883705615997, 0.45847761631011963, -0.41979530453681946, 0.6326503753662109, -0.07566580176353455 ]
https://github.com/huggingface/datasets/issues/5021
Split is inferred from filename and overrides metadata.jsonl
This looks like a duplicate of https://github.com/huggingface/datasets/issues/4895 (the problem is explained in this comment: https://github.com/huggingface/datasets/issues/4895#issuecomment-1248269550). In the meantime, you can do the following to fetch all the splits: ```python dataset = load_dataset("imagefolder", data_files={"train": "imagefolder/train/**", "test": "imagefolder/test/**"}) ```
## Describe the bug Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files. This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder ## Steps to reproduce the bug `metadata.jsonl` ```json {"file_name": "photo of a cat.jpg", "text": "a photo of a cat"} {"file_name": "photo of a dog.jpg", "text": "a photo of a dog"} {"file_name": "photo of a train.jpg", "text": "a photo of a train"} {"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"} ``` `bug.py` ```python from datasets import load_dataset dataset = load_dataset("dataset") print(dataset) # DatasetDict({ # train: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # test: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # }) for split in dataset: for n in dataset[split]: print(n['text']) # a photo of a train # a photo of test tubes ``` ## Expected results One single dataset with all four images / a warning for unused files / documentation of this behavior ## Actual results Only the images with "test" or "train" in the name are loaded ## Environment info - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.10.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
37
Split is inferred from filename and overrides metadata.jsonl ## Describe the bug Including the strings "test" or "train" anywhere in a filename causes `datasets` to infer the split and silently ignore all other files. This behavior is documented for directory names but not filenames: https://huggingface.co/docs/datasets/image_dataset#imagefolder ## Steps to reproduce the bug `metadata.jsonl` ```json {"file_name": "photo of a cat.jpg", "text": "a photo of a cat"} {"file_name": "photo of a dog.jpg", "text": "a photo of a dog"} {"file_name": "photo of a train.jpg", "text": "a photo of a train"} {"file_name": "photo of test tubes.jpg", "text": "a photo of test tubes"} ``` `bug.py` ```python from datasets import load_dataset dataset = load_dataset("dataset") print(dataset) # DatasetDict({ # train: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # test: Dataset({ # features: ['image', 'text'], # num_rows: 1 # }) # }) for split in dataset: for n in dataset[split]: print(n['text']) # a photo of a train # a photo of test tubes ``` ## Expected results One single dataset with all four images / a warning for unused files / documentation of this behavior ## Actual results Only the images with "test" or "train" in the name are loaded ## Environment info - `datasets` version: 2.5.1 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.10.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 This looks like a duplicate of https://github.com/huggingface/datasets/issues/4895 (the problem is explained in this comment: https://github.com/huggingface/datasets/issues/4895#issuecomment-1248269550). In the meantime, you can do the following to fetch all the splits: ```python dataset = load_dataset("imagefolder", data_files={"train": "imagefolder/train/**", "test": "imagefolder/test/**"}) ```
[ 0.10290111601352692, 0.024444878101348877, -0.06702554225921631, 0.4617421627044678, 0.08765880763530731, 0.21010467410087585, 0.3528493642807007, 0.3635416030883789, 0.004549942910671234, 0.1651323139667511, -0.1511828750371933, 0.4436893165111542, -0.20380224287509918, -0.0276158656924963, -0.2972065508365631, -0.04966314136981964, 0.04407711699604988, 0.21696364879608154, -0.005575031042098999, -0.0783180221915245, -0.34000200033187866, 0.27787503600120544, -0.07043448090553284, -0.2406827062368393, -0.46569353342056274, 0.004682835191488266, -0.1178128644824028, 0.26984551548957825, -0.14776936173439026, -0.10753370076417923, -0.162600576877594, 0.02996077388525009, -0.3045158088207245, 0.4823039770126343, -0.00011215966515010223, -0.06849109381437302, 0.12284479290246964, -0.07470186054706573, -0.2281482219696045, -0.5147325992584229, -0.18897929787635803, 0.049960777163505554, 0.11956847459077835, -0.41749000549316406, 0.1047222837805748, -0.31927260756492615, 0.08411464095115662, -0.32700008153915405, 0.39041346311569214, -0.006123042665421963, 0.18560804426670074, -0.03509391471743584, -0.15581093728542328, 0.15981478989124298, 0.2557723820209503, 0.5445475578308105, -0.018681172281503677, 0.10348948836326599, -0.10718010365962982, -0.006201009266078472, -0.1785283088684082, 0.5226869583129883, -0.05681673437356949, 0.13117291033267975, 0.06785550713539124, 0.2678232789039612, -0.4480299949645996, -0.41145890951156616, 0.08027107268571854, 0.22175240516662598, 0.05516040697693825, -0.07320667058229446, -0.33637475967407227, -0.6276502013206482, -0.14736412465572357, -0.07613285630941391, 0.29643458127975464, 0.3589940369129181, 0.009445806965231895, 0.05095773935317993, -0.2198159545660019, 0.08686638623476028, 0.0414615198969841, 0.16240434348583221, -0.04567451775074005, 0.2058815062046051, -0.24566033482551575, 0.18774908781051636, 0.13735729455947876, -0.004741426557302475, -0.21269570291042328, -0.31980475783348083, 0.022931452840566635, -0.04303046315908432, -0.015493739396333694, 0.0650695413351059, 0.05061189457774162, -0.12097597867250443, 0.23800194263458252, 0.06226199492812157, -0.1083926185965538, -0.2018732726573944, -0.24997234344482422, 0.21349725127220154, 0.33339840173721313, -0.12969236075878143, 0.131896510720253, 0.16751684248447418, 0.14942726492881775, 0.20236138999462128, -0.14583933353424072, -0.09996626526117325, 0.11543688923120499, -0.016705159097909927, -0.13176360726356506, -0.3152151107788086, 0.47463107109069824, 0.03921603783965111, -0.3913055956363678, -0.2071579098701477, -0.4176895022392273, -0.2730223834514618, 0.006915956735610962, 0.22165679931640625, 0.06392480432987213, 0.1482647955417633, 0.10042405128479004, 0.10589779913425446, -0.03706684708595276, 0.07857347279787064, -0.2934199869632721, 0.07851310074329376, -0.08653879165649414, 0.05854641646146774, 0.10797463357448578, -0.03206058219075203, 0.36151930689811707, 0.0016997605562210083, -0.0011667832732200623, -0.23633164167404175, 0.05092477798461914, -0.25108006596565247, 0.17913439869880676, 0.20991939306259155, -0.011355295777320862, 0.25812387466430664, 0.1319051831960678, -0.13849294185638428, -0.12606391310691833, -0.0567992627620697, -0.33181145787239075, 0.14650674164295197, 0.023317202925682068, 0.18479283154010773, -0.32488566637039185, 0.10357280820608139, -0.36590319871902466, 0.135782852768898, -0.030131958425045013, 0.1658860743045807, 0.1540599912405014, 0.05360465496778488, -0.10579274594783783, -0.20723667740821838, 0.1109885647892952, 0.47215867042541504, -0.19694505631923676, -0.21122705936431885, 0.044559046626091, -0.14655570685863495, -0.018098115921020508, 0.24550925195217133, -0.053754158318042755, 0.08831226825714111, -0.33848437666893005, 0.34301692247390747, 0.08591750264167786, -0.39050427079200745, -0.13564106822013855, 0.3294037878513336, -0.11114932596683502, 0.3386746048927307, 0.17621052265167236, -0.001987810479477048, -0.06191881746053696, 0.11999630182981491, 0.0476849302649498, 0.40611523389816284, -0.005482709035277367, 0.054070740938186646, 0.022798489779233932, -0.373016893863678, -0.038330741226673126, 0.14216205477714539, -0.147653728723526, -0.07821298390626907, 0.09458108991384506, 0.01706531271338463, 0.45984503626823425, -0.03692031279206276, 0.2269599884748459, 0.2783268690109253, 0.22020366787910461, 0.218485027551651, 0.15732808411121368, -0.3817206621170044, -0.4979732632637024, 0.08192139118909836, 0.3751232326030731, -0.08570355176925659, -0.6406491994857788, -0.16252808272838593, -0.024133913218975067, -0.11310756206512451, -0.36500898003578186, -0.19332446157932281, 0.11494997143745422, 0.29455211758613586, -0.12394921481609344, 0.10392121970653534, -0.24892202019691467, 0.33609604835510254, -0.03711741417646408, 0.4053635001182556, -0.38623368740081787, 0.19759202003479004, -0.022462425753474236, 0.06070326641201973, -0.04834757745265961, 0.05348515883088112, -0.020718008279800415, -0.29348790645599365, 0.0175931379199028, 0.5516290664672852, 0.33185502886772156, 0.22306422889232635, 0.0854484885931015, -0.029534608125686646, 0.15563136339187622, -0.20888863503932953, -0.15764418244361877, 0.18255911767482758, 0.22158966958522797, -0.100505530834198, -0.4410805404186249, 0.2750658690929413, -0.3869805634021759, 0.2673560380935669, -0.01932734251022339, -0.19372542202472687, 0.07983876764774323, -0.1552809774875641, -0.17999374866485596, -0.5148337483406067, -0.023293238133192062, -0.06397446990013123, 0.3849669396877289, 0.11985695362091064, -0.20844970643520355, -0.21709662675857544, 0.8158431649208069, -0.010709868744015694, 0.006553716957569122, 0.06164875999093056, -0.00316668301820755, 0.05372222512960434, -0.033982641994953156, 0.33718788623809814, 0.47802525758743286, 0.26026010513305664, 0.0668753832578659, 0.008219579234719276, 0.2009156495332718, -0.27824369072914124, 0.2397128939628601, 0.33051055669784546, 0.03958720341324806, 0.15133056044578552, 0.338994562625885, 0.006605533882975578, -0.49947312474250793, -0.35226428508758545, 0.08606241643428802, -0.02977447398006916, -0.07115745544433594, 0.18033336102962494, -0.366324782371521, -0.1941942274570465, -0.2278747856616974, -0.14581298828125, -0.3305922746658325, -0.2774035334587097, 0.01704235002398491, 0.07926741242408752, -0.23396824300289154, 0.1107124388217926, -0.08311085402965546, 0.16393613815307617, 0.04266291856765747, -0.27971866726875305, -0.35749417543411255, 0.1597193032503128, -0.1453222632408142, 0.05012805387377739, 0.1432475596666336, -0.035161104053258896, 0.3369097113609314, -0.06919531524181366, -0.12556247413158417, -0.19859157502651215, -0.4042968451976776, 0.2551584839820862, -0.3873072862625122, 0.14881135523319244, 0.3297833800315857, -0.062226712703704834, 0.14346380531787872, -0.23987862467765808, 0.2982965111732483, 0.03465334326028824, -0.16950763761997223, -0.2050398588180542, 0.3128131031990051, 0.2752208411693573, -0.37689176201820374, -0.3684859275817871, 0.008568160235881805, -0.3873041570186615, 0.5983863472938538, 0.09882760047912598, 0.07060187309980392, 0.37786364555358887, -0.045119453221559525, 0.17046572268009186, -0.35508307814598083, 0.04820723086595535, -0.19844111800193787, -0.3159801661968231, 0.22854070365428925, 0.015305429697036743, -0.0519762746989727, -0.014204896986484528, 0.028598491102457047, -0.011623132973909378, 0.049063824117183685, -0.4983028173446655, -0.4472212791442871, -0.2371598333120346, 0.1388426125049591, -0.03426104784011841, 0.06860914081335068, 0.005046628415584564, 0.1497078537940979, -0.0828293114900589, -0.38520917296409607, -0.08231613785028458, 0.1646900773048401, -0.1831478476524353, 0.10997474193572998, -0.0712914988398552, 0.3048730790615082, 0.28557687997817993, 0.2202785611152649, 0.0828428715467453, 0.11122837662696838, 0.35222360491752625, -0.14938026666641235, 0.42763203382492065, 0.05006532371044159, -0.3157903552055359, 0.018415411934256554, 0.05956041067838669, 0.06475581228733063, 0.3521031141281128, 0.019598281010985374, 0.17623364925384521, -0.06778603792190552, 0.07274723052978516, -0.4580211639404297, -0.28505823016166687, 0.04919701814651489, 0.32853662967681885, -0.06962903589010239, 0.06581798195838928, 0.03974795341491699, 0.06372281908988953, -0.025966398417949677, -0.16558796167373657, 0.3038076162338257, 0.16619300842285156, -0.013305948115885258, -0.345717191696167, 0.06909941881895065, -0.00048342347145080566, 0.13693895936012268, -0.038445454090833664, 0.0721358060836792, -0.03811546415090561, -0.12869808077812195, 0.1511979103088379, -0.10636827349662781, 1.0318876504898071, -0.06462877243757248, -0.00029791519045829773, -0.0005357116460800171, -0.03178982064127922, -0.20304226875305176, 0.14950847625732422, -0.3815271854400635, 0.04706824570894241, 0.2777242362499237, 0.853841245174408, -0.3363713324069977, -0.3067418336868286, 0.34696048498153687, 0.02419395186007023, 0.02891843393445015, -0.21062549948692322, -0.2580660283565521, -0.2709941565990448, -0.2366010695695877, -0.12326998263597488, 0.19687893986701965, 0.23997949063777924, 0.07770056277513504, -0.07442830502986908, 0.05567837506532669, -0.3435986042022705, 0.1682298481464386, 0.16692794859409332, 0.20122575759887695, -0.126307874917984, 0.10388277471065521, 0.1432068943977356, 0.13598093390464783, 0.3896307647228241, 0.5961443185806274, -0.25450849533081055, -0.38515645265579224, 0.1565496027469635, -0.29756152629852295, 0.21570351719856262, 0.41915658116340637, -0.20375216007232666, 0.06289801001548767, -0.07579934597015381, 0.28467369079589844, -0.309233695268631, 0.31089454889297485, 0.5867461562156677, -0.14595595002174377, -0.17151445150375366, -0.3728564977645874, 0.5423868894577026, 0.20086531341075897, -0.013555586338043213, 0.22700300812721252, 0.25827404856681824, -0.4985906481742859, 0.27776670455932617, -0.1714278757572174, 0.7810499668121338, 0.19777005910873413, 0.25231820344924927, 0.3115749657154083, -0.34487247467041016, 0.6755720376968384, -0.13481879234313965, 0.07697494328022003, -0.14205636084079742, -0.07345495373010635, -0.0005115680396556854, -0.05027005076408386, 0.22287893295288086, 0.2688383162021637, -0.03839894011616707, 0.20777371525764465, -0.13124416768550873, 0.21962758898735046, -0.1517983376979828, 0.2502956688404083, -0.3451542258262634, -0.24474665522575378, -0.28990378975868225, 0.12846779823303223, -0.018692180514335632, 0.10006970167160034, 0.16701433062553406, -0.1638728827238083, -0.18588081002235413, -0.2924368977546692, 0.06810387969017029, 0.1442279815673828, -0.07085727155208588, 0.11898384243249893, -0.03732093796133995, -0.08385316282510757, 0.01977509632706642, 0.025574130937457085, -0.04186931997537613, 0.10427027195692062, -0.01913982443511486, 0.3102661669254303, -0.22131651639938354, 0.20771537721157074, -0.0987800881266594, -0.06617248058319092, 0.27136749029159546, 0.16588297486305237, 0.14077723026275635, -0.263988196849823, -0.002324025146663189, -0.0831252783536911, -0.27025306224823, 0.2565787732601166, -0.24084995687007904, -0.4392006993293762, -0.2082822620868683, -0.1528700739145279, 0.03164217993617058, -0.2705892026424408, 0.11703470349311829, -0.06324438750743866, -0.1529034823179245, 0.21945074200630188, -0.24637027084827423, -0.3935718834400177, -0.2526232898235321, 0.24910226464271545, -0.012605659663677216, 0.05848987400531769, 0.41559553146362305, -0.012498613446950912, -0.05307628959417343, -0.2519543170928955, 0.2721199095249176, 0.24741525948047638, -0.3773778975009918, 0.2764579653739929, 0.059765513986349106, -0.06110022962093353, -0.011728561483323574, -0.0059351809322834015, -0.019100338220596313, 0.11418172717094421, 0.01737850531935692, -0.4336363971233368, 0.06916440278291702, 0.41726911067962646, -0.1014241874217987, 0.21687501668930054, 0.03292804956436157, 0.3344959318637848, -0.04471816122531891, 0.0766691267490387, -0.3055655360221863, 0.3097040057182312, -0.10734792053699493, 0.10747896879911423, 0.1403825581073761, 0.04237034544348717, 0.5383217334747314, 0.005151489749550819, 0.20778505504131317, 0.25583094358444214, -0.08798524737358093, -0.1707242727279663, -0.3728008270263672, 0.11987803131341934, 0.0637795478105545, 0.15930791199207306, -0.046130113303661346, -0.12757346034049988, -0.06933464109897614, -0.24229440093040466, 0.16382060945034027, 0.07677451521158218, 0.11310863494873047, 0.21790467202663422, 0.11913469433784485, -0.07745041698217392, 0.2048068791627884, -0.040793292224407196, -0.2698075771331787, 0.1657334864139557, 0.1897762417793274, 0.2640209197998047, -0.24509860575199127, 0.09805594384670258, -0.1257115602493286, -0.1259816288948059, -0.01696287840604782, 0.11288874596357346, 0.060598697513341904, -0.1466730386018753, -0.042438898235559464, -0.000332400668412447, 0.6117477416992188, 0.4399862587451935, -0.20053216814994812, -0.09541022777557373, -0.041688863188028336, 0.20656153559684753, -0.12141110748052597, -0.0637839064002037, 0.3674853444099426, 0.05900660902261734, 0.29978325963020325, 0.3238241374492645, -0.13391004502773285, 0.3323173224925995, -0.3350507616996765, -0.12041785567998886, 0.6637570261955261, -0.015561345964670181, 0.2337285280227661, 0.46126788854599, -0.18955007195472717, 0.11403165012598038, 0.3677864968776703, 0.20657627284526825, 0.26700878143310547, 0.6945743560791016, -0.05822112411260605, 0.36384105682373047, -0.11924875527620316, 0.0179157555103302, 0.305058091878891, -0.11944940686225891, -0.0586756207048893, 0.2621126174926758, -0.06064458191394806, 0.2594163119792938, -0.2414398193359375, 0.3359434902667999, -0.3098788857460022, 0.0719168558716774, 0.16066212952136993, 0.2646118998527527, -0.046255722641944885, -0.19363820552825928, -0.04223019257187843, -0.2368544042110443, -0.3404785096645355, -0.021613579243421555, 0.05617865175008774, -0.40649163722991943, 0.2243814319372177, 0.14568886160850525, -0.05141231417655945, -0.28738924860954285, -0.2026471197605133, -0.01649327203631401, 0.2794305086135864, -0.3728792071342468, 0.1666727513074875, 0.2761976718902588, 0.04259513318538666, 0.257824182510376, 0.23818832635879517, 0.2622123062610626, -0.02754746749997139, 0.2620055675506592, -0.16992010176181793, -0.2621167004108429, -0.20632457733154297, -0.1947774887084961, 0.19429703056812286, 0.006189510226249695, 0.02614496275782585, 0.33892491459846497, 0.2363482117652893, -0.2420293241739273, -0.16601984202861786, 0.21930894255638123, 0.06812818348407745, -0.533295214176178, 0.36807626485824585, -0.3672142028808594, 0.016318008303642273, -0.08314928412437439, -0.26818734407424927, -0.5947113037109375, -0.15480996668338776, 0.18717797100543976, -0.03887161612510681, 0.13661116361618042, 0.05640457198023796, 0.08390749245882034, -0.006819561123847961, 0.12557770311832428, 0.059318624436855316, -0.00884469598531723, 0.03023127093911171, -0.12661537528038025, -0.5339572429656982, -0.06846780329942703, -0.15177561342716217, -0.2891702353954315, -0.10005056113004684, 0.31995946168899536, -0.015803366899490356, -0.12653887271881104, 0.0678996741771698, 0.1255045086145401, 0.05996172875165939, 0.04001018404960632, -0.2913035750389099, -0.08244585990905762, -0.01336042582988739, -0.019156409427523613, 0.14238354563713074, -0.2230614721775055, 0.08389180898666382, -0.0019338633865118027, -0.05552011728286743, -0.14803145825862885, 0.06818981468677521, -0.0004436653107404709, -0.10034738481044769, 0.023259103298187256, 0.19368876516819, 0.22046443819999695, -0.23022985458374023, -0.34193485975265503, -0.36600974202156067, -0.2523675560951233, -0.35478806495666504, 0.3372059166431427, 0.16459372639656067, 0.7227156162261963, -0.28765755891799927, -0.16220059990882874, -0.26111817359924316, 0.36062678694725037, -0.09834187477827072, 0.00887291319668293, -0.21237680315971375, 0.3078317940235138, -0.19307097792625427, 0.26775678992271423, 0.04742281511425972, 0.46018290519714355, -0.07710623741149902, 0.024068454280495644, -0.2865073084831238, -0.6031758189201355, 0.517034113407135, -0.38863933086395264, -0.4049290120601654, 0.13507086038589478, 0.1176643818616867, 0.22848138213157654, -0.09818082302808762, -0.4858192801475525, -0.013440452516078949, 0.4875262379646301, 0.06490433216094971, -0.2840052843093872, 0.17733897268772125, 0.12494440376758575, -0.16969463229179382, -0.01754218339920044, -0.13949373364448547, 0.41733047366142273, -0.4554460644721985, 0.6408848762512207, -0.0826314240694046 ]
https://github.com/huggingface/datasets/issues/5014
I need to read the custom dataset in conll format
Hi! We don't currently have a builder for parsing custom `conll` datasets, but I guess we could add one as a packaged module (similarly to what [TFDS](https://github.com/tensorflow/datasets/blob/master/tensorflow_datasets/core/dataset_builders/conll/conll_dataset_builder.py) did). @lhoestq @albertvillanova WDYT? In the meantime, you can use `Dataset.from_generator` to create a dataset as follows: ```python from datasets import Dataset # 2009 version INPUT_COLUMNS = "ID FORM LEMMA PLEMMA POS PPOS FEAT PFEAT HEAD PHEAD DEPREL PDEPREL".split() def read_conll(file): example = {col: [] for col in INPUT_COLUMNS} idx = 0 with open(file) as f: for line in f: if line.startswith("-DOCSTART-") or line == "\n" or not line: if example[next(iter(example))]: yield idx, example idx += 1 example = {col: [] for col in INPUT_COLUMNS} else: row_cols = line.split() for i, col in enumerate(example): example[col] = row_cols[i].rstrip() # (optional) pass custom features with `features=Features(...)` dset = Dataset.from_generator(read_conll, gen_kwargs={"file": "path/to/conll/file"}) ```
I need to read the custom dataset in conll format
137
I need to read the custom dataset in conll format I need to read the custom dataset in conll format Hi! We don't currently have a builder for parsing custom `conll` datasets, but I guess we could add one as a packaged module (similarly to what [TFDS](https://github.com/tensorflow/datasets/blob/master/tensorflow_datasets/core/dataset_builders/conll/conll_dataset_builder.py) did). @lhoestq @albertvillanova WDYT? In the meantime, you can use `Dataset.from_generator` to create a dataset as follows: ```python from datasets import Dataset # 2009 version INPUT_COLUMNS = "ID FORM LEMMA PLEMMA POS PPOS FEAT PFEAT HEAD PHEAD DEPREL PDEPREL".split() def read_conll(file): example = {col: [] for col in INPUT_COLUMNS} idx = 0 with open(file) as f: for line in f: if line.startswith("-DOCSTART-") or line == "\n" or not line: if example[next(iter(example))]: yield idx, example idx += 1 example = {col: [] for col in INPUT_COLUMNS} else: row_cols = line.split() for i, col in enumerate(example): example[col] = row_cols[i].rstrip() # (optional) pass custom features with `features=Features(...)` dset = Dataset.from_generator(read_conll, gen_kwargs={"file": "path/to/conll/file"}) ```
[ -0.4587492346763611, 0.011594131588935852, -0.18534238636493683, 0.2370755970478058, 0.13481323421001434, 0.2164463996887207, 0.3992217779159546, 0.343513160943985, -0.4873550832271576, 0.02529759705066681, -0.26638007164001465, 0.24309208989143372, -0.353158563375473, 0.4143036901950836, -0.03827911615371704, 0.0909092053771019, -0.13595029711723328, 0.20246389508247375, 0.21575972437858582, -0.0854722335934639, -0.34861743450164795, 0.1448170691728592, -0.15955960750579834, -0.06810203194618225, -0.09764175117015839, -0.11104466766119003, 0.019309891387820244, 0.05115276202559471, -0.28089576959609985, -0.17211130261421204, 0.3252602815628052, 0.34449443221092224, 0.2620795667171478, 0.2392251193523407, -0.00010000627662520856, 0.21800388395786285, -0.12331368029117584, -0.1366884559392929, -0.017195265740156174, -0.027729347348213196, -0.23572540283203125, -0.2607101500034332, -0.16884109377861023, -0.3625854253768921, -0.3346420228481293, -0.1688588410615921, -0.27416500449180603, -0.20442740619182587, 0.22468781471252441, 0.3851203918457031, 0.26173657178878784, -0.040609847754240036, 0.19562487304210663, 0.23582211136817932, 0.10069666802883148, 0.1825433075428009, -0.23747946321964264, -0.039746321737766266, -0.04734925925731659, 0.14530549943447113, -0.11255507916212082, 0.14531509578227997, -0.2057643085718155, 0.02763473242521286, 0.2524382174015045, 0.08835934102535248, 0.24233463406562805, -0.1902381330728531, -0.12397577613592148, 0.3906805217266083, 0.4023307263851166, -0.28647300601005554, -0.27966445684432983, -0.27861401438713074, -0.03519798070192337, -0.33802205324172974, -0.045191697776317596, 0.3471217453479767, -0.21209917962551117, 0.4283301532268524, -0.1106266900897026, -0.26166900992393494, -0.40189477801322937, -0.02547658234834671, -0.3613568842411041, 0.25962692499160767, -0.17292597889900208, -0.11463997513055801, 0.0023675039410591125, -0.03903599828481674, 0.8426759839057922, -0.19565904140472412, 0.14652207493782043, 0.12128830701112747, -0.16797341406345367, -0.2405899465084076, 0.0025206059217453003, -0.5293875336647034, 0.10206522792577744, 0.02991965413093567, -0.030796218663454056, 0.16957548260688782, -0.20808683335781097, 0.11233729869127274, -0.13111625611782074, -0.14064358174800873, 0.2013411521911621, 0.30132314562797546, -0.029647186398506165, -0.20352813601493835, -0.06599791347980499, 0.0868634283542633, -0.31797724962234497, -0.024200621992349625, -0.49125802516937256, 0.062114305794239044, 0.09625177830457687, 0.025053661316633224, -0.0829591378569603, 0.13954278826713562, -0.012466799467802048, -0.1386224329471588, 0.15999487042427063, 0.20380949974060059, -0.03235936909914017, 0.3136541545391083, 0.04067450761795044, -0.03776116669178009, 0.0019529573619365692, -0.30311399698257446, -0.15157324075698853, -0.0887230783700943, 0.16628150641918182, -0.2559070289134979, 0.026535015553236008, -0.2964872717857361, 0.11075005680322647, -0.0861285850405693, -0.08914916217327118, -0.048849038779735565, 0.26792165637016296, -0.013346261344850063, 0.3167543411254883, -0.05569807067513466, 0.025412458926439285, -0.18829505145549774, 0.1002836748957634, -0.30655860900878906, -0.3355065584182739, 0.1356426477432251, -0.21134671568870544, -0.3967215418815613, -0.33830320835113525, 0.25863316655158997, -0.14530634880065918, -0.021579228341579437, 0.18790332973003387, 0.29058215022087097, 0.12594226002693176, 0.09773276746273041, -0.1906883716583252, -0.18443748354911804, -0.3541126847267151, -0.36127790808677673, 0.33828139305114746, -0.017652779817581177, -0.8473000526428223, 0.25211411714553833, -0.03408195823431015, -0.2476259171962738, 0.17082339525222778, 0.019206825643777847, -0.17545197904109955, 0.3468185067176819, -0.21245704591274261, 0.009071320295333862, 0.6601490378379822, -0.16706225275993347, -0.2503338158130646, 0.31091177463531494, 0.121729776263237, 0.020806340500712395, -0.15616419911384583, -0.018756603822112083, 0.45991799235343933, -0.10491745173931122, 0.10988602042198181, 0.19646862149238586, 0.013246402144432068, -0.16199825704097748, 0.10167200863361359, -0.27073079347610474, 0.005388397723436356, 0.008547745645046234, -0.09634296596050262, -0.09663975983858109, -0.04760127514600754, -0.1410292237997055, 0.41711872816085815, -0.17552028596401215, -0.03841479867696762, 0.3152669072151184, 0.249550461769104, 0.1326335072517395, -0.09187492728233337, -0.07884161174297333, -0.5953227877616882, 0.10769619792699814, 0.12953585386276245, -0.08003802597522736, 0.17014208436012268, -0.1565159410238266, -0.13112318515777588, 0.11371944099664688, -0.14773821830749512, 0.07778866589069366, 0.24276477098464966, 0.10448309779167175, -0.04723168909549713, 0.0812588483095169, -0.3099978268146515, 0.22450076043605804, -0.15767355263233185, -0.004674736876040697, -0.1040254533290863, -0.10101368278265, 0.05032585561275482, -0.02402719482779503, 0.00755712017416954, 0.3008793294429779, -0.025074854493141174, -0.04038238525390625, 0.1328013837337494, 0.268373966217041, 0.15986816585063934, -0.015543162822723389, -0.23365432024002075, 0.1870495080947876, 0.17018543183803558, -0.14957527816295624, -0.09347737580537796, -0.21070300042629242, -0.17420540750026703, -0.22477200627326965, -0.1576860249042511, 0.46420788764953613, 0.4318399429321289, 0.06974825263023376, 0.005530606955289841, 0.12080974131822586, 0.26392775774002075, -0.08905987441539764, 0.06322866678237915, -0.0901799201965332, -0.03754371777176857, 0.13028176128864288, 0.2260371893644333, 0.04334046691656113, -0.4864332675933838, 0.18506622314453125, 0.5428783893585205, -0.13465851545333862, -0.1582585573196411, -0.007920030504465103, -0.16372311115264893, 0.24231669306755066, 0.029607361182570457, 0.17088104784488678, -0.10877576470375061, 0.11729258298873901, 0.12276971340179443, 0.2496132105588913, -0.2346591204404831, -0.14299383759498596, 0.18292689323425293, 0.02735333889722824, 0.10308163613080978, 0.20391204953193665, 0.012543432414531708, -0.13587190210819244, 0.056763723492622375, -0.2324969619512558, -0.07384370267391205, 0.2122686803340912, -0.23715557157993317, -0.16149762272834778, -0.2563129961490631, 0.1010262742638588, -0.09989254176616669, -0.2716248631477356, 0.15999220311641693, -0.2996237576007843, -0.15834961831569672, 0.1490972638130188, -0.00033451616764068604, -0.12668146193027496, -0.30441245436668396, 0.11130982637405396, 0.2397318035364151, -0.335237979888916, -0.08008382469415665, -0.2033100426197052, -0.0976753905415535, 0.23124650120735168, 0.27426809072494507, -0.09106963872909546, 0.1669681817293167, -0.2755250334739685, 0.12265218794345856, -0.022047994658350945, -0.23829388618469238, 0.3096305727958679, -0.17538301646709442, 0.05306560546159744, 0.22849147021770477, 0.045124560594558716, -0.04715574160218239, -0.17919404804706573, 0.1323285847902298, 0.33118292689323425, -0.03773370012640953, 0.09778334200382233, -0.05599858611822128, -0.010962830856442451, -0.11053305864334106, -0.42906180024147034, -0.23537911474704742, -0.3318256437778473, -0.00450529158115387, 0.16994844377040863, 0.2821230888366699, 0.04875138774514198, 0.18447250127792358, 0.26578372716903687, 0.1836291253566742, 0.04800920933485031, -0.03172700107097626, -0.35140275955200195, 0.4537672996520996, -0.4901614487171173, -0.15188279747962952, 0.07573635876178741, -0.1468455195426941, 0.2764672338962555, -0.025661449879407883, -0.44754016399383545, 0.4341144263744354, -0.15519694983959198, 0.2670040428638458, -0.18898284435272217, -0.20863699913024902, -0.06488817930221558, 0.361736923456192, 0.10439354181289673, -0.23275437951087952, 0.12090905010700226, 0.10450958460569382, -0.13813596963882446, 0.04994792118668556, 0.28553491830825806, 0.2682165801525116, 0.19981110095977783, 0.3789660334587097, 0.007941300049424171, -0.23798154294490814, -0.07568761706352234, -0.32236185669898987, 0.06937675178050995, 0.24716690182685852, -0.19659645855426788, 0.14810925722122192, 0.12321493029594421, -0.06346292793750763, 0.2317124307155609, 0.021304404363036156, -0.17161805927753448, -0.07776498794555664, 0.150386780500412, -0.05204428732395172, -0.24606333673000336, 0.07284451276063919, 0.11140356957912445, 0.21970811486244202, -0.13465161621570587, 0.2234152853488922, -0.14719651639461517, -0.09973564743995667, 0.010980043560266495, -0.06615449488162994, 0.136182963848114, -0.13127194344997406, 0.09677217900753021, 0.1817532330751419, -0.4081408977508545, 0.19188348948955536, 0.07617053389549255, -0.07822903990745544, 0.21560384333133698, 0.07145269960165024, -0.065937340259552, -0.07514464110136032, 0.37154871225357056, -0.15182475745677948, -0.1877024620771408, 0.3040968179702759, 0.20692145824432373, -0.48435062170028687, 0.014721885323524475, -0.2732395529747009, -0.20447063446044922, 0.584994912147522, 0.41422709822654724, -0.043916620314121246, -0.3741550147533417, 0.40133050084114075, 0.06626418232917786, -0.24993422627449036, -0.27720388770103455, 0.03228278085589409, -0.46394437551498413, -0.23750634491443634, -0.16964232921600342, -0.034955088049173355, 0.19397300481796265, 0.014431425370275974, -0.2931079566478729, -0.043111301958560944, 0.02270950749516487, 0.29748356342315674, 0.12866275012493134, 0.1881897747516632, 0.15795643627643585, -0.043942976742982864, 0.13008612394332886, 0.03364303708076477, 0.28873568773269653, 0.2741626799106598, 0.06156371533870697, -0.4494859576225281, 0.0024843402206897736, -0.20654809474945068, 0.3319435715675354, -0.161426842212677, -0.12456990033388138, -0.07751519232988358, -0.10070548206567764, -0.02298416942358017, -0.19141091406345367, 0.3577769994735718, 0.21967045962810516, 0.027175094932317734, -0.619677722454071, -0.6504666805267334, 0.38303330540657043, 0.08276888728141785, 0.0883171558380127, 0.00029019638895988464, -0.2743176221847534, -0.1726987212896347, 0.18884268403053284, 0.3110274076461792, 0.6254969835281372, -0.09906521439552307, -0.12138071656227112, 0.5194321274757385, -0.05587572976946831, 0.11915023624897003, -0.6072766780853271, 0.007552974857389927, -0.2646264135837555, -0.11250056326389313, -0.19844281673431396, -0.0771038681268692, 0.11948786675930023, 0.5206438302993774, -0.1523960381746292, -0.013991535641252995, -0.05745910853147507, -0.14737074077129364, 0.2587207853794098, 0.29334500432014465, 0.05475164204835892, -0.02069445699453354, 0.2280084192752838, 0.2565227746963501, -0.052097469568252563, -0.1760195642709732, 0.16165274381637573, -0.2712588310241699, 0.041836295276880264, 0.07093817740678787, -0.2702811360359192, 0.01919930800795555, -0.34303659200668335, 0.029318057000637054, -0.005258973687887192, -0.4607940912246704, 0.2315196692943573, 0.3460845351219177, 0.36290156841278076, 0.2841331958770752, -0.22164934873580933, -0.06645037233829498, 0.2194727659225464, -0.09381664544343948, 0.20001749694347382, -0.04372646287083626, 0.12444014102220535, -0.06707028299570084, -0.24716347455978394, 0.22504419088363647, -0.0015760650858283043, -0.13705426454544067, 0.16739600896835327, -0.017040282487869263, 0.14886459708213806, -0.3136567771434784, -0.15495526790618896, 0.04150228947401047, -0.08246350288391113, 0.06781916320323944, 0.22609439492225647, -0.09896378219127655, -0.1817266345024109, 0.21954572200775146, -0.3803376853466034, -0.1539098024368286, 0.03833693638443947, -0.2989260256290436, 0.243901789188385, 0.05887199938297272, 0.2833506464958191, 0.2988224923610687, -0.205553337931633, -0.2716837525367737, 0.18494674563407898, -0.1873873770236969, 0.1773812174797058, -0.04836459830403328, -0.048748187720775604, -0.0009714961051940918, 0.10273631662130356, 0.325670450925827, -0.0479227751493454, 0.044284023344516754, -0.13781416416168213, -0.08470862358808517, -0.32375574111938477, -0.2423553615808487, -0.07276524603366852, 0.4563010036945343, 0.20233860611915588, 0.5312969088554382, -0.31340983510017395, 0.04267396032810211, -0.42779526114463806, 0.0750202015042305, -0.07214747369289398, 0.0003740508109331131, -0.05722300708293915, 0.22990897297859192, -0.07382707297801971, 0.08145259320735931, 0.26280316710472107, 0.1638973504304886, -0.03964608162641525, -0.3191186189651489, -0.31492772698402405, 0.041552186012268066, -0.05962865799665451, 0.013807314448058605, 0.03966797888278961, 0.05183711647987366, -0.406710147857666, -0.1161341741681099, 0.1250225007534027, 0.05967959761619568, 0.11891649663448334, 0.5792466998100281, -0.33458998799324036, 0.1595885455608368, -0.12434860318899155, 0.07061637192964554, 0.05349870026111603, 0.36345183849334717, -0.012127518653869629, 0.46573588252067566, -0.1858496218919754, 0.05253344774246216, 0.08751673251390457, 0.11414633691310883, -0.0454484224319458, -0.07677412033081055, 0.4639214277267456, 0.026782285422086716, 0.09185299277305603, 0.18470406532287598, 0.12803664803504944, 0.020498141646385193, -0.11974829435348511, 0.031315192580223083, 0.3670157790184021, 0.3002517521381378, -0.14915473759174347, 0.05942852050065994, 0.4621341824531555, 0.06980261206626892, 0.2595037817955017, 0.23004069924354553, -0.07814954221248627, 0.1555655151605606, -0.0628572553396225, 0.059969864785671234, 0.29243800044059753, -0.06767196953296661, 0.03781132027506828, 0.3095940053462982, -0.05385126546025276, 0.013008944690227509, 0.004797996953129768, 0.07204747945070267, 0.15889517962932587, 0.3363056182861328, 0.09609797596931458, -0.3285483419895172, 0.14004464447498322, 0.12924444675445557, 0.39321169257164, -0.5059925317764282, 0.33359259366989136, 0.23838841915130615, -0.23013374209403992, 0.28775668144226074, -0.0961611270904541, 0.09955358505249023, 0.16750800609588623, 0.09355007112026215, -0.15235045552253723, 0.5239496231079102, -0.04558371752500534, -0.03518782928586006, -0.2484436184167862, -0.029028985649347305, 0.24969136714935303, -0.016017723828554153, 0.15716443955898285, -0.26962292194366455, -0.27763375639915466, 0.12133178859949112, 0.1410457342863083, 0.012331166304647923, 0.39340445399284363, -0.08919083327054977, 0.04160620644688606, -0.2325986921787262, 0.18838998675346375, 0.14053384959697723, -0.09222845733165741, -0.12976934015750885, 0.10586494952440262, 0.18744774162769318, 0.09929776191711426, -0.01400689035654068, 0.020480353385210037, -0.23874805867671967, -0.1282258927822113, -0.12690597772598267, 0.020459476858377457, -0.08450096845626831, -0.085995614528656, 0.5094603896141052, 0.30999988317489624, -0.13617272675037384, -0.18589352071285248, 0.17038185894489288, 0.18559852242469788, -0.2122400999069214, -0.03271084278821945, 0.1418786346912384, -0.17069387435913086, -0.0025859326124191284, -0.22737270593643188, -0.21500369906425476, -0.1446973979473114, 0.822767436504364, 0.004743809811770916, 0.3646879196166992, 0.22444204986095428, 0.1355103850364685, -0.08664694428443909, 0.16659493744373322, 0.30465638637542725, 0.34160658717155457, 0.05539791285991669, -0.22123025357723236, -0.11586780846118927, 0.16153189539909363, 0.07808226346969604, -0.30096668004989624, 0.08429468423128128, 0.24095530807971954, 0.09084775298833847, 0.25778311491012573, -0.08634229004383087, -0.1268463283777237, -0.013247569091618061, 0.4405556917190552, -0.10048557817935944, 0.03804276883602142, -0.1673293560743332, 0.07796964794397354, -0.02824961394071579, -0.387829452753067, 0.17262977361679077, 0.22052700817584991, 0.10425650328397751, -0.25190192461013794, 0.3504479229450226, 0.3052321672439575, -0.2204437255859375, 0.09240846335887909, 0.06776859611272812, 0.2523624300956726, -0.2231520116329193, 0.10947418957948685, -0.05696405842900276, 0.2058083862066269, -0.17425338923931122, 0.11237718164920807, 0.03132040798664093, 0.17316259443759918, -0.3062373995780945, -0.1433132141828537, -0.1470736414194107, 0.20747268199920654, 0.3813444972038269, -0.2371947020292282, -0.2544477581977844, 0.22380945086479187, -0.19432100653648376, -0.1743699610233307, 0.1315770298242569, 0.25378045439720154, 0.034291695803403854, 0.24172694981098175, -0.03081856667995453, -0.14902622997760773, 0.29352954030036926, -0.22307425737380981, -0.33300480246543884, 0.1997443288564682, -0.18247443437576294, -0.10207109898328781, 0.312532901763916, -0.4427502751350403, -0.05876825004816055, 0.526455283164978, -0.04292471706867218, -0.019546322524547577, 0.15243025124073029, 0.3077333867549896, -0.0037178173661231995, -0.16344018280506134, 0.17220771312713623, 0.10712429881095886, -0.30874523520469666, -0.37030932307243347, -0.2924789786338806 ]
https://github.com/huggingface/datasets/issues/5014
I need to read the custom dataset in conll format
I think we could add a dedicated builder if you think this format is general enough.
I need to read the custom dataset in conll format
16
I need to read the custom dataset in conll format I need to read the custom dataset in conll format I think we could add a dedicated builder if you think this format is general enough.
[ -0.46517640352249146, 0.17232361435890198, -0.22875508666038513, 0.04054702818393707, 0.11928945034742355, 0.12518629431724548, 0.37645193934440613, 0.2061583399772644, -0.45362427830696106, 0.28308090567588806, -0.2519296407699585, 0.11082787066698074, -0.2176361083984375, 0.4760890603065491, -0.017038952559232712, 0.08542857319116592, -0.13568493723869324, 0.460154265165329, 0.14443007111549377, 0.07596489787101746, -0.1688326746225357, -0.04763215780258179, 0.07437370717525482, 0.006844416260719299, 0.00403603445738554, -0.11571121960878372, 0.03141762316226959, 0.03913488611578941, -0.3622894883155823, -0.5251989364624023, 0.18716104328632355, 0.445542573928833, 0.20188969373703003, -0.0014932304620742798, -0.00010263566218782216, 0.1785527765750885, 0.07656007260084152, -0.04275225102901459, -0.17332637310028076, 0.2905879020690918, -0.5200378894805908, -0.2458803802728653, 0.15869466960430145, -0.3054247498512268, -0.3875262141227722, -0.09614601731300354, 0.03495260328054428, -0.09331873059272766, 0.13529740273952484, 0.2827050983905792, 0.2744486629962921, -0.1669522076845169, -0.03604520857334137, -0.09437988698482513, 0.12233851104974747, 0.25583314895629883, -0.21678096055984497, 0.027120204642415047, 0.13382503390312195, 0.42666471004486084, -0.351611852645874, 0.28104114532470703, -0.09352543205022812, -0.02225305140018463, 0.18073442578315735, -0.1718216836452484, 0.13677659630775452, 0.03755224123597145, -0.051621392369270325, 0.21177485585212708, 0.7529648542404175, -0.28094425797462463, -0.1877463161945343, -0.04153282940387726, 0.03359388932585716, -0.1936064511537552, -0.1913261115550995, 0.26981717348098755, -0.05227312818169594, 0.47932523488998413, -0.08776538819074631, -0.40581953525543213, -0.28456783294677734, 0.04573313146829605, -0.40153858065605164, 0.22666440904140472, -0.17585134506225586, -0.047336965799331665, -0.02504630759358406, 0.0905005931854248, 0.7270780205726624, 0.005231495946645737, -0.1890401989221573, -0.29190248250961304, 0.11255819350481033, -0.42911580204963684, -0.1311470866203308, -0.23099255561828613, -0.045453764498233795, 0.1506667137145996, 0.14365722239017487, 0.15745961666107178, -0.1161532998085022, 0.025525014847517014, 0.05701851472258568, -0.3592742383480072, 0.3503168821334839, 0.1727147102355957, 0.3309422731399536, -0.16740331053733826, -0.09154748916625977, -0.05365215986967087, -0.20373694598674774, 0.09603051841259003, -0.4812822639942169, 0.13064107298851013, 0.008002400398254395, -0.22529777884483337, -0.134610116481781, -0.22031402587890625, 0.25773218274116516, -0.1916227489709854, 0.09612943232059479, 0.29039397835731506, 0.06119607761502266, 0.07342852652072906, -0.22190512716770172, -0.02105465531349182, 0.16682635247707367, -0.40359535813331604, -0.047501277178525925, 0.0008402187377214432, 0.05200430378317833, -0.14962610602378845, -0.11046692728996277, -0.2462097406387329, 0.08623339980840683, -0.041833147406578064, -0.06343060731887817, 0.007148619741201401, 0.2019946426153183, 0.10336069762706757, 0.37811875343322754, 0.058521341532468796, 0.02697291597723961, -0.2569565773010254, -0.09220932424068451, -0.11638939380645752, -0.36963072419166565, 0.12884604930877686, -0.2789898216724396, -0.43230998516082764, -0.4363897144794464, 0.23833099007606506, 0.14963842928409576, -0.21586546301841736, 0.3883408308029175, 0.3795052766799927, -0.06221305578947067, -0.30443844199180603, -0.15228664875030518, 0.09120608866214752, -0.25398290157318115, -0.13678093254566193, 0.048736900091171265, -0.07696004211902618, -0.7550117373466492, 0.23179024457931519, -0.06766065210103989, -0.2505352795124054, 0.1044173613190651, -0.0010889284312725067, -0.30704328417778015, 0.17746010422706604, -0.24461856484413147, -0.061147261410951614, 0.6175003051757812, -0.21361060440540314, -0.11956079304218292, 0.4468524158000946, 0.19565944373607635, -0.2318916916847229, 0.11455082893371582, 0.20573194324970245, 0.3059646189212799, -0.2789001762866974, -0.06424422562122345, -0.09382004290819168, -0.0382407009601593, -0.024539504200220108, 0.2168264538049698, -0.378265380859375, 0.024080689996480942, 0.13804306089878082, -0.03758423402905464, -0.018746398389339447, 0.1739603877067566, -0.0074160220101475716, 0.3377709686756134, -0.2285986840724945, -0.18361453711986542, 0.12405954301357269, 0.08859321475028992, -0.17612048983573914, -0.1180226057767868, -0.1075340285897255, -0.35295751690864563, -0.14794379472732544, -0.08785220980644226, -0.05242200195789337, 0.44066375494003296, -0.37772178649902344, -0.1793690323829651, -0.06255768239498138, -0.05359996482729912, 0.08306824415922165, 0.20745284855365753, 0.21041949093341827, 0.0035080686211586, -0.12858261168003082, -0.22785499691963196, 0.11022663861513138, -0.05297386646270752, -0.13453561067581177, 0.2183111310005188, -0.2444690316915512, 0.0016799233853816986, 0.0633653774857521, 0.22648072242736816, 0.2229878008365631, -0.049795493483543396, 0.04236721619963646, 0.09294723719358444, 0.28925636410713196, 0.1568620651960373, 0.07533302158117294, -0.010469373315572739, 0.1698307991027832, 0.07579207420349121, -0.03737534582614899, -0.07552056759595871, -0.14259976148605347, -0.2726239860057831, -0.09485535323619843, -0.34530550241470337, 0.3135868310928345, 0.5445774793624878, -0.010273076593875885, -0.08412929624319077, 0.07466407865285873, 0.16214750707149506, -0.05648516118526459, -0.22113899886608124, -0.2640681266784668, -0.2551041543483734, 0.1986733227968216, 0.23456905782222748, 0.11990327388048172, -0.6734221577644348, 0.2527581751346588, 0.7074395418167114, -0.07789045572280884, 0.11478295922279358, 0.17539310455322266, -0.11872965842485428, 0.08681963384151459, 0.18326033651828766, 0.16114479303359985, -0.07740649580955505, 0.369783490896225, 0.15640787780284882, 0.03888498246669769, -0.0662473738193512, -0.25318723917007446, 0.2545393705368042, -0.18555982410907745, 0.08255857229232788, 0.09126995503902435, 0.07971245795488358, -0.37631434202194214, -0.1811903417110443, -0.17463353276252747, -0.32959792017936707, -0.05213605612516403, -0.07013100385665894, -0.42563721537590027, -0.2284083366394043, -0.10150644183158875, -0.1058170273900032, -0.13953836262226105, 0.20440968871116638, -0.3324131965637207, 0.2658792734146118, -0.037225332111120224, -0.22087077796459198, 0.03592952340841293, -0.3202321231365204, 0.3735061585903168, 0.030712692067027092, 0.09453628212213516, -0.2033107876777649, -0.2887837588787079, -0.2406434714794159, 0.2770683169364929, 0.21132749319076538, -0.19529718160629272, 0.2395084649324417, -0.3772960305213928, 0.26682209968566895, -0.14843308925628662, -0.2278270721435547, 0.3834422826766968, 0.13934680819511414, 0.03551391512155533, 0.322093665599823, 0.019477903842926025, 0.04032637178897858, -0.18125343322753906, -0.013577720150351524, 0.3474283814430237, -0.06542664021253586, 0.013906553387641907, -0.232770174741745, -0.04607342928647995, -0.16534708440303802, -0.3618074357509613, -0.212065652012825, -0.46974408626556396, -0.1358078271150589, 0.09592552483081818, 0.2407064586877823, -0.14907151460647583, 0.03748351335525513, 0.09518174827098846, -0.12118534743785858, 0.1687590777873993, -0.11514412611722946, -0.35553374886512756, 0.30147477984428406, -0.4218687117099762, -0.25764381885528564, -0.2403283268213272, 0.05546704679727554, 0.20303401350975037, -0.19387374818325043, -0.40171313285827637, 0.26716911792755127, -0.19441984593868256, 0.019696921110153198, -0.05344337970018387, -0.13605481386184692, -0.015017993748188019, 0.3723543882369995, -0.11608625203371048, -0.09666843712329865, 0.07788144052028656, 0.07138954848051071, -0.11567109078168869, -0.1757940649986267, 0.07013703137636185, -0.08307469636201859, 0.14306774735450745, 0.1690450757741928, 0.03060949593782425, -0.1664847433567047, -0.046335138380527496, -0.38845041394233704, 0.29077473282814026, 0.013013042509555817, -0.1289968192577362, 0.2111807018518448, 0.06237506866455078, 0.040230393409729004, 0.3674601912498474, -0.08109743893146515, -0.22812387347221375, -0.10114946216344833, 0.003351230174303055, -0.020566072314977646, -0.2774808704853058, 0.08759802579879761, -0.02376355230808258, 0.18183773756027222, -0.08721211552619934, 0.27959784865379333, -0.00572966318577528, 0.08140149712562561, 0.19450703263282776, 0.08306428790092468, 0.012867964804172516, -0.08179005980491638, 0.019175369292497635, -0.002938724122941494, -0.2549716532230377, 0.2506343722343445, 0.17588257789611816, -0.2761188745498657, -0.01991252228617668, 0.004539463669061661, -0.1266852617263794, -0.1471804827451706, 0.2259652316570282, -0.13796089589595795, -0.3153364658355713, 0.04531584307551384, 0.23752525448799133, -0.17692767083644867, 0.1891900897026062, -0.18733620643615723, 0.1208268478512764, 0.3551313281059265, 0.4081563353538513, -0.22226715087890625, -0.2725786566734314, 0.5308448076248169, 0.06846986711025238, -0.2119152545928955, -0.3279727101325989, -0.03061206452548504, -0.3068379759788513, -0.24203772842884064, -0.08368853479623795, -0.12392758578062057, -0.019116340205073357, 0.09375040978193283, -0.4184073805809021, -0.08824273943901062, -0.04931385815143585, 0.14045003056526184, 0.32229724526405334, 0.04763643071055412, 0.08716021478176117, -0.2566317021846771, 0.09221310168504715, 0.22377103567123413, 0.17740973830223083, 0.2757703959941864, 0.011783050373196602, -0.046228110790252686, 0.22573214769363403, -0.4162982106208801, 0.41445547342300415, 0.09713077545166016, 0.05719646066427231, -0.08732310682535172, 0.12475872784852982, -0.17022044956684113, -0.14817248284816742, 0.06861072778701782, -0.11791296303272247, 0.018229234963655472, -0.7352418899536133, -0.629383385181427, 0.28288671374320984, 0.08794142305850983, -0.06857352703809738, -0.06404048949480057, -0.048086777329444885, -0.1285599172115326, 0.0888843834400177, 0.20552635192871094, 0.8570849895477295, -0.09583741426467896, 0.05374437943100929, 0.26536327600479126, -0.26661211252212524, -0.01685488410294056, -0.47229963541030884, -0.06859173625707626, -0.3055890202522278, 0.046116992831230164, -0.14694903790950775, 0.014129605144262314, 0.10627500712871552, 0.5165479183197021, -0.36115357279777527, 0.05831469967961311, 0.08716852962970734, -0.015442132949829102, 0.05918825417757034, 0.3831014037132263, -0.19611430168151855, -0.0077341292053461075, 0.0923604816198349, 0.23117387294769287, -0.10236351191997528, -0.2760213315486908, 0.09981483966112137, -0.2791121006011963, 0.23484936356544495, 0.000970795750617981, -0.10607179999351501, -0.09796112775802612, -0.14504890143871307, 0.007114085368812084, -0.060770582407712936, -0.27517300844192505, 0.12364257872104645, 0.207383394241333, 0.3847217559814453, 0.4186555743217468, -0.2415325939655304, 0.02643568068742752, 0.1936175525188446, -0.031623873859643936, 0.04641671106219292, 0.011270067654550076, 0.011844158172607422, -0.09682893753051758, -0.14551082253456116, 0.16685745120048523, -0.08571023494005203, -0.22806213796138763, 0.019483178853988647, 0.16455760598182678, 0.11306136846542358, -0.4343206584453583, -0.07937316596508026, 0.14934471249580383, 0.03695579990744591, -0.1747368574142456, 0.1872308850288391, -0.13601258397102356, 0.13267754018306732, 0.1826980710029602, 0.048702605068683624, -0.007847331464290619, -0.07974366843700409, -0.31078895926475525, 0.420244425535202, 0.030970193445682526, 0.11434396356344223, 0.030094396322965622, -0.2739046812057495, -0.40173664689064026, 0.2888733744621277, 0.03386428952217102, 0.1593610942363739, 0.15852877497673035, -0.12507276237010956, -0.20118683576583862, -0.00749500747770071, 0.3179701566696167, -0.06281936168670654, 0.14069542288780212, -0.18162208795547485, 0.07146848738193512, -0.4030900299549103, -0.04069189727306366, 0.11329978704452515, 0.6458510756492615, 0.24226346611976624, 0.3771976828575134, -0.31160852313041687, -0.10312806069850922, -0.4588676691055298, -0.10865262150764465, -0.14094048738479614, 0.07616697996854782, -0.13229593634605408, 0.2875365912914276, -0.1905657798051834, 0.22294481098651886, 0.1938459426164627, -0.007404327392578125, -0.07048722356557846, -0.2895966172218323, -0.16759179532527924, 0.09409050643444061, -0.08522341400384903, 0.2987968325614929, 0.11107903718948364, 0.19795161485671997, -0.26229336857795715, -0.09629032015800476, 0.11322273313999176, -0.06003163754940033, 0.1009562760591507, 0.4725102186203003, -0.19763542711734772, -0.04327871650457382, 0.002065688371658325, 0.236896350979805, 0.017765916883945465, 0.4881218671798706, -0.07692161202430725, 0.501555860042572, -0.28264927864074707, -0.03327206149697304, 0.5527619123458862, 0.3746485710144043, 0.31236281991004944, 0.15105324983596802, 0.1206275075674057, 0.1610727608203888, 0.12760472297668457, 0.19815215468406677, 0.25439319014549255, -0.10109025239944458, -0.05727442353963852, 0.07509889453649521, 0.10039865225553513, 0.32765042781829834, -0.28546419739723206, 0.09962877631187439, 0.31759560108184814, -0.2539868652820587, 0.31814175844192505, 0.22133153676986694, 0.22185704112052917, 0.1475532203912735, 0.3506978750228882, -0.09427115321159363, 0.15158124268054962, -0.13370802998542786, -0.08204345405101776, 0.22541260719299316, 0.058804143220186234, -0.1363890916109085, 0.12484866380691528, 0.06712277233600616, 0.10404591262340546, 0.3040546178817749, 0.002091057598590851, -0.09285431355237961, 0.4834819436073303, 0.1782919317483902, 0.5221691727638245, -0.16133388876914978, 0.6374793648719788, 0.2982732653617859, -0.008846156299114227, 0.12091334164142609, 0.310031533241272, 0.15101957321166992, 0.07784602046012878, -0.03790460526943207, -0.10029614716768265, 0.3331212103366852, -0.14976301789283752, -0.07209613919258118, -0.27741897106170654, -0.10855934768915176, 0.21182182431221008, 0.014763180166482925, -0.05914493277668953, 0.007404252886772156, -0.14053009450435638, 0.09015746414661407, 0.353630006313324, -0.08374626189470291, 0.5024555325508118, -0.05762854218482971, 0.1101612001657486, -0.286653995513916, 0.18934638798236847, 0.20106349885463715, -0.05790765583515167, 0.27331364154815674, 0.32378190755844116, 0.2041950523853302, -0.029590759426355362, 0.1633240431547165, -0.13672079145908356, -0.15503539144992828, -0.2542426884174347, -0.25930386781692505, -0.16727794706821442, 0.09005904197692871, 0.03997113183140755, 0.504655122756958, 0.34831565618515015, -0.12168581038713455, 0.030869755893945694, 0.16078932583332062, -0.02687976509332657, -0.18123789131641388, -0.26652443408966064, 0.29423901438713074, -0.2766789495944977, 0.036891233175992966, -0.14552071690559387, -0.314360648393631, -0.15092991292476654, 0.536699116230011, -0.1258322149515152, 0.22502875328063965, 0.04227299243211746, 0.15138189494609833, 0.16971728205680847, 0.2440112829208374, 0.2273411601781845, 0.4450273811817169, 0.1106545478105545, -0.38010507822036743, 0.09461984038352966, 0.16329960525035858, 0.17593125998973846, -0.18238703906536102, -0.0035173846408724785, 0.08056671172380447, 0.3089366853237152, 0.4510422348976135, 0.0979081243276596, 0.0048696971498429775, -0.10304044932126999, 0.21091897785663605, -0.17473381757736206, 0.09061352163553238, 0.4944586157798767, 0.134369358420372, -0.10535885393619537, -0.34303638339042664, 0.22024941444396973, 0.2734072506427765, 0.178434818983078, -0.20521022379398346, 0.2006254494190216, 0.3851126730442047, -0.13321273028850555, 0.18764019012451172, 0.03386659175157547, 0.1710895597934723, -0.38334932923316956, 0.07189187407493591, 0.10534851253032684, 0.0421651266515255, -0.14948080480098724, 0.03874817118048668, 0.23517249524593353, 0.05947207659482956, -0.2910134196281433, -0.04666086658835411, -0.08179472386837006, 0.10314022749662399, 0.21524010598659515, 0.25421273708343506, -0.15641625225543976, 0.2088814675807953, -0.12439396232366562, -0.21664710342884064, -0.02079598791897297, 0.1409265249967575, 0.12050183862447739, -0.05647188425064087, 0.023017719388008118, -0.1933039426803589, 0.2029327005147934, -0.019695639610290527, -0.24238155782222748, 0.36123400926589966, -0.09942302107810974, -0.033833518624305725, 0.3273186981678009, -0.22455734014511108, 0.017351992428302765, 0.4014837443828583, -0.11112978309392929, 0.1265171617269516, 0.2368605136871338, 0.3804900646209717, 0.06972242891788483, -0.24330797791481018, 0.17893873155117035, 0.3193402886390686, -0.376769095659256, -0.6741992235183716, -0.37746506929397583 ]
https://github.com/huggingface/datasets/issues/5014
I need to read the custom dataset in conll format
> I think we could add a dedicated builder if you think this format is general enough. I think its functions are incomplete. It should have to_ Conll and from_ There are two methods of conll.
I need to read the custom dataset in conll format
36
I need to read the custom dataset in conll format I need to read the custom dataset in conll format > I think we could add a dedicated builder if you think this format is general enough. I think its functions are incomplete. It should have to_ Conll and from_ There are two methods of conll.
[ -0.38365739583969116, 0.13543447852134705, -0.1454320102930069, 0.1218985766172409, 0.1794089525938034, -0.006354130804538727, 0.34691184759140015, 0.29411593079566956, -0.5567654967308044, 0.2632015347480774, -0.20346099138259888, 0.06095408648252487, -0.1663142293691635, 0.2996094524860382, 0.01219477504491806, 0.002435818314552307, -0.19870343804359436, 0.3933640122413635, 0.15672554075717926, -0.018014177680015564, -0.27498459815979004, -0.04899267852306366, -0.031835123896598816, 0.05896574258804321, 0.05615698918700218, -0.07145038992166519, -0.04965582117438316, 0.07291050255298615, -0.3321271240711212, -0.4342558979988098, 0.16025026142597198, 0.36307692527770996, 0.17872606217861176, 0.02174646407365799, -0.00010375349665991962, 0.14958345890045166, 0.1667603999376297, -0.14190861582756042, -0.19477435946464539, 0.22860461473464966, -0.486588716506958, -0.3788902759552002, 0.08477368205785751, -0.3371689021587372, -0.36745914816856384, -0.1748398095369339, -0.03485166281461716, 0.032156094908714294, 0.1659986972808838, 0.2769157886505127, 0.26982131600379944, -0.2841825485229492, 0.18064910173416138, -0.034777142107486725, 0.20464399456977844, 0.39031869173049927, -0.20458729565143585, 0.08101609349250793, 0.26797205209732056, 0.3985729217529297, -0.23542863130569458, 0.20521511137485504, -0.25756949186325073, -0.17511671781539917, 0.1957400143146515, -0.13657741248607635, 0.12785932421684265, 0.027676759287714958, -0.15696588158607483, 0.15337875485420227, 0.6221001148223877, -0.218361496925354, -0.11025906354188919, -0.21306881308555603, 0.002231763442978263, -0.17476119101047516, -0.21622368693351746, 0.1582106500864029, -0.16529060900211334, 0.4298384487628937, -0.10222955048084259, -0.52574223279953, -0.28130197525024414, 0.13750147819519043, -0.2835405468940735, 0.18158599734306335, -0.17185702919960022, 0.010238215327262878, 0.013600803911685944, 0.14744418859481812, 0.6457054018974304, -0.10829614102840424, -0.0473959855735302, -0.18065735697746277, 0.048451900482177734, -0.3765142858028412, -0.05329842120409012, -0.22058376669883728, 0.06791451573371887, 0.23329873383045197, 0.07313531637191772, 0.17612648010253906, -0.11402493715286255, 0.024702709168195724, 0.029334325343370438, -0.24612118303775787, 0.3656851053237915, 0.20538301765918732, 0.1467573493719101, -0.08662337064743042, -0.14163076877593994, -0.11329915374517441, -0.2021011859178543, -0.0635576993227005, -0.3619905114173889, 0.16750121116638184, -0.008416477590799332, -0.225397527217865, 0.027226222679018974, -0.09833238273859024, 0.1136888787150383, -0.26034626364707947, 0.2317340224981308, 0.28545382618904114, 0.0742986798286438, 0.09283962845802307, -0.15142501890659332, -0.07293328642845154, 0.16453266143798828, -0.4704437255859375, -0.032559171319007874, -0.07431349158287048, 0.027091216295957565, -0.10993480682373047, -0.15406805276870728, -0.34848031401634216, 0.002290952019393444, 0.026643671095371246, -0.027201592922210693, 0.017168648540973663, 0.14896497130393982, -0.0666467472910881, 0.4745376408100128, -0.13155637681484222, -0.14485713839530945, -0.2196250706911087, 0.014677109196782112, -0.21966999769210815, -0.4017331600189209, 0.12060979008674622, -0.33470338582992554, -0.5260723829269409, -0.38424718379974365, 0.20381252467632294, 0.13759879767894745, -0.015248116105794907, 0.49410566687583923, 0.48294442892074585, 0.018074847757816315, -0.399283766746521, -0.171003520488739, 0.0739612728357315, -0.2787426710128784, -0.22308191657066345, 0.1799861192703247, 0.042368993163108826, -0.6960299611091614, 0.19700124859809875, -0.14740966260433197, -0.2611328363418579, 0.3088696300983429, -0.009445171803236008, -0.35475102066993713, 0.4099809527397156, -0.25350356101989746, -0.10619166493415833, 0.7642771005630493, -0.15292595326900482, -0.13603827357292175, 0.5594140887260437, 0.19868646562099457, -0.002141166478395462, 0.041905179619789124, 0.03789679333567619, 0.2800075113773346, -0.28114625811576843, -0.01629161834716797, -0.14712530374526978, -0.10179658234119415, -0.20043718814849854, 0.10090593993663788, -0.20317918062210083, 0.009584346786141396, 0.10019317269325256, -0.07450850307941437, -0.09875326603651047, 0.07569592446088791, -0.11069891601800919, 0.3589988052845001, -0.23644843697547913, -0.15845739841461182, 0.1258055865764618, 0.24410903453826904, -0.2644795775413513, -0.15351985394954681, -0.17689231038093567, -0.4328394830226898, -0.1238384023308754, -0.08523842692375183, 0.024109529331326485, 0.4292018413543701, -0.2538430094718933, -0.14019262790679932, 0.0016678180545568466, -0.03140190616250038, 0.012255411595106125, 0.2141643613576889, 0.07801595330238342, -0.10172772407531738, -0.1350950002670288, -0.2566119432449341, 0.14160478115081787, -0.015516952611505985, -0.2166798859834671, 0.22353611886501312, -0.12773089110851288, -0.00027813948690891266, 0.030589576810598373, 0.10922332108020782, 0.32217279076576233, 0.07108815014362335, 0.08739900588989258, 0.10742246359586716, 0.2422179877758026, 0.23594368994235992, -0.12300406396389008, -0.1327507495880127, 0.09820246696472168, 0.10658250749111176, 0.009634066373109818, -0.2679237425327301, -0.26142796874046326, -0.18133676052093506, -0.188249409198761, -0.2120814025402069, 0.2716052532196045, 0.5792654752731323, 0.16897094249725342, -0.04381486028432846, 0.08632387220859528, 0.15029631555080414, -0.07968950271606445, -0.07288293540477753, -0.2516806125640869, -0.17635327577590942, 0.2993975281715393, 0.25433585047721863, 0.17596496641635895, -0.6369436383247375, 0.20382672548294067, 0.6046028137207031, -0.14765310287475586, -0.0024939998984336853, 0.23311284184455872, 0.015777572989463806, 0.057420022785663605, 0.12738680839538574, 0.15735135972499847, -0.03446611762046814, 0.3443441689014435, 0.07826653122901917, 0.11172304302453995, -0.02770049497485161, -0.16186363995075226, 0.3080093264579773, -0.062114059925079346, 0.06688227504491806, 0.1297384798526764, -0.055908843874931335, -0.28882214426994324, 0.022723637521266937, -0.29756975173950195, -0.2687701880931854, -0.06200306862592697, -0.12331895530223846, -0.43631312251091003, -0.15903803706169128, -0.08518601953983307, -0.17406000196933746, -0.17893458902835846, 0.14156188070774078, -0.3650948703289032, 0.20232605934143066, -0.04448557272553444, -0.28898885846138, 0.022100936621427536, -0.3304731547832489, 0.428164005279541, 0.03327055275440216, -0.05648910254240036, -0.26001039147377014, -0.2839376628398895, -0.3158946931362152, 0.23541510105133057, 0.2937467098236084, -0.19893090426921844, 0.12356506288051605, -0.26763394474983215, 0.22374121844768524, -0.1289333701133728, -0.19607621431350708, 0.44970306754112244, 0.04048417508602142, 0.16314485669136047, 0.4061063230037689, -0.1256820410490036, -0.019574616104364395, -0.1820799857378006, 0.0829492062330246, 0.31669631600379944, -0.009357023052871227, 0.07984588295221329, -0.269048810005188, -0.06471732258796692, -0.13219161331653595, -0.35646164417266846, -0.22161227464675903, -0.46490803360939026, -0.1746368557214737, 0.01860038936138153, 0.33082151412963867, -0.1180960014462471, -0.01519467681646347, 0.06846325844526291, -0.06171700730919838, 0.21993525326251984, -0.11715275049209595, -0.3540319502353668, 0.33447378873825073, -0.37587979435920715, -0.19755004346370697, -0.2953055500984192, 0.02258254587650299, 0.275924950838089, -0.19447053968906403, -0.41723084449768066, 0.1854071170091629, -0.12868449091911316, 0.0131785087287426, -0.17258870601654053, -0.05955000966787338, -0.001745961606502533, 0.5121602416038513, -0.11228671669960022, -0.1062653660774231, 0.011245157569646835, 0.20110514760017395, -0.19982939958572388, 0.02426178753376007, 0.09915003180503845, 0.056944794952869415, 0.12595197558403015, 0.21897336840629578, 0.1129758358001709, -0.1288643330335617, -0.0031148791313171387, -0.24407494068145752, 0.2837229073047638, 0.05362708121538162, -0.2684261202812195, 0.3463890254497528, 0.09355935454368591, -0.07324735075235367, 0.3152715563774109, -0.12660610675811768, -0.1830863505601883, -0.22522830963134766, -0.13468016684055328, 0.03726636618375778, -0.38471153378486633, 0.17120912671089172, 0.07474569976329803, 0.20621824264526367, -0.13600361347198486, 0.2697547376155853, -0.07007096707820892, 0.13924658298492432, 0.21484503149986267, -0.08472621440887451, 0.14266005158424377, -0.13175061345100403, 0.030941616743803024, -0.022690366953611374, -0.1425504982471466, 0.2947643995285034, 0.2953280806541443, -0.17653357982635498, 0.041553299874067307, 0.024110611528158188, -0.18546085059642792, -0.009322503581643105, 0.25363367795944214, -0.18131402134895325, -0.4489904046058655, 0.15118816494941711, 0.28308945894241333, -0.26668253540992737, 0.22990454733371735, -0.06869532912969589, 0.07493795454502106, 0.4533952474594116, 0.29870128631591797, -0.3921564817428589, -0.2523648738861084, 0.5583537817001343, 0.16921177506446838, -0.20969974994659424, -0.4505482017993927, 0.033252593129873276, -0.2691240906715393, -0.2798444330692291, -0.08666790276765823, -0.11875206232070923, 0.02134964056313038, 0.14152739942073822, -0.42115864157676697, -0.0219563078135252, -0.029618240892887115, 0.14519953727722168, 0.25346288084983826, 0.212147057056427, -0.017701085656881332, -0.2405189424753189, 0.042550187557935715, 0.194753959774971, 0.26115894317626953, 0.35573047399520874, -0.00203762948513031, -0.05431845784187317, 0.18697017431259155, -0.2822278141975403, 0.5819956064224243, 0.07272505015134811, -0.0014893561601638794, 0.0030070841312408447, 0.04146783798933029, -0.05888661742210388, -0.09481317549943924, 0.059825409203767776, -0.10675406455993652, -0.01859404146671295, -0.6992994546890259, -0.6306759715080261, 0.2372550070285797, -0.01592862606048584, -0.03285767510533333, -0.011250346899032593, -0.05652034282684326, -0.11348707228899002, 0.20224806666374207, 0.25055167078971863, 1.0354552268981934, -0.009427353739738464, -0.14189599454402924, 0.26184386014938354, -0.2787016034126282, 0.0028981391806155443, -0.5120136737823486, -0.03865433111786842, -0.2611974775791168, -0.025637026876211166, -0.10924724489450455, -0.02098843827843666, 0.08876372128725052, 0.47418642044067383, -0.431631475687027, 0.14948680996894836, 0.044658809900283813, 0.024009402841329575, 0.11641667783260345, 0.29711785912513733, -0.09332787245512009, -0.08270055055618286, 0.09107930213212967, 0.1874038726091385, -0.11932395398616791, -0.3640354573726654, 0.07495250552892685, -0.385537326335907, 0.23113393783569336, 0.054070018231868744, -0.040463924407958984, -0.061907146126031876, -0.2289307713508606, -0.04524993896484375, 0.008230505511164665, -0.34010791778564453, 0.21146206557750702, 0.21009717881679535, 0.30535632371902466, 0.4538569450378418, -0.30504855513572693, 0.008127950131893158, 0.24614793062210083, 0.03184660151600838, 0.0794902816414833, -0.06246450915932655, 0.11732698976993561, -0.12534399330615997, -0.2722272276878357, 0.22908169031143188, -0.08033723384141922, -0.2945685088634491, -0.0038764625787734985, 0.013627409934997559, 0.14413349330425262, -0.4606720209121704, -0.18015044927597046, 0.12789125740528107, 0.045366350561380386, -0.1995895504951477, 0.17842945456504822, -0.0541636198759079, 0.10472400486469269, 0.20350360870361328, -0.13248693943023682, 0.021367326378822327, -0.0323038212954998, -0.425881564617157, 0.3300512135028839, 0.0039589665830135345, 0.2035452425479889, 0.023749832063913345, -0.27328020334243774, -0.3526456356048584, 0.3131938874721527, 0.10607663542032242, 0.1511983871459961, 0.17811845242977142, -0.18466952443122864, -0.0229683518409729, -0.14802347123622894, 0.3420810103416443, 0.037233710289001465, 0.10303497314453125, -0.10014335811138153, 0.05398699641227722, -0.5348097085952759, -0.05615127086639404, 0.09559349715709686, 0.5384576320648193, 0.19400399923324585, 0.510358452796936, -0.3236635625362396, 0.06474629789590836, -0.43949535489082336, -0.21179305016994476, -0.23308494687080383, 0.0752623900771141, -0.12235116958618164, 0.29612070322036743, -0.19401614367961884, 0.21210670471191406, 0.17450372874736786, 0.025783197954297066, -0.043322376906871796, -0.259886234998703, -0.11822313070297241, 0.12008582800626755, -0.03245989605784416, 0.28644272685050964, 0.019312206655740738, 0.12948137521743774, -0.2655494809150696, -0.13416413962841034, 0.015144411474466324, -0.07881827652454376, 0.06951924413442612, 0.5104804635047913, -0.22747920453548431, -0.0913633331656456, -0.14905372262001038, 0.2395430952310562, -0.07838213443756104, 0.5155772566795349, 0.01257612369954586, 0.3350761830806732, -0.25093698501586914, -0.06488695740699768, 0.5459126830101013, 0.32472461462020874, 0.25861161947250366, 0.11250130832195282, 0.32807353138923645, 0.2617892622947693, 0.033577580004930496, 0.25845688581466675, 0.25616195797920227, -0.05819873511791229, -0.06928277015686035, 0.16516292095184326, 0.11385732144117355, 0.2947339117527008, -0.2784915566444397, 0.17879267036914825, 0.2517821192741394, -0.14219942688941956, 0.3314220905303955, 0.2615625560283661, 0.17779353260993958, 0.1506369709968567, 0.24941739439964294, -0.0877770185470581, 0.11387427151203156, -0.07336702197790146, -0.14528457820415497, 0.21886207163333893, 0.1952570527791977, -0.052711423486471176, 0.1782185584306717, -0.010347578674554825, 0.15480557084083557, 0.21202678978443146, -0.06474816054105759, -0.18984436988830566, 0.4680664539337158, 0.30134275555610657, 0.5858529210090637, -0.1540287584066391, 0.6756648421287537, 0.3679313659667969, 0.01054341346025467, 0.07251344621181488, 0.07245565950870514, 0.09396932274103165, 0.23456662893295288, -0.00265347957611084, 0.03859570622444153, 0.33634695410728455, -0.10599269717931747, 0.02967878431081772, -0.28275471925735474, -0.1694086343050003, 0.17852619290351868, -0.1261054426431656, 0.027213305234909058, -0.08451122045516968, -0.19266590476036072, 0.0979316383600235, 0.3294953405857086, -0.0947032943367958, 0.45351046323776245, 0.0036495812237262726, 0.21965131163597107, -0.3971188962459564, 0.15494249761104584, 0.29211926460266113, -0.18131417036056519, 0.1682891845703125, 0.38254913687705994, 0.26288357377052307, 0.19202560186386108, 0.19389505684375763, -0.22743955254554749, -0.06544111669063568, -0.18331587314605713, -0.26064926385879517, -0.102410688996315, 0.02703109383583069, 0.022411469370126724, 0.5909788608551025, 0.3058345317840576, -0.11940820515155792, 0.001529887318611145, 0.13625796139240265, -0.023656990379095078, -0.23680485785007477, -0.16065645217895508, 0.3916626572608948, -0.38064292073249817, 0.057610884308815, -0.252461701631546, -0.2544969320297241, -0.11671696603298187, 0.6195552349090576, -0.07733430713415146, 0.3121553361415863, 0.03594931215047836, 0.14411818981170654, 0.22984296083450317, 0.1755722314119339, 0.05315110832452774, 0.4343099892139435, -0.15123319625854492, -0.3964027762413025, 0.02755991369485855, 0.18678733706474304, 0.25852087140083313, -0.2970564365386963, 0.09319642931222916, 0.021831104531884193, 0.26116153597831726, 0.37045758962631226, 0.07350396364927292, -0.11937036365270615, 0.012250366620719433, 0.2516915202140808, -0.2448108196258545, 0.03884713724255562, 0.3063204288482666, 0.048732683062553406, -0.0975419133901596, -0.3194727301597595, 0.21594776213169098, 0.22989192605018616, 0.15322542190551758, -0.1776304394006729, 0.15913577377796173, 0.35950618982315063, -0.016285166144371033, 0.22020922601222992, 0.14890038967132568, 0.18734076619148254, -0.36636215448379517, 0.22717249393463135, 0.1775684356689453, 0.09011539816856384, -0.09734832495450974, 0.08581875264644623, 0.15552055835723877, -0.04414486140012741, -0.27417275309562683, -0.04778518155217171, -0.24686284363269806, 0.047974925488233566, 0.2397584170103073, 0.2561515271663666, -0.26328057050704956, 0.16602976620197296, -0.03343520313501358, -0.2725461423397064, 0.033562082797288895, 0.10779769718647003, 0.03329416364431381, 0.11916598677635193, -0.07174090296030045, -0.18614743649959564, 0.25790053606033325, 0.14675816893577576, -0.21354785561561584, 0.3468574285507202, -0.05441714823246002, -0.02825900912284851, 0.3005826473236084, -0.3448376953601837, -0.17614197731018066, 0.5561333894729614, -0.02066311612725258, 0.1606387197971344, 0.24505352973937988, 0.3292219340801239, 0.06661525368690491, -0.17704489827156067, 0.21167024970054626, 0.2741256356239319, -0.3469989597797394, -0.5599481463432312, -0.3031997084617615 ]
https://github.com/huggingface/datasets/issues/5013
would huggingface like publish cpp binding for datasets package ?
Hi ! Can you share more information about your use case ? How could it help you to have cpp bindings versus using the python libraries ?
HI: I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it. thanks
27
would huggingface like publish cpp binding for datasets package ? HI: I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it. thanks Hi ! Can you share more information about your use case ? How could it help you to have cpp bindings versus using the python libraries ?
[ -0.15040680766105652, -0.6395567655563354, -0.08259376883506775, 0.08187495172023773, 0.09981731325387955, -0.24678373336791992, 0.11569446325302124, 0.005057012662291527, -0.10657450556755066, 0.13536906242370605, -0.2619239091873169, 0.26693183183670044, -0.22225558757781982, 0.5219743847846985, 0.37111446261405945, -0.3943830728530884, 0.17358358204364777, 0.3324512839317322, -0.22145530581474304, -0.04748447239398956, 0.09733836352825165, 0.17629596590995789, -0.16279974579811096, 0.14068889617919922, -0.20463235676288605, -0.17664575576782227, -0.09586994349956512, 0.03914375230669975, -0.18030788004398346, -0.1097583994269371, 0.13212928175926208, 0.1396903097629547, 0.21292489767074585, 0.19800177216529846, -0.00011482054833322763, -0.08769576996564865, 0.08808610588312149, 0.10423216223716736, -0.02408408559858799, -0.07698884606361389, -0.06604226678609848, -0.367421418428421, 0.048873573541641235, -0.17854401469230652, -0.09554348886013031, -0.048386864364147186, 0.0039621926844120026, -0.05621718987822533, 0.26965242624282837, -0.05419270321726799, 0.2039746791124344, 0.2774980366230011, 0.1907147765159607, -0.10481122136116028, -0.1669560670852661, 0.12604160606861115, -0.26908451318740845, 0.15292496979236603, 0.5861767530441284, 0.17097394168376923, 0.21687045693397522, -0.012306139804422855, -0.1761806309223175, -0.2761341631412506, 0.2802216410636902, -0.019011005759239197, -0.40274080634117126, -0.11548654735088348, 0.028751906007528305, 0.09092095494270325, 0.6889675855636597, -0.47289010882377625, -0.19402767717838287, -0.3047431707382202, 0.07674389332532883, -0.03697504848241806, 0.13525745272636414, 0.2166711986064911, 0.14962415397167206, 0.499893456697464, -0.4009658992290497, -0.35782837867736816, -0.18349534273147583, -0.07967343926429749, 0.11287452280521393, -0.019660867750644684, -0.2849169373512268, -0.02179931104183197, 0.1239096075296402, -0.2163667529821396, 0.01990116387605667, -0.31151390075683594, 0.2702530324459076, -0.12965449690818787, 0.23048889636993408, -0.3499177396297455, -0.04582040011882782, 0.422859787940979, 0.03400436043739319, 0.13011988997459412, -0.05078612267971039, 0.07861921936273575, -0.1480352133512497, -0.05873050540685654, 0.17721101641654968, -0.1075020581483841, 0.13501495122909546, 0.3673323690891266, 0.24427029490470886, -0.05262459069490433, 0.09654387831687927, -0.06747786700725555, 0.179966002702713, 0.18573054671287537, 0.023238688707351685, -0.45841333270072937, -0.14202433824539185, -0.47521695494651794, 0.08966455608606339, -0.04356428235769272, 0.03718104213476181, -0.1003601923584938, 0.13213203847408295, 0.3473590910434723, -0.1519620418548584, 0.1532265543937683, 0.01447904109954834, -0.06820270419120789, 0.057520754635334015, 0.05833094194531441, -0.1717587262392044, 0.1554834395647049, -0.24682554602622986, -0.03609248250722885, 0.17413634061813354, -0.4627552628517151, 0.17845287919044495, 0.20957086980342865, 0.24318043887615204, 0.14271745085716248, -0.01098729483783245, 0.28190848231315613, -0.11287081986665726, -0.04505064710974693, -0.15112610161304474, 0.0792996883392334, -0.2478993684053421, -0.1297110915184021, -0.3345680236816406, 0.0490720234811306, -0.19971010088920593, 0.03140423819422722, 0.05091261863708496, 0.19995607435703278, -0.33533406257629395, -0.16392502188682556, -0.27987027168273926, 0.11731380224227905, -0.2809712290763855, -0.05703633278608322, 0.3059147596359253, 0.15834182500839233, -0.08507321774959564, -0.31069663166999817, 0.06235475093126297, 0.055481232702732086, -0.20935942232608795, -0.3201506733894348, 0.41176173090934753, -0.22796416282653809, 0.18237635493278503, 0.3944738805294037, -0.16813862323760986, -0.2183326780796051, -0.008507950231432915, -0.13644970953464508, 0.30104121565818787, -0.2521206736564636, -0.5235491991043091, 0.31612375378608704, -0.03227509930729866, -0.00932125560939312, 0.010359838604927063, 0.21536768972873688, -0.09008524566888809, -0.031809113919734955, -0.07968726754188538, -0.10210278630256653, 0.12670345604419708, -0.04456241428852081, -0.1314345747232437, 0.07530783861875534, 0.2138756513595581, 0.14906930923461914, -0.08220203220844269, 0.048804134130477905, 0.16510875523090363, 0.0595480278134346, 0.11935867369174957, -0.1411537379026413, 0.07822098582983017, 0.18890202045440674, 0.32536324858665466, -0.032356202602386475, 0.04419052600860596, -0.4069835841655731, -0.039256103336811066, 0.09443259984254837, -0.12358979880809784, -0.11474958062171936, 0.16398200392723083, -0.18824586272239685, -0.061888810247182846, 0.07485633343458176, 0.3303830027580261, -0.15982955694198608, -0.08185137808322906, -0.06851808726787567, 0.24798795580863953, -0.06050167977809906, -0.4558217227458954, 0.6992427110671997, 0.003520609810948372, 0.28192073106765747, -0.13856174051761627, 0.19363094866275787, -0.04173099249601364, 0.1067158430814743, 0.08353203535079956, 0.4153892695903778, -0.13313797116279602, -0.1382867842912674, 0.18480291962623596, 0.12613695859909058, -0.29083511233329773, 0.11242218315601349, 0.2091347873210907, 0.13608604669570923, 0.31558260321617126, -0.4015275835990906, 0.19998332858085632, -0.31473425030708313, 0.009839406237006187, 0.006247721612453461, -0.2128984034061432, 0.3711799383163452, 0.07542555779218674, -0.04168210178613663, -0.0891135036945343, -0.144648939371109, -0.117139533162117, -0.10778351128101349, -0.1588839292526245, 0.06719501316547394, 0.31640559434890747, 0.013500171713531017, 0.6637201905250549, 0.3117285370826721, -0.6145246624946594, -0.07017464190721512, 0.13224078714847565, -0.2857741415500641, -0.003363974392414093, 0.30581027269363403, -0.1327098309993744, 0.1257477104663849, 0.4169210195541382, -0.08512960374355316, 0.42749810218811035, 0.24426721036434174, 0.08698627352714539, -0.006417999044060707, 0.10182850062847137, -0.14890427887439728, -0.03323442488908768, -0.18514464795589447, -0.5368249416351318, -0.22387024760246277, -0.09355640411376953, 0.20058096945285797, -0.10193870961666107, 0.3584524691104889, -0.38979947566986084, -0.12447522580623627, -0.10643894970417023, -0.05872245877981186, -0.41068515181541443, -0.5238620638847351, -0.19758328795433044, 0.14416585862636566, -0.3246100842952728, 0.26943206787109375, -0.046258069574832916, -0.26018068194389343, 0.35528653860092163, 0.18154260516166687, -0.10679461061954498, 0.35262370109558105, -0.5772725939750671, -0.2040395885705948, -0.14711780846118927, 0.26857826113700867, -0.010523095726966858, 0.21554243564605713, -0.0327351838350296, 0.1364438384771347, 0.478159636259079, -0.02200583927333355, 0.10958801209926605, -0.2930747866630554, -0.3187205195426941, 0.07492254674434662, -0.05362595617771149, -0.09542182087898254, 0.3626752495765686, -0.12947002053260803, -0.03370978310704231, -0.06792772561311722, 0.07718179374933243, -0.04720504209399223, -0.2238224595785141, -0.10525254160165787, -0.007139410823583603, -0.19665645062923431, -0.05372148007154465, 0.10319257527589798, -0.26605480909347534, -0.3020975887775421, 0.7476904988288879, 0.08517369627952576, -0.11619588732719421, 0.05669088661670685, -0.17180675268173218, 0.1251075565814972, 0.02607295848429203, 0.3130713701248169, 0.04449864849448204, -0.2959330976009369, 0.008629802614450455, 0.045819126069545746, -0.24554701149463654, -0.08559859544038773, 0.17777250707149506, 0.18751654028892517, -0.01800231821835041, -0.2963804006576538, -0.1691283881664276, -0.1607542634010315, 0.14585596323013306, 0.3017529845237732, 0.633018434047699, 0.01212570071220398, 0.23022332787513733, -0.050944797694683075, -0.1659536063671112, -0.27816277742385864, -0.1495850682258606, -0.14533627033233643, 0.28654539585113525, 0.25683367252349854, -0.06397982686758041, -0.057924121618270874, 0.3952171206474304, 0.4343600571155548, -0.3655233681201935, 0.24294951558113098, 0.16364459693431854, 0.49048078060150146, -0.10640830546617508, -0.5064266324043274, 0.10474105179309845, 0.0854375883936882, 0.3528687357902527, 0.1533319652080536, 0.22682726383209229, -0.0012110238894820213, -0.31655973196029663, -0.35529381036758423, -0.14948435127735138, -0.004702594131231308, -0.1795792132616043, 0.30953121185302734, 0.27983880043029785, 0.021664556115865707, -0.3082638680934906, -0.06862707436084747, 0.00513039343059063, 0.27676814794540405, 0.32019755244255066, -0.010941855609416962, 0.047829996794462204, -0.36997121572494507, 0.00988793931901455, -0.7235023975372314, 0.24953661859035492, -0.20176814496517181, -0.04516267776489258, -0.3018038272857666, 0.06895287334918976, 0.2479374259710312, 0.032410092651844025, 0.257036030292511, -0.23511750996112823, -0.3121473789215088, -0.16049982607364655, -0.33949345350265503, -0.08343930542469025, 0.46905258297920227, -0.3123517334461212, 0.3493187725543976, 0.10032664239406586, 0.49530869722366333, -0.26662278175354004, -0.254574179649353, 0.07659512758255005, 0.07725642621517181, 0.19549915194511414, -0.37983131408691406, 0.07949972152709961, 0.02414552867412567, 0.06333782523870468, -0.05818686634302139, -0.14120961725711823, 0.01739605888724327, 0.20199498534202576, -0.11102287471294403, -0.14886237680912018, -0.04171794652938843, 0.2757205069065094, -0.11222779750823975, -0.2776819169521332, 0.07029151916503906, 0.2155437469482422, 0.057892341166734695, 0.4710318446159363, 0.08417760580778122, 0.2897244095802307, -0.6316888928413391, -0.16397243738174438, -0.18408438563346863, 0.5605618357658386, 0.48848822712898254, 0.1621517837047577, -0.03190543130040169, 0.3751744031906128, 0.23865319788455963, 0.08305712789297104, -0.20760475099086761, -0.05355269834399223, 0.08490123599767685, 0.2973102629184723, -0.5854732394218445, -0.38978278636932373, 0.33404189348220825, 0.48188453912734985, -0.15172883868217468, 0.27754122018814087, 0.34155768156051636, -0.20867811143398285, -0.2793208956718445, -0.04176905006170273, 1.0230101346969604, -0.22092850506305695, 0.1507376879453659, -0.24861973524093628, -0.2831915020942688, 0.6773512959480286, 0.2378763109445572, -0.1795540601015091, -0.3767404556274414, -0.26181674003601074, -0.06304541230201721, -0.29328885674476624, 0.03973224759101868, 0.05525931715965271, -0.24688586592674255, 0.3114432096481323, 0.36851876974105835, -0.19936728477478027, 0.06331928819417953, 0.46071767807006836, -0.13756702840328217, -0.15713635087013245, -0.520010232925415, 0.129236102104187, -0.13414199650287628, 0.17396555840969086, -0.12134132534265518, -0.28760772943496704, -0.05344002693891525, -0.2448880970478058, -0.15748275816440582, -0.05995408445596695, -0.2264065444469452, -0.19410888850688934, 0.4359687864780426, -0.4466888904571533, 0.6375424265861511, 0.0835513025522232, 0.3901205062866211, 0.3821920156478882, -0.1170867383480072, -0.05281832441687584, -0.18369963765144348, 0.07176055759191513, 0.016999999061226845, 0.12693649530410767, 0.06515072286128998, -0.04361516609787941, -0.023070380091667175, 0.05977817624807358, -0.03224418684840202, -0.020304199308156967, 0.25576528906822205, 0.2527081370353699, 0.23703378438949585, -0.3753560483455658, -0.01434620376676321, 0.0051895007491111755, 0.11753453314304352, -0.016302889212965965, 0.1133718192577362, 0.2431105673313141, 0.2361128330230713, 0.12268143892288208, 0.30175095796585083, -0.0726248174905777, -0.17246194183826447, 0.28893402218818665, -0.14091825485229492, -0.2870487570762634, -0.1385457068681717, -0.051591865718364716, -0.38929450511932373, -0.12264072149991989, -0.025362685322761536, -0.001556596951559186, -0.0592552050948143, -0.059047553688287735, 0.4029199779033661, -0.006956323981285095, -0.04276718199253082, 0.3462211787700653, 0.3278660178184509, -0.3396741449832916, -0.09163946658372879, 0.22536849975585938, -0.500781774520874, 0.2604912519454956, -0.1266576647758484, 0.2782736122608185, 0.23614129424095154, 0.09709504246711731, 0.14458870887756348, 0.07553806155920029, -0.30670633912086487, 0.1038634181022644, -0.021715961396694183, -0.21893379092216492, 0.5610944032669067, -0.1309627890586853, -0.2038099467754364, -0.04250357300043106, 0.07947931438684464, 0.15517151355743408, -0.1458142101764679, -0.18422549962997437, -0.2692818343639374, 0.13784825801849365, 0.015436120331287384, -0.14508572220802307, -0.14814698696136475, -0.10257283598184586, 0.05019676685333252, -0.15968555212020874, -0.07271847873926163, 0.2115466296672821, 0.18974697589874268, -0.16989772021770477, 0.12854450941085815, -0.24322548508644104, -0.32210463285446167, 0.3992733657360077, 0.03028932586312294, 0.042534343898296356, -0.03014214150607586, 0.006216064095497131, -0.14089785516262054, -0.07156859338283539, 0.11636218428611755, 0.3321749269962311, 0.40549468994140625, -0.05803823471069336, 0.14326339960098267, 0.11824311316013336, -0.10941427946090698, 0.4907258152961731, 0.47838231921195984, -0.05741085857152939, -0.07379435747861862, 0.20841820538043976, 0.5226777195930481, 0.17969681322574615, -0.2186509221792221, -0.2765624225139618, 0.20026884973049164, 0.09264631569385529, -0.04676743596792221, 0.4203796684741974, 0.27856725454330444, 0.2195509374141693, 0.33239293098449707, -0.31509125232696533, 0.32495591044425964, 0.14340844750404358, -0.1974400132894516, -0.04249535873532295, 0.30470311641693115, -0.07076740264892578, 0.3387809991836548, 0.6385720372200012, 0.13979941606521606, -0.3309043049812317, -0.07381445914506912, -0.1100744903087616, -0.12303168326616287, 0.26126396656036377, 0.2651146352291107, -0.19584716856479645, 0.1727028638124466, -0.21161159873008728, 0.16296276450157166, 0.05513482540845871, -0.14642919600009918, 0.873859167098999, -0.3048456013202667, 0.015100279822945595, 0.3305808901786804, 0.4981941282749176, -0.14207172393798828, -0.09329241514205933, 0.32112082839012146, 0.06159604340791702, -0.18951605260372162, -0.1461368352174759, -0.16365276277065277, -0.14767801761627197, 0.28621405363082886, -0.0885268896818161, 0.3696732521057129, -0.26123225688934326, -0.14670640230178833, 0.30933141708374023, 0.35818248987197876, -0.10110712051391602, 0.19298718869686127, -0.4342384934425354, -0.0034628957509994507, -0.034135621041059494, 0.28686895966529846, 0.22862665355205536, -0.14878259599208832, 0.29137977957725525, 0.07416988909244537, -0.0006391853094100952, 0.18261052668094635, 0.08090659230947495, 0.23724189400672913, 0.0845319926738739, 0.08147342503070831, 0.11378055810928345, 0.02976442687213421, -0.1154133528470993, -0.19229227304458618, -0.08674012124538422, 0.12124234437942505, -0.5860565304756165, 0.1291564404964447, -0.2158033698797226, -0.24863743782043457, -0.34884023666381836, 0.083934485912323, -0.28647470474243164, 0.24869686365127563, 0.19226282835006714, -0.15360428392887115, -0.20683538913726807, -0.17407792806625366, 0.051946207880973816, 0.12627975642681122, 0.3042764365673065, 0.39064130187034607, 0.5155893564224243, -0.038947273045778275, -0.30461305379867554, -0.2959286570549011, 0.211228147149086, 0.13121603429317474, -0.12694986164569855, -0.15238215029239655, -0.4049919843673706, 0.15804150700569153, -0.0386684387922287, -0.02652040123939514, 0.3116632103919983, 0.15450267493724823, -0.04286326467990875, 0.13317523896694183, 0.17594121396541595, 0.19180122017860413, -0.12078382074832916, 0.13186152279376984, 0.13888883590698242, 0.10237875580787659, 0.19353698194026947, -0.014311958104372025, -0.3427738547325134, 0.23270806670188904, -0.11059172451496124, -0.17572283744812012, 0.2723422944545746, 0.018278729170560837, 0.36810174584388733, -0.04314977675676346, -0.11088637262582779, 0.4374510645866394, -0.2511264383792877, -0.031162787228822708, 0.07183089852333069, -0.003845781087875366, -0.12973472476005554, -0.20995189249515533, -0.3009486198425293, 0.11358442902565002, -0.009127154015004635, 0.18821963667869568, -0.0006053495453670621, -0.08984164148569107, -0.19828687608242035, -0.4027819037437439, -0.2497321367263794, 0.21215246617794037, 0.3457258641719818, -0.023260489106178284, -0.09359534084796906, -0.2438420057296753, -0.3184899389743805, 0.42847949266433716, -0.2567945122718811, 0.16037587821483612, 0.19922521710395813, 0.11708801239728928, 0.1423540860414505, -0.43346595764160156, -0.57305508852005, -0.20739784836769104, 0.34822842478752136, -0.1553676426410675, -0.010498883202672005, 0.1405695527791977, -0.33240658044815063, -0.0023625902831554413, -0.02525286003947258, 0.6638485193252563, 0.01692289300262928, -0.07903440296649933, 0.2349894642829895, -0.1641753613948822 ]
https://github.com/huggingface/datasets/issues/5013
would huggingface like publish cpp binding for datasets package ?
> Hi ! Can you share more information about your use case ? How could it help you to have cpp bindings versus using the python libraries ? for example ,the huggingface load_model() and load_dataset() can execute in cpp env
HI: I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it. thanks
40
would huggingface like publish cpp binding for datasets package ? HI: I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it. thanks > Hi ! Can you share more information about your use case ? How could it help you to have cpp bindings versus using the python libraries ? for example ,the huggingface load_model() and load_dataset() can execute in cpp env
[ -0.11176742613315582, -0.7132203578948975, -0.0498846210539341, 0.10632003843784332, 0.14780597388744354, -0.19892370700836182, 0.10186192393302917, 0.0233752503991127, -0.04466817528009415, 0.11003843694925308, -0.30504894256591797, 0.2888956069946289, -0.20051023364067078, 0.5899175405502319, 0.4581059515476227, -0.3811780512332916, 0.1806940734386444, 0.3134225904941559, -0.2460210621356964, -0.03311091288924217, 0.0569852739572525, 0.17837589979171753, -0.11085712909698486, 0.17522116005420685, -0.09773727506399155, -0.07950110733509064, -0.1486460119485855, 0.10134349763393402, -0.14910219609737396, -0.1382952481508255, 0.25182583928108215, 0.13059110939502716, 0.30249011516571045, 0.11294223368167877, -0.00011583448940655217, -0.08918783813714981, 0.05865153670310974, 0.06797973066568375, -0.07323649525642395, -0.1164412647485733, -0.06348231434822083, -0.40081170201301575, 0.13385604321956635, -0.223272442817688, -0.03831532225012779, -0.0471317432820797, 0.028588907793164253, -0.03059028461575508, 0.3042580187320709, -0.02532113902270794, 0.17973929643630981, 0.32123416662216187, 0.21531672775745392, -0.10059545934200287, -0.25536713004112244, 0.0851532593369484, -0.23661671578884125, 0.23868075013160706, 0.5729930996894836, 0.15738330781459808, 0.19546622037887573, -0.036101143807172775, -0.15047307312488556, -0.3019498288631439, 0.3739714026451111, -0.012738863937556744, -0.28743991255760193, -0.09855417907238007, -0.03463754057884216, 0.09140665829181671, 0.576279878616333, -0.487397164106369, -0.2050744593143463, -0.3680430054664612, 0.07992542535066605, -0.06552238762378693, 0.14108318090438843, 0.18075749278068542, 0.14175044000148773, 0.47230905294418335, -0.4164770245552063, -0.42418381571769714, -0.18826043605804443, -0.12017171084880829, 0.19367948174476624, -0.027827255427837372, -0.22971805930137634, -0.002878151834011078, 0.16457217931747437, -0.16732928156852722, -0.052412595599889755, -0.3055940270423889, 0.3111753761768341, -0.12195730209350586, 0.1390092670917511, -0.305715948343277, -0.02939421683549881, 0.43608739972114563, 0.07943667471408844, 0.16749191284179688, -0.11442138254642487, 0.05638319253921509, -0.030675504356622696, -0.03745774179697037, 0.1608182191848755, -0.06276874244213104, 0.12827113270759583, 0.37485092878341675, 0.1815251111984253, 0.0000679293880239129, 0.11854848265647888, -0.09665136784315109, 0.09806254506111145, 0.22902129590511322, -0.0731111466884613, -0.4291723668575287, -0.21136009693145752, -0.4502377510070801, 0.08800646662712097, -0.04868193343281746, 0.0678640753030777, -0.056263476610183716, 0.1931188851594925, 0.33304208517074585, -0.1779402792453766, 0.15491220355033875, 0.081510029733181, -0.041373685002326965, -0.009602207690477371, 0.08311160653829575, -0.1365116387605667, 0.14457657933235168, -0.28067877888679504, -0.01737394742667675, 0.13860318064689636, -0.5119116902351379, 0.2536941468715668, 0.1936091035604477, 0.30956774950027466, 0.1328195035457611, -0.05427653342485428, 0.3340478539466858, -0.16229578852653503, -0.08369578421115875, -0.15986081957817078, 0.11842916160821915, -0.17269840836524963, -0.139751598238945, -0.3252561688423157, -0.06178002804517746, -0.2792053520679474, -0.018951918929815292, 0.099684938788414, 0.1702747792005539, -0.2792212963104248, -0.12979084253311157, -0.3075990080833435, 0.14111264050006866, -0.26331189274787903, -0.1186361312866211, 0.2988140285015106, 0.12962652742862701, -0.13759247958660126, -0.2966669201850891, 0.1977800577878952, 0.08493523299694061, -0.14206701517105103, -0.37624049186706543, 0.39480382204055786, -0.2138422578573227, 0.12984035909175873, 0.3791329264640808, -0.1511656939983368, -0.23165160417556763, -0.06429857760667801, -0.21351107954978943, 0.22461390495300293, -0.32223471999168396, -0.4616162180900574, 0.326048344373703, -0.01808711141347885, 0.048685021698474884, 0.028932958841323853, 0.19070570170879364, -0.1220274269580841, -0.08579782396554947, 0.010068371891975403, -0.09505084902048111, 0.11415551602840424, -0.0807899460196495, -0.100035160779953, 0.05969100445508957, 0.22691410779953003, 0.08912917971611023, -0.09287038445472717, 0.08126953989267349, 0.08461768180131912, 0.034204721450805664, 0.1463153064250946, -0.14470043778419495, 0.052744440734386444, 0.22691260278224945, 0.21617251634597778, -0.02184702455997467, 0.03533459082245827, -0.35582929849624634, -0.11246348172426224, 0.1652463972568512, -0.20055298507213593, -0.11645187437534332, 0.20178022980690002, -0.1565903276205063, -0.04218125343322754, 0.12242995947599411, 0.3388209044933319, -0.2751278579235077, -0.11418966948986053, -0.07351149618625641, 0.21802279353141785, -0.04915795102715492, -0.44960784912109375, 0.7378693222999573, -0.04536067321896553, 0.26928311586380005, -0.29819825291633606, 0.13570618629455566, -0.01920182816684246, 0.1568935364484787, 0.01785750687122345, 0.4134688377380371, -0.11917305737733841, -0.1497221142053604, 0.13568833470344543, 0.19885075092315674, -0.305097371339798, 0.11992646753787994, 0.15316198766231537, 0.130033940076828, 0.2862767279148102, -0.3540433347225189, 0.1839328408241272, -0.34135428071022034, 0.07107684761285782, 0.008288010954856873, -0.19183477759361267, 0.4190298318862915, 0.05360255390405655, 0.027737177908420563, -0.006432931870222092, -0.13651442527770996, -0.12424169480800629, -0.08138575404882431, -0.25504636764526367, 0.047669827938079834, 0.38066375255584717, 0.08710791170597076, 0.7291936278343201, 0.28607603907585144, -0.5783029794692993, -0.1981113851070404, 0.1288074404001236, -0.17777889966964722, -0.02762698382139206, 0.28043800592422485, -0.14450231194496155, 0.08559966832399368, 0.4453447759151459, -0.09183688461780548, 0.46606725454330444, 0.19898344576358795, 0.06628695130348206, 0.06515789777040482, 0.08720336109399796, -0.1361570656299591, 0.011820286512374878, -0.14159464836120605, -0.504155695438385, -0.23070812225341797, -0.13283047080039978, 0.13967198133468628, -0.05936603248119354, 0.3485769033432007, -0.4075355529785156, -0.16148047149181366, -0.15883375704288483, 0.02305581234395504, -0.4070379436016083, -0.4619773328304291, -0.19620631635189056, 0.10726379603147507, -0.32940179109573364, 0.2895652949810028, -0.03965295851230621, -0.29169484972953796, 0.3715673089027405, 0.19226409494876862, -0.03594929724931717, 0.3066083788871765, -0.5922433733940125, -0.1737523227930069, -0.21756266057491302, 0.2861068546772003, -0.01793232187628746, 0.1676846444606781, -0.042232345789670944, 0.10583824664354324, 0.4775121510028839, -0.012607251293957233, 0.11706125736236572, -0.19171841442584991, -0.31917935609817505, 0.09216153621673584, -0.048864491283893585, -0.022185159847140312, 0.4036954343318939, -0.1428164392709732, -0.07295051217079163, -0.1002761721611023, 0.13973762094974518, -0.05632734298706055, -0.1604882925748825, -0.08016663789749146, 0.013543365523219109, -0.10627982765436172, -0.06190085783600807, 0.07699432224035263, -0.27636221051216125, -0.30519723892211914, 0.6916824579238892, 0.0835094302892685, -0.15347185730934143, 0.10119229555130005, -0.13742943108081818, 0.12463144958019257, -0.002860299777239561, 0.30080434679985046, 0.09525879472494125, -0.2726936340332031, 0.026060260832309723, 0.03961760923266411, -0.21473760902881622, -0.14469298720359802, 0.17271371185779572, 0.21821092069149017, 0.02061491645872593, -0.25823426246643066, -0.17656965553760529, -0.04864737391471863, 0.09483425319194794, 0.23645448684692383, 0.5691381096839905, -0.051837921142578125, 0.18941648304462433, 0.006422968581318855, -0.130780890583992, -0.21601952612400055, -0.14796605706214905, -0.16067922115325928, 0.28961366415023804, 0.20438992977142334, 0.08679774403572083, -0.06936173886060715, 0.333465039730072, 0.4169929325580597, -0.3255592882633209, 0.2731170058250427, 0.16901402175426483, 0.5106438994407654, -0.14006152749061584, -0.5101746320724487, 0.1028863713145256, 0.04409317672252655, 0.30638086795806885, 0.21769002079963684, 0.208619624376297, 0.07003483921289444, -0.37888842821121216, -0.3409809172153473, -0.027383405715227127, -0.03735674172639847, -0.1562625616788864, 0.31280717253685, 0.30519676208496094, -0.0017924606800079346, -0.2337610125541687, -0.08677956461906433, 0.042226389050483704, 0.28168225288391113, 0.34945148229599, 0.010413870215415955, 0.08627322316169739, -0.35878586769104004, -0.02858099341392517, -0.735401451587677, 0.21028247475624084, -0.20649200677871704, -0.05339984595775604, -0.25493791699409485, 0.04184558987617493, 0.26431143283843994, 0.026478394865989685, 0.2792692184448242, -0.15393972396850586, -0.3292349576950073, -0.22458471357822418, -0.33949020504951477, -0.16831576824188232, 0.4336572289466858, -0.27779653668403625, 0.2954111695289612, 0.0983486920595169, 0.532102644443512, -0.29298752546310425, -0.2955557107925415, 0.02636421099305153, 0.12554576992988586, 0.15070341527462006, -0.3391648232936859, 0.02625804767012596, 0.016548622399568558, 0.0007285512983798981, -0.07344754785299301, -0.18326961994171143, -0.006888107396662235, 0.1801459640264511, -0.07146341353654861, -0.13808035850524902, 0.0323488675057888, 0.24107149243354797, -0.12270849943161011, -0.25210320949554443, 0.002492786617949605, 0.21680352091789246, 0.06613326072692871, 0.45701292157173157, 0.08969326317310333, 0.25394922494888306, -0.6588690876960754, -0.22349897027015686, -0.20342984795570374, 0.6105541586875916, 0.49504750967025757, 0.123576320707798, -0.02768293023109436, 0.3707645833492279, 0.3124234974384308, 0.08797655254602432, -0.23444579541683197, -0.07079127430915833, 0.1003633514046669, 0.28958097100257874, -0.6134358048439026, -0.4710008203983307, 0.3338608741760254, 0.45715898275375366, -0.11645689606666565, 0.22733065485954285, 0.26117581129074097, -0.22910404205322266, -0.30082881450653076, -0.0450868234038353, 0.9608798623085022, -0.24471934139728546, 0.1531701534986496, -0.17011913657188416, -0.18360725045204163, 0.7175765633583069, 0.20123906433582306, -0.20773357152938843, -0.3807101249694824, -0.23027703166007996, -0.06107407808303833, -0.2564909756183624, 0.10304439067840576, 0.026902837678790092, -0.20112285017967224, 0.32873740792274475, 0.4497120976448059, -0.21730339527130127, 0.027503542602062225, 0.49058741331100464, -0.16299763321876526, -0.2031548172235489, -0.602470338344574, 0.10323165357112885, -0.10381565988063812, 0.15608496963977814, -0.1341833472251892, -0.28108030557632446, -0.012309763580560684, -0.2986975908279419, -0.0954938605427742, -0.06121300160884857, -0.21764734387397766, -0.15161368250846863, 0.43109428882598877, -0.5218401551246643, 0.6430709958076477, 0.1794026792049408, 0.3538816571235657, 0.3808833062648773, -0.12471725046634674, -0.05996226891875267, -0.24689248204231262, 0.09629451483488083, -0.023322105407714844, 0.08935898542404175, 0.017455630004405975, -0.029998134821653366, 0.01161772757768631, -0.012560911476612091, -0.03670318052172661, -0.03566411882638931, 0.28806257247924805, 0.253511905670166, 0.30258384346961975, -0.3216876983642578, -0.0179964117705822, -0.0425858199596405, 0.1579674333333969, -0.02152852714061737, 0.07536216080188751, 0.2327136993408203, 0.242399200797081, 0.038078974932432175, 0.36207276582717896, -0.1197507232427597, -0.1609065681695938, 0.2785930633544922, -0.1497993767261505, -0.25957489013671875, -0.0538189560174942, -0.013689674437046051, -0.3413050174713135, -0.08860847353935242, -0.057423803955316544, 0.035769738256931305, -0.10181090235710144, -0.06426544487476349, 0.5007816553115845, 0.037132322788238525, -0.08678573369979858, 0.27285999059677124, 0.29262131452560425, -0.5076143145561218, -0.036506909877061844, 0.19968748092651367, -0.5511590838432312, 0.3428846597671509, -0.13558632135391235, 0.2681325674057007, 0.2769075036048889, 0.03217477723956108, 0.12413506209850311, 0.10181865841150284, -0.2721092700958252, 0.04794221371412277, -0.04987115412950516, -0.2295708954334259, 0.5991711616516113, -0.10994312912225723, -0.1711328774690628, 0.010760989040136337, 0.05664587765932083, 0.14416997134685516, -0.18300266563892365, -0.14794063568115234, -0.26504138112068176, 0.1550413966178894, 0.002503184601664543, -0.1132613942027092, -0.17779837548732758, -0.1510256975889206, 0.0396568700671196, -0.2550968527793884, -0.06669573485851288, 0.19661685824394226, 0.19298167526721954, -0.17972354590892792, 0.09591735154390335, -0.11160057038068771, -0.33309733867645264, 0.4206404983997345, 0.05709175765514374, 0.013681285083293915, -0.0206131674349308, -0.004074282944202423, -0.16690833866596222, -0.06221936643123627, -0.0006380249396897852, 0.32470762729644775, 0.44422388076782227, -0.014559119939804077, 0.13397139310836792, 0.174915611743927, -0.11038461327552795, 0.4043174684047699, 0.4331454634666443, 0.019131075590848923, -0.036883775144815445, 0.22909696400165558, 0.5439358949661255, 0.14466695487499237, -0.17166636884212494, -0.2129897028207779, 0.20833633840084076, 0.02704085409641266, -0.04208070784807205, 0.39596590399742126, 0.300481379032135, 0.19346237182617188, 0.36246639490127563, -0.347007691860199, 0.3370603919029236, 0.19910556077957153, -0.1849554181098938, -0.00035709142684936523, 0.34880807995796204, -0.005480948835611343, 0.2802206873893738, 0.6103806495666504, 0.19923201203346252, -0.38663190603256226, -0.1037527397274971, -0.13257990777492523, -0.1256864368915558, 0.2626907229423523, 0.25143274664878845, -0.23790715634822845, 0.060840945690870285, -0.2852562367916107, 0.13688123226165771, 0.06637459248304367, -0.1565004140138626, 0.9137787222862244, -0.3332066535949707, 0.04522953927516937, 0.23990681767463684, 0.5086293816566467, -0.13488665223121643, -0.15742948651313782, 0.31753426790237427, 0.06875384598970413, -0.18018504977226257, -0.10297411680221558, -0.15128827095031738, -0.1687983274459839, 0.24302901327610016, -0.06936617195606232, 0.3953074812889099, -0.24886970221996307, -0.19966304302215576, 0.3398444950580597, 0.2635190188884735, -0.0909784659743309, 0.17337854206562042, -0.39759743213653564, 0.0221954844892025, -0.05167626962065697, 0.17670969665050507, 0.18580542504787445, -0.1509767770767212, 0.2974146902561188, 0.033772945404052734, 0.062000297009944916, 0.24883057177066803, 0.06254173815250397, 0.21495388448238373, 0.09397320449352264, 0.13387148082256317, 0.10290329158306122, 0.011225787922739983, -0.09876643121242523, -0.2514135241508484, -0.08973611891269684, 0.1038796454668045, -0.5956958532333374, 0.11731953918933868, -0.18489551544189453, -0.198754221200943, -0.34260985255241394, 0.09400097280740738, -0.299474835395813, 0.2534700334072113, 0.16543249785900116, -0.1008911281824112, -0.22680243849754333, -0.17357909679412842, 0.03794641047716141, 0.10849973559379578, 0.32017454504966736, 0.3634537160396576, 0.47058960795402527, -0.053535789251327515, -0.2665516138076782, -0.313760906457901, 0.18249905109405518, 0.1621749997138977, -0.13728861510753632, -0.1559600979089737, -0.4545365273952484, 0.19865252077579498, -0.05558200180530548, -0.07570965588092804, 0.3097367584705353, 0.18806658685207367, -0.007584318518638611, 0.17871502041816711, 0.16802749037742615, 0.13949984312057495, -0.09227149933576584, 0.14172738790512085, 0.14845746755599976, 0.05220978334546089, 0.21361702680587769, -0.050300247967243195, -0.32887721061706543, 0.24516066908836365, -0.04952152445912361, -0.186074897646904, 0.35089901089668274, 0.02981512062251568, 0.40254905819892883, -0.038274459540843964, -0.1614043265581131, 0.4052295982837677, -0.23541861772537231, 0.029408592730760574, 0.10050579905509949, -0.06142247095704079, -0.17489466071128845, -0.23631012439727783, -0.3623351454734802, 0.03741167485713959, 0.034931547939777374, 0.17714083194732666, -0.08837494254112244, -0.09608397632837296, -0.1964419186115265, -0.38320034742355347, -0.23730649054050446, 0.1953366994857788, 0.3963960111141205, 0.025354847311973572, -0.08136001229286194, -0.19203433394432068, -0.20889931917190552, 0.4262186288833618, -0.287702739238739, 0.19880570471286774, 0.22006887197494507, 0.15002453327178955, 0.10265813767910004, -0.36769628524780273, -0.6036170125007629, -0.1962675154209137, 0.3207840621471405, -0.11254698783159256, -0.03862554952502251, 0.1640228033065796, -0.324958473443985, 0.028591405600309372, -0.05349735915660858, 0.6783946752548218, 0.006966821849346161, -0.08656737953424454, 0.26955679059028625, -0.16017505526542664 ]
https://github.com/huggingface/datasets/issues/5013
would huggingface like publish cpp binding for datasets package ?
If it's a viable option for you, you can check [tch-rs](https://github.com/LaurentMazare/tch-rs) to load models in Rust. Regarding datasets, you can first download them in python and then use Arrow C++ or Rust to load them
HI: I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it. thanks
35
would huggingface like publish cpp binding for datasets package ? HI: I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it. thanks If it's a viable option for you, you can check [tch-rs](https://github.com/LaurentMazare/tch-rs) to load models in Rust. Regarding datasets, you can first download them in python and then use Arrow C++ or Rust to load them
[ -0.43060657382011414, -0.32234787940979004, 0.00538407638669014, 0.10048864036798477, 0.11539752781391144, -0.07726025581359863, -0.02929486706852913, 0.1796390861272812, 0.06182944402098656, 0.07767027616500854, -0.5464898347854614, 0.30839598178863525, -0.25403207540512085, 0.6031463146209717, 0.4190945327281952, -0.2802647054195404, 0.25195854902267456, 0.3684403598308563, -0.3062751293182373, -0.08016789704561234, 0.1383488029241562, 0.2822090983390808, 0.08936801552772522, 0.04652330279350281, -0.04469296336174011, -0.0850779265165329, -0.08378522098064423, 0.17010022699832916, -0.1550537645816803, -0.11335813254117966, 0.14591190218925476, 0.1879405379295349, 0.3733561933040619, 0.34791719913482666, -0.00010984758409904316, 0.02202180027961731, 0.060951512306928635, 0.030520284548401833, 0.15208688378334045, -0.22573189437389374, 0.14585161209106445, -0.0669388622045517, 0.14123789966106415, -0.14143703877925873, -0.043743908405303955, -0.01763887330889702, 0.07702486217021942, 0.1539553999900818, 0.4048861265182495, -0.09181764721870422, 0.20407219231128693, 0.6909476518630981, 0.46114349365234375, -0.23183424770832062, -0.027697458863258362, -0.006548434495925903, -0.05137676000595093, 0.4200765788555145, 0.321757972240448, 0.18588735163211823, 0.087468221783638, 0.11877322196960449, -0.12551815807819366, -0.09071046113967896, 0.3928041160106659, -0.12304212898015976, -0.3040580451488495, -0.3738240897655487, -0.14668622612953186, 0.3977312445640564, 0.4013522267341614, -0.28769755363464355, -0.18803918361663818, -0.007273100316524506, 0.10492394864559174, -0.21908819675445557, 0.0368865430355072, 0.33903247117996216, -0.06342878192663193, 0.4046478867530823, -0.3996290862560272, -0.3693901598453522, -0.18799875676631927, 0.012389622628688812, 0.331472784280777, 0.14748407900333405, -0.104515939950943, -0.08502417057752609, 0.25882256031036377, -0.21898551285266876, -0.0325642004609108, -0.10662710666656494, 0.0792236477136612, -0.09274376183748245, -0.03701786324381828, -0.18124480545520782, 0.072554811835289, 0.49168863892555237, 0.32313403487205505, 0.030213041231036186, -0.2511591911315918, 0.28767868876457214, -0.34532296657562256, 0.16848556697368622, 0.024652592837810516, -0.2540980279445648, -0.177069753408432, 0.14670489728450775, 0.23645120859146118, -0.12204398214817047, 0.06798209249973297, -0.10380055755376816, -0.2200276106595993, 0.14448167383670807, -0.17278970777988434, -0.29944074153900146, -0.20886573195457458, -0.4138869047164917, 0.24597111344337463, -0.18435336649417877, 0.09870117157697678, 0.17050839960575104, 0.11213570833206177, 0.5850928425788879, -0.2527935206890106, 0.15636911988258362, 0.012223195284605026, -0.03022047132253647, -0.11737841367721558, -0.13579091429710388, -0.18496160209178925, -0.0020461156964302063, -0.22614851593971252, -0.17087510228157043, 0.12166664004325867, -0.31489062309265137, 0.1804095208644867, -0.013126199133694172, 0.37047046422958374, 0.17944222688674927, -0.10740392655134201, 0.2605600357055664, -0.2776644825935364, 0.1665983647108078, 0.008585162460803986, 0.014108231291174889, -0.04982168599963188, -0.12257255613803864, -0.2849723994731903, -0.06088552623987198, -0.47004926204681396, -0.06187686696648598, -0.18121470510959625, 0.16974036395549774, -0.31294846534729004, -0.27832743525505066, -0.38510581851005554, 0.32911887764930725, -0.30063459277153015, -0.18271204829216003, -0.0837310329079628, 0.1810881495475769, -0.3685348629951477, -0.19625546038150787, 0.30388206243515015, 0.22473835945129395, -0.2163875848054886, -0.26732122898101807, 0.40653136372566223, -0.16898441314697266, 0.1633460521697998, 0.3763915002346039, -0.0990869402885437, -0.10876258462667465, -0.014500962570309639, -0.03425303101539612, 0.3305417001247406, 0.13786275684833527, -0.37215644121170044, 0.23868398368358612, 0.0017410144209861755, -0.1860341876745224, -0.13502001762390137, 0.13799194991588593, -0.05956029146909714, 0.1303674280643463, -0.16091158986091614, 0.10667042434215546, 0.034983277320861816, -0.032225318253040314, -0.040877025574445724, -0.1484147161245346, 0.18804311752319336, 0.05857016518712044, 0.13972388207912445, 0.1924821436405182, 0.01119009405374527, -0.2451917678117752, 0.2887856066226959, -0.23882168531417847, -0.05065373331308365, 0.19714267551898956, 0.45107266306877136, 0.21213488280773163, -0.03851950168609619, -0.4254380166530609, -0.12043490260839462, 0.12995192408561707, -0.1279345452785492, 0.04347105696797371, 0.28442347049713135, -0.13947536051273346, 0.04142420366406441, 0.22075814008712769, 0.4276239573955536, 0.08605155348777771, -0.0470011867582798, -0.10622565448284149, -0.00380062498152256, -0.0079981479793787, -0.39024877548217773, 0.36643749475479126, 0.04612848162651062, 0.2589356303215027, -0.07942044734954834, 0.29959985613822937, -0.18391570448875427, 0.0032722707837820053, 0.08527703583240509, 0.25666484236717224, -0.12308310717344284, -0.24236167967319489, 0.07810071855783463, 0.23479902744293213, -0.22554156184196472, 0.16139072179794312, -0.16236713528633118, 0.2663261592388153, 0.24550284445285797, -0.2167188972234726, -0.059193916618824005, -0.13122738897800446, 0.034255657345056534, 0.030197642743587494, -0.26752427220344543, 0.26514536142349243, 0.1918318271636963, -0.15346869826316833, 0.04915149509906769, 0.04390498250722885, 0.16070933640003204, -0.023749368265271187, 0.10208530724048615, 0.06419976055622101, 0.1892714947462082, -0.10558263957500458, 0.3905463218688965, 0.13247451186180115, -0.6109017133712769, -0.08154063671827316, 0.02960674650967121, -0.032998811453580856, 0.07468994706869125, 0.29252365231513977, -0.1853809356689453, -0.004556408151984215, 0.4181802570819855, 0.06821803748607635, 0.29630792140960693, 0.2565356194972992, 0.12283428013324738, -0.007712295278906822, 0.2337862104177475, -0.050797682255506516, -0.08551197499036789, -0.16996267437934875, -0.36617720127105713, 0.11203418672084808, -0.03789171576499939, 0.08075524866580963, -0.2502286434173584, 0.0567253939807415, -0.27728062868118286, -0.014419479295611382, -0.13117358088493347, 0.09835928678512573, -0.27398163080215454, -0.2659013271331787, -0.12383492290973663, 0.10290832817554474, -0.1813904494047165, 0.15844593942165375, 0.07845444232225418, -0.13057997822761536, 0.23806005716323853, 0.27100229263305664, -0.10370080173015594, 0.13797667622566223, -0.3742210566997528, 0.04054979979991913, -0.18467314541339874, 0.15860621631145477, -0.20122689008712769, 0.12748393416404724, 0.13059915602207184, 0.12925073504447937, 0.4147954285144806, -0.08290904760360718, 0.16598859429359436, 0.04049183055758476, -0.4927005469799042, 0.17052826285362244, -0.010454490780830383, -0.13681285083293915, 0.2894519567489624, 0.02131153643131256, -0.1326368898153305, -0.3192993402481079, 0.2901762127876282, -0.3233921229839325, -0.22381335496902466, 0.13122747838497162, -0.16851995885372162, -0.195515438914299, -0.10034419596195221, 0.07903784513473511, -0.3934951424598694, -0.39415785670280457, 0.5905060768127441, 0.08439876139163971, -0.010559722781181335, 0.22836799919605255, 0.04742904007434845, 0.13028433918952942, -0.14823086559772491, 0.1744566112756729, 0.16732220351696014, -0.3886285424232483, 0.3707616925239563, -0.09766096621751785, -0.4191262722015381, 0.05059683695435524, 0.13148418068885803, 0.038885876536369324, -0.1086190864443779, -0.41147881746292114, -0.1666291505098343, -0.12202499806880951, -0.02564726024866104, 0.2163122594356537, 0.37760964035987854, -0.07112288475036621, 0.05720624327659607, -0.05421549081802368, -0.14779987931251526, -0.08513176441192627, -0.03753509372472763, -0.16004642844200134, 0.16914871335029602, 0.2762297987937927, 0.1511639952659607, -0.06747156381607056, 0.3296079635620117, 0.27663710713386536, -0.4249226152896881, 0.25235456228256226, 0.10409898310899734, 0.4752926230430603, -0.0440235361456871, -0.31837794184684753, -0.021794959902763367, 0.004414841532707214, 0.07932160049676895, 0.09021337330341339, 0.24162441492080688, -0.2305120825767517, -0.2802136540412903, -0.2201850414276123, 0.12099675089120865, -0.07557393610477448, 0.08925532549619675, 0.18057043850421906, 0.1384361982345581, -0.09211444854736328, -0.18437527120113373, -0.1609746813774109, -0.2691316306591034, 0.4344538152217865, 0.4067874550819397, -0.011717721819877625, 0.15694139897823334, -0.64677494764328, 0.15683767199516296, -0.6397527456283569, 0.24886931478977203, -0.21167969703674316, -0.08331962674856186, -0.19081254303455353, -0.03619010001420975, 0.15727581083774567, -0.0590418316423893, 0.12297613173723221, -0.025153426453471184, -0.07466904073953629, -0.07859779894351959, -0.33288711309432983, 0.104643814265728, 0.327380895614624, -0.08603081107139587, -0.03771277889609337, 0.1451728641986847, 0.39774250984191895, -0.38582512736320496, -0.36269405484199524, 0.05068231001496315, 0.037996482104063034, -0.11747051775455475, -0.30962422490119934, -0.07926109433174133, 0.15470272302627563, -0.013102238066494465, -0.12443441897630692, -0.13682913780212402, 0.03542590141296387, 0.310895174741745, -0.034510254859924316, -0.27271732687950134, 0.17777100205421448, 0.39354991912841797, 0.0789470225572586, -0.010451462119817734, 0.1895514577627182, 0.08253434300422668, 0.19628207385540009, 0.15485288202762604, 0.027870848774909973, 0.2765028178691864, -0.8117903470993042, -0.3263508975505829, -0.1887396275997162, 0.42821645736694336, 0.3755086064338684, -0.012449592351913452, -0.016266729682683945, 0.12906984984874725, 0.47994551062583923, 0.10090953856706619, -0.43021804094314575, 0.16678789258003235, -0.15248918533325195, 0.3002937436103821, -0.3943076729774475, -0.4404635429382324, 0.2521236836910248, 0.11844384670257568, -0.048169609159231186, 0.2941570281982422, 0.16272717714309692, -0.05406782031059265, 0.2759730815887451, -0.07639283686876297, 1.0000522136688232, -0.44959962368011475, 0.16779305040836334, -0.11853349953889847, -0.1388138234615326, 0.468544602394104, -0.2503754496574402, -0.14458629488945007, -0.45411714911460876, -0.14965718984603882, -0.17723843455314636, -0.12348316609859467, -0.2307702898979187, 0.11891724914312363, -0.15934672951698303, 0.22607660293579102, 0.35084372758865356, 0.3026030957698822, -0.04365906864404678, 0.3664996325969696, 0.043562933802604675, -0.36765801906585693, -0.47831639647483826, 0.19405846297740936, -0.15331856906414032, 0.16828088462352753, -0.1576269268989563, -0.4060112237930298, 0.1965523660182953, -0.09815168380737305, -0.13927003741264343, 0.04683436453342438, -0.42090389132499695, 0.048232533037662506, 0.468818336725235, -0.46563905477523804, 0.38854578137397766, 0.5825628042221069, 0.10912175476551056, 0.5220581889152527, -0.23743778467178345, -0.03693615272641182, -0.06900008767843246, -0.04691912606358528, -0.09270516037940979, 0.018870480358600616, -0.05434686690568924, -0.07230937480926514, -0.08770569413900375, 0.1087946742773056, -0.0174742229282856, -0.0821489542722702, 0.33803093433380127, 0.0914914608001709, 0.2885998487472534, -0.20294784009456635, 0.03642848879098892, 0.08780254423618317, 0.22876298427581787, -0.05116397142410278, 0.11196310818195343, 0.278697669506073, 0.04782942309975624, 0.007709778845310211, 0.40683552622795105, -0.02733524888753891, -0.018636126071214676, 0.399004727602005, -0.37544625997543335, 0.007654525339603424, 0.012175709009170532, 0.3445814549922943, -0.382721483707428, -0.13418476283550262, -0.06767584383487701, 0.1849304735660553, -0.39903807640075684, -0.11489095538854599, 0.1724669188261032, -0.00743451714515686, -0.060831017792224884, 0.3637106716632843, 0.4653998017311096, -0.39425739645957947, 0.014748472720384598, -0.11977849155664444, -0.6096492409706116, 0.41908109188079834, -0.14604859054088593, 0.21839594841003418, 0.14438208937644958, 0.04411790519952774, 0.01552506722509861, 0.1202889084815979, -0.34533464908599854, 0.0530431792140007, -0.036894991993904114, -0.28067123889923096, 0.2228400856256485, -0.19640395045280457, -0.03063189424574375, -0.15517960488796234, 0.029565950855612755, 0.02084754966199398, -0.2424517273902893, -0.14574091136455536, -0.3735763430595398, 0.12886251509189606, -0.0689554363489151, -0.046732038259506226, -0.09830580651760101, -0.12509077787399292, -0.1718989461660385, -0.1705848127603531, 0.036733463406562805, 0.08384858816862106, 0.04232192039489746, 0.0004752799868583679, 0.20843371748924255, 0.0005988627672195435, -0.45430290699005127, 0.2980150878429413, 0.1520160436630249, 0.17354992032051086, -0.1622999757528305, -0.14116792380809784, -0.07443147897720337, -0.1090816780924797, 0.2287553995847702, 0.4254063367843628, 0.5859944820404053, -0.300380140542984, 0.3674193322658539, 0.07830838859081268, 0.10274802148342133, 0.3386732339859009, 0.5960566997528076, 0.023087166249752045, 0.09104417264461517, 0.3868379294872284, 0.6061062216758728, 0.2048109769821167, -0.34579819440841675, -0.2899027466773987, 0.16312439739704132, 0.10941488295793533, -0.01708858832716942, 0.24628397822380066, 0.2030683159828186, 0.1062508374452591, 0.1404857039451599, -0.056051403284072876, 0.1244078204035759, 0.15512430667877197, -0.2304236739873886, -0.03072546049952507, 0.0944925844669342, 0.07149894535541534, 0.23448677361011505, 0.4678103029727936, 0.030310317873954773, -0.3456856608390808, 0.05677440017461777, -0.03288078308105469, 0.06769959628582001, 0.2339952290058136, 0.3559412956237793, -0.49383544921875, -0.26296114921569824, -0.2843979299068451, 0.3911750316619873, 0.0429513081908226, -0.21390178799629211, 0.9560574889183044, -0.07980301231145859, -0.15373735129833221, 0.041687414050102234, 0.45759519934654236, -0.15715420246124268, -0.17383772134780884, 0.17932988703250885, -0.01341506838798523, -0.22591949999332428, 0.02840087190270424, 0.04957588016986847, -0.06462277472019196, 0.39459723234176636, 0.09165307879447937, 0.46195608377456665, -0.3114815950393677, -0.2892516255378723, 0.3295271098613739, 0.1310017704963684, -0.19991834461688995, 0.19529734551906586, -0.027517840266227722, -0.07987506687641144, -0.11173373460769653, 0.19021977484226227, 0.2276354283094406, -0.09224197268486023, 0.17796674370765686, 0.04797808453440666, 0.017621487379074097, 0.16134919226169586, -0.04233250021934509, 0.2632952928543091, 0.17151376605033875, 0.14555108547210693, 0.138729065656662, 0.012040065601468086, -0.19108131527900696, -0.006600603461265564, -0.28138455748558044, 0.23965010046958923, -0.19426104426383972, 0.2098323404788971, 0.050753913819789886, -0.07765190303325653, -0.4229342043399811, -0.07833274453878403, -0.19233620166778564, 0.21789303421974182, 0.4598555862903595, -0.17736156284809113, -0.18720534443855286, -0.12562474608421326, 0.07381799072027206, 0.04600518196821213, 0.5069600939750671, 0.34842589497566223, 0.37477174401283264, -0.2553827464580536, -0.17563557624816895, -0.351838618516922, 0.09968756884336472, 0.10701341927051544, -0.0865132287144661, -0.25741326808929443, -0.24449175596237183, 0.2862638831138611, 0.06304720044136047, -0.20466946065425873, -0.07910852879285812, -0.06104302033782005, 0.18198125064373016, 0.12808822095394135, 0.384540319442749, -0.23021452128887177, -0.030625851824879646, 0.17189855873584747, 0.006648719310760498, -0.0061998553574085236, 0.13494430482387543, -0.009350713342428207, -0.24661625921726227, -0.03016580268740654, -0.017804007977247238, -0.2554180324077606, 0.3035234212875366, -0.15177540481090546, 0.5288772583007812, -0.014983372762799263, -0.1901053488254547, 0.3286246657371521, -0.5536609292030334, -0.10815824568271637, 0.017904285341501236, -0.009723592549562454, 0.09517355263233185, -0.25200191140174866, -0.09397770464420319, -0.14665071666240692, 0.008613708429038525, 0.10898475348949432, -0.2757377326488495, -0.3003738820552826, 0.038992010056972504, -0.5224515199661255, -0.06219007819890976, 0.42833396792411804, 0.3666008412837982, 0.01887734979391098, -0.06443087011575699, -0.1097385510802269, -0.22113345563411713, 0.4413435757160187, -0.38009703159332275, 0.18984688818454742, -0.06565114855766296, -0.026159435510635376, 0.3223622143268585, -0.20894406735897064, -0.8371755480766296, -0.0016688406467437744, 0.1557282954454422, -0.009675219655036926, -0.14100410044193268, 0.20982389152050018, -0.1378570795059204, -0.006259601563215256, -0.14717666804790497, 0.780038595199585, -0.01587565615773201, -0.20444577932357788, -0.07388634234666824, -0.21886767446994781 ]
https://github.com/huggingface/datasets/issues/5013
would huggingface like publish cpp binding for datasets package ?
If you are more adventurous, another option is to embed python calls inside c++ e.g. with `pybind11`.
HI: I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it. thanks
17
would huggingface like publish cpp binding for datasets package ? HI: I use cpp env libtorch, I like use hugggingface ,but huggingface not cpp binding, would you like publish cpp binding for it. thanks If you are more adventurous, another option is to embed python calls inside c++ e.g. with `pybind11`.
[ -0.3280462920665741, -0.5319107174873352, -0.01091565378010273, -0.009758204221725464, 0.20415040850639343, -0.15778087079524994, 0.10446525365114212, 0.09144486486911774, -0.10828098654747009, 0.2027130126953125, -0.31489911675453186, 0.28619492053985596, -0.246366485953331, 0.686676561832428, 0.41360417008399963, -0.33238881826400757, 0.12794919312000275, 0.4199838638305664, -0.22664138674736023, 0.04999615252017975, -0.003038015216588974, 0.19461281597614288, -0.17556264996528625, 0.19118520617485046, -0.022630346938967705, -0.2688334286212921, -0.13091421127319336, 0.0018409006297588348, -0.12376516312360764, -0.10265341401100159, 0.0883912593126297, 0.14379426836967468, 0.10678023844957352, 0.15644891560077667, -0.00011056498624384403, -0.02692478895187378, 0.15124252438545227, 0.08400466293096542, 0.040978483855724335, -0.009347587823867798, 0.044352248311042786, -0.3072221279144287, 0.20748336613178253, -0.2771786153316498, -0.028880979865789413, -0.2899898290634155, 0.012113228440284729, -0.024092458188533783, 0.4820462465286255, -0.10859967768192291, 0.2305547147989273, 0.5616395473480225, 0.10687640309333801, -0.03922075405716896, -0.3532026708126068, 0.17236214876174927, -0.1664648801088333, 0.09589976072311401, 0.48173898458480835, 0.16648082435131073, 0.12933260202407837, 0.004612622782588005, -0.16507166624069214, -0.28912511467933655, 0.251767098903656, -0.014683571644127369, -0.3746372163295746, -0.12535765767097473, -0.12490161508321762, 0.09252424538135529, 0.39328911900520325, -0.5991264581680298, -0.22597035765647888, -0.26371118426322937, 0.08085384219884872, -0.13478480279445648, 0.08113633096218109, 0.13066139817237854, 0.01650719717144966, 0.5171969532966614, -0.3767957091331482, -0.4464292824268341, -0.16346846520900726, -0.08666644990444183, 0.24693992733955383, -0.03462742269039154, -0.15319904685020447, -0.08553484827280045, 0.17601804435253143, -0.23115955293178558, 0.03539953753352165, -0.09594806283712387, 0.12795326113700867, -0.1443440020084381, 0.20075248181819916, -0.2917424440383911, -0.030634455382823944, 0.36013174057006836, 0.1528509557247162, 0.03844347223639488, -0.142763152718544, 0.1447126865386963, -0.17414414882659912, 0.12993556261062622, 0.15867429971694946, -0.20840686559677124, 0.062067024409770966, 0.3536442220211029, 0.38656413555145264, -0.057439424097537994, 0.17798484861850739, -0.08112245798110962, 0.14654073119163513, 0.22639089822769165, 0.05653296783566475, -0.40221530199050903, -0.19238410890102386, -0.20490792393684387, 0.14833921194076538, -0.14642371237277985, 0.10442104190587997, 0.11231508105993271, 0.0856955498456955, 0.5255128741264343, -0.015970414504408836, 0.050633467733860016, 0.16994304955005646, -0.06714034825563431, -0.007146279327571392, -0.04636985436081886, -0.16044369339942932, 0.17402251064777374, -0.091217041015625, -0.06513897329568863, 0.12671810388565063, -0.4089632034301758, 0.18011710047721863, 0.19020891189575195, 0.4833816885948181, 0.05113793909549713, 0.02936515025794506, 0.43483150005340576, -0.07917921990156174, -0.01886368915438652, -0.11490017175674438, 0.08169040083885193, -0.04239070788025856, -0.14033299684524536, -0.3324640095233917, -0.01945418119430542, -0.2087760865688324, 0.012341979891061783, -0.14891943335533142, 0.20581157505512238, -0.19917654991149902, -0.016364164650440216, -0.18206557631492615, 0.1688557267189026, -0.26108482480049133, -0.22434936463832855, 0.27846673130989075, 0.07184387743473053, -0.026714704930782318, -0.27549049258232117, 0.32420045137405396, 0.13658039271831512, -0.27750876545906067, -0.41454240679740906, 0.3693505525588989, -0.16185961663722992, 0.04784141480922699, 0.24687588214874268, -0.15597186982631683, -0.2120416760444641, -0.1925097405910492, -0.021329771727323532, 0.2711884677410126, -0.22039729356765747, -0.4717574715614319, 0.3258940875530243, -0.12678956985473633, -0.06508380174636841, -0.13161271810531616, 0.30634522438049316, -0.030794046819210052, 0.08618741482496262, 0.026715490967035294, 0.005497578531503677, 0.08085478842258453, 0.07677753269672394, 0.007074706256389618, -0.052924998104572296, 0.1643010377883911, 0.047148678451776505, -0.0982455462217331, 0.07542309165000916, 0.180925190448761, -0.010307615622878075, 0.21488788723945618, -0.25212225317955017, 0.05550864338874817, 0.23554983735084534, 0.34283575415611267, -0.020399034023284912, -0.04054712876677513, -0.4789322316646576, -0.010456770658493042, 0.00926072895526886, -0.08947494626045227, -0.10233436524868011, -0.027047142386436462, -0.29811030626296997, -0.05801939219236374, 0.28287869691848755, 0.34606578946113586, -0.15205246210098267, -0.00983167439699173, -0.03517559915781021, 0.09742237627506256, 0.018877025693655014, -0.4358255863189697, 0.7813391089439392, 0.0032543670386075974, 0.24959617853164673, -0.08689257502555847, 0.02348470874130726, -0.012096481397747993, -0.10116694867610931, 0.17519918084144592, 0.398945689201355, -0.10637103766202927, -0.19533032178878784, 0.1910547912120819, 0.23340830206871033, -0.32186776399612427, 0.06552624702453613, 0.005872905254364014, 0.09382176399230957, 0.21547360718250275, -0.2717354893684387, 0.08435937017202377, -0.21021218597888947, -0.11634188890457153, -0.04586946219205856, -0.10586769133806229, 0.48224514722824097, 0.13436193764209747, -0.01827196031808853, -0.008523404598236084, 0.01961958222091198, -0.02662263624370098, 0.03133764490485191, -0.1957901269197464, -0.008180614560842514, 0.10017272084951401, 0.01857319101691246, 0.6780903935432434, 0.21681392192840576, -0.5892014503479004, -0.07221990078687668, 0.23060694336891174, -0.21027325093746185, 0.1498541384935379, 0.2999558746814728, -0.2078365683555603, 0.1873585283756256, 0.4799637794494629, -0.06736090034246445, 0.2425771951675415, 0.22376304864883423, 0.052661992609500885, 0.11290162801742554, 0.12575310468673706, -0.03465985506772995, -0.08672616630792618, -0.17606578767299652, -0.6241979002952576, -0.2895570397377014, 0.03830685839056969, 0.022651270031929016, -0.1671195775270462, 0.2787274420261383, -0.33432912826538086, -0.19161362946033478, -0.1766718477010727, 0.04893839359283447, -0.3820258378982544, -0.4134906828403473, -0.17597250640392303, 0.08601018041372299, -0.34656625986099243, 0.15759877860546112, -0.028028901666402817, -0.17197749018669128, 0.2633107304573059, 0.276157945394516, -0.13988611102104187, 0.3191983699798584, -0.4052557945251465, -0.28918391466140747, -0.07731308043003082, 0.3217792212963104, -0.05526794493198395, 0.14654336869716644, -0.04694607853889465, 0.10973548889160156, 0.4966347813606262, -0.003931261599063873, 0.10104095190763474, -0.11387937515974045, -0.2530791163444519, 0.2288004457950592, 0.0032145529985427856, -0.07450610399246216, 0.29552942514419556, -0.27610546350479126, -0.18330349028110504, -0.14775878190994263, 0.004520272370427847, -0.0346616692841053, -0.201928973197937, -0.004900947213172913, 0.0490809828042984, -0.06094348430633545, -0.22200734913349152, 0.17807036638259888, -0.39480093121528625, -0.3649699091911316, 0.7454554438591003, 0.007651761174201965, -0.04456678777933121, 0.02726895362138748, -0.16174541413784027, 0.12187257409095764, -0.00792703777551651, 0.224298894405365, 0.16947250068187714, -0.24727769196033478, 0.18555912375450134, -0.076444610953331, -0.28647008538246155, -0.05793227627873421, 0.11584562063217163, 0.12365786731243134, -0.019197016954421997, -0.2629532217979431, -0.21444062888622284, -0.1898704320192337, 0.2806433439254761, 0.23146122694015503, 0.5622053146362305, 0.05767403170466423, 0.2844642698764801, -0.05904684588313103, -0.16892623901367188, -0.25094711780548096, 0.05807787552475929, -0.1864088773727417, 0.06500959396362305, 0.3666394054889679, -0.08163440227508545, -0.052697379142045975, 0.24542249739170074, 0.379005491733551, -0.3602840304374695, 0.21278204023838043, 0.035978034138679504, 0.6115536689758301, -0.0021220743656158447, -0.4526901841163635, 0.011812087148427963, 0.07148455828428268, 0.19194404780864716, 0.07369011640548706, 0.1716674566268921, 0.05149698257446289, -0.2937954366207123, -0.2946576476097107, -0.10665783286094666, -0.12371142208576202, -0.13583722710609436, 0.17821627855300903, 0.256173312664032, -0.06124752014875412, -0.14142157137393951, -0.2427418828010559, 0.07264270633459091, 0.3959958255290985, 0.2963005304336548, 0.028279714286327362, 0.023990966379642487, -0.21415208280086517, -0.04897228628396988, -0.6922539472579956, 0.22938716411590576, -0.138917937874794, 0.07787157595157623, -0.29823389649391174, 0.03932218253612518, 0.19398508965969086, -0.019779469817876816, 0.3579503893852234, -0.06895903497934341, -0.3149896264076233, -0.08415377140045166, -0.22215203940868378, 0.010395905002951622, 0.5108706951141357, -0.1786833107471466, 0.2579711079597473, 0.09417808055877686, 0.39514023065567017, -0.3619963228702545, -0.11895601451396942, 0.0930238887667656, 0.043275006115436554, -0.07933605462312698, -0.3694930076599121, 0.03337216004729271, -0.11745887249708176, 0.07725173234939575, -0.11713194102048874, 0.05694802105426788, -0.05654887482523918, 0.18980002403259277, -0.13683046400547028, -0.20770874619483948, -0.08065228164196014, 0.27335259318351746, -0.013585533015429974, -0.12032882124185562, -0.0181747879832983, 0.08750517666339874, 0.00794985517859459, 0.449064701795578, -0.134304016828537, 0.12547831237316132, -0.47881415486335754, -0.3004415035247803, -0.2305481731891632, 0.42144331336021423, 0.5693625211715698, 0.028747566044330597, -0.056964628398418427, 0.41474685072898865, 0.2701150178909302, 0.09754174947738647, -0.3770385980606079, 0.003669180441647768, 0.09119831770658493, 0.21540693938732147, -0.42460519075393677, -0.5148055553436279, 0.20195147395133972, 0.3528527021408081, -0.13264116644859314, 0.42169633507728577, 0.29294201731681824, -0.19706560671329498, -0.14097721874713898, -0.08909661322832108, 0.9209178686141968, -0.29976963996887207, 0.14990340173244476, -0.06950560957193375, -0.22887226939201355, 0.7017935514450073, 0.10679654777050018, -0.09201212972402573, -0.3032434284687042, -0.25457048416137695, -0.046206846833229065, -0.20206661522388458, -0.08838953822851181, -0.10281208157539368, -0.3997577428817749, 0.17561903595924377, 0.26631295680999756, -0.14606083929538727, 0.06173723191022873, 0.3344170153141022, -0.11810431629419327, -0.35215479135513306, -0.6086641550064087, 0.1503945291042328, -0.14239898324012756, 0.0467422716319561, -0.1358814835548401, -0.4003886580467224, 0.0702826976776123, -0.25310564041137695, -0.1712673008441925, -0.043943554162979126, -0.17222492396831512, -0.09696749597787857, 0.3605966866016388, -0.2796694040298462, 0.5200315713882446, 0.1406816840171814, 0.37521761655807495, 0.48425406217575073, -0.14063680171966553, -0.1308767944574356, -0.21198001503944397, 0.11869373172521591, -0.028651287779211998, 0.16792906820774078, 0.07384903728961945, 0.10993095487356186, -0.07304617017507553, 0.17586782574653625, 0.01916523650288582, -0.18986034393310547, 0.28298234939575195, 0.14179906249046326, 0.1507698893547058, -0.2949370741844177, 0.12215101718902588, -0.05435781180858612, 0.18028618395328522, -0.14198628067970276, 0.12249147891998291, 0.22815033793449402, 0.055330004543066025, 0.10794761776924133, 0.31248220801353455, -0.04868529364466667, -0.05474075302481651, 0.20873159170150757, -0.1783660650253296, -0.2932659387588501, -0.019702687859535217, 0.19596248865127563, -0.3874961733818054, -0.1140192374587059, -0.05057862401008606, 0.09964310377836227, 0.04992741346359253, -0.016050230711698532, 0.45779135823249817, -0.12323489040136337, -0.2169468104839325, 0.33383768796920776, 0.23392201960086823, -0.2872134745121002, -0.2920927405357361, 0.15590135753154755, -0.7241826057434082, 0.3718084692955017, -0.08273221552371979, 0.24072907865047455, 0.3283436894416809, 0.21409723162651062, 0.025054341182112694, 0.06409652531147003, -0.3495231866836548, -0.06902331113815308, -0.08525295555591583, -0.312614768743515, 0.5157606601715088, -0.10325326770544052, -0.16227322816848755, 0.009295813739299774, 0.08741080015897751, 0.2894437909126282, -0.12740932404994965, -0.13952286541461945, -0.23220692574977875, 0.11846969276666641, -0.09519924968481064, 0.05288863927125931, -0.1698901355266571, -0.19479785859584808, -0.06071909889578819, -0.28801435232162476, 0.04304429516196251, 0.1702331304550171, 0.09104692935943604, -0.08405106514692307, 0.05333329364657402, -0.018912523984909058, -0.26607292890548706, 0.37234967947006226, 0.13046669960021973, 0.28995102643966675, -0.17232708632946014, -0.018301472067832947, -0.11593043059110641, -0.012373365461826324, 0.18188010156154633, 0.37508684396743774, 0.3763389587402344, 0.02979850023984909, 0.1876305639743805, 0.083070769906044, -0.142571359872818, 0.2742350995540619, 0.6713573932647705, -0.05055766552686691, -0.035369858145713806, 0.32977133989334106, 0.458600789308548, 0.17476993799209595, -0.26053667068481445, -0.26571622490882874, 0.27774468064308167, -0.1040704995393753, 0.11219729483127594, 0.437249094247818, 0.13861507177352905, 0.21836239099502563, 0.2801845073699951, -0.26647892594337463, 0.2502560615539551, 0.07815080136060715, -0.2728634178638458, 0.11565295606851578, 0.26603516936302185, -0.04559153690934181, 0.3013084828853607, 0.6675856709480286, 0.23517873883247375, -0.15170791745185852, -0.15713924169540405, -0.09572092443704605, -0.06563553214073181, 0.20553463697433472, 0.2601255774497986, -0.21078290045261383, 0.20433032512664795, -0.36344730854034424, 0.4299079179763794, 0.23778873682022095, -0.2199678122997284, 0.9147478938102722, -0.4110959470272064, -0.01776862144470215, 0.2094736397266388, 0.4484498202800751, -0.2101280689239502, -0.03783213719725609, 0.4423985481262207, 0.10742742568254471, -0.2395583689212799, -0.10857738554477692, 0.07270392775535583, -0.14344820380210876, 0.34319549798965454, -0.0843079686164856, 0.48412245512008667, -0.24659736454486847, -0.1663314700126648, 0.32500237226486206, 0.2514350414276123, -0.21258558332920074, 0.1187656968832016, -0.2849506735801697, 0.03042447939515114, -0.0386241115629673, 0.1672465205192566, 0.23246422410011292, -0.06664814800024033, 0.1987714171409607, 0.13835829496383667, -0.056657325476408005, 0.14974991977214813, -0.08002229034900665, 0.08418337255716324, 0.015622921288013458, 0.18061959743499756, 0.124676913022995, 0.04746206849813461, -0.14362342655658722, -0.23090581595897675, -0.05908586457371712, 0.22260987758636475, -0.443392813205719, 0.19048194587230682, -0.19495722651481628, -0.2820481061935425, -0.46038591861724854, -0.07289493829011917, -0.2958691716194153, 0.1584254503250122, 0.2484285980463028, -0.19947358965873718, -0.18328502774238586, -0.19757795333862305, 0.09239204972982407, 0.02681855857372284, 0.2244323343038559, 0.38856959342956543, 0.47415563464164734, -0.01636625826358795, -0.2626534700393677, -0.39712369441986084, 0.2375032901763916, 0.20964117348194122, -0.27666687965393066, -0.1699652075767517, -0.3422544002532959, 0.2393549084663391, -0.10582824051380157, -0.04120256006717682, 0.29242441058158875, 0.172374427318573, -0.06926731765270233, 0.1536867320537567, 0.026418574154376984, 0.06725246459245682, -0.09814927726984024, 0.1817125529050827, 0.14913687109947205, 0.11467009782791138, 0.17333489656448364, 0.007672354578971863, -0.29797589778900146, 0.14032799005508423, -0.15009087324142456, -0.2175399363040924, 0.3078092932701111, 0.04760831966996193, 0.27225273847579956, -0.12449917942285538, -0.14587324857711792, 0.47430703043937683, -0.28166434168815613, -0.10002914071083069, 0.06845761835575104, -0.07961621880531311, -0.09412023425102234, -0.2966374158859253, -0.3771820664405823, -0.18755440413951874, -0.0670529380440712, 0.19484522938728333, -0.1706220954656601, -0.14572906494140625, -0.03246566280722618, -0.5218029618263245, -0.15174169838428497, 0.31218287348747253, 0.29166337847709656, -0.06565962731838226, 0.01738944835960865, -0.032351791858673096, -0.29249170422554016, 0.320537269115448, -0.26027795672416687, 0.10327239334583282, 0.16295205056667328, 0.19780448079109192, 0.06440852582454681, -0.40730583667755127, -0.6088607311248779, -0.034585267305374146, 0.25972533226013184, -0.005894441157579422, 0.02625412493944168, 0.17890840768814087, -0.4152602553367615, 0.012852724641561508, -0.10773172974586487, 0.7512059211730957, 0.1330922245979309, 0.03605658560991287, 0.25141337513923645, -0.1750173270702362 ]
https://github.com/huggingface/datasets/issues/5012
Force JSON format regardless of file naming on S3
Hi ! Support for URIs like `s3://...` is not implemented yet in `data_files=`. You can use the HTTP URL instead if your data is public in the meantime
I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run ```python dataset = load_dataset( "json", data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ) ``` It gives me ``` InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ``` However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming?
28
Force JSON format regardless of file naming on S3 I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run ```python dataset = load_dataset( "json", data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ) ``` It gives me ``` InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ``` However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming? Hi ! Support for URIs like `s3://...` is not implemented yet in `data_files=`. You can use the HTTP URL instead if your data is public in the meantime
[ 0.23562388122081757, -0.032607778906822205, 0.013763636350631714, -0.013254992663860321, 0.17930810153484344, -0.17578494548797607, 0.19756482541561127, 0.2532142102718353, 0.08307391405105591, 0.07370880991220474, -0.013869782909750938, 0.5979509353637695, -0.2102200984954834, 0.4327723979949951, -0.2815643846988678, 0.43547481298446655, 0.22107641398906708, 0.5871663093566895, 0.4455418586730957, 0.3483731150627136, -0.3076588213443756, 0.3087432384490967, 0.33121246099472046, -0.15262538194656372, 0.1332472264766693, 0.784109890460968, 0.21745295822620392, -0.04201684892177582, -0.4023604989051819, -0.6576977968215942, 0.28832584619522095, 0.418556272983551, 0.3380919396877289, 0.48906391859054565, -0.00012575226719491184, 0.1160905510187149, 0.2887322008609772, -0.20823781192302704, -0.5524816513061523, -0.19275493919849396, -0.47217023372650146, -0.2691011428833008, 0.13604231178760529, -0.027647435665130615, -0.28034213185310364, -0.03589539974927902, 0.08947431296110153, -0.2905573546886444, 0.5953047871589661, 0.1225380226969719, 0.017842452973127365, -0.1292003095149994, -0.1329462230205536, 0.3027068078517914, 0.3164445459842682, 0.41124123334884644, -0.09400749206542969, 0.5488461852073669, 0.004216514527797699, 0.133819580078125, 0.3940257430076599, 0.17693664133548737, -0.1972060203552246, 0.18646901845932007, 0.3841412365436554, -0.13835641741752625, 0.15130534768104553, 0.06453655660152435, -0.018089428544044495, 0.33322831988334656, 0.4810126721858978, -0.20487618446350098, -0.6261213421821594, -0.1381458193063736, -0.15277545154094696, -0.13068045675754547, 0.3582647144794464, -0.13707847893238068, 0.08143481612205505, 0.29182690382003784, -0.14477336406707764, -0.3233712911605835, -0.19163216650485992, 0.22245748341083527, -0.39967143535614014, 0.21227671205997467, -0.25866076350212097, -0.10832565277814865, 0.049607522785663605, 0.06614476442337036, 0.28300559520721436, -0.055763594806194305, -0.1972036361694336, -0.0968206524848938, -0.17117878794670105, -0.3407697081565857, -0.29436618089675903, -0.5033589601516724, -0.1123746931552887, 0.057004258036613464, 0.03596417233347893, 0.033057522028684616, 0.044658541679382324, 0.09875554591417313, -0.05990685895085335, -0.24103893339633942, 0.2773961126804352, -0.06929485499858856, 0.24927659332752228, 0.11941473931074142, 0.2681734263896942, -0.07572119683027267, -0.12928558886051178, -0.4189041256904602, -0.42482367157936096, 0.019769465550780296, 0.188613623380661, -0.2578011155128479, 0.027310064062476158, -0.110734723508358, -0.33976444602012634, 0.20384232699871063, -0.23016338050365448, -0.10355425626039505, 0.023213308304548264, 0.6059609651565552, 0.2242853194475174, 0.16508974134922028, -0.08633177727460861, 0.08335540443658829, 0.3455638885498047, -0.34750378131866455, 0.054851192981004715, 0.162382572889328, 0.23426075279712677, 0.005402117967605591, 0.09192174673080444, 0.19275622069835663, -0.3785526156425476, -0.13135305047035217, 0.16581429541110992, 0.25064751505851746, 0.17952319979667664, 0.1617026925086975, 0.26885974407196045, 0.29524433612823486, -0.15386834740638733, -0.5252317786216736, -0.25576451420783997, -0.06547685712575912, -0.43928998708724976, 0.031866300851106644, -0.23255275189876556, -0.0032279174774885178, -0.4334525465965271, 0.0186014287173748, -0.24320614337921143, -0.041246142238378525, -0.3589411675930023, -0.27342814207077026, 0.14181673526763916, -0.008822605013847351, 0.3662879765033722, -0.0727144256234169, 0.1829691380262375, 0.2345949411392212, -0.3158617317676544, -0.27390140295028687, 0.10738209635019302, -0.1527489870786667, -0.03834690898656845, -0.01320686936378479, 0.007940040901303291, -0.4225223958492279, -0.10321102291345596, -0.10383785516023636, 0.1929682195186615, -0.3781517446041107, -0.10820624977350235, 0.6889920830726624, -0.19405248761177063, 0.19944320619106293, 0.4453541338443756, -0.091807521879673, -0.1464989185333252, 0.03636319562792778, 0.10907360911369324, 0.19764293730258942, 0.2377973049879074, 0.05027725547552109, 0.0008697956800460815, -0.3916468024253845, -0.05707326531410217, 0.26341530680656433, -0.1041390597820282, 0.3819526433944702, 0.06688515841960907, -0.10207170993089676, 0.2531929910182953, -0.36968210339546204, -0.05133456736803055, 0.3139094114303589, 0.2561853528022766, 0.14492285251617432, 0.11267513781785965, 0.14156833291053772, -0.18550843000411987, -0.015036994591355324, 0.08919353038072586, -0.06172098219394684, -0.27724045515060425, -0.20398835837841034, -0.003138905391097069, -0.3989507257938385, -0.2230171412229538, 0.1372631937265396, 0.017845697700977325, 0.37948253750801086, 0.0013231821358203888, 0.01208673045039177, -0.12862388789653778, -0.3713048994541168, 0.26637208461761475, 0.09815923124551773, -0.02374214306473732, -0.09811928123235703, 0.25495243072509766, 0.02786576747894287, 0.18373741209506989, -0.23091015219688416, -0.053026407957077026, -0.13201546669006348, 0.05257581174373627, 0.05331399291753769, 0.34245845675468445, 0.3488287925720215, 0.18135252594947815, 0.2832372784614563, -0.0654003769159317, 0.21187075972557068, -0.15640564262866974, 0.3313210606575012, -0.06583172082901001, 0.06644121557474136, 0.06435653567314148, 0.5642769932746887, -0.05917837843298912, 0.3085983991622925, -0.12524524331092834, -0.11779168248176575, 0.36702603101730347, -0.33010903000831604, -0.5596516132354736, -0.08142242580652237, -0.07007190585136414, 0.3139345347881317, -0.015769368037581444, 0.21489155292510986, -0.15932586789131165, -0.6111878752708435, 0.3272295594215393, -0.16834408044815063, -0.1272883415222168, 0.21572047472000122, -0.24906545877456665, 0.11511868983507156, -0.15259388089179993, 0.4266548752784729, 0.21213778853416443, 0.03346283361315727, -0.22437506914138794, -0.037759929895401, 0.39461642503738403, -0.3580191433429718, 0.3962244987487793, 0.13431958854198456, 0.1790025681257248, 0.43551087379455566, 0.10894670337438583, -0.0990893617272377, -0.30043578147888184, -0.13566866517066956, 0.09162905067205429, -0.5145961046218872, -0.3344627916812897, 0.33544212579727173, -0.3540455102920532, -0.17968249320983887, -0.24253016710281372, -0.1533416211605072, -0.25272318720817566, 0.06417789310216904, 0.011144468560814857, 0.22710882127285004, 0.06940574944019318, 0.0390872061252594, 0.08984583616256714, 0.3359149098396301, -0.17801553010940552, -0.6061919927597046, -0.06680905818939209, -0.23858758807182312, -0.015073716640472412, -0.011530177667737007, 0.011367174796760082, -0.3697921931743622, -0.08738740533590317, -0.4958479106426239, 0.006175357848405838, -0.29505935311317444, -0.18175217509269714, 0.008789833635091782, 0.22040005028247833, 0.14028127491474152, 0.30912017822265625, 0.32247668504714966, 0.2584754228591919, -0.0171365924179554, 0.22184930741786957, 0.2921580672264099, 0.04154498875141144, 0.03292347490787506, -0.1650061458349228, 0.18938685953617096, -0.22858577966690063, 0.1639162302017212, 0.28440913558006287, -0.15238212049007416, 0.3545476794242859, 0.02395879477262497, 0.0018232166767120361, -0.15878647565841675, 0.14160318672657013, -0.15481650829315186, -0.012346332892775536, 0.004975169897079468, 0.039877064526081085, -0.21995198726654053, 0.3212882876396179, 0.01906653307378292, -0.03992150351405144, 0.1277228593826294, -0.009652418084442616, 0.19713567197322845, 0.19431036710739136, -0.3744460344314575, -0.10175508260726929, 0.14496757090091705, -0.21983395516872406, 0.09629742801189423, -0.1646454632282257, -0.0749204009771347, 0.18432088196277618, 0.030144022777676582, -0.12088906764984131, -0.09976519644260406, -0.025188550353050232, 0.12983576953411102, 0.43719279766082764, 0.3642486035823822, 0.39613625407218933, 0.026589524000883102, 0.2847387194633484, 0.1485796570777893, -0.0454607717692852, 0.39173591136932373, -0.08417422324419022, 0.2956206798553467, 0.2607286870479584, 0.39547470211982727, -0.34602442383766174, -0.04277554154396057, 0.02471911534667015, 0.2494613081216812, -0.009562773630023003, -0.13158263266086578, -0.32100966572761536, 0.20192962884902954, -0.17727738618850708, -0.11797879636287689, 0.1857401579618454, -0.2907130718231201, 0.08685857802629471, -0.2951434254646301, -0.025107819586992264, 0.13542599976062775, 0.0967046394944191, 0.3510458767414093, 0.5353094935417175, 0.4039773643016815, 0.0794094055891037, -0.12851382791996002, -0.274627685546875, -0.04447777569293976, 0.06331761181354523, -0.09473144263029099, 0.43330568075180054, 0.15707208216190338, -0.012297950685024261, -0.077553391456604, -0.2511352598667145, 0.6431043148040771, -0.3014320731163025, 0.11324664950370789, -0.11268134415149689, -0.0332162044942379, -0.4349815845489502, -0.052967119961977005, 0.010430186986923218, -0.05974477156996727, 0.03775239735841751, 0.7148435711860657, -0.2656714916229248, -0.23647814989089966, -0.45166006684303284, -0.03998954966664314, -0.055040355771780014, -0.27646440267562866, -0.2998974323272705, -0.018043287098407745, -0.2604897618293762, -0.36948439478874207, 0.22106344997882843, -0.055090922862291336, 0.03698953986167908, -0.11054949462413788, -0.2385353296995163, -0.1881522834300995, 0.1741400957107544, 0.30712470412254333, 0.032410629093647, 0.21873699128627777, -0.18350794911384583, 0.3157634139060974, 0.19421759247779846, 0.26757994294166565, 0.532961905002594, 0.15605591237545013, -0.7888303399085999, 0.1406688094139099, -0.018289051949977875, 0.24005088210105896, 0.24183210730552673, 0.2572789788246155, 0.27656155824661255, 0.29471516609191895, -0.12439273297786713, -0.4071873128414154, 0.0041888984851539135, 0.27087152004241943, -0.19592563807964325, -0.256205677986145, -0.3844129741191864, 0.5426313877105713, 0.1888767033815384, -0.045499347150325775, -0.20388942956924438, 0.3735658526420593, -0.3809759318828583, 0.2597677707672119, 0.3299635648727417, 0.8283454179763794, -0.03653213381767273, 0.35906413197517395, 0.15619295835494995, -0.5406430959701538, 0.3160202205181122, -0.1354067623615265, 0.08822178840637207, -0.13700725138187408, 0.21507857739925385, -0.24914920330047607, -0.16397102177143097, 0.2664666473865509, 0.26438093185424805, 0.04688568040728569, 0.18290579319000244, -0.0973702073097229, 0.14775942265987396, 0.2642856538295746, 0.40706661343574524, -0.36385005712509155, -0.15577614307403564, -0.4017295837402344, -0.05568397790193558, -0.17939916253089905, 0.07166245579719543, 0.03639649972319603, -0.29592186212539673, -0.18419629335403442, -0.2588537335395813, 0.27167993783950806, 0.006704673171043396, -0.04071035236120224, -0.27884984016418457, -0.22492483258247375, -0.17864307761192322, 0.06991530954837799, 0.15355856716632843, -0.014423713088035583, 0.1456131935119629, -0.11808328330516815, 0.06778295338153839, 0.16221529245376587, 0.13143634796142578, -0.13923242688179016, -0.12707526981830597, -0.0012798327952623367, 0.05852051079273224, 0.1373617947101593, 0.08077912032604218, -0.06050784885883331, -0.34175342321395874, 0.2926170825958252, -0.15563076734542847, -0.5142792463302612, 0.005048167426139116, -0.20523232221603394, -0.39930447936058044, -0.014110811054706573, 0.026312392204999924, 0.050327446311712265, -0.14681978523731232, 0.10695794224739075, -0.24900785088539124, -0.11862355470657349, -0.3036345839500427, -0.08706516027450562, 0.3885018229484558, -0.1277579963207245, 0.12042497098445892, 0.4049748480319977, -0.15770220756530762, -0.15781235694885254, -0.039883315563201904, 0.04263872653245926, -0.20492050051689148, 0.06054902821779251, 0.15100236237049103, 0.02526117116212845, -0.3396993577480316, -0.06867475062608719, -0.06056525185704231, 0.20352526009082794, 0.12525394558906555, 0.18972715735435486, -0.5147305130958557, 0.3317751884460449, 0.03070973977446556, -0.029027242213487625, 0.24032799899578094, 0.18337979912757874, -0.14905208349227905, -0.3293555974960327, -0.37190040946006775, -0.08660624921321869, 0.11117632687091827, 0.08203739672899246, 0.31349456310272217, -0.4424873888492584, 0.1757495105266571, 0.040361352264881134, -0.2503248155117035, 0.02501613460481167, -0.08043921738862991, 0.057800933718681335, -0.052652161568403244, -0.42113155126571655, 0.1939467340707779, 0.29175975918769836, 0.14193584024906158, -0.03727800399065018, -0.1783495992422104, -0.03281183913350105, -0.13814280927181244, 0.02687373012304306, 0.0806344598531723, -0.12938955426216125, 0.19364798069000244, -0.2592502534389496, -0.14350169897079468, -0.19488106667995453, 0.14990520477294922, -0.1231679618358612, 0.33763179183006287, -0.11562013626098633, 0.2470778226852417, -0.15392442047595978, 0.2807174026966095, -0.28895071148872375, 0.11240431666374207, 0.0958920568227768, 0.2426440715789795, 0.1626662015914917, -0.18027310073375702, 0.04286034777760506, 0.26579055190086365, 0.28721585869789124, 0.5075328350067139, -0.40571752190589905, -0.06969395279884338, 0.40322786569595337, -0.016428282484412193, 0.2763236165046692, -0.046186961233615875, -0.24511760473251343, -0.2662185728549957, -0.02799167111515999, 0.23569616675376892, -0.04387257993221283, -0.09543586522340775, -0.01187153160572052, -0.09083891659975052, 0.07814440131187439, 0.1648046225309372, 0.26485252380371094, 0.2659183442592621, 0.11264480650424957, 0.22710180282592773, 0.19667983055114746, 0.08257169276475906, 0.08200421184301376, -0.20172609388828278, 0.073961541056633, -0.247716024518013, 0.11133319139480591, 0.30801713466644287, -0.14063870906829834, 0.17966775596141815, -0.287357896566391, -0.05985243618488312, -0.215111643075943, 0.4710697829723358, 0.5111232995986938, -0.024147525429725647, -0.27751198410987854, 0.1133543998003006, -0.262939453125, -0.04534510150551796, 0.1584016978740692, -0.26994869112968445, -0.3188134431838989, -0.039255473762750626, -0.06966450810432434, 0.29131701588630676, -0.09332071244716644, -0.08154259622097015, -0.25535210967063904, 0.5149290561676025, 0.281264066696167, -0.18791642785072327, 0.17931663990020752, -0.0701381042599678, 0.3850906789302826, -0.28553175926208496, -0.05806558579206467, -0.09873612225055695, 0.0782596617937088, 0.4756099581718445, -0.18424540758132935, 0.1132533848285675, 0.16512927412986755, -0.02612178400158882, -0.3667626976966858, -0.22422847151756287, -0.12080862373113632, 0.08416318148374557, 0.22092437744140625, 0.3845134675502777, -0.18447089195251465, 0.1057262122631073, 0.15168963372707367, -0.05485844984650612, -0.010534025728702545, -0.2137383669614792, 0.21872694790363312, -0.15185391902923584, 0.17636901140213013, 0.10915639996528625, 0.15964987874031067, 0.06674586236476898, 0.09887166321277618, -0.45032799243927, -0.19439876079559326, -0.009703759104013443, 0.22078946232795715, 0.06370171159505844, 0.20659595727920532, -0.01048229169100523, 0.06258269399404526, 0.0924992710351944, -0.07715414464473724, 0.15793530642986298, 0.10774055123329163, 0.032064251601696014, -0.14664021134376526, -0.14351436495780945, 0.048842839896678925, -0.41212156414985657, 0.03339463472366333, -0.25588250160217285, 0.1371031403541565, 0.12885954976081848, -0.3500829339027405, 0.27029335498809814, -0.04861434921622276, 0.11059218645095825, 0.05114639177918434, -0.08430236577987671, 0.10049272328615189, 0.36410078406333923, -0.218096062541008, -0.23764413595199585, 0.16278456151485443, 0.2044527530670166, -0.10693366080522537, -0.05542224645614624, 0.1922132968902588, 0.11618703603744507, -0.013275519013404846, 0.2681955099105835, -0.019475070759654045, 0.3391628861427307, -0.33016592264175415, -0.29116567969322205, -0.005988556891679764, 0.0881449431180954, -0.10634331405162811, 0.1741742491722107, -0.11822126805782318, 0.24569499492645264, -0.25853613018989563, 0.4777916967868805, -0.3077845871448517, 0.23636218905448914, -0.5018326044082642, 0.08468501269817352, -0.21381613612174988, 0.11988403648138046, -0.06841061264276505, -0.10935994982719421, -0.21344596147537231, 0.1553402543067932, 0.05022162199020386, 0.005242111161351204, -0.18837133049964905, 0.08595053851604462, 0.14402326941490173, -0.6587644219398499, -0.014123527333140373, 0.4530249238014221, 0.11722534894943237, -0.09827578812837601, 0.3002379834651947, -0.0706033706665039, 0.3442067801952362, 0.10283864289522171, 0.10237051546573639, -0.2627585530281067, 0.22431699931621552, 0.17635783553123474, 0.045705344527959824, -0.2014424204826355, 0.1459912657737732, 0.36513006687164307, -0.21579916775226593, -0.49918583035469055, -0.22162847220897675 ]
https://github.com/huggingface/datasets/issues/5012
Force JSON format regardless of file naming on S3
Hi, I want to make sure I understand this response. I have a set of files on S3 that are private for security reasons. Because they are not public files I cannot read those files (many are parquet) into my hf notebooks in Kaggle? That can't be correct, can it?
I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run ```python dataset = load_dataset( "json", data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ) ``` It gives me ``` InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ``` However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming?
50
Force JSON format regardless of file naming on S3 I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run ```python dataset = load_dataset( "json", data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ) ``` It gives me ``` InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ``` However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming? Hi, I want to make sure I understand this response. I have a set of files on S3 that are private for security reasons. Because they are not public files I cannot read those files (many are parquet) into my hf notebooks in Kaggle? That can't be correct, can it?
[ 0.37514767050743103, -0.22132423520088196, 0.04070274904370308, 0.0384996123611927, 0.09746874868869781, -0.16973067820072174, 0.28897127509117126, 0.15318521857261658, 0.16126896440982819, 0.06703713536262512, -0.12092631310224533, 0.6312375068664551, -0.10404253751039505, 0.503279447555542, -0.21156230568885803, 0.39990296959877014, 0.29438409209251404, 0.4813464879989624, 0.4855634868144989, 0.17708760499954224, -0.27698150277137756, 0.23471318185329437, 0.3009929060935974, -0.08325226604938507, 0.16434833407402039, 0.6374423503875732, 0.22927230596542358, 0.02503148466348648, -0.3507668673992157, -0.5531057715415955, 0.2949359118938446, 0.40220433473587036, 0.3395169973373413, 0.5093223452568054, -0.00013210951874498278, 0.05996932089328766, 0.2804858684539795, -0.2453395426273346, -0.5511329770088196, -0.016172796487808228, -0.41521885991096497, -0.29370367527008057, 0.05524618923664093, -0.08706804364919662, -0.27313098311424255, -0.03861093148589134, 0.06785126775503159, -0.351661741733551, 0.7146238684654236, 0.11088002473115921, -0.040162619203329086, -0.11379826813936234, -0.06836358457803726, 0.28729215264320374, 0.4667830169200897, 0.3503563404083252, -0.07784420251846313, 0.5016552209854126, -0.0909728854894638, 0.11740632355213165, 0.3667696714401245, 0.2158096730709076, -0.1601921021938324, 0.17743217945098877, 0.5034175515174866, -0.1416482776403427, -0.036088958382606506, -0.06076199561357498, -0.0006163641810417175, 0.4038833677768707, 0.5748344659805298, -0.20488262176513672, -0.5411637425422668, -0.22091320157051086, -0.1134653314948082, -0.035402704030275345, 0.3217392563819885, -0.0025344593450427055, 0.09155917167663574, 0.2432176023721695, 0.025193437933921814, -0.3873014748096466, -0.1500270962715149, 0.19528073072433472, -0.3941330313682556, 0.22078213095664978, -0.2031853199005127, -0.07162589579820633, 0.005990404635667801, 0.10049476474523544, 0.39043012261390686, -0.18298622965812683, -0.1717686504125595, -0.07688375562429428, -0.21380330622196198, -0.24314281344413757, -0.35541990399360657, -0.4166254699230194, -0.09404128789901733, 0.04389572888612747, -0.005508781410753727, 0.0955825224518776, -0.03605993092060089, 0.12451698631048203, -0.050423514097929, -0.18737468123435974, 0.2322409451007843, 0.06757581979036331, 0.23841308057308197, 0.18960191309452057, 0.2456766664981842, -0.009525924921035767, -0.13412661850452423, -0.462628573179245, -0.5512325167655945, -0.08668561279773712, 0.19469791650772095, -0.28544923663139343, -0.03641493618488312, 0.01884266547858715, -0.4564597010612488, 0.1675828993320465, -0.37858060002326965, 0.013992473483085632, -0.03836167976260185, 0.46616044640541077, 0.2482057362794876, 0.14567157626152039, -0.13141895830631256, 0.06677087396383286, 0.3474937379360199, -0.3426942229270935, 0.10769115388393402, 0.15052424371242523, 0.16697493195533752, 0.02007395215332508, 0.07278076559305191, 0.22097554802894592, -0.19587920606136322, -0.18175408244132996, 0.17587785422801971, 0.17556357383728027, 0.1385396420955658, 0.17471899092197418, 0.291022390127182, 0.24617891013622284, -0.062126535922288895, -0.5560716390609741, -0.24349412322044373, -0.07592657953500748, -0.4691465497016907, 0.09064498543739319, -0.11045689880847931, -0.06894407421350479, -0.4570496678352356, 0.04387552663683891, -0.3463427424430847, -0.1340855211019516, -0.3652145564556122, -0.23297305405139923, 0.23643022775650024, 0.007969368249177933, 0.4507664144039154, -0.08173462003469467, 0.15840671956539154, 0.17171797156333923, -0.2570481300354004, -0.19950509071350098, 0.11682534217834473, -0.15242473781108856, -0.004866190254688263, 0.06935731321573257, -0.03968203440308571, -0.39802756905555725, -0.10746853053569794, -0.06722427159547806, 0.3388979434967041, -0.43207842111587524, -0.11482948064804077, 0.7467393279075623, -0.2109088897705078, 0.22115592658519745, 0.49500927329063416, -0.11659403145313263, -0.185237318277359, 0.08829985558986664, 0.0835643783211708, 0.15103958547115326, 0.2918211817741394, -0.06524915993213654, -0.09464555233716965, -0.35167601704597473, 0.0000928640365600586, 0.2992648780345917, -0.05287553742527962, 0.33840417861938477, 0.16612643003463745, -0.0778447762131691, 0.3458458483219147, -0.3428555727005005, -0.01673269085586071, 0.3097844123840332, 0.25896915793418884, 0.31192389130592346, 0.12112310528755188, 0.3243253827095032, -0.15933915972709656, -0.006764840334653854, -0.1277388334274292, -0.04173702746629715, -0.12375783920288086, -0.25015032291412354, -0.09919440001249313, -0.42596957087516785, -0.24898715317249298, 0.06416459381580353, -0.042875684797763824, 0.41492152214050293, -0.1167529821395874, 0.012838993221521378, -0.09088393300771713, -0.21182973682880402, 0.24872638285160065, 0.04460311308503151, -0.0865662544965744, -0.02420000173151493, 0.1494031548500061, 0.13454926013946533, 0.15861639380455017, -0.24845385551452637, 0.027513176202774048, -0.08863959461450577, 0.11249056458473206, 0.05450045317411423, 0.4436299204826355, 0.33536988496780396, 0.18758761882781982, 0.21369677782058716, -0.08052637428045273, 0.06151479110121727, -0.057229623198509216, 0.3882279098033905, 0.0027731582522392273, 0.06574272364377975, 0.06511276215314865, 0.60976642370224, -0.017026212066411972, 0.31066250801086426, -0.24979881942272186, -0.17250730097293854, 0.24531269073486328, -0.2917138636112213, -0.5415424704551697, 0.021419323980808258, -0.033588189631700516, 0.1756451427936554, -0.020761962980031967, 0.20356504619121552, -0.21138779819011688, -0.5101445913314819, 0.284542977809906, -0.21300916373729706, -0.12601199746131897, 0.20360898971557617, -0.23287063837051392, 0.07710649073123932, -0.04185047745704651, 0.3882525861263275, 0.14810329675674438, 0.031192928552627563, -0.20482677221298218, 0.052815645933151245, 0.3290073275566101, -0.3169292211532593, 0.2880670130252838, 0.18548369407653809, 0.2623417377471924, 0.44433897733688354, 0.11561167985200882, -0.09092263877391815, -0.21898582577705383, -0.08604533970355988, 0.13078662753105164, -0.4753565490245819, -0.3674634099006653, 0.36813148856163025, -0.31920579075813293, -0.16044096648693085, -0.2525986433029175, -0.06441366672515869, -0.25661492347717285, -0.02830401435494423, -0.01584744080901146, 0.16658484935760498, 0.1175234317779541, 0.02288093976676464, 0.08170381188392639, 0.3875529170036316, -0.26670029759407043, -0.47186705470085144, -0.11034871637821198, -0.2791053354740143, -0.11860040575265884, -0.0754772424697876, 0.04887419939041138, -0.28505411744117737, -0.05598776042461395, -0.4093613922595978, -0.07615847885608673, -0.364977091550827, -0.21215245127677917, -0.03847239911556244, 0.11101974546909332, 0.09297575801610947, 0.2845284342765808, 0.35898518562316895, 0.15522189438343048, -0.040731701999902725, 0.20836681127548218, 0.3577955365180969, 0.038866035640239716, -0.010322432965040207, -0.13044680655002594, 0.16293974220752716, -0.21451662480831146, 0.17936280369758606, 0.2065453827381134, -0.18438303470611572, 0.4017273783683777, 0.08278048038482666, -0.011204011738300323, -0.24252302944660187, 0.04365137219429016, -0.04939523711800575, 0.00931105762720108, 0.03721676021814346, -0.07682181894779205, -0.13232648372650146, 0.2908352315425873, 0.07141635566949844, -0.07633164525032043, 0.184443399310112, 0.015032518655061722, 0.1550210565328598, 0.11359316110610962, -0.5302354097366333, -0.11272931098937988, 0.15502284467220306, -0.2442418336868286, -0.018597185611724854, -0.09810218214988708, -0.06934377551078796, 0.12309577316045761, 0.09379514306783676, -0.15600968897342682, -0.19227334856987, -0.08381278067827225, 0.09513339400291443, 0.4169444441795349, 0.3202671706676483, 0.36951854825019836, 0.06955178081989288, 0.30957621335983276, 0.21799573302268982, 0.09644695371389389, 0.4130988121032715, -0.03836061805486679, 0.33174994587898254, 0.20145979523658752, 0.43183258175849915, -0.30346858501434326, -0.08340290188789368, 0.03179503232240677, 0.33157357573509216, -0.07816934585571289, -0.1971723884344101, -0.386086106300354, 0.026555616408586502, -0.27689477801322937, -0.14245392382144928, 0.16808851063251495, -0.2347034513950348, 0.004804827272891998, -0.3073689937591553, 0.00971519947052002, 0.07434959709644318, 0.09272989630699158, 0.4185550808906555, 0.513364315032959, 0.4199121296405792, 0.13414746522903442, -0.2031269073486328, -0.2903882563114166, -0.006169654428958893, 0.17390865087509155, -0.1863175630569458, 0.46709299087524414, 0.06791935861110687, -0.03140798583626747, 0.07052308320999146, -0.2808648943901062, 0.7019172310829163, -0.24114035069942474, 0.17501477897167206, -0.09457246959209442, 0.03269398957490921, -0.549986720085144, -0.12244939804077148, -0.03918039798736572, -0.17043109238147736, -0.06799185276031494, 0.735459566116333, -0.3354954719543457, -0.24171201884746552, -0.4893917739391327, -0.05639352276921272, -0.0010029040277004242, -0.21471942961215973, -0.3823648691177368, -0.0513090118765831, -0.3105127215385437, -0.34347662329673767, 0.14419442415237427, -0.031141439452767372, -0.051390185952186584, 0.008983563631772995, -0.18719160556793213, -0.07114039361476898, 0.20126286149024963, 0.26035821437835693, 0.06483656167984009, 0.3065730035305023, -0.27301567792892456, 0.24677537381649017, 0.32088637351989746, 0.22178682684898376, 0.612552285194397, 0.12633629143238068, -0.7681775689125061, 0.08233609795570374, -0.010870925150811672, 0.2325437366962433, 0.3845968246459961, 0.3256286084651947, 0.27973517775535583, 0.41129255294799805, -0.06572073698043823, -0.3550862967967987, 0.08865376561880112, 0.21714536845684052, -0.21220789849758148, -0.24317701160907745, -0.414353609085083, 0.6257129311561584, 0.12096717953681946, -0.15918958187103271, -0.15981540083885193, 0.5372146368026733, -0.3933694660663605, 0.3686419129371643, 0.318231463432312, 1.0979574918746948, -0.027457498013973236, 0.43607330322265625, 0.1798938810825348, -0.6004005670547485, 0.3175743818283081, -0.36133116483688354, 0.06888195872306824, -0.10155690461397171, 0.11817748099565506, -0.2905842959880829, -0.18849623203277588, 0.27802491188049316, 0.16093605756759644, 0.03484625741839409, 0.19584153592586517, -0.17474815249443054, 0.21014492213726044, 0.21210718154907227, 0.3308757543563843, -0.44033876061439514, -0.034776877611875534, -0.4907865524291992, -0.09257147461175919, -0.2096470147371292, 0.21450242400169373, 0.00792907178401947, -0.28399360179901123, -0.35957229137420654, -0.242394357919693, 0.292544960975647, 0.05556216090917587, -0.10996939986944199, -0.2772678732872009, -0.21869954466819763, -0.25303298234939575, 0.048472072929143906, 0.24661721289157867, 0.05894487351179123, 0.1535111516714096, -0.16161127388477325, 0.08908428251743317, 0.2389225959777832, 0.04401576519012451, -0.12319240719079971, -0.133905827999115, -0.048966698348522186, -0.06340484321117401, 0.0671239122748375, 0.13229846954345703, -0.11142561584711075, -0.4040493369102478, 0.22869348526000977, -0.02241785079240799, -0.4360913634300232, -0.07183390855789185, -0.19144324958324432, -0.3368133008480072, -0.042422257363796234, 0.03498506173491478, 0.004118144512176514, -0.20172224938869476, 0.13114245235919952, -0.2458607256412506, -0.048350248485803604, -0.3315517008304596, -0.08598589897155762, 0.49598953127861023, -0.1896064579486847, 0.22034963965415955, 0.45821231603622437, -0.1723216027021408, -0.23364777863025665, -0.05411701649427414, 0.0651889368891716, -0.10156113654375076, 0.15605229139328003, 0.06319081783294678, 0.09657317399978638, -0.37456634640693665, -0.11730876564979553, 0.009893342852592468, 0.36098653078079224, 0.07009793072938919, 0.18233953416347504, -0.5219961404800415, 0.35185113549232483, 0.10464411228895187, -0.03406530246138573, 0.2555707097053528, 0.22834715247154236, -0.0935983657836914, -0.2689029276371002, -0.32191893458366394, -0.05329318717122078, 0.14717863500118256, -0.017920149490237236, 0.27706730365753174, -0.31452319025993347, 0.17862790822982788, -0.009955060668289661, -0.22690673172473907, -0.05992661416530609, -0.05087548494338989, 0.038381949067115784, -0.007403271272778511, -0.36283159255981445, 0.25586891174316406, 0.3138132393360138, 0.09106949716806412, -0.05653219297528267, -0.30285853147506714, -0.02183932438492775, -0.08652472496032715, 0.1365252435207367, 0.10851789265871048, -0.12174597382545471, 0.24148474633693695, -0.18709294497966766, -0.04300440102815628, -0.30756717920303345, 0.1547732651233673, -0.10499657690525055, 0.18312254548072815, -0.07881177216768265, 0.042739421129226685, -0.10282916575670242, 0.26702404022216797, -0.24370811879634857, 0.17029720544815063, 0.13405287265777588, 0.24767202138900757, 0.2073398232460022, -0.19997315108776093, 0.02425333485007286, 0.19911068677902222, 0.2121957391500473, 0.5374733805656433, -0.36984890699386597, -0.11897116899490356, 0.4413417875766754, -0.057898104190826416, 0.19714297354221344, -0.14850418269634247, -0.14111736416816711, -0.2809804379940033, -0.05505229905247688, 0.15078537166118622, -0.0019421093165874481, -0.06486614048480988, -0.15592961013317108, -0.037277352064847946, 0.11435294896364212, 0.09826140850782394, 0.2860666513442993, 0.3090168535709381, 0.027091559022665024, 0.26124829053878784, 0.1309087872505188, 0.10764890909194946, 0.03342566639184952, -0.22706593573093414, 0.07446672767400742, -0.2344723492860794, 0.10569833964109421, 0.37369096279144287, -0.0418083593249321, -0.000006061047315597534, -0.2613564133644104, 0.06693845242261887, -0.1503770351409912, 0.41147348284721375, 0.43189117312431335, -0.030882015824317932, -0.1741367131471634, 0.10923542082309723, -0.24983373284339905, -0.028925251215696335, 0.15779761970043182, -0.22546525299549103, -0.31323540210723877, -0.08216214925050735, -0.022675108164548874, 0.18005867302417755, -0.05009664222598076, -0.15596438944339752, -0.1707431674003601, 0.4620344638824463, 0.19654706120491028, -0.003170609474182129, 0.1495635211467743, -0.061921000480651855, 0.43781623244285583, -0.23009328544139862, -0.11177632957696915, -0.1251877099275589, 0.08065850287675858, 0.50151127576828, -0.23388953506946564, 0.11271944642066956, 0.1275753676891327, -0.13242456316947937, -0.36983296275138855, -0.08593693375587463, -0.14607900381088257, 0.08367618918418884, 0.1969354897737503, 0.4213770925998688, -0.2782488167285919, 0.138958141207695, 0.08950657397508621, -0.04622869938611984, -0.04531044140458107, -0.21787677705287933, 0.21075007319450378, -0.17069272696971893, 0.1377059370279312, 0.029228651896119118, 0.08571549504995346, 0.07366213947534561, 0.09949763864278793, -0.4698936343193054, -0.10987315326929092, -0.054232027381658554, 0.26801902055740356, 0.11251864582300186, 0.21511511504650116, -0.04587642848491669, 0.004102123901247978, 0.18527637422084808, -0.024125423282384872, 0.2020571529865265, 0.08042265474796295, 0.07113003730773926, -0.14563843607902527, -0.07373834401369095, 0.03594353422522545, -0.5661935210227966, 0.10659203678369522, -0.28315961360931396, 0.27381467819213867, 0.12148991972208023, -0.3160102963447571, 0.2018282264471054, 0.06565040349960327, 0.17947596311569214, 0.018490519374608994, -0.019687626510858536, 0.16547106206417084, 0.33170944452285767, -0.21928565204143524, -0.32061469554901123, 0.2611919939517975, 0.21593990921974182, -0.15114471316337585, 0.026406582444906235, 0.15765561163425446, 0.1330464631319046, -0.03847569227218628, 0.3534403145313263, -0.08212291449308395, 0.4150996506214142, -0.2729748785495758, -0.2869330942630768, 0.0056645870208740234, 0.10956516116857529, -0.11637085676193237, 0.09966756403446198, -0.11645825207233429, 0.1981453001499176, -0.21527984738349915, 0.41068291664123535, -0.23762980103492737, 0.38452035188674927, -0.38515228033065796, 0.2242828607559204, -0.17292580008506775, 0.08962453156709671, -0.07432769984006882, -0.17341625690460205, -0.14307282865047455, 0.13117434084415436, 0.05883006751537323, -0.117344930768013, -0.23459747433662415, 0.06065835803747177, 0.3239963948726654, -0.6103981137275696, -0.005993358790874481, 0.3689434826374054, 0.1620791256427765, -0.014727935194969177, 0.23014207184314728, -0.09449728578329086, 0.33684730529785156, 0.12290932983160019, 0.10865911096334457, -0.23195907473564148, 0.20143257081508636, 0.07252136617898941, 0.0008055716753005981, -0.22557178139686584, 0.12174490094184875, 0.2085357904434204, -0.14790838956832886, -0.6044782400131226, -0.25322872400283813 ]
https://github.com/huggingface/datasets/issues/5012
Force JSON format regardless of file naming on S3
Hi ! There is a discussion at https://github.com/huggingface/datasets/issues/5281 Using the latest `datasets` 2.11 you can try passing fsspec URLs to private buckets to `data_files` in `load_dataset()`. Though this is still experimental and undocumented, so feedback is welcome. You may not have the best experience though, since anything related to performance and caching hasn't been tested properly yet.
I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run ```python dataset = load_dataset( "json", data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ) ``` It gives me ``` InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ``` However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming?
57
Force JSON format regardless of file naming on S3 I have a file on S3 created by Data Version Control, it looks like `s3://dvc/ac/badff5b134382a0f25248f1b45d7b2` but contains a json file. If I run ```python dataset = load_dataset( "json", data_files='s3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ) ``` It gives me ``` InvalidSchema: No connection adapters were found for 's3://dvc/ac/badff5b134382a0f25248f1b45d7b2' ``` However, I cannot go ahead and change the names of the s3 file. Is there a way to "force" load a S3 url with certain decoder (JSON, CSV, etc.) regardless of s3 URL naming? Hi ! There is a discussion at https://github.com/huggingface/datasets/issues/5281 Using the latest `datasets` 2.11 you can try passing fsspec URLs to private buckets to `data_files` in `load_dataset()`. Though this is still experimental and undocumented, so feedback is welcome. You may not have the best experience though, since anything related to performance and caching hasn't been tested properly yet.
[ 0.1723107546567917, 0.029758453369140625, 0.047462355345487595, 0.03164849057793617, 0.18879066407680511, -0.14227057993412018, 0.2048283964395523, 0.19066540896892548, 0.11577421426773071, 0.06750969588756561, -0.04631142318248749, 0.5999643206596375, -0.1597585529088974, 0.5780047178268433, -0.25846046209335327, 0.4037608206272125, 0.2232324779033661, 0.5520073175430298, 0.34993240237236023, 0.33812564611434937, -0.32555046677589417, 0.2623863220214844, 0.2513501048088074, -0.17822839319705963, 0.08577949553728104, 0.7556792497634888, 0.22284331917762756, -0.0028184428811073303, -0.38443776965141296, -0.612762987613678, 0.35947185754776, 0.4684155285358429, 0.33523133397102356, 0.47061240673065186, -0.00012820548727177083, 0.1014949232339859, 0.28721433877944946, -0.20294274389743805, -0.4871097207069397, -0.16604329645633698, -0.5604845285415649, -0.20436349511146545, 0.10904578864574432, -0.020697370171546936, -0.27614960074424744, -0.08305904269218445, 0.10204850882291794, -0.39698994159698486, 0.6079726815223694, 0.13333065807819366, 0.023506684228777885, -0.06327889859676361, -0.1409304141998291, 0.2623665928840637, 0.2756122052669525, 0.38097500801086426, -0.1838834583759308, 0.4004998505115509, -0.07319746911525726, 0.11489121615886688, 0.3564385175704956, 0.15662148594856262, -0.17307768762111664, 0.2666884958744049, 0.4690469801425934, -0.1618255376815796, 0.012376151978969574, -0.007975306361913681, 0.009210098534822464, 0.38620293140411377, 0.5483552813529968, -0.23364099860191345, -0.6405649781227112, -0.230417400598526, -0.12194643914699554, -0.12390618026256561, 0.38219594955444336, -0.12272052466869354, 0.10599443316459656, 0.3233526647090912, -0.18262408673763275, -0.35365718603134155, -0.18918469548225403, 0.21480000019073486, -0.39102742075920105, 0.05258376896381378, -0.3104017376899719, -0.05600443482398987, 0.036050498485565186, 0.0480533167719841, 0.2649281919002533, -0.1504523754119873, -0.2325442135334015, -0.13782763481140137, -0.21028222143650055, -0.3501109182834625, -0.22764092683792114, -0.4049285352230072, -0.06409469246864319, 0.0680566281080246, -0.03177287429571152, 0.043578892946243286, -0.10893245786428452, 0.0861554965376854, -0.021114390343427658, -0.23616209626197815, 0.34088656306266785, 0.033140454441308975, 0.2560316324234009, 0.05865805596113205, 0.23126927018165588, -0.03465502709150314, -0.1084047481417656, -0.36625564098358154, -0.48797887563705444, -0.010686691850423813, 0.18863439559936523, -0.3670235872268677, 0.022324303165078163, -0.06542448699474335, -0.3373517394065857, 0.21904772520065308, -0.2766118049621582, -0.011914029717445374, 0.042098917067050934, 0.6578822135925293, 0.19531339406967163, 0.1484845131635666, -0.11167502403259277, 0.044785842299461365, 0.2992827296257019, -0.3627779483795166, -0.0501100979745388, 0.20072151720523834, 0.2374948412179947, -0.011774744838476181, 0.07954192906618118, 0.163577139377594, -0.3506254553794861, -0.06463170051574707, 0.0903419703245163, 0.2282830774784088, 0.1296519637107849, 0.20118524134159088, 0.20151905715465546, 0.33029651641845703, -0.14641402661800385, -0.4518342614173889, -0.2944597005844116, -0.06625876575708389, -0.3887755274772644, 0.006336476653814316, -0.17998960614204407, -0.036066874861717224, -0.4640025496482849, -0.047864146530628204, -0.4258745610713959, -0.013467639684677124, -0.36347442865371704, -0.2970191240310669, 0.14588716626167297, -0.06642547249794006, 0.21041333675384521, -0.09416233748197556, 0.17087557911872864, 0.27356892824172974, -0.3407153785228729, -0.2983627915382385, 0.08019138872623444, -0.1658632904291153, -0.053547121584415436, 0.06141844391822815, 0.020163644105196, -0.45802977681159973, -0.12027742713689804, -0.06320638209581375, 0.2465110421180725, -0.40924525260925293, -0.16505315899848938, 0.7177810072898865, -0.1401025354862213, 0.18327774107456207, 0.4035670757293701, -0.11731003224849701, -0.10934621095657349, 0.0036691324785351753, 0.038440246134996414, 0.24930578470230103, 0.1986042857170105, 0.06645237654447556, 0.027332518249750137, -0.413662314414978, -0.01747986674308777, 0.3102181851863861, -0.13167846202850342, 0.4165828824043274, 0.11985369771718979, -0.09550341963768005, 0.2232843041419983, -0.3604404628276825, -0.021470215171575546, 0.34879374504089355, 0.2779059112071991, 0.14463776350021362, 0.0455755777657032, 0.08339190483093262, -0.3190455138683319, 0.03210070729255676, 0.07385600358247757, -0.07146210968494415, -0.18487589061260223, -0.21193653345108032, -0.005234445445239544, -0.39699655771255493, -0.21366934478282928, 0.0825079008936882, -0.06393492221832275, 0.3890436291694641, -0.010701324790716171, -0.027617646381258965, -0.161519855260849, -0.20543330907821655, 0.22754399478435516, 0.09716226905584335, -0.13554152846336365, -0.04281992465257645, 0.313429594039917, 0.04681586101651192, 0.25532636046409607, -0.1777878999710083, -0.019578248262405396, -0.12941651046276093, 0.04765978455543518, 0.1106981635093689, 0.37285009026527405, 0.36843055486679077, 0.17664718627929688, 0.3662063181400299, -0.07758962363004684, 0.18547619879245758, -0.07734863460063934, 0.26273638010025024, -0.0855003222823143, 0.05529184639453888, -0.015993639826774597, 0.5761950612068176, -0.009007822722196579, 0.376126229763031, -0.1871313452720642, -0.15684010088443756, 0.309144526720047, -0.31323426961898804, -0.5642743706703186, -0.055581387132406235, -0.07518234848976135, 0.32599544525146484, 0.07417669892311096, 0.27064448595046997, -0.2074217051267624, -0.5211389064788818, 0.3932814598083496, -0.14967887103557587, -0.19397678971290588, 0.22050535678863525, -0.2525986135005951, 0.06885682791471481, -0.04691869020462036, 0.4626167118549347, 0.28138571977615356, 0.07339783757925034, -0.23158502578735352, 0.027956988662481308, 0.3223133087158203, -0.32238906621932983, 0.32187172770500183, 0.14063535630702972, 0.202972874045372, 0.35298168659210205, 0.13442732393741608, -0.08958356827497482, -0.3357471823692322, -0.1641686111688614, 0.0957840159535408, -0.4842468500137329, -0.4203767776489258, 0.3210148215293884, -0.4101077914237976, -0.23421797156333923, -0.25143536925315857, -0.08038182556629181, -0.26377394795417786, 0.005029793828725815, -0.02619272843003273, 0.30198630690574646, 0.03177205100655556, 0.12909649312496185, 0.02372550219297409, 0.39983636140823364, -0.19993583858013153, -0.5677101612091064, -0.1140822023153305, -0.17246533930301666, -0.03242633491754532, -0.05365031957626343, 0.04565925523638725, -0.27478310465812683, -0.029874494299292564, -0.3912557363510132, -0.07490211725234985, -0.3617199659347534, -0.14932724833488464, 0.03978480398654938, 0.1522943526506424, 0.1426141858100891, 0.34882909059524536, 0.3152313828468323, 0.2803037166595459, 0.007494880817830563, 0.24263371527194977, 0.2594149112701416, 0.05187176913022995, 0.016304340213537216, -0.14999215304851532, 0.19252906739711761, -0.24924542009830475, 0.12044881284236908, 0.28388711810112, -0.18172094225883484, 0.4216660261154175, -0.020628314465284348, -0.005795687437057495, -0.059447504580020905, 0.044182028621435165, -0.13855679333209991, -0.11795403808355331, -0.05547688901424408, -0.02692347951233387, -0.28482455015182495, 0.3464091718196869, 0.05692818760871887, -0.04850611463189125, 0.12591132521629333, 0.03983156383037567, 0.07457603514194489, 0.17937800288200378, -0.3691440224647522, -0.15549920499324799, 0.04782214015722275, -0.18921104073524475, 0.17762088775634766, -0.06634429842233658, -0.03781589865684509, 0.19599920511245728, 0.060531385242938995, -0.13358262181282043, -0.20647397637367249, -0.032777316868305206, 0.15716388821601868, 0.4165576100349426, 0.36570724844932556, 0.3973705470561981, 0.0015815310180187225, 0.3116289973258972, 0.28771111369132996, -0.039142969995737076, 0.42204898595809937, -0.13538968563079834, 0.3388013541698456, 0.15944400429725647, 0.3454129993915558, -0.2385537177324295, -0.14129191637039185, 0.04466591030359268, 0.27246320247650146, 0.009988276287913322, -0.08739174157381058, -0.3096548616886139, 0.19636748731136322, -0.17281487584114075, -0.10496854782104492, 0.1372068077325821, -0.27266228199005127, 0.07314158976078033, -0.22186000645160675, -0.008005212992429733, 0.125263512134552, 0.06985189765691757, 0.3260813355445862, 0.4677090644836426, 0.4243294298648834, 0.08857382833957672, -0.20576897263526917, -0.11447200179100037, -0.17058971524238586, 0.1368645876646042, -0.16439159214496613, 0.4462072551250458, 0.09588831663131714, 0.07149050384759903, -0.06112949550151825, -0.17521727085113525, 0.6594641804695129, -0.3541381061077118, 0.1137494370341301, -0.1044386625289917, -0.07504094392061234, -0.4819369912147522, -0.027609681710600853, 0.03822675719857216, -0.02653271146118641, -0.016734376549720764, 0.6068100929260254, -0.34173068404197693, -0.3258887529373169, -0.4108405113220215, -0.03881565108895302, -0.005271695554256439, -0.2501811683177948, -0.25129997730255127, 0.008627884089946747, -0.2648341655731201, -0.36404138803482056, 0.17399922013282776, -0.018131127581000328, 0.01404366921633482, -0.11585423350334167, -0.22821426391601562, -0.14001494646072388, 0.22784672677516937, 0.27296313643455505, 0.06338374316692352, 0.3054150342941284, -0.11843858659267426, 0.35034850239753723, 0.1976463943719864, 0.36285820603370667, 0.5617462396621704, 0.07614326477050781, -0.8008148670196533, 0.1233154684305191, 0.06242263689637184, 0.26466092467308044, 0.30017709732055664, 0.19980493187904358, 0.24703681468963623, 0.3260926604270935, -0.11362455785274506, -0.43935537338256836, 0.08018098026514053, 0.26928579807281494, -0.1264009028673172, -0.3300948143005371, -0.5170933604240417, 0.6148514747619629, 0.21557873487472534, -0.06452417373657227, -0.10192690789699554, 0.45030850172042847, -0.3731950521469116, 0.3183056116104126, 0.17900243401527405, 0.8623098134994507, -0.0478026419878006, 0.38655197620391846, 0.16648221015930176, -0.46889710426330566, 0.3676515221595764, -0.2078455090522766, 0.04071735218167305, -0.14861777424812317, 0.18259082734584808, -0.2692067325115204, -0.18806631863117218, 0.327596515417099, 0.2680528163909912, 0.1070905476808548, 0.32318753004074097, -0.03877567499876022, 0.12415577471256256, 0.22786182165145874, 0.4022280275821686, -0.33980363607406616, -0.20796850323677063, -0.5137172341346741, -0.05296816676855087, -0.1849386990070343, 0.12719829380512238, 0.11092069745063782, -0.256449818611145, -0.13217230141162872, -0.27264130115509033, 0.14599740505218506, 0.04903772473335266, -0.03435405343770981, -0.3590223789215088, -0.15553203225135803, -0.10986489802598953, 0.24115866422653198, 0.23125065863132477, 0.010255880653858185, 0.12847289443016052, -0.19365786015987396, 0.09329573810100555, 0.18090598285198212, 0.21405649185180664, -0.07028331607580185, -0.2110844999551773, -0.04169332981109619, 0.04639075696468353, 0.11113175004720688, 0.07664264738559723, -0.054126229137182236, -0.4432045817375183, 0.3233301341533661, -0.12218564748764038, -0.40634655952453613, -0.10353284329175949, -0.21622610092163086, -0.30906838178634644, 0.06891289353370667, -0.015996471047401428, 0.025842752307653427, -0.11660213768482208, 0.11627526581287384, -0.1041891798377037, -0.1167798638343811, -0.3501560091972351, -0.11146047711372375, 0.42893707752227783, -0.24720057845115662, 0.153890460729599, 0.38599392771720886, -0.12008091807365417, -0.19362302124500275, -0.030475541949272156, 0.08295535296201706, -0.0553397499024868, 0.10843677073717117, 0.11252608895301819, 0.05107201635837555, -0.34706681966781616, -0.07203425467014313, 0.12851189076900482, 0.1537819504737854, 0.06917808949947357, 0.2209601253271103, -0.4690912365913391, 0.2955605685710907, 0.03208937123417854, -0.038833457976579666, 0.29547709226608276, 0.18850040435791016, -0.08374649286270142, -0.3759126365184784, -0.3249334990978241, -0.08342230319976807, 0.10175564885139465, 0.08058571070432663, 0.30239051580429077, -0.378813773393631, 0.2182263731956482, 0.12137912958860397, -0.32288703322410583, -0.02360503003001213, -0.029059115797281265, -0.018360674381256104, -0.02415979653596878, -0.41175299882888794, 0.209631085395813, 0.31938818097114563, 0.062218077480793, -0.06477214395999908, -0.2257576733827591, -0.08984829485416412, -0.1878175139427185, 0.09000787138938904, 0.21244359016418457, -0.12060500681400299, 0.23796901106834412, -0.20418979227542877, -0.14978376030921936, -0.20897048711776733, 0.21864835917949677, -0.08618767559528351, 0.31384629011154175, -0.09468960016965866, 0.2829780578613281, -0.17758725583553314, 0.270352840423584, -0.2450137883424759, 0.11923474818468094, 0.1803360879421234, 0.25376251339912415, 0.14379265904426575, -0.2299179583787918, -0.006667286157608032, 0.34209510684013367, 0.4103701114654541, 0.5582702159881592, -0.38074856996536255, -0.046064816415309906, 0.39709487557411194, -0.03379003703594208, 0.22821754217147827, -0.04028283804655075, -0.09384985268115997, -0.20782646536827087, -0.02756306529045105, 0.18617895245552063, -0.04246015101671219, -0.056982774287462234, -0.03545615077018738, -0.0774039551615715, 0.03553251549601555, 0.2099500447511673, 0.3256220519542694, 0.1549414098262787, 0.08991013467311859, 0.2665470540523529, 0.27673158049583435, 0.13457250595092773, 0.0036665424704551697, -0.08356454968452454, 0.14145250618457794, -0.21187788248062134, 0.0693313479423523, 0.32880350947380066, -0.14251360297203064, 0.043802935630083084, -0.1581820398569107, -0.04230387508869171, -0.13425007462501526, 0.42951497435569763, 0.4893512427806854, 0.07252006977796555, -0.28499868512153625, 0.038240376859903336, -0.26919880509376526, -0.010695986449718475, 0.14235101640224457, -0.31589165329933167, -0.2610290050506592, -0.008616916835308075, -0.010833077132701874, 0.2870032787322998, -0.144612118601799, -0.16599416732788086, -0.12734732031822205, 0.4614318013191223, 0.27255281805992126, -0.2967720925807953, 0.19057020545005798, -0.04399733990430832, 0.40913161635398865, -0.2027985006570816, 0.03804563730955124, -0.23413895070552826, 0.0680328905582428, 0.504197895526886, -0.10914117842912674, 0.0915583074092865, 0.08102007210254669, 0.030832761898636818, -0.3903813064098358, -0.1911599040031433, -0.09263850748538971, 0.12998750805854797, 0.1938675194978714, 0.2234933227300644, -0.1739014983177185, 0.14059242606163025, 0.10964934527873993, -0.015895117074251175, -0.07205872237682343, -0.26506081223487854, 0.22643353044986725, -0.23436765372753143, 0.223455011844635, 0.09619633108377457, 0.2117219865322113, 0.07180442661046982, 0.1270754486322403, -0.3598487973213196, -0.1709863394498825, 0.09574173390865326, 0.17638425529003143, 0.06806585192680359, 0.11101996898651123, -0.019558394327759743, 0.029178163036704063, 0.11105623841285706, 0.007447652518749237, 0.16962292790412903, 0.07237102091312408, 0.05041065812110901, -0.1985705941915512, -0.12552598118782043, 0.010273244231939316, -0.38554322719573975, 0.015895303338766098, -0.28086256980895996, 0.16633808612823486, 0.15799203515052795, -0.32867372035980225, 0.294495165348053, -0.07327248156070709, 0.17976497113704681, 0.019580069929361343, -0.01960695907473564, 0.03087412565946579, 0.3313825726509094, -0.18132761120796204, -0.324783056974411, 0.18800099194049835, 0.2727333605289459, -0.15256211161613464, -0.07634028792381287, 0.19515961408615112, 0.08557948470115662, -0.17877179384231567, 0.2591467499732971, 0.021361008286476135, 0.3524852395057678, -0.29288288950920105, -0.3425210118293762, -0.05467044934630394, -0.024348393082618713, -0.15555012226104736, 0.158302441239357, -0.19534213840961456, 0.2700413465499878, -0.2760649621486664, 0.48416540026664734, -0.3411514461040497, 0.2430749535560608, -0.49124181270599365, 0.09947255253791809, -0.2628614008426666, 0.1443554311990738, -0.15866199135780334, -0.0457274466753006, -0.26805514097213745, 0.17157253623008728, 0.02939416654407978, 0.042454496026039124, -0.18322741985321045, 0.07574410736560822, 0.24507907032966614, -0.7025941014289856, -0.04038263484835625, 0.3891836702823639, 0.15226337313652039, -0.04940084367990494, 0.1501152515411377, -0.1713685840368271, 0.2993462085723877, 0.07284444570541382, 0.08757507801055908, -0.24028420448303223, 0.20040185749530792, 0.07247360795736313, 0.036380279809236526, -0.23394335806369781, 0.3045969009399414, 0.32582709193229675, -0.21428339183330536, -0.4099414050579071, -0.27430450916290283 ]
https://github.com/huggingface/datasets/issues/5009
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
I think this is because some columns are mostly empty lists. In particular the train and validation splits only have empty lists for `val_ann`. Therefore the type inference doesn't know which type is inside (or it would have to scan the other splits first before knowing). You can fix that by specifying the features types explicitly. Then you can save the feature types inside the dataset repository, so that you won't need to specify the features in subsequent calls: ```python from datasets import load_dataset, Features, Sequence, Value from datasets.info import DatasetInfosDict features = Features({ 'narrative': Value('string'), 'question': Value('string'), 'original_sentence_for_question': Value('string'), 'narrative_lexical_overlap': Value('float64'), 'is_ques_answerable': Value('string'), 'answer': Value('string'), 'is_ques_answerable_annotator': Value('string'), 'original_narrative_form': Sequence(Value('string')), 'question_meta': Value('string'), 'helpful_sentences': Sequence(Value('int64')), 'human_eval': Value('bool'), 'val_ann': Sequence(Value('int64')), 'gram_ann': Sequence(Value('int64')) }) ds = load_dataset('StonyBrookNLP/tellmewhy', features=features) DatasetInfosDict({"default": ds["train"].info}).write_to_directory("path/to/local/tellmewhy") ``` and then after pushing the change to the dataset repository on the Hub, `load_dataset("StonyBrookNLP/tellmewhy")` will work directly`
## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
145
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly ## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 I think this is because some columns are mostly empty lists. In particular the train and validation splits only have empty lists for `val_ann`. Therefore the type inference doesn't know which type is inside (or it would have to scan the other splits first before knowing). You can fix that by specifying the features types explicitly. Then you can save the feature types inside the dataset repository, so that you won't need to specify the features in subsequent calls: ```python from datasets import load_dataset, Features, Sequence, Value from datasets.info import DatasetInfosDict features = Features({ 'narrative': Value('string'), 'question': Value('string'), 'original_sentence_for_question': Value('string'), 'narrative_lexical_overlap': Value('float64'), 'is_ques_answerable': Value('string'), 'answer': Value('string'), 'is_ques_answerable_annotator': Value('string'), 'original_narrative_form': Sequence(Value('string')), 'question_meta': Value('string'), 'helpful_sentences': Sequence(Value('int64')), 'human_eval': Value('bool'), 'val_ann': Sequence(Value('int64')), 'gram_ann': Sequence(Value('int64')) }) ds = load_dataset('StonyBrookNLP/tellmewhy', features=features) DatasetInfosDict({"default": ds["train"].info}).write_to_directory("path/to/local/tellmewhy") ``` and then after pushing the change to the dataset repository on the Hub, `load_dataset("StonyBrookNLP/tellmewhy")` will work directly`
[ -0.19701562821865082, 0.2147456705570221, 0.1286277174949646, 0.5178280472755432, 0.08397334814071655, 0.11888126283884048, 0.35095784068107605, 0.46086180210113525, 0.27356967329978943, 0.021775774657726288, -0.05008245259523392, 0.3347477614879608, -0.06883789598941803, -0.1606757491827011, 0.16613681614398956, -0.07134293019771576, -0.002238042652606964, 0.068179652094841, 0.28442156314849854, -0.3149515986442566, -0.21572916209697723, 0.1951570361852646, -0.08560508489608765, 0.18235453963279724, -0.5136275291442871, 0.2908664643764496, 0.06696397811174393, 0.6622047424316406, -0.008944563567638397, -0.26984015107154846, 0.456272155046463, -0.031321439892053604, 0.10714607685804367, 0.22887000441551208, -0.00011705971701303497, 0.14865674078464508, 0.5657786130905151, -0.058481886982917786, -0.14762942492961884, -0.43973588943481445, -0.15605680644512177, -0.08510439842939377, 0.2596462070941925, -0.11599650233983994, -0.03740054368972778, 0.18746060132980347, -0.13078756630420685, -0.11153917014598846, 0.18348461389541626, 0.172343909740448, 0.14590483903884888, 0.36417198181152344, -0.09025271236896515, -0.18379835784435272, 0.46016725897789, -0.021776795387268066, -0.18725670874118805, 0.5830785632133484, 0.42707741260528564, 0.020000601187348366, -0.07437913864850998, -0.004581637680530548, -0.04979734495282173, 0.2895178198814392, 0.18571612238883972, 0.02323346957564354, -0.11772600561380386, 0.319876492023468, 0.08932501822710037, 0.3359432816505432, 0.42460280656814575, -0.3093773126602173, -0.234124094247818, -0.25652265548706055, 0.05515793710947037, -0.016216782853007317, 0.3605438470840454, 0.15503118932247162, -0.01448700949549675, 0.2464950978755951, -0.1512671560049057, -0.21402515470981598, -0.0984705463051796, 0.20026758313179016, -0.04361036419868469, 0.1558614820241928, -0.0023554665967822075, 0.28337404131889343, -0.18832987546920776, 0.2060699313879013, 0.6413303017616272, -0.21716901659965515, -0.07802484929561615, 0.23984448611736298, -0.23552431166172028, 0.17296582460403442, 0.11733169853687286, 0.08802243322134018, 0.1464030146598816, 0.28124117851257324, 0.19925102591514587, 0.08470112085342407, -0.26748499274253845, 0.16310201585292816, 0.43075281381607056, 0.3105684518814087, -0.0944221094250679, 0.24172325432300568, 0.12600857019424438, 0.07823879271745682, -0.26603832840919495, 0.09031283855438232, -0.2536883056163788, -0.0043135955929756165, -0.05343949794769287, -0.14807263016700745, 0.24151097238063812, -0.30691981315612793, -0.3299899101257324, 0.03993817791342735, 0.04172813147306442, 0.023816315457224846, 0.28893208503723145, 0.3089176118373871, 0.04949469491839409, 0.2492062747478485, 0.008538279682397842, 0.21450453996658325, -0.42963019013404846, -0.04071016609668732, -0.3801487386226654, 0.0852317065000534, -0.09392672777175903, 0.016721457242965698, 0.3925604224205017, -0.20722196996212006, 0.23010586202144623, -0.09653033316135406, 0.01749725639820099, -0.2683083415031433, -0.1479666829109192, -0.046768106520175934, -0.2271479368209839, 0.10251347720623016, -0.0011388510465621948, 0.2749069929122925, 0.21091803908348083, -0.09476156532764435, -0.2303873598575592, 0.16277801990509033, -0.5746971964836121, -0.5359532833099365, -0.09801433980464935, 0.11177831143140793, -0.4134358763694763, -0.05355090647935867, -0.22293582558631897, -0.12172907590866089, -0.05648428946733475, -0.09146885573863983, -0.21742379665374756, -0.1340508759021759, 0.05319977179169655, -0.1414557844400406, 0.09549390524625778, 0.5670166611671448, -0.2274550199508667, -0.16266962885856628, 0.0074324519373476505, -0.018673665821552277, 0.09433499723672867, 0.33459359407424927, -0.5349122285842896, 0.4359896183013916, -0.19216907024383545, 0.1245189905166626, 0.3858533203601837, -0.5741565823554993, -0.45452678203582764, 0.15351282060146332, -0.2442898005247116, 0.04411961883306503, -0.24255988001823425, 0.08311142027378082, -0.08081134408712387, -0.017039291560649872, 0.38605645298957825, 0.3483806252479553, 0.22222307324409485, 0.05806061625480652, -0.30633270740509033, -0.31808698177337646, -0.1562667191028595, 0.4931279420852661, 0.1251504123210907, 0.16576488316059113, 0.23934608697891235, 0.4989723861217499, 0.19964411854743958, -0.02561776712536812, 0.07628058642148972, 0.205180823802948, 0.30421221256256104, -0.04750456660985947, 0.0035255588591098785, -0.11036995053291321, -0.37228330969810486, 0.44736185669898987, -0.14669504761695862, -0.12810461223125458, 0.09207446873188019, 0.1878521591424942, -0.3402768671512604, -0.035034291446208954, -0.5538846850395203, 0.06070950627326965, 0.028550885617733, 0.02032683789730072, 0.09743018448352814, -0.06468646228313446, -0.31894007325172424, 0.2732087969779968, -0.20937171578407288, 0.10529088973999023, -0.4227851927280426, 0.5764979124069214, 0.025490300729870796, -0.12467086315155029, 0.07284297049045563, 0.3011179268360138, 0.16023549437522888, -0.22351829707622528, -0.3328114151954651, 0.3756770193576813, 0.062291573733091354, 0.313528448343277, 0.01686735823750496, -0.12427110970020294, 0.07567904889583588, -0.04774840548634529, 0.40471965074539185, -0.026485610753297806, 0.10460072755813599, -0.1304578334093094, -0.1835048794746399, 0.2448483407497406, -0.1256927251815796, 0.10502180457115173, -0.11848173290491104, -0.1404641568660736, 0.22145965695381165, -0.17092907428741455, 0.17289559543132782, -0.11610622704029083, 0.34512859582901, 0.39496472477912903, 0.3352310061454773, -0.06196477264165878, -0.04925552010536194, -0.14124542474746704, 0.2527913451194763, -0.01723206415772438, 0.061140287667512894, 0.1366328001022339, -0.21710050106048584, -0.08008305728435516, -0.06099477410316467, 0.4289547801017761, 0.42490214109420776, 0.018296845257282257, -0.174462229013443, 0.24900385737419128, -0.0901227593421936, -0.15835699439048767, -0.02260487526655197, -0.0945587158203125, 0.22866640985012054, 0.4080880284309387, 0.029729502275586128, -0.04819939658045769, -0.42289480566978455, 0.04052339121699333, 0.20687495172023773, 0.32784783840179443, -0.4109727740287781, -0.023059027269482613, -0.25047168135643005, 0.4910900890827179, -0.35015979409217834, -0.37166792154312134, -0.18542322516441345, -0.39975506067276, -0.014579478651285172, 0.54119873046875, -0.0433967299759388, -0.22684185206890106, -0.10679534077644348, 0.18817423284053802, -0.05483122169971466, -0.30635198950767517, -0.04301480948925018, -0.27389150857925415, -0.3050994873046875, -0.06853784620761871, 0.30948442220687866, 0.34689733386039734, 0.07332723587751389, -0.4387647807598114, 0.1185830682516098, -0.07527811825275421, 0.048408955335617065, 0.19312019646167755, -0.015068728476762772, 0.3748866021633148, 0.04316943138837814, 0.15705999732017517, -0.014950843527913094, -0.2478795349597931, 0.36020395159721375, -0.3063112497329712, -0.0425509437918663, 0.2594083547592163, 0.01620488427579403, -0.14745375514030457, 0.02876313403248787, -0.3484431207180023, -0.30260899662971497, -0.2732788622379303, 0.10268473625183105, 0.016696374863386154, 0.042169228196144104, 0.2515583038330078, -0.05076845735311508, 0.12939687073230743, 0.04555045813322067, -0.2663952708244324, -0.36385640501976013, -0.65767902135849, 0.2792402505874634, -0.3718472123146057, -0.43669238686561584, -0.004410352557897568, 0.07626543194055557, 0.15471391379833221, -0.2062603384256363, -0.5261189937591553, -0.1717735379934311, -0.11505782604217529, -0.009988468140363693, -0.05330062657594681, -0.008193036541342735, 0.19568631052970886, -0.21059678494930267, 0.10146225988864899, -0.2207891047000885, -0.2358555942773819, 0.1315959095954895, 0.37768763303756714, 0.19302299618721008, 0.11540503054857254, 0.010035691782832146, -0.19215863943099976, 0.29746532440185547, 0.17917382717132568, 0.06619419157505035, 0.4907895624637604, 0.10853484272956848, 0.15505339205265045, -0.4114065170288086, -0.20209981501102448, 0.1520835906267166, -0.052531301975250244, -0.18543994426727295, 0.31425541639328003, 0.19528090953826904, -0.030888264998793602, -0.21794532239437103, -0.25970685482025146, -0.188947856426239, -0.2980727255344391, 0.07301932573318481, -0.036770112812519073, -0.10890030115842819, 0.18308031558990479, 0.1260860562324524, -0.2580634653568268, -0.20005354285240173, 0.0654594898223877, 0.2153385579586029, 0.08507014811038971, 0.1335149109363556, -0.3880454897880554, 0.13637055456638336, -0.3147239685058594, -0.006675347685813904, 0.007457990199327469, 0.46499401330947876, -0.021558716893196106, 0.10723166912794113, 0.21507342159748077, -0.09075571596622467, 0.40866243839263916, -0.1179942712187767, 0.33434122800827026, 0.16881625354290009, -0.13205234706401825, -0.589324414730072, -0.16433469951152802, -0.014595922082662582, 0.12914468348026276, -0.2715759575366974, 0.35465502738952637, -0.10960802435874939, -0.21530015766620636, 0.06275385618209839, 0.21182449162006378, -0.3659943640232086, -0.411203533411026, -0.1145152598619461, -0.22715073823928833, -0.43862125277519226, -0.314920574426651, -0.17281104624271393, 0.4311860501766205, -0.15103276073932648, -0.026461929082870483, 0.1973617672920227, 0.010848063975572586, -0.03127977252006531, 0.020853839814662933, 0.33532023429870605, 0.06245872750878334, 0.24964526295661926, 0.3859160542488098, 0.24668507277965546, 0.09362209588289261, 0.8297297358512878, 0.09053008258342743, -0.03659015893936157, 0.0182664692401886, -0.056973036378622055, -0.09519270807504654, 0.3731078803539276, 0.05587185546755791, -0.22279924154281616, -0.2321608066558838, -0.203006312251091, -0.26476314663887024, 0.07045827805995941, -0.047617703676223755, -0.15352649986743927, -0.13820187747478485, -0.29541242122650146, 0.745842695236206, -0.12150311470031738, -0.03792939335107803, 0.2378823310136795, 0.17754217982292175, -0.2442810982465744, 0.33682870864868164, -0.06746334582567215, 0.7275052070617676, -0.1296476125717163, 0.08208156377077103, 0.18494579195976257, -0.1389887034893036, 0.0571228563785553, -0.18973307311534882, -0.08631738275289536, -0.45234590768814087, 0.02663828432559967, 0.010600415989756584, -0.1912114918231964, -0.07580558210611343, 0.1763136088848114, 0.1925816684961319, 0.1807151585817337, -0.1706521362066269, 0.35948920249938965, 0.007710157427936792, 0.29934269189834595, -0.16448836028575897, -0.15620605647563934, -0.33395808935165405, 0.12198580801486969, -0.3084236979484558, 0.3172294795513153, -0.006357865873724222, -0.09382311254739761, -0.34397295117378235, -0.1346152424812317, -0.14901936054229736, 0.2670398950576782, 0.010019967332482338, 0.22526191174983978, 0.00787399336695671, -0.25347039103507996, 0.061544980853796005, -0.11672447621822357, 0.2907365560531616, -0.024738501757383347, -0.48471784591674805, 0.20331458747386932, -0.2533412575721741, -0.053124044090509415, -0.08387967199087143, 0.04198223352432251, 0.09079068154096603, -0.11623530089855194, -0.2936093807220459, -0.22534483671188354, -0.1320241093635559, -0.5381008982658386, -0.12279917299747467, 0.05468940734863281, 0.18077422678470612, -0.23348423838615417, -0.3793431520462036, 0.13879604637622833, 0.14752815663814545, -0.18550153076648712, 0.07469195127487183, 0.284479022026062, -0.1462664008140564, -0.03133571147918701, 0.1612139195203781, -0.27593719959259033, 0.06877652555704117, 0.5314810872077942, -0.015104200690984726, -0.1030048355460167, 0.4810539484024048, -0.04907890781760216, 0.13580256700515747, -0.061112578958272934, 0.2437121570110321, 0.6789808869361877, -0.5412433743476868, -0.055399391800165176, -0.29589128494262695, 0.0374419242143631, 0.13000857830047607, 0.35559991002082825, 0.19726169109344482, 0.054014042019844055, -0.058966971933841705, -0.48550644516944885, -0.19839242100715637, 0.24426642060279846, 0.013397255912423134, 0.2616472840309143, -0.0780034288764, 0.32993316650390625, -0.08748359233140945, 0.10379486531019211, -0.22026169300079346, 0.39067643880844116, -0.12353493273258209, 0.009700333699584007, -0.1733642965555191, -0.09233539551496506, 0.04447499290108681, -0.1052105575799942, 0.02650531195104122, -0.03913543373346329, -0.1847960650920868, -0.14265689253807068, -0.21187864243984222, 0.1832381933927536, 0.21305051445960999, -0.14759162068367004, -0.2793014943599701, -0.2858615517616272, 0.11521342396736145, -0.12745963037014008, 0.22058185935020447, 0.3554264307022095, -0.0367903858423233, 0.16165660321712494, 0.4478929042816162, 0.10388708114624023, -0.19051998853683472, 0.31567880511283875, 0.0064077228307724, 0.3063197433948517, -0.1715167611837387, 0.03792129084467888, 0.021641403436660767, 0.14073215425014496, -0.15181763470172882, 0.01262761652469635, 0.14787505567073822, 0.3636651635169983, 0.24251878261566162, -0.34817588329315186, 0.2341497540473938, 0.17834989726543427, 0.09790850430727005, 0.37694084644317627, -0.306972861289978, -0.07908239215612411, 0.09169360995292664, 0.12365489453077316, -0.15326832234859467, -0.3720608949661255, 0.2818470001220703, -0.045755043625831604, -0.19323700666427612, 0.07485808432102203, 0.4668865501880646, -0.22767546772956848, -0.4115045666694641, 0.04648400843143463, 0.7463684678077698, 0.11938205361366272, 0.12365953624248505, 0.4023260474205017, -0.22615930438041687, 0.018658261746168137, -0.08524885028600693, -0.03859685733914375, 0.02424941211938858, 0.7614558339118958, -0.09942758828401566, 0.31017905473709106, 0.008118974044919014, 0.24056532979011536, 0.1750899851322174, -0.3058958053588867, 0.02293030358850956, 0.05217587202787399, 0.03423575311899185, 0.09595011919736862, -0.16246791183948517, 0.1485905945301056, -0.32087084650993347, 0.01961883157491684, -0.3484989106655121, 0.12255674600601196, -0.1177418902516365, -0.2071269452571869, -0.25256794691085815, -0.301385760307312, -0.08712288737297058, 0.058529723435640335, -0.2395496368408203, -0.14305444061756134, 0.05892575904726982, 0.030798520892858505, -0.29535335302352905, -0.1507348269224167, 0.08520399034023285, 0.20092502236366272, -0.05329500883817673, -0.3021675944328308, 0.2914520502090454, 0.1629714071750641, -0.15443482995033264, 0.3131539821624756, 0.11015897244215012, 0.3145901560783386, 0.34282469749450684, -0.09955906867980957, 0.08877474069595337, 0.07118387520313263, -0.028794866055250168, -0.002706233412027359, 0.19171130657196045, -0.09520938992500305, -0.10282301902770996, 0.4018346965312958, 0.12415620684623718, -0.03519948571920395, 0.061752792447805405, -0.04285983368754387, 0.18986082077026367, -0.20830436050891876, 0.5340346097946167, -0.1340097039937973, 0.001352854073047638, -0.19088393449783325, 0.04971306771039963, -0.10665403306484222, -0.10763027518987656, 0.3707558512687683, -0.08239148557186127, 0.11125826090574265, -0.03065039962530136, 0.029711171984672546, -0.1269504427909851, 0.5807738304138184, 0.37020474672317505, -0.22765830159187317, -0.2903737425804138, -0.29171085357666016, -0.6512928605079651, 0.34886643290519714, -0.1494486778974533, 0.1185847669839859, 0.2773769795894623, 0.10515303164720535, -0.054008565843105316, -0.003333061933517456, -0.25373268127441406, 0.3306898772716522, -0.10873246192932129, 0.057387080043554306, -0.2382141649723053, -0.35852688550949097, 0.25329577922821045, -0.012602141126990318, -0.002044839784502983, -0.40286436676979065, 0.20321694016456604, 0.01300790999084711, -0.06494458019733429, -0.16466662287712097, 0.12157078087329865, 0.16878589987754822, -0.2281377613544464, 0.2321842610836029, 0.18217924237251282, 0.35991621017456055, 0.08440864086151123, -0.10740617662668228, -0.5960645079612732, -0.37141096591949463, -0.04809638112783432, 0.019034136086702347, -0.13050125539302826, 0.35365745425224304, 0.08108096569776535, -0.0613720677793026, -0.28941258788108826, 0.08101610839366913, -0.08908076584339142, 0.2710464298725128, -0.3573679029941559, -0.13287881016731262, -0.33072733879089355, 0.2468918412923813, 0.2877408266067505, 0.35579758882522583, -0.0018426142632961273, 0.3905982971191406, -0.07421255856752396, -0.3385460078716278, 0.5343868732452393, -0.37937358021736145, -0.3047368824481964, 0.12671133875846863, 0.14680209755897522, -0.2151361107826233, -0.22542637586593628, -0.28449684381484985, 0.12279964238405228, 0.34016942977905273, -0.11444618552923203, -0.15157493948936462, 0.2058027982711792, 0.1698247194290161, -0.08747890591621399, 0.0724724531173706, -0.04825928062200546, 0.1949249505996704, -0.18739239871501923, 0.13358430564403534, -0.15391972661018372 ]
https://github.com/huggingface/datasets/issues/5009
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
`gram_ann` and `val_ann` are annotations that only exist for part of the test set. I wanted to keep all the columns consistent across all files, so I added them to train and validation as well. I'll check if removing them from those files is still compliant with this repo. Otherwise, I will do as you suggested. Thanks @lhoestq !
## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
59
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly ## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 `gram_ann` and `val_ann` are annotations that only exist for part of the test set. I wanted to keep all the columns consistent across all files, so I added them to train and validation as well. I'll check if removing them from those files is still compliant with this repo. Otherwise, I will do as you suggested. Thanks @lhoestq !
[ -0.19701562821865082, 0.2147456705570221, 0.1286277174949646, 0.5178280472755432, 0.08397334814071655, 0.11888126283884048, 0.35095784068107605, 0.46086180210113525, 0.27356967329978943, 0.021775774657726288, -0.05008245259523392, 0.3347477614879608, -0.06883789598941803, -0.1606757491827011, 0.16613681614398956, -0.07134293019771576, -0.002238042652606964, 0.068179652094841, 0.28442156314849854, -0.3149515986442566, -0.21572916209697723, 0.1951570361852646, -0.08560508489608765, 0.18235453963279724, -0.5136275291442871, 0.2908664643764496, 0.06696397811174393, 0.6622047424316406, -0.008944563567638397, -0.26984015107154846, 0.456272155046463, -0.031321439892053604, 0.10714607685804367, 0.22887000441551208, -0.00011705971701303497, 0.14865674078464508, 0.5657786130905151, -0.058481886982917786, -0.14762942492961884, -0.43973588943481445, -0.15605680644512177, -0.08510439842939377, 0.2596462070941925, -0.11599650233983994, -0.03740054368972778, 0.18746060132980347, -0.13078756630420685, -0.11153917014598846, 0.18348461389541626, 0.172343909740448, 0.14590483903884888, 0.36417198181152344, -0.09025271236896515, -0.18379835784435272, 0.46016725897789, -0.021776795387268066, -0.18725670874118805, 0.5830785632133484, 0.42707741260528564, 0.020000601187348366, -0.07437913864850998, -0.004581637680530548, -0.04979734495282173, 0.2895178198814392, 0.18571612238883972, 0.02323346957564354, -0.11772600561380386, 0.319876492023468, 0.08932501822710037, 0.3359432816505432, 0.42460280656814575, -0.3093773126602173, -0.234124094247818, -0.25652265548706055, 0.05515793710947037, -0.016216782853007317, 0.3605438470840454, 0.15503118932247162, -0.01448700949549675, 0.2464950978755951, -0.1512671560049057, -0.21402515470981598, -0.0984705463051796, 0.20026758313179016, -0.04361036419868469, 0.1558614820241928, -0.0023554665967822075, 0.28337404131889343, -0.18832987546920776, 0.2060699313879013, 0.6413303017616272, -0.21716901659965515, -0.07802484929561615, 0.23984448611736298, -0.23552431166172028, 0.17296582460403442, 0.11733169853687286, 0.08802243322134018, 0.1464030146598816, 0.28124117851257324, 0.19925102591514587, 0.08470112085342407, -0.26748499274253845, 0.16310201585292816, 0.43075281381607056, 0.3105684518814087, -0.0944221094250679, 0.24172325432300568, 0.12600857019424438, 0.07823879271745682, -0.26603832840919495, 0.09031283855438232, -0.2536883056163788, -0.0043135955929756165, -0.05343949794769287, -0.14807263016700745, 0.24151097238063812, -0.30691981315612793, -0.3299899101257324, 0.03993817791342735, 0.04172813147306442, 0.023816315457224846, 0.28893208503723145, 0.3089176118373871, 0.04949469491839409, 0.2492062747478485, 0.008538279682397842, 0.21450453996658325, -0.42963019013404846, -0.04071016609668732, -0.3801487386226654, 0.0852317065000534, -0.09392672777175903, 0.016721457242965698, 0.3925604224205017, -0.20722196996212006, 0.23010586202144623, -0.09653033316135406, 0.01749725639820099, -0.2683083415031433, -0.1479666829109192, -0.046768106520175934, -0.2271479368209839, 0.10251347720623016, -0.0011388510465621948, 0.2749069929122925, 0.21091803908348083, -0.09476156532764435, -0.2303873598575592, 0.16277801990509033, -0.5746971964836121, -0.5359532833099365, -0.09801433980464935, 0.11177831143140793, -0.4134358763694763, -0.05355090647935867, -0.22293582558631897, -0.12172907590866089, -0.05648428946733475, -0.09146885573863983, -0.21742379665374756, -0.1340508759021759, 0.05319977179169655, -0.1414557844400406, 0.09549390524625778, 0.5670166611671448, -0.2274550199508667, -0.16266962885856628, 0.0074324519373476505, -0.018673665821552277, 0.09433499723672867, 0.33459359407424927, -0.5349122285842896, 0.4359896183013916, -0.19216907024383545, 0.1245189905166626, 0.3858533203601837, -0.5741565823554993, -0.45452678203582764, 0.15351282060146332, -0.2442898005247116, 0.04411961883306503, -0.24255988001823425, 0.08311142027378082, -0.08081134408712387, -0.017039291560649872, 0.38605645298957825, 0.3483806252479553, 0.22222307324409485, 0.05806061625480652, -0.30633270740509033, -0.31808698177337646, -0.1562667191028595, 0.4931279420852661, 0.1251504123210907, 0.16576488316059113, 0.23934608697891235, 0.4989723861217499, 0.19964411854743958, -0.02561776712536812, 0.07628058642148972, 0.205180823802948, 0.30421221256256104, -0.04750456660985947, 0.0035255588591098785, -0.11036995053291321, -0.37228330969810486, 0.44736185669898987, -0.14669504761695862, -0.12810461223125458, 0.09207446873188019, 0.1878521591424942, -0.3402768671512604, -0.035034291446208954, -0.5538846850395203, 0.06070950627326965, 0.028550885617733, 0.02032683789730072, 0.09743018448352814, -0.06468646228313446, -0.31894007325172424, 0.2732087969779968, -0.20937171578407288, 0.10529088973999023, -0.4227851927280426, 0.5764979124069214, 0.025490300729870796, -0.12467086315155029, 0.07284297049045563, 0.3011179268360138, 0.16023549437522888, -0.22351829707622528, -0.3328114151954651, 0.3756770193576813, 0.062291573733091354, 0.313528448343277, 0.01686735823750496, -0.12427110970020294, 0.07567904889583588, -0.04774840548634529, 0.40471965074539185, -0.026485610753297806, 0.10460072755813599, -0.1304578334093094, -0.1835048794746399, 0.2448483407497406, -0.1256927251815796, 0.10502180457115173, -0.11848173290491104, -0.1404641568660736, 0.22145965695381165, -0.17092907428741455, 0.17289559543132782, -0.11610622704029083, 0.34512859582901, 0.39496472477912903, 0.3352310061454773, -0.06196477264165878, -0.04925552010536194, -0.14124542474746704, 0.2527913451194763, -0.01723206415772438, 0.061140287667512894, 0.1366328001022339, -0.21710050106048584, -0.08008305728435516, -0.06099477410316467, 0.4289547801017761, 0.42490214109420776, 0.018296845257282257, -0.174462229013443, 0.24900385737419128, -0.0901227593421936, -0.15835699439048767, -0.02260487526655197, -0.0945587158203125, 0.22866640985012054, 0.4080880284309387, 0.029729502275586128, -0.04819939658045769, -0.42289480566978455, 0.04052339121699333, 0.20687495172023773, 0.32784783840179443, -0.4109727740287781, -0.023059027269482613, -0.25047168135643005, 0.4910900890827179, -0.35015979409217834, -0.37166792154312134, -0.18542322516441345, -0.39975506067276, -0.014579478651285172, 0.54119873046875, -0.0433967299759388, -0.22684185206890106, -0.10679534077644348, 0.18817423284053802, -0.05483122169971466, -0.30635198950767517, -0.04301480948925018, -0.27389150857925415, -0.3050994873046875, -0.06853784620761871, 0.30948442220687866, 0.34689733386039734, 0.07332723587751389, -0.4387647807598114, 0.1185830682516098, -0.07527811825275421, 0.048408955335617065, 0.19312019646167755, -0.015068728476762772, 0.3748866021633148, 0.04316943138837814, 0.15705999732017517, -0.014950843527913094, -0.2478795349597931, 0.36020395159721375, -0.3063112497329712, -0.0425509437918663, 0.2594083547592163, 0.01620488427579403, -0.14745375514030457, 0.02876313403248787, -0.3484431207180023, -0.30260899662971497, -0.2732788622379303, 0.10268473625183105, 0.016696374863386154, 0.042169228196144104, 0.2515583038330078, -0.05076845735311508, 0.12939687073230743, 0.04555045813322067, -0.2663952708244324, -0.36385640501976013, -0.65767902135849, 0.2792402505874634, -0.3718472123146057, -0.43669238686561584, -0.004410352557897568, 0.07626543194055557, 0.15471391379833221, -0.2062603384256363, -0.5261189937591553, -0.1717735379934311, -0.11505782604217529, -0.009988468140363693, -0.05330062657594681, -0.008193036541342735, 0.19568631052970886, -0.21059678494930267, 0.10146225988864899, -0.2207891047000885, -0.2358555942773819, 0.1315959095954895, 0.37768763303756714, 0.19302299618721008, 0.11540503054857254, 0.010035691782832146, -0.19215863943099976, 0.29746532440185547, 0.17917382717132568, 0.06619419157505035, 0.4907895624637604, 0.10853484272956848, 0.15505339205265045, -0.4114065170288086, -0.20209981501102448, 0.1520835906267166, -0.052531301975250244, -0.18543994426727295, 0.31425541639328003, 0.19528090953826904, -0.030888264998793602, -0.21794532239437103, -0.25970685482025146, -0.188947856426239, -0.2980727255344391, 0.07301932573318481, -0.036770112812519073, -0.10890030115842819, 0.18308031558990479, 0.1260860562324524, -0.2580634653568268, -0.20005354285240173, 0.0654594898223877, 0.2153385579586029, 0.08507014811038971, 0.1335149109363556, -0.3880454897880554, 0.13637055456638336, -0.3147239685058594, -0.006675347685813904, 0.007457990199327469, 0.46499401330947876, -0.021558716893196106, 0.10723166912794113, 0.21507342159748077, -0.09075571596622467, 0.40866243839263916, -0.1179942712187767, 0.33434122800827026, 0.16881625354290009, -0.13205234706401825, -0.589324414730072, -0.16433469951152802, -0.014595922082662582, 0.12914468348026276, -0.2715759575366974, 0.35465502738952637, -0.10960802435874939, -0.21530015766620636, 0.06275385618209839, 0.21182449162006378, -0.3659943640232086, -0.411203533411026, -0.1145152598619461, -0.22715073823928833, -0.43862125277519226, -0.314920574426651, -0.17281104624271393, 0.4311860501766205, -0.15103276073932648, -0.026461929082870483, 0.1973617672920227, 0.010848063975572586, -0.03127977252006531, 0.020853839814662933, 0.33532023429870605, 0.06245872750878334, 0.24964526295661926, 0.3859160542488098, 0.24668507277965546, 0.09362209588289261, 0.8297297358512878, 0.09053008258342743, -0.03659015893936157, 0.0182664692401886, -0.056973036378622055, -0.09519270807504654, 0.3731078803539276, 0.05587185546755791, -0.22279924154281616, -0.2321608066558838, -0.203006312251091, -0.26476314663887024, 0.07045827805995941, -0.047617703676223755, -0.15352649986743927, -0.13820187747478485, -0.29541242122650146, 0.745842695236206, -0.12150311470031738, -0.03792939335107803, 0.2378823310136795, 0.17754217982292175, -0.2442810982465744, 0.33682870864868164, -0.06746334582567215, 0.7275052070617676, -0.1296476125717163, 0.08208156377077103, 0.18494579195976257, -0.1389887034893036, 0.0571228563785553, -0.18973307311534882, -0.08631738275289536, -0.45234590768814087, 0.02663828432559967, 0.010600415989756584, -0.1912114918231964, -0.07580558210611343, 0.1763136088848114, 0.1925816684961319, 0.1807151585817337, -0.1706521362066269, 0.35948920249938965, 0.007710157427936792, 0.29934269189834595, -0.16448836028575897, -0.15620605647563934, -0.33395808935165405, 0.12198580801486969, -0.3084236979484558, 0.3172294795513153, -0.006357865873724222, -0.09382311254739761, -0.34397295117378235, -0.1346152424812317, -0.14901936054229736, 0.2670398950576782, 0.010019967332482338, 0.22526191174983978, 0.00787399336695671, -0.25347039103507996, 0.061544980853796005, -0.11672447621822357, 0.2907365560531616, -0.024738501757383347, -0.48471784591674805, 0.20331458747386932, -0.2533412575721741, -0.053124044090509415, -0.08387967199087143, 0.04198223352432251, 0.09079068154096603, -0.11623530089855194, -0.2936093807220459, -0.22534483671188354, -0.1320241093635559, -0.5381008982658386, -0.12279917299747467, 0.05468940734863281, 0.18077422678470612, -0.23348423838615417, -0.3793431520462036, 0.13879604637622833, 0.14752815663814545, -0.18550153076648712, 0.07469195127487183, 0.284479022026062, -0.1462664008140564, -0.03133571147918701, 0.1612139195203781, -0.27593719959259033, 0.06877652555704117, 0.5314810872077942, -0.015104200690984726, -0.1030048355460167, 0.4810539484024048, -0.04907890781760216, 0.13580256700515747, -0.061112578958272934, 0.2437121570110321, 0.6789808869361877, -0.5412433743476868, -0.055399391800165176, -0.29589128494262695, 0.0374419242143631, 0.13000857830047607, 0.35559991002082825, 0.19726169109344482, 0.054014042019844055, -0.058966971933841705, -0.48550644516944885, -0.19839242100715637, 0.24426642060279846, 0.013397255912423134, 0.2616472840309143, -0.0780034288764, 0.32993316650390625, -0.08748359233140945, 0.10379486531019211, -0.22026169300079346, 0.39067643880844116, -0.12353493273258209, 0.009700333699584007, -0.1733642965555191, -0.09233539551496506, 0.04447499290108681, -0.1052105575799942, 0.02650531195104122, -0.03913543373346329, -0.1847960650920868, -0.14265689253807068, -0.21187864243984222, 0.1832381933927536, 0.21305051445960999, -0.14759162068367004, -0.2793014943599701, -0.2858615517616272, 0.11521342396736145, -0.12745963037014008, 0.22058185935020447, 0.3554264307022095, -0.0367903858423233, 0.16165660321712494, 0.4478929042816162, 0.10388708114624023, -0.19051998853683472, 0.31567880511283875, 0.0064077228307724, 0.3063197433948517, -0.1715167611837387, 0.03792129084467888, 0.021641403436660767, 0.14073215425014496, -0.15181763470172882, 0.01262761652469635, 0.14787505567073822, 0.3636651635169983, 0.24251878261566162, -0.34817588329315186, 0.2341497540473938, 0.17834989726543427, 0.09790850430727005, 0.37694084644317627, -0.306972861289978, -0.07908239215612411, 0.09169360995292664, 0.12365489453077316, -0.15326832234859467, -0.3720608949661255, 0.2818470001220703, -0.045755043625831604, -0.19323700666427612, 0.07485808432102203, 0.4668865501880646, -0.22767546772956848, -0.4115045666694641, 0.04648400843143463, 0.7463684678077698, 0.11938205361366272, 0.12365953624248505, 0.4023260474205017, -0.22615930438041687, 0.018658261746168137, -0.08524885028600693, -0.03859685733914375, 0.02424941211938858, 0.7614558339118958, -0.09942758828401566, 0.31017905473709106, 0.008118974044919014, 0.24056532979011536, 0.1750899851322174, -0.3058958053588867, 0.02293030358850956, 0.05217587202787399, 0.03423575311899185, 0.09595011919736862, -0.16246791183948517, 0.1485905945301056, -0.32087084650993347, 0.01961883157491684, -0.3484989106655121, 0.12255674600601196, -0.1177418902516365, -0.2071269452571869, -0.25256794691085815, -0.301385760307312, -0.08712288737297058, 0.058529723435640335, -0.2395496368408203, -0.14305444061756134, 0.05892575904726982, 0.030798520892858505, -0.29535335302352905, -0.1507348269224167, 0.08520399034023285, 0.20092502236366272, -0.05329500883817673, -0.3021675944328308, 0.2914520502090454, 0.1629714071750641, -0.15443482995033264, 0.3131539821624756, 0.11015897244215012, 0.3145901560783386, 0.34282469749450684, -0.09955906867980957, 0.08877474069595337, 0.07118387520313263, -0.028794866055250168, -0.002706233412027359, 0.19171130657196045, -0.09520938992500305, -0.10282301902770996, 0.4018346965312958, 0.12415620684623718, -0.03519948571920395, 0.061752792447805405, -0.04285983368754387, 0.18986082077026367, -0.20830436050891876, 0.5340346097946167, -0.1340097039937973, 0.001352854073047638, -0.19088393449783325, 0.04971306771039963, -0.10665403306484222, -0.10763027518987656, 0.3707558512687683, -0.08239148557186127, 0.11125826090574265, -0.03065039962530136, 0.029711171984672546, -0.1269504427909851, 0.5807738304138184, 0.37020474672317505, -0.22765830159187317, -0.2903737425804138, -0.29171085357666016, -0.6512928605079651, 0.34886643290519714, -0.1494486778974533, 0.1185847669839859, 0.2773769795894623, 0.10515303164720535, -0.054008565843105316, -0.003333061933517456, -0.25373268127441406, 0.3306898772716522, -0.10873246192932129, 0.057387080043554306, -0.2382141649723053, -0.35852688550949097, 0.25329577922821045, -0.012602141126990318, -0.002044839784502983, -0.40286436676979065, 0.20321694016456604, 0.01300790999084711, -0.06494458019733429, -0.16466662287712097, 0.12157078087329865, 0.16878589987754822, -0.2281377613544464, 0.2321842610836029, 0.18217924237251282, 0.35991621017456055, 0.08440864086151123, -0.10740617662668228, -0.5960645079612732, -0.37141096591949463, -0.04809638112783432, 0.019034136086702347, -0.13050125539302826, 0.35365745425224304, 0.08108096569776535, -0.0613720677793026, -0.28941258788108826, 0.08101610839366913, -0.08908076584339142, 0.2710464298725128, -0.3573679029941559, -0.13287881016731262, -0.33072733879089355, 0.2468918412923813, 0.2877408266067505, 0.35579758882522583, -0.0018426142632961273, 0.3905982971191406, -0.07421255856752396, -0.3385460078716278, 0.5343868732452393, -0.37937358021736145, -0.3047368824481964, 0.12671133875846863, 0.14680209755897522, -0.2151361107826233, -0.22542637586593628, -0.28449684381484985, 0.12279964238405228, 0.34016942977905273, -0.11444618552923203, -0.15157493948936462, 0.2058027982711792, 0.1698247194290161, -0.08747890591621399, 0.0724724531173706, -0.04825928062200546, 0.1949249505996704, -0.18739239871501923, 0.13358430564403534, -0.15391972661018372 ]
https://github.com/huggingface/datasets/issues/5009
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
@lhoestq I followed the exact steps you described but it seems like I'm getting the same error unfortunately. Any other ideas? Thanks in advance
## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
24
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly ## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 @lhoestq I followed the exact steps you described but it seems like I'm getting the same error unfortunately. Any other ideas? Thanks in advance
[ -0.19701562821865082, 0.2147456705570221, 0.1286277174949646, 0.5178280472755432, 0.08397334814071655, 0.11888126283884048, 0.35095784068107605, 0.46086180210113525, 0.27356967329978943, 0.021775774657726288, -0.05008245259523392, 0.3347477614879608, -0.06883789598941803, -0.1606757491827011, 0.16613681614398956, -0.07134293019771576, -0.002238042652606964, 0.068179652094841, 0.28442156314849854, -0.3149515986442566, -0.21572916209697723, 0.1951570361852646, -0.08560508489608765, 0.18235453963279724, -0.5136275291442871, 0.2908664643764496, 0.06696397811174393, 0.6622047424316406, -0.008944563567638397, -0.26984015107154846, 0.456272155046463, -0.031321439892053604, 0.10714607685804367, 0.22887000441551208, -0.00011705971701303497, 0.14865674078464508, 0.5657786130905151, -0.058481886982917786, -0.14762942492961884, -0.43973588943481445, -0.15605680644512177, -0.08510439842939377, 0.2596462070941925, -0.11599650233983994, -0.03740054368972778, 0.18746060132980347, -0.13078756630420685, -0.11153917014598846, 0.18348461389541626, 0.172343909740448, 0.14590483903884888, 0.36417198181152344, -0.09025271236896515, -0.18379835784435272, 0.46016725897789, -0.021776795387268066, -0.18725670874118805, 0.5830785632133484, 0.42707741260528564, 0.020000601187348366, -0.07437913864850998, -0.004581637680530548, -0.04979734495282173, 0.2895178198814392, 0.18571612238883972, 0.02323346957564354, -0.11772600561380386, 0.319876492023468, 0.08932501822710037, 0.3359432816505432, 0.42460280656814575, -0.3093773126602173, -0.234124094247818, -0.25652265548706055, 0.05515793710947037, -0.016216782853007317, 0.3605438470840454, 0.15503118932247162, -0.01448700949549675, 0.2464950978755951, -0.1512671560049057, -0.21402515470981598, -0.0984705463051796, 0.20026758313179016, -0.04361036419868469, 0.1558614820241928, -0.0023554665967822075, 0.28337404131889343, -0.18832987546920776, 0.2060699313879013, 0.6413303017616272, -0.21716901659965515, -0.07802484929561615, 0.23984448611736298, -0.23552431166172028, 0.17296582460403442, 0.11733169853687286, 0.08802243322134018, 0.1464030146598816, 0.28124117851257324, 0.19925102591514587, 0.08470112085342407, -0.26748499274253845, 0.16310201585292816, 0.43075281381607056, 0.3105684518814087, -0.0944221094250679, 0.24172325432300568, 0.12600857019424438, 0.07823879271745682, -0.26603832840919495, 0.09031283855438232, -0.2536883056163788, -0.0043135955929756165, -0.05343949794769287, -0.14807263016700745, 0.24151097238063812, -0.30691981315612793, -0.3299899101257324, 0.03993817791342735, 0.04172813147306442, 0.023816315457224846, 0.28893208503723145, 0.3089176118373871, 0.04949469491839409, 0.2492062747478485, 0.008538279682397842, 0.21450453996658325, -0.42963019013404846, -0.04071016609668732, -0.3801487386226654, 0.0852317065000534, -0.09392672777175903, 0.016721457242965698, 0.3925604224205017, -0.20722196996212006, 0.23010586202144623, -0.09653033316135406, 0.01749725639820099, -0.2683083415031433, -0.1479666829109192, -0.046768106520175934, -0.2271479368209839, 0.10251347720623016, -0.0011388510465621948, 0.2749069929122925, 0.21091803908348083, -0.09476156532764435, -0.2303873598575592, 0.16277801990509033, -0.5746971964836121, -0.5359532833099365, -0.09801433980464935, 0.11177831143140793, -0.4134358763694763, -0.05355090647935867, -0.22293582558631897, -0.12172907590866089, -0.05648428946733475, -0.09146885573863983, -0.21742379665374756, -0.1340508759021759, 0.05319977179169655, -0.1414557844400406, 0.09549390524625778, 0.5670166611671448, -0.2274550199508667, -0.16266962885856628, 0.0074324519373476505, -0.018673665821552277, 0.09433499723672867, 0.33459359407424927, -0.5349122285842896, 0.4359896183013916, -0.19216907024383545, 0.1245189905166626, 0.3858533203601837, -0.5741565823554993, -0.45452678203582764, 0.15351282060146332, -0.2442898005247116, 0.04411961883306503, -0.24255988001823425, 0.08311142027378082, -0.08081134408712387, -0.017039291560649872, 0.38605645298957825, 0.3483806252479553, 0.22222307324409485, 0.05806061625480652, -0.30633270740509033, -0.31808698177337646, -0.1562667191028595, 0.4931279420852661, 0.1251504123210907, 0.16576488316059113, 0.23934608697891235, 0.4989723861217499, 0.19964411854743958, -0.02561776712536812, 0.07628058642148972, 0.205180823802948, 0.30421221256256104, -0.04750456660985947, 0.0035255588591098785, -0.11036995053291321, -0.37228330969810486, 0.44736185669898987, -0.14669504761695862, -0.12810461223125458, 0.09207446873188019, 0.1878521591424942, -0.3402768671512604, -0.035034291446208954, -0.5538846850395203, 0.06070950627326965, 0.028550885617733, 0.02032683789730072, 0.09743018448352814, -0.06468646228313446, -0.31894007325172424, 0.2732087969779968, -0.20937171578407288, 0.10529088973999023, -0.4227851927280426, 0.5764979124069214, 0.025490300729870796, -0.12467086315155029, 0.07284297049045563, 0.3011179268360138, 0.16023549437522888, -0.22351829707622528, -0.3328114151954651, 0.3756770193576813, 0.062291573733091354, 0.313528448343277, 0.01686735823750496, -0.12427110970020294, 0.07567904889583588, -0.04774840548634529, 0.40471965074539185, -0.026485610753297806, 0.10460072755813599, -0.1304578334093094, -0.1835048794746399, 0.2448483407497406, -0.1256927251815796, 0.10502180457115173, -0.11848173290491104, -0.1404641568660736, 0.22145965695381165, -0.17092907428741455, 0.17289559543132782, -0.11610622704029083, 0.34512859582901, 0.39496472477912903, 0.3352310061454773, -0.06196477264165878, -0.04925552010536194, -0.14124542474746704, 0.2527913451194763, -0.01723206415772438, 0.061140287667512894, 0.1366328001022339, -0.21710050106048584, -0.08008305728435516, -0.06099477410316467, 0.4289547801017761, 0.42490214109420776, 0.018296845257282257, -0.174462229013443, 0.24900385737419128, -0.0901227593421936, -0.15835699439048767, -0.02260487526655197, -0.0945587158203125, 0.22866640985012054, 0.4080880284309387, 0.029729502275586128, -0.04819939658045769, -0.42289480566978455, 0.04052339121699333, 0.20687495172023773, 0.32784783840179443, -0.4109727740287781, -0.023059027269482613, -0.25047168135643005, 0.4910900890827179, -0.35015979409217834, -0.37166792154312134, -0.18542322516441345, -0.39975506067276, -0.014579478651285172, 0.54119873046875, -0.0433967299759388, -0.22684185206890106, -0.10679534077644348, 0.18817423284053802, -0.05483122169971466, -0.30635198950767517, -0.04301480948925018, -0.27389150857925415, -0.3050994873046875, -0.06853784620761871, 0.30948442220687866, 0.34689733386039734, 0.07332723587751389, -0.4387647807598114, 0.1185830682516098, -0.07527811825275421, 0.048408955335617065, 0.19312019646167755, -0.015068728476762772, 0.3748866021633148, 0.04316943138837814, 0.15705999732017517, -0.014950843527913094, -0.2478795349597931, 0.36020395159721375, -0.3063112497329712, -0.0425509437918663, 0.2594083547592163, 0.01620488427579403, -0.14745375514030457, 0.02876313403248787, -0.3484431207180023, -0.30260899662971497, -0.2732788622379303, 0.10268473625183105, 0.016696374863386154, 0.042169228196144104, 0.2515583038330078, -0.05076845735311508, 0.12939687073230743, 0.04555045813322067, -0.2663952708244324, -0.36385640501976013, -0.65767902135849, 0.2792402505874634, -0.3718472123146057, -0.43669238686561584, -0.004410352557897568, 0.07626543194055557, 0.15471391379833221, -0.2062603384256363, -0.5261189937591553, -0.1717735379934311, -0.11505782604217529, -0.009988468140363693, -0.05330062657594681, -0.008193036541342735, 0.19568631052970886, -0.21059678494930267, 0.10146225988864899, -0.2207891047000885, -0.2358555942773819, 0.1315959095954895, 0.37768763303756714, 0.19302299618721008, 0.11540503054857254, 0.010035691782832146, -0.19215863943099976, 0.29746532440185547, 0.17917382717132568, 0.06619419157505035, 0.4907895624637604, 0.10853484272956848, 0.15505339205265045, -0.4114065170288086, -0.20209981501102448, 0.1520835906267166, -0.052531301975250244, -0.18543994426727295, 0.31425541639328003, 0.19528090953826904, -0.030888264998793602, -0.21794532239437103, -0.25970685482025146, -0.188947856426239, -0.2980727255344391, 0.07301932573318481, -0.036770112812519073, -0.10890030115842819, 0.18308031558990479, 0.1260860562324524, -0.2580634653568268, -0.20005354285240173, 0.0654594898223877, 0.2153385579586029, 0.08507014811038971, 0.1335149109363556, -0.3880454897880554, 0.13637055456638336, -0.3147239685058594, -0.006675347685813904, 0.007457990199327469, 0.46499401330947876, -0.021558716893196106, 0.10723166912794113, 0.21507342159748077, -0.09075571596622467, 0.40866243839263916, -0.1179942712187767, 0.33434122800827026, 0.16881625354290009, -0.13205234706401825, -0.589324414730072, -0.16433469951152802, -0.014595922082662582, 0.12914468348026276, -0.2715759575366974, 0.35465502738952637, -0.10960802435874939, -0.21530015766620636, 0.06275385618209839, 0.21182449162006378, -0.3659943640232086, -0.411203533411026, -0.1145152598619461, -0.22715073823928833, -0.43862125277519226, -0.314920574426651, -0.17281104624271393, 0.4311860501766205, -0.15103276073932648, -0.026461929082870483, 0.1973617672920227, 0.010848063975572586, -0.03127977252006531, 0.020853839814662933, 0.33532023429870605, 0.06245872750878334, 0.24964526295661926, 0.3859160542488098, 0.24668507277965546, 0.09362209588289261, 0.8297297358512878, 0.09053008258342743, -0.03659015893936157, 0.0182664692401886, -0.056973036378622055, -0.09519270807504654, 0.3731078803539276, 0.05587185546755791, -0.22279924154281616, -0.2321608066558838, -0.203006312251091, -0.26476314663887024, 0.07045827805995941, -0.047617703676223755, -0.15352649986743927, -0.13820187747478485, -0.29541242122650146, 0.745842695236206, -0.12150311470031738, -0.03792939335107803, 0.2378823310136795, 0.17754217982292175, -0.2442810982465744, 0.33682870864868164, -0.06746334582567215, 0.7275052070617676, -0.1296476125717163, 0.08208156377077103, 0.18494579195976257, -0.1389887034893036, 0.0571228563785553, -0.18973307311534882, -0.08631738275289536, -0.45234590768814087, 0.02663828432559967, 0.010600415989756584, -0.1912114918231964, -0.07580558210611343, 0.1763136088848114, 0.1925816684961319, 0.1807151585817337, -0.1706521362066269, 0.35948920249938965, 0.007710157427936792, 0.29934269189834595, -0.16448836028575897, -0.15620605647563934, -0.33395808935165405, 0.12198580801486969, -0.3084236979484558, 0.3172294795513153, -0.006357865873724222, -0.09382311254739761, -0.34397295117378235, -0.1346152424812317, -0.14901936054229736, 0.2670398950576782, 0.010019967332482338, 0.22526191174983978, 0.00787399336695671, -0.25347039103507996, 0.061544980853796005, -0.11672447621822357, 0.2907365560531616, -0.024738501757383347, -0.48471784591674805, 0.20331458747386932, -0.2533412575721741, -0.053124044090509415, -0.08387967199087143, 0.04198223352432251, 0.09079068154096603, -0.11623530089855194, -0.2936093807220459, -0.22534483671188354, -0.1320241093635559, -0.5381008982658386, -0.12279917299747467, 0.05468940734863281, 0.18077422678470612, -0.23348423838615417, -0.3793431520462036, 0.13879604637622833, 0.14752815663814545, -0.18550153076648712, 0.07469195127487183, 0.284479022026062, -0.1462664008140564, -0.03133571147918701, 0.1612139195203781, -0.27593719959259033, 0.06877652555704117, 0.5314810872077942, -0.015104200690984726, -0.1030048355460167, 0.4810539484024048, -0.04907890781760216, 0.13580256700515747, -0.061112578958272934, 0.2437121570110321, 0.6789808869361877, -0.5412433743476868, -0.055399391800165176, -0.29589128494262695, 0.0374419242143631, 0.13000857830047607, 0.35559991002082825, 0.19726169109344482, 0.054014042019844055, -0.058966971933841705, -0.48550644516944885, -0.19839242100715637, 0.24426642060279846, 0.013397255912423134, 0.2616472840309143, -0.0780034288764, 0.32993316650390625, -0.08748359233140945, 0.10379486531019211, -0.22026169300079346, 0.39067643880844116, -0.12353493273258209, 0.009700333699584007, -0.1733642965555191, -0.09233539551496506, 0.04447499290108681, -0.1052105575799942, 0.02650531195104122, -0.03913543373346329, -0.1847960650920868, -0.14265689253807068, -0.21187864243984222, 0.1832381933927536, 0.21305051445960999, -0.14759162068367004, -0.2793014943599701, -0.2858615517616272, 0.11521342396736145, -0.12745963037014008, 0.22058185935020447, 0.3554264307022095, -0.0367903858423233, 0.16165660321712494, 0.4478929042816162, 0.10388708114624023, -0.19051998853683472, 0.31567880511283875, 0.0064077228307724, 0.3063197433948517, -0.1715167611837387, 0.03792129084467888, 0.021641403436660767, 0.14073215425014496, -0.15181763470172882, 0.01262761652469635, 0.14787505567073822, 0.3636651635169983, 0.24251878261566162, -0.34817588329315186, 0.2341497540473938, 0.17834989726543427, 0.09790850430727005, 0.37694084644317627, -0.306972861289978, -0.07908239215612411, 0.09169360995292664, 0.12365489453077316, -0.15326832234859467, -0.3720608949661255, 0.2818470001220703, -0.045755043625831604, -0.19323700666427612, 0.07485808432102203, 0.4668865501880646, -0.22767546772956848, -0.4115045666694641, 0.04648400843143463, 0.7463684678077698, 0.11938205361366272, 0.12365953624248505, 0.4023260474205017, -0.22615930438041687, 0.018658261746168137, -0.08524885028600693, -0.03859685733914375, 0.02424941211938858, 0.7614558339118958, -0.09942758828401566, 0.31017905473709106, 0.008118974044919014, 0.24056532979011536, 0.1750899851322174, -0.3058958053588867, 0.02293030358850956, 0.05217587202787399, 0.03423575311899185, 0.09595011919736862, -0.16246791183948517, 0.1485905945301056, -0.32087084650993347, 0.01961883157491684, -0.3484989106655121, 0.12255674600601196, -0.1177418902516365, -0.2071269452571869, -0.25256794691085815, -0.301385760307312, -0.08712288737297058, 0.058529723435640335, -0.2395496368408203, -0.14305444061756134, 0.05892575904726982, 0.030798520892858505, -0.29535335302352905, -0.1507348269224167, 0.08520399034023285, 0.20092502236366272, -0.05329500883817673, -0.3021675944328308, 0.2914520502090454, 0.1629714071750641, -0.15443482995033264, 0.3131539821624756, 0.11015897244215012, 0.3145901560783386, 0.34282469749450684, -0.09955906867980957, 0.08877474069595337, 0.07118387520313263, -0.028794866055250168, -0.002706233412027359, 0.19171130657196045, -0.09520938992500305, -0.10282301902770996, 0.4018346965312958, 0.12415620684623718, -0.03519948571920395, 0.061752792447805405, -0.04285983368754387, 0.18986082077026367, -0.20830436050891876, 0.5340346097946167, -0.1340097039937973, 0.001352854073047638, -0.19088393449783325, 0.04971306771039963, -0.10665403306484222, -0.10763027518987656, 0.3707558512687683, -0.08239148557186127, 0.11125826090574265, -0.03065039962530136, 0.029711171984672546, -0.1269504427909851, 0.5807738304138184, 0.37020474672317505, -0.22765830159187317, -0.2903737425804138, -0.29171085357666016, -0.6512928605079651, 0.34886643290519714, -0.1494486778974533, 0.1185847669839859, 0.2773769795894623, 0.10515303164720535, -0.054008565843105316, -0.003333061933517456, -0.25373268127441406, 0.3306898772716522, -0.10873246192932129, 0.057387080043554306, -0.2382141649723053, -0.35852688550949097, 0.25329577922821045, -0.012602141126990318, -0.002044839784502983, -0.40286436676979065, 0.20321694016456604, 0.01300790999084711, -0.06494458019733429, -0.16466662287712097, 0.12157078087329865, 0.16878589987754822, -0.2281377613544464, 0.2321842610836029, 0.18217924237251282, 0.35991621017456055, 0.08440864086151123, -0.10740617662668228, -0.5960645079612732, -0.37141096591949463, -0.04809638112783432, 0.019034136086702347, -0.13050125539302826, 0.35365745425224304, 0.08108096569776535, -0.0613720677793026, -0.28941258788108826, 0.08101610839366913, -0.08908076584339142, 0.2710464298725128, -0.3573679029941559, -0.13287881016731262, -0.33072733879089355, 0.2468918412923813, 0.2877408266067505, 0.35579758882522583, -0.0018426142632961273, 0.3905982971191406, -0.07421255856752396, -0.3385460078716278, 0.5343868732452393, -0.37937358021736145, -0.3047368824481964, 0.12671133875846863, 0.14680209755897522, -0.2151361107826233, -0.22542637586593628, -0.28449684381484985, 0.12279964238405228, 0.34016942977905273, -0.11444618552923203, -0.15157493948936462, 0.2058027982711792, 0.1698247194290161, -0.08747890591621399, 0.0724724531173706, -0.04825928062200546, 0.1949249505996704, -0.18739239871501923, 0.13358430564403534, -0.15391972661018372 ]
https://github.com/huggingface/datasets/issues/5009
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
Hi ! If you move `dataset_infos.json` from `data/` to the root of your dataset repository if should work :)
## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
19
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly ## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 Hi ! If you move `dataset_infos.json` from `data/` to the root of your dataset repository if should work :)
[ -0.19701562821865082, 0.2147456705570221, 0.1286277174949646, 0.5178280472755432, 0.08397334814071655, 0.11888126283884048, 0.35095784068107605, 0.46086180210113525, 0.27356967329978943, 0.021775774657726288, -0.05008245259523392, 0.3347477614879608, -0.06883789598941803, -0.1606757491827011, 0.16613681614398956, -0.07134293019771576, -0.002238042652606964, 0.068179652094841, 0.28442156314849854, -0.3149515986442566, -0.21572916209697723, 0.1951570361852646, -0.08560508489608765, 0.18235453963279724, -0.5136275291442871, 0.2908664643764496, 0.06696397811174393, 0.6622047424316406, -0.008944563567638397, -0.26984015107154846, 0.456272155046463, -0.031321439892053604, 0.10714607685804367, 0.22887000441551208, -0.00011705971701303497, 0.14865674078464508, 0.5657786130905151, -0.058481886982917786, -0.14762942492961884, -0.43973588943481445, -0.15605680644512177, -0.08510439842939377, 0.2596462070941925, -0.11599650233983994, -0.03740054368972778, 0.18746060132980347, -0.13078756630420685, -0.11153917014598846, 0.18348461389541626, 0.172343909740448, 0.14590483903884888, 0.36417198181152344, -0.09025271236896515, -0.18379835784435272, 0.46016725897789, -0.021776795387268066, -0.18725670874118805, 0.5830785632133484, 0.42707741260528564, 0.020000601187348366, -0.07437913864850998, -0.004581637680530548, -0.04979734495282173, 0.2895178198814392, 0.18571612238883972, 0.02323346957564354, -0.11772600561380386, 0.319876492023468, 0.08932501822710037, 0.3359432816505432, 0.42460280656814575, -0.3093773126602173, -0.234124094247818, -0.25652265548706055, 0.05515793710947037, -0.016216782853007317, 0.3605438470840454, 0.15503118932247162, -0.01448700949549675, 0.2464950978755951, -0.1512671560049057, -0.21402515470981598, -0.0984705463051796, 0.20026758313179016, -0.04361036419868469, 0.1558614820241928, -0.0023554665967822075, 0.28337404131889343, -0.18832987546920776, 0.2060699313879013, 0.6413303017616272, -0.21716901659965515, -0.07802484929561615, 0.23984448611736298, -0.23552431166172028, 0.17296582460403442, 0.11733169853687286, 0.08802243322134018, 0.1464030146598816, 0.28124117851257324, 0.19925102591514587, 0.08470112085342407, -0.26748499274253845, 0.16310201585292816, 0.43075281381607056, 0.3105684518814087, -0.0944221094250679, 0.24172325432300568, 0.12600857019424438, 0.07823879271745682, -0.26603832840919495, 0.09031283855438232, -0.2536883056163788, -0.0043135955929756165, -0.05343949794769287, -0.14807263016700745, 0.24151097238063812, -0.30691981315612793, -0.3299899101257324, 0.03993817791342735, 0.04172813147306442, 0.023816315457224846, 0.28893208503723145, 0.3089176118373871, 0.04949469491839409, 0.2492062747478485, 0.008538279682397842, 0.21450453996658325, -0.42963019013404846, -0.04071016609668732, -0.3801487386226654, 0.0852317065000534, -0.09392672777175903, 0.016721457242965698, 0.3925604224205017, -0.20722196996212006, 0.23010586202144623, -0.09653033316135406, 0.01749725639820099, -0.2683083415031433, -0.1479666829109192, -0.046768106520175934, -0.2271479368209839, 0.10251347720623016, -0.0011388510465621948, 0.2749069929122925, 0.21091803908348083, -0.09476156532764435, -0.2303873598575592, 0.16277801990509033, -0.5746971964836121, -0.5359532833099365, -0.09801433980464935, 0.11177831143140793, -0.4134358763694763, -0.05355090647935867, -0.22293582558631897, -0.12172907590866089, -0.05648428946733475, -0.09146885573863983, -0.21742379665374756, -0.1340508759021759, 0.05319977179169655, -0.1414557844400406, 0.09549390524625778, 0.5670166611671448, -0.2274550199508667, -0.16266962885856628, 0.0074324519373476505, -0.018673665821552277, 0.09433499723672867, 0.33459359407424927, -0.5349122285842896, 0.4359896183013916, -0.19216907024383545, 0.1245189905166626, 0.3858533203601837, -0.5741565823554993, -0.45452678203582764, 0.15351282060146332, -0.2442898005247116, 0.04411961883306503, -0.24255988001823425, 0.08311142027378082, -0.08081134408712387, -0.017039291560649872, 0.38605645298957825, 0.3483806252479553, 0.22222307324409485, 0.05806061625480652, -0.30633270740509033, -0.31808698177337646, -0.1562667191028595, 0.4931279420852661, 0.1251504123210907, 0.16576488316059113, 0.23934608697891235, 0.4989723861217499, 0.19964411854743958, -0.02561776712536812, 0.07628058642148972, 0.205180823802948, 0.30421221256256104, -0.04750456660985947, 0.0035255588591098785, -0.11036995053291321, -0.37228330969810486, 0.44736185669898987, -0.14669504761695862, -0.12810461223125458, 0.09207446873188019, 0.1878521591424942, -0.3402768671512604, -0.035034291446208954, -0.5538846850395203, 0.06070950627326965, 0.028550885617733, 0.02032683789730072, 0.09743018448352814, -0.06468646228313446, -0.31894007325172424, 0.2732087969779968, -0.20937171578407288, 0.10529088973999023, -0.4227851927280426, 0.5764979124069214, 0.025490300729870796, -0.12467086315155029, 0.07284297049045563, 0.3011179268360138, 0.16023549437522888, -0.22351829707622528, -0.3328114151954651, 0.3756770193576813, 0.062291573733091354, 0.313528448343277, 0.01686735823750496, -0.12427110970020294, 0.07567904889583588, -0.04774840548634529, 0.40471965074539185, -0.026485610753297806, 0.10460072755813599, -0.1304578334093094, -0.1835048794746399, 0.2448483407497406, -0.1256927251815796, 0.10502180457115173, -0.11848173290491104, -0.1404641568660736, 0.22145965695381165, -0.17092907428741455, 0.17289559543132782, -0.11610622704029083, 0.34512859582901, 0.39496472477912903, 0.3352310061454773, -0.06196477264165878, -0.04925552010536194, -0.14124542474746704, 0.2527913451194763, -0.01723206415772438, 0.061140287667512894, 0.1366328001022339, -0.21710050106048584, -0.08008305728435516, -0.06099477410316467, 0.4289547801017761, 0.42490214109420776, 0.018296845257282257, -0.174462229013443, 0.24900385737419128, -0.0901227593421936, -0.15835699439048767, -0.02260487526655197, -0.0945587158203125, 0.22866640985012054, 0.4080880284309387, 0.029729502275586128, -0.04819939658045769, -0.42289480566978455, 0.04052339121699333, 0.20687495172023773, 0.32784783840179443, -0.4109727740287781, -0.023059027269482613, -0.25047168135643005, 0.4910900890827179, -0.35015979409217834, -0.37166792154312134, -0.18542322516441345, -0.39975506067276, -0.014579478651285172, 0.54119873046875, -0.0433967299759388, -0.22684185206890106, -0.10679534077644348, 0.18817423284053802, -0.05483122169971466, -0.30635198950767517, -0.04301480948925018, -0.27389150857925415, -0.3050994873046875, -0.06853784620761871, 0.30948442220687866, 0.34689733386039734, 0.07332723587751389, -0.4387647807598114, 0.1185830682516098, -0.07527811825275421, 0.048408955335617065, 0.19312019646167755, -0.015068728476762772, 0.3748866021633148, 0.04316943138837814, 0.15705999732017517, -0.014950843527913094, -0.2478795349597931, 0.36020395159721375, -0.3063112497329712, -0.0425509437918663, 0.2594083547592163, 0.01620488427579403, -0.14745375514030457, 0.02876313403248787, -0.3484431207180023, -0.30260899662971497, -0.2732788622379303, 0.10268473625183105, 0.016696374863386154, 0.042169228196144104, 0.2515583038330078, -0.05076845735311508, 0.12939687073230743, 0.04555045813322067, -0.2663952708244324, -0.36385640501976013, -0.65767902135849, 0.2792402505874634, -0.3718472123146057, -0.43669238686561584, -0.004410352557897568, 0.07626543194055557, 0.15471391379833221, -0.2062603384256363, -0.5261189937591553, -0.1717735379934311, -0.11505782604217529, -0.009988468140363693, -0.05330062657594681, -0.008193036541342735, 0.19568631052970886, -0.21059678494930267, 0.10146225988864899, -0.2207891047000885, -0.2358555942773819, 0.1315959095954895, 0.37768763303756714, 0.19302299618721008, 0.11540503054857254, 0.010035691782832146, -0.19215863943099976, 0.29746532440185547, 0.17917382717132568, 0.06619419157505035, 0.4907895624637604, 0.10853484272956848, 0.15505339205265045, -0.4114065170288086, -0.20209981501102448, 0.1520835906267166, -0.052531301975250244, -0.18543994426727295, 0.31425541639328003, 0.19528090953826904, -0.030888264998793602, -0.21794532239437103, -0.25970685482025146, -0.188947856426239, -0.2980727255344391, 0.07301932573318481, -0.036770112812519073, -0.10890030115842819, 0.18308031558990479, 0.1260860562324524, -0.2580634653568268, -0.20005354285240173, 0.0654594898223877, 0.2153385579586029, 0.08507014811038971, 0.1335149109363556, -0.3880454897880554, 0.13637055456638336, -0.3147239685058594, -0.006675347685813904, 0.007457990199327469, 0.46499401330947876, -0.021558716893196106, 0.10723166912794113, 0.21507342159748077, -0.09075571596622467, 0.40866243839263916, -0.1179942712187767, 0.33434122800827026, 0.16881625354290009, -0.13205234706401825, -0.589324414730072, -0.16433469951152802, -0.014595922082662582, 0.12914468348026276, -0.2715759575366974, 0.35465502738952637, -0.10960802435874939, -0.21530015766620636, 0.06275385618209839, 0.21182449162006378, -0.3659943640232086, -0.411203533411026, -0.1145152598619461, -0.22715073823928833, -0.43862125277519226, -0.314920574426651, -0.17281104624271393, 0.4311860501766205, -0.15103276073932648, -0.026461929082870483, 0.1973617672920227, 0.010848063975572586, -0.03127977252006531, 0.020853839814662933, 0.33532023429870605, 0.06245872750878334, 0.24964526295661926, 0.3859160542488098, 0.24668507277965546, 0.09362209588289261, 0.8297297358512878, 0.09053008258342743, -0.03659015893936157, 0.0182664692401886, -0.056973036378622055, -0.09519270807504654, 0.3731078803539276, 0.05587185546755791, -0.22279924154281616, -0.2321608066558838, -0.203006312251091, -0.26476314663887024, 0.07045827805995941, -0.047617703676223755, -0.15352649986743927, -0.13820187747478485, -0.29541242122650146, 0.745842695236206, -0.12150311470031738, -0.03792939335107803, 0.2378823310136795, 0.17754217982292175, -0.2442810982465744, 0.33682870864868164, -0.06746334582567215, 0.7275052070617676, -0.1296476125717163, 0.08208156377077103, 0.18494579195976257, -0.1389887034893036, 0.0571228563785553, -0.18973307311534882, -0.08631738275289536, -0.45234590768814087, 0.02663828432559967, 0.010600415989756584, -0.1912114918231964, -0.07580558210611343, 0.1763136088848114, 0.1925816684961319, 0.1807151585817337, -0.1706521362066269, 0.35948920249938965, 0.007710157427936792, 0.29934269189834595, -0.16448836028575897, -0.15620605647563934, -0.33395808935165405, 0.12198580801486969, -0.3084236979484558, 0.3172294795513153, -0.006357865873724222, -0.09382311254739761, -0.34397295117378235, -0.1346152424812317, -0.14901936054229736, 0.2670398950576782, 0.010019967332482338, 0.22526191174983978, 0.00787399336695671, -0.25347039103507996, 0.061544980853796005, -0.11672447621822357, 0.2907365560531616, -0.024738501757383347, -0.48471784591674805, 0.20331458747386932, -0.2533412575721741, -0.053124044090509415, -0.08387967199087143, 0.04198223352432251, 0.09079068154096603, -0.11623530089855194, -0.2936093807220459, -0.22534483671188354, -0.1320241093635559, -0.5381008982658386, -0.12279917299747467, 0.05468940734863281, 0.18077422678470612, -0.23348423838615417, -0.3793431520462036, 0.13879604637622833, 0.14752815663814545, -0.18550153076648712, 0.07469195127487183, 0.284479022026062, -0.1462664008140564, -0.03133571147918701, 0.1612139195203781, -0.27593719959259033, 0.06877652555704117, 0.5314810872077942, -0.015104200690984726, -0.1030048355460167, 0.4810539484024048, -0.04907890781760216, 0.13580256700515747, -0.061112578958272934, 0.2437121570110321, 0.6789808869361877, -0.5412433743476868, -0.055399391800165176, -0.29589128494262695, 0.0374419242143631, 0.13000857830047607, 0.35559991002082825, 0.19726169109344482, 0.054014042019844055, -0.058966971933841705, -0.48550644516944885, -0.19839242100715637, 0.24426642060279846, 0.013397255912423134, 0.2616472840309143, -0.0780034288764, 0.32993316650390625, -0.08748359233140945, 0.10379486531019211, -0.22026169300079346, 0.39067643880844116, -0.12353493273258209, 0.009700333699584007, -0.1733642965555191, -0.09233539551496506, 0.04447499290108681, -0.1052105575799942, 0.02650531195104122, -0.03913543373346329, -0.1847960650920868, -0.14265689253807068, -0.21187864243984222, 0.1832381933927536, 0.21305051445960999, -0.14759162068367004, -0.2793014943599701, -0.2858615517616272, 0.11521342396736145, -0.12745963037014008, 0.22058185935020447, 0.3554264307022095, -0.0367903858423233, 0.16165660321712494, 0.4478929042816162, 0.10388708114624023, -0.19051998853683472, 0.31567880511283875, 0.0064077228307724, 0.3063197433948517, -0.1715167611837387, 0.03792129084467888, 0.021641403436660767, 0.14073215425014496, -0.15181763470172882, 0.01262761652469635, 0.14787505567073822, 0.3636651635169983, 0.24251878261566162, -0.34817588329315186, 0.2341497540473938, 0.17834989726543427, 0.09790850430727005, 0.37694084644317627, -0.306972861289978, -0.07908239215612411, 0.09169360995292664, 0.12365489453077316, -0.15326832234859467, -0.3720608949661255, 0.2818470001220703, -0.045755043625831604, -0.19323700666427612, 0.07485808432102203, 0.4668865501880646, -0.22767546772956848, -0.4115045666694641, 0.04648400843143463, 0.7463684678077698, 0.11938205361366272, 0.12365953624248505, 0.4023260474205017, -0.22615930438041687, 0.018658261746168137, -0.08524885028600693, -0.03859685733914375, 0.02424941211938858, 0.7614558339118958, -0.09942758828401566, 0.31017905473709106, 0.008118974044919014, 0.24056532979011536, 0.1750899851322174, -0.3058958053588867, 0.02293030358850956, 0.05217587202787399, 0.03423575311899185, 0.09595011919736862, -0.16246791183948517, 0.1485905945301056, -0.32087084650993347, 0.01961883157491684, -0.3484989106655121, 0.12255674600601196, -0.1177418902516365, -0.2071269452571869, -0.25256794691085815, -0.301385760307312, -0.08712288737297058, 0.058529723435640335, -0.2395496368408203, -0.14305444061756134, 0.05892575904726982, 0.030798520892858505, -0.29535335302352905, -0.1507348269224167, 0.08520399034023285, 0.20092502236366272, -0.05329500883817673, -0.3021675944328308, 0.2914520502090454, 0.1629714071750641, -0.15443482995033264, 0.3131539821624756, 0.11015897244215012, 0.3145901560783386, 0.34282469749450684, -0.09955906867980957, 0.08877474069595337, 0.07118387520313263, -0.028794866055250168, -0.002706233412027359, 0.19171130657196045, -0.09520938992500305, -0.10282301902770996, 0.4018346965312958, 0.12415620684623718, -0.03519948571920395, 0.061752792447805405, -0.04285983368754387, 0.18986082077026367, -0.20830436050891876, 0.5340346097946167, -0.1340097039937973, 0.001352854073047638, -0.19088393449783325, 0.04971306771039963, -0.10665403306484222, -0.10763027518987656, 0.3707558512687683, -0.08239148557186127, 0.11125826090574265, -0.03065039962530136, 0.029711171984672546, -0.1269504427909851, 0.5807738304138184, 0.37020474672317505, -0.22765830159187317, -0.2903737425804138, -0.29171085357666016, -0.6512928605079651, 0.34886643290519714, -0.1494486778974533, 0.1185847669839859, 0.2773769795894623, 0.10515303164720535, -0.054008565843105316, -0.003333061933517456, -0.25373268127441406, 0.3306898772716522, -0.10873246192932129, 0.057387080043554306, -0.2382141649723053, -0.35852688550949097, 0.25329577922821045, -0.012602141126990318, -0.002044839784502983, -0.40286436676979065, 0.20321694016456604, 0.01300790999084711, -0.06494458019733429, -0.16466662287712097, 0.12157078087329865, 0.16878589987754822, -0.2281377613544464, 0.2321842610836029, 0.18217924237251282, 0.35991621017456055, 0.08440864086151123, -0.10740617662668228, -0.5960645079612732, -0.37141096591949463, -0.04809638112783432, 0.019034136086702347, -0.13050125539302826, 0.35365745425224304, 0.08108096569776535, -0.0613720677793026, -0.28941258788108826, 0.08101610839366913, -0.08908076584339142, 0.2710464298725128, -0.3573679029941559, -0.13287881016731262, -0.33072733879089355, 0.2468918412923813, 0.2877408266067505, 0.35579758882522583, -0.0018426142632961273, 0.3905982971191406, -0.07421255856752396, -0.3385460078716278, 0.5343868732452393, -0.37937358021736145, -0.3047368824481964, 0.12671133875846863, 0.14680209755897522, -0.2151361107826233, -0.22542637586593628, -0.28449684381484985, 0.12279964238405228, 0.34016942977905273, -0.11444618552923203, -0.15157493948936462, 0.2058027982711792, 0.1698247194290161, -0.08747890591621399, 0.0724724531173706, -0.04825928062200546, 0.1949249505996704, -0.18739239871501923, 0.13358430564403534, -0.15391972661018372 ]
https://github.com/huggingface/datasets/issues/5009
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
I tried that and pushed to the [hub](https://huggingface.co/datasets/StonyBrookNLP/tellmewhy/tree/main). Now, there is a new error. ``` File "/home/yklal95/tellmewhy/src/prepare_data.py", line 67, in main dataset = load_dataset('StonyBrookNLP/tellmewhy') File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 775, in _download_and_prepare verify_checksums( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/utils/info_utils.py", line 33, in verify_checksums raise ExpectedMoreDownloadedFiles(str(set(expected_checksums) - set(recorded_checksums))) datasets.utils.info_utils.ExpectedMoreDownloadedFiles: {'/home/yklal95/tellmewhy/data/test.json', '/home/yklal95/tellmewhy/data/validation.json', '/home/yklal95/tellmewhy/data/train.json'} ``` No changes were made to any of the other files and they are still on the hub. Let me know if you have any ideas @lhoestq Thanks!
## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
87
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly ## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 I tried that and pushed to the [hub](https://huggingface.co/datasets/StonyBrookNLP/tellmewhy/tree/main). Now, there is a new error. ``` File "/home/yklal95/tellmewhy/src/prepare_data.py", line 67, in main dataset = load_dataset('StonyBrookNLP/tellmewhy') File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 775, in _download_and_prepare verify_checksums( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/utils/info_utils.py", line 33, in verify_checksums raise ExpectedMoreDownloadedFiles(str(set(expected_checksums) - set(recorded_checksums))) datasets.utils.info_utils.ExpectedMoreDownloadedFiles: {'/home/yklal95/tellmewhy/data/test.json', '/home/yklal95/tellmewhy/data/validation.json', '/home/yklal95/tellmewhy/data/train.json'} ``` No changes were made to any of the other files and they are still on the hub. Let me know if you have any ideas @lhoestq Thanks!
[ -0.19701562821865082, 0.2147456705570221, 0.1286277174949646, 0.5178280472755432, 0.08397334814071655, 0.11888126283884048, 0.35095784068107605, 0.46086180210113525, 0.27356967329978943, 0.021775774657726288, -0.05008245259523392, 0.3347477614879608, -0.06883789598941803, -0.1606757491827011, 0.16613681614398956, -0.07134293019771576, -0.002238042652606964, 0.068179652094841, 0.28442156314849854, -0.3149515986442566, -0.21572916209697723, 0.1951570361852646, -0.08560508489608765, 0.18235453963279724, -0.5136275291442871, 0.2908664643764496, 0.06696397811174393, 0.6622047424316406, -0.008944563567638397, -0.26984015107154846, 0.456272155046463, -0.031321439892053604, 0.10714607685804367, 0.22887000441551208, -0.00011705971701303497, 0.14865674078464508, 0.5657786130905151, -0.058481886982917786, -0.14762942492961884, -0.43973588943481445, -0.15605680644512177, -0.08510439842939377, 0.2596462070941925, -0.11599650233983994, -0.03740054368972778, 0.18746060132980347, -0.13078756630420685, -0.11153917014598846, 0.18348461389541626, 0.172343909740448, 0.14590483903884888, 0.36417198181152344, -0.09025271236896515, -0.18379835784435272, 0.46016725897789, -0.021776795387268066, -0.18725670874118805, 0.5830785632133484, 0.42707741260528564, 0.020000601187348366, -0.07437913864850998, -0.004581637680530548, -0.04979734495282173, 0.2895178198814392, 0.18571612238883972, 0.02323346957564354, -0.11772600561380386, 0.319876492023468, 0.08932501822710037, 0.3359432816505432, 0.42460280656814575, -0.3093773126602173, -0.234124094247818, -0.25652265548706055, 0.05515793710947037, -0.016216782853007317, 0.3605438470840454, 0.15503118932247162, -0.01448700949549675, 0.2464950978755951, -0.1512671560049057, -0.21402515470981598, -0.0984705463051796, 0.20026758313179016, -0.04361036419868469, 0.1558614820241928, -0.0023554665967822075, 0.28337404131889343, -0.18832987546920776, 0.2060699313879013, 0.6413303017616272, -0.21716901659965515, -0.07802484929561615, 0.23984448611736298, -0.23552431166172028, 0.17296582460403442, 0.11733169853687286, 0.08802243322134018, 0.1464030146598816, 0.28124117851257324, 0.19925102591514587, 0.08470112085342407, -0.26748499274253845, 0.16310201585292816, 0.43075281381607056, 0.3105684518814087, -0.0944221094250679, 0.24172325432300568, 0.12600857019424438, 0.07823879271745682, -0.26603832840919495, 0.09031283855438232, -0.2536883056163788, -0.0043135955929756165, -0.05343949794769287, -0.14807263016700745, 0.24151097238063812, -0.30691981315612793, -0.3299899101257324, 0.03993817791342735, 0.04172813147306442, 0.023816315457224846, 0.28893208503723145, 0.3089176118373871, 0.04949469491839409, 0.2492062747478485, 0.008538279682397842, 0.21450453996658325, -0.42963019013404846, -0.04071016609668732, -0.3801487386226654, 0.0852317065000534, -0.09392672777175903, 0.016721457242965698, 0.3925604224205017, -0.20722196996212006, 0.23010586202144623, -0.09653033316135406, 0.01749725639820099, -0.2683083415031433, -0.1479666829109192, -0.046768106520175934, -0.2271479368209839, 0.10251347720623016, -0.0011388510465621948, 0.2749069929122925, 0.21091803908348083, -0.09476156532764435, -0.2303873598575592, 0.16277801990509033, -0.5746971964836121, -0.5359532833099365, -0.09801433980464935, 0.11177831143140793, -0.4134358763694763, -0.05355090647935867, -0.22293582558631897, -0.12172907590866089, -0.05648428946733475, -0.09146885573863983, -0.21742379665374756, -0.1340508759021759, 0.05319977179169655, -0.1414557844400406, 0.09549390524625778, 0.5670166611671448, -0.2274550199508667, -0.16266962885856628, 0.0074324519373476505, -0.018673665821552277, 0.09433499723672867, 0.33459359407424927, -0.5349122285842896, 0.4359896183013916, -0.19216907024383545, 0.1245189905166626, 0.3858533203601837, -0.5741565823554993, -0.45452678203582764, 0.15351282060146332, -0.2442898005247116, 0.04411961883306503, -0.24255988001823425, 0.08311142027378082, -0.08081134408712387, -0.017039291560649872, 0.38605645298957825, 0.3483806252479553, 0.22222307324409485, 0.05806061625480652, -0.30633270740509033, -0.31808698177337646, -0.1562667191028595, 0.4931279420852661, 0.1251504123210907, 0.16576488316059113, 0.23934608697891235, 0.4989723861217499, 0.19964411854743958, -0.02561776712536812, 0.07628058642148972, 0.205180823802948, 0.30421221256256104, -0.04750456660985947, 0.0035255588591098785, -0.11036995053291321, -0.37228330969810486, 0.44736185669898987, -0.14669504761695862, -0.12810461223125458, 0.09207446873188019, 0.1878521591424942, -0.3402768671512604, -0.035034291446208954, -0.5538846850395203, 0.06070950627326965, 0.028550885617733, 0.02032683789730072, 0.09743018448352814, -0.06468646228313446, -0.31894007325172424, 0.2732087969779968, -0.20937171578407288, 0.10529088973999023, -0.4227851927280426, 0.5764979124069214, 0.025490300729870796, -0.12467086315155029, 0.07284297049045563, 0.3011179268360138, 0.16023549437522888, -0.22351829707622528, -0.3328114151954651, 0.3756770193576813, 0.062291573733091354, 0.313528448343277, 0.01686735823750496, -0.12427110970020294, 0.07567904889583588, -0.04774840548634529, 0.40471965074539185, -0.026485610753297806, 0.10460072755813599, -0.1304578334093094, -0.1835048794746399, 0.2448483407497406, -0.1256927251815796, 0.10502180457115173, -0.11848173290491104, -0.1404641568660736, 0.22145965695381165, -0.17092907428741455, 0.17289559543132782, -0.11610622704029083, 0.34512859582901, 0.39496472477912903, 0.3352310061454773, -0.06196477264165878, -0.04925552010536194, -0.14124542474746704, 0.2527913451194763, -0.01723206415772438, 0.061140287667512894, 0.1366328001022339, -0.21710050106048584, -0.08008305728435516, -0.06099477410316467, 0.4289547801017761, 0.42490214109420776, 0.018296845257282257, -0.174462229013443, 0.24900385737419128, -0.0901227593421936, -0.15835699439048767, -0.02260487526655197, -0.0945587158203125, 0.22866640985012054, 0.4080880284309387, 0.029729502275586128, -0.04819939658045769, -0.42289480566978455, 0.04052339121699333, 0.20687495172023773, 0.32784783840179443, -0.4109727740287781, -0.023059027269482613, -0.25047168135643005, 0.4910900890827179, -0.35015979409217834, -0.37166792154312134, -0.18542322516441345, -0.39975506067276, -0.014579478651285172, 0.54119873046875, -0.0433967299759388, -0.22684185206890106, -0.10679534077644348, 0.18817423284053802, -0.05483122169971466, -0.30635198950767517, -0.04301480948925018, -0.27389150857925415, -0.3050994873046875, -0.06853784620761871, 0.30948442220687866, 0.34689733386039734, 0.07332723587751389, -0.4387647807598114, 0.1185830682516098, -0.07527811825275421, 0.048408955335617065, 0.19312019646167755, -0.015068728476762772, 0.3748866021633148, 0.04316943138837814, 0.15705999732017517, -0.014950843527913094, -0.2478795349597931, 0.36020395159721375, -0.3063112497329712, -0.0425509437918663, 0.2594083547592163, 0.01620488427579403, -0.14745375514030457, 0.02876313403248787, -0.3484431207180023, -0.30260899662971497, -0.2732788622379303, 0.10268473625183105, 0.016696374863386154, 0.042169228196144104, 0.2515583038330078, -0.05076845735311508, 0.12939687073230743, 0.04555045813322067, -0.2663952708244324, -0.36385640501976013, -0.65767902135849, 0.2792402505874634, -0.3718472123146057, -0.43669238686561584, -0.004410352557897568, 0.07626543194055557, 0.15471391379833221, -0.2062603384256363, -0.5261189937591553, -0.1717735379934311, -0.11505782604217529, -0.009988468140363693, -0.05330062657594681, -0.008193036541342735, 0.19568631052970886, -0.21059678494930267, 0.10146225988864899, -0.2207891047000885, -0.2358555942773819, 0.1315959095954895, 0.37768763303756714, 0.19302299618721008, 0.11540503054857254, 0.010035691782832146, -0.19215863943099976, 0.29746532440185547, 0.17917382717132568, 0.06619419157505035, 0.4907895624637604, 0.10853484272956848, 0.15505339205265045, -0.4114065170288086, -0.20209981501102448, 0.1520835906267166, -0.052531301975250244, -0.18543994426727295, 0.31425541639328003, 0.19528090953826904, -0.030888264998793602, -0.21794532239437103, -0.25970685482025146, -0.188947856426239, -0.2980727255344391, 0.07301932573318481, -0.036770112812519073, -0.10890030115842819, 0.18308031558990479, 0.1260860562324524, -0.2580634653568268, -0.20005354285240173, 0.0654594898223877, 0.2153385579586029, 0.08507014811038971, 0.1335149109363556, -0.3880454897880554, 0.13637055456638336, -0.3147239685058594, -0.006675347685813904, 0.007457990199327469, 0.46499401330947876, -0.021558716893196106, 0.10723166912794113, 0.21507342159748077, -0.09075571596622467, 0.40866243839263916, -0.1179942712187767, 0.33434122800827026, 0.16881625354290009, -0.13205234706401825, -0.589324414730072, -0.16433469951152802, -0.014595922082662582, 0.12914468348026276, -0.2715759575366974, 0.35465502738952637, -0.10960802435874939, -0.21530015766620636, 0.06275385618209839, 0.21182449162006378, -0.3659943640232086, -0.411203533411026, -0.1145152598619461, -0.22715073823928833, -0.43862125277519226, -0.314920574426651, -0.17281104624271393, 0.4311860501766205, -0.15103276073932648, -0.026461929082870483, 0.1973617672920227, 0.010848063975572586, -0.03127977252006531, 0.020853839814662933, 0.33532023429870605, 0.06245872750878334, 0.24964526295661926, 0.3859160542488098, 0.24668507277965546, 0.09362209588289261, 0.8297297358512878, 0.09053008258342743, -0.03659015893936157, 0.0182664692401886, -0.056973036378622055, -0.09519270807504654, 0.3731078803539276, 0.05587185546755791, -0.22279924154281616, -0.2321608066558838, -0.203006312251091, -0.26476314663887024, 0.07045827805995941, -0.047617703676223755, -0.15352649986743927, -0.13820187747478485, -0.29541242122650146, 0.745842695236206, -0.12150311470031738, -0.03792939335107803, 0.2378823310136795, 0.17754217982292175, -0.2442810982465744, 0.33682870864868164, -0.06746334582567215, 0.7275052070617676, -0.1296476125717163, 0.08208156377077103, 0.18494579195976257, -0.1389887034893036, 0.0571228563785553, -0.18973307311534882, -0.08631738275289536, -0.45234590768814087, 0.02663828432559967, 0.010600415989756584, -0.1912114918231964, -0.07580558210611343, 0.1763136088848114, 0.1925816684961319, 0.1807151585817337, -0.1706521362066269, 0.35948920249938965, 0.007710157427936792, 0.29934269189834595, -0.16448836028575897, -0.15620605647563934, -0.33395808935165405, 0.12198580801486969, -0.3084236979484558, 0.3172294795513153, -0.006357865873724222, -0.09382311254739761, -0.34397295117378235, -0.1346152424812317, -0.14901936054229736, 0.2670398950576782, 0.010019967332482338, 0.22526191174983978, 0.00787399336695671, -0.25347039103507996, 0.061544980853796005, -0.11672447621822357, 0.2907365560531616, -0.024738501757383347, -0.48471784591674805, 0.20331458747386932, -0.2533412575721741, -0.053124044090509415, -0.08387967199087143, 0.04198223352432251, 0.09079068154096603, -0.11623530089855194, -0.2936093807220459, -0.22534483671188354, -0.1320241093635559, -0.5381008982658386, -0.12279917299747467, 0.05468940734863281, 0.18077422678470612, -0.23348423838615417, -0.3793431520462036, 0.13879604637622833, 0.14752815663814545, -0.18550153076648712, 0.07469195127487183, 0.284479022026062, -0.1462664008140564, -0.03133571147918701, 0.1612139195203781, -0.27593719959259033, 0.06877652555704117, 0.5314810872077942, -0.015104200690984726, -0.1030048355460167, 0.4810539484024048, -0.04907890781760216, 0.13580256700515747, -0.061112578958272934, 0.2437121570110321, 0.6789808869361877, -0.5412433743476868, -0.055399391800165176, -0.29589128494262695, 0.0374419242143631, 0.13000857830047607, 0.35559991002082825, 0.19726169109344482, 0.054014042019844055, -0.058966971933841705, -0.48550644516944885, -0.19839242100715637, 0.24426642060279846, 0.013397255912423134, 0.2616472840309143, -0.0780034288764, 0.32993316650390625, -0.08748359233140945, 0.10379486531019211, -0.22026169300079346, 0.39067643880844116, -0.12353493273258209, 0.009700333699584007, -0.1733642965555191, -0.09233539551496506, 0.04447499290108681, -0.1052105575799942, 0.02650531195104122, -0.03913543373346329, -0.1847960650920868, -0.14265689253807068, -0.21187864243984222, 0.1832381933927536, 0.21305051445960999, -0.14759162068367004, -0.2793014943599701, -0.2858615517616272, 0.11521342396736145, -0.12745963037014008, 0.22058185935020447, 0.3554264307022095, -0.0367903858423233, 0.16165660321712494, 0.4478929042816162, 0.10388708114624023, -0.19051998853683472, 0.31567880511283875, 0.0064077228307724, 0.3063197433948517, -0.1715167611837387, 0.03792129084467888, 0.021641403436660767, 0.14073215425014496, -0.15181763470172882, 0.01262761652469635, 0.14787505567073822, 0.3636651635169983, 0.24251878261566162, -0.34817588329315186, 0.2341497540473938, 0.17834989726543427, 0.09790850430727005, 0.37694084644317627, -0.306972861289978, -0.07908239215612411, 0.09169360995292664, 0.12365489453077316, -0.15326832234859467, -0.3720608949661255, 0.2818470001220703, -0.045755043625831604, -0.19323700666427612, 0.07485808432102203, 0.4668865501880646, -0.22767546772956848, -0.4115045666694641, 0.04648400843143463, 0.7463684678077698, 0.11938205361366272, 0.12365953624248505, 0.4023260474205017, -0.22615930438041687, 0.018658261746168137, -0.08524885028600693, -0.03859685733914375, 0.02424941211938858, 0.7614558339118958, -0.09942758828401566, 0.31017905473709106, 0.008118974044919014, 0.24056532979011536, 0.1750899851322174, -0.3058958053588867, 0.02293030358850956, 0.05217587202787399, 0.03423575311899185, 0.09595011919736862, -0.16246791183948517, 0.1485905945301056, -0.32087084650993347, 0.01961883157491684, -0.3484989106655121, 0.12255674600601196, -0.1177418902516365, -0.2071269452571869, -0.25256794691085815, -0.301385760307312, -0.08712288737297058, 0.058529723435640335, -0.2395496368408203, -0.14305444061756134, 0.05892575904726982, 0.030798520892858505, -0.29535335302352905, -0.1507348269224167, 0.08520399034023285, 0.20092502236366272, -0.05329500883817673, -0.3021675944328308, 0.2914520502090454, 0.1629714071750641, -0.15443482995033264, 0.3131539821624756, 0.11015897244215012, 0.3145901560783386, 0.34282469749450684, -0.09955906867980957, 0.08877474069595337, 0.07118387520313263, -0.028794866055250168, -0.002706233412027359, 0.19171130657196045, -0.09520938992500305, -0.10282301902770996, 0.4018346965312958, 0.12415620684623718, -0.03519948571920395, 0.061752792447805405, -0.04285983368754387, 0.18986082077026367, -0.20830436050891876, 0.5340346097946167, -0.1340097039937973, 0.001352854073047638, -0.19088393449783325, 0.04971306771039963, -0.10665403306484222, -0.10763027518987656, 0.3707558512687683, -0.08239148557186127, 0.11125826090574265, -0.03065039962530136, 0.029711171984672546, -0.1269504427909851, 0.5807738304138184, 0.37020474672317505, -0.22765830159187317, -0.2903737425804138, -0.29171085357666016, -0.6512928605079651, 0.34886643290519714, -0.1494486778974533, 0.1185847669839859, 0.2773769795894623, 0.10515303164720535, -0.054008565843105316, -0.003333061933517456, -0.25373268127441406, 0.3306898772716522, -0.10873246192932129, 0.057387080043554306, -0.2382141649723053, -0.35852688550949097, 0.25329577922821045, -0.012602141126990318, -0.002044839784502983, -0.40286436676979065, 0.20321694016456604, 0.01300790999084711, -0.06494458019733429, -0.16466662287712097, 0.12157078087329865, 0.16878589987754822, -0.2281377613544464, 0.2321842610836029, 0.18217924237251282, 0.35991621017456055, 0.08440864086151123, -0.10740617662668228, -0.5960645079612732, -0.37141096591949463, -0.04809638112783432, 0.019034136086702347, -0.13050125539302826, 0.35365745425224304, 0.08108096569776535, -0.0613720677793026, -0.28941258788108826, 0.08101610839366913, -0.08908076584339142, 0.2710464298725128, -0.3573679029941559, -0.13287881016731262, -0.33072733879089355, 0.2468918412923813, 0.2877408266067505, 0.35579758882522583, -0.0018426142632961273, 0.3905982971191406, -0.07421255856752396, -0.3385460078716278, 0.5343868732452393, -0.37937358021736145, -0.3047368824481964, 0.12671133875846863, 0.14680209755897522, -0.2151361107826233, -0.22542637586593628, -0.28449684381484985, 0.12279964238405228, 0.34016942977905273, -0.11444618552923203, -0.15157493948936462, 0.2058027982711792, 0.1698247194290161, -0.08747890591621399, 0.0724724531173706, -0.04825928062200546, 0.1949249505996704, -0.18739239871501923, 0.13358430564403534, -0.15391972661018372 ]
https://github.com/huggingface/datasets/issues/5009
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly
Oh I see - the code I gave you returns local paths instead of URLs to store metadata about files to download. I opened a PR in your repo here to remove this: https://huggingface.co/datasets/StonyBrookNLP/tellmewhy/discussions/1 sorry for the inconvenience !
## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0
39
Error loading StonyBrookNLP/tellmewhy dataset from hub even though local copy loads correctly ## Describe the bug I have added a new dataset with the identifier `StonyBrookNLP/tellmewhy` to the hub. When I load the individual files using my local copy using `dataset = datasets.load_dataset("json", data_files="data/train.jsonl")`, it loads the dataset correctly. However, when I try to load it from the hub, I get an error (pasted below). Additionally, `dataset = datasets.load_dataset("json", data_dir="data/")` throws the same error. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('StonyBrookNLP/tellmewhy') ``` ## Expected results Successfully load the `StonyBrookNLP/tellmewhy` dataset. ## Actual results ``` Using custom data configuration StonyBrookNLP--tellmewhy-82712924092694ff Downloading and preparing dataset json/StonyBrookNLP--tellmewhy to /home/yklal95/.cache/huggingface/datasets/StonyBrookNLP___json/StonyBrookNLP--tellmewhy-82712924092694ff/0.0.0/a3e658c4731e59120d44081ac10bf85dc7e1388126b92338344ce9661907f253... Downloading data files: 100%|██████████████████████████████| 3/3 [00:00<00:00, 957.46it/s] Extracting data files: 100%|███████████████████████████████| 3/3 [00:00<00:00, 299.14it/s] Traceback (most recent call last): File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 17, in <module> main(args) File "/home/yklal95/tmw-generalization/src/load_datasets.py", line 11, in main dataset = datasets.load_dataset(args.dataset_name) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/load.py", line 1746, in load_dataset builder_instance.download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 793, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/builder.py", line 1277, in _prepare_split writer.write_table(table) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/arrow_writer.py", line 524, in write_table pa_table = table_cast(pa_table, self._schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 2005, in table_cast return cast_table_to_schema(table, schema) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1969, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1681, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1822, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1853, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1683, in wrapper return func(array, *args, **kwargs) File "/home/yklal95/anaconda3/envs/tmw-generalization/lib/python3.9/site-packages/datasets/table.py", line 1761, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type int64 to null ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.4.0 - Platform: Linux-4.15.0-121-generic-x86_64-with-glibc2.27 - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.5.0 Oh I see - the code I gave you returns local paths instead of URLs to store metadata about files to download. I opened a PR in your repo here to remove this: https://huggingface.co/datasets/StonyBrookNLP/tellmewhy/discussions/1 sorry for the inconvenience !
[ -0.19701562821865082, 0.2147456705570221, 0.1286277174949646, 0.5178280472755432, 0.08397334814071655, 0.11888126283884048, 0.35095784068107605, 0.46086180210113525, 0.27356967329978943, 0.021775774657726288, -0.05008245259523392, 0.3347477614879608, -0.06883789598941803, -0.1606757491827011, 0.16613681614398956, -0.07134293019771576, -0.002238042652606964, 0.068179652094841, 0.28442156314849854, -0.3149515986442566, -0.21572916209697723, 0.1951570361852646, -0.08560508489608765, 0.18235453963279724, -0.5136275291442871, 0.2908664643764496, 0.06696397811174393, 0.6622047424316406, -0.008944563567638397, -0.26984015107154846, 0.456272155046463, -0.031321439892053604, 0.10714607685804367, 0.22887000441551208, -0.00011705971701303497, 0.14865674078464508, 0.5657786130905151, -0.058481886982917786, -0.14762942492961884, -0.43973588943481445, -0.15605680644512177, -0.08510439842939377, 0.2596462070941925, -0.11599650233983994, -0.03740054368972778, 0.18746060132980347, -0.13078756630420685, -0.11153917014598846, 0.18348461389541626, 0.172343909740448, 0.14590483903884888, 0.36417198181152344, -0.09025271236896515, -0.18379835784435272, 0.46016725897789, -0.021776795387268066, -0.18725670874118805, 0.5830785632133484, 0.42707741260528564, 0.020000601187348366, -0.07437913864850998, -0.004581637680530548, -0.04979734495282173, 0.2895178198814392, 0.18571612238883972, 0.02323346957564354, -0.11772600561380386, 0.319876492023468, 0.08932501822710037, 0.3359432816505432, 0.42460280656814575, -0.3093773126602173, -0.234124094247818, -0.25652265548706055, 0.05515793710947037, -0.016216782853007317, 0.3605438470840454, 0.15503118932247162, -0.01448700949549675, 0.2464950978755951, -0.1512671560049057, -0.21402515470981598, -0.0984705463051796, 0.20026758313179016, -0.04361036419868469, 0.1558614820241928, -0.0023554665967822075, 0.28337404131889343, -0.18832987546920776, 0.2060699313879013, 0.6413303017616272, -0.21716901659965515, -0.07802484929561615, 0.23984448611736298, -0.23552431166172028, 0.17296582460403442, 0.11733169853687286, 0.08802243322134018, 0.1464030146598816, 0.28124117851257324, 0.19925102591514587, 0.08470112085342407, -0.26748499274253845, 0.16310201585292816, 0.43075281381607056, 0.3105684518814087, -0.0944221094250679, 0.24172325432300568, 0.12600857019424438, 0.07823879271745682, -0.26603832840919495, 0.09031283855438232, -0.2536883056163788, -0.0043135955929756165, -0.05343949794769287, -0.14807263016700745, 0.24151097238063812, -0.30691981315612793, -0.3299899101257324, 0.03993817791342735, 0.04172813147306442, 0.023816315457224846, 0.28893208503723145, 0.3089176118373871, 0.04949469491839409, 0.2492062747478485, 0.008538279682397842, 0.21450453996658325, -0.42963019013404846, -0.04071016609668732, -0.3801487386226654, 0.0852317065000534, -0.09392672777175903, 0.016721457242965698, 0.3925604224205017, -0.20722196996212006, 0.23010586202144623, -0.09653033316135406, 0.01749725639820099, -0.2683083415031433, -0.1479666829109192, -0.046768106520175934, -0.2271479368209839, 0.10251347720623016, -0.0011388510465621948, 0.2749069929122925, 0.21091803908348083, -0.09476156532764435, -0.2303873598575592, 0.16277801990509033, -0.5746971964836121, -0.5359532833099365, -0.09801433980464935, 0.11177831143140793, -0.4134358763694763, -0.05355090647935867, -0.22293582558631897, -0.12172907590866089, -0.05648428946733475, -0.09146885573863983, -0.21742379665374756, -0.1340508759021759, 0.05319977179169655, -0.1414557844400406, 0.09549390524625778, 0.5670166611671448, -0.2274550199508667, -0.16266962885856628, 0.0074324519373476505, -0.018673665821552277, 0.09433499723672867, 0.33459359407424927, -0.5349122285842896, 0.4359896183013916, -0.19216907024383545, 0.1245189905166626, 0.3858533203601837, -0.5741565823554993, -0.45452678203582764, 0.15351282060146332, -0.2442898005247116, 0.04411961883306503, -0.24255988001823425, 0.08311142027378082, -0.08081134408712387, -0.017039291560649872, 0.38605645298957825, 0.3483806252479553, 0.22222307324409485, 0.05806061625480652, -0.30633270740509033, -0.31808698177337646, -0.1562667191028595, 0.4931279420852661, 0.1251504123210907, 0.16576488316059113, 0.23934608697891235, 0.4989723861217499, 0.19964411854743958, -0.02561776712536812, 0.07628058642148972, 0.205180823802948, 0.30421221256256104, -0.04750456660985947, 0.0035255588591098785, -0.11036995053291321, -0.37228330969810486, 0.44736185669898987, -0.14669504761695862, -0.12810461223125458, 0.09207446873188019, 0.1878521591424942, -0.3402768671512604, -0.035034291446208954, -0.5538846850395203, 0.06070950627326965, 0.028550885617733, 0.02032683789730072, 0.09743018448352814, -0.06468646228313446, -0.31894007325172424, 0.2732087969779968, -0.20937171578407288, 0.10529088973999023, -0.4227851927280426, 0.5764979124069214, 0.025490300729870796, -0.12467086315155029, 0.07284297049045563, 0.3011179268360138, 0.16023549437522888, -0.22351829707622528, -0.3328114151954651, 0.3756770193576813, 0.062291573733091354, 0.313528448343277, 0.01686735823750496, -0.12427110970020294, 0.07567904889583588, -0.04774840548634529, 0.40471965074539185, -0.026485610753297806, 0.10460072755813599, -0.1304578334093094, -0.1835048794746399, 0.2448483407497406, -0.1256927251815796, 0.10502180457115173, -0.11848173290491104, -0.1404641568660736, 0.22145965695381165, -0.17092907428741455, 0.17289559543132782, -0.11610622704029083, 0.34512859582901, 0.39496472477912903, 0.3352310061454773, -0.06196477264165878, -0.04925552010536194, -0.14124542474746704, 0.2527913451194763, -0.01723206415772438, 0.061140287667512894, 0.1366328001022339, -0.21710050106048584, -0.08008305728435516, -0.06099477410316467, 0.4289547801017761, 0.42490214109420776, 0.018296845257282257, -0.174462229013443, 0.24900385737419128, -0.0901227593421936, -0.15835699439048767, -0.02260487526655197, -0.0945587158203125, 0.22866640985012054, 0.4080880284309387, 0.029729502275586128, -0.04819939658045769, -0.42289480566978455, 0.04052339121699333, 0.20687495172023773, 0.32784783840179443, -0.4109727740287781, -0.023059027269482613, -0.25047168135643005, 0.4910900890827179, -0.35015979409217834, -0.37166792154312134, -0.18542322516441345, -0.39975506067276, -0.014579478651285172, 0.54119873046875, -0.0433967299759388, -0.22684185206890106, -0.10679534077644348, 0.18817423284053802, -0.05483122169971466, -0.30635198950767517, -0.04301480948925018, -0.27389150857925415, -0.3050994873046875, -0.06853784620761871, 0.30948442220687866, 0.34689733386039734, 0.07332723587751389, -0.4387647807598114, 0.1185830682516098, -0.07527811825275421, 0.048408955335617065, 0.19312019646167755, -0.015068728476762772, 0.3748866021633148, 0.04316943138837814, 0.15705999732017517, -0.014950843527913094, -0.2478795349597931, 0.36020395159721375, -0.3063112497329712, -0.0425509437918663, 0.2594083547592163, 0.01620488427579403, -0.14745375514030457, 0.02876313403248787, -0.3484431207180023, -0.30260899662971497, -0.2732788622379303, 0.10268473625183105, 0.016696374863386154, 0.042169228196144104, 0.2515583038330078, -0.05076845735311508, 0.12939687073230743, 0.04555045813322067, -0.2663952708244324, -0.36385640501976013, -0.65767902135849, 0.2792402505874634, -0.3718472123146057, -0.43669238686561584, -0.004410352557897568, 0.07626543194055557, 0.15471391379833221, -0.2062603384256363, -0.5261189937591553, -0.1717735379934311, -0.11505782604217529, -0.009988468140363693, -0.05330062657594681, -0.008193036541342735, 0.19568631052970886, -0.21059678494930267, 0.10146225988864899, -0.2207891047000885, -0.2358555942773819, 0.1315959095954895, 0.37768763303756714, 0.19302299618721008, 0.11540503054857254, 0.010035691782832146, -0.19215863943099976, 0.29746532440185547, 0.17917382717132568, 0.06619419157505035, 0.4907895624637604, 0.10853484272956848, 0.15505339205265045, -0.4114065170288086, -0.20209981501102448, 0.1520835906267166, -0.052531301975250244, -0.18543994426727295, 0.31425541639328003, 0.19528090953826904, -0.030888264998793602, -0.21794532239437103, -0.25970685482025146, -0.188947856426239, -0.2980727255344391, 0.07301932573318481, -0.036770112812519073, -0.10890030115842819, 0.18308031558990479, 0.1260860562324524, -0.2580634653568268, -0.20005354285240173, 0.0654594898223877, 0.2153385579586029, 0.08507014811038971, 0.1335149109363556, -0.3880454897880554, 0.13637055456638336, -0.3147239685058594, -0.006675347685813904, 0.007457990199327469, 0.46499401330947876, -0.021558716893196106, 0.10723166912794113, 0.21507342159748077, -0.09075571596622467, 0.40866243839263916, -0.1179942712187767, 0.33434122800827026, 0.16881625354290009, -0.13205234706401825, -0.589324414730072, -0.16433469951152802, -0.014595922082662582, 0.12914468348026276, -0.2715759575366974, 0.35465502738952637, -0.10960802435874939, -0.21530015766620636, 0.06275385618209839, 0.21182449162006378, -0.3659943640232086, -0.411203533411026, -0.1145152598619461, -0.22715073823928833, -0.43862125277519226, -0.314920574426651, -0.17281104624271393, 0.4311860501766205, -0.15103276073932648, -0.026461929082870483, 0.1973617672920227, 0.010848063975572586, -0.03127977252006531, 0.020853839814662933, 0.33532023429870605, 0.06245872750878334, 0.24964526295661926, 0.3859160542488098, 0.24668507277965546, 0.09362209588289261, 0.8297297358512878, 0.09053008258342743, -0.03659015893936157, 0.0182664692401886, -0.056973036378622055, -0.09519270807504654, 0.3731078803539276, 0.05587185546755791, -0.22279924154281616, -0.2321608066558838, -0.203006312251091, -0.26476314663887024, 0.07045827805995941, -0.047617703676223755, -0.15352649986743927, -0.13820187747478485, -0.29541242122650146, 0.745842695236206, -0.12150311470031738, -0.03792939335107803, 0.2378823310136795, 0.17754217982292175, -0.2442810982465744, 0.33682870864868164, -0.06746334582567215, 0.7275052070617676, -0.1296476125717163, 0.08208156377077103, 0.18494579195976257, -0.1389887034893036, 0.0571228563785553, -0.18973307311534882, -0.08631738275289536, -0.45234590768814087, 0.02663828432559967, 0.010600415989756584, -0.1912114918231964, -0.07580558210611343, 0.1763136088848114, 0.1925816684961319, 0.1807151585817337, -0.1706521362066269, 0.35948920249938965, 0.007710157427936792, 0.29934269189834595, -0.16448836028575897, -0.15620605647563934, -0.33395808935165405, 0.12198580801486969, -0.3084236979484558, 0.3172294795513153, -0.006357865873724222, -0.09382311254739761, -0.34397295117378235, -0.1346152424812317, -0.14901936054229736, 0.2670398950576782, 0.010019967332482338, 0.22526191174983978, 0.00787399336695671, -0.25347039103507996, 0.061544980853796005, -0.11672447621822357, 0.2907365560531616, -0.024738501757383347, -0.48471784591674805, 0.20331458747386932, -0.2533412575721741, -0.053124044090509415, -0.08387967199087143, 0.04198223352432251, 0.09079068154096603, -0.11623530089855194, -0.2936093807220459, -0.22534483671188354, -0.1320241093635559, -0.5381008982658386, -0.12279917299747467, 0.05468940734863281, 0.18077422678470612, -0.23348423838615417, -0.3793431520462036, 0.13879604637622833, 0.14752815663814545, -0.18550153076648712, 0.07469195127487183, 0.284479022026062, -0.1462664008140564, -0.03133571147918701, 0.1612139195203781, -0.27593719959259033, 0.06877652555704117, 0.5314810872077942, -0.015104200690984726, -0.1030048355460167, 0.4810539484024048, -0.04907890781760216, 0.13580256700515747, -0.061112578958272934, 0.2437121570110321, 0.6789808869361877, -0.5412433743476868, -0.055399391800165176, -0.29589128494262695, 0.0374419242143631, 0.13000857830047607, 0.35559991002082825, 0.19726169109344482, 0.054014042019844055, -0.058966971933841705, -0.48550644516944885, -0.19839242100715637, 0.24426642060279846, 0.013397255912423134, 0.2616472840309143, -0.0780034288764, 0.32993316650390625, -0.08748359233140945, 0.10379486531019211, -0.22026169300079346, 0.39067643880844116, -0.12353493273258209, 0.009700333699584007, -0.1733642965555191, -0.09233539551496506, 0.04447499290108681, -0.1052105575799942, 0.02650531195104122, -0.03913543373346329, -0.1847960650920868, -0.14265689253807068, -0.21187864243984222, 0.1832381933927536, 0.21305051445960999, -0.14759162068367004, -0.2793014943599701, -0.2858615517616272, 0.11521342396736145, -0.12745963037014008, 0.22058185935020447, 0.3554264307022095, -0.0367903858423233, 0.16165660321712494, 0.4478929042816162, 0.10388708114624023, -0.19051998853683472, 0.31567880511283875, 0.0064077228307724, 0.3063197433948517, -0.1715167611837387, 0.03792129084467888, 0.021641403436660767, 0.14073215425014496, -0.15181763470172882, 0.01262761652469635, 0.14787505567073822, 0.3636651635169983, 0.24251878261566162, -0.34817588329315186, 0.2341497540473938, 0.17834989726543427, 0.09790850430727005, 0.37694084644317627, -0.306972861289978, -0.07908239215612411, 0.09169360995292664, 0.12365489453077316, -0.15326832234859467, -0.3720608949661255, 0.2818470001220703, -0.045755043625831604, -0.19323700666427612, 0.07485808432102203, 0.4668865501880646, -0.22767546772956848, -0.4115045666694641, 0.04648400843143463, 0.7463684678077698, 0.11938205361366272, 0.12365953624248505, 0.4023260474205017, -0.22615930438041687, 0.018658261746168137, -0.08524885028600693, -0.03859685733914375, 0.02424941211938858, 0.7614558339118958, -0.09942758828401566, 0.31017905473709106, 0.008118974044919014, 0.24056532979011536, 0.1750899851322174, -0.3058958053588867, 0.02293030358850956, 0.05217587202787399, 0.03423575311899185, 0.09595011919736862, -0.16246791183948517, 0.1485905945301056, -0.32087084650993347, 0.01961883157491684, -0.3484989106655121, 0.12255674600601196, -0.1177418902516365, -0.2071269452571869, -0.25256794691085815, -0.301385760307312, -0.08712288737297058, 0.058529723435640335, -0.2395496368408203, -0.14305444061756134, 0.05892575904726982, 0.030798520892858505, -0.29535335302352905, -0.1507348269224167, 0.08520399034023285, 0.20092502236366272, -0.05329500883817673, -0.3021675944328308, 0.2914520502090454, 0.1629714071750641, -0.15443482995033264, 0.3131539821624756, 0.11015897244215012, 0.3145901560783386, 0.34282469749450684, -0.09955906867980957, 0.08877474069595337, 0.07118387520313263, -0.028794866055250168, -0.002706233412027359, 0.19171130657196045, -0.09520938992500305, -0.10282301902770996, 0.4018346965312958, 0.12415620684623718, -0.03519948571920395, 0.061752792447805405, -0.04285983368754387, 0.18986082077026367, -0.20830436050891876, 0.5340346097946167, -0.1340097039937973, 0.001352854073047638, -0.19088393449783325, 0.04971306771039963, -0.10665403306484222, -0.10763027518987656, 0.3707558512687683, -0.08239148557186127, 0.11125826090574265, -0.03065039962530136, 0.029711171984672546, -0.1269504427909851, 0.5807738304138184, 0.37020474672317505, -0.22765830159187317, -0.2903737425804138, -0.29171085357666016, -0.6512928605079651, 0.34886643290519714, -0.1494486778974533, 0.1185847669839859, 0.2773769795894623, 0.10515303164720535, -0.054008565843105316, -0.003333061933517456, -0.25373268127441406, 0.3306898772716522, -0.10873246192932129, 0.057387080043554306, -0.2382141649723053, -0.35852688550949097, 0.25329577922821045, -0.012602141126990318, -0.002044839784502983, -0.40286436676979065, 0.20321694016456604, 0.01300790999084711, -0.06494458019733429, -0.16466662287712097, 0.12157078087329865, 0.16878589987754822, -0.2281377613544464, 0.2321842610836029, 0.18217924237251282, 0.35991621017456055, 0.08440864086151123, -0.10740617662668228, -0.5960645079612732, -0.37141096591949463, -0.04809638112783432, 0.019034136086702347, -0.13050125539302826, 0.35365745425224304, 0.08108096569776535, -0.0613720677793026, -0.28941258788108826, 0.08101610839366913, -0.08908076584339142, 0.2710464298725128, -0.3573679029941559, -0.13287881016731262, -0.33072733879089355, 0.2468918412923813, 0.2877408266067505, 0.35579758882522583, -0.0018426142632961273, 0.3905982971191406, -0.07421255856752396, -0.3385460078716278, 0.5343868732452393, -0.37937358021736145, -0.3047368824481964, 0.12671133875846863, 0.14680209755897522, -0.2151361107826233, -0.22542637586593628, -0.28449684381484985, 0.12279964238405228, 0.34016942977905273, -0.11444618552923203, -0.15157493948936462, 0.2058027982711792, 0.1698247194290161, -0.08747890591621399, 0.0724724531173706, -0.04825928062200546, 0.1949249505996704, -0.18739239871501923, 0.13358430564403534, -0.15391972661018372 ]
https://github.com/huggingface/datasets/issues/5000
Dataset Viewer issue for asapp/slue
<img width="519" alt="Capture d’écran 2022-09-20 à 22 33 47" src="https://user-images.githubusercontent.com/1676121/191358952-1220cb7d-745a-4203-a66b-3c707b25038f.png"> ``` Not found. Error code: SplitsResponseNotFound ``` https://datasets-server.huggingface.co/splits?dataset=asapp/slue ```json {"error":"Not found."} ```
### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes
22
Dataset Viewer issue for asapp/slue ### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes <img width="519" alt="Capture d’écran 2022-09-20 à 22 33 47" src="https://user-images.githubusercontent.com/1676121/191358952-1220cb7d-745a-4203-a66b-3c707b25038f.png"> ``` Not found. Error code: SplitsResponseNotFound ``` https://datasets-server.huggingface.co/splits?dataset=asapp/slue ```json {"error":"Not found."} ```
[ -0.418256551027298, -0.4197004437446594, 0.042974840849637985, 0.509233832359314, 0.2707154154777527, 0.08821801096200943, 0.11993806809186935, 0.24258728325366974, -0.05991286039352417, 0.10223323851823807, -0.20221774280071259, 0.18099993467330933, -0.008216076530516148, 0.22698254883289337, -0.1765618622303009, -0.19762307405471802, -0.08290324360132217, 0.14622968435287476, 0.32018712162971497, 0.06693002581596375, -0.14503850042819977, 0.2303554117679596, -0.0659148097038269, 0.14896094799041748, -0.1766902208328247, -0.0405077263712883, -0.03167768940329552, 0.1666179597377777, -0.3150944113731384, -0.09778717160224915, 0.12252762913703918, 0.005630020052194595, 0.3580397069454193, 0.349162757396698, -0.00011340466153342277, 0.046133942902088165, 0.4147685766220093, -0.03032780811190605, -0.0184960775077343, -0.15344057977199554, -0.5253604650497437, -0.024449344724416733, 0.1458718329668045, -0.05232524126768112, -0.2865633964538574, -0.012269613333046436, 0.12069717794656754, -0.5153008103370667, 0.589632511138916, 0.14608336985111237, 0.24689331650733948, -0.008429518900811672, 0.11501432955265045, -0.03623541444540024, 0.0071981847286224365, 0.11674073338508606, -0.27883926033973694, -0.13370253145694733, -0.04628145694732666, 0.4592893719673157, -0.039746664464473724, 0.32465946674346924, 0.08204460889101028, 0.1595284640789032, 0.21002435684204102, -0.08227661997079849, -0.27208030223846436, -0.2592637836933136, 0.4201068580150604, -0.009960547089576721, 0.5549567341804504, -0.16392290592193604, -0.19705267250537872, 0.04347655177116394, -0.07061119377613068, -0.11693926900625229, 0.18531088531017303, 0.38180503249168396, -0.0433683916926384, 0.2425416260957718, -0.23171694576740265, -0.27694079279899597, -0.2833854854106903, -0.022300049662590027, -0.39887532591819763, -0.11516869068145752, -0.3123449385166168, 0.10765384137630463, 0.07201739400625229, -0.09183850884437561, 0.11663965880870819, 0.08480831980705261, -0.14128044247627258, 0.012718196026980877, -0.2709980607032776, -0.13133174180984497, -0.035471655428409576, -0.02230013906955719, 0.04974017292261124, 0.3735044002532959, 0.09040141850709915, 0.22516310214996338, -0.10443385690450668, 0.16073042154312134, 0.3944067656993866, -0.069218710064888, 0.23303541541099548, 0.2709522247314453, 0.3097303509712219, 0.29214420914649963, 0.2154928743839264, -0.11679873615503311, -0.005602417513728142, -0.32841387391090393, -0.41007566452026367, -0.3337530195713043, 0.2836969494819641, -0.37174224853515625, -0.19688306748867035, -0.08022452145814896, -0.36765390634536743, -0.08166781812906265, -0.0464780367910862, 0.29526808857917786, 0.0859050303697586, 0.16702285408973694, -0.0074727535247802734, 0.11165425926446915, -0.30903512239456177, -0.41234588623046875, -0.2211042046546936, 0.05270296335220337, -0.22199830412864685, 0.020759213715791702, 0.11077766120433807, -0.34012287855148315, 0.0625312477350235, -0.1961342692375183, -0.34164565801620483, -0.12776190042495728, 0.010473517701029778, -0.051974907517433167, -0.22788944840431213, 0.15809008479118347, 0.3025420606136322, -0.17323611676692963, -0.018720310181379318, -0.02260783314704895, 0.02182108163833618, 0.07178615033626556, -0.02731873095035553, -0.1146656945347786, -0.0839083194732666, 0.1626311093568802, -0.18510468304157257, -0.042445361614227295, -0.2626558244228363, 0.21529482305049896, -0.23981240391731262, -0.13034212589263916, -0.03580465167760849, 0.19142547249794006, -0.22182098031044006, -0.026828818023204803, 0.2691792845726013, 0.45815372467041016, -0.4721052348613739, -0.14692428708076477, -0.5364881157875061, -0.5664243102073669, -0.1039668396115303, 0.1511911302804947, 0.1606689840555191, -0.26911330223083496, -0.4245717227458954, 0.11218439042568207, 0.20834754407405853, -0.08992704749107361, -0.4979279339313507, 0.2868431806564331, -0.12331346422433853, -0.24010129272937775, 0.15292802453041077, 0.10814385861158371, 0.24730999767780304, -0.06296706944704056, -0.3927224576473236, 0.25123170018196106, -0.23505443334579468, -0.16686150431632996, -0.17938019335269928, -0.18728001415729523, -0.18917551636695862, 0.3480486571788788, 0.19359038770198822, -0.08750089257955551, 0.3923819363117218, 0.15459692478179932, 0.1247495785355568, 0.10654619336128235, 0.17325623333454132, -0.1282445639371872, 0.29826515913009644, 0.17549178004264832, 0.041561421006917953, -0.23504137992858887, -0.42195457220077515, -0.10639013350009918, -0.24038442969322205, -0.16434623301029205, -0.3123930096626282, -0.007377728819847107, -0.3415108323097229, -0.1873016059398651, -0.30273178219795227, -0.30280616879463196, 0.08462698012590408, -0.05008740723133087, -0.007188122719526291, 0.20184330642223358, -0.010514434427022934, 0.19655945897102356, 0.16884911060333252, 0.27644747495651245, -0.22853808104991913, 0.6436202526092529, -0.11416719108819962, 0.07887156307697296, 0.2511975169181824, 0.14672914147377014, 0.17098084092140198, -0.17727454006671906, -0.052335381507873535, 0.2973150610923767, 0.3115761876106262, 0.2559847831726074, 0.3606301546096802, -0.10312856733798981, 0.5408878922462463, -0.8836181163787842, 0.2670731544494629, -0.01635352149605751, 0.06020275503396988, -0.08220461010932922, -0.46774008870124817, 0.09408073872327805, -0.21050889790058136, 0.09297993034124374, 0.08087305724620819, 0.4532764256000519, 0.22535115480422974, -0.16238455474376678, 0.09148959070444107, -0.2550342082977295, -0.08562895655632019, -0.10818271338939667, 0.16574442386627197, 0.0231761671602726, -0.42164602875709534, 0.10976269096136093, 0.1568112075328827, 0.04055670276284218, -0.19217607378959656, 0.23963063955307007, -0.22686973214149475, 0.012750200927257538, 0.3106120526790619, 0.09330424666404724, 0.11936952918767929, 0.3033643066883087, -0.09110851585865021, 0.24595646560192108, 0.14645196497440338, -0.2157883495092392, 0.03943556547164917, 0.13717415928840637, -0.059601642191410065, -0.07329420000314713, 0.09906352311372757, -0.17242473363876343, -0.3301807641983032, -0.18030428886413574, 0.13945622742176056, 0.20300595462322235, -0.1748422533273697, -0.20404106378555298, -0.31436190009117126, -0.6559750437736511, -0.25728753209114075, 0.16779527068138123, -0.1281580626964569, -0.3020840883255005, 0.07618730515241623, 0.10185445845127106, 0.023624971508979797, 0.23492971062660217, -0.34120509028434753, 0.47548431158065796, -0.13241486251354218, 0.39327162504196167, -0.25454631447792053, -0.04917655512690544, -0.1844637095928192, 0.15360510349273682, 0.47993338108062744, 0.18370629847049713, 0.4631503224372864, -0.3082596957683563, 0.2885255813598633, -0.48093271255493164, -0.4385901391506195, 0.2419537901878357, -0.01742744818329811, -0.027699189260601997, 0.07977323979139328, -0.0877305120229721, 0.1540476679801941, 0.09320859611034393, 0.263174444437027, -0.034366175532341, -0.17634743452072144, 0.019847121089696884, 0.07965041697025299, -0.001278477138839662, -0.04378104954957962, -0.43370071053504944, -0.022282036021351814, -0.31689339876174927, 0.14445191621780396, -0.10415330529212952, 0.0919121727347374, -0.35404908657073975, 0.19848811626434326, 0.16799408197402954, -0.019642606377601624, -0.1610199511051178, -0.07223135977983475, 0.04264964535832405, 0.05545249953866005, -0.35606321692466736, -0.3814869225025177, 0.4781106412410736, 0.2820942997932434, 0.046186596155166626, -0.23987147212028503, -0.5531013011932373, -0.14240701496601105, -0.1297881305217743, -0.0003024749457836151, 0.20417682826519012, -0.07514198124408722, 0.22387154400348663, 0.11643059551715851, 0.03524371236562729, -0.11149805039167404, -0.3662962317466736, 0.07383257895708084, -0.4317202866077423, 0.2788676917552948, -0.03888275474309921, 0.5638812184333801, 0.1666727066040039, 0.5461443662643433, 0.41207775473594666, -0.06292355060577393, 0.25825196504592896, -0.16396939754486084, 0.11109316349029541, -0.15516191720962524, -0.14341923594474792, 0.4549811780452728, 0.07673372328281403, 0.1420409083366394, 0.2765795588493347, 0.3203842043876648, -0.18909978866577148, -0.17472368478775024, 0.06625920534133911, -0.25081202387809753, -0.046030107885599136, -0.3736095428466797, 0.01776866428554058, -0.075798399746418, -0.04722989723086357, -0.06977445632219315, 0.06332136690616608, -0.2455008327960968, 0.007685549557209015, 0.30898892879486084, 0.21053284406661987, 0.15581552684307098, -0.21808482706546783, 0.1375439167022705, -0.1772482991218567, 0.5122391581535339, -0.1224912777543068, 0.05357963591814041, -0.14885695278644562, 0.12168868631124496, 0.35754406452178955, -0.086370088160038, 0.6051861643791199, -0.1465139538049698, 0.0926704928278923, -0.03860243409872055, -0.14596669375896454, -0.09186314791440964, 0.21052362024784088, 0.011954192072153091, -0.00014603696763515472, 0.19181737303733826, 0.16821062564849854, -0.3081793189048767, -0.11951509863138199, 0.369709849357605, -0.37297725677490234, -0.15391957759857178, -0.021205879747867584, 0.09196494519710541, -0.19794973731040955, -0.02086116187274456, -0.1759747862815857, -0.16066384315490723, 0.17459289729595184, 0.08200753480195999, -0.14524832367897034, -0.1420266181230545, -0.5194501876831055, 0.05018255114555359, 0.1437012404203415, 0.3478604853153229, -0.10258706659078598, 0.2953304350376129, 0.5163890719413757, 0.652266263961792, 0.4291865825653076, 0.7874916195869446, 0.06192097067832947, -0.6465845108032227, 0.3650673031806946, -0.10547611117362976, 0.21739719808101654, 0.18368738889694214, 0.009335221722722054, -0.2092859148979187, 0.15855900943279266, 0.30567196011543274, -0.29073959589004517, -0.002640992635861039, 0.2217070460319519, 0.06716570258140564, -0.28747138381004333, -0.3509383201599121, 0.3256565034389496, 0.25851160287857056, 0.09803982079029083, 0.05108792707324028, 0.2760050892829895, -0.1054360568523407, 0.016011524945497513, -0.06491010636091232, 0.8501965403556824, 0.01562809944152832, -0.298326313495636, 0.051566578447818756, -0.7011973857879639, 0.24198953807353973, -0.3380877375602722, 0.09960996359586716, -0.2255520224571228, 0.18314038217067719, -0.1167188435792923, -0.07193197309970856, 0.44174885749816895, 0.010586649179458618, -0.12904629111289978, 0.0530594103038311, 0.0460391640663147, -0.29001155495643616, 0.01013216096907854, 0.382978230714798, -0.13795587420463562, -0.00144985131919384, -0.06574754416942596, 0.18130765855312347, -0.11400850117206573, 0.14302881062030792, 0.13137081265449524, -0.21547114849090576, -0.05865301936864853, -0.06007829308509827, -0.44648492336273193, 0.05957130342721939, 0.093193419277668, -0.217298224568367, -0.05347457900643349, -0.2426259070634842, 0.6468430161476135, 0.24917753040790558, 0.08517587929964066, -0.20282825827598572, -0.35858428478240967, 0.29754364490509033, -0.19275498390197754, 0.008554569445550442, 0.15301674604415894, 0.2904262840747833, 0.15071159601211548, -0.07019536942243576, 0.042032353579998016, 0.23456701636314392, 0.19828754663467407, -0.11055345833301544, -0.19435295462608337, -0.020482875406742096, -0.004598155617713928, -0.30528178811073303, -0.004336465150117874, -0.10826900601387024, 0.07936874032020569, -0.14612698554992676, 0.11548006534576416, 0.06810123473405838, 0.07163755595684052, -0.07506891340017319, 0.005409654229879379, -0.16513961553573608, -0.1039169430732727, 0.35750749707221985, -0.16632720828056335, -0.1329389214515686, 0.18881358206272125, 0.36561688780784607, -0.1720609962940216, -0.18753588199615479, 0.09864545613527298, 0.18097496032714844, -0.5611411929130554, 0.09162409603595734, -0.11778544634580612, -0.0743933767080307, 0.13898327946662903, 0.10428810119628906, -0.07861701399087906, -0.15401345491409302, 0.1504632830619812, -0.4560096859931946, 0.02742384932935238, 0.0441800020635128, -0.26321592926979065, 0.17619651556015015, -0.2052019238471985, 0.286031574010849, 0.19764083623886108, 0.12333791702985764, -0.27727365493774414, 0.24001052975654602, -0.018238186836242676, -0.06005672365427017, -0.34384843707084656, 0.07369307428598404, -0.12364643067121506, -0.11683429777622223, 0.10426205396652222, 0.12209682911634445, -0.3098326027393341, -0.07911108434200287, -0.012206471525132656, 0.14232546091079712, 0.10105910897254944, -0.2775764465332031, -0.12539836764335632, -0.06691771745681763, -0.2918318212032318, 0.18779321014881134, 0.0613083653151989, 0.07008086144924164, -0.03138881176710129, -0.10518722236156464, -0.022323396056890488, -0.3768772780895233, -0.015418656170368195, 0.047398731112480164, 0.3180607855319977, 0.5436429977416992, -0.0038332082331180573, 0.20074304938316345, 0.002940902952104807, 0.02344048023223877, 0.150761678814888, 0.0819544792175293, 0.26288318634033203, -0.08974268287420273, 0.4753563702106476, -0.18762651085853577, 0.20952090620994568, 0.25338876247406006, 0.4718227684497833, 0.13542312383651733, -0.11672336608171463, 0.11717309057712555, 0.14474114775657654, 0.15742921829223633, -0.402719110250473, 0.14630308747291565, 0.36707577109336853, 0.06857871264219284, -0.017840296030044556, -0.026499934494495392, -0.08737915754318237, 0.48346614837646484, -0.14063479006290436, 0.14324510097503662, 0.6160216331481934, -0.03145278990268707, 0.37839648127555847, 0.17410647869110107, -0.2321797013282776, 0.18917033076286316, 0.3929145634174347, 0.20474939048290253, 0.0967947244644165, 0.39909619092941284, -0.23090901970863342, 0.1167621910572052, -0.24734720587730408, 0.6020876169204712, 0.37711066007614136, -0.3523247241973877, -0.23700116574764252, 0.07942572981119156, -0.07752598822116852, -0.07819507271051407, -0.21759983897209167, 0.5463477969169617, 0.05909128859639168, -0.09960312396287918, -0.24499323964118958, 0.2062225192785263, 0.11658940464258194, 0.2268184870481491, -0.2237214595079422, -0.24547365307807922, -0.17968407273292542, 0.04035459831357002, 0.05860649421811104, -0.2660278081893921, 0.17528624832630157, 0.10317412763834, -0.23565573990345, -0.28524452447891235, -0.11641866713762283, 0.031110286712646484, 0.022538088262081146, 0.021201062947511673, 0.2643173635005951, -0.028356269001960754, -0.08632797002792358, 0.4791644811630249, 0.4372454881668091, 0.018982939422130585, -0.052917495369911194, 0.10740911960601807, -0.13503363728523254, 0.0029716119170188904, -0.16814644634723663, -0.05842003598809242, 0.3812462389469147, 0.22662384808063507, -0.13596554100513458, 0.19502556324005127, 0.1104053407907486, -0.12924490869045258, 0.179676353931427, -0.02838752791285515, 0.32353535294532776, -0.1562250256538391, 0.3920692503452301, -0.512856125831604, 0.045966535806655884, -0.10641223192214966, -0.44219115376472473, -0.31861695647239685, -0.07970140874385834, -0.06353646516799927, -0.2850443422794342, -0.1018279418349266, -0.3535787761211395, 0.044637635350227356, 0.10053513944149017, 0.04089046269655228, 0.32016509771347046, -0.007165081799030304, 0.031078588217496872, -0.3067525625228882, -0.49336934089660645, 0.08781921863555908, 0.12955154478549957, -0.30798736214637756, 0.076642706990242, 0.13639160990715027, -0.07455281168222427, 0.09935759007930756, 0.3381415605545044, 0.3684990108013153, 0.28147274255752563, 0.3734981119632721, -0.11107800900936127, 0.1168169230222702, 0.15347808599472046, 0.13914039731025696, -0.1322236955165863, -0.11908901482820511, 0.38133925199508667, -0.03632914647459984, -0.06730449944734573, 0.04166334867477417, 0.23101076483726501, -0.18302707374095917, -0.4838269054889679, 0.05575188994407654, 0.20828254520893097, 0.386055588722229, 0.08013954758644104, 0.32074615359306335, -0.2638617157936096, -0.34172651171684265, -0.38569092750549316, 0.08456730097532272, 0.15532539784908295, 0.3843192458152771, -0.1381823718547821, -0.22900719940662384, -0.22815677523612976, 0.18969273567199707, -0.02777004987001419, 0.2735157310962677, -0.31486788392066956, 0.12893785536289215, -0.2786005735397339, 0.08362527191638947, 0.3861246109008789, 0.23680689930915833, -0.00440622866153717, -0.0508798286318779, -0.19591492414474487, -0.19654692709445953, 0.13343800604343414, -0.4304443299770355, -0.07610154151916504, 0.2746679484844208, 0.0926947370171547, 0.1753290891647339, -0.29652297496795654, -0.07789769023656845, -0.07331953197717667, 0.22375577688217163, -0.07208474725484848, 0.2331463098526001, 0.16237400472164154, 0.20285648107528687, -0.14980196952819824, -0.04922819882631302, 0.2093667984008789, 0.2500840723514557, 0.07613220065832138, 0.42773547768592834, 0.06454386562108994 ]
https://github.com/huggingface/datasets/issues/5000
Dataset Viewer issue for asapp/slue
I just launched a refresh. It's weird, I don't see any entry for this dataset in the cache, it's a bug on our side. In order to try to understand what happened, did you change the visibility status from private to public, by any chance?
### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes
45
Dataset Viewer issue for asapp/slue ### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes I just launched a refresh. It's weird, I don't see any entry for this dataset in the cache, it's a bug on our side. In order to try to understand what happened, did you change the visibility status from private to public, by any chance?
[ -0.38746219873428345, -0.3276960253715515, 0.0351436547935009, 0.45084524154663086, 0.38891154527664185, 0.00590737909078598, 0.23917630314826965, 0.004538895562291145, -0.04942909628152847, 0.13882531225681305, -0.2166341245174408, 0.2715500593185425, -0.08159657567739487, 0.08345993608236313, -0.00009978096932172775, -0.013379842042922974, 0.03157596290111542, -0.025638550519943237, 0.3235611319541931, -0.0376865528523922, -0.10105190426111221, -0.039086855947971344, -0.12878143787384033, 0.02160950005054474, -0.04815210774540901, 0.12915416061878204, -0.03670889884233475, 0.06262166053056717, -0.19572769105434418, -0.3138793408870697, 0.2703462839126587, -0.03413495048880577, 0.4060761332511902, 0.14864829182624817, -0.00010473596921656281, 0.04581322520971298, 0.44900697469711304, 0.023966876789927483, -0.21377384662628174, 0.09699483215808868, -0.47067946195602417, -0.12819385528564453, 0.22742244601249695, 0.005254656076431274, -0.34618091583251953, 0.07420837134122849, 0.14138588309288025, -0.4330950975418091, 0.18590384721755981, 0.22410178184509277, 0.34022051095962524, 0.0019761770963668823, 0.051820021122694016, 0.0006600822089239955, 0.0558096282184124, -0.13105745613574982, -0.2461840957403183, -0.20194697380065918, -0.04131637513637543, 0.37605538964271545, -0.1069188341498375, 0.26970595121383667, 0.1443355679512024, 0.1985580325126648, 0.3403337299823761, 0.03122730180621147, -0.09546595066785812, -0.19899490475654602, 0.28343430161476135, -0.10009554773569107, 0.8011901378631592, -0.29010647535324097, -0.19409458339214325, 0.11427325755357742, 0.0777701586484909, -0.2763431668281555, 0.2237381637096405, 0.18497952818870544, 0.16111837327480316, 0.35442662239074707, 0.09314631670713425, -0.15835651755332947, -0.08862574398517609, -0.12169545888900757, -0.3999894857406616, -0.07509946823120117, -0.2844770848751068, 0.06453726440668106, -0.09317059814929962, -0.09135745465755463, 0.4271094501018524, 0.06411688029766083, -0.22998473048210144, 0.03635530546307564, -0.36132511496543884, 0.04315903037786484, 0.3149356245994568, 0.13244076073169708, -0.1444063037633896, 0.2886781692504883, 0.307765930891037, 0.3111800253391266, -0.1262645125389099, 0.14927753806114197, 0.17739325761795044, 0.16086018085479736, 0.34812408685684204, 0.12124577909708023, 0.4337002635002136, 0.1220659390091896, 0.15254034101963043, -0.07998437434434891, -0.10112737864255905, -0.08085242658853531, -0.01800287701189518, -0.2945168614387512, 0.37590491771698, -0.4192401170730591, -0.2439493089914322, 0.05684588849544525, -0.28956830501556396, -0.24744877219200134, -0.025098543614149094, 0.2566315829753876, -0.004027741029858589, 0.21588072180747986, 0.03692688047885895, -0.07002710551023483, -0.19199737906455994, -0.4039553999900818, -0.30648013949394226, -0.16714240610599518, -0.30065348744392395, 0.05785726010799408, 0.24036984145641327, -0.44660115242004395, 0.00953022763133049, -0.0646560937166214, -0.4277881979942322, -0.16439232230186462, 0.1037885770201683, -0.006269038189202547, -0.0937310978770256, 0.1650804728269577, 0.15586969256401062, -0.1173226535320282, 0.07783946394920349, -0.09882829338312149, 0.1650180220603943, 0.22281897068023682, 0.0010066255927085876, -0.3019416332244873, -0.11858098208904266, 0.2210070788860321, -0.149727001786232, -0.044920556247234344, -0.033407919108867645, 0.17583084106445312, -0.04196680337190628, -0.25114819407463074, -0.07119382172822952, 0.09896563738584518, -0.18938767910003662, -0.14427179098129272, 0.2815920412540436, 0.4194166660308838, -0.4864930808544159, 0.008542433381080627, -0.5572488307952881, -0.44062700867652893, -0.03565705567598343, -0.04353803023695946, -0.07270671427249908, -0.23558947443962097, -0.46517205238342285, -0.22963418066501617, 0.30082449316978455, -0.031234489753842354, -0.6299103498458862, 0.09542657434940338, -0.16523581743240356, -0.13948236405849457, 0.11621905863285065, 0.18041348457336426, -0.05101145803928375, -0.134825199842453, -0.21206289529800415, -0.01937286928296089, -0.020218489691615105, -0.14319080114364624, -0.33209702372550964, -0.09822474420070648, 0.013366632163524628, 0.10765393078327179, 0.2178851217031479, 0.28373950719833374, 0.440043181180954, 0.022429052740335464, 0.20002508163452148, 0.2640373110771179, 0.21271641552448273, 0.09319695830345154, 0.26160162687301636, 0.2543780207633972, 0.13499148190021515, -0.046863045543432236, -0.23604422807693481, 0.04888813942670822, -0.36424553394317627, -0.10116465389728546, 0.1032663881778717, -0.06290743499994278, -0.12049742043018341, -0.08630670607089996, -0.21152426302433014, -0.5076442360877991, 0.21361790597438812, 0.2799060046672821, -0.21009452641010284, 0.12709514796733856, 0.031465258449316025, 0.15242023766040802, 0.08889028429985046, -0.004776752553880215, -0.17826704680919647, 0.5255498290061951, -0.049629777669906616, 0.005609367974102497, 0.01927371323108673, 0.1293439120054245, 0.19607770442962646, 0.06062380224466324, -0.06495935469865799, 0.13632841408252716, 0.17880061268806458, -0.030332699418067932, 0.30829235911369324, 0.14772829413414001, 0.2443987876176834, -0.48882365226745605, 0.3559664487838745, -0.03955121338367462, 0.10345104336738586, -0.06336494535207748, -0.41143426299095154, 0.025807566940784454, 0.1639375388622284, -0.06205464154481888, -0.07573398947715759, 0.3362547755241394, 0.33395275473594666, -0.10649897158145905, 0.0760742798447609, -0.08957113325595856, 0.033310867846012115, -0.08932013809680939, 0.2608967125415802, 0.17767587304115295, -0.5479755401611328, 0.3422546684741974, -0.04714132472872734, 0.1915178745985031, -0.17898836731910706, 0.0833810418844223, -0.4255583882331848, -0.08093192428350449, 0.31519222259521484, -0.0004183351993560791, 0.10848624259233475, 0.27140185236930847, 0.0044535622000694275, 0.17783239483833313, 0.05170755088329315, -0.13506221771240234, -0.11267831176519394, 0.15204846858978271, -0.07078752666711807, -0.09756987541913986, 0.4041202962398529, -0.02908206358551979, -0.36417052149772644, 0.0841839462518692, 0.3073708713054657, 0.21867386996746063, -0.24050085246562958, -0.1942993700504303, -0.21018026769161224, -0.6565437912940979, -0.11646290123462677, 0.30403417348861694, -0.13346266746520996, -0.340656042098999, -0.041084833443164825, 0.1573202908039093, 0.058836083859205246, 0.3073357045650482, -0.24072174727916718, 0.47318893671035767, -0.15765152871608734, 0.3722960948944092, -0.20511646568775177, -0.0378166027367115, -0.2853606343269348, 0.16545148193836212, 0.28070470690727234, 0.06482437252998352, 0.2926988899707794, -0.09547015279531479, 0.3727480173110962, -0.6366184949874878, -0.3765716552734375, 0.08337289094924927, 0.15885895490646362, 0.13576026260852814, -0.1612612009048462, -0.14527998864650726, 0.02951015532016754, 0.17071542143821716, 0.16133588552474976, -0.026407238095998764, -0.11955268681049347, 0.02051783725619316, 0.09275837987661362, 0.07320399582386017, -0.014503756538033485, -0.30456095933914185, -0.07165903598070145, -0.3564182221889496, -0.07437267899513245, -0.06550602614879608, 0.01888732984662056, -0.3348582088947296, -0.05461559072136879, 0.09502431005239487, 0.045448046177625656, -0.17149928212165833, -0.23275050520896912, -0.12612085044384003, 0.09781836718320847, -0.3322930634021759, -0.5086389780044556, 0.34798669815063477, 0.13570508360862732, 0.01565471477806568, -0.2257801592350006, -0.6021760106086731, -0.26696541905403137, -0.08003579080104828, 0.16183683276176453, 0.22937627136707306, -0.20940734446048737, 0.4496840536594391, 0.13279753923416138, -0.016079939901828766, -0.15365582704544067, -0.5736740231513977, 0.000730559229850769, -0.26201581954956055, 0.2676072120666504, -0.03950665891170502, 0.34585633873939514, 0.11629518866539001, 0.5173128247261047, 0.14138777554035187, -0.07747113704681396, 0.3503847122192383, -0.1542738974094391, 0.3211515545845032, -0.18338078260421753, -0.11651575565338135, 0.35966920852661133, -0.13165101408958435, -0.044008612632751465, 0.2683789134025574, 0.2887573838233948, -0.29312828183174133, -0.1475972831249237, 0.20701462030410767, -0.06640353053808212, -0.06257013976573944, -0.28449565172195435, -0.29461535811424255, 0.03529834374785423, 0.2223174273967743, 0.009057655930519104, -0.13325010240077972, -0.3834483027458191, 0.01553589478135109, 0.20414450764656067, 0.26816868782043457, 0.05653897300362587, -0.13243368268013, 0.2895922064781189, -0.30002012848854065, 0.304044634103775, -0.2038133442401886, 0.2635628283023834, -0.19921845197677612, -0.026463761925697327, 0.4771016240119934, -0.03992932662367821, 0.34889841079711914, -0.307239294052124, 0.2775501012802124, 0.2719573378562927, -0.02432098239660263, -0.11814521253108978, -0.0598130039870739, -0.0007778257131576538, -0.0012216339819133282, 0.14167539775371552, -0.01776318997144699, -0.14266812801361084, -0.021091297268867493, 0.18529987335205078, -0.34333929419517517, -0.16779617965221405, -0.10293380916118622, -0.08648402988910675, 0.004255279898643494, 0.1306864321231842, -0.12918302416801453, -0.24412144720554352, 0.1559671014547348, -0.15880006551742554, 0.14048175513744354, -0.3230210244655609, -0.1985543668270111, 0.015212900936603546, -0.017659470438957214, 0.3958013951778412, 0.07675516605377197, 0.3184056878089905, 0.4105277955532074, 0.6555017232894897, 0.17275448143482208, 0.7298908233642578, -0.04131590202450752, -0.5209154486656189, 0.4847734272480011, -0.14850734174251556, 0.08254840970039368, 0.11200219392776489, -0.03800637647509575, -0.09495911747217178, 0.07253117859363556, 0.030603107064962387, -0.2472924292087555, -0.01661832630634308, 0.09442726522684097, 0.1026754304766655, -0.3066672384738922, -0.4405607581138611, 0.3312002122402191, 0.31926479935646057, -0.10626561939716339, 0.23830370604991913, -0.026560179889202118, 0.012615622021257877, 0.046438269317150116, -0.12459831684827805, 0.7242977619171143, -0.08194001019001007, -0.24148449301719666, 0.09417364001274109, -0.4839000105857849, 0.12717284262180328, -0.510956883430481, 0.25272852182388306, -0.4155668020248413, -0.12825508415699005, 0.004474727436900139, -0.04065689444541931, 0.4053651690483093, -0.10630039870738983, -0.013823084533214569, -0.035677969455718994, 0.041163504123687744, -0.23252856731414795, 0.14981287717819214, 0.18214145302772522, -0.02696811966598034, 0.08337371051311493, 0.022719940170645714, 0.24458780884742737, -0.005032479763031006, 0.16148750483989716, -0.05233355611562729, -0.09935695677995682, 0.053117621690034866, 0.045554742217063904, -0.4727294445037842, 0.09232107549905777, 0.08666449040174484, -0.21503156423568726, 0.003276430070400238, -0.4455023407936096, 0.32172244787216187, 0.44018983840942383, 0.07021865993738174, -0.06837421655654907, -0.36271414160728455, 0.26267313957214355, 0.061543457210063934, 0.1414307951927185, 0.153948575258255, 0.18721510469913483, 0.1617106795310974, -0.028127461671829224, -0.1084052324295044, 0.3057296872138977, -0.003810604102909565, -0.24175982177257538, -0.2419441193342209, 0.1558103859424591, 0.07651093602180481, -0.3057226836681366, 0.14462026953697205, 0.01355414092540741, 0.09972524642944336, -0.09770972281694412, 0.2126641720533371, 0.2650473117828369, 0.08129046857357025, -0.13871070742607117, 0.007029667496681213, -0.17226427793502808, -0.0747729241847992, 0.5261292457580566, 0.02934568002820015, -0.13547508418560028, 0.2206544131040573, 0.2783990800380707, -0.17769433557987213, -0.16289228200912476, -0.0985095202922821, 0.1875716745853424, -0.3143322467803955, -0.07859857380390167, -0.003336491761729121, -0.03432858735322952, 0.252051442861557, 0.07000115513801575, -0.18278095126152039, -0.1354464888572693, -0.06303135305643082, -0.43748360872268677, 0.0025980528444051743, -0.08765123784542084, -0.342628538608551, 0.07425867021083832, -0.16169744729995728, 0.01301230862736702, 0.25550442934036255, 0.07760625332593918, -0.3715922236442566, 0.15051878988742828, -0.13064168393611908, 0.01349022425711155, -0.35812392830848694, 0.12405490130186081, -0.0945432111620903, -0.23830385506153107, 0.13148915767669678, -0.03821408003568649, -0.3480754792690277, -0.1762959063053131, 0.11479341983795166, 0.09945273399353027, 0.1401365101337433, -0.1706833839416504, -0.24203868210315704, -0.08448264002799988, -0.2351100742816925, 0.14649078249931335, 0.014527525752782822, 0.10412003844976425, -0.1264522522687912, -0.05715643987059593, 0.044648196548223495, -0.22085130214691162, 0.1256912499666214, 0.07461971044540405, 0.24208343029022217, 0.19322636723518372, -0.0019277320243418217, 0.08490487933158875, 0.0408661887049675, 0.15768486261367798, 0.1692163348197937, 0.03644056245684624, -0.05658407509326935, 0.1075722947716713, 0.3810100555419922, -0.4831817150115967, 0.12991410493850708, 0.1703163981437683, 0.33347252011299133, -0.01232137531042099, -0.2143549770116806, 0.04012639820575714, 0.2874963581562042, 0.23729561269283295, -0.45346638560295105, 0.07133375108242035, 0.33198675513267517, 0.24993695318698883, -0.06012597680091858, -0.23785018920898438, 0.14859217405319214, 0.18172761797904968, 0.041314296424388885, 0.36096978187561035, 0.4369722306728363, -0.3914594054222107, 0.18053856492042542, 0.0008859820663928986, -0.13565731048583984, 0.1020042896270752, 0.4487895369529724, 0.2277478575706482, -0.24274903535842896, 0.43111568689346313, 0.15287867188453674, 0.06064943969249725, 0.06606583297252655, 0.39455893635749817, 0.0775158554315567, -0.572917640209198, -0.038338739424943924, -0.027630969882011414, -0.1846924126148224, -0.13530853390693665, -0.1638071984052658, 0.31813573837280273, 0.22013632953166962, -0.05020572617650032, -0.20121128857135773, -0.028757471591234207, -0.13001391291618347, 0.21601969003677368, 0.07456915825605392, -0.18120065331459045, 0.2697630226612091, 0.008672963827848434, 0.05750747397542, 0.029233183711767197, 0.19633643329143524, -0.11056575179100037, -0.3634788393974304, -0.4784756302833557, 0.006503162905573845, 0.207179993391037, 0.04188913106918335, 0.06764277815818787, 0.35026419162750244, -0.17208613455295563, -0.07498210668563843, 0.46883997321128845, 0.431939035654068, -0.07354545593261719, 0.05481524392962456, 0.29819539189338684, -0.11091124266386032, -0.025886036455631256, -0.13881522417068481, -0.30461809039115906, 0.27256959676742554, 0.36287572979927063, -0.14840848743915558, 0.1716829091310501, 0.14497506618499756, -0.1291142702102661, 0.4273584187030792, -0.047518614679574966, 0.448144793510437, -0.27150774002075195, 0.44673287868499756, -0.34891584515571594, -0.10403531789779663, -0.01628584787249565, -0.25366413593292236, -0.18997406959533691, 0.15787768363952637, 0.24722570180892944, -0.043650805950164795, -0.04873689264059067, -0.5262815952301025, 0.1067570149898529, 0.1502937227487564, 0.025527983903884888, 0.4878810942173004, 0.10747109353542328, 0.0826953873038292, -0.1865852177143097, -0.753168523311615, 0.28404495120048523, 0.15559254586696625, -0.0423896461725235, 0.037754058837890625, 0.09617501497268677, -0.12267490476369858, 0.10979306697845459, 0.2580309212207794, 0.28574565052986145, 0.15327954292297363, 0.27968892455101013, -0.3550052046775818, -0.07049520313739777, 0.11803466826677322, 0.2254616916179657, -0.18580304086208344, -0.10396873950958252, 0.4556701183319092, -0.0994691252708435, 0.11661981791257858, -0.02962677925825119, 0.07394948601722717, -0.05162619799375534, -0.19437405467033386, 0.3807736039161682, 0.19126570224761963, 0.29942458868026733, 0.19104254245758057, 0.3264693319797516, -0.4391951560974121, -0.28425803780555725, -0.184640035033226, -0.13463523983955383, -0.03577153757214546, 0.21020236611366272, -0.1798311322927475, -0.3205515444278717, -0.10498955845832825, 0.2001258283853531, -0.09478768706321716, 0.4415297210216522, -0.267381489276886, 0.09817869961261749, -0.22473114728927612, 0.07832693308591843, 0.17560748755931854, 0.07445308566093445, 0.12686991691589355, -0.08307560533285141, -0.15987089276313782, -0.12764057517051697, 0.08442281186580658, -0.4859919548034668, -0.09754587709903717, 0.0031137289479374886, 0.24406403303146362, 0.03015248104929924, -0.3985963463783264, -0.16229888796806335, -0.06414159387350082, 0.327782541513443, -0.042718954384326935, 0.1956714540719986, 0.10172691941261292, 0.012370022013783455, 0.16648392379283905, -0.1707083135843277, 0.21421480178833008, 0.11280274391174316, 0.1816329061985016, 0.21447360515594482, 0.01619468629360199 ]
https://github.com/huggingface/datasets/issues/5000
Dataset Viewer issue for asapp/slue
The dataset is being refreshed, please retry later. <img width="802" alt="Capture d’écran 2022-09-20 à 22 39 46" src="https://user-images.githubusercontent.com/1676121/191360072-7cc86486-4e84-4b47-8f9a-4a69fe84a5ac.png">
### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes
18
Dataset Viewer issue for asapp/slue ### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes The dataset is being refreshed, please retry later. <img width="802" alt="Capture d’écran 2022-09-20 à 22 39 46" src="https://user-images.githubusercontent.com/1676121/191360072-7cc86486-4e84-4b47-8f9a-4a69fe84a5ac.png">
[ -0.5955622792243958, -0.31857913732528687, 0.01972363144159317, 0.4023895263671875, 0.3010101914405823, 0.049223482608795166, 0.1579607129096985, 0.09199504554271698, -0.13056986033916473, 0.10692748427391052, -0.1325240582227707, 0.2549448013305664, -0.009176903404295444, 0.19474008679389954, -0.12452554702758789, -0.12225960195064545, 0.008020631968975067, 0.13419516384601593, 0.24264614284038544, -0.035609304904937744, -0.1825675219297409, -0.028591984882950783, -0.13313326239585876, 0.051885638386011124, -0.032621607184410095, 0.026664450764656067, 0.011807119473814964, 0.04990662634372711, -0.2858460247516632, -0.31018057465553284, 0.16849550604820251, 0.11906489729881287, 0.4475671350955963, 0.14355280995368958, -0.00010502761142561212, -0.021372918039560318, 0.465515673160553, -0.019361821934580803, -0.12487982213497162, 0.05220086872577667, -0.45911315083503723, -0.08734865486621857, 0.13057619333267212, -0.03274592012166977, -0.23923960328102112, 0.020351048558950424, 0.16315025091171265, -0.3574649393558502, 0.4953821897506714, 0.2130734622478485, 0.3347814679145813, -0.13327230513095856, 0.10395331680774689, 0.03272533044219017, -0.0702243372797966, -0.12013503909111023, -0.1668207198381424, -0.10766038298606873, -0.010458037257194519, 0.4158455431461334, -0.0815851017832756, 0.3131984770298004, 0.006406823173165321, 0.08542899787425995, 0.30012816190719604, -0.16057612001895905, -0.010673992335796356, -0.22214484214782715, 0.357429176568985, -0.11318909376859665, 0.7624722719192505, -0.2816659212112427, -0.14198973774909973, 0.1919686198234558, 0.035463348031044006, -0.23203401267528534, 0.13412907719612122, 0.273370623588562, 0.049750085920095444, 0.2478029578924179, -0.05360975116491318, -0.19162636995315552, -0.3015458881855011, -0.014501400291919708, -0.42569178342819214, -0.22634291648864746, -0.25443020462989807, 0.06184301897883415, 0.006467938423156738, -0.1352822631597519, 0.4047397971153259, 0.029864773154258728, -0.22044625878334045, 0.08295296132564545, -0.37936198711395264, 0.03159403055906296, 0.10292378067970276, 0.058626119047403336, -0.07291048765182495, 0.30137956142425537, 0.2480953186750412, 0.31960609555244446, -0.12997418642044067, 0.21245339512825012, 0.1995026022195816, -0.06673754751682281, 0.3292408883571625, 0.21390239894390106, 0.32111746072769165, 0.22244136035442352, 0.15818576514720917, -0.09203708916902542, -0.21486079692840576, -0.3243878185749054, -0.12152300775051117, -0.3548464775085449, 0.24822930991649628, -0.2967700958251953, -0.22646920382976532, 0.14647328853607178, -0.3491118848323822, -0.10790848731994629, -0.11093487590551376, 0.22360405325889587, -0.04128032922744751, 0.25914254784584045, 0.14129240810871124, 0.032888393849134445, -0.2551976442337036, -0.46260255575180054, -0.24714626371860504, -0.04125021770596504, -0.2595400810241699, -0.06760723143815994, 0.091580331325531, -0.39396604895591736, -0.018689725548028946, -0.04456828907132149, -0.4100582003593445, -0.1456184685230255, -0.010873077437281609, -0.09497080743312836, -0.1868608593940735, 0.07963518798351288, 0.1831473708152771, -0.24721473455429077, -0.0695420652627945, -0.06495571881532669, 0.184871107339859, 0.25659164786338806, 0.03832283243536949, -0.06049761921167374, -0.10705740749835968, 0.25085514783859253, -0.01283210888504982, -0.14335650205612183, -0.12388022989034653, 0.1903722733259201, -0.2164713442325592, -0.1908831149339676, -0.10335817188024521, 0.04911142587661743, -0.18547792732715607, -0.05210292339324951, 0.2959604561328888, 0.4543575048446655, -0.5296252965927124, 0.001642078161239624, -0.46771642565727234, -0.4893534481525421, -0.11480211466550827, -0.0242491215467453, 0.09022534638643265, -0.26389798521995544, -0.3471001386642456, -0.19995640218257904, 0.3406444787979126, -0.14649200439453125, -0.5317984819412231, 0.1409740298986435, -0.029580753296613693, -0.21117059886455536, 0.07939663529396057, 0.2590107321739197, 0.07885073870420456, -0.04546041041612625, -0.3802906274795532, 0.18434537947177887, -0.1277029812335968, -0.2175643891096115, -0.24925360083580017, -0.03842828795313835, -0.1702050119638443, 0.26953125, 0.22674430906772614, 0.07309667766094208, 0.3520987033843994, 0.1796892285346985, 0.2212456464767456, 0.2494644820690155, 0.173163041472435, -0.12728531658649445, 0.2593335211277008, 0.141465425491333, -0.05922376736998558, -0.007406085729598999, -0.30482515692710876, -0.0809023529291153, -0.3070198595523834, -0.19328054785728455, -0.04410174489021301, 0.1024494618177414, -0.25201621651649475, -0.12167610228061676, -0.28663527965545654, -0.4254000782966614, 0.1855790913105011, 0.06579162180423737, -0.25568678975105286, 0.11422932147979736, 0.04847406968474388, 0.17277637124061584, -0.03508586063981056, 0.1113310307264328, -0.06454774737358093, 0.6035703420639038, -0.19272436201572418, 0.043762944638729095, 0.1687282919883728, 0.06163269281387329, 0.14595595002174377, 0.006653698161244392, -0.07079236209392548, 0.28752467036247253, 0.23218369483947754, 0.1354217380285263, 0.22880905866622925, 0.007133707404136658, 0.3572133183479309, -0.6272740364074707, 0.3157274127006531, -0.05684704706072807, 0.06646377593278885, -0.03183792904019356, -0.3842814564704895, -0.011929452419281006, 0.06433072686195374, -0.04333912581205368, 0.10144643485546112, 0.3659369945526123, 0.2462184727191925, -0.20478658378124237, 0.12003643065690994, -0.12645190954208374, 0.013460449874401093, 0.011471469886600971, 0.18537257611751556, 0.10510807484388351, -0.5353868007659912, 0.08328215777873993, -0.09018255770206451, 0.1283429116010666, -0.28546780347824097, 0.14959752559661865, -0.2892765700817108, -0.03497599810361862, 0.26562151312828064, 0.0015128366649150848, -0.07647393643856049, 0.23267009854316711, -0.08002312481403351, 0.3231002390384674, 0.09263861179351807, -0.20186226069927216, -0.11878878623247147, 0.03131670877337456, -0.043215516954660416, -0.010696962475776672, 0.21533095836639404, -0.07937616854906082, -0.3217417895793915, -0.05705232173204422, 0.337499737739563, 0.28137215971946716, -0.19988292455673218, -0.27837681770324707, -0.2957524061203003, -0.7804139852523804, -0.2282397449016571, 0.37225133180618286, -0.11596685647964478, -0.26488298177719116, -0.029245588928461075, 0.24344733357429504, 0.15422607958316803, 0.43571317195892334, -0.28742486238479614, 0.5086218118667603, -0.0299485195428133, 0.40328824520111084, -0.22734811902046204, -0.024820899590849876, -0.29067283868789673, 0.20412564277648926, 0.42685407400131226, 0.05644555017352104, 0.39339515566825867, -0.2405264526605606, 0.39941734075546265, -0.5974806547164917, -0.37249764800071716, 0.11569841206073761, 0.18941070139408112, 0.12131347507238388, -0.1281699538230896, -0.07880586385726929, -0.002963416278362274, 0.21940352022647858, 0.206760436296463, -0.060995154082775116, -0.12266451120376587, -0.0606747567653656, 0.08836604654788971, -0.016775889322161674, 0.09277977049350739, -0.2721598148345947, -0.056884340941905975, -0.3500814437866211, -0.1535981446504593, -0.0579686313867569, 0.10726673901081085, -0.20253115892410278, 0.14572030305862427, 0.026651307940483093, 0.044159285724163055, -0.08260203897953033, -0.07954858243465424, -0.06854039430618286, -0.04119516536593437, -0.2027883380651474, -0.4719642102718353, 0.2933397889137268, 0.3048604726791382, 0.06684251874685287, -0.10300915688276291, -0.6026439070701599, -0.40328434109687805, -0.0692041665315628, 0.06015784665942192, 0.13694830238819122, -0.08670183271169662, 0.1560681313276291, 0.12136629223823547, -0.046002574265003204, -0.16519805788993835, -0.4127250611782074, 0.14547091722488403, -0.3335248827934265, 0.1856698840856552, 0.0708237737417221, 0.5005506277084351, 0.15065263211727142, 0.4218313694000244, 0.2990875840187073, -0.19692949950695038, 0.35982251167297363, -0.2107122838497162, 0.2576315999031067, -0.12140677124261856, -0.08006002753973007, 0.422059029340744, 0.12202741205692291, 0.09159871190786362, 0.147308349609375, 0.1930074393749237, -0.16328278183937073, -0.11891761422157288, 0.22225704789161682, -0.14348822832107544, 0.014327917248010635, -0.3594972491264343, -0.24162018299102783, 0.06958053261041641, 0.1418399065732956, -0.019238971173763275, 0.015415750443935394, -0.3378870189189911, 0.008252788335084915, 0.28126683831214905, 0.2596065402030945, 0.11715236306190491, -0.04964461177587509, 0.28087735176086426, -0.15121719241142273, 0.41625428199768066, -0.18079808354377747, 0.3033875823020935, -0.14736759662628174, 0.07460010796785355, 0.37832218408584595, -0.08387691527605057, 0.3425026834011078, -0.34055814146995544, 0.2011791467666626, 0.13163119554519653, -0.02243659272789955, -0.12024371325969696, 0.009242363274097443, 0.04100241884589195, -0.15823712944984436, 0.1374470293521881, 0.00037501752376556396, -0.1732245683670044, -0.08006748557090759, 0.2314814031124115, -0.3004128038883209, -0.1832749992609024, -0.024599451571702957, 0.06719216704368591, -0.05181882157921791, -0.040709927678108215, -0.14725780487060547, -0.2634911835193634, 0.14725713431835175, 0.07418091595172882, 0.048414748162031174, -0.31532561779022217, -0.3377877175807953, 0.0016798973083496094, 0.02626911550760269, 0.40266209840774536, 0.06798552721738815, 0.3102004826068878, 0.28147590160369873, 0.5361418128013611, 0.41241776943206787, 0.712266206741333, -0.05072011426091194, -0.5459186434745789, 0.34847506880760193, -0.05361799895763397, 0.1512487828731537, 0.09150418639183044, 0.017327483743429184, -0.1916700303554535, 0.042430322617292404, 0.07844149321317673, -0.2804948687553406, 0.10857929289340973, 0.15854986011981964, 0.10850253701210022, -0.3011804223060608, -0.5027737021446228, 0.34915709495544434, 0.314493864774704, -0.012367524206638336, 0.04454456642270088, -0.08020806312561035, -0.013823652639985085, 0.054111506789922714, 0.06969574838876724, 0.7267588376998901, -0.01707400381565094, -0.23088610172271729, 0.01718001440167427, -0.548041820526123, -0.011482009664177895, -0.3750529885292053, 0.18741251528263092, -0.4709731340408325, 0.008072344586253166, -0.08194919675588608, -0.025118518620729446, 0.39783430099487305, -0.06052044779062271, 0.0010368712246418, -0.0026645753532648087, 0.1207381933927536, -0.32613933086395264, 0.12559086084365845, 0.3694724142551422, -0.09028103202581406, 0.10736691951751709, -0.045408397912979126, 0.2599601447582245, -0.007664814591407776, 0.0033572055399417877, -0.08908923715353012, -0.0530303493142128, 0.18368050456047058, 0.0009877942502498627, -0.4361652135848999, 0.09611901640892029, -0.004657890647649765, -0.2184067815542221, -0.10095059871673584, -0.4088512659072876, 0.4179142117500305, 0.41273775696754456, -0.05291508138179779, -0.06973861157894135, -0.21025395393371582, 0.32641470432281494, 0.03846059739589691, 0.03158733621239662, 0.17805638909339905, 0.283057302236557, 0.24887776374816895, -0.0969073474407196, 0.0390121266245842, 0.27997785806655884, 0.18859092891216278, -0.18584652245044708, -0.28280389308929443, -0.020387597382068634, 0.15077540278434753, -0.22213654220104218, 0.05694909021258354, -0.16551938652992249, 0.058339815586805344, -0.06722401827573776, 0.20601436495780945, 0.10874540358781815, 0.13823142647743225, -0.07369949668645859, 0.1333884447813034, -0.23658280074596405, -0.06595414876937866, 0.4943615794181824, -0.06196116656064987, -0.12339574843645096, 0.29088154435157776, 0.32465872168540955, -0.12019561231136322, -0.20307469367980957, 0.02195025235414505, 0.25561484694480896, -0.3718213140964508, 0.011577223427593708, -0.04965168610215187, 0.0030800700187683105, 0.1591399908065796, 0.16968810558319092, -0.18701139092445374, -0.15476053953170776, 0.13623099029064178, -0.46865254640579224, 0.04233422875404358, -0.13599465787410736, -0.2611389458179474, 0.1855088174343109, -0.14169344305992126, 0.1164037436246872, 0.197431281208992, 0.07416420429944992, -0.37187930941581726, 0.21545735001564026, -0.017884530127048492, 0.06761595606803894, -0.42170557379722595, 0.09122349321842194, -0.23659275472164154, -0.1586415022611618, 0.17044329643249512, -0.002414792776107788, -0.3947455585002899, -0.18760767579078674, 0.016081854701042175, 0.1266014128923416, 0.1825767159461975, -0.24016748368740082, -0.18398810923099518, -0.09139218181371689, -0.3330202102661133, 0.13605014979839325, -0.0904315710067749, 0.02512247860431671, -0.1812879890203476, -0.02065208926796913, -0.11421239376068115, -0.16769397258758545, 0.16970747709274292, -0.03591189533472061, 0.2272653430700302, 0.46207088232040405, 0.014188466593623161, 0.12065275013446808, 0.14999493956565857, 0.06552451848983765, 0.11287669092416763, 0.09410075843334198, 0.1815287172794342, -0.045118674635887146, 0.37798696756362915, -0.2799568772315979, 0.2388339638710022, 0.21181167662143707, 0.5068584680557251, 0.17961108684539795, -0.22737297415733337, -0.08223854750394821, 0.3721652626991272, 0.24349519610404968, -0.4579499661922455, 0.1688467115163803, 0.23776036500930786, 0.0049635134637355804, -0.04859498515725136, -0.21384114027023315, 0.028560493141412735, 0.29540666937828064, -0.1004725843667984, 0.22011157870292664, 0.5092061161994934, -0.33631038665771484, 0.23827071487903595, 0.13232263922691345, -0.13804839551448822, 0.18342086672782898, 0.40688976645469666, 0.3633088767528534, -0.1095036044716835, 0.42399168014526367, -0.03182709962129593, 0.017551152035593987, -0.05975265055894852, 0.4844735860824585, 0.14103446900844574, -0.5108857750892639, -0.12831969559192657, 0.053403228521347046, -0.1455765962600708, -0.0760803297162056, -0.09292376041412354, 0.32658305764198303, 0.39602288603782654, -0.12836164236068726, -0.1848255842924118, 0.16207382082939148, 0.04103783518075943, 0.16265524923801422, -0.1839863806962967, -0.2226470708847046, -0.0044472962617874146, 0.09104378521442413, 0.024423783645033836, -0.03687679022550583, 0.17792454361915588, 0.07346211373806, -0.3076501488685608, -0.4219522178173065, -0.0905994176864624, 0.1003202348947525, -0.005744501948356628, -0.0008873343467712402, 0.2920844554901123, -0.06451024115085602, 0.008128173649311066, 0.5736222267150879, 0.4518555998802185, -0.044573452323675156, 0.1298818588256836, 0.1867724061012268, -0.07585527747869492, -0.06838113069534302, -0.0392494834959507, -0.21954773366451263, 0.20388151705265045, 0.3849206864833832, -0.08031600713729858, 0.21739673614501953, 0.16028068959712982, -0.13752785325050354, 0.32882118225097656, -0.0705048143863678, 0.2652399241924286, -0.22786763310432434, 0.39512762427330017, -0.21909815073013306, 0.01842018961906433, -0.08851420134305954, -0.33504295349121094, -0.1860664039850235, 0.0036413376219570637, 0.09930716454982758, -0.16097460687160492, -0.023385778069496155, -0.42737630009651184, 0.10740049183368683, 0.08544610440731049, 0.1064835712313652, 0.5503513813018799, 0.07688386738300323, 0.025216706097126007, -0.20615211129188538, -0.6689856052398682, 0.1814059317111969, 0.18188607692718506, -0.25531721115112305, 0.11619918793439865, -0.0007564350962638855, -0.103534035384655, 0.08888614177703857, 0.2955362796783447, 0.2882080674171448, 0.17979781329631805, 0.4338536262512207, -0.23729564249515533, 0.08254668861627579, 0.219417542219162, 0.22945933043956757, -0.23342016339302063, -0.17301756143569946, 0.4218614101409912, -0.19854620099067688, 0.11385608464479446, 0.008368980139493942, 0.054171718657016754, -0.09380975365638733, -0.35577136278152466, 0.40646740794181824, 0.1369163691997528, 0.34125691652297974, 0.04705118387937546, 0.2830727994441986, -0.39798954129219055, -0.26985421776771545, -0.4130822420120239, -0.0878823772072792, 0.04636087641119957, 0.21945209801197052, -0.016053365543484688, -0.3462804853916168, -0.1635134220123291, 0.14191174507141113, -0.11350267380475998, 0.30896246433258057, -0.3065422475337982, 0.05147141218185425, -0.04226308688521385, 0.05318769812583923, 0.12476900219917297, 0.12985911965370178, 0.058172911405563354, 0.045960649847984314, -0.34461337327957153, -0.21733687818050385, 0.14448043704032898, -0.4342085123062134, -0.11222770810127258, 0.08713756501674652, 0.07095862179994583, 0.0018969178199768066, -0.21868079900741577, -0.08868098258972168, 0.016032293438911438, 0.29989534616470337, -0.09691239148378372, 0.16870076954364777, 0.14678046107292175, 0.1465483456850052, 0.09191735088825226, -0.1273900866508484, 0.21574918925762177, 0.15143291652202606, 0.024704324081540108, 0.2076990306377411, 0.047692976891994476 ]
https://github.com/huggingface/datasets/issues/5000
Dataset Viewer issue for asapp/slue
OK. We now have an issue because the dataset cannot be streamed, and the dataset viewer relies on it. Maybe @huggingface/datasets can help: ``` Error code: StreamingRowsError Exception: NotImplementedError Message: Extraction protocol for TAR archives like 'https://public-dataset-model-store.awsdev.asapp.com/users/sshon/public/slue/slue-voxpopuli_v0.2_blind.tar.gz' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead. Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/responses/first_rows.py", line 337, in get_first_rows_response rows = get_rows(dataset, config, split, streaming=True, rows_max_number=rows_max_number, hf_token=hf_token) File "/src/services/worker/src/worker/utils.py", line 123, in decorator return func(*args, **kwargs) File "/src/services/worker/src/worker/responses/first_rows.py", line 65, in get_rows ds = load_dataset( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1739, in load_dataset return builder_instance.as_streaming_dataset(split=split) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1025, in as_streaming_dataset splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)} File "/tmp/modules-cache/datasets_modules/datasets/asapp--slue/adaa0c78233e1a1df9c2f054e690ec5fc3eaf453bd76b80fe5cbe5728e55d9b1/slue.py", line 189, in _split_generators dl_dir = dl_manager.download_and_extract(_DL_URLS[config_name]) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 944, in download_and_extract return self.extract(self.download(url_or_urls)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 907, in extract urlpaths = map_nested(self._extract, path_or_paths, map_tuple=True) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 385, in map_nested return function(data_struct) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 912, in _extract protocol = _get_extraction_protocol(urlpath, use_auth_token=self.download_config.use_auth_token) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 390, in _get_extraction_protocol raise NotImplementedError( NotImplementedError: Extraction protocol for TAR archives like 'https://public-dataset-model-store.awsdev.asapp.com/users/sshon/public/slue/slue-voxpopuli_v0.2_blind.tar.gz' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead. ```
### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes
180
Dataset Viewer issue for asapp/slue ### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes OK. We now have an issue because the dataset cannot be streamed, and the dataset viewer relies on it. Maybe @huggingface/datasets can help: ``` Error code: StreamingRowsError Exception: NotImplementedError Message: Extraction protocol for TAR archives like 'https://public-dataset-model-store.awsdev.asapp.com/users/sshon/public/slue/slue-voxpopuli_v0.2_blind.tar.gz' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead. Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/responses/first_rows.py", line 337, in get_first_rows_response rows = get_rows(dataset, config, split, streaming=True, rows_max_number=rows_max_number, hf_token=hf_token) File "/src/services/worker/src/worker/utils.py", line 123, in decorator return func(*args, **kwargs) File "/src/services/worker/src/worker/responses/first_rows.py", line 65, in get_rows ds = load_dataset( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1739, in load_dataset return builder_instance.as_streaming_dataset(split=split) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1025, in as_streaming_dataset splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)} File "/tmp/modules-cache/datasets_modules/datasets/asapp--slue/adaa0c78233e1a1df9c2f054e690ec5fc3eaf453bd76b80fe5cbe5728e55d9b1/slue.py", line 189, in _split_generators dl_dir = dl_manager.download_and_extract(_DL_URLS[config_name]) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 944, in download_and_extract return self.extract(self.download(url_or_urls)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 907, in extract urlpaths = map_nested(self._extract, path_or_paths, map_tuple=True) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 385, in map_nested return function(data_struct) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 912, in _extract protocol = _get_extraction_protocol(urlpath, use_auth_token=self.download_config.use_auth_token) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 390, in _get_extraction_protocol raise NotImplementedError( NotImplementedError: Extraction protocol for TAR archives like 'https://public-dataset-model-store.awsdev.asapp.com/users/sshon/public/slue/slue-voxpopuli_v0.2_blind.tar.gz' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead. ```
[ -0.5810036659240723, -0.3571327030658722, 0.048230137676000595, 0.4917394518852234, 0.3302585482597351, 0.06502320617437363, -0.01746271178126335, 0.16445019841194153, -0.08153654634952545, 0.14145267009735107, -0.2883176803588867, 0.39679431915283203, -0.12663079798221588, 0.1775650680065155, -0.036841899156570435, -0.31125620007514954, -0.15779605507850647, 0.21128736436367035, 0.2574175000190735, 0.049814194440841675, -0.0474577322602272, 0.025722641497850418, -0.03971454128623009, 0.07310353219509125, 0.14786507189273834, 0.06527625769376755, 0.22738224267959595, -0.0031161755323410034, -0.4689466953277588, -0.18376082181930542, 0.30369383096694946, 0.08230428397655487, 0.5645875930786133, 0.3021549880504608, -0.00011553023796295747, 0.035570159554481506, 0.45909470319747925, -0.1860756129026413, -0.1867874264717102, -0.32492464780807495, -0.3528110086917877, -0.04038151726126671, 0.20677782595157623, -0.03555186092853546, -0.24810796976089478, -0.021413717418909073, 0.1021890863776207, -0.5175294876098633, 0.4627789258956909, 0.26978790760040283, 0.181417316198349, 0.2451600432395935, 0.1604946106672287, 0.10726757347583771, 0.08458366990089417, -0.1910616010427475, -0.21637971699237823, 0.1049564778804779, -0.10026557743549347, 0.3531632423400879, -0.09330453723669052, 0.22482840716838837, -0.026653120294213295, 0.22969847917556763, 0.3411629796028137, -0.07229769229888916, -0.154278963804245, -0.39694082736968994, 0.11865714937448502, 0.1769234538078308, 0.7385222315788269, -0.3078654110431671, -0.37325215339660645, 0.20934349298477173, 0.06663591414690018, -0.33626627922058105, 0.1445019245147705, 0.44594693183898926, -0.07379621267318726, 0.19660842418670654, 0.019360125064849854, -0.19688154757022858, -0.4857236444950104, -0.016861282289028168, -0.23628218472003937, 0.021284736692905426, -0.2516973614692688, -0.058597877621650696, 0.16126485168933868, 0.030612578615546227, 0.4707261025905609, -0.008565153926610947, -0.16899263858795166, 0.058303188532590866, -0.5235235095024109, -0.022980891168117523, 0.0629042536020279, 0.19322051107883453, -0.035158928483724594, 0.38789236545562744, 0.5798486471176147, 0.3114122450351715, -0.13825057446956635, 0.26484453678131104, 0.32057061791419983, 0.04000990465283394, 0.14262156188488007, 0.16087326407432556, 0.22872504591941833, 0.4884290099143982, 0.32763031125068665, -0.22116750478744507, -0.18764573335647583, -0.0701293870806694, -0.1336473971605301, -0.200640469789505, 0.4215209484100342, -0.44665980339050293, -0.17835649847984314, -0.02344948798418045, -0.573170006275177, -0.23938918113708496, -0.08395364880561829, 0.1203768327832222, -0.055489592254161835, 0.32823657989501953, -0.02900860086083412, 0.2771044671535492, -0.05368717014789581, -0.5228443145751953, -0.15252472460269928, 0.039718322455883026, -0.14742863178253174, -0.004041763022542, 0.15605299174785614, -0.5615434050559998, 0.06329473108053207, -0.013636032119393349, -0.3380259871482849, 0.07082174718379974, 0.13741637766361237, -0.27057772874832153, -0.09599984437227249, 0.2141120880842209, 0.302896112203598, -0.12037105113267899, 0.12901481986045837, -0.005221214145421982, 0.024260178208351135, -0.002807989716529846, 0.1318056881427765, -0.3190533518791199, -0.09703251719474792, 0.14594025909900665, -0.22611398994922638, -0.06349319219589233, -0.4238887131214142, 0.13870252668857574, -0.1310328245162964, -0.20990389585494995, -0.19205808639526367, -0.11824840307235718, -0.11536175012588501, -0.0022568306885659695, 0.4287073612213135, 0.4641300439834595, -0.635222315788269, -0.02796846628189087, -0.5366210341453552, -0.5124496221542358, 0.2995913624763489, 0.1303231567144394, 0.0006201990763656795, -0.2167002558708191, -0.22135597467422485, 0.02912525087594986, 0.45675915479660034, 0.010727114975452423, -0.6297715902328491, 0.30034109950065613, -0.02275807037949562, 0.1563548892736435, 0.3674769401550293, 0.014812625013291836, 0.2974105775356293, -0.11040078848600388, -0.16589418053627014, 0.29160910844802856, -0.1747899055480957, -0.31875771284103394, -0.2711396813392639, -0.18200096487998962, -0.11800357699394226, 0.223502054810524, 0.09656377136707306, 0.2648926079273224, 0.24753215909004211, 0.08425723016262054, 0.34866777062416077, 0.1284276396036148, 0.15194445848464966, -0.03180040419101715, 0.2134978324174881, 0.16379880905151367, -0.15089856088161469, -0.1908126175403595, -0.19492298364639282, -0.06162822246551514, -0.3672719895839691, -0.052234381437301636, -0.24570448696613312, 0.011399943381547928, -0.1055021733045578, -0.09029320627450943, -0.23679910600185394, -0.2569352984428406, 0.08956656605005264, 0.12950016558170319, -0.09117795526981354, 0.0006171725690364838, -0.14013786613941193, 0.03493071347475052, 0.07804301381111145, 0.05814015120267868, -0.3556657135486603, 0.5797329545021057, -0.06503012031316757, -0.15722641348838806, 0.3148822784423828, -0.06629819422960281, 0.12784424424171448, -0.08798151463270187, -0.13936105370521545, 0.16234242916107178, 0.017360620200634003, 0.18872565031051636, -0.0514196902513504, 0.07892987877130508, 0.26985347270965576, -0.5353306531906128, 0.3812907040119171, 0.2543652355670929, 0.22020912170410156, 0.046585813164711, -0.2273935079574585, 0.021986648440361023, 0.2127595692873001, 0.18526631593704224, 0.2589297890663147, 0.2651236355304718, 0.3368104100227356, 0.020559828728437424, 0.01408456265926361, -0.16008591651916504, 0.08948259055614471, -0.21089787781238556, 0.10587480664253235, -0.12512831389904022, -0.5217153429985046, 0.1777867078781128, -0.012376878410577774, 0.10115735232830048, -0.33123910427093506, 0.15024437010288239, -0.4058590233325958, -0.09738914668560028, 0.3781304359436035, 0.03937239572405815, 0.25122249126434326, 0.12236583977937698, 0.1401798576116562, 0.24352508783340454, 0.18358772993087769, -0.22459807991981506, 0.037440672516822815, 0.24185976386070251, -0.09189924597740173, 0.030824163928627968, 0.10595759749412537, 0.06256905943155289, -0.27218711376190186, -0.2548700273036957, 0.051639288663864136, 0.2837095558643341, -0.15147852897644043, -0.07401351630687714, -0.54160475730896, -0.7846248149871826, -0.08506165444850922, 0.2169182449579239, 0.09387119114398956, -0.3317790627479553, -0.16626591980457306, 0.5704867243766785, 0.08044855296611786, 0.23244139552116394, -0.2624736428260803, 0.062305063009262085, -0.07389149069786072, 0.22852003574371338, -0.42741233110427856, -0.13082252442836761, -0.0986361876130104, 0.1277257204055786, 0.394802063703537, 0.09005086123943329, 0.3206741213798523, -0.13042737543582916, 0.0701381042599678, -0.5649186968803406, -0.08005676418542862, 0.28268569707870483, 0.11878965049982071, 0.0766485407948494, -0.021996289491653442, 0.06960627436637878, 0.22025473415851593, -0.1283794641494751, 0.21716614067554474, -0.16526907682418823, -0.04356779903173447, 0.2018863409757614, -0.0034037576988339424, 0.12297923117876053, -0.018581058830022812, -0.2995166778564453, -0.09501974284648895, -0.5251824259757996, 0.019994501024484634, 0.08000463247299194, 0.07869195938110352, -0.36491766571998596, 0.02645019441843033, 0.07621661573648453, 0.03755020350217819, -0.11586683988571167, -0.02350771613419056, -0.23324808478355408, 0.3064698278903961, -0.16468293964862823, -0.42803335189819336, 0.2793756127357483, 0.24052520096302032, 0.0992819219827652, 0.16581805050373077, -0.40708988904953003, -0.14717347919940948, -0.05251067876815796, -0.027417033910751343, 0.0832873284816742, -0.10337987542152405, 0.32115480303764343, 0.08437230437994003, 0.08308008313179016, -0.027299636974930763, -0.22545839846134186, 0.011220186948776245, -0.10384055227041245, 0.2016948163509369, 0.14990369975566864, 0.684520423412323, 0.1401543766260147, 0.558194100856781, 0.4495029151439667, 0.03372962027788162, 0.616144061088562, 0.03773827105760574, 0.1465347409248352, -0.07252896577119827, -0.06059948354959488, 0.33217382431030273, -0.11785522103309631, 0.0794004574418068, 0.23539118468761444, 0.04335235059261322, -0.2920323610305786, -0.22844117879867554, 0.11353051662445068, -0.07428792119026184, -0.15431790053844452, -0.22796307504177094, -0.3528544008731842, 0.09785261750221252, 0.04930059239268303, 0.10742215067148209, 0.07753981649875641, -0.2381889522075653, 0.07799793779850006, 0.307348370552063, 0.37112054228782654, 0.2341221123933792, -0.08923906832933426, 0.17163771390914917, -0.3921969532966614, 0.3944799304008484, -0.11244902014732361, 0.25953006744384766, -0.03838077932596207, 0.02591986209154129, 0.3672593832015991, -0.080602265894413, 0.18345284461975098, -0.47188907861709595, 0.20338080823421478, 0.21482227742671967, 0.024500392377376556, -0.006994560360908508, -0.07627631723880768, -0.29142555594444275, -0.09260925650596619, 0.033326588571071625, 0.04470406845211983, -0.42985621094703674, -0.09104342013597488, 0.31322914361953735, -0.1433439552783966, -0.05172840133309364, -0.0043023694306612015, -0.05031900107860565, -0.2283678650856018, 0.022326162084937096, -0.10912119597196579, -0.3340036869049072, 0.21652886271476746, -0.1232428252696991, 0.18881946802139282, -0.22384312748908997, -0.08490188419818878, 0.1357961893081665, 0.1711312234401703, 0.2784232497215271, -0.11931926757097244, 0.13723750412464142, 0.35415118932724, 0.31624776124954224, 0.44769927859306335, 0.72530198097229, 0.09738406538963318, -0.7573485970497131, 0.33420711755752563, 0.025002509355545044, 0.1595717817544937, 0.03429322689771652, -0.05448540672659874, -0.008012861013412476, 0.20511093735694885, 0.09646449983119965, -0.17880183458328247, -0.007323370315134525, 0.269055038690567, -0.10740461200475693, -0.3231565058231354, -0.7310866713523865, 0.2134203016757965, 0.23366211354732513, 0.04968537390232086, -0.04610978811979294, -0.03676964342594147, 0.04423121362924576, 0.1703457087278366, -0.05768261104822159, 0.8461368083953857, -0.0353800430893898, -0.30373984575271606, 0.14784608781337738, -0.34146010875701904, 0.07771255820989609, -0.5184177756309509, 0.1782599538564682, -0.29463696479797363, -0.41269052028656006, -0.13789844512939453, -0.042523905634880066, 0.49354296922683716, 0.04229862242937088, -0.20857709646224976, 0.2942946255207062, -0.02706203982234001, -0.15935856103897095, 0.2765072286128998, 0.344062477350235, -0.2480730414390564, -0.06270839273929596, -0.3313399851322174, 0.13430863618850708, -0.07698918879032135, 0.06112658232450485, 0.007664280012249947, -0.3647133708000183, 0.30197957158088684, -0.09758168458938599, -0.42450547218322754, 0.33232957124710083, -0.1992749273777008, -0.38211214542388916, -0.3852170407772064, -0.548324465751648, 0.536293089389801, 0.32050347328186035, -0.06336574256420135, -0.15654049813747406, -0.25616466999053955, -0.03191344067454338, 0.01019754633307457, -0.025758471339941025, 0.27500811219215393, 0.20373229682445526, 0.2512814998626709, -0.1716298758983612, 0.025228850543498993, 0.43405085802078247, 0.1352645754814148, -0.15561585128307343, 0.04673653841018677, -0.08984556794166565, 0.20601056516170502, -0.22157682478427887, -0.04170820116996765, -0.14405390620231628, -0.02587142586708069, -0.10048140585422516, 0.07450426369905472, 0.06981762498617172, -0.06776051968336105, -0.02800862491130829, -0.21170811355113983, 0.008828260004520416, -0.17639727890491486, 0.5719513297080994, 0.011025533080101013, 0.1325385421514511, 0.30325090885162354, 0.20645259320735931, -0.2102203518152237, -0.16263283789157867, -0.19694969058036804, 0.07883081585168839, -0.38515111804008484, -0.03120647370815277, 0.016408154740929604, 0.02693144977092743, 0.1159358024597168, 0.1728169322013855, -0.11945028603076935, -0.2102717161178589, -0.12025648355484009, -0.47451481223106384, 0.03515790402889252, -0.011348143219947815, -0.2479679435491562, -0.028743479400873184, -0.18445992469787598, 0.16402438282966614, 0.060417212545871735, 0.2110779732465744, -0.283181369304657, 0.0882285088300705, -0.0264741238206625, 0.04798879474401474, -0.23184198141098022, 0.09849777817726135, 0.08608947694301605, -0.10326734185218811, 0.0965236946940422, 0.045332133769989014, -0.39599505066871643, -0.0735873281955719, -0.1176563948392868, 0.16868826746940613, 0.22506162524223328, -0.23520441353321075, -0.13993510603904724, -0.14837655425071716, -0.3821505904197693, 0.024212248623371124, 0.03192650526762009, 0.012962911278009415, -0.03065294772386551, -0.07717332243919373, 0.22541774809360504, 0.07270853966474533, -0.3335877060890198, 0.10559992492198944, 0.05081893131136894, 0.3624812960624695, -0.13884131610393524, 0.049630794674158096, 0.11428674310445786, -0.05757322162389755, -0.013954437337815762, -0.048798657953739166, 0.3891039490699768, 0.03446076065301895, 0.6672697067260742, -0.1844242811203003, 0.0875733345746994, -0.008992398157715797, 0.4839361608028412, 0.38857167959213257, 0.19239327311515808, -0.0019195787608623505, 0.24514493346214294, 0.13620544970035553, -0.38452646136283875, 0.06876987218856812, 0.15283608436584473, 0.12736034393310547, -0.021965105086565018, -0.05163904279470444, -0.12863242626190186, 0.27517256140708923, -0.0024453923106193542, 0.14434558153152466, 0.5006876587867737, -0.1590346097946167, 0.3159560561180115, 0.1915605664253235, 0.07726627588272095, 0.18282835185527802, 0.2813613712787628, 0.30498966574668884, 0.15097692608833313, -0.007406018674373627, -0.15400102734565735, 0.04391301050782204, -0.04569797217845917, 0.2009625881910324, 0.1465340405702591, -0.576792299747467, -0.4824022054672241, 0.04300936311483383, 0.03469252586364746, 0.19516301155090332, -0.11106415092945099, 0.4002065360546112, 0.08414599299430847, 0.02629760466516018, -0.22278621792793274, 0.09282155334949493, 0.16814878582954407, 0.18772196769714355, -0.13829565048217773, -0.14747047424316406, 0.04057539254426956, 0.028148043900728226, -0.04290361329913139, 0.1739991307258606, 0.14834120869636536, 0.15749216079711914, -0.13524754345417023, -0.31290403008461, -0.20829442143440247, 0.12633034586906433, 0.06557612866163254, -0.09552903473377228, 0.28337302803993225, 0.005085580050945282, 0.01988394930958748, 0.22430644929409027, 0.3437716066837311, 0.05525808781385422, 0.1146475151181221, 0.16443073749542236, 0.04609447345137596, 0.026984592899680138, -0.13005957007408142, -0.028919465839862823, 0.08868074417114258, 0.47157177329063416, -0.06529998779296875, 0.27302804589271545, 0.08051491528749466, -0.07296425849199295, 0.38882437348365784, -0.16457097232341766, 0.37394070625305176, -0.24565184116363525, 0.4794033169746399, -0.12465247511863708, -0.055938128381967545, -0.0019868090748786926, -0.42524126172065735, -0.2526092231273651, 0.26564908027648926, -0.07685765624046326, -0.00981724914163351, -0.1129845604300499, -0.3110337555408478, 0.04050888866186142, 0.09028002619743347, 0.11495049297809601, 0.5015867352485657, -0.09467325359582901, -0.12386145442724228, -0.07618634402751923, -0.6681156158447266, 0.13823482394218445, 0.13257184624671936, -0.3057076930999756, 0.08546583354473114, 0.1458822786808014, 0.09775634109973907, 0.36398619413375854, -0.03359474241733551, 0.10749974846839905, 0.10481296479701996, 0.49656572937965393, -0.250088632106781, -0.1345832347869873, 0.1733439564704895, 0.1994713544845581, -0.1680225282907486, -0.24714621901512146, 0.2768687605857849, -0.2762802541255951, 0.00908748060464859, -0.03883020579814911, 0.01930893212556839, -0.03130079060792923, -0.3763384222984314, 0.36534079909324646, 0.1516900658607483, 0.32480180263519287, 0.010263379663228989, 0.23051083087921143, -0.3036014437675476, -0.048570550978183746, -0.49749335646629333, -0.12378235906362534, 0.0472833476960659, 0.39688640832901, -0.023206718266010284, -0.11302746832370758, -0.42997947335243225, 0.4036349356174469, -0.1840001791715622, 0.1192118227481842, -0.353120893239975, 0.18720699846744537, -0.24397823214530945, 0.10635406523942947, 0.1547108292579651, 0.010135333985090256, -0.03912569582462311, -0.015304679982364178, -0.4032953977584839, -0.1606113463640213, 0.41224807500839233, -0.3061356246471405, -0.06328128278255463, 0.08033476024866104, 0.2031795233488083, 0.10607501864433289, -0.25107479095458984, -0.18174146115779877, 0.10076282173395157, 0.23274533450603485, -0.24271902441978455, 0.10651391744613647, 0.19186027348041534, 0.1954076588153839, 0.1097957193851471, -0.1962236911058426, 0.18514898419380188, 0.1716223657131195, -0.16071254014968872, 0.07417148351669312, 0.026473376899957657 ]
https://github.com/huggingface/datasets/issues/5000
Dataset Viewer issue for asapp/slue
Thanks @severo, Do I have to modify the python script to support streaming so that it can be previewed? Is there a document somewhere that I can follow?
### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes
28
Dataset Viewer issue for asapp/slue ### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes Thanks @severo, Do I have to modify the python script to support streaming so that it can be previewed? Is there a document somewhere that I can follow?
[ -0.6203361749649048, -0.4098052382469177, -0.010135514661669731, 0.22220447659492493, 0.20668841898441315, 0.14364978671073914, 0.0723196268081665, 0.12204399704933167, -0.019982019439339638, 0.15276239812374115, -0.1623469740152359, 0.2940070927143097, -0.1585039496421814, 0.36678454279899597, 0.03610510751605034, -0.16581369936466217, 0.04631739482283592, 0.1333986222743988, 0.16869708895683289, 0.11499384045600891, -0.05509323254227638, -0.16867704689502716, -0.1397903561592102, -0.020060919225215912, 0.17102420330047607, 0.002689102664589882, 0.042869776487350464, -0.08491384238004684, -0.2595379054546356, -0.23624305427074432, 0.06624730676412582, 0.3029468059539795, 0.5068776607513428, 0.1894921064376831, -0.00011082550918217748, -0.09237788617610931, 0.47587013244628906, -0.05913623422384262, -0.08736413717269897, 0.05162361264228821, -0.28504881262779236, -0.145345076918602, 0.41085121035575867, -0.023668162524700165, -0.38314446806907654, -0.007915415801107883, 0.23694537580013275, -0.45372599363327026, 0.41169625520706177, 0.17699171602725983, 0.23401276767253876, 0.12799598276615143, -0.030011970549821854, 0.048250529915094376, -0.0427669882774353, -0.14872203767299652, -0.3028281033039093, -0.053368400782346725, 0.15905705094337463, 0.2863805890083313, -0.17415502667427063, 0.18600453436374664, -0.011196941137313843, 0.06910347193479538, 0.32034924626350403, -0.07726997882127762, -0.10072355717420578, -0.4108229875564575, 0.10891129821538925, -0.05794426053762436, 0.8129032850265503, -0.46321621537208557, -0.27597981691360474, 0.13273489475250244, 0.09590623527765274, -0.23848725855350494, -0.01021498441696167, 0.3023299276828766, -0.12552307546138763, 0.2543366551399231, -0.1255650371313095, -0.3402208983898163, -0.3761822283267975, 0.01750143989920616, -0.09943956881761551, 0.21713709831237793, -0.1817064881324768, -0.023894786834716797, -0.12691761553287506, -0.020712118595838547, 0.4335169792175293, 0.021222516894340515, -0.005762156099081039, 0.03773568570613861, -0.2503819763660431, -0.10457500070333481, 0.01777242124080658, 0.024095844477415085, -0.15551656484603882, 0.3128893971443176, 0.3864304721355438, 0.2782686948776245, -0.01970551908016205, 0.2251874804496765, 0.30274471640586853, -0.02650246024131775, 0.26414650678634644, 0.29395413398742676, 0.3860586881637573, 0.38502493500709534, 0.3371737003326416, -0.147903710603714, -0.13698148727416992, -0.17553041875362396, -0.26466771960258484, -0.2742752432823181, 0.4390842318534851, -0.4254550039768219, -0.13131532073020935, 0.12296709418296814, -0.3136325478553772, -0.0972149670124054, -0.037118833512067795, 0.2138306200504303, -0.238377183675766, 0.1972123682498932, 0.05826511234045029, 0.1348494291305542, -0.23141425848007202, -0.30646389722824097, -0.16975146532058716, -0.1165207177400589, -0.16985026001930237, 0.1255786120891571, 0.14502078294754028, -0.39428767561912537, 0.03172936290502548, -0.08301087468862534, -0.08620615303516388, 0.0323697105050087, 0.04064589738845825, 0.1330893635749817, -0.15661543607711792, 0.19909583032131195, 0.3009147346019745, -0.13752558827400208, 0.04779140651226044, 0.06675317883491516, -0.04800495132803917, 0.1541205197572708, 0.22435134649276733, -0.315929651260376, -0.012574432417750359, 0.16401004791259766, -0.263717383146286, -0.20582757890224457, -0.2286258339881897, 0.2796090543270111, -0.23649758100509644, -0.36446186900138855, -0.07228634506464005, 0.042591117322444916, -0.17738968133926392, -0.14504079520702362, 0.42683112621307373, 0.4340878129005432, -0.48382723331451416, -0.008543048053979874, -0.4110165238380432, -0.5189579129219055, 0.10081283748149872, -0.0418444387614727, 0.06218705326318741, -0.49018701910972595, -0.2651903033256531, -0.007607966661453247, 0.43830862641334534, -0.188839852809906, -0.5017750263214111, 0.36581021547317505, -0.14154364168643951, -0.0026422571390867233, 0.29923248291015625, 0.2822358012199402, 0.35331451892852783, -0.26323533058166504, -0.3781206011772156, 0.19799752533435822, -0.07526439428329468, -0.21632646024227142, -0.24164733290672302, -0.09962410479784012, -0.09005817770957947, 0.3233359456062317, 0.12592849135398865, 0.14244499802589417, 0.32874464988708496, 0.09344753623008728, 0.4255199134349823, 0.26377400755882263, 0.119420625269413, -0.19232995808124542, 0.3269517719745636, 0.24286186695098877, -0.16756530106067657, -0.1100551187992096, -0.15645679831504822, -0.24040409922599792, -0.16889606416225433, -0.26912328600883484, -0.11486706137657166, -0.2343408763408661, -0.12902027368545532, -0.03845716640353203, -0.15001456439495087, -0.29792314767837524, 0.13808906078338623, 0.06403756886720657, -0.068910151720047, 0.08083409070968628, -0.11068515479564667, 0.08925902098417282, -0.08925092220306396, 0.06739567965269089, -0.18979401886463165, 0.47771936655044556, 0.0063803791999816895, -0.07442626357078552, 0.33974429965019226, 0.09273745864629745, 0.15556085109710693, 0.11472859978675842, -0.10234338790178299, 0.3671967089176178, 0.018060196191072464, 0.26630061864852905, 0.24328771233558655, 0.26196736097335815, 0.3119625151157379, -0.5894455313682556, 0.4748135805130005, 0.24721282720565796, 0.05760163068771362, -0.013267800211906433, -0.4208495020866394, 0.03411344438791275, 0.05328019708395004, -0.0027907714247703552, 0.2651548981666565, 0.31336989998817444, 0.13255144655704498, 0.058764103800058365, -0.31818997859954834, -0.024362776428461075, 0.0500931516289711, -0.20543721318244934, 0.15789365768432617, -0.13612349331378937, -0.7666845321655273, 0.23766353726387024, -0.13509957492351532, -0.08932235091924667, -0.21136298775672913, 0.07633734494447708, -0.3226501941680908, -0.12770193815231323, 0.39559420943260193, -0.12487807869911194, 0.071204274892807, 0.252009779214859, 0.14750218391418457, 0.38513219356536865, -0.054783277213573456, -0.2605252265930176, -0.05469182878732681, 0.14268434047698975, -0.31053557991981506, -0.12019322067499161, 0.030793845653533936, -0.142492413520813, -0.13848239183425903, -0.0638146847486496, 0.05573810636997223, 0.11530239135026932, -0.3271034359931946, -0.2134392112493515, -0.2251896858215332, -0.8146874904632568, -0.2715283930301666, 0.10378517210483551, 0.17611661553382874, -0.3986561596393585, -0.000952892005443573, 0.39151322841644287, -0.06492747366428375, 0.32322633266448975, -0.2666497528553009, 0.41032546758651733, -0.07324099540710449, 0.29294511675834656, -0.11140970885753632, -0.015318090096116066, -0.17477402091026306, 0.20602434873580933, 0.3614368736743927, 0.1723126918077469, 0.4314953088760376, -0.11163857579231262, 0.2337852269411087, -0.649742841720581, -0.1955028772354126, 0.062167197465896606, 0.1293247938156128, 0.13785435259342194, -0.1643894612789154, -0.021866828203201294, 0.2099621295928955, 0.012055586092174053, 0.042306821793317795, -0.21015088260173798, 0.031448766589164734, -0.06076274812221527, 0.022286847233772278, -0.05394202470779419, 0.018216650933027267, -0.4096451997756958, -0.1139768585562706, -0.5696855187416077, -0.008208602666854858, -0.07506643235683441, 0.08704239130020142, -0.5245770812034607, 0.17309676110744476, 0.058212969452142715, 0.15693965554237366, -0.13263507187366486, 0.04576308652758598, -0.12829075753688812, 0.2961329221725464, -0.44869816303253174, -0.6276789307594299, 0.405528724193573, 0.34835344552993774, -0.0005294308066368103, -0.0047460999339818954, -0.47305452823638916, -0.22124740481376648, 0.06901468336582184, -0.06320039927959442, 0.2015964835882187, 0.009866394102573395, 0.20326928794384003, 0.01845690608024597, 0.08271956443786621, -0.05500595271587372, -0.27279630303382874, -0.14361071586608887, -0.3187885582447052, 0.12045151740312576, 0.07848428934812546, 0.514545738697052, -0.019194049760699272, 0.5917091369628906, 0.45036453008651733, 0.019647419452667236, 0.34781137108802795, -0.1783660650253296, 0.2665942311286926, -0.021106138825416565, 0.004774035885930061, 0.211872860789299, -0.08186335861682892, -0.05813918262720108, 0.3264118432998657, 0.19855517148971558, -0.3429240584373474, -0.14992287755012512, 0.16530798375606537, -0.1361425817012787, -0.06601438671350479, -0.19772769510746002, -0.3612355589866638, 0.08230110257863998, -0.026335004717111588, 0.08214490860700607, 0.07515287399291992, -0.30413922667503357, -0.016114257276058197, 0.3464077413082123, 0.3228274881839752, 0.157528355717659, 0.05094088241457939, 0.14358030259609222, -0.3916042745113373, 0.3448864817619324, -0.21325558423995972, 0.31741899251937866, -0.02441345900297165, -0.17340898513793945, 0.44755566120147705, -0.0969754159450531, 0.2521049380302429, -0.3606204092502594, 0.10323597490787506, 0.12699951231479645, -0.05464250594377518, -0.2038831114768982, 0.005529347807168961, -0.20352263748645782, 0.01443214900791645, 0.10975907742977142, -0.05669844150543213, -0.2066076397895813, -0.04068050906062126, 0.3443681001663208, -0.326261043548584, -0.11180146038532257, -0.09827111661434174, -0.01129871979355812, -0.11426342278718948, -0.0061288028955459595, -0.07904142886400223, -0.29302018880844116, 0.05461760610342026, -0.2738281786441803, 0.025263499468564987, -0.20187345147132874, -0.20094391703605652, 0.04107873514294624, 0.1472887396812439, 0.30861014127731323, -0.07712503522634506, 0.32218295335769653, 0.4528423845767975, 0.4311235845088959, 0.23179525136947632, 0.7117987275123596, 0.20958572626113892, -0.6402604579925537, 0.3672993779182434, 0.05641305074095726, 0.2611357271671295, 0.20226457715034485, -0.05977713316679001, -0.14258891344070435, 0.14408984780311584, 0.11662013083696365, -0.30851274728775024, 0.06578221917152405, 0.17739109694957733, 0.1078547015786171, -0.35210615396499634, -0.7755357623100281, 0.4525035321712494, 0.2976469397544861, -0.08053729683160782, 0.0851588249206543, -0.11369210481643677, -0.013634605333209038, 0.001458517275750637, -0.01911468803882599, 0.7757231593132019, 0.09308762848377228, -0.13544031977653503, 0.16044211387634277, -0.5296283960342407, -0.1278255134820938, -0.5545729398727417, 0.07177488505840302, -0.3642456531524658, -0.11437518894672394, -0.03977169096469879, 0.01552576944231987, 0.4669920802116394, -0.0734054297208786, -0.20088700950145721, 0.18536607921123505, 0.0956794023513794, -0.21113556623458862, 0.08556199073791504, 0.3221798837184906, -0.20344766974449158, 0.036535102874040604, -0.21830834448337555, 0.17771483957767487, -0.0040773265063762665, 0.0245492085814476, 0.012517791241407394, -0.1628422886133194, 0.14544984698295593, -0.06456664204597473, -0.5107629299163818, 0.16957122087478638, 0.10295043140649796, -0.3964182734489441, -0.33019328117370605, -0.39795273542404175, 0.5094450116157532, 0.5323173403739929, -0.2155403345823288, 0.032541655004024506, -0.3024883568286896, 0.07915139198303223, -0.04032221436500549, 0.003003656165674329, 0.1871749311685562, 0.24541515111923218, 0.17974622547626495, -0.18540644645690918, 0.0309121236205101, 0.47685375809669495, 0.2449018657207489, -0.21875262260437012, -0.17307107150554657, -0.10571207106113434, 0.10969740152359009, -0.2991192638874054, -0.0889686644077301, -0.1279761791229248, -0.025643140077590942, -0.026743320748209953, 0.15519921481609344, 0.07062476873397827, -0.17742183804512024, 0.06161504238843918, 0.0028983652591705322, 0.025218583643436432, -0.13214938342571259, 0.508495569229126, -0.06772316992282867, -0.08711211383342743, 0.20852316915988922, 0.3861854672431946, -0.15957826375961304, -0.12686830759048462, -0.1320061832666397, 0.1711239069700241, -0.06739648431539536, -0.07721360772848129, -0.13467974960803986, 0.04769301414489746, 0.10469074547290802, 0.15977627038955688, -0.16130061447620392, -0.10322178155183792, -0.0939345434308052, -0.32545387744903564, -0.1210198923945427, -0.043583355844020844, -0.004545930773019791, 0.19513270258903503, -0.2246391773223877, 0.004442382603883743, 0.18923228979110718, 0.09637309610843658, -0.3192824721336365, -0.07665923982858658, 0.0008908752351999283, 0.010451387614011765, -0.1542808711528778, 0.34333938360214233, -0.030927056446671486, -0.060312822461128235, 0.09771668165922165, 0.025818511843681335, -0.34202221035957336, -0.09312302619218826, 0.07172392308712006, 0.15889707207679749, 0.18769434094429016, -0.2457359880208969, -0.175120010972023, -0.13004474341869354, -0.3722350001335144, 0.08208979666233063, -0.03385009616613388, 0.07140187174081802, -0.04620921611785889, -0.0523521788418293, 0.23668071627616882, -0.13077670335769653, -0.004774309694766998, 0.09206672757863998, 0.10174600034952164, 0.43994784355163574, 0.02801947295665741, 0.06510038673877716, 0.16775062680244446, -0.06013753265142441, 0.2921494245529175, -0.07072340697050095, 0.3608453869819641, 0.03774159774184227, 0.4033331573009491, -0.10072392225265503, 0.2913537323474884, 0.09338334202766418, 0.6514185667037964, 0.2964329123497009, -0.02443706803023815, -0.07549526542425156, 0.39975547790527344, 0.17412462830543518, -0.3436993956565857, 0.1258891224861145, 0.18070697784423828, 0.09620452672243118, 0.007428135722875595, -0.14421877264976501, -0.00047804415225982666, 0.4051740765571594, -0.0831359475851059, 0.20970982313156128, 0.35504183173179626, -0.04792207479476929, 0.4109191596508026, 0.16941562294960022, -0.14426422119140625, 0.11114247143268585, 0.06035587191581726, 0.39092281460762024, -0.07030310481786728, 0.3230326175689697, -0.07699716836214066, 0.11312773823738098, 0.0445539653301239, 0.39360085129737854, 0.12937012314796448, -0.4227234125137329, -0.25269198417663574, -0.18468737602233887, -0.15120446681976318, 0.1191549003124237, -0.09704950451850891, 0.30633440613746643, 0.14455437660217285, 0.03717697039246559, -0.12367502599954605, 0.06673473119735718, 0.138534814119339, 0.08928993344306946, -0.11192123591899872, -0.13307562470436096, 0.10461504757404327, 0.10968562960624695, 0.09894082695245743, -0.054962702095508575, 0.0923137217760086, 0.09785689413547516, -0.10388591885566711, -0.3031572997570038, 0.13572560250759125, 0.04642922803759575, 0.1885502189397812, 0.046486783772706985, 0.21729934215545654, -0.08597610890865326, 0.08258557319641113, 0.45919618010520935, 0.23882074654102325, 0.10172711312770844, 0.12709887325763702, 0.0386359877884388, 0.071176677942276, 0.04853810742497444, -0.13859817385673523, 0.05581463873386383, 0.19385193288326263, 0.4708929657936096, 0.005618773400783539, 0.15196290612220764, 0.1270926296710968, -0.13560543954372406, 0.5397455096244812, -0.2137094885110855, 0.21242304146289825, -0.23566889762878418, 0.5179599523544312, -0.2090156376361847, -0.09992372989654541, -0.07417576014995575, -0.4323270618915558, -0.3428478538990021, 0.026580698788166046, 0.11525870859622955, 0.007121815346181393, -0.08958511054515839, -0.5080087780952454, 0.06031697988510132, 0.23291616141796112, 0.2973797619342804, 0.47935301065444946, 0.26036566495895386, 0.09688901156187057, -0.16060958802700043, -0.6657847762107849, 0.16916875541210175, 0.2448408454656601, -0.31278812885284424, -0.002200470305979252, 0.0027436185628175735, -0.045954592525959015, 0.3887827396392822, 0.011339083313941956, 0.21604636311531067, 0.1256803423166275, 0.5308312773704529, -0.04194210097193718, -0.07934105396270752, 0.022755742073059082, 0.2992393374443054, -0.2058926373720169, -0.10837435722351074, 0.31542009115219116, -0.15387552976608276, 0.046435125172138214, -0.05250883102416992, 0.1283264309167862, -0.036133479326963425, -0.38006749749183655, 0.31305938959121704, 0.062028951942920685, 0.4663291871547699, 0.016355324536561966, 0.2109939157962799, -0.46182799339294434, -0.14914478361606598, -0.3879198133945465, -0.13984307646751404, -0.12024931609630585, 0.22577530145645142, -0.07265850156545639, -0.35066866874694824, -0.2006564438343048, 0.16351239383220673, -0.1860094517469406, 0.14520081877708435, -0.1927679032087326, -0.12124641239643097, -0.11431209743022919, -0.005705023184418678, 0.21164047718048096, 0.15487733483314514, -0.08798015117645264, -0.010712926276028156, -0.23857778310775757, -0.15807607769966125, 0.2133999615907669, -0.4518195688724518, -0.0723792314529419, -0.014418108388781548, 0.1340353935956955, 0.1008525937795639, -0.165985569357872, -0.24029237031936646, 0.05169684439897537, 0.1467822790145874, -0.22226831316947937, 0.3806803524494171, 0.304389625787735, 0.16539540886878967, 0.059068839997053146, -0.21306605637073517, 0.2929280400276184, 0.10735531151294708, 0.13089564442634583, 0.08699269592761993, -0.2708737850189209 ]
https://github.com/huggingface/datasets/issues/5000
Dataset Viewer issue for asapp/slue
Hi @fwu-asapp thanks for reporting, and thanks @severo for the investigation. As explained by @severo, the preview requires that your dataset loading script supports streaming. There are several options here: - the easiest would be to replace the source files, archived using ZIP instead TAR: the TAR format does not allow random access while streaming, but only sequential access; the ZIP files support streaming out of the box. - alternatively, to stream TAR archives you can use `dl_manager.iter_archive`: the only prerequisite is that your "index" files (.tsv) should have been archived before their corresponding audio files, so while iterating the content of the TAR archive, the metadata files appear first. I think this is the case for voxpopuli tar but not for voxceleb. - if your .tsv files were not archived before their corresponding audio files (I think this is the case for voxceleb), then you should extract the .tsv files and host them separately (you can host them on the same Hugging Face Hub). - you can take as example, e.g.: https://huggingface.co/datasets/vivos/blob/main/vivos.py As an advanced approach, you can handle both streaming and non-streaming cases separately. - as for example: https://huggingface.co/datasets/librispeech_asr/blob/main/librispeech_asr.py or https://huggingface.co/datasets/google/fleurs/blob/main/fleurs.py See related discussion: - https://github.com/huggingface/datasets/issues/4697#issuecomment-1191502492
### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes
198
Dataset Viewer issue for asapp/slue ### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes Hi @fwu-asapp thanks for reporting, and thanks @severo for the investigation. As explained by @severo, the preview requires that your dataset loading script supports streaming. There are several options here: - the easiest would be to replace the source files, archived using ZIP instead TAR: the TAR format does not allow random access while streaming, but only sequential access; the ZIP files support streaming out of the box. - alternatively, to stream TAR archives you can use `dl_manager.iter_archive`: the only prerequisite is that your "index" files (.tsv) should have been archived before their corresponding audio files, so while iterating the content of the TAR archive, the metadata files appear first. I think this is the case for voxpopuli tar but not for voxceleb. - if your .tsv files were not archived before their corresponding audio files (I think this is the case for voxceleb), then you should extract the .tsv files and host them separately (you can host them on the same Hugging Face Hub). - you can take as example, e.g.: https://huggingface.co/datasets/vivos/blob/main/vivos.py As an advanced approach, you can handle both streaming and non-streaming cases separately. - as for example: https://huggingface.co/datasets/librispeech_asr/blob/main/librispeech_asr.py or https://huggingface.co/datasets/google/fleurs/blob/main/fleurs.py See related discussion: - https://github.com/huggingface/datasets/issues/4697#issuecomment-1191502492
[ -0.47688615322113037, -0.4940895438194275, 0.09501074254512787, 0.3349086046218872, 0.40994375944137573, 0.018746912479400635, 0.01012340560555458, 0.09197352826595306, 0.009273864328861237, 0.21212856471538544, -0.4385012686252594, 0.17202800512313843, -0.13517701625823975, 0.3168143332004547, 0.048527829349040985, -0.2560340464115143, -0.03329984098672867, 0.11702105402946472, 0.08139101415872574, 0.09686493873596191, -0.08456672728061676, 0.04600270837545395, -0.06781413406133652, 0.0430486798286438, 0.043710920959711075, 0.18819329142570496, 0.0353599488735199, 0.05359455198049545, -0.348795622587204, -0.3271197974681854, 0.124709352850914, 0.2665286958217621, 0.4158473610877991, 0.3701857626438141, -0.00011055043432861567, 0.09621226787567139, 0.4522184729576111, -0.1024455726146698, -0.22493326663970947, -0.2209601253271103, -0.06056951358914375, 0.12142358720302582, 0.1340588480234146, 0.1283426582813263, -0.40410277247428894, -0.06464208662509918, 0.12643954157829285, -0.579841673374176, 0.4751100540161133, 0.07503710687160492, 0.2175452709197998, 0.3973671793937683, -0.033107656985521317, -0.02296467125415802, 0.25800812244415283, -0.14738410711288452, -0.2373979091644287, 0.04832515865564346, -0.10141776502132416, 0.2524298131465912, -0.17178824543952942, 0.3029499351978302, 0.013703962787985802, 0.04539206624031067, 0.4148971140384674, 0.04463041573762894, -0.17573457956314087, -0.38769564032554626, 0.03849129378795624, 0.17942717671394348, 0.7670701742172241, -0.43352752923965454, -0.373309463262558, 0.018460899591445923, 0.1494915932416916, -0.13056319952011108, 0.06845814734697342, 0.16586725413799286, -0.031158823519945145, 0.233737513422966, -0.15387864410877228, -0.16834814846515656, -0.1824464648962021, -0.032015249133110046, 0.012164570391178131, -0.10536593198776245, -0.27772945165634155, 0.030572064220905304, 0.27425244450569153, -0.16675050556659698, 0.2183315008878708, 0.04406707361340523, -0.04422382637858391, 0.19310379028320312, -0.3544063866138458, -0.12597189843654633, 0.08055786043405533, -0.09957299381494522, 0.11006192117929459, 0.37145423889160156, 0.5982604622840881, 0.22069132328033447, -0.19486789405345917, 0.1932036578655243, 0.17558220028877258, 0.1655556708574295, 0.33132240176200867, 0.034968551248311996, 0.37205779552459717, 0.3818240165710449, 0.4219627380371094, -0.24421894550323486, -0.25916287302970886, -0.12172693759202957, -0.45281362533569336, -0.09670180082321167, 0.363006055355072, -0.44924888014793396, -0.2042323499917984, 0.0996924638748169, -0.2565721273422241, -0.029953544959425926, 0.013983724638819695, 0.3864717185497284, -0.11943107843399048, 0.05606399476528168, 0.04351063817739487, 0.26799389719963074, -0.2399337887763977, -0.22354252636432648, -0.20547112822532654, -0.10979139804840088, -0.1748097687959671, 0.23406651616096497, 0.30634361505508423, -0.48321908712387085, 0.16484037041664124, -0.0593683198094368, 0.030774690210819244, 0.06190162152051926, -0.08313236385583878, -0.11588902771472931, -0.05661805719137192, 0.20862515270709991, 0.19121438264846802, 0.10683275014162064, 0.035019759088754654, 0.09208843111991882, -0.01909325271844864, 0.018180344253778458, 0.13786543905735016, -0.27762630581855774, 0.15775597095489502, 0.16399526596069336, -0.31953614950180054, 0.029993372038006783, -0.36789989471435547, 0.17816892266273499, -0.26730409264564514, -0.42636701464653015, -0.09661900252103806, 0.13589578866958618, -0.23628288507461548, 0.00960602704435587, 0.559997022151947, 0.6303481459617615, -0.4422411322593689, -0.1699073314666748, -0.32411059737205505, -0.4023917317390442, -0.013683922588825226, 0.0685090571641922, -0.013316546566784382, -0.43198636174201965, -0.3967287540435791, 0.15562638640403748, -0.02039400488138199, -0.24185344576835632, -0.5378583073616028, 0.2342352718114853, -0.1933789700269699, 0.1837010532617569, 0.20257583260536194, 0.12328319996595383, 0.2201002687215805, -0.2701414227485657, -0.2473703920841217, 0.2738730311393738, 0.12312638014554977, -0.021948274224996567, -0.2688327133655548, -0.10970942676067352, -0.23073701560497284, 0.26965266466140747, -0.21844999492168427, 0.08889704942703247, 0.1678677201271057, -0.02505541406571865, 0.28006911277770996, 0.21074309945106506, 0.12165366113185883, -0.03960607945919037, 0.13144738972187042, 0.18695899844169617, -0.14848074316978455, -0.0721205323934555, -0.4346746802330017, 0.07766412943601608, -0.23705148696899414, -0.05731368809938431, -0.13228878378868103, -0.3136385679244995, -0.18641144037246704, -0.1071765124797821, -0.25617751479148865, -0.3365674912929535, 0.13451442122459412, 0.2687003016471863, -0.014258429408073425, 0.09571875631809235, -0.08836913108825684, -0.12066543847322464, 0.19679869711399078, 0.09092479199171066, -0.3189304769039154, 0.5747416019439697, 0.011949252337217331, 0.08785747736692429, 0.3760799467563629, 0.04421617463231087, 0.2389782965183258, -0.08602503687143326, -0.0837358832359314, 0.580098569393158, -0.03585793450474739, 0.4272516369819641, -0.007707253098487854, -0.0064373016357421875, 0.3416416049003601, -0.4860842823982239, 0.2595761716365814, 0.21568794548511505, 0.18668396770954132, -0.01638013869524002, -0.32926416397094727, 0.16830860078334808, 0.021291807293891907, 0.1936144232749939, 0.2904101014137268, 0.13040105998516083, 0.10144113004207611, 0.09281153976917267, -0.2886400520801544, -0.08495522290468216, 0.07085826992988586, -0.10395093262195587, 0.3148050606250763, 0.005165398120880127, -0.49405208230018616, 0.1754109114408493, 0.12578962743282318, 0.008497104048728943, -0.3277575671672821, 0.01860760897397995, -0.47803354263305664, -0.06622505187988281, 0.3505619466304779, -0.11422359943389893, 0.17061519622802734, 0.21740521490573883, 0.10202380269765854, 0.2817971408367157, 0.11531185358762741, -0.19885970652103424, -0.025004111230373383, 0.08554477244615555, -0.12075430899858475, 0.11342667043209076, 0.0313919298350811, -0.06625131517648697, -0.43868088722229004, -0.18594495952129364, 0.07916148006916046, 0.12084775418043137, -0.3253718912601471, -0.17948593199253082, -0.2771872282028198, -0.8505998253822327, -0.18117699027061462, -0.03232274204492569, -0.09955295920372009, -0.27377668023109436, 0.023450791835784912, 0.42831727862358093, -0.19876313209533691, 0.369130402803421, 0.07354560494422913, 0.3724050521850586, -0.010869843885302544, 0.16969768702983856, -0.29527562856674194, 0.04867494851350784, -0.1371801793575287, 0.10859519243240356, 0.3611440360546112, 0.1564902514219284, 0.20122496783733368, -0.06485211104154587, 0.16269183158874512, -0.552058756351471, -0.10717437416315079, 0.1777293086051941, 0.03756387159228325, 0.1851641833782196, -0.09115093946456909, 0.09312515705823898, 0.14535270631313324, -0.022641895338892937, 0.15196958184242249, -0.22030778229236603, -0.04049369692802429, 0.08753164857625961, 0.22710587084293365, -0.025650227442383766, -0.14423024654388428, -0.3871588706970215, -0.1309921145439148, -0.5949603319168091, 0.10585150122642517, -0.16198836266994476, 0.016530923545360565, -0.1324446201324463, 0.043556079268455505, -0.04046979546546936, 0.011915336363017559, -0.056098684668540955, -0.10038034617900848, -0.294247031211853, 0.1794390082359314, -0.41708487272262573, -0.4858103096485138, 0.2028135359287262, 0.39245957136154175, 0.047416236251592636, -0.0107070691883564, -0.3847534656524658, -0.08768953382968903, -0.0549355149269104, -0.1749493032693863, 0.22301225364208221, -0.0586407333612442, 0.23948757350444794, 0.08866498619318008, 0.05863955616950989, -0.018601156771183014, -0.28569889068603516, -0.05582446604967117, -0.24597984552383423, -0.03203951567411423, 0.018122432753443718, 0.4222336411476135, 0.05998371168971062, 0.573398232460022, 0.3795127272605896, 0.09361328184604645, 0.35306909680366516, -0.16547301411628723, 0.37411898374557495, -0.22620931267738342, -0.05023626983165741, 0.3157861530780792, -0.10639172792434692, 0.010717522352933884, 0.46246862411499023, 0.22339650988578796, -0.0017526410520076752, -0.24907973408699036, 0.24390190839767456, 0.009042646735906601, -0.16555118560791016, -0.25024521350860596, -0.11298158764839172, 0.00695955753326416, 0.10571575164794922, 0.21185976266860962, 0.10699999332427979, -0.2631474435329437, 0.1220339983701706, 0.257967472076416, 0.41525158286094666, 0.23121094703674316, -0.20742811262607574, 0.2876840829849243, -0.5676828026771545, 0.35482877492904663, -0.12829837203025818, 0.2656668722629547, -0.05703127011656761, -0.247706800699234, 0.32784342765808105, -0.008140478283166885, 0.32759687304496765, -0.24826423823833466, 0.16030007600784302, 0.07946877181529999, 0.003873724490404129, -0.3329840898513794, -0.009808089584112167, -0.11151352524757385, 0.028942037373781204, -0.023623760789632797, 0.3557818830013275, -0.41329336166381836, -0.1308036595582962, 0.17073571681976318, -0.09420574456453323, 0.07122641801834106, -0.06355763971805573, -0.0451241098344326, -0.03535601869225502, -0.08224939554929733, -0.07609973102807999, -0.2592291831970215, 0.01655656471848488, -0.30437955260276794, 0.058374788612127304, -0.04498065263032913, -0.20690006017684937, 0.11187375336885452, 0.2889266014099121, 0.4324159622192383, -0.037337448447942734, 0.4650057256221771, 0.6416844129562378, 0.1618846356868744, 0.3768727779388428, 0.8849600553512573, 0.06989698112010956, -0.6208456754684448, 0.22840309143066406, 0.04417881742119789, 0.042081236839294434, 0.2548786401748657, -0.00020882044918835163, 0.04811957851052284, 0.0264587365090847, 0.12492819130420685, -0.4296214282512665, 0.11059869825839996, 0.282747745513916, 0.08053506910800934, -0.2769615948200226, -0.6313689947128296, 0.44640296697616577, 0.20245684683322906, -0.15811865031719208, -0.09099380671977997, 0.0926399752497673, 0.05531960725784302, 0.17220138013362885, -0.28003618121147156, 0.8408392071723938, -0.09070821106433868, -0.04788943752646446, 0.28774288296699524, -0.12386535853147507, 0.0415506437420845, -0.3756142854690552, 0.19199524819850922, -0.30753740668296814, -0.5288335680961609, -0.05843992531299591, 0.08673813939094543, 0.23110881447792053, 0.044672783464193344, -0.22160181403160095, 0.12611256539821625, 0.03285757452249527, -0.055001337081193924, 0.031370531767606735, 0.30088603496551514, -0.20416095852851868, -0.23226319253444672, -0.2537744641304016, 0.1750023514032364, 0.05299418047070503, 0.30205658078193665, 0.13003316521644592, -0.18861842155456543, 0.15112178027629852, -0.12650302052497864, -0.22230461239814758, 0.35073453187942505, -0.04411247372627258, -0.36994051933288574, -0.27952221035957336, -0.2717747390270233, 0.39104217290878296, 0.3088963031768799, -0.21087966859340668, 0.22969263792037964, -0.2681792974472046, 0.12132258713245392, 0.05708873271942139, 0.11596754193305969, 0.019493529573082924, 0.10153893381357193, 0.09352678805589676, -0.041930533945560455, -0.016250520944595337, 0.3880966603755951, 0.1700528860092163, -0.02869581989943981, -0.21701186895370483, -0.20021052658557892, 0.030041910707950592, -0.26854559779167175, -0.03479991853237152, -0.06919105350971222, -0.06681503355503082, -0.11308102309703827, 0.09884877502918243, -0.0293402299284935, -0.13524401187896729, -0.22618991136550903, -0.009909968823194504, -0.06463859975337982, -0.0170273594558239, 0.6340242624282837, -0.19941446185112, -0.00101432204246521, 0.2809978127479553, 0.2399635761976242, -0.16104373335838318, -0.1289493888616562, -0.21172508597373962, 0.21732740104198456, -0.51241534948349, -0.0009105950593948364, -0.016675321385264397, 0.045619770884513855, 0.12952223420143127, 0.2457563728094101, -0.04845479875802994, -0.3246660828590393, -0.01614248752593994, -0.32369789481163025, -0.06540293991565704, 0.13465486466884613, -0.01051279529929161, 0.3140045702457428, -0.020984800532460213, 0.09944932162761688, 0.008199328556656837, 0.07338926196098328, -0.31513792276382446, 0.09552157670259476, -0.01981150172650814, 0.03486703708767891, -0.0053081512451171875, 0.10964277386665344, 0.16141143441200256, -0.1954089105129242, 0.10059499740600586, 0.07928815484046936, -0.45609477162361145, -0.062261488288640976, -0.091854989528656, 0.13840623199939728, 0.1508018970489502, -0.22317978739738464, -0.17669454216957092, -0.050688836723566055, -0.23955616354942322, -0.1640090048313141, 0.23390087485313416, 0.18347886204719543, -0.06409955024719238, -0.13390256464481354, 0.0364217534661293, -0.12007258087396622, -0.07956227660179138, 0.2533019781112671, 0.1595776379108429, 0.2384771853685379, 0.01412198320031166, 0.07844597101211548, -0.19426007568836212, -0.1270221471786499, 0.13071995973587036, 0.1307600438594818, 0.33957988023757935, 0.09347425401210785, 0.4183386266231537, -0.13146193325519562, 0.18025392293930054, 0.022417906671762466, 0.7655539512634277, 0.2873138189315796, -0.007990743964910507, -0.14540959894657135, 0.3915288746356964, 0.17542074620723724, -0.41031166911125183, 0.015230346471071243, -0.005152687430381775, 0.04451104998588562, 0.1649465411901474, -0.08211963623762131, -0.032953739166259766, 0.2999017536640167, 0.07058494538068771, 0.15672782063484192, 0.44849371910095215, 0.16998110711574554, 0.3214489817619324, 0.1275257170200348, -0.1940087527036667, 0.10028553009033203, 0.1257498562335968, 0.1604490578174591, 0.04173624515533447, 0.18447542190551758, -0.35458609461784363, 0.0823582112789154, -0.10070206969976425, 0.2973037362098694, 0.08755353838205338, -0.7056808471679688, -0.27910947799682617, 0.11897324025630951, 0.04634912684559822, 0.18460708856582642, -0.06597763299942017, 0.5460651516914368, -0.009968620724976063, -0.085977703332901, -0.11297332495450974, 0.23065122961997986, 0.16276705265045166, -0.06286320090293884, -0.0816306322813034, -0.16076257824897766, -0.03610583394765854, 0.16442273557186127, -0.07935723662376404, -0.038681551814079285, 0.09092012047767639, 0.04740069806575775, -0.04091969132423401, -0.27756065130233765, -0.2264253795146942, 0.14269164204597473, 0.11686138063669205, -0.02864747680723667, 0.34029439091682434, -0.023985102772712708, 0.08481115847826004, 0.43104037642478943, 0.2666436433792114, 0.10808929800987244, 0.11413893848657608, 0.16834956407546997, 0.12319114059209824, -0.03643838316202164, -0.04414431005716324, 0.054884277284145355, 0.010996785014867783, 0.2885167598724365, -0.16764140129089355, 0.35496485233306885, 0.07488777488470078, -0.17468740046024323, 0.1770523488521576, -0.09864047169685364, 0.5302021503448486, -0.3105083107948303, 0.11193011701107025, -0.40107280015945435, 0.07732889801263809, -0.10494592785835266, -0.3654601275920868, -0.43302616477012634, -0.04887893795967102, 0.011243167333304882, -0.01015368290245533, 0.02575734630227089, -0.3411887586116791, 0.06360035389661789, 0.15291224420070648, 0.23728179931640625, 0.4468578100204468, 0.005154825747013092, -0.08128950744867325, -0.19079875946044922, -0.8241667151451111, 0.10941263288259506, 0.2139265090227127, -0.13867036998271942, -0.017259294167160988, -0.028462890535593033, 0.1004006639122963, 0.3148638606071472, -0.04505068063735962, 0.11344011127948761, 0.045290328562259674, 0.3631974756717682, -0.11806271970272064, -0.036677051335573196, -0.18644402921199799, 0.17341068387031555, -0.09431091696023941, -0.2646811306476593, 0.18994207680225372, -0.10346362739801407, 0.03333675116300583, 0.042385078966617584, 0.2781566083431244, -0.2460743635892868, -0.4351211190223694, 0.36002275347709656, -0.005344359204173088, 0.33554500341415405, -0.01738099381327629, 0.14965392649173737, -0.4221900403499603, -0.18050464987754822, -0.30378270149230957, -0.21358418464660645, 0.146993026137352, 0.4496576189994812, -0.004398409277200699, -0.195913165807724, -0.3942054212093353, 0.2279319167137146, 0.050946056842803955, 0.18518491089344025, -0.33096638321876526, 0.14160999655723572, -0.2670796811580658, 0.02604473941028118, 0.0952155739068985, 0.18141132593154907, -0.04909231513738632, -0.12006808072328568, -0.27328813076019287, -0.3057744801044464, 0.6067568063735962, -0.2560470700263977, 0.07163771986961365, 0.05518420413136482, 0.21293479204177856, 0.07889530062675476, -0.3340455889701843, -0.3152160942554474, 0.15636518597602844, 0.057472217828035355, -0.11341086775064468, 0.030671995133161545, 0.2001451551914215, -0.14743395149707794, -0.14889653027057648, -0.22341488301753998, 0.41616880893707275, 0.3573005199432373, -0.10543276369571686, 0.2427850365638733, -0.26921766996383667 ]
https://github.com/huggingface/datasets/issues/5000
Dataset Viewer issue for asapp/slue
Thanks @albertvillanova for your clarification. I'll talk to my collaborators to see if we can replace those files. Let me just close this issue for now.
### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes
26
Dataset Viewer issue for asapp/slue ### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes Thanks @albertvillanova for your clarification. I'll talk to my collaborators to see if we can replace those files. Let me just close this issue for now.
[ -0.48646342754364014, -0.28812575340270996, -0.024445073679089546, 0.3185844421386719, 0.3820769190788269, 0.09221500903367996, 0.1451212465763092, 0.1452311873435974, -0.07332322746515274, 0.20413056015968323, -0.22960598766803741, 0.2834063470363617, -0.13211236894130707, 0.24041412770748138, -0.07294114679098129, -0.12498204410076141, 0.0033921003341674805, 0.18096068501472473, 0.17599037289619446, 0.05708114802837372, -0.18610218167304993, 0.07345545291900635, -0.02014898881316185, 0.2633776366710663, 0.07638146728277206, 0.06805603951215744, 0.06459712237119675, 0.09233837574720383, -0.24859996140003204, -0.2334350198507309, 0.18851003050804138, 0.0618070624768734, 0.3578459918498993, 0.104485422372818, -0.00009518720617052168, 0.09849381446838379, 0.47244954109191895, -0.07411894202232361, 0.0033787954598665237, 0.11083324998617172, -0.3279910385608673, -0.07211670279502869, 0.10427255928516388, -0.11806410551071167, -0.21122488379478455, -0.14025864005088806, 0.11551890522241592, -0.2795211672782898, 0.34343838691711426, 0.2913821041584015, 0.41218575835227966, -0.017124727368354797, 0.08096013963222504, -0.13798649609088898, 0.13588951528072357, -0.19111160933971405, -0.12790605425834656, -0.06552845239639282, 0.11310800164937973, 0.2801988422870636, -0.1488061547279358, 0.18450191617012024, -0.021467577666044235, 0.0061760954558849335, 0.2577036917209625, -0.12268512696027756, 0.04545356333255768, -0.21714872121810913, 0.27292272448539734, -0.0992998257279396, 0.653694212436676, -0.3447524905204773, -0.07418595254421234, 0.12989377975463867, 0.1245521828532219, -0.1735614836215973, 0.21475183963775635, 0.25987932085990906, 0.03171740099787712, 0.22165590524673462, 0.18609046936035156, -0.21778184175491333, -0.213281512260437, -0.1157665103673935, -0.25208237767219543, -0.13615921139717102, -0.2764042913913727, -0.028787225484848022, 0.0726969838142395, -0.1039976179599762, 0.29081642627716064, 0.1949029117822647, -0.17239437997341156, -0.07804222404956818, -0.20680581033229828, -0.014647632837295532, 0.08407367765903473, 0.05930108577013016, -0.09199276566505432, 0.2277844399213791, 0.2850387990474701, 0.2867450416088104, -0.17755645513534546, 0.18843495845794678, 0.05295994132757187, 0.05443828925490379, 0.33544325828552246, 0.1507786214351654, 0.31236255168914795, 0.34720656275749207, 0.16593602299690247, -0.03472042828798294, -0.11883124709129333, -0.4770604372024536, -0.28800496459007263, -0.22229355573654175, 0.23361919820308685, -0.38852259516716003, -0.24014872312545776, 0.11380686610937119, -0.2672692537307739, -0.02183282934129238, -0.06646754592657089, 0.23389801383018494, 0.07551054656505585, 0.24222758412361145, 0.14096024632453918, 0.07180295884609222, -0.31172508001327515, -0.3504769802093506, -0.19827517867088318, 0.09869036078453064, -0.2618829905986786, -0.05192235857248306, 0.16763857007026672, -0.4155520498752594, 0.10940434038639069, -0.06840556859970093, -0.322986900806427, 0.015791133046150208, 0.1436995565891266, -0.04977407678961754, -0.2242933213710785, 0.18513710796833038, 0.18679343163967133, -0.17745426297187805, -0.10237906873226166, -0.14777898788452148, 0.12152012437582016, 0.19039484858512878, -0.02412848174571991, -0.19021371006965637, -0.12116704881191254, 0.3505450487136841, 0.034277819097042084, -0.07246680557727814, -0.1643894612789154, 0.08235348016023636, -0.2406941056251526, -0.3550581932067871, -0.131855309009552, -0.09276233613491058, -0.11554095894098282, -0.016270918771624565, 0.28446099162101746, 0.4358397126197815, -0.43979302048683167, -0.05703796073794365, -0.37127572298049927, -0.5237671732902527, -0.016891710460186005, 0.09181718528270721, -0.058081261813640594, -0.2642427682876587, -0.38963478803634644, -0.1043611466884613, 0.3712356388568878, -0.14828850328922272, -0.37551459670066833, 0.04175036400556564, -0.09700576961040497, -0.14385826885700226, 0.13486504554748535, 0.13957756757736206, 0.025735905393958092, -0.19472666084766388, -0.27827927470207214, -0.11849795281887054, 0.05600813031196594, -0.20882458984851837, -0.31781503558158875, -0.1588757336139679, -0.19941385090351105, 0.2676343321800232, 0.19906362891197205, 0.05115856975317001, 0.32184842228889465, 0.04113123193383217, 0.2086142599582672, 0.0355537049472332, 0.08844411373138428, 0.07851007580757141, 0.26770779490470886, 0.18138155341148376, -0.030473196879029274, -0.10467933863401413, -0.21094545722007751, -0.048589687794446945, -0.36912819743156433, -0.14223146438598633, 0.03313489258289337, -0.049600545316934586, -0.19450902938842773, -0.2089896947145462, -0.18459123373031616, -0.33699578046798706, 0.24122285842895508, 0.033255837857723236, -0.2469516098499298, 0.07581079006195068, 0.07272163033485413, 0.006723131984472275, -0.04276713728904724, 0.03185754269361496, -0.1776578277349472, 0.5355811715126038, -0.25317126512527466, 0.035652704536914825, 0.35981622338294983, 0.12345246225595474, 0.0902436226606369, 0.06729161739349365, -0.0990699976682663, 0.14166788756847382, 0.06084085628390312, 0.12551607191562653, 0.2430315911769867, 0.1684073656797409, 0.2628915309906006, -0.535376787185669, 0.3088531196117401, 0.009564686566591263, 0.12968705594539642, 0.03941816836595535, -0.41291308403015137, 0.045818574726581573, 0.14227762818336487, -0.14328604936599731, 0.22451616823673248, 0.31388479471206665, 0.3230968117713928, -0.21819549798965454, 0.13387945294380188, -0.09021387994289398, 0.11823470890522003, 0.032624501734972, 0.2241731733083725, 0.16091690957546234, -0.6567867398262024, 0.15408319234848022, 0.004792157560586929, 0.000302949920296669, -0.20205560326576233, 0.13164111971855164, -0.28898948431015015, -0.015153754502534866, 0.27964645624160767, 0.0059839822351932526, 0.09095495194196701, 0.28113603591918945, -0.08643671870231628, 0.330146849155426, -0.01734427735209465, -0.34854400157928467, 0.016920186579227448, 0.06887109577655792, -0.06754729896783829, 0.07202351093292236, 0.18239843845367432, -0.08276508003473282, -0.3623850643634796, -0.028818216174840927, 0.15967175364494324, 0.20527571439743042, -0.2841438353061676, -0.26804041862487793, -0.28293323516845703, -0.785097062587738, -0.31335556507110596, 0.4387761056423187, -0.0024950318038463593, -0.3236994445323944, 0.07727523893117905, 0.1215391755104065, -0.1744934618473053, 0.3255871832370758, -0.11923499405384064, 0.491305410861969, -0.07690856605768204, 0.47868961095809937, -0.25019240379333496, -0.0007503991946578026, -0.3191206455230713, 0.27429357171058655, 0.39261844754219055, 0.23168042302131653, 0.2854214012622833, -0.27056190371513367, 0.32010096311569214, -0.6487804055213928, -0.28936776518821716, 0.11332430690526962, 0.16216176748275757, 0.12793199717998505, -0.04507222771644592, -0.15630985796451569, 0.13588988780975342, -0.03074079006910324, 0.1948828250169754, -0.0970776230096817, -0.07154404371976852, 0.018237944692373276, 0.05464474856853485, -0.0626557245850563, -0.09216559678316116, -0.43657609820365906, -0.08733256906270981, -0.5100929737091064, -0.05972839891910553, -0.06026323512196541, 0.1336509883403778, -0.2552183270454407, 0.031698256731033325, 0.15905223786830902, 0.03351043537259102, -0.10715657472610474, 0.003635257016867399, -0.06679461151361465, 0.129914328455925, -0.38266444206237793, -0.5635870099067688, 0.2702711224555969, 0.3551333546638489, 0.07094475626945496, -0.2071753889322281, -0.4911082983016968, -0.3887162208557129, -0.05677567422389984, -0.03557761758565903, 0.11189640313386917, -0.07245481759309769, 0.19462554156780243, 0.17033392190933228, -0.13111326098442078, -0.17019614577293396, -0.3402925133705139, 0.18176302313804626, -0.3154885768890381, 0.02938774973154068, -0.0968237817287445, 0.40739336609840393, 0.020817700773477554, 0.5214169025421143, 0.1700509637594223, -0.07960255444049835, 0.27493607997894287, -0.11055087298154831, 0.3140604794025421, -0.2141164243221283, -0.03324677795171738, 0.2760064899921417, -0.03228354454040527, 0.17067548632621765, 0.3658357858657837, 0.13918480277061462, -0.21958883106708527, -0.04969221353530884, 0.1669800579547882, -0.060792528092861176, -0.12545976042747498, -0.34116488695144653, -0.11220403015613556, 0.032880835235118866, 0.12639911472797394, -0.014112316071987152, -0.13113288581371307, -0.26342207193374634, 0.23701365292072296, 0.30432164669036865, 0.1343124359846115, 0.15234510600566864, -0.1329457014799118, 0.2692388594150543, -0.24821999669075012, 0.49809449911117554, -0.1758851557970047, 0.1231970340013504, -0.17631128430366516, -0.0016432665288448334, 0.33542874455451965, -0.11805687099695206, 0.29680708050727844, -0.24192877113819122, 0.22823593020439148, 0.29602906107902527, 0.12108835577964783, -0.09168695658445358, -0.08633990585803986, -0.148176908493042, -0.012591235339641571, 0.2863178849220276, 0.05929982662200928, -0.10727669298648834, -0.20840981602668762, 0.18387159705162048, -0.16873380541801453, -0.1331968456506729, 0.024373680353164673, 0.008997749537229538, -0.07286886125802994, -0.04138295352458954, -0.13378196954727173, -0.23701904714107513, 0.10529456287622452, -0.24680998921394348, 0.017049774527549744, -0.21995915472507477, -0.258317768573761, 0.12053625285625458, 0.036400217562913895, 0.35058873891830444, 0.057530924677848816, 0.1978965550661087, 0.1684519350528717, 0.6700479984283447, 0.31762006878852844, 0.6829496622085571, -0.10094384849071503, -0.567690372467041, 0.399393767118454, -0.23140141367912292, 0.13093197345733643, 0.12910248339176178, -0.021509338170289993, -0.10199318081140518, -0.0022559650242328644, 0.08167893439531326, -0.17969770729541779, 0.09717711806297302, 0.17691713571548462, 0.10447481274604797, -0.26940158009529114, -0.3986615538597107, 0.286648154258728, 0.33207714557647705, -0.05596528947353363, 0.03428947553038597, -0.022659845650196075, -0.04132956266403198, 0.10862178355455399, -0.000452674925327301, 0.7229809761047363, -0.0656646192073822, -0.14778374135494232, 0.09240685403347015, -0.5121529698371887, 0.009878184646368027, -0.46452218294143677, 0.13939273357391357, -0.3827628493309021, -0.18059976398944855, 0.025699758902192116, -0.05075586587190628, 0.4552367925643921, -0.0016698762774467468, -0.03745266795158386, 0.12771131098270416, 0.12275238335132599, -0.3516046106815338, 0.17499354481697083, 0.3454256057739258, 0.04832568019628525, 0.13823598623275757, -0.07867199927568436, 0.30227258801460266, 0.07148587703704834, -0.05888405814766884, -0.04867885634303093, -0.1295284926891327, 0.10405689477920532, 0.0423523485660553, -0.2730045020580292, 0.16755452752113342, 0.0477883517742157, -0.17529332637786865, -0.0896032452583313, -0.32229501008987427, 0.5266669392585754, 0.4428638219833374, -0.04954814910888672, 0.021103758364915848, -0.26656898856163025, 0.19249942898750305, 0.004909522831439972, 0.014675136655569077, 0.18996670842170715, 0.2805630564689636, 0.22875702381134033, -0.09950785338878632, 0.14372479915618896, 0.3538585603237152, 0.0730038583278656, -0.2169678807258606, -0.2535834312438965, -0.08258691430091858, 0.031195173040032387, -0.257574200630188, -0.01739523746073246, -0.1909714937210083, -0.014644123613834381, -0.14934995770454407, 0.2583542466163635, 0.07539580017328262, 0.09889758378267288, -0.0908920094370842, 0.03028837777674198, -0.20190779864788055, -0.02514292672276497, 0.4427609443664551, -0.05644118785858154, -0.016540957614779472, 0.38122257590293884, 0.2634541094303131, -0.19925479590892792, -0.26857247948646545, -0.12797003984451294, 0.17307743430137634, -0.3797963857650757, 0.034305185079574585, 0.09318598359823227, -0.10699084401130676, 0.2295827716588974, 0.2086949199438095, -0.14223237335681915, -0.18141216039657593, 0.11743101477622986, -0.39371103048324585, -0.07531797885894775, -0.027399733662605286, -0.09911781549453735, 0.0872257649898529, -0.05065581202507019, 0.07230313867330551, 0.16764049232006073, -0.0010580196976661682, -0.45875662565231323, 0.26333409547805786, -0.15805992484092712, -0.02757178246974945, -0.347293883562088, 0.04760168492794037, -0.19215136766433716, -0.11702115833759308, 0.20698818564414978, -0.067591093480587, -0.3900725543498993, -0.2694111168384552, 0.031656414270401, 0.050789445638656616, 0.024517908692359924, -0.11630534380674362, -0.06661710143089294, -0.07825498282909393, -0.24026796221733093, 0.13358664512634277, -0.030874431133270264, 0.012846726924180984, -0.1420372724533081, 0.00930349063128233, -0.037955302745103836, -0.21518096327781677, 0.05172169208526611, 0.10560277849435806, 0.2216176688671112, 0.22322998940944672, -0.13373130559921265, 0.0014887787401676178, 0.013413583859801292, 0.007341243326663971, 0.2630344331264496, 0.02743370831012726, 0.13736556470394135, 0.11049409955739975, 0.3517700433731079, -0.14301271736621857, 0.1540612280368805, 0.30543750524520874, 0.35828667879104614, 0.12613293528556824, -0.214555025100708, 0.004706835374236107, 0.37918660044670105, 0.3053843677043915, -0.5585682392120361, 0.04009149596095085, 0.19628861546516418, -0.03809079900383949, -0.046408478170633316, -0.28582531213760376, 0.17909036576747894, 0.13835524022579193, 0.053383272141218185, 0.25794973969459534, 0.27070489525794983, -0.27622199058532715, 0.2700433135032654, 0.09224946796894073, -0.029280580580234528, 0.13439445197582245, 0.24430526793003082, 0.17019283771514893, -0.006776958703994751, 0.38824135065078735, -0.02214110642671585, 0.07742103189229965, -0.034166090190410614, 0.4144212603569031, 0.13322800397872925, -0.5426501631736755, -0.130452498793602, 0.03454722464084625, -0.07285377383232117, -0.03241446614265442, -0.053544074296951294, 0.3686314523220062, 0.2326708436012268, -0.12070801854133606, -0.1599312275648117, 0.14605996012687683, -0.052164383232593536, 0.0794994980096817, -0.05660105496644974, -0.2083723247051239, 0.05274021625518799, 0.08322465419769287, -0.05530852451920509, 0.18025916814804077, 0.10487857460975647, 0.0487227737903595, -0.26572632789611816, -0.20208072662353516, 0.012893682345747948, 0.04259360581636429, -0.0035971403121948242, 0.10463161766529083, 0.2202611118555069, -0.09302671253681183, -0.07637956738471985, 0.44885751605033875, 0.475579172372818, -0.01589806005358696, 0.16453737020492554, 0.18716223537921906, -0.15159377455711365, -0.006107183173298836, -0.05142085999250412, -0.2492704540491104, 0.11732752621173859, 0.38980337977409363, -0.04198281839489937, 0.27226555347442627, 0.22709789872169495, -0.26784947514533997, 0.2330007404088974, -0.04624778404831886, 0.25186046957969666, -0.2605239748954773, 0.3891938328742981, -0.15568864345550537, -0.07718230783939362, -0.10017631947994232, -0.3487186133861542, -0.3103824257850647, 0.10344888269901276, 0.0849979966878891, 0.020140931010246277, -0.029468845576047897, -0.3791693150997162, 0.1711416244506836, 0.11972130835056305, 0.20696550607681274, 0.39612704515457153, 0.04906586930155754, 0.06286834180355072, -0.23296543955802917, -0.7145402431488037, 0.223963662981987, 0.24610254168510437, -0.09573908895254135, 0.0356406643986702, -0.1551072746515274, -0.012724660336971283, 0.012183912098407745, 0.1276695430278778, 0.30808350443840027, 0.19784662127494812, 0.22699150443077087, -0.3597017526626587, 0.11692449450492859, 0.1721469610929489, 0.10303500294685364, -0.04959654062986374, -0.10093662142753601, 0.3901846408843994, -0.10666438192129135, 0.18503597378730774, 0.001887122169137001, 0.15594227612018585, -0.06226636841893196, -0.2601272463798523, 0.32920247316360474, 0.13013416528701782, 0.36795610189437866, 0.003796081990003586, 0.23985958099365234, -0.23946961760520935, -0.28339818120002747, -0.20438368618488312, -0.05828703194856644, 0.05753294378519058, 0.20163291692733765, -0.06995662301778793, -0.2586793005466461, -0.13570117950439453, 0.10492300242185593, -0.15506914258003235, 0.40044206380844116, -0.4205586016178131, 0.07208238542079926, -0.09966251254081726, 0.015862129628658295, 0.23936353623867035, 0.18677857518196106, -0.05928562581539154, -0.07662302255630493, -0.37210071086883545, -0.14233319461345673, 0.20138466358184814, -0.43209266662597656, -0.03413436934351921, -0.021437831223011017, 0.22347059845924377, 0.11332545429468155, -0.19591766595840454, -0.10389653593301773, -0.07068370282649994, 0.24742671847343445, -0.05634812265634537, 0.18655620515346527, 0.10798671841621399, 0.04253832995891571, 0.04657187685370445, -0.14507289230823517, 0.1548050493001938, 0.2524583637714386, -0.053445328027009964, 0.20603062212467194, -0.06391263753175735 ]
https://github.com/huggingface/datasets/issues/5000
Dataset Viewer issue for asapp/slue
FYI, after replacing the source files with the ZIP ones, the dataset viewer works well. Thanks again to @severo and @albertvillanova for your help!
### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes
24
Dataset Viewer issue for asapp/slue ### Link https://huggingface.co/datasets/asapp/slue/viewer/ ### Description Hi, I wonder how to get the dataset viewer of our slue dataset to work. Best, Felix ### Owner Yes FYI, after replacing the source files with the ZIP ones, the dataset viewer works well. Thanks again to @severo and @albertvillanova for your help!
[ -0.5353673696517944, -0.33656489849090576, 0.026200179010629654, 0.4379200339317322, 0.40814703702926636, 0.05784042924642563, 0.11444582045078278, 0.14656047523021698, -0.1574377417564392, 0.2312421202659607, -0.18963195383548737, 0.3726181983947754, -0.09914959967136383, 0.26467323303222656, -0.11408263444900513, -0.1573643982410431, 0.006686322391033173, 0.08018479496240616, 0.20746685564517975, 0.0033470168709754944, -0.1638590395450592, -0.009414056316018105, -0.12492622435092926, 0.22404254972934723, 0.08528856188058853, 0.062118545174598694, 0.03184068202972412, 0.051867060363292694, -0.25894150137901306, -0.20297588407993317, 0.24622772634029388, 0.055083680897951126, 0.5052881240844727, 0.09449020028114319, -0.00010273612861055881, 0.05855937302112579, 0.4861679673194885, -0.02235361933708191, -0.028602533042430878, -0.011600315570831299, -0.35160207748413086, -0.20245394110679626, 0.1618606299161911, -0.07315617799758911, -0.32401442527770996, 0.013694364577531815, 0.07106587290763855, -0.3827161490917206, 0.3800498843193054, 0.21206285059452057, 0.3387746810913086, 0.016518861055374146, 0.12760208547115326, -0.044787872582674026, 0.03913087770342827, -0.1187829077243805, -0.27767717838287354, -0.11167629063129425, 0.03680531680583954, 0.3289085924625397, -0.18124395608901978, 0.1147191971540451, 0.07326935231685638, 0.1449131965637207, 0.3252166211605072, -0.05115868151187897, 0.0035971030592918396, -0.2289903163909912, 0.2563762068748474, -0.07530439645051956, 0.8041945695877075, -0.35468414425849915, -0.0883670374751091, 0.1490176022052765, 0.08325114846229553, -0.22283709049224854, 0.19593554735183716, 0.25982701778411865, 0.02682606875896454, 0.26587390899658203, 0.042891062796115875, -0.13796280324459076, -0.314134418964386, -0.04801328480243683, -0.33316007256507874, -0.030328363180160522, -0.3010697662830353, 0.013223592191934586, 0.10795095562934875, -0.1570448875427246, 0.43572497367858887, 0.053625840693712234, -0.1402977854013443, 0.030026275664567947, -0.36293089389801025, -0.033077824860811234, 0.0915646031498909, 0.056282173842191696, 0.0034677349030971527, 0.2392972707748413, 0.2206488996744156, 0.3519074618816376, -0.1350218504667282, 0.1559441089630127, 0.2372782975435257, 0.02143288031220436, 0.3398788571357727, 0.2798903286457062, 0.36693716049194336, 0.264236181974411, 0.2359921634197235, -0.032066307961940765, -0.1915663182735443, -0.3681603670120239, -0.23551729321479797, -0.2767404019832611, 0.23957450687885284, -0.4290173053741455, -0.18305695056915283, 0.08734546601772308, -0.39636266231536865, -0.11289383471012115, -0.02995484322309494, 0.1950291097164154, 0.016831349581480026, 0.26356515288352966, 0.03474362939596176, 0.12457311898469925, -0.22296224534511566, -0.36314529180526733, -0.19964957237243652, -0.06496812403202057, -0.24936169385910034, -0.0788610652089119, 0.17828941345214844, -0.4308246374130249, 0.008504310622811317, 0.004339174367487431, -0.34581810235977173, -0.06480216979980469, 0.17579899728298187, -0.08203789591789246, -0.24647095799446106, 0.07363926619291306, 0.2941914200782776, -0.15990418195724487, -0.07494643330574036, -0.047263070940971375, 0.14303895831108093, 0.20757073163986206, 0.03523785620927811, -0.2091890126466751, -0.09174954146146774, 0.25389227271080017, -0.10213610529899597, -0.05410333722829819, -0.20198237895965576, 0.14066118001937866, -0.2195071578025818, -0.2851150333881378, -0.17912432551383972, -0.013926278799772263, -0.10037222504615784, -0.03305669501423836, 0.3633875250816345, 0.3865817189216614, -0.5058726668357849, 0.06192763149738312, -0.4946787655353546, -0.5635411143302917, -0.012853972613811493, 0.051406752318143845, 0.000663725018966943, -0.31647276878356934, -0.38703209161758423, -0.13948118686676025, 0.3135952949523926, -0.03257907181978226, -0.4565522074699402, 0.20014367997646332, -0.027743346989154816, -0.11746114492416382, 0.11972786486148834, 0.16339269280433655, -0.03352119028568268, -0.1587826907634735, -0.3119640648365021, 0.08290456235408783, -0.08090945333242416, -0.23165161907672882, -0.2905668318271637, -0.052608173340559006, -0.09746921062469482, 0.27586883306503296, 0.16951727867126465, 0.10538345575332642, 0.32574567198753357, 0.01283883024007082, 0.2589293122291565, 0.21969684958457947, 0.13578467071056366, -0.05417502671480179, 0.2166273444890976, 0.18427710235118866, -0.03127002343535423, -0.016162101179361343, -0.23962906002998352, -0.031224440783262253, -0.36900076270103455, -0.16708841919898987, -0.01239127665758133, 0.013294238597154617, -0.11561151593923569, -0.15926970541477203, -0.2550807595252991, -0.3022628426551819, 0.19849209487438202, 0.002423681318759918, -0.22733290493488312, 0.1056191474199295, 0.07470706105232239, 0.07615210860967636, 0.07749328762292862, 0.07445219159126282, -0.2045803666114807, 0.6313292384147644, -0.2146153301000595, 0.006625058129429817, 0.3008037507534027, 0.1123085618019104, 0.1468399465084076, -0.012873711064457893, -0.10763337463140488, 0.16782334446907043, 0.07485074549913406, 0.02260998636484146, 0.2506980001926422, 0.10387840867042542, 0.32994532585144043, -0.6273148059844971, 0.32910335063934326, 0.04179830476641655, 0.07115289568901062, -0.034983810037374496, -0.485350638628006, 0.04252222180366516, 0.08464957773685455, -0.005600109696388245, 0.06305953860282898, 0.42496711015701294, 0.2933131158351898, -0.14045889675617218, 0.14323145151138306, 0.015339024364948273, 0.18082769215106964, 0.046169713139534, 0.245735302567482, 0.1698666363954544, -0.6078821420669556, 0.0966651663184166, -0.11665080487728119, -0.0053565893322229385, -0.25075992941856384, 0.11413893848657608, -0.3197753429412842, 0.0021093059331178665, 0.36072492599487305, -0.0034163445234298706, 0.07969397306442261, 0.2527833580970764, -0.03731067106127739, 0.3112694323062897, -0.027067914605140686, -0.20529510080814362, -0.07799636572599411, 0.06239180266857147, -0.07830607146024704, -0.0825166180729866, 0.07430057227611542, -0.038373757153749466, -0.20855921506881714, 0.00003263354301452637, 0.2501746416091919, 0.2957320809364319, -0.287638783454895, -0.27292323112487793, -0.21516935527324677, -0.8364868760108948, -0.25548380613327026, 0.39548832178115845, -0.0414775125682354, -0.32437020540237427, -0.07590527832508087, 0.20131956040859222, -0.03547179698944092, 0.30243027210235596, -0.1474771797657013, 0.4810633659362793, -0.07325731217861176, 0.4126327931880951, -0.18850179016590118, -0.0373896099627018, -0.3882649540901184, 0.24520397186279297, 0.49209243059158325, 0.22783717513084412, 0.22192460298538208, -0.2054804563522339, 0.36160922050476074, -0.570563793182373, -0.2674069106578827, 0.11488878726959229, 0.1232590302824974, 0.1687859743833542, -0.10467207431793213, -0.12966741621494293, 0.07776203006505966, 0.0839742049574852, 0.25122618675231934, -0.0009017381817102432, -0.05667371302843094, 0.10130468755960464, 0.08684682846069336, -0.08679907023906708, -0.008002318441867828, -0.3593454360961914, -0.06279466301202774, -0.40830641984939575, -0.06663602590560913, -0.10516318678855896, 0.10730643570423126, -0.3315174877643585, 0.10607016086578369, 0.08969424664974213, 0.13697779178619385, -0.1964150071144104, 0.0020959321409463882, -0.10242736339569092, 0.16464269161224365, -0.33227619528770447, -0.5310899615287781, 0.3098675608634949, 0.3549749255180359, 0.004100196063518524, -0.15848921239376068, -0.49603164196014404, -0.31187915802001953, -0.025486106052994728, 0.09542325139045715, 0.15014921128749847, -0.04981797933578491, 0.1846666932106018, 0.12176253646612167, 0.017206283286213875, -0.12895114719867706, -0.4578128159046173, 0.18966145813465118, -0.35322660207748413, 0.22377735376358032, 0.05323709174990654, 0.39310958981513977, 0.09252575039863586, 0.38471871614456177, 0.21486952900886536, -0.0012126490473747253, 0.3327080011367798, -0.0935424193739891, 0.20083186030387878, -0.11032413691282272, -0.06087541580200195, 0.3238653540611267, -0.011204928159713745, 0.1658392697572708, 0.303827702999115, 0.280215859413147, -0.2600008547306061, -0.11147842556238174, 0.10897348821163177, 0.014613043516874313, -0.0713280662894249, -0.28320643305778503, -0.3205600082874298, 0.03018319234251976, 0.053681518882513046, 0.025036126375198364, 0.021746698766946793, -0.28471770882606506, 0.14149461686611176, 0.236117884516716, 0.21680322289466858, 0.13422422111034393, -0.07339805364608765, 0.2388741672039032, -0.2068350911140442, 0.44048261642456055, -0.20814290642738342, 0.191921204328537, -0.13587279617786407, 0.008832920342683792, 0.35854196548461914, -0.0919051393866539, 0.27020877599716187, -0.2758241593837738, 0.27922719717025757, 0.22995175421237946, 0.029103673994541168, -0.1805695742368698, -0.06544318050146103, -0.10228610038757324, -0.09851367026567459, 0.14229464530944824, 0.019320379942655563, -0.25403228402137756, -0.11429499834775925, 0.17535294592380524, -0.20019811391830444, -0.1295260637998581, -0.07972770929336548, 0.034536782652139664, -0.052629098296165466, 0.10254102945327759, -0.1549045443534851, -0.34447190165519714, 0.1589125096797943, -0.14200356602668762, 0.005526989698410034, -0.25943902134895325, -0.3545773923397064, 0.10585040599107742, 0.05990586057305336, 0.39708632230758667, -0.047299616038799286, 0.3034154772758484, 0.3212769031524658, 0.6301286220550537, 0.2902439534664154, 0.6866787672042847, -0.03251158818602562, -0.6554678678512573, 0.3714524209499359, -0.2179102599620819, 0.1662849634885788, -0.021304696798324585, -0.08262761682271957, -0.18336522579193115, -0.04572951793670654, 0.04005342721939087, -0.19698934257030487, 0.015637673437595367, 0.13509811460971832, 0.155305415391922, -0.3549419045448303, -0.46509483456611633, 0.3340889513492584, 0.3447299003601074, -0.04318657144904137, 0.05391310527920723, -0.059122249484062195, -0.01432386040687561, 0.05267839506268501, -0.07306963950395584, 0.6272913217544556, -0.01668928563594818, -0.3108747601509094, 0.05888013169169426, -0.5256046652793884, 0.013343282043933868, -0.5035998225212097, 0.11521486192941666, -0.42802321910858154, -0.1472819596529007, 0.012232327833771706, -0.014145169407129288, 0.5028563141822815, 0.018052302300930023, -0.027181778103113174, 0.09560105204582214, 0.07666264474391937, -0.4403352439403534, 0.16685502231121063, 0.33975687623023987, -0.0021422654390335083, 0.09014296531677246, -0.06995076686143875, 0.2555592656135559, -0.04146025329828262, 0.025234883651137352, -0.019328657537698746, -0.20122678577899933, 0.0546012707054615, 0.025762706995010376, -0.3834635615348816, 0.1625846028327942, 0.056329406797885895, -0.29439038038253784, -0.011061698198318481, -0.351041316986084, 0.6492961645126343, 0.44218701124191284, 0.021749239414930344, 0.06561999022960663, -0.33470386266708374, 0.15451312065124512, 0.03755704686045647, 0.12273188680410385, 0.2698148190975189, 0.26937031745910645, 0.1517544388771057, -0.13301876187324524, 0.08297262340784073, 0.36535799503326416, 0.05095130577683449, -0.1380372941493988, -0.20964886248111725, -0.06444990634918213, 0.07710058242082596, -0.3226180374622345, 0.058066871017217636, -0.13516557216644287, 0.0795808881521225, -0.025147028267383575, 0.2250560224056244, 0.1511937975883484, 0.025233639404177666, -0.0043623968958854675, -0.02744341269135475, -0.17687693238258362, -0.03558254614472389, 0.35357028245925903, -0.13612008094787598, -0.0868464931845665, 0.2638676166534424, 0.28322699666023254, -0.13093306124210358, -0.15988969802856445, -0.020649999380111694, 0.2573586404323578, -0.3378670811653137, -0.10271071642637253, 0.05047440528869629, -0.030095331370830536, 0.17351333796977997, 0.15054231882095337, -0.1408875584602356, -0.15791186690330505, 0.13248072564601898, -0.4409817159175873, -0.003343958407640457, -0.1362411379814148, -0.12527434527873993, 0.08995670080184937, -0.09533050656318665, 0.0828188806772232, 0.2163008600473404, 0.04144895076751709, -0.3767794072628021, 0.11190414428710938, -0.08691428601741791, 0.015605196356773376, -0.3149555027484894, 0.12912702560424805, -0.2584865987300873, -0.217970073223114, 0.177652508020401, -0.02966989204287529, -0.3545568287372589, -0.1730276346206665, 0.05103525146842003, 0.08056093007326126, 0.11362198740243912, -0.2775072157382965, -0.07567811757326126, -0.1143542230129242, -0.296741783618927, 0.10188654065132141, -0.07772617042064667, -0.005982071161270142, -0.16017720103263855, -0.03410572186112404, 0.057293981313705444, -0.20810440182685852, -0.05290035903453827, 0.1288718283176422, 0.24250273406505585, 0.23900431394577026, -0.0892539843916893, 0.049629006534814835, 0.09462478756904602, 0.06102202832698822, 0.14529308676719666, -0.0005229860544204712, 0.11054687947034836, -0.016866303980350494, 0.4210222661495209, -0.24382077157497406, 0.21154603362083435, 0.2987889349460602, 0.44383472204208374, 0.18894359469413757, -0.1532791554927826, 0.06454835087060928, 0.421364963054657, 0.2645508050918579, -0.4885982871055603, 0.07037005573511124, 0.18537509441375732, 0.02982868254184723, -0.11302782595157623, -0.24486508965492249, 0.05604321137070656, 0.2742132544517517, -0.062872976064682, 0.20183181762695312, 0.3956649899482727, -0.19640450179576874, 0.2765164375305176, 0.14940974116325378, -0.11431455612182617, 0.07150394469499588, 0.27784091234207153, 0.1919490098953247, -0.14638036489486694, 0.38817930221557617, -0.10002482682466507, -0.03420796990394592, -0.05144047737121582, 0.4730062186717987, 0.16236090660095215, -0.6014240980148315, -0.21283172070980072, -0.028135567903518677, -0.16388913989067078, -0.1331327259540558, -0.13595224916934967, 0.3935798108577728, 0.21183368563652039, -0.1592905968427658, -0.1453012079000473, 0.10358253121376038, 0.02047671191394329, 0.21562983095645905, -0.0885109007358551, -0.1659371256828308, 0.07232508063316345, 0.05980325862765312, 0.0074199289083480835, 0.04053764417767525, 0.20950005948543549, 0.10607056319713593, -0.24997098743915558, -0.32809120416641235, 0.07289506494998932, 0.137516587972641, -0.03550431877374649, 0.06199217215180397, 0.2893217206001282, -0.1714296191930771, -0.10586060583591461, 0.42612192034721375, 0.353775292634964, -0.03024626150727272, 0.17353151738643646, 0.18752169609069824, -0.1585569977760315, -0.11163458228111267, -0.044258713722229004, -0.19031067192554474, 0.19267866015434265, 0.372558057308197, -0.06144470348954201, 0.22802087664604187, 0.1383018046617508, -0.1544305980205536, 0.31193336844444275, -0.12532365322113037, 0.36773085594177246, -0.2520056366920471, 0.4668658673763275, -0.19985049962997437, -0.09665712714195251, -0.05920400470495224, -0.4139014184474945, -0.22000223398208618, 0.10480302572250366, 0.0631113052368164, 0.01046261377632618, -0.09525389969348907, -0.46142661571502686, 0.13136911392211914, 0.166077122092247, 0.15219730138778687, 0.46429115533828735, 0.07764458656311035, -0.04432399943470955, -0.2097601741552353, -0.7631760835647583, 0.16585111618041992, 0.27829691767692566, -0.11525233834981918, 0.07564108818769455, -0.10146793723106384, -0.0738023892045021, 0.15952755510807037, 0.12396008521318436, 0.3746432363986969, 0.22673586010932922, 0.389508455991745, -0.27321818470954895, -0.015458237379789352, 0.15609891712665558, 0.1696901023387909, -0.166114941239357, -0.13021805882453918, 0.455215722322464, -0.08161558210849762, 0.11619184166193008, 0.03735917806625366, 0.18386244773864746, -0.04176901653409004, -0.3422236442565918, 0.2852194309234619, 0.16601623594760895, 0.45606252551078796, 0.14241743087768555, 0.4276055097579956, -0.28649213910102844, -0.1740376353263855, -0.2847370207309723, -0.08593178540468216, 0.010761620476841927, 0.1409221887588501, -0.042441628873348236, -0.25577449798583984, -0.18292458355426788, 0.06101585179567337, -0.19666209816932678, 0.4342834949493408, -0.36122944951057434, 0.020111726596951485, -0.13108065724372864, -0.015023157000541687, 0.16920286417007446, 0.04927601292729378, 0.032014913856983185, -0.05362851917743683, -0.3725748062133789, -0.10144077241420746, 0.031271591782569885, -0.3999662399291992, -0.03548318147659302, 0.018024086952209473, 0.10113231092691422, 0.07014153897762299, -0.24914833903312683, -0.03415517136454582, -0.06870082020759583, 0.2866138219833374, -0.12147488445043564, 0.2525399327278137, 0.11719229817390442, 0.06764225661754608, 0.11677409708499908, -0.18221352994441986, 0.18563342094421387, 0.19410300254821777, 0.023289429023861885, 0.2269442081451416, 0.031917937099933624 ]
https://github.com/huggingface/datasets/issues/4996
Dataset Viewer issue for Jean-Baptiste/wikiner_fr
The script uses `Dataset.load_from_disk`, which as you can expect, doesn't work in streaming mode. It would probably be more practical to load the dataset locally using `Dataset.load_from_disk` first and then `push_to_hub` to upload it in Parquet on the Hub
### Link https://huggingface.co/datasets/Jean-Baptiste/wikiner_fr ### Description ``` Error code: StreamingRowsError Exception: FileNotFoundError Message: [Errno 2] No such file or directory: 'zip:/data/train::https:/huggingface.co/datasets/Jean-Baptiste/wikiner_fr/resolve/main/data.zip/state.json' Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/responses/first_rows.py", line 337, in get_first_rows_response rows = get_rows(dataset, config, split, streaming=True, rows_max_number=rows_max_number, hf_token=hf_token) File "/src/services/worker/src/worker/utils.py", line 123, in decorator return func(*args, **kwargs) File "/src/services/worker/src/worker/responses/first_rows.py", line 77, in get_rows rows_plus_one = list(itertools.islice(ds, rows_max_number + 1)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 718, in __iter__ for key, example in self._iter(): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 708, in _iter yield from ex_iterable File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 112, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/tmp/modules-cache/datasets_modules/datasets/Jean-Baptiste--wikiner_fr/683a580ba6ec769d508f7dfc603a651667b0ed3817b1ae5bfd45f97cc024923f/wikiner_fr.py", line 165, in _generate_examples dataset = Dataset.load_from_disk(filepath) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1210, in load_from_disk with open(Path(dataset_path, config.DATASET_STATE_JSON_FILENAME).as_posix(), encoding="utf-8") as state_file: FileNotFoundError: [Errno 2] No such file or directory: 'zip:/data/train::https:/huggingface.co/datasets/Jean-Baptiste/wikiner_fr/resolve/main/data.zip/state.json' ``` Is it an error with the dataset script, or the data itself, @huggingface/datasets? https://huggingface.co/datasets/Jean-Baptiste/wikiner_fr/tree/main ### Owner No
39
Dataset Viewer issue for Jean-Baptiste/wikiner_fr ### Link https://huggingface.co/datasets/Jean-Baptiste/wikiner_fr ### Description ``` Error code: StreamingRowsError Exception: FileNotFoundError Message: [Errno 2] No such file or directory: 'zip:/data/train::https:/huggingface.co/datasets/Jean-Baptiste/wikiner_fr/resolve/main/data.zip/state.json' Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/responses/first_rows.py", line 337, in get_first_rows_response rows = get_rows(dataset, config, split, streaming=True, rows_max_number=rows_max_number, hf_token=hf_token) File "/src/services/worker/src/worker/utils.py", line 123, in decorator return func(*args, **kwargs) File "/src/services/worker/src/worker/responses/first_rows.py", line 77, in get_rows rows_plus_one = list(itertools.islice(ds, rows_max_number + 1)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 718, in __iter__ for key, example in self._iter(): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 708, in _iter yield from ex_iterable File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 112, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/tmp/modules-cache/datasets_modules/datasets/Jean-Baptiste--wikiner_fr/683a580ba6ec769d508f7dfc603a651667b0ed3817b1ae5bfd45f97cc024923f/wikiner_fr.py", line 165, in _generate_examples dataset = Dataset.load_from_disk(filepath) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1210, in load_from_disk with open(Path(dataset_path, config.DATASET_STATE_JSON_FILENAME).as_posix(), encoding="utf-8") as state_file: FileNotFoundError: [Errno 2] No such file or directory: 'zip:/data/train::https:/huggingface.co/datasets/Jean-Baptiste/wikiner_fr/resolve/main/data.zip/state.json' ``` Is it an error with the dataset script, or the data itself, @huggingface/datasets? https://huggingface.co/datasets/Jean-Baptiste/wikiner_fr/tree/main ### Owner No The script uses `Dataset.load_from_disk`, which as you can expect, doesn't work in streaming mode. It would probably be more practical to load the dataset locally using `Dataset.load_from_disk` first and then `push_to_hub` to upload it in Parquet on the Hub
[ -0.43646442890167236, -0.03674481809139252, -0.06776560097932816, 0.37148499488830566, 0.1551411747932434, 0.058012597262859344, 0.05579458177089691, 0.6739018559455872, -0.3141521215438843, 0.12999120354652405, -0.1192692369222641, 0.25557050108909607, -0.1587839424610138, 0.18171660602092743, -0.06151747703552246, -0.21963751316070557, -0.11592762917280197, 0.4018334746360779, -0.13726702332496643, 0.10085561871528625, -0.14386066794395447, 0.17169401049613953, -0.23807738721370697, 0.1082635372877121, -0.19973184168338776, -0.09351997077465057, -0.06858385354280472, 0.13743863999843597, -0.2399320751428604, -0.33819863200187683, 0.06355606019496918, -0.12658865749835968, 0.2397395670413971, 0.7301624417304993, -0.00010882394417421892, 0.24390067160129547, 0.29200419783592224, -0.0410449281334877, -0.30934229493141174, -0.40705418586730957, 0.05250735580921173, -0.23383529484272003, 0.13032568991184235, -0.27472248673439026, -0.11854107677936554, -0.44473570585250854, 0.13346341252326965, -0.08753477036952972, 0.43280768394470215, 0.37791576981544495, 0.22965452075004578, 0.3148137032985687, 0.16977475583553314, -0.04769724979996681, 0.07870004326105118, 0.07850659638643265, -0.17520061135292053, 0.19294168055057526, -0.10493208467960358, 0.11515237390995026, -0.28928127884864807, 0.4180544316768646, -0.0406346432864666, 0.13091324269771576, 0.24603208899497986, -0.09937068074941635, -0.15550512075424194, -0.22962510585784912, 0.1438489854335785, 0.17074741423130035, 0.566483736038208, -0.2375025749206543, -0.2592225968837738, -0.13870765268802643, 0.03975670412182808, -0.09970476478338242, 0.1808846890926361, 0.3513215482234955, -0.30836963653564453, 0.15251493453979492, -0.0721178725361824, -0.04255286976695061, -0.4935334622859955, 0.16551509499549866, -0.15946543216705322, 0.3676530718803406, -0.16400697827339172, 0.05991522967815399, 0.2590042054653168, -0.10871638357639313, 0.5911106467247009, -0.02839900180697441, -0.10465295612812042, 0.006253656931221485, -0.29672202467918396, -0.09938228130340576, 0.21825331449508667, 0.04619607329368591, -0.07856452465057373, 0.14270000159740448, 0.11404656618833542, 0.004821524024009705, 0.04856276512145996, 0.07283387333154678, 0.17072167992591858, 0.05745553597807884, 0.005265824496746063, 0.4435178339481354, 0.35477882623672485, 0.4662797451019287, 0.022810112684965134, -0.10890986770391464, -0.13782015442848206, -0.35498225688934326, -0.245778888463974, -0.07520817220211029, 0.4446609616279602, -0.1049327403306961, -0.18388631939888, 0.000052590854465961456, -0.40582066774368286, -0.017739402130246162, 0.1850316971540451, 0.48293089866638184, -0.060016728937625885, 0.10869681090116501, -0.0797259509563446, 0.16991263628005981, -0.0878700315952301, -0.2299933284521103, -0.21271272003650665, 0.1482522040605545, -0.03842458501458168, -0.07053185254335403, 0.13830560445785522, -0.5121391415596008, 0.26980021595954895, -0.14920561015605927, 0.03372493013739586, -0.01968509331345558, 0.11040854454040527, -0.27352192997932434, 0.07552315294742584, 0.26802173256874084, 0.11913658678531647, -0.03174415975809097, 0.34025564789772034, -0.18413111567497253, 0.07911523431539536, 0.09205560386180878, -0.07103396207094193, -0.42803534865379333, -0.21262837946414948, 0.22465486824512482, -0.1792755275964737, 0.03791273385286331, 0.023679256439208984, 0.013849789276719093, -0.19576337933540344, -0.45677855610847473, -0.12263525277376175, -0.15789161622524261, -0.10483746230602264, -0.3123636841773987, 0.34274783730506897, 0.49612486362457275, -0.4601704180240631, -0.007784068584442139, -0.1846957951784134, -0.199997678399086, 0.07972255349159241, 0.31297942996025085, -0.1950296312570572, 0.09429832547903061, -0.4809088706970215, 0.21022437512874603, 0.4791663885116577, -0.173166885972023, -0.49668827652931213, 0.5992603302001953, -0.2323150336742401, 0.16530470550060272, 0.44168058037757874, 0.14294390380382538, 0.16540570557117462, -0.20886245369911194, -0.018621981143951416, -0.16916786134243011, 0.011356597766280174, 0.022987620905041695, -0.15011103451251984, -0.06129957735538483, 0.0345408134162426, 0.18879903852939606, 0.2090778797864914, -0.006372116506099701, 0.13144756853580475, -0.3517630398273468, 0.4818848967552185, -0.24393367767333984, 0.12674102187156677, 0.12489984184503555, 0.2372756451368332, 0.22397205233573914, -0.081635981798172, 0.006108678877353668, -0.3157145380973816, 0.07205362617969513, 0.01208953931927681, -0.19797781109809875, -0.33167725801467896, -0.04207594692707062, -0.21442639827728271, 0.0049385689198970795, -0.4044566750526428, -0.3296950161457062, 0.25857317447662354, 0.3133165240287781, 0.04908101633191109, 0.09861022233963013, -0.18987639248371124, 0.16337479650974274, -0.19987380504608154, -0.011927212588489056, -0.3043241500854492, 0.5362161993980408, -0.1850084811449051, -0.21268795430660248, 0.15526512265205383, -0.07390233129262924, 0.2870940864086151, -0.08745282143354416, -0.0688251405954361, 0.28631332516670227, -0.051625415682792664, 0.2719174027442932, 0.20811760425567627, -0.1494394689798355, 0.09177661687135696, -0.28720152378082275, 0.17799778282642365, 0.29288381338119507, 0.06302251666784286, 0.06473735719919205, -0.3598437011241913, 0.17489150166511536, -0.15139970183372498, 0.163618803024292, 0.17069269716739655, 0.06851515173912048, 0.2073506861925125, 0.10357582569122314, 0.04102187603712082, -0.058930233120918274, 0.21325132250785828, 0.0015832893550395966, 0.21705280244350433, -0.17410773038864136, -0.43639031052589417, 0.04754980653524399, 0.24154700338840485, -0.11233343183994293, -0.03818356990814209, 0.19063347578048706, -0.26852163672447205, -0.09578016400337219, 0.22218114137649536, 0.37514737248420715, 0.4175291657447815, 0.24718040227890015, 0.10572543740272522, 0.207931250333786, 0.11097194999456406, -0.2728833854198456, 0.24633637070655823, 0.14109767973423004, 0.2550770342350006, 0.47931107878685, -0.012818677350878716, -0.15684251487255096, -0.38032886385917664, -0.43566182255744934, -0.12940624356269836, 0.35658589005470276, -0.2714005708694458, -0.08838032931089401, -0.2610432207584381, -0.473253071308136, -0.11478567123413086, -0.04152391478419304, 0.03381544351577759, -0.3887401819229126, -0.021042127162218094, 0.5720040202140808, -0.11239631474018097, 0.16053467988967896, -0.20353589951992035, -0.13405843079090118, 0.22508661448955536, 0.13084441423416138, -0.4488261342048645, -0.09965653717517853, -0.10393167287111282, 0.13234233856201172, 0.31554150581359863, -0.18893970549106598, 0.3315008580684662, -0.21526508033275604, 0.07594095915555954, -0.6535003185272217, -0.254707396030426, 0.05746712163090706, -0.11421084403991699, 0.28525272011756897, 0.21518053114414215, 0.35523349046707153, -0.06224650517106056, -0.2645614743232727, 0.23922209441661835, -0.19909575581550598, -0.08074424415826797, 0.08844515681266785, -0.03891519829630852, 0.09675861895084381, 0.13041312992572784, -0.282724529504776, -0.33621594309806824, -0.6194939613342285, 0.36910706758499146, 0.04505353048443794, 0.19969186186790466, 0.000664479099214077, 0.26695844531059265, 0.21439774334430695, 0.11751965433359146, -0.066911481320858, -0.15357409417629242, -0.44645199179649353, 0.545146644115448, -0.2625657618045807, -0.32636022567749023, 0.19649195671081543, 0.10758213698863983, 0.18804459273815155, 0.049142077565193176, -0.6571354269981384, -0.18079864978790283, 0.11254385858774185, 0.2359159290790558, -0.15803605318069458, -0.05103161185979843, 0.23972845077514648, 0.08503416925668716, -0.058091454207897186, -0.07145299017429352, -0.0012668427079916, -0.18412679433822632, -0.1549054980278015, 0.03834507614374161, -0.10227187722921371, 0.5221207141876221, 0.26464948058128357, 0.5868648290634155, 0.4426686763763428, 0.22219973802566528, 0.3570850193500519, -0.10656186193227768, 0.39663711190223694, -0.08951162546873093, -0.2594369649887085, 0.1564304083585739, -0.02770128846168518, -0.10658390074968338, 0.21027031540870667, -0.01597592607140541, -0.106254443526268, -0.29114994406700134, -0.3116682469844818, -0.45253852009773254, -0.18676242232322693, 0.08107880502939224, 0.08081966638565063, 0.1738176941871643, -0.21515944600105286, 0.1558944582939148, -0.14806607365608215, -0.11302565038204193, -0.05855482071638107, 0.322174608707428, 0.1857438087463379, 0.08619222044944763, -0.12839558720588684, -0.2677738666534424, -0.2488572597503662, 0.3373587131500244, 0.16470792889595032, 0.08019241690635681, 0.02292642369866371, -0.12637755274772644, 0.11843564361333847, -0.05828331410884857, 0.8288512229919434, -0.10900216549634933, 0.060993459075689316, 0.10774374008178711, -0.09405561536550522, -0.1754840910434723, -0.02268321067094803, -0.07174375653266907, 0.23602533340454102, 0.008555881679058075, 0.30859512090682983, -0.08645163476467133, -0.1372169554233551, 0.449595183134079, -0.14191259443759918, -0.01744723692536354, -0.278404176235199, -0.13345402479171753, -0.2405785620212555, -0.31385859847068787, -0.0660080537199974, -0.14557242393493652, 0.014994198456406593, -0.013314724899828434, -0.08447223901748657, 0.026828357949852943, -0.11872199177742004, -0.07091274857521057, 0.2033350020647049, 0.22761639952659607, 0.018573231995105743, 0.02506951615214348, 0.5004394054412842, 0.22224578261375427, 0.5050357580184937, 0.46749088168144226, 0.26485446095466614, -0.5689439177513123, 0.13160346448421478, -0.010001382790505886, 0.10095502436161041, 0.28093644976615906, -0.2750590443611145, -0.11074475198984146, 0.18271976709365845, 0.3668121099472046, 0.02967134863138199, -0.00006050011143088341, 0.5314185619354248, -0.12588481605052948, -0.2853511869907379, -0.4952251613140106, 0.3652604818344116, -0.04181726276874542, 0.2037571221590042, 0.21015551686286926, -0.04938095808029175, 0.010740354657173157, 0.01135273091495037, -0.20229101181030273, 0.7532690167427063, 0.2972809672355652, 0.11831486225128174, 0.640031099319458, -0.2550787329673767, 0.42282745242118835, -0.31698179244995117, 0.3087918162345886, -0.35539981722831726, -0.4902648627758026, -0.10384668409824371, -0.12350781261920929, 0.21003833413124084, -0.02721039205789566, -0.36425840854644775, 0.27089810371398926, 0.09378503262996674, 0.24763262271881104, 0.041621990501880646, 0.07399459928274155, -0.28459182381629944, 0.07357771694660187, -0.5316314697265625, 0.15949390828609467, -0.19559846818447113, 0.07999096810817719, -0.12847942113876343, -0.35844457149505615, -0.000925358384847641, -0.1854766607284546, -0.059669289737939835, 0.16417399048805237, -0.31008562445640564, 0.2223593145608902, -0.11518354713916779, -0.40597963333129883, -0.025603199377655983, 0.3536931574344635, -0.31967800855636597, -0.07790715992450714, -0.18916559219360352, 0.16560737788677216, -0.07480724900960922, -0.07029987871646881, 0.025326432660222054, 0.11229462921619415, 0.24488940834999084, -0.09711730480194092, -0.22467082738876343, 0.38166528940200806, -0.013369156047701836, -0.2063305824995041, -0.041039250791072845, -0.07504399120807648, 0.062065489590168, -0.3317955434322357, -0.024304816499352455, -0.18975961208343506, -0.2930653691291809, -0.2078247368335724, 0.13328947126865387, -0.17519299685955048, -0.2525573968887329, -0.12495078891515732, -0.11935774981975555, -0.17430226504802704, -0.03577158972620964, 0.4390765130519867, -0.02303692325949669, 0.21868488192558289, 0.5006967782974243, 0.2376999408006668, -0.28422436118125916, -0.23560604453086853, 0.11244725435972214, -0.25671282410621643, -0.3474055230617523, 0.16230171918869019, 0.11760468780994415, 0.24057109653949738, 0.02022773213684559, 0.05209176614880562, 0.1809900403022766, 0.01452687382698059, -0.08324365317821503, -0.340736448764801, -0.226745143532753, 0.13321422040462494, -0.038009148091077805, 0.23156996071338654, 0.030007265508174896, 0.20929200947284698, 0.14614519476890564, -0.04154054820537567, -0.3491757810115814, -0.037843748927116394, -0.11469743400812149, -0.039930686354637146, 0.006772596389055252, 0.006432697176933289, 0.14701907336711884, 0.11974631249904633, 0.19873706996440887, 0.20535418391227722, -0.30302610993385315, -0.2108842134475708, -0.011054200120270252, 0.12214095890522003, 0.12548592686653137, -0.20404386520385742, -0.14100225269794464, -0.13503003120422363, -0.19316156208515167, -0.055546991527080536, 0.058965813368558884, 0.03889206051826477, -0.009004220366477966, 0.02968679368495941, 0.20064282417297363, -0.17261749505996704, -0.02925935760140419, 0.062105145305395126, -0.03697463870048523, 0.2759610414505005, -0.10728918761014938, 0.15100839734077454, -0.02423478662967682, -0.023356027901172638, -0.08372502028942108, 0.04440731927752495, 0.06499075144529343, 0.10926015675067902, 0.43572908639907837, -0.32330048084259033, 0.005169060081243515, -0.14318789541721344, 0.4188038110733032, 0.42000842094421387, -0.12768761813640594, -0.032554928213357925, 0.26757657527923584, 0.20802392065525055, -0.2950188219547272, 0.037366822361946106, 0.2714633345603943, -0.03802579268813133, 0.1558750569820404, -0.014163129031658173, -0.35535675287246704, -0.06267596781253815, 0.23904304206371307, 0.2084646224975586, 0.31751349568367004, -0.2374272495508194, 0.2764822840690613, 0.40249696373939514, -0.14557980000972748, -0.05050632730126381, 0.2094290554523468, 0.21564772725105286, 0.18871763348579407, 0.4062488079071045, -0.20914125442504883, -0.06681502610445023, -0.2681848406791687, -0.007682856172323227, -0.006877988576889038, -0.34177443385124207, -0.3133026361465454, 0.2086942493915558, -0.26019057631492615, -0.05773027241230011, -0.09595845639705658, 0.12322713434696198, -0.006437839008867741, 0.23407770693302155, -0.2646729350090027, 0.25018182396888733, -0.12144013494253159, 0.1292594075202942, -0.32428666949272156, -0.28474268317222595, -0.05672810226678848, 0.07683967053890228, 0.19888880848884583, 0.014495566487312317, -0.055037856101989746, 0.337654709815979, -0.18210773169994354, -0.1501639485359192, 0.11195378750562668, 0.10893800109624863, 0.14404301345348358, -0.3391949534416199, 0.18284648656845093, 0.40510475635528564, 0.2435407042503357, -0.01771729066967964, 0.2930240035057068, 0.5557258725166321, 0.20199190080165863, -0.023248229175806046, 0.031220532953739166, -0.038825515657663345, -0.2050805240869522, -0.0019379891455173492, 0.04816405102610588, 0.11262310296297073, 0.09276311099529266, 0.4001251757144928, 0.255568265914917, -0.17896723747253418, 0.4756476879119873, -0.04718330129981041, 0.2172691524028778, -0.2129569798707962, 0.0010894984006881714, -0.28171977400779724, -0.13849949836730957, -0.01939193159341812, -0.3760954737663269, -0.5250647068023682, 0.17811299860477448, 0.09758518636226654, -0.11990462243556976, 0.13975292444229126, -0.08282701671123505, 0.09841680526733398, 0.06734573096036911, 0.28805011510849, 0.34243112802505493, 0.02833188697695732, -0.3105711042881012, -0.33901673555374146, -0.5134339928627014, 0.21776610612869263, 0.012845713645219803, -0.21419307589530945, -0.13544949889183044, 0.18616436421871185, -0.03891301900148392, -0.010808221995830536, 0.16843757033348083, -0.024787649512290955, -0.03952218219637871, 0.42036595940589905, -0.0725359171628952, -0.1843903660774231, 0.19197727739810944, 0.099515900015831, 0.01146017387509346, -0.33850106596946716, 0.15177921950817108, -0.1491030752658844, 0.16497209668159485, 0.05771168693900108, 0.14526213705539703, -0.14323531091213226, -0.317487508058548, 0.3223503828048706, -0.015066651627421379, 0.365080863237381, -0.21490618586540222, 0.045268841087818146, -0.16830818355083466, -0.20184269547462463, -0.20450596511363983, 0.2363509237766266, 0.26975998282432556, 0.5958459377288818, -0.08098781853914261, -0.13000334799289703, -0.3438374698162079, 0.16638536751270294, -0.09359870851039886, 0.14979016780853271, -0.14216302335262299, 0.13893792033195496, -0.14777109026908875, 0.14565251767635345, 0.022014323621988297, 0.09024842828512192, -0.121273934841156, 0.09546279907226562, -0.410036563873291, -0.43903616070747375, 0.6018208861351013, -0.4525061249732971, -0.19387494027614594, 0.06639736145734787, 0.08592543751001358, 0.08187378197908401, 0.04988006502389908, -0.2079649567604065, 0.28933265805244446, 0.47289738059043884, 0.00520763173699379, -0.01686667837202549, 0.1861228048801422, -0.11905816197395325, 0.031028125435113907, 0.037387263029813766, 0.11894752085208893, 0.24560245871543884, -0.3390645384788513, 0.1885271668434143, -0.1937599927186966 ]
https://github.com/huggingface/datasets/issues/4990
"no-token" is passed to `huggingface_hub` when token is `None`
Hi @Wauplin, thanks for raising this potential issue. The choice of passing `"no-token"` instead of `None` was made in this PR: - #4536 According to the PR description, the reason why it is passed is to avoid that `HfApi.dataset_info` uses the local token when no token should be used.
## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev`
49
"no-token" is passed to `huggingface_hub` when token is `None` ## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev` Hi @Wauplin, thanks for raising this potential issue. The choice of passing `"no-token"` instead of `None` was made in this PR: - #4536 According to the PR description, the reason why it is passed is to avoid that `HfApi.dataset_info` uses the local token when no token should be used.
[ 0.25282400846481323, -0.7009128332138062, 0.04250628128647804, 0.2312164455652237, 0.11068888008594513, -0.28031057119369507, 0.1762472540140152, 0.1530032902956009, -0.11803650856018066, 0.19846761226654053, 0.08779360353946686, 0.02876308001577854, 0.2687619924545288, 0.0580504834651947, 0.0845760852098465, -0.04408738762140274, 0.27017462253570557, -0.03506563603878021, 0.5322906970977783, -0.32041335105895996, -0.21789991855621338, 0.23718753457069397, -0.1049429327249527, 0.38085120916366577, -0.6394857168197632, 0.07482954114675522, -0.15939421951770782, 0.2669043242931366, -0.015096331015229225, -0.1812445968389511, 0.1645791381597519, -0.04049130901694298, -0.23256799578666687, 0.12341736257076263, -0.000126611819723621, -0.04627135023474693, 0.40843600034713745, 0.06062941253185272, -0.3140360116958618, -0.4143059253692627, 0.01903650164604187, -0.0007765274494886398, -0.09132246673107147, -0.04406029358506203, 0.027007941156625748, 0.2185448706150055, -0.10438822209835052, -0.06667807698249817, 0.3671831488609314, 0.20801720023155212, 0.08817261457443237, 0.6495380401611328, -0.37562528252601624, -0.1428489089012146, 0.18395408987998962, 0.48613184690475464, -0.005650943145155907, -0.2408774495124817, 0.2012072205543518, 0.12295104563236237, 0.017035432159900665, 0.1765882670879364, -0.1097235307097435, -0.1377815306186676, 0.3996739089488983, 0.043836917728185654, -0.20209473371505737, 0.023850038647651672, 0.2721705138683319, 0.13055932521820068, -0.04864496737718582, -0.28952494263648987, -0.19320347905158997, -0.2757098376750946, 0.002556579653173685, -0.17450284957885742, 0.11345755308866501, 0.14072246849536896, -0.19053764641284943, 0.11160673201084137, -0.054916396737098694, -0.2882504463195801, -0.1041356548666954, -0.15370413661003113, -0.06295774132013321, 0.501338541507721, -0.14830796420574188, 0.171059250831604, -0.2900908887386322, -0.05619435012340546, -0.34920114278793335, -0.34118977189064026, 0.06551577895879745, 0.2934500575065613, -0.01463746652007103, -0.14405076205730438, 0.039361391216516495, 0.49031153321266174, 0.2832050621509552, 0.023961592465639114, -0.34345218539237976, 0.07495845854282379, -0.1279941201210022, 0.1186927855014801, 0.4073215425014496, 0.007143847644329071, 0.42078807950019836, 0.1695830225944519, 0.1142602264881134, -0.044674575328826904, 0.2928560674190521, -0.10601875931024551, 0.22206474840641022, 0.2904047667980194, -0.16855695843696594, -0.12134408205747604, 0.46528565883636475, -0.2604111135005951, -0.4713539183139801, 0.1557326316833496, -0.2529471814632416, 0.11982256174087524, 0.29630687832832336, 0.43265703320503235, -0.16464027762413025, 0.09872840344905853, -0.0626879334449768, 0.08924943208694458, -0.41285794973373413, -0.194635808467865, -0.30692344903945923, -0.06906644999980927, -0.13488754630088806, 0.13665319979190826, -0.07366760820150375, -0.1343330442905426, 0.15834249556064606, 0.246782585978508, 0.14341163635253906, 0.12145303189754486, -0.2709164619445801, -0.10970467329025269, 0.10381774604320526, 0.37111014127731323, -0.2004730999469757, 0.3106434941291809, 0.22004741430282593, -0.08465458452701569, -0.054280489683151245, 0.2560705244541168, -0.5532349348068237, -0.3108453154563904, 0.006269257515668869, 0.048857539892196655, -0.3807600140571594, 0.01321193017065525, -0.016282029449939728, -0.00840752199292183, -0.18125560879707336, 0.15536744892597198, 0.29027947783470154, 0.2005538046360016, -0.2674747109413147, -0.1957409381866455, 0.2963007092475891, 0.6850907206535339, 0.12335972487926483, -0.48841023445129395, 0.24067451059818268, -0.4574219882488251, 0.02160966396331787, 0.275145947933197, -0.06121513992547989, 0.0598367303609848, -0.3117484152317047, 0.33493030071258545, -0.08043157309293747, -0.6900413632392883, -0.15908102691173553, 0.18913620710372925, -0.27779310941696167, 0.2532600164413452, -0.006428755819797516, -0.0696425512433052, -0.013080768287181854, -0.07092113792896271, 0.29558461904525757, -0.015433598309755325, 0.046094730496406555, -0.0031389761716127396, -0.3098565936088562, -0.05567397177219391, -0.04352378845214844, 0.04106597229838371, 0.053287163376808167, 0.06916015595197678, -0.19013315439224243, 0.14860466122627258, 0.24064818024635315, 0.1557752937078476, 0.21258297562599182, -0.1398138403892517, 0.6541829705238342, 0.33474600315093994, 0.03679254278540611, 0.09914030879735947, -0.20082637667655945, 0.05690443515777588, -0.12137256562709808, -0.006661534309387207, -0.1604912430047989, -0.5253627896308899, -0.09432145953178406, 0.12205500155687332, 0.056580767035484314, -0.10985139012336731, 0.0013679340481758118, 0.11009988933801651, -0.06289710849523544, 0.13730791211128235, -0.309175044298172, 0.5788797736167908, -0.2973115146160126, 0.23814694583415985, -0.11697736382484436, 0.2789399027824402, 0.11788282543420792, 0.11708679050207138, -0.2825017273426056, 0.31350240111351013, 0.48197340965270996, 0.01790931075811386, 0.05832991376519203, 0.4169589877128601, -0.11005701869726181, 0.0274680033326149, -0.21396404504776, 0.031187012791633606, 0.39361464977264404, 0.027363140136003494, 0.016614612191915512, -0.057572606950998306, 0.19349373877048492, -0.08412529528141022, -0.07971342653036118, 0.5547069907188416, 0.09083763509988785, 0.19668664038181305, -0.08288241177797318, 0.04648751765489578, -0.2564270794391632, -0.07886289060115814, -0.29637929797172546, -0.07338446378707886, 0.11543084681034088, 0.039088159799575806, 0.4299108386039734, 0.02576102316379547, -0.3900131285190582, 0.12158849835395813, 0.37826594710350037, -0.2206641435623169, -0.13408398628234863, 0.03845702111721039, -0.07462560385465622, 0.058696597814559937, 0.24132566154003143, -0.08773058652877808, 0.49751466512680054, 0.10338516533374786, -0.22601264715194702, 0.364108145236969, -0.16906653344631195, -0.1413404941558838, 0.07961255311965942, 0.038478244096040726, -0.235701784491539, -0.04259670525789261, -0.3451566696166992, 0.07580103725194931, -0.1706734299659729, -0.17198435962200165, -0.19945943355560303, 0.02176157385110855, -0.6725218296051025, -0.007498451508581638, -0.13544508814811707, 0.017624881118535995, -0.0860179215669632, -0.28367623686790466, -0.417877197265625, -0.30779728293418884, 0.11611814051866531, -0.12904660403728485, -0.09716784954071045, -0.07559830695390701, 0.0113702192902565, 0.4603869616985321, -0.27592387795448303, -0.16075603663921356, -0.39455491304397583, 0.14157286286354065, -0.1737287938594818, -0.09664681553840637, -0.018271202221512794, 0.3172522783279419, 0.13993889093399048, -0.16712453961372375, -0.05766349285840988, -0.23125208914279938, -0.20626568794250488, 0.10374568402767181, -0.34728747606277466, 0.2120864987373352, 0.19526156783103943, 0.013219699263572693, -0.1514684557914734, 0.03819343075156212, 0.3564912974834442, -0.23940639197826385, -0.2802557051181793, -0.16074271500110626, 0.06752224266529083, -0.09813478589057922, -0.34431976079940796, 0.08099841326475143, -0.011011835187673569, -0.01332923211157322, 0.2939769923686981, -0.24359434843063354, 0.22516493499279022, 0.10122961550951004, -0.1951173096895218, 0.36574041843414307, -0.536934494972229, -0.09115195274353027, -0.2927425801753998, -0.6473979949951172, -0.06407125294208527, -0.22808733582496643, -0.16781742870807648, 0.08007468283176422, 0.16459675133228302, 0.11731031537055969, -0.21613049507141113, -0.24512359499931335, -0.47124630212783813, 0.012020736932754517, 0.11118483543395996, -0.10271362960338593, 0.12209095805883408, 0.20965901017189026, -0.26451992988586426, 0.10174372792243958, -0.21950837969779968, -0.23632636666297913, 0.18933506309986115, -0.2071830928325653, 0.047998931258916855, 0.15424704551696777, -0.1686256229877472, 0.11571353673934937, 0.602837085723877, 0.3053499758243561, 0.2187272310256958, 0.34216806292533875, 0.04971013218164444, 0.5643710494041443, 0.001002378761768341, -0.0904313176870346, -0.1397331953048706, 0.34530869126319885, 0.00585411861538887, 0.2697509229183197, 0.17610934376716614, 0.4712977111339569, 0.05945108085870743, -0.7315977215766907, -0.07403993606567383, -0.2155967354774475, -0.05385778099298477, 0.06236372888088226, -0.06355104595422745, 0.1202593594789505, 0.24670109152793884, -0.2921324074268341, 0.13910305500030518, 0.18578477203845978, 0.30976402759552, 0.20622651278972626, 0.16999122500419617, -0.4312170743942261, -0.23472914099693298, -0.357156902551651, 0.17944422364234924, 0.06608197093009949, 0.24338246881961823, -0.14556916058063507, -0.15842029452323914, 0.30649715662002563, -0.012330109253525734, 0.8055669069290161, 0.020121831446886063, 0.13300883769989014, 0.1061062216758728, -0.07567408680915833, -0.3089897334575653, 0.15237966179847717, -0.2089475393295288, 0.09942410886287689, 0.26032760739326477, 0.667317271232605, -0.31196850538253784, -0.5811099410057068, 0.06087644398212433, -0.32687684893608093, 0.07020905613899231, -0.06272383034229279, -0.35319679975509644, -0.29252105951309204, -0.03670592978596687, 0.2625594139099121, 0.10605824738740921, 0.31654247641563416, -0.1916114240884781, 0.13228827714920044, -0.09270497411489487, 0.12177439779043198, 0.06775487959384918, -0.1213655024766922, 0.2072063684463501, -0.2245224267244339, -0.13887730240821838, 0.26990941166877747, 0.28852856159210205, 0.08862847089767456, 0.38121286034584045, 0.177255779504776, -0.26005756855010986, -0.23154562711715698, 0.028811175376176834, 0.4137208163738251, 0.6540193557739258, 0.1855023056268692, 0.3661128878593445, -0.05466688424348831, 0.3680148124694824, -0.3333972096443176, -0.2806534767150879, 0.23671317100524902, 0.13772408664226532, -0.26952168345451355, 0.041872479021549225, 0.19071097671985626, 0.045639362186193466, 0.04427996277809143, 0.21440951526165009, 0.9848490357398987, -0.25539669394493103, 0.3241305351257324, 0.003496982157230377, 1.118438720703125, 0.48018771409988403, 0.2377057671546936, 0.2564491331577301, -0.13935205340385437, 0.4285786747932434, -0.058412302285432816, -0.1370517611503601, -0.13888967037200928, 0.03729325532913208, -0.09267072379589081, 0.07292604446411133, 0.40154245495796204, -0.19710056483745575, -0.17732959985733032, 0.2346944659948349, -0.025858625769615173, 0.5233023166656494, 0.07935721427202225, 0.007210135459899902, -0.4830867052078247, 0.015793433412909508, -0.3460486829280853, 0.045505449175834656, 0.23562681674957275, 0.3092024028301239, -0.13634620606899261, -0.05110755190253258, -0.14239779114723206, -0.46394890546798706, -0.07768653333187103, -0.2664482593536377, -0.2542100250720978, -0.272263765335083, 0.3798271417617798, 0.25637108087539673, 0.0755835771560669, 0.06943289935588837, 0.6170657277107239, 0.16339105367660522, -0.2901812195777893, 0.18118904531002045, -0.2572132349014282, 0.12980061769485474, -0.10857033729553223, -0.11497195065021515, 0.3253622353076935, 0.06837272644042969, -0.6391893029212952, 0.028612393885850906, -0.222598135471344, -0.12512937188148499, 0.003795310854911804, 0.10632011294364929, 0.10305911302566528, -0.09131340682506561, -0.10924862325191498, -0.0669223815202713, 0.43076464533805847, -0.09297671914100647, 0.05226334556937218, 0.0782671868801117, -0.2342178225517273, -0.06559089571237564, 0.075197733938694, -0.4028373062610626, -0.14880692958831787, 0.46253085136413574, -0.07217295467853546, -0.12307019531726837, 0.3586709201335907, -0.36675363779067993, -0.09533008188009262, -0.05046829953789711, 0.17812877893447876, 0.40001294016838074, -0.44381508231163025, -0.024859141558408737, 0.24847927689552307, 0.06082390248775482, -0.1367492973804474, 0.2818920910358429, -0.1734919548034668, -0.013525798916816711, -0.2561439573764801, -0.2661978006362915, -0.08768555521965027, 0.25175508856773376, -0.1920476257801056, 0.005459379404783249, 0.15935057401657104, 0.351043701171875, 0.23438918590545654, -0.029296578839421272, -0.25017619132995605, 0.06754832714796066, -0.26832249760627747, 0.13979747891426086, 0.013233043253421783, 0.07227752357721329, 0.21494676172733307, -0.016996663063764572, -0.03543834760785103, 0.2562524676322937, -0.23757775127887726, -0.10938090831041336, -0.20280341804027557, 0.20634745061397552, 0.15955814719200134, -0.060117654502391815, -0.07542435824871063, 0.06890127062797546, 0.12192417681217194, -0.06130380183458328, 0.5028708577156067, 0.6680660843849182, 0.07629229128360748, 0.06803088635206223, 0.3739415407180786, 0.5166708827018738, -0.07344034314155579, 0.10380835831165314, 0.4145137071609497, 0.17365315556526184, -0.14300385117530823, -0.07713519781827927, -0.5090893507003784, 0.01339816302061081, 0.3384990990161896, 0.23518866300582886, 0.318719744682312, 0.2214258313179016, -0.011831670999526978, 0.06122271344065666, -0.0970919281244278, -0.1270315796136856, 0.02288031578063965, 0.0050554461777210236, -0.1211099848151207, -0.07281310856342316, 0.39185526967048645, 0.13497532904148102, 0.04513564705848694, -0.013188006356358528, 0.19708757102489471, 0.03214562311768532, -0.06480304896831512, 0.2612247169017792, 0.3078211545944214, 0.1345263123512268, 0.3217322826385498, -0.04504005238413811, 0.47024649381637573, -0.032339390367269516, 0.14493291079998016, 0.2012394219636917, -0.10533642768859863, 0.1183800920844078, 0.22501389682292938, -0.01856337860226631, 0.08544355630874634, 0.3011559545993805, -0.05762217193841934, 0.3215250074863434, -0.15965184569358826, 0.2590433359146118, -0.08520107716321945, -0.264621376991272, 0.07404109835624695, 0.16687841713428497, -0.267020046710968, -0.04891267418861389, -0.25982075929641724, 0.4259207248687744, -0.02889774739742279, -0.1682242900133133, 0.001557881012558937, 0.2937111556529999, -0.32656362652778625, -0.3424427807331085, -0.22236093878746033, -0.08381348103284836, -0.23735326528549194, -0.139332115650177, 0.11289636790752411, -0.37153321504592896, 0.10633048415184021, -0.16665534675121307, -0.15403331816196442, -0.07976087927818298, -0.15714210271835327, 0.32852381467819214, 0.19371889531612396, 0.026691827923059464, 0.0006602536886930466, -0.17698858678340912, 0.06912030279636383, 0.36991095542907715, 0.2760343849658966, 0.38188108801841736, 0.19929562509059906, 0.21049943566322327, 0.24000808596611023, -0.05207803472876549, 0.0514906644821167, 0.09569370001554489, 0.07726345211267471, -0.032675184309482574, -0.08696113526821136, 0.13541625440120697, 0.09026696532964706, -0.13105471432209015, -0.15656013786792755, -0.025073502212762833, 0.2712011933326721, -0.4053788483142853, 0.6612571477890015, -0.36677369475364685, 0.10121191293001175, -0.36453375220298767, -0.04772204905748367, -0.5253648161888123, 0.1372220814228058, -0.03676576539874077, -0.06558078527450562, 0.09744074940681458, -0.42186668515205383, 0.028352264314889908, -0.12490791082382202, 0.18534351885318756, 0.17141468822956085, -0.15737563371658325, -0.37021705508232117, -0.17031557857990265, -0.4630623757839203, 0.138402059674263, 0.01707533188164234, 0.18376995623111725, 0.022225381806492805, -0.0442088320851326, -0.4703160226345062, -0.20497751235961914, -0.12853218615055084, 0.13444943726062775, 0.19221220910549164, -0.24849674105644226, 0.06667181849479675, 0.3383435606956482, -0.008756741881370544, -0.18720167875289917, 0.1571238934993744, -0.14612847566604614, 0.2628055512905121, -0.03455666825175285, -0.12349832057952881, 0.025704968720674515, 0.15602923929691315, -0.0829354077577591, -0.3260144889354706, 0.1375076174736023, 0.10199443995952606, 0.09395089000463486, 0.05974181741476059, -0.07947006076574326, -0.31380873918533325, 0.10082121193408966, -0.39738932251930237, -0.1559581458568573, -0.2368951141834259, 0.1696014255285263, -0.04924240708351135, -0.35236454010009766, 0.0018803966231644154, 0.24401399493217468, 0.14916051924228668, 0.003744711633771658, -0.08226705342531204, 0.5328118205070496, -0.4321819543838501, 0.055631861090660095, -0.043031562119722366, 0.12780188024044037, 0.06821320950984955, 0.44031068682670593, -0.2916111350059509, -0.08657120913267136, 0.6262447834014893, -0.5184198617935181, 0.009984355419874191, -0.13038350641727448, 0.45519232749938965, 0.2080479860305786, -0.7693551182746887, -0.7066336274147034, -0.2595740258693695, 0.22546188533306122, 0.0016137156635522842, -0.2335728406906128, 0.13452766835689545, -0.14490461349487305, -0.05447176843881607, -0.12133373320102692, 0.1373334527015686, 0.08835600316524506, 0.036253489553928375, 0.7579727172851562, -0.3820362687110901 ]
https://github.com/huggingface/datasets/issues/4990
"no-token" is passed to `huggingface_hub` when token is `None`
Hi @albertvillanova , thanks for finding the original issue :+1: As of next release of `huggingface_hub`, the `token` argument will be deprecated in favor of the `use_auth_token` argument in `dataset_info` method. This change as been done by @SBrandeis in https://github.com/huggingface/huggingface_hub/pull/928. `use_auth_token` is a bit different and allow the case "don't sent the cached token by default". If you want to strictly avoid sending the cached token from `datasets`, you can use: ```py # token=token if token else "no-token", <- will fail because token is not valid use_auth_token=token if token else False, # using the new `use_auth_token` parameter ``` And as a note, I am currently updating the "don't send the cached token by default"-rule to "don't send the cached token on public repos by default but use it in private ones" in https://github.com/huggingface/huggingface_hub/pull/1064. This will not change the fact that `use_auth_token=False` doesn't send the token at all.
## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev`
147
"no-token" is passed to `huggingface_hub` when token is `None` ## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev` Hi @albertvillanova , thanks for finding the original issue :+1: As of next release of `huggingface_hub`, the `token` argument will be deprecated in favor of the `use_auth_token` argument in `dataset_info` method. This change as been done by @SBrandeis in https://github.com/huggingface/huggingface_hub/pull/928. `use_auth_token` is a bit different and allow the case "don't sent the cached token by default". If you want to strictly avoid sending the cached token from `datasets`, you can use: ```py # token=token if token else "no-token", <- will fail because token is not valid use_auth_token=token if token else False, # using the new `use_auth_token` parameter ``` And as a note, I am currently updating the "don't send the cached token by default"-rule to "don't send the cached token on public repos by default but use it in private ones" in https://github.com/huggingface/huggingface_hub/pull/1064. This will not change the fact that `use_auth_token=False` doesn't send the token at all.
[ 0.2819623053073883, -0.6787631511688232, 0.039504390209913254, 0.2238372266292572, 0.13433870673179626, -0.2506917119026184, 0.2463054358959198, 0.19882100820541382, -0.12347112596035004, 0.12250350415706635, 0.04897645115852356, 0.1355794221162796, 0.06179715320467949, -0.13884446024894714, 0.0019435472786426544, 0.13724534213542938, 0.25545844435691833, -0.12251020967960358, 0.4599262475967407, -0.2719452977180481, -0.1777893304824829, 0.27390769124031067, -0.16282376646995544, 0.21596504747867584, -0.6497718095779419, -0.013577288016676903, -0.1275668889284134, 0.24517077207565308, -0.014017673209309578, -0.19826729595661163, 0.26982372999191284, -0.048690978437662125, -0.3063008189201355, 0.16135677695274353, -0.00012452487135306, -0.036968719214200974, 0.4338587522506714, 0.036532431840896606, -0.32368671894073486, -0.4407961368560791, 0.010586768388748169, -0.07551129907369614, -0.010069230571389198, -0.10153215378522873, -0.0192225631326437, 0.21715697646141052, -0.043757617473602295, -0.06507332623004913, 0.5164388418197632, 0.22114120423793793, 0.12940776348114014, 0.5648082494735718, -0.289737731218338, -0.12988831102848053, 0.09117356687784195, 0.37876588106155396, 0.0042595695704221725, -0.14312538504600525, 0.2341294288635254, 0.2369501292705536, 0.002185314893722534, 0.20911970734596252, -0.15387432277202606, -0.18461430072784424, 0.3992803692817688, 0.021712690591812134, -0.2699059247970581, 0.02062944322824478, 0.15799124538898468, 0.07439923286437988, -0.06846552342176437, -0.25902697443962097, -0.1630145013332367, -0.4197812080383301, 0.03194556385278702, -0.14859867095947266, 0.16123342514038086, 0.07369951158761978, -0.1917675882577896, 0.04692269116640091, -0.24638615548610687, -0.32966408133506775, -0.1063942238688469, -0.12903323769569397, 0.027483850717544556, 0.40102419257164, -0.20482206344604492, 0.2077508270740509, -0.2491680532693863, -0.12684974074363708, -0.3626932203769684, -0.3328031599521637, 0.07786685228347778, 0.31578993797302246, -0.1198553591966629, -0.20836785435676575, 0.12021186947822571, 0.494999498128891, 0.24798405170440674, 0.26224231719970703, -0.35630354285240173, 0.125693216919899, -0.06606823951005936, 0.06476258486509323, 0.27688607573509216, 0.09884032607078552, 0.454877644777298, 0.057498060166835785, 0.08190949261188507, -0.07873351126909256, 0.2807527482509613, -0.06126600503921509, 0.1336956024169922, 0.22277450561523438, -0.011672038584947586, -0.09491406381130219, 0.4664672017097473, -0.15264198184013367, -0.3480122983455658, 0.010715537704527378, -0.17385002970695496, 0.17134827375411987, 0.32308265566825867, 0.3776448667049408, -0.17654044926166534, 0.03432128578424454, -0.07088783383369446, 0.13109448552131653, -0.2966043949127197, -0.16707965731620789, -0.31278035044670105, 0.031018313020467758, -0.08208779245615005, 0.06091587245464325, -0.0311222393065691, -0.21179237961769104, 0.09840306639671326, 0.2553436756134033, 0.18831846117973328, 0.04988738149404526, -0.2304408997297287, -0.036312658339738846, 0.11254306137561798, 0.19982600212097168, -0.2076665461063385, 0.3713807165622711, 0.2124861627817154, -0.06719920784235, -0.09435033798217773, 0.213885098695755, -0.7289926409721375, -0.357936829328537, -0.004690034314990044, 0.06276409327983856, -0.5715981721878052, 0.04068174213171005, -0.10780096799135208, 0.039209604263305664, -0.11550261825323105, 0.15783987939357758, 0.27043744921684265, 0.20741866528987885, -0.25985872745513916, -0.24515442550182343, 0.23232746124267578, 0.6537157893180847, 0.2733214199542999, -0.4900550842285156, 0.17415417730808258, -0.32890626788139343, -0.06966713815927505, 0.18371343612670898, -0.0851665586233139, -0.015546455979347229, -0.29694658517837524, 0.39259010553359985, 0.0026957541704177856, -0.7580928802490234, -0.23264211416244507, 0.09497811645269394, -0.23961348831653595, 0.3107399344444275, -0.06511317938566208, -0.057328131049871445, 0.01518663577735424, -0.08757665753364563, 0.21466755867004395, -0.04696185141801834, 0.05631376430392265, -0.023436078801751137, -0.279425710439682, -0.06879591941833496, 0.08995313942432404, 0.07228340208530426, 0.04188903793692589, -0.0326569601893425, -0.1977469027042389, 0.19555030763149261, 0.16022560000419617, 0.18714216351509094, 0.17462699115276337, -0.1446685940027237, 0.5952785611152649, 0.16717484593391418, 0.018028434365987778, 0.07639269530773163, -0.22463896870613098, 0.16973134875297546, 0.042253993451595306, 0.0553954616189003, -0.2350367158651352, -0.404827356338501, -0.0684354305267334, 0.003907041624188423, 0.0007710009813308716, -0.08108280599117279, 0.04024418443441391, -0.038996823132038116, 0.030172158032655716, 0.19318155944347382, -0.2960582673549652, 0.6500256061553955, -0.26868757605552673, 0.27444976568222046, -0.30763354897499084, 0.18984699249267578, 0.2085925191640854, 0.030702922493219376, -0.30851078033447266, 0.2539825141429901, 0.48142626881599426, 0.06804007291793823, 0.11658421903848648, 0.4634469747543335, -0.15359504520893097, 0.12984156608581543, -0.3782351613044739, 0.02263970673084259, 0.3361734449863434, 0.0321757011115551, -0.09961927682161331, -0.11083067953586578, 0.15547169744968414, -0.08350639790296555, -0.047659046947956085, 0.5120276808738708, 0.10990011692047119, 0.18218398094177246, -0.12291866540908813, 0.07395031303167343, -0.30803245306015015, -0.07079201936721802, -0.3357142508029938, -0.059649430215358734, 0.03533289581537247, 0.0367342084646225, 0.4451730251312256, -0.09454553574323654, -0.19589301943778992, 0.06038982793688774, 0.3094995617866516, -0.14139702916145325, 0.013667169958353043, 0.03398016095161438, -0.0444163903594017, -0.020204493775963783, 0.2821655869483948, -0.06015360727906227, 0.49094158411026, 0.08257050067186356, -0.17243602871894836, 0.3516014516353607, -0.11634176224470139, -0.1434890776872635, 0.13154169917106628, 0.07462020963430405, -0.14435042440891266, -0.059309639036655426, -0.25680896639823914, 0.043469347059726715, -0.1444098800420761, -0.1319529265165329, -0.09294223040342331, 0.0551893413066864, -0.6178567409515381, -0.019092708826065063, -0.1800832897424698, 0.09263139218091965, -0.019360460340976715, -0.3308619260787964, -0.4460860788822174, -0.3393978774547577, 0.12443116307258606, -0.06649430096149445, -0.08485274016857147, 0.024494268000125885, -0.009747987613081932, 0.44404369592666626, -0.20221221446990967, -0.18142732977867126, -0.3281395137310028, 0.07775425165891647, -0.09172769635915756, -0.062214236706495285, 0.015069364570081234, 0.11612250655889511, 0.13012513518333435, -0.21513986587524414, -0.01061120443046093, -0.1566406637430191, -0.16966207325458527, 0.05885003134608269, -0.40413326025009155, 0.2044813632965088, 0.23146267235279083, -0.03245896100997925, -0.1696082055568695, 0.06477060168981552, 0.3389081656932831, -0.28103581070899963, -0.2892269492149353, -0.09681020677089691, 0.03967531770467758, 0.007707169279456139, -0.3801308870315552, 0.11598418653011322, -0.03293370455503464, -0.010862370952963829, 0.26392072439193726, -0.15518461167812347, 0.1708129346370697, 0.2938934564590454, -0.1567639410495758, 0.3465634286403656, -0.5291112661361694, 0.02991691417992115, -0.3286778926849365, -0.715535581111908, 0.14103588461875916, -0.17918193340301514, -0.08448898792266846, 0.12322923541069031, 0.11782316863536835, 0.2224850207567215, -0.18057510256767273, -0.20051461458206177, -0.556168794631958, 0.03942050784826279, 0.09487167000770569, -0.12770049273967743, 0.056876689195632935, 0.2841078042984009, -0.25021490454673767, 0.11454272270202637, -0.2209411859512329, -0.19639413058757782, 0.14386525750160217, -0.23971018195152283, 0.0672215074300766, 0.17657122015953064, -0.11966388672590256, 0.2148880660533905, 0.5595654845237732, 0.3449274003505707, 0.21350431442260742, 0.23111067712306976, 0.04457496851682663, 0.5715939402580261, 0.0846123918890953, -0.11174263060092926, -0.12310345470905304, 0.3334944248199463, 0.11186061799526215, 0.19900377094745636, 0.2786006033420563, 0.4592927098274231, 0.04777316749095917, -0.7179660201072693, -0.12932857871055603, -0.2711862325668335, -0.06782826036214828, -0.059831373393535614, -0.07878563553094864, 0.10043992102146149, 0.3144019544124603, -0.3363566994667053, -0.011171435937285423, 0.062435176223516464, 0.2841199040412903, 0.2557793855667114, 0.14259269833564758, -0.4369906485080719, -0.14412342011928558, -0.38779670000076294, 0.16808025538921356, 0.07970347255468369, 0.2570527493953705, -0.002426832914352417, -0.21388950943946838, 0.2542046904563904, -0.015608733519911766, 0.7641457319259644, 0.09049545228481293, 0.15508213639259338, 0.029519598931074142, -0.09425937384366989, -0.4514729082584381, 0.18089359998703003, -0.11400116980075836, 0.0632794052362442, 0.18858197331428528, 0.6145703196525574, -0.33012017607688904, -0.5176071524620056, -0.06377427279949188, -0.30596375465393066, 0.09419037401676178, -0.06113724038004875, -0.26433065533638, -0.32488003373146057, -0.05183209851384163, 0.2455475628376007, 0.16135947406291962, 0.33373117446899414, -0.18689186871051788, 0.18699029088020325, -0.08508729189634323, 0.06815312057733536, 0.19130633771419525, -0.0997629463672638, 0.2717455327510834, -0.20513419806957245, -0.08987908810377121, 0.2862410545349121, 0.11446850746870041, -0.06442775577306747, 0.39316293597221375, 0.20095042884349823, -0.2937603294849396, -0.2898522913455963, 0.12768208980560303, 0.27464157342910767, 0.6110662221908569, 0.07789980620145798, 0.4367973506450653, -0.16657231748104095, 0.28626129031181335, -0.2864495813846588, -0.2146797925233841, 0.21676671504974365, 0.12886513769626617, -0.33903390169143677, 0.0831008180975914, 0.15476691722869873, 0.07580505311489105, 0.05800709128379822, 0.2073860913515091, 0.8591707944869995, -0.29237523674964905, 0.16116687655448914, -0.07411467283964157, 1.0688252449035645, 0.6081933379173279, 0.2837769687175751, 0.26703694462776184, -0.017976943403482437, 0.5454409122467041, 0.06587713956832886, -0.05309431254863739, -0.08460144698619843, 0.032673876732587814, -0.06287927180528641, 0.08048459887504578, 0.30084332823753357, -0.14860957860946655, -0.0987178236246109, 0.25370970368385315, -0.03219331055879593, 0.6934304237365723, 0.04369227588176727, 0.013756021857261658, -0.5242608189582825, 0.007579086348414421, -0.31883835792541504, 0.10730579495429993, 0.18127305805683136, 0.20215128362178802, -0.050295040011405945, -0.05094122886657715, -0.0706043615937233, -0.5074758529663086, -0.0754481852054596, -0.2187400460243225, -0.16249465942382812, -0.09593541920185089, 0.4369827210903168, 0.11203645169734955, 0.10408219695091248, 0.0920703262090683, 0.566498875617981, 0.1913154274225235, -0.33080345392227173, 0.21870966255664825, -0.2354556918144226, 0.12953998148441315, -0.094081349670887, -0.13002845644950867, 0.36515888571739197, 0.09207572788000107, -0.4977583885192871, 0.06748399883508682, -0.13373583555221558, -0.21232633292675018, -0.08212730288505554, 0.1837487518787384, 0.09986033290624619, -0.09166254103183746, -0.19254305958747864, -0.06042082607746124, 0.41166356205940247, -0.14073729515075684, 0.05807911232113838, 0.16772621870040894, -0.18981941044330597, 0.032916225492954254, -0.03226155415177345, -0.32958418130874634, -0.11310011148452759, 0.516077995300293, -0.07652106881141663, -0.2231992781162262, 0.3700851798057556, -0.36773455142974854, -0.12962865829467773, -0.0019632093608379364, 0.2086840569972992, 0.3852386176586151, -0.45903339982032776, 0.02781948447227478, 0.21487028896808624, 0.24384705722332, -0.17099697887897491, 0.15008898079395294, -0.25370073318481445, 0.10452765226364136, -0.1740122139453888, -0.2350739687681198, -0.07410813122987747, 0.2398526817560196, -0.1375516653060913, 0.00006084144115447998, 0.18802878260612488, 0.2892306447029114, 0.1314239203929901, -0.09122907370328903, -0.27588507533073425, 0.21489280462265015, -0.21496078372001648, 0.07133511453866959, -0.03714573755860329, 0.03347969055175781, 0.3048677444458008, -0.05072429031133652, -0.02649557776749134, 0.2912389636039734, -0.24531444907188416, -0.12622176110744476, -0.26044344902038574, 0.17758892476558685, 0.14437228441238403, -0.12502948939800262, 0.019084952771663666, 0.06155795603990555, 0.1361101120710373, -0.034555584192276, 0.4649166166782379, 0.7254641652107239, 0.12337425351142883, 0.07043895870447159, 0.3834417760372162, 0.5532209277153015, -0.114675372838974, 0.09769586473703384, 0.31374871730804443, 0.22676590085029602, -0.11447766423225403, -0.07463191449642181, -0.43592017889022827, 0.06792697310447693, 0.2680562436580658, 0.25278252363204956, 0.293820858001709, 0.13651686906814575, 0.01614851877093315, 0.04025663435459137, -0.12131023406982422, -0.15252530574798584, -0.017837954685091972, 0.01674240455031395, -0.21995316445827484, -0.09067607671022415, 0.3398289680480957, 0.1281258910894394, 0.1111091822385788, 0.043849509209394455, 0.10502226650714874, 0.10968322306871414, -0.015290096402168274, 0.2624703049659729, 0.1544487327337265, 0.1352924108505249, 0.3322938084602356, -0.04436888545751572, 0.6364994049072266, -0.1077495664358139, 0.19662638008594513, 0.10894423723220825, -0.1537141054868698, -0.029423590749502182, 0.318905770778656, -0.09303043782711029, 0.06263014674186707, 0.1953684538602829, -0.1510220170021057, 0.46197250485420227, -0.16052758693695068, 0.08603353798389435, -0.037136659026145935, -0.18439562618732452, -0.05431492254137993, 0.16307832300662994, -0.23051562905311584, 0.028589315712451935, -0.3135257959365845, 0.4649363160133362, -0.10100118070840836, -0.1421852707862854, 0.051345013082027435, 0.2967621386051178, -0.31308045983314514, -0.2895292639732361, -0.17601890861988068, -0.10955768823623657, -0.3141103684902191, -0.18654422461986542, 0.028213776648044586, -0.5118725895881653, 0.025307171046733856, -0.12235206365585327, -0.19202487170696259, -0.061373449862003326, -0.15827882289886475, 0.33817222714424133, 0.2414611577987671, 0.01774226501584053, 0.07121593505144119, -0.056424304842948914, 0.11249929666519165, 0.39720672369003296, 0.2665274143218994, 0.4273182153701782, 0.12636807560920715, 0.23726828396320343, 0.20460651814937592, 0.03825170919299126, 0.05729205906391144, 0.13257917761802673, 0.20797099173069, -0.04283913969993591, -0.06944401562213898, 0.055955249816179276, 0.13462550938129425, -0.15147040784358978, -0.008255109190940857, -0.07920631766319275, 0.15740691125392914, -0.4377199113368988, 0.6959642171859741, -0.3738573491573334, 0.13675785064697266, -0.41962864995002747, 0.06634955108165741, -0.4582827389240265, 0.03977376967668533, 0.0077069541439414024, 0.005512204021215439, 0.024993062019348145, -0.5054634809494019, 0.046546317636966705, -0.07768793404102325, 0.1669529229402542, 0.14818339049816132, -0.20281577110290527, -0.3470047116279602, -0.19185230135917664, -0.4100668430328369, 0.20196875929832458, 0.0310058631002903, 0.15244704484939575, -0.10819502919912338, -0.02954660728573799, -0.4385089576244354, -0.15223753452301025, -0.1751485913991928, 0.1161535307765007, 0.04994867742061615, -0.3476158678531647, 0.017010364681482315, 0.3727249503135681, 0.06171037256717682, -0.2799060642719269, 0.21626006066799164, -0.08095329254865646, 0.23020289838314056, -0.07080288976430893, -0.10335763543844223, 0.003991575911641121, 0.10625788569450378, -0.04794635623693466, -0.2220613658428192, 0.19835036993026733, 0.10495908558368683, 0.11575134098529816, 0.08730047196149826, -0.12818849086761475, -0.3889535367488861, 0.024257004261016846, -0.3318863809108734, -0.09864487498998642, -0.20397068560123444, 0.18349438905715942, -0.05877251923084259, -0.35830414295196533, 0.059406429529190063, 0.17349986732006073, 0.06314650923013687, -0.06217272952198982, -0.11294987052679062, 0.4414355158805847, -0.40997573733329773, 0.15169228613376617, -0.11670458316802979, 0.15564686059951782, 0.02064581587910652, 0.48775291442871094, -0.29524171352386475, -0.19745944440364838, 0.5999674797058105, -0.4951472580432892, -0.04888811707496643, -0.23806291818618774, 0.4273163080215454, 0.19144785404205322, -0.7289313673973083, -0.7252330183982849, -0.24900203943252563, 0.28478795289993286, 0.08259154856204987, -0.16949522495269775, 0.15499354898929596, -0.14171087741851807, -0.047733522951602936, -0.07902388274669647, 0.1451229751110077, 0.10634661465883255, 0.07347334921360016, 0.7381657958030701, -0.40394461154937744 ]
https://github.com/huggingface/datasets/issues/4990
"no-token" is passed to `huggingface_hub` when token is `None`
What is current strategy in term of updating `huggingface_hub` version in `datasets` ? I don't want to break stuff in the next release so let's find a proper solution :)
## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev`
30
"no-token" is passed to `huggingface_hub` when token is `None` ## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev` What is current strategy in term of updating `huggingface_hub` version in `datasets` ? I don't want to break stuff in the next release so let's find a proper solution :)
[ 0.1979009062051773, -0.6772456169128418, -0.013981885276734829, 0.22226983308792114, -0.02464129775762558, -0.3031509220600128, 0.1233503669500351, 0.1820434033870697, -0.20400692522525787, 0.14178745448589325, 0.08585768193006516, 0.10670121014118195, 0.007463082671165466, 0.0384393036365509, -0.046664606779813766, 0.07631634920835495, 0.3889431357383728, 0.0005710646510124207, 0.35122889280319214, -0.2550968527793884, -0.2122323215007782, 0.20182056725025177, -0.21751104295253754, 0.19850483536720276, -0.6096742749214172, -0.07463935762643814, -0.15037621557712555, 0.18715915083885193, -0.12790219485759735, -0.2964804768562317, 0.25167208909988403, 0.09892250597476959, -0.24897269904613495, 0.3206060826778412, -0.00012919239816255867, -0.14359238743782043, 0.45625513792037964, 0.05222928524017334, -0.22118623554706573, -0.4762818217277527, -0.04894926771521568, -0.1733340173959732, 0.0011353334411978722, 0.005684196949005127, 0.01804104819893837, 0.19491024315357208, -0.03812001645565033, -0.03804920241236687, 0.48881661891937256, 0.21102946996688843, 0.0931394174695015, 0.6312358379364014, -0.14649227261543274, -0.09836740046739578, 0.15717872977256775, 0.3939296007156372, 0.006565237417817116, -0.06360644102096558, 0.33704930543899536, 0.3084692358970642, 0.06577509641647339, 0.28110745549201965, -0.08360661566257477, -0.2557345926761627, 0.4201447069644928, -0.05854235589504242, -0.2519899308681488, -0.05608927458524704, 0.15377271175384521, 0.0750524252653122, 0.014436475932598114, -0.2577454149723053, -0.35203462839126587, -0.438473105430603, 0.0025622094981372356, -0.13682560622692108, 0.23372355103492737, -0.04895438998937607, -0.10632689297199249, 0.08903816342353821, -0.1861540526151657, -0.5076554417610168, -0.14150786399841309, -0.12342332303524017, -0.00441167876124382, 0.4680968225002289, -0.2503301203250885, 0.17266753315925598, -0.3270585834980011, -0.10503904521465302, -0.2831006944179535, -0.2592844069004059, 0.06663396209478378, 0.2458563596010208, -0.08970922231674194, -0.21253880858421326, 0.09279923141002655, 0.5309733152389526, 0.18294349312782288, 0.2079530954360962, -0.33685630559921265, 0.1080668643116951, -0.07687463611364365, 0.0747980922460556, 0.3519688546657562, 0.016121620312333107, 0.5596004724502563, 0.04852667450904846, 0.1908506453037262, 0.013792874291539192, 0.33859074115753174, 0.0077161043882369995, 0.07785570621490479, 0.20201580226421356, -0.09806783497333527, -0.07152682542800903, 0.5280947685241699, -0.16011054813861847, -0.29460713267326355, 0.08175263553857803, -0.16475611925125122, 0.1325816810131073, 0.30295124650001526, 0.2798555791378021, -0.2945396900177002, 0.1572277843952179, -0.07933938503265381, -0.04112118482589722, -0.3068239986896515, -0.15338511765003204, -0.27089160680770874, -0.06665857136249542, -0.1770838052034378, 0.08043839782476425, -0.06354803591966629, -0.27610254287719727, 0.12918603420257568, 0.19969703257083893, 0.08622506260871887, -0.025421811267733574, -0.36751145124435425, -0.021836260333657265, 0.04047790914773941, 0.22111694514751434, -0.3213081359863281, 0.3425711393356323, 0.03027084469795227, -0.035739414393901825, -0.09533195942640305, 0.1330297887325287, -0.6196334958076477, -0.30588358640670776, -0.06223573535680771, 0.01560451090335846, -0.4783511757850647, 0.035881128162145615, -0.07762957364320755, 0.17127123475074768, -0.19560882449150085, 0.029559362679719925, 0.273730993270874, 0.28225797414779663, -0.3362422585487366, -0.22924984991550446, 0.25871771574020386, 0.6394556760787964, 0.10367657244205475, -0.4502130448818207, 0.15337760746479034, -0.30512917041778564, -0.1510217785835266, 0.11997061967849731, 0.0010701606515794992, 0.013320885598659515, -0.22560849785804749, 0.2043144255876541, 0.07324299216270447, -0.7063454985618591, -0.3408154249191284, 0.015351089648902416, -0.2349192202091217, 0.25158169865608215, 0.005125135183334351, 0.041586991399526596, 0.03527754172682762, -0.09954362362623215, 0.14001856744289398, -0.08638139814138412, 0.048656146973371506, -0.12661431729793549, -0.2795606851577759, -0.057073935866355896, -0.005078203976154327, 0.04187236353754997, 0.1309443563222885, 0.013587415218353271, -0.17308053374290466, 0.22812382876873016, 0.13225741684436798, 0.24438880383968353, 0.18681694567203522, -0.06956082582473755, 0.6510666012763977, 0.29017260670661926, 0.019983092322945595, -0.04114273935556412, -0.3978241980075836, 0.10655107349157333, -0.11303658038377762, -0.12102141976356506, -0.1905844658613205, -0.42404723167419434, -0.12800848484039307, 0.03301330655813217, 0.10356426239013672, -0.058936167508363724, -0.03049614280462265, 0.046242717653512955, 0.12168216705322266, 0.15500445663928986, -0.37361425161361694, 0.5799098610877991, -0.2627902925014496, 0.3010067343711853, -0.32839518785476685, 0.2442571371793747, 0.15195578336715698, -0.01987580582499504, -0.2028283327817917, 0.2714024484157562, 0.33354613184928894, -0.05707411468029022, 0.17015981674194336, 0.5013406276702881, -0.1269373595714569, 0.19513259828090668, -0.3108406960964203, 0.029904231429100037, 0.32251855731010437, 0.10889706015586853, -0.09535496681928635, -0.08233366906642914, 0.09895052760839462, 0.035882577300071716, -0.060494616627693176, 0.5116099715232849, 0.08793799579143524, 0.08341336250305176, -0.08025259524583817, 0.016512220725417137, -0.38739830255508423, -0.009291980415582657, -0.38597744703292847, -0.05276768282055855, -0.015683185309171677, 0.006569294258952141, 0.5597975254058838, 0.03514077886939049, -0.3278222680091858, 0.07199889421463013, 0.399276465177536, -0.1567603200674057, 0.04782119393348694, 0.07238414883613586, 0.04463772103190422, -0.07199758291244507, 0.1940620094537735, -0.07164189964532852, 0.3866882920265198, 0.09391343593597412, -0.14555197954177856, 0.3750596344470978, -0.06023877114057541, -0.1328597366809845, 0.10859668999910355, 0.15242570638656616, -0.12780237197875977, 0.07619539648294449, -0.3153550326824188, 0.065818652510643, -0.1412351280450821, -0.053605884313583374, -0.16462861001491547, 0.0905539020895958, -0.5545888543128967, -0.08550377190113068, -0.23553602397441864, 0.05327083170413971, -0.17609940469264984, -0.3191896378993988, -0.477438747882843, -0.2287173867225647, 0.1628861278295517, 0.03722032159566879, -0.10969950258731842, 0.04905824363231659, 0.12360447645187378, 0.5037539005279541, -0.2425704002380371, 0.014015650376677513, -0.3399134576320648, 0.11315179616212845, -0.22216787934303284, -0.10285168886184692, 0.02734309807419777, 0.11244187504053116, 0.17345410585403442, -0.30364474654197693, 0.05616338551044464, -0.21334673464298248, -0.36277472972869873, 0.022653141990303993, -0.3453841209411621, 0.21301430463790894, 0.2598731219768524, -0.023058749735355377, -0.2030918449163437, 0.10943734645843506, 0.2686562240123749, -0.3896625339984894, -0.26853692531585693, -0.22582925856113434, 0.028176575899124146, 0.07106198370456696, -0.21109113097190857, -0.03726319968700409, -0.10134696215391159, -0.07847001403570175, 0.3404286503791809, -0.2807663083076477, 0.22613851726055145, 0.23054158687591553, -0.17155632376670837, 0.26903435587882996, -0.5519441962242126, -0.044520094990730286, -0.19506202638149261, -0.6775161027908325, 0.09404801577329636, -0.15183843672275543, -0.1359967440366745, 0.10985629260540009, 0.13757741451263428, 0.12124572694301605, -0.16048866510391235, -0.1838824450969696, -0.5034887790679932, 0.10234126448631287, 0.044621583074331284, -0.03576736897230148, 0.06786705553531647, 0.3554459810256958, -0.2305065095424652, 0.11883306503295898, -0.25718626379966736, -0.20931942760944366, 0.1121293306350708, -0.23004737496376038, 0.08978580683469772, 0.26543664932250977, -0.08453024178743362, 0.20021632313728333, 0.42596375942230225, 0.44159135222435, 0.17610785365104675, 0.2396364063024521, 0.16268379986286163, 0.6587650775909424, 0.09233816713094711, -0.11686524003744125, -0.18190722167491913, 0.37874260544776917, 0.07371573895215988, 0.27395135164260864, 0.29511958360671997, 0.5496598482131958, -0.028397057205438614, -0.7838426232337952, -0.10110199451446533, -0.1908169388771057, -0.05228080600500107, -0.054393917322158813, -0.01586812734603882, 0.10380922257900238, 0.23060756921768188, -0.2837703824043274, 0.048267800360918045, 0.10492904484272003, 0.25185808539390564, 0.27075493335723877, 0.21366222202777863, -0.45047998428344727, -0.25001782178878784, -0.38747504353523254, 0.17699694633483887, 0.1825597733259201, 0.3207858204841614, 0.028632309287786484, -0.11864994466304779, 0.2465086579322815, 0.02319701761007309, 0.7336937189102173, 0.004583224654197693, 0.12960085272789001, -0.0683804303407669, -0.11800643801689148, -0.37614670395851135, 0.1335298866033554, -0.2261563241481781, 0.11953689903020859, 0.19188936054706573, 0.6875103116035461, -0.29065150022506714, -0.5321255922317505, 0.06082988530397415, -0.3052634298801422, 0.08849945664405823, -0.06451580673456192, -0.32801714539527893, -0.18548259139060974, 0.008217958733439445, 0.25936758518218994, 0.0966913104057312, 0.2504614293575287, -0.12365616112947464, 0.01771463081240654, -0.07731328904628754, 0.018554475158452988, 0.146523579955101, -0.09027513861656189, 0.25744369626045227, -0.14830897748470306, -0.12981939315795898, 0.2888353765010834, 0.16424521803855896, 0.07993060350418091, 0.3341315686702728, 0.10660137236118317, -0.277447372674942, -0.21474605798721313, 0.16956228017807007, 0.4118077754974365, 0.5778535604476929, 0.12307795882225037, 0.3987257480621338, -0.1621004343032837, 0.32334786653518677, -0.34987297654151917, -0.24212703108787537, 0.278290718793869, 0.21937908232212067, -0.3394964635372162, 0.05887698382139206, 0.25270652770996094, 0.15612247586250305, -0.022069193422794342, 0.29568201303482056, 0.8457600474357605, -0.2706335186958313, 0.08999541401863098, -0.06121470779180527, 1.0871509313583374, 0.5567561388015747, 0.17885933816432953, 0.19660481810569763, -0.1277560591697693, 0.6671077609062195, 0.057266853749752045, -0.06482849270105362, -0.08591531217098236, 0.05401547625660896, -0.11081112921237946, 0.13744816184043884, 0.4092618227005005, -0.16082453727722168, -0.23705974221229553, 0.41164451837539673, -0.015152283012866974, 0.7172441482543945, 0.02752484753727913, 0.023039378225803375, -0.44479477405548096, 0.08467744290828705, -0.5024852156639099, 0.011410955339670181, 0.21373087167739868, 0.26323094964027405, -0.1415867805480957, 0.015451367944478989, -0.08853791654109955, -0.5031681060791016, -0.10431743413209915, -0.3775925934314728, -0.0359138548374176, -0.14177408814430237, 0.42730748653411865, 0.048301100730895996, 0.09803806245326996, 0.1529819518327713, 0.6269032955169678, 0.23711839318275452, -0.24353152513504028, 0.19422748684883118, -0.4117525815963745, 0.04845314845442772, -0.10706336051225662, -0.06661912798881531, 0.31626322865486145, 0.0488201379776001, -0.5407716035842896, 0.02422744408249855, -0.16275754570960999, -0.1427028477191925, -0.1688445657491684, 0.09944236278533936, 0.07074287533760071, -0.028214866295456886, -0.049246374517679214, -0.10795214772224426, 0.41789984703063965, -0.16379696130752563, 0.017583336681127548, 0.07108835130929947, -0.13992191851139069, 0.058411963284015656, 0.060784947127103806, -0.36743825674057007, -0.12189902365207672, 0.5265840291976929, -0.059529438614845276, -0.20573347806930542, 0.3467942476272583, -0.2752044200897217, -0.09193101525306702, -0.006659138947725296, 0.24300381541252136, 0.44303473830223083, -0.4194885194301605, 0.07836469262838364, 0.14421382546424866, 0.14494119584560394, -0.1341129094362259, 0.2907436490058899, -0.06747972965240479, 0.047703906893730164, -0.23078249394893646, -0.2882695198059082, -0.06117779761552811, 0.37118828296661377, -0.0677996575832367, 0.0480763241648674, 0.16628232598304749, 0.18198424577713013, 0.17275866866111755, -0.041841164231300354, -0.21972423791885376, 0.11008856445550919, -0.2890183925628662, 0.05942899361252785, -0.08941641449928284, 0.050774719566106796, 0.170142263174057, -0.07099638879299164, -0.10635629296302795, 0.17409619688987732, -0.31701189279556274, -0.04510945454239845, -0.19795885682106018, 0.2210540473461151, 0.08746092021465302, -0.003994610160589218, -0.005678623914718628, 0.07568038254976273, 0.12045888602733612, 0.01355220377445221, 0.37288862466812134, 0.6758894324302673, 0.21916136145591736, 0.16115766763687134, 0.3114250898361206, 0.5460913181304932, -0.07905034720897675, 0.1780608892440796, 0.386138916015625, 0.2097296118736267, -0.14634698629379272, 0.016223696991801262, -0.25030094385147095, -0.00485789030790329, 0.26294809579849243, 0.27088895440101624, 0.35277068614959717, 0.059350237250328064, -0.003016538918018341, 0.0486157201230526, -0.05626556649804115, -0.045759305357933044, 0.07576744258403778, 0.18929213285446167, -0.06559883058071136, -0.15074723958969116, 0.396266907453537, 0.07027497887611389, 0.06375225633382797, 0.0010020616464316845, 0.19475217163562775, 0.10614977777004242, -0.08705264329910278, 0.1849862039089203, 0.23116180300712585, 0.14023134112358093, 0.3453701138496399, 0.026019304990768433, 0.503068745136261, -0.04038272798061371, 0.28885120153427124, 0.1751631796360016, -0.016201172024011612, -0.026929590851068497, 0.27824917435646057, 0.027375388890504837, 0.0604160837829113, 0.23514245450496674, -0.08867182582616806, 0.4676845371723175, -0.20670339465141296, 0.23001132905483246, 0.08431585133075714, -0.18920548260211945, -0.03408576175570488, 0.22730278968811035, -0.19513842463493347, -0.03333529829978943, -0.25580716133117676, 0.5083979368209839, -0.13255754113197327, -0.15291064977645874, 0.008578738197684288, 0.2544375956058502, -0.2338528335094452, -0.39456090331077576, -0.23285742104053497, -0.14460361003875732, -0.29763779044151306, -0.15719960629940033, 0.07623428851366043, -0.36923807859420776, 0.09661965817213058, -0.12009906768798828, -0.1366897076368332, -0.1471712589263916, -0.21958214044570923, 0.2910499572753906, 0.3244286775588989, 0.043913405388593674, 0.15424412488937378, -0.0458628386259079, 0.1286943554878235, 0.4347957968711853, 0.32042115926742554, 0.30632445216178894, 0.09873893857002258, 0.2234601229429245, 0.2731025815010071, -0.0515756793320179, -0.009643133729696274, 0.0643559992313385, 0.24454818665981293, -0.08516883850097656, -0.037136729806661606, -0.006264823488891125, 0.07650677114725113, -0.11812788248062134, -0.01492317020893097, -0.11918503046035767, 0.16662093997001648, -0.4604903757572174, 0.6454622745513916, -0.38995808362960815, 0.08526355773210526, -0.3282507061958313, 0.08197280764579773, -0.49913570284843445, -0.01599365472793579, -0.019668586552143097, -0.06929744780063629, -0.04818310961127281, -0.4276438355445862, 0.02265850454568863, -0.105256587266922, 0.31064629554748535, 0.1891958862543106, -0.10813359171152115, -0.17683899402618408, -0.3041918873786926, -0.4766303300857544, 0.15209153294563293, 0.2236778736114502, 0.17803755402565002, -0.051052484661340714, -0.07819788157939911, -0.5369630455970764, -0.13414834439754486, -0.1062626987695694, 0.08638084679841995, 0.0503508523106575, -0.2953839898109436, -0.04349464923143387, 0.3771950304508209, 0.02148236706852913, -0.21266214549541473, 0.19675622880458832, -0.018148891627788544, 0.2946016788482666, -0.058328595012426376, -0.20516574382781982, -0.04801409691572189, 0.14682890474796295, -0.036778926849365234, -0.387015163898468, 0.2370026707649231, 0.16292449831962585, 0.11921445280313492, 0.0495881512761116, -0.18399612605571747, -0.46188896894454956, 0.013914785347878933, -0.365408718585968, -0.04861968010663986, -0.19769129157066345, 0.29745030403137207, -0.17089807987213135, -0.34731003642082214, 0.11779525876045227, 0.2445000261068344, 0.07290207594633102, -0.01577206701040268, -0.105058953166008, 0.39364051818847656, -0.34488382935523987, 0.10786313563585281, -0.011272194795310497, 0.13426128029823303, 0.07368764281272888, 0.4449319541454315, -0.3306363821029663, -0.17047397792339325, 0.5727636814117432, -0.4170745015144348, -0.03835075721144676, -0.30786484479904175, 0.37498608231544495, 0.31416624784469604, -0.7951604127883911, -0.8659647107124329, -0.2670823335647583, 0.2396625578403473, 0.17412248253822327, -0.10301600396633148, 0.20668964087963104, -0.15446464717388153, -0.046877503395080566, -0.08752846717834473, 0.33232712745666504, 0.0490562841296196, 0.07533053308725357, 0.7480616569519043, -0.4183792471885681 ]
https://github.com/huggingface/datasets/issues/4990
"no-token" is passed to `huggingface_hub` when token is `None`
As soon as `token` is deprecated and hfh has a new release, we'll update `datasets` to use the new argument instead. Does it sound good to you ?
## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev`
28
"no-token" is passed to `huggingface_hub` when token is `None` ## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev` As soon as `token` is deprecated and hfh has a new release, we'll update `datasets` to use the new argument instead. Does it sound good to you ?
[ 0.25896790623664856, -0.7293570637702942, 0.03134026378393173, 0.20067736506462097, -0.029089897871017456, -0.2577570080757141, 0.14840634167194366, 0.18894565105438232, -0.09243319928646088, 0.14462853968143463, 0.055855803191661835, 0.00015450059436261654, 0.06369059532880783, -0.08414680510759354, 0.045010000467300415, -0.010876305401325226, 0.2544444799423218, -0.05070585012435913, 0.40727099776268005, -0.37024766206741333, -0.18188081681728363, 0.24887633323669434, -0.13784025609493256, 0.2827926278114319, -0.5794447064399719, -0.017095351591706276, -0.147073894739151, 0.28479981422424316, -0.05580621957778931, -0.14704056084156036, 0.11640560626983643, 0.10612376034259796, -0.2710130214691162, 0.22593465447425842, -0.00012531652464531362, -0.04859914630651474, 0.36016392707824707, 0.062296248972415924, -0.308305948972702, -0.4133877158164978, 0.013176348060369492, -0.04599674791097641, -0.17233534157276154, -0.10740898549556732, 0.025434158742427826, 0.14569276571273804, -0.0785057470202446, -0.0046797990798950195, 0.44658923149108887, 0.2099316418170929, 0.12479560077190399, 0.602934718132019, -0.31924968957901, -0.1460752934217453, 0.25656166672706604, 0.5538106560707092, 0.05105392634868622, -0.0842786580324173, 0.1438370645046234, 0.1355523020029068, 0.038358211517333984, 0.1823224425315857, -0.07760381698608398, -0.20167326927185059, 0.4920535087585449, 0.04947950318455696, -0.23352453112602234, 0.057669952511787415, 0.08533309400081635, 0.13482746481895447, -0.10087712854146957, -0.242044597864151, -0.14051131904125214, -0.3335345685482025, -0.026479914784431458, -0.10244379937648773, 0.09235862642526627, 0.04911758750677109, -0.20671232044696808, 0.06651649624109268, -0.05649055540561676, -0.4377528727054596, -0.13676539063453674, -0.09571248292922974, -0.022339746356010437, 0.4970186650753021, -0.1513456106185913, 0.15903252363204956, -0.25717684626579285, -0.05712077021598816, -0.4224986732006073, -0.37927961349487305, 0.01602022536098957, 0.28361791372299194, -0.025844145566225052, -0.17139218747615814, 0.14728328585624695, 0.4511689841747284, 0.30116987228393555, 0.085833340883255, -0.40717917680740356, 0.1286599487066269, -0.12195830047130585, 0.09582403302192688, 0.3491784632205963, -0.033240750432014465, 0.4276755452156067, 0.18656261265277863, 0.09377710521221161, -0.03156116232275963, 0.2493036389350891, -0.07094582170248032, 0.1987008899450302, 0.2636291980743408, -0.11163046956062317, -0.18181100487709045, 0.4601549506187439, -0.23046274483203888, -0.3836958706378937, 0.13029780983924866, -0.22580617666244507, 0.059178754687309265, 0.3170449137687683, 0.5087445974349976, -0.21168987452983856, 0.0467565655708313, -0.0545843131840229, 0.03765299543738365, -0.34892910718917847, -0.14525531232357025, -0.3024274408817291, 0.040342509746551514, -0.15390007197856903, 0.043673232197761536, -0.13824844360351562, -0.131327822804451, 0.04541318118572235, 0.27896398305892944, 0.2374281883239746, 0.10620948672294617, -0.30595704913139343, -0.12589876353740692, 0.11528076231479645, 0.2320117950439453, -0.258756160736084, 0.31869545578956604, 0.236257866024971, -0.042388174682855606, -0.10143475234508514, 0.1700267195701599, -0.6096789240837097, -0.2655429542064667, -0.08902847021818161, 0.08652487397193909, -0.3685714602470398, 0.07104788720607758, -0.14139676094055176, 0.07744856178760529, -0.25107240676879883, 0.08722178637981415, 0.2746085822582245, 0.1998051553964615, -0.3001985549926758, -0.241022527217865, 0.21696467697620392, 0.6473571062088013, 0.16884662210941315, -0.48120132088661194, 0.2271566241979599, -0.3574589192867279, -0.02501048892736435, 0.21511729061603546, -0.08495400846004486, 0.10451841354370117, -0.3854489028453827, 0.34511876106262207, 0.0800105482339859, -0.583700954914093, -0.16736558079719543, 0.20209001004695892, -0.23389361798763275, 0.33906105160713196, -0.04091525822877884, -0.03981097415089607, -0.027391735464334488, -0.12242437899112701, 0.24958613514900208, -0.13485433161258698, 0.039761096239089966, -0.088040791451931, -0.3308967649936676, 0.0000609029084444046, -0.00887816771864891, 0.039473969489336014, 0.11113400012254715, 0.023056760430336, -0.21356812119483948, 0.16085922718048096, 0.26701679825782776, 0.15796764194965363, 0.14682790637016296, -0.02388782426714897, 0.7393782138824463, 0.33546799421310425, 0.009324530139565468, 0.035403475165367126, -0.25757384300231934, 0.10713397711515427, -0.0828041285276413, 0.026878295466303825, -0.0928831696510315, -0.4928281307220459, -0.07575404644012451, 0.060559503734111786, 0.06311812251806259, -0.01428234949707985, 0.019491780549287796, 0.017276901751756668, -0.09978669881820679, 0.1391402781009674, -0.40433311462402344, 0.649392306804657, -0.30762484669685364, 0.22815600037574768, -0.11043357849121094, 0.3267427980899811, 0.09118489176034927, 0.14823958277702332, -0.3050561547279358, 0.19626513123512268, 0.44036903977394104, 0.004407665692269802, 0.12670327723026276, 0.41048282384872437, -0.16119502484798431, 0.056534554809331894, -0.29674363136291504, 0.03691375255584717, 0.3186606466770172, -0.01544269174337387, -0.011823324486613274, -0.079006627202034, 0.17787687480449677, -0.11734223365783691, -0.08456412702798843, 0.5048179626464844, 0.0972566232085228, 0.1623075306415558, -0.09578514099121094, -0.03923162817955017, -0.39916467666625977, -0.058120861649513245, -0.31851431727409363, -0.02856704220175743, 0.19078104197978973, -0.020293675363063812, 0.4009304642677307, -0.014143088832497597, -0.35539671778678894, 0.12369655072689056, 0.4355764091014862, -0.14730997383594513, -0.02874806523323059, 0.1252409815788269, 0.021666988730430603, -0.013290378265082836, 0.2270634025335312, -0.12173663079738617, 0.4671682119369507, 0.1680140197277069, -0.17823779582977295, 0.3792879581451416, -0.20636172592639923, -0.07604141533374786, 0.11530453711748123, 0.03889678791165352, -0.14409442245960236, 0.004792582243680954, -0.39145392179489136, 0.08383829891681671, -0.16274774074554443, -0.17933931946754456, -0.22350037097930908, 0.06163569539785385, -0.6942551732063293, 0.06525376439094543, -0.13108313083648682, 0.057066068053245544, -0.08922223746776581, -0.2921474277973175, -0.44694772362709045, -0.3505796790122986, 0.15073475241661072, -0.0758768618106842, -0.1038680225610733, -0.045237183570861816, -0.10381753742694855, 0.48034024238586426, -0.28510236740112305, -0.12105629593133926, -0.41403916478157043, 0.10551378130912781, -0.20331615209579468, -0.06434284895658493, -0.003844214603304863, 0.254081666469574, 0.23137487471103668, -0.21266742050647736, -0.07697455585002899, -0.18064245581626892, -0.26004597544670105, 0.09707929193973541, -0.354769229888916, 0.21521535515785217, 0.30942651629447937, 0.05526331439614296, -0.27321410179138184, 0.0712566152215004, 0.33462557196617126, -0.27459630370140076, -0.2882095277309418, -0.14783239364624023, 0.04175591468811035, -0.012499639764428139, -0.28990232944488525, 0.12836310267448425, -0.012242989614605904, -0.10368601977825165, 0.2094932198524475, -0.2526880204677582, 0.22988663613796234, 0.2661837041378021, -0.18321473896503448, 0.3553043603897095, -0.48980849981307983, -0.055016033351421356, -0.3075113296508789, -0.6264775991439819, 0.025156240910291672, -0.20042958855628967, -0.1162075400352478, 0.10032829642295837, 0.10991618037223816, 0.04638529196381569, -0.18180494010448456, -0.2712085247039795, -0.5052856802940369, 0.11713647097349167, 0.08822467923164368, -0.19797034561634064, 0.10985559225082397, 0.130006343126297, -0.29088595509529114, 0.08026908338069916, -0.2267214059829712, -0.1933075189590454, 0.13720551133155823, -0.22874346375465393, 0.06727316975593567, 0.21529391407966614, -0.04242372512817383, 0.11412687599658966, 0.5293319225311279, 0.3795433044433594, 0.21486786007881165, 0.38195034861564636, 0.05433536693453789, 0.5951051712036133, 0.08285661786794662, -0.19160233438014984, -0.1427626758813858, 0.3665817379951477, 0.02044207975268364, 0.24451027810573578, 0.1450163722038269, 0.5306558609008789, 0.052950285375118256, -0.7472742199897766, -0.08879376947879791, -0.25432059168815613, 0.057017982006073, -0.053614407777786255, -0.06688433140516281, 0.061618540436029434, 0.23206132650375366, -0.2632325291633606, 0.08467786014080048, 0.1897398978471756, 0.2885311245918274, 0.2784123718738556, 0.170400470495224, -0.40069687366485596, -0.1554974913597107, -0.34159570932388306, 0.2004787027835846, 0.1112024188041687, 0.19672758877277374, -0.12416040897369385, -0.09542277455329895, 0.22151871025562286, -0.04215184971690178, 0.8721858859062195, 0.07638905197381973, 0.08294307440519333, 0.05742862448096275, -0.02642236091196537, -0.31230464577674866, 0.1528070718050003, -0.16881141066551208, 0.14480893313884735, 0.16946960985660553, 0.6654412150382996, -0.41121137142181396, -0.5377584099769592, 0.07771633565425873, -0.3385639488697052, 0.06386461853981018, -0.13926389813423157, -0.33821749687194824, -0.24725323915481567, -0.019335530698299408, 0.23506313562393188, 0.18756330013275146, 0.2357182651758194, -0.10358083993196487, 0.13632895052433014, -0.04211505502462387, 0.11337237805128098, 0.2263014316558838, -0.10653907060623169, 0.2553761899471283, -0.18736250698566437, -0.22345620393753052, 0.21203625202178955, 0.16721951961517334, 0.06400272250175476, 0.4418446123600006, 0.130706787109375, -0.21050652861595154, -0.27346715331077576, 0.15319117903709412, 0.4602530896663666, 0.6099156141281128, 0.2384098321199417, 0.4236887991428375, -0.028067100793123245, 0.4071613550186157, -0.3338898718357086, -0.24375420808792114, 0.2899552583694458, 0.07929697632789612, -0.3663986325263977, 0.06221392750740051, 0.1978302001953125, 0.008868303149938583, 0.08006651699542999, 0.2486298829317093, 1.0394352674484253, -0.2161141186952591, 0.19993199408054352, -0.059697262942790985, 1.1858727931976318, 0.613051176071167, 0.23555850982666016, 0.3308521509170532, -0.1660429835319519, 0.5029333233833313, -0.08671286702156067, -0.17518554627895355, -0.10065097361803055, 0.031552754342556, -0.08522921055555344, 0.05428614094853401, 0.31968629360198975, -0.1611124724149704, -0.17621874809265137, 0.2864460349082947, -0.07391858845949173, 0.6704329252243042, 0.056842438876628876, 0.05294398218393326, -0.40765058994293213, 0.09869976341724396, -0.4257454574108124, 0.08864900469779968, 0.15578070282936096, 0.23991097509860992, -0.22447317838668823, -0.025888778269290924, -0.05538216605782509, -0.51162189245224, -0.04987839236855507, -0.29374751448631287, -0.15201376378536224, -0.14162345230579376, 0.40189892053604126, 0.22552992403507233, 0.1405753791332245, -0.06686823070049286, 0.5287091135978699, 0.21067889034748077, -0.21879282593727112, 0.1784808188676834, -0.27451851963996887, 0.12750865519046783, -0.12499862164258957, -0.084788978099823, 0.39346012473106384, 0.04176861047744751, -0.5976565480232239, 0.10225792974233627, -0.19823512434959412, -0.22001086175441742, -0.09525708854198456, 0.12432315200567245, 0.013265341520309448, -0.07656759023666382, -0.19282014667987823, -0.01800031214952469, 0.3898632824420929, -0.10918565094470978, 0.051428548991680145, 0.12565654516220093, -0.19531196355819702, 0.010373696684837341, 0.09709491580724716, -0.33454635739326477, -0.19129402935504913, 0.38635894656181335, -0.1456020176410675, -0.13296714425086975, 0.33713608980178833, -0.2759557366371155, -0.17824174463748932, -0.047800786793231964, 0.19037997722625732, 0.4520858824253082, -0.4470764696598053, 0.01016280148178339, 0.21062971651554108, 0.1855531483888626, -0.16227485239505768, 0.2267296314239502, -0.1442144811153412, 0.033367037773132324, -0.2322009652853012, -0.25709497928619385, -0.05804774910211563, 0.3391146659851074, -0.15869300067424774, 0.07356832921504974, 0.20565453171730042, 0.3066522181034088, 0.14172711968421936, -0.01947820745408535, -0.29393401741981506, 0.06790421903133392, -0.2620783746242523, -0.014902632683515549, -0.06006086617708206, 0.04568443074822426, 0.28027182817459106, -0.07320410013198853, -0.013469632714986801, 0.2657342553138733, -0.2998969554901123, -0.13132072985172272, -0.24449245631694794, 0.1956590712070465, 0.15306124091148376, -0.019984498620033264, 0.019529685378074646, 0.0796232596039772, 0.13935457170009613, 0.024161111563444138, 0.41148126125335693, 0.6898655295372009, 0.17264381051063538, 0.14415325224399567, 0.3984092175960541, 0.40859901905059814, -0.1151948794722557, 0.13333448767662048, 0.5306227207183838, 0.16331419348716736, -0.14157001674175262, -0.08638021349906921, -0.4532203674316406, -0.01204410195350647, 0.21133814752101898, 0.31675899028778076, 0.39539194107055664, 0.08266906440258026, 0.04764106124639511, 0.045922815799713135, -0.0631939172744751, -0.1963026225566864, 0.04503653943538666, 0.07176468521356583, -0.1501440703868866, -0.12517070770263672, 0.31952372193336487, 0.12882152199745178, 0.03154387325048447, 0.026773061603307724, 0.14869791269302368, 0.049964629113674164, -0.028592053800821304, 0.30263978242874146, 0.12589862942695618, 0.1914638876914978, 0.2744717001914978, 0.009485241025686264, 0.5094475746154785, -0.06025514751672745, 0.09884385764598846, 0.11190475523471832, -0.11675012111663818, 0.08942575752735138, 0.22546403110027313, -0.028311505913734436, 0.12855051457881927, 0.1961960792541504, -0.05423317104578018, 0.33851462602615356, -0.21010509133338928, 0.18636927008628845, 0.025428567081689835, -0.19615650177001953, 0.0006645172834396362, 0.32707738876342773, -0.20878690481185913, 0.010831061750650406, -0.2704642713069916, 0.414092093706131, -0.033512089401483536, -0.22425560653209686, 0.07693621516227722, 0.2932606041431427, -0.31574946641921997, -0.24252334237098694, -0.21339480578899384, -0.13301968574523926, -0.3591121435165405, -0.23731811344623566, 0.08878172934055328, -0.39643973112106323, 0.02831856906414032, -0.09578841924667358, -0.12973107397556305, -0.026452036574482918, -0.12679225206375122, 0.26932206749916077, 0.2395138442516327, -0.0062529295682907104, 0.026341194286942482, -0.07756136357784271, 0.16025331616401672, 0.37355107069015503, 0.2850353419780731, 0.39681142568588257, 0.1583574414253235, 0.2724405527114868, 0.18069347739219666, -0.009308148175477982, 0.00628969632089138, 0.07520648837089539, 0.0796833485364914, -0.04411564767360687, -0.09741716086864471, 0.10218523442745209, 0.11099989712238312, -0.16312289237976074, -0.023083437234163284, -0.0916404128074646, 0.1675739884376526, -0.42165419459342957, 0.6673796772956848, -0.36176103353500366, 0.10699518769979477, -0.36056485772132874, -0.07225634902715683, -0.4840288460254669, -0.011372492648661137, -0.040083110332489014, -0.05109753459692001, 0.05268268287181854, -0.4076746106147766, 0.05093560367822647, -0.05444842204451561, 0.18301554024219513, 0.1681828647851944, -0.05452914535999298, -0.35379892587661743, -0.20299959182739258, -0.4689236879348755, 0.14590668678283691, 0.015458621084690094, 0.13608886301517487, 0.06415373086929321, -0.07379047572612762, -0.337756872177124, -0.17380359768867493, -0.09079326689243317, 0.07147490978240967, 0.05039644241333008, -0.2048008143901825, 0.018116280436515808, 0.3953894376754761, -0.03902914375066757, -0.20422565937042236, 0.172426238656044, -0.12597736716270447, 0.26165300607681274, -0.011479903012514114, -0.12207721918821335, -0.042816728353500366, 0.18854430317878723, -0.00017603114247322083, -0.3411027789115906, 0.1700707972049713, 0.08879968523979187, 0.13650652766227722, -0.0011304393410682678, -0.16792646050453186, -0.25017163157463074, 0.06978721916675568, -0.35208860039711, -0.14747169613838196, -0.22263455390930176, 0.2532999515533447, 0.010614560917019844, -0.44321832060813904, 0.05638369172811508, 0.19276028871536255, 0.14965663850307465, 0.023198148235678673, -0.10847946256399155, 0.5024784207344055, -0.4422481060028076, 0.05699613690376282, -0.027692660689353943, 0.13742786645889282, 0.10462139546871185, 0.4465463161468506, -0.3265261948108673, -0.10513358563184738, 0.6684657335281372, -0.3703564703464508, -0.04319905862212181, -0.19849862158298492, 0.4361826777458191, 0.23705348372459412, -0.773909330368042, -0.8061954379081726, -0.3497377634048462, 0.2904609441757202, 0.11178187280893326, -0.08743869513273239, 0.17172466218471527, -0.13647696375846863, -0.05348251387476921, -0.0888863056898117, 0.14910399913787842, -0.07258164137601852, 0.07745416462421417, 0.7340090870857239, -0.3883662819862366 ]
https://github.com/huggingface/datasets/issues/4990
"no-token" is passed to `huggingface_hub` when token is `None`
Hi @Wauplin, thanks for the warning about the deprecation of `token` in favor of `use_auth_token`. Indeed, in datasets we use internally `use_auth_token`, which in this case was transformed to `token` to call `HfApi.dataset_info`: https://github.com/huggingface/datasets/blob/1a9385d7cc8a3241b44015145ef56a230fdadc51/src/datasets/load.py#L747 Therefore, for the new hfh release, the fix will be trivial: we will pass directly `use_auth_token`. As discussed during our meeting yesterday, due to the fact that at datasets we support multiple hfh versions, I think we should handle passing `token` or `use_auth_token` depending on the hfh version.
## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev`
82
"no-token" is passed to `huggingface_hub` when token is `None` ## Describe the bug In the 2 lines listed below, a token is passed to `huggingface_hub` to get information from a dataset. If no token is provided, a "no-token" string is passed. What is the purpose of it ? If no real, I would prefer if the `None` value could be sent directly to be handle by `huggingface_hub`. I feel that here it is working because we assume the token will never be validated. https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121 ## Expected results Pass `token=None` to `huggingface_hub`. ## Actual results `token="no-token"` is passed. ## Environment info `huggingface_hub v0.10.0dev` Hi @Wauplin, thanks for the warning about the deprecation of `token` in favor of `use_auth_token`. Indeed, in datasets we use internally `use_auth_token`, which in this case was transformed to `token` to call `HfApi.dataset_info`: https://github.com/huggingface/datasets/blob/1a9385d7cc8a3241b44015145ef56a230fdadc51/src/datasets/load.py#L747 Therefore, for the new hfh release, the fix will be trivial: we will pass directly `use_auth_token`. As discussed during our meeting yesterday, due to the fact that at datasets we support multiple hfh versions, I think we should handle passing `token` or `use_auth_token` depending on the hfh version.
[ 0.19348448514938354, -0.5523173809051514, 0.061112966388463974, 0.07486572116613388, 0.006892848759889603, -0.25592562556266785, 0.26371607184410095, 0.19955620169639587, -0.14704634249210358, 0.08689981698989868, 0.0014350827550515532, -0.0394718274474144, 0.2637208104133606, 0.012263106182217598, 0.0009584603831171989, 0.06054024398326874, 0.30292192101478577, -0.09512326121330261, 0.4243394732475281, -0.3411791920661926, -0.1939798891544342, 0.23457762598991394, -0.1304856240749359, 0.3716999292373657, -0.5430414080619812, -0.01687370054423809, -0.1306619495153427, 0.25461533665657043, -0.008180767297744751, -0.2674553692340851, 0.18148036301136017, 0.10813884437084198, -0.16211332380771637, 0.17176450788974762, -0.00012496202543843538, -0.012375690042972565, 0.4301455616950989, 0.12398101389408112, -0.3181934058666229, -0.4067496061325073, 0.015507027506828308, -0.09278631210327148, -0.11418471485376358, -0.010747082531452179, 0.010796215385198593, 0.12169503420591354, -0.05583879351615906, -0.07619143277406693, 0.3552899956703186, 0.15649200975894928, 0.11525276303291321, 0.49221935868263245, -0.2919868230819702, -0.19120006263256073, 0.18852342665195465, 0.44299453496932983, 0.03070848248898983, -0.21626830101013184, 0.23263563215732574, 0.03797288239002228, -0.1108170822262764, 0.20122496783733368, -0.039398498833179474, -0.14830875396728516, 0.4592677354812622, 0.03273054212331772, -0.20032241940498352, 0.058206647634506226, 0.10676638782024384, 0.15047067403793335, -0.06882812827825546, -0.22284603118896484, -0.25677821040153503, -0.2994462251663208, 0.012265640310943127, -0.09315454959869385, 0.14840617775917053, 0.04772060364484787, -0.17532363533973694, 0.03791971504688263, -0.13477568328380585, -0.3833685517311096, -0.12823505699634552, -0.1070345789194107, -0.0534331351518631, 0.40991440415382385, -0.13840429484844208, 0.15381965041160583, -0.26583150029182434, -0.16339142620563507, -0.3979446589946747, -0.3730701506137848, 0.04882980138063431, 0.21732036769390106, -0.08673878014087677, -0.1366683840751648, -0.008584335446357727, 0.360079288482666, 0.361532986164093, 0.09779933094978333, -0.43293070793151855, 0.1089695543050766, -0.1714201420545578, 0.03654169291257858, 0.3347958028316498, 0.010408537462353706, 0.42603600025177, 0.13893435895442963, 0.14235326647758484, 0.08917883038520813, 0.30134937167167664, -0.052750229835510254, 0.14755892753601074, 0.2447880208492279, -0.17061619460582733, -0.13001888990402222, 0.3961483836174011, -0.24560461938381195, -0.42004916071891785, 0.07110852748155594, -0.2606894373893738, 0.08159012347459793, 0.22368593513965607, 0.4078369736671448, -0.14781254529953003, 0.12214323878288269, -0.075607530772686, 0.08854399621486664, -0.3357752859592438, -0.22115285694599152, -0.272530734539032, -0.05244477465748787, -0.08144912123680115, 0.1781516969203949, -0.09842415153980255, -0.15834632515907288, 0.016239996999502182, 0.2884122133255005, 0.1869843602180481, 0.1520414650440216, -0.271814227104187, -0.11291094124317169, 0.03915655240416527, 0.22708888351917267, -0.20247799158096313, 0.32457369565963745, 0.17895479500293732, -0.08009292930364609, -0.06579334288835526, 0.16732972860336304, -0.6511631011962891, -0.2701861560344696, -0.09981043636798859, 0.05883922055363655, -0.3255075216293335, 0.03434830158948898, -0.10886011272668839, 0.07143668085336685, -0.23298364877700806, 0.12647174298763275, 0.24203044176101685, 0.1927928477525711, -0.2613508999347687, -0.2056148797273636, 0.260166734457016, 0.5992100238800049, 0.2129504680633545, -0.5243866443634033, 0.1859792172908783, -0.385873407125473, -0.007551208138465881, 0.2236521989107132, -0.048291124403476715, -0.02520100772380829, -0.3174595832824707, 0.36063945293426514, -0.020636864006519318, -0.7871918082237244, -0.1942237913608551, 0.15849167108535767, -0.149411141872406, 0.28571200370788574, -0.07606592029333115, -0.15809987485408783, 0.037412241101264954, -0.15948118269443512, 0.21567396819591522, -0.05212370306253433, 0.0526934415102005, -0.09755540639162064, -0.264191210269928, -0.13766148686408997, -0.04928387701511383, 0.09667232632637024, 0.13400015234947205, 0.06045619025826454, -0.1298832893371582, 0.17938999831676483, 0.2543463110923767, 0.17071758210659027, 0.1505879908800125, -0.11058014631271362, 0.6561484336853027, 0.3019975423812866, 0.043971721082925797, 0.19536957144737244, -0.22325029969215393, 0.10243793576955795, -0.09152190387248993, 0.05353119596838951, -0.14043748378753662, -0.4813958406448364, -0.10887811332941055, 0.03744184225797653, 0.05173109471797943, -0.037985559552907944, 0.015414617955684662, 0.03189092129468918, -0.08521196246147156, 0.20213806629180908, -0.25569817423820496, 0.6978432536125183, -0.2870683968067169, 0.30422642827033997, -0.1774192601442337, 0.3612184226512909, 0.13538329303264618, 0.12383605539798737, -0.23908954858779907, 0.2884669899940491, 0.48799753189086914, 0.06749836355447769, 0.1040562093257904, 0.44210076332092285, -0.15214122831821442, 0.06206328049302101, -0.25459223985671997, 0.03885351121425629, 0.39964208006858826, 0.013940777629613876, -0.02856292761862278, -0.09890952706336975, 0.09568759053945541, -0.0454980842769146, 0.02580471709370613, 0.45434778928756714, 0.1263144463300705, 0.19070088863372803, -0.060834214091300964, 0.03430567681789398, -0.33986690640449524, -0.07851363718509674, -0.23980189859867096, -0.07122386246919632, -0.000944133847951889, 0.004620809108018875, 0.42234006524086, -0.08711695671081543, -0.22827757894992828, 0.11480258405208588, 0.44506651163101196, -0.20501458644866943, -0.10715167969465256, 0.1260654330253601, -0.07164105027914047, -0.023865578696131706, 0.3740255534648895, -0.04326006770133972, 0.39262402057647705, 0.10157302767038345, -0.1615772396326065, 0.34718289971351624, -0.2240353524684906, -0.07336723059415817, 0.08911067992448807, 0.0807417631149292, -0.17912955582141876, -0.07098542898893356, -0.2692843973636627, 0.12199815362691879, -0.10023432970046997, -0.20380941033363342, -0.183905228972435, 0.052643775939941406, -0.6833323240280151, -0.04507005214691162, -0.20916682481765747, 0.045652784407138824, 0.05811169743537903, -0.22810328006744385, -0.41110149025917053, -0.3395387828350067, 0.12170539051294327, -0.0644366592168808, -0.011317778378725052, -0.018088312819600105, -0.07619693875312805, 0.3662692904472351, -0.2938835024833679, -0.016463538631796837, -0.34610193967819214, 0.14170674979686737, -0.17131561040878296, -0.04676499962806702, 0.04495149478316307, 0.19085681438446045, 0.12957249581813812, -0.15384750068187714, -0.05863038823008537, -0.2736312448978424, -0.23551803827285767, 0.0961037129163742, -0.31648075580596924, 0.14206399023532867, 0.21607708930969238, -0.06873933970928192, -0.22621853649616241, 0.016806408762931824, 0.2706212103366852, -0.2609732747077942, -0.32715803384780884, -0.15134453773498535, -0.050012871623039246, 0.03489356115460396, -0.27286455035209656, 0.12097997963428497, 0.028821846470236778, -0.0898652896285057, 0.20574559271335602, -0.25994840264320374, 0.17127084732055664, 0.24220435321331024, -0.2857156991958618, 0.3661739230155945, -0.5673288702964783, -0.08401115983724594, -0.3260767459869385, -0.5707156658172607, 0.015697650611400604, -0.19390597939491272, -0.15081267058849335, 0.1391097605228424, 0.10889533162117004, 0.19341324269771576, -0.1588897407054901, -0.2981656789779663, -0.4877600073814392, 0.043936580419540405, 0.1508701592683792, -0.19295871257781982, -0.012616408988833427, 0.18614251911640167, -0.17452140152454376, 0.08335594832897186, -0.16030168533325195, -0.16140101850032806, 0.1295069456100464, -0.2220766544342041, 0.023047015070915222, 0.2227698266506195, -0.07053624838590622, 0.2171114981174469, 0.5790055394172668, 0.43199360370635986, 0.22327260673046112, 0.3562317192554474, 0.11539661884307861, 0.5408676862716675, 0.07653607428073883, -0.03886451572179794, -0.13870543241500854, 0.2762661278247833, 0.22897477447986603, 0.2380695343017578, 0.16524073481559753, 0.5256882309913635, 0.11703048646450043, -0.7705228924751282, -0.06054733693599701, -0.3043028712272644, -0.10591952502727509, -0.09859821200370789, -0.03124820441007614, 0.09244213998317719, 0.29499465227127075, -0.26375430822372437, 0.04446089640259743, 0.2813926041126251, 0.30267903208732605, 0.2952054440975189, 0.2288031429052353, -0.3775101900100708, -0.09231653064489365, -0.32461777329444885, 0.24901323020458221, 0.13271069526672363, 0.3233911991119385, -0.13093452155590057, -0.1447262167930603, 0.25498831272125244, -0.032592758536338806, 0.6234049201011658, 0.06268277764320374, 0.13741272687911987, 0.07674244046211243, -0.10250595211982727, -0.3233906030654907, 0.1724204272031784, -0.0905781239271164, -0.039645418524742126, 0.17926143109798431, 0.6173394918441772, -0.3824266791343689, -0.657524049282074, 0.037205807864665985, -0.3786280155181885, 0.14187245070934296, -0.041133325546979904, -0.2149198204278946, -0.296347975730896, -0.08097562193870544, 0.18389952182769775, 0.09050025790929794, 0.2559567391872406, -0.2169027328491211, 0.11095480620861053, -0.11404213309288025, 0.07474175840616226, 0.10867447406053543, -0.12089814245700836, 0.2253466546535492, -0.1623406708240509, -0.0494815930724144, 0.3449508547782898, 0.14636188745498657, 0.1791030913591385, 0.3622949421405792, 0.2182622104883194, -0.32323309779167175, -0.23436814546585083, 0.14256377518177032, 0.3090142607688904, 0.627537727355957, 0.19183433055877686, 0.4585544764995575, -0.051355428993701935, 0.39522993564605713, -0.3408273160457611, -0.19553908705711365, 0.2286917269229889, 0.1022481620311737, -0.4097340404987335, 0.09155800193548203, 0.1564827859401703, 0.033066969364881516, 0.053765669465065, 0.22689928114414215, 1.1161645650863647, -0.25694167613983154, 0.25421732664108276, -0.06895638257265091, 1.0596040487289429, 0.4823720455169678, 0.3122587502002716, 0.2985282242298126, -0.14824649691581726, 0.4100371301174164, -0.061663202941417694, -0.1686711609363556, -0.1671324521303177, 0.06249918043613434, -0.09405223280191422, 0.12542381882667542, 0.4079786539077759, -0.16985684633255005, -0.14903634786605835, 0.29332688450813293, 0.07420504093170166, 0.5845038890838623, 0.10505800694227219, 0.072910375893116, -0.49828433990478516, 0.0021466147154569626, -0.20416401326656342, 0.09556503593921661, 0.16077861189842224, 0.22660373151302338, -0.09915115684270859, -0.09182609617710114, -0.0750575140118599, -0.42239201068878174, -0.07306952774524689, -0.28911665081977844, -0.22621233761310577, -0.16452869772911072, 0.44277533888816833, 0.1866767257452011, 0.2175854593515396, -0.07118993997573853, 0.6744983792304993, 0.15188749134540558, -0.25915783643722534, 0.17841365933418274, -0.27113431692123413, 0.14339303970336914, -0.10086982697248459, -0.13071173429489136, 0.39713913202285767, 0.03936092555522919, -0.585832417011261, 0.012038066983222961, -0.1709800511598587, -0.150110125541687, -0.12687784433364868, 0.10834095627069473, 0.03801199793815613, -0.07777053117752075, -0.0027409899048507214, -0.016963012516498566, 0.45246633887290955, -0.1136324405670166, 0.052399519830942154, 0.10347164422273636, -0.1286410689353943, -0.07808970659971237, 0.04382847249507904, -0.3231107294559479, -0.12337259948253632, 0.4229412376880646, -0.11795104295015335, -0.1541728675365448, 0.4248732328414917, -0.3534676730632782, -0.1600036770105362, 0.027404189109802246, 0.17938381433486938, 0.5379143953323364, -0.4492849111557007, -0.12204385548830032, 0.2062724232673645, 0.16450490057468414, -0.09778694808483124, 0.25780487060546875, -0.2770951986312866, -0.07101274281740189, -0.12276662886142731, -0.16410011053085327, -0.08285465836524963, 0.2928431034088135, -0.303419291973114, 0.0013839900493621826, 0.21709483861923218, 0.2692985236644745, 0.09321022033691406, -0.04548834264278412, -0.26742735505104065, 0.15963870286941528, -0.20292873680591583, 0.04392624646425247, -0.09581682085990906, 0.00042949989438056946, 0.27566778659820557, -0.0716208666563034, -0.012181604281067848, 0.2278864085674286, -0.2655772268772125, -0.0962572917342186, -0.26834359765052795, 0.1864936351776123, 0.18978819251060486, -0.1446894407272339, 0.011255810968577862, 0.08738015592098236, 0.09748139977455139, -0.0033067986369132996, 0.4744568169116974, 0.6710052490234375, 0.1609085500240326, 0.17905353009700775, 0.4195619821548462, 0.4583837687969208, -0.08383343368768692, 0.16016441583633423, 0.4536925256252289, 0.27328768372535706, -0.1795140653848648, -0.06943871825933456, -0.46011561155319214, 0.033791929483413696, 0.2424170970916748, 0.3421330749988556, 0.37191635370254517, 0.17810603976249695, 0.09217412769794464, 0.06212116777896881, -0.08513468503952026, -0.17629683017730713, -0.02987169474363327, -0.060157209634780884, -0.14683867990970612, -0.13529424369335175, 0.3752611577510834, 0.12527450919151306, 0.0704108476638794, -0.020458657294511795, 0.1146392673254013, 0.002801381517201662, -0.049292732030153275, 0.29620054364204407, 0.25603798031806946, 0.10895229876041412, 0.3463289737701416, -0.03565569967031479, 0.43719595670700073, -0.06257033348083496, 0.20326687395572662, 0.1737142652273178, -0.07015160471200943, 0.03669331967830658, 0.2180275022983551, -0.09482964873313904, 0.036062002182006836, 0.2108505219221115, -0.06035121530294418, 0.3975403606891632, -0.14398276805877686, 0.18192918598651886, 0.013893164694309235, -0.27943792939186096, -0.04488855227828026, 0.19665701687335968, -0.23558169603347778, -0.05293715000152588, -0.3056661784648895, 0.38271063566207886, 0.05473049730062485, -0.28401774168014526, 0.07110743224620819, 0.20939180254936218, -0.28779593110084534, -0.28840622305870056, -0.13762643933296204, -0.03707503527402878, -0.3710979223251343, -0.20313730835914612, 0.08399487286806107, -0.4402257800102234, 0.037475619465112686, -0.08448755741119385, -0.11307346820831299, -0.08585555106401443, -0.14159947633743286, 0.33889856934547424, 0.27260822057724, 0.1020972728729248, 0.021837949752807617, -0.09838828444480896, 0.09731924533843994, 0.4156315326690674, 0.27496641874313354, 0.39905616641044617, 0.023474307730793953, 0.2123066782951355, 0.20406903326511383, 0.0014227032661437988, 0.11276295781135559, 0.160084068775177, 0.09133222699165344, -0.03637504577636719, -0.10842803120613098, 0.10028669238090515, 0.08353330194950104, -0.1103319451212883, -0.14034497737884521, -0.15893104672431946, 0.09301966428756714, -0.4630991518497467, 0.8061785101890564, -0.42037901282310486, 0.144582599401474, -0.3470054864883423, -0.012163780629634857, -0.4183955490589142, 0.0907263234257698, 0.036628883332014084, -0.0725526511669159, 0.039516519755125046, -0.48358842730522156, 0.03946218639612198, -0.050930265337228775, 0.07552880048751831, 0.17828014492988586, -0.22232341766357422, -0.2840220630168915, -0.21192392706871033, -0.42065131664276123, 0.13270467519760132, 0.013811718672513962, 0.18781135976314545, 0.05711564049124718, -0.10370038449764252, -0.38190916180610657, -0.19482775032520294, -0.025273680686950684, 0.00731895724311471, 0.09869922697544098, -0.2658509612083435, 0.02306092157959938, 0.38673344254493713, 0.008942272514104843, -0.2564355731010437, 0.10952699184417725, -0.14770054817199707, 0.2924451529979706, -0.007526569999754429, -0.13222643733024597, 0.10825195163488388, 0.17985379695892334, 0.058482978492975235, -0.37245821952819824, 0.17093360424041748, 0.06717154383659363, -0.00024627894163131714, 0.0637039840221405, -0.19183218479156494, -0.313079833984375, 0.04330240562558174, -0.38251253962516785, -0.06815139204263687, -0.3503480553627014, 0.24659961462020874, 0.0016532745212316513, -0.4294622838497162, 0.07406779378652573, 0.18668411672115326, 0.06256069988012314, -0.03944987431168556, -0.15310639142990112, 0.5914832353591919, -0.3676668405532837, 0.11163850873708725, -0.000027449801564216614, 0.10777867585420609, 0.09437336027622223, 0.488582968711853, -0.38580530881881714, -0.1893020123243332, 0.594799280166626, -0.5020856261253357, 0.011395446956157684, -0.16363847255706787, 0.3955514430999756, 0.22410959005355835, -0.7533159852027893, -0.7547160983085632, -0.2909282445907593, 0.2657981514930725, 0.12365864217281342, -0.14190588891506195, 0.10744249820709229, -0.09784266352653503, -0.040148355066776276, -0.1270635724067688, 0.18970856070518494, 0.027448099106550217, -0.013532505370676517, 0.7362058758735657, -0.3134547472000122 ]
https://github.com/huggingface/datasets/issues/4988
Add `IterableDataset.from_generator` to the API
Thanks @hamid-vakilzadeh ! Let us know if you have some questions or if we can help
We've just added `Dataset.from_generator` to the API. It would also be cool to add `IterableDataset.from_generator` to support creating an iterable dataset from a generator. cc @lhoestq
16
Add `IterableDataset.from_generator` to the API We've just added `Dataset.from_generator` to the API. It would also be cool to add `IterableDataset.from_generator` to support creating an iterable dataset from a generator. cc @lhoestq Thanks @hamid-vakilzadeh ! Let us know if you have some questions or if we can help
[ -0.48686352372169495, 0.034543976187705994, -0.20454098284244537, -0.032212033867836, 0.19012095034122467, -0.10316180437803268, 0.1862967610359192, 0.4522264897823334, -0.029613273218274117, 0.3787182569503784, 0.1656016707420349, 0.33202967047691345, -0.1770992875099182, 0.2067379206418991, 0.10775695741176605, 0.10875770449638367, -0.08189868181943893, 0.26980167627334595, -0.0919858068227768, -0.08680795878171921, -0.21649551391601562, 0.23156937956809998, 0.042432792484760284, -0.05343165993690491, 0.19295071065425873, -0.03535231202840805, 0.03826054930686951, 0.027430236339569092, -0.13346277177333832, -0.37652191519737244, -0.023320280015468597, 0.3308158218860626, 0.09139682352542877, -0.001976020634174347, -0.00009474812395637855, 0.04235665500164032, 0.10499981045722961, -0.09202753007411957, -0.22226259112358093, -0.021433934569358826, -0.23592719435691833, 0.2246944159269333, 0.010596041567623615, -0.07350895553827286, -0.3288009762763977, -0.4571077525615692, 0.20947112143039703, -0.39915087819099426, 0.3739878535270691, 0.19513608515262604, 0.37949976325035095, 0.04378246143460274, 0.033046599477529526, -0.23705987632274628, -0.08582525700330734, 0.11574429273605347, -0.22194315493106842, -0.2347184717655182, 0.28069815039634705, -0.08084883540868759, -0.10704270750284195, 0.29211223125457764, 0.09249144792556763, 0.10259489715099335, 0.19948917627334595, -0.11561351269483566, -0.20407617092132568, -0.24802762269973755, 0.2170771360397339, 0.13250330090522766, 0.5782683491706848, -0.19302603602409363, -0.26840823888778687, -0.08784841746091843, -0.12656062841415405, -0.3357447385787964, -0.02829277515411377, 0.10079250484704971, -0.1240345686674118, 0.2646180987358093, -0.09702075272798538, -0.15516553819179535, -0.3968876600265503, 0.017584167420864105, 0.18509279191493988, 0.20028474926948547, -0.1035107746720314, -0.07501532882452011, 0.10759962350130081, -0.017751067876815796, 0.3564034700393677, 0.07521224766969681, -0.1829279661178589, 0.10526080429553986, -0.10261769592761993, -0.25262290239334106, 0.26748213171958923, -0.011435918509960175, 0.32460519671440125, 0.3326931595802307, 0.24371792376041412, 0.24541842937469482, -0.06996945291757584, 0.07837870717048645, 0.2514779567718506, -0.2700777053833008, 0.22505256533622742, 0.0054972851648926735, 0.31200724840164185, -0.048838015645742416, 0.015807632356882095, -0.2527892291545868, 0.04486916586756706, -0.10010168701410294, 0.11498932540416718, 0.10289456695318222, 0.011219970881938934, -0.1094013899564743, -0.05159427225589752, -0.31635504961013794, 0.009077612310647964, -0.08732250332832336, -0.013319496996700764, 0.31754058599472046, 0.07684652507305145, 0.07044027000665665, -0.17528215050697327, 0.2292208969593048, 0.015284782275557518, -0.3923523426055908, -0.2635536789894104, -0.08673247694969177, 0.08009026944637299, 0.13660426437854767, 0.1469997614622116, 0.005786900408565998, 0.24973076581954956, -0.09954745322465897, -0.04338863492012024, 0.12000738084316254, 0.5883978009223938, 0.17900124192237854, 0.36797013878822327, 0.08268263936042786, 0.2778281569480896, -0.07879823446273804, 0.03415818139910698, -0.18321503698825836, -0.13693168759346008, -0.09663962572813034, -0.05655264854431152, -0.2908950746059418, -0.2047068029642105, 0.3460007309913635, 0.09846154600381851, -0.02711358666419983, 0.06323474645614624, 0.3524250090122223, 0.20524486899375916, -0.19131715595722198, -0.17065289616584778, 0.19777287542819977, -0.10727614164352417, -0.1748356819152832, -0.04551092907786369, 0.18165276944637299, -0.3081991672515869, 0.030291251838207245, -0.22785529494285583, -0.10677751898765564, 0.0496368445456028, -0.13137215375900269, -0.2374144047498703, 0.25976505875587463, -0.2658877372741699, 0.11747251451015472, 0.33738285303115845, 0.04631166532635689, -0.12537863850593567, 0.0554150752723217, 0.0006451159715652466, -0.17405827343463898, 0.19578316807746887, 0.05229799821972847, 0.08304794877767563, -0.17208430171012878, 0.17308667302131653, 0.22888508439064026, -0.2005794197320938, 0.1559419184923172, 0.017104748636484146, -0.1583373099565506, -0.1172458827495575, 0.06821681559085846, 0.16036082804203033, 0.2483167052268982, 0.20183347165584564, -0.017575135454535484, 0.3868660628795624, -0.46107032895088196, 0.05791548639535904, 0.1445418894290924, 0.335031658411026, -0.27372872829437256, 0.07358983159065247, -0.23366889357566833, -0.17363104224205017, 0.011081486940383911, -0.27101442217826843, 0.10071086883544922, -0.003661327064037323, -0.23060055077075958, 0.011198962107300758, 0.18126694858074188, -0.18252432346343994, -0.06474313139915466, 0.3713022768497467, 0.24947242438793182, 0.05799706652760506, -0.11281150579452515, -0.32031455636024475, -0.07318136096000671, -0.0416971892118454, -0.13132846355438232, -0.4690537452697754, -0.02974071353673935, 0.01615879312157631, -0.10701056569814682, 0.2986639142036438, -0.042670004069805145, 0.002973906695842743, -0.20933471620082855, 0.06445453315973282, 0.1626439094543457, 0.10463916510343552, 0.22247439622879028, 0.07422136515378952, 0.4756271243095398, 0.04636462777853012, 0.01350821927189827, -0.0206423569470644, -0.03331620618700981, -0.11552904546260834, -0.0179130956530571, -0.12688499689102173, 0.38398218154907227, -0.006801031529903412, 0.12789009511470795, 0.1723570078611374, 0.09069547057151794, 0.5040207505226135, 0.012941617518663406, -0.10228052735328674, -0.2815716862678528, -0.16122829914093018, 0.23390020430088043, 0.06274442374706268, -0.29905053973197937, -0.25081855058670044, 0.5360145568847656, 0.39135557413101196, 0.13008171319961548, 0.11282487213611603, -0.061206720769405365, -0.1882529854774475, -0.2382093369960785, 0.21227575838565826, 0.26436734199523926, 0.06700097024440765, 0.305755615234375, 0.21269886195659637, -0.2074507474899292, 0.07282933592796326, -0.14297683537006378, 0.20109638571739197, -0.05002608895301819, 0.17543910443782806, 0.19788441061973572, 0.09830645471811295, -0.39447468519210815, -0.5875338912010193, -0.23219150304794312, -0.18032440543174744, 0.1889914572238922, 0.010900299996137619, 0.08462513983249664, -0.09406612068414688, -0.04324343428015709, 0.14287230372428894, -0.20233313739299774, 0.05550338700413704, -0.36844950914382935, 0.36976081132888794, 0.454432874917984, -0.2735821008682251, 0.10191603004932404, 0.06358924508094788, 0.28183382749557495, 0.16451558470726013, 0.15103894472122192, -0.2537889778614044, -0.31931185722351074, 0.005285266786813736, 0.29546982049942017, 0.05584654211997986, -0.2146683931350708, 0.5283871293067932, -0.023707065731287003, 0.06615963578224182, -0.33721014857292175, -0.21719184517860413, 0.3191256523132324, 0.16658969223499298, 0.18148335814476013, 0.2346504181623459, 0.1343650072813034, 0.3779609799385071, -0.08767324686050415, 0.06624562293291092, -0.19800129532814026, -0.08984549343585968, 0.005188310518860817, -0.17417827248573303, -0.04086896404623985, -0.07953282445669174, -0.28604909777641296, 0.09205527603626251, -0.3058323860168457, 0.15558068454265594, 0.32553738355636597, 0.30032670497894287, 0.23946011066436768, 0.1962084174156189, -0.03593597561120987, 0.06250081956386566, -0.0607355460524559, -0.24984820187091827, -0.3179834485054016, 0.3132694959640503, -0.5598108172416687, -0.3049454092979431, -0.038346730172634125, -0.20366288721561432, 0.42415452003479004, -0.013879634439945221, -0.03160392493009567, -0.3110962212085724, 0.03360096365213394, 0.11847740411758423, 0.1220555454492569, -0.13937564194202423, 0.22116005420684814, 0.2360975444316864, -0.24820393323898315, -0.13271747529506683, 0.15468516945838928, 0.16996319591999054, -0.021869249641895294, 0.023308701813220978, 0.09075432270765305, 0.158916637301445, -0.1413276046514511, 0.43258965015411377, 0.059150632470846176, -0.07085208594799042, 0.3519948720932007, -0.22257918119430542, 0.18090355396270752, -0.11999822407960892, -0.21915650367736816, -0.061561256647109985, 0.0731395035982132, -0.1815144270658493, 0.23190556466579437, -0.04407178610563278, -0.2609758675098419, -0.06708649545907974, 0.2252548336982727, -0.11159628629684448, -0.27399778366088867, 0.00348866730928421, 0.08766551315784454, 0.1332589089870453, 0.2030624896287918, 0.22603324055671692, -0.36293256282806396, 0.04917941242456436, 0.10619017481803894, -0.29884886741638184, 0.29338905215263367, -0.2989880442619324, -0.3164885342121124, -0.04750789701938629, -0.5287647843360901, 0.26550984382629395, 0.022605614736676216, -0.1845601201057434, -0.06135080009698868, -0.17897659540176392, -0.07561375200748444, -0.3446460962295532, 0.5098016858100891, -0.349170058965683, -0.20319096744060516, 0.02402140200138092, -0.09468269348144531, 0.1877530813217163, 0.2596849501132965, 0.029742006212472916, 0.12036580592393875, -0.028090115636587143, 0.2626846730709076, -0.3584764897823334, -0.09974189847707748, 0.08295822143554688, 0.08707448095083237, -0.3015778958797455, 0.02202390879392624, -0.04251287132501602, -0.3875962793827057, -0.3350266218185425, -0.23318585753440857, -0.10048573464155197, 0.2482527643442154, 0.11797286570072174, -0.30873921513557434, 0.005219499580562115, -0.07235756516456604, -0.07912375032901764, 0.34749549627304077, 0.18515461683273315, -0.19453854858875275, 0.05294468626379967, 0.08519802987575531, -0.05082067847251892, 0.2070905715227127, 0.1958562731742859, 0.0033281464129686356, -0.007452286779880524, 0.03705991432070732, -0.26813754439353943, 0.11691413819789886, 0.11543568968772888, -0.12266001105308533, 0.18591025471687317, 0.12203986942768097, 0.1867012232542038, -0.10563536733388901, -0.010421070270240307, 0.050527676939964294, -0.23880283534526825, -0.05499417334794998, -0.550024688243866, 0.2840566635131836, -0.04716300219297409, -0.060920052230358124, 0.6002119183540344, -0.10593140125274658, -0.21650880575180054, 0.25089848041534424, 0.3184446692466736, 0.7362446784973145, 0.089208222925663, -0.10158704221248627, 0.17612424492835999, -0.08776840567588806, 0.23892202973365784, -0.24733656644821167, 0.317338228225708, -0.5138672590255737, -0.1922701895236969, -0.04825004190206528, 0.07992540299892426, -0.06031110882759094, 0.39764565229415894, -0.05295359343290329, 0.05922108516097069, 0.2515953779220581, -0.022583331912755966, -0.22398380935192108, 0.28987663984298706, -0.3479411005973816, -0.32452189922332764, -0.10689340531826019, 0.31289178133010864, -0.05342170596122742, -0.06927166879177094, -0.07677584886550903, -0.38597404956817627, 0.3645796477794647, -0.09690059721469879, -0.19587457180023193, 0.19044709205627441, -0.12943214178085327, 0.030510731041431427, 0.1174771785736084, -0.20590782165527344, -0.19914035499095917, 0.06464961171150208, 0.4282364249229431, -0.015530180186033249, -0.2612915337085724, 0.17700569331645966, -0.12542793154716492, -0.01801142282783985, -0.30569422245025635, 0.10023731738328934, 0.20786960422992706, -0.2419181764125824, -0.01878271996974945, 0.14144620299339294, 0.13169272243976593, -0.3853411078453064, -0.14304758608341217, -0.10697264969348907, 0.030677780508995056, -0.10412335395812988, 0.196158766746521, 0.25751981139183044, -0.23634521663188934, -0.33715811371803284, 0.29654842615127563, 0.20235079526901245, -0.028784746304154396, 0.1148272156715393, 0.028884096071124077, 0.17782661318778992, -0.028635911643505096, 0.17048189043998718, 0.09242601692676544, 0.055079102516174316, 0.27180784940719604, 0.08686164021492004, -0.12867818772792816, -0.46644628047943115, -0.3079856038093567, 0.24714401364326477, -0.3214021325111389, 0.3271981179714203, 0.0875372663140297, -0.07841886579990387, 0.11533796787261963, 0.3044060170650482, -0.16783185303211212, 0.12532779574394226, -0.09767182171344757, -0.008298359811306, -0.2396201193332672, 0.056815989315509796, -0.11758469045162201, 0.40262317657470703, -0.02686346136033535, -0.213571697473526, -0.05035979300737381, 0.1285758763551712, -0.5150887966156006, -0.434144526720047, -0.0370909720659256, -0.03432711958885193, -0.003765864297747612, -0.060466185212135315, -0.007316626608371735, 0.048945460468530655, 0.3031332790851593, -0.0012181177735328674, -0.26139211654663086, -0.3881441056728363, -0.04276233911514282, 0.07734736055135727, 0.09920268505811691, 0.05818706005811691, 0.04558657109737396, 0.021000277251005173, -0.41362836956977844, -0.24993744492530823, 0.180032417178154, -0.20765185356140137, -0.01653064787387848, 0.05071881040930748, 0.20794430375099182, -0.10027290135622025, -0.013076059520244598, -0.17910009622573853, 0.14980438351631165, 0.20105180144309998, -0.08857231587171555, 0.11246687173843384, -0.1956682950258255, -0.27654656767845154, 0.21751819550991058, 0.2585226595401764, 0.16645637154579163, 0.024232100695371628, 0.4153784513473511, -0.0665014460682869, -0.2884952425956726, 0.22376090288162231, 0.30462440848350525, 0.14258712530136108, -0.005937362555414438, 0.24047265946865082, -0.026927310973405838, 0.4050740599632263, -0.35046321153640747, -0.0739840418100357, -0.1569008231163025, -0.0895761027932167, 0.23230808973312378, 0.12564562261104584, -0.002161692827939987, -0.13223202526569366, 0.33333051204681396, 0.11491293460130692, 0.10523366183042526, -0.5226806402206421, -0.09512223303318024, 0.11799323558807373, -0.1542036086320877, -0.00025982409715652466, 0.23724105954170227, 0.11557458341121674, 0.34328579902648926, 0.43464457988739014, -0.12836027145385742, 0.31077665090560913, 0.16875332593917847, -0.218038409948349, 0.22707578539848328, -0.0962279886007309, 0.01611616648733616, -0.006345018744468689, 0.23267100751399994, 0.19896602630615234, 0.35700997710227966, -0.04462369531393051, 0.01795102097094059, 0.15443603694438934, -0.40240275859832764, 0.2387441098690033, 0.08759674429893494, -0.10045371949672699, -0.3684728443622589, -0.21084880828857422, 0.0753738135099411, -0.07112416625022888, 0.15576986968517303, -0.009937435388565063, 0.07738164812326431, -0.15170171856880188, 0.1401776522397995, -0.18714989721775055, 0.3474518060684204, -0.0626380518078804, 0.08250218629837036, -0.21902358531951904, 0.051631130278110504, 0.24082006514072418, -0.1404755562543869, -0.09045088291168213, 0.2903558313846588, 0.07588919997215271, 0.1080804243683815, -0.04429497569799423, 0.1492501199245453, -0.16893655061721802, -0.20889444649219513, -0.3329627215862274, 0.09620416164398193, -0.10220231115818024, -0.03092200681567192, 0.3854469656944275, 0.27693116664886475, -0.20265452563762665, 0.08224217593669891, 0.2331104427576065, 0.09233689308166504, 0.10371151566505432, 0.02833692729473114, 0.2990710139274597, -0.23975878953933716, -0.04664149135351181, -0.07125351577997208, -0.1473928838968277, -0.17467521131038666, -0.034707944840192795, -0.2534902095794678, 0.14921745657920837, -0.3058725893497467, 0.18189765512943268, -0.03072788566350937, 0.33225956559181213, 0.00525733083486557, -0.01349688321352005, -0.027963850647211075, -0.33933335542678833, -0.2780701518058777, 0.1887623816728592, -0.12563945353031158, 0.11686523258686066, -0.18399947881698608, 0.3400435447692871, 0.27312368154525757, 0.1680622398853302, 0.04163273423910141, -0.1420777589082718, -0.03630497306585312, 0.4589792490005493, -0.22832655906677246, -0.20356664061546326, 0.2668132483959198, 0.040508635342121124, -0.0361609123647213, -0.3202597498893738, 0.098579540848732, -0.2749306261539459, 0.33360257744789124, -0.0899060070514679, 0.04990099370479584, 0.15986771881580353, -0.21679455041885376, 0.32836833596229553, 0.10084130614995956, -0.19545432925224304, -0.37432384490966797, 0.036722443997859955, -0.1340252310037613, -0.15347428619861603, -0.2579379379749298, 0.03502751141786575, 0.2169295698404312, 0.21017175912857056, 0.26877573132514954, -0.007828924804925919, -0.30310577154159546, 0.12428861856460571, 0.08619026839733124, 0.2581613063812256, -0.1858077198266983, 0.4072599709033966, -0.09926645457744598, -0.09027904272079468, -0.06177428364753723, -0.11781922727823257, -0.0722402036190033, -0.016309089958667755, -0.12701936066150665, -0.38919946551322937, 0.26772788166999817, -0.4195677638053894, -0.4090002477169037, 0.09168147295713425, 0.18282222747802734, 0.05886910855770111, -0.2877647280693054, -0.032428592443466187, 0.27845054864883423, 0.20973064005374908, -0.054570235311985016, 0.1333489716053009, 0.19681687653064728, 0.20467527210712433, 0.026961829513311386, -0.1251639723777771, 0.4347791075706482, 0.35572922229766846, -0.12149016559123993, -0.253888338804245, -0.2406192123889923 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
Hi! I think you can use the newly-added `from_generator` method for that: ```python from datasets import Dataset def gen(): for idx in len(torch_dataset): yield torch_dataset[idx] # this has to be a dictionary ## or if it's an IterableDataset # for ex in torch_dataset: # yield ex dset = Dataset.from_generator(gen) ```
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
50
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. Hi! I think you can use the newly-added `from_generator` method for that: ```python from datasets import Dataset def gen(): for idx in len(torch_dataset): yield torch_dataset[idx] # this has to be a dictionary ## or if it's an IterableDataset # for ex in torch_dataset: # yield ex dset = Dataset.from_generator(gen) ```
[ -0.04437154158949852, -0.5013186931610107, -0.010783793404698372, 0.30544978380203247, 0.3853740692138672, 0.2398015260696411, -0.07870303094387054, 0.11976763606071472, -0.03848221153020859, 0.09930354356765747, -0.13930770754814148, 0.15262138843536377, -0.36149993538856506, 0.1464695781469345, 0.15742069482803345, -0.24348753690719604, 0.38439178466796875, -0.13197462260723114, -0.43593284487724304, 0.011580653488636017, -0.23856723308563232, 0.37042921781539917, 0.09443281590938568, -0.040402866899967194, -0.07250415533781052, 0.22961385548114777, -0.13877740502357483, 0.10785212367773056, -0.2286614179611206, -0.11698786169290543, 0.38153761625289917, 0.007520999759435654, 0.1455383002758026, 0.49286943674087524, -0.00012377976963762194, -0.12828432023525238, -0.06728632003068924, -0.17412574589252472, 0.05370073392987251, -0.2536281943321228, 0.2937964200973511, -0.09121042490005493, 0.14044706523418427, 0.03714292496442795, -0.3425648808479309, -0.0741109848022461, -0.08832142502069473, -0.46982231736183167, 0.3122844099998474, 0.2537083625793457, 0.09394103288650513, 0.16263188421726227, 0.4343792200088501, -0.007115657441318035, -0.04446568340063095, 0.4834188222885132, -0.1299268752336502, 0.06197129189968109, 0.21909433603286743, 0.1518515646457672, 0.3926169276237488, 0.14689919352531433, -0.20126457512378693, -0.21096716821193695, 0.691207230091095, -0.003903639502823353, -0.42870157957077026, -0.41414037346839905, 0.06920735538005829, 0.18075568974018097, 0.35446587204933167, -0.3512780964374542, -0.41426780819892883, -0.10522669553756714, 0.09942489117383957, -0.009710673242807388, -0.2467499077320099, 0.2634662687778473, -0.25153443217277527, 0.09667438268661499, -0.3487042784690857, -0.5409219264984131, -0.1246141791343689, -0.09526358544826508, -0.06621354818344116, 0.07253052294254303, -0.32241275906562805, 0.052370280027389526, 0.3672906160354614, -0.3162485361099243, -0.040574248880147934, -0.04852265864610672, 0.1780838817358017, 0.16931024193763733, 0.10891672968864441, -0.044538214802742004, -0.2811809480190277, 0.4649076461791992, 0.4027046263217926, 0.11347431689500809, -0.12147577106952667, -0.09088082611560822, -0.16115844249725342, 0.0028736554086208344, 0.09728473424911499, -0.10471346974372864, 0.1489720344543457, 0.07944115996360779, -0.039029866456985474, -0.0034966887906193733, 0.08338156342506409, 0.0635470449924469, -0.06170518696308136, -0.3574764132499695, -0.13197486102581024, -0.07978899776935577, 0.3605387806892395, -0.24051345884799957, -0.07426922768354416, -0.25782060623168945, 0.016764439642429352, 0.14216575026512146, 0.019443940371274948, 0.1466374695301056, -0.02940114587545395, 0.13850289583206177, 0.2928921580314636, 0.2035098522901535, -0.011065042577683926, -0.2603166401386261, -0.05601625517010689, 0.04258258640766144, -0.051328614354133606, 0.06033048778772354, -0.12344549596309662, -0.6836598515510559, 0.002969663590192795, 0.126858651638031, 0.06602931022644043, 0.13008682429790497, -0.2523612082004547, 0.26345330476760864, 0.4044824540615082, 0.054376713931560516, 0.027356047183275223, 0.08005519956350327, 0.3709185719490051, -0.0249018594622612, -0.3544217050075531, -0.03962741047143936, -0.19343793392181396, 0.010709445923566818, -0.3460005223751068, -0.013002376072108746, -0.05591897293925285, -0.11585475504398346, -0.26132234930992126, 0.20160359144210815, 0.05617165192961693, -0.011757194995880127, 0.16240021586418152, -0.12634852528572083, -0.2627151906490326, -0.30028972029685974, 0.42654240131378174, 0.4354734420776367, -0.23003451526165009, -0.20166823267936707, 0.16650813817977905, -0.3883196711540222, -0.09715887159109116, 0.23027679324150085, 0.1047227755188942, -0.19414672255516052, -0.402345210313797, -0.35853445529937744, 0.014481209218502045, -0.38190776109695435, -0.02182682789862156, 0.1393570452928543, 0.1009761244058609, 0.16811420023441315, -0.0703398808836937, 0.1656503975391388, -0.11872144043445587, -0.1892796754837036, 0.09387463331222534, 0.08393300324678421, -0.21257926523685455, -0.14064043760299683, 0.1101635992527008, -0.13767632842063904, 0.5225292444229126, -0.12957313656806946, -0.15527692437171936, 0.27220118045806885, -0.2503454387187958, -0.1786608248949051, 0.23789432644844055, -0.2114068567752838, 0.13001787662506104, 0.1727558970451355, 0.06201758235692978, 0.3616488575935364, -0.043729957193136215, -0.061886146664619446, -0.3052494525909424, -0.032482657581567764, 0.14923132956027985, -0.010587692260742188, -0.13786107301712036, -0.2930443286895752, -0.05117740109562874, 0.1464572548866272, -0.052762147039175034, -0.07042892277240753, -0.031049789860844612, -0.09698709845542908, 0.41014787554740906, -0.17803233861923218, -0.3175530433654785, 0.32311123609542847, -0.008868414908647537, 0.3467741310596466, -0.7534839510917664, 0.14064627885818481, 0.20678812265396118, 0.0004571685567498207, 0.12540341913700104, 0.4265601336956024, 0.14157633483409882, -0.07737290859222412, 0.15870770812034607, 0.1630883812904358, 0.09866141527891159, 0.19979897141456604, -0.031099073588848114, 0.11880181729793549, 0.0801488533616066, -0.20554101467132568, 0.051951147615909576, 0.2713400721549988, 0.03993586450815201, 0.015677645802497864, -0.22494038939476013, 0.4525911808013916, -0.05485162511467934, 0.30003848671913147, -0.04995213449001312, 0.36937588453292847, -0.02514810860157013, 0.22652164101600647, -0.21162357926368713, -0.009539462625980377, -0.12197883427143097, -0.17466852068901062, 0.3581322133541107, 0.11136218905448914, -0.5610880851745605, 0.09978705644607544, 0.12610292434692383, -0.20512071251869202, 0.01710747927427292, 0.11835819482803345, -0.33697330951690674, -0.011600375175476074, 0.11061184108257294, -0.1294345259666443, 0.24606746435165405, 0.13715066015720367, 0.29563406109809875, 0.2620547413825989, 0.19842363893985748, 0.05681512504816055, 0.16865132749080658, -0.040728770196437836, -0.06531963497400284, -0.333936482667923, -0.19342045485973358, -0.06313559412956238, -0.11421424895524979, 0.2866409122943878, -0.3934297561645508, 0.033986449241638184, -0.49590739607810974, 0.07280446588993073, -0.29637113213539124, -0.24149587750434875, -0.47618719935417175, -0.1626778244972229, -0.3624960482120514, -0.30377480387687683, -0.27479010820388794, 0.038298703730106354, 0.19789260625839233, -0.16790688037872314, 0.19439789652824402, -0.10098512470722198, -0.058447740972042084, -0.2231634557247162, -0.257484495639801, -0.18920156359672546, -0.05887378007173538, 0.0018168110400438309, 0.2173997014760971, -0.013347426429390907, 0.2748746871948242, -0.387501984834671, 0.267821729183197, -0.6457683444023132, -0.15185779333114624, 0.06491472572088242, -0.3298290967941284, -0.03223991394042969, 0.42315617203712463, 0.154727503657341, 0.10051697492599487, -0.019050627946853638, 0.097248874604702, -0.24411574006080627, -0.19957098364830017, -0.16305315494537354, -0.2659042775630951, 0.043034911155700684, -0.00022476911544799805, 0.11259113252162933, -0.33678415417671204, -0.03202354907989502, 0.38794058561325073, 0.028263691812753677, -0.06125403940677643, -0.11302818357944489, 0.19056130945682526, 0.1362314224243164, -0.13859958946704865, 0.05543257296085358, -0.08892415463924408, -0.6099945306777954, 0.5190353393554688, -0.27191415429115295, -0.42939984798431396, 0.20380577445030212, 0.12491624057292938, 0.31066998839378357, 0.07197939604520798, -0.0384952649474144, -0.013895702548325062, -0.012694856151938438, 0.18203586339950562, 0.07898279279470444, 0.2720286548137665, 0.12553289532661438, 0.018703198060393333, 0.12804679572582245, -0.08370567858219147, 0.028191380202770233, -0.11498082429170609, -0.30930501222610474, 0.26087504625320435, 0.20654195547103882, 0.1290924847126007, -0.1269294023513794, 0.45611125230789185, 0.34854280948638916, -0.27203887701034546, 0.10877998918294907, -0.25696665048599243, 0.5241813063621521, 0.045164335519075394, -0.4518509805202484, 0.08956950902938843, -0.1673026978969574, 0.21885980665683746, 0.03407743573188782, 0.2060677409172058, 0.5156524181365967, -0.21768270432949066, -0.107478067278862, -0.1889890730381012, -0.27937376499176025, -0.20049674808979034, -0.22347888350486755, 0.1615990847349167, -0.2274792641401291, 0.1066448912024498, -0.1646692007780075, -0.04397187381982803, 0.16722427308559418, 0.37302887439727783, 0.5197250843048096, 0.22738079726696014, -0.3259381353855133, -0.15838623046875, -0.5980518460273743, 0.3543012738227844, 0.0130577702075243, -0.10659119486808777, -0.008389931172132492, -0.014311978593468666, -0.02208792418241501, 0.04159625992178917, 0.6962055563926697, 0.19085539877414703, -0.37512463331222534, -0.10106636583805084, -0.26656240224838257, -0.5702997446060181, 0.2494605928659439, 0.09006968140602112, 0.26881855726242065, 0.044534504413604736, 0.20115073025226593, -0.30793604254722595, -0.39670535922050476, 0.17287470400333405, 0.3782693147659302, -0.16705885529518127, 0.09707175940275192, -0.22258050739765167, -0.3207200765609741, -0.049177151173353195, -0.2789527177810669, 0.044957779347896576, 0.19682469964027405, -0.028744012117385864, -0.03443773463368416, -0.23378418385982513, -0.05362783372402191, 0.3797159194946289, -0.21223948895931244, 0.27816328406333923, -0.0841500386595726, -0.11091534793376923, 0.3654397130012512, 0.2770374119281769, 0.281790167093277, 0.3845614194869995, -0.15503747761249542, -0.4165470004081726, -0.12264669686555862, 0.335019588470459, 0.5242550373077393, 0.021354563534259796, -0.0993480309844017, 0.0765557810664177, -0.01202794536948204, 0.062308818101882935, -0.43890148401260376, -0.266962468624115, 0.32704228162765503, 0.2386481910943985, -0.3088991641998291, -0.4852910339832306, 0.4650244414806366, 0.3783824145793915, 0.27403169870376587, 0.08493353426456451, 0.7116439938545227, -0.14592118561267853, -0.1323978155851364, 0.26132887601852417, 0.8914647698402405, -0.1674758344888687, 0.18997953832149506, 0.16302531957626343, -0.21947990357875824, 0.8415807485580444, 0.1374911665916443, -0.13053447008132935, -0.337819904088974, 0.0351775586605072, -0.23439551889896393, -0.026843762025237083, 0.2615641951560974, 0.03244617581367493, -0.1871914267539978, 0.3518202304840088, -0.2305314540863037, 0.19067254662513733, -0.10649239271879196, 0.04888375848531723, -0.260853111743927, -0.19967833161354065, -0.30400341749191284, 0.05797555297613144, -0.0035990439355373383, 0.40008458495140076, 0.11736046522855759, -0.2142612487077713, -0.10811563581228256, 0.09997493028640747, -0.18371984362602234, 0.03413325175642967, -0.24843475222587585, -0.1012917011976242, 0.41825634241104126, -0.5319175124168396, 0.28944364190101624, 0.7321263551712036, 0.5973676443099976, -0.05063370242714882, -0.3252330422401428, -0.030776742845773697, -0.14133098721504211, -0.11457345634698868, -0.19080092012882233, 0.02517438307404518, 0.16037684679031372, 0.13637399673461914, 0.04898007959127426, 0.11752285808324814, 0.16311480104923248, -0.03667772561311722, -0.3489843010902405, -0.14896324276924133, -0.05383709818124771, -0.3592841923236847, -0.2563873529434204, 0.2402498722076416, 0.2357672154903412, -0.04947979748249054, -0.010120553895831108, 0.13560569286346436, -0.23314765095710754, -0.026488542556762695, 0.0024578124284744263, -0.073968306183815, 0.1268221139907837, 0.3906155228614807, -0.17169058322906494, -0.3727155923843384, 0.2634187340736389, 0.3046937584877014, -0.0849955677986145, -0.017670011147856712, 0.16500702500343323, 0.6306069493293762, -0.2085113823413849, 0.17701023817062378, 0.07263097912073135, 0.3828263282775879, -0.041869696229696274, 0.06274653226137161, -0.01112930104136467, -0.0914309099316597, -0.055953849107027054, -0.04473762959241867, -0.42195191979408264, 0.08048225194215775, 0.014129269868135452, 0.09842138737440109, 0.10177389532327652, -0.0057207513600587845, 0.004421800374984741, -0.057641200721263885, -0.18926778435707092, 0.22049686312675476, 0.17556364834308624, -0.10120131075382233, 0.4849810004234314, -0.011923961341381073, -0.16125278174877167, -0.10787543654441833, -0.005947405472397804, 0.13571205735206604, 0.02871154434978962, -0.08114317059516907, -0.1152244359254837, 0.17702463269233704, -0.09549493342638016, -0.06951789557933807, 0.13837778568267822, 0.031161915510892868, -0.13459283113479614, -0.371211975812912, 0.29910409450531006, 0.4616960883140564, 0.10284645855426788, 0.24576027691364288, 0.1873399317264557, 0.19919106364250183, -0.12582440674304962, -0.06196315586566925, 0.29111433029174805, 0.41567033529281616, -0.05762741342186928, 0.1572100818157196, -0.10797517746686935, -0.11961838603019714, 0.06030702590942383, 0.36309853196144104, 0.39561861753463745, -0.313473105430603, 0.346366822719574, 0.10461431741714478, 0.017885271459817886, 0.0208726916462183, 0.41502058506011963, 0.2370397299528122, -0.07008662819862366, 0.4503892660140991, 0.1638810932636261, -0.07301760464906693, -0.17067308723926544, -0.11960604786872864, 0.040998149663209915, -0.09754008054733276, -0.2049504667520523, 0.16125434637069702, -0.12419550120830536, 0.2898555397987366, 0.05314328148961067, -0.2677775025367737, 0.2873649299144745, 0.03688669204711914, 0.057967688888311386, 0.34937530755996704, 0.3228118419647217, -0.007457908242940903, 0.27876850962638855, 0.3915973901748657, 0.26582157611846924, 0.1610826551914215, -0.07847874611616135, 0.5464184880256653, -0.06229924410581589, 0.1550327092409134, 0.742498517036438, -0.19067269563674927, -0.24208708107471466, 0.03792943060398102, 0.13690400123596191, 0.12816716730594635, -0.12187084555625916, 0.6136914491653442, -0.2272246778011322, -0.2740243375301361, 0.08482153713703156, 0.5572196841239929, -0.017356183379888535, -0.30692070722579956, 0.03837653994560242, -0.09736758470535278, -0.07183253020048141, 0.015564188361167908, -0.14971093833446503, -0.6134594678878784, 0.1337995082139969, -0.04635190963745117, 0.17156651616096497, -0.055989980697631836, 0.07865364104509354, 0.16190893948078156, 0.04166369140148163, -0.06976978480815887, -0.20600640773773193, 0.22022587060928345, -0.09869353473186493, 0.16271771490573883, 0.29769328236579895, 0.4318188726902008, 0.09756434708833694, -0.14058727025985718, 0.32087963819503784, -0.040038757026195526, -0.2144649773836136, 0.1810067743062973, 0.03190780431032181, -0.10470576584339142, 0.013167675584554672, 0.1959211528301239, 0.06566092371940613, 0.13488352298736572, -0.1731790006160736, -0.09482964873313904, 0.46645310521125793, -0.2586868703365326, 0.32042190432548523, -0.5293467044830322, -0.09846743196249008, -0.42160725593566895, 0.08007220923900604, -0.45380616188049316, -0.20601646602153778, 0.10867667198181152, 0.16207091510295868, -0.088752381503582, -0.03848298266530037, 0.009028671309351921, 0.2015482783317566, 0.26229846477508545, 0.29963937401771545, 0.3933573365211487, -0.07471403479576111, -0.4565631151199341, -0.48111990094184875, -0.14123225212097168, 0.34435147047042847, 0.117263063788414, -0.15481732785701752, -0.05412619560956955, 0.08051830530166626, 0.23714347183704376, -0.16996808350086212, 0.036201901733875275, 0.1569790542125702, 0.1586017906665802, 0.24149028956890106, -0.3458627462387085, -0.09123547375202179, 0.0006219800561666489, 0.06991800665855408, 0.07091657817363739, 0.14273832738399506, -0.0763566642999649, -0.10565947741270065, -0.22968082129955292, 0.35623905062675476, -0.054600656032562256, -0.00017224252223968506, -0.006205372512340546, 0.2192974090576172, 0.27492520213127136, -0.03580480441451073, -0.1050565242767334, 0.09273603558540344, 0.17927286028862, -0.2063247114419937, 0.4687262177467346, -0.27811384201049805, 0.08650869876146317, -0.16548798978328705, -0.4757396876811981, -0.2905607521533966, 0.24743621051311493, 0.17598870396614075, -0.1687285602092743, -0.35340312123298645, 0.31381136178970337, -0.14032503962516785, -0.20693141222000122, 0.3423892855644226, 0.39749380946159363, -0.18727631866931915, 0.2159937024116516, -0.15093860030174255, 0.16789107024669647, 0.5362399816513062, -0.3085716664791107, -0.0613456629216671, -0.021281786262989044, -0.1206756979227066, 0.3160492181777954, -0.49551454186439514, -0.5577207207679749, 0.0423336997628212, 0.13767202198505402, -0.041971661150455475, 0.1860959827899933, 0.12797054648399353, -0.07729445397853851, -0.06919467449188232, -0.17337235808372498, 0.3270939588546753, 0.3404582738876343, 0.09782406687736511, 0.11638779938220978, -0.19379092752933502 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
Maybe `Dataset.from_list` can work as well no ? ```python from datasets import Dataset dset = Dataset.from_list(torch_dataset) ```
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
17
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. Maybe `Dataset.from_list` can work as well no ? ```python from datasets import Dataset dset = Dataset.from_list(torch_dataset) ```
[ -0.04258471354842186, -0.520442545413971, -0.03426603972911835, 0.3045966327190399, 0.4214355945587158, 0.29871663451194763, -0.07740248739719391, 0.10588885843753815, 0.008069857954978943, 0.0816090852022171, -0.22678148746490479, 0.16717764735221863, -0.3443012237548828, 0.1292041391134262, 0.12472881376743317, -0.2711709141731262, 0.3801068663597107, -0.19685426354408264, -0.36241546273231506, -0.0002162531018257141, -0.2037939876317978, 0.3381408452987671, 0.04301594942808151, -0.06946378946304321, -0.013239885680377483, 0.21211399137973785, -0.12883247435092926, 0.1023743748664856, -0.1642375886440277, -0.09598235785961151, 0.4198017120361328, -0.06296771764755249, 0.18844635784626007, 0.5153101682662964, -0.00012436520773917437, -0.12630416452884674, -0.03819166123867035, -0.18925024569034576, 0.043567366898059845, -0.2817118763923645, 0.23116666078567505, -0.15601471066474915, 0.26666873693466187, 0.010408282279968262, -0.3262183666229248, -0.08216967433691025, -0.05673161894083023, -0.45105019211769104, 0.2941707968711853, 0.32508882880210876, 0.09759923815727234, 0.21901558339595795, 0.39767998456954956, 0.013615808449685574, 0.01602736860513687, 0.5132246017456055, -0.12869083881378174, 0.10369665920734406, 0.23436027765274048, 0.22065192461013794, 0.42476916313171387, 0.09354251623153687, -0.22953452169895172, -0.1792232096195221, 0.5911587476730347, -0.0032201269641518593, -0.48265892267227173, -0.35917752981185913, 0.05192864313721657, 0.19807168841362, 0.4222901165485382, -0.35539308190345764, -0.41177821159362793, -0.019141245633363724, 0.10072140395641327, 0.024553684517741203, -0.2708207964897156, 0.2764410972595215, -0.15244267880916595, 0.0902666300535202, -0.3149111568927765, -0.5141273140907288, -0.1057986468076706, 0.01777040585875511, -0.13467180728912354, 0.13270050287246704, -0.3078140318393707, 0.06395003944635391, 0.3038451075553894, -0.3909357786178589, -0.07802332192659378, -0.028578169643878937, 0.21870553493499756, 0.14588123559951782, 0.05597852170467377, -0.015579834580421448, -0.383785218000412, 0.4286019802093506, 0.34562310576438904, 0.14218801259994507, -0.10494952648878098, -0.03800260275602341, -0.17570944130420685, 0.042428769171237946, 0.12057693302631378, -0.06310275942087173, 0.1203039363026619, 0.1341291218996048, 0.0015210062265396118, 0.00009581039194017649, 0.11018103361129761, 0.09008340537548065, -0.01912590116262436, -0.30984872579574585, -0.18409886956214905, -0.05039524286985397, 0.38137078285217285, -0.31717410683631897, -0.12925569713115692, -0.2519303262233734, -0.006932549178600311, 0.20846474170684814, 0.05051412805914879, 0.16022293269634247, -0.030448254197835922, 0.10750764608383179, 0.30764472484588623, 0.19343987107276917, -0.022715294733643532, -0.17277215421199799, -0.05050290375947952, 0.08266633749008179, -0.029355503618717194, -0.01863819919526577, -0.1119299829006195, -0.6267586946487427, 0.030526569113135338, 0.08928985893726349, 0.17294347286224365, 0.13869528472423553, -0.29034844040870667, 0.2502519190311432, 0.39795437455177307, 0.08932715654373169, 0.05382562056183815, 0.08565818518400192, 0.35402101278305054, 0.04961496591567993, -0.3560510277748108, -0.01099204272031784, -0.3118765652179718, 0.05066375061869621, -0.34330838918685913, -0.02005907893180847, -0.03057219833135605, -0.14102736115455627, -0.262705534696579, 0.15365426242351532, -0.0063705891370773315, -0.05831734463572502, 0.196150541305542, -0.16671383380889893, -0.24826247990131378, -0.3258601725101471, 0.38265126943588257, 0.3551463484764099, -0.22580815851688385, -0.24943587183952332, 0.20602376759052277, -0.3906240463256836, -0.09300903230905533, 0.2280476689338684, 0.10090652108192444, -0.31884974241256714, -0.39410942792892456, -0.2674104571342468, 0.0004621073603630066, -0.4550282657146454, -0.004796881228685379, 0.13658803701400757, 0.09538386762142181, 0.09341533482074738, -0.13575133681297302, 0.2000533491373062, -0.06395895034074783, -0.130967378616333, 0.024182073771953583, 0.09687849879264832, -0.1369861215353012, -0.13155050575733185, 0.13586722314357758, -0.1555359661579132, 0.5233967900276184, -0.0932522863149643, -0.19659066200256348, 0.19861894845962524, -0.19146856665611267, -0.11222124844789505, 0.23772072792053223, -0.13754568994045258, 0.10535865277051926, 0.23373880982398987, 0.11382648348808289, 0.3713453412055969, -0.008744118735194206, -0.1101636290550232, -0.3003074526786804, -0.0900999903678894, 0.19177190959453583, -0.049986109137535095, -0.11298595368862152, -0.324076771736145, -0.08213196694850922, 0.07923424988985062, -0.02374519780278206, -0.025582928210496902, -0.016866765916347504, -0.08838249742984772, 0.3219684660434723, -0.15007002651691437, -0.27638018131256104, 0.3510754704475403, -0.00960475578904152, 0.3745933771133423, -0.6586220860481262, 0.13817667961120605, 0.21576188504695892, -0.02441532164812088, 0.17890456318855286, 0.4099900722503662, 0.16718840599060059, -0.08227590471506119, 0.159365713596344, 0.17739972472190857, 0.1685815155506134, 0.19793643057346344, -0.009621914476156235, 0.09327209740877151, 0.07108908146619797, -0.2461402863264084, 0.032659754157066345, 0.389238178730011, 0.046347253024578094, 0.006659507751464844, -0.3180878460407257, 0.498742938041687, -0.05027982220053673, 0.2952157258987427, -0.04080299660563469, 0.4007294774055481, -0.0006948616355657578, 0.20203590393066406, -0.2281602919101715, -0.0008323490619659424, -0.12430581450462341, -0.1702459752559662, 0.3504517674446106, 0.06739635020494461, -0.6239298582077026, 0.012048877775669098, 0.10085746645927429, -0.1834035962820053, 0.059271086007356644, 0.1139158084988594, -0.34492024779319763, 0.044860102236270905, 0.19145415723323822, -0.2216670662164688, 0.24929025769233704, 0.17425885796546936, 0.3088440001010895, 0.2625162601470947, 0.24033260345458984, 0.08811023831367493, 0.18382398784160614, -0.015643320977687836, -0.08588223159313202, -0.3662474751472473, -0.10453706979751587, -0.07537349313497543, -0.0813092291355133, 0.25025054812431335, -0.42757853865623474, -0.018662991002202034, -0.49108392000198364, 0.017690325155854225, -0.3915029466152191, -0.2809864282608032, -0.5040678977966309, -0.1839267462491989, -0.40191271901130676, -0.3095081150531769, -0.26881736516952515, -0.0013108327984809875, 0.21312780678272247, -0.12900333106517792, 0.13288605213165283, -0.12540145218372345, -0.0906076654791832, -0.30582717061042786, -0.2101176679134369, -0.13263709843158722, -0.07700498402118683, 0.007506478577852249, 0.18705680966377258, 0.08954664319753647, 0.21874630451202393, -0.35026589035987854, 0.2994706630706787, -0.6097329258918762, -0.19494619965553284, 0.04289216548204422, -0.2760728597640991, -0.07642846554517746, 0.41144561767578125, 0.17928284406661987, 0.05331701040267944, 0.023752328008413315, 0.06426747888326645, -0.20639117062091827, -0.21071907877922058, -0.17681953310966492, -0.2449895441532135, 0.02998972497880459, 0.008017051964998245, 0.056292708963155746, -0.37983933091163635, -0.022765403613448143, 0.3421704173088074, 0.016876745969057083, -0.09325867891311646, -0.2027818113565445, 0.15047723054885864, 0.13674071431159973, -0.1956876814365387, 0.06316199153661728, -0.069304458796978, -0.5699708461761475, 0.5181092619895935, -0.23766541481018066, -0.4448585510253906, 0.2455260455608368, 0.215443417429924, 0.2835591435432434, 0.04909177124500275, -0.06501113623380661, -0.06465239077806473, -0.02185625396668911, 0.11801207065582275, 0.03031628206372261, 0.273578017950058, 0.16715359687805176, -0.03350983187556267, 0.11378206312656403, -0.1199946179986, -0.054908640682697296, -0.1500886082649231, -0.23504072427749634, 0.2719396650791168, 0.16444671154022217, 0.08158206939697266, -0.10684634745121002, 0.4239655137062073, 0.35756343603134155, -0.27358078956604004, 0.12307152152061462, -0.27914491295814514, 0.5266978144645691, 0.09418050944805145, -0.44154781103134155, 0.11024513840675354, -0.14694443345069885, 0.258190393447876, 0.08966630697250366, 0.22478830814361572, 0.41835424304008484, -0.20981143414974213, -0.17752596735954285, -0.20330655574798584, -0.24374280869960785, -0.2378818839788437, -0.19584135711193085, 0.1358172446489334, -0.21766352653503418, 0.05086405575275421, -0.11991588771343231, -0.07637069374322891, 0.1538773626089096, 0.4734407067298889, 0.43300750851631165, 0.24795830249786377, -0.2999049723148346, -0.16454099118709564, -0.48728299140930176, 0.40928804874420166, -0.011351678520441055, -0.011339900083839893, -0.036260221153497696, 0.027239270508289337, -0.017739780247211456, 0.07965362071990967, 0.6138076782226562, 0.2274748682975769, -0.36033469438552856, -0.08395062386989594, -0.2665148973464966, -0.5707410573959351, 0.23141540586948395, 0.03749432787299156, 0.30739128589630127, 0.07442336529493332, 0.1923922896385193, -0.31070953607559204, -0.3544656038284302, 0.18103158473968506, 0.36416834592819214, -0.1428646445274353, 0.10393572598695755, -0.22453035414218903, -0.32787981629371643, -0.029946554452180862, -0.2122407853603363, 0.047421425580978394, 0.14765653014183044, -0.001095315208658576, -0.043054819107055664, -0.27268487215042114, -0.11830359697341919, 0.39234620332717896, -0.26884177327156067, 0.29541075229644775, -0.07048895955085754, -0.13863322138786316, 0.2850889563560486, 0.35627397894859314, 0.3526246249675751, 0.41631096601486206, -0.15076234936714172, -0.43023884296417236, -0.12864720821380615, 0.324493408203125, 0.5957360863685608, -0.004244297742843628, -0.08163045346736908, 0.10985886305570602, -0.03991352394223213, 0.01826891303062439, -0.3486851751804352, -0.2520982623100281, 0.27949774265289307, 0.2809401750564575, -0.32204851508140564, -0.3770157992839813, 0.4423627257347107, 0.4027523696422577, 0.27616268396377563, 0.018978439271450043, 0.686547577381134, -0.18296273052692413, -0.1154707595705986, 0.2554004192352295, 0.9483461976051331, -0.15360964834690094, 0.17463722825050354, 0.08004865050315857, -0.2900557816028595, 0.7937402725219727, 0.16067302227020264, -0.1435248702764511, -0.3149595558643341, 0.07983484864234924, -0.2645201086997986, -0.021232087165117264, 0.28759095072746277, -0.008266735821962357, -0.23170502483844757, 0.393592894077301, -0.2894238233566284, 0.2778591215610504, -0.1391596794128418, 0.0637965276837349, -0.20512965321540833, -0.17837469279766083, -0.3062611520290375, 0.06302943080663681, -0.028329677879810333, 0.3741110861301422, 0.17302602529525757, -0.22918343544006348, -0.16272583603858948, 0.10434481501579285, -0.16929590702056885, -0.01758217252790928, -0.24316692352294922, -0.09247526526451111, 0.32870376110076904, -0.5592274069786072, 0.3104439377784729, 0.7160118222236633, 0.5269415974617004, -0.019823428243398666, -0.3720436692237854, -0.05599534884095192, -0.14134103059768677, -0.10612089931964874, -0.23007911443710327, 0.032869815826416016, 0.11907286196947098, 0.10535340756177902, 0.025510601699352264, 0.06879106909036636, 0.1955135017633438, -0.025125890970230103, -0.3512183725833893, -0.06452666223049164, -0.03780461102724075, -0.41379570960998535, -0.3438951373100281, 0.2170087993144989, 0.2358231544494629, -0.05277497321367264, -0.008954200893640518, 0.11556757986545563, -0.19820457696914673, 0.01553867757320404, 0.18019933998584747, -0.09078656136989594, 0.087336465716362, 0.43401655554771423, -0.18314069509506226, -0.37474051117897034, 0.23564881086349487, 0.3091401755809784, -0.13703060150146484, -0.021288983523845673, 0.21888622641563416, 0.6087396740913391, -0.1522696316242218, 0.14325706660747528, 0.0005949095357209444, 0.42360854148864746, -0.07907474040985107, -0.016283895820379257, -0.039866067469120026, -0.052122607827186584, -0.11233071982860565, -0.11939708888530731, -0.393260657787323, 0.10993528366088867, 0.0022623836994171143, 0.13170300424098969, 0.08036410063505173, 0.030969206243753433, -0.012475908733904362, -0.17660163342952728, -0.18646761775016785, 0.2670157551765442, 0.11299953609704971, -0.08429016917943954, 0.4364517331123352, 0.062284331768751144, -0.1566128432750702, -0.09903128445148468, -0.005694987252354622, 0.13816511631011963, 0.08026546239852905, -0.07699419558048248, -0.08077195286750793, 0.18074455857276917, -0.1365048587322235, -0.019339872524142265, 0.0745583325624466, 0.0036228932440280914, -0.14267830550670624, -0.356820672750473, 0.22635473310947418, 0.495610773563385, 0.08019613474607468, 0.27547574043273926, 0.19762960076332092, 0.15737521648406982, -0.09480240941047668, -0.046745315194129944, 0.2767689824104309, 0.35998791456222534, -0.06382348388433456, 0.14431366324424744, -0.08570761978626251, -0.07413537800312042, 0.12969636917114258, 0.3054659366607666, 0.4227849841117859, -0.28075292706489563, 0.2844029366970062, 0.15706750750541687, 0.037822622805833817, -0.002072522882372141, 0.45034679770469666, 0.22439220547676086, -0.06960172951221466, 0.5023370981216431, 0.1601240336894989, -0.08762932568788528, -0.2052271068096161, -0.12410583347082138, 0.12841832637786865, -0.055652931332588196, -0.22618930041790009, 0.14815571904182434, -0.08286184817552567, 0.3836362659931183, 0.10281587392091751, -0.26162832975387573, 0.342366486787796, 0.0425989143550396, 0.06304486840963364, 0.32162341475486755, 0.31211844086647034, -0.025119561702013016, 0.2672453820705414, 0.38028237223625183, 0.27078109979629517, 0.16732189059257507, -0.094478078186512, 0.6282318830490112, 0.050161778926849365, 0.17768555879592896, 0.77615886926651, -0.19692173600196838, -0.25025779008865356, 0.03121928870677948, 0.18180596828460693, 0.11961987614631653, -0.10066981613636017, 0.6001760959625244, -0.22937092185020447, -0.2762294411659241, 0.12708725035190582, 0.5165807604789734, -0.04785340279340744, -0.3083062469959259, 0.08118360489606857, -0.08695098012685776, -0.06297844648361206, -0.011438107118010521, -0.164681538939476, -0.6134514808654785, 0.14631691575050354, -0.05750739574432373, 0.16135071218013763, -0.07606923580169678, 0.026347875595092773, 0.18031904101371765, 0.029401689767837524, -0.05873345583677292, -0.25399789214134216, 0.1657131463289261, -0.06856679916381836, 0.18838077783584595, 0.2562352120876312, 0.41596776247024536, 0.03670661896467209, -0.13124045729637146, 0.2869134247303009, -0.023841585963964462, -0.21911828219890594, 0.1905452460050583, 0.013606138527393341, -0.06770548224449158, 0.05185600370168686, 0.19658653438091278, 0.08811435103416443, 0.14422085881233215, -0.09434154629707336, -0.1308528333902359, 0.3834873139858246, -0.30291497707366943, 0.33846694231033325, -0.5459994077682495, -0.11922555416822433, -0.5026392936706543, 0.028005436062812805, -0.4396100640296936, -0.2206607460975647, 0.17351049184799194, 0.19274213910102844, -0.07999910414218903, 0.021228410303592682, 0.002034548670053482, 0.16733066737651825, 0.2348775714635849, 0.25879350304603577, 0.39532843232154846, -0.0789552628993988, -0.41482633352279663, -0.45759081840515137, -0.12241440266370773, 0.35789960622787476, 0.06749986112117767, -0.11198526620864868, -0.10801620036363602, 0.08596553653478622, 0.2320123165845871, -0.12167561054229736, 0.023274071514606476, 0.23261535167694092, 0.06276185810565948, 0.17703469097614288, -0.3675958216190338, -0.119948610663414, 0.014870533719658852, 0.11540836095809937, 0.10038716346025467, 0.14079570770263672, -0.0480533167719841, -0.11980985105037689, -0.3160884976387024, 0.28657829761505127, -0.08450426906347275, 0.027204539626836777, 0.019504763185977936, 0.1523759663105011, 0.3374200165271759, -0.03821751847863197, -0.057189010083675385, 0.12296424806118011, 0.1637343019247055, -0.19033946096897125, 0.49949851632118225, -0.32557350397109985, 0.05810108780860901, -0.19270369410514832, -0.496217280626297, -0.23397885262966156, 0.2246892750263214, 0.1315033733844757, -0.16960817575454712, -0.3128194510936737, 0.3109842836856842, -0.14620482921600342, -0.2173253893852234, 0.3046683967113495, 0.3977214992046356, -0.1918037235736847, 0.1797259896993637, -0.11773272603750229, 0.12075094878673553, 0.5678790211677551, -0.2864588499069214, -0.02669602259993553, -0.015622150152921677, -0.13444757461547852, 0.23141658306121826, -0.44656437635421753, -0.6207994222640991, 0.007764749228954315, 0.17111268639564514, -0.01253511756658554, 0.140048086643219, 0.12196515500545502, -0.11268289387226105, -0.04060064256191254, -0.1801915168762207, 0.3233652710914612, 0.38211002945899963, 0.12326569855213165, 0.0605287067592144, -0.20958223938941956 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
> ```python > from datasets import Dataset > > def gen(): > for idx in len(torch_dataset): > yield torch_dataset[idx] # this has to be a dictionary > ## or if it's an IterableDataset > # for ex in torch_dataset: > # yield ex > > dset = Dataset.from_generator(gen) > ``` I try to use `Dataset.from_generator()` method, and it returns an error: ```bash AttributeError: type object 'Dataset' has no attribute 'from_generator' ``` And I think it maybe the version of my datasets package is out-of-date, so I update it ```bash pip install --upgrade datasets ``` But after that, the code still return the above Error.
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
104
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. > ```python > from datasets import Dataset > > def gen(): > for idx in len(torch_dataset): > yield torch_dataset[idx] # this has to be a dictionary > ## or if it's an IterableDataset > # for ex in torch_dataset: > # yield ex > > dset = Dataset.from_generator(gen) > ``` I try to use `Dataset.from_generator()` method, and it returns an error: ```bash AttributeError: type object 'Dataset' has no attribute 'from_generator' ``` And I think it maybe the version of my datasets package is out-of-date, so I update it ```bash pip install --upgrade datasets ``` But after that, the code still return the above Error.
[ -0.1442515105009079, -0.43003615736961365, -0.004021890461444855, 0.3285945653915405, 0.379458487033844, 0.23986491560935974, -0.03017738088965416, 0.11686287820339203, -0.004440780729055405, 0.12482424825429916, -0.07780871540307999, 0.21056626737117767, -0.33906400203704834, 0.043921202421188354, 0.11905040591955185, -0.2596675157546997, 0.3978409469127655, -0.1068231463432312, -0.45493826270103455, -0.008409339934587479, -0.21797987818717957, 0.3888148367404938, 0.06268231570720673, 0.013631924986839294, -0.04968028888106346, 0.16956989467144012, -0.038390789180994034, 0.033127352595329285, -0.2736821174621582, -0.17878307402133942, 0.4195626974105835, -0.04795974865555763, 0.1618523746728897, 0.5031748414039612, -0.0001265866303583607, -0.1339588165283203, 0.07256309688091278, -0.13520896434783936, -0.033770591020584106, -0.3036472797393799, 0.2760831415653229, -0.07400945574045181, 0.15206044912338257, 0.030178047716617584, -0.29260510206222534, -0.1180528774857521, -0.12134617567062378, -0.44722867012023926, 0.3180505037307739, 0.30173778533935547, 0.089985691010952, 0.13086363673210144, 0.5101422667503357, -0.04929603636264801, 0.03154519945383072, 0.48298341035842896, -0.13512955605983734, 0.010533522814512253, 0.19170735776424408, 0.17440730333328247, 0.43446868658065796, 0.16298343241214752, -0.22615768015384674, -0.12799131870269775, 0.7382636070251465, -0.06001187860965729, -0.4040927290916443, -0.361101359128952, 0.08115251362323761, 0.14188653230667114, 0.4073130190372467, -0.3799227774143219, -0.4742695093154907, -0.08683615922927856, 0.11852840334177017, -0.007776867598295212, -0.20682179927825928, 0.17036306858062744, -0.2696598172187805, 0.07702398300170898, -0.37151920795440674, -0.5538198351860046, -0.15085063874721527, -0.029816098511219025, -0.023942075669765472, 0.021895065903663635, -0.3067813813686371, 0.11813516914844513, 0.3494987487792969, -0.33783048391342163, 0.024456430226564407, -0.05942931026220322, 0.1662386804819107, 0.1275216042995453, 0.10822232812643051, -0.00978192687034607, -0.23910680413246155, 0.44518882036209106, 0.3518884479999542, 0.15533331036567688, -0.14907348155975342, -0.10542599111795425, -0.13006816804409027, 0.03894690424203873, 0.07078100740909576, -0.08447133004665375, 0.22714447975158691, 0.08124403655529022, -0.024575412273406982, -0.0032148845493793488, 0.1121160238981247, 0.05187154561281204, -0.08213315159082413, -0.33771684765815735, -0.10297983884811401, -0.008838661015033722, 0.3867000937461853, -0.24128536880016327, -0.1372610479593277, -0.21126629412174225, 0.023323245346546173, 0.13793033361434937, 0.04233284294605255, 0.17439153790473938, -0.0701751783490181, 0.11755950003862381, 0.2846260666847229, 0.18851284682750702, -0.05136505514383316, -0.297656774520874, -0.03440644592046738, 0.07033093273639679, -0.05726074054837227, -0.031399406492710114, -0.10698764026165009, -0.6132780909538269, -0.028869373723864555, 0.15331895649433136, 0.036952707916498184, 0.1433010846376419, -0.30257660150527954, 0.2343430370092392, 0.37669217586517334, 0.03870728611946106, 0.012426994740962982, 0.1089005097746849, 0.37611037492752075, -0.05769241973757744, -0.35281792283058167, -0.04554389417171478, -0.2542332112789154, -0.048009566962718964, -0.399789959192276, -0.011995580978691578, -0.05128666013479233, -0.11812905967235565, -0.3190701901912689, 0.11672447621822357, 0.03943120315670967, -0.09448301792144775, 0.12833113968372345, -0.17133399844169617, -0.20594702661037445, -0.2321719527244568, 0.40083029866218567, 0.4663647413253784, -0.268675833940506, -0.2210526168346405, 0.08255141973495483, -0.3956192433834076, -0.1115211620926857, 0.12926332652568817, 0.07940325886011124, -0.13483786582946777, -0.3669039011001587, -0.47968757152557373, 0.08949916809797287, -0.43801096081733704, -0.10891835391521454, 0.11326846480369568, 0.14969119429588318, 0.10583902150392532, -0.03700069338083267, 0.143501877784729, -0.11259207129478455, -0.13361136615276337, 0.06022052466869354, 0.02440027706325054, -0.15113304555416107, -0.19165712594985962, 0.1426508128643036, -0.17015305161476135, 0.45435720682144165, -0.15343743562698364, -0.09744440019130707, 0.2942653298377991, -0.17057591676712036, -0.06556433439254761, 0.14370311796665192, -0.14907552301883698, 0.09844313561916351, 0.18811705708503723, 0.08455640822649002, 0.36709243059158325, -0.0642738863825798, -0.15444201231002808, -0.3178609013557434, -0.064573734998703, 0.21561719477176666, -0.04802989959716797, -0.1939316838979721, -0.2850337028503418, -0.09667102247476578, 0.1856420934200287, -0.07273270189762115, -0.05159192904829979, -0.04728822037577629, -0.044546522200107574, 0.3959294557571411, -0.18808753788471222, -0.2752108871936798, 0.38534384965896606, -0.023110829293727875, 0.32826608419418335, -0.7332106828689575, 0.13039857149124146, 0.12124069780111313, -0.04074836149811745, 0.14642934501171112, 0.39355775713920593, 0.16313812136650085, -0.053834009915590286, 0.12921907007694244, 0.21010547876358032, 0.08498045802116394, 0.17739035189151764, -0.025051966309547424, 0.06631886959075928, 0.07873940467834473, -0.18560214340686798, 0.03674433380365372, 0.2550606429576874, 0.024023819714784622, 0.07743682712316513, -0.19003301858901978, 0.3280605673789978, -0.011816661804914474, 0.33920231461524963, -0.019922740757465363, 0.3547748029232025, -0.029399193823337555, 0.26916903257369995, -0.1734936237335205, -0.035644400864839554, -0.12353059649467468, -0.21683908998966217, 0.33689582347869873, 0.06867849826812744, -0.4786226749420166, 0.09834373742341995, 0.15859851241111755, -0.13428518176078796, 0.05087284371256828, 0.15166303515434265, -0.3136916756629944, 0.010864555835723877, 0.15559370815753937, -0.04211295023560524, 0.2685546875, 0.1384543478488922, 0.19635915756225586, 0.22446592152118683, 0.1791963130235672, 0.09147227555513382, 0.1340797394514084, -0.016411088407039642, -0.07442892342805862, -0.28263622522354126, -0.19829605519771576, -0.04682891070842743, -0.0652439221739769, 0.1809764951467514, -0.3386375308036804, 0.1315709501504898, -0.5285437703132629, 0.0996050089597702, -0.356391578912735, -0.22796878218650818, -0.4244571924209595, -0.19458132982254028, -0.37748590111732483, -0.274854838848114, -0.23988525569438934, 0.06364186853170395, 0.22342246770858765, -0.11024971306324005, 0.23081517219543457, -0.1438867300748825, 0.021602118387818336, -0.2766833007335663, -0.25869882106781006, -0.18336334824562073, -0.09211567789316177, -0.030950993299484253, 0.1852579265832901, -0.028311261907219887, 0.29776430130004883, -0.40484482049942017, 0.2960296869277954, -0.6801103949546814, -0.11119735240936279, 0.09185487031936646, -0.334408700466156, 0.06804697215557098, 0.5121610164642334, 0.10788187384605408, 0.06930363178253174, -0.07747533172369003, 0.1846916675567627, -0.29745379090309143, -0.1882806420326233, -0.12622570991516113, -0.2764797806739807, 0.0073493062518537045, 0.02914087101817131, 0.04330487921833992, -0.30922403931617737, -0.06200091540813446, 0.3176315426826477, 0.08552618324756622, -0.046073026955127716, -0.0795425996184349, 0.26522746682167053, 0.131431445479393, -0.11726242303848267, 0.1365242600440979, -0.08068693429231644, -0.6032972931861877, 0.4540017247200012, -0.27253884077072144, -0.40294763445854187, 0.16603027284145355, 0.18739965558052063, 0.3190115988254547, 0.11584295332431793, -0.05879061669111252, -0.05484108254313469, 0.012655332684516907, 0.20080982148647308, 0.0297347791492939, 0.2712462544441223, 0.15191961824893951, 0.06662433594465256, 0.1254660189151764, -0.11136012524366379, -0.029801534488797188, -0.12639328837394714, -0.3981148898601532, 0.32912710309028625, 0.2476382553577423, 0.16846412420272827, -0.1525656133890152, 0.5368391275405884, 0.3158314824104309, -0.29811570048332214, 0.12425275892019272, -0.2738349437713623, 0.5247921943664551, -0.0027595162391662598, -0.5285136103630066, 0.08244798332452774, -0.1473625898361206, 0.21776986122131348, -0.01486700028181076, 0.15817761421203613, 0.5378865003585815, -0.23467713594436646, -0.0396026186645031, -0.19523850083351135, -0.26738592982292175, -0.2351725846529007, -0.20251396298408508, 0.16451114416122437, -0.23761428892612457, 0.18475154042243958, -0.22887282073497772, -0.07504088431596756, 0.21238456666469574, 0.3525342345237732, 0.4612898528575897, 0.2758701741695404, -0.3740071952342987, -0.17800076305866241, -0.494872510433197, 0.4186084270477295, 0.021833345293998718, -0.024056166410446167, -0.06897057592868805, 0.012521423399448395, -0.07003289461135864, 0.07441361993551254, 0.6611188650131226, 0.13009397685527802, -0.27683430910110474, -0.07674938440322876, -0.17627032101154327, -0.5939052104949951, 0.21071939170360565, 0.09281806647777557, 0.29063037037849426, -0.03123892843723297, 0.14513874053955078, -0.2956872284412384, -0.3888515830039978, 0.1960819661617279, 0.33784857392311096, -0.13255034387111664, 0.12335259467363358, -0.18612565100193024, -0.2762477993965149, -0.12570494413375854, -0.28086796402931213, -0.0020272843539714813, 0.19913910329341888, -0.04225560277700424, -0.025344980880618095, -0.25062501430511475, -0.08180640637874603, 0.4036875367164612, -0.20512862503528595, 0.3315247893333435, -0.13268595933914185, -0.10889337956905365, 0.30350053310394287, 0.22295868396759033, 0.42473459243774414, 0.3954540491104126, -0.16681182384490967, -0.41083765029907227, -0.0916428342461586, 0.34522372484207153, 0.45082172751426697, -0.019477158784866333, -0.1894175261259079, 0.04052955284714699, -0.05885321646928787, 0.05748840421438217, -0.36257204413414, -0.26430583000183105, 0.37156811356544495, 0.27350565791130066, -0.2826995253562927, -0.4957457184791565, 0.46790409088134766, 0.4326038062572479, 0.24186007678508759, 0.14622116088867188, 0.7082948088645935, -0.17837680876255035, -0.15719833970069885, 0.22703692317008972, 0.8944311141967773, -0.11041933298110962, 0.11490969359874725, 0.11943994462490082, -0.13636747002601624, 0.8491353392601013, 0.08894281089305878, -0.10028048604726791, -0.3399229943752289, 0.05537973716855049, -0.24019239842891693, -0.038505665957927704, 0.35589370131492615, 0.047608308494091034, -0.2604125142097473, 0.3837202191352844, -0.24896398186683655, 0.23700971901416779, -0.11766865849494934, 0.07278729975223541, -0.32542258501052856, -0.14351029694080353, -0.2914017140865326, 0.052457451820373535, -0.015882253646850586, 0.44403502345085144, 0.09893739968538284, -0.1330273151397705, -0.14517593383789062, 0.04580304026603699, -0.2512211799621582, 0.014581769704818726, -0.23971153795719147, -0.054090775549411774, 0.42281851172447205, -0.6118224859237671, 0.2649451196193695, 0.7033466696739197, 0.552847683429718, -0.021419312804937363, -0.31118303537368774, -0.009496208280324936, -0.2205871045589447, -0.12413410097360611, -0.18573670089244843, 0.037559524178504944, 0.20930184423923492, 0.12431240826845169, -0.004136957228183746, 0.14560088515281677, 0.1424807459115982, -0.09353888779878616, -0.23612365126609802, -0.15116842091083527, 0.036741018295288086, -0.3731957972049713, -0.2691001892089844, 0.14206300675868988, 0.20771175622940063, -0.05647827684879303, -0.024496495723724365, 0.07186577469110489, -0.21644310653209686, -0.03268836438655853, 0.006917592138051987, -0.04875026270747185, 0.12388132512569427, 0.3779468238353729, -0.2312590479850769, -0.30763760209083557, 0.28319355845451355, 0.32601606845855713, -0.09118738025426865, -0.029675187543034554, 0.10597320646047592, 0.5732901096343994, -0.2658914029598236, 0.19205643236637115, 0.05355372652411461, 0.36738860607147217, 0.011426093056797981, 0.04852947220206261, -0.015613321214914322, -0.024563759565353394, -0.08955612778663635, -0.0945507287979126, -0.34356585144996643, 0.10544518381357193, -0.05423798784613609, 0.06447383761405945, 0.11064479500055313, -0.04516258090734482, 0.037885867059230804, -0.10333903133869171, -0.16323532164096832, 0.17703302204608917, 0.13779981434345245, -0.06430723518133163, 0.44948890805244446, 0.010250918567180634, -0.16179583966732025, -0.14737993478775024, -0.026509927585721016, 0.09202973544597626, -0.016513459384441376, -0.055501390248537064, -0.09232485294342041, 0.18574218451976776, -0.0934993103146553, -0.04413497447967529, 0.13372507691383362, 0.019407004117965698, -0.12278708815574646, -0.332950621843338, 0.2854955494403839, 0.4602016806602478, 0.04907819628715515, 0.31151238083839417, 0.14751480519771576, 0.23234057426452637, -0.10305839031934738, -0.05411102622747421, 0.30140024423599243, 0.5056100487709045, -0.05831145495176315, 0.19682061672210693, -0.06785482913255692, -0.10033759474754333, -0.05209996551275253, 0.38377267122268677, 0.3465782403945923, -0.3089597225189209, 0.34830087423324585, 0.05309559777379036, 0.05391957238316536, 0.06919553875923157, 0.39222729206085205, 0.28444576263427734, -0.07504845410585403, 0.3926892578601837, 0.13776004314422607, -0.07930459082126617, -0.2000664621591568, -0.11614754050970078, 0.029540371149778366, -0.06880754232406616, -0.20580434799194336, 0.14662349224090576, -0.10828982293605804, 0.22986388206481934, 0.06165380775928497, -0.17769396305084229, 0.3825022578239441, -0.009926855564117432, 0.1536915898323059, 0.3970983326435089, 0.28785714507102966, 0.022588636726140976, 0.2812625765800476, 0.38637980818748474, 0.2206946611404419, 0.26118385791778564, -0.12082266062498093, 0.5236097574234009, 0.07175269722938538, 0.18122002482414246, 0.7404531240463257, -0.15482351183891296, -0.16873925924301147, 0.017867639660835266, 0.17917269468307495, 0.10230086743831635, -0.13549910485744476, 0.6524670720100403, -0.25235989689826965, -0.2657918930053711, 0.012324301525950432, 0.49986737966537476, 0.004502188414335251, -0.31108513474464417, 0.04603391885757446, -0.0995415523648262, -0.0917452722787857, -0.013558052480220795, -0.13822093605995178, -0.6299270987510681, 0.17135843634605408, -0.058110982179641724, 0.1189691424369812, -0.19581018388271332, 0.08855882287025452, 0.12239362299442291, 0.04342379420995712, -0.06653580069541931, -0.17633368074893951, 0.215884268283844, -0.09848922491073608, 0.16266050934791565, 0.36507371068000793, 0.5081402659416199, 0.13848108053207397, -0.08130134642124176, 0.27125316858291626, -0.08611780405044556, -0.22918130457401276, 0.1719408929347992, 0.07655691355466843, -0.11743408441543579, -0.0021179094910621643, 0.1620728075504303, 0.061742670834064484, 0.11825637519359589, -0.16540978848934174, -0.11894266307353973, 0.46691399812698364, -0.27907273173332214, 0.4051823318004608, -0.5518314838409424, -0.09574650228023529, -0.4412003457546234, 0.14056818187236786, -0.4690636396408081, -0.24412690103054047, 0.24073678255081177, 0.18822595477104187, -0.08577802777290344, -0.08972171694040298, -0.0038671307265758514, 0.15989233553409576, 0.2726926803588867, 0.2946034371852875, 0.417690634727478, -0.043303050100803375, -0.40299850702285767, -0.479053258895874, -0.16683638095855713, 0.3391033411026001, 0.112433061003685, -0.14826948940753937, -0.03485286608338356, -0.0016876980662345886, 0.26944953203201294, -0.08853907883167267, -0.0068662408739328384, 0.16303880512714386, 0.19069747626781464, 0.18412905931472778, -0.35595694184303284, -0.10091809928417206, 0.005414019338786602, 0.10288098454475403, 0.00024129822850227356, 0.10512852668762207, -0.09675350785255432, -0.13933521509170532, -0.23366837203502655, 0.2862471342086792, 0.016221921890974045, 0.01072024181485176, 0.08698628842830658, 0.20061138272285461, 0.3784979581832886, 0.030856691300868988, -0.1275782734155655, 0.04369170218706131, 0.06580506265163422, -0.20666344463825226, 0.5462207794189453, -0.25087791681289673, 0.14234352111816406, -0.20252138376235962, -0.478714257478714, -0.3118073642253876, 0.2933323383331299, 0.16180792450904846, -0.16319039463996887, -0.40662655234336853, 0.2901528775691986, -0.15917497873306274, -0.16355183720588684, 0.32595816254615784, 0.30743035674095154, -0.1346520036458969, 0.28675469756126404, -0.2061212807893753, 0.0860237404704094, 0.5606181621551514, -0.26124393939971924, -0.07788816094398499, -0.06638850271701813, -0.09287519752979279, 0.3708125948905945, -0.5668396949768066, -0.6327186226844788, 0.05207856744527817, 0.15964236855506897, -0.041601911187171936, 0.20351924002170563, 0.0941893458366394, -0.10601994395256042, 0.03335527703166008, -0.17286282777786255, 0.39073696732521057, 0.2894675135612488, 0.07510636001825333, 0.1845516413450241, -0.16828036308288574 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
> ```python > dset = Dataset.from_list(torch_dataset) > ``` It seems that Dataset also has no `from_list` method 😂 ```bash AttributeError: type object 'Dataset' has no attribute 'from_list' ```
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
28
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. > ```python > dset = Dataset.from_list(torch_dataset) > ``` It seems that Dataset also has no `from_list` method 😂 ```bash AttributeError: type object 'Dataset' has no attribute 'from_list' ```
[ -0.06361742317676544, -0.4848392903804779, -0.03307074308395386, 0.3100292682647705, 0.4129195213317871, 0.30785056948661804, -0.05490834638476372, 0.10785019397735596, 0.0759207010269165, 0.10735887289047241, -0.1953287422657013, 0.21701788902282715, -0.3135426640510559, 0.06821852922439575, 0.15345114469528198, -0.26307666301727295, 0.3790542781352997, -0.19722974300384521, -0.38531312346458435, -0.049052536487579346, -0.1983281373977661, 0.35930678248405457, 0.01601516455411911, -0.07343494892120361, 0.03210195526480675, 0.19589585065841675, -0.11439969390630722, 0.08737964928150177, -0.1265125572681427, -0.12994036078453064, 0.3918033838272095, -0.11674527823925018, 0.12992000579833984, 0.49793949723243713, -0.00012574208085425198, -0.12160256505012512, 0.003933839499950409, -0.17617203295230865, 0.00416225753724575, -0.3419662117958069, 0.20810186862945557, -0.15024611353874207, 0.3008396625518799, 0.02533651888370514, -0.33318030834198, -0.07647312432527542, -0.0922805443406105, -0.41642001271247864, 0.30393970012664795, 0.35536497831344604, 0.08237620443105698, 0.2049131542444229, 0.41205185651779175, -0.04815816506743431, 0.09564851969480515, 0.505781888961792, -0.15514995157718658, 0.0276207085698843, 0.24904890358448029, 0.19725775718688965, 0.4503401219844818, 0.05620875954627991, -0.23816773295402527, -0.17769122123718262, 0.6367700099945068, -0.009097854606807232, -0.49763041734695435, -0.36321696639060974, 0.037552375346422195, 0.16640004515647888, 0.431865394115448, -0.33071473240852356, -0.4295216202735901, -0.040181152522563934, 0.1311960369348526, 0.009298289194703102, -0.2617208957672119, 0.23782676458358765, -0.2078864425420761, 0.08830533921718597, -0.36524906754493713, -0.5188789963722229, -0.1116611510515213, 0.036706916987895966, -0.08627529442310333, 0.12550273537635803, -0.30292966961860657, 0.08430828154087067, 0.3435937464237213, -0.34114909172058105, -0.133292093873024, -0.0927480161190033, 0.23148517310619354, 0.11419056355953217, 0.037602148950099945, 0.008586946874856949, -0.30058130621910095, 0.42239099740982056, 0.3228625953197479, 0.19566714763641357, -0.08912795782089233, -0.07599082589149475, -0.14336621761322021, 0.051260773092508316, 0.1105521023273468, -0.06433205306529999, 0.11811505258083344, 0.09901037067174911, -0.017948493361473083, 0.0012669495772570372, 0.11914235353469849, 0.07995793968439102, -0.03376064822077751, -0.24668969213962555, -0.17553280293941498, -0.03565313294529915, 0.4074791669845581, -0.290779173374176, -0.1847839504480362, -0.22902464866638184, -0.03951650857925415, 0.18894930183887482, 0.09698572009801865, 0.2141013741493225, -0.03660308197140694, 0.10161463916301727, 0.3104243874549866, 0.1689925640821457, -0.052670471370220184, -0.2038707733154297, -0.05072643607854843, 0.08971206843852997, -0.04232633858919144, -0.057411856949329376, -0.12347353994846344, -0.6026301980018616, 0.02096305415034294, 0.11428137868642807, 0.22642453014850616, 0.17143456637859344, -0.28125646710395813, 0.21980062127113342, 0.40562182664871216, 0.06092687323689461, 0.020853403955698013, 0.08201207220554352, 0.4135925769805908, 0.0053199343383312225, -0.3704806864261627, 0.009787727147340775, -0.3430018126964569, 0.027594689279794693, -0.323339581489563, -0.025633610785007477, -0.006670380011200905, -0.17589479684829712, -0.2726489007472992, 0.1463869959115982, -0.03537372499704361, -0.04340384155511856, 0.14661608636379242, -0.17068754136562347, -0.24258145689964294, -0.32887715101242065, 0.39576154947280884, 0.3963882327079773, -0.2754831910133362, -0.24027658998966217, 0.11750076711177826, -0.3680576980113983, -0.07856810837984085, 0.21034500002861023, 0.06602399796247482, -0.2309977114200592, -0.3954419791698456, -0.31553855538368225, 0.013833917677402496, -0.4497227966785431, -0.037297897040843964, 0.14357849955558777, 0.1090848445892334, 0.1420276165008545, -0.13512113690376282, 0.1824691891670227, -0.05626559257507324, -0.170708566904068, 0.018702302128076553, 0.07736144959926605, -0.13489115238189697, -0.14539135992527008, 0.14513419568538666, -0.17043286561965942, 0.5026444792747498, -0.14358989894390106, -0.19242355227470398, 0.22165241837501526, -0.14379826188087463, -0.06385783851146698, 0.20285212993621826, -0.14516402781009674, 0.04738645255565643, 0.2536947727203369, 0.1397087574005127, 0.3814404606819153, -0.06964379549026489, -0.14848122000694275, -0.3351123034954071, -0.10760469734668732, 0.24485310912132263, -0.02692227065563202, -0.14472372829914093, -0.2821512818336487, -0.0935794785618782, 0.14231227338314056, -0.028026927262544632, -0.0080379918217659, -0.02777990698814392, -0.036852940917015076, 0.31403589248657227, -0.16803230345249176, -0.29006797075271606, 0.34465983510017395, -0.008281247690320015, 0.3561152517795563, -0.6371985077857971, 0.14002573490142822, 0.15838481485843658, -0.06368567794561386, 0.1752944141626358, 0.3994888663291931, 0.18347759544849396, -0.07855977863073349, 0.18160581588745117, 0.22155258059501648, 0.19120316207408905, 0.1571861356496811, -0.005826808512210846, 0.09796588867902756, 0.08371240645647049, -0.24799469113349915, 0.013184942305088043, 0.41657236218452454, 0.0513412207365036, 0.025176793336868286, -0.3191481828689575, 0.4530486464500427, -0.006628703325986862, 0.3179152309894562, 0.00866379588842392, 0.3759877383708954, -0.01861000433564186, 0.2428417205810547, -0.190482959151268, -0.02314872294664383, -0.08836789429187775, -0.16541767120361328, 0.3429500460624695, 0.05367797240614891, -0.6425203680992126, 0.02962324768304825, 0.13915304839611053, -0.13422784209251404, 0.10310575366020203, 0.11047174036502838, -0.28694450855255127, 0.032210662961006165, 0.18003205955028534, -0.2149985283613205, 0.25716349482536316, 0.18885251879692078, 0.2510453760623932, 0.23740218579769135, 0.2041747123003006, 0.07915181666612625, 0.1976904273033142, -0.047767192125320435, -0.08256873488426208, -0.378255158662796, -0.11136871576309204, -0.08888565003871918, -0.0330333337187767, 0.17428146302700043, -0.40941858291625977, -0.0009158626198768616, -0.5091539025306702, 0.036918044090270996, -0.4100494384765625, -0.2385619580745697, -0.445328027009964, -0.2206788957118988, -0.4179215431213379, -0.3216443955898285, -0.2429729551076889, 0.03532005473971367, 0.1928708255290985, -0.12209545820951462, 0.11799600720405579, -0.13426564633846283, -0.06679187715053558, -0.33367329835891724, -0.2524610161781311, -0.12235984206199646, -0.10226523131132126, -0.00983775407075882, 0.20103628933429718, 0.03393729776144028, 0.22357814013957977, -0.3473148047924042, 0.2859552502632141, -0.6044758558273315, -0.20885607600212097, 0.07559788227081299, -0.29709017276763916, -0.03618493676185608, 0.4680652916431427, 0.13817967474460602, 0.022314179688692093, -0.018881965428590775, 0.1222914308309555, -0.23267948627471924, -0.20958936214447021, -0.13401886820793152, -0.2186296284198761, -0.01227966696023941, 0.015947330743074417, 0.025994423776865005, -0.3489585816860199, -0.04809001088142395, 0.3097178339958191, 0.07899875938892365, -0.060142405331134796, -0.1605297178030014, 0.1662590354681015, 0.18542146682739258, -0.17270174622535706, 0.13659311830997467, -0.021239321678876877, -0.5440891981124878, 0.498388409614563, -0.24612751603126526, -0.4535549283027649, 0.26242053508758545, 0.2530243396759033, 0.24387411773204803, 0.1027306616306305, -0.06309308111667633, -0.0932646095752716, -0.0417691245675087, 0.17801997065544128, 0.02666037529706955, 0.27654919028282166, 0.17566576600074768, -0.018020909279584885, 0.10844534635543823, -0.1493329256772995, -0.0938916951417923, -0.10802950710058212, -0.3067251443862915, 0.2989335358142853, 0.1542728841304779, 0.061100028455257416, -0.11726190149784088, 0.4826590418815613, 0.3188307583332062, -0.24641065299510956, 0.11100119352340698, -0.2854534685611725, 0.5435250401496887, 0.01603313535451889, -0.49352747201919556, 0.06859339028596878, -0.11599361896514893, 0.1922806054353714, 0.0574120469391346, 0.1950584352016449, 0.4296399652957916, -0.2220805436372757, -0.11105817556381226, -0.18813470005989075, -0.2572135627269745, -0.23415066301822662, -0.15959182381629944, 0.15343225002288818, -0.2383410632610321, 0.1107679083943367, -0.1519668847322464, -0.1089356541633606, 0.16458776593208313, 0.4447650909423828, 0.4281901717185974, 0.2278195321559906, -0.37023815512657166, -0.20282253623008728, -0.4470664858818054, 0.4277414083480835, -0.008092059753835201, 0.02847721427679062, -0.10218080878257751, -0.020506929606199265, -0.04836264252662659, 0.09242749214172363, 0.6085936427116394, 0.20428051054477692, -0.3712759017944336, -0.07817374169826508, -0.2576673626899719, -0.5422539114952087, 0.2508171498775482, -0.011662770062685013, 0.31315338611602783, 0.07439214736223221, 0.15382397174835205, -0.31970325112342834, -0.38667118549346924, 0.1619645655155182, 0.3749184310436249, -0.10212613642215729, 0.1532212495803833, -0.2325761765241623, -0.3060109615325928, -0.08231060951948166, -0.21945887804031372, 0.029485223814845085, 0.13862864673137665, 0.004787263460457325, -0.026830434799194336, -0.2727102041244507, -0.12403292208909988, 0.42757153511047363, -0.2591012120246887, 0.3185015320777893, -0.11130867153406143, -0.15981963276863098, 0.20144398510456085, 0.3699978291988373, 0.4315105974674225, 0.3887594938278198, -0.16527876257896423, -0.4694073796272278, -0.1338580846786499, 0.32243508100509644, 0.5811958909034729, 0.00904799997806549, -0.1235228106379509, 0.0884985625743866, -0.08131873607635498, 0.03534118831157684, -0.3168889880180359, -0.2932462990283966, 0.3114373981952667, 0.2666407823562622, -0.2795553505420685, -0.3849295675754547, 0.39024093747138977, 0.39924418926239014, 0.24673064053058624, 0.04333056882023811, 0.7051244974136353, -0.1933756023645401, -0.110353983938694, 0.23870059847831726, 0.9810025691986084, -0.12369327247142792, 0.12409612536430359, 0.08963307738304138, -0.25931745767593384, 0.8239071369171143, 0.19842682778835297, -0.08027175068855286, -0.31496262550354004, 0.06641267240047455, -0.25177937746047974, -0.05099015682935715, 0.36178484559059143, 0.039536360651254654, -0.26562464237213135, 0.39981359243392944, -0.3274609446525574, 0.2810332477092743, -0.15503539144992828, 0.044571541249752045, -0.2055676132440567, -0.15758414566516876, -0.35358527302742004, 0.060958437621593475, -0.004110783338546753, 0.3727276623249054, 0.16167771816253662, -0.2057405412197113, -0.20652484893798828, 0.09588047862052917, -0.1881219893693924, 0.036901019513607025, -0.2325235903263092, -0.09153483062982559, 0.33766061067581177, -0.6117269992828369, 0.29288676381111145, 0.7319487929344177, 0.4730147123336792, -0.016819555312395096, -0.3319401741027832, -0.06987223029136658, -0.23771727085113525, -0.06084000691771507, -0.1892871856689453, 0.016353633254766464, 0.19183386862277985, 0.1076718345284462, -0.02280968427658081, 0.10242947190999985, 0.17826734483242035, -0.08114966005086899, -0.31581079959869385, -0.08097602427005768, 0.04167996346950531, -0.39065292477607727, -0.37887635827064514, 0.20946018397808075, 0.19289171695709229, -0.03632298856973648, -0.01760958507657051, 0.07441234588623047, -0.22122807800769806, -0.004247128963470459, 0.12941138446331024, -0.05842044949531555, 0.09081502258777618, 0.3951716423034668, -0.22195720672607422, -0.34431734681129456, 0.26367929577827454, 0.3420747220516205, -0.14159956574440002, -0.03504636511206627, 0.19032910466194153, 0.5947592258453369, -0.16374000906944275, 0.18269677460193634, -0.02987728826701641, 0.3993120789527893, -0.06033146753907204, 0.0156974196434021, -0.03662075102329254, 0.014562349766492844, -0.1678488850593567, -0.13112246990203857, -0.33071982860565186, 0.10749031603336334, 0.013089088723063469, 0.09755370020866394, 0.04878923296928406, 0.03587502986192703, 0.02331363596022129, -0.21694107353687286, -0.17338253557682037, 0.217295840382576, 0.0846787840127945, -0.0852280706167221, 0.40958163142204285, 0.05301937088370323, -0.0970657542347908, -0.11121669411659241, -0.014803808182477951, 0.09839267283678055, 0.0724865198135376, -0.06014725938439369, -0.031938303261995316, 0.17971542477607727, -0.1468016505241394, -0.01761193759739399, 0.049804095178842545, -0.021257296204566956, -0.10995882749557495, -0.3555959165096283, 0.2330983579158783, 0.4752105474472046, 0.06984390318393707, 0.2933439016342163, 0.1738264262676239, 0.1796959936618805, -0.07837249338626862, -0.06100355088710785, 0.2570679485797882, 0.4344114661216736, -0.048360683023929596, 0.1405976414680481, -0.07244664430618286, -0.08346191048622131, 0.07319149374961853, 0.33175161480903625, 0.3998328447341919, -0.22627216577529907, 0.33566293120384216, 0.15353870391845703, 0.01243087649345398, 0.043508194386959076, 0.4384789764881134, 0.2239391803741455, -0.05075262859463692, 0.47399893403053284, 0.1582064926624298, -0.08438654243946075, -0.19562765955924988, -0.13125315308570862, 0.14648377895355225, -0.07870899885892868, -0.21792423725128174, 0.1708303689956665, -0.11832782626152039, 0.3684196472167969, 0.0851929634809494, -0.2257673144340515, 0.4062175154685974, 0.011679887771606445, 0.09572181105613708, 0.3720201253890991, 0.30841901898384094, 0.010895911604166031, 0.24628835916519165, 0.36582523584365845, 0.2502180337905884, 0.1930796056985855, -0.1114351823925972, 0.5984737873077393, 0.1159580871462822, 0.19216303527355194, 0.8223150968551636, -0.193900004029274, -0.17001576721668243, 0.05524331331253052, 0.2636749744415283, 0.08708810061216354, -0.13206836581230164, 0.5802497863769531, -0.2474309653043747, -0.26931941509246826, 0.12307972460985184, 0.5176423788070679, -0.030439622700214386, -0.26745033264160156, 0.049873754382133484, -0.07711178809404373, -0.05254419893026352, -0.049926117062568665, -0.13788355886936188, -0.6160727143287659, 0.15040886402130127, -0.040875762701034546, 0.20539870858192444, -0.13761316239833832, 0.007217245176434517, 0.17058104276657104, 0.06528187543153763, -0.05992690473794937, -0.24167512357234955, 0.1680191159248352, -0.05873297154903412, 0.2000795602798462, 0.28120142221450806, 0.4455188810825348, 0.10262402892112732, -0.0977487862110138, 0.25596147775650024, 0.0019682925194501877, -0.26032552123069763, 0.18876199424266815, 0.025378534570336342, -0.11737623810768127, 0.09435208141803741, 0.17178353667259216, 0.08131495863199234, 0.15454784035682678, -0.07123705744743347, -0.14241304993629456, 0.37434399127960205, -0.30077263712882996, 0.40672916173934937, -0.5532993078231812, -0.12688922882080078, -0.4850822985172272, 0.06161485239863396, -0.4209692180156708, -0.22454898059368134, 0.2604197859764099, 0.1794820874929428, -0.08147938549518585, 0.027452416718006134, -0.002550225704908371, 0.17838142812252045, 0.19096443057060242, 0.24942632019519806, 0.39455196261405945, -0.051032111048698425, -0.37605351209640503, -0.4172707796096802, -0.15258750319480896, 0.37315717339515686, 0.014521593227982521, -0.12147273123264313, -0.009709298610687256, 0.05857384577393532, 0.27853164076805115, -0.10547199845314026, -0.047808416187763214, 0.23588243126869202, 0.10163161158561707, 0.1577160507440567, -0.37322086095809937, -0.14267785847187042, 0.00661112554371357, 0.11013197898864746, 0.08918867260217667, 0.11381924152374268, 0.02816048264503479, -0.13751360774040222, -0.3344356417655945, 0.2578774392604828, -0.06933118402957916, 0.0670306459069252, 0.002423882484436035, 0.1947776824235916, 0.3660030663013458, -0.020284995436668396, -0.13875040411949158, 0.12897507846355438, 0.11546851694583893, -0.20581437647342682, 0.564193844795227, -0.32990762591362, 0.06799503415822983, -0.2077474296092987, -0.4986783564090729, -0.27038145065307617, 0.2600773870944977, 0.14841926097869873, -0.18127283453941345, -0.3697523772716522, 0.26458075642585754, -0.16188576817512512, -0.20534150302410126, 0.3133077919483185, 0.393708199262619, -0.14523719251155853, 0.22838430106639862, -0.14099907875061035, 0.13775987923145294, 0.5669107437133789, -0.2725493907928467, -0.04116619750857353, -0.03373336046934128, -0.09756897389888763, 0.17826363444328308, -0.4750407040119171, -0.6458293795585632, -0.029795080423355103, 0.17093127965927124, -0.02715267241001129, 0.1477394998073578, 0.10871167480945587, -0.13581082224845886, 0.010023314505815506, -0.16129665076732635, 0.3210946321487427, 0.35314229130744934, 0.11266469955444336, 0.1023210734128952, -0.1681928038597107 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
> I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: > > ```python > from datasets import Dataset > data = [[1, 2],[3, 4]] > ds = Dataset.from_dict({"data": data}) > ds = ds.with_format("torch") > ds[0] > ds[:2] > ``` > > So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. My dummy code is like: ```python import os import json from torch.utils import data import datasets def gen(torch_dataset): for idx in len(torch_dataset): yield torch_dataset[idx] # this has to be a dictionary class MyDataset(data.Dataset): def __init__(self, path): self.dict = [] for line in open(path, 'r', encoding='utf-8'): j_dict = json.loads(line) self.dict.append(j_dict['context']) def __getitem__(self, idx): return self.dict[idx] def __len__(self): return len(self.dict) root_path = os.path.dirname(os.path.abspath(__file__)) path = os.path.join(root_path, 'dataset', 'train.json') torch_dataset = MyDataset(path) dit = [] for line in open(path, 'r', encoding='utf-8'): j_dict = json.loads(line) dit.append(j_dict['context']) dset1 = datasets.Dataset.from_list(dit) print(dset1) dset2 = datasets.Dataset.from_generator(gen) print(dset2) ```
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
187
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. > I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: > > ```python > from datasets import Dataset > data = [[1, 2],[3, 4]] > ds = Dataset.from_dict({"data": data}) > ds = ds.with_format("torch") > ds[0] > ds[:2] > ``` > > So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. My dummy code is like: ```python import os import json from torch.utils import data import datasets def gen(torch_dataset): for idx in len(torch_dataset): yield torch_dataset[idx] # this has to be a dictionary class MyDataset(data.Dataset): def __init__(self, path): self.dict = [] for line in open(path, 'r', encoding='utf-8'): j_dict = json.loads(line) self.dict.append(j_dict['context']) def __getitem__(self, idx): return self.dict[idx] def __len__(self): return len(self.dict) root_path = os.path.dirname(os.path.abspath(__file__)) path = os.path.join(root_path, 'dataset', 'train.json') torch_dataset = MyDataset(path) dit = [] for line in open(path, 'r', encoding='utf-8'): j_dict = json.loads(line) dit.append(j_dict['context']) dset1 = datasets.Dataset.from_list(dit) print(dset1) dset2 = datasets.Dataset.from_generator(gen) print(dset2) ```
[ -0.0057874806225299835, -0.5595138669013977, -0.04572176933288574, 0.2835305333137512, 0.46112966537475586, 0.2584274709224701, 0.005282778292894363, 0.09215536713600159, -0.014008020982146263, 0.12703493237495422, -0.1788550168275833, 0.20138202607631683, -0.32762661576271057, 0.040070176124572754, 0.003336222842335701, -0.2270803153514862, 0.3373529016971588, -0.19086429476737976, -0.3019205927848816, -0.020176708698272705, -0.16953055560588837, 0.34780898690223694, 0.05423830449581146, -0.15074928104877472, -0.15675245225429535, 0.19924268126487732, -0.1625489890575409, 0.10917200148105621, -0.14993679523468018, -0.15582002699375153, 0.45209261775016785, -0.0033852793276309967, 0.21977035701274872, 0.5401358008384705, -0.0001178411184810102, -0.06133604422211647, 0.019600220024585724, -0.17360247671604156, -0.08216467499732971, -0.28325510025024414, 0.2915959060192108, -0.09986210614442825, 0.2618602514266968, -0.06860794126987457, -0.4587021768093109, -0.04935965687036514, -0.16251665353775024, -0.5175310373306274, 0.37036603689193726, 0.3477630317211151, 0.1790652722120285, 0.06479714065790176, 0.3657885193824768, -0.07772303372621536, -0.04079246520996094, 0.5760002732276917, -0.13997243344783783, 0.14213380217552185, 0.2289028912782669, 0.19936230778694153, 0.34487053751945496, 0.14201046526432037, -0.21901088953018188, -0.1619344800710678, 0.5542979836463928, -0.07598156481981277, -0.4512624144554138, -0.3632252514362335, 0.1352638304233551, 0.10321491211652756, 0.43696820735931396, -0.3447445333003998, -0.4465120732784271, -0.028287995606660843, 0.07600133866071701, -0.033370792865753174, -0.18606659770011902, 0.2742731273174286, -0.15321053564548492, 0.07341748476028442, -0.32097822427749634, -0.41019687056541443, -0.10352709889411926, 0.04645346850156784, -0.03838379681110382, 0.1983942687511444, -0.28420576453208923, 0.06982087343931198, 0.2811262309551239, -0.4145435690879822, -0.1528564989566803, 0.05028795078396797, 0.15801915526390076, 0.14823032915592194, 0.11140903830528259, 0.027285106480121613, -0.32308560609817505, 0.3539206385612488, 0.35593581199645996, 0.09695793688297272, -0.12063594162464142, -0.024523135274648666, -0.13925275206565857, -0.025259539484977722, 0.02407049387693405, -0.04736943542957306, 0.20184022188186646, 0.1546063870191574, -0.05551401525735855, 0.035385921597480774, 0.1345440298318863, 0.0423722006380558, 0.040001753717660904, -0.3252406418323517, -0.3342530429363251, 0.02122519724071026, 0.37838584184646606, -0.2610989511013031, -0.06778769940137863, -0.3126406669616699, -0.10410931706428528, 0.20238149166107178, 0.03375355154275894, 0.24931183457374573, -0.018438203260302544, 0.0739271491765976, 0.2821093201637268, 0.23201628029346466, -0.08132019639015198, -0.18161240220069885, -0.06538539379835129, 0.19801512360572815, -0.06143779307603836, 0.03872101381421089, 0.01575329899787903, -0.5580026507377625, 0.08582380414009094, 0.09169373661279678, 0.13573703169822693, 0.15896280109882355, -0.3061058819293976, 0.2664932608604431, 0.41366487741470337, 0.048465799540281296, -0.024406656622886658, 0.12995000183582306, 0.3476394712924957, -0.0872727781534195, -0.3337951898574829, -0.09203017503023148, -0.2439020276069641, 0.008925747126340866, -0.4203881621360779, 0.038731612265110016, -0.07645644247531891, -0.0857778936624527, -0.20890483260154724, 0.12406975030899048, -0.03103286772966385, -0.022699791938066483, 0.22568175196647644, -0.12327128648757935, -0.2146572321653366, -0.308653324842453, 0.4803679287433624, 0.4016752243041992, -0.2548953592777252, -0.2442067563533783, 0.0999438464641571, -0.2546314001083374, -0.07661633938550949, 0.08412478864192963, 0.12320899963378906, -0.1792849898338318, -0.4267372786998749, -0.30111902952194214, -0.0276695117354393, -0.5762145519256592, -0.06386449933052063, 0.1400739550590515, 0.14341430366039276, 0.17575080692768097, -0.09999250620603561, 0.11536076664924622, -0.035962436348199844, -0.022338295355439186, 0.06961227208375931, 0.08936074376106262, -0.05608893930912018, -0.062372542917728424, 0.06381480395793915, -0.11600492149591446, 0.5138468742370605, 0.007660705596208572, -0.23776377737522125, 0.08972223848104477, -0.12892475724220276, -0.06415538489818573, 0.28137385845184326, -0.19752636551856995, 0.12684139609336853, 0.23482537269592285, 0.10016333311796188, 0.2940402030944824, -0.037642545998096466, -0.028432747349143028, -0.4181218445301056, 0.05633177608251572, 0.24431121349334717, 0.0563214011490345, -0.16344095766544342, -0.3158331513404846, -0.05444665625691414, -0.014713680371642113, -0.1346791535615921, -0.24018970131874084, 0.06606260687112808, -0.09141917526721954, 0.4707174301147461, -0.12767571210861206, -0.1473005712032318, 0.2797507643699646, -0.003865085542201996, 0.31663867831230164, -0.7507453560829163, 0.11766907572746277, 0.12887349724769592, -0.03961970657110214, 0.1661168485879898, 0.4374985992908478, 0.17989706993103027, -0.0979861468076706, 0.057916175574064255, 0.21021243929862976, 0.19081400334835052, 0.08434341847896576, -0.11929797381162643, 0.03625504672527313, 0.10780470073223114, -0.2493302971124649, 0.030339743942022324, 0.4040745496749878, -0.0063162315636873245, -0.031173914670944214, -0.35333019495010376, 0.5129061937332153, 0.08335526287555695, 0.30815497040748596, -0.05781172960996628, 0.44155463576316833, -0.0006228070706129074, 0.19584965705871582, -0.3263534903526306, -0.030185669660568237, -0.1207958310842514, -0.17219503223896027, 0.31711268424987793, -0.0022119134664535522, -0.4727522134780884, 0.028270691633224487, 0.052846524864435196, -0.17020577192306519, 0.055413227528333664, 0.08784925937652588, -0.25833773612976074, 0.1497161090373993, 0.24114541709423065, -0.22751380503177643, 0.20477353036403656, 0.2233392894268036, 0.24077819287776947, 0.17974400520324707, 0.19954797625541687, 0.032680295407772064, 0.12076997011899948, -0.05258721113204956, -0.1098354235291481, -0.39456042647361755, -0.04430355504155159, -0.08792609721422195, -0.029710248112678528, 0.0710258036851883, -0.46840474009513855, -0.022595694288611412, -0.47631192207336426, 0.016188448294997215, -0.4321676194667816, -0.2195858359336853, -0.3503659963607788, -0.23946234583854675, -0.33495059609413147, -0.2709713280200958, -0.2065078616142273, -0.058215800672769547, 0.14661850035190582, -0.02375047467648983, 0.18513672053813934, -0.13642145693302155, -0.043875802308321, -0.36785832047462463, -0.19925062358379364, -0.14365941286087036, -0.14437901973724365, 0.0381997711956501, 0.20249968767166138, 0.02848322130739689, 0.27681002020835876, -0.2943279445171356, 0.23218387365341187, -0.6122046709060669, -0.1811600625514984, 0.06825072318315506, -0.3804532289505005, -0.14480048418045044, 0.4072626829147339, 0.07782404869794846, 0.04737944155931473, 0.008005696348845959, 0.1502128541469574, -0.1224721372127533, -0.23120877146720886, -0.18593017756938934, -0.2455967217683792, 0.03479277715086937, -0.10506224632263184, -0.0366826131939888, -0.2958979606628418, -0.13535535335540771, 0.4137251377105713, 0.08106006681919098, -0.06427723914384842, -0.12078476697206497, 0.2825120687484741, 0.2382725179195404, -0.14310555160045624, 0.1934487521648407, -0.09579475969076157, -0.5469149947166443, 0.5165059566497803, -0.33495524525642395, -0.5258204936981201, 0.302034467458725, 0.10673145949840546, 0.39839741587638855, 0.039468176662921906, -0.15721014142036438, -0.036861103028059006, -0.03185310214757919, 0.19312292337417603, 0.02054779790341854, 0.24980570375919342, 0.15863724052906036, 0.016959069296717644, 0.07637656480073929, -0.06379859149456024, -0.04325809329748154, -0.06812337785959244, -0.3157992660999298, 0.32911416888237, 0.06888267397880554, 0.14264792203903198, -0.10279349982738495, 0.41993391513824463, 0.3278467357158661, -0.3429785966873169, 0.11113192141056061, -0.3138468861579895, 0.4863535165786743, 0.07122363895177841, -0.4292182922363281, 0.1301329880952835, -0.16167011857032776, 0.22244830429553986, 0.07002909481525421, 0.203672856092453, 0.426780104637146, -0.2370486706495285, -0.09970007836818695, -0.22856208682060242, -0.3135901391506195, -0.19148941338062286, -0.31973549723625183, 0.005375221371650696, -0.3502465486526489, 0.19048333168029785, -0.06606777012348175, -0.05415794253349304, 0.21622493863105774, 0.3578603267669678, 0.34696653485298157, 0.2510027289390564, -0.2652701735496521, -0.1555679738521576, -0.4591628313064575, 0.43766629695892334, 0.0011491163168102503, -0.05174490064382553, -0.046529099345207214, -0.0013942345976829529, -0.06733371317386627, 0.010685514658689499, 0.6030727028846741, 0.1700444519519806, -0.29471486806869507, 0.03584703430533409, -0.2867661416530609, -0.7024648785591125, 0.13308210670948029, 0.043618861585855484, 0.3740992844104767, 0.09278009831905365, 0.22133901715278625, -0.30587053298950195, -0.40342772006988525, 0.11630906164646149, 0.2936569154262543, -0.17021077871322632, 0.0443737618625164, -0.23011143505573273, -0.39325860142707825, -0.15575766563415527, -0.20906245708465576, 0.10322362929582596, 0.2135218232870102, -0.13023501634597778, -0.07685454189777374, -0.2379000335931778, -0.13263672590255737, 0.3859615921974182, -0.276556134223938, 0.3319992125034332, -0.048213060945272446, -0.09956762194633484, 0.29991865158081055, 0.38952434062957764, 0.30229687690734863, 0.45928552746772766, -0.07294692099094391, -0.32639172673225403, -0.035307034850120544, 0.33431529998779297, 0.4829823672771454, 0.06066928058862686, 0.022476039826869965, 0.07254190742969513, -0.08651207387447357, 0.040304433554410934, -0.35206344723701477, -0.22429654002189636, 0.23530088365077972, 0.19836415350437164, -0.3429226279258728, -0.39073851704597473, 0.40457582473754883, 0.32257139682769775, 0.3131260275840759, 0.07718785107135773, 0.6996733546257019, -0.21167373657226562, 0.042354516685009, 0.31846073269844055, 0.8908796310424805, -0.08437682688236237, 0.15169508755207062, 0.19421949982643127, -0.20389991998672485, 0.7900010347366333, 0.041646651923656464, -0.10950596630573273, -0.25116634368896484, 0.16031141579151154, -0.16367439925670624, 0.007783655077219009, 0.23712560534477234, 0.024636978283524513, -0.29455339908599854, 0.35430267453193665, -0.2669757008552551, 0.22549162805080414, -0.14731867611408234, 0.1330745965242386, -0.22016732394695282, -0.26540908217430115, -0.25755178928375244, 0.1439020335674286, -0.02001047134399414, 0.3177853226661682, 0.1474795937538147, -0.24594534933567047, -0.25651663541793823, -0.001686740666627884, -0.15503303706645966, 0.044122256338596344, -0.21515502035617828, 0.030901938676834106, 0.291748970746994, -0.5136021971702576, 0.3682503402233124, 0.7648841738700867, 0.47008806467056274, -0.011129487305879593, -0.41981667280197144, -0.0753031075000763, -0.15057340264320374, -0.15151169896125793, -0.27683696150779724, 0.05167688429355621, 0.16782259941101074, 0.12094525247812271, 0.02622561901807785, 0.14787408709526062, 0.13276159763336182, -0.02004985325038433, -0.2808677554130554, -0.07016175985336304, -0.12573614716529846, -0.3896685838699341, -0.3376310169696808, 0.17083227634429932, 0.12716852128505707, 0.017978109419345856, 0.05250952020287514, 0.09258952736854553, -0.21316201984882355, -0.02944948524236679, 0.1982990801334381, -0.12256956100463867, 0.06606964766979218, 0.5148534178733826, -0.16982120275497437, -0.37538668513298035, 0.30334317684173584, 0.3820286989212036, -0.12387020140886307, -0.047024767845869064, 0.15826717019081116, 0.6178838014602661, -0.13762149214744568, 0.06569931656122208, 0.06274618953466415, 0.4003196954727173, -0.07498478144407272, -0.0037230737507343292, -0.03226219862699509, -0.03204457461833954, -0.0542510487139225, -0.03207100182771683, -0.4819287657737732, 0.11042332649230957, 0.011171583086252213, 0.1544819474220276, 0.015727445483207703, 0.11765070259571075, 0.09403052181005478, -0.1125914603471756, -0.265156090259552, 0.21462881565093994, 0.07517386972904205, -0.10123242437839508, 0.3732280731201172, 0.038412392139434814, -0.12205199152231216, -0.0926913470029831, 0.06896033138036728, 0.13913258910179138, -0.014102909713983536, -0.14245069026947021, -0.0266789011657238, 0.1322588324546814, -0.008389480412006378, 0.017333002761006355, 0.09818386286497116, -0.008962728083133698, -0.10609422624111176, -0.35516270995140076, 0.1806381791830063, 0.5152334570884705, 0.037296198308467865, 0.32266029715538025, 0.20680342614650726, 0.2189594805240631, -0.036882635205984116, -0.12878473103046417, 0.3089769184589386, 0.4232964515686035, -0.04488508775830269, 0.06804082542657852, -0.138933926820755, -0.08186317980289459, 0.13345660269260406, 0.2617143392562866, 0.376819372177124, -0.2091318964958191, 0.19391098618507385, 0.13520368933677673, 0.06934119760990143, 0.007397062610834837, 0.44237595796585083, 0.10587647557258606, -0.158225879073143, 0.4748169779777527, 0.199752539396286, 0.00827176682651043, -0.14313405752182007, -0.0137281259521842, 0.06431028246879578, -0.03831437975168228, -0.10774977505207062, 0.15959703922271729, -0.17742156982421875, 0.2619803547859192, 0.027272451668977737, -0.1972692310810089, 0.27767306566238403, 0.0068254247307777405, 0.06212196871638298, 0.23774032294750214, 0.18261870741844177, -0.10196466743946075, 0.269989937543869, 0.2013099193572998, 0.32515767216682434, 0.1622377336025238, -0.16554254293441772, 0.6360047459602356, 0.011706287041306496, 0.1958467960357666, 0.6860846281051636, -0.15198737382888794, -0.20320609211921692, -0.015503913164138794, 0.24551784992218018, 0.0235421285033226, -0.18429410457611084, 0.5770495533943176, -0.16809314489364624, -0.3321812152862549, 0.10571377724409103, 0.39976778626441956, -0.010322898626327515, -0.19612281024456024, 0.021300312131643295, -0.037751492112874985, -0.09705076366662979, -0.06784765422344208, -0.20378904044628143, -0.606802225112915, 0.19747710227966309, -0.03866694122552872, 0.10515975952148438, -0.08373097330331802, 0.09349209070205688, 0.12334253638982773, 0.05601804703474045, -0.04654290899634361, -0.1741805076599121, 0.29411080479621887, -0.08515052497386932, 0.11913175880908966, 0.23933614790439606, 0.48494774103164673, 0.18371029198169708, -0.20757991075515747, 0.29597800970077515, 0.006974469870328903, -0.20476895570755005, 0.1807863712310791, 0.09282097965478897, -0.0895061194896698, -0.0748133659362793, 0.2533387839794159, 0.16244444251060486, 0.028471924364566803, -0.11351741850376129, -0.07715237140655518, 0.37939485907554626, -0.23931634426116943, 0.3030993342399597, -0.5232434272766113, -0.08690601587295532, -0.3881315290927887, 0.018059857189655304, -0.5785419344902039, -0.2803457975387573, 0.09541340172290802, 0.21782280504703522, -0.0355796255171299, -0.06819159537553787, 0.04179750010371208, 0.13180384039878845, 0.2913764417171478, 0.230754092335701, 0.4434690773487091, -0.1431083381175995, -0.40629899501800537, -0.4061700105667114, -0.16589370369911194, 0.23752447962760925, 0.11226218938827515, -0.20545917749404907, -0.012727341614663601, 0.1079237312078476, 0.22718258202075958, -0.14458028972148895, -0.017175044864416122, 0.17587298154830933, 0.10264284908771515, 0.07029145956039429, -0.3208807110786438, -0.08869379758834839, 0.029923930764198303, 0.15985754132270813, 0.15259724855422974, 0.12949557602405548, -0.10980367660522461, -0.060005076229572296, -0.2569378614425659, 0.3038240969181061, -0.0048499200493097305, 0.06960705667734146, 0.021706294268369675, 0.17244099080562592, 0.32299935817718506, -0.06597240269184113, -0.15901829302310944, -0.04621204361319542, 0.10466808825731277, -0.08072890341281891, 0.5332878232002258, -0.26611295342445374, 0.16662362217903137, -0.19287404417991638, -0.4828387200832367, -0.26878607273101807, 0.3002716302871704, 0.12382608652114868, -0.21541041135787964, -0.3267679810523987, 0.3255293667316437, -0.06145419180393219, -0.16880212724208832, 0.16687963902950287, 0.36844441294670105, -0.23705196380615234, 0.33167579770088196, -0.19904986023902893, -0.01215033233165741, 0.6428762674331665, -0.2746713161468506, 0.019291464239358902, 0.031111765652894974, -0.06759418547153473, 0.2727092504501343, -0.37454304099082947, -0.5698925256729126, 0.059586621820926666, 0.13713550567626953, -0.00614030659198761, 0.08495129644870758, 0.13103929162025452, -0.0795048177242279, -0.0501994863152504, -0.1921018362045288, 0.26845312118530273, 0.26975134015083313, 0.1632944792509079, 0.08078725636005402, -0.2297685146331787 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
We're releasing `from_generator` and `from_list` today :) In the meantime you can play with them by installing `datasets` from source
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
20
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. We're releasing `from_generator` and `from_list` today :) In the meantime you can play with them by installing `datasets` from source
[ -0.10639508068561554, -0.4694138765335083, -0.03152967616915703, 0.3338087797164917, 0.42934274673461914, 0.24172073602676392, -0.07922270894050598, 0.10991768538951874, -0.06694844365119934, 0.1251249760389328, -0.18707223236560822, 0.15286710858345032, -0.35572198033332825, 0.08285010606050491, 0.15837447345256805, -0.295856773853302, 0.40424102544784546, -0.1590786576271057, -0.40857622027397156, 0.012103617191314697, -0.19406351447105408, 0.36587390303611755, 0.05990397930145264, -0.021462149918079376, -0.0065051596611738205, 0.19482851028442383, -0.10907363891601562, 0.09653361886739731, -0.20719000697135925, -0.13529497385025024, 0.35909321904182434, 0.003331352025270462, 0.17641037702560425, 0.4948674738407135, -0.0001260370045201853, -0.15371233224868774, -0.017530344426631927, -0.17082561552524567, 0.021672509610652924, -0.2997501492500305, 0.28814923763275146, -0.08838213235139847, 0.17448213696479797, 0.06510145217180252, -0.3374893367290497, -0.10261551290750504, -0.07800360023975372, -0.4487648010253906, 0.29810839891433716, 0.3156302869319916, 0.07534082233905792, 0.2338567078113556, 0.44861626625061035, -0.060967955738306046, 0.09755433350801468, 0.5105277895927429, -0.16656236350536346, -0.02589196339249611, 0.30358824133872986, 0.12224717438220978, 0.3714292347431183, 0.07419361174106598, -0.2176942229270935, -0.21262094378471375, 0.703997790813446, 0.015424937941133976, -0.5086849331855774, -0.420615017414093, 0.07112564146518707, 0.2251100242137909, 0.4103229343891144, -0.3612354099750519, -0.39431166648864746, -0.09441078454256058, 0.06048663705587387, 0.018763991072773933, -0.22489896416664124, 0.325554221868515, -0.24175429344177246, 0.10121473670005798, -0.35259291529655457, -0.5517910122871399, -0.11885993182659149, -0.02287190407514572, -0.08526910841464996, 0.060021840035915375, -0.3057267367839813, 0.04853253811597824, 0.3733229339122772, -0.29646652936935425, 0.020279109477996826, -0.08438260853290558, 0.15886689722537994, 0.16231663525104523, 0.034901201725006104, -0.008100535720586777, -0.2441112995147705, 0.46493229269981384, 0.35613715648651123, 0.14457300305366516, -0.12502962350845337, -0.11815742403268814, -0.20073169469833374, 0.003221869468688965, 0.10258547961711884, -0.08206470310688019, 0.15954452753067017, 0.12868711352348328, 0.000044930726289749146, -0.017259126529097557, 0.12818999588489532, 0.06503774970769882, -0.031486786901950836, -0.3369230329990387, -0.1789998859167099, -0.07282368093729019, 0.31331896781921387, -0.2731156051158905, -0.11173295974731445, -0.24222871661186218, 0.02468610554933548, 0.12066568434238434, 0.02959991991519928, 0.16992342472076416, -0.038602497428655624, 0.13219083845615387, 0.27205997705459595, 0.2218126654624939, -0.010520395822823048, -0.2445327192544937, -0.03879491239786148, 0.02457476407289505, -0.06346458941698074, 0.012209251523017883, -0.1367320716381073, -0.6680163741111755, 0.005692223086953163, 0.13280373811721802, 0.11470459401607513, 0.19698145985603333, -0.22122584283351898, 0.23762506246566772, 0.42587772011756897, 0.07632109522819519, 0.0408208854496479, 0.0837138369679451, 0.34807059168815613, 0.010020263493061066, -0.36650222539901733, 0.02338811755180359, -0.25225675106048584, 0.011223893612623215, -0.3239140212535858, -0.0489996075630188, -0.07108224928379059, -0.12094415724277496, -0.2741486728191376, 0.17164753377437592, 0.011032648384571075, -0.015025878325104713, 0.1543053239583969, -0.15088771283626556, -0.234454944729805, -0.3066626787185669, 0.37335148453712463, 0.38375091552734375, -0.3046371638774872, -0.20332494378089905, 0.15687456727027893, -0.42691299319267273, -0.10087434202432632, 0.21264031529426575, 0.05557529255747795, -0.19671812653541565, -0.3893985450267792, -0.3649085760116577, 0.05461970716714859, -0.3465445637702942, -0.0041945260018110275, 0.13372266292572021, 0.10687240958213806, 0.08998697251081467, -0.07479410618543625, 0.1541076898574829, -0.0705164223909378, -0.194015771150589, 0.07928385585546494, 0.055208541452884674, -0.1803133636713028, -0.15320487320423126, 0.11508825421333313, -0.18457770347595215, 0.5416635870933533, -0.13463693857192993, -0.12453331053256989, 0.23805618286132812, -0.16766569018363953, -0.13706529140472412, 0.204670250415802, -0.15052735805511475, 0.10697484016418457, 0.23929975926876068, 0.08901253342628479, 0.4011322855949402, -0.04568992182612419, -0.062449902296066284, -0.3144790530204773, -0.0632418692111969, 0.10692965984344482, -0.01168273389339447, -0.14252950251102448, -0.2767832279205322, -0.03607573360204697, 0.14182259142398834, -0.041444916278123856, -0.06460069119930267, -0.05223283916711807, -0.09181226789951324, 0.3720327317714691, -0.20211267471313477, -0.31560733914375305, 0.31711268424987793, -0.027534281834959984, 0.33295273780822754, -0.7277439832687378, 0.16427940130233765, 0.18147581815719604, -0.051693789660930634, 0.14706562459468842, 0.35319653153419495, 0.10735371708869934, -0.05637427791953087, 0.14204853773117065, 0.15474766492843628, 0.13135650753974915, 0.1878090500831604, 0.007209833711385727, 0.10400953888893127, 0.08303411304950714, -0.2123570740222931, 0.050293877720832825, 0.3318333327770233, 0.02541244775056839, 0.013465367257595062, -0.3064259886741638, 0.45484352111816406, -0.08508975803852081, 0.2972349524497986, -0.0723060742020607, 0.35402488708496094, 0.007158657535910606, 0.24396172165870667, -0.19636641442775726, 0.01873374730348587, -0.0605158694088459, -0.09283974766731262, 0.34359973669052124, 0.10335191339254379, -0.6604602932929993, 0.045828625559806824, 0.1543731391429901, -0.18725110590457916, -0.018235579133033752, 0.12706215679645538, -0.33938178420066833, 0.003638599067926407, 0.1926824301481247, -0.22199399769306183, 0.2310015857219696, 0.14676795899868011, 0.2840973138809204, 0.23373426496982574, 0.21539920568466187, 0.0472794845700264, 0.17168375849723816, -0.03891168534755707, -0.10369453579187393, -0.34072092175483704, -0.15598900616168976, -0.03229382261633873, -0.10813047736883163, 0.286451518535614, -0.4148460030555725, 0.03187018632888794, -0.4882284700870514, 0.05448471009731293, -0.3359980285167694, -0.2113971710205078, -0.49081212282180786, -0.15479260683059692, -0.4340366721153259, -0.29916447401046753, -0.21126924455165863, 0.06141023337841034, 0.17506101727485657, -0.16742204129695892, 0.18830004334449768, -0.10197798907756805, -0.05489596724510193, -0.23110438883304596, -0.22525234520435333, -0.16351266205310822, -0.05222015082836151, 0.0052265264093875885, 0.2365303635597229, -0.007839586585760117, 0.24277405440807343, -0.37441450357437134, 0.29620105028152466, -0.6221143007278442, -0.20860770344734192, 0.08479094505310059, -0.2679528594017029, -0.02645917795598507, 0.43207234144210815, 0.12077939510345459, 0.06753521412611008, -0.010674037039279938, 0.10110647231340408, -0.24308009445667267, -0.20908188819885254, -0.15531480312347412, -0.2652457058429718, 0.03657979145646095, -0.010654514655470848, 0.08340048044919968, -0.33739593625068665, -0.024653466418385506, 0.3647575378417969, 0.04870384559035301, -0.03473871201276779, -0.17788854241371155, 0.17301824688911438, 0.09749510884284973, -0.2199667990207672, 0.06924330443143845, -0.053811121731996536, -0.642451286315918, 0.5564695000648499, -0.28032001852989197, -0.4735141694545746, 0.24069344997406006, 0.17954055964946747, 0.25687095522880554, 0.09102875739336014, -0.039512068033218384, -0.007473723962903023, -0.044929929077625275, 0.20000280439853668, 0.07815928012132645, 0.28200069069862366, 0.1436086893081665, 0.027581045404076576, 0.12251047790050507, -0.09720727056264877, 0.009505387395620346, -0.13958337903022766, -0.2726525068283081, 0.34557828307151794, 0.19255471229553223, 0.06405363976955414, -0.146885946393013, 0.4623289704322815, 0.3065723180770874, -0.254201203584671, 0.11711515486240387, -0.24742379784584045, 0.5630457997322083, 0.007261291146278381, -0.45484447479248047, 0.05222668498754501, -0.13909617066383362, 0.22176282107830048, 0.04988702014088631, 0.23742514848709106, 0.4901266098022461, -0.22808068990707397, -0.0689331516623497, -0.1791292428970337, -0.25877127051353455, -0.1861010640859604, -0.18148335814476013, 0.1585204303264618, -0.21761275827884674, 0.12308081239461899, -0.1540074497461319, -0.09518933296203613, 0.18229511380195618, 0.3566410541534424, 0.5071120262145996, 0.20099477469921112, -0.32136788964271545, -0.12528680264949799, -0.5551613569259644, 0.3285316824913025, -0.006706092972308397, -0.12707272171974182, -0.057306211441755295, 0.004917949438095093, -0.001476965844631195, 0.05936650186777115, 0.6747196316719055, 0.2187763750553131, -0.36477017402648926, -0.054166145622730255, -0.2518956661224365, -0.5036450028419495, 0.27279001474380493, 0.04141045734286308, 0.19286686182022095, 0.07447247952222824, 0.1577579379081726, -0.3065721094608307, -0.405009925365448, 0.12236697971820831, 0.4157138466835022, -0.15484946966171265, 0.11871836334466934, -0.20626094937324524, -0.22843122482299805, -0.0994904413819313, -0.25595414638519287, 0.01496960036456585, 0.1869329959154129, -0.07746027410030365, -0.05569402873516083, -0.19414480030536652, -0.07491587102413177, 0.36607682704925537, -0.25761422514915466, 0.3251611888408661, -0.12185263633728027, -0.1298292875289917, 0.3194371461868286, 0.30878946185112, 0.34815481305122375, 0.4164615273475647, -0.19682541489601135, -0.3985237777233124, -0.09150565415620804, 0.29080072045326233, 0.4966217279434204, 0.015143230557441711, -0.11559770256280899, 0.09574495255947113, -0.07368893921375275, 0.07264230400323868, -0.3507024049758911, -0.24976100027561188, 0.2837699353694916, 0.24589064717292786, -0.2422826886177063, -0.4222390949726105, 0.40399906039237976, 0.4244832396507263, 0.24007506668567657, 0.08495119959115982, 0.7122729420661926, -0.1392388790845871, -0.1530872881412506, 0.2469700574874878, 0.9695004820823669, -0.16478678584098816, 0.18923036754131317, 0.08168841898441315, -0.2804916203022003, 0.8169203996658325, 0.09980832040309906, -0.14392316341400146, -0.3349108099937439, 0.03804384171962738, -0.2447727471590042, -0.04792701080441475, 0.3188077211380005, 0.0869465246796608, -0.18771280348300934, 0.35191023349761963, -0.21806368231773376, 0.3012637495994568, -0.1355246901512146, 0.03704718500375748, -0.2139601707458496, -0.17643184959888458, -0.34694525599479675, 0.03411144018173218, 0.04909885674715042, 0.40582478046417236, 0.12803906202316284, -0.23839329183101654, -0.13161496818065643, 0.11934657394886017, -0.18410742282867432, 0.027043841779232025, -0.1853630542755127, -0.09964275360107422, 0.43947330117225647, -0.5851088166236877, 0.2975724935531616, 0.7513419985771179, 0.5599529147148132, -0.04825646057724953, -0.29340124130249023, -0.05241149291396141, -0.16877144575119019, -0.05870998278260231, -0.18937987089157104, 0.03254270181059837, 0.14732131361961365, 0.10302063077688217, 0.013719268143177032, 0.15920265018939972, 0.11596404016017914, -0.09224329888820648, -0.3806716203689575, -0.12908202409744263, -0.008066974580287933, -0.34199607372283936, -0.22168050706386566, 0.2044522613286972, 0.26017439365386963, -0.03314925730228424, -0.016590889543294907, 0.17499229311943054, -0.2036217451095581, 0.0014163628220558167, 0.04158952832221985, -0.031126804649829865, 0.09877286851406097, 0.3970988988876343, -0.1937827467918396, -0.3927394449710846, 0.2082613706588745, 0.38521435856819153, -0.12494025379419327, -0.01722578890621662, 0.22359099984169006, 0.6572090983390808, -0.2155807912349701, 0.19286084175109863, 0.011939173564314842, 0.39220768213272095, -0.012847678735852242, 0.084708072245121, -0.03047224134206772, -0.021182209253311157, -0.11184388399124146, -0.06811880320310593, -0.3938283622264862, 0.0500018373131752, 0.030854741111397743, 0.09694784879684448, 0.0994354709982872, -0.05025221034884453, 0.03112390823662281, -0.10465924441814423, -0.16854053735733032, 0.19875624775886536, 0.17891746759414673, -0.06339912861585617, 0.4444443881511688, 0.0257773008197546, -0.18523694574832916, -0.16815921664237976, -0.04264789819717407, 0.09285259246826172, 0.0360812246799469, -0.06553508341312408, -0.08800646662712097, 0.1950429081916809, -0.12102776020765305, -0.06370256841182709, 0.09003210812807083, 0.010543391108512878, -0.12080122530460358, -0.34900668263435364, 0.30238521099090576, 0.4509206712245941, 0.10694032162427902, 0.25424498319625854, 0.22725160419940948, 0.17979460954666138, -0.12388325482606888, -0.046969443559646606, 0.2885470390319824, 0.4254884719848633, -0.048693280667066574, 0.16461801528930664, -0.09607120603322983, -0.10386437177658081, 0.09743603318929672, 0.3450992703437805, 0.39847880601882935, -0.28812357783317566, 0.36207595467567444, 0.14003631472587585, 0.005392830818891525, 0.05295853316783905, 0.4290982186794281, 0.23318561911582947, -0.03239447623491287, 0.4693295955657959, 0.18751174211502075, -0.09854710847139359, -0.19286991655826569, -0.1483139991760254, 0.021017108112573624, -0.04483197256922722, -0.23542523384094238, 0.07739560306072235, -0.0834372267127037, 0.3428806662559509, 0.13745346665382385, -0.22296729683876038, 0.3221895396709442, 0.006234088912606239, 0.07400776445865631, 0.41779443621635437, 0.3487779200077057, 0.027213584631681442, 0.29213395714759827, 0.3386417031288147, 0.24893218278884888, 0.18452134728431702, -0.07052253931760788, 0.5649240612983704, 0.03090270794928074, 0.1855577677488327, 0.8447133302688599, -0.2304755449295044, -0.22463075816631317, 0.05863106995820999, 0.23814347386360168, 0.09237933158874512, -0.11065798997879028, 0.6386151909828186, -0.18885883688926697, -0.27653825283050537, 0.10765408724546432, 0.5872952342033386, -0.012371372431516647, -0.30825895071029663, 0.006500605493783951, -0.13146741688251495, -0.07446512579917908, 0.03761105611920357, -0.14421290159225464, -0.6004323959350586, 0.12825238704681396, -0.06311361491680145, 0.15424662828445435, -0.10191083699464798, 0.08218762278556824, 0.17071574926376343, -0.010633572936058044, -0.05922828987240791, -0.2568531632423401, 0.16277605295181274, -0.1238945722579956, 0.17566832900047302, 0.2604943513870239, 0.4016995131969452, 0.08204039931297302, -0.10772353410720825, 0.284258633852005, -0.015492219477891922, -0.21564403176307678, 0.1732129603624344, 0.03416922315955162, -0.13265535235404968, -0.006472315639257431, 0.18736055493354797, 0.04165758937597275, 0.1329578161239624, -0.10637825727462769, -0.13062527775764465, 0.46325773000717163, -0.24041733145713806, 0.3646537661552429, -0.5045133829116821, -0.1436958909034729, -0.4385744631290436, 0.05775957554578781, -0.3988456428050995, -0.1726032793521881, 0.22412827610969543, 0.1762070506811142, -0.10772692412137985, -0.05045764893293381, -0.004018092527985573, 0.22723393142223358, 0.22198577225208282, 0.27365273237228394, 0.3858696222305298, -0.044356003403663635, -0.4677233099937439, -0.4668479859828949, -0.10710258036851883, 0.3581395745277405, 0.21909452974796295, -0.16515232622623444, -0.05150815099477768, 0.06994619965553284, 0.30381107330322266, -0.16185952723026276, 0.01760368049144745, 0.18415135145187378, 0.12348070740699768, 0.1877555400133133, -0.33552446961402893, -0.10645245015621185, 0.028450893238186836, 0.05225089192390442, 0.1070927307009697, 0.15149056911468506, -0.09128629416227341, -0.13838884234428406, -0.2994629740715027, 0.3010815680027008, -0.061930958181619644, 0.05664733052253723, 0.002117946743965149, 0.19833756983280182, 0.2573850154876709, -0.029595229774713516, -0.08767583221197128, 0.10110312700271606, 0.15481694042682648, -0.1628953367471695, 0.45614880323410034, -0.2943120300769806, 0.09045475721359253, -0.1886061578989029, -0.49167224764823914, -0.30752474069595337, 0.23500965535640717, 0.1348593831062317, -0.13166296482086182, -0.3734618127346039, 0.27976563572883606, -0.14794829487800598, -0.22825272381305695, 0.3741599917411804, 0.3252047896385193, -0.14476482570171356, 0.14856940507888794, -0.14828111231327057, 0.18041205406188965, 0.4873436689376831, -0.28904014825820923, -0.04403795674443245, -0.07934119552373886, -0.19455698132514954, 0.2748938202857971, -0.5021210312843323, -0.5923795700073242, 0.011107631027698517, 0.13170038163661957, -0.0383731946349144, 0.2646450400352478, 0.07275928556919098, -0.050919417291879654, -0.01170925423502922, -0.21131062507629395, 0.3836308419704437, 0.3766716420650482, 0.10352210700511932, 0.05475974455475807, -0.19535954296588898 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
> We're releasing `from_generator` and `from_list` today :) In the meantime you can play with them by installing `datasets` from source Thanks a lot for your work!
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
27
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. > We're releasing `from_generator` and `from_list` today :) In the meantime you can play with them by installing `datasets` from source Thanks a lot for your work!
[ -0.09902141988277435, -0.4878773093223572, -0.03271087259054184, 0.3409370183944702, 0.4273204803466797, 0.2405526041984558, -0.0781543105840683, 0.10982447862625122, -0.059794872999191284, 0.11361668258905411, -0.1899537593126297, 0.1660088300704956, -0.3545859754085541, 0.09371697902679443, 0.15269586443901062, -0.30555474758148193, 0.3979650139808655, -0.1627615988254547, -0.39588436484336853, 0.0075678229331970215, -0.1908661425113678, 0.35810860991477966, 0.05243653059005737, -0.015152931213378906, -0.010807132348418236, 0.1994931846857071, -0.12145650386810303, 0.1066095307469368, -0.20743310451507568, -0.136685311794281, 0.35564181208610535, -0.009247075766324997, 0.18391172587871552, 0.5127399563789368, -0.00012617016909644008, -0.16418153047561646, -0.01482623815536499, -0.17763817310333252, 0.026869647204875946, -0.3031612038612366, 0.2753605544567108, -0.0942099541425705, 0.1758669763803482, 0.051253728568553925, -0.33278071880340576, -0.10145619511604309, -0.08416129648685455, -0.45451071858406067, 0.30236560106277466, 0.3185615539550781, 0.0759877935051918, 0.22323331236839294, 0.44499462842941284, -0.05498842895030975, 0.09389585256576538, 0.5153337121009827, -0.1708267778158188, -0.019470639526844025, 0.3175719082355499, 0.11883549392223358, 0.37945756316185, 0.08905340731143951, -0.22212478518486023, -0.2202049046754837, 0.7101439237594604, 0.0117417611181736, -0.4946765899658203, -0.423576295375824, 0.06703265011310577, 0.22721338272094727, 0.4338098466396332, -0.36353355646133423, -0.38977909088134766, -0.08779044449329376, 0.05872195214033127, 0.024416165426373482, -0.225799560546875, 0.32732677459716797, -0.23499585688114166, 0.09504593908786774, -0.3506840169429779, -0.545911431312561, -0.12505991756916046, -0.014922857284545898, -0.07668304443359375, 0.05350390076637268, -0.30558934807777405, 0.04910511523485184, 0.363351970911026, -0.30287396907806396, 0.013301770202815533, -0.09195778518915176, 0.16193532943725586, 0.17671743035316467, 0.026395291090011597, -0.020526044070720673, -0.25847727060317993, 0.47528544068336487, 0.3652597665786743, 0.14366959035396576, -0.12899765372276306, -0.11584264785051346, -0.20496192574501038, 0.00442717969417572, 0.11631213128566742, -0.086540088057518, 0.15797501802444458, 0.1344737708568573, -0.0038728639483451843, -0.020819608122110367, 0.11945371329784393, 0.0619417205452919, -0.02921302244067192, -0.3380984365940094, -0.16694165766239166, -0.07070069760084152, 0.31588900089263916, -0.28800326585769653, -0.09667088836431503, -0.2437659502029419, 0.01856876164674759, 0.12056756019592285, 0.029819106683135033, 0.1826172024011612, -0.03813129663467407, 0.13459232449531555, 0.26863187551498413, 0.2205432504415512, -0.0026607001200318336, -0.23532092571258545, -0.04168199375271797, 0.020204463973641396, -0.06839344650506973, 0.016666922718286514, -0.1411769837141037, -0.6627007722854614, 0.002943039871752262, 0.13998763263225555, 0.11214102804660797, 0.18324704468250275, -0.2230672538280487, 0.22981996834278107, 0.41874951124191284, 0.06886858493089676, 0.03870232775807381, 0.08973202109336853, 0.3490654528141022, 0.015184871852397919, -0.3669389486312866, 0.03449736535549164, -0.258755624294281, 0.004575464874505997, -0.3324396312236786, -0.04948696494102478, -0.07082253694534302, -0.12210333347320557, -0.28023943305015564, 0.1667456477880478, 0.00808996707201004, -0.010570395737886429, 0.16626380383968353, -0.1482459008693695, -0.23721860349178314, -0.3089181184768677, 0.36254510283470154, 0.3923816680908203, -0.300188273191452, -0.20917809009552002, 0.16491127014160156, -0.4209720194339752, -0.0984981581568718, 0.21451804041862488, 0.0519096776843071, -0.2079409956932068, -0.39222970604896545, -0.36564749479293823, 0.05689288675785065, -0.35185733437538147, -0.0029861070215702057, 0.14665170013904572, 0.11390002071857452, 0.09106487035751343, -0.08043550699949265, 0.15587644279003143, -0.0703015998005867, -0.187374085187912, 0.06682426482439041, 0.05123836547136307, -0.16999126970767975, -0.14950621128082275, 0.1028272807598114, -0.18232911825180054, 0.5459879636764526, -0.12667816877365112, -0.1289936900138855, 0.24138286709785461, -0.1704891324043274, -0.13293589651584625, 0.21496856212615967, -0.14470842480659485, 0.1113852858543396, 0.24389506876468658, 0.10562235116958618, 0.4117569327354431, -0.030011918395757675, -0.06889121979475021, -0.3102548122406006, -0.06658171862363815, 0.10453519225120544, -0.011200040578842163, -0.13802634179592133, -0.27288818359375, -0.04353034496307373, 0.13167905807495117, -0.04248608276247978, -0.06733226776123047, -0.05397725850343704, -0.0983901172876358, 0.3604828417301178, -0.19849318265914917, -0.3174979090690613, 0.3320847451686859, -0.02880176156759262, 0.328472763299942, -0.7109202742576599, 0.16510996222496033, 0.1784498691558838, -0.05279017612338066, 0.146510511636734, 0.3483138680458069, 0.11453315615653992, -0.059932779520750046, 0.14002561569213867, 0.15803928673267365, 0.13559140264987946, 0.19415880739688873, 0.020244143903255463, 0.10352491587400436, 0.08736203610897064, -0.22973859310150146, 0.05523423105478287, 0.3330075740814209, 0.037123825401067734, 0.004036925733089447, -0.2972903549671173, 0.44491899013519287, -0.09093967080116272, 0.30034491419792175, -0.0806155651807785, 0.35386282205581665, 0.0009775180369615555, 0.23227205872535706, -0.19393616914749146, 0.04226372390985489, -0.05290510877966881, -0.09534335136413574, 0.3370412588119507, 0.1099594384431839, -0.6582515239715576, 0.05076822265982628, 0.13436053693294525, -0.18367479741573334, -0.0257943794131279, 0.12481094151735306, -0.34396296739578247, 0.00799601897597313, 0.1985018104314804, -0.23205141723155975, 0.2448151856660843, 0.14606212079524994, 0.2793477773666382, 0.22718530893325806, 0.22664257884025574, 0.05388035625219345, 0.1734853833913803, -0.02872178703546524, -0.09840308874845505, -0.34376218914985657, -0.15117831528186798, -0.03363526612520218, -0.09603117406368256, 0.2824452817440033, -0.4118410646915436, 0.029088325798511505, -0.48814186453819275, 0.06063642352819443, -0.3299688398838043, -0.23015862703323364, -0.48694688081741333, -0.1633269041776657, -0.44173523783683777, -0.28605198860168457, -0.2132624387741089, 0.04678149148821831, 0.18889842927455902, -0.15835553407669067, 0.1825905442237854, -0.09170408546924591, -0.05378222465515137, -0.23234622180461884, -0.2355552613735199, -0.15959486365318298, -0.04609190672636032, 0.005298968404531479, 0.24139894545078278, -0.002208456164225936, 0.23890075087547302, -0.35629430413246155, 0.2967485189437866, -0.620891273021698, -0.2059614062309265, 0.0705845057964325, -0.2654608488082886, -0.029875541105866432, 0.4205118715763092, 0.13281285762786865, 0.056464143097400665, -0.01234124694019556, 0.10268520563840866, -0.24741840362548828, -0.20782490074634552, -0.16347816586494446, -0.2644365727901459, 0.04709572345018387, -0.0018094368278980255, 0.08303613215684891, -0.3430394232273102, -0.0259692445397377, 0.3632996082305908, 0.04835711792111397, -0.036405354738235474, -0.1853683888912201, 0.1639571487903595, 0.09832025319337845, -0.21936112642288208, 0.07076256722211838, -0.06165109574794769, -0.6493241190910339, 0.5544790029525757, -0.2732013761997223, -0.47154733538627625, 0.24951958656311035, 0.1883067637681961, 0.2519947588443756, 0.07926228642463684, -0.0464981272816658, -0.013930032961070538, -0.0419396311044693, 0.18835827708244324, 0.06959129869937897, 0.27400341629981995, 0.143541157245636, 0.020342305302619934, 0.12786957621574402, -0.10237924754619598, 0.011042367666959763, -0.15206065773963928, -0.26614537835121155, 0.3621373772621155, 0.19318324327468872, 0.06001082807779312, -0.14219188690185547, 0.46697187423706055, 0.320377916097641, -0.24930636584758759, 0.12185171246528625, -0.2419203519821167, 0.5477033853530884, 0.016209661960601807, -0.4686773419380188, 0.057408031076192856, -0.14178138971328735, 0.22836525738239288, 0.05136062949895859, 0.24002021551132202, 0.47327888011932373, -0.23246648907661438, -0.08678386360406876, -0.17936673760414124, -0.24829567968845367, -0.18111591041088104, -0.18528947234153748, 0.15955787897109985, -0.22461338341236115, 0.10925882309675217, -0.14662374556064606, -0.10176708549261093, 0.1797444075345993, 0.37963902950286865, 0.5083289742469788, 0.20608480274677277, -0.3207924962043762, -0.11252928525209427, -0.5471644401550293, 0.32388216257095337, -0.008854787796735764, -0.13246531784534454, -0.05885013937950134, 0.016254279762506485, 0.006386712193489075, 0.07387597858905792, 0.6816005110740662, 0.21535030007362366, -0.3752603530883789, -0.05649324506521225, -0.24979634582996368, -0.5035630464553833, 0.2767076790332794, 0.04783310368657112, 0.1953945755958557, 0.07059817016124725, 0.1690826565027237, -0.3040851354598999, -0.4053002595901489, 0.1197487935423851, 0.41184863448143005, -0.15383276343345642, 0.0925414115190506, -0.2066442370414734, -0.219941645860672, -0.10766272246837616, -0.24496662616729736, 0.0194778423756361, 0.18260331451892853, -0.07475777715444565, -0.057335153222084045, -0.18845027685165405, -0.07214704155921936, 0.3669024109840393, -0.2723243832588196, 0.32652223110198975, -0.11817668378353119, -0.12411899864673615, 0.31448987126350403, 0.31411734223365784, 0.34656989574432373, 0.40686964988708496, -0.19737015664577484, -0.39214861392974854, -0.09723590314388275, 0.289108544588089, 0.5050327777862549, 0.0185345858335495, -0.10422641783952713, 0.09662636369466782, -0.09084317088127136, 0.06915321946144104, -0.3570360541343689, -0.2627580761909485, 0.2734059989452362, 0.24276500940322876, -0.25169143080711365, -0.4156971871852875, 0.4058489203453064, 0.4148535132408142, 0.24018354713916779, 0.09364516288042068, 0.7074584364891052, -0.14196589589118958, -0.14955973625183105, 0.24211272597312927, 1.0048960447311401, -0.16037341952323914, 0.18473701179027557, 0.06548742949962616, -0.28255122900009155, 0.808640718460083, 0.1071639358997345, -0.1508256196975708, -0.3414747714996338, 0.03268097713589668, -0.24555286765098572, -0.05422899127006531, 0.31615111231803894, 0.0852433443069458, -0.2031969428062439, 0.34483247995376587, -0.2302628457546234, 0.2960633933544159, -0.13424979150295258, 0.042294442653656006, -0.2119084894657135, -0.17901599407196045, -0.3524283170700073, 0.035325564444065094, 0.045517098158597946, 0.4162014424800873, 0.1254657804965973, -0.24934764206409454, -0.13901129364967346, 0.11817498505115509, -0.1876118779182434, 0.01976151019334793, -0.18000340461730957, -0.10699012875556946, 0.4317152500152588, -0.5826781988143921, 0.3147202134132385, 0.7585329413414001, 0.5532398819923401, -0.05790867283940315, -0.30197542905807495, -0.05116112902760506, -0.15992343425750732, -0.06464812159538269, -0.19322659075260162, 0.028051208704710007, 0.1496751308441162, 0.09862331300973892, 0.007584221661090851, 0.15891152620315552, 0.11890318989753723, -0.09054888784885406, -0.3910759687423706, -0.12060247361660004, -0.0014159530401229858, -0.3626115024089813, -0.23373258113861084, 0.20480205118656158, 0.25286614894866943, -0.026815127581357956, -0.013968434184789658, 0.18673264980316162, -0.20969580113887787, 0.023807082325220108, 0.04150458797812462, -0.041492678225040436, 0.10078591108322144, 0.40296241641044617, -0.20021232962608337, -0.39533254504203796, 0.20813573896884918, 0.38199132680892944, -0.12781651318073273, -0.017916927114129066, 0.2347196340560913, 0.6414585113525391, -0.2084813117980957, 0.18758580088615417, 0.010078385472297668, 0.4091593027114868, -0.01319840271025896, 0.0759156197309494, -0.030093081295490265, -0.022241614758968353, -0.09512902051210403, -0.0771801769733429, -0.3935721814632416, 0.04461946338415146, 0.01937233842909336, 0.09934484958648682, 0.0882234051823616, -0.053027767688035965, 0.04908790439367294, -0.10317221283912659, -0.1707344502210617, 0.213355153799057, 0.16819405555725098, -0.0572144091129303, 0.4460820257663727, 0.027971679344773293, -0.19107922911643982, -0.175035759806633, -0.044548891484737396, 0.1022164449095726, 0.04068379104137421, -0.0660596489906311, -0.084770068526268, 0.19802072644233704, -0.11404020339250565, -0.07284995168447495, 0.07763005048036575, 0.0036629363894462585, -0.11251598596572876, -0.34002211689949036, 0.29206839203834534, 0.45364323258399963, 0.10439474880695343, 0.2566024661064148, 0.23847557604312897, 0.16864275932312012, -0.1288832277059555, -0.037447065114974976, 0.29560086131095886, 0.42261332273483276, -0.04332553967833519, 0.1549074351787567, -0.08590713143348694, -0.10769643634557724, 0.10389586538076401, 0.3404742181301117, 0.39624136686325073, -0.27731576561927795, 0.3577353358268738, 0.14582930505275726, 0.009666871279478073, 0.05203159898519516, 0.4253430664539337, 0.24269255995750427, -0.043697673827409744, 0.4727049767971039, 0.19086745381355286, -0.09860477596521378, -0.19159390032291412, -0.1393820345401764, 0.025037411600351334, -0.04656463488936424, -0.24145907163619995, 0.07332608103752136, -0.0852680578827858, 0.3420371115207672, 0.13676929473876953, -0.22061190009117126, 0.3269385099411011, 0.0005948357284069061, 0.07701747119426727, 0.40398871898651123, 0.3384596109390259, 0.012819375842809677, 0.2964736521244049, 0.3466806709766388, 0.24294939637184143, 0.17637509107589722, -0.06451886147260666, 0.5579363107681274, 0.03552446514368057, 0.18465833365917206, 0.8467686176300049, -0.21507732570171356, -0.23335961997509003, 0.07008975744247437, 0.23039206862449646, 0.08026236295700073, -0.11122649908065796, 0.6390010118484497, -0.1879466325044632, -0.28553715348243713, 0.12351038306951523, 0.583358645439148, -0.007128775119781494, -0.2998126745223999, 0.006359480321407318, -0.13499367237091064, -0.08129388093948364, 0.022704798728227615, -0.14807038009166718, -0.6033949851989746, 0.13063915073871613, -0.0475652813911438, 0.15241242945194244, -0.10056491941213608, 0.06880953907966614, 0.19305595755577087, 0.0019848570227622986, -0.06799905002117157, -0.2669452428817749, 0.160517618060112, -0.11651065945625305, 0.17628414928913116, 0.25404492020606995, 0.4036766290664673, 0.08443303406238556, -0.11580023169517517, 0.30451589822769165, -0.010236527770757675, -0.21643759310245514, 0.18833981454372406, 0.04107881337404251, -0.12378497421741486, -0.013624221086502075, 0.19096364080905914, 0.04099579155445099, 0.13896319270133972, -0.10903102159500122, -0.13276240229606628, 0.4582989811897278, -0.2459285855293274, 0.36220821738243103, -0.5022033452987671, -0.14201144874095917, -0.4464597702026367, 0.05564148351550102, -0.39467939734458923, -0.17585457861423492, 0.22840791940689087, 0.17283105850219727, -0.10410915315151215, -0.05151126906275749, -0.005862602964043617, 0.22106143832206726, 0.21784918010234833, 0.2772718369960785, 0.39252203702926636, -0.05854121595621109, -0.47384971380233765, -0.4667343199253082, -0.11301440745592117, 0.3597603440284729, 0.21649491786956787, -0.15968851745128632, -0.053405970335006714, 0.06816242635250092, 0.2983499765396118, -0.15693096816539764, 0.00988040491938591, 0.1906396746635437, 0.13200902938842773, 0.17522400617599487, -0.33450883626937866, -0.10154359042644501, 0.04427103325724602, 0.0556267574429512, 0.11072822660207748, 0.1592005044221878, -0.07966168969869614, -0.1378369927406311, -0.3056359887123108, 0.29709547758102417, -0.0674656331539154, 0.07017938792705536, -0.004613958299160004, 0.19317586719989777, 0.26422637701034546, -0.024129442870616913, -0.0770547017455101, 0.10667303949594498, 0.14537738263607025, -0.1634397655725479, 0.45653849840164185, -0.2870321571826935, 0.07459069043397903, -0.18907222151756287, -0.48906609416007996, -0.30755454301834106, 0.24065689742565155, 0.12926192581653595, -0.13210488855838776, -0.3741004467010498, 0.267487108707428, -0.14246347546577454, -0.23351535201072693, 0.36025354266166687, 0.3318115770816803, -0.15233664214611053, 0.15307661890983582, -0.15546245872974396, 0.17472690343856812, 0.49979960918426514, -0.27279362082481384, -0.04634745791554451, -0.07635417580604553, -0.18902716040611267, 0.2690270245075226, -0.487225741147995, -0.603255033493042, 0.0019462108612060547, 0.14892707765102386, -0.02956359088420868, 0.2588614523410797, 0.0804847776889801, -0.03772790729999542, -0.007906943559646606, -0.21233925223350525, 0.37208864092826843, 0.3753353953361511, 0.12621526420116425, 0.059928055852651596, -0.19886714220046997 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
> > I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: > > ```python > > from datasets import Dataset > > data = [[1, 2],[3, 4]] > > ds = Dataset.from_dict({"data": data}) > > ds = ds.with_format("torch") > > ds[0] > > ds[:2] > > ``` > > > > > > > > > > > > > > > > > > > > > > > > So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. > > My dummy code is like: > > ```python > import os > import json > from torch.utils import data > import datasets > > def gen(torch_dataset): > for idx in len(torch_dataset): > yield torch_dataset[idx] # this has to be a dictionary > > class MyDataset(data.Dataset): > def __init__(self, path): > self.dict = [] > for line in open(path, 'r', encoding='utf-8'): > j_dict = json.loads(line) > self.dict.append(j_dict['context']) > > def __getitem__(self, idx): > return self.dict[idx] > > def __len__(self): > return len(self.dict) > > root_path = os.path.dirname(os.path.abspath(__file__)) > path = os.path.join(root_path, 'dataset', 'train.json') > torch_dataset = MyDataset(path) > > dit = [] > for line in open(path, 'r', encoding='utf-8'): > j_dict = json.loads(line) > dit.append(j_dict['context']) > dset1 = datasets.Dataset.from_list(dit) > print(dset1) > dset2 = datasets.Dataset.from_generator(gen) > print(dset2) > ``` Hi, when I am using this code to build my own dataset, ` datasets.Dataset.from_generator(gen)` report `TypeError: cannot pickle generator object` whre MyDataset returns a dict like {'image': bytes, 'text': string}. How can I resolve this? Thanks a lot!
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
294
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. > > I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: > > ```python > > from datasets import Dataset > > data = [[1, 2],[3, 4]] > > ds = Dataset.from_dict({"data": data}) > > ds = ds.with_format("torch") > > ds[0] > > ds[:2] > > ``` > > > > > > > > > > > > > > > > > > > > > > > > So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. > > My dummy code is like: > > ```python > import os > import json > from torch.utils import data > import datasets > > def gen(torch_dataset): > for idx in len(torch_dataset): > yield torch_dataset[idx] # this has to be a dictionary > > class MyDataset(data.Dataset): > def __init__(self, path): > self.dict = [] > for line in open(path, 'r', encoding='utf-8'): > j_dict = json.loads(line) > self.dict.append(j_dict['context']) > > def __getitem__(self, idx): > return self.dict[idx] > > def __len__(self): > return len(self.dict) > > root_path = os.path.dirname(os.path.abspath(__file__)) > path = os.path.join(root_path, 'dataset', 'train.json') > torch_dataset = MyDataset(path) > > dit = [] > for line in open(path, 'r', encoding='utf-8'): > j_dict = json.loads(line) > dit.append(j_dict['context']) > dset1 = datasets.Dataset.from_list(dit) > print(dset1) > dset2 = datasets.Dataset.from_generator(gen) > print(dset2) > ``` Hi, when I am using this code to build my own dataset, ` datasets.Dataset.from_generator(gen)` report `TypeError: cannot pickle generator object` whre MyDataset returns a dict like {'image': bytes, 'text': string}. How can I resolve this? Thanks a lot!
[ 0.009790714830160141, -0.5521003007888794, -0.05157579109072685, 0.26948249340057373, 0.46555590629577637, 0.2528730630874634, 0.003918204456567764, 0.11896823346614838, -0.013936078175902367, 0.13641729950904846, -0.1774415522813797, 0.2021636962890625, -0.3212900459766388, 0.043897613883018494, 0.0006841598078608513, -0.24910587072372437, 0.3535265624523163, -0.1782802939414978, -0.30183297395706177, -0.00277550145983696, -0.16909289360046387, 0.33188530802726746, 0.06160162389278412, -0.1577264666557312, -0.10394943505525589, 0.21444006264209747, -0.17473921179771423, 0.09105288982391357, -0.16361410915851593, -0.12946374714374542, 0.4598866105079651, -0.008426066488027573, 0.20784547924995422, 0.5427951812744141, -0.00011805839312728494, -0.0502731129527092, 0.03039628081023693, -0.17871622741222382, -0.05892423167824745, -0.2463027387857437, 0.259951114654541, -0.11163110285997391, 0.2512231469154358, -0.09923604875802994, -0.4526314437389374, -0.03228054568171501, -0.15007099509239197, -0.501275360584259, 0.4031680226325989, 0.3243265748023987, 0.17056477069854736, 0.08884505182504654, 0.3986194133758545, -0.09109178185462952, -0.04331183433532715, 0.5823930501937866, -0.15168651938438416, 0.1564708650112152, 0.24243783950805664, 0.20056979358196259, 0.3642991781234741, 0.19329017400741577, -0.20395386219024658, -0.15758919715881348, 0.5686710476875305, -0.07490502297878265, -0.45409679412841797, -0.3628937900066376, 0.14103718101978302, 0.09996591508388519, 0.4646433889865875, -0.3497887849807739, -0.4560379385948181, -0.02660970389842987, 0.0934915542602539, -0.013748733326792717, -0.18809586763381958, 0.2502932846546173, -0.11303181946277618, 0.06918085366487503, -0.3265829384326935, -0.38374337553977966, -0.11921131610870361, 0.03780171275138855, -0.0327424481511116, 0.19694271683692932, -0.2889747619628906, 0.07995550334453583, 0.28477025032043457, -0.4306909441947937, -0.12127503007650375, 0.045055389404296875, 0.14757981896400452, 0.1695122867822647, 0.09344378858804703, -0.0006249360740184784, -0.3488163352012634, 0.34036341309547424, 0.3623404800891876, 0.10744520276784897, -0.10428645461797714, -0.02024189755320549, -0.12084267288446426, -0.01240905374288559, 0.04422241449356079, -0.05626976862549782, 0.18173834681510925, 0.12340656667947769, -0.06816430389881134, 0.03177901729941368, 0.13345494866371155, 0.04926765710115433, 0.0595724880695343, -0.32792338728904724, -0.33268436789512634, 0.020559173077344894, 0.37600499391555786, -0.25216928124427795, -0.0344877652823925, -0.33339783549308777, -0.1321994811296463, 0.21258606016635895, 0.018630357459187508, 0.23961833119392395, -0.023491956293582916, 0.0640028715133667, 0.26519066095352173, 0.22163791954517365, -0.07735470682382584, -0.18744051456451416, -0.06039580702781677, 0.19383127987384796, -0.040579475462436676, 0.029149116948246956, 0.013885941356420517, -0.5408385992050171, 0.08662786334753036, 0.08175774663686752, 0.13212087750434875, 0.16242006421089172, -0.27800172567367554, 0.2633923292160034, 0.3937796950340271, 0.07068401575088501, -0.015341876074671745, 0.1415877491235733, 0.3301641345024109, -0.05186251178383827, -0.35425490140914917, -0.11280351132154465, -0.2552219033241272, -0.014173869043588638, -0.3868926167488098, 0.03186993673443794, -0.08436551690101624, -0.07294727116823196, -0.21751117706298828, 0.12745219469070435, -0.005977660417556763, -0.02332933247089386, 0.2224884182214737, -0.12365536391735077, -0.2021970897912979, -0.3132549524307251, 0.47253918647766113, 0.39028048515319824, -0.24374060332775116, -0.2388288974761963, 0.07733579725027084, -0.26243600249290466, -0.0789983943104744, 0.08551310747861862, 0.10902109742164612, -0.16426149010658264, -0.41852524876594543, -0.296132355928421, -0.026079170405864716, -0.5577012300491333, -0.0439281091094017, 0.13157010078430176, 0.14715690910816193, 0.17349094152450562, -0.08973345905542374, 0.11841332167387009, -0.05612622946500778, -0.021291745826601982, 0.0651462972164154, 0.0898982584476471, -0.05572952330112457, -0.06741108745336533, 0.08670590817928314, -0.12770642340183258, 0.5025553703308105, 0.00606541708111763, -0.24366821348667145, 0.08532993495464325, -0.11993717402219772, -0.024875864386558533, 0.24371308088302612, -0.21612122654914856, 0.13383695483207703, 0.25886082649230957, 0.09820353984832764, 0.2603554129600525, -0.027247248217463493, -0.029687898233532906, -0.43088775873184204, 0.03681954741477966, 0.22498396039009094, 0.04796399176120758, -0.15411867201328278, -0.31894201040267944, -0.0760359838604927, -0.013307997956871986, -0.09555321931838989, -0.21665751934051514, 0.06909231096506119, -0.08964726328849792, 0.4802044630050659, -0.17612861096858978, -0.15067891776561737, 0.2844610810279846, 0.01574225164949894, 0.32302534580230713, -0.8004749417304993, 0.09082841873168945, 0.12517131865024567, -0.04852156713604927, 0.1898399293422699, 0.4175492823123932, 0.1802312731742859, -0.12397917360067368, 0.07249614596366882, 0.21225124597549438, 0.17337274551391602, 0.08102437853813171, -0.13232490420341492, 0.0470205694437027, 0.10765951126813889, -0.23574814200401306, 0.0017939470708370209, 0.41899314522743225, -0.0029595389496535063, -0.038301169872283936, -0.3519359230995178, 0.5088164210319519, 0.07759036123752594, 0.3153703212738037, -0.04730871319770813, 0.41689538955688477, 0.023309456184506416, 0.1898937076330185, -0.3188988268375397, -0.00405140221118927, -0.15332022309303284, -0.1354060173034668, 0.29077425599098206, 0.0028683021664619446, -0.48947829008102417, 0.06585519760847092, 0.0706799104809761, -0.17451472580432892, 0.028233833611011505, 0.07117363810539246, -0.2720331847667694, 0.1358247697353363, 0.26214301586151123, -0.2250613570213318, 0.22560085356235504, 0.21540506184101105, 0.2699373960494995, 0.17256076633930206, 0.1900968849658966, 0.020313136279582977, 0.12658685445785522, -0.05457484722137451, -0.10580051690340042, -0.4104269742965698, -0.038245439529418945, -0.1001119613647461, -0.02193232998251915, 0.07175110280513763, -0.457060843706131, -0.034063614904880524, -0.48664578795433044, 0.04154140502214432, -0.412751168012619, -0.24566543102264404, -0.3669815957546234, -0.2307368516921997, -0.3381198048591614, -0.26688361167907715, -0.18108418583869934, -0.028529901057481766, 0.12991495430469513, -0.026914851740002632, 0.20773905515670776, -0.11900357902050018, -0.016624026000499725, -0.33600950241088867, -0.19540803134441376, -0.11935219913721085, -0.15876051783561707, 0.03789946809411049, 0.18661776185035706, 0.043354060500860214, 0.2567034959793091, -0.28713977336883545, 0.2560673952102661, -0.6032813191413879, -0.20442330837249756, 0.07776199281215668, -0.38849955797195435, -0.14361119270324707, 0.39034366607666016, 0.08650793880224228, 0.03686287999153137, -0.01173902302980423, 0.13628844916820526, -0.1232745498418808, -0.24529248476028442, -0.18980422616004944, -0.2539867162704468, 0.08030075579881668, -0.1303377002477646, -0.03753788024187088, -0.30315151810646057, -0.13754142820835114, 0.4130513072013855, 0.08005587756633759, -0.06795991957187653, -0.12451732903718948, 0.2980191111564636, 0.2304409295320511, -0.11888900399208069, 0.17868711054325104, -0.0909123420715332, -0.5651113986968994, 0.5213242173194885, -0.3378104567527771, -0.5236365795135498, 0.30531972646713257, 0.11426283419132233, 0.41873699426651, 0.045379023998975754, -0.12391012907028198, -0.06508708000183105, -0.01442735455930233, 0.14641907811164856, 0.00398336723446846, 0.261474072933197, 0.15472279489040375, 0.01813836768269539, 0.06882595270872116, -0.0735870748758316, -0.009895149618387222, -0.07655913382768631, -0.3284747302532196, 0.3386223018169403, 0.07353781908750534, 0.12175878137350082, -0.094053253531456, 0.42625272274017334, 0.3263508379459381, -0.3554939329624176, 0.0862623006105423, -0.2875429093837738, 0.4697686433792114, 0.0694124698638916, -0.4245303273200989, 0.1299774944782257, -0.18093585968017578, 0.2453489452600479, 0.0694684237241745, 0.20655277371406555, 0.41804400086402893, -0.2170001119375229, -0.08420068770647049, -0.2136925756931305, -0.3150099813938141, -0.16928069293498993, -0.26904475688934326, 0.008762218058109283, -0.3449054956436157, 0.1819632649421692, -0.09943293035030365, -0.0569690503180027, 0.19905249774456024, 0.37215209007263184, 0.34586912393569946, 0.25565552711486816, -0.2861093282699585, -0.1461530178785324, -0.4401015639305115, 0.46433985233306885, 0.008081917650997639, -0.07214280217885971, -0.015442248433828354, 0.004889126867055893, -0.06414267420768738, -0.02623157948255539, 0.5962538123130798, 0.18679024279117584, -0.30545955896377563, 0.05643496289849281, -0.27470719814300537, -0.6968555450439453, 0.1385476142168045, 0.032977547496557236, 0.36992624402046204, 0.11174061894416809, 0.22084753215312958, -0.3237062096595764, -0.41427624225616455, 0.10536728799343109, 0.29602742195129395, -0.165782630443573, 0.027715269476175308, -0.2263796627521515, -0.3958114683628082, -0.1553809940814972, -0.2137121558189392, 0.09456724673509598, 0.21097996830940247, -0.1557319164276123, -0.0982968658208847, -0.24853290617465973, -0.15844935178756714, 0.3573482036590576, -0.2601254880428314, 0.3231629431247711, -0.0391373485326767, -0.11601415276527405, 0.2900603413581848, 0.38648322224617004, 0.29607856273651123, 0.4428558349609375, -0.05583498254418373, -0.32169589400291443, -0.019972488284111023, 0.35099491477012634, 0.4773222506046295, 0.047175049781799316, 0.036495693027973175, 0.09282318502664566, -0.07414073497056961, 0.006776101887226105, -0.3315536379814148, -0.20566333830356598, 0.20244787633419037, 0.18735912442207336, -0.34309738874435425, -0.393204927444458, 0.4273220896720886, 0.34104135632514954, 0.30696725845336914, 0.06447909772396088, 0.6941217184066772, -0.2186965048313141, 0.011426853016018867, 0.3016463816165924, 0.8991264700889587, -0.09298808872699738, 0.13337844610214233, 0.19300684332847595, -0.22540266811847687, 0.8374059200286865, 0.014471758157014847, -0.0834893062710762, -0.24386978149414062, 0.14629331231117249, -0.15473690629005432, 0.010226700454950333, 0.24637621641159058, 0.04080557823181152, -0.31495681405067444, 0.3478054106235504, -0.23416997492313385, 0.28206029534339905, -0.16061748564243317, 0.1346307396888733, -0.23071469366550446, -0.27908411622047424, -0.3184219002723694, 0.14195632934570312, -0.02056443691253662, 0.310852974653244, 0.14876651763916016, -0.2801451086997986, -0.25905418395996094, -0.014669591560959816, -0.09984611719846725, 0.03864254802465439, -0.19362220168113708, 0.026056403294205666, 0.2872313857078552, -0.4921870827674866, 0.3528495132923126, 0.7172146439552307, 0.4850342273712158, -0.022898804396390915, -0.43289804458618164, -0.08488486707210541, -0.15918555855751038, -0.14891637861728668, -0.3099766969680786, 0.05379977077245712, 0.1806231588125229, 0.11413159221410751, 0.04650277644395828, 0.14972800016403198, 0.1244109719991684, -0.050937261432409286, -0.26767653226852417, -0.06358391046524048, -0.1848963499069214, -0.40583208203315735, -0.30832797288894653, 0.19439327716827393, 0.11813153326511383, 0.021085884422063828, 0.05290116369724274, 0.0866570845246315, -0.22862835228443146, -0.01650172472000122, 0.17594105005264282, -0.09876042604446411, 0.06640584766864777, 0.5296454429626465, -0.1483624279499054, -0.37199321389198303, 0.30104419589042664, 0.3615908920764923, -0.11399085074663162, -0.04975147172808647, 0.14013516902923584, 0.657406210899353, -0.14521118998527527, 0.0715184137225151, 0.05252976715564728, 0.39866095781326294, -0.06667063385248184, -0.018098775297403336, -0.032827481627464294, -0.035872869193553925, -0.04569822549819946, -0.03863479569554329, -0.5107503533363342, 0.1373358815908432, 0.009869180619716644, 0.15179617702960968, 0.01993441954255104, 0.14478908479213715, 0.07269057631492615, -0.10530230402946472, -0.26091670989990234, 0.1999288648366928, 0.05935335159301758, -0.09293816238641739, 0.3675965666770935, 0.036080196499824524, -0.1400119662284851, -0.07084985077381134, 0.05984549969434738, 0.15752451121807098, -0.04156605154275894, -0.14108389616012573, -0.005532890558242798, 0.1327117681503296, -0.020154252648353577, 0.013123285956680775, 0.09569702297449112, -0.004654012620449066, -0.11243867874145508, -0.3461264371871948, 0.17378246784210205, 0.4394760727882385, 0.042841844260692596, 0.30080628395080566, 0.210150808095932, 0.2343815565109253, -0.023742780089378357, -0.14463916420936584, 0.3298187255859375, 0.4280087947845459, -0.06446108222007751, 0.07969193905591965, -0.14097733795642853, -0.0821281298995018, 0.15233588218688965, 0.2545541822910309, 0.3683302402496338, -0.21553024649620056, 0.1897956132888794, 0.1510729044675827, 0.057621050626039505, -0.012977056205272675, 0.42663928866386414, 0.12114125490188599, -0.13949456810951233, 0.49743562936782837, 0.17983484268188477, 0.004002491012215614, -0.1411966234445572, -0.015748905017971992, 0.08698172867298126, -0.03759608790278435, -0.12198872864246368, 0.14971782267093658, -0.1486477255821228, 0.2623414695262909, 0.06587328016757965, -0.19227060675621033, 0.29889026284217834, 0.012222886085510254, 0.0633215680718422, 0.26077041029930115, 0.17837758362293243, -0.0956805944442749, 0.2466699331998825, 0.20061199367046356, 0.356935054063797, 0.16862042248249054, -0.1657732129096985, 0.647340714931488, 0.029324514791369438, 0.1979353427886963, 0.7120996713638306, -0.1318211406469345, -0.2509119510650635, 0.029338575899600983, 0.2940686345100403, 0.05995675548911095, -0.15046870708465576, 0.5603818297386169, -0.18874917924404144, -0.35518375039100647, 0.11178029328584671, 0.41066309809684753, 0.019144687801599503, -0.18788012862205505, -0.022330857813358307, -0.0318853035569191, -0.10600210726261139, -0.061562441289424896, -0.1996588259935379, -0.6113678812980652, 0.22731471061706543, -0.07094001770019531, 0.09019826352596283, -0.09933125972747803, 0.08281917870044708, 0.14691416919231415, 0.04450565576553345, -0.04286923632025719, -0.1734454482793808, 0.3088827133178711, -0.1161070466041565, 0.13470347225666046, 0.2278020679950714, 0.4752354323863983, 0.1564044952392578, -0.19968988001346588, 0.299357146024704, 0.023563669994473457, -0.22724224627017975, 0.1653321236371994, 0.07673126459121704, -0.07043778896331787, -0.11212733387947083, 0.24976785480976105, 0.1561143547296524, 0.028507530689239502, -0.10769869387149811, -0.07682710886001587, 0.3899814784526825, -0.25202468037605286, 0.29149043560028076, -0.522546648979187, -0.09345164895057678, -0.3705509603023529, 0.018130987882614136, -0.5925169587135315, -0.2509317994117737, 0.07542429864406586, 0.2104831337928772, -0.030752569437026978, -0.07358193397521973, 0.03937400132417679, 0.1356784701347351, 0.32016998529434204, 0.20957155525684357, 0.42120304703712463, -0.12042828649282455, -0.40716665983200073, -0.3875558376312256, -0.1828155219554901, 0.2338225245475769, 0.1509007215499878, -0.207223579287529, -0.007810437120497227, 0.09619981050491333, 0.2284988909959793, -0.15941332280635834, -0.04062298685312271, 0.21287785470485687, 0.09397043287754059, 0.031018663197755814, -0.3398580849170685, -0.07592102885246277, 0.03415974974632263, 0.17235851287841797, 0.14964622259140015, 0.16307474672794342, -0.11262771487236023, -0.06802934408187866, -0.24646146595478058, 0.30372175574302673, 0.01159471645951271, 0.08524760603904724, 0.029244914650917053, 0.19467854499816895, 0.29985716938972473, -0.07035849988460541, -0.16613605618476868, -0.0742029994726181, 0.08443479239940643, -0.08492626249790192, 0.5386391878128052, -0.24655011296272278, 0.17194858193397522, -0.19445499777793884, -0.44402265548706055, -0.26238498091697693, 0.3021637499332428, 0.10362660884857178, -0.22144083678722382, -0.32346126437187195, 0.3165314495563507, -0.09656276553869247, -0.1838877648115158, 0.15296971797943115, 0.38036683201789856, -0.23359480500221252, 0.3334692120552063, -0.21755856275558472, -0.016667403280735016, 0.6324251890182495, -0.2994101643562317, -0.009053142741322517, 0.037709999829530716, -0.09424340724945068, 0.285409539937973, -0.3530251979827881, -0.5797721743583679, 0.07108084112405777, 0.1426454484462738, -0.015566840767860413, 0.10247147083282471, 0.13904528319835663, -0.02935079112648964, -0.08098357915878296, -0.20239832997322083, 0.26171040534973145, 0.2831363081932068, 0.1609755903482437, 0.07809269428253174, -0.2531301975250244 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
Hi ! Right now generator functions are expected to be picklable, so that `datasets` can hash it and use the hash to cache the resulting Dataset on disk. Maybe this can be improved. In the meantime, can you check that you're not using unpickable objects. In your case it looks like you're using a generator object that is unpickable. It might come from an opened file, e.g. this doesn't work: ```python with open(...) as f: def gen(): for x in f: yield json.loads(x) ds = Dataset.from_generator(gen) ``` but this does work: ```python def gen(): with open(...) as f: for x in f: yield json.loads(x) ds = Dataset.from_generator(gen) ```
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
108
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. Hi ! Right now generator functions are expected to be picklable, so that `datasets` can hash it and use the hash to cache the resulting Dataset on disk. Maybe this can be improved. In the meantime, can you check that you're not using unpickable objects. In your case it looks like you're using a generator object that is unpickable. It might come from an opened file, e.g. this doesn't work: ```python with open(...) as f: def gen(): for x in f: yield json.loads(x) ds = Dataset.from_generator(gen) ``` but this does work: ```python def gen(): with open(...) as f: for x in f: yield json.loads(x) ds = Dataset.from_generator(gen) ```
[ -0.015316087752580643, -0.3764796555042267, 0.023010659962892532, 0.33072930574417114, 0.5059040784835815, 0.19528427720069885, -0.09379364550113678, 0.12583918869495392, 0.02332136407494545, 0.11674781888723373, -0.12190520018339157, 0.23164431750774384, -0.3326250910758972, 0.030517784878611565, 0.12838181853294373, -0.2797106206417084, 0.3349247872829437, -0.1299518197774887, -0.3901636004447937, 0.03209906816482544, -0.316913366317749, 0.38638412952423096, 0.11370179057121277, 0.018186241388320923, -0.08550682663917542, 0.19655033946037292, -0.060570068657398224, 0.1459544599056244, -0.3284989893436432, -0.09849368035793304, 0.3152307868003845, 0.05589373782277107, 0.05822121351957321, 0.5909223556518555, -0.00012173905997769907, -0.08934010565280914, 0.062167633324861526, -0.19668275117874146, -0.05366050824522972, -0.31214725971221924, 0.2756238281726837, -0.07899107784032822, 0.08580821752548218, 0.03365784138441086, -0.3424754738807678, -0.13928453624248505, -0.05743909627199173, -0.5269386768341064, 0.37803536653518677, 0.3039797842502594, 0.12218286097049713, 0.16278202831745148, 0.533037543296814, 0.013204020448029041, 0.06261754781007767, 0.5024852156639099, -0.21933749318122864, 0.10847160220146179, 0.14885498583316803, 0.18525296449661255, 0.36131802201271057, 0.17806966602802277, -0.23100221157073975, -0.19102822244167328, 0.7924190163612366, -0.09082575887441635, -0.49699437618255615, -0.3833373785018921, 0.16415563225746155, 0.20233210921287537, 0.35250985622406006, -0.41103771328926086, -0.43273383378982544, -0.13737452030181885, 0.08018992096185684, -0.006509440019726753, -0.13414165377616882, 0.26025113463401794, -0.24798569083213806, 0.13381905853748322, -0.3896164894104004, -0.4993741810321808, -0.10731260478496552, -0.0472370982170105, 0.05191418528556824, -0.014031313359737396, -0.289983332157135, 0.11389394104480743, 0.3780025839805603, -0.31030088663101196, 0.007789273280650377, -0.1402219533920288, 0.15059782564640045, 0.07987736910581589, 0.06328713148832321, 0.025193914771080017, -0.21613559126853943, 0.40545588731765747, 0.440215140581131, 0.17576375603675842, -0.029142264276742935, -0.032761164009571075, -0.17831313610076904, 0.0847601667046547, 0.01750241033732891, -0.041316308081150055, 0.14964203536510468, 0.06503763049840927, -0.047628603875637054, 0.008389003574848175, -0.00028238818049430847, 0.04434695094823837, -0.014530111104249954, -0.38665103912353516, -0.0651436597108841, 0.04909124970436096, 0.320279598236084, -0.2504426836967468, -0.04204567149281502, -0.2817651033401489, -0.012379419058561325, 0.15541410446166992, -0.006805523298680782, 0.25342556834220886, -0.04223188757896423, 0.11136198788881302, 0.30704742670059204, 0.2750902473926544, -0.058304667472839355, -0.3064885139465332, -0.034756459295749664, 0.04519614577293396, -0.06099047511816025, 0.05882573872804642, -0.06498347222805023, -0.610405683517456, 0.05470425635576248, 0.08158622682094574, -0.008128486573696136, 0.10549281537532806, -0.10611093789339066, 0.24623899161815643, 0.396115243434906, 0.08849513530731201, 0.00451534241437912, 0.15449856221675873, 0.33731386065483093, -0.07641368359327316, -0.35708317160606384, -0.04649077355861664, -0.14603188633918762, -0.0744749903678894, -0.294766902923584, -0.003532220609486103, -0.16284142434597015, -0.009932518005371094, -0.27444589138031006, 0.12859372794628143, -0.025698669254779816, -0.06518274545669556, 0.10828803479671478, -0.12144911289215088, -0.20033156871795654, -0.3359665870666504, 0.43238523602485657, 0.5127721428871155, -0.2554231286048889, -0.20349203050136566, 0.0721665471792221, -0.3229207396507263, -0.09176049381494522, 0.1783951073884964, 0.09927701205015182, -0.16884732246398926, -0.33477944135665894, -0.3632134795188904, 0.009511567652225494, -0.317068487405777, -0.13404487073421478, 0.1337306648492813, 0.08010996878147125, 0.246510311961174, -0.015603728592395782, 0.08958243578672409, -0.1689891219139099, -0.1115638017654419, 0.1618894636631012, 0.0941392257809639, -0.1252528578042984, -0.1874317079782486, -0.032385751605033875, -0.21944904327392578, 0.4767146110534668, -0.15240374207496643, -0.19053368270397186, 0.3590540885925293, -0.21382635831832886, -0.15095451474189758, 0.15498033165931702, -0.2552938759326935, 0.1704721450805664, 0.26699262857437134, 0.11536698043346405, 0.27135705947875977, -0.056365080177783966, 0.002810884267091751, -0.4806089997291565, 0.011692274361848831, 0.07543740421533585, -0.017074711620807648, -0.22203193604946136, -0.2699759304523468, -0.02562602609395981, 0.09229306131601334, -0.1267051100730896, -0.08123919367790222, -0.0017381440848112106, -0.015559300780296326, 0.4142928719520569, -0.15199550986289978, -0.2578618824481964, 0.26704588532447815, 0.08644771575927734, 0.3172759711742401, -0.822442352771759, 0.08244394510984421, 0.11969117820262909, -0.10150895267724991, 0.2250869870185852, 0.2846566438674927, 0.215943843126297, -0.1438084840774536, 0.1026511862874031, 0.1503974348306656, 0.03779267892241478, 0.16259074211120605, -0.07182591408491135, 0.11215346306562424, 0.018687427043914795, -0.1723499745130539, 0.046156398952007294, 0.3273712396621704, 0.03684069216251373, 0.011199451982975006, -0.1969643235206604, 0.48823028802871704, -0.07355077564716339, 0.2800107002258301, -0.07825309783220291, 0.2925219237804413, 0.0657854825258255, 0.16081999242305756, -0.21393416821956635, 0.03140943497419357, -0.07715263962745667, -0.07588104903697968, 0.3810924291610718, 0.16455093026161194, -0.5530012249946594, 0.15564218163490295, 0.2728830873966217, -0.17833486199378967, 0.04944419860839844, 0.18814632296562195, -0.38142266869544983, -0.015577775426208973, 0.14016608893871307, -0.18379256129264832, 0.3193741738796234, 0.16574789583683014, 0.2599269151687622, 0.22527705132961273, 0.1842035949230194, 0.002672618255019188, 0.09920890629291534, -0.06772160530090332, 0.0067063914611935616, -0.2538008987903595, -0.10689079761505127, -0.10492520034313202, -0.1363142728805542, 0.2841845750808716, -0.34190523624420166, 0.04402367025613785, -0.5018689036369324, 0.12823544442653656, -0.33469152450561523, -0.034684501588344574, -0.415213942527771, -0.11249635368585587, -0.4300636053085327, -0.2720254361629486, -0.1679016798734665, 0.16320210695266724, 0.1361144334077835, -0.14411218464374542, 0.259386271238327, -0.08994545042514801, -0.08042699098587036, -0.277969628572464, -0.37956511974334717, -0.18412762880325317, -0.17020577192306519, -0.03052917867898941, 0.26021862030029297, -0.03772784769535065, 0.25429949164390564, -0.324618935585022, 0.3037692904472351, -0.5664011836051941, -0.05956371873617172, 0.041164711117744446, -0.32036322355270386, 0.13069385290145874, 0.3442624807357788, 0.18915152549743652, 0.13830353319644928, -0.05437042564153671, 0.20532386004924774, -0.24451860785484314, -0.20795410871505737, -0.06372866034507751, -0.2613718807697296, 0.030323270708322525, -0.041578616946935654, 0.013530164957046509, -0.271373987197876, -0.10556507110595703, 0.4589102268218994, 0.08525773882865906, -0.09536130726337433, -0.13662153482437134, 0.3224885165691376, 0.06739065051078796, -0.09132591634988785, 0.10157521814107895, -0.1060696691274643, -0.7260817289352417, 0.5768734216690063, -0.27755579352378845, -0.4704115092754364, 0.18975958228111267, 0.14069482684135437, 0.26607754826545715, 0.09446366131305695, -0.03240147605538368, 0.007070909254252911, -0.003437414765357971, 0.1166267991065979, 0.0570896752178669, 0.16150972247123718, 0.1420922577381134, 0.12982194125652313, 0.1137845367193222, -0.13297580182552338, -0.09971065819263458, -0.07822152227163315, -0.35702165961265564, 0.35653725266456604, 0.24053362011909485, 0.15762680768966675, -0.1408550888299942, 0.4680773615837097, 0.34555086493492126, -0.31397509574890137, 0.15537811815738678, -0.1979421079158783, 0.493453711271286, -0.04070586711168289, -0.48504137992858887, 0.13865388929843903, -0.2593603730201721, 0.2130938470363617, -0.022265270352363586, 0.15257808566093445, 0.5202952027320862, -0.22050027549266815, 0.01721183955669403, -0.30704277753829956, -0.34243908524513245, -0.09251478314399719, -0.139046773314476, -0.002131350338459015, -0.13368447124958038, 0.15437597036361694, -0.2653515934944153, -0.06297625601291656, 0.28240731358528137, 0.4122619032859802, 0.4973560869693756, 0.32713836431503296, -0.3475744426250458, -0.0969105213880539, -0.5459681749343872, 0.37227141857147217, -0.08754900842905045, -0.15798091888427734, -0.03507792949676514, 0.016883283853530884, 0.02023051679134369, -0.00844614952802658, 0.7595799565315247, 0.06286460161209106, -0.31910234689712524, 0.019483815878629684, -0.22182898223400116, -0.5451780557632446, 0.2607247233390808, 0.158122718334198, 0.19802340865135193, 0.008207438513636589, 0.20021888613700867, -0.4196684956550598, -0.33572134375572205, 0.03773442283272743, 0.40850892663002014, -0.16510812938213348, 0.025594010949134827, -0.2665860950946808, -0.3291645348072052, -0.17147310078144073, -0.3392532467842102, -0.001020411029458046, 0.1605779230594635, -0.1391599029302597, -0.054966263473033905, -0.2243466079235077, -0.02147609367966652, 0.37978899478912354, -0.16221758723258972, 0.32249563932418823, -0.1559695452451706, -0.1050533652305603, 0.4157605469226837, 0.2898353040218353, 0.2546059787273407, 0.441000759601593, -0.10014273226261139, -0.3444569706916809, -0.14672622084617615, 0.30995073914527893, 0.2975740134716034, 0.02665264904499054, -0.09100555628538132, 0.08924943208694458, -0.08513134717941284, 0.05273988097906113, -0.349303275346756, -0.19296233355998993, 0.30222293734550476, 0.15412244200706482, -0.26200544834136963, -0.4683331251144409, 0.4524018466472626, 0.303497314453125, 0.2016935795545578, 0.1716073900461197, 0.6603471636772156, -0.13181185722351074, -0.01186450757086277, 0.2521367073059082, 1.0337247848510742, -0.26573437452316284, 0.1507011204957962, 0.13149094581604004, -0.2783346176147461, 0.8734392523765564, -0.011326950043439865, -0.054278649389743805, -0.3728393018245697, 0.11804674565792084, -0.16431130468845367, -0.03580675274133682, 0.2468809187412262, 0.12718713283538818, -0.2658062279224396, 0.29923710227012634, -0.20994478464126587, 0.13874605298042297, -0.11152904480695724, 0.11813689768314362, -0.1895822435617447, -0.20636627078056335, -0.3138156533241272, 0.09929025173187256, -0.062433674931526184, 0.5275458097457886, 0.13691985607147217, -0.3325001001358032, -0.2001560628414154, 0.08956129848957062, -0.10987551510334015, 0.055872030556201935, -0.2690543830394745, -0.10352740436792374, 0.4689326882362366, -0.47544699907302856, 0.239693284034729, 0.6409135460853577, 0.5729645490646362, -0.04362204298377037, -0.3006225824356079, -0.026095476001501083, -0.10924289375543594, -0.10889968276023865, -0.20628532767295837, -0.027609899640083313, 0.2220636010169983, 0.08727364987134933, -0.005182094871997833, 0.13988259434700012, 0.08474623411893845, -0.09526467323303223, -0.34932148456573486, -0.2328682690858841, -0.08825203776359558, -0.3486075699329376, -0.3395751118659973, 0.15225142240524292, 0.1818547397851944, -0.07320906221866608, 0.01814085803925991, 0.10005918145179749, -0.16439063847064972, -0.045509740710258484, -0.027259599417448044, -0.09368730336427689, 0.08555938303470612, 0.4460492432117462, -0.2226058840751648, -0.29612088203430176, 0.26730209589004517, 0.31920677423477173, -0.13399456441402435, -0.042532552033662796, 0.1769598424434662, 0.680789589881897, -0.2670704126358032, 0.2139025628566742, 0.02269531600177288, 0.2699960470199585, -0.019995588809251785, 0.03854185342788696, -0.0019550584256649017, -0.08917791396379471, -0.004999876022338867, -0.0033842548727989197, -0.46680402755737305, 0.06790437549352646, 0.03489420935511589, 0.06758474558591843, 0.14400914311408997, -0.026295267045497894, 0.09222590923309326, 0.013848795555531979, -0.22507691383361816, 0.18675139546394348, 0.08991649746894836, -0.10230523347854614, 0.34934258460998535, -0.0491614043712616, -0.18234772980213165, -0.12584760785102844, 0.0039214324206113815, 0.10217810422182083, -0.07737219333648682, -0.09477203339338303, -0.14719314873218536, 0.16263094544410706, -0.008685439825057983, -0.007926370948553085, 0.09389577060937881, 0.03284658491611481, -0.08559289574623108, -0.36089199781417847, 0.3146432340145111, 0.47143131494522095, 0.051143646240234375, 0.20289896428585052, 0.05306677520275116, 0.18263384699821472, -0.1342226266860962, -0.09789031744003296, 0.24915601313114166, 0.4318426251411438, -0.032407358288764954, 0.09903347492218018, -0.04547911137342453, -0.11233919858932495, 0.015707507729530334, 0.29544347524642944, 0.3378199338912964, -0.17771539092063904, 0.3605605363845825, 0.018015749752521515, 0.06023796275258064, -0.07705952227115631, 0.3005370795726776, 0.26174741983413696, -0.07918218523263931, 0.4599192440509796, 0.0994478389620781, -0.06209523230791092, -0.18559464812278748, -0.0933324545621872, 0.08861483633518219, -0.10466808825731277, -0.13506045937538147, 0.07230852544307709, -0.1715768724679947, 0.26686015725135803, 0.015479102730751038, -0.24068555235862732, 0.32815951108932495, -0.020108822733163834, 0.026033634319901466, 0.2862939238548279, 0.30842626094818115, -0.021404188126325607, 0.3119531273841858, 0.33192190527915955, 0.3104405105113983, 0.22094349563121796, -0.004579491913318634, 0.5635327100753784, -0.10193101316690445, 0.19474710524082184, 0.670450747013092, -0.21907511353492737, -0.24781100451946259, 0.1269562840461731, 0.19320857524871826, 0.21752658486366272, -0.08486917614936829, 0.555180549621582, -0.22064392268657684, -0.3022666871547699, 0.08973175287246704, 0.5321159362792969, 0.058625586330890656, -0.3590278625488281, -0.11790018528699875, -0.12408766150474548, -0.12699845433235168, 0.016948942095041275, -0.1898343563079834, -0.5323442220687866, 0.19370605051517487, -0.052426114678382874, 0.12780489027500153, -0.08781556040048599, 0.09667044878005981, 0.09227444231510162, 0.06159259006381035, -0.05173095688223839, -0.18199719488620758, 0.2557850480079651, -0.1369929164648056, 0.1618497371673584, 0.23538033664226532, 0.42252451181411743, 0.11572666466236115, -0.19766640663146973, 0.2711772620677948, -0.05086822435259819, -0.2378547638654709, 0.10777884721755981, 0.1368153989315033, -0.11669774353504181, -0.08701086044311523, 0.24770401418209076, 0.09163215756416321, 0.055215537548065186, -0.20574267208576202, -0.07960981130599976, 0.43998849391937256, -0.16646654903888702, 0.28355446457862854, -0.5902944803237915, -0.14652353525161743, -0.3601093888282776, -0.008893512189388275, -0.4925193190574646, -0.22028984129428864, 0.14994056522846222, 0.16917824745178223, -0.037104539573192596, -0.1356583535671234, 0.02704285830259323, 0.16333426535129547, 0.2819165289402008, 0.24319733679294586, 0.27109795808792114, -0.0995500236749649, -0.33633294701576233, -0.48351365327835083, -0.06951921433210373, 0.24695275723934174, 0.18156349658966064, -0.10296814888715744, -0.0349024273455143, 0.12891651690006256, 0.2056317776441574, -0.33129340410232544, 0.16269348561763763, 0.14600901305675507, 0.26207876205444336, 0.08790576457977295, -0.3321869969367981, -0.043499819934368134, 0.04476700723171234, 0.09532874822616577, -0.02728915959596634, 0.17097054421901703, -0.06901201605796814, -0.0904930979013443, -0.2614338994026184, 0.38199394941329956, -0.016078829765319824, 0.11831255257129669, 0.08172255009412766, 0.2500001788139343, 0.2759065628051758, -0.06619678437709808, -0.16458088159561157, 0.04941997304558754, 0.19513632357120514, -0.10593032091856003, 0.43726110458374023, -0.1715012788772583, 0.21424725651741028, -0.15645021200180054, -0.3427349627017975, -0.3978395462036133, 0.2863159477710724, 0.13386116921901703, -0.06766015291213989, -0.3701038658618927, 0.3420228362083435, -0.1629394292831421, -0.12407733500003815, 0.340965211391449, 0.3829444348812103, -0.1716744750738144, 0.26507750153541565, -0.2579079568386078, 0.17577777802944183, 0.6455247402191162, -0.24641473591327667, -0.09486092627048492, 0.07576436549425125, -0.12364870309829712, 0.35096535086631775, -0.5148870944976807, -0.5934816002845764, 0.10508685559034348, 0.07870397716760635, -0.06688713282346725, 0.14130137860774994, 0.11396655440330505, -0.11009983718395233, -0.04734615236520767, -0.17243066430091858, 0.36648690700531006, 0.3724914491176605, 0.1305914968252182, 0.1345183104276657, -0.12331996113061905 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
> Hi ! Right now generator functions are expected to be picklable, so that `datasets` can hash it and use the hash to cache the resulting Dataset on disk. Maybe this can be improved. > > In the meantime, can you check that you're not using unpickable objects. In your case it looks like you're using a generator object that is unpickable. It might come from an opened file, e.g. this doesn't work: > > ```python > with open(...) as f: > > def gen(): > for x in f: > yield json.loads(x) > > ds = Dataset.from_generator(gen) > ``` > > but this does work: > > ```python > def gen(): > with open(...) as f: > for x in f: > yield json.loads(x) > > ds = Dataset.from_generator(gen) > ``` Thanks a lot! That's the reason why I have encountered this issue. Sorry for bothering you again with another problem, since my dataset is large and I use IterableDataset.from_generator which has no attribute with_transform, how can I equip it with some customed preprocessings like Dataset.from_generator? Should I move the preprocessing to the my torch Dataset?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
187
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. > Hi ! Right now generator functions are expected to be picklable, so that `datasets` can hash it and use the hash to cache the resulting Dataset on disk. Maybe this can be improved. > > In the meantime, can you check that you're not using unpickable objects. In your case it looks like you're using a generator object that is unpickable. It might come from an opened file, e.g. this doesn't work: > > ```python > with open(...) as f: > > def gen(): > for x in f: > yield json.loads(x) > > ds = Dataset.from_generator(gen) > ``` > > but this does work: > > ```python > def gen(): > with open(...) as f: > for x in f: > yield json.loads(x) > > ds = Dataset.from_generator(gen) > ``` Thanks a lot! That's the reason why I have encountered this issue. Sorry for bothering you again with another problem, since my dataset is large and I use IterableDataset.from_generator which has no attribute with_transform, how can I equip it with some customed preprocessings like Dataset.from_generator? Should I move the preprocessing to the my torch Dataset?
[ -0.09438610821962357, -0.3931623697280884, 0.026491589844226837, 0.3118780851364136, 0.5127153396606445, 0.18641862273216248, -0.0444369800388813, 0.16245687007904053, -0.08811716735363007, 0.07791347801685333, -0.13433510065078735, 0.2247636914253235, -0.2620982229709625, -0.02295638807117939, 0.11843708902597427, -0.32393261790275574, 0.33590230345726013, -0.11212824285030365, -0.4799581468105316, 0.09835675358772278, -0.3462381958961487, 0.38024502992630005, 0.08487938344478607, -0.0037965774536132812, -0.0737239345908165, 0.12076006084680557, -0.023469869047403336, 0.17495107650756836, -0.19580982625484467, -0.14603261649608612, 0.2898203730583191, 0.11368268728256226, 0.050943970680236816, 0.6127122640609741, -0.0001217773460666649, -0.028174463659524918, 0.04292043671011925, -0.19507700204849243, -0.04056605324149132, -0.28212279081344604, 0.3575069308280945, -0.1096099317073822, 0.03185725212097168, 0.023675397038459778, -0.37887293100357056, -0.21878963708877563, -0.110136479139328, -0.5352905988693237, 0.3821027874946594, 0.2985555827617645, 0.12213790416717529, 0.21445994079113007, 0.43182316422462463, -0.009390351362526417, 0.024059098213911057, 0.4686611294746399, -0.22558686137199402, 0.023970583453774452, 0.2750244140625, 0.23056107759475708, 0.2696007490158081, 0.19895349442958832, -0.20631466805934906, -0.21904303133487701, 0.7280876040458679, -0.10112284123897552, -0.535723865032196, -0.4108287990093231, 0.14299452304840088, 0.19083207845687866, 0.26362308859825134, -0.4102730453014374, -0.43125689029693604, -0.2225031554698944, 0.07792070508003235, -0.01876630261540413, -0.08659305423498154, 0.18664996325969696, -0.2119256556034088, 0.1270774006843567, -0.44701915979385376, -0.4482952654361725, -0.18196861445903778, -0.12251268327236176, 0.08860760927200317, 0.0029722601175308228, -0.3041538596153259, 0.114855095744133, 0.3504846394062042, -0.2733203172683716, 0.0834486111998558, -0.17186063528060913, 0.09647403657436371, 0.17355814576148987, 0.007958520203828812, -0.008029758930206299, -0.24194791913032532, 0.3800128698348999, 0.43373677134513855, 0.2532286047935486, 0.011623561382293701, -0.03760462999343872, -0.12282652407884598, -0.04324460029602051, 0.04949181526899338, -0.023461606353521347, 0.026706043630838394, 0.03746499493718147, -0.05520161986351013, 0.04117460921406746, 0.06512525677680969, 0.02271224744617939, -0.06377538293600082, -0.46843913197517395, -0.04437900334596634, 0.10977000743150711, 0.2984432578086853, -0.2665483057498932, 0.03013462759554386, -0.30012333393096924, 0.06884650141000748, 0.1388455331325531, 0.019374659284949303, 0.20846349000930786, -0.032548755407333374, 0.15164750814437866, 0.28011882305145264, 0.2513135075569153, -0.0630197823047638, -0.31380394101142883, -0.025815721601247787, 0.03693306818604469, -0.08882926404476166, 0.09416121989488602, -0.047024309635162354, -0.5679954290390015, 0.05253104865550995, 0.056043609976768494, 0.03977470099925995, 0.10421286523342133, -0.10645771026611328, 0.1784098595380783, 0.44813811779022217, 0.07608968764543533, -0.010940518230199814, 0.1840507686138153, 0.2843698561191559, 0.052894726395606995, -0.3917296528816223, -0.019269101321697235, -0.13536995649337769, -0.21303550899028778, -0.18764598667621613, 0.007727050222456455, -0.2319294661283493, 0.010300656780600548, -0.27366214990615845, 0.1663467437028885, 0.06384451687335968, -0.03322332724928856, 0.09360627830028534, -0.07809705287218094, -0.23805776238441467, -0.2839142084121704, 0.42933550477027893, 0.5105403065681458, -0.2941257953643799, -0.19278018176555634, 0.06679800897836685, -0.36297765374183655, -0.02915596216917038, 0.1915867179632187, 0.10169818997383118, -0.011878728866577148, -0.3210911750793457, -0.4259243607521057, 0.07145902514457703, -0.2627638876438141, -0.19019615650177002, 0.20114567875862122, 0.05695025622844696, 0.32018977403640747, 0.008143201470375061, 0.07015684247016907, -0.1865110695362091, -0.2049287110567093, 0.06977296620607376, 0.18832048773765564, -0.1621398776769638, -0.1221652701497078, -0.051615722477436066, -0.16846664249897003, 0.3647710084915161, -0.06229672208428383, -0.14825139939785004, 0.35247108340263367, -0.2921355366706848, -0.17559345066547394, 0.09351999312639236, -0.24701768159866333, 0.22431118786334991, 0.29664039611816406, -0.015407498925924301, 0.24075990915298462, -0.004687550477683544, 0.014653138816356659, -0.4566653370857239, 0.018294695764780045, 0.00984293594956398, -0.037540502846241, -0.21566511690616608, -0.23322205245494843, -0.08124326169490814, 0.1088012084364891, -0.17852534353733063, -0.1353704035282135, -0.010923733934760094, 0.013865925371646881, 0.4756906032562256, -0.2238965779542923, -0.27567580342292786, 0.27634376287460327, 0.016701458021998405, 0.22796699404716492, -0.8589379191398621, 0.02813771925866604, 0.15911276638507843, -0.12222245335578918, 0.18756046891212463, 0.3163296580314636, 0.15003781020641327, -0.16492915153503418, 0.052931636571884155, 0.13861840963363647, -0.08318611234426498, 0.1980801522731781, -0.10319913178682327, 0.17757360637187958, 0.02459067292511463, -0.19988484680652618, 0.02436467818915844, 0.24059729278087616, 0.028966762125492096, -0.0043363869190216064, -0.16950556635856628, 0.48423486948013306, -0.17557018995285034, 0.4402965009212494, -0.028615590184926987, 0.19635805487632751, 0.10786600410938263, 0.11973714828491211, -0.1740027368068695, 0.04816422611474991, -0.09082247316837311, -0.02699621394276619, 0.45488986372947693, 0.1370071917772293, -0.518601655960083, 0.14441384375095367, 0.22398152947425842, -0.14647755026817322, -0.050780460238456726, 0.1596963107585907, -0.3750118315219879, -0.00420270673930645, 0.13147029280662537, -0.21912114322185516, 0.3296172320842743, 0.1574839949607849, 0.24079453945159912, 0.23709918558597565, 0.24785879254341125, -0.020603960379958153, 0.144194096326828, -0.0019915103912353516, 0.04472975432872772, -0.17746683955192566, -0.0788150280714035, -0.05182564631104469, -0.09744401276111603, 0.16491976380348206, -0.3034990727901459, 0.01581510715186596, -0.4789513945579529, 0.1840662807226181, -0.29587018489837646, -0.0855371356010437, -0.3941890001296997, -0.14939238131046295, -0.3315739631652832, -0.2177671641111374, -0.1273943930864334, 0.18302513659000397, 0.11220687627792358, -0.057757019996643066, 0.3179265260696411, -0.012561455368995667, -0.024302594363689423, -0.317997545003891, -0.38003823161125183, -0.20451579988002777, -0.1397666037082672, -0.036459505558013916, 0.2862015962600708, -0.17682740092277527, 0.29874181747436523, -0.29914411902427673, 0.2826682925224304, -0.5499352216720581, -0.03204934298992157, 0.11817590892314911, -0.2910075783729553, 0.18661190569400787, 0.32440435886383057, 0.11040723323822021, 0.2684212327003479, -0.04736192896962166, 0.1935829520225525, -0.21810884773731232, -0.2061319798231125, -0.05503679811954498, -0.31522130966186523, 0.05258552357554436, 0.01701110228896141, -0.02722223848104477, -0.26830005645751953, -0.17060433328151703, 0.43492037057876587, 0.025193486362695694, -0.046028926968574524, -0.089842289686203, 0.3206127882003784, 0.05040982738137245, -0.025491105392575264, 0.1250670999288559, -0.04917244613170624, -0.7298888564109802, 0.622506320476532, -0.29696860909461975, -0.46589574217796326, 0.16993099451065063, 0.09837771952152252, 0.3136385977268219, 0.19671235978603363, -0.08481555432081223, 0.052561935037374496, -0.05953766405582428, 0.15382994711399078, 0.020423786714673042, 0.16483265161514282, 0.18796122074127197, 0.15303625166416168, 0.10645772516727448, -0.11311226338148117, -0.07140009850263596, -0.06508175283670425, -0.4381214678287506, 0.2789807617664337, 0.26790493726730347, 0.23750609159469604, -0.1502436101436615, 0.6220689415931702, 0.2915818393230438, -0.31964296102523804, 0.2045656144618988, -0.12842540442943573, 0.3884933590888977, -0.13206425309181213, -0.5175110697746277, 0.06129777804017067, -0.2579957842826843, 0.2565205693244934, 0.020048193633556366, 0.13566379249095917, 0.4124715030193329, -0.21453946828842163, -0.028025958687067032, -0.24276137351989746, -0.33122938871383667, -0.015088928863406181, -0.11888520419597626, 0.11747778952121735, -0.1795804500579834, 0.15235626697540283, -0.29659631848335266, -0.07647744566202164, 0.3051777780056, 0.3192110061645508, 0.49363142251968384, 0.26950517296791077, -0.34459590911865234, -0.11361458152532578, -0.5362507700920105, 0.39168864488601685, -0.02594778686761856, -0.0994916707277298, -0.03332896530628204, -0.01935519278049469, -0.00009866058826446533, -0.02353418618440628, 0.7620623111724854, 0.06358674168586731, -0.3709293603897095, 0.07589279115200043, -0.3310213088989258, -0.5001239776611328, 0.25128987431526184, 0.17010174691677094, 0.2811598777770996, 0.05105718970298767, 0.2396654188632965, -0.3704785406589508, -0.43325963616371155, 0.09109295904636383, 0.4038781225681305, -0.21255871653556824, -0.022013593465089798, -0.19339758157730103, -0.3796984851360321, -0.24644310772418976, -0.2612699866294861, 0.034157074987888336, 0.14991798996925354, -0.1293315291404724, -0.05973724275827408, -0.26611608266830444, -0.043030329048633575, 0.3132462501525879, -0.13130103051662445, 0.2558613717556, -0.14137570559978485, 0.0027450360357761383, 0.376947820186615, 0.3034822344779968, 0.3161619305610657, 0.49420514702796936, -0.059408027678728104, -0.3199751079082489, -0.12287601083517075, 0.3122134208679199, 0.35208871960639954, 0.13626070320606232, -0.09861026704311371, 0.12482200562953949, -0.09803197532892227, 0.08531195670366287, -0.427752822637558, -0.08071690797805786, 0.23230642080307007, 0.12382271140813828, -0.3120400309562683, -0.5078940391540527, 0.4740092158317566, 0.32915961742401123, 0.17101792991161346, 0.2063051462173462, 0.5774104595184326, -0.1997087150812149, -0.0034887685906141996, 0.22645998001098633, 1.0878839492797852, -0.21850194036960602, 0.09454602748155594, 0.09933099895715714, -0.22239145636558533, 0.7676223516464233, -0.05508074909448624, -0.09033358842134476, -0.3494274914264679, -0.006476930342614651, -0.0828174352645874, -0.029637014493346214, 0.30414846539497375, 0.21045975387096405, -0.2090732753276825, 0.3384726345539093, -0.16537973284721375, -0.0024701394140720367, -0.0846562534570694, 0.14552059769630432, -0.18646083772182465, -0.3689119815826416, -0.33261382579803467, 0.07795798033475876, -0.06069415807723999, 0.46308013796806335, 0.11409037560224533, -0.29074347019195557, -0.12615947425365448, 0.16488289833068848, -0.08533284068107605, 0.0730150043964386, -0.29813262820243835, -0.17965106666088104, 0.4241465628147125, -0.5242958664894104, 0.34810686111450195, 0.5470259785652161, 0.6122761964797974, -0.029895398765802383, -0.2965388298034668, 0.04584364965558052, -0.10354796797037125, -0.11221446096897125, -0.22272901237010956, 0.025771107524633408, 0.29182299971580505, 0.04725547879934311, 0.020022518932819366, 0.09546573460102081, 0.028479989618062973, -0.0572831928730011, -0.31461936235427856, -0.29058170318603516, 0.02663791924715042, -0.3890446424484253, -0.33013054728507996, 0.11629801988601685, 0.20064261555671692, -0.09491928666830063, 0.024204924702644348, 0.10439440608024597, -0.20659029483795166, -0.009635165333747864, -0.08073750138282776, -0.10589173436164856, 0.060919828712940216, 0.3772626519203186, -0.22517263889312744, -0.31371593475341797, 0.3798813819885254, 0.33682775497436523, -0.10223475098609924, -0.021255752071738243, 0.11406818777322769, 0.7167390584945679, -0.4095374643802643, 0.21473972499370575, 0.04538971930742264, 0.225444957613945, -0.07436929643154144, 0.10991965234279633, 0.01948077231645584, -0.17100456357002258, -0.017407037317752838, 0.038491494953632355, -0.5438387393951416, 0.015371061861515045, 0.0675966814160347, 0.14024560153484344, 0.126432865858078, -0.041755180805921555, 0.03907131403684616, 0.12785488367080688, -0.22638505697250366, 0.08795415610074997, 0.057399675250053406, -0.04709085822105408, 0.3491593599319458, -0.03480666130781174, -0.14484156668186188, -0.0814676284790039, -0.00485147163271904, 0.11884807050228119, -0.06448118388652802, -0.11705341935157776, -0.18493634462356567, 0.1667906641960144, -0.05762980878353119, -0.12134987860918045, 0.1350414901971817, 0.05533004552125931, -0.09897056221961975, -0.42010578513145447, 0.34952932596206665, 0.36873239278793335, 0.10404165834188461, 0.15893353521823883, 0.10363276302814484, 0.17920611798763275, -0.20568996667861938, -0.062298551201820374, 0.20843283832073212, 0.4216759204864502, -0.006805116310715675, 0.09783126413822174, -0.051468510180711746, -0.19615091383457184, 0.01220009382814169, 0.25588372349739075, 0.4725342392921448, -0.1788851022720337, 0.3984794020652771, 0.06922298669815063, 0.05998735502362251, 0.06593077629804611, 0.20570985972881317, 0.2663206458091736, -0.0650586187839508, 0.407478392124176, 0.15047591924667358, -0.04860740900039673, -0.18758930265903473, -0.05674058571457863, 0.028888005763292313, -0.16528087854385376, -0.09921068698167801, 0.15142373740673065, -0.11011922359466553, 0.3087404668331146, 0.08955925703048706, -0.16350704431533813, 0.3392152488231659, -0.004401424899697304, 0.022064510732889175, 0.2506394386291504, 0.29521453380584717, -0.007419724017381668, 0.3258195221424103, 0.32675209641456604, 0.31853389739990234, 0.18558475375175476, -0.003289170563220978, 0.6277405619621277, -0.03494048863649368, 0.20783765614032745, 0.6257903575897217, -0.3612305223941803, -0.23525576293468475, 0.02079176902770996, 0.2917670011520386, 0.21998751163482666, -0.1044142097234726, 0.5164653062820435, -0.119424007833004, -0.2618008553981781, 0.15452978014945984, 0.5863860249519348, 0.09288299083709717, -0.3764597773551941, -0.13835270702838898, -0.11408489942550659, -0.13792698085308075, 0.015091974288225174, -0.1468990296125412, -0.5292438268661499, 0.2373615950345993, -0.06459268927574158, 0.12085264921188354, -0.10241392999887466, 0.16209137439727783, 0.09479115903377533, 0.10335220396518707, -0.06778990477323532, -0.07465562224388123, 0.2867315411567688, -0.17777535319328308, 0.1716597080230713, 0.24716909229755402, 0.4240559935569763, 0.17858384549617767, -0.27125486731529236, 0.2826346457004547, -0.032134488224983215, -0.21874527633190155, 0.11128519475460052, 0.18909046053886414, -0.24568501114845276, -0.02330935001373291, 0.2866024971008301, 0.05592494457960129, 0.04387526214122772, -0.22813983261585236, -0.07295744121074677, 0.4232448935508728, -0.1853954792022705, 0.34039533138275146, -0.4712367355823517, -0.1824779063463211, -0.3394795358181, 0.00216694176197052, -0.39861205220222473, -0.2292884737253189, 0.22163082659244537, 0.0832580029964447, -0.026525288820266724, -0.11323901265859604, 0.027332358062267303, 0.18807362020015717, 0.36323899030685425, 0.2360987663269043, 0.2667818069458008, -0.13726122677326202, -0.3477296233177185, -0.44298622012138367, -0.07497399300336838, 0.3048999309539795, 0.19605737924575806, -0.06732318550348282, -0.04030241072177887, 0.09041723608970642, 0.2123166024684906, -0.2982023358345032, -0.0361669585108757, 0.2188081443309784, 0.3634769320487976, 0.07007935643196106, -0.3755216896533966, -0.09040310978889465, 0.09601730853319168, 0.10795858502388, -0.06020764261484146, 0.06256172806024551, 0.019002124667167664, -0.09273196756839752, -0.20499488711357117, 0.2809281647205353, 0.03757466748356819, 0.11550915241241455, 0.08257884532213211, 0.25305840373039246, 0.24941463768482208, -0.09649775922298431, -0.10185312479734421, -0.005848977714776993, 0.17702823877334595, -0.17550218105316162, 0.48040908575057983, -0.11277051270008087, 0.17499735951423645, -0.12558984756469727, -0.3713432252407074, -0.4318268299102783, 0.214352548122406, 0.11051908135414124, -0.054701581597328186, -0.39198580384254456, 0.3105880618095398, -0.16595801711082458, -0.09614664316177368, 0.3979147672653198, 0.37447935342788696, -0.14049874246120453, 0.2981824576854706, -0.3595094084739685, 0.0729132890701294, 0.6404595375061035, -0.21887679398059845, -0.19143623113632202, 0.10778209567070007, -0.15824297070503235, 0.3188967704772949, -0.44335412979125977, -0.5637413859367371, 0.10082022100687027, 0.14212097227573395, -0.10861065238714218, 0.16892683506011963, 0.15986110270023346, -0.12478280067443848, -0.0786254033446312, -0.17972305417060852, 0.40480756759643555, 0.33433306217193604, 0.15092630684375763, 0.04065747186541557, -0.17845113575458527 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
Iterable datasets are lazy: exactly like `with_transform` they apply processing on the fly when accessing the examples. Therefore you can use `my_iterable_dataset.map()` instead :)
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
24
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. Iterable datasets are lazy: exactly like `with_transform` they apply processing on the fly when accessing the examples. Therefore you can use `my_iterable_dataset.map()` instead :)
[ -0.11331331729888916, -0.479759156703949, -0.03749573975801468, 0.2601988911628723, 0.41514891386032104, 0.2749333679676056, -0.10213667154312134, 0.17766529321670532, -0.06663209199905396, 0.10247629135847092, -0.25149497389793396, 0.20491456985473633, -0.3743201196193695, 0.11022628098726273, 0.0669008269906044, -0.26213544607162476, 0.3725385367870331, -0.11716768145561218, -0.44591882824897766, 0.04400132596492767, -0.2635263502597809, 0.31388959288597107, -0.0005708709359169006, -0.09059010446071625, 0.05040912702679634, 0.06644367426633835, -0.2163563072681427, 0.0505903922021389, -0.13420681655406952, -0.17316126823425293, 0.477886438369751, 0.04704738408327103, 0.2263088971376419, 0.5825064778327942, -0.00012494888505898416, -0.07322436571121216, -0.07900620996952057, -0.21042446792125702, -0.00927031971514225, -0.27138251066207886, 0.20747032761573792, -0.109474778175354, 0.18539221584796906, -0.046455249190330505, -0.329885870218277, -0.183893084526062, 0.014912278391420841, -0.42501726746559143, 0.3456220328807831, 0.23826910555362701, 0.08611278235912323, 0.16707462072372437, 0.3205668032169342, -0.03700283169746399, -0.018522538244724274, 0.4737647771835327, -0.198229119181633, 0.11102402210235596, 0.26872438192367554, 0.2130679190158844, 0.31302452087402344, 0.12049177289009094, -0.16704481840133667, -0.22205780446529388, 0.5625836849212646, -0.05981709808111191, -0.45576751232147217, -0.3783242404460907, 0.01833055168390274, 0.2534085214138031, 0.36115384101867676, -0.37286698818206787, -0.444164901971817, -0.162410169839859, 0.055800970643758774, 0.03863108903169632, -0.2728603184223175, 0.25647133588790894, -0.07207310199737549, 0.07319425791501999, -0.4087870419025421, -0.4077428877353668, -0.11505155265331268, 0.02329118549823761, -0.018286585807800293, 0.14497476816177368, -0.32802093029022217, 0.12670236825942993, 0.36868587136268616, -0.37746596336364746, 0.079698346555233, -0.05677635967731476, 0.18286347389221191, 0.2187037467956543, -0.040205638855695724, -0.07592262327671051, -0.25493261218070984, 0.4223625063896179, 0.46890127658843994, 0.157609224319458, -0.06871800869703293, -0.0748678520321846, -0.15143965184688568, -0.042291440069675446, 0.18079647421836853, -0.06668537110090256, 0.030141152441501617, 0.127690851688385, -0.016864262521266937, 0.0006842159200459719, 0.13827677071094513, 0.08937285095453262, -0.04465162009000778, -0.31851091980934143, -0.18860383331775665, -0.10263276845216751, 0.42005133628845215, -0.18562528491020203, -0.16327828168869019, -0.2365894466638565, -0.051312077790498734, 0.18410426378250122, 0.03363589942455292, 0.13812929391860962, 0.06583206355571747, 0.06663951277732849, 0.19705797731876373, 0.25243091583251953, 0.01700739748775959, -0.09501821547746658, -0.02428612858057022, 0.0873742401599884, -0.02566704712808132, 0.048316530883312225, -0.052484698593616486, -0.5898650288581848, 0.008439167402684689, 0.12403709441423416, 0.057263754308223724, 0.17089508473873138, -0.22267566621303558, 0.1860983967781067, 0.5109420418739319, 0.06034156680107117, 0.04912305995821953, 0.1397520899772644, 0.3192272186279297, 0.0009432137012481689, -0.4066857099533081, -0.09588884562253952, -0.24198481440544128, 0.041704852133989334, -0.21831509470939636, -0.0333421491086483, -0.12562385201454163, -0.14929254353046417, -0.21679547429084778, 0.25894615054130554, -0.001476980745792389, -0.1471918672323227, 0.24757468700408936, -0.20047351717948914, -0.2239747792482376, -0.26259884238243103, 0.35793906450271606, 0.47192466259002686, -0.1849595010280609, -0.24788661301136017, 0.26343363523483276, -0.3490820527076721, -0.08736804872751236, 0.24405048787593842, 0.15427473187446594, -0.18513157963752747, -0.4025956690311432, -0.28403401374816895, 0.05413801968097687, -0.31525281071662903, -0.07963970303535461, 0.2587263584136963, 0.08727550506591797, 0.22648294270038605, -0.18783578276634216, 0.19040563702583313, -0.115088552236557, -0.15086817741394043, -0.11503331363201141, 0.051931194961071014, -0.16130366921424866, -0.20729470252990723, 0.11000306904315948, -0.12580782175064087, 0.5350668430328369, -0.16235077381134033, -0.1431649923324585, 0.2687988579273224, -0.18411388993263245, -0.14001913368701935, 0.25912243127822876, -0.17124086618423462, 0.16302749514579773, 0.26949751377105713, 0.12120306491851807, 0.2957989573478699, 0.03519846871495247, -0.1391303539276123, -0.30470263957977295, 0.003760676831007004, 0.22924679517745972, -0.13255931437015533, -0.07203391194343567, -0.2800831198692322, -0.03509750962257385, 0.12239768356084824, -0.09711252152919769, -0.053010378032922745, -0.01995702087879181, -0.050361499190330505, 0.3968638479709625, -0.20056119561195374, -0.379462331533432, 0.36516520380973816, -0.06329496949911118, 0.24740812182426453, -0.7736752033233643, 0.09529800713062286, 0.33227869868278503, -0.023444093763828278, 0.2045237272977829, 0.39309507608413696, 0.12004329264163971, -0.25029313564300537, 0.15965542197227478, 0.17224857211112976, 0.0092238774523139, 0.1923932284116745, 0.0005030930042266846, 0.21318304538726807, 0.09124350547790527, -0.24877585470676422, -0.01981891505420208, 0.33471250534057617, 0.08621148020029068, -0.0739549994468689, -0.37170812487602234, 0.4897223114967346, -0.1360202580690384, 0.4753628671169281, 0.026159927248954773, 0.30944982171058655, 0.047157205641269684, 0.16822779178619385, -0.33411869406700134, 0.06906205415725708, -0.1229269951581955, -0.24484343826770782, 0.4626058340072632, -0.014120331034064293, -0.5509276390075684, 0.004428662359714508, 0.1184525340795517, -0.18282540142536163, 0.03668192774057388, 0.08441445231437683, -0.38108357787132263, 0.04706417769193649, 0.21520282328128815, -0.30420055985450745, 0.3071337640285492, 0.09338107705116272, 0.33273062109947205, 0.2466038316488266, 0.20219208300113678, 0.10381023585796356, 0.11161439120769501, 0.074494369328022, 0.038337983191013336, -0.2982670068740845, -0.09392762929201126, -0.012721036560833454, -0.17863720655441284, 0.13262544572353363, -0.4189037084579468, -0.026488756760954857, -0.4286006987094879, 0.11995133012533188, -0.3498682677745819, -0.24785399436950684, -0.4394318163394928, -0.19061064720153809, -0.2630453109741211, -0.35500940680503845, -0.29924023151397705, 0.16109272837638855, 0.18092592060565948, -0.08788610249757767, 0.1703415960073471, -0.009953394532203674, 0.05102543532848358, -0.2622130513191223, -0.28971171379089355, -0.2065548449754715, -0.03652193397283554, -0.018278848379850388, 0.20289820432662964, -0.14957135915756226, 0.26190507411956787, -0.35132160782814026, 0.2547808885574341, -0.6794359087944031, -0.19026947021484375, 0.10536923259496689, -0.2868233919143677, -0.10126712918281555, 0.42229071259498596, 0.18686029314994812, 0.09724268317222595, -0.010475320741534233, 0.10007403045892715, -0.30820462107658386, -0.17267270386219025, -0.12517158687114716, -0.3405352532863617, 0.012227457016706467, 0.09888556599617004, 0.0704604983329773, -0.3027269244194031, -0.029442964121699333, 0.5327218770980835, 0.05300566926598549, -0.08238762617111206, -0.13082969188690186, 0.17959529161453247, 0.12850621342658997, -0.1880839765071869, 0.01003170758485794, -0.058077648282051086, -0.5118827819824219, 0.512056291103363, -0.23662900924682617, -0.43762242794036865, 0.22715234756469727, 0.1370466947555542, 0.2702844440937042, 0.1367027312517166, -0.11543865501880646, 0.004875642247498035, -0.04065575450658798, 0.12462332844734192, 0.04648994654417038, 0.20623375475406647, 0.19079245626926422, -0.004217871930450201, 0.1353505253791809, -0.12844863533973694, 0.001268303021788597, -0.15232476592063904, -0.19791081547737122, 0.22337572276592255, 0.18446072936058044, 0.1730751395225525, -0.01705014519393444, 0.4215514063835144, 0.47607219219207764, -0.18858736753463745, 0.13361069560050964, -0.2748206555843353, 0.452315092086792, 0.047199103981256485, -0.44360607862472534, 0.141363263130188, -0.22899633646011353, 0.225098118185997, 0.14757376909255981, 0.14558973908424377, 0.26817116141319275, -0.1585991233587265, -0.14731670916080475, -0.11755260825157166, -0.2686466872692108, -0.2001946121454239, -0.17574726045131683, 0.10707244277000427, -0.15121658146381378, 0.08127380162477493, -0.12801679968833923, -0.08042916655540466, 0.14343304932117462, 0.38053011894226074, 0.4165404736995697, 0.29357704520225525, -0.2644914984703064, -0.10796543210744858, -0.4875635504722595, 0.327003538608551, -0.06260356307029724, 0.04473275691270828, 0.0153009332716465, -0.1133611723780632, 0.054007697850465775, 0.05366848409175873, 0.7490770816802979, 0.27706629037857056, -0.4467505216598511, -0.06776869297027588, -0.31850969791412354, -0.5940678119659424, 0.17482277750968933, -0.03293595090508461, 0.46068671345710754, 0.112516388297081, 0.28009164333343506, -0.2843972146511078, -0.3511240780353546, 0.2004905790090561, 0.3348885178565979, -0.1247858852148056, 0.037703800946474075, -0.15202145278453827, -0.29726794362068176, -0.06960732489824295, -0.1185319647192955, 0.027895981445908546, 0.05607352778315544, -0.04650329798460007, -0.07269947230815887, -0.3565867245197296, -0.08635209500789642, 0.357080340385437, -0.1989710032939911, 0.15003979206085205, -0.016961412504315376, -0.04007602110505104, 0.3786875605583191, 0.390409916639328, 0.25065878033638, 0.4307939112186432, -0.06452430784702301, -0.3534621596336365, -0.03386177122592926, 0.3418952226638794, 0.5572558045387268, 0.12511418759822845, -0.0789761170744896, 0.05106629058718681, -0.01804627850651741, 0.027117591351270676, -0.4308217465877533, -0.2055061161518097, 0.2725312113761902, 0.2112240493297577, -0.44213220477104187, -0.3579661548137665, 0.48415979743003845, 0.36557117104530334, 0.2569717764854431, 0.05199863016605377, 0.6678876280784607, -0.1561790406703949, -0.10806731134653091, 0.14456701278686523, 0.9285491704940796, -0.14003393054008484, 0.151548832654953, 0.150147944688797, -0.12981092929840088, 0.7826668620109558, 0.04742209613323212, -0.10420306026935577, -0.22597023844718933, -0.07084830105304718, -0.23722290992736816, -0.03461784869432449, 0.22333556413650513, 0.1184607744216919, -0.21043939888477325, 0.43289151787757874, -0.0930308848619461, 0.2823847532272339, -0.07122768461704254, -0.002539210021495819, -0.2564409077167511, -0.16850021481513977, -0.2822805345058441, 0.08860621601343155, 0.05002393200993538, 0.4469926655292511, 0.1262545883655548, -0.24938489496707916, -0.07258045673370361, 0.15989764034748077, -0.12765130400657654, -0.03319625183939934, -0.28483596444129944, -0.13128814101219177, 0.3253393769264221, -0.6702380776405334, 0.2495669722557068, 0.5619663000106812, 0.5508753061294556, -0.10359874367713928, -0.39754539728164673, -0.06967021524906158, -0.09140092879533768, -0.15434645116329193, -0.2600701153278351, 0.03984018787741661, 0.1645214706659317, 0.2043100893497467, 0.17081406712532043, 0.036011554300785065, 0.14379067718982697, 0.009115785360336304, -0.28422290086746216, -0.06795506179332733, -0.0740213394165039, -0.41953209042549133, -0.3324989378452301, 0.26990795135498047, 0.19513092935085297, -0.05239417776465416, -0.022940192371606827, 0.06635086238384247, -0.1175275444984436, 0.004348397254943848, 0.1205330342054367, -0.12610208988189697, 0.05525125563144684, 0.40187638998031616, -0.21899694204330444, -0.2745034992694855, 0.23873454332351685, 0.28012335300445557, -0.11882400512695312, 0.0073938630521297455, 0.15377870202064514, 0.6213744878768921, -0.25314781069755554, 0.16831228137016296, -0.0940200686454773, 0.49664175510406494, -0.14425860345363617, 0.0004982948303222656, 0.009169559925794601, -0.1430170238018036, -0.12180253863334656, -0.09168417751789093, -0.36140063405036926, 0.12958557903766632, -0.012832514941692352, 0.1867906004190445, 0.07028688490390778, -0.004290394484996796, 0.00462806411087513, -0.11617250740528107, -0.17079481482505798, 0.13104985654354095, 0.02379288710653782, -0.10435140132904053, 0.4714462161064148, 0.09320865571498871, -0.1683865487575531, -0.05937980115413666, -0.04882984608411789, 0.1701791137456894, 0.09702681750059128, -0.10363159328699112, -0.07535979151725769, 0.18245524168014526, -0.025484386831521988, -0.024297142401337624, 0.11360687762498856, 0.05119699239730835, -0.19004982709884644, -0.4546140432357788, 0.24517300724983215, 0.39698946475982666, 0.09444598853588104, 0.2719200551509857, 0.15044815838336945, 0.07788428664207458, -0.055332958698272705, -0.022770989686250687, 0.3358752131462097, 0.3066537380218506, -0.08796510100364685, 0.1674492508172989, -0.09808693826198578, -0.07300695031881332, 0.12051686644554138, 0.3228769302368164, 0.5161280632019043, -0.33356717228889465, 0.2921266555786133, 0.13314810395240784, 0.06502029299736023, 0.10177109390497208, 0.3525333106517792, 0.38294610381126404, -0.098930224776268, 0.49659574031829834, 0.1573789417743683, -0.09839288145303726, -0.18847937881946564, -0.06332175433635712, 0.09043510258197784, -0.02674463391304016, -0.14906930923461914, 0.1933634877204895, -0.10093279182910919, 0.2820957899093628, 0.15341469645500183, -0.24544179439544678, 0.3145696520805359, -0.09123750030994415, 0.04768518730998039, 0.3063637614250183, 0.3286045789718628, -0.036303143948316574, 0.2531028985977173, 0.3903789818286896, 0.2532474398612976, 0.1498054414987564, -0.13257449865341187, 0.6026957035064697, 0.02687816321849823, 0.13540703058242798, 0.7840395569801331, -0.22658243775367737, -0.36854368448257446, -0.019240334630012512, 0.2633483409881592, 0.13827979564666748, -0.1025061160326004, 0.547737717628479, -0.20900139212608337, -0.22704659402370453, 0.06541337817907333, 0.49566197395324707, -0.014654658734798431, -0.35246050357818604, 0.03788544982671738, -0.11496703326702118, -0.10941097140312195, -0.029438963159918785, -0.2298494577407837, -0.634880542755127, 0.23874689638614655, -0.11398656666278839, 0.26368242502212524, -0.2288852334022522, 0.09581366926431656, 0.21421101689338684, 0.09037970006465912, -0.11498160660266876, -0.13311250507831573, 0.140020489692688, -0.10069270431995392, 0.08963853120803833, 0.31758978962898254, 0.4106396436691284, 0.0894559770822525, -0.20021437108516693, 0.346172571182251, -0.07569114863872528, -0.25066879391670227, 0.2220914214849472, 0.08557085692882538, -0.23081550002098083, -0.0026069432497024536, 0.3189714848995209, 0.041286811232566833, 0.16088975965976715, 0.014875669032335281, -0.15631669759750366, 0.388305127620697, -0.4261281192302704, 0.223663330078125, -0.5717380046844482, -0.08690325170755386, -0.33066225051879883, -0.005345344543457031, -0.3544006049633026, -0.23852583765983582, 0.12217900156974792, 0.02337341010570526, 0.017788764089345932, 0.028937872499227524, -0.005811935290694237, 0.05977742746472359, 0.28488025069236755, 0.24978937208652496, 0.34981951117515564, -0.09655875712633133, -0.3646323084831238, -0.4200139045715332, -0.17696842551231384, 0.27809152007102966, 0.15425768494606018, -0.07073768228292465, 0.0014974568039178848, 0.0382976271212101, 0.22885200381278992, -0.16166715323925018, -0.07723632454872131, 0.16303159296512604, 0.21242880821228027, 0.232184037566185, -0.43043312430381775, -0.105579674243927, 0.06843994557857513, 0.13261550664901733, 0.04594815522432327, 0.10660767555236816, -0.08065958321094513, -0.1566237211227417, -0.19852523505687714, 0.30123454332351685, -0.04957940801978111, -0.0505085289478302, -0.02208840847015381, 0.19612154364585876, 0.25158727169036865, -0.0824509784579277, 0.02324610762298107, -0.020426172763109207, 0.1206384152173996, -0.1639741063117981, 0.47577670216560364, -0.27451270818710327, 0.018602654337882996, -0.21635101735591888, -0.4690605700016022, -0.1561168134212494, 0.08548454195261002, 0.1828860342502594, -0.07937445491552353, -0.37725305557250977, 0.3159022629261017, -0.2571585178375244, -0.0897320955991745, 0.2682541310787201, 0.4200083911418915, -0.1938627064228058, 0.21564464271068573, -0.08109047263860703, 0.03862200677394867, 0.5459619760513306, -0.2969474792480469, -0.1046980619430542, 0.09289749711751938, -0.22409507632255554, 0.323515921831131, -0.43434926867485046, -0.5289894938468933, 0.040210358798503876, 0.18227411806583405, -0.041378915309906006, 0.137663796544075, 0.09445211291313171, -0.07728615403175354, -0.10585876554250717, -0.19713452458381653, 0.4696066975593567, 0.44284355640411377, 0.05222800374031067, 0.0891600102186203, -0.22473633289337158 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
@lhoestq I am having a similar issue. Can you help me understand which kinds of generators are picklable? I previously thought that no generators are picklable so I'm intrigued to hear this.
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
32
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. @lhoestq I am having a similar issue. Can you help me understand which kinds of generators are picklable? I previously thought that no generators are picklable so I'm intrigued to hear this.
[ -0.029847342520952225, -0.441574364900589, 0.004151489585638046, 0.3768763542175293, 0.4642128348350525, 0.056484661996364594, -0.05373628810048103, 0.011406544595956802, 0.0760452151298523, 0.14993195235729218, -0.24295395612716675, 0.3158925175666809, -0.4018261432647705, 0.23434089124202728, 0.16175703704357147, -0.22822439670562744, 0.36278897523880005, -0.16011208295822144, -0.317791610956192, -0.15831904113292694, -0.36927250027656555, 0.29073792695999146, -0.000680185854434967, 0.00036187469959259033, -0.20898087322711945, 0.15529479086399078, -0.019797343760728836, 0.1573581099510193, -0.2981354892253876, -0.08967375755310059, 0.26979732513427734, 0.03836553543806076, 0.061333298683166504, 0.46436089277267456, -0.00012755070929415524, -0.17058411240577698, -0.02847551554441452, -0.25649040937423706, -0.09216003119945526, -0.3072354793548584, 0.2525895833969116, 0.12200196087360382, 0.022221600636839867, 0.05337951332330704, -0.24292287230491638, 0.01764392852783203, -0.00133594311773777, -0.4617059528827667, 0.28449857234954834, 0.32164397835731506, 0.08682511746883392, 0.33535847067832947, 0.38289541006088257, -0.04560958221554756, 0.18094086647033691, 0.4721171259880066, -0.2558835744857788, 0.13556955754756927, 0.2631787657737732, 0.24842432141304016, 0.335890531539917, 0.05733950808644295, -0.21349121630191803, -0.21556657552719116, 0.6974374055862427, -0.07050038129091263, -0.5429457426071167, -0.49355897307395935, 0.10949619114398956, 0.35043570399284363, 0.4191794991493225, -0.2958720326423645, -0.5352762937545776, -0.218082457780838, 0.08404925465583801, 0.029756968840956688, -0.07065340131521225, 0.4191157817840576, -0.32345089316368103, 0.04267876595258713, -0.30211302638053894, -0.5111191272735596, -0.1654236614704132, -0.14277197420597076, 0.24560591578483582, 0.17138653993606567, -0.2874700427055359, 0.11310778558254242, 0.4374951720237732, -0.2538939118385315, 0.009342660196125507, -0.12176816165447235, 0.22063474357128143, 0.19680586457252502, 0.15612587332725525, -0.009514324367046356, -0.3140714168548584, 0.47119826078414917, 0.31882667541503906, 0.16911190748214722, -0.17895236611366272, -0.052670784294605255, -0.3045046627521515, 0.10269409418106079, -0.04650545492768288, -0.22584499418735504, 0.2899114489555359, 0.19715112447738647, -0.011853598058223724, -0.2141873836517334, 0.1405271738767624, 0.12920832633972168, -0.1423606425523758, -0.35646453499794006, -0.2483263909816742, -0.1223142072558403, 0.18312014639377594, -0.1813499480485916, -0.13625678420066833, -0.29762402176856995, -0.03710310906171799, 0.03822299838066101, -0.022914119064807892, 0.2509996294975281, 0.10691838711500168, 0.07934671640396118, 0.22862295806407928, 0.24046963453292847, -0.05827050656080246, -0.4818749725818634, -0.048965029418468475, 0.14953091740608215, -0.037504665553569794, -0.057370856404304504, -0.11727863550186157, -0.5689612627029419, 0.07413635402917862, 0.0516715943813324, -0.0013222172856330872, 0.1566036492586136, -0.24527360498905182, 0.18826980888843536, 0.3704337775707245, 0.15262995660305023, -0.10623772442340851, 0.08956173807382584, 0.3264411389827728, -0.13835394382476807, -0.36236000061035156, 0.0017638914287090302, -0.03766797482967377, 0.0029836520552635193, -0.21041718125343323, -0.07052452862262726, -0.053757503628730774, -0.13642339408397675, -0.357332706451416, 0.030172094702720642, 0.03753618150949478, 0.13865993916988373, 0.24001023173332214, -0.14421023428440094, -0.09734156727790833, -0.3782264292240143, 0.35309937596321106, 0.5216610431671143, -0.29733726382255554, -0.3254892826080322, 0.2215682417154312, -0.3227751553058624, 0.07960888743400574, 0.30475932359695435, 0.16553497314453125, -0.22041213512420654, -0.2580699920654297, -0.25217896699905396, 0.18630221486091614, -0.3548862934112549, 0.01238343957811594, 0.026041388511657715, 0.16799236834049225, -0.018724646419286728, 0.1268172413110733, 0.11993689835071564, -0.2075205296278, -0.13522611558437347, 0.16335198283195496, 0.034779541194438934, -0.09656482189893723, -0.24399781227111816, 0.00900067389011383, -0.20844882726669312, 0.4732602834701538, -0.10594342648983002, -0.14504598081111908, 0.26915788650512695, -0.24036851525306702, -0.21625006198883057, 0.15381741523742676, -0.1518758237361908, 0.11733165383338928, 0.1527031660079956, 0.26108357310295105, 0.28927522897720337, -0.11725291609764099, 0.01035650447010994, -0.2829234302043915, -0.0009855590760707855, -0.1565476804971695, 0.03168832138180733, -0.044575825333595276, -0.3417298197746277, -0.0523090660572052, 0.170771062374115, -0.0034963972866535187, -0.05595121160149574, -0.09977597743272781, -0.01991380751132965, 0.3643910586833954, -0.1656814068555832, -0.3627072870731354, 0.14722862839698792, -0.13015559315681458, 0.3820744752883911, -0.6744646430015564, 0.05392032861709595, 0.12358678877353668, -0.17551565170288086, 0.2284790277481079, 0.3734012544155121, 0.22049841284751892, -0.1290021687746048, 0.12570060789585114, 0.17790332436561584, 0.15407906472682953, 0.2196834534406662, 0.08226442337036133, 0.0422719269990921, 0.04243648797273636, -0.048495814204216, 0.0033844634890556335, 0.1387898474931717, 0.0660003125667572, 0.06987190991640091, -0.12006520479917526, 0.4258614182472229, -0.06794820725917816, 0.208977609872818, -0.044480953365564346, 0.3560856282711029, -0.025177353993058205, 0.28729385137557983, -0.06664452701807022, 0.000691540539264679, -0.03277171775698662, -0.07905617356300354, 0.5247001051902771, 0.3009680211544037, -0.672338604927063, 0.17232190072536469, 0.33772122859954834, -0.2774760127067566, 0.10331369936466217, 0.172634094953537, -0.31649571657180786, -0.06212693825364113, 0.1091294065117836, -0.15151652693748474, 0.18283873796463013, 0.1340157836675644, 0.20742225646972656, -0.018098236992955208, 0.12874551117420197, -0.1164245530962944, 0.21081897616386414, -0.040729984641075134, -0.24859577417373657, -0.28971347212791443, -0.3286841809749603, -0.07248388975858688, -0.24545475840568542, 0.2718096971511841, -0.38405975699424744, 0.006627549417316914, -0.5391952395439148, 0.042707398533821106, -0.2688681483268738, -0.08057419955730438, -0.4174778163433075, -0.22931216657161713, -0.4315442740917206, -0.25344318151474, -0.19197185337543488, 0.07114747166633606, 0.14174728095531464, -0.15513041615486145, 0.10422618687152863, 0.08869655430316925, -0.12034037709236145, -0.07606331259012222, -0.3521118462085724, -0.22776418924331665, -0.1164647713303566, -0.026774324476718903, 0.2723766267299652, -0.043709125369787216, 0.3634999096393585, -0.30013442039489746, 0.2126014083623886, -0.4405309855937958, -0.012976892292499542, 0.11686846613883972, -0.30101311206817627, 0.12528394162654877, 0.4279448091983795, 0.1263924539089203, 0.11138565838336945, 0.005279219709336758, 0.11538662761449814, -0.2030215561389923, -0.23694537580013275, -0.2228747308254242, -0.22491809725761414, -0.05341453477740288, 0.02345319092273712, -0.08311299234628677, -0.39821529388427734, -0.06621145457029343, 0.41982316970825195, 0.03998454287648201, -0.02317068725824356, 0.013588091358542442, 0.15989670157432556, 0.08620291948318481, -0.2594473361968994, 0.11490647494792938, -0.13254618644714355, -0.5805044174194336, 0.4896546006202698, -0.22627155482769012, -0.4229736328125, 0.11587589979171753, 0.07518336176872253, 0.24550262093544006, -0.0012794947251677513, 0.11399462819099426, 0.22698768973350525, -0.17657628655433655, 0.20981186628341675, 0.09283623099327087, 0.3116911053657532, 0.21068772673606873, 0.10526742786169052, 0.12390157580375671, -0.2403198778629303, 0.07961612939834595, -0.03869914263486862, -0.25876283645629883, 0.22780849039554596, 0.276507169008255, -0.08674349635839462, -0.2473004013299942, 0.5504237413406372, 0.37501582503318787, -0.291922003030777, 0.1580149084329605, -0.1372770369052887, 0.44066664576530457, 0.0638168454170227, -0.45398852229118347, 0.24228428304195404, -0.1286594271659851, 0.2880924344062805, 0.055633872747421265, 0.19724488258361816, 0.6440855860710144, -0.17407959699630737, -0.025898056104779243, -0.33381766080856323, -0.24118880927562714, -0.09714845567941666, -0.11279495060443878, 0.05493682995438576, -0.2068450003862381, 0.1813170611858368, -0.2378508746623993, 0.05819869786500931, 0.10180115699768066, 0.26280397176742554, 0.6442163586616516, 0.27168717980384827, -0.22789797186851501, -0.06957443803548813, -0.5478174090385437, 0.2686397135257721, -0.012912673875689507, -0.08074717223644257, -0.136494442820549, -0.0005334652960300446, 0.039935775101184845, 0.1272049993276596, 0.6575552821159363, 0.03629165142774582, -0.24614392220973969, 0.0639674961566925, -0.13840019702911377, -0.5583133101463318, 0.2614040970802307, 0.0025812461972236633, 0.2163683921098709, 0.09456482529640198, 0.10619129985570908, -0.40973663330078125, -0.3556906282901764, 0.02733548916876316, 0.3309575319290161, -0.14676669239997864, 0.1172807589173317, -0.2175949215888977, -0.11077472567558289, -0.06828616559505463, -0.232793390750885, 0.007363302633166313, 0.0750030130147934, -0.22010089457035065, -0.01074729673564434, -0.08922627568244934, -0.07198688387870789, 0.3747822642326355, -0.1748618185520172, 0.297443151473999, -0.23013506829738617, -0.19939051568508148, 0.4478241503238678, 0.3105625510215759, 0.22053106129169464, 0.4115280210971832, -0.16727124154567719, -0.3130323588848114, -0.16097810864448547, 0.1756906807422638, 0.40073633193969727, 0.12647801637649536, -0.08188075572252274, 0.23501697182655334, -0.09280405193567276, 0.01509862020611763, -0.37234681844711304, -0.23459559679031372, 0.28076550364494324, 0.05432455614209175, -0.26707229018211365, -0.4362678825855255, 0.6439188718795776, 0.23481552302837372, 0.14400863647460938, 0.1856362223625183, 0.764949381351471, -0.16115428507328033, -0.1589701771736145, 0.33853891491889954, 1.2339398860931396, -0.17415089905261993, 0.21248935163021088, 0.09878002107143402, -0.28547337651252747, 0.8549654483795166, 0.20966728031635284, -0.09015502035617828, -0.35577335953712463, 0.26893410086631775, -0.19478166103363037, -0.15617482364177704, 0.14793235063552856, 0.08764632046222687, -0.16831138730049133, 0.28547149896621704, -0.27756381034851074, 0.05250513553619385, 0.015539932996034622, 0.05943562090396881, -0.29919037222862244, -0.2067020684480667, -0.19344031810760498, 0.002566814422607422, -0.028699949383735657, 0.5226016640663147, 0.15212342143058777, -0.23117975890636444, -0.18319609761238098, 0.04476942867040634, -0.22107863426208496, 0.021794911473989487, -0.30490148067474365, -0.11305814981460571, 0.6037835478782654, -0.5407355427742004, 0.3281652331352234, 0.6813127994537354, 0.589959979057312, -0.1836075335741043, -0.25407737493515015, -0.018631961196660995, -0.02841484546661377, -0.19505912065505981, -0.1212027296423912, 0.10854436457157135, 0.2296520471572876, 0.20412510633468628, -0.07114654779434204, 0.09785857796669006, -0.006264912895858288, -0.09315097332000732, -0.46365511417388916, -0.20899610221385956, -0.04710296541452408, -0.368622750043869, -0.22476007044315338, 0.11975769698619843, 0.07265686988830566, -0.07825305312871933, -0.04647168889641762, 0.18907122313976288, -0.10085535049438477, 0.05847156420350075, 0.012601986527442932, -0.08204374462366104, -0.02098563313484192, 0.3378704786300659, -0.19896426796913147, -0.09874574840068817, 0.2561410069465637, 0.17953623831272125, -0.20522579550743103, -0.07442867010831833, 0.2685573399066925, 0.5446904301643372, -0.29536473751068115, 0.35529741644859314, 0.10598473995923996, 0.2227335423231125, -0.06032147258520126, 0.3194088637828827, 0.08204686641693115, -0.03860333561897278, -0.17517799139022827, -0.00852920114994049, -0.3610445559024811, 0.08181222528219223, -0.07691898941993713, 0.12676866352558136, 0.022989492863416672, 0.031615838408470154, 0.08494538813829422, -0.06974869221448898, -0.15321485698223114, 0.07801329344511032, 0.024986473843455315, -0.09358803927898407, 0.48365873098373413, -0.02633465826511383, -0.1759355664253235, -0.134506955742836, -0.08245009183883667, -0.006782788783311844, 0.0054360260255634785, -0.02219304069876671, -0.1695648431777954, 0.20380601286888123, 0.006339447572827339, -0.06289628893136978, 0.05427287891507149, 0.07744361460208893, -0.03280939534306526, -0.32046329975128174, 0.24933892488479614, 0.5367720127105713, 0.06411851197481155, 0.2827688157558441, -0.01010860875248909, 0.25379037857055664, -0.141659215092659, 0.005989409983158112, 0.18807509541511536, 0.38146305084228516, -0.02032105252146721, 0.052976518869400024, 0.04490991309285164, -0.15785525739192963, 0.10543449223041534, 0.3259902000427246, 0.2893308103084564, -0.308984637260437, 0.20154908299446106, -0.029934421181678772, 0.0834963321685791, 0.027513017877936363, 0.23452907800674438, 0.3374367356300354, 0.04752520099282265, 0.33295342326164246, 0.15222561359405518, -0.081363745033741, -0.25530344247817993, -0.11254876106977463, -0.056092675775289536, 0.007615230977535248, -0.1081971675157547, 0.14252707362174988, -0.1386854201555252, 0.19827425479888916, -0.045947492122650146, -0.23816543817520142, 0.2471257448196411, 0.02341008372604847, 0.05457156524062157, 0.34717920422554016, 0.3916085660457611, 0.10197529196739197, 0.3473168909549713, 0.3153207302093506, 0.2717397212982178, 0.1718466430902481, -0.06255295127630234, 0.656603217124939, -0.17922243475914001, 0.0445583313703537, 0.7658969759941101, -0.2640780508518219, -0.19157440960407257, 0.1898486167192459, 0.17447471618652344, 0.28386080265045166, -0.16853520274162292, 0.7912728786468506, -0.3951685130596161, -0.2793909013271332, 0.016893597319722176, 0.476723313331604, -0.014022856950759888, -0.4370923340320587, -0.32929909229278564, -0.15130966901779175, -0.10678010433912277, 0.012097872793674469, -0.15215586125850677, -0.43938523530960083, 0.202403724193573, 0.0018859580159187317, 0.207081139087677, -0.07212182879447937, 0.03841139003634453, 0.04230830445885658, 0.12386780977249146, -0.06586852669715881, -0.16837374866008759, 0.2327820062637329, -0.1425815224647522, 0.17042258381843567, 0.2845505177974701, 0.4592626392841339, 0.0855165421962738, -0.2730572521686554, 0.2503099739551544, -0.05032416060566902, -0.17155826091766357, 0.15080910921096802, 0.16765528917312622, -0.157717764377594, -0.01950448751449585, 0.21602143347263336, 0.04335246980190277, 0.11232876777648926, -0.059809524565935135, -0.07648536562919617, 0.44949302077293396, -0.07291616499423981, 0.22828519344329834, -0.5624257326126099, -0.17175596952438354, -0.4056968688964844, 0.03965174779295921, -0.3334197402000427, 0.025084108114242554, 0.08923305571079254, 0.2273554652929306, -0.09407433122396469, -0.123478002846241, -0.010485030710697174, 0.30632099509239197, 0.26597222685813904, 0.3065318167209625, 0.3442443609237671, -0.013084172271192074, -0.30939966440200806, -0.25010424852371216, -0.08494498580694199, 0.2719094753265381, 0.03602597862482071, -0.2788352072238922, -0.14760808646678925, 0.2086208462715149, 0.16568230092525482, -0.12705717980861664, 0.2347167283296585, 0.06366981565952301, 0.23328745365142822, 0.23307891190052032, -0.31730636954307556, -0.0059854015707969666, 0.018519148230552673, -0.005028627812862396, -0.06721476465463638, 0.22625112533569336, -0.06258057802915573, -0.15479838848114014, -0.3024032711982727, 0.2951051890850067, 0.0747440755367279, 0.13278812170028687, -0.07744297385215759, 0.2365705966949463, 0.4273897111415863, -0.10410654544830322, -0.1468183547258377, 0.14909246563911438, 0.13647538423538208, -0.09836351126432419, 0.2630341351032257, -0.21349772810935974, 0.18731184303760529, -0.1984718292951584, -0.23074130713939667, -0.35162001848220825, 0.4147469401359558, 0.10504588484764099, 0.08114662021398544, -0.30533120036125183, 0.23997294902801514, -0.19977262616157532, -0.3567175269126892, 0.3913574516773224, 0.2952658236026764, -0.1922873705625534, 0.11569659411907196, -0.22848547995090485, 0.1167912632226944, 0.6021646857261658, -0.351734459400177, -0.058216970413923264, -0.1451544463634491, -0.12461425364017487, 0.38689056038856506, -0.456828773021698, -0.517853319644928, 0.0721449926495552, 0.06891932338476181, -0.037569254636764526, 0.19223912060260773, 0.009053966030478477, -0.023617912083864212, -0.06180023401975632, -0.23213326930999756, 0.5821385383605957, 0.2498789131641388, 0.2098361998796463, 0.1891496628522873, -0.14559905230998993 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
Generator functions are generally picklable. E.g. ```python import dill as pickle def generator_fn(): for i in range(10): yield i pickle.dumps(generator_fn) ``` however generators are not picklable ```python generator = generator_fn() pickle.dumps(generator) # TypeError: cannot pickle 'generator' object ``` Though it can happen that some generator functions are not recursively picklable if they use global objects that are not picklable: ```python def generator_fn_not_picklable(): for i in generator: yield i pickle.dumps(generator_fn_not_picklable, recurse=True) # TypeError: cannot pickle 'generator' object ````
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
77
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. Generator functions are generally picklable. E.g. ```python import dill as pickle def generator_fn(): for i in range(10): yield i pickle.dumps(generator_fn) ``` however generators are not picklable ```python generator = generator_fn() pickle.dumps(generator) # TypeError: cannot pickle 'generator' object ``` Though it can happen that some generator functions are not recursively picklable if they use global objects that are not picklable: ```python def generator_fn_not_picklable(): for i in generator: yield i pickle.dumps(generator_fn_not_picklable, recurse=True) # TypeError: cannot pickle 'generator' object ````
[ -0.09451135993003845, -0.37787237763404846, 0.02815106138586998, 0.33519452810287476, 0.37709861993789673, 0.11020659655332565, -0.13368070125579834, 0.10178948938846588, 0.029146838933229446, 0.13128913938999176, -0.1832723170518875, 0.27258819341659546, -0.4256507456302643, 0.11319821327924728, 0.1520662009716034, -0.3304990231990814, 0.33991673588752747, -0.14815828204154968, -0.5063165426254272, -0.03158850222826004, -0.304294228553772, 0.3645855784416199, 0.06314170360565186, 0.03568978235125542, -0.05121438205242157, 0.19461730122566223, -0.061906106770038605, 0.14655983448028564, -0.28231948614120483, -0.07997074723243713, 0.28883811831474304, 0.01601560227572918, 0.16179701685905457, 0.5488449931144714, -0.00012723359395749867, -0.11660104990005493, -0.06858693063259125, -0.1857433319091797, -0.012544766999781132, -0.3029104471206665, 0.372385710477829, -0.013988625258207321, 0.10784469544887543, 0.07039188593626022, -0.2751538157463074, -0.09546839445829391, -0.06338948011398315, -0.4157702922821045, 0.2875620722770691, 0.18943941593170166, 0.07565165311098099, 0.20074035227298737, 0.5002303719520569, 0.04791879653930664, 0.06869609653949738, 0.4796351194381714, -0.1825210303068161, 0.14741672575473785, 0.18090294301509857, 0.16352708637714386, 0.32337141036987305, 0.17087382078170776, -0.2170747071504593, -0.23805777728557587, 0.7851906418800354, -0.12027329951524734, -0.49609220027923584, -0.3785763680934906, 0.07457011938095093, 0.2435888946056366, 0.34415745735168457, -0.3875620663166046, -0.425351619720459, -0.11608108878135681, 0.14633752405643463, -0.02112502232193947, -0.2088368535041809, 0.2535897493362427, -0.2848745882511139, 0.06756937503814697, -0.27757227420806885, -0.5390699505805969, -0.11348004639148712, -0.08715429902076721, 0.07906600832939148, 0.1295919418334961, -0.29183435440063477, 0.084080770611763, 0.4090166687965393, -0.29045748710632324, -0.04315536096692085, -0.09603855013847351, 0.23028935492038727, 0.1150788962841034, 0.0803079903125763, -0.032254427671432495, -0.24574044346809387, 0.50563645362854, 0.5036767721176147, 0.18755626678466797, -0.07092039287090302, -0.07058580219745636, -0.28394991159439087, 0.0451192744076252, 0.07910555601119995, -0.18922075629234314, 0.12353165447711945, 0.17359498143196106, 0.02669973112642765, -0.05952640250325203, 0.054180558770895004, 0.15625843405723572, -0.040263622999191284, -0.34763991832733154, -0.14809514582157135, -0.0022504720836877823, 0.2875441312789917, -0.23517930507659912, -0.10017701238393784, -0.2561948895454407, 0.007822740823030472, 0.09455328434705734, 0.02585267461836338, 0.19494977593421936, -0.02123069390654564, 0.11132063716650009, 0.2994152307510376, 0.21520982682704926, -0.06282345205545425, -0.3280561864376068, -0.03758402541279793, 0.032359056174755096, -0.050510093569755554, 0.07436708360910416, -0.1904759258031845, -0.6320033669471741, 0.0685184970498085, 0.06770006567239761, 0.02516384795308113, 0.19565463066101074, -0.21490474045276642, 0.2095077782869339, 0.4283517599105835, 0.0409298837184906, -0.036887217313051224, 0.04698359966278076, 0.35427963733673096, 0.021339498460292816, -0.40776991844177246, -0.016674093902111053, -0.11500076204538345, 0.020397406071424484, -0.3166901767253876, -0.06035029515624046, -0.04983050376176834, -0.06618525087833405, -0.30464741587638855, 0.13412344455718994, -0.05523660033941269, -0.10821764171123505, 0.16087213158607483, -0.18000313639640808, -0.23819032311439514, -0.33331289887428284, 0.48112383484840393, 0.5448024868965149, -0.2411235272884369, -0.22025693953037262, 0.09129038453102112, -0.33904072642326355, -0.002728588879108429, 0.18465974926948547, 0.13771310448646545, -0.24285200238227844, -0.451876163482666, -0.29661208391189575, 0.13154655694961548, -0.346222460269928, -0.005492769181728363, 0.05125686153769493, 0.08622695505619049, 0.1104910597205162, -0.07205218821763992, 0.140974760055542, -0.23493488132953644, -0.10981922596693039, 0.17789913713932037, 0.07618879526853561, -0.10943248867988586, -0.1627257764339447, 0.07551737129688263, -0.20013248920440674, 0.5102946758270264, -0.1622573733329773, -0.22014091908931732, 0.3027331531047821, -0.19268682599067688, -0.1902940422296524, 0.23803523182868958, -0.19897562265396118, 0.09103772789239883, 0.16014383733272552, 0.1025162860751152, 0.32201069593429565, -0.05475067347288132, -0.05615314841270447, -0.36404716968536377, -0.059698715806007385, 0.0106426440179348, -0.06040152907371521, -0.13115252554416656, -0.2975885272026062, 0.01882452890276909, 0.15721949934959412, -0.028971049934625626, -0.07219861447811127, -0.0599563866853714, 0.01667407900094986, 0.4188811779022217, -0.153631791472435, -0.2703031003475189, 0.12041304260492325, -0.02857520803809166, 0.34270334243774414, -0.7434402704238892, 0.09025593101978302, 0.14486511051654816, -0.10774930566549301, 0.17841297388076782, 0.3827643096446991, 0.20022541284561157, -0.08228769153356552, 0.1532895565032959, 0.12063746899366379, 0.08024463057518005, 0.13129571080207825, -0.00644461065530777, 0.09077075123786926, 0.02435135655105114, -0.15026678144931793, 0.04534890502691269, 0.2719484269618988, 0.06349769234657288, 0.06055855751037598, -0.13336998224258423, 0.4317502975463867, -0.026164498180150986, 0.26310470700263977, -0.03156692907214165, 0.32590118050575256, -0.05790182948112488, 0.2625485360622406, -0.13924969732761383, 0.04625514894723892, -0.06639991700649261, -0.027533333748579025, 0.46299758553504944, 0.1764124035835266, -0.6864534020423889, 0.14055542647838593, 0.2216266393661499, -0.21510763466358185, 0.09548462927341461, 0.1756589710712433, -0.36576640605926514, 0.014543801546096802, 0.1797814667224884, -0.22798830270767212, 0.2618221044540405, 0.13943390548229218, 0.31481727957725525, 0.19718512892723083, 0.20730620622634888, 0.025957386940717697, 0.10992806404829025, -0.08450254797935486, -0.06401995569467545, -0.18488723039627075, -0.19477663934230804, -0.0829014852643013, -0.16659455001354218, 0.16306863725185394, -0.40097576379776, 0.00956985168159008, -0.48362427949905396, 0.07457252591848373, -0.3646102547645569, -0.11212270706892014, -0.4717559814453125, -0.05381515249609947, -0.3888946771621704, -0.2980268597602844, -0.2639358639717102, 0.056932561099529266, 0.11441174149513245, -0.1579168438911438, 0.19773893058300018, -0.08105726540088654, -0.06250323355197906, -0.20573003590106964, -0.3289787471294403, -0.21903802454471588, -0.1079750582575798, -0.05391038954257965, 0.21364934742450714, -0.0832371711730957, 0.27646905183792114, -0.2967173755168915, 0.1989067643880844, -0.5887389779090881, -0.0558931827545166, 0.13003763556480408, -0.2730092406272888, -0.016966165974736214, 0.42628806829452515, 0.14557388424873352, 0.1498868763446808, -0.055846404284238815, 0.08939395844936371, -0.22439108788967133, -0.21617767214775085, -0.18411785364151, -0.27007198333740234, 0.08307770639657974, -0.009485334157943726, 0.10324589908123016, -0.3613686263561249, -0.1045297235250473, 0.40552985668182373, 0.04777628555893898, -0.06021151691675186, -0.047842469066381454, 0.2534431219100952, 0.11382975429296494, -0.17254725098609924, 0.14018435776233673, -0.0727374479174614, -0.6246546506881714, 0.5263379812240601, -0.27546605467796326, -0.3917042911052704, 0.06883804500102997, 0.06380058825016022, 0.24675020575523376, 0.0841558501124382, -0.03244447708129883, -0.012491644360125065, -0.0703420415520668, 0.2016160786151886, 0.031954068690538406, 0.28322556614875793, 0.0900844931602478, 0.07582125812768936, 0.1479090452194214, -0.08106712251901627, 0.009786147624254227, -0.1390911340713501, -0.3111417591571808, 0.2727930247783661, 0.2926061153411865, -0.014994826167821884, -0.25342726707458496, 0.5328236818313599, 0.3555671274662018, -0.3426070213317871, 0.17573866248130798, -0.22947090864181519, 0.46127796173095703, 0.0041600242257118225, -0.4305301010608673, 0.2377816140651703, -0.15788844227790833, 0.21946024894714355, -0.011077992618083954, 0.10896419733762741, 0.5739150643348694, -0.2016087919473648, -0.08310027420520782, -0.16622823476791382, -0.34369364380836487, -0.126384437084198, -0.1470811665058136, 0.07657184451818466, -0.2761106789112091, 0.1456509828567505, -0.20482158660888672, 0.030110854655504227, 0.2321266233921051, 0.3548232913017273, 0.5909030437469482, 0.33247849345207214, -0.18405377864837646, -0.13135594129562378, -0.5602731704711914, 0.36118167638778687, 0.005053168162703514, -0.19096040725708008, -0.08051648736000061, -0.0489795058965683, -0.017288416624069214, 0.06657537817955017, 0.6495004296302795, 0.1135488823056221, -0.26464617252349854, -0.09264358878135681, -0.2091180682182312, -0.48355263471603394, 0.2282177060842514, 0.12113186717033386, 0.251329630613327, 0.054930176585912704, 0.12499594688415527, -0.42484205961227417, -0.3323170840740204, 0.18074209988117218, 0.422346293926239, -0.11119820922613144, 0.04564349353313446, -0.28181272745132446, -0.3043937683105469, -0.10690044611692429, -0.2962607741355896, 0.004537975415587425, 0.15643568336963654, -0.08529875427484512, -0.07565812021493912, -0.14907306432724, -0.07434023171663284, 0.3162171244621277, -0.17384923994541168, 0.29270756244659424, -0.13717146217823029, -0.20470167696475983, 0.397719144821167, 0.2790355086326599, 0.2146337628364563, 0.4012347459793091, -0.1529097855091095, -0.36110565066337585, -0.04637053608894348, 0.348577082157135, 0.4126543700695038, 0.004261285066604614, -0.12324439734220505, 0.14211994409561157, -0.09619792550802231, 0.07770641893148422, -0.36507609486579895, -0.2613673508167267, 0.2853628098964691, 0.20760966837406158, -0.23761041462421417, -0.44501540064811707, 0.5099658370018005, 0.3670259416103363, 0.2283502072095871, 0.2300923764705658, 0.6625432372093201, -0.07136929780244827, -0.11530658602714539, 0.29856714606285095, 1.0732691287994385, -0.16458682715892792, 0.16659404337406158, 0.2175629734992981, -0.2280360609292984, 0.8957924842834473, 0.14091186225414276, -0.0772002711892128, -0.3871211111545563, 0.17784877121448517, -0.18674378097057343, -0.061845991760492325, 0.18106579780578613, -0.005487721413373947, -0.20719075202941895, 0.3567994236946106, -0.24450577795505524, 0.001199282705783844, -0.10097134858369827, 0.09172210097312927, -0.2343446910381317, -0.15167637169361115, -0.2043662965297699, 0.018563538789749146, -0.05370587110519409, 0.5502788424491882, 0.09592904895544052, -0.27399778366088867, -0.07284624874591827, 0.09673109650611877, -0.21021541953086853, 0.0658821314573288, -0.3004467189311981, -0.14848865568637848, 0.5300146341323853, -0.6011627912521362, 0.3116472065448761, 0.7157993316650391, 0.5022732019424438, -0.07392682135105133, -0.2537980079650879, -0.07461531460285187, -0.16354846954345703, -0.13224288821220398, -0.20354251563549042, 0.05052967742085457, 0.1560409665107727, 0.17305085062980652, 0.028710655868053436, 0.17904335260391235, 0.14025922119617462, -0.043059561401605606, -0.41160833835601807, -0.1747501939535141, -0.08043602108955383, -0.3131677210330963, -0.19123317301273346, 0.26565301418304443, 0.0938170850276947, -0.03594603389501572, -0.04786451533436775, 0.13474148511886597, -0.19166794419288635, -0.023682191967964172, 0.03235411271452904, -0.09991667419672012, 0.12688608467578888, 0.3375489115715027, -0.21322283148765564, -0.10238409787416458, 0.24010834097862244, 0.2982468008995056, -0.14214405417442322, 0.00499880313873291, 0.10397528856992722, 0.6081247925758362, -0.2169097661972046, 0.2558577358722687, 0.06032625213265419, 0.2946434020996094, -0.05986220762133598, 0.09710009396076202, -0.047218628227710724, -0.08796552568674088, -0.08952422440052032, -0.02783239260315895, -0.3716559410095215, 0.0605587512254715, -0.11003817617893219, 0.09295651316642761, 0.15045961737632751, 0.02615068107843399, 0.006063841283321381, -0.012294841930270195, -0.15655621886253357, 0.13634265959262848, 0.026043416932225227, -0.11037291586399078, 0.40985193848609924, -0.0487009733915329, -0.24000349640846252, -0.035663899034261703, -0.05389346927404404, 0.11934040486812592, 0.04273290932178497, -0.013329219073057175, -0.14388646185398102, 0.19464102387428284, -0.03625516965985298, 0.01007688045501709, 0.06064465269446373, 0.033943090587854385, -0.024748384952545166, -0.36140450835227966, 0.3444788157939911, 0.3773011267185211, 0.09202773869037628, 0.30071333050727844, 0.02951337769627571, 0.20118772983551025, -0.1389814019203186, 0.008425405248999596, 0.3052012324333191, 0.4235991835594177, -0.049960508942604065, 0.15930593013763428, -0.03141167014837265, -0.1513160914182663, -0.003433880629017949, 0.3015141189098358, 0.3178423345088959, -0.3083823323249817, 0.2792944312095642, 0.17473532259464264, 0.02000034973025322, -0.09825440496206284, 0.32759836316108704, 0.2660723328590393, -0.03124687820672989, 0.3838907778263092, 0.0976903885602951, -0.12372372299432755, -0.19702616333961487, -0.11041886359453201, 0.02940172329545021, -0.05595286935567856, -0.14272157847881317, 0.10679727047681808, -0.261699914932251, 0.28476157784461975, -0.04818010330200195, -0.2830278277397156, 0.21900656819343567, 0.09126045554876328, -0.017153846099972725, 0.3189145624637604, 0.3618128001689911, 0.03200820833444595, 0.3184715807437897, 0.3794879913330078, 0.32955455780029297, 0.15214909613132477, -0.07512984424829483, 0.5695870518684387, -0.188767671585083, 0.1049724593758583, 0.7681082487106323, -0.3096264898777008, -0.1612895280122757, 0.19877639412879944, 0.22785745561122894, 0.12988637387752533, -0.14261217415332794, 0.5636160373687744, -0.2537655234336853, -0.2592347264289856, 0.14359289407730103, 0.5824922919273376, 0.00781579315662384, -0.3116205334663391, -0.17552345991134644, -0.14083322882652283, -0.11663886904716492, 0.07739049196243286, -0.19112005829811096, -0.5168518424034119, 0.2360730767250061, -0.033976465463638306, 0.1523534208536148, -0.11882279813289642, 0.10682319849729538, 0.1445876955986023, 0.036066893488168716, -0.08197193592786789, -0.20348834991455078, 0.30050623416900635, -0.09371478855609894, 0.08210444450378418, 0.3346463143825531, 0.44239458441734314, 0.11693402379751205, -0.2246606945991516, 0.27672871947288513, 0.008486119098961353, -0.19524604082107544, 0.06602387875318527, -0.015473458915948868, -0.16143961250782013, -0.09300762414932251, 0.28758108615875244, 0.03244313597679138, 0.1394479125738144, -0.14155901968479156, -0.08404123783111572, 0.4609929919242859, -0.16234973073005676, 0.34109005331993103, -0.5319950580596924, -0.10986252129077911, -0.39429256319999695, 0.07860264182090759, -0.45276880264282227, -0.0825749859213829, 0.10282140970230103, 0.1774292141199112, -0.07115273177623749, -0.12165530771017075, -0.00981835462152958, 0.20053859055042267, 0.28682467341423035, 0.3252228796482086, 0.46401774883270264, -0.062391698360443115, -0.3492433428764343, -0.4150010645389557, -0.04147491604089737, 0.3285936117172241, 0.05002053827047348, -0.15929444134235382, -0.13395921885967255, 0.14620783925056458, 0.2246694266796112, -0.2572801113128662, 0.16437707841396332, 0.20108409225940704, 0.28773611783981323, 0.1932307332754135, -0.34318941831588745, -0.0969739705324173, -0.020414302125573158, 0.06405605375766754, -0.011386554688215256, 0.18229347467422485, -0.055110786110162735, -0.13941173255443573, -0.2149227261543274, 0.28441131114959717, -0.04266101121902466, 0.10628797113895416, 0.026510320603847504, 0.2395191490650177, 0.34291088581085205, -0.09685768187046051, -0.1302584409713745, 0.18324081599712372, 0.21993373334407806, -0.16279259324073792, 0.3113364279270172, -0.28656259179115295, 0.04342399537563324, -0.17078672349452972, -0.3954080045223236, -0.3938431143760681, 0.4140389859676361, 0.11398833990097046, 0.0056441170163452625, -0.2765446603298187, 0.28777560591697693, -0.15416070818901062, -0.23737378418445587, 0.33345478773117065, 0.3741856515407562, -0.18991519510746002, 0.20637427270412445, -0.23558847606182098, 0.17897401750087738, 0.6275889873504639, -0.27061259746551514, -0.006637169048190117, -0.07426730543375015, -0.14171549677848816, 0.38580194115638733, -0.47892868518829346, -0.6048088073730469, 0.1142144724726677, 0.0770326629281044, -0.036217376589775085, 0.19794519245624542, 0.06857866048812866, -0.06254754960536957, -0.05933883413672447, -0.1929018646478653, 0.47594887018203735, 0.3589806854724884, 0.11748497188091278, 0.14323559403419495, -0.1681295484304428 ]
https://github.com/huggingface/datasets/issues/4983
How to convert torch.utils.data.Dataset to huggingface dataset?
I'm trying to create an IterableDataset from a generator but I get this error: `PicklingError: Can't pickle <built-in function input>: it's not the same object as builtins.input` What can I do?
I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks.
31
How to convert torch.utils.data.Dataset to huggingface dataset? I look through the huggingface dataset docs, and it seems that there is no offical support function to convert `torch.utils.data.Dataset` to huggingface dataset. However, there is a way to convert huggingface dataset to `torch.utils.data.Dataset`, like below: ```python from datasets import Dataset data = [[1, 2],[3, 4]] ds = Dataset.from_dict({"data": data}) ds = ds.with_format("torch") ds[0] ds[:2] ``` So is there something I miss, or there IS no function to convert `torch.utils.data.Dataset` to huggingface dataset. If so, is there any way to do this convert? Thanks. I'm trying to create an IterableDataset from a generator but I get this error: `PicklingError: Can't pickle <built-in function input>: it's not the same object as builtins.input` What can I do?
[ -0.11531290411949158, -0.520784854888916, -0.014464633539319038, 0.3105403482913971, 0.34615492820739746, 0.24259138107299805, -0.08286026120185852, 0.1370021402835846, -0.023693883791565895, 0.08231644332408905, -0.15151382982730865, 0.1798325479030609, -0.3926085829734802, 0.18873116374015808, 0.14696303009986877, -0.21109598875045776, 0.3619809150695801, -0.06674730777740479, -0.47939810156822205, 0.024751603603363037, -0.2086126059293747, 0.4066859185695648, -0.031238574534654617, -0.014439888298511505, -0.05213123559951782, 0.15688635408878326, -0.1071333959698677, 0.14446797966957092, -0.2833278775215149, -0.15636396408081055, 0.3453384339809418, -0.03684483841061592, 0.10573788732290268, 0.550893247127533, -0.0001265017781406641, -0.10639838874340057, -0.020301543176174164, -0.22271223366260529, -0.0042984820902347565, -0.31407272815704346, 0.2471855878829956, 0.08029565215110779, 0.07271186262369156, 0.06219909340143204, -0.24779143929481506, -0.20706544816493988, -0.04219967871904373, -0.4794657826423645, 0.36797499656677246, 0.27785995602607727, 0.07818317413330078, 0.19456514716148376, 0.413349986076355, -0.07655835151672363, -0.10960624366998672, 0.5769127607345581, -0.23796230554580688, 0.1356012225151062, 0.2593625783920288, 0.20194081962108612, 0.4059261679649353, 0.10481798648834229, -0.14922453463077545, -0.12862788140773773, 0.722890317440033, -0.05699608474969864, -0.5697740912437439, -0.4163433015346527, 0.1456582099199295, 0.24273449182510376, 0.38206398487091064, -0.4140174686908722, -0.4221920669078827, -0.19790679216384888, 0.07124403119087219, 0.014872552827000618, -0.18620634078979492, 0.21005575358867645, -0.23969334363937378, 0.03292699158191681, -0.334949791431427, -0.45047956705093384, -0.1250247210264206, 0.007679250091314316, 0.21589022874832153, 0.05006489157676697, -0.3280750513076782, 0.1514131724834442, 0.36606165766716003, -0.29667967557907104, 0.10480760782957077, -0.11254911124706268, 0.15647123754024506, 0.18047039210796356, 0.12070578336715698, -0.050749123096466064, -0.3261353671550751, 0.49241021275520325, 0.46964114904403687, 0.1691490262746811, -0.10008153319358826, -0.10282210260629654, -0.3078300356864929, -0.005056887865066528, 0.2039419412612915, -0.16095520555973053, 0.08496299386024475, 0.10686596482992172, -0.04137326031923294, -0.014895319938659668, 0.09044411778450012, 0.03538786619901657, 0.021184265613555908, -0.4073602557182312, -0.0667671412229538, -0.07479450106620789, 0.38846051692962646, -0.2457623928785324, -0.1534186452627182, -0.2667100727558136, -0.10670571774244308, 0.09566769748926163, -0.027467723935842514, 0.13754481077194214, -0.0003907247446477413, 0.014242714270949364, 0.16970601677894592, 0.2882534861564636, -0.06192327290773392, -0.24351762235164642, -0.0071877846494317055, 0.16392260789871216, -0.04390149563550949, 0.14186544716358185, -0.12989796698093414, -0.6343894004821777, 0.08989924937486649, 0.08554881811141968, 0.007976274937391281, 0.08089648187160492, -0.16226525604724884, 0.1332826316356659, 0.43943753838539124, 0.04051043465733528, 0.0870874673128128, 0.0588386133313179, 0.31584084033966064, -0.1503782570362091, -0.3550761044025421, -0.05623269081115723, -0.13786402344703674, -0.03920718654990196, -0.3056427538394928, -0.06246409937739372, -0.08363613486289978, -0.1015058159828186, -0.29813188314437866, 0.1861310601234436, 0.021128565073013306, -0.09472343325614929, 0.1290600299835205, -0.19820742309093475, -0.20389315485954285, -0.2838422358036041, 0.35229820013046265, 0.49931782484054565, -0.401411235332489, -0.20775210857391357, -0.022363783791661263, -0.3540341258049011, -0.029351241886615753, 0.23065119981765747, 0.08430321514606476, -0.056627072393894196, -0.4377312660217285, -0.15073040127754211, 0.11689265817403793, -0.20776256918907166, -0.1374843567609787, 0.024316487833857536, 0.18669377267360687, 0.1509055197238922, -0.14498254656791687, 0.18415191769599915, -0.22124405205249786, -0.12936827540397644, 0.16366249322891235, -0.0017336178570985794, -0.23349079489707947, -0.22853289544582367, 0.09817883372306824, -0.176319420337677, 0.49354779720306396, -0.16424593329429626, -0.16106915473937988, 0.2604920268058777, -0.18145594000816345, -0.229183167219162, 0.18724673986434937, -0.18262746930122375, 0.13271236419677734, 0.2308395951986313, 0.10872165858745575, 0.3494771122932434, 0.04499492049217224, -0.15740066766738892, -0.403862327337265, -0.0754816085100174, 0.10639768838882446, -0.07077820599079132, -0.09386415779590607, -0.27247413992881775, -0.17077851295471191, 0.20640194416046143, -0.099114328622818, 0.007372243329882622, -0.04603812098503113, 0.01786293089389801, 0.4262457489967346, -0.27367424964904785, -0.39190468192100525, 0.28012558817863464, -0.013071414083242416, 0.22812385857105255, -0.7984018325805664, 0.06068650633096695, 0.13952001929283142, -0.20314431190490723, 0.25932776927948, 0.42341363430023193, 0.15426033735275269, -0.14328625798225403, 0.09690484404563904, 0.15223786234855652, 0.11957400292158127, 0.10064008086919785, 0.012974899262189865, 0.21050219237804413, 0.05328290909528732, -0.14840885996818542, -0.04947298765182495, 0.27225035429000854, 0.10588932782411575, -0.01855384185910225, -0.21882978081703186, 0.4179556965827942, -0.16119596362113953, 0.3224991261959076, -0.039583176374435425, 0.3493514060974121, 0.020147746428847313, 0.2240506112575531, -0.23339174687862396, -0.029434654861688614, -0.17065668106079102, -0.17536620795726776, 0.45206353068351746, 0.08252424746751785, -0.5447477102279663, 0.07915998250246048, 0.2212456613779068, -0.14568932354450226, 0.0632292851805687, 0.14719435572624207, -0.37097597122192383, -0.004628168419003487, 0.16559433937072754, -0.13595642149448395, 0.34791848063468933, 0.08520468324422836, 0.23210005462169647, 0.23042409121990204, 0.23683901131153107, 0.042261648923158646, 0.09201981872320175, -0.018305204808712006, -0.04264143481850624, -0.24982523918151855, -0.22499360144138336, -0.08002842217683792, -0.19945162534713745, 0.18847061693668365, -0.43117499351501465, 0.0912434533238411, -0.46046823263168335, 0.03475011885166168, -0.3321477174758911, -0.15754297375679016, -0.43040964007377625, -0.18360261619091034, -0.2912186086177826, -0.27165675163269043, -0.2499789446592331, 0.19221621751785278, 0.1500733494758606, -0.11926839500665665, 0.2251351773738861, 0.01890723407268524, -0.04087189957499504, -0.14463764429092407, -0.32764381170272827, -0.15978895127773285, -0.1336905062198639, -0.030634811148047447, 0.32432469725608826, -0.03463108465075493, 0.34637176990509033, -0.25934720039367676, 0.2453368455171585, -0.6208177208900452, -0.07882412523031235, 0.16620272397994995, -0.28041666746139526, 0.05440077185630798, 0.444953054189682, 0.1658846139907837, 0.14177563786506653, -0.1603987067937851, 0.09420186281204224, -0.15757052600383759, -0.16156116127967834, -0.17484143376350403, -0.27292296290397644, -0.0796455666422844, 0.060088012367486954, 0.004695191979408264, -0.2982775568962097, -0.02182627096772194, 0.4307097792625427, 0.07033176720142365, -0.08018672466278076, -0.012468979693949223, 0.29241716861724854, 0.15286347270011902, -0.030792294070124626, 0.03422703593969345, -0.15905392169952393, -0.5616676807403564, 0.5342198014259338, -0.29309800267219543, -0.42636197805404663, 0.1848020851612091, 0.035248901695013046, 0.3284834027290344, 0.03999166563153267, -0.01428268849849701, 0.04938632622361183, -0.11979125440120697, 0.1414780169725418, 0.07652392983436584, 0.19357798993587494, 0.22985787689685822, 0.10806061327457428, 0.15115885436534882, -0.15513867139816284, -0.04757952690124512, -0.05159149318933487, -0.22242078185081482, 0.3111746311187744, 0.3815649747848511, 0.09143295139074326, -0.17363595962524414, 0.5380611419677734, 0.4111686944961548, -0.30786335468292236, 0.2571166157722473, -0.26276928186416626, 0.42736437916755676, -0.06552020460367203, -0.4851868748664856, 0.08760055899620056, -0.1727680265903473, 0.1853441745042801, 0.04273486137390137, 0.12574982643127441, 0.4848838150501251, -0.14132654666900635, 0.01668623462319374, -0.18345829844474792, -0.2796514928340912, -0.16619345545768738, -0.1487717479467392, 0.051615528762340546, -0.16963765025138855, 0.09731761366128922, -0.19835081696510315, -0.01571737416088581, 0.23134608566761017, 0.25822365283966064, 0.5441808700561523, 0.24007999897003174, -0.2360706925392151, -0.16316023468971252, -0.47939562797546387, 0.3698432445526123, 0.03171603009104729, -0.06479795277118683, -0.08117252588272095, -0.07205535471439362, 0.003891296684741974, 0.06743808835744858, 0.6820188760757446, 0.10872101038694382, -0.44280004501342773, -0.05052226036787033, -0.15037024021148682, -0.48408883810043335, 0.21890561282634735, 0.12492085993289948, 0.5076764822006226, 0.11431345343589783, 0.2815673351287842, -0.3151857554912567, -0.3082612156867981, 0.195962056517601, 0.42968589067459106, -0.16584104299545288, 0.0897509977221489, -0.22257204353809357, -0.3146427869796753, -0.16376090049743652, -0.3179839253425598, 0.08055514097213745, 0.15957146883010864, 0.0718575268983841, -0.07416242361068726, -0.2240104228258133, -0.08036819100379944, 0.3477134704589844, -0.16622942686080933, 0.3274475634098053, -0.060666851699352264, -0.07314247637987137, 0.3862616717815399, 0.22112584114074707, 0.19401074945926666, 0.38961297273635864, -0.031478073447942734, -0.34025534987449646, -0.06391728669404984, 0.24875953793525696, 0.45358699560165405, -0.0008112043142318726, -0.06889928877353668, 0.06184150651097298, 0.011349784210324287, 0.03529857099056244, -0.39361387491226196, -0.22295516729354858, 0.26013773679733276, 0.1765654981136322, -0.24621649086475372, -0.4615119397640228, 0.41208934783935547, 0.37971431016921997, 0.23793639242649078, 0.38980793952941895, 0.7344132661819458, -0.11308974772691727, -0.09535326808691025, 0.18706601858139038, 1.0662219524383545, -0.12904712557792664, 0.07175813615322113, 0.21885451674461365, -0.17234709858894348, 0.6381579637527466, 0.08484756946563721, -0.17580170929431915, -0.3754575550556183, 0.04239119216799736, -0.20215989649295807, -0.05455838143825531, 0.2521797716617584, 0.0788118913769722, -0.24774359166622162, 0.3018206059932709, -0.1921546459197998, 0.05882982909679413, -0.16106881201267242, 0.09496591985225677, -0.26108139753341675, -0.1872362643480301, -0.16317693889141083, 0.04593782126903534, 0.020756512880325317, 0.5328661203384399, 0.12455464154481888, -0.18786248564720154, -0.12194184958934784, 0.1532319188117981, -0.35251903533935547, 0.024082526564598083, -0.21066540479660034, -0.12200771272182465, 0.5410571098327637, -0.5002403855323792, 0.2853986620903015, 0.7066835165023804, 0.6334367394447327, -0.10725559294223785, -0.36253541707992554, -0.038880687206983566, -0.08918101340532303, -0.18161392211914062, -0.2406233698129654, 0.02441861480474472, 0.13668985664844513, 0.10602182894945145, 0.0587361678481102, 0.18706196546554565, 0.1104130893945694, -0.09629611670970917, -0.3949301838874817, -0.21015097200870514, -0.050982147455215454, -0.5018278956413269, -0.36577609181404114, 0.2375211864709854, 0.14757932722568512, -0.028163768351078033, -0.029378607869148254, 0.05914267897605896, -0.11192873120307922, 0.02851955220103264, 0.04423820227384567, -0.06891994923353195, 0.1315159946680069, 0.3283260464668274, -0.1617937684059143, -0.15637755393981934, 0.3737676739692688, 0.2775188982486725, -0.07140988111495972, -0.017064783722162247, 0.09087099879980087, 0.6010688543319702, -0.18470555543899536, 0.26749250292778015, -0.020018942654132843, 0.3818153142929077, -0.12005658447742462, 0.15439005196094513, -0.007311537861824036, -0.02658824622631073, -0.12597599625587463, 0.005651518702507019, -0.4314299523830414, 0.06380970776081085, 0.011561203747987747, 0.18255098164081573, 0.08663839846849442, -0.037234116345644, 0.055728621780872345, -0.06518788635730743, -0.1602206826210022, 0.05892924219369888, 0.007165906950831413, -0.04262452572584152, 0.41453424096107483, 0.00010655820369720459, -0.22559823095798492, -0.09989555180072784, -0.04730644077062607, 0.1628328412771225, 0.029994186013936996, -0.06566248834133148, -0.09800019860267639, 0.19143685698509216, -0.001588204875588417, -0.06686725467443466, 0.03601621091365814, 0.05819869786500931, -0.12979617714881897, -0.37244799733161926, 0.25331562757492065, 0.4241768717765808, 0.06266848742961884, 0.28443172574043274, 0.21545475721359253, 0.0864633247256279, -0.15733841061592102, -0.12933582067489624, 0.26158928871154785, 0.4371355175971985, -0.04173975810408592, 0.09117715060710907, -0.00271267700009048, -0.16926856338977814, 0.05987544730305672, 0.37202194333076477, 0.4572451114654541, -0.30791687965393066, 0.21738281846046448, 0.08000725507736206, 0.09241601824760437, 0.04638281092047691, 0.3053622841835022, 0.3774503171443939, -0.09198317676782608, 0.4913724660873413, 0.14825615286827087, -0.11861153692007065, -0.21066787838935852, -0.06496742367744446, -0.016467172652482986, -0.12251023203134537, -0.21061064302921295, 0.07403886318206787, -0.2430293709039688, 0.31469792127609253, 0.12516255676746368, -0.209432452917099, 0.24518749117851257, -0.12850026786327362, 0.055498939007520676, 0.2251480221748352, 0.30079200863838196, 0.026439979672431946, 0.3138826787471771, 0.2669963836669922, 0.20253409445285797, 0.13479357957839966, -0.16713562607765198, 0.46845847368240356, -0.06314651668071747, 0.13054585456848145, 0.8019399046897888, -0.2810510993003845, -0.19688893854618073, 0.0939471647143364, 0.28732043504714966, 0.1548970639705658, 0.0244893841445446, 0.582230806350708, -0.15313731133937836, -0.2599993348121643, 0.10435497015714645, 0.44495490193367004, 0.03503388538956642, -0.3000597655773163, -0.1603916734457016, -0.10293032228946686, -0.1742100715637207, 0.02786823734641075, -0.14324316382408142, -0.5295553207397461, 0.24166369438171387, -0.0861484557390213, 0.15606719255447388, -0.1478797197341919, 0.09026806056499481, 0.16562315821647644, 0.023335471749305725, -0.08063361048698425, -0.2270849496126175, 0.2111758291721344, -0.13931967318058014, 0.04112197458744049, 0.32558438181877136, 0.45729488134384155, 0.13856223225593567, -0.2518109679222107, 0.30794739723205566, -0.04432566091418266, -0.2643338739871979, 0.1845075637102127, 0.06057754531502724, -0.14808373153209686, 0.0167163647711277, 0.244181290268898, 0.03589083254337311, 0.14027656614780426, -0.16215522587299347, -0.04509260877966881, 0.43254944682121277, -0.2961049973964691, 0.1621854305267334, -0.5249500274658203, -0.15729118883609772, -0.38250961899757385, 0.030316896736621857, -0.3926895260810852, -0.24690137803554535, 0.1753266602754593, 0.0887233167886734, -0.040633704513311386, -0.11800079047679901, -0.005644461140036583, 0.18079930543899536, 0.36656516790390015, 0.3364856243133545, 0.3601525127887726, -0.11481363326311111, -0.40314406156539917, -0.4230347275733948, -0.1713152527809143, 0.2702905535697937, 0.1384037584066391, -0.13348419964313507, -0.030359406024217606, 0.06893424689769745, 0.2983492612838745, -0.16838838160037994, 0.12900310754776, 0.11370676010847092, 0.3496297001838684, 0.22130240499973297, -0.45539402961730957, -0.050246916711330414, -0.0007594209164381027, 0.09608384221792221, -0.08503472805023193, 0.11649027466773987, -0.042516496032476425, -0.15391139686107635, -0.1695440709590912, 0.2122724950313568, -0.00710163451731205, 0.06748548150062561, 0.02866358309984207, 0.2063046097755432, 0.24916397035121918, -0.1029951423406601, -0.05441644787788391, 0.041599683463573456, 0.16306431591510773, -0.2130744904279709, 0.46258533000946045, -0.21920838952064514, 0.08512024581432343, -0.2205599993467331, -0.28585854172706604, -0.348624587059021, 0.31928014755249023, 0.18621709942817688, -0.02912040799856186, -0.33948850631713867, 0.3085474967956543, -0.19351962208747864, -0.12166879326105118, 0.28868669271469116, 0.33443573117256165, -0.1880183219909668, 0.2737908661365509, -0.20830509066581726, 0.20526298880577087, 0.6235395073890686, -0.2483477145433426, -0.11466246843338013, 0.044227633625268936, -0.20261511206626892, 0.42525553703308105, -0.5565826296806335, -0.5378236174583435, 0.03268588334321976, 0.14912699162960052, -0.0814947560429573, 0.24887332320213318, 0.10458540916442871, 0.0511011928319931, -0.02767583355307579, -0.18348371982574463, 0.5934863090515137, 0.39843037724494934, 0.11091138422489166, 0.13284510374069214, -0.18533484637737274 ]
https://github.com/huggingface/datasets/issues/4982
Create dataset_infos.json with VALIDATION and TEST splits
Hi again! Can you please pass the directory name containing the dataset script instead of the script name to `datasets-cli test`?
The problem is described in that [issue](https://github.com/huggingface/datasets/issues/4895#issuecomment-1247975569). > When I try to create data_infos.json using datasets-cli test Peter.py --save_infos --all_configs I get an error: > ValueError: Unknown split "test". Should be one of ['train']. > > The data_infos.json is created perfectly fine when I use only one split - datasets.Split.TRAIN > > You can find the code here: https://huggingface.co/datasets/sberbank-ai/Peter/tree/add_splits (add_splits branch) I tried to clear the cache folder, than I got an another error. I run: ``` git clone https://huggingface.co/datasets/sberbank-ai/Peter cd Peter git checkout add_splits # switch to a add_splits branch rm dataset_infos.json # remove local dataset_infos.json rm -r ~/.cache/huggingface # remove cached dataset_infos.json datasets-cli test Peter.py --save_infos --all_configs # trying to create new dataset_infos.json ``` The error message: ``` Using custom data configuration default Testing builder 'default' (1/1) Downloading and preparing dataset peter/default to /Users/kalinin/.cache/huggingface/datasets/peter/default/0.0.0/ef579519e140d6a40df2555996f26165f04c47557d7373709c8d7e7b4fd7465d... Downloading data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 5160.63it/s] Extracting data files: 0%| | 0/4 [00:00<?, ?it/s]Traceback (most recent call last): File "/usr/local/bin/datasets-cli", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.9/site-packages/datasets/commands/datasets_cli.py", line 39, in main service.run() File "/usr/local/lib/python3.9/site-packages/datasets/commands/test.py", line 137, in run builder.download_and_prepare( File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 1227, in _download_and_prepare super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 771, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/Users/kalinin/.cache/huggingface/modules/datasets_modules/datasets/Peter/ef579519e140d6a40df2555996f26165f04c47557d7373709c8d7e7b4fd7465d/Peter.py", line 23, in _split_generators data_files = dl_manager.download_and_extract(_URLS) File "/usr/local/lib/python3.9/site-packages/datasets/download/download_manager.py", line 431, in download_and_extract return self.extract(self.download(url_or_urls)) File "/usr/local/lib/python3.9/site-packages/datasets/download/download_manager.py", line 403, in extract extracted_paths = map_nested( File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 393, in map_nested mapped = [ File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 394, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 330, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 213, in cached_path output_path = ExtractManager(cache_dir=download_config.cache_dir).extract( File "/usr/local/lib/python3.9/site-packages/datasets/utils/extract.py", line 46, in extract self.extractor.extract(input_path, output_path, extractor_format) File "/usr/local/lib/python3.9/site-packages/datasets/utils/extract.py", line 263, in extract with FileLock(lock_path): File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 399, in __init__ max_filename_length = os.statvfs(os.path.dirname(lock_file)).f_namemax FileNotFoundError: [Errno 2] No such file or directory: '' Exception ignored in: <function BaseFileLock.__del__ at 0x11caeec10> Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 328, in __del__ self.release(force=True) File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 303, in release with self._thread_lock: AttributeError: 'UnixFileLock' object has no attribute '_thread_lock' Extracting data files: 0%| | 0/4 [00:00<?, ?it/s] ``` Can you help me please? ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.9.5 - PyArrow version: 9.0.0 - Pandas version: 1.2.4
21
Create dataset_infos.json with VALIDATION and TEST splits The problem is described in that [issue](https://github.com/huggingface/datasets/issues/4895#issuecomment-1247975569). > When I try to create data_infos.json using datasets-cli test Peter.py --save_infos --all_configs I get an error: > ValueError: Unknown split "test". Should be one of ['train']. > > The data_infos.json is created perfectly fine when I use only one split - datasets.Split.TRAIN > > You can find the code here: https://huggingface.co/datasets/sberbank-ai/Peter/tree/add_splits (add_splits branch) I tried to clear the cache folder, than I got an another error. I run: ``` git clone https://huggingface.co/datasets/sberbank-ai/Peter cd Peter git checkout add_splits # switch to a add_splits branch rm dataset_infos.json # remove local dataset_infos.json rm -r ~/.cache/huggingface # remove cached dataset_infos.json datasets-cli test Peter.py --save_infos --all_configs # trying to create new dataset_infos.json ``` The error message: ``` Using custom data configuration default Testing builder 'default' (1/1) Downloading and preparing dataset peter/default to /Users/kalinin/.cache/huggingface/datasets/peter/default/0.0.0/ef579519e140d6a40df2555996f26165f04c47557d7373709c8d7e7b4fd7465d... Downloading data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 5160.63it/s] Extracting data files: 0%| | 0/4 [00:00<?, ?it/s]Traceback (most recent call last): File "/usr/local/bin/datasets-cli", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.9/site-packages/datasets/commands/datasets_cli.py", line 39, in main service.run() File "/usr/local/lib/python3.9/site-packages/datasets/commands/test.py", line 137, in run builder.download_and_prepare( File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 704, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 1227, in _download_and_prepare super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) File "/usr/local/lib/python3.9/site-packages/datasets/builder.py", line 771, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/Users/kalinin/.cache/huggingface/modules/datasets_modules/datasets/Peter/ef579519e140d6a40df2555996f26165f04c47557d7373709c8d7e7b4fd7465d/Peter.py", line 23, in _split_generators data_files = dl_manager.download_and_extract(_URLS) File "/usr/local/lib/python3.9/site-packages/datasets/download/download_manager.py", line 431, in download_and_extract return self.extract(self.download(url_or_urls)) File "/usr/local/lib/python3.9/site-packages/datasets/download/download_manager.py", line 403, in extract extracted_paths = map_nested( File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 393, in map_nested mapped = [ File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 394, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/usr/local/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 330, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 213, in cached_path output_path = ExtractManager(cache_dir=download_config.cache_dir).extract( File "/usr/local/lib/python3.9/site-packages/datasets/utils/extract.py", line 46, in extract self.extractor.extract(input_path, output_path, extractor_format) File "/usr/local/lib/python3.9/site-packages/datasets/utils/extract.py", line 263, in extract with FileLock(lock_path): File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 399, in __init__ max_filename_length = os.statvfs(os.path.dirname(lock_file)).f_namemax FileNotFoundError: [Errno 2] No such file or directory: '' Exception ignored in: <function BaseFileLock.__del__ at 0x11caeec10> Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 328, in __del__ self.release(force=True) File "/usr/local/lib/python3.9/site-packages/datasets/utils/filelock.py", line 303, in release with self._thread_lock: AttributeError: 'UnixFileLock' object has no attribute '_thread_lock' Extracting data files: 0%| | 0/4 [00:00<?, ?it/s] ``` Can you help me please? ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-x86_64-i386-64bit - Python version: 3.9.5 - PyArrow version: 9.0.0 - Pandas version: 1.2.4 Hi again! Can you please pass the directory name containing the dataset script instead of the script name to `datasets-cli test`?
[ -0.002343636006116867, -0.2656538486480713, 0.04977372661232948, 0.44563084840774536, 0.19490164518356323, 0.14243808388710022, 0.29455429315567017, 0.4225432276725769, -0.07759221643209457, 0.0482630580663681, -0.1166512742638588, 0.09244988113641739, -0.11206098645925522, 0.26801854372024536, -0.12379540503025055, -0.26987919211387634, 0.03392431139945984, 0.1623975932598114, 0.3358769714832306, 0.22515742480754852, -0.10770609974861145, 0.28128281235694885, 0.25536012649536133, -0.028805822134017944, -0.6608597636222839, -0.16773316264152527, -0.08841923624277115, 0.11625796556472778, -0.32943442463874817, -0.4465826451778412, 0.3690283000469208, -0.046725448220968246, -0.17047052085399628, 0.4949611723423004, -0.00012326335126999766, 0.11974896490573883, 0.2824244499206543, -0.15931247174739838, -0.4206688404083252, -0.2871131896972656, -0.4469771087169647, -0.05350823700428009, 0.06573132425546646, -0.18020406365394592, -0.1796034276485443, -0.1246250793337822, -0.22929753363132477, -0.28716138005256653, 0.6172136068344116, 0.41271138191223145, 0.10406068712472916, 0.11896936595439911, -0.08815811574459076, -0.262902170419693, 0.05493698641657829, 0.2082846313714981, -0.20669086277484894, 0.1936074197292328, -0.17608436942100525, 0.21097230911254883, 0.07270216941833496, 0.10171353816986084, 0.22454780340194702, 0.09763465821743011, 0.03115728870034218, -0.04968330264091492, -0.18027934432029724, -0.30213233828544617, 0.1166561171412468, 0.3242504298686981, 0.2989415228366852, -0.27545833587646484, -0.41501474380493164, -0.3678315281867981, 0.06179286539554596, -0.13786961138248444, 0.27028292417526245, 0.2854141294956207, -0.17802008986473083, 0.004341252148151398, -0.4577000141143799, -0.1367749124765396, -0.127379909157753, 0.008088082075119019, 0.06091321259737015, -0.09237842261791229, -0.26218345761299133, 0.11828941106796265, 0.3767501413822174, -0.03672512620687485, -0.338975727558136, -0.2624182403087616, -0.393688440322876, 0.125906303524971, -0.25730079412460327, -0.3264913260936737, -0.23265340924263, -0.10201583057641983, 0.13793551921844482, 0.32688748836517334, -0.04357710853219032, -0.21078252792358398, 0.03610962629318237, 0.024061642587184906, 0.25017181038856506, 0.47728684544563293, 0.4215462803840637, 0.020454145967960358, 0.09850941598415375, 0.2711946666240692, 0.08580659329891205, -0.18266087770462036, 0.19406644999980927, -0.05421718955039978, -0.02628435008227825, -0.03365706652402878, 0.08937346190214157, -0.021646350622177124, -0.21538570523262024, 0.13303683698177338, -0.29887181520462036, -0.1712271273136139, 0.26602402329444885, 0.28713953495025635, -0.009631449356675148, -0.19712498784065247, -0.22328373789787292, 0.2695702016353607, -0.21610939502716064, -0.11393076181411743, -0.1801156848669052, 0.2133600264787674, -0.16442783176898956, 0.15380339324474335, 0.4037476181983948, -0.3520905077457428, 0.4234708249568939, 0.13207142055034637, 0.043558597564697266, -0.3083270788192749, 0.0687030479311943, -0.058932237327098846, -0.13016536831855774, 0.322704553604126, 0.05127936974167824, 0.18778662383556366, 0.08471337705850601, -0.13721723854541779, -0.08698297291994095, -0.17285040020942688, -0.20119187235832214, -0.6590853333473206, 0.05176262930035591, 0.07615675032138824, -0.42512333393096924, 0.3301146328449249, -0.1461343765258789, 0.06088395416736603, 0.4181601405143738, -0.025249486789107323, -0.026608355343341827, 0.11322382092475891, 0.021468061953783035, -0.23345324397087097, 0.2542283535003662, 0.27766576409339905, -0.18666626513004303, -0.20905959606170654, -0.1918424367904663, -0.32061904668807983, -0.13055193424224854, 0.26486414670944214, -0.11249754577875137, 0.40809348225593567, -0.29407641291618347, 0.341654896736145, 0.0909661054611206, -0.14930355548858643, -0.12845289707183838, 0.3241046965122223, 0.02088608592748642, 0.005294101312756538, 0.2291405200958252, -0.08183620870113373, 0.08630013465881348, 0.006260732188820839, -0.09049086272716522, -0.042319588363170624, -0.23372036218643188, -0.01867484301328659, -0.1493355929851532, -0.3494035005569458, 0.05474898964166641, 0.032450344413518906, -0.010863151401281357, -0.08965002745389938, 0.01321132481098175, 0.25426822900772095, 0.0532754547894001, -0.12016196548938751, 0.293148010969162, 0.15051543712615967, 0.3715861141681671, -0.1153239905834198, 0.1221836507320404, -0.28248435258865356, -0.5955960750579834, 0.17339500784873962, -0.07916150987148285, 0.12517037987709045, -0.07392977178096771, -0.14670521020889282, -0.4698305130004883, -0.15578106045722961, -0.2906626760959625, -0.35380807518959045, 0.004370942711830139, 0.11499820649623871, 0.5020689368247986, -0.056909412145614624, -0.26635119318962097, 0.2630802094936371, -0.010134093463420868, 0.2172049731016159, -0.49137645959854126, 0.22338606417179108, -0.05248422175645828, -0.06060031056404114, -0.077076755464077, 0.1176074743270874, 0.012185189872980118, -0.2892628312110901, -0.1930203139781952, 0.5462902188301086, 0.19902555644512177, 0.03898324817419052, -0.026571214199066162, 0.05735337734222412, 0.10332533717155457, -0.07112538069486618, 0.05117611959576607, 0.01181577518582344, -0.078886978328228, -0.133916974067688, -0.3648794889450073, 0.4775133728981018, -0.14597637951374054, 0.19075748324394226, -0.017551511526107788, 0.042898036539554596, 0.21143363416194916, -0.1530950367450714, 0.060793183743953705, -0.48705828189849854, 0.1387348622083664, -0.38680267333984375, 0.23615528643131256, 0.0026330407708883286, -0.06830860674381256, 0.014206565916538239, 0.3114323616027832, 0.025702141225337982, -0.05893584340810776, 0.0005472078919410706, 0.15575569868087769, 0.0027279723435640335, 0.049692872911691666, 0.6305857300758362, 0.6134235262870789, 0.020137939602136612, -0.1758502870798111, 0.15526802837848663, 0.025976121425628662, -0.18013502657413483, 0.2044256031513214, -0.13130593299865723, 0.15377724170684814, 0.25410211086273193, 0.036216504871845245, -0.2385767549276352, -0.17961770296096802, 0.21289300918579102, 0.3499886095523834, 0.30447185039520264, -0.31951838731765747, -0.010989787057042122, -0.2044680118560791, -0.13852733373641968, -0.2650763690471649, -0.2554268538951874, -0.4038860499858856, -0.27712276577949524, 0.20518584549427032, 0.21070252358913422, 0.003021787852048874, 0.21711930632591248, -0.0245624091476202, 0.24807895720005035, -0.14201197028160095, -0.1973733901977539, -0.2603916823863983, -0.07430850714445114, -0.05159921199083328, -0.03703165799379349, 0.15083113312721252, 0.15772633254528046, 0.2724623382091522, -0.21875374019145966, -0.1831745207309723, -0.24641582369804382, -0.23722389340400696, 0.17736388742923737, -0.19126571714878082, 0.47411656379699707, 0.45597022771835327, 0.16326066851615906, 0.032571516931056976, -0.3880903720855713, 0.4019583761692047, 0.04087839275598526, -0.3950357139110565, 0.03223488852381706, 0.09051500260829926, 0.03169044107198715, -0.27843043208122253, -0.520395815372467, 0.013535553589463234, -0.2030070275068283, 0.4461180567741394, -0.10893796384334564, 0.07814089953899384, 0.0697937086224556, 0.08599452674388885, 0.05844568833708763, -0.25864100456237793, -0.01898752897977829, -0.23786398768424988, -0.4722733199596405, 0.08874659985303879, -0.4299090504646301, -0.12950217723846436, 0.08123931288719177, -0.0730023980140686, 0.2374151647090912, -0.17374679446220398, -0.3027297854423523, 0.01003412064164877, -0.23737363517284393, 0.39573419094085693, 0.005084820091724396, 0.030719121918082237, 0.42974722385406494, -0.08601020276546478, 0.17642727494239807, -0.22904276847839355, -0.33558064699172974, 0.4210865795612335, -0.13696572184562683, 0.5120134949684143, -0.1502862572669983, 0.41142964363098145, 0.1222754716873169, 0.73194819688797, 0.6558053493499756, -0.02770843729376793, 0.0017177611589431763, -0.21727505326271057, 0.3075430691242218, -0.22830066084861755, -0.44287770986557007, 0.20375008881092072, 0.08157563954591751, -0.08118881285190582, 0.16739654541015625, 0.2896305322647095, 0.2137654423713684, -0.13423322141170502, 0.028605569154024124, -0.1763627529144287, -0.3529379367828369, 0.09761542826890945, -0.189025416970253, 0.23200282454490662, -0.009717965498566628, 0.10866973549127579, -0.06235155090689659, -0.09518513083457947, -0.23119741678237915, 0.43900537490844727, 0.05030105262994766, 0.10746490955352783, -0.6386291980743408, -0.040191326290369034, -0.2759878933429718, 0.12398408353328705, 0.16947659850120544, 0.2121523916721344, -0.17238493263721466, 0.1706176996231079, 0.12277907878160477, -0.0235085841268301, 0.6619605422019958, -0.23362119495868683, -0.0070336684584617615, -0.036965638399124146, -0.09865741431713104, -0.11234075576066971, -0.05336231365799904, -0.018227726221084595, 0.41511374711990356, 0.4909900426864624, 0.5623966455459595, -0.5613088011741638, -0.29393741488456726, 0.2848966419696808, 0.17754299938678741, -0.19887703657150269, -0.2580099105834961, 0.009593218564987183, -0.22504571080207825, -0.24986259639263153, -0.021239109337329865, -0.0838157907128334, 0.31601420044898987, 0.063400037586689, 0.2849932909011841, 0.15633216500282288, -0.1518833041191101, 0.21450068056583405, 0.14365988969802856, 0.2686971426010132, -0.11985699087381363, 0.4340828061103821, 0.027260208502411842, 0.034219808876514435, 0.3729427754878998, 0.5644165873527527, -0.13928084075450897, -0.11198942363262177, -0.045165762305259705, -0.06671099364757538, 0.21689686179161072, 0.22570458054542542, -0.04469015821814537, 0.05660194158554077, 0.14991460740566254, 0.27920830249786377, -0.12173404544591904, 0.046755269169807434, 0.30233684182167053, -0.26261118054389954, -0.20878931879997253, -0.21755024790763855, 0.33105143904685974, -0.03668928146362305, 0.08624164760112762, 0.15532433986663818, 0.22170361876487732, -0.1967955380678177, 0.11994268000125885, -0.14403113722801208, 0.743681788444519, 0.26058429479599, -0.012027870863676071, 0.25203484296798706, -0.1425859034061432, 0.5394331216812134, -0.1906663179397583, 0.14429089426994324, -0.3907076418399811, 0.02923544868826866, 0.07565416395664215, -0.1701658070087433, 0.19081056118011475, 0.11141464859247208, -0.06514731794595718, 0.09078758209943771, -0.12592148780822754, 0.43641743063926697, -0.1936992108821869, 0.40053799748420715, -0.39515167474746704, -0.23039692640304565, -0.2957777976989746, 0.07112113386392593, -0.14305251836776733, 0.17002417147159576, 0.09054794907569885, -0.14096471667289734, -0.18712124228477478, -0.27786338329315186, -0.37548989057540894, -0.015592321753501892, -0.1308239996433258, 0.2532399892807007, 0.2353043407201767, -0.1504131555557251, 0.12392503023147583, 0.0639733150601387, 0.46640831232070923, 0.1262914091348648, -0.19645898044109344, 0.15777355432510376, -0.050051249563694, -0.05762432888150215, -0.04512711986899376, -0.005696666426956654, 0.37221193313598633, -0.10684842616319656, -0.22182023525238037, -0.23043832182884216, -0.2740493416786194, -0.24216386675834656, -0.08203631639480591, -0.09857606887817383, -0.3395659923553467, -0.5861825346946716, -0.14988839626312256, -0.09379895031452179, 0.11650294065475464, -0.24595560133457184, 0.05956181511282921, 0.20799964666366577, -0.28157228231430054, 0.03871803358197212, -0.22994472086429596, -0.06412500143051147, -0.23150689899921417, 0.17780429124832153, 0.06316713243722916, -0.08723525702953339, 0.4411845803260803, -0.1348796933889389, 0.033829256892204285, -0.2759195566177368, 0.26633140444755554, 0.2682359218597412, -0.4600514769554138, 0.2672671973705292, 0.029680676758289337, -0.11190174520015717, 0.050334930419921875, 0.21050214767456055, 0.3065715432167053, 0.22869470715522766, 0.29045653343200684, -0.32605305314064026, -0.2941402494907379, 0.10839567333459854, -0.03310053423047066, 0.3849489390850067, -0.09634757041931152, 0.43690815567970276, -0.04200328141450882, 0.2790936529636383, -0.19399626553058624, 0.14561651647090912, -0.10992662608623505, 0.10187571495771408, 0.20258836448192596, -0.05550087243318558, 0.3458424508571625, -0.1675926148891449, -0.019400179386138916, 0.05773220956325531, -0.41435521841049194, -0.04423176124691963, -0.21642042696475983, 0.1993722766637802, 0.11519545316696167, -0.010898550972342491, -0.1232544332742691, 0.02864178642630577, -0.13723841309547424, -0.09519830346107483, 0.15022072196006775, 0.19479572772979736, -0.008837908506393433, 0.11177848279476166, 0.19870655238628387, -0.07451248914003372, -0.14088085293769836, -0.0214172825217247, 0.09530699998140335, 0.2674625515937805, -0.0017450549639761448, 0.17473052442073822, -0.34252163767814636, -0.011220477521419525, -0.08415096998214722, -0.029435433447360992, -0.03223790228366852, 0.13066482543945312, 0.08604244142770767, -0.31938642263412476, 0.005146060138940811, -0.03602693974971771, 0.5474830865859985, 0.3574407696723938, -0.10319270938634872, 0.3618527352809906, 0.26998141407966614, 0.08078131079673767, -0.02640717662870884, 0.009593132883310318, 0.468421071767807, 0.06498029828071594, 0.0652526319026947, 0.428973525762558, 0.21737566590309143, 0.2045292854309082, 0.010185636579990387, 0.08054053783416748, 0.345954954624176, -0.23774178326129913, 0.5373668074607849, 0.35152411460876465, -0.27039381861686707, 0.03839430212974548, 0.4430079460144043, -0.1215633898973465, 0.1059563159942627, 0.20288662612438202, -0.19979512691497803, 0.44121110439300537, -0.14469316601753235, 0.07033754140138626, 0.2809986174106598, -0.06625844538211823, -0.10908538103103638, -0.006740137934684753, -0.2178744673728943, -0.026586011052131653, -0.11477728188037872, 0.9011763334274292, -0.5291306972503662, -0.2990863025188446, -0.44505518674850464, 0.2474469095468521, -0.17497119307518005, -0.05286118760704994, -0.2783581018447876, -0.2896665930747986, -0.0660603940486908, 0.05379309132695198, -0.025742780417203903, -0.22293902933597565, 0.29743561148643494, -0.026589199900627136, -0.14161166548728943, -0.2289491593837738, -0.055160149931907654, 0.28359130024909973, 0.27387920022010803, -0.24918405711650848, 0.2553270161151886, 0.25585612654685974, -0.398762583732605, -0.03632756695151329, 0.3605858087539673, 0.5406450033187866, 0.23007939755916595, 0.22718025743961334, -0.04326564818620682, 0.08159346878528595, -0.044608041644096375, 0.20217934250831604, 0.39566951990127563, 0.183692067861557, -0.14989572763442993, 0.29463744163513184, 0.07214061915874481, -0.061240557581186295, 0.026910416781902313, 0.036913178861141205, 0.3092396557331085, -0.3779335916042328, 0.4031073749065399, -0.19984544813632965, 0.0824088528752327, -0.01932414248585701, 0.020738542079925537, -0.3578653633594513, 0.03306059166789055, 0.12680655717849731, 0.0070222727954387665, 0.1851390302181244, -0.22318090498447418, 0.03177556023001671, 0.039971016347408295, 0.4034710228443146, -0.10654045641422272, -0.3427078425884247, -0.2979668080806732, -0.2629910707473755, -0.39062973856925964, -0.24534201622009277, -0.147708922624588, 0.09136676788330078, -0.09639440476894379, 0.16229060292243958, -0.15604481101036072, 0.03102920949459076, 0.13774432241916656, 0.07337180525064468, 0.16700439155101776, 0.0851438120007515, -0.2540009319782257, -0.06063028797507286, -0.07084402441978455, -0.03364908695220947, 0.23852115869522095, -0.12967365980148315, 0.08749652653932571, 0.21975165605545044, -0.13331587612628937, 0.12806612253189087, 0.14490096271038055, 0.2590101361274719, -0.28540948033332825, 0.002474561333656311, 0.3618836998939514, 0.4202592968940735, 0.02979687601327896, -0.07330850511789322, -0.2827095687389374, -0.20116938650608063, -0.1828341782093048, 0.3359166979789734, 0.19183602929115295, 0.7392679452896118, -0.2260197401046753, -0.02736217901110649, -0.56517094373703, 0.056456033140420914, 0.13803449273109436, -0.13796943426132202, -0.07108770310878754, 0.18124766647815704, -0.24603420495986938, 0.2225547879934311, 0.5741173028945923, 0.49932974576950073, -0.23607614636421204, 0.34603726863861084, -0.12629210948944092, -0.19448940455913544, 0.4748733341693878, -0.3224177956581116, -0.19450607895851135, 0.2099314033985138, 0.11806675046682358, 0.21704307198524475, -0.4536866545677185, -0.5936056971549988, -0.0530574694275856, 0.2656632363796234, -0.2261335551738739, -0.12539970874786377, 0.09458200633525848, -0.08797338604927063, -0.16841241717338562, 0.20290127396583557, 0.24078069627285004, 0.34718751907348633, -0.3030794858932495, 0.4338759183883667, -0.07237905263900757 ]
https://github.com/huggingface/datasets/issues/4981
Can't create a dataset with `float16` features
Hi @dconathan, thanks for reporting. We rely on Arrow as a backend, and as far as I know currently support for `float16` in Arrow is not fully implemented in Python (C++), hence the `ArrowNotImplementedError` you get. See, e.g.: https://arrow.apache.org/docs/status.html?highlight=float16#data-types
## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4
39
Can't create a dataset with `float16` features ## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 Hi @dconathan, thanks for reporting. We rely on Arrow as a backend, and as far as I know currently support for `float16` in Arrow is not fully implemented in Python (C++), hence the `ArrowNotImplementedError` you get. See, e.g.: https://arrow.apache.org/docs/status.html?highlight=float16#data-types
[ -0.2009882777929306, -0.10930380970239639, 0.016125444322824478, 0.021241173148155212, 0.38709986209869385, 0.15218710899353027, 0.45306962728500366, 0.033425502479076385, -0.2996401786804199, -0.06064164638519287, -0.10168614983558655, 0.39165961742401123, 0.08138644695281982, -0.2725028395652771, 0.05386701226234436, -0.28524065017700195, 0.3063649833202362, 0.04332839325070381, -0.18481168150901794, -0.022601041942834854, -0.1990492045879364, -0.3401804566383362, -0.2611536979675293, 0.17059750854969025, -0.1559762954711914, 0.018971078097820282, -0.08496809005737305, -0.11830157786607742, -0.5093178153038025, -0.27293258905410767, 0.24250976741313934, -0.13706576824188232, 0.25397172570228577, 0.5635740160942078, -0.0001274293172173202, -0.05802440643310547, 0.32713818550109863, 0.023302936926484108, -0.1843799203634262, -0.10865284502506256, 0.30563780665397644, -0.3205069601535797, 0.20863556861877441, -0.07551462948322296, -0.061374083161354065, -0.4296264350414276, -0.04463101178407669, -0.37546420097351074, 0.09877963364124298, 0.33850041031837463, 0.07996977865695953, 0.4241890013217926, 0.3578651249408722, -0.03421250730752945, 0.45074883103370667, 0.4039570093154907, -0.5992499589920044, 0.29422587156295776, 0.1359720230102539, -0.190775528550148, 0.021822452545166016, -0.14523367583751678, -0.30882593989372253, 0.12667979300022125, 0.1340358555316925, 0.02070295251905918, -0.3174879252910614, -0.5399730205535889, 0.006541889160871506, 0.41908931732177734, 0.35261908173561096, -0.40274855494499207, -0.42553430795669556, -0.08785778284072876, -0.19390881061553955, -0.2738761603832245, 0.03420600667595863, 0.40990519523620605, -0.1186908483505249, -0.016444560140371323, -0.06345303356647491, -0.20739704370498657, -0.18620286881923676, 0.15854501724243164, -0.1652776449918747, 0.34783393144607544, 0.10616662353277206, 0.2694159150123596, 0.05823955684900284, -0.23778541386127472, 0.24278852343559265, 0.014698839746415615, 0.19250856339931488, 0.4166063964366913, -0.15926699340343475, 0.22997263073921204, -0.08466974645853043, -0.012633845210075378, 0.31394410133361816, -0.14011476933956146, 0.17458698153495789, -0.07251515239477158, -0.16377468407154083, 0.29014572501182556, 0.03846806287765503, 0.06913262605667114, -0.2724461555480957, 0.2039286345243454, 0.2612970173358917, -0.16699519753456116, 0.4321260154247284, -0.07827672362327576, 0.05356742814183235, -0.26619917154312134, -0.009125448763370514, -0.04604879021644592, 0.3809537887573242, 0.003726024180650711, -0.20239710807800293, 0.08726012706756592, -0.20301571488380432, 0.036771658807992935, 0.012491287663578987, 0.06445305794477463, -0.04669033735990524, -0.10574231296777725, 0.15616841614246368, 0.5045014023780823, -0.33252838253974915, -0.17810915410518646, 0.033611394464969635, 0.007646363228559494, -0.05399911850690842, -0.23231655359268188, 0.17231160402297974, -0.3220874071121216, 0.09673260152339935, 0.41907256841659546, 0.06952518224716187, 0.23345455527305603, 0.147128164768219, -0.11583149433135986, 0.07660841941833496, 0.30969294905662537, 0.05454111471772194, 0.004066623747348785, 0.050598181784152985, 0.00018224865198135376, 0.07418554276227951, 0.4039927124977112, -0.007260158658027649, -0.17684891819953918, -0.6506955027580261, 0.04005052521824837, -0.26223844289779663, 0.12858529388904572, -0.0949387475848198, 0.24147972464561462, 0.44480517506599426, -0.019119786098599434, 0.16708838939666748, -0.28195399045944214, 0.1031244695186615, -0.391269326210022, 0.33751481771469116, 0.0132988840341568, -0.4363529682159424, 0.14479297399520874, -0.19500356912612915, -0.17097246646881104, 0.13314425945281982, 0.17532946169376373, -0.05014533922076225, 0.05009164661169052, -0.17867593467235565, 0.3053138256072998, 0.320515900850296, 0.29841357469558716, 0.08721606433391571, -0.2738025486469269, 0.14068736135959625, -0.11933491379022598, -0.1487503945827484, 0.19891256093978882, 0.08111049234867096, -0.021683312952518463, -0.09978131949901581, 0.1624314934015274, -0.3583245873451233, -0.1473839282989502, -0.0883869007229805, -0.2401062697172165, 0.624018669128418, 0.16689848899841309, -0.029464881867170334, -0.0566718652844429, 0.1613805741071701, -0.17129193246364594, 0.05252695828676224, -0.14857061207294464, 0.22635817527770996, -0.12711253762245178, 0.4069528579711914, 0.0938057228922844, 0.18390890955924988, -0.07957218587398529, -0.3487452268600464, 0.12162194401025772, 0.21531470119953156, 0.14144186675548553, 0.017554201185703278, 0.07789299637079239, -0.007133743725717068, 0.20382395386695862, 0.006942667067050934, -0.014258190989494324, -0.07020698487758636, -0.05855531990528107, 0.09015767276287079, -0.020606812089681625, -0.1422797590494156, -0.290919691324234, -0.02590198814868927, 0.18529349565505981, -0.43637365102767944, 0.41223201155662537, -0.10597900301218033, -0.38027819991111755, -0.05395900830626488, 0.20368218421936035, 0.11905805766582489, 0.05571179836988449, -0.08093709498643875, 0.3548550307750702, 0.17698223888874054, 0.08613050729036331, -0.391571044921875, 0.39116817712783813, 0.2704872190952301, -0.5048338174819946, 0.2723015546798706, 0.38557595014572144, 0.057458579540252686, 0.09725967794656754, 0.04880831018090248, 0.46721404790878296, -0.00625479593873024, 0.08490342646837234, -0.05847679451107979, 0.29040566086769104, 0.22908926010131836, 0.16976875066757202, -0.009310935623943806, 0.10481518507003784, 0.3094991147518158, -0.0630064606666565, 0.20576724410057068, -0.17405818402767181, -0.5079026222229004, 0.11875929683446884, -0.12462793290615082, -0.1970576047897339, 0.45767688751220703, 0.11689792573451996, -0.06620291620492935, 0.007442843168973923, 0.2048606127500534, -0.5006636381149292, 0.2638867497444153, 0.026012856513261795, 0.1352425515651703, 0.056765347719192505, -0.5381006598472595, -0.06209258735179901, 0.3258526623249054, -0.12251150608062744, 0.07606235146522522, 0.018427208065986633, 0.31827494502067566, -0.11010923236608505, -0.142548069357872, 0.2787318527698517, -0.07677961140871048, 0.1815873682498932, -0.5350092053413391, -0.048958584666252136, -0.15815098583698273, 0.17585048079490662, -0.21533122658729553, -0.06486194580793381, -0.31521034240722656, -0.2781312167644501, 0.0194306131452322, 0.40660178661346436, -0.14430977404117584, 0.2010667622089386, -0.2259627729654312, -0.07140956819057465, 0.1662759780883789, 0.16304393112659454, -0.14671751856803894, -0.13962936401367188, -0.2608131766319275, -0.004917725920677185, -0.04772023856639862, -0.29089999198913574, 0.27469784021377563, 0.26566264033317566, -0.13257154822349548, -0.4878038167953491, -0.6215579509735107, 0.15377746522426605, 0.01712367683649063, 0.5996179580688477, 0.34862425923347473, -0.013032771646976471, 0.10305455327033997, -0.07220446318387985, 0.23234441876411438, 0.0001151449978351593, -0.254052996635437, 0.20911499857902527, -0.31698164343833923, 0.03360975906252861, -0.29351744055747986, -0.1948186457157135, -0.16737471520900726, -0.19409050047397614, 0.09914541244506836, -0.10149432718753815, 0.05044029653072357, -0.11342798918485641, 0.2796400487422943, 0.047889307141304016, 0.1813199371099472, -0.2319115698337555, -0.15135546028614044, 0.16422182321548462, 0.6436343193054199, -0.35686996579170227, -0.4152831733226776, -0.06628052145242691, -0.16795821487903595, -0.25646674633026123, 0.3040205240249634, -0.2865667939186096, 0.14883705973625183, -0.22618477046489716, 0.6788866519927979, -0.17458249628543854, 0.2373189628124237, 0.11796550452709198, -0.046569857746362686, 0.20879516005516052, -0.2899356484413147, -0.27518966794013977, -0.06609175354242325, 0.07361122965812683, 0.30628079175949097, 0.1089000552892685, 0.42621323466300964, -0.00225081667304039, 0.6371802091598511, -0.04519385099411011, -0.15905094146728516, 0.3047466576099396, -0.30396056175231934, 0.32312482595443726, -0.24753615260124207, -0.3175903558731079, 0.2147320806980133, 0.03976888209581375, -0.14489367604255676, -0.10875818133354187, 0.04771826043725014, -0.19861923158168793, -0.05180380493402481, 0.12018068134784698, -0.12656450271606445, -0.07831932604312897, 0.07994028925895691, -0.1424388438463211, 0.23483827710151672, -0.06588040292263031, 0.01004183292388916, -0.03218698129057884, -0.23428165912628174, -0.11358289420604706, -0.15178385376930237, 0.2322603464126587, 0.0979398861527443, -0.2405989170074463, -0.31539836525917053, -0.3051488697528839, 0.15628671646118164, 0.1702616661787033, 0.5178305506706238, 0.1291535347700119, -0.08290588110685349, -0.019561924040317535, 0.009245960973203182, 0.5540453195571899, -0.059689879417419434, -0.006880618631839752, 0.07963816821575165, 0.3896000385284424, -0.8895676732063293, -0.18867886066436768, -0.08833999931812286, 0.41358545422554016, -0.005708619952201843, -0.14526426792144775, -0.36968979239463806, 0.021376674994826317, 0.23090288043022156, 0.4420981705188751, -0.16553166508674622, 0.1567024290561676, -0.3195832669734955, -0.48719555139541626, 0.04733787477016449, -0.21554362773895264, 0.13172976672649384, 0.011116134002804756, -0.20342202484607697, 0.10264135897159576, -0.11034497618675232, -0.13309159874916077, 0.02849038690328598, -0.01962541975080967, 0.23249942064285278, -0.2458992302417755, 0.25920987129211426, 0.07764463871717453, -0.2785908877849579, 0.29049673676490784, 0.3470986783504486, 0.3098409175872803, -0.17887619137763977, 0.1691378355026245, -0.0003693141043186188, 0.2408038079738617, -0.06750564277172089, -0.04090237617492676, 0.103031687438488, -0.0279231034219265, 0.05313124507665634, -0.16049589216709137, -0.18759305775165558, 0.19455169141292572, -0.15676021575927734, -0.1084338128566742, -0.13778163492679596, 0.5937711596488953, 0.0074049197137355804, 0.0851878970861435, 0.35843631625175476, 0.024016648530960083, -0.2130156308412552, 0.3375999927520752, 0.4357931613922119, 0.8538236021995544, 0.049039531499147415, -0.02730650082230568, 0.5003535151481628, -0.27718502283096313, 0.6113311648368835, 0.007908154278993607, -0.16320225596427917, -0.48226693272590637, 0.125383660197258, -0.10050641745328903, -0.2996918261051178, 0.18428602814674377, -0.17226704955101013, -0.2057236284017563, 0.06799802929162979, -0.5603979825973511, 0.3460778295993805, 0.1378689557313919, -0.00827731192111969, 0.006354721263051033, -0.020977310836315155, 0.02589147910475731, 0.017484959214925766, -0.049804940819740295, -0.05166104808449745, 0.0016712285578250885, 0.09800387918949127, -0.2691466808319092, -0.29746782779693604, -0.6034275889396667, -0.042835064232349396, -0.35232463479042053, 0.2549137473106384, 0.24177739024162292, -0.21315033733844757, 0.00832124799489975, 0.07583989948034286, 0.44250982999801636, -0.12718063592910767, -0.20705437660217285, 0.05514562129974365, 0.3489169180393219, -0.07071169465780258, 0.11349056661128998, 0.031792715191841125, 0.09025630354881287, -0.049087733030319214, -0.3630618155002594, 0.06516790390014648, -0.01939462125301361, 0.06788906455039978, -0.14831256866455078, -0.08773626387119293, 0.1735137403011322, -0.2894706726074219, -0.020574716851115227, -0.2216566801071167, 0.2498345971107483, -0.23599614202976227, 0.013944437727332115, 0.16499733924865723, -0.02381627820432186, 0.1253248006105423, -0.16987824440002441, 0.13464540243148804, -0.22948192059993744, 0.1340651512145996, 0.037361517548561096, 0.11513309180736542, 0.23605507612228394, 0.5455991625785828, -0.21919867396354675, -0.028531715273857117, 0.23761001229286194, 0.25836649537086487, -0.6207526326179504, 0.1218966692686081, -0.2193095088005066, -0.11131282895803452, -0.3863028287887573, 0.13781863451004028, 0.08189444988965988, -0.04294928163290024, -0.13485664129257202, -0.23111389577388763, -0.10467525571584702, 0.07781562209129333, 0.2825815975666046, -0.0008310899138450623, -0.1987895369529724, 0.13204878568649292, 0.22792860865592957, -0.070456862449646, -0.13433176279067993, 0.10638993233442307, 0.2855088412761688, 0.32122090458869934, 0.2335401177406311, 0.25778067111968994, -0.334809273481369, -0.2253362089395523, 0.03455473482608795, -0.00044829025864601135, -0.24579739570617676, -0.024681560695171356, -0.2800191342830658, 0.20098374783992767, 0.03859840705990791, -0.6139501929283142, -0.13813170790672302, -0.43617498874664307, -0.20025131106376648, -0.034218963235616684, -0.13085156679153442, 0.3575483560562134, -0.16364237666130066, 0.15799032151699066, 0.28751471638679504, 0.06559901684522629, 0.05103176087141037, -0.08622199296951294, 0.02207363024353981, 0.3146094083786011, 0.20110788941383362, 0.26496243476867676, 0.20801399648189545, -0.07735099643468857, -0.04098409786820412, -0.01721661537885666, -0.2904090881347656, -0.1861938238143921, 0.1184687465429306, -0.20818720757961273, 0.11302658915519714, -0.3155680298805237, 0.3886965215206146, 0.39289751648902893, -0.23363927006721497, 0.11838936805725098, 0.25339069962501526, 0.039332009851932526, -0.3467806875705719, -0.0914635881781578, 0.11253762245178223, 0.12667390704154968, -0.050920020788908005, 0.247306227684021, 0.16306500136852264, 0.2504338324069977, -0.1723097413778305, 0.08548068255186081, 0.1885589212179184, -0.21833819150924683, 0.178214430809021, 0.4489647448062897, -0.258218914270401, 0.045216139405965805, 0.05155699700117111, -0.25499188899993896, 0.2289685606956482, 0.2283363938331604, -0.06483722478151321, 0.295948326587677, 0.4261493682861328, -0.03568049147725105, 0.3528614342212677, -0.1423235386610031, 0.030657818540930748, 0.05196071416139603, 0.13089241087436676, -0.015550054609775543, 0.045528583228588104, 0.4165058135986328, -0.008753764443099499, -0.04033134877681732, -0.21584640443325043, 0.22013652324676514, -0.08850520849227905, -0.1476963758468628, -0.2782488465309143, -0.3249232769012451, -0.11586296558380127, -0.05779607594013214, -0.045378539711236954, -0.14014746248722076, 0.706403374671936, 0.079798623919487, -0.07771241664886475, -0.43017855286598206, 0.40263891220092773, 0.2697792649269104, -0.12425253540277481, 0.03371371701359749, 0.25435173511505127, 0.4279123544692993, -0.3185235261917114, -0.0857156366109848, 0.5536986589431763, 0.6665911674499512, 0.4717917740345001, -0.39450764656066895, 0.07029669731855392, -0.11245247721672058, -0.18227899074554443, 0.055573880672454834, 0.22163629531860352, 0.05265319347381592, -0.03965343162417412, 0.11666250228881836, 0.020728567615151405, -0.0014102468267083168, 0.1776181161403656, 0.13534091413021088, 0.27555519342422485, -0.16884441673755646, 0.17167815566062927, -0.34147804975509644, -0.2661192715167999, 0.15580235421657562, -0.09024769812822342, -0.06424036622047424, 0.10226378589868546, 0.6065556406974792, 0.09300480037927628, 0.013100434094667435, -0.03607797250151634, -0.022339962422847748, 0.09541536867618561, 0.2906781733036041, 0.2984878420829773, 0.2318648099899292, -0.14597547054290771, -0.00680696964263916, -0.4679802358150482, 0.04772119224071503, -0.14627087116241455, -0.13646472990512848, 0.2612055838108063, 0.4154999852180481, 0.16815891861915588, 0.28913354873657227, 0.31570398807525635, -0.07544542849063873, 0.3857262432575226, 0.1278291642665863, -0.0786743089556694, -0.3377087116241455, -0.05919715762138367, 0.22877399623394012, -0.13623353838920593, -0.41667068004608154, 0.3047880530357361, -0.2719825506210327, -0.04775095731019974, -0.2536156177520752, -0.07169191539287567, 0.2647555470466614, 0.1359941065311432, 0.5345326662063599, 0.31682732701301575, 0.2748361825942993, 0.010668415576219559, -0.028413735330104828, -0.33387982845306396, -0.2982674539089203, -0.2113001048564911, 0.3667523264884949, -0.1701822727918625, 0.44773030281066895, -0.24920479953289032, -0.46423575282096863, -0.2789261043071747, 0.12078036367893219, -0.039221182465553284, -0.02014991268515587, -0.18121767044067383, 0.5001735091209412, -0.23746904730796814, -0.10327030718326569, -0.1335625797510147, -0.13894477486610413, -0.07070234417915344, 0.3442595303058624, -0.1417948305606842, -0.48923584818840027, 0.5753933191299438, -0.38821810483932495, -0.22262127697467804, -0.11553806811571121, -0.04740974307060242, 0.5173842310905457, -0.07865134626626968, -0.7344138622283936, -0.01109004020690918, 0.3903237283229828, -0.06649941205978394, -0.10737712681293488, 0.07146496325731277, -0.1244744062423706, -0.035735417157411575, -0.0067528001964092255, 0.643000602722168, -0.05534069985151291, -0.15253670513629913, 0.19939829409122467, -0.17205563187599182 ]
https://github.com/huggingface/datasets/issues/4981
Can't create a dataset with `float16` features
Thanks for the link…. didn’t realize arrow didn’t support it yet. Should it be removed from https://huggingface.co/docs/datasets/v2.4.0/en/package_reference/main_classes#datasets.Value until Arrow supports it?
## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4
21
Can't create a dataset with `float16` features ## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 Thanks for the link…. didn’t realize arrow didn’t support it yet. Should it be removed from https://huggingface.co/docs/datasets/v2.4.0/en/package_reference/main_classes#datasets.Value until Arrow supports it?
[ -0.2009882777929306, -0.10930380970239639, 0.016125444322824478, 0.021241173148155212, 0.38709986209869385, 0.15218710899353027, 0.45306962728500366, 0.033425502479076385, -0.2996401786804199, -0.06064164638519287, -0.10168614983558655, 0.39165961742401123, 0.08138644695281982, -0.2725028395652771, 0.05386701226234436, -0.28524065017700195, 0.3063649833202362, 0.04332839325070381, -0.18481168150901794, -0.022601041942834854, -0.1990492045879364, -0.3401804566383362, -0.2611536979675293, 0.17059750854969025, -0.1559762954711914, 0.018971078097820282, -0.08496809005737305, -0.11830157786607742, -0.5093178153038025, -0.27293258905410767, 0.24250976741313934, -0.13706576824188232, 0.25397172570228577, 0.5635740160942078, -0.0001274293172173202, -0.05802440643310547, 0.32713818550109863, 0.023302936926484108, -0.1843799203634262, -0.10865284502506256, 0.30563780665397644, -0.3205069601535797, 0.20863556861877441, -0.07551462948322296, -0.061374083161354065, -0.4296264350414276, -0.04463101178407669, -0.37546420097351074, 0.09877963364124298, 0.33850041031837463, 0.07996977865695953, 0.4241890013217926, 0.3578651249408722, -0.03421250730752945, 0.45074883103370667, 0.4039570093154907, -0.5992499589920044, 0.29422587156295776, 0.1359720230102539, -0.190775528550148, 0.021822452545166016, -0.14523367583751678, -0.30882593989372253, 0.12667979300022125, 0.1340358555316925, 0.02070295251905918, -0.3174879252910614, -0.5399730205535889, 0.006541889160871506, 0.41908931732177734, 0.35261908173561096, -0.40274855494499207, -0.42553430795669556, -0.08785778284072876, -0.19390881061553955, -0.2738761603832245, 0.03420600667595863, 0.40990519523620605, -0.1186908483505249, -0.016444560140371323, -0.06345303356647491, -0.20739704370498657, -0.18620286881923676, 0.15854501724243164, -0.1652776449918747, 0.34783393144607544, 0.10616662353277206, 0.2694159150123596, 0.05823955684900284, -0.23778541386127472, 0.24278852343559265, 0.014698839746415615, 0.19250856339931488, 0.4166063964366913, -0.15926699340343475, 0.22997263073921204, -0.08466974645853043, -0.012633845210075378, 0.31394410133361816, -0.14011476933956146, 0.17458698153495789, -0.07251515239477158, -0.16377468407154083, 0.29014572501182556, 0.03846806287765503, 0.06913262605667114, -0.2724461555480957, 0.2039286345243454, 0.2612970173358917, -0.16699519753456116, 0.4321260154247284, -0.07827672362327576, 0.05356742814183235, -0.26619917154312134, -0.009125448763370514, -0.04604879021644592, 0.3809537887573242, 0.003726024180650711, -0.20239710807800293, 0.08726012706756592, -0.20301571488380432, 0.036771658807992935, 0.012491287663578987, 0.06445305794477463, -0.04669033735990524, -0.10574231296777725, 0.15616841614246368, 0.5045014023780823, -0.33252838253974915, -0.17810915410518646, 0.033611394464969635, 0.007646363228559494, -0.05399911850690842, -0.23231655359268188, 0.17231160402297974, -0.3220874071121216, 0.09673260152339935, 0.41907256841659546, 0.06952518224716187, 0.23345455527305603, 0.147128164768219, -0.11583149433135986, 0.07660841941833496, 0.30969294905662537, 0.05454111471772194, 0.004066623747348785, 0.050598181784152985, 0.00018224865198135376, 0.07418554276227951, 0.4039927124977112, -0.007260158658027649, -0.17684891819953918, -0.6506955027580261, 0.04005052521824837, -0.26223844289779663, 0.12858529388904572, -0.0949387475848198, 0.24147972464561462, 0.44480517506599426, -0.019119786098599434, 0.16708838939666748, -0.28195399045944214, 0.1031244695186615, -0.391269326210022, 0.33751481771469116, 0.0132988840341568, -0.4363529682159424, 0.14479297399520874, -0.19500356912612915, -0.17097246646881104, 0.13314425945281982, 0.17532946169376373, -0.05014533922076225, 0.05009164661169052, -0.17867593467235565, 0.3053138256072998, 0.320515900850296, 0.29841357469558716, 0.08721606433391571, -0.2738025486469269, 0.14068736135959625, -0.11933491379022598, -0.1487503945827484, 0.19891256093978882, 0.08111049234867096, -0.021683312952518463, -0.09978131949901581, 0.1624314934015274, -0.3583245873451233, -0.1473839282989502, -0.0883869007229805, -0.2401062697172165, 0.624018669128418, 0.16689848899841309, -0.029464881867170334, -0.0566718652844429, 0.1613805741071701, -0.17129193246364594, 0.05252695828676224, -0.14857061207294464, 0.22635817527770996, -0.12711253762245178, 0.4069528579711914, 0.0938057228922844, 0.18390890955924988, -0.07957218587398529, -0.3487452268600464, 0.12162194401025772, 0.21531470119953156, 0.14144186675548553, 0.017554201185703278, 0.07789299637079239, -0.007133743725717068, 0.20382395386695862, 0.006942667067050934, -0.014258190989494324, -0.07020698487758636, -0.05855531990528107, 0.09015767276287079, -0.020606812089681625, -0.1422797590494156, -0.290919691324234, -0.02590198814868927, 0.18529349565505981, -0.43637365102767944, 0.41223201155662537, -0.10597900301218033, -0.38027819991111755, -0.05395900830626488, 0.20368218421936035, 0.11905805766582489, 0.05571179836988449, -0.08093709498643875, 0.3548550307750702, 0.17698223888874054, 0.08613050729036331, -0.391571044921875, 0.39116817712783813, 0.2704872190952301, -0.5048338174819946, 0.2723015546798706, 0.38557595014572144, 0.057458579540252686, 0.09725967794656754, 0.04880831018090248, 0.46721404790878296, -0.00625479593873024, 0.08490342646837234, -0.05847679451107979, 0.29040566086769104, 0.22908926010131836, 0.16976875066757202, -0.009310935623943806, 0.10481518507003784, 0.3094991147518158, -0.0630064606666565, 0.20576724410057068, -0.17405818402767181, -0.5079026222229004, 0.11875929683446884, -0.12462793290615082, -0.1970576047897339, 0.45767688751220703, 0.11689792573451996, -0.06620291620492935, 0.007442843168973923, 0.2048606127500534, -0.5006636381149292, 0.2638867497444153, 0.026012856513261795, 0.1352425515651703, 0.056765347719192505, -0.5381006598472595, -0.06209258735179901, 0.3258526623249054, -0.12251150608062744, 0.07606235146522522, 0.018427208065986633, 0.31827494502067566, -0.11010923236608505, -0.142548069357872, 0.2787318527698517, -0.07677961140871048, 0.1815873682498932, -0.5350092053413391, -0.048958584666252136, -0.15815098583698273, 0.17585048079490662, -0.21533122658729553, -0.06486194580793381, -0.31521034240722656, -0.2781312167644501, 0.0194306131452322, 0.40660178661346436, -0.14430977404117584, 0.2010667622089386, -0.2259627729654312, -0.07140956819057465, 0.1662759780883789, 0.16304393112659454, -0.14671751856803894, -0.13962936401367188, -0.2608131766319275, -0.004917725920677185, -0.04772023856639862, -0.29089999198913574, 0.27469784021377563, 0.26566264033317566, -0.13257154822349548, -0.4878038167953491, -0.6215579509735107, 0.15377746522426605, 0.01712367683649063, 0.5996179580688477, 0.34862425923347473, -0.013032771646976471, 0.10305455327033997, -0.07220446318387985, 0.23234441876411438, 0.0001151449978351593, -0.254052996635437, 0.20911499857902527, -0.31698164343833923, 0.03360975906252861, -0.29351744055747986, -0.1948186457157135, -0.16737471520900726, -0.19409050047397614, 0.09914541244506836, -0.10149432718753815, 0.05044029653072357, -0.11342798918485641, 0.2796400487422943, 0.047889307141304016, 0.1813199371099472, -0.2319115698337555, -0.15135546028614044, 0.16422182321548462, 0.6436343193054199, -0.35686996579170227, -0.4152831733226776, -0.06628052145242691, -0.16795821487903595, -0.25646674633026123, 0.3040205240249634, -0.2865667939186096, 0.14883705973625183, -0.22618477046489716, 0.6788866519927979, -0.17458249628543854, 0.2373189628124237, 0.11796550452709198, -0.046569857746362686, 0.20879516005516052, -0.2899356484413147, -0.27518966794013977, -0.06609175354242325, 0.07361122965812683, 0.30628079175949097, 0.1089000552892685, 0.42621323466300964, -0.00225081667304039, 0.6371802091598511, -0.04519385099411011, -0.15905094146728516, 0.3047466576099396, -0.30396056175231934, 0.32312482595443726, -0.24753615260124207, -0.3175903558731079, 0.2147320806980133, 0.03976888209581375, -0.14489367604255676, -0.10875818133354187, 0.04771826043725014, -0.19861923158168793, -0.05180380493402481, 0.12018068134784698, -0.12656450271606445, -0.07831932604312897, 0.07994028925895691, -0.1424388438463211, 0.23483827710151672, -0.06588040292263031, 0.01004183292388916, -0.03218698129057884, -0.23428165912628174, -0.11358289420604706, -0.15178385376930237, 0.2322603464126587, 0.0979398861527443, -0.2405989170074463, -0.31539836525917053, -0.3051488697528839, 0.15628671646118164, 0.1702616661787033, 0.5178305506706238, 0.1291535347700119, -0.08290588110685349, -0.019561924040317535, 0.009245960973203182, 0.5540453195571899, -0.059689879417419434, -0.006880618631839752, 0.07963816821575165, 0.3896000385284424, -0.8895676732063293, -0.18867886066436768, -0.08833999931812286, 0.41358545422554016, -0.005708619952201843, -0.14526426792144775, -0.36968979239463806, 0.021376674994826317, 0.23090288043022156, 0.4420981705188751, -0.16553166508674622, 0.1567024290561676, -0.3195832669734955, -0.48719555139541626, 0.04733787477016449, -0.21554362773895264, 0.13172976672649384, 0.011116134002804756, -0.20342202484607697, 0.10264135897159576, -0.11034497618675232, -0.13309159874916077, 0.02849038690328598, -0.01962541975080967, 0.23249942064285278, -0.2458992302417755, 0.25920987129211426, 0.07764463871717453, -0.2785908877849579, 0.29049673676490784, 0.3470986783504486, 0.3098409175872803, -0.17887619137763977, 0.1691378355026245, -0.0003693141043186188, 0.2408038079738617, -0.06750564277172089, -0.04090237617492676, 0.103031687438488, -0.0279231034219265, 0.05313124507665634, -0.16049589216709137, -0.18759305775165558, 0.19455169141292572, -0.15676021575927734, -0.1084338128566742, -0.13778163492679596, 0.5937711596488953, 0.0074049197137355804, 0.0851878970861435, 0.35843631625175476, 0.024016648530960083, -0.2130156308412552, 0.3375999927520752, 0.4357931613922119, 0.8538236021995544, 0.049039531499147415, -0.02730650082230568, 0.5003535151481628, -0.27718502283096313, 0.6113311648368835, 0.007908154278993607, -0.16320225596427917, -0.48226693272590637, 0.125383660197258, -0.10050641745328903, -0.2996918261051178, 0.18428602814674377, -0.17226704955101013, -0.2057236284017563, 0.06799802929162979, -0.5603979825973511, 0.3460778295993805, 0.1378689557313919, -0.00827731192111969, 0.006354721263051033, -0.020977310836315155, 0.02589147910475731, 0.017484959214925766, -0.049804940819740295, -0.05166104808449745, 0.0016712285578250885, 0.09800387918949127, -0.2691466808319092, -0.29746782779693604, -0.6034275889396667, -0.042835064232349396, -0.35232463479042053, 0.2549137473106384, 0.24177739024162292, -0.21315033733844757, 0.00832124799489975, 0.07583989948034286, 0.44250982999801636, -0.12718063592910767, -0.20705437660217285, 0.05514562129974365, 0.3489169180393219, -0.07071169465780258, 0.11349056661128998, 0.031792715191841125, 0.09025630354881287, -0.049087733030319214, -0.3630618155002594, 0.06516790390014648, -0.01939462125301361, 0.06788906455039978, -0.14831256866455078, -0.08773626387119293, 0.1735137403011322, -0.2894706726074219, -0.020574716851115227, -0.2216566801071167, 0.2498345971107483, -0.23599614202976227, 0.013944437727332115, 0.16499733924865723, -0.02381627820432186, 0.1253248006105423, -0.16987824440002441, 0.13464540243148804, -0.22948192059993744, 0.1340651512145996, 0.037361517548561096, 0.11513309180736542, 0.23605507612228394, 0.5455991625785828, -0.21919867396354675, -0.028531715273857117, 0.23761001229286194, 0.25836649537086487, -0.6207526326179504, 0.1218966692686081, -0.2193095088005066, -0.11131282895803452, -0.3863028287887573, 0.13781863451004028, 0.08189444988965988, -0.04294928163290024, -0.13485664129257202, -0.23111389577388763, -0.10467525571584702, 0.07781562209129333, 0.2825815975666046, -0.0008310899138450623, -0.1987895369529724, 0.13204878568649292, 0.22792860865592957, -0.070456862449646, -0.13433176279067993, 0.10638993233442307, 0.2855088412761688, 0.32122090458869934, 0.2335401177406311, 0.25778067111968994, -0.334809273481369, -0.2253362089395523, 0.03455473482608795, -0.00044829025864601135, -0.24579739570617676, -0.024681560695171356, -0.2800191342830658, 0.20098374783992767, 0.03859840705990791, -0.6139501929283142, -0.13813170790672302, -0.43617498874664307, -0.20025131106376648, -0.034218963235616684, -0.13085156679153442, 0.3575483560562134, -0.16364237666130066, 0.15799032151699066, 0.28751471638679504, 0.06559901684522629, 0.05103176087141037, -0.08622199296951294, 0.02207363024353981, 0.3146094083786011, 0.20110788941383362, 0.26496243476867676, 0.20801399648189545, -0.07735099643468857, -0.04098409786820412, -0.01721661537885666, -0.2904090881347656, -0.1861938238143921, 0.1184687465429306, -0.20818720757961273, 0.11302658915519714, -0.3155680298805237, 0.3886965215206146, 0.39289751648902893, -0.23363927006721497, 0.11838936805725098, 0.25339069962501526, 0.039332009851932526, -0.3467806875705719, -0.0914635881781578, 0.11253762245178223, 0.12667390704154968, -0.050920020788908005, 0.247306227684021, 0.16306500136852264, 0.2504338324069977, -0.1723097413778305, 0.08548068255186081, 0.1885589212179184, -0.21833819150924683, 0.178214430809021, 0.4489647448062897, -0.258218914270401, 0.045216139405965805, 0.05155699700117111, -0.25499188899993896, 0.2289685606956482, 0.2283363938331604, -0.06483722478151321, 0.295948326587677, 0.4261493682861328, -0.03568049147725105, 0.3528614342212677, -0.1423235386610031, 0.030657818540930748, 0.05196071416139603, 0.13089241087436676, -0.015550054609775543, 0.045528583228588104, 0.4165058135986328, -0.008753764443099499, -0.04033134877681732, -0.21584640443325043, 0.22013652324676514, -0.08850520849227905, -0.1476963758468628, -0.2782488465309143, -0.3249232769012451, -0.11586296558380127, -0.05779607594013214, -0.045378539711236954, -0.14014746248722076, 0.706403374671936, 0.079798623919487, -0.07771241664886475, -0.43017855286598206, 0.40263891220092773, 0.2697792649269104, -0.12425253540277481, 0.03371371701359749, 0.25435173511505127, 0.4279123544692993, -0.3185235261917114, -0.0857156366109848, 0.5536986589431763, 0.6665911674499512, 0.4717917740345001, -0.39450764656066895, 0.07029669731855392, -0.11245247721672058, -0.18227899074554443, 0.055573880672454834, 0.22163629531860352, 0.05265319347381592, -0.03965343162417412, 0.11666250228881836, 0.020728567615151405, -0.0014102468267083168, 0.1776181161403656, 0.13534091413021088, 0.27555519342422485, -0.16884441673755646, 0.17167815566062927, -0.34147804975509644, -0.2661192715167999, 0.15580235421657562, -0.09024769812822342, -0.06424036622047424, 0.10226378589868546, 0.6065556406974792, 0.09300480037927628, 0.013100434094667435, -0.03607797250151634, -0.022339962422847748, 0.09541536867618561, 0.2906781733036041, 0.2984878420829773, 0.2318648099899292, -0.14597547054290771, -0.00680696964263916, -0.4679802358150482, 0.04772119224071503, -0.14627087116241455, -0.13646472990512848, 0.2612055838108063, 0.4154999852180481, 0.16815891861915588, 0.28913354873657227, 0.31570398807525635, -0.07544542849063873, 0.3857262432575226, 0.1278291642665863, -0.0786743089556694, -0.3377087116241455, -0.05919715762138367, 0.22877399623394012, -0.13623353838920593, -0.41667068004608154, 0.3047880530357361, -0.2719825506210327, -0.04775095731019974, -0.2536156177520752, -0.07169191539287567, 0.2647555470466614, 0.1359941065311432, 0.5345326662063599, 0.31682732701301575, 0.2748361825942993, 0.010668415576219559, -0.028413735330104828, -0.33387982845306396, -0.2982674539089203, -0.2113001048564911, 0.3667523264884949, -0.1701822727918625, 0.44773030281066895, -0.24920479953289032, -0.46423575282096863, -0.2789261043071747, 0.12078036367893219, -0.039221182465553284, -0.02014991268515587, -0.18121767044067383, 0.5001735091209412, -0.23746904730796814, -0.10327030718326569, -0.1335625797510147, -0.13894477486610413, -0.07070234417915344, 0.3442595303058624, -0.1417948305606842, -0.48923584818840027, 0.5753933191299438, -0.38821810483932495, -0.22262127697467804, -0.11553806811571121, -0.04740974307060242, 0.5173842310905457, -0.07865134626626968, -0.7344138622283936, -0.01109004020690918, 0.3903237283229828, -0.06649941205978394, -0.10737712681293488, 0.07146496325731277, -0.1244744062423706, -0.035735417157411575, -0.0067528001964092255, 0.643000602722168, -0.05534069985151291, -0.15253670513629913, 0.19939829409122467, -0.17205563187599182 ]
https://github.com/huggingface/datasets/issues/4981
Can't create a dataset with `float16` features
Yes, you are right: maybe we should either remove it from our docs or add a comment explaining the issue. The thing is that in Arrow it is partially supported: you can create `float16` values, but you can't cast them from/to other types. And current implementation of `Value` always tries to perform a cast from `float64` to `float16`.
## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4
58
Can't create a dataset with `float16` features ## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 Yes, you are right: maybe we should either remove it from our docs or add a comment explaining the issue. The thing is that in Arrow it is partially supported: you can create `float16` values, but you can't cast them from/to other types. And current implementation of `Value` always tries to perform a cast from `float64` to `float16`.
[ -0.2009882777929306, -0.10930380970239639, 0.016125444322824478, 0.021241173148155212, 0.38709986209869385, 0.15218710899353027, 0.45306962728500366, 0.033425502479076385, -0.2996401786804199, -0.06064164638519287, -0.10168614983558655, 0.39165961742401123, 0.08138644695281982, -0.2725028395652771, 0.05386701226234436, -0.28524065017700195, 0.3063649833202362, 0.04332839325070381, -0.18481168150901794, -0.022601041942834854, -0.1990492045879364, -0.3401804566383362, -0.2611536979675293, 0.17059750854969025, -0.1559762954711914, 0.018971078097820282, -0.08496809005737305, -0.11830157786607742, -0.5093178153038025, -0.27293258905410767, 0.24250976741313934, -0.13706576824188232, 0.25397172570228577, 0.5635740160942078, -0.0001274293172173202, -0.05802440643310547, 0.32713818550109863, 0.023302936926484108, -0.1843799203634262, -0.10865284502506256, 0.30563780665397644, -0.3205069601535797, 0.20863556861877441, -0.07551462948322296, -0.061374083161354065, -0.4296264350414276, -0.04463101178407669, -0.37546420097351074, 0.09877963364124298, 0.33850041031837463, 0.07996977865695953, 0.4241890013217926, 0.3578651249408722, -0.03421250730752945, 0.45074883103370667, 0.4039570093154907, -0.5992499589920044, 0.29422587156295776, 0.1359720230102539, -0.190775528550148, 0.021822452545166016, -0.14523367583751678, -0.30882593989372253, 0.12667979300022125, 0.1340358555316925, 0.02070295251905918, -0.3174879252910614, -0.5399730205535889, 0.006541889160871506, 0.41908931732177734, 0.35261908173561096, -0.40274855494499207, -0.42553430795669556, -0.08785778284072876, -0.19390881061553955, -0.2738761603832245, 0.03420600667595863, 0.40990519523620605, -0.1186908483505249, -0.016444560140371323, -0.06345303356647491, -0.20739704370498657, -0.18620286881923676, 0.15854501724243164, -0.1652776449918747, 0.34783393144607544, 0.10616662353277206, 0.2694159150123596, 0.05823955684900284, -0.23778541386127472, 0.24278852343559265, 0.014698839746415615, 0.19250856339931488, 0.4166063964366913, -0.15926699340343475, 0.22997263073921204, -0.08466974645853043, -0.012633845210075378, 0.31394410133361816, -0.14011476933956146, 0.17458698153495789, -0.07251515239477158, -0.16377468407154083, 0.29014572501182556, 0.03846806287765503, 0.06913262605667114, -0.2724461555480957, 0.2039286345243454, 0.2612970173358917, -0.16699519753456116, 0.4321260154247284, -0.07827672362327576, 0.05356742814183235, -0.26619917154312134, -0.009125448763370514, -0.04604879021644592, 0.3809537887573242, 0.003726024180650711, -0.20239710807800293, 0.08726012706756592, -0.20301571488380432, 0.036771658807992935, 0.012491287663578987, 0.06445305794477463, -0.04669033735990524, -0.10574231296777725, 0.15616841614246368, 0.5045014023780823, -0.33252838253974915, -0.17810915410518646, 0.033611394464969635, 0.007646363228559494, -0.05399911850690842, -0.23231655359268188, 0.17231160402297974, -0.3220874071121216, 0.09673260152339935, 0.41907256841659546, 0.06952518224716187, 0.23345455527305603, 0.147128164768219, -0.11583149433135986, 0.07660841941833496, 0.30969294905662537, 0.05454111471772194, 0.004066623747348785, 0.050598181784152985, 0.00018224865198135376, 0.07418554276227951, 0.4039927124977112, -0.007260158658027649, -0.17684891819953918, -0.6506955027580261, 0.04005052521824837, -0.26223844289779663, 0.12858529388904572, -0.0949387475848198, 0.24147972464561462, 0.44480517506599426, -0.019119786098599434, 0.16708838939666748, -0.28195399045944214, 0.1031244695186615, -0.391269326210022, 0.33751481771469116, 0.0132988840341568, -0.4363529682159424, 0.14479297399520874, -0.19500356912612915, -0.17097246646881104, 0.13314425945281982, 0.17532946169376373, -0.05014533922076225, 0.05009164661169052, -0.17867593467235565, 0.3053138256072998, 0.320515900850296, 0.29841357469558716, 0.08721606433391571, -0.2738025486469269, 0.14068736135959625, -0.11933491379022598, -0.1487503945827484, 0.19891256093978882, 0.08111049234867096, -0.021683312952518463, -0.09978131949901581, 0.1624314934015274, -0.3583245873451233, -0.1473839282989502, -0.0883869007229805, -0.2401062697172165, 0.624018669128418, 0.16689848899841309, -0.029464881867170334, -0.0566718652844429, 0.1613805741071701, -0.17129193246364594, 0.05252695828676224, -0.14857061207294464, 0.22635817527770996, -0.12711253762245178, 0.4069528579711914, 0.0938057228922844, 0.18390890955924988, -0.07957218587398529, -0.3487452268600464, 0.12162194401025772, 0.21531470119953156, 0.14144186675548553, 0.017554201185703278, 0.07789299637079239, -0.007133743725717068, 0.20382395386695862, 0.006942667067050934, -0.014258190989494324, -0.07020698487758636, -0.05855531990528107, 0.09015767276287079, -0.020606812089681625, -0.1422797590494156, -0.290919691324234, -0.02590198814868927, 0.18529349565505981, -0.43637365102767944, 0.41223201155662537, -0.10597900301218033, -0.38027819991111755, -0.05395900830626488, 0.20368218421936035, 0.11905805766582489, 0.05571179836988449, -0.08093709498643875, 0.3548550307750702, 0.17698223888874054, 0.08613050729036331, -0.391571044921875, 0.39116817712783813, 0.2704872190952301, -0.5048338174819946, 0.2723015546798706, 0.38557595014572144, 0.057458579540252686, 0.09725967794656754, 0.04880831018090248, 0.46721404790878296, -0.00625479593873024, 0.08490342646837234, -0.05847679451107979, 0.29040566086769104, 0.22908926010131836, 0.16976875066757202, -0.009310935623943806, 0.10481518507003784, 0.3094991147518158, -0.0630064606666565, 0.20576724410057068, -0.17405818402767181, -0.5079026222229004, 0.11875929683446884, -0.12462793290615082, -0.1970576047897339, 0.45767688751220703, 0.11689792573451996, -0.06620291620492935, 0.007442843168973923, 0.2048606127500534, -0.5006636381149292, 0.2638867497444153, 0.026012856513261795, 0.1352425515651703, 0.056765347719192505, -0.5381006598472595, -0.06209258735179901, 0.3258526623249054, -0.12251150608062744, 0.07606235146522522, 0.018427208065986633, 0.31827494502067566, -0.11010923236608505, -0.142548069357872, 0.2787318527698517, -0.07677961140871048, 0.1815873682498932, -0.5350092053413391, -0.048958584666252136, -0.15815098583698273, 0.17585048079490662, -0.21533122658729553, -0.06486194580793381, -0.31521034240722656, -0.2781312167644501, 0.0194306131452322, 0.40660178661346436, -0.14430977404117584, 0.2010667622089386, -0.2259627729654312, -0.07140956819057465, 0.1662759780883789, 0.16304393112659454, -0.14671751856803894, -0.13962936401367188, -0.2608131766319275, -0.004917725920677185, -0.04772023856639862, -0.29089999198913574, 0.27469784021377563, 0.26566264033317566, -0.13257154822349548, -0.4878038167953491, -0.6215579509735107, 0.15377746522426605, 0.01712367683649063, 0.5996179580688477, 0.34862425923347473, -0.013032771646976471, 0.10305455327033997, -0.07220446318387985, 0.23234441876411438, 0.0001151449978351593, -0.254052996635437, 0.20911499857902527, -0.31698164343833923, 0.03360975906252861, -0.29351744055747986, -0.1948186457157135, -0.16737471520900726, -0.19409050047397614, 0.09914541244506836, -0.10149432718753815, 0.05044029653072357, -0.11342798918485641, 0.2796400487422943, 0.047889307141304016, 0.1813199371099472, -0.2319115698337555, -0.15135546028614044, 0.16422182321548462, 0.6436343193054199, -0.35686996579170227, -0.4152831733226776, -0.06628052145242691, -0.16795821487903595, -0.25646674633026123, 0.3040205240249634, -0.2865667939186096, 0.14883705973625183, -0.22618477046489716, 0.6788866519927979, -0.17458249628543854, 0.2373189628124237, 0.11796550452709198, -0.046569857746362686, 0.20879516005516052, -0.2899356484413147, -0.27518966794013977, -0.06609175354242325, 0.07361122965812683, 0.30628079175949097, 0.1089000552892685, 0.42621323466300964, -0.00225081667304039, 0.6371802091598511, -0.04519385099411011, -0.15905094146728516, 0.3047466576099396, -0.30396056175231934, 0.32312482595443726, -0.24753615260124207, -0.3175903558731079, 0.2147320806980133, 0.03976888209581375, -0.14489367604255676, -0.10875818133354187, 0.04771826043725014, -0.19861923158168793, -0.05180380493402481, 0.12018068134784698, -0.12656450271606445, -0.07831932604312897, 0.07994028925895691, -0.1424388438463211, 0.23483827710151672, -0.06588040292263031, 0.01004183292388916, -0.03218698129057884, -0.23428165912628174, -0.11358289420604706, -0.15178385376930237, 0.2322603464126587, 0.0979398861527443, -0.2405989170074463, -0.31539836525917053, -0.3051488697528839, 0.15628671646118164, 0.1702616661787033, 0.5178305506706238, 0.1291535347700119, -0.08290588110685349, -0.019561924040317535, 0.009245960973203182, 0.5540453195571899, -0.059689879417419434, -0.006880618631839752, 0.07963816821575165, 0.3896000385284424, -0.8895676732063293, -0.18867886066436768, -0.08833999931812286, 0.41358545422554016, -0.005708619952201843, -0.14526426792144775, -0.36968979239463806, 0.021376674994826317, 0.23090288043022156, 0.4420981705188751, -0.16553166508674622, 0.1567024290561676, -0.3195832669734955, -0.48719555139541626, 0.04733787477016449, -0.21554362773895264, 0.13172976672649384, 0.011116134002804756, -0.20342202484607697, 0.10264135897159576, -0.11034497618675232, -0.13309159874916077, 0.02849038690328598, -0.01962541975080967, 0.23249942064285278, -0.2458992302417755, 0.25920987129211426, 0.07764463871717453, -0.2785908877849579, 0.29049673676490784, 0.3470986783504486, 0.3098409175872803, -0.17887619137763977, 0.1691378355026245, -0.0003693141043186188, 0.2408038079738617, -0.06750564277172089, -0.04090237617492676, 0.103031687438488, -0.0279231034219265, 0.05313124507665634, -0.16049589216709137, -0.18759305775165558, 0.19455169141292572, -0.15676021575927734, -0.1084338128566742, -0.13778163492679596, 0.5937711596488953, 0.0074049197137355804, 0.0851878970861435, 0.35843631625175476, 0.024016648530960083, -0.2130156308412552, 0.3375999927520752, 0.4357931613922119, 0.8538236021995544, 0.049039531499147415, -0.02730650082230568, 0.5003535151481628, -0.27718502283096313, 0.6113311648368835, 0.007908154278993607, -0.16320225596427917, -0.48226693272590637, 0.125383660197258, -0.10050641745328903, -0.2996918261051178, 0.18428602814674377, -0.17226704955101013, -0.2057236284017563, 0.06799802929162979, -0.5603979825973511, 0.3460778295993805, 0.1378689557313919, -0.00827731192111969, 0.006354721263051033, -0.020977310836315155, 0.02589147910475731, 0.017484959214925766, -0.049804940819740295, -0.05166104808449745, 0.0016712285578250885, 0.09800387918949127, -0.2691466808319092, -0.29746782779693604, -0.6034275889396667, -0.042835064232349396, -0.35232463479042053, 0.2549137473106384, 0.24177739024162292, -0.21315033733844757, 0.00832124799489975, 0.07583989948034286, 0.44250982999801636, -0.12718063592910767, -0.20705437660217285, 0.05514562129974365, 0.3489169180393219, -0.07071169465780258, 0.11349056661128998, 0.031792715191841125, 0.09025630354881287, -0.049087733030319214, -0.3630618155002594, 0.06516790390014648, -0.01939462125301361, 0.06788906455039978, -0.14831256866455078, -0.08773626387119293, 0.1735137403011322, -0.2894706726074219, -0.020574716851115227, -0.2216566801071167, 0.2498345971107483, -0.23599614202976227, 0.013944437727332115, 0.16499733924865723, -0.02381627820432186, 0.1253248006105423, -0.16987824440002441, 0.13464540243148804, -0.22948192059993744, 0.1340651512145996, 0.037361517548561096, 0.11513309180736542, 0.23605507612228394, 0.5455991625785828, -0.21919867396354675, -0.028531715273857117, 0.23761001229286194, 0.25836649537086487, -0.6207526326179504, 0.1218966692686081, -0.2193095088005066, -0.11131282895803452, -0.3863028287887573, 0.13781863451004028, 0.08189444988965988, -0.04294928163290024, -0.13485664129257202, -0.23111389577388763, -0.10467525571584702, 0.07781562209129333, 0.2825815975666046, -0.0008310899138450623, -0.1987895369529724, 0.13204878568649292, 0.22792860865592957, -0.070456862449646, -0.13433176279067993, 0.10638993233442307, 0.2855088412761688, 0.32122090458869934, 0.2335401177406311, 0.25778067111968994, -0.334809273481369, -0.2253362089395523, 0.03455473482608795, -0.00044829025864601135, -0.24579739570617676, -0.024681560695171356, -0.2800191342830658, 0.20098374783992767, 0.03859840705990791, -0.6139501929283142, -0.13813170790672302, -0.43617498874664307, -0.20025131106376648, -0.034218963235616684, -0.13085156679153442, 0.3575483560562134, -0.16364237666130066, 0.15799032151699066, 0.28751471638679504, 0.06559901684522629, 0.05103176087141037, -0.08622199296951294, 0.02207363024353981, 0.3146094083786011, 0.20110788941383362, 0.26496243476867676, 0.20801399648189545, -0.07735099643468857, -0.04098409786820412, -0.01721661537885666, -0.2904090881347656, -0.1861938238143921, 0.1184687465429306, -0.20818720757961273, 0.11302658915519714, -0.3155680298805237, 0.3886965215206146, 0.39289751648902893, -0.23363927006721497, 0.11838936805725098, 0.25339069962501526, 0.039332009851932526, -0.3467806875705719, -0.0914635881781578, 0.11253762245178223, 0.12667390704154968, -0.050920020788908005, 0.247306227684021, 0.16306500136852264, 0.2504338324069977, -0.1723097413778305, 0.08548068255186081, 0.1885589212179184, -0.21833819150924683, 0.178214430809021, 0.4489647448062897, -0.258218914270401, 0.045216139405965805, 0.05155699700117111, -0.25499188899993896, 0.2289685606956482, 0.2283363938331604, -0.06483722478151321, 0.295948326587677, 0.4261493682861328, -0.03568049147725105, 0.3528614342212677, -0.1423235386610031, 0.030657818540930748, 0.05196071416139603, 0.13089241087436676, -0.015550054609775543, 0.045528583228588104, 0.4165058135986328, -0.008753764443099499, -0.04033134877681732, -0.21584640443325043, 0.22013652324676514, -0.08850520849227905, -0.1476963758468628, -0.2782488465309143, -0.3249232769012451, -0.11586296558380127, -0.05779607594013214, -0.045378539711236954, -0.14014746248722076, 0.706403374671936, 0.079798623919487, -0.07771241664886475, -0.43017855286598206, 0.40263891220092773, 0.2697792649269104, -0.12425253540277481, 0.03371371701359749, 0.25435173511505127, 0.4279123544692993, -0.3185235261917114, -0.0857156366109848, 0.5536986589431763, 0.6665911674499512, 0.4717917740345001, -0.39450764656066895, 0.07029669731855392, -0.11245247721672058, -0.18227899074554443, 0.055573880672454834, 0.22163629531860352, 0.05265319347381592, -0.03965343162417412, 0.11666250228881836, 0.020728567615151405, -0.0014102468267083168, 0.1776181161403656, 0.13534091413021088, 0.27555519342422485, -0.16884441673755646, 0.17167815566062927, -0.34147804975509644, -0.2661192715167999, 0.15580235421657562, -0.09024769812822342, -0.06424036622047424, 0.10226378589868546, 0.6065556406974792, 0.09300480037927628, 0.013100434094667435, -0.03607797250151634, -0.022339962422847748, 0.09541536867618561, 0.2906781733036041, 0.2984878420829773, 0.2318648099899292, -0.14597547054290771, -0.00680696964263916, -0.4679802358150482, 0.04772119224071503, -0.14627087116241455, -0.13646472990512848, 0.2612055838108063, 0.4154999852180481, 0.16815891861915588, 0.28913354873657227, 0.31570398807525635, -0.07544542849063873, 0.3857262432575226, 0.1278291642665863, -0.0786743089556694, -0.3377087116241455, -0.05919715762138367, 0.22877399623394012, -0.13623353838920593, -0.41667068004608154, 0.3047880530357361, -0.2719825506210327, -0.04775095731019974, -0.2536156177520752, -0.07169191539287567, 0.2647555470466614, 0.1359941065311432, 0.5345326662063599, 0.31682732701301575, 0.2748361825942993, 0.010668415576219559, -0.028413735330104828, -0.33387982845306396, -0.2982674539089203, -0.2113001048564911, 0.3667523264884949, -0.1701822727918625, 0.44773030281066895, -0.24920479953289032, -0.46423575282096863, -0.2789261043071747, 0.12078036367893219, -0.039221182465553284, -0.02014991268515587, -0.18121767044067383, 0.5001735091209412, -0.23746904730796814, -0.10327030718326569, -0.1335625797510147, -0.13894477486610413, -0.07070234417915344, 0.3442595303058624, -0.1417948305606842, -0.48923584818840027, 0.5753933191299438, -0.38821810483932495, -0.22262127697467804, -0.11553806811571121, -0.04740974307060242, 0.5173842310905457, -0.07865134626626968, -0.7344138622283936, -0.01109004020690918, 0.3903237283229828, -0.06649941205978394, -0.10737712681293488, 0.07146496325731277, -0.1244744062423706, -0.035735417157411575, -0.0067528001964092255, 0.643000602722168, -0.05534069985151291, -0.15253670513629913, 0.19939829409122467, -0.17205563187599182 ]
https://github.com/huggingface/datasets/issues/4981
Can't create a dataset with `float16` features
Would you accept a PR to fix this? @lhoestq Do you have an idea of how hard it would be to fix?
## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4
22
Can't create a dataset with `float16` features ## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 Would you accept a PR to fix this? @lhoestq Do you have an idea of how hard it would be to fix?
[ -0.2009882777929306, -0.10930380970239639, 0.016125444322824478, 0.021241173148155212, 0.38709986209869385, 0.15218710899353027, 0.45306962728500366, 0.033425502479076385, -0.2996401786804199, -0.06064164638519287, -0.10168614983558655, 0.39165961742401123, 0.08138644695281982, -0.2725028395652771, 0.05386701226234436, -0.28524065017700195, 0.3063649833202362, 0.04332839325070381, -0.18481168150901794, -0.022601041942834854, -0.1990492045879364, -0.3401804566383362, -0.2611536979675293, 0.17059750854969025, -0.1559762954711914, 0.018971078097820282, -0.08496809005737305, -0.11830157786607742, -0.5093178153038025, -0.27293258905410767, 0.24250976741313934, -0.13706576824188232, 0.25397172570228577, 0.5635740160942078, -0.0001274293172173202, -0.05802440643310547, 0.32713818550109863, 0.023302936926484108, -0.1843799203634262, -0.10865284502506256, 0.30563780665397644, -0.3205069601535797, 0.20863556861877441, -0.07551462948322296, -0.061374083161354065, -0.4296264350414276, -0.04463101178407669, -0.37546420097351074, 0.09877963364124298, 0.33850041031837463, 0.07996977865695953, 0.4241890013217926, 0.3578651249408722, -0.03421250730752945, 0.45074883103370667, 0.4039570093154907, -0.5992499589920044, 0.29422587156295776, 0.1359720230102539, -0.190775528550148, 0.021822452545166016, -0.14523367583751678, -0.30882593989372253, 0.12667979300022125, 0.1340358555316925, 0.02070295251905918, -0.3174879252910614, -0.5399730205535889, 0.006541889160871506, 0.41908931732177734, 0.35261908173561096, -0.40274855494499207, -0.42553430795669556, -0.08785778284072876, -0.19390881061553955, -0.2738761603832245, 0.03420600667595863, 0.40990519523620605, -0.1186908483505249, -0.016444560140371323, -0.06345303356647491, -0.20739704370498657, -0.18620286881923676, 0.15854501724243164, -0.1652776449918747, 0.34783393144607544, 0.10616662353277206, 0.2694159150123596, 0.05823955684900284, -0.23778541386127472, 0.24278852343559265, 0.014698839746415615, 0.19250856339931488, 0.4166063964366913, -0.15926699340343475, 0.22997263073921204, -0.08466974645853043, -0.012633845210075378, 0.31394410133361816, -0.14011476933956146, 0.17458698153495789, -0.07251515239477158, -0.16377468407154083, 0.29014572501182556, 0.03846806287765503, 0.06913262605667114, -0.2724461555480957, 0.2039286345243454, 0.2612970173358917, -0.16699519753456116, 0.4321260154247284, -0.07827672362327576, 0.05356742814183235, -0.26619917154312134, -0.009125448763370514, -0.04604879021644592, 0.3809537887573242, 0.003726024180650711, -0.20239710807800293, 0.08726012706756592, -0.20301571488380432, 0.036771658807992935, 0.012491287663578987, 0.06445305794477463, -0.04669033735990524, -0.10574231296777725, 0.15616841614246368, 0.5045014023780823, -0.33252838253974915, -0.17810915410518646, 0.033611394464969635, 0.007646363228559494, -0.05399911850690842, -0.23231655359268188, 0.17231160402297974, -0.3220874071121216, 0.09673260152339935, 0.41907256841659546, 0.06952518224716187, 0.23345455527305603, 0.147128164768219, -0.11583149433135986, 0.07660841941833496, 0.30969294905662537, 0.05454111471772194, 0.004066623747348785, 0.050598181784152985, 0.00018224865198135376, 0.07418554276227951, 0.4039927124977112, -0.007260158658027649, -0.17684891819953918, -0.6506955027580261, 0.04005052521824837, -0.26223844289779663, 0.12858529388904572, -0.0949387475848198, 0.24147972464561462, 0.44480517506599426, -0.019119786098599434, 0.16708838939666748, -0.28195399045944214, 0.1031244695186615, -0.391269326210022, 0.33751481771469116, 0.0132988840341568, -0.4363529682159424, 0.14479297399520874, -0.19500356912612915, -0.17097246646881104, 0.13314425945281982, 0.17532946169376373, -0.05014533922076225, 0.05009164661169052, -0.17867593467235565, 0.3053138256072998, 0.320515900850296, 0.29841357469558716, 0.08721606433391571, -0.2738025486469269, 0.14068736135959625, -0.11933491379022598, -0.1487503945827484, 0.19891256093978882, 0.08111049234867096, -0.021683312952518463, -0.09978131949901581, 0.1624314934015274, -0.3583245873451233, -0.1473839282989502, -0.0883869007229805, -0.2401062697172165, 0.624018669128418, 0.16689848899841309, -0.029464881867170334, -0.0566718652844429, 0.1613805741071701, -0.17129193246364594, 0.05252695828676224, -0.14857061207294464, 0.22635817527770996, -0.12711253762245178, 0.4069528579711914, 0.0938057228922844, 0.18390890955924988, -0.07957218587398529, -0.3487452268600464, 0.12162194401025772, 0.21531470119953156, 0.14144186675548553, 0.017554201185703278, 0.07789299637079239, -0.007133743725717068, 0.20382395386695862, 0.006942667067050934, -0.014258190989494324, -0.07020698487758636, -0.05855531990528107, 0.09015767276287079, -0.020606812089681625, -0.1422797590494156, -0.290919691324234, -0.02590198814868927, 0.18529349565505981, -0.43637365102767944, 0.41223201155662537, -0.10597900301218033, -0.38027819991111755, -0.05395900830626488, 0.20368218421936035, 0.11905805766582489, 0.05571179836988449, -0.08093709498643875, 0.3548550307750702, 0.17698223888874054, 0.08613050729036331, -0.391571044921875, 0.39116817712783813, 0.2704872190952301, -0.5048338174819946, 0.2723015546798706, 0.38557595014572144, 0.057458579540252686, 0.09725967794656754, 0.04880831018090248, 0.46721404790878296, -0.00625479593873024, 0.08490342646837234, -0.05847679451107979, 0.29040566086769104, 0.22908926010131836, 0.16976875066757202, -0.009310935623943806, 0.10481518507003784, 0.3094991147518158, -0.0630064606666565, 0.20576724410057068, -0.17405818402767181, -0.5079026222229004, 0.11875929683446884, -0.12462793290615082, -0.1970576047897339, 0.45767688751220703, 0.11689792573451996, -0.06620291620492935, 0.007442843168973923, 0.2048606127500534, -0.5006636381149292, 0.2638867497444153, 0.026012856513261795, 0.1352425515651703, 0.056765347719192505, -0.5381006598472595, -0.06209258735179901, 0.3258526623249054, -0.12251150608062744, 0.07606235146522522, 0.018427208065986633, 0.31827494502067566, -0.11010923236608505, -0.142548069357872, 0.2787318527698517, -0.07677961140871048, 0.1815873682498932, -0.5350092053413391, -0.048958584666252136, -0.15815098583698273, 0.17585048079490662, -0.21533122658729553, -0.06486194580793381, -0.31521034240722656, -0.2781312167644501, 0.0194306131452322, 0.40660178661346436, -0.14430977404117584, 0.2010667622089386, -0.2259627729654312, -0.07140956819057465, 0.1662759780883789, 0.16304393112659454, -0.14671751856803894, -0.13962936401367188, -0.2608131766319275, -0.004917725920677185, -0.04772023856639862, -0.29089999198913574, 0.27469784021377563, 0.26566264033317566, -0.13257154822349548, -0.4878038167953491, -0.6215579509735107, 0.15377746522426605, 0.01712367683649063, 0.5996179580688477, 0.34862425923347473, -0.013032771646976471, 0.10305455327033997, -0.07220446318387985, 0.23234441876411438, 0.0001151449978351593, -0.254052996635437, 0.20911499857902527, -0.31698164343833923, 0.03360975906252861, -0.29351744055747986, -0.1948186457157135, -0.16737471520900726, -0.19409050047397614, 0.09914541244506836, -0.10149432718753815, 0.05044029653072357, -0.11342798918485641, 0.2796400487422943, 0.047889307141304016, 0.1813199371099472, -0.2319115698337555, -0.15135546028614044, 0.16422182321548462, 0.6436343193054199, -0.35686996579170227, -0.4152831733226776, -0.06628052145242691, -0.16795821487903595, -0.25646674633026123, 0.3040205240249634, -0.2865667939186096, 0.14883705973625183, -0.22618477046489716, 0.6788866519927979, -0.17458249628543854, 0.2373189628124237, 0.11796550452709198, -0.046569857746362686, 0.20879516005516052, -0.2899356484413147, -0.27518966794013977, -0.06609175354242325, 0.07361122965812683, 0.30628079175949097, 0.1089000552892685, 0.42621323466300964, -0.00225081667304039, 0.6371802091598511, -0.04519385099411011, -0.15905094146728516, 0.3047466576099396, -0.30396056175231934, 0.32312482595443726, -0.24753615260124207, -0.3175903558731079, 0.2147320806980133, 0.03976888209581375, -0.14489367604255676, -0.10875818133354187, 0.04771826043725014, -0.19861923158168793, -0.05180380493402481, 0.12018068134784698, -0.12656450271606445, -0.07831932604312897, 0.07994028925895691, -0.1424388438463211, 0.23483827710151672, -0.06588040292263031, 0.01004183292388916, -0.03218698129057884, -0.23428165912628174, -0.11358289420604706, -0.15178385376930237, 0.2322603464126587, 0.0979398861527443, -0.2405989170074463, -0.31539836525917053, -0.3051488697528839, 0.15628671646118164, 0.1702616661787033, 0.5178305506706238, 0.1291535347700119, -0.08290588110685349, -0.019561924040317535, 0.009245960973203182, 0.5540453195571899, -0.059689879417419434, -0.006880618631839752, 0.07963816821575165, 0.3896000385284424, -0.8895676732063293, -0.18867886066436768, -0.08833999931812286, 0.41358545422554016, -0.005708619952201843, -0.14526426792144775, -0.36968979239463806, 0.021376674994826317, 0.23090288043022156, 0.4420981705188751, -0.16553166508674622, 0.1567024290561676, -0.3195832669734955, -0.48719555139541626, 0.04733787477016449, -0.21554362773895264, 0.13172976672649384, 0.011116134002804756, -0.20342202484607697, 0.10264135897159576, -0.11034497618675232, -0.13309159874916077, 0.02849038690328598, -0.01962541975080967, 0.23249942064285278, -0.2458992302417755, 0.25920987129211426, 0.07764463871717453, -0.2785908877849579, 0.29049673676490784, 0.3470986783504486, 0.3098409175872803, -0.17887619137763977, 0.1691378355026245, -0.0003693141043186188, 0.2408038079738617, -0.06750564277172089, -0.04090237617492676, 0.103031687438488, -0.0279231034219265, 0.05313124507665634, -0.16049589216709137, -0.18759305775165558, 0.19455169141292572, -0.15676021575927734, -0.1084338128566742, -0.13778163492679596, 0.5937711596488953, 0.0074049197137355804, 0.0851878970861435, 0.35843631625175476, 0.024016648530960083, -0.2130156308412552, 0.3375999927520752, 0.4357931613922119, 0.8538236021995544, 0.049039531499147415, -0.02730650082230568, 0.5003535151481628, -0.27718502283096313, 0.6113311648368835, 0.007908154278993607, -0.16320225596427917, -0.48226693272590637, 0.125383660197258, -0.10050641745328903, -0.2996918261051178, 0.18428602814674377, -0.17226704955101013, -0.2057236284017563, 0.06799802929162979, -0.5603979825973511, 0.3460778295993805, 0.1378689557313919, -0.00827731192111969, 0.006354721263051033, -0.020977310836315155, 0.02589147910475731, 0.017484959214925766, -0.049804940819740295, -0.05166104808449745, 0.0016712285578250885, 0.09800387918949127, -0.2691466808319092, -0.29746782779693604, -0.6034275889396667, -0.042835064232349396, -0.35232463479042053, 0.2549137473106384, 0.24177739024162292, -0.21315033733844757, 0.00832124799489975, 0.07583989948034286, 0.44250982999801636, -0.12718063592910767, -0.20705437660217285, 0.05514562129974365, 0.3489169180393219, -0.07071169465780258, 0.11349056661128998, 0.031792715191841125, 0.09025630354881287, -0.049087733030319214, -0.3630618155002594, 0.06516790390014648, -0.01939462125301361, 0.06788906455039978, -0.14831256866455078, -0.08773626387119293, 0.1735137403011322, -0.2894706726074219, -0.020574716851115227, -0.2216566801071167, 0.2498345971107483, -0.23599614202976227, 0.013944437727332115, 0.16499733924865723, -0.02381627820432186, 0.1253248006105423, -0.16987824440002441, 0.13464540243148804, -0.22948192059993744, 0.1340651512145996, 0.037361517548561096, 0.11513309180736542, 0.23605507612228394, 0.5455991625785828, -0.21919867396354675, -0.028531715273857117, 0.23761001229286194, 0.25836649537086487, -0.6207526326179504, 0.1218966692686081, -0.2193095088005066, -0.11131282895803452, -0.3863028287887573, 0.13781863451004028, 0.08189444988965988, -0.04294928163290024, -0.13485664129257202, -0.23111389577388763, -0.10467525571584702, 0.07781562209129333, 0.2825815975666046, -0.0008310899138450623, -0.1987895369529724, 0.13204878568649292, 0.22792860865592957, -0.070456862449646, -0.13433176279067993, 0.10638993233442307, 0.2855088412761688, 0.32122090458869934, 0.2335401177406311, 0.25778067111968994, -0.334809273481369, -0.2253362089395523, 0.03455473482608795, -0.00044829025864601135, -0.24579739570617676, -0.024681560695171356, -0.2800191342830658, 0.20098374783992767, 0.03859840705990791, -0.6139501929283142, -0.13813170790672302, -0.43617498874664307, -0.20025131106376648, -0.034218963235616684, -0.13085156679153442, 0.3575483560562134, -0.16364237666130066, 0.15799032151699066, 0.28751471638679504, 0.06559901684522629, 0.05103176087141037, -0.08622199296951294, 0.02207363024353981, 0.3146094083786011, 0.20110788941383362, 0.26496243476867676, 0.20801399648189545, -0.07735099643468857, -0.04098409786820412, -0.01721661537885666, -0.2904090881347656, -0.1861938238143921, 0.1184687465429306, -0.20818720757961273, 0.11302658915519714, -0.3155680298805237, 0.3886965215206146, 0.39289751648902893, -0.23363927006721497, 0.11838936805725098, 0.25339069962501526, 0.039332009851932526, -0.3467806875705719, -0.0914635881781578, 0.11253762245178223, 0.12667390704154968, -0.050920020788908005, 0.247306227684021, 0.16306500136852264, 0.2504338324069977, -0.1723097413778305, 0.08548068255186081, 0.1885589212179184, -0.21833819150924683, 0.178214430809021, 0.4489647448062897, -0.258218914270401, 0.045216139405965805, 0.05155699700117111, -0.25499188899993896, 0.2289685606956482, 0.2283363938331604, -0.06483722478151321, 0.295948326587677, 0.4261493682861328, -0.03568049147725105, 0.3528614342212677, -0.1423235386610031, 0.030657818540930748, 0.05196071416139603, 0.13089241087436676, -0.015550054609775543, 0.045528583228588104, 0.4165058135986328, -0.008753764443099499, -0.04033134877681732, -0.21584640443325043, 0.22013652324676514, -0.08850520849227905, -0.1476963758468628, -0.2782488465309143, -0.3249232769012451, -0.11586296558380127, -0.05779607594013214, -0.045378539711236954, -0.14014746248722076, 0.706403374671936, 0.079798623919487, -0.07771241664886475, -0.43017855286598206, 0.40263891220092773, 0.2697792649269104, -0.12425253540277481, 0.03371371701359749, 0.25435173511505127, 0.4279123544692993, -0.3185235261917114, -0.0857156366109848, 0.5536986589431763, 0.6665911674499512, 0.4717917740345001, -0.39450764656066895, 0.07029669731855392, -0.11245247721672058, -0.18227899074554443, 0.055573880672454834, 0.22163629531860352, 0.05265319347381592, -0.03965343162417412, 0.11666250228881836, 0.020728567615151405, -0.0014102468267083168, 0.1776181161403656, 0.13534091413021088, 0.27555519342422485, -0.16884441673755646, 0.17167815566062927, -0.34147804975509644, -0.2661192715167999, 0.15580235421657562, -0.09024769812822342, -0.06424036622047424, 0.10226378589868546, 0.6065556406974792, 0.09300480037927628, 0.013100434094667435, -0.03607797250151634, -0.022339962422847748, 0.09541536867618561, 0.2906781733036041, 0.2984878420829773, 0.2318648099899292, -0.14597547054290771, -0.00680696964263916, -0.4679802358150482, 0.04772119224071503, -0.14627087116241455, -0.13646472990512848, 0.2612055838108063, 0.4154999852180481, 0.16815891861915588, 0.28913354873657227, 0.31570398807525635, -0.07544542849063873, 0.3857262432575226, 0.1278291642665863, -0.0786743089556694, -0.3377087116241455, -0.05919715762138367, 0.22877399623394012, -0.13623353838920593, -0.41667068004608154, 0.3047880530357361, -0.2719825506210327, -0.04775095731019974, -0.2536156177520752, -0.07169191539287567, 0.2647555470466614, 0.1359941065311432, 0.5345326662063599, 0.31682732701301575, 0.2748361825942993, 0.010668415576219559, -0.028413735330104828, -0.33387982845306396, -0.2982674539089203, -0.2113001048564911, 0.3667523264884949, -0.1701822727918625, 0.44773030281066895, -0.24920479953289032, -0.46423575282096863, -0.2789261043071747, 0.12078036367893219, -0.039221182465553284, -0.02014991268515587, -0.18121767044067383, 0.5001735091209412, -0.23746904730796814, -0.10327030718326569, -0.1335625797510147, -0.13894477486610413, -0.07070234417915344, 0.3442595303058624, -0.1417948305606842, -0.48923584818840027, 0.5753933191299438, -0.38821810483932495, -0.22262127697467804, -0.11553806811571121, -0.04740974307060242, 0.5173842310905457, -0.07865134626626968, -0.7344138622283936, -0.01109004020690918, 0.3903237283229828, -0.06649941205978394, -0.10737712681293488, 0.07146496325731277, -0.1244744062423706, -0.035735417157411575, -0.0067528001964092255, 0.643000602722168, -0.05534069985151291, -0.15253670513629913, 0.19939829409122467, -0.17205563187599182 ]
https://github.com/huggingface/datasets/issues/4981
Can't create a dataset with `float16` features
I think the issue comes mostly from pyarrow not supporting `float16` completely. For example you stil can't cast from/to `float16` ```python import numpy as np import pyarrow as pa pa.array(range(5)).cast(pa.float16()) # ArrowNotImplementedError: Unsupported cast from int64 to halffloat using function cast_half_float pa.array(range(5), pa.float32()).cast(pa.float16()) # ArrowNotImplementedError: Unsupported cast from float to halffloat using function cast_half_float pa.array(range(5), pa.float16()) # ArrowTypeError: Expected np.float16 instance pa.array(np.arange(5, dtype=np.float16())).cast(pa.float32()) # ArrowNotImplementedError: Unsupported cast from halffloat to float using function cast_float ```
## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4
75
Can't create a dataset with `float16` features ## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 I think the issue comes mostly from pyarrow not supporting `float16` completely. For example you stil can't cast from/to `float16` ```python import numpy as np import pyarrow as pa pa.array(range(5)).cast(pa.float16()) # ArrowNotImplementedError: Unsupported cast from int64 to halffloat using function cast_half_float pa.array(range(5), pa.float32()).cast(pa.float16()) # ArrowNotImplementedError: Unsupported cast from float to halffloat using function cast_half_float pa.array(range(5), pa.float16()) # ArrowTypeError: Expected np.float16 instance pa.array(np.arange(5, dtype=np.float16())).cast(pa.float32()) # ArrowNotImplementedError: Unsupported cast from halffloat to float using function cast_float ```
[ -0.2009882777929306, -0.10930380970239639, 0.016125444322824478, 0.021241173148155212, 0.38709986209869385, 0.15218710899353027, 0.45306962728500366, 0.033425502479076385, -0.2996401786804199, -0.06064164638519287, -0.10168614983558655, 0.39165961742401123, 0.08138644695281982, -0.2725028395652771, 0.05386701226234436, -0.28524065017700195, 0.3063649833202362, 0.04332839325070381, -0.18481168150901794, -0.022601041942834854, -0.1990492045879364, -0.3401804566383362, -0.2611536979675293, 0.17059750854969025, -0.1559762954711914, 0.018971078097820282, -0.08496809005737305, -0.11830157786607742, -0.5093178153038025, -0.27293258905410767, 0.24250976741313934, -0.13706576824188232, 0.25397172570228577, 0.5635740160942078, -0.0001274293172173202, -0.05802440643310547, 0.32713818550109863, 0.023302936926484108, -0.1843799203634262, -0.10865284502506256, 0.30563780665397644, -0.3205069601535797, 0.20863556861877441, -0.07551462948322296, -0.061374083161354065, -0.4296264350414276, -0.04463101178407669, -0.37546420097351074, 0.09877963364124298, 0.33850041031837463, 0.07996977865695953, 0.4241890013217926, 0.3578651249408722, -0.03421250730752945, 0.45074883103370667, 0.4039570093154907, -0.5992499589920044, 0.29422587156295776, 0.1359720230102539, -0.190775528550148, 0.021822452545166016, -0.14523367583751678, -0.30882593989372253, 0.12667979300022125, 0.1340358555316925, 0.02070295251905918, -0.3174879252910614, -0.5399730205535889, 0.006541889160871506, 0.41908931732177734, 0.35261908173561096, -0.40274855494499207, -0.42553430795669556, -0.08785778284072876, -0.19390881061553955, -0.2738761603832245, 0.03420600667595863, 0.40990519523620605, -0.1186908483505249, -0.016444560140371323, -0.06345303356647491, -0.20739704370498657, -0.18620286881923676, 0.15854501724243164, -0.1652776449918747, 0.34783393144607544, 0.10616662353277206, 0.2694159150123596, 0.05823955684900284, -0.23778541386127472, 0.24278852343559265, 0.014698839746415615, 0.19250856339931488, 0.4166063964366913, -0.15926699340343475, 0.22997263073921204, -0.08466974645853043, -0.012633845210075378, 0.31394410133361816, -0.14011476933956146, 0.17458698153495789, -0.07251515239477158, -0.16377468407154083, 0.29014572501182556, 0.03846806287765503, 0.06913262605667114, -0.2724461555480957, 0.2039286345243454, 0.2612970173358917, -0.16699519753456116, 0.4321260154247284, -0.07827672362327576, 0.05356742814183235, -0.26619917154312134, -0.009125448763370514, -0.04604879021644592, 0.3809537887573242, 0.003726024180650711, -0.20239710807800293, 0.08726012706756592, -0.20301571488380432, 0.036771658807992935, 0.012491287663578987, 0.06445305794477463, -0.04669033735990524, -0.10574231296777725, 0.15616841614246368, 0.5045014023780823, -0.33252838253974915, -0.17810915410518646, 0.033611394464969635, 0.007646363228559494, -0.05399911850690842, -0.23231655359268188, 0.17231160402297974, -0.3220874071121216, 0.09673260152339935, 0.41907256841659546, 0.06952518224716187, 0.23345455527305603, 0.147128164768219, -0.11583149433135986, 0.07660841941833496, 0.30969294905662537, 0.05454111471772194, 0.004066623747348785, 0.050598181784152985, 0.00018224865198135376, 0.07418554276227951, 0.4039927124977112, -0.007260158658027649, -0.17684891819953918, -0.6506955027580261, 0.04005052521824837, -0.26223844289779663, 0.12858529388904572, -0.0949387475848198, 0.24147972464561462, 0.44480517506599426, -0.019119786098599434, 0.16708838939666748, -0.28195399045944214, 0.1031244695186615, -0.391269326210022, 0.33751481771469116, 0.0132988840341568, -0.4363529682159424, 0.14479297399520874, -0.19500356912612915, -0.17097246646881104, 0.13314425945281982, 0.17532946169376373, -0.05014533922076225, 0.05009164661169052, -0.17867593467235565, 0.3053138256072998, 0.320515900850296, 0.29841357469558716, 0.08721606433391571, -0.2738025486469269, 0.14068736135959625, -0.11933491379022598, -0.1487503945827484, 0.19891256093978882, 0.08111049234867096, -0.021683312952518463, -0.09978131949901581, 0.1624314934015274, -0.3583245873451233, -0.1473839282989502, -0.0883869007229805, -0.2401062697172165, 0.624018669128418, 0.16689848899841309, -0.029464881867170334, -0.0566718652844429, 0.1613805741071701, -0.17129193246364594, 0.05252695828676224, -0.14857061207294464, 0.22635817527770996, -0.12711253762245178, 0.4069528579711914, 0.0938057228922844, 0.18390890955924988, -0.07957218587398529, -0.3487452268600464, 0.12162194401025772, 0.21531470119953156, 0.14144186675548553, 0.017554201185703278, 0.07789299637079239, -0.007133743725717068, 0.20382395386695862, 0.006942667067050934, -0.014258190989494324, -0.07020698487758636, -0.05855531990528107, 0.09015767276287079, -0.020606812089681625, -0.1422797590494156, -0.290919691324234, -0.02590198814868927, 0.18529349565505981, -0.43637365102767944, 0.41223201155662537, -0.10597900301218033, -0.38027819991111755, -0.05395900830626488, 0.20368218421936035, 0.11905805766582489, 0.05571179836988449, -0.08093709498643875, 0.3548550307750702, 0.17698223888874054, 0.08613050729036331, -0.391571044921875, 0.39116817712783813, 0.2704872190952301, -0.5048338174819946, 0.2723015546798706, 0.38557595014572144, 0.057458579540252686, 0.09725967794656754, 0.04880831018090248, 0.46721404790878296, -0.00625479593873024, 0.08490342646837234, -0.05847679451107979, 0.29040566086769104, 0.22908926010131836, 0.16976875066757202, -0.009310935623943806, 0.10481518507003784, 0.3094991147518158, -0.0630064606666565, 0.20576724410057068, -0.17405818402767181, -0.5079026222229004, 0.11875929683446884, -0.12462793290615082, -0.1970576047897339, 0.45767688751220703, 0.11689792573451996, -0.06620291620492935, 0.007442843168973923, 0.2048606127500534, -0.5006636381149292, 0.2638867497444153, 0.026012856513261795, 0.1352425515651703, 0.056765347719192505, -0.5381006598472595, -0.06209258735179901, 0.3258526623249054, -0.12251150608062744, 0.07606235146522522, 0.018427208065986633, 0.31827494502067566, -0.11010923236608505, -0.142548069357872, 0.2787318527698517, -0.07677961140871048, 0.1815873682498932, -0.5350092053413391, -0.048958584666252136, -0.15815098583698273, 0.17585048079490662, -0.21533122658729553, -0.06486194580793381, -0.31521034240722656, -0.2781312167644501, 0.0194306131452322, 0.40660178661346436, -0.14430977404117584, 0.2010667622089386, -0.2259627729654312, -0.07140956819057465, 0.1662759780883789, 0.16304393112659454, -0.14671751856803894, -0.13962936401367188, -0.2608131766319275, -0.004917725920677185, -0.04772023856639862, -0.29089999198913574, 0.27469784021377563, 0.26566264033317566, -0.13257154822349548, -0.4878038167953491, -0.6215579509735107, 0.15377746522426605, 0.01712367683649063, 0.5996179580688477, 0.34862425923347473, -0.013032771646976471, 0.10305455327033997, -0.07220446318387985, 0.23234441876411438, 0.0001151449978351593, -0.254052996635437, 0.20911499857902527, -0.31698164343833923, 0.03360975906252861, -0.29351744055747986, -0.1948186457157135, -0.16737471520900726, -0.19409050047397614, 0.09914541244506836, -0.10149432718753815, 0.05044029653072357, -0.11342798918485641, 0.2796400487422943, 0.047889307141304016, 0.1813199371099472, -0.2319115698337555, -0.15135546028614044, 0.16422182321548462, 0.6436343193054199, -0.35686996579170227, -0.4152831733226776, -0.06628052145242691, -0.16795821487903595, -0.25646674633026123, 0.3040205240249634, -0.2865667939186096, 0.14883705973625183, -0.22618477046489716, 0.6788866519927979, -0.17458249628543854, 0.2373189628124237, 0.11796550452709198, -0.046569857746362686, 0.20879516005516052, -0.2899356484413147, -0.27518966794013977, -0.06609175354242325, 0.07361122965812683, 0.30628079175949097, 0.1089000552892685, 0.42621323466300964, -0.00225081667304039, 0.6371802091598511, -0.04519385099411011, -0.15905094146728516, 0.3047466576099396, -0.30396056175231934, 0.32312482595443726, -0.24753615260124207, -0.3175903558731079, 0.2147320806980133, 0.03976888209581375, -0.14489367604255676, -0.10875818133354187, 0.04771826043725014, -0.19861923158168793, -0.05180380493402481, 0.12018068134784698, -0.12656450271606445, -0.07831932604312897, 0.07994028925895691, -0.1424388438463211, 0.23483827710151672, -0.06588040292263031, 0.01004183292388916, -0.03218698129057884, -0.23428165912628174, -0.11358289420604706, -0.15178385376930237, 0.2322603464126587, 0.0979398861527443, -0.2405989170074463, -0.31539836525917053, -0.3051488697528839, 0.15628671646118164, 0.1702616661787033, 0.5178305506706238, 0.1291535347700119, -0.08290588110685349, -0.019561924040317535, 0.009245960973203182, 0.5540453195571899, -0.059689879417419434, -0.006880618631839752, 0.07963816821575165, 0.3896000385284424, -0.8895676732063293, -0.18867886066436768, -0.08833999931812286, 0.41358545422554016, -0.005708619952201843, -0.14526426792144775, -0.36968979239463806, 0.021376674994826317, 0.23090288043022156, 0.4420981705188751, -0.16553166508674622, 0.1567024290561676, -0.3195832669734955, -0.48719555139541626, 0.04733787477016449, -0.21554362773895264, 0.13172976672649384, 0.011116134002804756, -0.20342202484607697, 0.10264135897159576, -0.11034497618675232, -0.13309159874916077, 0.02849038690328598, -0.01962541975080967, 0.23249942064285278, -0.2458992302417755, 0.25920987129211426, 0.07764463871717453, -0.2785908877849579, 0.29049673676490784, 0.3470986783504486, 0.3098409175872803, -0.17887619137763977, 0.1691378355026245, -0.0003693141043186188, 0.2408038079738617, -0.06750564277172089, -0.04090237617492676, 0.103031687438488, -0.0279231034219265, 0.05313124507665634, -0.16049589216709137, -0.18759305775165558, 0.19455169141292572, -0.15676021575927734, -0.1084338128566742, -0.13778163492679596, 0.5937711596488953, 0.0074049197137355804, 0.0851878970861435, 0.35843631625175476, 0.024016648530960083, -0.2130156308412552, 0.3375999927520752, 0.4357931613922119, 0.8538236021995544, 0.049039531499147415, -0.02730650082230568, 0.5003535151481628, -0.27718502283096313, 0.6113311648368835, 0.007908154278993607, -0.16320225596427917, -0.48226693272590637, 0.125383660197258, -0.10050641745328903, -0.2996918261051178, 0.18428602814674377, -0.17226704955101013, -0.2057236284017563, 0.06799802929162979, -0.5603979825973511, 0.3460778295993805, 0.1378689557313919, -0.00827731192111969, 0.006354721263051033, -0.020977310836315155, 0.02589147910475731, 0.017484959214925766, -0.049804940819740295, -0.05166104808449745, 0.0016712285578250885, 0.09800387918949127, -0.2691466808319092, -0.29746782779693604, -0.6034275889396667, -0.042835064232349396, -0.35232463479042053, 0.2549137473106384, 0.24177739024162292, -0.21315033733844757, 0.00832124799489975, 0.07583989948034286, 0.44250982999801636, -0.12718063592910767, -0.20705437660217285, 0.05514562129974365, 0.3489169180393219, -0.07071169465780258, 0.11349056661128998, 0.031792715191841125, 0.09025630354881287, -0.049087733030319214, -0.3630618155002594, 0.06516790390014648, -0.01939462125301361, 0.06788906455039978, -0.14831256866455078, -0.08773626387119293, 0.1735137403011322, -0.2894706726074219, -0.020574716851115227, -0.2216566801071167, 0.2498345971107483, -0.23599614202976227, 0.013944437727332115, 0.16499733924865723, -0.02381627820432186, 0.1253248006105423, -0.16987824440002441, 0.13464540243148804, -0.22948192059993744, 0.1340651512145996, 0.037361517548561096, 0.11513309180736542, 0.23605507612228394, 0.5455991625785828, -0.21919867396354675, -0.028531715273857117, 0.23761001229286194, 0.25836649537086487, -0.6207526326179504, 0.1218966692686081, -0.2193095088005066, -0.11131282895803452, -0.3863028287887573, 0.13781863451004028, 0.08189444988965988, -0.04294928163290024, -0.13485664129257202, -0.23111389577388763, -0.10467525571584702, 0.07781562209129333, 0.2825815975666046, -0.0008310899138450623, -0.1987895369529724, 0.13204878568649292, 0.22792860865592957, -0.070456862449646, -0.13433176279067993, 0.10638993233442307, 0.2855088412761688, 0.32122090458869934, 0.2335401177406311, 0.25778067111968994, -0.334809273481369, -0.2253362089395523, 0.03455473482608795, -0.00044829025864601135, -0.24579739570617676, -0.024681560695171356, -0.2800191342830658, 0.20098374783992767, 0.03859840705990791, -0.6139501929283142, -0.13813170790672302, -0.43617498874664307, -0.20025131106376648, -0.034218963235616684, -0.13085156679153442, 0.3575483560562134, -0.16364237666130066, 0.15799032151699066, 0.28751471638679504, 0.06559901684522629, 0.05103176087141037, -0.08622199296951294, 0.02207363024353981, 0.3146094083786011, 0.20110788941383362, 0.26496243476867676, 0.20801399648189545, -0.07735099643468857, -0.04098409786820412, -0.01721661537885666, -0.2904090881347656, -0.1861938238143921, 0.1184687465429306, -0.20818720757961273, 0.11302658915519714, -0.3155680298805237, 0.3886965215206146, 0.39289751648902893, -0.23363927006721497, 0.11838936805725098, 0.25339069962501526, 0.039332009851932526, -0.3467806875705719, -0.0914635881781578, 0.11253762245178223, 0.12667390704154968, -0.050920020788908005, 0.247306227684021, 0.16306500136852264, 0.2504338324069977, -0.1723097413778305, 0.08548068255186081, 0.1885589212179184, -0.21833819150924683, 0.178214430809021, 0.4489647448062897, -0.258218914270401, 0.045216139405965805, 0.05155699700117111, -0.25499188899993896, 0.2289685606956482, 0.2283363938331604, -0.06483722478151321, 0.295948326587677, 0.4261493682861328, -0.03568049147725105, 0.3528614342212677, -0.1423235386610031, 0.030657818540930748, 0.05196071416139603, 0.13089241087436676, -0.015550054609775543, 0.045528583228588104, 0.4165058135986328, -0.008753764443099499, -0.04033134877681732, -0.21584640443325043, 0.22013652324676514, -0.08850520849227905, -0.1476963758468628, -0.2782488465309143, -0.3249232769012451, -0.11586296558380127, -0.05779607594013214, -0.045378539711236954, -0.14014746248722076, 0.706403374671936, 0.079798623919487, -0.07771241664886475, -0.43017855286598206, 0.40263891220092773, 0.2697792649269104, -0.12425253540277481, 0.03371371701359749, 0.25435173511505127, 0.4279123544692993, -0.3185235261917114, -0.0857156366109848, 0.5536986589431763, 0.6665911674499512, 0.4717917740345001, -0.39450764656066895, 0.07029669731855392, -0.11245247721672058, -0.18227899074554443, 0.055573880672454834, 0.22163629531860352, 0.05265319347381592, -0.03965343162417412, 0.11666250228881836, 0.020728567615151405, -0.0014102468267083168, 0.1776181161403656, 0.13534091413021088, 0.27555519342422485, -0.16884441673755646, 0.17167815566062927, -0.34147804975509644, -0.2661192715167999, 0.15580235421657562, -0.09024769812822342, -0.06424036622047424, 0.10226378589868546, 0.6065556406974792, 0.09300480037927628, 0.013100434094667435, -0.03607797250151634, -0.022339962422847748, 0.09541536867618561, 0.2906781733036041, 0.2984878420829773, 0.2318648099899292, -0.14597547054290771, -0.00680696964263916, -0.4679802358150482, 0.04772119224071503, -0.14627087116241455, -0.13646472990512848, 0.2612055838108063, 0.4154999852180481, 0.16815891861915588, 0.28913354873657227, 0.31570398807525635, -0.07544542849063873, 0.3857262432575226, 0.1278291642665863, -0.0786743089556694, -0.3377087116241455, -0.05919715762138367, 0.22877399623394012, -0.13623353838920593, -0.41667068004608154, 0.3047880530357361, -0.2719825506210327, -0.04775095731019974, -0.2536156177520752, -0.07169191539287567, 0.2647555470466614, 0.1359941065311432, 0.5345326662063599, 0.31682732701301575, 0.2748361825942993, 0.010668415576219559, -0.028413735330104828, -0.33387982845306396, -0.2982674539089203, -0.2113001048564911, 0.3667523264884949, -0.1701822727918625, 0.44773030281066895, -0.24920479953289032, -0.46423575282096863, -0.2789261043071747, 0.12078036367893219, -0.039221182465553284, -0.02014991268515587, -0.18121767044067383, 0.5001735091209412, -0.23746904730796814, -0.10327030718326569, -0.1335625797510147, -0.13894477486610413, -0.07070234417915344, 0.3442595303058624, -0.1417948305606842, -0.48923584818840027, 0.5753933191299438, -0.38821810483932495, -0.22262127697467804, -0.11553806811571121, -0.04740974307060242, 0.5173842310905457, -0.07865134626626968, -0.7344138622283936, -0.01109004020690918, 0.3903237283229828, -0.06649941205978394, -0.10737712681293488, 0.07146496325731277, -0.1244744062423706, -0.035735417157411575, -0.0067528001964092255, 0.643000602722168, -0.05534069985151291, -0.15253670513629913, 0.19939829409122467, -0.17205563187599182 ]
https://github.com/huggingface/datasets/issues/4981
Can't create a dataset with `float16` features
Hmm it seems like we can either: 1. try to fix pyarrow upstream 2. half-support float16 with some workaround to make sure we don't ever do casting internally
## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4
28
Can't create a dataset with `float16` features ## Describe the bug I can't create a dataset with `float16` features. I understand from the traceback that this is a `pyarrow` error, but I don't see anywhere in the `datasets` documentation about how to successfully do this. Is it actually supported? I've tried older versions of `pyarrow` as well with the same exact error. The bug seems to arise from `datasets` casting the values to `double` and then `pyarrow` doesn't know how to convert those back to `float16`... does that sound right? Is there a way to bypass this since it's not necessary in the `numpy` and `torch` cases? Thanks! ## Steps to reproduce the bug All of the following raise the following error with the same exact (as far as I can tell) traceback: ```python ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ```python from datasets import Dataset, Features, Value Dataset.from_dict({"x": [0.0, 1.0, 2.0]}, features=Features(x=Value("float16"))) import numpy as np Dataset.from_dict({"x": np.arange(3, dtype=np.float16)}, features=Features(x=Value("float16"))) import torch Dataset.from_dict({"x": torch.arange(3).to(torch.float16)}, features=Features(x=Value("float16"))) ``` ## Expected results A dataset with `float16` features is successfully created. ## Actual results ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) Cell In [14], line 1 ----> 1 Dataset.from_dict({"x": [1.0, 2.0, 3.0]}, features=Features(x=Value("float16"))) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py:870, in Dataset.from_dict(cls, mapping, features, info, split) 865 mapping = features.encode_batch(mapping) 866 mapping = { 867 col: OptimizedTypedSequence(data, type=features[col] if features is not None else None, col=col) 868 for col, data in mapping.items() 869 } --> 870 pa_table = InMemoryTable.from_pydict(mapping=mapping) 871 if info.features is None: 872 info.features = Features({col: ts.get_inferred_type() for col, ts in mapping.items()}) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:750, in InMemoryTable.from_pydict(cls, *args, **kwargs) 734 @classmethod 735 def from_pydict(cls, *args, **kwargs): 736 """ 737 Construct a Table from Arrow arrays or columns 738 (...) 748 :class:`datasets.table.Table`: 749 """ --> 750 return cls(pa.Table.from_pydict(*args, **kwargs)) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:3648, in pyarrow.lib.Table.from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/table.pxi:5174, in pyarrow.lib._from_pydict() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:343, in pyarrow.lib.asarray() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:231, in pyarrow.lib.array() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py:197, in TypedSequence.__arrow_array__(self, type) 192 # otherwise we can finally use the user's type 193 elif type is not None: 194 # We use cast_array_to_feature to support casting to custom types like Audio and Image 195 # Also, when trying type "string", we don't want to convert integers or floats to "string". 196 # We only do it if trying_type is False - since this is what the user asks for. --> 197 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 198 return out 199 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1853, in cast_array_to_feature(array, feature, allow_number_to_str) 1851 return array_cast(array, get_nested_type(feature), allow_number_to_str=allow_number_to_str) 1852 elif not isinstance(feature, (Sequence, dict, list, tuple)): -> 1853 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) 1854 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1683, in _wrap_for_chunked_arrays.<locals>.wrapper(array, *args, **kwargs) 1681 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 1682 else: -> 1683 return func(array, *args, **kwargs) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/datasets/table.py:1762, in array_cast(array, pa_type, allow_number_to_str) 1760 if pa.types.is_null(pa_type) and not pa.types.is_null(array.type): 1761 raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") -> 1762 return array.cast(pa_type) 1763 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{pa_type}") File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/array.pxi:919, in pyarrow.lib.Array.cast() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/compute.py:389, in cast(arr, target_type, safe, options) 387 else: 388 options = CastOptions.safe(target_type) --> 389 return call_function("cast", [arr], options) File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:560, in pyarrow._compute.call_function() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/_compute.pyx:355, in pyarrow._compute.Function.call() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/scratch/scratch-env-39/.venv/lib/python3.9/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from double to halffloat using function cast_half_float ``` ## Environment info - `datasets` version: 2.4.0 - Platform: macOS-12.5.1-arm64-arm-64bit - Python version: 3.9.13 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 Hmm it seems like we can either: 1. try to fix pyarrow upstream 2. half-support float16 with some workaround to make sure we don't ever do casting internally
[ -0.2009882777929306, -0.10930380970239639, 0.016125444322824478, 0.021241173148155212, 0.38709986209869385, 0.15218710899353027, 0.45306962728500366, 0.033425502479076385, -0.2996401786804199, -0.06064164638519287, -0.10168614983558655, 0.39165961742401123, 0.08138644695281982, -0.2725028395652771, 0.05386701226234436, -0.28524065017700195, 0.3063649833202362, 0.04332839325070381, -0.18481168150901794, -0.022601041942834854, -0.1990492045879364, -0.3401804566383362, -0.2611536979675293, 0.17059750854969025, -0.1559762954711914, 0.018971078097820282, -0.08496809005737305, -0.11830157786607742, -0.5093178153038025, -0.27293258905410767, 0.24250976741313934, -0.13706576824188232, 0.25397172570228577, 0.5635740160942078, -0.0001274293172173202, -0.05802440643310547, 0.32713818550109863, 0.023302936926484108, -0.1843799203634262, -0.10865284502506256, 0.30563780665397644, -0.3205069601535797, 0.20863556861877441, -0.07551462948322296, -0.061374083161354065, -0.4296264350414276, -0.04463101178407669, -0.37546420097351074, 0.09877963364124298, 0.33850041031837463, 0.07996977865695953, 0.4241890013217926, 0.3578651249408722, -0.03421250730752945, 0.45074883103370667, 0.4039570093154907, -0.5992499589920044, 0.29422587156295776, 0.1359720230102539, -0.190775528550148, 0.021822452545166016, -0.14523367583751678, -0.30882593989372253, 0.12667979300022125, 0.1340358555316925, 0.02070295251905918, -0.3174879252910614, -0.5399730205535889, 0.006541889160871506, 0.41908931732177734, 0.35261908173561096, -0.40274855494499207, -0.42553430795669556, -0.08785778284072876, -0.19390881061553955, -0.2738761603832245, 0.03420600667595863, 0.40990519523620605, -0.1186908483505249, -0.016444560140371323, -0.06345303356647491, -0.20739704370498657, -0.18620286881923676, 0.15854501724243164, -0.1652776449918747, 0.34783393144607544, 0.10616662353277206, 0.2694159150123596, 0.05823955684900284, -0.23778541386127472, 0.24278852343559265, 0.014698839746415615, 0.19250856339931488, 0.4166063964366913, -0.15926699340343475, 0.22997263073921204, -0.08466974645853043, -0.012633845210075378, 0.31394410133361816, -0.14011476933956146, 0.17458698153495789, -0.07251515239477158, -0.16377468407154083, 0.29014572501182556, 0.03846806287765503, 0.06913262605667114, -0.2724461555480957, 0.2039286345243454, 0.2612970173358917, -0.16699519753456116, 0.4321260154247284, -0.07827672362327576, 0.05356742814183235, -0.26619917154312134, -0.009125448763370514, -0.04604879021644592, 0.3809537887573242, 0.003726024180650711, -0.20239710807800293, 0.08726012706756592, -0.20301571488380432, 0.036771658807992935, 0.012491287663578987, 0.06445305794477463, -0.04669033735990524, -0.10574231296777725, 0.15616841614246368, 0.5045014023780823, -0.33252838253974915, -0.17810915410518646, 0.033611394464969635, 0.007646363228559494, -0.05399911850690842, -0.23231655359268188, 0.17231160402297974, -0.3220874071121216, 0.09673260152339935, 0.41907256841659546, 0.06952518224716187, 0.23345455527305603, 0.147128164768219, -0.11583149433135986, 0.07660841941833496, 0.30969294905662537, 0.05454111471772194, 0.004066623747348785, 0.050598181784152985, 0.00018224865198135376, 0.07418554276227951, 0.4039927124977112, -0.007260158658027649, -0.17684891819953918, -0.6506955027580261, 0.04005052521824837, -0.26223844289779663, 0.12858529388904572, -0.0949387475848198, 0.24147972464561462, 0.44480517506599426, -0.019119786098599434, 0.16708838939666748, -0.28195399045944214, 0.1031244695186615, -0.391269326210022, 0.33751481771469116, 0.0132988840341568, -0.4363529682159424, 0.14479297399520874, -0.19500356912612915, -0.17097246646881104, 0.13314425945281982, 0.17532946169376373, -0.05014533922076225, 0.05009164661169052, -0.17867593467235565, 0.3053138256072998, 0.320515900850296, 0.29841357469558716, 0.08721606433391571, -0.2738025486469269, 0.14068736135959625, -0.11933491379022598, -0.1487503945827484, 0.19891256093978882, 0.08111049234867096, -0.021683312952518463, -0.09978131949901581, 0.1624314934015274, -0.3583245873451233, -0.1473839282989502, -0.0883869007229805, -0.2401062697172165, 0.624018669128418, 0.16689848899841309, -0.029464881867170334, -0.0566718652844429, 0.1613805741071701, -0.17129193246364594, 0.05252695828676224, -0.14857061207294464, 0.22635817527770996, -0.12711253762245178, 0.4069528579711914, 0.0938057228922844, 0.18390890955924988, -0.07957218587398529, -0.3487452268600464, 0.12162194401025772, 0.21531470119953156, 0.14144186675548553, 0.017554201185703278, 0.07789299637079239, -0.007133743725717068, 0.20382395386695862, 0.006942667067050934, -0.014258190989494324, -0.07020698487758636, -0.05855531990528107, 0.09015767276287079, -0.020606812089681625, -0.1422797590494156, -0.290919691324234, -0.02590198814868927, 0.18529349565505981, -0.43637365102767944, 0.41223201155662537, -0.10597900301218033, -0.38027819991111755, -0.05395900830626488, 0.20368218421936035, 0.11905805766582489, 0.05571179836988449, -0.08093709498643875, 0.3548550307750702, 0.17698223888874054, 0.08613050729036331, -0.391571044921875, 0.39116817712783813, 0.2704872190952301, -0.5048338174819946, 0.2723015546798706, 0.38557595014572144, 0.057458579540252686, 0.09725967794656754, 0.04880831018090248, 0.46721404790878296, -0.00625479593873024, 0.08490342646837234, -0.05847679451107979, 0.29040566086769104, 0.22908926010131836, 0.16976875066757202, -0.009310935623943806, 0.10481518507003784, 0.3094991147518158, -0.0630064606666565, 0.20576724410057068, -0.17405818402767181, -0.5079026222229004, 0.11875929683446884, -0.12462793290615082, -0.1970576047897339, 0.45767688751220703, 0.11689792573451996, -0.06620291620492935, 0.007442843168973923, 0.2048606127500534, -0.5006636381149292, 0.2638867497444153, 0.026012856513261795, 0.1352425515651703, 0.056765347719192505, -0.5381006598472595, -0.06209258735179901, 0.3258526623249054, -0.12251150608062744, 0.07606235146522522, 0.018427208065986633, 0.31827494502067566, -0.11010923236608505, -0.142548069357872, 0.2787318527698517, -0.07677961140871048, 0.1815873682498932, -0.5350092053413391, -0.048958584666252136, -0.15815098583698273, 0.17585048079490662, -0.21533122658729553, -0.06486194580793381, -0.31521034240722656, -0.2781312167644501, 0.0194306131452322, 0.40660178661346436, -0.14430977404117584, 0.2010667622089386, -0.2259627729654312, -0.07140956819057465, 0.1662759780883789, 0.16304393112659454, -0.14671751856803894, -0.13962936401367188, -0.2608131766319275, -0.004917725920677185, -0.04772023856639862, -0.29089999198913574, 0.27469784021377563, 0.26566264033317566, -0.13257154822349548, -0.4878038167953491, -0.6215579509735107, 0.15377746522426605, 0.01712367683649063, 0.5996179580688477, 0.34862425923347473, -0.013032771646976471, 0.10305455327033997, -0.07220446318387985, 0.23234441876411438, 0.0001151449978351593, -0.254052996635437, 0.20911499857902527, -0.31698164343833923, 0.03360975906252861, -0.29351744055747986, -0.1948186457157135, -0.16737471520900726, -0.19409050047397614, 0.09914541244506836, -0.10149432718753815, 0.05044029653072357, -0.11342798918485641, 0.2796400487422943, 0.047889307141304016, 0.1813199371099472, -0.2319115698337555, -0.15135546028614044, 0.16422182321548462, 0.6436343193054199, -0.35686996579170227, -0.4152831733226776, -0.06628052145242691, -0.16795821487903595, -0.25646674633026123, 0.3040205240249634, -0.2865667939186096, 0.14883705973625183, -0.22618477046489716, 0.6788866519927979, -0.17458249628543854, 0.2373189628124237, 0.11796550452709198, -0.046569857746362686, 0.20879516005516052, -0.2899356484413147, -0.27518966794013977, -0.06609175354242325, 0.07361122965812683, 0.30628079175949097, 0.1089000552892685, 0.42621323466300964, -0.00225081667304039, 0.6371802091598511, -0.04519385099411011, -0.15905094146728516, 0.3047466576099396, -0.30396056175231934, 0.32312482595443726, -0.24753615260124207, -0.3175903558731079, 0.2147320806980133, 0.03976888209581375, -0.14489367604255676, -0.10875818133354187, 0.04771826043725014, -0.19861923158168793, -0.05180380493402481, 0.12018068134784698, -0.12656450271606445, -0.07831932604312897, 0.07994028925895691, -0.1424388438463211, 0.23483827710151672, -0.06588040292263031, 0.01004183292388916, -0.03218698129057884, -0.23428165912628174, -0.11358289420604706, -0.15178385376930237, 0.2322603464126587, 0.0979398861527443, -0.2405989170074463, -0.31539836525917053, -0.3051488697528839, 0.15628671646118164, 0.1702616661787033, 0.5178305506706238, 0.1291535347700119, -0.08290588110685349, -0.019561924040317535, 0.009245960973203182, 0.5540453195571899, -0.059689879417419434, -0.006880618631839752, 0.07963816821575165, 0.3896000385284424, -0.8895676732063293, -0.18867886066436768, -0.08833999931812286, 0.41358545422554016, -0.005708619952201843, -0.14526426792144775, -0.36968979239463806, 0.021376674994826317, 0.23090288043022156, 0.4420981705188751, -0.16553166508674622, 0.1567024290561676, -0.3195832669734955, -0.48719555139541626, 0.04733787477016449, -0.21554362773895264, 0.13172976672649384, 0.011116134002804756, -0.20342202484607697, 0.10264135897159576, -0.11034497618675232, -0.13309159874916077, 0.02849038690328598, -0.01962541975080967, 0.23249942064285278, -0.2458992302417755, 0.25920987129211426, 0.07764463871717453, -0.2785908877849579, 0.29049673676490784, 0.3470986783504486, 0.3098409175872803, -0.17887619137763977, 0.1691378355026245, -0.0003693141043186188, 0.2408038079738617, -0.06750564277172089, -0.04090237617492676, 0.103031687438488, -0.0279231034219265, 0.05313124507665634, -0.16049589216709137, -0.18759305775165558, 0.19455169141292572, -0.15676021575927734, -0.1084338128566742, -0.13778163492679596, 0.5937711596488953, 0.0074049197137355804, 0.0851878970861435, 0.35843631625175476, 0.024016648530960083, -0.2130156308412552, 0.3375999927520752, 0.4357931613922119, 0.8538236021995544, 0.049039531499147415, -0.02730650082230568, 0.5003535151481628, -0.27718502283096313, 0.6113311648368835, 0.007908154278993607, -0.16320225596427917, -0.48226693272590637, 0.125383660197258, -0.10050641745328903, -0.2996918261051178, 0.18428602814674377, -0.17226704955101013, -0.2057236284017563, 0.06799802929162979, -0.5603979825973511, 0.3460778295993805, 0.1378689557313919, -0.00827731192111969, 0.006354721263051033, -0.020977310836315155, 0.02589147910475731, 0.017484959214925766, -0.049804940819740295, -0.05166104808449745, 0.0016712285578250885, 0.09800387918949127, -0.2691466808319092, -0.29746782779693604, -0.6034275889396667, -0.042835064232349396, -0.35232463479042053, 0.2549137473106384, 0.24177739024162292, -0.21315033733844757, 0.00832124799489975, 0.07583989948034286, 0.44250982999801636, -0.12718063592910767, -0.20705437660217285, 0.05514562129974365, 0.3489169180393219, -0.07071169465780258, 0.11349056661128998, 0.031792715191841125, 0.09025630354881287, -0.049087733030319214, -0.3630618155002594, 0.06516790390014648, -0.01939462125301361, 0.06788906455039978, -0.14831256866455078, -0.08773626387119293, 0.1735137403011322, -0.2894706726074219, -0.020574716851115227, -0.2216566801071167, 0.2498345971107483, -0.23599614202976227, 0.013944437727332115, 0.16499733924865723, -0.02381627820432186, 0.1253248006105423, -0.16987824440002441, 0.13464540243148804, -0.22948192059993744, 0.1340651512145996, 0.037361517548561096, 0.11513309180736542, 0.23605507612228394, 0.5455991625785828, -0.21919867396354675, -0.028531715273857117, 0.23761001229286194, 0.25836649537086487, -0.6207526326179504, 0.1218966692686081, -0.2193095088005066, -0.11131282895803452, -0.3863028287887573, 0.13781863451004028, 0.08189444988965988, -0.04294928163290024, -0.13485664129257202, -0.23111389577388763, -0.10467525571584702, 0.07781562209129333, 0.2825815975666046, -0.0008310899138450623, -0.1987895369529724, 0.13204878568649292, 0.22792860865592957, -0.070456862449646, -0.13433176279067993, 0.10638993233442307, 0.2855088412761688, 0.32122090458869934, 0.2335401177406311, 0.25778067111968994, -0.334809273481369, -0.2253362089395523, 0.03455473482608795, -0.00044829025864601135, -0.24579739570617676, -0.024681560695171356, -0.2800191342830658, 0.20098374783992767, 0.03859840705990791, -0.6139501929283142, -0.13813170790672302, -0.43617498874664307, -0.20025131106376648, -0.034218963235616684, -0.13085156679153442, 0.3575483560562134, -0.16364237666130066, 0.15799032151699066, 0.28751471638679504, 0.06559901684522629, 0.05103176087141037, -0.08622199296951294, 0.02207363024353981, 0.3146094083786011, 0.20110788941383362, 0.26496243476867676, 0.20801399648189545, -0.07735099643468857, -0.04098409786820412, -0.01721661537885666, -0.2904090881347656, -0.1861938238143921, 0.1184687465429306, -0.20818720757961273, 0.11302658915519714, -0.3155680298805237, 0.3886965215206146, 0.39289751648902893, -0.23363927006721497, 0.11838936805725098, 0.25339069962501526, 0.039332009851932526, -0.3467806875705719, -0.0914635881781578, 0.11253762245178223, 0.12667390704154968, -0.050920020788908005, 0.247306227684021, 0.16306500136852264, 0.2504338324069977, -0.1723097413778305, 0.08548068255186081, 0.1885589212179184, -0.21833819150924683, 0.178214430809021, 0.4489647448062897, -0.258218914270401, 0.045216139405965805, 0.05155699700117111, -0.25499188899993896, 0.2289685606956482, 0.2283363938331604, -0.06483722478151321, 0.295948326587677, 0.4261493682861328, -0.03568049147725105, 0.3528614342212677, -0.1423235386610031, 0.030657818540930748, 0.05196071416139603, 0.13089241087436676, -0.015550054609775543, 0.045528583228588104, 0.4165058135986328, -0.008753764443099499, -0.04033134877681732, -0.21584640443325043, 0.22013652324676514, -0.08850520849227905, -0.1476963758468628, -0.2782488465309143, -0.3249232769012451, -0.11586296558380127, -0.05779607594013214, -0.045378539711236954, -0.14014746248722076, 0.706403374671936, 0.079798623919487, -0.07771241664886475, -0.43017855286598206, 0.40263891220092773, 0.2697792649269104, -0.12425253540277481, 0.03371371701359749, 0.25435173511505127, 0.4279123544692993, -0.3185235261917114, -0.0857156366109848, 0.5536986589431763, 0.6665911674499512, 0.4717917740345001, -0.39450764656066895, 0.07029669731855392, -0.11245247721672058, -0.18227899074554443, 0.055573880672454834, 0.22163629531860352, 0.05265319347381592, -0.03965343162417412, 0.11666250228881836, 0.020728567615151405, -0.0014102468267083168, 0.1776181161403656, 0.13534091413021088, 0.27555519342422485, -0.16884441673755646, 0.17167815566062927, -0.34147804975509644, -0.2661192715167999, 0.15580235421657562, -0.09024769812822342, -0.06424036622047424, 0.10226378589868546, 0.6065556406974792, 0.09300480037927628, 0.013100434094667435, -0.03607797250151634, -0.022339962422847748, 0.09541536867618561, 0.2906781733036041, 0.2984878420829773, 0.2318648099899292, -0.14597547054290771, -0.00680696964263916, -0.4679802358150482, 0.04772119224071503, -0.14627087116241455, -0.13646472990512848, 0.2612055838108063, 0.4154999852180481, 0.16815891861915588, 0.28913354873657227, 0.31570398807525635, -0.07544542849063873, 0.3857262432575226, 0.1278291642665863, -0.0786743089556694, -0.3377087116241455, -0.05919715762138367, 0.22877399623394012, -0.13623353838920593, -0.41667068004608154, 0.3047880530357361, -0.2719825506210327, -0.04775095731019974, -0.2536156177520752, -0.07169191539287567, 0.2647555470466614, 0.1359941065311432, 0.5345326662063599, 0.31682732701301575, 0.2748361825942993, 0.010668415576219559, -0.028413735330104828, -0.33387982845306396, -0.2982674539089203, -0.2113001048564911, 0.3667523264884949, -0.1701822727918625, 0.44773030281066895, -0.24920479953289032, -0.46423575282096863, -0.2789261043071747, 0.12078036367893219, -0.039221182465553284, -0.02014991268515587, -0.18121767044067383, 0.5001735091209412, -0.23746904730796814, -0.10327030718326569, -0.1335625797510147, -0.13894477486610413, -0.07070234417915344, 0.3442595303058624, -0.1417948305606842, -0.48923584818840027, 0.5753933191299438, -0.38821810483932495, -0.22262127697467804, -0.11553806811571121, -0.04740974307060242, 0.5173842310905457, -0.07865134626626968, -0.7344138622283936, -0.01109004020690918, 0.3903237283229828, -0.06649941205978394, -0.10737712681293488, 0.07146496325731277, -0.1244744062423706, -0.035735417157411575, -0.0067528001964092255, 0.643000602722168, -0.05534069985151291, -0.15253670513629913, 0.19939829409122467, -0.17205563187599182 ]
https://github.com/huggingface/datasets/issues/4980
Make `pyarrow` optional
The whole datasets library is pretty much a wrapper to pyarrow (just take a look at some of the source for a Dataset) https://github.com/huggingface/datasets/blob/51aef08ad7053c0bfe8f9a961207b26df15850d3/src/datasets/arrow_dataset.py#L639 I think removing the pyarrow dependency would involve a complete rewrite / a different library with minimal functionality (datasets-lite ?)
**Is your feature request related to a problem? Please describe.** Is `pyarrow` really needed for every dataset? **Describe the solution you'd like** It is made optional. **Describe alternatives you've considered** Likely, no.
44
Make `pyarrow` optional **Is your feature request related to a problem? Please describe.** Is `pyarrow` really needed for every dataset? **Describe the solution you'd like** It is made optional. **Describe alternatives you've considered** Likely, no. The whole datasets library is pretty much a wrapper to pyarrow (just take a look at some of the source for a Dataset) https://github.com/huggingface/datasets/blob/51aef08ad7053c0bfe8f9a961207b26df15850d3/src/datasets/arrow_dataset.py#L639 I think removing the pyarrow dependency would involve a complete rewrite / a different library with minimal functionality (datasets-lite ?)
[ -0.15364816784858704, 0.3306680917739868, -0.0716269463300705, -0.20790855586528778, 0.12799778580665588, -0.13656021654605865, 0.29660892486572266, 0.2046220749616623, -0.3974742591381073, 0.2452406883239746, 0.15917767584323883, 0.5092920064926147, 0.06397420167922974, -0.018436308950185776, -0.10961559414863586, 0.048015862703323364, 0.03286174684762955, 0.6245987415313721, -0.010310500860214233, 0.12736795842647552, -0.0666663721203804, -0.134791299700737, -0.2352009266614914, 0.1754390150308609, -0.2098727524280548, -0.030211372300982475, 0.13464902341365814, -0.1389673352241516, -0.27303794026374817, -0.4274495542049408, 0.3473314642906189, 0.3476564288139343, -0.11450245976448059, -0.05743678659200668, -0.00010745133477030322, -0.05847831815481186, 0.17084664106369019, 0.18637727200984955, -0.144908607006073, -0.07561373710632324, -0.051617465913295746, -0.11903902143239975, 0.46228620409965515, -0.2797160744667053, 0.14786899089813232, -0.40643566846847534, -0.009001059457659721, 0.11411997675895691, 0.224723681807518, 0.04734666272997856, 0.2493869811296463, 0.3008827567100525, -0.13441044092178345, 0.028824595734477043, 0.5119609236717224, 0.3088677227497101, -0.1872999519109726, 0.40182730555534363, -0.013902992010116577, -0.11592818051576614, -0.18253159523010254, 0.246013805270195, -0.22995975613594055, -0.16623996198177338, 0.29355180263519287, -0.015896927565336227, 0.05480816215276718, -0.15684466063976288, -0.03130856156349182, 0.34606316685676575, 0.5683605074882507, -0.5883808732032776, -0.08757594972848892, -0.2099449634552002, 0.14064113795757294, -0.2693735957145691, 0.09184194356203079, 0.18318083882331848, -0.1459593027830124, 0.3047904372215271, 0.04324984923005104, -0.2644120752811432, -0.26249489188194275, 0.07961494475603104, -0.1685521900653839, 0.14887507259845734, 0.17020836472511292, 0.08348608016967773, 0.13934078812599182, 0.02350154146552086, 0.17452682554721832, 0.004456598311662674, -0.008289705961942673, -0.10086265951395035, -0.14633868634700775, -0.24078722298145294, 0.029932908713817596, 0.24595573544502258, 0.1735978126525879, 0.3115442395210266, -0.08596573024988174, 0.05513116717338562, 0.066078782081604, 0.12322412431240082, 0.030441245064139366, -0.226880744099617, -0.036388687789440155, -0.14313696324825287, 0.45528650283813477, -0.15262779593467712, 0.20675131678581238, -0.051555246114730835, 0.2290017306804657, -0.2480328530073166, 0.41069936752319336, 0.04918636381626129, 0.6517953872680664, -0.22405272722244263, -0.20878365635871887, -0.2510063052177429, -0.32361239194869995, 0.027921443805098534, 0.07010790705680847, 0.026009265333414078, 0.02002367377281189, 0.07193844020366669, -0.13189876079559326, 0.16645795106887817, -0.03307884559035301, -0.060832053422927856, -0.041056226938962936, -0.002501601353287697, -0.15261465311050415, 0.2327495813369751, 0.11449845135211945, -0.17384004592895508, 0.17042379081249237, 0.37189024686813354, 0.09667899459600449, 0.48863381147384644, 0.08219996839761734, -0.10147035121917725, -0.09939727932214737, 0.21915096044540405, -0.2436126470565796, -0.044752538204193115, -0.1548299491405487, 0.24296672642230988, -0.2978478670120239, 0.38954001665115356, -0.12407145649194717, -0.4283336400985718, -0.27584585547447205, 0.2561248540878296, -0.17343124747276306, -0.1447671353816986, -0.14110219478607178, 0.025984587147831917, -0.3504045903682709, -0.09678903222084045, 0.32689550518989563, -0.17726607620716095, 0.14461106061935425, -0.33913686871528625, -0.03444303572177887, 0.057369932532310486, -0.3586689531803131, -0.03129546344280243, -0.16875380277633667, -0.5480758547782898, 0.047738440334796906, 0.279266893863678, -0.6241833567619324, 0.09509348124265671, -0.15177921950817108, 0.33777952194213867, 0.5346730351448059, -0.08885850012302399, -0.27743983268737793, -0.06908759474754333, -0.2589496076107025, -0.03463283181190491, -0.09455900639295578, 0.28257039189338684, -0.21814127266407013, -0.06087412312626839, -0.2787266969680786, 0.3044329881668091, 0.006716825067996979, -0.03214060515165329, -0.02555140107870102, -0.4262502193450928, 0.3802575469017029, 0.27943986654281616, -0.19953450560569763, -0.1772141456604004, -0.04248815029859543, -0.3409120738506317, 0.24592635035514832, -0.32036611437797546, -0.13736006617546082, 0.06239272654056549, 0.7864648699760437, 0.00446009635925293, -0.05269043520092964, -0.25840073823928833, -0.3995530307292938, 0.03773126006126404, -0.033542223274707794, 0.10632963478565216, -0.42836707830429077, -0.5997552275657654, 0.10683979839086533, 0.10673745721578598, 0.03811671584844589, 0.35490214824676514, 0.1530742347240448, -0.2882375121116638, 0.018612317740917206, -0.043833911418914795, -0.15345457196235657, -0.13117387890815735, -0.10820095241069794, 0.2632145285606384, 0.11525855958461761, 0.1456102579832077, -0.020053083077073097, -0.032003190368413925, 0.17353864014148712, 0.13658028841018677, 0.09912451356649399, 0.1644352823495865, 0.22721800208091736, 0.30788370966911316, -0.026088984683156013, -0.002270936965942383, -0.32570114731788635, 0.29061707854270935, 0.06983958929777145, -0.3623211979866028, 0.09856484085321426, -0.03007756918668747, -0.09652555733919144, 0.0915510281920433, 0.03815227746963501, 0.3106602430343628, 0.1250700205564499, 0.1804099977016449, 0.011778026819229126, -0.05857118219137192, -0.09650874137878418, -0.27031588554382324, -0.11776407063007355, 0.04796425998210907, 0.08097393810749054, 0.15446467697620392, 0.37184083461761475, 0.2417692393064499, -0.34213823080062866, 0.06140787899494171, 0.36352330446243286, 0.039066132158041, 0.2032947540283203, 0.22914227843284607, -0.23726660013198853, -0.09638693183660507, 0.2578929364681244, -0.2617208957672119, 0.31599897146224976, 0.46167996525764465, 0.006863780319690704, 0.14256520569324493, -0.04344447702169418, -0.2807317078113556, 0.09777391701936722, 0.132769376039505, 0.20239178836345673, -0.16038751602172852, 0.3250185251235962, -0.03844268620014191, -0.3982057571411133, -0.24012449383735657, -0.17661646008491516, -0.07270392775535583, -0.13096967339515686, 0.001426858827471733, -0.3444233238697052, -0.3067498207092285, -0.012314566411077976, -0.28271910548210144, -0.35708752274513245, -0.11406921595335007, 0.4362475872039795, 0.09999392181634903, -0.16290807723999023, 0.42522740364074707, -0.12936946749687195, 0.14978662133216858, -0.2711903750896454, -0.48722875118255615, -0.17069554328918457, -0.2672750651836395, -0.23301982879638672, 0.1882590800523758, -0.06234056502580643, 0.131505087018013, 0.4777943789958954, 0.1213342472910881, 0.12918414175510406, -0.6127896308898926, -0.3263584077358246, 0.10337696969509125, 0.04457543417811394, -0.031533725559711456, 0.42198246717453003, 0.09875201433897018, 0.12846358120441437, -0.23990187048912048, 0.09302692860364914, -0.1440979242324829, -0.05889573693275452, 0.0003163907676935196, -0.2941659986972809, 0.12555775046348572, -0.15684956312179565, -0.0635434165596962, -0.12054549902677536, -0.23091202974319458, 0.38410407304763794, -0.10121884942054749, 0.10724327713251114, 0.1625939905643463, 0.1650121659040451, -0.014193504117429256, -0.2818326950073242, -0.009173715487122536, 0.08198228478431702, -0.012271955609321594, 0.32494208216667175, 0.13783948123455048, -0.086851567029953, 0.09002123773097992, -0.08051291108131409, 0.17962615191936493, 0.3816148638725281, -0.4786534309387207, -0.3327603042125702, -0.1870240569114685, 0.8262919783592224, -0.20565834641456604, 0.04239620268344879, 0.5010385513305664, 0.2754741907119751, -0.22331951558589935, 0.11656952649354935, -0.12423650920391083, -0.04605517536401749, -0.07118573784828186, -0.12537595629692078, 0.0864260345697403, 0.19456690549850464, 0.05969776585698128, 0.7887526154518127, -0.13693036139011383, -0.10008163750171661, 0.228879913687706, -0.15756990015506744, 0.4445708394050598, 0.056558188050985336, -0.06624768674373627, -0.11756069213151932, 0.040929920971393585, 0.06537164002656937, 0.24535436928272247, -0.06675592064857483, -0.2816402316093445, -0.11621038615703583, -0.4064828157424927, -0.05035145580768585, -0.3782171905040741, 0.12310957908630371, 0.13240854442119598, 0.17112481594085693, -0.03825194388628006, 0.0064608752727508545, -0.22914722561836243, -0.19362184405326843, 0.2785203754901886, 0.07138989865779877, 0.20413890480995178, -0.266406774520874, -0.2819879949092865, -0.014645987190306187, -0.2502789795398712, 0.1908906251192093, -0.017370155081152916, -0.334452748298645, 0.22274358570575714, -0.0566069558262825, 0.006891094148159027, -0.019045256078243256, 0.42076796293258667, 0.17357957363128662, -0.22749613225460052, 0.04896179214119911, 0.31580621004104614, -0.46044668555259705, 0.018310952931642532, -0.016586409881711006, 0.07299592345952988, -0.030276130884885788, 0.04509264975786209, -0.43485841155052185, -0.3330177962779999, 0.3674164414405823, 0.40894097089767456, -0.00757242739200592, -0.41289639472961426, -0.17845356464385986, -0.23809438943862915, -0.019268687814474106, 0.04774169996380806, 0.05262184888124466, -0.1415882110595703, -0.001939346781000495, -0.011011015623807907, -0.15498410165309906, -0.21537664532661438, 0.1332886666059494, 0.03298601880669594, 0.05997103452682495, -0.2901843786239624, -0.09595084190368652, -0.1314999759197235, 0.01037289947271347, 0.4492514431476593, 0.33420199155807495, 0.05797798931598663, -0.4883078932762146, -0.38617759943008423, 0.09109101444482803, 0.4639395773410797, 0.24110905826091766, -0.2562342882156372, 0.4213537573814392, -0.15218544006347656, 0.03871637210249901, -0.12267094105482101, -0.041641831398010254, 0.20675358176231384, -0.36429035663604736, -0.0816364735364914, -0.032902833074331284, 0.46583035588264465, 0.29258888959884644, -0.15280681848526, 0.15790270268917084, 0.40867215394973755, -0.15803812444210052, -0.0388568714261055, 0.10520286858081818, 0.9313454627990723, 0.2308376133441925, 0.1600511223077774, 0.512616753578186, -0.23927180469036102, 0.3800612986087799, -0.003946688026189804, 0.10656771063804626, -0.2661712169647217, -0.2060033231973648, -0.03153855353593826, -0.3124307692050934, 0.10574108362197876, 0.12695209681987762, -0.06049109250307083, 0.1922616809606552, -0.08397034555673599, 0.2680106461048126, 0.06795394420623779, 0.32949599623680115, -0.11256853491067886, -0.22783593833446503, -0.15861868858337402, 0.1807756870985031, -0.015435904264450073, -0.1509457230567932, -0.1120232418179512, -0.26331835985183716, 0.23123133182525635, -0.31094950437545776, 0.043156176805496216, 0.1321743130683899, -0.413523405790329, 0.011590041220188141, -0.002983272075653076, -0.129680797457695, 0.234755277633667, -0.010629978030920029, -0.050182655453681946, 0.053730111569166183, -0.21880576014518738, 0.20661619305610657, 0.10343241691589355, 0.07030828297138214, -0.07423389703035355, 0.07294601202011108, 0.14734207093715668, -0.15925201773643494, -0.23290637135505676, 0.21250620484352112, 0.004497040994465351, -0.31488317251205444, -0.05692875385284424, -0.25290220975875854, 0.2535519599914551, -0.24848760664463043, 0.18723487854003906, -0.13940264284610748, 0.15055514872074127, -0.10281885415315628, 0.1859222799539566, 0.11043918132781982, 0.2712734043598175, 0.10290764272212982, -0.06460119783878326, -0.008617520332336426, -0.28394871950149536, 0.06206369400024414, 0.05223768204450607, -0.02519320137798786, 0.15972445905208588, -0.0810907781124115, -0.33604657649993896, -0.2827867567539215, -0.04163239151239395, 0.10144314169883728, -0.5210763812065125, 0.012423125095665455, 0.3341415226459503, 0.2967854142189026, -0.1675150990486145, 0.08971460163593292, 0.013862013816833496, -0.168597012758255, -0.08192883431911469, 0.08899760246276855, -0.18063606321811676, 0.31593024730682373, 0.15219293534755707, 0.10404443740844727, 0.14805427193641663, 0.12344750761985779, 0.027783429250121117, -0.017642641440033913, -0.41127872467041016, 0.19466058909893036, 0.15581773221492767, 0.19760029017925262, -0.25472840666770935, 0.009736210107803345, 0.10479321330785751, -0.04433240741491318, 0.20281779766082764, -0.10927028954029083, -0.07130426913499832, -0.2833007872104645, -0.09731481969356537, 0.11830532550811768, -0.02546376734972, -0.03554549068212509, 0.3534168601036072, -0.14691060781478882, -0.03494420647621155, 0.02896449714899063, 0.18853598833084106, -0.04579544812440872, -0.10468943417072296, 0.1696159988641739, 0.26096048951148987, 0.07022573798894882, -0.4010627269744873, -0.061415672302246094, -0.24049240350723267, 0.21469494700431824, 0.11890487372875214, 0.24104534089565277, -0.2086455374956131, -0.05444332957267761, 0.10853699594736099, 0.05948750674724579, 0.2576122283935547, -0.08542781323194504, -0.24122264981269836, -0.07061779499053955, -0.4392761290073395, -0.1107032373547554, 0.4462704360485077, 0.1596558839082718, -0.14328064024448395, 0.06817345321178436, 0.44909343123435974, 0.271136999130249, -0.4629826247692108, -0.06994900852441788, 0.23110318183898926, -0.041790664196014404, 0.1849467009305954, 0.23637136816978455, 0.17248733341693878, 0.07115684449672699, 0.15691344439983368, -0.1605062484741211, 0.15692396461963654, 0.028329892084002495, -0.0035922452807426453, 0.4739503562450409, -0.03254283219575882, -0.25486820936203003, 0.545687735080719, 0.4935126006603241, 0.30476483702659607, 0.21446773409843445, -0.27729111909866333, 0.26950299739837646, 0.0660482719540596, -0.08534488081932068, 0.0719904899597168, 0.06552118062973022, -0.12499256432056427, 0.2319893091917038, 0.3328879475593567, -0.40147072076797485, 0.2357088178396225, 0.34579962491989136, 0.4504043161869049, -0.15225352346897125, -0.0745164006948471, 0.23287570476531982, -0.060933470726013184, 0.15473879873752594, -0.13958793878555298, -0.05553612485527992, 0.01018766313791275, 0.03487817570567131, -0.07509627938270569, -0.2997879385948181, 0.37555330991744995, 0.07537616044282913, 0.17795109748840332, -0.28091490268707275, 0.35503578186035156, 0.18759050965309143, 0.25825974345207214, -0.05933380126953125, -0.3596550226211548, 0.03722578287124634, -0.12114472687244415, 0.003282606601715088, 0.3326033055782318, 0.20738407969474792, 0.1049312874674797, -0.10537728667259216, -0.17115981876850128, -0.14826679229736328, -0.19306477904319763, -0.06422986090183258, -0.09250477701425552, 0.1675643026828766, 0.47434815764427185, 0.07012253999710083, 0.23290233314037323, -0.24700592458248138, 0.1823287010192871, 0.03269846737384796, 0.14882832765579224, -0.5759291648864746, 0.16649788618087769, 0.3825361728668213, -0.34838443994522095, -0.013150211423635483, -0.0874917283654213, 0.06085771322250366, 0.05796835198998451, 0.3422354757785797, 0.19250161945819855, -0.16377130150794983, -0.332122802734375, 0.1286555975675583, 0.09107139706611633, 0.1837296038866043, 0.293512761592865, 0.40621259808540344, -0.17324432730674744, -0.06192299723625183, -0.44866788387298584, 0.05649019032716751, -0.40530216693878174, -0.05554119497537613, 0.31843695044517517, -0.11681903898715973, 0.011179693043231964, 0.5064982175827026, 0.008432954549789429, 0.2015235871076584, 0.08011729270219803, -0.15300165116786957, -0.3001711368560791, 0.25398215651512146, 0.1719510853290558, -0.23364099860191345, -0.028419766575098038, -0.31036272644996643, 0.07272554934024811, -0.2513721287250519, 0.10222727805376053, -0.2868737578392029, 0.04956882447004318, 0.28809234499931335, 0.2527836561203003, 0.6892633438110352, 0.11153774708509445, 0.10266923904418945, 0.11214952915906906, -0.13086476922035217, 0.045310214161872864, -0.049383994191884995, -0.30116134881973267, 0.08310998976230621, 0.03251614421606064, -0.005157859995961189, -0.06483127176761627, -0.026858117431402206, -0.26868873834609985, 0.2755962312221527, 0.07147692143917084, 0.019370926544070244, -0.0763901099562645, 0.2239995151758194, 0.20803356170654297, 0.0724169984459877, -0.4173179566860199, -0.14805498719215393, -0.12517400085926056, -0.1642448604106903, -0.4871900677680969, -0.27026158571243286, 0.42712974548339844, -0.3632599413394928, -0.03889497369527817, -0.03819967061281204, 0.3508870601654053, 0.23081263899803162, -0.15321063995361328, -0.331127405166626, 0.07716702669858932, 0.40069451928138733, 0.06713900715112686, 0.007624272257089615, 0.28997424244880676, -0.0002452367916703224, -0.06194956973195076, -0.10422757267951965, 0.2507093548774719, -0.12089819461107254, -0.2385019212961197, -0.32941246032714844, -0.4909136891365051 ]