html_url
stringlengths
51
51
title
stringlengths
6
280
comments
stringlengths
67
24.7k
body
stringlengths
51
36.2k
__index_level_0__
int64
1
1.17k
comment_length
int64
16
1.45k
text
stringlengths
190
38.3k
embeddings
sequence
https://github.com/huggingface/datasets/issues/3688
Pyarrow version error
Hi @Zaker237, thanks for reporting. This is weird: the error you get is only thrown if the installed pyarrow version is less than 3.0.0. Could you please check that you install pyarrow in the same Python virtual environment where you installed datasets? From the Python command line (or terminal) where you get the error, please type: ``` import pyarrow print(pyarrow.__version__) import datasets print(datasets.__version__) ```
## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0
963
64
Pyarrow version error ## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0 Hi @Zaker237, thanks for reporting. This is weird: the error you get is only thrown if the installed pyarrow version is less than 3.0.0. Could you please check that you install pyarrow in the same Python virtual environment where you installed datasets? From the Python command line (or terminal) where you get the error, please type: ``` import pyarrow print(pyarrow.__version__) import datasets print(datasets.__version__) ```
[ -1.2849866151809692, -0.9149413108825684, -0.6520612835884094, 1.4287223815917969, -0.15140192210674286, -1.336443305015564, 0.15659460425376892, -1.038428783416748, 1.7254475355148315, -0.7810778617858887, 0.28039824962615967, -1.6592779159545898, 0.12056879699230194, -0.583744466304779, -0.7101070880889893, -0.8417413234710693, -0.4109680652618408, -0.7519049048423767, 1.100322961807251, 2.5161221027374268, 1.3508384227752686, -1.4286776781082153, 2.7619221210479736, 0.7500436305999756, -0.19689033925533295, -0.9616190791130066, 0.5273226499557495, -0.024637825787067413, -1.297046184539795, -0.5076597332954407, -0.8468593955039978, 0.018412210047245026, -0.6089756488800049, -0.5422490835189819, -0.12062989175319672, 0.4109586477279663, -0.31221726536750793, -0.4820346534252167, -0.5788653492927551, -0.7826820015907288, 0.41934463381767273, -0.45471325516700745, 0.9845448732376099, -0.3312806189060211, 1.7263925075531006, -0.5672324895858765, 0.46298372745513916, 0.8282036781311035, 1.2971720695495605, 0.14349275827407837, 0.014581040479242802, 0.3283522427082062, 0.3110063374042511, 0.01869935169816017, 0.5790520310401917, 1.0712722539901733, 0.7348955869674683, 0.3965741693973541, 0.6762566566467285, -2.1508431434631348, 1.358651041984558, -0.9424354434013367, 0.1478445827960968, 1.249419927597046, -0.9344937205314636, 0.3423019349575043, -1.694238543510437, -0.08643242716789246, 0.618334174156189, -2.197125196456909, 0.18054382503032684, -1.2975037097930908, -0.4361856281757355, 0.9988667964935303, 0.2916649878025055, -1.135125994682312, 0.05493094027042389, -0.4817667305469513, 1.0195392370224, 0.4014350473880768, 1.0903754234313965, -1.6463420391082764, 0.01839027926325798, -0.3209296762943268, 0.2222074419260025, -1.2957535982131958, -1.5598225593566895, 0.6003091335296631, 0.5975789427757263, 0.6346451640129089, 0.008409555070102215, 1.0642935037612915, -1.0092140436172485, 0.7217668294906616, -1.0261428356170654, -1.8027327060699463, -1.3966023921966553, -2.33406662940979, -2.2746670246124268, 0.6646580100059509, -0.5214690566062927, -0.5089320540428162, 2.1128721237182617, -1.0910022258758545, -1.718824863433838, 1.0787749290466309, 0.2026243507862091, 0.025519929826259613, 2.4382715225219727, 0.19642747938632965, -0.8119199275970459, 0.531305193901062, -0.7538176774978638, 0.764889657497406, -0.3034808337688446, 1.267113208770752, 0.34317320585250854, -1.0341598987579346, 1.512284278869629, -0.39387595653533936, 0.7147988677024841, -0.643408477306366, -0.3791542947292328, -0.7190046310424805, 0.25216957926750183, 1.7889626026153564, -0.31355196237564087, 1.5474954843521118, -0.3321382999420166, -1.4629753828048706, -1.5565189123153687, 0.7908610701560974, 0.3657724857330322, -0.7041740417480469, 0.11334747076034546, -0.42444929480552673, 0.13593274354934692, -0.09647159278392792, 1.1520744562149048, 1.3254531621932983, 0.6607458591461182, -0.3321564495563507, -0.927883505821228, 0.19578124582767487, -0.06975602358579636, -0.6854512095451355, -1.7731044292449951, -0.2688269317150116, 0.051127828657627106, 0.7417152523994446, -1.169467806816101, 1.8045064210891724, 0.987139880657196, 1.905346393585205, 1.0919376611709595, -0.288542777299881, 1.4334243535995483, 0.1273954063653946, 1.8224890232086182, -0.5050301551818848, 0.6820957660675049, -0.3991326689720154, -1.109300971031189, 0.8558771014213562, -0.313512921333313, -2.013559579849243, -0.6899538040161133, -0.6129435896873474, -0.14059016108512878, -0.775343120098114, 0.9992866516113281, -0.2940378487110138, -1.3451542854309082, 0.24639758467674255, -0.7513401508331299, 0.03050638735294342, -1.286760926246643, 0.2595410943031311, 0.6889548897743225, -0.5760634541511536, 0.15848875045776367, -0.3055790364742279, -1.2953331470489502, -0.471791535615921, 0.3279346227645874, 1.8419665098190308, -0.705920398235321, 0.9439666271209717, 1.0724390745162964, -0.651322066783905, 0.05990971624851227, 0.32492759823799133, -0.3003985583782196, 0.8256988525390625, -1.0286234617233276, -0.4601488411426544, 1.2141536474227905, -0.3141458332538605, -0.6302441358566284, 1.557477355003357, 0.7002227902412415, -1.0613887310028076, -0.2163105010986328, -0.10445701330900192, -0.9185823202133179, 0.09356872737407684, -1.5606272220611572, -0.1086038276553154, 0.4724581241607666, -1.6533921957015991, -0.4498791992664337, -0.17536340653896332, 1.3355450630187988, -0.09411762654781342, 1.4857293367385864, -0.36318647861480713, -0.046810638159513474, -0.2783185839653015, -0.41547757387161255, 0.09861715137958527, -0.13871100544929504, -0.5927207469940186, 0.1450340896844864, -0.8269990086555481, 0.35581910610198975, 1.448455572128296, 0.2766733169555664, -0.04935107007622719, 0.393324077129364, 1.0833852291107178, 0.3124798536300659, -0.07396765053272247, -0.7630755305290222, -1.4545297622680664, 2.032024621963501, -1.4664113521575928, 2.0518720149993896, 0.8274086117744446, -0.1347954422235489, -1.7190425395965576, -1.8374189138412476, 1.4132519960403442, 1.115943193435669, 2.248384475708008, 0.5533167123794556, 0.3226372301578522, -0.814824104309082, -0.616985559463501, 0.3430599272251129, -1.0092952251434326, -0.731816291809082, 0.1821814924478531, 2.407402515411377, 1.769393801689148, -0.39024412631988525, -0.12370071560144424, -0.9468482732772827, 1.399921178817749, -0.19662721455097198, 0.277634859085083, 2.0123116970062256, -0.33153027296066284, -0.9807419180870056, 1.312696099281311, -2.346083641052246, 0.1848655343055725, 2.047109365463257, 0.21924984455108643, 0.1278396099805832, -1.3943582773208618, -0.6411377787590027, -0.438289999961853, -0.3735346496105194, -1.2772971391677856, 0.5544124841690063, -0.26542922854423523, -0.8320977687835693, -1.469455361366272, 0.1988712102174759, -1.0861390829086304, -1.8103471994400024, 0.31837165355682373, 1.85545015335083, 2.100219249725342, -0.7429919242858887, 1.582772135734558, -0.37689831852912903, 0.16752582788467407, 1.1363919973373413, 1.2117860317230225, 3.1669845581054688, 1.9623197317123413, -1.2039847373962402, 0.6366387605667114, -0.14453816413879395, -0.5040633082389832, 1.2034316062927246, -1.235921025276184, 1.2847466468811035, -0.15609772503376007, -1.1504472494125366, -1.2777444124221802, 0.9140022993087769, 0.4340340793132782, -0.046892017126083374, -0.4570368826389313, 1.3049958944320679, 0.11682118475437164, 1.3574672937393188, 0.4563949406147003, -0.232184499502182, 0.6710363626480103, -0.4598361849784851, -0.5034161806106567, 1.4423714876174927, 0.1322137415409088, -1.5154170989990234, -2.215456008911133, -0.24367935955524445, -0.7848129272460938, 0.07987247407436371, -0.69536292552948, -0.9836483597755432, 1.6977201700210571, 0.33576256036758423, -1.1264142990112305, -0.28595125675201416, -0.443164587020874, -0.4970155358314514, 2.7387173175811768, -1.304856777191162, -0.22582824528217316, -0.9888152480125427, -0.6045606732368469, 1.5678187608718872, -1.1845093965530396, -0.17663860321044922, -1.0884851217269897, -0.5741523504257202, -1.2576532363891602, -0.5161184072494507, -0.08810947090387344, -0.9675719738006592, 0.8633095622062683, 0.313723623752594, -1.2154031991958618, -0.2998085916042328, -0.9265316128730774, 0.8558915853500366, -0.16369187831878662, 0.281684011220932, 1.8277641534805298, 0.3832930028438568, -0.4435763955116272, 0.8162981271743774, 1.1306791305541992, 0.5802851915359497, -0.6407120823860168, 0.042369257658720016, -0.6524136662483215, 0.4885573983192444, -1.1877046823501587, 0.2436504364013672, -2.8262133598327637, 0.6057960987091064, -0.05334068089723587, 0.01716657727956772, -0.14203040301799774, -1.2651147842407227, 1.0846459865570068, 2.6458988189697266, -1.173386812210083, 0.5348307490348816, 0.3667135536670685, 1.1834721565246582, -1.5360286235809326, 0.331904798746109, -0.4436837136745453, 2.078521728515625, 0.17456352710723877, 1.206263780593872, -0.48369720578193665, -2.4505345821380615, 0.7896559834480286, -1.1954642534255981, -1.246976613998413, 0.8432357311248779, -0.9351076483726501, 0.06359944492578506, -1.416090726852417, -0.1670415997505188, -0.9264650344848633, -1.1638916730880737, 0.6546210646629333, 0.1656045913696289, 0.49627137184143066, -0.6962332725524902, 0.27679309248924255, -2.1946582794189453, -1.3317921161651611, -0.3210712969303131, -0.9656928181648254, 0.5251664519309998, -0.47947174310684204, 0.5900293588638306, -0.15752695500850677, -0.03623552247881889, 0.3710375130176544, 1.4307571649551392, 3.4222350120544434, 0.10355674475431442, 0.283189058303833, -0.22946873307228088, -0.9622194766998291, 1.4400436878204346, 0.8916636109352112, -0.20046356320381165, -0.483379065990448, -1.0375882387161255, 1.2364732027053833, 1.9467836618423462, 0.9153432846069336, -0.0033118706196546555, -0.8860894441604614, -0.7489058375358582, -0.04690694808959961, 0.17956219613552094, 0.49551498889923096, 0.9228600859642029, 0.06152860075235367, 0.08351809531450272, 1.5451267957687378, 1.115768551826477, -0.3900894522666931, 0.302762508392334, -0.8658192753791809, -0.40001919865608215, 0.6104919910430908, 0.2617111802101135, -0.0573350265622139, 0.34903839230537415, -0.9127021431922913, -0.2873629927635193, -0.33833858370780945, -0.8253154158592224, -0.7375534176826477, -0.37715834379196167, -0.2829859256744385, 1.6939483880996704, 0.04279020056128502, -0.5033288598060608, -0.052591994404792786, -0.7184389233589172, -0.13688674569129944, -1.014640212059021, 0.31980276107788086, -0.25720933079719543, -0.04854939877986908, -0.2094975709915161, 1.6780155897140503, -0.9264678359031677, -2.01780104637146, 0.24976614117622375, 0.26057833433151245, -0.22397170960903168, 0.2562524080276489, 1.6663711071014404, 0.6681368947029114, 1.4184437990188599, 1.3914210796356201, 0.9458407163619995, -0.7289214730262756, -1.3104389905929565, 0.6704680919647217, 1.0079874992370605, -1.350798487663269, 0.8804379105567932, -0.03703545033931732, -0.6095227599143982, 0.6236991882324219, 1.3398394584655762, 0.5455866456031799, -2.0271856784820557, 0.8049734234809875, -0.986422061920166, 0.9560725688934326, 0.7130386233329773, 0.761722207069397, 0.1773964762687683, 0.7723459005355835, -1.1313472986221313, -1.150883674621582, -0.6821289658546448, -0.7161511182785034, 1.886679768562317, -0.3676747679710388, 0.6116753220558167, -0.19180002808570862, -1.3133299350738525, -0.08811958879232407, 0.6872145533561707, 0.4263356328010559, -0.4434301555156708, 0.8043658137321472, -0.6673190593719482, -1.0888437032699585, -1.2806774377822876, -0.4073058068752289, -1.0098958015441895, -1.0017518997192383, 0.9923275709152222, 0.6624225974082947, 0.3457663059234619, 1.847436785697937, 0.6548072099685669, 0.18996787071228027, -2.514601707458496, 0.9456784725189209, 0.3094276189804077, -0.1298447549343109, 0.8529065251350403, 0.3694537878036499, 0.9420865178108215, 0.011595162563025951, 0.5425461530685425, -2.4442059993743896, 2.292055368423462, -0.2579399645328522, 0.6764395833015442, 0.052643321454524994, -0.23595158755779266, 1.014526128768921, 0.6519304513931274, 0.4832994341850281, -0.9911680817604065, 0.8004351854324341, -0.5374329686164856, 1.3101907968521118, 0.9359338879585266, -0.7894895672798157, -0.03670734539628029, 1.242396354675293, 0.44628098607063293, -0.5359063744544983, -0.9512262940406799, -1.041919231414795, 0.9088340401649475, 1.8688305616378784, -0.0692402794957161, -0.09682507067918777, 0.7656225562095642, 0.6957230567932129, -1.1120831966400146, -0.008952334523200989, -0.7534897923469543, -0.7961651682853699, 1.6700366735458374, 2.070341110229492, -0.10347093641757965, -0.20064863562583923, -0.7042695879936218, -1.210325002670288, 0.8266779780387878, -0.03320522978901863, -0.012258310802280903, 0.6019163727760315, -0.602770984172821, 1.1147661209106445, 0.8368013501167297, 0.9512678384780884, 0.13509170711040497, 0.26318487524986267, 0.3829408288002014, -0.3093143701553345, -1.1835256814956665, -0.28067031502723694, -1.1103771924972534, -2.4840478897094727, 0.30790793895721436, -0.25769099593162537, -1.5491582155227661, -0.028989102691411972, -1.0498936176300049, 0.914583683013916, -0.5055781006813049, -1.138039231300354, -1.5049134492874146, 0.08792182058095932, -0.03500720113515854, 0.8937428593635559, -1.5099434852600098, -0.10947884619235992, 1.3062465190887451, 0.8878752589225769, -0.6197025775909424, 1.0717852115631104, 0.2823820412158966, 1.0492281913757324, 0.827638566493988, -0.36922886967658997, 0.5894542932510376, 0.09729241579771042, -1.295216679573059, 0.4205060601234436, 1.220073938369751, 0.1944097876548767, 1.5432157516479492, -0.5092639923095703, 0.005689850077033043, 0.32538989186286926, -0.5274744629859924, -0.45749184489250183, -0.5385995507240295, 0.7383257150650024, -0.04410570114850998, -0.84471595287323, -0.05622316896915436, -0.19669564068317413, -0.26228734850883484, 0.14925053715705872, -1.5652798414230347, -0.12776747345924377, -0.4566711485385895, -0.5981088280677795, -1.3490623235702515, -0.0033706510439515114, 1.5257011651992798, -0.724937379360199, -0.20639990270137787, 0.3955974578857422, 0.36416274309158325, 0.48327481746673584, 0.6433703303337097, -0.7519021034240723, -0.4403972625732422, -0.3417654037475586, -0.35329940915107727, 0.33390504121780396, 1.2758816480636597, -0.017595697194337845, -1.0693165063858032, 0.6617228388786316, -0.5006529688835144, 0.06118229031562805, 1.903552532196045, 0.09851913899183273, -0.7300445437431335, 0.38548964262008667, -0.7225058674812317, 1.8924912214279175, 1.7027814388275146, 1.3122519254684448, -0.1901031732559204, -1.0071957111358643, 0.6812204718589783, -0.4139452278614044, -0.4373570382595062, 0.8416814208030701, 0.38982486724853516, -0.2586171627044678, -1.3918994665145874, 0.7246200442314148, 1.222347378730774, -0.7975094318389893, -0.8440015316009521, 0.10815773904323578, -0.7953514456748962, 1.1845978498458862, 0.6657221913337708, 0.37380626797676086, 0.2713179886341095, 1.7005006074905396, 0.7464199662208557, -0.5212810635566711, 0.5122714042663574, 0.499717116355896, -0.2560586631298065, -2.0504226684570312, -1.108534336090088, 0.2920367121696472, -0.49608007073402405, -1.583476185798645, 1.4435486793518066, -1.2316416501998901, -0.9534938931465149, 0.5305323600769043, -0.016136253252625465, 1.348729133605957, 0.3503579795360565, 1.5079269409179688, 2.1101794242858887, 0.8219298124313354, 0.4341433644294739, 1.2139739990234375, -0.2958601117134094, -0.5195697546005249, 1.856040596961975, -0.44944024085998535, 0.5300709009170532, 1.1437606811523438, -0.374632328748703, -1.0460901260375977, -0.8125361800193787, -1.2432529926300049, -0.7390210628509521, 1.197270154953003, 0.028711818158626556, -1.173804759979248, 0.3540841042995453, 1.5460617542266846, 0.199159175157547, -0.3823843002319336, 0.5755521655082703, 0.4480052590370178, -0.7980490922927856, -0.16839846968650818, -0.9055758118629456, 0.5429608821868896, -0.2988499104976654, -0.35811853408813477, 0.3004651963710785, 0.4961977005004883, 1.3614223003387451, -0.09678111970424652, 0.12064228951931, 1.1782320737838745, -1.3399395942687988, 1.4840644598007202, -0.68660569190979, 0.23031508922576904, -2.297746419906616, 1.3595459461212158, -0.7904897332191467, 2.0107831954956055, -2.6836438179016113, 0.4185886085033417, -0.4544387459754944, -0.3985161781311035, 0.22943826019763947, -0.3033153712749481, 0.14668135344982147, -0.1298401802778244, -1.1028757095336914, -0.012232081964612007, -0.59222012758255, 0.6655833125114441, 1.130128026008606, 1.37709379196167, -1.1234323978424072, -0.18225301802158356, -1.670862078666687, -0.16547100245952606, -0.8195047974586487, 0.3089715540409088, -1.9590141773223877, -0.2733492851257324, -2.0420336723327637, -2.441149950027466, -1.2763023376464844, -0.7962523698806763, 1.0980337858200073, 0.1781499981880188, -0.8541395664215088, 1.2404165267944336, -0.3485892713069916, -1.8736815452575684, 1.157070517539978, -2.1396076679229736 ]
https://github.com/huggingface/datasets/issues/3688
Pyarrow version error
hi @albertvillanova i try yesterday to create a new python environement with python 7 and try it on the environement and it worked. so i think that the error was not the package but may be jupyter notebook on conda. still yet i'm not yet sure but it worked in an environment created with venv
## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0
963
55
Pyarrow version error ## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0 hi @albertvillanova i try yesterday to create a new python environement with python 7 and try it on the environement and it worked. so i think that the error was not the package but may be jupyter notebook on conda. still yet i'm not yet sure but it worked in an environment created with venv
[ -1.2849866151809692, -0.9149413108825684, -0.6520612835884094, 1.4287223815917969, -0.15140192210674286, -1.336443305015564, 0.15659460425376892, -1.038428783416748, 1.7254475355148315, -0.7810778617858887, 0.28039824962615967, -1.6592779159545898, 0.12056879699230194, -0.583744466304779, -0.7101070880889893, -0.8417413234710693, -0.4109680652618408, -0.7519049048423767, 1.100322961807251, 2.5161221027374268, 1.3508384227752686, -1.4286776781082153, 2.7619221210479736, 0.7500436305999756, -0.19689033925533295, -0.9616190791130066, 0.5273226499557495, -0.024637825787067413, -1.297046184539795, -0.5076597332954407, -0.8468593955039978, 0.018412210047245026, -0.6089756488800049, -0.5422490835189819, -0.12062989175319672, 0.4109586477279663, -0.31221726536750793, -0.4820346534252167, -0.5788653492927551, -0.7826820015907288, 0.41934463381767273, -0.45471325516700745, 0.9845448732376099, -0.3312806189060211, 1.7263925075531006, -0.5672324895858765, 0.46298372745513916, 0.8282036781311035, 1.2971720695495605, 0.14349275827407837, 0.014581040479242802, 0.3283522427082062, 0.3110063374042511, 0.01869935169816017, 0.5790520310401917, 1.0712722539901733, 0.7348955869674683, 0.3965741693973541, 0.6762566566467285, -2.1508431434631348, 1.358651041984558, -0.9424354434013367, 0.1478445827960968, 1.249419927597046, -0.9344937205314636, 0.3423019349575043, -1.694238543510437, -0.08643242716789246, 0.618334174156189, -2.197125196456909, 0.18054382503032684, -1.2975037097930908, -0.4361856281757355, 0.9988667964935303, 0.2916649878025055, -1.135125994682312, 0.05493094027042389, -0.4817667305469513, 1.0195392370224, 0.4014350473880768, 1.0903754234313965, -1.6463420391082764, 0.01839027926325798, -0.3209296762943268, 0.2222074419260025, -1.2957535982131958, -1.5598225593566895, 0.6003091335296631, 0.5975789427757263, 0.6346451640129089, 0.008409555070102215, 1.0642935037612915, -1.0092140436172485, 0.7217668294906616, -1.0261428356170654, -1.8027327060699463, -1.3966023921966553, -2.33406662940979, -2.2746670246124268, 0.6646580100059509, -0.5214690566062927, -0.5089320540428162, 2.1128721237182617, -1.0910022258758545, -1.718824863433838, 1.0787749290466309, 0.2026243507862091, 0.025519929826259613, 2.4382715225219727, 0.19642747938632965, -0.8119199275970459, 0.531305193901062, -0.7538176774978638, 0.764889657497406, -0.3034808337688446, 1.267113208770752, 0.34317320585250854, -1.0341598987579346, 1.512284278869629, -0.39387595653533936, 0.7147988677024841, -0.643408477306366, -0.3791542947292328, -0.7190046310424805, 0.25216957926750183, 1.7889626026153564, -0.31355196237564087, 1.5474954843521118, -0.3321382999420166, -1.4629753828048706, -1.5565189123153687, 0.7908610701560974, 0.3657724857330322, -0.7041740417480469, 0.11334747076034546, -0.42444929480552673, 0.13593274354934692, -0.09647159278392792, 1.1520744562149048, 1.3254531621932983, 0.6607458591461182, -0.3321564495563507, -0.927883505821228, 0.19578124582767487, -0.06975602358579636, -0.6854512095451355, -1.7731044292449951, -0.2688269317150116, 0.051127828657627106, 0.7417152523994446, -1.169467806816101, 1.8045064210891724, 0.987139880657196, 1.905346393585205, 1.0919376611709595, -0.288542777299881, 1.4334243535995483, 0.1273954063653946, 1.8224890232086182, -0.5050301551818848, 0.6820957660675049, -0.3991326689720154, -1.109300971031189, 0.8558771014213562, -0.313512921333313, -2.013559579849243, -0.6899538040161133, -0.6129435896873474, -0.14059016108512878, -0.775343120098114, 0.9992866516113281, -0.2940378487110138, -1.3451542854309082, 0.24639758467674255, -0.7513401508331299, 0.03050638735294342, -1.286760926246643, 0.2595410943031311, 0.6889548897743225, -0.5760634541511536, 0.15848875045776367, -0.3055790364742279, -1.2953331470489502, -0.471791535615921, 0.3279346227645874, 1.8419665098190308, -0.705920398235321, 0.9439666271209717, 1.0724390745162964, -0.651322066783905, 0.05990971624851227, 0.32492759823799133, -0.3003985583782196, 0.8256988525390625, -1.0286234617233276, -0.4601488411426544, 1.2141536474227905, -0.3141458332538605, -0.6302441358566284, 1.557477355003357, 0.7002227902412415, -1.0613887310028076, -0.2163105010986328, -0.10445701330900192, -0.9185823202133179, 0.09356872737407684, -1.5606272220611572, -0.1086038276553154, 0.4724581241607666, -1.6533921957015991, -0.4498791992664337, -0.17536340653896332, 1.3355450630187988, -0.09411762654781342, 1.4857293367385864, -0.36318647861480713, -0.046810638159513474, -0.2783185839653015, -0.41547757387161255, 0.09861715137958527, -0.13871100544929504, -0.5927207469940186, 0.1450340896844864, -0.8269990086555481, 0.35581910610198975, 1.448455572128296, 0.2766733169555664, -0.04935107007622719, 0.393324077129364, 1.0833852291107178, 0.3124798536300659, -0.07396765053272247, -0.7630755305290222, -1.4545297622680664, 2.032024621963501, -1.4664113521575928, 2.0518720149993896, 0.8274086117744446, -0.1347954422235489, -1.7190425395965576, -1.8374189138412476, 1.4132519960403442, 1.115943193435669, 2.248384475708008, 0.5533167123794556, 0.3226372301578522, -0.814824104309082, -0.616985559463501, 0.3430599272251129, -1.0092952251434326, -0.731816291809082, 0.1821814924478531, 2.407402515411377, 1.769393801689148, -0.39024412631988525, -0.12370071560144424, -0.9468482732772827, 1.399921178817749, -0.19662721455097198, 0.277634859085083, 2.0123116970062256, -0.33153027296066284, -0.9807419180870056, 1.312696099281311, -2.346083641052246, 0.1848655343055725, 2.047109365463257, 0.21924984455108643, 0.1278396099805832, -1.3943582773208618, -0.6411377787590027, -0.438289999961853, -0.3735346496105194, -1.2772971391677856, 0.5544124841690063, -0.26542922854423523, -0.8320977687835693, -1.469455361366272, 0.1988712102174759, -1.0861390829086304, -1.8103471994400024, 0.31837165355682373, 1.85545015335083, 2.100219249725342, -0.7429919242858887, 1.582772135734558, -0.37689831852912903, 0.16752582788467407, 1.1363919973373413, 1.2117860317230225, 3.1669845581054688, 1.9623197317123413, -1.2039847373962402, 0.6366387605667114, -0.14453816413879395, -0.5040633082389832, 1.2034316062927246, -1.235921025276184, 1.2847466468811035, -0.15609772503376007, -1.1504472494125366, -1.2777444124221802, 0.9140022993087769, 0.4340340793132782, -0.046892017126083374, -0.4570368826389313, 1.3049958944320679, 0.11682118475437164, 1.3574672937393188, 0.4563949406147003, -0.232184499502182, 0.6710363626480103, -0.4598361849784851, -0.5034161806106567, 1.4423714876174927, 0.1322137415409088, -1.5154170989990234, -2.215456008911133, -0.24367935955524445, -0.7848129272460938, 0.07987247407436371, -0.69536292552948, -0.9836483597755432, 1.6977201700210571, 0.33576256036758423, -1.1264142990112305, -0.28595125675201416, -0.443164587020874, -0.4970155358314514, 2.7387173175811768, -1.304856777191162, -0.22582824528217316, -0.9888152480125427, -0.6045606732368469, 1.5678187608718872, -1.1845093965530396, -0.17663860321044922, -1.0884851217269897, -0.5741523504257202, -1.2576532363891602, -0.5161184072494507, -0.08810947090387344, -0.9675719738006592, 0.8633095622062683, 0.313723623752594, -1.2154031991958618, -0.2998085916042328, -0.9265316128730774, 0.8558915853500366, -0.16369187831878662, 0.281684011220932, 1.8277641534805298, 0.3832930028438568, -0.4435763955116272, 0.8162981271743774, 1.1306791305541992, 0.5802851915359497, -0.6407120823860168, 0.042369257658720016, -0.6524136662483215, 0.4885573983192444, -1.1877046823501587, 0.2436504364013672, -2.8262133598327637, 0.6057960987091064, -0.05334068089723587, 0.01716657727956772, -0.14203040301799774, -1.2651147842407227, 1.0846459865570068, 2.6458988189697266, -1.173386812210083, 0.5348307490348816, 0.3667135536670685, 1.1834721565246582, -1.5360286235809326, 0.331904798746109, -0.4436837136745453, 2.078521728515625, 0.17456352710723877, 1.206263780593872, -0.48369720578193665, -2.4505345821380615, 0.7896559834480286, -1.1954642534255981, -1.246976613998413, 0.8432357311248779, -0.9351076483726501, 0.06359944492578506, -1.416090726852417, -0.1670415997505188, -0.9264650344848633, -1.1638916730880737, 0.6546210646629333, 0.1656045913696289, 0.49627137184143066, -0.6962332725524902, 0.27679309248924255, -2.1946582794189453, -1.3317921161651611, -0.3210712969303131, -0.9656928181648254, 0.5251664519309998, -0.47947174310684204, 0.5900293588638306, -0.15752695500850677, -0.03623552247881889, 0.3710375130176544, 1.4307571649551392, 3.4222350120544434, 0.10355674475431442, 0.283189058303833, -0.22946873307228088, -0.9622194766998291, 1.4400436878204346, 0.8916636109352112, -0.20046356320381165, -0.483379065990448, -1.0375882387161255, 1.2364732027053833, 1.9467836618423462, 0.9153432846069336, -0.0033118706196546555, -0.8860894441604614, -0.7489058375358582, -0.04690694808959961, 0.17956219613552094, 0.49551498889923096, 0.9228600859642029, 0.06152860075235367, 0.08351809531450272, 1.5451267957687378, 1.115768551826477, -0.3900894522666931, 0.302762508392334, -0.8658192753791809, -0.40001919865608215, 0.6104919910430908, 0.2617111802101135, -0.0573350265622139, 0.34903839230537415, -0.9127021431922913, -0.2873629927635193, -0.33833858370780945, -0.8253154158592224, -0.7375534176826477, -0.37715834379196167, -0.2829859256744385, 1.6939483880996704, 0.04279020056128502, -0.5033288598060608, -0.052591994404792786, -0.7184389233589172, -0.13688674569129944, -1.014640212059021, 0.31980276107788086, -0.25720933079719543, -0.04854939877986908, -0.2094975709915161, 1.6780155897140503, -0.9264678359031677, -2.01780104637146, 0.24976614117622375, 0.26057833433151245, -0.22397170960903168, 0.2562524080276489, 1.6663711071014404, 0.6681368947029114, 1.4184437990188599, 1.3914210796356201, 0.9458407163619995, -0.7289214730262756, -1.3104389905929565, 0.6704680919647217, 1.0079874992370605, -1.350798487663269, 0.8804379105567932, -0.03703545033931732, -0.6095227599143982, 0.6236991882324219, 1.3398394584655762, 0.5455866456031799, -2.0271856784820557, 0.8049734234809875, -0.986422061920166, 0.9560725688934326, 0.7130386233329773, 0.761722207069397, 0.1773964762687683, 0.7723459005355835, -1.1313472986221313, -1.150883674621582, -0.6821289658546448, -0.7161511182785034, 1.886679768562317, -0.3676747679710388, 0.6116753220558167, -0.19180002808570862, -1.3133299350738525, -0.08811958879232407, 0.6872145533561707, 0.4263356328010559, -0.4434301555156708, 0.8043658137321472, -0.6673190593719482, -1.0888437032699585, -1.2806774377822876, -0.4073058068752289, -1.0098958015441895, -1.0017518997192383, 0.9923275709152222, 0.6624225974082947, 0.3457663059234619, 1.847436785697937, 0.6548072099685669, 0.18996787071228027, -2.514601707458496, 0.9456784725189209, 0.3094276189804077, -0.1298447549343109, 0.8529065251350403, 0.3694537878036499, 0.9420865178108215, 0.011595162563025951, 0.5425461530685425, -2.4442059993743896, 2.292055368423462, -0.2579399645328522, 0.6764395833015442, 0.052643321454524994, -0.23595158755779266, 1.014526128768921, 0.6519304513931274, 0.4832994341850281, -0.9911680817604065, 0.8004351854324341, -0.5374329686164856, 1.3101907968521118, 0.9359338879585266, -0.7894895672798157, -0.03670734539628029, 1.242396354675293, 0.44628098607063293, -0.5359063744544983, -0.9512262940406799, -1.041919231414795, 0.9088340401649475, 1.8688305616378784, -0.0692402794957161, -0.09682507067918777, 0.7656225562095642, 0.6957230567932129, -1.1120831966400146, -0.008952334523200989, -0.7534897923469543, -0.7961651682853699, 1.6700366735458374, 2.070341110229492, -0.10347093641757965, -0.20064863562583923, -0.7042695879936218, -1.210325002670288, 0.8266779780387878, -0.03320522978901863, -0.012258310802280903, 0.6019163727760315, -0.602770984172821, 1.1147661209106445, 0.8368013501167297, 0.9512678384780884, 0.13509170711040497, 0.26318487524986267, 0.3829408288002014, -0.3093143701553345, -1.1835256814956665, -0.28067031502723694, -1.1103771924972534, -2.4840478897094727, 0.30790793895721436, -0.25769099593162537, -1.5491582155227661, -0.028989102691411972, -1.0498936176300049, 0.914583683013916, -0.5055781006813049, -1.138039231300354, -1.5049134492874146, 0.08792182058095932, -0.03500720113515854, 0.8937428593635559, -1.5099434852600098, -0.10947884619235992, 1.3062465190887451, 0.8878752589225769, -0.6197025775909424, 1.0717852115631104, 0.2823820412158966, 1.0492281913757324, 0.827638566493988, -0.36922886967658997, 0.5894542932510376, 0.09729241579771042, -1.295216679573059, 0.4205060601234436, 1.220073938369751, 0.1944097876548767, 1.5432157516479492, -0.5092639923095703, 0.005689850077033043, 0.32538989186286926, -0.5274744629859924, -0.45749184489250183, -0.5385995507240295, 0.7383257150650024, -0.04410570114850998, -0.84471595287323, -0.05622316896915436, -0.19669564068317413, -0.26228734850883484, 0.14925053715705872, -1.5652798414230347, -0.12776747345924377, -0.4566711485385895, -0.5981088280677795, -1.3490623235702515, -0.0033706510439515114, 1.5257011651992798, -0.724937379360199, -0.20639990270137787, 0.3955974578857422, 0.36416274309158325, 0.48327481746673584, 0.6433703303337097, -0.7519021034240723, -0.4403972625732422, -0.3417654037475586, -0.35329940915107727, 0.33390504121780396, 1.2758816480636597, -0.017595697194337845, -1.0693165063858032, 0.6617228388786316, -0.5006529688835144, 0.06118229031562805, 1.903552532196045, 0.09851913899183273, -0.7300445437431335, 0.38548964262008667, -0.7225058674812317, 1.8924912214279175, 1.7027814388275146, 1.3122519254684448, -0.1901031732559204, -1.0071957111358643, 0.6812204718589783, -0.4139452278614044, -0.4373570382595062, 0.8416814208030701, 0.38982486724853516, -0.2586171627044678, -1.3918994665145874, 0.7246200442314148, 1.222347378730774, -0.7975094318389893, -0.8440015316009521, 0.10815773904323578, -0.7953514456748962, 1.1845978498458862, 0.6657221913337708, 0.37380626797676086, 0.2713179886341095, 1.7005006074905396, 0.7464199662208557, -0.5212810635566711, 0.5122714042663574, 0.499717116355896, -0.2560586631298065, -2.0504226684570312, -1.108534336090088, 0.2920367121696472, -0.49608007073402405, -1.583476185798645, 1.4435486793518066, -1.2316416501998901, -0.9534938931465149, 0.5305323600769043, -0.016136253252625465, 1.348729133605957, 0.3503579795360565, 1.5079269409179688, 2.1101794242858887, 0.8219298124313354, 0.4341433644294739, 1.2139739990234375, -0.2958601117134094, -0.5195697546005249, 1.856040596961975, -0.44944024085998535, 0.5300709009170532, 1.1437606811523438, -0.374632328748703, -1.0460901260375977, -0.8125361800193787, -1.2432529926300049, -0.7390210628509521, 1.197270154953003, 0.028711818158626556, -1.173804759979248, 0.3540841042995453, 1.5460617542266846, 0.199159175157547, -0.3823843002319336, 0.5755521655082703, 0.4480052590370178, -0.7980490922927856, -0.16839846968650818, -0.9055758118629456, 0.5429608821868896, -0.2988499104976654, -0.35811853408813477, 0.3004651963710785, 0.4961977005004883, 1.3614223003387451, -0.09678111970424652, 0.12064228951931, 1.1782320737838745, -1.3399395942687988, 1.4840644598007202, -0.68660569190979, 0.23031508922576904, -2.297746419906616, 1.3595459461212158, -0.7904897332191467, 2.0107831954956055, -2.6836438179016113, 0.4185886085033417, -0.4544387459754944, -0.3985161781311035, 0.22943826019763947, -0.3033153712749481, 0.14668135344982147, -0.1298401802778244, -1.1028757095336914, -0.012232081964612007, -0.59222012758255, 0.6655833125114441, 1.130128026008606, 1.37709379196167, -1.1234323978424072, -0.18225301802158356, -1.670862078666687, -0.16547100245952606, -0.8195047974586487, 0.3089715540409088, -1.9590141773223877, -0.2733492851257324, -2.0420336723327637, -2.441149950027466, -1.2763023376464844, -0.7962523698806763, 1.0980337858200073, 0.1781499981880188, -0.8541395664215088, 1.2404165267944336, -0.3485892713069916, -1.8736815452575684, 1.157070517539978, -2.1396076679229736 ]
https://github.com/huggingface/datasets/issues/3688
Pyarrow version error
OK, thanks @Zaker237 for your feedback. I close this issue then. Please, feel free to reopen it if the problem arises again.
## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0
963
22
Pyarrow version error ## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0 OK, thanks @Zaker237 for your feedback. I close this issue then. Please, feel free to reopen it if the problem arises again.
[ -1.2849866151809692, -0.9149413108825684, -0.6520612835884094, 1.4287223815917969, -0.15140192210674286, -1.336443305015564, 0.15659460425376892, -1.038428783416748, 1.7254475355148315, -0.7810778617858887, 0.28039824962615967, -1.6592779159545898, 0.12056879699230194, -0.583744466304779, -0.7101070880889893, -0.8417413234710693, -0.4109680652618408, -0.7519049048423767, 1.100322961807251, 2.5161221027374268, 1.3508384227752686, -1.4286776781082153, 2.7619221210479736, 0.7500436305999756, -0.19689033925533295, -0.9616190791130066, 0.5273226499557495, -0.024637825787067413, -1.297046184539795, -0.5076597332954407, -0.8468593955039978, 0.018412210047245026, -0.6089756488800049, -0.5422490835189819, -0.12062989175319672, 0.4109586477279663, -0.31221726536750793, -0.4820346534252167, -0.5788653492927551, -0.7826820015907288, 0.41934463381767273, -0.45471325516700745, 0.9845448732376099, -0.3312806189060211, 1.7263925075531006, -0.5672324895858765, 0.46298372745513916, 0.8282036781311035, 1.2971720695495605, 0.14349275827407837, 0.014581040479242802, 0.3283522427082062, 0.3110063374042511, 0.01869935169816017, 0.5790520310401917, 1.0712722539901733, 0.7348955869674683, 0.3965741693973541, 0.6762566566467285, -2.1508431434631348, 1.358651041984558, -0.9424354434013367, 0.1478445827960968, 1.249419927597046, -0.9344937205314636, 0.3423019349575043, -1.694238543510437, -0.08643242716789246, 0.618334174156189, -2.197125196456909, 0.18054382503032684, -1.2975037097930908, -0.4361856281757355, 0.9988667964935303, 0.2916649878025055, -1.135125994682312, 0.05493094027042389, -0.4817667305469513, 1.0195392370224, 0.4014350473880768, 1.0903754234313965, -1.6463420391082764, 0.01839027926325798, -0.3209296762943268, 0.2222074419260025, -1.2957535982131958, -1.5598225593566895, 0.6003091335296631, 0.5975789427757263, 0.6346451640129089, 0.008409555070102215, 1.0642935037612915, -1.0092140436172485, 0.7217668294906616, -1.0261428356170654, -1.8027327060699463, -1.3966023921966553, -2.33406662940979, -2.2746670246124268, 0.6646580100059509, -0.5214690566062927, -0.5089320540428162, 2.1128721237182617, -1.0910022258758545, -1.718824863433838, 1.0787749290466309, 0.2026243507862091, 0.025519929826259613, 2.4382715225219727, 0.19642747938632965, -0.8119199275970459, 0.531305193901062, -0.7538176774978638, 0.764889657497406, -0.3034808337688446, 1.267113208770752, 0.34317320585250854, -1.0341598987579346, 1.512284278869629, -0.39387595653533936, 0.7147988677024841, -0.643408477306366, -0.3791542947292328, -0.7190046310424805, 0.25216957926750183, 1.7889626026153564, -0.31355196237564087, 1.5474954843521118, -0.3321382999420166, -1.4629753828048706, -1.5565189123153687, 0.7908610701560974, 0.3657724857330322, -0.7041740417480469, 0.11334747076034546, -0.42444929480552673, 0.13593274354934692, -0.09647159278392792, 1.1520744562149048, 1.3254531621932983, 0.6607458591461182, -0.3321564495563507, -0.927883505821228, 0.19578124582767487, -0.06975602358579636, -0.6854512095451355, -1.7731044292449951, -0.2688269317150116, 0.051127828657627106, 0.7417152523994446, -1.169467806816101, 1.8045064210891724, 0.987139880657196, 1.905346393585205, 1.0919376611709595, -0.288542777299881, 1.4334243535995483, 0.1273954063653946, 1.8224890232086182, -0.5050301551818848, 0.6820957660675049, -0.3991326689720154, -1.109300971031189, 0.8558771014213562, -0.313512921333313, -2.013559579849243, -0.6899538040161133, -0.6129435896873474, -0.14059016108512878, -0.775343120098114, 0.9992866516113281, -0.2940378487110138, -1.3451542854309082, 0.24639758467674255, -0.7513401508331299, 0.03050638735294342, -1.286760926246643, 0.2595410943031311, 0.6889548897743225, -0.5760634541511536, 0.15848875045776367, -0.3055790364742279, -1.2953331470489502, -0.471791535615921, 0.3279346227645874, 1.8419665098190308, -0.705920398235321, 0.9439666271209717, 1.0724390745162964, -0.651322066783905, 0.05990971624851227, 0.32492759823799133, -0.3003985583782196, 0.8256988525390625, -1.0286234617233276, -0.4601488411426544, 1.2141536474227905, -0.3141458332538605, -0.6302441358566284, 1.557477355003357, 0.7002227902412415, -1.0613887310028076, -0.2163105010986328, -0.10445701330900192, -0.9185823202133179, 0.09356872737407684, -1.5606272220611572, -0.1086038276553154, 0.4724581241607666, -1.6533921957015991, -0.4498791992664337, -0.17536340653896332, 1.3355450630187988, -0.09411762654781342, 1.4857293367385864, -0.36318647861480713, -0.046810638159513474, -0.2783185839653015, -0.41547757387161255, 0.09861715137958527, -0.13871100544929504, -0.5927207469940186, 0.1450340896844864, -0.8269990086555481, 0.35581910610198975, 1.448455572128296, 0.2766733169555664, -0.04935107007622719, 0.393324077129364, 1.0833852291107178, 0.3124798536300659, -0.07396765053272247, -0.7630755305290222, -1.4545297622680664, 2.032024621963501, -1.4664113521575928, 2.0518720149993896, 0.8274086117744446, -0.1347954422235489, -1.7190425395965576, -1.8374189138412476, 1.4132519960403442, 1.115943193435669, 2.248384475708008, 0.5533167123794556, 0.3226372301578522, -0.814824104309082, -0.616985559463501, 0.3430599272251129, -1.0092952251434326, -0.731816291809082, 0.1821814924478531, 2.407402515411377, 1.769393801689148, -0.39024412631988525, -0.12370071560144424, -0.9468482732772827, 1.399921178817749, -0.19662721455097198, 0.277634859085083, 2.0123116970062256, -0.33153027296066284, -0.9807419180870056, 1.312696099281311, -2.346083641052246, 0.1848655343055725, 2.047109365463257, 0.21924984455108643, 0.1278396099805832, -1.3943582773208618, -0.6411377787590027, -0.438289999961853, -0.3735346496105194, -1.2772971391677856, 0.5544124841690063, -0.26542922854423523, -0.8320977687835693, -1.469455361366272, 0.1988712102174759, -1.0861390829086304, -1.8103471994400024, 0.31837165355682373, 1.85545015335083, 2.100219249725342, -0.7429919242858887, 1.582772135734558, -0.37689831852912903, 0.16752582788467407, 1.1363919973373413, 1.2117860317230225, 3.1669845581054688, 1.9623197317123413, -1.2039847373962402, 0.6366387605667114, -0.14453816413879395, -0.5040633082389832, 1.2034316062927246, -1.235921025276184, 1.2847466468811035, -0.15609772503376007, -1.1504472494125366, -1.2777444124221802, 0.9140022993087769, 0.4340340793132782, -0.046892017126083374, -0.4570368826389313, 1.3049958944320679, 0.11682118475437164, 1.3574672937393188, 0.4563949406147003, -0.232184499502182, 0.6710363626480103, -0.4598361849784851, -0.5034161806106567, 1.4423714876174927, 0.1322137415409088, -1.5154170989990234, -2.215456008911133, -0.24367935955524445, -0.7848129272460938, 0.07987247407436371, -0.69536292552948, -0.9836483597755432, 1.6977201700210571, 0.33576256036758423, -1.1264142990112305, -0.28595125675201416, -0.443164587020874, -0.4970155358314514, 2.7387173175811768, -1.304856777191162, -0.22582824528217316, -0.9888152480125427, -0.6045606732368469, 1.5678187608718872, -1.1845093965530396, -0.17663860321044922, -1.0884851217269897, -0.5741523504257202, -1.2576532363891602, -0.5161184072494507, -0.08810947090387344, -0.9675719738006592, 0.8633095622062683, 0.313723623752594, -1.2154031991958618, -0.2998085916042328, -0.9265316128730774, 0.8558915853500366, -0.16369187831878662, 0.281684011220932, 1.8277641534805298, 0.3832930028438568, -0.4435763955116272, 0.8162981271743774, 1.1306791305541992, 0.5802851915359497, -0.6407120823860168, 0.042369257658720016, -0.6524136662483215, 0.4885573983192444, -1.1877046823501587, 0.2436504364013672, -2.8262133598327637, 0.6057960987091064, -0.05334068089723587, 0.01716657727956772, -0.14203040301799774, -1.2651147842407227, 1.0846459865570068, 2.6458988189697266, -1.173386812210083, 0.5348307490348816, 0.3667135536670685, 1.1834721565246582, -1.5360286235809326, 0.331904798746109, -0.4436837136745453, 2.078521728515625, 0.17456352710723877, 1.206263780593872, -0.48369720578193665, -2.4505345821380615, 0.7896559834480286, -1.1954642534255981, -1.246976613998413, 0.8432357311248779, -0.9351076483726501, 0.06359944492578506, -1.416090726852417, -0.1670415997505188, -0.9264650344848633, -1.1638916730880737, 0.6546210646629333, 0.1656045913696289, 0.49627137184143066, -0.6962332725524902, 0.27679309248924255, -2.1946582794189453, -1.3317921161651611, -0.3210712969303131, -0.9656928181648254, 0.5251664519309998, -0.47947174310684204, 0.5900293588638306, -0.15752695500850677, -0.03623552247881889, 0.3710375130176544, 1.4307571649551392, 3.4222350120544434, 0.10355674475431442, 0.283189058303833, -0.22946873307228088, -0.9622194766998291, 1.4400436878204346, 0.8916636109352112, -0.20046356320381165, -0.483379065990448, -1.0375882387161255, 1.2364732027053833, 1.9467836618423462, 0.9153432846069336, -0.0033118706196546555, -0.8860894441604614, -0.7489058375358582, -0.04690694808959961, 0.17956219613552094, 0.49551498889923096, 0.9228600859642029, 0.06152860075235367, 0.08351809531450272, 1.5451267957687378, 1.115768551826477, -0.3900894522666931, 0.302762508392334, -0.8658192753791809, -0.40001919865608215, 0.6104919910430908, 0.2617111802101135, -0.0573350265622139, 0.34903839230537415, -0.9127021431922913, -0.2873629927635193, -0.33833858370780945, -0.8253154158592224, -0.7375534176826477, -0.37715834379196167, -0.2829859256744385, 1.6939483880996704, 0.04279020056128502, -0.5033288598060608, -0.052591994404792786, -0.7184389233589172, -0.13688674569129944, -1.014640212059021, 0.31980276107788086, -0.25720933079719543, -0.04854939877986908, -0.2094975709915161, 1.6780155897140503, -0.9264678359031677, -2.01780104637146, 0.24976614117622375, 0.26057833433151245, -0.22397170960903168, 0.2562524080276489, 1.6663711071014404, 0.6681368947029114, 1.4184437990188599, 1.3914210796356201, 0.9458407163619995, -0.7289214730262756, -1.3104389905929565, 0.6704680919647217, 1.0079874992370605, -1.350798487663269, 0.8804379105567932, -0.03703545033931732, -0.6095227599143982, 0.6236991882324219, 1.3398394584655762, 0.5455866456031799, -2.0271856784820557, 0.8049734234809875, -0.986422061920166, 0.9560725688934326, 0.7130386233329773, 0.761722207069397, 0.1773964762687683, 0.7723459005355835, -1.1313472986221313, -1.150883674621582, -0.6821289658546448, -0.7161511182785034, 1.886679768562317, -0.3676747679710388, 0.6116753220558167, -0.19180002808570862, -1.3133299350738525, -0.08811958879232407, 0.6872145533561707, 0.4263356328010559, -0.4434301555156708, 0.8043658137321472, -0.6673190593719482, -1.0888437032699585, -1.2806774377822876, -0.4073058068752289, -1.0098958015441895, -1.0017518997192383, 0.9923275709152222, 0.6624225974082947, 0.3457663059234619, 1.847436785697937, 0.6548072099685669, 0.18996787071228027, -2.514601707458496, 0.9456784725189209, 0.3094276189804077, -0.1298447549343109, 0.8529065251350403, 0.3694537878036499, 0.9420865178108215, 0.011595162563025951, 0.5425461530685425, -2.4442059993743896, 2.292055368423462, -0.2579399645328522, 0.6764395833015442, 0.052643321454524994, -0.23595158755779266, 1.014526128768921, 0.6519304513931274, 0.4832994341850281, -0.9911680817604065, 0.8004351854324341, -0.5374329686164856, 1.3101907968521118, 0.9359338879585266, -0.7894895672798157, -0.03670734539628029, 1.242396354675293, 0.44628098607063293, -0.5359063744544983, -0.9512262940406799, -1.041919231414795, 0.9088340401649475, 1.8688305616378784, -0.0692402794957161, -0.09682507067918777, 0.7656225562095642, 0.6957230567932129, -1.1120831966400146, -0.008952334523200989, -0.7534897923469543, -0.7961651682853699, 1.6700366735458374, 2.070341110229492, -0.10347093641757965, -0.20064863562583923, -0.7042695879936218, -1.210325002670288, 0.8266779780387878, -0.03320522978901863, -0.012258310802280903, 0.6019163727760315, -0.602770984172821, 1.1147661209106445, 0.8368013501167297, 0.9512678384780884, 0.13509170711040497, 0.26318487524986267, 0.3829408288002014, -0.3093143701553345, -1.1835256814956665, -0.28067031502723694, -1.1103771924972534, -2.4840478897094727, 0.30790793895721436, -0.25769099593162537, -1.5491582155227661, -0.028989102691411972, -1.0498936176300049, 0.914583683013916, -0.5055781006813049, -1.138039231300354, -1.5049134492874146, 0.08792182058095932, -0.03500720113515854, 0.8937428593635559, -1.5099434852600098, -0.10947884619235992, 1.3062465190887451, 0.8878752589225769, -0.6197025775909424, 1.0717852115631104, 0.2823820412158966, 1.0492281913757324, 0.827638566493988, -0.36922886967658997, 0.5894542932510376, 0.09729241579771042, -1.295216679573059, 0.4205060601234436, 1.220073938369751, 0.1944097876548767, 1.5432157516479492, -0.5092639923095703, 0.005689850077033043, 0.32538989186286926, -0.5274744629859924, -0.45749184489250183, -0.5385995507240295, 0.7383257150650024, -0.04410570114850998, -0.84471595287323, -0.05622316896915436, -0.19669564068317413, -0.26228734850883484, 0.14925053715705872, -1.5652798414230347, -0.12776747345924377, -0.4566711485385895, -0.5981088280677795, -1.3490623235702515, -0.0033706510439515114, 1.5257011651992798, -0.724937379360199, -0.20639990270137787, 0.3955974578857422, 0.36416274309158325, 0.48327481746673584, 0.6433703303337097, -0.7519021034240723, -0.4403972625732422, -0.3417654037475586, -0.35329940915107727, 0.33390504121780396, 1.2758816480636597, -0.017595697194337845, -1.0693165063858032, 0.6617228388786316, -0.5006529688835144, 0.06118229031562805, 1.903552532196045, 0.09851913899183273, -0.7300445437431335, 0.38548964262008667, -0.7225058674812317, 1.8924912214279175, 1.7027814388275146, 1.3122519254684448, -0.1901031732559204, -1.0071957111358643, 0.6812204718589783, -0.4139452278614044, -0.4373570382595062, 0.8416814208030701, 0.38982486724853516, -0.2586171627044678, -1.3918994665145874, 0.7246200442314148, 1.222347378730774, -0.7975094318389893, -0.8440015316009521, 0.10815773904323578, -0.7953514456748962, 1.1845978498458862, 0.6657221913337708, 0.37380626797676086, 0.2713179886341095, 1.7005006074905396, 0.7464199662208557, -0.5212810635566711, 0.5122714042663574, 0.499717116355896, -0.2560586631298065, -2.0504226684570312, -1.108534336090088, 0.2920367121696472, -0.49608007073402405, -1.583476185798645, 1.4435486793518066, -1.2316416501998901, -0.9534938931465149, 0.5305323600769043, -0.016136253252625465, 1.348729133605957, 0.3503579795360565, 1.5079269409179688, 2.1101794242858887, 0.8219298124313354, 0.4341433644294739, 1.2139739990234375, -0.2958601117134094, -0.5195697546005249, 1.856040596961975, -0.44944024085998535, 0.5300709009170532, 1.1437606811523438, -0.374632328748703, -1.0460901260375977, -0.8125361800193787, -1.2432529926300049, -0.7390210628509521, 1.197270154953003, 0.028711818158626556, -1.173804759979248, 0.3540841042995453, 1.5460617542266846, 0.199159175157547, -0.3823843002319336, 0.5755521655082703, 0.4480052590370178, -0.7980490922927856, -0.16839846968650818, -0.9055758118629456, 0.5429608821868896, -0.2988499104976654, -0.35811853408813477, 0.3004651963710785, 0.4961977005004883, 1.3614223003387451, -0.09678111970424652, 0.12064228951931, 1.1782320737838745, -1.3399395942687988, 1.4840644598007202, -0.68660569190979, 0.23031508922576904, -2.297746419906616, 1.3595459461212158, -0.7904897332191467, 2.0107831954956055, -2.6836438179016113, 0.4185886085033417, -0.4544387459754944, -0.3985161781311035, 0.22943826019763947, -0.3033153712749481, 0.14668135344982147, -0.1298401802778244, -1.1028757095336914, -0.012232081964612007, -0.59222012758255, 0.6655833125114441, 1.130128026008606, 1.37709379196167, -1.1234323978424072, -0.18225301802158356, -1.670862078666687, -0.16547100245952606, -0.8195047974586487, 0.3089715540409088, -1.9590141773223877, -0.2733492851257324, -2.0420336723327637, -2.441149950027466, -1.2763023376464844, -0.7962523698806763, 1.0980337858200073, 0.1781499981880188, -0.8541395664215088, 1.2404165267944336, -0.3485892713069916, -1.8736815452575684, 1.157070517539978, -2.1396076679229736 ]
https://github.com/huggingface/datasets/issues/3687
Can't get the text data when calling to_tf_dataset
You are correct that `to_tf_dataset` only handles numerical columns right now, yes, though this is a limitation we might remove in future! The main reason we do this is that our models mostly do not include the tokenizer as a model layer, because it's very difficult to compile some of them in TF. So the "normal" Huggingface workflow is to first tokenize your dataset, and then pass tokenized tensors to the model. For your use case, would you prefer to pass strings to the model, and use some text processing layers instead of the built-in tokenizers?
I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded?
964
96
Can't get the text data when calling to_tf_dataset I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded? You are correct that `to_tf_dataset` only handles numerical columns right now, yes, though this is a limitation we might remove in future! The main reason we do this is that our models mostly do not include the tokenizer as a model layer, because it's very difficult to compile some of them in TF. So the "normal" Huggingface workflow is to first tokenize your dataset, and then pass tokenized tensors to the model. For your use case, would you prefer to pass strings to the model, and use some text processing layers instead of the built-in tokenizers?
[ -1.2407846450805664, -0.911194920539856, -0.7502970099449158, 1.4378316402435303, -0.19253002107143402, -1.2492157220840454, 0.18979981541633606, -1.0651826858520508, 1.7046186923980713, -0.7588399052619934, 0.2690124213695526, -1.632290005683899, 0.0295279398560524, -0.5651085376739502, -0.7286174893379211, -0.8919707536697388, -0.4119968116283417, -0.7072266340255737, 1.0126045942306519, 2.4781553745269775, 1.1866636276245117, -1.381150484085083, 2.7177672386169434, 0.6939176917076111, -0.13495546579360962, -1.0498650074005127, 0.5055744647979736, 0.08669982105493546, -1.2826287746429443, -0.49596282839775085, -0.909310519695282, -0.06160896271467209, -0.5800577998161316, -0.6247358918190002, -0.01669686660170555, 0.45332247018814087, -0.27559274435043335, -0.37878674268722534, -0.5792022347450256, -0.8022788166999817, 0.4900519549846649, -0.3727821111679077, 0.8983618021011353, -0.34782928228378296, 1.8589262962341309, -0.5007508397102356, 0.4576575756072998, 0.7117142677307129, 1.3101822137832642, 0.20723852515220642, -0.020683113485574722, 0.3712925612926483, 0.41512152552604675, 0.0015988592058420181, 0.5078502297401428, 1.2112269401550293, 0.5960208773612976, 0.5021551251411438, 0.7102733254432678, -2.281217575073242, 1.2673134803771973, -1.025683879852295, 0.36571216583251953, 1.3126543760299683, -0.8937165141105652, 0.36047083139419556, -1.7983087301254272, -0.0786711648106575, 0.5505507588386536, -2.2596383094787598, 0.21238704025745392, -1.3251384496688843, -0.5388238430023193, 0.9855650663375854, 0.3263758420944214, -1.206394910812378, 0.1855953186750412, -0.4592636525630951, 1.0756773948669434, 0.4902786910533905, 1.1478701829910278, -1.6563667058944702, 0.034913063049316406, -0.25637346506118774, 0.1793828159570694, -1.2201335430145264, -1.5387294292449951, 0.5750166773796082, 0.661442220211029, 0.5324757099151611, -0.13272133469581604, 1.0466153621673584, -1.0117604732513428, 0.7589607238769531, -1.007175087928772, -1.7128640413284302, -1.4951645135879517, -2.26400089263916, -2.333858013153076, 0.763466477394104, -0.49719059467315674, -0.4853295683860779, 2.030531644821167, -1.0341455936431885, -1.7349169254302979, 1.1996084451675415, 0.3033241629600525, 0.02415931224822998, 2.350231170654297, 0.1652776002883911, -0.7447325587272644, 0.49935969710350037, -0.7526981234550476, 0.7867294549942017, -0.2809879779815674, 1.4013601541519165, 0.4934858977794647, -1.0388476848602295, 1.664737343788147, -0.3629472553730011, 0.561617374420166, -0.6982330083847046, -0.5179325938224792, -0.7207070589065552, 0.27577322721481323, 1.934672474861145, -0.3291644752025604, 1.5938929319381714, -0.38059520721435547, -1.5153522491455078, -1.5591133832931519, 0.9318589568138123, 0.49212202429771423, -0.7900199890136719, 0.04957522824406624, -0.4022703766822815, 0.12183932960033417, -0.03169438615441322, 1.156279444694519, 1.2567100524902344, 0.7434108257293701, -0.3644710183143616, -0.8083740472793579, 0.1746707707643509, -0.034438904374837875, -0.6620036363601685, -1.8255903720855713, -0.3542569875717163, 0.16675861179828644, 0.5686633586883545, -1.2094407081604004, 1.7315101623535156, 0.8581075072288513, 1.9182322025299072, 0.9861254692077637, -0.38644522428512573, 1.5119385719299316, 0.12466426193714142, 1.8398102521896362, -0.4715413749217987, 0.6567741632461548, -0.3361791670322418, -1.1736589670181274, 0.8432689905166626, -0.2493848353624344, -2.07688045501709, -0.7466360926628113, -0.842095673084259, -0.164055734872818, -0.7993597984313965, 0.900398850440979, -0.2640173137187958, -1.4411288499832153, 0.20776507258415222, -0.6435121297836304, 0.12187768518924713, -1.200687050819397, 0.33881765604019165, 0.7367253303527832, -0.6699548363685608, 0.06915893405675888, -0.276750773191452, -1.3152105808258057, -0.498191237449646, 0.3142048120498657, 1.8914985656738281, -0.750678539276123, 0.9232280850410461, 1.1126760244369507, -0.7027001976966858, -0.004358980339020491, 0.30970731377601624, -0.30611416697502136, 0.8400387167930603, -1.0146973133087158, -0.4924371838569641, 1.1810435056686401, -0.21361182630062103, -0.634397566318512, 1.4099000692367554, 0.6819589734077454, -0.9895254373550415, -0.19439645111560822, -0.16698236763477325, -0.825644314289093, 0.018963225185871124, -1.5745418071746826, -0.09079835563898087, 0.35352420806884766, -1.546643853187561, -0.5127345323562622, -0.18125857412815094, 1.312723994255066, -0.16244545578956604, 1.4774776697158813, -0.3748595416545868, -0.18761679530143738, -0.3778526782989502, -0.39431822299957275, 0.1471230536699295, -0.20017512142658234, -0.6604090332984924, 0.1994209885597229, -0.8482189774513245, 0.3604641258716583, 1.3902279138565063, 0.3639931380748749, -0.019257057458162308, 0.5163804888725281, 1.1256014108657837, 0.3453214466571808, -0.03161121904850006, -0.8827919363975525, -1.5337127447128296, 1.972307562828064, -1.468442678451538, 1.9669954776763916, 0.7021132707595825, -0.03634963929653168, -1.7799618244171143, -1.8375201225280762, 1.3662103414535522, 1.146178126335144, 2.3493828773498535, 0.5607309937477112, 0.3687930703163147, -0.7748127579689026, -0.6175450086593628, 0.36165156960487366, -1.0011659860610962, -0.7377098202705383, 0.09629789739847183, 2.310150623321533, 1.7945120334625244, -0.48569926619529724, -0.19054366648197174, -1.0567981004714966, 1.3939648866653442, -0.2519955635070801, 0.30273112654685974, 1.9938613176345825, -0.30416935682296753, -1.0307756662368774, 1.3478202819824219, -2.3431029319763184, 0.18418435752391815, 2.0146501064300537, 0.25790977478027344, 0.09693865478038788, -1.3868051767349243, -0.5916035175323486, -0.2331303209066391, -0.5024559497833252, -1.3117493391036987, 0.5229682326316833, -0.2946561872959137, -0.8155026435852051, -1.402729868888855, 0.09203343093395233, -1.1488107442855835, -1.6370618343353271, 0.28699398040771484, 1.924178123474121, 2.002621650695801, -0.6978436708450317, 1.501259684562683, -0.34086060523986816, 0.22128351032733917, 1.2485926151275635, 1.2914183139801025, 3.1165010929107666, 1.9347407817840576, -1.2884246110916138, 0.6738796830177307, -0.18926112353801727, -0.4811651408672333, 1.2513788938522339, -1.1501463651657104, 1.2307082414627075, -0.19751930236816406, -1.202643871307373, -1.2305291891098022, 1.0296908617019653, 0.49965712428092957, 0.03900165483355522, -0.5040696859359741, 1.1608526706695557, 0.05540166795253754, 1.2469253540039062, 0.5771740674972534, -0.48463883996009827, 0.6473097801208496, -0.37187910079956055, -0.5569736361503601, 1.5205389261245728, 0.1566476970911026, -1.4230924844741821, -2.2885749340057373, -0.19117304682731628, -0.8756750822067261, 0.03528304025530815, -0.604047954082489, -1.0054421424865723, 1.6769933700561523, 0.4383726119995117, -1.233086347579956, -0.2521912753582001, -0.32232099771499634, -0.616348385810852, 2.6726162433624268, -1.2800304889678955, -0.27667710185050964, -0.9733095765113831, -0.6564264893531799, 1.634272575378418, -1.1343344449996948, -0.23026590049266815, -0.9697285294532776, -0.6016733646392822, -1.3257807493209839, -0.6279060244560242, 0.013738307170569897, -0.8897265195846558, 0.8005479574203491, 0.09739810973405838, -1.1763396263122559, -0.35781779885292053, -0.8748855590820312, 0.9758567810058594, -0.14072324335575104, 0.12616685032844543, 1.903717279434204, 0.30708131194114685, -0.4547795355319977, 0.6977123618125916, 1.1795464754104614, 0.6055000424385071, -0.5866384506225586, 0.26371508836746216, -0.7127901315689087, 0.29414835572242737, -1.3506578207015991, 0.24835790693759918, -2.8936405181884766, 0.6838635206222534, 0.0014373427256941795, -0.06520737707614899, -0.013539375737309456, -1.305476427078247, 1.0438034534454346, 2.615619421005249, -1.1921789646148682, 0.4470806419849396, 0.3346792757511139, 1.154036045074463, -1.5492324829101562, 0.2950443625450134, -0.4466055631637573, 2.078275680541992, 0.23759573698043823, 1.232925534248352, -0.455982506275177, -2.242032051086426, 0.6171199679374695, -1.2253762483596802, -1.161643147468567, 0.8125584125518799, -0.9004271030426025, 0.13505640625953674, -1.4198334217071533, -0.19904513657093048, -0.9223336577415466, -1.2089048624038696, 0.707460880279541, 0.1603437215089798, 0.4811725318431854, -0.5938098430633545, 0.33527761697769165, -2.155980348587036, -1.3243342638015747, -0.2781353294849396, -1.0186010599136353, 0.47532469034194946, -0.30128225684165955, 0.6105220913887024, -0.10299842804670334, 0.025103695690631866, 0.35760611295700073, 1.4503718614578247, 3.4046552181243896, 0.23359572887420654, 0.2582634389400482, -0.15172693133354187, -1.0068706274032593, 1.4571468830108643, 0.9724550247192383, -0.09874048829078674, -0.49579405784606934, -1.0172433853149414, 1.200536847114563, 1.9647873640060425, 1.048176646232605, 0.031218107789754868, -0.8831886649131775, -0.7203763723373413, 0.010385907255113125, 0.12087514996528625, 0.49148955941200256, 0.927524209022522, 0.07679243385791779, 0.1248149424791336, 1.4149885177612305, 1.1469533443450928, -0.3710882365703583, 0.4278368651866913, -0.8794882893562317, -0.42621806263923645, 0.49355509877204895, 0.29361313581466675, 0.01761452481150627, 0.3774496614933014, -1.0378648042678833, -0.24973119795322418, -0.39678916335105896, -0.9229549169540405, -0.6574004888534546, -0.4537983238697052, -0.3731171488761902, 1.560847520828247, 0.10996121168136597, -0.49410268664360046, -0.0556609109044075, -0.7850190997123718, -0.17040762305259705, -1.0354745388031006, 0.2894512712955475, -0.1064700335264206, -0.07602837681770325, -0.1672040969133377, 1.7107819318771362, -0.8437445759773254, -2.0700979232788086, 0.17682138085365295, 0.232052281498909, -0.32949572801589966, 0.23338238894939423, 1.6425343751907349, 0.5156101584434509, 1.3870322704315186, 1.3598430156707764, 0.9526875019073486, -0.5715468525886536, -1.287854552268982, 0.7200867533683777, 0.9548569321632385, -1.3604159355163574, 0.8370141386985779, -0.011522544547915459, -0.5014259815216064, 0.7000669240951538, 1.297521948814392, 0.4417247474193573, -1.9744892120361328, 0.7991164922714233, -0.9215673804283142, 0.797812283039093, 0.6764000058174133, 0.7301241755485535, 0.2448551505804062, 0.8585205674171448, -1.2276411056518555, -1.1634734869003296, -0.735854983329773, -0.6329337954521179, 1.947447419166565, -0.2822481095790863, 0.5979063510894775, -0.23996521532535553, -1.3357481956481934, -0.10030524432659149, 0.7457746863365173, 0.37454038858413696, -0.5277367234230042, 0.7788578867912292, -0.602350115776062, -1.0814701318740845, -1.3229360580444336, -0.37425148487091064, -1.0682681798934937, -0.9413266181945801, 1.0126045942306519, 0.7627726793289185, 0.3232831358909607, 1.8408375978469849, 0.6452611088752747, 0.26343831419944763, -2.680938959121704, 0.9870629906654358, 0.28919416666030884, -0.07647524774074554, 0.7990748286247253, 0.28588783740997314, 1.0265710353851318, -0.028961341828107834, 0.6501989960670471, -2.376082181930542, 2.256387710571289, -0.202499121427536, 0.7167506217956543, 0.050769153982400894, -0.19759289920330048, 1.0928349494934082, 0.5893028378486633, 0.5904464721679688, -1.0817756652832031, 0.7013167142868042, -0.6094583868980408, 1.1637111902236938, 0.9051999449729919, -0.7848093509674072, -0.07164191454648972, 1.394578456878662, 0.48874202370643616, -0.4466363787651062, -0.9265856146812439, -0.9473680853843689, 0.9715821743011475, 1.744016170501709, -0.03948996216058731, -0.053308695554733276, 0.9060227870941162, 0.691296398639679, -1.2948130369186401, 0.12028095126152039, -0.7457735538482666, -0.6985418200492859, 1.6846694946289062, 2.0972061157226562, -0.19305048882961273, -0.17587606608867645, -0.6871242523193359, -1.261568307876587, 0.7502244710922241, -0.0981203243136406, 0.09201407432556152, 0.6946336627006531, -0.6358503103256226, 1.1201274394989014, 0.8059669733047485, 0.9231313467025757, 0.16841129958629608, 0.28394004702568054, 0.3992789089679718, -0.3816554546356201, -1.1555683612823486, -0.3261984586715698, -1.0333755016326904, -2.5404341220855713, 0.4104917347431183, -0.26109373569488525, -1.3862266540527344, 0.08898494392633438, -1.0276060104370117, 0.9187034368515015, -0.5711653232574463, -1.0625903606414795, -1.5064589977264404, 0.20604826509952545, -0.027952391654253006, 0.9126091599464417, -1.6175333261489868, -0.08170480281114578, 1.2263013124465942, 0.8993083238601685, -0.6934868097305298, 0.98917555809021, 0.29701119661331177, 1.04096257686615, 0.8330435156822205, -0.39578136801719666, 0.5157150030136108, 0.08594702184200287, -1.2998274564743042, 0.47354358434677124, 1.1534532308578491, 0.1665419489145279, 1.4470462799072266, -0.5028627514839172, 0.004736251197755337, 0.4150031507015228, -0.5893182158470154, -0.5015929937362671, -0.4971555173397064, 0.6305931806564331, 0.014106825925409794, -0.919066846370697, -0.03612483665347099, -0.0564335398375988, -0.2533988356590271, 0.2083343267440796, -1.5055828094482422, -0.16635718941688538, -0.3569054901599884, -0.6005199551582336, -1.2306394577026367, -0.03561900183558464, 1.3902653455734253, -0.839529812335968, -0.20918355882167816, 0.5367316007614136, 0.33716899156570435, 0.5712083578109741, 0.5730015635490417, -0.6659834384918213, -0.2997175455093384, -0.2791225016117096, -0.3549545109272003, 0.2597394585609436, 1.3504135608673096, -0.13070113956928253, -0.9586324095726013, 0.7295083999633789, -0.4124501645565033, -0.006346419453620911, 1.9429582357406616, 0.061944201588630676, -0.7745407223701477, 0.32864633202552795, -0.7183346748352051, 1.8921116590499878, 1.777777910232544, 1.382341742515564, -0.15849876403808594, -0.8946723937988281, 0.5122449398040771, -0.4296826720237732, -0.41522032022476196, 0.8654054999351501, 0.36523979902267456, -0.15101706981658936, -1.381276249885559, 0.6877059936523438, 1.3550395965576172, -0.8901754021644592, -0.7936732769012451, 0.14465035498142242, -0.8065802454948425, 1.152909755706787, 0.6575630903244019, 0.3792356848716736, 0.24732445180416107, 1.5523792505264282, 0.7423785924911499, -0.44014665484428406, 0.5294052362442017, 0.5392389893531799, -0.1806613653898239, -2.1246039867401123, -1.172381043434143, 0.35515180230140686, -0.5194671154022217, -1.60332453250885, 1.3643367290496826, -1.1904009580612183, -1.0257245302200317, 0.5651654005050659, 0.11499837040901184, 1.4062269926071167, 0.33413031697273254, 1.608964443206787, 2.1218883991241455, 0.8266240358352661, 0.42500776052474976, 1.2746186256408691, -0.10256897658109665, -0.41871586441993713, 1.8051763772964478, -0.43560782074928284, 0.529630720615387, 1.0950446128845215, -0.3125699460506439, -1.044524073600769, -0.8047074675559998, -1.3164491653442383, -0.664860188961029, 1.125174641609192, 0.08464806526899338, -1.16789710521698, 0.19402611255645752, 1.5683670043945312, 0.12116643786430359, -0.33468636870384216, 0.6764446496963501, 0.4029046893119812, -0.7324228882789612, -0.0012843925505876541, -0.9254114031791687, 0.523249626159668, -0.255609393119812, -0.3907356560230255, 0.2961186468601227, 0.47114428877830505, 1.2651340961456299, -0.046567533165216446, 0.17396318912506104, 1.1866787672042847, -1.3767950534820557, 1.4626164436340332, -0.6809369921684265, 0.30056288838386536, -2.4091782569885254, 1.3623400926589966, -0.7441019415855408, 1.910427212715149, -2.6813204288482666, 0.4863862097263336, -0.6099047660827637, -0.44025009870529175, 0.28516778349876404, -0.3170502483844757, 0.08531925827264786, -0.08701308071613312, -1.1198352575302124, 0.0319061204791069, -0.711688756942749, 0.5892493724822998, 1.0774356126785278, 1.3450720310211182, -1.1846253871917725, -0.35779285430908203, -1.7759671211242676, -0.11928737908601761, -0.677317202091217, 0.3495132029056549, -1.9812567234039307, -0.19273661077022552, -1.929238200187683, -2.444687843322754, -1.3050720691680908, -0.8570525050163269, 1.0811951160430908, 0.10773962736129761, -0.9064972996711731, 1.237457513809204, -0.399476021528244, -1.9049605131149292, 1.087953805923462, -2.1737053394317627 ]
https://github.com/huggingface/datasets/issues/3687
Can't get the text data when calling to_tf_dataset
Thanks for the quick follow-up to my issue. For my use-case, instead of the built-in tokenizers I wanted to use the `TextVectorization` layer to map from strings to integers. To achieve this, I came up with the following solution: ``` from datasets import load_dataset from transformers import DefaultDataCollator import tensorflow as tf import string import re from tensorflow.keras.layers.experimental.preprocessing import TextVectorization #some hyper-parameters for the text-to-integer mapping max_features = 20000 embedding_dim = 128 sequence_length = 210 data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst", "default") #adapt the vectorization layer on train data only vectorize_layer.adapt(dataset["train"].to_dict(batched=False)["sentence"]) def prepare_features(text, label): text = tf.expand_dims(text, -1) return {"vectorized_text": vectorize_layer(text)[0], "label": tf.expand_dims(label, axis=-1)} encoded_dataset = dataset.map(lambda example: prepare_features(example["sentence"], example["label"]), batched=False) def custom_standardization(input_data): lowercase = tf.strings.lower(input_data) return tf.strings.regex_replace( lowercase, f"[{re.escape(string.punctuation)}]", "" ) vectorize_layer = TextVectorization( standardize=custom_standardization, max_tokens=max_features, output_mode="int", output_sequence_length=sequence_length, ) train_dataset = encoded_dataset["train"].to_tf_dataset(columns=['vectorized_text'], label_cols=["label"], shuffle=True, batch_size=1, collate_fn=data_collator).unbatch() #similar for the other sub-sets ``` Since the strings would have been mapped to integers or floats at some point, it's no drawback that this mapping is done early in the process. For the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float. For now, this can be done by calling `to_dict`.
I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded?
964
212
Can't get the text data when calling to_tf_dataset I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded? Thanks for the quick follow-up to my issue. For my use-case, instead of the built-in tokenizers I wanted to use the `TextVectorization` layer to map from strings to integers. To achieve this, I came up with the following solution: ``` from datasets import load_dataset from transformers import DefaultDataCollator import tensorflow as tf import string import re from tensorflow.keras.layers.experimental.preprocessing import TextVectorization #some hyper-parameters for the text-to-integer mapping max_features = 20000 embedding_dim = 128 sequence_length = 210 data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst", "default") #adapt the vectorization layer on train data only vectorize_layer.adapt(dataset["train"].to_dict(batched=False)["sentence"]) def prepare_features(text, label): text = tf.expand_dims(text, -1) return {"vectorized_text": vectorize_layer(text)[0], "label": tf.expand_dims(label, axis=-1)} encoded_dataset = dataset.map(lambda example: prepare_features(example["sentence"], example["label"]), batched=False) def custom_standardization(input_data): lowercase = tf.strings.lower(input_data) return tf.strings.regex_replace( lowercase, f"[{re.escape(string.punctuation)}]", "" ) vectorize_layer = TextVectorization( standardize=custom_standardization, max_tokens=max_features, output_mode="int", output_sequence_length=sequence_length, ) train_dataset = encoded_dataset["train"].to_tf_dataset(columns=['vectorized_text'], label_cols=["label"], shuffle=True, batch_size=1, collate_fn=data_collator).unbatch() #similar for the other sub-sets ``` Since the strings would have been mapped to integers or floats at some point, it's no drawback that this mapping is done early in the process. For the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float. For now, this can be done by calling `to_dict`.
[ -1.2407846450805664, -0.911194920539856, -0.7502970099449158, 1.4378316402435303, -0.19253002107143402, -1.2492157220840454, 0.18979981541633606, -1.0651826858520508, 1.7046186923980713, -0.7588399052619934, 0.2690124213695526, -1.632290005683899, 0.0295279398560524, -0.5651085376739502, -0.7286174893379211, -0.8919707536697388, -0.4119968116283417, -0.7072266340255737, 1.0126045942306519, 2.4781553745269775, 1.1866636276245117, -1.381150484085083, 2.7177672386169434, 0.6939176917076111, -0.13495546579360962, -1.0498650074005127, 0.5055744647979736, 0.08669982105493546, -1.2826287746429443, -0.49596282839775085, -0.909310519695282, -0.06160896271467209, -0.5800577998161316, -0.6247358918190002, -0.01669686660170555, 0.45332247018814087, -0.27559274435043335, -0.37878674268722534, -0.5792022347450256, -0.8022788166999817, 0.4900519549846649, -0.3727821111679077, 0.8983618021011353, -0.34782928228378296, 1.8589262962341309, -0.5007508397102356, 0.4576575756072998, 0.7117142677307129, 1.3101822137832642, 0.20723852515220642, -0.020683113485574722, 0.3712925612926483, 0.41512152552604675, 0.0015988592058420181, 0.5078502297401428, 1.2112269401550293, 0.5960208773612976, 0.5021551251411438, 0.7102733254432678, -2.281217575073242, 1.2673134803771973, -1.025683879852295, 0.36571216583251953, 1.3126543760299683, -0.8937165141105652, 0.36047083139419556, -1.7983087301254272, -0.0786711648106575, 0.5505507588386536, -2.2596383094787598, 0.21238704025745392, -1.3251384496688843, -0.5388238430023193, 0.9855650663375854, 0.3263758420944214, -1.206394910812378, 0.1855953186750412, -0.4592636525630951, 1.0756773948669434, 0.4902786910533905, 1.1478701829910278, -1.6563667058944702, 0.034913063049316406, -0.25637346506118774, 0.1793828159570694, -1.2201335430145264, -1.5387294292449951, 0.5750166773796082, 0.661442220211029, 0.5324757099151611, -0.13272133469581604, 1.0466153621673584, -1.0117604732513428, 0.7589607238769531, -1.007175087928772, -1.7128640413284302, -1.4951645135879517, -2.26400089263916, -2.333858013153076, 0.763466477394104, -0.49719059467315674, -0.4853295683860779, 2.030531644821167, -1.0341455936431885, -1.7349169254302979, 1.1996084451675415, 0.3033241629600525, 0.02415931224822998, 2.350231170654297, 0.1652776002883911, -0.7447325587272644, 0.49935969710350037, -0.7526981234550476, 0.7867294549942017, -0.2809879779815674, 1.4013601541519165, 0.4934858977794647, -1.0388476848602295, 1.664737343788147, -0.3629472553730011, 0.561617374420166, -0.6982330083847046, -0.5179325938224792, -0.7207070589065552, 0.27577322721481323, 1.934672474861145, -0.3291644752025604, 1.5938929319381714, -0.38059520721435547, -1.5153522491455078, -1.5591133832931519, 0.9318589568138123, 0.49212202429771423, -0.7900199890136719, 0.04957522824406624, -0.4022703766822815, 0.12183932960033417, -0.03169438615441322, 1.156279444694519, 1.2567100524902344, 0.7434108257293701, -0.3644710183143616, -0.8083740472793579, 0.1746707707643509, -0.034438904374837875, -0.6620036363601685, -1.8255903720855713, -0.3542569875717163, 0.16675861179828644, 0.5686633586883545, -1.2094407081604004, 1.7315101623535156, 0.8581075072288513, 1.9182322025299072, 0.9861254692077637, -0.38644522428512573, 1.5119385719299316, 0.12466426193714142, 1.8398102521896362, -0.4715413749217987, 0.6567741632461548, -0.3361791670322418, -1.1736589670181274, 0.8432689905166626, -0.2493848353624344, -2.07688045501709, -0.7466360926628113, -0.842095673084259, -0.164055734872818, -0.7993597984313965, 0.900398850440979, -0.2640173137187958, -1.4411288499832153, 0.20776507258415222, -0.6435121297836304, 0.12187768518924713, -1.200687050819397, 0.33881765604019165, 0.7367253303527832, -0.6699548363685608, 0.06915893405675888, -0.276750773191452, -1.3152105808258057, -0.498191237449646, 0.3142048120498657, 1.8914985656738281, -0.750678539276123, 0.9232280850410461, 1.1126760244369507, -0.7027001976966858, -0.004358980339020491, 0.30970731377601624, -0.30611416697502136, 0.8400387167930603, -1.0146973133087158, -0.4924371838569641, 1.1810435056686401, -0.21361182630062103, -0.634397566318512, 1.4099000692367554, 0.6819589734077454, -0.9895254373550415, -0.19439645111560822, -0.16698236763477325, -0.825644314289093, 0.018963225185871124, -1.5745418071746826, -0.09079835563898087, 0.35352420806884766, -1.546643853187561, -0.5127345323562622, -0.18125857412815094, 1.312723994255066, -0.16244545578956604, 1.4774776697158813, -0.3748595416545868, -0.18761679530143738, -0.3778526782989502, -0.39431822299957275, 0.1471230536699295, -0.20017512142658234, -0.6604090332984924, 0.1994209885597229, -0.8482189774513245, 0.3604641258716583, 1.3902279138565063, 0.3639931380748749, -0.019257057458162308, 0.5163804888725281, 1.1256014108657837, 0.3453214466571808, -0.03161121904850006, -0.8827919363975525, -1.5337127447128296, 1.972307562828064, -1.468442678451538, 1.9669954776763916, 0.7021132707595825, -0.03634963929653168, -1.7799618244171143, -1.8375201225280762, 1.3662103414535522, 1.146178126335144, 2.3493828773498535, 0.5607309937477112, 0.3687930703163147, -0.7748127579689026, -0.6175450086593628, 0.36165156960487366, -1.0011659860610962, -0.7377098202705383, 0.09629789739847183, 2.310150623321533, 1.7945120334625244, -0.48569926619529724, -0.19054366648197174, -1.0567981004714966, 1.3939648866653442, -0.2519955635070801, 0.30273112654685974, 1.9938613176345825, -0.30416935682296753, -1.0307756662368774, 1.3478202819824219, -2.3431029319763184, 0.18418435752391815, 2.0146501064300537, 0.25790977478027344, 0.09693865478038788, -1.3868051767349243, -0.5916035175323486, -0.2331303209066391, -0.5024559497833252, -1.3117493391036987, 0.5229682326316833, -0.2946561872959137, -0.8155026435852051, -1.402729868888855, 0.09203343093395233, -1.1488107442855835, -1.6370618343353271, 0.28699398040771484, 1.924178123474121, 2.002621650695801, -0.6978436708450317, 1.501259684562683, -0.34086060523986816, 0.22128351032733917, 1.2485926151275635, 1.2914183139801025, 3.1165010929107666, 1.9347407817840576, -1.2884246110916138, 0.6738796830177307, -0.18926112353801727, -0.4811651408672333, 1.2513788938522339, -1.1501463651657104, 1.2307082414627075, -0.19751930236816406, -1.202643871307373, -1.2305291891098022, 1.0296908617019653, 0.49965712428092957, 0.03900165483355522, -0.5040696859359741, 1.1608526706695557, 0.05540166795253754, 1.2469253540039062, 0.5771740674972534, -0.48463883996009827, 0.6473097801208496, -0.37187910079956055, -0.5569736361503601, 1.5205389261245728, 0.1566476970911026, -1.4230924844741821, -2.2885749340057373, -0.19117304682731628, -0.8756750822067261, 0.03528304025530815, -0.604047954082489, -1.0054421424865723, 1.6769933700561523, 0.4383726119995117, -1.233086347579956, -0.2521912753582001, -0.32232099771499634, -0.616348385810852, 2.6726162433624268, -1.2800304889678955, -0.27667710185050964, -0.9733095765113831, -0.6564264893531799, 1.634272575378418, -1.1343344449996948, -0.23026590049266815, -0.9697285294532776, -0.6016733646392822, -1.3257807493209839, -0.6279060244560242, 0.013738307170569897, -0.8897265195846558, 0.8005479574203491, 0.09739810973405838, -1.1763396263122559, -0.35781779885292053, -0.8748855590820312, 0.9758567810058594, -0.14072324335575104, 0.12616685032844543, 1.903717279434204, 0.30708131194114685, -0.4547795355319977, 0.6977123618125916, 1.1795464754104614, 0.6055000424385071, -0.5866384506225586, 0.26371508836746216, -0.7127901315689087, 0.29414835572242737, -1.3506578207015991, 0.24835790693759918, -2.8936405181884766, 0.6838635206222534, 0.0014373427256941795, -0.06520737707614899, -0.013539375737309456, -1.305476427078247, 1.0438034534454346, 2.615619421005249, -1.1921789646148682, 0.4470806419849396, 0.3346792757511139, 1.154036045074463, -1.5492324829101562, 0.2950443625450134, -0.4466055631637573, 2.078275680541992, 0.23759573698043823, 1.232925534248352, -0.455982506275177, -2.242032051086426, 0.6171199679374695, -1.2253762483596802, -1.161643147468567, 0.8125584125518799, -0.9004271030426025, 0.13505640625953674, -1.4198334217071533, -0.19904513657093048, -0.9223336577415466, -1.2089048624038696, 0.707460880279541, 0.1603437215089798, 0.4811725318431854, -0.5938098430633545, 0.33527761697769165, -2.155980348587036, -1.3243342638015747, -0.2781353294849396, -1.0186010599136353, 0.47532469034194946, -0.30128225684165955, 0.6105220913887024, -0.10299842804670334, 0.025103695690631866, 0.35760611295700073, 1.4503718614578247, 3.4046552181243896, 0.23359572887420654, 0.2582634389400482, -0.15172693133354187, -1.0068706274032593, 1.4571468830108643, 0.9724550247192383, -0.09874048829078674, -0.49579405784606934, -1.0172433853149414, 1.200536847114563, 1.9647873640060425, 1.048176646232605, 0.031218107789754868, -0.8831886649131775, -0.7203763723373413, 0.010385907255113125, 0.12087514996528625, 0.49148955941200256, 0.927524209022522, 0.07679243385791779, 0.1248149424791336, 1.4149885177612305, 1.1469533443450928, -0.3710882365703583, 0.4278368651866913, -0.8794882893562317, -0.42621806263923645, 0.49355509877204895, 0.29361313581466675, 0.01761452481150627, 0.3774496614933014, -1.0378648042678833, -0.24973119795322418, -0.39678916335105896, -0.9229549169540405, -0.6574004888534546, -0.4537983238697052, -0.3731171488761902, 1.560847520828247, 0.10996121168136597, -0.49410268664360046, -0.0556609109044075, -0.7850190997123718, -0.17040762305259705, -1.0354745388031006, 0.2894512712955475, -0.1064700335264206, -0.07602837681770325, -0.1672040969133377, 1.7107819318771362, -0.8437445759773254, -2.0700979232788086, 0.17682138085365295, 0.232052281498909, -0.32949572801589966, 0.23338238894939423, 1.6425343751907349, 0.5156101584434509, 1.3870322704315186, 1.3598430156707764, 0.9526875019073486, -0.5715468525886536, -1.287854552268982, 0.7200867533683777, 0.9548569321632385, -1.3604159355163574, 0.8370141386985779, -0.011522544547915459, -0.5014259815216064, 0.7000669240951538, 1.297521948814392, 0.4417247474193573, -1.9744892120361328, 0.7991164922714233, -0.9215673804283142, 0.797812283039093, 0.6764000058174133, 0.7301241755485535, 0.2448551505804062, 0.8585205674171448, -1.2276411056518555, -1.1634734869003296, -0.735854983329773, -0.6329337954521179, 1.947447419166565, -0.2822481095790863, 0.5979063510894775, -0.23996521532535553, -1.3357481956481934, -0.10030524432659149, 0.7457746863365173, 0.37454038858413696, -0.5277367234230042, 0.7788578867912292, -0.602350115776062, -1.0814701318740845, -1.3229360580444336, -0.37425148487091064, -1.0682681798934937, -0.9413266181945801, 1.0126045942306519, 0.7627726793289185, 0.3232831358909607, 1.8408375978469849, 0.6452611088752747, 0.26343831419944763, -2.680938959121704, 0.9870629906654358, 0.28919416666030884, -0.07647524774074554, 0.7990748286247253, 0.28588783740997314, 1.0265710353851318, -0.028961341828107834, 0.6501989960670471, -2.376082181930542, 2.256387710571289, -0.202499121427536, 0.7167506217956543, 0.050769153982400894, -0.19759289920330048, 1.0928349494934082, 0.5893028378486633, 0.5904464721679688, -1.0817756652832031, 0.7013167142868042, -0.6094583868980408, 1.1637111902236938, 0.9051999449729919, -0.7848093509674072, -0.07164191454648972, 1.394578456878662, 0.48874202370643616, -0.4466363787651062, -0.9265856146812439, -0.9473680853843689, 0.9715821743011475, 1.744016170501709, -0.03948996216058731, -0.053308695554733276, 0.9060227870941162, 0.691296398639679, -1.2948130369186401, 0.12028095126152039, -0.7457735538482666, -0.6985418200492859, 1.6846694946289062, 2.0972061157226562, -0.19305048882961273, -0.17587606608867645, -0.6871242523193359, -1.261568307876587, 0.7502244710922241, -0.0981203243136406, 0.09201407432556152, 0.6946336627006531, -0.6358503103256226, 1.1201274394989014, 0.8059669733047485, 0.9231313467025757, 0.16841129958629608, 0.28394004702568054, 0.3992789089679718, -0.3816554546356201, -1.1555683612823486, -0.3261984586715698, -1.0333755016326904, -2.5404341220855713, 0.4104917347431183, -0.26109373569488525, -1.3862266540527344, 0.08898494392633438, -1.0276060104370117, 0.9187034368515015, -0.5711653232574463, -1.0625903606414795, -1.5064589977264404, 0.20604826509952545, -0.027952391654253006, 0.9126091599464417, -1.6175333261489868, -0.08170480281114578, 1.2263013124465942, 0.8993083238601685, -0.6934868097305298, 0.98917555809021, 0.29701119661331177, 1.04096257686615, 0.8330435156822205, -0.39578136801719666, 0.5157150030136108, 0.08594702184200287, -1.2998274564743042, 0.47354358434677124, 1.1534532308578491, 0.1665419489145279, 1.4470462799072266, -0.5028627514839172, 0.004736251197755337, 0.4150031507015228, -0.5893182158470154, -0.5015929937362671, -0.4971555173397064, 0.6305931806564331, 0.014106825925409794, -0.919066846370697, -0.03612483665347099, -0.0564335398375988, -0.2533988356590271, 0.2083343267440796, -1.5055828094482422, -0.16635718941688538, -0.3569054901599884, -0.6005199551582336, -1.2306394577026367, -0.03561900183558464, 1.3902653455734253, -0.839529812335968, -0.20918355882167816, 0.5367316007614136, 0.33716899156570435, 0.5712083578109741, 0.5730015635490417, -0.6659834384918213, -0.2997175455093384, -0.2791225016117096, -0.3549545109272003, 0.2597394585609436, 1.3504135608673096, -0.13070113956928253, -0.9586324095726013, 0.7295083999633789, -0.4124501645565033, -0.006346419453620911, 1.9429582357406616, 0.061944201588630676, -0.7745407223701477, 0.32864633202552795, -0.7183346748352051, 1.8921116590499878, 1.777777910232544, 1.382341742515564, -0.15849876403808594, -0.8946723937988281, 0.5122449398040771, -0.4296826720237732, -0.41522032022476196, 0.8654054999351501, 0.36523979902267456, -0.15101706981658936, -1.381276249885559, 0.6877059936523438, 1.3550395965576172, -0.8901754021644592, -0.7936732769012451, 0.14465035498142242, -0.8065802454948425, 1.152909755706787, 0.6575630903244019, 0.3792356848716736, 0.24732445180416107, 1.5523792505264282, 0.7423785924911499, -0.44014665484428406, 0.5294052362442017, 0.5392389893531799, -0.1806613653898239, -2.1246039867401123, -1.172381043434143, 0.35515180230140686, -0.5194671154022217, -1.60332453250885, 1.3643367290496826, -1.1904009580612183, -1.0257245302200317, 0.5651654005050659, 0.11499837040901184, 1.4062269926071167, 0.33413031697273254, 1.608964443206787, 2.1218883991241455, 0.8266240358352661, 0.42500776052474976, 1.2746186256408691, -0.10256897658109665, -0.41871586441993713, 1.8051763772964478, -0.43560782074928284, 0.529630720615387, 1.0950446128845215, -0.3125699460506439, -1.044524073600769, -0.8047074675559998, -1.3164491653442383, -0.664860188961029, 1.125174641609192, 0.08464806526899338, -1.16789710521698, 0.19402611255645752, 1.5683670043945312, 0.12116643786430359, -0.33468636870384216, 0.6764446496963501, 0.4029046893119812, -0.7324228882789612, -0.0012843925505876541, -0.9254114031791687, 0.523249626159668, -0.255609393119812, -0.3907356560230255, 0.2961186468601227, 0.47114428877830505, 1.2651340961456299, -0.046567533165216446, 0.17396318912506104, 1.1866787672042847, -1.3767950534820557, 1.4626164436340332, -0.6809369921684265, 0.30056288838386536, -2.4091782569885254, 1.3623400926589966, -0.7441019415855408, 1.910427212715149, -2.6813204288482666, 0.4863862097263336, -0.6099047660827637, -0.44025009870529175, 0.28516778349876404, -0.3170502483844757, 0.08531925827264786, -0.08701308071613312, -1.1198352575302124, 0.0319061204791069, -0.711688756942749, 0.5892493724822998, 1.0774356126785278, 1.3450720310211182, -1.1846253871917725, -0.35779285430908203, -1.7759671211242676, -0.11928737908601761, -0.677317202091217, 0.3495132029056549, -1.9812567234039307, -0.19273661077022552, -1.929238200187683, -2.444687843322754, -1.3050720691680908, -0.8570525050163269, 1.0811951160430908, 0.10773962736129761, -0.9064972996711731, 1.237457513809204, -0.399476021528244, -1.9049605131149292, 1.087953805923462, -2.1737053394317627 ]
https://github.com/huggingface/datasets/issues/3687
Can't get the text data when calling to_tf_dataset
> For the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float. Yes, I agree, so let's keep this issue open.
I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded?
964
44
Can't get the text data when calling to_tf_dataset I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded? > For the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float. Yes, I agree, so let's keep this issue open.
[ -1.2407846450805664, -0.911194920539856, -0.7502970099449158, 1.4378316402435303, -0.19253002107143402, -1.2492157220840454, 0.18979981541633606, -1.0651826858520508, 1.7046186923980713, -0.7588399052619934, 0.2690124213695526, -1.632290005683899, 0.0295279398560524, -0.5651085376739502, -0.7286174893379211, -0.8919707536697388, -0.4119968116283417, -0.7072266340255737, 1.0126045942306519, 2.4781553745269775, 1.1866636276245117, -1.381150484085083, 2.7177672386169434, 0.6939176917076111, -0.13495546579360962, -1.0498650074005127, 0.5055744647979736, 0.08669982105493546, -1.2826287746429443, -0.49596282839775085, -0.909310519695282, -0.06160896271467209, -0.5800577998161316, -0.6247358918190002, -0.01669686660170555, 0.45332247018814087, -0.27559274435043335, -0.37878674268722534, -0.5792022347450256, -0.8022788166999817, 0.4900519549846649, -0.3727821111679077, 0.8983618021011353, -0.34782928228378296, 1.8589262962341309, -0.5007508397102356, 0.4576575756072998, 0.7117142677307129, 1.3101822137832642, 0.20723852515220642, -0.020683113485574722, 0.3712925612926483, 0.41512152552604675, 0.0015988592058420181, 0.5078502297401428, 1.2112269401550293, 0.5960208773612976, 0.5021551251411438, 0.7102733254432678, -2.281217575073242, 1.2673134803771973, -1.025683879852295, 0.36571216583251953, 1.3126543760299683, -0.8937165141105652, 0.36047083139419556, -1.7983087301254272, -0.0786711648106575, 0.5505507588386536, -2.2596383094787598, 0.21238704025745392, -1.3251384496688843, -0.5388238430023193, 0.9855650663375854, 0.3263758420944214, -1.206394910812378, 0.1855953186750412, -0.4592636525630951, 1.0756773948669434, 0.4902786910533905, 1.1478701829910278, -1.6563667058944702, 0.034913063049316406, -0.25637346506118774, 0.1793828159570694, -1.2201335430145264, -1.5387294292449951, 0.5750166773796082, 0.661442220211029, 0.5324757099151611, -0.13272133469581604, 1.0466153621673584, -1.0117604732513428, 0.7589607238769531, -1.007175087928772, -1.7128640413284302, -1.4951645135879517, -2.26400089263916, -2.333858013153076, 0.763466477394104, -0.49719059467315674, -0.4853295683860779, 2.030531644821167, -1.0341455936431885, -1.7349169254302979, 1.1996084451675415, 0.3033241629600525, 0.02415931224822998, 2.350231170654297, 0.1652776002883911, -0.7447325587272644, 0.49935969710350037, -0.7526981234550476, 0.7867294549942017, -0.2809879779815674, 1.4013601541519165, 0.4934858977794647, -1.0388476848602295, 1.664737343788147, -0.3629472553730011, 0.561617374420166, -0.6982330083847046, -0.5179325938224792, -0.7207070589065552, 0.27577322721481323, 1.934672474861145, -0.3291644752025604, 1.5938929319381714, -0.38059520721435547, -1.5153522491455078, -1.5591133832931519, 0.9318589568138123, 0.49212202429771423, -0.7900199890136719, 0.04957522824406624, -0.4022703766822815, 0.12183932960033417, -0.03169438615441322, 1.156279444694519, 1.2567100524902344, 0.7434108257293701, -0.3644710183143616, -0.8083740472793579, 0.1746707707643509, -0.034438904374837875, -0.6620036363601685, -1.8255903720855713, -0.3542569875717163, 0.16675861179828644, 0.5686633586883545, -1.2094407081604004, 1.7315101623535156, 0.8581075072288513, 1.9182322025299072, 0.9861254692077637, -0.38644522428512573, 1.5119385719299316, 0.12466426193714142, 1.8398102521896362, -0.4715413749217987, 0.6567741632461548, -0.3361791670322418, -1.1736589670181274, 0.8432689905166626, -0.2493848353624344, -2.07688045501709, -0.7466360926628113, -0.842095673084259, -0.164055734872818, -0.7993597984313965, 0.900398850440979, -0.2640173137187958, -1.4411288499832153, 0.20776507258415222, -0.6435121297836304, 0.12187768518924713, -1.200687050819397, 0.33881765604019165, 0.7367253303527832, -0.6699548363685608, 0.06915893405675888, -0.276750773191452, -1.3152105808258057, -0.498191237449646, 0.3142048120498657, 1.8914985656738281, -0.750678539276123, 0.9232280850410461, 1.1126760244369507, -0.7027001976966858, -0.004358980339020491, 0.30970731377601624, -0.30611416697502136, 0.8400387167930603, -1.0146973133087158, -0.4924371838569641, 1.1810435056686401, -0.21361182630062103, -0.634397566318512, 1.4099000692367554, 0.6819589734077454, -0.9895254373550415, -0.19439645111560822, -0.16698236763477325, -0.825644314289093, 0.018963225185871124, -1.5745418071746826, -0.09079835563898087, 0.35352420806884766, -1.546643853187561, -0.5127345323562622, -0.18125857412815094, 1.312723994255066, -0.16244545578956604, 1.4774776697158813, -0.3748595416545868, -0.18761679530143738, -0.3778526782989502, -0.39431822299957275, 0.1471230536699295, -0.20017512142658234, -0.6604090332984924, 0.1994209885597229, -0.8482189774513245, 0.3604641258716583, 1.3902279138565063, 0.3639931380748749, -0.019257057458162308, 0.5163804888725281, 1.1256014108657837, 0.3453214466571808, -0.03161121904850006, -0.8827919363975525, -1.5337127447128296, 1.972307562828064, -1.468442678451538, 1.9669954776763916, 0.7021132707595825, -0.03634963929653168, -1.7799618244171143, -1.8375201225280762, 1.3662103414535522, 1.146178126335144, 2.3493828773498535, 0.5607309937477112, 0.3687930703163147, -0.7748127579689026, -0.6175450086593628, 0.36165156960487366, -1.0011659860610962, -0.7377098202705383, 0.09629789739847183, 2.310150623321533, 1.7945120334625244, -0.48569926619529724, -0.19054366648197174, -1.0567981004714966, 1.3939648866653442, -0.2519955635070801, 0.30273112654685974, 1.9938613176345825, -0.30416935682296753, -1.0307756662368774, 1.3478202819824219, -2.3431029319763184, 0.18418435752391815, 2.0146501064300537, 0.25790977478027344, 0.09693865478038788, -1.3868051767349243, -0.5916035175323486, -0.2331303209066391, -0.5024559497833252, -1.3117493391036987, 0.5229682326316833, -0.2946561872959137, -0.8155026435852051, -1.402729868888855, 0.09203343093395233, -1.1488107442855835, -1.6370618343353271, 0.28699398040771484, 1.924178123474121, 2.002621650695801, -0.6978436708450317, 1.501259684562683, -0.34086060523986816, 0.22128351032733917, 1.2485926151275635, 1.2914183139801025, 3.1165010929107666, 1.9347407817840576, -1.2884246110916138, 0.6738796830177307, -0.18926112353801727, -0.4811651408672333, 1.2513788938522339, -1.1501463651657104, 1.2307082414627075, -0.19751930236816406, -1.202643871307373, -1.2305291891098022, 1.0296908617019653, 0.49965712428092957, 0.03900165483355522, -0.5040696859359741, 1.1608526706695557, 0.05540166795253754, 1.2469253540039062, 0.5771740674972534, -0.48463883996009827, 0.6473097801208496, -0.37187910079956055, -0.5569736361503601, 1.5205389261245728, 0.1566476970911026, -1.4230924844741821, -2.2885749340057373, -0.19117304682731628, -0.8756750822067261, 0.03528304025530815, -0.604047954082489, -1.0054421424865723, 1.6769933700561523, 0.4383726119995117, -1.233086347579956, -0.2521912753582001, -0.32232099771499634, -0.616348385810852, 2.6726162433624268, -1.2800304889678955, -0.27667710185050964, -0.9733095765113831, -0.6564264893531799, 1.634272575378418, -1.1343344449996948, -0.23026590049266815, -0.9697285294532776, -0.6016733646392822, -1.3257807493209839, -0.6279060244560242, 0.013738307170569897, -0.8897265195846558, 0.8005479574203491, 0.09739810973405838, -1.1763396263122559, -0.35781779885292053, -0.8748855590820312, 0.9758567810058594, -0.14072324335575104, 0.12616685032844543, 1.903717279434204, 0.30708131194114685, -0.4547795355319977, 0.6977123618125916, 1.1795464754104614, 0.6055000424385071, -0.5866384506225586, 0.26371508836746216, -0.7127901315689087, 0.29414835572242737, -1.3506578207015991, 0.24835790693759918, -2.8936405181884766, 0.6838635206222534, 0.0014373427256941795, -0.06520737707614899, -0.013539375737309456, -1.305476427078247, 1.0438034534454346, 2.615619421005249, -1.1921789646148682, 0.4470806419849396, 0.3346792757511139, 1.154036045074463, -1.5492324829101562, 0.2950443625450134, -0.4466055631637573, 2.078275680541992, 0.23759573698043823, 1.232925534248352, -0.455982506275177, -2.242032051086426, 0.6171199679374695, -1.2253762483596802, -1.161643147468567, 0.8125584125518799, -0.9004271030426025, 0.13505640625953674, -1.4198334217071533, -0.19904513657093048, -0.9223336577415466, -1.2089048624038696, 0.707460880279541, 0.1603437215089798, 0.4811725318431854, -0.5938098430633545, 0.33527761697769165, -2.155980348587036, -1.3243342638015747, -0.2781353294849396, -1.0186010599136353, 0.47532469034194946, -0.30128225684165955, 0.6105220913887024, -0.10299842804670334, 0.025103695690631866, 0.35760611295700073, 1.4503718614578247, 3.4046552181243896, 0.23359572887420654, 0.2582634389400482, -0.15172693133354187, -1.0068706274032593, 1.4571468830108643, 0.9724550247192383, -0.09874048829078674, -0.49579405784606934, -1.0172433853149414, 1.200536847114563, 1.9647873640060425, 1.048176646232605, 0.031218107789754868, -0.8831886649131775, -0.7203763723373413, 0.010385907255113125, 0.12087514996528625, 0.49148955941200256, 0.927524209022522, 0.07679243385791779, 0.1248149424791336, 1.4149885177612305, 1.1469533443450928, -0.3710882365703583, 0.4278368651866913, -0.8794882893562317, -0.42621806263923645, 0.49355509877204895, 0.29361313581466675, 0.01761452481150627, 0.3774496614933014, -1.0378648042678833, -0.24973119795322418, -0.39678916335105896, -0.9229549169540405, -0.6574004888534546, -0.4537983238697052, -0.3731171488761902, 1.560847520828247, 0.10996121168136597, -0.49410268664360046, -0.0556609109044075, -0.7850190997123718, -0.17040762305259705, -1.0354745388031006, 0.2894512712955475, -0.1064700335264206, -0.07602837681770325, -0.1672040969133377, 1.7107819318771362, -0.8437445759773254, -2.0700979232788086, 0.17682138085365295, 0.232052281498909, -0.32949572801589966, 0.23338238894939423, 1.6425343751907349, 0.5156101584434509, 1.3870322704315186, 1.3598430156707764, 0.9526875019073486, -0.5715468525886536, -1.287854552268982, 0.7200867533683777, 0.9548569321632385, -1.3604159355163574, 0.8370141386985779, -0.011522544547915459, -0.5014259815216064, 0.7000669240951538, 1.297521948814392, 0.4417247474193573, -1.9744892120361328, 0.7991164922714233, -0.9215673804283142, 0.797812283039093, 0.6764000058174133, 0.7301241755485535, 0.2448551505804062, 0.8585205674171448, -1.2276411056518555, -1.1634734869003296, -0.735854983329773, -0.6329337954521179, 1.947447419166565, -0.2822481095790863, 0.5979063510894775, -0.23996521532535553, -1.3357481956481934, -0.10030524432659149, 0.7457746863365173, 0.37454038858413696, -0.5277367234230042, 0.7788578867912292, -0.602350115776062, -1.0814701318740845, -1.3229360580444336, -0.37425148487091064, -1.0682681798934937, -0.9413266181945801, 1.0126045942306519, 0.7627726793289185, 0.3232831358909607, 1.8408375978469849, 0.6452611088752747, 0.26343831419944763, -2.680938959121704, 0.9870629906654358, 0.28919416666030884, -0.07647524774074554, 0.7990748286247253, 0.28588783740997314, 1.0265710353851318, -0.028961341828107834, 0.6501989960670471, -2.376082181930542, 2.256387710571289, -0.202499121427536, 0.7167506217956543, 0.050769153982400894, -0.19759289920330048, 1.0928349494934082, 0.5893028378486633, 0.5904464721679688, -1.0817756652832031, 0.7013167142868042, -0.6094583868980408, 1.1637111902236938, 0.9051999449729919, -0.7848093509674072, -0.07164191454648972, 1.394578456878662, 0.48874202370643616, -0.4466363787651062, -0.9265856146812439, -0.9473680853843689, 0.9715821743011475, 1.744016170501709, -0.03948996216058731, -0.053308695554733276, 0.9060227870941162, 0.691296398639679, -1.2948130369186401, 0.12028095126152039, -0.7457735538482666, -0.6985418200492859, 1.6846694946289062, 2.0972061157226562, -0.19305048882961273, -0.17587606608867645, -0.6871242523193359, -1.261568307876587, 0.7502244710922241, -0.0981203243136406, 0.09201407432556152, 0.6946336627006531, -0.6358503103256226, 1.1201274394989014, 0.8059669733047485, 0.9231313467025757, 0.16841129958629608, 0.28394004702568054, 0.3992789089679718, -0.3816554546356201, -1.1555683612823486, -0.3261984586715698, -1.0333755016326904, -2.5404341220855713, 0.4104917347431183, -0.26109373569488525, -1.3862266540527344, 0.08898494392633438, -1.0276060104370117, 0.9187034368515015, -0.5711653232574463, -1.0625903606414795, -1.5064589977264404, 0.20604826509952545, -0.027952391654253006, 0.9126091599464417, -1.6175333261489868, -0.08170480281114578, 1.2263013124465942, 0.8993083238601685, -0.6934868097305298, 0.98917555809021, 0.29701119661331177, 1.04096257686615, 0.8330435156822205, -0.39578136801719666, 0.5157150030136108, 0.08594702184200287, -1.2998274564743042, 0.47354358434677124, 1.1534532308578491, 0.1665419489145279, 1.4470462799072266, -0.5028627514839172, 0.004736251197755337, 0.4150031507015228, -0.5893182158470154, -0.5015929937362671, -0.4971555173397064, 0.6305931806564331, 0.014106825925409794, -0.919066846370697, -0.03612483665347099, -0.0564335398375988, -0.2533988356590271, 0.2083343267440796, -1.5055828094482422, -0.16635718941688538, -0.3569054901599884, -0.6005199551582336, -1.2306394577026367, -0.03561900183558464, 1.3902653455734253, -0.839529812335968, -0.20918355882167816, 0.5367316007614136, 0.33716899156570435, 0.5712083578109741, 0.5730015635490417, -0.6659834384918213, -0.2997175455093384, -0.2791225016117096, -0.3549545109272003, 0.2597394585609436, 1.3504135608673096, -0.13070113956928253, -0.9586324095726013, 0.7295083999633789, -0.4124501645565033, -0.006346419453620911, 1.9429582357406616, 0.061944201588630676, -0.7745407223701477, 0.32864633202552795, -0.7183346748352051, 1.8921116590499878, 1.777777910232544, 1.382341742515564, -0.15849876403808594, -0.8946723937988281, 0.5122449398040771, -0.4296826720237732, -0.41522032022476196, 0.8654054999351501, 0.36523979902267456, -0.15101706981658936, -1.381276249885559, 0.6877059936523438, 1.3550395965576172, -0.8901754021644592, -0.7936732769012451, 0.14465035498142242, -0.8065802454948425, 1.152909755706787, 0.6575630903244019, 0.3792356848716736, 0.24732445180416107, 1.5523792505264282, 0.7423785924911499, -0.44014665484428406, 0.5294052362442017, 0.5392389893531799, -0.1806613653898239, -2.1246039867401123, -1.172381043434143, 0.35515180230140686, -0.5194671154022217, -1.60332453250885, 1.3643367290496826, -1.1904009580612183, -1.0257245302200317, 0.5651654005050659, 0.11499837040901184, 1.4062269926071167, 0.33413031697273254, 1.608964443206787, 2.1218883991241455, 0.8266240358352661, 0.42500776052474976, 1.2746186256408691, -0.10256897658109665, -0.41871586441993713, 1.8051763772964478, -0.43560782074928284, 0.529630720615387, 1.0950446128845215, -0.3125699460506439, -1.044524073600769, -0.8047074675559998, -1.3164491653442383, -0.664860188961029, 1.125174641609192, 0.08464806526899338, -1.16789710521698, 0.19402611255645752, 1.5683670043945312, 0.12116643786430359, -0.33468636870384216, 0.6764446496963501, 0.4029046893119812, -0.7324228882789612, -0.0012843925505876541, -0.9254114031791687, 0.523249626159668, -0.255609393119812, -0.3907356560230255, 0.2961186468601227, 0.47114428877830505, 1.2651340961456299, -0.046567533165216446, 0.17396318912506104, 1.1866787672042847, -1.3767950534820557, 1.4626164436340332, -0.6809369921684265, 0.30056288838386536, -2.4091782569885254, 1.3623400926589966, -0.7441019415855408, 1.910427212715149, -2.6813204288482666, 0.4863862097263336, -0.6099047660827637, -0.44025009870529175, 0.28516778349876404, -0.3170502483844757, 0.08531925827264786, -0.08701308071613312, -1.1198352575302124, 0.0319061204791069, -0.711688756942749, 0.5892493724822998, 1.0774356126785278, 1.3450720310211182, -1.1846253871917725, -0.35779285430908203, -1.7759671211242676, -0.11928737908601761, -0.677317202091217, 0.3495132029056549, -1.9812567234039307, -0.19273661077022552, -1.929238200187683, -2.444687843322754, -1.3050720691680908, -0.8570525050163269, 1.0811951160430908, 0.10773962736129761, -0.9064972996711731, 1.237457513809204, -0.399476021528244, -1.9049605131149292, 1.087953805923462, -2.1737053394317627 ]
https://github.com/huggingface/datasets/issues/3687
Can't get the text data when calling to_tf_dataset
Going to close this now - methods like `to_tf_dataset` and `prepare_tf_dataset` now support string data, and have done for a while! If anyone sees this and is encountering issues with string data in those methods, please file a new issue!
I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded?
964
40
Can't get the text data when calling to_tf_dataset I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded? Going to close this now - methods like `to_tf_dataset` and `prepare_tf_dataset` now support string data, and have done for a while! If anyone sees this and is encountering issues with string data in those methods, please file a new issue!
[ -1.2407846450805664, -0.911194920539856, -0.7502970099449158, 1.4378316402435303, -0.19253002107143402, -1.2492157220840454, 0.18979981541633606, -1.0651826858520508, 1.7046186923980713, -0.7588399052619934, 0.2690124213695526, -1.632290005683899, 0.0295279398560524, -0.5651085376739502, -0.7286174893379211, -0.8919707536697388, -0.4119968116283417, -0.7072266340255737, 1.0126045942306519, 2.4781553745269775, 1.1866636276245117, -1.381150484085083, 2.7177672386169434, 0.6939176917076111, -0.13495546579360962, -1.0498650074005127, 0.5055744647979736, 0.08669982105493546, -1.2826287746429443, -0.49596282839775085, -0.909310519695282, -0.06160896271467209, -0.5800577998161316, -0.6247358918190002, -0.01669686660170555, 0.45332247018814087, -0.27559274435043335, -0.37878674268722534, -0.5792022347450256, -0.8022788166999817, 0.4900519549846649, -0.3727821111679077, 0.8983618021011353, -0.34782928228378296, 1.8589262962341309, -0.5007508397102356, 0.4576575756072998, 0.7117142677307129, 1.3101822137832642, 0.20723852515220642, -0.020683113485574722, 0.3712925612926483, 0.41512152552604675, 0.0015988592058420181, 0.5078502297401428, 1.2112269401550293, 0.5960208773612976, 0.5021551251411438, 0.7102733254432678, -2.281217575073242, 1.2673134803771973, -1.025683879852295, 0.36571216583251953, 1.3126543760299683, -0.8937165141105652, 0.36047083139419556, -1.7983087301254272, -0.0786711648106575, 0.5505507588386536, -2.2596383094787598, 0.21238704025745392, -1.3251384496688843, -0.5388238430023193, 0.9855650663375854, 0.3263758420944214, -1.206394910812378, 0.1855953186750412, -0.4592636525630951, 1.0756773948669434, 0.4902786910533905, 1.1478701829910278, -1.6563667058944702, 0.034913063049316406, -0.25637346506118774, 0.1793828159570694, -1.2201335430145264, -1.5387294292449951, 0.5750166773796082, 0.661442220211029, 0.5324757099151611, -0.13272133469581604, 1.0466153621673584, -1.0117604732513428, 0.7589607238769531, -1.007175087928772, -1.7128640413284302, -1.4951645135879517, -2.26400089263916, -2.333858013153076, 0.763466477394104, -0.49719059467315674, -0.4853295683860779, 2.030531644821167, -1.0341455936431885, -1.7349169254302979, 1.1996084451675415, 0.3033241629600525, 0.02415931224822998, 2.350231170654297, 0.1652776002883911, -0.7447325587272644, 0.49935969710350037, -0.7526981234550476, 0.7867294549942017, -0.2809879779815674, 1.4013601541519165, 0.4934858977794647, -1.0388476848602295, 1.664737343788147, -0.3629472553730011, 0.561617374420166, -0.6982330083847046, -0.5179325938224792, -0.7207070589065552, 0.27577322721481323, 1.934672474861145, -0.3291644752025604, 1.5938929319381714, -0.38059520721435547, -1.5153522491455078, -1.5591133832931519, 0.9318589568138123, 0.49212202429771423, -0.7900199890136719, 0.04957522824406624, -0.4022703766822815, 0.12183932960033417, -0.03169438615441322, 1.156279444694519, 1.2567100524902344, 0.7434108257293701, -0.3644710183143616, -0.8083740472793579, 0.1746707707643509, -0.034438904374837875, -0.6620036363601685, -1.8255903720855713, -0.3542569875717163, 0.16675861179828644, 0.5686633586883545, -1.2094407081604004, 1.7315101623535156, 0.8581075072288513, 1.9182322025299072, 0.9861254692077637, -0.38644522428512573, 1.5119385719299316, 0.12466426193714142, 1.8398102521896362, -0.4715413749217987, 0.6567741632461548, -0.3361791670322418, -1.1736589670181274, 0.8432689905166626, -0.2493848353624344, -2.07688045501709, -0.7466360926628113, -0.842095673084259, -0.164055734872818, -0.7993597984313965, 0.900398850440979, -0.2640173137187958, -1.4411288499832153, 0.20776507258415222, -0.6435121297836304, 0.12187768518924713, -1.200687050819397, 0.33881765604019165, 0.7367253303527832, -0.6699548363685608, 0.06915893405675888, -0.276750773191452, -1.3152105808258057, -0.498191237449646, 0.3142048120498657, 1.8914985656738281, -0.750678539276123, 0.9232280850410461, 1.1126760244369507, -0.7027001976966858, -0.004358980339020491, 0.30970731377601624, -0.30611416697502136, 0.8400387167930603, -1.0146973133087158, -0.4924371838569641, 1.1810435056686401, -0.21361182630062103, -0.634397566318512, 1.4099000692367554, 0.6819589734077454, -0.9895254373550415, -0.19439645111560822, -0.16698236763477325, -0.825644314289093, 0.018963225185871124, -1.5745418071746826, -0.09079835563898087, 0.35352420806884766, -1.546643853187561, -0.5127345323562622, -0.18125857412815094, 1.312723994255066, -0.16244545578956604, 1.4774776697158813, -0.3748595416545868, -0.18761679530143738, -0.3778526782989502, -0.39431822299957275, 0.1471230536699295, -0.20017512142658234, -0.6604090332984924, 0.1994209885597229, -0.8482189774513245, 0.3604641258716583, 1.3902279138565063, 0.3639931380748749, -0.019257057458162308, 0.5163804888725281, 1.1256014108657837, 0.3453214466571808, -0.03161121904850006, -0.8827919363975525, -1.5337127447128296, 1.972307562828064, -1.468442678451538, 1.9669954776763916, 0.7021132707595825, -0.03634963929653168, -1.7799618244171143, -1.8375201225280762, 1.3662103414535522, 1.146178126335144, 2.3493828773498535, 0.5607309937477112, 0.3687930703163147, -0.7748127579689026, -0.6175450086593628, 0.36165156960487366, -1.0011659860610962, -0.7377098202705383, 0.09629789739847183, 2.310150623321533, 1.7945120334625244, -0.48569926619529724, -0.19054366648197174, -1.0567981004714966, 1.3939648866653442, -0.2519955635070801, 0.30273112654685974, 1.9938613176345825, -0.30416935682296753, -1.0307756662368774, 1.3478202819824219, -2.3431029319763184, 0.18418435752391815, 2.0146501064300537, 0.25790977478027344, 0.09693865478038788, -1.3868051767349243, -0.5916035175323486, -0.2331303209066391, -0.5024559497833252, -1.3117493391036987, 0.5229682326316833, -0.2946561872959137, -0.8155026435852051, -1.402729868888855, 0.09203343093395233, -1.1488107442855835, -1.6370618343353271, 0.28699398040771484, 1.924178123474121, 2.002621650695801, -0.6978436708450317, 1.501259684562683, -0.34086060523986816, 0.22128351032733917, 1.2485926151275635, 1.2914183139801025, 3.1165010929107666, 1.9347407817840576, -1.2884246110916138, 0.6738796830177307, -0.18926112353801727, -0.4811651408672333, 1.2513788938522339, -1.1501463651657104, 1.2307082414627075, -0.19751930236816406, -1.202643871307373, -1.2305291891098022, 1.0296908617019653, 0.49965712428092957, 0.03900165483355522, -0.5040696859359741, 1.1608526706695557, 0.05540166795253754, 1.2469253540039062, 0.5771740674972534, -0.48463883996009827, 0.6473097801208496, -0.37187910079956055, -0.5569736361503601, 1.5205389261245728, 0.1566476970911026, -1.4230924844741821, -2.2885749340057373, -0.19117304682731628, -0.8756750822067261, 0.03528304025530815, -0.604047954082489, -1.0054421424865723, 1.6769933700561523, 0.4383726119995117, -1.233086347579956, -0.2521912753582001, -0.32232099771499634, -0.616348385810852, 2.6726162433624268, -1.2800304889678955, -0.27667710185050964, -0.9733095765113831, -0.6564264893531799, 1.634272575378418, -1.1343344449996948, -0.23026590049266815, -0.9697285294532776, -0.6016733646392822, -1.3257807493209839, -0.6279060244560242, 0.013738307170569897, -0.8897265195846558, 0.8005479574203491, 0.09739810973405838, -1.1763396263122559, -0.35781779885292053, -0.8748855590820312, 0.9758567810058594, -0.14072324335575104, 0.12616685032844543, 1.903717279434204, 0.30708131194114685, -0.4547795355319977, 0.6977123618125916, 1.1795464754104614, 0.6055000424385071, -0.5866384506225586, 0.26371508836746216, -0.7127901315689087, 0.29414835572242737, -1.3506578207015991, 0.24835790693759918, -2.8936405181884766, 0.6838635206222534, 0.0014373427256941795, -0.06520737707614899, -0.013539375737309456, -1.305476427078247, 1.0438034534454346, 2.615619421005249, -1.1921789646148682, 0.4470806419849396, 0.3346792757511139, 1.154036045074463, -1.5492324829101562, 0.2950443625450134, -0.4466055631637573, 2.078275680541992, 0.23759573698043823, 1.232925534248352, -0.455982506275177, -2.242032051086426, 0.6171199679374695, -1.2253762483596802, -1.161643147468567, 0.8125584125518799, -0.9004271030426025, 0.13505640625953674, -1.4198334217071533, -0.19904513657093048, -0.9223336577415466, -1.2089048624038696, 0.707460880279541, 0.1603437215089798, 0.4811725318431854, -0.5938098430633545, 0.33527761697769165, -2.155980348587036, -1.3243342638015747, -0.2781353294849396, -1.0186010599136353, 0.47532469034194946, -0.30128225684165955, 0.6105220913887024, -0.10299842804670334, 0.025103695690631866, 0.35760611295700073, 1.4503718614578247, 3.4046552181243896, 0.23359572887420654, 0.2582634389400482, -0.15172693133354187, -1.0068706274032593, 1.4571468830108643, 0.9724550247192383, -0.09874048829078674, -0.49579405784606934, -1.0172433853149414, 1.200536847114563, 1.9647873640060425, 1.048176646232605, 0.031218107789754868, -0.8831886649131775, -0.7203763723373413, 0.010385907255113125, 0.12087514996528625, 0.49148955941200256, 0.927524209022522, 0.07679243385791779, 0.1248149424791336, 1.4149885177612305, 1.1469533443450928, -0.3710882365703583, 0.4278368651866913, -0.8794882893562317, -0.42621806263923645, 0.49355509877204895, 0.29361313581466675, 0.01761452481150627, 0.3774496614933014, -1.0378648042678833, -0.24973119795322418, -0.39678916335105896, -0.9229549169540405, -0.6574004888534546, -0.4537983238697052, -0.3731171488761902, 1.560847520828247, 0.10996121168136597, -0.49410268664360046, -0.0556609109044075, -0.7850190997123718, -0.17040762305259705, -1.0354745388031006, 0.2894512712955475, -0.1064700335264206, -0.07602837681770325, -0.1672040969133377, 1.7107819318771362, -0.8437445759773254, -2.0700979232788086, 0.17682138085365295, 0.232052281498909, -0.32949572801589966, 0.23338238894939423, 1.6425343751907349, 0.5156101584434509, 1.3870322704315186, 1.3598430156707764, 0.9526875019073486, -0.5715468525886536, -1.287854552268982, 0.7200867533683777, 0.9548569321632385, -1.3604159355163574, 0.8370141386985779, -0.011522544547915459, -0.5014259815216064, 0.7000669240951538, 1.297521948814392, 0.4417247474193573, -1.9744892120361328, 0.7991164922714233, -0.9215673804283142, 0.797812283039093, 0.6764000058174133, 0.7301241755485535, 0.2448551505804062, 0.8585205674171448, -1.2276411056518555, -1.1634734869003296, -0.735854983329773, -0.6329337954521179, 1.947447419166565, -0.2822481095790863, 0.5979063510894775, -0.23996521532535553, -1.3357481956481934, -0.10030524432659149, 0.7457746863365173, 0.37454038858413696, -0.5277367234230042, 0.7788578867912292, -0.602350115776062, -1.0814701318740845, -1.3229360580444336, -0.37425148487091064, -1.0682681798934937, -0.9413266181945801, 1.0126045942306519, 0.7627726793289185, 0.3232831358909607, 1.8408375978469849, 0.6452611088752747, 0.26343831419944763, -2.680938959121704, 0.9870629906654358, 0.28919416666030884, -0.07647524774074554, 0.7990748286247253, 0.28588783740997314, 1.0265710353851318, -0.028961341828107834, 0.6501989960670471, -2.376082181930542, 2.256387710571289, -0.202499121427536, 0.7167506217956543, 0.050769153982400894, -0.19759289920330048, 1.0928349494934082, 0.5893028378486633, 0.5904464721679688, -1.0817756652832031, 0.7013167142868042, -0.6094583868980408, 1.1637111902236938, 0.9051999449729919, -0.7848093509674072, -0.07164191454648972, 1.394578456878662, 0.48874202370643616, -0.4466363787651062, -0.9265856146812439, -0.9473680853843689, 0.9715821743011475, 1.744016170501709, -0.03948996216058731, -0.053308695554733276, 0.9060227870941162, 0.691296398639679, -1.2948130369186401, 0.12028095126152039, -0.7457735538482666, -0.6985418200492859, 1.6846694946289062, 2.0972061157226562, -0.19305048882961273, -0.17587606608867645, -0.6871242523193359, -1.261568307876587, 0.7502244710922241, -0.0981203243136406, 0.09201407432556152, 0.6946336627006531, -0.6358503103256226, 1.1201274394989014, 0.8059669733047485, 0.9231313467025757, 0.16841129958629608, 0.28394004702568054, 0.3992789089679718, -0.3816554546356201, -1.1555683612823486, -0.3261984586715698, -1.0333755016326904, -2.5404341220855713, 0.4104917347431183, -0.26109373569488525, -1.3862266540527344, 0.08898494392633438, -1.0276060104370117, 0.9187034368515015, -0.5711653232574463, -1.0625903606414795, -1.5064589977264404, 0.20604826509952545, -0.027952391654253006, 0.9126091599464417, -1.6175333261489868, -0.08170480281114578, 1.2263013124465942, 0.8993083238601685, -0.6934868097305298, 0.98917555809021, 0.29701119661331177, 1.04096257686615, 0.8330435156822205, -0.39578136801719666, 0.5157150030136108, 0.08594702184200287, -1.2998274564743042, 0.47354358434677124, 1.1534532308578491, 0.1665419489145279, 1.4470462799072266, -0.5028627514839172, 0.004736251197755337, 0.4150031507015228, -0.5893182158470154, -0.5015929937362671, -0.4971555173397064, 0.6305931806564331, 0.014106825925409794, -0.919066846370697, -0.03612483665347099, -0.0564335398375988, -0.2533988356590271, 0.2083343267440796, -1.5055828094482422, -0.16635718941688538, -0.3569054901599884, -0.6005199551582336, -1.2306394577026367, -0.03561900183558464, 1.3902653455734253, -0.839529812335968, -0.20918355882167816, 0.5367316007614136, 0.33716899156570435, 0.5712083578109741, 0.5730015635490417, -0.6659834384918213, -0.2997175455093384, -0.2791225016117096, -0.3549545109272003, 0.2597394585609436, 1.3504135608673096, -0.13070113956928253, -0.9586324095726013, 0.7295083999633789, -0.4124501645565033, -0.006346419453620911, 1.9429582357406616, 0.061944201588630676, -0.7745407223701477, 0.32864633202552795, -0.7183346748352051, 1.8921116590499878, 1.777777910232544, 1.382341742515564, -0.15849876403808594, -0.8946723937988281, 0.5122449398040771, -0.4296826720237732, -0.41522032022476196, 0.8654054999351501, 0.36523979902267456, -0.15101706981658936, -1.381276249885559, 0.6877059936523438, 1.3550395965576172, -0.8901754021644592, -0.7936732769012451, 0.14465035498142242, -0.8065802454948425, 1.152909755706787, 0.6575630903244019, 0.3792356848716736, 0.24732445180416107, 1.5523792505264282, 0.7423785924911499, -0.44014665484428406, 0.5294052362442017, 0.5392389893531799, -0.1806613653898239, -2.1246039867401123, -1.172381043434143, 0.35515180230140686, -0.5194671154022217, -1.60332453250885, 1.3643367290496826, -1.1904009580612183, -1.0257245302200317, 0.5651654005050659, 0.11499837040901184, 1.4062269926071167, 0.33413031697273254, 1.608964443206787, 2.1218883991241455, 0.8266240358352661, 0.42500776052474976, 1.2746186256408691, -0.10256897658109665, -0.41871586441993713, 1.8051763772964478, -0.43560782074928284, 0.529630720615387, 1.0950446128845215, -0.3125699460506439, -1.044524073600769, -0.8047074675559998, -1.3164491653442383, -0.664860188961029, 1.125174641609192, 0.08464806526899338, -1.16789710521698, 0.19402611255645752, 1.5683670043945312, 0.12116643786430359, -0.33468636870384216, 0.6764446496963501, 0.4029046893119812, -0.7324228882789612, -0.0012843925505876541, -0.9254114031791687, 0.523249626159668, -0.255609393119812, -0.3907356560230255, 0.2961186468601227, 0.47114428877830505, 1.2651340961456299, -0.046567533165216446, 0.17396318912506104, 1.1866787672042847, -1.3767950534820557, 1.4626164436340332, -0.6809369921684265, 0.30056288838386536, -2.4091782569885254, 1.3623400926589966, -0.7441019415855408, 1.910427212715149, -2.6813204288482666, 0.4863862097263336, -0.6099047660827637, -0.44025009870529175, 0.28516778349876404, -0.3170502483844757, 0.08531925827264786, -0.08701308071613312, -1.1198352575302124, 0.0319061204791069, -0.711688756942749, 0.5892493724822998, 1.0774356126785278, 1.3450720310211182, -1.1846253871917725, -0.35779285430908203, -1.7759671211242676, -0.11928737908601761, -0.677317202091217, 0.3495132029056549, -1.9812567234039307, -0.19273661077022552, -1.929238200187683, -2.444687843322754, -1.3050720691680908, -0.8570525050163269, 1.0811951160430908, 0.10773962736129761, -0.9064972996711731, 1.237457513809204, -0.399476021528244, -1.9049605131149292, 1.087953805923462, -2.1737053394317627 ]
https://github.com/huggingface/datasets/issues/3686
`Translation` features cannot be `flatten`ed
Thanks for reporting, @SBrandeis! Some additional feature types that don't behave as expected when flattened: `Audio`, `Image` and `TranslationVariableLanguages`
## Describe the bug (`Dataset.flatten`)[https://github.com/huggingface/datasets/blob/master/src/datasets/arrow_dataset.py#L1265] fails for columns with feature (`Translation`)[https://github.com/huggingface/datasets/blob/3edbeb0ec6519b79f1119adc251a1a6b379a2c12/src/datasets/features/translation.py#L8] ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("europa_ecdc_tm", "en2fr", split="train[:10]") print(dataset.features) # {'translation': Translation(languages=['en', 'fr'], id=None)} print(dataset[0]) # {'translation': {'en': 'Vaccination against hepatitis C is not yet available.', 'fr': 'Aucune vaccination contre l’hépatite C n’est encore disponible.'}} dataset.flatten() ``` ## Expected results `dataset.flatten` should flatten the `Translation` column as if it were a dict of `Value("string")` ```python dataset[0] # {'translation.en': 'Vaccination against hepatitis C is not yet available.', 'translation.fr': 'Aucune vaccination contre l’hépatite C n’est encore disponible.' } dataset.features # {'translation.en': Value("string"), 'translation.fr': Value("string")} ``` ## Actual results ```python In [31]: dset.flatten() --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-31-bb88eb5276ee> in <module> ----> 1 dset.flatten() [...]\site-packages\datasets\fingerprint.py in wrapper(*args, **kwargs) 411 # Call actual function 412 --> 413 out = func(self, *args, **kwargs) 414 415 # Update fingerprint of in-place transforms + update in-place history of transforms [...]\site-packages\datasets\arrow_dataset.py in flatten(self, new_fingerprint, max_depth) 1294 break 1295 dataset.info.features = self.features.flatten(max_depth=max_depth) -> 1296 dataset._data = update_metadata_with_features(dataset._data, dataset.features) 1297 logger.info(f'Flattened dataset from depth {depth} to depth {1 if depth + 1 < max_depth else "unknown"}.') 1298 dataset._fingerprint = new_fingerprint [...]\site-packages\datasets\arrow_dataset.py in update_metadata_with_features(table, features) 534 def update_metadata_with_features(table: Table, features: Features): 535 """To be used in dataset transforms that modify the features of the dataset, in order to update the features stored in the metadata of its schema.""" --> 536 features = Features({col_name: features[col_name] for col_name in table.column_names}) 537 if table.schema.metadata is None or b"huggingface" not in table.schema.metadata: 538 pa_metadata = ArrowWriter._build_metadata(DatasetInfo(features=features)) [...]\site-packages\datasets\arrow_dataset.py in <dictcomp>(.0) 534 def update_metadata_with_features(table: Table, features: Features): 535 """To be used in dataset transforms that modify the features of the dataset, in order to update the features stored in the metadata of its schema.""" --> 536 features = Features({col_name: features[col_name] for col_name in table.column_names}) 537 if table.schema.metadata is None or b"huggingface" not in table.schema.metadata: 538 pa_metadata = ArrowWriter._build_metadata(DatasetInfo(features=features)) KeyError: 'translation.en' ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.10 - PyArrow version: 3.0.0
965
19
`Translation` features cannot be `flatten`ed ## Describe the bug (`Dataset.flatten`)[https://github.com/huggingface/datasets/blob/master/src/datasets/arrow_dataset.py#L1265] fails for columns with feature (`Translation`)[https://github.com/huggingface/datasets/blob/3edbeb0ec6519b79f1119adc251a1a6b379a2c12/src/datasets/features/translation.py#L8] ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("europa_ecdc_tm", "en2fr", split="train[:10]") print(dataset.features) # {'translation': Translation(languages=['en', 'fr'], id=None)} print(dataset[0]) # {'translation': {'en': 'Vaccination against hepatitis C is not yet available.', 'fr': 'Aucune vaccination contre l’hépatite C n’est encore disponible.'}} dataset.flatten() ``` ## Expected results `dataset.flatten` should flatten the `Translation` column as if it were a dict of `Value("string")` ```python dataset[0] # {'translation.en': 'Vaccination against hepatitis C is not yet available.', 'translation.fr': 'Aucune vaccination contre l’hépatite C n’est encore disponible.' } dataset.features # {'translation.en': Value("string"), 'translation.fr': Value("string")} ``` ## Actual results ```python In [31]: dset.flatten() --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-31-bb88eb5276ee> in <module> ----> 1 dset.flatten() [...]\site-packages\datasets\fingerprint.py in wrapper(*args, **kwargs) 411 # Call actual function 412 --> 413 out = func(self, *args, **kwargs) 414 415 # Update fingerprint of in-place transforms + update in-place history of transforms [...]\site-packages\datasets\arrow_dataset.py in flatten(self, new_fingerprint, max_depth) 1294 break 1295 dataset.info.features = self.features.flatten(max_depth=max_depth) -> 1296 dataset._data = update_metadata_with_features(dataset._data, dataset.features) 1297 logger.info(f'Flattened dataset from depth {depth} to depth {1 if depth + 1 < max_depth else "unknown"}.') 1298 dataset._fingerprint = new_fingerprint [...]\site-packages\datasets\arrow_dataset.py in update_metadata_with_features(table, features) 534 def update_metadata_with_features(table: Table, features: Features): 535 """To be used in dataset transforms that modify the features of the dataset, in order to update the features stored in the metadata of its schema.""" --> 536 features = Features({col_name: features[col_name] for col_name in table.column_names}) 537 if table.schema.metadata is None or b"huggingface" not in table.schema.metadata: 538 pa_metadata = ArrowWriter._build_metadata(DatasetInfo(features=features)) [...]\site-packages\datasets\arrow_dataset.py in <dictcomp>(.0) 534 def update_metadata_with_features(table: Table, features: Features): 535 """To be used in dataset transforms that modify the features of the dataset, in order to update the features stored in the metadata of its schema.""" --> 536 features = Features({col_name: features[col_name] for col_name in table.column_names}) 537 if table.schema.metadata is None or b"huggingface" not in table.schema.metadata: 538 pa_metadata = ArrowWriter._build_metadata(DatasetInfo(features=features)) KeyError: 'translation.en' ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.10 - PyArrow version: 3.0.0 Thanks for reporting, @SBrandeis! Some additional feature types that don't behave as expected when flattened: `Audio`, `Image` and `TranslationVariableLanguages`
[ -1.1166224479675293, -0.8579998016357422, -0.6932525634765625, 1.508471131324768, -0.0682276114821434, -1.2960996627807617, 0.12403365224599838, -0.9047678112983704, 1.6723589897155762, -0.7345048785209656, 0.26342278718948364, -1.6978775262832642, 0.004757522605359554, -0.6963163018226624, -0.6721804738044739, -0.7073785066604614, -0.264890193939209, -0.6582674384117126, 1.1367037296295166, 2.41310453414917, 1.1403305530548096, -1.3041373491287231, 2.774998664855957, 0.6253972053527832, -0.16431023180484772, -0.9589605927467346, 0.4724164307117462, -0.029480893164873123, -1.3422739505767822, -0.33455538749694824, -1.0144214630126953, 0.017776720225811005, -0.6112229228019714, -0.6242220997810364, 0.027989249676465988, 0.5211619138717651, -0.2844438850879669, -0.5435018539428711, -0.45771342515945435, -0.7885137796401978, 0.469818115234375, -0.3461092710494995, 0.894910454750061, -0.281684011220932, 1.7475972175598145, -0.5851306915283203, 0.34777772426605225, 0.4859909117221832, 1.3026872873306274, 0.23460471630096436, -0.0072839027270674706, 0.45645228028297424, 0.2795867323875427, 0.06044011935591698, 0.6343480944633484, 1.2921619415283203, 0.6304688453674316, 0.44962185621261597, 0.8036498427391052, -2.2930400371551514, 1.2557331323623657, -0.8940833806991577, 0.2213834971189499, 1.288325548171997, -0.9887152910232544, 0.47891414165496826, -1.784155011177063, -0.009444719180464745, 0.4459976553916931, -2.1775243282318115, 0.21533919870853424, -1.3399409055709839, -0.5044844150543213, 1.0020033121109009, 0.3526364862918854, -1.1972746849060059, 0.04326724261045456, -0.3249025046825409, 0.9581854343414307, 0.3727043569087982, 1.1189008951187134, -1.6634427309036255, 0.04759242385625839, -0.2372824251651764, 0.28770169615745544, -1.2228718996047974, -1.6275404691696167, 0.5348164439201355, 0.7182225584983826, 0.6716874837875366, -0.2178388237953186, 0.9945607781410217, -1.1674787998199463, 0.7196522355079651, -1.0016391277313232, -1.8760292530059814, -1.3561787605285645, -2.2699122428894043, -2.316399097442627, 0.7284069657325745, -0.36088597774505615, -0.44727668166160583, 2.021890640258789, -0.99856036901474, -1.867568850517273, 1.1176692247390747, 0.3323284983634949, -0.028772275894880295, 2.3280670642852783, 0.19528904557228088, -0.8366683721542358, 0.6511218547821045, -0.8616156578063965, 0.6552528738975525, -0.34137439727783203, 1.3660888671875, 0.42891666293144226, -0.9314584732055664, 1.6670036315917969, -0.37614506483078003, 0.5655344724655151, -0.7466104030609131, -0.35896459221839905, -0.6641684770584106, 0.27703529596328735, 2.079238176345825, -0.2928946018218994, 1.5175622701644897, -0.27429673075675964, -1.5558042526245117, -1.3989015817642212, 0.8083021640777588, 0.4136256277561188, -0.747147262096405, 0.1702333241701126, -0.3914480209350586, 0.19203044474124908, 0.010891427285969257, 1.1694577932357788, 1.2049356698989868, 0.7682962417602539, -0.21144068241119385, -0.8745163679122925, 0.2160804718732834, -0.028725583106279373, -0.6044942736625671, -1.6988170146942139, -0.2665821611881256, 0.23559312522411346, 0.6016882061958313, -1.227099895477295, 1.806147813796997, 0.8040124177932739, 1.9879601001739502, 1.0286831855773926, -0.37324610352516174, 1.5513705015182495, 0.1235213503241539, 1.9163531064987183, -0.38280221819877625, 0.6546781659126282, -0.4357190728187561, -1.201491117477417, 0.8076828122138977, -0.287828266620636, -1.9735522270202637, -0.49354320764541626, -0.9665911197662354, -0.15646769106388092, -0.8419311046600342, 0.9657775163650513, -0.28141042590141296, -1.4313684701919556, 0.17588591575622559, -0.7851157784461975, 0.13966341316699982, -1.3277560472488403, 0.2297048717737198, 0.7792073488235474, -0.6779999136924744, 0.16697576642036438, -0.37660202383995056, -1.4042013883590698, -0.5088862180709839, 0.5205520987510681, 1.8755656480789185, -0.794344425201416, 0.8830994963645935, 1.088265061378479, -0.6946958899497986, -0.0015489794313907623, 0.40432941913604736, -0.31294262409210205, 0.8073323369026184, -1.027072787284851, -0.5075644850730896, 1.1531579494476318, -0.14610297977924347, -0.6006883382797241, 1.355237603187561, 0.7890554070472717, -1.0117498636245728, -0.3149814009666443, -0.13740287721157074, -0.8508711457252502, -0.005892103537917137, -1.6296589374542236, -0.12165389955043793, 0.38373178243637085, -1.5213217735290527, -0.5192383527755737, -0.19475656747817993, 1.2175477743148804, -0.05985473096370697, 1.3393715620040894, -0.24270880222320557, -0.12486536055803299, -0.3855227828025818, -0.4980560839176178, 0.1266005039215088, -0.22896474599838257, -0.7356250882148743, 0.26101890206336975, -0.7364142537117004, 0.32842549681663513, 1.4306738376617432, 0.29089051485061646, 0.0740492045879364, 0.6019272804260254, 1.1770905256271362, 0.3584360182285309, -0.04560721665620804, -0.9133890271186829, -1.6699148416519165, 1.9772964715957642, -1.5215855836868286, 1.9364506006240845, 0.6948462724685669, 0.000019070692360401154, -1.8219883441925049, -1.9335753917694092, 1.5134559869766235, 1.131441354751587, 2.425595998764038, 0.6048546433448792, 0.45019200444221497, -0.8028147220611572, -0.6645329594612122, 0.2743285596370697, -0.780110239982605, -0.8524566292762756, 0.17113149166107178, 2.3636696338653564, 1.7688944339752197, -0.4267476499080658, -0.259647935628891, -0.9718071222305298, 1.4311505556106567, -0.3140707015991211, 0.317795068025589, 1.9074269533157349, -0.2761756479740143, -0.9753441214561462, 1.3342305421829224, -2.4086573123931885, 0.25861844420433044, 2.0000791549682617, 0.1961444467306137, 0.10447821021080017, -1.2441078424453735, -0.7655405402183533, -0.204595148563385, -0.43245649337768555, -1.2677152156829834, 0.3991096019744873, -0.2062135636806488, -0.7776898145675659, -1.4430986642837524, 0.151762917637825, -1.094205617904663, -1.6537665128707886, 0.26547303795814514, 1.9226218461990356, 2.088519811630249, -0.8442105054855347, 1.4508498907089233, -0.18144436180591583, 0.3459562063217163, 1.314770221710205, 1.165073275566101, 3.1830673217773438, 1.9425138235092163, -1.2235872745513916, 0.7035717368125916, -0.1379787027835846, -0.5224743485450745, 1.3004944324493408, -1.1680046319961548, 1.1411323547363281, -0.27567124366760254, -1.2787361145019531, -1.1878796815872192, 0.896337628364563, 0.48056769371032715, -0.04389173164963722, -0.4746849536895752, 1.0578025579452515, 0.016970030963420868, 1.267335057258606, 0.6833035945892334, -0.3664078712463379, 0.5754106044769287, -0.28235599398612976, -0.4725116193294525, 1.528793454170227, 0.008343207649886608, -1.4636902809143066, -2.2426888942718506, -0.11066478490829468, -0.9254447817802429, 0.0018024491146206856, -0.7069247961044312, -1.015609622001648, 1.5189237594604492, 0.47500675916671753, -1.0443580150604248, -0.13423864543437958, -0.3766386806964874, -0.53953617811203, 2.6888487339019775, -1.4465175867080688, -0.33322176337242126, -1.0822046995162964, -0.548719048500061, 1.6308202743530273, -1.0830626487731934, -0.23907488584518433, -0.9903304576873779, -0.5268058180809021, -1.36598801612854, -0.5505257248878479, -0.022200707346200943, -0.7345820665359497, 0.795592725276947, 0.14197824895381927, -1.2298526763916016, -0.2938164174556732, -1.081743836402893, 0.9326574206352234, -0.33447641134262085, 0.1085662841796875, 1.8766754865646362, 0.33596372604370117, -0.3426152169704437, 0.8194627165794373, 1.1660860776901245, 0.5934415459632874, -0.5591105222702026, 0.3168381154537201, -0.6430709958076477, 0.41101911664009094, -1.4336004257202148, 0.30580320954322815, -2.835847854614258, 0.6317243576049805, -0.0079556405544281, -0.01828601583838463, -0.05247781425714493, -1.4102760553359985, 1.023141860961914, 2.444483518600464, -1.2010958194732666, 0.5648322701454163, 0.29274699091911316, 1.2881922721862793, -1.6631665229797363, 0.11440764367580414, -0.526616096496582, 2.005472183227539, 0.03177211433649063, 1.118606448173523, -0.40419456362724304, -2.3376855850219727, 0.5362752676010132, -1.314355731010437, -1.0271919965744019, 0.7097678780555725, -0.9293473958969116, 0.19267083704471588, -1.3659676313400269, -0.19582368433475494, -0.9392514824867249, -1.1488863229751587, 0.6468449831008911, 0.002379150129854679, 0.450342059135437, -0.632089376449585, 0.39067110419273376, -2.1699469089508057, -1.4047119617462158, -0.16271166503429413, -0.9605116844177246, 0.5054865479469299, -0.3506227731704712, 0.6948915719985962, -0.18445156514644623, -0.08560977131128311, 0.23972363770008087, 1.4572521448135376, 3.266584873199463, 0.09588279575109482, 0.37329715490341187, -0.17017413675785065, -1.032389521598816, 1.4597859382629395, 0.9619622826576233, -0.18409770727157593, -0.521504819393158, -1.038427472114563, 1.3655297756195068, 1.9013891220092773, 1.096288800239563, 0.07351741939783096, -0.8404337763786316, -0.8367152810096741, 0.09144540876150131, 0.18939964473247528, 0.4800468385219574, 0.8984233736991882, 0.1992778778076172, 0.12283908575773239, 1.2957683801651, 1.0763001441955566, -0.3174881339073181, 0.46573343873023987, -0.9053397178649902, -0.377655565738678, 0.5172982811927795, 0.24978919327259064, -0.004395187366753817, 0.297715961933136, -1.0889956951141357, -0.2576618194580078, -0.30071333050727844, -0.8302678465843201, -0.7469977140426636, -0.3686404824256897, -0.3248269259929657, 1.6151254177093506, 0.012778337113559246, -0.6541851162910461, -0.13645662367343903, -0.760882556438446, -0.021810755133628845, -0.9232197403907776, 0.23957696557044983, -0.22292810678482056, -0.06152944639325142, -0.14524027705192566, 1.6517928838729858, -0.9575098156929016, -2.113969564437866, 0.1464296281337738, 0.30318495631217957, -0.33930501341819763, 0.0733359232544899, 1.7595717906951904, 0.5859004259109497, 1.388010859489441, 1.5140466690063477, 1.0923669338226318, -0.6588628888130188, -1.307483196258545, 0.6610798239707947, 0.9695393443107605, -1.3450844287872314, 0.8506627082824707, -0.040757469832897186, -0.5646846890449524, 0.5178912878036499, 1.3317770957946777, 0.5039758682250977, -1.9366377592086792, 0.7488290667533875, -1.0948047637939453, 0.8293731808662415, 0.819913923740387, 0.8176127672195435, 0.19543103873729706, 0.7965409159660339, -1.2452080249786377, -1.0527015924453735, -0.7282829284667969, -0.6528817415237427, 1.8133283853530884, -0.22568044066429138, 0.4347569942474365, -0.23031438887119293, -1.3086904287338257, 0.03516607731580734, 0.686568558216095, 0.3820538818836212, -0.568121612071991, 0.7688225507736206, -0.6655275225639343, -1.0596562623977661, -1.2743251323699951, -0.5062570571899414, -0.9931188821792603, -0.9367952942848206, 0.9856597185134888, 0.808624267578125, 0.43527230620384216, 1.8818713426589966, 0.7377200722694397, 0.1794944703578949, -2.610471248626709, 0.850261926651001, 0.36355060338974, -0.09132375568151474, 0.769790530204773, 0.31295832991600037, 1.1666971445083618, -0.16158920526504517, 0.5997970104217529, -2.2740373611450195, 2.1961746215820312, -0.178422749042511, 0.7694498300552368, -0.08087249845266342, -0.04929954186081886, 0.9888388514518738, 0.4690176546573639, 0.5538954734802246, -1.1042147874832153, 0.7518066763877869, -0.6615486145019531, 1.2643743753433228, 0.8952171206474304, -0.8781315684318542, 0.07972431182861328, 1.3035472631454468, 0.36541494727134705, -0.6601129770278931, -1.005228042602539, -0.9045916795730591, 0.9718053340911865, 1.701760172843933, 0.00820931326597929, 0.03866790980100632, 0.9398859739303589, 0.6549580097198486, -1.3444088697433472, 0.055851493030786514, -0.6321703791618347, -0.5664000511169434, 1.8660917282104492, 2.057534694671631, -0.18168216943740845, -0.12200873345136642, -0.7687843441963196, -1.3304539918899536, 0.7129245400428772, 0.12539887428283691, -0.06862463802099228, 0.8692086935043335, -0.668953537940979, 1.1589070558547974, 0.8468939661979675, 0.8430103063583374, 0.15906143188476562, 0.1716802567243576, 0.32375213503837585, -0.3675662875175476, -1.2355194091796875, -0.2503058910369873, -1.0537495613098145, -2.5129787921905518, 0.4147984981536865, -0.20773790776729584, -1.424160122871399, 0.10465573519468307, -1.020445466041565, 0.9153246283531189, -0.537522554397583, -1.1866471767425537, -1.3413541316986084, 0.2697983384132385, -0.059791918843984604, 0.8024174571037292, -1.6322431564331055, -0.09646416455507278, 1.2362231016159058, 1.0741443634033203, -0.7534797787666321, 0.9546405673027039, 0.278542697429657, 1.019797682762146, 0.9123679399490356, -0.3272588849067688, 0.4728718400001526, 0.05984244868159294, -1.2903845310211182, 0.48825743794441223, 1.256117343902588, 0.13861533999443054, 1.4360466003417969, -0.5105398893356323, -0.0579298660159111, 0.3993929624557495, -0.3883213400840759, -0.500096321105957, -0.6869840621948242, 0.6341574192047119, -0.11143171787261963, -0.8214442729949951, -0.035717517137527466, 0.09391900151968002, -0.12898601591587067, 0.23014123737812042, -1.5676485300064087, -0.09286443889141083, -0.30224543809890747, -0.6740182638168335, -1.2442063093185425, -0.0426299013197422, 1.2967678308486938, -0.8630793690681458, -0.25127455592155457, 0.5557053685188293, 0.12632019817829132, 0.5163914561271667, 0.5350729823112488, -0.7301318645477295, -0.2816975712776184, -0.12039529532194138, -0.3714030981063843, 0.2998998165130615, 1.424996018409729, -0.08793061971664429, -1.066880464553833, 0.5762401819229126, -0.34794652462005615, 0.06796573102474213, 1.901423454284668, -0.036879245191812515, -0.8898593187332153, 0.2314225435256958, -0.7577545046806335, 1.9078350067138672, 1.7397807836532593, 1.3483234643936157, -0.12816721200942993, -0.9466989040374756, 0.6529198288917542, -0.3566661477088928, -0.42841213941574097, 0.8597394227981567, 0.3665841817855835, -0.2343851625919342, -1.4004969596862793, 0.7018232345581055, 1.2858099937438965, -0.8526608347892761, -0.8279674649238586, 0.14854489266872406, -0.8398522734642029, 1.2135268449783325, 0.7172693014144897, 0.27446654438972473, 0.28413552045822144, 1.6155643463134766, 0.7888340353965759, -0.44942453503608704, 0.5396891236305237, 0.537970781326294, -0.12294945120811462, -2.05316162109375, -1.121060848236084, 0.24759431183338165, -0.3908337354660034, -1.6344958543777466, 1.4360512495040894, -1.2367424964904785, -0.8699234127998352, 0.6003278493881226, 0.16846846044063568, 1.3844276666641235, 0.3256427049636841, 1.6291707754135132, 2.034804105758667, 0.8662682771682739, 0.43571045994758606, 1.1279399394989014, -0.20992177724838257, -0.34287402033805847, 1.6319329738616943, -0.5063024759292603, 0.6755326390266418, 1.0135514736175537, -0.35442084074020386, -1.2366628646850586, -0.7715765237808228, -1.3653690814971924, -0.7028143405914307, 1.1022275686264038, 0.12216416746377945, -1.1487529277801514, 0.32773372530937195, 1.5703614950180054, 0.018427018076181412, -0.2979767620563507, 0.696709394454956, 0.38980305194854736, -0.7868651747703552, -0.06153150275349617, -0.908602774143219, 0.5828371644020081, -0.24666079878807068, -0.31401732563972473, 0.2901718020439148, 0.48571959137916565, 1.3321126699447632, 0.18048496544361115, 0.1486048400402069, 1.371793508529663, -1.3388340473175049, 1.4374686479568481, -0.958044707775116, 0.30393505096435547, -2.4012553691864014, 1.462884545326233, -0.9282053112983704, 1.964878797531128, -2.6876752376556396, 0.5297631621360779, -0.5651930570602417, -0.48911556601524353, 0.1637701690196991, -0.27095407247543335, 0.04212009534239769, -0.039503175765275955, -1.1289520263671875, -0.09357055276632309, -0.7745047211647034, 0.5009261965751648, 1.2387874126434326, 1.4260971546173096, -1.0205718278884888, -0.3175239861011505, -1.761106014251709, -0.1425921618938446, -0.5542792081832886, 0.24542830884456635, -1.878714919090271, -0.20244483649730682, -1.9248559474945068, -2.4426987171173096, -1.2783907651901245, -0.8670028448104858, 1.2179044485092163, 0.028924372047185898, -0.9018072485923767, 1.1572903394699097, -0.4155968725681305, -1.7529228925704956, 1.1643452644348145, -2.1936380863189697 ]
https://github.com/huggingface/datasets/issues/3679
Download datasets from a private hub
Hi ! For information one can set the environment variable `HF_ENDPOINT` (default is `https://huggingface.co`) if they want to use a private hub. We may need to coordinate with the other libraries to have a consistent way of changing the hub endpoint
In the context of a private hub deployment, customers would like to use load_dataset() to load datasets from their hub, not from the public hub. This doesn't seem to be configurable at the moment and it would be nice to add this feature. The obvious workaround is to clone the repo first and then load it from local storage, but this adds an extra step. It'd be great to have the same experience regardless of where the hub is hosted. The same issue exists with the transformers library and the CLI. I'm going to create issues there as well, and I'll reference them below.
966
41
Download datasets from a private hub In the context of a private hub deployment, customers would like to use load_dataset() to load datasets from their hub, not from the public hub. This doesn't seem to be configurable at the moment and it would be nice to add this feature. The obvious workaround is to clone the repo first and then load it from local storage, but this adds an extra step. It'd be great to have the same experience regardless of where the hub is hosted. The same issue exists with the transformers library and the CLI. I'm going to create issues there as well, and I'll reference them below. Hi ! For information one can set the environment variable `HF_ENDPOINT` (default is `https://huggingface.co`) if they want to use a private hub. We may need to coordinate with the other libraries to have a consistent way of changing the hub endpoint
[ -1.2928180694580078, -0.9811541438102722, -0.8492002487182617, 1.5485219955444336, -0.21207988262176514, -1.3233472108840942, 0.010777153074741364, -1.043709635734558, 1.6567189693450928, -0.9061861038208008, 0.33849093317985535, -1.6110509634017944, 0.16192850470542908, -0.5487292408943176, -0.7780382633209229, -0.8934272527694702, -0.3974002003669739, -0.7238112688064575, 0.9593401551246643, 2.4907615184783936, 1.1453170776367188, -1.4551448822021484, 2.7715251445770264, 0.679613471031189, -0.03297433257102966, -1.1148362159729004, 0.4719735383987427, 0.08928398042917252, -1.2124577760696411, -0.5484258532524109, -0.9399588704109192, -0.03091614507138729, -0.5809705853462219, -0.527033269405365, -0.030806688591837883, 0.39227110147476196, -0.33865854144096375, -0.3775749206542969, -0.517566978931427, -0.822787880897522, 0.46743854880332947, -0.420634001493454, 0.9821835160255432, -0.400420606136322, 1.8491069078445435, -0.4059775173664093, 0.38395604491233826, 0.7892152070999146, 1.4885034561157227, 0.12569943070411682, -0.04938298463821411, 0.2358207404613495, 0.3622293770313263, -0.026460273191332817, 0.42106640338897705, 1.1079375743865967, 0.4956079423427582, 0.5671159625053406, 0.6554773449897766, -2.1754088401794434, 1.462636947631836, -1.2017991542816162, 0.28890371322631836, 1.3987799882888794, -0.976229190826416, 0.36767423152923584, -1.7551054954528809, -0.090768001973629, 0.4263512194156647, -2.308056354522705, 0.24196359515190125, -1.215712547302246, -0.4940347671508789, 1.008036494255066, 0.25693559646606445, -1.3035918474197388, 0.14296936988830566, -0.4617982804775238, 1.0136191844940186, 0.5637382864952087, 1.1157095432281494, -1.6367055177688599, 0.06764481961727142, -0.27964529395103455, 0.11287210136651993, -1.3172698020935059, -1.4166613817214966, 0.503281831741333, 0.6341776251792908, 0.5788738131523132, 0.06313672661781311, 1.009416937828064, -1.001961588859558, 0.8774218559265137, -0.8827522397041321, -1.5487273931503296, -1.398231029510498, -2.2739577293395996, -2.3670642375946045, 0.7743749618530273, -0.47555744647979736, -0.6287700533866882, 2.020092487335205, -1.137575626373291, -1.7470508813858032, 1.355383038520813, 0.2188851535320282, 0.14236494898796082, 2.4688501358032227, 0.11579222232103348, -0.5451860427856445, 0.4805903732776642, -0.6053853631019592, 0.8920849561691284, -0.5307658910751343, 1.3806499242782593, 0.4862636923789978, -1.0946916341781616, 1.635755181312561, -0.31317320466041565, 0.4791414141654968, -0.6612496376037598, -0.5242260098457336, -0.8946309089660645, 0.40162989497184753, 1.8192683458328247, -0.3254910707473755, 1.6119362115859985, -0.39832603931427, -1.5049049854278564, -1.671313762664795, 1.0331141948699951, 0.46547767519950867, -0.7654484510421753, 0.04694492742419243, -0.3548286259174347, 0.016151485964655876, 0.04613355174660683, 1.122184157371521, 1.2280362844467163, 0.675792396068573, -0.2569410502910614, -0.8641350269317627, 0.16534343361854553, -0.07277077436447144, -0.6440216898918152, -1.8391255140304565, -0.32962021231651306, 0.13029786944389343, 0.6890298128128052, -1.173293948173523, 1.7351078987121582, 0.9937084913253784, 1.8665143251419067, 1.0384467840194702, -0.1692015528678894, 1.511351466178894, 0.05074254050850868, 1.8396377563476562, -0.5002396106719971, 0.7043113112449646, -0.3365779221057892, -1.0647433996200562, 0.8020816445350647, -0.44623512029647827, -2.0045740604400635, -0.8278874158859253, -0.8231119513511658, -0.2071804404258728, -0.6860504746437073, 1.058348536491394, -0.3409624695777893, -1.254875659942627, 0.2832416594028473, -0.5506854057312012, 0.15007174015045166, -1.1167861223220825, 0.39897826313972473, 0.7913773655891418, -0.7249316573143005, 0.07819512486457825, -0.31223583221435547, -1.283898949623108, -0.4813806116580963, 0.34550756216049194, 1.8494242429733276, -0.8350443840026855, 0.8540833592414856, 0.9138794541358948, -0.7158715724945068, -0.09576492011547089, 0.3914130628108978, -0.31678688526153564, 0.7899176478385925, -0.9690104126930237, -0.36064550280570984, 1.2852509021759033, -0.24187862873077393, -0.6712192296981812, 1.5126595497131348, 0.7565241456031799, -0.9263080954551697, -0.12910676002502441, -0.2921079099178314, -0.875062882900238, -0.03072185441851616, -1.5641754865646362, -0.06177983060479164, 0.19113007187843323, -1.539751410484314, -0.4245229959487915, -0.2090889811515808, 1.2354739904403687, -0.20149880647659302, 1.4512767791748047, -0.38585618138313293, -0.2921786606311798, -0.3000674545764923, -0.3853333294391632, 0.1427098512649536, -0.15520316362380981, -0.6097654104232788, 0.20380258560180664, -0.819063663482666, 0.38676074147224426, 1.4162242412567139, 0.46261999011039734, 0.058878786861896515, 0.5320263504981995, 1.0717754364013672, 0.38325822353363037, 0.03191337734460831, -0.8765542507171631, -1.6252676248550415, 1.9450385570526123, -1.4882009029388428, 2.041076898574829, 0.8391502499580383, -0.00277860090136528, -1.8570361137390137, -1.7696629762649536, 1.3508609533309937, 1.2011287212371826, 2.263892650604248, 0.5350161790847778, 0.27269601821899414, -0.8714208602905273, -0.6812911033630371, 0.46974945068359375, -1.0821970701217651, -0.7006531953811646, -0.007100132293999195, 2.260251045227051, 1.8555448055267334, -0.42209678888320923, -0.2719668745994568, -1.1006429195404053, 1.378096342086792, -0.14688712358474731, 0.297443151473999, 2.0035383701324463, -0.26759132742881775, -1.0848864316940308, 1.2871553897857666, -2.320375680923462, 0.11298807710409164, 2.0005435943603516, 0.2785279452800751, -0.0565410815179348, -1.5067601203918457, -0.6774490475654602, -0.1361275017261505, -0.4126686751842499, -1.2989327907562256, 0.5677360892295837, -0.36895450949668884, -0.7253258228302002, -1.486177682876587, 0.1899024248123169, -1.1786885261535645, -1.6074044704437256, 0.34905514121055603, 1.8401362895965576, 2.0711963176727295, -0.5684316754341125, 1.5828588008880615, -0.1694161295890808, 0.22270414233207703, 1.2735364437103271, 1.1784437894821167, 3.098304271697998, 1.8699185848236084, -1.2104201316833496, 0.5858243703842163, -0.08711306750774384, -0.5072477459907532, 1.228309988975525, -1.117171049118042, 1.3545327186584473, -0.16653144359588623, -1.1431729793548584, -1.2982546091079712, 0.9525235891342163, 0.37904056906700134, 0.11765093356370926, -0.48596933484077454, 1.2297412157058716, 0.0007158443331718445, 1.2206965684890747, 0.5130249857902527, -0.37625646591186523, 0.6014923453330994, -0.5377858877182007, -0.6484898924827576, 1.5088512897491455, 0.17495253682136536, -1.4186090230941772, -2.2049474716186523, -0.2150822877883911, -0.6743573546409607, 0.013415355235338211, -0.5858023762702942, -0.9316684603691101, 1.6826969385147095, 0.39311909675598145, -1.376623272895813, -0.26637741923332214, -0.41211366653442383, -0.617091715335846, 2.585165023803711, -1.4039688110351562, -0.2669302523136139, -0.9553325176239014, -0.6013950109481812, 1.6673859357833862, -1.2648926973342896, -0.1671518087387085, -1.0097391605377197, -0.6116979122161865, -1.3781898021697998, -0.5823941230773926, -0.05703870579600334, -0.8769811987876892, 0.7473618388175964, 0.1670060157775879, -1.0846316814422607, -0.2917504608631134, -0.8199678659439087, 0.7344304919242859, -0.032163143157958984, 0.4134621024131775, 1.8865954875946045, 0.4493899345397949, -0.4166248142719269, 0.8134528398513794, 1.095892310142517, 0.6003677845001221, -0.5760661959648132, 0.23189494013786316, -0.6877945065498352, 0.29239019751548767, -1.2031561136245728, 0.38874953985214233, -2.956284999847412, 0.6543950438499451, -0.07184848934412003, -0.17635080218315125, -0.00832523126155138, -1.26658296585083, 1.0650044679641724, 2.6080663204193115, -1.2025755643844604, 0.466121643781662, 0.2496773600578308, 1.2216360569000244, -1.6457809209823608, 0.44829005002975464, -0.2984415590763092, 2.13761305809021, 0.19896647334098816, 1.1404527425765991, -0.5368179678916931, -2.293287992477417, 0.6503911018371582, -1.3111543655395508, -1.2099695205688477, 0.6683557629585266, -0.791371762752533, -0.05468783527612686, -1.4400582313537598, -0.2239099144935608, -0.8502717018127441, -1.2298210859298706, 0.8059934973716736, 0.20522719621658325, 0.5203647613525391, -0.551010251045227, 0.2708666920661926, -2.1432106494903564, -1.3440195322036743, -0.20881137251853943, -0.8580697178840637, 0.4764041304588318, -0.3196554183959961, 0.6714605093002319, -0.28826409578323364, 0.12276936322450638, 0.36422035098075867, 1.3877910375595093, 3.435957431793213, 0.2292674481868744, 0.5257271528244019, -0.186849445104599, -0.8357471823692322, 1.4315201044082642, 0.9844648838043213, -0.09162413328886032, -0.6178879737854004, -1.0451258420944214, 1.3358803987503052, 1.8977781534194946, 0.8572907447814941, 0.1835935413837433, -0.7648808360099792, -0.6413484811782837, -0.1513909101486206, 0.07089518755674362, 0.47792550921440125, 0.956275999546051, 0.07025516033172607, 0.12510401010513306, 1.5104596614837646, 1.3172264099121094, -0.4163053631782532, 0.34912365674972534, -0.7420266270637512, -0.36232680082321167, 0.4983561336994171, 0.37790441513061523, -0.19913411140441895, 0.37960579991340637, -0.9301535487174988, -0.30024951696395874, -0.5317395925521851, -1.0558547973632812, -0.6721407175064087, -0.39570069313049316, -0.37277641892433167, 1.671343445777893, 0.2376084327697754, -0.5522735714912415, -0.08767669647932053, -0.823767900466919, -0.21765679121017456, -1.0812370777130127, 0.23720908164978027, -0.11892332881689072, -0.14526993036270142, -0.0806037187576294, 1.8970693349838257, -0.9760267734527588, -2.107419729232788, 0.21562626957893372, 0.17539072036743164, -0.2892397344112396, 0.24964311718940735, 1.5690691471099854, 0.4577696919441223, 1.4637240171432495, 1.4210400581359863, 0.8998557329177856, -0.6391083598136902, -1.3510631322860718, 0.6989257335662842, 0.8868343830108643, -1.4917486906051636, 0.8114645481109619, 0.06985855102539062, -0.5459913611412048, 0.7994030714035034, 1.2077341079711914, 0.5086311101913452, -1.9986780881881714, 0.718595564365387, -0.906753420829773, 0.7427294850349426, 0.6876548528671265, 0.6398124098777771, 0.23664778470993042, 0.808468222618103, -1.1160566806793213, -1.2820976972579956, -0.7981354594230652, -0.7156311869621277, 1.8792943954467773, -0.2658173143863678, 0.6106250286102295, -0.12359672784805298, -1.416986346244812, -0.19164147973060608, 0.6505849957466125, 0.3721437156200409, -0.33732613921165466, 0.7837640047073364, -0.8303869366645813, -1.18018639087677, -1.4817540645599365, -0.4531998634338379, -1.0051324367523193, -0.8479493260383606, 1.1174044609069824, 0.8158937692642212, 0.07342705875635147, 1.9463565349578857, 0.5966392159461975, 0.1927972137928009, -2.6966214179992676, 0.7964040040969849, 0.32892605662345886, 0.05400305613875389, 0.9181588888168335, 0.3001544177532196, 0.9786850810050964, 0.061702556908130646, 0.4662410318851471, -2.3826704025268555, 2.2794911861419678, -0.31240347027778625, 0.761096715927124, -0.08977138251066208, -0.21800026297569275, 1.162128210067749, 0.5023142695426941, 0.6432583332061768, -1.1088310480117798, 0.7014567255973816, -0.6106871366500854, 1.2626161575317383, 0.9332870841026306, -0.7514526844024658, -0.13453567028045654, 1.295549750328064, 0.49520859122276306, -0.5835067629814148, -0.8195484280586243, -0.9360369443893433, 0.8294587731361389, 1.7869478464126587, -0.00572739914059639, 0.004150708205997944, 0.7168450951576233, 0.6058437824249268, -1.3231160640716553, 0.09212416410446167, -0.6889306902885437, -0.8651317358016968, 1.5513508319854736, 2.025482654571533, -0.09306942671537399, -0.14410272240638733, -0.7121231555938721, -1.2112984657287598, 0.7513446807861328, 0.07752961665391922, 0.13706663250923157, 0.5350635647773743, -0.6296333074569702, 1.0957603454589844, 0.9287160038948059, 0.8920844197273254, 0.09002035856246948, 0.41713133454322815, 0.3747040927410126, -0.24071764945983887, -1.1429013013839722, -0.2999674081802368, -1.1153775453567505, -2.546902894973755, 0.524696409702301, -0.37705519795417786, -1.4795509576797485, -0.04030720517039299, -1.031294345855713, 0.923820436000824, -0.4760860502719879, -1.1443020105361938, -1.505069613456726, 0.1326085329055786, -0.19026917219161987, 0.8690206408500671, -1.6132489442825317, -0.00943908654153347, 1.1980156898498535, 0.962976336479187, -0.7142217755317688, 1.1205735206604004, 0.21975144743919373, 1.0692428350448608, 0.8546477556228638, -0.5383153557777405, 0.41909992694854736, 0.14085233211517334, -1.3521289825439453, 0.43793606758117676, 1.052551507949829, 0.1515159010887146, 1.4225283861160278, -0.4849299192428589, 0.03309974819421768, 0.40467751026153564, -0.5658740997314453, -0.4000402092933655, -0.5480368137359619, 0.8852477669715881, -0.0514996200799942, -0.727411687374115, 0.06292662024497986, -0.18833687901496887, -0.331717312335968, 0.0532284714281559, -1.526853322982788, -0.22507065534591675, -0.43006759881973267, -0.5460140705108643, -1.300757646560669, 0.06692331284284592, 1.4077650308609009, -0.6676797270774841, -0.24821427464485168, 0.4465175271034241, 0.48432305455207825, 0.47381407022476196, 0.6346251964569092, -0.6673902273178101, -0.42337462306022644, -0.2356952428817749, -0.34203943610191345, 0.3787621855735779, 1.3209608793258667, -0.2490345537662506, -0.945224940776825, 0.7665594220161438, -0.334477037191391, -0.007144632749259472, 1.9430702924728394, 0.06779579818248749, -0.7740397453308105, 0.3586270213127136, -0.7229617238044739, 1.9851161241531372, 1.8063808679580688, 1.303953766822815, -0.07699889689683914, -0.8871901631355286, 0.6734399795532227, -0.2303510308265686, -0.3131835460662842, 0.8922106027603149, 0.5101163387298584, -0.08710671216249466, -1.3602015972137451, 0.570724368095398, 1.1021088361740112, -0.8652955889701843, -0.7868456840515137, 0.017777537927031517, -0.8397961854934692, 1.0080496072769165, 0.7026675343513489, 0.5346078872680664, 0.19400659203529358, 1.6277599334716797, 0.6488291025161743, -0.5341082215309143, 0.5546300411224365, 0.541645884513855, -0.16808176040649414, -2.0845086574554443, -1.11784029006958, 0.31287774443626404, -0.4071403443813324, -1.5448161363601685, 1.2565999031066895, -1.1451336145401, -0.8635815978050232, 0.49895909428596497, -0.011609270237386227, 1.4797273874282837, 0.23547792434692383, 1.5553337335586548, 2.063631772994995, 0.8836404085159302, 0.3683135211467743, 1.3903964757919312, -0.06728450208902359, -0.48867690563201904, 1.9879361391067505, -0.45590782165527344, 0.4920012056827545, 1.1382726430892944, -0.3661167025566101, -0.9859156012535095, -0.6942804455757141, -1.0354554653167725, -0.6129973530769348, 1.1278706789016724, 0.1873326301574707, -1.110263705253601, 0.1536036729812622, 1.5036696195602417, 0.1332065463066101, -0.285739541053772, 0.39008334279060364, 0.5314603447914124, -0.6573436260223389, -0.06664714962244034, -0.9108029007911682, 0.5432806015014648, -0.2746714651584625, -0.39083337783813477, 0.43474483489990234, 0.35547566413879395, 1.2653553485870361, -0.1576438844203949, 0.1497848927974701, 1.234052300453186, -1.4400653839111328, 1.341310977935791, -0.5669537782669067, 0.1704609990119934, -2.3414223194122314, 1.4517804384231567, -0.8178434371948242, 2.011475086212158, -2.6091225147247314, 0.3472670614719391, -0.706921398639679, -0.4960143268108368, 0.47013798356056213, -0.36395639181137085, 0.08870183676481247, -0.21889275312423706, -1.0562939643859863, 0.005635653622448444, -0.6231367588043213, 0.5065165162086487, 1.1495380401611328, 1.276721477508545, -1.0900726318359375, -0.3384321928024292, -1.7887107133865356, -0.22702237963676453, -0.7162970900535583, 0.3768879175186157, -2.117525339126587, -0.18413451313972473, -1.9973598718643188, -2.3035597801208496, -1.4316703081130981, -0.7504886984825134, 1.0847169160842896, 0.23394790291786194, -0.8181781768798828, 1.134469985961914, -0.2722786068916321, -1.7590162754058838, 1.0506995916366577, -2.020139217376709 ]
https://github.com/huggingface/datasets/issues/3677
Discovery cannot be streamed anymore
Seems like a regression from https://github.com/huggingface/datasets/pull/2843 Or maybe it's an issue with the hosting. I don't think so, though, because https://www.dropbox.com/s/aox84z90nyyuikz/discovery.zip seems to work as expected
## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset iterable_dataset = load_dataset("discovery", name="discovery", split="train", streaming=True) list(iterable_dataset.take(1)) ``` ## Expected results The first row of the train split. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 365, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 362, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 272, in __iter__ yield from islice(self.ex_iterable, self.n) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 79, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/discovery/542fab7a9ddc1d9726160355f7baa06a1ccc44c40bc8e12c09e9bc743aca43a2/discovery.py", line 333, in _generate_examples with open(data_file, encoding="utf8") as f: File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/streaming.py", line 64, in wrapper return function(*args, use_auth_token=use_auth_token, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 369, in xopen file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open() File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 456, in open return open_files( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 288, in open_files fs, fs_token, paths = get_fs_token_paths( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 611, in get_fs_token_paths fs = filesystem(protocol, **inkwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 253, in filesystem return cls(**storage_options) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 68, in __call__ obj = super().__call__(*args, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 57, in __init__ self.zip = zipfile.ZipFile(self.fo) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1257, in __init__ self._RealGetContents() File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1320, in _RealGetContents endrec = _EndRecData(fp) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 263, in _EndRecData fpin.seek(0, 2) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 676, in seek raise ValueError("Cannot seek streaming HTTP file") ValueError: Cannot seek streaming HTTP file ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.11.0-1027-aws-x86_64-with-glibc2.31 - Python version: 3.9.6 - PyArrow version: 6.0.1
967
26
Discovery cannot be streamed anymore ## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset iterable_dataset = load_dataset("discovery", name="discovery", split="train", streaming=True) list(iterable_dataset.take(1)) ``` ## Expected results The first row of the train split. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 365, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 362, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 272, in __iter__ yield from islice(self.ex_iterable, self.n) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 79, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/discovery/542fab7a9ddc1d9726160355f7baa06a1ccc44c40bc8e12c09e9bc743aca43a2/discovery.py", line 333, in _generate_examples with open(data_file, encoding="utf8") as f: File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/streaming.py", line 64, in wrapper return function(*args, use_auth_token=use_auth_token, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 369, in xopen file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open() File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 456, in open return open_files( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 288, in open_files fs, fs_token, paths = get_fs_token_paths( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 611, in get_fs_token_paths fs = filesystem(protocol, **inkwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 253, in filesystem return cls(**storage_options) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 68, in __call__ obj = super().__call__(*args, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 57, in __init__ self.zip = zipfile.ZipFile(self.fo) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1257, in __init__ self._RealGetContents() File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1320, in _RealGetContents endrec = _EndRecData(fp) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 263, in _EndRecData fpin.seek(0, 2) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 676, in seek raise ValueError("Cannot seek streaming HTTP file") ValueError: Cannot seek streaming HTTP file ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.11.0-1027-aws-x86_64-with-glibc2.31 - Python version: 3.9.6 - PyArrow version: 6.0.1 Seems like a regression from https://github.com/huggingface/datasets/pull/2843 Or maybe it's an issue with the hosting. I don't think so, though, because https://www.dropbox.com/s/aox84z90nyyuikz/discovery.zip seems to work as expected
[ -1.1577967405319214, -0.8773195147514343, -0.6874287724494934, 1.4352542161941528, -0.11231346428394318, -1.2791805267333984, 0.14318887889385223, -0.9710866212844849, 1.5768080949783325, -0.7367047071456909, 0.2162063717842102, -1.7022005319595337, -0.09991513192653656, -0.48380476236343384, -0.673223614692688, -0.8579420447349548, -0.3017967939376831, -0.9043712019920349, 0.9824592471122742, 2.515223741531372, 1.3186218738555908, -1.2697986364364624, 2.7863821983337402, 0.6256194710731506, -0.2625114321708679, -0.9786731600761414, 0.5788639783859253, 0.031730249524116516, -1.2459145784378052, -0.4612763226032257, -0.982789158821106, 0.02275528386235237, -0.5166386961936951, -0.41858717799186707, 0.14264614880084991, 0.46767640113830566, -0.30664190649986267, -0.2827841639518738, -0.5876616835594177, -0.7698017954826355, 0.5144218802452087, -0.3231339454650879, 1.0315032005310059, -0.33873483538627625, 1.844512939453125, -0.6051690578460693, 0.41175100207328796, 0.6985647082328796, 1.2280030250549316, 0.19882434606552124, 0.03966580331325531, 0.2871831953525543, 0.2680279314517975, 0.039569977670907974, 0.5668350458145142, 1.2673542499542236, 0.5520768165588379, 0.5083122253417969, 0.6150257587432861, -2.213500499725342, 1.3101484775543213, -0.9185435175895691, 0.2281421571969986, 1.3882524967193604, -0.9137657284736633, 0.3809073269367218, -1.8223727941513062, -0.07300126552581787, 0.594216525554657, -2.3440747261047363, 0.2728607952594757, -1.304874062538147, -0.5337329506874084, 0.9477067589759827, 0.2826027572154999, -1.1905568838119507, 0.15411680936813354, -0.5440011024475098, 1.0282915830612183, 0.44069406390190125, 1.1462912559509277, -1.7337419986724854, -0.07053956389427185, -0.1710963249206543, 0.15448839962482452, -1.344666838645935, -1.6930780410766602, 0.6321927309036255, 0.5709717869758606, 0.7019915580749512, -0.11368216574192047, 1.0721269845962524, -1.0677109956741333, 0.7838852405548096, -0.925209641456604, -1.6366047859191895, -1.3509007692337036, -2.3839197158813477, -2.3000118732452393, 0.8380186557769775, -0.48723211884498596, -0.537684440612793, 2.035659074783325, -1.0318838357925415, -1.7038342952728271, 1.00484037399292, 0.305940717458725, 0.06960032880306244, 2.479315757751465, 0.24551768600940704, -0.8124133944511414, 0.4556536376476288, -0.6601606011390686, 0.8100672364234924, -0.25376787781715393, 1.3072701692581177, 0.5505685210227966, -1.0202821493148804, 1.5883418321609497, -0.4434012472629547, 0.5412607789039612, -0.6542924046516418, -0.5000786185264587, -0.8146817088127136, 0.1933738738298416, 1.8907157182693481, -0.3355399966239929, 1.5623903274536133, -0.21278518438339233, -1.5848119258880615, -1.5038238763809204, 0.8362639546394348, 0.48714402318000793, -0.8966668248176575, -0.00006201490759849548, -0.5025074481964111, 0.1904255598783493, -0.0187709741294384, 1.1117026805877686, 1.1266505718231201, 0.6976287364959717, -0.26139312982559204, -0.8647017478942871, 0.2565518915653229, -0.1545751988887787, -0.6367751955986023, -1.8190133571624756, -0.3064412474632263, 0.2398514300584793, 0.6690297722816467, -1.2360275983810425, 1.8237438201904297, 0.8859173655509949, 1.9668713808059692, 1.0105834007263184, -0.34910109639167786, 1.5170185565948486, 0.004327093251049519, 1.8405553102493286, -0.4525153934955597, 0.5913032293319702, -0.38335323333740234, -1.1380020380020142, 0.8207203149795532, -0.36750328540802, -1.977934718132019, -0.7896716594696045, -0.8592145442962646, -0.11670352518558502, -0.7328214645385742, 0.9179341793060303, -0.3127138018608093, -1.4588072299957275, 0.11427903175354004, -0.6320918798446655, 0.1494898796081543, -1.2960460186004639, 0.20933978259563446, 0.7038300037384033, -0.7315410375595093, -0.04235358163714409, -0.2812015116214752, -1.3204668760299683, -0.47314590215682983, 0.32344508171081543, 1.9938262701034546, -0.5602362751960754, 0.9826050996780396, 1.001219630241394, -0.764938473701477, 0.12131868302822113, 0.25389036536216736, -0.30701807141304016, 0.8147539496421814, -1.173371434211731, -0.3465964198112488, 1.1982133388519287, -0.26389119029045105, -0.7352302074432373, 1.4514034986495972, 0.7642340064048767, -1.1202936172485352, -0.30920565128326416, -0.18098898231983185, -0.795046329498291, -0.002802035305649042, -1.5192539691925049, -0.14421099424362183, 0.39228400588035583, -1.4604604244232178, -0.3650266230106354, -0.17999260127544403, 1.3260693550109863, -0.2118769884109497, 1.4606722593307495, -0.24670907855033875, -0.19130854308605194, -0.31604909896850586, -0.5142146944999695, 0.12091343104839325, -0.21848498284816742, -0.59162437915802, 0.2263639122247696, -0.8680467009544373, 0.28221938014030457, 1.493636131286621, 0.38667914271354675, 0.021097969263792038, 0.5063983798027039, 1.1426572799682617, 0.40136992931365967, -0.08205774426460266, -0.8776602149009705, -1.5789809226989746, 1.9865424633026123, -1.4553464651107788, 1.8927778005599976, 0.7478841543197632, -0.13126392662525177, -1.787308692932129, -1.825417399406433, 1.2428134679794312, 1.1635692119598389, 2.412076473236084, 0.5147958993911743, 0.42885085940361023, -0.6776208877563477, -0.7618588805198669, 0.41136106848716736, -0.9738303422927856, -0.6611884832382202, 0.257158488035202, 2.3117706775665283, 1.7946703433990479, -0.5690723061561584, -0.30235207080841064, -0.9087784290313721, 1.2139244079589844, -0.2862371802330017, 0.2369953691959381, 2.033642530441284, -0.2992126941680908, -1.034213900566101, 1.3498430252075195, -2.3168158531188965, 0.2901759147644043, 2.074863910675049, 0.3131564259529114, 0.0960458368062973, -1.4193814992904663, -0.6070789694786072, -0.31759658455848694, -0.3989986777305603, -1.3060301542282104, 0.550369381904602, -0.31132999062538147, -0.8415840864181519, -1.4468395709991455, 0.08234335482120514, -1.1368811130523682, -1.716943621635437, 0.2745444178581238, 1.9266960620880127, 2.158069610595703, -0.7945781350135803, 1.2917300462722778, -0.22008606791496277, 0.05139483883976936, 1.2421863079071045, 1.3354178667068481, 3.0868353843688965, 1.8626879453659058, -1.285550594329834, 0.708744466304779, -0.19671471416950226, -0.4567490518093109, 1.2042491436004639, -1.194976806640625, 1.0515042543411255, -0.23659992218017578, -1.3126330375671387, -1.1797815561294556, 1.0201430320739746, 0.4961274266242981, 0.0009673880413174629, -0.5048816800117493, 1.2398512363433838, 0.014700543135404587, 1.3484728336334229, 0.6558950543403625, -0.4248233735561371, 0.5411845445632935, -0.4606795907020569, -0.5638688206672668, 1.6176990270614624, 0.14226986467838287, -1.527889370918274, -2.335723876953125, -0.26648011803627014, -0.9023157358169556, 0.001897917129099369, -0.6466292142868042, -1.0565921068191528, 1.6209553480148315, 0.3858318030834198, -1.1525813341140747, -0.24167919158935547, -0.3265836238861084, -0.537225067615509, 2.6199965476989746, -1.242447018623352, -0.11425220966339111, -0.9898583292961121, -0.5454283952713013, 1.640729546546936, -1.194495677947998, -0.2122364044189453, -1.0007449388504028, -0.6607525944709778, -1.359766960144043, -0.49571937322616577, 0.07307381927967072, -0.9116548895835876, 0.7328077554702759, 0.17411011457443237, -1.1500486135482788, -0.244697704911232, -0.9489468336105347, 0.9901368618011475, -0.11383627355098724, 0.1749509572982788, 1.800686001777649, 0.3460749685764313, -0.4659677743911743, 0.699478805065155, 1.2329035997390747, 0.6076372265815735, -0.6977418661117554, 0.050229884684085846, -0.783072292804718, 0.2965104579925537, -1.40004301071167, 0.21399077773094177, -2.9192514419555664, 0.7081108093261719, -0.18970507383346558, -0.10138460993766785, -0.04718766734004021, -1.2522354125976562, 1.0906062126159668, 2.5712759494781494, -1.179694414138794, 0.5394114255905151, 0.4181433320045471, 1.1675026416778564, -1.6290220022201538, 0.27815064787864685, -0.5509330034255981, 2.0161449909210205, 0.15489964187145233, 1.21213698387146, -0.5086309909820557, -2.1517958641052246, 0.6687249541282654, -1.2254315614700317, -1.0604248046875, 0.8242732286453247, -0.9601818919181824, 0.3050459027290344, -1.425130844116211, -0.15894769132137299, -0.8777526617050171, -1.271554946899414, 0.771257221698761, 0.039550792425870895, 0.43998393416404724, -0.5156528949737549, 0.3819843828678131, -2.1696903705596924, -1.3916983604431152, -0.2728002667427063, -1.0610634088516235, 0.5701257586479187, -0.403816819190979, 0.621586263179779, -0.10288330912590027, 0.06487990915775299, 0.36089465022087097, 1.4065498113632202, 3.3853766918182373, 0.18733711540699005, 0.2386084347963333, -0.06632041931152344, -1.0610352754592896, 1.4526795148849487, 0.9462401270866394, -0.1532737910747528, -0.5818918943405151, -1.016708493232727, 1.3043488264083862, 2.0109200477600098, 1.1574666500091553, 0.19853897392749786, -0.9071325659751892, -0.7391418814659119, 0.0446489080786705, 0.15670128166675568, 0.4983658194541931, 0.9074124693870544, -0.05649932473897934, 0.11071336269378662, 1.4043220281600952, 1.1376802921295166, -0.3189298212528229, 0.3728657364845276, -0.9304255843162537, -0.4153393507003784, 0.5176460146903992, 0.15145277976989746, 0.007311146706342697, 0.5295341610908508, -1.0540026426315308, -0.2971488833427429, -0.3173430860042572, -0.8969612717628479, -0.6841750741004944, -0.4180550277233124, -0.3542500138282776, 1.6765758991241455, 0.02754664421081543, -0.4799160957336426, 0.07590056955814362, -0.6735029816627502, -0.1639009714126587, -1.142837405204773, 0.19428026676177979, -0.11690287292003632, -0.07938443124294281, -0.1531973034143448, 1.6712297201156616, -0.9525483846664429, -2.178110361099243, 0.13853628933429718, 0.3214781880378723, -0.3244840204715729, 0.15316687524318695, 1.7609145641326904, 0.534169614315033, 1.3940963745117188, 1.3072636127471924, 1.0552339553833008, -0.6222274303436279, -1.245665192604065, 0.7021653652191162, 0.8957647681236267, -1.3534882068634033, 0.932051420211792, -0.22056370973587036, -0.5355237126350403, 0.6254931688308716, 1.300983190536499, 0.43572741746902466, -1.9454731941223145, 0.9056249856948853, -0.9877749681472778, 0.7041714787483215, 0.7123923897743225, 0.8484264612197876, 0.21404512226581573, 0.9031743407249451, -1.2447978258132935, -1.1526957750320435, -0.6987646222114563, -0.5782893896102905, 1.8930995464324951, -0.21669401228427887, 0.5269643068313599, -0.19050034880638123, -1.2048499584197998, -0.06254789233207703, 0.8168212175369263, 0.37551939487457275, -0.3687032163143158, 0.9021403193473816, -0.692881166934967, -0.9501873850822449, -1.2961976528167725, -0.4419615566730499, -1.063503623008728, -0.8056303262710571, 1.057296872138977, 0.7046202421188354, 0.42108768224716187, 1.9011542797088623, 0.6979053020477295, 0.32349491119384766, -2.635547161102295, 0.8621684908866882, 0.30405229330062866, -0.03485048562288284, 0.8869274258613586, 0.21660684049129486, 1.1585828065872192, -0.02248549461364746, 0.550999641418457, -2.3091001510620117, 2.201488733291626, -0.18196775019168854, 0.6853118538856506, 0.03983791545033455, -0.23539982736110687, 1.0968648195266724, 0.5593519806861877, 0.5934939980506897, -1.105210781097412, 0.7954244613647461, -0.5845117568969727, 0.9901427030563354, 0.9017725586891174, -0.9502019882202148, 0.08112625777721405, 1.3820499181747437, 0.4997595548629761, -0.4335470199584961, -1.003356695175171, -0.7409254312515259, 0.9898910522460938, 1.6792913675308228, -0.014837335795164108, 0.03387827053666115, 0.9113954305648804, 0.6026436686515808, -1.1955516338348389, 0.057685595005750656, -0.6389011144638062, -0.7262762188911438, 1.7068697214126587, 2.0359749794006348, -0.09485654532909393, -0.21109063923358917, -0.7513575553894043, -1.2087904214859009, 0.737701416015625, -0.02998349629342556, 0.042894113808870316, 0.7250335216522217, -0.6836515069007874, 1.1411975622177124, 0.6306225657463074, 1.030583143234253, 0.0335867777466774, 0.2773924171924591, 0.3871421217918396, -0.3588576018810272, -1.1882215738296509, -0.3237968981266022, -1.0431804656982422, -2.6212897300720215, 0.4421701729297638, -0.26694831252098083, -1.5015852451324463, 0.12433549761772156, -1.0260146856307983, 0.9461867809295654, -0.564921498298645, -1.1505851745605469, -1.4667962789535522, 0.2987498939037323, -0.24722668528556824, 0.9176268577575684, -1.6843419075012207, -0.2774692475795746, 1.2468749284744263, 0.9481016397476196, -0.5835345387458801, 0.9283097982406616, 0.2075914442539215, 0.960746169090271, 0.8080649375915527, -0.37897446751594543, 0.5991961359977722, 0.1332574188709259, -1.3878693580627441, 0.43805113434791565, 1.2240757942199707, 0.1934935599565506, 1.4164865016937256, -0.4073823392391205, 0.07951958477497101, 0.4854893982410431, -0.5570653080940247, -0.5334707498550415, -0.4500172436237335, 0.7140212655067444, 0.05100221186876297, -1.0601725578308105, -0.18913355469703674, -0.11415745317935944, -0.26893123984336853, 0.17897702753543854, -1.4566309452056885, -0.28245991468429565, -0.37633296847343445, -0.4645370841026306, -1.3314121961593628, 0.005538472905755043, 1.290148377418518, -0.8355254530906677, -0.24673564732074738, 0.4296397864818573, 0.406002014875412, 0.5204439759254456, 0.5118953585624695, -0.8364415168762207, -0.21112200617790222, -0.3482459783554077, -0.3586606979370117, 0.27873802185058594, 1.241047739982605, -0.03774779289960861, -1.0388737916946411, 0.6405923962593079, -0.27533799409866333, 0.12166216969490051, 1.9772471189498901, -0.0008265264332294464, -0.6775588989257812, 0.31600943207740784, -0.733588457107544, 1.794653296470642, 1.6998547315597534, 1.2661166191101074, -0.10132071375846863, -0.8376366496086121, 0.5525293350219727, -0.2898062765598297, -0.34570443630218506, 0.8722214102745056, 0.38447821140289307, -0.218577578663826, -1.4537824392318726, 0.6731556057929993, 1.2562977075576782, -0.8314390778541565, -0.6653851270675659, 0.10313065350055695, -0.9130999445915222, 1.2167657613754272, 0.5181839466094971, 0.2635159492492676, 0.2919522821903229, 1.5960183143615723, 0.6748443245887756, -0.4537411332130432, 0.4971630573272705, 0.5229129791259766, -0.16262808442115784, -2.11574649810791, -1.0603899955749512, 0.3401467502117157, -0.40134531259536743, -1.4646223783493042, 1.3419286012649536, -1.0734254121780396, -0.9769620299339294, 0.5316037535667419, 0.16374459862709045, 1.375235915184021, 0.38502025604248047, 1.6937248706817627, 2.081646203994751, 0.9242740273475647, 0.32254916429519653, 1.2256019115447998, -0.06646938621997833, -0.379162460565567, 1.856726050376892, -0.4020974636077881, 0.5138964653015137, 0.926504909992218, -0.3685472011566162, -1.1670211553573608, -0.7933452725410461, -1.2219061851501465, -0.6231791377067566, 1.1056938171386719, 0.08806413412094116, -1.047519564628601, 0.1866472065448761, 1.5806400775909424, 0.14006838202476501, -0.1690867394208908, 0.6749864220619202, 0.3786841928958893, -0.7053459882736206, -0.08890797197818756, -0.9029220342636108, 0.5095100998878479, -0.1096004992723465, -0.30084508657455444, 0.18553058803081512, 0.6439593434333801, 1.3337043523788452, -0.033189550042152405, 0.14231541752815247, 1.245017170906067, -1.3518542051315308, 1.531844973564148, -0.6769737601280212, 0.255460649728775, -2.4541919231414795, 1.3695240020751953, -0.8226679563522339, 1.9357720613479614, -2.522535562515259, 0.4312576353549957, -0.5505416989326477, -0.48914116621017456, 0.2673458755016327, -0.41275620460510254, 0.15931305289268494, -0.14057666063308716, -0.9751551151275635, -0.03571691736578941, -0.7285153269767761, 0.6012542843818665, 1.1490651369094849, 1.409254550933838, -1.088040828704834, -0.30342915654182434, -1.797728419303894, -0.18265388906002045, -0.7409621477127075, 0.26683688163757324, -1.882468581199646, -0.18236400187015533, -1.9883588552474976, -2.408017873764038, -1.4548497200012207, -0.8389934301376343, 1.1135919094085693, 0.22672250866889954, -1.002892255783081, 1.177065134048462, -0.3186885714530945, -1.8157001733779907, 1.1668163537979126, -2.2584333419799805 ]
https://github.com/huggingface/datasets/issues/3677
Discovery cannot be streamed anymore
Hi @severo, thanks for reporting. Some servers do not support HTTP range requests, and those are required to stream some file formats (like ZIP in this case). Let me try to propose a workaround.
## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset iterable_dataset = load_dataset("discovery", name="discovery", split="train", streaming=True) list(iterable_dataset.take(1)) ``` ## Expected results The first row of the train split. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 365, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 362, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 272, in __iter__ yield from islice(self.ex_iterable, self.n) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 79, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/discovery/542fab7a9ddc1d9726160355f7baa06a1ccc44c40bc8e12c09e9bc743aca43a2/discovery.py", line 333, in _generate_examples with open(data_file, encoding="utf8") as f: File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/streaming.py", line 64, in wrapper return function(*args, use_auth_token=use_auth_token, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 369, in xopen file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open() File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 456, in open return open_files( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 288, in open_files fs, fs_token, paths = get_fs_token_paths( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 611, in get_fs_token_paths fs = filesystem(protocol, **inkwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 253, in filesystem return cls(**storage_options) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 68, in __call__ obj = super().__call__(*args, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 57, in __init__ self.zip = zipfile.ZipFile(self.fo) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1257, in __init__ self._RealGetContents() File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1320, in _RealGetContents endrec = _EndRecData(fp) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 263, in _EndRecData fpin.seek(0, 2) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 676, in seek raise ValueError("Cannot seek streaming HTTP file") ValueError: Cannot seek streaming HTTP file ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.11.0-1027-aws-x86_64-with-glibc2.31 - Python version: 3.9.6 - PyArrow version: 6.0.1
967
34
Discovery cannot be streamed anymore ## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset iterable_dataset = load_dataset("discovery", name="discovery", split="train", streaming=True) list(iterable_dataset.take(1)) ``` ## Expected results The first row of the train split. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 365, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 362, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 272, in __iter__ yield from islice(self.ex_iterable, self.n) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 79, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/discovery/542fab7a9ddc1d9726160355f7baa06a1ccc44c40bc8e12c09e9bc743aca43a2/discovery.py", line 333, in _generate_examples with open(data_file, encoding="utf8") as f: File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/streaming.py", line 64, in wrapper return function(*args, use_auth_token=use_auth_token, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 369, in xopen file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open() File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 456, in open return open_files( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 288, in open_files fs, fs_token, paths = get_fs_token_paths( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 611, in get_fs_token_paths fs = filesystem(protocol, **inkwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 253, in filesystem return cls(**storage_options) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 68, in __call__ obj = super().__call__(*args, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 57, in __init__ self.zip = zipfile.ZipFile(self.fo) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1257, in __init__ self._RealGetContents() File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1320, in _RealGetContents endrec = _EndRecData(fp) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 263, in _EndRecData fpin.seek(0, 2) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 676, in seek raise ValueError("Cannot seek streaming HTTP file") ValueError: Cannot seek streaming HTTP file ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.11.0-1027-aws-x86_64-with-glibc2.31 - Python version: 3.9.6 - PyArrow version: 6.0.1 Hi @severo, thanks for reporting. Some servers do not support HTTP range requests, and those are required to stream some file formats (like ZIP in this case). Let me try to propose a workaround.
[ -1.1577967405319214, -0.8773195147514343, -0.6874287724494934, 1.4352542161941528, -0.11231346428394318, -1.2791805267333984, 0.14318887889385223, -0.9710866212844849, 1.5768080949783325, -0.7367047071456909, 0.2162063717842102, -1.7022005319595337, -0.09991513192653656, -0.48380476236343384, -0.673223614692688, -0.8579420447349548, -0.3017967939376831, -0.9043712019920349, 0.9824592471122742, 2.515223741531372, 1.3186218738555908, -1.2697986364364624, 2.7863821983337402, 0.6256194710731506, -0.2625114321708679, -0.9786731600761414, 0.5788639783859253, 0.031730249524116516, -1.2459145784378052, -0.4612763226032257, -0.982789158821106, 0.02275528386235237, -0.5166386961936951, -0.41858717799186707, 0.14264614880084991, 0.46767640113830566, -0.30664190649986267, -0.2827841639518738, -0.5876616835594177, -0.7698017954826355, 0.5144218802452087, -0.3231339454650879, 1.0315032005310059, -0.33873483538627625, 1.844512939453125, -0.6051690578460693, 0.41175100207328796, 0.6985647082328796, 1.2280030250549316, 0.19882434606552124, 0.03966580331325531, 0.2871831953525543, 0.2680279314517975, 0.039569977670907974, 0.5668350458145142, 1.2673542499542236, 0.5520768165588379, 0.5083122253417969, 0.6150257587432861, -2.213500499725342, 1.3101484775543213, -0.9185435175895691, 0.2281421571969986, 1.3882524967193604, -0.9137657284736633, 0.3809073269367218, -1.8223727941513062, -0.07300126552581787, 0.594216525554657, -2.3440747261047363, 0.2728607952594757, -1.304874062538147, -0.5337329506874084, 0.9477067589759827, 0.2826027572154999, -1.1905568838119507, 0.15411680936813354, -0.5440011024475098, 1.0282915830612183, 0.44069406390190125, 1.1462912559509277, -1.7337419986724854, -0.07053956389427185, -0.1710963249206543, 0.15448839962482452, -1.344666838645935, -1.6930780410766602, 0.6321927309036255, 0.5709717869758606, 0.7019915580749512, -0.11368216574192047, 1.0721269845962524, -1.0677109956741333, 0.7838852405548096, -0.925209641456604, -1.6366047859191895, -1.3509007692337036, -2.3839197158813477, -2.3000118732452393, 0.8380186557769775, -0.48723211884498596, -0.537684440612793, 2.035659074783325, -1.0318838357925415, -1.7038342952728271, 1.00484037399292, 0.305940717458725, 0.06960032880306244, 2.479315757751465, 0.24551768600940704, -0.8124133944511414, 0.4556536376476288, -0.6601606011390686, 0.8100672364234924, -0.25376787781715393, 1.3072701692581177, 0.5505685210227966, -1.0202821493148804, 1.5883418321609497, -0.4434012472629547, 0.5412607789039612, -0.6542924046516418, -0.5000786185264587, -0.8146817088127136, 0.1933738738298416, 1.8907157182693481, -0.3355399966239929, 1.5623903274536133, -0.21278518438339233, -1.5848119258880615, -1.5038238763809204, 0.8362639546394348, 0.48714402318000793, -0.8966668248176575, -0.00006201490759849548, -0.5025074481964111, 0.1904255598783493, -0.0187709741294384, 1.1117026805877686, 1.1266505718231201, 0.6976287364959717, -0.26139312982559204, -0.8647017478942871, 0.2565518915653229, -0.1545751988887787, -0.6367751955986023, -1.8190133571624756, -0.3064412474632263, 0.2398514300584793, 0.6690297722816467, -1.2360275983810425, 1.8237438201904297, 0.8859173655509949, 1.9668713808059692, 1.0105834007263184, -0.34910109639167786, 1.5170185565948486, 0.004327093251049519, 1.8405553102493286, -0.4525153934955597, 0.5913032293319702, -0.38335323333740234, -1.1380020380020142, 0.8207203149795532, -0.36750328540802, -1.977934718132019, -0.7896716594696045, -0.8592145442962646, -0.11670352518558502, -0.7328214645385742, 0.9179341793060303, -0.3127138018608093, -1.4588072299957275, 0.11427903175354004, -0.6320918798446655, 0.1494898796081543, -1.2960460186004639, 0.20933978259563446, 0.7038300037384033, -0.7315410375595093, -0.04235358163714409, -0.2812015116214752, -1.3204668760299683, -0.47314590215682983, 0.32344508171081543, 1.9938262701034546, -0.5602362751960754, 0.9826050996780396, 1.001219630241394, -0.764938473701477, 0.12131868302822113, 0.25389036536216736, -0.30701807141304016, 0.8147539496421814, -1.173371434211731, -0.3465964198112488, 1.1982133388519287, -0.26389119029045105, -0.7352302074432373, 1.4514034986495972, 0.7642340064048767, -1.1202936172485352, -0.30920565128326416, -0.18098898231983185, -0.795046329498291, -0.002802035305649042, -1.5192539691925049, -0.14421099424362183, 0.39228400588035583, -1.4604604244232178, -0.3650266230106354, -0.17999260127544403, 1.3260693550109863, -0.2118769884109497, 1.4606722593307495, -0.24670907855033875, -0.19130854308605194, -0.31604909896850586, -0.5142146944999695, 0.12091343104839325, -0.21848498284816742, -0.59162437915802, 0.2263639122247696, -0.8680467009544373, 0.28221938014030457, 1.493636131286621, 0.38667914271354675, 0.021097969263792038, 0.5063983798027039, 1.1426572799682617, 0.40136992931365967, -0.08205774426460266, -0.8776602149009705, -1.5789809226989746, 1.9865424633026123, -1.4553464651107788, 1.8927778005599976, 0.7478841543197632, -0.13126392662525177, -1.787308692932129, -1.825417399406433, 1.2428134679794312, 1.1635692119598389, 2.412076473236084, 0.5147958993911743, 0.42885085940361023, -0.6776208877563477, -0.7618588805198669, 0.41136106848716736, -0.9738303422927856, -0.6611884832382202, 0.257158488035202, 2.3117706775665283, 1.7946703433990479, -0.5690723061561584, -0.30235207080841064, -0.9087784290313721, 1.2139244079589844, -0.2862371802330017, 0.2369953691959381, 2.033642530441284, -0.2992126941680908, -1.034213900566101, 1.3498430252075195, -2.3168158531188965, 0.2901759147644043, 2.074863910675049, 0.3131564259529114, 0.0960458368062973, -1.4193814992904663, -0.6070789694786072, -0.31759658455848694, -0.3989986777305603, -1.3060301542282104, 0.550369381904602, -0.31132999062538147, -0.8415840864181519, -1.4468395709991455, 0.08234335482120514, -1.1368811130523682, -1.716943621635437, 0.2745444178581238, 1.9266960620880127, 2.158069610595703, -0.7945781350135803, 1.2917300462722778, -0.22008606791496277, 0.05139483883976936, 1.2421863079071045, 1.3354178667068481, 3.0868353843688965, 1.8626879453659058, -1.285550594329834, 0.708744466304779, -0.19671471416950226, -0.4567490518093109, 1.2042491436004639, -1.194976806640625, 1.0515042543411255, -0.23659992218017578, -1.3126330375671387, -1.1797815561294556, 1.0201430320739746, 0.4961274266242981, 0.0009673880413174629, -0.5048816800117493, 1.2398512363433838, 0.014700543135404587, 1.3484728336334229, 0.6558950543403625, -0.4248233735561371, 0.5411845445632935, -0.4606795907020569, -0.5638688206672668, 1.6176990270614624, 0.14226986467838287, -1.527889370918274, -2.335723876953125, -0.26648011803627014, -0.9023157358169556, 0.001897917129099369, -0.6466292142868042, -1.0565921068191528, 1.6209553480148315, 0.3858318030834198, -1.1525813341140747, -0.24167919158935547, -0.3265836238861084, -0.537225067615509, 2.6199965476989746, -1.242447018623352, -0.11425220966339111, -0.9898583292961121, -0.5454283952713013, 1.640729546546936, -1.194495677947998, -0.2122364044189453, -1.0007449388504028, -0.6607525944709778, -1.359766960144043, -0.49571937322616577, 0.07307381927967072, -0.9116548895835876, 0.7328077554702759, 0.17411011457443237, -1.1500486135482788, -0.244697704911232, -0.9489468336105347, 0.9901368618011475, -0.11383627355098724, 0.1749509572982788, 1.800686001777649, 0.3460749685764313, -0.4659677743911743, 0.699478805065155, 1.2329035997390747, 0.6076372265815735, -0.6977418661117554, 0.050229884684085846, -0.783072292804718, 0.2965104579925537, -1.40004301071167, 0.21399077773094177, -2.9192514419555664, 0.7081108093261719, -0.18970507383346558, -0.10138460993766785, -0.04718766734004021, -1.2522354125976562, 1.0906062126159668, 2.5712759494781494, -1.179694414138794, 0.5394114255905151, 0.4181433320045471, 1.1675026416778564, -1.6290220022201538, 0.27815064787864685, -0.5509330034255981, 2.0161449909210205, 0.15489964187145233, 1.21213698387146, -0.5086309909820557, -2.1517958641052246, 0.6687249541282654, -1.2254315614700317, -1.0604248046875, 0.8242732286453247, -0.9601818919181824, 0.3050459027290344, -1.425130844116211, -0.15894769132137299, -0.8777526617050171, -1.271554946899414, 0.771257221698761, 0.039550792425870895, 0.43998393416404724, -0.5156528949737549, 0.3819843828678131, -2.1696903705596924, -1.3916983604431152, -0.2728002667427063, -1.0610634088516235, 0.5701257586479187, -0.403816819190979, 0.621586263179779, -0.10288330912590027, 0.06487990915775299, 0.36089465022087097, 1.4065498113632202, 3.3853766918182373, 0.18733711540699005, 0.2386084347963333, -0.06632041931152344, -1.0610352754592896, 1.4526795148849487, 0.9462401270866394, -0.1532737910747528, -0.5818918943405151, -1.016708493232727, 1.3043488264083862, 2.0109200477600098, 1.1574666500091553, 0.19853897392749786, -0.9071325659751892, -0.7391418814659119, 0.0446489080786705, 0.15670128166675568, 0.4983658194541931, 0.9074124693870544, -0.05649932473897934, 0.11071336269378662, 1.4043220281600952, 1.1376802921295166, -0.3189298212528229, 0.3728657364845276, -0.9304255843162537, -0.4153393507003784, 0.5176460146903992, 0.15145277976989746, 0.007311146706342697, 0.5295341610908508, -1.0540026426315308, -0.2971488833427429, -0.3173430860042572, -0.8969612717628479, -0.6841750741004944, -0.4180550277233124, -0.3542500138282776, 1.6765758991241455, 0.02754664421081543, -0.4799160957336426, 0.07590056955814362, -0.6735029816627502, -0.1639009714126587, -1.142837405204773, 0.19428026676177979, -0.11690287292003632, -0.07938443124294281, -0.1531973034143448, 1.6712297201156616, -0.9525483846664429, -2.178110361099243, 0.13853628933429718, 0.3214781880378723, -0.3244840204715729, 0.15316687524318695, 1.7609145641326904, 0.534169614315033, 1.3940963745117188, 1.3072636127471924, 1.0552339553833008, -0.6222274303436279, -1.245665192604065, 0.7021653652191162, 0.8957647681236267, -1.3534882068634033, 0.932051420211792, -0.22056370973587036, -0.5355237126350403, 0.6254931688308716, 1.300983190536499, 0.43572741746902466, -1.9454731941223145, 0.9056249856948853, -0.9877749681472778, 0.7041714787483215, 0.7123923897743225, 0.8484264612197876, 0.21404512226581573, 0.9031743407249451, -1.2447978258132935, -1.1526957750320435, -0.6987646222114563, -0.5782893896102905, 1.8930995464324951, -0.21669401228427887, 0.5269643068313599, -0.19050034880638123, -1.2048499584197998, -0.06254789233207703, 0.8168212175369263, 0.37551939487457275, -0.3687032163143158, 0.9021403193473816, -0.692881166934967, -0.9501873850822449, -1.2961976528167725, -0.4419615566730499, -1.063503623008728, -0.8056303262710571, 1.057296872138977, 0.7046202421188354, 0.42108768224716187, 1.9011542797088623, 0.6979053020477295, 0.32349491119384766, -2.635547161102295, 0.8621684908866882, 0.30405229330062866, -0.03485048562288284, 0.8869274258613586, 0.21660684049129486, 1.1585828065872192, -0.02248549461364746, 0.550999641418457, -2.3091001510620117, 2.201488733291626, -0.18196775019168854, 0.6853118538856506, 0.03983791545033455, -0.23539982736110687, 1.0968648195266724, 0.5593519806861877, 0.5934939980506897, -1.105210781097412, 0.7954244613647461, -0.5845117568969727, 0.9901427030563354, 0.9017725586891174, -0.9502019882202148, 0.08112625777721405, 1.3820499181747437, 0.4997595548629761, -0.4335470199584961, -1.003356695175171, -0.7409254312515259, 0.9898910522460938, 1.6792913675308228, -0.014837335795164108, 0.03387827053666115, 0.9113954305648804, 0.6026436686515808, -1.1955516338348389, 0.057685595005750656, -0.6389011144638062, -0.7262762188911438, 1.7068697214126587, 2.0359749794006348, -0.09485654532909393, -0.21109063923358917, -0.7513575553894043, -1.2087904214859009, 0.737701416015625, -0.02998349629342556, 0.042894113808870316, 0.7250335216522217, -0.6836515069007874, 1.1411975622177124, 0.6306225657463074, 1.030583143234253, 0.0335867777466774, 0.2773924171924591, 0.3871421217918396, -0.3588576018810272, -1.1882215738296509, -0.3237968981266022, -1.0431804656982422, -2.6212897300720215, 0.4421701729297638, -0.26694831252098083, -1.5015852451324463, 0.12433549761772156, -1.0260146856307983, 0.9461867809295654, -0.564921498298645, -1.1505851745605469, -1.4667962789535522, 0.2987498939037323, -0.24722668528556824, 0.9176268577575684, -1.6843419075012207, -0.2774692475795746, 1.2468749284744263, 0.9481016397476196, -0.5835345387458801, 0.9283097982406616, 0.2075914442539215, 0.960746169090271, 0.8080649375915527, -0.37897446751594543, 0.5991961359977722, 0.1332574188709259, -1.3878693580627441, 0.43805113434791565, 1.2240757942199707, 0.1934935599565506, 1.4164865016937256, -0.4073823392391205, 0.07951958477497101, 0.4854893982410431, -0.5570653080940247, -0.5334707498550415, -0.4500172436237335, 0.7140212655067444, 0.05100221186876297, -1.0601725578308105, -0.18913355469703674, -0.11415745317935944, -0.26893123984336853, 0.17897702753543854, -1.4566309452056885, -0.28245991468429565, -0.37633296847343445, -0.4645370841026306, -1.3314121961593628, 0.005538472905755043, 1.290148377418518, -0.8355254530906677, -0.24673564732074738, 0.4296397864818573, 0.406002014875412, 0.5204439759254456, 0.5118953585624695, -0.8364415168762207, -0.21112200617790222, -0.3482459783554077, -0.3586606979370117, 0.27873802185058594, 1.241047739982605, -0.03774779289960861, -1.0388737916946411, 0.6405923962593079, -0.27533799409866333, 0.12166216969490051, 1.9772471189498901, -0.0008265264332294464, -0.6775588989257812, 0.31600943207740784, -0.733588457107544, 1.794653296470642, 1.6998547315597534, 1.2661166191101074, -0.10132071375846863, -0.8376366496086121, 0.5525293350219727, -0.2898062765598297, -0.34570443630218506, 0.8722214102745056, 0.38447821140289307, -0.218577578663826, -1.4537824392318726, 0.6731556057929993, 1.2562977075576782, -0.8314390778541565, -0.6653851270675659, 0.10313065350055695, -0.9130999445915222, 1.2167657613754272, 0.5181839466094971, 0.2635159492492676, 0.2919522821903229, 1.5960183143615723, 0.6748443245887756, -0.4537411332130432, 0.4971630573272705, 0.5229129791259766, -0.16262808442115784, -2.11574649810791, -1.0603899955749512, 0.3401467502117157, -0.40134531259536743, -1.4646223783493042, 1.3419286012649536, -1.0734254121780396, -0.9769620299339294, 0.5316037535667419, 0.16374459862709045, 1.375235915184021, 0.38502025604248047, 1.6937248706817627, 2.081646203994751, 0.9242740273475647, 0.32254916429519653, 1.2256019115447998, -0.06646938621997833, -0.379162460565567, 1.856726050376892, -0.4020974636077881, 0.5138964653015137, 0.926504909992218, -0.3685472011566162, -1.1670211553573608, -0.7933452725410461, -1.2219061851501465, -0.6231791377067566, 1.1056938171386719, 0.08806413412094116, -1.047519564628601, 0.1866472065448761, 1.5806400775909424, 0.14006838202476501, -0.1690867394208908, 0.6749864220619202, 0.3786841928958893, -0.7053459882736206, -0.08890797197818756, -0.9029220342636108, 0.5095100998878479, -0.1096004992723465, -0.30084508657455444, 0.18553058803081512, 0.6439593434333801, 1.3337043523788452, -0.033189550042152405, 0.14231541752815247, 1.245017170906067, -1.3518542051315308, 1.531844973564148, -0.6769737601280212, 0.255460649728775, -2.4541919231414795, 1.3695240020751953, -0.8226679563522339, 1.9357720613479614, -2.522535562515259, 0.4312576353549957, -0.5505416989326477, -0.48914116621017456, 0.2673458755016327, -0.41275620460510254, 0.15931305289268494, -0.14057666063308716, -0.9751551151275635, -0.03571691736578941, -0.7285153269767761, 0.6012542843818665, 1.1490651369094849, 1.409254550933838, -1.088040828704834, -0.30342915654182434, -1.797728419303894, -0.18265388906002045, -0.7409621477127075, 0.26683688163757324, -1.882468581199646, -0.18236400187015533, -1.9883588552474976, -2.408017873764038, -1.4548497200012207, -0.8389934301376343, 1.1135919094085693, 0.22672250866889954, -1.002892255783081, 1.177065134048462, -0.3186885714530945, -1.8157001733779907, 1.1668163537979126, -2.2584333419799805 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
It looks like this is because of this behavior in pyarrow: ```python import pyarrow as pa arr = pa.array([None, [0]]) reconstructed_arr = pa.ListArray.from_arrays(arr.offsets, arr.values) print(reconstructed_arr.to_pylist()) # [[], [0]] ``` It seems that `arr.offsets` can reconstruct the array properly, but an offsets array with null values can: ```python fixed_offsets = pa.array([None, 0, 1]) fixed_arr = pa.ListArray.from_arrays(fixed_offsets, arr.values) print(fixed_arr.to_pylist()) # [None, [0]] print(arr.offsets.to_pylist()) # [0, 0, 1] print(fixed_offsets.to_pylist()) # [None, 0, 1] ``` EDIT: this is because `arr.offsets` is not enough to reconstruct the array, we also need the validity bitmap
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
968
89
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger It looks like this is because of this behavior in pyarrow: ```python import pyarrow as pa arr = pa.array([None, [0]]) reconstructed_arr = pa.ListArray.from_arrays(arr.offsets, arr.values) print(reconstructed_arr.to_pylist()) # [[], [0]] ``` It seems that `arr.offsets` can reconstruct the array properly, but an offsets array with null values can: ```python fixed_offsets = pa.array([None, 0, 1]) fixed_arr = pa.ListArray.from_arrays(fixed_offsets, arr.values) print(fixed_arr.to_pylist()) # [None, [0]] print(arr.offsets.to_pylist()) # [0, 0, 1] print(fixed_offsets.to_pylist()) # [None, 0, 1] ``` EDIT: this is because `arr.offsets` is not enough to reconstruct the array, we also need the validity bitmap
[ -1.2000926733016968, -0.8267972469329834, -0.7819049954414368, 1.647674560546875, -0.043543845415115356, -1.2201114892959595, 0.17466960847377777, -1.070904016494751, 1.8123843669891357, -0.8013801574707031, 0.3766501247882843, -1.6294846534729004, 0.09186530858278275, -0.67696213722229, -0.8518049716949463, -0.8145517110824585, -0.3629455864429474, -0.7126051783561707, 1.07233464717865, 2.470313549041748, 1.254839539527893, -1.3352007865905762, 2.7682197093963623, 0.7628793716430664, -0.2147170454263687, -1.0297536849975586, 0.4652417004108429, -0.0971931517124176, -1.3431830406188965, -0.5442591309547424, -0.9357119798660278, -0.08789064735174179, -0.49825361371040344, -0.5796290040016174, -0.0458931028842926, 0.4346857964992523, -0.29930511116981506, -0.43026435375213623, -0.5037418603897095, -0.9000962972640991, 0.32171040773391724, -0.33252689242362976, 0.9486913084983826, -0.17131516337394714, 1.746785044670105, -0.681772768497467, 0.4534687101840973, 0.6305002570152283, 1.3743399381637573, 0.21263842284679413, -0.027432827278971672, 0.41248857975006104, 0.3982812166213989, -0.07857728749513626, 0.6198561787605286, 1.1942764520645142, 0.7661324143409729, 0.4093347489833832, 0.9120027422904968, -2.24216628074646, 1.2523518800735474, -1.1067143678665161, 0.346526175737381, 1.20503568649292, -0.8745636940002441, 0.26836636662483215, -1.6412076950073242, -0.12663204967975616, 0.6467511653900146, -2.3079617023468018, 0.24961811304092407, -1.3906038999557495, -0.4991656243801117, 0.9227643609046936, 0.3843000531196594, -1.3677477836608887, 0.12736651301383972, -0.37763524055480957, 1.0407326221466064, 0.35954955220222473, 1.0114057064056396, -1.7376203536987305, -0.061815857887268066, -0.30540844798088074, 0.10359250754117966, -1.188029170036316, -1.5512595176696777, 0.6256429553031921, 0.634169340133667, 0.5766610503196716, -0.1585727334022522, 1.0932481288909912, -1.1138744354248047, 0.7549550533294678, -1.1123085021972656, -1.837842583656311, -1.3893049955368042, -2.235924482345581, -2.1429784297943115, 0.6394869089126587, -0.46399545669555664, -0.6346694827079773, 2.0719594955444336, -0.9826136827468872, -1.703229308128357, 1.1126075983047485, 0.36152851581573486, -0.02528136596083641, 2.4742462635040283, 0.1858912855386734, -0.675290584564209, 0.50660640001297, -0.7687241435050964, 0.8059466481208801, -0.3742038607597351, 1.3178263902664185, 0.37051326036453247, -1.0723313093185425, 1.6412171125411987, -0.2679627537727356, 0.479378342628479, -0.8041687607765198, -0.45242127776145935, -0.6427770853042603, 0.2971833348274231, 1.8938406705856323, -0.3391742408275604, 1.427763819694519, -0.3059672713279724, -1.4799671173095703, -1.5745296478271484, 0.8733236193656921, 0.4998124837875366, -0.7736650109291077, 0.050783492624759674, -0.4167414903640747, 0.17723394930362701, -0.04096377268433571, 1.3109155893325806, 1.2431234121322632, 0.6124250888824463, -0.3095812499523163, -0.7964329719543457, 0.15237188339233398, -0.07047144323587418, -0.8429746031761169, -1.7117030620574951, -0.3024158179759979, 0.15345492959022522, 0.708062469959259, -1.212091326713562, 1.8101603984832764, 0.8288188576698303, 1.9291554689407349, 1.1238454580307007, -0.42465585470199585, 1.5181280374526978, 0.09861090779304504, 1.7833733558654785, -0.5571366548538208, 0.6382668614387512, -0.4699244797229767, -1.1608338356018066, 0.9808633923530579, -0.40338775515556335, -2.005260467529297, -0.6568068861961365, -0.6371815800666809, -0.14508570730686188, -0.7764745354652405, 0.9498192667961121, -0.34816914796829224, -1.3855618238449097, 0.2218884527683258, -0.8432623147964478, 0.08587998151779175, -1.147492527961731, 0.30504393577575684, 0.6878048777580261, -0.5442034602165222, 0.1528843194246292, -0.23487739264965057, -1.3421385288238525, -0.4939568042755127, 0.21124382317066193, 1.8183741569519043, -0.7509577870368958, 0.9038367867469788, 1.0688512325286865, -0.6473662853240967, -0.14824208617210388, 0.3962514400482178, -0.3415432870388031, 0.9103207588195801, -0.9838634729385376, -0.5875862836837769, 1.1770038604736328, -0.05623168498277664, -0.6561592817306519, 1.5106399059295654, 0.7214647531509399, -0.9612091183662415, -0.24991288781166077, -0.01315397024154663, -0.9101639986038208, 0.19683589041233063, -1.703594446182251, -0.15044833719730377, 0.591110110282898, -1.5620157718658447, -0.42581984400749207, -0.16270631551742554, 1.3059735298156738, -0.2341485321521759, 1.4025020599365234, -0.2808479368686676, -0.22083547711372375, -0.2775515913963318, -0.361331969499588, 0.03843358904123306, -0.17305675148963928, -0.6374949812889099, 0.26586589217185974, -0.654458224773407, 0.48911553621292114, 1.4205749034881592, 0.2759455740451813, 0.15319444239139557, 0.47066840529441833, 1.1674236059188843, 0.34270262718200684, -0.037537477910518646, -0.8644102811813354, -1.6106677055358887, 2.0174360275268555, -1.491007685661316, 2.0857489109039307, 0.8380284309387207, -0.014434072189033031, -1.6581496000289917, -1.8818633556365967, 1.4516208171844482, 1.0862319469451904, 2.2554264068603516, 0.5886259078979492, 0.4021371006965637, -0.7452331185340881, -0.6195425987243652, 0.2428935170173645, -0.9890450835227966, -0.6889899969100952, 0.15242978930473328, 2.4915926456451416, 1.779862403869629, -0.3431030511856079, -0.15919581055641174, -1.0020275115966797, 1.4737492799758911, -0.27753913402557373, 0.1939360648393631, 1.9472938776016235, -0.18904709815979004, -1.0641462802886963, 1.2198529243469238, -2.3761277198791504, 0.04745413362979889, 2.0019562244415283, 0.20762939751148224, 0.06678067147731781, -1.3510358333587646, -0.5832880735397339, -0.4059935212135315, -0.4523989260196686, -1.240770936012268, 0.5583924651145935, -0.21558856964111328, -0.7859130501747131, -1.40306556224823, 0.16163712739944458, -1.1029562950134277, -1.6270917654037476, 0.16567502915859222, 1.9032260179519653, 1.9587067365646362, -0.6825695037841797, 1.6911084651947021, -0.38090595602989197, 0.19286340475082397, 1.1409449577331543, 1.2505247592926025, 3.1195123195648193, 1.9205509424209595, -1.27803373336792, 0.6207398176193237, -0.1339426040649414, -0.5407524704933167, 1.1850489377975464, -1.2030998468399048, 1.291054368019104, -0.06016352027654648, -1.3614710569381714, -1.288450837135315, 1.013216495513916, 0.441897988319397, -0.02811499498784542, -0.5610045790672302, 1.1560211181640625, 0.03472554683685303, 1.298660159111023, 0.600824773311615, -0.15269455313682556, 0.5943414568901062, -0.38310733437538147, -0.4591744542121887, 1.5378004312515259, 0.1527971774339676, -1.3831440210342407, -2.34533953666687, -0.08075157552957535, -0.8864282369613647, 0.168193519115448, -0.7218987941741943, -1.0997285842895508, 1.8135613203048706, 0.29793354868888855, -1.3269296884536743, -0.20951448380947113, -0.2736169993877411, -0.6064929366111755, 2.7578928470611572, -1.286103367805481, -0.370587557554245, -1.111690640449524, -0.5858234167098999, 1.616706132888794, -1.174283742904663, -0.15745851397514343, -0.9664120078086853, -0.44490373134613037, -1.1681300401687622, -0.5676000714302063, 0.014093339443206787, -0.9595344662666321, 0.7345283627510071, 0.10563545674085617, -1.248095154762268, -0.43645939230918884, -0.8407983183860779, 0.9073230028152466, -0.1919436752796173, 0.13125990331172943, 1.96695876121521, 0.4403781592845917, -0.42805516719818115, 0.8259102702140808, 1.1517974138259888, 0.7488365173339844, -0.5383039712905884, 0.29993221163749695, -0.5889546275138855, 0.370100736618042, -1.3140177726745605, 0.2799820005893707, -2.804658889770508, 0.6296577453613281, 0.04135923832654953, -0.02375180646777153, 0.08707064390182495, -1.2498449087142944, 1.0976313352584839, 2.5912132263183594, -1.0970147848129272, 0.4289616346359253, 0.22844833135604858, 1.2591835260391235, -1.6311194896697998, 0.23307031393051147, -0.4052032232284546, 2.1676948070526123, 0.14982080459594727, 1.1573537588119507, -0.40549829602241516, -2.313746213912964, 0.6434647440910339, -1.3595802783966064, -1.0969016551971436, 0.7653416395187378, -0.868361234664917, 0.1686759889125824, -1.3576639890670776, -0.1826668232679367, -0.8749091029167175, -1.0663292407989502, 0.6854012608528137, 0.12832944095134735, 0.40987277030944824, -0.6207607388496399, 0.29135677218437195, -2.1545190811157227, -1.3436424732208252, -0.12260840088129044, -0.9615058302879333, 0.564210832118988, -0.33077991008758545, 0.6682338118553162, -0.22091801464557648, -0.15456701815128326, 0.2852940261363983, 1.4726111888885498, 3.4047939777374268, 0.30118414759635925, 0.45702114701271057, -0.3204387426376343, -0.8799262046813965, 1.3247276544570923, 0.8743234872817993, -0.17359469830989838, -0.5663890242576599, -1.0002652406692505, 1.3012983798980713, 1.9177720546722412, 0.9714920520782471, -0.009642325341701508, -0.844064474105835, -0.8391448259353638, -0.07452021539211273, 0.23447264730930328, 0.32202693819999695, 0.8427528738975525, 0.19183796644210815, 0.008496161550283432, 1.3551082611083984, 1.1983423233032227, -0.5144128799438477, 0.43324822187423706, -0.8491529822349548, -0.40936776995658875, 0.504977822303772, 0.2755590081214905, -0.07475871592760086, 0.3738402724266052, -1.0245673656463623, -0.2929750680923462, -0.39971280097961426, -0.7892575860023499, -0.749961793422699, -0.26137667894363403, -0.35536500811576843, 1.6432477235794067, -0.016922183334827423, -0.5010073781013489, 0.08424318581819534, -0.73279869556427, -0.03663471341133118, -1.06261146068573, 0.24471935629844666, -0.1093786284327507, -0.12516914308071136, -0.11765424907207489, 1.7832801342010498, -0.8998550176620483, -1.9572809934616089, 0.19034478068351746, 0.15810933709144592, -0.3348289430141449, 0.3333396315574646, 1.6788321733474731, 0.6142746806144714, 1.4665427207946777, 1.4264341592788696, 0.9009214639663696, -0.7228915691375732, -1.3329195976257324, 0.597903311252594, 1.0395084619522095, -1.351204514503479, 0.9284299612045288, -0.005219458602368832, -0.464586079120636, 0.6157082319259644, 1.3599079847335815, 0.49387168884277344, -2.102144241333008, 0.7548987865447998, -0.9035263657569885, 0.8095182776451111, 0.7504804134368896, 0.5682262182235718, 0.32035693526268005, 0.7274651527404785, -1.2302484512329102, -1.2355374097824097, -0.7012302279472351, -0.69426029920578, 1.8752928972244263, -0.25733834505081177, 0.6540786623954773, -0.19224172830581665, -1.4094816446304321, -0.10835178196430206, 0.5383409857749939, 0.41530904173851013, -0.5462377071380615, 0.7442912459373474, -0.6752781271934509, -1.088191032409668, -1.2496144771575928, -0.5313093662261963, -1.0330967903137207, -0.976182222366333, 1.0503464937210083, 0.8679433465003967, 0.4074912965297699, 1.9152562618255615, 0.6270626187324524, 0.16913753747940063, -2.4671409130096436, 0.8180227279663086, 0.3708733022212982, -0.16604959964752197, 0.7443851828575134, 0.4488375186920166, 1.0131784677505493, -0.05563599616289139, 0.5920190215110779, -2.43587589263916, 2.2850921154022217, -0.1893998682498932, 0.6982913017272949, 0.0003168834373354912, -0.1073697954416275, 1.048736572265625, 0.6011374592781067, 0.5290511846542358, -0.9391761422157288, 0.48057204484939575, -0.6287693381309509, 1.3962947130203247, 0.8420408964157104, -0.7172451615333557, -0.040208131074905396, 1.3812875747680664, 0.3935512900352478, -0.590048611164093, -0.9229608178138733, -0.9612369537353516, 0.8408738970756531, 1.6333165168762207, 0.007996328175067902, -0.04285816848278046, 0.8632368445396423, 0.6937040090560913, -1.2691010236740112, 0.06894292682409286, -0.679412305355072, -0.8304170370101929, 1.6370341777801514, 2.151400327682495, -0.3471299409866333, -0.09512834995985031, -0.6807880401611328, -1.1535075902938843, 0.7790266275405884, -0.14334677159786224, 0.07111591845750809, 0.636486828327179, -0.5678533911705017, 1.0483119487762451, 0.8439139723777771, 0.8534969091415405, 0.2730399966239929, 0.34043383598327637, 0.25342729687690735, -0.35667240619659424, -1.2138363122940063, -0.2593703269958496, -1.065945029258728, -2.5377628803253174, 0.34997081756591797, -0.27720126509666443, -1.3488215208053589, 0.010182015597820282, -1.0602349042892456, 0.8058714866638184, -0.555635929107666, -1.0291980504989624, -1.4538319110870361, 0.2558954060077667, 0.06160389631986618, 0.9438215494155884, -1.616322636604309, -0.017465628683567047, 1.1561229228973389, 0.8748413920402527, -0.6782246828079224, 0.9663509726524353, 0.23917102813720703, 1.1410281658172607, 0.9773892760276794, -0.3466995358467102, 0.5381032824516296, -0.06309714168310165, -1.3589767217636108, 0.5295420289039612, 1.1735583543777466, 0.11506518721580505, 1.4973872900009155, -0.510125994682312, -0.07929956167936325, 0.3658214211463928, -0.4995112419128418, -0.4121842682361603, -0.6399645209312439, 0.6747170686721802, 0.13368508219718933, -0.8225530982017517, -0.05395208299160004, 0.001749555580317974, -0.3091421127319336, 0.15675391256809235, -1.542385458946228, -0.026616839691996574, -0.378801167011261, -0.6646342873573303, -1.2272640466690063, -0.11022892594337463, 1.3754838705062866, -0.7965198159217834, -0.19927795231342316, 0.38956618309020996, 0.2932175099849701, 0.4931516647338867, 0.7890222072601318, -0.5778478980064392, -0.49539434909820557, -0.2361447960138321, -0.39805370569229126, 0.4310518503189087, 1.444632649421692, -0.09312145411968231, -0.8648450374603271, 0.6243531703948975, -0.4245659410953522, -0.0016094222664833069, 1.9417469501495361, 0.024660730734467506, -0.8261280655860901, 0.33738675713539124, -0.679366409778595, 1.992817997932434, 1.738274335861206, 1.246386170387268, -0.15257816016674042, -1.0600616931915283, 0.7467952370643616, -0.3793758749961853, -0.4684469997882843, 0.7756423950195312, 0.20645025372505188, -0.23422794044017792, -1.4312063455581665, 0.6928102374076843, 1.3278765678405762, -0.8790007829666138, -0.8836045265197754, 0.09200786054134369, -0.8166308403015137, 1.0737991333007812, 0.6567245125770569, 0.2668476402759552, 0.30906468629837036, 1.5768612623214722, 0.8313413858413696, -0.492789089679718, 0.5301527380943298, 0.49283939599990845, -0.06331997364759445, -2.1992340087890625, -1.1659367084503174, 0.22404664754867554, -0.38928845524787903, -1.7169032096862793, 1.3290176391601562, -1.1846157312393188, -0.9080106019973755, 0.5587611794471741, 0.056371062994003296, 1.3458240032196045, 0.276316374540329, 1.5223333835601807, 2.0640087127685547, 0.7295188903808594, 0.3616868257522583, 1.2589447498321533, -0.22352999448776245, -0.5063508749008179, 1.7403208017349243, -0.5016205906867981, 0.5884101390838623, 1.0098459720611572, -0.2320803999900818, -1.1656779050827026, -0.7511627078056335, -1.2488478422164917, -0.7715857625007629, 1.2273164987564087, 0.042072951793670654, -1.1800296306610107, 0.27189889550209045, 1.557617425918579, 0.015482092276215553, -0.3622693419456482, 0.5777038335800171, 0.42171183228492737, -0.7730254530906677, -0.1070532500743866, -0.8554500937461853, 0.5458622574806213, -0.09895320981740952, -0.2747328579425812, 0.4226978123188019, 0.5297321677207947, 1.3308783769607544, 0.03340794891119003, 0.10516238212585449, 1.0577551126480103, -1.5178143978118896, 1.40349543094635, -0.6701920628547668, 0.33318448066711426, -2.3518269062042236, 1.4783828258514404, -0.7965201735496521, 1.9163211584091187, -2.737919807434082, 0.44092634320259094, -0.49739179015159607, -0.5091928839683533, 0.2154625803232193, -0.18967564404010773, 0.23904579877853394, -0.20814532041549683, -1.1840184926986694, -0.016403701156377792, -0.6782932877540588, 0.5074628591537476, 1.0640144348144531, 1.3402018547058105, -1.044762372970581, -0.2655014991760254, -1.7547348737716675, -0.060123786330223083, -0.7011426091194153, 0.15657773613929749, -2.0080747604370117, -0.22356845438480377, -1.8521301746368408, -2.3578274250030518, -1.2965840101242065, -0.8159613609313965, 1.0300571918487549, 0.12583383917808533, -0.8938122391700745, 1.2692197561264038, -0.3848797082901001, -1.8820010423660278, 0.995419979095459, -2.0861282348632812 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
The offsets don't have nulls because they don't include the validity bitmap from `arr.buffers()[0]`, which is used to say which values are null and which values are non-null. Though the validity bitmap also seems to be wrong: ```python bin(int(arr.buffers()[0].hex(), 16)) # '0b10' # it should be 0b110 - 1 corresponds to non-null and 0 corresponds to null, if you take the bits in reverse order ``` So apparently I can't even create the fixed offsets array using this. If I understand correctly it's always missing the 1 on the left, so I can add it manually as a hack to fix the issue until this is fixed in pyarrow EDIT: actually it may be more complicated than that EDIT2: actuall it's right, it corresponds to the validity bitmap of the array of logical length 2. So if we use the offsets array, the values array, and this validity bitmap it should be possible to reconstruct the array properly
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
968
158
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger The offsets don't have nulls because they don't include the validity bitmap from `arr.buffers()[0]`, which is used to say which values are null and which values are non-null. Though the validity bitmap also seems to be wrong: ```python bin(int(arr.buffers()[0].hex(), 16)) # '0b10' # it should be 0b110 - 1 corresponds to non-null and 0 corresponds to null, if you take the bits in reverse order ``` So apparently I can't even create the fixed offsets array using this. If I understand correctly it's always missing the 1 on the left, so I can add it manually as a hack to fix the issue until this is fixed in pyarrow EDIT: actually it may be more complicated than that EDIT2: actuall it's right, it corresponds to the validity bitmap of the array of logical length 2. So if we use the offsets array, the values array, and this validity bitmap it should be possible to reconstruct the array properly
[ -1.2178661823272705, -0.8376503586769104, -0.8794726133346558, 1.5811872482299805, -0.12077205628156662, -1.2044386863708496, 0.1259051412343979, -1.1239768266677856, 1.8287503719329834, -0.8035478591918945, 0.3951488435268402, -1.6401058435440063, 0.11743035912513733, -0.6468379497528076, -0.823580801486969, -0.8082982301712036, -0.3503280282020569, -0.7258260250091553, 1.02347731590271, 2.449903726577759, 1.2655198574066162, -1.4472142457962036, 2.720052480697632, 0.7236219644546509, -0.17977535724639893, -0.9722652435302734, 0.5130829811096191, -0.08963033556938171, -1.310852289199829, -0.547829270362854, -0.9240984916687012, -0.023689530789852142, -0.5060197710990906, -0.5683866739273071, -0.05537477880716324, 0.41181471943855286, -0.2937789261341095, -0.4806605875492096, -0.5061464905738831, -0.8512062430381775, 0.3757382333278656, -0.32159942388534546, 0.9718458652496338, -0.2502930164337158, 1.814656138420105, -0.5588629841804504, 0.33452677726745605, 0.6335166096687317, 1.3675154447555542, 0.2158583104610443, -0.06986288726329803, 0.38927599787712097, 0.3665304481983185, -0.06365250796079636, 0.5301437377929688, 1.227750539779663, 0.7144318222999573, 0.5121394395828247, 0.9185508489608765, -2.226162910461426, 1.2615094184875488, -1.1226602792739868, 0.32574495673179626, 1.2566848993301392, -0.9205303192138672, 0.2968934178352356, -1.6985039710998535, -0.07011735439300537, 0.6207520365715027, -2.312960147857666, 0.2510814070701599, -1.311486840248108, -0.5228472352027893, 0.9690135717391968, 0.316314697265625, -1.3160145282745361, 0.17851008474826813, -0.39079320430755615, 1.0125774145126343, 0.3507648706436157, 1.0922605991363525, -1.7125967741012573, 0.006043868139386177, -0.3272082209587097, 0.1342732012271881, -1.2370963096618652, -1.5525842905044556, 0.5623965859413147, 0.6457134485244751, 0.5239107608795166, -0.13970546424388885, 1.0542327165603638, -0.9937015175819397, 0.7513341307640076, -1.0361436605453491, -1.7570445537567139, -1.4013583660125732, -2.1988449096679688, -2.163374185562134, 0.7030277848243713, -0.4795643091201782, -0.5981753468513489, 2.0461666584014893, -0.9982345700263977, -1.7105367183685303, 1.1238493919372559, 0.3422311544418335, -0.02853785827755928, 2.4658961296081543, 0.1463325172662735, -0.7422974705696106, 0.5303793549537659, -0.7817957997322083, 0.8293479084968567, -0.39086779952049255, 1.3330110311508179, 0.3721958100795746, -1.0589394569396973, 1.6601414680480957, -0.3815099895000458, 0.4858977794647217, -0.7301309108734131, -0.47420692443847656, -0.7609626650810242, 0.34723931550979614, 1.9384764432907104, -0.31542909145355225, 1.5145970582962036, -0.28967738151550293, -1.545446515083313, -1.5567448139190674, 0.9104171991348267, 0.44098058342933655, -0.7727853655815125, 0.1169268935918808, -0.3504730463027954, 0.12657365202903748, -0.058825574815273285, 1.2568529844284058, 1.2594447135925293, 0.6512580513954163, -0.2719205915927887, -0.8528748154640198, 0.16638635098934174, -0.10845129936933517, -0.7691233158111572, -1.7309151887893677, -0.3277369439601898, 0.15261031687259674, 0.6852646470069885, -1.2595226764678955, 1.7962243556976318, 0.8568975925445557, 1.9156996011734009, 1.1071094274520874, -0.37446680665016174, 1.5364100933074951, 0.1054287999868393, 1.8071870803833008, -0.532784640789032, 0.655463695526123, -0.46896737813949585, -1.1500201225280762, 0.9461771845817566, -0.39100345969200134, -1.9381650686264038, -0.7016606330871582, -0.7445808053016663, -0.13414746522903442, -0.7351377606391907, 0.9945463538169861, -0.33481231331825256, -1.3223313093185425, 0.28624287247657776, -0.7526500225067139, 0.04434499889612198, -1.1962372064590454, 0.32409340143203735, 0.7277318835258484, -0.581615149974823, 0.12394911050796509, -0.26214584708213806, -1.2996028661727905, -0.4781366288661957, 0.26326438784599304, 1.8727456331253052, -0.7522892355918884, 0.8352732062339783, 1.0814698934555054, -0.6720640659332275, -0.10475991666316986, 0.385303258895874, -0.335534006357193, 0.8809807300567627, -1.0072966814041138, -0.5474598407745361, 1.1257051229476929, -0.09088722616434097, -0.5794646739959717, 1.445164442062378, 0.7176199555397034, -1.0062990188598633, -0.21428346633911133, -0.04518307000398636, -0.8907067775726318, 0.11929330229759216, -1.6096038818359375, -0.14182955026626587, 0.46428272128105164, -1.5930662155151367, -0.48553162813186646, -0.18310272693634033, 1.2474972009658813, -0.24134603142738342, 1.4280891418457031, -0.293268084526062, -0.20794951915740967, -0.3078714609146118, -0.36438512802124023, 0.04020524024963379, -0.18125541508197784, -0.7004504203796387, 0.26339876651763916, -0.6751178503036499, 0.3916623592376709, 1.379288911819458, 0.31513696908950806, 0.11871719360351562, 0.5012338161468506, 1.1586483716964722, 0.39745059609413147, -0.017874088138341904, -0.8430863618850708, -1.5774649381637573, 2.0215275287628174, -1.5062490701675415, 1.9929553270339966, 0.8158444762229919, -0.0010536005720496178, -1.7261419296264648, -1.8697916269302368, 1.519649624824524, 1.1604820489883423, 2.3021836280822754, 0.6226903200149536, 0.3630641996860504, -0.7634193897247314, -0.6065100431442261, 0.3149036765098572, -1.0081405639648438, -0.7599449753761292, 0.15498240292072296, 2.434896945953369, 1.79940664768219, -0.3834115266799927, -0.2082313597202301, -0.9905772805213928, 1.4131457805633545, -0.20224469900131226, 0.22329701483249664, 1.9186311960220337, -0.2141963541507721, -1.0886012315750122, 1.2433913946151733, -2.370694875717163, 0.042568936944007874, 1.9807324409484863, 0.2748875617980957, 0.021659987047314644, -1.3598304986953735, -0.6055435538291931, -0.3224334418773651, -0.4732778072357178, -1.2600210905075073, 0.5425578951835632, -0.24848173558712006, -0.785490095615387, -1.4563597440719604, 0.17811113595962524, -1.1179689168930054, -1.583428978919983, 0.21404960751533508, 1.9015743732452393, 2.0268476009368896, -0.6899829506874084, 1.6912286281585693, -0.33569830656051636, 0.19471769034862518, 1.1796060800552368, 1.1779851913452148, 3.1776368618011475, 1.9210126399993896, -1.253546118736267, 0.5692130327224731, -0.15041956305503845, -0.5842209458351135, 1.1785942316055298, -1.1884459257125854, 1.3444454669952393, -0.1241786852478981, -1.2917523384094238, -1.2241127490997314, 0.9278524518013, 0.43720927834510803, 0.03361163288354874, -0.5280857086181641, 1.1483781337738037, 0.04198499023914337, 1.2062588930130005, 0.5624896287918091, -0.22300779819488525, 0.5853481888771057, -0.4236714243888855, -0.5384857058525085, 1.5359290838241577, 0.12027694284915924, -1.393520474433899, -2.35400390625, -0.11646239459514618, -0.8406848907470703, 0.13190020620822906, -0.6816014647483826, -1.057644248008728, 1.734363317489624, 0.300202339887619, -1.2688435316085815, -0.2409641593694687, -0.3234209418296814, -0.6273460388183594, 2.670677900314331, -1.4053460359573364, -0.3276594877243042, -1.0763062238693237, -0.6196532249450684, 1.6104445457458496, -1.1406978368759155, -0.18028710782527924, -0.9618794322013855, -0.4478226602077484, -1.2692897319793701, -0.5824549198150635, -0.0037598153576254845, -0.8655357956886292, 0.7869192361831665, 0.1305159032344818, -1.1927107572555542, -0.3506273627281189, -0.8527372479438782, 0.7874698042869568, -0.16351589560508728, 0.21132229268550873, 1.941908836364746, 0.4092937111854553, -0.40466994047164917, 0.7842810153961182, 1.1590415239334106, 0.7224817276000977, -0.6131711602210999, 0.2801024615764618, -0.6163683533668518, 0.30650269985198975, -1.3222452402114868, 0.3161175847053528, -2.8100123405456543, 0.6081362366676331, 0.02995407022535801, -0.009802836924791336, 0.12474562227725983, -1.2634624242782593, 1.0958213806152344, 2.5986216068267822, -1.1408532857894897, 0.44736629724502563, 0.2649042308330536, 1.268947958946228, -1.6369761228561401, 0.27824243903160095, -0.4192942678928375, 2.1543095111846924, 0.12138058245182037, 1.1458290815353394, -0.3958292007446289, -2.299950361251831, 0.595806896686554, -1.277626395225525, -1.1704236268997192, 0.7896400094032288, -0.8595755696296692, 0.07472163438796997, -1.4321348667144775, -0.24008724093437195, -0.8613183498382568, -1.1376413106918335, 0.7487695217132568, 0.07594718039035797, 0.42998915910720825, -0.5837641358375549, 0.32873520255088806, -2.14520263671875, -1.3972564935684204, -0.15227484703063965, -0.9629588723182678, 0.5241788625717163, -0.35947662591934204, 0.689426839351654, -0.1978866308927536, -0.061237938702106476, 0.32298311591148376, 1.3968130350112915, 3.4051527976989746, 0.27038007974624634, 0.5201359987258911, -0.24927127361297607, -0.8762708902359009, 1.3847506046295166, 0.9318612813949585, -0.15114088356494904, -0.5617915987968445, -0.9801443815231323, 1.272233247756958, 1.9033305644989014, 0.9314515590667725, 0.05360827594995499, -0.8060667514801025, -0.8236223459243774, -0.08053519576787949, 0.20374654233455658, 0.3335016369819641, 0.8843358755111694, 0.16426420211791992, 0.05139351636171341, 1.3460719585418701, 1.1697672605514526, -0.49111613631248474, 0.4227648973464966, -0.841420590877533, -0.4207589328289032, 0.5364724397659302, 0.319964200258255, -0.08398588001728058, 0.3939957916736603, -0.9830052852630615, -0.3239566385746002, -0.4509524405002594, -0.8609561324119568, -0.6549322009086609, -0.3180113136768341, -0.23476913571357727, 1.6359407901763916, 0.05372307449579239, -0.5838879942893982, -0.0019198502413928509, -0.8079025149345398, -0.09102293848991394, -1.1035711765289307, 0.20007017254829407, -0.12780095636844635, -0.17473751306533813, -0.10839268565177917, 1.8039437532424927, -0.905694842338562, -2.0227975845336914, 0.1896970272064209, 0.24241554737091064, -0.30982649326324463, 0.28597375750541687, 1.6439917087554932, 0.5519534349441528, 1.4687066078186035, 1.3798301219940186, 0.9443201422691345, -0.6755095720291138, -1.3658093214035034, 0.6422007083892822, 1.015777587890625, -1.3751131296157837, 0.8628441691398621, 0.008007517084479332, -0.4936685562133789, 0.6231633424758911, 1.2518236637115479, 0.4321646988391876, -2.0621609687805176, 0.7693116068840027, -0.8638092875480652, 0.7923433780670166, 0.7025390267372131, 0.6116849780082703, 0.308845192193985, 0.7638391256332397, -1.1783666610717773, -1.2020738124847412, -0.7476200461387634, -0.693468451499939, 1.8775042295455933, -0.23969918489456177, 0.6118007302284241, -0.16927017271518707, -1.391748070716858, -0.12067633867263794, 0.5411074757575989, 0.3793620467185974, -0.4975302517414093, 0.8038213849067688, -0.6924249529838562, -1.1720582246780396, -1.3727495670318604, -0.5106924176216125, -1.0151911973953247, -0.933704674243927, 1.0660264492034912, 0.8939586877822876, 0.3013593256473541, 1.9708151817321777, 0.6769603490829468, 0.127435103058815, -2.50713849067688, 0.9006205797195435, 0.38644227385520935, -0.10035595297813416, 0.8120918273925781, 0.4402271807193756, 1.0397573709487915, -0.051875509321689606, 0.5136625170707703, -2.4137258529663086, 2.285015344619751, -0.20772869884967804, 0.7680063247680664, -0.008018926717340946, -0.20850595831871033, 1.0414631366729736, 0.566749632358551, 0.5573107004165649, -1.0310002565383911, 0.5579076409339905, -0.6249615550041199, 1.3356205224990845, 0.8987099528312683, -0.7713397741317749, -0.06285092979669571, 1.3368651866912842, 0.4178416430950165, -0.5799585580825806, -0.9116981625556946, -0.9546775221824646, 0.859224796295166, 1.637977123260498, 0.024504205211997032, -0.007796349935233593, 0.877361536026001, 0.6589773297309875, -1.2956572771072388, 0.11888617277145386, -0.7099091410636902, -0.8705525398254395, 1.6727274656295776, 2.0938198566436768, -0.2489149421453476, -0.1328798532485962, -0.7604274749755859, -1.2243717908859253, 0.7936562895774841, -0.01962626539170742, 0.09145883470773697, 0.6086824536323547, -0.6475838422775269, 1.1182217597961426, 0.953567624092102, 0.8333403468132019, 0.2408648133277893, 0.31022942066192627, 0.3849531412124634, -0.3673994541168213, -1.1313589811325073, -0.2512274384498596, -1.0756242275238037, -2.5133981704711914, 0.36243000626564026, -0.22882241010665894, -1.3970568180084229, 0.05864347517490387, -1.0157049894332886, 0.8862205147743225, -0.5164706110954285, -1.0272703170776367, -1.4975045919418335, 0.2669402062892914, 0.007905621081590652, 0.950133204460144, -1.5948961973190308, -0.09376921504735947, 1.1812916994094849, 0.9064241647720337, -0.6789140701293945, 0.9786741733551025, 0.23650237917900085, 1.1228406429290771, 0.9756964445114136, -0.3726566433906555, 0.47921428084373474, -0.014148328453302383, -1.3726341724395752, 0.4673893451690674, 1.1391921043395996, 0.12525418400764465, 1.460110068321228, -0.49776679277420044, -0.05409349501132965, 0.3780534863471985, -0.4717145264148712, -0.4426575303077698, -0.6660419702529907, 0.6735272407531738, 0.0848705992102623, -0.8139657378196716, -0.007482137996703386, -0.0337878093123436, -0.3009137213230133, 0.15270453691482544, -1.5657728910446167, -0.08072233945131302, -0.3932293653488159, -0.6156493425369263, -1.2442203760147095, -0.048912689089775085, 1.368693232536316, -0.7738030552864075, -0.2029983550310135, 0.46073994040489197, 0.38831520080566406, 0.4464723765850067, 0.7096765041351318, -0.6062174439430237, -0.457195520401001, -0.1878664493560791, -0.4070802628993988, 0.368717223405838, 1.4168647527694702, -0.11757097393274307, -0.9146931171417236, 0.6337321400642395, -0.3534281849861145, -0.07433317601680756, 1.9155479669570923, 0.07024247199296951, -0.7881603837013245, 0.3294318616390228, -0.6767525672912598, 1.965352177619934, 1.7700387239456177, 1.2673426866531372, -0.17493367195129395, -0.9917663931846619, 0.7205168604850769, -0.3714286684989929, -0.44624757766723633, 0.8203176856040955, 0.2864476442337036, -0.16956162452697754, -1.4543960094451904, 0.5889621376991272, 1.3221219778060913, -0.9107843637466431, -0.8222225904464722, 0.07355983555316925, -0.7873285412788391, 1.0550098419189453, 0.6934723258018494, 0.38342538475990295, 0.33775827288627625, 1.5980514287948608, 0.8033377528190613, -0.5333252549171448, 0.5588472485542297, 0.5181342363357544, -0.0592714324593544, -2.198239803314209, -1.1488723754882812, 0.29555580019950867, -0.4061587452888489, -1.6574101448059082, 1.3275730609893799, -1.142897367477417, -0.9068679213523865, 0.547368586063385, 0.04038257896900177, 1.3916913270950317, 0.26297727227211, 1.5144126415252686, 2.0983734130859375, 0.728909432888031, 0.31556570529937744, 1.2218459844589233, -0.22506138682365417, -0.46435514092445374, 1.7989230155944824, -0.5131952166557312, 0.5485333800315857, 1.0592687129974365, -0.28131943941116333, -1.0895978212356567, -0.7276189923286438, -1.3280061483383179, -0.7230643033981323, 1.1955910921096802, 0.042968034744262695, -1.164231538772583, 0.2930935025215149, 1.5765658617019653, -0.020655617117881775, -0.36205267906188965, 0.5784373879432678, 0.5002215504646301, -0.7883064150810242, -0.11245104670524597, -0.8753269910812378, 0.6208970546722412, -0.1132795512676239, -0.2836098074913025, 0.3908686637878418, 0.47558775544166565, 1.3550704717636108, 0.030596641823649406, 0.1298040747642517, 1.1416953802108765, -1.502752661705017, 1.4515714645385742, -0.7432341575622559, 0.27176395058631897, -2.337028741836548, 1.4500690698623657, -0.7573879361152649, 1.9974521398544312, -2.7092645168304443, 0.377159059047699, -0.5795575380325317, -0.48440343141555786, 0.3343392014503479, -0.2606813907623291, 0.16432687640190125, -0.22202588617801666, -1.1107197999954224, -0.036588624119758606, -0.6723030209541321, 0.5313680768013, 1.1115946769714355, 1.3563263416290283, -1.0159953832626343, -0.30125096440315247, -1.7536146640777588, -0.04134447127580643, -0.6137433052062988, 0.19687648117542267, -2.0375890731811523, -0.22011087834835052, -1.9522589445114136, -2.3963494300842285, -1.3187090158462524, -0.8067121505737305, 1.093301773071289, 0.17858798801898956, -0.9290990233421326, 1.2367910146713257, -0.3632173240184784, -1.845253586769104, 1.0241714715957642, -2.0360445976257324 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
FYI the behavior is the same with: - `datasets` version: 1.18.3 - Platform: Linux-5.8.0-50-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.11 - PyArrow version: 6.0.1 but not with: - `datasets` version: 1.8.0 - Platform: Linux-4.18.0-305.40.2.el8_4.x86_64-x86_64-with-redhat-8.4-Ootpa - Python version: 3.7.11 - PyArrow version: 3.0.0 i.e. it outputs: ```py 0 [None, [0]] 1 [None, [0]] 2 [None, [0]] 3 [None, [0]] ```
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
968
57
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger FYI the behavior is the same with: - `datasets` version: 1.18.3 - Platform: Linux-5.8.0-50-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.11 - PyArrow version: 6.0.1 but not with: - `datasets` version: 1.8.0 - Platform: Linux-4.18.0-305.40.2.el8_4.x86_64-x86_64-with-redhat-8.4-Ootpa - Python version: 3.7.11 - PyArrow version: 3.0.0 i.e. it outputs: ```py 0 [None, [0]] 1 [None, [0]] 2 [None, [0]] 3 [None, [0]] ```
[ -1.198793888092041, -0.7228336334228516, -0.7852547764778137, 1.603676438331604, -0.0869036614894867, -1.2214630842208862, 0.18629337847232819, -1.0556279420852661, 1.7939519882202148, -0.7443584203720093, 0.4068952202796936, -1.6118801832199097, 0.10107123851776123, -0.6533054113388062, -0.8139473795890808, -0.8150826096534729, -0.35261639952659607, -0.6258310079574585, 1.0947834253311157, 2.4413249492645264, 1.248594880104065, -1.3821579217910767, 2.6790883541107178, 0.7560704350471497, -0.17794574797153473, -0.9153643846511841, 0.5267491340637207, 0.008106610737740993, -1.4520198106765747, -0.3520067632198334, -0.9008461833000183, -0.10233836621046066, -0.5880354642868042, -0.610146701335907, -0.07672511041164398, 0.377863347530365, -0.27290740609169006, -0.4415038228034973, -0.44622287154197693, -0.9337728023529053, 0.3279135525226593, -0.27329105138778687, 0.8779520988464355, -0.27486929297447205, 1.6943461894989014, -0.6736640930175781, 0.4443178176879883, 0.6359623670578003, 1.278337001800537, 0.2172037959098816, -0.013610560446977615, 0.4104222059249878, 0.4044433534145355, -0.04066306725144386, 0.56747967004776, 1.18843412399292, 0.7408422827720642, 0.44166839122772217, 0.8560194969177246, -2.2541091442108154, 1.258680820465088, -1.013931155204773, 0.2714931070804596, 1.2709832191467285, -0.9693560004234314, 0.26367485523223877, -1.6598334312438965, -0.1241641491651535, 0.5859996676445007, -2.288421630859375, 0.24405525624752045, -1.3987056016921997, -0.565781831741333, 0.9049155116081238, 0.4145970940589905, -1.2789514064788818, 0.06754466146230698, -0.37402239441871643, 0.9512114524841309, 0.32035455107688904, 1.1341298818588257, -1.7236531972885132, -0.015102693811058998, -0.3393145799636841, 0.22518377006053925, -1.2062510251998901, -1.4964009523391724, 0.5586106181144714, 0.6914684176445007, 0.5168372988700867, -0.21695604920387268, 0.959417998790741, -1.091986894607544, 0.793479859828949, -1.0957072973251343, -1.891266942024231, -1.3635196685791016, -2.3247311115264893, -2.2069344520568848, 0.7003312706947327, -0.425811231136322, -0.5213687419891357, 2.069026470184326, -1.003031611442566, -1.6961132287979126, 1.0748698711395264, 0.33652612566947937, -0.022184357047080994, 2.4928951263427734, 0.1264435350894928, -0.7504005432128906, 0.5706508755683899, -0.9191997647285461, 0.6957705020904541, -0.3111891746520996, 1.2438710927963257, 0.3307836949825287, -1.0619511604309082, 1.6723576784133911, -0.2935294210910797, 0.5368752479553223, -0.8071341514587402, -0.38519561290740967, -0.6351625919342041, 0.23686595261096954, 1.918285608291626, -0.2725176215171814, 1.4974077939987183, -0.2188560515642166, -1.4450372457504272, -1.4388136863708496, 0.7984849214553833, 0.5081879496574402, -0.7153809666633606, 0.07370226085186005, -0.3210591673851013, 0.18908624351024628, -0.06094750761985779, 1.2372772693634033, 1.2716890573501587, 0.7818440794944763, -0.2809428870677948, -0.8872599005699158, 0.1463794857263565, -0.05801943317055702, -0.8867181539535522, -1.6815465688705444, -0.21463219821453094, 0.08644388616085052, 0.735057532787323, -1.3363310098648071, 1.8744882345199585, 0.7778231501579285, 1.9684410095214844, 1.0533984899520874, -0.4944932758808136, 1.5224978923797607, 0.08574073016643524, 1.8700449466705322, -0.4695173501968384, 0.6949718594551086, -0.49166110157966614, -1.1579344272613525, 0.9413599371910095, -0.31800931692123413, -1.9992201328277588, -0.6532770991325378, -0.7432918548583984, -0.09476706385612488, -0.7970409393310547, 1.0641119480133057, -0.3000575304031372, -1.4071017503738403, 0.2720189094543457, -0.8394401669502258, 0.021534159779548645, -1.2409428358078003, 0.26919370889663696, 0.7376714944839478, -0.5077995657920837, 0.16252073645591736, -0.2720705568790436, -1.3234217166900635, -0.5490202307701111, 0.33808159828186035, 1.8212602138519287, -0.7094489336013794, 0.9527541995048523, 1.1353188753128052, -0.6136133670806885, -0.12312773615121841, 0.42920416593551636, -0.358575701713562, 0.9142609238624573, -0.9925071001052856, -0.5881748795509338, 1.1249511241912842, -0.07885497808456421, -0.6013022065162659, 1.547950267791748, 0.707032322883606, -0.9649050235748291, -0.2936854660511017, 0.0033797025680541992, -0.8007415533065796, 0.14561180770397186, -1.6863458156585693, -0.0651547834277153, 0.43778762221336365, -1.6377007961273193, -0.4732295572757721, -0.11453016847372055, 1.3442802429199219, -0.15736229717731476, 1.3747994899749756, -0.193186953663826, -0.19898714125156403, -0.42113250494003296, -0.28211918473243713, 0.03709639608860016, -0.19894716143608093, -0.6545327305793762, 0.3625345528125763, -0.6307269334793091, 0.3876664936542511, 1.364780306816101, 0.25895169377326965, 0.12273488193750381, 0.44580164551734924, 1.1122329235076904, 0.388062983751297, -0.08390189707279205, -0.856897234916687, -1.6003884077072144, 2.045614719390869, -1.4649035930633545, 2.038908004760742, 0.7824333310127258, -0.04272108152508736, -1.7607861757278442, -1.9469558000564575, 1.5490723848342896, 1.052254557609558, 2.3128862380981445, 0.6090390682220459, 0.38124191761016846, -0.771514356136322, -0.6023005843162537, 0.24126707017421722, -0.941847562789917, -0.7551442384719849, 0.17001621425151825, 2.4840352535247803, 1.6467195749282837, -0.33214616775512695, -0.13922026753425598, -1.0417011976242065, 1.451084017753601, -0.1611465960741043, 0.24008296430110931, 1.9109187126159668, -0.25438690185546875, -1.1250085830688477, 1.1744797229766846, -2.3446621894836426, 0.07265157252550125, 1.946270227432251, 0.22524677217006683, 0.004109003581106663, -1.3010834455490112, -0.6520016193389893, -0.38086894154548645, -0.5541079640388489, -1.1901700496673584, 0.5757532119750977, -0.13824622333049774, -0.8467925190925598, -1.4185808897018433, 0.14481393992900848, -1.0837641954421997, -1.708754301071167, 0.2538851499557495, 1.8200581073760986, 1.9672186374664307, -0.7326633334159851, 1.6312811374664307, -0.3623706102371216, 0.216551274061203, 1.16013503074646, 1.1979457139968872, 3.135866403579712, 1.9478799104690552, -1.2822999954223633, 0.6628055572509766, -0.12011468410491943, -0.456561416387558, 1.1965144872665405, -1.2237694263458252, 1.3133119344711304, -0.16111253201961517, -1.3213796615600586, -1.2358778715133667, 0.9569547176361084, 0.4354289770126343, 0.004144790582358837, -0.49791496992111206, 1.0963774919509888, 0.16306668519973755, 1.322067379951477, 0.5578160285949707, -0.03500284254550934, 0.6204681992530823, -0.4422241449356079, -0.42980051040649414, 1.5880566835403442, 0.06512954086065292, -1.4516061544418335, -2.4542131423950195, -0.12662672996520996, -0.9019714593887329, 0.10109754651784897, -0.7460231781005859, -1.0764120817184448, 1.7325469255447388, 0.3867001235485077, -1.1791200637817383, -0.17565226554870605, -0.3755877912044525, -0.6128969192504883, 2.7563371658325195, -1.413411259651184, -0.3142067492008209, -1.0723638534545898, -0.6530182361602783, 1.5890963077545166, -1.143430233001709, -0.15529881417751312, -0.9488309621810913, -0.3961401879787445, -1.2276626825332642, -0.544786810874939, -0.06119794771075249, -0.893828272819519, 0.7535696625709534, 0.09391992539167404, -1.2480087280273438, -0.4628554880619049, -0.9291437268257141, 0.7735754251480103, -0.11141470074653625, 0.2081436961889267, 1.8732000589370728, 0.4475720226764679, -0.34385472536087036, 0.7576313614845276, 1.1767407655715942, 0.7705870866775513, -0.5812525749206543, 0.3647632896900177, -0.557518482208252, 0.41905152797698975, -1.2199161052703857, 0.2318471372127533, -2.7538578510284424, 0.6123868227005005, 0.04252035170793533, -0.0030695023015141487, -0.010406817309558392, -1.2657392024993896, 1.203794002532959, 2.536628007888794, -1.1153069734573364, 0.48594942688941956, 0.21288636326789856, 1.1791890859603882, -1.5517278909683228, 0.17326293885707855, -0.5429707765579224, 2.199190139770508, 0.15324373543262482, 1.0881531238555908, -0.35705068707466125, -2.3240716457366943, 0.65976881980896, -1.2700997591018677, -1.1180830001831055, 0.8198337554931641, -0.8519137501716614, 0.19804659485816956, -1.3069874048233032, -0.1559409350156784, -0.8437181115150452, -1.0934431552886963, 0.5965707898139954, 0.07449069619178772, 0.5446523427963257, -0.7204605340957642, 0.3116561472415924, -2.215243339538574, -1.352962613105774, -0.14471270143985748, -0.9973459839820862, 0.5248696804046631, -0.3133746385574341, 0.714652419090271, -0.14324384927749634, -0.14367276430130005, 0.32727953791618347, 1.3709956407546997, 3.40513277053833, 0.22735700011253357, 0.4567718505859375, -0.25521743297576904, -0.9964892268180847, 1.3856960535049438, 0.9779811501502991, -0.10833848267793655, -0.5300522446632385, -1.0106233358383179, 1.2477445602416992, 1.937200903892517, 1.0186147689819336, 0.039046160876750946, -0.7824028730392456, -0.8227505087852478, 0.020886320620775223, 0.27762508392333984, 0.34797966480255127, 0.9028015732765198, 0.16741959750652313, -0.005039566196501255, 1.420656681060791, 1.1585726737976074, -0.44040289521217346, 0.41004490852355957, -0.8693146109580994, -0.4281890392303467, 0.6143671870231628, 0.36574697494506836, -0.02252008393406868, 0.4056530296802521, -1.0964776277542114, -0.29236912727355957, -0.35277795791625977, -0.794927179813385, -0.6818786263465881, -0.3228527009487152, -0.33356067538261414, 1.6523393392562866, -0.10663237422704697, -0.5177847146987915, 0.02223201096057892, -0.779850423336029, 0.02293400466442108, -1.027582049369812, 0.3214499354362488, -0.21731621026992798, 0.02370990812778473, -0.16319820284843445, 1.8323594331741333, -0.9364205002784729, -1.9781689643859863, 0.22610048949718475, 0.19115541875362396, -0.4236869812011719, 0.3314829170703888, 1.6751914024353027, 0.6652708053588867, 1.4488083124160767, 1.4370850324630737, 0.9431198239326477, -0.6670857667922974, -1.4017988443374634, 0.628841757774353, 1.0325841903686523, -1.3436884880065918, 0.845431923866272, -0.00300963269546628, -0.4564436376094818, 0.5176664590835571, 1.3001289367675781, 0.4219019114971161, -2.1198954582214355, 0.6992514133453369, -0.9023721218109131, 0.8682068586349487, 0.7128299474716187, 0.633571982383728, 0.16411565244197845, 0.7304105758666992, -1.2469741106033325, -1.0886785984039307, -0.6868883967399597, -0.697847306728363, 1.8498262166976929, -0.31440040469169617, 0.6237766146659851, -0.21793711185455322, -1.375210165977478, -0.011968976818025112, 0.5193163752555847, 0.37499818205833435, -0.5500732660293579, 0.7947555780410767, -0.6111836433410645, -1.1984413862228394, -1.2598795890808105, -0.5369153618812561, -0.9772123098373413, -0.966157078742981, 1.0701931715011597, 0.7685003876686096, 0.45202764868736267, 1.9537019729614258, 0.6511057019233704, 0.10249631106853485, -2.5089566707611084, 0.8236225843429565, 0.4015182852745056, -0.09086842089891434, 0.7807224988937378, 0.426031231880188, 1.0213944911956787, -0.14426790177822113, 0.5666113495826721, -2.4049527645111084, 2.3361852169036865, -0.17621546983718872, 0.7523133158683777, 0.048149384558200836, -0.08207730203866959, 1.0067474842071533, 0.6797971725463867, 0.5255815982818604, -1.0442882776260376, 0.5938231348991394, -0.6805163621902466, 1.4333887100219727, 0.7747782468795776, -0.7269599437713623, -0.10973572731018066, 1.2735073566436768, 0.47623077034950256, -0.46575844287872314, -0.8827306628227234, -0.9677731990814209, 0.875272810459137, 1.656721830368042, -0.017591925337910652, 0.004730452783405781, 0.8765966892242432, 0.7537512183189392, -1.3562142848968506, -0.030475590378046036, -0.7567487955093384, -0.7525904774665833, 1.6961967945098877, 2.1363871097564697, -0.1732785701751709, -0.10823830217123032, -0.7830492854118347, -1.2389025688171387, 0.8003649711608887, -0.08469057828187943, -0.008748834952712059, 0.6179919242858887, -0.5874112844467163, 1.1362268924713135, 0.8637640476226807, 0.8352692127227783, 0.33515429496765137, 0.2335001826286316, 0.18762117624282837, -0.35870152711868286, -1.2514476776123047, -0.2294587343931198, -1.0107191801071167, -2.5145175457000732, 0.3546055853366852, -0.3194218575954437, -1.3996762037277222, -0.004914309363812208, -1.1150647401809692, 0.773218035697937, -0.49026039242744446, -1.0378508567810059, -1.365822196006775, 0.23846183717250824, 0.042291779071092606, 0.9367781281471252, -1.5378776788711548, -0.043124228715896606, 1.2434617280960083, 0.8753073811531067, -0.7347612977027893, 0.9936225414276123, 0.2686488628387451, 1.1289952993392944, 0.9569383859634399, -0.3423503637313843, 0.4763855040073395, 0.06218990683555603, -1.3253083229064941, 0.43542158603668213, 1.2331000566482544, 0.12286887317895889, 1.5550490617752075, -0.5998099446296692, -0.06203548610210419, 0.37479832768440247, -0.4101005494594574, -0.4789634048938751, -0.8340092897415161, 0.7158017754554749, 0.041110601276159286, -0.9053627848625183, -0.01670435443520546, 0.03429410606622696, -0.2129264771938324, 0.23161828517913818, -1.4907658100128174, -0.001294681802392006, -0.38362041115760803, -0.6601370573043823, -1.2716108560562134, -0.0393439419567585, 1.2732903957366943, -0.804407000541687, -0.09644386172294617, 0.40408700704574585, 0.21054796874523163, 0.5244919061660767, 0.8032138347625732, -0.5489050149917603, -0.5291222333908081, -0.23738455772399902, -0.4121020436286926, 0.43524232506752014, 1.3628933429718018, -0.09876963496208191, -0.939497709274292, 0.6094301342964172, -0.3534860610961914, -0.009448560886085033, 2.005323648452759, 0.006263970397412777, -0.8191885948181152, 0.4053404629230499, -0.6759182214736938, 1.967308759689331, 1.718726396560669, 1.2262842655181885, -0.14439882338047028, -1.0424724817276, 0.6626436710357666, -0.3863544166088104, -0.5205283164978027, 0.8013772368431091, 0.25382110476493835, -0.2718420624732971, -1.3869264125823975, 0.5711613893508911, 1.3516016006469727, -0.8974034786224365, -0.8782936334609985, 0.20843759179115295, -0.7923274040222168, 1.1301062107086182, 0.7710341215133667, 0.35907745361328125, 0.4340766966342926, 1.5525037050247192, 0.7983009815216064, -0.5391810536384583, 0.5158476233482361, 0.4212390184402466, -0.09308289736509323, -2.1166625022888184, -1.177253246307373, 0.2849980592727661, -0.4767012298107147, -1.5989176034927368, 1.3774396181106567, -1.2435128688812256, -0.939033031463623, 0.6187480688095093, 0.029402203857898712, 1.259326457977295, 0.2368907481431961, 1.5726292133331299, 2.069577217102051, 0.8179841637611389, 0.35651153326034546, 1.2295753955841064, -0.25028958916664124, -0.5435512661933899, 1.692427158355713, -0.5721661448478699, 0.6191821098327637, 1.0376323461532593, -0.22831906378269196, -1.1013286113739014, -0.8135126829147339, -1.2360482215881348, -0.801776647567749, 1.2008041143417358, 0.031321052461862564, -1.2018488645553589, 0.28405067324638367, 1.5319585800170898, 0.012446646578609943, -0.3336672782897949, 0.5452204942703247, 0.34709596633911133, -0.7647150158882141, -0.17026278376579285, -0.9736055135726929, 0.6008578538894653, -0.18936491012573242, -0.26169174909591675, 0.3591383397579193, 0.49821725487709045, 1.3437461853027344, 0.011374049820005894, 0.1515040546655655, 1.1631605625152588, -1.4754469394683838, 1.4649546146392822, -0.7766008377075195, 0.3364444971084595, -2.3060142993927, 1.3952670097351074, -0.8076896667480469, 1.9075312614440918, -2.7983224391937256, 0.3991459012031555, -0.4761849045753479, -0.4934045672416687, 0.20368094742298126, -0.17821477353572845, 0.22743847966194153, -0.21612899005413055, -1.1507898569107056, -0.11859577149152756, -0.8922690153121948, 0.38259607553482056, 1.0625799894332886, 1.3414483070373535, -0.974109947681427, -0.3622714579105377, -1.6913851499557495, -0.08409988880157471, -0.6415485739707947, 0.25055214762687683, -1.889288306236267, -0.1866130381822586, -1.9231194257736206, -2.3774805068969727, -1.319990634918213, -0.8241828083992004, 1.1225998401641846, 0.0856485366821289, -0.8472822308540344, 1.0799105167388916, -0.4395889639854431, -1.8773027658462524, 1.0925276279449463, -2.124847173690796 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
Thanks for the insights @PaulLerner ! I found a way to workaround this issue for the code example presented in this issue. Note that empty lists will still appear when you explicitly `cast` a list of lists that contain None values like [None, [0]] to a new feature type (e.g. to change the integer precision). In this case it will show a warning that it happened. If you don't cast anything, then the None values will be kept as expected. Let me know what you think !
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
968
87
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger Thanks for the insights @PaulLerner ! I found a way to workaround this issue for the code example presented in this issue. Note that empty lists will still appear when you explicitly `cast` a list of lists that contain None values like [None, [0]] to a new feature type (e.g. to change the integer precision). In this case it will show a warning that it happened. If you don't cast anything, then the None values will be kept as expected. Let me know what you think !
[ -1.2524112462997437, -0.799302875995636, -0.8442069292068481, 1.6302332878112793, -0.09669983386993408, -1.2405985593795776, 0.11740817874670029, -1.1173961162567139, 1.7937039136886597, -0.7277756333351135, 0.3948241174221039, -1.6287319660186768, 0.13676278293132782, -0.7200153470039368, -0.8399851322174072, -0.901911199092865, -0.37820860743522644, -0.6968255639076233, 1.0307433605194092, 2.4639055728912354, 1.2141143083572388, -1.420202374458313, 2.6992359161376953, 0.7738248705863953, -0.13812048733234406, -0.9874010682106018, 0.5640736222267151, -0.03515562787652016, -1.3284707069396973, -0.47906678915023804, -0.9189960956573486, -0.1210792139172554, -0.5424907803535461, -0.5738430619239807, -0.07779373228549957, 0.39897558093070984, -0.2797359228134155, -0.43507376313209534, -0.5138115286827087, -0.9124481678009033, 0.30938929319381714, -0.30353137850761414, 0.9514588713645935, -0.22887985408306122, 1.7608813047409058, -0.6648102402687073, 0.3634133040904999, 0.6016473174095154, 1.3819844722747803, 0.22914919257164001, 0.008311181329190731, 0.3861754834651947, 0.4062659740447998, -0.09079094231128693, 0.5057843923568726, 1.1846883296966553, 0.7534818053245544, 0.46815964579582214, 0.8703475594520569, -2.2309370040893555, 1.2298787832260132, -1.1346665620803833, 0.32852667570114136, 1.2845160961151123, -0.9547705054283142, 0.31132277846336365, -1.6913496255874634, -0.07291016727685928, 0.657717764377594, -2.327428102493286, 0.20802462100982666, -1.3261288404464722, -0.5573481917381287, 0.9045495390892029, 0.34005892276763916, -1.3665316104888916, 0.1798328459262848, -0.4038054347038269, 1.0322645902633667, 0.3774826228618622, 1.0919078588485718, -1.7357549667358398, 0.0037916721776127815, -0.3727555274963379, 0.13832397758960724, -1.2552040815353394, -1.4695234298706055, 0.6258717179298401, 0.7002094388008118, 0.5143669843673706, -0.16667769849300385, 1.041635513305664, -1.0567868947982788, 0.8091859817504883, -1.0384496450424194, -1.7900725603103638, -1.4219595193862915, -2.227780818939209, -2.2000532150268555, 0.727928102016449, -0.5146079063415527, -0.6109278798103333, 1.9885271787643433, -0.967802107334137, -1.71871817111969, 1.114652395248413, 0.3444094955921173, -0.011113584972918034, 2.5706794261932373, 0.1384325623512268, -0.7156897783279419, 0.49651584029197693, -0.7648561000823975, 0.8069262504577637, -0.42771995067596436, 1.3388899564743042, 0.3809194564819336, -1.0392495393753052, 1.7034655809402466, -0.35097694396972656, 0.490978866815567, -0.8150641322135925, -0.4453445374965668, -0.7246559858322144, 0.35883036255836487, 1.9184273481369019, -0.2949482500553131, 1.5738753080368042, -0.24963532388210297, -1.4976282119750977, -1.5327284336090088, 0.8620878458023071, 0.4857577085494995, -0.8218592405319214, 0.1220860704779625, -0.3476296663284302, 0.17112162709236145, -0.10148900747299194, 1.2661772966384888, 1.2642585039138794, 0.6267034411430359, -0.26647868752479553, -0.8334134221076965, 0.1986050009727478, -0.10838808864355087, -0.8568795919418335, -1.6864345073699951, -0.30500105023384094, 0.1311170756816864, 0.7048510909080505, -1.3068729639053345, 1.8186776638031006, 0.7603805661201477, 1.9054274559020996, 1.1228448152542114, -0.41465601325035095, 1.5419799089431763, 0.03221459314227104, 1.8366161584854126, -0.5281050801277161, 0.6897316575050354, -0.46695175766944885, -1.1256036758422852, 0.8888521194458008, -0.4086107313632965, -2.0007245540618896, -0.7699970006942749, -0.7192282676696777, -0.09268359839916229, -0.7486723065376282, 0.9695959687232971, -0.3724203407764435, -1.3521939516067505, 0.3344095051288605, -0.7808881998062134, 0.045197147876024246, -1.230191946029663, 0.30369994044303894, 0.7171376347541809, -0.5254729390144348, 0.15708740055561066, -0.23801399767398834, -1.3112894296646118, -0.48622044920921326, 0.23292116820812225, 1.892523169517517, -0.7790277600288391, 0.839166522026062, 1.0591357946395874, -0.6275825500488281, -0.12639085948467255, 0.42481479048728943, -0.33745473623275757, 0.9105846285820007, -1.0313835144042969, -0.5689111351966858, 1.1618739366531372, -0.06613323837518692, -0.6073006391525269, 1.5052666664123535, 0.7539761066436768, -0.9180532693862915, -0.246017724275589, -0.05005618929862976, -0.8494606614112854, 0.10915631800889969, -1.6812305450439453, -0.06831873953342438, 0.42715924978256226, -1.5683962106704712, -0.45104536414146423, -0.12995344400405884, 1.2651948928833008, -0.2348978966474533, 1.4171087741851807, -0.31847915053367615, -0.19539612531661987, -0.3276122212409973, -0.35150742530822754, 0.04116988182067871, -0.2433842569589615, -0.6686049103736877, 0.2566418945789337, -0.6104270815849304, 0.4589044749736786, 1.3575983047485352, 0.35479477047920227, 0.12521992623806, 0.4718203842639923, 1.171359896659851, 0.3639034330844879, 0.020763278007507324, -0.8153841495513916, -1.5325685739517212, 2.002351999282837, -1.4863619804382324, 2.020747661590576, 0.7651267647743225, -0.04903988912701607, -1.7094892263412476, -1.831259846687317, 1.5053776502609253, 1.1440526247024536, 2.2542641162872314, 0.6543931365013123, 0.33242377638816833, -0.8305866718292236, -0.5682929754257202, 0.2284015715122223, -1.0048754215240479, -0.736433744430542, 0.17748816311359406, 2.4660816192626953, 1.75532066822052, -0.4251232147216797, -0.1917247474193573, -1.0002347230911255, 1.4169445037841797, -0.20832481980323792, 0.20003725588321686, 1.9025224447250366, -0.24169892072677612, -1.1328420639038086, 1.1807820796966553, -2.3724234104156494, -0.01320910919457674, 1.9462015628814697, 0.2813006341457367, 0.023587066680192947, -1.3373676538467407, -0.5934349894523621, -0.38465213775634766, -0.44092196226119995, -1.223512053489685, 0.566619873046875, -0.2004125565290451, -0.7904244065284729, -1.420362114906311, 0.17436303198337555, -1.1065350770950317, -1.6091669797897339, 0.21254704892635345, 1.8305754661560059, 1.9449061155319214, -0.6964467167854309, 1.6917152404785156, -0.3289054036140442, 0.23246502876281738, 1.1795250177383423, 1.207335114479065, 3.13879656791687, 1.948197841644287, -1.2044639587402344, 0.6116955876350403, -0.1810133457183838, -0.4880119264125824, 1.199268102645874, -1.229000449180603, 1.3175185918807983, -0.09150492399930954, -1.271709680557251, -1.2226392030715942, 0.9387202262878418, 0.47219118475914, -0.007667321711778641, -0.5775293707847595, 1.152348518371582, 0.07513193041086197, 1.2930446863174438, 0.4827463924884796, -0.15071196854114532, 0.5452064871788025, -0.46074968576431274, -0.5382883548736572, 1.590032696723938, 0.09661396592855453, -1.4257457256317139, -2.361956834793091, -0.10154226422309875, -0.8122439980506897, 0.06785406917333603, -0.7171177864074707, -1.0826200246810913, 1.7892491817474365, 0.3301406502723694, -1.2982021570205688, -0.2262793779373169, -0.34891676902770996, -0.6287379860877991, 2.760209560394287, -1.373753547668457, -0.37970688939094543, -1.0361835956573486, -0.6411432027816772, 1.6879831552505493, -1.1051870584487915, -0.151067852973938, -0.9773486852645874, -0.46077191829681396, -1.2795557975769043, -0.5599101185798645, -0.09413037449121475, -0.9132505655288696, 0.7712092995643616, 0.15450099110603333, -1.2204657793045044, -0.4475097060203552, -0.8125048875808716, 0.792168140411377, -0.13026274740695953, 0.2975232005119324, 2.0037190914154053, 0.4729773700237274, -0.38373997807502747, 0.7550215721130371, 1.1958622932434082, 0.7260844707489014, -0.6014538407325745, 0.2943207025527954, -0.5556254982948303, 0.4019596576690674, -1.31741464138031, 0.23955385386943817, -2.755784511566162, 0.6528610587120056, 0.02479655295610428, -0.060163091868162155, 0.08480892330408096, -1.2615782022476196, 1.138898491859436, 2.6264073848724365, -1.1157745122909546, 0.408389151096344, 0.25183314085006714, 1.2353541851043701, -1.638044834136963, 0.23798099160194397, -0.45329251885414124, 2.1997666358947754, 0.16862955689430237, 1.1133745908737183, -0.3918212652206421, -2.3005640506744385, 0.5803200602531433, -1.2549844980239868, -1.191143274307251, 0.783283531665802, -0.9095310568809509, 0.12390468269586563, -1.3945345878601074, -0.18821054697036743, -0.8861172199249268, -1.1181813478469849, 0.7778503894805908, 0.1123761460185051, 0.442300409078598, -0.6517901420593262, 0.3447716236114502, -2.165254831314087, -1.3800424337387085, -0.1562470942735672, -0.9560892581939697, 0.47855135798454285, -0.31564563512802124, 0.68141108751297, -0.13369134068489075, -0.05783413350582123, 0.30457523465156555, 1.4117834568023682, 3.4073565006256104, 0.3072723150253296, 0.5377483367919922, -0.23334279656410217, -0.8766889572143555, 1.3838638067245483, 0.9015413522720337, -0.13676518201828003, -0.5373219847679138, -1.0284799337387085, 1.3027530908584595, 1.882887840270996, 0.9688990712165833, 0.08807419240474701, -0.7526159286499023, -0.7491469979286194, -0.07446326315402985, 0.240399569272995, 0.2762868404388428, 0.8555907011032104, 0.12194477766752243, 0.06020678952336311, 1.3751407861709595, 1.2071880102157593, -0.5006449818611145, 0.4088369309902191, -0.8104822039604187, -0.41490715742111206, 0.5634902715682983, 0.32059699296951294, -0.037112634629011154, 0.4372079372406006, -1.0211752653121948, -0.2815842628479004, -0.40793895721435547, -0.8415870070457458, -0.6561237573623657, -0.34342846274375916, -0.25598427653312683, 1.651551365852356, 0.011605088599026203, -0.5396407842636108, 0.010030754841864109, -0.7878845930099487, -0.0458604097366333, -1.0579659938812256, 0.2139921486377716, -0.10868291556835175, -0.12718632817268372, -0.04651753976941109, 1.872878909111023, -0.9306281805038452, -2.0335047245025635, 0.22681580483913422, 0.25055989623069763, -0.3798137307167053, 0.3139280378818512, 1.630415439605713, 0.5465297102928162, 1.4475347995758057, 1.4024467468261719, 0.9676721692085266, -0.6943992972373962, -1.3774651288986206, 0.647498607635498, 1.02412748336792, -1.3309016227722168, 0.9112444519996643, -0.008975811302661896, -0.39252641797065735, 0.5437884330749512, 1.2902308702468872, 0.4130452573299408, -2.0669422149658203, 0.7491214871406555, -0.8681459426879883, 0.8198586702346802, 0.6803535223007202, 0.5686989426612854, 0.28906041383743286, 0.8006604909896851, -1.2060984373092651, -1.2101866006851196, -0.786819577217102, -0.6843230724334717, 1.8951252698898315, -0.2185470014810562, 0.6332273483276367, -0.13679952919483185, -1.3817354440689087, -0.06273232400417328, 0.5939961671829224, 0.39711713790893555, -0.4752807915210724, 0.8422908186912537, -0.7028191089630127, -1.1626324653625488, -1.3298027515411377, -0.523802638053894, -0.9899502396583557, -0.9963275194168091, 1.1129752397537231, 0.8502407670021057, 0.30115970969200134, 1.9377460479736328, 0.6681731939315796, 0.10578244924545288, -2.478656768798828, 0.8551100492477417, 0.37704482674598694, -0.054042331874370575, 0.7657389044761658, 0.46295076608657837, 0.992278516292572, -0.03659282252192497, 0.48030656576156616, -2.417003631591797, 2.295632839202881, -0.23238390684127808, 0.7672393918037415, 0.00040044449269771576, -0.16836631298065186, 1.0126752853393555, 0.6233606338500977, 0.5202553868293762, -0.9966278672218323, 0.5092697143554688, -0.6113433241844177, 1.3763251304626465, 0.8727841973304749, -0.7191371917724609, -0.0659162700176239, 1.3378026485443115, 0.5024257302284241, -0.5475238561630249, -0.9350782036781311, -0.8843433260917664, 0.9158667325973511, 1.6545703411102295, 0.015031623654067516, -0.010621263645589352, 0.8629677891731262, 0.6844426393508911, -1.269404411315918, 0.07436911761760712, -0.7910053730010986, -0.8563624620437622, 1.6825971603393555, 2.1199934482574463, -0.20193621516227722, -0.12299513071775436, -0.7479470372200012, -1.1891727447509766, 0.7649533748626709, -0.11978885531425476, 0.07535642385482788, 0.6301149129867554, -0.6784987449645996, 1.0648478269577026, 0.8641150593757629, 0.8442999124526978, 0.31259146332740784, 0.28341254591941833, 0.3226970136165619, -0.34350892901420593, -1.1781295537948608, -0.21032020449638367, -1.0820417404174805, -2.5424845218658447, 0.3599710762500763, -0.2920515835285187, -1.3470888137817383, 0.04250778630375862, -1.0528861284255981, 0.8299099802970886, -0.5281181335449219, -1.0682772397994995, -1.4102116823196411, 0.2682969272136688, 0.019466709345579147, 0.9178595542907715, -1.5916153192520142, -0.08527251332998276, 1.184619665145874, 0.8763334155082703, -0.7376810312271118, 0.9626486301422119, 0.2553696930408478, 1.1726696491241455, 1.000728726387024, -0.36903393268585205, 0.4265119433403015, -0.08145619183778763, -1.33628249168396, 0.5432618856430054, 1.139419674873352, 0.13257046043872833, 1.5324831008911133, -0.5059041976928711, -0.11971639096736908, 0.3498765826225281, -0.5354722142219543, -0.4313143789768219, -0.7831475734710693, 0.6687478423118591, 0.11919604986906052, -0.8625007271766663, -0.013767066411674023, -0.025731846690177917, -0.2899511158466339, 0.15715765953063965, -1.5330621004104614, 0.022100500762462616, -0.3631478548049927, -0.5844221115112305, -1.1990501880645752, -0.0438334159553051, 1.3152793645858765, -0.8014141917228699, -0.15727226436138153, 0.45915505290031433, 0.351627379655838, 0.46390682458877563, 0.7579173445701599, -0.5654735565185547, -0.4756796360015869, -0.23921875655651093, -0.3800908923149109, 0.3681958317756653, 1.3463553190231323, -0.15431132912635803, -0.8740548491477966, 0.6338240504264832, -0.3135669529438019, -0.08625493198633194, 1.9670445919036865, 0.0751304030418396, -0.7580263018608093, 0.36529290676116943, -0.6711838841438293, 1.9777687788009644, 1.7425270080566406, 1.2359619140625, -0.16764913499355316, -1.0223442316055298, 0.6945488452911377, -0.3841015100479126, -0.47452738881111145, 0.7540322542190552, 0.2874697744846344, -0.19967959821224213, -1.4566690921783447, 0.5798441767692566, 1.3064526319503784, -0.8367188572883606, -0.8326911330223083, 0.09078337997198105, -0.8072404265403748, 1.0440518856048584, 0.7172833681106567, 0.3452034890651703, 0.3609146177768707, 1.63139808177948, 0.7693501114845276, -0.5343019366264343, 0.4996775686740875, 0.4918678104877472, -0.06015912443399429, -2.153106212615967, -1.198055386543274, 0.2819223701953888, -0.42015281319618225, -1.6506017446517944, 1.3223042488098145, -1.1882721185684204, -0.8763598203659058, 0.5493454933166504, 0.08510182052850723, 1.3587756156921387, 0.2308492362499237, 1.484235405921936, 2.0984179973602295, 0.7274647355079651, 0.32577502727508545, 1.2057336568832397, -0.18350835144519806, -0.542350709438324, 1.809955358505249, -0.5172107815742493, 0.5339118242263794, 1.0019524097442627, -0.21619448065757751, -1.1386468410491943, -0.7399104237556458, -1.2537223100662231, -0.7655772566795349, 1.1943328380584717, -0.0035833162255585194, -1.1708797216415405, 0.21202565729618073, 1.5759670734405518, 0.007293441332876682, -0.4101433753967285, 0.5278401374816895, 0.4390738904476166, -0.7467442154884338, -0.09859023988246918, -0.8992169499397278, 0.6258650422096252, -0.04371386393904686, -0.259777694940567, 0.41583049297332764, 0.5148949027061462, 1.3439075946807861, 0.03635081276297569, 0.14826402068138123, 1.0985918045043945, -1.4941728115081787, 1.4475913047790527, -0.6916611194610596, 0.279903382062912, -2.3572442531585693, 1.4462915658950806, -0.7582511901855469, 1.8947887420654297, -2.7282187938690186, 0.4179876148700714, -0.5773350596427917, -0.5227543115615845, 0.3314281404018402, -0.27092882990837097, 0.2170269787311554, -0.20039580762386322, -1.121488332748413, -0.057766836136579514, -0.7310159802436829, 0.44399648904800415, 1.0198495388031006, 1.2962709665298462, -1.019729495048523, -0.3467493951320648, -1.7197175025939941, -0.042895298451185226, -0.6021808981895447, 0.23559662699699402, -2.01882004737854, -0.20308129489421844, -1.9397640228271484, -2.3554885387420654, -1.3921916484832764, -0.7457097768783569, 1.0789557695388794, 0.11540968716144562, -0.9290750622749329, 1.1458587646484375, -0.413626492023468, -1.8513689041137695, 1.0191694498062134, -2.0911571979522705 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
Hi! I feel like I’m missing something in your answer, *what* is the workaround? Is it fixed in some `datasets` version?
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
968
21
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger Hi! I feel like I’m missing something in your answer, *what* is the workaround? Is it fixed in some `datasets` version?
[ -1.1765111684799194, -0.7676296830177307, -0.8830662369728088, 1.6188921928405762, -0.06895564496517181, -1.2736685276031494, 0.2005542367696762, -1.160027265548706, 1.8128104209899902, -0.7777000069618225, 0.43016788363456726, -1.6687474250793457, 0.09703557193279266, -0.7167236804962158, -0.8675695657730103, -0.8811547160148621, -0.34731096029281616, -0.6442074775695801, 0.9987468123435974, 2.4259445667266846, 1.2824915647506714, -1.350083589553833, 2.707676410675049, 0.7629704475402832, -0.17190591990947723, -0.9675402641296387, 0.5349588394165039, -0.0008012289181351662, -1.2725714445114136, -0.4710317552089691, -0.9172202944755554, -0.09886492788791656, -0.5345714688301086, -0.5914079546928406, -0.07987731695175171, 0.39895740151405334, -0.31105899810791016, -0.4476314187049866, -0.4529185891151428, -0.9712762832641602, 0.32332736253738403, -0.3171118199825287, 0.9909966588020325, -0.27610450983047485, 1.7722702026367188, -0.7029749155044556, 0.3531911373138428, 0.6327471137046814, 1.3613311052322388, 0.21366509795188904, -0.04341651499271393, 0.39807984232902527, 0.39683789014816284, -0.0608123280107975, 0.5242376327514648, 1.1861820220947266, 0.6971915364265442, 0.5273805260658264, 0.9333739876747131, -2.2129764556884766, 1.2221648693084717, -1.1307613849639893, 0.27282989025115967, 1.2496025562286377, -0.9038899540901184, 0.26572468876838684, -1.6672639846801758, -0.09090286493301392, 0.6427698731422424, -2.3385651111602783, 0.2705036997795105, -1.3851449489593506, -0.5867365598678589, 0.8751068115234375, 0.35730040073394775, -1.3474700450897217, 0.14700204133987427, -0.3855166435241699, 0.9899762272834778, 0.40816017985343933, 1.0560362339019775, -1.7722874879837036, 0.003325778990983963, -0.3789695203304291, 0.13797521591186523, -1.2877135276794434, -1.4529470205307007, 0.6254094243049622, 0.6428598165512085, 0.547942578792572, -0.1805039495229721, 1.0389022827148438, -1.056619644165039, 0.7824202179908752, -1.0493667125701904, -1.7923966646194458, -1.3886175155639648, -2.193253993988037, -2.1488516330718994, 0.6812800168991089, -0.4847331643104553, -0.6358938813209534, 1.9987531900405884, -0.9507011771202087, -1.6941941976547241, 1.0821008682250977, 0.3080577850341797, 0.005320045165717602, 2.5146398544311523, 0.15189756453037262, -0.7192122340202332, 0.5197725892066956, -0.7905083298683167, 0.7928885221481323, -0.40227872133255005, 1.3104735612869263, 0.4031997323036194, -1.0745769739151, 1.7320541143417358, -0.38066425919532776, 0.48315635323524475, -0.8171293139457703, -0.4666084945201874, -0.7151403427124023, 0.2888137996196747, 1.9300096035003662, -0.30663958191871643, 1.552667498588562, -0.2562587261199951, -1.486179232597351, -1.4986329078674316, 0.8893915414810181, 0.4468737542629242, -0.7817162871360779, 0.12459065020084381, -0.3422187566757202, 0.18735310435295105, -0.14909149706363678, 1.285377025604248, 1.1988825798034668, 0.6638615131378174, -0.22754833102226257, -0.8044191002845764, 0.21175675094127655, -0.052609484642744064, -0.8930675983428955, -1.66557776927948, -0.3100601136684418, 0.15611396729946136, 0.7141034603118896, -1.2957974672317505, 1.851072072982788, 0.7387292385101318, 1.919633150100708, 1.0797522068023682, -0.3884848356246948, 1.4642386436462402, 0.04222818836569786, 1.846612572669983, -0.5124858021736145, 0.7124682664871216, -0.450801819562912, -1.127959132194519, 0.9314437508583069, -0.40214571356773376, -1.9771586656570435, -0.7699791789054871, -0.7793664932250977, -0.06022171303629875, -0.8030087947845459, 1.0318849086761475, -0.3603344261646271, -1.3606293201446533, 0.2885224521160126, -0.7952717542648315, 0.03415394201874733, -1.2675005197525024, 0.2548254430294037, 0.6918897032737732, -0.4948226809501648, 0.11494572460651398, -0.1999589055776596, -1.3031102418899536, -0.48060157895088196, 0.21387895941734314, 1.9690322875976562, -0.7614068388938904, 0.8956687450408936, 1.0546972751617432, -0.627037763595581, -0.11686673760414124, 0.39455685019493103, -0.33110132813453674, 0.9064728617668152, -1.0148444175720215, -0.5787952542304993, 1.172316551208496, -0.03115493804216385, -0.6320040225982666, 1.5811761617660522, 0.7671692371368408, -0.9554181098937988, -0.24201495945453644, -0.08375434577465057, -0.8472514152526855, 0.11352372169494629, -1.6177599430084229, -0.05107255280017853, 0.45545685291290283, -1.5107406377792358, -0.4604463577270508, -0.13703645765781403, 1.2777639627456665, -0.2646065950393677, 1.380797266960144, -0.2761261463165283, -0.25635549426078796, -0.33314746618270874, -0.3395974934101105, 0.019037455320358276, -0.20101965963840485, -0.7282674312591553, 0.260699063539505, -0.5764927864074707, 0.45016708970069885, 1.3191169500350952, 0.2952073812484741, 0.15052452683448792, 0.48933836817741394, 1.140974760055542, 0.3066209852695465, 0.0030422816053032875, -0.8520209193229675, -1.5626665353775024, 2.032784938812256, -1.4634521007537842, 1.9925798177719116, 0.7379164099693298, -0.07955840229988098, -1.6892706155776978, -1.849363088607788, 1.5399221181869507, 1.1672927141189575, 2.2236669063568115, 0.6935259699821472, 0.350081205368042, -0.7705561518669128, -0.6043246388435364, 0.16375279426574707, -1.0279688835144043, -0.7114770412445068, 0.19600747525691986, 2.4327449798583984, 1.7572354078292847, -0.42304232716560364, -0.19031380116939545, -1.023231863975525, 1.388755202293396, -0.273794949054718, 0.19846801459789276, 1.8861743211746216, -0.30663710832595825, -1.1322169303894043, 1.1771830320358276, -2.363046169281006, -0.04278503358364105, 1.9536632299423218, 0.26422303915023804, 0.015301937237381935, -1.309718370437622, -0.6087539792060852, -0.42653149366378784, -0.4923325181007385, -1.2554174661636353, 0.5363949537277222, -0.21414066851139069, -0.8050307035446167, -1.3692147731781006, 0.2148081362247467, -1.0564236640930176, -1.615022897720337, 0.2385193407535553, 1.8478889465332031, 1.9592506885528564, -0.739099383354187, 1.6798095703125, -0.357548326253891, 0.2654484212398529, 1.2346112728118896, 1.2453032732009888, 3.1394996643066406, 1.9486624002456665, -1.2239261865615845, 0.6610732078552246, -0.170770063996315, -0.5466049313545227, 1.2801563739776611, -1.23395836353302, 1.2903183698654175, -0.0958411693572998, -1.2958511114120483, -1.2826333045959473, 0.9228070378303528, 0.4198160469532013, 0.016316041350364685, -0.5668497085571289, 1.1617435216903687, 0.05925851687788963, 1.3186900615692139, 0.539088785648346, -0.12909208238124847, 0.5276716947555542, -0.4305805563926697, -0.4618450403213501, 1.563051700592041, 0.1043357253074646, -1.4172544479370117, -2.4586739540100098, -0.07870940864086151, -0.8568423986434937, 0.1110527366399765, -0.6873356699943542, -1.1252076625823975, 1.8257075548171997, 0.33080390095710754, -1.2365877628326416, -0.23496456444263458, -0.3448348939418793, -0.6140393614768982, 2.7733101844787598, -1.4308834075927734, -0.38216453790664673, -1.1045336723327637, -0.61770099401474, 1.737445592880249, -1.1493221521377563, -0.11756470799446106, -0.9210630059242249, -0.4040898084640503, -1.331997036933899, -0.5825729966163635, -0.07289043068885803, -0.9231583476066589, 0.7804610729217529, 0.13398237526416779, -1.1943926811218262, -0.4581014811992645, -0.8319954872131348, 0.7910817265510559, -0.20262375473976135, 0.2910446524620056, 1.9721204042434692, 0.48017510771751404, -0.37870851159095764, 0.7055821418762207, 1.222450852394104, 0.7482635378837585, -0.6034433841705322, 0.31339794397354126, -0.5766174793243408, 0.3344650864601135, -1.3392552137374878, 0.23837989568710327, -2.736001968383789, 0.6339554786682129, -0.0013180607929825783, -0.044613972306251526, 0.07093267142772675, -1.3009339570999146, 1.169283390045166, 2.5937135219573975, -1.1341265439987183, 0.3705240786075592, 0.21497657895088196, 1.2624722719192505, -1.624039888381958, 0.2107507437467575, -0.42866623401641846, 2.1403980255126953, 0.17358078062534332, 1.141005516052246, -0.3021266758441925, -2.2422823905944824, 0.6443907022476196, -1.2901465892791748, -1.171104907989502, 0.793624222278595, -0.836166262626648, 0.1616104245185852, -1.395400881767273, -0.15984059870243073, -0.9082701206207275, -1.077142596244812, 0.8134592175483704, 0.08003884553909302, 0.46383190155029297, -0.6762388944625854, 0.337611585855484, -2.167909622192383, -1.3575998544692993, -0.14767976105213165, -0.9666739702224731, 0.4913232922554016, -0.2744752764701843, 0.6677814722061157, -0.18108423054218292, -0.0485692173242569, 0.328063428401947, 1.4348351955413818, 3.4348387718200684, 0.35522812604904175, 0.5140958428382874, -0.19662149250507355, -0.8712856769561768, 1.3903694152832031, 0.9329795837402344, -0.07025881111621857, -0.4886299669742584, -0.9780305624008179, 1.2638615369796753, 1.8990113735198975, 0.953170120716095, 0.09221124649047852, -0.7983513474464417, -0.7264684438705444, -0.090057373046875, 0.262431263923645, 0.2930977940559387, 0.8521277904510498, 0.15939806401729584, -0.0009335167706012726, 1.3485437631607056, 1.1656339168548584, -0.519035279750824, 0.44160279631614685, -0.8495978713035583, -0.3862207531929016, 0.6222702860832214, 0.3239358067512512, -0.046042751520872116, 0.41777729988098145, -1.0024406909942627, -0.33469250798225403, -0.3998444676399231, -0.8282327055931091, -0.67155522108078, -0.35368290543556213, -0.26835155487060547, 1.6164934635162354, -0.06986335664987564, -0.5278724431991577, 0.024161692708730698, -0.8028698563575745, -0.037468429654836655, -1.0665758848190308, 0.18132437765598297, -0.1529969424009323, -0.10533128678798676, -0.07055404037237167, 1.8102067708969116, -0.9339538812637329, -1.9659454822540283, 0.2181388884782791, 0.2687537372112274, -0.4309707283973694, 0.3172169625759125, 1.6339470148086548, 0.5453037619590759, 1.4427028894424438, 1.3832145929336548, 0.9042618870735168, -0.6902685165405273, -1.3791412115097046, 0.5950145125389099, 1.0184868574142456, -1.3268831968307495, 0.9190980792045593, 0.06280848383903503, -0.4468036890029907, 0.5368953347206116, 1.2634577751159668, 0.4139752686023712, -1.9995719194412231, 0.6670043468475342, -0.8581992387771606, 0.828784704208374, 0.6696984171867371, 0.59103924036026, 0.3456066846847534, 0.7882797718048096, -1.219908595085144, -1.1984282732009888, -0.834488034248352, -0.6552165746688843, 1.8276993036270142, -0.25107717514038086, 0.6258144974708557, -0.14147096872329712, -1.2967426776885986, -0.07151781022548676, 0.5960626006126404, 0.42597758769989014, -0.48478826880455017, 0.7933769822120667, -0.6362683176994324, -1.1190407276153564, -1.3125773668289185, -0.5191508531570435, -0.9837716817855835, -1.008415937423706, 1.1069319248199463, 0.8722814917564392, 0.3147064447402954, 1.9619553089141846, 0.7139678001403809, 0.11051887273788452, -2.421177387237549, 0.8290183544158936, 0.3633863031864166, -0.08577868342399597, 0.7611444592475891, 0.48081740736961365, 1.0237843990325928, -0.05374860763549805, 0.5126155018806458, -2.4743423461914062, 2.264267921447754, -0.20083415508270264, 0.6611509323120117, 0.004940729588270187, -0.20736448466777802, 1.0767394304275513, 0.6199992299079895, 0.4750824272632599, -1.013085126876831, 0.48581090569496155, -0.6319452524185181, 1.4034425020217896, 0.8618666529655457, -0.7483087182044983, -0.06593548506498337, 1.385026216506958, 0.5238847136497498, -0.5168817043304443, -0.9063078761100769, -0.8855150938034058, 0.8739001154899597, 1.5482381582260132, 0.026957038789987564, -0.1047295480966568, 0.9374508857727051, 0.7499618530273438, -1.2864327430725098, 0.08077506721019745, -0.751556396484375, -0.8076604008674622, 1.7286953926086426, 2.137779474258423, -0.20948252081871033, -0.11067111790180206, -0.7961562275886536, -1.1303298473358154, 0.8129802942276001, -0.12456199526786804, 0.0029323967173695564, 0.675594687461853, -0.6823262572288513, 1.0887585878372192, 0.8900480270385742, 0.7967748045921326, 0.3409688472747803, 0.3347379267215729, 0.3203941583633423, -0.33946871757507324, -1.1810816526412964, -0.1947978138923645, -1.127761721611023, -2.535240650177002, 0.38777878880500793, -0.3770367205142975, -1.351241946220398, 0.036075618118047714, -1.1238394975662231, 0.8494890332221985, -0.5543214678764343, -1.0129613876342773, -1.418479084968567, 0.27060356736183167, 0.10402067005634308, 0.9542220234870911, -1.5294615030288696, -0.06889881193637848, 1.2431117296218872, 0.8401089310646057, -0.7299410104751587, 0.9452904462814331, 0.2549365162849426, 1.1973929405212402, 0.964496910572052, -0.38166457414627075, 0.49454551935195923, -0.11937233805656433, -1.3376902341842651, 0.5940837860107422, 1.1615346670150757, 0.15410879254341125, 1.5743240118026733, -0.45264604687690735, -0.0964270681142807, 0.36162588000297546, -0.5099166631698608, -0.4517749845981598, -0.8009080290794373, 0.661500096321106, 0.17168082296848297, -0.8549716472625732, 0.0013395696878433228, 0.017608020454645157, -0.3303702175617218, 0.22100433707237244, -1.5585391521453857, -0.018895437940955162, -0.3709961175918579, -0.6243641972541809, -1.1837300062179565, -0.03950081765651703, 1.3022381067276, -0.8064684867858887, -0.14286886155605316, 0.442362517118454, 0.2946462631225586, 0.4692273437976837, 0.7424852252006531, -0.6012192368507385, -0.4809991419315338, -0.3066665232181549, -0.40128517150878906, 0.394914448261261, 1.3579550981521606, -0.16734634339809418, -0.9561781883239746, 0.6140601634979248, -0.3368541896343231, -0.0921008288860321, 1.9610012769699097, 0.04692600667476654, -0.7942050099372864, 0.33834314346313477, -0.6859961748123169, 2.027228832244873, 1.7285867929458618, 1.1847288608551025, -0.1283062994480133, -0.9699339866638184, 0.6600040197372437, -0.360433965921402, -0.4678671658039093, 0.7522338032722473, 0.2750190496444702, -0.18579721450805664, -1.4355931282043457, 0.5828354358673096, 1.341348648071289, -0.8800017237663269, -0.9034944176673889, 0.1034524142742157, -0.7986462712287903, 1.0432358980178833, 0.742148756980896, 0.3379557728767395, 0.4470108449459076, 1.5906893014907837, 0.790946900844574, -0.5265366435050964, 0.46933713555336, 0.4852358400821686, -0.007643412798643112, -2.1763298511505127, -1.1403635740280151, 0.30323928594589233, -0.41956740617752075, -1.6285392045974731, 1.3402736186981201, -1.1625584363937378, -0.8614996671676636, 0.6115831136703491, 0.1100413054227829, 1.3749953508377075, 0.23331789672374725, 1.5240669250488281, 2.045562744140625, 0.7086919546127319, 0.2898387014865875, 1.217944860458374, -0.16994954645633698, -0.5611743927001953, 1.7552090883255005, -0.5264723300933838, 0.5714386701583862, 0.9888626933097839, -0.17824873328208923, -1.1478127241134644, -0.7706482410430908, -1.3283718824386597, -0.7693732380867004, 1.2272692918777466, 0.038130708038806915, -1.216537594795227, 0.176498681306839, 1.5626097917556763, 0.019753791391849518, -0.41447997093200684, 0.5054333209991455, 0.3873809278011322, -0.7744143605232239, -0.0916515439748764, -0.9011253714561462, 0.6460866928100586, 0.02015027217566967, -0.23746660351753235, 0.3897343873977661, 0.5300297141075134, 1.3699450492858887, 0.020375262945890427, 0.19188638031482697, 1.1083431243896484, -1.528428077697754, 1.4657723903656006, -0.726875364780426, 0.2350550889968872, -2.3894996643066406, 1.4086885452270508, -0.7643402814865112, 1.9102575778961182, -2.7541074752807617, 0.37710461020469666, -0.5550011396408081, -0.4836920201778412, 0.3096909821033478, -0.2813948690891266, 0.23660194873809814, -0.2055744081735611, -1.159415602684021, -0.004273940343409777, -0.7799881100654602, 0.4759651720523834, 1.038464069366455, 1.3500280380249023, -1.052565574645996, -0.3425308167934418, -1.7447749376296997, -0.009843595325946808, -0.632490336894989, 0.23533309996128082, -1.9856425523757935, -0.1456867754459381, -1.929968237876892, -2.3532662391662598, -1.4401860237121582, -0.7340348362922668, 1.056870460510254, 0.1214846521615982, -0.9568310379981995, 1.11494779586792, -0.4431634843349457, -1.8182876110076904, 1.0319362878799438, -2.0858848094940186 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
`pa.ListArray.from_arrays` returns empty lists instead of None values. The workaround I added inside `datasets` simply consists in not using `pa.ListArray.from_arrays` :) Once this PR [here ](https://github.com/huggingface/datasets/pull/4282)is merged, we'll release a new version of `datasets` that currectly returns the None values in the case described in this issue EDIT: released :) but let's keep this issue open because it might happen again if users change the integer precision for example
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
968
69
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger `pa.ListArray.from_arrays` returns empty lists instead of None values. The workaround I added inside `datasets` simply consists in not using `pa.ListArray.from_arrays` :) Once this PR [here ](https://github.com/huggingface/datasets/pull/4282)is merged, we'll release a new version of `datasets` that currectly returns the None values in the case described in this issue EDIT: released :) but let's keep this issue open because it might happen again if users change the integer precision for example
[ -1.1787856817245483, -0.7680287957191467, -0.8862252831459045, 1.6177971363067627, -0.03641195222735405, -1.2241778373718262, 0.16572460532188416, -1.1101558208465576, 1.7918046712875366, -0.7246434092521667, 0.3737803101539612, -1.698535442352295, 0.06695874035358429, -0.6996204257011414, -0.8172637820243835, -0.8780892491340637, -0.39208564162254333, -0.6460777521133423, 1.0184290409088135, 2.4352285861968994, 1.2722266912460327, -1.3827803134918213, 2.7181222438812256, 0.7476832270622253, -0.16855625808238983, -0.9743384718894958, 0.5075379014015198, -0.003708890173584223, -1.2812340259552002, -0.4723329544067383, -0.9067029356956482, -0.062186356633901596, -0.5339471697807312, -0.5674839615821838, -0.05625741183757782, 0.43779507279396057, -0.3274153172969818, -0.4357205927371979, -0.49399080872535706, -0.914828896522522, 0.3137732148170471, -0.3013805150985718, 0.9286852478981018, -0.2262473851442337, 1.7817163467407227, -0.6263918876647949, 0.336153119802475, 0.6570638418197632, 1.3428714275360107, 0.21815413236618042, -0.04102689400315285, 0.3860546350479126, 0.3588172495365143, -0.09154018759727478, 0.5123162269592285, 1.2129647731781006, 0.7126402258872986, 0.47018325328826904, 0.8698603510856628, -2.2311575412750244, 1.2378121614456177, -1.1170037984848022, 0.2931827902793884, 1.3087894916534424, -0.9252611994743347, 0.2910272181034088, -1.7046955823898315, -0.03895436227321625, 0.6373571753501892, -2.3175830841064453, 0.25150981545448303, -1.310636043548584, -0.4978080689907074, 0.9747840166091919, 0.3603579103946686, -1.2800289392471313, 0.14754827320575714, -0.35278716683387756, 1.0266923904418945, 0.3878159821033478, 1.1515843868255615, -1.7416192293167114, 0.001218481920659542, -0.36887145042419434, 0.1468798965215683, -1.2478320598602295, -1.517179250717163, 0.5606206655502319, 0.6918174028396606, 0.5481618642807007, -0.20389705896377563, 1.011159896850586, -1.0267423391342163, 0.7593925595283508, -1.0124576091766357, -1.788468360900879, -1.3826754093170166, -2.252943515777588, -2.229016065597534, 0.7060694098472595, -0.499317467212677, -0.5993504524230957, 2.01369571685791, -0.953376054763794, -1.7259337902069092, 1.0803070068359375, 0.36366337537765503, 0.003291570581495762, 2.479208469390869, 0.19203977286815643, -0.7309142351150513, 0.4820987582206726, -0.7835270166397095, 0.762345016002655, -0.38362735509872437, 1.3490709066390991, 0.45218217372894287, -1.1046943664550781, 1.70356285572052, -0.3376540541648865, 0.4935998320579529, -0.8489548563957214, -0.46206238865852356, -0.6852806806564331, 0.31769222021102905, 1.9243321418762207, -0.3438570201396942, 1.567233920097351, -0.2858125567436218, -1.5090783834457397, -1.5069525241851807, 0.8460650444030762, 0.49850142002105713, -0.7362673282623291, 0.10905514657497406, -0.3456146717071533, 0.1528637707233429, -0.10333210229873657, 1.2696882486343384, 1.2316056489944458, 0.6367396712303162, -0.26142042875289917, -0.8200840353965759, 0.2235775589942932, -0.03473740071058273, -0.8231923580169678, -1.6840384006500244, -0.29885950684547424, 0.20473690330982208, 0.6761239171028137, -1.2937936782836914, 1.7876108884811401, 0.7479754686355591, 1.9359080791473389, 1.0665920972824097, -0.4338400065898895, 1.501126766204834, 0.040479470044374466, 1.8450722694396973, -0.5010969638824463, 0.6832026839256287, -0.3800933361053467, -1.1590673923492432, 0.9197202324867249, -0.3522026240825653, -1.9942231178283691, -0.7909215092658997, -0.7849580645561218, -0.07401982694864273, -0.7222528457641602, 0.9812663793563843, -0.3143647015094757, -1.3655754327774048, 0.25703585147857666, -0.7671378254890442, 0.07534834742546082, -1.2531423568725586, 0.2489786446094513, 0.7260428667068481, -0.5758513808250427, 0.11265415698289871, -0.21589691936969757, -1.3164170980453491, -0.46824049949645996, 0.28842809796333313, 1.9098786115646362, -0.7564167380332947, 0.8545255661010742, 1.0939396619796753, -0.6623148322105408, -0.03817657381296158, 0.3737912178039551, -0.34191760420799255, 0.9251394867897034, -1.0376721620559692, -0.5893389582633972, 1.1596773862838745, -0.051889173686504364, -0.6291300058364868, 1.5133769512176514, 0.7715140581130981, -0.998255729675293, -0.2574343681335449, -0.07521077245473862, -0.8528987765312195, 0.14615269005298615, -1.5973552465438843, -0.06778743118047714, 0.4238547682762146, -1.5576248168945312, -0.45844727754592896, -0.17786462604999542, 1.3468633890151978, -0.28322651982307434, 1.4060968160629272, -0.28255870938301086, -0.1713191419839859, -0.3659047782421112, -0.34102553129196167, 0.010922041721642017, -0.21639060974121094, -0.6995319128036499, 0.2800142765045166, -0.6071563363075256, 0.4389735162258148, 1.3435248136520386, 0.3167886734008789, 0.10734500735998154, 0.5017574429512024, 1.1862189769744873, 0.354154109954834, 0.009660490788519382, -0.8449939489364624, -1.5800085067749023, 1.9899543523788452, -1.4623183012008667, 2.0024304389953613, 0.784796953201294, -0.03331724554300308, -1.6743731498718262, -1.8281534910202026, 1.5372209548950195, 1.1516880989074707, 2.2891862392425537, 0.6126683950424194, 0.3649296164512634, -0.8080787658691406, -0.6138460040092468, 0.2429649829864502, -0.997631847858429, -0.7199977040290833, 0.195062056183815, 2.41286301612854, 1.7681218385696411, -0.4048570394515991, -0.2221423238515854, -0.9845682978630066, 1.3769445419311523, -0.22205166518688202, 0.1453174352645874, 1.9531575441360474, -0.21124497056007385, -1.121251106262207, 1.1812207698822021, -2.3767547607421875, 0.024694934487342834, 1.9551433324813843, 0.2832326889038086, 0.007953447289764881, -1.381285309791565, -0.6353321075439453, -0.37300625443458557, -0.4765145182609558, -1.2235283851623535, 0.552720308303833, -0.19924595952033997, -0.7989622950553894, -1.4347087144851685, 0.22693845629692078, -1.0794581174850464, -1.6129870414733887, 0.20432937145233154, 1.8349450826644897, 1.9304330348968506, -0.7831855416297913, 1.6423306465148926, -0.28251901268959045, 0.21916887164115906, 1.2289210557937622, 1.235410213470459, 3.124363660812378, 1.9115447998046875, -1.251015543937683, 0.6409879326820374, -0.14498989284038544, -0.5545921921730042, 1.2338190078735352, -1.2363581657409668, 1.2946776151657104, -0.13517911732196808, -1.3123316764831543, -1.3010406494140625, 0.9494340419769287, 0.498150110244751, 0.027363382279872894, -0.5723184943199158, 1.1477210521697998, 0.07346919924020767, 1.3032666444778442, 0.5354252457618713, -0.19601954519748688, 0.5473982691764832, -0.43819329142570496, -0.4975394606590271, 1.5557774305343628, 0.10039066523313522, -1.439283013343811, -2.3672173023223877, -0.09013665467500687, -0.8255528211593628, 0.04696141928434372, -0.7156866192817688, -1.0511975288391113, 1.7524105310440063, 0.36838430166244507, -1.2869009971618652, -0.2627132534980774, -0.37134578824043274, -0.637691855430603, 2.748863697052002, -1.391708254814148, -0.3187001943588257, -1.0698789358139038, -0.6065465807914734, 1.7110956907272339, -1.1073888540267944, -0.13482223451137543, -0.9661706686019897, -0.4898073971271515, -1.3190058469772339, -0.6267649531364441, -0.03144047409296036, -0.8675166964530945, 0.7425278425216675, 0.11731477826833725, -1.1893672943115234, -0.4264023005962372, -0.8275477290153503, 0.8280898332595825, -0.1984996348619461, 0.2270301878452301, 1.9617688655853271, 0.48857226967811584, -0.3596786558628082, 0.714747428894043, 1.177698016166687, 0.6934236288070679, -0.5473507046699524, 0.3456000089645386, -0.5882570147514343, 0.313280314207077, -1.378365159034729, 0.27838972210884094, -2.7920002937316895, 0.6346076130867004, 0.03360794857144356, 0.03589485213160515, 0.04813414439558983, -1.2578115463256836, 1.1443849802017212, 2.6360719203948975, -1.1637834310531616, 0.43033555150032043, 0.3129904568195343, 1.2178436517715454, -1.6645772457122803, 0.2202727496623993, -0.45325547456741333, 2.179412364959717, 0.13669845461845398, 1.1548041105270386, -0.3737691044807434, -2.2558882236480713, 0.5839061737060547, -1.2868130207061768, -1.1566052436828613, 0.8265944719314575, -0.8707089424133301, 0.1563195139169693, -1.3795288801193237, -0.20235516130924225, -0.859818160533905, -1.1523406505584717, 0.7783516645431519, 0.06755125522613525, 0.46061578392982483, -0.6475273966789246, 0.35262057185173035, -2.1691534519195557, -1.357893943786621, -0.17324690520763397, -0.9809024333953857, 0.47967755794525146, -0.29361554980278015, 0.6771612763404846, -0.1647057980298996, -0.0475015863776207, 0.2989308834075928, 1.4241645336151123, 3.426011085510254, 0.33563220500946045, 0.49038153886795044, -0.15672588348388672, -0.8828278183937073, 1.415371060371399, 0.9497653841972351, -0.1272546648979187, -0.5104445815086365, -1.0073126554489136, 1.2441209554672241, 1.8972488641738892, 1.0531182289123535, 0.07048290222883224, -0.822102427482605, -0.8291814923286438, -0.040128443390131, 0.23471884429454803, 0.3067423105239868, 0.810241162776947, 0.13065236806869507, 0.03256242349743843, 1.3444205522537231, 1.2025097608566284, -0.4882083535194397, 0.411882221698761, -0.8569998145103455, -0.3986314535140991, 0.5409613251686096, 0.3218308389186859, -0.024047961458563805, 0.44964009523391724, -1.0214664936065674, -0.30118662118911743, -0.3699256181716919, -0.845231294631958, -0.6703312397003174, -0.3477218747138977, -0.2641809582710266, 1.607282042503357, 0.013251624070107937, -0.5498966574668884, 0.015437855385243893, -0.781351625919342, -0.04578651115298271, -1.0330299139022827, 0.22136440873146057, -0.13346722722053528, -0.11838287860155106, -0.10032429546117783, 1.7766773700714111, -0.9431337118148804, -2.0610029697418213, 0.22235827147960663, 0.28234511613845825, -0.4446505308151245, 0.29693272709846497, 1.6582186222076416, 0.5456088781356812, 1.4345446825027466, 1.3882861137390137, 0.9571059942245483, -0.6784539222717285, -1.373421549797058, 0.594134509563446, 1.0349371433258057, -1.2990201711654663, 0.895666241645813, 0.00565408356487751, -0.40284809470176697, 0.5396537184715271, 1.3262656927108765, 0.4471459984779358, -2.028156042098999, 0.6978840827941895, -0.8551964163780212, 0.7671769857406616, 0.6656333208084106, 0.6196004152297974, 0.23559336364269257, 0.741793692111969, -1.1960304975509644, -1.218121886253357, -0.7538861632347107, -0.7005413174629211, 1.8345941305160522, -0.2171945571899414, 0.6164067983627319, -0.1796768307685852, -1.3816595077514648, -0.060821283608675, 0.612703800201416, 0.3715062439441681, -0.5002999901771545, 0.8265295624732971, -0.6505115628242493, -1.1258213520050049, -1.3071516752243042, -0.468217670917511, -0.9849438071250916, -0.9915845394134521, 1.0607261657714844, 0.8578256964683533, 0.2728489339351654, 1.9252060651779175, 0.6694843769073486, 0.1383867859840393, -2.5304617881774902, 0.830232560634613, 0.3988604247570038, -0.0681435838341713, 0.7918908596038818, 0.4432113766670227, 1.0300331115722656, -0.05610160902142525, 0.5288474559783936, -2.4260308742523193, 2.27659273147583, -0.19709312915802002, 0.6814436316490173, -0.019444815814495087, -0.2323456108570099, 1.0532220602035522, 0.6053340435028076, 0.5264726281166077, -1.052154302597046, 0.5486640334129333, -0.6381330490112305, 1.3042716979980469, 0.8389104604721069, -0.7689329981803894, -0.06611189246177673, 1.3654733896255493, 0.5213819146156311, -0.5049299597740173, -0.9084931015968323, -0.9527654647827148, 0.9114705324172974, 1.5921913385391235, 0.010923304595053196, -0.043180882930755615, 0.9177330732345581, 0.7095322012901306, -1.2812756299972534, 0.10584256798028946, -0.7532387375831604, -0.8198329210281372, 1.7196203470230103, 2.127366304397583, -0.1908816248178482, -0.1655963957309723, -0.8111746907234192, -1.1253470182418823, 0.7411186695098877, -0.08745800703763962, 0.06330025941133499, 0.6630647778511047, -0.6591190695762634, 1.1233916282653809, 0.8654814958572388, 0.8099724054336548, 0.2710602879524231, 0.3291538655757904, 0.3234407305717468, -0.36170047521591187, -1.236116886138916, -0.2644038498401642, -1.1119470596313477, -2.508692741394043, 0.3610328137874603, -0.30645060539245605, -1.3222918510437012, 0.027605324983596802, -1.1011531352996826, 0.8426235318183899, -0.5583087801933289, -1.0680791139602661, -1.4047681093215942, 0.24808421730995178, 0.05152468383312225, 0.9209084510803223, -1.5288814306259155, -0.055135443806648254, 1.2406010627746582, 0.8534306883811951, -0.7333972454071045, 0.9193663597106934, 0.22192873060703278, 1.1577855348587036, 0.9791023135185242, -0.3496445119380951, 0.5074869394302368, -0.03077811747789383, -1.3571521043777466, 0.5314621329307556, 1.1355892419815063, 0.1456674188375473, 1.5577058792114258, -0.47931554913520813, -0.07989991456270218, 0.392072856426239, -0.4800774157047272, -0.4937165379524231, -0.7337799668312073, 0.6603128910064697, 0.11607647687196732, -0.8642067909240723, 0.058199625462293625, 0.014141920022666454, -0.27140578627586365, 0.1945854276418686, -1.596452236175537, -0.042353175580501556, -0.3400333821773529, -0.5840170383453369, -1.1746073961257935, -0.0594499371945858, 1.3077685832977295, -0.7933185696601868, -0.1928243637084961, 0.46500617265701294, 0.2981763184070587, 0.4628618359565735, 0.7327486872673035, -0.5651832818984985, -0.44136467576026917, -0.24757279455661774, -0.40770313143730164, 0.4041769504547119, 1.3317989110946655, -0.1612577587366104, -0.9321931004524231, 0.6514196395874023, -0.34801119565963745, -0.04251731187105179, 1.945530652999878, 0.061378028243780136, -0.8166736960411072, 0.32994839549064636, -0.6382465362548828, 1.9584221839904785, 1.76264226436615, 1.2488090991973877, -0.13956627249717712, -0.9978604912757874, 0.6839066743850708, -0.38170257210731506, -0.47279855608940125, 0.8190006017684937, 0.32778415083885193, -0.18139752745628357, -1.445719838142395, 0.5700104832649231, 1.3323214054107666, -0.8839846849441528, -0.8942661285400391, 0.10180231928825378, -0.8563961386680603, 1.053362488746643, 0.7421069741249084, 0.2963663935661316, 0.3719327449798584, 1.6076538562774658, 0.7480278015136719, -0.48085036873817444, 0.5086632966995239, 0.4760591387748718, -0.10403157770633698, -2.1413915157318115, -1.1502214670181274, 0.27144068479537964, -0.43174028396606445, -1.6294955015182495, 1.3599345684051514, -1.1736011505126953, -0.9177899956703186, 0.5490841269493103, 0.05326152965426445, 1.3896950483322144, 0.196883887052536, 1.5581164360046387, 2.0573318004608154, 0.7310599684715271, 0.26593267917633057, 1.1870501041412354, -0.16236425936222076, -0.529252290725708, 1.7808523178100586, -0.5389771461486816, 0.5616025328636169, 1.0325380563735962, -0.23190873861312866, -1.1368383169174194, -0.7994197010993958, -1.284175992012024, -0.7586866021156311, 1.2190779447555542, 0.05557004734873772, -1.2118829488754272, 0.2348630428314209, 1.5430407524108887, 0.05844167247414589, -0.3709704577922821, 0.5854808688163757, 0.43306827545166016, -0.8268128037452698, -0.08746969699859619, -0.9019450545310974, 0.6468838453292847, -0.054876357316970825, -0.21886184811592102, 0.37261155247688293, 0.5060096383094788, 1.3501521348953247, 0.025129176676273346, 0.15119795501232147, 1.1127614974975586, -1.5052469968795776, 1.499880075454712, -0.7314777374267578, 0.3223249018192291, -2.3923165798187256, 1.4292829036712646, -0.7725595831871033, 1.8909775018692017, -2.718583583831787, 0.42198172211647034, -0.5388574004173279, -0.4772922694683075, 0.33947575092315674, -0.3169531524181366, 0.21611979603767395, -0.1767500340938568, -1.1473366022109985, -0.07340483367443085, -0.742897093296051, 0.4700598120689392, 1.0964393615722656, 1.3809919357299805, -0.997719407081604, -0.36097297072410583, -1.7570767402648926, -0.07733700424432755, -0.6238313913345337, 0.2633678615093231, -1.950514316558838, -0.18231143057346344, -1.9483975172042847, -2.3706557750701904, -1.355391025543213, -0.7595159411430359, 1.0486012697219849, 0.11582877486944199, -0.946637749671936, 1.1367608308792114, -0.45631587505340576, -1.841132640838623, 1.0428024530410767, -2.097303628921509 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
Yes, we decided to replace the encoded label with the corresponding label when possible in the dataset viewer. But 1. maybe it's the wrong default 2. we could find a way to show both (with a switch, or showing both ie. `0 (neutral)`).
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
970
43
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 Yes, we decided to replace the encoded label with the corresponding label when possible in the dataset viewer. But 1. maybe it's the wrong default 2. we could find a way to show both (with a switch, or showing both ie. `0 (neutral)`).
[ -1.1885920763015747, -0.8964242339134216, -0.8215885162353516, 1.4476042985916138, -0.21867793798446655, -1.2799710035324097, 0.15325555205345154, -1.0769917964935303, 1.745485544204712, -0.8974407911300659, 0.3682152032852173, -1.7433717250823975, 0.07784321904182434, -0.522814154624939, -0.7468084692955017, -0.8767776489257812, -0.44254711270332336, -0.7419815063476562, 0.9928688406944275, 2.464721918106079, 1.1900752782821655, -1.317007064819336, 2.6763718128204346, 0.5991513729095459, -0.13005289435386658, -0.9954284429550171, 0.5991084575653076, -0.03213009983301163, -1.3469629287719727, -0.3970949351787567, -1.0140396356582642, -0.11398901045322418, -0.4845840036869049, -0.6125004291534424, 0.0044702086597681046, 0.318727970123291, -0.3598152995109558, -0.4041256010532379, -0.47584062814712524, -0.925303041934967, 0.44110292196273804, -0.38097837567329407, 0.9473797082901001, -0.42400604486465454, 1.893838882446289, -0.5570465922355652, 0.5518221855163574, 0.779349684715271, 1.343879222869873, 0.13020750880241394, -0.05661972612142563, 0.3799935281276703, 0.38651925325393677, 0.14318585395812988, 0.4350610673427582, 1.1107299327850342, 0.5451831221580505, 0.4886956214904785, 0.7720835208892822, -2.233536958694458, 1.3660508394241333, -1.0469752550125122, 0.26813244819641113, 1.3293253183364868, -1.045645833015442, 0.31866854429244995, -1.7264667749404907, -0.0902162566781044, 0.5025858879089355, -2.26481294631958, 0.20246517658233643, -1.3330531120300293, -0.4460794925689697, 0.9766326546669006, 0.3598925471305847, -1.1864594221115112, 0.031978853046894073, -0.3889845609664917, 0.8516407608985901, 0.5414547324180603, 1.1728665828704834, -1.5923341512680054, -0.022396448999643326, -0.360553115606308, 0.15132486820220947, -1.3433845043182373, -1.5331571102142334, 0.5845425724983215, 0.6989859938621521, 0.4574844539165497, -0.17712554335594177, 1.0295675992965698, -0.9319223761558533, 0.7552794814109802, -0.9239515662193298, -1.7645407915115356, -1.4051889181137085, -2.271428346633911, -2.2513632774353027, 0.7448358535766602, -0.5081220865249634, -0.5621546506881714, 2.1322641372680664, -1.1295225620269775, -1.7416801452636719, 1.160597801208496, 0.17521435022354126, 0.05573948472738266, 2.3806614875793457, 0.19061613082885742, -0.6244150400161743, 0.4946447014808655, -0.7014473080635071, 0.7869247794151306, -0.3458922505378723, 1.310907006263733, 0.499853253364563, -1.1065447330474854, 1.5751442909240723, -0.34067532420158386, 0.5326172113418579, -0.5851295590400696, -0.3965453803539276, -0.7867779731750488, 0.24716466665267944, 1.8112128973007202, -0.29273363947868347, 1.5219919681549072, -0.2733599543571472, -1.543171763420105, -1.5982145071029663, 0.7965518832206726, 0.4542381167411804, -0.77005934715271, 0.10452955961227417, -0.23121657967567444, 0.10249535739421844, 0.03506803512573242, 1.2186037302017212, 1.3094984292984009, 0.7485434412956238, -0.29675954580307007, -0.9415355324745178, 0.1844342052936554, -0.05891447141766548, -0.7573164105415344, -1.7165067195892334, -0.4024507403373718, 0.07597150653600693, 0.7245255708694458, -1.1285008192062378, 1.8053500652313232, 0.9725300669670105, 1.8449610471725464, 1.018966794013977, -0.2689424157142639, 1.5187870264053345, 0.0821646973490715, 1.8319947719573975, -0.4711460471153259, 0.7008376121520996, -0.4627005457878113, -1.152695894241333, 0.8691983819007874, -0.3126453459262848, -1.9953306913375854, -0.7616016268730164, -0.9959105253219604, -0.23405295610427856, -0.7531712055206299, 1.0766950845718384, -0.3364388346672058, -1.279090166091919, 0.31678396463394165, -0.6551303863525391, 0.02447432652115822, -1.23760187625885, 0.3393266797065735, 0.6745522618293762, -0.68387371301651, -0.006950484123080969, -0.28063157200813293, -1.3913685083389282, -0.46119609475135803, 0.21434977650642395, 1.8673268556594849, -0.8251661062240601, 1.0485681295394897, 0.9780294299125671, -0.7963771224021912, -0.07117784768342972, 0.32086122035980225, -0.24031716585159302, 0.8448778390884399, -0.999100923538208, -0.41004517674446106, 1.2079278230667114, -0.23104283213615417, -0.6402681469917297, 1.481921672821045, 0.6501463651657104, -0.9550713300704956, -0.1782938539981842, -0.1443614959716797, -0.8213439583778381, -0.02906429022550583, -1.5506221055984497, -0.07790989428758621, 0.32839903235435486, -1.4966388940811157, -0.5342459678649902, -0.14846765995025635, 1.2792627811431885, -0.09116110950708389, 1.3801422119140625, -0.3905145227909088, -0.336410254240036, -0.500964343547821, -0.39291179180145264, 0.1638483703136444, -0.1555769443511963, -0.7036358714103699, 0.21744710206985474, -0.798132061958313, 0.3152853548526764, 1.3994855880737305, 0.419637531042099, 0.06215646117925644, 0.7132003307342529, 1.102346420288086, 0.35101017355918884, -0.02355080470442772, -0.8345309495925903, -1.6541577577590942, 2.074594497680664, -1.428666114807129, 1.9352577924728394, 0.6424033045768738, -0.09382453560829163, -1.8173165321350098, -1.9570246934890747, 1.3367211818695068, 1.1741950511932373, 2.2578370571136475, 0.5573461055755615, 0.409196674823761, -0.773137629032135, -0.6295472979545593, 0.38270148634910583, -1.0677639245986938, -0.7170768976211548, 0.049061574041843414, 2.3425981998443604, 1.7240382432937622, -0.5024402141571045, -0.06026234105229378, -1.0800150632858276, 1.344204306602478, -0.11529466509819031, 0.2064817249774933, 1.9407109022140503, -0.33966949582099915, -1.1327672004699707, 1.2751128673553467, -2.237569808959961, 0.09714111685752869, 1.9960638284683228, 0.2703278958797455, 0.010784637182950974, -1.3674896955490112, -0.6508561968803406, -0.19010111689567566, -0.458322137594223, -1.2811279296875, 0.5796109437942505, -0.23037385940551758, -0.7978346347808838, -1.4236338138580322, 0.12392335385084152, -1.1644338369369507, -1.7324639558792114, 0.2742488980293274, 1.8473597764968872, 2.0448880195617676, -0.5999916791915894, 1.4973796606063843, -0.23811110854148865, 0.20698282122612, 1.2302247285842896, 1.2516577243804932, 3.12054181098938, 1.9682327508926392, -1.2557125091552734, 0.6972974538803101, -0.02770458161830902, -0.49481621384620667, 1.3214268684387207, -1.155756950378418, 1.3372136354446411, -0.15024060010910034, -1.1784707307815552, -1.1746573448181152, 0.8907074928283691, 0.3954290449619293, 0.026259202510118484, -0.4036826491355896, 1.2571672201156616, 0.06830412894487381, 1.2705107927322388, 0.5531527996063232, -0.3543999195098877, 0.6762356162071228, -0.45879754424095154, -0.4921267330646515, 1.545307993888855, 0.2178894579410553, -1.409782886505127, -2.3238487243652344, -0.2104591429233551, -0.8185955882072449, 0.07629808783531189, -0.5617218017578125, -0.8487345576286316, 1.732973575592041, 0.3999145030975342, -1.2106726169586182, -0.28450676798820496, -0.4265873432159424, -0.6589987874031067, 2.739705801010132, -1.4365993738174438, -0.27983975410461426, -1.0182474851608276, -0.724929928779602, 1.6112439632415771, -1.3120753765106201, -0.18062371015548706, -1.0536400079727173, -0.49222415685653687, -1.3739774227142334, -0.5737705826759338, -0.0026310025714337826, -1.0542629957199097, 0.8251578211784363, 0.09063014388084412, -1.1582590341567993, -0.32069504261016846, -0.892167329788208, 0.8361067175865173, -0.12279835343360901, 0.21159711480140686, 1.8699877262115479, 0.38445666432380676, -0.3945690095424652, 0.6568719744682312, 1.127634048461914, 0.6381566524505615, -0.5801210999488831, 0.3099128305912018, -0.7057231068611145, 0.33081111311912537, -1.276116967201233, 0.2671966254711151, -2.860262155532837, 0.5953096151351929, -0.15508851408958435, -0.09435643255710602, -0.0632288008928299, -1.337744951248169, 1.0300638675689697, 2.565570592880249, -1.2228010892868042, 0.4139716923236847, 0.18022340536117554, 1.205057144165039, -1.6159173250198364, 0.3094593584537506, -0.46588778495788574, 2.128169536590576, 0.22267279028892517, 1.124617338180542, -0.40872180461883545, -2.1864020824432373, 0.6862037181854248, -1.2032686471939087, -1.1403528451919556, 0.7652484774589539, -0.7861499786376953, 0.11248898506164551, -1.310722827911377, -0.16167479753494263, -0.7897902727127075, -1.1342586278915405, 0.7287477850914001, 0.10209590941667557, 0.5055118799209595, -0.5718790888786316, 0.25497761368751526, -2.1757476329803467, -1.3520206212997437, -0.24775275588035583, -0.8617803454399109, 0.480082243680954, -0.3411731719970703, 0.7347261309623718, -0.24120473861694336, 0.03243475407361984, 0.4024246335029602, 1.392993688583374, 3.3719394207000732, 0.1583232581615448, 0.4187960922718048, -0.12079519033432007, -1.0419620275497437, 1.5041673183441162, 0.9702305197715759, -0.14255395531654358, -0.46359461545944214, -1.0344719886779785, 1.2182096242904663, 1.9414708614349365, 0.8791727423667908, 0.07035820931196213, -0.8224309682846069, -0.6683778166770935, -0.0166508536785841, 0.0689406543970108, 0.5380567312240601, 0.9050124883651733, 0.09078820794820786, 0.16474643349647522, 1.5541855096817017, 1.206021785736084, -0.25961917638778687, 0.37077343463897705, -0.7385117411613464, -0.47005295753479004, 0.6004694104194641, 0.3972433805465698, -0.024350708350539207, 0.38914889097213745, -0.9925892353057861, -0.3080197274684906, -0.2852841317653656, -0.9616730213165283, -0.6764494776725769, -0.47119471430778503, -0.4121635854244232, 1.6679421663284302, 0.02292352169752121, -0.5278285145759583, -0.03945977985858917, -0.8188639283180237, 0.004089068621397018, -1.0227750539779663, 0.28485867381095886, -0.18658903241157532, -0.09803740680217743, -0.07332400977611542, 1.6911847591400146, -0.945675790309906, -2.06626033782959, 0.3194575309753418, 0.22858315706253052, -0.3504911959171295, 0.1537151336669922, 1.5242007970809937, 0.6657617092132568, 1.4894605875015259, 1.4477206468582153, 0.9766416549682617, -0.6535354852676392, -1.3691542148590088, 0.6564663648605347, 0.8622452020645142, -1.45426607131958, 0.8926259279251099, -0.023102492094039917, -0.5809146761894226, 0.5808882713317871, 1.1850435733795166, 0.4563724994659424, -1.9648278951644897, 0.7755838632583618, -0.8619685769081116, 0.839821457862854, 0.7236121296882629, 0.8015438914299011, 0.15692701935768127, 0.7876001000404358, -1.172680377960205, -1.1267918348312378, -0.7196474075317383, -0.7480369806289673, 1.931107521057129, -0.2853926718235016, 0.5999996066093445, -0.2917081415653229, -1.3380426168441772, -0.05407300963997841, 0.6035635471343994, 0.2687198519706726, -0.44972655177116394, 0.7517749071121216, -0.6852641701698303, -1.1884652376174927, -1.4516702890396118, -0.4979970455169678, -1.0689055919647217, -0.9294101595878601, 1.0847197771072388, 0.7539204955101013, 0.25563186407089233, 1.9122707843780518, 0.6224111318588257, 0.18713051080703735, -2.646941900253296, 0.8471848964691162, 0.2871888279914856, 0.01440102607011795, 0.7770306468009949, 0.28744736313819885, 1.1035245656967163, -0.15598735213279724, 0.535711944103241, -2.3729891777038574, 2.2890498638153076, -0.32397475838661194, 0.6851039528846741, 0.06247669458389282, -0.16471821069717407, 1.0610038042068481, 0.5976749658584595, 0.6494010090827942, -1.0945894718170166, 0.6953368186950684, -0.6965761184692383, 1.2672619819641113, 1.047481656074524, -0.8172978758811951, 0.0047828881070017815, 1.3923535346984863, 0.5579057931900024, -0.5198133587837219, -0.896584153175354, -0.9572239518165588, 0.9581988453865051, 1.7914031744003296, -0.06351008266210556, 0.08660680055618286, 0.867901623249054, 0.6977899074554443, -1.2897831201553345, 0.1052083820104599, -0.8371444940567017, -0.7078432440757751, 1.6129398345947266, 2.0840606689453125, -0.08985882252454758, -0.14482781291007996, -0.8199113011360168, -1.2140862941741943, 0.791735827922821, 0.09421072155237198, 0.05063885077834129, 0.7431683540344238, -0.5880210995674133, 1.1146787405014038, 0.8726041316986084, 0.9554710388183594, 0.29911836981773376, 0.34700658917427063, 0.27765724062919617, -0.20373228192329407, -1.1489830017089844, -0.18553104996681213, -0.9535242915153503, -2.585021495819092, 0.5142658352851868, -0.3260519206523895, -1.4995944499969482, 0.013574589043855667, -1.0528247356414795, 0.8787215352058411, -0.48484209179878235, -1.1021722555160522, -1.5232832431793213, 0.1456308364868164, -0.06392870843410492, 0.8392085433006287, -1.5639348030090332, -0.048356980085372925, 1.302512288093567, 0.9872087836265564, -0.731328010559082, 0.9971126914024353, 0.238224595785141, 1.1010452508926392, 0.8842717409133911, -0.4551645815372467, 0.5512638092041016, 0.09348529577255249, -1.3237766027450562, 0.44099605083465576, 1.1231881380081177, 0.20256340503692627, 1.4414191246032715, -0.5467609167098999, 0.07410287111997604, 0.47848623991012573, -0.42042776942253113, -0.4780433475971222, -0.6012051701545715, 0.7076833844184875, -0.03260663524270058, -0.8503944277763367, 0.012879380956292152, -0.03842639550566673, -0.26855915784835815, 0.26077553629875183, -1.4421674013137817, -0.14292144775390625, -0.3269839584827423, -0.6390596628189087, -1.2387202978134155, -0.14334705471992493, 1.3961085081100464, -0.7536401152610779, -0.046652618795633316, 0.44131219387054443, 0.22797080874443054, 0.5348128080368042, 0.6545747518539429, -0.7148008942604065, -0.32736101746559143, -0.2103058099746704, -0.3676551878452301, 0.3613063395023346, 1.3289719820022583, -0.22243836522102356, -0.9884219765663147, 0.6926881670951843, -0.24638399481773376, 0.09538982063531876, 1.8981728553771973, 0.05632736533880234, -0.7568817734718323, 0.3044661283493042, -0.7185001373291016, 1.8807049989700317, 1.7211217880249023, 1.3604706525802612, -0.07341527193784714, -1.0146557092666626, 0.5877004265785217, -0.34493082761764526, -0.33028507232666016, 0.8744511008262634, 0.3475276529788971, -0.1444491744041443, -1.3147964477539062, 0.7645248174667358, 1.2437095642089844, -0.9295542240142822, -0.8178949952125549, 0.09856079518795013, -0.8372933268547058, 1.1011440753936768, 0.7201099991798401, 0.4773312509059906, 0.24406147003173828, 1.6092166900634766, 0.7118858098983765, -0.5002872943878174, 0.4887726306915283, 0.521577775478363, -0.08962368965148926, -2.0166735649108887, -1.1425926685333252, 0.3245003819465637, -0.5474451184272766, -1.5964539051055908, 1.3842710256576538, -1.2213281393051147, -0.9357293248176575, 0.5071007013320923, 0.1450561285018921, 1.493796944618225, 0.37923768162727356, 1.6028369665145874, 2.0416412353515625, 0.8998526334762573, 0.38894325494766235, 1.3453902006149292, -0.10641820728778839, -0.39109110832214355, 1.719775676727295, -0.4127846956253052, 0.4798092246055603, 1.0783954858779907, -0.38064226508140564, -1.0140466690063477, -0.7962861657142639, -1.2093391418457031, -0.6804957389831543, 1.074899435043335, 0.08980165421962738, -1.138057827949524, 0.22680675983428955, 1.504797101020813, 0.10881133377552032, -0.2854563295841217, 0.6388810873031616, 0.4141422212123871, -0.6760968565940857, -0.06141078844666481, -0.9268330931663513, 0.4958999752998352, -0.2606276571750641, -0.42022383213043213, 0.38309550285339355, 0.45004960894584656, 1.3019654750823975, 0.0036028577014803886, 0.13978102803230286, 1.2356544733047485, -1.4056397676467896, 1.4902057647705078, -0.6865199208259583, 0.1711394488811493, -2.3374850749969482, 1.4411940574645996, -0.8678693175315857, 1.9706480503082275, -2.7033162117004395, 0.39194247126579285, -0.546370804309845, -0.47549763321876526, 0.3142513632774353, -0.315096378326416, 0.1114300787448883, -0.13487344980239868, -1.1240978240966797, -0.004185243975371122, -0.7423940300941467, 0.5171387791633606, 1.1154283285140991, 1.3361793756484985, -1.1576383113861084, -0.3893033266067505, -1.7892292737960815, -0.1406298577785492, -0.6387171745300293, 0.286211758852005, -1.924390435218811, -0.27562108635902405, -1.9422498941421509, -2.49361515045166, -1.3106272220611572, -0.871191680431366, 1.2243099212646484, 0.08309415727853775, -0.881402313709259, 1.1020334959030151, -0.27585768699645996, -1.8820627927780151, 1.1418566703796387, -2.2144527435302734 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
Hi @severo, Thanks for clarifying. I think this default is a bit counterintuitive for the user. However, this is a personal opinion that might not be general. I think it is nice to have the actual (non-encoded) labels in the viewer. On the other hand, it would be nice to match what the user sees with what they get when they download a dataset. I don't know - I can see the difficulty of choosing a default :) Maybe having non-encoded labels as a default can be useful? Anyway, I think the issue has been addressed. Thanks a lot for your super-quick answer!
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
970
103
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 Hi @severo, Thanks for clarifying. I think this default is a bit counterintuitive for the user. However, this is a personal opinion that might not be general. I think it is nice to have the actual (non-encoded) labels in the viewer. On the other hand, it would be nice to match what the user sees with what they get when they download a dataset. I don't know - I can see the difficulty of choosing a default :) Maybe having non-encoded labels as a default can be useful? Anyway, I think the issue has been addressed. Thanks a lot for your super-quick answer!
[ -1.1730613708496094, -0.8764906525611877, -0.8184439539909363, 1.320812463760376, -0.19348454475402832, -1.2684595584869385, 0.1221456453204155, -1.0814582109451294, 1.7375649213790894, -0.8894008994102478, 0.35953912138938904, -1.6899840831756592, 0.08711229264736176, -0.5265528559684753, -0.8118162155151367, -0.8670898675918579, -0.45977750420570374, -0.7919277548789978, 1.0182721614837646, 2.5259225368499756, 1.1643728017807007, -1.4302189350128174, 2.6564595699310303, 0.6362549662590027, -0.09638652950525284, -0.9732590913772583, 0.564721405506134, -0.022485408931970596, -1.3285290002822876, -0.3810708820819855, -0.9948484897613525, -0.09231657534837723, -0.5410629510879517, -0.5522638559341431, 0.0024317316710948944, 0.3087049424648285, -0.31568312644958496, -0.45219045877456665, -0.4480209946632385, -0.8667852282524109, 0.43977758288383484, -0.3438907563686371, 0.9989508986473083, -0.3520307242870331, 1.870936632156372, -0.5246606469154358, 0.49221014976501465, 0.7744267582893372, 1.3413596153259277, 0.16696009039878845, -0.06308739632368088, 0.28338977694511414, 0.37172800302505493, 0.07256881147623062, 0.4598367214202881, 1.1043072938919067, 0.6216777563095093, 0.5033158659934998, 0.7376565337181091, -2.2228050231933594, 1.343359112739563, -1.0694870948791504, 0.30494678020477295, 1.357085943222046, -1.0125261545181274, 0.3979344069957733, -1.7797914743423462, -0.08635200560092926, 0.5652125477790833, -2.248654842376709, 0.18420346081256866, -1.2916597127914429, -0.4416486918926239, 0.9801792502403259, 0.26832011342048645, -1.2478467226028442, 0.0922909677028656, -0.41881588101387024, 0.9192711710929871, 0.5187253355979919, 1.1944856643676758, -1.7043852806091309, -0.007911712862551212, -0.34062376618385315, 0.2279844880104065, -1.379313588142395, -1.5262117385864258, 0.5708202719688416, 0.701714277267456, 0.47984838485717773, -0.11437409371137619, 0.9672325253486633, -1.0169892311096191, 0.8007867336273193, -0.9544380903244019, -1.691343903541565, -1.4392794370651245, -2.2946858406066895, -2.338931083679199, 0.7666996121406555, -0.47355031967163086, -0.549759030342102, 2.138937473297119, -1.1188420057296753, -1.654613733291626, 1.1938271522521973, 0.16219043731689453, 0.08703017234802246, 2.4735007286071777, 0.15459425747394562, -0.7054541110992432, 0.5626556873321533, -0.706766664981842, 0.7557216286659241, -0.39979425072669983, 1.2921944856643677, 0.5065480470657349, -1.0343692302703857, 1.619612693786621, -0.47931230068206787, 0.4719797968864441, -0.5975415706634521, -0.4095744490623474, -0.7736489772796631, 0.26817524433135986, 1.7653253078460693, -0.2526978552341461, 1.554931402206421, -0.32519805431365967, -1.5948859453201294, -1.6049118041992188, 0.8030126690864563, 0.45882555842399597, -0.8603633046150208, 0.14191468060016632, -0.26026153564453125, 0.1191532239317894, 0.021121695637702942, 1.1596951484680176, 1.2642064094543457, 0.7382103800773621, -0.23009401559829712, -0.944131076335907, 0.2379685789346695, -0.11075521260499954, -0.7782276272773743, -1.712310791015625, -0.3733704686164856, 0.05695880949497223, 0.6900137662887573, -1.143972396850586, 1.8900285959243774, 0.9287086725234985, 1.815368890762329, 0.9733343720436096, -0.29739025235176086, 1.5113518238067627, 0.11078156530857086, 1.8501250743865967, -0.47910237312316895, 0.7144111394882202, -0.4605429470539093, -1.1301305294036865, 0.8313369154930115, -0.3577049672603607, -2.0028676986694336, -0.6924951672554016, -0.9189311861991882, -0.2441435307264328, -0.7587633728981018, 0.9847783446311951, -0.23188461363315582, -1.323746919631958, 0.3838162124156952, -0.6542503237724304, 0.06301502138376236, -1.2611098289489746, 0.39723384380340576, 0.7128998637199402, -0.6403089761734009, 0.04952012002468109, -0.3029358386993408, -1.3987140655517578, -0.4091692864894867, 0.22495049238204956, 1.8707672357559204, -0.7971195578575134, 0.9600134491920471, 0.9123852252960205, -0.6459715962409973, -0.10129395127296448, 0.39502426981925964, -0.296036958694458, 0.833177387714386, -1.034179449081421, -0.41995593905448914, 1.1827178001403809, -0.23133958876132965, -0.5706380605697632, 1.3865382671356201, 0.658485472202301, -0.9603973031044006, -0.18414244055747986, -0.18789249658584595, -0.8814711570739746, -0.040584951639175415, -1.593039870262146, 0.008151581510901451, 0.3185613751411438, -1.5121597051620483, -0.5048130750656128, -0.08095446228981018, 1.2156906127929688, -0.17078761756420135, 1.401098608970642, -0.43036869168281555, -0.24731557071208954, -0.506120502948761, -0.3612213432788849, 0.1930347979068756, -0.15472456812858582, -0.6623186469078064, 0.20313400030136108, -0.8262855410575867, 0.29383331537246704, 1.3889228105545044, 0.43009647727012634, 0.0388762429356575, 0.6091018915176392, 1.100778579711914, 0.32174357771873474, 0.008649347350001335, -0.8407900333404541, -1.5974384546279907, 2.1219091415405273, -1.4795172214508057, 1.9347938299179077, 0.7093928456306458, -0.08462753891944885, -1.7940996885299683, -1.845226526260376, 1.3278692960739136, 1.136745810508728, 2.2802021503448486, 0.5320624709129333, 0.3909449875354767, -0.7796443700790405, -0.6227990984916687, 0.41408205032348633, -1.0695676803588867, -0.7900887727737427, 0.10096435248851776, 2.324493408203125, 1.725390076637268, -0.4793204963207245, -0.12134361267089844, -1.046966314315796, 1.4194048643112183, -0.1615409404039383, 0.21866074204444885, 1.9416782855987549, -0.3518493175506592, -1.1273517608642578, 1.2924911975860596, -2.3263611793518066, 0.1411755532026291, 1.9969779253005981, 0.2942231595516205, 0.039980947971343994, -1.371242642402649, -0.6459323167800903, -0.17000900208950043, -0.44178274273872375, -1.2554510831832886, 0.5668609738349915, -0.27844199538230896, -0.7692342400550842, -1.440614104270935, 0.10573126375675201, -1.1967570781707764, -1.7094782590866089, 0.21650788187980652, 1.79263436794281, 2.09307861328125, -0.7115530967712402, 1.4959197044372559, -0.21365363895893097, 0.24478228390216827, 1.206386923789978, 1.193621039390564, 3.157310724258423, 1.9293664693832397, -1.2399942874908447, 0.6621113419532776, -0.09055520594120026, -0.4900842010974884, 1.2360022068023682, -1.1431819200515747, 1.2903023958206177, -0.13698816299438477, -1.2137919664382935, -1.1583484411239624, 0.9057140946388245, 0.41455015540122986, 0.04962144047021866, -0.43984702229499817, 1.2429096698760986, 0.08963481336832047, 1.3333803415298462, 0.5714558362960815, -0.31356745958328247, 0.6486017107963562, -0.5085858702659607, -0.502975583076477, 1.5665677785873413, 0.18987460434436798, -1.3768943548202515, -2.314592123031616, -0.2600105404853821, -0.8254038691520691, 0.06354691833257675, -0.6298816204071045, -0.8772678375244141, 1.696408748626709, 0.40768662095069885, -1.2077544927597046, -0.297385573387146, -0.4287731349468231, -0.6881722807884216, 2.710069179534912, -1.5022099018096924, -0.27263087034225464, -1.013315200805664, -0.7466364502906799, 1.6059916019439697, -1.2735720872879028, -0.17691875994205475, -1.1042976379394531, -0.5694243311882019, -1.3562020063400269, -0.5773147344589233, -0.061105601489543915, -0.9604452848434448, 0.7784044742584229, 0.18311187624931335, -1.1809237003326416, -0.3722652494907379, -0.9107409119606018, 0.7491021752357483, -0.09863314032554626, 0.2417486160993576, 1.818892002105713, 0.3398561477661133, -0.43340152502059937, 0.6491689085960388, 1.1136877536773682, 0.669605553150177, -0.5738738179206848, 0.24361301958560944, -0.7391321063041687, 0.39064356684684753, -1.2426116466522217, 0.2750018537044525, -2.8647713661193848, 0.6052157878875732, -0.08482915908098221, -0.09987274557352066, -0.05957460403442383, -1.3171203136444092, 1.0435056686401367, 2.5674781799316406, -1.1427839994430542, 0.48306113481521606, 0.20639348030090332, 1.2505439519882202, -1.7154808044433594, 0.26935678720474243, -0.4302806258201599, 2.1937642097473145, 0.19011054933071136, 1.1536288261413574, -0.3953937888145447, -2.271250009536743, 0.6018304228782654, -1.2513458728790283, -1.1479891538619995, 0.7827826142311096, -0.7924064993858337, 0.11776348203420639, -1.3695191144943237, -0.19289328157901764, -0.8437880873680115, -1.1765210628509521, 0.8015080690383911, 0.0758434385061264, 0.5878881216049194, -0.591804563999176, 0.2768532633781433, -2.1754980087280273, -1.330316424369812, -0.2203044444322586, -0.8446754217147827, 0.4399401843547821, -0.28342583775520325, 0.7264512181282043, -0.2218785136938095, 0.004415609873831272, 0.36420291662216187, 1.369260311126709, 3.3871521949768066, 0.20000125467777252, 0.4773755967617035, -0.14580971002578735, -0.9799325466156006, 1.4439467191696167, 0.9007687568664551, -0.19045402109622955, -0.5355032086372375, -1.0519896745681763, 1.3059073686599731, 1.8937519788742065, 0.8594562411308289, 0.1007109135389328, -0.7424165606498718, -0.5774615406990051, -0.019275272265076637, 0.12018992751836777, 0.49071452021598816, 0.9505274891853333, 0.01383078470826149, 0.15300649404525757, 1.5148446559906006, 1.2108101844787598, -0.2888485789299011, 0.4126085340976715, -0.7609398365020752, -0.5083566904067993, 0.5960299372673035, 0.38409292697906494, -0.052651070058345795, 0.3987157344818115, -0.9473574161529541, -0.2861635684967041, -0.32722559571266174, -1.0216517448425293, -0.6230847239494324, -0.45580434799194336, -0.3583385646343231, 1.6992433071136475, 0.05342774838209152, -0.5531861186027527, 0.03278156369924545, -0.8112647533416748, -0.037222325801849365, -1.0158538818359375, 0.22663897275924683, -0.142872616648674, -0.0931619182229042, -0.11102719604969025, 1.764980673789978, -0.8775988817214966, -2.0277891159057617, 0.2411491721868515, 0.27316945791244507, -0.28640908002853394, 0.1721370965242386, 1.5684603452682495, 0.4915776252746582, 1.4725323915481567, 1.408036708831787, 0.958051860332489, -0.6508163213729858, -1.3894556760787964, 0.6664504408836365, 0.933782160282135, -1.468795657157898, 0.9075558185577393, -0.032110005617141724, -0.5456832051277161, 0.6007175445556641, 1.2035835981369019, 0.3972528278827667, -1.9265100955963135, 0.8028665781021118, -0.9346917271614075, 0.8025306463241577, 0.674950897693634, 0.7721746563911438, 0.2084394097328186, 0.8309518694877625, -1.1919149160385132, -1.088830590248108, -0.7624039649963379, -0.6541187167167664, 1.9784321784973145, -0.3053685128688812, 0.6212980151176453, -0.19637931883335114, -1.3263311386108398, -0.05687166005373001, 0.644934356212616, 0.29813146591186523, -0.34982284903526306, 0.7624791860580444, -0.7183948755264282, -1.1963704824447632, -1.4282419681549072, -0.4293581545352936, -1.0727266073226929, -0.9104812145233154, 1.0768824815750122, 0.8021466732025146, 0.22169458866119385, 1.9597913026809692, 0.6096276044845581, 0.17448382079601288, -2.630796194076538, 0.7874712347984314, 0.3208231031894684, -0.014744791202247143, 0.8360821604728699, 0.2831660509109497, 1.0417609214782715, -0.10625606775283813, 0.5140164494514465, -2.43051815032959, 2.2875983715057373, -0.3163434565067291, 0.7919387817382812, 0.05086100101470947, -0.24099889397621155, 1.0279680490493774, 0.6060119867324829, 0.6199564933776855, -1.0833317041397095, 0.6757037043571472, -0.6497330069541931, 1.2540918588638306, 1.0491943359375, -0.8237091302871704, -0.016701649874448776, 1.2937339544296265, 0.4579613208770752, -0.5185849666595459, -0.9631547927856445, -0.9070555567741394, 0.9546219110488892, 1.760739803314209, -0.01839265786111355, 0.022898664698004723, 0.8405757546424866, 0.738465428352356, -1.3035293817520142, 0.14033469557762146, -0.8266251683235168, -0.8252508044242859, 1.6122034788131714, 2.0982446670532227, -0.08060269057750702, -0.127996563911438, -0.7865325212478638, -1.327195167541504, 0.8230873942375183, 0.10389799624681473, 0.12688662111759186, 0.7248595952987671, -0.6247197985649109, 1.104988694190979, 0.8660061359405518, 0.9119850993156433, 0.31458067893981934, 0.29576486349105835, 0.251826673746109, -0.17778107523918152, -1.142717719078064, -0.1462583690881729, -1.0442460775375366, -2.5522561073303223, 0.49733293056488037, -0.2728462219238281, -1.4967458248138428, 0.052976593375205994, -0.9560774564743042, 0.8866264224052429, -0.47758567333221436, -1.1190836429595947, -1.5110220909118652, 0.20368041098117828, -0.024961158633232117, 0.8160613775253296, -1.5889064073562622, -0.02014242485165596, 1.214223027229309, 1.0120773315429688, -0.642149031162262, 1.0059963464736938, 0.23934173583984375, 1.0860121250152588, 0.8952369689941406, -0.43042415380477905, 0.5482646226882935, 0.1438622921705246, -1.3512239456176758, 0.4483853578567505, 1.124828815460205, 0.2054854929447174, 1.4561288356781006, -0.5193049311637878, 0.0607752725481987, 0.4721274673938751, -0.4124639332294464, -0.4185323417186737, -0.6167663335800171, 0.741496741771698, -0.008632192388176918, -0.7847544550895691, -0.006251519545912743, -0.05985884368419647, -0.2716835141181946, 0.2628057599067688, -1.4498956203460693, -0.13896510004997253, -0.3378531336784363, -0.5526034235954285, -1.2137442827224731, -0.15800172090530396, 1.3974635601043701, -0.8279206156730652, -0.11900836229324341, 0.4738936424255371, 0.3274858593940735, 0.5658273696899414, 0.6232444643974304, -0.6629622578620911, -0.3344208002090454, -0.18236765265464783, -0.360826313495636, 0.2997395694255829, 1.3412295579910278, -0.2507277727127075, -0.953622043132782, 0.6569007039070129, -0.254635214805603, 0.03994724899530411, 1.9184017181396484, 0.13605833053588867, -0.7900562882423401, 0.3451153039932251, -0.7012883424758911, 1.893486738204956, 1.7340693473815918, 1.2941287755966187, -0.05552435666322708, -0.9930371046066284, 0.6647130250930786, -0.3771979808807373, -0.3539080023765564, 0.8618226647377014, 0.3835586607456207, -0.16146016120910645, -1.364527702331543, 0.7369157671928406, 1.1583751440048218, -0.8582311868667603, -0.7613376379013062, 0.04261350631713867, -0.8811438083648682, 1.052673101425171, 0.7358986735343933, 0.4993321895599365, 0.23610426485538483, 1.6769007444381714, 0.7478353977203369, -0.5137710571289062, 0.534793496131897, 0.5891059041023254, -0.13019974529743195, -2.0537779331207275, -1.1466426849365234, 0.26381462812423706, -0.5199710726737976, -1.5380948781967163, 1.384963035583496, -1.2392178773880005, -0.9173505902290344, 0.5223382711410522, 0.0928211361169815, 1.3899797201156616, 0.3902781009674072, 1.6066980361938477, 2.064793109893799, 0.9353889226913452, 0.3653995394706726, 1.3023544549942017, -0.1008853167295456, -0.3891666829586029, 1.7882168292999268, -0.4593869149684906, 0.5027744174003601, 1.1208575963974, -0.4074871838092804, -1.010649561882019, -0.760558009147644, -1.1597422361373901, -0.6742690801620483, 1.1270751953125, 0.034722961485385895, -1.0838514566421509, 0.27010563015937805, 1.5989080667495728, -0.01381099782884121, -0.2993990182876587, 0.6024866700172424, 0.44032666087150574, -0.644054114818573, -0.07404062151908875, -0.9307844638824463, 0.4772719144821167, -0.26531311869621277, -0.3946481943130493, 0.3628070652484894, 0.4896802604198456, 1.3007289171218872, 0.003763873130083084, 0.13041070103645325, 1.2455270290374756, -1.4635571241378784, 1.3905671834945679, -0.7072049975395203, 0.15892696380615234, -2.3613855838775635, 1.4331276416778564, -0.8530350923538208, 1.986978530883789, -2.7281198501586914, 0.40699607133865356, -0.6097280383110046, -0.48498156666755676, 0.36661121249198914, -0.3468547463417053, 0.11350405216217041, -0.09172524511814117, -1.099539041519165, -0.015041174367070198, -0.7113385796546936, 0.5304278135299683, 1.017130732536316, 1.3207542896270752, -1.1063416004180908, -0.35792142152786255, -1.7192645072937012, -0.16792336106300354, -0.6564887762069702, 0.27991053462028503, -1.9207324981689453, -0.18209609389305115, -2.0043082237243652, -2.431516170501709, -1.4098976850509644, -0.8475955724716187, 1.173443078994751, 0.08600478619337082, -0.9150639176368713, 1.138371467590332, -0.31100568175315857, -1.844334602355957, 1.1123220920562744, -2.158226251602173 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
Thanks for the 👍 in https://github.com/huggingface/datasets/issues/3673#issuecomment-1029008349 @mariosasko @gary149 @pietrolesci, but as I proposed various solutions, it's not clear to me which you prefer. Could you write your preferences as a comment? _(note for myself: one idea per comment in the future)_
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
970
41
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 Thanks for the 👍 in https://github.com/huggingface/datasets/issues/3673#issuecomment-1029008349 @mariosasko @gary149 @pietrolesci, but as I proposed various solutions, it's not clear to me which you prefer. Could you write your preferences as a comment? _(note for myself: one idea per comment in the future)_
[ -1.1509034633636475, -0.8894001841545105, -0.806133508682251, 1.4253917932510376, -0.18999341130256653, -1.2403761148452759, 0.13286307454109192, -1.0309817790985107, 1.701953411102295, -0.85834801197052, 0.33291274309158325, -1.7139140367507935, 0.015738554298877716, -0.6110354065895081, -0.7705150246620178, -0.8695936799049377, -0.4401983618736267, -0.7946851253509521, 1.0024263858795166, 2.502790689468384, 1.1927437782287598, -1.322239875793457, 2.704946994781494, 0.6415624022483826, -0.18088723719120026, -0.9390887022018433, 0.5462886691093445, -0.0746583491563797, -1.2644466161727905, -0.38072872161865234, -1.0173757076263428, -0.07260239124298096, -0.5113149881362915, -0.5671072006225586, 0.06386972218751907, 0.37262505292892456, -0.3605581223964691, -0.36944982409477234, -0.4644065499305725, -0.8978176712989807, 0.4856437146663666, -0.36087101697921753, 1.0284709930419922, -0.37679871916770935, 1.8794721364974976, -0.5248303413391113, 0.4812273681163788, 0.7534434795379639, 1.3269883394241333, 0.13741391897201538, -0.011060706339776516, 0.3489895462989807, 0.3617050051689148, 0.11420916765928268, 0.45742732286453247, 1.1679377555847168, 0.565275251865387, 0.4869842231273651, 0.7901356816291809, -2.1995503902435303, 1.3327763080596924, -0.9854881167411804, 0.2527118921279907, 1.3431504964828491, -1.0053253173828125, 0.34594637155532837, -1.7893590927124023, -0.07765708118677139, 0.5191851258277893, -2.232341766357422, 0.22251930832862854, -1.3001806735992432, -0.463871568441391, 0.9923633337020874, 0.33724865317344666, -1.2478203773498535, 0.07104092091321945, -0.3912724256515503, 0.9562249779701233, 0.5618586540222168, 1.1656723022460938, -1.64812433719635, -0.042893145233392715, -0.2928462624549866, 0.18458376824855804, -1.349218487739563, -1.5230352878570557, 0.5713105201721191, 0.6581127643585205, 0.5314671397209167, -0.12162771821022034, 0.9853886365890503, -0.993315577507019, 0.812781810760498, -0.9472447633743286, -1.7071053981781006, -1.4144572019577026, -2.2936878204345703, -2.3161227703094482, 0.7633041739463806, -0.4856131076812744, -0.5332118272781372, 2.063981533050537, -1.0720584392547607, -1.692612886428833, 1.16513991355896, 0.27110838890075684, 0.0622745007276535, 2.362128973007202, 0.27637916803359985, -0.7189220190048218, 0.5124271512031555, -0.7014940977096558, 0.7674036622047424, -0.372124582529068, 1.3554091453552246, 0.5235756039619446, -1.0442030429840088, 1.616107702255249, -0.4705325663089752, 0.5281779170036316, -0.6112557649612427, -0.43299728631973267, -0.7881608009338379, 0.2609190046787262, 1.7848401069641113, -0.3144499659538269, 1.5513362884521484, -0.3074110746383667, -1.6315336227416992, -1.6203522682189941, 0.762169361114502, 0.4756249487400055, -0.8022922277450562, 0.12685681879520416, -0.3224465847015381, 0.10406695306301117, 0.012487436644732952, 1.1771602630615234, 1.2780157327651978, 0.707434892654419, -0.2650928497314453, -0.9453339576721191, 0.22666051983833313, -0.0746547058224678, -0.7936519384384155, -1.7364201545715332, -0.3837079703807831, 0.15885931253433228, 0.686669111251831, -1.1592530012130737, 1.7954200506210327, 0.9264951944351196, 1.849613904953003, 0.9982789754867554, -0.25170791149139404, 1.4786728620529175, 0.04981604963541031, 1.835516095161438, -0.4833737909793854, 0.6674093008041382, -0.4480331242084503, -1.1716939210891724, 0.8005319237709045, -0.36584144830703735, -2.035001754760742, -0.7389400601387024, -0.9499124884605408, -0.20750173926353455, -0.7650960087776184, 1.032705545425415, -0.3211583197116852, -1.3016101121902466, 0.32690656185150146, -0.6856757998466492, 0.06677792221307755, -1.2744532823562622, 0.3156965374946594, 0.6852578520774841, -0.6541509628295898, -0.009380496107041836, -0.2002059519290924, -1.3752198219299316, -0.41319096088409424, 0.2709936201572418, 1.8976809978485107, -0.7662824392318726, 1.0098103284835815, 0.9457652568817139, -0.7272387146949768, -0.028381507843732834, 0.3305343985557556, -0.3372955620288849, 0.7883280515670776, -0.9945493340492249, -0.4079751968383789, 1.2144558429718018, -0.21951420605182648, -0.6104686260223389, 1.3957183361053467, 0.7043931484222412, -0.9944072365760803, -0.23816648125648499, -0.15833598375320435, -0.7792953252792358, -0.05804472044110298, -1.5552247762680054, -0.12751351296901703, 0.32483723759651184, -1.4949592351913452, -0.5010827779769897, -0.12956996262073517, 1.3026111125946045, -0.23469498753547668, 1.4188369512557983, -0.3554516136646271, -0.24598008394241333, -0.4875417947769165, -0.4605981111526489, 0.18258999288082123, -0.15761958062648773, -0.6930564641952515, 0.19257134199142456, -0.7847755551338196, 0.3304440379142761, 1.4007067680358887, 0.41156837344169617, 0.06883227825164795, 0.6136429309844971, 1.1139655113220215, 0.3345530331134796, 0.021111909300088882, -0.8698707222938538, -1.627851128578186, 2.0548133850097656, -1.4358826875686646, 1.9782030582427979, 0.702846884727478, -0.10510358214378357, -1.7690967321395874, -1.9307926893234253, 1.3652942180633545, 1.2107930183410645, 2.298086643218994, 0.6032090783119202, 0.40495890378952026, -0.7470055222511292, -0.67904132604599, 0.4059084355831146, -1.072266697883606, -0.7352886199951172, 0.06535423547029495, 2.4040520191192627, 1.7102030515670776, -0.4995323717594147, -0.13000157475471497, -0.9959749579429626, 1.3585015535354614, -0.1749977022409439, 0.16689683496952057, 1.9964044094085693, -0.3029482960700989, -1.1049015522003174, 1.2603200674057007, -2.2819669246673584, 0.14602312445640564, 2.0318896770477295, 0.29959604144096375, 0.06599574536085129, -1.405161738395691, -0.6750963926315308, -0.20570164918899536, -0.5074731111526489, -1.2449133396148682, 0.571471631526947, -0.24522320926189423, -0.8598747849464417, -1.429114580154419, 0.1188059076666832, -1.1380683183670044, -1.6891040802001953, 0.26524317264556885, 1.8538072109222412, 2.080836057662964, -0.6993170976638794, 1.5042030811309814, -0.15955832600593567, 0.24680458009243011, 1.2809406518936157, 1.3028475046157837, 3.157489061355591, 1.8716766834259033, -1.2707279920578003, 0.7080637216567993, -0.03860868513584137, -0.4989543557167053, 1.2853260040283203, -1.1376755237579346, 1.2711514234542847, -0.1491866409778595, -1.2067158222198486, -1.187605619430542, 0.9157311916351318, 0.4746183753013611, 0.01779322326183319, -0.39586004614830017, 1.2440917491912842, 0.08117876201868057, 1.3204485177993774, 0.5919687747955322, -0.3403257131576538, 0.6611972451210022, -0.4473365247249603, -0.4886184334754944, 1.5464555025100708, 0.20085521042346954, -1.436056137084961, -2.293398857116699, -0.26233577728271484, -0.8465458750724792, -0.013373387977480888, -0.5728660821914673, -0.9758148789405823, 1.6572113037109375, 0.3707830607891083, -1.214558482170105, -0.3161298334598541, -0.4208333194255829, -0.5906193852424622, 2.6992783546447754, -1.4596316814422607, -0.24969199299812317, -0.9658912420272827, -0.6768915057182312, 1.6646682024002075, -1.2568600177764893, -0.18663114309310913, -1.0935193300247192, -0.6010105609893799, -1.4109200239181519, -0.574151337146759, -0.027327146381139755, -0.9841864109039307, 0.7231765985488892, 0.14474789798259735, -1.159853458404541, -0.32725462317466736, -0.9522585272789001, 0.8681758046150208, -0.14790698885917664, 0.21265138685703278, 1.8647388219833374, 0.37375542521476746, -0.4369695782661438, 0.6355051398277283, 1.1478846073150635, 0.6001964211463928, -0.6131971478462219, 0.22311802208423615, -0.7314932942390442, 0.3763049244880676, -1.3433516025543213, 0.2844911813735962, -2.894972801208496, 0.5780760645866394, -0.16090212762355804, -0.1718643754720688, -0.06880152225494385, -1.3566514253616333, 1.0798799991607666, 2.598419427871704, -1.2193374633789062, 0.44181621074676514, 0.23761694133281708, 1.202962040901184, -1.7197821140289307, 0.18270069360733032, -0.45067375898361206, 2.1559865474700928, 0.17897820472717285, 1.1847808361053467, -0.4344801604747772, -2.199625015258789, 0.6448494791984558, -1.25089693069458, -1.0893994569778442, 0.7757682204246521, -0.830040454864502, 0.23790623247623444, -1.3357226848602295, -0.16183596849441528, -0.9000772833824158, -1.192245364189148, 0.741466760635376, 0.05722564458847046, 0.505568265914917, -0.5500355958938599, 0.2825508117675781, -2.1468589305877686, -1.363150715827942, -0.2230735570192337, -0.9078910946846008, 0.4506446123123169, -0.3167766034603119, 0.7215710878372192, -0.19041034579277039, -0.020703338086605072, 0.372151643037796, 1.3776805400848389, 3.3863959312438965, 0.1723143458366394, 0.39400261640548706, -0.09565683454275131, -1.0028132200241089, 1.4775903224945068, 0.9876766204833984, -0.1274126023054123, -0.49616044759750366, -0.947191596031189, 1.2980040311813354, 1.9575691223144531, 0.9645296931266785, 0.05212158337235451, -0.8046208620071411, -0.6825700402259827, 0.032306890934705734, 0.10462195426225662, 0.5110675096511841, 0.8806793689727783, 0.06648817658424377, 0.12035731226205826, 1.4971179962158203, 1.1297358274459839, -0.30723434686660767, 0.3788759112358093, -0.7820165157318115, -0.4815952479839325, 0.49978867173194885, 0.32422128319740295, -0.022086884826421738, 0.4238276183605194, -0.9908967018127441, -0.2723120152950287, -0.2828465700149536, -0.951818585395813, -0.6892675757408142, -0.4739641845226288, -0.3465453088283539, 1.6735191345214844, 0.03499479964375496, -0.5047317743301392, -0.00716412765905261, -0.8230249881744385, -0.04567218944430351, -1.0396053791046143, 0.23317503929138184, -0.13381527364253998, -0.07739697396755219, -0.11185017228126526, 1.694766640663147, -0.9089249968528748, -2.09822940826416, 0.24608899652957916, 0.27433717250823975, -0.38507863879203796, 0.12257974594831467, 1.5755161046981812, 0.5405598878860474, 1.4477072954177856, 1.401951551437378, 0.9981061220169067, -0.7051761746406555, -1.3117960691452026, 0.709953248500824, 0.951149582862854, -1.4478092193603516, 0.8967670798301697, -0.1282288134098053, -0.5100509524345398, 0.5788668394088745, 1.2390873432159424, 0.42616233229637146, -1.9022287130355835, 0.7828349471092224, -0.9083123207092285, 0.7959994077682495, 0.6576410531997681, 0.7770222425460815, 0.20275947451591492, 0.8476251363754272, -1.200441837310791, -1.0939933061599731, -0.7529536485671997, -0.67885822057724, 1.9791663885116577, -0.2554515600204468, 0.5753465890884399, -0.2285282462835312, -1.2892009019851685, -0.04957609251141548, 0.6733720898628235, 0.3515682816505432, -0.40846675634384155, 0.8014737963676453, -0.706689178943634, -1.112656831741333, -1.4041951894760132, -0.43141764402389526, -1.0087138414382935, -0.9224995970726013, 1.0557900667190552, 0.7604355812072754, 0.28164729475975037, 1.930546522140503, 0.6275357604026794, 0.2490430623292923, -2.6060917377471924, 0.8274897933006287, 0.30947837233543396, -0.009108525700867176, 0.8415037989616394, 0.24118395149707794, 1.1540873050689697, -0.10050969570875168, 0.5202767252922058, -2.403956413269043, 2.2017393112182617, -0.26828470826148987, 0.6794173717498779, 0.05362030863761902, -0.20718537271022797, 1.0246062278747559, 0.5772075653076172, 0.5895482897758484, -1.1123948097229004, 0.7009246945381165, -0.6493997573852539, 1.2033910751342773, 1.0287630558013916, -0.8482435345649719, 0.05731990933418274, 1.37015962600708, 0.4849390983581543, -0.5181074738502502, -0.909663200378418, -0.8657910823822021, 0.9462164044380188, 1.7107559442520142, -0.07133100181818008, 0.029270995408296585, 0.8692690134048462, 0.7220770716667175, -1.3144131898880005, 0.1239936426281929, -0.815037727355957, -0.7333823442459106, 1.648082971572876, 2.100522041320801, -0.09748475253582001, -0.1674649715423584, -0.8113994598388672, -1.231177568435669, 0.7902499437332153, 0.0351819284260273, 0.09717242419719696, 0.7474870085716248, -0.6664343476295471, 1.1516629457473755, 0.8006929159164429, 0.9308003783226013, 0.20426806807518005, 0.34822508692741394, 0.26446232199668884, -0.20765487849712372, -1.137272834777832, -0.2505800426006317, -1.0109883546829224, -2.569115400314331, 0.5411949157714844, -0.2425711750984192, -1.4414818286895752, 0.0900150015950203, -0.979854941368103, 0.885273277759552, -0.5085694789886475, -1.0933935642242432, -1.5030561685562134, 0.22043204307556152, -0.0770721361041069, 0.8451955318450928, -1.544561505317688, -0.08563145995140076, 1.2837940454483032, 0.9575849771499634, -0.7037076950073242, 0.9840006828308105, 0.22958484292030334, 1.0446254014968872, 0.8763133883476257, -0.4370643198490143, 0.5563721060752869, 0.1261460781097412, -1.3602198362350464, 0.45164936780929565, 1.1751503944396973, 0.22083792090415955, 1.4866317510604858, -0.5093355774879456, 0.077273890376091, 0.4959236681461334, -0.490246057510376, -0.50048828125, -0.6055317521095276, 0.6820508241653442, 0.020649094134569168, -0.8514965772628784, -0.025118514895439148, -0.057517554610967636, -0.30230894684791565, 0.28551962971687317, -1.481000304222107, -0.17027531564235687, -0.30520832538604736, -0.600838303565979, -1.242325782775879, -0.09424842894077301, 1.3565922975540161, -0.8187389373779297, -0.14161603152751923, 0.48532742261886597, 0.29683345556259155, 0.5110445022583008, 0.6118459105491638, -0.7125066518783569, -0.3349124789237976, -0.2316456437110901, -0.31402352452278137, 0.29713380336761475, 1.3077741861343384, -0.16228941082954407, -1.0320357084274292, 0.673438549041748, -0.3271417021751404, 0.08522693067789078, 1.919638752937317, 0.05663807690143585, -0.7696424126625061, 0.28802797198295593, -0.7219511866569519, 1.9150028228759766, 1.6644749641418457, 1.3608204126358032, -0.07097005099058151, -0.9687779545783997, 0.6574382781982422, -0.35584256052970886, -0.30674314498901367, 0.9274436235427856, 0.3296169340610504, -0.1983468383550644, -1.3724148273468018, 0.6999273300170898, 1.2239757776260376, -0.9371103644371033, -0.7522842884063721, 0.10433799028396606, -0.8666620254516602, 1.0988000631332397, 0.7180554866790771, 0.4250946044921875, 0.24233542382717133, 1.641373872756958, 0.707787036895752, -0.510917603969574, 0.47211262583732605, 0.5690248012542725, -0.1073802039027214, -2.0078654289245605, -1.103606104850769, 0.2908613979816437, -0.4807841181755066, -1.5717302560806274, 1.389221429824829, -1.2020800113677979, -0.9690670967102051, 0.4789791703224182, 0.1140267550945282, 1.4222335815429688, 0.3997091054916382, 1.6530201435089111, 2.0367298126220703, 0.897451639175415, 0.3264131247997284, 1.2978017330169678, -0.08872883021831512, -0.3614438474178314, 1.7309074401855469, -0.4647701382637024, 0.5391620397567749, 1.0438464879989624, -0.4210004508495331, -1.0993808507919312, -0.8043628334999084, -1.199088215827942, -0.6747288107872009, 1.1213551759719849, 0.09434079378843307, -1.1126095056533813, 0.25329649448394775, 1.632102370262146, 0.05244850367307663, -0.2856752276420593, 0.6583094000816345, 0.4352983236312866, -0.7623735070228577, -0.0356733538210392, -0.9047752022743225, 0.4988332688808441, -0.1717112958431244, -0.401120126247406, 0.30808550119400024, 0.5461022853851318, 1.312720537185669, -0.02419273555278778, 0.14728260040283203, 1.2427033185958862, -1.3635278940200806, 1.4832713603973389, -0.7013696432113647, 0.18904273211956024, -2.4016637802124023, 1.391890048980713, -0.8759499192237854, 1.938741683959961, -2.637549877166748, 0.4172639846801758, -0.5632405281066895, -0.5186113715171814, 0.3229982852935791, -0.30191996693611145, 0.13580934703350067, -0.1087440699338913, -1.0832934379577637, -0.02825617417693138, -0.7463247179985046, 0.5534263849258423, 1.1484123468399048, 1.3682470321655273, -1.1322712898254395, -0.37740078568458557, -1.7445709705352783, -0.14389196038246155, -0.6295934319496155, 0.2729283273220062, -1.939508080482483, -0.23984844982624054, -1.9506133794784546, -2.4431562423706055, -1.3887825012207031, -0.8705681562423706, 1.1622337102890015, 0.09344726800918579, -0.9622200131416321, 1.1580369472503662, -0.2984929084777832, -1.818023920059204, 1.1046024560928345, -2.1536271572113037 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
As I am working with seq2seq, I prefer having the label in string form rather than numeric. So the viewer is fine and the underlying dataset should be "decoded" (from int to str). In this way, the user does not have to search for a mapping `int -> original name` (even though is trivial to find, I reckon). Also, encoding labels is rather easy. I hope this is useful
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
970
69
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 As I am working with seq2seq, I prefer having the label in string form rather than numeric. So the viewer is fine and the underlying dataset should be "decoded" (from int to str). In this way, the user does not have to search for a mapping `int -> original name` (even though is trivial to find, I reckon). Also, encoding labels is rather easy. I hope this is useful
[ -1.2032816410064697, -0.8859898447990417, -0.7888201475143433, 1.3823269605636597, -0.21650369465351105, -1.2518703937530518, 0.17600670456886292, -1.1009658575057983, 1.7100157737731934, -0.9279150366783142, 0.3678354024887085, -1.6870627403259277, 0.06176663190126419, -0.5755828022956848, -0.802544355392456, -0.9227343797683716, -0.4432857632637024, -0.7766388058662415, 0.9577219486236572, 2.5256495475769043, 1.2404980659484863, -1.3475334644317627, 2.6859776973724365, 0.5742918848991394, -0.16170988976955414, -1.0054177045822144, 0.5642792582511902, -0.03989202529191971, -1.2932051420211792, -0.44055065512657166, -0.9972440600395203, -0.09866131842136383, -0.5128090381622314, -0.6206741333007812, 0.0485648512840271, 0.34702107310295105, -0.32763656973838806, -0.4400003254413605, -0.39570748805999756, -0.9161809682846069, 0.4824100136756897, -0.3658673167228699, 1.0387128591537476, -0.40557757019996643, 1.9007117748260498, -0.5379632711410522, 0.46835294365882874, 0.7981294989585876, 1.3212480545043945, 0.1320277899503708, -0.04885886609554291, 0.3393282890319824, 0.3882156014442444, 0.13293206691741943, 0.5054643154144287, 1.12450110912323, 0.5666411519050598, 0.5170627236366272, 0.7864190340042114, -2.1568140983581543, 1.3610135316848755, -1.020189881324768, 0.27200233936309814, 1.3437167406082153, -1.0018202066421509, 0.3701813817024231, -1.7986794710159302, -0.1197410300374031, 0.5087839961051941, -2.2182536125183105, 0.1740291863679886, -1.301139235496521, -0.41905567049980164, 0.9893651008605957, 0.3201013505458832, -1.208645224571228, 0.04994380474090576, -0.3830171227455139, 0.8296739459037781, 0.5153515934944153, 1.1854807138442993, -1.6149910688400269, -0.023430176079273224, -0.3595027029514313, 0.23062993586063385, -1.354223608970642, -1.5257244110107422, 0.5444209575653076, 0.6702853441238403, 0.44766291975975037, -0.18241354823112488, 1.0161244869232178, -0.9748076796531677, 0.7918547987937927, -0.9257214069366455, -1.7202390432357788, -1.465295433998108, -2.2907509803771973, -2.3041257858276367, 0.7467360496520996, -0.499078631401062, -0.5939015746116638, 2.1143970489501953, -1.1302120685577393, -1.7182635068893433, 1.1877515316009521, 0.17689979076385498, 0.066733717918396, 2.381751537322998, 0.20571202039718628, -0.6847800612449646, 0.5335761904716492, -0.6718763113021851, 0.7581939101219177, -0.3615424335002899, 1.3094226121902466, 0.4910465180873871, -1.1041386127471924, 1.6144944429397583, -0.43581119179725647, 0.5333311557769775, -0.6051493287086487, -0.4085480868816376, -0.7491271495819092, 0.2429371327161789, 1.752408742904663, -0.2726536691188812, 1.5461848974227905, -0.2950766384601593, -1.5844340324401855, -1.622748851776123, 0.7947929501533508, 0.4854598641395569, -0.7466731667518616, 0.11392349749803543, -0.2768511176109314, 0.10215315967798233, 0.040111951529979706, 1.177588939666748, 1.3131862878799438, 0.7552873492240906, -0.27368471026420593, -0.9461996555328369, 0.22611117362976074, -0.054383330047130585, -0.7895578145980835, -1.7496540546417236, -0.4008249342441559, 0.08411204814910889, 0.7034417986869812, -1.1242042779922485, 1.7905608415603638, 0.9836316108703613, 1.8101284503936768, 1.0098305940628052, -0.23879311978816986, 1.4992045164108276, 0.10560379177331924, 1.7892978191375732, -0.4889754354953766, 0.649253785610199, -0.45373234152793884, -1.1402720212936401, 0.8269839882850647, -0.3119807839393616, -2.0186009407043457, -0.7584198713302612, -0.9703192710876465, -0.23433232307434082, -0.7547094225883484, 1.0567272901535034, -0.23810549080371857, -1.3024163246154785, 0.3590676784515381, -0.6885030269622803, 0.008298054337501526, -1.256685733795166, 0.37497246265411377, 0.6525772213935852, -0.677042543888092, 0.02641073428094387, -0.27892500162124634, -1.3549333810806274, -0.42295265197753906, 0.17586487531661987, 1.8798024654388428, -0.8472884297370911, 0.9847198128700256, 0.9036949872970581, -0.7051410675048828, -0.09891115128993988, 0.3506809175014496, -0.33391761779785156, 0.7933942079544067, -1.0231730937957764, -0.366693913936615, 1.1557363271713257, -0.1846247911453247, -0.5926535725593567, 1.4034489393234253, 0.6864417791366577, -0.9604140520095825, -0.1627589762210846, -0.18098588287830353, -0.8459697961807251, -0.06316269934177399, -1.5368579626083374, -0.09129916876554489, 0.30017879605293274, -1.5181876420974731, -0.5012204051017761, -0.13785985112190247, 1.2777528762817383, -0.16010518372058868, 1.4277054071426392, -0.37990760803222656, -0.330994188785553, -0.46391016244888306, -0.4110496938228607, 0.2003227174282074, -0.09652195870876312, -0.6575787663459778, 0.20862703025341034, -0.7595216631889343, 0.3007785677909851, 1.3967180252075195, 0.40872085094451904, 0.015253109857439995, 0.6402789950370789, 1.1075009107589722, 0.3154586851596832, -0.007378620561212301, -0.8655380606651306, -1.6017088890075684, 2.0783400535583496, -1.4749245643615723, 1.9577252864837646, 0.6676321029663086, -0.041650570929050446, -1.74237060546875, -1.8828930854797363, 1.356321930885315, 1.2185393571853638, 2.2484099864959717, 0.5825030207633972, 0.37941277027130127, -0.7690264582633972, -0.6460428833961487, 0.41051822900772095, -1.1141811609268188, -0.7647795677185059, 0.04387557506561279, 2.3359060287475586, 1.7325870990753174, -0.5061419010162354, -0.10478507727384567, -1.0406900644302368, 1.4048700332641602, -0.16130325198173523, 0.16806091368198395, 1.9919724464416504, -0.3263826072216034, -1.126131296157837, 1.3364675045013428, -2.2474260330200195, 0.12688316404819489, 2.0158724784851074, 0.23615431785583496, 0.010644109919667244, -1.3744093179702759, -0.6433380842208862, -0.15276694297790527, -0.44284048676490784, -1.3112387657165527, 0.5755929350852966, -0.26820510625839233, -0.7924948334693909, -1.4205970764160156, 0.12166908383369446, -1.1885008811950684, -1.6922428607940674, 0.23391081392765045, 1.7816858291625977, 2.120041847229004, -0.6559241414070129, 1.5027631521224976, -0.21473060548305511, 0.27627044916152954, 1.2234745025634766, 1.289095401763916, 3.130169153213501, 1.9416450262069702, -1.2525231838226318, 0.6483877897262573, -0.08428643643856049, -0.5565274953842163, 1.332304835319519, -1.170133352279663, 1.2529900074005127, -0.13425277173519135, -1.1794795989990234, -1.1576999425888062, 0.8848165273666382, 0.44164738059043884, 0.04849240928888321, -0.39099955558776855, 1.2576086521148682, 0.06654670089483261, 1.3323075771331787, 0.5559951663017273, -0.28523293137550354, 0.7016946077346802, -0.4808614253997803, -0.4613541066646576, 1.5174490213394165, 0.22455403208732605, -1.3728864192962646, -2.30507493019104, -0.23822908103466034, -0.8423855304718018, 0.07038743793964386, -0.5283635854721069, -0.9024468064308167, 1.6943877935409546, 0.3588706851005554, -1.1638990640640259, -0.31051066517829895, -0.4223232865333557, -0.6596436500549316, 2.6852269172668457, -1.4504828453063965, -0.2702694237232208, -1.0015835762023926, -0.7260305285453796, 1.6117236614227295, -1.3313145637512207, -0.1528383493423462, -1.0420368909835815, -0.5172017812728882, -1.409250259399414, -0.6455481648445129, -0.033477626740932465, -1.013918161392212, 0.7971085906028748, 0.1849192976951599, -1.1681269407272339, -0.32564303278923035, -0.9039432406425476, 0.7685838341712952, -0.11230725049972534, 0.24293886125087738, 1.8205454349517822, 0.3592689633369446, -0.44112512469291687, 0.6233266592025757, 1.1330740451812744, 0.6365113258361816, -0.5833848118782043, 0.24550746381282806, -0.7613170742988586, 0.33202672004699707, -1.2930971384048462, 0.27392685413360596, -2.8444111347198486, 0.6050732731819153, -0.12695840001106262, -0.0951731875538826, -0.08668781071901321, -1.3146445751190186, 1.0659046173095703, 2.622525691986084, -1.186821460723877, 0.40630170702934265, 0.20295682549476624, 1.2230727672576904, -1.691038966178894, 0.2675769031047821, -0.4368223547935486, 2.1582705974578857, 0.23563815653324127, 1.1791852712631226, -0.3528158366680145, -2.2723593711853027, 0.6553056836128235, -1.2526832818984985, -1.135878086090088, 0.7771087884902954, -0.7718263268470764, 0.08447756618261337, -1.3507415056228638, -0.17545689642429352, -0.8473166227340698, -1.128510594367981, 0.7332836389541626, 0.07960909605026245, 0.5698500871658325, -0.5983357429504395, 0.272227942943573, -2.1146883964538574, -1.319815754890442, -0.2661423683166504, -0.8583619594573975, 0.40482479333877563, -0.2972242534160614, 0.7719845771789551, -0.26818737387657166, 0.006091570481657982, 0.40613502264022827, 1.3791718482971191, 3.338893175125122, 0.18715429306030273, 0.44254690408706665, -0.16265127062797546, -1.017149806022644, 1.5236274003982544, 0.9202429056167603, -0.16109688580036163, -0.4479338824748993, -1.0352667570114136, 1.2222137451171875, 1.9617325067520142, 0.8738149404525757, 0.060271069407463074, -0.8390416502952576, -0.6360719203948975, -0.039176780730485916, 0.08210471272468567, 0.5285454392433167, 0.9229608178138733, 0.04911354184150696, 0.09579550474882126, 1.5459972620010376, 1.1718556880950928, -0.3283611238002777, 0.3831039071083069, -0.7635930776596069, -0.44338396191596985, 0.6098852753639221, 0.3501950204372406, -0.03992202877998352, 0.38444003462791443, -0.9186083674430847, -0.2951118052005768, -0.30468735098838806, -0.990864098072052, -0.6694653034210205, -0.4675498604774475, -0.3565472960472107, 1.6727739572525024, 0.04349314421415329, -0.5448535084724426, -0.022877663373947144, -0.762600839138031, -0.026518147438764572, -1.032505750656128, 0.20671014487743378, -0.16883417963981628, -0.07809101790189743, -0.08297257870435715, 1.737444519996643, -0.8883148431777954, -2.043243169784546, 0.3228570818901062, 0.3032209873199463, -0.3836110532283783, 0.15676197409629822, 1.525946855545044, 0.5841402411460876, 1.4896690845489502, 1.4137035608291626, 0.99663245677948, -0.6776564121246338, -1.3572944402694702, 0.666935384273529, 0.9259260892868042, -1.481387734413147, 0.8862885236740112, -0.003760719206184149, -0.5855446457862854, 0.567628026008606, 1.1885231733322144, 0.4511464834213257, -1.9482429027557373, 0.7631139159202576, -0.8565740585327148, 0.8021073937416077, 0.680417537689209, 0.781853973865509, 0.1856342852115631, 0.8053248524665833, -1.1402478218078613, -1.1103236675262451, -0.7416263818740845, -0.6858704686164856, 1.974392056465149, -0.26994022727012634, 0.6187567114830017, -0.22541025280952454, -1.3528915643692017, -0.04223623126745224, 0.6263230443000793, 0.256750226020813, -0.3887338936328888, 0.7130898833274841, -0.6734315156936646, -1.182564377784729, -1.4751163721084595, -0.40002018213272095, -1.071451187133789, -0.9358335733413696, 1.0961979627609253, 0.7679080367088318, 0.21409234404563904, 1.9384441375732422, 0.6291736364364624, 0.18350885808467865, -2.619537830352783, 0.815968930721283, 0.30992552638053894, -0.005553727969527245, 0.8288916945457458, 0.2213384211063385, 1.1207550764083862, -0.11175000667572021, 0.5612155199050903, -2.4597291946411133, 2.2978527545928955, -0.256710022687912, 0.6996521949768066, 0.08018121868371964, -0.2784557044506073, 1.0443400144577026, 0.6014652848243713, 0.6385648250579834, -1.113701343536377, 0.6613792181015015, -0.675975501537323, 1.2472968101501465, 1.0370640754699707, -0.8333066701889038, -0.005712640471756458, 1.3862587213516235, 0.4896947741508484, -0.4905627369880676, -0.8905634880065918, -0.926310122013092, 0.9079436659812927, 1.7251758575439453, -0.03923732042312622, 0.008032096549868584, 0.8636558055877686, 0.7615315914154053, -1.2663155794143677, 0.08904555439949036, -0.8197144269943237, -0.7422026991844177, 1.591346263885498, 2.118584394454956, -0.12061731517314911, -0.17449171841144562, -0.8383323550224304, -1.2259342670440674, 0.8225418925285339, 0.09154479205608368, 0.11389664560556412, 0.7298409938812256, -0.6221243143081665, 1.1947194337844849, 0.8721291422843933, 0.934892475605011, 0.3342398703098297, 0.37746286392211914, 0.2644704580307007, -0.18363496661186218, -1.114404320716858, -0.17149944603443146, -1.0126821994781494, -2.5820977687835693, 0.5369455814361572, -0.3181872069835663, -1.4343897104263306, 0.02782573364675045, -0.9671997427940369, 0.8570579886436462, -0.4802371561527252, -1.104570746421814, -1.5356332063674927, 0.17455193400382996, -0.036457668989896774, 0.8425683379173279, -1.5562775135040283, -0.007820522412657738, 1.2937915325164795, 0.9642013311386108, -0.6585506796836853, 1.0001929998397827, 0.2644791901111603, 1.0645830631256104, 0.8915878534317017, -0.4506984055042267, 0.5422117114067078, 0.09172321856021881, -1.3201459646224976, 0.47763973474502563, 1.1031333208084106, 0.19650235772132874, 1.447300910949707, -0.4977472126483917, 0.07263901084661484, 0.4581425189971924, -0.39616909623146057, -0.4694824814796448, -0.5664785504341125, 0.7256511449813843, 0.026821346953511238, -0.8661208748817444, 0.029777443036437035, -0.054620787501335144, -0.29401540756225586, 0.2641645669937134, -1.4831781387329102, -0.17180778086185455, -0.3601207435131073, -0.6093806028366089, -1.2217012643814087, -0.14542841911315918, 1.4098659753799438, -0.790040910243988, -0.1000508964061737, 0.459945946931839, 0.25815215706825256, 0.545693576335907, 0.6087864637374878, -0.7290372848510742, -0.32686880230903625, -0.2116890400648117, -0.3841058611869812, 0.33541765809059143, 1.3347413539886475, -0.16308555006980896, -1.0092322826385498, 0.6690247058868408, -0.2918858826160431, 0.03132279962301254, 1.9065723419189453, 0.10320377349853516, -0.7676056623458862, 0.35637617111206055, -0.6832413673400879, 1.9064661264419556, 1.716473937034607, 1.3467551469802856, -0.01659485697746277, -0.9918028116226196, 0.5772207975387573, -0.388223260641098, -0.31612977385520935, 0.8652313351631165, 0.37436872720718384, -0.1363159716129303, -1.3416744470596313, 0.7268192768096924, 1.2471237182617188, -0.8759865164756775, -0.8389953374862671, 0.07330235093832016, -0.8652155995368958, 1.0301334857940674, 0.7112026810646057, 0.489815354347229, 0.22205889225006104, 1.6604294776916504, 0.7351465821266174, -0.5198512673377991, 0.5122727751731873, 0.5534491539001465, -0.10326499491930008, -2.0329091548919678, -1.1155362129211426, 0.2774454653263092, -0.49034857749938965, -1.5417993068695068, 1.3987252712249756, -1.2622870206832886, -0.9649648666381836, 0.5114229321479797, 0.09670033305883408, 1.4631701707839966, 0.41587603092193604, 1.59513258934021, 2.0163605213165283, 0.9198758006095886, 0.3808305561542511, 1.312591791152954, -0.13947764039039612, -0.37466853857040405, 1.7592016458511353, -0.45051559805870056, 0.44809940457344055, 1.1002490520477295, -0.3878342807292938, -1.0111067295074463, -0.795310914516449, -1.191706657409668, -0.7011136412620544, 1.1093837022781372, 0.03810979425907135, -1.1353155374526978, 0.24287833273410797, 1.6327210664749146, 0.051023319363594055, -0.36281752586364746, 0.5884734392166138, 0.4868534803390503, -0.6948850154876709, -0.07064730674028397, -0.9657434225082397, 0.49480921030044556, -0.24350617825984955, -0.3942471146583557, 0.3627384603023529, 0.5184147357940674, 1.301320195198059, 0.005690637975931168, 0.15186463296413422, 1.2302470207214355, -1.398598313331604, 1.4665627479553223, -0.6732537746429443, 0.14783474802970886, -2.3888132572174072, 1.4597941637039185, -0.8656704425811768, 2.017106056213379, -2.6907851696014404, 0.38900047540664673, -0.5885159373283386, -0.4629352390766144, 0.32002532482147217, -0.2823356091976166, 0.12773928046226501, -0.11526844650506973, -1.1007905006408691, -0.00874315295368433, -0.7304053902626038, 0.5735998749732971, 1.1021438837051392, 1.3503972291946411, -1.167358636856079, -0.3958803713321686, -1.7375074625015259, -0.13622282445430756, -0.6276188492774963, 0.2651852071285248, -1.9475288391113281, -0.24787938594818115, -2.00561261177063, -2.4428353309631348, -1.406193494796753, -0.8837425708770752, 1.1739909648895264, 0.11535794287919998, -0.9263814687728882, 1.0911753177642822, -0.30121883749961853, -1.855948805809021, 1.2033179998397827, -2.1425037384033203 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
I like the idea of "0 (neutral)". The label name can even be greyed to make it clear that it's not part of the actual item in the dataset, it's just the meaning.
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
970
33
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 I like the idea of "0 (neutral)". The label name can even be greyed to make it clear that it's not part of the actual item in the dataset, it's just the meaning.
[ -1.1599113941192627, -0.8787045478820801, -0.8659039735794067, 1.4373579025268555, -0.2194320559501648, -1.2487443685531616, 0.14836694300174713, -1.0209698677062988, 1.753664255142212, -0.9244992733001709, 0.35206907987594604, -1.7411454916000366, 0.07305871695280075, -0.5166879892349243, -0.7405437231063843, -0.9086884260177612, -0.4134700894355774, -0.7559664249420166, 1.008192777633667, 2.478318691253662, 1.1837438344955444, -1.3376084566116333, 2.686781167984009, 0.5844961404800415, -0.11189300566911697, -1.0060187578201294, 0.6197167634963989, -0.03463103622198105, -1.3114001750946045, -0.42023372650146484, -1.0102571249008179, -0.06255485117435455, -0.4754889905452728, -0.5875462293624878, 0.012207837775349617, 0.35650935769081116, -0.35727691650390625, -0.42470210790634155, -0.4753541350364685, -0.9570438861846924, 0.3994967043399811, -0.380174845457077, 0.9990309476852417, -0.4802723228931427, 1.9091031551361084, -0.4881061911582947, 0.47001004219055176, 0.7539938688278198, 1.3110774755477905, 0.15268783271312714, -0.038015853613615036, 0.3053473234176636, 0.38461950421333313, 0.13846264779567719, 0.455838143825531, 1.1227431297302246, 0.5083916187286377, 0.5142501592636108, 0.7654763460159302, -2.2410027980804443, 1.330810785293579, -1.03330397605896, 0.22534719109535217, 1.3370856046676636, -1.0304988622665405, 0.34445497393608093, -1.7506638765335083, -0.10737983137369156, 0.5031671524047852, -2.2778983116149902, 0.19137626886367798, -1.3101143836975098, -0.44252222776412964, 0.9418251514434814, 0.32130759954452515, -1.2158827781677246, -0.010165376588702202, -0.3828856647014618, 0.8555175065994263, 0.5448554754257202, 1.1875611543655396, -1.589539647102356, -0.013259364292025566, -0.364425927400589, 0.12970612943172455, -1.3648122549057007, -1.5240004062652588, 0.5878266096115112, 0.6770138740539551, 0.45477649569511414, -0.1681143343448639, 1.0440312623977661, -0.9733821153640747, 0.7519590854644775, -0.8916294574737549, -1.7522592544555664, -1.4105618000030518, -2.2925896644592285, -2.25203013420105, 0.7694313526153564, -0.4904325008392334, -0.5639779567718506, 2.1451213359832764, -1.112012505531311, -1.6949450969696045, 1.127773404121399, 0.2031131386756897, 0.06553046405315399, 2.398084878921509, 0.183937668800354, -0.6508170366287231, 0.5121835470199585, -0.688107967376709, 0.8149611949920654, -0.32901716232299805, 1.3095413446426392, 0.45869675278663635, -1.1165684461593628, 1.5911202430725098, -0.37003210186958313, 0.5566798448562622, -0.5722452402114868, -0.41125911474227905, -0.8080384731292725, 0.19954678416252136, 1.775060772895813, -0.2911630868911743, 1.5559195280075073, -0.2589099407196045, -1.5529835224151611, -1.6099132299423218, 0.8080239295959473, 0.42153435945510864, -0.7492530345916748, 0.11957259476184845, -0.26751023530960083, 0.08686644583940506, 0.03770160302519798, 1.2644696235656738, 1.2683210372924805, 0.7887511253356934, -0.24339532852172852, -0.9235718250274658, 0.21063373982906342, -0.06957364827394485, -0.7689706087112427, -1.7310552597045898, -0.3983375132083893, 0.04897262156009674, 0.7244499921798706, -1.1216830015182495, 1.8126499652862549, 0.9867453575134277, 1.8502873182296753, 1.0462085008621216, -0.2404583841562271, 1.50682532787323, 0.11768276989459991, 1.816548228263855, -0.43204131722450256, 0.6537908315658569, -0.42661476135253906, -1.166540265083313, 0.8374243974685669, -0.3513493537902832, -1.9653815031051636, -0.7997220754623413, -0.9684137105941772, -0.22746840119361877, -0.7513372898101807, 1.0627493858337402, -0.3532583713531494, -1.265219807624817, 0.3119920790195465, -0.6716121435165405, -0.03164196014404297, -1.2660616636276245, 0.3473725914955139, 0.7062045335769653, -0.7169835567474365, 0.03613801300525665, -0.262561559677124, -1.392221450805664, -0.47115612030029297, 0.2136453092098236, 1.9332929849624634, -0.8432579040527344, 1.0505717992782593, 0.9415875673294067, -0.8033145666122437, -0.07151539623737335, 0.28419291973114014, -0.29002368450164795, 0.8182334899902344, -1.00296151638031, -0.48413339257240295, 1.2267663478851318, -0.26256898045539856, -0.6740469932556152, 1.4550033807754517, 0.6148945093154907, -0.9432350397109985, -0.18840420246124268, -0.12323185801506042, -0.8316620588302612, -0.021339857950806618, -1.5341336727142334, -0.0640205442905426, 0.32141220569610596, -1.5278146266937256, -0.525931715965271, -0.137033149600029, 1.256468415260315, -0.12620548903942108, 1.355797529220581, -0.3609941303730011, -0.32989802956581116, -0.5269346237182617, -0.4423321783542633, 0.15287069976329803, -0.1361342966556549, -0.7400561571121216, 0.23590947687625885, -0.7902078628540039, 0.28707727789878845, 1.4089733362197876, 0.4406137466430664, 0.014434924349188805, 0.7469207048416138, 1.1308672428131104, 0.39050236344337463, -0.021232854574918747, -0.8443424701690674, -1.6134295463562012, 2.0676329135894775, -1.4411251544952393, 1.9239768981933594, 0.65696120262146, -0.14057132601737976, -1.7964682579040527, -1.9368031024932861, 1.3756412267684937, 1.208204746246338, 2.2083795070648193, 0.6345676183700562, 0.4373554587364197, -0.7353804111480713, -0.6393414735794067, 0.40348824858665466, -1.075947880744934, -0.7064768075942993, 0.08610288053750992, 2.352154493331909, 1.712821125984192, -0.5115540027618408, -0.08242809027433395, -1.0351614952087402, 1.3322452306747437, -0.10372237861156464, 0.1793425977230072, 1.9458853006362915, -0.34504926204681396, -1.1239748001098633, 1.2885431051254272, -2.2313945293426514, 0.12465502321720123, 2.0330052375793457, 0.3005748987197876, -0.023384729400277138, -1.4005075693130493, -0.6676565408706665, -0.1710280328989029, -0.4726399779319763, -1.2906209230422974, 0.6160887479782104, -0.284300833940506, -0.7641582489013672, -1.4531134366989136, 0.15085716545581818, -1.1603416204452515, -1.6802927255630493, 0.2448796033859253, 1.8359566926956177, 2.06272029876709, -0.5758411884307861, 1.4542617797851562, -0.19679315388202667, 0.21855208277702332, 1.2439134120941162, 1.2802364826202393, 3.133463144302368, 1.9751696586608887, -1.2052819728851318, 0.6643387079238892, 0.00014163926243782043, -0.5073758959770203, 1.3513482809066772, -1.1925880908966064, 1.3096991777420044, -0.17309556901454926, -1.2130639553070068, -1.2095319032669067, 0.8577326536178589, 0.42825424671173096, 0.030718300491571426, -0.37360841035842896, 1.2830218076705933, 0.053298816084861755, 1.2670209407806396, 0.5829167366027832, -0.3301210105419159, 0.6622834205627441, -0.509745717048645, -0.4560543894767761, 1.5599653720855713, 0.19306732714176178, -1.4399759769439697, -2.3060302734375, -0.21175245940685272, -0.8010141849517822, 0.08364912867546082, -0.5714544057846069, -0.8898613452911377, 1.7366634607315063, 0.392487108707428, -1.1796478033065796, -0.3380626440048218, -0.44567057490348816, -0.7181104421615601, 2.7240376472473145, -1.423506259918213, -0.28469350934028625, -1.0206193923950195, -0.7229928970336914, 1.6329416036605835, -1.311445951461792, -0.15370586514472961, -1.0654512643814087, -0.515944242477417, -1.407145380973816, -0.5948688983917236, 0.016931893303990364, -0.9894863367080688, 0.8470166921615601, 0.169411301612854, -1.1676081418991089, -0.31793516874313354, -0.905296802520752, 0.7960469722747803, -0.12941235303878784, 0.2350706309080124, 1.8700165748596191, 0.3996967673301697, -0.40927746891975403, 0.6794259548187256, 1.1536263227462769, 0.6960967779159546, -0.568939208984375, 0.26480957865715027, -0.6834280490875244, 0.3511316180229187, -1.320852279663086, 0.27040359377861023, -2.8945510387420654, 0.5802079439163208, -0.1432403326034546, -0.15137255191802979, -0.016498548910021782, -1.2695679664611816, 1.007992148399353, 2.526695966720581, -1.239803433418274, 0.42546892166137695, 0.1666514128446579, 1.214266061782837, -1.6694583892822266, 0.25963062047958374, -0.4646327793598175, 2.0974795818328857, 0.18265768885612488, 1.1432310342788696, -0.40463319420814514, -2.194127082824707, 0.7161530256271362, -1.2143899202346802, -1.1333341598510742, 0.7577074766159058, -0.8107836246490479, 0.1467919796705246, -1.306449294090271, -0.19579844176769257, -0.8135474920272827, -1.1621129512786865, 0.7723218202590942, 0.10164462774991989, 0.5093824863433838, -0.548762321472168, 0.2747264802455902, -2.188831329345703, -1.3744581937789917, -0.2744913101196289, -0.8847293853759766, 0.4704012870788574, -0.3549953103065491, 0.7624350786209106, -0.25537794828414917, 0.03407357633113861, 0.33658137917518616, 1.3915038108825684, 3.423870325088501, 0.1666688621044159, 0.4323505461215973, -0.14730745553970337, -1.0576940774917603, 1.5349072217941284, 0.9922827482223511, -0.13822542130947113, -0.46341660618782043, -1.043869972229004, 1.247450351715088, 1.9241756200790405, 0.8978821039199829, 0.07893091440200806, -0.7947357892990112, -0.6231659650802612, -0.07410869747400284, 0.10893575102090836, 0.5880110263824463, 0.8724827766418457, 0.08195668458938599, 0.16310107707977295, 1.5383583307266235, 1.1524326801300049, -0.26101934909820557, 0.33326420187950134, -0.7456141710281372, -0.46753838658332825, 0.6457607746124268, 0.375799298286438, -0.045317143201828, 0.4320419132709503, -0.9880620241165161, -0.3293318450450897, -0.30517497658729553, -1.0075453519821167, -0.6323562860488892, -0.41109776496887207, -0.39321523904800415, 1.6708836555480957, -0.010350732132792473, -0.5639617443084717, -0.06962646543979645, -0.8232266902923584, -0.027873029932379723, -1.0544384717941284, 0.2495271861553192, -0.1463361233472824, -0.13303296267986298, -0.10856128484010696, 1.7224018573760986, -0.9547814130783081, -2.092277765274048, 0.2693670988082886, 0.286164790391922, -0.31089112162590027, 0.12633758783340454, 1.5037187337875366, 0.5497757196426392, 1.443462610244751, 1.412667155265808, 0.9644960165023804, -0.6390445232391357, -1.4088573455810547, 0.6052701473236084, 0.9077212810516357, -1.4597039222717285, 0.9163224697113037, -0.05538038909435272, -0.5876153707504272, 0.6139539480209351, 1.181276798248291, 0.4909275472164154, -1.9001574516296387, 0.7548171281814575, -0.8752710819244385, 0.8144429922103882, 0.73618483543396, 0.8065228462219238, 0.16056106984615326, 0.8015252351760864, -1.1542645692825317, -1.1434305906295776, -0.7347544431686401, -0.7109576463699341, 1.928574562072754, -0.28563690185546875, 0.6067675352096558, -0.2579796016216278, -1.3192687034606934, -0.05216529592871666, 0.5947165489196777, 0.274535208940506, -0.3682355284690857, 0.7488937377929688, -0.7047131061553955, -1.1855367422103882, -1.482466697692871, -0.40868237614631653, -1.0902460813522339, -0.9407155513763428, 1.1269701719284058, 0.726616382598877, 0.22330498695373535, 1.9564356803894043, 0.6394873857498169, 0.20057421922683716, -2.6264445781707764, 0.7573529481887817, 0.353365033864975, 0.010895935818552971, 0.7958080768585205, 0.2971932888031006, 1.1575056314468384, -0.11994569003582001, 0.5405359268188477, -2.367586374282837, 2.2605788707733154, -0.30930519104003906, 0.7136024236679077, 0.05372194945812225, -0.19193296134471893, 1.0030597448349, 0.6079155206680298, 0.6241295337677002, -1.0572911500930786, 0.7213538885116577, -0.6799453496932983, 1.2317571640014648, 1.0751579999923706, -0.7799395322799683, 0.04672576114535332, 1.407573938369751, 0.6094800233840942, -0.5288000106811523, -0.8781874179840088, -0.9230853319168091, 0.9219212532043457, 1.776834487915039, -0.03181414678692818, 0.09231621026992798, 0.838402271270752, 0.6770484447479248, -1.2729848623275757, 0.11386438459157944, -0.833188533782959, -0.7022900581359863, 1.596501350402832, 2.046518325805664, -0.09497858583927155, -0.15517061948776245, -0.7765272855758667, -1.2079651355743408, 0.7333552837371826, 0.10570965707302094, 0.052861496806144714, 0.7983547449111938, -0.6375808715820312, 1.092427372932434, 0.8705548048019409, 0.9307370185852051, 0.2838875949382782, 0.3855658769607544, 0.30170494318008423, -0.1559513956308365, -1.1629835367202759, -0.17777608335018158, -0.9452006816864014, -2.5937914848327637, 0.4940480887889862, -0.35529688000679016, -1.4609214067459106, -0.012627547606825829, -0.9858803749084473, 0.883359432220459, -0.45936769247055054, -1.1470476388931274, -1.5121498107910156, 0.12420420348644257, -0.02511865645647049, 0.7903786897659302, -1.5527942180633545, -0.08799778670072556, 1.321466326713562, 1.0259681940078735, -0.7901089191436768, 0.994930624961853, 0.19906862080097198, 1.1430935859680176, 0.8561017513275146, -0.47753095626831055, 0.5114881992340088, 0.05165863037109375, -1.3507131338119507, 0.45109134912490845, 1.1220386028289795, 0.18496033549308777, 1.4719353914260864, -0.5508400201797485, 0.045195747166872025, 0.5079329013824463, -0.3601335287094116, -0.5051462650299072, -0.6250684261322021, 0.6873722076416016, -0.05892624706029892, -0.7626626491546631, 0.04145811125636101, -0.07151159644126892, -0.30291101336479187, 0.243778795003891, -1.433832049369812, -0.16049852967262268, -0.36137649416923523, -0.6110790967941284, -1.251976728439331, -0.1021970808506012, 1.3733961582183838, -0.7942118644714355, -0.08761660009622574, 0.4547503590583801, 0.26938822865486145, 0.4910251200199127, 0.5752118825912476, -0.7100393772125244, -0.32896724343299866, -0.20832517743110657, -0.34535038471221924, 0.3363240957260132, 1.3699678182601929, -0.20480826497077942, -1.0114479064941406, 0.660462498664856, -0.2278779298067093, 0.06384467333555222, 1.9250669479370117, 0.07621903717517853, -0.7604087591171265, 0.28837764263153076, -0.7331905364990234, 1.8981666564941406, 1.6360732316970825, 1.3576821088790894, -0.031080259010195732, -0.9299235343933105, 0.637061357498169, -0.3249152898788452, -0.3532252609729767, 0.8451459407806396, 0.3551413118839264, -0.1454627513885498, -1.3550777435302734, 0.7974755764007568, 1.2070949077606201, -0.9201434850692749, -0.7550487518310547, 0.11136528849601746, -0.8564461469650269, 1.0611138343811035, 0.6825138330459595, 0.5164248943328857, 0.2545594274997711, 1.6167066097259521, 0.7462494373321533, -0.4660250246524811, 0.5131856203079224, 0.5609176158905029, -0.059314269572496414, -1.982460856437683, -1.1415400505065918, 0.32750949263572693, -0.5389275550842285, -1.5721991062164307, 1.4085135459899902, -1.2407490015029907, -0.9349695444107056, 0.5015696287155151, 0.1282922625541687, 1.4452139139175415, 0.3802400529384613, 1.5869468450546265, 2.031571626663208, 0.9002435207366943, 0.37030133605003357, 1.315967082977295, -0.11831564456224442, -0.37563085556030273, 1.7463258504867554, -0.41725680232048035, 0.4885503947734833, 1.1178245544433594, -0.38266000151634216, -1.032538652420044, -0.7313038110733032, -1.2121120691299438, -0.6793719530105591, 1.0611271858215332, 0.06604833900928497, -1.1501818895339966, 0.1940225064754486, 1.4608104228973389, 0.11073503643274307, -0.260233998298645, 0.5898681879043579, 0.42972806096076965, -0.7158583402633667, -0.05842052027583122, -0.9144692420959473, 0.5084571838378906, -0.2751781940460205, -0.41759589314460754, 0.3449382483959198, 0.49659642577171326, 1.371685266494751, 0.006949042901396751, 0.14880064129829407, 1.304160475730896, -1.3778513669967651, 1.4794193506240845, -0.7076356410980225, 0.0880863294005394, -2.3707339763641357, 1.4839351177215576, -0.9028725624084473, 1.97842538356781, -2.6732287406921387, 0.3996332585811615, -0.557193398475647, -0.44588252902030945, 0.33970320224761963, -0.29947760701179504, 0.09642575681209564, -0.1482687145471573, -1.0457748174667358, 0.010850965976715088, -0.7165515422821045, 0.5453356504440308, 1.1845616102218628, 1.3271938562393188, -1.137458086013794, -0.43211978673934937, -1.7400685548782349, -0.13104647397994995, -0.5810242891311646, 0.28206825256347656, -1.9349863529205322, -0.30552053451538086, -1.9304479360580444, -2.5111005306243896, -1.312656283378601, -0.875676155090332, 1.223126769065857, 0.07753483206033707, -0.9526385068893433, 1.1633325815200806, -0.28839996457099915, -1.8355015516281128, 1.0813167095184326, -2.196070671081543 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
Proposals by @gary149. Which one do you prefer? Please vote with the thumbs - 👍 ![image](https://user-images.githubusercontent.com/1676121/152387949-883c7d7e-a9f3-48aa-bff9-11a691555e6e.png) - 👎 ![image (1)](https://user-images.githubusercontent.com/1676121/152388061-32d95e42-cade-4ae4-9a77-7365e7b72b8f.png)
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
970
20
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 Proposals by @gary149. Which one do you prefer? Please vote with the thumbs - 👍 ![image](https://user-images.githubusercontent.com/1676121/152387949-883c7d7e-a9f3-48aa-bff9-11a691555e6e.png) - 👎 ![image (1)](https://user-images.githubusercontent.com/1676121/152388061-32d95e42-cade-4ae4-9a77-7365e7b72b8f.png)
[ -1.187976598739624, -0.7658642530441284, -0.7779809236526489, 1.3634175062179565, -0.09791475534439087, -1.249812364578247, 0.1240210086107254, -0.9911660552024841, 1.69413161277771, -0.7974244952201843, 0.3308415114879608, -1.665361762046814, 0.05758292227983475, -0.5562041997909546, -0.7797656059265137, -0.8613548874855042, -0.37953731417655945, -0.8080525994300842, 1.0307015180587769, 2.525491237640381, 1.1620506048202515, -1.3447474241256714, 2.76574969291687, 0.606739342212677, -0.2578749656677246, -0.9360827207565308, 0.4687286913394928, -0.010058545507490635, -1.3509172201156616, -0.3665865957736969, -1.0215896368026733, -0.013245326466858387, -0.546989381313324, -0.6064756512641907, 0.08300889283418655, 0.3456813097000122, -0.3134002089500427, -0.41083192825317383, -0.381377249956131, -0.8378350138664246, 0.4839126169681549, -0.3465253412723541, 0.9116979837417603, -0.3243834376335144, 1.8784047365188599, -0.5921568274497986, 0.4973715543746948, 0.6780929565429688, 1.2927000522613525, 0.20001603662967682, -0.0954531878232956, 0.44206503033638, 0.3057485520839691, 0.05053591728210449, 0.43354421854019165, 1.2419617176055908, 0.6266080737113953, 0.48232340812683105, 0.7503104209899902, -2.2322885990142822, 1.3531615734100342, -0.9603810906410217, 0.18021109700202942, 1.3502123355865479, -1.0663273334503174, 0.3878926932811737, -1.8724825382232666, -0.08929319679737091, 0.49273788928985596, -2.328031063079834, 0.1909341663122177, -1.3358399868011475, -0.526999831199646, 1.062330722808838, 0.3318506181240082, -1.238185167312622, 0.06191599369049072, -0.42163947224617004, 0.9107201099395752, 0.45230481028556824, 1.24508535861969, -1.6701582670211792, -0.11216578632593155, -0.2854483723640442, 0.21647027134895325, -1.3525974750518799, -1.579709529876709, 0.5693373084068298, 0.7128649353981018, 0.564991295337677, -0.11160718649625778, 0.9325753450393677, -0.9917259812355042, 0.8428698778152466, -0.912104606628418, -1.7276599407196045, -1.3954967260360718, -2.2292230129241943, -2.2931957244873047, 0.8021690845489502, -0.46414273977279663, -0.507033109664917, 2.071269989013672, -1.1207563877105713, -1.681886076927185, 1.1322698593139648, 0.30335912108421326, -0.034991707652807236, 2.453399419784546, 0.26093992590904236, -0.7914905548095703, 0.5883857011795044, -0.7162762880325317, 0.7749412059783936, -0.34793177247047424, 1.3597159385681152, 0.5211005210876465, -1.0815098285675049, 1.6226840019226074, -0.4264790713787079, 0.5193643569946289, -0.6687958836555481, -0.45089584589004517, -0.7879695296287537, 0.3046652376651764, 1.8731783628463745, -0.32150524854660034, 1.565487265586853, -0.27234652638435364, -1.5768508911132812, -1.5386518239974976, 0.7678999900817871, 0.5245047211647034, -0.8062943816184998, 0.13772894442081451, -0.36481523513793945, 0.11344438791275024, 0.0937986895442009, 1.1363608837127686, 1.3160603046417236, 0.7404276728630066, -0.24950775504112244, -0.9984858632087708, 0.16479846835136414, -0.05448766425251961, -0.7308201789855957, -1.762267827987671, -0.33976709842681885, 0.13059453666210175, 0.6975176930427551, -1.2663698196411133, 1.7834317684173584, 0.8906121850013733, 1.933018445968628, 0.9884675741195679, -0.3406631648540497, 1.5540227890014648, 0.09665344655513763, 1.8323545455932617, -0.41191616654396057, 0.7219508290290833, -0.4255644381046295, -1.1892136335372925, 0.7377424240112305, -0.326926052570343, -2.059781551361084, -0.6649717688560486, -0.905238926410675, -0.15069185197353363, -0.8298033475875854, 0.9873479604721069, -0.2497592717409134, -1.382293939590454, 0.31836050748825073, -0.6854676008224487, 0.07370726019144058, -1.3988759517669678, 0.2807280421257019, 0.7492800354957581, -0.664436936378479, 0.04901896417140961, -0.23806896805763245, -1.3999770879745483, -0.4283187985420227, 0.17895247042179108, 1.9004614353179932, -0.7190645337104797, 1.035105586051941, 1.0272047519683838, -0.6488078832626343, -0.03316279873251915, 0.38408470153808594, -0.34126704931259155, 0.8905144333839417, -1.0859938859939575, -0.2998657524585724, 1.173776388168335, -0.12591947615146637, -0.5423271059989929, 1.361510157585144, 0.734100878238678, -0.9495201706886292, -0.26775476336479187, -0.13372471928596497, -0.7759376168251038, -0.018998675048351288, -1.599595069885254, -0.09255745261907578, 0.3229571580886841, -1.4517056941986084, -0.4920451045036316, -0.19099774956703186, 1.323838472366333, -0.22934550046920776, 1.4303655624389648, -0.3762240409851074, -0.24395811557769775, -0.48968616127967834, -0.41478627920150757, 0.15263356268405914, -0.18129976093769073, -0.6785473823547363, 0.28702637553215027, -0.7439711689949036, 0.2289602905511856, 1.4573626518249512, 0.4254912734031677, 0.07210319489240646, 0.5842913389205933, 1.175407886505127, 0.2948039472103119, -0.08535897731781006, -0.8389713764190674, -1.680978536605835, 2.074221611022949, -1.4908709526062012, 1.9958893060684204, 0.7500019073486328, -0.0895845890045166, -1.7572650909423828, -1.9293121099472046, 1.3775768280029297, 1.147033452987671, 2.4104957580566406, 0.5606100559234619, 0.46782270073890686, -0.7707902789115906, -0.6500133872032166, 0.4222489595413208, -0.9909425973892212, -0.8049938082695007, 0.1202586442232132, 2.3788905143737793, 1.6437855958938599, -0.48158422112464905, -0.16748756170272827, -1.0009061098098755, 1.3328725099563599, -0.175601065158844, 0.1682167947292328, 1.9249815940856934, -0.30159032344818115, -1.1652439832687378, 1.239312767982483, -2.2446539402008057, 0.12782007455825806, 2.0155398845672607, 0.25540217757225037, -0.023444034159183502, -1.3867813348770142, -0.60511714220047, -0.18514539301395416, -0.4687158465385437, -1.2378634214401245, 0.5217397212982178, -0.2492457628250122, -0.8861767053604126, -1.4473212957382202, 0.042400896549224854, -1.1932601928710938, -1.6554338932037354, 0.2879398763179779, 1.7696130275726318, 2.067011833190918, -0.7341192960739136, 1.410502314567566, -0.21510285139083862, 0.22163791954517365, 1.1618127822875977, 1.2770729064941406, 3.1612660884857178, 1.8317208290100098, -1.2921932935714722, 0.6865851283073425, -0.10580739378929138, -0.47178953886032104, 1.232132077217102, -1.1511359214782715, 1.2710973024368286, -0.1293681561946869, -1.3005626201629639, -1.1712886095046997, 0.9167711734771729, 0.4266132712364197, -0.0003867223858833313, -0.39858919382095337, 1.209928274154663, 0.09960898011922836, 1.3318113088607788, 0.5956272482872009, -0.25154417753219604, 0.6721814274787903, -0.4358195662498474, -0.5421347618103027, 1.5588756799697876, 0.1145150363445282, -1.4061635732650757, -2.3441598415374756, -0.2516132593154907, -0.8730577826499939, 0.031635407358407974, -0.7007509469985962, -0.963760256767273, 1.7029696702957153, 0.40967127680778503, -1.1534092426300049, -0.3012031316757202, -0.43765172362327576, -0.5744221806526184, 2.6646926403045654, -1.4253466129302979, -0.2234942764043808, -0.9603942632675171, -0.6203937530517578, 1.5850629806518555, -1.1520482301712036, -0.20410142838954926, -1.0322109460830688, -0.581753134727478, -1.3570568561553955, -0.5899685025215149, -0.08934430778026581, -0.884339451789856, 0.7006987929344177, 0.17008735239505768, -1.1890027523040771, -0.3498151898384094, -0.9292370676994324, 0.8122972249984741, -0.1523001790046692, 0.14311207830905914, 1.7762084007263184, 0.3798890709877014, -0.412873238325119, 0.7252151370048523, 1.1901969909667969, 0.6016435027122498, -0.5318834185600281, 0.22367697954177856, -0.714733362197876, 0.3179459571838379, -1.280205249786377, 0.3047584593296051, -2.86794376373291, 0.5972570776939392, -0.08473479747772217, -0.04526561498641968, -0.0993393212556839, -1.3487396240234375, 1.1157032251358032, 2.594438076019287, -1.1392242908477783, 0.4991825819015503, 0.26385101675987244, 1.197992205619812, -1.6602256298065186, 0.16849346458911896, -0.5045117139816284, 2.1944687366485596, 0.1683853566646576, 1.1515531539916992, -0.482230544090271, -2.2080559730529785, 0.5920988917350769, -1.1818491220474243, -1.0738062858581543, 0.822045087814331, -0.8722900748252869, 0.18591657280921936, -1.2572678327560425, -0.2116582691669464, -0.9096113443374634, -1.1607311964035034, 0.6629738807678223, 0.03437717258930206, 0.6083253622055054, -0.5687659978866577, 0.3093700110912323, -2.1975607872009277, -1.355916142463684, -0.20077745616436005, -0.9440332055091858, 0.48342272639274597, -0.22925430536270142, 0.7588910460472107, -0.12650352716445923, 0.03473326563835144, 0.3681071102619171, 1.413643717765808, 3.2228801250457764, 0.22221674025058746, 0.4357658922672272, -0.11561474204063416, -1.0168285369873047, 1.4620816707611084, 0.950238049030304, -0.18171699345111847, -0.5903046131134033, -0.9332680106163025, 1.3150979280471802, 1.9168763160705566, 0.9799383282661438, 0.02253783866763115, -0.8074221611022949, -0.6722677946090698, 0.0628422200679779, 0.12758733332157135, 0.46961796283721924, 0.9354161024093628, 0.06421384960412979, 0.1740591675043106, 1.45939040184021, 1.1692293882369995, -0.4069478213787079, 0.4935588240623474, -0.8194873929023743, -0.4591095447540283, 0.5254688262939453, 0.31390607357025146, -0.03139020502567291, 0.3943716287612915, -1.0515915155410767, -0.28397345542907715, -0.2314170002937317, -0.9594482779502869, -0.6954923272132874, -0.4119497835636139, -0.3495437204837799, 1.6944500207901, -0.04112182930111885, -0.42870330810546875, 0.030379675328731537, -0.8382989168167114, -0.09546215832233429, -1.0384199619293213, 0.2679743766784668, -0.18251928687095642, -0.02917340025305748, -0.09252838045358658, 1.7547037601470947, -0.8628512024879456, -2.053919792175293, 0.18952232599258423, 0.25589314103126526, -0.4276064336299896, 0.046796251088380814, 1.6758862733840942, 0.5830627083778381, 1.500959873199463, 1.3939508199691772, 0.9919245839118958, -0.6752961874008179, -1.2884299755096436, 0.6878003478050232, 0.9212076663970947, -1.3523166179656982, 0.843102216720581, -0.11115553975105286, -0.5203770995140076, 0.5737445950508118, 1.280138611793518, 0.43223410844802856, -1.919137716293335, 0.8162282705307007, -0.9175258874893188, 0.745258092880249, 0.6743245720863342, 0.7638569474220276, 0.12125840783119202, 0.8896699547767639, -1.2021336555480957, -1.0869150161743164, -0.7092908024787903, -0.6124324202537537, 1.9464744329452515, -0.21522867679595947, 0.4943274259567261, -0.20861221849918365, -1.2764780521392822, -0.0030117537826299667, 0.6461420059204102, 0.3373744785785675, -0.32307615876197815, 0.8408975005149841, -0.6971836686134338, -1.1657835245132446, -1.4507452249526978, -0.48452240228652954, -1.0043365955352783, -0.896554708480835, 1.0156441926956177, 0.7559688091278076, 0.26239630579948425, 1.9462628364562988, 0.6395435333251953, 0.16279096901416779, -2.6431756019592285, 0.820805549621582, 0.3550952970981598, -0.07514310628175735, 0.9037719368934631, 0.2669972777366638, 1.1393561363220215, -0.07804253697395325, 0.5029517412185669, -2.377702236175537, 2.215839147567749, -0.31771284341812134, 0.7247746586799622, 0.04775760695338249, -0.18316562473773956, 0.9682965278625488, 0.551114022731781, 0.6248142123222351, -1.1744911670684814, 0.7330090403556824, -0.7200199961662292, 1.189967155456543, 0.9890709519386292, -0.835843563079834, 0.13327167928218842, 1.2953836917877197, 0.42277204990386963, -0.4752643406391144, -0.8998148441314697, -0.8736265301704407, 0.9035078287124634, 1.7633076906204224, -0.041322071105241776, 0.1032959446310997, 0.8224700689315796, 0.7094360589981079, -1.3487873077392578, 0.06190788000822067, -0.7612610459327698, -0.8100997805595398, 1.6662694215774536, 2.1489951610565186, -0.03727350011467934, -0.1988578736782074, -0.7716725468635559, -1.2998420000076294, 0.8651378154754639, 0.050921883434057236, 0.1472097784280777, 0.7256837487220764, -0.675184965133667, 1.1835312843322754, 0.8633979558944702, 0.9222522377967834, 0.2423844337463379, 0.2741988003253937, 0.2632969915866852, -0.15292073786258698, -1.1210445165634155, -0.2778182327747345, -0.9991176724433899, -2.5785751342773438, 0.523377001285553, -0.2979295551776886, -1.500172734260559, 0.12354755401611328, -0.9783286452293396, 0.8127967119216919, -0.5383480191230774, -1.113782286643982, -1.4459174871444702, 0.2302779257297516, -0.10971236974000931, 0.8296573758125305, -1.5434116125106812, -0.134538933634758, 1.2069250345230103, 1.024038553237915, -0.6250009536743164, 0.9283756613731384, 0.3123215436935425, 1.0400334596633911, 0.9317837953567505, -0.43286633491516113, 0.5031903386116028, 0.20095525681972504, -1.358962893486023, 0.4329167604446411, 1.2549285888671875, 0.24129170179367065, 1.5036451816558838, -0.43288537859916687, -0.013590002432465553, 0.48248401284217834, -0.3816429376602173, -0.49213287234306335, -0.6286552548408508, 0.7087947726249695, -0.02283020317554474, -0.9273149967193604, 0.0252688005566597, -0.06002214923501015, -0.2131344974040985, 0.36873239278793335, -1.479981541633606, -0.18104319274425507, -0.2896924912929535, -0.6144165992736816, -1.315012812614441, -0.11615248769521713, 1.3376669883728027, -0.9032164216041565, -0.10307575017213821, 0.48995864391326904, 0.28796523809432983, 0.5393676161766052, 0.6460114121437073, -0.6915408372879028, -0.417785108089447, -0.2128162533044815, -0.41122108697891235, 0.32047006487846375, 1.247818112373352, -0.14004428684711456, -1.0013140439987183, 0.6396594047546387, -0.2861316204071045, 0.07714180648326874, 1.8565483093261719, 0.08532436937093735, -0.8222113251686096, 0.295546293258667, -0.6795953512191772, 1.884803056716919, 1.6289393901824951, 1.3741180896759033, -0.09714578837156296, -0.9742752909660339, 0.6264137029647827, -0.3658972382545471, -0.33891651034355164, 0.9354777932167053, 0.3917178511619568, -0.17577910423278809, -1.3933104276657104, 0.6932111978530884, 1.2535452842712402, -0.9290492534637451, -0.7276539206504822, 0.052564460784196854, -0.8892870545387268, 1.1561427116394043, 0.7522314786911011, 0.35664162039756775, 0.23949964344501495, 1.6522941589355469, 0.7078584432601929, -0.4974537491798401, 0.49307191371917725, 0.5143316984176636, -0.11808037012815475, -2.085639476776123, -1.05148184299469, 0.2310904860496521, -0.35753506422042847, -1.4927021265029907, 1.386187195777893, -1.176801323890686, -0.9937979578971863, 0.45743581652641296, 0.1054573729634285, 1.4145294427871704, 0.35434454679489136, 1.6982214450836182, 2.0584867000579834, 0.9499847888946533, 0.2719605267047882, 1.2579588890075684, -0.12897908687591553, -0.3589739203453064, 1.7467172145843506, -0.46164900064468384, 0.5759680867195129, 1.0682084560394287, -0.4561712443828583, -1.0766644477844238, -0.8329076766967773, -1.2340807914733887, -0.7274165153503418, 1.0860600471496582, 0.10452611744403839, -1.1629563570022583, 0.2480795979499817, 1.616231918334961, 0.05288727581501007, -0.30198919773101807, 0.6674391627311707, 0.46992090344429016, -0.6710731983184814, -0.07556453347206116, -0.9705353379249573, 0.49742281436920166, -0.21359853446483612, -0.3838091492652893, 0.222431480884552, 0.5449256896972656, 1.2330814599990845, 0.05125636234879494, 0.08156659454107285, 1.2524096965789795, -1.387891411781311, 1.3936792612075806, -0.7856624126434326, 0.25353822112083435, -2.3575940132141113, 1.414566993713379, -0.912870466709137, 1.9121956825256348, -2.6612534523010254, 0.4968515634536743, -0.5193522572517395, -0.530203104019165, 0.30686241388320923, -0.3257424533367157, 0.16434045135974884, -0.10611757636070251, -1.074032187461853, -0.15216121077537537, -0.8228849768638611, 0.5499488115310669, 1.1137675046920776, 1.3243213891983032, -1.0569250583648682, -0.3456360697746277, -1.7092053890228271, -0.14813627302646637, -0.5712520480155945, 0.193783238530159, -1.8607786893844604, -0.21707966923713684, -2.059569835662842, -2.4442381858825684, -1.3973053693771362, -0.9541155695915222, 1.1770271062850952, 0.113655686378479, -0.9283193349838257, 1.0685371160507202, -0.3377494215965271, -1.8244926929473877, 1.1995571851730347, -2.147620916366577 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
It's [live](https://huggingface.co/datasets/glue/viewer/cola/train): <img width="1126" alt="Capture d’écran 2022-02-14 à 10 26 03" src="https://user-images.githubusercontent.com/1676121/153836716-25f6205b-96af-42d8-880a-7c09cb24c420.png"> Thanks all for the help to improve the UI!
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
970
21
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 It's [live](https://huggingface.co/datasets/glue/viewer/cola/train): <img width="1126" alt="Capture d’écran 2022-02-14 à 10 26 03" src="https://user-images.githubusercontent.com/1676121/153836716-25f6205b-96af-42d8-880a-7c09cb24c420.png"> Thanks all for the help to improve the UI!
[ -1.1740540266036987, -0.8017017245292664, -0.7683207988739014, 1.3607538938522339, -0.10963303595781326, -1.235489845275879, 0.12306442856788635, -0.9963587522506714, 1.6893587112426758, -0.8206861019134521, 0.35243695974349976, -1.6838606595993042, -0.0008171945810317993, -0.5202528238296509, -0.7362697720527649, -0.9075985550880432, -0.41786080598831177, -0.7270911931991577, 1.021520733833313, 2.4944419860839844, 1.2507232427597046, -1.4039983749389648, 2.718924045562744, 0.6357817649841309, -0.16429808735847473, -0.9406019449234009, 0.5176846981048584, -0.001054123044013977, -1.3017287254333496, -0.4051889479160309, -0.9836889505386353, -0.06538637727499008, -0.517576277256012, -0.5571390390396118, 0.034184373915195465, 0.3728461265563965, -0.3010939955711365, -0.44755691289901733, -0.5077450275421143, -0.9038584232330322, 0.4230491518974304, -0.36514362692832947, 0.9219567179679871, -0.4412619173526764, 1.8241537809371948, -0.5598132014274597, 0.48404937982559204, 0.7039536237716675, 1.2992767095565796, 0.1740097999572754, -0.03674072027206421, 0.33713605999946594, 0.348224401473999, 0.07218178361654282, 0.4996168613433838, 1.221163272857666, 0.6113613843917847, 0.4910862445831299, 0.772714376449585, -2.19339919090271, 1.3045246601104736, -0.9682457447052002, 0.20214809477329254, 1.3611656427383423, -1.0091158151626587, 0.4068162143230438, -1.861022710800171, -0.08282439410686493, 0.4556819498538971, -2.3284661769866943, 0.20078623294830322, -1.3035962581634521, -0.48382389545440674, 0.9835977554321289, 0.2876916527748108, -1.2391537427902222, 0.044421397149562836, -0.4328243136405945, 0.9200132489204407, 0.5313817858695984, 1.1920185089111328, -1.6310440301895142, -0.0873144119977951, -0.28774023056030273, 0.19096538424491882, -1.3760156631469727, -1.565003752708435, 0.5229800939559937, 0.6539753675460815, 0.5047764778137207, -0.09458030015230179, 0.9526585340499878, -1.0167765617370605, 0.7830421328544617, -0.959607720375061, -1.7538299560546875, -1.4361566305160522, -2.281909704208374, -2.298428535461426, 0.8022148609161377, -0.4281838536262512, -0.5155869126319885, 2.0505714416503906, -1.0397230386734009, -1.7236522436141968, 1.0637805461883545, 0.28463026881217957, 0.047558724880218506, 2.440598726272583, 0.2179538905620575, -0.7848469614982605, 0.5303003787994385, -0.7126953601837158, 0.7105900049209595, -0.3956218361854553, 1.3517643213272095, 0.4951574206352234, -1.042534589767456, 1.6215813159942627, -0.4460008144378662, 0.5328601002693176, -0.6530633568763733, -0.47158336639404297, -0.7715602517127991, 0.2074301689863205, 1.843288540840149, -0.30249032378196716, 1.5310184955596924, -0.2712201178073883, -1.5986963510513306, -1.5814604759216309, 0.807111918926239, 0.49172234535217285, -0.7873250246047974, 0.11383106559515, -0.2936079204082489, 0.12672391533851624, 0.009197166189551353, 1.1091725826263428, 1.2305326461791992, 0.7906151413917542, -0.2528294622898102, -0.9422272443771362, 0.18450672924518585, -0.029421400278806686, -0.7073190212249756, -1.721845269203186, -0.3640700876712799, 0.15587268769741058, 0.6291124820709229, -1.2519009113311768, 1.7990405559539795, 0.9249140620231628, 1.8864613771438599, 1.0018811225891113, -0.31079012155532837, 1.5570716857910156, 0.08429459482431412, 1.8799382448196411, -0.468418687582016, 0.6642470359802246, -0.40324458479881287, -1.1733609437942505, 0.7693044543266296, -0.3220641314983368, -2.0647964477539062, -0.7268144488334656, -0.9358160495758057, -0.18900138139724731, -0.7738738059997559, 1.0159975290298462, -0.26320746541023254, -1.3105698823928833, 0.274203360080719, -0.6641359329223633, 0.05971579998731613, -1.3342442512512207, 0.334599107503891, 0.7125626802444458, -0.6479480862617493, 0.04444902390241623, -0.23567438125610352, -1.360673189163208, -0.4500361382961273, 0.21759408712387085, 1.9102654457092285, -0.7385258078575134, 0.9720614552497864, 0.9573289155960083, -0.7280614972114563, -0.028701437637209892, 0.359478235244751, -0.3032446503639221, 0.8568845987319946, -1.0330078601837158, -0.3986259400844574, 1.2076438665390015, -0.16591867804527283, -0.621002733707428, 1.3827203512191772, 0.742597222328186, -0.9648687243461609, -0.25442245602607727, -0.14561016857624054, -0.832517683506012, -0.018869206309318542, -1.4989707469940186, -0.09172924607992172, 0.31815558671951294, -1.463562250137329, -0.4608578681945801, -0.16062790155410767, 1.2838943004608154, -0.23455499112606049, 1.3988759517669678, -0.34254971146583557, -0.22389841079711914, -0.4737078845500946, -0.4281712472438812, 0.11432279646396637, -0.19102618098258972, -0.7336849570274353, 0.21665583550930023, -0.8205679059028625, 0.27074700593948364, 1.4485399723052979, 0.46242859959602356, 0.007737841457128525, 0.6074504852294922, 1.1390072107315063, 0.33391571044921875, -0.07475762814283371, -0.861031174659729, -1.6242924928665161, 2.06339168548584, -1.46113121509552, 1.9620579481124878, 0.7063113451004028, -0.11702415347099304, -1.7796242237091064, -1.9288913011550903, 1.3494168519973755, 1.160538911819458, 2.4139771461486816, 0.6017380356788635, 0.47259992361068726, -0.786274790763855, -0.7308741807937622, 0.3820755183696747, -1.0277618169784546, -0.7788293361663818, 0.12307710945606232, 2.346500873565674, 1.7313077449798584, -0.5167115330696106, -0.12385697662830353, -0.9807286262512207, 1.3694666624069214, -0.18620802462100983, 0.1936495155096054, 1.9017645120620728, -0.30455392599105835, -1.0751538276672363, 1.246787667274475, -2.2627294063568115, 0.16622215509414673, 2.0069141387939453, 0.3458527624607086, 0.06734910607337952, -1.3538905382156372, -0.6923536062240601, -0.25063374638557434, -0.49366727471351624, -1.2375434637069702, 0.48489609360694885, -0.24319636821746826, -0.8373935222625732, -1.4310767650604248, 0.07697849720716476, -1.1797853708267212, -1.6922938823699951, 0.2697928845882416, 1.8141601085662842, 2.016397714614868, -0.7248525619506836, 1.4202582836151123, -0.23815467953681946, 0.18671853840351105, 1.2230907678604126, 1.2792352437973022, 3.1551053524017334, 1.8781147003173828, -1.2462286949157715, 0.7388880252838135, -0.05772861838340759, -0.4692942500114441, 1.263990879058838, -1.153442621231079, 1.2338223457336426, -0.12441828846931458, -1.2011414766311646, -1.1642303466796875, 0.8684460520744324, 0.462120920419693, 0.017427384853363037, -0.4607635736465454, 1.1876673698425293, 0.10843616724014282, 1.3601500988006592, 0.5873510837554932, -0.31805145740509033, 0.6337611079216003, -0.4089246094226837, -0.4535074234008789, 1.5490741729736328, 0.11001261323690414, -1.463010311126709, -2.310194253921509, -0.2266950160264969, -0.8854919075965881, -0.0056737563572824, -0.6213912963867188, -0.9928853511810303, 1.7370860576629639, 0.43803367018699646, -1.17595636844635, -0.27345940470695496, -0.4208229184150696, -0.6503861546516418, 2.7080347537994385, -1.4276630878448486, -0.22071489691734314, -1.0176231861114502, -0.6564986109733582, 1.606166958808899, -1.1978667974472046, -0.17634111642837524, -1.0159211158752441, -0.5370915532112122, -1.4317430257797241, -0.5932033658027649, -0.0352025032043457, -0.9175674915313721, 0.7530299425125122, 0.18244963884353638, -1.150779128074646, -0.32745853066444397, -0.9239938855171204, 0.8540940284729004, -0.12908881902694702, 0.17968060076236725, 1.8744428157806396, 0.3727441728115082, -0.37307217717170715, 0.6749979257583618, 1.1719404458999634, 0.5986272096633911, -0.5675284266471863, 0.22228427231311798, -0.7178114056587219, 0.3515177369117737, -1.3452736139297485, 0.21724587678909302, -2.8633739948272705, 0.6523197889328003, -0.14484277367591858, -0.09772469103336334, -0.05206719785928726, -1.2999274730682373, 1.0944589376449585, 2.572598695755005, -1.1703083515167236, 0.46989181637763977, 0.28468042612075806, 1.1907241344451904, -1.6822642087936401, 0.22330258786678314, -0.4791218340396881, 2.1562907695770264, 0.2248467057943344, 1.188511610031128, -0.45161277055740356, -2.209663152694702, 0.6085020303726196, -1.210114598274231, -1.1004923582077026, 0.8057106137275696, -0.8336482644081116, 0.2268606275320053, -1.3429327011108398, -0.2004568725824356, -0.8761982321739197, -1.1669960021972656, 0.7444416284561157, 0.05867892503738403, 0.5160714387893677, -0.5647995471954346, 0.32000720500946045, -2.2025609016418457, -1.3167262077331543, -0.25501394271850586, -0.8873808979988098, 0.480861634016037, -0.2655960023403168, 0.7362014651298523, -0.14604149758815765, 0.0053499070927500725, 0.33723339438438416, 1.4102283716201782, 3.300403356552124, 0.20361575484275818, 0.3800206184387207, -0.16402916610240936, -1.0433968305587769, 1.5236876010894775, 0.9710178971290588, -0.1206473857164383, -0.4638585150241852, -0.984689474105835, 1.2792155742645264, 1.9172956943511963, 0.959940493106842, 0.07648039609193802, -0.8328220844268799, -0.6945089101791382, -0.003073840867727995, 0.10980011522769928, 0.48484838008880615, 0.9552886486053467, 0.03562159091234207, 0.13627010583877563, 1.5117008686065674, 1.1960318088531494, -0.31964004039764404, 0.3863843083381653, -0.8387361168861389, -0.4416470229625702, 0.5696996450424194, 0.3230753242969513, -0.0015111109241843224, 0.45293885469436646, -1.0341508388519287, -0.259580135345459, -0.2944675087928772, -0.9454131722450256, -0.6538122296333313, -0.4730216860771179, -0.343623548746109, 1.6984028816223145, 0.020242681726813316, -0.5167686939239502, 0.05055897682905197, -0.8629109263420105, -0.03993988782167435, -1.094160556793213, 0.27859142422676086, -0.1441839635372162, -0.02537403628230095, -0.10061608254909515, 1.7239049673080444, -0.923949122428894, -2.108663320541382, 0.20396138727664948, 0.2969087064266205, -0.37910205125808716, 0.08922150731086731, 1.6194725036621094, 0.5422468185424805, 1.4642094373703003, 1.3508317470550537, 0.9747379422187805, -0.6699590086936951, -1.3271443843841553, 0.6610975861549377, 0.9765509366989136, -1.3901816606521606, 0.9009997248649597, -0.06586845219135284, -0.5445318222045898, 0.5612223744392395, 1.2386178970336914, 0.4117317199707031, -1.906273603439331, 0.7797213196754456, -0.8629364967346191, 0.7683883905410767, 0.6634918451309204, 0.7860345244407654, 0.18950307369232178, 0.8600239753723145, -1.2453203201293945, -1.0948667526245117, -0.7697322964668274, -0.6213114857673645, 1.889356255531311, -0.23078805208206177, 0.5506307482719421, -0.23158220946788788, -1.2946175336837769, -0.007104864809662104, 0.6586982011795044, 0.3183032274246216, -0.3512776792049408, 0.7731825113296509, -0.6605516672134399, -1.1302573680877686, -1.4166628122329712, -0.4593692421913147, -1.0007210969924927, -0.9159137606620789, 1.065148949623108, 0.7517970204353333, 0.2738899290561676, 1.9485739469528198, 0.6777071952819824, 0.21483708918094635, -2.672121286392212, 0.8261245489120483, 0.3238931894302368, 0.033507078886032104, 0.8934813141822815, 0.27630704641342163, 1.1294736862182617, -0.1103430688381195, 0.5406224131584167, -2.3996989727020264, 2.230517625808716, -0.27410805225372314, 0.719318687915802, 0.019283439964056015, -0.21808812022209167, 1.015794277191162, 0.6105244755744934, 0.5836569666862488, -1.1329329013824463, 0.6907720565795898, -0.6727675199508667, 1.164155125617981, 0.9741581082344055, -0.8470371961593628, 0.08559267222881317, 1.3128352165222168, 0.47281062602996826, -0.44617190957069397, -0.9561540484428406, -0.8161820769309998, 0.9736815690994263, 1.7343308925628662, 0.02197268418967724, 0.05030980706214905, 0.9077487587928772, 0.6877590417861938, -1.3209521770477295, 0.08889304846525192, -0.7560399174690247, -0.7280604839324951, 1.6887307167053223, 2.0592010021209717, -0.05412197858095169, -0.22160428762435913, -0.7531631588935852, -1.3045580387115479, 0.7778787016868591, 0.051817163825035095, 0.1277865767478943, 0.7791633009910583, -0.6748062372207642, 1.1424832344055176, 0.7899678945541382, 0.9495978951454163, 0.23272602260112762, 0.3506968915462494, 0.29664748907089233, -0.22255350649356842, -1.1694062948226929, -0.1541876345872879, -1.0345618724822998, -2.6009249687194824, 0.4997597932815552, -0.2477787435054779, -1.4392588138580322, 0.0711776465177536, -1.0196861028671265, 0.8681513071060181, -0.5179190635681152, -1.1541545391082764, -1.4401788711547852, 0.22235141694545746, -0.08939410746097565, 0.8148613572120667, -1.5317593812942505, -0.11957617104053497, 1.292540431022644, 1.0380041599273682, -0.6301645636558533, 0.977647602558136, 0.2564387023448944, 1.0963306427001953, 0.881786048412323, -0.4593360424041748, 0.5039706230163574, 0.0911649614572525, -1.3718937635421753, 0.4348246157169342, 1.200384497642517, 0.24219630658626556, 1.4831644296646118, -0.50731360912323, 0.072471484541893, 0.48332783579826355, -0.41085752844810486, -0.5066859722137451, -0.623727560043335, 0.7035928964614868, 0.009913802146911621, -0.989762008190155, -0.02100438065826893, -0.05883333832025528, -0.24568715691566467, 0.25503113865852356, -1.423258662223816, -0.15505540370941162, -0.3510509133338928, -0.6189747452735901, -1.243709683418274, -0.0912691056728363, 1.3240997791290283, -0.8904517889022827, -0.12291338294744492, 0.5052136182785034, 0.217471644282341, 0.5470088124275208, 0.6199215054512024, -0.7537655234336853, -0.32341790199279785, -0.22487950325012207, -0.37372466921806335, 0.30451709032058716, 1.2625035047531128, -0.1623278707265854, -1.058414340019226, 0.6549090147018433, -0.26515328884124756, 0.10735047608613968, 1.924683690071106, 0.04503398388624191, -0.7591066956520081, 0.31215476989746094, -0.7042434811592102, 1.9088904857635498, 1.7103434801101685, 1.3782813549041748, -0.09332718700170517, -0.8883806467056274, 0.62641441822052, -0.3581024706363678, -0.35834258794784546, 0.8881327509880066, 0.3891214430332184, -0.1725611686706543, -1.4159250259399414, 0.6635107398033142, 1.2604165077209473, -0.9147763252258301, -0.7617053985595703, 0.1186472475528717, -0.8851135969161987, 1.114122748374939, 0.7315196394920349, 0.38276511430740356, 0.3052046597003937, 1.6137735843658447, 0.7504113912582397, -0.4957839846611023, 0.518338143825531, 0.5408198237419128, -0.12578085064888, -2.0374655723571777, -1.069787621498108, 0.27985242009162903, -0.44680267572402954, -1.5010855197906494, 1.4276360273361206, -1.1975831985473633, -0.947029709815979, 0.5153772234916687, 0.17908136546611786, 1.4061304330825806, 0.33609944581985474, 1.6705472469329834, 2.034205913543701, 0.8747082948684692, 0.2947247326374054, 1.2383983135223389, -0.08446580916643143, -0.37973445653915405, 1.7777835130691528, -0.4341314136981964, 0.541621208190918, 1.0312561988830566, -0.41738325357437134, -1.1169885396957397, -0.7974989414215088, -1.2606817483901978, -0.7199203372001648, 1.129451870918274, 0.07647445052862167, -1.1221883296966553, 0.2096804678440094, 1.615156888961792, 0.048466458916664124, -0.33048614859580994, 0.6675868630409241, 0.4173133671283722, -0.7031564712524414, -0.053317442536354065, -0.9804831147193909, 0.5278698205947876, -0.1298595368862152, -0.36190715432167053, 0.20604027807712555, 0.5429098606109619, 1.2855786085128784, 0.045863181352615356, 0.13828207552433014, 1.282811164855957, -1.3389455080032349, 1.462742805480957, -0.7860947847366333, 0.18098676204681396, -2.3941662311553955, 1.4367669820785522, -0.9267168641090393, 1.9337992668151855, -2.6336445808410645, 0.46608418226242065, -0.5623912215232849, -0.422129362821579, 0.3015044927597046, -0.3904843032360077, 0.13377010822296143, -0.0798412412405014, -1.0967963933944702, -0.10622613877058029, -0.7466740012168884, 0.5384433269500732, 1.1401610374450684, 1.3555315732955933, -1.1233716011047363, -0.37446779012680054, -1.7552437782287598, -0.11377609521150589, -0.6660616993904114, 0.2836257815361023, -1.893151044845581, -0.18630491197109222, -1.9749736785888672, -2.4686107635498047, -1.4280833005905151, -0.8347371816635132, 1.1666841506958008, 0.13836495578289032, -0.9401775002479553, 1.1507734060287476, -0.31873345375061035, -1.7996604442596436, 1.1686183214187622, -2.2286508083343506 ]
https://github.com/huggingface/datasets/issues/3668
Couldn't cast array of type string error with cast_column
Hi ! I wasn't able to reproduce the error, are you still experiencing this ? I tried calling `cast_column` on a string column containing paths. If you manage to share a reproducible code example that would be perfect
## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## 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: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png)
971
38
Couldn't cast array of type string error with cast_column ## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## 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: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png) Hi ! I wasn't able to reproduce the error, are you still experiencing this ? I tried calling `cast_column` on a string column containing paths. If you manage to share a reproducible code example that would be perfect
[ -1.253899097442627, -0.7385124564170837, -0.7103964686393738, 1.345011591911316, -0.045501478016376495, -1.2987394332885742, 0.09456437826156616, -1.02891206741333, 1.6527752876281738, -0.7013452053070068, 0.2824831008911133, -1.5934077501296997, 0.0644301250576973, -0.5723004341125488, -0.7946640253067017, -0.8037755489349365, -0.3209434747695923, -0.822878360748291, 1.130953073501587, 2.578375816345215, 1.208672285079956, -1.4203921556472778, 2.873389959335327, 0.6720002293586731, -0.2668260335922241, -0.894591212272644, 0.5048167109489441, 0.10595222562551498, -1.3898006677627563, -0.3990652561187744, -0.9286364912986755, -0.05907999724149704, -0.5346329808235168, -0.5343493819236755, 0.06250478327274323, 0.32644039392471313, -0.19490960240364075, -0.3823835253715515, -0.4842466115951538, -0.6865054368972778, 0.4830678701400757, -0.34701669216156006, 0.8881429433822632, -0.254680335521698, 1.7484900951385498, -0.576714813709259, 0.36893200874328613, 0.6281339526176453, 1.367667555809021, 0.16445861756801605, -0.08211500197649002, 0.4098542332649231, 0.31570005416870117, -0.049332745373249054, 0.479733943939209, 1.2703384160995483, 0.7510656118392944, 0.47493892908096313, 0.7367919087409973, -2.176844835281372, 1.3304862976074219, -0.8762626051902771, 0.2207457274198532, 1.3984036445617676, -1.0584769248962402, 0.41264718770980835, -1.8688620328903198, -0.06775979697704315, 0.43478089570999146, -2.325326681137085, 0.19814592599868774, -1.3086004257202148, -0.5541176795959473, 0.9643503427505493, 0.22836388647556305, -1.3105064630508423, 0.14912374317646027, -0.5151437520980835, 1.0428214073181152, 0.3695855140686035, 1.2799034118652344, -1.7525960206985474, -0.10532283782958984, -0.23036573827266693, 0.15533007681369781, -1.1993355751037598, -1.5832710266113281, 0.5560126900672913, 0.6563679575920105, 0.6049669981002808, -0.10818000137805939, 0.9060983061790466, -1.0188333988189697, 0.8490869402885437, -0.9338655471801758, -1.683516263961792, -1.3941764831542969, -2.2738397121429443, -2.2189888954162598, 0.8144130110740662, -0.44634389877319336, -0.4174796938896179, 2.0702059268951416, -1.0841201543807983, -1.7183194160461426, 1.0246096849441528, 0.3093719482421875, -0.07422810047864914, 2.4587020874023438, 0.26936328411102295, -0.7995479702949524, 0.5888776183128357, -0.7675445675849915, 0.8235218524932861, -0.34912675619125366, 1.3601956367492676, 0.4528312683105469, -0.9984708428382874, 1.5432106256484985, -0.46897029876708984, 0.5374763607978821, -0.6768918633460999, -0.45959627628326416, -0.7896268367767334, 0.31978631019592285, 1.9871768951416016, -0.2488383799791336, 1.6306856870651245, -0.3584309220314026, -1.5719236135482788, -1.4525552988052368, 0.762039303779602, 0.6399025917053223, -0.8793768286705017, 0.08793583512306213, -0.42304056882858276, 0.07046457380056381, 0.08236683160066605, 1.0508122444152832, 1.3019517660140991, 0.7340950965881348, -0.27811557054519653, -0.9597434401512146, 0.14691497385501862, -0.08215250819921494, -0.7024634480476379, -1.8246889114379883, -0.28471839427948, 0.17036278545856476, 0.6506552696228027, -1.3755019903182983, 1.662964105606079, 0.8777323365211487, 1.9668381214141846, 1.0661165714263916, -0.4281999468803406, 1.5564632415771484, 0.10421131551265717, 1.8878967761993408, -0.4991322159767151, 0.7143121957778931, -0.4185146689414978, -1.2019766569137573, 0.7295923829078674, -0.33755987882614136, -2.0656590461730957, -0.6465029120445251, -0.7321816086769104, -0.14512299001216888, -0.8379071354866028, 0.9147136211395264, -0.3107298016548157, -1.4070593118667603, 0.2870526909828186, -0.6975364685058594, 0.17267680168151855, -1.3112250566482544, 0.273506224155426, 0.7671605944633484, -0.601661741733551, 0.0043122051283717155, -0.2782852053642273, -1.325129508972168, -0.468197226524353, 0.3063892126083374, 1.779016375541687, -0.6922687292098999, 0.9686651825904846, 1.062276005744934, -0.5540545582771301, 0.012286247685551643, 0.38664668798446655, -0.3568512797355652, 0.9041824340820312, -1.1138876676559448, -0.373557448387146, 1.1069231033325195, -0.1465345174074173, -0.41218411922454834, 1.3654766082763672, 0.750537097454071, -0.9986882209777832, -0.24941852688789368, -0.07094530761241913, -0.848933219909668, -0.027249636128544807, -1.64288330078125, -0.16960930824279785, 0.3093307614326477, -1.4759091138839722, -0.45986026525497437, -0.18388433754444122, 1.3562403917312622, -0.18523092567920685, 1.4304865598678589, -0.3236844539642334, -0.12415920943021774, -0.4555776119232178, -0.4144425392150879, 0.15143394470214844, -0.20290601253509521, -0.6871157288551331, 0.2766599655151367, -0.7372748851776123, 0.25433218479156494, 1.486425757408142, 0.41011613607406616, 0.09377648681402206, 0.4796924591064453, 1.1392598152160645, 0.2831560969352722, -0.10464268922805786, -0.8294459581375122, -1.6681798696517944, 2.081200122833252, -1.5141313076019287, 1.9950685501098633, 0.9099112749099731, -0.023661445826292038, -1.7989883422851562, -1.845973014831543, 1.419487476348877, 1.106842279434204, 2.474480628967285, 0.48291850090026855, 0.4640706181526184, -0.7354654669761658, -0.6551657319068909, 0.3883383274078369, -0.920849621295929, -0.8181432485580444, 0.12695305049419403, 2.3565659523010254, 1.6790809631347656, -0.43934929370880127, -0.21104276180267334, -1.0246764421463013, 1.3846372365951538, -0.1865229457616806, 0.18115830421447754, 1.9026850461959839, -0.2190055400133133, -1.1364820003509521, 1.2729899883270264, -2.263376235961914, 0.24898777902126312, 2.0218141078948975, 0.332984983921051, -0.046663008630275726, -1.3756747245788574, -0.658129870891571, -0.26688283681869507, -0.45999038219451904, -1.225768804550171, 0.45316392183303833, -0.2743619680404663, -0.8894256949424744, -1.5204359292984009, -0.014478463679552078, -1.2284644842147827, -1.700178861618042, 0.39202582836151123, 1.866668701171875, 2.046553373336792, -0.7556139826774597, 1.4304676055908203, -0.37888485193252563, 0.1361970454454422, 1.1088334321975708, 1.1901559829711914, 3.1746230125427246, 1.8110747337341309, -1.2494288682937622, 0.6528406143188477, -0.19092904031276703, -0.41385430097579956, 1.0320911407470703, -1.0525949001312256, 1.286658763885498, -0.14510837197303772, -1.2518196105957031, -1.1848641633987427, 0.9786937236785889, 0.4541969895362854, 0.011693764477968216, -0.45767366886138916, 1.196347951889038, 0.07058370113372803, 1.3166933059692383, 0.5733560919761658, -0.23069129884243011, 0.6048217415809631, -0.3358432650566101, -0.5610851645469666, 1.578108787536621, 0.09244304895401001, -1.516010046005249, -2.385150671005249, -0.23030968010425568, -0.769721269607544, 0.03032548353075981, -0.7152819633483887, -1.0803176164627075, 1.597025752067566, 0.448322594165802, -1.1198348999023438, -0.2855146527290344, -0.4063042998313904, -0.5512036085128784, 2.572364330291748, -1.4301265478134155, -0.1559273600578308, -0.894390881061554, -0.5670831799507141, 1.5429104566574097, -1.1292115449905396, -0.17576348781585693, -0.9147065281867981, -0.5345257520675659, -1.2178683280944824, -0.47305458784103394, -0.0951375961303711, -0.8596673607826233, 0.6584895253181458, 0.1513640433549881, -1.174769639968872, -0.3137405514717102, -0.938281238079071, 0.8725493550300598, -0.14850464463233948, 0.09741382300853729, 1.8077565431594849, 0.38283294439315796, -0.41325557231903076, 0.7766176462173462, 1.2555192708969116, 0.5743496417999268, -0.6258978843688965, 0.12053227424621582, -0.6668018698692322, 0.33929187059402466, -1.2755458354949951, 0.24463443458080292, -2.8806653022766113, 0.6888142824172974, -0.03288901597261429, -0.02407154068350792, -0.05270882323384285, -1.3704360723495483, 1.092808485031128, 2.5433552265167236, -1.1109243631362915, 0.5743392109870911, 0.3066706657409668, 1.1555125713348389, -1.6225569248199463, 0.24523426592350006, -0.42271775007247925, 2.086714506149292, 0.1811991184949875, 1.2091925144195557, -0.5861096382141113, -2.274890899658203, 0.5205267667770386, -1.1774410009384155, -1.0759023427963257, 0.7434245347976685, -0.8714029788970947, 0.15242740511894226, -1.3274577856063843, -0.21876820921897888, -0.9328242540359497, -1.2258137464523315, 0.6233239769935608, 0.11697512865066528, 0.48112547397613525, -0.5831410884857178, 0.30909955501556396, -2.1978824138641357, -1.3385539054870605, -0.11266707628965378, -1.0063660144805908, 0.5402793288230896, -0.3291982412338257, 0.651964545249939, -0.06818069517612457, -0.005730592645704746, 0.3030042052268982, 1.4427075386047363, 3.276705265045166, 0.12318657338619232, 0.3976227045059204, -0.23422662913799286, -0.9978305697441101, 1.4841142892837524, 0.9451134204864502, -0.1295224130153656, -0.6763790845870972, -1.0064836740493774, 1.281786561012268, 1.9602453708648682, 0.9890650510787964, -0.008124301210045815, -0.8798304200172424, -0.7373848557472229, 0.07053019106388092, 0.14289703965187073, 0.48417598009109497, 1.0962355136871338, 0.018741583451628685, 0.08123920112848282, 1.4780128002166748, 1.1767367124557495, -0.46450620889663696, 0.5319663882255554, -0.8461997509002686, -0.46677958965301514, 0.4140894412994385, 0.3443750739097595, -0.05778073891997337, 0.4159080386161804, -1.0821244716644287, -0.22736774384975433, -0.30781883001327515, -0.945817232131958, -0.7301898002624512, -0.40786463022232056, -0.3439602851867676, 1.6880433559417725, 0.06946543604135513, -0.4034876227378845, 0.08168800175189972, -0.768012285232544, -0.15964318811893463, -0.9762521982192993, 0.3480186462402344, -0.18476983904838562, 0.008509643375873566, -0.07041382789611816, 1.7471036911010742, -0.882182776927948, -2.150130271911621, 0.19825994968414307, 0.20502057671546936, -0.3842562437057495, 0.07092898339033127, 1.7439554929733276, 0.6422119140625, 1.3915733098983765, 1.3866018056869507, 0.936050534248352, -0.6666607856750488, -1.3515417575836182, 0.7072747945785522, 0.9459221959114075, -1.3226641416549683, 0.8178622126579285, -0.17831511795520782, -0.5664768815040588, 0.7246176600456238, 1.4079443216323853, 0.43097424507141113, -2.0605146884918213, 0.8952634930610657, -0.9375656247138977, 0.8174062967300415, 0.6445297598838806, 0.7217346429824829, 0.20173507928848267, 0.9158182740211487, -1.3458102941513062, -1.0665650367736816, -0.7206498384475708, -0.6773415803909302, 1.9111865758895874, -0.21453729271888733, 0.4615458846092224, -0.22977527976036072, -1.289912223815918, -0.08346372842788696, 0.6194530129432678, 0.35599565505981445, -0.3297085762023926, 0.7578083872795105, -0.7273268699645996, -1.1553692817687988, -1.4544721841812134, -0.47425252199172974, -0.8848044872283936, -0.8381629586219788, 0.9261356592178345, 0.6973838210105896, 0.40757519006729126, 1.9882184267044067, 0.5869346261024475, 0.08994544297456741, -2.6393983364105225, 0.8924387097358704, 0.32472699880599976, -0.023323988541960716, 0.9701479077339172, 0.31446373462677, 1.0867265462875366, 0.0250452421605587, 0.5418594479560852, -2.3640944957733154, 2.2570812702178955, -0.30133116245269775, 0.7910810112953186, 0.040729474276304245, -0.14511071145534515, 1.0766386985778809, 0.5448147058486938, 0.6102274656295776, -1.1854764223098755, 0.7557528614997864, -0.6650062203407288, 1.1776843070983887, 0.8950318694114685, -0.8007914423942566, 0.029667671769857407, 1.2736313343048096, 0.3716288208961487, -0.4783859848976135, -0.9801798462867737, -0.9002384543418884, 0.9177537560462952, 1.8068805932998657, -0.022196531295776367, 0.13889586925506592, 0.7759965658187866, 0.693808376789093, -1.3809823989868164, 0.01218397170305252, -0.7295544743537903, -0.7757127285003662, 1.7286442518234253, 2.147390842437744, -0.0439675897359848, -0.2515016794204712, -0.616215705871582, -1.3440932035446167, 0.8407548666000366, 0.01810690201818943, 0.17222462594509125, 0.6425778269767761, -0.7229832410812378, 1.1815892457962036, 0.8218055367469788, 0.9015182852745056, 0.11974816024303436, 0.2518051862716675, 0.3369055986404419, -0.2590635418891907, -1.1470762491226196, -0.33533066511154175, -1.066119909286499, -2.5292744636535645, 0.41362762451171875, -0.23195141553878784, -1.50386381149292, 0.12736164033412933, -1.0316107273101807, 0.7305641770362854, -0.5408836007118225, -1.0818654298782349, -1.4512510299682617, 0.24540086090564728, -0.15330760180950165, 0.8687896132469177, -1.5436147451400757, -0.21093367040157318, 1.21657395362854, 1.0130798816680908, -0.5350453853607178, 1.0091521739959717, 0.27214115858078003, 0.9741173982620239, 0.9009265303611755, -0.4727219343185425, 0.43561530113220215, 0.20048783719539642, -1.2521854639053345, 0.40945619344711304, 1.3402860164642334, 0.21893998980522156, 1.5198988914489746, -0.4742904305458069, 0.03077888861298561, 0.5182032585144043, -0.4412822723388672, -0.47409993410110474, -0.5929572582244873, 0.7152688503265381, -0.011312652379274368, -1.0147002935409546, -0.004337777383625507, -0.1261814683675766, -0.22857031226158142, 0.31399887800216675, -1.4705325365066528, -0.20736348628997803, -0.40797924995422363, -0.5438082218170166, -1.3434752225875854, -0.04762578755617142, 1.2882570028305054, -0.8641154766082764, -0.18246710300445557, 0.5102931261062622, 0.41106587648391724, 0.5897246599197388, 0.6784043312072754, -0.7374738454818726, -0.3988063335418701, -0.24074581265449524, -0.42600440979003906, 0.28996098041534424, 1.2463197708129883, -0.14792639017105103, -0.9927289485931396, 0.5846081972122192, -0.38285231590270996, 0.12162086367607117, 1.9097967147827148, 0.046871598809957504, -0.8304608464241028, 0.3444766402244568, -0.6726041436195374, 1.8961596488952637, 1.591556191444397, 1.3901026248931885, -0.14805766940116882, -0.8877525329589844, 0.6326211094856262, -0.19873909652233124, -0.3214385509490967, 0.9232119917869568, 0.4119076728820801, -0.21312540769577026, -1.4565744400024414, 0.5649880766868591, 1.2300604581832886, -0.8573389053344727, -0.6851440668106079, 0.035687871277332306, -0.8323953747749329, 1.2243674993515015, 0.7437790632247925, 0.3465862274169922, 0.30324065685272217, 1.7004176378250122, 0.6875566244125366, -0.54200679063797, 0.4845591187477112, 0.45299309492111206, -0.262199342250824, -2.161442756652832, -1.0224521160125732, 0.2258133739233017, -0.3767179250717163, -1.5722070932388306, 1.3269109725952148, -1.1298502683639526, -1.0013540983200073, 0.5140959024429321, 0.06446372717618942, 1.3479543924331665, 0.25839030742645264, 1.7053765058517456, 2.0574562549591064, 1.0007497072219849, 0.34499502182006836, 1.218819499015808, -0.17795708775520325, -0.39741432666778564, 1.7910997867584229, -0.39863526821136475, 0.5490545034408569, 1.041077733039856, -0.43326878547668457, -1.103049635887146, -0.815913736820221, -1.1717743873596191, -0.7470393776893616, 1.0961414575576782, 0.15248750150203705, -1.197463035583496, 0.19466248154640198, 1.5752017498016357, 0.16401441395282745, -0.2766156792640686, 0.6999792456626892, 0.5139482617378235, -0.6442142724990845, -0.13897308707237244, -0.9945457577705383, 0.48702168464660645, -0.2313745766878128, -0.4294159412384033, 0.19391991198062897, 0.5363492965698242, 1.1793463230133057, 0.020620353519916534, -0.00639145914465189, 1.2764976024627686, -1.3894010782241821, 1.3414905071258545, -0.7485976219177246, 0.3104977011680603, -2.3143513202667236, 1.445918321609497, -0.7931972146034241, 1.9710097312927246, -2.636326551437378, 0.5010573267936707, -0.6270037889480591, -0.478582501411438, 0.3175066113471985, -0.2808259129524231, 0.17162807285785675, -0.11360429972410202, -1.0232741832733154, -0.22626815736293793, -0.8353541493415833, 0.5018036365509033, 1.198561191558838, 1.330156922340393, -0.954810619354248, -0.16008126735687256, -1.6424556970596313, -0.18742293119430542, -0.6042828559875488, 0.19664612412452698, -1.952100396156311, -0.18916504085063934, -2.058799982070923, -2.343496084213257, -1.4317541122436523, -0.8765798807144165, 1.1327062845230103, 0.21518486738204956, -0.8952102065086365, 1.1562846899032593, -0.40064334869384766, -1.7257144451141357, 1.1575102806091309, -2.1827051639556885 ]
https://github.com/huggingface/datasets/issues/3668
Couldn't cast array of type string error with cast_column
Hi, I think my team mate got this solved. Clolsing it for now and will reopen if I experience this again. Thanks :)
## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## 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: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png)
971
23
Couldn't cast array of type string error with cast_column ## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## 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: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png) Hi, I think my team mate got this solved. Clolsing it for now and will reopen if I experience this again. Thanks :)
[ -1.253899097442627, -0.7385124564170837, -0.7103964686393738, 1.345011591911316, -0.045501478016376495, -1.2987394332885742, 0.09456437826156616, -1.02891206741333, 1.6527752876281738, -0.7013452053070068, 0.2824831008911133, -1.5934077501296997, 0.0644301250576973, -0.5723004341125488, -0.7946640253067017, -0.8037755489349365, -0.3209434747695923, -0.822878360748291, 1.130953073501587, 2.578375816345215, 1.208672285079956, -1.4203921556472778, 2.873389959335327, 0.6720002293586731, -0.2668260335922241, -0.894591212272644, 0.5048167109489441, 0.10595222562551498, -1.3898006677627563, -0.3990652561187744, -0.9286364912986755, -0.05907999724149704, -0.5346329808235168, -0.5343493819236755, 0.06250478327274323, 0.32644039392471313, -0.19490960240364075, -0.3823835253715515, -0.4842466115951538, -0.6865054368972778, 0.4830678701400757, -0.34701669216156006, 0.8881429433822632, -0.254680335521698, 1.7484900951385498, -0.576714813709259, 0.36893200874328613, 0.6281339526176453, 1.367667555809021, 0.16445861756801605, -0.08211500197649002, 0.4098542332649231, 0.31570005416870117, -0.049332745373249054, 0.479733943939209, 1.2703384160995483, 0.7510656118392944, 0.47493892908096313, 0.7367919087409973, -2.176844835281372, 1.3304862976074219, -0.8762626051902771, 0.2207457274198532, 1.3984036445617676, -1.0584769248962402, 0.41264718770980835, -1.8688620328903198, -0.06775979697704315, 0.43478089570999146, -2.325326681137085, 0.19814592599868774, -1.3086004257202148, -0.5541176795959473, 0.9643503427505493, 0.22836388647556305, -1.3105064630508423, 0.14912374317646027, -0.5151437520980835, 1.0428214073181152, 0.3695855140686035, 1.2799034118652344, -1.7525960206985474, -0.10532283782958984, -0.23036573827266693, 0.15533007681369781, -1.1993355751037598, -1.5832710266113281, 0.5560126900672913, 0.6563679575920105, 0.6049669981002808, -0.10818000137805939, 0.9060983061790466, -1.0188333988189697, 0.8490869402885437, -0.9338655471801758, -1.683516263961792, -1.3941764831542969, -2.2738397121429443, -2.2189888954162598, 0.8144130110740662, -0.44634389877319336, -0.4174796938896179, 2.0702059268951416, -1.0841201543807983, -1.7183194160461426, 1.0246096849441528, 0.3093719482421875, -0.07422810047864914, 2.4587020874023438, 0.26936328411102295, -0.7995479702949524, 0.5888776183128357, -0.7675445675849915, 0.8235218524932861, -0.34912675619125366, 1.3601956367492676, 0.4528312683105469, -0.9984708428382874, 1.5432106256484985, -0.46897029876708984, 0.5374763607978821, -0.6768918633460999, -0.45959627628326416, -0.7896268367767334, 0.31978631019592285, 1.9871768951416016, -0.2488383799791336, 1.6306856870651245, -0.3584309220314026, -1.5719236135482788, -1.4525552988052368, 0.762039303779602, 0.6399025917053223, -0.8793768286705017, 0.08793583512306213, -0.42304056882858276, 0.07046457380056381, 0.08236683160066605, 1.0508122444152832, 1.3019517660140991, 0.7340950965881348, -0.27811557054519653, -0.9597434401512146, 0.14691497385501862, -0.08215250819921494, -0.7024634480476379, -1.8246889114379883, -0.28471839427948, 0.17036278545856476, 0.6506552696228027, -1.3755019903182983, 1.662964105606079, 0.8777323365211487, 1.9668381214141846, 1.0661165714263916, -0.4281999468803406, 1.5564632415771484, 0.10421131551265717, 1.8878967761993408, -0.4991322159767151, 0.7143121957778931, -0.4185146689414978, -1.2019766569137573, 0.7295923829078674, -0.33755987882614136, -2.0656590461730957, -0.6465029120445251, -0.7321816086769104, -0.14512299001216888, -0.8379071354866028, 0.9147136211395264, -0.3107298016548157, -1.4070593118667603, 0.2870526909828186, -0.6975364685058594, 0.17267680168151855, -1.3112250566482544, 0.273506224155426, 0.7671605944633484, -0.601661741733551, 0.0043122051283717155, -0.2782852053642273, -1.325129508972168, -0.468197226524353, 0.3063892126083374, 1.779016375541687, -0.6922687292098999, 0.9686651825904846, 1.062276005744934, -0.5540545582771301, 0.012286247685551643, 0.38664668798446655, -0.3568512797355652, 0.9041824340820312, -1.1138876676559448, -0.373557448387146, 1.1069231033325195, -0.1465345174074173, -0.41218411922454834, 1.3654766082763672, 0.750537097454071, -0.9986882209777832, -0.24941852688789368, -0.07094530761241913, -0.848933219909668, -0.027249636128544807, -1.64288330078125, -0.16960930824279785, 0.3093307614326477, -1.4759091138839722, -0.45986026525497437, -0.18388433754444122, 1.3562403917312622, -0.18523092567920685, 1.4304865598678589, -0.3236844539642334, -0.12415920943021774, -0.4555776119232178, -0.4144425392150879, 0.15143394470214844, -0.20290601253509521, -0.6871157288551331, 0.2766599655151367, -0.7372748851776123, 0.25433218479156494, 1.486425757408142, 0.41011613607406616, 0.09377648681402206, 0.4796924591064453, 1.1392598152160645, 0.2831560969352722, -0.10464268922805786, -0.8294459581375122, -1.6681798696517944, 2.081200122833252, -1.5141313076019287, 1.9950685501098633, 0.9099112749099731, -0.023661445826292038, -1.7989883422851562, -1.845973014831543, 1.419487476348877, 1.106842279434204, 2.474480628967285, 0.48291850090026855, 0.4640706181526184, -0.7354654669761658, -0.6551657319068909, 0.3883383274078369, -0.920849621295929, -0.8181432485580444, 0.12695305049419403, 2.3565659523010254, 1.6790809631347656, -0.43934929370880127, -0.21104276180267334, -1.0246764421463013, 1.3846372365951538, -0.1865229457616806, 0.18115830421447754, 1.9026850461959839, -0.2190055400133133, -1.1364820003509521, 1.2729899883270264, -2.263376235961914, 0.24898777902126312, 2.0218141078948975, 0.332984983921051, -0.046663008630275726, -1.3756747245788574, -0.658129870891571, -0.26688283681869507, -0.45999038219451904, -1.225768804550171, 0.45316392183303833, -0.2743619680404663, -0.8894256949424744, -1.5204359292984009, -0.014478463679552078, -1.2284644842147827, -1.700178861618042, 0.39202582836151123, 1.866668701171875, 2.046553373336792, -0.7556139826774597, 1.4304676055908203, -0.37888485193252563, 0.1361970454454422, 1.1088334321975708, 1.1901559829711914, 3.1746230125427246, 1.8110747337341309, -1.2494288682937622, 0.6528406143188477, -0.19092904031276703, -0.41385430097579956, 1.0320911407470703, -1.0525949001312256, 1.286658763885498, -0.14510837197303772, -1.2518196105957031, -1.1848641633987427, 0.9786937236785889, 0.4541969895362854, 0.011693764477968216, -0.45767366886138916, 1.196347951889038, 0.07058370113372803, 1.3166933059692383, 0.5733560919761658, -0.23069129884243011, 0.6048217415809631, -0.3358432650566101, -0.5610851645469666, 1.578108787536621, 0.09244304895401001, -1.516010046005249, -2.385150671005249, -0.23030968010425568, -0.769721269607544, 0.03032548353075981, -0.7152819633483887, -1.0803176164627075, 1.597025752067566, 0.448322594165802, -1.1198348999023438, -0.2855146527290344, -0.4063042998313904, -0.5512036085128784, 2.572364330291748, -1.4301265478134155, -0.1559273600578308, -0.894390881061554, -0.5670831799507141, 1.5429104566574097, -1.1292115449905396, -0.17576348781585693, -0.9147065281867981, -0.5345257520675659, -1.2178683280944824, -0.47305458784103394, -0.0951375961303711, -0.8596673607826233, 0.6584895253181458, 0.1513640433549881, -1.174769639968872, -0.3137405514717102, -0.938281238079071, 0.8725493550300598, -0.14850464463233948, 0.09741382300853729, 1.8077565431594849, 0.38283294439315796, -0.41325557231903076, 0.7766176462173462, 1.2555192708969116, 0.5743496417999268, -0.6258978843688965, 0.12053227424621582, -0.6668018698692322, 0.33929187059402466, -1.2755458354949951, 0.24463443458080292, -2.8806653022766113, 0.6888142824172974, -0.03288901597261429, -0.02407154068350792, -0.05270882323384285, -1.3704360723495483, 1.092808485031128, 2.5433552265167236, -1.1109243631362915, 0.5743392109870911, 0.3066706657409668, 1.1555125713348389, -1.6225569248199463, 0.24523426592350006, -0.42271775007247925, 2.086714506149292, 0.1811991184949875, 1.2091925144195557, -0.5861096382141113, -2.274890899658203, 0.5205267667770386, -1.1774410009384155, -1.0759023427963257, 0.7434245347976685, -0.8714029788970947, 0.15242740511894226, -1.3274577856063843, -0.21876820921897888, -0.9328242540359497, -1.2258137464523315, 0.6233239769935608, 0.11697512865066528, 0.48112547397613525, -0.5831410884857178, 0.30909955501556396, -2.1978824138641357, -1.3385539054870605, -0.11266707628965378, -1.0063660144805908, 0.5402793288230896, -0.3291982412338257, 0.651964545249939, -0.06818069517612457, -0.005730592645704746, 0.3030042052268982, 1.4427075386047363, 3.276705265045166, 0.12318657338619232, 0.3976227045059204, -0.23422662913799286, -0.9978305697441101, 1.4841142892837524, 0.9451134204864502, -0.1295224130153656, -0.6763790845870972, -1.0064836740493774, 1.281786561012268, 1.9602453708648682, 0.9890650510787964, -0.008124301210045815, -0.8798304200172424, -0.7373848557472229, 0.07053019106388092, 0.14289703965187073, 0.48417598009109497, 1.0962355136871338, 0.018741583451628685, 0.08123920112848282, 1.4780128002166748, 1.1767367124557495, -0.46450620889663696, 0.5319663882255554, -0.8461997509002686, -0.46677958965301514, 0.4140894412994385, 0.3443750739097595, -0.05778073891997337, 0.4159080386161804, -1.0821244716644287, -0.22736774384975433, -0.30781883001327515, -0.945817232131958, -0.7301898002624512, -0.40786463022232056, -0.3439602851867676, 1.6880433559417725, 0.06946543604135513, -0.4034876227378845, 0.08168800175189972, -0.768012285232544, -0.15964318811893463, -0.9762521982192993, 0.3480186462402344, -0.18476983904838562, 0.008509643375873566, -0.07041382789611816, 1.7471036911010742, -0.882182776927948, -2.150130271911621, 0.19825994968414307, 0.20502057671546936, -0.3842562437057495, 0.07092898339033127, 1.7439554929733276, 0.6422119140625, 1.3915733098983765, 1.3866018056869507, 0.936050534248352, -0.6666607856750488, -1.3515417575836182, 0.7072747945785522, 0.9459221959114075, -1.3226641416549683, 0.8178622126579285, -0.17831511795520782, -0.5664768815040588, 0.7246176600456238, 1.4079443216323853, 0.43097424507141113, -2.0605146884918213, 0.8952634930610657, -0.9375656247138977, 0.8174062967300415, 0.6445297598838806, 0.7217346429824829, 0.20173507928848267, 0.9158182740211487, -1.3458102941513062, -1.0665650367736816, -0.7206498384475708, -0.6773415803909302, 1.9111865758895874, -0.21453729271888733, 0.4615458846092224, -0.22977527976036072, -1.289912223815918, -0.08346372842788696, 0.6194530129432678, 0.35599565505981445, -0.3297085762023926, 0.7578083872795105, -0.7273268699645996, -1.1553692817687988, -1.4544721841812134, -0.47425252199172974, -0.8848044872283936, -0.8381629586219788, 0.9261356592178345, 0.6973838210105896, 0.40757519006729126, 1.9882184267044067, 0.5869346261024475, 0.08994544297456741, -2.6393983364105225, 0.8924387097358704, 0.32472699880599976, -0.023323988541960716, 0.9701479077339172, 0.31446373462677, 1.0867265462875366, 0.0250452421605587, 0.5418594479560852, -2.3640944957733154, 2.2570812702178955, -0.30133116245269775, 0.7910810112953186, 0.040729474276304245, -0.14511071145534515, 1.0766386985778809, 0.5448147058486938, 0.6102274656295776, -1.1854764223098755, 0.7557528614997864, -0.6650062203407288, 1.1776843070983887, 0.8950318694114685, -0.8007914423942566, 0.029667671769857407, 1.2736313343048096, 0.3716288208961487, -0.4783859848976135, -0.9801798462867737, -0.9002384543418884, 0.9177537560462952, 1.8068805932998657, -0.022196531295776367, 0.13889586925506592, 0.7759965658187866, 0.693808376789093, -1.3809823989868164, 0.01218397170305252, -0.7295544743537903, -0.7757127285003662, 1.7286442518234253, 2.147390842437744, -0.0439675897359848, -0.2515016794204712, -0.616215705871582, -1.3440932035446167, 0.8407548666000366, 0.01810690201818943, 0.17222462594509125, 0.6425778269767761, -0.7229832410812378, 1.1815892457962036, 0.8218055367469788, 0.9015182852745056, 0.11974816024303436, 0.2518051862716675, 0.3369055986404419, -0.2590635418891907, -1.1470762491226196, -0.33533066511154175, -1.066119909286499, -2.5292744636535645, 0.41362762451171875, -0.23195141553878784, -1.50386381149292, 0.12736164033412933, -1.0316107273101807, 0.7305641770362854, -0.5408836007118225, -1.0818654298782349, -1.4512510299682617, 0.24540086090564728, -0.15330760180950165, 0.8687896132469177, -1.5436147451400757, -0.21093367040157318, 1.21657395362854, 1.0130798816680908, -0.5350453853607178, 1.0091521739959717, 0.27214115858078003, 0.9741173982620239, 0.9009265303611755, -0.4727219343185425, 0.43561530113220215, 0.20048783719539642, -1.2521854639053345, 0.40945619344711304, 1.3402860164642334, 0.21893998980522156, 1.5198988914489746, -0.4742904305458069, 0.03077888861298561, 0.5182032585144043, -0.4412822723388672, -0.47409993410110474, -0.5929572582244873, 0.7152688503265381, -0.011312652379274368, -1.0147002935409546, -0.004337777383625507, -0.1261814683675766, -0.22857031226158142, 0.31399887800216675, -1.4705325365066528, -0.20736348628997803, -0.40797924995422363, -0.5438082218170166, -1.3434752225875854, -0.04762578755617142, 1.2882570028305054, -0.8641154766082764, -0.18246710300445557, 0.5102931261062622, 0.41106587648391724, 0.5897246599197388, 0.6784043312072754, -0.7374738454818726, -0.3988063335418701, -0.24074581265449524, -0.42600440979003906, 0.28996098041534424, 1.2463197708129883, -0.14792639017105103, -0.9927289485931396, 0.5846081972122192, -0.38285231590270996, 0.12162086367607117, 1.9097967147827148, 0.046871598809957504, -0.8304608464241028, 0.3444766402244568, -0.6726041436195374, 1.8961596488952637, 1.591556191444397, 1.3901026248931885, -0.14805766940116882, -0.8877525329589844, 0.6326211094856262, -0.19873909652233124, -0.3214385509490967, 0.9232119917869568, 0.4119076728820801, -0.21312540769577026, -1.4565744400024414, 0.5649880766868591, 1.2300604581832886, -0.8573389053344727, -0.6851440668106079, 0.035687871277332306, -0.8323953747749329, 1.2243674993515015, 0.7437790632247925, 0.3465862274169922, 0.30324065685272217, 1.7004176378250122, 0.6875566244125366, -0.54200679063797, 0.4845591187477112, 0.45299309492111206, -0.262199342250824, -2.161442756652832, -1.0224521160125732, 0.2258133739233017, -0.3767179250717163, -1.5722070932388306, 1.3269109725952148, -1.1298502683639526, -1.0013540983200073, 0.5140959024429321, 0.06446372717618942, 1.3479543924331665, 0.25839030742645264, 1.7053765058517456, 2.0574562549591064, 1.0007497072219849, 0.34499502182006836, 1.218819499015808, -0.17795708775520325, -0.39741432666778564, 1.7910997867584229, -0.39863526821136475, 0.5490545034408569, 1.041077733039856, -0.43326878547668457, -1.103049635887146, -0.815913736820221, -1.1717743873596191, -0.7470393776893616, 1.0961414575576782, 0.15248750150203705, -1.197463035583496, 0.19466248154640198, 1.5752017498016357, 0.16401441395282745, -0.2766156792640686, 0.6999792456626892, 0.5139482617378235, -0.6442142724990845, -0.13897308707237244, -0.9945457577705383, 0.48702168464660645, -0.2313745766878128, -0.4294159412384033, 0.19391991198062897, 0.5363492965698242, 1.1793463230133057, 0.020620353519916534, -0.00639145914465189, 1.2764976024627686, -1.3894010782241821, 1.3414905071258545, -0.7485976219177246, 0.3104977011680603, -2.3143513202667236, 1.445918321609497, -0.7931972146034241, 1.9710097312927246, -2.636326551437378, 0.5010573267936707, -0.6270037889480591, -0.478582501411438, 0.3175066113471985, -0.2808259129524231, 0.17162807285785675, -0.11360429972410202, -1.0232741832733154, -0.22626815736293793, -0.8353541493415833, 0.5018036365509033, 1.198561191558838, 1.330156922340393, -0.954810619354248, -0.16008126735687256, -1.6424556970596313, -0.18742293119430542, -0.6042828559875488, 0.19664612412452698, -1.952100396156311, -0.18916504085063934, -2.058799982070923, -2.343496084213257, -1.4317541122436523, -0.8765798807144165, 1.1327062845230103, 0.21518486738204956, -0.8952102065086365, 1.1562846899032593, -0.40064334869384766, -1.7257144451141357, 1.1575102806091309, -2.1827051639556885 ]
https://github.com/huggingface/datasets/issues/3668
Couldn't cast array of type string error with cast_column
Hi @R4ZZ3, If it is not too much of a bother, can you please help me how to resolve this error? I am exactly getting the same error where I am going as per the documentation guideline: `my_audio_dataset = my_audio_dataset.cast_column("audio_paths", Audio())` where `"audio_paths"` is a dataset column (feature) having strings of absolute paths to mp3 files of the dataset.
## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## 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: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png)
971
59
Couldn't cast array of type string error with cast_column ## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## 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: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png) Hi @R4ZZ3, If it is not too much of a bother, can you please help me how to resolve this error? I am exactly getting the same error where I am going as per the documentation guideline: `my_audio_dataset = my_audio_dataset.cast_column("audio_paths", Audio())` where `"audio_paths"` is a dataset column (feature) having strings of absolute paths to mp3 files of the dataset.
[ -1.253899097442627, -0.7385124564170837, -0.7103964686393738, 1.345011591911316, -0.045501478016376495, -1.2987394332885742, 0.09456437826156616, -1.02891206741333, 1.6527752876281738, -0.7013452053070068, 0.2824831008911133, -1.5934077501296997, 0.0644301250576973, -0.5723004341125488, -0.7946640253067017, -0.8037755489349365, -0.3209434747695923, -0.822878360748291, 1.130953073501587, 2.578375816345215, 1.208672285079956, -1.4203921556472778, 2.873389959335327, 0.6720002293586731, -0.2668260335922241, -0.894591212272644, 0.5048167109489441, 0.10595222562551498, -1.3898006677627563, -0.3990652561187744, -0.9286364912986755, -0.05907999724149704, -0.5346329808235168, -0.5343493819236755, 0.06250478327274323, 0.32644039392471313, -0.19490960240364075, -0.3823835253715515, -0.4842466115951538, -0.6865054368972778, 0.4830678701400757, -0.34701669216156006, 0.8881429433822632, -0.254680335521698, 1.7484900951385498, -0.576714813709259, 0.36893200874328613, 0.6281339526176453, 1.367667555809021, 0.16445861756801605, -0.08211500197649002, 0.4098542332649231, 0.31570005416870117, -0.049332745373249054, 0.479733943939209, 1.2703384160995483, 0.7510656118392944, 0.47493892908096313, 0.7367919087409973, -2.176844835281372, 1.3304862976074219, -0.8762626051902771, 0.2207457274198532, 1.3984036445617676, -1.0584769248962402, 0.41264718770980835, -1.8688620328903198, -0.06775979697704315, 0.43478089570999146, -2.325326681137085, 0.19814592599868774, -1.3086004257202148, -0.5541176795959473, 0.9643503427505493, 0.22836388647556305, -1.3105064630508423, 0.14912374317646027, -0.5151437520980835, 1.0428214073181152, 0.3695855140686035, 1.2799034118652344, -1.7525960206985474, -0.10532283782958984, -0.23036573827266693, 0.15533007681369781, -1.1993355751037598, -1.5832710266113281, 0.5560126900672913, 0.6563679575920105, 0.6049669981002808, -0.10818000137805939, 0.9060983061790466, -1.0188333988189697, 0.8490869402885437, -0.9338655471801758, -1.683516263961792, -1.3941764831542969, -2.2738397121429443, -2.2189888954162598, 0.8144130110740662, -0.44634389877319336, -0.4174796938896179, 2.0702059268951416, -1.0841201543807983, -1.7183194160461426, 1.0246096849441528, 0.3093719482421875, -0.07422810047864914, 2.4587020874023438, 0.26936328411102295, -0.7995479702949524, 0.5888776183128357, -0.7675445675849915, 0.8235218524932861, -0.34912675619125366, 1.3601956367492676, 0.4528312683105469, -0.9984708428382874, 1.5432106256484985, -0.46897029876708984, 0.5374763607978821, -0.6768918633460999, -0.45959627628326416, -0.7896268367767334, 0.31978631019592285, 1.9871768951416016, -0.2488383799791336, 1.6306856870651245, -0.3584309220314026, -1.5719236135482788, -1.4525552988052368, 0.762039303779602, 0.6399025917053223, -0.8793768286705017, 0.08793583512306213, -0.42304056882858276, 0.07046457380056381, 0.08236683160066605, 1.0508122444152832, 1.3019517660140991, 0.7340950965881348, -0.27811557054519653, -0.9597434401512146, 0.14691497385501862, -0.08215250819921494, -0.7024634480476379, -1.8246889114379883, -0.28471839427948, 0.17036278545856476, 0.6506552696228027, -1.3755019903182983, 1.662964105606079, 0.8777323365211487, 1.9668381214141846, 1.0661165714263916, -0.4281999468803406, 1.5564632415771484, 0.10421131551265717, 1.8878967761993408, -0.4991322159767151, 0.7143121957778931, -0.4185146689414978, -1.2019766569137573, 0.7295923829078674, -0.33755987882614136, -2.0656590461730957, -0.6465029120445251, -0.7321816086769104, -0.14512299001216888, -0.8379071354866028, 0.9147136211395264, -0.3107298016548157, -1.4070593118667603, 0.2870526909828186, -0.6975364685058594, 0.17267680168151855, -1.3112250566482544, 0.273506224155426, 0.7671605944633484, -0.601661741733551, 0.0043122051283717155, -0.2782852053642273, -1.325129508972168, -0.468197226524353, 0.3063892126083374, 1.779016375541687, -0.6922687292098999, 0.9686651825904846, 1.062276005744934, -0.5540545582771301, 0.012286247685551643, 0.38664668798446655, -0.3568512797355652, 0.9041824340820312, -1.1138876676559448, -0.373557448387146, 1.1069231033325195, -0.1465345174074173, -0.41218411922454834, 1.3654766082763672, 0.750537097454071, -0.9986882209777832, -0.24941852688789368, -0.07094530761241913, -0.848933219909668, -0.027249636128544807, -1.64288330078125, -0.16960930824279785, 0.3093307614326477, -1.4759091138839722, -0.45986026525497437, -0.18388433754444122, 1.3562403917312622, -0.18523092567920685, 1.4304865598678589, -0.3236844539642334, -0.12415920943021774, -0.4555776119232178, -0.4144425392150879, 0.15143394470214844, -0.20290601253509521, -0.6871157288551331, 0.2766599655151367, -0.7372748851776123, 0.25433218479156494, 1.486425757408142, 0.41011613607406616, 0.09377648681402206, 0.4796924591064453, 1.1392598152160645, 0.2831560969352722, -0.10464268922805786, -0.8294459581375122, -1.6681798696517944, 2.081200122833252, -1.5141313076019287, 1.9950685501098633, 0.9099112749099731, -0.023661445826292038, -1.7989883422851562, -1.845973014831543, 1.419487476348877, 1.106842279434204, 2.474480628967285, 0.48291850090026855, 0.4640706181526184, -0.7354654669761658, -0.6551657319068909, 0.3883383274078369, -0.920849621295929, -0.8181432485580444, 0.12695305049419403, 2.3565659523010254, 1.6790809631347656, -0.43934929370880127, -0.21104276180267334, -1.0246764421463013, 1.3846372365951538, -0.1865229457616806, 0.18115830421447754, 1.9026850461959839, -0.2190055400133133, -1.1364820003509521, 1.2729899883270264, -2.263376235961914, 0.24898777902126312, 2.0218141078948975, 0.332984983921051, -0.046663008630275726, -1.3756747245788574, -0.658129870891571, -0.26688283681869507, -0.45999038219451904, -1.225768804550171, 0.45316392183303833, -0.2743619680404663, -0.8894256949424744, -1.5204359292984009, -0.014478463679552078, -1.2284644842147827, -1.700178861618042, 0.39202582836151123, 1.866668701171875, 2.046553373336792, -0.7556139826774597, 1.4304676055908203, -0.37888485193252563, 0.1361970454454422, 1.1088334321975708, 1.1901559829711914, 3.1746230125427246, 1.8110747337341309, -1.2494288682937622, 0.6528406143188477, -0.19092904031276703, -0.41385430097579956, 1.0320911407470703, -1.0525949001312256, 1.286658763885498, -0.14510837197303772, -1.2518196105957031, -1.1848641633987427, 0.9786937236785889, 0.4541969895362854, 0.011693764477968216, -0.45767366886138916, 1.196347951889038, 0.07058370113372803, 1.3166933059692383, 0.5733560919761658, -0.23069129884243011, 0.6048217415809631, -0.3358432650566101, -0.5610851645469666, 1.578108787536621, 0.09244304895401001, -1.516010046005249, -2.385150671005249, -0.23030968010425568, -0.769721269607544, 0.03032548353075981, -0.7152819633483887, -1.0803176164627075, 1.597025752067566, 0.448322594165802, -1.1198348999023438, -0.2855146527290344, -0.4063042998313904, -0.5512036085128784, 2.572364330291748, -1.4301265478134155, -0.1559273600578308, -0.894390881061554, -0.5670831799507141, 1.5429104566574097, -1.1292115449905396, -0.17576348781585693, -0.9147065281867981, -0.5345257520675659, -1.2178683280944824, -0.47305458784103394, -0.0951375961303711, -0.8596673607826233, 0.6584895253181458, 0.1513640433549881, -1.174769639968872, -0.3137405514717102, -0.938281238079071, 0.8725493550300598, -0.14850464463233948, 0.09741382300853729, 1.8077565431594849, 0.38283294439315796, -0.41325557231903076, 0.7766176462173462, 1.2555192708969116, 0.5743496417999268, -0.6258978843688965, 0.12053227424621582, -0.6668018698692322, 0.33929187059402466, -1.2755458354949951, 0.24463443458080292, -2.8806653022766113, 0.6888142824172974, -0.03288901597261429, -0.02407154068350792, -0.05270882323384285, -1.3704360723495483, 1.092808485031128, 2.5433552265167236, -1.1109243631362915, 0.5743392109870911, 0.3066706657409668, 1.1555125713348389, -1.6225569248199463, 0.24523426592350006, -0.42271775007247925, 2.086714506149292, 0.1811991184949875, 1.2091925144195557, -0.5861096382141113, -2.274890899658203, 0.5205267667770386, -1.1774410009384155, -1.0759023427963257, 0.7434245347976685, -0.8714029788970947, 0.15242740511894226, -1.3274577856063843, -0.21876820921897888, -0.9328242540359497, -1.2258137464523315, 0.6233239769935608, 0.11697512865066528, 0.48112547397613525, -0.5831410884857178, 0.30909955501556396, -2.1978824138641357, -1.3385539054870605, -0.11266707628965378, -1.0063660144805908, 0.5402793288230896, -0.3291982412338257, 0.651964545249939, -0.06818069517612457, -0.005730592645704746, 0.3030042052268982, 1.4427075386047363, 3.276705265045166, 0.12318657338619232, 0.3976227045059204, -0.23422662913799286, -0.9978305697441101, 1.4841142892837524, 0.9451134204864502, -0.1295224130153656, -0.6763790845870972, -1.0064836740493774, 1.281786561012268, 1.9602453708648682, 0.9890650510787964, -0.008124301210045815, -0.8798304200172424, -0.7373848557472229, 0.07053019106388092, 0.14289703965187073, 0.48417598009109497, 1.0962355136871338, 0.018741583451628685, 0.08123920112848282, 1.4780128002166748, 1.1767367124557495, -0.46450620889663696, 0.5319663882255554, -0.8461997509002686, -0.46677958965301514, 0.4140894412994385, 0.3443750739097595, -0.05778073891997337, 0.4159080386161804, -1.0821244716644287, -0.22736774384975433, -0.30781883001327515, -0.945817232131958, -0.7301898002624512, -0.40786463022232056, -0.3439602851867676, 1.6880433559417725, 0.06946543604135513, -0.4034876227378845, 0.08168800175189972, -0.768012285232544, -0.15964318811893463, -0.9762521982192993, 0.3480186462402344, -0.18476983904838562, 0.008509643375873566, -0.07041382789611816, 1.7471036911010742, -0.882182776927948, -2.150130271911621, 0.19825994968414307, 0.20502057671546936, -0.3842562437057495, 0.07092898339033127, 1.7439554929733276, 0.6422119140625, 1.3915733098983765, 1.3866018056869507, 0.936050534248352, -0.6666607856750488, -1.3515417575836182, 0.7072747945785522, 0.9459221959114075, -1.3226641416549683, 0.8178622126579285, -0.17831511795520782, -0.5664768815040588, 0.7246176600456238, 1.4079443216323853, 0.43097424507141113, -2.0605146884918213, 0.8952634930610657, -0.9375656247138977, 0.8174062967300415, 0.6445297598838806, 0.7217346429824829, 0.20173507928848267, 0.9158182740211487, -1.3458102941513062, -1.0665650367736816, -0.7206498384475708, -0.6773415803909302, 1.9111865758895874, -0.21453729271888733, 0.4615458846092224, -0.22977527976036072, -1.289912223815918, -0.08346372842788696, 0.6194530129432678, 0.35599565505981445, -0.3297085762023926, 0.7578083872795105, -0.7273268699645996, -1.1553692817687988, -1.4544721841812134, -0.47425252199172974, -0.8848044872283936, -0.8381629586219788, 0.9261356592178345, 0.6973838210105896, 0.40757519006729126, 1.9882184267044067, 0.5869346261024475, 0.08994544297456741, -2.6393983364105225, 0.8924387097358704, 0.32472699880599976, -0.023323988541960716, 0.9701479077339172, 0.31446373462677, 1.0867265462875366, 0.0250452421605587, 0.5418594479560852, -2.3640944957733154, 2.2570812702178955, -0.30133116245269775, 0.7910810112953186, 0.040729474276304245, -0.14511071145534515, 1.0766386985778809, 0.5448147058486938, 0.6102274656295776, -1.1854764223098755, 0.7557528614997864, -0.6650062203407288, 1.1776843070983887, 0.8950318694114685, -0.8007914423942566, 0.029667671769857407, 1.2736313343048096, 0.3716288208961487, -0.4783859848976135, -0.9801798462867737, -0.9002384543418884, 0.9177537560462952, 1.8068805932998657, -0.022196531295776367, 0.13889586925506592, 0.7759965658187866, 0.693808376789093, -1.3809823989868164, 0.01218397170305252, -0.7295544743537903, -0.7757127285003662, 1.7286442518234253, 2.147390842437744, -0.0439675897359848, -0.2515016794204712, -0.616215705871582, -1.3440932035446167, 0.8407548666000366, 0.01810690201818943, 0.17222462594509125, 0.6425778269767761, -0.7229832410812378, 1.1815892457962036, 0.8218055367469788, 0.9015182852745056, 0.11974816024303436, 0.2518051862716675, 0.3369055986404419, -0.2590635418891907, -1.1470762491226196, -0.33533066511154175, -1.066119909286499, -2.5292744636535645, 0.41362762451171875, -0.23195141553878784, -1.50386381149292, 0.12736164033412933, -1.0316107273101807, 0.7305641770362854, -0.5408836007118225, -1.0818654298782349, -1.4512510299682617, 0.24540086090564728, -0.15330760180950165, 0.8687896132469177, -1.5436147451400757, -0.21093367040157318, 1.21657395362854, 1.0130798816680908, -0.5350453853607178, 1.0091521739959717, 0.27214115858078003, 0.9741173982620239, 0.9009265303611755, -0.4727219343185425, 0.43561530113220215, 0.20048783719539642, -1.2521854639053345, 0.40945619344711304, 1.3402860164642334, 0.21893998980522156, 1.5198988914489746, -0.4742904305458069, 0.03077888861298561, 0.5182032585144043, -0.4412822723388672, -0.47409993410110474, -0.5929572582244873, 0.7152688503265381, -0.011312652379274368, -1.0147002935409546, -0.004337777383625507, -0.1261814683675766, -0.22857031226158142, 0.31399887800216675, -1.4705325365066528, -0.20736348628997803, -0.40797924995422363, -0.5438082218170166, -1.3434752225875854, -0.04762578755617142, 1.2882570028305054, -0.8641154766082764, -0.18246710300445557, 0.5102931261062622, 0.41106587648391724, 0.5897246599197388, 0.6784043312072754, -0.7374738454818726, -0.3988063335418701, -0.24074581265449524, -0.42600440979003906, 0.28996098041534424, 1.2463197708129883, -0.14792639017105103, -0.9927289485931396, 0.5846081972122192, -0.38285231590270996, 0.12162086367607117, 1.9097967147827148, 0.046871598809957504, -0.8304608464241028, 0.3444766402244568, -0.6726041436195374, 1.8961596488952637, 1.591556191444397, 1.3901026248931885, -0.14805766940116882, -0.8877525329589844, 0.6326211094856262, -0.19873909652233124, -0.3214385509490967, 0.9232119917869568, 0.4119076728820801, -0.21312540769577026, -1.4565744400024414, 0.5649880766868591, 1.2300604581832886, -0.8573389053344727, -0.6851440668106079, 0.035687871277332306, -0.8323953747749329, 1.2243674993515015, 0.7437790632247925, 0.3465862274169922, 0.30324065685272217, 1.7004176378250122, 0.6875566244125366, -0.54200679063797, 0.4845591187477112, 0.45299309492111206, -0.262199342250824, -2.161442756652832, -1.0224521160125732, 0.2258133739233017, -0.3767179250717163, -1.5722070932388306, 1.3269109725952148, -1.1298502683639526, -1.0013540983200073, 0.5140959024429321, 0.06446372717618942, 1.3479543924331665, 0.25839030742645264, 1.7053765058517456, 2.0574562549591064, 1.0007497072219849, 0.34499502182006836, 1.218819499015808, -0.17795708775520325, -0.39741432666778564, 1.7910997867584229, -0.39863526821136475, 0.5490545034408569, 1.041077733039856, -0.43326878547668457, -1.103049635887146, -0.815913736820221, -1.1717743873596191, -0.7470393776893616, 1.0961414575576782, 0.15248750150203705, -1.197463035583496, 0.19466248154640198, 1.5752017498016357, 0.16401441395282745, -0.2766156792640686, 0.6999792456626892, 0.5139482617378235, -0.6442142724990845, -0.13897308707237244, -0.9945457577705383, 0.48702168464660645, -0.2313745766878128, -0.4294159412384033, 0.19391991198062897, 0.5363492965698242, 1.1793463230133057, 0.020620353519916534, -0.00639145914465189, 1.2764976024627686, -1.3894010782241821, 1.3414905071258545, -0.7485976219177246, 0.3104977011680603, -2.3143513202667236, 1.445918321609497, -0.7931972146034241, 1.9710097312927246, -2.636326551437378, 0.5010573267936707, -0.6270037889480591, -0.478582501411438, 0.3175066113471985, -0.2808259129524231, 0.17162807285785675, -0.11360429972410202, -1.0232741832733154, -0.22626815736293793, -0.8353541493415833, 0.5018036365509033, 1.198561191558838, 1.330156922340393, -0.954810619354248, -0.16008126735687256, -1.6424556970596313, -0.18742293119430542, -0.6042828559875488, 0.19664612412452698, -1.952100396156311, -0.18916504085063934, -2.058799982070923, -2.343496084213257, -1.4317541122436523, -0.8765798807144165, 1.1327062845230103, 0.21518486738204956, -0.8952102065086365, 1.1562846899032593, -0.40064334869384766, -1.7257144451141357, 1.1575102806091309, -2.1827051639556885 ]
https://github.com/huggingface/datasets/issues/3668
Couldn't cast array of type string error with cast_column
I was having the same issue with this code: ``` dataset = dataset.map( lambda batch: {"full_path" : os.path.join(self.data_path, batch["path"])}, num_procs = 4 ) my_audio_dataset = dataset.cast_column("full_path", Audio(sampling_rate=16_000)) ``` Removing the "num_procs" argument fixed it somehow. Using a mac with m1 chip
## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## 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: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png)
971
41
Couldn't cast array of type string error with cast_column ## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## 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: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png) I was having the same issue with this code: ``` dataset = dataset.map( lambda batch: {"full_path" : os.path.join(self.data_path, batch["path"])}, num_procs = 4 ) my_audio_dataset = dataset.cast_column("full_path", Audio(sampling_rate=16_000)) ``` Removing the "num_procs" argument fixed it somehow. Using a mac with m1 chip
[ -1.253899097442627, -0.7385124564170837, -0.7103964686393738, 1.345011591911316, -0.045501478016376495, -1.2987394332885742, 0.09456437826156616, -1.02891206741333, 1.6527752876281738, -0.7013452053070068, 0.2824831008911133, -1.5934077501296997, 0.0644301250576973, -0.5723004341125488, -0.7946640253067017, -0.8037755489349365, -0.3209434747695923, -0.822878360748291, 1.130953073501587, 2.578375816345215, 1.208672285079956, -1.4203921556472778, 2.873389959335327, 0.6720002293586731, -0.2668260335922241, -0.894591212272644, 0.5048167109489441, 0.10595222562551498, -1.3898006677627563, -0.3990652561187744, -0.9286364912986755, -0.05907999724149704, -0.5346329808235168, -0.5343493819236755, 0.06250478327274323, 0.32644039392471313, -0.19490960240364075, -0.3823835253715515, -0.4842466115951538, -0.6865054368972778, 0.4830678701400757, -0.34701669216156006, 0.8881429433822632, -0.254680335521698, 1.7484900951385498, -0.576714813709259, 0.36893200874328613, 0.6281339526176453, 1.367667555809021, 0.16445861756801605, -0.08211500197649002, 0.4098542332649231, 0.31570005416870117, -0.049332745373249054, 0.479733943939209, 1.2703384160995483, 0.7510656118392944, 0.47493892908096313, 0.7367919087409973, -2.176844835281372, 1.3304862976074219, -0.8762626051902771, 0.2207457274198532, 1.3984036445617676, -1.0584769248962402, 0.41264718770980835, -1.8688620328903198, -0.06775979697704315, 0.43478089570999146, -2.325326681137085, 0.19814592599868774, -1.3086004257202148, -0.5541176795959473, 0.9643503427505493, 0.22836388647556305, -1.3105064630508423, 0.14912374317646027, -0.5151437520980835, 1.0428214073181152, 0.3695855140686035, 1.2799034118652344, -1.7525960206985474, -0.10532283782958984, -0.23036573827266693, 0.15533007681369781, -1.1993355751037598, -1.5832710266113281, 0.5560126900672913, 0.6563679575920105, 0.6049669981002808, -0.10818000137805939, 0.9060983061790466, -1.0188333988189697, 0.8490869402885437, -0.9338655471801758, -1.683516263961792, -1.3941764831542969, -2.2738397121429443, -2.2189888954162598, 0.8144130110740662, -0.44634389877319336, -0.4174796938896179, 2.0702059268951416, -1.0841201543807983, -1.7183194160461426, 1.0246096849441528, 0.3093719482421875, -0.07422810047864914, 2.4587020874023438, 0.26936328411102295, -0.7995479702949524, 0.5888776183128357, -0.7675445675849915, 0.8235218524932861, -0.34912675619125366, 1.3601956367492676, 0.4528312683105469, -0.9984708428382874, 1.5432106256484985, -0.46897029876708984, 0.5374763607978821, -0.6768918633460999, -0.45959627628326416, -0.7896268367767334, 0.31978631019592285, 1.9871768951416016, -0.2488383799791336, 1.6306856870651245, -0.3584309220314026, -1.5719236135482788, -1.4525552988052368, 0.762039303779602, 0.6399025917053223, -0.8793768286705017, 0.08793583512306213, -0.42304056882858276, 0.07046457380056381, 0.08236683160066605, 1.0508122444152832, 1.3019517660140991, 0.7340950965881348, -0.27811557054519653, -0.9597434401512146, 0.14691497385501862, -0.08215250819921494, -0.7024634480476379, -1.8246889114379883, -0.28471839427948, 0.17036278545856476, 0.6506552696228027, -1.3755019903182983, 1.662964105606079, 0.8777323365211487, 1.9668381214141846, 1.0661165714263916, -0.4281999468803406, 1.5564632415771484, 0.10421131551265717, 1.8878967761993408, -0.4991322159767151, 0.7143121957778931, -0.4185146689414978, -1.2019766569137573, 0.7295923829078674, -0.33755987882614136, -2.0656590461730957, -0.6465029120445251, -0.7321816086769104, -0.14512299001216888, -0.8379071354866028, 0.9147136211395264, -0.3107298016548157, -1.4070593118667603, 0.2870526909828186, -0.6975364685058594, 0.17267680168151855, -1.3112250566482544, 0.273506224155426, 0.7671605944633484, -0.601661741733551, 0.0043122051283717155, -0.2782852053642273, -1.325129508972168, -0.468197226524353, 0.3063892126083374, 1.779016375541687, -0.6922687292098999, 0.9686651825904846, 1.062276005744934, -0.5540545582771301, 0.012286247685551643, 0.38664668798446655, -0.3568512797355652, 0.9041824340820312, -1.1138876676559448, -0.373557448387146, 1.1069231033325195, -0.1465345174074173, -0.41218411922454834, 1.3654766082763672, 0.750537097454071, -0.9986882209777832, -0.24941852688789368, -0.07094530761241913, -0.848933219909668, -0.027249636128544807, -1.64288330078125, -0.16960930824279785, 0.3093307614326477, -1.4759091138839722, -0.45986026525497437, -0.18388433754444122, 1.3562403917312622, -0.18523092567920685, 1.4304865598678589, -0.3236844539642334, -0.12415920943021774, -0.4555776119232178, -0.4144425392150879, 0.15143394470214844, -0.20290601253509521, -0.6871157288551331, 0.2766599655151367, -0.7372748851776123, 0.25433218479156494, 1.486425757408142, 0.41011613607406616, 0.09377648681402206, 0.4796924591064453, 1.1392598152160645, 0.2831560969352722, -0.10464268922805786, -0.8294459581375122, -1.6681798696517944, 2.081200122833252, -1.5141313076019287, 1.9950685501098633, 0.9099112749099731, -0.023661445826292038, -1.7989883422851562, -1.845973014831543, 1.419487476348877, 1.106842279434204, 2.474480628967285, 0.48291850090026855, 0.4640706181526184, -0.7354654669761658, -0.6551657319068909, 0.3883383274078369, -0.920849621295929, -0.8181432485580444, 0.12695305049419403, 2.3565659523010254, 1.6790809631347656, -0.43934929370880127, -0.21104276180267334, -1.0246764421463013, 1.3846372365951538, -0.1865229457616806, 0.18115830421447754, 1.9026850461959839, -0.2190055400133133, -1.1364820003509521, 1.2729899883270264, -2.263376235961914, 0.24898777902126312, 2.0218141078948975, 0.332984983921051, -0.046663008630275726, -1.3756747245788574, -0.658129870891571, -0.26688283681869507, -0.45999038219451904, -1.225768804550171, 0.45316392183303833, -0.2743619680404663, -0.8894256949424744, -1.5204359292984009, -0.014478463679552078, -1.2284644842147827, -1.700178861618042, 0.39202582836151123, 1.866668701171875, 2.046553373336792, -0.7556139826774597, 1.4304676055908203, -0.37888485193252563, 0.1361970454454422, 1.1088334321975708, 1.1901559829711914, 3.1746230125427246, 1.8110747337341309, -1.2494288682937622, 0.6528406143188477, -0.19092904031276703, -0.41385430097579956, 1.0320911407470703, -1.0525949001312256, 1.286658763885498, -0.14510837197303772, -1.2518196105957031, -1.1848641633987427, 0.9786937236785889, 0.4541969895362854, 0.011693764477968216, -0.45767366886138916, 1.196347951889038, 0.07058370113372803, 1.3166933059692383, 0.5733560919761658, -0.23069129884243011, 0.6048217415809631, -0.3358432650566101, -0.5610851645469666, 1.578108787536621, 0.09244304895401001, -1.516010046005249, -2.385150671005249, -0.23030968010425568, -0.769721269607544, 0.03032548353075981, -0.7152819633483887, -1.0803176164627075, 1.597025752067566, 0.448322594165802, -1.1198348999023438, -0.2855146527290344, -0.4063042998313904, -0.5512036085128784, 2.572364330291748, -1.4301265478134155, -0.1559273600578308, -0.894390881061554, -0.5670831799507141, 1.5429104566574097, -1.1292115449905396, -0.17576348781585693, -0.9147065281867981, -0.5345257520675659, -1.2178683280944824, -0.47305458784103394, -0.0951375961303711, -0.8596673607826233, 0.6584895253181458, 0.1513640433549881, -1.174769639968872, -0.3137405514717102, -0.938281238079071, 0.8725493550300598, -0.14850464463233948, 0.09741382300853729, 1.8077565431594849, 0.38283294439315796, -0.41325557231903076, 0.7766176462173462, 1.2555192708969116, 0.5743496417999268, -0.6258978843688965, 0.12053227424621582, -0.6668018698692322, 0.33929187059402466, -1.2755458354949951, 0.24463443458080292, -2.8806653022766113, 0.6888142824172974, -0.03288901597261429, -0.02407154068350792, -0.05270882323384285, -1.3704360723495483, 1.092808485031128, 2.5433552265167236, -1.1109243631362915, 0.5743392109870911, 0.3066706657409668, 1.1555125713348389, -1.6225569248199463, 0.24523426592350006, -0.42271775007247925, 2.086714506149292, 0.1811991184949875, 1.2091925144195557, -0.5861096382141113, -2.274890899658203, 0.5205267667770386, -1.1774410009384155, -1.0759023427963257, 0.7434245347976685, -0.8714029788970947, 0.15242740511894226, -1.3274577856063843, -0.21876820921897888, -0.9328242540359497, -1.2258137464523315, 0.6233239769935608, 0.11697512865066528, 0.48112547397613525, -0.5831410884857178, 0.30909955501556396, -2.1978824138641357, -1.3385539054870605, -0.11266707628965378, -1.0063660144805908, 0.5402793288230896, -0.3291982412338257, 0.651964545249939, -0.06818069517612457, -0.005730592645704746, 0.3030042052268982, 1.4427075386047363, 3.276705265045166, 0.12318657338619232, 0.3976227045059204, -0.23422662913799286, -0.9978305697441101, 1.4841142892837524, 0.9451134204864502, -0.1295224130153656, -0.6763790845870972, -1.0064836740493774, 1.281786561012268, 1.9602453708648682, 0.9890650510787964, -0.008124301210045815, -0.8798304200172424, -0.7373848557472229, 0.07053019106388092, 0.14289703965187073, 0.48417598009109497, 1.0962355136871338, 0.018741583451628685, 0.08123920112848282, 1.4780128002166748, 1.1767367124557495, -0.46450620889663696, 0.5319663882255554, -0.8461997509002686, -0.46677958965301514, 0.4140894412994385, 0.3443750739097595, -0.05778073891997337, 0.4159080386161804, -1.0821244716644287, -0.22736774384975433, -0.30781883001327515, -0.945817232131958, -0.7301898002624512, -0.40786463022232056, -0.3439602851867676, 1.6880433559417725, 0.06946543604135513, -0.4034876227378845, 0.08168800175189972, -0.768012285232544, -0.15964318811893463, -0.9762521982192993, 0.3480186462402344, -0.18476983904838562, 0.008509643375873566, -0.07041382789611816, 1.7471036911010742, -0.882182776927948, -2.150130271911621, 0.19825994968414307, 0.20502057671546936, -0.3842562437057495, 0.07092898339033127, 1.7439554929733276, 0.6422119140625, 1.3915733098983765, 1.3866018056869507, 0.936050534248352, -0.6666607856750488, -1.3515417575836182, 0.7072747945785522, 0.9459221959114075, -1.3226641416549683, 0.8178622126579285, -0.17831511795520782, -0.5664768815040588, 0.7246176600456238, 1.4079443216323853, 0.43097424507141113, -2.0605146884918213, 0.8952634930610657, -0.9375656247138977, 0.8174062967300415, 0.6445297598838806, 0.7217346429824829, 0.20173507928848267, 0.9158182740211487, -1.3458102941513062, -1.0665650367736816, -0.7206498384475708, -0.6773415803909302, 1.9111865758895874, -0.21453729271888733, 0.4615458846092224, -0.22977527976036072, -1.289912223815918, -0.08346372842788696, 0.6194530129432678, 0.35599565505981445, -0.3297085762023926, 0.7578083872795105, -0.7273268699645996, -1.1553692817687988, -1.4544721841812134, -0.47425252199172974, -0.8848044872283936, -0.8381629586219788, 0.9261356592178345, 0.6973838210105896, 0.40757519006729126, 1.9882184267044067, 0.5869346261024475, 0.08994544297456741, -2.6393983364105225, 0.8924387097358704, 0.32472699880599976, -0.023323988541960716, 0.9701479077339172, 0.31446373462677, 1.0867265462875366, 0.0250452421605587, 0.5418594479560852, -2.3640944957733154, 2.2570812702178955, -0.30133116245269775, 0.7910810112953186, 0.040729474276304245, -0.14511071145534515, 1.0766386985778809, 0.5448147058486938, 0.6102274656295776, -1.1854764223098755, 0.7557528614997864, -0.6650062203407288, 1.1776843070983887, 0.8950318694114685, -0.8007914423942566, 0.029667671769857407, 1.2736313343048096, 0.3716288208961487, -0.4783859848976135, -0.9801798462867737, -0.9002384543418884, 0.9177537560462952, 1.8068805932998657, -0.022196531295776367, 0.13889586925506592, 0.7759965658187866, 0.693808376789093, -1.3809823989868164, 0.01218397170305252, -0.7295544743537903, -0.7757127285003662, 1.7286442518234253, 2.147390842437744, -0.0439675897359848, -0.2515016794204712, -0.616215705871582, -1.3440932035446167, 0.8407548666000366, 0.01810690201818943, 0.17222462594509125, 0.6425778269767761, -0.7229832410812378, 1.1815892457962036, 0.8218055367469788, 0.9015182852745056, 0.11974816024303436, 0.2518051862716675, 0.3369055986404419, -0.2590635418891907, -1.1470762491226196, -0.33533066511154175, -1.066119909286499, -2.5292744636535645, 0.41362762451171875, -0.23195141553878784, -1.50386381149292, 0.12736164033412933, -1.0316107273101807, 0.7305641770362854, -0.5408836007118225, -1.0818654298782349, -1.4512510299682617, 0.24540086090564728, -0.15330760180950165, 0.8687896132469177, -1.5436147451400757, -0.21093367040157318, 1.21657395362854, 1.0130798816680908, -0.5350453853607178, 1.0091521739959717, 0.27214115858078003, 0.9741173982620239, 0.9009265303611755, -0.4727219343185425, 0.43561530113220215, 0.20048783719539642, -1.2521854639053345, 0.40945619344711304, 1.3402860164642334, 0.21893998980522156, 1.5198988914489746, -0.4742904305458069, 0.03077888861298561, 0.5182032585144043, -0.4412822723388672, -0.47409993410110474, -0.5929572582244873, 0.7152688503265381, -0.011312652379274368, -1.0147002935409546, -0.004337777383625507, -0.1261814683675766, -0.22857031226158142, 0.31399887800216675, -1.4705325365066528, -0.20736348628997803, -0.40797924995422363, -0.5438082218170166, -1.3434752225875854, -0.04762578755617142, 1.2882570028305054, -0.8641154766082764, -0.18246710300445557, 0.5102931261062622, 0.41106587648391724, 0.5897246599197388, 0.6784043312072754, -0.7374738454818726, -0.3988063335418701, -0.24074581265449524, -0.42600440979003906, 0.28996098041534424, 1.2463197708129883, -0.14792639017105103, -0.9927289485931396, 0.5846081972122192, -0.38285231590270996, 0.12162086367607117, 1.9097967147827148, 0.046871598809957504, -0.8304608464241028, 0.3444766402244568, -0.6726041436195374, 1.8961596488952637, 1.591556191444397, 1.3901026248931885, -0.14805766940116882, -0.8877525329589844, 0.6326211094856262, -0.19873909652233124, -0.3214385509490967, 0.9232119917869568, 0.4119076728820801, -0.21312540769577026, -1.4565744400024414, 0.5649880766868591, 1.2300604581832886, -0.8573389053344727, -0.6851440668106079, 0.035687871277332306, -0.8323953747749329, 1.2243674993515015, 0.7437790632247925, 0.3465862274169922, 0.30324065685272217, 1.7004176378250122, 0.6875566244125366, -0.54200679063797, 0.4845591187477112, 0.45299309492111206, -0.262199342250824, -2.161442756652832, -1.0224521160125732, 0.2258133739233017, -0.3767179250717163, -1.5722070932388306, 1.3269109725952148, -1.1298502683639526, -1.0013540983200073, 0.5140959024429321, 0.06446372717618942, 1.3479543924331665, 0.25839030742645264, 1.7053765058517456, 2.0574562549591064, 1.0007497072219849, 0.34499502182006836, 1.218819499015808, -0.17795708775520325, -0.39741432666778564, 1.7910997867584229, -0.39863526821136475, 0.5490545034408569, 1.041077733039856, -0.43326878547668457, -1.103049635887146, -0.815913736820221, -1.1717743873596191, -0.7470393776893616, 1.0961414575576782, 0.15248750150203705, -1.197463035583496, 0.19466248154640198, 1.5752017498016357, 0.16401441395282745, -0.2766156792640686, 0.6999792456626892, 0.5139482617378235, -0.6442142724990845, -0.13897308707237244, -0.9945457577705383, 0.48702168464660645, -0.2313745766878128, -0.4294159412384033, 0.19391991198062897, 0.5363492965698242, 1.1793463230133057, 0.020620353519916534, -0.00639145914465189, 1.2764976024627686, -1.3894010782241821, 1.3414905071258545, -0.7485976219177246, 0.3104977011680603, -2.3143513202667236, 1.445918321609497, -0.7931972146034241, 1.9710097312927246, -2.636326551437378, 0.5010573267936707, -0.6270037889480591, -0.478582501411438, 0.3175066113471985, -0.2808259129524231, 0.17162807285785675, -0.11360429972410202, -1.0232741832733154, -0.22626815736293793, -0.8353541493415833, 0.5018036365509033, 1.198561191558838, 1.330156922340393, -0.954810619354248, -0.16008126735687256, -1.6424556970596313, -0.18742293119430542, -0.6042828559875488, 0.19664612412452698, -1.952100396156311, -0.18916504085063934, -2.058799982070923, -2.343496084213257, -1.4317541122436523, -0.8765798807144165, 1.1327062845230103, 0.21518486738204956, -0.8952102065086365, 1.1562846899032593, -0.40064334869384766, -1.7257144451141357, 1.1575102806091309, -2.1827051639556885 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Having talked to @lhoestq, I see that this feature is no longer supported. I really don't think this was a good idea. It is a major breaking change and one for which we don't even have a working solution at the moment, which is bad for PyTorch as we don't want to force people to have `datasets` decode audio files automatically, but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files - e.g. `common_voice` doesn't work anymore in a TF training script. Note this worked perfectly fine before making the change (think it was done [here](https://github.com/huggingface/datasets/pull/3290) no?) IMO, it's really important to think about a solution here and I strongly favor to make a difference here between loading a dataset in streaming mode and in non-streaming mode, so that in non-streaming mode the actual downloaded file is displayed. It's really crucial for people to be able to analyse the original files IMO when the dataset is not downloaded in streaming mode. There are the following reasons why it is paramount to have access to the **original** audio file in my opinion (in non-streaming mode): - There are a wide variety of different libraries to load audio data with varying support on different platforms. For me it was quite clear that there is simply to single good library to load audio files for all platforms - so we have to leave the option to the user to decide which loading to use. - We had support for audio datasets a long time before streaming audio was possible. There were quite some versions where we advertised **everywhere** to load the audio from the path name (and there are many places where we still do even though it's not possible anymore). To give some examples: - Official example of TF Wav2Vec2: https://github.com/huggingface/transformers/blob/f427e750490b486944cc9be3c99834ad5cf78b57/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1423 Wav2Vec2 is as important for speech as BERT is for NLP - so it's **very** important. The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment. Same goes for Flax. - The most downloaded non-nlp checkpoint: https://huggingface.co/facebook/wav2vec2-base-960h#usage has a usage example which doesn't work anymore with the current datasets implementation. I'll update this now, but we have >1000 wav2vec2 checkpoints on the Hub and we can't update all the model cards. => This is a big breaking change with no current solution. For `transformers` breaking changes are one of the biggest complaints. - Similar to this we also shouldn't assume that there is only one resampling method for Audio. I think it's good to have one offered automatically by `datasets`, but we have to leave the user the freedom to choose her/his own resampling as well. Resampling can take very different filtering windows and other parameters which are currently somewhat hardcoded in `datasets`, which users might very well want to change. => IMO, it's a **very** big priority to again have the correct absolute path in non-streaming mode. The other solution of providing a path-like object derived from the bytes stocked in the `.array` file is not nearly as user-friendly, but better than nothing.
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
522
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Having talked to @lhoestq, I see that this feature is no longer supported. I really don't think this was a good idea. It is a major breaking change and one for which we don't even have a working solution at the moment, which is bad for PyTorch as we don't want to force people to have `datasets` decode audio files automatically, but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files - e.g. `common_voice` doesn't work anymore in a TF training script. Note this worked perfectly fine before making the change (think it was done [here](https://github.com/huggingface/datasets/pull/3290) no?) IMO, it's really important to think about a solution here and I strongly favor to make a difference here between loading a dataset in streaming mode and in non-streaming mode, so that in non-streaming mode the actual downloaded file is displayed. It's really crucial for people to be able to analyse the original files IMO when the dataset is not downloaded in streaming mode. There are the following reasons why it is paramount to have access to the **original** audio file in my opinion (in non-streaming mode): - There are a wide variety of different libraries to load audio data with varying support on different platforms. For me it was quite clear that there is simply to single good library to load audio files for all platforms - so we have to leave the option to the user to decide which loading to use. - We had support for audio datasets a long time before streaming audio was possible. There were quite some versions where we advertised **everywhere** to load the audio from the path name (and there are many places where we still do even though it's not possible anymore). To give some examples: - Official example of TF Wav2Vec2: https://github.com/huggingface/transformers/blob/f427e750490b486944cc9be3c99834ad5cf78b57/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1423 Wav2Vec2 is as important for speech as BERT is for NLP - so it's **very** important. The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment. Same goes for Flax. - The most downloaded non-nlp checkpoint: https://huggingface.co/facebook/wav2vec2-base-960h#usage has a usage example which doesn't work anymore with the current datasets implementation. I'll update this now, but we have >1000 wav2vec2 checkpoints on the Hub and we can't update all the model cards. => This is a big breaking change with no current solution. For `transformers` breaking changes are one of the biggest complaints. - Similar to this we also shouldn't assume that there is only one resampling method for Audio. I think it's good to have one offered automatically by `datasets`, but we have to leave the user the freedom to choose her/his own resampling as well. Resampling can take very different filtering windows and other parameters which are currently somewhat hardcoded in `datasets`, which users might very well want to change. => IMO, it's a **very** big priority to again have the correct absolute path in non-streaming mode. The other solution of providing a path-like object derived from the bytes stocked in the `.array` file is not nearly as user-friendly, but better than nothing.
[ -1.211350679397583, -0.8331567645072937, -0.7296276688575745, 1.4403501749038696, -0.13547828793525696, -1.237105369567871, 0.14080092310905457, -1.0095335245132446, 1.635348916053772, -0.8398658037185669, 0.3193618655204773, -1.6709586381912231, 0.05961627513170242, -0.6523935794830322, -0.7404515743255615, -0.8257830142974854, -0.3142620921134949, -0.731033980846405, 1.0586210489273071, 2.436636447906494, 1.218363642692566, -1.38729727268219, 2.740729331970215, 0.6889345049858093, -0.30744561553001404, -0.9597908854484558, 0.4614868462085724, -0.02557584084570408, -1.2790074348449707, -0.4435673654079437, -0.9539717435836792, -0.05393432825803757, -0.6180650591850281, -0.4797463119029999, 0.006159042939543724, 0.38020429015159607, -0.3059924244880676, -0.384108304977417, -0.5725716352462769, -0.8041263222694397, 0.43002235889434814, -0.36946192383766174, 0.9884271621704102, -0.26471850275993347, 1.762851357460022, -0.6501340270042419, 0.4669743776321411, 0.7082449793815613, 1.2959555387496948, 0.2320973426103592, 0.023515591397881508, 0.3441596031188965, 0.3729322850704193, -0.015027282759547234, 0.5364197492599487, 1.1331632137298584, 0.6732414960861206, 0.5208756923675537, 0.73274827003479, -2.1938540935516357, 1.3897755146026611, -0.9875673055648804, 0.22516191005706787, 1.318886399269104, -0.96878582239151, 0.3355068266391754, -1.7355446815490723, -0.09143134206533432, 0.5268875360488892, -2.285754680633545, 0.2710956633090973, -1.3386863470077515, -0.5609437227249146, 0.989749014377594, 0.4484667181968689, -1.2447118759155273, 0.10056675970554352, -0.4313424527645111, 0.9427968263626099, 0.42768725752830505, 1.0438345670700073, -1.6375102996826172, -0.061798498034477234, -0.2892320454120636, 0.1483677327632904, -1.2255734205245972, -1.527042031288147, 0.6129999756813049, 0.5734856128692627, 0.6178404688835144, -0.12396888434886932, 1.0461426973342896, -1.079234004020691, 0.8309783935546875, -1.0562005043029785, -1.7352664470672607, -1.3823728561401367, -2.3186099529266357, -2.2899467945098877, 0.815133810043335, -0.47975683212280273, -0.5221419930458069, 2.123440742492676, -1.082228183746338, -1.6815185546875, 1.1280840635299683, 0.23288685083389282, -0.01616930589079857, 2.411910057067871, 0.16128210723400116, -0.754542350769043, 0.5370295643806458, -0.7997130751609802, 0.7882236242294312, -0.41724419593811035, 1.2648159265518188, 0.3938957154750824, -1.0601497888565063, 1.5681341886520386, -0.31980153918266296, 0.5950822830200195, -0.6914958953857422, -0.4863816499710083, -0.7672672867774963, 0.2971856892108917, 1.8569031953811646, -0.23489993810653687, 1.5234333276748657, -0.27208906412124634, -1.5507909059524536, -1.5492382049560547, 0.8588465452194214, 0.4701119363307953, -0.8204861879348755, 0.12442287057638168, -0.3599334955215454, 0.16978271305561066, -0.0068303258158266544, 1.144107699394226, 1.3322540521621704, 0.7391167283058167, -0.3292807638645172, -0.845789909362793, 0.14503541588783264, -0.14535486698150635, -0.7057061791419983, -1.760726809501648, -0.3475320339202881, 0.12350935488939285, 0.6662614941596985, -1.2162683010101318, 1.8204697370529175, 0.8837715983390808, 1.9429551362991333, 1.0235366821289062, -0.4141365885734558, 1.4888564348220825, 0.11065645515918732, 1.8838402032852173, -0.4989795386791229, 0.6107451915740967, -0.45560914278030396, -1.1769061088562012, 0.8506473302841187, -0.3460964858531952, -2.0106217861175537, -0.6953012347221375, -0.7523893713951111, -0.21497221291065216, -0.777590811252594, 0.9603299498558044, -0.2874191403388977, -1.400434970855713, 0.24139805138111115, -0.6884450316429138, 0.09440097957849503, -1.2717922925949097, 0.2758047878742218, 0.6770139932632446, -0.6396052837371826, 0.06366346776485443, -0.30004993081092834, -1.2710883617401123, -0.4909462630748749, 0.3269416391849518, 1.8622504472732544, -0.6639792323112488, 0.9728781580924988, 1.0222949981689453, -0.6525601744651794, -0.02042756974697113, 0.4027456045150757, -0.29612216353416443, 0.8358177542686462, -1.0393043756484985, -0.47158628702163696, 1.1760282516479492, -0.26453596353530884, -0.5648050308227539, 1.4082642793655396, 0.7093917727470398, -1.039900302886963, -0.18101222813129425, -0.12430740892887115, -0.8320263028144836, 0.01010940968990326, -1.6140309572219849, -0.171488955616951, 0.4118902385234833, -1.5641276836395264, -0.3848530948162079, -0.15076319873332977, 1.2375761270523071, -0.15437498688697815, 1.3935450315475464, -0.34408003091812134, -0.1456906795501709, -0.39103153347969055, -0.46672576665878296, 0.09353280812501907, -0.17491690814495087, -0.5877518653869629, 0.2667789161205292, -0.7576279044151306, 0.27507609128952026, 1.4909868240356445, 0.24678246676921844, 0.06297601014375687, 0.42866820096969604, 1.0872948169708252, 0.3419678211212158, -0.06732436269521713, -0.9149805903434753, -1.5286123752593994, 2.0473244190216064, -1.5064449310302734, 2.0115931034088135, 0.8031803369522095, -0.01794014498591423, -1.7787795066833496, -1.8181504011154175, 1.3484348058700562, 1.1106029748916626, 2.3567464351654053, 0.5198888182640076, 0.40061137080192566, -0.7907792925834656, -0.6861141324043274, 0.37723755836486816, -1.009132981300354, -0.6885570287704468, 0.1038103848695755, 2.4669957160949707, 1.6705937385559082, -0.3815571665763855, -0.16954298317432404, -0.9942368865013123, 1.3899598121643066, -0.23086915910243988, 0.23431992530822754, 1.9933907985687256, -0.2996034026145935, -1.0027981996536255, 1.3137649297714233, -2.3180832862854004, 0.22134746611118317, 2.049159049987793, 0.24467529356479645, 0.07936171442270279, -1.3250354528427124, -0.6646518707275391, -0.27411219477653503, -0.447834849357605, -1.297507643699646, 0.5056105852127075, -0.2338133603334427, -0.7880382537841797, -1.3765500783920288, 0.1256176084280014, -1.1481984853744507, -1.6669113636016846, 0.2615240812301636, 1.9080405235290527, 2.106879711151123, -0.7198412418365479, 1.4918115139007568, -0.30530551075935364, 0.10508973896503448, 1.211138367652893, 1.2515722513198853, 3.1775224208831787, 1.8777763843536377, -1.288722276687622, 0.6287647485733032, -0.21985368430614471, -0.4523916244506836, 1.0946506261825562, -1.1167503595352173, 1.245840311050415, -0.1923755556344986, -1.2770745754241943, -1.2434043884277344, 0.972416341304779, 0.39682963490486145, 0.0008256696164608002, -0.5229173898696899, 1.216050148010254, 0.13045567274093628, 1.3029537200927734, 0.5920947194099426, -0.2572624087333679, 0.5647802352905273, -0.39530807733535767, -0.5450093150138855, 1.6459941864013672, 0.20077285170555115, -1.466082215309143, -2.3478569984436035, -0.20761530101299286, -0.9111692905426025, 0.04033944010734558, -0.646185576915741, -1.0299826860427856, 1.6446921825408936, 0.36998334527015686, -1.1741068363189697, -0.22856266796588898, -0.3597230315208435, -0.5505914092063904, 2.756822347640991, -1.4003267288208008, -0.20297913253307343, -0.9981173872947693, -0.63559889793396, 1.6296507120132446, -1.2243746519088745, -0.24460317194461823, -1.007863998413086, -0.5564849972724915, -1.20444917678833, -0.4443403482437134, -0.0026904488913714886, -0.9921323657035828, 0.7797583341598511, 0.18145884573459625, -1.234095573425293, -0.3253384232521057, -0.9249558448791504, 0.8975324034690857, -0.12085128575563431, 0.17112018167972565, 1.8208365440368652, 0.32221096754074097, -0.3900900185108185, 0.7879816889762878, 1.2258999347686768, 0.6355056762695312, -0.6432142853736877, 0.10950644314289093, -0.6531583666801453, 0.374593585729599, -1.239643931388855, 0.29052063822746277, -2.8656835556030273, 0.6323225498199463, -0.09658972918987274, -0.10291142016649246, -0.0866621732711792, -1.2983604669570923, 1.0811079740524292, 2.5665457248687744, -1.0842361450195312, 0.5312219262123108, 0.2891688346862793, 1.1950759887695312, -1.6011275053024292, 0.2550515830516815, -0.5021087527275085, 2.13810658454895, 0.21470391750335693, 1.1771405935287476, -0.4400632083415985, -2.371589422225952, 0.6296291351318359, -1.180261492729187, -1.062781572341919, 0.8030250668525696, -0.8035515546798706, 0.18314510583877563, -1.3500425815582275, -0.22994288802146912, -0.7962296009063721, -1.1922425031661987, 0.6880171895027161, 0.08078617602586746, 0.5376672744750977, -0.5602042078971863, 0.2809270918369293, -2.212580442428589, -1.4046425819396973, -0.16514359414577484, -0.9157271981239319, 0.5132311582565308, -0.3971046209335327, 0.7146018147468567, -0.16879384219646454, -0.033057112246751785, 0.33618468046188354, 1.4950625896453857, 3.373162269592285, 0.1337827891111374, 0.35570964217185974, -0.27462852001190186, -0.9425114393234253, 1.3876010179519653, 0.9414151310920715, -0.10179119557142258, -0.6331881880760193, -1.0362484455108643, 1.329073429107666, 1.9735352993011475, 0.9750716686248779, 0.048806846141815186, -0.8233276009559631, -0.7375651001930237, 0.008141577243804932, 0.19594377279281616, 0.48937833309173584, 0.9141120910644531, 0.02580571360886097, 0.060065336525440216, 1.4358681440353394, 1.1847312450408936, -0.36955350637435913, 0.3108021914958954, -0.8917033672332764, -0.37995946407318115, 0.4897374212741852, 0.3098742663860321, -0.03226694092154503, 0.37568414211273193, -0.9759483933448792, -0.2255689799785614, -0.3384690582752228, -0.8790311813354492, -0.7768669128417969, -0.3807707726955414, -0.40313073992729187, 1.7287548780441284, 0.027313729748129845, -0.5051584839820862, -0.003981644753366709, -0.7351736426353455, -0.12386777997016907, -1.0851783752441406, 0.24261526763439178, -0.11270771920681, -0.08661533892154694, -0.1270325928926468, 1.766168236732483, -0.9918385744094849, -2.044666051864624, 0.21170848608016968, 0.24316026270389557, -0.23757530748844147, 0.16472817957401276, 1.7038326263427734, 0.556651771068573, 1.4441965818405151, 1.3469175100326538, 0.971827507019043, -0.6400165557861328, -1.3149982690811157, 0.6202252507209778, 0.9660604596138, -1.3868509531021118, 0.8949841260910034, -0.11961731314659119, -0.49961355328559875, 0.6368374824523926, 1.3015865087509155, 0.4390147030353546, -2.070089101791382, 0.8295965194702148, -1.0149301290512085, 0.8447151184082031, 0.7125653624534607, 0.7129547595977783, 0.23197303712368011, 0.8364447355270386, -1.2644994258880615, -1.168854832649231, -0.6722913384437561, -0.6536562442779541, 1.958314061164856, -0.32108211517333984, 0.5737868547439575, -0.21902357041835785, -1.3270399570465088, -0.06198422610759735, 0.6856449246406555, 0.37624791264533997, -0.4426918029785156, 0.7749661803245544, -0.6632702946662903, -1.0832246541976929, -1.4089893102645874, -0.5117666721343994, -1.0918737649917603, -0.9269949197769165, 1.060056209564209, 0.7744036316871643, 0.38711246848106384, 1.9012010097503662, 0.6158173680305481, 0.2905524969100952, -2.5745811462402344, 0.9318766593933105, 0.3037394881248474, -0.05154411494731903, 0.8596380352973938, 0.3610990047454834, 1.0851521492004395, -0.009182882495224476, 0.5416730642318726, -2.4498050212860107, 2.2980144023895264, -0.2718311846256256, 0.7071557641029358, 0.024283865466713905, -0.08764210343360901, 1.074751615524292, 0.5707215666770935, 0.5470950603485107, -1.0908308029174805, 0.6957303881645203, -0.5791829228401184, 1.2558822631835938, 0.9193649291992188, -0.8350168466567993, -0.005233324598520994, 1.331333041191101, 0.42874935269355774, -0.5456167459487915, -0.9534072279930115, -0.9258610606193542, 0.918877124786377, 1.7420158386230469, -0.017040688544511795, -0.020597334951162338, 0.8462429642677307, 0.6662083864212036, -1.2517178058624268, 0.11606418341398239, -0.6677049994468689, -0.7645410895347595, 1.6398377418518066, 2.03224778175354, -0.17936407029628754, -0.14423918724060059, -0.6947833299636841, -1.273146629333496, 0.8048697113990784, -0.007338179741054773, 0.08614195138216019, 0.6514591574668884, -0.6269751787185669, 1.122396469116211, 0.7937440276145935, 0.9323724508285522, 0.22962170839309692, 0.23111015558242798, 0.3979853093624115, -0.32893115282058716, -1.1217856407165527, -0.3094806969165802, -1.044089674949646, -2.599764823913574, 0.4420613944530487, -0.22180822491645813, -1.4375823736190796, 0.07037390023469925, -1.0020405054092407, 0.8297192454338074, -0.5510643720626831, -1.103888750076294, -1.4888955354690552, 0.2558424174785614, -0.11315850913524628, 0.9290563464164734, -1.6225709915161133, -0.14456230401992798, 1.2097091674804688, 0.9131840467453003, -0.6356735229492188, 1.027855634689331, 0.24869756400585175, 0.9915282130241394, 0.8783102035522461, -0.4434252083301544, 0.5131435394287109, 0.11972478777170181, -1.315412163734436, 0.4438292682170868, 1.2552618980407715, 0.1539953351020813, 1.4555562734603882, -0.5319954752922058, -0.004211633000522852, 0.40485984086990356, -0.512398898601532, -0.4638080596923828, -0.5809816718101501, 0.6843547224998474, 0.056592389941215515, -0.9647582173347473, -0.06134357303380966, -0.03486465662717819, -0.28128549456596375, 0.20950797200202942, -1.4536914825439453, -0.12016961723566055, -0.4136119782924652, -0.5569871664047241, -1.3438876867294312, -0.1006578877568245, 1.3154689073562622, -0.7654994130134583, -0.15877588093280792, 0.49106767773628235, 0.31153491139411926, 0.4791223406791687, 0.6665376424789429, -0.7662476897239685, -0.35427534580230713, -0.2295108139514923, -0.362655907869339, 0.34181615710258484, 1.3041807413101196, -0.0838547870516777, -0.9771329760551453, 0.6580855250358582, -0.3373759090900421, 0.08606260269880295, 1.9812064170837402, 0.07003346085548401, -0.7972089052200317, 0.35481658577919006, -0.7987694144248962, 1.9143273830413818, 1.665232539176941, 1.2722059488296509, -0.08565060794353485, -0.9682550430297852, 0.7244529724121094, -0.2994788885116577, -0.39791202545166016, 0.8689573407173157, 0.31942495703697205, -0.275621235370636, -1.4358152151107788, 0.6621586084365845, 1.2707575559616089, -0.7790518999099731, -0.8263678550720215, 0.11592429131269455, -0.8426057696342468, 1.0893049240112305, 0.6061474084854126, 0.3909970819950104, 0.24182264506816864, 1.658521294593811, 0.8111172318458557, -0.5348093509674072, 0.557852566242218, 0.48223140835762024, -0.14489121735095978, -2.1035497188568115, -1.1399515867233276, 0.27837103605270386, -0.46081456542015076, -1.5865089893341064, 1.4461983442306519, -1.169579029083252, -0.9814093112945557, 0.6103028059005737, 0.12103138118982315, 1.3759031295776367, 0.32091087102890015, 1.571292757987976, 2.0856876373291016, 0.8684893250465393, 0.4162270128726959, 1.2646830081939697, -0.2227696031332016, -0.44594377279281616, 1.8047380447387695, -0.4991374909877777, 0.5314511656761169, 1.0888458490371704, -0.3395530879497528, -1.1100865602493286, -0.7712151408195496, -1.1732468605041504, -0.7466575503349304, 1.1582962274551392, 0.08541809022426605, -1.060389757156372, 0.25896114110946655, 1.6008009910583496, 0.07928863912820816, -0.28173935413360596, 0.6075598001480103, 0.4504985809326172, -0.7311838269233704, -0.13677367568016052, -0.9569854140281677, 0.5694553852081299, -0.17308981716632843, -0.35174673795700073, 0.28996455669403076, 0.47692424058914185, 1.3152987957000732, -0.013597546145319939, 0.08574536442756653, 1.1436878442764282, -1.4829857349395752, 1.4841806888580322, -0.693255603313446, 0.31322336196899414, -2.3228228092193604, 1.3738116025924683, -0.7682507038116455, 1.9801154136657715, -2.611879587173462, 0.4108436703681946, -0.583638072013855, -0.5513119697570801, 0.29450803995132446, -0.26963937282562256, 0.1535855084657669, -0.15889087319374084, -1.1457860469818115, -0.040167368948459625, -0.7942733764648438, 0.4935281574726105, 1.141689419746399, 1.3878780603408813, -1.0528044700622559, -0.27342167496681213, -1.6786019802093506, -0.11806079000234604, -0.6561969518661499, 0.2524698078632355, -1.9253493547439575, -0.08847072720527649, -1.9771145582199097, -2.363835573196411, -1.4010016918182373, -0.821840763092041, 1.1279202699661255, 0.17637357115745544, -0.9296016693115234, 1.279198169708252, -0.33729976415634155, -1.8274976015090942, 1.1690913438796997, -2.104846239089966 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Agree that we need to have access to the original sound files. Few days ago I was looking for these original files because I suspected there is bug in the audio resampling (confirmed in https://github.com/huggingface/datasets/issues/3662) and I want to do my own resampling to workaround the bug, which is now not possible anymore due to the unavailability of the original files.
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
61
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Agree that we need to have access to the original sound files. Few days ago I was looking for these original files because I suspected there is bug in the audio resampling (confirmed in https://github.com/huggingface/datasets/issues/3662) and I want to do my own resampling to workaround the bug, which is now not possible anymore due to the unavailability of the original files.
[ -1.1913546323776245, -0.8255574107170105, -0.7234131693840027, 1.445169448852539, -0.1279461681842804, -1.2275002002716064, 0.1571241170167923, -1.0249649286270142, 1.5994600057601929, -0.8263223171234131, 0.32143181562423706, -1.6750274896621704, 0.04798300191760063, -0.6392063498497009, -0.7637650966644287, -0.8502250909805298, -0.35459020733833313, -0.7025353312492371, 1.0356436967849731, 2.434753179550171, 1.235779881477356, -1.379512071609497, 2.748455286026001, 0.6815871596336365, -0.29825207591056824, -0.9735772609710693, 0.48977309465408325, -0.009778820909559727, -1.2984411716461182, -0.4475080370903015, -0.9367640614509583, -0.04269111528992653, -0.5986729264259338, -0.46816253662109375, 0.025535672903060913, 0.394018292427063, -0.29646673798561096, -0.3635118305683136, -0.5779733657836914, -0.8073607087135315, 0.42961564660072327, -0.3847009837627411, 0.9735358357429504, -0.27575886249542236, 1.7676817178726196, -0.646569550037384, 0.49398884177207947, 0.7133899331092834, 1.3241426944732666, 0.24399249255657196, 0.03223271667957306, 0.348483145236969, 0.3598467707633972, 0.016559574753046036, 0.532572865486145, 1.1356126070022583, 0.6876438856124878, 0.4878427982330322, 0.7272317409515381, -2.168429136276245, 1.3471523523330688, -0.9467816352844238, 0.22616833448410034, 1.3298380374908447, -0.9588449597358704, 0.31089910864830017, -1.7656748294830322, -0.1033661961555481, 0.5349112749099731, -2.307028293609619, 0.24860911071300507, -1.3249231576919556, -0.5823211073875427, 1.0087251663208008, 0.44153088331222534, -1.257668137550354, 0.07875359803438187, -0.4421851634979248, 0.9546107649803162, 0.4418408274650574, 1.0709714889526367, -1.5878832340240479, -0.06959106773138046, -0.2832111120223999, 0.10710369050502777, -1.209513783454895, -1.5300730466842651, 0.5888429284095764, 0.5645398497581482, 0.6295390725135803, -0.1357264369726181, 1.0259267091751099, -1.0751442909240723, 0.850424587726593, -1.0129142999649048, -1.7606536149978638, -1.3846304416656494, -2.34148907661438, -2.2535974979400635, 0.852402925491333, -0.47229692339897156, -0.4840070605278015, 2.1071717739105225, -1.077925682067871, -1.6949951648712158, 1.0818721055984497, 0.2635999619960785, -0.020896602421998978, 2.41227126121521, 0.15975451469421387, -0.7601457834243774, 0.48560577630996704, -0.7871260046958923, 0.7927637696266174, -0.4117472171783447, 1.2689393758773804, 0.3951303958892822, -1.0866822004318237, 1.5668225288391113, -0.31056535243988037, 0.5781531929969788, -0.715583860874176, -0.4857807159423828, -0.7603389620780945, 0.26318275928497314, 1.8577706813812256, -0.26020997762680054, 1.5510938167572021, -0.25358837842941284, -1.5682790279388428, -1.5434238910675049, 0.8510474562644958, 0.4902602434158325, -0.8340581059455872, 0.10823807120323181, -0.37120309472084045, 0.1517208069562912, -0.004828033037483692, 1.1324305534362793, 1.3188738822937012, 0.7406781911849976, -0.340126633644104, -0.8219958543777466, 0.1420101821422577, -0.10657709091901779, -0.6905204653739929, -1.7695472240447998, -0.33393624424934387, 0.15888087451457977, 0.6578409671783447, -1.2261525392532349, 1.8236571550369263, 0.8849601149559021, 1.9409478902816772, 1.0321760177612305, -0.44061046838760376, 1.506894826889038, 0.08559044450521469, 1.8885473012924194, -0.4953393340110779, 0.5975705981254578, -0.4354931712150574, -1.1787402629852295, 0.8312345743179321, -0.34437426924705505, -2.035823106765747, -0.6910461783409119, -0.7523369193077087, -0.20638443529605865, -0.7827431559562683, 0.9621360301971436, -0.2983190715312958, -1.3851054906845093, 0.1944398730993271, -0.6868780851364136, 0.09901805222034454, -1.2859100103378296, 0.247894749045372, 0.693200409412384, -0.6692357659339905, 0.019134104251861572, -0.2998417615890503, -1.2603410482406616, -0.5043172836303711, 0.3427906632423401, 1.8485223054885864, -0.6440662145614624, 1.0010085105895996, 1.034052848815918, -0.6865125298500061, 0.006868542172014713, 0.39731547236442566, -0.32472261786460876, 0.8773677349090576, -1.069217324256897, -0.4663372337818146, 1.16721773147583, -0.2673875391483307, -0.5623804330825806, 1.4306023120880127, 0.7383231520652771, -1.0232137441635132, -0.19802819192409515, -0.11095482856035233, -0.8293875455856323, 0.028893180191516876, -1.607460856437683, -0.1853259652853012, 0.3992573916912079, -1.5567963123321533, -0.3961738348007202, -0.1597936749458313, 1.2672076225280762, -0.18114635348320007, 1.4150947332382202, -0.2873390018939972, -0.15780971944332123, -0.37473103404045105, -0.48342597484588623, 0.09374590963125229, -0.16848869621753693, -0.5795161724090576, 0.2751370370388031, -0.7625560760498047, 0.28647327423095703, 1.4883060455322266, 0.25761204957962036, 0.04321938753128052, 0.4568585455417633, 1.0861188173294067, 0.33546310663223267, -0.10402735322713852, -0.9209915399551392, -1.5663678646087646, 2.0619559288024902, -1.475773811340332, 2.012730598449707, 0.8068051934242249, -0.054216060787439346, -1.7794653177261353, -1.8425899744033813, 1.3424886465072632, 1.1006006002426147, 2.384061574935913, 0.5333483815193176, 0.4405349791049957, -0.7812259197235107, -0.7132222056388855, 0.36800241470336914, -0.9994714856147766, -0.6995059847831726, 0.09766090661287308, 2.4726359844207764, 1.685328722000122, -0.3856213092803955, -0.19547605514526367, -1.006208062171936, 1.365376353263855, -0.24049273133277893, 0.2363872081041336, 1.985661268234253, -0.28685933351516724, -1.0318642854690552, 1.2817381620407104, -2.2920496463775635, 0.20962458848953247, 2.062235116958618, 0.24856840074062347, 0.05601681023836136, -1.334471583366394, -0.6354427933692932, -0.27441155910491943, -0.48103341460227966, -1.2818520069122314, 0.4995659291744232, -0.25407248735427856, -0.8189574480056763, -1.3360990285873413, 0.09019004553556442, -1.1640572547912598, -1.6845930814743042, 0.27749842405319214, 1.9086438417434692, 2.081897258758545, -0.7152711749076843, 1.4851726293563843, -0.3017064034938812, 0.09231717139482498, 1.1983829736709595, 1.2679166793823242, 3.186350107192993, 1.8824524879455566, -1.307180643081665, 0.64925217628479, -0.21453016996383667, -0.4477293789386749, 1.1180108785629272, -1.115666389465332, 1.2371431589126587, -0.21133184432983398, -1.2997044324874878, -1.238693356513977, 0.9902672171592712, 0.417447954416275, 0.014466586522758007, -0.5471229553222656, 1.1934547424316406, 0.13271349668502808, 1.3022211790084839, 0.5976672768592834, -0.2733425796031952, 0.5484395027160645, -0.3833746612071991, -0.5384804010391235, 1.6532729864120483, 0.18246524035930634, -1.4605631828308105, -2.3808705806732178, -0.22475582361221313, -0.9380180239677429, 0.047274019569158554, -0.6451292634010315, -1.0305538177490234, 1.6363953351974487, 0.4066826403141022, -1.179142951965332, -0.25750210881233215, -0.35788947343826294, -0.5553434491157532, 2.7525951862335205, -1.3698256015777588, -0.18523761630058289, -0.9846078157424927, -0.6004927754402161, 1.6373754739761353, -1.2117750644683838, -0.25952842831611633, -1.0117464065551758, -0.5779595375061035, -1.2179676294326782, -0.4540554881095886, 0.019611511379480362, -0.9740890264511108, 0.7543081045150757, 0.15509527921676636, -1.200982689857483, -0.3078584372997284, -0.9188699126243591, 0.9243178963661194, -0.12040235847234726, 0.16646316647529602, 1.819691777229309, 0.3729643225669861, -0.36332187056541443, 0.7963452935218811, 1.211201786994934, 0.6357364654541016, -0.6332385540008545, 0.10723239183425903, -0.6540104150772095, 0.34836888313293457, -1.2637637853622437, 0.27616408467292786, -2.856171131134033, 0.6521617770195007, -0.11905995011329651, -0.09748899936676025, -0.08692020922899246, -1.2981871366500854, 1.0798877477645874, 2.566286563873291, -1.1090062856674194, 0.5106876492500305, 0.3143303692340851, 1.1725906133651733, -1.602524757385254, 0.2171226292848587, -0.5269249677658081, 2.1241743564605713, 0.2037626951932907, 1.1724624633789062, -0.45542851090431213, -2.3460683822631836, 0.6245105862617493, -1.1712946891784668, -1.046019196510315, 0.8329565525054932, -0.7819045186042786, 0.17825907468795776, -1.3627736568450928, -0.2134922593832016, -0.7979782819747925, -1.190016269683838, 0.6796029210090637, 0.0874444916844368, 0.5390363335609436, -0.5802756547927856, 0.2643401026725769, -2.212623357772827, -1.3850393295288086, -0.17176713049411774, -0.930579423904419, 0.5069361329078674, -0.3945406973361969, 0.7209307551383972, -0.1274551898241043, -0.03576730564236641, 0.3292262852191925, 1.4834750890731812, 3.3659048080444336, 0.14206315577030182, 0.2947649359703064, -0.2447754144668579, -0.9373216032981873, 1.3896470069885254, 0.9206357002258301, -0.12289886176586151, -0.6477149128913879, -1.0157893896102905, 1.3171358108520508, 1.9751263856887817, 1.0091164112091064, 0.0857071578502655, -0.8383119702339172, -0.7477097511291504, 0.0031944625079631805, 0.20313864946365356, 0.5293571352958679, 0.8951708078384399, -0.0003256704658269882, 0.04164889082312584, 1.4249000549316406, 1.1944102048873901, -0.3589957356452942, 0.3357113003730774, -0.9033916592597961, -0.3856569826602936, 0.47460997104644775, 0.2821502983570099, -0.023613853380084038, 0.3977091610431671, -1.0128799676895142, -0.21159811317920685, -0.3709383010864258, -0.8928719162940979, -0.7843383550643921, -0.34901633858680725, -0.4129564166069031, 1.7108522653579712, 0.02278260514140129, -0.49537426233291626, 0.02623661980032921, -0.7300293445587158, -0.13789992034435272, -1.078194499015808, 0.26866087317466736, -0.13904137909412384, -0.05876583606004715, -0.12867508828639984, 1.7327561378479004, -1.0263811349868774, -2.0769875049591064, 0.2222263365983963, 0.21270839869976044, -0.2935488820075989, 0.15467271208763123, 1.7110018730163574, 0.5676482915878296, 1.4268898963928223, 1.3427581787109375, 0.9684613347053528, -0.640120804309845, -1.277195692062378, 0.6336513161659241, 0.9778175950050354, -1.3752520084381104, 0.8831627368927002, -0.12137964367866516, -0.5192543268203735, 0.6510369181632996, 1.2954708337783813, 0.41435694694519043, -2.0828323364257812, 0.8469105958938599, -0.9895502328872681, 0.8247870802879333, 0.6983955502510071, 0.7189420461654663, 0.2422703057527542, 0.856182873249054, -1.266196370124817, -1.1556522846221924, -0.6658438444137573, -0.6541370749473572, 1.9581403732299805, -0.3005843758583069, 0.5544052124023438, -0.21459540724754333, -1.2884410619735718, -0.07704780995845795, 0.6595584154129028, 0.36934247612953186, -0.4379066824913025, 0.7935330867767334, -0.6479799151420593, -1.0689798593521118, -1.421813726425171, -0.5029839873313904, -1.0820106267929077, -0.9138627648353577, 1.0475068092346191, 0.7826728820800781, 0.4149564504623413, 1.9004921913146973, 0.6234084963798523, 0.28043079376220703, -2.6060028076171875, 0.9170294404029846, 0.31578943133354187, -0.08016615360975266, 0.8856803178787231, 0.33353641629219055, 1.1106163263320923, 0.0023636631667613983, 0.5496385097503662, -2.4318292140960693, 2.2820887565612793, -0.2646126449108124, 0.6878187656402588, 0.01780804619193077, -0.09968052804470062, 1.0912115573883057, 0.5706350803375244, 0.5444852113723755, -1.0977351665496826, 0.7299034595489502, -0.5537106990814209, 1.2135142087936401, 0.9194046854972839, -0.8526915311813354, 0.002636653371155262, 1.3575018644332886, 0.4479493498802185, -0.5214970707893372, -0.9560286402702332, -0.8942228555679321, 0.9037023782730103, 1.7641397714614868, 0.0017414959147572517, -0.0002925293520092964, 0.8529105186462402, 0.6655116081237793, -1.2690051794052124, 0.10214897990226746, -0.6553164720535278, -0.7581489682197571, 1.655333161354065, 2.028809070587158, -0.14086522161960602, -0.1582511067390442, -0.7232951521873474, -1.2631973028182983, 0.803999662399292, -0.04078434407711029, 0.0908491387963295, 0.6719084978103638, -0.6545388102531433, 1.1229442358016968, 0.7978045344352722, 0.9441643357276917, 0.18304021656513214, 0.2295244038105011, 0.38178566098213196, -0.30346596240997314, -1.1376988887786865, -0.3346254825592041, -1.0312434434890747, -2.5896096229553223, 0.4467344582080841, -0.25413623452186584, -1.4262133836746216, 0.0827113464474678, -1.0105079412460327, 0.8239982724189758, -0.579725980758667, -1.1033726930618286, -1.4895236492156982, 0.2860284447669983, -0.11076793074607849, 0.9281798601150513, -1.6295099258422852, -0.15560846030712128, 1.226385474205017, 0.8937755227088928, -0.6000598073005676, 0.9963475465774536, 0.2564738094806671, 1.003086805343628, 0.8572319746017456, -0.43597614765167236, 0.5032930970191956, 0.12587973475456238, -1.3382320404052734, 0.4529457688331604, 1.2304341793060303, 0.1574203222990036, 1.4517040252685547, -0.5274986624717712, -0.00032791122794151306, 0.4192192256450653, -0.5028467178344727, -0.4595831334590912, -0.5783084630966187, 0.6720922589302063, 0.055302850902080536, -1.001796007156372, -0.041863080114126205, -0.04378855600953102, -0.28898537158966064, 0.22204285860061646, -1.4486502408981323, -0.1473258137702942, -0.3834567964076996, -0.5481745004653931, -1.341965913772583, -0.0755670815706253, 1.2964426279067993, -0.7641772031784058, -0.15394705533981323, 0.5141830444335938, 0.2898997664451599, 0.5019572377204895, 0.6597223877906799, -0.7768760323524475, -0.34813275933265686, -0.24882172048091888, -0.3796306252479553, 0.31907573342323303, 1.2623515129089355, -0.09246931225061417, -0.9564681649208069, 0.6603484153747559, -0.32830744981765747, 0.12962378561496735, 1.9748753309249878, 0.06349502503871918, -0.7907084822654724, 0.36655092239379883, -0.7957037687301636, 1.9041187763214111, 1.6573333740234375, 1.2924963235855103, -0.08272020518779755, -0.9825365543365479, 0.6999215483665466, -0.30400341749191284, -0.3720829486846924, 0.8759821653366089, 0.3519105017185211, -0.2571033239364624, -1.4280281066894531, 0.659998893737793, 1.3010554313659668, -0.8386423587799072, -0.8311119675636292, 0.11898979544639587, -0.8458361029624939, 1.095070719718933, 0.6099407076835632, 0.37435558438301086, 0.253730446100235, 1.615591287612915, 0.7980321645736694, -0.506549596786499, 0.5371010303497314, 0.49439647793769836, -0.14102788269519806, -2.0689995288848877, -1.1223140954971313, 0.2908165752887726, -0.44051867723464966, -1.6029549837112427, 1.430521845817566, -1.1757609844207764, -0.9779033064842224, 0.5863282680511475, 0.1325797736644745, 1.3943657875061035, 0.3305071294307709, 1.5994746685028076, 2.061990976333618, 0.8843650817871094, 0.390900194644928, 1.2716588973999023, -0.16507196426391602, -0.4271492660045624, 1.7887108325958252, -0.487515926361084, 0.5224099159240723, 1.0781348943710327, -0.3647652566432953, -1.135158658027649, -0.7883462309837341, -1.1628974676132202, -0.7363665699958801, 1.1942867040634155, 0.07766128331422806, -1.0396124124526978, 0.25555065274238586, 1.607550859451294, 0.11117951571941376, -0.26617884635925293, 0.6116228699684143, 0.4291530251502991, -0.735720694065094, -0.123056560754776, -0.9275660514831543, 0.5749236941337585, -0.15652205049991608, -0.3581671416759491, 0.294133722782135, 0.4797646403312683, 1.3231818675994873, -0.022720135748386383, 0.0713067278265953, 1.1800428628921509, -1.4637194871902466, 1.4854377508163452, -0.6902908682823181, 0.29689353704452515, -2.3364076614379883, 1.3829421997070312, -0.7814337015151978, 1.9673898220062256, -2.5898613929748535, 0.443255215883255, -0.5650750398635864, -0.5324552655220032, 0.2861427366733551, -0.27954983711242676, 0.1673326939344406, -0.16733530163764954, -1.123936653137207, -0.07088032364845276, -0.8022500276565552, 0.5185949802398682, 1.1923667192459106, 1.3777034282684326, -1.0457292795181274, -0.28902366757392883, -1.6931368112564087, -0.13192224502563477, -0.6443775296211243, 0.27017080783843994, -1.9197973012924194, -0.08758930116891861, -1.9522161483764648, -2.4056198596954346, -1.4032479524612427, -0.8368212580680847, 1.1197413206100464, 0.19017840921878815, -0.9160930514335632, 1.2708702087402344, -0.34064656496047974, -1.8142411708831787, 1.172308087348938, -2.14624285697937 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
@patrickvonplaten > The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing Just to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes? > The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment I'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 (https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627). Your concern is reasonable, but there are situations where we can only serve bytes (see https://github.com/huggingface/datasets/pull/3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column("audio", Audio(decode=False))`).
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
180
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 @patrickvonplaten > The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing Just to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes? > The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment I'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 (https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627). Your concern is reasonable, but there are situations where we can only serve bytes (see https://github.com/huggingface/datasets/pull/3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column("audio", Audio(decode=False))`).
[ -1.1875488758087158, -0.8184916973114014, -0.7379257678985596, 1.4578173160552979, -0.144943505525589, -1.264755129814148, 0.15165400505065918, -1.016464352607727, 1.6363080739974976, -0.8378830552101135, 0.3068549931049347, -1.683391809463501, 0.04046982526779175, -0.6583877205848694, -0.7630300521850586, -0.8325304388999939, -0.3489167392253876, -0.72134929895401, 1.0401477813720703, 2.4041526317596436, 1.2327988147735596, -1.3607254028320312, 2.728248357772827, 0.673267662525177, -0.30843573808670044, -0.9253569841384888, 0.45171472430229187, -0.04572746902704239, -1.3084605932235718, -0.45927101373672485, -0.9329909682273865, -0.053318850696086884, -0.616732656955719, -0.48314857482910156, 0.01970636658370495, 0.3714260458946228, -0.3302375376224518, -0.36636462807655334, -0.5880473256111145, -0.8256871104240417, 0.41180458664894104, -0.35897940397262573, 0.9781789183616638, -0.30181029438972473, 1.7694846391677856, -0.6765835881233215, 0.45978236198425293, 0.7197569012641907, 1.303058385848999, 0.25499269366264343, 0.019297044724225998, 0.34503650665283203, 0.3686724603176117, -0.0020900703966617584, 0.5384528040885925, 1.1430652141571045, 0.6803584098815918, 0.5259162783622742, 0.7408356070518494, -2.1864771842956543, 1.3707834482192993, -0.9823876619338989, 0.22178490459918976, 1.3279613256454468, -0.966422438621521, 0.3292349874973297, -1.7537765502929688, -0.08636973053216934, 0.5164681077003479, -2.303184747695923, 0.29362553358078003, -1.3448256254196167, -0.5593423247337341, 0.9958451390266418, 0.4618195593357086, -1.2465136051177979, 0.07866714149713516, -0.4185877740383148, 0.9360881447792053, 0.41746535897254944, 1.0525318384170532, -1.626211166381836, -0.06595609337091446, -0.28676873445510864, 0.11244639754295349, -1.2127857208251953, -1.5275388956069946, 0.5914756655693054, 0.5632190704345703, 0.6093662977218628, -0.1303725242614746, 1.042790174484253, -1.0536643266677856, 0.8259931206703186, -1.037442684173584, -1.7437374591827393, -1.3838313817977905, -2.3013269901275635, -2.255943536758423, 0.8369358777999878, -0.48860374093055725, -0.4937145709991455, 2.1348509788513184, -1.0849940776824951, -1.6974122524261475, 1.1186527013778687, 0.22387027740478516, -0.03331129252910614, 2.4103195667266846, 0.17442066967487335, -0.744704008102417, 0.5119718909263611, -0.768035888671875, 0.8038570880889893, -0.41405540704727173, 1.2642288208007812, 0.3827201724052429, -1.0762176513671875, 1.5766477584838867, -0.3292146325111389, 0.5850585699081421, -0.6883822083473206, -0.48849934339523315, -0.7590957880020142, 0.2811810374259949, 1.8422727584838867, -0.22967810928821564, 1.5309373140335083, -0.25959810614585876, -1.5516762733459473, -1.5691646337509155, 0.8879041075706482, 0.4925401508808136, -0.8475632667541504, 0.11359604448080063, -0.3251897692680359, 0.1650053709745407, -0.004842042922973633, 1.1624627113342285, 1.362121343612671, 0.7603883743286133, -0.33825474977493286, -0.8157327175140381, 0.12463346123695374, -0.10320140421390533, -0.712600588798523, -1.7544625997543335, -0.3383271098136902, 0.13415303826332092, 0.6572003364562988, -1.2415188550949097, 1.8230682611465454, 0.8860958814620972, 1.952180027961731, 1.0243380069732666, -0.4248964488506317, 1.4900513887405396, 0.10372521728277206, 1.9062831401824951, -0.47044843435287476, 0.6041505336761475, -0.46696677803993225, -1.2006250619888306, 0.8634940385818481, -0.34328415989875793, -2.0231378078460693, -0.6715590953826904, -0.7678781151771545, -0.2009068876504898, -0.777880072593689, 0.9646645188331604, -0.29586517810821533, -1.383016586303711, 0.21507787704467773, -0.7003061175346375, 0.10096392780542374, -1.296811580657959, 0.2703709006309509, 0.6879264116287231, -0.6578484773635864, 0.0553174689412117, -0.28571802377700806, -1.2629259824752808, -0.5142484903335571, 0.3357221782207489, 1.86459219455719, -0.6662268042564392, 0.9962138533592224, 1.022066593170166, -0.6693359613418579, -0.0403737798333168, 0.3991381824016571, -0.3157886564731598, 0.8519924283027649, -1.0452741384506226, -0.46312758326530457, 1.1676998138427734, -0.26756051182746887, -0.5470122694969177, 1.4132447242736816, 0.6901547312736511, -1.0417027473449707, -0.19515259563922882, -0.09802539646625519, -0.8290334343910217, 0.011401664465665817, -1.6171382665634155, -0.15711113810539246, 0.3992624580860138, -1.5651854276657104, -0.41021034121513367, -0.1463426649570465, 1.2690426111221313, -0.16604669392108917, 1.40162992477417, -0.33035698533058167, -0.15943682193756104, -0.4001093804836273, -0.4756392538547516, 0.07315120846033096, -0.16997481882572174, -0.5921410322189331, 0.2789265513420105, -0.7337488532066345, 0.2532906234264374, 1.4807296991348267, 0.2623145282268524, 0.05076047033071518, 0.4398869276046753, 1.1027259826660156, 0.35260599851608276, -0.08163177967071533, -0.9170488715171814, -1.5310838222503662, 2.0468435287475586, -1.4920662641525269, 2.0051441192626953, 0.7770749926567078, -0.03548961132764816, -1.7802257537841797, -1.8447468280792236, 1.3470672369003296, 1.1035106182098389, 2.346619129180908, 0.5251444578170776, 0.4288441836833954, -0.7960381507873535, -0.6903676986694336, 0.3641364276409149, -1.0058648586273193, -0.7152334451675415, 0.09947782009840012, 2.466327428817749, 1.6547592878341675, -0.3631536662578583, -0.19093027710914612, -1.0143237113952637, 1.3599697351455688, -0.24223989248275757, 0.2191540002822876, 1.969001054763794, -0.2925926446914673, -1.0449509620666504, 1.2811707258224487, -2.3075528144836426, 0.20683564245700836, 2.066321611404419, 0.23952679336071014, 0.05544665455818176, -1.312723994255066, -0.6728334426879883, -0.2663031816482544, -0.44872477650642395, -1.2709676027297974, 0.49270036816596985, -0.27003902196884155, -0.782439112663269, -1.351853847503662, 0.10732467472553253, -1.1166952848434448, -1.651607871055603, 0.2548977732658386, 1.9340792894363403, 2.081480026245117, -0.6998370289802551, 1.506413221359253, -0.3163827657699585, 0.07476988434791565, 1.2023725509643555, 1.2588027715682983, 3.193596363067627, 1.886437177658081, -1.3274281024932861, 0.6335240006446838, -0.1861823946237564, -0.42430028319358826, 1.1098308563232422, -1.1167112588882446, 1.2677382230758667, -0.204467311501503, -1.3057985305786133, -1.226656436920166, 0.9671315550804138, 0.40826326608657837, -0.008281366899609566, -0.5322278141975403, 1.2135547399520874, 0.10445281118154526, 1.3023790121078491, 0.6069149374961853, -0.27130892872810364, 0.5582831501960754, -0.3803215026855469, -0.5665873885154724, 1.6515583992004395, 0.18948788940906525, -1.4622248411178589, -2.386354684829712, -0.20087754726409912, -0.9266149997711182, 0.07813765108585358, -0.639014720916748, -1.0181976556777954, 1.6670260429382324, 0.3806622326374054, -1.1802773475646973, -0.2585201859474182, -0.36424076557159424, -0.546748161315918, 2.772648572921753, -1.4018620252609253, -0.1879015415906906, -0.9726637601852417, -0.6216310262680054, 1.6558302640914917, -1.2220890522003174, -0.2688843905925751, -1.0116124153137207, -0.5439256429672241, -1.1928215026855469, -0.4491879642009735, 0.006299518048763275, -0.9846873879432678, 0.785236120223999, 0.15126189589500427, -1.2409536838531494, -0.3370768129825592, -0.9401910305023193, 0.8923001289367676, -0.11337665468454361, 0.18425250053405762, 1.83913254737854, 0.35823190212249756, -0.3977542221546173, 0.7848842740058899, 1.231299638748169, 0.633814811706543, -0.6257590651512146, 0.12214641273021698, -0.606133759021759, 0.3624882102012634, -1.2542909383773804, 0.2901160717010498, -2.842263698577881, 0.6281738877296448, -0.09998009353876114, -0.08021431416273117, -0.07847300916910172, -1.3032399415969849, 1.0606614351272583, 2.529247283935547, -1.100952386856079, 0.5232011079788208, 0.2663342356681824, 1.2011210918426514, -1.6263638734817505, 0.21629944443702698, -0.511137843132019, 2.1431782245635986, 0.19401101768016815, 1.1517016887664795, -0.4279942512512207, -2.3321144580841064, 0.6260513067245483, -1.1604807376861572, -1.053081750869751, 0.8184295892715454, -0.7722727060317993, 0.18055102229118347, -1.3338860273361206, -0.23151782155036926, -0.768036961555481, -1.1707773208618164, 0.690021276473999, 0.0883546769618988, 0.5475859642028809, -0.5705039501190186, 0.2571254372596741, -2.2231969833374023, -1.3863643407821655, -0.16674621403217316, -0.9155004024505615, 0.5150132179260254, -0.39077457785606384, 0.7533668279647827, -0.17531593143939972, -0.05066622048616409, 0.3414455056190491, 1.4967563152313232, 3.3804028034210205, 0.12156054377555847, 0.3162718415260315, -0.29800355434417725, -0.9311151504516602, 1.387027621269226, 0.9370720982551575, -0.11808112263679504, -0.6450430750846863, -1.0429519414901733, 1.3114707469940186, 1.9634438753128052, 0.9756110310554504, 0.05539480596780777, -0.8429428339004517, -0.7439893484115601, 0.004088319838047028, 0.2030314803123474, 0.5362109541893005, 0.8942334651947021, 0.04766800254583359, 0.05126962065696716, 1.420929193496704, 1.1781024932861328, -0.34533926844596863, 0.36093536019325256, -0.8736228346824646, -0.42050355672836304, 0.50062495470047, 0.34203627705574036, -0.04516977816820145, 0.3660717308521271, -0.990056037902832, -0.21578484773635864, -0.3362731337547302, -0.8910982012748718, -0.7798461318016052, -0.3541855216026306, -0.41814878582954407, 1.725032925605774, 0.014488516375422478, -0.4986995756626129, 0.0021710339933633804, -0.718436062335968, -0.12577079236507416, -1.0993784666061401, 0.2718653380870819, -0.1288568675518036, -0.07613154500722885, -0.12481574714183807, 1.7312462329864502, -1.0064034461975098, -2.0514583587646484, 0.2292923480272293, 0.23201560974121094, -0.2628931403160095, 0.1757994294166565, 1.6886600255966187, 0.549594521522522, 1.4422110319137573, 1.3781346082687378, 0.9597107172012329, -0.6718775629997253, -1.3078550100326538, 0.6069726943969727, 0.97035813331604, -1.418925166130066, 0.8800284266471863, -0.1442936509847641, -0.5026381611824036, 0.640701174736023, 1.3015997409820557, 0.44077005982398987, -2.078951597213745, 0.8616140484809875, -0.9692891240119934, 0.8471564650535583, 0.7227982878684998, 0.7431290149688721, 0.24795928597450256, 0.8339551091194153, -1.2839549779891968, -1.1749835014343262, -0.6565251350402832, -0.6738455295562744, 1.9367371797561646, -0.32141774892807007, 0.5464900732040405, -0.22670599818229675, -1.3102017641067505, -0.07158555835485458, 0.6689873933792114, 0.388882040977478, -0.40664008259773254, 0.7387314438819885, -0.677438497543335, -1.0972789525985718, -1.4009766578674316, -0.53611820936203, -1.0918447971343994, -0.9097156524658203, 1.0571894645690918, 0.794768214225769, 0.38291555643081665, 1.8911432027816772, 0.6029243469238281, 0.27657443284988403, -2.5635101795196533, 0.9233816266059875, 0.3320273458957672, -0.07330931723117828, 0.8605953454971313, 0.3656095862388611, 1.1179921627044678, 0.0031248433515429497, 0.5512046217918396, -2.468313694000244, 2.306706428527832, -0.28576138615608215, 0.693337082862854, 0.012038785964250565, -0.08268959820270538, 1.0680872201919556, 0.5951585173606873, 0.5354797840118408, -1.0710777044296265, 0.7295616865158081, -0.5925520062446594, 1.2416499853134155, 0.9288168549537659, -0.8400974273681641, 0.009090520441532135, 1.3355271816253662, 0.4509541392326355, -0.5459991693496704, -0.9434052109718323, -0.9136734008789062, 0.9148277640342712, 1.7709513902664185, -0.009114188142120838, 0.00042276643216609955, 0.8388189673423767, 0.6637187600135803, -1.2574445009231567, 0.1419488489627838, -0.6611707210540771, -0.7900482416152954, 1.6198267936706543, 1.9959977865219116, -0.15423619747161865, -0.14039166271686554, -0.7212087512016296, -1.2799625396728516, 0.8206838369369507, -0.015738967806100845, 0.07904181629419327, 0.6728227734565735, -0.6278043389320374, 1.1104087829589844, 0.7892939448356628, 0.9343723058700562, 0.24242529273033142, 0.23594267666339874, 0.39643174409866333, -0.30523476004600525, -1.1309982538223267, -0.29409900307655334, -1.0251226425170898, -2.589033365249634, 0.4504576623439789, -0.2790815830230713, -1.4269733428955078, 0.06529597193002701, -0.9915996193885803, 0.8227686882019043, -0.5601703524589539, -1.1278400421142578, -1.4988183975219727, 0.2500021159648895, -0.08953414857387543, 0.9314634203910828, -1.6072044372558594, -0.17112839221954346, 1.2200998067855835, 0.9045941829681396, -0.6503902673721313, 1.0033318996429443, 0.24289071559906006, 1.002885341644287, 0.8784080743789673, -0.4277022182941437, 0.4870438277721405, 0.10339238494634628, -1.3242700099945068, 0.43180152773857117, 1.2495977878570557, 0.1382501870393753, 1.4780126810073853, -0.5435071587562561, -0.010961699299514294, 0.40454715490341187, -0.46843549609184265, -0.4531858265399933, -0.6149881482124329, 0.6594855785369873, 0.026270372793078423, -0.9608018398284912, -0.039549753069877625, -0.038807470351457596, -0.273557186126709, 0.22375090420246124, -1.4398845434188843, -0.12085415422916412, -0.4141194224357605, -0.5396314859390259, -1.3545093536376953, -0.10208795964717865, 1.286447286605835, -0.7307370901107788, -0.13338612020015717, 0.5213800072669983, 0.27793586254119873, 0.47669515013694763, 0.6748673319816589, -0.75814288854599, -0.3638031780719757, -0.2474992275238037, -0.3886311650276184, 0.3539293110370636, 1.2954298257827759, -0.08323266357183456, -0.9672621488571167, 0.6590121388435364, -0.305433452129364, 0.0871027410030365, 1.9813717603683472, 0.07197028398513794, -0.7769346833229065, 0.3568536937236786, -0.7895017862319946, 1.9270111322402954, 1.672304391860962, 1.2692373991012573, -0.10681091994047165, -1.0112583637237549, 0.722137987613678, -0.3045358955860138, -0.3855307698249817, 0.8758682012557983, 0.3364768326282501, -0.26163432002067566, -1.4455785751342773, 0.6917568445205688, 1.27825927734375, -0.7864770293235779, -0.8393054604530334, 0.11872687935829163, -0.8177327513694763, 1.0667864084243774, 0.6095424890518188, 0.37703242897987366, 0.26843342185020447, 1.643102765083313, 0.7928823828697205, -0.5119547247886658, 0.5653703808784485, 0.4687410593032837, -0.1329883486032486, -2.0845649242401123, -1.1499296426773071, 0.2867327928543091, -0.43418174982070923, -1.5994703769683838, 1.4685392379760742, -1.1724107265472412, -0.9789655208587646, 0.5997325778007507, 0.13529786467552185, 1.3790637254714966, 0.29962724447250366, 1.6048566102981567, 2.087430477142334, 0.875387966632843, 0.4072006046772003, 1.2813817262649536, -0.186926007270813, -0.4209456443786621, 1.7770750522613525, -0.482521116733551, 0.5154253244400024, 1.0771256685256958, -0.3423575758934021, -1.1297149658203125, -0.7874840497970581, -1.1924041509628296, -0.7815485000610352, 1.1666606664657593, 0.05690156668424606, -1.0399974584579468, 0.2697998583316803, 1.5949381589889526, 0.09501685202121735, -0.2702663242816925, 0.6223539710044861, 0.44758859276771545, -0.7421436905860901, -0.1341720074415207, -0.9500607252120972, 0.573019802570343, -0.1640630066394806, -0.3622964918613434, 0.30344364047050476, 0.46497997641563416, 1.343397617340088, -0.012136639095842838, 0.07032839953899384, 1.1403143405914307, -1.4656052589416504, 1.4676427841186523, -0.6892151832580566, 0.31006506085395813, -2.3158862590789795, 1.385094404220581, -0.7880236506462097, 1.9531569480895996, -2.6050732135772705, 0.42694342136383057, -0.5564108490943909, -0.5424197316169739, 0.3025403916835785, -0.2582322061061859, 0.1691291630268097, -0.17889468371868134, -1.1311960220336914, -0.034780412912368774, -0.7859872579574585, 0.5024751424789429, 1.1743168830871582, 1.3915362358093262, -1.042571783065796, -0.29709592461586, -1.6826590299606323, -0.1146487295627594, -0.6314471364021301, 0.2591772675514221, -1.9102582931518555, -0.10186558961868286, -1.970619797706604, -2.3798911571502686, -1.3933839797973633, -0.8250195980072021, 1.1637903451919556, 0.19166085124015808, -0.9221044778823853, 1.2828290462493896, -0.3176036775112152, -1.8234279155731201, 1.1404914855957031, -2.1232752799987793 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Related to this discussion: in https://github.com/huggingface/datasets/pull/3664#issuecomment-1031866858 I propose how we could change `iter_archive` to work for streaming and also return local paths (as it used too !). I'd love your opinions on this
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
33
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Related to this discussion: in https://github.com/huggingface/datasets/pull/3664#issuecomment-1031866858 I propose how we could change `iter_archive` to work for streaming and also return local paths (as it used too !). I'd love your opinions on this
[ -1.201959252357483, -0.8334378004074097, -0.7257519960403442, 1.4766780138015747, -0.11766380071640015, -1.229422926902771, 0.1331651657819748, -0.9861310124397278, 1.6292163133621216, -0.8112095594406128, 0.3163148760795593, -1.6626245975494385, 0.03311249613761902, -0.6421111226081848, -0.7592487335205078, -0.8349622488021851, -0.32739508152008057, -0.7028912305831909, 1.0459336042404175, 2.4489221572875977, 1.2493999004364014, -1.3956105709075928, 2.7363955974578857, 0.677521288394928, -0.2903137803077698, -0.9683265686035156, 0.4598406255245209, -0.01625172235071659, -1.29877507686615, -0.43714067339897156, -0.9291622042655945, -0.045484669506549835, -0.5890910029411316, -0.4824272096157074, 0.01708773523569107, 0.40766045451164246, -0.28706520795822144, -0.37973228096961975, -0.581518292427063, -0.8130234479904175, 0.4360169470310211, -0.3601536154747009, 0.9763213992118835, -0.27831897139549255, 1.7491519451141357, -0.668838381767273, 0.48408737778663635, 0.7060520052909851, 1.3061366081237793, 0.24586597084999084, 0.01038192305713892, 0.35955673456192017, 0.3618514835834503, 0.016890309751033783, 0.5503416657447815, 1.1406651735305786, 0.6807205677032471, 0.47941291332244873, 0.7316516041755676, -2.18093204498291, 1.3468542098999023, -0.958151638507843, 0.23746319115161896, 1.3014715909957886, -0.9683877825737, 0.3017173409461975, -1.7723369598388672, -0.10395423322916031, 0.5292301177978516, -2.265559673309326, 0.28009524941444397, -1.3451793193817139, -0.5656049847602844, 1.0207439661026, 0.4326041638851166, -1.2701929807662964, 0.06558828055858612, -0.4291093349456787, 0.9588750600814819, 0.44238051772117615, 1.0520743131637573, -1.613384485244751, -0.0631190612912178, -0.2809535264968872, 0.11560637503862381, -1.2016123533248901, -1.5166568756103516, 0.5618451237678528, 0.5605883598327637, 0.6461917757987976, -0.12747317552566528, 1.0318872928619385, -1.0707460641860962, 0.8360370993614197, -1.071463704109192, -1.7452888488769531, -1.3828356266021729, -2.3524880409240723, -2.282940149307251, 0.8426921367645264, -0.45793625712394714, -0.49284452199935913, 2.084202527999878, -1.0739338397979736, -1.7053248882293701, 1.1034331321716309, 0.26299700140953064, -0.02467743307352066, 2.3835065364837646, 0.1865277886390686, -0.7712977528572083, 0.5201583504676819, -0.797967255115509, 0.7866116166114807, -0.4033632278442383, 1.2796118259429932, 0.42518046498298645, -1.0923254489898682, 1.5601863861083984, -0.3331772983074188, 0.5854060053825378, -0.700944185256958, -0.4891476035118103, -0.7527079582214355, 0.2776451110839844, 1.8506118059158325, -0.24534732103347778, 1.5302212238311768, -0.259179949760437, -1.5714306831359863, -1.546157717704773, 0.852973461151123, 0.49256670475006104, -0.7979661822319031, 0.1058121770620346, -0.36488279700279236, 0.14612001180648804, -0.013139655813574791, 1.136240839958191, 1.3202468156814575, 0.7599834203720093, -0.33871737122535706, -0.8218437433242798, 0.1437506228685379, -0.08207639306783676, -0.7072749137878418, -1.757678508758545, -0.3166554868221283, 0.16662070155143738, 0.6491021513938904, -1.2202677726745605, 1.8214417695999146, 0.8823044300079346, 1.9540839195251465, 1.0092211961746216, -0.3944631516933441, 1.5025078058242798, 0.08461400121450424, 1.9065684080123901, -0.48195451498031616, 0.5830277800559998, -0.4359191358089447, -1.1793639659881592, 0.8493545651435852, -0.354621559381485, -2.0323708057403564, -0.6766008734703064, -0.758330225944519, -0.18226388096809387, -0.7920788526535034, 0.9618386626243591, -0.290138304233551, -1.4017572402954102, 0.21168957650661469, -0.7109798789024353, 0.10632425546646118, -1.2671504020690918, 0.24618330597877502, 0.6887009143829346, -0.6473264694213867, 0.04629574716091156, -0.29655781388282776, -1.2557014226913452, -0.5294175744056702, 0.3532732129096985, 1.8551685810089111, -0.659494161605835, 1.008874535560608, 1.0404950380325317, -0.6869896054267883, -0.0006138607859611511, 0.3937864303588867, -0.3318837881088257, 0.8501033782958984, -1.0674577951431274, -0.4660196304321289, 1.1786085367202759, -0.25460755825042725, -0.5440987348556519, 1.435868501663208, 0.7229814529418945, -1.0172439813613892, -0.19569189846515656, -0.0999796912074089, -0.816494882106781, 0.019056696444749832, -1.6013883352279663, -0.16815800964832306, 0.4096934199333191, -1.5352973937988281, -0.38272783160209656, -0.15874972939491272, 1.2830893993377686, -0.15676181018352509, 1.3975775241851807, -0.3185743987560272, -0.1538776457309723, -0.37636861205101013, -0.4681730270385742, 0.07889332622289658, -0.17844447493553162, -0.6079249382019043, 0.27505019307136536, -0.7489752173423767, 0.27331656217575073, 1.505491852760315, 0.25428661704063416, 0.05168961361050606, 0.446414053440094, 1.1181763410568237, 0.3380434513092041, -0.08173870295286179, -0.9043574333190918, -1.549472451210022, 2.058837890625, -1.4771592617034912, 2.0003082752227783, 0.7990400791168213, -0.04231996089220047, -1.7768688201904297, -1.8422843217849731, 1.3529280424118042, 1.0958664417266846, 2.4069416522979736, 0.5224172472953796, 0.4097500443458557, -0.7886332869529724, -0.7019035816192627, 0.35818150639533997, -1.002842664718628, -0.6956360936164856, 0.1102035716176033, 2.4792425632476807, 1.6735458374023438, -0.3734756410121918, -0.18516890704631805, -1.0007494688034058, 1.3819798231124878, -0.24220070242881775, 0.226751908659935, 1.9916751384735107, -0.2619745135307312, -1.0196553468704224, 1.2774889469146729, -2.294879674911499, 0.2377261370420456, 2.080244779586792, 0.2568894624710083, 0.05984244495630264, -1.3475650548934937, -0.6395063996315002, -0.2941349446773529, -0.462805837392807, -1.271766185760498, 0.5118964910507202, -0.25971245765686035, -0.8129370808601379, -1.3471217155456543, 0.09320995211601257, -1.1293617486953735, -1.6903352737426758, 0.2816581428050995, 1.9004883766174316, 2.099531888961792, -0.718082845211029, 1.4876117706298828, -0.2849857211112976, 0.10412418097257614, 1.2250725030899048, 1.2801305055618286, 3.1852610111236572, 1.8686637878417969, -1.3181302547454834, 0.6504444479942322, -0.1965058147907257, -0.44252657890319824, 1.097764253616333, -1.1292468309402466, 1.2355268001556396, -0.2076932042837143, -1.2975542545318604, -1.2315828800201416, 0.9837719798088074, 0.43818098306655884, 0.008539143018424511, -0.5408409833908081, 1.1869933605194092, 0.11993817239999771, 1.2851591110229492, 0.6165464520454407, -0.27088645100593567, 0.5726503729820251, -0.36772385239601135, -0.5384316444396973, 1.6403799057006836, 0.18155065178871155, -1.4907779693603516, -2.3706235885620117, -0.18839548528194427, -0.9553770422935486, 0.0025371629744768143, -0.6241997480392456, -1.0256856679916382, 1.64127779006958, 0.38255539536476135, -1.183883547782898, -0.22903989255428314, -0.33109569549560547, -0.5532722473144531, 2.7655327320098877, -1.3581055402755737, -0.18278105556964874, -0.9822049140930176, -0.6151880025863647, 1.671297550201416, -1.2015286684036255, -0.2701471745967865, -1.0140467882156372, -0.5760674476623535, -1.210955023765564, -0.4765997529029846, 0.038359835743904114, -0.9750055074691772, 0.7524782419204712, 0.14254535734653473, -1.2314462661743164, -0.3107782304286957, -0.9297921657562256, 0.9132519960403442, -0.11439821869134903, 0.1802147775888443, 1.8228318691253662, 0.34695014357566833, -0.375053733587265, 0.7978842854499817, 1.2211555242538452, 0.6348873972892761, -0.6239851713180542, 0.13005508482456207, -0.6342531442642212, 0.35405150055885315, -1.2636098861694336, 0.29297783970832825, -2.8525726795196533, 0.6375386118888855, -0.11055111140012741, -0.08436676114797592, -0.10234715044498444, -1.2991524934768677, 1.086944580078125, 2.5402088165283203, -1.1056913137435913, 0.5287445187568665, 0.302412211894989, 1.179193377494812, -1.612423300743103, 0.21319453418254852, -0.5109688639640808, 2.127926826477051, 0.18590372800827026, 1.163869023323059, -0.448358416557312, -2.322979688644409, 0.6290820240974426, -1.1803144216537476, -1.0232504606246948, 0.7980721592903137, -0.7933955788612366, 0.19931790232658386, -1.3523633480072021, -0.20528621971607208, -0.7933350801467896, -1.1783690452575684, 0.6755576133728027, 0.08544526994228363, 0.5228307843208313, -0.5668169856071472, 0.2777335047721863, -2.2162210941314697, -1.4071701765060425, -0.17082643508911133, -0.9178118705749512, 0.5128071904182434, -0.4065732955932617, 0.7231108546257019, -0.14863517880439758, -0.07052094489336014, 0.3220958411693573, 1.4836846590042114, 3.3562209606170654, 0.1401560753583908, 0.31806787848472595, -0.2301003485918045, -0.9385985732078552, 1.4002821445465088, 0.9280633926391602, -0.13069237768650055, -0.6445578336715698, -1.0480167865753174, 1.310420036315918, 1.9690370559692383, 1.0064727067947388, 0.05844995379447937, -0.8356332182884216, -0.7727006673812866, 0.017793085426092148, 0.17387115955352783, 0.5266208648681641, 0.9057437181472778, 0.026107043027877808, 0.03173872455954552, 1.4282995462417603, 1.1842498779296875, -0.35827258229255676, 0.32698214054107666, -0.8890210390090942, -0.36800655722618103, 0.4812285304069519, 0.2840766906738281, -0.025514520704746246, 0.38600391149520874, -1.0294228792190552, -0.23610365390777588, -0.33285805583000183, -0.8972750306129456, -0.7907583713531494, -0.3886091411113739, -0.4136362373828888, 1.7120933532714844, 0.006611236371099949, -0.49263840913772583, 0.028548438102006912, -0.7363724112510681, -0.12705504894256592, -1.0936369895935059, 0.26931479573249817, -0.13505123555660248, -0.06051463633775711, -0.1373913586139679, 1.7360336780548096, -1.0184175968170166, -2.084428310394287, 0.21646718680858612, 0.21924655139446259, -0.2873476445674896, 0.1657165288925171, 1.704650640487671, 0.5717092156410217, 1.417639970779419, 1.3469700813293457, 0.9531005620956421, -0.6476050019264221, -1.2934820652008057, 0.6183252334594727, 0.995612621307373, -1.387107253074646, 0.8819013833999634, -0.14197230339050293, -0.5013502240180969, 0.6718243956565857, 1.2961220741271973, 0.4114989936351776, -2.060293197631836, 0.8417921662330627, -0.9585646986961365, 0.8470047116279602, 0.7064567804336548, 0.7415337562561035, 0.22607587277889252, 0.8363427519798279, -1.2962307929992676, -1.164515495300293, -0.6717923283576965, -0.6754555106163025, 1.949129581451416, -0.2882832884788513, 0.552338719367981, -0.2254822701215744, -1.3208588361740112, -0.0656055361032486, 0.6670756936073303, 0.3638521432876587, -0.44381389021873474, 0.7585935592651367, -0.6685904860496521, -1.0526930093765259, -1.399903416633606, -0.5251355767250061, -1.0842242240905762, -0.9227001667022705, 1.0362943410873413, 0.771975040435791, 0.4029872417449951, 1.8862709999084473, 0.635339617729187, 0.3024892807006836, -2.5743558406829834, 0.9266176819801331, 0.30454587936401367, -0.040857333689928055, 0.8545360565185547, 0.3425544202327728, 1.1099202632904053, -0.004493290092796087, 0.5655602812767029, -2.4498164653778076, 2.2818756103515625, -0.2618772089481354, 0.6880219578742981, 0.029834218323230743, -0.12170757353305817, 1.0899100303649902, 0.5722255706787109, 0.5203819274902344, -1.1064854860305786, 0.7097592949867249, -0.5731624960899353, 1.2232098579406738, 0.8846827149391174, -0.8351334929466248, 0.006614658050239086, 1.3446543216705322, 0.4267868101596832, -0.5014684200286865, -0.954503059387207, -0.8881633877754211, 0.9391176700592041, 1.7254410982131958, -0.004450203385204077, -0.015586961060762405, 0.8688988089561462, 0.6594117879867554, -1.2760233879089355, 0.10277644544839859, -0.6645667552947998, -0.7445540428161621, 1.669676661491394, 2.024960994720459, -0.13938070833683014, -0.16500437259674072, -0.732939600944519, -1.2564064264297485, 0.7921751737594604, -0.03152600675821304, 0.07661846280097961, 0.6673336029052734, -0.6324126720428467, 1.1264193058013916, 0.7906614542007446, 0.9375786781311035, 0.2009744942188263, 0.21914297342300415, 0.39009442925453186, -0.3111402690410614, -1.1441813707351685, -0.34372976422309875, -1.0576016902923584, -2.5901432037353516, 0.4457979202270508, -0.24071064591407776, -1.4268085956573486, 0.0857822373509407, -1.0206643342971802, 0.8311447501182556, -0.5784311890602112, -1.1119924783706665, -1.4831515550613403, 0.2724756598472595, -0.12849369645118713, 0.9191917777061462, -1.6111085414886475, -0.1695428192615509, 1.230825662612915, 0.8861814737319946, -0.6204037070274353, 1.0033113956451416, 0.22634927928447723, 0.9962738752365112, 0.8859437108039856, -0.43720442056655884, 0.5239174962043762, 0.13467560708522797, -1.3416807651519775, 0.4304206669330597, 1.2531001567840576, 0.14680476486682892, 1.4828306436538696, -0.5332185626029968, 0.009522908367216587, 0.421592652797699, -0.5200138688087463, -0.4696752429008484, -0.5927047729492188, 0.6620470285415649, 0.04933106526732445, -1.006078839302063, -0.04257786273956299, -0.028372887521982193, -0.27399569749832153, 0.22118143737316132, -1.4613406658172607, -0.13019756972789764, -0.38914862275123596, -0.5587072968482971, -1.348667025566101, -0.08099376410245895, 1.2820816040039062, -0.7888094186782837, -0.16250301897525787, 0.4812254011631012, 0.2795543670654297, 0.4974742531776428, 0.6778861284255981, -0.7761856317520142, -0.35366812348365784, -0.2387932389974594, -0.3739580512046814, 0.33491262793540955, 1.276536226272583, -0.06133975833654404, -0.9730610847473145, 0.6633749604225159, -0.3495731055736542, 0.12990303337574005, 1.974183440208435, 0.07633725553750992, -0.7940665483474731, 0.3791995942592621, -0.7835592031478882, 1.9237831830978394, 1.6592365503311157, 1.2991870641708374, -0.09754229336977005, -0.9689943194389343, 0.7148873805999756, -0.3096171021461487, -0.3957867920398712, 0.8770866990089417, 0.3255382180213928, -0.26408350467681885, -1.4106229543685913, 0.6696250438690186, 1.302524209022522, -0.8118576407432556, -0.8312191367149353, 0.13314807415008545, -0.8476963043212891, 1.0902680158615112, 0.6102490425109863, 0.3699917495250702, 0.26849013566970825, 1.6300846338272095, 0.7913246750831604, -0.4995541572570801, 0.5562915802001953, 0.49224478006362915, -0.12815958261489868, -2.0800282955169678, -1.119032859802246, 0.3029213845729828, -0.44157665967941284, -1.595318078994751, 1.4389277696609497, -1.1628497838974, -0.9715051651000977, 0.6021966338157654, 0.14519654214382172, 1.3891372680664062, 0.33069467544555664, 1.6035281419754028, 2.0819878578186035, 0.8579080104827881, 0.39654645323753357, 1.2676180601119995, -0.18749867379665375, -0.4526916742324829, 1.7936391830444336, -0.4943139851093292, 0.5540833473205566, 1.0654553174972534, -0.3511224389076233, -1.1613857746124268, -0.7987890243530273, -1.1998977661132812, -0.7467920184135437, 1.1785650253295898, 0.08714251965284348, -1.0631221532821655, 0.2581271827220917, 1.6149556636810303, 0.0801951065659523, -0.2686542272567749, 0.6326631307601929, 0.40946826338768005, -0.7534604668617249, -0.1255851686000824, -0.9409254193305969, 0.5706594586372375, -0.140655979514122, -0.37102454900741577, 0.28108102083206177, 0.48953551054000854, 1.316833257675171, -0.02114611119031906, 0.05791148543357849, 1.1674110889434814, -1.45600426197052, 1.474838376045227, -0.7159721255302429, 0.32050132751464844, -2.3132870197296143, 1.3643637895584106, -0.8080110549926758, 1.9480650424957275, -2.607741355895996, 0.4136888086795807, -0.5500484108924866, -0.553387463092804, 0.2729707360267639, -0.26606491208076477, 0.1548638790845871, -0.1615004986524582, -1.1280947923660278, -0.06292293220758438, -0.7931113839149475, 0.5169227123260498, 1.1876137256622314, 1.3853018283843994, -1.0567642450332642, -0.28632852435112, -1.6946990489959717, -0.12671619653701782, -0.6306059956550598, 0.262141615152359, -1.9177806377410889, -0.0809965580701828, -1.9529228210449219, -2.3839070796966553, -1.3934208154678345, -0.844122052192688, 1.125741958618164, 0.1907157003879547, -0.9311953186988831, 1.2605072259902954, -0.3414144515991211, -1.8002264499664307, 1.1369363069534302, -2.1461310386657715 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
> @patrickvonplaten > > > The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing > > Just to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes? Yes! > > > The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment > > I'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 ([#3667 (comment)](https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627)). > Your concern is reasonable, but there are situations where we can only serve bytes (see #3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column("audio", Audio(decode=False))`). Yes this might be, but I highly doubt that `soundfile` is the go-to library for audio then. @anton-l and I have tried out a bunch of different audio loading libraries (`soundfile`, `librosa`, `torchaudio`, pure `ffmpeg`, `audioread`, ...). One thing that was pretty clear to me is that there is just no "de-facto standard" library and they all have pros and cons. None of the libraries really supports "batch"-ed audio loading. Some depend on PyTorch. `torchaudio` is 100x faster (really!) than `librosa's` fallback on MP3. `torchaudio` often has problems with multi-proessing, ... Also we should keep in mind that resampling is similarly not as simple as reading a text file. It's a pretty complex signal processing transform and people very well might want to use special filters, etc...at the moment we just hard-code `torchaudio's` or `librosa's` default filter when doing resampling. => All this to say that we **should definitely** care about whether we rely on local paths or bytes IMO. We don't want to loose all users that are forced to use `datasets` decoding or resampling or have to built a very much not intuitive way of loading bytes into a numpy array. It's much more intuitive to be able to inspect a local file. I feel pretty strongly about this and am happy to also jump on a call. Keeping libraries flexible and lean as well as exposing internals is very important IMO (this philosophy has worked quite well so far with Transformers).
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
436
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 > @patrickvonplaten > > > The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing > > Just to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes? Yes! > > > The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment > > I'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 ([#3667 (comment)](https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627)). > Your concern is reasonable, but there are situations where we can only serve bytes (see #3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column("audio", Audio(decode=False))`). Yes this might be, but I highly doubt that `soundfile` is the go-to library for audio then. @anton-l and I have tried out a bunch of different audio loading libraries (`soundfile`, `librosa`, `torchaudio`, pure `ffmpeg`, `audioread`, ...). One thing that was pretty clear to me is that there is just no "de-facto standard" library and they all have pros and cons. None of the libraries really supports "batch"-ed audio loading. Some depend on PyTorch. `torchaudio` is 100x faster (really!) than `librosa's` fallback on MP3. `torchaudio` often has problems with multi-proessing, ... Also we should keep in mind that resampling is similarly not as simple as reading a text file. It's a pretty complex signal processing transform and people very well might want to use special filters, etc...at the moment we just hard-code `torchaudio's` or `librosa's` default filter when doing resampling. => All this to say that we **should definitely** care about whether we rely on local paths or bytes IMO. We don't want to loose all users that are forced to use `datasets` decoding or resampling or have to built a very much not intuitive way of loading bytes into a numpy array. It's much more intuitive to be able to inspect a local file. I feel pretty strongly about this and am happy to also jump on a call. Keeping libraries flexible and lean as well as exposing internals is very important IMO (this philosophy has worked quite well so far with Transformers).
[ -1.1805168390274048, -0.797357976436615, -0.7345559597015381, 1.450345754623413, -0.140347421169281, -1.26619553565979, 0.16371265053749084, -1.0223641395568848, 1.6398733854293823, -0.8301815390586853, 0.3154648244380951, -1.689217448234558, 0.029394786804914474, -0.6495817303657532, -0.765673816204071, -0.8558322787284851, -0.3487585186958313, -0.7249631285667419, 1.0275317430496216, 2.4171953201293945, 1.247097134590149, -1.3525949716567993, 2.711416006088257, 0.6716794371604919, -0.3227505087852478, -0.9200498461723328, 0.46777164936065674, -0.03785409405827522, -1.3131439685821533, -0.4648800492286682, -0.922187328338623, -0.05736735463142395, -0.6332306861877441, -0.49104931950569153, 0.02588847652077675, 0.36798757314682007, -0.32437413930892944, -0.33317360281944275, -0.5915752053260803, -0.841072678565979, 0.4044673442840576, -0.3721896708011627, 0.9738975167274475, -0.30337852239608765, 1.7521872520446777, -0.6866486668586731, 0.4650348424911499, 0.7231757640838623, 1.2890220880508423, 0.27061009407043457, -0.007560097612440586, 0.3562546670436859, 0.36785250902175903, -0.00044890306890010834, 0.51496422290802, 1.1203960180282593, 0.6738347411155701, 0.5243852138519287, 0.7466694712638855, -2.1758909225463867, 1.3671269416809082, -0.9687653183937073, 0.20943570137023926, 1.3342974185943604, -0.9604906439781189, 0.3345423936843872, -1.765079140663147, -0.08606791496276855, 0.5243548154830933, -2.3238704204559326, 0.2843731641769409, -1.3533480167388916, -0.5828129053115845, 0.9763385057449341, 0.46438294649124146, -1.2542346715927124, 0.06275046616792679, -0.4168775975704193, 0.9295759201049805, 0.427895188331604, 1.0566565990447998, -1.6626352071762085, -0.06431376934051514, -0.2970758378505707, 0.11911649256944656, -1.2021671533584595, -1.5245994329452515, 0.613143265247345, 0.5701918601989746, 0.5977548956871033, -0.1373315155506134, 1.0305147171020508, -1.0337607860565186, 0.8240841031074524, -1.0260497331619263, -1.756596565246582, -1.378913164138794, -2.2959208488464355, -2.2406058311462402, 0.8159171342849731, -0.5094394683837891, -0.501425564289093, 2.1415655612945557, -1.0809119939804077, -1.6929080486297607, 1.1061614751815796, 0.2207416296005249, -0.04049333930015564, 2.4151554107666016, 0.17915388941764832, -0.7291577458381653, 0.5063239932060242, -0.7695432901382446, 0.808832585811615, -0.4065670967102051, 1.2624926567077637, 0.3869383931159973, -1.0867822170257568, 1.5867111682891846, -0.3372601270675659, 0.5724596381187439, -0.6939782500267029, -0.5106712579727173, -0.7465106844902039, 0.2651318311691284, 1.8485474586486816, -0.2289237678050995, 1.5427255630493164, -0.23997104167938232, -1.5536729097366333, -1.5719943046569824, 0.8850573897361755, 0.4914364218711853, -0.8610615730285645, 0.13975182175636292, -0.34095776081085205, 0.17449209094047546, 0.00599332619458437, 1.1599653959274292, 1.3712769746780396, 0.7640045881271362, -0.3376973569393158, -0.8207599520683289, 0.11805673688650131, -0.09254981577396393, -0.7127845287322998, -1.7635571956634521, -0.3341522216796875, 0.11980996280908585, 0.6730810403823853, -1.225203037261963, 1.8199341297149658, 0.8777865767478943, 1.9594511985778809, 1.0294735431671143, -0.43715646862983704, 1.4864013195037842, 0.10614029318094254, 1.9016226530075073, -0.4888606667518616, 0.6120801568031311, -0.4808099567890167, -1.183944821357727, 0.8679417371749878, -0.3368346393108368, -2.0079355239868164, -0.6551757454872131, -0.7628642916679382, -0.2043086290359497, -0.7867699265480042, 0.963135838508606, -0.27293479442596436, -1.3583602905273438, 0.2309279441833496, -0.7156093716621399, 0.0832548588514328, -1.3104221820831299, 0.2786487638950348, 0.6856140494346619, -0.6477775573730469, 0.05825887620449066, -0.2986418604850769, -1.2662886381149292, -0.5354655385017395, 0.31805574893951416, 1.8734095096588135, -0.6453982591629028, 1.0082297325134277, 1.0052881240844727, -0.6810356378555298, -0.04006092995405197, 0.40354442596435547, -0.30477508902549744, 0.8450760841369629, -1.0584388971328735, -0.4508672058582306, 1.1698894500732422, -0.2690897285938263, -0.5345425009727478, 1.4043041467666626, 0.674543023109436, -1.039074420928955, -0.19128939509391785, -0.10527822375297546, -0.8176959753036499, 0.016843607649207115, -1.6397981643676758, -0.14552965760231018, 0.4040646553039551, -1.5678573846817017, -0.4159179627895355, -0.14106795191764832, 1.2643978595733643, -0.16114646196365356, 1.3818376064300537, -0.32820427417755127, -0.14495491981506348, -0.4193524718284607, -0.47208350896835327, 0.0632028803229332, -0.17935243248939514, -0.58824622631073, 0.2811368703842163, -0.7298406958580017, 0.2486816942691803, 1.5008447170257568, 0.25001636147499084, 0.049003228545188904, 0.4324149787425995, 1.1035332679748535, 0.3409147560596466, -0.09429416060447693, -0.9184982180595398, -1.5292363166809082, 2.056182622909546, -1.4988515377044678, 2.0050981044769287, 0.7677716016769409, -0.03340397775173187, -1.7759774923324585, -1.8792647123336792, 1.3376439809799194, 1.1017255783081055, 2.346259355545044, 0.5393026471138, 0.43413838744163513, -0.7756599187850952, -0.6947621703147888, 0.3519696891307831, -1.0062119960784912, -0.7295292019844055, 0.11128564178943634, 2.4699058532714844, 1.6379257440567017, -0.39104756712913513, -0.17541593313217163, -1.004709005355835, 1.358156681060791, -0.23121896386146545, 0.20801326632499695, 1.9668967723846436, -0.2985175549983978, -1.0607860088348389, 1.272703766822815, -2.291107416152954, 0.2065572440624237, 2.052083969116211, 0.23174652457237244, 0.07217152416706085, -1.2934976816177368, -0.6720933318138123, -0.2749210000038147, -0.4531280994415283, -1.2611783742904663, 0.4994007349014282, -0.2635314166545868, -0.7847952842712402, -1.3510273694992065, 0.10641144216060638, -1.1000661849975586, -1.6646733283996582, 0.24867215752601624, 1.939522624015808, 2.089876651763916, -0.6962383985519409, 1.510202169418335, -0.34259068965911865, 0.04795602336525917, 1.1986862421035767, 1.2621089220046997, 3.1924495697021484, 1.9041616916656494, -1.320996880531311, 0.6281434893608093, -0.18325933814048767, -0.4221409261226654, 1.1219736337661743, -1.107288122177124, 1.2517322301864624, -0.21113938093185425, -1.3141642808914185, -1.2231611013412476, 0.9596120119094849, 0.38845670223236084, -0.017584800720214844, -0.5384031534194946, 1.2173718214035034, 0.0931115448474884, 1.3242663145065308, 0.6102021932601929, -0.2704028785228729, 0.5669289231300354, -0.39206957817077637, -0.5446276664733887, 1.6671812534332275, 0.19671523571014404, -1.4611233472824097, -2.4035632610321045, -0.20870038866996765, -0.9363303184509277, 0.08318085968494415, -0.6442339420318604, -1.0402851104736328, 1.671098232269287, 0.38719674944877625, -1.175157070159912, -0.2734065651893616, -0.3748323619365692, -0.5333215594291687, 2.7641658782958984, -1.4138168096542358, -0.1708032786846161, -0.9623202085494995, -0.6247113347053528, 1.6467751264572144, -1.2376971244812012, -0.2636711001396179, -1.016124963760376, -0.5288352370262146, -1.2010791301727295, -0.43056803941726685, 0.011785971000790596, -0.9942378401756287, 0.7651652693748474, 0.17070883512496948, -1.257615566253662, -0.32404476404190063, -0.9320735931396484, 0.8875607252120972, -0.11002308875322342, 0.19067922234535217, 1.8437014818191528, 0.3649892807006836, -0.39439135789871216, 0.7847499251365662, 1.2363274097442627, 0.6311460733413696, -0.6315000653266907, 0.1154126301407814, -0.6055008172988892, 0.38042399287223816, -1.2467793226242065, 0.27249446511268616, -2.8316915035247803, 0.6474819779396057, -0.10038726776838303, -0.06388495862483978, -0.07549246400594711, -1.3034700155258179, 1.0602195262908936, 2.538553476333618, -1.10940682888031, 0.5241664052009583, 0.262271523475647, 1.1876647472381592, -1.6245050430297852, 0.2078324854373932, -0.5168574452400208, 2.1713449954986572, 0.1933917999267578, 1.1531683206558228, -0.41414716839790344, -2.3460025787353516, 0.6111453175544739, -1.1528034210205078, -1.047979474067688, 0.8137611150741577, -0.7597584128379822, 0.15002751350402832, -1.3552154302597046, -0.22101673483848572, -0.7736696004867554, -1.1593568325042725, 0.7168423533439636, 0.08056521415710449, 0.5537022948265076, -0.5801250338554382, 0.24891135096549988, -2.228142738342285, -1.3879541158676147, -0.1780475676059723, -0.9241428375244141, 0.521693766117096, -0.38795238733291626, 0.7644398808479309, -0.1780197024345398, -0.044224269688129425, 0.3566429316997528, 1.4971481561660767, 3.3767244815826416, 0.10938920825719833, 0.31055086851119995, -0.3112446367740631, -0.9224401116371155, 1.379450798034668, 0.9348869323730469, -0.11819104105234146, -0.6395048499107361, -1.0434738397598267, 1.310206651687622, 1.9725329875946045, 0.9588571190834045, 0.06872671842575073, -0.8589351773262024, -0.7244816422462463, -0.0005470840260386467, 0.21772143244743347, 0.5319467186927795, 0.8978022336959839, 0.04833206161856651, 0.04906022176146507, 1.406862497329712, 1.1792583465576172, -0.33864396810531616, 0.38081586360931396, -0.8769209980964661, -0.4119926691055298, 0.5050704479217529, 0.3375031054019928, -0.045579440891742706, 0.3694588243961334, -0.9712934494018555, -0.2125048041343689, -0.3289533853530884, -0.8829491138458252, -0.7840235829353333, -0.35306137800216675, -0.41010338068008423, 1.7298166751861572, -0.0009769238531589508, -0.49819445610046387, 0.008428597822785378, -0.7213695645332336, -0.13080820441246033, -1.1062922477722168, 0.27552589774131775, -0.14345774054527283, -0.06175202503800392, -0.11494208872318268, 1.7110463380813599, -0.9977567195892334, -2.0445635318756104, 0.2356146275997162, 0.24153131246566772, -0.2894693911075592, 0.1840062141418457, 1.7038850784301758, 0.5498170256614685, 1.453899621963501, 1.3621633052825928, 0.9709529280662537, -0.6853242516517639, -1.2973766326904297, 0.5881800651550293, 0.9603976607322693, -1.4072657823562622, 0.892475962638855, -0.1418013870716095, -0.5038120150566101, 0.6172845363616943, 1.2869548797607422, 0.44702860713005066, -2.069028615951538, 0.8829668760299683, -0.9672133922576904, 0.8542919754981995, 0.7163958549499512, 0.7635635137557983, 0.24155458807945251, 0.834723949432373, -1.2896760702133179, -1.1656602621078491, -0.6604944467544556, -0.6659576296806335, 1.9175524711608887, -0.3070175051689148, 0.5314043760299683, -0.22834032773971558, -1.3096544742584229, -0.07723280787467957, 0.6656283736228943, 0.395333468914032, -0.4097025394439697, 0.7408462762832642, -0.6568162441253662, -1.0891029834747314, -1.3924756050109863, -0.5308601260185242, -1.0920108556747437, -0.9134849905967712, 1.0625556707382202, 0.7949668765068054, 0.389283686876297, 1.8900737762451172, 0.5894992351531982, 0.27416345477104187, -2.5846805572509766, 0.9334170818328857, 0.3239201009273529, -0.07942306995391846, 0.8797005414962769, 0.39243951439857483, 1.1272122859954834, -0.01693890616297722, 0.5564117431640625, -2.4508914947509766, 2.3063106536865234, -0.2932482361793518, 0.6956323385238647, 0.026586297899484634, -0.07123754918575287, 1.0457878112792969, 0.598286509513855, 0.5152972340583801, -1.0695440769195557, 0.7344087362289429, -0.6019890308380127, 1.2369859218597412, 0.925319254398346, -0.8431218862533569, 0.02423778921365738, 1.330488920211792, 0.4545367658138275, -0.5546255111694336, -0.9504486322402954, -0.8832561373710632, 0.9132266640663147, 1.7715818881988525, -0.010256408713757992, 0.003696633502840996, 0.8204450607299805, 0.6597864031791687, -1.2640727758407593, 0.14653202891349792, -0.6569356918334961, -0.7985612750053406, 1.614854097366333, 1.975488305091858, -0.13864129781723022, -0.14256185293197632, -0.7366679906845093, -1.2860745191574097, 0.83881014585495, -0.009661490097641945, 0.07466322928667068, 0.669658362865448, -0.625506579875946, 1.1118699312210083, 0.7804281711578369, 0.9534170031547546, 0.2507389485836029, 0.2642469108104706, 0.41287127137184143, -0.3013954162597656, -1.1077758073806763, -0.28296396136283875, -1.0478594303131104, -2.5913312435150146, 0.4631679058074951, -0.2968197166919708, -1.4116352796554565, 0.044658176600933075, -0.9839603900909424, 0.8204283714294434, -0.5696126818656921, -1.1118054389953613, -1.495073676109314, 0.23968452215194702, -0.09907201677560806, 0.9454097747802734, -1.6013261079788208, -0.1747678816318512, 1.2216366529464722, 0.9172567129135132, -0.6684387922286987, 1.0097837448120117, 0.2534339427947998, 0.9998809695243835, 0.8868370056152344, -0.432935506105423, 0.48913872241973877, 0.10505163669586182, -1.3067926168441772, 0.4366818368434906, 1.2497154474258423, 0.1549549102783203, 1.4598368406295776, -0.5544998049736023, -0.034218430519104004, 0.4023725092411041, -0.44106170535087585, -0.4484439492225647, -0.6158249378204346, 0.6441171765327454, 0.03817597031593323, -0.9841378927230835, -0.03946275636553764, -0.042860500514507294, -0.26340797543525696, 0.2331971526145935, -1.4317125082015991, -0.10977773368358612, -0.417397677898407, -0.5084346532821655, -1.3534420728683472, -0.1286056935787201, 1.2960965633392334, -0.7219506502151489, -0.11078599095344543, 0.5194166302680969, 0.27108097076416016, 0.48304811120033264, 0.6682916879653931, -0.7524558901786804, -0.3743876516819, -0.264239639043808, -0.39973169565200806, 0.34535592794418335, 1.2728632688522339, -0.0788782462477684, -0.9703186750411987, 0.6611528992652893, -0.2941707670688629, 0.09858402609825134, 1.9838367700576782, 0.0759417936205864, -0.7802110314369202, 0.33970311284065247, -0.7671147584915161, 1.9199883937835693, 1.6713800430297852, 1.2722859382629395, -0.10975518077611923, -1.0191373825073242, 0.7372236847877502, -0.30580130219459534, -0.3837119936943054, 0.8549614548683167, 0.3498775064945221, -0.2650039494037628, -1.469560980796814, 0.6967366933822632, 1.28640615940094, -0.7907854914665222, -0.8401198983192444, 0.10818948596715927, -0.8050243854522705, 1.0475605726242065, 0.6221672892570496, 0.37575235962867737, 0.2788146138191223, 1.6423314809799194, 0.7823514938354492, -0.5142261981964111, 0.5584204792976379, 0.4640417695045471, -0.13561895489692688, -2.0751442909240723, -1.175524115562439, 0.2830902934074402, -0.42498907446861267, -1.5874544382095337, 1.476468801498413, -1.174485445022583, -0.9826219081878662, 0.5913139581680298, 0.14064618945121765, 1.390487790107727, 0.2915685772895813, 1.617550253868103, 2.093027114868164, 0.8698228597640991, 0.4109349548816681, 1.284568190574646, -0.19531509280204773, -0.4139975905418396, 1.7600646018981934, -0.48681461811065674, 0.525636613368988, 1.0901145935058594, -0.33971455693244934, -1.129345178604126, -0.8065661787986755, -1.198561191558838, -0.7947373390197754, 1.1652964353561401, 0.058389149606227875, -1.0439345836639404, 0.27121978998184204, 1.618586778640747, 0.09698769450187683, -0.27649539709091187, 0.6215452551841736, 0.44822803139686584, -0.7556160092353821, -0.1455591320991516, -0.9735867381095886, 0.5804856419563293, -0.1587935984134674, -0.3669027090072632, 0.3023243248462677, 0.45548880100250244, 1.3422142267227173, 0.001597144640982151, 0.06975147128105164, 1.139340877532959, -1.44113290309906, 1.467034935951233, -0.6861541867256165, 0.2967235743999481, -2.3028619289398193, 1.4073163270950317, -0.7802109718322754, 1.9536222219467163, -2.6066646575927734, 0.42938032746315, -0.5540826916694641, -0.5170502662658691, 0.2913126051425934, -0.2538176476955414, 0.19359958171844482, -0.19598782062530518, -1.1242380142211914, -0.04343399778008461, -0.779890775680542, 0.5010204315185547, 1.1672453880310059, 1.4005942344665527, -1.0423927307128906, -0.2801350951194763, -1.6871857643127441, -0.1054425984621048, -0.6265405416488647, 0.23916032910346985, -1.8924052715301514, -0.10056456923484802, -1.9760428667068481, -2.396000623703003, -1.3982956409454346, -0.8113933205604553, 1.1494230031967163, 0.17542564868927002, -0.9186301827430725, 1.294250249862671, -0.3244684040546417, -1.811967372894287, 1.1489454507827759, -2.1198842525482178 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
From https://github.com/huggingface/datasets/pull/3736 the Common Voice dataset now gives access to the local audio files as before
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
16
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 From https://github.com/huggingface/datasets/pull/3736 the Common Voice dataset now gives access to the local audio files as before
[ -1.1766422986984253, -0.8134067058563232, -0.7346804738044739, 1.4860891103744507, -0.1210813820362091, -1.2292580604553223, 0.13880497217178345, -0.9748915433883667, 1.6050442457199097, -0.816304087638855, 0.32475560903549194, -1.6735010147094727, 0.01942441426217556, -0.6484355330467224, -0.7403732538223267, -0.8588516712188721, -0.3266942501068115, -0.7001670002937317, 1.0341893434524536, 2.430299758911133, 1.2449513673782349, -1.3633719682693481, 2.739356756210327, 0.6609367728233337, -0.3014777898788452, -0.9622536301612854, 0.4782955050468445, -0.0003395862877368927, -1.301386833190918, -0.4348471760749817, -0.932645320892334, -0.03743986785411835, -0.6122324466705322, -0.4617389440536499, 0.026648640632629395, 0.3903833031654358, -0.3284168839454651, -0.3472713232040405, -0.6020671725273132, -0.8438242077827454, 0.4162464737892151, -0.35046255588531494, 0.9672462940216064, -0.2843140959739685, 1.7663519382476807, -0.6755226254463196, 0.47653645277023315, 0.6983726620674133, 1.2747538089752197, 0.26230061054229736, 0.018638934940099716, 0.368305504322052, 0.3574550747871399, 0.0019947709515690804, 0.5636317133903503, 1.1347211599349976, 0.6840717196464539, 0.49844473600387573, 0.7189543843269348, -2.1821115016937256, 1.381089210510254, -0.97575443983078, 0.20566138625144958, 1.3379406929016113, -0.9638292789459229, 0.3164139986038208, -1.7574101686477661, -0.13032928109169006, 0.5237218141555786, -2.289222002029419, 0.259352445602417, -1.3630071878433228, -0.5797982215881348, 1.0262306928634644, 0.4638803005218506, -1.2571957111358643, 0.0733771026134491, -0.43681395053863525, 0.9415280222892761, 0.4175404906272888, 1.0653455257415771, -1.6252474784851074, -0.08022402226924896, -0.28009337186813354, 0.10222189873456955, -1.2125834226608276, -1.5295649766921997, 0.5927683711051941, 0.5349052548408508, 0.641732394695282, -0.141496479511261, 1.0190075635910034, -1.0675113201141357, 0.8507451415061951, -1.060077428817749, -1.7554259300231934, -1.380130410194397, -2.348001480102539, -2.298872709274292, 0.8537359833717346, -0.46683841943740845, -0.4855087995529175, 2.107839584350586, -1.0768516063690186, -1.6753695011138916, 1.0955610275268555, 0.24060975015163422, -0.03227217495441437, 2.4091296195983887, 0.18903446197509766, -0.7617076635360718, 0.5049792528152466, -0.7794775366783142, 0.810390830039978, -0.38768261671066284, 1.2713916301727295, 0.43274223804473877, -1.1025992631912231, 1.5775518417358398, -0.3190549612045288, 0.5616409778594971, -0.701196014881134, -0.5066409111022949, -0.7580714225769043, 0.2615865468978882, 1.8355056047439575, -0.24650242924690247, 1.5621756315231323, -0.2340279221534729, -1.5543136596679688, -1.5296679735183716, 0.8526998162269592, 0.4813128709793091, -0.8415991067886353, 0.06921012699604034, -0.3232309818267822, 0.15329276025295258, 0.0018040584400296211, 1.165412425994873, 1.3324387073516846, 0.7429388761520386, -0.3617141842842102, -0.8125734329223633, 0.12027686834335327, -0.09274550527334213, -0.7034047842025757, -1.7506355047225952, -0.3382330536842346, 0.1704133152961731, 0.6568901538848877, -1.2468070983886719, 1.8286257982254028, 0.8755600452423096, 1.9466156959533691, 1.0283520221710205, -0.43402689695358276, 1.4821540117263794, 0.09526669234037399, 1.9121487140655518, -0.5022007822990417, 0.5947021842002869, -0.4514397382736206, -1.185761570930481, 0.8488607406616211, -0.334405779838562, -2.027988910675049, -0.6991910338401794, -0.7595129013061523, -0.1898517906665802, -0.7792431712150574, 0.965922474861145, -0.30169224739074707, -1.3950297832489014, 0.19778378307819366, -0.7087372541427612, 0.10004053264856339, -1.2876547574996948, 0.22252540290355682, 0.6839756369590759, -0.6484418511390686, 0.038773249834775925, -0.2862665057182312, -1.2470929622650146, -0.5305277109146118, 0.3590105175971985, 1.855549693107605, -0.6317996978759766, 1.0254688262939453, 1.019400954246521, -0.6929459571838379, -0.0025252909399569035, 0.36925578117370605, -0.3277941346168518, 0.8721159100532532, -1.0556297302246094, -0.4843885898590088, 1.1653263568878174, -0.2663196921348572, -0.5648468136787415, 1.426627516746521, 0.7302332520484924, -1.0310100317001343, -0.2100641280412674, -0.11445540934801102, -0.8391284942626953, 0.0204803217202425, -1.614008903503418, -0.18138840794563293, 0.4108527898788452, -1.551418662071228, -0.36813074350357056, -0.1377796083688736, 1.2812371253967285, -0.1831512749195099, 1.3891137838363647, -0.32155436277389526, -0.1725972592830658, -0.3927608132362366, -0.49051886796951294, 0.08262211829423904, -0.1580597162246704, -0.5842734575271606, 0.30522406101226807, -0.7453396916389465, 0.25677335262298584, 1.5048922300338745, 0.27152544260025024, 0.046743713319301605, 0.44600486755371094, 1.098394513130188, 0.3517458438873291, -0.09203589707612991, -0.9169497489929199, -1.5535815954208374, 2.07138991355896, -1.4631192684173584, 1.993725299835205, 0.7725937962532043, -0.03655724972486496, -1.7882132530212402, -1.8532955646514893, 1.3412717580795288, 1.0901035070419312, 2.3750557899475098, 0.5178366303443909, 0.444633424282074, -0.7648511528968811, -0.7196122407913208, 0.3541112542152405, -0.9992682337760925, -0.6922272443771362, 0.12571625411510468, 2.471713066101074, 1.658925175666809, -0.3735319972038269, -0.18728509545326233, -1.0088062286376953, 1.362566351890564, -0.25622832775115967, 0.21596480906009674, 1.99387788772583, -0.27479445934295654, -1.037631869316101, 1.2861535549163818, -2.2881686687469482, 0.2204999327659607, 2.080246686935425, 0.26802313327789307, 0.04101072624325752, -1.3423453569412231, -0.6669869422912598, -0.2945560812950134, -0.4720720052719116, -1.2889392375946045, 0.4896867275238037, -0.25244200229644775, -0.8159189224243164, -1.3333653211593628, 0.05991419404745102, -1.1354924440383911, -1.6910609006881714, 0.290652871131897, 1.9098341464996338, 2.0694730281829834, -0.7141883373260498, 1.4786733388900757, -0.29789942502975464, 0.07338536530733109, 1.227556586265564, 1.2707691192626953, 3.189418077468872, 1.8742235898971558, -1.3228600025177002, 0.6694601774215698, -0.18756788969039917, -0.42980527877807617, 1.1147228479385376, -1.1123924255371094, 1.2193986177444458, -0.2371269166469574, -1.327744483947754, -1.246641755104065, 0.9954565763473511, 0.4121641516685486, 0.00041978899389505386, -0.5650161504745483, 1.1999973058700562, 0.11863531172275543, 1.29262375831604, 0.6273891925811768, -0.2773169279098511, 0.542966902256012, -0.3853175640106201, -0.5599848628044128, 1.6705797910690308, 0.17328406870365143, -1.4999604225158691, -2.3881869316101074, -0.21782338619232178, -0.9268162250518799, 0.009885475039482117, -0.6385807991027832, -1.0196588039398193, 1.659010887145996, 0.40134167671203613, -1.1894294023513794, -0.2528955340385437, -0.3642144203186035, -0.5267062187194824, 2.7893242835998535, -1.3790686130523682, -0.1496715098619461, -0.9930592179298401, -0.6278001666069031, 1.6587294340133667, -1.1948509216308594, -0.26189565658569336, -0.9959267973899841, -0.5725784301757812, -1.2137292623519897, -0.4487636089324951, 0.021124962717294693, -0.9821217656135559, 0.7470486164093018, 0.12300729751586914, -1.202690839767456, -0.3137916326522827, -0.9214491844177246, 0.9166178703308105, -0.12584444880485535, 0.16781476140022278, 1.8189581632614136, 0.3530392050743103, -0.3648418188095093, 0.7829264402389526, 1.2330546379089355, 0.6618882417678833, -0.637504518032074, 0.10757122933864594, -0.6338015794754028, 0.32676011323928833, -1.249584674835205, 0.2584931254386902, -2.8637399673461914, 0.6259996891021729, -0.14182449877262115, -0.09189262241125107, -0.08978806436061859, -1.2735298871994019, 1.0921289920806885, 2.519700765609741, -1.0992406606674194, 0.5095956921577454, 0.28652477264404297, 1.1551097631454468, -1.6301612854003906, 0.2165812999010086, -0.5385742783546448, 2.127718210220337, 0.20670954883098602, 1.1432435512542725, -0.4473816156387329, -2.2784245014190674, 0.6242608428001404, -1.1681303977966309, -1.0278050899505615, 0.8240455985069275, -0.7728116512298584, 0.24003303050994873, -1.3487744331359863, -0.21549472212791443, -0.7794082760810852, -1.1974728107452393, 0.6710735559463501, 0.06869885325431824, 0.5248115658760071, -0.531829833984375, 0.26569753885269165, -2.2287042140960693, -1.4055484533309937, -0.16166964173316956, -0.9490215182304382, 0.5253048539161682, -0.41237080097198486, 0.7245065569877625, -0.14874696731567383, -0.037980400025844574, 0.334106981754303, 1.4846066236495972, 3.376493453979492, 0.131310373544693, 0.30417513847351074, -0.24583670496940613, -0.9420754313468933, 1.4008021354675293, 0.9458656311035156, -0.10983958840370178, -0.6424110531806946, -1.0276210308074951, 1.3233842849731445, 1.9776300191879272, 1.0250210762023926, 0.08221983909606934, -0.8356362581253052, -0.7617435455322266, 0.03260795399546623, 0.2082315981388092, 0.5313611030578613, 0.882419228553772, 0.02531856670975685, 0.04395884647965431, 1.4306412935256958, 1.2044026851654053, -0.3342967629432678, 0.34354865550994873, -0.9055261611938477, -0.3834623098373413, 0.4796168804168701, 0.28404533863067627, -0.03895149007439613, 0.41445761919021606, -1.0266385078430176, -0.23486392199993134, -0.34461158514022827, -0.9044253826141357, -0.7816535234451294, -0.36714452505111694, -0.4339619278907776, 1.713948130607605, -0.007863664999604225, -0.4975751042366028, 0.01305796392261982, -0.722821831703186, -0.12980106472969055, -1.0953233242034912, 0.2955453395843506, -0.12824279069900513, -0.04664049670100212, -0.15149685740470886, 1.7452046871185303, -1.03664231300354, -2.0687127113342285, 0.19952696561813354, 0.23466645181179047, -0.28213709592819214, 0.15694500505924225, 1.7027100324630737, 0.5455378293991089, 1.4175716638565063, 1.3571785688400269, 0.9505325555801392, -0.6521301865577698, -1.2896075248718262, 0.5912030339241028, 0.9889496564865112, -1.386808156967163, 0.8917938470840454, -0.1934928297996521, -0.5011770725250244, 0.6584956645965576, 1.3057860136032104, 0.4130992293357849, -2.04664945602417, 0.8553109169006348, -0.9482084512710571, 0.8437264561653137, 0.7003830671310425, 0.7514130473136902, 0.23043951392173767, 0.827266275882721, -1.3026008605957031, -1.1600881814956665, -0.641913890838623, -0.6486580967903137, 1.914049506187439, -0.2841542959213257, 0.5580605268478394, -0.23551055788993835, -1.2855544090270996, -0.047463055700063705, 0.7036538124084473, 0.38641440868377686, -0.44381314516067505, 0.7787615656852722, -0.6217844486236572, -1.040380597114563, -1.4019827842712402, -0.5036922693252563, -1.1011734008789062, -0.9038851857185364, 1.0493532419204712, 0.7736893892288208, 0.41345131397247314, 1.884069561958313, 0.5974484086036682, 0.315854549407959, -2.576026678085327, 0.9257553219795227, 0.29638969898223877, -0.052206844091415405, 0.8775482177734375, 0.3448731303215027, 1.1273574829101562, -0.024186771363019943, 0.5551692843437195, -2.4216301441192627, 2.2973899841308594, -0.2802314758300781, 0.6810685396194458, 0.023791499435901642, -0.07871529459953308, 1.093217134475708, 0.5883802771568298, 0.5366222858428955, -1.0983214378356934, 0.7341630458831787, -0.5619375705718994, 1.199619174003601, 0.910600483417511, -0.8554906249046326, -0.00715473759919405, 1.3542252779006958, 0.4572533965110779, -0.4935109615325928, -0.948103666305542, -0.8835470080375671, 0.9152229428291321, 1.7276304960250854, -0.0012203194200992584, -0.020473537966609, 0.8763659000396729, 0.645971953868866, -1.2697926759719849, 0.13495226204395294, -0.640773594379425, -0.752129852771759, 1.6582971811294556, 1.9977798461914062, -0.12821821868419647, -0.15834985673427582, -0.7320876121520996, -1.2613760232925415, 0.795108437538147, -0.037720441818237305, 0.079814612865448, 0.6726107001304626, -0.6354739665985107, 1.133284568786621, 0.7860367298126221, 0.94593745470047, 0.19308191537857056, 0.2399895340204239, 0.37708580493927, -0.287289559841156, -1.1645667552947998, -0.3286837339401245, -1.043663501739502, -2.5884509086608887, 0.45816218852996826, -0.2913617491722107, -1.4301376342773438, 0.08822234719991684, -1.0180158615112305, 0.8240954279899597, -0.5743305087089539, -1.1186407804489136, -1.5000176429748535, 0.2875329256057739, -0.12843379378318787, 0.9516165256500244, -1.6199527978897095, -0.1708189845085144, 1.231276512145996, 0.8783959150314331, -0.63027024269104, 0.9939312934875488, 0.23905763030052185, 0.986215353012085, 0.8512068390846252, -0.42737752199172974, 0.5116710662841797, 0.13405364751815796, -1.3430454730987549, 0.4390246272087097, 1.2456034421920776, 0.1568119078874588, 1.4724756479263306, -0.5394216179847717, 0.016504526138305664, 0.4262862205505371, -0.497692346572876, -0.4500458240509033, -0.5976096391677856, 0.6619187593460083, 0.0408218577504158, -1.0029737949371338, -0.04638262465596199, -0.02986294776201248, -0.28459632396698, 0.21453163027763367, -1.4274933338165283, -0.13321137428283691, -0.41005754470825195, -0.5342735648155212, -1.3555288314819336, -0.09466680884361267, 1.2589566707611084, -0.7694942951202393, -0.13694794476032257, 0.5196927785873413, 0.2603868842124939, 0.49882936477661133, 0.6775417923927307, -0.7619346380233765, -0.3476371169090271, -0.2634999752044678, -0.36223024129867554, 0.3412019610404968, 1.248782992362976, -0.08218414336442947, -0.9753135442733765, 0.671181321144104, -0.3150559067726135, 0.12497009336948395, 2.0124874114990234, 0.05511852353811264, -0.7758076786994934, 0.38491660356521606, -0.7654780149459839, 1.8998342752456665, 1.664474606513977, 1.3038502931594849, -0.07762487232685089, -0.9871455430984497, 0.7108235359191895, -0.2990816831588745, -0.38513094186782837, 0.8642727136611938, 0.33667129278182983, -0.2458644062280655, -1.4184036254882812, 0.6693444848060608, 1.29654061794281, -0.8049273490905762, -0.8246327638626099, 0.1465819627046585, -0.8313599228858948, 1.0849013328552246, 0.5937997102737427, 0.36913758516311646, 0.271862268447876, 1.6119673252105713, 0.7810587882995605, -0.49222332239151, 0.5291354656219482, 0.4913479685783386, -0.14491400122642517, -2.071772575378418, -1.1308647394180298, 0.3086380958557129, -0.4665685296058655, -1.5969384908676147, 1.444872498512268, -1.1684746742248535, -0.9724364876747131, 0.617132842540741, 0.14194980263710022, 1.399726152420044, 0.3155639171600342, 1.6256200075149536, 2.0801379680633545, 0.8630843162536621, 0.389981746673584, 1.2896894216537476, -0.16519170999526978, -0.4362402558326721, 1.7828059196472168, -0.5018088817596436, 0.5581820011138916, 1.0624041557312012, -0.3629370927810669, -1.1477444171905518, -0.7854487895965576, -1.177310824394226, -0.7419854402542114, 1.1762826442718506, 0.08440861850976944, -1.0319321155548096, 0.24365784227848053, 1.5999337434768677, 0.08699491620063782, -0.273029088973999, 0.614090621471405, 0.40083378553390503, -0.7276728749275208, -0.13798198103904724, -0.960099995136261, 0.5727407932281494, -0.1390252262353897, -0.3482512831687927, 0.2670120596885681, 0.4721028208732605, 1.3251410722732544, -0.011737726628780365, 0.0934523418545723, 1.1643962860107422, -1.4569944143295288, 1.4862730503082275, -0.6959311962127686, 0.3275819420814514, -2.3038151264190674, 1.370600700378418, -0.789390504360199, 1.9368952512741089, -2.606858491897583, 0.4301624894142151, -0.5537585616111755, -0.549814760684967, 0.2759671211242676, -0.27893149852752686, 0.19018501043319702, -0.17991116642951965, -1.11443293094635, -0.05969401076436043, -0.8114118576049805, 0.4990089535713196, 1.1933425664901733, 1.3999662399291992, -1.054192066192627, -0.2959941625595093, -1.6839433908462524, -0.12046866118907928, -0.6249333024024963, 0.26526981592178345, -1.8974345922470093, -0.05934741348028183, -1.9538654088974, -2.41935396194458, -1.4166247844696045, -0.8267856240272522, 1.1299307346343994, 0.19088923931121826, -0.9355276823043823, 1.275933861732483, -0.337394118309021, -1.8061327934265137, 1.1529370546340942, -2.147783041000366 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?). Regardless of whether it is a breaking change, however, I don't see the other arguments. > but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files I don't exactly understand this. Why not? Why does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent? But even if you just provide the raw bytes to TF, on TF you could just use sth like `tfio.audio.decode_mp3` or `tf.audio.decode_ogg` or `tfio.audio.decode_flac`? > There are the following reasons why it is paramount to have access to the original audio file in my opinion ... I don't really understand the arguments (despite that it maybe breaks existing code). You anyway have the original audio files but it is just embedded in the dataset? I don't really know about any library which cannot also load the audio from memory (i.e. from the dataset). Btw, on librosa being slow for decoding audio files, I saw that as well, so we have this comment RETURNN: > Don't use librosa.load which internally uses audioread which would use Gstreamer as a backend which has multiple issues: > https://github.com/beetbox/audioread/issues/62 > https://github.com/beetbox/audioread/issues/63 > Instead, use PySoundFile (soundfile), which is also faster. See here for discussions: > https://github.com/beetbox/audioread/issues/64 > https://github.com/librosa/librosa/issues/681 Resampling is also a separate aspect, which is also less straightforward and with different compromises between speed and quality. So there the different tradeoffs and different implementations can make a difference. However, I don't see how this is related to the question whether there should be the raw bytes inside the dataset or as separate local files.
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
336
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?). Regardless of whether it is a breaking change, however, I don't see the other arguments. > but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files I don't exactly understand this. Why not? Why does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent? But even if you just provide the raw bytes to TF, on TF you could just use sth like `tfio.audio.decode_mp3` or `tf.audio.decode_ogg` or `tfio.audio.decode_flac`? > There are the following reasons why it is paramount to have access to the original audio file in my opinion ... I don't really understand the arguments (despite that it maybe breaks existing code). You anyway have the original audio files but it is just embedded in the dataset? I don't really know about any library which cannot also load the audio from memory (i.e. from the dataset). Btw, on librosa being slow for decoding audio files, I saw that as well, so we have this comment RETURNN: > Don't use librosa.load which internally uses audioread which would use Gstreamer as a backend which has multiple issues: > https://github.com/beetbox/audioread/issues/62 > https://github.com/beetbox/audioread/issues/63 > Instead, use PySoundFile (soundfile), which is also faster. See here for discussions: > https://github.com/beetbox/audioread/issues/64 > https://github.com/librosa/librosa/issues/681 Resampling is also a separate aspect, which is also less straightforward and with different compromises between speed and quality. So there the different tradeoffs and different implementations can make a difference. However, I don't see how this is related to the question whether there should be the raw bytes inside the dataset or as separate local files.
[ -1.189786672592163, -0.8113566040992737, -0.7218737602233887, 1.4523447751998901, -0.1317829191684723, -1.243444800376892, 0.15147900581359863, -1.011496663093567, 1.6505309343338013, -0.850271999835968, 0.33987244963645935, -1.6613706350326538, 0.05998244136571884, -0.6576784253120422, -0.7613171339035034, -0.8373986482620239, -0.3469306528568268, -0.733360767364502, 1.0430266857147217, 2.4544575214385986, 1.2470073699951172, -1.3753976821899414, 2.737396717071533, 0.6863980293273926, -0.3044731914997101, -0.9416776895523071, 0.42379528284072876, -0.0379120297729969, -1.2877204418182373, -0.4434872567653656, -0.9387924075126648, -0.054607030004262924, -0.6141089200973511, -0.49489402770996094, -0.012920298613607883, 0.3947893977165222, -0.3226553499698639, -0.3836459815502167, -0.5890102386474609, -0.8341825008392334, 0.4367345869541168, -0.38647040724754333, 0.9723408222198486, -0.2887880504131317, 1.7851370573043823, -0.6474707722663879, 0.47828373312950134, 0.7091352939605713, 1.29380202293396, 0.24578042328357697, 0.02394774928689003, 0.3617594540119171, 0.3525661826133728, -0.015841100364923477, 0.5461103916168213, 1.150235652923584, 0.6875419020652771, 0.48220187425613403, 0.7407639622688293, -2.1805787086486816, 1.3801662921905518, -0.9740854501724243, 0.2407894879579544, 1.2900313138961792, -0.9612106680870056, 0.2976704239845276, -1.7338858842849731, -0.1143912523984909, 0.5480332970619202, -2.273482322692871, 0.27638474106788635, -1.336918592453003, -0.5874353647232056, 1.0067229270935059, 0.4499146342277527, -1.2587919235229492, 0.08435875177383423, -0.4191674292087555, 0.9396654963493347, 0.4266594648361206, 1.0563695430755615, -1.6135632991790771, -0.0853089764714241, -0.2689005434513092, 0.1313330978155136, -1.2501546144485474, -1.5236895084381104, 0.6131415963172913, 0.5621641278266907, 0.6314650177955627, -0.13354963064193726, 1.049825668334961, -1.0610028505325317, 0.8396022915840149, -1.0525034666061401, -1.7641466856002808, -1.3799580335617065, -2.3297383785247803, -2.274060010910034, 0.8235722184181213, -0.47032567858695984, -0.5247463583946228, 2.1171374320983887, -1.0780434608459473, -1.6849108934402466, 1.096797227859497, 0.24232979118824005, -0.051983922719955444, 2.4058055877685547, 0.1791684627532959, -0.7626047134399414, 0.5104721188545227, -0.7842420935630798, 0.812221884727478, -0.41790956258773804, 1.2646641731262207, 0.3872680962085724, -1.1007179021835327, 1.5544569492340088, -0.3383125364780426, 0.5793642997741699, -0.6950029730796814, -0.5049157738685608, -0.7718411087989807, 0.2892105281352997, 1.8132359981536865, -0.2201462984085083, 1.5333200693130493, -0.266932874917984, -1.5603020191192627, -1.5922532081604004, 0.8654439449310303, 0.4604320824146271, -0.8153706192970276, 0.12927979230880737, -0.3708658516407013, 0.1565973162651062, -0.006689394824206829, 1.1428061723709106, 1.34612238407135, 0.7540864944458008, -0.32774031162261963, -0.8378103375434875, 0.12873756885528564, -0.12709259986877441, -0.7046528458595276, -1.7480489015579224, -0.32753199338912964, 0.13680924475193024, 0.6392709016799927, -1.207898736000061, 1.8371740579605103, 0.8838310837745667, 1.967851996421814, 1.0510398149490356, -0.39290952682495117, 1.5085161924362183, 0.09529974311590195, 1.8728381395339966, -0.5059972405433655, 0.6067652702331543, -0.44685032963752747, -1.1640554666519165, 0.8304730653762817, -0.36593925952911377, -2.043245315551758, -0.6801658868789673, -0.7442280650138855, -0.2034757137298584, -0.7712512016296387, 0.9648880958557129, -0.27728715538978577, -1.3801109790802002, 0.2277100533246994, -0.7082463502883911, 0.08957602083683014, -1.2511214017868042, 0.27988651394844055, 0.6982690691947937, -0.6409952044487, 0.06226107478141785, -0.30214694142341614, -1.245632290840149, -0.49049094319343567, 0.34090134501457214, 1.8621176481246948, -0.6664884090423584, 0.9757099151611328, 1.0326591730117798, -0.6627489924430847, -0.023048914968967438, 0.39423689246177673, -0.31388869881629944, 0.8437799215316772, -1.0362449884414673, -0.43972262740135193, 1.1832383871078491, -0.2571706473827362, -0.5598685145378113, 1.4276882410049438, 0.6972473859786987, -1.024657130241394, -0.1444149911403656, -0.11618483066558838, -0.8474262356758118, 0.015080816112458706, -1.6131067276000977, -0.17259815335273743, 0.41534894704818726, -1.5554734468460083, -0.3890169858932495, -0.1365216225385666, 1.2377849817276, -0.15503495931625366, 1.3972641229629517, -0.3492758274078369, -0.15675534307956696, -0.36376962065696716, -0.4353961646556854, 0.07218407839536667, -0.19363819062709808, -0.585695207118988, 0.2399698793888092, -0.7427251935005188, 0.27359017729759216, 1.4820691347122192, 0.2609111964702606, 0.05575171858072281, 0.4443296492099762, 1.1011848449707031, 0.3410414755344391, -0.09378606081008911, -0.8793622255325317, -1.5389752388000488, 2.0551016330718994, -1.4536232948303223, 2.003894329071045, 0.8049099445343018, -0.014274286106228828, -1.785187840461731, -1.8433257341384888, 1.3297717571258545, 1.1000114679336548, 2.359741449356079, 0.5304064750671387, 0.41291770339012146, -0.7924297451972961, -0.6954094171524048, 0.36935845017433167, -1.0111174583435059, -0.691826343536377, 0.09316553175449371, 2.4919888973236084, 1.696600079536438, -0.378753662109375, -0.17392486333847046, -1.0140841007232666, 1.4132479429244995, -0.2484205812215805, 0.20544105768203735, 1.998556137084961, -0.29054176807403564, -1.01528799533844, 1.2913904190063477, -2.310337543487549, 0.20626631379127502, 2.061044454574585, 0.233074352145195, 0.05424822121858597, -1.3151036500930786, -0.6405307054519653, -0.2909647226333618, -0.4557092785835266, -1.2719364166259766, 0.5025849342346191, -0.24728818237781525, -0.7980351448059082, -1.3525406122207642, 0.11466837674379349, -1.123127818107605, -1.6550475358963013, 0.27010390162467957, 1.9012526273727417, 2.0873379707336426, -0.6975722312927246, 1.5140732526779175, -0.2997943162918091, 0.08719264715909958, 1.207099199295044, 1.2741420269012451, 3.2144882678985596, 1.8707128763198853, -1.3090989589691162, 0.6261155009269714, -0.19466795027256012, -0.44404351711273193, 1.0932471752166748, -1.1462323665618896, 1.250827431678772, -0.18635718524456024, -1.2826347351074219, -1.2270138263702393, 0.9743602275848389, 0.42871883511543274, 0.011892762966454029, -0.5389689803123474, 1.2027305364608765, 0.1149262860417366, 1.3061269521713257, 0.6118420958518982, -0.2600114345550537, 0.5552161335945129, -0.3893924951553345, -0.5602434277534485, 1.6399723291397095, 0.2194400131702423, -1.4446771144866943, -2.3480637073516846, -0.18775174021720886, -0.9088510274887085, 0.06299299746751785, -0.6370972990989685, -1.020999789237976, 1.6731756925582886, 0.3757786452770233, -1.1904462575912476, -0.23721815645694733, -0.3551636338233948, -0.5572925209999084, 2.753981113433838, -1.3770679235458374, -0.18482623994350433, -0.9979521632194519, -0.6185934543609619, 1.6443138122558594, -1.2325174808502197, -0.2619013488292694, -1.02352774143219, -0.5644697546958923, -1.1801788806915283, -0.4663126766681671, -0.007242943625897169, -0.9646095037460327, 0.7835027575492859, 0.1844804883003235, -1.2350915670394897, -0.3163837790489197, -0.9336298704147339, 0.8882324695587158, -0.1259855479001999, 0.17489318549633026, 1.8085370063781738, 0.35453200340270996, -0.40254661440849304, 0.7884889245033264, 1.234720230102539, 0.6214778423309326, -0.633959949016571, 0.1015242412686348, -0.6569728255271912, 0.3643640875816345, -1.2375872135162354, 0.28549453616142273, -2.8742401599884033, 0.6295263171195984, -0.1143457293510437, -0.10056647658348083, -0.08546972274780273, -1.308715581893921, 1.0760447978973389, 2.5582900047302246, -1.0859318971633911, 0.5259312391281128, 0.27796000242233276, 1.1874184608459473, -1.6279547214508057, 0.24145548045635223, -0.534924328327179, 2.1245622634887695, 0.1998172253370285, 1.1485003232955933, -0.4563344717025757, -2.3382792472839355, 0.6154834628105164, -1.1686820983886719, -1.0544711351394653, 0.8232415318489075, -0.8115118145942688, 0.1926078051328659, -1.3394300937652588, -0.23247000575065613, -0.7699360847473145, -1.1773825883865356, 0.6712133884429932, 0.09280551970005035, 0.5367058515548706, -0.5658752918243408, 0.258760541677475, -2.2213499546051025, -1.3988099098205566, -0.15720082819461823, -0.9219204783439636, 0.5180244445800781, -0.4056590795516968, 0.720940351486206, -0.15790176391601562, -0.05310339853167534, 0.34126394987106323, 1.4762319326400757, 3.355677604675293, 0.12752412259578705, 0.33339858055114746, -0.2694288194179535, -0.9221667051315308, 1.374821424484253, 0.9094310402870178, -0.10736735910177231, -0.6457171440124512, -1.0381337404251099, 1.310528039932251, 1.9767087697982788, 0.9759635925292969, 0.06165435165166855, -0.8226117491722107, -0.7451751828193665, 0.006612583063542843, 0.19646400213241577, 0.540357232093811, 0.9104120135307312, 0.02463243529200554, 0.058930352330207825, 1.415659785270691, 1.2010984420776367, -0.3671843707561493, 0.35577577352523804, -0.869078516960144, -0.4117175340652466, 0.47690117359161377, 0.2838832437992096, -0.0508863739669323, 0.37974783778190613, -1.0005667209625244, -0.22737467288970947, -0.3536580204963684, -0.862251877784729, -0.7850201725959778, -0.394359290599823, -0.40217724442481995, 1.7261173725128174, 0.01964709907770157, -0.49843311309814453, 0.008510389365255833, -0.7402849793434143, -0.11031263321638107, -1.0920982360839844, 0.2734062671661377, -0.11403488367795944, -0.0876542255282402, -0.10989532619714737, 1.7509745359420776, -0.9971967339515686, -2.057600498199463, 0.22795021533966064, 0.22117862105369568, -0.24869008362293243, 0.15691113471984863, 1.6816409826278687, 0.5652683973312378, 1.456031322479248, 1.3531593084335327, 0.9527194499969482, -0.6674538254737854, -1.2975269556045532, 0.6260309219360352, 0.9792592525482178, -1.3951143026351929, 0.8874262571334839, -0.1177254468202591, -0.5114515423774719, 0.6601608395576477, 1.2865593433380127, 0.44516775012016296, -2.067002296447754, 0.8632120490074158, -1.0084593296051025, 0.8600290417671204, 0.7132591605186462, 0.6927176713943481, 0.25503289699554443, 0.836963951587677, -1.2710570096969604, -1.1850061416625977, -0.6757855415344238, -0.6896858215332031, 1.9356435537338257, -0.31000185012817383, 0.5761666893959045, -0.21802465617656708, -1.3432523012161255, -0.06845875084400177, 0.6896538138389587, 0.3689131736755371, -0.4443364441394806, 0.7606754899024963, -0.6591215133666992, -1.0736597776412964, -1.4255592823028564, -0.5157417058944702, -1.1003655195236206, -0.9121299982070923, 1.0721290111541748, 0.7973170280456543, 0.3732234239578247, 1.8856818675994873, 0.6346358060836792, 0.28676867485046387, -2.550713062286377, 0.9241536855697632, 0.32596513628959656, -0.06383208930492401, 0.8515270948410034, 0.37834522128105164, 1.0763270854949951, -0.005405486561357975, 0.5532439947128296, -2.462752342224121, 2.3013455867767334, -0.26279252767562866, 0.7013785243034363, 0.008158358745276928, -0.09943996369838715, 1.0873957872390747, 0.584611177444458, 0.5405551791191101, -1.0689057111740112, 0.7151303887367249, -0.5617495775222778, 1.2388285398483276, 0.9120294451713562, -0.8370718359947205, 0.0033165905624628067, 1.3375897407531738, 0.4286293685436249, -0.539995551109314, -0.9350543022155762, -0.9286285042762756, 0.9037032723426819, 1.7542104721069336, 0.009994746185839176, 0.006187879480421543, 0.8541148900985718, 0.6703348755836487, -1.2698898315429688, 0.10816831141710281, -0.6608561873435974, -0.773932695388794, 1.6667660474777222, 2.0390520095825195, -0.16309714317321777, -0.1497291475534439, -0.7260066270828247, -1.2650365829467773, 0.8278270363807678, -0.006551578640937805, 0.06722340732812881, 0.6347032189369202, -0.6228322982788086, 1.11851966381073, 0.8228563666343689, 0.9202631711959839, 0.22568999230861664, 0.22025921940803528, 0.3914463222026825, -0.31770867109298706, -1.1274518966674805, -0.3058905601501465, -1.042612075805664, -2.58510160446167, 0.44834235310554504, -0.2521834373474121, -1.4403012990951538, 0.07434815913438797, -0.9965588450431824, 0.8282368183135986, -0.544033408164978, -1.0900055170059204, -1.5045015811920166, 0.2695351541042328, -0.10908420383930206, 0.9543454051017761, -1.6001290082931519, -0.15038879215717316, 1.2041573524475098, 0.8840364813804626, -0.6461251974105835, 1.0038565397262573, 0.24966831505298615, 0.981070339679718, 0.8952704071998596, -0.45995455980300903, 0.4924601912498474, 0.11793137341737747, -1.352981448173523, 0.4323064982891083, 1.25876784324646, 0.12269357591867447, 1.4775148630142212, -0.5215703248977661, -0.01701253652572632, 0.4059300720691681, -0.4965216815471649, -0.43933722376823425, -0.5695773363113403, 0.6707115769386292, 0.05471359193325043, -0.9769254326820374, -0.03387824818491936, -0.01768326386809349, -0.3136333227157593, 0.2009473592042923, -1.4497685432434082, -0.1148190125823021, -0.4089406132698059, -0.5610798001289368, -1.360660195350647, -0.09215322881937027, 1.306666374206543, -0.7590698003768921, -0.14878708124160767, 0.48634156584739685, 0.30070310831069946, 0.4885382354259491, 0.6933891177177429, -0.7609500885009766, -0.35264745354652405, -0.2418437898159027, -0.35520583391189575, 0.33045655488967896, 1.2911043167114258, -0.07085045427083969, -0.9606237411499023, 0.6844494342803955, -0.32842424511909485, 0.10161086171865463, 1.9675716161727905, 0.09938281774520874, -0.7788724899291992, 0.3581063151359558, -0.8207311630249023, 1.8996716737747192, 1.6833020448684692, 1.289110779762268, -0.057737674564123154, -1.0149433612823486, 0.7061008810997009, -0.2976970076560974, -0.39887434244155884, 0.8807069063186646, 0.3279145658016205, -0.27425506711006165, -1.4240202903747559, 0.6847675442695618, 1.265526294708252, -0.8011911511421204, -0.8574865460395813, 0.12081270664930344, -0.8278517127037048, 1.0995962619781494, 0.61683189868927, 0.3824155628681183, 0.26721659302711487, 1.6215821504592896, 0.7882671356201172, -0.5150905251502991, 0.5706602931022644, 0.4615946114063263, -0.1347741186618805, -2.0867998600006104, -1.1584985256195068, 0.27892622351646423, -0.4458025097846985, -1.6163849830627441, 1.434891939163208, -1.1705873012542725, -0.9967613816261292, 0.5931386947631836, 0.10708005726337433, 1.3952150344848633, 0.3045341670513153, 1.5738232135772705, 2.0911049842834473, 0.8846301436424255, 0.4137499928474426, 1.2922160625457764, -0.20677119493484497, -0.4396674931049347, 1.7873543500900269, -0.4976469874382019, 0.5309184193611145, 1.056032657623291, -0.3530677556991577, -1.1319329738616943, -0.7820968627929688, -1.1607674360275269, -0.7630151510238647, 1.1723904609680176, 0.06212674826383591, -1.0281122922897339, 0.27535921335220337, 1.5993127822875977, 0.09162905067205429, -0.28294649720191956, 0.5965094566345215, 0.4514993727207184, -0.7408309578895569, -0.1377423256635666, -0.9417058825492859, 0.5811151266098022, -0.16195549070835114, -0.37635737657546997, 0.3048613369464874, 0.48578351736068726, 1.3156707286834717, -0.021262310445308685, 0.057291336357593536, 1.141657829284668, -1.4570047855377197, 1.4662625789642334, -0.6680278778076172, 0.29291051626205444, -2.3100762367248535, 1.3849650621414185, -0.7729056477546692, 1.9782942533493042, -2.6107606887817383, 0.4316330850124359, -0.572087287902832, -0.5496723651885986, 0.3106825053691864, -0.2673598527908325, 0.16989564895629883, -0.16413715481758118, -1.1486839056015015, -0.052434008568525314, -0.786225438117981, 0.48759573698043823, 1.1644611358642578, 1.3837896585464478, -1.0552574396133423, -0.28270503878593445, -1.6640440225601196, -0.12030816823244095, -0.6700221300125122, 0.2530566155910492, -1.9235472679138184, -0.09731052070856094, -1.9764214754104614, -2.3752858638763428, -1.3925714492797852, -0.8437168002128601, 1.1255629062652588, 0.1674291044473648, -0.9277759194374084, 1.2732830047607422, -0.34438541531562805, -1.8446341753005981, 1.1463018655776978, -2.108858108520508 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Thanks for your comments here @albertz - cool to get your input! Answering a bit here between the lines: > I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?). > > Regardless of whether it is a breaking change, however, I don't see the other arguments. > > > but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files > > I don't exactly understand this. Why not? > Why does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent? The problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here. So for TF and Flax it's important that users can load audio files or bytes they way the want to - this might become less important if we find (or make) a good library with few dependencies that is fast for all kinds of platforms / use cases. Now the question is whether it's better to store audio data as a path to a file or as raw bytes I guess.\ My main arguments for storing the audio data as a path to a file is pretty much all about users experience - I don't really expect our users to understand the inner workings of datasets: - 1. It's not straightforward to know which function to use to decode it - not all `load_audio(...)` or `read_audio(...)` work on raw bytes. E.g. Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes . There are also some functions of other libraries which only work on files which would require the user to save the bytes as a file first before being able to load it. - 2. It's difficult to see which format the bytes are coming from (mp3, ogg, ...) - guess this could be remedied by adding the format to each sample though - 3. It is a bit scary IMO to see raw bytes for users. Overall, I think it's better to leave the data in it's raw form as this way it's much easier for people to play around with the audio files, less need to read docs because people don't worry about what happened to the audio files (are the bytes already resampled?) But the argument that the audio should be loadable directly from memory is good - haven't thought about this too much. I guess it's still very much possible for the user to do this: ```python def save_as_bytes: batch["bytes"] = read_in_bytes_from_file(batch["file"])\ os.remove(batch["file"]) ds = ds.map(save_as_bytes) ds.save_to_disk(...) ``` Guess the question is more a bit about what should be the default case?
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
561
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Thanks for your comments here @albertz - cool to get your input! Answering a bit here between the lines: > I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?). > > Regardless of whether it is a breaking change, however, I don't see the other arguments. > > > but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files > > I don't exactly understand this. Why not? > Why does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent? The problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here. So for TF and Flax it's important that users can load audio files or bytes they way the want to - this might become less important if we find (or make) a good library with few dependencies that is fast for all kinds of platforms / use cases. Now the question is whether it's better to store audio data as a path to a file or as raw bytes I guess.\ My main arguments for storing the audio data as a path to a file is pretty much all about users experience - I don't really expect our users to understand the inner workings of datasets: - 1. It's not straightforward to know which function to use to decode it - not all `load_audio(...)` or `read_audio(...)` work on raw bytes. E.g. Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes . There are also some functions of other libraries which only work on files which would require the user to save the bytes as a file first before being able to load it. - 2. It's difficult to see which format the bytes are coming from (mp3, ogg, ...) - guess this could be remedied by adding the format to each sample though - 3. It is a bit scary IMO to see raw bytes for users. Overall, I think it's better to leave the data in it's raw form as this way it's much easier for people to play around with the audio files, less need to read docs because people don't worry about what happened to the audio files (are the bytes already resampled?) But the argument that the audio should be loadable directly from memory is good - haven't thought about this too much. I guess it's still very much possible for the user to do this: ```python def save_as_bytes: batch["bytes"] = read_in_bytes_from_file(batch["file"])\ os.remove(batch["file"]) ds = ds.map(save_as_bytes) ds.save_to_disk(...) ``` Guess the question is more a bit about what should be the default case?
[ -1.2104860544204712, -0.8140400052070618, -0.7164084911346436, 1.4529991149902344, -0.13145405054092407, -1.2384436130523682, 0.14503420889377594, -1.0119092464447021, 1.6497551202774048, -0.8471251130104065, 0.34102749824523926, -1.6602015495300293, 0.050279922783374786, -0.6437296271324158, -0.761471688747406, -0.8459259271621704, -0.3564901351928711, -0.7249158024787903, 1.0287691354751587, 2.451730251312256, 1.263986349105835, -1.37798011302948, 2.7342333793640137, 0.6865050196647644, -0.29829731583595276, -0.9460267424583435, 0.4530736207962036, -0.0368180088698864, -1.294419527053833, -0.43643635511398315, -0.9407724142074585, -0.07058081775903702, -0.6106942296028137, -0.4876456558704376, 0.003394121304154396, 0.3835630416870117, -0.2984977066516876, -0.3665321469306946, -0.5944371223449707, -0.8284027576446533, 0.4248266816139221, -0.3848600387573242, 0.9654334187507629, -0.2989030182361603, 1.7824593782424927, -0.6374686360359192, 0.4844178557395935, 0.7129718661308289, 1.3185429573059082, 0.24090327322483063, -0.0026189754717051983, 0.3517954647541046, 0.35838764905929565, -0.018065009266138077, 0.528935968875885, 1.137935996055603, 0.6970329880714417, 0.4826993942260742, 0.7204941511154175, -2.1830365657806396, 1.3791885375976562, -0.9612869620323181, 0.23335592448711395, 1.3136992454528809, -0.9710425138473511, 0.32330989837646484, -1.736383080482483, -0.11680574715137482, 0.5434150099754333, -2.286790609359741, 0.258236289024353, -1.332350492477417, -0.5958810448646545, 0.9894919395446777, 0.432370126247406, -1.2606388330459595, 0.08163012564182281, -0.43009287118911743, 0.9509559273719788, 0.4407081604003906, 1.0707446336746216, -1.6358015537261963, -0.07843395322561264, -0.27740901708602905, 0.13713304698467255, -1.2339738607406616, -1.5269259214401245, 0.6070067882537842, 0.5705581903457642, 0.6114209890365601, -0.11101829260587692, 1.0328388214111328, -1.0736761093139648, 0.854430615901947, -1.0370714664459229, -1.75872004032135, -1.380768060684204, -2.3332061767578125, -2.262712240219116, 0.8146277070045471, -0.47832003235816956, -0.515532910823822, 2.1240885257720947, -1.080108880996704, -1.6847800016403198, 1.1027072668075562, 0.2505851089954376, -0.042321886867284775, 2.414355993270874, 0.17451442778110504, -0.7592769861221313, 0.4978781044483185, -0.7673695683479309, 0.7985113859176636, -0.42244407534599304, 1.2591500282287598, 0.3825804889202118, -1.096734881401062, 1.5589442253112793, -0.3528650403022766, 0.5856336355209351, -0.6994335055351257, -0.49071913957595825, -0.7421714067459106, 0.28546634316444397, 1.8220292329788208, -0.24404066801071167, 1.5286543369293213, -0.2657724618911743, -1.5527758598327637, -1.5814560651779175, 0.8641539812088013, 0.47052228450775146, -0.8135972023010254, 0.13198387622833252, -0.3528595566749573, 0.16220226883888245, -0.00927839707583189, 1.137363314628601, 1.3496203422546387, 0.7574586272239685, -0.3303254544734955, -0.8380722999572754, 0.12311525642871857, -0.11883527040481567, -0.712938666343689, -1.7405234575271606, -0.3359142243862152, 0.12623180449008942, 0.6596575975418091, -1.2102959156036377, 1.847800612449646, 0.8971098065376282, 1.9631705284118652, 1.030469536781311, -0.3968204855918884, 1.5110424757003784, 0.08980944007635117, 1.8728114366531372, -0.5030931234359741, 0.6042546033859253, -0.4516616463661194, -1.16978919506073, 0.819955587387085, -0.3521095812320709, -2.0397090911865234, -0.668354332447052, -0.7524546384811401, -0.21217982470989227, -0.7797922492027283, 0.9725679755210876, -0.2743608355522156, -1.369145393371582, 0.23617370426654816, -0.7166510224342346, 0.07576389610767365, -1.256340503692627, 0.28650805354118347, 0.6895284652709961, -0.6263547539710999, 0.06378727406263351, -0.3040054738521576, -1.2380173206329346, -0.5155373215675354, 0.3484269678592682, 1.8593183755874634, -0.6550251841545105, 0.9782199263572693, 1.0309091806411743, -0.6541767716407776, -0.028905004262924194, 0.3963375389575958, -0.3184281289577484, 0.8561297059059143, -1.0446335077285767, -0.4556332230567932, 1.1730798482894897, -0.2618066966533661, -0.5603348612785339, 1.437408685684204, 0.6924201846122742, -1.0233662128448486, -0.17173559963703156, -0.11602111160755157, -0.8283751010894775, 0.026428062468767166, -1.6251568794250488, -0.16629557311534882, 0.40004435181617737, -1.5396168231964111, -0.40076079964637756, -0.13580991327762604, 1.2499111890792847, -0.13083310425281525, 1.390967607498169, -0.3344707190990448, -0.15108910202980042, -0.38267266750335693, -0.43714407086372375, 0.06968378275632858, -0.19938473403453827, -0.5719940066337585, 0.25221166014671326, -0.7356885075569153, 0.26224562525749207, 1.4925849437713623, 0.2591773271560669, 0.05245852470397949, 0.4445422291755676, 1.087001085281372, 0.3538294732570648, -0.09552320092916489, -0.9036367535591125, -1.5431535243988037, 2.054640293121338, -1.463828206062317, 2.0203871726989746, 0.8213057518005371, -0.02460363507270813, -1.7905750274658203, -1.8513141870498657, 1.3497580289840698, 1.0984238386154175, 2.3527414798736572, 0.5237924456596375, 0.40782997012138367, -0.7852851748466492, -0.7048383355140686, 0.3652404546737671, -1.0086215734481812, -0.7165558934211731, 0.08434950560331345, 2.4987359046936035, 1.6902520656585693, -0.3906833827495575, -0.16470451653003693, -1.0041651725769043, 1.393967628479004, -0.2344730943441391, 0.20620004832744598, 1.9931275844573975, -0.28270962834358215, -1.0097447633743286, 1.292100429534912, -2.3125109672546387, 0.2055637389421463, 2.0635745525360107, 0.24190689623355865, 0.0548669658601284, -1.3176637887954712, -0.6592505574226379, -0.2696903347969055, -0.4659653306007385, -1.2626621723175049, 0.4815118908882141, -0.2645817995071411, -0.7903447151184082, -1.3546006679534912, 0.10417898744344711, -1.1272095441818237, -1.6591488122940063, 0.26426851749420166, 1.9010214805603027, 2.089096784591675, -0.7152724862098694, 1.5167959928512573, -0.2990573048591614, 0.08009536564350128, 1.204913854598999, 1.2709593772888184, 3.193952798843384, 1.8690310716629028, -1.3146381378173828, 0.6243866682052612, -0.1848836988210678, -0.42198824882507324, 1.089217185974121, -1.1404151916503906, 1.2612788677215576, -0.18824179470539093, -1.278808832168579, -1.2186861038208008, 0.9816167950630188, 0.43393680453300476, -0.0030000116676092148, -0.5413200259208679, 1.1960334777832031, 0.13859200477600098, 1.30940580368042, 0.6006908416748047, -0.2674807012081146, 0.5598388314247131, -0.37630343437194824, -0.5631373524665833, 1.6566123962402344, 0.21096040308475494, -1.45607328414917, -2.3507680892944336, -0.1906910389661789, -0.9038401246070862, 0.06133492663502693, -0.6472291946411133, -1.020585060119629, 1.66848623752594, 0.3736332058906555, -1.1879321336746216, -0.2521982192993164, -0.38089609146118164, -0.5618683099746704, 2.732255697250366, -1.388042688369751, -0.19433432817459106, -0.9950816035270691, -0.6159341335296631, 1.6287999153137207, -1.2318364381790161, -0.2618390619754791, -1.0154646635055542, -0.5610769391059875, -1.191098690032959, -0.4471636116504669, 0.0010594101622700691, -0.9598227143287659, 0.781550943851471, 0.18487979471683502, -1.2435078620910645, -0.30469629168510437, -0.9290775060653687, 0.891708254814148, -0.11816456913948059, 0.18235693871974945, 1.8172266483306885, 0.3586057126522064, -0.39906445145606995, 0.775452196598053, 1.2386579513549805, 0.6385378837585449, -0.6372153759002686, 0.11630932986736298, -0.6340826749801636, 0.36798861622810364, -1.2307872772216797, 0.2934989929199219, -2.8555095195770264, 0.6294086575508118, -0.11314374953508377, -0.0940445140004158, -0.06986674666404724, -1.3003839254379272, 1.0876175165176392, 2.5637524127960205, -1.078101634979248, 0.5216132998466492, 0.28032857179641724, 1.189206838607788, -1.6196467876434326, 0.24359937012195587, -0.5413813591003418, 2.1335384845733643, 0.1920391172170639, 1.1401084661483765, -0.46339455246925354, -2.357614517211914, 0.614006757736206, -1.1803476810455322, -1.0502629280090332, 0.8029261231422424, -0.7927799820899963, 0.17406818270683289, -1.336248755455017, -0.21226170659065247, -0.7823696136474609, -1.1759378910064697, 0.6787481904029846, 0.09426134824752808, 0.5420364737510681, -0.5861635804176331, 0.2495480328798294, -2.2168829441070557, -1.395735740661621, -0.16124214231967926, -0.914035439491272, 0.5083045959472656, -0.40670502185821533, 0.7530515789985657, -0.15956264734268188, -0.04298631101846695, 0.33545589447021484, 1.4626448154449463, 3.3522095680236816, 0.11152520030736923, 0.3467938005924225, -0.2837880253791809, -0.9167343974113464, 1.3906233310699463, 0.9099124670028687, -0.10879769176244736, -0.650324821472168, -1.0522422790527344, 1.301827311515808, 1.9685450792312622, 0.9703878164291382, 0.07951366901397705, -0.8304528594017029, -0.7412338852882385, 0.01235243771225214, 0.2060633897781372, 0.536662220954895, 0.9162136912345886, 0.010893705300986767, 0.06526448577642441, 1.416084885597229, 1.2052332162857056, -0.36123743653297424, 0.3445037603378296, -0.8733404278755188, -0.3998609781265259, 0.48052695393562317, 0.2933732271194458, -0.05860413238406181, 0.367003858089447, -1.0028128623962402, -0.2325097620487213, -0.35062748193740845, -0.8763231635093689, -0.7765354514122009, -0.383689284324646, -0.40389057993888855, 1.7398426532745361, 0.008429340086877346, -0.4987527132034302, 0.005503748543560505, -0.746315062046051, -0.10996830463409424, -1.1026283502578735, 0.27509546279907227, -0.13037511706352234, -0.06454093754291534, -0.11576336622238159, 1.7626099586486816, -0.9986522793769836, -2.0700604915618896, 0.22915413975715637, 0.2104082703590393, -0.26175856590270996, 0.15980233252048492, 1.690246820449829, 0.5702083706855774, 1.4648743867874146, 1.3535641431808472, 0.965434193611145, -0.6696724891662598, -1.2991986274719238, 0.6370797157287598, 0.9836225509643555, -1.411183476448059, 0.8938554525375366, -0.11409664154052734, -0.5153690576553345, 0.6574773788452148, 1.2922158241271973, 0.4474219083786011, -2.0818119049072266, 0.8598703742027283, -0.9871357679367065, 0.8726263642311096, 0.6979624032974243, 0.6938967108726501, 0.2488635629415512, 0.8409706950187683, -1.2731215953826904, -1.1766828298568726, -0.6696638464927673, -0.6724209785461426, 1.9409452676773071, -0.3069351315498352, 0.5591681003570557, -0.21227826178073883, -1.3339277505874634, -0.057399194687604904, 0.684867799282074, 0.37947019934654236, -0.43459317088127136, 0.7588492035865784, -0.6757428050041199, -1.0816277265548706, -1.4299601316452026, -0.5269813537597656, -1.0857969522476196, -0.9131963849067688, 1.0713694095611572, 0.7890705466270447, 0.373654305934906, 1.891236662864685, 0.6260961294174194, 0.27561527490615845, -2.554780960083008, 0.9214012026786804, 0.333108514547348, -0.062403056770563126, 0.885352611541748, 0.365271657705307, 1.0811567306518555, 0.00645237322896719, 0.5518130660057068, -2.4615888595581055, 2.3171045780181885, -0.270710825920105, 0.711581289768219, 0.018015895038843155, -0.09830956906080246, 1.0833873748779297, 0.5924932956695557, 0.5329818725585938, -1.0740352869033813, 0.7099349498748779, -0.5607970356941223, 1.2354609966278076, 0.9054393172264099, -0.8354317545890808, 0.002640604041516781, 1.3232276439666748, 0.4334399402141571, -0.5351256728172302, -0.9373684525489807, -0.9050179123878479, 0.8957464694976807, 1.7698091268539429, 0.013833905570209026, 0.02103715017437935, 0.8379935026168823, 0.6739537119865417, -1.2777856588363647, 0.119402214884758, -0.6578108668327332, -0.7863203883171082, 1.6459424495697021, 2.0191972255706787, -0.1417834609746933, -0.14103268086910248, -0.7176107168197632, -1.2798621654510498, 0.8293732404708862, -0.018499737605452538, 0.08661184459924698, 0.6392130255699158, -0.6247285008430481, 1.119918704032898, 0.824558675289154, 0.9321168065071106, 0.21199646592140198, 0.22984835505485535, 0.3901827037334442, -0.32843783497810364, -1.1124944686889648, -0.2835378646850586, -1.0426853895187378, -2.586426258087158, 0.4513581693172455, -0.24175944924354553, -1.4406681060791016, 0.05073348432779312, -0.986183226108551, 0.8181629776954651, -0.5356978178024292, -1.0950636863708496, -1.5097376108169556, 0.2704010605812073, -0.11798908561468124, 0.9520152807235718, -1.6022353172302246, -0.15593019127845764, 1.2087199687957764, 0.8981115221977234, -0.6486856937408447, 1.0091418027877808, 0.24091477692127228, 0.9861462116241455, 0.8836339712142944, -0.45103833079338074, 0.48153144121170044, 0.11383502930402756, -1.3432040214538574, 0.42808622121810913, 1.2441396713256836, 0.13351140916347504, 1.4672119617462158, -0.5212002992630005, -0.0206469539552927, 0.39815980195999146, -0.4837385416030884, -0.4607044756412506, -0.5929228067398071, 0.6747296452522278, 0.0331045538187027, -0.9755818247795105, -0.029682353138923645, -0.03255230933427811, -0.3018336594104767, 0.19574958086013794, -1.448038101196289, -0.12662295997142792, -0.42126625776290894, -0.5469221472740173, -1.3741450309753418, -0.0821421667933464, 1.3017449378967285, -0.7455189228057861, -0.14773693680763245, 0.48435336351394653, 0.30062028765678406, 0.479839026927948, 0.694164514541626, -0.7623406052589417, -0.3666675388813019, -0.2394859343767166, -0.36173731088638306, 0.32838186621665955, 1.2796931266784668, -0.09672322869300842, -0.9693198204040527, 0.6628226637840271, -0.329049676656723, 0.1130925789475441, 1.9787380695343018, 0.08813466131687164, -0.7905356884002686, 0.3606962263584137, -0.8045618534088135, 1.8984688520431519, 1.6677271127700806, 1.2931239604949951, -0.08931440114974976, -0.9984822869300842, 0.7175695896148682, -0.30312108993530273, -0.3808111846446991, 0.8782342076301575, 0.3449883460998535, -0.2749005854129791, -1.44024658203125, 0.668455183506012, 1.2730106115341187, -0.7978378534317017, -0.8455164432525635, 0.1319229155778885, -0.8224468231201172, 1.0824909210205078, 0.6299806237220764, 0.3758031725883484, 0.26310086250305176, 1.6218773126602173, 0.7950382232666016, -0.5317219495773315, 0.5619833469390869, 0.4685184955596924, -0.1364009827375412, -2.082021951675415, -1.152091383934021, 0.28254827857017517, -0.45121997594833374, -1.601265549659729, 1.4396895170211792, -1.1804189682006836, -0.9958510398864746, 0.5813749432563782, 0.11227243393659592, 1.3848029375076294, 0.3172101676464081, 1.5937093496322632, 2.076033115386963, 0.8762256503105164, 0.42545685172080994, 1.30001962184906, -0.19575388729572296, -0.42716744542121887, 1.7936090230941772, -0.49673545360565186, 0.52225261926651, 1.0844258069992065, -0.35918158292770386, -1.1293293237686157, -0.7882235646247864, -1.1567853689193726, -0.7576249241828918, 1.183967113494873, 0.06911220401525497, -1.02385675907135, 0.2709331810474396, 1.5883092880249023, 0.08283863961696625, -0.292300283908844, 0.5904890894889832, 0.44907695055007935, -0.7383854985237122, -0.13466349244117737, -0.945305585861206, 0.5786469578742981, -0.15228599309921265, -0.38427528738975525, 0.3096994161605835, 0.49031996726989746, 1.328707218170166, -0.020543454214930534, 0.07508008182048798, 1.1670610904693604, -1.4672704935073853, 1.4641743898391724, -0.6764358282089233, 0.28521811962127686, -2.3166017532348633, 1.3846254348754883, -0.759391188621521, 1.9765104055404663, -2.605499267578125, 0.4188700020313263, -0.5704907774925232, -0.5337536931037903, 0.2990705966949463, -0.25770124793052673, 0.171479269862175, -0.16889914870262146, -1.1395775079727173, -0.06067896634340286, -0.7864240407943726, 0.48628854751586914, 1.1685532331466675, 1.3620928525924683, -1.0466030836105347, -0.2730068564414978, -1.6723486185073853, -0.11844871193170547, -0.6746817827224731, 0.25495555996894836, -1.9235084056854248, -0.1196533739566803, -1.972497820854187, -2.3739819526672363, -1.3912214040756226, -0.8430009484291077, 1.1300455331802368, 0.1777333766222, -0.9403786659240723, 1.2720329761505127, -0.3568171262741089, -1.8200925588607788, 1.128007173538208, -2.109992265701294 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
> The problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here. But how is this relevant for this issue here? I thought this issue here is about having the (correct) path in the dataset or having raw bytes in the dataset. How did TF users use it at all then? Or they just do not use on-the-fly decoding? I did not even notice this problem (maybe because I had `torchaudio` installed). But what do they use instead? But as I outlined before, they could just use `tfio.audio.decode_flac` and co, where it would be more natural if you already provide the raw bytes. > Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes I was not really familiar with `torchaudio`. It seems that they really don't provide an easy/direct API to operate on raw bytes. Which is very strange and unfortunate because as far as I can see, all the underlying backend libraries (e.g. soundfile) easily allow that. So I would say that this is the fault of `torchaudio` then. But despite, if you anyway use `torchaudio` with `soundfile` backend, why not just use `soundfile` directly. It's very simple to use and crossplatform. But ok, now we are just discussing how to handle the on-the-fly decoding. I still think this is a separate issue and having raw bytes in the dataset instead of local files should just be fine as well. > It is a bit scary IMO to see raw bytes for users. I think nobody who writes code is scared by seeing the raw bytes content of a binary file. :) > I guess it's still very much possible for the user to do this: > > ```python > def save_as_bytes: > batch["bytes"] = read_in_bytes_from_file(batch["file"])\ > os.remove(batch["file"]) > > ds = ds.map(save_as_bytes) > > ds.save_to_disk(...) > ``` In https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this `map` is not needed anymore and `save_to_disk` could do it automatically (maybe via some option)? > Guess the question is more a bit about what should be the default case? Yea this is up to you. I'm happy as long as we can get it the way we want easily and this is a well supported use case. :)
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
435
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 > The problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here. But how is this relevant for this issue here? I thought this issue here is about having the (correct) path in the dataset or having raw bytes in the dataset. How did TF users use it at all then? Or they just do not use on-the-fly decoding? I did not even notice this problem (maybe because I had `torchaudio` installed). But what do they use instead? But as I outlined before, they could just use `tfio.audio.decode_flac` and co, where it would be more natural if you already provide the raw bytes. > Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes I was not really familiar with `torchaudio`. It seems that they really don't provide an easy/direct API to operate on raw bytes. Which is very strange and unfortunate because as far as I can see, all the underlying backend libraries (e.g. soundfile) easily allow that. So I would say that this is the fault of `torchaudio` then. But despite, if you anyway use `torchaudio` with `soundfile` backend, why not just use `soundfile` directly. It's very simple to use and crossplatform. But ok, now we are just discussing how to handle the on-the-fly decoding. I still think this is a separate issue and having raw bytes in the dataset instead of local files should just be fine as well. > It is a bit scary IMO to see raw bytes for users. I think nobody who writes code is scared by seeing the raw bytes content of a binary file. :) > I guess it's still very much possible for the user to do this: > > ```python > def save_as_bytes: > batch["bytes"] = read_in_bytes_from_file(batch["file"])\ > os.remove(batch["file"]) > > ds = ds.map(save_as_bytes) > > ds.save_to_disk(...) > ``` In https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this `map` is not needed anymore and `save_to_disk` could do it automatically (maybe via some option)? > Guess the question is more a bit about what should be the default case? Yea this is up to you. I'm happy as long as we can get it the way we want easily and this is a well supported use case. :)
[ -1.1817327737808228, -0.7966588735580444, -0.7225505113601685, 1.4715908765792847, -0.11163772642612457, -1.258471131324768, 0.1783446967601776, -1.043304204940796, 1.6371420621871948, -0.8318999409675598, 0.32233473658561707, -1.6752383708953857, 0.039613187313079834, -0.6536986827850342, -0.7694606781005859, -0.8358840942382812, -0.31129130721092224, -0.6834057569503784, 1.0382838249206543, 2.405543804168701, 1.2517530918121338, -1.345662236213684, 2.7239432334899902, 0.6733148694038391, -0.3311396837234497, -0.9408099055290222, 0.45604604482650757, -0.036807529628276825, -1.2997194528579712, -0.460697203874588, -0.9368371367454529, -0.09689027816057205, -0.5974593162536621, -0.5001424551010132, 0.01496952585875988, 0.40134939551353455, -0.3203919231891632, -0.38236260414123535, -0.5935642123222351, -0.8230468034744263, 0.43266016244888306, -0.37975063920021057, 0.9861830472946167, -0.29420900344848633, 1.778763771057129, -0.7057622075080872, 0.4791238009929657, 0.7086474895477295, 1.3145930767059326, 0.2742682695388794, -0.015041914768517017, 0.3696568012237549, 0.3683977425098419, -0.026987599208950996, 0.5348049998283386, 1.1094903945922852, 0.6632204055786133, 0.5371429324150085, 0.7414556741714478, -2.19245982170105, 1.3601545095443726, -0.9812026023864746, 0.19866685569286346, 1.3305834531784058, -0.9702991843223572, 0.29991939663887024, -1.7582287788391113, -0.09930916130542755, 0.5014981031417847, -2.2779548168182373, 0.28882959485054016, -1.3454707860946655, -0.5832855701446533, 0.9753029346466064, 0.4417239725589752, -1.2531208992004395, 0.08672881871461868, -0.3924442529678345, 0.9338421821594238, 0.4397147595882416, 1.0466277599334717, -1.6412314176559448, -0.08160743862390518, -0.28745192289352417, 0.13803932070732117, -1.1929594278335571, -1.5277602672576904, 0.6048880815505981, 0.5588340163230896, 0.5998260378837585, -0.1443932205438614, 1.0506788492202759, -1.0535860061645508, 0.826458752155304, -1.0517998933792114, -1.7695473432540894, -1.3788102865219116, -2.2955188751220703, -2.2481985092163086, 0.8172308206558228, -0.4925326704978943, -0.4931764602661133, 2.114933729171753, -1.0891761779785156, -1.7239599227905273, 1.1085071563720703, 0.24558432400226593, -0.04453020542860031, 2.38496732711792, 0.18656465411186218, -0.723804771900177, 0.5216547846794128, -0.8015855550765991, 0.7616612911224365, -0.4390753507614136, 1.2542808055877686, 0.3675825893878937, -1.1057864427566528, 1.5872344970703125, -0.31847503781318665, 0.6024598479270935, -0.7297801971435547, -0.48723316192626953, -0.7387139797210693, 0.29775574803352356, 1.8731745481491089, -0.25420403480529785, 1.5159904956817627, -0.2593059539794922, -1.5519250631332397, -1.5565931797027588, 0.8605920076370239, 0.4744521975517273, -0.8028787970542908, 0.13341796398162842, -0.3463050127029419, 0.17271025478839874, -0.0321558378636837, 1.1582952737808228, 1.3222237825393677, 0.7760249376296997, -0.3277476131916046, -0.794567346572876, 0.1530432552099228, -0.06302756071090698, -0.7139087915420532, -1.746328353881836, -0.3629373610019684, 0.14937782287597656, 0.6532009840011597, -1.2284618616104126, 1.8536313772201538, 0.8778278827667236, 1.9358490705490112, 1.030646800994873, -0.43585458397865295, 1.4790632724761963, 0.11295276135206223, 1.8885964155197144, -0.449065238237381, 0.6012545824050903, -0.4475596845149994, -1.1930873394012451, 0.8449546098709106, -0.31977319717407227, -2.0121374130249023, -0.6601735353469849, -0.7799280881881714, -0.2004101574420929, -0.8022022843360901, 0.9732517004013062, -0.29011964797973633, -1.3767023086547852, 0.20542527735233307, -0.6981438398361206, 0.10368555039167404, -1.2896314859390259, 0.28135573863983154, 0.7029919028282166, -0.6556922793388367, 0.06685394793748856, -0.29167523980140686, -1.2600873708724976, -0.5153980255126953, 0.3491670489311218, 1.8535205125808716, -0.6721628904342651, 0.9674502611160278, 1.0254700183868408, -0.6750084757804871, -0.014724943786859512, 0.40222886204719543, -0.32154580950737, 0.8417769074440002, -1.02479088306427, -0.4600447416305542, 1.1906276941299438, -0.2612874507904053, -0.5680423378944397, 1.4247313737869263, 0.7131209373474121, -1.0247756242752075, -0.18434478342533112, -0.1398279219865799, -0.8206987380981445, 0.013642314821481705, -1.60089910030365, -0.16498926281929016, 0.4252626299858093, -1.5553905963897705, -0.4070287048816681, -0.15280704200267792, 1.276395559310913, -0.15188850462436676, 1.3789719343185425, -0.3309597373008728, -0.1650322824716568, -0.3922043442726135, -0.4401053488254547, 0.06472033262252808, -0.20568755269050598, -0.6209692358970642, 0.27423927187919617, -0.7041286826133728, 0.25897228717803955, 1.4835597276687622, 0.24031920731067657, 0.040817104279994965, 0.45473477244377136, 1.1020545959472656, 0.3441445827484131, -0.10395585745573044, -0.9330992102622986, -1.5438238382339478, 2.0592663288116455, -1.4954410791397095, 2.0117204189300537, 0.7972514033317566, -0.00886115524917841, -1.793402075767517, -1.8683804273605347, 1.3418525457382202, 1.0919039249420166, 2.3451554775238037, 0.5364524126052856, 0.42845267057418823, -0.8002254962921143, -0.6672524213790894, 0.3642832040786743, -1.0137296915054321, -0.6995602250099182, 0.11048093438148499, 2.4735827445983887, 1.684816598892212, -0.3878607451915741, -0.19689998030662537, -1.00851571559906, 1.393314003944397, -0.2653180956840515, 0.21326623857021332, 1.9837011098861694, -0.28218165040016174, -1.0297876596450806, 1.3012086153030396, -2.2753779888153076, 0.2113589644432068, 2.067241907119751, 0.22800691425800323, 0.06041757017374039, -1.3208465576171875, -0.6725288033485413, -0.2731238603591919, -0.4444967806339264, -1.2836600542068481, 0.4816261827945709, -0.22718089818954468, -0.7811825275421143, -1.3386714458465576, 0.12780801951885223, -1.1177167892456055, -1.6552618741989136, 0.2567886412143707, 1.92697012424469, 2.0739026069641113, -0.7253782153129578, 1.5074143409729004, -0.3152316212654114, 0.09322953224182129, 1.234687089920044, 1.2559210062026978, 3.1905760765075684, 1.8663831949234009, -1.3265628814697266, 0.6317737102508545, -0.18154671788215637, -0.45723098516464233, 1.1286782026290894, -1.1123244762420654, 1.246293544769287, -0.21324025094509125, -1.2818113565444946, -1.232854962348938, 0.9620574712753296, 0.40817147493362427, 0.01537780836224556, -0.5442873239517212, 1.197921872138977, 0.12730558216571808, 1.31023108959198, 0.6284809112548828, -0.277052104473114, 0.5804198384284973, -0.3568035066127777, -0.528931200504303, 1.6271779537200928, 0.22535769641399384, -1.449947476387024, -2.3831405639648438, -0.1714516282081604, -0.9272100925445557, 0.06544997543096542, -0.6189195513725281, -1.0216420888900757, 1.6709990501403809, 0.4170445501804352, -1.1805981397628784, -0.22783981263637543, -0.352967768907547, -0.5531577467918396, 2.7744154930114746, -1.3785593509674072, -0.19190838932991028, -1.002017855644226, -0.6258302927017212, 1.6795601844787598, -1.2251472473144531, -0.261851042509079, -1.0217000246047974, -0.5364208817481995, -1.203891634941101, -0.4660584330558777, 0.022610163316130638, -0.9691018462181091, 0.7876235246658325, 0.16880804300308228, -1.240726351737976, -0.3519051671028137, -0.9149407744407654, 0.8890155553817749, -0.11617461591959, 0.16610167920589447, 1.8564860820770264, 0.3679124712944031, -0.38450443744659424, 0.7930912971496582, 1.2128574848175049, 0.6230470538139343, -0.6272905468940735, 0.1547524780035019, -0.6165428161621094, 0.35090768337249756, -1.2652676105499268, 0.2804322838783264, -2.849736213684082, 0.6197018027305603, -0.1132938489317894, -0.09073540568351746, -0.09565949440002441, -1.3054643869400024, 1.0750364065170288, 2.56626296043396, -1.0951275825500488, 0.5197878479957581, 0.27509525418281555, 1.1941097974777222, -1.6150139570236206, 0.2269340455532074, -0.49817147850990295, 2.1329898834228516, 0.20054735243320465, 1.1748818159103394, -0.4405532777309418, -2.334859848022461, 0.6146699786186218, -1.1750596761703491, -1.096264362335205, 0.8340284824371338, -0.7564648389816284, 0.1608145833015442, -1.3437249660491943, -0.21597932279109955, -0.7683317065238953, -1.1947107315063477, 0.7127037048339844, 0.07390423119068146, 0.5461686253547668, -0.5653757452964783, 0.2560141682624817, -2.200592279434204, -1.3997371196746826, -0.1683967113494873, -0.935133159160614, 0.5010657906532288, -0.3963625133037567, 0.7419699430465698, -0.16075116395950317, -0.050507836043834686, 0.3397518992424011, 1.5041983127593994, 3.3599777221679688, 0.13872459530830383, 0.33615437150001526, -0.29148489236831665, -0.9161536693572998, 1.3813683986663818, 0.929678738117218, -0.13238392770290375, -0.6279435157775879, -1.0297436714172363, 1.2856308221817017, 1.9610952138900757, 0.9853498339653015, 0.04373548924922943, -0.825348973274231, -0.7790414690971375, -0.00035117194056510925, 0.18977110087871552, 0.5275641083717346, 0.9032376408576965, 0.07336297631263733, 0.03285282105207443, 1.4001535177230835, 1.1684757471084595, -0.3706488013267517, 0.3306492567062378, -0.8714525699615479, -0.39732450246810913, 0.4844196140766144, 0.3402635455131531, -0.04435112327337265, 0.36559444665908813, -0.9926540851593018, -0.23364517092704773, -0.3312937617301941, -0.8541445136070251, -0.7794396281242371, -0.3852401673793793, -0.4182395935058594, 1.6990337371826172, 0.012490037828683853, -0.49551087617874146, 0.003696184605360031, -0.7337077856063843, -0.10446348041296005, -1.0813796520233154, 0.2813289165496826, -0.1133948415517807, -0.1080937460064888, -0.11332093179225922, 1.7161184549331665, -1.006099820137024, -2.024829864501953, 0.22238555550575256, 0.20422561466693878, -0.2706467807292938, 0.16375789046287537, 1.6891980171203613, 0.5572426319122314, 1.4409083127975464, 1.3575862646102905, 0.9507365822792053, -0.6651338338851929, -1.287002444267273, 0.6006370186805725, 0.9735183119773865, -1.3981417417526245, 0.8829552531242371, -0.0959482342004776, -0.49281027913093567, 0.6152530312538147, 1.284541368484497, 0.43744075298309326, -2.049952745437622, 0.8364930748939514, -0.9818865060806274, 0.8445274233818054, 0.7520154118537903, 0.7309107780456543, 0.22718000411987305, 0.808853030204773, -1.2616856098175049, -1.177126169204712, -0.6524966955184937, -0.673500657081604, 1.9195175170898438, -0.32475072145462036, 0.5504560470581055, -0.2248174548149109, -1.3329532146453857, -0.0605737641453743, 0.67108154296875, 0.40007737278938293, -0.4258711636066437, 0.7412240505218506, -0.6564720273017883, -1.0522958040237427, -1.3829201459884644, -0.5423034429550171, -1.0970567464828491, -0.9452919363975525, 1.0404722690582275, 0.8246344923973083, 0.38377150893211365, 1.8770098686218262, 0.6251698136329651, 0.28783679008483887, -2.5594396591186523, 0.9484779834747314, 0.3355073034763336, -0.06717455387115479, 0.8629089593887329, 0.37460723519325256, 1.0751688480377197, -0.004609647672623396, 0.566426157951355, -2.4682466983795166, 2.3200368881225586, -0.2675120532512665, 0.698310136795044, 0.0015332531183958054, -0.12256994843482971, 1.0876870155334473, 0.5891098976135254, 0.5340213775634766, -1.0729374885559082, 0.7073319554328918, -0.5874075293540955, 1.2510143518447876, 0.9082179069519043, -0.8549452424049377, -0.0009266883134841919, 1.3668088912963867, 0.44039514660835266, -0.554429292678833, -0.9606360197067261, -0.936403214931488, 0.9313057065010071, 1.7511972188949585, 0.0019012866541743279, -0.026130978018045425, 0.8779905438423157, 0.6459897756576538, -1.2744433879852295, 0.127812460064888, -0.6516295075416565, -0.7742984294891357, 1.6574628353118896, 1.9983484745025635, -0.1540444940328598, -0.15099914371967316, -0.7507641315460205, -1.2586573362350464, 0.8393539190292358, -0.00621014554053545, 0.07410915940999985, 0.6452580690383911, -0.6203271746635437, 1.1257405281066895, 0.8182144165039062, 0.9458340406417847, 0.2523280382156372, 0.2633030116558075, 0.36949190497398376, -0.33127859234809875, -1.1482470035552979, -0.30043771862983704, -1.067636251449585, -2.600292444229126, 0.45736315846443176, -0.26219242811203003, -1.4313850402832031, 0.07633107155561447, -1.0204282999038696, 0.7935425639152527, -0.5860164761543274, -1.1024267673492432, -1.494513988494873, 0.2507753372192383, -0.11248371005058289, 0.9198506474494934, -1.6082777976989746, -0.151845321059227, 1.2195889949798584, 0.9210034012794495, -0.6347857117652893, 0.9828399419784546, 0.2212422490119934, 1.0144108533859253, 0.8914822936058044, -0.4339240789413452, 0.5248978137969971, 0.08912084996700287, -1.3432543277740479, 0.4288437068462372, 1.263833999633789, 0.14682717621326447, 1.4886897802352905, -0.5136403441429138, -0.010118710808455944, 0.41244468092918396, -0.5007739067077637, -0.43905699253082275, -0.6165322661399841, 0.6665907502174377, 0.045655593276023865, -0.97584068775177, -0.023367740213871002, -0.025379663333296776, -0.2755718231201172, 0.2239128202199936, -1.4612764120101929, -0.11811099201440811, -0.37811097502708435, -0.5780846476554871, -1.3366130590438843, -0.10872127115726471, 1.282396912574768, -0.7454805970191956, -0.1250213086605072, 0.4766281247138977, 0.2879115343093872, 0.47721993923187256, 0.6751158833503723, -0.7795410752296448, -0.36205852031707764, -0.24722504615783691, -0.3826525807380676, 0.3691599369049072, 1.31906259059906, -0.07605743408203125, -0.9620052576065063, 0.6373952627182007, -0.33877676725387573, 0.08724382519721985, 1.9906141757965088, 0.07364849001169205, -0.7994568347930908, 0.32553908228874207, -0.794653058052063, 1.928794503211975, 1.665617823600769, 1.2637101411819458, -0.07102439552545547, -1.0001511573791504, 0.7286566495895386, -0.31252527236938477, -0.3834458589553833, 0.8865266442298889, 0.3170139789581299, -0.27597150206565857, -1.4263005256652832, 0.6785327792167664, 1.2894482612609863, -0.7816843390464783, -0.86038738489151, 0.10876129567623138, -0.8293572068214417, 1.0991308689117432, 0.6353945732116699, 0.35623714327812195, 0.2692257761955261, 1.6364712715148926, 0.8182434439659119, -0.4934172034263611, 0.5686925053596497, 0.47363409399986267, -0.12251726537942886, -2.0780818462371826, -1.1361443996429443, 0.31971848011016846, -0.4422371983528137, -1.6233996152877808, 1.468294620513916, -1.1668319702148438, -0.9842910170555115, 0.6161531805992126, 0.14243268966674805, 1.4051549434661865, 0.3115577697753906, 1.5740240812301636, 2.070286273956299, 0.860322892665863, 0.40667399764060974, 1.2696254253387451, -0.21064256131649017, -0.4559001326560974, 1.7732462882995605, -0.49675893783569336, 0.5581157803535461, 1.0937556028366089, -0.3207657039165497, -1.146356463432312, -0.7995502352714539, -1.2235651016235352, -0.7678040862083435, 1.17409348487854, 0.06489656865596771, -1.067244052886963, 0.27518001198768616, 1.6001042127609253, 0.08286691457033157, -0.2721831202507019, 0.621225118637085, 0.42244386672973633, -0.7564589381217957, -0.1314791887998581, -0.9415585994720459, 0.5790096521377563, -0.14072147011756897, -0.34624478220939636, 0.3188605308532715, 0.459144651889801, 1.3388782739639282, -0.02209234982728958, 0.06918831169605255, 1.133957862854004, -1.4528086185455322, 1.4835636615753174, -0.7164247632026672, 0.2942856252193451, -2.332886219024658, 1.3883452415466309, -0.7990550398826599, 1.95956552028656, -2.601511001586914, 0.4164794683456421, -0.5478521585464478, -0.533203661441803, 0.2884625494480133, -0.28434503078460693, 0.1577550619840622, -0.17074041068553925, -1.160093903541565, -0.053707145154476166, -0.824567973613739, 0.48829522728919983, 1.147994041442871, 1.3830205202102661, -1.0446616411209106, -0.28770655393600464, -1.6877306699752808, -0.10371845215559006, -0.6458856463432312, 0.271993488073349, -1.9108408689498901, -0.08231643587350845, -1.9661637544631958, -2.39499568939209, -1.3607300519943237, -0.8061511516571045, 1.1332992315292358, 0.1565205603837967, -0.9063637256622314, 1.276720404624939, -0.3371168375015259, -1.8194094896316528, 1.1380304098129272, -2.1282081604003906 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
> In https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this map is not needed anymore and save_to_disk could do it automatically (maybe via some option)? Yes! Should be super easy now see discussion here: https://github.com/rwth-i6/i6_core/issues/257#issuecomment-1105494468 Thanks for the super useful input :-)
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
39
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 > In https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this map is not needed anymore and save_to_disk could do it automatically (maybe via some option)? Yes! Should be super easy now see discussion here: https://github.com/rwth-i6/i6_core/issues/257#issuecomment-1105494468 Thanks for the super useful input :-)
[ -1.1790995597839355, -0.8171549439430237, -0.7177407741546631, 1.4631839990615845, -0.13961324095726013, -1.232786774635315, 0.14650361239910126, -0.9853827953338623, 1.6017441749572754, -0.8141644597053528, 0.3117726743221283, -1.6840084791183472, 0.011091044172644615, -0.647318959236145, -0.7528848052024841, -0.8396735787391663, -0.33098962903022766, -0.7247284650802612, 1.0407650470733643, 2.4366190433502197, 1.251915454864502, -1.3650799989700317, 2.7287769317626953, 0.6766175031661987, -0.3129391372203827, -0.952425479888916, 0.45985570549964905, -0.019015487283468246, -1.3098732233047485, -0.42496782541275024, -0.9484416842460632, -0.047359831631183624, -0.582737147808075, -0.4685441851615906, 0.01409110426902771, 0.4025673568248749, -0.2967892289161682, -0.34240442514419556, -0.5954237580299377, -0.816675066947937, 0.4273996651172638, -0.36440762877464294, 0.9688974022865295, -0.2797114849090576, 1.7622109651565552, -0.6680105924606323, 0.4779151976108551, 0.706656813621521, 1.281890869140625, 0.24300777912139893, 0.01797163486480713, 0.3562208116054535, 0.36288556456565857, 0.0028027119114995003, 0.5455023646354675, 1.140015959739685, 0.6936361789703369, 0.49674344062805176, 0.7343676686286926, -2.1754050254821777, 1.3592619895935059, -0.9430468678474426, 0.216785728931427, 1.310370683670044, -0.9594681262969971, 0.31704598665237427, -1.7555935382843018, -0.10412479937076569, 0.5396692752838135, -2.272932529449463, 0.28960850834846497, -1.3355250358581543, -0.5924894213676453, 1.0132594108581543, 0.43750306963920593, -1.2621374130249023, 0.07452916353940964, -0.44191503524780273, 0.9641109704971313, 0.41715413331985474, 1.0626862049102783, -1.618125319480896, -0.07268615067005157, -0.2717478275299072, 0.0939759612083435, -1.2190155982971191, -1.516826868057251, 0.585999071598053, 0.5716908574104309, 0.6406436562538147, -0.13932447135448456, 1.0305445194244385, -1.0649207830429077, 0.8355854153633118, -1.0585108995437622, -1.7426564693450928, -1.4036526679992676, -2.3578670024871826, -2.2562448978424072, 0.8256494998931885, -0.47298306226730347, -0.4994993805885315, 2.0999433994293213, -1.0724488496780396, -1.6845227479934692, 1.103558897972107, 0.26001623272895813, -0.01888400688767433, 2.404175043106079, 0.19336044788360596, -0.7758606672286987, 0.5274178385734558, -0.7947102189064026, 0.7873209714889526, -0.41256651282310486, 1.2706445455551147, 0.4265751242637634, -1.0918477773666382, 1.5687592029571533, -0.33527883887290955, 0.5716506242752075, -0.6937777996063232, -0.5182989239692688, -0.7487289905548096, 0.26307210326194763, 1.8462852239608765, -0.26477116346359253, 1.5450502634048462, -0.2541452944278717, -1.5598326921463013, -1.5459519624710083, 0.8505884408950806, 0.4830056130886078, -0.8264439702033997, 0.09254182875156403, -0.3662426769733429, 0.14484012126922607, -0.03387327864766121, 1.1518250703811646, 1.3330355882644653, 0.7521231174468994, -0.3417574465274811, -0.818341851234436, 0.14828112721443176, -0.09492895007133484, -0.7025922536849976, -1.760421872138977, -0.3423425555229187, 0.17408888041973114, 0.6425679922103882, -1.2151665687561035, 1.835536241531372, 0.8692885637283325, 1.9616323709487915, 1.0242129564285278, -0.40973666310310364, 1.4787101745605469, 0.08563339710235596, 1.8927769660949707, -0.49959683418273926, 0.5928090810775757, -0.43765994906425476, -1.18986976146698, 0.8387852907180786, -0.3447588384151459, -2.0215930938720703, -0.6623282432556152, -0.7653447985649109, -0.19898506999015808, -0.8099907040596008, 0.9509959816932678, -0.2893213629722595, -1.3839737176895142, 0.21309392154216766, -0.71429044008255, 0.10346947610378265, -1.2701001167297363, 0.24019785225391388, 0.7046197056770325, -0.6408615708351135, 0.025495586916804314, -0.2737959325313568, -1.2578309774398804, -0.5126502513885498, 0.3639112710952759, 1.8653619289398193, -0.6500650644302368, 1.012778639793396, 1.027404546737671, -0.6698989272117615, 0.002382272854447365, 0.3825567662715912, -0.3358463943004608, 0.8532559275627136, -1.0527949333190918, -0.48082736134529114, 1.1743818521499634, -0.25218701362609863, -0.55295729637146, 1.4259876012802124, 0.7237661480903625, -1.0219740867614746, -0.21020004153251648, -0.11353590339422226, -0.8105957508087158, 0.0117111224681139, -1.622901201248169, -0.15986000001430511, 0.41757816076278687, -1.5406570434570312, -0.39260196685791016, -0.1426544040441513, 1.2940044403076172, -0.17080570757389069, 1.3735792636871338, -0.3103075623512268, -0.14706552028656006, -0.3921218812465668, -0.49117961525917053, 0.08048555254936218, -0.1871345192193985, -0.5876909494400024, 0.2756897211074829, -0.7507580518722534, 0.27595874667167664, 1.5016268491744995, 0.24997884035110474, 0.06041935831308365, 0.44550421833992004, 1.0861250162124634, 0.35607168078422546, -0.0887797400355339, -0.8937842845916748, -1.571445107460022, 2.0631372928619385, -1.4687936305999756, 2.011592388153076, 0.8034584522247314, -0.05681624263525009, -1.8070722818374634, -1.8615018129348755, 1.334464192390442, 1.10463547706604, 2.3845014572143555, 0.5333145260810852, 0.44244134426116943, -0.7804584503173828, -0.7098132371902466, 0.3625276982784271, -1.003352403640747, -0.6838193535804749, 0.106733039021492, 2.4819579124450684, 1.6845959424972534, -0.3813551366329193, -0.18934482336044312, -1.006643533706665, 1.3664687871932983, -0.23001138865947723, 0.22765253484249115, 1.9951153993606567, -0.27420327067375183, -1.014329433441162, 1.2947343587875366, -2.3016693592071533, 0.24562960863113403, 2.0712435245513916, 0.25683337450027466, 0.06450553983449936, -1.323017954826355, -0.6437268853187561, -0.2867622673511505, -0.45649686455726624, -1.2742513418197632, 0.5211228132247925, -0.2568988800048828, -0.8199044466018677, -1.3453491926193237, 0.08000116050243378, -1.1234451532363892, -1.6878622770309448, 0.30541715025901794, 1.8901901245117188, 2.0965945720672607, -0.7397629022598267, 1.4872212409973145, -0.29566359519958496, 0.07937269657850266, 1.2165082693099976, 1.2803916931152344, 3.1626298427581787, 1.8843441009521484, -1.3109190464019775, 0.6463053226470947, -0.20335258543491364, -0.4269062876701355, 1.0969058275222778, -1.121097207069397, 1.2433717250823975, -0.20999641716480255, -1.3012113571166992, -1.2315503358840942, 0.9804442524909973, 0.4243772625923157, -0.00944170169532299, -0.5503294467926025, 1.1963011026382446, 0.12778964638710022, 1.303726077079773, 0.619624674320221, -0.26776453852653503, 0.5589846968650818, -0.3870358467102051, -0.5465002655982971, 1.6464296579360962, 0.19362162053585052, -1.4934924840927124, -2.3549602031707764, -0.21319878101348877, -0.9331669807434082, 0.034385137259960175, -0.6389819383621216, -1.036028504371643, 1.6549268960952759, 0.38719281554222107, -1.1936277151107788, -0.24358761310577393, -0.35466498136520386, -0.5276440978050232, 2.767885208129883, -1.3750540018081665, -0.15336288511753082, -0.9778514504432678, -0.6087740659713745, 1.6730560064315796, -1.2195816040039062, -0.26790469884872437, -1.016903281211853, -0.589385986328125, -1.208240032196045, -0.4540348947048187, 0.020946377888321877, -0.9607226252555847, 0.7438040375709534, 0.14712584018707275, -1.2265526056289673, -0.3185209631919861, -0.9296972751617432, 0.9313746094703674, -0.13748881220817566, 0.16482695937156677, 1.8265677690505981, 0.3461477756500244, -0.3659863770008087, 0.7677687406539917, 1.2391612529754639, 0.6288339495658875, -0.6600617170333862, 0.11228606104850769, -0.644089937210083, 0.3495892286300659, -1.2621508836746216, 0.2691207528114319, -2.8648126125335693, 0.6313020586967468, -0.11060992628335953, -0.08483942598104477, -0.0882309228181839, -1.30982506275177, 1.0895127058029175, 2.534325361251831, -1.1175661087036133, 0.514963686466217, 0.3139220178127289, 1.1638909578323364, -1.607390284538269, 0.20999716222286224, -0.526523768901825, 2.141648769378662, 0.1908322423696518, 1.1610174179077148, -0.45799940824508667, -2.30106258392334, 0.6363259553909302, -1.169154405593872, -1.0193647146224976, 0.7999206185340881, -0.8017378449440002, 0.21310214698314667, -1.3543134927749634, -0.21452924609184265, -0.7975797653198242, -1.2013336420059204, 0.6929258108139038, 0.06651002168655396, 0.5252470970153809, -0.5364323854446411, 0.2605994641780853, -2.213369846343994, -1.3951770067214966, -0.17855781316757202, -0.9314874410629272, 0.5210145115852356, -0.3978225588798523, 0.7264609932899475, -0.14985863864421844, -0.055993542075157166, 0.3368712365627289, 1.4763295650482178, 3.3615882396698, 0.1399313062429428, 0.3059495687484741, -0.24273763597011566, -0.9427231550216675, 1.3850280046463013, 0.9361208081245422, -0.12353435903787613, -0.6366124749183655, -1.0226987600326538, 1.3141684532165527, 1.9895777702331543, 1.0102635622024536, 0.059465616941452026, -0.8652553558349609, -0.7695686221122742, 0.03384982794523239, 0.19224801659584045, 0.5403621196746826, 0.9078201651573181, 0.018500639125704765, 0.04868822544813156, 1.4218684434890747, 1.1777863502502441, -0.36023369431495667, 0.3396134078502655, -0.8898784518241882, -0.3843308985233307, 0.46446487307548523, 0.2892223298549652, -0.026972798630595207, 0.4011635482311249, -1.0218333005905151, -0.24420331418514252, -0.3286949098110199, -0.8748123645782471, -0.7847147583961487, -0.39137643575668335, -0.42851218581199646, 1.696993350982666, 0.011869365349411964, -0.48231223225593567, 0.047327592968940735, -0.7433571219444275, -0.13225392997264862, -1.0855661630630493, 0.26771876215934753, -0.12698234617710114, -0.05280020087957382, -0.14276115596294403, 1.7367507219314575, -1.0071934461593628, -2.073486804962158, 0.22936899960041046, 0.23852208256721497, -0.2847959101200104, 0.14964820444583893, 1.7124444246292114, 0.5686920285224915, 1.4171345233917236, 1.3398452997207642, 0.9718902707099915, -0.6599218845367432, -1.2791444063186646, 0.6276466846466064, 1.0031347274780273, -1.4031835794448853, 0.8944515585899353, -0.1677640676498413, -0.5016140937805176, 0.6529141068458557, 1.302506685256958, 0.42880895733833313, -2.0447275638580322, 0.8513636589050293, -0.9753855466842651, 0.8517308235168457, 0.7154626250267029, 0.7427425980567932, 0.23048914968967438, 0.8480589985847473, -1.3015871047973633, -1.1545096635818481, -0.6710622310638428, -0.6703901886940002, 1.9443727731704712, -0.30641674995422363, 0.5415765643119812, -0.2199142724275589, -1.3101836442947388, -0.07543700933456421, 0.6982465982437134, 0.37819963693618774, -0.43647444248199463, 0.779268205165863, -0.6381102204322815, -1.0221232175827026, -1.394537329673767, -0.5187317132949829, -1.0857067108154297, -0.9173220992088318, 1.0540837049484253, 0.7680222392082214, 0.43073809146881104, 1.8935906887054443, 0.6171961426734924, 0.30192211270332336, -2.5688045024871826, 0.9345263242721558, 0.2965364158153534, -0.06273457407951355, 0.8673387169837952, 0.349187433719635, 1.114041805267334, -0.0174577459692955, 0.5748093724250793, -2.4596493244171143, 2.2831621170043945, -0.2733481526374817, 0.6846228837966919, 0.04419434070587158, -0.09081081300973892, 1.0783840417861938, 0.574561357498169, 0.5241273045539856, -1.116237998008728, 0.7165683507919312, -0.5585710406303406, 1.2153915166854858, 0.8969797492027283, -0.8622841238975525, 0.01701572723686695, 1.3567837476730347, 0.4309106469154358, -0.5026208758354187, -0.939106285572052, -0.8773757219314575, 0.9364074468612671, 1.7254743576049805, -0.008900009095668793, -0.007689569145441055, 0.8768098950386047, 0.6582545638084412, -1.2932653427124023, 0.09934087097644806, -0.6442834734916687, -0.7411303520202637, 1.6691631078720093, 2.0257365703582764, -0.13584139943122864, -0.14834901690483093, -0.718159019947052, -1.261791467666626, 0.8038994669914246, -0.04459580034017563, 0.07919172197580338, 0.672661542892456, -0.6297192573547363, 1.1102194786071777, 0.7635873556137085, 0.9484780430793762, 0.19394588470458984, 0.22556650638580322, 0.38349300622940063, -0.3120945692062378, -1.1575039625167847, -0.3447798192501068, -1.0493699312210083, -2.592923879623413, 0.441108375787735, -0.24910584092140198, -1.4295216798782349, 0.06978714466094971, -1.0176044702529907, 0.8165803551673889, -0.5776837468147278, -1.098012924194336, -1.4921740293502808, 0.27356070280075073, -0.11807667464017868, 0.9478162527084351, -1.605971097946167, -0.19603367149829865, 1.2242710590362549, 0.888778805732727, -0.6327435374259949, 0.9958770871162415, 0.23569521307945251, 0.9985540509223938, 0.8562152981758118, -0.42571333050727844, 0.5212521553039551, 0.13827496767044067, -1.3423011302947998, 0.4492647647857666, 1.257888913154602, 0.16264203190803528, 1.481375813484192, -0.514611005783081, 0.01303812861442566, 0.4355360269546509, -0.513934850692749, -0.46157845854759216, -0.5815093517303467, 0.6585280895233154, 0.05813886970281601, -1.0059393644332886, -0.05017813295125961, -0.028782490640878677, -0.28806304931640625, 0.21206951141357422, -1.4642200469970703, -0.1458655744791031, -0.38474324345588684, -0.5520691275596619, -1.3416510820388794, -0.09154562652111053, 1.2823468446731567, -0.7870113849639893, -0.12670892477035522, 0.503255307674408, 0.2858262062072754, 0.5057106614112854, 0.6909193396568298, -0.7642942667007446, -0.3505590558052063, -0.24386268854141235, -0.37599602341651917, 0.34502920508384705, 1.2777314186096191, -0.06601248681545258, -0.9782691597938538, 0.672455370426178, -0.3405933678150177, 0.13373024761676788, 1.9839167594909668, 0.05857985466718674, -0.8056362867355347, 0.3685881495475769, -0.7851528525352478, 1.9166429042816162, 1.6349185705184937, 1.2972769737243652, -0.0919513925909996, -0.9647997617721558, 0.7211630344390869, -0.2915418744087219, -0.3840031623840332, 0.8664994239807129, 0.333377867937088, -0.2789306938648224, -1.4282883405685425, 0.6642019152641296, 1.2896260023117065, -0.8229928612709045, -0.8362811207771301, 0.13741245865821838, -0.8302140831947327, 1.0986579656600952, 0.6058828830718994, 0.34957006573677063, 0.3021870255470276, 1.6200907230377197, 0.8011538982391357, -0.5108084082603455, 0.5409359931945801, 0.490756630897522, -0.12668316066265106, -2.061384439468384, -1.1088883876800537, 0.3114476501941681, -0.46265271306037903, -1.5864777565002441, 1.4269808530807495, -1.1779423952102661, -1.001999020576477, 0.6027630567550659, 0.14133614301681519, 1.3736292123794556, 0.31812354922294617, 1.6007351875305176, 2.071115255355835, 0.873374879360199, 0.40631532669067383, 1.2774605751037598, -0.18468883633613586, -0.43206602334976196, 1.7815667390823364, -0.4900914430618286, 0.554458498954773, 1.057931661605835, -0.34349921345710754, -1.1606059074401855, -0.7978134155273438, -1.1914151906967163, -0.7459210157394409, 1.1840600967407227, 0.07716813683509827, -1.0575371980667114, 0.25303730368614197, 1.6034448146820068, 0.09043381363153458, -0.2671931982040405, 0.625144898891449, 0.397573858499527, -0.7339666485786438, -0.12414509803056717, -0.945999801158905, 0.5755621194839478, -0.13484176993370056, -0.3693009614944458, 0.27719253301620483, 0.49765926599502563, 1.3162293434143066, -0.03079826384782791, 0.07682204246520996, 1.1227128505706787, -1.4576362371444702, 1.4811365604400635, -0.6909609436988831, 0.3089008331298828, -2.3274035453796387, 1.3773963451385498, -0.7670331001281738, 1.9613580703735352, -2.610987901687622, 0.42727944254875183, -0.5520117878913879, -0.5469107031822205, 0.28317147493362427, -0.2687496840953827, 0.17013861238956451, -0.16656889021396637, -1.1346819400787354, -0.05501363426446915, -0.7977835536003113, 0.5287004709243774, 1.2013182640075684, 1.3698394298553467, -1.048362374305725, -0.28077682852745056, -1.6789917945861816, -0.12080387026071548, -0.6739557981491089, 0.2262503057718277, -1.9095097780227661, -0.08182499557733536, -1.961647868156433, -2.395921230316162, -1.408072590827942, -0.852831244468689, 1.1181635856628418, 0.1901225447654724, -0.94968181848526, 1.2677044868469238, -0.337230920791626, -1.8167067766189575, 1.1395634412765503, -2.151751756668091 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Despite the comments that this has been fixed, I am finding the exact same problem is occurring again (with datasets version 2.3.2)
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
22
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Despite the comments that this has been fixed, I am finding the exact same problem is occurring again (with datasets version 2.3.2)
[ -1.2028648853302002, -0.7967610359191895, -0.7306275367736816, 1.468835711479187, -0.12877009809017181, -1.224625825881958, 0.13728907704353333, -0.9917372465133667, 1.621397614479065, -0.832856297492981, 0.32234448194503784, -1.68658447265625, 0.03943557292222977, -0.6422229409217834, -0.7515265345573425, -0.8440735936164856, -0.32472074031829834, -0.7096380591392517, 1.056845784187317, 2.436310291290283, 1.2434847354888916, -1.3699705600738525, 2.7306277751922607, 0.6563577651977539, -0.3134412169456482, -0.9425082206726074, 0.4846552014350891, -0.013788647949695587, -1.3108007907867432, -0.45436036586761475, -0.9254400134086609, -0.060091666877269745, -0.5987175703048706, -0.47725576162338257, 0.006739379838109016, 0.3756120800971985, -0.3148866891860962, -0.3476489782333374, -0.5802485346794128, -0.8459284901618958, 0.41780608892440796, -0.3406774401664734, 0.9621150493621826, -0.2865702509880066, 1.7559620141983032, -0.6598751544952393, 0.4844891428947449, 0.7026605606079102, 1.2780447006225586, 0.2645765542984009, -0.0009627630934119225, 0.3760743737220764, 0.35849130153656006, 0.0046830857172608376, 0.5416215062141418, 1.1406409740447998, 0.6831610798835754, 0.49062418937683105, 0.7113725543022156, -2.1870222091674805, 1.3776898384094238, -0.9932949542999268, 0.20735159516334534, 1.33125638961792, -0.9694884419441223, 0.30641359090805054, -1.7302385568618774, -0.13620811700820923, 0.5155655741691589, -2.2879559993743896, 0.27583158016204834, -1.3632912635803223, -0.5906383395195007, 1.013503909111023, 0.468853235244751, -1.2837519645690918, 0.05392603576183319, -0.41172027587890625, 0.9424920678138733, 0.40745413303375244, 1.0494968891143799, -1.6234052181243896, -0.07303694635629654, -0.29545241594314575, 0.09600043296813965, -1.2215840816497803, -1.5267198085784912, 0.5855507850646973, 0.5492125749588013, 0.6215362548828125, -0.12314248830080032, 1.0209763050079346, -1.0817652940750122, 0.8487951755523682, -1.0510274171829224, -1.7590574026107788, -1.3933019638061523, -2.366894483566284, -2.284931182861328, 0.8320453763008118, -0.4689829349517822, -0.5052466988563538, 2.1351511478424072, -1.088279366493225, -1.668337106704712, 1.0995690822601318, 0.24289561808109283, -0.04752197861671448, 2.4140870571136475, 0.18743447959423065, -0.7611300349235535, 0.5045785307884216, -0.80894935131073, 0.7766193151473999, -0.400223970413208, 1.275368571281433, 0.41327083110809326, -1.111276388168335, 1.5842411518096924, -0.30059587955474854, 0.5735469460487366, -0.6770361661911011, -0.5179429054260254, -0.7496543526649475, 0.2647520899772644, 1.8269354104995728, -0.23207229375839233, 1.5438483953475952, -0.24054142832756042, -1.5500866174697876, -1.5317108631134033, 0.8663455247879028, 0.473688542842865, -0.8292167782783508, 0.11287438124418259, -0.3349111080169678, 0.1531008929014206, 0.009983886033296585, 1.1716159582138062, 1.3482047319412231, 0.7443585991859436, -0.3575221300125122, -0.8235288262367249, 0.1301681399345398, -0.11196855455636978, -0.6887650489807129, -1.7501580715179443, -0.34066343307495117, 0.12147201597690582, 0.6740425229072571, -1.2375394105911255, 1.8431891202926636, 0.8799086213111877, 1.9375685453414917, 1.0304889678955078, -0.42847156524658203, 1.474812626838684, 0.09505187720060349, 1.9002940654754639, -0.4862560033798218, 0.5989310145378113, -0.456581175327301, -1.1745895147323608, 0.8731315732002258, -0.32896220684051514, -2.03037428855896, -0.6928094029426575, -0.7703537344932556, -0.19983628392219543, -0.8024506568908691, 0.9802284240722656, -0.29490047693252563, -1.386296272277832, 0.2225128710269928, -0.7102153301239014, 0.09647588431835175, -1.294566035270691, 0.26055556535720825, 0.6806814670562744, -0.629754900932312, 0.04683087766170502, -0.28381502628326416, -1.2555840015411377, -0.5018442273139954, 0.3492385745048523, 1.8497276306152344, -0.661777913570404, 1.034263014793396, 1.030575156211853, -0.6745701432228088, -0.017434336245059967, 0.3860405683517456, -0.31704258918762207, 0.8809638023376465, -1.0261995792388916, -0.4702082872390747, 1.1580216884613037, -0.2675275206565857, -0.5465248227119446, 1.4329884052276611, 0.6975563764572144, -1.0234185457229614, -0.1852785050868988, -0.10846105217933655, -0.8544917702674866, 0.02851201221346855, -1.6269845962524414, -0.19038011133670807, 0.439425528049469, -1.5614269971847534, -0.3714095950126648, -0.11550579965114594, 1.2985717058181763, -0.14805403351783752, 1.4007318019866943, -0.3433115482330322, -0.17392529547214508, -0.3901442289352417, -0.46614372730255127, 0.0830666646361351, -0.15843035280704498, -0.586631715297699, 0.29375457763671875, -0.7474979162216187, 0.2588985562324524, 1.4897485971450806, 0.2581290602684021, 0.04620885103940964, 0.4482860565185547, 1.1010476350784302, 0.3447020649909973, -0.10749778896570206, -0.906797468662262, -1.5590293407440186, 2.075824499130249, -1.4815126657485962, 2.002136707305908, 0.7839719653129578, -0.04019481688737869, -1.7891292572021484, -1.860039472579956, 1.3551236391067505, 1.085355520248413, 2.3541059494018555, 0.5241694450378418, 0.4426071047782898, -0.7806761264801025, -0.7033730745315552, 0.3660314679145813, -0.9978799819946289, -0.6902850866317749, 0.11892443895339966, 2.4819135665893555, 1.6453698873519897, -0.38052815198898315, -0.1622583121061325, -1.0153659582138062, 1.3773027658462524, -0.2467663288116455, 0.22087860107421875, 2.0053601264953613, -0.28682124614715576, -1.0453754663467407, 1.2844995260238647, -2.2912354469299316, 0.22738546133041382, 2.0818557739257812, 0.2603743076324463, 0.04103101044893265, -1.3269102573394775, -0.6444775462150574, -0.2767264246940613, -0.4751906991004944, -1.2582021951675415, 0.5085526704788208, -0.2348680943250656, -0.8122445344924927, -1.3359614610671997, 0.07035057246685028, -1.1484930515289307, -1.6973227262496948, 0.28419238328933716, 1.9062618017196655, 2.10190749168396, -0.7030951976776123, 1.4965170621871948, -0.2859981060028076, 0.08460084348917007, 1.2008705139160156, 1.2597711086273193, 3.1669118404388428, 1.8799268007278442, -1.3317416906356812, 0.6490602493286133, -0.1713666319847107, -0.4339265823364258, 1.1065753698349, -1.133608102798462, 1.245991587638855, -0.20277392864227295, -1.3045352697372437, -1.2342942953109741, 0.9737489223480225, 0.39612311124801636, -0.012389377690851688, -0.540110170841217, 1.212377905845642, 0.12171733379364014, 1.2775521278381348, 0.6134697794914246, -0.26017171144485474, 0.5474682450294495, -0.40826982259750366, -0.5526239275932312, 1.6520326137542725, 0.1956278383731842, -1.494116187095642, -2.3831262588500977, -0.20007005333900452, -0.9194533824920654, 0.03568332642316818, -0.6486135125160217, -1.016023874282837, 1.6541332006454468, 0.4023650288581848, -1.1652865409851074, -0.24827083945274353, -0.3849447965621948, -0.551293134689331, 2.7843148708343506, -1.3802977800369263, -0.16416360437870026, -0.983995795249939, -0.6457760334014893, 1.6338316202163696, -1.2153464555740356, -0.252535343170166, -0.9900266528129578, -0.5684042572975159, -1.2035176753997803, -0.45389246940612793, 0.02011379785835743, -0.9991477131843567, 0.753820538520813, 0.14260677993297577, -1.2083474397659302, -0.3210250735282898, -0.9190766215324402, 0.8994492292404175, -0.12484949082136154, 0.1636897623538971, 1.8057827949523926, 0.3421999216079712, -0.358733594417572, 0.7872238755226135, 1.2395650148391724, 0.6693547964096069, -0.6207529306411743, 0.11716578900814056, -0.6152976751327515, 0.35215312242507935, -1.2227703332901, 0.2711251974105835, -2.850287437438965, 0.5968159437179565, -0.12087585777044296, -0.08480620384216309, -0.10366865247488022, -1.2765053510665894, 1.0775458812713623, 2.496199607849121, -1.0990900993347168, 0.5259195566177368, 0.2767335772514343, 1.1620184183120728, -1.6259992122650146, 0.2309519648551941, -0.5610274076461792, 2.1435346603393555, 0.23015064001083374, 1.1341984272003174, -0.44488221406936646, -2.308234691619873, 0.6401607990264893, -1.1679350137710571, -1.0283244848251343, 0.8107408881187439, -0.7838473916053772, 0.2242400348186493, -1.332987904548645, -0.2212999165058136, -0.7747241258621216, -1.1760330200195312, 0.6739519834518433, 0.08143948763608932, 0.5301350951194763, -0.5288457870483398, 0.26424193382263184, -2.2326858043670654, -1.390493392944336, -0.15242384374141693, -0.942247748374939, 0.5303072929382324, -0.41893845796585083, 0.7271603941917419, -0.15809418261051178, -0.045195192098617554, 0.3385031819343567, 1.4884850978851318, 3.3732447624206543, 0.11847831308841705, 0.32068896293640137, -0.27416545152664185, -0.9562667012214661, 1.385825276374817, 0.9453383684158325, -0.11373397707939148, -0.6541662812232971, -1.0536876916885376, 1.3268811702728271, 1.9729646444320679, 0.9902017116546631, 0.06895051151514053, -0.8368986248970032, -0.768334686756134, 0.02017684280872345, 0.2082628309726715, 0.5307375192642212, 0.8977509140968323, 0.03821156173944473, 0.04789244383573532, 1.4294546842575073, 1.1755739450454712, -0.3480594754219055, 0.3312607407569885, -0.9023138284683228, -0.3800341486930847, 0.4790945053100586, 0.2911941409111023, -0.03543800115585327, 0.3918083906173706, -1.007213830947876, -0.2431294023990631, -0.3250553607940674, -0.8786373138427734, -0.788707971572876, -0.36427658796310425, -0.4305092692375183, 1.7288917303085327, -0.01130626816302538, -0.5037053227424622, 0.01124466210603714, -0.7321949005126953, -0.13123801350593567, -1.0987133979797363, 0.28042352199554443, -0.11639171838760376, -0.059844497591257095, -0.14909084141254425, 1.746071696281433, -1.0196925401687622, -2.0675952434539795, 0.21129408478736877, 0.23366399109363556, -0.256369948387146, 0.16339732706546783, 1.6799144744873047, 0.5731143355369568, 1.440837025642395, 1.3487696647644043, 0.9424156546592712, -0.6507614254951477, -1.318561315536499, 0.6118590235710144, 0.9875409603118896, -1.4148938655853271, 0.8719325065612793, -0.1606842279434204, -0.5067335367202759, 0.6390737295150757, 1.308733344078064, 0.4407235383987427, -2.0702266693115234, 0.8393547534942627, -0.9724454879760742, 0.8544918894767761, 0.7004073262214661, 0.739057719707489, 0.23327675461769104, 0.8185666799545288, -1.30144202709198, -1.1587761640548706, -0.6483746767044067, -0.6624785661697388, 1.930479884147644, -0.2979254126548767, 0.5747909545898438, -0.2379646599292755, -1.30402672290802, -0.039688676595687866, 0.6757622361183167, 0.367759644985199, -0.4309350848197937, 0.7740815281867981, -0.6340713500976562, -1.0686285495758057, -1.4196749925613403, -0.499393105506897, -1.1021521091461182, -0.9128411412239075, 1.043652892112732, 0.7648444175720215, 0.4231634736061096, 1.8943729400634766, 0.5872434973716736, 0.2949766516685486, -2.572117328643799, 0.9297823309898376, 0.30731523036956787, -0.0632687658071518, 0.8641233444213867, 0.3535380959510803, 1.1294803619384766, -0.024707740172743797, 0.563441812992096, -2.446944236755371, 2.314128875732422, -0.28161364793777466, 0.7050288915634155, 0.024625428020954132, -0.070606529712677, 1.0823765993118286, 0.6062991619110107, 0.5280850529670715, -1.0864771604537964, 0.7307544946670532, -0.5806902647018433, 1.2249568700790405, 0.9250202178955078, -0.8288004994392395, -0.005577046889811754, 1.3445851802825928, 0.4419846534729004, -0.4966995120048523, -0.9405366778373718, -0.8974855542182922, 0.912571907043457, 1.7264742851257324, -0.013088405132293701, -0.0049518682062625885, 0.8480006456375122, 0.6531201601028442, -1.2642353773117065, 0.13539420068264008, -0.6496531367301941, -0.7653234004974365, 1.6524806022644043, 2.0105504989624023, -0.1456817090511322, -0.13490992784500122, -0.7315053343772888, -1.2728536128997803, 0.821897029876709, -0.043675780296325684, 0.06341280043125153, 0.6551672220230103, -0.6264567971229553, 1.129137396812439, 0.8086673617362976, 0.9323838949203491, 0.23163843154907227, 0.21834613382816315, 0.35259097814559937, -0.27763599157333374, -1.1437582969665527, -0.31751304864883423, -1.0204136371612549, -2.6108994483947754, 0.45414119958877563, -0.27218347787857056, -1.4168766736984253, 0.06573846936225891, -1.018540382385254, 0.8151192665100098, -0.556029200553894, -1.1117186546325684, -1.4969574213027954, 0.26020604372024536, -0.11685337871313095, 0.957482635974884, -1.6232290267944336, -0.1896224170923233, 1.2332919836044312, 0.8856152296066284, -0.6324247121810913, 1.0182695388793945, 0.2358190417289734, 0.9884654879570007, 0.841026246547699, -0.44284552335739136, 0.5290452837944031, 0.1346079707145691, -1.3395881652832031, 0.44655531644821167, 1.2489326000213623, 0.1550249457359314, 1.4868099689483643, -0.5350890159606934, 0.014925539493560791, 0.4275543689727783, -0.4872611165046692, -0.4565662741661072, -0.6106817722320557, 0.6768763661384583, 0.03959371894598007, -0.9768299460411072, -0.04461706057190895, -0.03749701380729675, -0.2778770327568054, 0.22858870029449463, -1.427754521369934, -0.12996898591518402, -0.4073159694671631, -0.5476874709129333, -1.3651562929153442, -0.11863504350185394, 1.2869088649749756, -0.7590392827987671, -0.1178291067481041, 0.5096988081932068, 0.27537089586257935, 0.4997670650482178, 0.6929700970649719, -0.7472589015960693, -0.36091679334640503, -0.2550032138824463, -0.3443381190299988, 0.3645251393318176, 1.2652376890182495, -0.07391588389873505, -0.9732118248939514, 0.6705410480499268, -0.3107094168663025, 0.11929447948932648, 1.9942125082015991, 0.06140602380037308, -0.7946558594703674, 0.3934280276298523, -0.7675365805625916, 1.9269567728042603, 1.6450879573822021, 1.275783896446228, -0.08495243638753891, -1.005003571510315, 0.7004221677780151, -0.29774564504623413, -0.3909321427345276, 0.8564978837966919, 0.3280068039894104, -0.259732186794281, -1.4081718921661377, 0.6914845705032349, 1.298295021057129, -0.8087312579154968, -0.8358556628227234, 0.13970990478992462, -0.8304855227470398, 1.0771580934524536, 0.5924398899078369, 0.3774486184120178, 0.28004342317581177, 1.6210787296295166, 0.8001630306243896, -0.515648365020752, 0.5364586114883423, 0.4877258539199829, -0.1350785791873932, -2.0586283206939697, -1.1373705863952637, 0.3010806441307068, -0.47341102361679077, -1.5901509523391724, 1.4498018026351929, -1.1580541133880615, -0.9826638102531433, 0.6114826202392578, 0.14511407911777496, 1.373283863067627, 0.3118664026260376, 1.5873050689697266, 2.071593999862671, 0.8651655912399292, 0.43267881870269775, 1.2846654653549194, -0.19502903521060944, -0.4177408814430237, 1.7682287693023682, -0.49939584732055664, 0.5457194447517395, 1.0687575340270996, -0.34000158309936523, -1.1405421495437622, -0.794251024723053, -1.1810474395751953, -0.7509554028511047, 1.1703884601593018, 0.06922023743391037, -1.0462623834609985, 0.25023871660232544, 1.5948964357376099, 0.08906523138284683, -0.2761054039001465, 0.5869971513748169, 0.4118129014968872, -0.737702488899231, -0.13552772998809814, -0.975410521030426, 0.5755556225776672, -0.16701488196849823, -0.3627997636795044, 0.28527188301086426, 0.4786953926086426, 1.3274081945419312, -0.028485968708992004, 0.09137894213199615, 1.1604337692260742, -1.4595621824264526, 1.4845876693725586, -0.6896561980247498, 0.3074015974998474, -2.28116774559021, 1.3738913536071777, -0.7762650847434998, 1.964802622795105, -2.6216087341308594, 0.425933837890625, -0.5448451042175293, -0.5340955257415771, 0.2767573595046997, -0.26061272621154785, 0.17986099421977997, -0.18661633133888245, -1.1189063787460327, -0.07352431863546371, -0.8105224370956421, 0.4897919297218323, 1.179368019104004, 1.3817335367202759, -1.0481376647949219, -0.29682570695877075, -1.677351474761963, -0.10565067082643509, -0.6173515319824219, 0.2301638126373291, -1.9058278799057007, -0.08199206739664078, -1.9592704772949219, -2.411374807357788, -1.386383295059204, -0.8185534477233887, 1.1493582725524902, 0.1578049510717392, -0.9152555465698242, 1.2861182689666748, -0.32907944917678833, -1.8199543952941895, 1.150562047958374, -2.134795665740967 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
> Despite the comments that this has been fixed, I am finding the exact same problem is occurring again (with datasets version 2.3.2) It appears downgrading to torchaudio 0.11.0 fixed this problem.
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
32
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 > Despite the comments that this has been fixed, I am finding the exact same problem is occurring again (with datasets version 2.3.2) It appears downgrading to torchaudio 0.11.0 fixed this problem.
[ -1.2182871103286743, -0.8033661842346191, -0.7231054306030273, 1.4594700336456299, -0.15133699774742126, -1.2276586294174194, 0.13847248256206512, -0.9961664080619812, 1.6304653882980347, -0.8361271619796753, 0.3123502731323242, -1.6824687719345093, 0.05228857323527336, -0.6234197616577148, -0.7406986951828003, -0.8389926552772522, -0.32487809658050537, -0.7017605900764465, 1.0438669919967651, 2.43888258934021, 1.2431342601776123, -1.3685476779937744, 2.7218270301818848, 0.6690879464149475, -0.31360119581222534, -0.9417672157287598, 0.48774248361587524, -0.00344545254483819, -1.335495114326477, -0.45306074619293213, -0.9252258539199829, -0.045735493302345276, -0.5949625968933105, -0.46559011936187744, 0.016819214448332787, 0.3697717785835266, -0.30082154273986816, -0.35023587942123413, -0.578191876411438, -0.8172759413719177, 0.42268288135528564, -0.3527790904045105, 0.969520628452301, -0.27583563327789307, 1.7463362216949463, -0.6663322448730469, 0.4931942820549011, 0.7000266313552856, 1.2800439596176147, 0.2562936544418335, 0.005372135899960995, 0.36753469705581665, 0.37189167737960815, 0.02050052210688591, 0.5197980403900146, 1.132066249847412, 0.6820005178451538, 0.47674161195755005, 0.7097194790840149, -2.1919608116149902, 1.3668992519378662, -0.9951480031013489, 0.20431004464626312, 1.3273742198944092, -0.9754291772842407, 0.30042630434036255, -1.739756464958191, -0.12976385653018951, 0.5294978022575378, -2.295990228652954, 0.2685777544975281, -1.3690654039382935, -0.580207347869873, 1.0070873498916626, 0.4563853144645691, -1.268498420715332, 0.05868089944124222, -0.4157620668411255, 0.9350365400314331, 0.43530839681625366, 1.0507335662841797, -1.6184622049331665, -0.06700542569160461, -0.29694879055023193, 0.09884601086378098, -1.2192764282226562, -1.5176736116409302, 0.5927778482437134, 0.5684360265731812, 0.6130337119102478, -0.1279556006193161, 1.0357705354690552, -1.071329951286316, 0.8505721092224121, -1.0503264665603638, -1.7570164203643799, -1.4067920446395874, -2.3641676902770996, -2.276409864425659, 0.8251015543937683, -0.47420912981033325, -0.4973839521408081, 2.1214067935943604, -1.1018742322921753, -1.688926100730896, 1.112165093421936, 0.2335488349199295, -0.044287919998168945, 2.3951563835144043, 0.17356635630130768, -0.7578979134559631, 0.5007862448692322, -0.8085361123085022, 0.784501850605011, -0.40075892210006714, 1.2564600706100464, 0.40020596981048584, -1.1019659042358398, 1.5741157531738281, -0.28905272483825684, 0.5743889212608337, -0.6886475682258606, -0.5189350247383118, -0.7515945434570312, 0.2594375014305115, 1.8289268016815186, -0.25020307302474976, 1.5369923114776611, -0.24526630342006683, -1.5546739101409912, -1.538421392440796, 0.8600406050682068, 0.4882499575614929, -0.8067180514335632, 0.1129579246044159, -0.3465006947517395, 0.15063247084617615, -0.0007693963125348091, 1.1590713262557983, 1.3392173051834106, 0.7607252597808838, -0.34905368089675903, -0.8246380686759949, 0.14477071166038513, -0.09869147837162018, -0.6857762932777405, -1.7559906244277954, -0.3370853066444397, 0.11688043177127838, 0.6834888458251953, -1.2286505699157715, 1.8411346673965454, 0.8809149265289307, 1.942785382270813, 1.0306637287139893, -0.4262744188308716, 1.4940232038497925, 0.1040482372045517, 1.8730647563934326, -0.4881090521812439, 0.5993145704269409, -0.4648837447166443, -1.1626315116882324, 0.8670818209648132, -0.3211197853088379, -2.0145058631896973, -0.6740861535072327, -0.7748692035675049, -0.20481325685977936, -0.8171775341033936, 0.9819737076759338, -0.29582953453063965, -1.375727891921997, 0.21458221971988678, -0.7015282511711121, 0.07629445940256119, -1.2854788303375244, 0.271140992641449, 0.6841133236885071, -0.6308910250663757, 0.06331812590360641, -0.29680323600769043, -1.2545814514160156, -0.4972376227378845, 0.34556907415390015, 1.8520162105560303, -0.6518017649650574, 1.0317432880401611, 1.030236005783081, -0.6776442527770996, -0.010043487884104252, 0.38534557819366455, -0.3088262677192688, 0.8632655143737793, -1.0214641094207764, -0.4586601257324219, 1.1768066883087158, -0.28390657901763916, -0.5415043234825134, 1.4440326690673828, 0.6881563663482666, -1.0249452590942383, -0.19839367270469666, -0.11021433025598526, -0.8352059721946716, 0.025905974209308624, -1.6310538053512573, -0.19229482114315033, 0.44008868932724, -1.5570158958435059, -0.3889009356498718, -0.11284512281417847, 1.2867857217788696, -0.14985138177871704, 1.4034013748168945, -0.32400017976760864, -0.17695601284503937, -0.3876432776451111, -0.4642178416252136, 0.07496879249811172, -0.15149535238742828, -0.5942570567131042, 0.3090885877609253, -0.7804135680198669, 0.26362621784210205, 1.4892833232879639, 0.244818314909935, 0.038339320570230484, 0.4547464847564697, 1.0821514129638672, 0.3568344712257385, -0.10913760960102081, -0.9164102673530579, -1.5606642961502075, 2.0871450901031494, -1.4883615970611572, 2.0017917156219482, 0.7902413606643677, -0.050323911011219025, -1.789162278175354, -1.8703773021697998, 1.3454567193984985, 1.07171630859375, 2.3530681133270264, 0.5175043940544128, 0.44605493545532227, -0.770226240158081, -0.7033165693283081, 0.35758787393569946, -1.0096420049667358, -0.6987684965133667, 0.12231135368347168, 2.489504098892212, 1.6402701139450073, -0.36932510137557983, -0.15914376080036163, -1.0214849710464478, 1.3650486469268799, -0.22210593521595, 0.2360960841178894, 1.9919153451919556, -0.2789556384086609, -1.034980297088623, 1.2830300331115723, -2.2908287048339844, 0.2253248393535614, 2.0744147300720215, 0.254591703414917, 0.04890294745564461, -1.3382177352905273, -0.6366782784461975, -0.28873902559280396, -0.47267580032348633, -1.2634532451629639, 0.5194777250289917, -0.2456064224243164, -0.8182319402694702, -1.34363853931427, 0.08195696026086807, -1.150414228439331, -1.693255066871643, 0.2903617024421692, 1.9053099155426025, 2.1031911373138428, -0.6934788823127747, 1.4854753017425537, -0.2950546145439148, 0.07136965543031693, 1.1892187595367432, 1.2490938901901245, 3.1705169677734375, 1.8957182168960571, -1.329365849494934, 0.6498231887817383, -0.17610594630241394, -0.4225301146507263, 1.09661865234375, -1.120998740196228, 1.247401237487793, -0.2135317325592041, -1.2955881357192993, -1.2392863035202026, 0.989870011806488, 0.40452057123184204, -0.008868577890098095, -0.562014639377594, 1.2100080251693726, 0.11801604926586151, 1.280004620552063, 0.6014963388442993, -0.2532240152359009, 0.5566519498825073, -0.3998386859893799, -0.5494667291641235, 1.6429320573806763, 0.1946353018283844, -1.4924606084823608, -2.3859317302703857, -0.20157784223556519, -0.9270379543304443, 0.035729095339775085, -0.6288823485374451, -1.009330153465271, 1.6664851903915405, 0.38991832733154297, -1.1741055250167847, -0.23704826831817627, -0.37800365686416626, -0.549921452999115, 2.787036657333374, -1.375375747680664, -0.1747666597366333, -0.9838776588439941, -0.6406445503234863, 1.6356314420700073, -1.2302573919296265, -0.24060407280921936, -1.0006564855575562, -0.563026487827301, -1.223264455795288, -0.4648928642272949, 0.028656527400016785, -0.9951595664024353, 0.7571989297866821, 0.13089287281036377, -1.1984164714813232, -0.3283218741416931, -0.9180861711502075, 0.9105754494667053, -0.11750635504722595, 0.15355835855007172, 1.8243248462677002, 0.3374931812286377, -0.3576670289039612, 0.7882413268089294, 1.2214117050170898, 0.665116548538208, -0.637199878692627, 0.11688175797462463, -0.6136500835418701, 0.36680150032043457, -1.2302366495132446, 0.2884374260902405, -2.849432945251465, 0.6033746600151062, -0.09996848553419113, -0.07477805018424988, -0.10045906901359558, -1.2686889171600342, 1.0824495553970337, 2.5089733600616455, -1.1133087873458862, 0.5311987996101379, 0.28401100635528564, 1.1624425649642944, -1.6000123023986816, 0.24839289486408234, -0.5563958883285522, 2.158400058746338, 0.24024273455142975, 1.1448661088943481, -0.44475919008255005, -2.3233554363250732, 0.640897810459137, -1.1709835529327393, -1.043869972229004, 0.7982112765312195, -0.7977146506309509, 0.20897167921066284, -1.3464159965515137, -0.2103295475244522, -0.7792067527770996, -1.1773169040679932, 0.6867666244506836, 0.1061808317899704, 0.5448765158653259, -0.5494362711906433, 0.26983726024627686, -2.23911714553833, -1.376515507698059, -0.16252200305461884, -0.9446567296981812, 0.5201506614685059, -0.42020225524902344, 0.7389241456985474, -0.15539385378360748, -0.05811285227537155, 0.34710776805877686, 1.4829156398773193, 3.3742079734802246, 0.11417855322360992, 0.3076205849647522, -0.274056077003479, -0.9487771391868591, 1.3820817470550537, 0.9485531449317932, -0.11400666832923889, -0.645853579044342, -1.0496362447738647, 1.3183897733688354, 1.9717624187469482, 0.9952623844146729, 0.06273483484983444, -0.8518906235694885, -0.7838361859321594, 0.016207609325647354, 0.21034643054008484, 0.5410695672035217, 0.8850104212760925, 0.031062256544828415, 0.06494539231061935, 1.4379000663757324, 1.1793760061264038, -0.33428770303726196, 0.3294007182121277, -0.8997321128845215, -0.3728695511817932, 0.4854148030281067, 0.3091990351676941, -0.03847264125943184, 0.39669424295425415, -1.0098857879638672, -0.24438537657260895, -0.33340317010879517, -0.878818154335022, -0.7801626920700073, -0.35793787240982056, -0.42315542697906494, 1.72745943069458, 0.0030262256041169167, -0.5005667805671692, -0.0022681071422994137, -0.754761278629303, -0.124806709587574, -1.094497561454773, 0.2862122058868408, -0.12464544922113419, -0.05910477414727211, -0.1383107453584671, 1.7485148906707764, -1.007703423500061, -2.052905559539795, 0.22221006453037262, 0.21717293560504913, -0.2553037405014038, 0.16292358934879303, 1.6841036081314087, 0.5809271335601807, 1.4215099811553955, 1.34356689453125, 0.9482080340385437, -0.6485064029693604, -1.308748722076416, 0.6074336171150208, 0.9778437614440918, -1.4054232835769653, 0.8830236196517944, -0.16027505695819855, -0.5075151324272156, 0.6449061036109924, 1.2973283529281616, 0.4315530061721802, -2.0828545093536377, 0.8543093800544739, -0.9575519561767578, 0.8477242588996887, 0.7196182608604431, 0.7449735999107361, 0.21842706203460693, 0.8135890960693359, -1.292190670967102, -1.1442794799804688, -0.6419872045516968, -0.6587196588516235, 1.9446393251419067, -0.29977166652679443, 0.5690082907676697, -0.24215459823608398, -1.2994086742401123, -0.05184948816895485, 0.6562464237213135, 0.3720192313194275, -0.4294355511665344, 0.7817467451095581, -0.6342218518257141, -1.0694226026535034, -1.4156208038330078, -0.5256364941596985, -1.0777565240859985, -0.9224830269813538, 1.0531532764434814, 0.7660297155380249, 0.43009239435195923, 1.903303623199463, 0.5751917362213135, 0.2895883321762085, -2.577115297317505, 0.9374954700469971, 0.3160092830657959, -0.053290221840143204, 0.8687785267829895, 0.34810322523117065, 1.1215451955795288, -0.025902243331074715, 0.5674093961715698, -2.4532759189605713, 2.308183193206787, -0.284112811088562, 0.714381217956543, 0.041181210428476334, -0.05824243277311325, 1.0745748281478882, 0.618452250957489, 0.5452350974082947, -1.0972641706466675, 0.7350713014602661, -0.5839570164680481, 1.2405825853347778, 0.9356623888015747, -0.8330767750740051, -0.008155123330652714, 1.3472442626953125, 0.4266000986099243, -0.5097627639770508, -0.9411758780479431, -0.896615207195282, 0.9188767075538635, 1.7320173978805542, -0.00574797298759222, 0.0021921489387750626, 0.8545519113540649, 0.6612561941146851, -1.2670046091079712, 0.12304383516311646, -0.6603175401687622, -0.7502326965332031, 1.6420279741287231, 2.0040745735168457, -0.144609272480011, -0.13567766547203064, -0.7233867645263672, -1.2594026327133179, 0.8222491145133972, -0.04947056248784065, 0.07331457734107971, 0.6724840998649597, -0.6230013966560364, 1.10216224193573, 0.8148879408836365, 0.9481960535049438, 0.22071963548660278, 0.23059269785881042, 0.353760302066803, -0.2828386425971985, -1.146357774734497, -0.3289499282836914, -1.0228077173233032, -2.6010804176330566, 0.44783055782318115, -0.2712150812149048, -1.4116547107696533, 0.06096508353948593, -1.0294948816299438, 0.8097723722457886, -0.5665239095687866, -1.0958480834960938, -1.4763911962509155, 0.2462897151708603, -0.12313004583120346, 0.9527208209037781, -1.6374318599700928, -0.18596357107162476, 1.222212314605713, 0.903450071811676, -0.6203033328056335, 1.0318607091903687, 0.24214760959148407, 0.9965074062347412, 0.8336597084999084, -0.45123863220214844, 0.5144657492637634, 0.1460195630788803, -1.3338630199432373, 0.4361899495124817, 1.2385097742080688, 0.16553877294063568, 1.4778717756271362, -0.555523157119751, 0.008922146633267403, 0.4252864122390747, -0.5055644512176514, -0.45270830392837524, -0.6042687892913818, 0.6766183376312256, 0.033686500042676926, -0.9758660793304443, -0.05538392439484596, -0.050304822623729706, -0.2710632085800171, 0.21055710315704346, -1.4247708320617676, -0.12275077402591705, -0.39165520668029785, -0.5483700633049011, -1.360932469367981, -0.10833132266998291, 1.2865674495697021, -0.7717565894126892, -0.11394558101892471, 0.4893572926521301, 0.2830932140350342, 0.49490004777908325, 0.6964542865753174, -0.7421831488609314, -0.3647499084472656, -0.2421521693468094, -0.34462928771972656, 0.36949479579925537, 1.271950125694275, -0.0813179537653923, -0.9786847233772278, 0.6602120995521545, -0.3135206699371338, 0.12950149178504944, 1.9943164587020874, 0.0629594698548317, -0.7930642366409302, 0.377727746963501, -0.7732897996902466, 1.916537880897522, 1.6468907594680786, 1.2784380912780762, -0.09216701239347458, -1.0045989751815796, 0.7032546997070312, -0.2993226647377014, -0.405856728553772, 0.8468010425567627, 0.33876943588256836, -0.2602729797363281, -1.4113671779632568, 0.6842438578605652, 1.2873848676681519, -0.8247809410095215, -0.820666491985321, 0.13606327772140503, -0.8231857419013977, 1.0764540433883667, 0.6042202711105347, 0.36488258838653564, 0.2795853018760681, 1.6369279623031616, 0.8023730516433716, -0.5277167558670044, 0.5517507791519165, 0.47687625885009766, -0.127864271402359, -2.0726637840270996, -1.1318410634994507, 0.3123156428337097, -0.46505916118621826, -1.6010428667068481, 1.4566071033477783, -1.1704033613204956, -0.9873259663581848, 0.6121745705604553, 0.15424953401088715, 1.3778951168060303, 0.3126763105392456, 1.601115345954895, 2.0731565952301025, 0.8645298480987549, 0.4235750436782837, 1.2823925018310547, -0.19660522043704987, -0.43093496561050415, 1.7565511465072632, -0.5087457299232483, 0.5515146255493164, 1.0726767778396606, -0.34287452697753906, -1.1207921504974365, -0.7895612120628357, -1.1980581283569336, -0.7536329627037048, 1.1688601970672607, 0.07798807322978973, -1.0541630983352661, 0.25585705041885376, 1.5943652391433716, 0.0814385786652565, -0.2687309980392456, 0.5889689922332764, 0.4185163974761963, -0.7391573190689087, -0.14401878416538239, -0.9674792289733887, 0.5734485387802124, -0.16430385410785675, -0.3702508211135864, 0.2763296365737915, 0.46972358226776123, 1.3248143196105957, -0.019058575853705406, 0.08138790726661682, 1.1819531917572021, -1.4572381973266602, 1.48587965965271, -0.6988245248794556, 0.30509287118911743, -2.2907233238220215, 1.3791818618774414, -0.7920331954956055, 1.9490771293640137, -2.621509075164795, 0.41047632694244385, -0.5432255864143372, -0.5407482385635376, 0.27135562896728516, -0.25594764947891235, 0.1624392867088318, -0.18629342317581177, -1.115480899810791, -0.05959014594554901, -0.8079323768615723, 0.49058961868286133, 1.1737810373306274, 1.3843683004379272, -1.0537346601486206, -0.28465408086776733, -1.687819242477417, -0.10925907641649246, -0.6305371522903442, 0.2515984773635864, -1.909508466720581, -0.09917885810136795, -1.9613474607467651, -2.4183270931243896, -1.3870151042938232, -0.815320611000061, 1.1462268829345703, 0.1455262452363968, -0.9058524370193481, 1.2735320329666138, -0.311495840549469, -1.8312976360321045, 1.1251050233840942, -2.124645709991455 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
@patrickvonplaten @lhoestq @polinaeterna I was unable to load audio from Common Voice using 🤗 with the current version of torchaudio, but downgrading to torchaudio 0.11.0 fixed it. This is probably more of a torch problem than a Hugging Face problem.
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
40
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 @patrickvonplaten @lhoestq @polinaeterna I was unable to load audio from Common Voice using 🤗 with the current version of torchaudio, but downgrading to torchaudio 0.11.0 fixed it. This is probably more of a torch problem than a Hugging Face problem.
[ -1.1905149221420288, -0.7921594977378845, -0.7168384194374084, 1.4701356887817383, -0.1533428579568863, -1.2143727540969849, 0.1725270003080368, -0.9808933734893799, 1.6113502979278564, -0.8315277099609375, 0.3225761950016022, -1.6618098020553589, 0.05565189570188522, -0.6441161036491394, -0.7513597011566162, -0.838046133518219, -0.3497622609138489, -0.6837807297706604, 1.0517123937606812, 2.4358408451080322, 1.2432118654251099, -1.3615998029708862, 2.7311885356903076, 0.6842049956321716, -0.3055403530597687, -0.9500361680984497, 0.45940113067626953, -0.008411236107349396, -1.3035610914230347, -0.4495823383331299, -0.9297965168952942, -0.06658194214105606, -0.6051782965660095, -0.47490057349205017, 0.016254205256700516, 0.37540194392204285, -0.302700012922287, -0.3465017080307007, -0.5878369808197021, -0.8241899609565735, 0.43720659613609314, -0.3698927164077759, 0.9782124757766724, -0.2758885622024536, 1.7701497077941895, -0.6756885051727295, 0.4815340042114258, 0.7016448378562927, 1.2849347591400146, 0.2712092101573944, 0.022002488374710083, 0.38316670060157776, 0.3659558892250061, -0.01765882410109043, 0.5304941534996033, 1.141703724861145, 0.6763156652450562, 0.48676177859306335, 0.7346130609512329, -2.1820569038391113, 1.374237060546875, -0.9794976711273193, 0.23232676088809967, 1.3332557678222656, -0.9712966084480286, 0.30882105231285095, -1.7421302795410156, -0.12468650192022324, 0.5211716294288635, -2.2813310623168945, 0.274705171585083, -1.3362501859664917, -0.6028857827186584, 0.9949870705604553, 0.4537478983402252, -1.2605643272399902, 0.08136036247015, -0.43355703353881836, 0.9316369891166687, 0.40507593750953674, 1.0523651838302612, -1.617256760597229, -0.07901045680046082, -0.31626707315444946, 0.12608981132507324, -1.2047983407974243, -1.5158058404922485, 0.5916547775268555, 0.5534783601760864, 0.6205082535743713, -0.14297641813755035, 1.0330438613891602, -1.0721557140350342, 0.870091438293457, -1.074600100517273, -1.768755555152893, -1.4074891805648804, -2.342191219329834, -2.2703816890716553, 0.8457638621330261, -0.4704183042049408, -0.5085383653640747, 2.1116740703582764, -1.0966750383377075, -1.6800780296325684, 1.1363413333892822, 0.23623128235340118, -0.05724012479186058, 2.415311574935913, 0.17281126976013184, -0.7524571418762207, 0.506392776966095, -0.8140653967857361, 0.7815026044845581, -0.39919281005859375, 1.2731245756149292, 0.39211305975914, -1.0926084518432617, 1.5593230724334717, -0.3170092701911926, 0.578904926776886, -0.690632700920105, -0.5298080444335938, -0.7595167756080627, 0.26460352540016174, 1.8379400968551636, -0.22996889054775238, 1.5435712337493896, -0.2545703053474426, -1.5762145519256592, -1.555106520652771, 0.8728427886962891, 0.45403608679771423, -0.7943539619445801, 0.10501887649297714, -0.3419573903083801, 0.15435336530208588, 0.006402001716196537, 1.1349676847457886, 1.3296608924865723, 0.7494969964027405, -0.3445688784122467, -0.838654637336731, 0.12776076793670654, -0.09984292834997177, -0.6926031112670898, -1.7645512819290161, -0.34268397092819214, 0.13214649260044098, 0.6694533228874207, -1.229792594909668, 1.8154566287994385, 0.8833534121513367, 1.9585909843444824, 1.036047339439392, -0.4245983362197876, 1.5074106454849243, 0.10462533682584763, 1.8676159381866455, -0.5016879439353943, 0.6068506836891174, -0.47214439511299133, -1.1608390808105469, 0.8698362708091736, -0.3340633809566498, -2.0297622680664062, -0.6926175355911255, -0.7597008943557739, -0.2156527042388916, -0.8003151416778564, 0.9923846125602722, -0.3024378716945648, -1.388877511024475, 0.22438973188400269, -0.6954025030136108, 0.07379700243473053, -1.2965421676635742, 0.26465386152267456, 0.6910459399223328, -0.6279745697975159, 0.06804728507995605, -0.2824285924434662, -1.2606651782989502, -0.4921725392341614, 0.3291090726852417, 1.8521100282669067, -0.6238935589790344, 1.0110939741134644, 1.0313128232955933, -0.6711426377296448, -0.011151229031383991, 0.3821614384651184, -0.3007679283618927, 0.8484847545623779, -1.0237164497375488, -0.45258206129074097, 1.177182912826538, -0.2685094177722931, -0.5351703763008118, 1.422849416732788, 0.7181912660598755, -1.0344160795211792, -0.20059873163700104, -0.10654675215482712, -0.8401747345924377, 0.02067793533205986, -1.6187872886657715, -0.19194649159908295, 0.41241341829299927, -1.560910701751709, -0.37755468487739563, -0.14159032702445984, 1.2595232725143433, -0.17549309134483337, 1.390557885169983, -0.31823301315307617, -0.18076026439666748, -0.37800493836402893, -0.46783480048179626, 0.0770307406783104, -0.16547098755836487, -0.610978364944458, 0.3029857575893402, -0.7468903660774231, 0.2733234167098999, 1.494710922241211, 0.24629329144954681, 0.0764790028333664, 0.4406128525733948, 1.0740553140640259, 0.3503369390964508, -0.09026668220758438, -0.9370094537734985, -1.5573980808258057, 2.081796169281006, -1.4726026058197021, 2.0093326568603516, 0.8033246397972107, -0.0450875386595726, -1.7748942375183105, -1.8310295343399048, 1.3417301177978516, 1.1022740602493286, 2.3771910667419434, 0.517045795917511, 0.44058719277381897, -0.768974244594574, -0.702680230140686, 0.3530333638191223, -1.0272371768951416, -0.7065560221672058, 0.132914736866951, 2.502519130706787, 1.6539932489395142, -0.36366644501686096, -0.1688971221446991, -1.0079379081726074, 1.3878103494644165, -0.22329555451869965, 0.21525967121124268, 1.996785044670105, -0.28708210587501526, -1.0300568342208862, 1.2771705389022827, -2.278730630874634, 0.22829702496528625, 2.0572409629821777, 0.26252567768096924, 0.04568040370941162, -1.3294748067855835, -0.6532201766967773, -0.300393670797348, -0.47848600149154663, -1.2779433727264404, 0.5039718747138977, -0.2557162046432495, -0.7980870008468628, -1.353785753250122, 0.09531428664922714, -1.1382098197937012, -1.6675066947937012, 0.275804728269577, 1.9071598052978516, 2.0849320888519287, -0.6951867938041687, 1.4921014308929443, -0.3073110580444336, 0.08288618177175522, 1.1792044639587402, 1.2567217350006104, 3.1697378158569336, 1.8955905437469482, -1.2993489503860474, 0.643925130367279, -0.19980674982070923, -0.430739164352417, 1.0814398527145386, -1.1377043724060059, 1.2646026611328125, -0.19236449897289276, -1.2738491296768188, -1.2428890466690063, 0.9811351299285889, 0.3925337493419647, -0.012968378141522408, -0.5323203206062317, 1.19967520236969, 0.13400891423225403, 1.2821016311645508, 0.6049798130989075, -0.24169223010540009, 0.554327130317688, -0.4035394787788391, -0.5551247000694275, 1.651247262954712, 0.19783633947372437, -1.4895230531692505, -2.376447916030884, -0.21567177772521973, -0.9257845878601074, 0.022400185465812683, -0.6268431544303894, -1.0252225399017334, 1.6657423973083496, 0.35563546419143677, -1.1897616386413574, -0.21870185434818268, -0.36098071932792664, -0.5419613122940063, 2.7986812591552734, -1.3888187408447266, -0.18244557082653046, -0.9740960001945496, -0.6447117924690247, 1.6427929401397705, -1.2104979753494263, -0.23716673254966736, -1.006005883216858, -0.56142657995224, -1.1919646263122559, -0.45359736680984497, 0.020108863711357117, -0.99470454454422, 0.7531545162200928, 0.15074212849140167, -1.230782389640808, -0.34102994203567505, -0.9325923919677734, 0.9047678709030151, -0.10828454792499542, 0.1780393272638321, 1.815047025680542, 0.34283268451690674, -0.3707790672779083, 0.784398078918457, 1.2188271284103394, 0.659633457660675, -0.6428812742233276, 0.09989932179450989, -0.6320587396621704, 0.33175721764564514, -1.211478352546692, 0.29852110147476196, -2.830552339553833, 0.6158657670021057, -0.11178859323263168, -0.09831307828426361, -0.09038164466619492, -1.2666866779327393, 1.1021970510482788, 2.521980047225952, -1.0860295295715332, 0.521449863910675, 0.28676357865333557, 1.1657689809799194, -1.6109483242034912, 0.2282848358154297, -0.5373532772064209, 2.1494691371917725, 0.21814438700675964, 1.1538742780685425, -0.45900970697402954, -2.3329017162323, 0.6365242004394531, -1.1805970668792725, -1.0478135347366333, 0.8115206360816956, -0.7876018285751343, 0.2013237029314041, -1.3411226272583008, -0.2197985202074051, -0.7819045782089233, -1.1927025318145752, 0.6790595650672913, 0.1042502224445343, 0.5565773844718933, -0.5684062838554382, 0.26011455059051514, -2.2420947551727295, -1.4096689224243164, -0.17681236565113068, -0.936851978302002, 0.5215495824813843, -0.41288989782333374, 0.7409701943397522, -0.1691761016845703, -0.06462959200143814, 0.35251474380493164, 1.4984840154647827, 3.374347448348999, 0.12896911799907684, 0.33434152603149414, -0.2687396705150604, -0.9283334612846375, 1.3818027973175049, 0.9440475106239319, -0.08848651498556137, -0.643473207950592, -1.0365699529647827, 1.3130526542663574, 1.9873493909835815, 1.0183825492858887, 0.05042794346809387, -0.8304717540740967, -0.7600502967834473, 0.02218148112297058, 0.213952898979187, 0.5055511593818665, 0.8947135210037231, 0.027402963489294052, 0.04215320572257042, 1.447779655456543, 1.1858991384506226, -0.37521326541900635, 0.32083964347839355, -0.8907988667488098, -0.3743881285190582, 0.47090959548950195, 0.3012649118900299, -0.05964145436882973, 0.38062307238578796, -1.0060040950775146, -0.2399330586194992, -0.3575240671634674, -0.8888431191444397, -0.7906461358070374, -0.367253839969635, -0.4278718829154968, 1.7439428567886353, 0.014701894484460354, -0.494973361492157, -0.003908023238182068, -0.7349867820739746, -0.11904271692037582, -1.1034595966339111, 0.2622089684009552, -0.10816685110330582, -0.0634782463312149, -0.1444581151008606, 1.7659566402435303, -1.0361138582229614, -2.057889223098755, 0.21806004643440247, 0.21946565806865692, -0.2554599940776825, 0.16344524919986725, 1.6877788305282593, 0.5636556148529053, 1.4261231422424316, 1.338158130645752, 0.9520822167396545, -0.6575983166694641, -1.3089827299118042, 0.6044567227363586, 0.9810909628868103, -1.385644793510437, 0.8888431191444397, -0.15186366438865662, -0.4990173578262329, 0.643801212310791, 1.2772971391677856, 0.43183478713035583, -2.074232578277588, 0.8507882952690125, -0.9714223742485046, 0.8484908938407898, 0.7099614143371582, 0.7160870432853699, 0.22410376369953156, 0.8326799869537354, -1.2812470197677612, -1.1672405004501343, -0.6683986783027649, -0.6574987769126892, 1.9369066953659058, -0.29464825987815857, 0.5778270959854126, -0.22574575245380402, -1.297215461730957, -0.039643146097660065, 0.6688831448554993, 0.38749730587005615, -0.45679551362991333, 0.7628016471862793, -0.6405506134033203, -1.0836539268493652, -1.4261302947998047, -0.5220288038253784, -1.0979262590408325, -0.927609384059906, 1.071638822555542, 0.7583233118057251, 0.41572389006614685, 1.891620397567749, 0.6120144724845886, 0.29137083888053894, -2.5815484523773193, 0.9338645935058594, 0.2997046709060669, -0.03870953246951103, 0.8647482395172119, 0.3441472053527832, 1.106579065322876, -0.006532874424010515, 0.548269510269165, -2.452791690826416, 2.2998900413513184, -0.2718437612056732, 0.7097846865653992, 0.021037325263023376, -0.06916181743144989, 1.0677872896194458, 0.6198554635047913, 0.5242283344268799, -1.0861364603042603, 0.7090820074081421, -0.5657522082328796, 1.2555460929870605, 0.9158759713172913, -0.8172239065170288, 0.0019925544038414955, 1.3358125686645508, 0.4149928092956543, -0.5205689072608948, -0.9442360997200012, -0.9048269987106323, 0.9126251339912415, 1.7275655269622803, -0.00622192956507206, -0.00984865427017212, 0.858558177947998, 0.6570214629173279, -1.2650400400161743, 0.13568119704723358, -0.659466028213501, -0.7774714231491089, 1.6254774332046509, 2.0295679569244385, -0.16322985291481018, -0.1585770845413208, -0.7305185198783875, -1.2521897554397583, 0.832255482673645, -0.032188091427087784, 0.08391270041465759, 0.6594451069831848, -0.6205401420593262, 1.1081539392471313, 0.8077132701873779, 0.9421966671943665, 0.24775026738643646, 0.23590262234210968, 0.38038909435272217, -0.28830018639564514, -1.136967420578003, -0.31735050678253174, -1.0230191946029663, -2.6120712757110596, 0.44668328762054443, -0.2666502594947815, -1.413914442062378, 0.0607953816652298, -1.0397547483444214, 0.806978166103363, -0.5552178621292114, -1.0821770429611206, -1.500861406326294, 0.25576213002204895, -0.11434940993785858, 0.9433847069740295, -1.6312756538391113, -0.1676883101463318, 1.2021992206573486, 0.9027193784713745, -0.6240629553794861, 1.0339821577072144, 0.22470968961715698, 0.9854536056518555, 0.8696601986885071, -0.43013373017311096, 0.5116777420043945, 0.1487121880054474, -1.3336771726608276, 0.4316665232181549, 1.253658652305603, 0.15766838192939758, 1.4708459377288818, -0.5437067747116089, 0.014450973831117153, 0.4117414951324463, -0.4994584321975708, -0.4606054127216339, -0.5972174406051636, 0.6673398017883301, 0.037274885922670364, -0.9698437452316284, -0.03653136268258095, -0.04620107635855675, -0.27928709983825684, 0.20024344325065613, -1.4297754764556885, -0.12240882217884064, -0.39361968636512756, -0.5490456223487854, -1.370306372642517, -0.1139909029006958, 1.2963944673538208, -0.7536614537239075, -0.12140985578298569, 0.4910736083984375, 0.2976182699203491, 0.48853737115859985, 0.6863642334938049, -0.7571431994438171, -0.35616573691368103, -0.23337462544441223, -0.34453409910202026, 0.3821689784526825, 1.294715166091919, -0.08020499348640442, -0.9649496078491211, 0.6648144125938416, -0.32538557052612305, 0.10669554024934769, 2.0139198303222656, 0.08431296795606613, -0.7867805361747742, 0.36092668771743774, -0.7705320715904236, 1.9301857948303223, 1.6683803796768188, 1.273624062538147, -0.0976911336183548, -1.0132519006729126, 0.7227194905281067, -0.295794814825058, -0.4151647686958313, 0.8590177893638611, 0.31447747349739075, -0.28509965538978577, -1.4149391651153564, 0.6777303218841553, 1.3127144575119019, -0.7947157025337219, -0.8367562294006348, 0.1397019773721695, -0.8298352956771851, 1.0845580101013184, 0.611803412437439, 0.36393192410469055, 0.25308313965797424, 1.6287868022918701, 0.8078187704086304, -0.5150930881500244, 0.5679705739021301, 0.46219372749328613, -0.12707898020744324, -2.0739681720733643, -1.1396005153656006, 0.30760279297828674, -0.4584164619445801, -1.596236228942871, 1.4503872394561768, -1.1692171096801758, -1.0082603693008423, 0.61344313621521, 0.1324317753314972, 1.3946202993392944, 0.3098876178264618, 1.5977973937988281, 2.081597328186035, 0.8616393208503723, 0.416207879781723, 1.274431586265564, -0.20632842183113098, -0.451552152633667, 1.7764240503311157, -0.49900126457214355, 0.5534772276878357, 1.0687941312789917, -0.3290766775608063, -1.1304901838302612, -0.7893454432487488, -1.1855403184890747, -0.7410226464271545, 1.18045175075531, 0.07585785537958145, -1.0456833839416504, 0.24700947105884552, 1.602532148361206, 0.08105672895908356, -0.27621063590049744, 0.5939637422561646, 0.4223554730415344, -0.7472324967384338, -0.12888649106025696, -0.9814960360527039, 0.5618138313293457, -0.16415449976921082, -0.36214715242385864, 0.27881690859794617, 0.479779988527298, 1.3157284259796143, -0.018552612513303757, 0.08291953057050705, 1.1603821516036987, -1.4886664152145386, 1.4747416973114014, -0.6917372345924377, 0.3056129217147827, -2.303274631500244, 1.3654062747955322, -0.7785453796386719, 1.9544181823730469, -2.630218982696533, 0.4026774764060974, -0.5494788885116577, -0.5519090294837952, 0.2825717628002167, -0.2583639621734619, 0.18305449187755585, -0.17397812008857727, -1.1134816408157349, -0.04614151641726494, -0.8076594471931458, 0.4703187346458435, 1.1554068326950073, 1.3793619871139526, -1.0294182300567627, -0.29385092854499817, -1.6735193729400635, -0.11047746986150742, -0.6476515531539917, 0.2596578299999237, -1.9161590337753296, -0.09999383985996246, -1.96601402759552, -2.3756539821624756, -1.3936293125152588, -0.8275760412216187, 1.1310951709747314, 0.17438651621341705, -0.9118680953979492, 1.2750998735427856, -0.32990458607673645, -1.8224769830703735, 1.1322654485702515, -2.09659481048584 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
@DCNemesis that's interesting, could you please share the error message if you still can access it?
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
16
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 @DCNemesis that's interesting, could you please share the error message if you still can access it?
[ -1.1753910779953003, -0.7958585023880005, -0.7405556440353394, 1.4926306009292603, -0.12206826359033585, -1.2115001678466797, 0.14824090898036957, -0.9918941259384155, 1.6174546480178833, -0.8236861228942871, 0.322940468788147, -1.6874405145645142, 0.021067839115858078, -0.6516708135604858, -0.7424439191818237, -0.8531501889228821, -0.32870081067085266, -0.7128223180770874, 1.0806620121002197, 2.4223883152008057, 1.228820562362671, -1.3853641748428345, 2.7324676513671875, 0.6558216214179993, -0.30315202474594116, -0.9495645761489868, 0.4674835801124573, -0.016686871647834778, -1.2863467931747437, -0.4426518678665161, -0.9444791674613953, -0.06600456684827805, -0.614443302154541, -0.46714359521865845, 0.008750892244279385, 0.37033432722091675, -0.3096824586391449, -0.35400429368019104, -0.576703667640686, -0.8379806280136108, 0.4157997667789459, -0.3595501780509949, 0.9580422043800354, -0.28209298849105835, 1.7652485370635986, -0.668850839138031, 0.49226492643356323, 0.6991003155708313, 1.2745001316070557, 0.28056368231773376, 0.019346177577972412, 0.3808911442756653, 0.35716867446899414, -0.002619959879666567, 0.5477941632270813, 1.1387240886688232, 0.6807439923286438, 0.5104573965072632, 0.7085039615631104, -2.1963846683502197, 1.371468186378479, -0.9871564507484436, 0.20176856219768524, 1.3272658586502075, -0.9712979793548584, 0.3019707202911377, -1.7441598176956177, -0.1236715018749237, 0.5244700312614441, -2.2736122608184814, 0.2808707654476166, -1.3638653755187988, -0.5979729890823364, 1.0029420852661133, 0.4926488995552063, -1.280372142791748, 0.054763488471508026, -0.39621928334236145, 0.945706307888031, 0.3873279392719269, 1.0396219491958618, -1.6316227912902832, -0.07158117741346359, -0.29129600524902344, 0.10251446813344955, -1.2106863260269165, -1.5295796394348145, 0.5961906313896179, 0.5326684713363647, 0.6250638961791992, -0.12936969101428986, 1.0207997560501099, -1.0996462106704712, 0.8447532653808594, -1.0653706789016724, -1.7618211507797241, -1.395267128944397, -2.363959550857544, -2.294285774230957, 0.8516611456871033, -0.4651821553707123, -0.4928518235683441, 2.125105142593384, -1.072385311126709, -1.6662460565567017, 1.1123284101486206, 0.24453283846378326, -0.05762879177927971, 2.420485496520996, 0.1816517561674118, -0.7671110033988953, 0.5043810606002808, -0.8218803405761719, 0.7912683486938477, -0.3956022262573242, 1.2878518104553223, 0.41727355122566223, -1.093808889389038, 1.5816534757614136, -0.3026800751686096, 0.5651137828826904, -0.6764423251152039, -0.5202578902244568, -0.7569496631622314, 0.24894748628139496, 1.8424651622772217, -0.2111712247133255, 1.548104166984558, -0.22679662704467773, -1.5436766147613525, -1.5376629829406738, 0.8707289099693298, 0.4688330888748169, -0.8386898636817932, 0.1105426624417305, -0.33457061648368835, 0.16718408465385437, 0.004064520820975304, 1.180031180381775, 1.351392388343811, 0.7499305605888367, -0.3654443323612213, -0.8207315802574158, 0.12093080580234528, -0.120697982609272, -0.7002884745597839, -1.740649700164795, -0.3490658402442932, 0.11539099365472794, 0.6667575240135193, -1.2473407983779907, 1.8401519060134888, 0.8718404769897461, 1.9471368789672852, 1.031299352645874, -0.4287760257720947, 1.4944262504577637, 0.08604558557271957, 1.908508539199829, -0.48720449209213257, 0.607353150844574, -0.4763719439506531, -1.1856859922409058, 0.8642317652702332, -0.3473566770553589, -2.0248570442199707, -0.7024163007736206, -0.7805576324462891, -0.20739203691482544, -0.7962087392807007, 0.9642361402511597, -0.2966829240322113, -1.400606393814087, 0.21430452167987823, -0.7118463516235352, 0.09896513819694519, -1.29328453540802, 0.2746194005012512, 0.6682981252670288, -0.6299505829811096, 0.03829691931605339, -0.28950580954551697, -1.2489930391311646, -0.5152798295021057, 0.3441517949104309, 1.8594870567321777, -0.6377347111701965, 1.013489007949829, 1.0355186462402344, -0.683695375919342, -0.02034270018339157, 0.38264942169189453, -0.32027533650398254, 0.8767242431640625, -1.0553008317947388, -0.49553751945495605, 1.1590067148208618, -0.26901984214782715, -0.5439124703407288, 1.4220967292785645, 0.7100816965103149, -1.0244532823562622, -0.20922555029392242, -0.11620970070362091, -0.8231037259101868, 0.03618624433875084, -1.6178607940673828, -0.19021525979042053, 0.4352041184902191, -1.5665286779403687, -0.38268551230430603, -0.12139095366001129, 1.2876275777816772, -0.17770065367221832, 1.3942927122116089, -0.31894803047180176, -0.16356655955314636, -0.380029559135437, -0.4772385060787201, 0.08232761919498444, -0.17462176084518433, -0.5635648965835571, 0.2833101451396942, -0.7325054407119751, 0.2517785131931305, 1.4925198554992676, 0.2627722918987274, 0.04981783777475357, 0.43221062421798706, 1.1030899286270142, 0.3513200581073761, -0.08613164722919464, -0.9077814221382141, -1.532455563545227, 2.0756618976593018, -1.4723727703094482, 2.0104057788848877, 0.787172257900238, -0.046131476759910583, -1.790777564048767, -1.8459210395812988, 1.3366106748580933, 1.1028199195861816, 2.3654000759124756, 0.5291386842727661, 0.45574647188186646, -0.7878703474998474, -0.7081081867218018, 0.36856600642204285, -1.0044962167739868, -0.6817928552627563, 0.13409781455993652, 2.487852096557617, 1.6252886056900024, -0.3629413843154907, -0.16518869996070862, -1.0036509037017822, 1.3766981363296509, -0.2383497655391693, 0.23672650754451752, 1.999193787574768, -0.27949339151382446, -1.0591188669204712, 1.2562949657440186, -2.2880842685699463, 0.21765904128551483, 2.087491035461426, 0.2726539075374603, 0.05052705854177475, -1.329003930091858, -0.6412103772163391, -0.2926854193210602, -0.47251954674720764, -1.2600394487380981, 0.503492534160614, -0.23645074665546417, -0.7957630753517151, -1.3347299098968506, 0.07984202355146408, -1.1328346729278564, -1.683936595916748, 0.26252269744873047, 1.9121896028518677, 2.093474864959717, -0.7143424153327942, 1.4768706560134888, -0.2869495749473572, 0.08682985603809357, 1.199782371520996, 1.2633661031723022, 3.164062976837158, 1.8748449087142944, -1.316719651222229, 0.6366692185401917, -0.17893122136592865, -0.45120587944984436, 1.10965895652771, -1.1303659677505493, 1.2453325986862183, -0.1932947188615799, -1.2876389026641846, -1.2310811281204224, 0.9776758551597595, 0.3893279433250427, -0.022769873961806297, -0.5358486771583557, 1.2066926956176758, 0.11923423409461975, 1.2871681451797485, 0.6141108870506287, -0.2430795282125473, 0.5361425876617432, -0.3968033194541931, -0.5529181957244873, 1.662123441696167, 0.19670051336288452, -1.4963527917861938, -2.3874387741088867, -0.19948327541351318, -0.9402704834938049, 0.041866544634103775, -0.6431974172592163, -1.0308352708816528, 1.6598515510559082, 0.38307610154151917, -1.1537286043167114, -0.24624937772750854, -0.36564570665359497, -0.5478580594062805, 2.7898757457733154, -1.3754538297653198, -0.1612756997346878, -0.9747554063796997, -0.6592217087745667, 1.6483194828033447, -1.2118616104125977, -0.2544315457344055, -0.9895028471946716, -0.5636516213417053, -1.181438684463501, -0.449711412191391, 0.009447318501770496, -0.9824539422988892, 0.7431017160415649, 0.1589435636997223, -1.2207109928131104, -0.32127445936203003, -0.925818681716919, 0.8867272138595581, -0.13150031864643097, 0.17803707718849182, 1.809793472290039, 0.33348348736763, -0.3600437343120575, 0.7980225682258606, 1.2476818561553955, 0.6586938500404358, -0.6190541982650757, 0.11358211934566498, -0.6148080825805664, 0.3596620559692383, -1.2057182788848877, 0.26126202940940857, -2.8588674068450928, 0.6016474366188049, -0.132796511054039, -0.10750762373209, -0.08718319982290268, -1.2923320531845093, 1.0876888036727905, 2.4979398250579834, -1.1088390350341797, 0.5378294587135315, 0.2746197283267975, 1.1849621534347534, -1.6336827278137207, 0.2155168652534485, -0.5481097102165222, 2.1485960483551025, 0.22355931997299194, 1.127558946609497, -0.4474048316478729, -2.3367972373962402, 0.6269407868385315, -1.1594101190567017, -1.0281721353530884, 0.8092657327651978, -0.8056566715240479, 0.23404110968112946, -1.3399211168289185, -0.23458720743656158, -0.7610212564468384, -1.183988332748413, 0.6574583649635315, 0.0673690065741539, 0.5336920022964478, -0.5281737446784973, 0.2586812973022461, -2.2374250888824463, -1.4200361967086792, -0.1497020572423935, -0.949558675289154, 0.5343425273895264, -0.4230688810348511, 0.7396531701087952, -0.15933407843112946, -0.05182782560586929, 0.34983429312705994, 1.505491018295288, 3.373610496520996, 0.13793788850307465, 0.32874754071235657, -0.25985071063041687, -0.9499265551567078, 1.376795768737793, 0.9543843865394592, -0.11490573734045029, -0.6480555534362793, -1.0524630546569824, 1.3389652967453003, 1.9752275943756104, 0.9963510036468506, 0.05960645526647568, -0.8145125508308411, -0.754827618598938, 0.006218812428414822, 0.22070837020874023, 0.5210461020469666, 0.8978917002677917, 0.0393594428896904, 0.054620303213596344, 1.416093111038208, 1.1762977838516235, -0.3721407949924469, 0.3292716145515442, -0.9011709094047546, -0.38186076283454895, 0.4720756411552429, 0.290744423866272, -0.05199616774916649, 0.40163785219192505, -0.9937263131141663, -0.25601089000701904, -0.3250240087509155, -0.8766132593154907, -0.8002605438232422, -0.3791828751564026, -0.42854931950569153, 1.7199368476867676, -0.004014849662780762, -0.5001679062843323, 0.015057257376611233, -0.7194494009017944, -0.12989474833011627, -1.1100385189056396, 0.25774574279785156, -0.11294574290513992, -0.07584832608699799, -0.14269118010997772, 1.7609833478927612, -1.0133358240127563, -2.0629031658172607, 0.21303361654281616, 0.24156640470027924, -0.25217950344085693, 0.15748432278633118, 1.7047991752624512, 0.557414174079895, 1.438159465789795, 1.353912115097046, 0.948015570640564, -0.6578543186187744, -1.31118643283844, 0.6034106016159058, 0.9952360391616821, -1.3990206718444824, 0.8767467141151428, -0.1663963496685028, -0.491460919380188, 0.6151421070098877, 1.2968329191207886, 0.44014081358909607, -2.061920166015625, 0.8646657466888428, -0.9926917552947998, 0.8709266781806946, 0.695497453212738, 0.7248167395591736, 0.22977320849895477, 0.8239553570747375, -1.2825731039047241, -1.1460421085357666, -0.6624115109443665, -0.6891140341758728, 1.9238276481628418, -0.3106006979942322, 0.5511345863342285, -0.24212980270385742, -1.3026784658432007, -0.04690152406692505, 0.6662055253982544, 0.37758150696754456, -0.43213391304016113, 0.7714606523513794, -0.6324732899665833, -1.0614227056503296, -1.4367069005966187, -0.511956512928009, -1.1171786785125732, -0.910080075263977, 1.0582154989242554, 0.7580466270446777, 0.4026079773902893, 1.8790735006332397, 0.6073337197303772, 0.29358169436454773, -2.564500331878662, 0.9370543360710144, 0.3082188367843628, -0.07350543141365051, 0.860904335975647, 0.37418949604034424, 1.1299536228179932, -0.02757938578724861, 0.5522243976593018, -2.4604201316833496, 2.320284605026245, -0.28577563166618347, 0.6975961327552795, 0.023456573486328125, -0.07227175682783127, 1.0855189561843872, 0.5955758094787598, 0.5179637670516968, -1.0908657312393188, 0.7245627641677856, -0.5661505460739136, 1.2247151136398315, 0.9170961380004883, -0.8232110738754272, -0.002043971326202154, 1.3408842086791992, 0.4368266761302948, -0.5230239033699036, -0.950181782245636, -0.8815422058105469, 0.9231799840927124, 1.720371127128601, -0.012169525027275085, -0.009655707515776157, 0.862702488899231, 0.638083279132843, -1.261204719543457, 0.14371910691261292, -0.6510822772979736, -0.7805613279342651, 1.6466768980026245, 2.0334601402282715, -0.1551767885684967, -0.1440037339925766, -0.7261280417442322, -1.281619906425476, 0.8064472675323486, -0.03350754454731941, 0.054397664964199066, 0.6520525813102722, -0.6248127222061157, 1.1266921758651733, 0.7958372831344604, 0.9282817840576172, 0.24221418797969818, 0.20321904122829437, 0.3719910681247711, -0.2824329733848572, -1.129287600517273, -0.3183820843696594, -1.019394874572754, -2.6205997467041016, 0.44662564992904663, -0.2754259407520294, -1.4151510000228882, 0.07173643261194229, -0.9913429021835327, 0.8224742412567139, -0.5581715703010559, -1.0960456132888794, -1.5054948329925537, 0.2738962173461914, -0.1096678301692009, 0.9637347459793091, -1.623039960861206, -0.1918523907661438, 1.2273585796356201, 0.8801838755607605, -0.6469727158546448, 1.0140132904052734, 0.24613212049007416, 0.9844827055931091, 0.8572367429733276, -0.44253987073898315, 0.5395732522010803, 0.12392331659793854, -1.3345777988433838, 0.46077924966812134, 1.2595402002334595, 0.13024723529815674, 1.4848796129226685, -0.5173581838607788, -0.01130646001547575, 0.42181751132011414, -0.4779048264026642, -0.4492955207824707, -0.5987577438354492, 0.67646723985672, 0.04164201766252518, -0.9868890047073364, -0.037372298538684845, -0.019336353987455368, -0.2673840820789337, 0.22070278227329254, -1.4332261085510254, -0.12565581500530243, -0.4065133035182953, -0.5401856899261475, -1.3633447885513306, -0.11484774947166443, 1.2756538391113281, -0.7564186453819275, -0.12529566884040833, 0.5131086111068726, 0.2763482630252838, 0.5024695992469788, 0.6886863112449646, -0.7533866763114929, -0.3541257977485657, -0.24103227257728577, -0.35494735836982727, 0.36049121618270874, 1.267258882522583, -0.08187562227249146, -0.9666038155555725, 0.6653037071228027, -0.28528696298599243, 0.1085762158036232, 1.9643492698669434, 0.053504206240177155, -0.8002128005027771, 0.37074875831604004, -0.7694145441055298, 1.9299485683441162, 1.654349446296692, 1.278587818145752, -0.08159375190734863, -0.9860116839408875, 0.7329500913619995, -0.2944619357585907, -0.3858886659145355, 0.843177855014801, 0.3171427845954895, -0.2659781575202942, -1.4205427169799805, 0.6906305551528931, 1.2950338125228882, -0.798180878162384, -0.8402769565582275, 0.14045527577400208, -0.8068791031837463, 1.0990043878555298, 0.5881490707397461, 0.3799920678138733, 0.2793084383010864, 1.6343752145767212, 0.7955905199050903, -0.5076850056648254, 0.5529915690422058, 0.48604366183280945, -0.13744178414344788, -2.0712594985961914, -1.1701894998550415, 0.30823251605033875, -0.4869691729545593, -1.5947890281677246, 1.4610819816589355, -1.1408616304397583, -0.9855561256408691, 0.6273643970489502, 0.13109256327152252, 1.3836828470230103, 0.3044393062591553, 1.6048848628997803, 2.0795822143554688, 0.8726073503494263, 0.41588082909584045, 1.2816503047943115, -0.19894295930862427, -0.43530967831611633, 1.7775530815124512, -0.5000894665718079, 0.5275299549102783, 1.0590112209320068, -0.34140676259994507, -1.1405750513076782, -0.7810174226760864, -1.187047004699707, -0.7578772306442261, 1.1613709926605225, 0.06759428232908249, -1.0379102230072021, 0.25501731038093567, 1.6001830101013184, 0.08834696561098099, -0.2806974947452545, 0.5894832611083984, 0.4091295301914215, -0.735929548740387, -0.12842483818531036, -0.9722278714179993, 0.5773261785507202, -0.1622850000858307, -0.35683897137641907, 0.29187843203544617, 0.4707934558391571, 1.3254270553588867, -0.018383227288722992, 0.08346428722143173, 1.1314730644226074, -1.4779627323150635, 1.4883331060409546, -0.6985728740692139, 0.31126517057418823, -2.281076431274414, 1.358678936958313, -0.7714769840240479, 1.9632716178894043, -2.6071739196777344, 0.42919081449508667, -0.5513696670532227, -0.5546323657035828, 0.2894672155380249, -0.2507508397102356, 0.1920236349105835, -0.18376582860946655, -1.132665753364563, -0.06553088128566742, -0.8213159441947937, 0.4899566173553467, 1.1540148258209229, 1.3859703540802002, -1.029699683189392, -0.2893926203250885, -1.663301944732666, -0.08763601630926132, -0.6050524115562439, 0.22647328674793243, -1.9009618759155273, -0.07254878431558609, -1.9545116424560547, -2.3797903060913086, -1.3934040069580078, -0.8340715169906616, 1.136389970779419, 0.16094094514846802, -0.914865255355835, 1.288861632347107, -0.30618488788604736, -1.8166204690933228, 1.1531245708465576, -2.1094372272491455 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
@polinaeterna I believe it is the same exact error as above. It occurs on other .mp3 sources as well, but the problem is with torchaudio > 0.11.0. I've created a short colab notebook that reproduces the error, and the fix here: https://colab.research.google.com/drive/18wsuwdHwBPN3JkcnhEtk8MUYqF9swuWZ?usp=sharing
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
42
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 @polinaeterna I believe it is the same exact error as above. It occurs on other .mp3 sources as well, but the problem is with torchaudio > 0.11.0. I've created a short colab notebook that reproduces the error, and the fix here: https://colab.research.google.com/drive/18wsuwdHwBPN3JkcnhEtk8MUYqF9swuWZ?usp=sharing
[ -1.2015074491500854, -0.8203659057617188, -0.7189690470695496, 1.4487746953964233, -0.15981365740299225, -1.2458240985870361, 0.14631983637809753, -0.9941901564598083, 1.623773455619812, -0.839643657207489, 0.312946081161499, -1.678154706954956, 0.033375535160303116, -0.6361973285675049, -0.7480801939964294, -0.8414148092269897, -0.33522850275039673, -0.7236322164535522, 1.0667163133621216, 2.4357268810272217, 1.2418166399002075, -1.3614261150360107, 2.730567216873169, 0.6608476638793945, -0.2985876500606537, -0.9597496390342712, 0.49192094802856445, -0.029570546001195908, -1.3394423723220825, -0.4328782856464386, -0.9534690976142883, -0.05107274651527405, -0.5927422642707825, -0.4685370624065399, 0.04982573911547661, 0.35975003242492676, -0.2963150441646576, -0.3512659966945648, -0.578263521194458, -0.8051543235778809, 0.415249228477478, -0.3653227388858795, 0.9852092862129211, -0.27081218361854553, 1.7674267292022705, -0.668419599533081, 0.48351287841796875, 0.7183635234832764, 1.3003356456756592, 0.26158273220062256, 0.02111191675066948, 0.34800320863723755, 0.39457064867019653, 0.02140921726822853, 0.5267086625099182, 1.1305670738220215, 0.6682213544845581, 0.49213600158691406, 0.7183777689933777, -2.195864200592041, 1.3704522848129272, -0.9477949142456055, 0.20584075152873993, 1.3415534496307373, -0.9704807996749878, 0.3007851839065552, -1.7542643547058105, -0.103429414331913, 0.5363919138908386, -2.2984373569488525, 0.27186816930770874, -1.3756873607635498, -0.6003485918045044, 0.9740228056907654, 0.44645965099334717, -1.2516508102416992, 0.0981755182147026, -0.42711347341537476, 0.9192405343055725, 0.429690420627594, 1.0570454597473145, -1.6269296407699585, -0.08397217094898224, -0.26083314418792725, 0.13822594285011292, -1.2001827955245972, -1.5336333513259888, 0.6088937520980835, 0.5775514245033264, 0.6182883381843567, -0.154170423746109, 1.0277777910232544, -1.0882073640823364, 0.859303891658783, -1.0407333374023438, -1.7560818195343018, -1.405867338180542, -2.3368945121765137, -2.2839386463165283, 0.8299260139465332, -0.4691430926322937, -0.4694218933582306, 2.109274387359619, -1.0969563722610474, -1.6883399486541748, 1.1014503240585327, 0.2261940985918045, -0.0444287434220314, 2.400386095046997, 0.17227448523044586, -0.7410237193107605, 0.4852047562599182, -0.820104718208313, 0.7927728891372681, -0.40362945199012756, 1.2547531127929688, 0.4099668562412262, -1.0678597688674927, 1.552423119544983, -0.3308333456516266, 0.5695510506629944, -0.6820143461227417, -0.46742889285087585, -0.755187451839447, 0.2599494159221649, 1.8583284616470337, -0.24599021673202515, 1.5428658723831177, -0.24491453170776367, -1.5636661052703857, -1.5582010746002197, 0.8564887642860413, 0.501492440700531, -0.8256657123565674, 0.10894311964511871, -0.35820472240448, 0.15489250421524048, -0.002158768940716982, 1.1492315530776978, 1.3229366540908813, 0.7803717851638794, -0.3378482162952423, -0.8381026983261108, 0.1477227658033371, -0.12355546653270721, -0.713813066482544, -1.7602111101150513, -0.3461104929447174, 0.13526445627212524, 0.6619393825531006, -1.2264946699142456, 1.8234002590179443, 0.8859314918518066, 1.9517754316329956, 1.0172650814056396, -0.43844538927078247, 1.5076431035995483, 0.09471805393695831, 1.8941665887832642, -0.5130448341369629, 0.5997339487075806, -0.4778474271297455, -1.1688566207885742, 0.862004280090332, -0.3382098078727722, -1.99571692943573, -0.6638043522834778, -0.7762539982795715, -0.19743631780147552, -0.7971307635307312, 0.9639384746551514, -0.2897062599658966, -1.3949933052062988, 0.19857807457447052, -0.7075877785682678, 0.06915651261806488, -1.284002423286438, 0.25948968529701233, 0.6965948939323425, -0.6290324926376343, 0.03986615315079689, -0.28447097539901733, -1.2767493724822998, -0.5206865072250366, 0.34708887338638306, 1.8655977249145508, -0.6428410410881042, 1.0281202793121338, 1.0081952810287476, -0.670926570892334, -0.015156075358390808, 0.38996320962905884, -0.3342590928077698, 0.8190793395042419, -1.0430400371551514, -0.45710521936416626, 1.1594438552856445, -0.2620045244693756, -0.5384839177131653, 1.436557650566101, 0.7246171832084656, -1.04013991355896, -0.20468677580356598, -0.10524768382310867, -0.7974324226379395, 0.030502520501613617, -1.6143656969070435, -0.19486038386821747, 0.41593584418296814, -1.5657912492752075, -0.41791796684265137, -0.1485724300146103, 1.2772313356399536, -0.15266768634319305, 1.4121816158294678, -0.3301011323928833, -0.1839962601661682, -0.40299519896507263, -0.45698654651641846, 0.09400036931037903, -0.19105856120586395, -0.5865197777748108, 0.28429681062698364, -0.7713742256164551, 0.2594565451145172, 1.5087302923202515, 0.24904587864875793, 0.06321092694997787, 0.4446380138397217, 1.0922781229019165, 0.3673969805240631, -0.09992124885320663, -0.9491831660270691, -1.5429024696350098, 2.0873289108276367, -1.4816641807556152, 1.9990726709365845, 0.7828781008720398, -0.03245072439312935, -1.7858396768569946, -1.8537296056747437, 1.3278063535690308, 1.1040068864822388, 2.356872081756592, 0.508403480052948, 0.43362897634506226, -0.7740863561630249, -0.6821849346160889, 0.3682625889778137, -1.0058951377868652, -0.6884170770645142, 0.12451750040054321, 2.4713199138641357, 1.6542109251022339, -0.39683735370635986, -0.19046497344970703, -1.0043962001800537, 1.3812823295593262, -0.23546567559242249, 0.21976114809513092, 1.9955610036849976, -0.2734672725200653, -1.0130022764205933, 1.2779752016067505, -2.2825889587402344, 0.2504822611808777, 2.0560946464538574, 0.24817630648612976, 0.046418480575084686, -1.3333384990692139, -0.6621596217155457, -0.27940937876701355, -0.4886781573295593, -1.2728012800216675, 0.5098877549171448, -0.2648775279521942, -0.8258128762245178, -1.3645589351654053, 0.0889870896935463, -1.1330361366271973, -1.7115674018859863, 0.2446715235710144, 1.9111864566802979, 2.0949862003326416, -0.7159149646759033, 1.4899085760116577, -0.30295249819755554, 0.07065416872501373, 1.1930631399154663, 1.2518095970153809, 3.1634371280670166, 1.8986470699310303, -1.286967396736145, 0.6613865494728088, -0.19418038427829742, -0.40213465690612793, 1.085424542427063, -1.1134998798370361, 1.2291572093963623, -0.21165059506893158, -1.2957444190979004, -1.2029861211776733, 0.9967162609100342, 0.419818639755249, -0.01057444978505373, -0.5110096335411072, 1.2152079343795776, 0.13231462240219116, 1.3135766983032227, 0.6286972165107727, -0.2518802583217621, 0.5771648287773132, -0.3846346139907837, -0.5437849164009094, 1.6593354940414429, 0.18937614560127258, -1.4960392713546753, -2.390073299407959, -0.23999254405498505, -0.9290779232978821, 0.044020816683769226, -0.6226271986961365, -1.0287013053894043, 1.6613689661026, 0.39428216218948364, -1.1723763942718506, -0.22428150475025177, -0.37063494324684143, -0.5367636680603027, 2.771583080291748, -1.3671246767044067, -0.16945680975914001, -0.9634767770767212, -0.6349520087242126, 1.647741675376892, -1.2319978475570679, -0.22335301339626312, -1.0223581790924072, -0.5444275140762329, -1.206318736076355, -0.44834238290786743, 0.0019327718764543533, -0.9700354337692261, 0.7420799136161804, 0.12954075634479523, -1.2245814800262451, -0.3361039161682129, -0.9375339150428772, 0.9038360118865967, -0.08283083140850067, 0.16685692965984344, 1.8454276323318481, 0.3536393642425537, -0.3847941756248474, 0.7904342412948608, 1.2189260721206665, 0.6433651447296143, -0.6503667831420898, 0.12842302024364471, -0.624670147895813, 0.3485819399356842, -1.2358345985412598, 0.2657061815261841, -2.8363261222839355, 0.6346591114997864, -0.11944025009870529, -0.09372176229953766, -0.09225684404373169, -1.2853955030441284, 1.1085057258605957, 2.5284759998321533, -1.110431432723999, 0.5253276228904724, 0.2700998783111572, 1.1969923973083496, -1.5963138341903687, 0.2219754159450531, -0.5093621015548706, 2.148859977722168, 0.23331917822360992, 1.1535906791687012, -0.4365377128124237, -2.324848175048828, 0.6391183733940125, -1.1758148670196533, -1.0383960008621216, 0.7972816824913025, -0.8018649220466614, 0.19987547397613525, -1.3550413846969604, -0.20436930656433105, -0.7687740325927734, -1.1809518337249756, 0.6833170056343079, 0.07915909588336945, 0.5441616177558899, -0.5760523676872253, 0.2726868689060211, -2.2096524238586426, -1.3993043899536133, -0.161508247256279, -0.9263035655021667, 0.5264765024185181, -0.3965969979763031, 0.7576001286506653, -0.16370858252048492, -0.0527268648147583, 0.3518995940685272, 1.5041331052780151, 3.3712053298950195, 0.11601154506206512, 0.30894291400909424, -0.2631741464138031, -0.9493598937988281, 1.3833589553833008, 0.958371639251709, -0.14073489606380463, -0.6349241733551025, -1.0470190048217773, 1.3128119707107544, 1.9790438413619995, 1.0059231519699097, 0.057218022644519806, -0.8223042488098145, -0.7596825361251831, 0.026368267834186554, 0.19316363334655762, 0.5416439771652222, 0.927911639213562, 0.02008620649576187, 0.05053640156984329, 1.4422377347946167, 1.1705280542373657, -0.3566906750202179, 0.3384723365306854, -0.8935394883155823, -0.3946284353733063, 0.4723009765148163, 0.2899746000766754, -0.04196983203291893, 0.4134525656700134, -1.0212630033493042, -0.23349861800670624, -0.34327295422554016, -0.8908920288085938, -0.7674384713172913, -0.3898034393787384, -0.41354840993881226, 1.726656198501587, 0.019208349287509918, -0.4861307740211487, -0.00009833648800849915, -0.7226743698120117, -0.12359350174665451, -1.0854644775390625, 0.26226139068603516, -0.14279383420944214, -0.06315100193023682, -0.11707144230604172, 1.743472933769226, -0.9963873028755188, -2.0348622798919678, 0.22989706695079803, 0.20759212970733643, -0.25929978489875793, 0.19578732550144196, 1.7033641338348389, 0.5804476141929626, 1.418679118156433, 1.3589707612991333, 0.9579841494560242, -0.6309259533882141, -1.3096561431884766, 0.6217352747917175, 0.9787223935127258, -1.3925297260284424, 0.8914105296134949, -0.15136967599391937, -0.5088516473770142, 0.6435942053794861, 1.2877628803253174, 0.4073672592639923, -2.084956645965576, 0.8552259802818298, -0.98464435338974, 0.8393858075141907, 0.7050775289535522, 0.7472455501556396, 0.20734097063541412, 0.8314041495323181, -1.274053931236267, -1.1557241678237915, -0.6587307453155518, -0.6582977771759033, 1.9472761154174805, -0.2850390374660492, 0.5405309796333313, -0.2444513738155365, -1.2917007207870483, -0.063865065574646, 0.6544601321220398, 0.36710602045059204, -0.4205625355243683, 0.7849094867706299, -0.6562110781669617, -1.088871717453003, -1.4123098850250244, -0.5298373699188232, -1.0833088159561157, -0.9194520115852356, 1.063539981842041, 0.7581457495689392, 0.4313306212425232, 1.8879796266555786, 0.6066204905509949, 0.26391470432281494, -2.5786359310150146, 0.9363903403282166, 0.3105907738208771, -0.05325476825237274, 0.8793789744377136, 0.33639663457870483, 1.1341434717178345, -0.036413416266441345, 0.5615214705467224, -2.4527485370635986, 2.2926132678985596, -0.28163185715675354, 0.7169896960258484, 0.05057282745838165, -0.06997925043106079, 1.0828770399093628, 0.6065844297409058, 0.5486336946487427, -1.1158387660980225, 0.7207531929016113, -0.5814610719680786, 1.2254753112792969, 0.9153605699539185, -0.8395795226097107, 0.0041132234036922455, 1.3357667922973633, 0.443291038274765, -0.5235382318496704, -0.945278525352478, -0.9269171357154846, 0.9143691062927246, 1.750417709350586, -0.026852361857891083, 0.015234573744237423, 0.8329564929008484, 0.659771740436554, -1.2775431871414185, 0.10328011214733124, -0.6725382208824158, -0.7536635994911194, 1.6425795555114746, 2.036210775375366, -0.15866507589817047, -0.14858749508857727, -0.7184467911720276, -1.2738795280456543, 0.8034021258354187, -0.038367051631212234, 0.0901859700679779, 0.6725536584854126, -0.6134384274482727, 1.1060914993286133, 0.7702861428260803, 0.9498811364173889, 0.2385736107826233, 0.23384803533554077, 0.3578350841999054, -0.3007180690765381, -1.1216551065444946, -0.3089327812194824, -1.033957839012146, -2.5999770164489746, 0.45987260341644287, -0.26534026861190796, -1.4346827268600464, 0.07134699076414108, -1.0172101259231567, 0.8051358461380005, -0.5749697089195251, -1.0939489603042603, -1.468501329421997, 0.2596530318260193, -0.1315201371908188, 0.9392229914665222, -1.6202751398086548, -0.16922500729560852, 1.236160397529602, 0.9005743265151978, -0.6175664067268372, 1.0196037292480469, 0.2422807514667511, 0.994695782661438, 0.8540818095207214, -0.4355561137199402, 0.5074188113212585, 0.1370304673910141, -1.3551679849624634, 0.4312368333339691, 1.2496405839920044, 0.17084626853466034, 1.481091022491455, -0.5512227416038513, 0.013716536574065685, 0.4298597276210785, -0.5025866031646729, -0.46121180057525635, -0.59234619140625, 0.6788089275360107, 0.015144872479140759, -0.9983842372894287, -0.04666096344590187, -0.04788966849446297, -0.2634926736354828, 0.21837584674358368, -1.419675588607788, -0.12623150646686554, -0.39417025446891785, -0.5442376732826233, -1.351728081703186, -0.0988488420844078, 1.29192054271698, -0.7876212000846863, -0.13168224692344666, 0.48374685645103455, 0.28648844361305237, 0.5061922669410706, 0.6770625710487366, -0.754157304763794, -0.367931604385376, -0.2385786771774292, -0.3706609010696411, 0.330724835395813, 1.298529863357544, -0.10535935312509537, -0.9721655249595642, 0.6451042294502258, -0.3262089788913727, 0.11812862753868103, 1.9980593919754028, 0.05274059250950813, -0.7824065089225769, 0.35653457045555115, -0.7707361578941345, 1.9008665084838867, 1.6464781761169434, 1.264794945716858, -0.10251739621162415, -0.9605768322944641, 0.6980671882629395, -0.29445984959602356, -0.38794392347335815, 0.8604862093925476, 0.32654401659965515, -0.26820632815361023, -1.4091566801071167, 0.6683153510093689, 1.299268126487732, -0.8156917691230774, -0.842365026473999, 0.11847315728664398, -0.810204029083252, 1.0809314250946045, 0.6150670051574707, 0.3684875965118408, 0.2626585364341736, 1.6340181827545166, 0.8156365752220154, -0.5249598622322083, 0.5616511702537537, 0.4661538004875183, -0.1331087201833725, -2.0766143798828125, -1.1319681406021118, 0.3064594864845276, -0.45653653144836426, -1.5996376276016235, 1.4199007749557495, -1.1572372913360596, -1.0006941556930542, 0.6001139879226685, 0.1513398438692093, 1.3700801134109497, 0.33071568608283997, 1.6130435466766357, 2.084775924682617, 0.8897156119346619, 0.4100976884365082, 1.281997799873352, -0.17697511613368988, -0.45412176847457886, 1.7893339395523071, -0.4996660053730011, 0.5361608862876892, 1.0607293844223022, -0.3471737802028656, -1.1091502904891968, -0.7897322177886963, -1.1714626550674438, -0.733060896396637, 1.1862035989761353, 0.09138303250074387, -1.0675100088119507, 0.2572473883628845, 1.5665870904922485, 0.0983055830001831, -0.2577546536922455, 0.642753541469574, 0.42687657475471497, -0.7168896794319153, -0.1255270540714264, -0.9383366107940674, 0.5520167946815491, -0.16150379180908203, -0.3662809729576111, 0.3067876398563385, 0.47675439715385437, 1.3317129611968994, -0.019292782992124557, 0.06666135042905807, 1.17580246925354, -1.4391825199127197, 1.4800227880477905, -0.6815478205680847, 0.2954810857772827, -2.309793710708618, 1.3639618158340454, -0.7978273630142212, 1.9633705615997314, -2.6151745319366455, 0.39882561564445496, -0.547825038433075, -0.5495555400848389, 0.27572086453437805, -0.2587044835090637, 0.15198004245758057, -0.17239703238010406, -1.1363486051559448, -0.06321291625499725, -0.8173522353172302, 0.496850848197937, 1.148324728012085, 1.3860219717025757, -1.0434331893920898, -0.28389179706573486, -1.6961723566055298, -0.10255962610244751, -0.6649833917617798, 0.26828351616859436, -1.9151721000671387, -0.10897137224674225, -1.961613655090332, -2.382096767425537, -1.3956336975097656, -0.8524459600448608, 1.124036192893982, 0.1601456105709076, -0.8920140266418457, 1.2614699602127075, -0.31967365741729736, -1.8136131763458252, 1.127048373222351, -2.138162612915039 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Hi @DCNemesis, Your issue was slightly different from the original one in this issue page. Yours seems related to a change in the backend used by `torchaudio` (`ffmpeg` instead of `sox`). Refer to the issue page here: - #4776 Normally, it should be circumvented with the patch made by @polinaeterna in: - #4923
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
53
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Hi @DCNemesis, Your issue was slightly different from the original one in this issue page. Yours seems related to a change in the backend used by `torchaudio` (`ffmpeg` instead of `sox`). Refer to the issue page here: - #4776 Normally, it should be circumvented with the patch made by @polinaeterna in: - #4923
[ -1.1800994873046875, -0.7805718183517456, -0.7340307235717773, 1.4551787376403809, -0.16754958033561707, -1.2167367935180664, 0.16239774227142334, -1.0000009536743164, 1.6366373300552368, -0.8439387083053589, 0.33562803268432617, -1.6846755743026733, 0.04577711597084999, -0.6599307060241699, -0.762470543384552, -0.8159903287887573, -0.3614780008792877, -0.7151350378990173, 1.0462703704833984, 2.420288562774658, 1.2307363748550415, -1.3610674142837524, 2.7373316287994385, 0.683837890625, -0.2865638732910156, -0.9424872994422913, 0.44851210713386536, -0.028073560446500778, -1.3200523853302002, -0.42943692207336426, -0.9331128001213074, -0.06503050029277802, -0.5825779438018799, -0.5155539512634277, 0.022271521389484406, 0.393809974193573, -0.2997484505176544, -0.37935811281204224, -0.5555173754692078, -0.8321735858917236, 0.42688173055648804, -0.3673025965690613, 0.989039421081543, -0.268912672996521, 1.7764323949813843, -0.6515498161315918, 0.4842842221260071, 0.7143598794937134, 1.2835382223129272, 0.25419554114341736, 0.0014497824013233185, 0.36386021971702576, 0.3507591784000397, 0.004163652658462524, 0.5477964878082275, 1.1346021890640259, 0.7030516862869263, 0.49023452401161194, 0.7191973924636841, -2.1949057579040527, 1.3576339483261108, -0.9759368300437927, 0.22771495580673218, 1.3346353769302368, -1.0130079984664917, 0.2897701561450958, -1.734971046447754, -0.09016638994216919, 0.5407035946846008, -2.2716927528381348, 0.2921389043331146, -1.3419156074523926, -0.5856299996376038, 1.0340937376022339, 0.4587246775627136, -1.2664549350738525, 0.06914792209863663, -0.4158255457878113, 0.9647570252418518, 0.41388463973999023, 1.0517520904541016, -1.6188515424728394, -0.057262372225522995, -0.3031362295150757, 0.12396910041570663, -1.20246160030365, -1.510300874710083, 0.5974905490875244, 0.5833884477615356, 0.616067111492157, -0.16442731022834778, 1.0535097122192383, -1.0833823680877686, 0.8419154286384583, -1.0524144172668457, -1.7781263589859009, -1.3884611129760742, -2.3187224864959717, -2.257901668548584, 0.8326544165611267, -0.45860475301742554, -0.5150883197784424, 2.123314142227173, -1.0873892307281494, -1.694562554359436, 1.0984506607055664, 0.22680938243865967, -0.052857447415590286, 2.3988704681396484, 0.1750321090221405, -0.7512954473495483, 0.4835827350616455, -0.7945877313613892, 0.7951061129570007, -0.42089518904685974, 1.2643232345581055, 0.39912649989128113, -1.102401614189148, 1.5676988363265991, -0.3080664575099945, 0.5734046101570129, -0.7057968378067017, -0.4876784086227417, -0.7412477731704712, 0.26848194003105164, 1.850488543510437, -0.25452524423599243, 1.528977632522583, -0.2429409623146057, -1.5480117797851562, -1.5507234334945679, 0.8732795119285583, 0.4660283029079437, -0.8046297430992126, 0.10872702300548553, -0.3622954785823822, 0.17243102192878723, -0.03636155277490616, 1.1679996252059937, 1.3413258790969849, 0.7607744336128235, -0.3112487196922302, -0.8152136206626892, 0.1405864953994751, -0.08778735995292664, -0.7155712246894836, -1.7436182498931885, -0.32245078682899475, 0.14737313985824585, 0.6545933485031128, -1.2050981521606445, 1.851831078529358, 0.8550049066543579, 1.9508552551269531, 1.0205707550048828, -0.41418513655662537, 1.5225750207901, 0.10925421863794327, 1.894115686416626, -0.47280845046043396, 0.5941827893257141, -0.46740636229515076, -1.1753101348876953, 0.8627042174339294, -0.33465316891670227, -2.0218865871429443, -0.6562585830688477, -0.7730401158332825, -0.19052228331565857, -0.7972823977470398, 0.9763520359992981, -0.2774885296821594, -1.3924611806869507, 0.21291282773017883, -0.6901525259017944, 0.06235465407371521, -1.2726962566375732, 0.26890549063682556, 0.6792629957199097, -0.6323493719100952, 0.04298873990774155, -0.30848681926727295, -1.2645072937011719, -0.5072431564331055, 0.3289351761341095, 1.8639627695083618, -0.6627597808837891, 1.001458764076233, 1.033654808998108, -0.6888650059700012, -0.056227367371320724, 0.3897686302661896, -0.3339611291885376, 0.8381568193435669, -1.076983094215393, -0.45163199305534363, 1.160099744796753, -0.25035256147384644, -0.543758749961853, 1.4350320100784302, 0.718644917011261, -1.0431245565414429, -0.18777897953987122, -0.09932973235845566, -0.8247905373573303, 0.04098356515169144, -1.6323204040527344, -0.15664157271385193, 0.4241633117198944, -1.5513421297073364, -0.39728084206581116, -0.14502644538879395, 1.266866683959961, -0.17053461074829102, 1.3923203945159912, -0.30876484513282776, -0.1691334843635559, -0.3897370398044586, -0.45075735449790955, 0.06011911481618881, -0.1428171694278717, -0.5765482783317566, 0.26339948177337646, -0.7512393593788147, 0.2731482982635498, 1.4921929836273193, 0.2372249960899353, 0.04750099405646324, 0.4562169313430786, 1.105015516281128, 0.3402062654495239, -0.07626292109489441, -0.9375564455986023, -1.5536067485809326, 2.0750529766082764, -1.4870905876159668, 2.024445056915283, 0.7828352451324463, -0.020418506115674973, -1.7794150114059448, -1.8642796277999878, 1.3377575874328613, 1.1082807779312134, 2.372201442718506, 0.5290421843528748, 0.4566575586795807, -0.7768809795379639, -0.688811719417572, 0.36771076917648315, -1.0022162199020386, -0.6938511729240417, 0.13816863298416138, 2.471310615539551, 1.6576555967330933, -0.3723919987678528, -0.17614760994911194, -1.0199052095413208, 1.3862215280532837, -0.23220956325531006, 0.22461342811584473, 1.9953974485397339, -0.2610248029232025, -1.0284862518310547, 1.2701994180679321, -2.302569627761841, 0.21349778771400452, 2.058748722076416, 0.21879854798316956, 0.04313492029905319, -1.2986751794815063, -0.6283913254737854, -0.276157945394516, -0.45196208357810974, -1.2960768938064575, 0.5120255351066589, -0.25529608130455017, -0.7947955131530762, -1.353723168373108, 0.0940886065363884, -1.1231210231781006, -1.6613904237747192, 0.2556162178516388, 1.9106680154800415, 2.082710027694702, -0.7304118871688843, 1.4964572191238403, -0.31172558665275574, 0.07800538837909698, 1.2190172672271729, 1.2480370998382568, 3.177041530609131, 1.8953523635864258, -1.2996920347213745, 0.629175066947937, -0.20409715175628662, -0.4348986744880676, 1.1153291463851929, -1.1560276746749878, 1.243648886680603, -0.19074293971061707, -1.2835732698440552, -1.2366437911987305, 0.9591456651687622, 0.40156108140945435, 0.014462700113654137, -0.5201194286346436, 1.2018803358078003, 0.1260097324848175, 1.306625485420227, 0.6264125108718872, -0.24381694197654724, 0.570539653301239, -0.40076982975006104, -0.519494354724884, 1.653883695602417, 0.20264190435409546, -1.454063057899475, -2.38313889503479, -0.19199225306510925, -0.9368847012519836, 0.061863891780376434, -0.6384013891220093, -1.0180079936981201, 1.6612672805786133, 0.3656408488750458, -1.175743579864502, -0.23113691806793213, -0.3587561845779419, -0.5405334234237671, 2.778348922729492, -1.3831154108047485, -0.19532987475395203, -0.9914464354515076, -0.627918541431427, 1.6766526699066162, -1.209139347076416, -0.2652203142642975, -1.015749216079712, -0.5464508533477783, -1.193611979484558, -0.46526628732681274, 0.025788407772779465, -0.9622396230697632, 0.7886257171630859, 0.13509336113929749, -1.2329739332199097, -0.3243212103843689, -0.9389057159423828, 0.8822331428527832, -0.14110901951789856, 0.16630175709724426, 1.8187017440795898, 0.3608192503452301, -0.38638901710510254, 0.7855347990989685, 1.208805799484253, 0.6380760669708252, -0.610959529876709, 0.15674957633018494, -0.6407958269119263, 0.34563174843788147, -1.2419111728668213, 0.27331504225730896, -2.8457791805267334, 0.6237757205963135, -0.12111945450305939, -0.058292265981435776, -0.10554929822683334, -1.307875633239746, 1.0667632818222046, 2.52058482170105, -1.1026694774627686, 0.4941904544830322, 0.2709449231624603, 1.2107713222503662, -1.6059783697128296, 0.20746341347694397, -0.5337658524513245, 2.136996269226074, 0.18980154395103455, 1.1518241167068481, -0.4368896484375, -2.3562777042388916, 0.6186648011207581, -1.1824532747268677, -1.0429003238677979, 0.8222874402999878, -0.7800298929214478, 0.17040693759918213, -1.3311654329299927, -0.23642399907112122, -0.7895457744598389, -1.1871745586395264, 0.6959242820739746, 0.07958915084600449, 0.5379114151000977, -0.5778446793556213, 0.26201993227005005, -2.2131242752075195, -1.3956272602081299, -0.18325087428092957, -0.9185918569564819, 0.4975340962409973, -0.40445229411125183, 0.7362649440765381, -0.17508268356323242, -0.05955212935805321, 0.35407501459121704, 1.477342128753662, 3.362205743789673, 0.13178420066833496, 0.33263540267944336, -0.2750365734100342, -0.9450842142105103, 1.3674691915512085, 0.9251194000244141, -0.11141646653413773, -0.6447166204452515, -1.0397001504898071, 1.293699860572815, 1.963342547416687, 0.9897579550743103, 0.060521990060806274, -0.8367486596107483, -0.748264491558075, -0.0004303855821490288, 0.20123150944709778, 0.5068916082382202, 0.9002922773361206, 0.025885261595249176, 0.047295570373535156, 1.3974299430847168, 1.178946614265442, -0.3633745312690735, 0.34621569514274597, -0.8833958506584167, -0.3773800730705261, 0.49435919523239136, 0.3138919472694397, -0.04143661633133888, 0.3549128472805023, -1.0037325620651245, -0.2551981508731842, -0.3365629017353058, -0.8930969834327698, -0.7997714877128601, -0.3669032156467438, -0.3999539017677307, 1.7279919385910034, -0.002834449987858534, -0.4990328550338745, 0.003457736223936081, -0.7270280122756958, -0.11602295935153961, -1.09087073802948, 0.2726603150367737, -0.14348599314689636, -0.06454059481620789, -0.14127051830291748, 1.7546075582504272, -1.0132027864456177, -2.0516250133514404, 0.23179152607917786, 0.21869215369224548, -0.2537687122821808, 0.17011243104934692, 1.7042677402496338, 0.5718927979469299, 1.4483494758605957, 1.3681272268295288, 0.9663103818893433, -0.6480964422225952, -1.302344560623169, 0.6219455003738403, 0.9846848249435425, -1.3920139074325562, 0.851955771446228, -0.11874609440565109, -0.4907495975494385, 0.6390675902366638, 1.2834737300872803, 0.430289626121521, -2.086742639541626, 0.8412089943885803, -1.0167760848999023, 0.8452039361000061, 0.7288645505905151, 0.7363069653511047, 0.24692827463150024, 0.8525251746177673, -1.2642565965652466, -1.1792256832122803, -0.6536149978637695, -0.671537458896637, 1.9447933435440063, -0.30786633491516113, 0.5628928542137146, -0.22906151413917542, -1.3421690464019775, -0.06973504275083542, 0.6695082187652588, 0.37033021450042725, -0.4411209523677826, 0.7628244161605835, -0.6676505208015442, -1.055245041847229, -1.420998215675354, -0.5502915978431702, -1.1126230955123901, -0.9295163750648499, 1.0418140888214111, 0.7828686237335205, 0.4051431119441986, 1.8946256637573242, 0.6160438060760498, 0.28893643617630005, -2.5693371295928955, 0.9196366667747498, 0.32564234733581543, -0.08413278311491013, 0.8635302782058716, 0.3667203187942505, 1.1038740873336792, -0.028166532516479492, 0.5590762495994568, -2.4736406803131104, 2.3024394512176514, -0.28720512986183167, 0.6898335814476013, 0.012683570384979248, -0.10514730215072632, 1.0718504190444946, 0.5804227590560913, 0.5068330764770508, -1.082821249961853, 0.7099014520645142, -0.5923118591308594, 1.2450205087661743, 0.9015848636627197, -0.8343784213066101, -0.011286924593150616, 1.3282496929168701, 0.4339444637298584, -0.5287876725196838, -0.9284124374389648, -0.9110934138298035, 0.9097748398780823, 1.7403900623321533, -0.01971494033932686, 0.01652568019926548, 0.8585940599441528, 0.6665533185005188, -1.2556589841842651, 0.13249671459197998, -0.6663426756858826, -0.7793452739715576, 1.6536973714828491, 2.0243287086486816, -0.1649179756641388, -0.13500595092773438, -0.7478082180023193, -1.2556185722351074, 0.8028901815414429, -0.009593036025762558, 0.05183463543653488, 0.6660635471343994, -0.6067049503326416, 1.1169885396957397, 0.8030149340629578, 0.9519995450973511, 0.22179967164993286, 0.23365145921707153, 0.3888438045978546, -0.30541563034057617, -1.1420096158981323, -0.31972619891166687, -1.028530240058899, -2.6009726524353027, 0.45628878474235535, -0.25832998752593994, -1.4143564701080322, 0.07242744415998459, -0.9916630387306213, 0.8141822218894958, -0.5522300004959106, -1.095333456993103, -1.4770869016647339, 0.27601003646850586, -0.10557947307825089, 0.9689111709594727, -1.6081784963607788, -0.15055349469184875, 1.2147246599197388, 0.902658224105835, -0.6491836905479431, 0.9878290891647339, 0.25191831588745117, 0.9989301562309265, 0.8785758018493652, -0.4261549115180969, 0.5183661580085754, 0.1268014907836914, -1.3475548028945923, 0.4484439492225647, 1.2426539659500122, 0.13118141889572144, 1.474753975868225, -0.5360861420631409, -0.023800380527973175, 0.41069701313972473, -0.49286818504333496, -0.46862074732780457, -0.5975529551506042, 0.6677954792976379, 0.05153849348425865, -0.9624015688896179, -0.03329109400510788, -0.011899012140929699, -0.2746524214744568, 0.2056528925895691, -1.4491077661514282, -0.11401023715734482, -0.3824198842048645, -0.5365862846374512, -1.3462172746658325, -0.10451068729162216, 1.2781683206558228, -0.7472391128540039, -0.13133899867534637, 0.5126549005508423, 0.29312190413475037, 0.4941197633743286, 0.6661849617958069, -0.7432541251182556, -0.38188958168029785, -0.23693066835403442, -0.3775289058685303, 0.34578433632850647, 1.309553861618042, -0.06542837619781494, -0.9637659788131714, 0.6682231426239014, -0.32138973474502563, 0.0939774215221405, 1.9636963605880737, 0.08205144852399826, -0.8139038681983948, 0.36350923776626587, -0.773428738117218, 1.9165953397750854, 1.6711927652359009, 1.27667236328125, -0.09196944534778595, -0.9843665361404419, 0.7304835319519043, -0.3216175138950348, -0.39244601130485535, 0.8511946797370911, 0.3115343153476715, -0.2674421966075897, -1.428453803062439, 0.6988474130630493, 1.3042552471160889, -0.8086211085319519, -0.8537300825119019, 0.13032245635986328, -0.8204151391983032, 1.0631122589111328, 0.6244760155677795, 0.3602534830570221, 0.27220845222473145, 1.60781991481781, 0.7877603769302368, -0.5105652213096619, 0.5501447319984436, 0.4751940667629242, -0.0918489620089531, -2.092149019241333, -1.1514861583709717, 0.3184942305088043, -0.4594965875148773, -1.5980561971664429, 1.4510478973388672, -1.1642857789993286, -0.9779337644577026, 0.592857837677002, 0.13459712266921997, 1.3820151090621948, 0.33038130402565, 1.5765454769134521, 2.0907785892486572, 0.8548563718795776, 0.4232046604156494, 1.287205696105957, -0.2001039981842041, -0.4366247355937958, 1.7891173362731934, -0.530317485332489, 0.5468001961708069, 1.0688413381576538, -0.32285377383232117, -1.1399500370025635, -0.800896942615509, -1.2039705514907837, -0.7604190707206726, 1.1689419746398926, 0.0637509897351265, -1.0548821687698364, 0.255616694688797, 1.6096458435058594, 0.07860270887613297, -0.27943795919418335, 0.6313375234603882, 0.4157617688179016, -0.7432937026023865, -0.12812118232250214, -0.925196647644043, 0.6063094735145569, -0.16596385836601257, -0.3524918258190155, 0.32870247960090637, 0.49711865186691284, 1.3389497995376587, -0.013869107700884342, 0.05540110915899277, 1.1325905323028564, -1.4705182313919067, 1.4579638242721558, -0.693153440952301, 0.29999661445617676, -2.311652660369873, 1.3766337633132935, -0.7840062975883484, 1.9453701972961426, -2.621614456176758, 0.42130687832832336, -0.5450395941734314, -0.5311338901519775, 0.30280953645706177, -0.24817559123039246, 0.16646161675453186, -0.16569966077804565, -1.1394497156143188, -0.04888824746012688, -0.7949437499046326, 0.49499160051345825, 1.154573917388916, 1.402801752090454, -1.0413156747817993, -0.3010825216770172, -1.6961547136306763, -0.08908423036336899, -0.6184667348861694, 0.24287688732147217, -1.9174309968948364, -0.10729119181632996, -1.973275899887085, -2.3965864181518555, -1.3962520360946655, -0.8446719646453857, 1.14412522315979, 0.1638413667678833, -0.9166797995567322, 1.2747598886489868, -0.3308849632740021, -1.8288692235946655, 1.1244535446166992, -2.11541485786438 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
I think the original issue reported here was already fixed by: - #3736 Otherwise, feel free to reopen.
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
972
18
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 I think the original issue reported here was already fixed by: - #3736 Otherwise, feel free to reopen.
[ -1.189099669456482, -0.7955570816993713, -0.7317938804626465, 1.4743374586105347, -0.1267322152853012, -1.221937656402588, 0.13989776372909546, -0.9817562699317932, 1.6219779253005981, -0.8184970617294312, 0.32509636878967285, -1.6710867881774902, 0.03981862962245941, -0.6467409729957581, -0.7308878898620605, -0.855573832988739, -0.3227388262748718, -0.6958756446838379, 1.0587923526763916, 2.4356844425201416, 1.2384759187698364, -1.3837499618530273, 2.711111307144165, 0.658721387386322, -0.3117300570011139, -0.9483458995819092, 0.4586058259010315, -0.020139319822192192, -1.297613263130188, -0.4472276568412781, -0.928584635257721, -0.06388700753450394, -0.6216988563537598, -0.4868442416191101, 0.015239009633660316, 0.3935530483722687, -0.3079873323440552, -0.3464317321777344, -0.5773121118545532, -0.8383597731590271, 0.42056193947792053, -0.3530092239379883, 0.9552584886550903, -0.28082334995269775, 1.7580523490905762, -0.6738373041152954, 0.5088071823120117, 0.6927332878112793, 1.291590690612793, 0.26113763451576233, -0.006132282316684723, 0.3884318768978119, 0.35953742265701294, 0.013696461915969849, 0.5367529988288879, 1.1152626276016235, 0.6782394051551819, 0.4842151403427124, 0.7091265320777893, -2.1915483474731445, 1.3741304874420166, -0.9844062924385071, 0.19909177720546722, 1.3329722881317139, -0.9814716577529907, 0.3075513243675232, -1.7576857805252075, -0.1367204338312149, 0.5115129947662354, -2.2789976596832275, 0.26723384857177734, -1.366461157798767, -0.5928216576576233, 1.0184272527694702, 0.48714929819107056, -1.2922500371932983, 0.05285590887069702, -0.42623400688171387, 0.9406180381774902, 0.41854143142700195, 1.0390769243240356, -1.6358672380447388, -0.08184732496738434, -0.3012232780456543, 0.10840052366256714, -1.203960657119751, -1.5132074356079102, 0.5878480076789856, 0.5339552760124207, 0.6227477788925171, -0.12918740510940552, 1.0241479873657227, -1.0807315111160278, 0.8523721694946289, -1.0724265575408936, -1.7763890027999878, -1.385637879371643, -2.3539140224456787, -2.308114528656006, 0.8306942582130432, -0.47146186232566833, -0.49223172664642334, 2.126058340072632, -1.0752860307693481, -1.6651071310043335, 1.1045702695846558, 0.23830944299697876, -0.07008364796638489, 2.4143948554992676, 0.181617870926857, -0.7639942169189453, 0.5044636726379395, -0.820330798625946, 0.7854407429695129, -0.39971068501472473, 1.2728127241134644, 0.41750115156173706, -1.104548454284668, 1.5759509801864624, -0.29754018783569336, 0.5745923519134521, -0.6895753145217896, -0.5140745043754578, -0.7374511957168579, 0.26758381724357605, 1.8470139503479004, -0.23259389400482178, 1.5391802787780762, -0.237284854054451, -1.5407010316848755, -1.5247992277145386, 0.8783748745918274, 0.4642047882080078, -0.838841438293457, 0.11395186185836792, -0.3274480998516083, 0.15459544956684113, 0.00562639907002449, 1.1684030294418335, 1.347574234008789, 0.7555280923843384, -0.37031909823417664, -0.825817883014679, 0.1217758059501648, -0.10140092670917511, -0.7042769193649292, -1.7377479076385498, -0.3481121361255646, 0.12068256735801697, 0.6779584288597107, -1.2464629411697388, 1.8368712663650513, 0.8727285265922546, 1.9536163806915283, 1.0256003141403198, -0.4249134361743927, 1.479897141456604, 0.09018906950950623, 1.9112930297851562, -0.4895135164260864, 0.6002138257026672, -0.46101897954940796, -1.1914869546890259, 0.8771771192550659, -0.32876524329185486, -2.019577741622925, -0.6897945404052734, -0.7785321474075317, -0.20513640344142914, -0.8118759393692017, 0.9677181243896484, -0.27979302406311035, -1.3887939453125, 0.2160196304321289, -0.7047827839851379, 0.087405264377594, -1.296369194984436, 0.26243510842323303, 0.6672379970550537, -0.6243160963058472, 0.06357315182685852, -0.3096722364425659, -1.249150037765503, -0.5209407806396484, 0.3509896397590637, 1.8336775302886963, -0.6501398086547852, 1.0266070365905762, 1.0353336334228516, -0.6802759766578674, -0.024011988192796707, 0.38247939944267273, -0.32205766439437866, 0.8787140846252441, -1.0421452522277832, -0.481267511844635, 1.166918158531189, -0.27230408787727356, -0.5433481931686401, 1.4313490390777588, 0.702759325504303, -1.0283150672912598, -0.19660034775733948, -0.12256699800491333, -0.8294946551322937, 0.03777195140719414, -1.6426188945770264, -0.18626122176647186, 0.43445077538490295, -1.56834077835083, -0.3705161511898041, -0.12575332820415497, 1.2833259105682373, -0.17193661630153656, 1.3887590169906616, -0.32941994071006775, -0.17523428797721863, -0.39936891198158264, -0.4783417880535126, 0.08026912808418274, -0.14974768459796906, -0.5730282068252563, 0.2851699888706207, -0.7497020363807678, 0.25264406204223633, 1.492158055305481, 0.2500768005847931, 0.04166639968752861, 0.4308077096939087, 1.1014916896820068, 0.34440377354621887, -0.10163603723049164, -0.9171333909034729, -1.5375627279281616, 2.0931975841522217, -1.476834774017334, 1.9987194538116455, 0.7787895202636719, -0.02994033880531788, -1.798522710800171, -1.8492988348007202, 1.3420292139053345, 1.0950593948364258, 2.360321283340454, 0.5357484221458435, 0.45682457089424133, -0.7922385931015015, -0.692139208316803, 0.36653411388397217, -1.0073901414871216, -0.6838292479515076, 0.11539475619792938, 2.4960832595825195, 1.6408790349960327, -0.3729405403137207, -0.1667342334985733, -1.0049529075622559, 1.3848426342010498, -0.2374962866306305, 0.22852450609207153, 1.9904711246490479, -0.290654718875885, -1.0238564014434814, 1.2678724527359009, -2.292407512664795, 0.22159653902053833, 2.08489727973938, 0.2659324109554291, 0.048829976469278336, -1.3137974739074707, -0.6509919762611389, -0.283943772315979, -0.4743518829345703, -1.2596198320388794, 0.4906565845012665, -0.2409776747226715, -0.8096310496330261, -1.338440179824829, 0.08359099924564362, -1.1423546075820923, -1.683332085609436, 0.26229122281074524, 1.9029844999313354, 2.078665018081665, -0.7065219283103943, 1.49580979347229, -0.30609646439552307, 0.08649244904518127, 1.217222809791565, 1.2597129344940186, 3.17218279838562, 1.8826543092727661, -1.3173713684082031, 0.6479173302650452, -0.17905382812023163, -0.4340597093105316, 1.1025655269622803, -1.1232110261917114, 1.2452982664108276, -0.21040160953998566, -1.2991650104522705, -1.2374670505523682, 0.9757583141326904, 0.38270434737205505, -0.011316509917378426, -0.5522807836532593, 1.2009037733078003, 0.13263803720474243, 1.2809096574783325, 0.6156986355781555, -0.25285786390304565, 0.5479907393455505, -0.39875471591949463, -0.5515907406806946, 1.6602609157562256, 0.20680418610572815, -1.4949936866760254, -2.3956098556518555, -0.21264614164829254, -0.9398520588874817, 0.029002569615840912, -0.6335588693618774, -1.0278270244598389, 1.6569726467132568, 0.38692930340766907, -1.157333493232727, -0.249590665102005, -0.36875784397125244, -0.5482602119445801, 2.803788185119629, -1.3776189088821411, -0.16561248898506165, -0.9799225330352783, -0.6467738151550293, 1.6499212980270386, -1.2094457149505615, -0.25123608112335205, -0.9874362945556641, -0.552544355392456, -1.188923716545105, -0.44050589203834534, 0.006307294592261314, -0.9919075965881348, 0.7434744834899902, 0.128825381398201, -1.2305952310562134, -0.30724141001701355, -0.9227880239486694, 0.8820894360542297, -0.1313738226890564, 0.16456195712089539, 1.7937071323394775, 0.35805684328079224, -0.3599364757537842, 0.8006283044815063, 1.2413734197616577, 0.6598002314567566, -0.6249933242797852, 0.11665253341197968, -0.6172740459442139, 0.3487435281276703, -1.205729603767395, 0.2723875045776367, -2.8523993492126465, 0.6015055775642395, -0.13148853182792664, -0.07547259330749512, -0.09665574133396149, -1.288498044013977, 1.1002113819122314, 2.5054562091827393, -1.122697353363037, 0.519248902797699, 0.28160110116004944, 1.1671944856643677, -1.6121327877044678, 0.2137008011341095, -0.5462232232093811, 2.1652474403381348, 0.22353659570217133, 1.151818871498108, -0.4488186538219452, -2.325012683868408, 0.6329088807106018, -1.1635522842407227, -1.0299794673919678, 0.798454761505127, -0.779618501663208, 0.22444938123226166, -1.3444050550460815, -0.22007130086421967, -0.7568994760513306, -1.1802903413772583, 0.6647853851318359, 0.07284021377563477, 0.5322262644767761, -0.5357561707496643, 0.2521927058696747, -2.234870672225952, -1.4095083475112915, -0.1599712371826172, -0.9369247555732727, 0.5215389132499695, -0.4132937490940094, 0.7392473220825195, -0.16112922132015228, -0.045723166316747665, 0.3321596086025238, 1.5022623538970947, 3.371811866760254, 0.12951825559139252, 0.32285401225090027, -0.2729162871837616, -0.9512983560562134, 1.3935036659240723, 0.9551000595092773, -0.11253173649311066, -0.630543053150177, -1.0319010019302368, 1.3196467161178589, 1.993119478225708, 1.003184199333191, 0.05589768663048744, -0.8266703486442566, -0.745746910572052, 0.01611926220357418, 0.21663647890090942, 0.5279132723808289, 0.8974378705024719, 0.03990839421749115, 0.04127101972699165, 1.4179494380950928, 1.1720527410507202, -0.36316800117492676, 0.3321473002433777, -0.8953074812889099, -0.37073227763175964, 0.48678427934646606, 0.2917475998401642, -0.04082055389881134, 0.38808801770210266, -1.009027361869812, -0.25491905212402344, -0.32426217198371887, -0.885892391204834, -0.7999683022499084, -0.3651720881462097, -0.43852365016937256, 1.7291791439056396, 0.012249132618308067, -0.49385184049606323, 0.01586019992828369, -0.7301319241523743, -0.11730866134166718, -1.1103447675704956, 0.2850516736507416, -0.11342237889766693, -0.04524852707982063, -0.14362631738185883, 1.7644157409667969, -1.0304678678512573, -2.067321538925171, 0.22111351788043976, 0.23055614531040192, -0.265084445476532, 0.16589069366455078, 1.7019017934799194, 0.573388934135437, 1.4388704299926758, 1.3460122346878052, 0.9545818567276001, -0.6722773313522339, -1.3075509071350098, 0.6066027283668518, 0.9936162233352661, -1.3985650539398193, 0.872168779373169, -0.14095783233642578, -0.49832651019096375, 0.6304492354393005, 1.291015625, 0.4388577342033386, -2.0657925605773926, 0.8477231860160828, -0.976748526096344, 0.8586431741714478, 0.7006295919418335, 0.7337200045585632, 0.23863206803798676, 0.8176422119140625, -1.2958710193634033, -1.1480567455291748, -0.649062991142273, -0.6700537800788879, 1.9219881296157837, -0.31123119592666626, 0.5606289505958557, -0.23824259638786316, -1.2983428239822388, -0.03386611491441727, 0.6742383241653442, 0.38017508387565613, -0.4465993046760559, 0.7804570198059082, -0.6113815307617188, -1.066677212715149, -1.4343864917755127, -0.5234272480010986, -1.095789909362793, -0.9227102994918823, 1.046791434288025, 0.7596767544746399, 0.4072290360927582, 1.8898345232009888, 0.601538360118866, 0.2901765704154968, -2.5621354579925537, 0.9403795599937439, 0.3070768415927887, -0.06097138673067093, 0.8736043572425842, 0.37226757407188416, 1.120300531387329, -0.04075902700424194, 0.5649110078811646, -2.4404332637786865, 2.3110101222991943, -0.2778354287147522, 0.6939486265182495, 0.03570296987891197, -0.06273755431175232, 1.0857033729553223, 0.5911774635314941, 0.5232969522476196, -1.0993437767028809, 0.735252857208252, -0.5761811137199402, 1.2319982051849365, 0.9107809662818909, -0.8172422051429749, -0.006258653476834297, 1.3443835973739624, 0.44105613231658936, -0.5056714415550232, -0.9574352502822876, -0.876013457775116, 0.9270913600921631, 1.7159628868103027, -0.01301922369748354, -0.0052247499115765095, 0.8431912064552307, 0.6370906233787537, -1.2756168842315674, 0.12454073131084442, -0.6396706700325012, -0.7610560059547424, 1.6378425359725952, 2.012169361114502, -0.1510894000530243, -0.15570521354675293, -0.7376449704170227, -1.2828843593597412, 0.8189796209335327, -0.03763699531555176, 0.0631776750087738, 0.6551716923713684, -0.6121883392333984, 1.1296062469482422, 0.809657871723175, 0.9329223036766052, 0.24199749529361725, 0.2131461203098297, 0.36422520875930786, -0.2839975655078888, -1.131378412246704, -0.3184884190559387, -1.0313680171966553, -2.6109628677368164, 0.4493464529514313, -0.2980629503726959, -1.4127023220062256, 0.06623688340187073, -1.0065526962280273, 0.8250408172607422, -0.5546984672546387, -1.1076537370681763, -1.4983980655670166, 0.26368480920791626, -0.11281920969486237, 0.9701534509658813, -1.6244393587112427, -0.18645034730434418, 1.2322876453399658, 0.8861871957778931, -0.6378934979438782, 1.0117751359939575, 0.2514393627643585, 1.0025324821472168, 0.8449063897132874, -0.43219679594039917, 0.5241384506225586, 0.13405440747737885, -1.3426364660263062, 0.4452803432941437, 1.2717481851577759, 0.15209738910198212, 1.4732465744018555, -0.5347955226898193, -0.00022855866700410843, 0.4112737774848938, -0.46910184621810913, -0.46101483702659607, -0.59990394115448, 0.67037433385849, 0.05065343901515007, -0.9950439929962158, -0.027855461463332176, -0.01693429797887802, -0.2727358341217041, 0.22684910893440247, -1.4362897872924805, -0.13239061832427979, -0.4116397202014923, -0.5493065118789673, -1.359377384185791, -0.12507697939872742, 1.267830491065979, -0.7536513805389404, -0.11194410920143127, 0.5235719084739685, 0.28133609890937805, 0.5062869191169739, 0.6938580274581909, -0.7399914860725403, -0.3612280786037445, -0.25606197118759155, -0.3598293960094452, 0.34857675433158875, 1.2667791843414307, -0.07047107815742493, -0.9845646023750305, 0.6808948516845703, -0.2889901101589203, 0.11314238607883453, 1.9983816146850586, 0.06367383897304535, -0.8027939200401306, 0.379915714263916, -0.7652488350868225, 1.9236477613449097, 1.6442965269088745, 1.2745872735977173, -0.09205013513565063, -1.004032015800476, 0.7113620638847351, -0.2907657325267792, -0.3787291646003723, 0.8441634774208069, 0.317812442779541, -0.2735408842563629, -1.413967251777649, 0.6740742921829224, 1.2924355268478394, -0.8035975694656372, -0.8493212461471558, 0.14222466945648193, -0.8266512751579285, 1.08072829246521, 0.5879631638526917, 0.3779411017894745, 0.2634584307670593, 1.6283040046691895, 0.7940601706504822, -0.5219449400901794, 0.5309085249900818, 0.4867839515209198, -0.13338901102542877, -2.0653340816497803, -1.1514315605163574, 0.30564770102500916, -0.4958871304988861, -1.5953601598739624, 1.4567620754241943, -1.175252914428711, -0.9811199307441711, 0.6292881369590759, 0.15037782490253448, 1.393094539642334, 0.3039657175540924, 1.6024165153503418, 2.0746805667877197, 0.8646593689918518, 0.4199172556400299, 1.2719672918319702, -0.1966075748205185, -0.42982327938079834, 1.7747035026550293, -0.492178350687027, 0.5314273238182068, 1.074894905090332, -0.33558738231658936, -1.1448497772216797, -0.794490396976471, -1.180630087852478, -0.7567190527915955, 1.176252007484436, 0.07845419645309448, -1.039898157119751, 0.25219911336898804, 1.6124835014343262, 0.08549259603023529, -0.282981812953949, 0.57746422290802, 0.4038931429386139, -0.7428975701332092, -0.11816295981407166, -0.9851834774017334, 0.573483407497406, -0.15163566172122955, -0.36361509561538696, 0.294621080160141, 0.4796315133571625, 1.3227901458740234, -0.012418503873050213, 0.11033351719379425, 1.150873064994812, -1.4664433002471924, 1.4783855676651, -0.6947782635688782, 0.30145594477653503, -2.2755002975463867, 1.356665015220642, -0.7742455005645752, 1.9511704444885254, -2.610713243484497, 0.4095308482646942, -0.5379785895347595, -0.5360769033432007, 0.2808295488357544, -0.2599213123321533, 0.1874147653579712, -0.17038750648498535, -1.1262415647506714, -0.07599867880344391, -0.809498131275177, 0.4837431013584137, 1.1794852018356323, 1.3779222965240479, -1.0216684341430664, -0.29200980067253113, -1.670587182044983, -0.10248549282550812, -0.610710859298706, 0.23887218534946442, -1.893760085105896, -0.06125035509467125, -1.947736144065857, -2.400625705718994, -1.3954424858093262, -0.8449583649635315, 1.150350570678711, 0.1699065864086151, -0.9199272394180298, 1.2861436605453491, -0.32028642296791077, -1.8090401887893677, 1.151832103729248, -2.122948169708252 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
Thanks @lhoestq for finding the reason of incorrect resampling. This issue affects all languages which have sound files with different sampling rates such as Turkish and Luganda.
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
973
27
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 Thanks @lhoestq for finding the reason of incorrect resampling. This issue affects all languages which have sound files with different sampling rates such as Turkish and Luganda.
[ -1.3920469284057617, -0.8224828243255615, -0.6726378798484802, 1.4861177206039429, -0.1254834085702896, -1.2422548532485962, 0.1428719162940979, -1.1265442371368408, 1.6405339241027832, -0.7956996560096741, 0.43074506521224976, -1.6366304159164429, 0.04461100697517395, -0.5762713551521301, -0.8422549366950989, -0.9075511693954468, -0.4147358536720276, -0.6475420594215393, 1.0152937173843384, 2.4049034118652344, 1.2402695417404175, -1.3607895374298096, 2.7938690185546875, 0.7410194873809814, -0.2787855267524719, -0.9628453254699707, 0.5201768279075623, 0.04540131986141205, -1.3535453081130981, -0.5183335542678833, -0.9586236476898193, -0.06760258972644806, -0.4997299909591675, -0.4181402623653412, -0.04528563469648361, 0.3096561133861542, -0.30089831352233887, -0.4450500011444092, -0.6222570538520813, -0.8348660469055176, 0.3144114017486572, -0.35935544967651367, 0.9171770215034485, -0.24309787154197693, 1.7946267127990723, -0.715705394744873, 0.4489205479621887, 0.6602954268455505, 1.3614834547042847, 0.2835189402103424, 0.09526573121547699, 0.4257161319255829, 0.5132258534431458, 0.008681084029376507, 0.5726178288459778, 1.1019930839538574, 0.7211399078369141, 0.4253939688205719, 0.7862055897712708, -2.2152998447418213, 1.1746106147766113, -1.0306979417800903, 0.14792868494987488, 1.4416203498840332, -0.8547709584236145, 0.35555770993232727, -1.723151683807373, -0.004540770780295134, 0.6042393445968628, -2.2994141578674316, 0.19740426540374756, -1.4235222339630127, -0.5522645115852356, 1.0229756832122803, 0.4434637427330017, -1.1869348287582397, 0.15902584791183472, -0.42026180028915405, 0.9321914315223694, 0.348739355802536, 1.0895154476165771, -1.5902942419052124, -0.11524331569671631, -0.34883546829223633, 0.03860345855355263, -1.1833800077438354, -1.523234486579895, 0.6061765551567078, 0.49819308519363403, 0.5806512236595154, -0.08896160870790482, 1.0965653657913208, -1.112172245979309, 0.9226510524749756, -1.0990744829177856, -1.7225209474563599, -1.548104166984558, -2.1894571781158447, -2.165640354156494, 0.8370531797409058, -0.5558211803436279, -0.46716606616973877, 1.9982763528823853, -1.107481598854065, -1.6234225034713745, 1.2217837572097778, 0.20553895831108093, -0.03370530530810356, 2.409010171890259, 0.15122778713703156, -0.6486408710479736, 0.4405570924282074, -0.7436134219169617, 0.7609421014785767, -0.3330332636833191, 1.1901553869247437, 0.3389277756214142, -1.0300371646881104, 1.5311554670333862, -0.3350277245044708, 0.520095944404602, -0.6320230960845947, -0.531862199306488, -0.7486974596977234, 0.38592594861984253, 1.8247523307800293, -0.2515883147716522, 1.6866002082824707, -0.38702425360679626, -1.5722333192825317, -1.5990341901779175, 0.8052170872688293, 0.5449525713920593, -0.9112103581428528, 0.062205515801906586, -0.390290766954422, 0.1480615884065628, -0.05877213180065155, 1.2151803970336914, 1.3797603845596313, 0.6810975670814514, -0.4046233296394348, -0.7475613951683044, 0.16772031784057617, 0.013625581748783588, -0.8686111569404602, -1.6720114946365356, -0.41134113073349, 0.0842803418636322, 0.6372669339179993, -1.3112009763717651, 1.6905324459075928, 0.9279705286026001, 1.7938522100448608, 1.1228716373443604, -0.4716665744781494, 1.5226011276245117, 0.18580925464630127, 1.7846213579177856, -0.5675927400588989, 0.6938465237617493, -0.4108181297779083, -1.1399037837982178, 0.7621167302131653, -0.3245983421802521, -2.1027040481567383, -0.8128036856651306, -0.5815792083740234, -0.2018086463212967, -0.7883877754211426, 0.9674639701843262, -0.35737892985343933, -1.3852767944335938, 0.16565686464309692, -0.7763639688491821, 0.16895438730716705, -1.2172025442123413, 0.24921609461307526, 0.7211940884590149, -0.5979413390159607, 0.11193583905696869, -0.10696328431367874, -1.2824152708053589, -0.2651790976524353, 0.2230699062347412, 1.8945356607437134, -0.8061832189559937, 0.9181395769119263, 1.0000890493392944, -0.6546730399131775, 0.020618561655282974, 0.21696628630161285, -0.2058989703655243, 0.9435762166976929, -0.9922937154769897, -0.4962866008281708, 1.2366794347763062, -0.24417656660079956, -0.46233561635017395, 1.4168462753295898, 0.6873024106025696, -0.9566481709480286, -0.2833556830883026, -0.14088082313537598, -0.8958540558815002, -0.027889568358659744, -1.5328792333602905, -0.2411201298236847, 0.46479952335357666, -1.5153896808624268, -0.4168466627597809, -0.17386658489704132, 1.2079681158065796, -0.24770714342594147, 1.446370244026184, -0.4223322868347168, -0.23435530066490173, -0.2875558137893677, -0.37007856369018555, 0.16294293105602264, -0.2457914501428604, -0.6608290076255798, 0.18752817809581757, -0.7011070847511292, 0.39205554127693176, 1.379658818244934, 0.34218651056289673, 0.0799277201294899, 0.3510233163833618, 1.0162569284439087, 0.3940310478210449, -0.08556755632162094, -0.8792168498039246, -1.5839576721191406, 2.067413091659546, -1.488531231880188, 2.092167377471924, 0.7543487548828125, -0.046721577644348145, -1.7018076181411743, -1.8348348140716553, 1.239909052848816, 1.0602130889892578, 2.349695920944214, 0.4159335792064667, 0.4107920229434967, -0.7899381518363953, -0.6721205115318298, 0.2831594944000244, -1.02386474609375, -0.677273154258728, 0.09267468750476837, 2.4224369525909424, 1.6748570203781128, -0.40522435307502747, -0.17104415595531464, -0.9724377989768982, 1.3146936893463135, -0.16725623607635498, 0.23245766758918762, 1.9846314191818237, -0.2581525444984436, -1.0970426797866821, 1.3305011987686157, -2.3279800415039062, 0.14850567281246185, 2.002718448638916, 0.2786496579647064, 0.0070619843900203705, -1.3204025030136108, -0.6603819727897644, -0.42005109786987305, -0.46575817465782166, -1.2810403108596802, 0.4970822334289551, -0.26154443621635437, -0.8162463307380676, -1.3151627779006958, -0.02066977322101593, -1.0874017477035522, -1.6056870222091675, 0.2341158390045166, 2.03122615814209, 1.9043641090393066, -0.7598724365234375, 1.5093237161636353, -0.2623845636844635, -0.007938618771731853, 1.1810575723648071, 1.318279504776001, 3.1262121200561523, 1.841643214225769, -1.322070598602295, 0.5258016586303711, -0.2832053303718567, -0.4558199346065521, 1.1356265544891357, -1.2468281984329224, 1.365499496459961, -0.02443239465355873, -1.2458679676055908, -1.167910099029541, 0.9618567228317261, 0.4625069797039032, -0.017913082614541054, -0.6077032685279846, 1.1290092468261719, 0.015084815211594105, 1.316731572151184, 0.5680792331695557, -0.2983647584915161, 0.5311970710754395, -0.34779512882232666, -0.5509042143821716, 1.5192478895187378, 0.09363871812820435, -1.4518651962280273, -2.3502893447875977, -0.16761352121829987, -0.8349912762641907, 0.0518140010535717, -0.5372459888458252, -1.0648356676101685, 1.7370178699493408, 0.37020114064216614, -1.3310993909835815, -0.327993780374527, -0.41255125403404236, -0.5143149495124817, 2.913055658340454, -1.312877893447876, -0.176626056432724, -0.99048912525177, -0.5983820557594299, 1.7136189937591553, -1.1692618131637573, -0.2396831214427948, -0.9555060863494873, -0.5842412114143372, -1.3011231422424316, -0.4122913181781769, 0.08108783513307571, -1.059385895729065, 0.859379231929779, 0.26647549867630005, -1.151076078414917, -0.3982175290584564, -0.8824379444122314, 0.8619803786277771, -0.13231243193149567, 0.2167872190475464, 2.0653815269470215, 0.40557050704956055, -0.2708710730075836, 0.833142876625061, 1.272879719734192, 0.6928480863571167, -0.6976916790008545, 0.11457742005586624, -0.6570323705673218, 0.3297605514526367, -1.357674241065979, 0.29297274351119995, -2.8084752559661865, 0.6675459146499634, -0.07607075572013855, -0.16282953321933746, 0.05930706113576889, -1.1975395679473877, 1.132210612297058, 2.568801164627075, -1.1180826425552368, 0.4807402789592743, 0.2979324758052826, 1.131064772605896, -1.6755964756011963, 0.2973039746284485, -0.4311525821685791, 2.123277425765991, 0.3973225951194763, 1.2450224161148071, -0.494792103767395, -2.2888002395629883, 0.6372920274734497, -1.255068063735962, -1.1899515390396118, 0.8027642369270325, -0.8609787821769714, 0.24276147782802582, -1.4677462577819824, -0.2761248052120209, -0.8285009264945984, -1.1428923606872559, 0.5768202543258667, 0.16232796013355255, 0.4078158736228943, -0.5518743991851807, 0.27620941400527954, -2.3932907581329346, -1.3896238803863525, -0.1086963638663292, -1.020229697227478, 0.5055070519447327, -0.45378559827804565, 0.6908156275749207, -0.08805693686008453, -0.029698528349399567, 0.38194793462753296, 1.6569015979766846, 3.3990206718444824, 0.3432939946651459, 0.3302674889564514, -0.29005110263824463, -0.9391810297966003, 1.4048519134521484, 0.8746007084846497, -0.0359812006354332, -0.596266508102417, -1.1389296054840088, 1.226996660232544, 1.8934788703918457, 0.963687539100647, -0.00602163840085268, -0.8038417100906372, -0.7750322818756104, -0.08996232599020004, 0.23699498176574707, 0.5650245547294617, 0.989140510559082, 0.08590146154165268, 0.08611630648374557, 1.5393438339233398, 1.1917697191238403, -0.4317839741706848, 0.3180740177631378, -0.8366612792015076, -0.5214040279388428, 0.4024369716644287, 0.28265106678009033, -0.017438245937228203, 0.4763607978820801, -0.947776734828949, -0.17379418015480042, -0.5325052738189697, -0.8206740617752075, -0.7116966843605042, -0.3325418531894684, -0.3454505503177643, 1.6021182537078857, 0.12308187782764435, -0.4595828950405121, -0.043335091322660446, -0.7241536974906921, -0.24414579570293427, -1.0371596813201904, 0.320769727230072, -0.020835060626268387, -0.09342598915100098, -0.05751573294401169, 1.7108601331710815, -0.8590230941772461, -2.0362067222595215, 0.16935794055461884, 0.15349198877811432, -0.29242733120918274, 0.19608260691165924, 1.568585753440857, 0.575594425201416, 1.4240813255310059, 1.3199974298477173, 0.862415075302124, -0.5615981221199036, -1.3656363487243652, 0.6689519882202148, 0.9596808552742004, -1.2949415445327759, 0.8922305703163147, -0.20456720888614655, -0.5199177265167236, 0.5933687090873718, 1.3397431373596191, 0.45095953345298767, -2.015702486038208, 0.9037430286407471, -0.9100394248962402, 0.8623488545417786, 0.6876624226570129, 0.6814846396446228, 0.25988128781318665, 0.8371727466583252, -1.2219512462615967, -1.2340326309204102, -0.6999858617782593, -0.7196918725967407, 1.9776438474655151, -0.35381463170051575, 0.6544365286827087, -0.2606809437274933, -1.1815134286880493, -0.001973289530724287, 0.603135347366333, 0.36063048243522644, -0.49845635890960693, 0.8523103594779968, -0.5993491411209106, -1.0963143110275269, -1.3776642084121704, -0.45111870765686035, -1.041988730430603, -0.905070424079895, 0.9476454854011536, 0.8207343220710754, 0.30735278129577637, 1.7742317914962769, 0.6292149424552917, 0.3353559076786041, -2.689619541168213, 0.9537433385848999, 0.1592453569173813, -0.116688571870327, 0.8938232064247131, 0.34136489033699036, 1.0127743482589722, 0.06903407722711563, 0.473847895860672, -2.558945655822754, 2.360347032546997, -0.41137728095054626, 0.7631104588508606, -0.04763241857290268, -0.042436383664608, 1.1696480512619019, 0.7050463557243347, 0.5539021492004395, -1.0408413410186768, 0.6431414484977722, -0.4085714817047119, 1.2340995073318481, 0.9329420328140259, -0.7817742228507996, -0.05735209956765175, 1.5007669925689697, 0.4788152873516083, -0.6308817267417908, -0.8709248900413513, -0.9270895719528198, 0.9065390229225159, 1.750038504600525, 0.017110757529735565, -0.03376206383109093, 0.9207185506820679, 0.6952529549598694, -1.1677031517028809, 0.13564278185367584, -0.6762940883636475, -0.7526960968971252, 1.6547234058380127, 2.138350486755371, -0.10304621607065201, -0.29518118500709534, -0.5768266320228577, -1.2187974452972412, 0.753158450126648, -0.08024919033050537, 0.26698222756385803, 0.6858541369438171, -0.7310247421264648, 1.0406248569488525, 0.8048052191734314, 0.9792479872703552, 0.2853330671787262, 0.25125443935394287, 0.43668892979621887, -0.281421422958374, -1.174363136291504, -0.32896697521209717, -1.1512802839279175, -2.4457168579101562, 0.32768818736076355, -0.25310030579566956, -1.3901065587997437, 0.11103262007236481, -1.0830810070037842, 0.8024473786354065, -0.6888136267662048, -1.0665292739868164, -1.5736958980560303, 0.20282067358493805, 0.04338008910417557, 0.8833816051483154, -1.6311596632003784, -0.2561163604259491, 1.1897066831588745, 0.893227756023407, -0.5517680644989014, 0.921951413154602, 0.18651901185512543, 1.0322805643081665, 0.803269624710083, -0.40937769412994385, 0.3835245370864868, -0.07938876003026962, -1.3543570041656494, 0.5007349252700806, 1.208141803741455, 0.24165035784244537, 1.6117380857467651, -0.5113011598587036, -0.05031760036945343, 0.3877544701099396, -0.5440784692764282, -0.2911362051963806, -0.46890515089035034, 0.5689723491668701, 0.17062555253505707, -0.9043975472450256, -0.10545910894870758, -0.06527754664421082, -0.3386080265045166, 0.08924707770347595, -1.3746665716171265, -0.07979772239923477, -0.4456019401550293, -0.5850498080253601, -1.1451961994171143, -0.12111279368400574, 1.3604631423950195, -0.8974778652191162, -0.14927977323532104, 0.4856261610984802, 0.2786639332771301, 0.5994020104408264, 0.7024035453796387, -0.7100880146026611, -0.3409590721130371, -0.2910833954811096, -0.303238183259964, 0.3027670681476593, 1.2723337411880493, -0.13932785391807556, -0.8756037950515747, 0.60691899061203, -0.36420300602912903, 0.13031521439552307, 1.8982622623443604, -0.02737969532608986, -0.6860343217849731, 0.3009139597415924, -0.7972003221511841, 1.9049944877624512, 1.6251791715621948, 1.250503420829773, -0.1257859170436859, -0.9898862838745117, 0.643151581287384, -0.4361223876476288, -0.39072126150131226, 0.7274683117866516, 0.3450058698654175, -0.2232637107372284, -1.4539482593536377, 0.7500842213630676, 1.2425410747528076, -0.9871392250061035, -0.7261852622032166, 0.21788297593593597, -0.8076938986778259, 1.0522329807281494, 0.5696714520454407, 0.2402709573507309, 0.3301248550415039, 1.676027536392212, 0.8839903473854065, -0.329928457736969, 0.4956236481666565, 0.5735917091369629, -0.20663687586784363, -2.203526020050049, -1.173896074295044, 0.2912505865097046, -0.42254671454429626, -1.589289903640747, 1.442243218421936, -1.1496397256851196, -0.9648959636688232, 0.6511660814285278, 0.11723779141902924, 1.3963836431503296, 0.36449891328811646, 1.59639310836792, 2.096285820007324, 0.9262003898620605, 0.4458015263080597, 1.244294285774231, -0.08340109884738922, -0.4461541473865509, 1.7690963745117188, -0.390906423330307, 0.47446852922439575, 0.9792773127555847, -0.30851805210113525, -1.103279948234558, -0.8371413350105286, -1.366457462310791, -0.7384980320930481, 1.1522306203842163, 0.0817585289478302, -1.0464813709259033, 0.23051141202449799, 1.577062726020813, 0.16501611471176147, -0.43383800983428955, 0.589514970779419, 0.5203112959861755, -0.7592626810073853, -0.15056844055652618, -0.8356045484542847, 0.5255478620529175, -0.1185736209154129, -0.33985406160354614, 0.25607290863990784, 0.4402123987674713, 1.441201090812683, -0.01731412298977375, 0.03300465643405914, 1.0713346004486084, -1.5143805742263794, 1.4924548864364624, -0.5963876247406006, 0.34682169556617737, -2.247520923614502, 1.4284089803695679, -0.7359286546707153, 1.9842536449432373, -2.620241165161133, 0.5249099135398865, -0.5941247344017029, -0.5098524689674377, 0.27904364466667175, -0.3464415371417999, 0.2373819202184677, -0.20711974799633026, -1.1657087802886963, -0.06664109230041504, -0.7405198812484741, 0.44406989216804504, 1.1550424098968506, 1.3931633234024048, -1.0949174165725708, -0.397943377494812, -1.61432945728302, -0.02749267965555191, -0.6833990812301636, 0.2517191171646118, -2.0113487243652344, -0.06703821569681168, -1.9614231586456299, -2.3990254402160645, -1.3229610919952393, -0.680630087852478, 1.088256597518921, 0.13461340963840485, -0.856856107711792, 1.3230746984481812, -0.34262847900390625, -1.7755447626113892, 1.178642988204956, -2.1467130184173584 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
@cahya-wirawan - do you know how many languages have different sampling rates in Common Voice? I'm quite surprised to see this for multiple languages actually
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
973
25
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 @cahya-wirawan - do you know how many languages have different sampling rates in Common Voice? I'm quite surprised to see this for multiple languages actually
[ -1.3920469284057617, -0.8224828243255615, -0.6726378798484802, 1.4861177206039429, -0.1254834085702896, -1.2422548532485962, 0.1428719162940979, -1.1265442371368408, 1.6405339241027832, -0.7956996560096741, 0.43074506521224976, -1.6366304159164429, 0.04461100697517395, -0.5762713551521301, -0.8422549366950989, -0.9075511693954468, -0.4147358536720276, -0.6475420594215393, 1.0152937173843384, 2.4049034118652344, 1.2402695417404175, -1.3607895374298096, 2.7938690185546875, 0.7410194873809814, -0.2787855267524719, -0.9628453254699707, 0.5201768279075623, 0.04540131986141205, -1.3535453081130981, -0.5183335542678833, -0.9586236476898193, -0.06760258972644806, -0.4997299909591675, -0.4181402623653412, -0.04528563469648361, 0.3096561133861542, -0.30089831352233887, -0.4450500011444092, -0.6222570538520813, -0.8348660469055176, 0.3144114017486572, -0.35935544967651367, 0.9171770215034485, -0.24309787154197693, 1.7946267127990723, -0.715705394744873, 0.4489205479621887, 0.6602954268455505, 1.3614834547042847, 0.2835189402103424, 0.09526573121547699, 0.4257161319255829, 0.5132258534431458, 0.008681084029376507, 0.5726178288459778, 1.1019930839538574, 0.7211399078369141, 0.4253939688205719, 0.7862055897712708, -2.2152998447418213, 1.1746106147766113, -1.0306979417800903, 0.14792868494987488, 1.4416203498840332, -0.8547709584236145, 0.35555770993232727, -1.723151683807373, -0.004540770780295134, 0.6042393445968628, -2.2994141578674316, 0.19740426540374756, -1.4235222339630127, -0.5522645115852356, 1.0229756832122803, 0.4434637427330017, -1.1869348287582397, 0.15902584791183472, -0.42026180028915405, 0.9321914315223694, 0.348739355802536, 1.0895154476165771, -1.5902942419052124, -0.11524331569671631, -0.34883546829223633, 0.03860345855355263, -1.1833800077438354, -1.523234486579895, 0.6061765551567078, 0.49819308519363403, 0.5806512236595154, -0.08896160870790482, 1.0965653657913208, -1.112172245979309, 0.9226510524749756, -1.0990744829177856, -1.7225209474563599, -1.548104166984558, -2.1894571781158447, -2.165640354156494, 0.8370531797409058, -0.5558211803436279, -0.46716606616973877, 1.9982763528823853, -1.107481598854065, -1.6234225034713745, 1.2217837572097778, 0.20553895831108093, -0.03370530530810356, 2.409010171890259, 0.15122778713703156, -0.6486408710479736, 0.4405570924282074, -0.7436134219169617, 0.7609421014785767, -0.3330332636833191, 1.1901553869247437, 0.3389277756214142, -1.0300371646881104, 1.5311554670333862, -0.3350277245044708, 0.520095944404602, -0.6320230960845947, -0.531862199306488, -0.7486974596977234, 0.38592594861984253, 1.8247523307800293, -0.2515883147716522, 1.6866002082824707, -0.38702425360679626, -1.5722333192825317, -1.5990341901779175, 0.8052170872688293, 0.5449525713920593, -0.9112103581428528, 0.062205515801906586, -0.390290766954422, 0.1480615884065628, -0.05877213180065155, 1.2151803970336914, 1.3797603845596313, 0.6810975670814514, -0.4046233296394348, -0.7475613951683044, 0.16772031784057617, 0.013625581748783588, -0.8686111569404602, -1.6720114946365356, -0.41134113073349, 0.0842803418636322, 0.6372669339179993, -1.3112009763717651, 1.6905324459075928, 0.9279705286026001, 1.7938522100448608, 1.1228716373443604, -0.4716665744781494, 1.5226011276245117, 0.18580925464630127, 1.7846213579177856, -0.5675927400588989, 0.6938465237617493, -0.4108181297779083, -1.1399037837982178, 0.7621167302131653, -0.3245983421802521, -2.1027040481567383, -0.8128036856651306, -0.5815792083740234, -0.2018086463212967, -0.7883877754211426, 0.9674639701843262, -0.35737892985343933, -1.3852767944335938, 0.16565686464309692, -0.7763639688491821, 0.16895438730716705, -1.2172025442123413, 0.24921609461307526, 0.7211940884590149, -0.5979413390159607, 0.11193583905696869, -0.10696328431367874, -1.2824152708053589, -0.2651790976524353, 0.2230699062347412, 1.8945356607437134, -0.8061832189559937, 0.9181395769119263, 1.0000890493392944, -0.6546730399131775, 0.020618561655282974, 0.21696628630161285, -0.2058989703655243, 0.9435762166976929, -0.9922937154769897, -0.4962866008281708, 1.2366794347763062, -0.24417656660079956, -0.46233561635017395, 1.4168462753295898, 0.6873024106025696, -0.9566481709480286, -0.2833556830883026, -0.14088082313537598, -0.8958540558815002, -0.027889568358659744, -1.5328792333602905, -0.2411201298236847, 0.46479952335357666, -1.5153896808624268, -0.4168466627597809, -0.17386658489704132, 1.2079681158065796, -0.24770714342594147, 1.446370244026184, -0.4223322868347168, -0.23435530066490173, -0.2875558137893677, -0.37007856369018555, 0.16294293105602264, -0.2457914501428604, -0.6608290076255798, 0.18752817809581757, -0.7011070847511292, 0.39205554127693176, 1.379658818244934, 0.34218651056289673, 0.0799277201294899, 0.3510233163833618, 1.0162569284439087, 0.3940310478210449, -0.08556755632162094, -0.8792168498039246, -1.5839576721191406, 2.067413091659546, -1.488531231880188, 2.092167377471924, 0.7543487548828125, -0.046721577644348145, -1.7018076181411743, -1.8348348140716553, 1.239909052848816, 1.0602130889892578, 2.349695920944214, 0.4159335792064667, 0.4107920229434967, -0.7899381518363953, -0.6721205115318298, 0.2831594944000244, -1.02386474609375, -0.677273154258728, 0.09267468750476837, 2.4224369525909424, 1.6748570203781128, -0.40522435307502747, -0.17104415595531464, -0.9724377989768982, 1.3146936893463135, -0.16725623607635498, 0.23245766758918762, 1.9846314191818237, -0.2581525444984436, -1.0970426797866821, 1.3305011987686157, -2.3279800415039062, 0.14850567281246185, 2.002718448638916, 0.2786496579647064, 0.0070619843900203705, -1.3204025030136108, -0.6603819727897644, -0.42005109786987305, -0.46575817465782166, -1.2810403108596802, 0.4970822334289551, -0.26154443621635437, -0.8162463307380676, -1.3151627779006958, -0.02066977322101593, -1.0874017477035522, -1.6056870222091675, 0.2341158390045166, 2.03122615814209, 1.9043641090393066, -0.7598724365234375, 1.5093237161636353, -0.2623845636844635, -0.007938618771731853, 1.1810575723648071, 1.318279504776001, 3.1262121200561523, 1.841643214225769, -1.322070598602295, 0.5258016586303711, -0.2832053303718567, -0.4558199346065521, 1.1356265544891357, -1.2468281984329224, 1.365499496459961, -0.02443239465355873, -1.2458679676055908, -1.167910099029541, 0.9618567228317261, 0.4625069797039032, -0.017913082614541054, -0.6077032685279846, 1.1290092468261719, 0.015084815211594105, 1.316731572151184, 0.5680792331695557, -0.2983647584915161, 0.5311970710754395, -0.34779512882232666, -0.5509042143821716, 1.5192478895187378, 0.09363871812820435, -1.4518651962280273, -2.3502893447875977, -0.16761352121829987, -0.8349912762641907, 0.0518140010535717, -0.5372459888458252, -1.0648356676101685, 1.7370178699493408, 0.37020114064216614, -1.3310993909835815, -0.327993780374527, -0.41255125403404236, -0.5143149495124817, 2.913055658340454, -1.312877893447876, -0.176626056432724, -0.99048912525177, -0.5983820557594299, 1.7136189937591553, -1.1692618131637573, -0.2396831214427948, -0.9555060863494873, -0.5842412114143372, -1.3011231422424316, -0.4122913181781769, 0.08108783513307571, -1.059385895729065, 0.859379231929779, 0.26647549867630005, -1.151076078414917, -0.3982175290584564, -0.8824379444122314, 0.8619803786277771, -0.13231243193149567, 0.2167872190475464, 2.0653815269470215, 0.40557050704956055, -0.2708710730075836, 0.833142876625061, 1.272879719734192, 0.6928480863571167, -0.6976916790008545, 0.11457742005586624, -0.6570323705673218, 0.3297605514526367, -1.357674241065979, 0.29297274351119995, -2.8084752559661865, 0.6675459146499634, -0.07607075572013855, -0.16282953321933746, 0.05930706113576889, -1.1975395679473877, 1.132210612297058, 2.568801164627075, -1.1180826425552368, 0.4807402789592743, 0.2979324758052826, 1.131064772605896, -1.6755964756011963, 0.2973039746284485, -0.4311525821685791, 2.123277425765991, 0.3973225951194763, 1.2450224161148071, -0.494792103767395, -2.2888002395629883, 0.6372920274734497, -1.255068063735962, -1.1899515390396118, 0.8027642369270325, -0.8609787821769714, 0.24276147782802582, -1.4677462577819824, -0.2761248052120209, -0.8285009264945984, -1.1428923606872559, 0.5768202543258667, 0.16232796013355255, 0.4078158736228943, -0.5518743991851807, 0.27620941400527954, -2.3932907581329346, -1.3896238803863525, -0.1086963638663292, -1.020229697227478, 0.5055070519447327, -0.45378559827804565, 0.6908156275749207, -0.08805693686008453, -0.029698528349399567, 0.38194793462753296, 1.6569015979766846, 3.3990206718444824, 0.3432939946651459, 0.3302674889564514, -0.29005110263824463, -0.9391810297966003, 1.4048519134521484, 0.8746007084846497, -0.0359812006354332, -0.596266508102417, -1.1389296054840088, 1.226996660232544, 1.8934788703918457, 0.963687539100647, -0.00602163840085268, -0.8038417100906372, -0.7750322818756104, -0.08996232599020004, 0.23699498176574707, 0.5650245547294617, 0.989140510559082, 0.08590146154165268, 0.08611630648374557, 1.5393438339233398, 1.1917697191238403, -0.4317839741706848, 0.3180740177631378, -0.8366612792015076, -0.5214040279388428, 0.4024369716644287, 0.28265106678009033, -0.017438245937228203, 0.4763607978820801, -0.947776734828949, -0.17379418015480042, -0.5325052738189697, -0.8206740617752075, -0.7116966843605042, -0.3325418531894684, -0.3454505503177643, 1.6021182537078857, 0.12308187782764435, -0.4595828950405121, -0.043335091322660446, -0.7241536974906921, -0.24414579570293427, -1.0371596813201904, 0.320769727230072, -0.020835060626268387, -0.09342598915100098, -0.05751573294401169, 1.7108601331710815, -0.8590230941772461, -2.0362067222595215, 0.16935794055461884, 0.15349198877811432, -0.29242733120918274, 0.19608260691165924, 1.568585753440857, 0.575594425201416, 1.4240813255310059, 1.3199974298477173, 0.862415075302124, -0.5615981221199036, -1.3656363487243652, 0.6689519882202148, 0.9596808552742004, -1.2949415445327759, 0.8922305703163147, -0.20456720888614655, -0.5199177265167236, 0.5933687090873718, 1.3397431373596191, 0.45095953345298767, -2.015702486038208, 0.9037430286407471, -0.9100394248962402, 0.8623488545417786, 0.6876624226570129, 0.6814846396446228, 0.25988128781318665, 0.8371727466583252, -1.2219512462615967, -1.2340326309204102, -0.6999858617782593, -0.7196918725967407, 1.9776438474655151, -0.35381463170051575, 0.6544365286827087, -0.2606809437274933, -1.1815134286880493, -0.001973289530724287, 0.603135347366333, 0.36063048243522644, -0.49845635890960693, 0.8523103594779968, -0.5993491411209106, -1.0963143110275269, -1.3776642084121704, -0.45111870765686035, -1.041988730430603, -0.905070424079895, 0.9476454854011536, 0.8207343220710754, 0.30735278129577637, 1.7742317914962769, 0.6292149424552917, 0.3353559076786041, -2.689619541168213, 0.9537433385848999, 0.1592453569173813, -0.116688571870327, 0.8938232064247131, 0.34136489033699036, 1.0127743482589722, 0.06903407722711563, 0.473847895860672, -2.558945655822754, 2.360347032546997, -0.41137728095054626, 0.7631104588508606, -0.04763241857290268, -0.042436383664608, 1.1696480512619019, 0.7050463557243347, 0.5539021492004395, -1.0408413410186768, 0.6431414484977722, -0.4085714817047119, 1.2340995073318481, 0.9329420328140259, -0.7817742228507996, -0.05735209956765175, 1.5007669925689697, 0.4788152873516083, -0.6308817267417908, -0.8709248900413513, -0.9270895719528198, 0.9065390229225159, 1.750038504600525, 0.017110757529735565, -0.03376206383109093, 0.9207185506820679, 0.6952529549598694, -1.1677031517028809, 0.13564278185367584, -0.6762940883636475, -0.7526960968971252, 1.6547234058380127, 2.138350486755371, -0.10304621607065201, -0.29518118500709534, -0.5768266320228577, -1.2187974452972412, 0.753158450126648, -0.08024919033050537, 0.26698222756385803, 0.6858541369438171, -0.7310247421264648, 1.0406248569488525, 0.8048052191734314, 0.9792479872703552, 0.2853330671787262, 0.25125443935394287, 0.43668892979621887, -0.281421422958374, -1.174363136291504, -0.32896697521209717, -1.1512802839279175, -2.4457168579101562, 0.32768818736076355, -0.25310030579566956, -1.3901065587997437, 0.11103262007236481, -1.0830810070037842, 0.8024473786354065, -0.6888136267662048, -1.0665292739868164, -1.5736958980560303, 0.20282067358493805, 0.04338008910417557, 0.8833816051483154, -1.6311596632003784, -0.2561163604259491, 1.1897066831588745, 0.893227756023407, -0.5517680644989014, 0.921951413154602, 0.18651901185512543, 1.0322805643081665, 0.803269624710083, -0.40937769412994385, 0.3835245370864868, -0.07938876003026962, -1.3543570041656494, 0.5007349252700806, 1.208141803741455, 0.24165035784244537, 1.6117380857467651, -0.5113011598587036, -0.05031760036945343, 0.3877544701099396, -0.5440784692764282, -0.2911362051963806, -0.46890515089035034, 0.5689723491668701, 0.17062555253505707, -0.9043975472450256, -0.10545910894870758, -0.06527754664421082, -0.3386080265045166, 0.08924707770347595, -1.3746665716171265, -0.07979772239923477, -0.4456019401550293, -0.5850498080253601, -1.1451961994171143, -0.12111279368400574, 1.3604631423950195, -0.8974778652191162, -0.14927977323532104, 0.4856261610984802, 0.2786639332771301, 0.5994020104408264, 0.7024035453796387, -0.7100880146026611, -0.3409590721130371, -0.2910833954811096, -0.303238183259964, 0.3027670681476593, 1.2723337411880493, -0.13932785391807556, -0.8756037950515747, 0.60691899061203, -0.36420300602912903, 0.13031521439552307, 1.8982622623443604, -0.02737969532608986, -0.6860343217849731, 0.3009139597415924, -0.7972003221511841, 1.9049944877624512, 1.6251791715621948, 1.250503420829773, -0.1257859170436859, -0.9898862838745117, 0.643151581287384, -0.4361223876476288, -0.39072126150131226, 0.7274683117866516, 0.3450058698654175, -0.2232637107372284, -1.4539482593536377, 0.7500842213630676, 1.2425410747528076, -0.9871392250061035, -0.7261852622032166, 0.21788297593593597, -0.8076938986778259, 1.0522329807281494, 0.5696714520454407, 0.2402709573507309, 0.3301248550415039, 1.676027536392212, 0.8839903473854065, -0.329928457736969, 0.4956236481666565, 0.5735917091369629, -0.20663687586784363, -2.203526020050049, -1.173896074295044, 0.2912505865097046, -0.42254671454429626, -1.589289903640747, 1.442243218421936, -1.1496397256851196, -0.9648959636688232, 0.6511660814285278, 0.11723779141902924, 1.3963836431503296, 0.36449891328811646, 1.59639310836792, 2.096285820007324, 0.9262003898620605, 0.4458015263080597, 1.244294285774231, -0.08340109884738922, -0.4461541473865509, 1.7690963745117188, -0.390906423330307, 0.47446852922439575, 0.9792773127555847, -0.30851805210113525, -1.103279948234558, -0.8371413350105286, -1.366457462310791, -0.7384980320930481, 1.1522306203842163, 0.0817585289478302, -1.0464813709259033, 0.23051141202449799, 1.577062726020813, 0.16501611471176147, -0.43383800983428955, 0.589514970779419, 0.5203112959861755, -0.7592626810073853, -0.15056844055652618, -0.8356045484542847, 0.5255478620529175, -0.1185736209154129, -0.33985406160354614, 0.25607290863990784, 0.4402123987674713, 1.441201090812683, -0.01731412298977375, 0.03300465643405914, 1.0713346004486084, -1.5143805742263794, 1.4924548864364624, -0.5963876247406006, 0.34682169556617737, -2.247520923614502, 1.4284089803695679, -0.7359286546707153, 1.9842536449432373, -2.620241165161133, 0.5249099135398865, -0.5941247344017029, -0.5098524689674377, 0.27904364466667175, -0.3464415371417999, 0.2373819202184677, -0.20711974799633026, -1.1657087802886963, -0.06664109230041504, -0.7405198812484741, 0.44406989216804504, 1.1550424098968506, 1.3931633234024048, -1.0949174165725708, -0.397943377494812, -1.61432945728302, -0.02749267965555191, -0.6833990812301636, 0.2517191171646118, -2.0113487243652344, -0.06703821569681168, -1.9614231586456299, -2.3990254402160645, -1.3229610919952393, -0.680630087852478, 1.088256597518921, 0.13461340963840485, -0.856856107711792, 1.3230746984481812, -0.34262847900390625, -1.7755447626113892, 1.178642988204956, -2.1467130184173584 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
@cahya-wirawan, I can reproduce the problem for Common Voice 7 for Turkish. Here a script you can use: ```python #!/usr/bin/env python3 from datasets import load_dataset import torchaudio from io import BytesIO from datasets import Audio from collections import Counter import sys ds_name = str(sys.argv[1]) lang = str(sys.argv[2]) ds = load_dataset(ds_name, lang, split="train", use_auth_token=True) ds = ds.cast_column("audio", Audio(decode=False)) all_sampling_rates = [] def print_sampling_rate(x): x, sr = torchaudio.load(BytesIO(x["audio"]["bytes"]), format="mp3") all_sampling_rates.append(sr) ds.map(print_sampling_rate) print(Counter(all_sampling_rates)) ``` can be run with: ```bash python run.py mozilla-foundation/common_voice_7_0 tr ``` For CV 6.1 all samples seem to have the same audio
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
973
92
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 @cahya-wirawan, I can reproduce the problem for Common Voice 7 for Turkish. Here a script you can use: ```python #!/usr/bin/env python3 from datasets import load_dataset import torchaudio from io import BytesIO from datasets import Audio from collections import Counter import sys ds_name = str(sys.argv[1]) lang = str(sys.argv[2]) ds = load_dataset(ds_name, lang, split="train", use_auth_token=True) ds = ds.cast_column("audio", Audio(decode=False)) all_sampling_rates = [] def print_sampling_rate(x): x, sr = torchaudio.load(BytesIO(x["audio"]["bytes"]), format="mp3") all_sampling_rates.append(sr) ds.map(print_sampling_rate) print(Counter(all_sampling_rates)) ``` can be run with: ```bash python run.py mozilla-foundation/common_voice_7_0 tr ``` For CV 6.1 all samples seem to have the same audio
[ -1.3920469284057617, -0.8224828243255615, -0.6726378798484802, 1.4861177206039429, -0.1254834085702896, -1.2422548532485962, 0.1428719162940979, -1.1265442371368408, 1.6405339241027832, -0.7956996560096741, 0.43074506521224976, -1.6366304159164429, 0.04461100697517395, -0.5762713551521301, -0.8422549366950989, -0.9075511693954468, -0.4147358536720276, -0.6475420594215393, 1.0152937173843384, 2.4049034118652344, 1.2402695417404175, -1.3607895374298096, 2.7938690185546875, 0.7410194873809814, -0.2787855267524719, -0.9628453254699707, 0.5201768279075623, 0.04540131986141205, -1.3535453081130981, -0.5183335542678833, -0.9586236476898193, -0.06760258972644806, -0.4997299909591675, -0.4181402623653412, -0.04528563469648361, 0.3096561133861542, -0.30089831352233887, -0.4450500011444092, -0.6222570538520813, -0.8348660469055176, 0.3144114017486572, -0.35935544967651367, 0.9171770215034485, -0.24309787154197693, 1.7946267127990723, -0.715705394744873, 0.4489205479621887, 0.6602954268455505, 1.3614834547042847, 0.2835189402103424, 0.09526573121547699, 0.4257161319255829, 0.5132258534431458, 0.008681084029376507, 0.5726178288459778, 1.1019930839538574, 0.7211399078369141, 0.4253939688205719, 0.7862055897712708, -2.2152998447418213, 1.1746106147766113, -1.0306979417800903, 0.14792868494987488, 1.4416203498840332, -0.8547709584236145, 0.35555770993232727, -1.723151683807373, -0.004540770780295134, 0.6042393445968628, -2.2994141578674316, 0.19740426540374756, -1.4235222339630127, -0.5522645115852356, 1.0229756832122803, 0.4434637427330017, -1.1869348287582397, 0.15902584791183472, -0.42026180028915405, 0.9321914315223694, 0.348739355802536, 1.0895154476165771, -1.5902942419052124, -0.11524331569671631, -0.34883546829223633, 0.03860345855355263, -1.1833800077438354, -1.523234486579895, 0.6061765551567078, 0.49819308519363403, 0.5806512236595154, -0.08896160870790482, 1.0965653657913208, -1.112172245979309, 0.9226510524749756, -1.0990744829177856, -1.7225209474563599, -1.548104166984558, -2.1894571781158447, -2.165640354156494, 0.8370531797409058, -0.5558211803436279, -0.46716606616973877, 1.9982763528823853, -1.107481598854065, -1.6234225034713745, 1.2217837572097778, 0.20553895831108093, -0.03370530530810356, 2.409010171890259, 0.15122778713703156, -0.6486408710479736, 0.4405570924282074, -0.7436134219169617, 0.7609421014785767, -0.3330332636833191, 1.1901553869247437, 0.3389277756214142, -1.0300371646881104, 1.5311554670333862, -0.3350277245044708, 0.520095944404602, -0.6320230960845947, -0.531862199306488, -0.7486974596977234, 0.38592594861984253, 1.8247523307800293, -0.2515883147716522, 1.6866002082824707, -0.38702425360679626, -1.5722333192825317, -1.5990341901779175, 0.8052170872688293, 0.5449525713920593, -0.9112103581428528, 0.062205515801906586, -0.390290766954422, 0.1480615884065628, -0.05877213180065155, 1.2151803970336914, 1.3797603845596313, 0.6810975670814514, -0.4046233296394348, -0.7475613951683044, 0.16772031784057617, 0.013625581748783588, -0.8686111569404602, -1.6720114946365356, -0.41134113073349, 0.0842803418636322, 0.6372669339179993, -1.3112009763717651, 1.6905324459075928, 0.9279705286026001, 1.7938522100448608, 1.1228716373443604, -0.4716665744781494, 1.5226011276245117, 0.18580925464630127, 1.7846213579177856, -0.5675927400588989, 0.6938465237617493, -0.4108181297779083, -1.1399037837982178, 0.7621167302131653, -0.3245983421802521, -2.1027040481567383, -0.8128036856651306, -0.5815792083740234, -0.2018086463212967, -0.7883877754211426, 0.9674639701843262, -0.35737892985343933, -1.3852767944335938, 0.16565686464309692, -0.7763639688491821, 0.16895438730716705, -1.2172025442123413, 0.24921609461307526, 0.7211940884590149, -0.5979413390159607, 0.11193583905696869, -0.10696328431367874, -1.2824152708053589, -0.2651790976524353, 0.2230699062347412, 1.8945356607437134, -0.8061832189559937, 0.9181395769119263, 1.0000890493392944, -0.6546730399131775, 0.020618561655282974, 0.21696628630161285, -0.2058989703655243, 0.9435762166976929, -0.9922937154769897, -0.4962866008281708, 1.2366794347763062, -0.24417656660079956, -0.46233561635017395, 1.4168462753295898, 0.6873024106025696, -0.9566481709480286, -0.2833556830883026, -0.14088082313537598, -0.8958540558815002, -0.027889568358659744, -1.5328792333602905, -0.2411201298236847, 0.46479952335357666, -1.5153896808624268, -0.4168466627597809, -0.17386658489704132, 1.2079681158065796, -0.24770714342594147, 1.446370244026184, -0.4223322868347168, -0.23435530066490173, -0.2875558137893677, -0.37007856369018555, 0.16294293105602264, -0.2457914501428604, -0.6608290076255798, 0.18752817809581757, -0.7011070847511292, 0.39205554127693176, 1.379658818244934, 0.34218651056289673, 0.0799277201294899, 0.3510233163833618, 1.0162569284439087, 0.3940310478210449, -0.08556755632162094, -0.8792168498039246, -1.5839576721191406, 2.067413091659546, -1.488531231880188, 2.092167377471924, 0.7543487548828125, -0.046721577644348145, -1.7018076181411743, -1.8348348140716553, 1.239909052848816, 1.0602130889892578, 2.349695920944214, 0.4159335792064667, 0.4107920229434967, -0.7899381518363953, -0.6721205115318298, 0.2831594944000244, -1.02386474609375, -0.677273154258728, 0.09267468750476837, 2.4224369525909424, 1.6748570203781128, -0.40522435307502747, -0.17104415595531464, -0.9724377989768982, 1.3146936893463135, -0.16725623607635498, 0.23245766758918762, 1.9846314191818237, -0.2581525444984436, -1.0970426797866821, 1.3305011987686157, -2.3279800415039062, 0.14850567281246185, 2.002718448638916, 0.2786496579647064, 0.0070619843900203705, -1.3204025030136108, -0.6603819727897644, -0.42005109786987305, -0.46575817465782166, -1.2810403108596802, 0.4970822334289551, -0.26154443621635437, -0.8162463307380676, -1.3151627779006958, -0.02066977322101593, -1.0874017477035522, -1.6056870222091675, 0.2341158390045166, 2.03122615814209, 1.9043641090393066, -0.7598724365234375, 1.5093237161636353, -0.2623845636844635, -0.007938618771731853, 1.1810575723648071, 1.318279504776001, 3.1262121200561523, 1.841643214225769, -1.322070598602295, 0.5258016586303711, -0.2832053303718567, -0.4558199346065521, 1.1356265544891357, -1.2468281984329224, 1.365499496459961, -0.02443239465355873, -1.2458679676055908, -1.167910099029541, 0.9618567228317261, 0.4625069797039032, -0.017913082614541054, -0.6077032685279846, 1.1290092468261719, 0.015084815211594105, 1.316731572151184, 0.5680792331695557, -0.2983647584915161, 0.5311970710754395, -0.34779512882232666, -0.5509042143821716, 1.5192478895187378, 0.09363871812820435, -1.4518651962280273, -2.3502893447875977, -0.16761352121829987, -0.8349912762641907, 0.0518140010535717, -0.5372459888458252, -1.0648356676101685, 1.7370178699493408, 0.37020114064216614, -1.3310993909835815, -0.327993780374527, -0.41255125403404236, -0.5143149495124817, 2.913055658340454, -1.312877893447876, -0.176626056432724, -0.99048912525177, -0.5983820557594299, 1.7136189937591553, -1.1692618131637573, -0.2396831214427948, -0.9555060863494873, -0.5842412114143372, -1.3011231422424316, -0.4122913181781769, 0.08108783513307571, -1.059385895729065, 0.859379231929779, 0.26647549867630005, -1.151076078414917, -0.3982175290584564, -0.8824379444122314, 0.8619803786277771, -0.13231243193149567, 0.2167872190475464, 2.0653815269470215, 0.40557050704956055, -0.2708710730075836, 0.833142876625061, 1.272879719734192, 0.6928480863571167, -0.6976916790008545, 0.11457742005586624, -0.6570323705673218, 0.3297605514526367, -1.357674241065979, 0.29297274351119995, -2.8084752559661865, 0.6675459146499634, -0.07607075572013855, -0.16282953321933746, 0.05930706113576889, -1.1975395679473877, 1.132210612297058, 2.568801164627075, -1.1180826425552368, 0.4807402789592743, 0.2979324758052826, 1.131064772605896, -1.6755964756011963, 0.2973039746284485, -0.4311525821685791, 2.123277425765991, 0.3973225951194763, 1.2450224161148071, -0.494792103767395, -2.2888002395629883, 0.6372920274734497, -1.255068063735962, -1.1899515390396118, 0.8027642369270325, -0.8609787821769714, 0.24276147782802582, -1.4677462577819824, -0.2761248052120209, -0.8285009264945984, -1.1428923606872559, 0.5768202543258667, 0.16232796013355255, 0.4078158736228943, -0.5518743991851807, 0.27620941400527954, -2.3932907581329346, -1.3896238803863525, -0.1086963638663292, -1.020229697227478, 0.5055070519447327, -0.45378559827804565, 0.6908156275749207, -0.08805693686008453, -0.029698528349399567, 0.38194793462753296, 1.6569015979766846, 3.3990206718444824, 0.3432939946651459, 0.3302674889564514, -0.29005110263824463, -0.9391810297966003, 1.4048519134521484, 0.8746007084846497, -0.0359812006354332, -0.596266508102417, -1.1389296054840088, 1.226996660232544, 1.8934788703918457, 0.963687539100647, -0.00602163840085268, -0.8038417100906372, -0.7750322818756104, -0.08996232599020004, 0.23699498176574707, 0.5650245547294617, 0.989140510559082, 0.08590146154165268, 0.08611630648374557, 1.5393438339233398, 1.1917697191238403, -0.4317839741706848, 0.3180740177631378, -0.8366612792015076, -0.5214040279388428, 0.4024369716644287, 0.28265106678009033, -0.017438245937228203, 0.4763607978820801, -0.947776734828949, -0.17379418015480042, -0.5325052738189697, -0.8206740617752075, -0.7116966843605042, -0.3325418531894684, -0.3454505503177643, 1.6021182537078857, 0.12308187782764435, -0.4595828950405121, -0.043335091322660446, -0.7241536974906921, -0.24414579570293427, -1.0371596813201904, 0.320769727230072, -0.020835060626268387, -0.09342598915100098, -0.05751573294401169, 1.7108601331710815, -0.8590230941772461, -2.0362067222595215, 0.16935794055461884, 0.15349198877811432, -0.29242733120918274, 0.19608260691165924, 1.568585753440857, 0.575594425201416, 1.4240813255310059, 1.3199974298477173, 0.862415075302124, -0.5615981221199036, -1.3656363487243652, 0.6689519882202148, 0.9596808552742004, -1.2949415445327759, 0.8922305703163147, -0.20456720888614655, -0.5199177265167236, 0.5933687090873718, 1.3397431373596191, 0.45095953345298767, -2.015702486038208, 0.9037430286407471, -0.9100394248962402, 0.8623488545417786, 0.6876624226570129, 0.6814846396446228, 0.25988128781318665, 0.8371727466583252, -1.2219512462615967, -1.2340326309204102, -0.6999858617782593, -0.7196918725967407, 1.9776438474655151, -0.35381463170051575, 0.6544365286827087, -0.2606809437274933, -1.1815134286880493, -0.001973289530724287, 0.603135347366333, 0.36063048243522644, -0.49845635890960693, 0.8523103594779968, -0.5993491411209106, -1.0963143110275269, -1.3776642084121704, -0.45111870765686035, -1.041988730430603, -0.905070424079895, 0.9476454854011536, 0.8207343220710754, 0.30735278129577637, 1.7742317914962769, 0.6292149424552917, 0.3353559076786041, -2.689619541168213, 0.9537433385848999, 0.1592453569173813, -0.116688571870327, 0.8938232064247131, 0.34136489033699036, 1.0127743482589722, 0.06903407722711563, 0.473847895860672, -2.558945655822754, 2.360347032546997, -0.41137728095054626, 0.7631104588508606, -0.04763241857290268, -0.042436383664608, 1.1696480512619019, 0.7050463557243347, 0.5539021492004395, -1.0408413410186768, 0.6431414484977722, -0.4085714817047119, 1.2340995073318481, 0.9329420328140259, -0.7817742228507996, -0.05735209956765175, 1.5007669925689697, 0.4788152873516083, -0.6308817267417908, -0.8709248900413513, -0.9270895719528198, 0.9065390229225159, 1.750038504600525, 0.017110757529735565, -0.03376206383109093, 0.9207185506820679, 0.6952529549598694, -1.1677031517028809, 0.13564278185367584, -0.6762940883636475, -0.7526960968971252, 1.6547234058380127, 2.138350486755371, -0.10304621607065201, -0.29518118500709534, -0.5768266320228577, -1.2187974452972412, 0.753158450126648, -0.08024919033050537, 0.26698222756385803, 0.6858541369438171, -0.7310247421264648, 1.0406248569488525, 0.8048052191734314, 0.9792479872703552, 0.2853330671787262, 0.25125443935394287, 0.43668892979621887, -0.281421422958374, -1.174363136291504, -0.32896697521209717, -1.1512802839279175, -2.4457168579101562, 0.32768818736076355, -0.25310030579566956, -1.3901065587997437, 0.11103262007236481, -1.0830810070037842, 0.8024473786354065, -0.6888136267662048, -1.0665292739868164, -1.5736958980560303, 0.20282067358493805, 0.04338008910417557, 0.8833816051483154, -1.6311596632003784, -0.2561163604259491, 1.1897066831588745, 0.893227756023407, -0.5517680644989014, 0.921951413154602, 0.18651901185512543, 1.0322805643081665, 0.803269624710083, -0.40937769412994385, 0.3835245370864868, -0.07938876003026962, -1.3543570041656494, 0.5007349252700806, 1.208141803741455, 0.24165035784244537, 1.6117380857467651, -0.5113011598587036, -0.05031760036945343, 0.3877544701099396, -0.5440784692764282, -0.2911362051963806, -0.46890515089035034, 0.5689723491668701, 0.17062555253505707, -0.9043975472450256, -0.10545910894870758, -0.06527754664421082, -0.3386080265045166, 0.08924707770347595, -1.3746665716171265, -0.07979772239923477, -0.4456019401550293, -0.5850498080253601, -1.1451961994171143, -0.12111279368400574, 1.3604631423950195, -0.8974778652191162, -0.14927977323532104, 0.4856261610984802, 0.2786639332771301, 0.5994020104408264, 0.7024035453796387, -0.7100880146026611, -0.3409590721130371, -0.2910833954811096, -0.303238183259964, 0.3027670681476593, 1.2723337411880493, -0.13932785391807556, -0.8756037950515747, 0.60691899061203, -0.36420300602912903, 0.13031521439552307, 1.8982622623443604, -0.02737969532608986, -0.6860343217849731, 0.3009139597415924, -0.7972003221511841, 1.9049944877624512, 1.6251791715621948, 1.250503420829773, -0.1257859170436859, -0.9898862838745117, 0.643151581287384, -0.4361223876476288, -0.39072126150131226, 0.7274683117866516, 0.3450058698654175, -0.2232637107372284, -1.4539482593536377, 0.7500842213630676, 1.2425410747528076, -0.9871392250061035, -0.7261852622032166, 0.21788297593593597, -0.8076938986778259, 1.0522329807281494, 0.5696714520454407, 0.2402709573507309, 0.3301248550415039, 1.676027536392212, 0.8839903473854065, -0.329928457736969, 0.4956236481666565, 0.5735917091369629, -0.20663687586784363, -2.203526020050049, -1.173896074295044, 0.2912505865097046, -0.42254671454429626, -1.589289903640747, 1.442243218421936, -1.1496397256851196, -0.9648959636688232, 0.6511660814285278, 0.11723779141902924, 1.3963836431503296, 0.36449891328811646, 1.59639310836792, 2.096285820007324, 0.9262003898620605, 0.4458015263080597, 1.244294285774231, -0.08340109884738922, -0.4461541473865509, 1.7690963745117188, -0.390906423330307, 0.47446852922439575, 0.9792773127555847, -0.30851805210113525, -1.103279948234558, -0.8371413350105286, -1.366457462310791, -0.7384980320930481, 1.1522306203842163, 0.0817585289478302, -1.0464813709259033, 0.23051141202449799, 1.577062726020813, 0.16501611471176147, -0.43383800983428955, 0.589514970779419, 0.5203112959861755, -0.7592626810073853, -0.15056844055652618, -0.8356045484542847, 0.5255478620529175, -0.1185736209154129, -0.33985406160354614, 0.25607290863990784, 0.4402123987674713, 1.441201090812683, -0.01731412298977375, 0.03300465643405914, 1.0713346004486084, -1.5143805742263794, 1.4924548864364624, -0.5963876247406006, 0.34682169556617737, -2.247520923614502, 1.4284089803695679, -0.7359286546707153, 1.9842536449432373, -2.620241165161133, 0.5249099135398865, -0.5941247344017029, -0.5098524689674377, 0.27904364466667175, -0.3464415371417999, 0.2373819202184677, -0.20711974799633026, -1.1657087802886963, -0.06664109230041504, -0.7405198812484741, 0.44406989216804504, 1.1550424098968506, 1.3931633234024048, -1.0949174165725708, -0.397943377494812, -1.61432945728302, -0.02749267965555191, -0.6833990812301636, 0.2517191171646118, -2.0113487243652344, -0.06703821569681168, -1.9614231586456299, -2.3990254402160645, -1.3229610919952393, -0.680630087852478, 1.088256597518921, 0.13461340963840485, -0.856856107711792, 1.3230746984481812, -0.34262847900390625, -1.7755447626113892, 1.178642988204956, -2.1467130184173584 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
It actually shows that many more samples are in 32kHz format than it 48kHz which is unexpected. Thanks a lot for flagging! Will contact Common Voice about this as well
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
973
30
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 It actually shows that many more samples are in 32kHz format than it 48kHz which is unexpected. Thanks a lot for flagging! Will contact Common Voice about this as well
[ -1.3920469284057617, -0.8224828243255615, -0.6726378798484802, 1.4861177206039429, -0.1254834085702896, -1.2422548532485962, 0.1428719162940979, -1.1265442371368408, 1.6405339241027832, -0.7956996560096741, 0.43074506521224976, -1.6366304159164429, 0.04461100697517395, -0.5762713551521301, -0.8422549366950989, -0.9075511693954468, -0.4147358536720276, -0.6475420594215393, 1.0152937173843384, 2.4049034118652344, 1.2402695417404175, -1.3607895374298096, 2.7938690185546875, 0.7410194873809814, -0.2787855267524719, -0.9628453254699707, 0.5201768279075623, 0.04540131986141205, -1.3535453081130981, -0.5183335542678833, -0.9586236476898193, -0.06760258972644806, -0.4997299909591675, -0.4181402623653412, -0.04528563469648361, 0.3096561133861542, -0.30089831352233887, -0.4450500011444092, -0.6222570538520813, -0.8348660469055176, 0.3144114017486572, -0.35935544967651367, 0.9171770215034485, -0.24309787154197693, 1.7946267127990723, -0.715705394744873, 0.4489205479621887, 0.6602954268455505, 1.3614834547042847, 0.2835189402103424, 0.09526573121547699, 0.4257161319255829, 0.5132258534431458, 0.008681084029376507, 0.5726178288459778, 1.1019930839538574, 0.7211399078369141, 0.4253939688205719, 0.7862055897712708, -2.2152998447418213, 1.1746106147766113, -1.0306979417800903, 0.14792868494987488, 1.4416203498840332, -0.8547709584236145, 0.35555770993232727, -1.723151683807373, -0.004540770780295134, 0.6042393445968628, -2.2994141578674316, 0.19740426540374756, -1.4235222339630127, -0.5522645115852356, 1.0229756832122803, 0.4434637427330017, -1.1869348287582397, 0.15902584791183472, -0.42026180028915405, 0.9321914315223694, 0.348739355802536, 1.0895154476165771, -1.5902942419052124, -0.11524331569671631, -0.34883546829223633, 0.03860345855355263, -1.1833800077438354, -1.523234486579895, 0.6061765551567078, 0.49819308519363403, 0.5806512236595154, -0.08896160870790482, 1.0965653657913208, -1.112172245979309, 0.9226510524749756, -1.0990744829177856, -1.7225209474563599, -1.548104166984558, -2.1894571781158447, -2.165640354156494, 0.8370531797409058, -0.5558211803436279, -0.46716606616973877, 1.9982763528823853, -1.107481598854065, -1.6234225034713745, 1.2217837572097778, 0.20553895831108093, -0.03370530530810356, 2.409010171890259, 0.15122778713703156, -0.6486408710479736, 0.4405570924282074, -0.7436134219169617, 0.7609421014785767, -0.3330332636833191, 1.1901553869247437, 0.3389277756214142, -1.0300371646881104, 1.5311554670333862, -0.3350277245044708, 0.520095944404602, -0.6320230960845947, -0.531862199306488, -0.7486974596977234, 0.38592594861984253, 1.8247523307800293, -0.2515883147716522, 1.6866002082824707, -0.38702425360679626, -1.5722333192825317, -1.5990341901779175, 0.8052170872688293, 0.5449525713920593, -0.9112103581428528, 0.062205515801906586, -0.390290766954422, 0.1480615884065628, -0.05877213180065155, 1.2151803970336914, 1.3797603845596313, 0.6810975670814514, -0.4046233296394348, -0.7475613951683044, 0.16772031784057617, 0.013625581748783588, -0.8686111569404602, -1.6720114946365356, -0.41134113073349, 0.0842803418636322, 0.6372669339179993, -1.3112009763717651, 1.6905324459075928, 0.9279705286026001, 1.7938522100448608, 1.1228716373443604, -0.4716665744781494, 1.5226011276245117, 0.18580925464630127, 1.7846213579177856, -0.5675927400588989, 0.6938465237617493, -0.4108181297779083, -1.1399037837982178, 0.7621167302131653, -0.3245983421802521, -2.1027040481567383, -0.8128036856651306, -0.5815792083740234, -0.2018086463212967, -0.7883877754211426, 0.9674639701843262, -0.35737892985343933, -1.3852767944335938, 0.16565686464309692, -0.7763639688491821, 0.16895438730716705, -1.2172025442123413, 0.24921609461307526, 0.7211940884590149, -0.5979413390159607, 0.11193583905696869, -0.10696328431367874, -1.2824152708053589, -0.2651790976524353, 0.2230699062347412, 1.8945356607437134, -0.8061832189559937, 0.9181395769119263, 1.0000890493392944, -0.6546730399131775, 0.020618561655282974, 0.21696628630161285, -0.2058989703655243, 0.9435762166976929, -0.9922937154769897, -0.4962866008281708, 1.2366794347763062, -0.24417656660079956, -0.46233561635017395, 1.4168462753295898, 0.6873024106025696, -0.9566481709480286, -0.2833556830883026, -0.14088082313537598, -0.8958540558815002, -0.027889568358659744, -1.5328792333602905, -0.2411201298236847, 0.46479952335357666, -1.5153896808624268, -0.4168466627597809, -0.17386658489704132, 1.2079681158065796, -0.24770714342594147, 1.446370244026184, -0.4223322868347168, -0.23435530066490173, -0.2875558137893677, -0.37007856369018555, 0.16294293105602264, -0.2457914501428604, -0.6608290076255798, 0.18752817809581757, -0.7011070847511292, 0.39205554127693176, 1.379658818244934, 0.34218651056289673, 0.0799277201294899, 0.3510233163833618, 1.0162569284439087, 0.3940310478210449, -0.08556755632162094, -0.8792168498039246, -1.5839576721191406, 2.067413091659546, -1.488531231880188, 2.092167377471924, 0.7543487548828125, -0.046721577644348145, -1.7018076181411743, -1.8348348140716553, 1.239909052848816, 1.0602130889892578, 2.349695920944214, 0.4159335792064667, 0.4107920229434967, -0.7899381518363953, -0.6721205115318298, 0.2831594944000244, -1.02386474609375, -0.677273154258728, 0.09267468750476837, 2.4224369525909424, 1.6748570203781128, -0.40522435307502747, -0.17104415595531464, -0.9724377989768982, 1.3146936893463135, -0.16725623607635498, 0.23245766758918762, 1.9846314191818237, -0.2581525444984436, -1.0970426797866821, 1.3305011987686157, -2.3279800415039062, 0.14850567281246185, 2.002718448638916, 0.2786496579647064, 0.0070619843900203705, -1.3204025030136108, -0.6603819727897644, -0.42005109786987305, -0.46575817465782166, -1.2810403108596802, 0.4970822334289551, -0.26154443621635437, -0.8162463307380676, -1.3151627779006958, -0.02066977322101593, -1.0874017477035522, -1.6056870222091675, 0.2341158390045166, 2.03122615814209, 1.9043641090393066, -0.7598724365234375, 1.5093237161636353, -0.2623845636844635, -0.007938618771731853, 1.1810575723648071, 1.318279504776001, 3.1262121200561523, 1.841643214225769, -1.322070598602295, 0.5258016586303711, -0.2832053303718567, -0.4558199346065521, 1.1356265544891357, -1.2468281984329224, 1.365499496459961, -0.02443239465355873, -1.2458679676055908, -1.167910099029541, 0.9618567228317261, 0.4625069797039032, -0.017913082614541054, -0.6077032685279846, 1.1290092468261719, 0.015084815211594105, 1.316731572151184, 0.5680792331695557, -0.2983647584915161, 0.5311970710754395, -0.34779512882232666, -0.5509042143821716, 1.5192478895187378, 0.09363871812820435, -1.4518651962280273, -2.3502893447875977, -0.16761352121829987, -0.8349912762641907, 0.0518140010535717, -0.5372459888458252, -1.0648356676101685, 1.7370178699493408, 0.37020114064216614, -1.3310993909835815, -0.327993780374527, -0.41255125403404236, -0.5143149495124817, 2.913055658340454, -1.312877893447876, -0.176626056432724, -0.99048912525177, -0.5983820557594299, 1.7136189937591553, -1.1692618131637573, -0.2396831214427948, -0.9555060863494873, -0.5842412114143372, -1.3011231422424316, -0.4122913181781769, 0.08108783513307571, -1.059385895729065, 0.859379231929779, 0.26647549867630005, -1.151076078414917, -0.3982175290584564, -0.8824379444122314, 0.8619803786277771, -0.13231243193149567, 0.2167872190475464, 2.0653815269470215, 0.40557050704956055, -0.2708710730075836, 0.833142876625061, 1.272879719734192, 0.6928480863571167, -0.6976916790008545, 0.11457742005586624, -0.6570323705673218, 0.3297605514526367, -1.357674241065979, 0.29297274351119995, -2.8084752559661865, 0.6675459146499634, -0.07607075572013855, -0.16282953321933746, 0.05930706113576889, -1.1975395679473877, 1.132210612297058, 2.568801164627075, -1.1180826425552368, 0.4807402789592743, 0.2979324758052826, 1.131064772605896, -1.6755964756011963, 0.2973039746284485, -0.4311525821685791, 2.123277425765991, 0.3973225951194763, 1.2450224161148071, -0.494792103767395, -2.2888002395629883, 0.6372920274734497, -1.255068063735962, -1.1899515390396118, 0.8027642369270325, -0.8609787821769714, 0.24276147782802582, -1.4677462577819824, -0.2761248052120209, -0.8285009264945984, -1.1428923606872559, 0.5768202543258667, 0.16232796013355255, 0.4078158736228943, -0.5518743991851807, 0.27620941400527954, -2.3932907581329346, -1.3896238803863525, -0.1086963638663292, -1.020229697227478, 0.5055070519447327, -0.45378559827804565, 0.6908156275749207, -0.08805693686008453, -0.029698528349399567, 0.38194793462753296, 1.6569015979766846, 3.3990206718444824, 0.3432939946651459, 0.3302674889564514, -0.29005110263824463, -0.9391810297966003, 1.4048519134521484, 0.8746007084846497, -0.0359812006354332, -0.596266508102417, -1.1389296054840088, 1.226996660232544, 1.8934788703918457, 0.963687539100647, -0.00602163840085268, -0.8038417100906372, -0.7750322818756104, -0.08996232599020004, 0.23699498176574707, 0.5650245547294617, 0.989140510559082, 0.08590146154165268, 0.08611630648374557, 1.5393438339233398, 1.1917697191238403, -0.4317839741706848, 0.3180740177631378, -0.8366612792015076, -0.5214040279388428, 0.4024369716644287, 0.28265106678009033, -0.017438245937228203, 0.4763607978820801, -0.947776734828949, -0.17379418015480042, -0.5325052738189697, -0.8206740617752075, -0.7116966843605042, -0.3325418531894684, -0.3454505503177643, 1.6021182537078857, 0.12308187782764435, -0.4595828950405121, -0.043335091322660446, -0.7241536974906921, -0.24414579570293427, -1.0371596813201904, 0.320769727230072, -0.020835060626268387, -0.09342598915100098, -0.05751573294401169, 1.7108601331710815, -0.8590230941772461, -2.0362067222595215, 0.16935794055461884, 0.15349198877811432, -0.29242733120918274, 0.19608260691165924, 1.568585753440857, 0.575594425201416, 1.4240813255310059, 1.3199974298477173, 0.862415075302124, -0.5615981221199036, -1.3656363487243652, 0.6689519882202148, 0.9596808552742004, -1.2949415445327759, 0.8922305703163147, -0.20456720888614655, -0.5199177265167236, 0.5933687090873718, 1.3397431373596191, 0.45095953345298767, -2.015702486038208, 0.9037430286407471, -0.9100394248962402, 0.8623488545417786, 0.6876624226570129, 0.6814846396446228, 0.25988128781318665, 0.8371727466583252, -1.2219512462615967, -1.2340326309204102, -0.6999858617782593, -0.7196918725967407, 1.9776438474655151, -0.35381463170051575, 0.6544365286827087, -0.2606809437274933, -1.1815134286880493, -0.001973289530724287, 0.603135347366333, 0.36063048243522644, -0.49845635890960693, 0.8523103594779968, -0.5993491411209106, -1.0963143110275269, -1.3776642084121704, -0.45111870765686035, -1.041988730430603, -0.905070424079895, 0.9476454854011536, 0.8207343220710754, 0.30735278129577637, 1.7742317914962769, 0.6292149424552917, 0.3353559076786041, -2.689619541168213, 0.9537433385848999, 0.1592453569173813, -0.116688571870327, 0.8938232064247131, 0.34136489033699036, 1.0127743482589722, 0.06903407722711563, 0.473847895860672, -2.558945655822754, 2.360347032546997, -0.41137728095054626, 0.7631104588508606, -0.04763241857290268, -0.042436383664608, 1.1696480512619019, 0.7050463557243347, 0.5539021492004395, -1.0408413410186768, 0.6431414484977722, -0.4085714817047119, 1.2340995073318481, 0.9329420328140259, -0.7817742228507996, -0.05735209956765175, 1.5007669925689697, 0.4788152873516083, -0.6308817267417908, -0.8709248900413513, -0.9270895719528198, 0.9065390229225159, 1.750038504600525, 0.017110757529735565, -0.03376206383109093, 0.9207185506820679, 0.6952529549598694, -1.1677031517028809, 0.13564278185367584, -0.6762940883636475, -0.7526960968971252, 1.6547234058380127, 2.138350486755371, -0.10304621607065201, -0.29518118500709534, -0.5768266320228577, -1.2187974452972412, 0.753158450126648, -0.08024919033050537, 0.26698222756385803, 0.6858541369438171, -0.7310247421264648, 1.0406248569488525, 0.8048052191734314, 0.9792479872703552, 0.2853330671787262, 0.25125443935394287, 0.43668892979621887, -0.281421422958374, -1.174363136291504, -0.32896697521209717, -1.1512802839279175, -2.4457168579101562, 0.32768818736076355, -0.25310030579566956, -1.3901065587997437, 0.11103262007236481, -1.0830810070037842, 0.8024473786354065, -0.6888136267662048, -1.0665292739868164, -1.5736958980560303, 0.20282067358493805, 0.04338008910417557, 0.8833816051483154, -1.6311596632003784, -0.2561163604259491, 1.1897066831588745, 0.893227756023407, -0.5517680644989014, 0.921951413154602, 0.18651901185512543, 1.0322805643081665, 0.803269624710083, -0.40937769412994385, 0.3835245370864868, -0.07938876003026962, -1.3543570041656494, 0.5007349252700806, 1.208141803741455, 0.24165035784244537, 1.6117380857467651, -0.5113011598587036, -0.05031760036945343, 0.3877544701099396, -0.5440784692764282, -0.2911362051963806, -0.46890515089035034, 0.5689723491668701, 0.17062555253505707, -0.9043975472450256, -0.10545910894870758, -0.06527754664421082, -0.3386080265045166, 0.08924707770347595, -1.3746665716171265, -0.07979772239923477, -0.4456019401550293, -0.5850498080253601, -1.1451961994171143, -0.12111279368400574, 1.3604631423950195, -0.8974778652191162, -0.14927977323532104, 0.4856261610984802, 0.2786639332771301, 0.5994020104408264, 0.7024035453796387, -0.7100880146026611, -0.3409590721130371, -0.2910833954811096, -0.303238183259964, 0.3027670681476593, 1.2723337411880493, -0.13932785391807556, -0.8756037950515747, 0.60691899061203, -0.36420300602912903, 0.13031521439552307, 1.8982622623443604, -0.02737969532608986, -0.6860343217849731, 0.3009139597415924, -0.7972003221511841, 1.9049944877624512, 1.6251791715621948, 1.250503420829773, -0.1257859170436859, -0.9898862838745117, 0.643151581287384, -0.4361223876476288, -0.39072126150131226, 0.7274683117866516, 0.3450058698654175, -0.2232637107372284, -1.4539482593536377, 0.7500842213630676, 1.2425410747528076, -0.9871392250061035, -0.7261852622032166, 0.21788297593593597, -0.8076938986778259, 1.0522329807281494, 0.5696714520454407, 0.2402709573507309, 0.3301248550415039, 1.676027536392212, 0.8839903473854065, -0.329928457736969, 0.4956236481666565, 0.5735917091369629, -0.20663687586784363, -2.203526020050049, -1.173896074295044, 0.2912505865097046, -0.42254671454429626, -1.589289903640747, 1.442243218421936, -1.1496397256851196, -0.9648959636688232, 0.6511660814285278, 0.11723779141902924, 1.3963836431503296, 0.36449891328811646, 1.59639310836792, 2.096285820007324, 0.9262003898620605, 0.4458015263080597, 1.244294285774231, -0.08340109884738922, -0.4461541473865509, 1.7690963745117188, -0.390906423330307, 0.47446852922439575, 0.9792773127555847, -0.30851805210113525, -1.103279948234558, -0.8371413350105286, -1.366457462310791, -0.7384980320930481, 1.1522306203842163, 0.0817585289478302, -1.0464813709259033, 0.23051141202449799, 1.577062726020813, 0.16501611471176147, -0.43383800983428955, 0.589514970779419, 0.5203112959861755, -0.7592626810073853, -0.15056844055652618, -0.8356045484542847, 0.5255478620529175, -0.1185736209154129, -0.33985406160354614, 0.25607290863990784, 0.4402123987674713, 1.441201090812683, -0.01731412298977375, 0.03300465643405914, 1.0713346004486084, -1.5143805742263794, 1.4924548864364624, -0.5963876247406006, 0.34682169556617737, -2.247520923614502, 1.4284089803695679, -0.7359286546707153, 1.9842536449432373, -2.620241165161133, 0.5249099135398865, -0.5941247344017029, -0.5098524689674377, 0.27904364466667175, -0.3464415371417999, 0.2373819202184677, -0.20711974799633026, -1.1657087802886963, -0.06664109230041504, -0.7405198812484741, 0.44406989216804504, 1.1550424098968506, 1.3931633234024048, -1.0949174165725708, -0.397943377494812, -1.61432945728302, -0.02749267965555191, -0.6833990812301636, 0.2517191171646118, -2.0113487243652344, -0.06703821569681168, -1.9614231586456299, -2.3990254402160645, -1.3229610919952393, -0.680630087852478, 1.088256597518921, 0.13461340963840485, -0.856856107711792, 1.3230746984481812, -0.34262847900390625, -1.7755447626113892, 1.178642988204956, -2.1467130184173584 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
I only checked the CV 7.0 for Turkish, Luganda and Indonesian, they have audio files with difference sampling rates, and all of them are affected by this issue. Percentage of incorrect resampling as follow, Turkish: 9.1%, Luganda: 88.2% and Indonesian: 64.1%. I checked it using the original CV files. I check the original sampling rates and the length of audio array of each files and compare it with the length of audio array (and the sampling rate which is always 48kHz) from mozilla-foundation/common_voice_7_0 datasets. if the length of audio array from dataset is not equal to 48kHz/original sampling rate * length of audio array of the original audio file then it is affected,
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
973
113
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 I only checked the CV 7.0 for Turkish, Luganda and Indonesian, they have audio files with difference sampling rates, and all of them are affected by this issue. Percentage of incorrect resampling as follow, Turkish: 9.1%, Luganda: 88.2% and Indonesian: 64.1%. I checked it using the original CV files. I check the original sampling rates and the length of audio array of each files and compare it with the length of audio array (and the sampling rate which is always 48kHz) from mozilla-foundation/common_voice_7_0 datasets. if the length of audio array from dataset is not equal to 48kHz/original sampling rate * length of audio array of the original audio file then it is affected,
[ -1.3920469284057617, -0.8224828243255615, -0.6726378798484802, 1.4861177206039429, -0.1254834085702896, -1.2422548532485962, 0.1428719162940979, -1.1265442371368408, 1.6405339241027832, -0.7956996560096741, 0.43074506521224976, -1.6366304159164429, 0.04461100697517395, -0.5762713551521301, -0.8422549366950989, -0.9075511693954468, -0.4147358536720276, -0.6475420594215393, 1.0152937173843384, 2.4049034118652344, 1.2402695417404175, -1.3607895374298096, 2.7938690185546875, 0.7410194873809814, -0.2787855267524719, -0.9628453254699707, 0.5201768279075623, 0.04540131986141205, -1.3535453081130981, -0.5183335542678833, -0.9586236476898193, -0.06760258972644806, -0.4997299909591675, -0.4181402623653412, -0.04528563469648361, 0.3096561133861542, -0.30089831352233887, -0.4450500011444092, -0.6222570538520813, -0.8348660469055176, 0.3144114017486572, -0.35935544967651367, 0.9171770215034485, -0.24309787154197693, 1.7946267127990723, -0.715705394744873, 0.4489205479621887, 0.6602954268455505, 1.3614834547042847, 0.2835189402103424, 0.09526573121547699, 0.4257161319255829, 0.5132258534431458, 0.008681084029376507, 0.5726178288459778, 1.1019930839538574, 0.7211399078369141, 0.4253939688205719, 0.7862055897712708, -2.2152998447418213, 1.1746106147766113, -1.0306979417800903, 0.14792868494987488, 1.4416203498840332, -0.8547709584236145, 0.35555770993232727, -1.723151683807373, -0.004540770780295134, 0.6042393445968628, -2.2994141578674316, 0.19740426540374756, -1.4235222339630127, -0.5522645115852356, 1.0229756832122803, 0.4434637427330017, -1.1869348287582397, 0.15902584791183472, -0.42026180028915405, 0.9321914315223694, 0.348739355802536, 1.0895154476165771, -1.5902942419052124, -0.11524331569671631, -0.34883546829223633, 0.03860345855355263, -1.1833800077438354, -1.523234486579895, 0.6061765551567078, 0.49819308519363403, 0.5806512236595154, -0.08896160870790482, 1.0965653657913208, -1.112172245979309, 0.9226510524749756, -1.0990744829177856, -1.7225209474563599, -1.548104166984558, -2.1894571781158447, -2.165640354156494, 0.8370531797409058, -0.5558211803436279, -0.46716606616973877, 1.9982763528823853, -1.107481598854065, -1.6234225034713745, 1.2217837572097778, 0.20553895831108093, -0.03370530530810356, 2.409010171890259, 0.15122778713703156, -0.6486408710479736, 0.4405570924282074, -0.7436134219169617, 0.7609421014785767, -0.3330332636833191, 1.1901553869247437, 0.3389277756214142, -1.0300371646881104, 1.5311554670333862, -0.3350277245044708, 0.520095944404602, -0.6320230960845947, -0.531862199306488, -0.7486974596977234, 0.38592594861984253, 1.8247523307800293, -0.2515883147716522, 1.6866002082824707, -0.38702425360679626, -1.5722333192825317, -1.5990341901779175, 0.8052170872688293, 0.5449525713920593, -0.9112103581428528, 0.062205515801906586, -0.390290766954422, 0.1480615884065628, -0.05877213180065155, 1.2151803970336914, 1.3797603845596313, 0.6810975670814514, -0.4046233296394348, -0.7475613951683044, 0.16772031784057617, 0.013625581748783588, -0.8686111569404602, -1.6720114946365356, -0.41134113073349, 0.0842803418636322, 0.6372669339179993, -1.3112009763717651, 1.6905324459075928, 0.9279705286026001, 1.7938522100448608, 1.1228716373443604, -0.4716665744781494, 1.5226011276245117, 0.18580925464630127, 1.7846213579177856, -0.5675927400588989, 0.6938465237617493, -0.4108181297779083, -1.1399037837982178, 0.7621167302131653, -0.3245983421802521, -2.1027040481567383, -0.8128036856651306, -0.5815792083740234, -0.2018086463212967, -0.7883877754211426, 0.9674639701843262, -0.35737892985343933, -1.3852767944335938, 0.16565686464309692, -0.7763639688491821, 0.16895438730716705, -1.2172025442123413, 0.24921609461307526, 0.7211940884590149, -0.5979413390159607, 0.11193583905696869, -0.10696328431367874, -1.2824152708053589, -0.2651790976524353, 0.2230699062347412, 1.8945356607437134, -0.8061832189559937, 0.9181395769119263, 1.0000890493392944, -0.6546730399131775, 0.020618561655282974, 0.21696628630161285, -0.2058989703655243, 0.9435762166976929, -0.9922937154769897, -0.4962866008281708, 1.2366794347763062, -0.24417656660079956, -0.46233561635017395, 1.4168462753295898, 0.6873024106025696, -0.9566481709480286, -0.2833556830883026, -0.14088082313537598, -0.8958540558815002, -0.027889568358659744, -1.5328792333602905, -0.2411201298236847, 0.46479952335357666, -1.5153896808624268, -0.4168466627597809, -0.17386658489704132, 1.2079681158065796, -0.24770714342594147, 1.446370244026184, -0.4223322868347168, -0.23435530066490173, -0.2875558137893677, -0.37007856369018555, 0.16294293105602264, -0.2457914501428604, -0.6608290076255798, 0.18752817809581757, -0.7011070847511292, 0.39205554127693176, 1.379658818244934, 0.34218651056289673, 0.0799277201294899, 0.3510233163833618, 1.0162569284439087, 0.3940310478210449, -0.08556755632162094, -0.8792168498039246, -1.5839576721191406, 2.067413091659546, -1.488531231880188, 2.092167377471924, 0.7543487548828125, -0.046721577644348145, -1.7018076181411743, -1.8348348140716553, 1.239909052848816, 1.0602130889892578, 2.349695920944214, 0.4159335792064667, 0.4107920229434967, -0.7899381518363953, -0.6721205115318298, 0.2831594944000244, -1.02386474609375, -0.677273154258728, 0.09267468750476837, 2.4224369525909424, 1.6748570203781128, -0.40522435307502747, -0.17104415595531464, -0.9724377989768982, 1.3146936893463135, -0.16725623607635498, 0.23245766758918762, 1.9846314191818237, -0.2581525444984436, -1.0970426797866821, 1.3305011987686157, -2.3279800415039062, 0.14850567281246185, 2.002718448638916, 0.2786496579647064, 0.0070619843900203705, -1.3204025030136108, -0.6603819727897644, -0.42005109786987305, -0.46575817465782166, -1.2810403108596802, 0.4970822334289551, -0.26154443621635437, -0.8162463307380676, -1.3151627779006958, -0.02066977322101593, -1.0874017477035522, -1.6056870222091675, 0.2341158390045166, 2.03122615814209, 1.9043641090393066, -0.7598724365234375, 1.5093237161636353, -0.2623845636844635, -0.007938618771731853, 1.1810575723648071, 1.318279504776001, 3.1262121200561523, 1.841643214225769, -1.322070598602295, 0.5258016586303711, -0.2832053303718567, -0.4558199346065521, 1.1356265544891357, -1.2468281984329224, 1.365499496459961, -0.02443239465355873, -1.2458679676055908, -1.167910099029541, 0.9618567228317261, 0.4625069797039032, -0.017913082614541054, -0.6077032685279846, 1.1290092468261719, 0.015084815211594105, 1.316731572151184, 0.5680792331695557, -0.2983647584915161, 0.5311970710754395, -0.34779512882232666, -0.5509042143821716, 1.5192478895187378, 0.09363871812820435, -1.4518651962280273, -2.3502893447875977, -0.16761352121829987, -0.8349912762641907, 0.0518140010535717, -0.5372459888458252, -1.0648356676101685, 1.7370178699493408, 0.37020114064216614, -1.3310993909835815, -0.327993780374527, -0.41255125403404236, -0.5143149495124817, 2.913055658340454, -1.312877893447876, -0.176626056432724, -0.99048912525177, -0.5983820557594299, 1.7136189937591553, -1.1692618131637573, -0.2396831214427948, -0.9555060863494873, -0.5842412114143372, -1.3011231422424316, -0.4122913181781769, 0.08108783513307571, -1.059385895729065, 0.859379231929779, 0.26647549867630005, -1.151076078414917, -0.3982175290584564, -0.8824379444122314, 0.8619803786277771, -0.13231243193149567, 0.2167872190475464, 2.0653815269470215, 0.40557050704956055, -0.2708710730075836, 0.833142876625061, 1.272879719734192, 0.6928480863571167, -0.6976916790008545, 0.11457742005586624, -0.6570323705673218, 0.3297605514526367, -1.357674241065979, 0.29297274351119995, -2.8084752559661865, 0.6675459146499634, -0.07607075572013855, -0.16282953321933746, 0.05930706113576889, -1.1975395679473877, 1.132210612297058, 2.568801164627075, -1.1180826425552368, 0.4807402789592743, 0.2979324758052826, 1.131064772605896, -1.6755964756011963, 0.2973039746284485, -0.4311525821685791, 2.123277425765991, 0.3973225951194763, 1.2450224161148071, -0.494792103767395, -2.2888002395629883, 0.6372920274734497, -1.255068063735962, -1.1899515390396118, 0.8027642369270325, -0.8609787821769714, 0.24276147782802582, -1.4677462577819824, -0.2761248052120209, -0.8285009264945984, -1.1428923606872559, 0.5768202543258667, 0.16232796013355255, 0.4078158736228943, -0.5518743991851807, 0.27620941400527954, -2.3932907581329346, -1.3896238803863525, -0.1086963638663292, -1.020229697227478, 0.5055070519447327, -0.45378559827804565, 0.6908156275749207, -0.08805693686008453, -0.029698528349399567, 0.38194793462753296, 1.6569015979766846, 3.3990206718444824, 0.3432939946651459, 0.3302674889564514, -0.29005110263824463, -0.9391810297966003, 1.4048519134521484, 0.8746007084846497, -0.0359812006354332, -0.596266508102417, -1.1389296054840088, 1.226996660232544, 1.8934788703918457, 0.963687539100647, -0.00602163840085268, -0.8038417100906372, -0.7750322818756104, -0.08996232599020004, 0.23699498176574707, 0.5650245547294617, 0.989140510559082, 0.08590146154165268, 0.08611630648374557, 1.5393438339233398, 1.1917697191238403, -0.4317839741706848, 0.3180740177631378, -0.8366612792015076, -0.5214040279388428, 0.4024369716644287, 0.28265106678009033, -0.017438245937228203, 0.4763607978820801, -0.947776734828949, -0.17379418015480042, -0.5325052738189697, -0.8206740617752075, -0.7116966843605042, -0.3325418531894684, -0.3454505503177643, 1.6021182537078857, 0.12308187782764435, -0.4595828950405121, -0.043335091322660446, -0.7241536974906921, -0.24414579570293427, -1.0371596813201904, 0.320769727230072, -0.020835060626268387, -0.09342598915100098, -0.05751573294401169, 1.7108601331710815, -0.8590230941772461, -2.0362067222595215, 0.16935794055461884, 0.15349198877811432, -0.29242733120918274, 0.19608260691165924, 1.568585753440857, 0.575594425201416, 1.4240813255310059, 1.3199974298477173, 0.862415075302124, -0.5615981221199036, -1.3656363487243652, 0.6689519882202148, 0.9596808552742004, -1.2949415445327759, 0.8922305703163147, -0.20456720888614655, -0.5199177265167236, 0.5933687090873718, 1.3397431373596191, 0.45095953345298767, -2.015702486038208, 0.9037430286407471, -0.9100394248962402, 0.8623488545417786, 0.6876624226570129, 0.6814846396446228, 0.25988128781318665, 0.8371727466583252, -1.2219512462615967, -1.2340326309204102, -0.6999858617782593, -0.7196918725967407, 1.9776438474655151, -0.35381463170051575, 0.6544365286827087, -0.2606809437274933, -1.1815134286880493, -0.001973289530724287, 0.603135347366333, 0.36063048243522644, -0.49845635890960693, 0.8523103594779968, -0.5993491411209106, -1.0963143110275269, -1.3776642084121704, -0.45111870765686035, -1.041988730430603, -0.905070424079895, 0.9476454854011536, 0.8207343220710754, 0.30735278129577637, 1.7742317914962769, 0.6292149424552917, 0.3353559076786041, -2.689619541168213, 0.9537433385848999, 0.1592453569173813, -0.116688571870327, 0.8938232064247131, 0.34136489033699036, 1.0127743482589722, 0.06903407722711563, 0.473847895860672, -2.558945655822754, 2.360347032546997, -0.41137728095054626, 0.7631104588508606, -0.04763241857290268, -0.042436383664608, 1.1696480512619019, 0.7050463557243347, 0.5539021492004395, -1.0408413410186768, 0.6431414484977722, -0.4085714817047119, 1.2340995073318481, 0.9329420328140259, -0.7817742228507996, -0.05735209956765175, 1.5007669925689697, 0.4788152873516083, -0.6308817267417908, -0.8709248900413513, -0.9270895719528198, 0.9065390229225159, 1.750038504600525, 0.017110757529735565, -0.03376206383109093, 0.9207185506820679, 0.6952529549598694, -1.1677031517028809, 0.13564278185367584, -0.6762940883636475, -0.7526960968971252, 1.6547234058380127, 2.138350486755371, -0.10304621607065201, -0.29518118500709534, -0.5768266320228577, -1.2187974452972412, 0.753158450126648, -0.08024919033050537, 0.26698222756385803, 0.6858541369438171, -0.7310247421264648, 1.0406248569488525, 0.8048052191734314, 0.9792479872703552, 0.2853330671787262, 0.25125443935394287, 0.43668892979621887, -0.281421422958374, -1.174363136291504, -0.32896697521209717, -1.1512802839279175, -2.4457168579101562, 0.32768818736076355, -0.25310030579566956, -1.3901065587997437, 0.11103262007236481, -1.0830810070037842, 0.8024473786354065, -0.6888136267662048, -1.0665292739868164, -1.5736958980560303, 0.20282067358493805, 0.04338008910417557, 0.8833816051483154, -1.6311596632003784, -0.2561163604259491, 1.1897066831588745, 0.893227756023407, -0.5517680644989014, 0.921951413154602, 0.18651901185512543, 1.0322805643081665, 0.803269624710083, -0.40937769412994385, 0.3835245370864868, -0.07938876003026962, -1.3543570041656494, 0.5007349252700806, 1.208141803741455, 0.24165035784244537, 1.6117380857467651, -0.5113011598587036, -0.05031760036945343, 0.3877544701099396, -0.5440784692764282, -0.2911362051963806, -0.46890515089035034, 0.5689723491668701, 0.17062555253505707, -0.9043975472450256, -0.10545910894870758, -0.06527754664421082, -0.3386080265045166, 0.08924707770347595, -1.3746665716171265, -0.07979772239923477, -0.4456019401550293, -0.5850498080253601, -1.1451961994171143, -0.12111279368400574, 1.3604631423950195, -0.8974778652191162, -0.14927977323532104, 0.4856261610984802, 0.2786639332771301, 0.5994020104408264, 0.7024035453796387, -0.7100880146026611, -0.3409590721130371, -0.2910833954811096, -0.303238183259964, 0.3027670681476593, 1.2723337411880493, -0.13932785391807556, -0.8756037950515747, 0.60691899061203, -0.36420300602912903, 0.13031521439552307, 1.8982622623443604, -0.02737969532608986, -0.6860343217849731, 0.3009139597415924, -0.7972003221511841, 1.9049944877624512, 1.6251791715621948, 1.250503420829773, -0.1257859170436859, -0.9898862838745117, 0.643151581287384, -0.4361223876476288, -0.39072126150131226, 0.7274683117866516, 0.3450058698654175, -0.2232637107372284, -1.4539482593536377, 0.7500842213630676, 1.2425410747528076, -0.9871392250061035, -0.7261852622032166, 0.21788297593593597, -0.8076938986778259, 1.0522329807281494, 0.5696714520454407, 0.2402709573507309, 0.3301248550415039, 1.676027536392212, 0.8839903473854065, -0.329928457736969, 0.4956236481666565, 0.5735917091369629, -0.20663687586784363, -2.203526020050049, -1.173896074295044, 0.2912505865097046, -0.42254671454429626, -1.589289903640747, 1.442243218421936, -1.1496397256851196, -0.9648959636688232, 0.6511660814285278, 0.11723779141902924, 1.3963836431503296, 0.36449891328811646, 1.59639310836792, 2.096285820007324, 0.9262003898620605, 0.4458015263080597, 1.244294285774231, -0.08340109884738922, -0.4461541473865509, 1.7690963745117188, -0.390906423330307, 0.47446852922439575, 0.9792773127555847, -0.30851805210113525, -1.103279948234558, -0.8371413350105286, -1.366457462310791, -0.7384980320930481, 1.1522306203842163, 0.0817585289478302, -1.0464813709259033, 0.23051141202449799, 1.577062726020813, 0.16501611471176147, -0.43383800983428955, 0.589514970779419, 0.5203112959861755, -0.7592626810073853, -0.15056844055652618, -0.8356045484542847, 0.5255478620529175, -0.1185736209154129, -0.33985406160354614, 0.25607290863990784, 0.4402123987674713, 1.441201090812683, -0.01731412298977375, 0.03300465643405914, 1.0713346004486084, -1.5143805742263794, 1.4924548864364624, -0.5963876247406006, 0.34682169556617737, -2.247520923614502, 1.4284089803695679, -0.7359286546707153, 1.9842536449432373, -2.620241165161133, 0.5249099135398865, -0.5941247344017029, -0.5098524689674377, 0.27904364466667175, -0.3464415371417999, 0.2373819202184677, -0.20711974799633026, -1.1657087802886963, -0.06664109230041504, -0.7405198812484741, 0.44406989216804504, 1.1550424098968506, 1.3931633234024048, -1.0949174165725708, -0.397943377494812, -1.61432945728302, -0.02749267965555191, -0.6833990812301636, 0.2517191171646118, -2.0113487243652344, -0.06703821569681168, -1.9614231586456299, -2.3990254402160645, -1.3229610919952393, -0.680630087852478, 1.088256597518921, 0.13461340963840485, -0.856856107711792, 1.3230746984481812, -0.34262847900390625, -1.7755447626113892, 1.178642988204956, -2.1467130184173584 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
Ok wow, thanks a lot for checking this - you've found a pretty big bug :sweat_smile: It seems like **a lot** more datasets are actually affected than I original thought. We'll try to solve this as soon as possible and make an announcement tomorrow.
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
973
44
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 Ok wow, thanks a lot for checking this - you've found a pretty big bug :sweat_smile: It seems like **a lot** more datasets are actually affected than I original thought. We'll try to solve this as soon as possible and make an announcement tomorrow.
[ -1.3920469284057617, -0.8224828243255615, -0.6726378798484802, 1.4861177206039429, -0.1254834085702896, -1.2422548532485962, 0.1428719162940979, -1.1265442371368408, 1.6405339241027832, -0.7956996560096741, 0.43074506521224976, -1.6366304159164429, 0.04461100697517395, -0.5762713551521301, -0.8422549366950989, -0.9075511693954468, -0.4147358536720276, -0.6475420594215393, 1.0152937173843384, 2.4049034118652344, 1.2402695417404175, -1.3607895374298096, 2.7938690185546875, 0.7410194873809814, -0.2787855267524719, -0.9628453254699707, 0.5201768279075623, 0.04540131986141205, -1.3535453081130981, -0.5183335542678833, -0.9586236476898193, -0.06760258972644806, -0.4997299909591675, -0.4181402623653412, -0.04528563469648361, 0.3096561133861542, -0.30089831352233887, -0.4450500011444092, -0.6222570538520813, -0.8348660469055176, 0.3144114017486572, -0.35935544967651367, 0.9171770215034485, -0.24309787154197693, 1.7946267127990723, -0.715705394744873, 0.4489205479621887, 0.6602954268455505, 1.3614834547042847, 0.2835189402103424, 0.09526573121547699, 0.4257161319255829, 0.5132258534431458, 0.008681084029376507, 0.5726178288459778, 1.1019930839538574, 0.7211399078369141, 0.4253939688205719, 0.7862055897712708, -2.2152998447418213, 1.1746106147766113, -1.0306979417800903, 0.14792868494987488, 1.4416203498840332, -0.8547709584236145, 0.35555770993232727, -1.723151683807373, -0.004540770780295134, 0.6042393445968628, -2.2994141578674316, 0.19740426540374756, -1.4235222339630127, -0.5522645115852356, 1.0229756832122803, 0.4434637427330017, -1.1869348287582397, 0.15902584791183472, -0.42026180028915405, 0.9321914315223694, 0.348739355802536, 1.0895154476165771, -1.5902942419052124, -0.11524331569671631, -0.34883546829223633, 0.03860345855355263, -1.1833800077438354, -1.523234486579895, 0.6061765551567078, 0.49819308519363403, 0.5806512236595154, -0.08896160870790482, 1.0965653657913208, -1.112172245979309, 0.9226510524749756, -1.0990744829177856, -1.7225209474563599, -1.548104166984558, -2.1894571781158447, -2.165640354156494, 0.8370531797409058, -0.5558211803436279, -0.46716606616973877, 1.9982763528823853, -1.107481598854065, -1.6234225034713745, 1.2217837572097778, 0.20553895831108093, -0.03370530530810356, 2.409010171890259, 0.15122778713703156, -0.6486408710479736, 0.4405570924282074, -0.7436134219169617, 0.7609421014785767, -0.3330332636833191, 1.1901553869247437, 0.3389277756214142, -1.0300371646881104, 1.5311554670333862, -0.3350277245044708, 0.520095944404602, -0.6320230960845947, -0.531862199306488, -0.7486974596977234, 0.38592594861984253, 1.8247523307800293, -0.2515883147716522, 1.6866002082824707, -0.38702425360679626, -1.5722333192825317, -1.5990341901779175, 0.8052170872688293, 0.5449525713920593, -0.9112103581428528, 0.062205515801906586, -0.390290766954422, 0.1480615884065628, -0.05877213180065155, 1.2151803970336914, 1.3797603845596313, 0.6810975670814514, -0.4046233296394348, -0.7475613951683044, 0.16772031784057617, 0.013625581748783588, -0.8686111569404602, -1.6720114946365356, -0.41134113073349, 0.0842803418636322, 0.6372669339179993, -1.3112009763717651, 1.6905324459075928, 0.9279705286026001, 1.7938522100448608, 1.1228716373443604, -0.4716665744781494, 1.5226011276245117, 0.18580925464630127, 1.7846213579177856, -0.5675927400588989, 0.6938465237617493, -0.4108181297779083, -1.1399037837982178, 0.7621167302131653, -0.3245983421802521, -2.1027040481567383, -0.8128036856651306, -0.5815792083740234, -0.2018086463212967, -0.7883877754211426, 0.9674639701843262, -0.35737892985343933, -1.3852767944335938, 0.16565686464309692, -0.7763639688491821, 0.16895438730716705, -1.2172025442123413, 0.24921609461307526, 0.7211940884590149, -0.5979413390159607, 0.11193583905696869, -0.10696328431367874, -1.2824152708053589, -0.2651790976524353, 0.2230699062347412, 1.8945356607437134, -0.8061832189559937, 0.9181395769119263, 1.0000890493392944, -0.6546730399131775, 0.020618561655282974, 0.21696628630161285, -0.2058989703655243, 0.9435762166976929, -0.9922937154769897, -0.4962866008281708, 1.2366794347763062, -0.24417656660079956, -0.46233561635017395, 1.4168462753295898, 0.6873024106025696, -0.9566481709480286, -0.2833556830883026, -0.14088082313537598, -0.8958540558815002, -0.027889568358659744, -1.5328792333602905, -0.2411201298236847, 0.46479952335357666, -1.5153896808624268, -0.4168466627597809, -0.17386658489704132, 1.2079681158065796, -0.24770714342594147, 1.446370244026184, -0.4223322868347168, -0.23435530066490173, -0.2875558137893677, -0.37007856369018555, 0.16294293105602264, -0.2457914501428604, -0.6608290076255798, 0.18752817809581757, -0.7011070847511292, 0.39205554127693176, 1.379658818244934, 0.34218651056289673, 0.0799277201294899, 0.3510233163833618, 1.0162569284439087, 0.3940310478210449, -0.08556755632162094, -0.8792168498039246, -1.5839576721191406, 2.067413091659546, -1.488531231880188, 2.092167377471924, 0.7543487548828125, -0.046721577644348145, -1.7018076181411743, -1.8348348140716553, 1.239909052848816, 1.0602130889892578, 2.349695920944214, 0.4159335792064667, 0.4107920229434967, -0.7899381518363953, -0.6721205115318298, 0.2831594944000244, -1.02386474609375, -0.677273154258728, 0.09267468750476837, 2.4224369525909424, 1.6748570203781128, -0.40522435307502747, -0.17104415595531464, -0.9724377989768982, 1.3146936893463135, -0.16725623607635498, 0.23245766758918762, 1.9846314191818237, -0.2581525444984436, -1.0970426797866821, 1.3305011987686157, -2.3279800415039062, 0.14850567281246185, 2.002718448638916, 0.2786496579647064, 0.0070619843900203705, -1.3204025030136108, -0.6603819727897644, -0.42005109786987305, -0.46575817465782166, -1.2810403108596802, 0.4970822334289551, -0.26154443621635437, -0.8162463307380676, -1.3151627779006958, -0.02066977322101593, -1.0874017477035522, -1.6056870222091675, 0.2341158390045166, 2.03122615814209, 1.9043641090393066, -0.7598724365234375, 1.5093237161636353, -0.2623845636844635, -0.007938618771731853, 1.1810575723648071, 1.318279504776001, 3.1262121200561523, 1.841643214225769, -1.322070598602295, 0.5258016586303711, -0.2832053303718567, -0.4558199346065521, 1.1356265544891357, -1.2468281984329224, 1.365499496459961, -0.02443239465355873, -1.2458679676055908, -1.167910099029541, 0.9618567228317261, 0.4625069797039032, -0.017913082614541054, -0.6077032685279846, 1.1290092468261719, 0.015084815211594105, 1.316731572151184, 0.5680792331695557, -0.2983647584915161, 0.5311970710754395, -0.34779512882232666, -0.5509042143821716, 1.5192478895187378, 0.09363871812820435, -1.4518651962280273, -2.3502893447875977, -0.16761352121829987, -0.8349912762641907, 0.0518140010535717, -0.5372459888458252, -1.0648356676101685, 1.7370178699493408, 0.37020114064216614, -1.3310993909835815, -0.327993780374527, -0.41255125403404236, -0.5143149495124817, 2.913055658340454, -1.312877893447876, -0.176626056432724, -0.99048912525177, -0.5983820557594299, 1.7136189937591553, -1.1692618131637573, -0.2396831214427948, -0.9555060863494873, -0.5842412114143372, -1.3011231422424316, -0.4122913181781769, 0.08108783513307571, -1.059385895729065, 0.859379231929779, 0.26647549867630005, -1.151076078414917, -0.3982175290584564, -0.8824379444122314, 0.8619803786277771, -0.13231243193149567, 0.2167872190475464, 2.0653815269470215, 0.40557050704956055, -0.2708710730075836, 0.833142876625061, 1.272879719734192, 0.6928480863571167, -0.6976916790008545, 0.11457742005586624, -0.6570323705673218, 0.3297605514526367, -1.357674241065979, 0.29297274351119995, -2.8084752559661865, 0.6675459146499634, -0.07607075572013855, -0.16282953321933746, 0.05930706113576889, -1.1975395679473877, 1.132210612297058, 2.568801164627075, -1.1180826425552368, 0.4807402789592743, 0.2979324758052826, 1.131064772605896, -1.6755964756011963, 0.2973039746284485, -0.4311525821685791, 2.123277425765991, 0.3973225951194763, 1.2450224161148071, -0.494792103767395, -2.2888002395629883, 0.6372920274734497, -1.255068063735962, -1.1899515390396118, 0.8027642369270325, -0.8609787821769714, 0.24276147782802582, -1.4677462577819824, -0.2761248052120209, -0.8285009264945984, -1.1428923606872559, 0.5768202543258667, 0.16232796013355255, 0.4078158736228943, -0.5518743991851807, 0.27620941400527954, -2.3932907581329346, -1.3896238803863525, -0.1086963638663292, -1.020229697227478, 0.5055070519447327, -0.45378559827804565, 0.6908156275749207, -0.08805693686008453, -0.029698528349399567, 0.38194793462753296, 1.6569015979766846, 3.3990206718444824, 0.3432939946651459, 0.3302674889564514, -0.29005110263824463, -0.9391810297966003, 1.4048519134521484, 0.8746007084846497, -0.0359812006354332, -0.596266508102417, -1.1389296054840088, 1.226996660232544, 1.8934788703918457, 0.963687539100647, -0.00602163840085268, -0.8038417100906372, -0.7750322818756104, -0.08996232599020004, 0.23699498176574707, 0.5650245547294617, 0.989140510559082, 0.08590146154165268, 0.08611630648374557, 1.5393438339233398, 1.1917697191238403, -0.4317839741706848, 0.3180740177631378, -0.8366612792015076, -0.5214040279388428, 0.4024369716644287, 0.28265106678009033, -0.017438245937228203, 0.4763607978820801, -0.947776734828949, -0.17379418015480042, -0.5325052738189697, -0.8206740617752075, -0.7116966843605042, -0.3325418531894684, -0.3454505503177643, 1.6021182537078857, 0.12308187782764435, -0.4595828950405121, -0.043335091322660446, -0.7241536974906921, -0.24414579570293427, -1.0371596813201904, 0.320769727230072, -0.020835060626268387, -0.09342598915100098, -0.05751573294401169, 1.7108601331710815, -0.8590230941772461, -2.0362067222595215, 0.16935794055461884, 0.15349198877811432, -0.29242733120918274, 0.19608260691165924, 1.568585753440857, 0.575594425201416, 1.4240813255310059, 1.3199974298477173, 0.862415075302124, -0.5615981221199036, -1.3656363487243652, 0.6689519882202148, 0.9596808552742004, -1.2949415445327759, 0.8922305703163147, -0.20456720888614655, -0.5199177265167236, 0.5933687090873718, 1.3397431373596191, 0.45095953345298767, -2.015702486038208, 0.9037430286407471, -0.9100394248962402, 0.8623488545417786, 0.6876624226570129, 0.6814846396446228, 0.25988128781318665, 0.8371727466583252, -1.2219512462615967, -1.2340326309204102, -0.6999858617782593, -0.7196918725967407, 1.9776438474655151, -0.35381463170051575, 0.6544365286827087, -0.2606809437274933, -1.1815134286880493, -0.001973289530724287, 0.603135347366333, 0.36063048243522644, -0.49845635890960693, 0.8523103594779968, -0.5993491411209106, -1.0963143110275269, -1.3776642084121704, -0.45111870765686035, -1.041988730430603, -0.905070424079895, 0.9476454854011536, 0.8207343220710754, 0.30735278129577637, 1.7742317914962769, 0.6292149424552917, 0.3353559076786041, -2.689619541168213, 0.9537433385848999, 0.1592453569173813, -0.116688571870327, 0.8938232064247131, 0.34136489033699036, 1.0127743482589722, 0.06903407722711563, 0.473847895860672, -2.558945655822754, 2.360347032546997, -0.41137728095054626, 0.7631104588508606, -0.04763241857290268, -0.042436383664608, 1.1696480512619019, 0.7050463557243347, 0.5539021492004395, -1.0408413410186768, 0.6431414484977722, -0.4085714817047119, 1.2340995073318481, 0.9329420328140259, -0.7817742228507996, -0.05735209956765175, 1.5007669925689697, 0.4788152873516083, -0.6308817267417908, -0.8709248900413513, -0.9270895719528198, 0.9065390229225159, 1.750038504600525, 0.017110757529735565, -0.03376206383109093, 0.9207185506820679, 0.6952529549598694, -1.1677031517028809, 0.13564278185367584, -0.6762940883636475, -0.7526960968971252, 1.6547234058380127, 2.138350486755371, -0.10304621607065201, -0.29518118500709534, -0.5768266320228577, -1.2187974452972412, 0.753158450126648, -0.08024919033050537, 0.26698222756385803, 0.6858541369438171, -0.7310247421264648, 1.0406248569488525, 0.8048052191734314, 0.9792479872703552, 0.2853330671787262, 0.25125443935394287, 0.43668892979621887, -0.281421422958374, -1.174363136291504, -0.32896697521209717, -1.1512802839279175, -2.4457168579101562, 0.32768818736076355, -0.25310030579566956, -1.3901065587997437, 0.11103262007236481, -1.0830810070037842, 0.8024473786354065, -0.6888136267662048, -1.0665292739868164, -1.5736958980560303, 0.20282067358493805, 0.04338008910417557, 0.8833816051483154, -1.6311596632003784, -0.2561163604259491, 1.1897066831588745, 0.893227756023407, -0.5517680644989014, 0.921951413154602, 0.18651901185512543, 1.0322805643081665, 0.803269624710083, -0.40937769412994385, 0.3835245370864868, -0.07938876003026962, -1.3543570041656494, 0.5007349252700806, 1.208141803741455, 0.24165035784244537, 1.6117380857467651, -0.5113011598587036, -0.05031760036945343, 0.3877544701099396, -0.5440784692764282, -0.2911362051963806, -0.46890515089035034, 0.5689723491668701, 0.17062555253505707, -0.9043975472450256, -0.10545910894870758, -0.06527754664421082, -0.3386080265045166, 0.08924707770347595, -1.3746665716171265, -0.07979772239923477, -0.4456019401550293, -0.5850498080253601, -1.1451961994171143, -0.12111279368400574, 1.3604631423950195, -0.8974778652191162, -0.14927977323532104, 0.4856261610984802, 0.2786639332771301, 0.5994020104408264, 0.7024035453796387, -0.7100880146026611, -0.3409590721130371, -0.2910833954811096, -0.303238183259964, 0.3027670681476593, 1.2723337411880493, -0.13932785391807556, -0.8756037950515747, 0.60691899061203, -0.36420300602912903, 0.13031521439552307, 1.8982622623443604, -0.02737969532608986, -0.6860343217849731, 0.3009139597415924, -0.7972003221511841, 1.9049944877624512, 1.6251791715621948, 1.250503420829773, -0.1257859170436859, -0.9898862838745117, 0.643151581287384, -0.4361223876476288, -0.39072126150131226, 0.7274683117866516, 0.3450058698654175, -0.2232637107372284, -1.4539482593536377, 0.7500842213630676, 1.2425410747528076, -0.9871392250061035, -0.7261852622032166, 0.21788297593593597, -0.8076938986778259, 1.0522329807281494, 0.5696714520454407, 0.2402709573507309, 0.3301248550415039, 1.676027536392212, 0.8839903473854065, -0.329928457736969, 0.4956236481666565, 0.5735917091369629, -0.20663687586784363, -2.203526020050049, -1.173896074295044, 0.2912505865097046, -0.42254671454429626, -1.589289903640747, 1.442243218421936, -1.1496397256851196, -0.9648959636688232, 0.6511660814285278, 0.11723779141902924, 1.3963836431503296, 0.36449891328811646, 1.59639310836792, 2.096285820007324, 0.9262003898620605, 0.4458015263080597, 1.244294285774231, -0.08340109884738922, -0.4461541473865509, 1.7690963745117188, -0.390906423330307, 0.47446852922439575, 0.9792773127555847, -0.30851805210113525, -1.103279948234558, -0.8371413350105286, -1.366457462310791, -0.7384980320930481, 1.1522306203842163, 0.0817585289478302, -1.0464813709259033, 0.23051141202449799, 1.577062726020813, 0.16501611471176147, -0.43383800983428955, 0.589514970779419, 0.5203112959861755, -0.7592626810073853, -0.15056844055652618, -0.8356045484542847, 0.5255478620529175, -0.1185736209154129, -0.33985406160354614, 0.25607290863990784, 0.4402123987674713, 1.441201090812683, -0.01731412298977375, 0.03300465643405914, 1.0713346004486084, -1.5143805742263794, 1.4924548864364624, -0.5963876247406006, 0.34682169556617737, -2.247520923614502, 1.4284089803695679, -0.7359286546707153, 1.9842536449432373, -2.620241165161133, 0.5249099135398865, -0.5941247344017029, -0.5098524689674377, 0.27904364466667175, -0.3464415371417999, 0.2373819202184677, -0.20711974799633026, -1.1657087802886963, -0.06664109230041504, -0.7405198812484741, 0.44406989216804504, 1.1550424098968506, 1.3931633234024048, -1.0949174165725708, -0.397943377494812, -1.61432945728302, -0.02749267965555191, -0.6833990812301636, 0.2517191171646118, -2.0113487243652344, -0.06703821569681168, -1.9614231586456299, -2.3990254402160645, -1.3229610919952393, -0.680630087852478, 1.088256597518921, 0.13461340963840485, -0.856856107711792, 1.3230746984481812, -0.34262847900390625, -1.7755447626113892, 1.178642988204956, -2.1467130184173584 ]
https://github.com/huggingface/datasets/issues/3659
push_to_hub but preview not working
Hi @thomas-happify, please note that the preview may take some time before rendering the data. I've seen it is already working. I close this issue. Please feel free to reopen it if the problem arises again.
## Dataset viewer issue for '*happifyhealth/twitter_pnn*' **Link:** *[link to the dataset viewer page](https://huggingface.co/datasets/happifyhealth/twitter_pnn)* I used ``` dataset.push_to_hub("happifyhealth/twitter_pnn") ``` but the preview is not working. Am I the one who added this dataset ? Yes
974
36
push_to_hub but preview not working ## Dataset viewer issue for '*happifyhealth/twitter_pnn*' **Link:** *[link to the dataset viewer page](https://huggingface.co/datasets/happifyhealth/twitter_pnn)* I used ``` dataset.push_to_hub("happifyhealth/twitter_pnn") ``` but the preview is not working. Am I the one who added this dataset ? Yes Hi @thomas-happify, please note that the preview may take some time before rendering the data. I've seen it is already working. I close this issue. Please feel free to reopen it if the problem arises again.
[ -1.2381802797317505, -0.961679995059967, -0.8256894946098328, 1.479280948638916, -0.2787991762161255, -1.2113685607910156, 0.08118078857660294, -1.045634388923645, 1.6768256425857544, -0.7775561809539795, 0.2575128674507141, -1.636253833770752, -0.15152691304683685, -0.5337334871292114, -0.753871500492096, -0.8409081697463989, -0.5002520680427551, -0.880892276763916, 1.0002800226211548, 2.4809412956237793, 1.1762276887893677, -1.3506250381469727, 2.6857516765594482, 0.6211153268814087, -0.1272897720336914, -1.1985441446304321, 0.49686476588249207, 0.12667293846607208, -1.1029903888702393, -0.49208179116249084, -0.9069374203681946, -0.110797218978405, -0.5381873250007629, -0.48035529255867004, 0.06410413980484009, 0.43334129452705383, -0.08645603060722351, -0.33794093132019043, -0.48663750290870667, -0.7424913048744202, 0.5096414089202881, -0.41411668062210083, 0.9216745495796204, -0.4817778468132019, 1.8616597652435303, -0.629331648349762, 0.3488783836364746, 0.7878788709640503, 1.4446250200271606, 0.16463454067707062, -0.15144075453281403, 0.29600009322166443, 0.40955445170402527, -0.023864738643169403, 0.4616914391517639, 1.1272221803665161, 0.4516039192676544, 0.612394392490387, 0.5939105153083801, -2.3474366664886475, 1.3705822229385376, -1.0498689413070679, 0.26809006929397583, 1.4143794775009155, -1.0474379062652588, 0.3452287018299103, -1.8379623889923096, 0.000764181837439537, 0.5514049530029297, -2.2786107063293457, 0.250243604183197, -1.2098934650421143, -0.5128923058509827, 0.9646888971328735, 0.3403927981853485, -1.3738731145858765, -0.010994787327945232, -0.3919561803340912, 1.1289279460906982, 0.5178483128547668, 1.0832313299179077, -1.6572386026382446, 0.010918335989117622, -0.2889271676540375, 0.06999491155147552, -1.4377228021621704, -1.455712914466858, 0.5730876922607422, 0.542732298374176, 0.6517337560653687, -0.03508033603429794, 0.9365032911300659, -0.9841437339782715, 0.8375747203826904, -1.0325806140899658, -1.565372347831726, -1.3991068601608276, -2.298675060272217, -2.328223705291748, 0.8975334763526917, -0.4516923129558563, -0.5670941472053528, 1.945919156074524, -1.0079171657562256, -1.7528785467147827, 1.12657630443573, 0.19306223094463348, 0.1639079451560974, 2.370450735092163, 0.20044435560703278, -0.7274547815322876, 0.3003878593444824, -0.7131460309028625, 0.854087233543396, -0.33917316794395447, 1.420566201210022, 0.5009950995445251, -1.0148900747299194, 1.6578227281570435, -0.21118874847888947, 0.5388669371604919, -0.6571129560470581, -0.6015477180480957, -0.9759109616279602, 0.26936575770378113, 1.90189790725708, -0.3132045567035675, 1.6605088710784912, -0.5323479175567627, -1.5928477048873901, -1.581944227218628, 0.9664114117622375, 0.5567562580108643, -0.8507031202316284, 0.03847511112689972, -0.4746703803539276, 0.14635789394378662, -0.04646659642457962, 1.1819231510162354, 1.2479655742645264, 0.7617641687393188, -0.33001506328582764, -0.8527489304542542, 0.2317454218864441, 0.00022690929472446442, -0.6443625092506409, -1.8666422367095947, -0.4523499608039856, 0.11518740653991699, 0.7156082391738892, -1.1726597547531128, 1.7047191858291626, 0.9331305027008057, 1.947274923324585, 1.01166832447052, -0.21105016767978668, 1.4188172817230225, -0.06526190787553787, 1.811874270439148, -0.5352499485015869, 0.5872464179992676, -0.26618996262550354, -1.047111988067627, 0.841089129447937, -0.3310511112213135, -2.0318593978881836, -0.9546486735343933, -0.9034519195556641, -0.1302803009748459, -0.7076639533042908, 0.9533769488334656, -0.3020445704460144, -1.3745518922805786, 0.07805905491113663, -0.6900454163551331, 0.1899241954088211, -1.1748169660568237, 0.3061656653881073, 0.6623873114585876, -0.6779413819313049, -0.05192612111568451, -0.1909535527229309, -1.341293215751648, -0.5214943289756775, 0.2688921093940735, 1.9783324003219604, -0.7043147683143616, 0.9445117712020874, 0.9503507018089294, -0.8092197179794312, -0.049878500401973724, 0.27415525913238525, -0.2187376618385315, 0.8536207675933838, -1.1072419881820679, -0.3710986077785492, 1.129823088645935, -0.17348138988018036, -0.7617074251174927, 1.5657505989074707, 0.7268421649932861, -1.069789171218872, -0.2128365933895111, -0.2838610112667084, -0.739128828048706, 0.03833231329917908, -1.5184550285339355, -0.2284030169248581, 0.2076730877161026, -1.4167768955230713, -0.49993452429771423, -0.15542781352996826, 1.3845349550247192, -0.17831096053123474, 1.3024839162826538, -0.3101203739643097, -0.3800048232078552, -0.3775021433830261, -0.4570056200027466, 0.12888440489768982, -0.14075125753879547, -0.6139323711395264, 0.2657722532749176, -0.8854333758354187, 0.3474574685096741, 1.3499095439910889, 0.4295034110546112, -0.011087950319051743, 0.5668237805366516, 1.0490578413009644, 0.3061656951904297, 0.04287922382354736, -0.8592527508735657, -1.5769346952438354, 1.968473196029663, -1.512303113937378, 1.9544436931610107, 0.7164058089256287, -0.12190129607915878, -1.7147799730300903, -1.8215773105621338, 1.4031085968017578, 1.3581093549728394, 2.2551538944244385, 0.600767195224762, 0.4643164873123169, -0.8812407851219177, -0.7758631110191345, 0.301902711391449, -1.1696738004684448, -0.6565195322036743, 0.07683014869689941, 2.309530019760132, 1.7152655124664307, -0.5180025696754456, -0.14713741838932037, -0.9494795799255371, 1.197534441947937, -0.14635048806667328, 0.3170759677886963, 2.045759916305542, -0.22823742032051086, -1.0110042095184326, 1.0878804922103882, -2.30419659614563, 0.1948884278535843, 1.9931714534759521, 0.24542425572872162, 0.1805454045534134, -1.534110188484192, -0.5605296492576599, -0.19917415082454681, -0.42939049005508423, -1.2916884422302246, 0.6788691282272339, -0.34185224771499634, -0.8653115034103394, -1.4493660926818848, 0.13651692867279053, -1.1605603694915771, -1.6343311071395874, 0.3851378858089447, 1.9466416835784912, 2.0740716457366943, -0.6660748720169067, 1.4493306875228882, -0.2909661531448364, 0.1298189014196396, 1.22347891330719, 1.1974161863327026, 2.955345392227173, 2.00526762008667, -1.1627050638198853, 0.6001856327056885, -0.10924562811851501, -0.5253791809082031, 1.1946792602539062, -1.0385462045669556, 1.2264766693115234, -0.23489025235176086, -1.2422776222229004, -1.3162755966186523, 1.0626440048217773, 0.45281943678855896, -0.0682065486907959, -0.4345235228538513, 1.3879029750823975, -0.005615341942757368, 1.2671220302581787, 0.5174620151519775, -0.4329555332660675, 0.6394547820091248, -0.45768052339553833, -0.44085416197776794, 1.6384201049804688, 0.18423467874526978, -1.4667277336120605, -2.323495388031006, -0.21527840197086334, -0.82822585105896, -0.0009138127788901329, -0.5745446681976318, -0.9789571166038513, 1.6768769025802612, 0.43806567788124084, -1.3268543481826782, -0.3535376787185669, -0.2944168150424957, -0.6914924383163452, 2.7446067333221436, -1.2830890417099, -0.24360212683677673, -0.9245296716690063, -0.49311017990112305, 1.7799410820007324, -1.1975111961364746, -0.18568284809589386, -0.971854031085968, -0.5682874321937561, -1.3453832864761353, -0.5865728259086609, -0.0874229148030281, -0.9277971982955933, 0.8490563035011292, 0.07000736892223358, -1.0055948495864868, -0.21085043251514435, -0.8078376054763794, 0.8480399250984192, -0.07722296565771103, 0.2881893515586853, 1.908778190612793, 0.2923833429813385, -0.38740208745002747, 0.6488159894943237, 1.1907750368118286, 0.5846102237701416, -0.6194295883178711, 0.283656507730484, -0.5865064263343811, 0.24817489087581635, -1.302634835243225, 0.21088504791259766, -3.043565273284912, 0.6467962265014648, -0.009588649496436119, -0.018460027873516083, -0.03853766992688179, -1.2921086549758911, 1.1111195087432861, 2.480085849761963, -1.248757004737854, 0.3919590711593628, 0.31591495871543884, 1.191370964050293, -1.5261902809143066, 0.393108606338501, -0.44186025857925415, 2.171870231628418, 0.30454331636428833, 1.2495501041412354, -0.47321492433547974, -2.1122851371765137, 0.7121111750602722, -1.3000143766403198, -1.1382942199707031, 0.6455882787704468, -0.840949535369873, 0.18477226793766022, -1.4519143104553223, -0.1953708380460739, -0.8941298127174377, -1.2416740655899048, 0.8042175769805908, 0.1922607719898224, 0.4173758924007416, -0.584820032119751, 0.30219805240631104, -2.143331527709961, -1.3335634469985962, -0.2913922369480133, -0.9212000966072083, 0.5254969596862793, -0.3343934714794159, 0.6782092452049255, -0.12186433374881744, 0.14963263273239136, 0.2681586444377899, 1.4871821403503418, 3.5525078773498535, 0.22637759149074554, 0.2991385757923126, -0.12809957563877106, -0.9290513396263123, 1.549428939819336, 1.0616453886032104, 0.10669174790382385, -0.5891141891479492, -0.9414765238761902, 1.2879152297973633, 1.8862545490264893, 1.0536432266235352, 0.14474083483219147, -0.8734353184700012, -0.5595898628234863, -0.08940201252698898, 0.1700243055820465, 0.47434452176094055, 0.9080444574356079, 0.046327561140060425, 0.1391201913356781, 1.3506070375442505, 1.2310562133789062, -0.4762381613254547, 0.3654254376888275, -1.0345479249954224, -0.44649726152420044, 0.5138300061225891, 0.2544343173503876, -0.11721255630254745, 0.37354764342308044, -0.9781067967414856, -0.17974060773849487, -0.25799569487571716, -0.9913269281387329, -0.6885153651237488, -0.407769113779068, -0.36106130480766296, 1.620335578918457, 0.07413209229707718, -0.4941730499267578, -0.04121536761522293, -0.7613170146942139, -0.16919611394405365, -1.147176742553711, 0.28769630193710327, -0.12223361432552338, -0.16498053073883057, -0.15801864862442017, 1.7991114854812622, -0.9321304559707642, -2.0782968997955322, 0.31020763516426086, 0.3521893322467804, -0.43903326988220215, 0.1762680560350418, 1.5323928594589233, 0.4878080487251282, 1.3853501081466675, 1.3891321420669556, 1.03221595287323, -0.6281126737594604, -1.3017054796218872, 0.5467315316200256, 0.9754724502563477, -1.3974987268447876, 0.7777475714683533, -0.06622886657714844, -0.4236702024936676, 0.699964165687561, 1.340173602104187, 0.5571516752243042, -1.9780943393707275, 0.8699453473091125, -0.8034281730651855, 0.881091833114624, 0.6216779947280884, 0.8103898167610168, 0.33724620938301086, 0.8490830659866333, -1.2093595266342163, -1.1067956686019897, -0.8817867040634155, -0.6537884473800659, 1.9515247344970703, -0.3158149719238281, 0.6338648200035095, -0.1829157918691635, -1.2204526662826538, -0.20921790599822998, 0.689721405506134, 0.36436256766319275, -0.3870215117931366, 0.778520941734314, -0.5741546154022217, -1.0233789682388306, -1.42018723487854, -0.38557174801826477, -1.0003544092178345, -0.9045083522796631, 1.05571711063385, 0.8481341004371643, 0.3314107358455658, 1.8227355480194092, 0.494396835565567, 0.33173927664756775, -2.6925978660583496, 0.9527679681777954, 0.29787808656692505, 0.038592733442783356, 0.966781735420227, 0.28528544306755066, 1.0830403566360474, -0.03800549358129501, 0.5726727247238159, -2.381913423538208, 2.210571527481079, -0.19300317764282227, 0.5713539719581604, 0.08040911704301834, -0.18658140301704407, 1.193152666091919, 0.5631322264671326, 0.6229376196861267, -1.050970196723938, 0.777774453163147, -0.5428963899612427, 1.169603943824768, 0.9547214508056641, -0.6828096508979797, -0.08420528471469879, 1.3000751733779907, 0.46501052379608154, -0.4948611855506897, -0.9543600678443909, -0.8682945966720581, 0.9347051978111267, 1.7371000051498413, -0.05218956619501114, -0.11417660117149353, 0.8304117321968079, 0.5987911224365234, -1.109987497329712, 0.10755278170108795, -0.7883893847465515, -0.6957606673240662, 1.563066840171814, 2.0869357585906982, -0.13286785781383514, -0.19169868528842926, -0.7367568016052246, -1.1568002700805664, 0.7099728584289551, -0.008793339133262634, -0.00035418104380369186, 0.6753151416778564, -0.6020467281341553, 1.1013357639312744, 0.7414310574531555, 0.9607007503509521, 0.002156941220164299, 0.493368536233902, 0.409371554851532, -0.1657864898443222, -1.151684284210205, -0.321616530418396, -1.0336570739746094, -2.6699516773223877, 0.42728349566459656, -0.3920114040374756, -1.3216359615325928, -0.07069405168294907, -1.1384296417236328, 0.9853925108909607, -0.5147615671157837, -1.1078901290893555, -1.6011741161346436, 0.11469195783138275, -0.07447218894958496, 0.9465101957321167, -1.6068120002746582, -0.09267222136259079, 1.2655203342437744, 0.8054696321487427, -0.697334885597229, 1.118095874786377, 0.24970866739749908, 1.0016307830810547, 0.6654868721961975, -0.5246780514717102, 0.4951194226741791, 0.06121654063463211, -1.413540005683899, 0.5853598713874817, 1.1151045560836792, 0.07153702527284622, 1.4030492305755615, -0.5130411982536316, 0.018310297280550003, 0.5080366134643555, -0.6459510326385498, -0.5195217728614807, -0.46434661746025085, 0.8386815190315247, 0.07972534000873566, -0.9855121970176697, -0.06544964015483856, -0.09819526225328445, -0.2691480219364166, 0.13917407393455505, -1.4480406045913696, -0.2780075669288635, -0.4502004384994507, -0.5803588032722473, -1.2749136686325073, 0.044853970408439636, 1.2304165363311768, -0.7321918606758118, -0.30412307381629944, 0.49666354060173035, 0.4103955924510956, 0.5950626730918884, 0.6381111145019531, -0.7166193127632141, -0.3762512803077698, -0.29220396280288696, -0.2119489163160324, 0.4108548164367676, 1.2888708114624023, -0.27896636724472046, -1.044398307800293, 0.7192647457122803, -0.3399275243282318, -0.01072884164750576, 1.9154564142227173, 0.11019081622362137, -0.7891295552253723, 0.31761619448661804, -0.7044245004653931, 1.9970529079437256, 1.5278016328811646, 1.3781800270080566, -0.07997125387191772, -0.843796968460083, 0.5977598428726196, -0.22997884452342987, -0.44655972719192505, 0.8177249431610107, 0.5209830403327942, -0.058085083961486816, -1.4077788591384888, 0.6386767029762268, 1.2570444345474243, -0.8515341877937317, -0.8947432637214661, 0.11165537685155869, -0.7473523020744324, 1.0537599325180054, 0.6192744970321655, 0.4705650806427002, 0.2759157717227936, 1.4996495246887207, 0.6423096060752869, -0.45861682295799255, 0.38872864842414856, 0.4885873794555664, -0.10175131261348724, -2.1162939071655273, -1.1665278673171997, 0.30363166332244873, -0.5173794031143188, -1.5807995796203613, 1.3773308992385864, -1.1480461359024048, -0.8232483863830566, 0.5153939127922058, 0.13860175013542175, 1.5587561130523682, 0.3138976991176605, 1.6978683471679688, 1.9958980083465576, 0.9351398348808289, 0.337268203496933, 1.397247314453125, -0.0102855134755373, -0.4575469195842743, 1.8708372116088867, -0.5276974439620972, 0.40472128987312317, 1.101190447807312, -0.3288953900337219, -1.095072865486145, -0.7071241736412048, -1.1671398878097534, -0.5454758405685425, 1.087343692779541, 0.2192862182855606, -1.3082743883132935, 0.11064985394477844, 1.449924111366272, 0.23089228570461273, -0.33771783113479614, 0.48644009232521057, 0.40409407019615173, -0.8108984231948853, 0.03529323637485504, -0.9055633544921875, 0.4594167470932007, -0.19119110703468323, -0.35926681756973267, 0.32968538999557495, 0.3846679627895355, 1.2480558156967163, -0.1237553283572197, 0.07819041609764099, 1.2122128009796143, -1.4124538898468018, 1.560243844985962, -0.5553789138793945, 0.1729801595211029, -2.467014789581299, 1.4412435293197632, -0.6971650719642639, 1.8974758386611938, -2.601486921310425, 0.32006245851516724, -0.5883234143257141, -0.36253368854522705, 0.3413102626800537, -0.25256603956222534, 0.08690426498651505, -0.16946367919445038, -1.208957314491272, 0.0831170454621315, -0.7826419472694397, 0.5705509781837463, 1.1423181295394897, 1.373470425605774, -1.1631360054016113, -0.2503982484340668, -1.8370095491409302, -0.027194086462259293, -0.7152265906333923, 0.3562394678592682, -2.1194379329681396, -0.11988642066717148, -1.942628264427185, -2.2390682697296143, -1.3303453922271729, -0.7499988675117493, 1.1188734769821167, 0.22668088972568512, -0.7898877263069153, 1.1537145376205444, -0.24005953967571259, -1.7208112478256226, 1.0454002618789673, -2.0975401401519775 ]
https://github.com/huggingface/datasets/issues/3658
Dataset viewer issue for *P3*
The error is now: ``` Status code: 400 Exception: Status400Error Message: this dataset is not supported for now. ``` We've disabled the dataset viewer for several big datasets like this one. We hope being able to reenable it soon.
## Dataset viewer issue for '*P3*' **Link: https://huggingface.co/datasets/bigscience/P3** ``` Status code: 400 Exception: SplitsNotFoundError Message: The split names could not be parsed from the dataset config. ``` Am I the one who added this dataset ? No
975
39
Dataset viewer issue for *P3* ## Dataset viewer issue for '*P3*' **Link: https://huggingface.co/datasets/bigscience/P3** ``` Status code: 400 Exception: SplitsNotFoundError Message: The split names could not be parsed from the dataset config. ``` Am I the one who added this dataset ? No The error is now: ``` Status code: 400 Exception: Status400Error Message: this dataset is not supported for now. ``` We've disabled the dataset viewer for several big datasets like this one. We hope being able to reenable it soon.
[ -1.12673020362854, -0.9163292050361633, -0.794221818447113, 1.4299156665802002, -0.29555609822273254, -1.3249266147613525, 0.17224566638469696, -1.1095885038375854, 1.8187183141708374, -0.6679830551147461, 0.3161879777908325, -1.7505183219909668, -0.051623836159706116, -0.46899399161338806, -0.7467641830444336, -0.904563307762146, -0.5549325942993164, -0.8382593393325806, 1.0033148527145386, 2.4091453552246094, 1.187651515007019, -1.5103238821029663, 2.6425070762634277, 0.6715021133422852, -0.09763290733098984, -1.103879690170288, 0.5070903301239014, 0.05030343681573868, -1.1959015130996704, -0.3915502727031708, -0.9068579077720642, -0.16888770461082458, -0.4892793595790863, -0.6157103180885315, 0.003988334909081459, 0.4533793330192566, -0.22546301782131195, -0.43260645866394043, -0.4544311761856079, -0.735925555229187, 0.5267456769943237, -0.36221203207969666, 0.8926382660865784, -0.5080261826515198, 1.7721912860870361, -0.5002657175064087, 0.33646160364151, 0.7129286527633667, 1.3971130847930908, 0.11110318452119827, -0.2750933766365051, 0.3372642993927002, 0.3800838887691498, -0.07406746596097946, 0.35010579228401184, 1.130120038986206, 0.5384292006492615, 0.6294173002243042, 0.6956964135169983, -2.2720611095428467, 1.2227452993392944, -1.0154800415039062, 0.3215366005897522, 1.4446767568588257, -1.2000901699066162, 0.2755899131298065, -1.8150333166122437, 0.030496569350361824, 0.4983603060245514, -2.2331745624542236, 0.2351255714893341, -1.1695688962936401, -0.4838509261608124, 1.07187819480896, 0.29455599188804626, -1.2921254634857178, 0.03467686474323273, -0.31733086705207825, 1.0430840253829956, 0.5109961032867432, 1.214935302734375, -1.740684986114502, 0.16031230986118317, -0.4547537863254547, 0.0228081326931715, -1.3338732719421387, -1.5070210695266724, 0.5730253458023071, 0.6861749291419983, 0.7913706302642822, -0.20729857683181763, 0.880327045917511, -0.8991581797599792, 0.7712781429290771, -1.0484951734542847, -1.662144660949707, -1.3404163122177124, -2.2430405616760254, -2.256462574005127, 0.8460188508033752, -0.5594088435173035, -0.5287567377090454, 2.00018572807312, -0.8777086138725281, -1.8133676052093506, 1.1753486394882202, 0.40181827545166016, 0.055883415043354034, 2.233980655670166, 0.3420987129211426, -0.6156403422355652, 0.3458606004714966, -0.7768037915229797, 0.8362007141113281, -0.35810813307762146, 1.5120759010314941, 0.6040064096450806, -1.0061663389205933, 1.7610466480255127, -0.4221371114253998, 0.6882123947143555, -0.6858960390090942, -0.6280989050865173, -0.8201466798782349, 0.43883728981018066, 2.0137569904327393, -0.4309377372264862, 1.508533000946045, -0.4532218277454376, -1.628648281097412, -1.4315803050994873, 0.8843474984169006, 0.6027505993843079, -0.7411388754844666, 0.17021457850933075, -0.2987121045589447, 0.0007107770070433617, -0.13121403753757477, 1.0839594602584839, 1.106998324394226, 0.7153336405754089, -0.2868523895740509, -0.9288731217384338, 0.2506653368473053, 0.07756726443767548, -0.8523544669151306, -1.7786482572555542, -0.40248817205429077, 0.10567931085824966, 0.5439082980155945, -1.175825834274292, 1.5659809112548828, 0.8806692957878113, 1.952669382095337, 0.8794432878494263, -0.35679447650909424, 1.4079978466033936, -0.04792486131191254, 1.8868674039840698, -0.5774276852607727, 0.633856475353241, -0.14374090731143951, -1.1332954168319702, 0.8929111361503601, -0.3149415850639343, -2.0530741214752197, -0.7859876751899719, -0.9317266345024109, -0.17151664197444916, -0.7230732440948486, 1.1089380979537964, -0.1996644288301468, -1.525886058807373, 0.10224015265703201, -0.5881288051605225, 0.1425301730632782, -1.3373428583145142, 0.29722070693969727, 0.6747135519981384, -0.539573073387146, -0.03622645512223244, -0.2778777778148651, -1.2941216230392456, -0.5214964151382446, 0.2148621529340744, 1.8482784032821655, -0.8367100954055786, 0.969963550567627, 0.9059675335884094, -0.8155782222747803, -0.00784040242433548, 0.22958315908908844, -0.1495600938796997, 0.9095438122749329, -1.1506823301315308, -0.4645351767539978, 1.0889052152633667, -0.023016473278403282, -0.6520290970802307, 1.5582280158996582, 0.6517342329025269, -1.0413739681243896, -0.09825797379016876, -0.240965336561203, -0.8504342436790466, -0.10657530277967453, -1.6457570791244507, -0.21461401879787445, 0.09934218227863312, -1.445350170135498, -0.58322674036026, -0.24017301201820374, 1.331076741218567, -0.21757957339286804, 1.1681476831436157, -0.24811623990535736, -0.30238983035087585, -0.3935704827308655, -0.27677223086357117, 0.17547038197517395, -0.2190638780593872, -0.6352764368057251, 0.2161196917295456, -0.8411107659339905, 0.337533175945282, 1.4666045904159546, 0.45012807846069336, 0.07226455211639404, 0.6716434359550476, 1.009971022605896, 0.37841489911079407, -0.0726676657795906, -0.8912848830223083, -1.5393261909484863, 1.9991250038146973, -1.5048494338989258, 1.8333684206008911, 0.631981372833252, -0.028560541570186615, -1.772376537322998, -1.9196032285690308, 1.4655518531799316, 1.2781282663345337, 2.289870023727417, 0.7045901417732239, 0.415520042181015, -0.8330684304237366, -0.6122713685035706, 0.27304333448410034, -1.0056378841400146, -0.6491404175758362, 0.15432322025299072, 2.2811594009399414, 1.7667629718780518, -0.682774543762207, -0.22396130859851837, -1.027770757675171, 1.2628978490829468, -0.07677622884511948, 0.24404989182949066, 2.040111780166626, -0.257212370634079, -1.051286220550537, 1.228170394897461, -2.292346715927124, 0.09960106760263443, 1.9800299406051636, 0.28082141280174255, 0.1478790044784546, -1.5136284828186035, -0.6632087230682373, -0.05890704691410065, -0.4641559422016144, -1.3468810319900513, 0.5715753436088562, -0.359819620847702, -0.7720566987991333, -1.4504432678222656, 0.2556073069572449, -1.0938674211502075, -1.6628670692443848, 0.34232744574546814, 1.9182708263397217, 1.8099257946014404, -0.7076051235198975, 1.5454044342041016, -0.3385572135448456, 0.25398752093315125, 1.355347752571106, 0.999381422996521, 2.991583824157715, 1.934905767440796, -1.2811071872711182, 0.739983081817627, -0.049158304929733276, -0.5923287868499756, 1.2175501585006714, -0.9995681047439575, 1.2340307235717773, -0.31852269172668457, -1.2119109630584717, -1.245164394378662, 0.8992176651954651, 0.5064811110496521, 0.20429076254367828, -0.48909708857536316, 1.273371696472168, 0.03156818449497223, 1.2104054689407349, 0.5323679447174072, -0.4653416574001312, 0.7256741523742676, -0.4313351809978485, -0.33188700675964355, 1.5821813344955444, 0.26541614532470703, -1.2575063705444336, -2.2999119758605957, -0.20343896746635437, -0.8636547327041626, -0.01726648211479187, -0.56776362657547, -0.986655056476593, 1.6039923429489136, 0.5418140292167664, -1.3590261936187744, -0.3389226496219635, -0.3360871374607086, -0.6009715795516968, 2.649078845977783, -1.4166553020477295, -0.23634320497512817, -0.9836699962615967, -0.4885379374027252, 1.7843462228775024, -1.1856305599212646, -0.2062435746192932, -1.1766464710235596, -0.6056616902351379, -1.3906879425048828, -0.6203935146331787, -0.03053615614771843, -0.8610631823539734, 0.985894501209259, 0.053070493042469025, -1.1280931234359741, -0.3099353015422821, -0.7965558171272278, 0.7850868701934814, -0.13927705585956573, 0.31182268261909485, 1.9910080432891846, 0.4682869017124176, -0.40678882598876953, 0.5997264981269836, 1.0557234287261963, 0.5994095206260681, -0.5916662812232971, 0.4179162085056305, -0.6104310154914856, 0.259515643119812, -1.4226452112197876, 0.168776735663414, -3.030409812927246, 0.5921470522880554, -0.006235199049115181, 0.09179692715406418, -0.08506696671247482, -1.3974453210830688, 1.1085436344146729, 2.5954771041870117, -1.2088350057601929, 0.3908434808254242, 0.3688216209411621, 1.1737030744552612, -1.5387382507324219, 0.25104668736457825, -0.4203246533870697, 2.1644935607910156, 0.07388070225715637, 1.217901349067688, -0.5212564468383789, -2.1381566524505615, 0.6799524426460266, -1.164953351020813, -1.2103540897369385, 0.6468411684036255, -0.7525155544281006, 0.08185554295778275, -1.5100737810134888, -0.10315278172492981, -0.9013118743896484, -1.2855406999588013, 0.976179838180542, 0.2341195046901703, 0.31528982520103455, -0.7175639867782593, 0.3934636116027832, -2.130896806716919, -1.3466870784759521, -0.2176239788532257, -0.8931381106376648, 0.4532902240753174, -0.3937566578388214, 0.6559665203094482, -0.11629962921142578, 0.08929544687271118, 0.26813873648643494, 1.2317575216293335, 3.514277935028076, 0.2688817083835602, 0.34110942482948303, -0.025351673364639282, -0.8509639501571655, 1.610904335975647, 1.105493426322937, 0.018410298973321915, -0.5362077355384827, -0.9862743616104126, 1.1941736936569214, 1.9446853399276733, 0.9242578744888306, 0.0020964480936527252, -0.8209967613220215, -0.6119163632392883, 0.022013092413544655, 0.1962704360485077, 0.4966742694377899, 0.8522199988365173, 0.08021028339862823, 0.028323983773589134, 1.4463095664978027, 1.1006582975387573, -0.43375515937805176, 0.4873649477958679, -0.8216132521629333, -0.4847203195095062, 0.5472561120986938, 0.4646909236907959, 0.2313341647386551, 0.34173446893692017, -1.0897454023361206, -0.28752344846725464, -0.1364237517118454, -0.9994019269943237, -0.6972747445106506, -0.5408945083618164, -0.38320112228393555, 1.562563419342041, -0.04811646789312363, -0.5372501611709595, -0.1234956681728363, -0.8452147841453552, 0.018853066489100456, -1.0820621252059937, 0.3412185311317444, -0.1577467918395996, -0.05281955748796463, -0.11986198276281357, 1.72068190574646, -0.94466632604599, -2.1363959312438965, 0.29658031463623047, 0.41718465089797974, -0.49284878373146057, 0.21681581437587738, 1.5765835046768188, 0.6568124890327454, 1.3552287817001343, 1.3831449747085571, 1.0253809690475464, -0.6423624753952026, -1.2979209423065186, 0.4953613579273224, 0.904377818107605, -1.4167968034744263, 0.7129986882209778, 0.15719838440418243, -0.46693184971809387, 0.6619290709495544, 1.4234215021133423, 0.4958589971065521, -1.9956437349319458, 0.7538760304450989, -0.6998088955879211, 0.8269060254096985, 0.7361060976982117, 0.8486605882644653, 0.20022930204868317, 0.8464006781578064, -1.2949187755584717, -1.1913840770721436, -0.8570454716682434, -0.677078366279602, 1.9583383798599243, -0.17586112022399902, 0.5973135232925415, -0.19276182353496552, -1.2880738973617554, -0.050034187734127045, 0.6721442341804504, 0.46125146746635437, -0.4135870337486267, 0.7689706683158875, -0.4892979860305786, -1.073562502861023, -1.319335699081421, -0.4344312250614166, -0.8621979355812073, -0.8737315535545349, 0.9399441480636597, 0.8812157511711121, 0.43205544352531433, 1.858467936515808, 0.5912578105926514, 0.14451946318149567, -2.625417709350586, 0.867009699344635, 0.3524588942527771, 0.0484100803732872, 0.8759228587150574, 0.35508936643600464, 1.0064085721969604, -0.0621953010559082, 0.5296123623847961, -2.259235143661499, 2.238023519515991, -0.2359054982662201, 0.49683520197868347, 0.08185140788555145, -0.24311122298240662, 1.151384949684143, 0.5189074277877808, 0.518785297870636, -1.2064019441604614, 0.7478548884391785, -0.6332767009735107, 1.246537446975708, 0.8947015404701233, -0.6657533645629883, -0.023560641333460808, 1.264552116394043, 0.593248188495636, -0.39095890522003174, -0.9754316210746765, -0.8309870958328247, 0.9605280160903931, 1.6706671714782715, 0.01339111477136612, -0.0033793416805565357, 0.9077103734016418, 0.7315250039100647, -1.261843204498291, 0.0411217138171196, -0.7852075695991516, -0.627388060092926, 1.6407595872879028, 2.0175886154174805, -0.07885686308145523, -0.17583084106445312, -0.7586859464645386, -1.1522254943847656, 0.7988607287406921, 0.0462343767285347, 0.020926740020513535, 0.7182151079177856, -0.6347909569740295, 1.2147433757781982, 0.8758325576782227, 0.8927394151687622, -0.007830627262592316, 0.5527582168579102, 0.3607045114040375, -0.2515239715576172, -1.2726742029190063, -0.19947350025177002, -1.1115617752075195, -2.3960185050964355, 0.49468621611595154, -0.2182348519563675, -1.3383389711380005, -0.048225902020931244, -1.203977108001709, 0.9642649292945862, -0.5920372009277344, -1.1571813821792603, -1.5939429998397827, 0.17223259806632996, -0.013419553637504578, 0.8418879508972168, -1.497913122177124, -0.015507180243730545, 1.3541923761367798, 0.8205084204673767, -0.7745149731636047, 0.9909161329269409, 0.1739351600408554, 1.0686784982681274, 0.8185648918151855, -0.3780095875263214, 0.47621074318885803, 0.028382258489727974, -1.364011526107788, 0.5445683598518372, 1.1337889432907104, 0.0962761640548706, 1.46462881565094, -0.5541441440582275, 0.08984940499067307, 0.5646427273750305, -0.6320067048072815, -0.52081298828125, -0.6432287693023682, 0.713931143283844, 0.1584918051958084, -0.9548470377922058, 0.1144370585680008, 0.04512815177440643, -0.09281118214130402, 0.27859169244766235, -1.436614990234375, -0.27234411239624023, -0.3626275956630707, -0.4990527331829071, -1.2604848146438599, -0.06997988373041153, 1.3585355281829834, -0.588183581829071, -0.2470542937517166, 0.5617128610610962, 0.32201626896858215, 0.4978487193584442, 0.5645314455032349, -0.621120035648346, -0.3458765745162964, -0.29420945048332214, -0.3551907241344452, 0.25881701707839966, 1.2762582302093506, -0.15935565531253815, -1.0724209547042847, 0.7442335486412048, -0.36215120553970337, 0.017339114099740982, 1.9664523601531982, 0.036857299506664276, -0.9439635872840881, 0.3116343021392822, -0.7120130658149719, 1.8347210884094238, 1.7357653379440308, 1.4108891487121582, -0.03515009582042694, -0.9547003507614136, 0.48042550683021545, -0.287457674741745, -0.42828860878944397, 0.872846782207489, 0.4220629334449768, -0.12556923925876617, -1.3176753520965576, 0.5195237994194031, 1.44948148727417, -0.9329947829246521, -0.9059969782829285, 0.14419065415859222, -0.7459110617637634, 1.0148837566375732, 0.7453619241714478, 0.4538014233112335, 0.3197234272956848, 1.5629628896713257, 0.5795687437057495, -0.30842524766921997, 0.46332257986068726, 0.47413498163223267, -0.14667758345603943, -2.0783023834228516, -1.1657673120498657, 0.4052286446094513, -0.5696950554847717, -1.5909004211425781, 1.398663878440857, -1.2442573308944702, -0.8794247508049011, 0.4619210660457611, 0.1472674459218979, 1.5528591871261597, 0.3592660427093506, 1.653972864151001, 2.0153861045837402, 0.9873365759849548, 0.2110673487186432, 1.4474364519119263, -0.09291965514421463, -0.48568400740623474, 1.9112887382507324, -0.5038449168205261, 0.5041450262069702, 1.0688120126724243, -0.3748938739299774, -1.104178547859192, -0.8455832004547119, -1.2370234727859497, -0.618656575679779, 1.0480002164840698, 0.21731849014759064, -1.298871636390686, 0.19653001427650452, 1.4978725910186768, 0.09082506597042084, -0.237228125333786, 0.6664077043533325, 0.320913165807724, -0.9863424897193909, -0.04406856745481491, -0.9526877999305725, 0.4081897437572479, -0.26159676909446716, -0.32759833335876465, 0.27326443791389465, 0.5608687400817871, 1.2920702695846558, -0.04104109853506088, 0.1566123068332672, 1.1987040042877197, -1.3532378673553467, 1.5084474086761475, -0.7321042418479919, 0.28701162338256836, -2.5161125659942627, 1.4731827974319458, -0.7173172831535339, 1.8489649295806885, -2.699666738510132, 0.32532060146331787, -0.460750937461853, -0.3755767047405243, 0.30650514364242554, -0.4584706723690033, 0.06118492782115936, -0.07381893694400787, -1.2102506160736084, 0.06712644547224045, -0.8200616240501404, 0.5609237551689148, 1.240346908569336, 1.4081028699874878, -1.1308932304382324, -0.2591353952884674, -1.8437389135360718, -0.146218404173851, -0.6330598592758179, 0.5030463337898254, -2.0920908451080322, -0.09221701323986053, -1.9179720878601074, -2.2927908897399902, -1.243259310722351, -0.8786823153495789, 0.968763530254364, 0.1120254322886467, -0.8924058079719543, 0.8169090151786804, -0.3533972203731537, -1.694316029548645, 1.0388000011444092, -2.109398603439331 ]
https://github.com/huggingface/datasets/issues/3658
Dataset viewer issue for *P3*
``` Error code: SplitsNamesError Exception: SplitsNotFoundError Message: The split names could not be parsed from the dataset config. Traceback: Traceback (most recent call last): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 354, in get_dataset_config_info for split_generator in builder._split_generators( File "/tmp/modules-cache/datasets_modules/datasets/bigscience--P3/12c0badfecad4564ecb8a6f81b5d0559656f269f08b13c59c93283f3a84134ba/P3.py", line 154, in _split_generators data_dir = dl_manager.download_and_extract(_URLs) 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 393, in map_nested mapped = [ File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 394, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 346, in <dictcomp> return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 346, in <dictcomp> return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 330, in _single_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 402, in _get_extraction_protocol return _get_extraction_protocol_with_magic_number(f) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 367, in _get_extraction_protocol_with_magic_number magic_number = f.read(MAGIC_NUMBER_MAX_LENGTH) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 574, in read return super().read(length) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 1575, in read out = self.cache._fetch(self.loc, self.loc + length) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/caching.py", line 377, in _fetch self.cache = self.fetcher(start, bend) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/asyn.py", line 111, in wrapper return sync(self.loop, func, *args, **kwargs) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/asyn.py", line 96, in sync raise return_result File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/asyn.py", line 53, in _runner result[0] = await coro File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 616, in async_fetch_range out = await r.read() File "/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1036, in read self._body = await self.content.read() File "/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/streams.py", line 375, in read block = await self.readany() File "/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/streams.py", line 397, in readany await self._wait("readany") File "/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/streams.py", line 304, in _wait await waiter aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/src/services/worker/src/worker/responses/splits.py", line 75, in get_splits_response split_full_names = get_dataset_split_full_names(dataset, hf_token) File "/src/services/worker/src/worker/responses/splits.py", line 35, in get_dataset_split_full_names return [ File "/src/services/worker/src/worker/responses/splits.py", line 38, in <listcomp> for split in get_dataset_split_names(dataset, config, use_auth_token=hf_token) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 404, in get_dataset_split_names info = get_dataset_config_info( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 359, in get_dataset_config_info raise SplitsNotFoundError("The split names could not be parsed from the dataset config.") from err datasets.inspect.SplitsNotFoundError: The split names could not be parsed from the dataset config. ```
## Dataset viewer issue for '*P3*' **Link: https://huggingface.co/datasets/bigscience/P3** ``` Status code: 400 Exception: SplitsNotFoundError Message: The split names could not be parsed from the dataset config. ``` Am I the one who added this dataset ? No
975
393
Dataset viewer issue for *P3* ## Dataset viewer issue for '*P3*' **Link: https://huggingface.co/datasets/bigscience/P3** ``` Status code: 400 Exception: SplitsNotFoundError Message: The split names could not be parsed from the dataset config. ``` Am I the one who added this dataset ? No ``` Error code: SplitsNamesError Exception: SplitsNotFoundError Message: The split names could not be parsed from the dataset config. Traceback: Traceback (most recent call last): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 354, in get_dataset_config_info for split_generator in builder._split_generators( File "/tmp/modules-cache/datasets_modules/datasets/bigscience--P3/12c0badfecad4564ecb8a6f81b5d0559656f269f08b13c59c93283f3a84134ba/P3.py", line 154, in _split_generators data_dir = dl_manager.download_and_extract(_URLs) 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 393, in map_nested mapped = [ File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 394, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 346, in <dictcomp> return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 346, in <dictcomp> return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 330, in _single_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 402, in _get_extraction_protocol return _get_extraction_protocol_with_magic_number(f) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 367, in _get_extraction_protocol_with_magic_number magic_number = f.read(MAGIC_NUMBER_MAX_LENGTH) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 574, in read return super().read(length) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 1575, in read out = self.cache._fetch(self.loc, self.loc + length) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/caching.py", line 377, in _fetch self.cache = self.fetcher(start, bend) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/asyn.py", line 111, in wrapper return sync(self.loop, func, *args, **kwargs) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/asyn.py", line 96, in sync raise return_result File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/asyn.py", line 53, in _runner result[0] = await coro File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 616, in async_fetch_range out = await r.read() File "/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1036, in read self._body = await self.content.read() File "/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/streams.py", line 375, in read block = await self.readany() File "/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/streams.py", line 397, in readany await self._wait("readany") File "/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/streams.py", line 304, in _wait await waiter aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/src/services/worker/src/worker/responses/splits.py", line 75, in get_splits_response split_full_names = get_dataset_split_full_names(dataset, hf_token) File "/src/services/worker/src/worker/responses/splits.py", line 35, in get_dataset_split_full_names return [ File "/src/services/worker/src/worker/responses/splits.py", line 38, in <listcomp> for split in get_dataset_split_names(dataset, config, use_auth_token=hf_token) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 404, in get_dataset_split_names info = get_dataset_config_info( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 359, in get_dataset_config_info raise SplitsNotFoundError("The split names could not be parsed from the dataset config.") from err datasets.inspect.SplitsNotFoundError: The split names could not be parsed from the dataset config. ```
[ -1.1426880359649658, -0.8961902856826782, -0.6254259347915649, 1.3873069286346436, -0.15059128403663635, -1.28842031955719, 0.11905185133218765, -1.0660779476165771, 1.5911173820495605, -0.6981656551361084, 0.20036183297634125, -1.6570566892623901, -0.09277589619159698, -0.44849246740341187, -0.6903188824653625, -0.8561002612113953, -0.3978186547756195, -0.9304412007331848, 1.0158368349075317, 2.4703147411346436, 1.311759352684021, -1.356685757637024, 2.78011417388916, 0.7160575985908508, -0.2685316801071167, -1.0060170888900757, 0.5846778154373169, 0.01737227663397789, -1.2604824304580688, -0.42736315727233887, -0.947150468826294, 0.005409007892012596, -0.5585249662399292, -0.33305469155311584, 0.1052352711558342, 0.45696353912353516, -0.2719867527484894, -0.24430371820926666, -0.672694981098175, -0.7583153247833252, 0.5258362293243408, -0.35694700479507446, 0.934228777885437, -0.3245178461074829, 1.7327741384506226, -0.5656041502952576, 0.3536578416824341, 0.7471976280212402, 1.2723954916000366, 0.1179332360625267, -0.019249459728598595, 0.23920586705207825, 0.31132060289382935, -0.0075599430128932, 0.5138554573059082, 1.2601441144943237, 0.5736813545227051, 0.5197996497154236, 0.6066603660583496, -2.236964225769043, 1.3209885358810425, -0.8962820768356323, 0.23997192084789276, 1.321110486984253, -0.9361485242843628, 0.3314633369445801, -1.8247922658920288, -0.024435658007860184, 0.6279295682907104, -2.306248664855957, 0.31354567408561707, -1.2818083763122559, -0.5477384924888611, 0.9109578132629395, 0.2916984260082245, -1.1966526508331299, 0.18107281625270844, -0.5335814952850342, 1.1315431594848633, 0.5074715614318848, 1.1107127666473389, -1.7430624961853027, -0.010495549999177456, -0.19259577989578247, 0.0821981281042099, -1.344159483909607, -1.7051273584365845, 0.5858177542686462, 0.6437321305274963, 0.7243239283561707, -0.1077452003955841, 1.0551131963729858, -1.0893011093139648, 0.81474369764328, -0.9602419137954712, -1.5831575393676758, -1.3735759258270264, -2.396627902984619, -2.2167069911956787, 0.8119820356369019, -0.503658652305603, -0.5020641088485718, 2.060537099838257, -1.0091413259506226, -1.729769229888916, 1.0558812618255615, 0.2992182672023773, 0.05209842696785927, 2.3048324584960938, 0.26370999217033386, -0.7417733073234558, 0.36330124735832214, -0.6873002648353577, 0.8124101758003235, -0.3105035126209259, 1.314370036125183, 0.5605026483535767, -0.9804235696792603, 1.6485772132873535, -0.42885029315948486, 0.6109569072723389, -0.6216781735420227, -0.5323249101638794, -0.7863611578941345, 0.2767601013183594, 1.8907246589660645, -0.4077701270580292, 1.559950590133667, -0.3104308247566223, -1.573235034942627, -1.4983681440353394, 0.8538886308670044, 0.5628395676612854, -0.8878113031387329, 0.06777334213256836, -0.47362446784973145, 0.1322028934955597, -0.09467705339193344, 1.0658955574035645, 1.217117428779602, 0.7062222361564636, -0.3324401378631592, -0.8107158541679382, 0.2359222173690796, -0.14526398479938507, -0.664306640625, -1.8469456434249878, -0.3185637891292572, 0.22528968751430511, 0.674904465675354, -1.245402455329895, 1.814355492591858, 0.8840659260749817, 1.9727911949157715, 0.945223867893219, -0.41462141275405884, 1.4596071243286133, -0.030922599136829376, 1.8073697090148926, -0.4999343752861023, 0.6301203966140747, -0.31709426641464233, -1.1414916515350342, 0.9020767211914062, -0.32003599405288696, -2.004305124282837, -0.7878714203834534, -0.7695009708404541, -0.14828641712665558, -0.7344664335250854, 0.8903735876083374, -0.3130839169025421, -1.5120841264724731, 0.05945954471826553, -0.6178352236747742, 0.17970329523086548, -1.2509126663208008, 0.17107930779457092, 0.671829342842102, -0.6558027863502502, -0.08027473092079163, -0.31286635994911194, -1.2919036149978638, -0.4809507131576538, 0.3893490135669708, 1.9281039237976074, -0.5189350247383118, 0.9472278356552124, 1.0026683807373047, -0.7502379417419434, 0.1173207238316536, 0.2179042398929596, -0.2737007439136505, 0.8041934370994568, -1.1689869165420532, -0.44154736399650574, 1.1190985441207886, -0.2198999971151352, -0.6905542016029358, 1.4224133491516113, 0.7453545331954956, -1.1302931308746338, -0.27908799052238464, -0.23160646855831146, -0.8488019108772278, -0.0006696470081806183, -1.5483871698379517, -0.2427818328142166, 0.3340778648853302, -1.5061092376708984, -0.32070308923721313, -0.20182006061077118, 1.3926674127578735, -0.23941242694854736, 1.4355483055114746, -0.3157104551792145, -0.1283961534500122, -0.23669221997261047, -0.501733124256134, 0.18877415359020233, -0.16227124631404877, -0.565193772315979, 0.24064885079860687, -0.9002344608306885, 0.2688291370868683, 1.5306637287139893, 0.36518844962120056, 0.041944652795791626, 0.5543406009674072, 1.0471222400665283, 0.3886920213699341, -0.10563504695892334, -0.8609171509742737, -1.5582400560379028, 1.9586232900619507, -1.4747473001480103, 1.9082244634628296, 0.815412700176239, -0.0800626203417778, -1.838391900062561, -1.8499500751495361, 1.2082092761993408, 1.1339470148086548, 2.309687852859497, 0.5158816576004028, 0.4276120960712433, -0.7201897501945496, -0.7678871750831604, 0.4147252142429352, -1.0144010782241821, -0.5957331657409668, 0.24013350903987885, 2.3463211059570312, 1.7657016515731812, -0.5752073526382446, -0.26192957162857056, -0.8627609610557556, 1.2265821695327759, -0.228400319814682, 0.2521958649158478, 2.0820231437683105, -0.2874799370765686, -0.9994761347770691, 1.3182238340377808, -2.381000518798828, 0.3127453327178955, 2.015451669692993, 0.2800554633140564, 0.13557027280330658, -1.3733490705490112, -0.6634997129440308, -0.2636553645133972, -0.4562157392501831, -1.2261791229248047, 0.5686916708946228, -0.33682745695114136, -0.8495571613311768, -1.408164381980896, 0.07680869847536087, -1.1256530284881592, -1.8319942951202393, 0.363330602645874, 1.9887393712997437, 2.070768117904663, -0.7982321381568909, 1.3978906869888306, -0.30840909481048584, 0.0009772665798664093, 1.2701486349105835, 1.2772729396820068, 3.076963186264038, 1.8005332946777344, -1.314182162284851, 0.7567558884620667, -0.14051981270313263, -0.44459304213523865, 1.1170287132263184, -1.0613877773284912, 1.0693401098251343, -0.24631230533123016, -1.2196180820465088, -1.1609691381454468, 1.1012234687805176, 0.5029252171516418, 0.02689247578382492, -0.4930245578289032, 1.2368345260620117, 0.09748426079750061, 1.3403781652450562, 0.6000013947486877, -0.48850974440574646, 0.5787056684494019, -0.3340137302875519, -0.564007580280304, 1.6536738872528076, 0.17907139658927917, -1.473710536956787, -2.3763670921325684, -0.25924503803253174, -0.8494536876678467, -0.030898991972208023, -0.6127604842185974, -1.012903094291687, 1.5529100894927979, 0.42449331283569336, -1.2340435981750488, -0.2688376009464264, -0.341106116771698, -0.5084783434867859, 2.5860140323638916, -1.273167610168457, -0.09803734719753265, -0.9560984969139099, -0.5328494906425476, 1.6013153791427612, -1.232564091682434, -0.2747953236103058, -1.0264440774917603, -0.6335484981536865, -1.3190687894821167, -0.4990455210208893, 0.06647627800703049, -0.9449067115783691, 0.7741384506225586, 0.10988045483827591, -1.0879000425338745, -0.2973564863204956, -0.8480367660522461, 1.0656111240386963, -0.08925919979810715, 0.1953914761543274, 1.8657734394073486, 0.3324127793312073, -0.435179203748703, 0.6878637671470642, 1.161378264427185, 0.6208682656288147, -0.6239321231842041, 0.03765106201171875, -0.6787853240966797, 0.3476893901824951, -1.4516140222549438, 0.23083381354808807, -3.002819776535034, 0.8037277460098267, -0.1509438455104828, -0.06316960602998734, -0.11286655068397522, -1.3853034973144531, 0.9989070296287537, 2.639397144317627, -1.18558931350708, 0.5006994605064392, 0.4437220096588135, 1.0979806184768677, -1.5789934396743774, 0.2803881764411926, -0.49300411343574524, 2.065030813217163, 0.1594112664461136, 1.2672652006149292, -0.5414198040962219, -2.1684486865997314, 0.697437047958374, -1.1398147344589233, -1.0517958402633667, 0.8118143677711487, -0.8949128985404968, 0.3328416347503662, -1.4166094064712524, -0.1361839920282364, -0.942966103553772, -1.2696311473846436, 0.7007688283920288, 0.128395676612854, 0.37431642413139343, -0.5769401788711548, 0.3310015797615051, -2.1660079956054688, -1.3282794952392578, -0.19807235896587372, -0.9823607802391052, 0.5713431239128113, -0.40470731258392334, 0.5183030366897583, -0.010418614372611046, 0.13104721903800964, 0.2709585130214691, 1.4190683364868164, 3.4460461139678955, 0.08849632740020752, 0.14781855046749115, -0.07892084866762161, -1.0313853025436401, 1.4480746984481812, 0.8917424082756042, -0.11014534533023834, -0.6805399060249329, -1.0610666275024414, 1.3202229738235474, 2.004037380218506, 1.079487919807434, 0.12107077986001968, -0.8234047889709473, -0.7399135828018188, 0.06696803122758865, 0.17569325864315033, 0.5839362740516663, 0.9462710618972778, -0.039253029972314835, 0.050216179341077805, 1.3990284204483032, 1.2101376056671143, -0.3485601246356964, 0.414734423160553, -0.9471326470375061, -0.4073980152606964, 0.3401637375354767, 0.2655053734779358, 0.09345055371522903, 0.48623156547546387, -1.0751914978027344, -0.2898072600364685, -0.27376213669776917, -0.9047011733055115, -0.783922016620636, -0.4332791566848755, -0.4113403558731079, 1.643884539604187, 0.0821102112531662, -0.4490922689437866, 0.004650764167308807, -0.7071061134338379, -0.12682442367076874, -1.1105715036392212, 0.2128840982913971, -0.050596896559000015, -0.05245942994952202, -0.20474286377429962, 1.6391105651855469, -0.8945237398147583, -2.1212270259857178, 0.18658429384231567, 0.3200874626636505, -0.35828182101249695, 0.2001955658197403, 1.7482929229736328, 0.5042883157730103, 1.3040834665298462, 1.2929449081420898, 0.9626574516296387, -0.5772625207901001, -1.175923466682434, 0.6522601842880249, 0.9386518001556396, -1.3777495622634888, 0.8936753273010254, -0.15276429057121277, -0.5408191680908203, 0.7076390385627747, 1.4101078510284424, 0.45940476655960083, -2.027679920196533, 0.9301880598068237, -0.9010146856307983, 0.6933647990226746, 0.7338621616363525, 0.8201831579208374, 0.2403881698846817, 0.9438632726669312, -1.2851121425628662, -1.1728250980377197, -0.7214720845222473, -0.6280034184455872, 1.9571629762649536, -0.2589285969734192, 0.541929304599762, -0.16987831890583038, -1.2319425344467163, -0.08745263516902924, 0.796427845954895, 0.3923070430755615, -0.4116710424423218, 0.8964686989784241, -0.6165406107902527, -0.9763843417167664, -1.2915279865264893, -0.42669299244880676, -0.9825699925422668, -0.8404639363288879, 0.9480246901512146, 0.7586238384246826, 0.46195098757743835, 2.0154261589050293, 0.5484462380409241, 0.28368300199508667, -2.6080784797668457, 0.8480837941169739, 0.3452529013156891, -0.025677945464849472, 0.9346795678138733, 0.20888879895210266, 1.101889729499817, 0.0016497056931257248, 0.5930037498474121, -2.2946934700012207, 2.2457358837127686, -0.2416837215423584, 0.6588408946990967, 0.06088819354772568, -0.21610386669635773, 1.1377944946289062, 0.5873843431472778, 0.5963143706321716, -1.1263034343719482, 0.7663817405700684, -0.5796328783035278, 1.0602295398712158, 0.968679666519165, -0.9209571480751038, 0.02560293674468994, 1.3968570232391357, 0.46857553720474243, -0.4509228467941284, -0.9588412046432495, -0.8460403084754944, 0.942807137966156, 1.7296600341796875, -0.06380245089530945, 0.02698381617665291, 0.7945265769958496, 0.6762802600860596, -1.2468340396881104, 0.06701848655939102, -0.7120336890220642, -0.6959672570228577, 1.6931865215301514, 2.02307391166687, -0.10404982417821884, -0.2101639360189438, -0.6964017152786255, -1.3056057691574097, 0.8011258840560913, -0.13446345925331116, 0.06922033429145813, 0.6872361898422241, -0.6386621594429016, 1.111910104751587, 0.602474570274353, 1.0503065586090088, -0.007714017294347286, 0.32696202397346497, 0.41747620701789856, -0.34408488869667053, -1.1847418546676636, -0.3576481342315674, -1.1089844703674316, -2.6116950511932373, 0.4601685404777527, -0.2083025574684143, -1.4394015073776245, 0.03658131882548332, -1.056583285331726, 0.8821380734443665, -0.5964946150779724, -1.150688886642456, -1.4526885747909546, 0.3681005537509918, -0.18427100777626038, 0.9240397214889526, -1.6350326538085938, -0.24135060608386993, 1.2685796022415161, 0.8864400386810303, -0.6035547256469727, 0.9765622019767761, 0.16097033023834229, 0.9681339859962463, 0.7921954989433289, -0.42246100306510925, 0.5912593007087708, 0.026064645498991013, -1.3187825679779053, 0.46646609902381897, 1.234844446182251, 0.16847951710224152, 1.414103388786316, -0.4540584087371826, 0.1453266143798828, 0.48391416668891907, -0.7179499864578247, -0.559231162071228, -0.4038080871105194, 0.7343019843101501, 0.03747626021504402, -1.024793267250061, -0.18734797835350037, -0.17812104523181915, -0.2556825876235962, 0.19043460488319397, -1.4426275491714478, -0.29524484276771545, -0.3755034804344177, -0.40800198912620544, -1.3781558275222778, -0.027440909296274185, 1.3184682130813599, -0.7757251262664795, -0.28174957633018494, 0.41582196950912476, 0.45058998465538025, 0.5779650211334229, 0.5978665351867676, -0.8009116649627686, -0.31690385937690735, -0.3346416652202606, -0.32295912504196167, 0.3306635022163391, 1.1941113471984863, -0.04289836436510086, -0.990567684173584, 0.6642820835113525, -0.3188299536705017, 0.1942661702632904, 2.03342342376709, -0.003761124797165394, -0.7292235493659973, 0.3334181308746338, -0.7393333911895752, 1.7226390838623047, 1.7056394815444946, 1.2343758344650269, -0.07081857323646545, -0.7991880774497986, 0.5895963907241821, -0.3079494833946228, -0.32108381390571594, 0.8656097054481506, 0.4309794306755066, -0.20666469633579254, -1.4125092029571533, 0.643129825592041, 1.324004888534546, -0.7808646559715271, -0.7488962411880493, 0.0323881171643734, -0.856135904788971, 1.248422384262085, 0.5037413239479065, 0.2884068191051483, 0.30030980706214905, 1.6066190004348755, 0.6985853314399719, -0.4523082375526428, 0.5046983361244202, 0.4566880464553833, -0.2001531422138214, -2.1726555824279785, -1.0308551788330078, 0.3874099552631378, -0.425525963306427, -1.6024727821350098, 1.408239483833313, -1.1505374908447266, -1.0327386856079102, 0.5097940564155579, 0.11718816310167313, 1.289074420928955, 0.3697633147239685, 1.724355697631836, 2.1064789295196533, 0.9394581913948059, 0.36765700578689575, 1.2750868797302246, -0.04556114226579666, -0.4237736165523529, 1.8422307968139648, -0.44277238845825195, 0.4730285704135895, 1.0083422660827637, -0.37619417905807495, -1.0790146589279175, -0.817599892616272, -1.1637641191482544, -0.64925616979599, 1.1929678916931152, 0.08606958389282227, -1.0820918083190918, 0.20998167991638184, 1.5998972654342651, 0.14658620953559875, -0.10893682390451431, 0.7071300148963928, 0.3788910210132599, -0.7267397046089172, -0.1095268577337265, -0.8643778562545776, 0.465577095746994, -0.14619840681552887, -0.36893340945243835, 0.21656209230422974, 0.593440592288971, 1.3487441539764404, -0.06264163553714752, 0.10431476682424545, 1.1805814504623413, -1.4065486192703247, 1.5224065780639648, -0.6319697499275208, 0.3144345283508301, -2.5161428451538086, 1.3691282272338867, -0.7345061898231506, 1.9965105056762695, -2.587135076522827, 0.4114932119846344, -0.44880688190460205, -0.4550674259662628, 0.23345549404621124, -0.4077771306037903, 0.10476940870285034, -0.11723286658525467, -0.9631475210189819, -0.05632667616009712, -0.7568294405937195, 0.6254922151565552, 1.2173758745193481, 1.4452519416809082, -1.1479777097702026, -0.17831456661224365, -1.7381548881530762, -0.16965049505233765, -0.7988529801368713, 0.31330224871635437, -1.9778048992156982, -0.17017845809459686, -2.026580333709717, -2.395643472671509, -1.3385834693908691, -0.8714123964309692, 1.0338413715362549, 0.14707441627979279, -0.9482344388961792, 1.0769875049591064, -0.3471582233905792, -1.8222742080688477, 1.1526670455932617, -2.2063629627227783 ]
https://github.com/huggingface/datasets/issues/3656
checksum error subjqa dataset
Hi @RensDimmendaal, I'm sorry but I can't reproduce your bug: ```python In [1]: from datasets import load_dataset ...: ds = load_dataset("subjqa", "electronics") Downloading builder script: 9.15kB [00:00, 4.10MB/s] Downloading metadata: 17.7kB [00:00, 8.51MB/s] Downloading and preparing dataset subjqa/electronics (download: 10.86 MiB, generated: 3.01 MiB, post-processed: Unknown size, total: 13.86 MiB) to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd... Downloading data: 11.4MB [00:03, 3.50MB/s] Dataset subjqa downloaded and prepared to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd. Subsequent calls will reuse this data. 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 605.09it/s] In [2]: ds Out[2]: DatasetDict({ train: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 1295 }) test: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 358 }) validation: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 255 }) }) ``` Could you please try again and see if the problem persists? If that is the case, you can circumvent the issue by passing `ignore_verifications`: ```python ds = load_dataset("subjqa", "electronics", ignore_verifications=True)
## Describe the bug I get a checksum error when loading the `subjqa` dataset (used in the transformers book). ## Steps to reproduce the bug ```python from datasets import load_dataset subjqa = load_dataset("subjqa","electronics") ``` ## Expected results Loading the dataset ## Actual results ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-2-d2857d460155> in <module>() 2 from datasets import load_dataset 3 ----> 4 subjqa = load_dataset("subjqa","electronics") 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 38 if len(bad_urls) > 0: 39 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 40 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 41 logger.info("All the checksums matched successfully" + for_verification_name) 42 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/lewtun/SubjQA/archive/refs/heads/master.zip'] ``` ## Environment info Google colab - `datasets` version: 1.18.2 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0
976
174
checksum error subjqa dataset ## Describe the bug I get a checksum error when loading the `subjqa` dataset (used in the transformers book). ## Steps to reproduce the bug ```python from datasets import load_dataset subjqa = load_dataset("subjqa","electronics") ``` ## Expected results Loading the dataset ## Actual results ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-2-d2857d460155> in <module>() 2 from datasets import load_dataset 3 ----> 4 subjqa = load_dataset("subjqa","electronics") 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 38 if len(bad_urls) > 0: 39 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 40 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 41 logger.info("All the checksums matched successfully" + for_verification_name) 42 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/lewtun/SubjQA/archive/refs/heads/master.zip'] ``` ## Environment info Google colab - `datasets` version: 1.18.2 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 Hi @RensDimmendaal, I'm sorry but I can't reproduce your bug: ```python In [1]: from datasets import load_dataset ...: ds = load_dataset("subjqa", "electronics") Downloading builder script: 9.15kB [00:00, 4.10MB/s] Downloading metadata: 17.7kB [00:00, 8.51MB/s] Downloading and preparing dataset subjqa/electronics (download: 10.86 MiB, generated: 3.01 MiB, post-processed: Unknown size, total: 13.86 MiB) to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd... Downloading data: 11.4MB [00:03, 3.50MB/s] Dataset subjqa downloaded and prepared to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd. Subsequent calls will reuse this data. 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 605.09it/s] In [2]: ds Out[2]: DatasetDict({ train: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 1295 }) test: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 358 }) validation: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 255 }) }) ``` Could you please try again and see if the problem persists? If that is the case, you can circumvent the issue by passing `ignore_verifications`: ```python ds = load_dataset("subjqa", "electronics", ignore_verifications=True)
[ -1.170517921447754, -0.7536989450454712, -0.5374830365180969, 1.4233942031860352, 0.025913327932357788, -1.3544694185256958, 0.09605385363101959, -0.8627185821533203, 1.6316784620285034, -0.8433938026428223, 0.36177197098731995, -1.7236298322677612, 0.019626159220933914, -0.6037812829017639, -0.63942551612854, -0.6467211246490479, -0.3068186938762665, -0.6568673253059387, 1.104724645614624, 2.4228498935699463, 1.1923357248306274, -1.3317265510559082, 2.8572208881378174, 0.5956296324729919, -0.30977126955986023, -0.8138771057128906, 0.3891567885875702, -0.018220480531454086, -1.4967153072357178, -0.26094263792037964, -1.0221611261367798, -0.029622219502925873, -0.6332626342773438, -0.5407837629318237, 0.1463230550289154, 0.47982338070869446, -0.1655627340078354, -0.3916233479976654, -0.44206398725509644, -0.7422446608543396, 0.5765579342842102, -0.2671881914138794, 0.8400483727455139, -0.29531458020210266, 1.7698217630386353, -0.629633367061615, 0.5432801246643066, 0.5354748368263245, 1.20821213722229, 0.23118631541728973, -0.013900868594646454, 0.4094025492668152, 0.1986735463142395, 0.06595940887928009, 0.62981778383255, 1.2087057828903198, 0.5808919072151184, 0.5534693002700806, 0.7548728585243225, -2.2046244144439697, 1.3163663148880005, -0.7960255742073059, 0.19806133210659027, 1.3260995149612427, -1.130005121231079, 0.4709348976612091, -1.8609260320663452, -0.11899920552968979, 0.35564106702804565, -2.3412578105926514, 0.12649625539779663, -1.3722933530807495, -0.556941568851471, 1.007440447807312, 0.33380216360092163, -1.1773535013198853, -0.031511444598436356, -0.3952537477016449, 0.943175733089447, 0.36015039682388306, 1.1508326530456543, -1.613999605178833, 0.0347885899245739, -0.18116025626659393, 0.28275978565216064, -1.1945918798446655, -1.667379379272461, 0.5873076915740967, 0.7110750079154968, 0.5724164247512817, -0.16493761539459229, 0.9007941484451294, -1.087678074836731, 0.7821059823036194, -0.9408550262451172, -1.834593653678894, -1.3977160453796387, -2.429985284805298, -2.3938181400299072, 0.8132843375205994, -0.4358343780040741, -0.333536297082901, 2.1297149658203125, -1.1191905736923218, -1.8009711503982544, 1.0514131784439087, 0.34059274196624756, -0.10854952037334442, 2.3312511444091797, 0.22770333290100098, -0.9594483971595764, 0.7330019474029541, -0.848483145236969, 0.647406280040741, -0.37165507674217224, 1.2538751363754272, 0.42180824279785156, -1.0656523704528809, 1.5944565534591675, -0.4247247278690338, 0.5716201663017273, -0.6725656986236572, -0.3809029757976532, -0.5343458652496338, 0.16779236495494843, 1.976709008216858, -0.17111076414585114, 1.5538907051086426, -0.08636868000030518, -1.4732351303100586, -1.3396707773208618, 0.6929491758346558, 0.5177829265594482, -0.7899866700172424, 0.21169905364513397, -0.3903923034667969, 0.1823577880859375, 0.13705572485923767, 1.0900191068649292, 1.2904516458511353, 0.8197625875473022, -0.16178588569164276, -0.8778819441795349, 0.11081399023532867, 0.021441668272018433, -0.5486076474189758, -1.7261663675308228, -0.2938403785228729, 0.17523311078548431, 0.6504093408584595, -1.1846946477890015, 1.9514274597167969, 0.8895688056945801, 2.0084149837493896, 0.9075891971588135, -0.34621888399124146, 1.6051939725875854, 0.05743856728076935, 1.891668677330017, -0.23558615148067474, 0.6538660526275635, -0.47417378425598145, -1.185258388519287, 0.6022502779960632, -0.33853331208229065, -1.9773727655410767, -0.3454647660255432, -0.9350790977478027, -0.083226278424263, -0.9041057229042053, 1.0603249073028564, -0.11414328962564468, -1.3655651807785034, 0.17223003506660461, -0.6776094436645508, 0.11948717385530472, -1.3991177082061768, 0.29334282875061035, 0.7065507173538208, -0.6892098784446716, 0.025936894118785858, -0.42879918217658997, -1.4023747444152832, -0.600990891456604, 0.4279769957065582, 1.7349114418029785, -0.6530307531356812, 1.0737680196762085, 1.0431149005889893, -0.6436014771461487, -0.05540192499756813, 0.5048896074295044, -0.4198567569255829, 0.969467043876648, -0.9867010116577148, -0.4220852851867676, 1.1466186046600342, -0.30120596289634705, -0.4513470232486725, 1.3210301399230957, 0.7150477766990662, -1.011206030845642, -0.34153881669044495, -0.10581845790147781, -0.838101863861084, 0.06723056733608246, -1.6174633502960205, -0.1305004358291626, 0.2548457384109497, -1.461566686630249, -0.4746010899543762, -0.02750789374113083, 1.3018800020217896, 0.0382067933678627, 1.3532989025115967, -0.19844955205917358, -0.1299382895231247, -0.5496340394020081, -0.550358772277832, 0.06727957725524902, -0.1346905529499054, -0.6297478675842285, 0.30167457461357117, -0.7451016902923584, 0.18387287855148315, 1.4885756969451904, 0.24156437814235687, 0.06274069845676422, 0.5337262749671936, 1.2067351341247559, 0.29638662934303284, -0.2208864390850067, -0.901680052280426, -1.6857043504714966, 2.0178122520446777, -1.6043094396591187, 1.9639062881469727, 0.7793428301811218, -0.05208829417824745, -1.8207365274429321, -1.9024970531463623, 1.472330093383789, 1.1078962087631226, 2.5236892700195312, 0.5077885389328003, 0.4775543808937073, -0.8339489698410034, -0.6930463314056396, 0.4913312494754791, -0.7488743662834167, -0.8624329566955566, 0.16308391094207764, 2.2651195526123047, 1.7440698146820068, -0.34583503007888794, -0.14085786044597626, -0.9623369574546814, 1.3686097860336304, -0.2781890034675598, 0.2399701327085495, 1.8686445951461792, -0.3900472819805145, -1.0563349723815918, 1.2657612562179565, -2.362867593765259, 0.2801682949066162, 1.9977037906646729, 0.2763165533542633, 0.017481878399848938, -1.1478019952774048, -0.7242423295974731, -0.18739432096481323, -0.39197665452957153, -1.2945220470428467, 0.472371369600296, -0.15757648646831512, -0.7614201307296753, -1.3598029613494873, 0.044302407652139664, -1.2127965688705444, -1.7556098699569702, 0.25824442505836487, 1.8675713539123535, 2.2160792350769043, -0.7951990365982056, 1.253660798072815, -0.32346227765083313, 0.26960793137550354, 1.1843000650405884, 1.2336331605911255, 3.2368459701538086, 1.932218313217163, -1.2714251279830933, 0.7215505838394165, -0.13776209950447083, -0.5017735958099365, 1.236473798751831, -0.9999974966049194, 1.1996190547943115, -0.2420133352279663, -1.3439011573791504, -1.171230435371399, 0.8519098162651062, 0.4412881135940552, -0.11193085461854935, -0.4473256766796112, 1.054479956626892, 0.19434842467308044, 1.366687297821045, 0.629711389541626, -0.3297499418258667, 0.5367816686630249, -0.31699445843696594, -0.5220159292221069, 1.580530047416687, 0.05915959179401398, -1.4956459999084473, -2.326752185821533, -0.15658989548683167, -1.015662670135498, 0.021283943206071854, -0.9561038017272949, -1.0893710851669312, 1.4699980020523071, 0.5143312215805054, -0.8960485458374023, -0.1341952234506607, -0.44487661123275757, -0.6045315265655518, 2.5895259380340576, -1.4228897094726562, -0.18286928534507751, -0.9728690385818481, -0.6080283522605896, 1.4623857736587524, -1.159271240234375, -0.28524449467658997, -0.9976181983947754, -0.46870526671409607, -1.2483198642730713, -0.4489933252334595, -0.0995623916387558, -0.7849099040031433, 0.7183615565299988, -0.02202294021844864, -1.2744343280792236, -0.28432130813598633, -1.080307126045227, 0.8698849678039551, -0.24943983554840088, -0.007870476692914963, 1.7216907739639282, 0.20894518494606018, -0.3072705864906311, 0.808569610118866, 1.2222107648849487, 0.5905674695968628, -0.5396407842636108, 0.22481669485569, -0.6484581232070923, 0.49195608496665955, -1.2683823108673096, 0.3259332776069641, -2.93442702293396, 0.705356776714325, -0.026391442865133286, -0.07631658762693405, -0.17730681598186493, -1.47931706905365, 0.8841102719306946, 2.4391775131225586, -1.12728750705719, 0.6208436489105225, 0.3051859140396118, 1.1977589130401611, -1.625388741493225, -0.042070649564266205, -0.6580678820610046, 2.0944294929504395, -0.020624877884984016, 1.0508217811584473, -0.5436788201332092, -2.4180662631988525, 0.5205464363098145, -1.1869964599609375, -0.9139755964279175, 0.8555998206138611, -0.830073893070221, 0.2084076851606369, -1.157723069190979, -0.1332934945821762, -0.8411367535591125, -1.1008268594741821, 0.49194154143333435, -0.022182483226060867, 0.681999146938324, -0.5934334993362427, 0.2345094382762909, -2.3195841312408447, -1.3742743730545044, -0.18696260452270508, -0.9047542214393616, 0.5130665302276611, -0.35241103172302246, 0.7527390122413635, -0.09531877934932709, 0.008448801003396511, 0.25870856642723083, 1.4608341455459595, 3.2143824100494385, -0.016015179455280304, 0.36889544129371643, -0.25228121876716614, -1.05118989944458, 1.510762095451355, 0.8920159935951233, -0.3344360888004303, -0.6364864706993103, -0.964468777179718, 1.4111640453338623, 1.8761283159255981, 1.0395026206970215, 0.09824585914611816, -0.9355618953704834, -0.7838518619537354, 0.14530281722545624, 0.11169252544641495, 0.4947495758533478, 0.9670140743255615, 0.19248352944850922, 0.19176071882247925, 1.359127402305603, 1.056657075881958, -0.23549948632717133, 0.4765055179595947, -0.8232393860816956, -0.39231085777282715, 0.5404773950576782, 0.3814093768596649, -0.013599672354757786, 0.2186315506696701, -0.996532678604126, -0.2329469472169876, -0.25106295943260193, -0.7859818935394287, -0.8067629933357239, -0.4291474223136902, -0.41078004240989685, 1.8131167888641357, -0.13889217376708984, -0.5597180724143982, 0.015468592755496502, -0.773121178150177, -0.09766283631324768, -1.0038074254989624, 0.3240307867527008, -0.09274560213088989, 0.08050204813480377, -0.15056394040584564, 1.5853363275527954, -0.960305392742157, -2.2149698734283447, 0.166326105594635, 0.2803824841976166, -0.35664936900138855, -0.1880568563938141, 1.8285071849822998, 0.535709023475647, 1.3945642709732056, 1.5472913980484009, 1.0938202142715454, -0.5860881209373474, -1.3269329071044922, 0.7219650745391846, 0.9274848103523254, -1.3389501571655273, 0.8858454823493958, -0.2569955587387085, -0.5822159051895142, 0.4913659393787384, 1.3636035919189453, 0.4432869553565979, -1.9430636167526245, 0.917029619216919, -1.0906436443328857, 0.8802475929260254, 0.8227450847625732, 0.8771620988845825, 0.11675310879945755, 0.9215638041496277, -1.2652170658111572, -1.0239590406417847, -0.5254698395729065, -0.6768694519996643, 1.8987491130828857, -0.25675997138023376, 0.30119603872299194, -0.37733036279678345, -1.3315832614898682, 0.10023006051778793, 0.6336666941642761, 0.3722723424434662, -0.2751271724700928, 0.7056896686553955, -0.7391002774238586, -1.06063973903656, -1.3659348487854004, -0.46104031801223755, -1.0151623487472534, -0.9033217430114746, 1.0200579166412354, 0.7972911596298218, 0.563237726688385, 1.9130293130874634, 0.6838874816894531, 0.21946781873703003, -2.57016658782959, 0.8054895997047424, 0.41479143500328064, -0.11255400627851486, 0.8031690120697021, 0.2865460216999054, 1.2331115007400513, -0.17020685970783234, 0.579811692237854, -2.2921407222747803, 2.2235751152038574, -0.27622881531715393, 0.7754112482070923, 0.05514085292816162, 0.04095880314707756, 0.9462077617645264, 0.46966326236724854, 0.5584582090377808, -1.0912117958068848, 0.92325758934021, -0.6144799590110779, 1.125919222831726, 0.8567607998847961, -0.8989189267158508, 0.19481675326824188, 1.2017732858657837, 0.3608964681625366, -0.5736408233642578, -0.979056179523468, -0.853367269039154, 0.9638140201568604, 1.80189847946167, 0.04731399565935135, 0.11416710168123245, 0.7913001775741577, 0.7773857712745667, -1.2699110507965088, 0.010799982585012913, -0.5564531087875366, -0.676321268081665, 1.7722012996673584, 2.0186939239501953, -0.007035914808511734, -0.09564787894487381, -0.7220709919929504, -1.5389834642410278, 0.7919273972511292, 0.19602341949939728, -0.08825787156820297, 0.82075434923172, -0.7056053280830383, 1.206307053565979, 0.8175703883171082, 0.8894900679588318, 0.26285964250564575, -0.0085035664960742, 0.25015854835510254, -0.22799424827098846, -1.2476238012313843, -0.34320154786109924, -0.9782296419143677, -2.564216136932373, 0.4337930381298065, -0.2752359211444855, -1.4646477699279785, 0.14641956984996796, -0.8912794589996338, 0.7012734413146973, -0.5719321370124817, -1.1548157930374146, -1.3837857246398926, 0.2283068746328354, -0.16700884699821472, 0.7302908301353455, -1.6068027019500732, -0.23057889938354492, 1.1556535959243774, 0.9953054785728455, -0.6174427270889282, 0.9120604991912842, 0.26305097341537476, 0.894652247428894, 0.9818921685218811, -0.4120360314846039, 0.46394193172454834, 0.26273778080940247, -1.3750660419464111, 0.4351094663143158, 1.3918288946151733, 0.24128635227680206, 1.3546854257583618, -0.47199177742004395, -0.04199066758155823, 0.38027843832969666, -0.26702266931533813, -0.5704490542411804, -0.7930065393447876, 0.6840994358062744, -0.13502484560012817, -0.9969725608825684, -0.0760866105556488, 0.05317123979330063, -0.11263711005449295, 0.326925665140152, -1.5264726877212524, -0.062255002558231354, -0.38732364773750305, -0.6474012732505798, -1.4232770204544067, -0.11856836825609207, 1.3278735876083374, -0.8857157826423645, -0.08810129761695862, 0.5303633809089661, 0.23749206960201263, 0.535281777381897, 0.6961343884468079, -0.7815012335777283, -0.22869618237018585, -0.1364702731370926, -0.45021867752075195, 0.30473020672798157, 1.2610211372375488, -0.08504040539264679, -0.9622425436973572, 0.3877948820590973, -0.2627118229866028, 0.23085492849349976, 1.9223735332489014, 0.06388473510742188, -0.8548962473869324, 0.3642747402191162, -0.7826892733573914, 1.8576096296310425, 1.67050039768219, 1.329588770866394, -0.043165840208530426, -0.9671983122825623, 0.6326996088027954, -0.3478831648826599, -0.37597188353538513, 0.9189682006835938, 0.3706807792186737, -0.2883059084415436, -1.4570828676223755, 0.8033984303474426, 1.2633212804794312, -0.8309251070022583, -0.754780113697052, 0.05038037523627281, -0.8417819142341614, 1.1749372482299805, 0.6735754013061523, 0.257310688495636, 0.3021675944328308, 1.6926617622375488, 0.7248159050941467, -0.5711933374404907, 0.4816393554210663, 0.4272081255912781, -0.16513526439666748, -1.9720160961151123, -1.1413222551345825, 0.33412593603134155, -0.45960795879364014, -1.4508583545684814, 1.509157419204712, -1.21365225315094, -0.9438652396202087, 0.5867299437522888, 0.1584068238735199, 1.3126966953277588, 0.3201305568218231, 1.7455065250396729, 1.9862326383590698, 0.929614782333374, 0.4643304646015167, 1.0813490152359009, -0.2820485830307007, -0.16999472677707672, 1.6532645225524902, -0.5288029313087463, 0.6462346315383911, 1.011868953704834, -0.5032254457473755, -1.2528581619262695, -0.829021692276001, -1.2080694437026978, -0.7919154167175293, 1.034557819366455, 0.09390973299741745, -1.1135520935058594, 0.34630855917930603, 1.649477243423462, 0.06335003674030304, -0.12914615869522095, 0.7345378994941711, 0.34894490242004395, -0.6815427541732788, -0.08257759362459183, -1.103953242301941, 0.6030389070510864, -0.32438257336616516, -0.39829668402671814, 0.1445438712835312, 0.6142919659614563, 1.2828279733657837, 0.24519942700862885, 0.06372319161891937, 1.333298683166504, -1.3718128204345703, 1.1703025102615356, -1.0561023950576782, 0.38639330863952637, -2.2798609733581543, 1.4881476163864136, -0.9949083924293518, 1.975663661956787, -2.6955246925354004, 0.5297531485557556, -0.4596230387687683, -0.5590206980705261, 0.13989631831645966, -0.18887750804424286, 0.14028291404247284, -0.02387908101081848, -1.1044617891311646, -0.13928841054439545, -0.9151652455329895, 0.5052648782730103, 1.221738576889038, 1.4249085187911987, -0.9558176398277283, -0.27652353048324585, -1.5971012115478516, -0.14367598295211792, -0.48546072840690613, 0.10175630450248718, -1.7423784732818604, -0.18237313628196716, -1.971961498260498, -2.487191677093506, -1.3050904273986816, -0.965797483921051, 1.3599039316177368, 0.10652084648609161, -0.94638592004776, 1.1244441270828247, -0.41898974776268005, -1.7746264934539795, 1.2585599422454834, -2.252237319946289 ]
https://github.com/huggingface/datasets/issues/3656
checksum error subjqa dataset
Thanks checking! You're totally right. I don't know what's changed, but I'm glad it's working now!
## Describe the bug I get a checksum error when loading the `subjqa` dataset (used in the transformers book). ## Steps to reproduce the bug ```python from datasets import load_dataset subjqa = load_dataset("subjqa","electronics") ``` ## Expected results Loading the dataset ## Actual results ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-2-d2857d460155> in <module>() 2 from datasets import load_dataset 3 ----> 4 subjqa = load_dataset("subjqa","electronics") 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 38 if len(bad_urls) > 0: 39 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 40 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 41 logger.info("All the checksums matched successfully" + for_verification_name) 42 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/lewtun/SubjQA/archive/refs/heads/master.zip'] ``` ## Environment info Google colab - `datasets` version: 1.18.2 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0
976
16
checksum error subjqa dataset ## Describe the bug I get a checksum error when loading the `subjqa` dataset (used in the transformers book). ## Steps to reproduce the bug ```python from datasets import load_dataset subjqa = load_dataset("subjqa","electronics") ``` ## Expected results Loading the dataset ## Actual results ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-2-d2857d460155> in <module>() 2 from datasets import load_dataset 3 ----> 4 subjqa = load_dataset("subjqa","electronics") 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 38 if len(bad_urls) > 0: 39 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 40 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 41 logger.info("All the checksums matched successfully" + for_verification_name) 42 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/lewtun/SubjQA/archive/refs/heads/master.zip'] ``` ## Environment info Google colab - `datasets` version: 1.18.2 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 Thanks checking! You're totally right. I don't know what's changed, but I'm glad it's working now!
[ -1.170517921447754, -0.7536989450454712, -0.5374830365180969, 1.4233942031860352, 0.025913327932357788, -1.3544694185256958, 0.09605385363101959, -0.8627185821533203, 1.6316784620285034, -0.8433938026428223, 0.36177197098731995, -1.7236298322677612, 0.019626159220933914, -0.6037812829017639, -0.63942551612854, -0.6467211246490479, -0.3068186938762665, -0.6568673253059387, 1.104724645614624, 2.4228498935699463, 1.1923357248306274, -1.3317265510559082, 2.8572208881378174, 0.5956296324729919, -0.30977126955986023, -0.8138771057128906, 0.3891567885875702, -0.018220480531454086, -1.4967153072357178, -0.26094263792037964, -1.0221611261367798, -0.029622219502925873, -0.6332626342773438, -0.5407837629318237, 0.1463230550289154, 0.47982338070869446, -0.1655627340078354, -0.3916233479976654, -0.44206398725509644, -0.7422446608543396, 0.5765579342842102, -0.2671881914138794, 0.8400483727455139, -0.29531458020210266, 1.7698217630386353, -0.629633367061615, 0.5432801246643066, 0.5354748368263245, 1.20821213722229, 0.23118631541728973, -0.013900868594646454, 0.4094025492668152, 0.1986735463142395, 0.06595940887928009, 0.62981778383255, 1.2087057828903198, 0.5808919072151184, 0.5534693002700806, 0.7548728585243225, -2.2046244144439697, 1.3163663148880005, -0.7960255742073059, 0.19806133210659027, 1.3260995149612427, -1.130005121231079, 0.4709348976612091, -1.8609260320663452, -0.11899920552968979, 0.35564106702804565, -2.3412578105926514, 0.12649625539779663, -1.3722933530807495, -0.556941568851471, 1.007440447807312, 0.33380216360092163, -1.1773535013198853, -0.031511444598436356, -0.3952537477016449, 0.943175733089447, 0.36015039682388306, 1.1508326530456543, -1.613999605178833, 0.0347885899245739, -0.18116025626659393, 0.28275978565216064, -1.1945918798446655, -1.667379379272461, 0.5873076915740967, 0.7110750079154968, 0.5724164247512817, -0.16493761539459229, 0.9007941484451294, -1.087678074836731, 0.7821059823036194, -0.9408550262451172, -1.834593653678894, -1.3977160453796387, -2.429985284805298, -2.3938181400299072, 0.8132843375205994, -0.4358343780040741, -0.333536297082901, 2.1297149658203125, -1.1191905736923218, -1.8009711503982544, 1.0514131784439087, 0.34059274196624756, -0.10854952037334442, 2.3312511444091797, 0.22770333290100098, -0.9594483971595764, 0.7330019474029541, -0.848483145236969, 0.647406280040741, -0.37165507674217224, 1.2538751363754272, 0.42180824279785156, -1.0656523704528809, 1.5944565534591675, -0.4247247278690338, 0.5716201663017273, -0.6725656986236572, -0.3809029757976532, -0.5343458652496338, 0.16779236495494843, 1.976709008216858, -0.17111076414585114, 1.5538907051086426, -0.08636868000030518, -1.4732351303100586, -1.3396707773208618, 0.6929491758346558, 0.5177829265594482, -0.7899866700172424, 0.21169905364513397, -0.3903923034667969, 0.1823577880859375, 0.13705572485923767, 1.0900191068649292, 1.2904516458511353, 0.8197625875473022, -0.16178588569164276, -0.8778819441795349, 0.11081399023532867, 0.021441668272018433, -0.5486076474189758, -1.7261663675308228, -0.2938403785228729, 0.17523311078548431, 0.6504093408584595, -1.1846946477890015, 1.9514274597167969, 0.8895688056945801, 2.0084149837493896, 0.9075891971588135, -0.34621888399124146, 1.6051939725875854, 0.05743856728076935, 1.891668677330017, -0.23558615148067474, 0.6538660526275635, -0.47417378425598145, -1.185258388519287, 0.6022502779960632, -0.33853331208229065, -1.9773727655410767, -0.3454647660255432, -0.9350790977478027, -0.083226278424263, -0.9041057229042053, 1.0603249073028564, -0.11414328962564468, -1.3655651807785034, 0.17223003506660461, -0.6776094436645508, 0.11948717385530472, -1.3991177082061768, 0.29334282875061035, 0.7065507173538208, -0.6892098784446716, 0.025936894118785858, -0.42879918217658997, -1.4023747444152832, -0.600990891456604, 0.4279769957065582, 1.7349114418029785, -0.6530307531356812, 1.0737680196762085, 1.0431149005889893, -0.6436014771461487, -0.05540192499756813, 0.5048896074295044, -0.4198567569255829, 0.969467043876648, -0.9867010116577148, -0.4220852851867676, 1.1466186046600342, -0.30120596289634705, -0.4513470232486725, 1.3210301399230957, 0.7150477766990662, -1.011206030845642, -0.34153881669044495, -0.10581845790147781, -0.838101863861084, 0.06723056733608246, -1.6174633502960205, -0.1305004358291626, 0.2548457384109497, -1.461566686630249, -0.4746010899543762, -0.02750789374113083, 1.3018800020217896, 0.0382067933678627, 1.3532989025115967, -0.19844955205917358, -0.1299382895231247, -0.5496340394020081, -0.550358772277832, 0.06727957725524902, -0.1346905529499054, -0.6297478675842285, 0.30167457461357117, -0.7451016902923584, 0.18387287855148315, 1.4885756969451904, 0.24156437814235687, 0.06274069845676422, 0.5337262749671936, 1.2067351341247559, 0.29638662934303284, -0.2208864390850067, -0.901680052280426, -1.6857043504714966, 2.0178122520446777, -1.6043094396591187, 1.9639062881469727, 0.7793428301811218, -0.05208829417824745, -1.8207365274429321, -1.9024970531463623, 1.472330093383789, 1.1078962087631226, 2.5236892700195312, 0.5077885389328003, 0.4775543808937073, -0.8339489698410034, -0.6930463314056396, 0.4913312494754791, -0.7488743662834167, -0.8624329566955566, 0.16308391094207764, 2.2651195526123047, 1.7440698146820068, -0.34583503007888794, -0.14085786044597626, -0.9623369574546814, 1.3686097860336304, -0.2781890034675598, 0.2399701327085495, 1.8686445951461792, -0.3900472819805145, -1.0563349723815918, 1.2657612562179565, -2.362867593765259, 0.2801682949066162, 1.9977037906646729, 0.2763165533542633, 0.017481878399848938, -1.1478019952774048, -0.7242423295974731, -0.18739432096481323, -0.39197665452957153, -1.2945220470428467, 0.472371369600296, -0.15757648646831512, -0.7614201307296753, -1.3598029613494873, 0.044302407652139664, -1.2127965688705444, -1.7556098699569702, 0.25824442505836487, 1.8675713539123535, 2.2160792350769043, -0.7951990365982056, 1.253660798072815, -0.32346227765083313, 0.26960793137550354, 1.1843000650405884, 1.2336331605911255, 3.2368459701538086, 1.932218313217163, -1.2714251279830933, 0.7215505838394165, -0.13776209950447083, -0.5017735958099365, 1.236473798751831, -0.9999974966049194, 1.1996190547943115, -0.2420133352279663, -1.3439011573791504, -1.171230435371399, 0.8519098162651062, 0.4412881135940552, -0.11193085461854935, -0.4473256766796112, 1.054479956626892, 0.19434842467308044, 1.366687297821045, 0.629711389541626, -0.3297499418258667, 0.5367816686630249, -0.31699445843696594, -0.5220159292221069, 1.580530047416687, 0.05915959179401398, -1.4956459999084473, -2.326752185821533, -0.15658989548683167, -1.015662670135498, 0.021283943206071854, -0.9561038017272949, -1.0893710851669312, 1.4699980020523071, 0.5143312215805054, -0.8960485458374023, -0.1341952234506607, -0.44487661123275757, -0.6045315265655518, 2.5895259380340576, -1.4228897094726562, -0.18286928534507751, -0.9728690385818481, -0.6080283522605896, 1.4623857736587524, -1.159271240234375, -0.28524449467658997, -0.9976181983947754, -0.46870526671409607, -1.2483198642730713, -0.4489933252334595, -0.0995623916387558, -0.7849099040031433, 0.7183615565299988, -0.02202294021844864, -1.2744343280792236, -0.28432130813598633, -1.080307126045227, 0.8698849678039551, -0.24943983554840088, -0.007870476692914963, 1.7216907739639282, 0.20894518494606018, -0.3072705864906311, 0.808569610118866, 1.2222107648849487, 0.5905674695968628, -0.5396407842636108, 0.22481669485569, -0.6484581232070923, 0.49195608496665955, -1.2683823108673096, 0.3259332776069641, -2.93442702293396, 0.705356776714325, -0.026391442865133286, -0.07631658762693405, -0.17730681598186493, -1.47931706905365, 0.8841102719306946, 2.4391775131225586, -1.12728750705719, 0.6208436489105225, 0.3051859140396118, 1.1977589130401611, -1.625388741493225, -0.042070649564266205, -0.6580678820610046, 2.0944294929504395, -0.020624877884984016, 1.0508217811584473, -0.5436788201332092, -2.4180662631988525, 0.5205464363098145, -1.1869964599609375, -0.9139755964279175, 0.8555998206138611, -0.830073893070221, 0.2084076851606369, -1.157723069190979, -0.1332934945821762, -0.8411367535591125, -1.1008268594741821, 0.49194154143333435, -0.022182483226060867, 0.681999146938324, -0.5934334993362427, 0.2345094382762909, -2.3195841312408447, -1.3742743730545044, -0.18696260452270508, -0.9047542214393616, 0.5130665302276611, -0.35241103172302246, 0.7527390122413635, -0.09531877934932709, 0.008448801003396511, 0.25870856642723083, 1.4608341455459595, 3.2143824100494385, -0.016015179455280304, 0.36889544129371643, -0.25228121876716614, -1.05118989944458, 1.510762095451355, 0.8920159935951233, -0.3344360888004303, -0.6364864706993103, -0.964468777179718, 1.4111640453338623, 1.8761283159255981, 1.0395026206970215, 0.09824585914611816, -0.9355618953704834, -0.7838518619537354, 0.14530281722545624, 0.11169252544641495, 0.4947495758533478, 0.9670140743255615, 0.19248352944850922, 0.19176071882247925, 1.359127402305603, 1.056657075881958, -0.23549948632717133, 0.4765055179595947, -0.8232393860816956, -0.39231085777282715, 0.5404773950576782, 0.3814093768596649, -0.013599672354757786, 0.2186315506696701, -0.996532678604126, -0.2329469472169876, -0.25106295943260193, -0.7859818935394287, -0.8067629933357239, -0.4291474223136902, -0.41078004240989685, 1.8131167888641357, -0.13889217376708984, -0.5597180724143982, 0.015468592755496502, -0.773121178150177, -0.09766283631324768, -1.0038074254989624, 0.3240307867527008, -0.09274560213088989, 0.08050204813480377, -0.15056394040584564, 1.5853363275527954, -0.960305392742157, -2.2149698734283447, 0.166326105594635, 0.2803824841976166, -0.35664936900138855, -0.1880568563938141, 1.8285071849822998, 0.535709023475647, 1.3945642709732056, 1.5472913980484009, 1.0938202142715454, -0.5860881209373474, -1.3269329071044922, 0.7219650745391846, 0.9274848103523254, -1.3389501571655273, 0.8858454823493958, -0.2569955587387085, -0.5822159051895142, 0.4913659393787384, 1.3636035919189453, 0.4432869553565979, -1.9430636167526245, 0.917029619216919, -1.0906436443328857, 0.8802475929260254, 0.8227450847625732, 0.8771620988845825, 0.11675310879945755, 0.9215638041496277, -1.2652170658111572, -1.0239590406417847, -0.5254698395729065, -0.6768694519996643, 1.8987491130828857, -0.25675997138023376, 0.30119603872299194, -0.37733036279678345, -1.3315832614898682, 0.10023006051778793, 0.6336666941642761, 0.3722723424434662, -0.2751271724700928, 0.7056896686553955, -0.7391002774238586, -1.06063973903656, -1.3659348487854004, -0.46104031801223755, -1.0151623487472534, -0.9033217430114746, 1.0200579166412354, 0.7972911596298218, 0.563237726688385, 1.9130293130874634, 0.6838874816894531, 0.21946781873703003, -2.57016658782959, 0.8054895997047424, 0.41479143500328064, -0.11255400627851486, 0.8031690120697021, 0.2865460216999054, 1.2331115007400513, -0.17020685970783234, 0.579811692237854, -2.2921407222747803, 2.2235751152038574, -0.27622881531715393, 0.7754112482070923, 0.05514085292816162, 0.04095880314707756, 0.9462077617645264, 0.46966326236724854, 0.5584582090377808, -1.0912117958068848, 0.92325758934021, -0.6144799590110779, 1.125919222831726, 0.8567607998847961, -0.8989189267158508, 0.19481675326824188, 1.2017732858657837, 0.3608964681625366, -0.5736408233642578, -0.979056179523468, -0.853367269039154, 0.9638140201568604, 1.80189847946167, 0.04731399565935135, 0.11416710168123245, 0.7913001775741577, 0.7773857712745667, -1.2699110507965088, 0.010799982585012913, -0.5564531087875366, -0.676321268081665, 1.7722012996673584, 2.0186939239501953, -0.007035914808511734, -0.09564787894487381, -0.7220709919929504, -1.5389834642410278, 0.7919273972511292, 0.19602341949939728, -0.08825787156820297, 0.82075434923172, -0.7056053280830383, 1.206307053565979, 0.8175703883171082, 0.8894900679588318, 0.26285964250564575, -0.0085035664960742, 0.25015854835510254, -0.22799424827098846, -1.2476238012313843, -0.34320154786109924, -0.9782296419143677, -2.564216136932373, 0.4337930381298065, -0.2752359211444855, -1.4646477699279785, 0.14641956984996796, -0.8912794589996338, 0.7012734413146973, -0.5719321370124817, -1.1548157930374146, -1.3837857246398926, 0.2283068746328354, -0.16700884699821472, 0.7302908301353455, -1.6068027019500732, -0.23057889938354492, 1.1556535959243774, 0.9953054785728455, -0.6174427270889282, 0.9120604991912842, 0.26305097341537476, 0.894652247428894, 0.9818921685218811, -0.4120360314846039, 0.46394193172454834, 0.26273778080940247, -1.3750660419464111, 0.4351094663143158, 1.3918288946151733, 0.24128635227680206, 1.3546854257583618, -0.47199177742004395, -0.04199066758155823, 0.38027843832969666, -0.26702266931533813, -0.5704490542411804, -0.7930065393447876, 0.6840994358062744, -0.13502484560012817, -0.9969725608825684, -0.0760866105556488, 0.05317123979330063, -0.11263711005449295, 0.326925665140152, -1.5264726877212524, -0.062255002558231354, -0.38732364773750305, -0.6474012732505798, -1.4232770204544067, -0.11856836825609207, 1.3278735876083374, -0.8857157826423645, -0.08810129761695862, 0.5303633809089661, 0.23749206960201263, 0.535281777381897, 0.6961343884468079, -0.7815012335777283, -0.22869618237018585, -0.1364702731370926, -0.45021867752075195, 0.30473020672798157, 1.2610211372375488, -0.08504040539264679, -0.9622425436973572, 0.3877948820590973, -0.2627118229866028, 0.23085492849349976, 1.9223735332489014, 0.06388473510742188, -0.8548962473869324, 0.3642747402191162, -0.7826892733573914, 1.8576096296310425, 1.67050039768219, 1.329588770866394, -0.043165840208530426, -0.9671983122825623, 0.6326996088027954, -0.3478831648826599, -0.37597188353538513, 0.9189682006835938, 0.3706807792186737, -0.2883059084415436, -1.4570828676223755, 0.8033984303474426, 1.2633212804794312, -0.8309251070022583, -0.754780113697052, 0.05038037523627281, -0.8417819142341614, 1.1749372482299805, 0.6735754013061523, 0.257310688495636, 0.3021675944328308, 1.6926617622375488, 0.7248159050941467, -0.5711933374404907, 0.4816393554210663, 0.4272081255912781, -0.16513526439666748, -1.9720160961151123, -1.1413222551345825, 0.33412593603134155, -0.45960795879364014, -1.4508583545684814, 1.509157419204712, -1.21365225315094, -0.9438652396202087, 0.5867299437522888, 0.1584068238735199, 1.3126966953277588, 0.3201305568218231, 1.7455065250396729, 1.9862326383590698, 0.929614782333374, 0.4643304646015167, 1.0813490152359009, -0.2820485830307007, -0.16999472677707672, 1.6532645225524902, -0.5288029313087463, 0.6462346315383911, 1.011868953704834, -0.5032254457473755, -1.2528581619262695, -0.829021692276001, -1.2080694437026978, -0.7919154167175293, 1.034557819366455, 0.09390973299741745, -1.1135520935058594, 0.34630855917930603, 1.649477243423462, 0.06335003674030304, -0.12914615869522095, 0.7345378994941711, 0.34894490242004395, -0.6815427541732788, -0.08257759362459183, -1.103953242301941, 0.6030389070510864, -0.32438257336616516, -0.39829668402671814, 0.1445438712835312, 0.6142919659614563, 1.2828279733657837, 0.24519942700862885, 0.06372319161891937, 1.333298683166504, -1.3718128204345703, 1.1703025102615356, -1.0561023950576782, 0.38639330863952637, -2.2798609733581543, 1.4881476163864136, -0.9949083924293518, 1.975663661956787, -2.6955246925354004, 0.5297531485557556, -0.4596230387687683, -0.5590206980705261, 0.13989631831645966, -0.18887750804424286, 0.14028291404247284, -0.02387908101081848, -1.1044617891311646, -0.13928841054439545, -0.9151652455329895, 0.5052648782730103, 1.221738576889038, 1.4249085187911987, -0.9558176398277283, -0.27652353048324585, -1.5971012115478516, -0.14367598295211792, -0.48546072840690613, 0.10175630450248718, -1.7423784732818604, -0.18237313628196716, -1.971961498260498, -2.487191677093506, -1.3050904273986816, -0.965797483921051, 1.3599039316177368, 0.10652084648609161, -0.94638592004776, 1.1244441270828247, -0.41898974776268005, -1.7746264934539795, 1.2585599422454834, -2.252237319946289 ]
https://github.com/huggingface/datasets/issues/3655
Pubmed dataset not reachable
Hey @albertvillanova, sorry to reopen this... I can confirm that on `master` branch the dataset is downloadable now but it is still broken in streaming mode: ```python >>> import datasets >>> pubmed_train = datasets.load_dataset('pubmed', split='train', streaming=True) >>> next(iter(pubmed_train)) ``` ``` No such file or directory: 'gzip://pubmed22n0001.xml::ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed22n0001.xml.gz' ```
## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0
977
47
Pubmed dataset not reachable ## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0 Hey @albertvillanova, sorry to reopen this... I can confirm that on `master` branch the dataset is downloadable now but it is still broken in streaming mode: ```python >>> import datasets >>> pubmed_train = datasets.load_dataset('pubmed', split='train', streaming=True) >>> next(iter(pubmed_train)) ``` ``` No such file or directory: 'gzip://pubmed22n0001.xml::ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed22n0001.xml.gz' ```
[ -1.1885287761688232, -0.9074975848197937, -0.7641465067863464, 1.512665867805481, -0.22244997322559357, -1.2067879438400269, 0.18187640607357025, -0.9373891353607178, 1.7159315347671509, -0.7185981273651123, 0.3189203441143036, -1.6967138051986694, -0.06047055497765541, -0.5480324029922485, -0.7107194662094116, -0.8667210340499878, -0.35915955901145935, -0.6996297240257263, 1.024246096611023, 2.457376003265381, 1.2593913078308105, -1.4095432758331299, 2.6606240272521973, 0.6357368230819702, -0.15547114610671997, -1.0900797843933105, 0.4919002056121826, -0.022408613935112953, -1.3247299194335938, -0.41401705145835876, -0.9460888504981995, -0.15342649817466736, -0.5740978717803955, -0.5674297213554382, 0.06779708713293076, 0.37423738837242126, -0.25930455327033997, -0.5301385521888733, -0.5322201251983643, -0.822330117225647, 0.4881572127342224, -0.38071516156196594, 0.8594479560852051, -0.30565062165260315, 1.8239575624465942, -0.55180823802948, 0.5374225378036499, 0.7845140099525452, 1.2913107872009277, 0.1634484976530075, -0.12378818541765213, 0.3403496742248535, 0.3935541808605194, 0.04565360024571419, 0.5256671905517578, 1.1814565658569336, 0.6327359676361084, 0.4071342647075653, 0.6691178679466248, -2.308861255645752, 1.2913423776626587, -1.010296106338501, 0.2984151244163513, 1.3268496990203857, -1.088935375213623, 0.367455393075943, -1.8753001689910889, -0.027246002107858658, 0.6514848470687866, -2.2166309356689453, 0.2020072489976883, -1.2966673374176025, -0.4653654992580414, 0.9964399337768555, 0.3429696261882782, -1.1813414096832275, 0.10770049691200256, -0.3212888538837433, 1.074082851409912, 0.44406619668006897, 1.2093926668167114, -1.8454160690307617, -0.0564209409058094, -0.2464890033006668, 0.14207406342029572, -1.2022714614868164, -1.6184498071670532, 0.536063015460968, 0.7475060820579529, 0.5914592742919922, -0.08890805393457413, 1.0110771656036377, -0.8683356642723083, 0.7483352422714233, -1.0261049270629883, -1.7280570268630981, -1.3890410661697388, -2.2639095783233643, -2.352266550064087, 0.7039646506309509, -0.4340883791446686, -0.4189927577972412, 2.104980707168579, -0.9521287083625793, -1.8972771167755127, 1.1059478521347046, 0.29005157947540283, -0.02397550642490387, 2.308112382888794, 0.26260992884635925, -0.715451180934906, 0.44139257073402405, -0.8364908695220947, 0.6378858089447021, -0.3263593316078186, 1.4093399047851562, 0.47046059370040894, -0.9901846647262573, 1.6479066610336304, -0.3743797838687897, 0.5717101693153381, -0.7542113065719604, -0.4336056113243103, -0.6432710289955139, 0.187879279255867, 1.98075270652771, -0.3591372072696686, 1.5342049598693848, -0.36225250363349915, -1.557320475578308, -1.5829004049301147, 0.8427819609642029, 0.47029048204421997, -0.7789671421051025, 0.1255316287279129, -0.3327840268611908, 0.14632216095924377, 0.0034125829115509987, 1.0956171751022339, 1.2194039821624756, 0.7260845303535461, -0.2827726900577545, -0.8919329643249512, 0.2955513894557953, 0.10312534123659134, -0.7224133014678955, -1.7609463930130005, -0.3493671715259552, 0.13180094957351685, 0.5793731808662415, -1.1813870668411255, 1.7444640398025513, 0.8468114733695984, 1.9836164712905884, 0.9752066135406494, -0.3344409763813019, 1.4821562767028809, 0.14892810583114624, 1.9514943361282349, -0.40686431527137756, 0.6293292045593262, -0.3086230456829071, -1.087918758392334, 0.8547775149345398, -0.32323014736175537, -2.0530569553375244, -0.6592867970466614, -0.9501029253005981, -0.12971720099449158, -0.724073052406311, 0.9030224680900574, -0.1793774515390396, -1.4334653615951538, 0.20321737229824066, -0.8067375421524048, 0.11081961542367935, -1.2261419296264648, 0.25824856758117676, 0.748369038105011, -0.6734538078308105, 0.16200320422649384, -0.37568265199661255, -1.3287041187286377, -0.5291483402252197, 0.3425312042236328, 2.0187222957611084, -0.7593337297439575, 0.9898039102554321, 1.0183480978012085, -0.7488958835601807, -0.023369263857603073, 0.29149970412254333, -0.18172134459018707, 0.8589543104171753, -1.1720633506774902, -0.3591143786907196, 1.1516737937927246, -0.08530731499195099, -0.7103140354156494, 1.4907796382904053, 0.7703015804290771, -0.9943660497665405, -0.20514366030693054, -0.11500455439090729, -0.7875832319259644, 0.013789926655590534, -1.687744140625, -0.06602021306753159, 0.38374412059783936, -1.4881118535995483, -0.5069703459739685, -0.21618060767650604, 1.4285824298858643, -0.057605497539043427, 1.4553053379058838, -0.21893362700939178, -0.18787896633148193, -0.4503398537635803, -0.35303783416748047, 0.16592389345169067, -0.31202855706214905, -0.6113454103469849, 0.20306992530822754, -0.8256993293762207, 0.3177456557750702, 1.4478057622909546, 0.23010572791099548, 0.033547576516866684, 0.5697060227394104, 1.1121864318847656, 0.3579128384590149, -0.07064978778362274, -0.8764248490333557, -1.5588593482971191, 2.007777690887451, -1.411234974861145, 2.012963056564331, 0.6146116852760315, -0.04557255282998085, -1.7660481929779053, -1.9212632179260254, 1.3964179754257202, 1.098921775817871, 2.3626930713653564, 0.6512914299964905, 0.40412595868110657, -0.8558459877967834, -0.5831975340843201, 0.2156514972448349, -0.9309499859809875, -0.8918905258178711, 0.23739305138587952, 2.366151809692383, 1.7160764932632446, -0.495042085647583, -0.3121325969696045, -0.9894194602966309, 1.3100017309188843, -0.2279278039932251, 0.2496352344751358, 1.9745993614196777, -0.2049904614686966, -1.0856267213821411, 1.3243781328201294, -2.3456971645355225, 0.19036802649497986, 2.002476215362549, 0.22117164731025696, 0.11634104698896408, -1.4634413719177246, -0.7235981225967407, -0.21506528556346893, -0.45996904373168945, -1.2657791376113892, 0.48316723108291626, -0.30304285883903503, -0.8440183997154236, -1.4167795181274414, 0.19943632185459137, -1.0239644050598145, -1.7717440128326416, 0.13311274349689484, 1.8982751369476318, 1.896706461906433, -0.7095062732696533, 1.466386079788208, -0.3235546052455902, 0.09475945681333542, 1.3146857023239136, 1.2105973958969116, 3.131540536880493, 2.0315957069396973, -1.2718703746795654, 0.7122823596000671, -0.12486636638641357, -0.4515831172466278, 1.1771148443222046, -1.2119793891906738, 1.1278420686721802, -0.35295620560646057, -1.2726473808288574, -1.1773816347122192, 0.9478408694267273, 0.5048531889915466, 0.044845618307590485, -0.441962867975235, 1.217239260673523, 0.04658205807209015, 1.3585864305496216, 0.54845130443573, -0.3265517055988312, 0.7979515194892883, -0.44828107953071594, -0.4842163622379303, 1.525170922279358, 0.21995985507965088, -1.353369951248169, -2.2767884731292725, -0.18284766376018524, -0.9489641189575195, -0.04136374592781067, -0.563957154750824, -0.9950851202011108, 1.611870288848877, 0.43500471115112305, -1.2294461727142334, -0.2567748427391052, -0.30737850069999695, -0.535896360874176, 2.712132453918457, -1.3483504056930542, -0.2199326604604721, -1.035471796989441, -0.5224262475967407, 1.6966230869293213, -1.0636556148529053, -0.2482532262802124, -1.0974857807159424, -0.5774766802787781, -1.342163324356079, -0.6365714073181152, 0.07381357997655869, -0.8724626898765564, 0.8812045454978943, 0.11937997490167618, -1.2073860168457031, -0.20333504676818848, -0.878944456577301, 0.8495907187461853, -0.09521184116601944, 0.255469411611557, 1.963495135307312, 0.41190460324287415, -0.45506319403648376, 0.6459863185882568, 1.0436022281646729, 0.6725335717201233, -0.6389220356941223, 0.42064809799194336, -0.6094319224357605, 0.30649426579475403, -1.3376102447509766, 0.23563915491104126, -2.8914175033569336, 0.6873341202735901, 0.018407512456178665, -0.027573823928833008, -0.1287117898464203, -1.2901893854141235, 1.0677074193954468, 2.583526134490967, -1.2496029138565063, 0.568128764629364, 0.34845396876335144, 1.2679020166397095, -1.5240997076034546, 0.32814231514930725, -0.3840758502483368, 2.157153367996216, 0.10103195160627365, 1.252353310585022, -0.39876893162727356, -2.2997329235076904, 0.6714364290237427, -1.2549277544021606, -1.2388731241226196, 0.7300154566764832, -0.7954491376876831, -0.0219227634370327, -1.3383857011795044, -0.20173509418964386, -0.8633444905281067, -1.2377861738204956, 0.7351576089859009, 0.04405733942985535, 0.42035821080207825, -0.5865398049354553, 0.4234541654586792, -2.1336424350738525, -1.2971973419189453, -0.26312270760536194, -1.0218278169631958, 0.47238853573799133, -0.2722696363925934, 0.6844849586486816, -0.20627900958061218, -0.004052039235830307, 0.37573209404945374, 1.4178814888000488, 3.3936450481414795, 0.09858693927526474, 0.21964779496192932, -0.20550446212291718, -1.0328260660171509, 1.4357032775878906, 0.9257930517196655, -0.16227208077907562, -0.5404762029647827, -1.106837511062622, 1.1943228244781494, 2.0754239559173584, 1.0559953451156616, 0.06793098151683807, -0.8255889415740967, -0.7575297355651855, 0.05723561346530914, 0.13075736165046692, 0.5218413472175598, 0.9199153184890747, 0.20125874876976013, 0.08730531483888626, 1.2652628421783447, 1.163553237915039, -0.32462987303733826, 0.41788551211357117, -0.9251401424407959, -0.371831476688385, 0.5455228686332703, 0.27542629837989807, 0.016730699688196182, 0.20263448357582092, -1.0049697160720825, -0.2600003778934479, -0.2998178005218506, -0.934115469455719, -0.7411055564880371, -0.363348126411438, -0.3275788128376007, 1.6561158895492554, 0.1543649584054947, -0.47227880358695984, -0.021021123975515366, -0.7297361493110657, -0.04282524436712265, -1.0612988471984863, 0.31945452094078064, -0.23441162705421448, -0.026309069246053696, -0.07558552920818329, 1.650784969329834, -0.9241756200790405, -2.067499876022339, 0.26392892003059387, 0.25553572177886963, -0.41723954677581787, 0.28719326853752136, 1.6614017486572266, 0.63653963804245, 1.3511508703231812, 1.3322741985321045, 1.0901432037353516, -0.6650954484939575, -1.3065623044967651, 0.6180365681648254, 0.9344310760498047, -1.364242434501648, 0.806336522102356, 0.03544100001454353, -0.3941338360309601, 0.5808829069137573, 1.3144328594207764, 0.4623399078845978, -2.048743963241577, 0.6856786012649536, -0.806434154510498, 0.7741072773933411, 0.6997993588447571, 0.8306189775466919, 0.18691430985927582, 0.7213670611381531, -1.2280259132385254, -1.0312896966934204, -0.617840588092804, -0.6146818995475769, 1.8826401233673096, -0.2515525817871094, 0.5355508923530579, -0.16928952932357788, -1.3217090368270874, -0.08183500170707703, 0.7263825535774231, 0.35717669129371643, -0.5003061294555664, 0.7968709468841553, -0.6382974982261658, -1.1915823221206665, -1.3110682964324951, -0.5355589985847473, -0.9946178197860718, -0.9361658692359924, 0.9788947701454163, 0.811336874961853, 0.3856184780597687, 1.8658045530319214, 0.5816885828971863, 0.09675244987010956, -2.6955864429473877, 0.9204423427581787, 0.27794376015663147, -0.04052450880408287, 0.9008898735046387, 0.2850028872489929, 0.9800326228141785, -0.11864333599805832, 0.6316737532615662, -2.288872480392456, 2.2941136360168457, -0.15722553431987762, 0.7007880806922913, 0.05722437798976898, -0.19737644493579865, 0.8751230239868164, 0.41419366002082825, 0.6146361827850342, -1.1062599420547485, 0.7358353734016418, -0.6681909561157227, 1.2414253950119019, 0.7730807662010193, -0.8544952869415283, -0.05860837176442146, 1.2678498029708862, 0.44122380018234253, -0.4920591711997986, -0.9934116005897522, -0.9719556570053101, 1.0243898630142212, 1.7566101551055908, -0.0979059487581253, -0.027895700186491013, 0.8991309404373169, 0.6321045160293579, -1.3045159578323364, 0.08067616820335388, -0.7496294975280762, -0.7001410126686096, 1.6822220087051392, 1.9545841217041016, -0.11641331762075424, -0.2985219359397888, -0.869093656539917, -1.3038688898086548, 0.7973295450210571, 0.13347871601581573, -0.02283715270459652, 0.6168802976608276, -0.5298845171928406, 1.2145875692367554, 0.7164694666862488, 0.8764209747314453, 0.17690090835094452, 0.408002644777298, 0.37507790327072144, -0.42039763927459717, -1.2167266607284546, -0.22714920341968536, -1.1040549278259277, -2.5450992584228516, 0.5097516179084778, -0.20012277364730835, -1.3517889976501465, 0.008249885402619839, -1.0696998834609985, 0.8673501014709473, -0.5712953209877014, -1.1988953351974487, -1.3846015930175781, 0.17266646027565002, -0.11951279640197754, 0.8970822691917419, -1.614798665046692, 0.027407236397266388, 1.32447350025177, 1.005098819732666, -0.7436730861663818, 0.9241256713867188, 0.13746331632137299, 1.0406006574630737, 0.8951907753944397, -0.3178257644176483, 0.5980579257011414, 0.0811886116862297, -1.394794225692749, 0.5157458186149597, 1.1912254095077515, 0.14600872993469238, 1.3744761943817139, -0.5614418983459473, -0.04180876910686493, 0.3993736803531647, -0.5092100501060486, -0.504819393157959, -0.6533659100532532, 0.66017746925354, -0.053018294274806976, -0.9256654381752014, 0.037658337503671646, 0.04627929627895355, -0.05320144072175026, 0.20360016822814941, -1.446951150894165, -0.12182009965181351, -0.2532193660736084, -0.601973831653595, -1.1882978677749634, -0.1764635145664215, 1.2785297632217407, -0.7824313640594482, -0.2608949542045593, 0.43351393938064575, 0.2709449231624603, 0.525397002696991, 0.5100138187408447, -0.6048437356948853, -0.4293370246887207, -0.19909216463565826, -0.41760963201522827, 0.37256962060928345, 1.4391967058181763, -0.04261217266321182, -1.0286177396774292, 0.7767907977104187, -0.45107364654541016, 0.04984315484762192, 1.952459692955017, 0.10500692576169968, -0.8575291037559509, 0.19507640600204468, -0.6355413794517517, 1.9878686666488647, 1.7609376907348633, 1.27281653881073, -0.198589026927948, -0.9894647598266602, 0.6225990653038025, -0.4592438042163849, -0.3995550870895386, 0.8360410928726196, 0.3889695107936859, -0.14727261662483215, -1.2390556335449219, 0.5410400629043579, 1.3276152610778809, -0.8984124064445496, -0.8486392498016357, 0.11531540006399155, -0.8361197710037231, 0.9934146404266357, 0.6909494400024414, 0.3446970283985138, 0.13104449212551117, 1.52639639377594, 0.7701826691627502, -0.37245315313339233, 0.6281337141990662, 0.4721243381500244, -0.13486865162849426, -2.093445301055908, -1.129083275794983, 0.37689414620399475, -0.527545154094696, -1.5976207256317139, 1.3298404216766357, -1.1778647899627686, -0.9115607738494873, 0.48513686656951904, 0.15922439098358154, 1.4567291736602783, 0.2952477037906647, 1.6282062530517578, 2.0047707557678223, 0.8499724864959717, 0.2941642105579376, 1.315424919128418, -0.10036493092775345, -0.4561329185962677, 1.821842074394226, -0.436288982629776, 0.49948322772979736, 1.1519708633422852, -0.28070345520973206, -1.1882002353668213, -0.8160156011581421, -1.3122161626815796, -0.7457119822502136, 1.238081932067871, 0.17775902152061462, -1.1385406255722046, 0.2429821938276291, 1.6392780542373657, 0.08898966759443283, -0.30354052782058716, 0.7379025816917419, 0.2433270663022995, -0.8540599346160889, 0.02864784374833107, -0.9157117009162903, 0.5188930034637451, -0.2286967635154724, -0.3429657518863678, 0.31638017296791077, 0.39219874143600464, 1.2916470766067505, 0.052184268832206726, 0.15610894560813904, 1.3167308568954468, -1.2208585739135742, 1.5980559587478638, -0.6631993055343628, 0.31329724192619324, -2.3321502208709717, 1.2887580394744873, -0.7955052256584167, 1.8380553722381592, -2.6807875633239746, 0.3863452672958374, -0.4487752914428711, -0.32675808668136597, 0.22022853791713715, -0.36572468280792236, 0.07997492700815201, -0.22348351776599884, -1.0900617837905884, -0.12717528641223907, -0.6725452542304993, 0.5123228430747986, 1.0853487253189087, 1.3900678157806396, -1.0998510122299194, -0.22208271920681, -1.8748760223388672, -0.18608729541301727, -0.7587394714355469, 0.46916478872299194, -1.896662950515747, -0.13466697931289673, -1.9498605728149414, -2.4431917667388916, -1.215793490409851, -0.7753522396087646, 1.1261390447616577, 0.05951876938343048, -0.7824024558067322, 1.096489429473877, -0.2259981334209442, -1.8326855897903442, 1.0502846240997314, -2.1494998931884766 ]
https://github.com/huggingface/datasets/issues/3655
Pubmed dataset not reachable
Hi @abhi-mosaic, would you mind opening another issue for this new problem? First issue (already solved) was a ConnectionError due to the yearly update release of PubMed: we fixed it by updating the URLs from year 2021 to year 2022. However this is another problem: to make pubmed streamable. Please note that NOT all our datastes are streamable: we are making streamable more and more of them... but this is an on-going process... Thanks.
## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0
977
74
Pubmed dataset not reachable ## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0 Hi @abhi-mosaic, would you mind opening another issue for this new problem? First issue (already solved) was a ConnectionError due to the yearly update release of PubMed: we fixed it by updating the URLs from year 2021 to year 2022. However this is another problem: to make pubmed streamable. Please note that NOT all our datastes are streamable: we are making streamable more and more of them... but this is an on-going process... Thanks.
[ -1.2422174215316772, -0.8939493298530579, -0.7748817801475525, 1.4604185819625854, -0.24598120152950287, -1.220200538635254, 0.1387709677219391, -0.9982219934463501, 1.6952325105667114, -0.7265534996986389, 0.2993633449077606, -1.6785926818847656, 0.017498251050710678, -0.5313356518745422, -0.7116528153419495, -0.8612209558486938, -0.39953872561454773, -0.6264079809188843, 1.0252999067306519, 2.5386359691619873, 1.1999564170837402, -1.3779231309890747, 2.6329715251922607, 0.6881558299064636, -0.12828189134597778, -1.0749269723892212, 0.4967109262943268, 0.013730417005717754, -1.3431477546691895, -0.3883795440196991, -0.9166633486747742, -0.16520355641841888, -0.5192369818687439, -0.5603676438331604, 0.03465574234724045, 0.3338334262371063, -0.20933479070663452, -0.49278774857521057, -0.533001184463501, -0.777222752571106, 0.5073522925376892, -0.3863316476345062, 0.8547817468643188, -0.29715755581855774, 1.8439455032348633, -0.5542130470275879, 0.5876360535621643, 0.7467979192733765, 1.3517286777496338, 0.21636439859867096, -0.05686303600668907, 0.31463563442230225, 0.42397990822792053, 0.019670803099870682, 0.44343918561935425, 1.123051404953003, 0.6890261173248291, 0.35519203543663025, 0.6603490710258484, -2.235194444656372, 1.2818100452423096, -1.032267689704895, 0.30399635434150696, 1.317265510559082, -1.0882304906845093, 0.34906652569770813, -1.8510152101516724, -0.09446148574352264, 0.6095559000968933, -2.1969358921051025, 0.21488195657730103, -1.262438178062439, -0.49614760279655457, 1.0262727737426758, 0.3064093589782715, -1.2151278257369995, 0.10527206212282181, -0.39382219314575195, 1.0879653692245483, 0.4747754633426666, 1.164297342300415, -1.7861614227294922, -0.029307771474123, -0.2993203103542328, 0.15939471125602722, -1.2410043478012085, -1.5635724067687988, 0.49587830901145935, 0.7250109910964966, 0.5703163743019104, -0.04014229401946068, 0.9063423871994019, -0.8882416486740112, 0.830675482749939, -1.0279052257537842, -1.7126541137695312, -1.4314230680465698, -2.3547089099884033, -2.3907649517059326, 0.7562482953071594, -0.3946390151977539, -0.43555888533592224, 2.074045419692993, -0.9984163045883179, -1.8685840368270874, 1.1471436023712158, 0.21837863326072693, -0.04893844202160835, 2.3384697437286377, 0.18879400193691254, -0.7302422523498535, 0.4353548288345337, -0.8150295615196228, 0.6277399659156799, -0.41204217076301575, 1.37376070022583, 0.4567161500453949, -1.0077258348464966, 1.632627248764038, -0.38608554005622864, 0.5662347078323364, -0.7521404027938843, -0.49806463718414307, -0.7399340271949768, 0.28387385606765747, 1.9474413394927979, -0.31082481145858765, 1.5672459602355957, -0.3818050026893616, -1.5442931652069092, -1.5889865159988403, 0.8388887643814087, 0.4925859272480011, -0.7090253233909607, 0.10544168204069138, -0.34270089864730835, 0.06478309631347656, 0.03252379596233368, 0.9868466258049011, 1.2139707803726196, 0.7651160955429077, -0.29901644587516785, -0.8784106373786926, 0.2846808135509491, 0.0743202269077301, -0.7383577227592468, -1.7718462944030762, -0.3688736855983734, 0.12202614545822144, 0.6294243335723877, -1.2504570484161377, 1.7378755807876587, 0.8206329345703125, 1.9996854066848755, 0.9928991794586182, -0.3263910710811615, 1.4904640913009644, 0.12380379438400269, 1.9084254503250122, -0.41367554664611816, 0.6910570859909058, -0.2992350459098816, -1.0884658098220825, 0.7740759253501892, -0.3143686056137085, -2.1249537467956543, -0.6791858077049255, -0.9172130823135376, -0.132490336894989, -0.7454708218574524, 0.9178723692893982, -0.19846771657466888, -1.3794535398483276, 0.19633039832115173, -0.7294104695320129, 0.10404887795448303, -1.2592135667800903, 0.31165969371795654, 0.7702962756156921, -0.6438238024711609, 0.1627522110939026, -0.29268038272857666, -1.3206146955490112, -0.5182060599327087, 0.29585057497024536, 1.930688738822937, -0.7965280413627625, 0.9364539384841919, 1.0201865434646606, -0.6943455338478088, -0.02420177310705185, 0.35628899931907654, -0.22145222127437592, 0.8847330808639526, -1.0692511796951294, -0.3320653736591339, 1.177912950515747, -0.12181487679481506, -0.6349332332611084, 1.496262788772583, 0.7761868834495544, -0.9837409257888794, -0.18863992393016815, -0.10547299683094025, -0.859334409236908, -0.013151843100786209, -1.716893196105957, -0.0995744988322258, 0.2885717451572418, -1.5233479738235474, -0.46624717116355896, -0.22404515743255615, 1.419276475906372, -0.05733893811702728, 1.4658814668655396, -0.32228952646255493, -0.22148799896240234, -0.45814740657806396, -0.35450923442840576, 0.1683264672756195, -0.28076446056365967, -0.5907896161079407, 0.2257259041070938, -0.8561402559280396, 0.33765095472335815, 1.4335767030715942, 0.2849332392215729, 0.1029847264289856, 0.5654227137565613, 1.0393799543380737, 0.3485678732395172, -0.15498481690883636, -0.8294739127159119, -1.605280876159668, 2.0619258880615234, -1.3800978660583496, 2.0888309478759766, 0.7406505942344666, -0.0916069895029068, -1.7602561712265015, -1.9075111150741577, 1.3813267946243286, 1.1243162155151367, 2.346010684967041, 0.5685956478118896, 0.37825632095336914, -0.8965792655944824, -0.6023055911064148, 0.2162640392780304, -0.9804649949073792, -0.8730551600456238, 0.13495410978794098, 2.397975444793701, 1.740432858467102, -0.4534079134464264, -0.2467041015625, -1.0719355344772339, 1.322670578956604, -0.1813461035490036, 0.2550969421863556, 1.9699631929397583, -0.2064855396747589, -1.064481258392334, 1.3263074159622192, -2.332698345184326, 0.18141813576221466, 1.9826723337173462, 0.23936568200588226, 0.07666148990392685, -1.4228525161743164, -0.687423586845398, -0.2551952302455902, -0.419709712266922, -1.1984241008758545, 0.5050365328788757, -0.2980879247188568, -0.8637518882751465, -1.439734697341919, 0.12317733466625214, -1.11404550075531, -1.7459241151809692, 0.23411554098129272, 1.8393107652664185, 1.877732515335083, -0.6874658465385437, 1.4443762302398682, -0.20180149376392365, 0.1433986872434616, 1.3197351694107056, 1.1849162578582764, 3.1375019550323486, 2.0483291149139404, -1.2812635898590088, 0.7126853466033936, -0.11237431317567825, -0.43537282943725586, 1.0848312377929688, -1.1676970720291138, 1.238216757774353, -0.2798764705657959, -1.2548936605453491, -1.174302101135254, 0.9439697861671448, 0.4879113733768463, 0.06747303158044815, -0.4506669044494629, 1.167057752609253, 0.08885575830936432, 1.3630450963974, 0.5510203838348389, -0.29241296648979187, 0.7387434840202332, -0.4737037420272827, -0.5590707063674927, 1.5173455476760864, 0.2401115894317627, -1.471724271774292, -2.3376517295837402, -0.2231578677892685, -0.8987569212913513, -0.10891799628734589, -0.5832342505455017, -0.9821689128875732, 1.6185438632965088, 0.4370315372943878, -1.2416430711746216, -0.26823875308036804, -0.3128345310688019, -0.558165967464447, 2.764927625656128, -1.4640625715255737, -0.2505057454109192, -1.0271601676940918, -0.5584455728530884, 1.6695131063461304, -1.1055985689163208, -0.18304495513439178, -1.0678887367248535, -0.6233434677124023, -1.2774606943130493, -0.6444434523582458, 0.001385432668030262, -0.9207678437232971, 0.8475033640861511, 0.09966427832841873, -1.1853229999542236, -0.23374797403812408, -0.8955958485603333, 0.839288592338562, -0.04147578030824661, 0.2591858506202698, 1.9341812133789062, 0.47843700647354126, -0.36531466245651245, 0.6354039907455444, 1.0951590538024902, 0.6772258877754211, -0.6715561747550964, 0.3574724495410919, -0.6570918560028076, 0.3086169362068176, -1.2605470418930054, 0.28905969858169556, -2.8509681224823, 0.6613873839378357, -0.0009078569710254669, -0.08883879333734512, -0.1242997869849205, -1.2623018026351929, 1.0906751155853271, 2.604153871536255, -1.1851112842559814, 0.5374680161476135, 0.3653121888637543, 1.228686809539795, -1.5239198207855225, 0.3549199402332306, -0.4024988114833832, 2.162452220916748, 0.11903436481952667, 1.2324923276901245, -0.4991186261177063, -2.245065927505493, 0.7201704978942871, -1.2722755670547485, -1.2732031345367432, 0.7050794959068298, -0.8391711115837097, 0.03762410953640938, -1.3520420789718628, -0.1817430853843689, -0.8333094120025635, -1.2631903886795044, 0.6884020566940308, 0.0918445959687233, 0.46647557616233826, -0.5831248164176941, 0.37503573298454285, -2.1821959018707275, -1.3015846014022827, -0.2572934925556183, -0.9981504082679749, 0.4497462809085846, -0.2843676805496216, 0.6743476986885071, -0.18837875127792358, -0.0112672820687294, 0.3759630620479584, 1.4000715017318726, 3.377742052078247, 0.14423079788684845, 0.28746461868286133, -0.17436043918132782, -0.9908344149589539, 1.4495105743408203, 0.9403670430183411, -0.16035202145576477, -0.5748316645622253, -1.040692925453186, 1.2273728847503662, 2.0332274436950684, 1.0827453136444092, 0.03322800621390343, -0.7420545220375061, -0.7415047883987427, 0.06236426904797554, 0.13998869061470032, 0.4683263301849365, 1.0031087398529053, 0.1431940644979477, 0.11743846535682678, 1.387779712677002, 1.2838325500488281, -0.4055664539337158, 0.3365905284881592, -0.8815640807151794, -0.4131619930267334, 0.543164849281311, 0.3331088423728943, -0.016918828710913658, 0.2674635648727417, -1.0474772453308105, -0.2783561944961548, -0.3240630030632019, -0.9487574696540833, -0.7197372317314148, -0.3643246293067932, -0.3775501549243927, 1.6747626066207886, 0.15458190441131592, -0.45861005783081055, -0.015079252421855927, -0.7826159000396729, -0.056467071175575256, -0.9956054091453552, 0.3208676278591156, -0.16524538397789001, -0.024144764989614487, -0.1120188981294632, 1.7416409254074097, -0.9984129667282104, -2.136883497238159, 0.30848419666290283, 0.21141894161701202, -0.3664252758026123, 0.24236199259757996, 1.5809601545333862, 0.5825785398483276, 1.4130053520202637, 1.325688123703003, 1.0059993267059326, -0.7253363132476807, -1.333882451057434, 0.6692898869514465, 0.9984389543533325, -1.4087319374084473, 0.7632980942726135, 0.05599544569849968, -0.42236146330833435, 0.614902913570404, 1.288032054901123, 0.39843717217445374, -2.008735418319702, 0.6894952058792114, -0.7848758101463318, 0.7522713541984558, 0.702652096748352, 0.7873364686965942, 0.16378530859947205, 0.7054703235626221, -1.238430142402649, -1.032576084136963, -0.636588454246521, -0.6159647107124329, 1.8914425373077393, -0.27350911498069763, 0.5810586810112, -0.12000802159309387, -1.3121260404586792, -0.06891252100467682, 0.6772621870040894, 0.3261282444000244, -0.49795836210250854, 0.8486253023147583, -0.6733786463737488, -1.23717200756073, -1.3281934261322021, -0.4982353150844574, -0.994861900806427, -0.915661633014679, 0.9850910902023315, 0.8375134468078613, 0.3700721561908722, 1.886382818222046, 0.554009199142456, 0.12751761078834534, -2.7230398654937744, 0.9174501299858093, 0.24914106726646423, -0.007564458530396223, 0.9052736759185791, 0.22774343192577362, 0.9413176774978638, -0.07224109023809433, 0.5779087543487549, -2.324106216430664, 2.271766424179077, -0.20589441061019897, 0.7149239778518677, 0.035322632640600204, -0.12072261422872543, 0.92641282081604, 0.5109004378318787, 0.5772576332092285, -1.0948251485824585, 0.7359111309051514, -0.6310619115829468, 1.2900400161743164, 0.8251256942749023, -0.792436420917511, -0.09113888442516327, 1.2060855627059937, 0.4949844777584076, -0.4597918391227722, -0.9863705635070801, -0.9615267515182495, 1.0102466344833374, 1.7910784482955933, -0.07580430060625076, -0.014702819287776947, 0.8832707405090332, 0.6488082408905029, -1.3215636014938354, 0.045201320201158524, -0.8223010897636414, -0.7095978856086731, 1.636526346206665, 2.0235347747802734, -0.10173211991786957, -0.29197952151298523, -0.8090523481369019, -1.2568094730377197, 0.8198114633560181, 0.06649502366781235, 0.05228804424405098, 0.6053626537322998, -0.5434231162071228, 1.1689517498016357, 0.861772894859314, 0.9042066335678101, 0.22194026410579681, 0.3322806656360626, 0.2825715243816376, -0.348773330450058, -1.248035192489624, -0.2191651165485382, -1.107670783996582, -2.5529913902282715, 0.49673113226890564, -0.25814709067344666, -1.4067559242248535, 0.04726923257112503, -1.0971180200576782, 0.8387791514396667, -0.5380597710609436, -1.164977788925171, -1.4310919046401978, 0.16920630633831024, -0.10170774906873703, 0.9159642457962036, -1.6387052536010742, 0.014857192523777485, 1.3055166006088257, 0.9497262835502625, -0.6393616795539856, 0.9609968662261963, 0.19016434252262115, 1.063995361328125, 0.9025777578353882, -0.31932535767555237, 0.5443243384361267, 0.14978903532028198, -1.4133994579315186, 0.4882749021053314, 1.2121703624725342, 0.1760523021221161, 1.4019505977630615, -0.6037362813949585, 0.04357166588306427, 0.3915720283985138, -0.48450103402137756, -0.4667533338069916, -0.7163872122764587, 0.7324440479278564, 0.01945660263299942, -0.8839326500892639, 0.013242832385003567, -0.03537610545754433, -0.12043191492557526, 0.19197985529899597, -1.4787895679473877, -0.1442856341600418, -0.2362084835767746, -0.6414259672164917, -1.2183314561843872, -0.15455590188503265, 1.3246519565582275, -0.8046131730079651, -0.18691180646419525, 0.43269428610801697, 0.325318843126297, 0.6140092015266418, 0.6016025543212891, -0.5456548929214478, -0.46427789330482483, -0.18661601841449738, -0.35304850339889526, 0.3828447163105011, 1.3844252824783325, -0.07609816640615463, -1.0221353769302368, 0.7984830737113953, -0.4381914436817169, 0.08069957047700882, 1.963392972946167, 0.15611717104911804, -0.8194625377655029, 0.25340011715888977, -0.6445023417472839, 1.961371898651123, 1.7107545137405396, 1.2612711191177368, -0.21511664986610413, -1.0043137073516846, 0.606645941734314, -0.3920847475528717, -0.3406657874584198, 0.8625552654266357, 0.45061689615249634, -0.15695036947727203, -1.2189618349075317, 0.5582250356674194, 1.3087158203125, -0.9260504245758057, -0.8110435009002686, 0.11382056027650833, -0.8223633170127869, 1.0285117626190186, 0.7022882699966431, 0.30831366777420044, 0.12699279189109802, 1.602009892463684, 0.8059929013252258, -0.4126410186290741, 0.5716877579689026, 0.5184084177017212, -0.11844043433666229, -2.0691800117492676, -1.0700523853302002, 0.350237637758255, -0.5121371150016785, -1.5850192308425903, 1.3140705823898315, -1.2228145599365234, -0.9037222266197205, 0.5196334719657898, 0.14507821202278137, 1.4708735942840576, 0.3213878571987152, 1.5760127305984497, 1.9922648668289185, 0.905849039554596, 0.32178640365600586, 1.3602169752120972, -0.07859659194946289, -0.4565185010433197, 1.7693819999694824, -0.44345349073410034, 0.5245234370231628, 1.1404273509979248, -0.30886581540107727, -1.1343697309494019, -0.7907695174217224, -1.244299054145813, -0.7208666801452637, 1.240463376045227, 0.1515725702047348, -1.126521348953247, 0.2344219982624054, 1.6455687284469604, 0.05608653649687767, -0.3013286292552948, 0.6060263514518738, 0.25389087200164795, -0.7766618132591248, -0.015329400077462196, -0.9302946925163269, 0.49115630984306335, -0.26137542724609375, -0.3872896134853363, 0.3277131915092468, 0.41689571738243103, 1.2537418603897095, 0.030265770852565765, 0.1601475030183792, 1.2788968086242676, -1.3285551071166992, 1.5325180292129517, -0.659894585609436, 0.28870126605033875, -2.3506362438201904, 1.3416190147399902, -0.8045089244842529, 1.805290937423706, -2.638542652130127, 0.3820735216140747, -0.48833397030830383, -0.372670441865921, 0.20769934356212616, -0.36060044169425964, 0.09061907231807709, -0.17551396787166595, -1.0600612163543701, -0.13433142006397247, -0.7173743844032288, 0.5033961534500122, 1.07386314868927, 1.3028653860092163, -1.037102222442627, -0.23950213193893433, -1.7881760597229004, -0.21857991814613342, -0.7072876691818237, 0.4181123673915863, -1.9229010343551636, -0.10421766340732574, -1.930533528327942, -2.395026445388794, -1.2704970836639404, -0.8117746710777283, 1.1555625200271606, 0.08253280073404312, -0.7999945282936096, 1.0708729028701782, -0.2841446101665497, -1.833234190940857, 1.0402544736862183, -2.186549186706543 ]
https://github.com/huggingface/datasets/issues/3655
Pubmed dataset not reachable
@albertvillanova When I tried below codes, I got the similar error ``` dataset=load_dataset("pubmed",split="train") Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0601.xml.gz ```
## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0
977
17
Pubmed dataset not reachable ## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0 @albertvillanova When I tried below codes, I got the similar error ``` dataset=load_dataset("pubmed",split="train") Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0601.xml.gz ```
[ -1.2133049964904785, -0.875700056552887, -0.778522789478302, 1.420082449913025, -0.223030224442482, -1.207221269607544, 0.1702091246843338, -0.9646809697151184, 1.6917990446090698, -0.7238134145736694, 0.3323289752006531, -1.6535383462905884, -0.06741004437208176, -0.5737534165382385, -0.6751201152801514, -0.8915095925331116, -0.36083775758743286, -0.6156532764434814, 1.0099228620529175, 2.4714407920837402, 1.2459055185317993, -1.3541157245635986, 2.6699435710906982, 0.6619043350219727, -0.12677927315235138, -1.0518866777420044, 0.5020572543144226, -0.012206774204969406, -1.2707778215408325, -0.3998318314552307, -0.9334609508514404, -0.17269974946975708, -0.5208917856216431, -0.564673900604248, 0.07749251276254654, 0.3419371247291565, -0.2774796187877655, -0.5051412582397461, -0.5373647212982178, -0.8331037163734436, 0.5358089804649353, -0.40405505895614624, 0.860387921333313, -0.3396660387516022, 1.8645646572113037, -0.5736085772514343, 0.5788528323173523, 0.7788511514663696, 1.3139550685882568, 0.18300257623195648, -0.07919179648160934, 0.34437787532806396, 0.41138219833374023, 0.06975091993808746, 0.51677405834198, 1.179336428642273, 0.5992225408554077, 0.4070532023906708, 0.6438618302345276, -2.2626333236694336, 1.248131275177002, -1.0255577564239502, 0.2390553504228592, 1.355825662612915, -1.089736819267273, 0.3898395299911499, -1.841034173965454, -0.09483418613672256, 0.6332847476005554, -2.2592430114746094, 0.21810683608055115, -1.288129448890686, -0.4839169979095459, 0.996131956577301, 0.34281113743782043, -1.2036982774734497, 0.09341023117303848, -0.320308655500412, 1.0552719831466675, 0.4707909822463989, 1.1894097328186035, -1.798641324043274, -0.06436866521835327, -0.25696563720703125, 0.10649888217449188, -1.227021336555481, -1.5527740716934204, 0.520788311958313, 0.7483368515968323, 0.5992476940155029, -0.029859634116292, 0.9732339382171631, -0.8592634797096252, 0.8060798645019531, -1.0243639945983887, -1.7040067911148071, -1.4384582042694092, -2.315772294998169, -2.3675644397735596, 0.7741530537605286, -0.3864983320236206, -0.4071347713470459, 2.0638911724090576, -0.9784059524536133, -1.880867838859558, 1.1217597723007202, 0.2569170594215393, -0.028325283899903297, 2.3097429275512695, 0.22547246515750885, -0.7398358583450317, 0.4921948313713074, -0.8384252190589905, 0.5871894359588623, -0.37033650279045105, 1.385041356086731, 0.5254437327384949, -0.9815220832824707, 1.6818513870239258, -0.4449674189090729, 0.5666736960411072, -0.7460697889328003, -0.45093831419944763, -0.7318447232246399, 0.22074250876903534, 1.970353364944458, -0.3443305492401123, 1.5735688209533691, -0.368450403213501, -1.530370831489563, -1.5736401081085205, 0.8275117874145508, 0.446821928024292, -0.7541923522949219, 0.09225796908140182, -0.31123441457748413, 0.13075989484786987, -0.0008672047406435013, 1.0577356815338135, 1.1942130327224731, 0.7583577632904053, -0.26690006256103516, -0.8465272784233093, 0.32222676277160645, 0.12862348556518555, -0.7542235255241394, -1.7583630084991455, -0.3937131464481354, 0.16878405213356018, 0.5568802356719971, -1.2137367725372314, 1.8076775074005127, 0.8370695114135742, 1.9572876691818237, 0.9952637553215027, -0.30042731761932373, 1.4747573137283325, 0.14905355870723724, 1.9746419191360474, -0.3255043029785156, 0.6716923117637634, -0.2607176899909973, -1.0965791940689087, 0.7854899168014526, -0.34367233514785767, -2.0834426879882812, -0.7062498927116394, -0.961463451385498, -0.06021115928888321, -0.7222883105278015, 0.9549145102500916, -0.19704361259937286, -1.4261367321014404, 0.1726294606924057, -0.7671164274215698, 0.10620881617069244, -1.2862818241119385, 0.2628563344478607, 0.7439919710159302, -0.6796855926513672, 0.13438217341899872, -0.33367857336997986, -1.305884599685669, -0.5140133500099182, 0.29812097549438477, 2.0590901374816895, -0.7984617948532104, 0.9545932412147522, 0.9666287302970886, -0.719192385673523, -0.023321988061070442, 0.3198562264442444, -0.23365917801856995, 0.8560932874679565, -1.1248347759246826, -0.308641642332077, 1.1801085472106934, -0.07443852722644806, -0.7032470107078552, 1.5036442279815674, 0.8428374528884888, -0.9963034391403198, -0.2028190791606903, -0.14019420742988586, -0.7828412055969238, -0.03653324395418167, -1.6662336587905884, -0.0411703959107399, 0.36516711115837097, -1.4489203691482544, -0.48498907685279846, -0.18538710474967957, 1.424651861190796, -0.08630207180976868, 1.47394859790802, -0.2820885181427002, -0.21899688243865967, -0.4944644570350647, -0.37860915064811707, 0.18450398743152618, -0.32098188996315, -0.6766118407249451, 0.20453356206417084, -0.8057897090911865, 0.32715338468551636, 1.4212278127670288, 0.30120569467544556, 0.10366269201040268, 0.626218318939209, 1.079750895500183, 0.3083702623844147, -0.12066841870546341, -0.8898607492446899, -1.5666520595550537, 2.0189208984375, -1.3716834783554077, 2.006887674331665, 0.6021614670753479, -0.1050124242901802, -1.7733112573623657, -1.9095667600631714, 1.3441429138183594, 1.1208994388580322, 2.3353769779205322, 0.6114453077316284, 0.4307534396648407, -0.8919727206230164, -0.6177260875701904, 0.17930953204631805, -0.95624840259552, -0.875262975692749, 0.1947120726108551, 2.326744556427002, 1.7353651523590088, -0.5228469967842102, -0.2965577244758606, -1.0486347675323486, 1.3009867668151855, -0.27220624685287476, 0.2775479555130005, 1.9627623558044434, -0.22826872766017914, -1.05953049659729, 1.3209128379821777, -2.3286242485046387, 0.18675938248634338, 1.9865514039993286, 0.21191805601119995, 0.0906415730714798, -1.457849383354187, -0.7292542457580566, -0.2424025684595108, -0.4658033549785614, -1.2681186199188232, 0.46223828196525574, -0.33161643147468567, -0.8759928345680237, -1.3646492958068848, 0.14549799263477325, -1.0495033264160156, -1.7925390005111694, 0.21070697903633118, 1.8468819856643677, 1.8883466720581055, -0.6680906414985657, 1.4132416248321533, -0.2134137600660324, 0.11949005722999573, 1.3481162786483765, 1.2134590148925781, 3.1283769607543945, 2.0266826152801514, -1.2732540369033813, 0.736668586730957, -0.1543819010257721, -0.4296322464942932, 1.1693915128707886, -1.1971336603164673, 1.18301260471344, -0.32601305842399597, -1.28755784034729, -1.1611230373382568, 0.937353789806366, 0.48294466733932495, 0.08722217381000519, -0.40599027276039124, 1.2145971059799194, 0.057549141347408295, 1.418410301208496, 0.5887226462364197, -0.3160375654697418, 0.795219361782074, -0.430629163980484, -0.5336627960205078, 1.5128604173660278, 0.20626692473888397, -1.4179197549819946, -2.3320353031158447, -0.18589137494564056, -0.9734936952590942, -0.1261856108903885, -0.5716139078140259, -0.9673787355422974, 1.625258445739746, 0.46316036581993103, -1.2097841501235962, -0.25677236914634705, -0.28367742896080017, -0.5621220469474792, 2.8054380416870117, -1.431502342224121, -0.22515825927257538, -1.0573755502700806, -0.522641122341156, 1.7340388298034668, -1.0788244009017944, -0.17204062640666962, -1.0679749250411987, -0.6193118691444397, -1.3458231687545776, -0.6317289471626282, 0.048135653138160706, -0.9321752190589905, 0.9153728485107422, 0.09865652769804001, -1.16400945186615, -0.20898301899433136, -0.8836168646812439, 0.8313030004501343, -0.057132937014102936, 0.2501721978187561, 1.9457134008407593, 0.40836066007614136, -0.4144859313964844, 0.6087231040000916, 1.062819004058838, 0.6735759973526001, -0.6688947677612305, 0.42367804050445557, -0.6354283094406128, 0.3086514174938202, -1.352554440498352, 0.20154882967472076, -2.877913236618042, 0.6489658951759338, -0.04385661333799362, -0.0848584771156311, -0.18841136991977692, -1.2737174034118652, 1.0717179775238037, 2.5638668537139893, -1.2301406860351562, 0.566748321056366, 0.3203642964363098, 1.2959961891174316, -1.5149238109588623, 0.3564971685409546, -0.4250369369983673, 2.110621452331543, 0.12317472696304321, 1.1972464323043823, -0.3925829827785492, -2.1910979747772217, 0.7312483787536621, -1.2411280870437622, -1.2593969106674194, 0.7343898415565491, -0.8164786696434021, 0.06929131597280502, -1.3326466083526611, -0.18286658823490143, -0.8608633875846863, -1.2549749612808228, 0.6875308752059937, 0.0715700313448906, 0.4763816297054291, -0.5639505386352539, 0.4257752001285553, -2.1432228088378906, -1.3143322467803955, -0.2807023227214813, -0.9898658394813538, 0.4723762571811676, -0.25121399760246277, 0.6854095458984375, -0.21318934857845306, -0.031175781041383743, 0.37345486879348755, 1.4514660835266113, 3.387115955352783, 0.1258893460035324, 0.2252853810787201, -0.18226757645606995, -1.043857216835022, 1.4651024341583252, 0.9216890931129456, -0.16293583810329437, -0.5597572326660156, -1.0663504600524902, 1.2468397617340088, 2.0334248542785645, 1.1009280681610107, 0.05773737281560898, -0.7858238816261292, -0.7327414155006409, 0.0605086088180542, 0.1171317994594574, 0.4697125256061554, 0.958566427230835, 0.17444543540477753, 0.07188846915960312, 1.3388952016830444, 1.249478816986084, -0.33252841234207153, 0.3724024295806885, -0.9325343370437622, -0.34972381591796875, 0.5802707672119141, 0.3083583116531372, -0.004880642518401146, 0.23630407452583313, -1.01753830909729, -0.2809752821922302, -0.266521692276001, -0.9436621069908142, -0.7445698380470276, -0.38273051381111145, -0.3911009430885315, 1.6689282655715942, 0.15331262350082397, -0.4630020260810852, -0.018275823444128036, -0.7739410996437073, -0.04737282544374466, -1.0485795736312866, 0.3105001151561737, -0.19650429487228394, -0.022791169583797455, -0.07679518312215805, 1.663955807685852, -0.9552924633026123, -2.105178117752075, 0.2633683979511261, 0.22604362666606903, -0.3715684413909912, 0.2506145238876343, 1.59503972530365, 0.5960461497306824, 1.364187240600586, 1.3101736307144165, 1.0196201801300049, -0.6907167434692383, -1.2937203645706177, 0.6531598567962646, 0.9476326704025269, -1.4098726511001587, 0.7860413193702698, 0.034967973828315735, -0.3996970057487488, 0.5948646068572998, 1.2581406831741333, 0.4032626152038574, -1.9981204271316528, 0.6646230220794678, -0.8000760078430176, 0.7641427516937256, 0.7034340500831604, 0.7813893556594849, 0.210033118724823, 0.7397658228874207, -1.233662724494934, -1.0204905271530151, -0.609255313873291, -0.5852606296539307, 1.8684138059616089, -0.24592947959899902, 0.5718154907226562, -0.12927024066448212, -1.2475403547286987, -0.07889954745769501, 0.7177475094795227, 0.37037208676338196, -0.4438540041446686, 0.8049877882003784, -0.6466377973556519, -1.1807793378829956, -1.3264648914337158, -0.49139487743377686, -1.0401461124420166, -0.907993495464325, 0.986560046672821, 0.8094577789306641, 0.3598758280277252, 1.877243995666504, 0.5970647931098938, 0.14296279847621918, -2.711660385131836, 0.9490329623222351, 0.25738832354545593, 0.009622519835829735, 0.8756466507911682, 0.21301648020744324, 0.9900632500648499, -0.12477540224790573, 0.6004182696342468, -2.3173482418060303, 2.2674753665924072, -0.18661069869995117, 0.6589182615280151, 0.032211631536483765, -0.14570322632789612, 0.8697344064712524, 0.45759841799736023, 0.5734783411026001, -1.1066433191299438, 0.7133054733276367, -0.685426652431488, 1.265211582183838, 0.8011142015457153, -0.8627485036849976, -0.056805871427059174, 1.2663993835449219, 0.4834848940372467, -0.4554287791252136, -1.0068161487579346, -0.9477711319923401, 1.037560224533081, 1.747470736503601, -0.11076682806015015, -0.0984133630990982, 0.9365701079368591, 0.6227424144744873, -1.3067125082015991, 0.10153356194496155, -0.7995705008506775, -0.669307291507721, 1.708796501159668, 1.9856407642364502, -0.1047775000333786, -0.305976539850235, -0.8672672510147095, -1.2934907674789429, 0.800290048122406, 0.11817538738250732, 0.027684049680829048, 0.6407731175422668, -0.5588246583938599, 1.2083625793457031, 0.7527024745941162, 0.9024238586425781, 0.18193842470645905, 0.3756137788295746, 0.33707481622695923, -0.3998749256134033, -1.2721377611160278, -0.21808916330337524, -1.0899206399917603, -2.5827009677886963, 0.49286985397338867, -0.25289762020111084, -1.3745280504226685, 0.057441286742687225, -1.103102684020996, 0.8407811522483826, -0.5643157958984375, -1.1894774436950684, -1.4097421169281006, 0.18804432451725006, -0.0995236486196518, 0.8649100065231323, -1.6212455034255981, 0.01906164363026619, 1.3384374380111694, 0.9924376606941223, -0.6786519289016724, 0.9368112087249756, 0.15778736770153046, 1.0717965364456177, 0.8604384660720825, -0.34928643703460693, 0.615477442741394, 0.05537980794906616, -1.4549028873443604, 0.5463244318962097, 1.2114449739456177, 0.14202246069908142, 1.3704859018325806, -0.5914433598518372, 0.035307377576828, 0.3995371460914612, -0.5160354375839233, -0.540566623210907, -0.6930501461029053, 0.6890693306922913, -0.02705947309732437, -0.9663535952568054, 0.0017567286267876625, 0.02083507925271988, -0.09392159432172775, 0.2042677253484726, -1.4222818613052368, -0.1399192214012146, -0.238502636551857, -0.679824948310852, -1.2061090469360352, -0.14825135469436646, 1.220228910446167, -0.8132075667381287, -0.22130706906318665, 0.4173848330974579, 0.26532188057899475, 0.5654183626174927, 0.4905310273170471, -0.6164219975471497, -0.4325586259365082, -0.21728308498859406, -0.3785020709037781, 0.3822680413722992, 1.4072322845458984, -0.06221238523721695, -1.0540308952331543, 0.7698364853858948, -0.4599984586238861, 0.05457664281129837, 1.9981869459152222, 0.14855603873729706, -0.8153573274612427, 0.20510941743850708, -0.6630393266677856, 1.9635443687438965, 1.7183536291122437, 1.239729404449463, -0.1971396654844284, -0.9352988004684448, 0.5731433033943176, -0.4770981967449188, -0.3487485647201538, 0.8503385782241821, 0.43078187108039856, -0.12398490309715271, -1.2115925550460815, 0.5545793771743774, 1.3125042915344238, -0.8725021481513977, -0.7959861159324646, 0.07331815361976624, -0.8762333989143372, 1.014595627784729, 0.718658983707428, 0.32080182433128357, 0.15488484501838684, 1.5493168830871582, 0.7993460893630981, -0.37714818120002747, 0.5680868029594421, 0.5005396604537964, -0.10549166798591614, -2.1118361949920654, -1.041412353515625, 0.3937806487083435, -0.5137338638305664, -1.5816566944122314, 1.3250041007995605, -1.159964919090271, -0.8806833028793335, 0.5466009378433228, 0.20960336923599243, 1.4636297225952148, 0.32837754487991333, 1.6032441854476929, 1.993059754371643, 0.8722295165061951, 0.26811036467552185, 1.2983589172363281, -0.07239218056201935, -0.43948274850845337, 1.804635763168335, -0.40331441164016724, 0.5260711312294006, 1.0942553281784058, -0.2947230339050293, -1.1723273992538452, -0.7834949493408203, -1.3334245681762695, -0.7023783922195435, 1.267442226409912, 0.19129657745361328, -1.1074873208999634, 0.16558516025543213, 1.6101619005203247, 0.056801363825798035, -0.306885689496994, 0.7467480897903442, 0.22405779361724854, -0.8046642541885376, 0.020900866016745567, -0.901606559753418, 0.520566999912262, -0.17805588245391846, -0.34608185291290283, 0.2895398437976837, 0.40837985277175903, 1.305779218673706, 0.032973021268844604, 0.19072088599205017, 1.3500028848648071, -1.227449655532837, 1.5793876647949219, -0.7040845155715942, 0.3053683936595917, -2.357785940170288, 1.2917561531066895, -0.8471229076385498, 1.7735737562179565, -2.6497769355773926, 0.37871283292770386, -0.43446508049964905, -0.3090716600418091, 0.2210749387741089, -0.391755610704422, 0.050401344895362854, -0.1839618980884552, -1.0927894115447998, -0.09973490983247757, -0.693558394908905, 0.4983382821083069, 1.0885350704193115, 1.383315920829773, -1.1043412685394287, -0.23403628170490265, -1.8661556243896484, -0.17256797850131989, -0.799792468547821, 0.4778177738189697, -1.9140310287475586, -0.08268025517463684, -1.9548604488372803, -2.4289040565490723, -1.2816953659057617, -0.7787216901779175, 1.1827894449234009, 0.03745456784963608, -0.7713680863380432, 1.087593913078308, -0.22320738434791565, -1.8451372385025024, 1.0580800771713257, -2.2102439403533936 ]
https://github.com/huggingface/datasets/issues/3644
Add a GROUP BY operator
Hi ! At the moment you can use `to_pandas()` to get a pandas DataFrame that supports `group_by` operations (make sure your dataset fits in memory though) We use Arrow as a back-end for `datasets` and it doesn't have native group by (see https://github.com/apache/arrow/issues/2189) unfortunately. I just drafted what it could look like to have `group_by` in `datasets`: ```python from datasets import concatenate_datasets def group_by(d, col, join): """from: https://github.com/huggingface/datasets/issues/3644""" # Get the indices of each group groups = {key: [] for key in d.unique(col)} def create_groups_indices(key, i): groups[key].append(i) d.map(create_groups_indices, with_indices=True, input_columns=col) # Get one dataset object per group groups = {key: d.select(indices) for key, indices in groups.items()} # Apply join function groups = { key: dataset_group.map(join, batched=True, batch_size=len(dataset_group), remove_columns=d.column_names) for key, dataset_group in groups.items() } # Return concatenation of all the joined groups return concatenate_datasets(groups.values()) ``` example of usage: ```python def join(batch): # take the batch of all the examples of a group, and return a batch with one aggregated example # (we could aggregate examples into several rows instead of one, if you want) return {"total": [batch["i"]]} d = Dataset.from_dict({ "i": [i for i in range(50)], "group_key": [i % 4 for i in range(50)], }) print(group_by(d, "group_key", join)) # total # 0 [0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48] # 1 [1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49] # 2 [2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46] # 3 [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47] ``` Let me know if that helps ! cc @albertvillanova @mariosasko for visibility
**Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column.
978
271
Add a GROUP BY operator **Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column. Hi ! At the moment you can use `to_pandas()` to get a pandas DataFrame that supports `group_by` operations (make sure your dataset fits in memory though) We use Arrow as a back-end for `datasets` and it doesn't have native group by (see https://github.com/apache/arrow/issues/2189) unfortunately. I just drafted what it could look like to have `group_by` in `datasets`: ```python from datasets import concatenate_datasets def group_by(d, col, join): """from: https://github.com/huggingface/datasets/issues/3644""" # Get the indices of each group groups = {key: [] for key in d.unique(col)} def create_groups_indices(key, i): groups[key].append(i) d.map(create_groups_indices, with_indices=True, input_columns=col) # Get one dataset object per group groups = {key: d.select(indices) for key, indices in groups.items()} # Apply join function groups = { key: dataset_group.map(join, batched=True, batch_size=len(dataset_group), remove_columns=d.column_names) for key, dataset_group in groups.items() } # Return concatenation of all the joined groups return concatenate_datasets(groups.values()) ``` example of usage: ```python def join(batch): # take the batch of all the examples of a group, and return a batch with one aggregated example # (we could aggregate examples into several rows instead of one, if you want) return {"total": [batch["i"]]} d = Dataset.from_dict({ "i": [i for i in range(50)], "group_key": [i % 4 for i in range(50)], }) print(group_by(d, "group_key", join)) # total # 0 [0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48] # 1 [1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49] # 2 [2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46] # 3 [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47] ``` Let me know if that helps ! cc @albertvillanova @mariosasko for visibility
[ -1.2649974822998047, -0.9758623242378235, -0.788390040397644, 1.5149518251419067, -0.19254150986671448, -1.2414768934249878, 0.18476614356040955, -1.1992429494857788, 1.6573001146316528, -0.8058323264122009, 0.48877930641174316, -1.6476770639419556, -0.04355749115347862, -0.612837553024292, -0.7736255526542664, -0.8870532512664795, -0.4174593985080719, -0.6783455610275269, 1.0428389310836792, 2.5159666538238525, 1.228135108947754, -1.4173845052719116, 2.643627882003784, 0.7294040322303772, -0.11912201344966888, -0.9780504107475281, 0.6202033162117004, -0.024243338033556938, -1.1785378456115723, -0.4491642415523529, -1.0057601928710938, -0.1465596854686737, -0.5095758438110352, -0.44052115082740784, -0.08775199204683304, 0.4636000692844391, -0.32101497054100037, -0.4930031895637512, -0.6254774928092957, -0.8438013792037964, 0.48534294962882996, -0.43314477801322937, 1.0157057046890259, -0.3615816533565521, 1.746720790863037, -0.6331466436386108, 0.47281527519226074, 0.6717521548271179, 1.3863075971603394, 0.26023930311203003, -0.022842444479465485, 0.3182242512702942, 0.42581707239151, -0.13829997181892395, 0.5471469163894653, 1.2136585712432861, 0.7060502767562866, 0.46030858159065247, 0.8213571310043335, -2.1231467723846436, 1.2517999410629272, -1.2031830549240112, 0.3196184039115906, 1.3275943994522095, -0.8535203337669373, 0.3223439157009125, -1.7761149406433105, -0.11100547760725021, 0.6364269256591797, -2.191619396209717, 0.28741204738616943, -1.2873239517211914, -0.5414185523986816, 1.0583534240722656, 0.41728368401527405, -1.2858608961105347, 0.052256714552640915, -0.40361690521240234, 0.9440942406654358, 0.3177764415740967, 1.06393563747406, -1.7433977127075195, -0.011426130309700966, -0.3649598956108093, 0.09148941189050674, -1.231353998184204, -1.4505232572555542, 0.5827224254608154, 0.5128576755523682, 0.5436218976974487, -0.08814605325460434, 1.0279268026351929, -1.160483479499817, 0.808699905872345, -1.0695509910583496, -1.670318365097046, -1.4796117544174194, -2.296199083328247, -2.175844430923462, 0.7745853066444397, -0.4303884208202362, -0.5814473628997803, 1.9450629949569702, -0.9282475709915161, -1.5868940353393555, 1.117980718612671, 0.24976882338523865, 0.0951148271560669, 2.4439854621887207, 0.19448935985565186, -0.7824833989143372, 0.5694430470466614, -0.778517484664917, 0.7516402006149292, -0.3113479018211365, 1.3584003448486328, 0.31073617935180664, -0.9533784985542297, 1.6012128591537476, -0.33867141604423523, 0.5152151584625244, -0.5996986627578735, -0.49930042028427124, -0.6882275342941284, 0.44238850474357605, 1.8719401359558105, -0.25252798199653625, 1.4881348609924316, -0.22195705771446228, -1.5508415699005127, -1.5991482734680176, 0.865976095199585, 0.5494550466537476, -0.7875001430511475, 0.11288454383611679, -0.3538775146007538, 0.17896687984466553, -0.1481674313545227, 1.2014881372451782, 1.2346230745315552, 0.7702867984771729, -0.35360246896743774, -0.8278504014015198, 0.171566903591156, -0.04514814913272858, -0.8863531351089478, -1.6640745401382446, -0.37878143787384033, 0.1229773685336113, 0.6675857305526733, -1.2250099182128906, 1.8301888704299927, 0.9417589902877808, 1.839410424232483, 1.0871689319610596, -0.2964698076248169, 1.492264986038208, 0.09234746545553207, 1.782659888267517, -0.5158202052116394, 0.6074032187461853, -0.3243832588195801, -1.1786625385284424, 0.8816714882850647, -0.3297957479953766, -2.030252695083618, -0.8307357430458069, -0.7633114457130432, -0.14291781187057495, -0.8241062164306641, 0.9242371916770935, -0.418864905834198, -1.3831201791763306, 0.2980704605579376, -0.7768926024436951, 0.0022468063980340958, -1.1614524126052856, 0.2847009599208832, 0.5936657786369324, -0.6122095584869385, 0.0605311319231987, -0.15079283714294434, -1.2541753053665161, -0.3909798562526703, 0.1594967246055603, 1.9922593832015991, -0.7621906399726868, 0.8815479278564453, 1.0545291900634766, -0.6977753639221191, -0.037797726690769196, 0.3194870054721832, -0.3698379695415497, 0.8841453194618225, -1.026172399520874, -0.5834090709686279, 1.1652997732162476, -0.05649775266647339, -0.5690845251083374, 1.530582308769226, 0.593331515789032, -0.9914600849151611, -0.296389639377594, -0.09004819393157959, -0.840761661529541, 0.1148403137922287, -1.5764638185501099, -0.08671567589044571, 0.48048636317253113, -1.5732462406158447, -0.49864840507507324, -0.11248994618654251, 1.2029283046722412, -0.23918595910072327, 1.4262418746948242, -0.3745991885662079, -0.12224691361188889, -0.2820199429988861, -0.37618210911750793, 0.12642750144004822, -0.24335885047912598, -0.6468994617462158, 0.20875516533851624, -0.803003191947937, 0.38527607917785645, 1.3799821138381958, 0.3584006428718567, 0.024945110082626343, 0.46302902698516846, 1.0691536664962769, 0.39420026540756226, -0.0817345529794693, -0.8611162900924683, -1.4850738048553467, 2.065988779067993, -1.4795222282409668, 2.0412490367889404, 0.7672893404960632, -0.06633840501308441, -1.7496379613876343, -1.9155577421188354, 1.307643175125122, 1.2679369449615479, 2.3378381729125977, 0.5135713815689087, 0.42462679743766785, -0.8163408041000366, -0.6730939745903015, 0.278029203414917, -1.0662627220153809, -0.6557818651199341, 0.177076518535614, 2.369621992111206, 1.8489415645599365, -0.4356890022754669, -0.207231342792511, -0.9792075157165527, 1.4120723009109497, -0.31040599942207336, 0.20381024479866028, 1.9676378965377808, -0.24231606721878052, -1.1343162059783936, 1.3571888208389282, -2.333667755126953, 0.07358387112617493, 1.952643632888794, 0.3369930684566498, 0.13876456022262573, -1.313029170036316, -0.581362247467041, -0.42147547006607056, -0.3784652054309845, -1.2772692441940308, 0.4990706443786621, -0.1807783842086792, -0.8382742404937744, -1.3437080383300781, 0.20413723587989807, -1.1286265850067139, -1.6009711027145386, 0.20332098007202148, 1.8052253723144531, 2.124692678451538, -0.8664064407348633, 1.6035916805267334, -0.3349649906158447, 0.16605669260025024, 1.1259862184524536, 1.17887282371521, 3.101794719696045, 1.9250587224960327, -1.3296644687652588, 0.5974116921424866, -0.1747014820575714, -0.4253418743610382, 1.129769206047058, -1.2583715915679932, 1.326586127281189, -0.036746494472026825, -1.1582812070846558, -1.122557282447815, 0.9711512923240662, 0.39433595538139343, -0.02548292838037014, -0.5595840811729431, 1.0577281713485718, 0.05915199965238571, 1.3832345008850098, 0.5615488886833191, -0.20400482416152954, 0.5646898746490479, -0.43354561924934387, -0.45445698499679565, 1.5279595851898193, 0.14885678887367249, -1.412191390991211, -2.284015417098999, -0.134000763297081, -0.8742688894271851, 0.14920902252197266, -0.6103676557540894, -1.0385241508483887, 1.7111303806304932, 0.24371322989463806, -1.3141111135482788, -0.2866344749927521, -0.42748725414276123, -0.6242830753326416, 2.790576696395874, -1.3546404838562012, -0.22900643944740295, -1.050687551498413, -0.7226554751396179, 1.717665433883667, -1.144421100616455, -0.15779989957809448, -1.036759376525879, -0.5156813263893127, -1.3202613592147827, -0.6139951944351196, 0.08965489268302917, -0.9774641990661621, 0.8181247711181641, 0.17317599058151245, -1.168229341506958, -0.3679884076118469, -0.8089788556098938, 0.8826403617858887, -0.15509536862373352, 0.14509299397468567, 1.918969750404358, 0.27533093094825745, -0.3074449300765991, 0.7057552337646484, 1.240727424621582, 0.6754874587059021, -0.6397759914398193, 0.14688879251480103, -0.6908125281333923, 0.36980485916137695, -1.3157680034637451, 0.21718630194664001, -2.742719888687134, 0.6402110457420349, 0.009104562923312187, -0.054070845246315, 0.010740164667367935, -1.2442935705184937, 1.176127552986145, 2.5879738330841064, -1.1841192245483398, 0.4750974178314209, 0.3051771819591522, 1.1151013374328613, -1.5889562368392944, 0.30549460649490356, -0.40222010016441345, 2.0898897647857666, 0.18935513496398926, 1.195434808731079, -0.49972230195999146, -2.2674732208251953, 0.7286493182182312, -1.331112027168274, -1.2777099609375, 0.6985568404197693, -0.9508486390113831, 0.27278339862823486, -1.5236871242523193, -0.2538771629333496, -0.8353303670883179, -1.0541789531707764, 0.646632969379425, 0.049704328179359436, 0.34553784132003784, -0.5523374080657959, 0.37047815322875977, -2.2239513397216797, -1.4059208631515503, -0.22210246324539185, -0.9950542449951172, 0.468890517950058, -0.41528865694999695, 0.6933695077896118, -0.1437821388244629, -0.022851327434182167, 0.38395100831985474, 1.4514371156692505, 3.4942209720611572, 0.3043263554573059, 0.33221590518951416, -0.17741593718528748, -0.9082669019699097, 1.465807557106018, 0.893558144569397, -0.07587708532810211, -0.5131135582923889, -1.0695465803146362, 1.3202563524246216, 1.9045065641403198, 0.9686269164085388, 0.07681170850992203, -0.8410950899124146, -0.6694467663764954, -0.11590945720672607, 0.20775923132896423, 0.37447357177734375, 0.8727474808692932, 0.042925819754600525, 0.007675273343920708, 1.543691873550415, 1.096929907798767, -0.44304436445236206, 0.25371044874191284, -0.8919681310653687, -0.5059712529182434, 0.538577139377594, 0.25093328952789307, -0.038706935942173004, 0.38570278882980347, -0.9816134572029114, -0.3063690662384033, -0.3792993724346161, -0.8257309198379517, -0.610448956489563, -0.3430563509464264, -0.31690505146980286, 1.6472032070159912, 0.1113976389169693, -0.5339786410331726, 0.0014401981607079506, -0.8819073438644409, -0.07408569008111954, -1.1122679710388184, 0.1613422930240631, -0.049193914979696274, -0.12987442314624786, -0.24490132927894592, 1.8106926679611206, -0.8445698022842407, -2.0188450813293457, 0.1979973018169403, 0.3035009503364563, -0.2349289059638977, 0.18922466039657593, 1.6549084186553955, 0.6029565334320068, 1.421418309211731, 1.2428455352783203, 0.8904584050178528, -0.6296622157096863, -1.2904425859451294, 0.6149243712425232, 1.0337512493133545, -1.3137000799179077, 0.8719291687011719, -0.045275039970874786, -0.3992554545402527, 0.5276616811752319, 1.2941973209381104, 0.5357967019081116, -1.8880982398986816, 0.7980982661247253, -0.9744399189949036, 0.8358342051506042, 0.6952724456787109, 0.6381492018699646, 0.1987726390361786, 0.771324872970581, -1.1395491361618042, -1.0700205564498901, -0.8595576882362366, -0.6611009240150452, 2.025972366333008, -0.3533551096916199, 0.6930686831474304, -0.2673390209674835, -1.3010789155960083, -0.05940083786845207, 0.6696408987045288, 0.3512822091579437, -0.4365479052066803, 0.8356441855430603, -0.6366412043571472, -0.9974713921546936, -1.3515843152999878, -0.3269832134246826, -1.0349533557891846, -0.9087278842926025, 1.1504170894622803, 0.7550559043884277, 0.29413747787475586, 1.9311860799789429, 0.8046198487281799, 0.251242458820343, -2.4453184604644775, 0.8433482050895691, 0.2875916659832001, -0.08313989639282227, 0.8587732911109924, 0.3900362551212311, 0.9432234764099121, -0.03302372992038727, 0.42659759521484375, -2.4531772136688232, 2.2145731449127197, -0.16040721535682678, 0.7080287933349609, -0.04065192490816116, -0.21456754207611084, 1.0746599435806274, 0.5700860023498535, 0.527557373046875, -1.022945761680603, 0.47457757592201233, -0.5026518702507019, 1.3331348896026611, 0.9197827577590942, -0.706093430519104, -0.04136361926794052, 1.3329946994781494, 0.5142285227775574, -0.5643590688705444, -1.126772165298462, -0.8284087777137756, 0.9661961197853088, 1.6667726039886475, -0.03386877849698067, -0.1016373485326767, 0.7859545350074768, 0.6685531139373779, -1.2343922853469849, -0.0293696541339159, -0.7687935829162598, -0.8136346936225891, 1.801045298576355, 2.2230312824249268, -0.24111029505729675, -0.29588785767555237, -0.6096875667572021, -1.3268669843673706, 0.8372765779495239, -0.10941753536462784, 0.16992336511611938, 0.6012336611747742, -0.6598453521728516, 1.0181961059570312, 1.0044865608215332, 0.8962332606315613, 0.24738621711730957, 0.22746863961219788, 0.39002639055252075, -0.30977973341941833, -1.1672977209091187, -0.17926666140556335, -1.0950000286102295, -2.636413335800171, 0.44805702567100525, -0.13982492685317993, -1.3460026979446411, -0.012198184616863728, -1.031711220741272, 1.0612695217132568, -0.572029173374176, -0.982978105545044, -1.544453740119934, 0.21947258710861206, 0.07713592797517776, 1.0650560855865479, -1.6291762590408325, -0.30205047130584717, 1.198607087135315, 0.9479568600654602, -0.7264662384986877, 0.8746198415756226, 0.1724148690700531, 1.119957447052002, 0.7482485771179199, -0.4569619297981262, 0.5401379466056824, -0.0630967915058136, -1.3808958530426025, 0.4963517189025879, 1.1333849430084229, 0.12840574979782104, 1.5052565336227417, -0.48032236099243164, 0.09182367473840714, 0.39673006534576416, -0.6264710426330566, -0.43617919087409973, -0.5660547614097595, 0.6377729177474976, 0.09287022799253464, -0.8998534083366394, -0.16249561309814453, 0.02726166322827339, -0.30442869663238525, 0.1642259657382965, -1.4213086366653442, -0.10554671287536621, -0.3688127398490906, -0.7080214619636536, -1.1992251873016357, -0.1772577166557312, 1.3515456914901733, -0.832197368144989, -0.12414609640836716, 0.4791752099990845, 0.3242547810077667, 0.5537053942680359, 0.6544618010520935, -0.7464781403541565, -0.3787728548049927, -0.24257004261016846, -0.34468764066696167, 0.3484101891517639, 1.4008996486663818, -0.07846634835004807, -0.971393883228302, 0.60039883852005, -0.27755191922187805, 0.12118785828351974, 1.9780274629592896, 0.09340979903936386, -0.7319009900093079, 0.2442876696586609, -0.7192382216453552, 1.911426305770874, 1.6478856801986694, 1.2727713584899902, -0.15790364146232605, -0.8915001749992371, 0.7187010645866394, -0.37237748503685, -0.4859655499458313, 0.7701519131660461, 0.286260724067688, -0.18248724937438965, -1.5506902933120728, 0.7672904133796692, 1.2574820518493652, -0.9053995609283447, -0.805534839630127, 0.12592104077339172, -0.7969735860824585, 1.1224180459976196, 0.5950897932052612, 0.34636276960372925, 0.46695470809936523, 1.7305585145950317, 0.8548281192779541, -0.46577557921409607, 0.39137914776802063, 0.6913810968399048, -0.10105007141828537, -2.1066479682922363, -1.1496704816818237, 0.27045100927352905, -0.5965506434440613, -1.5924127101898193, 1.4018806219100952, -1.124803066253662, -1.0134741067886353, 0.642686665058136, 0.00869036465883255, 1.400253415107727, 0.38846656680107117, 1.5558297634124756, 2.0003557205200195, 0.8146163821220398, 0.4123639166355133, 1.2435487508773804, -0.12770912051200867, -0.436340868473053, 1.7922005653381348, -0.39636775851249695, 0.510535717010498, 1.1275968551635742, -0.16817143559455872, -1.1744455099105835, -0.7389085292816162, -1.28926420211792, -0.8196508884429932, 1.1474181413650513, 0.06630142778158188, -1.0874613523483276, 0.2699871063232422, 1.6463130712509155, 0.10568495839834213, -0.4371432662010193, 0.48819324374198914, 0.3561033606529236, -0.8123955130577087, -0.04768156632781029, -0.9102016687393188, 0.585314929485321, -0.13807973265647888, -0.3582388162612915, 0.2547701895236969, 0.4747343361377716, 1.475692629814148, -0.07460494339466095, 0.20622357726097107, 1.0210165977478027, -1.5064144134521484, 1.5534056425094604, -0.6924440264701843, 0.2821761965751648, -2.3616020679473877, 1.3469045162200928, -0.7793388366699219, 1.979552149772644, -2.7137744426727295, 0.46200916171073914, -0.5231531858444214, -0.48419997096061707, 0.22728770971298218, -0.44481199979782104, 0.1815934181213379, -0.00572997098788619, -1.1641706228256226, -0.05590679869055748, -0.5633537173271179, 0.6464536190032959, 1.112592339515686, 1.3360565900802612, -1.1202207803726196, -0.29287686944007874, -1.671897530555725, -0.05465045943856239, -0.7846315503120422, 0.08491092175245285, -1.9566093683242798, -0.14242258667945862, -1.8429007530212402, -2.266021728515625, -1.2906135320663452, -0.7755588293075562, 1.139367938041687, 0.17476144433021545, -0.9264694452285767, 1.2268964052200317, -0.35925206542015076, -1.8344517946243286, 1.1506152153015137, -2.2606899738311768 ]
https://github.com/huggingface/datasets/issues/3644
Add a GROUP BY operator
@lhoestq As of PyArrow 7.0.0, `pa.Table` has the [`group_by` method](https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.group_by), so we should also consider using that function for grouping.
**Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column.
978
20
Add a GROUP BY operator **Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column. @lhoestq As of PyArrow 7.0.0, `pa.Table` has the [`group_by` method](https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.group_by), so we should also consider using that function for grouping.
[ -1.2649974822998047, -0.9758623242378235, -0.788390040397644, 1.5149518251419067, -0.19254150986671448, -1.2414768934249878, 0.18476614356040955, -1.1992429494857788, 1.6573001146316528, -0.8058323264122009, 0.48877930641174316, -1.6476770639419556, -0.04355749115347862, -0.612837553024292, -0.7736255526542664, -0.8870532512664795, -0.4174593985080719, -0.6783455610275269, 1.0428389310836792, 2.5159666538238525, 1.228135108947754, -1.4173845052719116, 2.643627882003784, 0.7294040322303772, -0.11912201344966888, -0.9780504107475281, 0.6202033162117004, -0.024243338033556938, -1.1785378456115723, -0.4491642415523529, -1.0057601928710938, -0.1465596854686737, -0.5095758438110352, -0.44052115082740784, -0.08775199204683304, 0.4636000692844391, -0.32101497054100037, -0.4930031895637512, -0.6254774928092957, -0.8438013792037964, 0.48534294962882996, -0.43314477801322937, 1.0157057046890259, -0.3615816533565521, 1.746720790863037, -0.6331466436386108, 0.47281527519226074, 0.6717521548271179, 1.3863075971603394, 0.26023930311203003, -0.022842444479465485, 0.3182242512702942, 0.42581707239151, -0.13829997181892395, 0.5471469163894653, 1.2136585712432861, 0.7060502767562866, 0.46030858159065247, 0.8213571310043335, -2.1231467723846436, 1.2517999410629272, -1.2031830549240112, 0.3196184039115906, 1.3275943994522095, -0.8535203337669373, 0.3223439157009125, -1.7761149406433105, -0.11100547760725021, 0.6364269256591797, -2.191619396209717, 0.28741204738616943, -1.2873239517211914, -0.5414185523986816, 1.0583534240722656, 0.41728368401527405, -1.2858608961105347, 0.052256714552640915, -0.40361690521240234, 0.9440942406654358, 0.3177764415740967, 1.06393563747406, -1.7433977127075195, -0.011426130309700966, -0.3649598956108093, 0.09148941189050674, -1.231353998184204, -1.4505232572555542, 0.5827224254608154, 0.5128576755523682, 0.5436218976974487, -0.08814605325460434, 1.0279268026351929, -1.160483479499817, 0.808699905872345, -1.0695509910583496, -1.670318365097046, -1.4796117544174194, -2.296199083328247, -2.175844430923462, 0.7745853066444397, -0.4303884208202362, -0.5814473628997803, 1.9450629949569702, -0.9282475709915161, -1.5868940353393555, 1.117980718612671, 0.24976882338523865, 0.0951148271560669, 2.4439854621887207, 0.19448935985565186, -0.7824833989143372, 0.5694430470466614, -0.778517484664917, 0.7516402006149292, -0.3113479018211365, 1.3584003448486328, 0.31073617935180664, -0.9533784985542297, 1.6012128591537476, -0.33867141604423523, 0.5152151584625244, -0.5996986627578735, -0.49930042028427124, -0.6882275342941284, 0.44238850474357605, 1.8719401359558105, -0.25252798199653625, 1.4881348609924316, -0.22195705771446228, -1.5508415699005127, -1.5991482734680176, 0.865976095199585, 0.5494550466537476, -0.7875001430511475, 0.11288454383611679, -0.3538775146007538, 0.17896687984466553, -0.1481674313545227, 1.2014881372451782, 1.2346230745315552, 0.7702867984771729, -0.35360246896743774, -0.8278504014015198, 0.171566903591156, -0.04514814913272858, -0.8863531351089478, -1.6640745401382446, -0.37878143787384033, 0.1229773685336113, 0.6675857305526733, -1.2250099182128906, 1.8301888704299927, 0.9417589902877808, 1.839410424232483, 1.0871689319610596, -0.2964698076248169, 1.492264986038208, 0.09234746545553207, 1.782659888267517, -0.5158202052116394, 0.6074032187461853, -0.3243832588195801, -1.1786625385284424, 0.8816714882850647, -0.3297957479953766, -2.030252695083618, -0.8307357430458069, -0.7633114457130432, -0.14291781187057495, -0.8241062164306641, 0.9242371916770935, -0.418864905834198, -1.3831201791763306, 0.2980704605579376, -0.7768926024436951, 0.0022468063980340958, -1.1614524126052856, 0.2847009599208832, 0.5936657786369324, -0.6122095584869385, 0.0605311319231987, -0.15079283714294434, -1.2541753053665161, -0.3909798562526703, 0.1594967246055603, 1.9922593832015991, -0.7621906399726868, 0.8815479278564453, 1.0545291900634766, -0.6977753639221191, -0.037797726690769196, 0.3194870054721832, -0.3698379695415497, 0.8841453194618225, -1.026172399520874, -0.5834090709686279, 1.1652997732162476, -0.05649775266647339, -0.5690845251083374, 1.530582308769226, 0.593331515789032, -0.9914600849151611, -0.296389639377594, -0.09004819393157959, -0.840761661529541, 0.1148403137922287, -1.5764638185501099, -0.08671567589044571, 0.48048636317253113, -1.5732462406158447, -0.49864840507507324, -0.11248994618654251, 1.2029283046722412, -0.23918595910072327, 1.4262418746948242, -0.3745991885662079, -0.12224691361188889, -0.2820199429988861, -0.37618210911750793, 0.12642750144004822, -0.24335885047912598, -0.6468994617462158, 0.20875516533851624, -0.803003191947937, 0.38527607917785645, 1.3799821138381958, 0.3584006428718567, 0.024945110082626343, 0.46302902698516846, 1.0691536664962769, 0.39420026540756226, -0.0817345529794693, -0.8611162900924683, -1.4850738048553467, 2.065988779067993, -1.4795222282409668, 2.0412490367889404, 0.7672893404960632, -0.06633840501308441, -1.7496379613876343, -1.9155577421188354, 1.307643175125122, 1.2679369449615479, 2.3378381729125977, 0.5135713815689087, 0.42462679743766785, -0.8163408041000366, -0.6730939745903015, 0.278029203414917, -1.0662627220153809, -0.6557818651199341, 0.177076518535614, 2.369621992111206, 1.8489415645599365, -0.4356890022754669, -0.207231342792511, -0.9792075157165527, 1.4120723009109497, -0.31040599942207336, 0.20381024479866028, 1.9676378965377808, -0.24231606721878052, -1.1343162059783936, 1.3571888208389282, -2.333667755126953, 0.07358387112617493, 1.952643632888794, 0.3369930684566498, 0.13876456022262573, -1.313029170036316, -0.581362247467041, -0.42147547006607056, -0.3784652054309845, -1.2772692441940308, 0.4990706443786621, -0.1807783842086792, -0.8382742404937744, -1.3437080383300781, 0.20413723587989807, -1.1286265850067139, -1.6009711027145386, 0.20332098007202148, 1.8052253723144531, 2.124692678451538, -0.8664064407348633, 1.6035916805267334, -0.3349649906158447, 0.16605669260025024, 1.1259862184524536, 1.17887282371521, 3.101794719696045, 1.9250587224960327, -1.3296644687652588, 0.5974116921424866, -0.1747014820575714, -0.4253418743610382, 1.129769206047058, -1.2583715915679932, 1.326586127281189, -0.036746494472026825, -1.1582812070846558, -1.122557282447815, 0.9711512923240662, 0.39433595538139343, -0.02548292838037014, -0.5595840811729431, 1.0577281713485718, 0.05915199965238571, 1.3832345008850098, 0.5615488886833191, -0.20400482416152954, 0.5646898746490479, -0.43354561924934387, -0.45445698499679565, 1.5279595851898193, 0.14885678887367249, -1.412191390991211, -2.284015417098999, -0.134000763297081, -0.8742688894271851, 0.14920902252197266, -0.6103676557540894, -1.0385241508483887, 1.7111303806304932, 0.24371322989463806, -1.3141111135482788, -0.2866344749927521, -0.42748725414276123, -0.6242830753326416, 2.790576696395874, -1.3546404838562012, -0.22900643944740295, -1.050687551498413, -0.7226554751396179, 1.717665433883667, -1.144421100616455, -0.15779989957809448, -1.036759376525879, -0.5156813263893127, -1.3202613592147827, -0.6139951944351196, 0.08965489268302917, -0.9774641990661621, 0.8181247711181641, 0.17317599058151245, -1.168229341506958, -0.3679884076118469, -0.8089788556098938, 0.8826403617858887, -0.15509536862373352, 0.14509299397468567, 1.918969750404358, 0.27533093094825745, -0.3074449300765991, 0.7057552337646484, 1.240727424621582, 0.6754874587059021, -0.6397759914398193, 0.14688879251480103, -0.6908125281333923, 0.36980485916137695, -1.3157680034637451, 0.21718630194664001, -2.742719888687134, 0.6402110457420349, 0.009104562923312187, -0.054070845246315, 0.010740164667367935, -1.2442935705184937, 1.176127552986145, 2.5879738330841064, -1.1841192245483398, 0.4750974178314209, 0.3051771819591522, 1.1151013374328613, -1.5889562368392944, 0.30549460649490356, -0.40222010016441345, 2.0898897647857666, 0.18935513496398926, 1.195434808731079, -0.49972230195999146, -2.2674732208251953, 0.7286493182182312, -1.331112027168274, -1.2777099609375, 0.6985568404197693, -0.9508486390113831, 0.27278339862823486, -1.5236871242523193, -0.2538771629333496, -0.8353303670883179, -1.0541789531707764, 0.646632969379425, 0.049704328179359436, 0.34553784132003784, -0.5523374080657959, 0.37047815322875977, -2.2239513397216797, -1.4059208631515503, -0.22210246324539185, -0.9950542449951172, 0.468890517950058, -0.41528865694999695, 0.6933695077896118, -0.1437821388244629, -0.022851327434182167, 0.38395100831985474, 1.4514371156692505, 3.4942209720611572, 0.3043263554573059, 0.33221590518951416, -0.17741593718528748, -0.9082669019699097, 1.465807557106018, 0.893558144569397, -0.07587708532810211, -0.5131135582923889, -1.0695465803146362, 1.3202563524246216, 1.9045065641403198, 0.9686269164085388, 0.07681170850992203, -0.8410950899124146, -0.6694467663764954, -0.11590945720672607, 0.20775923132896423, 0.37447357177734375, 0.8727474808692932, 0.042925819754600525, 0.007675273343920708, 1.543691873550415, 1.096929907798767, -0.44304436445236206, 0.25371044874191284, -0.8919681310653687, -0.5059712529182434, 0.538577139377594, 0.25093328952789307, -0.038706935942173004, 0.38570278882980347, -0.9816134572029114, -0.3063690662384033, -0.3792993724346161, -0.8257309198379517, -0.610448956489563, -0.3430563509464264, -0.31690505146980286, 1.6472032070159912, 0.1113976389169693, -0.5339786410331726, 0.0014401981607079506, -0.8819073438644409, -0.07408569008111954, -1.1122679710388184, 0.1613422930240631, -0.049193914979696274, -0.12987442314624786, -0.24490132927894592, 1.8106926679611206, -0.8445698022842407, -2.0188450813293457, 0.1979973018169403, 0.3035009503364563, -0.2349289059638977, 0.18922466039657593, 1.6549084186553955, 0.6029565334320068, 1.421418309211731, 1.2428455352783203, 0.8904584050178528, -0.6296622157096863, -1.2904425859451294, 0.6149243712425232, 1.0337512493133545, -1.3137000799179077, 0.8719291687011719, -0.045275039970874786, -0.3992554545402527, 0.5276616811752319, 1.2941973209381104, 0.5357967019081116, -1.8880982398986816, 0.7980982661247253, -0.9744399189949036, 0.8358342051506042, 0.6952724456787109, 0.6381492018699646, 0.1987726390361786, 0.771324872970581, -1.1395491361618042, -1.0700205564498901, -0.8595576882362366, -0.6611009240150452, 2.025972366333008, -0.3533551096916199, 0.6930686831474304, -0.2673390209674835, -1.3010789155960083, -0.05940083786845207, 0.6696408987045288, 0.3512822091579437, -0.4365479052066803, 0.8356441855430603, -0.6366412043571472, -0.9974713921546936, -1.3515843152999878, -0.3269832134246826, -1.0349533557891846, -0.9087278842926025, 1.1504170894622803, 0.7550559043884277, 0.29413747787475586, 1.9311860799789429, 0.8046198487281799, 0.251242458820343, -2.4453184604644775, 0.8433482050895691, 0.2875916659832001, -0.08313989639282227, 0.8587732911109924, 0.3900362551212311, 0.9432234764099121, -0.03302372992038727, 0.42659759521484375, -2.4531772136688232, 2.2145731449127197, -0.16040721535682678, 0.7080287933349609, -0.04065192490816116, -0.21456754207611084, 1.0746599435806274, 0.5700860023498535, 0.527557373046875, -1.022945761680603, 0.47457757592201233, -0.5026518702507019, 1.3331348896026611, 0.9197827577590942, -0.706093430519104, -0.04136361926794052, 1.3329946994781494, 0.5142285227775574, -0.5643590688705444, -1.126772165298462, -0.8284087777137756, 0.9661961197853088, 1.6667726039886475, -0.03386877849698067, -0.1016373485326767, 0.7859545350074768, 0.6685531139373779, -1.2343922853469849, -0.0293696541339159, -0.7687935829162598, -0.8136346936225891, 1.801045298576355, 2.2230312824249268, -0.24111029505729675, -0.29588785767555237, -0.6096875667572021, -1.3268669843673706, 0.8372765779495239, -0.10941753536462784, 0.16992336511611938, 0.6012336611747742, -0.6598453521728516, 1.0181961059570312, 1.0044865608215332, 0.8962332606315613, 0.24738621711730957, 0.22746863961219788, 0.39002639055252075, -0.30977973341941833, -1.1672977209091187, -0.17926666140556335, -1.0950000286102295, -2.636413335800171, 0.44805702567100525, -0.13982492685317993, -1.3460026979446411, -0.012198184616863728, -1.031711220741272, 1.0612695217132568, -0.572029173374176, -0.982978105545044, -1.544453740119934, 0.21947258710861206, 0.07713592797517776, 1.0650560855865479, -1.6291762590408325, -0.30205047130584717, 1.198607087135315, 0.9479568600654602, -0.7264662384986877, 0.8746198415756226, 0.1724148690700531, 1.119957447052002, 0.7482485771179199, -0.4569619297981262, 0.5401379466056824, -0.0630967915058136, -1.3808958530426025, 0.4963517189025879, 1.1333849430084229, 0.12840574979782104, 1.5052565336227417, -0.48032236099243164, 0.09182367473840714, 0.39673006534576416, -0.6264710426330566, -0.43617919087409973, -0.5660547614097595, 0.6377729177474976, 0.09287022799253464, -0.8998534083366394, -0.16249561309814453, 0.02726166322827339, -0.30442869663238525, 0.1642259657382965, -1.4213086366653442, -0.10554671287536621, -0.3688127398490906, -0.7080214619636536, -1.1992251873016357, -0.1772577166557312, 1.3515456914901733, -0.832197368144989, -0.12414609640836716, 0.4791752099990845, 0.3242547810077667, 0.5537053942680359, 0.6544618010520935, -0.7464781403541565, -0.3787728548049927, -0.24257004261016846, -0.34468764066696167, 0.3484101891517639, 1.4008996486663818, -0.07846634835004807, -0.971393883228302, 0.60039883852005, -0.27755191922187805, 0.12118785828351974, 1.9780274629592896, 0.09340979903936386, -0.7319009900093079, 0.2442876696586609, -0.7192382216453552, 1.911426305770874, 1.6478856801986694, 1.2727713584899902, -0.15790364146232605, -0.8915001749992371, 0.7187010645866394, -0.37237748503685, -0.4859655499458313, 0.7701519131660461, 0.286260724067688, -0.18248724937438965, -1.5506902933120728, 0.7672904133796692, 1.2574820518493652, -0.9053995609283447, -0.805534839630127, 0.12592104077339172, -0.7969735860824585, 1.1224180459976196, 0.5950897932052612, 0.34636276960372925, 0.46695470809936523, 1.7305585145950317, 0.8548281192779541, -0.46577557921409607, 0.39137914776802063, 0.6913810968399048, -0.10105007141828537, -2.1066479682922363, -1.1496704816818237, 0.27045100927352905, -0.5965506434440613, -1.5924127101898193, 1.4018806219100952, -1.124803066253662, -1.0134741067886353, 0.642686665058136, 0.00869036465883255, 1.400253415107727, 0.38846656680107117, 1.5558297634124756, 2.0003557205200195, 0.8146163821220398, 0.4123639166355133, 1.2435487508773804, -0.12770912051200867, -0.436340868473053, 1.7922005653381348, -0.39636775851249695, 0.510535717010498, 1.1275968551635742, -0.16817143559455872, -1.1744455099105835, -0.7389085292816162, -1.28926420211792, -0.8196508884429932, 1.1474181413650513, 0.06630142778158188, -1.0874613523483276, 0.2699871063232422, 1.6463130712509155, 0.10568495839834213, -0.4371432662010193, 0.48819324374198914, 0.3561033606529236, -0.8123955130577087, -0.04768156632781029, -0.9102016687393188, 0.585314929485321, -0.13807973265647888, -0.3582388162612915, 0.2547701895236969, 0.4747343361377716, 1.475692629814148, -0.07460494339466095, 0.20622357726097107, 1.0210165977478027, -1.5064144134521484, 1.5534056425094604, -0.6924440264701843, 0.2821761965751648, -2.3616020679473877, 1.3469045162200928, -0.7793388366699219, 1.979552149772644, -2.7137744426727295, 0.46200916171073914, -0.5231531858444214, -0.48419997096061707, 0.22728770971298218, -0.44481199979782104, 0.1815934181213379, -0.00572997098788619, -1.1641706228256226, -0.05590679869055748, -0.5633537173271179, 0.6464536190032959, 1.112592339515686, 1.3360565900802612, -1.1202207803726196, -0.29287686944007874, -1.671897530555725, -0.05465045943856239, -0.7846315503120422, 0.08491092175245285, -1.9566093683242798, -0.14242258667945862, -1.8429007530212402, -2.266021728515625, -1.2906135320663452, -0.7755588293075562, 1.139367938041687, 0.17476144433021545, -0.9264694452285767, 1.2268964052200317, -0.35925206542015076, -1.8344517946243286, 1.1506152153015137, -2.2606899738311768 ]
https://github.com/huggingface/datasets/issues/3644
Add a GROUP BY operator
Hi, I have a similar issue as OP but the suggested solutions do not work for my case. Basically, I process documents through a model to extract the last_hidden_state, using the "map" method on a Dataset object, but would like to average the result over a categorical column at the end (i.e. groupby this column). - A to_pandas() saturates the memory, although it gives me the desired result through a .groupby().apply(np.mean, axis=0) on a smaller use-case, - The solution posted on Feb 4 is much too slow, - datasets_sql seems to not like the fact that I'm averaging np.arrays. So I'm kinda out of "non brute force" options... Any help appreciated
**Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column.
978
111
Add a GROUP BY operator **Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column. Hi, I have a similar issue as OP but the suggested solutions do not work for my case. Basically, I process documents through a model to extract the last_hidden_state, using the "map" method on a Dataset object, but would like to average the result over a categorical column at the end (i.e. groupby this column). - A to_pandas() saturates the memory, although it gives me the desired result through a .groupby().apply(np.mean, axis=0) on a smaller use-case, - The solution posted on Feb 4 is much too slow, - datasets_sql seems to not like the fact that I'm averaging np.arrays. So I'm kinda out of "non brute force" options... Any help appreciated
[ -1.2649974822998047, -0.9758623242378235, -0.788390040397644, 1.5149518251419067, -0.19254150986671448, -1.2414768934249878, 0.18476614356040955, -1.1992429494857788, 1.6573001146316528, -0.8058323264122009, 0.48877930641174316, -1.6476770639419556, -0.04355749115347862, -0.612837553024292, -0.7736255526542664, -0.8870532512664795, -0.4174593985080719, -0.6783455610275269, 1.0428389310836792, 2.5159666538238525, 1.228135108947754, -1.4173845052719116, 2.643627882003784, 0.7294040322303772, -0.11912201344966888, -0.9780504107475281, 0.6202033162117004, -0.024243338033556938, -1.1785378456115723, -0.4491642415523529, -1.0057601928710938, -0.1465596854686737, -0.5095758438110352, -0.44052115082740784, -0.08775199204683304, 0.4636000692844391, -0.32101497054100037, -0.4930031895637512, -0.6254774928092957, -0.8438013792037964, 0.48534294962882996, -0.43314477801322937, 1.0157057046890259, -0.3615816533565521, 1.746720790863037, -0.6331466436386108, 0.47281527519226074, 0.6717521548271179, 1.3863075971603394, 0.26023930311203003, -0.022842444479465485, 0.3182242512702942, 0.42581707239151, -0.13829997181892395, 0.5471469163894653, 1.2136585712432861, 0.7060502767562866, 0.46030858159065247, 0.8213571310043335, -2.1231467723846436, 1.2517999410629272, -1.2031830549240112, 0.3196184039115906, 1.3275943994522095, -0.8535203337669373, 0.3223439157009125, -1.7761149406433105, -0.11100547760725021, 0.6364269256591797, -2.191619396209717, 0.28741204738616943, -1.2873239517211914, -0.5414185523986816, 1.0583534240722656, 0.41728368401527405, -1.2858608961105347, 0.052256714552640915, -0.40361690521240234, 0.9440942406654358, 0.3177764415740967, 1.06393563747406, -1.7433977127075195, -0.011426130309700966, -0.3649598956108093, 0.09148941189050674, -1.231353998184204, -1.4505232572555542, 0.5827224254608154, 0.5128576755523682, 0.5436218976974487, -0.08814605325460434, 1.0279268026351929, -1.160483479499817, 0.808699905872345, -1.0695509910583496, -1.670318365097046, -1.4796117544174194, -2.296199083328247, -2.175844430923462, 0.7745853066444397, -0.4303884208202362, -0.5814473628997803, 1.9450629949569702, -0.9282475709915161, -1.5868940353393555, 1.117980718612671, 0.24976882338523865, 0.0951148271560669, 2.4439854621887207, 0.19448935985565186, -0.7824833989143372, 0.5694430470466614, -0.778517484664917, 0.7516402006149292, -0.3113479018211365, 1.3584003448486328, 0.31073617935180664, -0.9533784985542297, 1.6012128591537476, -0.33867141604423523, 0.5152151584625244, -0.5996986627578735, -0.49930042028427124, -0.6882275342941284, 0.44238850474357605, 1.8719401359558105, -0.25252798199653625, 1.4881348609924316, -0.22195705771446228, -1.5508415699005127, -1.5991482734680176, 0.865976095199585, 0.5494550466537476, -0.7875001430511475, 0.11288454383611679, -0.3538775146007538, 0.17896687984466553, -0.1481674313545227, 1.2014881372451782, 1.2346230745315552, 0.7702867984771729, -0.35360246896743774, -0.8278504014015198, 0.171566903591156, -0.04514814913272858, -0.8863531351089478, -1.6640745401382446, -0.37878143787384033, 0.1229773685336113, 0.6675857305526733, -1.2250099182128906, 1.8301888704299927, 0.9417589902877808, 1.839410424232483, 1.0871689319610596, -0.2964698076248169, 1.492264986038208, 0.09234746545553207, 1.782659888267517, -0.5158202052116394, 0.6074032187461853, -0.3243832588195801, -1.1786625385284424, 0.8816714882850647, -0.3297957479953766, -2.030252695083618, -0.8307357430458069, -0.7633114457130432, -0.14291781187057495, -0.8241062164306641, 0.9242371916770935, -0.418864905834198, -1.3831201791763306, 0.2980704605579376, -0.7768926024436951, 0.0022468063980340958, -1.1614524126052856, 0.2847009599208832, 0.5936657786369324, -0.6122095584869385, 0.0605311319231987, -0.15079283714294434, -1.2541753053665161, -0.3909798562526703, 0.1594967246055603, 1.9922593832015991, -0.7621906399726868, 0.8815479278564453, 1.0545291900634766, -0.6977753639221191, -0.037797726690769196, 0.3194870054721832, -0.3698379695415497, 0.8841453194618225, -1.026172399520874, -0.5834090709686279, 1.1652997732162476, -0.05649775266647339, -0.5690845251083374, 1.530582308769226, 0.593331515789032, -0.9914600849151611, -0.296389639377594, -0.09004819393157959, -0.840761661529541, 0.1148403137922287, -1.5764638185501099, -0.08671567589044571, 0.48048636317253113, -1.5732462406158447, -0.49864840507507324, -0.11248994618654251, 1.2029283046722412, -0.23918595910072327, 1.4262418746948242, -0.3745991885662079, -0.12224691361188889, -0.2820199429988861, -0.37618210911750793, 0.12642750144004822, -0.24335885047912598, -0.6468994617462158, 0.20875516533851624, -0.803003191947937, 0.38527607917785645, 1.3799821138381958, 0.3584006428718567, 0.024945110082626343, 0.46302902698516846, 1.0691536664962769, 0.39420026540756226, -0.0817345529794693, -0.8611162900924683, -1.4850738048553467, 2.065988779067993, -1.4795222282409668, 2.0412490367889404, 0.7672893404960632, -0.06633840501308441, -1.7496379613876343, -1.9155577421188354, 1.307643175125122, 1.2679369449615479, 2.3378381729125977, 0.5135713815689087, 0.42462679743766785, -0.8163408041000366, -0.6730939745903015, 0.278029203414917, -1.0662627220153809, -0.6557818651199341, 0.177076518535614, 2.369621992111206, 1.8489415645599365, -0.4356890022754669, -0.207231342792511, -0.9792075157165527, 1.4120723009109497, -0.31040599942207336, 0.20381024479866028, 1.9676378965377808, -0.24231606721878052, -1.1343162059783936, 1.3571888208389282, -2.333667755126953, 0.07358387112617493, 1.952643632888794, 0.3369930684566498, 0.13876456022262573, -1.313029170036316, -0.581362247467041, -0.42147547006607056, -0.3784652054309845, -1.2772692441940308, 0.4990706443786621, -0.1807783842086792, -0.8382742404937744, -1.3437080383300781, 0.20413723587989807, -1.1286265850067139, -1.6009711027145386, 0.20332098007202148, 1.8052253723144531, 2.124692678451538, -0.8664064407348633, 1.6035916805267334, -0.3349649906158447, 0.16605669260025024, 1.1259862184524536, 1.17887282371521, 3.101794719696045, 1.9250587224960327, -1.3296644687652588, 0.5974116921424866, -0.1747014820575714, -0.4253418743610382, 1.129769206047058, -1.2583715915679932, 1.326586127281189, -0.036746494472026825, -1.1582812070846558, -1.122557282447815, 0.9711512923240662, 0.39433595538139343, -0.02548292838037014, -0.5595840811729431, 1.0577281713485718, 0.05915199965238571, 1.3832345008850098, 0.5615488886833191, -0.20400482416152954, 0.5646898746490479, -0.43354561924934387, -0.45445698499679565, 1.5279595851898193, 0.14885678887367249, -1.412191390991211, -2.284015417098999, -0.134000763297081, -0.8742688894271851, 0.14920902252197266, -0.6103676557540894, -1.0385241508483887, 1.7111303806304932, 0.24371322989463806, -1.3141111135482788, -0.2866344749927521, -0.42748725414276123, -0.6242830753326416, 2.790576696395874, -1.3546404838562012, -0.22900643944740295, -1.050687551498413, -0.7226554751396179, 1.717665433883667, -1.144421100616455, -0.15779989957809448, -1.036759376525879, -0.5156813263893127, -1.3202613592147827, -0.6139951944351196, 0.08965489268302917, -0.9774641990661621, 0.8181247711181641, 0.17317599058151245, -1.168229341506958, -0.3679884076118469, -0.8089788556098938, 0.8826403617858887, -0.15509536862373352, 0.14509299397468567, 1.918969750404358, 0.27533093094825745, -0.3074449300765991, 0.7057552337646484, 1.240727424621582, 0.6754874587059021, -0.6397759914398193, 0.14688879251480103, -0.6908125281333923, 0.36980485916137695, -1.3157680034637451, 0.21718630194664001, -2.742719888687134, 0.6402110457420349, 0.009104562923312187, -0.054070845246315, 0.010740164667367935, -1.2442935705184937, 1.176127552986145, 2.5879738330841064, -1.1841192245483398, 0.4750974178314209, 0.3051771819591522, 1.1151013374328613, -1.5889562368392944, 0.30549460649490356, -0.40222010016441345, 2.0898897647857666, 0.18935513496398926, 1.195434808731079, -0.49972230195999146, -2.2674732208251953, 0.7286493182182312, -1.331112027168274, -1.2777099609375, 0.6985568404197693, -0.9508486390113831, 0.27278339862823486, -1.5236871242523193, -0.2538771629333496, -0.8353303670883179, -1.0541789531707764, 0.646632969379425, 0.049704328179359436, 0.34553784132003784, -0.5523374080657959, 0.37047815322875977, -2.2239513397216797, -1.4059208631515503, -0.22210246324539185, -0.9950542449951172, 0.468890517950058, -0.41528865694999695, 0.6933695077896118, -0.1437821388244629, -0.022851327434182167, 0.38395100831985474, 1.4514371156692505, 3.4942209720611572, 0.3043263554573059, 0.33221590518951416, -0.17741593718528748, -0.9082669019699097, 1.465807557106018, 0.893558144569397, -0.07587708532810211, -0.5131135582923889, -1.0695465803146362, 1.3202563524246216, 1.9045065641403198, 0.9686269164085388, 0.07681170850992203, -0.8410950899124146, -0.6694467663764954, -0.11590945720672607, 0.20775923132896423, 0.37447357177734375, 0.8727474808692932, 0.042925819754600525, 0.007675273343920708, 1.543691873550415, 1.096929907798767, -0.44304436445236206, 0.25371044874191284, -0.8919681310653687, -0.5059712529182434, 0.538577139377594, 0.25093328952789307, -0.038706935942173004, 0.38570278882980347, -0.9816134572029114, -0.3063690662384033, -0.3792993724346161, -0.8257309198379517, -0.610448956489563, -0.3430563509464264, -0.31690505146980286, 1.6472032070159912, 0.1113976389169693, -0.5339786410331726, 0.0014401981607079506, -0.8819073438644409, -0.07408569008111954, -1.1122679710388184, 0.1613422930240631, -0.049193914979696274, -0.12987442314624786, -0.24490132927894592, 1.8106926679611206, -0.8445698022842407, -2.0188450813293457, 0.1979973018169403, 0.3035009503364563, -0.2349289059638977, 0.18922466039657593, 1.6549084186553955, 0.6029565334320068, 1.421418309211731, 1.2428455352783203, 0.8904584050178528, -0.6296622157096863, -1.2904425859451294, 0.6149243712425232, 1.0337512493133545, -1.3137000799179077, 0.8719291687011719, -0.045275039970874786, -0.3992554545402527, 0.5276616811752319, 1.2941973209381104, 0.5357967019081116, -1.8880982398986816, 0.7980982661247253, -0.9744399189949036, 0.8358342051506042, 0.6952724456787109, 0.6381492018699646, 0.1987726390361786, 0.771324872970581, -1.1395491361618042, -1.0700205564498901, -0.8595576882362366, -0.6611009240150452, 2.025972366333008, -0.3533551096916199, 0.6930686831474304, -0.2673390209674835, -1.3010789155960083, -0.05940083786845207, 0.6696408987045288, 0.3512822091579437, -0.4365479052066803, 0.8356441855430603, -0.6366412043571472, -0.9974713921546936, -1.3515843152999878, -0.3269832134246826, -1.0349533557891846, -0.9087278842926025, 1.1504170894622803, 0.7550559043884277, 0.29413747787475586, 1.9311860799789429, 0.8046198487281799, 0.251242458820343, -2.4453184604644775, 0.8433482050895691, 0.2875916659832001, -0.08313989639282227, 0.8587732911109924, 0.3900362551212311, 0.9432234764099121, -0.03302372992038727, 0.42659759521484375, -2.4531772136688232, 2.2145731449127197, -0.16040721535682678, 0.7080287933349609, -0.04065192490816116, -0.21456754207611084, 1.0746599435806274, 0.5700860023498535, 0.527557373046875, -1.022945761680603, 0.47457757592201233, -0.5026518702507019, 1.3331348896026611, 0.9197827577590942, -0.706093430519104, -0.04136361926794052, 1.3329946994781494, 0.5142285227775574, -0.5643590688705444, -1.126772165298462, -0.8284087777137756, 0.9661961197853088, 1.6667726039886475, -0.03386877849698067, -0.1016373485326767, 0.7859545350074768, 0.6685531139373779, -1.2343922853469849, -0.0293696541339159, -0.7687935829162598, -0.8136346936225891, 1.801045298576355, 2.2230312824249268, -0.24111029505729675, -0.29588785767555237, -0.6096875667572021, -1.3268669843673706, 0.8372765779495239, -0.10941753536462784, 0.16992336511611938, 0.6012336611747742, -0.6598453521728516, 1.0181961059570312, 1.0044865608215332, 0.8962332606315613, 0.24738621711730957, 0.22746863961219788, 0.39002639055252075, -0.30977973341941833, -1.1672977209091187, -0.17926666140556335, -1.0950000286102295, -2.636413335800171, 0.44805702567100525, -0.13982492685317993, -1.3460026979446411, -0.012198184616863728, -1.031711220741272, 1.0612695217132568, -0.572029173374176, -0.982978105545044, -1.544453740119934, 0.21947258710861206, 0.07713592797517776, 1.0650560855865479, -1.6291762590408325, -0.30205047130584717, 1.198607087135315, 0.9479568600654602, -0.7264662384986877, 0.8746198415756226, 0.1724148690700531, 1.119957447052002, 0.7482485771179199, -0.4569619297981262, 0.5401379466056824, -0.0630967915058136, -1.3808958530426025, 0.4963517189025879, 1.1333849430084229, 0.12840574979782104, 1.5052565336227417, -0.48032236099243164, 0.09182367473840714, 0.39673006534576416, -0.6264710426330566, -0.43617919087409973, -0.5660547614097595, 0.6377729177474976, 0.09287022799253464, -0.8998534083366394, -0.16249561309814453, 0.02726166322827339, -0.30442869663238525, 0.1642259657382965, -1.4213086366653442, -0.10554671287536621, -0.3688127398490906, -0.7080214619636536, -1.1992251873016357, -0.1772577166557312, 1.3515456914901733, -0.832197368144989, -0.12414609640836716, 0.4791752099990845, 0.3242547810077667, 0.5537053942680359, 0.6544618010520935, -0.7464781403541565, -0.3787728548049927, -0.24257004261016846, -0.34468764066696167, 0.3484101891517639, 1.4008996486663818, -0.07846634835004807, -0.971393883228302, 0.60039883852005, -0.27755191922187805, 0.12118785828351974, 1.9780274629592896, 0.09340979903936386, -0.7319009900093079, 0.2442876696586609, -0.7192382216453552, 1.911426305770874, 1.6478856801986694, 1.2727713584899902, -0.15790364146232605, -0.8915001749992371, 0.7187010645866394, -0.37237748503685, -0.4859655499458313, 0.7701519131660461, 0.286260724067688, -0.18248724937438965, -1.5506902933120728, 0.7672904133796692, 1.2574820518493652, -0.9053995609283447, -0.805534839630127, 0.12592104077339172, -0.7969735860824585, 1.1224180459976196, 0.5950897932052612, 0.34636276960372925, 0.46695470809936523, 1.7305585145950317, 0.8548281192779541, -0.46577557921409607, 0.39137914776802063, 0.6913810968399048, -0.10105007141828537, -2.1066479682922363, -1.1496704816818237, 0.27045100927352905, -0.5965506434440613, -1.5924127101898193, 1.4018806219100952, -1.124803066253662, -1.0134741067886353, 0.642686665058136, 0.00869036465883255, 1.400253415107727, 0.38846656680107117, 1.5558297634124756, 2.0003557205200195, 0.8146163821220398, 0.4123639166355133, 1.2435487508773804, -0.12770912051200867, -0.436340868473053, 1.7922005653381348, -0.39636775851249695, 0.510535717010498, 1.1275968551635742, -0.16817143559455872, -1.1744455099105835, -0.7389085292816162, -1.28926420211792, -0.8196508884429932, 1.1474181413650513, 0.06630142778158188, -1.0874613523483276, 0.2699871063232422, 1.6463130712509155, 0.10568495839834213, -0.4371432662010193, 0.48819324374198914, 0.3561033606529236, -0.8123955130577087, -0.04768156632781029, -0.9102016687393188, 0.585314929485321, -0.13807973265647888, -0.3582388162612915, 0.2547701895236969, 0.4747343361377716, 1.475692629814148, -0.07460494339466095, 0.20622357726097107, 1.0210165977478027, -1.5064144134521484, 1.5534056425094604, -0.6924440264701843, 0.2821761965751648, -2.3616020679473877, 1.3469045162200928, -0.7793388366699219, 1.979552149772644, -2.7137744426727295, 0.46200916171073914, -0.5231531858444214, -0.48419997096061707, 0.22728770971298218, -0.44481199979782104, 0.1815934181213379, -0.00572997098788619, -1.1641706228256226, -0.05590679869055748, -0.5633537173271179, 0.6464536190032959, 1.112592339515686, 1.3360565900802612, -1.1202207803726196, -0.29287686944007874, -1.671897530555725, -0.05465045943856239, -0.7846315503120422, 0.08491092175245285, -1.9566093683242798, -0.14242258667945862, -1.8429007530212402, -2.266021728515625, -1.2906135320663452, -0.7755588293075562, 1.139367938041687, 0.17476144433021545, -0.9264694452285767, 1.2268964052200317, -0.35925206542015076, -1.8344517946243286, 1.1506152153015137, -2.2606899738311768 ]
https://github.com/huggingface/datasets/issues/3644
Add a GROUP BY operator
> Hi, I have a similar issue as OP but the suggested solutions do not work for my case. Basically, I process documents through a model to extract the last_hidden_state, using the "map" method on a Dataset object, but would like to average the result over a categorical column at the end (i.e. groupby this column). If you haven't yet, you could explore using [Polars](https://www.pola.rs/) for this. It's a new DataFrame library written in Rust with Python bindings. It is Pandas like it in many ways ,but does have some biggish differences in syntax/approach so it's definitely not a drop-in replacement. Polar's also uses Arrow as a backend but also supports out-of-memory operations; in this case, it's probably easiest to write out your dataset to parquet and then use the polar's `scan_parquet` method (this will lazily read from the parquet file). The thing you get back from that is a `LazyDataFrame` i.e. nothing is loaded into memory until you specify a query and call a `collect` method. Example below of doing a groupby on a dataset which definitely wouldn't fit into memory on my machine: ``` from datasets import load_dataset import polars as pl ds = load_dataset("blbooks") ds['train'].to_parquet("test.parquet") df = pl.scan_parquet("test.parquet") df.groupby('date').agg([pl.count()]).collect() ``` >datasets_sql seems to not like the fact that I'm averaging np.arrays. I am not certain how Polars will handle this either. It does have NumPy support (https://pola-rs.github.io/polars-book/user-guide/howcani/interop/numpy.html) but I assume Polars will need to have at least enough memory in each group you want to average over so you may still end up needing more memory depending on the size of your dataset/groups.
**Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column.
978
266
Add a GROUP BY operator **Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column. > Hi, I have a similar issue as OP but the suggested solutions do not work for my case. Basically, I process documents through a model to extract the last_hidden_state, using the "map" method on a Dataset object, but would like to average the result over a categorical column at the end (i.e. groupby this column). If you haven't yet, you could explore using [Polars](https://www.pola.rs/) for this. It's a new DataFrame library written in Rust with Python bindings. It is Pandas like it in many ways ,but does have some biggish differences in syntax/approach so it's definitely not a drop-in replacement. Polar's also uses Arrow as a backend but also supports out-of-memory operations; in this case, it's probably easiest to write out your dataset to parquet and then use the polar's `scan_parquet` method (this will lazily read from the parquet file). The thing you get back from that is a `LazyDataFrame` i.e. nothing is loaded into memory until you specify a query and call a `collect` method. Example below of doing a groupby on a dataset which definitely wouldn't fit into memory on my machine: ``` from datasets import load_dataset import polars as pl ds = load_dataset("blbooks") ds['train'].to_parquet("test.parquet") df = pl.scan_parquet("test.parquet") df.groupby('date').agg([pl.count()]).collect() ``` >datasets_sql seems to not like the fact that I'm averaging np.arrays. I am not certain how Polars will handle this either. It does have NumPy support (https://pola-rs.github.io/polars-book/user-guide/howcani/interop/numpy.html) but I assume Polars will need to have at least enough memory in each group you want to average over so you may still end up needing more memory depending on the size of your dataset/groups.
[ -1.2649974822998047, -0.9758623242378235, -0.788390040397644, 1.5149518251419067, -0.19254150986671448, -1.2414768934249878, 0.18476614356040955, -1.1992429494857788, 1.6573001146316528, -0.8058323264122009, 0.48877930641174316, -1.6476770639419556, -0.04355749115347862, -0.612837553024292, -0.7736255526542664, -0.8870532512664795, -0.4174593985080719, -0.6783455610275269, 1.0428389310836792, 2.5159666538238525, 1.228135108947754, -1.4173845052719116, 2.643627882003784, 0.7294040322303772, -0.11912201344966888, -0.9780504107475281, 0.6202033162117004, -0.024243338033556938, -1.1785378456115723, -0.4491642415523529, -1.0057601928710938, -0.1465596854686737, -0.5095758438110352, -0.44052115082740784, -0.08775199204683304, 0.4636000692844391, -0.32101497054100037, -0.4930031895637512, -0.6254774928092957, -0.8438013792037964, 0.48534294962882996, -0.43314477801322937, 1.0157057046890259, -0.3615816533565521, 1.746720790863037, -0.6331466436386108, 0.47281527519226074, 0.6717521548271179, 1.3863075971603394, 0.26023930311203003, -0.022842444479465485, 0.3182242512702942, 0.42581707239151, -0.13829997181892395, 0.5471469163894653, 1.2136585712432861, 0.7060502767562866, 0.46030858159065247, 0.8213571310043335, -2.1231467723846436, 1.2517999410629272, -1.2031830549240112, 0.3196184039115906, 1.3275943994522095, -0.8535203337669373, 0.3223439157009125, -1.7761149406433105, -0.11100547760725021, 0.6364269256591797, -2.191619396209717, 0.28741204738616943, -1.2873239517211914, -0.5414185523986816, 1.0583534240722656, 0.41728368401527405, -1.2858608961105347, 0.052256714552640915, -0.40361690521240234, 0.9440942406654358, 0.3177764415740967, 1.06393563747406, -1.7433977127075195, -0.011426130309700966, -0.3649598956108093, 0.09148941189050674, -1.231353998184204, -1.4505232572555542, 0.5827224254608154, 0.5128576755523682, 0.5436218976974487, -0.08814605325460434, 1.0279268026351929, -1.160483479499817, 0.808699905872345, -1.0695509910583496, -1.670318365097046, -1.4796117544174194, -2.296199083328247, -2.175844430923462, 0.7745853066444397, -0.4303884208202362, -0.5814473628997803, 1.9450629949569702, -0.9282475709915161, -1.5868940353393555, 1.117980718612671, 0.24976882338523865, 0.0951148271560669, 2.4439854621887207, 0.19448935985565186, -0.7824833989143372, 0.5694430470466614, -0.778517484664917, 0.7516402006149292, -0.3113479018211365, 1.3584003448486328, 0.31073617935180664, -0.9533784985542297, 1.6012128591537476, -0.33867141604423523, 0.5152151584625244, -0.5996986627578735, -0.49930042028427124, -0.6882275342941284, 0.44238850474357605, 1.8719401359558105, -0.25252798199653625, 1.4881348609924316, -0.22195705771446228, -1.5508415699005127, -1.5991482734680176, 0.865976095199585, 0.5494550466537476, -0.7875001430511475, 0.11288454383611679, -0.3538775146007538, 0.17896687984466553, -0.1481674313545227, 1.2014881372451782, 1.2346230745315552, 0.7702867984771729, -0.35360246896743774, -0.8278504014015198, 0.171566903591156, -0.04514814913272858, -0.8863531351089478, -1.6640745401382446, -0.37878143787384033, 0.1229773685336113, 0.6675857305526733, -1.2250099182128906, 1.8301888704299927, 0.9417589902877808, 1.839410424232483, 1.0871689319610596, -0.2964698076248169, 1.492264986038208, 0.09234746545553207, 1.782659888267517, -0.5158202052116394, 0.6074032187461853, -0.3243832588195801, -1.1786625385284424, 0.8816714882850647, -0.3297957479953766, -2.030252695083618, -0.8307357430458069, -0.7633114457130432, -0.14291781187057495, -0.8241062164306641, 0.9242371916770935, -0.418864905834198, -1.3831201791763306, 0.2980704605579376, -0.7768926024436951, 0.0022468063980340958, -1.1614524126052856, 0.2847009599208832, 0.5936657786369324, -0.6122095584869385, 0.0605311319231987, -0.15079283714294434, -1.2541753053665161, -0.3909798562526703, 0.1594967246055603, 1.9922593832015991, -0.7621906399726868, 0.8815479278564453, 1.0545291900634766, -0.6977753639221191, -0.037797726690769196, 0.3194870054721832, -0.3698379695415497, 0.8841453194618225, -1.026172399520874, -0.5834090709686279, 1.1652997732162476, -0.05649775266647339, -0.5690845251083374, 1.530582308769226, 0.593331515789032, -0.9914600849151611, -0.296389639377594, -0.09004819393157959, -0.840761661529541, 0.1148403137922287, -1.5764638185501099, -0.08671567589044571, 0.48048636317253113, -1.5732462406158447, -0.49864840507507324, -0.11248994618654251, 1.2029283046722412, -0.23918595910072327, 1.4262418746948242, -0.3745991885662079, -0.12224691361188889, -0.2820199429988861, -0.37618210911750793, 0.12642750144004822, -0.24335885047912598, -0.6468994617462158, 0.20875516533851624, -0.803003191947937, 0.38527607917785645, 1.3799821138381958, 0.3584006428718567, 0.024945110082626343, 0.46302902698516846, 1.0691536664962769, 0.39420026540756226, -0.0817345529794693, -0.8611162900924683, -1.4850738048553467, 2.065988779067993, -1.4795222282409668, 2.0412490367889404, 0.7672893404960632, -0.06633840501308441, -1.7496379613876343, -1.9155577421188354, 1.307643175125122, 1.2679369449615479, 2.3378381729125977, 0.5135713815689087, 0.42462679743766785, -0.8163408041000366, -0.6730939745903015, 0.278029203414917, -1.0662627220153809, -0.6557818651199341, 0.177076518535614, 2.369621992111206, 1.8489415645599365, -0.4356890022754669, -0.207231342792511, -0.9792075157165527, 1.4120723009109497, -0.31040599942207336, 0.20381024479866028, 1.9676378965377808, -0.24231606721878052, -1.1343162059783936, 1.3571888208389282, -2.333667755126953, 0.07358387112617493, 1.952643632888794, 0.3369930684566498, 0.13876456022262573, -1.313029170036316, -0.581362247467041, -0.42147547006607056, -0.3784652054309845, -1.2772692441940308, 0.4990706443786621, -0.1807783842086792, -0.8382742404937744, -1.3437080383300781, 0.20413723587989807, -1.1286265850067139, -1.6009711027145386, 0.20332098007202148, 1.8052253723144531, 2.124692678451538, -0.8664064407348633, 1.6035916805267334, -0.3349649906158447, 0.16605669260025024, 1.1259862184524536, 1.17887282371521, 3.101794719696045, 1.9250587224960327, -1.3296644687652588, 0.5974116921424866, -0.1747014820575714, -0.4253418743610382, 1.129769206047058, -1.2583715915679932, 1.326586127281189, -0.036746494472026825, -1.1582812070846558, -1.122557282447815, 0.9711512923240662, 0.39433595538139343, -0.02548292838037014, -0.5595840811729431, 1.0577281713485718, 0.05915199965238571, 1.3832345008850098, 0.5615488886833191, -0.20400482416152954, 0.5646898746490479, -0.43354561924934387, -0.45445698499679565, 1.5279595851898193, 0.14885678887367249, -1.412191390991211, -2.284015417098999, -0.134000763297081, -0.8742688894271851, 0.14920902252197266, -0.6103676557540894, -1.0385241508483887, 1.7111303806304932, 0.24371322989463806, -1.3141111135482788, -0.2866344749927521, -0.42748725414276123, -0.6242830753326416, 2.790576696395874, -1.3546404838562012, -0.22900643944740295, -1.050687551498413, -0.7226554751396179, 1.717665433883667, -1.144421100616455, -0.15779989957809448, -1.036759376525879, -0.5156813263893127, -1.3202613592147827, -0.6139951944351196, 0.08965489268302917, -0.9774641990661621, 0.8181247711181641, 0.17317599058151245, -1.168229341506958, -0.3679884076118469, -0.8089788556098938, 0.8826403617858887, -0.15509536862373352, 0.14509299397468567, 1.918969750404358, 0.27533093094825745, -0.3074449300765991, 0.7057552337646484, 1.240727424621582, 0.6754874587059021, -0.6397759914398193, 0.14688879251480103, -0.6908125281333923, 0.36980485916137695, -1.3157680034637451, 0.21718630194664001, -2.742719888687134, 0.6402110457420349, 0.009104562923312187, -0.054070845246315, 0.010740164667367935, -1.2442935705184937, 1.176127552986145, 2.5879738330841064, -1.1841192245483398, 0.4750974178314209, 0.3051771819591522, 1.1151013374328613, -1.5889562368392944, 0.30549460649490356, -0.40222010016441345, 2.0898897647857666, 0.18935513496398926, 1.195434808731079, -0.49972230195999146, -2.2674732208251953, 0.7286493182182312, -1.331112027168274, -1.2777099609375, 0.6985568404197693, -0.9508486390113831, 0.27278339862823486, -1.5236871242523193, -0.2538771629333496, -0.8353303670883179, -1.0541789531707764, 0.646632969379425, 0.049704328179359436, 0.34553784132003784, -0.5523374080657959, 0.37047815322875977, -2.2239513397216797, -1.4059208631515503, -0.22210246324539185, -0.9950542449951172, 0.468890517950058, -0.41528865694999695, 0.6933695077896118, -0.1437821388244629, -0.022851327434182167, 0.38395100831985474, 1.4514371156692505, 3.4942209720611572, 0.3043263554573059, 0.33221590518951416, -0.17741593718528748, -0.9082669019699097, 1.465807557106018, 0.893558144569397, -0.07587708532810211, -0.5131135582923889, -1.0695465803146362, 1.3202563524246216, 1.9045065641403198, 0.9686269164085388, 0.07681170850992203, -0.8410950899124146, -0.6694467663764954, -0.11590945720672607, 0.20775923132896423, 0.37447357177734375, 0.8727474808692932, 0.042925819754600525, 0.007675273343920708, 1.543691873550415, 1.096929907798767, -0.44304436445236206, 0.25371044874191284, -0.8919681310653687, -0.5059712529182434, 0.538577139377594, 0.25093328952789307, -0.038706935942173004, 0.38570278882980347, -0.9816134572029114, -0.3063690662384033, -0.3792993724346161, -0.8257309198379517, -0.610448956489563, -0.3430563509464264, -0.31690505146980286, 1.6472032070159912, 0.1113976389169693, -0.5339786410331726, 0.0014401981607079506, -0.8819073438644409, -0.07408569008111954, -1.1122679710388184, 0.1613422930240631, -0.049193914979696274, -0.12987442314624786, -0.24490132927894592, 1.8106926679611206, -0.8445698022842407, -2.0188450813293457, 0.1979973018169403, 0.3035009503364563, -0.2349289059638977, 0.18922466039657593, 1.6549084186553955, 0.6029565334320068, 1.421418309211731, 1.2428455352783203, 0.8904584050178528, -0.6296622157096863, -1.2904425859451294, 0.6149243712425232, 1.0337512493133545, -1.3137000799179077, 0.8719291687011719, -0.045275039970874786, -0.3992554545402527, 0.5276616811752319, 1.2941973209381104, 0.5357967019081116, -1.8880982398986816, 0.7980982661247253, -0.9744399189949036, 0.8358342051506042, 0.6952724456787109, 0.6381492018699646, 0.1987726390361786, 0.771324872970581, -1.1395491361618042, -1.0700205564498901, -0.8595576882362366, -0.6611009240150452, 2.025972366333008, -0.3533551096916199, 0.6930686831474304, -0.2673390209674835, -1.3010789155960083, -0.05940083786845207, 0.6696408987045288, 0.3512822091579437, -0.4365479052066803, 0.8356441855430603, -0.6366412043571472, -0.9974713921546936, -1.3515843152999878, -0.3269832134246826, -1.0349533557891846, -0.9087278842926025, 1.1504170894622803, 0.7550559043884277, 0.29413747787475586, 1.9311860799789429, 0.8046198487281799, 0.251242458820343, -2.4453184604644775, 0.8433482050895691, 0.2875916659832001, -0.08313989639282227, 0.8587732911109924, 0.3900362551212311, 0.9432234764099121, -0.03302372992038727, 0.42659759521484375, -2.4531772136688232, 2.2145731449127197, -0.16040721535682678, 0.7080287933349609, -0.04065192490816116, -0.21456754207611084, 1.0746599435806274, 0.5700860023498535, 0.527557373046875, -1.022945761680603, 0.47457757592201233, -0.5026518702507019, 1.3331348896026611, 0.9197827577590942, -0.706093430519104, -0.04136361926794052, 1.3329946994781494, 0.5142285227775574, -0.5643590688705444, -1.126772165298462, -0.8284087777137756, 0.9661961197853088, 1.6667726039886475, -0.03386877849698067, -0.1016373485326767, 0.7859545350074768, 0.6685531139373779, -1.2343922853469849, -0.0293696541339159, -0.7687935829162598, -0.8136346936225891, 1.801045298576355, 2.2230312824249268, -0.24111029505729675, -0.29588785767555237, -0.6096875667572021, -1.3268669843673706, 0.8372765779495239, -0.10941753536462784, 0.16992336511611938, 0.6012336611747742, -0.6598453521728516, 1.0181961059570312, 1.0044865608215332, 0.8962332606315613, 0.24738621711730957, 0.22746863961219788, 0.39002639055252075, -0.30977973341941833, -1.1672977209091187, -0.17926666140556335, -1.0950000286102295, -2.636413335800171, 0.44805702567100525, -0.13982492685317993, -1.3460026979446411, -0.012198184616863728, -1.031711220741272, 1.0612695217132568, -0.572029173374176, -0.982978105545044, -1.544453740119934, 0.21947258710861206, 0.07713592797517776, 1.0650560855865479, -1.6291762590408325, -0.30205047130584717, 1.198607087135315, 0.9479568600654602, -0.7264662384986877, 0.8746198415756226, 0.1724148690700531, 1.119957447052002, 0.7482485771179199, -0.4569619297981262, 0.5401379466056824, -0.0630967915058136, -1.3808958530426025, 0.4963517189025879, 1.1333849430084229, 0.12840574979782104, 1.5052565336227417, -0.48032236099243164, 0.09182367473840714, 0.39673006534576416, -0.6264710426330566, -0.43617919087409973, -0.5660547614097595, 0.6377729177474976, 0.09287022799253464, -0.8998534083366394, -0.16249561309814453, 0.02726166322827339, -0.30442869663238525, 0.1642259657382965, -1.4213086366653442, -0.10554671287536621, -0.3688127398490906, -0.7080214619636536, -1.1992251873016357, -0.1772577166557312, 1.3515456914901733, -0.832197368144989, -0.12414609640836716, 0.4791752099990845, 0.3242547810077667, 0.5537053942680359, 0.6544618010520935, -0.7464781403541565, -0.3787728548049927, -0.24257004261016846, -0.34468764066696167, 0.3484101891517639, 1.4008996486663818, -0.07846634835004807, -0.971393883228302, 0.60039883852005, -0.27755191922187805, 0.12118785828351974, 1.9780274629592896, 0.09340979903936386, -0.7319009900093079, 0.2442876696586609, -0.7192382216453552, 1.911426305770874, 1.6478856801986694, 1.2727713584899902, -0.15790364146232605, -0.8915001749992371, 0.7187010645866394, -0.37237748503685, -0.4859655499458313, 0.7701519131660461, 0.286260724067688, -0.18248724937438965, -1.5506902933120728, 0.7672904133796692, 1.2574820518493652, -0.9053995609283447, -0.805534839630127, 0.12592104077339172, -0.7969735860824585, 1.1224180459976196, 0.5950897932052612, 0.34636276960372925, 0.46695470809936523, 1.7305585145950317, 0.8548281192779541, -0.46577557921409607, 0.39137914776802063, 0.6913810968399048, -0.10105007141828537, -2.1066479682922363, -1.1496704816818237, 0.27045100927352905, -0.5965506434440613, -1.5924127101898193, 1.4018806219100952, -1.124803066253662, -1.0134741067886353, 0.642686665058136, 0.00869036465883255, 1.400253415107727, 0.38846656680107117, 1.5558297634124756, 2.0003557205200195, 0.8146163821220398, 0.4123639166355133, 1.2435487508773804, -0.12770912051200867, -0.436340868473053, 1.7922005653381348, -0.39636775851249695, 0.510535717010498, 1.1275968551635742, -0.16817143559455872, -1.1744455099105835, -0.7389085292816162, -1.28926420211792, -0.8196508884429932, 1.1474181413650513, 0.06630142778158188, -1.0874613523483276, 0.2699871063232422, 1.6463130712509155, 0.10568495839834213, -0.4371432662010193, 0.48819324374198914, 0.3561033606529236, -0.8123955130577087, -0.04768156632781029, -0.9102016687393188, 0.585314929485321, -0.13807973265647888, -0.3582388162612915, 0.2547701895236969, 0.4747343361377716, 1.475692629814148, -0.07460494339466095, 0.20622357726097107, 1.0210165977478027, -1.5064144134521484, 1.5534056425094604, -0.6924440264701843, 0.2821761965751648, -2.3616020679473877, 1.3469045162200928, -0.7793388366699219, 1.979552149772644, -2.7137744426727295, 0.46200916171073914, -0.5231531858444214, -0.48419997096061707, 0.22728770971298218, -0.44481199979782104, 0.1815934181213379, -0.00572997098788619, -1.1641706228256226, -0.05590679869055748, -0.5633537173271179, 0.6464536190032959, 1.112592339515686, 1.3360565900802612, -1.1202207803726196, -0.29287686944007874, -1.671897530555725, -0.05465045943856239, -0.7846315503120422, 0.08491092175245285, -1.9566093683242798, -0.14242258667945862, -1.8429007530212402, -2.266021728515625, -1.2906135320663452, -0.7755588293075562, 1.139367938041687, 0.17476144433021545, -0.9264694452285767, 1.2268964052200317, -0.35925206542015076, -1.8344517946243286, 1.1506152153015137, -2.2606899738311768 ]
https://github.com/huggingface/datasets/issues/3644
Add a GROUP BY operator
Hi @davanstrien , thanks a lot, I didn't know about this library and the answer works! I need to try it on the full dataset now, but I'm hopeful. Here's what my code looks like: ``` list_size = 768 df.groupby("date").agg( pl.concat_list( [ pl.col("hidden_state") .arr.slice(n, 1) .arr.first() .mean() for n in range(0, list_size) ] ).collect() ``` For some reasons, the following code was giving me a "mean() got unexpected argument 'axis'": ``` df2 = df.groupby('date').agg( pl.col("hidden_state").map(np.mean).alias("average_hidden_state") ).collect() ``` EDIT: The solution works on my large dataset, the memory does not crash and the time is reasonable, thanks a lot again!
**Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column.
978
99
Add a GROUP BY operator **Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column. Hi @davanstrien , thanks a lot, I didn't know about this library and the answer works! I need to try it on the full dataset now, but I'm hopeful. Here's what my code looks like: ``` list_size = 768 df.groupby("date").agg( pl.concat_list( [ pl.col("hidden_state") .arr.slice(n, 1) .arr.first() .mean() for n in range(0, list_size) ] ).collect() ``` For some reasons, the following code was giving me a "mean() got unexpected argument 'axis'": ``` df2 = df.groupby('date').agg( pl.col("hidden_state").map(np.mean).alias("average_hidden_state") ).collect() ``` EDIT: The solution works on my large dataset, the memory does not crash and the time is reasonable, thanks a lot again!
[ -1.2649974822998047, -0.9758623242378235, -0.788390040397644, 1.5149518251419067, -0.19254150986671448, -1.2414768934249878, 0.18476614356040955, -1.1992429494857788, 1.6573001146316528, -0.8058323264122009, 0.48877930641174316, -1.6476770639419556, -0.04355749115347862, -0.612837553024292, -0.7736255526542664, -0.8870532512664795, -0.4174593985080719, -0.6783455610275269, 1.0428389310836792, 2.5159666538238525, 1.228135108947754, -1.4173845052719116, 2.643627882003784, 0.7294040322303772, -0.11912201344966888, -0.9780504107475281, 0.6202033162117004, -0.024243338033556938, -1.1785378456115723, -0.4491642415523529, -1.0057601928710938, -0.1465596854686737, -0.5095758438110352, -0.44052115082740784, -0.08775199204683304, 0.4636000692844391, -0.32101497054100037, -0.4930031895637512, -0.6254774928092957, -0.8438013792037964, 0.48534294962882996, -0.43314477801322937, 1.0157057046890259, -0.3615816533565521, 1.746720790863037, -0.6331466436386108, 0.47281527519226074, 0.6717521548271179, 1.3863075971603394, 0.26023930311203003, -0.022842444479465485, 0.3182242512702942, 0.42581707239151, -0.13829997181892395, 0.5471469163894653, 1.2136585712432861, 0.7060502767562866, 0.46030858159065247, 0.8213571310043335, -2.1231467723846436, 1.2517999410629272, -1.2031830549240112, 0.3196184039115906, 1.3275943994522095, -0.8535203337669373, 0.3223439157009125, -1.7761149406433105, -0.11100547760725021, 0.6364269256591797, -2.191619396209717, 0.28741204738616943, -1.2873239517211914, -0.5414185523986816, 1.0583534240722656, 0.41728368401527405, -1.2858608961105347, 0.052256714552640915, -0.40361690521240234, 0.9440942406654358, 0.3177764415740967, 1.06393563747406, -1.7433977127075195, -0.011426130309700966, -0.3649598956108093, 0.09148941189050674, -1.231353998184204, -1.4505232572555542, 0.5827224254608154, 0.5128576755523682, 0.5436218976974487, -0.08814605325460434, 1.0279268026351929, -1.160483479499817, 0.808699905872345, -1.0695509910583496, -1.670318365097046, -1.4796117544174194, -2.296199083328247, -2.175844430923462, 0.7745853066444397, -0.4303884208202362, -0.5814473628997803, 1.9450629949569702, -0.9282475709915161, -1.5868940353393555, 1.117980718612671, 0.24976882338523865, 0.0951148271560669, 2.4439854621887207, 0.19448935985565186, -0.7824833989143372, 0.5694430470466614, -0.778517484664917, 0.7516402006149292, -0.3113479018211365, 1.3584003448486328, 0.31073617935180664, -0.9533784985542297, 1.6012128591537476, -0.33867141604423523, 0.5152151584625244, -0.5996986627578735, -0.49930042028427124, -0.6882275342941284, 0.44238850474357605, 1.8719401359558105, -0.25252798199653625, 1.4881348609924316, -0.22195705771446228, -1.5508415699005127, -1.5991482734680176, 0.865976095199585, 0.5494550466537476, -0.7875001430511475, 0.11288454383611679, -0.3538775146007538, 0.17896687984466553, -0.1481674313545227, 1.2014881372451782, 1.2346230745315552, 0.7702867984771729, -0.35360246896743774, -0.8278504014015198, 0.171566903591156, -0.04514814913272858, -0.8863531351089478, -1.6640745401382446, -0.37878143787384033, 0.1229773685336113, 0.6675857305526733, -1.2250099182128906, 1.8301888704299927, 0.9417589902877808, 1.839410424232483, 1.0871689319610596, -0.2964698076248169, 1.492264986038208, 0.09234746545553207, 1.782659888267517, -0.5158202052116394, 0.6074032187461853, -0.3243832588195801, -1.1786625385284424, 0.8816714882850647, -0.3297957479953766, -2.030252695083618, -0.8307357430458069, -0.7633114457130432, -0.14291781187057495, -0.8241062164306641, 0.9242371916770935, -0.418864905834198, -1.3831201791763306, 0.2980704605579376, -0.7768926024436951, 0.0022468063980340958, -1.1614524126052856, 0.2847009599208832, 0.5936657786369324, -0.6122095584869385, 0.0605311319231987, -0.15079283714294434, -1.2541753053665161, -0.3909798562526703, 0.1594967246055603, 1.9922593832015991, -0.7621906399726868, 0.8815479278564453, 1.0545291900634766, -0.6977753639221191, -0.037797726690769196, 0.3194870054721832, -0.3698379695415497, 0.8841453194618225, -1.026172399520874, -0.5834090709686279, 1.1652997732162476, -0.05649775266647339, -0.5690845251083374, 1.530582308769226, 0.593331515789032, -0.9914600849151611, -0.296389639377594, -0.09004819393157959, -0.840761661529541, 0.1148403137922287, -1.5764638185501099, -0.08671567589044571, 0.48048636317253113, -1.5732462406158447, -0.49864840507507324, -0.11248994618654251, 1.2029283046722412, -0.23918595910072327, 1.4262418746948242, -0.3745991885662079, -0.12224691361188889, -0.2820199429988861, -0.37618210911750793, 0.12642750144004822, -0.24335885047912598, -0.6468994617462158, 0.20875516533851624, -0.803003191947937, 0.38527607917785645, 1.3799821138381958, 0.3584006428718567, 0.024945110082626343, 0.46302902698516846, 1.0691536664962769, 0.39420026540756226, -0.0817345529794693, -0.8611162900924683, -1.4850738048553467, 2.065988779067993, -1.4795222282409668, 2.0412490367889404, 0.7672893404960632, -0.06633840501308441, -1.7496379613876343, -1.9155577421188354, 1.307643175125122, 1.2679369449615479, 2.3378381729125977, 0.5135713815689087, 0.42462679743766785, -0.8163408041000366, -0.6730939745903015, 0.278029203414917, -1.0662627220153809, -0.6557818651199341, 0.177076518535614, 2.369621992111206, 1.8489415645599365, -0.4356890022754669, -0.207231342792511, -0.9792075157165527, 1.4120723009109497, -0.31040599942207336, 0.20381024479866028, 1.9676378965377808, -0.24231606721878052, -1.1343162059783936, 1.3571888208389282, -2.333667755126953, 0.07358387112617493, 1.952643632888794, 0.3369930684566498, 0.13876456022262573, -1.313029170036316, -0.581362247467041, -0.42147547006607056, -0.3784652054309845, -1.2772692441940308, 0.4990706443786621, -0.1807783842086792, -0.8382742404937744, -1.3437080383300781, 0.20413723587989807, -1.1286265850067139, -1.6009711027145386, 0.20332098007202148, 1.8052253723144531, 2.124692678451538, -0.8664064407348633, 1.6035916805267334, -0.3349649906158447, 0.16605669260025024, 1.1259862184524536, 1.17887282371521, 3.101794719696045, 1.9250587224960327, -1.3296644687652588, 0.5974116921424866, -0.1747014820575714, -0.4253418743610382, 1.129769206047058, -1.2583715915679932, 1.326586127281189, -0.036746494472026825, -1.1582812070846558, -1.122557282447815, 0.9711512923240662, 0.39433595538139343, -0.02548292838037014, -0.5595840811729431, 1.0577281713485718, 0.05915199965238571, 1.3832345008850098, 0.5615488886833191, -0.20400482416152954, 0.5646898746490479, -0.43354561924934387, -0.45445698499679565, 1.5279595851898193, 0.14885678887367249, -1.412191390991211, -2.284015417098999, -0.134000763297081, -0.8742688894271851, 0.14920902252197266, -0.6103676557540894, -1.0385241508483887, 1.7111303806304932, 0.24371322989463806, -1.3141111135482788, -0.2866344749927521, -0.42748725414276123, -0.6242830753326416, 2.790576696395874, -1.3546404838562012, -0.22900643944740295, -1.050687551498413, -0.7226554751396179, 1.717665433883667, -1.144421100616455, -0.15779989957809448, -1.036759376525879, -0.5156813263893127, -1.3202613592147827, -0.6139951944351196, 0.08965489268302917, -0.9774641990661621, 0.8181247711181641, 0.17317599058151245, -1.168229341506958, -0.3679884076118469, -0.8089788556098938, 0.8826403617858887, -0.15509536862373352, 0.14509299397468567, 1.918969750404358, 0.27533093094825745, -0.3074449300765991, 0.7057552337646484, 1.240727424621582, 0.6754874587059021, -0.6397759914398193, 0.14688879251480103, -0.6908125281333923, 0.36980485916137695, -1.3157680034637451, 0.21718630194664001, -2.742719888687134, 0.6402110457420349, 0.009104562923312187, -0.054070845246315, 0.010740164667367935, -1.2442935705184937, 1.176127552986145, 2.5879738330841064, -1.1841192245483398, 0.4750974178314209, 0.3051771819591522, 1.1151013374328613, -1.5889562368392944, 0.30549460649490356, -0.40222010016441345, 2.0898897647857666, 0.18935513496398926, 1.195434808731079, -0.49972230195999146, -2.2674732208251953, 0.7286493182182312, -1.331112027168274, -1.2777099609375, 0.6985568404197693, -0.9508486390113831, 0.27278339862823486, -1.5236871242523193, -0.2538771629333496, -0.8353303670883179, -1.0541789531707764, 0.646632969379425, 0.049704328179359436, 0.34553784132003784, -0.5523374080657959, 0.37047815322875977, -2.2239513397216797, -1.4059208631515503, -0.22210246324539185, -0.9950542449951172, 0.468890517950058, -0.41528865694999695, 0.6933695077896118, -0.1437821388244629, -0.022851327434182167, 0.38395100831985474, 1.4514371156692505, 3.4942209720611572, 0.3043263554573059, 0.33221590518951416, -0.17741593718528748, -0.9082669019699097, 1.465807557106018, 0.893558144569397, -0.07587708532810211, -0.5131135582923889, -1.0695465803146362, 1.3202563524246216, 1.9045065641403198, 0.9686269164085388, 0.07681170850992203, -0.8410950899124146, -0.6694467663764954, -0.11590945720672607, 0.20775923132896423, 0.37447357177734375, 0.8727474808692932, 0.042925819754600525, 0.007675273343920708, 1.543691873550415, 1.096929907798767, -0.44304436445236206, 0.25371044874191284, -0.8919681310653687, -0.5059712529182434, 0.538577139377594, 0.25093328952789307, -0.038706935942173004, 0.38570278882980347, -0.9816134572029114, -0.3063690662384033, -0.3792993724346161, -0.8257309198379517, -0.610448956489563, -0.3430563509464264, -0.31690505146980286, 1.6472032070159912, 0.1113976389169693, -0.5339786410331726, 0.0014401981607079506, -0.8819073438644409, -0.07408569008111954, -1.1122679710388184, 0.1613422930240631, -0.049193914979696274, -0.12987442314624786, -0.24490132927894592, 1.8106926679611206, -0.8445698022842407, -2.0188450813293457, 0.1979973018169403, 0.3035009503364563, -0.2349289059638977, 0.18922466039657593, 1.6549084186553955, 0.6029565334320068, 1.421418309211731, 1.2428455352783203, 0.8904584050178528, -0.6296622157096863, -1.2904425859451294, 0.6149243712425232, 1.0337512493133545, -1.3137000799179077, 0.8719291687011719, -0.045275039970874786, -0.3992554545402527, 0.5276616811752319, 1.2941973209381104, 0.5357967019081116, -1.8880982398986816, 0.7980982661247253, -0.9744399189949036, 0.8358342051506042, 0.6952724456787109, 0.6381492018699646, 0.1987726390361786, 0.771324872970581, -1.1395491361618042, -1.0700205564498901, -0.8595576882362366, -0.6611009240150452, 2.025972366333008, -0.3533551096916199, 0.6930686831474304, -0.2673390209674835, -1.3010789155960083, -0.05940083786845207, 0.6696408987045288, 0.3512822091579437, -0.4365479052066803, 0.8356441855430603, -0.6366412043571472, -0.9974713921546936, -1.3515843152999878, -0.3269832134246826, -1.0349533557891846, -0.9087278842926025, 1.1504170894622803, 0.7550559043884277, 0.29413747787475586, 1.9311860799789429, 0.8046198487281799, 0.251242458820343, -2.4453184604644775, 0.8433482050895691, 0.2875916659832001, -0.08313989639282227, 0.8587732911109924, 0.3900362551212311, 0.9432234764099121, -0.03302372992038727, 0.42659759521484375, -2.4531772136688232, 2.2145731449127197, -0.16040721535682678, 0.7080287933349609, -0.04065192490816116, -0.21456754207611084, 1.0746599435806274, 0.5700860023498535, 0.527557373046875, -1.022945761680603, 0.47457757592201233, -0.5026518702507019, 1.3331348896026611, 0.9197827577590942, -0.706093430519104, -0.04136361926794052, 1.3329946994781494, 0.5142285227775574, -0.5643590688705444, -1.126772165298462, -0.8284087777137756, 0.9661961197853088, 1.6667726039886475, -0.03386877849698067, -0.1016373485326767, 0.7859545350074768, 0.6685531139373779, -1.2343922853469849, -0.0293696541339159, -0.7687935829162598, -0.8136346936225891, 1.801045298576355, 2.2230312824249268, -0.24111029505729675, -0.29588785767555237, -0.6096875667572021, -1.3268669843673706, 0.8372765779495239, -0.10941753536462784, 0.16992336511611938, 0.6012336611747742, -0.6598453521728516, 1.0181961059570312, 1.0044865608215332, 0.8962332606315613, 0.24738621711730957, 0.22746863961219788, 0.39002639055252075, -0.30977973341941833, -1.1672977209091187, -0.17926666140556335, -1.0950000286102295, -2.636413335800171, 0.44805702567100525, -0.13982492685317993, -1.3460026979446411, -0.012198184616863728, -1.031711220741272, 1.0612695217132568, -0.572029173374176, -0.982978105545044, -1.544453740119934, 0.21947258710861206, 0.07713592797517776, 1.0650560855865479, -1.6291762590408325, -0.30205047130584717, 1.198607087135315, 0.9479568600654602, -0.7264662384986877, 0.8746198415756226, 0.1724148690700531, 1.119957447052002, 0.7482485771179199, -0.4569619297981262, 0.5401379466056824, -0.0630967915058136, -1.3808958530426025, 0.4963517189025879, 1.1333849430084229, 0.12840574979782104, 1.5052565336227417, -0.48032236099243164, 0.09182367473840714, 0.39673006534576416, -0.6264710426330566, -0.43617919087409973, -0.5660547614097595, 0.6377729177474976, 0.09287022799253464, -0.8998534083366394, -0.16249561309814453, 0.02726166322827339, -0.30442869663238525, 0.1642259657382965, -1.4213086366653442, -0.10554671287536621, -0.3688127398490906, -0.7080214619636536, -1.1992251873016357, -0.1772577166557312, 1.3515456914901733, -0.832197368144989, -0.12414609640836716, 0.4791752099990845, 0.3242547810077667, 0.5537053942680359, 0.6544618010520935, -0.7464781403541565, -0.3787728548049927, -0.24257004261016846, -0.34468764066696167, 0.3484101891517639, 1.4008996486663818, -0.07846634835004807, -0.971393883228302, 0.60039883852005, -0.27755191922187805, 0.12118785828351974, 1.9780274629592896, 0.09340979903936386, -0.7319009900093079, 0.2442876696586609, -0.7192382216453552, 1.911426305770874, 1.6478856801986694, 1.2727713584899902, -0.15790364146232605, -0.8915001749992371, 0.7187010645866394, -0.37237748503685, -0.4859655499458313, 0.7701519131660461, 0.286260724067688, -0.18248724937438965, -1.5506902933120728, 0.7672904133796692, 1.2574820518493652, -0.9053995609283447, -0.805534839630127, 0.12592104077339172, -0.7969735860824585, 1.1224180459976196, 0.5950897932052612, 0.34636276960372925, 0.46695470809936523, 1.7305585145950317, 0.8548281192779541, -0.46577557921409607, 0.39137914776802063, 0.6913810968399048, -0.10105007141828537, -2.1066479682922363, -1.1496704816818237, 0.27045100927352905, -0.5965506434440613, -1.5924127101898193, 1.4018806219100952, -1.124803066253662, -1.0134741067886353, 0.642686665058136, 0.00869036465883255, 1.400253415107727, 0.38846656680107117, 1.5558297634124756, 2.0003557205200195, 0.8146163821220398, 0.4123639166355133, 1.2435487508773804, -0.12770912051200867, -0.436340868473053, 1.7922005653381348, -0.39636775851249695, 0.510535717010498, 1.1275968551635742, -0.16817143559455872, -1.1744455099105835, -0.7389085292816162, -1.28926420211792, -0.8196508884429932, 1.1474181413650513, 0.06630142778158188, -1.0874613523483276, 0.2699871063232422, 1.6463130712509155, 0.10568495839834213, -0.4371432662010193, 0.48819324374198914, 0.3561033606529236, -0.8123955130577087, -0.04768156632781029, -0.9102016687393188, 0.585314929485321, -0.13807973265647888, -0.3582388162612915, 0.2547701895236969, 0.4747343361377716, 1.475692629814148, -0.07460494339466095, 0.20622357726097107, 1.0210165977478027, -1.5064144134521484, 1.5534056425094604, -0.6924440264701843, 0.2821761965751648, -2.3616020679473877, 1.3469045162200928, -0.7793388366699219, 1.979552149772644, -2.7137744426727295, 0.46200916171073914, -0.5231531858444214, -0.48419997096061707, 0.22728770971298218, -0.44481199979782104, 0.1815934181213379, -0.00572997098788619, -1.1641706228256226, -0.05590679869055748, -0.5633537173271179, 0.6464536190032959, 1.112592339515686, 1.3360565900802612, -1.1202207803726196, -0.29287686944007874, -1.671897530555725, -0.05465045943856239, -0.7846315503120422, 0.08491092175245285, -1.9566093683242798, -0.14242258667945862, -1.8429007530212402, -2.266021728515625, -1.2906135320663452, -0.7755588293075562, 1.139367938041687, 0.17476144433021545, -0.9264694452285767, 1.2268964052200317, -0.35925206542015076, -1.8344517946243286, 1.1506152153015137, -2.2606899738311768 ]
https://github.com/huggingface/datasets/issues/3644
Add a GROUP BY operator
I find this functionality missing in my workflow as well and the workarounds with SQL and Polars unsatisfying. Since PyArrow has exposed this functionality, I hope this soon makes it into a release. (:
**Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column.
978
34
Add a GROUP BY operator **Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column. I find this functionality missing in my workflow as well and the workarounds with SQL and Polars unsatisfying. Since PyArrow has exposed this functionality, I hope this soon makes it into a release. (:
[ -1.2649974822998047, -0.9758623242378235, -0.788390040397644, 1.5149518251419067, -0.19254150986671448, -1.2414768934249878, 0.18476614356040955, -1.1992429494857788, 1.6573001146316528, -0.8058323264122009, 0.48877930641174316, -1.6476770639419556, -0.04355749115347862, -0.612837553024292, -0.7736255526542664, -0.8870532512664795, -0.4174593985080719, -0.6783455610275269, 1.0428389310836792, 2.5159666538238525, 1.228135108947754, -1.4173845052719116, 2.643627882003784, 0.7294040322303772, -0.11912201344966888, -0.9780504107475281, 0.6202033162117004, -0.024243338033556938, -1.1785378456115723, -0.4491642415523529, -1.0057601928710938, -0.1465596854686737, -0.5095758438110352, -0.44052115082740784, -0.08775199204683304, 0.4636000692844391, -0.32101497054100037, -0.4930031895637512, -0.6254774928092957, -0.8438013792037964, 0.48534294962882996, -0.43314477801322937, 1.0157057046890259, -0.3615816533565521, 1.746720790863037, -0.6331466436386108, 0.47281527519226074, 0.6717521548271179, 1.3863075971603394, 0.26023930311203003, -0.022842444479465485, 0.3182242512702942, 0.42581707239151, -0.13829997181892395, 0.5471469163894653, 1.2136585712432861, 0.7060502767562866, 0.46030858159065247, 0.8213571310043335, -2.1231467723846436, 1.2517999410629272, -1.2031830549240112, 0.3196184039115906, 1.3275943994522095, -0.8535203337669373, 0.3223439157009125, -1.7761149406433105, -0.11100547760725021, 0.6364269256591797, -2.191619396209717, 0.28741204738616943, -1.2873239517211914, -0.5414185523986816, 1.0583534240722656, 0.41728368401527405, -1.2858608961105347, 0.052256714552640915, -0.40361690521240234, 0.9440942406654358, 0.3177764415740967, 1.06393563747406, -1.7433977127075195, -0.011426130309700966, -0.3649598956108093, 0.09148941189050674, -1.231353998184204, -1.4505232572555542, 0.5827224254608154, 0.5128576755523682, 0.5436218976974487, -0.08814605325460434, 1.0279268026351929, -1.160483479499817, 0.808699905872345, -1.0695509910583496, -1.670318365097046, -1.4796117544174194, -2.296199083328247, -2.175844430923462, 0.7745853066444397, -0.4303884208202362, -0.5814473628997803, 1.9450629949569702, -0.9282475709915161, -1.5868940353393555, 1.117980718612671, 0.24976882338523865, 0.0951148271560669, 2.4439854621887207, 0.19448935985565186, -0.7824833989143372, 0.5694430470466614, -0.778517484664917, 0.7516402006149292, -0.3113479018211365, 1.3584003448486328, 0.31073617935180664, -0.9533784985542297, 1.6012128591537476, -0.33867141604423523, 0.5152151584625244, -0.5996986627578735, -0.49930042028427124, -0.6882275342941284, 0.44238850474357605, 1.8719401359558105, -0.25252798199653625, 1.4881348609924316, -0.22195705771446228, -1.5508415699005127, -1.5991482734680176, 0.865976095199585, 0.5494550466537476, -0.7875001430511475, 0.11288454383611679, -0.3538775146007538, 0.17896687984466553, -0.1481674313545227, 1.2014881372451782, 1.2346230745315552, 0.7702867984771729, -0.35360246896743774, -0.8278504014015198, 0.171566903591156, -0.04514814913272858, -0.8863531351089478, -1.6640745401382446, -0.37878143787384033, 0.1229773685336113, 0.6675857305526733, -1.2250099182128906, 1.8301888704299927, 0.9417589902877808, 1.839410424232483, 1.0871689319610596, -0.2964698076248169, 1.492264986038208, 0.09234746545553207, 1.782659888267517, -0.5158202052116394, 0.6074032187461853, -0.3243832588195801, -1.1786625385284424, 0.8816714882850647, -0.3297957479953766, -2.030252695083618, -0.8307357430458069, -0.7633114457130432, -0.14291781187057495, -0.8241062164306641, 0.9242371916770935, -0.418864905834198, -1.3831201791763306, 0.2980704605579376, -0.7768926024436951, 0.0022468063980340958, -1.1614524126052856, 0.2847009599208832, 0.5936657786369324, -0.6122095584869385, 0.0605311319231987, -0.15079283714294434, -1.2541753053665161, -0.3909798562526703, 0.1594967246055603, 1.9922593832015991, -0.7621906399726868, 0.8815479278564453, 1.0545291900634766, -0.6977753639221191, -0.037797726690769196, 0.3194870054721832, -0.3698379695415497, 0.8841453194618225, -1.026172399520874, -0.5834090709686279, 1.1652997732162476, -0.05649775266647339, -0.5690845251083374, 1.530582308769226, 0.593331515789032, -0.9914600849151611, -0.296389639377594, -0.09004819393157959, -0.840761661529541, 0.1148403137922287, -1.5764638185501099, -0.08671567589044571, 0.48048636317253113, -1.5732462406158447, -0.49864840507507324, -0.11248994618654251, 1.2029283046722412, -0.23918595910072327, 1.4262418746948242, -0.3745991885662079, -0.12224691361188889, -0.2820199429988861, -0.37618210911750793, 0.12642750144004822, -0.24335885047912598, -0.6468994617462158, 0.20875516533851624, -0.803003191947937, 0.38527607917785645, 1.3799821138381958, 0.3584006428718567, 0.024945110082626343, 0.46302902698516846, 1.0691536664962769, 0.39420026540756226, -0.0817345529794693, -0.8611162900924683, -1.4850738048553467, 2.065988779067993, -1.4795222282409668, 2.0412490367889404, 0.7672893404960632, -0.06633840501308441, -1.7496379613876343, -1.9155577421188354, 1.307643175125122, 1.2679369449615479, 2.3378381729125977, 0.5135713815689087, 0.42462679743766785, -0.8163408041000366, -0.6730939745903015, 0.278029203414917, -1.0662627220153809, -0.6557818651199341, 0.177076518535614, 2.369621992111206, 1.8489415645599365, -0.4356890022754669, -0.207231342792511, -0.9792075157165527, 1.4120723009109497, -0.31040599942207336, 0.20381024479866028, 1.9676378965377808, -0.24231606721878052, -1.1343162059783936, 1.3571888208389282, -2.333667755126953, 0.07358387112617493, 1.952643632888794, 0.3369930684566498, 0.13876456022262573, -1.313029170036316, -0.581362247467041, -0.42147547006607056, -0.3784652054309845, -1.2772692441940308, 0.4990706443786621, -0.1807783842086792, -0.8382742404937744, -1.3437080383300781, 0.20413723587989807, -1.1286265850067139, -1.6009711027145386, 0.20332098007202148, 1.8052253723144531, 2.124692678451538, -0.8664064407348633, 1.6035916805267334, -0.3349649906158447, 0.16605669260025024, 1.1259862184524536, 1.17887282371521, 3.101794719696045, 1.9250587224960327, -1.3296644687652588, 0.5974116921424866, -0.1747014820575714, -0.4253418743610382, 1.129769206047058, -1.2583715915679932, 1.326586127281189, -0.036746494472026825, -1.1582812070846558, -1.122557282447815, 0.9711512923240662, 0.39433595538139343, -0.02548292838037014, -0.5595840811729431, 1.0577281713485718, 0.05915199965238571, 1.3832345008850098, 0.5615488886833191, -0.20400482416152954, 0.5646898746490479, -0.43354561924934387, -0.45445698499679565, 1.5279595851898193, 0.14885678887367249, -1.412191390991211, -2.284015417098999, -0.134000763297081, -0.8742688894271851, 0.14920902252197266, -0.6103676557540894, -1.0385241508483887, 1.7111303806304932, 0.24371322989463806, -1.3141111135482788, -0.2866344749927521, -0.42748725414276123, -0.6242830753326416, 2.790576696395874, -1.3546404838562012, -0.22900643944740295, -1.050687551498413, -0.7226554751396179, 1.717665433883667, -1.144421100616455, -0.15779989957809448, -1.036759376525879, -0.5156813263893127, -1.3202613592147827, -0.6139951944351196, 0.08965489268302917, -0.9774641990661621, 0.8181247711181641, 0.17317599058151245, -1.168229341506958, -0.3679884076118469, -0.8089788556098938, 0.8826403617858887, -0.15509536862373352, 0.14509299397468567, 1.918969750404358, 0.27533093094825745, -0.3074449300765991, 0.7057552337646484, 1.240727424621582, 0.6754874587059021, -0.6397759914398193, 0.14688879251480103, -0.6908125281333923, 0.36980485916137695, -1.3157680034637451, 0.21718630194664001, -2.742719888687134, 0.6402110457420349, 0.009104562923312187, -0.054070845246315, 0.010740164667367935, -1.2442935705184937, 1.176127552986145, 2.5879738330841064, -1.1841192245483398, 0.4750974178314209, 0.3051771819591522, 1.1151013374328613, -1.5889562368392944, 0.30549460649490356, -0.40222010016441345, 2.0898897647857666, 0.18935513496398926, 1.195434808731079, -0.49972230195999146, -2.2674732208251953, 0.7286493182182312, -1.331112027168274, -1.2777099609375, 0.6985568404197693, -0.9508486390113831, 0.27278339862823486, -1.5236871242523193, -0.2538771629333496, -0.8353303670883179, -1.0541789531707764, 0.646632969379425, 0.049704328179359436, 0.34553784132003784, -0.5523374080657959, 0.37047815322875977, -2.2239513397216797, -1.4059208631515503, -0.22210246324539185, -0.9950542449951172, 0.468890517950058, -0.41528865694999695, 0.6933695077896118, -0.1437821388244629, -0.022851327434182167, 0.38395100831985474, 1.4514371156692505, 3.4942209720611572, 0.3043263554573059, 0.33221590518951416, -0.17741593718528748, -0.9082669019699097, 1.465807557106018, 0.893558144569397, -0.07587708532810211, -0.5131135582923889, -1.0695465803146362, 1.3202563524246216, 1.9045065641403198, 0.9686269164085388, 0.07681170850992203, -0.8410950899124146, -0.6694467663764954, -0.11590945720672607, 0.20775923132896423, 0.37447357177734375, 0.8727474808692932, 0.042925819754600525, 0.007675273343920708, 1.543691873550415, 1.096929907798767, -0.44304436445236206, 0.25371044874191284, -0.8919681310653687, -0.5059712529182434, 0.538577139377594, 0.25093328952789307, -0.038706935942173004, 0.38570278882980347, -0.9816134572029114, -0.3063690662384033, -0.3792993724346161, -0.8257309198379517, -0.610448956489563, -0.3430563509464264, -0.31690505146980286, 1.6472032070159912, 0.1113976389169693, -0.5339786410331726, 0.0014401981607079506, -0.8819073438644409, -0.07408569008111954, -1.1122679710388184, 0.1613422930240631, -0.049193914979696274, -0.12987442314624786, -0.24490132927894592, 1.8106926679611206, -0.8445698022842407, -2.0188450813293457, 0.1979973018169403, 0.3035009503364563, -0.2349289059638977, 0.18922466039657593, 1.6549084186553955, 0.6029565334320068, 1.421418309211731, 1.2428455352783203, 0.8904584050178528, -0.6296622157096863, -1.2904425859451294, 0.6149243712425232, 1.0337512493133545, -1.3137000799179077, 0.8719291687011719, -0.045275039970874786, -0.3992554545402527, 0.5276616811752319, 1.2941973209381104, 0.5357967019081116, -1.8880982398986816, 0.7980982661247253, -0.9744399189949036, 0.8358342051506042, 0.6952724456787109, 0.6381492018699646, 0.1987726390361786, 0.771324872970581, -1.1395491361618042, -1.0700205564498901, -0.8595576882362366, -0.6611009240150452, 2.025972366333008, -0.3533551096916199, 0.6930686831474304, -0.2673390209674835, -1.3010789155960083, -0.05940083786845207, 0.6696408987045288, 0.3512822091579437, -0.4365479052066803, 0.8356441855430603, -0.6366412043571472, -0.9974713921546936, -1.3515843152999878, -0.3269832134246826, -1.0349533557891846, -0.9087278842926025, 1.1504170894622803, 0.7550559043884277, 0.29413747787475586, 1.9311860799789429, 0.8046198487281799, 0.251242458820343, -2.4453184604644775, 0.8433482050895691, 0.2875916659832001, -0.08313989639282227, 0.8587732911109924, 0.3900362551212311, 0.9432234764099121, -0.03302372992038727, 0.42659759521484375, -2.4531772136688232, 2.2145731449127197, -0.16040721535682678, 0.7080287933349609, -0.04065192490816116, -0.21456754207611084, 1.0746599435806274, 0.5700860023498535, 0.527557373046875, -1.022945761680603, 0.47457757592201233, -0.5026518702507019, 1.3331348896026611, 0.9197827577590942, -0.706093430519104, -0.04136361926794052, 1.3329946994781494, 0.5142285227775574, -0.5643590688705444, -1.126772165298462, -0.8284087777137756, 0.9661961197853088, 1.6667726039886475, -0.03386877849698067, -0.1016373485326767, 0.7859545350074768, 0.6685531139373779, -1.2343922853469849, -0.0293696541339159, -0.7687935829162598, -0.8136346936225891, 1.801045298576355, 2.2230312824249268, -0.24111029505729675, -0.29588785767555237, -0.6096875667572021, -1.3268669843673706, 0.8372765779495239, -0.10941753536462784, 0.16992336511611938, 0.6012336611747742, -0.6598453521728516, 1.0181961059570312, 1.0044865608215332, 0.8962332606315613, 0.24738621711730957, 0.22746863961219788, 0.39002639055252075, -0.30977973341941833, -1.1672977209091187, -0.17926666140556335, -1.0950000286102295, -2.636413335800171, 0.44805702567100525, -0.13982492685317993, -1.3460026979446411, -0.012198184616863728, -1.031711220741272, 1.0612695217132568, -0.572029173374176, -0.982978105545044, -1.544453740119934, 0.21947258710861206, 0.07713592797517776, 1.0650560855865479, -1.6291762590408325, -0.30205047130584717, 1.198607087135315, 0.9479568600654602, -0.7264662384986877, 0.8746198415756226, 0.1724148690700531, 1.119957447052002, 0.7482485771179199, -0.4569619297981262, 0.5401379466056824, -0.0630967915058136, -1.3808958530426025, 0.4963517189025879, 1.1333849430084229, 0.12840574979782104, 1.5052565336227417, -0.48032236099243164, 0.09182367473840714, 0.39673006534576416, -0.6264710426330566, -0.43617919087409973, -0.5660547614097595, 0.6377729177474976, 0.09287022799253464, -0.8998534083366394, -0.16249561309814453, 0.02726166322827339, -0.30442869663238525, 0.1642259657382965, -1.4213086366653442, -0.10554671287536621, -0.3688127398490906, -0.7080214619636536, -1.1992251873016357, -0.1772577166557312, 1.3515456914901733, -0.832197368144989, -0.12414609640836716, 0.4791752099990845, 0.3242547810077667, 0.5537053942680359, 0.6544618010520935, -0.7464781403541565, -0.3787728548049927, -0.24257004261016846, -0.34468764066696167, 0.3484101891517639, 1.4008996486663818, -0.07846634835004807, -0.971393883228302, 0.60039883852005, -0.27755191922187805, 0.12118785828351974, 1.9780274629592896, 0.09340979903936386, -0.7319009900093079, 0.2442876696586609, -0.7192382216453552, 1.911426305770874, 1.6478856801986694, 1.2727713584899902, -0.15790364146232605, -0.8915001749992371, 0.7187010645866394, -0.37237748503685, -0.4859655499458313, 0.7701519131660461, 0.286260724067688, -0.18248724937438965, -1.5506902933120728, 0.7672904133796692, 1.2574820518493652, -0.9053995609283447, -0.805534839630127, 0.12592104077339172, -0.7969735860824585, 1.1224180459976196, 0.5950897932052612, 0.34636276960372925, 0.46695470809936523, 1.7305585145950317, 0.8548281192779541, -0.46577557921409607, 0.39137914776802063, 0.6913810968399048, -0.10105007141828537, -2.1066479682922363, -1.1496704816818237, 0.27045100927352905, -0.5965506434440613, -1.5924127101898193, 1.4018806219100952, -1.124803066253662, -1.0134741067886353, 0.642686665058136, 0.00869036465883255, 1.400253415107727, 0.38846656680107117, 1.5558297634124756, 2.0003557205200195, 0.8146163821220398, 0.4123639166355133, 1.2435487508773804, -0.12770912051200867, -0.436340868473053, 1.7922005653381348, -0.39636775851249695, 0.510535717010498, 1.1275968551635742, -0.16817143559455872, -1.1744455099105835, -0.7389085292816162, -1.28926420211792, -0.8196508884429932, 1.1474181413650513, 0.06630142778158188, -1.0874613523483276, 0.2699871063232422, 1.6463130712509155, 0.10568495839834213, -0.4371432662010193, 0.48819324374198914, 0.3561033606529236, -0.8123955130577087, -0.04768156632781029, -0.9102016687393188, 0.585314929485321, -0.13807973265647888, -0.3582388162612915, 0.2547701895236969, 0.4747343361377716, 1.475692629814148, -0.07460494339466095, 0.20622357726097107, 1.0210165977478027, -1.5064144134521484, 1.5534056425094604, -0.6924440264701843, 0.2821761965751648, -2.3616020679473877, 1.3469045162200928, -0.7793388366699219, 1.979552149772644, -2.7137744426727295, 0.46200916171073914, -0.5231531858444214, -0.48419997096061707, 0.22728770971298218, -0.44481199979782104, 0.1815934181213379, -0.00572997098788619, -1.1641706228256226, -0.05590679869055748, -0.5633537173271179, 0.6464536190032959, 1.112592339515686, 1.3360565900802612, -1.1202207803726196, -0.29287686944007874, -1.671897530555725, -0.05465045943856239, -0.7846315503120422, 0.08491092175245285, -1.9566093683242798, -0.14242258667945862, -1.8429007530212402, -2.266021728515625, -1.2906135320663452, -0.7755588293075562, 1.139367938041687, 0.17476144433021545, -0.9264694452285767, 1.2268964052200317, -0.35925206542015076, -1.8344517946243286, 1.1506152153015137, -2.2606899738311768 ]
https://github.com/huggingface/datasets/issues/3639
same value of precision, recall, f1 score at each epoch for classification task.
Hi @Dhanachandra, We have tests for all our metrics and they work as expected: under the hood, we use scikit-learn implementations. Maybe the cause is somewhere else. For example: - Is it a binary or a multiclass or a multilabel classification? Default computation of these metrics is for binary classification; if you would like multiclass or multilabel, you should pass the corresponding parameters; see their documentation (e.g.: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_score.html) or code below: https://huggingface.co/docs/datasets/using_metrics.html#computing-the-metric-scores ```python In [1]: from datasets import load_metric In [2]: precision = load_metric("precision") In [3]: print(precision.inputs_description) Args: predictions: Predicted labels, as returned by a model. references: Ground truth labels. labels: The set of labels to include when average != 'binary', and their order if average is None. Labels present in the data can be excluded, for example to calculate a multiclass average ignoring a majority negative class, while labels not present in the data will result in 0 components in a macro average. For multilabel targets, labels are column indices. By default, all labels in y_true and y_pred are used in sorted order. average: This parameter is required for multiclass/multilabel targets. If None, the scores for each class are returned. Otherwise, this determines the type of averaging performed on the data: binary: Only report results for the class specified by pos_label. This is applicable only if targets (y_{true,pred}) are binary. micro: Calculate metrics globally by counting the total true positives, false negatives and false positives. macro: Calculate metrics for each label, and find their unweighted mean. This does not take label imbalance into account. weighted: Calculate metrics for each label, and find their average weighted by support (the number of true instances for each label). This alters ‘macro’ to account for label imbalance; it can result in an F-score that is not between precision and recall. samples: Calculate metrics for each instance, and find their average (only meaningful for multilabel classification). sample_weight: Sample weights. Returns: precision: Precision score. Examples: >>> precision_metric = datasets.load_metric("precision") >>> results = precision_metric.compute(references=[0, 1], predictions=[0, 1]) >>> print(results) {'precision': 1.0} >>> predictions = [0, 2, 1, 0, 0, 1] >>> references = [0, 1, 2, 0, 1, 2] >>> results = precision_metric.compute(predictions=predictions, references=references, average='macro') >>> print(results) {'precision': 0.2222222222222222} >>> results = precision_metric.compute(predictions=predictions, references=references, average='micro') >>> print(results) {'precision': 0.3333333333333333} >>> results = precision_metric.compute(predictions=predictions, references=references, average='weighted') >>> print(results) {'precision': 0.2222222222222222} >>> results = precision_metric.compute(predictions=predictions, references=references, average=None) >>> print(results) {'precision': array([0.66666667, 0. , 0. ])} ```
**1st Epoch:** 1/27/2022 09:30:48 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/f1/default/default_experiment-1-0.arrow.59it/s] 01/27/2022 09:30:48 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/precision/default/default_experiment-1-0.arrow 01/27/2022 09:30:49 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/recall/default/default_experiment-1-0.arrow PRECISION: {'precision': 0.7612903225806451} RECALL: {'recall': 0.7612903225806451} F1: {'f1': 0.7612903225806451} {'eval_loss': 1.4658324718475342, 'eval_accuracy': 0.7612903118133545, 'eval_runtime': 30.0054, 'eval_samples_per_second': 46.492, 'eval_steps_per_second': 46.492, 'epoch': 3.0} **4th Epoch:** 1/27/2022 09:56:55 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/f1/default/default_experiment-1-0.arrow.92it/s] 01/27/2022 09:56:56 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/precision/default/default_experiment-1-0.arrow 01/27/2022 09:56:56 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/recall/default/default_experiment-1-0.arrow PRECISION: {'precision': 0.7698924731182796} RECALL: {'recall': 0.7698924731182796} F1: {'f1': 0.7698924731182796} ## Environment info !git clone https://github.com/huggingface/transformers %cd transformers !pip install . !pip install -r /content/transformers/examples/pytorch/token-classification/requirements.txt !pip install datasets
980
398
same value of precision, recall, f1 score at each epoch for classification task. **1st Epoch:** 1/27/2022 09:30:48 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/f1/default/default_experiment-1-0.arrow.59it/s] 01/27/2022 09:30:48 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/precision/default/default_experiment-1-0.arrow 01/27/2022 09:30:49 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/recall/default/default_experiment-1-0.arrow PRECISION: {'precision': 0.7612903225806451} RECALL: {'recall': 0.7612903225806451} F1: {'f1': 0.7612903225806451} {'eval_loss': 1.4658324718475342, 'eval_accuracy': 0.7612903118133545, 'eval_runtime': 30.0054, 'eval_samples_per_second': 46.492, 'eval_steps_per_second': 46.492, 'epoch': 3.0} **4th Epoch:** 1/27/2022 09:56:55 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/f1/default/default_experiment-1-0.arrow.92it/s] 01/27/2022 09:56:56 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/precision/default/default_experiment-1-0.arrow 01/27/2022 09:56:56 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/recall/default/default_experiment-1-0.arrow PRECISION: {'precision': 0.7698924731182796} RECALL: {'recall': 0.7698924731182796} F1: {'f1': 0.7698924731182796} ## Environment info !git clone https://github.com/huggingface/transformers %cd transformers !pip install . !pip install -r /content/transformers/examples/pytorch/token-classification/requirements.txt !pip install datasets Hi @Dhanachandra, We have tests for all our metrics and they work as expected: under the hood, we use scikit-learn implementations. Maybe the cause is somewhere else. For example: - Is it a binary or a multiclass or a multilabel classification? Default computation of these metrics is for binary classification; if you would like multiclass or multilabel, you should pass the corresponding parameters; see their documentation (e.g.: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_score.html) or code below: https://huggingface.co/docs/datasets/using_metrics.html#computing-the-metric-scores ```python In [1]: from datasets import load_metric In [2]: precision = load_metric("precision") In [3]: print(precision.inputs_description) Args: predictions: Predicted labels, as returned by a model. references: Ground truth labels. labels: The set of labels to include when average != 'binary', and their order if average is None. Labels present in the data can be excluded, for example to calculate a multiclass average ignoring a majority negative class, while labels not present in the data will result in 0 components in a macro average. For multilabel targets, labels are column indices. By default, all labels in y_true and y_pred are used in sorted order. average: This parameter is required for multiclass/multilabel targets. If None, the scores for each class are returned. Otherwise, this determines the type of averaging performed on the data: binary: Only report results for the class specified by pos_label. This is applicable only if targets (y_{true,pred}) are binary. micro: Calculate metrics globally by counting the total true positives, false negatives and false positives. macro: Calculate metrics for each label, and find their unweighted mean. This does not take label imbalance into account. weighted: Calculate metrics for each label, and find their average weighted by support (the number of true instances for each label). This alters ‘macro’ to account for label imbalance; it can result in an F-score that is not between precision and recall. samples: Calculate metrics for each instance, and find their average (only meaningful for multilabel classification). sample_weight: Sample weights. Returns: precision: Precision score. Examples: >>> precision_metric = datasets.load_metric("precision") >>> results = precision_metric.compute(references=[0, 1], predictions=[0, 1]) >>> print(results) {'precision': 1.0} >>> predictions = [0, 2, 1, 0, 0, 1] >>> references = [0, 1, 2, 0, 1, 2] >>> results = precision_metric.compute(predictions=predictions, references=references, average='macro') >>> print(results) {'precision': 0.2222222222222222} >>> results = precision_metric.compute(predictions=predictions, references=references, average='micro') >>> print(results) {'precision': 0.3333333333333333} >>> results = precision_metric.compute(predictions=predictions, references=references, average='weighted') >>> print(results) {'precision': 0.2222222222222222} >>> results = precision_metric.compute(predictions=predictions, references=references, average=None) >>> print(results) {'precision': array([0.66666667, 0. , 0. ])} ```
[ -1.1134930849075317, -1.0416456460952759, -0.7136155366897583, 1.5456631183624268, -0.12044119834899902, -1.2317355871200562, 0.036532096564769745, -0.8581305742263794, 1.5046128034591675, -0.6103307604789734, 0.27678972482681274, -1.6628109216690063, -0.06135821342468262, -0.6014117002487183, -0.6960776448249817, -0.7163018584251404, -0.30700281262397766, -0.7960786819458008, 1.0687187910079956, 2.579005718231201, 1.313586711883545, -1.410504698753357, 2.6850109100341797, 0.7013742327690125, -0.22613425552845, -0.9741168022155762, 0.5391719341278076, 0.04955574870109558, -1.3785736560821533, -0.3024243116378784, -0.8702570199966431, 0.12522780895233154, -0.6032260060310364, -0.4245172441005707, 0.15284426510334015, 0.37927404046058655, -0.1698417365550995, -0.33319976925849915, -0.6071525812149048, -0.6737567186355591, 0.47079557180404663, -0.33492520451545715, 0.913940966129303, -0.25962042808532715, 1.6553914546966553, -0.5583114624023438, 0.4001656174659729, 0.6084883809089661, 1.245230793952942, 0.12059631198644638, 0.1571408361196518, 0.33964037895202637, 0.40590524673461914, 0.07516676932573318, 0.6068671345710754, 1.2216498851776123, 0.6397486329078674, 0.3761865198612213, 0.6879568099975586, -2.3255817890167236, 1.3060189485549927, -0.8487602472305298, 0.29145321249961853, 1.3224531412124634, -0.8716088533401489, 0.3069645166397095, -1.8770986795425415, 0.10640309751033783, 0.677853524684906, -2.176100969314575, 0.25104087591171265, -1.2232096195220947, -0.48201310634613037, 0.9950101971626282, 0.25729900598526, -1.1862622499465942, 0.22375711798667908, -0.4989778995513916, 1.0660912990570068, 0.3798905909061432, 1.0891529321670532, -1.7666585445404053, 0.01851946860551834, -0.06730987876653671, 0.10986318439245224, -1.3089205026626587, -1.7015047073364258, 0.5652267336845398, 0.5687719583511353, 0.6750820279121399, -0.10777249187231064, 0.8682571649551392, -1.1187083721160889, 0.8047915101051331, -1.085768461227417, -1.7535728216171265, -1.4731829166412354, -2.4922804832458496, -2.235663414001465, 0.6646899580955505, -0.4296089708805084, -0.35915568470954895, 1.8803699016571045, -0.9945504069328308, -1.8123515844345093, 1.070967674255371, 0.47900062799453735, 0.1482246071100235, 2.3244385719299316, 0.13862034678459167, -0.7682866454124451, 0.5318503379821777, -0.8372481465339661, 0.6794654130935669, -0.27234169840812683, 1.3103249073028564, 0.4674852192401886, -0.9082528352737427, 1.5685112476348877, -0.49202388525009155, 0.5173722505569458, -0.7602418661117554, -0.33633700013160706, -0.7501809597015381, 0.1631297767162323, 1.8426231145858765, -0.35053130984306335, 1.4777659177780151, -0.42321494221687317, -1.502153754234314, -1.4910727739334106, 0.6636455655097961, 0.5605476498603821, -0.8767806887626648, 0.09405568242073059, -0.5566999316215515, 0.14747066795825958, -0.1368776112794876, 1.0743093490600586, 1.2078547477722168, 0.6427132487297058, -0.26194921135902405, -0.9678604006767273, 0.18020838499069214, -0.24135248363018036, -0.5800336003303528, -1.8963940143585205, -0.1900995671749115, 0.32255420088768005, 0.7276346683502197, -1.232982873916626, 1.7655149698257446, 0.9172981977462769, 2.0446789264678955, 1.002941608428955, -0.49518686532974243, 1.532671332359314, 0.09643006324768066, 1.8570411205291748, -0.5722394585609436, 0.6229238510131836, -0.44517555832862854, -1.0873202085494995, 0.9387581944465637, -0.41441643238067627, -2.1035728454589844, -0.625819981098175, -0.8817230463027954, -0.29976141452789307, -0.8536243438720703, 0.9168744683265686, -0.2256370186805725, -1.4244900941848755, 0.10734758526086807, -0.7407230138778687, 0.21914325654506683, -1.15923011302948, 0.14980703592300415, 0.832506537437439, -0.6188903450965881, -0.040155936032533646, -0.30761414766311646, -1.386239767074585, -0.6289156079292297, 0.4976746737957001, 1.784341812133789, -0.6314243078231812, 1.0114598274230957, 1.015383243560791, -0.595970630645752, 0.2282496690750122, 0.3025042414665222, -0.3314548432826996, 0.8265054225921631, -0.9697438478469849, -0.4578881859779358, 1.051173210144043, -0.3137515187263489, -0.642737090587616, 1.361016869544983, 0.9248512387275696, -1.0404683351516724, -0.3537006378173828, -0.08724644780158997, -0.7259900569915771, -0.008701283484697342, -1.5658284425735474, -0.15213711559772491, 0.29462000727653503, -1.5886026620864868, -0.43202561140060425, -0.2305821180343628, 1.4842079877853394, -0.13691920042037964, 1.36734938621521, -0.14925944805145264, -0.016013219952583313, -0.40772825479507446, -0.46943750977516174, 0.21814198791980743, -0.2457558661699295, -0.5780244469642639, 0.3835930824279785, -0.9118051528930664, 0.38108697533607483, 1.4860814809799194, 0.34747621417045593, 0.09600099176168442, 0.4602791368961334, 1.054460048675537, 0.41196462512016296, 0.07750804722309113, -0.8226913809776306, -1.6476848125457764, 2.054758310317993, -1.4913661479949951, 1.9685792922973633, 0.8249431848526001, -0.07474549859762192, -1.8073055744171143, -1.9092085361480713, 1.2885100841522217, 0.9876366853713989, 2.4059042930603027, 0.5393459796905518, 0.41055139899253845, -0.7751246690750122, -0.8118367791175842, 0.3578680455684662, -0.8339517116546631, -0.7745407223701477, 0.10631576180458069, 2.4549717903137207, 1.756223201751709, -0.4305136203765869, -0.28020620346069336, -0.846793532371521, 1.4229737520217896, -0.11277434229850769, 0.3052448630332947, 2.046321153640747, -0.2274390012025833, -1.003557801246643, 1.3297990560531616, -2.461642265319824, 0.47035664319992065, 2.025536060333252, 0.3028090000152588, 0.1773943305015564, -1.4400430917739868, -0.7405746579170227, -0.22978061437606812, -0.5285924077033997, -1.239823341369629, 0.5107019543647766, -0.2649931013584137, -1.006430745124817, -1.4303231239318848, -0.03817592188715935, -1.1743067502975464, -1.8027253150939941, 0.4114989638328552, 1.8962090015411377, 2.281374931335449, -0.8144508004188538, 1.355914831161499, -0.15995268523693085, 0.08522704243659973, 1.2719999551773071, 1.398972511291504, 3.1156742572784424, 1.9274922609329224, -1.281316876411438, 0.7462061047554016, -0.25688549876213074, -0.465175986289978, 1.152954339981079, -1.1235675811767578, 1.0882986783981323, -0.27580538392066956, -1.1745275259017944, -1.1998261213302612, 1.102288007736206, 0.5212811231613159, -0.028134331107139587, -0.5319920182228088, 1.110152006149292, 0.14070910215377808, 1.3189811706542969, 0.6548154950141907, -0.30670174956321716, 0.4605098068714142, -0.3816066086292267, -0.6079365015029907, 1.5850483179092407, 0.032676633447408676, -1.527323842048645, -2.3355045318603516, -0.3313574492931366, -0.9907861351966858, -0.12193045765161514, -0.668670654296875, -1.0829564332962036, 1.5520405769348145, 0.45248305797576904, -1.1539266109466553, -0.08849319815635681, -0.3186968266963959, -0.5040194988250732, 2.5370004177093506, -1.375388741493225, -0.16594143211841583, -1.0542482137680054, -0.4803125262260437, 1.5900038480758667, -1.099112629890442, -0.1753588765859604, -1.0777841806411743, -0.6740121841430664, -1.283124327659607, -0.4564493000507355, -0.05525271221995354, -0.8028831481933594, 0.8259338140487671, 0.06662575155496597, -1.136542558670044, -0.3270070254802704, -0.9369782209396362, 0.9911126494407654, -0.15685124695301056, 0.26303550601005554, 1.847875714302063, 0.37682685256004333, -0.3000754714012146, 0.7253238558769226, 1.1698297262191772, 0.6781119704246521, -0.6339269280433655, 0.10939935594797134, -0.5317167639732361, 0.4847135841846466, -1.332764744758606, 0.3342283368110657, -2.8850555419921875, 0.6865755915641785, -0.04524701461195946, -0.1682867556810379, -0.13942372798919678, -1.376600742340088, 1.1683956384658813, 2.5095510482788086, -1.2203023433685303, 0.5954217910766602, 0.4300113618373871, 1.1028199195861816, -1.649499773979187, 0.07223368436098099, -0.5744463205337524, 2.219966411590576, 0.08435631543397903, 1.1275849342346191, -0.5776509046554565, -2.2721660137176514, 0.5829315185546875, -1.24925696849823, -0.8346424698829651, 0.6808590292930603, -0.8288441896438599, 0.32633647322654724, -1.5301814079284668, -0.17445847392082214, -1.128239393234253, -1.3248372077941895, 0.564900815486908, -0.017379114404320717, 0.44874125719070435, -0.5994805693626404, 0.353368878364563, -2.1024985313415527, -1.317030906677246, -0.20909127593040466, -0.9830641150474548, 0.6351502537727356, -0.3985728323459625, 0.6916090250015259, 0.0768674686551094, -0.03938646614551544, 0.22068463265895844, 1.362841010093689, 3.347520112991333, 0.10091684013605118, 0.23425425589084625, -0.11529763787984848, -1.0321476459503174, 1.413492202758789, 0.9939225316047668, -0.05066569894552231, -0.5720466375350952, -1.0999953746795654, 1.4145201444625854, 2.042341470718384, 1.2072638273239136, 0.13905580341815948, -0.9382545351982117, -0.8884524703025818, 0.08587726950645447, 0.21364998817443848, 0.535544753074646, 0.9470664858818054, -0.06282950937747955, 0.08850821852684021, 1.416420578956604, 1.2009936571121216, -0.17353378236293793, 0.4295791983604431, -1.0006664991378784, -0.36131665110588074, 0.33623698353767395, 0.21554891765117645, 0.04566537216305733, 0.5048539042472839, -1.1383593082427979, -0.2643534243106842, -0.25763368606567383, -0.8943475484848022, -0.7227275371551514, -0.3668056130409241, -0.42084136605262756, 1.53896963596344, 0.07532817870378494, -0.409059077501297, -0.005481101106852293, -0.7283090949058533, -0.11154957860708237, -1.0614511966705322, 0.22338902950286865, -0.26460662484169006, 0.0157792866230011, -0.27479788661003113, 1.6140851974487305, -0.882212221622467, -2.1276845932006836, 0.12352802604436874, 0.37216365337371826, -0.46747639775276184, 0.17153780162334442, 1.7473747730255127, 0.6031526327133179, 1.362260103225708, 1.2658294439315796, 1.0511646270751953, -0.5550989508628845, -1.2162392139434814, 0.7437410950660706, 0.9379938244819641, -1.3852652311325073, 1.013060212135315, -0.22453203797340393, -0.5409539937973022, 0.7355586290359497, 1.4102836847305298, 0.2933201193809509, -2.0637967586517334, 0.8569017052650452, -0.9553527235984802, 0.8954442143440247, 0.6936033964157104, 0.912460446357727, 0.2176923304796219, 0.7683364748954773, -1.4308135509490967, -0.9781234264373779, -0.7111752033233643, -0.665529727935791, 1.8815104961395264, -0.32461920380592346, 0.4834657609462738, -0.15034759044647217, -1.2285338640213013, -0.20200732350349426, 0.735139787197113, 0.2908938229084015, -0.38306713104248047, 0.8914445638656616, -0.6261452436447144, -1.0346896648406982, -1.0755927562713623, -0.39052683115005493, -0.9288730025291443, -0.8631810545921326, 1.0518075227737427, 0.8080399632453918, 0.6448647379875183, 1.9553675651550293, 0.5217750668525696, 0.163665771484375, -2.681913137435913, 0.8523798584938049, 0.2453583925962448, -0.06113602966070175, 0.9765453934669495, 0.10546597838401794, 1.1425352096557617, -0.07745228707790375, 0.6478202939033508, -2.29689884185791, 2.1327428817749023, -0.09331532567739487, 0.7591229677200317, 0.02499985322356224, 0.002958051860332489, 1.0614711046218872, 0.5896800756454468, 0.6459454894065857, -1.1421184539794922, 0.8376864194869995, -0.5287383794784546, 1.197985291481018, 0.762377917766571, -0.9196275472640991, 0.0588398203253746, 1.2469408512115479, 0.31858256459236145, -0.47861844301223755, -0.95912766456604, -0.8358743190765381, 0.9817193150520325, 1.750333547592163, -0.053501393646001816, 0.03878149390220642, 0.8951519727706909, 0.7261524796485901, -1.286476969718933, 0.054955124855041504, -0.6019350290298462, -0.5622469186782837, 1.77262544631958, 2.1304619312286377, -0.09175054728984833, -0.09068237990140915, -0.793201208114624, -1.3433672189712524, 0.6049540638923645, -0.025949526578187943, 0.0461239255964756, 0.6470939517021179, -0.6535131335258484, 1.1447004079818726, 0.5844404697418213, 0.9446215033531189, -0.19470904767513275, 0.26995348930358887, 0.22053802013397217, -0.4487250745296478, -1.2214601039886475, -0.5414389967918396, -1.0963523387908936, -2.4867677688598633, 0.412399023771286, -0.11861629784107208, -1.4422502517700195, 0.05629502236843109, -0.9958652257919312, 0.7961085438728333, -0.6038297414779663, -1.2488118410110474, -1.2878390550613403, 0.29680588841438293, -0.15987926721572876, 0.8283688426017761, -1.697662353515625, -0.06165790930390358, 1.152304768562317, 0.8281943798065186, -0.4873567819595337, 0.9511260390281677, 0.26425793766975403, 0.8836365938186646, 0.8367131352424622, -0.2798866033554077, 0.46875837445259094, 0.2887340486049652, -1.3459382057189941, 0.3345879018306732, 1.285117745399475, 0.24996165931224823, 1.3654656410217285, -0.5353168845176697, 0.16311675310134888, 0.4193222224712372, -0.538698136806488, -0.5440442562103271, -0.31341829895973206, 0.7431008815765381, 0.015609554015100002, -0.9822916984558105, -0.09214546531438828, -0.054868727922439575, -0.1582176238298416, 0.15369267761707306, -1.4217966794967651, -0.24140994250774384, -0.28280994296073914, -0.5102877616882324, -1.3227156400680542, 0.010945267044007778, 1.3558886051177979, -0.8066197633743286, -0.16423657536506653, 0.47208717465400696, 0.17712967097759247, 0.598885715007782, 0.6892057657241821, -0.5604240298271179, -0.4581140875816345, -0.1740332990884781, -0.29655876755714417, 0.30959755182266235, 1.1606367826461792, -0.08438143879175186, -0.9524455070495605, 0.6498788595199585, -0.44194161891937256, 0.1887541264295578, 1.9682480096817017, -0.14709916710853577, -0.7483532428741455, 0.42121025919914246, -0.6750271320343018, 1.8184832334518433, 1.6597285270690918, 1.2743427753448486, -0.2493739277124405, -0.9298197031021118, 0.6510944962501526, -0.2742938697338104, -0.3704182803630829, 0.8960314989089966, 0.45275673270225525, -0.2899831533432007, -1.350781798362732, 0.522268533706665, 1.3288040161132812, -0.9913671016693115, -0.736736536026001, 0.2907814681529999, -0.9279164671897888, 1.2617690563201904, 0.5682248473167419, 0.28578224778175354, 0.2575807571411133, 1.6166952848434448, 0.6624336838722229, -0.5265071988105774, 0.4925539195537567, 0.5030254125595093, -0.3313102722167969, -2.0049262046813965, -1.0013670921325684, 0.28522318601608276, -0.3713672161102295, -1.5656079053878784, 1.188841462135315, -1.2564566135406494, -1.0484938621520996, 0.5632944703102112, 0.18853551149368286, 1.3176363706588745, 0.3205971121788025, 1.8147666454315186, 2.1131067276000977, 0.8460626602172852, 0.3932945728302002, 1.1510473489761353, -0.0527820847928524, -0.5300329923629761, 1.7854175567626953, -0.391605943441391, 0.750594437122345, 1.093786358833313, -0.48359352350234985, -1.252736210823059, -0.7789133787155151, -1.1253998279571533, -0.6158425807952881, 1.2960867881774902, 0.1401202529668808, -1.0854015350341797, 0.24098731577396393, 1.5995858907699585, 0.0761365070939064, -0.11181166768074036, 0.6793705821037292, 0.4153459072113037, -0.6899765729904175, -0.13069212436676025, -0.9452944993972778, 0.46397629380226135, -0.21851979196071625, -0.250801146030426, 0.23316232860088348, 0.5566273331642151, 1.2121561765670776, -0.05939839035272598, 0.08012212067842484, 1.1815358400344849, -1.4290387630462646, 1.5923709869384766, -0.760413408279419, 0.3908824026584625, -2.443723678588867, 1.3752238750457764, -0.7969748973846436, 1.993760347366333, -2.5544557571411133, 0.30543962121009827, -0.5960844159126282, -0.6160882115364075, 0.23201709985733032, -0.24233685433864594, 0.021558023989200592, -0.1869162768125534, -0.894945502281189, -0.07912520319223404, -0.8469749093055725, 0.46315935254096985, 1.3026028871536255, 1.3589383363723755, -1.1601753234863281, -0.25252267718315125, -1.6763484477996826, -0.32295507192611694, -0.9136655330657959, 0.37919551134109497, -1.886397123336792, -0.11677048355340958, -1.9939757585525513, -2.281798839569092, -1.4424126148223877, -0.9422545433044434, 0.9926431775093079, 0.11924160271883011, -0.8309316039085388, 1.0689342021942139, -0.28353390097618103, -1.6960393190383911, 1.0525315999984741, -2.145216226577759 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
This issue was original reported at https://github.com/huggingface/transformers/issues/14931 and It seems like this issue also occur with other AutoClass like AutoFeatureExtractor.
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
20
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 This issue was original reported at https://github.com/huggingface/transformers/issues/14931 and It seems like this issue also occur with other AutoClass like AutoFeatureExtractor.
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
Thanks for moving the issue here ! I wasn't able to reproduce the issue on my env (the hashes stay the same): ``` - `transformers` version: 1.15.0 - `tokenizers` version: 0.10.3 - `datasets` version: 1.18.1 - `dill` version: 0.3.4 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-debian-10.11 - Python version: 3.7.10 - PyArrow version: 6.0.1 ``` However I was able to reproduce it on Google Colab (the hashes end up different): ``` - `transformers` version: 1.15.0 - `tokenizers` version: 0.10.3 - `datasets` version: 1.18.1 - `dill` version: 0.3.4 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 ``` I'll investigate why it doesn't work properly on Google Colab :)
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
106
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 Thanks for moving the issue here ! I wasn't able to reproduce the issue on my env (the hashes stay the same): ``` - `transformers` version: 1.15.0 - `tokenizers` version: 0.10.3 - `datasets` version: 1.18.1 - `dill` version: 0.3.4 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-debian-10.11 - Python version: 3.7.10 - PyArrow version: 6.0.1 ``` However I was able to reproduce it on Google Colab (the hashes end up different): ``` - `transformers` version: 1.15.0 - `tokenizers` version: 0.10.3 - `datasets` version: 1.18.1 - `dill` version: 0.3.4 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 ``` I'll investigate why it doesn't work properly on Google Colab :)
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
I found the issue: the tokenizer has something inside it that changes. Before the call, `tokenizer._tokenizer.truncation` is None, and after the call it changes to this for some reason: ``` {'max_length': 512, 'strategy': 'longest_first', 'stride': 0} ``` Does anybody know why calling the tokenizer would change its state this way ? cc @Narsil @SaulLu maybe ?
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
56
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 I found the issue: the tokenizer has something inside it that changes. Before the call, `tokenizer._tokenizer.truncation` is None, and after the call it changes to this for some reason: ``` {'max_length': 512, 'strategy': 'longest_first', 'stride': 0} ``` Does anybody know why calling the tokenizer would change its state this way ? cc @Narsil @SaulLu maybe ?
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
`tokenizer.encode(..)` does not accept argument like max_length, strategy or stride. In `tokenizers` you have to modify the tokenizer state by setting various `TruncationParams` (and/or `PaddingParams`). However, since this is modifying the state, you need to mutably borrow the tokenizer (a rust concept). The key principle is that there can ever be only 1 mutable borrow at a time during the span of the tokenizer lifecycle. Because of this, if `transformers` blindly set `TruncationParams` and `PaddingParams` on every call, it would cause the tokenizer to crash (or make the various threads accessing it hang, which is not necessarily better). In order to avoid that, we decided to handle it this way : https://github.com/huggingface/transformers/pull/12550 . Which should explain the state of the tokenizer being modified (hence its hash). Now for a temporary solution, simply encoding once with the tokenizer should give it it's proper hash (since by default the tokenizer doesn't have this state, looks at the first encoding call, and creates it). We could try and set these 2 dicts at initialization time, but it wouldn't work if a user modified the tokenizer state later ```python tokenizer = AutoTokenizer.from_pretrained(..) tokenizer.truncation_side = "left" # Now we have a difference between `tokenizer._tokenizer.truncation` and `tokenizer.truncation_side` ``` If we wanted to fix it correctly it would mean mapping every assignation to it's proper location on `tokenizer.{padding/truncation}` I think it's important to note that we cannot guarantee a tokenizer' hash remains the same if *any* of those parameters are modified through the `.map` function. Edit: Another option would be to override the default __hash__ function, but I don't know if there's a sound implementation that could fit.
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
271
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 `tokenizer.encode(..)` does not accept argument like max_length, strategy or stride. In `tokenizers` you have to modify the tokenizer state by setting various `TruncationParams` (and/or `PaddingParams`). However, since this is modifying the state, you need to mutably borrow the tokenizer (a rust concept). The key principle is that there can ever be only 1 mutable borrow at a time during the span of the tokenizer lifecycle. Because of this, if `transformers` blindly set `TruncationParams` and `PaddingParams` on every call, it would cause the tokenizer to crash (or make the various threads accessing it hang, which is not necessarily better). In order to avoid that, we decided to handle it this way : https://github.com/huggingface/transformers/pull/12550 . Which should explain the state of the tokenizer being modified (hence its hash). Now for a temporary solution, simply encoding once with the tokenizer should give it it's proper hash (since by default the tokenizer doesn't have this state, looks at the first encoding call, and creates it). We could try and set these 2 dicts at initialization time, but it wouldn't work if a user modified the tokenizer state later ```python tokenizer = AutoTokenizer.from_pretrained(..) tokenizer.truncation_side = "left" # Now we have a difference between `tokenizer._tokenizer.truncation` and `tokenizer.truncation_side` ``` If we wanted to fix it correctly it would mean mapping every assignation to it's proper location on `tokenizer.{padding/truncation}` I think it's important to note that we cannot guarantee a tokenizer' hash remains the same if *any* of those parameters are modified through the `.map` function. Edit: Another option would be to override the default __hash__ function, but I don't know if there's a sound implementation that could fit.
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
Thanks a lot for the explanation ! I think if we set these 2 dicts at initialization time it would be amazing already Shall we open an issue in `transformers` to ask for these dictionaries to be set when the tokenizer is instantiated ? > Edit: Another option would be to override the default hash function, but I don't know if there's a sound implementation that could fit. In `datasets` we can easily have custom hashing for objects of the other HF libraries if we want. For example we ignore the cache some tokenizers have. However in this specific case it touches parameters that may change the behavior of the tokenizer itself. I'm not sure the logic that determines how a tokenizer behaves should be in `datasets`
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
127
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 Thanks a lot for the explanation ! I think if we set these 2 dicts at initialization time it would be amazing already Shall we open an issue in `transformers` to ask for these dictionaries to be set when the tokenizer is instantiated ? > Edit: Another option would be to override the default hash function, but I don't know if there's a sound implementation that could fit. In `datasets` we can easily have custom hashing for objects of the other HF libraries if we want. For example we ignore the cache some tokenizers have. However in this specific case it touches parameters that may change the behavior of the tokenizer itself. I'm not sure the logic that determines how a tokenizer behaves should be in `datasets`
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
A hack we could have in the `datasets` lib would be to call the tokenizer before hashing it in order to set all its parameters correctly - but it sounds a lot like a hack and I'm not sure this can work in the long run
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
46
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 A hack we could have in the `datasets` lib would be to call the tokenizer before hashing it in order to set all its parameters correctly - but it sounds a lot like a hack and I'm not sure this can work in the long run
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
Fully agree with everything you said. I think the best course of action is creating an issue in `transformers`. I can start the work on this. I think the code changes are fairly simple. Making a sound test + not breaking other stuff might be different :D
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
47
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 Fully agree with everything you said. I think the best course of action is creating an issue in `transformers`. I can start the work on this. I think the code changes are fairly simple. Making a sound test + not breaking other stuff might be different :D
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
It should be noted that this problem also occurs in other AutoClasses, such as AutoFeatureExtractor, so I don't think handling it in Datasets is a long-term practice either.
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
28
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 It should be noted that this problem also occurs in other AutoClasses, such as AutoFeatureExtractor, so I don't think handling it in Datasets is a long-term practice either.
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
> I think the best course of action is creating an issue in `transformers`. I can start the work on this. @Narsil Hi, I reopen this issue in `transformers` https://github.com/huggingface/transformers/issues/14931
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
30
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 > I think the best course of action is creating an issue in `transformers`. I can start the work on this. @Narsil Hi, I reopen this issue in `transformers` https://github.com/huggingface/transformers/issues/14931
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
Here is @Narsil comment from https://github.com/huggingface/transformers/issues/14931#issuecomment-1074981569 > # TL;DR > Call the function once on a dummy example beforehand will fix it. > > ```python > tokenizer("Some", "test", truncation=True) > ``` > > # Long answer > If I remember the last status, it's hard doing anything, since the call itself > > ```python > tokenizer(example["sentence1"], example["sentence2"], truncation=True) > ``` > > will modify the tokenizer. It's the `truncation=True` that modifies the tokenizer to put it into truncation mode if you will. Calling the tokenizer once with that argument would fix the cache. > > Finding a fix that : > > * Doesn't imply a huge chunk of work on `tokenizers` (with potential loss of performance, and breaking backward compatibility) > * Doesn't imply `datasets` running a first pass of the loop > * Doesn't imply `datasets` looking at the map function itself > * Uses a sound `hash` for this object in `datasets`. > > is IIRC impossible for this use case. > > I can explain a bit more why the first option is not desirable. > > In order to "fix" this for tokenizers, we would need to make `tokenizer(..)` purely without side effects. This means that the "options" of tokenization (like `truncation` and `padding` at least) would have
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
981
213
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 Here is @Narsil comment from https://github.com/huggingface/transformers/issues/14931#issuecomment-1074981569 > # TL;DR > Call the function once on a dummy example beforehand will fix it. > > ```python > tokenizer("Some", "test", truncation=True) > ``` > > # Long answer > If I remember the last status, it's hard doing anything, since the call itself > > ```python > tokenizer(example["sentence1"], example["sentence2"], truncation=True) > ``` > > will modify the tokenizer. It's the `truncation=True` that modifies the tokenizer to put it into truncation mode if you will. Calling the tokenizer once with that argument would fix the cache. > > Finding a fix that : > > * Doesn't imply a huge chunk of work on `tokenizers` (with potential loss of performance, and breaking backward compatibility) > * Doesn't imply `datasets` running a first pass of the loop > * Doesn't imply `datasets` looking at the map function itself > * Uses a sound `hash` for this object in `datasets`. > > is IIRC impossible for this use case. > > I can explain a bit more why the first option is not desirable. > > In order to "fix" this for tokenizers, we would need to make `tokenizer(..)` purely without side effects. This means that the "options" of tokenization (like `truncation` and `padding` at least) would have
[ -1.1982817649841309, -0.9047369956970215, -0.7933287024497986, 1.4315873384475708, -0.11998300999403, -1.1727235317230225, 0.1259632557630539, -1.1186212301254272, 1.594604730606079, -0.7635347247123718, 0.33248451352119446, -1.7085989713668823, 0.014246449805796146, -0.5057345628738403, -0.746111273765564, -0.8181358575820923, -0.4022776782512665, -0.7961214780807495, 1.039888858795166, 2.562274694442749, 1.1498713493347168, -1.3224679231643677, 2.8532683849334717, 0.6675052046775818, -0.20587927103042603, -0.9955106973648071, 0.5840831995010376, 0.07268618047237396, -1.3052568435668945, -0.43388044834136963, -1.0159707069396973, 0.011740789748728275, -0.5487893223762512, -0.494486540555954, 0.16578972339630127, 0.3855012357234955, -0.2955683767795563, -0.43674397468566895, -0.5714272260665894, -0.7423660159111023, 0.47974395751953125, -0.3082315921783447, 0.957070529460907, -0.313864141702652, 1.7885404825210571, -0.5824100375175476, 0.4038558602333069, 0.7066004276275635, 1.3600951433181763, 0.21487392485141754, 0.029338158667087555, 0.4015706181526184, 0.3585788309574127, 0.009896847419440746, 0.45838138461112976, 1.2107115983963013, 0.5968607068061829, 0.3730422556400299, 0.7118266820907593, -2.147458791732788, 1.2784154415130615, -0.9831580519676208, 0.32846149802207947, 1.3458980321884155, -0.881202220916748, 0.3219170570373535, -1.785651445388794, -0.02744600921869278, 0.619324266910553, -2.201873302459717, 0.2709003984928131, -1.32676100730896, -0.4160996079444885, 1.0626133680343628, 0.34412506222724915, -1.2498260736465454, 0.24172110855579376, -0.5303766131401062, 1.1092027425765991, 0.4303981065750122, 1.1081143617630005, -1.6694660186767578, -0.0004308028146624565, -0.26348626613616943, 0.11367044597864151, -1.2757351398468018, -1.5623964071273804, 0.5955447554588318, 0.5225611329078674, 0.6166935563087463, -0.13187095522880554, 1.0729827880859375, -1.0677298307418823, 0.7791633605957031, -0.9484623670578003, -1.7954713106155396, -1.3830130100250244, -2.239318370819092, -2.25744891166687, 0.7523844242095947, -0.4226694107055664, -0.5754849910736084, 1.9791793823242188, -1.0373739004135132, -1.7592897415161133, 1.0854742527008057, 0.3149010241031647, -0.030567243695259094, 2.433962106704712, 0.2792533338069916, -0.730602502822876, 0.41663438081741333, -0.7610119581222534, 0.8217025399208069, -0.2693214416503906, 1.4839239120483398, 0.4543727934360504, -0.9698092341423035, 1.6036180257797241, -0.34636592864990234, 0.5109258890151978, -0.6362797617912292, -0.5093283653259277, -0.8306509256362915, 0.30459001660346985, 1.9417753219604492, -0.366384357213974, 1.5452669858932495, -0.41609764099121094, -1.5823068618774414, -1.5747770071029663, 0.7842531800270081, 0.6125636696815491, -0.8147941827774048, 0.07438334822654724, -0.5384965538978577, 0.10966820269823074, 0.013512887991964817, 1.2110928297042847, 1.2824962139129639, 0.7253557443618774, -0.2799842059612274, -0.9043906331062317, 0.19357824325561523, -0.10276820510625839, -0.7146080732345581, -1.7951650619506836, -0.3578265607357025, 0.13449010252952576, 0.7420735955238342, -1.2182215452194214, 1.6262952089309692, 0.8875040411949158, 1.929524302482605, 1.052077054977417, -0.4295216202735901, 1.5041695833206177, 0.0621015764772892, 1.8128398656845093, -0.5620278716087341, 0.6466009616851807, -0.3201766312122345, -1.1551766395568848, 0.8218735456466675, -0.3555184602737427, -2.0922696590423584, -0.8780992031097412, -0.7357869148254395, -0.16735880076885223, -0.7804776430130005, 0.9349194169044495, -0.31981736421585083, -1.544653058052063, 0.2741212844848633, -0.6988874077796936, 0.15655681490898132, -1.1645938158035278, 0.31988564133644104, 0.7161716222763062, -0.5801785588264465, 0.07000119239091873, -0.1820622682571411, -1.2857856750488281, -0.42144423723220825, 0.1941297948360443, 1.886225700378418, -0.8036800622940063, 0.9504377245903015, 1.0829823017120361, -0.6963271498680115, 0.08351720124483109, 0.31786251068115234, -0.3541497588157654, 0.9036329984664917, -1.158957600593567, -0.3660101890563965, 1.1731176376342773, -0.13140055537223816, -0.4927131235599518, 1.4525147676467896, 0.7372574210166931, -1.0695782899856567, -0.18769273161888123, -0.13532914221286774, -0.8625598549842834, -0.005650280974805355, -1.6483323574066162, -0.18877851963043213, 0.43283510208129883, -1.438446283340454, -0.48506930470466614, -0.19779887795448303, 1.2865866422653198, -0.1443547159433365, 1.4163652658462524, -0.37466850876808167, -0.14164428412914276, -0.37530872225761414, -0.443893164396286, 0.1625562310218811, -0.2537984848022461, -0.6424307823181152, 0.27915439009666443, -0.840097963809967, 0.4267895817756653, 1.42453932762146, 0.3981159031391144, -0.008066084235906601, 0.5011496543884277, 1.1234822273254395, 0.40091535449028015, -0.034867580980062485, -0.7808641791343689, -1.6709545850753784, 2.0262644290924072, -1.5100758075714111, 1.9349907636642456, 0.7518568634986877, 0.014685039408504963, -1.7811142206192017, -1.8505390882492065, 1.4040806293487549, 1.0984225273132324, 2.4283759593963623, 0.5197663307189941, 0.41615840792655945, -0.7681165933609009, -0.7607191801071167, 0.35544562339782715, -1.0000866651535034, -0.6459575295448303, 0.1572549045085907, 2.397135019302368, 1.705936074256897, -0.48201581835746765, -0.18522241711616516, -0.9949741959571838, 1.2958357334136963, -0.16500073671340942, 0.15281812846660614, 1.9710475206375122, -0.23244214057922363, -1.0973255634307861, 1.329540491104126, -2.3254239559173584, 0.16692057251930237, 2.023953437805176, 0.23963338136672974, 0.10467928647994995, -1.4165173768997192, -0.6216967701911926, -0.369803786277771, -0.3512525260448456, -1.2838025093078613, 0.5684368014335632, -0.2425244152545929, -0.9060388207435608, -1.5445905923843384, 0.04431924968957901, -1.1950868368148804, -1.590455412864685, 0.33659273386001587, 1.883423924446106, 2.0827622413635254, -0.6964359879493713, 1.5092393159866333, -0.30151012539863586, 0.16500762104988098, 1.2058446407318115, 1.2655186653137207, 3.0734667778015137, 1.7492262125015259, -1.364248514175415, 0.6945075988769531, -0.165735125541687, -0.5446670055389404, 1.1342453956604004, -1.190075397491455, 1.2532424926757812, -0.10266517847776413, -1.2093974351882935, -1.2588613033294678, 0.9698413014411926, 0.4557771384716034, 0.07820317149162292, -0.45265889167785645, 1.278540015220642, 0.0526634082198143, 1.3436481952667236, 0.5948539972305298, -0.30855682492256165, 0.5772839188575745, -0.42096227407455444, -0.48596999049186707, 1.5499484539031982, 0.1827230155467987, -1.477845549583435, -2.3539986610412598, -0.2000548541545868, -0.8118433952331543, 0.141062393784523, -0.6058892011642456, -1.065381407737732, 1.617434024810791, 0.33761879801750183, -1.2436360120773315, -0.3046000599861145, -0.37931931018829346, -0.5455253720283508, 2.6274285316467285, -1.3013099431991577, -0.16241297125816345, -0.9384192824363708, -0.5607547760009766, 1.5618937015533447, -1.1406919956207275, -0.19875645637512207, -1.058333396911621, -0.5823904275894165, -1.2811228036880493, -0.6202656030654907, 0.044057272374629974, -0.9303394556045532, 0.7368638515472412, 0.12861213088035583, -1.1297587156295776, -0.2546864449977875, -0.923412024974823, 0.9884332418441772, -0.15244081616401672, 0.1846865564584732, 1.812056064605713, 0.4089460074901581, -0.3904104232788086, 0.7788304090499878, 1.2127201557159424, 0.591338038444519, -0.5769734978675842, 0.08140700310468674, -0.6980384588241577, 0.27522191405296326, -1.4210811853408813, 0.28902947902679443, -2.834326982498169, 0.6837565302848816, -0.08179906010627747, -0.022960636764764786, 0.004324239678680897, -1.3182791471481323, 1.1057897806167603, 2.5915369987487793, -1.1951230764389038, 0.4887232780456543, 0.3089340031147003, 1.1532859802246094, -1.5051522254943848, 0.2722896933555603, -0.5005027055740356, 2.054628610610962, 0.23472148180007935, 1.19940185546875, -0.5266088247299194, -2.1667890548706055, 0.7102254033088684, -1.3492968082427979, -1.0840191841125488, 0.7980073690414429, -0.9370711445808411, 0.1767716109752655, -1.3867226839065552, -0.29067978262901306, -0.9704976081848145, -1.1701761484146118, 0.6166972517967224, 0.1274138242006302, 0.40365278720855713, -0.45634597539901733, 0.3950246572494507, -2.230276346206665, -1.3788352012634277, -0.1648586392402649, -1.069966197013855, 0.541318953037262, -0.36730992794036865, 0.6568964719772339, -0.16437186300754547, 0.046903785318136215, 0.4020756483078003, 1.3724946975708008, 3.338888168334961, 0.21138474345207214, 0.340628981590271, -0.1658836007118225, -1.0141128301620483, 1.4054827690124512, 0.9244742393493652, -0.12797223031520844, -0.6306277513504028, -1.0186647176742554, 1.245030164718628, 1.9509758949279785, 1.0441745519638062, -0.014778433367609978, -0.9080354571342468, -0.7546204328536987, 0.04553467780351639, 0.17123369872570038, 0.48981931805610657, 0.911567211151123, 0.021384913474321365, 0.11486190557479858, 1.5153156518936157, 1.182947039604187, -0.4504527151584625, 0.33881163597106934, -0.8311810493469238, -0.4811030924320221, 0.5145251750946045, 0.23234644532203674, 0.02519669011235237, 0.3968815207481384, -1.0339871644973755, -0.19752450287342072, -0.353299081325531, -0.9724672436714172, -0.7447720766067505, -0.3962133526802063, -0.37123632431030273, 1.600258708000183, 0.14746424555778503, -0.46776455640792847, -0.03836750611662865, -0.788948655128479, -0.12285163253545761, -1.0838574171066284, 0.31093931198120117, -0.08975362777709961, -0.1298973709344864, -0.1512528657913208, 1.699498176574707, -0.963773787021637, -2.0858280658721924, 0.15222036838531494, 0.25221121311187744, -0.36128461360931396, 0.21657735109329224, 1.6877080202102661, 0.6570039391517639, 1.4429055452346802, 1.3210270404815674, 0.8666589856147766, -0.6333866119384766, -1.2278262376785278, 0.6471185088157654, 0.9729359149932861, -1.3684251308441162, 0.7941232919692993, -0.06208377331495285, -0.5112181305885315, 0.6505822539329529, 1.4217113256454468, 0.5155015587806702, -1.9439617395401, 0.7966852188110352, -0.9089680910110474, 0.7201257348060608, 0.7116131782531738, 0.7016713619232178, 0.2217528373003006, 0.8076285719871521, -1.2277183532714844, -1.1375020742416382, -0.7557711601257324, -0.639830470085144, 1.9618743658065796, -0.274212509393692, 0.5136808156967163, -0.23714137077331543, -1.240346074104309, -0.15217669308185577, 0.6820526123046875, 0.3128288984298706, -0.49328136444091797, 0.8230851292610168, -0.575444757938385, -1.1027919054031372, -1.3201868534088135, -0.4364177882671356, -1.0353535413742065, -0.9393640160560608, 1.0130608081817627, 0.7325054407119751, 0.37851887941360474, 1.8318188190460205, 0.5853331089019775, 0.2627843916416168, -2.694058895111084, 0.8699649572372437, 0.24793966114521027, -0.0628715455532074, 0.950735330581665, 0.2904186546802521, 1.135295033454895, -0.0513312853872776, 0.5754745006561279, -2.3550305366516113, 2.1698720455169678, -0.19905957579612732, 0.7240192890167236, -0.028996501117944717, -0.15986938774585724, 1.162274956703186, 0.6069849729537964, 0.5274386405944824, -1.07477605342865, 0.6950055360794067, -0.6616713404655457, 1.1950913667678833, 0.8756245374679565, -0.8542827367782593, 0.0010824818164110184, 1.3898013830184937, 0.4069608747959137, -0.4073185920715332, -0.962321400642395, -0.8651888966560364, 0.9852925539016724, 1.7010793685913086, -0.07823076099157333, 0.0648680105805397, 0.7723918557167053, 0.6352781653404236, -1.3694462776184082, 0.0424405038356781, -0.6356649398803711, -0.7360727787017822, 1.712005376815796, 2.1187665462493896, -0.11343390494585037, -0.19930294156074524, -0.6782185435295105, -1.2034680843353271, 0.7381569743156433, -0.07452960312366486, 0.2153218388557434, 0.5930176973342896, -0.6502924561500549, 1.181898593902588, 0.7597315311431885, 0.8973245024681091, 0.10159961134195328, 0.32652583718299866, 0.32664716243743896, -0.31152814626693726, -1.1955574750900269, -0.34217771887779236, -1.0571140050888062, -2.536240577697754, 0.44863787293434143, -0.26925036311149597, -1.4512604475021362, 0.11371338367462158, -0.9703162908554077, 0.8879915475845337, -0.593823254108429, -1.1122691631317139, -1.5491886138916016, 0.25846001505851746, -0.050018854439258575, 0.9918091297149658, -1.6590465307235718, -0.11103446781635284, 1.1972945928573608, 0.9180601835250854, -0.6051315665245056, 1.0283892154693604, 0.3351256251335144, 0.9841787219047546, 0.8308343887329102, -0.3280104100704193, 0.5780746936798096, 0.050981663167476654, -1.3109134435653687, 0.43036356568336487, 1.2261306047439575, 0.24067722260951996, 1.5099066495895386, -0.4884095788002014, 0.05104401335120201, 0.4180942177772522, -0.5384736657142639, -0.49219024181365967, -0.40362033247947693, 0.6173397898674011, 0.24340711534023285, -0.8923569917678833, -0.09176377207040787, -0.038603927940130234, -0.20947356522083282, 0.22216641902923584, -1.537387490272522, -0.2656627893447876, -0.44065627455711365, -0.5972133278846741, -1.2012172937393188, -0.08715193718671799, 1.4435384273529053, -0.812688410282135, -0.20263855159282684, 0.39132362604141235, 0.36307865381240845, 0.5318127274513245, 0.6384279131889343, -0.6976729035377502, -0.37802737951278687, -0.3156023323535919, -0.3621286451816559, 0.23267142474651337, 1.2517061233520508, -0.08877696841955185, -0.9633577466011047, 0.6635168790817261, -0.3938320279121399, 0.07877340912818909, 1.8743706941604614, -0.004761611111462116, -0.8019535541534424, 0.32148081064224243, -0.7342705130577087, 1.9485142230987549, 1.7413948774337769, 1.3587819337844849, -0.16596470773220062, -0.9501656889915466, 0.6242470145225525, -0.24953092634677887, -0.3211469352245331, 0.9570498466491699, 0.435709148645401, -0.15680839121341705, -1.4366676807403564, 0.6293838620185852, 1.2996073961257935, -0.9831467270851135, -0.7420610189437866, 0.10835575312376022, -0.874069094657898, 1.1356085538864136, 0.6827700138092041, 0.29563388228416443, 0.30614611506462097, 1.5996346473693848, 0.7210145592689514, -0.4679948687553406, 0.6045708060264587, 0.4347539246082306, -0.2069154530763626, -2.1456847190856934, -1.0363712310791016, 0.3555790185928345, -0.430397629737854, -1.5966227054595947, 1.3711113929748535, -1.101410150527954, -0.9309136867523193, 0.5714147686958313, 0.0957941934466362, 1.3883755207061768, 0.3695679008960724, 1.6691644191741943, 2.1196744441986084, 0.8735047578811646, 0.2808535695075989, 1.2695980072021484, -0.1113753691315651, -0.4270431101322174, 1.761772632598877, -0.4597422182559967, 0.5102913975715637, 1.0099033117294312, -0.34347859025001526, -1.0153098106384277, -0.7830020189285278, -1.2529278993606567, -0.76190185546875, 1.0964967012405396, 0.16831794381141663, -1.2203125953674316, 0.23555856943130493, 1.6056466102600098, 0.10314593464136124, -0.22344611585140228, 0.7238013744354248, 0.5141719579696655, -0.7396279573440552, -0.08314856886863708, -0.8947615027427673, 0.46694350242614746, -0.14956094324588776, -0.36432692408561707, 0.2501950263977051, 0.5151203274726868, 1.313313603401184, -0.039960481226444244, 0.08384998887777328, 1.1774964332580566, -1.5000555515289307, 1.4871798753738403, -0.663555383682251, 0.3320161700248718, -2.423153877258301, 1.4180039167404175, -0.7952693104743958, 1.8723363876342773, -2.562171459197998, 0.4779389202594757, -0.6658279895782471, -0.4654141366481781, 0.21947269141674042, -0.3494461476802826, 0.1674027144908905, -0.12564556300640106, -1.0749534368515015, -0.11074750870466232, -0.6871910691261292, 0.6145269870758057, 1.1410077810287476, 1.2684557437896729, -1.0983107089996338, -0.2875566780567169, -1.7771508693695068, -0.13978157937526703, -0.6420726180076599, 0.2292667031288147, -2.016201972961426, -0.19532394409179688, -1.956432580947876, -2.403142213821411, -1.4094643592834473, -0.7958414554595947, 1.152722954750061, 0.13006474077701569, -0.935949981212616, 1.178426742553711, -0.41730940341949463, -1.7965236902236938, 1.1111114025115967, -2.205307960510254 ]
https://github.com/huggingface/datasets/issues/3637
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18
Hi @lewtun! This one was tricky to debug. Initially, I tought there is a bug in the recently-added (by @lhoestq ) `cast_array_to_feature` function because `git bisect` points to the https://github.com/huggingface/datasets/commit/6ca96c707502e0689f9b58d94f46d871fa5a3c9c commit. Then, I noticed that the feature tpye of the `dialogue` field is `list`, which explains why you didn't get an error in earlier versions. Is there a specific reason why you use `list` instead of `Sequence` in the script? Maybe to avoid turning list of dicts to dicts of lists as it's done by `Sequence` for compatibility with TFDS or for performance reasons? If the field was `Sequence`, you would get an error in `encode_nested_example` because **the scripts yields some additional (nested) columns which are not specified in the `features` dictionary**. Previously, these additional columns would've been ignored by PyArrow (1), but now we have a check for them (2). (1) See PyArrow behavior: ``` >>> pa.array([{"a": 2, "b": 3}], type=pa.struct({"a": pa.int32()})) # pyarrow ignores the extra column -- is_valid: all not null -- child 0 type: int32 [ 2 ] ``` (2) Check: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/table.py#L1059 The fix is very simple: just add the missing columns to the _EMPTY_BELIEF_STATE list: ```python _EMPTY_BELIEF_STATE.extend(['通用-产品类别', '火车-舱位档次', '通用-系列', '通用-价格区间', '通用-品牌']) ```
## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0
982
197
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18 ## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0 Hi @lewtun! This one was tricky to debug. Initially, I tought there is a bug in the recently-added (by @lhoestq ) `cast_array_to_feature` function because `git bisect` points to the https://github.com/huggingface/datasets/commit/6ca96c707502e0689f9b58d94f46d871fa5a3c9c commit. Then, I noticed that the feature tpye of the `dialogue` field is `list`, which explains why you didn't get an error in earlier versions. Is there a specific reason why you use `list` instead of `Sequence` in the script? Maybe to avoid turning list of dicts to dicts of lists as it's done by `Sequence` for compatibility with TFDS or for performance reasons? If the field was `Sequence`, you would get an error in `encode_nested_example` because **the scripts yields some additional (nested) columns which are not specified in the `features` dictionary**. Previously, these additional columns would've been ignored by PyArrow (1), but now we have a check for them (2). (1) See PyArrow behavior: ``` >>> pa.array([{"a": 2, "b": 3}], type=pa.struct({"a": pa.int32()})) # pyarrow ignores the extra column -- is_valid: all not null -- child 0 type: int32 [ 2 ] ``` (2) Check: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/table.py#L1059 The fix is very simple: just add the missing columns to the _EMPTY_BELIEF_STATE list: ```python _EMPTY_BELIEF_STATE.extend(['通用-产品类别', '火车-舱位档次', '通用-系列', '通用-价格区间', '通用-品牌']) ```
[ -1.119612693786621, -0.7998745441436768, -0.6116821765899658, 1.3577075004577637, 0.050743404775857925, -1.4359827041625977, 0.13755398988723755, -0.876522421836853, 1.6176228523254395, -0.808984637260437, 0.34142786264419556, -1.759246826171875, -0.017837852239608765, -0.5892559885978699, -0.6911984086036682, -0.7316567301750183, -0.3103090524673462, -0.7355347275733948, 1.0836652517318726, 2.4761643409729004, 1.2086782455444336, -1.2797062397003174, 2.8229124546051025, 0.5709953904151917, -0.2829189896583557, -0.8498000502586365, 0.4273245334625244, -0.025058943778276443, -1.426507592201233, -0.2457330822944641, -0.979324221611023, -0.05479567497968674, -0.6450890898704529, -0.5338867902755737, 0.15625113248825073, 0.5145761966705322, -0.14601249992847443, -0.3748859763145447, -0.41920530796051025, -0.7390908002853394, 0.5777602195739746, -0.25486230850219727, 0.8970232009887695, -0.3141157627105713, 1.7584664821624756, -0.6439350843429565, 0.4730257987976074, 0.5801748633384705, 1.2777273654937744, 0.21179983019828796, -0.042523205280303955, 0.38918542861938477, 0.2076684832572937, 0.07493970543146133, 0.5940607786178589, 1.2711210250854492, 0.5803079009056091, 0.5318754315376282, 0.7299256920814514, -2.196223497390747, 1.4101659059524536, -0.7317008376121521, 0.25966310501098633, 1.3172829151153564, -1.044732689857483, 0.443572461605072, -1.865087866783142, -0.18595251441001892, 0.38373124599456787, -2.3192310333251953, 0.0474226176738739, -1.30625319480896, -0.5620532631874084, 0.9538967609405518, 0.390342652797699, -1.2468212842941284, 0.0013336027041077614, -0.3922343850135803, 0.9623681902885437, 0.4595646858215332, 1.2114605903625488, -1.6485048532485962, 0.05268295109272003, -0.199926495552063, 0.37630122900009155, -1.189096212387085, -1.6890515089035034, 0.5943613648414612, 0.7753700613975525, 0.670306384563446, -0.17349517345428467, 0.7936232686042786, -1.0536009073257446, 0.8381703495979309, -0.8909687399864197, -1.8659862279891968, -1.3040815591812134, -2.3887598514556885, -2.4135775566101074, 0.802474319934845, -0.44554591178894043, -0.36523669958114624, 2.145801544189453, -1.126902461051941, -1.7858461141586304, 0.9752016663551331, 0.26382148265838623, -0.08937223255634308, 2.3905930519104004, 0.2317325919866562, -0.8920384049415588, 0.6567294597625732, -0.835502564907074, 0.6978958249092102, -0.3457126021385193, 1.271892786026001, 0.4428752660751343, -1.0470685958862305, 1.6073377132415771, -0.47498196363449097, 0.45754891633987427, -0.7968437671661377, -0.380523681640625, -0.5883035063743591, 0.1990339756011963, 1.9204295873641968, -0.18293912708759308, 1.5648789405822754, -0.1771640032529831, -1.5329855680465698, -1.419334053993225, 0.6409233212471008, 0.511070728302002, -0.8315302133560181, 0.20550572872161865, -0.423764169216156, 0.11501666903495789, 0.2588154077529907, 1.1363389492034912, 1.2631319761276245, 0.8184175491333008, -0.1449815183877945, -0.8537033200263977, 0.14530646800994873, -0.047281812876462936, -0.5539096593856812, -1.7793304920196533, -0.26767826080322266, 0.19479145109653473, 0.6433777213096619, -1.1806881427764893, 1.9212442636489868, 0.8450674414634705, 2.0691168308258057, 1.011534571647644, -0.35163480043411255, 1.559617519378662, 0.058200523257255554, 1.95903742313385, -0.26726996898651123, 0.6355524659156799, -0.5372718572616577, -1.1851940155029297, 0.6636114120483398, -0.39501678943634033, -1.9712419509887695, -0.43572866916656494, -0.9084848761558533, -0.08571698516607285, -0.8853223919868469, 1.0004886388778687, -0.19106678664684296, -1.4041653871536255, 0.16553756594657898, -0.6922587752342224, 0.09646189212799072, -1.415770411491394, 0.21261946856975555, 0.7603151798248291, -0.758435070514679, 0.05565764009952545, -0.4859585165977478, -1.4342120885849, -0.5883336067199707, 0.47023946046829224, 1.834052324295044, -0.6187215447425842, 1.0081350803375244, 0.9806607365608215, -0.5800778269767761, -0.0205399040132761, 0.4618062376976013, -0.36061954498291016, 0.8371902704238892, -1.015712022781372, -0.37133342027664185, 1.0635143518447876, -0.2355886548757553, -0.5456058382987976, 1.338151216506958, 0.7552140355110168, -1.0400891304016113, -0.28770989179611206, -0.11580777168273926, -0.8428633213043213, 0.038519639521837234, -1.6853548288345337, -0.10931016504764557, 0.24126924574375153, -1.4571247100830078, -0.4939950108528137, -0.05970833823084831, 1.2659093141555786, 0.0006748558953404427, 1.359289526939392, -0.21134743094444275, -0.08477456122636795, -0.5597373247146606, -0.602897047996521, 0.132068932056427, -0.16976170241832733, -0.6361870169639587, 0.32542723417282104, -0.7288950085639954, 0.13461723923683167, 1.4678130149841309, 0.23815126717090607, 0.1888279765844345, 0.5161290168762207, 1.1954594850540161, 0.3123498558998108, -0.21036450564861298, -0.8146694898605347, -1.7335072755813599, 2.071624517440796, -1.551440715789795, 1.8983094692230225, 0.7998167276382446, -0.022029321640729904, -1.859951376914978, -1.8680002689361572, 1.4765774011611938, 1.1173120737075806, 2.492229700088501, 0.5548480749130249, 0.40577542781829834, -0.7626863718032837, -0.6621938347816467, 0.46223556995391846, -0.7214275002479553, -0.9060555696487427, 0.14085105061531067, 2.3165245056152344, 1.7345789670944214, -0.4417719841003418, -0.19271281361579895, -0.9375565052032471, 1.262038230895996, -0.29372525215148926, 0.25354456901550293, 1.9168552160263062, -0.3982049822807312, -1.0190922021865845, 1.339911937713623, -2.348566770553589, 0.28986889123916626, 1.9899355173110962, 0.19151830673217773, 0.044448718428611755, -1.2205075025558472, -0.6833729147911072, -0.16544651985168457, -0.4215649962425232, -1.2520346641540527, 0.39194953441619873, -0.22689397633075714, -0.878262460231781, -1.4213306903839111, -0.004877625964581966, -1.1716142892837524, -1.7365578413009644, 0.25420576333999634, 1.8068935871124268, 2.1381163597106934, -0.7728328108787537, 1.3075892925262451, -0.32603728771209717, 0.2261461317539215, 1.1600760221481323, 1.2050968408584595, 3.2276816368103027, 1.92926025390625, -1.2556031942367554, 0.7965556383132935, -0.17707611620426178, -0.4913681745529175, 1.241777777671814, -1.0068689584732056, 1.0982232093811035, -0.3209373950958252, -1.4596340656280518, -1.144465684890747, 0.9917930960655212, 0.4058082103729248, -0.08810915052890778, -0.496335506439209, 1.1961954832077026, 0.1611473560333252, 1.338577389717102, 0.6223247647285461, -0.30050128698349, 0.49827009439468384, -0.3498308062553406, -0.5742332935333252, 1.5902163982391357, 0.09471748024225235, -1.57475745677948, -2.3421523571014404, -0.14593227207660675, -1.0322730541229248, -0.029893938452005386, -0.8867084980010986, -1.006983995437622, 1.5383116006851196, 0.49987107515335083, -0.9225417971611023, -0.17774981260299683, -0.431973934173584, -0.5515721440315247, 2.5889029502868652, -1.3962551355361938, -0.24638882279396057, -0.971834123134613, -0.5538017153739929, 1.5350608825683594, -1.2121676206588745, -0.19492711126804352, -1.0291566848754883, -0.5403655171394348, -1.25620436668396, -0.39817196130752563, -0.07845989614725113, -0.7918838262557983, 0.6544962525367737, -0.019697384908795357, -1.2596689462661743, -0.22769701480865479, -1.1334638595581055, 0.9021468162536621, -0.2605598568916321, 0.06468406319618225, 1.798713207244873, 0.3021313548088074, -0.4981348514556885, 0.7675408720970154, 1.224614143371582, 0.6015278100967407, -0.5442714691162109, 0.17253339290618896, -0.6270760297775269, 0.49163705110549927, -1.3075816631317139, 0.3121066689491272, -2.91960072517395, 0.7094182372093201, 0.0006736684590578079, -0.05091461166739464, -0.1264019012451172, -1.4099401235580444, 0.9417678713798523, 2.4503092765808105, -1.1701202392578125, 0.5972591638565063, 0.30168431997299194, 1.2482932806015015, -1.5840792655944824, 0.03424539044499397, -0.6404653787612915, 2.0732998847961426, 0.02873857691884041, 1.0666922330856323, -0.5150413513183594, -2.2727713584899902, 0.5435158610343933, -1.199947714805603, -0.8611487150192261, 0.8605102896690369, -0.8508410453796387, 0.2154218554496765, -1.145628809928894, -0.031820546835660934, -0.8631377816200256, -1.0889166593551636, 0.6361963152885437, 0.010912595316767693, 0.6705073714256287, -0.6373783946037292, 0.31339186429977417, -2.259322166442871, -1.3543840646743774, -0.16112318634986877, -0.9446152448654175, 0.509792149066925, -0.34517163038253784, 0.6800792217254639, -0.09977160394191742, 0.0630718544125557, 0.2454591542482376, 1.4225273132324219, 3.2189037799835205, -0.00001485925167798996, 0.29055696725845337, -0.217911958694458, -1.1092785596847534, 1.4887304306030273, 0.8735137581825256, -0.28096532821655273, -0.5946307182312012, -0.9274188876152039, 1.3636548519134521, 1.937703013420105, 1.136893630027771, 0.1775016188621521, -0.9504683613777161, -0.8678733110427856, 0.2273586243391037, 0.18778754770755768, 0.5286253690719604, 0.9536038637161255, 0.08545749634504318, 0.21577629446983337, 1.3877471685409546, 1.0823705196380615, -0.31362760066986084, 0.612708568572998, -0.9541574120521545, -0.3983624577522278, 0.4813767671585083, 0.37013787031173706, 0.00557960569858551, 0.3068811297416687, -1.0588836669921875, -0.20292039215564728, -0.23573839664459229, -0.8350136280059814, -0.7271630167961121, -0.33326536417007446, -0.45103275775909424, 1.7159967422485352, -0.10222291946411133, -0.45858222246170044, 0.070691779255867, -0.738508403301239, -0.09033962339162827, -0.9749050140380859, 0.30179286003112793, -0.1228434294462204, 0.09332659840583801, -0.13366982340812683, 1.6532974243164062, -0.9416487216949463, -2.2009127140045166, 0.23136454820632935, 0.20509587228298187, -0.4248581528663635, -0.05806789919734001, 1.8047105073928833, 0.5763020515441895, 1.3700213432312012, 1.6025999784469604, 1.103058099746704, -0.5758250951766968, -1.3001466989517212, 0.6996467113494873, 0.8552044034004211, -1.3009766340255737, 0.9795910120010376, -0.2113885134458542, -0.5584648847579956, 0.5485947132110596, 1.2941936254501343, 0.418792188167572, -1.979844570159912, 0.9245808720588684, -1.038778305053711, 0.9081931710243225, 0.8050394654273987, 0.8616791367530823, 0.13224954903125763, 0.8901932239532471, -1.2986984252929688, -1.0819549560546875, -0.6229140162467957, -0.6206711530685425, 1.808860182762146, -0.17995217442512512, 0.32770800590515137, -0.2730444669723511, -1.32528817653656, 0.06319980323314667, 0.6952558755874634, 0.3219570517539978, -0.3554050326347351, 0.8009045124053955, -0.6379557251930237, -1.0596200227737427, -1.3133093118667603, -0.5038952827453613, -1.0294544696807861, -0.832511305809021, 0.9616255760192871, 0.7738403081893921, 0.552367091178894, 1.9589869976043701, 0.6032726168632507, 0.2158871442079544, -2.6199071407318115, 0.8225910663604736, 0.3662470579147339, -0.059635672718286514, 0.8449527025222778, 0.2785816192626953, 1.2683334350585938, -0.18088959157466888, 0.5874233841896057, -2.2921242713928223, 2.1690261363983154, -0.22495795786380768, 0.761279284954071, 0.09445998072624207, -0.017997298389673233, 0.9174206256866455, 0.5475717186927795, 0.5821606516838074, -1.1368697881698608, 0.9111485481262207, -0.7391820549964905, 1.1241531372070312, 0.8604467511177063, -0.9205640554428101, 0.11943770945072174, 1.2398340702056885, 0.36033785343170166, -0.534640908241272, -1.000387191772461, -0.8567456007003784, 0.9220495223999023, 1.713695764541626, 0.04039255902171135, 0.11661936342716217, 0.8011965751647949, 0.7600537538528442, -1.2808912992477417, -0.0118602579459548, -0.6313025951385498, -0.667926549911499, 1.790512204170227, 2.013495922088623, -0.05750730261206627, -0.045367736369371414, -0.7324133515357971, -1.3751955032348633, 0.8291164636611938, 0.13959719240665436, -0.09277848899364471, 0.876620888710022, -0.685476541519165, 1.2745670080184937, 0.7209948897361755, 0.8708990812301636, 0.24002332985401154, 0.07112381607294083, 0.22846367955207825, -0.2700314521789551, -1.2207729816436768, -0.34530961513519287, -0.9963302612304688, -2.5466647148132324, 0.3920894265174866, -0.2923585772514343, -1.5319087505340576, 0.1914130449295044, -0.9806758165359497, 0.7317236661911011, -0.5747666358947754, -1.1545330286026, -1.3148747682571411, 0.3282393217086792, -0.21618427336215973, 0.7912532091140747, -1.6331455707550049, -0.1371871531009674, 1.1642582416534424, 0.9580935835838318, -0.6333773136138916, 0.8563666343688965, 0.3320441246032715, 0.9113264083862305, 0.9988066554069519, -0.4057621955871582, 0.3992491364479065, 0.24882198870182037, -1.3048334121704102, 0.3393615484237671, 1.330315113067627, 0.13737647235393524, 1.2659516334533691, -0.45069271326065063, -0.03491874039173126, 0.4296345114707947, -0.28913259506225586, -0.5146400332450867, -0.7486792802810669, 0.6796937584877014, -0.13342063128948212, -0.9989706873893738, -0.11885946989059448, 0.04887685924768448, -0.11897716671228409, 0.37906694412231445, -1.5410125255584717, -0.10391178727149963, -0.3671260476112366, -0.6159200072288513, -1.4692177772521973, -0.07747774571180344, 1.2890185117721558, -0.9024573564529419, -0.11171962320804596, 0.5639620423316956, 0.227944016456604, 0.5179268717765808, 0.6201545000076294, -0.7708943486213684, -0.22981470823287964, -0.22069118916988373, -0.4250307083129883, 0.30170130729675293, 1.2651128768920898, -0.12134572863578796, -0.9807888269424438, 0.5094994902610779, -0.248505637049675, 0.21310950815677643, 1.9541267156600952, 0.0426827147603035, -0.903765857219696, 0.3250196576118469, -0.7246149182319641, 1.8388921022415161, 1.6954482793807983, 1.3649290800094604, -0.06351137906312943, -1.0126831531524658, 0.5139392018318176, -0.2561618685722351, -0.31311899423599243, 0.9021921753883362, 0.4061295986175537, -0.2568599581718445, -1.3517625331878662, 0.6733543872833252, 1.244443416595459, -0.7478359937667847, -0.790195882320404, 0.055280208587646484, -0.8513990044593811, 1.2613401412963867, 0.7231612205505371, 0.32136625051498413, 0.251356303691864, 1.603773832321167, 0.6842034459114075, -0.5551558136940002, 0.4866151809692383, 0.43085741996765137, -0.163336381316185, -1.994253158569336, -1.0186288356781006, 0.22747009992599487, -0.3520575165748596, -1.5342377424240112, 1.413391351699829, -1.2679544687271118, -0.9721493124961853, 0.4997873306274414, 0.1295795887708664, 1.3151836395263672, 0.260089635848999, 1.74989914894104, 2.047804832458496, 0.9825809001922607, 0.4371896982192993, 1.1690624952316284, -0.1960819810628891, -0.24053485691547394, 1.6105989217758179, -0.4852268695831299, 0.6477347016334534, 0.9746306538581848, -0.4716033935546875, -1.196473240852356, -0.8553757071495056, -1.1388676166534424, -0.7862529754638672, 1.0621124505996704, 0.1898522973060608, -1.149884819984436, 0.3044811487197876, 1.617238998413086, 0.053890831768512726, -0.1335015743970871, 0.7164933681488037, 0.39506179094314575, -0.6479167342185974, -0.08402308821678162, -1.0317535400390625, 0.5900484323501587, -0.2807777523994446, -0.36378318071365356, 0.19082897901535034, 0.539252519607544, 1.196293830871582, 0.18305455148220062, 0.14696119725704193, 1.4136749505996704, -1.3436400890350342, 1.2438193559646606, -0.9229470491409302, 0.3805428743362427, -2.3365025520324707, 1.5273871421813965, -0.9386296272277832, 1.893409252166748, -2.6830320358276367, 0.5512139797210693, -0.45212405920028687, -0.5854523181915283, 0.15021400153636932, -0.22309891879558563, 0.07485535740852356, -0.028467023745179176, -1.0142229795455933, -0.1825016289949417, -0.9272513389587402, 0.4517614245414734, 1.208055019378662, 1.3745726346969604, -0.9028977155685425, -0.3034746050834656, -1.6826531887054443, -0.13940879702568054, -0.5172159075737, 0.21712414920330048, -1.7770774364471436, -0.1603246033191681, -2.091036558151245, -2.5095455646514893, -1.422497272491455, -0.9882639050483704, 1.2877840995788574, 0.15297673642635345, -0.8971368074417114, 1.047493577003479, -0.4075697064399719, -1.795865774154663, 1.2273149490356445, -2.2751903533935547 ]
https://github.com/huggingface/datasets/issues/3637
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18
Hey @mariosasko, thank you so much for figuring this one out - it certainly looks like a tricky bug 😱 ! I don't think there's a specific reason to use `list` instead of `Sequence` with the script, but I'll let the dataset creators know to see if your suggestion is acceptable. Thank you again!
## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0
982
54
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18 ## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0 Hey @mariosasko, thank you so much for figuring this one out - it certainly looks like a tricky bug 😱 ! I don't think there's a specific reason to use `list` instead of `Sequence` with the script, but I'll let the dataset creators know to see if your suggestion is acceptable. Thank you again!
[ -1.119612693786621, -0.7998745441436768, -0.6116821765899658, 1.3577075004577637, 0.050743404775857925, -1.4359827041625977, 0.13755398988723755, -0.876522421836853, 1.6176228523254395, -0.808984637260437, 0.34142786264419556, -1.759246826171875, -0.017837852239608765, -0.5892559885978699, -0.6911984086036682, -0.7316567301750183, -0.3103090524673462, -0.7355347275733948, 1.0836652517318726, 2.4761643409729004, 1.2086782455444336, -1.2797062397003174, 2.8229124546051025, 0.5709953904151917, -0.2829189896583557, -0.8498000502586365, 0.4273245334625244, -0.025058943778276443, -1.426507592201233, -0.2457330822944641, -0.979324221611023, -0.05479567497968674, -0.6450890898704529, -0.5338867902755737, 0.15625113248825073, 0.5145761966705322, -0.14601249992847443, -0.3748859763145447, -0.41920530796051025, -0.7390908002853394, 0.5777602195739746, -0.25486230850219727, 0.8970232009887695, -0.3141157627105713, 1.7584664821624756, -0.6439350843429565, 0.4730257987976074, 0.5801748633384705, 1.2777273654937744, 0.21179983019828796, -0.042523205280303955, 0.38918542861938477, 0.2076684832572937, 0.07493970543146133, 0.5940607786178589, 1.2711210250854492, 0.5803079009056091, 0.5318754315376282, 0.7299256920814514, -2.196223497390747, 1.4101659059524536, -0.7317008376121521, 0.25966310501098633, 1.3172829151153564, -1.044732689857483, 0.443572461605072, -1.865087866783142, -0.18595251441001892, 0.38373124599456787, -2.3192310333251953, 0.0474226176738739, -1.30625319480896, -0.5620532631874084, 0.9538967609405518, 0.390342652797699, -1.2468212842941284, 0.0013336027041077614, -0.3922343850135803, 0.9623681902885437, 0.4595646858215332, 1.2114605903625488, -1.6485048532485962, 0.05268295109272003, -0.199926495552063, 0.37630122900009155, -1.189096212387085, -1.6890515089035034, 0.5943613648414612, 0.7753700613975525, 0.670306384563446, -0.17349517345428467, 0.7936232686042786, -1.0536009073257446, 0.8381703495979309, -0.8909687399864197, -1.8659862279891968, -1.3040815591812134, -2.3887598514556885, -2.4135775566101074, 0.802474319934845, -0.44554591178894043, -0.36523669958114624, 2.145801544189453, -1.126902461051941, -1.7858461141586304, 0.9752016663551331, 0.26382148265838623, -0.08937223255634308, 2.3905930519104004, 0.2317325919866562, -0.8920384049415588, 0.6567294597625732, -0.835502564907074, 0.6978958249092102, -0.3457126021385193, 1.271892786026001, 0.4428752660751343, -1.0470685958862305, 1.6073377132415771, -0.47498196363449097, 0.45754891633987427, -0.7968437671661377, -0.380523681640625, -0.5883035063743591, 0.1990339756011963, 1.9204295873641968, -0.18293912708759308, 1.5648789405822754, -0.1771640032529831, -1.5329855680465698, -1.419334053993225, 0.6409233212471008, 0.511070728302002, -0.8315302133560181, 0.20550572872161865, -0.423764169216156, 0.11501666903495789, 0.2588154077529907, 1.1363389492034912, 1.2631319761276245, 0.8184175491333008, -0.1449815183877945, -0.8537033200263977, 0.14530646800994873, -0.047281812876462936, -0.5539096593856812, -1.7793304920196533, -0.26767826080322266, 0.19479145109653473, 0.6433777213096619, -1.1806881427764893, 1.9212442636489868, 0.8450674414634705, 2.0691168308258057, 1.011534571647644, -0.35163480043411255, 1.559617519378662, 0.058200523257255554, 1.95903742313385, -0.26726996898651123, 0.6355524659156799, -0.5372718572616577, -1.1851940155029297, 0.6636114120483398, -0.39501678943634033, -1.9712419509887695, -0.43572866916656494, -0.9084848761558533, -0.08571698516607285, -0.8853223919868469, 1.0004886388778687, -0.19106678664684296, -1.4041653871536255, 0.16553756594657898, -0.6922587752342224, 0.09646189212799072, -1.415770411491394, 0.21261946856975555, 0.7603151798248291, -0.758435070514679, 0.05565764009952545, -0.4859585165977478, -1.4342120885849, -0.5883336067199707, 0.47023946046829224, 1.834052324295044, -0.6187215447425842, 1.0081350803375244, 0.9806607365608215, -0.5800778269767761, -0.0205399040132761, 0.4618062376976013, -0.36061954498291016, 0.8371902704238892, -1.015712022781372, -0.37133342027664185, 1.0635143518447876, -0.2355886548757553, -0.5456058382987976, 1.338151216506958, 0.7552140355110168, -1.0400891304016113, -0.28770989179611206, -0.11580777168273926, -0.8428633213043213, 0.038519639521837234, -1.6853548288345337, -0.10931016504764557, 0.24126924574375153, -1.4571247100830078, -0.4939950108528137, -0.05970833823084831, 1.2659093141555786, 0.0006748558953404427, 1.359289526939392, -0.21134743094444275, -0.08477456122636795, -0.5597373247146606, -0.602897047996521, 0.132068932056427, -0.16976170241832733, -0.6361870169639587, 0.32542723417282104, -0.7288950085639954, 0.13461723923683167, 1.4678130149841309, 0.23815126717090607, 0.1888279765844345, 0.5161290168762207, 1.1954594850540161, 0.3123498558998108, -0.21036450564861298, -0.8146694898605347, -1.7335072755813599, 2.071624517440796, -1.551440715789795, 1.8983094692230225, 0.7998167276382446, -0.022029321640729904, -1.859951376914978, -1.8680002689361572, 1.4765774011611938, 1.1173120737075806, 2.492229700088501, 0.5548480749130249, 0.40577542781829834, -0.7626863718032837, -0.6621938347816467, 0.46223556995391846, -0.7214275002479553, -0.9060555696487427, 0.14085105061531067, 2.3165245056152344, 1.7345789670944214, -0.4417719841003418, -0.19271281361579895, -0.9375565052032471, 1.262038230895996, -0.29372525215148926, 0.25354456901550293, 1.9168552160263062, -0.3982049822807312, -1.0190922021865845, 1.339911937713623, -2.348566770553589, 0.28986889123916626, 1.9899355173110962, 0.19151830673217773, 0.044448718428611755, -1.2205075025558472, -0.6833729147911072, -0.16544651985168457, -0.4215649962425232, -1.2520346641540527, 0.39194953441619873, -0.22689397633075714, -0.878262460231781, -1.4213306903839111, -0.004877625964581966, -1.1716142892837524, -1.7365578413009644, 0.25420576333999634, 1.8068935871124268, 2.1381163597106934, -0.7728328108787537, 1.3075892925262451, -0.32603728771209717, 0.2261461317539215, 1.1600760221481323, 1.2050968408584595, 3.2276816368103027, 1.92926025390625, -1.2556031942367554, 0.7965556383132935, -0.17707611620426178, -0.4913681745529175, 1.241777777671814, -1.0068689584732056, 1.0982232093811035, -0.3209373950958252, -1.4596340656280518, -1.144465684890747, 0.9917930960655212, 0.4058082103729248, -0.08810915052890778, -0.496335506439209, 1.1961954832077026, 0.1611473560333252, 1.338577389717102, 0.6223247647285461, -0.30050128698349, 0.49827009439468384, -0.3498308062553406, -0.5742332935333252, 1.5902163982391357, 0.09471748024225235, -1.57475745677948, -2.3421523571014404, -0.14593227207660675, -1.0322730541229248, -0.029893938452005386, -0.8867084980010986, -1.006983995437622, 1.5383116006851196, 0.49987107515335083, -0.9225417971611023, -0.17774981260299683, -0.431973934173584, -0.5515721440315247, 2.5889029502868652, -1.3962551355361938, -0.24638882279396057, -0.971834123134613, -0.5538017153739929, 1.5350608825683594, -1.2121676206588745, -0.19492711126804352, -1.0291566848754883, -0.5403655171394348, -1.25620436668396, -0.39817196130752563, -0.07845989614725113, -0.7918838262557983, 0.6544962525367737, -0.019697384908795357, -1.2596689462661743, -0.22769701480865479, -1.1334638595581055, 0.9021468162536621, -0.2605598568916321, 0.06468406319618225, 1.798713207244873, 0.3021313548088074, -0.4981348514556885, 0.7675408720970154, 1.224614143371582, 0.6015278100967407, -0.5442714691162109, 0.17253339290618896, -0.6270760297775269, 0.49163705110549927, -1.3075816631317139, 0.3121066689491272, -2.91960072517395, 0.7094182372093201, 0.0006736684590578079, -0.05091461166739464, -0.1264019012451172, -1.4099401235580444, 0.9417678713798523, 2.4503092765808105, -1.1701202392578125, 0.5972591638565063, 0.30168431997299194, 1.2482932806015015, -1.5840792655944824, 0.03424539044499397, -0.6404653787612915, 2.0732998847961426, 0.02873857691884041, 1.0666922330856323, -0.5150413513183594, -2.2727713584899902, 0.5435158610343933, -1.199947714805603, -0.8611487150192261, 0.8605102896690369, -0.8508410453796387, 0.2154218554496765, -1.145628809928894, -0.031820546835660934, -0.8631377816200256, -1.0889166593551636, 0.6361963152885437, 0.010912595316767693, 0.6705073714256287, -0.6373783946037292, 0.31339186429977417, -2.259322166442871, -1.3543840646743774, -0.16112318634986877, -0.9446152448654175, 0.509792149066925, -0.34517163038253784, 0.6800792217254639, -0.09977160394191742, 0.0630718544125557, 0.2454591542482376, 1.4225273132324219, 3.2189037799835205, -0.00001485925167798996, 0.29055696725845337, -0.217911958694458, -1.1092785596847534, 1.4887304306030273, 0.8735137581825256, -0.28096532821655273, -0.5946307182312012, -0.9274188876152039, 1.3636548519134521, 1.937703013420105, 1.136893630027771, 0.1775016188621521, -0.9504683613777161, -0.8678733110427856, 0.2273586243391037, 0.18778754770755768, 0.5286253690719604, 0.9536038637161255, 0.08545749634504318, 0.21577629446983337, 1.3877471685409546, 1.0823705196380615, -0.31362760066986084, 0.612708568572998, -0.9541574120521545, -0.3983624577522278, 0.4813767671585083, 0.37013787031173706, 0.00557960569858551, 0.3068811297416687, -1.0588836669921875, -0.20292039215564728, -0.23573839664459229, -0.8350136280059814, -0.7271630167961121, -0.33326536417007446, -0.45103275775909424, 1.7159967422485352, -0.10222291946411133, -0.45858222246170044, 0.070691779255867, -0.738508403301239, -0.09033962339162827, -0.9749050140380859, 0.30179286003112793, -0.1228434294462204, 0.09332659840583801, -0.13366982340812683, 1.6532974243164062, -0.9416487216949463, -2.2009127140045166, 0.23136454820632935, 0.20509587228298187, -0.4248581528663635, -0.05806789919734001, 1.8047105073928833, 0.5763020515441895, 1.3700213432312012, 1.6025999784469604, 1.103058099746704, -0.5758250951766968, -1.3001466989517212, 0.6996467113494873, 0.8552044034004211, -1.3009766340255737, 0.9795910120010376, -0.2113885134458542, -0.5584648847579956, 0.5485947132110596, 1.2941936254501343, 0.418792188167572, -1.979844570159912, 0.9245808720588684, -1.038778305053711, 0.9081931710243225, 0.8050394654273987, 0.8616791367530823, 0.13224954903125763, 0.8901932239532471, -1.2986984252929688, -1.0819549560546875, -0.6229140162467957, -0.6206711530685425, 1.808860182762146, -0.17995217442512512, 0.32770800590515137, -0.2730444669723511, -1.32528817653656, 0.06319980323314667, 0.6952558755874634, 0.3219570517539978, -0.3554050326347351, 0.8009045124053955, -0.6379557251930237, -1.0596200227737427, -1.3133093118667603, -0.5038952827453613, -1.0294544696807861, -0.832511305809021, 0.9616255760192871, 0.7738403081893921, 0.552367091178894, 1.9589869976043701, 0.6032726168632507, 0.2158871442079544, -2.6199071407318115, 0.8225910663604736, 0.3662470579147339, -0.059635672718286514, 0.8449527025222778, 0.2785816192626953, 1.2683334350585938, -0.18088959157466888, 0.5874233841896057, -2.2921242713928223, 2.1690261363983154, -0.22495795786380768, 0.761279284954071, 0.09445998072624207, -0.017997298389673233, 0.9174206256866455, 0.5475717186927795, 0.5821606516838074, -1.1368697881698608, 0.9111485481262207, -0.7391820549964905, 1.1241531372070312, 0.8604467511177063, -0.9205640554428101, 0.11943770945072174, 1.2398340702056885, 0.36033785343170166, -0.534640908241272, -1.000387191772461, -0.8567456007003784, 0.9220495223999023, 1.713695764541626, 0.04039255902171135, 0.11661936342716217, 0.8011965751647949, 0.7600537538528442, -1.2808912992477417, -0.0118602579459548, -0.6313025951385498, -0.667926549911499, 1.790512204170227, 2.013495922088623, -0.05750730261206627, -0.045367736369371414, -0.7324133515357971, -1.3751955032348633, 0.8291164636611938, 0.13959719240665436, -0.09277848899364471, 0.876620888710022, -0.685476541519165, 1.2745670080184937, 0.7209948897361755, 0.8708990812301636, 0.24002332985401154, 0.07112381607294083, 0.22846367955207825, -0.2700314521789551, -1.2207729816436768, -0.34530961513519287, -0.9963302612304688, -2.5466647148132324, 0.3920894265174866, -0.2923585772514343, -1.5319087505340576, 0.1914130449295044, -0.9806758165359497, 0.7317236661911011, -0.5747666358947754, -1.1545330286026, -1.3148747682571411, 0.3282393217086792, -0.21618427336215973, 0.7912532091140747, -1.6331455707550049, -0.1371871531009674, 1.1642582416534424, 0.9580935835838318, -0.6333773136138916, 0.8563666343688965, 0.3320441246032715, 0.9113264083862305, 0.9988066554069519, -0.4057621955871582, 0.3992491364479065, 0.24882198870182037, -1.3048334121704102, 0.3393615484237671, 1.330315113067627, 0.13737647235393524, 1.2659516334533691, -0.45069271326065063, -0.03491874039173126, 0.4296345114707947, -0.28913259506225586, -0.5146400332450867, -0.7486792802810669, 0.6796937584877014, -0.13342063128948212, -0.9989706873893738, -0.11885946989059448, 0.04887685924768448, -0.11897716671228409, 0.37906694412231445, -1.5410125255584717, -0.10391178727149963, -0.3671260476112366, -0.6159200072288513, -1.4692177772521973, -0.07747774571180344, 1.2890185117721558, -0.9024573564529419, -0.11171962320804596, 0.5639620423316956, 0.227944016456604, 0.5179268717765808, 0.6201545000076294, -0.7708943486213684, -0.22981470823287964, -0.22069118916988373, -0.4250307083129883, 0.30170130729675293, 1.2651128768920898, -0.12134572863578796, -0.9807888269424438, 0.5094994902610779, -0.248505637049675, 0.21310950815677643, 1.9541267156600952, 0.0426827147603035, -0.903765857219696, 0.3250196576118469, -0.7246149182319641, 1.8388921022415161, 1.6954482793807983, 1.3649290800094604, -0.06351137906312943, -1.0126831531524658, 0.5139392018318176, -0.2561618685722351, -0.31311899423599243, 0.9021921753883362, 0.4061295986175537, -0.2568599581718445, -1.3517625331878662, 0.6733543872833252, 1.244443416595459, -0.7478359937667847, -0.790195882320404, 0.055280208587646484, -0.8513990044593811, 1.2613401412963867, 0.7231612205505371, 0.32136625051498413, 0.251356303691864, 1.603773832321167, 0.6842034459114075, -0.5551558136940002, 0.4866151809692383, 0.43085741996765137, -0.163336381316185, -1.994253158569336, -1.0186288356781006, 0.22747009992599487, -0.3520575165748596, -1.5342377424240112, 1.413391351699829, -1.2679544687271118, -0.9721493124961853, 0.4997873306274414, 0.1295795887708664, 1.3151836395263672, 0.260089635848999, 1.74989914894104, 2.047804832458496, 0.9825809001922607, 0.4371896982192993, 1.1690624952316284, -0.1960819810628891, -0.24053485691547394, 1.6105989217758179, -0.4852268695831299, 0.6477347016334534, 0.9746306538581848, -0.4716033935546875, -1.196473240852356, -0.8553757071495056, -1.1388676166534424, -0.7862529754638672, 1.0621124505996704, 0.1898522973060608, -1.149884819984436, 0.3044811487197876, 1.617238998413086, 0.053890831768512726, -0.1335015743970871, 0.7164933681488037, 0.39506179094314575, -0.6479167342185974, -0.08402308821678162, -1.0317535400390625, 0.5900484323501587, -0.2807777523994446, -0.36378318071365356, 0.19082897901535034, 0.539252519607544, 1.196293830871582, 0.18305455148220062, 0.14696119725704193, 1.4136749505996704, -1.3436400890350342, 1.2438193559646606, -0.9229470491409302, 0.3805428743362427, -2.3365025520324707, 1.5273871421813965, -0.9386296272277832, 1.893409252166748, -2.6830320358276367, 0.5512139797210693, -0.45212405920028687, -0.5854523181915283, 0.15021400153636932, -0.22309891879558563, 0.07485535740852356, -0.028467023745179176, -1.0142229795455933, -0.1825016289949417, -0.9272513389587402, 0.4517614245414734, 1.208055019378662, 1.3745726346969604, -0.9028977155685425, -0.3034746050834656, -1.6826531887054443, -0.13940879702568054, -0.5172159075737, 0.21712414920330048, -1.7770774364471436, -0.1603246033191681, -2.091036558151245, -2.5095455646514893, -1.422497272491455, -0.9882639050483704, 1.2877840995788574, 0.15297673642635345, -0.8971368074417114, 1.047493577003479, -0.4075697064399719, -1.795865774154663, 1.2273149490356445, -2.2751903533935547 ]
https://github.com/huggingface/datasets/issues/3637
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18
Thanks, this was indeed the fix! Would it make sense to produce a more informative error message in such cases? The issue can be closed.
## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0
982
25
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18 ## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0 Thanks, this was indeed the fix! Would it make sense to produce a more informative error message in such cases? The issue can be closed.
[ -1.119612693786621, -0.7998745441436768, -0.6116821765899658, 1.3577075004577637, 0.050743404775857925, -1.4359827041625977, 0.13755398988723755, -0.876522421836853, 1.6176228523254395, -0.808984637260437, 0.34142786264419556, -1.759246826171875, -0.017837852239608765, -0.5892559885978699, -0.6911984086036682, -0.7316567301750183, -0.3103090524673462, -0.7355347275733948, 1.0836652517318726, 2.4761643409729004, 1.2086782455444336, -1.2797062397003174, 2.8229124546051025, 0.5709953904151917, -0.2829189896583557, -0.8498000502586365, 0.4273245334625244, -0.025058943778276443, -1.426507592201233, -0.2457330822944641, -0.979324221611023, -0.05479567497968674, -0.6450890898704529, -0.5338867902755737, 0.15625113248825073, 0.5145761966705322, -0.14601249992847443, -0.3748859763145447, -0.41920530796051025, -0.7390908002853394, 0.5777602195739746, -0.25486230850219727, 0.8970232009887695, -0.3141157627105713, 1.7584664821624756, -0.6439350843429565, 0.4730257987976074, 0.5801748633384705, 1.2777273654937744, 0.21179983019828796, -0.042523205280303955, 0.38918542861938477, 0.2076684832572937, 0.07493970543146133, 0.5940607786178589, 1.2711210250854492, 0.5803079009056091, 0.5318754315376282, 0.7299256920814514, -2.196223497390747, 1.4101659059524536, -0.7317008376121521, 0.25966310501098633, 1.3172829151153564, -1.044732689857483, 0.443572461605072, -1.865087866783142, -0.18595251441001892, 0.38373124599456787, -2.3192310333251953, 0.0474226176738739, -1.30625319480896, -0.5620532631874084, 0.9538967609405518, 0.390342652797699, -1.2468212842941284, 0.0013336027041077614, -0.3922343850135803, 0.9623681902885437, 0.4595646858215332, 1.2114605903625488, -1.6485048532485962, 0.05268295109272003, -0.199926495552063, 0.37630122900009155, -1.189096212387085, -1.6890515089035034, 0.5943613648414612, 0.7753700613975525, 0.670306384563446, -0.17349517345428467, 0.7936232686042786, -1.0536009073257446, 0.8381703495979309, -0.8909687399864197, -1.8659862279891968, -1.3040815591812134, -2.3887598514556885, -2.4135775566101074, 0.802474319934845, -0.44554591178894043, -0.36523669958114624, 2.145801544189453, -1.126902461051941, -1.7858461141586304, 0.9752016663551331, 0.26382148265838623, -0.08937223255634308, 2.3905930519104004, 0.2317325919866562, -0.8920384049415588, 0.6567294597625732, -0.835502564907074, 0.6978958249092102, -0.3457126021385193, 1.271892786026001, 0.4428752660751343, -1.0470685958862305, 1.6073377132415771, -0.47498196363449097, 0.45754891633987427, -0.7968437671661377, -0.380523681640625, -0.5883035063743591, 0.1990339756011963, 1.9204295873641968, -0.18293912708759308, 1.5648789405822754, -0.1771640032529831, -1.5329855680465698, -1.419334053993225, 0.6409233212471008, 0.511070728302002, -0.8315302133560181, 0.20550572872161865, -0.423764169216156, 0.11501666903495789, 0.2588154077529907, 1.1363389492034912, 1.2631319761276245, 0.8184175491333008, -0.1449815183877945, -0.8537033200263977, 0.14530646800994873, -0.047281812876462936, -0.5539096593856812, -1.7793304920196533, -0.26767826080322266, 0.19479145109653473, 0.6433777213096619, -1.1806881427764893, 1.9212442636489868, 0.8450674414634705, 2.0691168308258057, 1.011534571647644, -0.35163480043411255, 1.559617519378662, 0.058200523257255554, 1.95903742313385, -0.26726996898651123, 0.6355524659156799, -0.5372718572616577, -1.1851940155029297, 0.6636114120483398, -0.39501678943634033, -1.9712419509887695, -0.43572866916656494, -0.9084848761558533, -0.08571698516607285, -0.8853223919868469, 1.0004886388778687, -0.19106678664684296, -1.4041653871536255, 0.16553756594657898, -0.6922587752342224, 0.09646189212799072, -1.415770411491394, 0.21261946856975555, 0.7603151798248291, -0.758435070514679, 0.05565764009952545, -0.4859585165977478, -1.4342120885849, -0.5883336067199707, 0.47023946046829224, 1.834052324295044, -0.6187215447425842, 1.0081350803375244, 0.9806607365608215, -0.5800778269767761, -0.0205399040132761, 0.4618062376976013, -0.36061954498291016, 0.8371902704238892, -1.015712022781372, -0.37133342027664185, 1.0635143518447876, -0.2355886548757553, -0.5456058382987976, 1.338151216506958, 0.7552140355110168, -1.0400891304016113, -0.28770989179611206, -0.11580777168273926, -0.8428633213043213, 0.038519639521837234, -1.6853548288345337, -0.10931016504764557, 0.24126924574375153, -1.4571247100830078, -0.4939950108528137, -0.05970833823084831, 1.2659093141555786, 0.0006748558953404427, 1.359289526939392, -0.21134743094444275, -0.08477456122636795, -0.5597373247146606, -0.602897047996521, 0.132068932056427, -0.16976170241832733, -0.6361870169639587, 0.32542723417282104, -0.7288950085639954, 0.13461723923683167, 1.4678130149841309, 0.23815126717090607, 0.1888279765844345, 0.5161290168762207, 1.1954594850540161, 0.3123498558998108, -0.21036450564861298, -0.8146694898605347, -1.7335072755813599, 2.071624517440796, -1.551440715789795, 1.8983094692230225, 0.7998167276382446, -0.022029321640729904, -1.859951376914978, -1.8680002689361572, 1.4765774011611938, 1.1173120737075806, 2.492229700088501, 0.5548480749130249, 0.40577542781829834, -0.7626863718032837, -0.6621938347816467, 0.46223556995391846, -0.7214275002479553, -0.9060555696487427, 0.14085105061531067, 2.3165245056152344, 1.7345789670944214, -0.4417719841003418, -0.19271281361579895, -0.9375565052032471, 1.262038230895996, -0.29372525215148926, 0.25354456901550293, 1.9168552160263062, -0.3982049822807312, -1.0190922021865845, 1.339911937713623, -2.348566770553589, 0.28986889123916626, 1.9899355173110962, 0.19151830673217773, 0.044448718428611755, -1.2205075025558472, -0.6833729147911072, -0.16544651985168457, -0.4215649962425232, -1.2520346641540527, 0.39194953441619873, -0.22689397633075714, -0.878262460231781, -1.4213306903839111, -0.004877625964581966, -1.1716142892837524, -1.7365578413009644, 0.25420576333999634, 1.8068935871124268, 2.1381163597106934, -0.7728328108787537, 1.3075892925262451, -0.32603728771209717, 0.2261461317539215, 1.1600760221481323, 1.2050968408584595, 3.2276816368103027, 1.92926025390625, -1.2556031942367554, 0.7965556383132935, -0.17707611620426178, -0.4913681745529175, 1.241777777671814, -1.0068689584732056, 1.0982232093811035, -0.3209373950958252, -1.4596340656280518, -1.144465684890747, 0.9917930960655212, 0.4058082103729248, -0.08810915052890778, -0.496335506439209, 1.1961954832077026, 0.1611473560333252, 1.338577389717102, 0.6223247647285461, -0.30050128698349, 0.49827009439468384, -0.3498308062553406, -0.5742332935333252, 1.5902163982391357, 0.09471748024225235, -1.57475745677948, -2.3421523571014404, -0.14593227207660675, -1.0322730541229248, -0.029893938452005386, -0.8867084980010986, -1.006983995437622, 1.5383116006851196, 0.49987107515335083, -0.9225417971611023, -0.17774981260299683, -0.431973934173584, -0.5515721440315247, 2.5889029502868652, -1.3962551355361938, -0.24638882279396057, -0.971834123134613, -0.5538017153739929, 1.5350608825683594, -1.2121676206588745, -0.19492711126804352, -1.0291566848754883, -0.5403655171394348, -1.25620436668396, -0.39817196130752563, -0.07845989614725113, -0.7918838262557983, 0.6544962525367737, -0.019697384908795357, -1.2596689462661743, -0.22769701480865479, -1.1334638595581055, 0.9021468162536621, -0.2605598568916321, 0.06468406319618225, 1.798713207244873, 0.3021313548088074, -0.4981348514556885, 0.7675408720970154, 1.224614143371582, 0.6015278100967407, -0.5442714691162109, 0.17253339290618896, -0.6270760297775269, 0.49163705110549927, -1.3075816631317139, 0.3121066689491272, -2.91960072517395, 0.7094182372093201, 0.0006736684590578079, -0.05091461166739464, -0.1264019012451172, -1.4099401235580444, 0.9417678713798523, 2.4503092765808105, -1.1701202392578125, 0.5972591638565063, 0.30168431997299194, 1.2482932806015015, -1.5840792655944824, 0.03424539044499397, -0.6404653787612915, 2.0732998847961426, 0.02873857691884041, 1.0666922330856323, -0.5150413513183594, -2.2727713584899902, 0.5435158610343933, -1.199947714805603, -0.8611487150192261, 0.8605102896690369, -0.8508410453796387, 0.2154218554496765, -1.145628809928894, -0.031820546835660934, -0.8631377816200256, -1.0889166593551636, 0.6361963152885437, 0.010912595316767693, 0.6705073714256287, -0.6373783946037292, 0.31339186429977417, -2.259322166442871, -1.3543840646743774, -0.16112318634986877, -0.9446152448654175, 0.509792149066925, -0.34517163038253784, 0.6800792217254639, -0.09977160394191742, 0.0630718544125557, 0.2454591542482376, 1.4225273132324219, 3.2189037799835205, -0.00001485925167798996, 0.29055696725845337, -0.217911958694458, -1.1092785596847534, 1.4887304306030273, 0.8735137581825256, -0.28096532821655273, -0.5946307182312012, -0.9274188876152039, 1.3636548519134521, 1.937703013420105, 1.136893630027771, 0.1775016188621521, -0.9504683613777161, -0.8678733110427856, 0.2273586243391037, 0.18778754770755768, 0.5286253690719604, 0.9536038637161255, 0.08545749634504318, 0.21577629446983337, 1.3877471685409546, 1.0823705196380615, -0.31362760066986084, 0.612708568572998, -0.9541574120521545, -0.3983624577522278, 0.4813767671585083, 0.37013787031173706, 0.00557960569858551, 0.3068811297416687, -1.0588836669921875, -0.20292039215564728, -0.23573839664459229, -0.8350136280059814, -0.7271630167961121, -0.33326536417007446, -0.45103275775909424, 1.7159967422485352, -0.10222291946411133, -0.45858222246170044, 0.070691779255867, -0.738508403301239, -0.09033962339162827, -0.9749050140380859, 0.30179286003112793, -0.1228434294462204, 0.09332659840583801, -0.13366982340812683, 1.6532974243164062, -0.9416487216949463, -2.2009127140045166, 0.23136454820632935, 0.20509587228298187, -0.4248581528663635, -0.05806789919734001, 1.8047105073928833, 0.5763020515441895, 1.3700213432312012, 1.6025999784469604, 1.103058099746704, -0.5758250951766968, -1.3001466989517212, 0.6996467113494873, 0.8552044034004211, -1.3009766340255737, 0.9795910120010376, -0.2113885134458542, -0.5584648847579956, 0.5485947132110596, 1.2941936254501343, 0.418792188167572, -1.979844570159912, 0.9245808720588684, -1.038778305053711, 0.9081931710243225, 0.8050394654273987, 0.8616791367530823, 0.13224954903125763, 0.8901932239532471, -1.2986984252929688, -1.0819549560546875, -0.6229140162467957, -0.6206711530685425, 1.808860182762146, -0.17995217442512512, 0.32770800590515137, -0.2730444669723511, -1.32528817653656, 0.06319980323314667, 0.6952558755874634, 0.3219570517539978, -0.3554050326347351, 0.8009045124053955, -0.6379557251930237, -1.0596200227737427, -1.3133093118667603, -0.5038952827453613, -1.0294544696807861, -0.832511305809021, 0.9616255760192871, 0.7738403081893921, 0.552367091178894, 1.9589869976043701, 0.6032726168632507, 0.2158871442079544, -2.6199071407318115, 0.8225910663604736, 0.3662470579147339, -0.059635672718286514, 0.8449527025222778, 0.2785816192626953, 1.2683334350585938, -0.18088959157466888, 0.5874233841896057, -2.2921242713928223, 2.1690261363983154, -0.22495795786380768, 0.761279284954071, 0.09445998072624207, -0.017997298389673233, 0.9174206256866455, 0.5475717186927795, 0.5821606516838074, -1.1368697881698608, 0.9111485481262207, -0.7391820549964905, 1.1241531372070312, 0.8604467511177063, -0.9205640554428101, 0.11943770945072174, 1.2398340702056885, 0.36033785343170166, -0.534640908241272, -1.000387191772461, -0.8567456007003784, 0.9220495223999023, 1.713695764541626, 0.04039255902171135, 0.11661936342716217, 0.8011965751647949, 0.7600537538528442, -1.2808912992477417, -0.0118602579459548, -0.6313025951385498, -0.667926549911499, 1.790512204170227, 2.013495922088623, -0.05750730261206627, -0.045367736369371414, -0.7324133515357971, -1.3751955032348633, 0.8291164636611938, 0.13959719240665436, -0.09277848899364471, 0.876620888710022, -0.685476541519165, 1.2745670080184937, 0.7209948897361755, 0.8708990812301636, 0.24002332985401154, 0.07112381607294083, 0.22846367955207825, -0.2700314521789551, -1.2207729816436768, -0.34530961513519287, -0.9963302612304688, -2.5466647148132324, 0.3920894265174866, -0.2923585772514343, -1.5319087505340576, 0.1914130449295044, -0.9806758165359497, 0.7317236661911011, -0.5747666358947754, -1.1545330286026, -1.3148747682571411, 0.3282393217086792, -0.21618427336215973, 0.7912532091140747, -1.6331455707550049, -0.1371871531009674, 1.1642582416534424, 0.9580935835838318, -0.6333773136138916, 0.8563666343688965, 0.3320441246032715, 0.9113264083862305, 0.9988066554069519, -0.4057621955871582, 0.3992491364479065, 0.24882198870182037, -1.3048334121704102, 0.3393615484237671, 1.330315113067627, 0.13737647235393524, 1.2659516334533691, -0.45069271326065063, -0.03491874039173126, 0.4296345114707947, -0.28913259506225586, -0.5146400332450867, -0.7486792802810669, 0.6796937584877014, -0.13342063128948212, -0.9989706873893738, -0.11885946989059448, 0.04887685924768448, -0.11897716671228409, 0.37906694412231445, -1.5410125255584717, -0.10391178727149963, -0.3671260476112366, -0.6159200072288513, -1.4692177772521973, -0.07747774571180344, 1.2890185117721558, -0.9024573564529419, -0.11171962320804596, 0.5639620423316956, 0.227944016456604, 0.5179268717765808, 0.6201545000076294, -0.7708943486213684, -0.22981470823287964, -0.22069118916988373, -0.4250307083129883, 0.30170130729675293, 1.2651128768920898, -0.12134572863578796, -0.9807888269424438, 0.5094994902610779, -0.248505637049675, 0.21310950815677643, 1.9541267156600952, 0.0426827147603035, -0.903765857219696, 0.3250196576118469, -0.7246149182319641, 1.8388921022415161, 1.6954482793807983, 1.3649290800094604, -0.06351137906312943, -1.0126831531524658, 0.5139392018318176, -0.2561618685722351, -0.31311899423599243, 0.9021921753883362, 0.4061295986175537, -0.2568599581718445, -1.3517625331878662, 0.6733543872833252, 1.244443416595459, -0.7478359937667847, -0.790195882320404, 0.055280208587646484, -0.8513990044593811, 1.2613401412963867, 0.7231612205505371, 0.32136625051498413, 0.251356303691864, 1.603773832321167, 0.6842034459114075, -0.5551558136940002, 0.4866151809692383, 0.43085741996765137, -0.163336381316185, -1.994253158569336, -1.0186288356781006, 0.22747009992599487, -0.3520575165748596, -1.5342377424240112, 1.413391351699829, -1.2679544687271118, -0.9721493124961853, 0.4997873306274414, 0.1295795887708664, 1.3151836395263672, 0.260089635848999, 1.74989914894104, 2.047804832458496, 0.9825809001922607, 0.4371896982192993, 1.1690624952316284, -0.1960819810628891, -0.24053485691547394, 1.6105989217758179, -0.4852268695831299, 0.6477347016334534, 0.9746306538581848, -0.4716033935546875, -1.196473240852356, -0.8553757071495056, -1.1388676166534424, -0.7862529754638672, 1.0621124505996704, 0.1898522973060608, -1.149884819984436, 0.3044811487197876, 1.617238998413086, 0.053890831768512726, -0.1335015743970871, 0.7164933681488037, 0.39506179094314575, -0.6479167342185974, -0.08402308821678162, -1.0317535400390625, 0.5900484323501587, -0.2807777523994446, -0.36378318071365356, 0.19082897901535034, 0.539252519607544, 1.196293830871582, 0.18305455148220062, 0.14696119725704193, 1.4136749505996704, -1.3436400890350342, 1.2438193559646606, -0.9229470491409302, 0.3805428743362427, -2.3365025520324707, 1.5273871421813965, -0.9386296272277832, 1.893409252166748, -2.6830320358276367, 0.5512139797210693, -0.45212405920028687, -0.5854523181915283, 0.15021400153636932, -0.22309891879558563, 0.07485535740852356, -0.028467023745179176, -1.0142229795455933, -0.1825016289949417, -0.9272513389587402, 0.4517614245414734, 1.208055019378662, 1.3745726346969604, -0.9028977155685425, -0.3034746050834656, -1.6826531887054443, -0.13940879702568054, -0.5172159075737, 0.21712414920330048, -1.7770774364471436, -0.1603246033191681, -2.091036558151245, -2.5095455646514893, -1.422497272491455, -0.9882639050483704, 1.2877840995788574, 0.15297673642635345, -0.8971368074417114, 1.047493577003479, -0.4075697064399719, -1.795865774154663, 1.2273149490356445, -2.2751903533935547 ]
https://github.com/huggingface/datasets/issues/3634
Dataset.shuffle(seed=None) gives fixed row permutation
I'm not sure if this is expected behavior. Am I supposed to work with a copy of the dataset, i.e. `shuffled_dataset = data.shuffle(seed=None)`? ```diff import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) +shuffled_data = data.shuffle(seed=None) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): + shuffled_data = shuffled_data.shuffle(seed=None) + print(shuffled_data[:]) - print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` or provide a `generator` instead? ```diff import datasets +from numpy.random import default_rng # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) +rng = default_rng() # Doesn't work as expected print("Shuffle dataset") for _ in range(3): + print(data.shuffle(generator=rng)[:]) - print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ```
## Describe the bug Repeated attempts to `shuffle` a dataset without specifying a seed give the same results. ## Steps to reproduce the bug ```python import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` ## Expected results I assumed that the default setting would initialize a new/random state of a `np.random.BitGenerator` (see [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=shuffle#datasets.Dataset.shuffle)). Wouldn't that reshuffle the rows each time I call `data.shuffle()`? ## Actual results ```bash Shuffle dataset {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} Shuffle via pandas {'feature': [4, 2, 3, 1, 5], 'label': ['d', 'b', 'c', 'a', 'e']} {'feature': [2, 5, 3, 4, 1], 'label': ['b', 'e', 'c', 'd', 'a']} {'feature': [5, 2, 3, 1, 4], 'label': ['e', 'b', 'c', 'a', 'd']} ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-5.13.0-27-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 6.0.1
983
158
Dataset.shuffle(seed=None) gives fixed row permutation ## Describe the bug Repeated attempts to `shuffle` a dataset without specifying a seed give the same results. ## Steps to reproduce the bug ```python import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` ## Expected results I assumed that the default setting would initialize a new/random state of a `np.random.BitGenerator` (see [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=shuffle#datasets.Dataset.shuffle)). Wouldn't that reshuffle the rows each time I call `data.shuffle()`? ## Actual results ```bash Shuffle dataset {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} Shuffle via pandas {'feature': [4, 2, 3, 1, 5], 'label': ['d', 'b', 'c', 'a', 'e']} {'feature': [2, 5, 3, 4, 1], 'label': ['b', 'e', 'c', 'd', 'a']} {'feature': [5, 2, 3, 1, 4], 'label': ['e', 'b', 'c', 'a', 'd']} ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-5.13.0-27-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 6.0.1 I'm not sure if this is expected behavior. Am I supposed to work with a copy of the dataset, i.e. `shuffled_dataset = data.shuffle(seed=None)`? ```diff import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) +shuffled_data = data.shuffle(seed=None) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): + shuffled_data = shuffled_data.shuffle(seed=None) + print(shuffled_data[:]) - print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` or provide a `generator` instead? ```diff import datasets +from numpy.random import default_rng # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) +rng = default_rng() # Doesn't work as expected print("Shuffle dataset") for _ in range(3): + print(data.shuffle(generator=rng)[:]) - print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ```
[ -1.2027478218078613, -0.9850239753723145, -0.8426291942596436, 1.5853625535964966, -0.17829139530658722, -1.144905686378479, 0.027265725657343864, -1.0506383180618286, 1.6484477519989014, -0.6523365378379822, 0.09356063604354858, -1.7013888359069824, -0.06106358766555786, -0.7257154583930969, -0.6672883629798889, -0.869242787361145, -0.25720736384391785, -0.7927384972572327, 1.1071012020111084, 2.457977056503296, 1.0428855419158936, -1.4840631484985352, 2.6904914379119873, 0.7689693570137024, -0.0688672736287117, -1.040507197380066, 0.5966792702674866, -0.08514317125082016, -1.1909923553466797, -0.45391958951950073, -1.0341832637786865, -0.06214957684278488, -0.6168980002403259, -0.4924125075340271, -0.08345461636781693, 0.4951717257499695, -0.3388653099536896, -0.4941442310810089, -0.5522199273109436, -0.771803617477417, 0.37362730503082275, -0.4101693630218506, 0.9827365875244141, -0.21912246942520142, 1.760561466217041, -0.39788365364074707, 0.3650769591331482, 0.628996729850769, 1.3568896055221558, 0.21863725781440735, 0.15344084799289703, 0.42191192507743835, 0.38438355922698975, -0.008238296024501324, 0.6083023548126221, 1.1559370756149292, 0.6885864734649658, 0.41446128487586975, 0.9052733182907104, -2.3432130813598633, 1.1599243879318237, -1.1698594093322754, 0.37659165263175964, 1.3764426708221436, -0.8055191040039062, 0.4391515552997589, -1.7189208269119263, 0.068687304854393, 0.6904436349868774, -2.1372780799865723, 0.372691810131073, -1.2821190357208252, -0.41910529136657715, 0.9607100486755371, 0.48674678802490234, -1.2486307621002197, 0.1457797735929489, -0.3983977735042572, 1.0252894163131714, 0.3761633336544037, 1.0323494672775269, -1.6882625818252563, 0.09740152955055237, -0.25037792325019836, 0.09389486163854599, -1.1886605024337769, -1.5327250957489014, 0.5611794590950012, 0.5829719305038452, 0.6493719220161438, -0.13532768189907074, 0.9798920750617981, -1.1387897729873657, 0.5425660014152527, -1.0260506868362427, -1.7844281196594238, -1.453007698059082, -2.2929153442382812, -2.2942311763763428, 0.6784314513206482, -0.43588218092918396, -0.5060495734214783, 2.0450551509857178, -0.8377869129180908, -1.6964178085327148, 1.217308521270752, 0.45000195503234863, 0.07996112108230591, 2.5087661743164062, 0.19487906992435455, -0.7537073493003845, 0.5700538158416748, -0.8862690925598145, 0.7820252776145935, -0.4019380509853363, 1.4053552150726318, 0.38143470883369446, -0.8486970067024231, 1.7186824083328247, -0.4181620478630066, 0.5527417063713074, -0.6321273446083069, -0.4098011553287506, -0.7568954825401306, 0.3448311686515808, 1.9081897735595703, -0.21275825798511505, 1.4100896120071411, -0.4107515811920166, -1.5465697050094604, -1.5514869689941406, 0.9152252674102783, 0.3180091679096222, -0.9351732730865479, 0.07506877183914185, -0.4084171652793884, 0.22413237392902374, -0.1717260330915451, 1.3101876974105835, 1.2890074253082275, 0.6212308406829834, -0.3578004837036133, -0.9722316265106201, 0.14348365366458893, -0.17375808954238892, -0.8203666806221008, -1.718309998512268, -0.30600330233573914, 0.09644447267055511, 0.6722708940505981, -1.2377768754959106, 1.7080951929092407, 0.8040940761566162, 1.8765846490859985, 0.9671685695648193, -0.5200857520103455, 1.5206220149993896, 0.15174980461597443, 1.7803553342819214, -0.6624228954315186, 0.576121985912323, -0.40498456358909607, -1.156876564025879, 0.9170974493026733, -0.34166470170021057, -1.9956552982330322, -0.7706634998321533, -0.8442538976669312, -0.26009076833724976, -0.7778388857841492, 0.8920508027076721, -0.39852818846702576, -1.427286982536316, 0.30719757080078125, -0.831377387046814, 0.14997598528862, -1.1744450330734253, 0.23811550438404083, 0.7273319959640503, -0.5462007522583008, 0.1252046376466751, -0.20238204300403595, -1.376065969467163, -0.38425910472869873, 0.4271897077560425, 1.9370163679122925, -0.7601563930511475, 0.7689212560653687, 1.0657309293746948, -0.6993778347969055, -0.008597210980951786, 0.2714066803455353, -0.22858363389968872, 0.8258752226829529, -0.9639033675193787, -0.7383837103843689, 1.2210427522659302, -0.23460347950458527, -0.6009925603866577, 1.374183177947998, 0.7669705152511597, -1.0298837423324585, -0.23531010746955872, -0.13850858807563782, -0.8219053745269775, 0.053035520017147064, -1.601953387260437, -0.13278600573539734, 0.5720393061637878, -1.5809754133224487, -0.5392161011695862, -0.26546579599380493, 1.218254804611206, -0.1041264533996582, 1.309666633605957, -0.31711727380752563, -0.11134909838438034, -0.2705114781856537, -0.47025951743125916, 0.20588232576847076, -0.3218876123428345, -0.5949971079826355, 0.10657503455877304, -0.8272674679756165, 0.414374977350235, 1.3970104455947876, 0.3178020119667053, 0.03353176265954971, 0.5593878626823425, 1.1336748600006104, 0.5356203317642212, 0.12357998639345169, -0.8425074219703674, -1.453641653060913, 1.9701045751571655, -1.5236870050430298, 1.8954299688339233, 0.6510457992553711, -0.01158755924552679, -1.7725965976715088, -1.8902961015701294, 1.3825664520263672, 1.1533141136169434, 2.2383832931518555, 0.5952703356742859, 0.4339529573917389, -0.8554482460021973, -0.6174194812774658, 0.18528637290000916, -0.8409154415130615, -0.6591248512268066, 0.17004746198654175, 2.4253854751586914, 1.833988070487976, -0.4317640960216522, -0.17396605014801025, -0.9397380352020264, 1.5607621669769287, -0.31144383549690247, 0.3412323594093323, 2.009483575820923, -0.3180587887763977, -1.0340436697006226, 1.3727706670761108, -2.506140947341919, 0.13649697601795197, 2.0087296962738037, 0.27472740411758423, 0.19672390818595886, -1.4073569774627686, -0.7214491963386536, -0.34806108474731445, -0.4298110008239746, -1.2648204565048218, 0.5525278449058533, -0.21434609591960907, -0.7954612970352173, -1.498732566833496, 0.205153688788414, -1.1750816106796265, -1.5997273921966553, 0.1329279989004135, 1.9549096822738647, 2.1537766456604004, -0.8064053654670715, 1.6521885395050049, -0.21074673533439636, 0.23343059420585632, 1.2658686637878418, 1.165868878364563, 3.028795003890991, 1.8387995958328247, -1.1382274627685547, 0.6173235774040222, -0.16209538280963898, -0.5051411986351013, 1.1733049154281616, -1.1823008060455322, 1.1875149011611938, -0.10017775744199753, -1.1009490489959717, -1.2129194736480713, 0.8785483837127686, 0.46849319338798523, -0.050421424210071564, -0.47246819734573364, 1.1999870538711548, -0.05595345050096512, 1.216972827911377, 0.6459949612617493, -0.39526239037513733, 0.45009517669677734, -0.34786155819892883, -0.5473735332489014, 1.4817509651184082, 0.11394677311182022, -1.4880449771881104, -2.192829132080078, -0.19201228022575378, -0.7927535176277161, 0.0038545364513993263, -0.5866337418556213, -1.0536772012710571, 1.660463571548462, 0.29163166880607605, -1.0994858741760254, -0.2577934265136719, -0.34714123606681824, -0.46952077746391296, 2.7494418621063232, -1.3157869577407837, -0.45054876804351807, -0.9771263003349304, -0.573137640953064, 1.6766890287399292, -1.0687284469604492, -0.1910528838634491, -1.0768049955368042, -0.5766167044639587, -1.3321741819381714, -0.5575454831123352, 0.03558077663183212, -0.9735773801803589, 0.9316545128822327, 0.28552696108818054, -1.18160080909729, -0.30885687470436096, -0.936836302280426, 0.9684805274009705, -0.22029443085193634, 0.176992267370224, 1.9485143423080444, 0.3222794234752655, -0.40311697125434875, 0.8627122640609741, 1.1980605125427246, 0.6725000739097595, -0.6056346893310547, 0.1539829522371292, -0.5568241477012634, 0.4864893853664398, -1.3809995651245117, 0.19943544268608093, -2.8877973556518555, 0.5183447003364563, -0.06869594007730484, -0.08792844414710999, 0.12342818826436996, -1.2899888753890991, 1.1041686534881592, 2.4690425395965576, -1.2826400995254517, 0.5024694800376892, 0.2552028000354767, 1.4039509296417236, -1.6844899654388428, 0.28132280707359314, -0.4239630699157715, 2.110945224761963, 0.10908966511487961, 1.1057026386260986, -0.3995947539806366, -2.3907535076141357, 0.6047439575195312, -1.339608073234558, -1.0967750549316406, 0.6191752552986145, -0.949665367603302, 0.23442868888378143, -1.6273646354675293, -0.23223930597305298, -0.8321203589439392, -1.2027230262756348, 0.7062541246414185, 0.2173343449831009, 0.28239956498146057, -0.537087619304657, 0.4054957330226898, -2.146214723587036, -1.4706519842147827, -0.17289434373378754, -0.9069441556930542, 0.5918384790420532, -0.36087799072265625, 0.7021045088768005, -0.15307410061359406, -0.06463776528835297, 0.2521042823791504, 1.4948176145553589, 3.494410753250122, 0.14225390553474426, 0.3621062934398651, -0.16934306919574738, -0.9432679414749146, 1.405328392982483, 1.0108883380889893, -0.14764650166034698, -0.49972814321517944, -1.1227058172225952, 1.467691421508789, 1.9854415655136108, 0.9209309816360474, 0.012785853818058968, -0.7228732109069824, -0.6832807064056396, -0.04089072346687317, 0.2665509283542633, 0.44264787435531616, 0.8079368472099304, 0.06672979891300201, -0.01918226107954979, 1.482689380645752, 1.1830425262451172, -0.2912008464336395, 0.2979688346385956, -0.9353402256965637, -0.45286473631858826, 0.5964691638946533, 0.1465446799993515, -0.05676329880952835, 0.3788291811943054, -1.1047974824905396, -0.30461540818214417, -0.3279343545436859, -0.8305020332336426, -0.6166424751281738, -0.3637184202671051, -0.24431079626083374, 1.5334131717681885, 0.30706942081451416, -0.6296212673187256, -0.04220759868621826, -0.6804234385490417, -0.08814273774623871, -1.0219846963882446, 0.11348859965801239, -0.20294134318828583, -0.19108416140079498, -0.2438177466392517, 1.7411484718322754, -0.8174925446510315, -1.9938451051712036, -0.017873937264084816, 0.432028591632843, -0.12459087371826172, 0.26956284046173096, 1.622824788093567, 0.5946660041809082, 1.4462857246398926, 1.3089340925216675, 0.9230803847312927, -0.590895414352417, -1.3333728313446045, 0.6670123338699341, 1.0509260892868042, -1.25721275806427, 0.8999046087265015, -0.044412173330783844, -0.5754315853118896, 0.591562807559967, 1.3544093370437622, 0.38252460956573486, -1.9684510231018066, 0.7812802791595459, -1.0200278759002686, 0.9225218892097473, 0.7564151287078857, 0.7682754993438721, 0.29317739605903625, 0.7342533469200134, -1.2364684343338013, -1.169651746749878, -0.8393371105194092, -0.7544728517532349, 2.0007457733154297, -0.3010682165622711, 0.6275573372840881, -0.22295813262462616, -1.317624807357788, -0.1310672163963318, 0.5926023125648499, 0.40422260761260986, -0.5330566763877869, 0.8842213749885559, -0.6827632784843445, -1.1259318590164185, -1.3239115476608276, -0.44160571694374084, -1.001908779144287, -0.9877004027366638, 1.0263618230819702, 0.8037208318710327, 0.30945783853530884, 1.8109318017959595, 0.5973926782608032, 0.18527230620384216, -2.4863393306732178, 0.937535285949707, 0.34674859046936035, -0.1556154042482376, 0.6944962739944458, 0.39792513847351074, 1.1920067071914673, -0.04145066440105438, 0.5318114161491394, -2.269291639328003, 2.1758921146392822, -0.11659768223762512, 0.7916720509529114, -0.05609792470932007, -0.008175384253263474, 1.0131758451461792, 0.5106115341186523, 0.5550148487091064, -0.9090742468833923, 0.5726118683815002, -0.5380112528800964, 1.3161944150924683, 1.0646281242370605, -0.6904686093330383, -0.06308268755674362, 1.4143809080123901, 0.5061217546463013, -0.6741029620170593, -0.9994091391563416, -0.8499894738197327, 0.9853264689445496, 1.6977287530899048, -0.10960256308317184, -0.057664625346660614, 0.8646607995033264, 0.5637720823287964, -1.256563425064087, 0.007256653159856796, -0.6389970779418945, -0.5625125169754028, 1.7938917875289917, 2.106156349182129, -0.3955633044242859, -0.11275256425142288, -0.6844910979270935, -1.3661705255508423, 0.5803123712539673, -0.07995465397834778, 0.07572568207979202, 0.7325646281242371, -0.6893892884254456, 0.9922799468040466, 0.7176045775413513, 0.7853760719299316, 0.15531820058822632, 0.316283643245697, 0.43439966440200806, -0.41614818572998047, -1.1571463346481323, -0.3115007281303406, -1.1407380104064941, -2.5032196044921875, 0.3790138065814972, -0.10085336118936539, -1.3544753789901733, 0.04915387183427811, -0.9972333312034607, 1.1946027278900146, -0.5093771815299988, -1.1144732236862183, -1.3771514892578125, 0.3182785212993622, 0.10814283788204193, 0.8756378293037415, -1.6797535419464111, -0.07401356846094131, 1.2704596519470215, 0.9657828211784363, -0.7646998167037964, 0.9991578459739685, 0.3520015478134155, 1.1727278232574463, 0.7326361536979675, -0.36164167523384094, 0.565434992313385, -0.1155037134885788, -1.2760868072509766, 0.4798758327960968, 1.1452240943908691, 0.13248059153556824, 1.424686074256897, -0.48931968212127686, -0.14286160469055176, 0.4216919243335724, -0.5991042852401733, -0.41596174240112305, -0.41166579723358154, 0.5196923017501831, 0.11749885231256485, -0.7830802202224731, -0.12271010130643845, 0.08648931980133057, -0.36629730463027954, 0.13541975617408752, -1.5017850399017334, -0.21681979298591614, -0.3897079825401306, -0.4958266019821167, -1.2512837648391724, -0.07521321624517441, 1.332988977432251, -0.6980776190757751, -0.3094165623188019, 0.5737336277961731, 0.31825175881385803, 0.44878843426704407, 0.6160010099411011, -0.6607797145843506, -0.3344722092151642, -0.16579142212867737, -0.3559885621070862, 0.1826964169740677, 1.4243497848510742, -0.19780290126800537, -1.015480637550354, 0.6366184949874878, -0.3939228951931, -0.03643346577882767, 1.7478076219558716, -0.04135289043188095, -0.9167328476905823, 0.2518167197704315, -0.7589367032051086, 1.9306716918945312, 1.679197907447815, 1.270687222480774, -0.22416648268699646, -0.8034568428993225, 0.6671223044395447, -0.38070887327194214, -0.4605635702610016, 0.7166867852210999, 0.32288503646850586, -0.23451751470565796, -1.445146083831787, 0.7211039066314697, 1.1724423170089722, -0.9073219299316406, -0.8049536943435669, 0.2645699381828308, -0.8277426958084106, 1.1207250356674194, 0.7534492611885071, 0.43449634313583374, 0.22384218871593475, 1.770803451538086, 0.8277978897094727, -0.5148362517356873, 0.5741256475448608, 0.6019452214241028, -0.21132834255695343, -2.1312434673309326, -1.2499688863754272, 0.15653711557388306, -0.5009317398071289, -1.6703803539276123, 1.283846139907837, -1.066731572151184, -0.8875505924224854, 0.5498026013374329, 0.09050960093736649, 1.3029848337173462, 0.4386071264743805, 1.3812048435211182, 2.0297772884368896, 0.7557095289230347, 0.508176863193512, 1.2080610990524292, -0.18760643899440765, -0.4192383587360382, 1.8911958932876587, -0.334767609834671, 0.6496037244796753, 1.042941927909851, -0.31267309188842773, -1.0690784454345703, -0.666793167591095, -1.3121654987335205, -0.6702253818511963, 1.1172219514846802, 0.054775528609752655, -1.168107032775879, 0.28160300850868225, 1.5067321062088013, 0.004873599857091904, -0.43494972586631775, 0.7222462892532349, 0.4646424949169159, -0.8343160152435303, -0.05477886646986008, -0.852583110332489, 0.49595922231674194, -0.20503203570842743, -0.2254990190267563, 0.3915296494960785, 0.47682806849479675, 1.4779051542282104, 0.0023633139207959175, 0.28208449482917786, 0.989058792591095, -1.4254472255706787, 1.5900195837020874, -0.7809470295906067, 0.28000009059906006, -2.3381059169769287, 1.271091341972351, -0.7293258905410767, 2.105875015258789, -2.7352235317230225, 0.49040287733078003, -0.5448870658874512, -0.5219646692276001, 0.25413262844085693, -0.36240407824516296, 0.08183645457029343, -0.014054653234779835, -1.2095844745635986, 0.13733284175395966, -0.5896158218383789, 0.48691385984420776, 1.1005679368972778, 1.354830265045166, -1.1764603853225708, -0.3006136119365692, -1.718981146812439, -0.14827311038970947, -0.7320050597190857, 0.2651197612285614, -2.0871522426605225, -0.29835188388824463, -1.7867100238800049, -2.335706949234009, -1.255629539489746, -0.7716183662414551, 1.2298532724380493, -0.021606475114822388, -0.9559575319290161, 1.470201849937439, -0.2884046733379364, -1.8488291501998901, 1.019766092300415, -2.105395555496216 ]
https://github.com/huggingface/datasets/issues/3634
Dataset.shuffle(seed=None) gives fixed row permutation
Hi! Thanks for reporting! Yes, this is not expected behavior. I've opened a PR with the fix.
## Describe the bug Repeated attempts to `shuffle` a dataset without specifying a seed give the same results. ## Steps to reproduce the bug ```python import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` ## Expected results I assumed that the default setting would initialize a new/random state of a `np.random.BitGenerator` (see [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=shuffle#datasets.Dataset.shuffle)). Wouldn't that reshuffle the rows each time I call `data.shuffle()`? ## Actual results ```bash Shuffle dataset {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} Shuffle via pandas {'feature': [4, 2, 3, 1, 5], 'label': ['d', 'b', 'c', 'a', 'e']} {'feature': [2, 5, 3, 4, 1], 'label': ['b', 'e', 'c', 'd', 'a']} {'feature': [5, 2, 3, 1, 4], 'label': ['e', 'b', 'c', 'a', 'd']} ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-5.13.0-27-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 6.0.1
983
17
Dataset.shuffle(seed=None) gives fixed row permutation ## Describe the bug Repeated attempts to `shuffle` a dataset without specifying a seed give the same results. ## Steps to reproduce the bug ```python import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` ## Expected results I assumed that the default setting would initialize a new/random state of a `np.random.BitGenerator` (see [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=shuffle#datasets.Dataset.shuffle)). Wouldn't that reshuffle the rows each time I call `data.shuffle()`? ## Actual results ```bash Shuffle dataset {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} Shuffle via pandas {'feature': [4, 2, 3, 1, 5], 'label': ['d', 'b', 'c', 'a', 'e']} {'feature': [2, 5, 3, 4, 1], 'label': ['b', 'e', 'c', 'd', 'a']} {'feature': [5, 2, 3, 1, 4], 'label': ['e', 'b', 'c', 'a', 'd']} ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-5.13.0-27-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 6.0.1 Hi! Thanks for reporting! Yes, this is not expected behavior. I've opened a PR with the fix.
[ -1.2027478218078613, -0.9850239753723145, -0.8426291942596436, 1.5853625535964966, -0.17829139530658722, -1.144905686378479, 0.027265725657343864, -1.0506383180618286, 1.6484477519989014, -0.6523365378379822, 0.09356063604354858, -1.7013888359069824, -0.06106358766555786, -0.7257154583930969, -0.6672883629798889, -0.869242787361145, -0.25720736384391785, -0.7927384972572327, 1.1071012020111084, 2.457977056503296, 1.0428855419158936, -1.4840631484985352, 2.6904914379119873, 0.7689693570137024, -0.0688672736287117, -1.040507197380066, 0.5966792702674866, -0.08514317125082016, -1.1909923553466797, -0.45391958951950073, -1.0341832637786865, -0.06214957684278488, -0.6168980002403259, -0.4924125075340271, -0.08345461636781693, 0.4951717257499695, -0.3388653099536896, -0.4941442310810089, -0.5522199273109436, -0.771803617477417, 0.37362730503082275, -0.4101693630218506, 0.9827365875244141, -0.21912246942520142, 1.760561466217041, -0.39788365364074707, 0.3650769591331482, 0.628996729850769, 1.3568896055221558, 0.21863725781440735, 0.15344084799289703, 0.42191192507743835, 0.38438355922698975, -0.008238296024501324, 0.6083023548126221, 1.1559370756149292, 0.6885864734649658, 0.41446128487586975, 0.9052733182907104, -2.3432130813598633, 1.1599243879318237, -1.1698594093322754, 0.37659165263175964, 1.3764426708221436, -0.8055191040039062, 0.4391515552997589, -1.7189208269119263, 0.068687304854393, 0.6904436349868774, -2.1372780799865723, 0.372691810131073, -1.2821190357208252, -0.41910529136657715, 0.9607100486755371, 0.48674678802490234, -1.2486307621002197, 0.1457797735929489, -0.3983977735042572, 1.0252894163131714, 0.3761633336544037, 1.0323494672775269, -1.6882625818252563, 0.09740152955055237, -0.25037792325019836, 0.09389486163854599, -1.1886605024337769, -1.5327250957489014, 0.5611794590950012, 0.5829719305038452, 0.6493719220161438, -0.13532768189907074, 0.9798920750617981, -1.1387897729873657, 0.5425660014152527, -1.0260506868362427, -1.7844281196594238, -1.453007698059082, -2.2929153442382812, -2.2942311763763428, 0.6784314513206482, -0.43588218092918396, -0.5060495734214783, 2.0450551509857178, -0.8377869129180908, -1.6964178085327148, 1.217308521270752, 0.45000195503234863, 0.07996112108230591, 2.5087661743164062, 0.19487906992435455, -0.7537073493003845, 0.5700538158416748, -0.8862690925598145, 0.7820252776145935, -0.4019380509853363, 1.4053552150726318, 0.38143470883369446, -0.8486970067024231, 1.7186824083328247, -0.4181620478630066, 0.5527417063713074, -0.6321273446083069, -0.4098011553287506, -0.7568954825401306, 0.3448311686515808, 1.9081897735595703, -0.21275825798511505, 1.4100896120071411, -0.4107515811920166, -1.5465697050094604, -1.5514869689941406, 0.9152252674102783, 0.3180091679096222, -0.9351732730865479, 0.07506877183914185, -0.4084171652793884, 0.22413237392902374, -0.1717260330915451, 1.3101876974105835, 1.2890074253082275, 0.6212308406829834, -0.3578004837036133, -0.9722316265106201, 0.14348365366458893, -0.17375808954238892, -0.8203666806221008, -1.718309998512268, -0.30600330233573914, 0.09644447267055511, 0.6722708940505981, -1.2377768754959106, 1.7080951929092407, 0.8040940761566162, 1.8765846490859985, 0.9671685695648193, -0.5200857520103455, 1.5206220149993896, 0.15174980461597443, 1.7803553342819214, -0.6624228954315186, 0.576121985912323, -0.40498456358909607, -1.156876564025879, 0.9170974493026733, -0.34166470170021057, -1.9956552982330322, -0.7706634998321533, -0.8442538976669312, -0.26009076833724976, -0.7778388857841492, 0.8920508027076721, -0.39852818846702576, -1.427286982536316, 0.30719757080078125, -0.831377387046814, 0.14997598528862, -1.1744450330734253, 0.23811550438404083, 0.7273319959640503, -0.5462007522583008, 0.1252046376466751, -0.20238204300403595, -1.376065969467163, -0.38425910472869873, 0.4271897077560425, 1.9370163679122925, -0.7601563930511475, 0.7689212560653687, 1.0657309293746948, -0.6993778347969055, -0.008597210980951786, 0.2714066803455353, -0.22858363389968872, 0.8258752226829529, -0.9639033675193787, -0.7383837103843689, 1.2210427522659302, -0.23460347950458527, -0.6009925603866577, 1.374183177947998, 0.7669705152511597, -1.0298837423324585, -0.23531010746955872, -0.13850858807563782, -0.8219053745269775, 0.053035520017147064, -1.601953387260437, -0.13278600573539734, 0.5720393061637878, -1.5809754133224487, -0.5392161011695862, -0.26546579599380493, 1.218254804611206, -0.1041264533996582, 1.309666633605957, -0.31711727380752563, -0.11134909838438034, -0.2705114781856537, -0.47025951743125916, 0.20588232576847076, -0.3218876123428345, -0.5949971079826355, 0.10657503455877304, -0.8272674679756165, 0.414374977350235, 1.3970104455947876, 0.3178020119667053, 0.03353176265954971, 0.5593878626823425, 1.1336748600006104, 0.5356203317642212, 0.12357998639345169, -0.8425074219703674, -1.453641653060913, 1.9701045751571655, -1.5236870050430298, 1.8954299688339233, 0.6510457992553711, -0.01158755924552679, -1.7725965976715088, -1.8902961015701294, 1.3825664520263672, 1.1533141136169434, 2.2383832931518555, 0.5952703356742859, 0.4339529573917389, -0.8554482460021973, -0.6174194812774658, 0.18528637290000916, -0.8409154415130615, -0.6591248512268066, 0.17004746198654175, 2.4253854751586914, 1.833988070487976, -0.4317640960216522, -0.17396605014801025, -0.9397380352020264, 1.5607621669769287, -0.31144383549690247, 0.3412323594093323, 2.009483575820923, -0.3180587887763977, -1.0340436697006226, 1.3727706670761108, -2.506140947341919, 0.13649697601795197, 2.0087296962738037, 0.27472740411758423, 0.19672390818595886, -1.4073569774627686, -0.7214491963386536, -0.34806108474731445, -0.4298110008239746, -1.2648204565048218, 0.5525278449058533, -0.21434609591960907, -0.7954612970352173, -1.498732566833496, 0.205153688788414, -1.1750816106796265, -1.5997273921966553, 0.1329279989004135, 1.9549096822738647, 2.1537766456604004, -0.8064053654670715, 1.6521885395050049, -0.21074673533439636, 0.23343059420585632, 1.2658686637878418, 1.165868878364563, 3.028795003890991, 1.8387995958328247, -1.1382274627685547, 0.6173235774040222, -0.16209538280963898, -0.5051411986351013, 1.1733049154281616, -1.1823008060455322, 1.1875149011611938, -0.10017775744199753, -1.1009490489959717, -1.2129194736480713, 0.8785483837127686, 0.46849319338798523, -0.050421424210071564, -0.47246819734573364, 1.1999870538711548, -0.05595345050096512, 1.216972827911377, 0.6459949612617493, -0.39526239037513733, 0.45009517669677734, -0.34786155819892883, -0.5473735332489014, 1.4817509651184082, 0.11394677311182022, -1.4880449771881104, -2.192829132080078, -0.19201228022575378, -0.7927535176277161, 0.0038545364513993263, -0.5866337418556213, -1.0536772012710571, 1.660463571548462, 0.29163166880607605, -1.0994858741760254, -0.2577934265136719, -0.34714123606681824, -0.46952077746391296, 2.7494418621063232, -1.3157869577407837, -0.45054876804351807, -0.9771263003349304, -0.573137640953064, 1.6766890287399292, -1.0687284469604492, -0.1910528838634491, -1.0768049955368042, -0.5766167044639587, -1.3321741819381714, -0.5575454831123352, 0.03558077663183212, -0.9735773801803589, 0.9316545128822327, 0.28552696108818054, -1.18160080909729, -0.30885687470436096, -0.936836302280426, 0.9684805274009705, -0.22029443085193634, 0.176992267370224, 1.9485143423080444, 0.3222794234752655, -0.40311697125434875, 0.8627122640609741, 1.1980605125427246, 0.6725000739097595, -0.6056346893310547, 0.1539829522371292, -0.5568241477012634, 0.4864893853664398, -1.3809995651245117, 0.19943544268608093, -2.8877973556518555, 0.5183447003364563, -0.06869594007730484, -0.08792844414710999, 0.12342818826436996, -1.2899888753890991, 1.1041686534881592, 2.4690425395965576, -1.2826400995254517, 0.5024694800376892, 0.2552028000354767, 1.4039509296417236, -1.6844899654388428, 0.28132280707359314, -0.4239630699157715, 2.110945224761963, 0.10908966511487961, 1.1057026386260986, -0.3995947539806366, -2.3907535076141357, 0.6047439575195312, -1.339608073234558, -1.0967750549316406, 0.6191752552986145, -0.949665367603302, 0.23442868888378143, -1.6273646354675293, -0.23223930597305298, -0.8321203589439392, -1.2027230262756348, 0.7062541246414185, 0.2173343449831009, 0.28239956498146057, -0.537087619304657, 0.4054957330226898, -2.146214723587036, -1.4706519842147827, -0.17289434373378754, -0.9069441556930542, 0.5918384790420532, -0.36087799072265625, 0.7021045088768005, -0.15307410061359406, -0.06463776528835297, 0.2521042823791504, 1.4948176145553589, 3.494410753250122, 0.14225390553474426, 0.3621062934398651, -0.16934306919574738, -0.9432679414749146, 1.405328392982483, 1.0108883380889893, -0.14764650166034698, -0.49972814321517944, -1.1227058172225952, 1.467691421508789, 1.9854415655136108, 0.9209309816360474, 0.012785853818058968, -0.7228732109069824, -0.6832807064056396, -0.04089072346687317, 0.2665509283542633, 0.44264787435531616, 0.8079368472099304, 0.06672979891300201, -0.01918226107954979, 1.482689380645752, 1.1830425262451172, -0.2912008464336395, 0.2979688346385956, -0.9353402256965637, -0.45286473631858826, 0.5964691638946533, 0.1465446799993515, -0.05676329880952835, 0.3788291811943054, -1.1047974824905396, -0.30461540818214417, -0.3279343545436859, -0.8305020332336426, -0.6166424751281738, -0.3637184202671051, -0.24431079626083374, 1.5334131717681885, 0.30706942081451416, -0.6296212673187256, -0.04220759868621826, -0.6804234385490417, -0.08814273774623871, -1.0219846963882446, 0.11348859965801239, -0.20294134318828583, -0.19108416140079498, -0.2438177466392517, 1.7411484718322754, -0.8174925446510315, -1.9938451051712036, -0.017873937264084816, 0.432028591632843, -0.12459087371826172, 0.26956284046173096, 1.622824788093567, 0.5946660041809082, 1.4462857246398926, 1.3089340925216675, 0.9230803847312927, -0.590895414352417, -1.3333728313446045, 0.6670123338699341, 1.0509260892868042, -1.25721275806427, 0.8999046087265015, -0.044412173330783844, -0.5754315853118896, 0.591562807559967, 1.3544093370437622, 0.38252460956573486, -1.9684510231018066, 0.7812802791595459, -1.0200278759002686, 0.9225218892097473, 0.7564151287078857, 0.7682754993438721, 0.29317739605903625, 0.7342533469200134, -1.2364684343338013, -1.169651746749878, -0.8393371105194092, -0.7544728517532349, 2.0007457733154297, -0.3010682165622711, 0.6275573372840881, -0.22295813262462616, -1.317624807357788, -0.1310672163963318, 0.5926023125648499, 0.40422260761260986, -0.5330566763877869, 0.8842213749885559, -0.6827632784843445, -1.1259318590164185, -1.3239115476608276, -0.44160571694374084, -1.001908779144287, -0.9877004027366638, 1.0263618230819702, 0.8037208318710327, 0.30945783853530884, 1.8109318017959595, 0.5973926782608032, 0.18527230620384216, -2.4863393306732178, 0.937535285949707, 0.34674859046936035, -0.1556154042482376, 0.6944962739944458, 0.39792513847351074, 1.1920067071914673, -0.04145066440105438, 0.5318114161491394, -2.269291639328003, 2.1758921146392822, -0.11659768223762512, 0.7916720509529114, -0.05609792470932007, -0.008175384253263474, 1.0131758451461792, 0.5106115341186523, 0.5550148487091064, -0.9090742468833923, 0.5726118683815002, -0.5380112528800964, 1.3161944150924683, 1.0646281242370605, -0.6904686093330383, -0.06308268755674362, 1.4143809080123901, 0.5061217546463013, -0.6741029620170593, -0.9994091391563416, -0.8499894738197327, 0.9853264689445496, 1.6977287530899048, -0.10960256308317184, -0.057664625346660614, 0.8646607995033264, 0.5637720823287964, -1.256563425064087, 0.007256653159856796, -0.6389970779418945, -0.5625125169754028, 1.7938917875289917, 2.106156349182129, -0.3955633044242859, -0.11275256425142288, -0.6844910979270935, -1.3661705255508423, 0.5803123712539673, -0.07995465397834778, 0.07572568207979202, 0.7325646281242371, -0.6893892884254456, 0.9922799468040466, 0.7176045775413513, 0.7853760719299316, 0.15531820058822632, 0.316283643245697, 0.43439966440200806, -0.41614818572998047, -1.1571463346481323, -0.3115007281303406, -1.1407380104064941, -2.5032196044921875, 0.3790138065814972, -0.10085336118936539, -1.3544753789901733, 0.04915387183427811, -0.9972333312034607, 1.1946027278900146, -0.5093771815299988, -1.1144732236862183, -1.3771514892578125, 0.3182785212993622, 0.10814283788204193, 0.8756378293037415, -1.6797535419464111, -0.07401356846094131, 1.2704596519470215, 0.9657828211784363, -0.7646998167037964, 0.9991578459739685, 0.3520015478134155, 1.1727278232574463, 0.7326361536979675, -0.36164167523384094, 0.565434992313385, -0.1155037134885788, -1.2760868072509766, 0.4798758327960968, 1.1452240943908691, 0.13248059153556824, 1.424686074256897, -0.48931968212127686, -0.14286160469055176, 0.4216919243335724, -0.5991042852401733, -0.41596174240112305, -0.41166579723358154, 0.5196923017501831, 0.11749885231256485, -0.7830802202224731, -0.12271010130643845, 0.08648931980133057, -0.36629730463027954, 0.13541975617408752, -1.5017850399017334, -0.21681979298591614, -0.3897079825401306, -0.4958266019821167, -1.2512837648391724, -0.07521321624517441, 1.332988977432251, -0.6980776190757751, -0.3094165623188019, 0.5737336277961731, 0.31825175881385803, 0.44878843426704407, 0.6160010099411011, -0.6607797145843506, -0.3344722092151642, -0.16579142212867737, -0.3559885621070862, 0.1826964169740677, 1.4243497848510742, -0.19780290126800537, -1.015480637550354, 0.6366184949874878, -0.3939228951931, -0.03643346577882767, 1.7478076219558716, -0.04135289043188095, -0.9167328476905823, 0.2518167197704315, -0.7589367032051086, 1.9306716918945312, 1.679197907447815, 1.270687222480774, -0.22416648268699646, -0.8034568428993225, 0.6671223044395447, -0.38070887327194214, -0.4605635702610016, 0.7166867852210999, 0.32288503646850586, -0.23451751470565796, -1.445146083831787, 0.7211039066314697, 1.1724423170089722, -0.9073219299316406, -0.8049536943435669, 0.2645699381828308, -0.8277426958084106, 1.1207250356674194, 0.7534492611885071, 0.43449634313583374, 0.22384218871593475, 1.770803451538086, 0.8277978897094727, -0.5148362517356873, 0.5741256475448608, 0.6019452214241028, -0.21132834255695343, -2.1312434673309326, -1.2499688863754272, 0.15653711557388306, -0.5009317398071289, -1.6703803539276123, 1.283846139907837, -1.066731572151184, -0.8875505924224854, 0.5498026013374329, 0.09050960093736649, 1.3029848337173462, 0.4386071264743805, 1.3812048435211182, 2.0297772884368896, 0.7557095289230347, 0.508176863193512, 1.2080610990524292, -0.18760643899440765, -0.4192383587360382, 1.8911958932876587, -0.334767609834671, 0.6496037244796753, 1.042941927909851, -0.31267309188842773, -1.0690784454345703, -0.666793167591095, -1.3121654987335205, -0.6702253818511963, 1.1172219514846802, 0.054775528609752655, -1.168107032775879, 0.28160300850868225, 1.5067321062088013, 0.004873599857091904, -0.43494972586631775, 0.7222462892532349, 0.4646424949169159, -0.8343160152435303, -0.05477886646986008, -0.852583110332489, 0.49595922231674194, -0.20503203570842743, -0.2254990190267563, 0.3915296494960785, 0.47682806849479675, 1.4779051542282104, 0.0023633139207959175, 0.28208449482917786, 0.989058792591095, -1.4254472255706787, 1.5900195837020874, -0.7809470295906067, 0.28000009059906006, -2.3381059169769287, 1.271091341972351, -0.7293258905410767, 2.105875015258789, -2.7352235317230225, 0.49040287733078003, -0.5448870658874512, -0.5219646692276001, 0.25413262844085693, -0.36240407824516296, 0.08183645457029343, -0.014054653234779835, -1.2095844745635986, 0.13733284175395966, -0.5896158218383789, 0.48691385984420776, 1.1005679368972778, 1.354830265045166, -1.1764603853225708, -0.3006136119365692, -1.718981146812439, -0.14827311038970947, -0.7320050597190857, 0.2651197612285614, -2.0871522426605225, -0.29835188388824463, -1.7867100238800049, -2.335706949234009, -1.255629539489746, -0.7716183662414551, 1.2298532724380493, -0.021606475114822388, -0.9559575319290161, 1.470201849937439, -0.2884046733379364, -1.8488291501998901, 1.019766092300415, -2.105395555496216 ]
https://github.com/huggingface/datasets/issues/3632
Adding CC-100: Monolingual Datasets from Web Crawl Data (Datasets links are invalid)
Hi @AnzorGozalishvili, Maybe their site was temporarily down, but it seems to work fine now. Could you please try again and confirm if the problem persists?
## Describe the bug The dataset links are no longer valid for CC-100. It seems that the website which was keeping these files are no longer accessible and therefore this dataset became unusable. Check out the dataset [homepage](http://data.statmt.org/cc-100/) which isn't accessible. Also the URLs for dataset file per language isn't accessible: http://data.statmt.org/cc-100/<language code here>.txt.xz (language codes: am, sr, ka, etc.) ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("cc100", "ka") ``` It throws 503 error. ## Expected results It should successfully download and load dataset but it throws an exception because the dataset files are no longer accessible. ## Environment info Run from google colab. Just installed the library using pip: ```!pip install -U datasets```
984
26
Adding CC-100: Monolingual Datasets from Web Crawl Data (Datasets links are invalid) ## Describe the bug The dataset links are no longer valid for CC-100. It seems that the website which was keeping these files are no longer accessible and therefore this dataset became unusable. Check out the dataset [homepage](http://data.statmt.org/cc-100/) which isn't accessible. Also the URLs for dataset file per language isn't accessible: http://data.statmt.org/cc-100/<language code here>.txt.xz (language codes: am, sr, ka, etc.) ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("cc100", "ka") ``` It throws 503 error. ## Expected results It should successfully download and load dataset but it throws an exception because the dataset files are no longer accessible. ## Environment info Run from google colab. Just installed the library using pip: ```!pip install -U datasets``` Hi @AnzorGozalishvili, Maybe their site was temporarily down, but it seems to work fine now. Could you please try again and confirm if the problem persists?
[ -1.1981393098831177, -0.8024134039878845, -0.7469552755355835, 1.3958330154418945, -0.21643629670143127, -1.1875437498092651, 0.11261772364377975, -1.05171537399292, 1.6886485815048218, -0.820061206817627, 0.18727056682109833, -1.7201366424560547, 0.04015783220529556, -0.5359641313552856, -0.7778015732765198, -0.9266380667686462, -0.41486209630966187, -0.7484139800071716, 1.0219308137893677, 2.4889612197875977, 1.1780325174331665, -1.3612321615219116, 2.6962525844573975, 0.642417848110199, -0.14996786415576935, -1.0384433269500732, 0.4955563545227051, 0.02728043869137764, -1.296884536743164, -0.386682391166687, -0.9838416576385498, -0.09674639254808426, -0.5684714317321777, -0.6156404614448547, 0.022341281175613403, 0.3135262429714203, -0.3415909707546234, -0.459265798330307, -0.5688521265983582, -0.7868903875350952, 0.5433893799781799, -0.3094192445278168, 0.9751569032669067, -0.39828380942344666, 1.8909498453140259, -0.521539032459259, 0.4411489963531494, 0.6095873713493347, 1.3486640453338623, 0.2346690595149994, 0.034887947142124176, 0.3278529942035675, 0.3962990641593933, 0.12371531873941422, 0.37451669573783875, 1.0918958187103271, 0.6304388046264648, 0.5185748338699341, 0.6313418745994568, -2.1808133125305176, 1.2241326570510864, -0.9846605658531189, 0.2870248854160309, 1.3716334104537964, -0.9236146807670593, 0.3397761881351471, -1.7612751722335815, -0.08708072453737259, 0.5643348693847656, -2.238633632659912, 0.21214833855628967, -1.2843819856643677, -0.5094132423400879, 1.0493746995925903, 0.37629610300064087, -1.1760977506637573, 0.17678233981132507, -0.4297817647457123, 1.0391478538513184, 0.4567692279815674, 1.1609508991241455, -1.6516581773757935, -0.007464531809091568, -0.3400364816188812, 0.05029461160302162, -1.2728508710861206, -1.5692834854125977, 0.56517094373703, 0.7218539714813232, 0.6485576033592224, -0.14713320136070251, 0.9661916494369507, -0.938349187374115, 0.7425245046615601, -1.0425692796707153, -1.74631667137146, -1.3819506168365479, -2.20560622215271, -2.4132635593414307, 0.7759963870048523, -0.4509431719779968, -0.5106184482574463, 2.084003448486328, -0.990857720375061, -1.8384653329849243, 1.146064043045044, 0.251893013715744, 0.0025994833558797836, 2.323378801345825, 0.15218079090118408, -0.6886982917785645, 0.4762348532676697, -0.6781232357025146, 0.787850022315979, -0.3757086992263794, 1.4384891986846924, 0.4950188994407654, -0.9845544099807739, 1.6250314712524414, -0.37406447529792786, 0.5729638934135437, -0.6693068146705627, -0.559065580368042, -0.8604816794395447, 0.30452367663383484, 1.9738694429397583, -0.32818880677223206, 1.6283503770828247, -0.3143915832042694, -1.6328343152999878, -1.5894166231155396, 0.9082682728767395, 0.5172737240791321, -0.7870198488235474, 0.1243477538228035, -0.25898292660713196, 0.06393475830554962, -0.011215374805033207, 1.1117265224456787, 1.1448417901992798, 0.8217984437942505, -0.27928978204727173, -0.8605650067329407, 0.310199111700058, -0.0287991501390934, -0.7244095206260681, -1.7466683387756348, -0.355888694524765, 0.11383311450481415, 0.5760486125946045, -1.2492690086364746, 1.7029469013214111, 0.8582438230514526, 1.988492488861084, 1.0361977815628052, -0.36604446172714233, 1.4919332265853882, 0.08798292279243469, 1.942785382270813, -0.4924710690975189, 0.7194035053253174, -0.3278084993362427, -1.1749181747436523, 0.7647746205329895, -0.3433324694633484, -2.061556339263916, -0.7580556273460388, -0.965761661529541, -0.1468214988708496, -0.7673341631889343, 0.9488165974617004, -0.24386343359947205, -1.4365813732147217, 0.22110967338085175, -0.6401852965354919, 0.15073132514953613, -1.2811039686203003, 0.32120680809020996, 0.7462591528892517, -0.6606966853141785, -0.021270792931318283, -0.23120270669460297, -1.3667094707489014, -0.46571943163871765, 0.2405293583869934, 1.9024267196655273, -0.7987886667251587, 0.9946069121360779, 0.9707831740379333, -0.7849328517913818, 0.00992556568235159, 0.30896684527397156, -0.270106703042984, 0.853264331817627, -1.0846681594848633, -0.38727813959121704, 1.265136480331421, -0.1924869418144226, -0.5394362807273865, 1.4578136205673218, 0.639957845211029, -1.0100270509719849, -0.1513705998659134, -0.15093377232551575, -0.7996214628219604, 0.0087038679048419, -1.6261608600616455, -0.12266745418310165, 0.2977787256240845, -1.478987216949463, -0.5063609480857849, -0.1966307908296585, 1.2471065521240234, -0.18545010685920715, 1.4140537977218628, -0.42433300614356995, -0.26602861285209656, -0.4324378967285156, -0.4139026701450348, 0.14186608791351318, -0.19869017601013184, -0.675405740737915, 0.2428070604801178, -0.8467510938644409, 0.32092151045799255, 1.3885438442230225, 0.338023841381073, 0.026736289262771606, 0.5426377058029175, 1.10100257396698, 0.3519200086593628, -0.09692071378231049, -0.940817654132843, -1.6069260835647583, 1.967711329460144, -1.4565585851669312, 1.8900777101516724, 0.6526452898979187, -0.09492450952529907, -1.7336012125015259, -1.8832106590270996, 1.3183014392852783, 1.1495181322097778, 2.3313491344451904, 0.6227368116378784, 0.4408034086227417, -0.8096465468406677, -0.6514391899108887, 0.37420982122421265, -0.9797901511192322, -0.7059832811355591, 0.10452458262443542, 2.339771032333374, 1.7094649076461792, -0.5377901196479797, -0.2717832326889038, -1.000097632408142, 1.2572343349456787, -0.23023107647895813, 0.2537706196308136, 1.9805071353912354, -0.30478599667549133, -1.1435813903808594, 1.2715022563934326, -2.3069217205047607, 0.17749592661857605, 1.992954969406128, 0.2877141535282135, 0.08994292467832565, -1.4071991443634033, -0.6815261244773865, -0.2546444833278656, -0.46176910400390625, -1.2890827655792236, 0.5456521511077881, -0.2792966067790985, -0.7447019815444946, -1.4153869152069092, 0.17700150609016418, -1.121024489402771, -1.7045104503631592, 0.2564484775066376, 1.885670781135559, 1.9706156253814697, -0.6951065063476562, 1.439803123474121, -0.32907211780548096, 0.22093431651592255, 1.319040060043335, 1.1490451097488403, 3.150787591934204, 1.9645487070083618, -1.2920050621032715, 0.7817193269729614, -0.09209080040454865, -0.46904775500297546, 1.2254853248596191, -1.096985101699829, 1.2348164319992065, -0.24508081376552582, -1.2797393798828125, -1.2579641342163086, 0.9250599145889282, 0.4028330147266388, 0.1078353077173233, -0.4948042035102844, 1.3020522594451904, -0.044223297387361526, 1.2802653312683105, 0.559699535369873, -0.4624306857585907, 0.6671962141990662, -0.39482858777046204, -0.4690890610218048, 1.5943102836608887, 0.23233088850975037, -1.4034173488616943, -2.3368144035339355, -0.30944231152534485, -0.8148124814033508, 0.011491107754409313, -0.5765548348426819, -0.9893965125083923, 1.6309858560562134, 0.44874143600463867, -1.213086724281311, -0.2728825509548187, -0.376327246427536, -0.699553906917572, 2.727943181991577, -1.4715250730514526, -0.21470005810260773, -1.039257526397705, -0.5848912596702576, 1.618658423423767, -1.1503208875656128, -0.1986074298620224, -0.9865611791610718, -0.669745683670044, -1.425319790840149, -0.5982295870780945, -0.012755087576806545, -0.8673770427703857, 0.7632443308830261, 0.18211452662944794, -1.145021915435791, -0.25651559233665466, -0.8488559126853943, 0.8797930479049683, -0.08759906142950058, 0.2623405158519745, 1.9421285390853882, 0.4661370515823364, -0.3651120066642761, 0.6695905923843384, 1.2172129154205322, 0.7034479379653931, -0.694935142993927, 0.2346208244562149, -0.792675256729126, 0.22598765790462494, -1.3843525648117065, 0.22897855937480927, -2.849318027496338, 0.7289643287658691, -0.12183113396167755, -0.07530602067708969, 0.004911612719297409, -1.2674459218978882, 1.019566535949707, 2.6016831398010254, -1.2816202640533447, 0.4184925854206085, 0.35138586163520813, 1.1974793672561646, -1.5886327028274536, 0.31774890422821045, -0.4321599304676056, 2.175153970718384, 0.20490126311779022, 1.185964584350586, -0.4758824110031128, -2.2946903705596924, 0.6485626101493835, -1.311446189880371, -1.2371914386749268, 0.8079363703727722, -0.8237890601158142, 0.07803560793399811, -1.4741735458374023, -0.15208908915519714, -0.8555853366851807, -1.2824175357818604, 0.793290376663208, 0.08422476053237915, 0.4130423665046692, -0.49187010526657104, 0.35623598098754883, -2.1332952976226807, -1.3884025812149048, -0.27249714732170105, -1.009576439857483, 0.40835803747177124, -0.28610289096832275, 0.7326520085334778, -0.2212413251399994, 0.061092086136341095, 0.4320715665817261, 1.3728166818618774, 3.352259874343872, 0.20805558562278748, 0.3165909945964813, -0.13257350027561188, -1.0200059413909912, 1.4047564268112183, 0.987472414970398, -0.1837536245584488, -0.5094257593154907, -0.9285510778427124, 1.1970025300979614, 1.976115107536316, 0.9911110997200012, 0.07206151634454727, -0.7664793133735657, -0.6435495018959045, 0.06060628592967987, 0.20134523510932922, 0.5066664814949036, 0.8787387609481812, 0.10043692588806152, 0.16572387516498566, 1.399507761001587, 1.2057929039001465, -0.272063285112381, 0.33602359890937805, -0.8057827949523926, -0.5509668588638306, 0.6031551957130432, 0.3410368859767914, 0.0808091089129448, 0.4144784212112427, -1.0230705738067627, -0.2619386315345764, -0.35757318139076233, -0.9806774258613586, -0.682858943939209, -0.49995601177215576, -0.42739391326904297, 1.6355786323547363, 0.07062753289937973, -0.5465190410614014, -0.08493374288082123, -0.7999167442321777, -0.0830596536397934, -1.037635087966919, 0.3252885639667511, -0.06660907715559006, -0.10712379217147827, -0.007942107506096363, 1.7565906047821045, -1.055693507194519, -2.078721761703491, 0.2435571849346161, 0.2610085606575012, -0.3609498143196106, 0.13027451932430267, 1.6441478729248047, 0.5760608911514282, 1.4711498022079468, 1.3391062021255493, 1.0010613203048706, -0.596083402633667, -1.3419054746627808, 0.7228566408157349, 0.9714328646659851, -1.3910143375396729, 0.7748783826828003, 0.041872963309288025, -0.5413490533828735, 0.6149851679801941, 1.29531729221344, 0.43150267004966736, -1.9254156351089478, 0.7733145356178284, -0.8683956265449524, 0.702809751033783, 0.6575273275375366, 0.7835403680801392, 0.11685965210199356, 0.8244619369506836, -1.319172739982605, -1.073817491531372, -0.6767377257347107, -0.5235308408737183, 1.9435594081878662, -0.18261116743087769, 0.5093545317649841, -0.22336333990097046, -1.2293612957000732, 0.01505060400813818, 0.70863938331604, 0.32862532138824463, -0.4755089581012726, 0.8517441749572754, -0.6129364371299744, -1.0744105577468872, -1.4180846214294434, -0.4571315348148346, -0.9741992950439453, -0.8953570127487183, 1.0839954614639282, 0.8512780070304871, 0.27432605624198914, 1.7848433256149292, 0.6150197982788086, 0.19386108219623566, -2.7815182209014893, 0.8740292191505432, 0.13599903881549835, -0.11250797659158707, 0.8610258102416992, 0.23761895298957825, 0.9662115573883057, -0.11701217293739319, 0.5862606167793274, -2.299170970916748, 2.2466766834259033, -0.323916494846344, 0.6212192177772522, 0.012375361286103725, -0.06080571562051773, 1.1266762018203735, 0.5330989360809326, 0.5252873301506042, -1.1260918378829956, 0.710695207118988, -0.6387630701065063, 1.2045267820358276, 1.0022920370101929, -0.8694751858711243, -0.0034190467558801174, 1.3215882778167725, 0.5592788457870483, -0.4865364134311676, -0.9331971406936646, -0.8781854510307312, 0.9843893647193909, 1.6507117748260498, -0.06734392791986465, -0.025185007601976395, 0.9041902422904968, 0.6530745029449463, -1.325047254562378, 0.18811452388763428, -0.6614382266998291, -0.7144185304641724, 1.6308488845825195, 2.006540536880493, -0.010409103706479073, -0.21667389571666718, -0.725021481513977, -1.245036005973816, 0.7490063309669495, 0.025664780288934708, 0.1051340326666832, 0.7138445973396301, -0.6473835110664368, 1.0621492862701416, 0.9113296866416931, 0.8838822245597839, 0.16331197321414948, 0.3276403546333313, 0.3589423596858978, -0.285676509141922, -1.1931264400482178, -0.1596851497888565, -0.9954425096511841, -2.532947301864624, 0.5513879060745239, -0.2395918220281601, -1.450609564781189, 0.0925261601805687, -1.0607680082321167, 0.8968319296836853, -0.5756205320358276, -1.0853723287582397, -1.548539638519287, 0.17304569482803345, -0.036766260862350464, 0.9265588521957397, -1.5943673849105835, -0.05904001370072365, 1.2512447834014893, 0.9204378128051758, -0.6630694270133972, 1.0097075700759888, 0.23325085639953613, 1.0815961360931396, 0.8857681751251221, -0.428256630897522, 0.5510448217391968, 0.15724816918373108, -1.341083288192749, 0.5450888872146606, 1.1095508337020874, 0.2084771990776062, 1.4289181232452393, -0.5645117163658142, 0.06940384954214096, 0.4732535779476166, -0.5508643388748169, -0.46804118156433105, -0.6196239590644836, 0.6931000351905823, 0.15110039710998535, -0.7961641550064087, -0.03733740746974945, -0.08995147049427032, -0.1941181719303131, 0.1800346076488495, -1.4985486268997192, -0.13520970940589905, -0.3514823317527771, -0.5855646133422852, -1.157476782798767, -0.08248762041330338, 1.4003589153289795, -0.8529626131057739, -0.13827160000801086, 0.5315195322036743, 0.2731735110282898, 0.5633615255355835, 0.6039856672286987, -0.6344298124313354, -0.29619547724723816, -0.2558705508708954, -0.38832536339759827, 0.2248321771621704, 1.370184302330017, -0.14039230346679688, -1.0603638887405396, 0.7677171230316162, -0.29001444578170776, 0.061803966760635376, 1.8858381509780884, 0.11503591388463974, -0.8584685325622559, 0.3022278845310211, -0.7904992699623108, 1.858074426651001, 1.7440091371536255, 1.3158432245254517, -0.12302384525537491, -0.9180536270141602, 0.5534347295761108, -0.23739349842071533, -0.3065275251865387, 0.8770236372947693, 0.5081545114517212, -0.17303001880645752, -1.36531662940979, 0.6976336240768433, 1.2913084030151367, -0.9335605502128601, -0.7881697416305542, 0.08438462764024734, -0.8084297776222229, 1.025920033454895, 0.6547507643699646, 0.4567839801311493, 0.22617556154727936, 1.6384179592132568, 0.741380512714386, -0.4632086455821991, 0.553263247013092, 0.5064636468887329, -0.10897883027791977, -2.0297062397003174, -1.1620157957077026, 0.39079710841178894, -0.47197774052619934, -1.625832438468933, 1.408139705657959, -1.1453278064727783, -0.8841654658317566, 0.5518619418144226, 0.15525196492671967, 1.5188993215560913, 0.32337838411331177, 1.631680965423584, 2.0601117610931396, 0.8769900798797607, 0.25204068422317505, 1.3496373891830444, -0.022103779017925262, -0.3880937397480011, 1.7529094219207764, -0.42949098348617554, 0.5339735150337219, 1.0569244623184204, -0.3294837474822998, -1.1381378173828125, -0.7109226584434509, -1.2519299983978271, -0.6209219098091125, 1.0844781398773193, 0.176093190908432, -1.1775416135787964, 0.1911444216966629, 1.6255333423614502, 0.057637132704257965, -0.30691224336624146, 0.6283110976219177, 0.3400191366672516, -0.7813185453414917, -0.05098128691315651, -0.9608968496322632, 0.4535980224609375, -0.10512001067399979, -0.3060421645641327, 0.2612932622432709, 0.4149535596370697, 1.3219789266586304, 0.029252253472805023, 0.08633910864591599, 1.2632700204849243, -1.3631786108016968, 1.485321044921875, -0.6618472337722778, 0.24382972717285156, -2.4086239337921143, 1.4003124237060547, -0.8003627061843872, 1.8806240558624268, -2.6272599697113037, 0.4382830560207367, -0.6604753732681274, -0.428849458694458, 0.41238293051719666, -0.4150952100753784, 0.19853977859020233, -0.12050938606262207, -1.0774428844451904, -0.11841461062431335, -0.7873039841651917, 0.6421886086463928, 1.1201456785202026, 1.3726862668991089, -1.074300765991211, -0.4066830277442932, -1.7840521335601807, -0.18009904026985168, -0.6401793360710144, 0.3499559760093689, -1.9531517028808594, -0.11725378781557083, -1.9283369779586792, -2.412111282348633, -1.33558189868927, -0.8031953573226929, 1.0576246976852417, 0.06966399401426315, -0.9182736873626709, 1.1942293643951416, -0.3407203257083893, -1.8193837404251099, 1.0902823209762573, -2.2173256874084473 ]
https://github.com/huggingface/datasets/issues/3632
Adding CC-100: Monolingual Datasets from Web Crawl Data (Datasets links are invalid)
Hi @albertvillanova I checked and it works. It seems that it was really temporarily down. Thanks!
## Describe the bug The dataset links are no longer valid for CC-100. It seems that the website which was keeping these files are no longer accessible and therefore this dataset became unusable. Check out the dataset [homepage](http://data.statmt.org/cc-100/) which isn't accessible. Also the URLs for dataset file per language isn't accessible: http://data.statmt.org/cc-100/<language code here>.txt.xz (language codes: am, sr, ka, etc.) ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("cc100", "ka") ``` It throws 503 error. ## Expected results It should successfully download and load dataset but it throws an exception because the dataset files are no longer accessible. ## Environment info Run from google colab. Just installed the library using pip: ```!pip install -U datasets```
984
16
Adding CC-100: Monolingual Datasets from Web Crawl Data (Datasets links are invalid) ## Describe the bug The dataset links are no longer valid for CC-100. It seems that the website which was keeping these files are no longer accessible and therefore this dataset became unusable. Check out the dataset [homepage](http://data.statmt.org/cc-100/) which isn't accessible. Also the URLs for dataset file per language isn't accessible: http://data.statmt.org/cc-100/<language code here>.txt.xz (language codes: am, sr, ka, etc.) ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("cc100", "ka") ``` It throws 503 error. ## Expected results It should successfully download and load dataset but it throws an exception because the dataset files are no longer accessible. ## Environment info Run from google colab. Just installed the library using pip: ```!pip install -U datasets``` Hi @albertvillanova I checked and it works. It seems that it was really temporarily down. Thanks!
[ -1.2111079692840576, -0.8023394346237183, -0.7521563768386841, 1.4080098867416382, -0.21999233961105347, -1.1954903602600098, 0.12280917167663574, -1.0245331525802612, 1.6909362077713013, -0.8263736367225647, 0.16994920372962952, -1.7044641971588135, 0.026491623371839523, -0.5259647369384766, -0.7575122117996216, -0.9479026198387146, -0.42406541109085083, -0.7523438334465027, 1.024209976196289, 2.495772361755371, 1.1594659090042114, -1.3276859521865845, 2.7077624797821045, 0.6369287371635437, -0.16050440073013306, -1.0362403392791748, 0.4910186529159546, 0.041190896183252335, -1.3151683807373047, -0.38034409284591675, -0.9828720688819885, -0.11727270483970642, -0.5496726632118225, -0.6222265362739563, 0.035402990877628326, 0.319013774394989, -0.3295130133628845, -0.4737127423286438, -0.5586658716201782, -0.7653694748878479, 0.5362778306007385, -0.3200092315673828, 0.9921483397483826, -0.3990938663482666, 1.8896117210388184, -0.526696503162384, 0.43868589401245117, 0.6079754829406738, 1.3372511863708496, 0.197208970785141, -0.0013444237411022186, 0.3235890865325928, 0.4216899275779724, 0.14189010858535767, 0.3937181234359741, 1.1056829690933228, 0.6194669008255005, 0.4948497414588928, 0.637719988822937, -2.19049072265625, 1.2269792556762695, -0.9978504180908203, 0.29469233751296997, 1.3790103197097778, -0.951666533946991, 0.3300369083881378, -1.7452683448791504, -0.11454106867313385, 0.566295325756073, -2.250506639480591, 0.1509501338005066, -1.3171265125274658, -0.5104168057441711, 1.0468816757202148, 0.40240731835365295, -1.1758105754852295, 0.15367209911346436, -0.39642080664634705, 1.0118529796600342, 0.49612998962402344, 1.1686747074127197, -1.6426194906234741, -0.01699952781200409, -0.28928041458129883, 0.06370849162340164, -1.2790822982788086, -1.5258232355117798, 0.5640261173248291, 0.7244819402694702, 0.6595975756645203, -0.12324900925159454, 0.9613802433013916, -0.9194760322570801, 0.7442103028297424, -1.0346033573150635, -1.7709039449691772, -1.3717594146728516, -2.216578960418701, -2.4247000217437744, 0.7719754576683044, -0.4479901194572449, -0.4993029832839966, 2.0914578437805176, -1.018619418144226, -1.8524852991104126, 1.1294599771499634, 0.2065221667289734, 0.01454403530806303, 2.3148601055145264, 0.1707482933998108, -0.7252104878425598, 0.47649946808815, -0.6834486722946167, 0.7736642956733704, -0.3612000644207001, 1.4309002161026, 0.514052152633667, -0.9470034241676331, 1.613732933998108, -0.36324477195739746, 0.5901792645454407, -0.6364572644233704, -0.5540636777877808, -0.8497291207313538, 0.34246325492858887, 1.962267279624939, -0.32607796788215637, 1.6348570585250854, -0.2714022994041443, -1.6425014734268188, -1.555601716041565, 0.878294825553894, 0.5280106067657471, -0.760608971118927, 0.10216005891561508, -0.25680869817733765, 0.07319881021976471, -0.011300728656351566, 1.1233675479888916, 1.1292965412139893, 0.8333308100700378, -0.28659743070602417, -0.8619954586029053, 0.3333921730518341, -0.0037616961635649204, -0.6970310211181641, -1.7379255294799805, -0.34860533475875854, 0.12322030961513519, 0.592352569103241, -1.2265595197677612, 1.7011909484863281, 0.850914478302002, 1.9757663011550903, 1.0332022905349731, -0.3230341076850891, 1.4785858392715454, 0.06744404137134552, 1.949714183807373, -0.4713563919067383, 0.7197026014328003, -0.34293678402900696, -1.1646897792816162, 0.7363666296005249, -0.35405632853507996, -2.0398025512695312, -0.7721745371818542, -0.984374463558197, -0.12281719595193863, -0.7573655843734741, 0.9679751992225647, -0.23865319788455963, -1.4417011737823486, 0.18775127828121185, -0.6532983779907227, 0.14633974432945251, -1.2901557683944702, 0.32275596261024475, 0.7686022520065308, -0.6537138223648071, -0.005554029252380133, -0.21485036611557007, -1.3708289861679077, -0.47614559531211853, 0.23316842317581177, 1.9152742624282837, -0.7886152863502502, 1.018491506576538, 0.9784895181655884, -0.7896605134010315, 0.018441960215568542, 0.29280349612236023, -0.25452035665512085, 0.8540732860565186, -1.0718436241149902, -0.3300972282886505, 1.2540600299835205, -0.19844335317611694, -0.5496766567230225, 1.487190842628479, 0.6724886298179626, -1.0031760931015015, -0.16980010271072388, -0.17460577189922333, -0.7718738317489624, 0.01682410016655922, -1.6737009286880493, -0.1272062510251999, 0.3093910813331604, -1.4610977172851562, -0.5113202929496765, -0.19572129845619202, 1.2426635026931763, -0.15607532858848572, 1.4177969694137573, -0.39501529932022095, -0.2601557672023773, -0.4632309079170227, -0.444748193025589, 0.15029790997505188, -0.23434074223041534, -0.6878626942634583, 0.25179219245910645, -0.8079877495765686, 0.3091398775577545, 1.4110294580459595, 0.3344269096851349, 0.03410610556602478, 0.5395304560661316, 1.1032910346984863, 0.3343545198440552, -0.12179403007030487, -0.952978789806366, -1.5930533409118652, 2.0068676471710205, -1.4561082124710083, 1.8864614963531494, 0.6233817934989929, -0.10049635916948318, -1.7188140153884888, -1.9144949913024902, 1.3442498445510864, 1.1497689485549927, 2.3129935264587402, 0.6406528949737549, 0.43118739128112793, -0.8175969123840332, -0.6422926783561707, 0.3664748966693878, -0.9613738059997559, -0.6901571154594421, 0.14404699206352234, 2.331315279006958, 1.7161537408828735, -0.5607166290283203, -0.2593398094177246, -0.9829804301261902, 1.2588305473327637, -0.2357672154903412, 0.25067493319511414, 1.9878772497177124, -0.27815020084381104, -1.1291685104370117, 1.2603461742401123, -2.281510353088379, 0.18004027009010315, 2.0021491050720215, 0.3129151463508606, 0.09425917267799377, -1.4524775743484497, -0.6779236793518066, -0.26729899644851685, -0.45985478162765503, -1.2948493957519531, 0.5830258131027222, -0.30447688698768616, -0.7788597941398621, -1.3940073251724243, 0.18367935717105865, -1.1035199165344238, -1.7427746057510376, 0.24245186150074005, 1.8418643474578857, 1.9655894041061401, -0.6648477911949158, 1.4165582656860352, -0.323201447725296, 0.21578554809093475, 1.3298909664154053, 1.1760234832763672, 3.1719274520874023, 1.9907251596450806, -1.2588462829589844, 0.7794170379638672, -0.09506901353597641, -0.4583752751350403, 1.230586290359497, -1.1400763988494873, 1.235782504081726, -0.2348518669605255, -1.3020766973495483, -1.2279117107391357, 0.9398854374885559, 0.390310138463974, 0.11855310201644897, -0.4894323945045471, 1.3101881742477417, -0.05152975022792816, 1.2793468236923218, 0.545238733291626, -0.4632411301136017, 0.6712949872016907, -0.4307343065738678, -0.4434551000595093, 1.6057724952697754, 0.22479045391082764, -1.4033702611923218, -2.323704957962036, -0.3207018971443176, -0.8479889631271362, -0.023874256759881973, -0.5727258324623108, -0.9997603297233582, 1.622204065322876, 0.4636908769607544, -1.2253159284591675, -0.27052026987075806, -0.3912484049797058, -0.7138444185256958, 2.765167474746704, -1.4661730527877808, -0.22420138120651245, -1.0445140600204468, -0.5908554792404175, 1.6469781398773193, -1.1448910236358643, -0.16465801000595093, -0.9763500690460205, -0.6412962079048157, -1.4448846578598022, -0.6236303448677063, -0.03037109225988388, -0.8768958449363708, 0.7674583792686462, 0.2010517567396164, -1.151691198348999, -0.2384180724620819, -0.8355319499969482, 0.8798717856407166, -0.08806375414133072, 0.2289130687713623, 1.9381119012832642, 0.43694794178009033, -0.36727797985076904, 0.6839861273765564, 1.207957148551941, 0.7294853329658508, -0.7205486297607422, 0.24811212718486786, -0.7827910780906677, 0.2121688723564148, -1.3827582597732544, 0.20860600471496582, -2.84558367729187, 0.7093315720558167, -0.1433396190404892, -0.09309184551239014, 0.027312014251947403, -1.24284029006958, 1.0107307434082031, 2.6236016750335693, -1.2860897779464722, 0.4255962073802948, 0.3392772376537323, 1.207787036895752, -1.5701762437820435, 0.31340017914772034, -0.447713702917099, 2.161921501159668, 0.19385980069637299, 1.2061580419540405, -0.46462181210517883, -2.3023626804351807, 0.6949437856674194, -1.321863055229187, -1.223006248474121, 0.7896618247032166, -0.8326435685157776, 0.06985459476709366, -1.4280402660369873, -0.13477587699890137, -0.8477372527122498, -1.2736222743988037, 0.7874290347099304, 0.08255849033594131, 0.3994223475456238, -0.47846707701683044, 0.3550095856189728, -2.113285779953003, -1.3822791576385498, -0.2915983498096466, -1.0115445852279663, 0.4325545132160187, -0.27572688460350037, 0.7408966422080994, -0.2406127005815506, 0.064808689057827, 0.4263116121292114, 1.3691577911376953, 3.3507707118988037, 0.1837388426065445, 0.3246191740036011, -0.13243117928504944, -1.034074306488037, 1.4011037349700928, 1.0014997720718384, -0.19362124800682068, -0.5041767954826355, -0.9216572046279907, 1.1791150569915771, 1.9719821214675903, 1.0001909732818604, 0.05021725594997406, -0.7614985108375549, -0.6657761931419373, 0.05632632225751877, 0.17251752316951752, 0.5242910385131836, 0.8748681545257568, 0.0924779549241066, 0.13848432898521423, 1.4117660522460938, 1.161285400390625, -0.26013538241386414, 0.3023340106010437, -0.8310537338256836, -0.5405725240707397, 0.6352666616439819, 0.3228037655353546, 0.06480508297681808, 0.4199623763561249, -1.0299206972122192, -0.23139409720897675, -0.34412816166877747, -0.9860279560089111, -0.6709295511245728, -0.4908725917339325, -0.4072340726852417, 1.6541341543197632, 0.04948857054114342, -0.537912905216217, -0.07560760527849197, -0.7892632484436035, -0.08701128512620926, -1.0401289463043213, 0.3264935314655304, -0.07501371204853058, -0.07578501850366592, -0.0010295147076249123, 1.7651605606079102, -1.0353550910949707, -2.0770556926727295, 0.25975409150123596, 0.2509268522262573, -0.39111387729644775, 0.13772760331630707, 1.6257455348968506, 0.5893934369087219, 1.476706624031067, 1.3848681449890137, 1.0260658264160156, -0.5919382572174072, -1.3463072776794434, 0.7065986394882202, 0.9213642477989197, -1.405389428138733, 0.7746175527572632, 0.03749596327543259, -0.522200882434845, 0.6040017604827881, 1.3155375719070435, 0.4471655786037445, -1.9328871965408325, 0.7643625140190125, -0.8565279841423035, 0.6974260210990906, 0.6700342297554016, 0.7919195890426636, 0.1335906982421875, 0.8280590772628784, -1.290015697479248, -1.0776053667068481, -0.6634688377380371, -0.5322914719581604, 1.9461336135864258, -0.16114212572574615, 0.5068894028663635, -0.2406177967786789, -1.224591851234436, 0.03012940287590027, 0.7056663036346436, 0.33390530943870544, -0.4497290849685669, 0.8759247660636902, -0.6168362498283386, -1.0862016677856445, -1.4154876470565796, -0.4658063054084778, -0.9675371050834656, -0.8926082253456116, 1.0861024856567383, 0.8237329721450806, 0.2810642421245575, 1.7808747291564941, 0.634566605091095, 0.19533738493919373, -2.798759937286377, 0.8733070492744446, 0.1445648968219757, -0.06887303292751312, 0.8475022315979004, 0.2351914793252945, 0.9875285029411316, -0.14854209125041962, 0.5831450819969177, -2.2807838916778564, 2.239593267440796, -0.34527331590652466, 0.6159501075744629, 0.015324202366173267, -0.08055087178945541, 1.066168189048767, 0.5414484739303589, 0.553030788898468, -1.147875428199768, 0.723614513874054, -0.689450740814209, 1.1974050998687744, 0.9510006904602051, -0.8545379638671875, 0.016830366104841232, 1.3332782983779907, 0.5632407069206238, -0.4879418611526489, -0.9378145933151245, -0.8938515782356262, 0.9917324185371399, 1.630222201347351, -0.07882359623908997, -0.041093610227108, 0.9203040599822998, 0.6481788158416748, -1.312171459197998, 0.16280999779701233, -0.653014063835144, -0.7050066590309143, 1.6463686227798462, 2.0156118869781494, -0.0035872869193553925, -0.21885022521018982, -0.7303455471992493, -1.2215704917907715, 0.7197083234786987, 0.043261829763650894, 0.05557696521282196, 0.7247627973556519, -0.6168063879013062, 1.0759128332138062, 0.9122940897941589, 0.877473771572113, 0.15407642722129822, 0.3522363007068634, 0.33916276693344116, -0.2791966199874878, -1.2106976509094238, -0.17732031643390656, -1.0044097900390625, -2.522075891494751, 0.5722730755805969, -0.24899442493915558, -1.4663606882095337, 0.10514349490404129, -1.0670249462127686, 0.8850396871566772, -0.5772302150726318, -1.099401831626892, -1.5085853338241577, 0.14769096672534943, -0.072245754301548, 0.9172766804695129, -1.6072040796279907, -0.06163419783115387, 1.264026165008545, 0.9300827383995056, -0.6846893429756165, 1.0187314748764038, 0.22869640588760376, 1.0712848901748657, 0.8805586099624634, -0.45467257499694824, 0.559100866317749, 0.15771135687828064, -1.367695689201355, 0.5655543208122253, 1.1060428619384766, 0.21422523260116577, 1.4046601057052612, -0.5836697816848755, 0.04823195934295654, 0.45779430866241455, -0.5323510766029358, -0.47056037187576294, -0.6384371519088745, 0.7192144989967346, 0.1414249837398529, -0.808086633682251, -0.03180890530347824, -0.06783854216337204, -0.19648553431034088, 0.1757669895887375, -1.5000108480453491, -0.15431508421897888, -0.3548055589199066, -0.5981994867324829, -1.1655173301696777, -0.061481427401304245, 1.3843655586242676, -0.8787696957588196, -0.13434942066669464, 0.5164827704429626, 0.2776757478713989, 0.5452448725700378, 0.5608940124511719, -0.6525528430938721, -0.28055787086486816, -0.287431925535202, -0.3836337924003601, 0.24864597618579865, 1.356348991394043, -0.13480693101882935, -1.0927658081054688, 0.7649456262588501, -0.30043309926986694, 0.07355855405330658, 1.8943185806274414, 0.08168380707502365, -0.8348775506019592, 0.2920484244823456, -0.7978693246841431, 1.8309108018875122, 1.7080247402191162, 1.3086782693862915, -0.14692889153957367, -0.9392009377479553, 0.5157070159912109, -0.24630920588970184, -0.306503027677536, 0.8682166337966919, 0.509779691696167, -0.17348530888557434, -1.3497443199157715, 0.6764156222343445, 1.2544842958450317, -0.9440357089042664, -0.7660354971885681, 0.09995188564062119, -0.8133801817893982, 1.0123915672302246, 0.6573505401611328, 0.4260745048522949, 0.23125715553760529, 1.646148920059204, 0.758770227432251, -0.45783859491348267, 0.5475132465362549, 0.47869256138801575, -0.09440368413925171, -2.041361093521118, -1.1408774852752686, 0.39073818922042847, -0.45585426688194275, -1.6170297861099243, 1.3923022747039795, -1.1363844871520996, -0.8653566837310791, 0.5545427799224854, 0.1707412153482437, 1.5284370183944702, 0.3219717741012573, 1.6064558029174805, 2.065267562866211, 0.9030134081840515, 0.25912150740623474, 1.3430418968200684, -0.02277306467294693, -0.38411080837249756, 1.752858281135559, -0.42441031336784363, 0.544136106967926, 1.0486199855804443, -0.33440595865249634, -1.1368142366409302, -0.7508491277694702, -1.2533572912216187, -0.5991026163101196, 1.064644694328308, 0.18651501834392548, -1.2102748155593872, 0.17039628326892853, 1.612973690032959, 0.06265608966350555, -0.3083536624908447, 0.6312701106071472, 0.3196919858455658, -0.7881863713264465, -0.05603763833642006, -0.9862006306648254, 0.44672930240631104, -0.08303618431091309, -0.28121498227119446, 0.26853394508361816, 0.4197818636894226, 1.3002979755401611, 0.05688644200563431, 0.08597838133573532, 1.3062405586242676, -1.3287670612335205, 1.4977680444717407, -0.6731053590774536, 0.26213470101356506, -2.388097047805786, 1.3883777856826782, -0.8413847088813782, 1.8818556070327759, -2.6192562580108643, 0.42797327041625977, -0.637961745262146, -0.43252548575401306, 0.39720121026039124, -0.420276403427124, 0.1745654195547104, -0.10509409010410309, -1.0990197658538818, -0.12502151727676392, -0.8020369410514832, 0.6451577544212341, 1.131338357925415, 1.3940738439559937, -1.0885776281356812, -0.3989366888999939, -1.7943180799484253, -0.1657174974679947, -0.6614453792572021, 0.3965006470680237, -1.9498262405395508, -0.10263478010892868, -1.8968695402145386, -2.421189308166504, -1.3564521074295044, -0.8136013746261597, 1.0821738243103027, 0.07378175109624863, -0.9166397452354431, 1.1688929796218872, -0.33291029930114746, -1.793622374534607, 1.0813671350479126, -2.253227949142456 ]
https://github.com/huggingface/datasets/issues/3625
Add a metadata field for when source data was produced
A question to the datasets maintainers: is there a policy about how the set of allowed metadata fields is maintained and expanded? Metadata are very important, but defining the standard is always a struggle between allowing exhaustivity without being too complex. Archivists have Dublin Core, open data has https://frictionlessdata.io/, geo has ISO 19139 and INSPIRE, etc. and it's always a mess! I'm not sure we want to dig too much into it, but I'm curious to know if there has been some work on the metadata standard.
**Is your feature request related to a problem? Please describe.** The current problem is that information about when source data was produced is not easily visible. Though there are a variety of metadata fields available in the dataset viewer, time period information is not included. This feature request suggests making metadata relating to the time that the underlying *source* data was produced more prominent and outlines why this specific information is of particular importance, both in domain-specific historic research and more broadly. **Describe the solution you'd like** There are a variety of metadata fields exposed in the dataset viewer (license, task categories, etc.) These fields make this metadata more prominent both for human users and as potentially machine-actionable information (for example, through the API). I would propose to add a metadata field that says when some underlying data was produced. For example, a dataset would be labelled as being produced between `1800-1900`. **Describe alternatives you've considered** This information is sometimes available in the Datacard or a paper describing the dataset. However, it's often not that easy to identify or extract this information, particularly if you want to use this field as a filter to identify relevant datasets. **Additional context** I believe this feature is relevant for a number of reasons: - Increasingly, there is an interest in using historical data for training language models (for example, https://huggingface.co/dbmdz/bert-base-historic-dutch-cased), and datasets to support this task (for example, https://huggingface.co/datasets/bnl_newspapers). For these datasets, indicating the time periods covered is particularly relevant. - More broadly, time is likely a common source of domain drift. Datasets of movie reviews from the 90s may not work well for recent movie reviews. As the documentation and long-term management of ML data become more of a priority, quickly understanding the time when the underlying text (or other data types) is arguably more important. - time-series data: datasets are adding more support for time series data. Again, the periods covered might be particularly relevant here. **open questions** - I think some of my points above apply not only to the underlying data but also to annotations. As a result, there could also be an argument for encoding this information somewhere. However, I would argue (but could be persuaded otherwise) that this is probably less important for filtering. This type of context is already addressed in the datasheets template and often requires more narrative to discuss. - what level of granularity would make sense for this? e.g. assigning a decade, century or year? - how to encode this information? What formatting makes sense - what specific time to encode; a data range? (mean, modal, min, max value?) This is a slightly amorphous feature request - I would be happy to discuss further/try and propose a more concrete solution if this seems like something that could be worth considering. I realise this might also touch on other parts of the 🤗 hubs ecosystem.
987
87
Add a metadata field for when source data was produced **Is your feature request related to a problem? Please describe.** The current problem is that information about when source data was produced is not easily visible. Though there are a variety of metadata fields available in the dataset viewer, time period information is not included. This feature request suggests making metadata relating to the time that the underlying *source* data was produced more prominent and outlines why this specific information is of particular importance, both in domain-specific historic research and more broadly. **Describe the solution you'd like** There are a variety of metadata fields exposed in the dataset viewer (license, task categories, etc.) These fields make this metadata more prominent both for human users and as potentially machine-actionable information (for example, through the API). I would propose to add a metadata field that says when some underlying data was produced. For example, a dataset would be labelled as being produced between `1800-1900`. **Describe alternatives you've considered** This information is sometimes available in the Datacard or a paper describing the dataset. However, it's often not that easy to identify or extract this information, particularly if you want to use this field as a filter to identify relevant datasets. **Additional context** I believe this feature is relevant for a number of reasons: - Increasingly, there is an interest in using historical data for training language models (for example, https://huggingface.co/dbmdz/bert-base-historic-dutch-cased), and datasets to support this task (for example, https://huggingface.co/datasets/bnl_newspapers). For these datasets, indicating the time periods covered is particularly relevant. - More broadly, time is likely a common source of domain drift. Datasets of movie reviews from the 90s may not work well for recent movie reviews. As the documentation and long-term management of ML data become more of a priority, quickly understanding the time when the underlying text (or other data types) is arguably more important. - time-series data: datasets are adding more support for time series data. Again, the periods covered might be particularly relevant here. **open questions** - I think some of my points above apply not only to the underlying data but also to annotations. As a result, there could also be an argument for encoding this information somewhere. However, I would argue (but could be persuaded otherwise) that this is probably less important for filtering. This type of context is already addressed in the datasheets template and often requires more narrative to discuss. - what level of granularity would make sense for this? e.g. assigning a decade, century or year? - how to encode this information? What formatting makes sense - what specific time to encode; a data range? (mean, modal, min, max value?) This is a slightly amorphous feature request - I would be happy to discuss further/try and propose a more concrete solution if this seems like something that could be worth considering. I realise this might also touch on other parts of the 🤗 hubs ecosystem. A question to the datasets maintainers: is there a policy about how the set of allowed metadata fields is maintained and expanded? Metadata are very important, but defining the standard is always a struggle between allowing exhaustivity without being too complex. Archivists have Dublin Core, open data has https://frictionlessdata.io/, geo has ISO 19139 and INSPIRE, etc. and it's always a mess! I'm not sure we want to dig too much into it, but I'm curious to know if there has been some work on the metadata standard.
[ -1.2954860925674438, -0.9918079376220703, -0.6771826148033142, 1.2773762941360474, -0.18633553385734558, -1.2720962762832642, 0.10471586883068085, -1.124650239944458, 1.7239423990249634, -0.7835263609886169, 0.2648022174835205, -1.728906273841858, -0.012608734890818596, -0.5998939275741577, -0.7871482968330383, -0.8063772320747375, -0.4729844331741333, -0.8441378474235535, 0.9709751009941101, 2.5746662616729736, 1.1779814958572388, -1.487242341041565, 2.7103352546691895, 0.6813777685165405, -0.14515657722949982, -0.9556789398193359, 0.466907799243927, 0.04114899784326553, -1.3290210962295532, -0.47445616126060486, -0.9758620262145996, -0.030902985483407974, -0.5897318124771118, -0.4705865979194641, 0.005236322060227394, 0.41116270422935486, -0.16917341947555542, -0.40752163529396057, -0.5659245252609253, -0.6530498266220093, 0.45380210876464844, -0.4322144091129303, 0.9617085456848145, -0.3986256420612335, 1.8219773769378662, -0.5663298964500427, 0.37267476320266724, 0.6510388851165771, 1.3508918285369873, 0.21591801941394806, -0.053713154047727585, 0.29726389050483704, 0.3372099697589874, -0.0572592169046402, 0.45734789967536926, 1.1879818439483643, 0.6991208791732788, 0.4439855217933655, 0.7273464202880859, -2.1341261863708496, 1.3606107234954834, -1.0512120723724365, 0.40979287028312683, 1.4274338483810425, -0.9130104184150696, 0.510674774646759, -1.8460971117019653, -0.04150138422846794, 0.5836086869239807, -2.2598869800567627, 0.09360604733228683, -1.185463309288025, -0.5488883256912231, 0.9513773322105408, 0.2742074728012085, -1.272878885269165, 0.21784603595733643, -0.5140342116355896, 0.9737191200256348, 0.39899176359176636, 1.162578821182251, -1.740412950515747, 0.017791762948036194, -0.29648882150650024, 0.15334159135818481, -1.286206603050232, -1.5403470993041992, 0.5743499398231506, 0.669660210609436, 0.5642269849777222, -0.13297565281391144, 0.907821536064148, -1.0735223293304443, 0.8279478549957275, -0.9996257424354553, -1.6506009101867676, -1.4234049320220947, -2.3101282119750977, -2.2638638019561768, 0.8553280234336853, -0.4553053379058838, -0.5442947745323181, 2.025684356689453, -1.0090479850769043, -1.7629330158233643, 1.1754111051559448, 0.26619821786880493, 0.048639826476573944, 2.442105293273926, 0.15066425502300262, -0.7525264620780945, 0.5208364129066467, -0.7000741362571716, 0.7914835810661316, -0.4154852330684662, 1.431467890739441, 0.3954225182533264, -1.0533815622329712, 1.5605489015579224, -0.5141642689704895, 0.4589829444885254, -0.6112108826637268, -0.5415807962417603, -0.7275623679161072, 0.5234147310256958, 1.8367913961410522, -0.2002459317445755, 1.5431671142578125, -0.4683741331100464, -1.5752424001693726, -1.6500598192214966, 0.9072906970977783, 0.5303645730018616, -0.8069954514503479, 0.08027820289134979, -0.3864252269268036, 0.06490503996610641, -0.00593047309666872, 1.0422616004943848, 1.1920949220657349, 0.7604568004608154, -0.304738849401474, -0.9256188869476318, 0.15742366015911102, -0.15643872320652008, -0.6485445499420166, -1.8172367811203003, -0.33045315742492676, 0.1858329176902771, 0.5813127756118774, -1.1930330991744995, 1.7113947868347168, 1.0005624294281006, 1.8941911458969116, 1.0084785223007202, -0.3742299973964691, 1.479838252067566, 0.019839048385620117, 1.81011164188385, -0.5414974093437195, 0.7434530854225159, -0.3584698438644409, -1.1181490421295166, 0.7691612243652344, -0.34317007660865784, -2.06461501121521, -0.7011275887489319, -0.801305890083313, -0.27400335669517517, -0.791819155216217, 0.9832838773727417, -0.14327608048915863, -1.2892080545425415, 0.2912803292274475, -0.6560148000717163, 0.12343377619981766, -1.202584981918335, 0.3215523660182953, 0.7527092099189758, -0.6817118525505066, 0.009144901297986507, -0.2766416072845459, -1.365676999092102, -0.5508480072021484, 0.24413460493087769, 1.7600648403167725, -0.7329161167144775, 0.8428336977958679, 0.9852453470230103, -0.6652056574821472, 0.017024900764226913, 0.3905518054962158, -0.2849591076374054, 0.8588306903839111, -0.9599354267120361, -0.4113661050796509, 1.0776081085205078, -0.20438982546329498, -0.4848903715610504, 1.4599744081497192, 0.623933732509613, -0.9785727858543396, -0.18982400000095367, -0.22288329899311066, -0.8933509588241577, -0.013817504979670048, -1.6204557418823242, -0.1478600800037384, 0.2621404230594635, -1.4719669818878174, -0.49724456667900085, -0.2515340745449066, 1.2738920450210571, -0.0741061195731163, 1.3569031953811646, -0.28761956095695496, -0.16992485523223877, -0.4198386073112488, -0.338539183139801, 0.15496990084648132, -0.19007079303264618, -0.5427848696708679, 0.2670881450176239, -0.8518688678741455, 0.2741571068763733, 1.4438765048980713, 0.466328501701355, 0.021484624594449997, 0.4823378920555115, 1.0503301620483398, 0.38097429275512695, -0.13805542886257172, -0.8819799423217773, -1.5207362174987793, 1.9884439706802368, -1.4814584255218506, 1.8951529264450073, 0.9049115777015686, -0.0032944991253316402, -1.801323413848877, -1.8106321096420288, 1.3829478025436401, 1.176178216934204, 2.4406769275665283, 0.527159571647644, 0.3664335310459137, -0.8392391204833984, -0.6741625070571899, 0.3958643674850464, -1.0209691524505615, -0.8138527870178223, 0.052248477935791016, 2.3965160846710205, 1.8695048093795776, -0.5389474630355835, -0.1598886400461197, -1.0250695943832397, 1.402294397354126, -0.19913209974765778, 0.18792231380939484, 2.0143351554870605, -0.3928488790988922, -1.0708364248275757, 1.3474290370941162, -2.3556406497955322, 0.11669518798589706, 1.9440498352050781, 0.29042813181877136, 0.11210794746875763, -1.3851290941238403, -0.6069506406784058, -0.25284242630004883, -0.41305413842201233, -1.2769503593444824, 0.5864463448524475, -0.277547687292099, -0.8116663694381714, -1.544958472251892, 0.1275758147239685, -1.2460745573043823, -1.5857309103012085, 0.3636821508407593, 1.8068071603775024, 2.1110684871673584, -0.7092276811599731, 1.4731810092926025, -0.2228054255247116, 0.19184674322605133, 1.1830484867095947, 1.1881839036941528, 3.203667640686035, 1.8895149230957031, -1.2373358011245728, 0.577666163444519, -0.2625032067298889, -0.4911275804042816, 1.0844414234161377, -1.1214344501495361, 1.2678661346435547, -0.1736682504415512, -1.2179702520370483, -1.1889243125915527, 1.0307416915893555, 0.5178147554397583, 0.04823978245258331, -0.529536783695221, 1.136237621307373, 0.11909795552492142, 1.2964776754379272, 0.5195127129554749, -0.31050360202789307, 0.5888598561286926, -0.498768150806427, -0.5425723195075989, 1.525920033454895, 0.26820024847984314, -1.4567921161651611, -2.260812997817993, -0.24611787497997284, -0.8911052346229553, 0.03985248878598213, -0.5994177460670471, -0.9527132511138916, 1.5785471200942993, 0.39801284670829773, -1.301138997077942, -0.22927974164485931, -0.37997570633888245, -0.6635751724243164, 2.5448923110961914, -1.3923249244689941, -0.26326367259025574, -0.9245645999908447, -0.5385798215866089, 1.594110131263733, -1.2247666120529175, -0.11486298590898514, -1.0478330850601196, -0.6658095121383667, -1.3087915182113647, -0.5434962511062622, -0.07210282236337662, -0.8810672163963318, 0.8370343446731567, 0.20796571671962738, -1.0801547765731812, -0.3589296340942383, -0.905720591545105, 0.7979149222373962, -0.12317121773958206, 0.2603492736816406, 1.8238420486450195, 0.3912554085254669, -0.39170023798942566, 0.6933196783065796, 1.2040385007858276, 0.6461063027381897, -0.5665567517280579, 0.14973366260528564, -0.704404354095459, 0.39768245816230774, -1.2704756259918213, 0.317746102809906, -2.910423517227173, 0.6788537502288818, -0.014762316830456257, -0.07866216450929642, 0.0054107001051306725, -1.2576885223388672, 1.1077224016189575, 2.581354856491089, -1.1394386291503906, 0.4485984146595001, 0.40083277225494385, 1.1431419849395752, -1.5552929639816284, 0.35098856687545776, -0.42251619696617126, 2.1243536472320557, 0.07712601870298386, 1.1131236553192139, -0.5846381187438965, -2.275239944458008, 0.5067342519760132, -1.2633005380630493, -1.1478822231292725, 0.689487636089325, -0.8039058446884155, 0.08353915810585022, -1.5507454872131348, -0.12814469635486603, -0.9367653727531433, -1.1851519346237183, 0.7539933323860168, 0.11864756792783737, 0.43274664878845215, -0.6576327085494995, 0.3123367726802826, -2.135575532913208, -1.40360689163208, -0.3505246639251709, -0.857808530330658, 0.4579911231994629, -0.2887048125267029, 0.73209148645401, -0.1129709929227829, 0.023725148290395737, 0.311849445104599, 1.3615751266479492, 3.314162254333496, 0.16459313035011292, 0.4254549741744995, -0.12814345955848694, -0.9316307306289673, 1.4518229961395264, 1.0046888589859009, -0.06839211285114288, -0.5604676008224487, -1.021689534187317, 1.3408344984054565, 1.9443947076797485, 0.9829362034797668, 0.09995656460523605, -0.7824310064315796, -0.6758540272712708, 0.019289333373308182, 0.22614668309688568, 0.46887749433517456, 0.9411765336990356, -0.013688361272215843, 0.1430797576904297, 1.5231635570526123, 1.3120574951171875, -0.4493284821510315, 0.395891010761261, -0.7981895804405212, -0.568646252155304, 0.422774076461792, 0.36309656500816345, 0.019388917833566666, 0.3159848749637604, -1.0379525423049927, -0.27053022384643555, -0.30620479583740234, -1.0466645956039429, -0.6519547700881958, -0.43392127752304077, -0.45012015104293823, 1.6553887128829956, 0.1724270135164261, -0.5358833074569702, 0.04957791417837143, -0.7806655168533325, -0.12124983966350555, -1.0376718044281006, 0.3400399684906006, -0.06155388057231903, -0.08655285835266113, -0.22375543415546417, 1.831114411354065, -0.9012652635574341, -2.0513415336608887, 0.24132874608039856, 0.26860836148262024, -0.40520697832107544, 0.2069939821958542, 1.6106468439102173, 0.557324230670929, 1.5809175968170166, 1.3218191862106323, 0.976538896560669, -0.5523531436920166, -1.3180078268051147, 0.7860857844352722, 0.9645277857780457, -1.3889927864074707, 0.8548648953437805, 0.031929317861795425, -0.580992579460144, 0.7349236011505127, 1.2909140586853027, 0.3843958079814911, -1.997248888015747, 0.8720492720603943, -0.9517286419868469, 0.820469081401825, 0.6324418187141418, 0.7300575971603394, 0.1809413731098175, 0.7746932506561279, -1.3616857528686523, -1.2050460577011108, -0.8419363498687744, -0.6246022582054138, 2.0716843605041504, -0.21833983063697815, 0.5738869905471802, -0.16405460238456726, -1.2672055959701538, -0.05146823078393936, 0.6675738096237183, 0.3956016004085541, -0.4104832708835602, 0.7597376704216003, -0.6685794591903687, -1.1664131879806519, -1.4471569061279297, -0.34254786372184753, -0.9712684750556946, -0.806984007358551, 1.0441877841949463, 0.9109646081924438, 0.32933035492897034, 1.8862344026565552, 0.6098386645317078, 0.22539576888084412, -2.602558135986328, 0.8904834985733032, 0.293900728225708, -0.07708588242530823, 0.8935855031013489, 0.24194535613059998, 1.0033681392669678, 0.026752550154924393, 0.5653285384178162, -2.4130842685699463, 2.2201449871063232, -0.19828258454799652, 0.7421579360961914, -0.01910679042339325, -0.18747103214263916, 1.1271313428878784, 0.5953782200813293, 0.5588861107826233, -1.0356677770614624, 0.6669304370880127, -0.5260002613067627, 1.2549450397491455, 0.9074306488037109, -0.7011582851409912, -0.06580772250890732, 1.2312132120132446, 0.4955216348171234, -0.4888345003128052, -0.9632371664047241, -0.9613767862319946, 0.9329451322555542, 1.7924760580062866, -0.08765562623739243, -0.0012774509377777576, 0.8090787529945374, 0.7279645800590515, -1.3031024932861328, 0.09062399715185165, -0.797419011592865, -0.7483176589012146, 1.5685629844665527, 2.075584888458252, -0.04114871844649315, -0.14261294901371002, -0.62555330991745, -1.2903032302856445, 0.7602460384368896, 0.02232862263917923, 0.18577466905117035, 0.7317137122154236, -0.6345881819725037, 1.1016989946365356, 0.9129447937011719, 0.8930256962776184, 0.16618409752845764, 0.3141600787639618, 0.3969152569770813, -0.27905210852622986, -1.1728311777114868, -0.22862257063388824, -1.1408741474151611, -2.4582650661468506, 0.4209509491920471, -0.223891019821167, -1.518932580947876, -0.04028526693582535, -0.9723424315452576, 0.9367765784263611, -0.485577255487442, -1.20724618434906, -1.5602833032608032, 0.19368387758731842, 0.041831426322460175, 0.9520712494850159, -1.6297175884246826, -0.06282385438680649, 1.122146725654602, 0.8748999238014221, -0.5760457515716553, 0.9454171657562256, 0.3306717276573181, 0.9868580102920532, 0.8847270011901855, -0.39083150029182434, 0.40717530250549316, 0.0891513079404831, -1.3830695152282715, 0.41511228680610657, 1.1164826154708862, 0.14807389676570892, 1.3117461204528809, -0.5300977230072021, 0.03894229978322983, 0.4745527505874634, -0.4651638865470886, -0.33486542105674744, -0.4837903380393982, 0.6629406213760376, 0.060012124478816986, -0.838036298751831, -0.003066232893615961, -0.02895524725317955, -0.2705613076686859, 0.17447473108768463, -1.4124892950057983, -0.20210641622543335, -0.4736209809780121, -0.5303911566734314, -1.2469602823257446, -0.04659375920891762, 1.429724931716919, -0.7668034434318542, -0.18516215682029724, 0.5599067211151123, 0.4399898648262024, 0.5632097125053406, 0.7186381816864014, -0.6203739643096924, -0.3923547565937042, -0.22796234488487244, -0.3715788424015045, 0.23982320725917816, 1.3196862936019897, -0.10348670929670334, -0.9980641603469849, 0.7347108721733093, -0.4314841330051422, 0.033573172986507416, 1.955396294593811, 0.12299323827028275, -0.8432226181030273, 0.41470733284950256, -0.7496023178100586, 1.8214111328125, 1.7223422527313232, 1.264087438583374, -0.06470470875501633, -0.9652772545814514, 0.6130855679512024, -0.27031850814819336, -0.37780994176864624, 1.001777172088623, 0.46402978897094727, -0.15789440274238586, -1.4190536737442017, 0.6012121438980103, 1.29469633102417, -0.8608956933021545, -0.7440143823623657, 0.11491181701421738, -0.8356037735939026, 1.1919981241226196, 0.7916014194488525, 0.42976415157318115, 0.19631540775299072, 1.7223103046417236, 0.7081571221351624, -0.47543808817863464, 0.5586233139038086, 0.5651798844337463, -0.22824573516845703, -2.1573197841644287, -1.2033642530441284, 0.1150982603430748, -0.431602418422699, -1.4808378219604492, 1.2851817607879639, -1.198608160018921, -0.956282913684845, 0.45253247022628784, -0.044279083609580994, 1.4826757907867432, 0.35421910881996155, 1.6427860260009766, 2.1539766788482666, 0.9715793132781982, 0.3574897348880768, 1.419386863708496, -0.054437559098005295, -0.32591062784194946, 1.8595287799835205, -0.4306674003601074, 0.5128552317619324, 1.1436463594436646, -0.3376633822917938, -1.116989016532898, -0.7648721933364868, -1.1092588901519775, -0.6632434725761414, 1.1660641431808472, 0.05057559162378311, -1.1109375953674316, 0.30000752210617065, 1.5834689140319824, 0.14130856096744537, -0.32697176933288574, 0.42861655354499817, 0.4929659068584442, -0.7966773509979248, -0.07632950693368912, -1.0019195079803467, 0.5027468800544739, -0.32091569900512695, -0.3723258078098297, 0.3506164848804474, 0.5027207136154175, 1.271889328956604, -0.028621826320886612, 0.20558863878250122, 1.1359692811965942, -1.5247530937194824, 1.4195001125335693, -0.6762034296989441, 0.2034732848405838, -2.418086051940918, 1.5011974573135376, -0.7415038347244263, 1.998395562171936, -2.7451374530792236, 0.39475786685943604, -0.5664682388305664, -0.5438746809959412, 0.36986711621284485, -0.2950306236743927, 0.1508813053369522, -0.12198343873023987, -1.1035888195037842, -0.046787820756435394, -0.6635032892227173, 0.5772014856338501, 1.1452230215072632, 1.328978419303894, -1.047690510749817, -0.30745169520378113, -1.6352500915527344, -0.20987704396247864, -0.7485408782958984, 0.27492955327033997, -1.9723879098892212, -0.11063872277736664, -1.8962411880493164, -2.2518019676208496, -1.4143781661987305, -0.9247217178344727, 1.1316490173339844, 0.1347341239452362, -0.9351359009742737, 1.0900964736938477, -0.45246991515159607, -1.864540696144104, 1.0774809122085571, -2.164776563644409 ]
https://github.com/huggingface/datasets/issues/3625
Add a metadata field for when source data was produced
> Metadata are very important, but defining the standard is always a struggle between allowing exhaustivity without being too complex. Archivists have Dublin Core, open data has [frictionlessdata.io](https://frictionlessdata.io/), geo has ISO 19139 and INSPIRE, etc. and it's always a mess! I'm not sure we want to dig too much into it, but I'm curious to know if there has been some work on the metadata standard. I thought this is a potential issue with adding this field since it might be hard to define what is general enough to be useful for most data vs what becomes very domain-specific. Potentially adding one extra field leads to more and more fields in the future. Another issue is that there are some metadata standards around data i.e. [datacite](https://schema.datacite.org/meta/kernel-4.4/), but not many aimed explicitly at ML data afaik. Some of the discussions around metadata for ML are also more focused on versioning/managing data in production environments. My thinking is that here, some reference to the time of production would also often be tracked/relevant, i.e. for triggering model training, so having this information available in the hub would also help address this use case.
**Is your feature request related to a problem? Please describe.** The current problem is that information about when source data was produced is not easily visible. Though there are a variety of metadata fields available in the dataset viewer, time period information is not included. This feature request suggests making metadata relating to the time that the underlying *source* data was produced more prominent and outlines why this specific information is of particular importance, both in domain-specific historic research and more broadly. **Describe the solution you'd like** There are a variety of metadata fields exposed in the dataset viewer (license, task categories, etc.) These fields make this metadata more prominent both for human users and as potentially machine-actionable information (for example, through the API). I would propose to add a metadata field that says when some underlying data was produced. For example, a dataset would be labelled as being produced between `1800-1900`. **Describe alternatives you've considered** This information is sometimes available in the Datacard or a paper describing the dataset. However, it's often not that easy to identify or extract this information, particularly if you want to use this field as a filter to identify relevant datasets. **Additional context** I believe this feature is relevant for a number of reasons: - Increasingly, there is an interest in using historical data for training language models (for example, https://huggingface.co/dbmdz/bert-base-historic-dutch-cased), and datasets to support this task (for example, https://huggingface.co/datasets/bnl_newspapers). For these datasets, indicating the time periods covered is particularly relevant. - More broadly, time is likely a common source of domain drift. Datasets of movie reviews from the 90s may not work well for recent movie reviews. As the documentation and long-term management of ML data become more of a priority, quickly understanding the time when the underlying text (or other data types) is arguably more important. - time-series data: datasets are adding more support for time series data. Again, the periods covered might be particularly relevant here. **open questions** - I think some of my points above apply not only to the underlying data but also to annotations. As a result, there could also be an argument for encoding this information somewhere. However, I would argue (but could be persuaded otherwise) that this is probably less important for filtering. This type of context is already addressed in the datasheets template and often requires more narrative to discuss. - what level of granularity would make sense for this? e.g. assigning a decade, century or year? - how to encode this information? What formatting makes sense - what specific time to encode; a data range? (mean, modal, min, max value?) This is a slightly amorphous feature request - I would be happy to discuss further/try and propose a more concrete solution if this seems like something that could be worth considering. I realise this might also touch on other parts of the 🤗 hubs ecosystem.
987
190
Add a metadata field for when source data was produced **Is your feature request related to a problem? Please describe.** The current problem is that information about when source data was produced is not easily visible. Though there are a variety of metadata fields available in the dataset viewer, time period information is not included. This feature request suggests making metadata relating to the time that the underlying *source* data was produced more prominent and outlines why this specific information is of particular importance, both in domain-specific historic research and more broadly. **Describe the solution you'd like** There are a variety of metadata fields exposed in the dataset viewer (license, task categories, etc.) These fields make this metadata more prominent both for human users and as potentially machine-actionable information (for example, through the API). I would propose to add a metadata field that says when some underlying data was produced. For example, a dataset would be labelled as being produced between `1800-1900`. **Describe alternatives you've considered** This information is sometimes available in the Datacard or a paper describing the dataset. However, it's often not that easy to identify or extract this information, particularly if you want to use this field as a filter to identify relevant datasets. **Additional context** I believe this feature is relevant for a number of reasons: - Increasingly, there is an interest in using historical data for training language models (for example, https://huggingface.co/dbmdz/bert-base-historic-dutch-cased), and datasets to support this task (for example, https://huggingface.co/datasets/bnl_newspapers). For these datasets, indicating the time periods covered is particularly relevant. - More broadly, time is likely a common source of domain drift. Datasets of movie reviews from the 90s may not work well for recent movie reviews. As the documentation and long-term management of ML data become more of a priority, quickly understanding the time when the underlying text (or other data types) is arguably more important. - time-series data: datasets are adding more support for time series data. Again, the periods covered might be particularly relevant here. **open questions** - I think some of my points above apply not only to the underlying data but also to annotations. As a result, there could also be an argument for encoding this information somewhere. However, I would argue (but could be persuaded otherwise) that this is probably less important for filtering. This type of context is already addressed in the datasheets template and often requires more narrative to discuss. - what level of granularity would make sense for this? e.g. assigning a decade, century or year? - how to encode this information? What formatting makes sense - what specific time to encode; a data range? (mean, modal, min, max value?) This is a slightly amorphous feature request - I would be happy to discuss further/try and propose a more concrete solution if this seems like something that could be worth considering. I realise this might also touch on other parts of the 🤗 hubs ecosystem. > Metadata are very important, but defining the standard is always a struggle between allowing exhaustivity without being too complex. Archivists have Dublin Core, open data has [frictionlessdata.io](https://frictionlessdata.io/), geo has ISO 19139 and INSPIRE, etc. and it's always a mess! I'm not sure we want to dig too much into it, but I'm curious to know if there has been some work on the metadata standard. I thought this is a potential issue with adding this field since it might be hard to define what is general enough to be useful for most data vs what becomes very domain-specific. Potentially adding one extra field leads to more and more fields in the future. Another issue is that there are some metadata standards around data i.e. [datacite](https://schema.datacite.org/meta/kernel-4.4/), but not many aimed explicitly at ML data afaik. Some of the discussions around metadata for ML are also more focused on versioning/managing data in production environments. My thinking is that here, some reference to the time of production would also often be tracked/relevant, i.e. for triggering model training, so having this information available in the hub would also help address this use case.
[ -1.2954860925674438, -0.9918079376220703, -0.6771826148033142, 1.2773762941360474, -0.18633553385734558, -1.2720962762832642, 0.10471586883068085, -1.124650239944458, 1.7239423990249634, -0.7835263609886169, 0.2648022174835205, -1.728906273841858, -0.012608734890818596, -0.5998939275741577, -0.7871482968330383, -0.8063772320747375, -0.4729844331741333, -0.8441378474235535, 0.9709751009941101, 2.5746662616729736, 1.1779814958572388, -1.487242341041565, 2.7103352546691895, 0.6813777685165405, -0.14515657722949982, -0.9556789398193359, 0.466907799243927, 0.04114899784326553, -1.3290210962295532, -0.47445616126060486, -0.9758620262145996, -0.030902985483407974, -0.5897318124771118, -0.4705865979194641, 0.005236322060227394, 0.41116270422935486, -0.16917341947555542, -0.40752163529396057, -0.5659245252609253, -0.6530498266220093, 0.45380210876464844, -0.4322144091129303, 0.9617085456848145, -0.3986256420612335, 1.8219773769378662, -0.5663298964500427, 0.37267476320266724, 0.6510388851165771, 1.3508918285369873, 0.21591801941394806, -0.053713154047727585, 0.29726389050483704, 0.3372099697589874, -0.0572592169046402, 0.45734789967536926, 1.1879818439483643, 0.6991208791732788, 0.4439855217933655, 0.7273464202880859, -2.1341261863708496, 1.3606107234954834, -1.0512120723724365, 0.40979287028312683, 1.4274338483810425, -0.9130104184150696, 0.510674774646759, -1.8460971117019653, -0.04150138422846794, 0.5836086869239807, -2.2598869800567627, 0.09360604733228683, -1.185463309288025, -0.5488883256912231, 0.9513773322105408, 0.2742074728012085, -1.272878885269165, 0.21784603595733643, -0.5140342116355896, 0.9737191200256348, 0.39899176359176636, 1.162578821182251, -1.740412950515747, 0.017791762948036194, -0.29648882150650024, 0.15334159135818481, -1.286206603050232, -1.5403470993041992, 0.5743499398231506, 0.669660210609436, 0.5642269849777222, -0.13297565281391144, 0.907821536064148, -1.0735223293304443, 0.8279478549957275, -0.9996257424354553, -1.6506009101867676, -1.4234049320220947, -2.3101282119750977, -2.2638638019561768, 0.8553280234336853, -0.4553053379058838, -0.5442947745323181, 2.025684356689453, -1.0090479850769043, -1.7629330158233643, 1.1754111051559448, 0.26619821786880493, 0.048639826476573944, 2.442105293273926, 0.15066425502300262, -0.7525264620780945, 0.5208364129066467, -0.7000741362571716, 0.7914835810661316, -0.4154852330684662, 1.431467890739441, 0.3954225182533264, -1.0533815622329712, 1.5605489015579224, -0.5141642689704895, 0.4589829444885254, -0.6112108826637268, -0.5415807962417603, -0.7275623679161072, 0.5234147310256958, 1.8367913961410522, -0.2002459317445755, 1.5431671142578125, -0.4683741331100464, -1.5752424001693726, -1.6500598192214966, 0.9072906970977783, 0.5303645730018616, -0.8069954514503479, 0.08027820289134979, -0.3864252269268036, 0.06490503996610641, -0.00593047309666872, 1.0422616004943848, 1.1920949220657349, 0.7604568004608154, -0.304738849401474, -0.9256188869476318, 0.15742366015911102, -0.15643872320652008, -0.6485445499420166, -1.8172367811203003, -0.33045315742492676, 0.1858329176902771, 0.5813127756118774, -1.1930330991744995, 1.7113947868347168, 1.0005624294281006, 1.8941911458969116, 1.0084785223007202, -0.3742299973964691, 1.479838252067566, 0.019839048385620117, 1.81011164188385, -0.5414974093437195, 0.7434530854225159, -0.3584698438644409, -1.1181490421295166, 0.7691612243652344, -0.34317007660865784, -2.06461501121521, -0.7011275887489319, -0.801305890083313, -0.27400335669517517, -0.791819155216217, 0.9832838773727417, -0.14327608048915863, -1.2892080545425415, 0.2912803292274475, -0.6560148000717163, 0.12343377619981766, -1.202584981918335, 0.3215523660182953, 0.7527092099189758, -0.6817118525505066, 0.009144901297986507, -0.2766416072845459, -1.365676999092102, -0.5508480072021484, 0.24413460493087769, 1.7600648403167725, -0.7329161167144775, 0.8428336977958679, 0.9852453470230103, -0.6652056574821472, 0.017024900764226913, 0.3905518054962158, -0.2849591076374054, 0.8588306903839111, -0.9599354267120361, -0.4113661050796509, 1.0776081085205078, -0.20438982546329498, -0.4848903715610504, 1.4599744081497192, 0.623933732509613, -0.9785727858543396, -0.18982400000095367, -0.22288329899311066, -0.8933509588241577, -0.013817504979670048, -1.6204557418823242, -0.1478600800037384, 0.2621404230594635, -1.4719669818878174, -0.49724456667900085, -0.2515340745449066, 1.2738920450210571, -0.0741061195731163, 1.3569031953811646, -0.28761956095695496, -0.16992485523223877, -0.4198386073112488, -0.338539183139801, 0.15496990084648132, -0.19007079303264618, -0.5427848696708679, 0.2670881450176239, -0.8518688678741455, 0.2741571068763733, 1.4438765048980713, 0.466328501701355, 0.021484624594449997, 0.4823378920555115, 1.0503301620483398, 0.38097429275512695, -0.13805542886257172, -0.8819799423217773, -1.5207362174987793, 1.9884439706802368, -1.4814584255218506, 1.8951529264450073, 0.9049115777015686, -0.0032944991253316402, -1.801323413848877, -1.8106321096420288, 1.3829478025436401, 1.176178216934204, 2.4406769275665283, 0.527159571647644, 0.3664335310459137, -0.8392391204833984, -0.6741625070571899, 0.3958643674850464, -1.0209691524505615, -0.8138527870178223, 0.052248477935791016, 2.3965160846710205, 1.8695048093795776, -0.5389474630355835, -0.1598886400461197, -1.0250695943832397, 1.402294397354126, -0.19913209974765778, 0.18792231380939484, 2.0143351554870605, -0.3928488790988922, -1.0708364248275757, 1.3474290370941162, -2.3556406497955322, 0.11669518798589706, 1.9440498352050781, 0.29042813181877136, 0.11210794746875763, -1.3851290941238403, -0.6069506406784058, -0.25284242630004883, -0.41305413842201233, -1.2769503593444824, 0.5864463448524475, -0.277547687292099, -0.8116663694381714, -1.544958472251892, 0.1275758147239685, -1.2460745573043823, -1.5857309103012085, 0.3636821508407593, 1.8068071603775024, 2.1110684871673584, -0.7092276811599731, 1.4731810092926025, -0.2228054255247116, 0.19184674322605133, 1.1830484867095947, 1.1881839036941528, 3.203667640686035, 1.8895149230957031, -1.2373358011245728, 0.577666163444519, -0.2625032067298889, -0.4911275804042816, 1.0844414234161377, -1.1214344501495361, 1.2678661346435547, -0.1736682504415512, -1.2179702520370483, -1.1889243125915527, 1.0307416915893555, 0.5178147554397583, 0.04823978245258331, -0.529536783695221, 1.136237621307373, 0.11909795552492142, 1.2964776754379272, 0.5195127129554749, -0.31050360202789307, 0.5888598561286926, -0.498768150806427, -0.5425723195075989, 1.525920033454895, 0.26820024847984314, -1.4567921161651611, -2.260812997817993, -0.24611787497997284, -0.8911052346229553, 0.03985248878598213, -0.5994177460670471, -0.9527132511138916, 1.5785471200942993, 0.39801284670829773, -1.301138997077942, -0.22927974164485931, -0.37997570633888245, -0.6635751724243164, 2.5448923110961914, -1.3923249244689941, -0.26326367259025574, -0.9245645999908447, -0.5385798215866089, 1.594110131263733, -1.2247666120529175, -0.11486298590898514, -1.0478330850601196, -0.6658095121383667, -1.3087915182113647, -0.5434962511062622, -0.07210282236337662, -0.8810672163963318, 0.8370343446731567, 0.20796571671962738, -1.0801547765731812, -0.3589296340942383, -0.905720591545105, 0.7979149222373962, -0.12317121773958206, 0.2603492736816406, 1.8238420486450195, 0.3912554085254669, -0.39170023798942566, 0.6933196783065796, 1.2040385007858276, 0.6461063027381897, -0.5665567517280579, 0.14973366260528564, -0.704404354095459, 0.39768245816230774, -1.2704756259918213, 0.317746102809906, -2.910423517227173, 0.6788537502288818, -0.014762316830456257, -0.07866216450929642, 0.0054107001051306725, -1.2576885223388672, 1.1077224016189575, 2.581354856491089, -1.1394386291503906, 0.4485984146595001, 0.40083277225494385, 1.1431419849395752, -1.5552929639816284, 0.35098856687545776, -0.42251619696617126, 2.1243536472320557, 0.07712601870298386, 1.1131236553192139, -0.5846381187438965, -2.275239944458008, 0.5067342519760132, -1.2633005380630493, -1.1478822231292725, 0.689487636089325, -0.8039058446884155, 0.08353915810585022, -1.5507454872131348, -0.12814469635486603, -0.9367653727531433, -1.1851519346237183, 0.7539933323860168, 0.11864756792783737, 0.43274664878845215, -0.6576327085494995, 0.3123367726802826, -2.135575532913208, -1.40360689163208, -0.3505246639251709, -0.857808530330658, 0.4579911231994629, -0.2887048125267029, 0.73209148645401, -0.1129709929227829, 0.023725148290395737, 0.311849445104599, 1.3615751266479492, 3.314162254333496, 0.16459313035011292, 0.4254549741744995, -0.12814345955848694, -0.9316307306289673, 1.4518229961395264, 1.0046888589859009, -0.06839211285114288, -0.5604676008224487, -1.021689534187317, 1.3408344984054565, 1.9443947076797485, 0.9829362034797668, 0.09995656460523605, -0.7824310064315796, -0.6758540272712708, 0.019289333373308182, 0.22614668309688568, 0.46887749433517456, 0.9411765336990356, -0.013688361272215843, 0.1430797576904297, 1.5231635570526123, 1.3120574951171875, -0.4493284821510315, 0.395891010761261, -0.7981895804405212, -0.568646252155304, 0.422774076461792, 0.36309656500816345, 0.019388917833566666, 0.3159848749637604, -1.0379525423049927, -0.27053022384643555, -0.30620479583740234, -1.0466645956039429, -0.6519547700881958, -0.43392127752304077, -0.45012015104293823, 1.6553887128829956, 0.1724270135164261, -0.5358833074569702, 0.04957791417837143, -0.7806655168533325, -0.12124983966350555, -1.0376718044281006, 0.3400399684906006, -0.06155388057231903, -0.08655285835266113, -0.22375543415546417, 1.831114411354065, -0.9012652635574341, -2.0513415336608887, 0.24132874608039856, 0.26860836148262024, -0.40520697832107544, 0.2069939821958542, 1.6106468439102173, 0.557324230670929, 1.5809175968170166, 1.3218191862106323, 0.976538896560669, -0.5523531436920166, -1.3180078268051147, 0.7860857844352722, 0.9645277857780457, -1.3889927864074707, 0.8548648953437805, 0.031929317861795425, -0.580992579460144, 0.7349236011505127, 1.2909140586853027, 0.3843958079814911, -1.997248888015747, 0.8720492720603943, -0.9517286419868469, 0.820469081401825, 0.6324418187141418, 0.7300575971603394, 0.1809413731098175, 0.7746932506561279, -1.3616857528686523, -1.2050460577011108, -0.8419363498687744, -0.6246022582054138, 2.0716843605041504, -0.21833983063697815, 0.5738869905471802, -0.16405460238456726, -1.2672055959701538, -0.05146823078393936, 0.6675738096237183, 0.3956016004085541, -0.4104832708835602, 0.7597376704216003, -0.6685794591903687, -1.1664131879806519, -1.4471569061279297, -0.34254786372184753, -0.9712684750556946, -0.806984007358551, 1.0441877841949463, 0.9109646081924438, 0.32933035492897034, 1.8862344026565552, 0.6098386645317078, 0.22539576888084412, -2.602558135986328, 0.8904834985733032, 0.293900728225708, -0.07708588242530823, 0.8935855031013489, 0.24194535613059998, 1.0033681392669678, 0.026752550154924393, 0.5653285384178162, -2.4130842685699463, 2.2201449871063232, -0.19828258454799652, 0.7421579360961914, -0.01910679042339325, -0.18747103214263916, 1.1271313428878784, 0.5953782200813293, 0.5588861107826233, -1.0356677770614624, 0.6669304370880127, -0.5260002613067627, 1.2549450397491455, 0.9074306488037109, -0.7011582851409912, -0.06580772250890732, 1.2312132120132446, 0.4955216348171234, -0.4888345003128052, -0.9632371664047241, -0.9613767862319946, 0.9329451322555542, 1.7924760580062866, -0.08765562623739243, -0.0012774509377777576, 0.8090787529945374, 0.7279645800590515, -1.3031024932861328, 0.09062399715185165, -0.797419011592865, -0.7483176589012146, 1.5685629844665527, 2.075584888458252, -0.04114871844649315, -0.14261294901371002, -0.62555330991745, -1.2903032302856445, 0.7602460384368896, 0.02232862263917923, 0.18577466905117035, 0.7317137122154236, -0.6345881819725037, 1.1016989946365356, 0.9129447937011719, 0.8930256962776184, 0.16618409752845764, 0.3141600787639618, 0.3969152569770813, -0.27905210852622986, -1.1728311777114868, -0.22862257063388824, -1.1408741474151611, -2.4582650661468506, 0.4209509491920471, -0.223891019821167, -1.518932580947876, -0.04028526693582535, -0.9723424315452576, 0.9367765784263611, -0.485577255487442, -1.20724618434906, -1.5602833032608032, 0.19368387758731842, 0.041831426322460175, 0.9520712494850159, -1.6297175884246826, -0.06282385438680649, 1.122146725654602, 0.8748999238014221, -0.5760457515716553, 0.9454171657562256, 0.3306717276573181, 0.9868580102920532, 0.8847270011901855, -0.39083150029182434, 0.40717530250549316, 0.0891513079404831, -1.3830695152282715, 0.41511228680610657, 1.1164826154708862, 0.14807389676570892, 1.3117461204528809, -0.5300977230072021, 0.03894229978322983, 0.4745527505874634, -0.4651638865470886, -0.33486542105674744, -0.4837903380393982, 0.6629406213760376, 0.060012124478816986, -0.838036298751831, -0.003066232893615961, -0.02895524725317955, -0.2705613076686859, 0.17447473108768463, -1.4124892950057983, -0.20210641622543335, -0.4736209809780121, -0.5303911566734314, -1.2469602823257446, -0.04659375920891762, 1.429724931716919, -0.7668034434318542, -0.18516215682029724, 0.5599067211151123, 0.4399898648262024, 0.5632097125053406, 0.7186381816864014, -0.6203739643096924, -0.3923547565937042, -0.22796234488487244, -0.3715788424015045, 0.23982320725917816, 1.3196862936019897, -0.10348670929670334, -0.9980641603469849, 0.7347108721733093, -0.4314841330051422, 0.033573172986507416, 1.955396294593811, 0.12299323827028275, -0.8432226181030273, 0.41470733284950256, -0.7496023178100586, 1.8214111328125, 1.7223422527313232, 1.264087438583374, -0.06470470875501633, -0.9652772545814514, 0.6130855679512024, -0.27031850814819336, -0.37780994176864624, 1.001777172088623, 0.46402978897094727, -0.15789440274238586, -1.4190536737442017, 0.6012121438980103, 1.29469633102417, -0.8608956933021545, -0.7440143823623657, 0.11491181701421738, -0.8356037735939026, 1.1919981241226196, 0.7916014194488525, 0.42976415157318115, 0.19631540775299072, 1.7223103046417236, 0.7081571221351624, -0.47543808817863464, 0.5586233139038086, 0.5651798844337463, -0.22824573516845703, -2.1573197841644287, -1.2033642530441284, 0.1150982603430748, -0.431602418422699, -1.4808378219604492, 1.2851817607879639, -1.198608160018921, -0.956282913684845, 0.45253247022628784, -0.044279083609580994, 1.4826757907867432, 0.35421910881996155, 1.6427860260009766, 2.1539766788482666, 0.9715793132781982, 0.3574897348880768, 1.419386863708496, -0.054437559098005295, -0.32591062784194946, 1.8595287799835205, -0.4306674003601074, 0.5128552317619324, 1.1436463594436646, -0.3376633822917938, -1.116989016532898, -0.7648721933364868, -1.1092588901519775, -0.6632434725761414, 1.1660641431808472, 0.05057559162378311, -1.1109375953674316, 0.30000752210617065, 1.5834689140319824, 0.14130856096744537, -0.32697176933288574, 0.42861655354499817, 0.4929659068584442, -0.7966773509979248, -0.07632950693368912, -1.0019195079803467, 0.5027468800544739, -0.32091569900512695, -0.3723258078098297, 0.3506164848804474, 0.5027207136154175, 1.271889328956604, -0.028621826320886612, 0.20558863878250122, 1.1359692811965942, -1.5247530937194824, 1.4195001125335693, -0.6762034296989441, 0.2034732848405838, -2.418086051940918, 1.5011974573135376, -0.7415038347244263, 1.998395562171936, -2.7451374530792236, 0.39475786685943604, -0.5664682388305664, -0.5438746809959412, 0.36986711621284485, -0.2950306236743927, 0.1508813053369522, -0.12198343873023987, -1.1035888195037842, -0.046787820756435394, -0.6635032892227173, 0.5772014856338501, 1.1452230215072632, 1.328978419303894, -1.047690510749817, -0.30745169520378113, -1.6352500915527344, -0.20987704396247864, -0.7485408782958984, 0.27492955327033997, -1.9723879098892212, -0.11063872277736664, -1.8962411880493164, -2.2518019676208496, -1.4143781661987305, -0.9247217178344727, 1.1316490173339844, 0.1347341239452362, -0.9351359009742737, 1.0900964736938477, -0.45246991515159607, -1.864540696144104, 1.0774809122085571, -2.164776563644409 ]
https://github.com/huggingface/datasets/issues/3625
Add a metadata field for when source data was produced
Also related: the [Data Catalog Vocabulary - DCAT](https://www.w3.org/TR/vocab-dcat/) standard will be discussed in a new Working Group at the W3C: https://www.w3.org/2022/06/dx-wg-charter.html
**Is your feature request related to a problem? Please describe.** The current problem is that information about when source data was produced is not easily visible. Though there are a variety of metadata fields available in the dataset viewer, time period information is not included. This feature request suggests making metadata relating to the time that the underlying *source* data was produced more prominent and outlines why this specific information is of particular importance, both in domain-specific historic research and more broadly. **Describe the solution you'd like** There are a variety of metadata fields exposed in the dataset viewer (license, task categories, etc.) These fields make this metadata more prominent both for human users and as potentially machine-actionable information (for example, through the API). I would propose to add a metadata field that says when some underlying data was produced. For example, a dataset would be labelled as being produced between `1800-1900`. **Describe alternatives you've considered** This information is sometimes available in the Datacard or a paper describing the dataset. However, it's often not that easy to identify or extract this information, particularly if you want to use this field as a filter to identify relevant datasets. **Additional context** I believe this feature is relevant for a number of reasons: - Increasingly, there is an interest in using historical data for training language models (for example, https://huggingface.co/dbmdz/bert-base-historic-dutch-cased), and datasets to support this task (for example, https://huggingface.co/datasets/bnl_newspapers). For these datasets, indicating the time periods covered is particularly relevant. - More broadly, time is likely a common source of domain drift. Datasets of movie reviews from the 90s may not work well for recent movie reviews. As the documentation and long-term management of ML data become more of a priority, quickly understanding the time when the underlying text (or other data types) is arguably more important. - time-series data: datasets are adding more support for time series data. Again, the periods covered might be particularly relevant here. **open questions** - I think some of my points above apply not only to the underlying data but also to annotations. As a result, there could also be an argument for encoding this information somewhere. However, I would argue (but could be persuaded otherwise) that this is probably less important for filtering. This type of context is already addressed in the datasheets template and often requires more narrative to discuss. - what level of granularity would make sense for this? e.g. assigning a decade, century or year? - how to encode this information? What formatting makes sense - what specific time to encode; a data range? (mean, modal, min, max value?) This is a slightly amorphous feature request - I would be happy to discuss further/try and propose a more concrete solution if this seems like something that could be worth considering. I realise this might also touch on other parts of the 🤗 hubs ecosystem.
987
21
Add a metadata field for when source data was produced **Is your feature request related to a problem? Please describe.** The current problem is that information about when source data was produced is not easily visible. Though there are a variety of metadata fields available in the dataset viewer, time period information is not included. This feature request suggests making metadata relating to the time that the underlying *source* data was produced more prominent and outlines why this specific information is of particular importance, both in domain-specific historic research and more broadly. **Describe the solution you'd like** There are a variety of metadata fields exposed in the dataset viewer (license, task categories, etc.) These fields make this metadata more prominent both for human users and as potentially machine-actionable information (for example, through the API). I would propose to add a metadata field that says when some underlying data was produced. For example, a dataset would be labelled as being produced between `1800-1900`. **Describe alternatives you've considered** This information is sometimes available in the Datacard or a paper describing the dataset. However, it's often not that easy to identify or extract this information, particularly if you want to use this field as a filter to identify relevant datasets. **Additional context** I believe this feature is relevant for a number of reasons: - Increasingly, there is an interest in using historical data for training language models (for example, https://huggingface.co/dbmdz/bert-base-historic-dutch-cased), and datasets to support this task (for example, https://huggingface.co/datasets/bnl_newspapers). For these datasets, indicating the time periods covered is particularly relevant. - More broadly, time is likely a common source of domain drift. Datasets of movie reviews from the 90s may not work well for recent movie reviews. As the documentation and long-term management of ML data become more of a priority, quickly understanding the time when the underlying text (or other data types) is arguably more important. - time-series data: datasets are adding more support for time series data. Again, the periods covered might be particularly relevant here. **open questions** - I think some of my points above apply not only to the underlying data but also to annotations. As a result, there could also be an argument for encoding this information somewhere. However, I would argue (but could be persuaded otherwise) that this is probably less important for filtering. This type of context is already addressed in the datasheets template and often requires more narrative to discuss. - what level of granularity would make sense for this? e.g. assigning a decade, century or year? - how to encode this information? What formatting makes sense - what specific time to encode; a data range? (mean, modal, min, max value?) This is a slightly amorphous feature request - I would be happy to discuss further/try and propose a more concrete solution if this seems like something that could be worth considering. I realise this might also touch on other parts of the 🤗 hubs ecosystem. Also related: the [Data Catalog Vocabulary - DCAT](https://www.w3.org/TR/vocab-dcat/) standard will be discussed in a new Working Group at the W3C: https://www.w3.org/2022/06/dx-wg-charter.html
[ -1.2954860925674438, -0.9918079376220703, -0.6771826148033142, 1.2773762941360474, -0.18633553385734558, -1.2720962762832642, 0.10471586883068085, -1.124650239944458, 1.7239423990249634, -0.7835263609886169, 0.2648022174835205, -1.728906273841858, -0.012608734890818596, -0.5998939275741577, -0.7871482968330383, -0.8063772320747375, -0.4729844331741333, -0.8441378474235535, 0.9709751009941101, 2.5746662616729736, 1.1779814958572388, -1.487242341041565, 2.7103352546691895, 0.6813777685165405, -0.14515657722949982, -0.9556789398193359, 0.466907799243927, 0.04114899784326553, -1.3290210962295532, -0.47445616126060486, -0.9758620262145996, -0.030902985483407974, -0.5897318124771118, -0.4705865979194641, 0.005236322060227394, 0.41116270422935486, -0.16917341947555542, -0.40752163529396057, -0.5659245252609253, -0.6530498266220093, 0.45380210876464844, -0.4322144091129303, 0.9617085456848145, -0.3986256420612335, 1.8219773769378662, -0.5663298964500427, 0.37267476320266724, 0.6510388851165771, 1.3508918285369873, 0.21591801941394806, -0.053713154047727585, 0.29726389050483704, 0.3372099697589874, -0.0572592169046402, 0.45734789967536926, 1.1879818439483643, 0.6991208791732788, 0.4439855217933655, 0.7273464202880859, -2.1341261863708496, 1.3606107234954834, -1.0512120723724365, 0.40979287028312683, 1.4274338483810425, -0.9130104184150696, 0.510674774646759, -1.8460971117019653, -0.04150138422846794, 0.5836086869239807, -2.2598869800567627, 0.09360604733228683, -1.185463309288025, -0.5488883256912231, 0.9513773322105408, 0.2742074728012085, -1.272878885269165, 0.21784603595733643, -0.5140342116355896, 0.9737191200256348, 0.39899176359176636, 1.162578821182251, -1.740412950515747, 0.017791762948036194, -0.29648882150650024, 0.15334159135818481, -1.286206603050232, -1.5403470993041992, 0.5743499398231506, 0.669660210609436, 0.5642269849777222, -0.13297565281391144, 0.907821536064148, -1.0735223293304443, 0.8279478549957275, -0.9996257424354553, -1.6506009101867676, -1.4234049320220947, -2.3101282119750977, -2.2638638019561768, 0.8553280234336853, -0.4553053379058838, -0.5442947745323181, 2.025684356689453, -1.0090479850769043, -1.7629330158233643, 1.1754111051559448, 0.26619821786880493, 0.048639826476573944, 2.442105293273926, 0.15066425502300262, -0.7525264620780945, 0.5208364129066467, -0.7000741362571716, 0.7914835810661316, -0.4154852330684662, 1.431467890739441, 0.3954225182533264, -1.0533815622329712, 1.5605489015579224, -0.5141642689704895, 0.4589829444885254, -0.6112108826637268, -0.5415807962417603, -0.7275623679161072, 0.5234147310256958, 1.8367913961410522, -0.2002459317445755, 1.5431671142578125, -0.4683741331100464, -1.5752424001693726, -1.6500598192214966, 0.9072906970977783, 0.5303645730018616, -0.8069954514503479, 0.08027820289134979, -0.3864252269268036, 0.06490503996610641, -0.00593047309666872, 1.0422616004943848, 1.1920949220657349, 0.7604568004608154, -0.304738849401474, -0.9256188869476318, 0.15742366015911102, -0.15643872320652008, -0.6485445499420166, -1.8172367811203003, -0.33045315742492676, 0.1858329176902771, 0.5813127756118774, -1.1930330991744995, 1.7113947868347168, 1.0005624294281006, 1.8941911458969116, 1.0084785223007202, -0.3742299973964691, 1.479838252067566, 0.019839048385620117, 1.81011164188385, -0.5414974093437195, 0.7434530854225159, -0.3584698438644409, -1.1181490421295166, 0.7691612243652344, -0.34317007660865784, -2.06461501121521, -0.7011275887489319, -0.801305890083313, -0.27400335669517517, -0.791819155216217, 0.9832838773727417, -0.14327608048915863, -1.2892080545425415, 0.2912803292274475, -0.6560148000717163, 0.12343377619981766, -1.202584981918335, 0.3215523660182953, 0.7527092099189758, -0.6817118525505066, 0.009144901297986507, -0.2766416072845459, -1.365676999092102, -0.5508480072021484, 0.24413460493087769, 1.7600648403167725, -0.7329161167144775, 0.8428336977958679, 0.9852453470230103, -0.6652056574821472, 0.017024900764226913, 0.3905518054962158, -0.2849591076374054, 0.8588306903839111, -0.9599354267120361, -0.4113661050796509, 1.0776081085205078, -0.20438982546329498, -0.4848903715610504, 1.4599744081497192, 0.623933732509613, -0.9785727858543396, -0.18982400000095367, -0.22288329899311066, -0.8933509588241577, -0.013817504979670048, -1.6204557418823242, -0.1478600800037384, 0.2621404230594635, -1.4719669818878174, -0.49724456667900085, -0.2515340745449066, 1.2738920450210571, -0.0741061195731163, 1.3569031953811646, -0.28761956095695496, -0.16992485523223877, -0.4198386073112488, -0.338539183139801, 0.15496990084648132, -0.19007079303264618, -0.5427848696708679, 0.2670881450176239, -0.8518688678741455, 0.2741571068763733, 1.4438765048980713, 0.466328501701355, 0.021484624594449997, 0.4823378920555115, 1.0503301620483398, 0.38097429275512695, -0.13805542886257172, -0.8819799423217773, -1.5207362174987793, 1.9884439706802368, -1.4814584255218506, 1.8951529264450073, 0.9049115777015686, -0.0032944991253316402, -1.801323413848877, -1.8106321096420288, 1.3829478025436401, 1.176178216934204, 2.4406769275665283, 0.527159571647644, 0.3664335310459137, -0.8392391204833984, -0.6741625070571899, 0.3958643674850464, -1.0209691524505615, -0.8138527870178223, 0.052248477935791016, 2.3965160846710205, 1.8695048093795776, -0.5389474630355835, -0.1598886400461197, -1.0250695943832397, 1.402294397354126, -0.19913209974765778, 0.18792231380939484, 2.0143351554870605, -0.3928488790988922, -1.0708364248275757, 1.3474290370941162, -2.3556406497955322, 0.11669518798589706, 1.9440498352050781, 0.29042813181877136, 0.11210794746875763, -1.3851290941238403, -0.6069506406784058, -0.25284242630004883, -0.41305413842201233, -1.2769503593444824, 0.5864463448524475, -0.277547687292099, -0.8116663694381714, -1.544958472251892, 0.1275758147239685, -1.2460745573043823, -1.5857309103012085, 0.3636821508407593, 1.8068071603775024, 2.1110684871673584, -0.7092276811599731, 1.4731810092926025, -0.2228054255247116, 0.19184674322605133, 1.1830484867095947, 1.1881839036941528, 3.203667640686035, 1.8895149230957031, -1.2373358011245728, 0.577666163444519, -0.2625032067298889, -0.4911275804042816, 1.0844414234161377, -1.1214344501495361, 1.2678661346435547, -0.1736682504415512, -1.2179702520370483, -1.1889243125915527, 1.0307416915893555, 0.5178147554397583, 0.04823978245258331, -0.529536783695221, 1.136237621307373, 0.11909795552492142, 1.2964776754379272, 0.5195127129554749, -0.31050360202789307, 0.5888598561286926, -0.498768150806427, -0.5425723195075989, 1.525920033454895, 0.26820024847984314, -1.4567921161651611, -2.260812997817993, -0.24611787497997284, -0.8911052346229553, 0.03985248878598213, -0.5994177460670471, -0.9527132511138916, 1.5785471200942993, 0.39801284670829773, -1.301138997077942, -0.22927974164485931, -0.37997570633888245, -0.6635751724243164, 2.5448923110961914, -1.3923249244689941, -0.26326367259025574, -0.9245645999908447, -0.5385798215866089, 1.594110131263733, -1.2247666120529175, -0.11486298590898514, -1.0478330850601196, -0.6658095121383667, -1.3087915182113647, -0.5434962511062622, -0.07210282236337662, -0.8810672163963318, 0.8370343446731567, 0.20796571671962738, -1.0801547765731812, -0.3589296340942383, -0.905720591545105, 0.7979149222373962, -0.12317121773958206, 0.2603492736816406, 1.8238420486450195, 0.3912554085254669, -0.39170023798942566, 0.6933196783065796, 1.2040385007858276, 0.6461063027381897, -0.5665567517280579, 0.14973366260528564, -0.704404354095459, 0.39768245816230774, -1.2704756259918213, 0.317746102809906, -2.910423517227173, 0.6788537502288818, -0.014762316830456257, -0.07866216450929642, 0.0054107001051306725, -1.2576885223388672, 1.1077224016189575, 2.581354856491089, -1.1394386291503906, 0.4485984146595001, 0.40083277225494385, 1.1431419849395752, -1.5552929639816284, 0.35098856687545776, -0.42251619696617126, 2.1243536472320557, 0.07712601870298386, 1.1131236553192139, -0.5846381187438965, -2.275239944458008, 0.5067342519760132, -1.2633005380630493, -1.1478822231292725, 0.689487636089325, -0.8039058446884155, 0.08353915810585022, -1.5507454872131348, -0.12814469635486603, -0.9367653727531433, -1.1851519346237183, 0.7539933323860168, 0.11864756792783737, 0.43274664878845215, -0.6576327085494995, 0.3123367726802826, -2.135575532913208, -1.40360689163208, -0.3505246639251709, -0.857808530330658, 0.4579911231994629, -0.2887048125267029, 0.73209148645401, -0.1129709929227829, 0.023725148290395737, 0.311849445104599, 1.3615751266479492, 3.314162254333496, 0.16459313035011292, 0.4254549741744995, -0.12814345955848694, -0.9316307306289673, 1.4518229961395264, 1.0046888589859009, -0.06839211285114288, -0.5604676008224487, -1.021689534187317, 1.3408344984054565, 1.9443947076797485, 0.9829362034797668, 0.09995656460523605, -0.7824310064315796, -0.6758540272712708, 0.019289333373308182, 0.22614668309688568, 0.46887749433517456, 0.9411765336990356, -0.013688361272215843, 0.1430797576904297, 1.5231635570526123, 1.3120574951171875, -0.4493284821510315, 0.395891010761261, -0.7981895804405212, -0.568646252155304, 0.422774076461792, 0.36309656500816345, 0.019388917833566666, 0.3159848749637604, -1.0379525423049927, -0.27053022384643555, -0.30620479583740234, -1.0466645956039429, -0.6519547700881958, -0.43392127752304077, -0.45012015104293823, 1.6553887128829956, 0.1724270135164261, -0.5358833074569702, 0.04957791417837143, -0.7806655168533325, -0.12124983966350555, -1.0376718044281006, 0.3400399684906006, -0.06155388057231903, -0.08655285835266113, -0.22375543415546417, 1.831114411354065, -0.9012652635574341, -2.0513415336608887, 0.24132874608039856, 0.26860836148262024, -0.40520697832107544, 0.2069939821958542, 1.6106468439102173, 0.557324230670929, 1.5809175968170166, 1.3218191862106323, 0.976538896560669, -0.5523531436920166, -1.3180078268051147, 0.7860857844352722, 0.9645277857780457, -1.3889927864074707, 0.8548648953437805, 0.031929317861795425, -0.580992579460144, 0.7349236011505127, 1.2909140586853027, 0.3843958079814911, -1.997248888015747, 0.8720492720603943, -0.9517286419868469, 0.820469081401825, 0.6324418187141418, 0.7300575971603394, 0.1809413731098175, 0.7746932506561279, -1.3616857528686523, -1.2050460577011108, -0.8419363498687744, -0.6246022582054138, 2.0716843605041504, -0.21833983063697815, 0.5738869905471802, -0.16405460238456726, -1.2672055959701538, -0.05146823078393936, 0.6675738096237183, 0.3956016004085541, -0.4104832708835602, 0.7597376704216003, -0.6685794591903687, -1.1664131879806519, -1.4471569061279297, -0.34254786372184753, -0.9712684750556946, -0.806984007358551, 1.0441877841949463, 0.9109646081924438, 0.32933035492897034, 1.8862344026565552, 0.6098386645317078, 0.22539576888084412, -2.602558135986328, 0.8904834985733032, 0.293900728225708, -0.07708588242530823, 0.8935855031013489, 0.24194535613059998, 1.0033681392669678, 0.026752550154924393, 0.5653285384178162, -2.4130842685699463, 2.2201449871063232, -0.19828258454799652, 0.7421579360961914, -0.01910679042339325, -0.18747103214263916, 1.1271313428878784, 0.5953782200813293, 0.5588861107826233, -1.0356677770614624, 0.6669304370880127, -0.5260002613067627, 1.2549450397491455, 0.9074306488037109, -0.7011582851409912, -0.06580772250890732, 1.2312132120132446, 0.4955216348171234, -0.4888345003128052, -0.9632371664047241, -0.9613767862319946, 0.9329451322555542, 1.7924760580062866, -0.08765562623739243, -0.0012774509377777576, 0.8090787529945374, 0.7279645800590515, -1.3031024932861328, 0.09062399715185165, -0.797419011592865, -0.7483176589012146, 1.5685629844665527, 2.075584888458252, -0.04114871844649315, -0.14261294901371002, -0.62555330991745, -1.2903032302856445, 0.7602460384368896, 0.02232862263917923, 0.18577466905117035, 0.7317137122154236, -0.6345881819725037, 1.1016989946365356, 0.9129447937011719, 0.8930256962776184, 0.16618409752845764, 0.3141600787639618, 0.3969152569770813, -0.27905210852622986, -1.1728311777114868, -0.22862257063388824, -1.1408741474151611, -2.4582650661468506, 0.4209509491920471, -0.223891019821167, -1.518932580947876, -0.04028526693582535, -0.9723424315452576, 0.9367765784263611, -0.485577255487442, -1.20724618434906, -1.5602833032608032, 0.19368387758731842, 0.041831426322460175, 0.9520712494850159, -1.6297175884246826, -0.06282385438680649, 1.122146725654602, 0.8748999238014221, -0.5760457515716553, 0.9454171657562256, 0.3306717276573181, 0.9868580102920532, 0.8847270011901855, -0.39083150029182434, 0.40717530250549316, 0.0891513079404831, -1.3830695152282715, 0.41511228680610657, 1.1164826154708862, 0.14807389676570892, 1.3117461204528809, -0.5300977230072021, 0.03894229978322983, 0.4745527505874634, -0.4651638865470886, -0.33486542105674744, -0.4837903380393982, 0.6629406213760376, 0.060012124478816986, -0.838036298751831, -0.003066232893615961, -0.02895524725317955, -0.2705613076686859, 0.17447473108768463, -1.4124892950057983, -0.20210641622543335, -0.4736209809780121, -0.5303911566734314, -1.2469602823257446, -0.04659375920891762, 1.429724931716919, -0.7668034434318542, -0.18516215682029724, 0.5599067211151123, 0.4399898648262024, 0.5632097125053406, 0.7186381816864014, -0.6203739643096924, -0.3923547565937042, -0.22796234488487244, -0.3715788424015045, 0.23982320725917816, 1.3196862936019897, -0.10348670929670334, -0.9980641603469849, 0.7347108721733093, -0.4314841330051422, 0.033573172986507416, 1.955396294593811, 0.12299323827028275, -0.8432226181030273, 0.41470733284950256, -0.7496023178100586, 1.8214111328125, 1.7223422527313232, 1.264087438583374, -0.06470470875501633, -0.9652772545814514, 0.6130855679512024, -0.27031850814819336, -0.37780994176864624, 1.001777172088623, 0.46402978897094727, -0.15789440274238586, -1.4190536737442017, 0.6012121438980103, 1.29469633102417, -0.8608956933021545, -0.7440143823623657, 0.11491181701421738, -0.8356037735939026, 1.1919981241226196, 0.7916014194488525, 0.42976415157318115, 0.19631540775299072, 1.7223103046417236, 0.7081571221351624, -0.47543808817863464, 0.5586233139038086, 0.5651798844337463, -0.22824573516845703, -2.1573197841644287, -1.2033642530441284, 0.1150982603430748, -0.431602418422699, -1.4808378219604492, 1.2851817607879639, -1.198608160018921, -0.956282913684845, 0.45253247022628784, -0.044279083609580994, 1.4826757907867432, 0.35421910881996155, 1.6427860260009766, 2.1539766788482666, 0.9715793132781982, 0.3574897348880768, 1.419386863708496, -0.054437559098005295, -0.32591062784194946, 1.8595287799835205, -0.4306674003601074, 0.5128552317619324, 1.1436463594436646, -0.3376633822917938, -1.116989016532898, -0.7648721933364868, -1.1092588901519775, -0.6632434725761414, 1.1660641431808472, 0.05057559162378311, -1.1109375953674316, 0.30000752210617065, 1.5834689140319824, 0.14130856096744537, -0.32697176933288574, 0.42861655354499817, 0.4929659068584442, -0.7966773509979248, -0.07632950693368912, -1.0019195079803467, 0.5027468800544739, -0.32091569900512695, -0.3723258078098297, 0.3506164848804474, 0.5027207136154175, 1.271889328956604, -0.028621826320886612, 0.20558863878250122, 1.1359692811965942, -1.5247530937194824, 1.4195001125335693, -0.6762034296989441, 0.2034732848405838, -2.418086051940918, 1.5011974573135376, -0.7415038347244263, 1.998395562171936, -2.7451374530792236, 0.39475786685943604, -0.5664682388305664, -0.5438746809959412, 0.36986711621284485, -0.2950306236743927, 0.1508813053369522, -0.12198343873023987, -1.1035888195037842, -0.046787820756435394, -0.6635032892227173, 0.5772014856338501, 1.1452230215072632, 1.328978419303894, -1.047690510749817, -0.30745169520378113, -1.6352500915527344, -0.20987704396247864, -0.7485408782958984, 0.27492955327033997, -1.9723879098892212, -0.11063872277736664, -1.8962411880493164, -2.2518019676208496, -1.4143781661987305, -0.9247217178344727, 1.1316490173339844, 0.1347341239452362, -0.9351359009742737, 1.0900964736938477, -0.45246991515159607, -1.864540696144104, 1.0774809122085571, -2.164776563644409 ]
https://github.com/huggingface/datasets/issues/3621
Consider adding `ipywidgets` as a dependency.
Hi! We use `tqdm` to display progress bars, so I suggest you open this issue in their repo.
When I install `datasets` in a fresh virtualenv with jupyterlab I always see this error. ``` ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html ``` It's a bit of a nuisance, because I need to run shut down the jupyterlab server in order to install the required dependency. Might it be an option to just include it as a dependency here?
988
18
Consider adding `ipywidgets` as a dependency. When I install `datasets` in a fresh virtualenv with jupyterlab I always see this error. ``` ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html ``` It's a bit of a nuisance, because I need to run shut down the jupyterlab server in order to install the required dependency. Might it be an option to just include it as a dependency here? Hi! We use `tqdm` to display progress bars, so I suggest you open this issue in their repo.
[ -1.2572124004364014, -0.8440772294998169, -0.7778602242469788, 1.4231904745101929, -0.26468297839164734, -1.2413325309753418, 0.12216352671384811, -1.0644726753234863, 1.773568034172058, -0.8667131662368774, 0.4416113495826721, -1.7301785945892334, -0.02705739066004753, -0.5621858835220337, -0.7617802023887634, -0.857134222984314, -0.40013012290000916, -0.8114147782325745, 1.0159515142440796, 2.550571918487549, 1.1663427352905273, -1.4281591176986694, 2.6520392894744873, 0.7429264783859253, -0.1673109084367752, -1.0626311302185059, 0.5003852844238281, 0.07586140185594559, -1.2729984521865845, -0.33765164017677307, -0.9516217708587646, -0.08260645717382431, -0.5186712741851807, -0.556281566619873, 0.029522545635700226, 0.41070234775543213, -0.24693076312541962, -0.3777260482311249, -0.4850900173187256, -0.7066540122032166, 0.5042654871940613, -0.3892095685005188, 1.0526065826416016, -0.4165450930595398, 1.8055680990219116, -0.5744527578353882, 0.4240359663963318, 0.7981128096580505, 1.3359915018081665, 0.14972138404846191, -0.11346516013145447, 0.22609171271324158, 0.4237256348133087, -0.01878741942346096, 0.3683226406574249, 1.1808058023452759, 0.5272651314735413, 0.6030382513999939, 0.6670381426811218, -2.1664998531341553, 1.3398749828338623, -1.0661041736602783, 0.35832446813583374, 1.2604105472564697, -0.9036798477172852, 0.36968809366226196, -1.8344987630844116, -0.01143057830631733, 0.6152639389038086, -2.1781165599823, 0.32571423053741455, -1.2887301445007324, -0.5994613170623779, 0.991281270980835, 0.33650436997413635, -1.3756487369537354, 0.10449617356061935, -0.3237296938896179, 0.9972971677780151, 0.43761971592903137, 1.0245131254196167, -1.8634512424468994, 0.1433027684688568, -0.27274584770202637, 0.06487209349870682, -1.2916110754013062, -1.3626071214675903, 0.5736122131347656, 0.733539342880249, 0.6053480505943298, -0.07245969772338867, 0.8982564806938171, -0.9527464509010315, 0.8208822011947632, -0.8883750438690186, -1.6894166469573975, -1.3109104633331299, -2.192798137664795, -2.2924752235412598, 0.8248540759086609, -0.49809351563453674, -0.5708585977554321, 1.9868319034576416, -0.8758929371833801, -1.8425155878067017, 1.1669143438339233, 0.2560514211654663, -0.029373236000537872, 2.4182379245758057, 0.18166545033454895, -0.755164384841919, 0.5035070180892944, -0.8403050899505615, 0.8028563261032104, -0.665919303894043, 1.3472191095352173, 0.5067072510719299, -1.012194037437439, 1.680795431137085, -0.46290478110313416, 0.561893105506897, -0.7652714252471924, -0.5471282601356506, -0.8769965171813965, 0.44681453704833984, 1.932472825050354, -0.3088360130786896, 1.5458014011383057, -0.30844831466674805, -1.5396273136138916, -1.624651312828064, 0.8753001689910889, 0.5720179080963135, -0.7425937056541443, 0.18437723815441132, -0.32968562841415405, 0.2448963224887848, -0.05118866264820099, 1.0969033241271973, 1.1763018369674683, 0.851325273513794, -0.17987994849681854, -0.8696314692497253, 0.3484869599342346, -0.045336950570344925, -0.6925790905952454, -1.8844830989837646, -0.3714258372783661, 0.044502150267362595, 0.6020551919937134, -1.123462438583374, 1.8221919536590576, 0.8852762579917908, 2.003246307373047, 0.9648818969726562, -0.2581857740879059, 1.5551048517227173, -0.06127716600894928, 1.9128953218460083, -0.5179553627967834, 0.698409378528595, -0.3166460692882538, -1.0726760625839233, 0.9236602783203125, -0.3370620012283325, -1.9723836183547974, -0.780839204788208, -0.8518881797790527, -0.12609657645225525, -0.7163293957710266, 0.8721218109130859, -0.28514787554740906, -1.3215677738189697, 0.21826086938381195, -0.6623119115829468, 0.09060920774936676, -1.2022285461425781, 0.236990824341774, 0.7729616761207581, -0.6017252206802368, 0.11421621590852737, -0.20949354767799377, -1.331371784210205, -0.594235897064209, 0.32893240451812744, 2.0045008659362793, -0.7096267938613892, 0.8280312418937683, 1.0051937103271484, -0.716850757598877, -0.12129256874322891, 0.38947629928588867, -0.25043195486068726, 0.762581467628479, -1.0617396831512451, -0.35795000195503235, 1.2072557210922241, -0.21683268249034882, -0.6177067160606384, 1.4316303730010986, 0.7550610303878784, -1.0230191946029663, -0.10667326301336288, -0.3107052147388458, -0.7360965013504028, 0.050304487347602844, -1.621388554573059, -0.01660907454788685, 0.3743446469306946, -1.4792475700378418, -0.39817461371421814, -0.17481356859207153, 1.1711578369140625, -0.2708808183670044, 1.4526118040084839, -0.2680564224720001, -0.25098204612731934, -0.45085960626602173, -0.5285406708717346, 0.05734959989786148, -0.24996624886989594, -0.4946190118789673, 0.11471851915121078, -0.6752070188522339, 0.40428778529167175, 1.473649024963379, 0.21575316786766052, 0.09452389180660248, 0.4912419319152832, 1.073237657546997, 0.3500593900680542, -0.10884838551282883, -0.8584392666816711, -1.352752685546875, 1.993033766746521, -1.36882483959198, 1.9323091506958008, 0.8335558176040649, 0.003088996745646, -1.730798602104187, -1.9239662885665894, 1.4106229543685913, 1.2597721815109253, 2.3240933418273926, 0.6570226550102234, 0.3560028672218323, -0.839828372001648, -0.6785075068473816, 0.2973388135433197, -1.1385256052017212, -0.7746749520301819, 0.1854517161846161, 2.439584732055664, 1.6812539100646973, -0.5775073170661926, -0.24263733625411987, -1.0665428638458252, 1.3593173027038574, -0.07438677549362183, 0.21687304973602295, 2.0231194496154785, -0.41161975264549255, -1.2991389036178589, 1.1481386423110962, -2.341482400894165, 0.10398785769939423, 1.979155421257019, 0.25319287180900574, 0.21612811088562012, -1.4371241331100464, -0.5832595229148865, -0.07172580808401108, -0.3916495442390442, -1.118722915649414, 0.6387571692466736, -0.2626844048500061, -0.7781277298927307, -1.3817431926727295, 0.27391737699508667, -1.032863736152649, -1.7621420621871948, 0.207249715924263, 1.8590210676193237, 2.0153989791870117, -0.8327078223228455, 1.5248632431030273, -0.19042211771011353, 0.03810245543718338, 1.270911693572998, 1.240655541419983, 2.971156120300293, 1.9786955118179321, -1.110129714012146, 0.6896697878837585, -0.13612115383148193, -0.5463479161262512, 1.1243973970413208, -1.178299903869629, 1.229134202003479, -0.11583532392978668, -1.1372108459472656, -1.3015910387039185, 0.8002064824104309, 0.39802321791648865, 0.12254080921411514, -0.5053232908248901, 1.2974233627319336, 0.20780889689922333, 1.3247452974319458, 0.44203391671180725, -0.30101221799850464, 0.6704183220863342, -0.33510518074035645, -0.45358332991600037, 1.5556273460388184, 0.32413530349731445, -1.300736427307129, -2.336322069168091, -0.13763371109962463, -0.8749343752861023, -0.0696200504899025, -0.6077243089675903, -0.9608697295188904, 1.5993746519088745, 0.4538194239139557, -1.278716802597046, -0.20682445168495178, -0.35653984546661377, -0.6810835599899292, 2.7196147441864014, -1.4746901988983154, -0.3148879110813141, -0.9783334136009216, -0.5353866815567017, 1.7087311744689941, -1.263418436050415, -0.08326075226068497, -0.9473374485969543, -0.4641176462173462, -1.3199471235275269, -0.5729014873504639, -0.022540464997291565, -0.8634108901023865, 0.6780399680137634, 0.2702721059322357, -1.1842608451843262, -0.3555447459220886, -0.7418908476829529, 0.68646240234375, -0.03755352646112442, 0.4199989438056946, 1.9012380838394165, 0.33366820216178894, -0.3256392776966095, 0.7557094693183899, 1.190803050994873, 0.5279964208602905, -0.5650864243507385, 0.3310967683792114, -0.7687405943870544, 0.3733830451965332, -1.3097573518753052, 0.22557823359966278, -2.9152028560638428, 0.6632097959518433, -0.0704788938164711, -0.16227108240127563, -0.060758884996175766, -1.3725475072860718, 1.1677381992340088, 2.696458339691162, -1.212790608406067, 0.5044644474983215, 0.2066347599029541, 1.2296907901763916, -1.445444941520691, 0.2116251289844513, -0.40624478459358215, 2.08876633644104, 0.18679766356945038, 1.134322166442871, -0.4895660877227783, -2.361138343811035, 0.5928056240081787, -1.3054372072219849, -1.2354464530944824, 0.7353613972663879, -0.8521546721458435, -0.055686283856630325, -1.4315526485443115, -0.1502259522676468, -0.9333704113960266, -1.3120558261871338, 0.9072487950325012, 0.21569471061229706, 0.4981321096420288, -0.6969532370567322, 0.43091487884521484, -2.10853910446167, -1.4249874353408813, -0.24942728877067566, -0.937204897403717, 0.42967280745506287, -0.2649185359477997, 0.742286741733551, -0.2830975353717804, 0.022202778607606888, 0.36783111095428467, 1.409155011177063, 3.398441791534424, 0.2173386514186859, 0.44250982999801636, -0.10319603979587555, -0.8557449579238892, 1.4237335920333862, 0.9908119440078735, -0.24874219298362732, -0.5423697233200073, -1.03227698802948, 1.291326880455017, 2.0530898571014404, 0.9019376039505005, 0.10359369218349457, -0.8463579416275024, -0.6345652341842651, -0.09137195348739624, 0.1103135272860527, 0.3612416088581085, 0.9679790735244751, 0.09028014540672302, 0.00915659498423338, 1.3468611240386963, 1.2506301403045654, -0.5799153447151184, 0.38244640827178955, -0.8445633053779602, -0.40773630142211914, 0.5512579679489136, 0.3293144702911377, -0.06672710180282593, 0.34452396631240845, -0.9338353276252747, -0.21292851865291595, -0.2520233392715454, -0.9826467633247375, -0.8142859935760498, -0.4120780825614929, -0.3426411747932434, 1.6756950616836548, 0.05509248375892639, -0.48370683193206787, 0.033021628856658936, -0.7293063998222351, -0.07094291597604752, -0.9546927809715271, 0.12112832814455032, -0.1651684045791626, -0.14617745578289032, -0.016823872923851013, 1.8130394220352173, -0.9025151133537292, -2.0542140007019043, 0.2745820879936218, 0.23379594087600708, -0.34898194670677185, 0.25873804092407227, 1.6362509727478027, 0.573204755783081, 1.4661154747009277, 1.425118327140808, 1.0341005325317383, -0.6243939995765686, -1.4212838411331177, 0.7311316728591919, 0.9219619035720825, -1.4372626543045044, 0.7749600410461426, 0.09413988888263702, -0.4305446743965149, 0.5401679873466492, 1.1451833248138428, 0.5023627281188965, -2.01729679107666, 0.7587549686431885, -0.9656277298927307, 0.8988564610481262, 0.6294448375701904, 0.7256463170051575, 0.2632385194301605, 0.8372100591659546, -1.0902278423309326, -1.0951290130615234, -0.8789639472961426, -0.8045634627342224, 1.8927334547042847, -0.2742770314216614, 0.652416467666626, -0.08750087767839432, -1.334802508354187, -0.23807817697525024, 0.6458727717399597, 0.40763863921165466, -0.33928725123405457, 0.7483118176460266, -0.6448543071746826, -1.1934829950332642, -1.4728134870529175, -0.4965054392814636, -1.0377845764160156, -0.9234893321990967, 1.039876937866211, 0.7654762864112854, 0.271123468875885, 1.8554574251174927, 0.6281929016113281, 0.2413349151611328, -2.616811513900757, 0.9789835214614868, 0.3735097348690033, 0.002999262884259224, 0.8406704068183899, 0.4972112774848938, 1.0021713972091675, -0.1890603005886078, 0.6278634071350098, -2.3484604358673096, 2.447252035140991, -0.24780026078224182, 0.6473937034606934, 0.10091165453195572, -0.10298684984445572, 1.0839065313339233, 0.4367416799068451, 0.55147385597229, -1.1548702716827393, 0.5759276151657104, -0.6611757874488831, 1.3156296014785767, 0.8625644445419312, -0.8164870738983154, -0.014981587417423725, 1.2089036703109741, 0.43153172731399536, -0.5478766560554504, -0.8034459948539734, -0.8840612173080444, 0.9985134601593018, 1.6974376440048218, -0.09549460560083389, 0.005570916458964348, 0.8074413537979126, 0.4588911831378937, -1.357827067375183, -0.04356365650892258, -0.802262008190155, -0.8259828686714172, 1.6706558465957642, 1.935075283050537, -0.14117370545864105, -0.2997961640357971, -0.81800377368927, -1.2961535453796387, 0.8136836290359497, 0.16422376036643982, 0.004934537224471569, 0.6763845086097717, -0.5844061374664307, 1.211954116821289, 0.8873500823974609, 0.8323991298675537, 0.1838482916355133, 0.3806367814540863, 0.3263259828090668, -0.3581046462059021, -1.148044466972351, -0.2960888147354126, -1.1299383640289307, -2.711038112640381, 0.40505343675613403, -0.19765396416187286, -1.3867213726043701, -0.15491846203804016, -1.0915216207504272, 0.8527328968048096, -0.4362970292568207, -1.0616778135299683, -1.4266055822372437, 0.20364022254943848, -0.19624343514442444, 0.8763249516487122, -1.6473102569580078, -0.10173225402832031, 1.1844555139541626, 0.9954832792282104, -0.8718090653419495, 1.035873293876648, 0.25013378262519836, 1.0873777866363525, 0.8482616543769836, -0.40611666440963745, 0.5356354713439941, 0.08778363466262817, -1.2959572076797485, 0.480949342250824, 1.121275782585144, 0.013866365887224674, 1.3171422481536865, -0.6229110360145569, -0.01437252014875412, 0.4310038089752197, -0.4511701166629791, -0.5042251348495483, -0.649468183517456, 0.732340395450592, 0.003393768332898617, -0.8953548669815063, 0.048393238335847855, -0.07367753982543945, -0.09850353747606277, 0.20079287886619568, -1.576937198638916, -0.3115852177143097, -0.24154804646968842, -0.45565152168273926, -1.1619573831558228, -0.05160683020949364, 1.4112906455993652, -0.6773556470870972, -0.16727115213871002, 0.5034841299057007, 0.4666513502597809, 0.5805094838142395, 0.5449962019920349, -0.6365116238594055, -0.4687233865261078, -0.15707238018512726, -0.41567113995552063, 0.4427560269832611, 1.3204244375228882, -0.17143456637859344, -1.0189565420150757, 0.8465672135353088, -0.3547496199607849, 0.06555382907390594, 1.7916369438171387, 0.09127763658761978, -0.9494047164916992, 0.2650090456008911, -0.7216066122055054, 1.867324709892273, 1.6897923946380615, 1.1526089906692505, -0.06249541416764259, -0.8369282484054565, 0.6800229549407959, -0.21004341542720795, -0.33880215883255005, 0.869598388671875, 0.44469892978668213, -0.2152966409921646, -1.4132939577102661, 0.544598400592804, 1.2611039876937866, -0.8121208548545837, -0.9166247248649597, -0.02637368068099022, -0.7622167468070984, 1.0365267992019653, 0.7496514320373535, 0.41903847455978394, 0.2871972918510437, 1.6987696886062622, 0.746709406375885, -0.47067269682884216, 0.6454334855079651, 0.37254953384399414, -0.059467099606990814, -2.049081563949585, -1.1789276599884033, 0.3149178624153137, -0.4835660755634308, -1.6184762716293335, 1.2486448287963867, -1.1212942600250244, -0.9696097373962402, 0.6805444955825806, 0.13919441401958466, 1.5102486610412598, 0.21317750215530396, 1.5420762300491333, 1.9621931314468384, 0.880582869052887, 0.3063596785068512, 1.326720952987671, -0.1924053281545639, -0.5159799456596375, 1.877472996711731, -0.49864327907562256, 0.44940516352653503, 1.0468863248825073, -0.3300531804561615, -0.9556941986083984, -0.7746298313140869, -1.2255202531814575, -0.7566312551498413, 1.2156531810760498, 0.19865958392620087, -1.3150464296340942, 0.2726720869541168, 1.5631635189056396, 0.11179105192422867, -0.15517279505729675, 0.5576558113098145, 0.46243366599082947, -0.8015635013580322, 0.04993883892893791, -0.8885743021965027, 0.4947013854980469, -0.08822646737098694, -0.38660308718681335, 0.4339955449104309, 0.4474131166934967, 1.2090837955474854, -0.0060606710612773895, 0.1818573921918869, 1.0322117805480957, -1.358547329902649, 1.5533239841461182, -0.6453054547309875, 0.3877025544643402, -2.415588617324829, 1.3834601640701294, -0.7195179462432861, 1.9260731935501099, -2.682241916656494, 0.3133006989955902, -0.6034516096115112, -0.48600971698760986, 0.37996751070022583, -0.3559816777706146, 0.16098320484161377, -0.285542756319046, -1.1590861082077026, -0.10265803337097168, -0.6997196674346924, 0.6412931680679321, 0.9642078280448914, 1.2269552946090698, -1.030794382095337, -0.29336217045783997, -1.8233418464660645, -0.14276434481143951, -0.5649932622909546, 0.31328436732292175, -2.163114309310913, -0.21401794254779816, -2.0269863605499268, -2.1086370944976807, -1.3965802192687988, -0.863724946975708, 1.0351359844207764, -0.024786703288555145, -0.8566128611564636, 1.1656700372695923, -0.2643440365791321, -1.8564562797546387, 1.125340461730957, -2.1604321002960205 ]
https://github.com/huggingface/datasets/issues/3621
Consider adding `ipywidgets` as a dependency.
It depends on how you use `tqdm`, no? Doesn't this library import via; ``` from tqdm.notebook import tqdm ```
When I install `datasets` in a fresh virtualenv with jupyterlab I always see this error. ``` ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html ``` It's a bit of a nuisance, because I need to run shut down the jupyterlab server in order to install the required dependency. Might it be an option to just include it as a dependency here?
988
19
Consider adding `ipywidgets` as a dependency. When I install `datasets` in a fresh virtualenv with jupyterlab I always see this error. ``` ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html ``` It's a bit of a nuisance, because I need to run shut down the jupyterlab server in order to install the required dependency. Might it be an option to just include it as a dependency here? It depends on how you use `tqdm`, no? Doesn't this library import via; ``` from tqdm.notebook import tqdm ```
[ -1.2264671325683594, -0.8708646297454834, -0.8007208704948425, 1.5371228456497192, -0.22818367183208466, -1.2524385452270508, 0.14695076644420624, -1.024356722831726, 1.8052208423614502, -0.9142190217971802, 0.4502286911010742, -1.7003107070922852, 0.007576330564916134, -0.5523838996887207, -0.7852668166160583, -0.7764442563056946, -0.4021981656551361, -0.8275426030158997, 1.0050252676010132, 2.498159170150757, 1.1238012313842773, -1.4313417673110962, 2.6647896766662598, 0.7318888902664185, -0.1898736208677292, -1.0730106830596924, 0.4238491356372833, -0.014165529981255531, -1.2574677467346191, -0.3510822355747223, -0.9343200922012329, -0.05442359298467636, -0.5305252075195312, -0.6123157143592834, 0.03278934583067894, 0.49625590443611145, -0.29404735565185547, -0.4945787787437439, -0.43891701102256775, -0.7778092622756958, 0.4674935042858124, -0.365418404340744, 1.0238513946533203, -0.38452669978141785, 1.8402526378631592, -0.5727674961090088, 0.4020797908306122, 0.7823778390884399, 1.3615610599517822, 0.18641060590744019, -0.10401153564453125, 0.2067694514989853, 0.40104547142982483, -0.004863053094595671, 0.4723055958747864, 1.2122840881347656, 0.5457373857498169, 0.5860469341278076, 0.637460470199585, -2.224172592163086, 1.3566759824752808, -1.1075592041015625, 0.3502821922302246, 1.2024402618408203, -0.9044240713119507, 0.30712881684303284, -1.8173506259918213, -0.0012053465470671654, 0.5414630770683289, -2.1282389163970947, 0.34823882579803467, -1.3072636127471924, -0.5381077527999878, 1.0371121168136597, 0.35278192162513733, -1.3651089668273926, 0.09236116707324982, -0.275368332862854, 1.049228310585022, 0.44319260120391846, 1.0211063623428345, -1.811535358428955, 0.11708185821771622, -0.2769329249858856, 0.08121015131473541, -1.2702361345291138, -1.356813907623291, 0.5652797222137451, 0.7537637948989868, 0.6661465764045715, -0.10584928095340729, 0.9920400977134705, -0.9407572746276855, 0.7908266186714172, -0.9590763449668884, -1.7403206825256348, -1.2281570434570312, -2.1319973468780518, -2.3128280639648438, 0.8174412250518799, -0.43027225136756897, -0.5924500823020935, 2.038041830062866, -0.8527590036392212, -1.9077153205871582, 1.1474013328552246, 0.2864527702331543, -0.03138403221964836, 2.369091272354126, 0.1749679148197174, -0.7696169018745422, 0.4606297016143799, -0.822012722492218, 0.830742359161377, -0.6699280142784119, 1.3782224655151367, 0.4908418357372284, -0.9982504844665527, 1.6288204193115234, -0.3790491819381714, 0.5892764925956726, -0.7878486514091492, -0.5157973766326904, -0.8270581960678101, 0.4246422052383423, 1.9477059841156006, -0.3153536319732666, 1.4927527904510498, -0.28972867131233215, -1.535723328590393, -1.6118398904800415, 0.8777754306793213, 0.5677215456962585, -0.7547059655189514, 0.17484353482723236, -0.37464168667793274, 0.2566227316856384, -0.06769772619009018, 1.1495428085327148, 1.1704195737838745, 0.8653144836425781, -0.16829876601696014, -0.8432683348655701, 0.372642457485199, -0.021100949496030807, -0.6837097406387329, -1.812807559967041, -0.3900885581970215, 0.06664281338453293, 0.5840515494346619, -1.128381371498108, 1.8617993593215942, 0.8872791528701782, 1.9876222610473633, 0.9908431172370911, -0.17614081501960754, 1.5685373544692993, -0.08068161457777023, 1.945683240890503, -0.426550030708313, 0.636957049369812, -0.3607630729675293, -1.078551173210144, 0.9067699909210205, -0.34721916913986206, -1.9583678245544434, -0.7827509045600891, -0.9069626331329346, -0.12546227872371674, -0.7338006496429443, 0.8469279408454895, -0.30140212178230286, -1.392526626586914, 0.14027242362499237, -0.7347696423530579, 0.07545319199562073, -1.184782862663269, 0.2628321349620819, 0.7551879286766052, -0.6386404037475586, 0.16149233281612396, -0.25449904799461365, -1.334341049194336, -0.5853723883628845, 0.35439276695251465, 2.045616388320923, -0.7386359572410583, 0.860300600528717, 1.0524334907531738, -0.757635772228241, -0.10663396865129471, 0.39596688747406006, -0.2704649567604065, 0.7646356821060181, -1.0819469690322876, -0.3357149660587311, 1.206540584564209, -0.16805554926395416, -0.6419697403907776, 1.4957027435302734, 0.7752677202224731, -1.0487060546875, -0.10008394718170166, -0.2798182964324951, -0.692802369594574, 0.05011552572250366, -1.5995219945907593, -0.0064492011442780495, 0.3880518972873688, -1.4731522798538208, -0.4692661166191101, -0.20819132030010223, 1.1276878118515015, -0.28198960423469543, 1.4618841409683228, -0.23646461963653564, -0.25590479373931885, -0.35769912600517273, -0.48123064637184143, 0.019969962537288666, -0.23413221538066864, -0.5369296073913574, 0.09307096153497696, -0.6291715502738953, 0.4153280258178711, 1.4883061647415161, 0.21467745304107666, 0.009787618182599545, 0.5452151894569397, 1.1048057079315186, 0.4038779139518738, -0.030112769454717636, -0.8772478103637695, -1.3408359289169312, 1.942097544670105, -1.3992453813552856, 1.948387622833252, 0.7569833993911743, 0.026317641139030457, -1.6656556129455566, -1.9298328161239624, 1.4615724086761475, 1.2508546113967896, 2.3444161415100098, 0.6742752194404602, 0.3906099498271942, -0.8669245839118958, -0.6646994352340698, 0.3169229328632355, -1.116111397743225, -0.777677595615387, 0.20097562670707703, 2.423748731613159, 1.6681373119354248, -0.5727370977401733, -0.28041812777519226, -1.0353869199752808, 1.3680217266082764, -0.1427513062953949, 0.21985647082328796, 2.016507387161255, -0.3918735980987549, -1.2364223003387451, 1.1417529582977295, -2.406651496887207, 0.1369245946407318, 2.0315005779266357, 0.21687915921211243, 0.17023587226867676, -1.4629567861557007, -0.604389488697052, -0.08130934834480286, -0.36223548650741577, -1.1275631189346313, 0.5810419917106628, -0.19611741602420807, -0.6964042782783508, -1.4011269807815552, 0.33142682909965515, -0.9733061790466309, -1.7295328378677368, 0.16473913192749023, 1.905011534690857, 1.9687116146087646, -0.8299762010574341, 1.5444144010543823, -0.2592059075832367, 0.09597623348236084, 1.274395227432251, 1.2310389280319214, 3.014692544937134, 1.9429970979690552, -1.09000825881958, 0.7359839677810669, -0.1462750881910324, -0.5790094137191772, 1.157383918762207, -1.1785651445388794, 1.1633083820343018, -0.12863679230213165, -1.1077929735183716, -1.3574613332748413, 0.7647891044616699, 0.4651843011379242, 0.09596249461174011, -0.46033623814582825, 1.2782763242721558, 0.1967521607875824, 1.3563534021377563, 0.43407031893730164, -0.2891925871372223, 0.6809948682785034, -0.3518794775009155, -0.422319233417511, 1.5511373281478882, 0.3252240717411041, -1.2552608251571655, -2.279681444168091, -0.06979572772979736, -0.8961978554725647, 0.002387773245573044, -0.6038736701011658, -0.9127242565155029, 1.6419243812561035, 0.46415865421295166, -1.2539361715316772, -0.16854797303676605, -0.3276005983352661, -0.6779946088790894, 2.6975269317626953, -1.4124455451965332, -0.326242059469223, -1.0319310426712036, -0.5812527537345886, 1.7624467611312866, -1.2355211973190308, -0.21401317417621613, -0.9280295372009277, -0.44389626383781433, -1.332345962524414, -0.6290387511253357, -0.004132759291678667, -0.8717813491821289, 0.7156196236610413, 0.2505212426185608, -1.207581639289856, -0.3197590410709381, -0.7809377312660217, 0.7232985496520996, -0.04241212457418442, 0.35582125186920166, 1.8884258270263672, 0.38140860199928284, -0.38898447155952454, 0.7414310574531555, 1.1481657028198242, 0.5421832203865051, -0.5037586092948914, 0.4203071892261505, -0.7492693662643433, 0.39601412415504456, -1.3374154567718506, 0.18217957019805908, -2.9372241497039795, 0.6316121220588684, -0.04238772764801979, -0.13346315920352936, -0.08778482675552368, -1.380972146987915, 1.156401515007019, 2.6910440921783447, -1.1704789400100708, 0.4986104667186737, 0.18712514638900757, 1.3134448528289795, -1.398927092552185, 0.1865062713623047, -0.3779505789279938, 2.072335958480835, 0.1556655913591385, 1.178796648979187, -0.4257563054561615, -2.361140489578247, 0.6221980452537537, -1.3529505729675293, -1.2625763416290283, 0.7503944039344788, -0.8503328561782837, -0.10171394050121307, -1.3501627445220947, -0.15464118123054504, -0.8759853839874268, -1.2608951330184937, 0.9343371987342834, 0.21611224114894867, 0.47472357749938965, -0.7218104600906372, 0.43933966755867004, -2.1043474674224854, -1.399199366569519, -0.24664722383022308, -1.0162441730499268, 0.3787778615951538, -0.29958391189575195, 0.6843798160552979, -0.30389416217803955, 0.06477712094783783, 0.3395721912384033, 1.458802342414856, 3.4162814617156982, 0.24660345911979675, 0.4838787317276001, -0.12251110374927521, -0.8881857395172119, 1.4264492988586426, 0.9691057801246643, -0.2067616581916809, -0.483874648809433, -1.0545952320098877, 1.2340617179870605, 2.018810749053955, 0.9599983096122742, 0.0973239615559578, -0.8288660049438477, -0.7066268920898438, -0.11014551669359207, 0.1000659391283989, 0.34521764516830444, 0.9151333570480347, 0.16568002104759216, 0.02862081304192543, 1.296294927597046, 1.1800683736801147, -0.55800861120224, 0.4561786949634552, -0.8716660737991333, -0.4031272828578949, 0.5708558559417725, 0.3279935419559479, -0.11710646003484726, 0.25835421681404114, -0.9436408281326294, -0.22052764892578125, -0.238149031996727, -0.9633640646934509, -0.842574417591095, -0.4533505141735077, -0.3034760057926178, 1.6735821962356567, 0.03779291734099388, -0.48913878202438354, -0.013957382179796696, -0.7641541957855225, 0.010863852687180042, -0.9818102717399597, 0.10950762033462524, -0.1798921525478363, -0.18637578189373016, 0.011972705833613873, 1.7950830459594727, -0.9108928442001343, -1.9800243377685547, 0.3220421373844147, 0.24072644114494324, -0.33381012082099915, 0.2689317464828491, 1.6106410026550293, 0.547227144241333, 1.4728015661239624, 1.4415795803070068, 1.0705100297927856, -0.6460424065589905, -1.4334534406661987, 0.7230511903762817, 0.8912245631217957, -1.3870484828948975, 0.765332818031311, 0.16497857868671417, -0.3785068094730377, 0.48127689957618713, 1.2000939846038818, 0.5374631285667419, -1.9893323183059692, 0.6537505388259888, -0.9423730373382568, 0.8227983713150024, 0.6497278809547424, 0.7251182198524475, 0.2888050377368927, 0.7939302325248718, -1.0432562828063965, -1.0932438373565674, -0.8257079720497131, -0.8266421556472778, 1.844689965248108, -0.30434373021125793, 0.6443385481834412, -0.07663003355264664, -1.3968490362167358, -0.27083662152290344, 0.6917769908905029, 0.4255104660987854, -0.43341264128685, 0.6966835856437683, -0.6468138694763184, -1.1119762659072876, -1.451952338218689, -0.5479912757873535, -1.0407754182815552, -0.9679160118103027, 0.983087956905365, 0.7915499806404114, 0.2057359516620636, 1.8368759155273438, 0.6593894958496094, 0.24469351768493652, -2.5863118171691895, 0.9285057187080383, 0.3908166289329529, -0.024940431118011475, 0.7959610223770142, 0.4977467358112335, 0.9528520107269287, -0.1909530609846115, 0.6335861086845398, -2.353022813796997, 2.447965383529663, -0.19873805344104767, 0.5873870253562927, 0.08075059205293655, -0.148642435669899, 1.079923391342163, 0.38412630558013916, 0.5318562388420105, -1.1439437866210938, 0.5429499745368958, -0.7201099991798401, 1.3336886167526245, 0.8116044998168945, -0.8287993669509888, -0.0410488098859787, 1.2324144840240479, 0.42760899662971497, -0.5613808035850525, -0.8285996913909912, -0.9673833250999451, 1.0138338804244995, 1.6706178188323975, -0.08414735645055771, 0.00873843114823103, 0.8606845140457153, 0.49685052037239075, -1.3693795204162598, -0.10497813671827316, -0.8163731694221497, -0.8378062844276428, 1.683899164199829, 1.9831737279891968, -0.16699273884296417, -0.3060593903064728, -0.8840253353118896, -1.2689063549041748, 0.787373960018158, 0.20392519235610962, -0.10765030235052109, 0.6695683002471924, -0.5770780444145203, 1.2321463823318481, 0.8941038846969604, 0.8319876194000244, 0.16697365045547485, 0.4025411605834961, 0.32771173119544983, -0.38360244035720825, -1.1633912324905396, -0.2787121832370758, -1.1054296493530273, -2.7341480255126953, 0.39425697922706604, -0.16297192871570587, -1.3468658924102783, -0.13556857407093048, -1.126518726348877, 0.878990650177002, -0.48817795515060425, -1.0845385789871216, -1.40115225315094, 0.17734971642494202, -0.18342289328575134, 0.8664067387580872, -1.6372320652008057, -0.04768090322613716, 1.170607566833496, 1.0280296802520752, -0.9253541827201843, 1.0058969259262085, 0.21305781602859497, 1.0863299369812012, 0.8960649371147156, -0.42318791151046753, 0.557182252407074, 0.05667441710829735, -1.2926609516143799, 0.4659893810749054, 1.1227551698684692, 0.002288874238729477, 1.354912519454956, -0.6329787969589233, -0.03239016234874725, 0.46146607398986816, -0.4735807478427887, -0.5170906186103821, -0.7088426947593689, 0.7637479305267334, -0.04252899810671806, -0.8836276531219482, 0.07561325281858444, -0.013828137889504433, -0.07904490828514099, 0.2193177491426468, -1.597206711769104, -0.26486736536026, -0.16705380380153656, -0.5331385731697083, -1.1666579246520996, -0.030261240899562836, 1.3932931423187256, -0.7147485017776489, -0.21779651939868927, 0.46562182903289795, 0.3821765184402466, 0.5400450825691223, 0.5060473680496216, -0.6803853511810303, -0.47393518686294556, -0.20401498675346375, -0.4243428409099579, 0.44559431076049805, 1.4055922031402588, -0.1049773320555687, -0.9755128026008606, 0.8386620879173279, -0.36969855427742004, 0.03742397204041481, 1.7551653385162354, 0.04976890608668327, -0.9501938223838806, 0.20701701939105988, -0.697611927986145, 1.8862981796264648, 1.694108009338379, 1.1650910377502441, -0.018251217901706696, -0.8891593217849731, 0.7151697278022766, -0.22718806564807892, -0.4036251902580261, 0.8670127987861633, 0.4052364230155945, -0.2264818251132965, -1.4097388982772827, 0.5856068134307861, 1.2492713928222656, -0.7916130423545837, -1.0060031414031982, -0.02953866869211197, -0.7719739675521851, 1.0580673217773438, 0.7425969839096069, 0.39183852076530457, 0.28145086765289307, 1.707763433456421, 0.7534428834915161, -0.4548608958721161, 0.6601750254631042, 0.424643337726593, -0.018859321251511574, -2.0830886363983154, -1.168439269065857, 0.30657753348350525, -0.48626452684402466, -1.6443580389022827, 1.2982796430587769, -1.0776963233947754, -0.8810815811157227, 0.649081289768219, 0.1566140502691269, 1.569459319114685, 0.22634455561637878, 1.487776279449463, 1.954214096069336, 0.8478244543075562, 0.30402612686157227, 1.3081293106079102, -0.2764652967453003, -0.5797274708747864, 1.8816415071487427, -0.5521382689476013, 0.4278102219104767, 1.0491701364517212, -0.2904491126537323, -0.9553863406181335, -0.7729259729385376, -1.2527331113815308, -0.7849885821342468, 1.1883108615875244, 0.19199416041374207, -1.332257866859436, 0.24643129110336304, 1.5382535457611084, 0.1462942212820053, -0.15805970132350922, 0.6216375231742859, 0.410218209028244, -0.81373131275177, 0.1093069538474083, -0.8545888066291809, 0.5430049300193787, -0.12541668117046356, -0.37375855445861816, 0.42937445640563965, 0.44475966691970825, 1.2255572080612183, 0.01609811559319496, 0.15647175908088684, 1.0298038721084595, -1.3319880962371826, 1.5806046724319458, -0.6158751845359802, 0.4385710656642914, -2.417778730392456, 1.3532500267028809, -0.7845540642738342, 1.9231548309326172, -2.66741943359375, 0.2749723196029663, -0.5567569732666016, -0.4655771553516388, 0.4044800102710724, -0.40466052293777466, 0.15821930766105652, -0.26621147990226746, -1.1705745458602905, -0.09101124107837677, -0.6639543771743774, 0.6261310577392578, 0.9190826416015625, 1.313066005706787, -1.052754521369934, -0.3257148265838623, -1.89589524269104, -0.10209804028272629, -0.5608246326446533, 0.3623138666152954, -2.141291379928589, -0.24390125274658203, -2.021597385406494, -2.100551128387451, -1.350335955619812, -0.7985125184059143, 0.9854876399040222, -0.09393739700317383, -0.8008437156677246, 1.1706293821334839, -0.25643548369407654, -1.868589162826538, 1.1150784492492676, -2.096001148223877 ]
https://github.com/huggingface/datasets/issues/3621
Consider adding `ipywidgets` as a dependency.
Hi! Sorry for the late reply. We import `tqdm` as `from tqdm.auto import tqdm`, which should be equal to `from tqdm.notebook import tqdm` in Jupyter.
When I install `datasets` in a fresh virtualenv with jupyterlab I always see this error. ``` ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html ``` It's a bit of a nuisance, because I need to run shut down the jupyterlab server in order to install the required dependency. Might it be an option to just include it as a dependency here?
988
25
Consider adding `ipywidgets` as a dependency. When I install `datasets` in a fresh virtualenv with jupyterlab I always see this error. ``` ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html ``` It's a bit of a nuisance, because I need to run shut down the jupyterlab server in order to install the required dependency. Might it be an option to just include it as a dependency here? Hi! Sorry for the late reply. We import `tqdm` as `from tqdm.auto import tqdm`, which should be equal to `from tqdm.notebook import tqdm` in Jupyter.
[ -1.214193344116211, -0.8415186405181885, -0.7192380428314209, 1.4941892623901367, -0.23961277306079865, -1.2713321447372437, 0.15907414257526398, -1.0490306615829468, 1.7566665410995483, -0.9677300453186035, 0.4743548035621643, -1.7069237232208252, 0.010902371257543564, -0.5603199005126953, -0.7692732810974121, -0.765113353729248, -0.42322051525115967, -0.7795966863632202, 0.9979960918426514, 2.5452287197113037, 1.1172863245010376, -1.4267061948776245, 2.636345386505127, 0.7327255010604858, -0.23118822276592255, -1.0896035432815552, 0.4590085446834564, 0.03558025881648064, -1.3197288513183594, -0.34650006890296936, -0.953331708908081, -0.014673927798867226, -0.4994877576828003, -0.6255799531936646, 0.08435094356536865, 0.439667671918869, -0.25058645009994507, -0.4708216190338135, -0.4926798641681671, -0.7465999126434326, 0.43098533153533936, -0.4002159535884857, 1.0686684846878052, -0.39904382824897766, 1.7637810707092285, -0.5816439390182495, 0.4365381598472595, 0.7988083362579346, 1.3440910577774048, 0.13107262551784515, -0.08929568529129028, 0.18725928664207458, 0.44160762429237366, 0.0349409356713295, 0.4729990065097809, 1.142269253730774, 0.5674605369567871, 0.527692437171936, 0.6420485973358154, -2.18082594871521, 1.3898868560791016, -1.0517399311065674, 0.31653034687042236, 1.2218964099884033, -0.9199916124343872, 0.3065907657146454, -1.8131742477416992, -0.030648311600089073, 0.4819420874118805, -2.133463144302368, 0.3141411244869232, -1.2992922067642212, -0.5621538162231445, 1.0395787954330444, 0.35653263330459595, -1.3692004680633545, 0.12091483175754547, -0.36311131715774536, 0.9714272022247314, 0.47734928131103516, 0.9717215299606323, -1.8256434202194214, 0.05098210647702217, -0.26543691754341125, 0.07545745372772217, -1.2498180866241455, -1.3077569007873535, 0.5790436267852783, 0.7948672771453857, 0.639313817024231, -0.08917267620563507, 0.949944257736206, -1.0134074687957764, 0.8526339530944824, -0.9695876836776733, -1.7591854333877563, -1.218212366104126, -2.143033981323242, -2.277390718460083, 0.8417803049087524, -0.4277488589286804, -0.590227484703064, 2.0193395614624023, -0.883784294128418, -1.8327594995498657, 1.155543327331543, 0.24657738208770752, -0.03786904364824295, 2.4059696197509766, 0.17393797636032104, -0.7436014413833618, 0.4344691336154938, -0.7868117094039917, 0.8265061378479004, -0.7033090591430664, 1.3110439777374268, 0.462793231010437, -1.0063652992248535, 1.6515920162200928, -0.327106237411499, 0.578834056854248, -0.7666255235671997, -0.5005173683166504, -0.8236078023910522, 0.4174182713031769, 1.9567779302597046, -0.3167949318885803, 1.4629662036895752, -0.2547442317008972, -1.5255178213119507, -1.5931527614593506, 0.8448275327682495, 0.5593265295028687, -0.7155849933624268, 0.168851837515831, -0.3752802610397339, 0.28283265233039856, -0.09334671497344971, 1.139018177986145, 1.214529275894165, 0.894101619720459, -0.155643031001091, -0.8249098062515259, 0.3876376152038574, -0.09538819640874863, -0.7257850170135498, -1.8496404886245728, -0.41667696833610535, 0.04144924879074097, 0.6677769422531128, -1.1212080717086792, 1.8357069492340088, 0.9431465864181519, 1.9142590761184692, 1.0052496194839478, -0.21105879545211792, 1.5620911121368408, -0.07387839257717133, 1.9455265998840332, -0.478550523519516, 0.6722228527069092, -0.32250577211380005, -1.0944604873657227, 0.8880139589309692, -0.33767667412757874, -1.9638227224349976, -0.786684513092041, -0.8570848703384399, -0.1697232723236084, -0.7367922067642212, 0.8555314540863037, -0.30829018354415894, -1.3777854442596436, 0.16923190653324127, -0.7267012596130371, 0.1264491230249405, -1.1474157571792603, 0.2823662757873535, 0.8125240802764893, -0.6024836301803589, 0.1427372694015503, -0.31633034348487854, -1.3387811183929443, -0.6052600145339966, 0.33596205711364746, 1.9828797578811646, -0.7836296558380127, 0.8278284072875977, 0.9717838764190674, -0.7578948736190796, -0.10449111461639404, 0.4304005801677704, -0.3179498314857483, 0.7633521556854248, -1.0963376760482788, -0.3545454740524292, 1.1567823886871338, -0.18481694161891937, -0.5890368223190308, 1.502026081085205, 0.8264013528823853, -1.0207496881484985, -0.13373114168643951, -0.2983959913253784, -0.7206588983535767, 0.052776385098695755, -1.6461325883865356, 0.014079082757234573, 0.34444159269332886, -1.4904078245162964, -0.4275132119655609, -0.2053062617778778, 1.135583758354187, -0.2602662742137909, 1.4977484941482544, -0.21452222764492035, -0.27924293279647827, -0.323568195104599, -0.4299470782279968, 0.045296646654605865, -0.2022835910320282, -0.5454651117324829, 0.1559942215681076, -0.6554974317550659, 0.4025777578353882, 1.5420864820480347, 0.26932674646377563, 0.04551185667514801, 0.5755070447921753, 1.050487756729126, 0.3815734088420868, -0.05318943411111832, -0.8565390110015869, -1.3408873081207275, 2.0258169174194336, -1.4131466150283813, 1.9962599277496338, 0.7455059289932251, 0.04010937735438347, -1.7436758279800415, -1.9147592782974243, 1.4094170331954956, 1.2007274627685547, 2.314422369003296, 0.6286894083023071, 0.38730987906455994, -0.7993893623352051, -0.6986907720565796, 0.33678966760635376, -1.0851261615753174, -0.7813394069671631, 0.195678249001503, 2.4440150260925293, 1.7064567804336548, -0.5909122228622437, -0.23378483951091766, -1.063825249671936, 1.3633043766021729, -0.10814788937568665, 0.24317866563796997, 2.034018039703369, -0.3818608522415161, -1.2305238246917725, 1.199296236038208, -2.4236481189727783, 0.16353020071983337, 2.034989595413208, 0.22330771386623383, 0.10800206661224365, -1.4184086322784424, -0.5775301456451416, -0.1279810667037964, -0.30062803626060486, -1.0869146585464478, 0.5839167833328247, -0.20180217921733856, -0.7279726266860962, -1.4058561325073242, 0.2575659155845642, -0.9846813678741455, -1.7445182800292969, 0.18629510700702667, 1.8188838958740234, 1.9616577625274658, -0.8247729539871216, 1.535564661026001, -0.2559741139411926, 0.09541123360395432, 1.2650595903396606, 1.2074882984161377, 3.0336086750030518, 1.960822582244873, -1.1224932670593262, 0.7629746198654175, -0.14613878726959229, -0.5240665674209595, 1.1050816774368286, -1.1591602563858032, 1.1975208520889282, -0.09847132116556168, -1.1626602411270142, -1.291440486907959, 0.8198027610778809, 0.43475672602653503, 0.0684196874499321, -0.4862259328365326, 1.2671427726745605, 0.18470054864883423, 1.3988839387893677, 0.4255293905735016, -0.2385798543691635, 0.6319141387939453, -0.41003724932670593, -0.4567335844039917, 1.5557550191879272, 0.3317878246307373, -1.2780171632766724, -2.3104724884033203, -0.15114381909370422, -0.8949729204177856, -0.008213126100599766, -0.6288973093032837, -0.9307560920715332, 1.6248067617416382, 0.44539642333984375, -1.2616459131240845, -0.20111806690692902, -0.29326245188713074, -0.6394253969192505, 2.7105584144592285, -1.4825470447540283, -0.2888135313987732, -1.0274924039840698, -0.5932798385620117, 1.7433860301971436, -1.2637869119644165, -0.1541462540626526, -0.9891266822814941, -0.44892120361328125, -1.3367475271224976, -0.5878465175628662, -0.005128113087266684, -0.9455909729003906, 0.7173367738723755, 0.25918644666671753, -1.2023850679397583, -0.3514370620250702, -0.7563978433609009, 0.7283114194869995, -0.023571621626615524, 0.38099852204322815, 1.879716396331787, 0.4456304907798767, -0.40259429812431335, 0.7300465106964111, 1.1611840724945068, 0.5738097429275513, -0.5850808620452881, 0.3615526556968689, -0.780009388923645, 0.38253313302993774, -1.324820876121521, 0.17404519021511078, -2.892613410949707, 0.6350367069244385, -0.06452122330665588, -0.135247141122818, -0.10010959208011627, -1.3705083131790161, 1.1276568174362183, 2.7266499996185303, -1.1453979015350342, 0.5032999515533447, 0.19558005034923553, 1.2368412017822266, -1.3259047269821167, 0.1906599998474121, -0.3645862638950348, 2.092575788497925, 0.1618669629096985, 1.151577353477478, -0.4986788332462311, -2.392120599746704, 0.6159346103668213, -1.3366934061050415, -1.2367041110992432, 0.7634462118148804, -0.8116493225097656, -0.07414653152227402, -1.3428945541381836, -0.13969939947128296, -0.862686038017273, -1.2732312679290771, 0.8889524936676025, 0.211130291223526, 0.490173876285553, -0.7339440584182739, 0.4781542718410492, -2.0489108562469482, -1.3555570840835571, -0.26678532361984253, -0.9528552293777466, 0.422355592250824, -0.26386740803718567, 0.6879937648773193, -0.2992683947086334, 0.10159521549940109, 0.37322938442230225, 1.4338864088058472, 3.4141194820404053, 0.23456794023513794, 0.4429605305194855, -0.16803087294101715, -0.886757493019104, 1.4488630294799805, 0.9588462114334106, -0.16310785710811615, -0.5372612476348877, -1.0763533115386963, 1.2370619773864746, 1.9873347282409668, 0.9196001291275024, 0.0968768522143364, -0.8130419254302979, -0.6992861032485962, -0.11134318262338638, 0.09234372526407242, 0.3290398418903351, 0.9377079010009766, 0.1376444548368454, -0.0013647675514221191, 1.3593963384628296, 1.2681430578231812, -0.5767184495925903, 0.4221058189868927, -0.8877226114273071, -0.40179044008255005, 0.5574649572372437, 0.38992422819137573, -0.10595320165157318, 0.2528783977031708, -0.9231216907501221, -0.183969184756279, -0.27960896492004395, -1.0042592287063599, -0.8349602222442627, -0.42704248428344727, -0.3540787398815155, 1.6950225830078125, 0.029026754200458527, -0.45849519968032837, -0.059017132967710495, -0.7511521577835083, 0.007988044992089272, -0.9903045892715454, 0.1359824538230896, -0.14409193396568298, -0.17473575472831726, 0.025586534291505814, 1.8392724990844727, -0.8712118864059448, -1.9798038005828857, 0.32244423031806946, 0.16241595149040222, -0.3614461123943329, 0.2719137668609619, 1.5994247198104858, 0.5471471548080444, 1.4729071855545044, 1.4275254011154175, 1.0647372007369995, -0.6052548885345459, -1.4186162948608398, 0.7032572031021118, 0.8970440626144409, -1.442328691482544, 0.7882258892059326, 0.16600525379180908, -0.4198284447193146, 0.5708737373352051, 1.210699200630188, 0.5574705600738525, -2.005549907684326, 0.6785119771957397, -0.9677636623382568, 0.8239459991455078, 0.6531933546066284, 0.7037763595581055, 0.31812435388565063, 0.7965364456176758, -1.1062955856323242, -1.0979065895080566, -0.8762830495834351, -0.8070147037506104, 1.8726351261138916, -0.33745497465133667, 0.6276999711990356, -0.05473615974187851, -1.3877246379852295, -0.30767062306404114, 0.7028781175613403, 0.4056393504142761, -0.39267265796661377, 0.6792682409286499, -0.6945228576660156, -1.1740375757217407, -1.4360735416412354, -0.5372288227081299, -1.039487600326538, -0.9629796743392944, 1.013830542564392, 0.8077459335327148, 0.23306909203529358, 1.8386569023132324, 0.6056094169616699, 0.2443755865097046, -2.578939437866211, 0.8838821649551392, 0.35215362906455994, 0.009144814684987068, 0.8230862617492676, 0.46134626865386963, 1.0100146532058716, -0.17063763737678528, 0.6444228887557983, -2.373666524887085, 2.455543041229248, -0.23062892258167267, 0.6375876665115356, 0.07363274693489075, -0.09859830141067505, 1.1077704429626465, 0.4181921184062958, 0.552847146987915, -1.0957579612731934, 0.5567934513092041, -0.7487097978591919, 1.3856592178344727, 0.8368154764175415, -0.8084421157836914, -0.01913117989897728, 1.1924092769622803, 0.4074980318546295, -0.5686451196670532, -0.824059009552002, -1.0089482069015503, 0.9748917818069458, 1.7298330068588257, -0.12355522066354752, -0.032240502536296844, 0.8360493183135986, 0.5502064228057861, -1.3966262340545654, -0.08952463418245316, -0.8340010643005371, -0.8367714881896973, 1.6938196420669556, 1.951568365097046, -0.134073406457901, -0.3376823365688324, -0.8169841766357422, -1.261854648590088, 0.7909054756164551, 0.19890068471431732, -0.08213472366333008, 0.6871902942657471, -0.5782731771469116, 1.2349830865859985, 0.8721774816513062, 0.8650848865509033, 0.1438463181257248, 0.3747461438179016, 0.24318286776542664, -0.34713977575302124, -1.153529405593872, -0.2697311043739319, -1.108832597732544, -2.7897746562957764, 0.38169756531715393, -0.1660289317369461, -1.4132791757583618, -0.1202879473567009, -1.1101757287979126, 0.8662058115005493, -0.5108275413513184, -1.1430517435073853, -1.4192525148391724, 0.16561520099639893, -0.19827723503112793, 0.8999379873275757, -1.6148300170898438, -0.049134761095047, 1.1818485260009766, 1.0466352701187134, -0.809516429901123, 1.0328882932662964, 0.2698570787906647, 1.0979584455490112, 0.8675893545150757, -0.38562238216400146, 0.49942103028297424, 0.052472710609436035, -1.2806360721588135, 0.45982715487480164, 1.086268663406372, 0.05386646091938019, 1.3018850088119507, -0.6556941270828247, 0.05206863582134247, 0.46853670477867126, -0.4570205807685852, -0.4837334156036377, -0.6768555641174316, 0.8311260938644409, -0.06764551997184753, -0.9203393459320068, 0.00019836332648992538, -0.05119818449020386, -0.10298885405063629, 0.19877567887306213, -1.5590676069259644, -0.2641514241695404, -0.18668708205223083, -0.539182186126709, -1.1794393062591553, -0.02153441123664379, 1.3824083805084229, -0.7448314428329468, -0.1980990171432495, 0.42630040645599365, 0.3703831434249878, 0.5663421154022217, 0.5493133068084717, -0.6714977025985718, -0.5438909530639648, -0.24718137085437775, -0.42167264223098755, 0.43436795473098755, 1.388968825340271, -0.1401943862438202, -0.940066933631897, 0.8656129837036133, -0.348924845457077, 0.08651652932167053, 1.8022197484970093, 0.05892129987478256, -0.8886703252792358, 0.22725136578083038, -0.688132643699646, 1.898603081703186, 1.6804957389831543, 1.1883450746536255, -0.03486234322190285, -0.9546130895614624, 0.7015084028244019, -0.2445039451122284, -0.3502192199230194, 0.8193955421447754, 0.46587899327278137, -0.19513295590877533, -1.360592007637024, 0.5788228511810303, 1.240602970123291, -0.7443519830703735, -0.9388962984085083, -0.047848526388406754, -0.7649080753326416, 1.0562702417373657, 0.7579625844955444, 0.3908011019229889, 0.256663978099823, 1.6810307502746582, 0.7512692213058472, -0.4699603319168091, 0.6619579792022705, 0.4555457830429077, -0.06524990499019623, -2.0886900424957275, -1.1093319654464722, 0.2584076523780823, -0.4591137170791626, -1.681269884109497, 1.296326994895935, -1.1231205463409424, -0.8794618844985962, 0.6502373218536377, 0.14975091814994812, 1.5359690189361572, 0.2638740539550781, 1.5184556245803833, 1.9384307861328125, 0.8849420547485352, 0.29271072149276733, 1.3125249147415161, -0.2066248059272766, -0.5702120065689087, 1.9012492895126343, -0.5357611179351807, 0.4416518807411194, 1.106557846069336, -0.2805282175540924, -0.91553795337677, -0.7533376216888428, -1.1621421575546265, -0.7688039541244507, 1.2352501153945923, 0.17515121400356293, -1.3477388620376587, 0.22254209220409393, 1.5241882801055908, 0.1501695066690445, -0.1720483899116516, 0.5768481492996216, 0.42563796043395996, -0.7339047193527222, 0.01600012369453907, -0.8434963226318359, 0.552043080329895, -0.11456291377544403, -0.36468473076820374, 0.43754833936691284, 0.45674124360084534, 1.232904076576233, -0.03684774041175842, 0.1815308928489685, 1.0446780920028687, -1.3582595586776733, 1.5463933944702148, -0.5835592746734619, 0.4287695586681366, -2.4109764099121094, 1.3983122110366821, -0.8079879283905029, 1.908179521560669, -2.650829315185547, 0.28076475858688354, -0.5786821842193604, -0.46102777123451233, 0.3562455177307129, -0.43872544169425964, 0.16239309310913086, -0.2811809182167053, -1.128582239151001, -0.1632106602191925, -0.6733407974243164, 0.61925208568573, 0.9248722791671753, 1.2340410947799683, -1.063477635383606, -0.30773624777793884, -1.8497754335403442, -0.1275354027748108, -0.6134999990463257, 0.3646635115146637, -2.1170084476470947, -0.20664839446544647, -2.0652472972869873, -2.1396234035491943, -1.3931782245635986, -0.8379660844802856, 0.9539185762405396, -0.03054969012737274, -0.7638852596282959, 1.1223708391189575, -0.25155770778656006, -1.8789559602737427, 1.1511361598968506, -2.1650192737579346 ]
https://github.com/huggingface/datasets/issues/3621
Consider adding `ipywidgets` as a dependency.
Any objection if I make a PR that checks if the widgets library is installed beforehand?
When I install `datasets` in a fresh virtualenv with jupyterlab I always see this error. ``` ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html ``` It's a bit of a nuisance, because I need to run shut down the jupyterlab server in order to install the required dependency. Might it be an option to just include it as a dependency here?
988
16
Consider adding `ipywidgets` as a dependency. When I install `datasets` in a fresh virtualenv with jupyterlab I always see this error. ``` ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html ``` It's a bit of a nuisance, because I need to run shut down the jupyterlab server in order to install the required dependency. Might it be an option to just include it as a dependency here? Any objection if I make a PR that checks if the widgets library is installed beforehand?
[ -1.3232721090316772, -0.8348334431648254, -0.8598360419273376, 1.4445937871932983, -0.26564478874206543, -1.2309495210647583, 0.11643369495868683, -1.0231374502182007, 1.7696096897125244, -0.8929191827774048, 0.4386448264122009, -1.7111601829528809, 0.013154999352991581, -0.580095112323761, -0.7235125303268433, -0.8400264382362366, -0.4059993326663971, -0.8363875150680542, 1.0192506313323975, 2.52593994140625, 1.1546962261199951, -1.4856947660446167, 2.613007068634033, 0.7621819376945496, -0.2026028037071228, -1.0332244634628296, 0.43994414806365967, 0.0632241740822792, -1.2102628946304321, -0.3405616581439972, -0.9877691864967346, 0.0021169809624552727, -0.5047266483306885, -0.5600407123565674, 0.029086511582136154, 0.41559842228889465, -0.25865352153778076, -0.45518922805786133, -0.5359950065612793, -0.7145738005638123, 0.49189233779907227, -0.3373841643333435, 0.9996211528778076, -0.40372806787490845, 1.8246428966522217, -0.5718997716903687, 0.34934765100479126, 0.7950010299682617, 1.3612620830535889, 0.19576995074748993, -0.12235768884420395, 0.22914348542690277, 0.41802117228507996, -0.05980086699128151, 0.39200127124786377, 1.1754788160324097, 0.5187348127365112, 0.6242560744285583, 0.6973821520805359, -2.1879074573516846, 1.3931410312652588, -1.1471211910247803, 0.3214159905910492, 1.2771716117858887, -0.9600770473480225, 0.39928001165390015, -1.8369494676589966, 0.00004442688077688217, 0.5820745229721069, -2.2627549171447754, 0.32621222734451294, -1.2380530834197998, -0.6024898290634155, 0.9667960405349731, 0.3482721447944641, -1.3297293186187744, 0.08855948597192764, -0.3291340172290802, 1.0326411724090576, 0.47690629959106445, 1.0705959796905518, -1.8401597738265991, 0.13433538377285004, -0.2465624213218689, 0.0660090520977974, -1.37877357006073, -1.3752371072769165, 0.6016644835472107, 0.7839719653129578, 0.6000837683677673, -0.05433398857712746, 0.9374165534973145, -0.9357330799102783, 0.808434247970581, -0.9043546915054321, -1.6416972875595093, -1.2947726249694824, -2.1848881244659424, -2.291001319885254, 0.8686028122901917, -0.45839032530784607, -0.6530137062072754, 2.002070188522339, -0.8725520968437195, -1.8750712871551514, 1.1887341737747192, 0.2702711522579193, -0.041948407888412476, 2.453510284423828, 0.18121927976608276, -0.7794357538223267, 0.48291704058647156, -0.8274553418159485, 0.9167847037315369, -0.6506543755531311, 1.3490628004074097, 0.5243077278137207, -0.9660007357597351, 1.6803442239761353, -0.4439534842967987, 0.5522961616516113, -0.7076926827430725, -0.5600182414054871, -0.8847081661224365, 0.46681851148605347, 1.9492878913879395, -0.3485129177570343, 1.5546470880508423, -0.36467671394348145, -1.5284571647644043, -1.6488385200500488, 0.8844388723373413, 0.5455507040023804, -0.856398344039917, 0.21944379806518555, -0.3799695670604706, 0.31250613927841187, -0.05661521479487419, 1.0945532321929932, 1.2426142692565918, 0.8141039609909058, -0.18852826952934265, -0.9032647609710693, 0.30263569951057434, -0.060225557535886765, -0.6272459030151367, -1.840491533279419, -0.38498976826667786, 0.027151357382535934, 0.6041277050971985, -1.0950134992599487, 1.831964373588562, 0.9226710796356201, 1.9903640747070312, 0.9425874948501587, -0.283930242061615, 1.563828706741333, -0.11794406175613403, 1.9062339067459106, -0.5168864130973816, 0.7076091170310974, -0.2843303382396698, -1.0928010940551758, 0.9110574126243591, -0.38061225414276123, -1.9708739519119263, -0.8111687302589417, -0.8696478605270386, -0.11082463711500168, -0.7259055376052856, 0.8711775541305542, -0.26137927174568176, -1.3394116163253784, 0.22994311153888702, -0.648892343044281, 0.08118734508752823, -1.1977044343948364, 0.20762968063354492, 0.7652899026870728, -0.6170223951339722, 0.11826832592487335, -0.20821000635623932, -1.3122512102127075, -0.6221317052841187, 0.3438383638858795, 2.018711566925049, -0.7156110405921936, 0.8667165040969849, 1.0028423070907593, -0.7317637801170349, -0.06343533843755722, 0.36901238560676575, -0.2403983175754547, 0.7940541505813599, -1.0036603212356567, -0.3696376383304596, 1.199161171913147, -0.2439868301153183, -0.59711754322052, 1.4754902124404907, 0.7744995355606079, -1.0072940587997437, -0.051054663956165314, -0.32062235474586487, -0.734819233417511, -0.017099855467677116, -1.5815435647964478, -0.05159026011824608, 0.33589139580726624, -1.4138444662094116, -0.4507821798324585, -0.19788967072963715, 1.1851592063903809, -0.23407068848609924, 1.4606844186782837, -0.3283136188983917, -0.22746260464191437, -0.451345294713974, -0.4404861629009247, 0.04059033468365669, -0.2454223483800888, -0.46920180320739746, 0.11763706803321838, -0.725696325302124, 0.3831588625907898, 1.441760540008545, 0.2470732182264328, 0.11100412905216217, 0.4816870391368866, 1.082512378692627, 0.3796026408672333, -0.09852676093578339, -0.8618510961532593, -1.2794824838638306, 1.9821250438690186, -1.3859708309173584, 1.9166780710220337, 0.7594003081321716, -0.015836099162697792, -1.6999677419662476, -1.9036847352981567, 1.4005240201950073, 1.3161921501159668, 2.313962697982788, 0.672950804233551, 0.33636707067489624, -0.837165355682373, -0.6873052716255188, 0.2991085350513458, -1.13742995262146, -0.7809763550758362, 0.15580704808235168, 2.422929048538208, 1.6699100732803345, -0.6229913234710693, -0.255306601524353, -1.0020849704742432, 1.3498053550720215, -0.1223195269703865, 0.22253377735614777, 2.0065577030181885, -0.4205058515071869, -1.2419074773788452, 1.2072949409484863, -2.3992502689361572, 0.08808328211307526, 1.962673306465149, 0.284883588552475, 0.19070856273174286, -1.4440642595291138, -0.5978320240974426, -0.0871715098619461, -0.39601218700408936, -1.0911494493484497, 0.6410176157951355, -0.2924409806728363, -0.7824129462242126, -1.394672155380249, 0.31660887598991394, -1.0280425548553467, -1.77225923538208, 0.2407110631465912, 1.8671634197235107, 1.9967851638793945, -0.8207003474235535, 1.5051778554916382, -0.24620883166790009, 0.00574273057281971, 1.292208194732666, 1.2358555793762207, 2.9730477333068848, 1.995525598526001, -1.0920641422271729, 0.6738532781600952, -0.143371120095253, -0.5350686311721802, 1.0836834907531738, -1.211252212524414, 1.1783549785614014, -0.09343280643224716, -1.1509028673171997, -1.3373202085494995, 0.8405706286430359, 0.4298747479915619, 0.11979731917381287, -0.5119901895523071, 1.329097867012024, 0.17945529520511627, 1.3414241075515747, 0.4311736822128296, -0.31295421719551086, 0.6131605505943298, -0.3627675771713257, -0.43050438165664673, 1.5774222612380981, 0.29999786615371704, -1.3022209405899048, -2.286074161529541, -0.14731955528259277, -0.8412563800811768, -0.020434044301509857, -0.6056873202323914, -0.9678381681442261, 1.622216820716858, 0.45424532890319824, -1.2967482805252075, -0.19397325813770294, -0.41334500908851624, -0.6904338002204895, 2.6795620918273926, -1.5138100385665894, -0.3641766905784607, -0.9532022476196289, -0.499248206615448, 1.6784982681274414, -1.2465444803237915, -0.17161841690540314, -0.930424153804779, -0.4256751239299774, -1.3098623752593994, -0.5607963800430298, -0.0657418966293335, -0.8581783771514893, 0.6546868681907654, 0.2725773751735687, -1.1500335931777954, -0.33572134375572205, -0.7021423578262329, 0.7015138864517212, -0.07132123410701752, 0.3899633288383484, 1.891587495803833, 0.3134380578994751, -0.36279675364494324, 0.825776219367981, 1.2095706462860107, 0.5080917477607727, -0.5087419748306274, 0.3109835982322693, -0.6800532937049866, 0.40584179759025574, -1.3276011943817139, 0.23158477246761322, -2.917109251022339, 0.6608289480209351, -0.04126562923192978, -0.1366918534040451, -0.12014983594417572, -1.3597970008850098, 1.1813160181045532, 2.630239486694336, -1.1545946598052979, 0.5082604289054871, 0.17944808304309845, 1.2649645805358887, -1.4175257682800293, 0.180174320936203, -0.4119761288166046, 2.1049134731292725, 0.19975154101848602, 1.177077054977417, -0.48199522495269775, -2.3223609924316406, 0.5685667991638184, -1.2823234796524048, -1.199681282043457, 0.7443882822990417, -0.8125532865524292, -0.0569080114364624, -1.4676066637039185, -0.17804525792598724, -0.8693604469299316, -1.2853184938430786, 0.9262655377388, 0.22025272250175476, 0.511286199092865, -0.720841109752655, 0.41412949562072754, -2.1640937328338623, -1.4083091020584106, -0.2342699021100998, -0.9821854829788208, 0.45673835277557373, -0.36609333753585815, 0.7343862652778625, -0.24393966794013977, 0.03351447731256485, 0.3434266149997711, 1.4366817474365234, 3.4499523639678955, 0.2520841062068939, 0.4703274369239807, -0.13229253888130188, -0.8411470651626587, 1.4222947359085083, 0.9770970344543457, -0.266704797744751, -0.5215396285057068, -1.047114610671997, 1.294797658920288, 1.9948246479034424, 0.9344311356544495, 0.08415931463241577, -0.8387061953544617, -0.6218771934509277, -0.11348004639148712, 0.12212975323200226, 0.38780874013900757, 0.9929230213165283, 0.08359681069850922, 0.04776204377412796, 1.3611915111541748, 1.209241509437561, -0.5655632019042969, 0.4875115156173706, -0.8969467878341675, -0.42317092418670654, 0.5373274683952332, 0.3279477655887604, -0.0696755051612854, 0.34290724992752075, -0.9166403412818909, -0.23012688755989075, -0.22083355486392975, -0.9878179430961609, -0.8447486758232117, -0.4179574251174927, -0.3039231598377228, 1.676445484161377, 0.09552687406539917, -0.525957465171814, -0.02653440088033676, -0.7758728861808777, -0.09190144389867783, -0.9480416774749756, 0.1464487761259079, -0.10456442832946777, -0.1931380182504654, -0.016202853992581367, 1.7524514198303223, -0.9148010015487671, -2.0484707355499268, 0.3060738742351532, 0.25793445110321045, -0.309909850358963, 0.2137915939092636, 1.6567593812942505, 0.5515890717506409, 1.42239248752594, 1.3998264074325562, 0.999779462814331, -0.5998340249061584, -1.4091150760650635, 0.720034122467041, 0.8726823925971985, -1.4574074745178223, 0.7598968744277954, 0.10565581172704697, -0.40739285945892334, 0.539323627948761, 1.1267536878585815, 0.5020947456359863, -1.9867044687271118, 0.7889845967292786, -1.0191397666931152, 0.8730800747871399, 0.6070597171783447, 0.6831104159355164, 0.24277879297733307, 0.841506838798523, -1.094609260559082, -1.0902137756347656, -0.8665776252746582, -0.8068558573722839, 1.898321270942688, -0.278233140707016, 0.6243799924850464, -0.08445921540260315, -1.3092151880264282, -0.2615526020526886, 0.6924023628234863, 0.37166541814804077, -0.3559738099575043, 0.7377986311912537, -0.6282622814178467, -1.1500366926193237, -1.485114574432373, -0.5320441126823425, -1.0181012153625488, -0.9226672053337097, 1.0442646741867065, 0.7615650296211243, 0.209697425365448, 1.8343353271484375, 0.6176123023033142, 0.2543673515319824, -2.6421096324920654, 0.9743795394897461, 0.4046703279018402, -0.0042775655165314674, 0.8968660831451416, 0.46368739008903503, 0.9814911484718323, -0.19151727855205536, 0.6052414774894714, -2.326439142227173, 2.372542381286621, -0.2494138926267624, 0.648726224899292, 0.05341028422117233, -0.09428678452968597, 1.0691282749176025, 0.4391644597053528, 0.5435292720794678, -1.1649550199508667, 0.5581679344177246, -0.6506221890449524, 1.301756739616394, 0.8794179558753967, -0.7372254729270935, 0.011784247122704983, 1.2224302291870117, 0.3964526355266571, -0.5466778874397278, -0.8232625722885132, -0.8575196266174316, 1.0074275732040405, 1.7368112802505493, -0.11365179717540741, 0.04422680288553238, 0.7585440278053284, 0.49095138907432556, -1.372240424156189, -0.006539464928209782, -0.8239524364471436, -0.8365489840507507, 1.6280447244644165, 1.9593305587768555, -0.14892634749412537, -0.29803067445755005, -0.7914989590644836, -1.3866642713546753, 0.8069330453872681, 0.18563197553157806, 0.031930673867464066, 0.682022750377655, -0.6115365028381348, 1.2009650468826294, 0.8623905181884766, 0.8262155652046204, 0.14808540046215057, 0.3612816333770752, 0.38538843393325806, -0.3283100426197052, -1.1475989818572998, -0.303824782371521, -1.116603970527649, -2.6475830078125, 0.3847538232803345, -0.21237832307815552, -1.3775603771209717, -0.193695068359375, -1.1026972532272339, 0.8593752980232239, -0.44091367721557617, -1.079592227935791, -1.4197646379470825, 0.1914752870798111, -0.12144476920366287, 0.8355624079704285, -1.6426541805267334, -0.11342998594045639, 1.216922640800476, 0.9796522259712219, -0.8409167528152466, 1.045422911643982, 0.2347496747970581, 1.099426507949829, 0.8144725561141968, -0.42769891023635864, 0.5172340869903564, 0.07482070475816727, -1.3059041500091553, 0.5120080709457397, 1.1621673107147217, 0.007742105983197689, 1.4139372110366821, -0.6365116238594055, -0.03583328798413277, 0.4207782447338104, -0.4415706992149353, -0.5097223520278931, -0.6822766065597534, 0.7168939113616943, -0.041319914162158966, -0.9053012132644653, 0.09678139537572861, -0.02273198403418064, -0.1447867900133133, 0.25574448704719543, -1.5212624073028564, -0.2711837589740753, -0.2583117187023163, -0.4227493703365326, -1.2013745307922363, -0.060343578457832336, 1.4277100563049316, -0.7027836441993713, -0.17193366587162018, 0.4830068051815033, 0.4678993821144104, 0.5562881827354431, 0.5335297584533691, -0.612159252166748, -0.46350905299186707, -0.13014507293701172, -0.40630266070365906, 0.44532251358032227, 1.2879736423492432, -0.14239032566547394, -1.0300366878509521, 0.8305668234825134, -0.3320861756801605, 0.09800806641578674, 1.7861242294311523, 0.06360075622797012, -0.8868376612663269, 0.25686490535736084, -0.7297008037567139, 1.8305490016937256, 1.6785929203033447, 1.1463723182678223, -0.04700859636068344, -0.8225554823875427, 0.7193036675453186, -0.21257270872592926, -0.32773926854133606, 0.8591293692588806, 0.42204999923706055, -0.2795243263244629, -1.4867277145385742, 0.5454211235046387, 1.2248951196670532, -0.8279753923416138, -0.9147617220878601, -0.08534962683916092, -0.7335583567619324, 1.0434932708740234, 0.751681387424469, 0.43352174758911133, 0.2638660967350006, 1.7367899417877197, 0.7430324554443359, -0.44693663716316223, 0.7016898989677429, 0.3651883602142334, -0.0033669262193143368, -2.0765061378479004, -1.1546920537948608, 0.28888919949531555, -0.44150716066360474, -1.587378978729248, 1.2610487937927246, -1.0833226442337036, -0.9425989985466003, 0.648686945438385, 0.10556943714618683, 1.5060104131698608, 0.1641242802143097, 1.6006382703781128, 1.983034610748291, 0.8988245129585266, 0.29212793707847595, 1.3137507438659668, -0.24817153811454773, -0.47507378458976746, 1.8915126323699951, -0.47972458600997925, 0.4542263150215149, 1.0545108318328857, -0.3152545392513275, -0.9151946306228638, -0.7372077107429504, -1.2506412267684937, -0.7614535689353943, 1.2068003416061401, 0.17669668793678284, -1.2998685836791992, 0.23913420736789703, 1.5457860231399536, 0.1280509978532791, -0.14751936495304108, 0.5142402648925781, 0.5337654948234558, -0.8696542978286743, 0.05065201595425606, -0.891002357006073, 0.47626638412475586, -0.12592773139476776, -0.42780905961990356, 0.46320074796676636, 0.3809935748577118, 1.233535647392273, 0.029143936932086945, 0.16881583631038666, 1.0688226222991943, -1.4157276153564453, 1.5959419012069702, -0.630100667476654, 0.3478711247444153, -2.456204652786255, 1.3855690956115723, -0.749386191368103, 2.010580539703369, -2.6591007709503174, 0.3191079795360565, -0.6309546232223511, -0.48459893465042114, 0.44171175360679626, -0.36881083250045776, 0.18463394045829773, -0.2513677477836609, -1.1464225053787231, -0.0690997913479805, -0.6935604810714722, 0.5832445025444031, 0.9718940854072571, 1.2869709730148315, -1.063311219215393, -0.28108394145965576, -1.8072654008865356, -0.1624768227338791, -0.6243914365768433, 0.32711803913116455, -2.164278745651245, -0.19742605090141296, -2.049448013305664, -2.1021406650543213, -1.3871855735778809, -0.8634820580482483, 1.0413581132888794, -0.053055986762046814, -0.835344135761261, 1.163203477859497, -0.30385732650756836, -1.8333181142807007, 1.1204794645309448, -2.091463327407837 ]
https://github.com/huggingface/datasets/issues/3618
TIMIT Dataset not working with GPU
Hi ! I think you should avoid calling `timit_train['audio']`. Indeed by doing so you're **loading all the audio column in memory**. This is problematic in your case because the TIMIT dataset is huge. If you want to access the audio data of some samples, you should do this instead `timit_train[:10]["train"]` for example. Other than that, I'm not sure why you get a `TypeError: string indices must be integers`, do you have a code snippet that reproduces the issue that you can share here ?
## Describe the bug I am working trying to use the TIMIT dataset in order to fine-tune Wav2Vec2 model and I am unable to load the "audio" column from the dataset when working with a GPU. I am working on Amazon Sagemaker Studio, on the Python 3 (PyTorch 1.8 Python 3.6 GPU Optimized) environment, with a single ml.g4dn.xlarge instance (corresponds to a Tesla T4 GPU). I don't know if the issue is GPU related or Python environment related because everything works when I work off of the CPU Optimized environment with a non-GPU instance. My code also works on Google Colab with a GPU instance. This issue is blocking because I cannot get the 'audio' column in any way due to this error, which means that I can't pass it to any functions. I later use the dataset.map function and that is where I originally noticed this error. ## Steps to reproduce the bug ```python from datasets import load_dataset timit_train = load_dataset('timit_asr', split='train') print(timit_train['audio']) ``` ## Expected results Expected to see inside the 'audio' column, which contains an 'array' nested field with the array data I actually need. ## Actual results Traceback ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-ceeac555e921> in <module> ----> 1 timit_train['audio'] /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in __getitem__(self, key) 1917 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" 1918 return self._getitem( -> 1919 key, 1920 ) 1921 /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in _getitem(self, key, decoded, **kwargs) 1902 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) 1903 formatted_output = format_table( -> 1904 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns 1905 ) 1906 return formatted_output /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_table(table, key, formatter, format_columns, output_all_columns) 529 python_formatter = PythonFormatter(features=None) 530 if format_columns is None: --> 531 return formatter(pa_table, query_type=query_type) 532 elif query_type == "column": 533 if key in format_columns: /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in __call__(self, pa_table, query_type) 280 return self.format_row(pa_table) 281 elif query_type == "column": --> 282 return self.format_column(pa_table) 283 elif query_type == "batch": 284 return self.format_batch(pa_table) /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_column(self, pa_table) 315 column = self.python_arrow_extractor().extract_column(pa_table) 316 if self.decoded: --> 317 column = self.python_features_decoder.decode_column(column, pa_table.column_names[0]) 318 return column 319 /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in decode_column(self, column, column_name) 221 222 def decode_column(self, column: list, column_name: str) -> list: --> 223 return self.features.decode_column(column, column_name) if self.features else column 224 225 def decode_batch(self, batch: dict) -> dict: /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in decode_column(self, column, column_name) 1337 return ( 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] -> 1339 if self._column_requires_decoding[column_name] 1340 else column 1341 ) /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in <listcomp>(.0) 1336 """ 1337 return ( -> 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] 1339 if self._column_requires_decoding[column_name] 1340 else column /opt/conda/lib/python3.6/site-packages/datasets/features/audio.py in decode_example(self, value) 85 dict 86 """ ---> 87 path, file = (value["path"], BytesIO(value["bytes"])) if value["bytes"] is not None else (value["path"], None) 88 if path is None and file is None: 89 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.") TypeError: string indices must be integers ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-4.14.256-197.484.amzn2.x86_64-x86_64-with-debian-buster-sid - Python version: 3.6.13 - PyArrow version: 6.0.1
989
84
TIMIT Dataset not working with GPU ## Describe the bug I am working trying to use the TIMIT dataset in order to fine-tune Wav2Vec2 model and I am unable to load the "audio" column from the dataset when working with a GPU. I am working on Amazon Sagemaker Studio, on the Python 3 (PyTorch 1.8 Python 3.6 GPU Optimized) environment, with a single ml.g4dn.xlarge instance (corresponds to a Tesla T4 GPU). I don't know if the issue is GPU related or Python environment related because everything works when I work off of the CPU Optimized environment with a non-GPU instance. My code also works on Google Colab with a GPU instance. This issue is blocking because I cannot get the 'audio' column in any way due to this error, which means that I can't pass it to any functions. I later use the dataset.map function and that is where I originally noticed this error. ## Steps to reproduce the bug ```python from datasets import load_dataset timit_train = load_dataset('timit_asr', split='train') print(timit_train['audio']) ``` ## Expected results Expected to see inside the 'audio' column, which contains an 'array' nested field with the array data I actually need. ## Actual results Traceback ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-ceeac555e921> in <module> ----> 1 timit_train['audio'] /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in __getitem__(self, key) 1917 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" 1918 return self._getitem( -> 1919 key, 1920 ) 1921 /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in _getitem(self, key, decoded, **kwargs) 1902 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) 1903 formatted_output = format_table( -> 1904 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns 1905 ) 1906 return formatted_output /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_table(table, key, formatter, format_columns, output_all_columns) 529 python_formatter = PythonFormatter(features=None) 530 if format_columns is None: --> 531 return formatter(pa_table, query_type=query_type) 532 elif query_type == "column": 533 if key in format_columns: /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in __call__(self, pa_table, query_type) 280 return self.format_row(pa_table) 281 elif query_type == "column": --> 282 return self.format_column(pa_table) 283 elif query_type == "batch": 284 return self.format_batch(pa_table) /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_column(self, pa_table) 315 column = self.python_arrow_extractor().extract_column(pa_table) 316 if self.decoded: --> 317 column = self.python_features_decoder.decode_column(column, pa_table.column_names[0]) 318 return column 319 /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in decode_column(self, column, column_name) 221 222 def decode_column(self, column: list, column_name: str) -> list: --> 223 return self.features.decode_column(column, column_name) if self.features else column 224 225 def decode_batch(self, batch: dict) -> dict: /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in decode_column(self, column, column_name) 1337 return ( 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] -> 1339 if self._column_requires_decoding[column_name] 1340 else column 1341 ) /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in <listcomp>(.0) 1336 """ 1337 return ( -> 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] 1339 if self._column_requires_decoding[column_name] 1340 else column /opt/conda/lib/python3.6/site-packages/datasets/features/audio.py in decode_example(self, value) 85 dict 86 """ ---> 87 path, file = (value["path"], BytesIO(value["bytes"])) if value["bytes"] is not None else (value["path"], None) 88 if path is None and file is None: 89 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.") TypeError: string indices must be integers ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-4.14.256-197.484.amzn2.x86_64-x86_64-with-debian-buster-sid - Python version: 3.6.13 - PyArrow version: 6.0.1 Hi ! I think you should avoid calling `timit_train['audio']`. Indeed by doing so you're **loading all the audio column in memory**. This is problematic in your case because the TIMIT dataset is huge. If you want to access the audio data of some samples, you should do this instead `timit_train[:10]["train"]` for example. Other than that, I'm not sure why you get a `TypeError: string indices must be integers`, do you have a code snippet that reproduces the issue that you can share here ?
[ -1.2647321224212646, -0.8886952996253967, -0.6472134590148926, 1.4138190746307373, -0.07949122786521912, -1.313057541847229, 0.08145900070667267, -0.9339150190353394, 1.62185537815094, -0.8823034763336182, 0.3373264968395233, -1.6882554292678833, 0.1112191453576088, -0.5964295268058777, -0.7424575686454773, -0.6608542799949646, -0.28661951422691345, -0.6930971145629883, 1.066750168800354, 2.3873655796051025, 1.104068398475647, -1.3673522472381592, 2.8862762451171875, 0.6344596743583679, -0.2634269595146179, -0.8835254907608032, 0.430915892124176, -0.008650314062833786, -1.4499998092651367, -0.29580962657928467, -0.9948140978813171, 0.01772676780819893, -0.6852909922599792, -0.5250044465065002, 0.09243851900100708, 0.4820097088813782, -0.17605216801166534, -0.4556626081466675, -0.3425646424293518, -0.6999073028564453, 0.5697444081306458, -0.3427639305591583, 0.8425794839859009, -0.29066216945648193, 1.7806233167648315, -0.617828905582428, 0.48883867263793945, 0.5502216815948486, 1.2975702285766602, 0.26030558347702026, -0.052047789096832275, 0.45088744163513184, 0.29831641912460327, 0.00022198539227247238, 0.5844095349311829, 1.243964433670044, 0.5593083500862122, 0.537670373916626, 0.7217525839805603, -2.192877769470215, 1.4112117290496826, -0.7967541217803955, 0.22156235575675964, 1.3436230421066284, -1.0806994438171387, 0.5380545258522034, -1.855231523513794, -0.10793545097112656, 0.37404125928878784, -2.2898142337799072, 0.11942146718502045, -1.2682288885116577, -0.5469743013381958, 1.0252596139907837, 0.34787923097610474, -1.2692620754241943, 0.027377668768167496, -0.4351905584335327, 0.9599073529243469, 0.3614089787006378, 1.1643871068954468, -1.592422366142273, 0.03508449345827103, -0.23595088720321655, 0.32555684447288513, -1.2290141582489014, -1.6068328619003296, 0.6133379936218262, 0.6746487617492676, 0.5640817284584045, -0.10742682963609695, 0.91684889793396, -1.1042418479919434, 0.8542332649230957, -0.9177533984184265, -1.7671326398849487, -1.2719234228134155, -2.4090654850006104, -2.3407909870147705, 0.7933451533317566, -0.45911645889282227, -0.4124586880207062, 2.1550590991973877, -1.208667278289795, -1.7838619947433472, 1.1574592590332031, 0.3198811411857605, -0.08131995052099228, 2.3951900005340576, 0.18934616446495056, -0.8973209261894226, 0.7207262516021729, -0.8458586931228638, 0.7286521792411804, -0.4803287386894226, 1.2479604482650757, 0.3671933710575104, -1.015560507774353, 1.5963460206985474, -0.4124966859817505, 0.5562397241592407, -0.7471591830253601, -0.3723842203617096, -0.5842087864875793, 0.26331716775894165, 2.036870002746582, -0.19128939509391785, 1.5230743885040283, -0.23623055219650269, -1.4762037992477417, -1.425304651260376, 0.8059109449386597, 0.5343431234359741, -0.8476883172988892, 0.2457181215286255, -0.32823890447616577, 0.17346245050430298, 0.19047009944915771, 1.0578097105026245, 1.3527946472167969, 0.77501380443573, -0.16077445447444916, -0.9399117827415466, 0.1133580133318901, -0.10824312269687653, -0.5035039782524109, -1.7879399061203003, -0.30250680446624756, 0.16534075140953064, 0.6718754768371582, -1.2054401636123657, 1.8903511762619019, 0.9230970144271851, 1.9683984518051147, 1.0298054218292236, -0.34042415022850037, 1.546472191810608, 0.13734354078769684, 1.8428096771240234, -0.2621397078037262, 0.7082369327545166, -0.5710582137107849, -1.1437418460845947, 0.6277948021888733, -0.3900489807128906, -1.9157748222351074, -0.3984016180038452, -0.9321011900901794, -0.10699612647294998, -0.8556980490684509, 1.0087544918060303, -0.2261783331632614, -1.404504418373108, 0.2812795639038086, -0.6818772554397583, 0.20266738533973694, -1.341726303100586, 0.3103398382663727, 0.6999056339263916, -0.6869061589241028, 0.1120670810341835, -0.45195335149765015, -1.4052289724349976, -0.5632108449935913, 0.4859057664871216, 1.730226993560791, -0.7512651681900024, 1.0174225568771362, 1.010542631149292, -0.5821380019187927, -0.11427363753318787, 0.5402370691299438, -0.4261339604854584, 0.86309415102005, -0.9917380213737488, -0.40184420347213745, 1.076917052268982, -0.3323761224746704, -0.45655301213264465, 1.3004342317581177, 0.701240062713623, -0.9821875691413879, -0.3372199237346649, -0.12310580909252167, -0.8150513768196106, 0.012688740156590939, -1.6169661283493042, -0.12518414855003357, 0.2682993412017822, -1.5451503992080688, -0.4307065010070801, -0.07623512297868729, 1.1922376155853271, -0.0075788237154483795, 1.4133540391921997, -0.3431776463985443, -0.06371741741895676, -0.4662834405899048, -0.6108959317207336, 0.17420488595962524, -0.13878922164440155, -0.6674498915672302, 0.26173415780067444, -0.7192078828811646, 0.1984800547361374, 1.4228821992874146, 0.2906680703163147, 0.07243331521749496, 0.5051981210708618, 1.2118244171142578, 0.3286275565624237, -0.1456228643655777, -0.8287588953971863, -1.7022135257720947, 2.0031208992004395, -1.6733508110046387, 2.0073392391204834, 0.8459134697914124, -0.01918763853609562, -1.8204385042190552, -1.8336604833602905, 1.498030424118042, 1.092775821685791, 2.4495558738708496, 0.5716277956962585, 0.42198556661605835, -0.8020254969596863, -0.6463773846626282, 0.49933141469955444, -0.7890920639038086, -0.9360100030899048, 0.054226383566856384, 2.301063299179077, 1.7435951232910156, -0.3470931053161621, -0.19170114398002625, -0.9244458079338074, 1.4030929803848267, -0.29219505190849304, 0.29121917486190796, 1.87637460231781, -0.38671058416366577, -1.0550607442855835, 1.2750191688537598, -2.388509750366211, 0.270696759223938, 1.9856114387512207, 0.2830713391304016, 0.026326168328523636, -1.179630994796753, -0.7105243802070618, -0.08075692504644394, -0.40668243169784546, -1.2353515625, 0.3755550980567932, -0.2932848036289215, -0.7431211471557617, -1.3837693929672241, 0.03639766573905945, -1.2448667287826538, -1.6336042881011963, 0.29621651768684387, 1.8689273595809937, 2.220651388168335, -0.7955330014228821, 1.3517292737960815, -0.2667416036128998, 0.3146252930164337, 1.1744256019592285, 1.2195961475372314, 3.16141676902771, 1.832007646560669, -1.2611445188522339, 0.6330965161323547, -0.16129405796527863, -0.4753722548484802, 1.2236148118972778, -0.9354265928268433, 1.1967312097549438, -0.19885747134685516, -1.3386547565460205, -1.1571124792099, 0.8999983668327332, 0.4561367332935333, -0.07328131794929504, -0.39969417452812195, 1.127292513847351, 0.13443347811698914, 1.314030647277832, 0.6024960279464722, -0.29188063740730286, 0.5643169283866882, -0.30178317427635193, -0.548731803894043, 1.5519053936004639, 0.048815738409757614, -1.468189001083374, -2.2817628383636475, -0.14793509244918823, -0.9089892506599426, -0.0110882967710495, -0.8356008529663086, -1.0131700038909912, 1.422215223312378, 0.4678874909877777, -0.9107133746147156, -0.11990313231945038, -0.40288883447647095, -0.6455588340759277, 2.5625760555267334, -1.3616477251052856, -0.31797951459884644, -0.8893600702285767, -0.6105954647064209, 1.4957765340805054, -1.1910455226898193, -0.2251572608947754, -1.0077928304672241, -0.4748441278934479, -1.279314398765564, -0.46862736344337463, -0.08430745452642441, -0.8656675815582275, 0.7209872007369995, 0.051590561866760254, -1.2437496185302734, -0.24484437704086304, -1.0579357147216797, 0.780958890914917, -0.21884089708328247, 0.09073246270418167, 1.761557698249817, 0.24002963304519653, -0.41510269045829773, 0.831174910068512, 1.2271623611450195, 0.5774657726287842, -0.5386257767677307, 0.1925964206457138, -0.6443235874176025, 0.532919704914093, -1.2276090383529663, 0.3682151138782501, -2.9434561729431152, 0.6867900490760803, 0.08090896159410477, -0.07386063784360886, -0.16141115128993988, -1.4574272632598877, 0.9233518838882446, 2.4774537086486816, -1.096061110496521, 0.6501322388648987, 0.2804704010486603, 1.3023056983947754, -1.673887014389038, 0.1084415391087532, -0.6252288818359375, 2.0829193592071533, 0.06950956583023071, 1.097617268562317, -0.5459311008453369, -2.461400032043457, 0.5466499924659729, -1.155001163482666, -1.0244115591049194, 0.7306584119796753, -0.8556129932403564, 0.13635903596878052, -1.1892906427383423, -0.17157265543937683, -0.898783266544342, -1.0946916341781616, 0.5372651815414429, 0.10056457668542862, 0.6310678720474243, -0.6158241033554077, 0.2521827816963196, -2.3320562839508057, -1.3876270055770874, -0.14586083590984344, -0.8711285591125488, 0.5193703174591064, -0.39486902952194214, 0.7115902304649353, -0.13006798923015594, 0.06682056188583374, 0.2158719003200531, 1.4774227142333984, 3.1699180603027344, 0.07033617049455643, 0.38884836435317993, -0.3530209958553314, -1.0434612035751343, 1.5245360136032104, 0.9149453639984131, -0.3703669309616089, -0.6477615237236023, -0.9873577356338501, 1.437880277633667, 1.9241418838500977, 0.9705777764320374, 0.11816757917404175, -0.9060859084129333, -0.8051576614379883, 0.07670163363218307, 0.07160908728837967, 0.48273807764053345, 1.0330841541290283, 0.1763220727443695, 0.23015014827251434, 1.3667551279067993, 1.0764259099960327, -0.38651174306869507, 0.48720797896385193, -0.8357126712799072, -0.39313986897468567, 0.4930878281593323, 0.4263056516647339, -0.04697956517338753, 0.2019655704498291, -0.9594129920005798, -0.1577759087085724, -0.2897327244281769, -0.8608633279800415, -0.7424020171165466, -0.3262472450733185, -0.3830033838748932, 1.8158917427062988, 0.00555398128926754, -0.5569713115692139, -0.055938202887773514, -0.8007502555847168, -0.07351339608430862, -0.9803864359855652, 0.22600635886192322, -0.14232107996940613, 0.006578222848474979, -0.11575605720281601, 1.7297186851501465, -0.9712722897529602, -2.215148448944092, 0.1416754126548767, 0.20035594701766968, -0.2919950485229492, -0.1394241601228714, 1.7775546312332153, 0.5704072713851929, 1.40542733669281, 1.6491973400115967, 1.0456115007400513, -0.6483228802680969, -1.3268258571624756, 0.7288176417350769, 0.9084739089012146, -1.3455432653427124, 0.8899564743041992, -0.094652459025383, -0.6087819337844849, 0.5502459406852722, 1.3118312358856201, 0.43585261702537537, -2.035053253173828, 0.9326478242874146, -1.1370009183883667, 0.8729574680328369, 0.8241004347801208, 0.8535171747207642, 0.18721990287303925, 0.8623724579811096, -1.2135682106018066, -1.071210265159607, -0.6597578525543213, -0.7105010747909546, 1.896180272102356, -0.30377843976020813, 0.30234771966934204, -0.25788646936416626, -1.26785147190094, 0.08687137812376022, 0.6612517237663269, 0.30325034260749817, -0.24737544357776642, 0.7140762209892273, -0.7798006534576416, -1.1687511205673218, -1.4431020021438599, -0.4580658972263336, -0.9797496199607849, -0.850592315196991, 0.9670803546905518, 0.7813855409622192, 0.4415401518344879, 1.9771689176559448, 0.6685789227485657, 0.15145157277584076, -2.6041131019592285, 0.8656266927719116, 0.375116765499115, -0.13283798098564148, 0.7814111709594727, 0.2694978415966034, 1.2121447324752808, -0.10263323038816452, 0.5610167384147644, -2.347175359725952, 2.2526166439056396, -0.26843616366386414, 0.8462886810302734, 0.008772778324782848, 0.04191943630576134, 1.0281174182891846, 0.5580107569694519, 0.6534639596939087, -1.0992501974105835, 0.8961001038551331, -0.6766380667686462, 1.2092723846435547, 0.8903021216392517, -0.8979292511940002, 0.12269288301467896, 1.230589747428894, 0.2921594977378845, -0.6369526386260986, -1.03335440158844, -0.8934895992279053, 0.8969411849975586, 1.8559767007827759, 0.008609897457063198, 0.07356799393892288, 0.7522598505020142, 0.7675720453262329, -1.3030329942703247, 0.031109917908906937, -0.5321963429450989, -0.7414300441741943, 1.7917922735214233, 2.0405685901641846, -0.04065334424376488, -0.045035261660814285, -0.6717929244041443, -1.5301352739334106, 0.8222823739051819, 0.1872088760137558, 0.011959788389503956, 0.7795640826225281, -0.6852076053619385, 1.2256665229797363, 0.8415351510047913, 0.8628460168838501, 0.2213374227285385, 0.01207349169999361, 0.2536495625972748, -0.27055174112319946, -1.1400724649429321, -0.31793174147605896, -0.9579440355300903, -2.5603556632995605, 0.38591715693473816, -0.208093523979187, -1.509416103363037, 0.20671899616718292, -0.8742547631263733, 0.7415274381637573, -0.5423686504364014, -1.216458797454834, -1.3912153244018555, 0.23188002407550812, -0.17860165238380432, 0.6994929313659668, -1.6322487592697144, -0.14239895343780518, 1.1057456731796265, 1.0461422204971313, -0.6168261766433716, 0.9928783178329468, 0.31200194358825684, 0.8702443242073059, 0.9552839994430542, -0.4391222298145294, 0.419481098651886, 0.2164507806301117, -1.34426748752594, 0.34372085332870483, 1.3762187957763672, 0.14363475143909454, 1.3303323984146118, -0.45768842101097107, -0.006860416382551193, 0.41958877444267273, -0.27131959795951843, -0.4912984073162079, -0.7047750353813171, 0.6530009508132935, -0.15171392261981964, -0.9097104072570801, -0.07937570661306381, 0.026546433568000793, -0.22290761768817902, 0.305386483669281, -1.5418061017990112, -0.11227767169475555, -0.4233458638191223, -0.6806974411010742, -1.3431780338287354, -0.027187347412109375, 1.3890399932861328, -0.8578990697860718, -0.16708898544311523, 0.5571561455726624, 0.3030802309513092, 0.48368310928344727, 0.6412657499313354, -0.7735017538070679, -0.23197637498378754, -0.07414260506629944, -0.39495694637298584, 0.3079383373260498, 1.2965441942214966, -0.1367318481206894, -0.9844367504119873, 0.465684175491333, -0.2457021027803421, 0.10885582864284515, 1.8586392402648926, 0.05357041209936142, -0.8718341588973999, 0.33686310052871704, -0.8226186633110046, 1.9052668809890747, 1.636285662651062, 1.3069164752960205, -0.05924295634031296, -0.9486669898033142, 0.6002145409584045, -0.2870314121246338, -0.3181701600551605, 0.8772949576377869, 0.39327141642570496, -0.2890656888484955, -1.3823118209838867, 0.7030133605003357, 1.1526927947998047, -0.7485164999961853, -0.7645214200019836, -0.029144294559955597, -0.8539190888404846, 1.267492651939392, 0.6569898724555969, 0.3409351408481598, 0.23905016481876373, 1.7584869861602783, 0.7594270706176758, -0.629708468914032, 0.5489968657493591, 0.4301753342151642, -0.21248459815979004, -2.0392560958862305, -1.1084119081497192, 0.24039235711097717, -0.41107338666915894, -1.540494441986084, 1.4221419095993042, -1.189676284790039, -0.9322291612625122, 0.5571454763412476, 0.13516809046268463, 1.309037685394287, 0.29206061363220215, 1.6734321117401123, 1.991439938545227, 0.9407336115837097, 0.46114441752433777, 1.1116204261779785, -0.33472922444343567, -0.2147126942873001, 1.679069995880127, -0.49232128262519836, 0.5889590382575989, 1.0404903888702393, -0.44799333810806274, -1.196510672569275, -0.8118433952331543, -1.1573785543441772, -0.7869958281517029, 0.9937018156051636, 0.166849285364151, -1.1223114728927612, 0.33028706908226013, 1.5995606184005737, 0.02732335776090622, -0.13080966472625732, 0.7094204425811768, 0.4618220329284668, -0.6558139324188232, -0.09946980327367783, -1.0208405256271362, 0.5858111381530762, -0.32304829359054565, -0.40687432885169983, 0.2427901029586792, 0.5333766341209412, 1.222797155380249, 0.15228009223937988, 0.055875882506370544, 1.4778019189834595, -1.4099018573760986, 1.2291467189788818, -0.9910569190979004, 0.37040185928344727, -2.274461269378662, 1.483457326889038, -0.9370652437210083, 1.9922839403152466, -2.6730546951293945, 0.45992013812065125, -0.600883424282074, -0.5868232250213623, 0.2207479476928711, -0.18314668536186218, 0.0948587954044342, -0.051737792789936066, -1.0736457109451294, -0.13207930326461792, -0.83406662940979, 0.4150427281856537, 1.2150945663452148, 1.283305048942566, -0.9471378922462463, -0.2234511375427246, -1.5990324020385742, -0.15682902932167053, -0.5353323817253113, 0.213409423828125, -1.8440935611724854, -0.21471130847930908, -2.104276657104492, -2.4333081245422363, -1.378914713859558, -0.9629499316215515, 1.3010166883468628, 0.11742658913135529, -0.880017876625061, 1.1680632829666138, -0.38787296414375305, -1.7702780961990356, 1.247343897819519, -2.1451001167297363 ]
https://github.com/huggingface/datasets/issues/3618
TIMIT Dataset not working with GPU
I get the same error when I try to do `timit_train[0]` or really any indexing into the whole thing. Really, that IS the code snippet that reproduces the issue. If you index into other fields like 'file' or whatever, it works. As soon as one of the fields you're looking into is 'audio', you get that issue. It's a weird issue and I suspect it's Sagemaker/environment related, maybe the mix of libraries and dependencies are not good. Example code snippet with issue. ```python from datasets import load_dataset timit_train = load_dataset('timit_asr', split='train') print(timit_train[0]) ```
## Describe the bug I am working trying to use the TIMIT dataset in order to fine-tune Wav2Vec2 model and I am unable to load the "audio" column from the dataset when working with a GPU. I am working on Amazon Sagemaker Studio, on the Python 3 (PyTorch 1.8 Python 3.6 GPU Optimized) environment, with a single ml.g4dn.xlarge instance (corresponds to a Tesla T4 GPU). I don't know if the issue is GPU related or Python environment related because everything works when I work off of the CPU Optimized environment with a non-GPU instance. My code also works on Google Colab with a GPU instance. This issue is blocking because I cannot get the 'audio' column in any way due to this error, which means that I can't pass it to any functions. I later use the dataset.map function and that is where I originally noticed this error. ## Steps to reproduce the bug ```python from datasets import load_dataset timit_train = load_dataset('timit_asr', split='train') print(timit_train['audio']) ``` ## Expected results Expected to see inside the 'audio' column, which contains an 'array' nested field with the array data I actually need. ## Actual results Traceback ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-ceeac555e921> in <module> ----> 1 timit_train['audio'] /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in __getitem__(self, key) 1917 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" 1918 return self._getitem( -> 1919 key, 1920 ) 1921 /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in _getitem(self, key, decoded, **kwargs) 1902 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) 1903 formatted_output = format_table( -> 1904 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns 1905 ) 1906 return formatted_output /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_table(table, key, formatter, format_columns, output_all_columns) 529 python_formatter = PythonFormatter(features=None) 530 if format_columns is None: --> 531 return formatter(pa_table, query_type=query_type) 532 elif query_type == "column": 533 if key in format_columns: /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in __call__(self, pa_table, query_type) 280 return self.format_row(pa_table) 281 elif query_type == "column": --> 282 return self.format_column(pa_table) 283 elif query_type == "batch": 284 return self.format_batch(pa_table) /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_column(self, pa_table) 315 column = self.python_arrow_extractor().extract_column(pa_table) 316 if self.decoded: --> 317 column = self.python_features_decoder.decode_column(column, pa_table.column_names[0]) 318 return column 319 /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in decode_column(self, column, column_name) 221 222 def decode_column(self, column: list, column_name: str) -> list: --> 223 return self.features.decode_column(column, column_name) if self.features else column 224 225 def decode_batch(self, batch: dict) -> dict: /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in decode_column(self, column, column_name) 1337 return ( 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] -> 1339 if self._column_requires_decoding[column_name] 1340 else column 1341 ) /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in <listcomp>(.0) 1336 """ 1337 return ( -> 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] 1339 if self._column_requires_decoding[column_name] 1340 else column /opt/conda/lib/python3.6/site-packages/datasets/features/audio.py in decode_example(self, value) 85 dict 86 """ ---> 87 path, file = (value["path"], BytesIO(value["bytes"])) if value["bytes"] is not None else (value["path"], None) 88 if path is None and file is None: 89 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.") TypeError: string indices must be integers ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-4.14.256-197.484.amzn2.x86_64-x86_64-with-debian-buster-sid - Python version: 3.6.13 - PyArrow version: 6.0.1
989
93
TIMIT Dataset not working with GPU ## Describe the bug I am working trying to use the TIMIT dataset in order to fine-tune Wav2Vec2 model and I am unable to load the "audio" column from the dataset when working with a GPU. I am working on Amazon Sagemaker Studio, on the Python 3 (PyTorch 1.8 Python 3.6 GPU Optimized) environment, with a single ml.g4dn.xlarge instance (corresponds to a Tesla T4 GPU). I don't know if the issue is GPU related or Python environment related because everything works when I work off of the CPU Optimized environment with a non-GPU instance. My code also works on Google Colab with a GPU instance. This issue is blocking because I cannot get the 'audio' column in any way due to this error, which means that I can't pass it to any functions. I later use the dataset.map function and that is where I originally noticed this error. ## Steps to reproduce the bug ```python from datasets import load_dataset timit_train = load_dataset('timit_asr', split='train') print(timit_train['audio']) ``` ## Expected results Expected to see inside the 'audio' column, which contains an 'array' nested field with the array data I actually need. ## Actual results Traceback ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-ceeac555e921> in <module> ----> 1 timit_train['audio'] /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in __getitem__(self, key) 1917 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" 1918 return self._getitem( -> 1919 key, 1920 ) 1921 /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in _getitem(self, key, decoded, **kwargs) 1902 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) 1903 formatted_output = format_table( -> 1904 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns 1905 ) 1906 return formatted_output /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_table(table, key, formatter, format_columns, output_all_columns) 529 python_formatter = PythonFormatter(features=None) 530 if format_columns is None: --> 531 return formatter(pa_table, query_type=query_type) 532 elif query_type == "column": 533 if key in format_columns: /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in __call__(self, pa_table, query_type) 280 return self.format_row(pa_table) 281 elif query_type == "column": --> 282 return self.format_column(pa_table) 283 elif query_type == "batch": 284 return self.format_batch(pa_table) /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_column(self, pa_table) 315 column = self.python_arrow_extractor().extract_column(pa_table) 316 if self.decoded: --> 317 column = self.python_features_decoder.decode_column(column, pa_table.column_names[0]) 318 return column 319 /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in decode_column(self, column, column_name) 221 222 def decode_column(self, column: list, column_name: str) -> list: --> 223 return self.features.decode_column(column, column_name) if self.features else column 224 225 def decode_batch(self, batch: dict) -> dict: /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in decode_column(self, column, column_name) 1337 return ( 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] -> 1339 if self._column_requires_decoding[column_name] 1340 else column 1341 ) /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in <listcomp>(.0) 1336 """ 1337 return ( -> 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] 1339 if self._column_requires_decoding[column_name] 1340 else column /opt/conda/lib/python3.6/site-packages/datasets/features/audio.py in decode_example(self, value) 85 dict 86 """ ---> 87 path, file = (value["path"], BytesIO(value["bytes"])) if value["bytes"] is not None else (value["path"], None) 88 if path is None and file is None: 89 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.") TypeError: string indices must be integers ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-4.14.256-197.484.amzn2.x86_64-x86_64-with-debian-buster-sid - Python version: 3.6.13 - PyArrow version: 6.0.1 I get the same error when I try to do `timit_train[0]` or really any indexing into the whole thing. Really, that IS the code snippet that reproduces the issue. If you index into other fields like 'file' or whatever, it works. As soon as one of the fields you're looking into is 'audio', you get that issue. It's a weird issue and I suspect it's Sagemaker/environment related, maybe the mix of libraries and dependencies are not good. Example code snippet with issue. ```python from datasets import load_dataset timit_train = load_dataset('timit_asr', split='train') print(timit_train[0]) ```
[ -1.2647321224212646, -0.8886952996253967, -0.6472134590148926, 1.4138190746307373, -0.07949122786521912, -1.313057541847229, 0.08145900070667267, -0.9339150190353394, 1.62185537815094, -0.8823034763336182, 0.3373264968395233, -1.6882554292678833, 0.1112191453576088, -0.5964295268058777, -0.7424575686454773, -0.6608542799949646, -0.28661951422691345, -0.6930971145629883, 1.066750168800354, 2.3873655796051025, 1.104068398475647, -1.3673522472381592, 2.8862762451171875, 0.6344596743583679, -0.2634269595146179, -0.8835254907608032, 0.430915892124176, -0.008650314062833786, -1.4499998092651367, -0.29580962657928467, -0.9948140978813171, 0.01772676780819893, -0.6852909922599792, -0.5250044465065002, 0.09243851900100708, 0.4820097088813782, -0.17605216801166534, -0.4556626081466675, -0.3425646424293518, -0.6999073028564453, 0.5697444081306458, -0.3427639305591583, 0.8425794839859009, -0.29066216945648193, 1.7806233167648315, -0.617828905582428, 0.48883867263793945, 0.5502216815948486, 1.2975702285766602, 0.26030558347702026, -0.052047789096832275, 0.45088744163513184, 0.29831641912460327, 0.00022198539227247238, 0.5844095349311829, 1.243964433670044, 0.5593083500862122, 0.537670373916626, 0.7217525839805603, -2.192877769470215, 1.4112117290496826, -0.7967541217803955, 0.22156235575675964, 1.3436230421066284, -1.0806994438171387, 0.5380545258522034, -1.855231523513794, -0.10793545097112656, 0.37404125928878784, -2.2898142337799072, 0.11942146718502045, -1.2682288885116577, -0.5469743013381958, 1.0252596139907837, 0.34787923097610474, -1.2692620754241943, 0.027377668768167496, -0.4351905584335327, 0.9599073529243469, 0.3614089787006378, 1.1643871068954468, -1.592422366142273, 0.03508449345827103, -0.23595088720321655, 0.32555684447288513, -1.2290141582489014, -1.6068328619003296, 0.6133379936218262, 0.6746487617492676, 0.5640817284584045, -0.10742682963609695, 0.91684889793396, -1.1042418479919434, 0.8542332649230957, -0.9177533984184265, -1.7671326398849487, -1.2719234228134155, -2.4090654850006104, -2.3407909870147705, 0.7933451533317566, -0.45911645889282227, -0.4124586880207062, 2.1550590991973877, -1.208667278289795, -1.7838619947433472, 1.1574592590332031, 0.3198811411857605, -0.08131995052099228, 2.3951900005340576, 0.18934616446495056, -0.8973209261894226, 0.7207262516021729, -0.8458586931228638, 0.7286521792411804, -0.4803287386894226, 1.2479604482650757, 0.3671933710575104, -1.015560507774353, 1.5963460206985474, -0.4124966859817505, 0.5562397241592407, -0.7471591830253601, -0.3723842203617096, -0.5842087864875793, 0.26331716775894165, 2.036870002746582, -0.19128939509391785, 1.5230743885040283, -0.23623055219650269, -1.4762037992477417, -1.425304651260376, 0.8059109449386597, 0.5343431234359741, -0.8476883172988892, 0.2457181215286255, -0.32823890447616577, 0.17346245050430298, 0.19047009944915771, 1.0578097105026245, 1.3527946472167969, 0.77501380443573, -0.16077445447444916, -0.9399117827415466, 0.1133580133318901, -0.10824312269687653, -0.5035039782524109, -1.7879399061203003, -0.30250680446624756, 0.16534075140953064, 0.6718754768371582, -1.2054401636123657, 1.8903511762619019, 0.9230970144271851, 1.9683984518051147, 1.0298054218292236, -0.34042415022850037, 1.546472191810608, 0.13734354078769684, 1.8428096771240234, -0.2621397078037262, 0.7082369327545166, -0.5710582137107849, -1.1437418460845947, 0.6277948021888733, -0.3900489807128906, -1.9157748222351074, -0.3984016180038452, -0.9321011900901794, -0.10699612647294998, -0.8556980490684509, 1.0087544918060303, -0.2261783331632614, -1.404504418373108, 0.2812795639038086, -0.6818772554397583, 0.20266738533973694, -1.341726303100586, 0.3103398382663727, 0.6999056339263916, -0.6869061589241028, 0.1120670810341835, -0.45195335149765015, -1.4052289724349976, -0.5632108449935913, 0.4859057664871216, 1.730226993560791, -0.7512651681900024, 1.0174225568771362, 1.010542631149292, -0.5821380019187927, -0.11427363753318787, 0.5402370691299438, -0.4261339604854584, 0.86309415102005, -0.9917380213737488, -0.40184420347213745, 1.076917052268982, -0.3323761224746704, -0.45655301213264465, 1.3004342317581177, 0.701240062713623, -0.9821875691413879, -0.3372199237346649, -0.12310580909252167, -0.8150513768196106, 0.012688740156590939, -1.6169661283493042, -0.12518414855003357, 0.2682993412017822, -1.5451503992080688, -0.4307065010070801, -0.07623512297868729, 1.1922376155853271, -0.0075788237154483795, 1.4133540391921997, -0.3431776463985443, -0.06371741741895676, -0.4662834405899048, -0.6108959317207336, 0.17420488595962524, -0.13878922164440155, -0.6674498915672302, 0.26173415780067444, -0.7192078828811646, 0.1984800547361374, 1.4228821992874146, 0.2906680703163147, 0.07243331521749496, 0.5051981210708618, 1.2118244171142578, 0.3286275565624237, -0.1456228643655777, -0.8287588953971863, -1.7022135257720947, 2.0031208992004395, -1.6733508110046387, 2.0073392391204834, 0.8459134697914124, -0.01918763853609562, -1.8204385042190552, -1.8336604833602905, 1.498030424118042, 1.092775821685791, 2.4495558738708496, 0.5716277956962585, 0.42198556661605835, -0.8020254969596863, -0.6463773846626282, 0.49933141469955444, -0.7890920639038086, -0.9360100030899048, 0.054226383566856384, 2.301063299179077, 1.7435951232910156, -0.3470931053161621, -0.19170114398002625, -0.9244458079338074, 1.4030929803848267, -0.29219505190849304, 0.29121917486190796, 1.87637460231781, -0.38671058416366577, -1.0550607442855835, 1.2750191688537598, -2.388509750366211, 0.270696759223938, 1.9856114387512207, 0.2830713391304016, 0.026326168328523636, -1.179630994796753, -0.7105243802070618, -0.08075692504644394, -0.40668243169784546, -1.2353515625, 0.3755550980567932, -0.2932848036289215, -0.7431211471557617, -1.3837693929672241, 0.03639766573905945, -1.2448667287826538, -1.6336042881011963, 0.29621651768684387, 1.8689273595809937, 2.220651388168335, -0.7955330014228821, 1.3517292737960815, -0.2667416036128998, 0.3146252930164337, 1.1744256019592285, 1.2195961475372314, 3.16141676902771, 1.832007646560669, -1.2611445188522339, 0.6330965161323547, -0.16129405796527863, -0.4753722548484802, 1.2236148118972778, -0.9354265928268433, 1.1967312097549438, -0.19885747134685516, -1.3386547565460205, -1.1571124792099, 0.8999983668327332, 0.4561367332935333, -0.07328131794929504, -0.39969417452812195, 1.127292513847351, 0.13443347811698914, 1.314030647277832, 0.6024960279464722, -0.29188063740730286, 0.5643169283866882, -0.30178317427635193, -0.548731803894043, 1.5519053936004639, 0.048815738409757614, -1.468189001083374, -2.2817628383636475, -0.14793509244918823, -0.9089892506599426, -0.0110882967710495, -0.8356008529663086, -1.0131700038909912, 1.422215223312378, 0.4678874909877777, -0.9107133746147156, -0.11990313231945038, -0.40288883447647095, -0.6455588340759277, 2.5625760555267334, -1.3616477251052856, -0.31797951459884644, -0.8893600702285767, -0.6105954647064209, 1.4957765340805054, -1.1910455226898193, -0.2251572608947754, -1.0077928304672241, -0.4748441278934479, -1.279314398765564, -0.46862736344337463, -0.08430745452642441, -0.8656675815582275, 0.7209872007369995, 0.051590561866760254, -1.2437496185302734, -0.24484437704086304, -1.0579357147216797, 0.780958890914917, -0.21884089708328247, 0.09073246270418167, 1.761557698249817, 0.24002963304519653, -0.41510269045829773, 0.831174910068512, 1.2271623611450195, 0.5774657726287842, -0.5386257767677307, 0.1925964206457138, -0.6443235874176025, 0.532919704914093, -1.2276090383529663, 0.3682151138782501, -2.9434561729431152, 0.6867900490760803, 0.08090896159410477, -0.07386063784360886, -0.16141115128993988, -1.4574272632598877, 0.9233518838882446, 2.4774537086486816, -1.096061110496521, 0.6501322388648987, 0.2804704010486603, 1.3023056983947754, -1.673887014389038, 0.1084415391087532, -0.6252288818359375, 2.0829193592071533, 0.06950956583023071, 1.097617268562317, -0.5459311008453369, -2.461400032043457, 0.5466499924659729, -1.155001163482666, -1.0244115591049194, 0.7306584119796753, -0.8556129932403564, 0.13635903596878052, -1.1892906427383423, -0.17157265543937683, -0.898783266544342, -1.0946916341781616, 0.5372651815414429, 0.10056457668542862, 0.6310678720474243, -0.6158241033554077, 0.2521827816963196, -2.3320562839508057, -1.3876270055770874, -0.14586083590984344, -0.8711285591125488, 0.5193703174591064, -0.39486902952194214, 0.7115902304649353, -0.13006798923015594, 0.06682056188583374, 0.2158719003200531, 1.4774227142333984, 3.1699180603027344, 0.07033617049455643, 0.38884836435317993, -0.3530209958553314, -1.0434612035751343, 1.5245360136032104, 0.9149453639984131, -0.3703669309616089, -0.6477615237236023, -0.9873577356338501, 1.437880277633667, 1.9241418838500977, 0.9705777764320374, 0.11816757917404175, -0.9060859084129333, -0.8051576614379883, 0.07670163363218307, 0.07160908728837967, 0.48273807764053345, 1.0330841541290283, 0.1763220727443695, 0.23015014827251434, 1.3667551279067993, 1.0764259099960327, -0.38651174306869507, 0.48720797896385193, -0.8357126712799072, -0.39313986897468567, 0.4930878281593323, 0.4263056516647339, -0.04697956517338753, 0.2019655704498291, -0.9594129920005798, -0.1577759087085724, -0.2897327244281769, -0.8608633279800415, -0.7424020171165466, -0.3262472450733185, -0.3830033838748932, 1.8158917427062988, 0.00555398128926754, -0.5569713115692139, -0.055938202887773514, -0.8007502555847168, -0.07351339608430862, -0.9803864359855652, 0.22600635886192322, -0.14232107996940613, 0.006578222848474979, -0.11575605720281601, 1.7297186851501465, -0.9712722897529602, -2.215148448944092, 0.1416754126548767, 0.20035594701766968, -0.2919950485229492, -0.1394241601228714, 1.7775546312332153, 0.5704072713851929, 1.40542733669281, 1.6491973400115967, 1.0456115007400513, -0.6483228802680969, -1.3268258571624756, 0.7288176417350769, 0.9084739089012146, -1.3455432653427124, 0.8899564743041992, -0.094652459025383, -0.6087819337844849, 0.5502459406852722, 1.3118312358856201, 0.43585261702537537, -2.035053253173828, 0.9326478242874146, -1.1370009183883667, 0.8729574680328369, 0.8241004347801208, 0.8535171747207642, 0.18721990287303925, 0.8623724579811096, -1.2135682106018066, -1.071210265159607, -0.6597578525543213, -0.7105010747909546, 1.896180272102356, -0.30377843976020813, 0.30234771966934204, -0.25788646936416626, -1.26785147190094, 0.08687137812376022, 0.6612517237663269, 0.30325034260749817, -0.24737544357776642, 0.7140762209892273, -0.7798006534576416, -1.1687511205673218, -1.4431020021438599, -0.4580658972263336, -0.9797496199607849, -0.850592315196991, 0.9670803546905518, 0.7813855409622192, 0.4415401518344879, 1.9771689176559448, 0.6685789227485657, 0.15145157277584076, -2.6041131019592285, 0.8656266927719116, 0.375116765499115, -0.13283798098564148, 0.7814111709594727, 0.2694978415966034, 1.2121447324752808, -0.10263323038816452, 0.5610167384147644, -2.347175359725952, 2.2526166439056396, -0.26843616366386414, 0.8462886810302734, 0.008772778324782848, 0.04191943630576134, 1.0281174182891846, 0.5580107569694519, 0.6534639596939087, -1.0992501974105835, 0.8961001038551331, -0.6766380667686462, 1.2092723846435547, 0.8903021216392517, -0.8979292511940002, 0.12269288301467896, 1.230589747428894, 0.2921594977378845, -0.6369526386260986, -1.03335440158844, -0.8934895992279053, 0.8969411849975586, 1.8559767007827759, 0.008609897457063198, 0.07356799393892288, 0.7522598505020142, 0.7675720453262329, -1.3030329942703247, 0.031109917908906937, -0.5321963429450989, -0.7414300441741943, 1.7917922735214233, 2.0405685901641846, -0.04065334424376488, -0.045035261660814285, -0.6717929244041443, -1.5301352739334106, 0.8222823739051819, 0.1872088760137558, 0.011959788389503956, 0.7795640826225281, -0.6852076053619385, 1.2256665229797363, 0.8415351510047913, 0.8628460168838501, 0.2213374227285385, 0.01207349169999361, 0.2536495625972748, -0.27055174112319946, -1.1400724649429321, -0.31793174147605896, -0.9579440355300903, -2.5603556632995605, 0.38591715693473816, -0.208093523979187, -1.509416103363037, 0.20671899616718292, -0.8742547631263733, 0.7415274381637573, -0.5423686504364014, -1.216458797454834, -1.3912153244018555, 0.23188002407550812, -0.17860165238380432, 0.6994929313659668, -1.6322487592697144, -0.14239895343780518, 1.1057456731796265, 1.0461422204971313, -0.6168261766433716, 0.9928783178329468, 0.31200194358825684, 0.8702443242073059, 0.9552839994430542, -0.4391222298145294, 0.419481098651886, 0.2164507806301117, -1.34426748752594, 0.34372085332870483, 1.3762187957763672, 0.14363475143909454, 1.3303323984146118, -0.45768842101097107, -0.006860416382551193, 0.41958877444267273, -0.27131959795951843, -0.4912984073162079, -0.7047750353813171, 0.6530009508132935, -0.15171392261981964, -0.9097104072570801, -0.07937570661306381, 0.026546433568000793, -0.22290761768817902, 0.305386483669281, -1.5418061017990112, -0.11227767169475555, -0.4233458638191223, -0.6806974411010742, -1.3431780338287354, -0.027187347412109375, 1.3890399932861328, -0.8578990697860718, -0.16708898544311523, 0.5571561455726624, 0.3030802309513092, 0.48368310928344727, 0.6412657499313354, -0.7735017538070679, -0.23197637498378754, -0.07414260506629944, -0.39495694637298584, 0.3079383373260498, 1.2965441942214966, -0.1367318481206894, -0.9844367504119873, 0.465684175491333, -0.2457021027803421, 0.10885582864284515, 1.8586392402648926, 0.05357041209936142, -0.8718341588973999, 0.33686310052871704, -0.8226186633110046, 1.9052668809890747, 1.636285662651062, 1.3069164752960205, -0.05924295634031296, -0.9486669898033142, 0.6002145409584045, -0.2870314121246338, -0.3181701600551605, 0.8772949576377869, 0.39327141642570496, -0.2890656888484955, -1.3823118209838867, 0.7030133605003357, 1.1526927947998047, -0.7485164999961853, -0.7645214200019836, -0.029144294559955597, -0.8539190888404846, 1.267492651939392, 0.6569898724555969, 0.3409351408481598, 0.23905016481876373, 1.7584869861602783, 0.7594270706176758, -0.629708468914032, 0.5489968657493591, 0.4301753342151642, -0.21248459815979004, -2.0392560958862305, -1.1084119081497192, 0.24039235711097717, -0.41107338666915894, -1.540494441986084, 1.4221419095993042, -1.189676284790039, -0.9322291612625122, 0.5571454763412476, 0.13516809046268463, 1.309037685394287, 0.29206061363220215, 1.6734321117401123, 1.991439938545227, 0.9407336115837097, 0.46114441752433777, 1.1116204261779785, -0.33472922444343567, -0.2147126942873001, 1.679069995880127, -0.49232128262519836, 0.5889590382575989, 1.0404903888702393, -0.44799333810806274, -1.196510672569275, -0.8118433952331543, -1.1573785543441772, -0.7869958281517029, 0.9937018156051636, 0.166849285364151, -1.1223114728927612, 0.33028706908226013, 1.5995606184005737, 0.02732335776090622, -0.13080966472625732, 0.7094204425811768, 0.4618220329284668, -0.6558139324188232, -0.09946980327367783, -1.0208405256271362, 0.5858111381530762, -0.32304829359054565, -0.40687432885169983, 0.2427901029586792, 0.5333766341209412, 1.222797155380249, 0.15228009223937988, 0.055875882506370544, 1.4778019189834595, -1.4099018573760986, 1.2291467189788818, -0.9910569190979004, 0.37040185928344727, -2.274461269378662, 1.483457326889038, -0.9370652437210083, 1.9922839403152466, -2.6730546951293945, 0.45992013812065125, -0.600883424282074, -0.5868232250213623, 0.2207479476928711, -0.18314668536186218, 0.0948587954044342, -0.051737792789936066, -1.0736457109451294, -0.13207930326461792, -0.83406662940979, 0.4150427281856537, 1.2150945663452148, 1.283305048942566, -0.9471378922462463, -0.2234511375427246, -1.5990324020385742, -0.15682902932167053, -0.5353323817253113, 0.213409423828125, -1.8440935611724854, -0.21471130847930908, -2.104276657104492, -2.4333081245422363, -1.378914713859558, -0.9629499316215515, 1.3010166883468628, 0.11742658913135529, -0.880017876625061, 1.1680632829666138, -0.38787296414375305, -1.7702780961990356, 1.247343897819519, -2.1451001167297363 ]
https://github.com/huggingface/datasets/issues/3618
TIMIT Dataset not working with GPU
Ok I see ! From the error you got, it looks like the `value` encoded in the arrow file of the TIMIT dataset you loaded is a string instead of a dictionary with keys "path" and "bytes" but we don't support this since 1.18 Can you try regenerating the dataset with `load_dataset('timit_asr', download_mode="force_redownload")` please ? I think it should fix the issue.
## Describe the bug I am working trying to use the TIMIT dataset in order to fine-tune Wav2Vec2 model and I am unable to load the "audio" column from the dataset when working with a GPU. I am working on Amazon Sagemaker Studio, on the Python 3 (PyTorch 1.8 Python 3.6 GPU Optimized) environment, with a single ml.g4dn.xlarge instance (corresponds to a Tesla T4 GPU). I don't know if the issue is GPU related or Python environment related because everything works when I work off of the CPU Optimized environment with a non-GPU instance. My code also works on Google Colab with a GPU instance. This issue is blocking because I cannot get the 'audio' column in any way due to this error, which means that I can't pass it to any functions. I later use the dataset.map function and that is where I originally noticed this error. ## Steps to reproduce the bug ```python from datasets import load_dataset timit_train = load_dataset('timit_asr', split='train') print(timit_train['audio']) ``` ## Expected results Expected to see inside the 'audio' column, which contains an 'array' nested field with the array data I actually need. ## Actual results Traceback ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-ceeac555e921> in <module> ----> 1 timit_train['audio'] /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in __getitem__(self, key) 1917 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" 1918 return self._getitem( -> 1919 key, 1920 ) 1921 /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in _getitem(self, key, decoded, **kwargs) 1902 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) 1903 formatted_output = format_table( -> 1904 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns 1905 ) 1906 return formatted_output /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_table(table, key, formatter, format_columns, output_all_columns) 529 python_formatter = PythonFormatter(features=None) 530 if format_columns is None: --> 531 return formatter(pa_table, query_type=query_type) 532 elif query_type == "column": 533 if key in format_columns: /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in __call__(self, pa_table, query_type) 280 return self.format_row(pa_table) 281 elif query_type == "column": --> 282 return self.format_column(pa_table) 283 elif query_type == "batch": 284 return self.format_batch(pa_table) /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_column(self, pa_table) 315 column = self.python_arrow_extractor().extract_column(pa_table) 316 if self.decoded: --> 317 column = self.python_features_decoder.decode_column(column, pa_table.column_names[0]) 318 return column 319 /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in decode_column(self, column, column_name) 221 222 def decode_column(self, column: list, column_name: str) -> list: --> 223 return self.features.decode_column(column, column_name) if self.features else column 224 225 def decode_batch(self, batch: dict) -> dict: /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in decode_column(self, column, column_name) 1337 return ( 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] -> 1339 if self._column_requires_decoding[column_name] 1340 else column 1341 ) /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in <listcomp>(.0) 1336 """ 1337 return ( -> 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] 1339 if self._column_requires_decoding[column_name] 1340 else column /opt/conda/lib/python3.6/site-packages/datasets/features/audio.py in decode_example(self, value) 85 dict 86 """ ---> 87 path, file = (value["path"], BytesIO(value["bytes"])) if value["bytes"] is not None else (value["path"], None) 88 if path is None and file is None: 89 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.") TypeError: string indices must be integers ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-4.14.256-197.484.amzn2.x86_64-x86_64-with-debian-buster-sid - Python version: 3.6.13 - PyArrow version: 6.0.1
989
62
TIMIT Dataset not working with GPU ## Describe the bug I am working trying to use the TIMIT dataset in order to fine-tune Wav2Vec2 model and I am unable to load the "audio" column from the dataset when working with a GPU. I am working on Amazon Sagemaker Studio, on the Python 3 (PyTorch 1.8 Python 3.6 GPU Optimized) environment, with a single ml.g4dn.xlarge instance (corresponds to a Tesla T4 GPU). I don't know if the issue is GPU related or Python environment related because everything works when I work off of the CPU Optimized environment with a non-GPU instance. My code also works on Google Colab with a GPU instance. This issue is blocking because I cannot get the 'audio' column in any way due to this error, which means that I can't pass it to any functions. I later use the dataset.map function and that is where I originally noticed this error. ## Steps to reproduce the bug ```python from datasets import load_dataset timit_train = load_dataset('timit_asr', split='train') print(timit_train['audio']) ``` ## Expected results Expected to see inside the 'audio' column, which contains an 'array' nested field with the array data I actually need. ## Actual results Traceback ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-ceeac555e921> in <module> ----> 1 timit_train['audio'] /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in __getitem__(self, key) 1917 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" 1918 return self._getitem( -> 1919 key, 1920 ) 1921 /opt/conda/lib/python3.6/site-packages/datasets/arrow_dataset.py in _getitem(self, key, decoded, **kwargs) 1902 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) 1903 formatted_output = format_table( -> 1904 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns 1905 ) 1906 return formatted_output /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_table(table, key, formatter, format_columns, output_all_columns) 529 python_formatter = PythonFormatter(features=None) 530 if format_columns is None: --> 531 return formatter(pa_table, query_type=query_type) 532 elif query_type == "column": 533 if key in format_columns: /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in __call__(self, pa_table, query_type) 280 return self.format_row(pa_table) 281 elif query_type == "column": --> 282 return self.format_column(pa_table) 283 elif query_type == "batch": 284 return self.format_batch(pa_table) /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in format_column(self, pa_table) 315 column = self.python_arrow_extractor().extract_column(pa_table) 316 if self.decoded: --> 317 column = self.python_features_decoder.decode_column(column, pa_table.column_names[0]) 318 return column 319 /opt/conda/lib/python3.6/site-packages/datasets/formatting/formatting.py in decode_column(self, column, column_name) 221 222 def decode_column(self, column: list, column_name: str) -> list: --> 223 return self.features.decode_column(column, column_name) if self.features else column 224 225 def decode_batch(self, batch: dict) -> dict: /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in decode_column(self, column, column_name) 1337 return ( 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] -> 1339 if self._column_requires_decoding[column_name] 1340 else column 1341 ) /opt/conda/lib/python3.6/site-packages/datasets/features/features.py in <listcomp>(.0) 1336 """ 1337 return ( -> 1338 [self[column_name].decode_example(value) if value is not None else None for value in column] 1339 if self._column_requires_decoding[column_name] 1340 else column /opt/conda/lib/python3.6/site-packages/datasets/features/audio.py in decode_example(self, value) 85 dict 86 """ ---> 87 path, file = (value["path"], BytesIO(value["bytes"])) if value["bytes"] is not None else (value["path"], None) 88 if path is None and file is None: 89 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.") TypeError: string indices must be integers ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-4.14.256-197.484.amzn2.x86_64-x86_64-with-debian-buster-sid - Python version: 3.6.13 - PyArrow version: 6.0.1 Ok I see ! From the error you got, it looks like the `value` encoded in the arrow file of the TIMIT dataset you loaded is a string instead of a dictionary with keys "path" and "bytes" but we don't support this since 1.18 Can you try regenerating the dataset with `load_dataset('timit_asr', download_mode="force_redownload")` please ? I think it should fix the issue.
[ -1.2647321224212646, -0.8886952996253967, -0.6472134590148926, 1.4138190746307373, -0.07949122786521912, -1.313057541847229, 0.08145900070667267, -0.9339150190353394, 1.62185537815094, -0.8823034763336182, 0.3373264968395233, -1.6882554292678833, 0.1112191453576088, -0.5964295268058777, -0.7424575686454773, -0.6608542799949646, -0.28661951422691345, -0.6930971145629883, 1.066750168800354, 2.3873655796051025, 1.104068398475647, -1.3673522472381592, 2.8862762451171875, 0.6344596743583679, -0.2634269595146179, -0.8835254907608032, 0.430915892124176, -0.008650314062833786, -1.4499998092651367, -0.29580962657928467, -0.9948140978813171, 0.01772676780819893, -0.6852909922599792, -0.5250044465065002, 0.09243851900100708, 0.4820097088813782, -0.17605216801166534, -0.4556626081466675, -0.3425646424293518, -0.6999073028564453, 0.5697444081306458, -0.3427639305591583, 0.8425794839859009, -0.29066216945648193, 1.7806233167648315, -0.617828905582428, 0.48883867263793945, 0.5502216815948486, 1.2975702285766602, 0.26030558347702026, -0.052047789096832275, 0.45088744163513184, 0.29831641912460327, 0.00022198539227247238, 0.5844095349311829, 1.243964433670044, 0.5593083500862122, 0.537670373916626, 0.7217525839805603, -2.192877769470215, 1.4112117290496826, -0.7967541217803955, 0.22156235575675964, 1.3436230421066284, -1.0806994438171387, 0.5380545258522034, -1.855231523513794, -0.10793545097112656, 0.37404125928878784, -2.2898142337799072, 0.11942146718502045, -1.2682288885116577, -0.5469743013381958, 1.0252596139907837, 0.34787923097610474, -1.2692620754241943, 0.027377668768167496, -0.4351905584335327, 0.9599073529243469, 0.3614089787006378, 1.1643871068954468, -1.592422366142273, 0.03508449345827103, -0.23595088720321655, 0.32555684447288513, -1.2290141582489014, -1.6068328619003296, 0.6133379936218262, 0.6746487617492676, 0.5640817284584045, -0.10742682963609695, 0.91684889793396, -1.1042418479919434, 0.8542332649230957, -0.9177533984184265, -1.7671326398849487, -1.2719234228134155, -2.4090654850006104, -2.3407909870147705, 0.7933451533317566, -0.45911645889282227, -0.4124586880207062, 2.1550590991973877, -1.208667278289795, -1.7838619947433472, 1.1574592590332031, 0.3198811411857605, -0.08131995052099228, 2.3951900005340576, 0.18934616446495056, -0.8973209261894226, 0.7207262516021729, -0.8458586931228638, 0.7286521792411804, -0.4803287386894226, 1.2479604482650757, 0.3671933710575104, -1.015560507774353, 1.5963460206985474, -0.4124966859817505, 0.5562397241592407, -0.7471591830253601, -0.3723842203617096, -0.5842087864875793, 0.26331716775894165, 2.036870002746582, -0.19128939509391785, 1.5230743885040283, -0.23623055219650269, -1.4762037992477417, -1.425304651260376, 0.8059109449386597, 0.5343431234359741, -0.8476883172988892, 0.2457181215286255, -0.32823890447616577, 0.17346245050430298, 0.19047009944915771, 1.0578097105026245, 1.3527946472167969, 0.77501380443573, -0.16077445447444916, -0.9399117827415466, 0.1133580133318901, -0.10824312269687653, -0.5035039782524109, -1.7879399061203003, -0.30250680446624756, 0.16534075140953064, 0.6718754768371582, -1.2054401636123657, 1.8903511762619019, 0.9230970144271851, 1.9683984518051147, 1.0298054218292236, -0.34042415022850037, 1.546472191810608, 0.13734354078769684, 1.8428096771240234, -0.2621397078037262, 0.7082369327545166, -0.5710582137107849, -1.1437418460845947, 0.6277948021888733, -0.3900489807128906, -1.9157748222351074, -0.3984016180038452, -0.9321011900901794, -0.10699612647294998, -0.8556980490684509, 1.0087544918060303, -0.2261783331632614, -1.404504418373108, 0.2812795639038086, -0.6818772554397583, 0.20266738533973694, -1.341726303100586, 0.3103398382663727, 0.6999056339263916, -0.6869061589241028, 0.1120670810341835, -0.45195335149765015, -1.4052289724349976, -0.5632108449935913, 0.4859057664871216, 1.730226993560791, -0.7512651681900024, 1.0174225568771362, 1.010542631149292, -0.5821380019187927, -0.11427363753318787, 0.5402370691299438, -0.4261339604854584, 0.86309415102005, -0.9917380213737488, -0.40184420347213745, 1.076917052268982, -0.3323761224746704, -0.45655301213264465, 1.3004342317581177, 0.701240062713623, -0.9821875691413879, -0.3372199237346649, -0.12310580909252167, -0.8150513768196106, 0.012688740156590939, -1.6169661283493042, -0.12518414855003357, 0.2682993412017822, -1.5451503992080688, -0.4307065010070801, -0.07623512297868729, 1.1922376155853271, -0.0075788237154483795, 1.4133540391921997, -0.3431776463985443, -0.06371741741895676, -0.4662834405899048, -0.6108959317207336, 0.17420488595962524, -0.13878922164440155, -0.6674498915672302, 0.26173415780067444, -0.7192078828811646, 0.1984800547361374, 1.4228821992874146, 0.2906680703163147, 0.07243331521749496, 0.5051981210708618, 1.2118244171142578, 0.3286275565624237, -0.1456228643655777, -0.8287588953971863, -1.7022135257720947, 2.0031208992004395, -1.6733508110046387, 2.0073392391204834, 0.8459134697914124, -0.01918763853609562, -1.8204385042190552, -1.8336604833602905, 1.498030424118042, 1.092775821685791, 2.4495558738708496, 0.5716277956962585, 0.42198556661605835, -0.8020254969596863, -0.6463773846626282, 0.49933141469955444, -0.7890920639038086, -0.9360100030899048, 0.054226383566856384, 2.301063299179077, 1.7435951232910156, -0.3470931053161621, -0.19170114398002625, -0.9244458079338074, 1.4030929803848267, -0.29219505190849304, 0.29121917486190796, 1.87637460231781, -0.38671058416366577, -1.0550607442855835, 1.2750191688537598, -2.388509750366211, 0.270696759223938, 1.9856114387512207, 0.2830713391304016, 0.026326168328523636, -1.179630994796753, -0.7105243802070618, -0.08075692504644394, -0.40668243169784546, -1.2353515625, 0.3755550980567932, -0.2932848036289215, -0.7431211471557617, -1.3837693929672241, 0.03639766573905945, -1.2448667287826538, -1.6336042881011963, 0.29621651768684387, 1.8689273595809937, 2.220651388168335, -0.7955330014228821, 1.3517292737960815, -0.2667416036128998, 0.3146252930164337, 1.1744256019592285, 1.2195961475372314, 3.16141676902771, 1.832007646560669, -1.2611445188522339, 0.6330965161323547, -0.16129405796527863, -0.4753722548484802, 1.2236148118972778, -0.9354265928268433, 1.1967312097549438, -0.19885747134685516, -1.3386547565460205, -1.1571124792099, 0.8999983668327332, 0.4561367332935333, -0.07328131794929504, -0.39969417452812195, 1.127292513847351, 0.13443347811698914, 1.314030647277832, 0.6024960279464722, -0.29188063740730286, 0.5643169283866882, -0.30178317427635193, -0.548731803894043, 1.5519053936004639, 0.048815738409757614, -1.468189001083374, -2.2817628383636475, -0.14793509244918823, -0.9089892506599426, -0.0110882967710495, -0.8356008529663086, -1.0131700038909912, 1.422215223312378, 0.4678874909877777, -0.9107133746147156, -0.11990313231945038, -0.40288883447647095, -0.6455588340759277, 2.5625760555267334, -1.3616477251052856, -0.31797951459884644, -0.8893600702285767, -0.6105954647064209, 1.4957765340805054, -1.1910455226898193, -0.2251572608947754, -1.0077928304672241, -0.4748441278934479, -1.279314398765564, -0.46862736344337463, -0.08430745452642441, -0.8656675815582275, 0.7209872007369995, 0.051590561866760254, -1.2437496185302734, -0.24484437704086304, -1.0579357147216797, 0.780958890914917, -0.21884089708328247, 0.09073246270418167, 1.761557698249817, 0.24002963304519653, -0.41510269045829773, 0.831174910068512, 1.2271623611450195, 0.5774657726287842, -0.5386257767677307, 0.1925964206457138, -0.6443235874176025, 0.532919704914093, -1.2276090383529663, 0.3682151138782501, -2.9434561729431152, 0.6867900490760803, 0.08090896159410477, -0.07386063784360886, -0.16141115128993988, -1.4574272632598877, 0.9233518838882446, 2.4774537086486816, -1.096061110496521, 0.6501322388648987, 0.2804704010486603, 1.3023056983947754, -1.673887014389038, 0.1084415391087532, -0.6252288818359375, 2.0829193592071533, 0.06950956583023071, 1.097617268562317, -0.5459311008453369, -2.461400032043457, 0.5466499924659729, -1.155001163482666, -1.0244115591049194, 0.7306584119796753, -0.8556129932403564, 0.13635903596878052, -1.1892906427383423, -0.17157265543937683, -0.898783266544342, -1.0946916341781616, 0.5372651815414429, 0.10056457668542862, 0.6310678720474243, -0.6158241033554077, 0.2521827816963196, -2.3320562839508057, -1.3876270055770874, -0.14586083590984344, -0.8711285591125488, 0.5193703174591064, -0.39486902952194214, 0.7115902304649353, -0.13006798923015594, 0.06682056188583374, 0.2158719003200531, 1.4774227142333984, 3.1699180603027344, 0.07033617049455643, 0.38884836435317993, -0.3530209958553314, -1.0434612035751343, 1.5245360136032104, 0.9149453639984131, -0.3703669309616089, -0.6477615237236023, -0.9873577356338501, 1.437880277633667, 1.9241418838500977, 0.9705777764320374, 0.11816757917404175, -0.9060859084129333, -0.8051576614379883, 0.07670163363218307, 0.07160908728837967, 0.48273807764053345, 1.0330841541290283, 0.1763220727443695, 0.23015014827251434, 1.3667551279067993, 1.0764259099960327, -0.38651174306869507, 0.48720797896385193, -0.8357126712799072, -0.39313986897468567, 0.4930878281593323, 0.4263056516647339, -0.04697956517338753, 0.2019655704498291, -0.9594129920005798, -0.1577759087085724, -0.2897327244281769, -0.8608633279800415, -0.7424020171165466, -0.3262472450733185, -0.3830033838748932, 1.8158917427062988, 0.00555398128926754, -0.5569713115692139, -0.055938202887773514, -0.8007502555847168, -0.07351339608430862, -0.9803864359855652, 0.22600635886192322, -0.14232107996940613, 0.006578222848474979, -0.11575605720281601, 1.7297186851501465, -0.9712722897529602, -2.215148448944092, 0.1416754126548767, 0.20035594701766968, -0.2919950485229492, -0.1394241601228714, 1.7775546312332153, 0.5704072713851929, 1.40542733669281, 1.6491973400115967, 1.0456115007400513, -0.6483228802680969, -1.3268258571624756, 0.7288176417350769, 0.9084739089012146, -1.3455432653427124, 0.8899564743041992, -0.094652459025383, -0.6087819337844849, 0.5502459406852722, 1.3118312358856201, 0.43585261702537537, -2.035053253173828, 0.9326478242874146, -1.1370009183883667, 0.8729574680328369, 0.8241004347801208, 0.8535171747207642, 0.18721990287303925, 0.8623724579811096, -1.2135682106018066, -1.071210265159607, -0.6597578525543213, -0.7105010747909546, 1.896180272102356, -0.30377843976020813, 0.30234771966934204, -0.25788646936416626, -1.26785147190094, 0.08687137812376022, 0.6612517237663269, 0.30325034260749817, -0.24737544357776642, 0.7140762209892273, -0.7798006534576416, -1.1687511205673218, -1.4431020021438599, -0.4580658972263336, -0.9797496199607849, -0.850592315196991, 0.9670803546905518, 0.7813855409622192, 0.4415401518344879, 1.9771689176559448, 0.6685789227485657, 0.15145157277584076, -2.6041131019592285, 0.8656266927719116, 0.375116765499115, -0.13283798098564148, 0.7814111709594727, 0.2694978415966034, 1.2121447324752808, -0.10263323038816452, 0.5610167384147644, -2.347175359725952, 2.2526166439056396, -0.26843616366386414, 0.8462886810302734, 0.008772778324782848, 0.04191943630576134, 1.0281174182891846, 0.5580107569694519, 0.6534639596939087, -1.0992501974105835, 0.8961001038551331, -0.6766380667686462, 1.2092723846435547, 0.8903021216392517, -0.8979292511940002, 0.12269288301467896, 1.230589747428894, 0.2921594977378845, -0.6369526386260986, -1.03335440158844, -0.8934895992279053, 0.8969411849975586, 1.8559767007827759, 0.008609897457063198, 0.07356799393892288, 0.7522598505020142, 0.7675720453262329, -1.3030329942703247, 0.031109917908906937, -0.5321963429450989, -0.7414300441741943, 1.7917922735214233, 2.0405685901641846, -0.04065334424376488, -0.045035261660814285, -0.6717929244041443, -1.5301352739334106, 0.8222823739051819, 0.1872088760137558, 0.011959788389503956, 0.7795640826225281, -0.6852076053619385, 1.2256665229797363, 0.8415351510047913, 0.8628460168838501, 0.2213374227285385, 0.01207349169999361, 0.2536495625972748, -0.27055174112319946, -1.1400724649429321, -0.31793174147605896, -0.9579440355300903, -2.5603556632995605, 0.38591715693473816, -0.208093523979187, -1.509416103363037, 0.20671899616718292, -0.8742547631263733, 0.7415274381637573, -0.5423686504364014, -1.216458797454834, -1.3912153244018555, 0.23188002407550812, -0.17860165238380432, 0.6994929313659668, -1.6322487592697144, -0.14239895343780518, 1.1057456731796265, 1.0461422204971313, -0.6168261766433716, 0.9928783178329468, 0.31200194358825684, 0.8702443242073059, 0.9552839994430542, -0.4391222298145294, 0.419481098651886, 0.2164507806301117, -1.34426748752594, 0.34372085332870483, 1.3762187957763672, 0.14363475143909454, 1.3303323984146118, -0.45768842101097107, -0.006860416382551193, 0.41958877444267273, -0.27131959795951843, -0.4912984073162079, -0.7047750353813171, 0.6530009508132935, -0.15171392261981964, -0.9097104072570801, -0.07937570661306381, 0.026546433568000793, -0.22290761768817902, 0.305386483669281, -1.5418061017990112, -0.11227767169475555, -0.4233458638191223, -0.6806974411010742, -1.3431780338287354, -0.027187347412109375, 1.3890399932861328, -0.8578990697860718, -0.16708898544311523, 0.5571561455726624, 0.3030802309513092, 0.48368310928344727, 0.6412657499313354, -0.7735017538070679, -0.23197637498378754, -0.07414260506629944, -0.39495694637298584, 0.3079383373260498, 1.2965441942214966, -0.1367318481206894, -0.9844367504119873, 0.465684175491333, -0.2457021027803421, 0.10885582864284515, 1.8586392402648926, 0.05357041209936142, -0.8718341588973999, 0.33686310052871704, -0.8226186633110046, 1.9052668809890747, 1.636285662651062, 1.3069164752960205, -0.05924295634031296, -0.9486669898033142, 0.6002145409584045, -0.2870314121246338, -0.3181701600551605, 0.8772949576377869, 0.39327141642570496, -0.2890656888484955, -1.3823118209838867, 0.7030133605003357, 1.1526927947998047, -0.7485164999961853, -0.7645214200019836, -0.029144294559955597, -0.8539190888404846, 1.267492651939392, 0.6569898724555969, 0.3409351408481598, 0.23905016481876373, 1.7584869861602783, 0.7594270706176758, -0.629708468914032, 0.5489968657493591, 0.4301753342151642, -0.21248459815979004, -2.0392560958862305, -1.1084119081497192, 0.24039235711097717, -0.41107338666915894, -1.540494441986084, 1.4221419095993042, -1.189676284790039, -0.9322291612625122, 0.5571454763412476, 0.13516809046268463, 1.309037685394287, 0.29206061363220215, 1.6734321117401123, 1.991439938545227, 0.9407336115837097, 0.46114441752433777, 1.1116204261779785, -0.33472922444343567, -0.2147126942873001, 1.679069995880127, -0.49232128262519836, 0.5889590382575989, 1.0404903888702393, -0.44799333810806274, -1.196510672569275, -0.8118433952331543, -1.1573785543441772, -0.7869958281517029, 0.9937018156051636, 0.166849285364151, -1.1223114728927612, 0.33028706908226013, 1.5995606184005737, 0.02732335776090622, -0.13080966472625732, 0.7094204425811768, 0.4618220329284668, -0.6558139324188232, -0.09946980327367783, -1.0208405256271362, 0.5858111381530762, -0.32304829359054565, -0.40687432885169983, 0.2427901029586792, 0.5333766341209412, 1.222797155380249, 0.15228009223937988, 0.055875882506370544, 1.4778019189834595, -1.4099018573760986, 1.2291467189788818, -0.9910569190979004, 0.37040185928344727, -2.274461269378662, 1.483457326889038, -0.9370652437210083, 1.9922839403152466, -2.6730546951293945, 0.45992013812065125, -0.600883424282074, -0.5868232250213623, 0.2207479476928711, -0.18314668536186218, 0.0948587954044342, -0.051737792789936066, -1.0736457109451294, -0.13207930326461792, -0.83406662940979, 0.4150427281856537, 1.2150945663452148, 1.283305048942566, -0.9471378922462463, -0.2234511375427246, -1.5990324020385742, -0.15682902932167053, -0.5353323817253113, 0.213409423828125, -1.8440935611724854, -0.21471130847930908, -2.104276657104492, -2.4333081245422363, -1.378914713859558, -0.9629499316215515, 1.3010166883468628, 0.11742658913135529, -0.880017876625061, 1.1680632829666138, -0.38787296414375305, -1.7702780961990356, 1.247343897819519, -2.1451001167297363 ]
https://github.com/huggingface/datasets/issues/3615
Dataset BnL Historical Newspapers does not work in streaming mode
@albertvillanova let me know if there is anything I can do to help with this. I had a quick look at the code again and though I could try the following changes: - use `download` instead of `download_and_extract` https://github.com/huggingface/datasets/blob/d3d339fb86d378f4cb3c5d1de423315c07a466c6/datasets/bnl_newspapers/bnl_newspapers.py#L136 - swith to using `iter_archive` to loop through downloaded data to replace https://github.com/huggingface/datasets/blob/d3d339fb86d378f4cb3c5d1de423315c07a466c6/datasets/bnl_newspapers/bnl_newspapers.py#L159 Let me know if it's useful for me to try and make those changes.
## Describe the bug When trying to load in streaming mode, it "hangs"... ## Steps to reproduce the bug ```python ds = load_dataset("bnl_newspapers", split="train", streaming=True) ``` ## Expected results The code should be optimized, so that it works fast in streaming mode. CC: @davanstrien
990
66
Dataset BnL Historical Newspapers does not work in streaming mode ## Describe the bug When trying to load in streaming mode, it "hangs"... ## Steps to reproduce the bug ```python ds = load_dataset("bnl_newspapers", split="train", streaming=True) ``` ## Expected results The code should be optimized, so that it works fast in streaming mode. CC: @davanstrien @albertvillanova let me know if there is anything I can do to help with this. I had a quick look at the code again and though I could try the following changes: - use `download` instead of `download_and_extract` https://github.com/huggingface/datasets/blob/d3d339fb86d378f4cb3c5d1de423315c07a466c6/datasets/bnl_newspapers/bnl_newspapers.py#L136 - swith to using `iter_archive` to loop through downloaded data to replace https://github.com/huggingface/datasets/blob/d3d339fb86d378f4cb3c5d1de423315c07a466c6/datasets/bnl_newspapers/bnl_newspapers.py#L159 Let me know if it's useful for me to try and make those changes.
[ -1.175127625465393, -0.8599932193756104, -0.7388767004013062, 1.450530767440796, -0.09926477074623108, -1.1728525161743164, 0.15486624836921692, -1.0794483423233032, 1.6466689109802246, -0.7629331350326538, 0.32579848170280457, -1.6230645179748535, -0.04421348124742508, -0.5620777010917664, -0.716372549533844, -0.8874863982200623, -0.41003361344337463, -0.7428853511810303, 1.0098519325256348, 2.5648937225341797, 1.1752817630767822, -1.3586664199829102, 2.6973190307617188, 0.6495633125305176, -0.2635759115219116, -1.0308886766433716, 0.4781379997730255, 0.06506793946027756, -1.2302988767623901, -0.5192527174949646, -0.8860936164855957, -0.01960710436105728, -0.593968391418457, -0.5467303395271301, -0.044632505625486374, 0.45868295431137085, -0.2886698544025421, -0.35038143396377563, -0.511177659034729, -0.8037136793136597, 0.47955650091171265, -0.41532057523727417, 0.8649393320083618, -0.36063987016677856, 1.8643648624420166, -0.5777409672737122, 0.44156768918037415, 0.6693429946899414, 1.3502644300460815, 0.15998151898384094, -0.07146680355072021, 0.22827544808387756, 0.3587699830532074, -0.004165514372289181, 0.5237986445426941, 1.1656078100204468, 0.6281704902648926, 0.47074460983276367, 0.5422730445861816, -2.174663782119751, 1.2634507417678833, -0.8898626565933228, 0.23747560381889343, 1.4235317707061768, -0.9143983721733093, 0.3351202607154846, -1.842885971069336, -0.12529410421848297, 0.532075822353363, -2.264120578765869, 0.22975066304206848, -1.3427650928497314, -0.5120871067047119, 1.0749634504318237, 0.30816394090652466, -1.3496673107147217, 0.14858704805374146, -0.37172436714172363, 1.119997501373291, 0.4940737187862396, 1.133061170578003, -1.6587342023849487, -0.10143996775150299, -0.319945365190506, 0.03874136880040169, -1.3515076637268066, -1.5337117910385132, 0.4180346727371216, 0.5602754354476929, 0.6686440706253052, -0.01766452006995678, 0.8991546630859375, -1.0392370223999023, 0.7677404284477234, -0.9463990926742554, -1.6399964094161987, -1.383164644241333, -2.2709498405456543, -2.2905988693237305, 0.8586092591285706, -0.48002728819847107, -0.5642481446266174, 1.921492576599121, -1.0328689813613892, -1.8000351190567017, 1.1443663835525513, 0.2921919524669647, -0.010809207335114479, 2.399393320083618, 0.2608957886695862, -0.7618953585624695, 0.5145180821418762, -0.6951322555541992, 0.7745997309684753, -0.402279257774353, 1.442836880683899, 0.5093117356300354, -1.058693528175354, 1.5651836395263672, -0.5267936587333679, 0.5708611607551575, -0.7189838886260986, -0.5750942230224609, -0.7514523267745972, 0.36621037125587463, 1.9119220972061157, -0.34097975492477417, 1.6551811695098877, -0.3385958671569824, -1.578948736190796, -1.5954140424728394, 0.9542387127876282, 0.4237827956676483, -0.7858201861381531, 0.16239333152770996, -0.36495673656463623, 0.11154456436634064, -0.08863817900419235, 1.0818318128585815, 1.2439099550247192, 0.641318678855896, -0.30133262276649475, -0.8878452181816101, 0.266175240278244, -0.022688785567879677, -0.6176761388778687, -1.7992428541183472, -0.3184264004230499, 0.22316113114356995, 0.5883678197860718, -1.2162580490112305, 1.7446027994155884, 0.9061066508293152, 1.9551091194152832, 1.0319397449493408, -0.297688364982605, 1.4360582828521729, 0.04914459213614464, 1.897997498512268, -0.36414700746536255, 0.7044428586959839, -0.26659539341926575, -1.173202633857727, 0.8500912189483643, -0.39718499779701233, -2.0152952671051025, -0.8044480085372925, -0.8728076219558716, -0.1794760525226593, -0.779585599899292, 0.8943127989768982, -0.30453217029571533, -1.4863778352737427, 0.23361468315124512, -0.6920361518859863, 0.22174349427223206, -1.2638161182403564, 0.353162556886673, 0.7784319519996643, -0.6289430260658264, 0.005592811852693558, -0.19881701469421387, -1.227292776107788, -0.4609484076499939, 0.3830863833427429, 1.9569523334503174, -0.6946521401405334, 0.8775315284729004, 1.0707800388336182, -0.6927304863929749, 0.05747039243578911, 0.38550999760627747, -0.38499993085861206, 0.7576558589935303, -1.084252119064331, -0.304237425327301, 1.2331037521362305, -0.23246128857135773, -0.6807323694229126, 1.4563043117523193, 0.8631098866462708, -0.9677227735519409, -0.11852820962667465, -0.270054429769516, -0.7426910400390625, 0.018383413553237915, -1.589820384979248, -0.05004425346851349, 0.3708127737045288, -1.4168672561645508, -0.4345441162586212, -0.2459876835346222, 1.2994415760040283, -0.25532791018486023, 1.3920985460281372, -0.33929693698883057, -0.07419804483652115, -0.4336760640144348, -0.44499126076698303, 0.13221527636051178, -0.19466182589530945, -0.6313986778259277, 0.22483931481838226, -0.7295457124710083, 0.31849154829978943, 1.3745880126953125, 0.4462917447090149, 0.04240519180893898, 0.4900696277618408, 1.1383962631225586, 0.28540489077568054, -0.12057965993881226, -0.8530410528182983, -1.562469244003296, 2.0674495697021484, -1.393837809562683, 1.9620646238327026, 0.7841611504554749, -0.11433807015419006, -1.7177990674972534, -1.8305904865264893, 1.3533985614776611, 1.1629490852355957, 2.421562910079956, 0.5704501271247864, 0.4408651888370514, -0.810407280921936, -0.6876500248908997, 0.25661876797676086, -1.0297964811325073, -0.7910693287849426, 0.13803966343402863, 2.373426675796509, 1.7594279050827026, -0.46815624833106995, -0.19689428806304932, -1.0282706022262573, 1.2508481740951538, -0.21173015236854553, 0.17426621913909912, 2.0255074501037598, -0.2225092053413391, -1.044405460357666, 1.2125511169433594, -2.3294527530670166, 0.18405447900295258, 2.0365207195281982, 0.271957129240036, 0.048707615584135056, -1.4300789833068848, -0.5962888598442078, -0.2877577841281891, -0.3656182289123535, -1.158011794090271, 0.5556638836860657, -0.27638939023017883, -0.8276678919792175, -1.474634051322937, 0.17022722959518433, -1.0840191841125488, -1.6590065956115723, 0.34063655138015747, 1.854590892791748, 1.9960005283355713, -0.7540755867958069, 1.51815664768219, -0.2202889770269394, 0.1531037986278534, 1.3075218200683594, 1.254996657371521, 3.1530866622924805, 1.8944618701934814, -1.281912088394165, 0.7165265679359436, -0.1995643973350525, -0.5760577321052551, 1.1842163801193237, -1.201202154159546, 1.267600655555725, -0.1949922889471054, -1.181917667388916, -1.2838976383209229, 0.9567638635635376, 0.5335643887519836, 0.1458296924829483, -0.5517662167549133, 1.2253239154815674, 0.12035079300403595, 1.3949178457260132, 0.46864280104637146, -0.3076832592487335, 0.6357802152633667, -0.4289310574531555, -0.527876615524292, 1.5494747161865234, 0.18000830709934235, -1.4528673887252808, -2.323920726776123, -0.2391473650932312, -0.9045473337173462, -0.08468585461378098, -0.6560460925102234, -1.052636981010437, 1.5949277877807617, 0.42062637209892273, -1.2532333135604858, -0.2795509397983551, -0.3288750648498535, -0.6475876569747925, 2.6886889934539795, -1.4235647916793823, -0.10849069803953171, -1.0007790327072144, -0.588312029838562, 1.6734857559204102, -1.1726099252700806, -0.13574770092964172, -1.066148281097412, -0.6440239548683167, -1.2835191488265991, -0.5163626074790955, -0.02355290949344635, -0.9448439478874207, 0.7194844484329224, 0.23441991209983826, -1.1403844356536865, -0.3486458659172058, -0.8925874829292297, 0.9229996800422668, -0.08101401478052139, 0.22011595964431763, 1.806726336479187, 0.3858672082424164, -0.4328860640525818, 0.746599555015564, 1.2311580181121826, 0.5617976784706116, -0.6917137503623962, 0.1936732977628708, -0.7157204747200012, 0.2812788784503937, -1.4028552770614624, 0.24101375043392181, -2.812873363494873, 0.7015554308891296, -0.11481546610593796, -0.1341218203306198, -0.05048930272459984, -1.3604100942611694, 1.1537314653396606, 2.6565136909484863, -1.189307451248169, 0.4592984616756439, 0.3958432674407959, 1.2211285829544067, -1.6209886074066162, 0.39105159044265747, -0.487382709980011, 2.1149253845214844, 0.19953608512878418, 1.1955000162124634, -0.5128879547119141, -2.3039512634277344, 0.639001190662384, -1.2258574962615967, -1.1818323135375977, 0.9107137322425842, -0.8560488820075989, 0.06875598430633545, -1.3547838926315308, -0.21098944544792175, -0.9384171962738037, -1.2289197444915771, 0.6966692209243774, 0.10833979398012161, 0.4514560103416443, -0.6274024844169617, 0.368618905544281, -2.235258102416992, -1.3435344696044922, -0.26363900303840637, -0.882330060005188, 0.44477513432502747, -0.28083646297454834, 0.6215012669563293, -0.10353630781173706, 0.0008122110739350319, 0.40016400814056396, 1.48948335647583, 3.3429062366485596, 0.23876725137233734, 0.36880621314048767, -0.13640165328979492, -0.9195862412452698, 1.4245637655258179, 0.8560548424720764, -0.14578506350517273, -0.5701931118965149, -0.9180904626846313, 1.1163699626922607, 1.9490954875946045, 1.1093418598175049, 0.023162562400102615, -0.7982274889945984, -0.7300809621810913, -0.06865756213665009, 0.12448816001415253, 0.39914989471435547, 0.8598215579986572, 0.06394833326339722, 0.11790411174297333, 1.3253509998321533, 1.249646544456482, -0.4587843716144562, 0.42746075987815857, -0.8344535231590271, -0.3515392243862152, 0.45689091086387634, 0.2282755970954895, 0.008025147952139378, 0.3867059648036957, -1.0054664611816406, -0.25928160548210144, -0.27593928575515747, -0.9386091828346252, -0.8590193390846252, -0.4733486473560333, -0.3042546808719635, 1.6431787014007568, 0.044450793415308, -0.5047386884689331, 0.02879391610622406, -0.8844911456108093, -0.1406453549861908, -1.0990527868270874, 0.19591809809207916, -0.12906596064567566, -0.09526854008436203, 0.01386272069066763, 1.7447179555892944, -1.0506006479263306, -2.126483917236328, 0.2222527116537094, 0.21715866029262543, -0.3861836791038513, 0.16648590564727783, 1.6658838987350464, 0.4834563136100769, 1.4025543928146362, 1.2463154792785645, 0.9809110760688782, -0.6471701264381409, -1.2403961420059204, 0.7244440317153931, 1.0093096494674683, -1.4033838510513306, 0.8472551107406616, -0.02283325046300888, -0.4474680721759796, 0.6640061140060425, 1.2559632062911987, 0.42604923248291016, -1.9202046394348145, 0.7481882572174072, -0.8865639567375183, 0.6956695914268494, 0.6803639531135559, 0.6753165125846863, 0.24454911053180695, 0.8389980792999268, -1.2406896352767944, -1.1658341884613037, -0.7784808874130249, -0.6131358742713928, 1.9325684309005737, -0.18614599108695984, 0.5788530707359314, -0.09002061933279037, -1.2383841276168823, -0.027090568095445633, 0.7919607758522034, 0.3472979962825775, -0.39159145951271057, 0.8345098495483398, -0.6294543743133545, -1.0625375509262085, -1.3890458345413208, -0.47685226798057556, -0.9220153093338013, -0.9423855543136597, 1.0341920852661133, 0.8171215653419495, 0.3338446021080017, 1.9191193580627441, 0.6901967525482178, 0.3562749922275543, -2.6489996910095215, 0.9049930572509766, 0.3303181529045105, 0.001086047850549221, 0.9250468611717224, 0.31962841749191284, 1.109326958656311, 0.03453133627772331, 0.5212516784667969, -2.366248607635498, 2.2302920818328857, -0.22816768288612366, 0.5838512778282166, -0.042896781116724014, -0.19924288988113403, 1.0703731775283813, 0.5647199749946594, 0.4702821671962738, -1.1586276292800903, 0.7769204378128052, -0.628389298915863, 1.2179266214370728, 0.9490135908126831, -0.927895724773407, 0.14390502870082855, 1.415122628211975, 0.42934563755989075, -0.4396475553512573, -1.0212796926498413, -0.8499590158462524, 0.9799696803092957, 1.687286615371704, -0.08257006108760834, -0.05235973745584488, 0.8212296366691589, 0.6522007584571838, -1.3225187063217163, 0.08831767737865448, -0.738947868347168, -0.8009734749794006, 1.7950303554534912, 2.090989828109741, -0.006379918195307255, -0.2530694305896759, -0.8128818869590759, -1.18092679977417, 0.7560887932777405, -0.015967631712555885, 0.18525895476341248, 0.5953407883644104, -0.7227194905281067, 1.0797404050827026, 0.8637099862098694, 1.0108386278152466, 0.06895116716623306, 0.25727441906929016, 0.4408888518810272, -0.32444867491722107, -1.1220157146453857, -0.22528187930583954, -1.2015916109085083, -2.643474578857422, 0.40094929933547974, -0.26120099425315857, -1.4293562173843384, 0.046105001121759415, -1.064979910850525, 0.9231821298599243, -0.6265033483505249, -1.1509945392608643, -1.5142545700073242, 0.1992441564798355, -0.0693843886256218, 0.874849259853363, -1.6064716577529907, -0.13348811864852905, 1.2392905950546265, 0.9137776494026184, -0.6204155683517456, 1.0125129222869873, 0.23137588798999786, 1.0782945156097412, 0.8791277408599854, -0.4337436556816101, 0.6439625024795532, 0.041499268263578415, -1.4258102178573608, 0.4711671769618988, 1.2270421981811523, 0.223709374666214, 1.4383330345153809, -0.5558279156684875, 0.1098800003528595, 0.40817901492118835, -0.5640737414360046, -0.5275365114212036, -0.5625319480895996, 0.6989474296569824, 0.12828554213047028, -0.9859233498573303, 0.08758629858493805, -0.2142760157585144, -0.18553435802459717, 0.20612569153308868, -1.467890977859497, -0.2545221149921417, -0.37378814816474915, -0.5934967994689941, -1.2331491708755493, -0.009820056147873402, 1.340908169746399, -0.8155007362365723, -0.22629402577877045, 0.4102421998977661, 0.34588029980659485, 0.4865521788597107, 0.6146019101142883, -0.739647626876831, -0.32781875133514404, -0.2494933307170868, -0.3325127363204956, 0.3661397695541382, 1.2738165855407715, -0.07185792922973633, -0.9660334587097168, 0.6980632543563843, -0.4311489462852478, 0.1768089383840561, 1.9981448650360107, 0.12657056748867035, -0.7800136804580688, 0.30747827887535095, -0.6872598528862, 1.9247878789901733, 1.6294245719909668, 1.325582504272461, -0.09323352575302124, -0.9477390050888062, 0.6486929655075073, -0.30238237977027893, -0.3808913826942444, 0.9905049800872803, 0.4381638169288635, -0.17341923713684082, -1.450866460800171, 0.5416605472564697, 1.251133680343628, -0.8289706707000732, -0.7308118939399719, 0.017634693533182144, -0.8547552824020386, 1.0832738876342773, 0.6856561899185181, 0.3580247163772583, 0.26187044382095337, 1.6113556623458862, 0.751890242099762, -0.4779706597328186, 0.527438759803772, 0.436519980430603, -0.14370638132095337, -2.1709060668945312, -0.9816111922264099, 0.3591797947883606, -0.4300357401371002, -1.5032378435134888, 1.3944792747497559, -1.1301308870315552, -0.9023357033729553, 0.513989269733429, 0.16976337134838104, 1.4888932704925537, 0.3180464506149292, 1.6419492959976196, 2.104149341583252, 0.9443816542625427, 0.24683396518230438, 1.2289787530899048, -0.1492931842803955, -0.4780060052871704, 1.8038196563720703, -0.4440312385559082, 0.42675408720970154, 1.039757251739502, -0.4024844467639923, -1.0541681051254272, -0.9172399044036865, -1.1935756206512451, -0.6077023148536682, 1.1756315231323242, 0.15021517872810364, -1.1005115509033203, 0.1911976933479309, 1.6304073333740234, 0.0887281522154808, -0.295173317193985, 0.6520161032676697, 0.42812544107437134, -0.85527104139328, -0.05468042567372322, -0.8444867730140686, 0.5861518383026123, -0.09047446399927139, -0.2795044481754303, 0.24002009630203247, 0.49594053626060486, 1.2450509071350098, -0.04698215052485466, 0.14957672357559204, 1.2042239904403687, -1.356259822845459, 1.4306761026382446, -0.698805570602417, 0.2956162095069885, -2.365091323852539, 1.3752250671386719, -0.7961764931678772, 1.8232767581939697, -2.5505948066711426, 0.39067700505256653, -0.6062337756156921, -0.43308767676353455, 0.3114159405231476, -0.5054322481155396, 0.1231791228055954, -0.12076673656702042, -1.0691781044006348, -0.11757117509841919, -0.7408015727996826, 0.5839150547981262, 1.1551175117492676, 1.3185123205184937, -1.1296958923339844, -0.265568345785141, -1.7500381469726562, -0.20157621800899506, -0.6941606402397156, 0.2924799919128418, -1.9433988332748413, -0.12220435589551926, -2.0302412509918213, -2.3818345069885254, -1.348479151725769, -0.7787405848503113, 1.0404764413833618, 0.12507858872413635, -0.8364356160163879, 1.1529691219329834, -0.38265371322631836, -1.7956156730651855, 1.1264039278030396, -2.181062698364258 ]
https://github.com/huggingface/datasets/issues/3615
Dataset BnL Historical Newspapers does not work in streaming mode
Thanks @davanstrien. I have already been working on it so that it can be used in the BigScience workshop. I agree that the `rglob()` is not efficient in this case. I tried different solutions without success: - `iter_archive` cannot be used in this case because it does not support ZIP files yet Finally I have used `iter_files()`.
## Describe the bug When trying to load in streaming mode, it "hangs"... ## Steps to reproduce the bug ```python ds = load_dataset("bnl_newspapers", split="train", streaming=True) ``` ## Expected results The code should be optimized, so that it works fast in streaming mode. CC: @davanstrien
990
57
Dataset BnL Historical Newspapers does not work in streaming mode ## Describe the bug When trying to load in streaming mode, it "hangs"... ## Steps to reproduce the bug ```python ds = load_dataset("bnl_newspapers", split="train", streaming=True) ``` ## Expected results The code should be optimized, so that it works fast in streaming mode. CC: @davanstrien Thanks @davanstrien. I have already been working on it so that it can be used in the BigScience workshop. I agree that the `rglob()` is not efficient in this case. I tried different solutions without success: - `iter_archive` cannot be used in this case because it does not support ZIP files yet Finally I have used `iter_files()`.
[ -1.1636712551116943, -0.9138602018356323, -0.7710234522819519, 1.6028363704681396, -0.2325965166091919, -1.1600419282913208, 0.2417747974395752, -1.0462325811386108, 1.6799349784851074, -0.8322854042053223, 0.3940921127796173, -1.6648645401000977, 0.02589048631489277, -0.524436354637146, -0.6964596509933472, -0.8081830143928528, -0.5226089358329773, -0.7336243391036987, 1.0553861856460571, 2.485285758972168, 1.2094697952270508, -1.288153886795044, 2.6718249320983887, 0.6066732406616211, -0.16471967101097107, -1.0772037506103516, 0.5350415706634521, 0.02426481433212757, -1.2994252443313599, -0.5200672149658203, -1.0534918308258057, -0.13596563041210175, -0.5340670347213745, -0.5152057409286499, -0.02692672237753868, 0.43570083379745483, -0.32077640295028687, -0.39913704991340637, -0.47344285249710083, -0.7995638251304626, 0.5076815485954285, -0.471596896648407, 0.9341608285903931, -0.4417547583580017, 1.918573260307312, -0.570518434047699, 0.474582701921463, 0.7319092154502869, 1.3727787733078003, 0.22260728478431702, -0.20245634019374847, 0.323535680770874, 0.39121732115745544, -0.017289338633418083, 0.5749074816703796, 1.1320728063583374, 0.5527362823486328, 0.5199538469314575, 0.6260430216789246, -2.1340389251708984, 1.2539085149765015, -0.9947794079780579, 0.2599946856498718, 1.3322396278381348, -1.0658650398254395, 0.2758834958076477, -1.7183985710144043, -0.12428562343120575, 0.5379223823547363, -2.2353246212005615, 0.23621685802936554, -1.27889883518219, -0.49877989292144775, 1.1519616842269897, 0.3463202714920044, -1.3710145950317383, -0.012976685538887978, -0.27838948369026184, 0.8892776370048523, 0.4109271168708801, 1.0495331287384033, -1.6346355676651, 0.03538212180137634, -0.41982826590538025, 0.07526931911706924, -1.2594929933547974, -1.3632644414901733, 0.5065760612487793, 0.603139340877533, 0.6570761203765869, -0.1174984946846962, 0.9527281522750854, -1.0510023832321167, 0.7302834987640381, -0.914570689201355, -1.7423173189163208, -1.358778953552246, -2.303070068359375, -2.252922773361206, 0.79784095287323, -0.43285131454467773, -0.5962636470794678, 2.0635311603546143, -0.9832179546356201, -1.7226858139038086, 1.2219181060791016, 0.17249199748039246, 0.0006575938314199448, 2.374969244003296, 0.25068357586860657, -0.7225489616394043, 0.5254542827606201, -0.7569164633750916, 0.7407315969467163, -0.4797102212905884, 1.4792048931121826, 0.42016321420669556, -1.0148557424545288, 1.664344310760498, -0.35526275634765625, 0.5621736645698547, -0.641450047492981, -0.5884314179420471, -0.7433866262435913, 0.2903125584125519, 2.0190072059631348, -0.3261035084724426, 1.559574007987976, -0.2236335277557373, -1.641941785812378, -1.5985674858093262, 1.0066787004470825, 0.43424752354621887, -0.6393846869468689, 0.22685150802135468, -0.28204551339149475, 0.1577363908290863, -0.0803510993719101, 1.2033888101577759, 1.2424041032791138, 0.7550629377365112, -0.1736225187778473, -0.9002184271812439, 0.26238369941711426, -0.017435723915696144, -0.6411890387535095, -1.6772515773773193, -0.3807644248008728, 0.09367134422063828, 0.5372778177261353, -1.1187716722488403, 1.859308123588562, 0.999207079410553, 1.8626916408538818, 1.0080519914627075, -0.13514035940170288, 1.4933866262435913, 0.07056646049022675, 1.96000075340271, -0.2846863567829132, 0.6168352365493774, -0.4257257282733917, -1.2258782386779785, 0.7965480089187622, -0.3950081169605255, -1.9095470905303955, -0.758374035358429, -0.9454787373542786, -0.15907682478427887, -0.7728434205055237, 1.0710581541061401, -0.2452409565448761, -1.3291094303131104, 0.2447984516620636, -0.7785806655883789, 0.08228233456611633, -1.2375434637069702, 0.4860811233520508, 0.6638150811195374, -0.7001171708106995, 0.1517314910888672, -0.24111346900463104, -1.2787264585494995, -0.4372292160987854, 0.19614967703819275, 1.9016525745391846, -0.8632159233093262, 0.9124667644500732, 1.019041895866394, -0.8273773789405823, -0.11056560277938843, 0.42436060309410095, -0.3772902488708496, 0.8424709439277649, -1.0679993629455566, -0.28378480672836304, 1.2668697834014893, -0.23294776678085327, -0.6495878100395203, 1.4328471422195435, 0.7152286171913147, -0.9522457718849182, -0.11177901178598404, -0.20725305378437042, -0.7540349960327148, 0.1294761300086975, -1.6119110584259033, -0.08213892579078674, 0.4599427580833435, -1.4638242721557617, -0.4927304983139038, -0.1644100844860077, 1.1992948055267334, -0.081630177795887, 1.359969973564148, -0.23943129181861877, -0.2057248055934906, -0.44070369005203247, -0.45289745926856995, 0.09254976361989975, -0.12375436723232269, -0.5974825024604797, 0.2515549659729004, -0.6248201727867126, 0.3738410174846649, 1.4547991752624512, 0.2164754569530487, -0.004033402539789677, 0.6465533375740051, 1.0533549785614014, 0.40714722871780396, -0.11413548141717911, -0.934651255607605, -1.4919756650924683, 1.9795910120010376, -1.4281179904937744, 1.9200453758239746, 0.757683277130127, -0.14349614083766937, -1.7076575756072998, -1.9273016452789307, 1.4208070039749146, 1.3030604124069214, 2.3468222618103027, 0.6707373857498169, 0.46966275572776794, -0.863843560218811, -0.6606320142745972, 0.30906906723976135, -1.1277505159378052, -0.8082161545753479, 0.15801455080509186, 2.336305856704712, 1.743895411491394, -0.46910950541496277, -0.18596072494983673, -1.0448471307754517, 1.335958480834961, -0.15569144487380981, 0.16250291466712952, 1.8571975231170654, -0.21749870479106903, -1.0971872806549072, 1.0362820625305176, -2.3061513900756836, 0.08436746895313263, 2.044617176055908, 0.29602864384651184, 0.09948304295539856, -1.5030797719955444, -0.6066892743110657, -0.16318896412849426, -0.3624694347381592, -1.1781269311904907, 0.6282150745391846, -0.27353760600090027, -0.6881025433540344, -1.4205595254898071, 0.30473625659942627, -0.97994464635849, -1.6554349660873413, 0.11593612283468246, 1.8426538705825806, 2.0588691234588623, -0.8286285996437073, 1.508988857269287, -0.1763392686843872, 0.31634601950645447, 1.2968858480453491, 1.2016831636428833, 3.026008367538452, 2.153411626815796, -1.1433219909667969, 0.6929044723510742, -0.1430547684431076, -0.47667425870895386, 1.2772468328475952, -1.1821551322937012, 1.356949806213379, -0.15570420026779175, -1.1712143421173096, -1.2529830932617188, 0.8001899719238281, 0.4758184254169464, 0.01935317926108837, -0.4315274953842163, 1.1864982843399048, 0.15100686252117157, 1.302229881286621, 0.47631675004959106, -0.22230949997901917, 0.7364310026168823, -0.4213361442089081, -0.3521104156970978, 1.597575068473816, 0.23979224264621735, -1.4297302961349487, -2.2107887268066406, -0.13882169127464294, -0.9942439794540405, 0.025219248607754707, -0.5936900973320007, -0.9288864731788635, 1.5623700618743896, 0.3807227611541748, -1.2481424808502197, -0.18072248995304108, -0.2935125231742859, -0.7269570827484131, 2.7755727767944336, -1.3540624380111694, -0.3051758408546448, -1.0324705839157104, -0.6893857717514038, 1.8352688550949097, -1.2287650108337402, -0.21762600541114807, -1.0211386680603027, -0.43308892846107483, -1.247959017753601, -0.6177446842193604, -0.054054103791713715, -0.9018368124961853, 0.7252545356750488, 0.2813514173030853, -1.245023488998413, -0.39923572540283203, -0.847866952419281, 0.7450357675552368, -0.056741923093795776, 0.16857604682445526, 1.8508141040802002, 0.36270400881767273, -0.39667797088623047, 0.7319429516792297, 1.1694854497909546, 0.5676687359809875, -0.5314430594444275, 0.43487849831581116, -0.7382674813270569, 0.2624226212501526, -1.3375484943389893, 0.23339523375034332, -2.813528299331665, 0.5748901963233948, -0.1409924030303955, -0.14145584404468536, -0.014587150886654854, -1.3586262464523315, 1.0357269048690796, 2.498734474182129, -1.1602858304977417, 0.4190182387828827, 0.3016754686832428, 1.246346116065979, -1.5803357362747192, 0.32627713680267334, -0.5252279043197632, 2.20670223236084, 0.2705586850643158, 1.1047859191894531, -0.45485877990722656, -2.3960464000701904, 0.6882851123809814, -1.3306113481521606, -1.255268931388855, 0.7273964881896973, -0.884032666683197, -0.08627215027809143, -1.2958369255065918, -0.258766233921051, -0.7243641018867493, -1.1664941310882568, 0.7762213349342346, 0.09864022582769394, 0.5332831144332886, -0.590599775314331, 0.3280605673789978, -2.214754104614258, -1.3204606771469116, -0.24821318686008453, -0.9508198499679565, 0.38069620728492737, -0.32961371541023254, 0.7241740822792053, -0.3417244851589203, 0.007999895140528679, 0.34976428747177124, 1.4602872133255005, 3.4323506355285645, 0.18939702212810516, 0.40619543194770813, -0.22098520398139954, -0.8709653615951538, 1.5017815828323364, 0.9761167168617249, -0.21859465539455414, -0.581257164478302, -1.078268051147461, 1.0550459623336792, 1.8915737867355347, 0.9370393753051758, 0.11216016113758087, -0.8009058237075806, -0.6433438658714294, -0.15022024512290955, 0.04086045175790787, 0.41231614351272583, 0.8557547330856323, 0.14510147273540497, 0.027012215927243233, 1.356253743171692, 1.0852946043014526, -0.45258477330207825, 0.29035767912864685, -0.7766396999359131, -0.4155671298503876, 0.5619040727615356, 0.3502090871334076, -0.06456311047077179, 0.21560582518577576, -0.9631490111351013, -0.2357480674982071, -0.3022252917289734, -0.93414306640625, -0.7845796346664429, -0.37718096375465393, -0.18380357325077057, 1.7287530899047852, -0.013005158863961697, -0.6061501502990723, -0.00730727706104517, -0.8644533753395081, -0.04240555316209793, -1.169156551361084, 0.17071673274040222, -0.1373158097267151, -0.19751101732254028, -0.0004291580989956856, 1.8740251064300537, -1.021818995475769, -2.214104175567627, 0.32597616314888, 0.13358786702156067, -0.27764660120010376, 0.23404517769813538, 1.517603874206543, 0.48054176568984985, 1.4812043905258179, 1.4008868932724, 1.109168529510498, -0.7396975755691528, -1.3832753896713257, 0.7309257984161377, 0.9538925290107727, -1.514618158340454, 0.6439101099967957, 0.1566167175769806, -0.3973684310913086, 0.5091400146484375, 1.1281975507736206, 0.5403741002082825, -1.9481898546218872, 0.7050554156303406, -0.9045723676681519, 0.7502725720405579, 0.7700236439704895, 0.7347217202186584, 0.29473021626472473, 0.7826381921768188, -1.0346076488494873, -1.238242745399475, -0.7106918096542358, -0.7670387029647827, 1.915844440460205, -0.24818643927574158, 0.5941935777664185, -0.09965480864048004, -1.391509771347046, 0.0028236275538802147, 0.7315137982368469, 0.25322219729423523, -0.38641393184661865, 0.739409863948822, -0.763695478439331, -1.078642725944519, -1.5112196207046509, -0.43808305263519287, -1.092719316482544, -1.0235964059829712, 1.086934208869934, 0.7760080099105835, 0.27497848868370056, 1.8860379457473755, 0.8362299799919128, 0.35126590728759766, -2.623568058013916, 0.9213194251060486, 0.3704833388328552, 0.009677188470959663, 0.8091225624084473, 0.47455474734306335, 1.044763207435608, -0.13357582688331604, 0.5037297010421753, -2.406885862350464, 2.2830796241760254, -0.2376246303319931, 0.5555279850959778, 0.05055985599756241, -0.21071799099445343, 1.0002292394638062, 0.5530821084976196, 0.5055282115936279, -1.046442985534668, 0.576826810836792, -0.6451597213745117, 1.3223376274108887, 0.905450165271759, -0.8381416201591492, 0.11176701635122299, 1.3266596794128418, 0.5414877533912659, -0.5344861745834351, -0.9812458753585815, -0.9868735074996948, 0.9737981557846069, 1.647463321685791, -0.1153787225484848, -0.059988342225551605, 0.82020503282547, 0.6091128587722778, -1.3050051927566528, -0.07100538909435272, -0.8489043116569519, -0.7849752306938171, 1.6986955404281616, 2.097996234893799, -0.07722561061382294, -0.20894211530685425, -0.8146412372589111, -1.242971420288086, 0.7178656458854675, 0.05900482088327408, 0.024823730811476707, 0.5810848474502563, -0.6084690093994141, 1.053475260734558, 1.0188045501708984, 0.9272116422653198, 0.2750459313392639, 0.22322708368301392, 0.3995702862739563, -0.22396907210350037, -1.169098138809204, -0.2138776034116745, -1.1482120752334595, -2.70363712310791, 0.4125731587409973, -0.31349867582321167, -1.3616143465042114, 0.07811583578586578, -1.0933947563171387, 0.8643937110900879, -0.41386064887046814, -1.1735340356826782, -1.5320067405700684, 0.08140343427658081, -0.06120380759239197, 0.929402768611908, -1.5834075212478638, -0.1591114103794098, 1.2331377267837524, 0.9890996813774109, -0.9129006862640381, 1.0257490873336792, 0.26043254137039185, 1.1660906076431274, 0.8761633038520813, -0.4396921694278717, 0.6533790230751038, -0.00894417054951191, -1.4467476606369019, 0.5717713236808777, 1.0743510723114014, 0.09900582581758499, 1.4378904104232788, -0.6028042435646057, -0.012091802433133125, 0.41033947467803955, -0.5346844792366028, -0.48284363746643066, -0.6629385352134705, 0.6933557391166687, 0.021667875349521637, -0.8348730206489563, 0.07739333808422089, -0.014030823484063148, -0.19973167777061462, 0.10865747183561325, -1.5635823011398315, -0.17432154715061188, -0.3353559374809265, -0.7160917520523071, -1.2137619256973267, -0.07014255225658417, 1.4185066223144531, -0.7300676703453064, -0.23004193603992462, 0.4449837803840637, 0.31318357586860657, 0.46263065934181213, 0.5224488377571106, -0.8131835460662842, -0.3164803981781006, -0.0804794579744339, -0.3445453345775604, 0.5013030767440796, 1.441364049911499, -0.07465680688619614, -1.071877360343933, 0.6858833432197571, -0.2582053542137146, 0.12437573820352554, 1.9092189073562622, 0.12428466230630875, -0.9084134101867676, 0.18711872398853302, -0.7371802926063538, 2.013493776321411, 1.552467703819275, 1.2448030710220337, -0.04144037514925003, -0.8869569301605225, 0.7112292051315308, -0.3018084466457367, -0.47451984882354736, 0.861581563949585, 0.4096212685108185, -0.16226047277450562, -1.4880391359329224, 0.7299901843070984, 1.2612360715866089, -0.7554841637611389, -0.8819556832313538, 0.034628428518772125, -0.7209867835044861, 0.9632019996643066, 0.7356793284416199, 0.46292752027511597, 0.26487430930137634, 1.7665889263153076, 0.8215738534927368, -0.49913397431373596, 0.5683035254478455, 0.5248094797134399, 0.004631169140338898, -2.1637587547302246, -1.1245951652526855, 0.47361183166503906, -0.5691154599189758, -1.5451725721359253, 1.4022307395935059, -1.1047444343566895, -0.8460293412208557, 0.5038087368011475, 0.1087869182229042, 1.5950058698654175, 0.3488295078277588, 1.4422719478607178, 1.9589985609054565, 0.9731495976448059, 0.3274787664413452, 1.3140138387680054, -0.25255635380744934, -0.5163972973823547, 1.7986291646957397, -0.5631328225135803, 0.37319228053092957, 1.0672245025634766, -0.30123430490493774, -1.0974985361099243, -0.8234012126922607, -1.2158477306365967, -0.6391046643257141, 1.0589979887008667, 0.1279417723417282, -1.1627305746078491, 0.31498879194259644, 1.451722264289856, 0.11804068833589554, -0.34766554832458496, 0.6269988417625427, 0.3092404305934906, -0.8800440430641174, 0.05183477699756622, -0.8183594942092896, 0.4978983402252197, -0.1598580926656723, -0.3525363504886627, 0.379729688167572, 0.42620033025741577, 1.308396339416504, -0.027767697349190712, 0.1518457680940628, 1.178327202796936, -1.4168469905853271, 1.3854784965515137, -0.7515071034431458, 0.24214589595794678, -2.2557804584503174, 1.411754846572876, -0.8633414506912231, 1.8457417488098145, -2.6777169704437256, 0.41598859429359436, -0.5498368144035339, -0.40300294756889343, 0.2677008807659149, -0.42403095960617065, 0.14298872649669647, -0.13247863948345184, -1.2429689168930054, -0.029298720881342888, -0.6385318636894226, 0.652149498462677, 1.0610169172286987, 1.2443329095840454, -1.0861798524856567, -0.3053434491157532, -1.8308582305908203, -0.025770682841539383, -0.5991992354393005, 0.21417364478111267, -2.047187089920044, -0.24927175045013428, -1.9168527126312256, -2.2772223949432373, -1.2388858795166016, -0.6823685765266418, 1.111339807510376, 0.1870383620262146, -0.802839994430542, 1.2098230123519897, -0.26549383997917175, -1.749306321144104, 1.0849024057388306, -2.170419216156006 ]
https://github.com/huggingface/datasets/issues/3615
Dataset BnL Historical Newspapers does not work in streaming mode
I see this is fixed now 🙂. I also picked up a few other tips from your redactors so hopefully my next attempts will support streaming from the start.
## Describe the bug When trying to load in streaming mode, it "hangs"... ## Steps to reproduce the bug ```python ds = load_dataset("bnl_newspapers", split="train", streaming=True) ``` ## Expected results The code should be optimized, so that it works fast in streaming mode. CC: @davanstrien
990
29
Dataset BnL Historical Newspapers does not work in streaming mode ## Describe the bug When trying to load in streaming mode, it "hangs"... ## Steps to reproduce the bug ```python ds = load_dataset("bnl_newspapers", split="train", streaming=True) ``` ## Expected results The code should be optimized, so that it works fast in streaming mode. CC: @davanstrien I see this is fixed now 🙂. I also picked up a few other tips from your redactors so hopefully my next attempts will support streaming from the start.
[ -1.269133448600769, -0.8585634827613831, -0.7699055075645447, 1.4769037961959839, -0.2659066319465637, -1.154210090637207, 0.2856462895870209, -1.108539342880249, 1.6813353300094604, -0.7608298063278198, 0.3031230866909027, -1.6707348823547363, -0.00825279951095581, -0.5853433609008789, -0.6537801623344421, -0.8494879603385925, -0.5851367115974426, -0.6492764949798584, 0.9566953182220459, 2.429628849029541, 1.2768025398254395, -1.2820004224777222, 2.6711764335632324, 0.7678551077842712, -0.18794742226600647, -1.0278130769729614, 0.5179621577262878, 0.02362827956676483, -1.3050727844238281, -0.5605495572090149, -1.0472476482391357, -0.13411352038383484, -0.5129866600036621, -0.5775170922279358, -0.15759897232055664, 0.47236770391464233, -0.3576279282569885, -0.5216065049171448, -0.4412557780742645, -0.7260763049125671, 0.4423871338367462, -0.41891029477119446, 0.8333771824836731, -0.4539680480957031, 1.9072906970977783, -0.6404904723167419, 0.5096491575241089, 0.7838526964187622, 1.379859447479248, 0.23871266841888428, -0.12719736993312836, 0.3790081739425659, 0.47495678067207336, -0.07917935401201248, 0.5146766901016235, 1.10796058177948, 0.5025049448013306, 0.5571879148483276, 0.6639933586120605, -2.093902111053467, 1.2807828187942505, -1.0434517860412598, 0.2426144778728485, 1.5011204481124878, -1.0181866884231567, 0.30658620595932007, -1.7127811908721924, -0.0805806964635849, 0.5550464987754822, -2.24556565284729, 0.3556787669658661, -1.2039440870285034, -0.5767268538475037, 1.10639226436615, 0.5349510908126831, -1.339362382888794, 0.009971840307116508, -0.2511131465435028, 0.8956276774406433, 0.43678128719329834, 1.118272304534912, -1.5294246673583984, 0.025813665241003036, -0.4789706766605377, -0.03392407298088074, -1.3488283157348633, -1.386818289756775, 0.5301999449729919, 0.5297852158546448, 0.6368410587310791, -0.12503288686275482, 0.8810401558876038, -0.9603667855262756, 0.7956655621528625, -0.8423284888267517, -1.7041929960250854, -1.398533582687378, -2.3952841758728027, -2.185762643814087, 0.8671357035636902, -0.4343412220478058, -0.7207226157188416, 2.0540871620178223, -1.0135287046432495, -1.7668979167938232, 1.2830095291137695, 0.20548582077026367, -0.05373199284076691, 2.471531629562378, 0.28249722719192505, -0.6353650093078613, 0.5506873726844788, -0.7628408670425415, 0.8182292580604553, -0.6159283518791199, 1.477755069732666, 0.37271779775619507, -0.9987522959709167, 1.6546961069107056, -0.43707650899887085, 0.6391019225120544, -0.6976847052574158, -0.6179006695747375, -0.7472677230834961, 0.3802473545074463, 1.9352378845214844, -0.24547982215881348, 1.5347177982330322, -0.34049084782600403, -1.6068711280822754, -1.6917634010314941, 1.0325645208358765, 0.323090523481369, -0.6569423079490662, 0.3069440424442291, -0.27661558985710144, 0.02924826741218567, -0.09762676060199738, 1.2066450119018555, 1.3747518062591553, 0.6473702788352966, -0.24411433935165405, -0.887019693851471, 0.20215153694152832, 0.01035417802631855, -0.7875226140022278, -1.6418877840042114, -0.34980496764183044, 0.07018078863620758, 0.511691153049469, -1.1446073055267334, 1.758014440536499, 1.056421160697937, 1.8809239864349365, 1.0097407102584839, -0.2881554961204529, 1.3347934484481812, 0.0793357864022255, 1.9059323072433472, -0.42947351932525635, 0.6763209104537964, -0.3745373487472534, -1.270328402519226, 0.845248818397522, -0.340898722410202, -1.9874118566513062, -0.7960485816001892, -0.9717961549758911, -0.2156791388988495, -0.8008404970169067, 1.1199456453323364, -0.2551025152206421, -1.3333485126495361, 0.3098759353160858, -0.8146292567253113, 0.12898656725883484, -1.3397798538208008, 0.4166218936443329, 0.6822789907455444, -0.5662573575973511, 0.18248438835144043, -0.1669522523880005, -1.2889642715454102, -0.36165904998779297, 0.24079212546348572, 1.811575174331665, -0.8596550226211548, 0.8618462681770325, 1.0072002410888672, -0.7872008681297302, -0.0759119987487793, 0.45460015535354614, -0.3079596757888794, 0.7974891066551208, -1.003122091293335, -0.37017306685447693, 1.2175283432006836, -0.19736170768737793, -0.6455569267272949, 1.5047358274459839, 0.6545082330703735, -0.8658228516578674, -0.02377379685640335, -0.2314138412475586, -0.9078590869903564, 0.04024100303649902, -1.615794062614441, -0.038713499903678894, 0.4274686276912689, -1.4352399110794067, -0.5452346801757812, -0.15252918004989624, 1.2495204210281372, -0.09986365586519241, 1.4125734567642212, -0.25359275937080383, -0.16819584369659424, -0.3978157639503479, -0.3366798162460327, 0.14313429594039917, -0.1734636127948761, -0.49675068259239197, 0.25033921003341675, -0.6298891305923462, 0.37419161200523376, 1.3817975521087646, 0.18522796034812927, 0.07349489629268646, 0.6708737015724182, 0.9913318157196045, 0.3021639287471771, -0.1746857762336731, -0.932532548904419, -1.514469027519226, 1.9157096147537231, -1.4515154361724854, 1.8451735973358154, 0.7089986205101013, -0.22037294507026672, -1.7102054357528687, -1.8906370401382446, 1.365709900856018, 1.3190369606018066, 2.3059675693511963, 0.6361305117607117, 0.43327775597572327, -0.8458206653594971, -0.7012853622436523, 0.19695767760276794, -1.12063467502594, -0.7155203819274902, 0.1323721706867218, 2.2146902084350586, 1.8107672929763794, -0.5372666716575623, -0.10190894454717636, -1.1707420349121094, 1.2631940841674805, -0.22853189706802368, 0.1163555234670639, 1.9456733465194702, -0.2448578178882599, -1.0621330738067627, 1.1592344045639038, -2.279757499694824, 0.08937199413776398, 2.0133614540100098, 0.3240104913711548, 0.08161121606826782, -1.3823144435882568, -0.6130841970443726, -0.19950762391090393, -0.4073721468448639, -1.1259962320327759, 0.6049651503562927, -0.2145327925682068, -0.6889486908912659, -1.4047329425811768, 0.24033907055854797, -0.9582116007804871, -1.5816384553909302, 0.13431322574615479, 1.7707880735397339, 2.0089304447174072, -0.8337351679801941, 1.5677720308303833, -0.1755634844303131, 0.1622234582901001, 1.2955936193466187, 1.1298140287399292, 2.984114170074463, 2.0931642055511475, -1.2302563190460205, 0.759881317615509, -0.07550590485334396, -0.5139421224594116, 1.230647087097168, -1.3393474817276, 1.4128053188323975, -0.021123133599758148, -1.0087544918060303, -1.195377230644226, 0.7699504494667053, 0.41641470789909363, 0.14014902710914612, -0.49041464924812317, 1.2185218334197998, 0.12949591875076294, 1.3393837213516235, 0.4939352869987488, -0.2174546718597412, 0.6720836758613586, -0.4008840322494507, -0.410858154296875, 1.5834708213806152, 0.3613904118537903, -1.4369364976882935, -2.1604795455932617, -0.16091087460517883, -0.9864718317985535, 0.008764248341321945, -0.6555941104888916, -0.9270309805870056, 1.6398653984069824, 0.4016091227531433, -1.0957794189453125, -0.33021292090415955, -0.33243563771247864, -0.7230897545814514, 2.8611526489257812, -1.4247902631759644, -0.2585289180278778, -1.0226680040359497, -0.6492634415626526, 1.798039436340332, -1.2277824878692627, -0.1795291304588318, -1.205399990081787, -0.43441250920295715, -1.222068190574646, -0.5760321021080017, -0.015711961314082146, -0.9860844016075134, 0.7357746362686157, 0.32182952761650085, -1.2232264280319214, -0.3877367675304413, -0.8178025484085083, 0.8329240679740906, -0.0055572171695530415, 0.2243257761001587, 1.8256516456604004, 0.2774287760257721, -0.3828417658805847, 0.6734604239463806, 1.2712005376815796, 0.5440075993537903, -0.5111194252967834, 0.30431702733039856, -0.7169275283813477, 0.2692964971065521, -1.2737071514129639, 0.25496336817741394, -2.706641674041748, 0.46612226963043213, -0.1740221083164215, -0.08774688839912415, -0.11953189224004745, -1.3910247087478638, 1.1061445474624634, 2.484635591506958, -1.1593410968780518, 0.4903947114944458, 0.2886866629123688, 1.282493233680725, -1.5612763166427612, 0.43616387248039246, -0.5958012342453003, 2.1551501750946045, 0.27371057868003845, 0.9583603739738464, -0.4608994126319885, -2.3113973140716553, 0.6802969574928284, -1.2669243812561035, -1.2869802713394165, 0.7459682822227478, -0.8534031510353088, -0.03847835958003998, -1.3377827405929565, -0.18743333220481873, -0.8252535462379456, -1.1772537231445312, 0.7853114604949951, 0.19808214902877808, 0.5267701745033264, -0.6111586093902588, 0.34463292360305786, -2.3334102630615234, -1.2967231273651123, -0.28705015778541565, -0.8666748404502869, 0.4012872278690338, -0.32524004578590393, 0.7105592489242554, -0.26852908730506897, -0.0038116564974188805, 0.4228854775428772, 1.5042833089828491, 3.3483457565307617, 0.1345413625240326, 0.4530589282512665, -0.14575380086898804, -0.9084954261779785, 1.5411008596420288, 1.0223280191421509, -0.0932704284787178, -0.6802058815956116, -0.9723793268203735, 1.015538215637207, 1.9300328493118286, 1.0473600625991821, 0.023198086768388748, -0.8465967178344727, -0.5813114643096924, -0.13508975505828857, 0.14319318532943726, 0.2931852340698242, 0.9621368050575256, 0.16332346200942993, 0.04225267097353935, 1.4163258075714111, 1.1402418613433838, -0.3933922350406647, 0.33158087730407715, -0.7893781065940857, -0.45723795890808105, 0.5531201958656311, 0.39741939306259155, 0.057874999940395355, 0.24108335375785828, -0.984199047088623, -0.26909974217414856, -0.21596089005470276, -0.855477511882782, -0.8816540837287903, -0.3185972273349762, -0.3058173954486847, 1.7588400840759277, 0.050602056086063385, -0.612693190574646, -0.023481503129005432, -0.8533799648284912, -0.012548625469207764, -1.1894257068634033, 0.2303658127784729, -0.08433017879724503, -0.08495954424142838, 0.020637542009353638, 1.8114924430847168, -1.0316540002822876, -2.1758100986480713, 0.22387075424194336, 0.28806963562965393, -0.23857536911964417, 0.15591686964035034, 1.421521782875061, 0.5029982924461365, 1.498102068901062, 1.3439515829086304, 1.0565464496612549, -0.7379888296127319, -1.3993282318115234, 0.7032878994941711, 1.0684393644332886, -1.5290635824203491, 0.6267822980880737, 0.2647194266319275, -0.48950403928756714, 0.5361077785491943, 1.1037310361862183, 0.4125911295413971, -1.9988934993743896, 0.7301123738288879, -0.9660651683807373, 0.7692618370056152, 0.648787260055542, 0.676690936088562, 0.3046230375766754, 0.7621222734451294, -1.0879590511322021, -1.2474099397659302, -0.7811865210533142, -0.7080872058868408, 1.9460009336471558, -0.24910438060760498, 0.6509799957275391, -0.21225792169570923, -1.3128578662872314, -0.002280456479638815, 0.7176222801208496, 0.2868691682815552, -0.4625975489616394, 0.6891018152236938, -0.7132250070571899, -1.1732743978500366, -1.4702388048171997, -0.46613752841949463, -1.0060110092163086, -1.0058077573776245, 1.105629563331604, 0.772924542427063, 0.17379972338676453, 1.9028306007385254, 0.7240097522735596, 0.3269372284412384, -2.6250219345092773, 0.8793589472770691, 0.25428757071495056, 0.08849743008613586, 0.8081687688827515, 0.5179739594459534, 1.0501549243927002, -0.08061744272708893, 0.4577609598636627, -2.48331618309021, 2.3268308639526367, -0.30314356088638306, 0.5550708770751953, 0.05295950174331665, -0.15608328580856323, 1.0259010791778564, 0.6917034983634949, 0.5110212564468384, -1.0032774209976196, 0.5824832320213318, -0.6119345426559448, 1.4057036638259888, 0.9198036193847656, -0.7659521698951721, 0.10296563059091568, 1.3645201921463013, 0.5869684815406799, -0.3845052719116211, -0.9760579466819763, -0.9025092720985413, 0.9168595671653748, 1.5975861549377441, -0.11292175948619843, 0.014693120494484901, 0.8231359720230103, 0.48912733793258667, -1.291329264640808, 0.027451321482658386, -0.8470557332038879, -0.821174681186676, 1.6674453020095825, 2.169191360473633, -0.12943792343139648, -0.16529586911201477, -0.786152720451355, -1.2445088624954224, 0.8041398525238037, -0.027144482359290123, 0.25941216945648193, 0.5880475640296936, -0.5569202303886414, 1.0027666091918945, 0.9422333240509033, 0.915262758731842, 0.28543078899383545, 0.23158633708953857, 0.4579707682132721, -0.182223379611969, -1.120771050453186, -0.1210707277059555, -1.0721592903137207, -2.6765711307525635, 0.4320998787879944, -0.3328114449977875, -1.4871635437011719, 0.09370768070220947, -1.104872226715088, 0.9146618843078613, -0.4962436258792877, -1.1280995607376099, -1.5746235847473145, -0.020189329981803894, -0.0031915316358208656, 0.9137226939201355, -1.5067825317382812, -0.17634445428848267, 1.215415120124817, 0.8879973292350769, -0.8451828956604004, 1.0577796697616577, 0.2967836260795593, 1.2196089029312134, 0.8479613065719604, -0.37218955159187317, 0.5650453567504883, -0.003397999331355095, -1.4613226652145386, 0.5807784795761108, 1.2815231084823608, 0.1264234185218811, 1.466470718383789, -0.5946685671806335, 0.04001331329345703, 0.395468145608902, -0.5699449777603149, -0.5057197213172913, -0.5581727623939514, 0.6853665709495544, 0.10692240297794342, -0.9372953176498413, 0.03194105997681618, -0.14609935879707336, -0.2644781768321991, 0.1004951149225235, -1.4809225797653198, -0.16221001744270325, -0.4852544963359833, -0.7838367223739624, -1.159949541091919, -0.01058154832571745, 1.3988651037216187, -0.7512502074241638, -0.20492181181907654, 0.42650073766708374, 0.3451482653617859, 0.5041972994804382, 0.5696637630462646, -0.7502651810646057, -0.2058289349079132, -0.0933089628815651, -0.3952421545982361, 0.4833305776119232, 1.466914415359497, -0.08587536960840225, -1.054827094078064, 0.6996595859527588, -0.335681289434433, 0.0511627197265625, 1.9624069929122925, 0.1591968536376953, -0.838607132434845, 0.16271784901618958, -0.668369472026825, 2.0446205139160156, 1.5663820505142212, 1.3037035465240479, -0.06244388222694397, -0.961853563785553, 0.5792057514190674, -0.2231830656528473, -0.4508705139160156, 0.756338894367218, 0.38950225710868835, -0.25362563133239746, -1.5250298976898193, 0.6600388288497925, 1.2340834140777588, -0.7844036817550659, -0.8348212242126465, 0.008541695773601532, -0.7781679034233093, 0.9796753525733948, 0.7636286616325378, 0.48734426498413086, 0.35241562128067017, 1.6923195123672485, 0.8765687942504883, -0.5467261672019958, 0.5586154460906982, 0.5637525916099548, -0.0575840063393116, -2.1343929767608643, -1.0432021617889404, 0.355222225189209, -0.6520763635635376, -1.5219120979309082, 1.4014582633972168, -1.0711299180984497, -0.9302622675895691, 0.4410911798477173, 0.245437890291214, 1.6372073888778687, 0.3586677014827728, 1.4291837215423584, 1.976019024848938, 0.9238536953926086, 0.29010459780693054, 1.30610990524292, -0.2341424524784088, -0.45998600125312805, 1.84771728515625, -0.46560782194137573, 0.3262818157672882, 1.1746882200241089, -0.271144837141037, -1.0531196594238281, -0.7731800675392151, -1.2304322719573975, -0.6227973103523254, 1.1276047229766846, 0.0739886686205864, -1.1144328117370605, 0.3298104703426361, 1.467458963394165, 0.11341049522161484, -0.4309120178222656, 0.5466954708099365, 0.4561612904071808, -0.9391266703605652, 0.06131811439990997, -0.915658175945282, 0.47507137060165405, -0.11775188893079758, -0.43484988808631897, 0.31446605920791626, 0.528236448764801, 1.3602255582809448, -0.06514351069927216, 0.2895757257938385, 1.1344050168991089, -1.4894968271255493, 1.4895586967468262, -0.7606511116027832, 0.15986481308937073, -2.200592517852783, 1.3359296321868896, -0.7007091045379639, 1.8158832788467407, -2.714616298675537, 0.4594503939151764, -0.5621523857116699, -0.4373567998409271, 0.2880079746246338, -0.5007741451263428, 0.06847098469734192, -0.1876610517501831, -1.251361608505249, 0.011200908571481705, -0.608848512172699, 0.5760653018951416, 1.0179699659347534, 1.2640339136123657, -1.0471556186676025, -0.3070635497570038, -1.7604889869689941, -0.14902210235595703, -0.7165749669075012, 0.28322264552116394, -2.0578465461730957, -0.2803485095500946, -1.922574758529663, -2.2714381217956543, -1.253775954246521, -0.7417925000190735, 1.2258414030075073, 0.1531234085559845, -0.8607674837112427, 1.1706024408340454, -0.42808008193969727, -1.9142290353775024, 1.0911015272140503, -2.1925976276397705 ]
https://github.com/huggingface/datasets/issues/3613
Files not updating in dataset viewer
Yes. The jobs queue is full right now, following an upgrade... Back to normality in the next hours hopefully. I'll look at your datasets to be sure the dataset viewer works as expected on them.
## Dataset viewer issue for '*name of the dataset*' **Link:** Some examples: * https://huggingface.co/datasets/abidlabs/crowdsourced-speech4 * https://huggingface.co/datasets/abidlabs/test-audio-13 *short description of the issue* It seems that the dataset viewer is reading a cached version of the dataset and it is not updating to reflect new files that are added to the dataset. I get this error: ![image](https://user-images.githubusercontent.com/1778297/150566660-30dc0dcd-18fd-4471-b70c-7c4bdc6a23c6.png) Am I the one who added this dataset? Yes
991
35
Files not updating in dataset viewer ## Dataset viewer issue for '*name of the dataset*' **Link:** Some examples: * https://huggingface.co/datasets/abidlabs/crowdsourced-speech4 * https://huggingface.co/datasets/abidlabs/test-audio-13 *short description of the issue* It seems that the dataset viewer is reading a cached version of the dataset and it is not updating to reflect new files that are added to the dataset. I get this error: ![image](https://user-images.githubusercontent.com/1778297/150566660-30dc0dcd-18fd-4471-b70c-7c4bdc6a23c6.png) Am I the one who added this dataset? Yes Yes. The jobs queue is full right now, following an upgrade... Back to normality in the next hours hopefully. I'll look at your datasets to be sure the dataset viewer works as expected on them.
[ -1.2266243696212769, -0.946139931678772, -0.7874407768249512, 1.2763078212738037, -0.11479169130325317, -1.3846678733825684, 0.002870841883122921, -1.0300257205963135, 1.660773515701294, -0.7440741062164307, 0.21121668815612793, -1.735167384147644, -0.020314615219831467, -0.5980451107025146, -0.7753496170043945, -0.8665729761123657, -0.4178813099861145, -0.8270577192306519, 0.966877818107605, 2.5464134216308594, 1.159262776374817, -1.3606257438659668, 2.718060255050659, 0.6190043687820435, -0.2403227537870407, -1.0547503232955933, 0.5654779672622681, 0.14147524535655975, -1.298144817352295, -0.4806467890739441, -0.9126005172729492, -0.04205555096268654, -0.4743340313434601, -0.5012969970703125, 0.13006648421287537, 0.38668712973594666, -0.15805380046367645, -0.31130388379096985, -0.4618756175041199, -0.7127170562744141, 0.474585622549057, -0.4134799838066101, 0.9572567939758301, -0.4363195598125458, 1.8544801473617554, -0.5974856615066528, 0.2974753677845001, 0.6344963312149048, 1.3871331214904785, 0.15214763581752777, -0.10196736454963684, 0.23347368836402893, 0.3511946499347687, 0.04256264120340347, 0.384848952293396, 1.1241785287857056, 0.6448529958724976, 0.4628535807132721, 0.7210568189620972, -2.178107976913452, 1.4240058660507202, -0.9266690015792847, 0.2902083396911621, 1.499330997467041, -1.127894401550293, 0.4089755117893219, -1.8216034173965454, -0.10189074277877808, 0.4908686578273773, -2.3374366760253906, 0.12752729654312134, -1.300898551940918, -0.5319594144821167, 0.9339960813522339, 0.28431010246276855, -1.2733867168426514, 0.2011316865682602, -0.5214204788208008, 0.995098352432251, 0.48471498489379883, 1.263037919998169, -1.7341243028640747, -0.07031436264514923, -0.2419825941324234, 0.07744208723306656, -1.4175305366516113, -1.5310083627700806, 0.5548971891403198, 0.5882465839385986, 0.7026989459991455, -0.05087878182530403, 0.8041970729827881, -0.9435737133026123, 0.8259961605072021, -0.9299498796463013, -1.6190565824508667, -1.3957395553588867, -2.3118577003479004, -2.312699317932129, 0.8842343091964722, -0.38716205954551697, -0.4773324728012085, 1.964975357055664, -1.0649813413619995, -1.7969828844070435, 1.1133654117584229, 0.28764352202415466, 0.031160224229097366, 2.3970444202423096, 0.24393150210380554, -0.6645519733428955, 0.3276881277561188, -0.6891051530838013, 0.829450249671936, -0.3694237470626831, 1.432443618774414, 0.544204831123352, -1.0244767665863037, 1.5701954364776611, -0.46650758385658264, 0.5229607820510864, -0.6794471740722656, -0.5331491231918335, -0.9014394283294678, 0.40258514881134033, 1.891381859779358, -0.3167872726917267, 1.6424518823623657, -0.40600094199180603, -1.6195201873779297, -1.5067611932754517, 0.7905131578445435, 0.5584962368011475, -0.8748519420623779, -0.0358792245388031, -0.33799490332603455, 0.08414541184902191, 0.0017441827803850174, 0.992057204246521, 1.1806111335754395, 0.632461428642273, -0.3045729994773865, -0.8877468109130859, 0.258110910654068, -0.08597543835639954, -0.6691685914993286, -1.8543808460235596, -0.3253238797187805, 0.269687682390213, 0.6861855983734131, -1.2400550842285156, 1.6021913290023804, 0.9327263832092285, 1.9644638299942017, 0.9451719522476196, -0.3103378713130951, 1.4175996780395508, 0.031588610261678696, 1.8846927881240845, -0.6362768411636353, 0.7430126667022705, -0.2004653811454773, -1.0499721765518188, 0.7870563268661499, -0.4050460755825043, -2.06337571144104, -0.7173843383789062, -0.9228376150131226, -0.21506085991859436, -0.7751855850219727, 1.0125161409378052, -0.22856105864048004, -1.3537014722824097, 0.20614752173423767, -0.6239179372787476, 0.186992347240448, -1.3048162460327148, 0.22311948239803314, 0.8352642059326172, -0.6196972131729126, -0.16539496183395386, -0.2534257173538208, -1.3837300539016724, -0.5028005242347717, 0.21665851771831512, 1.9716198444366455, -0.7292680740356445, 1.0259425640106201, 0.9053155183792114, -0.6463596820831299, 0.07654228806495667, 0.3486941456794739, -0.25843581557273865, 0.8445119857788086, -1.0753577947616577, -0.2600386440753937, 1.0548282861709595, -0.17062526941299438, -0.49696609377861023, 1.563598871231079, 0.8565212488174438, -0.9689483642578125, -0.167349711060524, -0.25270402431488037, -0.8127999305725098, -0.045046184211969376, -1.6254459619522095, -0.2114717811346054, 0.14148327708244324, -1.4092400074005127, -0.495250403881073, -0.2368960678577423, 1.2693465948104858, -0.18977203965187073, 1.3318796157836914, -0.3237537145614624, -0.3008460998535156, -0.45572519302368164, -0.4021737277507782, 0.2220556139945984, -0.22684454917907715, -0.6720556020736694, 0.3258183002471924, -0.8889192342758179, 0.2620059847831726, 1.4476782083511353, 0.5323716402053833, 0.10344809293746948, 0.5927293300628662, 1.0202165842056274, 0.24779409170150757, -0.09639822691679001, -0.8599629402160645, -1.6382964849472046, 2.0627646446228027, -1.5119274854660034, 1.9108184576034546, 0.7504481077194214, -0.020044663920998573, -1.750654697418213, -1.8500210046768188, 1.346619725227356, 1.1249125003814697, 2.4071338176727295, 0.6044493913650513, 0.37078264355659485, -0.818506121635437, -0.6870195865631104, 0.32397690415382385, -0.9925123453140259, -0.7135845422744751, 0.05683329701423645, 2.2848379611968994, 1.7209339141845703, -0.6502172946929932, -0.18528543412685394, -1.0159294605255127, 1.2163327932357788, -0.11567613482475281, 0.14931610226631165, 2.042036294937134, -0.3107111155986786, -1.1133723258972168, 1.2648639678955078, -2.3376283645629883, 0.18074777722358704, 1.9463573694229126, 0.322392076253891, 0.018531346693634987, -1.4161220788955688, -0.6890773773193359, -0.218525692820549, -0.4444584548473358, -1.300409197807312, 0.521865963935852, -0.3214648365974426, -0.9088824987411499, -1.5676231384277344, 0.05482052266597748, -1.118945837020874, -1.6512532234191895, 0.4606735110282898, 1.7810949087142944, 2.056286334991455, -0.7096117734909058, 1.4117499589920044, -0.20907729864120483, 0.22545097768306732, 1.2158304452896118, 1.1999685764312744, 3.1008715629577637, 1.9192941188812256, -1.220777153968811, 0.7375433444976807, -0.11276913434267044, -0.4488494396209717, 1.1564946174621582, -1.082296371459961, 1.1666418313980103, -0.17154017090797424, -1.3002146482467651, -1.2187042236328125, 0.950769305229187, 0.4869152009487152, 0.007658801972866058, -0.5208220481872559, 1.2311460971832275, -0.013873674906790257, 1.3631902933120728, 0.5539075136184692, -0.37785273790359497, 0.5844993591308594, -0.48267778754234314, -0.5281485319137573, 1.5858529806137085, 0.12589304149150848, -1.5086073875427246, -2.3892245292663574, -0.2717635929584503, -0.7585887908935547, -0.07235858589410782, -0.6283198595046997, -1.0595786571502686, 1.6562050580978394, 0.5078403949737549, -1.2287273406982422, -0.284665048122406, -0.3677981197834015, -0.6874397993087769, 2.6021220684051514, -1.4138529300689697, -0.17837083339691162, -0.9829061031341553, -0.5253565311431885, 1.6306864023208618, -1.2269798517227173, -0.1766832321882248, -1.065345048904419, -0.6916377544403076, -1.347508430480957, -0.49466606974601746, -0.14189273118972778, -0.8893125057220459, 0.8039572238922119, 0.06509258598089218, -1.0507261753082275, -0.26735180616378784, -0.9475840330123901, 0.834790825843811, -0.08262643963098526, 0.2598249018192291, 1.9025464057922363, 0.3981746733188629, -0.43688762187957764, 0.5579476356506348, 1.1699687242507935, 0.642880916595459, -0.6852090358734131, 0.1283014565706253, -0.6965413093566895, 0.18221284449100494, -1.329376220703125, 0.2924248278141022, -2.893174409866333, 0.6695150136947632, -0.056816570460796356, -0.027993865311145782, -0.03852706775069237, -1.3366042375564575, 1.1840474605560303, 2.560429096221924, -1.1554006338119507, 0.482804536819458, 0.32648032903671265, 1.2343577146530151, -1.6141058206558228, 0.3911024332046509, -0.4586731195449829, 2.0759928226470947, 0.23138836026191711, 1.1610122919082642, -0.5061618089675903, -2.1234209537506104, 0.6302320957183838, -1.2014884948730469, -1.068239450454712, 0.647330641746521, -0.8572628498077393, 0.13834120333194733, -1.456821084022522, -0.16130368411540985, -0.9786360263824463, -1.291196346282959, 0.7768650054931641, 0.09302770346403122, 0.4511747658252716, -0.5698827505111694, 0.3101939558982849, -2.1710245609283447, -1.2916028499603271, -0.22754214704036713, -0.8717027902603149, 0.5477187633514404, -0.2263246774673462, 0.671202540397644, -0.09234932065010071, 0.14267075061798096, 0.3118644058704376, 1.3348218202590942, 3.3626513481140137, 0.17323023080825806, 0.4072658121585846, -0.05040759593248367, -1.0226324796676636, 1.455501914024353, 1.0109412670135498, -0.02880028635263443, -0.5936996936798096, -0.9760974645614624, 1.3352733850479126, 1.9300272464752197, 1.081183671951294, 0.09915433824062347, -0.8269870281219482, -0.647042989730835, 0.1288689821958542, 0.24743333458900452, 0.5252964496612549, 0.994475245475769, 0.022974196821451187, 0.11415133625268936, 1.5316510200500488, 1.2579759359359741, -0.45072293281555176, 0.47387954592704773, -0.9227710962295532, -0.4126623272895813, 0.46320003271102905, 0.3773990571498871, -0.001215476542711258, 0.47868406772613525, -1.109858512878418, -0.2245641052722931, -0.1987004578113556, -1.0382262468338013, -0.6945013999938965, -0.47996199131011963, -0.4047063887119293, 1.6841598749160767, 0.04310332238674164, -0.43679559230804443, -0.046830326318740845, -0.7472022771835327, -0.15262888371944427, -1.100492000579834, 0.3544142246246338, -0.10907947272062302, -0.010721668601036072, -0.08936969935894012, 1.8300061225891113, -0.9120982885360718, -2.1560635566711426, 0.30079641938209534, 0.3376500904560089, -0.5713443756103516, 0.061434827744960785, 1.5752722024917603, 0.5685516595840454, 1.3777483701705933, 1.3770482540130615, 1.040835976600647, -0.6192078590393066, -1.364167332649231, 0.6367813348770142, 0.915565013885498, -1.395013689994812, 0.9116528034210205, -0.07040250301361084, -0.592441201210022, 0.7915135622024536, 1.462664246559143, 0.37100109457969666, -1.943724513053894, 0.8540940284729004, -0.8296352624893188, 0.8456385135650635, 0.6183334589004517, 0.8447697162628174, 0.23359297215938568, 0.891499400138855, -1.4399585723876953, -1.1096746921539307, -0.8422638177871704, -0.5307599306106567, 1.9968678951263428, -0.1049639880657196, 0.4998601973056793, -0.2534162998199463, -1.2076104879379272, -0.03444519639015198, 0.6394233703613281, 0.3599961996078491, -0.21568819880485535, 0.8238176107406616, -0.6617848873138428, -1.1719874143600464, -1.4327468872070312, -0.41411155462265015, -0.887113094329834, -0.8376809358596802, 1.035451889038086, 0.8469717502593994, 0.3309061825275421, 1.8605530261993408, 0.5384669303894043, 0.18827681243419647, -2.642078161239624, 0.8033497333526611, 0.2558402419090271, 0.07459569722414017, 0.9291735887527466, 0.19419245421886444, 1.1455804109573364, 0.04148026183247566, 0.49021264910697937, -2.321411609649658, 2.1895618438720703, -0.3179682791233063, 0.71586012840271, -0.01238511223345995, -0.09995803982019424, 1.1441679000854492, 0.6260848045349121, 0.625825047492981, -1.1797497272491455, 0.841572642326355, -0.628135085105896, 1.0631765127182007, 1.025583028793335, -0.7668119668960571, 0.06774459779262543, 1.2584348917007446, 0.5032576322555542, -0.37672513723373413, -0.9495513439178467, -0.8592652082443237, 0.8626804351806641, 1.8412810564041138, -0.04189161956310272, 0.02230311930179596, 0.8407626152038574, 0.710016131401062, -1.2070287466049194, 0.07847531139850616, -0.7650843858718872, -0.6574732065200806, 1.735200047492981, 2.0309855937957764, 0.06952249258756638, -0.19275331497192383, -0.6270947456359863, -1.1372379064559937, 0.7256120443344116, 0.08810093253850937, 0.10610778629779816, 0.7736268043518066, -0.6983014345169067, 1.1964184045791626, 0.8013110160827637, 0.9248716831207275, 0.06045110523700714, 0.33494919538497925, 0.3608512282371521, -0.201761394739151, -1.1273574829101562, -0.34193044900894165, -1.1288007497787476, -2.4844353199005127, 0.5546659231185913, -0.32030704617500305, -1.4474431276321411, 0.05389324575662613, -1.062395453453064, 0.9134485721588135, -0.5523190498352051, -1.1779791116714478, -1.5303162336349487, 0.2408718466758728, -0.10221108049154282, 0.8292614221572876, -1.5415858030319214, -0.07365430891513824, 1.2463641166687012, 0.8525444269180298, -0.505742073059082, 1.0713376998901367, 0.25093892216682434, 1.0415363311767578, 0.7789324522018433, -0.45826756954193115, 0.319307416677475, 0.173031747341156, -1.3519359827041626, 0.5472326278686523, 1.1604260206222534, 0.1737741082906723, 1.38124680519104, -0.5086432695388794, 0.14655330777168274, 0.48114439845085144, -0.43027153611183167, -0.4632963538169861, -0.532859206199646, 0.8290970325469971, 0.10060089081525803, -0.9507144689559937, 0.020822513848543167, -0.16052256524562836, -0.19993069767951965, 0.29490742087364197, -1.4377602338790894, -0.33887946605682373, -0.48003238439559937, -0.5326292514801025, -1.3136392831802368, -0.07789695262908936, 1.3476028442382812, -0.860614538192749, -0.17450571060180664, 0.5567290782928467, 0.44748470187187195, 0.5800424814224243, 0.6183494329452515, -0.6490656137466431, -0.3336416780948639, -0.3056418001651764, -0.34183380007743835, 0.20860765874385834, 1.1814446449279785, -0.23967286944389343, -0.9888812303543091, 0.7179718017578125, -0.3520938456058502, 0.115448959171772, 1.9582889080047607, 0.02944427728652954, -0.8149771690368652, 0.3684213161468506, -0.7104649543762207, 1.8542554378509521, 1.6212886571884155, 1.4074112176895142, -0.054217629134655, -0.9426112174987793, 0.4781593382358551, -0.1566307544708252, -0.41582322120666504, 0.9271730184555054, 0.5543383359909058, -0.11046125739812851, -1.3629155158996582, 0.5293033123016357, 1.254578948020935, -0.9750752449035645, -0.7105934619903564, 0.07624996453523636, -0.8525141477584839, 1.037710428237915, 0.6219899654388428, 0.40402278304100037, 0.25326472520828247, 1.6143897771835327, 0.5191113948822021, -0.4998549222946167, 0.33627447485923767, 0.44470375776290894, -0.20355775952339172, -2.0697708129882812, -1.034014105796814, 0.22364044189453125, -0.36219513416290283, -1.5422747135162354, 1.3141591548919678, -1.1547647714614868, -0.8332798480987549, 0.5038268566131592, 0.1788284033536911, 1.4110187292099, 0.32147136330604553, 1.812750220298767, 2.0512053966522217, 0.9120938777923584, 0.23597808182239532, 1.3729861974716187, 0.033747293055057526, -0.4359065890312195, 1.8228566646575928, -0.3169006109237671, 0.606426477432251, 1.0603164434432983, -0.43695148825645447, -1.056477427482605, -0.7424634695053101, -1.0807172060012817, -0.606736421585083, 1.1324628591537476, 0.16857972741127014, -1.2060579061508179, 0.10795943439006805, 1.5101234912872314, 0.1324116289615631, -0.2263180911540985, 0.531122088432312, 0.47770678997039795, -0.64982008934021, -0.11146532744169235, -1.0077180862426758, 0.40508130192756653, -0.22837021946907043, -0.3612481653690338, 0.1670684963464737, 0.6113086938858032, 1.2010293006896973, -0.011407682672142982, 0.134750634431839, 1.4036027193069458, -1.334633231163025, 1.403649091720581, -0.6382491588592529, 0.19072359800338745, -2.431104898452759, 1.501239538192749, -0.7776150703430176, 1.9871858358383179, -2.6291263103485107, 0.3527996838092804, -0.5672807693481445, -0.39520493149757385, 0.2909450829029083, -0.3532294034957886, 0.11508660018444061, -0.078169085085392, -1.1077179908752441, -0.00835580937564373, -0.8170449733734131, 0.5234469175338745, 1.3042385578155518, 1.331046223640442, -1.076808214187622, -0.2688058912754059, -1.7716619968414307, -0.18949273228645325, -0.7002706527709961, 0.40316250920295715, -1.978145718574524, -0.04665275663137436, -1.9837000370025635, -2.416376829147339, -1.5210813283920288, -0.9142261743545532, 1.1107438802719116, 0.22395198047161102, -0.9779485464096069, 0.9492523670196533, -0.32146742939949036, -1.6782920360565186, 1.0677043199539185, -2.196587562561035 ]
https://github.com/huggingface/datasets/issues/3608
Add support for continuous metrics (RMSE, MAE)
Hey @ck37 You can always use a custom metric as explained [in this guide from HF](https://huggingface.co/docs/datasets/master/loading_metrics.html#using-a-custom-metric-script). If this issue needs to be contributed to (for enhancing the metric API) I think [this link](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_absolute_error.html) would be helpful for the `MAE` metric.
**Is your feature request related to a problem? Please describe.** I am uploading our dataset and models for the "Constructing interval measures" method we've developed, which uses item response theory to convert multiple discrete labels into a continuous spectrum for hate speech. Once we have this outcome our NLP models conduct regression rather than classification, so binary metrics are not relevant. The only continuous metrics available at https://huggingface.co/metrics are pearson & spearman correlation, which don't ensure that the prediction is on the same scale as the outcome. **Describe the solution you'd like** I would like to be able to tag our models on the Hub with the following metrics: - RMSE - MAE **Describe alternatives you've considered** I don't know if there are any alternatives. **Additional context** Our preprint is available here: https://arxiv.org/abs/2009.10277 . We are making it available for use in Jigsaw's Toxic Severity Rating Kaggle competition: https://www.kaggle.com/c/jigsaw-toxic-severity-rating/overview . I have our first model uploaded to the Hub at https://huggingface.co/ucberkeley-dlab/hate-measure-roberta-large Thanks, Chris
994
40
Add support for continuous metrics (RMSE, MAE) **Is your feature request related to a problem? Please describe.** I am uploading our dataset and models for the "Constructing interval measures" method we've developed, which uses item response theory to convert multiple discrete labels into a continuous spectrum for hate speech. Once we have this outcome our NLP models conduct regression rather than classification, so binary metrics are not relevant. The only continuous metrics available at https://huggingface.co/metrics are pearson & spearman correlation, which don't ensure that the prediction is on the same scale as the outcome. **Describe the solution you'd like** I would like to be able to tag our models on the Hub with the following metrics: - RMSE - MAE **Describe alternatives you've considered** I don't know if there are any alternatives. **Additional context** Our preprint is available here: https://arxiv.org/abs/2009.10277 . We are making it available for use in Jigsaw's Toxic Severity Rating Kaggle competition: https://www.kaggle.com/c/jigsaw-toxic-severity-rating/overview . I have our first model uploaded to the Hub at https://huggingface.co/ucberkeley-dlab/hate-measure-roberta-large Thanks, Chris Hey @ck37 You can always use a custom metric as explained [in this guide from HF](https://huggingface.co/docs/datasets/master/loading_metrics.html#using-a-custom-metric-script). If this issue needs to be contributed to (for enhancing the metric API) I think [this link](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_absolute_error.html) would be helpful for the `MAE` metric.
[ -1.2058979272842407, -0.9754817485809326, -0.8198542594909668, 1.3842730522155762, -0.14492468535900116, -1.3038243055343628, 0.02972082793712616, -1.0278265476226807, 1.667044997215271, -0.6561852097511292, 0.3533053398132324, -1.6439343690872192, -0.016394779086112976, -0.6290751099586487, -0.842463493347168, -0.7470524907112122, -0.3440234363079071, -0.8602014183998108, 0.902038037776947, 2.5851197242736816, 1.175139307975769, -1.412732720375061, 2.69291615486145, 0.6289249062538147, -0.12442705780267715, -0.9875913858413696, 0.5117571949958801, 0.042138829827308655, -1.282863974571228, -0.5008053183555603, -0.9492497444152832, 0.040562499314546585, -0.5727631449699402, -0.44562554359436035, 0.13674584031105042, 0.3928760290145874, -0.11887677758932114, -0.3455456495285034, -0.5925138592720032, -0.6607301831245422, 0.5270601511001587, -0.3368741571903229, 1.006334900856018, -0.3881886303424835, 1.8826202154159546, -0.6002297401428223, 0.38044267892837524, 0.6700371503829956, 1.3883707523345947, 0.20409968495368958, -0.030667539685964584, 0.28279590606689453, 0.42586612701416016, 0.013936399482190609, 0.49156567454338074, 1.167454481124878, 0.6575395464897156, 0.4358113408088684, 0.6704118847846985, -2.172760248184204, 1.3443667888641357, -1.0064176321029663, 0.31649336218833923, 1.374267578125, -0.9273659586906433, 0.3691501021385193, -1.8798905611038208, -0.057059552520513535, 0.6506561040878296, -2.2487006187438965, 0.14370088279247284, -1.2741997241973877, -0.5234103202819824, 1.0266661643981934, 0.216513991355896, -1.3695658445358276, 0.20746269822120667, -0.4707372486591339, 0.9862328171730042, 0.4145033061504364, 1.154099464416504, -1.7294120788574219, -0.023168042302131653, -0.2041948437690735, 0.1775553673505783, -1.26083242893219, -1.6022816896438599, 0.5528145432472229, 0.5554978251457214, 0.601890504360199, -0.09576037526130676, 0.8620476126670837, -1.1562128067016602, 0.9621570706367493, -0.9292665719985962, -1.673107385635376, -1.4747416973114014, -2.2833216190338135, -2.3016343116760254, 0.8957756161689758, -0.419436514377594, -0.41000232100486755, 1.9658972024917603, -1.0426714420318604, -1.7408740520477295, 1.1075454950332642, 0.27709051966667175, 0.10324754565954208, 2.337430953979492, 0.19383637607097626, -0.6905774474143982, 0.4051188826560974, -0.730368971824646, 0.8079525828361511, -0.41905680298805237, 1.4006507396697998, 0.4354619085788727, -0.9850791096687317, 1.6553268432617188, -0.46874532103538513, 0.4445556402206421, -0.6525205373764038, -0.5134417414665222, -0.8172982931137085, 0.4080466032028198, 1.904009461402893, -0.3039485216140747, 1.580519437789917, -0.35163575410842896, -1.5804550647735596, -1.5215498208999634, 0.8067891001701355, 0.539011538028717, -0.9097047448158264, 0.06499511003494263, -0.42845267057418823, 0.11667592823505402, -0.03713936731219292, 1.140092372894287, 1.1830089092254639, 0.7486018538475037, -0.31589004397392273, -0.9140040278434753, 0.20517562329769135, -0.13997608423233032, -0.6965517401695251, -1.7892627716064453, -0.3748319745063782, 0.22795431315898895, 0.6904920339584351, -1.2629684209823608, 1.7284713983535767, 0.9333550333976746, 1.9732365608215332, 1.0038838386535645, -0.3514566719532013, 1.4881752729415894, 0.06133024021983147, 1.8688442707061768, -0.6237396001815796, 0.6336953043937683, -0.35000479221343994, -1.1359432935714722, 0.8181009292602539, -0.43818336725234985, -2.0448360443115234, -0.7028415203094482, -0.8714425563812256, -0.1980665773153305, -0.8042709231376648, 0.930428683757782, -0.22208444774150848, -1.3409056663513184, 0.2692912518978119, -0.6900325417518616, 0.11026189476251602, -1.2029001712799072, 0.30344921350479126, 0.7554861307144165, -0.6534517407417297, 0.01322211604565382, -0.2676807940006256, -1.3773407936096191, -0.519732654094696, 0.3263014554977417, 1.8798612356185913, -0.7303504943847656, 0.9400191307067871, 0.9020313620567322, -0.6750706434249878, 0.0521916039288044, 0.4415549337863922, -0.4050332307815552, 0.8529430627822876, -1.0516140460968018, -0.442023903131485, 1.0639479160308838, -0.26748350262641907, -0.4813050627708435, 1.4261484146118164, 0.7446208596229553, -1.039919137954712, -0.32442766427993774, -0.2384004145860672, -0.81096351146698, -0.006051286123692989, -1.5687592029571533, -0.18859229981899261, 0.2631322145462036, -1.5223004817962646, -0.5274124145507812, -0.16966526210308075, 1.3425333499908447, -0.15392574667930603, 1.3852146863937378, -0.23575909435749054, -0.19618983566761017, -0.39798957109451294, -0.4458603858947754, 0.20734836161136627, -0.21161137521266937, -0.6531381011009216, 0.350011944770813, -0.8572169542312622, 0.34844616055488586, 1.4064507484436035, 0.3900769054889679, -0.03442104533314705, 0.4943802058696747, 1.066270112991333, 0.3379690647125244, -0.015836201608181, -0.8994987607002258, -1.5820192098617554, 2.0725605487823486, -1.5293476581573486, 1.9511176347732544, 0.8647814393043518, -0.01818094402551651, -1.8207989931106567, -1.8216270208358765, 1.3342957496643066, 1.2053258419036865, 2.4098458290100098, 0.534314751625061, 0.3427274227142334, -0.7429062724113464, -0.6773537993431091, 0.3986654579639435, -1.0247255563735962, -0.7711174488067627, 0.032638322561979294, 2.3321664333343506, 1.806649088859558, -0.5256389379501343, -0.2837078273296356, -0.9994075894355774, 1.3579410314559937, -0.15724298357963562, 0.14398841559886932, 2.08725905418396, -0.30522027611732483, -1.056092619895935, 1.3237978219985962, -2.410900831222534, 0.2511477768421173, 1.9802550077438354, 0.3148922324180603, 0.0438232384622097, -1.4596017599105835, -0.57354336977005, -0.24966226518154144, -0.3582451641559601, -1.1887003183364868, 0.5617080926895142, -0.26025331020355225, -0.9600629806518555, -1.5828332901000977, 0.013399946503341198, -1.2329691648483276, -1.6887996196746826, 0.412045419216156, 1.8374664783477783, 2.096096992492676, -0.7147263288497925, 1.4249234199523926, -0.18312226235866547, 0.09802959114313126, 1.238435983657837, 1.2891321182250977, 3.2245240211486816, 1.8721342086791992, -1.2555862665176392, 0.6214763522148132, -0.23488903045654297, -0.46755826473236084, 1.1058603525161743, -1.053706169128418, 1.1411083936691284, -0.2358800321817398, -1.1821759939193726, -1.1477546691894531, 1.0948150157928467, 0.5139812231063843, 0.002144917845726013, -0.4764471650123596, 1.140350103378296, 0.12162047624588013, 1.3399666547775269, 0.6025252938270569, -0.386355996131897, 0.5546836256980896, -0.4566324055194855, -0.49132758378982544, 1.5717626810073853, 0.1558341532945633, -1.4961456060409546, -2.3678877353668213, -0.1807507872581482, -0.9151166081428528, -0.01183433085680008, -0.614680826663971, -1.0557397603988647, 1.5953083038330078, 0.43448248505592346, -1.3113853931427002, -0.22466331720352173, -0.4006032347679138, -0.6578977108001709, 2.589531421661377, -1.4226105213165283, -0.19323326647281647, -1.0063376426696777, -0.5241435170173645, 1.5938376188278198, -1.1956980228424072, -0.20510578155517578, -1.0774073600769043, -0.6892524361610413, -1.2972975969314575, -0.6071102619171143, -0.0005740569904446602, -0.8291493654251099, 0.7228301763534546, 0.04691625386476517, -1.0359132289886475, -0.3115215003490448, -0.8964002132415771, 0.8056783080101013, -0.09355786442756653, 0.2523570954799652, 1.879021406173706, 0.3241381347179413, -0.38821572065353394, 0.7099804282188416, 1.2547013759613037, 0.6096124649047852, -0.5898734927177429, 0.15579557418823242, -0.6271592378616333, 0.31445005536079407, -1.3542866706848145, 0.3124220073223114, -2.863121271133423, 0.6495913863182068, -0.039615366607904434, -0.05545146390795708, -0.03458359092473984, -1.2825813293457031, 1.1389120817184448, 2.52912974357605, -1.1914560794830322, 0.4883608818054199, 0.29156485199928284, 1.1458842754364014, -1.6197413206100464, 0.27588483691215515, -0.4318038821220398, 2.1304917335510254, 0.17881031334400177, 1.1358267068862915, -0.5653801560401917, -2.1207869052886963, 0.5920536518096924, -1.2209337949752808, -1.0367735624313354, 0.687892496585846, -0.8596214652061462, 0.15168707072734833, -1.4911834001541138, -0.1046069860458374, -0.9308544397354126, -1.2417441606521606, 0.7006517648696899, 0.03070596605539322, 0.4333546757698059, -0.5982110500335693, 0.301814466714859, -2.0641942024230957, -1.3478727340698242, -0.1437552124261856, -0.965697705745697, 0.5430284738540649, -0.3013748526573181, 0.6492786407470703, -0.027767568826675415, 0.041557200253009796, 0.24485698342323303, 1.359025239944458, 3.4268970489501953, 0.16291356086730957, 0.4097655117511749, -0.11913785338401794, -0.9543961882591248, 1.4266459941864014, 0.9901022911071777, -0.0479605570435524, -0.6169281601905823, -1.0287625789642334, 1.381048560142517, 1.9533398151397705, 1.046440839767456, 0.17857199907302856, -0.8135636448860168, -0.7321098446846008, 0.015958108007907867, 0.21878355741500854, 0.5158259868621826, 0.9373835921287537, 0.0026287762448191643, 0.10607799142599106, 1.4383952617645264, 1.2472400665283203, -0.3408313989639282, 0.43143266439437866, -0.8605979084968567, -0.43686699867248535, 0.3674037754535675, 0.3436730206012726, 0.009110457263886929, 0.3867003619670868, -1.0208253860473633, -0.3006165027618408, -0.268101304769516, -0.9653648138046265, -0.6823461651802063, -0.44168391823768616, -0.34459584951400757, 1.657652497291565, 0.11645686626434326, -0.44484561681747437, -0.020991237834095955, -0.8169659972190857, -0.07218246161937714, -1.059657096862793, 0.2372857630252838, -0.09476292878389359, -0.04235716536641121, -0.21789850294589996, 1.7878482341766357, -0.8290243744850159, -2.0903637409210205, 0.16584312915802002, 0.26486220955848694, -0.42050620913505554, 0.146588996052742, 1.644097089767456, 0.57374507188797, 1.3890126943588257, 1.3465303182601929, 0.9741631150245667, -0.575884997844696, -1.2524662017822266, 0.648845374584198, 0.965112566947937, -1.445772647857666, 0.8906711935997009, -0.0718134418129921, -0.5056766867637634, 0.7219381928443909, 1.3320645093917847, 0.353822261095047, -1.9796900749206543, 0.817621111869812, -0.8968571424484253, 0.8027885556221008, 0.6438905596733093, 0.7597314119338989, 0.2905791997909546, 0.821601152420044, -1.3572509288787842, -1.0972895622253418, -0.800585150718689, -0.6143855452537537, 2.0652406215667725, -0.2000424861907959, 0.5122290849685669, -0.16463513672351837, -1.284663200378418, -0.2043791562318802, 0.6759468913078308, 0.3834690451622009, -0.3394666016101837, 0.8641200065612793, -0.7100226283073425, -1.1169860363006592, -1.3364067077636719, -0.3927706480026245, -0.9114117622375488, -0.8492003083229065, 1.061019778251648, 0.8613077998161316, 0.41525840759277344, 2.0196950435638428, 0.5207874178886414, 0.22203515470027924, -2.6490652561187744, 0.8317992687225342, 0.30161428451538086, -0.07699985057115555, 1.0530271530151367, 0.20970311760902405, 1.1968989372253418, 0.022490244358778, 0.5259974002838135, -2.3603708744049072, 2.1664304733276367, -0.2184741348028183, 0.7959381937980652, 0.0465753972530365, -0.2009851187467575, 1.167636513710022, 0.5321516394615173, 0.6454212665557861, -1.095956802368164, 0.7285634875297546, -0.5836100578308105, 1.1692363023757935, 1.0092005729675293, -0.7666334509849548, 0.011777128092944622, 1.2675073146820068, 0.464392751455307, -0.46429112553596497, -1.0163524150848389, -0.8467899560928345, 0.9087570309638977, 1.7916598320007324, -0.005174986552447081, 0.014874209649860859, 0.800207793712616, 0.7164523005485535, -1.311003565788269, 0.0830514132976532, -0.7461712956428528, -0.7504897713661194, 1.6574678421020508, 2.110880136489868, -0.021936610341072083, -0.20230846107006073, -0.7461127042770386, -1.3347442150115967, 0.6588180065155029, 0.013265629298985004, 0.16804395616054535, 0.672642707824707, -0.6924954652786255, 1.1347105503082275, 0.8715974688529968, 0.9299359321594238, -0.007759562227874994, 0.3345387876033783, 0.3263077437877655, -0.3120611906051636, -1.1816394329071045, -0.380410373210907, -1.1427687406539917, -2.517934560775757, 0.5316997766494751, -0.269903302192688, -1.4850465059280396, 0.008559112437069416, -1.0656815767288208, 0.8865492939949036, -0.5951289534568787, -1.1557198762893677, -1.5369502305984497, 0.3058834671974182, -0.09500882029533386, 0.9033395051956177, -1.6639091968536377, -0.13389615714550018, 1.1657724380493164, 0.8687959909439087, -0.49452587962150574, 0.9294488430023193, 0.30270013213157654, 1.0006614923477173, 0.8135724067687988, -0.3704296946525574, 0.4374266564846039, 0.23243069648742676, -1.3969393968582153, 0.43604323267936707, 1.1795153617858887, 0.16167721152305603, 1.3384921550750732, -0.49674558639526367, 0.2025485336780548, 0.4926539957523346, -0.507240355014801, -0.4762459099292755, -0.45476195216178894, 0.7274423241615295, 0.0617046095430851, -0.9072166681289673, -0.03632335364818573, -0.14013779163360596, -0.23082996904850006, 0.21505895256996155, -1.4712810516357422, -0.2859971225261688, -0.3416220247745514, -0.4977985918521881, -1.3054094314575195, -0.05357956141233444, 1.3682786226272583, -0.8227017521858215, -0.198688805103302, 0.5772576332092285, 0.38740211725234985, 0.623315691947937, 0.5986663103103638, -0.6089298725128174, -0.3982367515563965, -0.22894352674484253, -0.3720068037509918, 0.19512756168842316, 1.2788705825805664, -0.13210102915763855, -0.9442764520645142, 0.6374865174293518, -0.4656464755535126, 0.08600001782178879, 1.9770642518997192, 0.02206585183739662, -0.8104550242424011, 0.4039672315120697, -0.674961507320404, 1.817421555519104, 1.6319726705551147, 1.251747488975525, -0.08776131272315979, -0.9397053718566895, 0.6400679349899292, -0.23083879053592682, -0.3685894012451172, 0.8910539150238037, 0.444030225276947, -0.15033866465091705, -1.4242974519729614, 0.5163523554801941, 1.2972731590270996, -1.006929874420166, -0.7884417772293091, 0.20112186670303345, -0.9232733249664307, 1.1401933431625366, 0.6334331631660461, 0.4453251361846924, 0.1992570161819458, 1.659616470336914, 0.6826944351196289, -0.5101682543754578, 0.5267872214317322, 0.540062665939331, -0.2599703371524811, -2.0830113887786865, -1.0340150594711304, 0.2003047913312912, -0.37614184617996216, -1.5852329730987549, 1.308624505996704, -1.109987735748291, -0.9116794466972351, 0.5077762603759766, 0.10785219073295593, 1.35371994972229, 0.3363434672355652, 1.716997504234314, 2.019033908843994, 0.8495884537696838, 0.31510594487190247, 1.2841172218322754, -0.013347423635423183, -0.4712459146976471, 1.810014009475708, -0.44998735189437866, 0.6585217118263245, 1.1202678680419922, -0.3996051251888275, -1.1241121292114258, -0.7392908930778503, -1.0931925773620605, -0.6571142077445984, 1.1523910760879517, 0.16004543006420135, -1.1338002681732178, 0.2228301763534546, 1.6352529525756836, 0.08464614301919937, -0.2702469229698181, 0.5023319125175476, 0.4628590941429138, -0.6742531061172485, -0.10308083146810532, -0.9627589583396912, 0.46182283759117126, -0.19071732461452484, -0.32524973154067993, 0.2995968759059906, 0.4692230224609375, 1.262050747871399, -0.010696304962038994, 0.1354198306798935, 1.2084600925445557, -1.4659419059753418, 1.5411583185195923, -0.6639745831489563, 0.2847069203853607, -2.401041269302368, 1.471516489982605, -0.7964558601379395, 1.9405159950256348, -2.606827735900879, 0.3487163484096527, -0.621151328086853, -0.4651876389980316, 0.2692251205444336, -0.2713000774383545, 0.15777699649333954, -0.15333354473114014, -0.9765928983688354, -0.0010587070137262344, -0.7001901268959045, 0.5335215330123901, 1.1919233798980713, 1.3449981212615967, -1.100939393043518, -0.30861997604370117, -1.767014503479004, -0.12261614203453064, -0.7450997233390808, 0.26611465215682983, -1.9219961166381836, -0.10985707491636276, -1.8969192504882812, -2.258164405822754, -1.5137499570846558, -0.8377775549888611, 1.0363901853561401, 0.17146600782871246, -0.9102896451950073, 1.067747712135315, -0.32567766308784485, -1.7490630149841309, 1.0531905889511108, -2.2039437294006348 ]
https://github.com/huggingface/datasets/issues/3608
Add support for continuous metrics (RMSE, MAE)
You can use a local metric script just by providing its path instead of the usual shortcut name
**Is your feature request related to a problem? Please describe.** I am uploading our dataset and models for the "Constructing interval measures" method we've developed, which uses item response theory to convert multiple discrete labels into a continuous spectrum for hate speech. Once we have this outcome our NLP models conduct regression rather than classification, so binary metrics are not relevant. The only continuous metrics available at https://huggingface.co/metrics are pearson & spearman correlation, which don't ensure that the prediction is on the same scale as the outcome. **Describe the solution you'd like** I would like to be able to tag our models on the Hub with the following metrics: - RMSE - MAE **Describe alternatives you've considered** I don't know if there are any alternatives. **Additional context** Our preprint is available here: https://arxiv.org/abs/2009.10277 . We are making it available for use in Jigsaw's Toxic Severity Rating Kaggle competition: https://www.kaggle.com/c/jigsaw-toxic-severity-rating/overview . I have our first model uploaded to the Hub at https://huggingface.co/ucberkeley-dlab/hate-measure-roberta-large Thanks, Chris
994
18
Add support for continuous metrics (RMSE, MAE) **Is your feature request related to a problem? Please describe.** I am uploading our dataset and models for the "Constructing interval measures" method we've developed, which uses item response theory to convert multiple discrete labels into a continuous spectrum for hate speech. Once we have this outcome our NLP models conduct regression rather than classification, so binary metrics are not relevant. The only continuous metrics available at https://huggingface.co/metrics are pearson & spearman correlation, which don't ensure that the prediction is on the same scale as the outcome. **Describe the solution you'd like** I would like to be able to tag our models on the Hub with the following metrics: - RMSE - MAE **Describe alternatives you've considered** I don't know if there are any alternatives. **Additional context** Our preprint is available here: https://arxiv.org/abs/2009.10277 . We are making it available for use in Jigsaw's Toxic Severity Rating Kaggle competition: https://www.kaggle.com/c/jigsaw-toxic-severity-rating/overview . I have our first model uploaded to the Hub at https://huggingface.co/ucberkeley-dlab/hate-measure-roberta-large Thanks, Chris You can use a local metric script just by providing its path instead of the usual shortcut name
[ -1.221238374710083, -1.0120574235916138, -0.8475973010063171, 1.331917405128479, -0.17093883454799652, -1.3295485973358154, 0.0412827767431736, -1.0344730615615845, 1.6802759170532227, -0.7088550925254822, 0.35290810465812683, -1.6008448600769043, -0.02299042046070099, -0.6235030889511108, -0.8497353792190552, -0.7755857110023499, -0.3879598379135132, -0.8857537508010864, 0.8750231862068176, 2.5750746726989746, 1.1340895891189575, -1.4538339376449585, 2.6724421977996826, 0.6418750882148743, -0.1350954920053482, -1.012376070022583, 0.505820631980896, 0.0368538424372673, -1.2097920179367065, -0.5215396285057068, -0.9412728548049927, 0.007038688287138939, -0.5806465148925781, -0.4425164759159088, 0.13500669598579407, 0.355454683303833, -0.10818415135145187, -0.3502649664878845, -0.5351072549819946, -0.6646052002906799, 0.5414128303527832, -0.3826773166656494, 1.0308107137680054, -0.45867154002189636, 1.9312093257904053, -0.6068897247314453, 0.37033000588417053, 0.717366099357605, 1.4368218183517456, 0.2407444715499878, -0.07811170071363449, 0.252714067697525, 0.4259781539440155, 0.03108847141265869, 0.4387848377227783, 1.1335008144378662, 0.5888974070549011, 0.44616934657096863, 0.6848554611206055, -2.1468605995178223, 1.3222826719284058, -1.039536476135254, 0.2974027097225189, 1.392025351524353, -0.9056254625320435, 0.40214866399765015, -1.9121533632278442, -0.04938937723636627, 0.6174020171165466, -2.263514518737793, 0.16669540107250214, -1.2596367597579956, -0.5538070201873779, 1.0207266807556152, 0.1965821534395218, -1.418959379196167, 0.20192784070968628, -0.47060859203338623, 0.9386039972305298, 0.4802650213241577, 1.1765276193618774, -1.7107526063919067, -0.05145995691418648, -0.2517991065979004, 0.20804433524608612, -1.2856296300888062, -1.5352997779846191, 0.5372873544692993, 0.5245279669761658, 0.5710003972053528, -0.03428757190704346, 0.8632161021232605, -1.1517447233200073, 1.0119390487670898, -0.9682843089103699, -1.6287283897399902, -1.491564393043518, -2.2338290214538574, -2.3049700260162354, 0.8922079801559448, -0.43841463327407837, -0.4171518087387085, 1.912986397743225, -1.0471584796905518, -1.695918321609497, 1.1428643465042114, 0.28094735741615295, 0.13426178693771362, 2.3515212535858154, 0.15410266816616058, -0.6679598093032837, 0.4033900797367096, -0.7570742964744568, 0.810024619102478, -0.49325329065322876, 1.4176013469696045, 0.46949926018714905, -0.9667530059814453, 1.6810516119003296, -0.5284764170646667, 0.4210626482963562, -0.6329053640365601, -0.5408018827438354, -0.8847378492355347, 0.47541365027427673, 1.9078750610351562, -0.28190499544143677, 1.5980428457260132, -0.3728722631931305, -1.5699025392532349, -1.5170705318450928, 0.8696399927139282, 0.5120901465415955, -0.9436793923377991, 0.08831383287906647, -0.39176884293556213, 0.082944355905056, -0.08593226969242096, 1.0752758979797363, 1.1220656633377075, 0.7521430850028992, -0.32290780544281006, -0.9146739840507507, 0.20791113376617432, -0.15267647802829742, -0.7245795130729675, -1.8036869764328003, -0.41655460000038147, 0.19990098476409912, 0.720454216003418, -1.2852225303649902, 1.6711610555648804, 0.9823113083839417, 1.9821230173110962, 0.9857620000839233, -0.34929943084716797, 1.4539012908935547, 0.0647033154964447, 1.858117938041687, -0.6174814105033875, 0.6741278171539307, -0.3231590986251831, -1.1120527982711792, 0.8223629593849182, -0.4799605906009674, -2.0867767333984375, -0.7352201342582703, -0.8784818053245544, -0.21576902270317078, -0.7853258848190308, 0.943087637424469, -0.22107620537281036, -1.3658920526504517, 0.3003959357738495, -0.6830464601516724, 0.13857728242874146, -1.254645586013794, 0.38186928629875183, 0.7725205421447754, -0.6631290316581726, -0.008897462859749794, -0.2194874882698059, -1.3465583324432373, -0.49446555972099304, 0.27569568157196045, 1.9328354597091675, -0.7695739269256592, 0.8932940363883972, 0.8210980892181396, -0.6626002788543701, 0.04593074694275856, 0.45591771602630615, -0.4372839033603668, 0.813132643699646, -1.040771245956421, -0.45035362243652344, 1.075387716293335, -0.2574359178543091, -0.46988606452941895, 1.4452779293060303, 0.7732232809066772, -1.0210034847259521, -0.27371570467948914, -0.2630847692489624, -0.7808537483215332, -0.016997143626213074, -1.522611141204834, -0.14722158014774323, 0.23010890185832977, -1.5040558576583862, -0.5182507634162903, -0.1886744350194931, 1.3223797082901, -0.17723718285560608, 1.3526651859283447, -0.318507581949234, -0.22355379164218903, -0.41377314925193787, -0.40840303897857666, 0.2462075650691986, -0.24231575429439545, -0.6806148886680603, 0.3141205906867981, -0.8240882754325867, 0.386553555727005, 1.3543274402618408, 0.4597487151622772, -0.03799940645694733, 0.5118937492370605, 1.0667309761047363, 0.30837947130203247, 0.0018566865473985672, -0.9140620827674866, -1.527226209640503, 2.0840401649475098, -1.5568852424621582, 1.955496072769165, 0.8619709610939026, -0.06426869332790375, -1.8061341047286987, -1.7923142910003662, 1.2839913368225098, 1.198874592781067, 2.3605146408081055, 0.5612291693687439, 0.35773032903671265, -0.79469895362854, -0.678706705570221, 0.3948778808116913, -1.088894248008728, -0.7558631300926208, -0.055954787880182266, 2.3058860301971436, 1.8101900815963745, -0.5333905816078186, -0.2671981155872345, -0.9738751649856567, 1.3882453441619873, -0.17716911435127258, 0.1736152023077011, 2.091883420944214, -0.33871111273765564, -1.0648813247680664, 1.3067657947540283, -2.3979485034942627, 0.22353331744670868, 1.9708534479141235, 0.31587424874305725, 0.0551551952958107, -1.4791144132614136, -0.5541436672210693, -0.19668971002101898, -0.34215933084487915, -1.1660035848617554, 0.5382542610168457, -0.2863234877586365, -0.9685212969779968, -1.60611093044281, 0.08244094252586365, -1.2445039749145508, -1.6469337940216064, 0.46213042736053467, 1.840881109237671, 2.0751004219055176, -0.6957387924194336, 1.4394044876098633, -0.15339729189872742, 0.13720037043094635, 1.2727023363113403, 1.2657133340835571, 3.2031726837158203, 1.8525114059448242, -1.25408136844635, 0.5848853588104248, -0.2444409728050232, -0.47160616517066956, 1.0886385440826416, -1.0400323867797852, 1.1566026210784912, -0.22022342681884766, -1.145674467086792, -1.1054736375808716, 1.077133297920227, 0.511844277381897, 0.047769010066986084, -0.4918948709964752, 1.1694140434265137, 0.12273488938808441, 1.3749302625656128, 0.5992152690887451, -0.385733425617218, 0.5477378964424133, -0.4813009202480316, -0.46264737844467163, 1.5741146802902222, 0.17008784413337708, -1.4811831712722778, -2.3972318172454834, -0.19279637932777405, -0.9223906993865967, -0.007707776036113501, -0.5780880451202393, -1.044667363166809, 1.6470495462417603, 0.40546998381614685, -1.3408504724502563, -0.27694395184516907, -0.38243523240089417, -0.6500261425971985, 2.6197526454925537, -1.4632617235183716, -0.23084063827991486, -0.9856868386268616, -0.49748483300209045, 1.6358648538589478, -1.225818157196045, -0.1618422567844391, -1.1068450212478638, -0.7008182406425476, -1.3229011297225952, -0.6463614106178284, -0.02357887662947178, -0.8299277424812317, 0.769422173500061, 0.1234188824892044, -1.0148838758468628, -0.3509601056575775, -0.9058755040168762, 0.7607738971710205, -0.03518287092447281, 0.32042115926742554, 1.8404018878936768, 0.3312293291091919, -0.386773943901062, 0.7247635126113892, 1.2682782411575317, 0.6093663573265076, -0.5999178290367126, 0.13619345426559448, -0.5892646312713623, 0.3184189200401306, -1.3206731081008911, 0.3520311415195465, -2.8594844341278076, 0.6426700353622437, -0.05030565336346626, -0.07635357975959778, -0.05729861184954643, -1.2830959558486938, 1.2063887119293213, 2.529963493347168, -1.179916262626648, 0.4559868574142456, 0.2710632085800171, 1.2022536993026733, -1.6370922327041626, 0.3405199944972992, -0.43795302510261536, 2.1916117668151855, 0.20454593002796173, 1.1347665786743164, -0.5776978731155396, -2.1308376789093018, 0.5877856016159058, -1.203574538230896, -1.094201683998108, 0.6778897047042847, -0.8834161758422852, 0.1256900280714035, -1.5849277973175049, -0.12094917893409729, -0.9380349516868591, -1.2457753419876099, 0.7241098880767822, 0.05792733281850815, 0.4648972749710083, -0.6069748401641846, 0.30021896958351135, -2.070570707321167, -1.3913624286651611, -0.16110478341579437, -0.9313557147979736, 0.488467812538147, -0.2888725697994232, 0.6765635013580322, -0.00595730310305953, 0.06266842037439346, 0.2425641417503357, 1.3620299100875854, 3.403779983520508, 0.18410660326480865, 0.4567040503025055, -0.13710151612758636, -0.9380086064338684, 1.4466710090637207, 1.0075241327285767, 0.00801804382354021, -0.6121147871017456, -0.9645320773124695, 1.3879536390304565, 1.9530105590820312, 0.9946147799491882, 0.1351882964372635, -0.7453880310058594, -0.6451742649078369, -0.011408153921365738, 0.21551668643951416, 0.5167021155357361, 0.9244059920310974, 0.003897441551089287, 0.1165245920419693, 1.463686466217041, 1.2779765129089355, -0.38532575964927673, 0.4066276252269745, -0.7862862348556519, -0.4206274449825287, 0.43134188652038574, 0.3629053831100464, 0.010526622645556927, 0.39090821146965027, -1.0117298364639282, -0.30192264914512634, -0.25392308831214905, -1.0085837841033936, -0.6672646403312683, -0.45691707730293274, -0.3662514388561249, 1.658438801765442, 0.11566121876239777, -0.42439520359039307, -0.030408885329961777, -0.8249231576919556, -0.019695043563842773, -1.1104624271392822, 0.2037726789712906, -0.09583047032356262, -0.05670152232050896, -0.21163570880889893, 1.831824779510498, -0.8134384751319885, -2.05051851272583, 0.1870940923690796, 0.2876618504524231, -0.4139166474342346, 0.14059922099113464, 1.5937296152114868, 0.5122455358505249, 1.3769341707229614, 1.3203617334365845, 0.9368618726730347, -0.6001229286193848, -1.2327316999435425, 0.6318728923797607, 0.9872673153877258, -1.467340350151062, 0.8625256419181824, 0.029342196881771088, -0.5279746055603027, 0.7452430725097656, 1.3163611888885498, 0.32755041122436523, -1.9374687671661377, 0.8224249482154846, -0.8793044090270996, 0.8117491602897644, 0.6422705054283142, 0.7129802703857422, 0.3259512484073639, 0.8400014042854309, -1.3244826793670654, -1.1030807495117188, -0.8472527265548706, -0.5877703428268433, 2.0820772647857666, -0.2118062525987625, 0.48768100142478943, -0.08631764352321625, -1.2382653951644897, -0.1822325438261032, 0.6555111408233643, 0.3882037103176117, -0.22850069403648376, 0.8709372282028198, -0.7362908124923706, -1.1556166410446167, -1.3526878356933594, -0.37176430225372314, -0.8746579885482788, -0.866539478302002, 1.1151964664459229, 0.9078924059867859, 0.3695298731327057, 2.0254576206207275, 0.5502280592918396, 0.20708604156970978, -2.653348207473755, 0.8200721144676208, 0.29214170575141907, -0.0555843748152256, 1.039955973625183, 0.153627410531044, 1.217159628868103, 0.07850716263055801, 0.4894193410873413, -2.414340019226074, 2.123063325881958, -0.24059170484542847, 0.7761490345001221, 0.01611439138650894, -0.19677512347698212, 1.1728355884552002, 0.5416132211685181, 0.5868024826049805, -1.1069762706756592, 0.6734284162521362, -0.5917213559150696, 1.1793321371078491, 1.0530078411102295, -0.758190393447876, 0.014055001549422741, 1.2198587656021118, 0.4977809488773346, -0.4859883487224579, -1.0142827033996582, -0.8100774884223938, 0.8762749433517456, 1.8225090503692627, -0.016804911196231842, -0.036486923694610596, 0.8168414831161499, 0.7351782321929932, -1.2810617685317993, 0.11230863630771637, -0.7728387117385864, -0.7963364124298096, 1.6418105363845825, 2.1031124591827393, -0.022168317809700966, -0.1923232227563858, -0.7521098852157593, -1.3442234992980957, 0.6809000968933105, 0.007722550071775913, 0.20437775552272797, 0.6194153428077698, -0.7113384008407593, 1.1139540672302246, 0.8979620933532715, 0.9398927092552185, 0.019872181117534637, 0.3383994698524475, 0.34261777997016907, -0.3053552508354187, -1.1371049880981445, -0.33477985858917236, -1.165613055229187, -2.5791068077087402, 0.5452712178230286, -0.3268830180168152, -1.4661870002746582, 0.017526686191558838, -1.0546635389328003, 0.9269408583641052, -0.5706258416175842, -1.1537792682647705, -1.5586055517196655, 0.27012598514556885, -0.038401681929826736, 0.890880286693573, -1.654768705368042, -0.08558928221464157, 1.1942095756530762, 0.8523125052452087, -0.4729650616645813, 0.932417631149292, 0.37494945526123047, 1.0271570682525635, 0.7837441563606262, -0.4154569208621979, 0.44693687558174133, 0.22857879102230072, -1.419067621231079, 0.4547405242919922, 1.164336085319519, 0.17196349799633026, 1.381616473197937, -0.5165863633155823, 0.21117806434631348, 0.47785353660583496, -0.514045000076294, -0.4608173668384552, -0.5146233439445496, 0.7479607462882996, 0.06939440965652466, -0.9420149326324463, -0.00619659386575222, -0.19186726212501526, -0.2555737793445587, 0.2258068323135376, -1.4952341318130493, -0.32014867663383484, -0.3617662787437439, -0.5018488168716431, -1.2679822444915771, -0.06602896749973297, 1.3746631145477295, -0.7782061100006104, -0.16921839118003845, 0.6059847474098206, 0.41558173298835754, 0.6139621734619141, 0.6079822182655334, -0.598621666431427, -0.44196826219558716, -0.2396652102470398, -0.37232914566993713, 0.14826062321662903, 1.2750704288482666, -0.1722474843263626, -0.9574337005615234, 0.6322023868560791, -0.4530899226665497, 0.036706868559122086, 1.976869821548462, 0.06391146034002304, -0.8091259598731995, 0.4085015654563904, -0.7004995942115784, 1.81243896484375, 1.5851736068725586, 1.2512233257293701, -0.08524011075496674, -0.9014407992362976, 0.6512812972068787, -0.2455737590789795, -0.36293771862983704, 0.8868345022201538, 0.48158156871795654, -0.09173959493637085, -1.4137574434280396, 0.536731481552124, 1.262930989265442, -1.0537961721420288, -0.7978985905647278, 0.18468530476093292, -0.9252479672431946, 1.1472030878067017, 0.6548363566398621, 0.5229155421257019, 0.20431281626224518, 1.646627426147461, 0.69847172498703, -0.49534469842910767, 0.49563172459602356, 0.5837859511375427, -0.22449631989002228, -2.0731799602508545, -1.0278295278549194, 0.22016632556915283, -0.3855094909667969, -1.5569202899932861, 1.3305391073226929, -1.1089261770248413, -0.8774137496948242, 0.4998573958873749, 0.151035338640213, 1.3402200937271118, 0.3645187020301819, 1.7166451215744019, 2.0119571685791016, 0.8440138101577759, 0.2777172923088074, 1.3137598037719727, 0.012623935006558895, -0.46205899119377136, 1.831770896911621, -0.4406767785549164, 0.6583829522132874, 1.1513164043426514, -0.41762593388557434, -1.1030720472335815, -0.7520355582237244, -1.0793391466140747, -0.6507962346076965, 1.1468156576156616, 0.14416541159152985, -1.1402645111083984, 0.1794539988040924, 1.625541090965271, 0.05821859836578369, -0.2743309438228607, 0.43624716997146606, 0.46799761056900024, -0.6845875382423401, -0.11499249935150146, -0.9568518996238708, 0.39662227034568787, -0.16459809243679047, -0.3479362428188324, 0.30256640911102295, 0.4858408272266388, 1.2693349123001099, -0.051254432648420334, 0.14062264561653137, 1.2692036628723145, -1.4537007808685303, 1.4759372472763062, -0.6831427216529846, 0.22154176235198975, -2.412501096725464, 1.4486218690872192, -0.8273910880088806, 1.9429806470870972, -2.5866358280181885, 0.32770782709121704, -0.6371451020240784, -0.43094807863235474, 0.3165853023529053, -0.3052952289581299, 0.16095829010009766, -0.1527215838432312, -0.9835442304611206, 0.027377068996429443, -0.6728290319442749, 0.5085130929946899, 1.1383485794067383, 1.3342286348342896, -1.1194214820861816, -0.3258677124977112, -1.741960883140564, -0.10997302830219269, -0.7582964897155762, 0.31060951948165894, -1.9583964347839355, -0.08251828700304031, -1.9157170057296753, -2.1803653240203857, -1.525388479232788, -0.8395550847053528, 1.0733333826065063, 0.18758806586265564, -0.8707218170166016, 1.0132557153701782, -0.30550920963287354, -1.7138774394989014, 1.046397089958191, -2.1696648597717285 ]
https://github.com/huggingface/datasets/issues/3606
audio column not saved correctly after resampling
Hi ! We just released a new version of `datasets` that should fix this. I tested resampling and using save/load_from_disk afterwards and it seems to be fixed now
## Describe the bug After resampling the audio column, saving with save_to_disk doesn't seem to save with the correct type. ## Steps to reproduce the bug - load a subset of common voice dataset (48Khz) - resample audio column to 16Khz - save with save_to_disk() - load with load_from_disk() ## Expected results I expected that after saving the data, and then loading it back in, the audio column has the correct dataset.Audio type (i.e. same as before saving it) {'accent': Value(dtype='string', id=None), 'age': Value(dtype='string', id=None), 'audio': Audio(sampling_rate=16000, mono=True, _storage_dtype='string', id=None), 'client_id': Value(dtype='string', id=None), 'down_votes': Value(dtype='int64', id=None), 'gender': Value(dtype='string', id=None), 'locale': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'segment': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'up_votes': Value(dtype='int64', id=None)} ## Actual results Audio column does not have the right type {'accent': Value(dtype='string', id=None), 'age': Value(dtype='string', id=None), 'audio': {'bytes': Value(dtype='binary', id=None), 'path': Value(dtype='string', id=None)}, 'client_id': Value(dtype='string', id=None), 'down_votes': Value(dtype='int64', id=None), 'gender': Value(dtype='string', id=None), 'locale': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'segment': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'up_votes': Value(dtype='int64', id=None)} ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.17.0 - Platform: linux - Python version: - PyArrow version:
995
28
audio column not saved correctly after resampling ## Describe the bug After resampling the audio column, saving with save_to_disk doesn't seem to save with the correct type. ## Steps to reproduce the bug - load a subset of common voice dataset (48Khz) - resample audio column to 16Khz - save with save_to_disk() - load with load_from_disk() ## Expected results I expected that after saving the data, and then loading it back in, the audio column has the correct dataset.Audio type (i.e. same as before saving it) {'accent': Value(dtype='string', id=None), 'age': Value(dtype='string', id=None), 'audio': Audio(sampling_rate=16000, mono=True, _storage_dtype='string', id=None), 'client_id': Value(dtype='string', id=None), 'down_votes': Value(dtype='int64', id=None), 'gender': Value(dtype='string', id=None), 'locale': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'segment': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'up_votes': Value(dtype='int64', id=None)} ## Actual results Audio column does not have the right type {'accent': Value(dtype='string', id=None), 'age': Value(dtype='string', id=None), 'audio': {'bytes': Value(dtype='binary', id=None), 'path': Value(dtype='string', id=None)}, 'client_id': Value(dtype='string', id=None), 'down_votes': Value(dtype='int64', id=None), 'gender': Value(dtype='string', id=None), 'locale': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'segment': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'up_votes': Value(dtype='int64', id=None)} ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.17.0 - Platform: linux - Python version: - PyArrow version: Hi ! We just released a new version of `datasets` that should fix this. I tested resampling and using save/load_from_disk afterwards and it seems to be fixed now
[ -1.3430960178375244, -1.1578905582427979, -0.758400559425354, 1.7860935926437378, -0.2986602187156677, -0.9259240031242371, 0.08126549422740936, -0.9642009735107422, 1.477781891822815, -0.602222204208374, 0.1990954577922821, -1.5646151304244995, -0.07825441658496857, -0.7650704383850098, -0.6334887146949768, -0.8066398501396179, -0.28156787157058716, -0.7911815643310547, 1.2543941736221313, 2.4462881088256836, 1.1958062648773193, -1.5060052871704102, 2.8199682235717773, 0.9077052474021912, -0.06301429867744446, -1.184325098991394, 0.4904230833053589, -0.15547677874565125, -1.079023838043213, -0.6414474844932556, -0.9128745198249817, -0.07344114780426025, -0.5633729100227356, -0.32170331478118896, -0.09691710025072098, 0.49820810556411743, -0.1995449662208557, -0.49904999136924744, -0.5528222322463989, -0.7585212588310242, 0.5088798999786377, -0.49490466713905334, 0.7111311554908752, -0.11676768958568573, 1.7680456638336182, -0.3094818890094757, 0.23172038793563843, 0.548053503036499, 1.4081120491027832, 0.21022437512874603, 0.07014701515436172, 0.4954385757446289, 0.4387800097465515, -0.05961953103542328, 0.631499171257019, 1.0773543119430542, 0.858514666557312, 0.3039611279964447, 0.8162190914154053, -2.4045095443725586, 1.0752240419387817, -1.2270989418029785, 0.44751930236816406, 1.450884222984314, -0.8702410459518433, 0.6455224752426147, -1.7018662691116333, 0.030936378985643387, 0.6897577047348022, -2.0922441482543945, 0.44178229570388794, -1.073960304260254, -0.34816139936447144, 0.919961154460907, 0.4482753276824951, -1.3309684991836548, 0.06858309358358383, -0.3372544050216675, 1.1092780828475952, 0.18314413726329803, 0.9137652516365051, -1.681897759437561, 0.10923423618078232, -0.24655155837535858, 0.049682486802339554, -1.2425274848937988, -1.4744272232055664, 0.3855125904083252, 0.3915659785270691, 0.6702761650085449, -0.1937275230884552, 1.1004670858383179, -1.206576943397522, 0.6289946436882019, -1.0880217552185059, -1.6558291912078857, -1.4454524517059326, -2.501321792602539, -2.1510939598083496, 0.6413002610206604, -0.3310721516609192, -0.5578584671020508, 1.9932262897491455, -0.8492835760116577, -1.7523348331451416, 1.3800232410430908, 0.42144569754600525, 0.07239381223917007, 2.5490267276763916, 0.13527865707874298, -0.7476987242698669, 0.503101110458374, -0.8896654844284058, 0.7335511445999146, -0.5415335893630981, 1.5490390062332153, 0.4036668837070465, -0.7925218343734741, 1.7040181159973145, -0.39598503708839417, 0.4908353090286255, -0.7276358604431152, -0.4032514691352844, -0.906934916973114, 0.4223387539386749, 1.8926852941513062, -0.11199668794870377, 1.3033541440963745, -0.5113908648490906, -1.4455534219741821, -1.5005288124084473, 1.0543897151947021, 0.29459062218666077, -0.9297149181365967, 0.2785308361053467, -0.43822699785232544, 0.3399461507797241, -0.17260313034057617, 1.1758508682250977, 1.2723802328109741, 0.4877123534679413, -0.33091944456100464, -0.9256730675697327, 0.1476026475429535, -0.27600428462028503, -0.5842220783233643, -1.7932454347610474, -0.229981929063797, 0.021629296243190765, 0.6934981346130371, -1.2990694046020508, 1.5173298120498657, 0.9275861978530884, 1.7921019792556763, 1.0772995948791504, -0.49385786056518555, 1.5776677131652832, 0.09258117526769638, 1.8406776189804077, -0.708808183670044, 0.6695214509963989, -0.3890286386013031, -1.1739801168441772, 0.8506205677986145, -0.20394723117351532, -2.0139577388763428, -0.8063947558403015, -0.8026085495948792, -0.37362122535705566, -0.8080605268478394, 0.8840048909187317, -0.504595160484314, -1.4409573078155518, 0.2756408154964447, -0.8915093541145325, 0.42224323749542236, -1.0215210914611816, 0.4706087112426758, 0.7394489049911499, -0.5240143537521362, 0.07339804619550705, -0.2784152030944824, -1.2460118532180786, -0.4997178316116333, 0.5348716378211975, 1.859958529472351, -0.8703423142433167, 0.5893303751945496, 1.0487196445465088, -0.5910202264785767, 0.0996752381324768, 0.24884402751922607, -0.18357209861278534, 0.8605244159698486, -1.0288057327270508, -0.8528387546539307, 1.2149791717529297, -0.31012657284736633, -0.5805702805519104, 1.324195146560669, 0.8273196220397949, -1.0588276386260986, -0.3500937223434448, -0.15727302432060242, -0.8552836179733276, 0.11901145428419113, -1.6104166507720947, -0.18447744846343994, 0.6088606119155884, -1.614598274230957, -0.4758565425872803, -0.2723398506641388, 1.3785393238067627, -0.04801133647561073, 1.4887844324111938, -0.41561123728752136, -0.0418071411550045, -0.09480762481689453, -0.3617539405822754, 0.3605520725250244, -0.27228838205337524, -0.5793043971061707, -0.02618444710969925, -0.8143740892410278, 0.47128814458847046, 1.4123557806015015, 0.3320038914680481, 0.09708285331726074, 0.6133859753608704, 1.1591728925704956, 0.5729011297225952, 0.2432561218738556, -0.7855472564697266, -1.534348726272583, 1.9168360233306885, -1.6965898275375366, 2.0758144855499268, 0.6174435019493103, 0.021865949034690857, -1.5298980474472046, -1.7659012079238892, 1.3732542991638184, 1.1503866910934448, 2.1854875087738037, 0.6526608467102051, 0.42525914311408997, -1.0455513000488281, -0.7254161238670349, 0.010101835243403912, -0.9195826649665833, -0.8300281763076782, 0.14334332942962646, 2.5832254886627197, 1.8961865901947021, -0.36006322503089905, -0.2201128751039505, -0.8898328542709351, 1.6352711915969849, -0.29603174328804016, 0.29050973057746887, 2.022756814956665, -0.057212863117456436, -1.0731950998306274, 1.1603198051452637, -2.6674692630767822, 0.2387199103832245, 2.0027034282684326, 0.39433103799819946, 0.27619850635528564, -1.401079773902893, -0.7501051425933838, -0.0881047397851944, -0.5019217133522034, -1.2753407955169678, 0.4564807713031769, -0.3533828854560852, -0.6948673725128174, -1.4469553232192993, 0.24090376496315002, -1.1066616773605347, -1.474818229675293, 0.20769567787647247, 1.935846209526062, 2.2258825302124023, -0.8418369293212891, 1.7657631635665894, -0.018292058259248734, 0.30574706196784973, 1.293196201324463, 1.2313073873519897, 2.84704852104187, 1.8694229125976562, -1.2482460737228394, 0.34142276644706726, -0.1952309012413025, -0.5017710328102112, 1.063983678817749, -1.1912089586257935, 1.2019422054290771, -0.03530032932758331, -1.14145028591156, -1.1760742664337158, 0.8660569190979004, 0.6282238960266113, -0.14014442265033722, -0.47069206833839417, 1.0606554746627808, -0.0909719243645668, 1.2563430070877075, 0.7282025218009949, -0.3347720503807068, 0.3825952410697937, -0.4188452661037445, -0.5687882304191589, 1.501287579536438, 0.032181836664676666, -1.354779839515686, -2.1071972846984863, -0.11888522654771805, -0.8328075408935547, -0.056706152856349945, -0.5683385133743286, -0.9702971577644348, 1.420332670211792, 0.21577681601047516, -1.0763765573501587, -0.21230070292949677, -0.2614442706108093, -0.44571253657341003, 2.7141847610473633, -1.3157093524932861, -0.5313762426376343, -0.9506816864013672, -0.6458051204681396, 1.6454102993011475, -1.0253045558929443, -0.2729240655899048, -1.1162763833999634, -0.6558843851089478, -1.261802315711975, -0.44986632466316223, 0.01331534143537283, -0.7859101295471191, 0.9282914996147156, 0.5168387293815613, -1.225268840789795, -0.3826412260532379, -0.9051085710525513, 0.9565157890319824, -0.09443997591733932, 0.1559194028377533, 1.7656413316726685, 0.33901089429855347, -0.36542314291000366, 1.0388023853302002, 1.1051360368728638, 0.6297974586486816, -0.5320218205451965, 0.2396644651889801, -0.45610859990119934, 0.3565252125263214, -1.3614201545715332, 0.30774566531181335, -2.8961520195007324, 0.5736068487167358, 0.09505200386047363, -0.08396951854228973, -0.04207605868577957, -1.3634757995605469, 1.1442234516143799, 2.3681817054748535, -1.1857490539550781, 0.6448615193367004, 0.34287479519844055, 1.4132269620895386, -1.9438406229019165, 0.2145768702030182, -0.3858200013637543, 2.141378402709961, 0.15955355763435364, 1.240092158317566, -0.4847399890422821, -2.6113290786743164, 0.4433988928794861, -1.4181921482086182, -1.029455304145813, 0.4226212203502655, -0.9587783217430115, 0.2045571357011795, -1.6890630722045898, -0.35849982500076294, -0.9672367572784424, -1.2215124368667603, 0.6636798977851868, 0.23992353677749634, 0.10499706864356995, -0.5070100426673889, 0.3845485746860504, -2.181382656097412, -1.4138025045394897, -0.08595932275056839, -0.834122359752655, 0.4981355667114258, -0.5442475080490112, 0.8066439628601074, -0.19451914727687836, -0.09039842337369919, 0.2554263174533844, 1.5215071439743042, 3.2836294174194336, 0.209462970495224, 0.5428584218025208, -0.259112685918808, -0.8583725690841675, 1.543647050857544, 0.8624324798583984, -0.23376332223415375, -0.48083925247192383, -1.2711292505264282, 1.5027241706848145, 1.8521502017974854, 0.9053514003753662, 0.05656047165393829, -0.6349638104438782, -0.5708805322647095, -0.09942507743835449, 0.35069817304611206, 0.5338123440742493, 0.8180361390113831, -0.19688524305820465, -0.11122790724039078, 1.3375475406646729, 1.0851194858551025, -0.5219195485115051, 0.2811504602432251, -0.8411389589309692, -0.4288996160030365, 0.5246690511703491, 0.019800491631031036, -0.23591358959674835, 0.2590125501155853, -0.9033349752426147, -0.1901378482580185, -0.3304922878742218, -0.778753399848938, -0.6661773324012756, -0.32869860529899597, -0.335851788520813, 1.4609440565109253, 0.5050926804542542, -0.6857286095619202, -0.22360895574092865, -0.7076573371887207, -0.15213069319725037, -1.0886019468307495, 0.05755481868982315, -0.13727958500385284, -0.23532676696777344, -0.29485467076301575, 1.742982029914856, -0.777239978313446, -2.1972529888153076, 0.017157670110464096, 0.4224356412887573, -0.022256281226873398, 0.364948570728302, 1.7805198431015015, 0.45627617835998535, 1.32094144821167, 1.299548864364624, 0.9879356622695923, -0.5389044284820557, -1.414388656616211, 0.7582183480262756, 1.2104253768920898, -1.3525258302688599, 0.7592605352401733, -0.0555121935904026, -0.4327162504196167, 0.5376050472259521, 1.4755326509475708, 0.4546879529953003, -2.015374183654785, 0.9014816880226135, -1.1560783386230469, 1.1192470788955688, 0.7252050638198853, 0.576947033405304, 0.3249194622039795, 0.8222624659538269, -1.2549318075180054, -1.1187384128570557, -0.7858166098594666, -0.819613516330719, 2.143669366836548, -0.34815531969070435, 0.5962302088737488, -0.08969760686159134, -1.3597391843795776, 0.06525658816099167, 0.6026601195335388, 0.22341293096542358, -0.5481542944908142, 0.8622098565101624, -0.8024275302886963, -1.3212599754333496, -1.2608401775360107, -0.4248541295528412, -0.9782891273498535, -1.0287606716156006, 1.126733660697937, 0.8109962940216064, -0.02494864910840988, 1.7642022371292114, 0.6797254085540771, 0.11569700390100479, -2.48065185546875, 0.8887943625450134, 0.2797505259513855, -0.11313275247812271, 0.6235178112983704, 0.43670952320098877, 1.1235541105270386, 0.2085075080394745, 0.5057421326637268, -2.412677526473999, 2.280900716781616, -0.11909105628728867, 0.8590611815452576, -0.17442743480205536, -0.07285597175359726, 1.1110721826553345, 0.5326666235923767, 0.5603265166282654, -0.7329139113426208, 0.5207827091217041, -0.48409509658813477, 1.3546066284179688, 1.025412917137146, -0.8393677473068237, -0.10308703035116196, 1.256073236465454, 0.27987444400787354, -0.7802035212516785, -0.9973540306091309, -0.8593765497207642, 0.9141483902931213, 1.6956943273544312, -0.009945474565029144, 0.058097049593925476, 0.7908076643943787, 0.5919962525367737, -1.1735936403274536, -0.002931518480181694, -0.5746617913246155, -0.6302162408828735, 1.8342305421829224, 1.9891269207000732, -0.4885697364807129, -0.2007002979516983, -0.5372680425643921, -1.4759197235107422, 0.6616749167442322, -0.17075303196907043, 0.12129420787096024, 0.6652854084968567, -0.587824821472168, 0.7810575366020203, 0.8255650997161865, 0.7780030369758606, 0.09830720722675323, 0.15714772045612335, 0.5201243758201599, -0.6134353280067444, -1.0422508716583252, -0.2594343423843384, -1.3812772035598755, -2.560638904571533, 0.2197120636701584, -0.06574501842260361, -1.1990493535995483, 0.15634183585643768, -0.9258977770805359, 1.2228938341140747, -0.5065923929214478, -1.229744553565979, -1.2586569786071777, 0.13761764764785767, 0.03192676231265068, 0.7709188461303711, -1.7975268363952637, -0.023101869970560074, 1.20368492603302, 0.8796184659004211, -0.7259921431541443, 0.9746967554092407, 0.2502473294734955, 1.2606244087219238, 0.6400160789489746, -0.27904000878334045, 0.522061824798584, -0.168930321931839, -1.33413565158844, 0.6080389022827148, 1.1158733367919922, 0.08668334037065506, 1.4666739702224731, -0.4965519607067108, -0.16731053590774536, 0.3332480192184448, -0.684642493724823, -0.4041692614555359, -0.22836235165596008, 0.5101929903030396, 0.005937126465141773, -0.6681131720542908, 0.004907530732452869, 0.09327412396669388, -0.3369303047657013, 0.021426599472761154, -1.5281380414962769, -0.1585598886013031, -0.5335057377815247, -0.38468560576438904, -1.2536286115646362, -0.19090241193771362, 1.224103331565857, -0.5108558535575867, -0.4407857358455658, 0.6200443506240845, 0.2643180191516876, 0.4868001639842987, 0.6305259466171265, -0.667980432510376, -0.3491010069847107, -0.013431146740913391, -0.3432682454586029, 0.24585172533988953, 1.4240080118179321, -0.12066685408353806, -0.955292820930481, 0.6740768551826477, -0.28427231311798096, 0.08840391039848328, 1.5291023254394531, -0.12061578780412674, -0.8359596729278564, 0.17606468498706818, -0.876312255859375, 1.9803136587142944, 1.5571123361587524, 1.3086761236190796, -0.4498601257801056, -0.7596820592880249, 0.7633724808692932, -0.5522134900093079, -0.464081734418869, 0.6805001497268677, 0.565571129322052, -0.19630391895771027, -1.430290937423706, 0.8573907017707825, 1.1640739440917969, -0.7084550261497498, -0.7930847406387329, 0.26508966088294983, -0.6613707542419434, 1.2189218997955322, 0.6152307391166687, 0.37314775586128235, 0.26683786511421204, 1.801771640777588, 0.8262246251106262, -0.5408809781074524, 0.6493972539901733, 0.5822327136993408, -0.3330822288990021, -2.1763031482696533, -1.2756720781326294, 0.15786628425121307, -0.49956685304641724, -1.6629098653793335, 1.2798908948898315, -1.017160177230835, -0.8613433241844177, 0.6654229164123535, 0.14262160658836365, 1.27811598777771, 0.5008267760276794, 1.3113981485366821, 1.959169864654541, 0.6014063358306885, 0.5642998218536377, 1.087039589881897, -0.14892518520355225, -0.4177355468273163, 1.7988255023956299, -0.24972209334373474, 0.5687621235847473, 1.1412842273712158, -0.20772439241409302, -1.2678194046020508, -0.6717470288276672, -1.3962520360946655, -0.6446495056152344, 1.1382890939712524, 0.12873299419879913, -1.0111191272735596, 0.2887234389781952, 1.5689181089401245, -0.02097228169441223, -0.5663111805915833, 0.7055771350860596, 0.3701438903808594, -0.8802386522293091, -0.028823476284742355, -0.8632286787033081, 0.43965664505958557, -0.26728910207748413, -0.20071129500865936, 0.4867044985294342, 0.43589547276496887, 1.4471702575683594, 0.15954448282718658, 0.22836579382419586, 0.9407135248184204, -1.3421036005020142, 1.5496325492858887, -0.8048701882362366, 0.44823163747787476, -2.2864935398101807, 1.3427152633666992, -0.6680173873901367, 2.0931460857391357, -2.7079834938049316, 0.5590811967849731, -0.6853843331336975, -0.499214231967926, 0.3329813480377197, -0.3015820384025574, -0.027576107531785965, -0.08909709751605988, -1.122780680656433, 0.23908424377441406, -0.4470844268798828, 0.3347005248069763, 1.3437308073043823, 1.1919209957122803, -1.0179237127304077, -0.14675261080265045, -1.759091854095459, -0.20975324511528015, -0.9110821485519409, 0.28762638568878174, -2.129215955734253, -0.4338964521884918, -1.8271369934082031, -2.022557020187378, -1.0482416152954102, -0.8272583484649658, 1.3377407789230347, 0.09275434166193008, -0.8466646075248718, 1.5271462202072144, -0.3652172386646271, -1.6384296417236328, 0.8934744000434875, -2.003497362136841 ]