html_url
stringlengths 48
51
| title
stringlengths 5
268
| comments
stringlengths 63
51.8k
| body
stringlengths 0
36.2k
β | comment_length
int64 16
1.52k
| text
stringlengths 164
54.1k
| embeddings
sequence |
---|---|---|---|---|---|---|
https://github.com/huggingface/datasets/issues/1831 | Some question about raw dataset download info in the project . | Sure it would be nice to have an easier access to these paths !
The dataset builder could have a method to return those, what do you think ?
Feel free to work on this @albertvillanova , it would be a nice addition :)
Your suggestion does work as well @albertvillanova if you complete it by specifying `etag=` to `hash_url_to_filename`.
The ETag is obtained by a HEAD request and is used to know if the file on the remote host has changed. Therefore if a file is updated on the remote host, then the hash returned by `hash_url_to_filename` is different. | Hi , i review the code in
https://github.com/huggingface/datasets/blob/master/datasets/conll2003/conll2003.py
in the _split_generators function is the truly logic of download raw datasets with dl_manager
and use Conll2003 cls by use import_main_class in load_dataset function
My question is that , with this logic it seems that i can not have the raw dataset download location
in variable in downloaded_files in _split_generators.
If someone also want use huggingface datasets as raw dataset downloader,
how can he retrieve the raw dataset download path from attributes in
datasets.dataset_dict.DatasetDict ? | 100 | Some question about raw dataset download info in the project .
Hi , i review the code in
https://github.com/huggingface/datasets/blob/master/datasets/conll2003/conll2003.py
in the _split_generators function is the truly logic of download raw datasets with dl_manager
and use Conll2003 cls by use import_main_class in load_dataset function
My question is that , with this logic it seems that i can not have the raw dataset download location
in variable in downloaded_files in _split_generators.
If someone also want use huggingface datasets as raw dataset downloader,
how can he retrieve the raw dataset download path from attributes in
datasets.dataset_dict.DatasetDict ?
Sure it would be nice to have an easier access to these paths !
The dataset builder could have a method to return those, what do you think ?
Feel free to work on this @albertvillanova , it would be a nice addition :)
Your suggestion does work as well @albertvillanova if you complete it by specifying `etag=` to `hash_url_to_filename`.
The ETag is obtained by a HEAD request and is used to know if the file on the remote host has changed. Therefore if a file is updated on the remote host, then the hash returned by `hash_url_to_filename` is different. | [
-0.1199874282,
-0.1007267535,
-0.0441225916,
0.5240061283,
0.043897938,
-0.1413998455,
0.1183404624,
0.0170495324,
0.0113149034,
0.1344253123,
-0.3461933136,
0.1511437446,
-0.1354891062,
0.5920692682,
0.1894117892,
-0.037962798,
-0.084184438,
0.1217007935,
-0.1077714339,
-0.0879006833,
-0.3565677106,
0.2822727263,
-0.2687030733,
0.1657117009,
-0.1946667731,
-0.0248462893,
-0.0181012452,
0.3191280961,
-0.4727252126,
-0.2737629116,
0.3005142212,
0.2128323019,
0.4005344212,
0.174207598,
-0.0001249203,
0.0375020877,
0.2728614211,
-0.340290308,
-0.5269050598,
-0.2696055174,
-0.6916823387,
-0.0082495231,
-0.0579736531,
-0.2070540935,
0.1547249705,
0.0112638101,
-0.0531005561,
-0.1325003952,
0.085832417,
0.1186292842,
0.051858373,
0.3697147071,
-0.0970059633,
0.0601941161,
0.3183318377,
0.2908331752,
0.0077933664,
0.1266433448,
-0.0761737674,
0.3405935168,
0.105688341,
0.3024418056,
0.2225825191,
0.1028110161,
0.440628171,
0.337348938,
-0.3781243861,
-0.2769118845,
0.0373097137,
0.2423308045,
0.3537123203,
-0.281283915,
-0.5841251016,
-0.4083460271,
-0.1191255301,
-0.4685431123,
0.1080774441,
0.1214453205,
-0.4281235933,
0.3086462021,
-0.5675063729,
-0.4780253172,
-0.1658398211,
-0.0852147713,
-0.137549758,
0.3164403141,
-0.277533859,
0.0663057417,
0.0792563632,
0.3843625784,
0.2701305151,
-0.2281225622,
-0.021869611,
0.2174347192,
-0.1073610336,
-0.1102791801,
-0.0512241013,
0.2954007685,
0.1776960194,
0.0195231233,
-0.1246259287,
-0.2577975988,
-0.0622395873,
0.0344965495,
0.3408127725,
0.033426296,
0.1301031113,
0.2412094623,
0.2612253726,
0.1766109765,
0.1660883427,
-0.2614011765,
-0.1151488572,
-0.0674979389,
-0.346203208,
0.1671790928,
0.0185233913,
-0.1103437692,
-0.1785896719,
-0.2391813397,
-0.0279652346,
-0.3496949971,
0.3141700327,
0.3573301435,
-0.1220672801,
0.0427074619,
-0.1295643151,
-0.0033857361,
0.1085047051,
-0.3434870243,
-0.0575917661,
-0.2041843832,
-0.1811353713,
0.1146544591,
-0.2467758358,
-0.1190599576,
0.3445104361,
0.0368778855,
0.0044908337,
0.051166743,
-0.0212293305,
-0.0554250591,
0.2633834779,
0.1153133512,
0.0225036237,
0.2498402894,
-0.1723192334,
-0.2595722377,
-0.1941956878,
-0.140134111,
-0.3265099227,
-0.4692921937,
-0.0550041534,
-0.0365223996,
-0.139764294,
0.0882557184,
-0.204592064,
-0.0359488279,
-0.0043264558,
0.2903864384,
0.0153337354,
0.0368745513,
-0.4375741184,
-0.2614072859,
0.4150720835,
0.5498960018,
-0.2640759051,
-0.1248824596,
0.1626145244,
-0.4113041461,
0.0055076019,
0.0851147473,
-0.3762218356,
0.4481259584,
-0.3954285681,
-0.1491191536,
0.4284543693,
-0.3486126959,
-0.2835325599,
0.5134189129,
0.0685736537,
-0.0092669204,
0.4227089584,
0.0049934643,
0.3071329892,
-0.083153978,
-0.0749481767,
0.5160323381,
0.1115893349,
-0.1125850081,
-0.0146317426,
-0.2521876395,
-0.156272918,
-0.086976327,
-0.0983392745,
0.2540660203,
0.1340302974,
-0.1878970414,
0.5806202888,
-0.0906960815,
0.2048040181,
0.2849577069,
0.0666124746,
0.1446065158,
-0.0434156433,
0.0592398196,
-0.6398254633,
0.2061687261,
-0.27134794,
-0.2402376086,
-0.3789280951,
-0.332102865,
-0.2896722257,
0.1395772696,
-0.2251722068,
-0.3142987192,
-0.0874107704,
0.1475147158,
0.4725337327,
0.0423081778,
-0.3148837686,
0.5093702078,
-0.0809044763,
0.1222967207,
-0.1639379412,
0.0552343763,
0.1615950465,
0.1928499639,
-0.0075580771,
0.0963907912,
0.1178839654,
-0.1511209458,
0.0378696099,
0.4245798588,
0.1222039685,
0.2514210641,
0.3347154558,
0.0576164536,
0.2651586831,
0.145898208,
-0.005686318,
-0.2740899026,
0.0745327547,
0.2104530931,
0.0384138972,
0.4083468616,
-0.0198513381,
0.2785646915,
0.1696807742,
-0.0084310509,
0.103900522,
-0.0308021307,
0.1452544779,
-0.16566208,
-0.1733823717,
0.1735543758,
0.3252805471,
0.090826869,
-0.2493946105,
0.2692504227,
0.4680550992,
-0.0680285767,
-0.3477776051,
0.1148413867,
-0.269121021,
-0.0557167158,
0.124627769,
0.8814337254,
0.401753217,
0.0123439748,
0.2361503541,
0.0718543082,
0.2702479362,
-0.0683172941,
0.3649233282,
0.0819863304,
-0.0913175568,
-0.0149566615,
-0.4808921218,
-0.1915662736,
0.1524692923,
-0.0226062592,
0.182738319,
0.1612288505,
-0.3683392107,
0.0330823101,
-0.2861865759,
-0.3713717163,
-0.2221477032,
-0.1441485584,
-0.0842058137,
-0.1802143902,
-0.2356018722,
-0.0917688236,
-0.1567490697,
-0.2011982948,
-0.1180165634,
0.0290221144,
-0.2226624936,
0.0688053742,
-0.1916801631,
-0.155370757,
-0.0985752344,
-0.090702273,
0.1838147342,
-0.039756719,
0.0875818804,
-0.4963956177,
0.146994248,
-0.3051645458,
0.2047580481,
0.3494756222,
0.0336925462,
0.1768495888,
0.4060947895,
0.2000523955,
-0.0665530637,
0.0030450495,
-0.1094023585,
0.0911623165,
-0.1093044356,
-0.3894090354,
0.1404078752,
0.0943237543,
-0.0475682616,
-0.2293681651,
-0.692969501,
-0.0416316688,
0.2408768982,
-0.1981219798,
0.2762157917,
-0.1055138856,
-0.137817651,
0.0386814289,
-0.4083719552,
-0.0131056393,
-0.186048165,
-0.8774710894,
0.2753804922,
-0.354498446,
-0.2303793132,
-0.0539297238,
-0.0597017482,
0.1787717789,
0.0648877621,
-0.2197256684,
-0.0151434699,
-0.1151275337,
0.2784602642,
0.1276265979,
0.2927651703,
0.0518943183,
-0.0566531122,
0.1648828238,
-0.1588712335,
-0.0507450439,
0.237091586,
-0.3477134705,
0.3656215072,
0.4061175585,
-0.0131742749,
0.2261143327,
0.7650011182,
0.1852659285,
-0.078365691,
0.1470416784,
-0.1283285767,
0.3387123346,
0.3169539869,
-0.1909826994,
-0.045426432,
-0.0715170205,
-0.0789539292,
0.1751826257,
0.1232248917,
0.2392904162,
-0.2906845808,
-0.2120725513,
-0.1655000895,
-0.1859313995,
-0.114814207,
0.5175090432,
0.1606006622,
0.1139921099,
0.2111281455,
-0.1149086878,
0.0466601662,
0.0916074738,
0.3727548718,
0.4440425336,
0.1854566634,
-0.1331202537,
0.0172862653,
-0.2204595208,
0.0872579962,
0.3334241211,
-0.1385307908,
0.1563545316,
0.0564961396,
0.1949282438,
0.1494935751,
0.7233955264,
-0.0107272603,
-0.0319373123,
-0.2197544873,
-0.2569633126,
-0.0265562199,
0.1234021038,
-0.0482272394,
0.0339765511,
0.4549546242,
0.2488845587,
-0.3597501516,
-0.362392813,
0.154603973,
0.1162099466,
-0.2746769488,
-0.1146765351,
-0.083312057,
-0.0899408981,
-0.1801081449,
-0.2004743069,
0.0539677292,
0.0568369329,
-0.0310870484,
-0.0269084219,
0.1527350247,
0.1428884715,
-0.0335353613,
0.1749983281,
0.3482395113,
-0.0658728629,
-0.0234587602,
0.4482235312,
0.4415013194,
0.1750421524,
0.4515221715,
-0.3798856735,
-0.1904300451,
-0.0910221264,
0.0152671253,
0.6671975255,
0.2702570558,
-0.4598639309,
0.0253375266,
0.092191346,
-0.0970598087,
-0.4243960381,
0.2011387199,
0.283462733,
-0.0252957884,
-0.1949805766,
-0.6230822802,
0.4908493161,
-0.112314865,
-0.2402644008,
0.1811757237,
0.1288717985,
-0.3148918748,
-0.1643145233,
-0.0058824173,
0.8531173468,
0.1205511689,
0.1551861614,
0.1111790165,
-0.4877260625,
0.5681894422,
-0.1102226675,
-0.1549277306,
-0.262286365,
-0.0139864292,
-0.2005353272,
-0.2348828465,
-0.0075674085,
-0.0535391681,
0.0036481684,
0.3770988584,
0.0088333404,
0.0962402672,
0.0190935321,
0.5144584179,
-0.0574415103,
-0.1568572372,
0.1019323245,
-0.1120366752,
0.2022066563,
0.4311727285,
-0.0611430369,
-0.5024575591,
-0.2511903942,
0.0823461562,
-0.0367888883,
-0.0575544238,
-0.4359022975,
-0.0646283031,
0.1010860726,
-0.3668348491,
-0.1016822904,
0.5698289871,
0.2479191422,
0.0213812534,
-0.2106356919,
0.1094161719,
-0.0936088935,
0.1404233575,
0.2428718954,
0.111488916,
-0.0798582658,
-0.0651343092,
-0.2068640739,
0.0714726597,
-0.0393274352,
-0.261888057,
0.1217392385,
-0.1065543145,
0.1592174321,
-0.2659185529,
-0.0238230973,
-0.0651175678,
0.0663719848,
-0.0832173228,
-0.0198666304,
0.228132844,
-0.2856938541,
0.0371866748,
-0.2354146838,
-0.3530791402,
-0.170494765,
0.366499871,
-0.184543252,
0.0369888432,
0.268732816,
-0.0928183794,
-0.2668077648,
0.0150243891,
0.308293432,
-0.1077837199,
-0.3853510022,
0.2481777966,
0.2917561531,
0.1974304765,
-0.403375268,
0.2362272888,
0.0175396912,
-0.2571883798,
-0.1818033755,
-0.4481990635,
-0.2201607376,
0.1389451921,
-0.3590065241,
0.1187704802,
-0.0564315282,
0.1030534431,
0.087507017,
-0.0609076135,
-0.1775810868,
0.0292509533,
-0.0316628627,
-0.1708804071,
0.3003228009,
0.1231868863,
0.3215071857,
0.0304655973,
-0.0757866651,
-0.0375026129,
-0.0238966439,
0.0123708323,
-0.2674650848,
0.2046536356,
-0.1177913919,
-0.1721883118,
0.0988984928,
-0.0669286922,
-0.1082695201,
0.1115720123,
0.2172596604,
0.2519300878,
0.1715550721,
0.4327416718,
-0.0578061976,
-0.0781412274,
-0.5655527115,
0.4370855987,
0.0744242892,
0.5529671311,
-0.1422431767,
0.4968706071,
-0.4778568745,
-0.0598211549,
0.1709117442,
-0.0679050311,
-0.0351613387,
-0.0924729779,
0.4812839627,
0.0271642301,
0.0824264959,
0.1139088571,
0.2881809473,
0.213497445,
-0.0559951179,
-0.022076875,
0.2925489545,
-0.065835081,
-0.0243378356,
-0.0060558417,
-0.11527697,
-0.0515514463,
-0.0074525378,
0.2672929466,
0.3170598447,
-0.0574741103,
0.0366610736,
-0.2835756838,
0.3031590283,
0.411151588,
0.0160915088,
0.6047901511,
0.1351975352,
0.3596572578,
0.2057715505,
0.5650690198,
0.1462515444,
0.3469209075,
-0.2732592821,
-0.1061097607,
-0.0679324046,
0.2807175815,
0.3305306137,
-0.4702318013,
0.1446443051,
0.1134791672,
-0.2296657115,
0.0006696787,
-0.2954061627,
0.6380743384,
-0.0482072383,
0.1427687556,
-0.1898058355,
0.5034022927,
0.0923021883,
-0.2670193017,
-0.1357159317,
-0.2603684366,
-0.1646876037,
0.2709103525,
-0.068067573,
-0.4204149842,
0.0985166579,
-0.0504770875,
0.1767945737,
0.0280137323,
0.0287284572,
0.0661973357,
0.0950495526,
-0.2267215997,
0.100446254,
0.0161680616,
0.2924772799,
0.4172535837,
0.2327013165,
0.0323165171,
0.2583263218,
0.2004220188,
-0.2206254005,
0.2401105314,
-0.0181815848,
-0.0658186376,
0.027500391,
-0.1293643713,
0.0138200037,
0.4370178282,
-0.0464094169,
0.0211234111,
-0.2937391102,
0.0402429476,
0.2716839015,
-0.013461059,
0.4885114133,
0.0111888889,
0.0218148548,
0.0729124993,
0.0148396194,
-0.4192560315,
0.07811822,
0.3170060515,
-0.2312472612,
0.1861356199,
-0.0094240308,
-0.0040242928,
-0.0653240532,
0.3525850475,
0.2203418463,
0.380389601,
-0.3470633924,
-0.2478014976,
-0.4514296949,
-0.2148246616,
0.3679116666,
-0.2235807776,
-0.0821257681,
0.2524749339,
-0.2352209985,
0.179506734,
0.0145758735,
0.2517455518,
-0.0515866578,
0.18124336,
-0.0746959448,
-0.1761793494,
-0.3598522842,
0.1285799742,
0.0889079869,
-0.1742635965,
0.3584085703,
-0.1178862751,
-0.1673536599,
-0.0971776694,
0.2376361638,
0.1741001159,
-0.2355187237,
0.1722302288,
0.0413750373,
0.1344534457,
-0.0645540729,
-0.055709701,
0.1212467104,
0.1673984677,
-0.324188143,
-0.038895946,
-0.1537390798,
-0.130843237,
-0.1989883631,
0.0394288413,
-0.5205609798,
0.3817764521,
0.2414392233,
0.0903250799,
-0.0592816174,
-0.0564866774,
-0.2958544493,
0.011628286,
0.5659481883,
0.1310488284,
-0.2498775572,
0.0230486505,
-0.1982486248,
0.017298948,
0.5022481084,
-0.3008304536,
0.1593635082,
0.060787335,
0.2231652886,
0.3416748345,
-0.1027992964,
-0.5669335723,
0.2001691163,
0.505693078,
-0.1171720996,
0.1527399272,
0.1659207493,
0.1424452066,
0.0287003089,
-0.1023586243,
0.50853616,
0.1950048059,
-0.4277582169,
0.1314693242,
-0.0252332799
] |
https://github.com/huggingface/datasets/issues/1831 | Some question about raw dataset download info in the project . | Once #1846 will be merged, the paths to the raw downloaded files will be accessible as:
```python
builder_instance.dl_manager.downloaded_paths
``` | Hi , i review the code in
https://github.com/huggingface/datasets/blob/master/datasets/conll2003/conll2003.py
in the _split_generators function is the truly logic of download raw datasets with dl_manager
and use Conll2003 cls by use import_main_class in load_dataset function
My question is that , with this logic it seems that i can not have the raw dataset download location
in variable in downloaded_files in _split_generators.
If someone also want use huggingface datasets as raw dataset downloader,
how can he retrieve the raw dataset download path from attributes in
datasets.dataset_dict.DatasetDict ? | 19 | Some question about raw dataset download info in the project .
Hi , i review the code in
https://github.com/huggingface/datasets/blob/master/datasets/conll2003/conll2003.py
in the _split_generators function is the truly logic of download raw datasets with dl_manager
and use Conll2003 cls by use import_main_class in load_dataset function
My question is that , with this logic it seems that i can not have the raw dataset download location
in variable in downloaded_files in _split_generators.
If someone also want use huggingface datasets as raw dataset downloader,
how can he retrieve the raw dataset download path from attributes in
datasets.dataset_dict.DatasetDict ?
Once #1846 will be merged, the paths to the raw downloaded files will be accessible as:
```python
builder_instance.dl_manager.downloaded_paths
``` | [
-0.2227525115,
-0.0727901384,
-0.0795345902,
0.5368557572,
0.1130916551,
-0.0717309639,
0.1194332168,
-0.040837843,
0.0301585477,
0.125805974,
-0.3729730248,
0.1903691143,
-0.1131498814,
0.6030974984,
0.1462549716,
-0.0494616218,
-0.0528514758,
0.193154946,
-0.0936013609,
-0.0438144766,
-0.4198141396,
0.3098752201,
-0.3674633205,
0.1116436422,
-0.183257103,
0.0009520714,
0.0041941009,
0.2849134207,
-0.4855920076,
-0.2597878277,
0.2608335316,
0.2013037503,
0.4007952809,
0.2447418123,
-0.0001246907,
0.045272205,
0.2902216017,
-0.3360068798,
-0.4938017726,
-0.2695340216,
-0.6499736309,
0.0080852285,
-0.0744825304,
-0.1832294166,
0.0880004615,
-0.0940373093,
-0.0886581242,
-0.1186729446,
0.1216425449,
0.0911429673,
0.0624107495,
0.3518903553,
-0.0213568322,
0.0244733766,
0.2250175774,
0.2522042096,
0.0580833554,
0.0618891455,
-0.0252658166,
0.3873562217,
0.1903800964,
0.2815833986,
0.2330067456,
0.1151762009,
0.4400794804,
0.2746640146,
-0.2849645019,
-0.3441520631,
0.0646266714,
0.1897076517,
0.3417408168,
-0.3277812898,
-0.4800506234,
-0.351113081,
-0.1297979355,
-0.5806760192,
0.0638197511,
0.1226148754,
-0.4566830695,
0.2788124084,
-0.5162332058,
-0.5137310624,
-0.1360851377,
-0.094853662,
-0.2339905798,
0.4693613052,
-0.3634056747,
0.0339230485,
0.0787887573,
0.4059507549,
0.252389878,
-0.1982112527,
-0.0329440907,
0.2363316417,
-0.1470580101,
-0.1451291442,
-0.12419682,
0.2437324375,
0.1872885823,
-0.0102503579,
-0.1592286676,
-0.2508051693,
0.0632319525,
0.0414231718,
0.3790726364,
0.0483651422,
0.0730749294,
0.258043617,
0.2510021925,
0.1209765151,
0.1441135108,
-0.2335910052,
-0.0929672718,
-0.0628624335,
-0.381437093,
0.142205894,
0.0251009427,
-0.0544401072,
-0.2750727236,
-0.214488402,
-0.0897699073,
-0.3215322196,
0.3057870865,
0.3743991554,
-0.101936385,
0.0220569354,
-0.0423462205,
0.0158645306,
0.1265098602,
-0.3291882873,
-0.0845959261,
-0.2330511361,
-0.1551713645,
0.0351235755,
-0.2879270017,
-0.1038952768,
0.4116894305,
0.1091846451,
0.0140772862,
0.0599600598,
0.0134303588,
-0.0717190951,
0.1696664542,
0.1859177947,
0.0490515158,
0.2148471475,
-0.1917368025,
-0.259278208,
-0.1738079637,
-0.0748299062,
-0.3227012753,
-0.4281929731,
-0.1209013835,
0.0081479363,
-0.1694133133,
0.1197640896,
-0.2129066139,
0.0280259214,
0.1235992089,
0.2871416807,
0.0152982865,
-0.011190393,
-0.4282563925,
-0.2514010668,
0.3835564256,
0.4348741174,
-0.2215136737,
-0.1230008006,
0.0940120444,
-0.431432128,
0.0629920661,
0.0478172377,
-0.3582910597,
0.5085853934,
-0.425464958,
-0.1822804809,
0.5232155919,
-0.3267565966,
-0.2476577312,
0.5593615174,
0.1116133407,
-0.0978967175,
0.4094044268,
-0.0305033512,
0.2824293077,
-0.0730032325,
-0.0714547038,
0.5319203734,
0.1348211914,
-0.1183862016,
0.0307500549,
-0.2429302931,
-0.1591520309,
-0.1199132949,
-0.1136737019,
0.252461344,
0.0738944858,
-0.1367600411,
0.5260579586,
-0.0497714169,
0.2035019845,
0.335077703,
-0.0111464551,
0.1369570345,
0.0173294749,
-0.0154992547,
-0.6657514572,
0.083852388,
-0.2974475324,
-0.2576330304,
-0.2690090239,
-0.3559126258,
-0.337718606,
0.1751467735,
-0.2877253592,
-0.3327609003,
-0.0792820454,
0.0922703594,
0.4710852504,
-0.025877757,
-0.3952091932,
0.5251184106,
-0.0418805219,
0.1615413576,
-0.088803485,
-0.0046256334,
0.1427608281,
0.1398673505,
0.0007157669,
0.1126952842,
0.0803140476,
-0.1782865673,
0.0629310757,
0.4662192166,
0.1516310871,
0.1959068626,
0.1718025357,
0.0093576126,
0.2583297789,
0.1817044169,
-0.051086951,
-0.2297550887,
0.0971027017,
0.2127889246,
0.0565141365,
0.3524627984,
0.0223182123,
0.2595728934,
0.1650948524,
-0.0690740496,
0.1472308338,
-0.0168985631,
0.1959603727,
-0.2239766419,
-0.1486390978,
0.206876263,
0.3971289396,
0.1536172926,
-0.2714308798,
0.1967891306,
0.4208651185,
-0.067954883,
-0.2724222243,
0.0342277773,
-0.318757534,
-0.033349365,
0.0566567294,
0.7819698453,
0.4830188155,
0.0190001,
0.1943263561,
0.0896527469,
0.2920683324,
-0.1252112836,
0.4004474878,
0.1224450022,
-0.0320639163,
0.076039508,
-0.4785552025,
-0.2069207132,
0.1402297467,
0.0287684295,
0.2454362959,
0.1555005014,
-0.3239542842,
0.0535906814,
-0.2396929562,
-0.3992610872,
-0.2819198668,
-0.1486744285,
-0.0159911923,
-0.1645134836,
-0.243656382,
-0.0574244857,
-0.0981530547,
-0.169770807,
-0.0488384366,
0.0056509338,
-0.2327383906,
0.0742064491,
-0.1707395166,
-0.0941132456,
-0.1039257199,
-0.0643207952,
0.1774677336,
-0.0226612613,
0.0893999636,
-0.4694091976,
0.121761933,
-0.166653052,
0.1832150966,
0.3540811241,
0.0813801438,
0.1517677158,
0.4431500733,
0.128968209,
-0.0204902701,
0.0068591065,
-0.1250998676,
0.1245363057,
-0.1264801323,
-0.4716935754,
0.1030035987,
0.0985290259,
-0.0831037462,
-0.2064297646,
-0.7116601467,
-0.0992263481,
0.121895656,
-0.1045545191,
0.2185327411,
-0.1333875358,
-0.1711413711,
0.0174396355,
-0.2863848507,
-0.0070472206,
-0.2202374339,
-0.7402293086,
0.2095381469,
-0.3735068738,
-0.2058056295,
-0.0553149618,
-0.1200566888,
0.2111453265,
-0.0086778849,
-0.1650973707,
0.0514053255,
-0.1619439274,
0.1768593192,
0.0831116438,
0.3762397468,
-0.034780629,
-0.0497434698,
0.1611569971,
-0.1935866773,
-0.0018391345,
0.1826921999,
-0.3915805221,
0.3662188053,
0.3890745938,
-0.0243429188,
0.1229493544,
0.7561133504,
0.2864711881,
-0.1502742916,
0.175342977,
-0.1364036649,
0.4252974689,
0.2925865352,
-0.1773472279,
-0.048888009,
0.072766915,
-0.0693988577,
0.1823136955,
0.0921333432,
0.2284848541,
-0.2628239989,
-0.1667081714,
-0.1121023074,
-0.130259797,
-0.1420614719,
0.5496485233,
0.192571193,
0.092987895,
0.1902044266,
-0.0035490664,
0.0613079742,
0.0210149214,
0.4095698297,
0.3880937099,
0.161898762,
-0.0672064051,
-0.0749607906,
-0.2247970253,
0.07422176,
0.2897366881,
-0.1773895323,
0.1776884198,
0.0986662284,
0.2031382024,
0.1185432673,
0.7021449208,
-0.0180748068,
-0.0924168974,
-0.132848531,
-0.2192425281,
-0.0113094291,
0.1038034856,
-0.1278326064,
0.1078299433,
0.5110150576,
0.2077197134,
-0.3721148372,
-0.4381561279,
0.2151832581,
0.1094942018,
-0.2812062502,
-0.1837835163,
-0.1544683129,
-0.1078192964,
-0.2226546407,
-0.2091929168,
0.1499245465,
0.0881495103,
-0.005703873,
-0.0566784665,
0.082651332,
0.0841820315,
-0.00867783,
0.1462732852,
0.3609339893,
-0.012086153,
-0.073328808,
0.3574352562,
0.3906068504,
0.1943041682,
0.4637272656,
-0.3728158176,
-0.1768309325,
-0.0265095308,
0.0531405173,
0.7556013465,
0.1763666719,
-0.4882670343,
0.0601238087,
-0.0116343899,
-0.075568594,
-0.3720977306,
0.242215246,
0.2992217243,
0.0321991146,
-0.1801103801,
-0.6387313604,
0.4800693989,
-0.052099254,
-0.2018404007,
0.1666305214,
0.0069740475,
-0.3069559038,
-0.1485982835,
-0.0105795059,
0.7889217734,
0.1614473909,
0.112199828,
0.0857862905,
-0.4110885262,
0.5621547699,
-0.1268182248,
-0.1707641035,
-0.2967331111,
0.0537738204,
-0.1420811117,
-0.2615426481,
0.0487697795,
-0.0964147002,
-0.083570011,
0.3538786471,
-0.1031553298,
0.0783122629,
0.0351163223,
0.5478223562,
-0.092840381,
-0.1032028571,
0.0988960713,
-0.111356318,
0.2575157285,
0.4692692757,
-0.1261552125,
-0.4839958251,
-0.1835498363,
0.1057135835,
-0.0513834506,
-0.0979698971,
-0.4327757061,
-0.0170005448,
0.0926151946,
-0.3537168503,
0.0128735267,
0.6208475828,
0.2836616635,
0.0231480449,
-0.1648339778,
0.0673449859,
-0.049520161,
0.076901719,
0.2480777055,
0.2085043639,
-0.0699046403,
-0.0784724206,
-0.1581484228,
0.1368763298,
0.0107303075,
-0.206312418,
0.0896551311,
-0.1035651788,
0.1816353202,
-0.3317039013,
-0.0347606875,
-0.0417185128,
0.0668422356,
-0.0687275752,
-0.0109379161,
0.2227707207,
-0.3475804031,
0.0621427596,
-0.2775216103,
-0.3875666559,
-0.1929180324,
0.2877932489,
-0.053740751,
0.0600106567,
0.220713079,
-0.0982338935,
-0.2024486214,
-0.0398914665,
0.3363057077,
-0.1070860848,
-0.2793478072,
0.3372611105,
0.3225165009,
0.0940121487,
-0.363756448,
0.3148419559,
-0.0405120403,
-0.2393661439,
-0.2452914715,
-0.4822891951,
-0.2695067823,
0.1232937127,
-0.3319844007,
0.1249401942,
-0.0620176494,
0.1958286762,
0.0651970282,
-0.0243791584,
-0.1795799434,
0.0090980371,
-0.0362629034,
-0.1489290446,
0.3070866168,
0.0986237675,
0.2730362415,
0.0948403627,
-0.0722216442,
-0.0209140535,
-0.0723859295,
-0.0107931802,
-0.2254005522,
0.1856941432,
-0.1288864464,
-0.1764188856,
0.1162186712,
-0.0721573681,
-0.1746606231,
0.1263109148,
0.2937782407,
0.1577111781,
0.1738809198,
0.3827466667,
-0.0763130337,
-0.0502567254,
-0.546572566,
0.356020838,
0.0966605321,
0.479352355,
-0.1747327745,
0.4857379198,
-0.4541738927,
-0.0447824523,
0.1853283495,
-0.1238314137,
0.0049050879,
-0.1167222857,
0.423252821,
-0.021385517,
0.1024015769,
0.1084320694,
0.2947763205,
0.2523184121,
-0.107811667,
0.0440972671,
0.1966436654,
-0.045934815,
-0.0586764738,
-0.0020265321,
-0.1170233637,
-0.0076996544,
0.0213973708,
0.3223965764,
0.3394871652,
0.0151305143,
-0.011926447,
-0.2416766882,
0.3374830186,
0.4738018811,
0.0307138264,
0.6178552508,
0.1547664702,
0.3950326741,
0.2319706678,
0.6090505123,
0.1564680785,
0.3764050305,
-0.2511891723,
-0.0926401988,
-0.0720535144,
0.209482789,
0.3799169064,
-0.4324009418,
0.1841050088,
0.1872382909,
-0.2192244232,
0.0289910063,
-0.2477704585,
0.5808359981,
-0.1430680305,
0.111890249,
-0.1777610779,
0.4941424429,
-0.0063957442,
-0.258330375,
-0.1401862949,
-0.2041163296,
-0.0913493484,
0.2170605659,
-0.0641435683,
-0.4420026839,
0.0254702587,
-0.1010129899,
0.1205314249,
0.0508956276,
0.0709131509,
0.0971239284,
0.0195932426,
-0.2196978182,
0.2089305967,
-0.0922002718,
0.316380769,
0.3709082007,
0.2975152135,
0.0974189192,
0.3126900792,
0.1595858634,
-0.2844440043,
0.2018163353,
-0.04754778,
-0.0905614197,
0.006173824,
-0.1210868582,
0.0058414969,
0.4182614088,
-0.0461421125,
-0.0200620964,
-0.3648142815,
0.1689007282,
0.251278758,
0.0000592576,
0.5455229282,
-0.0535516106,
0.0083285188,
0.0869261846,
-0.0172512792,
-0.4771107435,
0.0602713712,
0.3029375374,
-0.2579322457,
0.2056420594,
0.0049273991,
-0.0021013857,
-0.0642878935,
0.322824657,
0.1336645037,
0.3569432795,
-0.3690539598,
-0.2826678455,
-0.472033143,
-0.1578615755,
0.3902361393,
-0.2169175148,
-0.0885376185,
0.2607625425,
-0.2557820976,
0.227168262,
0.0340685658,
0.3226415217,
0.0107521098,
0.1497735679,
-0.0656412542,
-0.1614823192,
-0.3975391388,
0.1098097414,
0.114342995,
-0.1939415485,
0.3625614047,
-0.2283435166,
-0.1399368495,
-0.1116102785,
0.2486993819,
0.2083443105,
-0.2049415559,
0.1192517802,
-0.0392201059,
0.1562286019,
-0.0664400458,
0.0166161042,
0.2328226715,
0.2091889381,
-0.3784231842,
-0.000628032,
-0.1004873514,
-0.1940931529,
-0.3043052852,
0.0465800166,
-0.4616069198,
0.3110299408,
0.2901495993,
0.0687091202,
-0.0569684543,
-0.0396673381,
-0.3614221811,
0.0534360185,
0.5975098014,
0.1792012006,
-0.2954569161,
-0.001694898,
-0.2020285279,
0.0181051902,
0.4721162021,
-0.2760743797,
0.0974706262,
-0.0395484529,
0.1857445389,
0.3565402031,
-0.1293279529,
-0.5400488973,
0.2439941615,
0.5118326545,
-0.1200244576,
0.1001456454,
0.2415111363,
0.1531035304,
-0.016219046,
-0.0992010832,
0.5105972886,
0.2011980265,
-0.4127675295,
0.1326323897,
-0.0148095973
] |
https://github.com/huggingface/datasets/issues/1830 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? | Hi @wumpusman
`datasets` has a caching mechanism that allows to cache the results of `.map` so that when you want to re-run it later it doesn't recompute it again.
So when you do `.map`, what actually happens is:
1. compute the hash used to identify your `map` for the cache
2. apply your function on every batch
This can explain the time difference between your different experiments.
The hash computation time depends of how complex your function is. For a tokenizer, the hash computation scans the lists of the words in the tokenizer to identify this tokenizer. Usually it takes 2-3 seconds.
Also note that you can disable caching though using
```python
import datasets
datasets.set_caching_enabled(False)
``` | This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
| 116 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer?
This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
Hi @wumpusman
`datasets` has a caching mechanism that allows to cache the results of `.map` so that when you want to re-run it later it doesn't recompute it again.
So when you do `.map`, what actually happens is:
1. compute the hash used to identify your `map` for the cache
2. apply your function on every batch
This can explain the time difference between your different experiments.
The hash computation time depends of how complex your function is. For a tokenizer, the hash computation scans the lists of the words in the tokenizer to identify this tokenizer. Usually it takes 2-3 seconds.
Also note that you can disable caching though using
```python
import datasets
datasets.set_caching_enabled(False)
``` | [
-0.40404737,
-0.0130074006,
-0.1024704129,
0.1034294739,
0.1453052163,
-0.1225538552,
0.2550543845,
0.1890889108,
0.1306776851,
-0.006502152,
-0.0542232022,
0.4988860786,
-0.1724810451,
-0.2727595866,
-0.1320427358,
0.0650426075,
0.2197590768,
0.0224167742,
0.241645202,
-0.0342864916,
-0.1218727008,
0.1023018658,
-0.1767258048,
0.2413994074,
-0.3152629733,
-0.07799308,
0.0812310278,
-0.209633559,
-0.0027562869,
-0.5689615011,
-0.2084297538,
0.1581246704,
0.0209431909,
0.5331247449,
-0.0001148737,
0.0403424352,
-0.0291635897,
0.2731474936,
0.1347175837,
0.0443615541,
0.3529543579,
-0.1942857206,
-0.1685833186,
-0.2257664502,
-0.0541707911,
-0.2808631659,
-0.0221224949,
-0.2241772413,
0.0683083087,
0.0300420634,
0.1608586162,
0.1151948944,
-0.3964318931,
-0.0595158376,
-0.0024587174,
-0.1042250991,
-0.0991548225,
0.0140271476,
0.0713294595,
-0.255187124,
-0.2116563171,
0.1949045062,
-0.2130432874,
-0.1478140056,
0.2687232494,
0.2163694352,
0.0346122161,
-0.2425244898,
0.1680866778,
0.2316349894,
0.0670108199,
-0.0272127744,
-0.0171247311,
-0.3350792825,
-0.3706912398,
-0.0284825563,
0.1461225599,
-0.4334976971,
-0.1206514686,
-0.0896025151,
-0.4140654504,
0.2037733048,
0.2642426789,
-0.1223936826,
-0.2039304525,
0.4352439344,
0.0954283923,
0.1497345716,
0.1041519642,
-0.0997518077,
-0.2807915509,
-0.264377743,
-0.1595771015,
0.3733043075,
-0.3415874839,
-0.1739549935,
0.2692954838,
-0.3091348112,
-0.1407883614,
0.1142804325,
-0.1424312741,
0.1946653128,
0.2083412707,
-0.0471199378,
0.0663069785,
0.2460044473,
0.038447544,
0.1738463342,
0.0296909045,
-0.4802924693,
-0.3160503805,
-0.0903608724,
-0.1888757348,
0.0202141274,
0.345872134,
-0.2424586564,
-0.2370805889,
-0.0725834295,
-0.0205962602,
-0.1713075787,
-0.3799442649,
-0.0983374491,
0.0658609793,
0.1854549646,
0.058747232,
0.0610379986,
-0.364798218,
-0.2021664977,
-0.092831552,
-0.076726146,
-0.1286276728,
-0.1720003635,
-0.1044917852,
0.2542574704,
-0.1882733256,
0.0913058221,
0.2601751089,
0.0789948776,
-0.1153762266,
0.2103087008,
0.2196047604,
-0.3643231392,
0.104728356,
-0.1130543202,
0.0748010278,
0.4360268116,
-0.0055077421,
0.0017844305,
-0.2595285475,
0.2082756162,
-0.264908731,
-0.2264891863,
0.2413855642,
0.1191598997,
-0.0831421167,
-0.1221607774,
-0.4942295849,
0.4385454655,
0.2539224625,
-0.1163534075,
-0.0749134943,
-0.1809134334,
-0.5298197269,
-0.2167423815,
0.267924726,
-0.0187719055,
-0.0722124949,
-0.193780005,
0.3418036997,
0.1921719909,
0.3103511035,
0.643055737,
-0.3864825368,
0.7953375578,
-0.1250497997,
0.7483618259,
0.2579940856,
-0.2477055043,
-0.377818048,
0.1166384593,
-0.1784684807,
0.2722211778,
-0.2818517089,
-0.1200629249,
0.702637136,
-0.2252788097,
0.3419843614,
0.106144309,
0.2469955385,
0.3040956855,
-0.2483735234,
-0.0491900817,
0.5504584312,
-0.0802224502,
-0.2242528796,
-0.1509811729,
-0.1534065008,
0.1111334488,
-0.0315547623,
-0.1203735694,
-0.1554093063,
0.0617320612,
0.0151113877,
0.0270558447,
-0.0637359023,
0.2192265391,
0.1471123695,
0.2171942145,
0.0741172284,
0.0683927312,
0.429030776,
-0.0061166505,
0.105516538,
-0.0645507649,
-0.1504325718,
-0.1419281512,
0.1726527661,
0.1282208711,
0.0678982735,
0.0891925842,
0.231172502,
-0.1069800332,
0.0154443318,
0.1270229667,
0.4437766969,
-0.3041421473,
0.1406869292,
-0.1602892578,
-0.1061220318,
-0.1936034113,
0.1408743411,
0.1087324023,
-0.1834658831,
0.1624327451,
0.1247906908,
0.3094664812,
-0.1730700582,
0.2074124068,
0.1145596206,
0.2654833496,
0.0448613949,
0.1117051616,
0.0164179187,
-0.1618008763,
-0.1011433154,
0.2487524599,
0.7665549517,
0.2934232652,
-0.0981311202,
-0.1918503195,
-0.0074496386,
0.2052227855,
0.1254599392,
0.0902862996,
-0.0172136594,
0.3012904525,
0.4247046113,
0.1712669581,
0.350859046,
0.4743337929,
0.5267605186,
-0.1261988878,
-0.2109233439,
0.1169244573,
-0.3413846493,
-0.4390027821,
-0.0324557349,
-0.4132478535,
0.1679464877,
0.1043306813,
0.2238327563,
-0.1689834744,
-0.0138752004,
0.0025530215,
0.2727620602,
0.2319282591,
-0.0062526651,
-0.0347079486,
0.1677316129,
0.2354775071,
-0.3278359175,
-0.1683430672,
-0.0177448075,
0.2466843426,
-0.0202031638,
-0.0880930498,
0.0660285205,
0.1790388525,
0.4836560786,
-0.0730331838,
0.0438802801,
-0.2336484939,
-0.0868268013,
0.0112863081,
0.0730062202,
0.1429344863,
0.2016054988,
0.0416047648,
0.0553794317,
-0.1324758232,
-0.032636188,
-0.2036225647,
-0.3690443933,
0.0673271939,
0.0478157252,
-0.1053123549,
0.3012901545,
0.1895496845,
-0.0706469119,
-0.0284741428,
-0.4572890997,
0.0877391323,
-0.1803112626,
0.0098783216,
-0.1076650098,
-0.1534429491,
-0.1983680278,
0.040002957,
0.116860263,
-0.2781752944,
-0.2616516054,
-0.3224227428,
-0.1180725992,
-0.1744087487,
0.1405442208,
-0.0200541932,
0.0511424616,
-0.0312802494,
0.1222997606,
0.1008712053,
0.1293455213,
-0.2491522133,
-0.167208299,
0.1939768642,
-0.052004464,
-0.0121717164,
-0.3335225284,
-0.2497051358,
0.3890590072,
-0.0699700862,
-0.0141934697,
-0.2141370624,
0.0942139849,
0.1669800282,
0.1398718059,
-0.2460225075,
0.2176398635,
-0.3044710755,
0.2614801526,
0.0384431593,
-0.2167222351,
0.3941025734,
0.2282126844,
-0.1222437844,
0.1697707325,
-0.2478059977,
0.169134587,
-0.0590035915,
-0.2350637317,
0.0723135695,
0.4840386212,
0.2467960119,
0.6211674809,
0.0489818081,
-0.0133376727,
-0.000104659,
-0.3113280237,
-0.1315823197,
-0.4311896563,
-0.0755137727,
0.2071561366,
-0.0991366208,
0.025744576,
0.4865766764,
-0.0850559846,
-0.3330842257,
0.2221699953,
-0.1734429002,
0.0490760766,
-0.1999393553,
0.1273281276,
-0.094773449,
0.0593056194,
0.001397786,
0.4046106339,
-0.5339139104,
-0.1491030306,
0.2374676615,
-0.2787155807,
0.2525823712,
-0.2517897785,
-0.9455536008,
0.3512923419,
-0.8524879813,
0.0949762985,
0.0165478121,
0.2276024818,
0.0475076474,
-0.0270617194,
0.116301097,
-0.0324513875,
0.1658133417,
-0.0538088381,
-0.0845551938,
0.2370496392,
-0.5604740977,
-0.1172572598,
-0.1456516236,
-0.0787851959,
0.1936263442,
0.5949997902,
0.7412644029,
-0.0944306627,
-0.2862771749,
-0.3504448533,
-0.0479066707,
0.0696777776,
0.0392844714,
-0.0138419215,
-0.1023690179,
-0.1808015108,
0.0108177979,
0.1023748741,
0.1822671741,
0.1334198415,
-0.1541094631,
-0.0875531435,
0.1505204439,
0.3036971986,
0.2778021693,
0.2423069924,
-0.0387685634,
0.3437796235,
0.3173718452,
0.1055742577,
-0.1110975668,
-0.1575467139,
0.218151778,
-0.3695305884,
0.0900226161,
0.0998717472,
0.0671067163,
0.1695055962,
-0.0323254652,
0.2138264328,
-0.2696320713,
0.3467109203,
-0.1918302476,
0.3990118504,
0.5268699527,
0.1344356239,
-0.5008948445,
-0.3026988208,
0.0710378662,
0.5278066397,
-0.2671489716,
0.436906606,
-0.480276674,
-0.4048760533,
0.4786455631,
0.2622503936,
0.5893495679,
-0.0001973089,
0.2131255269,
0.2467376292,
0.2820874751,
0.1871794313,
-0.4422437549,
-0.128349781,
-0.2351829559,
0.218982175,
0.0433000661,
-0.0735478103,
0.0681040883,
0.2392939478,
-0.1190580502,
-0.070746474,
0.1343747228,
0.8829228282,
-0.0130435945,
0.302734077,
0.4876134098,
-0.3995562196,
0.3429581225,
0.139388144,
0.2241424024,
0.0627054423,
0.0940345749,
0.0973554701,
-0.0682933852,
-0.1550719887,
-0.2499285191,
-0.2025585771,
-0.5686982274,
0.297793299,
-0.2047142088,
0.0308007114,
0.079801023,
0.1448376179,
0.0416583233,
0.240643099,
0.006632573,
0.288567096,
0.2132267505,
0.3364418149,
0.2534502149,
-0.5096055269,
-0.1977290064,
-0.0098065846,
-0.0152438125,
0.1644135565,
-0.2644810379,
-0.3185323477,
-0.6420419812,
-0.0458641909,
0.304049015,
-0.3656049669,
0.0190449804,
0.1011227295,
-0.0792651102,
-0.1980583966,
0.0806414336,
-0.1534317732,
0.0853770971,
0.4080637991,
-0.0744124949,
-0.2806638777,
0.018494064,
0.3022502661,
0.1215463802,
-0.2107042223,
0.4307022393,
-0.4703118503,
-0.2629355788,
-0.1035873294,
0.2154366076,
0.1363150179,
0.1198757887,
0.0926351324,
-0.1318541765,
-0.1832281202,
0.0951460227,
0.2641551197,
-0.1274953336,
-0.1099076942,
-0.1724203676,
-0.0183413699,
-0.3060437143,
-0.010590571,
-0.059931308,
0.0916232169,
0.0973536149,
0.1349284202,
-0.3185408711,
0.1697501987,
-0.257768333,
-0.1210308895,
0.1259122789,
0.153881073,
-0.201411128,
-0.1586651802,
0.1208087951,
0.0411623493,
0.0997673124,
0.2575888932,
0.0350962058,
-0.2286946476,
-0.0834931955,
0.1424898654,
0.0466305539,
-0.360457778,
0.065940775,
0.1358203888,
-0.0845476836,
-0.5128016472,
0.2053452879,
0.1716240197,
0.0137767466,
-0.4263346195,
0.1967775226,
-0.0045446618,
-0.006976604,
0.1540152282,
-0.0409203246,
0.0195883419,
0.109384343,
0.216730237,
0.1208918095,
-0.203953445,
0.0436545424,
0.2604888678,
0.3350318968,
0.1718847156,
0.0119803064,
-0.0260329749,
-0.0632948205,
0.1637772322,
-0.169979617,
0.212677896,
-0.2245703191,
-0.4430893362,
0.206537962,
0.1477204561,
0.0679500699,
-0.2368669212,
0.4112254679,
-0.2698411942,
0.1705465615,
0.0537063852,
0.2234907448,
0.2558572292,
-0.2167447656,
-0.1678138673,
0.458050251,
-0.1856303066,
0.0927563384,
0.1185214072,
-0.0464377776,
0.0143658705,
0.323636502,
0.089629747,
0.1318291128,
0.4207835197,
0.206501469,
0.2570440471,
0.2392932624,
0.3731355369,
-0.1887238175,
-0.2324148864,
-0.0579186045,
0.4835403562,
-0.3375785649,
0.1452248394,
-0.0031017212,
-0.0090718167,
0.0150641305,
-0.557723999,
-0.0361897498,
0.3808558285,
-0.3738012612,
-0.2634641826,
-0.1039748564,
0.0000506653,
-0.0444149971,
0.357973367,
-0.1306928843,
-0.0440517105,
-0.3228885531,
-0.1085640565,
-0.070135884,
0.1116298735,
-0.2539830506,
-0.2345301956,
0.218488574,
-0.2175603509,
0.2340624183,
-0.4240420461,
0.1349431425,
-0.0556654632,
0.3740639389,
0.3734025061,
0.2763726115,
-0.1379141659,
0.0604413971,
-0.0782147869,
0.0910297781,
0.0376119427,
0.1411616653,
-0.073115699,
-0.3212689757,
0.1342653185,
0.0041141552,
-0.1798273921,
-0.3566518426,
0.0329825208,
-0.1090816036,
0.1966266483,
0.2209126055,
0.0509851798,
-0.1480569839,
0.1166607291,
0.0628017634,
0.0814494416,
-0.1601274163,
0.1489978284,
0.0793071836,
0.1826461107,
-0.0843047053,
0.0706104264,
0.0378759503,
0.4189381897,
0.0274147801,
-0.1120420322,
-0.3786530495,
-0.3307703435,
-0.3441820443,
-0.0883446783,
-0.1933035403,
0.1373800337,
-0.0022711691,
0.090537779,
0.176057294,
0.1948622763,
0.2074846625,
0.1234854013,
-0.2083262205,
-0.099849984,
-0.2851066887,
0.4816953838,
-0.1726652533,
0.039655365,
0.0064430898,
-0.3506655395,
0.4216939509,
0.016045969,
0.1311934143,
-0.1760371476,
0.0523304716,
-0.0212396886,
0.0931963027,
0.6377807856,
0.1688712984,
0.0617192015,
-0.0346785784,
0.1621492803,
0.1541452855,
0.1810175478,
-0.2202599496,
0.0676567107,
-0.0157292094,
-0.0018751784,
0.0582157932,
0.0275884606,
-0.0795356333,
-0.1120132655,
0.1741835624,
-0.0966246724,
-0.2279874831,
-0.0935886577,
0.0079854485,
0.12249396,
-0.2413400263,
0.3319844604,
0.0734153017,
0.2080665082,
-0.3973878324,
-0.0614512414,
0.4318277836,
-0.6654881239,
-0.1201496348,
-0.2693096101,
-0.0117829209,
0.3286217153,
0.1732207388,
-0.105751805,
-0.2817884088,
0.5291824341,
0.0278507657,
-0.2813952565,
0.3174489141,
-0.0696156919,
-0.0076538348,
-0.0337327458,
0.3865730762,
-0.2410534322,
-0.1833972335,
-0.0738726333,
-0.044959195
] |
https://github.com/huggingface/datasets/issues/1830 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? | Hi @lhoestq ,
Thanks for the reply. It's entirely possible that is the issue. Since it's a side project I won't be looking at it till later this week, but, I'll verify it by disabling caching and hopefully I'll see the same runtime.
Appreciate the reference,
Michael | This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
| 47 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer?
This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
Hi @lhoestq ,
Thanks for the reply. It's entirely possible that is the issue. Since it's a side project I won't be looking at it till later this week, but, I'll verify it by disabling caching and hopefully I'll see the same runtime.
Appreciate the reference,
Michael | [
-0.40404737,
-0.0130074006,
-0.1024704129,
0.1034294739,
0.1453052163,
-0.1225538552,
0.2550543845,
0.1890889108,
0.1306776851,
-0.006502152,
-0.0542232022,
0.4988860786,
-0.1724810451,
-0.2727595866,
-0.1320427358,
0.0650426075,
0.2197590768,
0.0224167742,
0.241645202,
-0.0342864916,
-0.1218727008,
0.1023018658,
-0.1767258048,
0.2413994074,
-0.3152629733,
-0.07799308,
0.0812310278,
-0.209633559,
-0.0027562869,
-0.5689615011,
-0.2084297538,
0.1581246704,
0.0209431909,
0.5331247449,
-0.0001148737,
0.0403424352,
-0.0291635897,
0.2731474936,
0.1347175837,
0.0443615541,
0.3529543579,
-0.1942857206,
-0.1685833186,
-0.2257664502,
-0.0541707911,
-0.2808631659,
-0.0221224949,
-0.2241772413,
0.0683083087,
0.0300420634,
0.1608586162,
0.1151948944,
-0.3964318931,
-0.0595158376,
-0.0024587174,
-0.1042250991,
-0.0991548225,
0.0140271476,
0.0713294595,
-0.255187124,
-0.2116563171,
0.1949045062,
-0.2130432874,
-0.1478140056,
0.2687232494,
0.2163694352,
0.0346122161,
-0.2425244898,
0.1680866778,
0.2316349894,
0.0670108199,
-0.0272127744,
-0.0171247311,
-0.3350792825,
-0.3706912398,
-0.0284825563,
0.1461225599,
-0.4334976971,
-0.1206514686,
-0.0896025151,
-0.4140654504,
0.2037733048,
0.2642426789,
-0.1223936826,
-0.2039304525,
0.4352439344,
0.0954283923,
0.1497345716,
0.1041519642,
-0.0997518077,
-0.2807915509,
-0.264377743,
-0.1595771015,
0.3733043075,
-0.3415874839,
-0.1739549935,
0.2692954838,
-0.3091348112,
-0.1407883614,
0.1142804325,
-0.1424312741,
0.1946653128,
0.2083412707,
-0.0471199378,
0.0663069785,
0.2460044473,
0.038447544,
0.1738463342,
0.0296909045,
-0.4802924693,
-0.3160503805,
-0.0903608724,
-0.1888757348,
0.0202141274,
0.345872134,
-0.2424586564,
-0.2370805889,
-0.0725834295,
-0.0205962602,
-0.1713075787,
-0.3799442649,
-0.0983374491,
0.0658609793,
0.1854549646,
0.058747232,
0.0610379986,
-0.364798218,
-0.2021664977,
-0.092831552,
-0.076726146,
-0.1286276728,
-0.1720003635,
-0.1044917852,
0.2542574704,
-0.1882733256,
0.0913058221,
0.2601751089,
0.0789948776,
-0.1153762266,
0.2103087008,
0.2196047604,
-0.3643231392,
0.104728356,
-0.1130543202,
0.0748010278,
0.4360268116,
-0.0055077421,
0.0017844305,
-0.2595285475,
0.2082756162,
-0.264908731,
-0.2264891863,
0.2413855642,
0.1191598997,
-0.0831421167,
-0.1221607774,
-0.4942295849,
0.4385454655,
0.2539224625,
-0.1163534075,
-0.0749134943,
-0.1809134334,
-0.5298197269,
-0.2167423815,
0.267924726,
-0.0187719055,
-0.0722124949,
-0.193780005,
0.3418036997,
0.1921719909,
0.3103511035,
0.643055737,
-0.3864825368,
0.7953375578,
-0.1250497997,
0.7483618259,
0.2579940856,
-0.2477055043,
-0.377818048,
0.1166384593,
-0.1784684807,
0.2722211778,
-0.2818517089,
-0.1200629249,
0.702637136,
-0.2252788097,
0.3419843614,
0.106144309,
0.2469955385,
0.3040956855,
-0.2483735234,
-0.0491900817,
0.5504584312,
-0.0802224502,
-0.2242528796,
-0.1509811729,
-0.1534065008,
0.1111334488,
-0.0315547623,
-0.1203735694,
-0.1554093063,
0.0617320612,
0.0151113877,
0.0270558447,
-0.0637359023,
0.2192265391,
0.1471123695,
0.2171942145,
0.0741172284,
0.0683927312,
0.429030776,
-0.0061166505,
0.105516538,
-0.0645507649,
-0.1504325718,
-0.1419281512,
0.1726527661,
0.1282208711,
0.0678982735,
0.0891925842,
0.231172502,
-0.1069800332,
0.0154443318,
0.1270229667,
0.4437766969,
-0.3041421473,
0.1406869292,
-0.1602892578,
-0.1061220318,
-0.1936034113,
0.1408743411,
0.1087324023,
-0.1834658831,
0.1624327451,
0.1247906908,
0.3094664812,
-0.1730700582,
0.2074124068,
0.1145596206,
0.2654833496,
0.0448613949,
0.1117051616,
0.0164179187,
-0.1618008763,
-0.1011433154,
0.2487524599,
0.7665549517,
0.2934232652,
-0.0981311202,
-0.1918503195,
-0.0074496386,
0.2052227855,
0.1254599392,
0.0902862996,
-0.0172136594,
0.3012904525,
0.4247046113,
0.1712669581,
0.350859046,
0.4743337929,
0.5267605186,
-0.1261988878,
-0.2109233439,
0.1169244573,
-0.3413846493,
-0.4390027821,
-0.0324557349,
-0.4132478535,
0.1679464877,
0.1043306813,
0.2238327563,
-0.1689834744,
-0.0138752004,
0.0025530215,
0.2727620602,
0.2319282591,
-0.0062526651,
-0.0347079486,
0.1677316129,
0.2354775071,
-0.3278359175,
-0.1683430672,
-0.0177448075,
0.2466843426,
-0.0202031638,
-0.0880930498,
0.0660285205,
0.1790388525,
0.4836560786,
-0.0730331838,
0.0438802801,
-0.2336484939,
-0.0868268013,
0.0112863081,
0.0730062202,
0.1429344863,
0.2016054988,
0.0416047648,
0.0553794317,
-0.1324758232,
-0.032636188,
-0.2036225647,
-0.3690443933,
0.0673271939,
0.0478157252,
-0.1053123549,
0.3012901545,
0.1895496845,
-0.0706469119,
-0.0284741428,
-0.4572890997,
0.0877391323,
-0.1803112626,
0.0098783216,
-0.1076650098,
-0.1534429491,
-0.1983680278,
0.040002957,
0.116860263,
-0.2781752944,
-0.2616516054,
-0.3224227428,
-0.1180725992,
-0.1744087487,
0.1405442208,
-0.0200541932,
0.0511424616,
-0.0312802494,
0.1222997606,
0.1008712053,
0.1293455213,
-0.2491522133,
-0.167208299,
0.1939768642,
-0.052004464,
-0.0121717164,
-0.3335225284,
-0.2497051358,
0.3890590072,
-0.0699700862,
-0.0141934697,
-0.2141370624,
0.0942139849,
0.1669800282,
0.1398718059,
-0.2460225075,
0.2176398635,
-0.3044710755,
0.2614801526,
0.0384431593,
-0.2167222351,
0.3941025734,
0.2282126844,
-0.1222437844,
0.1697707325,
-0.2478059977,
0.169134587,
-0.0590035915,
-0.2350637317,
0.0723135695,
0.4840386212,
0.2467960119,
0.6211674809,
0.0489818081,
-0.0133376727,
-0.000104659,
-0.3113280237,
-0.1315823197,
-0.4311896563,
-0.0755137727,
0.2071561366,
-0.0991366208,
0.025744576,
0.4865766764,
-0.0850559846,
-0.3330842257,
0.2221699953,
-0.1734429002,
0.0490760766,
-0.1999393553,
0.1273281276,
-0.094773449,
0.0593056194,
0.001397786,
0.4046106339,
-0.5339139104,
-0.1491030306,
0.2374676615,
-0.2787155807,
0.2525823712,
-0.2517897785,
-0.9455536008,
0.3512923419,
-0.8524879813,
0.0949762985,
0.0165478121,
0.2276024818,
0.0475076474,
-0.0270617194,
0.116301097,
-0.0324513875,
0.1658133417,
-0.0538088381,
-0.0845551938,
0.2370496392,
-0.5604740977,
-0.1172572598,
-0.1456516236,
-0.0787851959,
0.1936263442,
0.5949997902,
0.7412644029,
-0.0944306627,
-0.2862771749,
-0.3504448533,
-0.0479066707,
0.0696777776,
0.0392844714,
-0.0138419215,
-0.1023690179,
-0.1808015108,
0.0108177979,
0.1023748741,
0.1822671741,
0.1334198415,
-0.1541094631,
-0.0875531435,
0.1505204439,
0.3036971986,
0.2778021693,
0.2423069924,
-0.0387685634,
0.3437796235,
0.3173718452,
0.1055742577,
-0.1110975668,
-0.1575467139,
0.218151778,
-0.3695305884,
0.0900226161,
0.0998717472,
0.0671067163,
0.1695055962,
-0.0323254652,
0.2138264328,
-0.2696320713,
0.3467109203,
-0.1918302476,
0.3990118504,
0.5268699527,
0.1344356239,
-0.5008948445,
-0.3026988208,
0.0710378662,
0.5278066397,
-0.2671489716,
0.436906606,
-0.480276674,
-0.4048760533,
0.4786455631,
0.2622503936,
0.5893495679,
-0.0001973089,
0.2131255269,
0.2467376292,
0.2820874751,
0.1871794313,
-0.4422437549,
-0.128349781,
-0.2351829559,
0.218982175,
0.0433000661,
-0.0735478103,
0.0681040883,
0.2392939478,
-0.1190580502,
-0.070746474,
0.1343747228,
0.8829228282,
-0.0130435945,
0.302734077,
0.4876134098,
-0.3995562196,
0.3429581225,
0.139388144,
0.2241424024,
0.0627054423,
0.0940345749,
0.0973554701,
-0.0682933852,
-0.1550719887,
-0.2499285191,
-0.2025585771,
-0.5686982274,
0.297793299,
-0.2047142088,
0.0308007114,
0.079801023,
0.1448376179,
0.0416583233,
0.240643099,
0.006632573,
0.288567096,
0.2132267505,
0.3364418149,
0.2534502149,
-0.5096055269,
-0.1977290064,
-0.0098065846,
-0.0152438125,
0.1644135565,
-0.2644810379,
-0.3185323477,
-0.6420419812,
-0.0458641909,
0.304049015,
-0.3656049669,
0.0190449804,
0.1011227295,
-0.0792651102,
-0.1980583966,
0.0806414336,
-0.1534317732,
0.0853770971,
0.4080637991,
-0.0744124949,
-0.2806638777,
0.018494064,
0.3022502661,
0.1215463802,
-0.2107042223,
0.4307022393,
-0.4703118503,
-0.2629355788,
-0.1035873294,
0.2154366076,
0.1363150179,
0.1198757887,
0.0926351324,
-0.1318541765,
-0.1832281202,
0.0951460227,
0.2641551197,
-0.1274953336,
-0.1099076942,
-0.1724203676,
-0.0183413699,
-0.3060437143,
-0.010590571,
-0.059931308,
0.0916232169,
0.0973536149,
0.1349284202,
-0.3185408711,
0.1697501987,
-0.257768333,
-0.1210308895,
0.1259122789,
0.153881073,
-0.201411128,
-0.1586651802,
0.1208087951,
0.0411623493,
0.0997673124,
0.2575888932,
0.0350962058,
-0.2286946476,
-0.0834931955,
0.1424898654,
0.0466305539,
-0.360457778,
0.065940775,
0.1358203888,
-0.0845476836,
-0.5128016472,
0.2053452879,
0.1716240197,
0.0137767466,
-0.4263346195,
0.1967775226,
-0.0045446618,
-0.006976604,
0.1540152282,
-0.0409203246,
0.0195883419,
0.109384343,
0.216730237,
0.1208918095,
-0.203953445,
0.0436545424,
0.2604888678,
0.3350318968,
0.1718847156,
0.0119803064,
-0.0260329749,
-0.0632948205,
0.1637772322,
-0.169979617,
0.212677896,
-0.2245703191,
-0.4430893362,
0.206537962,
0.1477204561,
0.0679500699,
-0.2368669212,
0.4112254679,
-0.2698411942,
0.1705465615,
0.0537063852,
0.2234907448,
0.2558572292,
-0.2167447656,
-0.1678138673,
0.458050251,
-0.1856303066,
0.0927563384,
0.1185214072,
-0.0464377776,
0.0143658705,
0.323636502,
0.089629747,
0.1318291128,
0.4207835197,
0.206501469,
0.2570440471,
0.2392932624,
0.3731355369,
-0.1887238175,
-0.2324148864,
-0.0579186045,
0.4835403562,
-0.3375785649,
0.1452248394,
-0.0031017212,
-0.0090718167,
0.0150641305,
-0.557723999,
-0.0361897498,
0.3808558285,
-0.3738012612,
-0.2634641826,
-0.1039748564,
0.0000506653,
-0.0444149971,
0.357973367,
-0.1306928843,
-0.0440517105,
-0.3228885531,
-0.1085640565,
-0.070135884,
0.1116298735,
-0.2539830506,
-0.2345301956,
0.218488574,
-0.2175603509,
0.2340624183,
-0.4240420461,
0.1349431425,
-0.0556654632,
0.3740639389,
0.3734025061,
0.2763726115,
-0.1379141659,
0.0604413971,
-0.0782147869,
0.0910297781,
0.0376119427,
0.1411616653,
-0.073115699,
-0.3212689757,
0.1342653185,
0.0041141552,
-0.1798273921,
-0.3566518426,
0.0329825208,
-0.1090816036,
0.1966266483,
0.2209126055,
0.0509851798,
-0.1480569839,
0.1166607291,
0.0628017634,
0.0814494416,
-0.1601274163,
0.1489978284,
0.0793071836,
0.1826461107,
-0.0843047053,
0.0706104264,
0.0378759503,
0.4189381897,
0.0274147801,
-0.1120420322,
-0.3786530495,
-0.3307703435,
-0.3441820443,
-0.0883446783,
-0.1933035403,
0.1373800337,
-0.0022711691,
0.090537779,
0.176057294,
0.1948622763,
0.2074846625,
0.1234854013,
-0.2083262205,
-0.099849984,
-0.2851066887,
0.4816953838,
-0.1726652533,
0.039655365,
0.0064430898,
-0.3506655395,
0.4216939509,
0.016045969,
0.1311934143,
-0.1760371476,
0.0523304716,
-0.0212396886,
0.0931963027,
0.6377807856,
0.1688712984,
0.0617192015,
-0.0346785784,
0.1621492803,
0.1541452855,
0.1810175478,
-0.2202599496,
0.0676567107,
-0.0157292094,
-0.0018751784,
0.0582157932,
0.0275884606,
-0.0795356333,
-0.1120132655,
0.1741835624,
-0.0966246724,
-0.2279874831,
-0.0935886577,
0.0079854485,
0.12249396,
-0.2413400263,
0.3319844604,
0.0734153017,
0.2080665082,
-0.3973878324,
-0.0614512414,
0.4318277836,
-0.6654881239,
-0.1201496348,
-0.2693096101,
-0.0117829209,
0.3286217153,
0.1732207388,
-0.105751805,
-0.2817884088,
0.5291824341,
0.0278507657,
-0.2813952565,
0.3174489141,
-0.0696156919,
-0.0076538348,
-0.0337327458,
0.3865730762,
-0.2410534322,
-0.1833972335,
-0.0738726333,
-0.044959195
] |
https://github.com/huggingface/datasets/issues/1830 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? | I believe this is an actual issue, tokenizing a ~4GB txt file went from an hour and a half to ~10 minutes when I switched from my pre-trained tokenizer(on the same dataset) to the default gpt2 tokenizer.
Both were loaded using:
```
AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
```
I trained the tokenizer using ByteLevelBPETokenizer from the Tokenizers library and save it to a tokenizer.json file.
I have tested the caching ideas above, changing the number of process, the TOKENIZERS_PARALLELISM env variable, keep_in_memory=True and batching with different sizes.
Apologies I can't really upload much code, but wanted to back up the finding and hopefully a fix/the problem can be found.
I will comment back if I find a fix as well. | This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
| 117 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer?
This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
I believe this is an actual issue, tokenizing a ~4GB txt file went from an hour and a half to ~10 minutes when I switched from my pre-trained tokenizer(on the same dataset) to the default gpt2 tokenizer.
Both were loaded using:
```
AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
```
I trained the tokenizer using ByteLevelBPETokenizer from the Tokenizers library and save it to a tokenizer.json file.
I have tested the caching ideas above, changing the number of process, the TOKENIZERS_PARALLELISM env variable, keep_in_memory=True and batching with different sizes.
Apologies I can't really upload much code, but wanted to back up the finding and hopefully a fix/the problem can be found.
I will comment back if I find a fix as well. | [
-0.40404737,
-0.0130074006,
-0.1024704129,
0.1034294739,
0.1453052163,
-0.1225538552,
0.2550543845,
0.1890889108,
0.1306776851,
-0.006502152,
-0.0542232022,
0.4988860786,
-0.1724810451,
-0.2727595866,
-0.1320427358,
0.0650426075,
0.2197590768,
0.0224167742,
0.241645202,
-0.0342864916,
-0.1218727008,
0.1023018658,
-0.1767258048,
0.2413994074,
-0.3152629733,
-0.07799308,
0.0812310278,
-0.209633559,
-0.0027562869,
-0.5689615011,
-0.2084297538,
0.1581246704,
0.0209431909,
0.5331247449,
-0.0001148737,
0.0403424352,
-0.0291635897,
0.2731474936,
0.1347175837,
0.0443615541,
0.3529543579,
-0.1942857206,
-0.1685833186,
-0.2257664502,
-0.0541707911,
-0.2808631659,
-0.0221224949,
-0.2241772413,
0.0683083087,
0.0300420634,
0.1608586162,
0.1151948944,
-0.3964318931,
-0.0595158376,
-0.0024587174,
-0.1042250991,
-0.0991548225,
0.0140271476,
0.0713294595,
-0.255187124,
-0.2116563171,
0.1949045062,
-0.2130432874,
-0.1478140056,
0.2687232494,
0.2163694352,
0.0346122161,
-0.2425244898,
0.1680866778,
0.2316349894,
0.0670108199,
-0.0272127744,
-0.0171247311,
-0.3350792825,
-0.3706912398,
-0.0284825563,
0.1461225599,
-0.4334976971,
-0.1206514686,
-0.0896025151,
-0.4140654504,
0.2037733048,
0.2642426789,
-0.1223936826,
-0.2039304525,
0.4352439344,
0.0954283923,
0.1497345716,
0.1041519642,
-0.0997518077,
-0.2807915509,
-0.264377743,
-0.1595771015,
0.3733043075,
-0.3415874839,
-0.1739549935,
0.2692954838,
-0.3091348112,
-0.1407883614,
0.1142804325,
-0.1424312741,
0.1946653128,
0.2083412707,
-0.0471199378,
0.0663069785,
0.2460044473,
0.038447544,
0.1738463342,
0.0296909045,
-0.4802924693,
-0.3160503805,
-0.0903608724,
-0.1888757348,
0.0202141274,
0.345872134,
-0.2424586564,
-0.2370805889,
-0.0725834295,
-0.0205962602,
-0.1713075787,
-0.3799442649,
-0.0983374491,
0.0658609793,
0.1854549646,
0.058747232,
0.0610379986,
-0.364798218,
-0.2021664977,
-0.092831552,
-0.076726146,
-0.1286276728,
-0.1720003635,
-0.1044917852,
0.2542574704,
-0.1882733256,
0.0913058221,
0.2601751089,
0.0789948776,
-0.1153762266,
0.2103087008,
0.2196047604,
-0.3643231392,
0.104728356,
-0.1130543202,
0.0748010278,
0.4360268116,
-0.0055077421,
0.0017844305,
-0.2595285475,
0.2082756162,
-0.264908731,
-0.2264891863,
0.2413855642,
0.1191598997,
-0.0831421167,
-0.1221607774,
-0.4942295849,
0.4385454655,
0.2539224625,
-0.1163534075,
-0.0749134943,
-0.1809134334,
-0.5298197269,
-0.2167423815,
0.267924726,
-0.0187719055,
-0.0722124949,
-0.193780005,
0.3418036997,
0.1921719909,
0.3103511035,
0.643055737,
-0.3864825368,
0.7953375578,
-0.1250497997,
0.7483618259,
0.2579940856,
-0.2477055043,
-0.377818048,
0.1166384593,
-0.1784684807,
0.2722211778,
-0.2818517089,
-0.1200629249,
0.702637136,
-0.2252788097,
0.3419843614,
0.106144309,
0.2469955385,
0.3040956855,
-0.2483735234,
-0.0491900817,
0.5504584312,
-0.0802224502,
-0.2242528796,
-0.1509811729,
-0.1534065008,
0.1111334488,
-0.0315547623,
-0.1203735694,
-0.1554093063,
0.0617320612,
0.0151113877,
0.0270558447,
-0.0637359023,
0.2192265391,
0.1471123695,
0.2171942145,
0.0741172284,
0.0683927312,
0.429030776,
-0.0061166505,
0.105516538,
-0.0645507649,
-0.1504325718,
-0.1419281512,
0.1726527661,
0.1282208711,
0.0678982735,
0.0891925842,
0.231172502,
-0.1069800332,
0.0154443318,
0.1270229667,
0.4437766969,
-0.3041421473,
0.1406869292,
-0.1602892578,
-0.1061220318,
-0.1936034113,
0.1408743411,
0.1087324023,
-0.1834658831,
0.1624327451,
0.1247906908,
0.3094664812,
-0.1730700582,
0.2074124068,
0.1145596206,
0.2654833496,
0.0448613949,
0.1117051616,
0.0164179187,
-0.1618008763,
-0.1011433154,
0.2487524599,
0.7665549517,
0.2934232652,
-0.0981311202,
-0.1918503195,
-0.0074496386,
0.2052227855,
0.1254599392,
0.0902862996,
-0.0172136594,
0.3012904525,
0.4247046113,
0.1712669581,
0.350859046,
0.4743337929,
0.5267605186,
-0.1261988878,
-0.2109233439,
0.1169244573,
-0.3413846493,
-0.4390027821,
-0.0324557349,
-0.4132478535,
0.1679464877,
0.1043306813,
0.2238327563,
-0.1689834744,
-0.0138752004,
0.0025530215,
0.2727620602,
0.2319282591,
-0.0062526651,
-0.0347079486,
0.1677316129,
0.2354775071,
-0.3278359175,
-0.1683430672,
-0.0177448075,
0.2466843426,
-0.0202031638,
-0.0880930498,
0.0660285205,
0.1790388525,
0.4836560786,
-0.0730331838,
0.0438802801,
-0.2336484939,
-0.0868268013,
0.0112863081,
0.0730062202,
0.1429344863,
0.2016054988,
0.0416047648,
0.0553794317,
-0.1324758232,
-0.032636188,
-0.2036225647,
-0.3690443933,
0.0673271939,
0.0478157252,
-0.1053123549,
0.3012901545,
0.1895496845,
-0.0706469119,
-0.0284741428,
-0.4572890997,
0.0877391323,
-0.1803112626,
0.0098783216,
-0.1076650098,
-0.1534429491,
-0.1983680278,
0.040002957,
0.116860263,
-0.2781752944,
-0.2616516054,
-0.3224227428,
-0.1180725992,
-0.1744087487,
0.1405442208,
-0.0200541932,
0.0511424616,
-0.0312802494,
0.1222997606,
0.1008712053,
0.1293455213,
-0.2491522133,
-0.167208299,
0.1939768642,
-0.052004464,
-0.0121717164,
-0.3335225284,
-0.2497051358,
0.3890590072,
-0.0699700862,
-0.0141934697,
-0.2141370624,
0.0942139849,
0.1669800282,
0.1398718059,
-0.2460225075,
0.2176398635,
-0.3044710755,
0.2614801526,
0.0384431593,
-0.2167222351,
0.3941025734,
0.2282126844,
-0.1222437844,
0.1697707325,
-0.2478059977,
0.169134587,
-0.0590035915,
-0.2350637317,
0.0723135695,
0.4840386212,
0.2467960119,
0.6211674809,
0.0489818081,
-0.0133376727,
-0.000104659,
-0.3113280237,
-0.1315823197,
-0.4311896563,
-0.0755137727,
0.2071561366,
-0.0991366208,
0.025744576,
0.4865766764,
-0.0850559846,
-0.3330842257,
0.2221699953,
-0.1734429002,
0.0490760766,
-0.1999393553,
0.1273281276,
-0.094773449,
0.0593056194,
0.001397786,
0.4046106339,
-0.5339139104,
-0.1491030306,
0.2374676615,
-0.2787155807,
0.2525823712,
-0.2517897785,
-0.9455536008,
0.3512923419,
-0.8524879813,
0.0949762985,
0.0165478121,
0.2276024818,
0.0475076474,
-0.0270617194,
0.116301097,
-0.0324513875,
0.1658133417,
-0.0538088381,
-0.0845551938,
0.2370496392,
-0.5604740977,
-0.1172572598,
-0.1456516236,
-0.0787851959,
0.1936263442,
0.5949997902,
0.7412644029,
-0.0944306627,
-0.2862771749,
-0.3504448533,
-0.0479066707,
0.0696777776,
0.0392844714,
-0.0138419215,
-0.1023690179,
-0.1808015108,
0.0108177979,
0.1023748741,
0.1822671741,
0.1334198415,
-0.1541094631,
-0.0875531435,
0.1505204439,
0.3036971986,
0.2778021693,
0.2423069924,
-0.0387685634,
0.3437796235,
0.3173718452,
0.1055742577,
-0.1110975668,
-0.1575467139,
0.218151778,
-0.3695305884,
0.0900226161,
0.0998717472,
0.0671067163,
0.1695055962,
-0.0323254652,
0.2138264328,
-0.2696320713,
0.3467109203,
-0.1918302476,
0.3990118504,
0.5268699527,
0.1344356239,
-0.5008948445,
-0.3026988208,
0.0710378662,
0.5278066397,
-0.2671489716,
0.436906606,
-0.480276674,
-0.4048760533,
0.4786455631,
0.2622503936,
0.5893495679,
-0.0001973089,
0.2131255269,
0.2467376292,
0.2820874751,
0.1871794313,
-0.4422437549,
-0.128349781,
-0.2351829559,
0.218982175,
0.0433000661,
-0.0735478103,
0.0681040883,
0.2392939478,
-0.1190580502,
-0.070746474,
0.1343747228,
0.8829228282,
-0.0130435945,
0.302734077,
0.4876134098,
-0.3995562196,
0.3429581225,
0.139388144,
0.2241424024,
0.0627054423,
0.0940345749,
0.0973554701,
-0.0682933852,
-0.1550719887,
-0.2499285191,
-0.2025585771,
-0.5686982274,
0.297793299,
-0.2047142088,
0.0308007114,
0.079801023,
0.1448376179,
0.0416583233,
0.240643099,
0.006632573,
0.288567096,
0.2132267505,
0.3364418149,
0.2534502149,
-0.5096055269,
-0.1977290064,
-0.0098065846,
-0.0152438125,
0.1644135565,
-0.2644810379,
-0.3185323477,
-0.6420419812,
-0.0458641909,
0.304049015,
-0.3656049669,
0.0190449804,
0.1011227295,
-0.0792651102,
-0.1980583966,
0.0806414336,
-0.1534317732,
0.0853770971,
0.4080637991,
-0.0744124949,
-0.2806638777,
0.018494064,
0.3022502661,
0.1215463802,
-0.2107042223,
0.4307022393,
-0.4703118503,
-0.2629355788,
-0.1035873294,
0.2154366076,
0.1363150179,
0.1198757887,
0.0926351324,
-0.1318541765,
-0.1832281202,
0.0951460227,
0.2641551197,
-0.1274953336,
-0.1099076942,
-0.1724203676,
-0.0183413699,
-0.3060437143,
-0.010590571,
-0.059931308,
0.0916232169,
0.0973536149,
0.1349284202,
-0.3185408711,
0.1697501987,
-0.257768333,
-0.1210308895,
0.1259122789,
0.153881073,
-0.201411128,
-0.1586651802,
0.1208087951,
0.0411623493,
0.0997673124,
0.2575888932,
0.0350962058,
-0.2286946476,
-0.0834931955,
0.1424898654,
0.0466305539,
-0.360457778,
0.065940775,
0.1358203888,
-0.0845476836,
-0.5128016472,
0.2053452879,
0.1716240197,
0.0137767466,
-0.4263346195,
0.1967775226,
-0.0045446618,
-0.006976604,
0.1540152282,
-0.0409203246,
0.0195883419,
0.109384343,
0.216730237,
0.1208918095,
-0.203953445,
0.0436545424,
0.2604888678,
0.3350318968,
0.1718847156,
0.0119803064,
-0.0260329749,
-0.0632948205,
0.1637772322,
-0.169979617,
0.212677896,
-0.2245703191,
-0.4430893362,
0.206537962,
0.1477204561,
0.0679500699,
-0.2368669212,
0.4112254679,
-0.2698411942,
0.1705465615,
0.0537063852,
0.2234907448,
0.2558572292,
-0.2167447656,
-0.1678138673,
0.458050251,
-0.1856303066,
0.0927563384,
0.1185214072,
-0.0464377776,
0.0143658705,
0.323636502,
0.089629747,
0.1318291128,
0.4207835197,
0.206501469,
0.2570440471,
0.2392932624,
0.3731355369,
-0.1887238175,
-0.2324148864,
-0.0579186045,
0.4835403562,
-0.3375785649,
0.1452248394,
-0.0031017212,
-0.0090718167,
0.0150641305,
-0.557723999,
-0.0361897498,
0.3808558285,
-0.3738012612,
-0.2634641826,
-0.1039748564,
0.0000506653,
-0.0444149971,
0.357973367,
-0.1306928843,
-0.0440517105,
-0.3228885531,
-0.1085640565,
-0.070135884,
0.1116298735,
-0.2539830506,
-0.2345301956,
0.218488574,
-0.2175603509,
0.2340624183,
-0.4240420461,
0.1349431425,
-0.0556654632,
0.3740639389,
0.3734025061,
0.2763726115,
-0.1379141659,
0.0604413971,
-0.0782147869,
0.0910297781,
0.0376119427,
0.1411616653,
-0.073115699,
-0.3212689757,
0.1342653185,
0.0041141552,
-0.1798273921,
-0.3566518426,
0.0329825208,
-0.1090816036,
0.1966266483,
0.2209126055,
0.0509851798,
-0.1480569839,
0.1166607291,
0.0628017634,
0.0814494416,
-0.1601274163,
0.1489978284,
0.0793071836,
0.1826461107,
-0.0843047053,
0.0706104264,
0.0378759503,
0.4189381897,
0.0274147801,
-0.1120420322,
-0.3786530495,
-0.3307703435,
-0.3441820443,
-0.0883446783,
-0.1933035403,
0.1373800337,
-0.0022711691,
0.090537779,
0.176057294,
0.1948622763,
0.2074846625,
0.1234854013,
-0.2083262205,
-0.099849984,
-0.2851066887,
0.4816953838,
-0.1726652533,
0.039655365,
0.0064430898,
-0.3506655395,
0.4216939509,
0.016045969,
0.1311934143,
-0.1760371476,
0.0523304716,
-0.0212396886,
0.0931963027,
0.6377807856,
0.1688712984,
0.0617192015,
-0.0346785784,
0.1621492803,
0.1541452855,
0.1810175478,
-0.2202599496,
0.0676567107,
-0.0157292094,
-0.0018751784,
0.0582157932,
0.0275884606,
-0.0795356333,
-0.1120132655,
0.1741835624,
-0.0966246724,
-0.2279874831,
-0.0935886577,
0.0079854485,
0.12249396,
-0.2413400263,
0.3319844604,
0.0734153017,
0.2080665082,
-0.3973878324,
-0.0614512414,
0.4318277836,
-0.6654881239,
-0.1201496348,
-0.2693096101,
-0.0117829209,
0.3286217153,
0.1732207388,
-0.105751805,
-0.2817884088,
0.5291824341,
0.0278507657,
-0.2813952565,
0.3174489141,
-0.0696156919,
-0.0076538348,
-0.0337327458,
0.3865730762,
-0.2410534322,
-0.1833972335,
-0.0738726333,
-0.044959195
] |
https://github.com/huggingface/datasets/issues/1830 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? | Hi @johncookds do you think this can come from one tokenizer being faster than the other one ? Can you try to compare their speed without using `datasets` just to make sure ? | This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
| 33 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer?
This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
Hi @johncookds do you think this can come from one tokenizer being faster than the other one ? Can you try to compare their speed without using `datasets` just to make sure ? | [
-0.40404737,
-0.0130074006,
-0.1024704129,
0.1034294739,
0.1453052163,
-0.1225538552,
0.2550543845,
0.1890889108,
0.1306776851,
-0.006502152,
-0.0542232022,
0.4988860786,
-0.1724810451,
-0.2727595866,
-0.1320427358,
0.0650426075,
0.2197590768,
0.0224167742,
0.241645202,
-0.0342864916,
-0.1218727008,
0.1023018658,
-0.1767258048,
0.2413994074,
-0.3152629733,
-0.07799308,
0.0812310278,
-0.209633559,
-0.0027562869,
-0.5689615011,
-0.2084297538,
0.1581246704,
0.0209431909,
0.5331247449,
-0.0001148737,
0.0403424352,
-0.0291635897,
0.2731474936,
0.1347175837,
0.0443615541,
0.3529543579,
-0.1942857206,
-0.1685833186,
-0.2257664502,
-0.0541707911,
-0.2808631659,
-0.0221224949,
-0.2241772413,
0.0683083087,
0.0300420634,
0.1608586162,
0.1151948944,
-0.3964318931,
-0.0595158376,
-0.0024587174,
-0.1042250991,
-0.0991548225,
0.0140271476,
0.0713294595,
-0.255187124,
-0.2116563171,
0.1949045062,
-0.2130432874,
-0.1478140056,
0.2687232494,
0.2163694352,
0.0346122161,
-0.2425244898,
0.1680866778,
0.2316349894,
0.0670108199,
-0.0272127744,
-0.0171247311,
-0.3350792825,
-0.3706912398,
-0.0284825563,
0.1461225599,
-0.4334976971,
-0.1206514686,
-0.0896025151,
-0.4140654504,
0.2037733048,
0.2642426789,
-0.1223936826,
-0.2039304525,
0.4352439344,
0.0954283923,
0.1497345716,
0.1041519642,
-0.0997518077,
-0.2807915509,
-0.264377743,
-0.1595771015,
0.3733043075,
-0.3415874839,
-0.1739549935,
0.2692954838,
-0.3091348112,
-0.1407883614,
0.1142804325,
-0.1424312741,
0.1946653128,
0.2083412707,
-0.0471199378,
0.0663069785,
0.2460044473,
0.038447544,
0.1738463342,
0.0296909045,
-0.4802924693,
-0.3160503805,
-0.0903608724,
-0.1888757348,
0.0202141274,
0.345872134,
-0.2424586564,
-0.2370805889,
-0.0725834295,
-0.0205962602,
-0.1713075787,
-0.3799442649,
-0.0983374491,
0.0658609793,
0.1854549646,
0.058747232,
0.0610379986,
-0.364798218,
-0.2021664977,
-0.092831552,
-0.076726146,
-0.1286276728,
-0.1720003635,
-0.1044917852,
0.2542574704,
-0.1882733256,
0.0913058221,
0.2601751089,
0.0789948776,
-0.1153762266,
0.2103087008,
0.2196047604,
-0.3643231392,
0.104728356,
-0.1130543202,
0.0748010278,
0.4360268116,
-0.0055077421,
0.0017844305,
-0.2595285475,
0.2082756162,
-0.264908731,
-0.2264891863,
0.2413855642,
0.1191598997,
-0.0831421167,
-0.1221607774,
-0.4942295849,
0.4385454655,
0.2539224625,
-0.1163534075,
-0.0749134943,
-0.1809134334,
-0.5298197269,
-0.2167423815,
0.267924726,
-0.0187719055,
-0.0722124949,
-0.193780005,
0.3418036997,
0.1921719909,
0.3103511035,
0.643055737,
-0.3864825368,
0.7953375578,
-0.1250497997,
0.7483618259,
0.2579940856,
-0.2477055043,
-0.377818048,
0.1166384593,
-0.1784684807,
0.2722211778,
-0.2818517089,
-0.1200629249,
0.702637136,
-0.2252788097,
0.3419843614,
0.106144309,
0.2469955385,
0.3040956855,
-0.2483735234,
-0.0491900817,
0.5504584312,
-0.0802224502,
-0.2242528796,
-0.1509811729,
-0.1534065008,
0.1111334488,
-0.0315547623,
-0.1203735694,
-0.1554093063,
0.0617320612,
0.0151113877,
0.0270558447,
-0.0637359023,
0.2192265391,
0.1471123695,
0.2171942145,
0.0741172284,
0.0683927312,
0.429030776,
-0.0061166505,
0.105516538,
-0.0645507649,
-0.1504325718,
-0.1419281512,
0.1726527661,
0.1282208711,
0.0678982735,
0.0891925842,
0.231172502,
-0.1069800332,
0.0154443318,
0.1270229667,
0.4437766969,
-0.3041421473,
0.1406869292,
-0.1602892578,
-0.1061220318,
-0.1936034113,
0.1408743411,
0.1087324023,
-0.1834658831,
0.1624327451,
0.1247906908,
0.3094664812,
-0.1730700582,
0.2074124068,
0.1145596206,
0.2654833496,
0.0448613949,
0.1117051616,
0.0164179187,
-0.1618008763,
-0.1011433154,
0.2487524599,
0.7665549517,
0.2934232652,
-0.0981311202,
-0.1918503195,
-0.0074496386,
0.2052227855,
0.1254599392,
0.0902862996,
-0.0172136594,
0.3012904525,
0.4247046113,
0.1712669581,
0.350859046,
0.4743337929,
0.5267605186,
-0.1261988878,
-0.2109233439,
0.1169244573,
-0.3413846493,
-0.4390027821,
-0.0324557349,
-0.4132478535,
0.1679464877,
0.1043306813,
0.2238327563,
-0.1689834744,
-0.0138752004,
0.0025530215,
0.2727620602,
0.2319282591,
-0.0062526651,
-0.0347079486,
0.1677316129,
0.2354775071,
-0.3278359175,
-0.1683430672,
-0.0177448075,
0.2466843426,
-0.0202031638,
-0.0880930498,
0.0660285205,
0.1790388525,
0.4836560786,
-0.0730331838,
0.0438802801,
-0.2336484939,
-0.0868268013,
0.0112863081,
0.0730062202,
0.1429344863,
0.2016054988,
0.0416047648,
0.0553794317,
-0.1324758232,
-0.032636188,
-0.2036225647,
-0.3690443933,
0.0673271939,
0.0478157252,
-0.1053123549,
0.3012901545,
0.1895496845,
-0.0706469119,
-0.0284741428,
-0.4572890997,
0.0877391323,
-0.1803112626,
0.0098783216,
-0.1076650098,
-0.1534429491,
-0.1983680278,
0.040002957,
0.116860263,
-0.2781752944,
-0.2616516054,
-0.3224227428,
-0.1180725992,
-0.1744087487,
0.1405442208,
-0.0200541932,
0.0511424616,
-0.0312802494,
0.1222997606,
0.1008712053,
0.1293455213,
-0.2491522133,
-0.167208299,
0.1939768642,
-0.052004464,
-0.0121717164,
-0.3335225284,
-0.2497051358,
0.3890590072,
-0.0699700862,
-0.0141934697,
-0.2141370624,
0.0942139849,
0.1669800282,
0.1398718059,
-0.2460225075,
0.2176398635,
-0.3044710755,
0.2614801526,
0.0384431593,
-0.2167222351,
0.3941025734,
0.2282126844,
-0.1222437844,
0.1697707325,
-0.2478059977,
0.169134587,
-0.0590035915,
-0.2350637317,
0.0723135695,
0.4840386212,
0.2467960119,
0.6211674809,
0.0489818081,
-0.0133376727,
-0.000104659,
-0.3113280237,
-0.1315823197,
-0.4311896563,
-0.0755137727,
0.2071561366,
-0.0991366208,
0.025744576,
0.4865766764,
-0.0850559846,
-0.3330842257,
0.2221699953,
-0.1734429002,
0.0490760766,
-0.1999393553,
0.1273281276,
-0.094773449,
0.0593056194,
0.001397786,
0.4046106339,
-0.5339139104,
-0.1491030306,
0.2374676615,
-0.2787155807,
0.2525823712,
-0.2517897785,
-0.9455536008,
0.3512923419,
-0.8524879813,
0.0949762985,
0.0165478121,
0.2276024818,
0.0475076474,
-0.0270617194,
0.116301097,
-0.0324513875,
0.1658133417,
-0.0538088381,
-0.0845551938,
0.2370496392,
-0.5604740977,
-0.1172572598,
-0.1456516236,
-0.0787851959,
0.1936263442,
0.5949997902,
0.7412644029,
-0.0944306627,
-0.2862771749,
-0.3504448533,
-0.0479066707,
0.0696777776,
0.0392844714,
-0.0138419215,
-0.1023690179,
-0.1808015108,
0.0108177979,
0.1023748741,
0.1822671741,
0.1334198415,
-0.1541094631,
-0.0875531435,
0.1505204439,
0.3036971986,
0.2778021693,
0.2423069924,
-0.0387685634,
0.3437796235,
0.3173718452,
0.1055742577,
-0.1110975668,
-0.1575467139,
0.218151778,
-0.3695305884,
0.0900226161,
0.0998717472,
0.0671067163,
0.1695055962,
-0.0323254652,
0.2138264328,
-0.2696320713,
0.3467109203,
-0.1918302476,
0.3990118504,
0.5268699527,
0.1344356239,
-0.5008948445,
-0.3026988208,
0.0710378662,
0.5278066397,
-0.2671489716,
0.436906606,
-0.480276674,
-0.4048760533,
0.4786455631,
0.2622503936,
0.5893495679,
-0.0001973089,
0.2131255269,
0.2467376292,
0.2820874751,
0.1871794313,
-0.4422437549,
-0.128349781,
-0.2351829559,
0.218982175,
0.0433000661,
-0.0735478103,
0.0681040883,
0.2392939478,
-0.1190580502,
-0.070746474,
0.1343747228,
0.8829228282,
-0.0130435945,
0.302734077,
0.4876134098,
-0.3995562196,
0.3429581225,
0.139388144,
0.2241424024,
0.0627054423,
0.0940345749,
0.0973554701,
-0.0682933852,
-0.1550719887,
-0.2499285191,
-0.2025585771,
-0.5686982274,
0.297793299,
-0.2047142088,
0.0308007114,
0.079801023,
0.1448376179,
0.0416583233,
0.240643099,
0.006632573,
0.288567096,
0.2132267505,
0.3364418149,
0.2534502149,
-0.5096055269,
-0.1977290064,
-0.0098065846,
-0.0152438125,
0.1644135565,
-0.2644810379,
-0.3185323477,
-0.6420419812,
-0.0458641909,
0.304049015,
-0.3656049669,
0.0190449804,
0.1011227295,
-0.0792651102,
-0.1980583966,
0.0806414336,
-0.1534317732,
0.0853770971,
0.4080637991,
-0.0744124949,
-0.2806638777,
0.018494064,
0.3022502661,
0.1215463802,
-0.2107042223,
0.4307022393,
-0.4703118503,
-0.2629355788,
-0.1035873294,
0.2154366076,
0.1363150179,
0.1198757887,
0.0926351324,
-0.1318541765,
-0.1832281202,
0.0951460227,
0.2641551197,
-0.1274953336,
-0.1099076942,
-0.1724203676,
-0.0183413699,
-0.3060437143,
-0.010590571,
-0.059931308,
0.0916232169,
0.0973536149,
0.1349284202,
-0.3185408711,
0.1697501987,
-0.257768333,
-0.1210308895,
0.1259122789,
0.153881073,
-0.201411128,
-0.1586651802,
0.1208087951,
0.0411623493,
0.0997673124,
0.2575888932,
0.0350962058,
-0.2286946476,
-0.0834931955,
0.1424898654,
0.0466305539,
-0.360457778,
0.065940775,
0.1358203888,
-0.0845476836,
-0.5128016472,
0.2053452879,
0.1716240197,
0.0137767466,
-0.4263346195,
0.1967775226,
-0.0045446618,
-0.006976604,
0.1540152282,
-0.0409203246,
0.0195883419,
0.109384343,
0.216730237,
0.1208918095,
-0.203953445,
0.0436545424,
0.2604888678,
0.3350318968,
0.1718847156,
0.0119803064,
-0.0260329749,
-0.0632948205,
0.1637772322,
-0.169979617,
0.212677896,
-0.2245703191,
-0.4430893362,
0.206537962,
0.1477204561,
0.0679500699,
-0.2368669212,
0.4112254679,
-0.2698411942,
0.1705465615,
0.0537063852,
0.2234907448,
0.2558572292,
-0.2167447656,
-0.1678138673,
0.458050251,
-0.1856303066,
0.0927563384,
0.1185214072,
-0.0464377776,
0.0143658705,
0.323636502,
0.089629747,
0.1318291128,
0.4207835197,
0.206501469,
0.2570440471,
0.2392932624,
0.3731355369,
-0.1887238175,
-0.2324148864,
-0.0579186045,
0.4835403562,
-0.3375785649,
0.1452248394,
-0.0031017212,
-0.0090718167,
0.0150641305,
-0.557723999,
-0.0361897498,
0.3808558285,
-0.3738012612,
-0.2634641826,
-0.1039748564,
0.0000506653,
-0.0444149971,
0.357973367,
-0.1306928843,
-0.0440517105,
-0.3228885531,
-0.1085640565,
-0.070135884,
0.1116298735,
-0.2539830506,
-0.2345301956,
0.218488574,
-0.2175603509,
0.2340624183,
-0.4240420461,
0.1349431425,
-0.0556654632,
0.3740639389,
0.3734025061,
0.2763726115,
-0.1379141659,
0.0604413971,
-0.0782147869,
0.0910297781,
0.0376119427,
0.1411616653,
-0.073115699,
-0.3212689757,
0.1342653185,
0.0041141552,
-0.1798273921,
-0.3566518426,
0.0329825208,
-0.1090816036,
0.1966266483,
0.2209126055,
0.0509851798,
-0.1480569839,
0.1166607291,
0.0628017634,
0.0814494416,
-0.1601274163,
0.1489978284,
0.0793071836,
0.1826461107,
-0.0843047053,
0.0706104264,
0.0378759503,
0.4189381897,
0.0274147801,
-0.1120420322,
-0.3786530495,
-0.3307703435,
-0.3441820443,
-0.0883446783,
-0.1933035403,
0.1373800337,
-0.0022711691,
0.090537779,
0.176057294,
0.1948622763,
0.2074846625,
0.1234854013,
-0.2083262205,
-0.099849984,
-0.2851066887,
0.4816953838,
-0.1726652533,
0.039655365,
0.0064430898,
-0.3506655395,
0.4216939509,
0.016045969,
0.1311934143,
-0.1760371476,
0.0523304716,
-0.0212396886,
0.0931963027,
0.6377807856,
0.1688712984,
0.0617192015,
-0.0346785784,
0.1621492803,
0.1541452855,
0.1810175478,
-0.2202599496,
0.0676567107,
-0.0157292094,
-0.0018751784,
0.0582157932,
0.0275884606,
-0.0795356333,
-0.1120132655,
0.1741835624,
-0.0966246724,
-0.2279874831,
-0.0935886577,
0.0079854485,
0.12249396,
-0.2413400263,
0.3319844604,
0.0734153017,
0.2080665082,
-0.3973878324,
-0.0614512414,
0.4318277836,
-0.6654881239,
-0.1201496348,
-0.2693096101,
-0.0117829209,
0.3286217153,
0.1732207388,
-0.105751805,
-0.2817884088,
0.5291824341,
0.0278507657,
-0.2813952565,
0.3174489141,
-0.0696156919,
-0.0076538348,
-0.0337327458,
0.3865730762,
-0.2410534322,
-0.1833972335,
-0.0738726333,
-0.044959195
] |
https://github.com/huggingface/datasets/issues/1830 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? | Hi yes, I'm closing the loop here with some timings below. The issue seems to be at least somewhat/mainly with the tokenizer's themselves. Moreover legacy saves of the trainer tokenizer perform faster but differently than the new tokenizer.json saves(note nothing about the training process/adding of special tokens changed between the top two trained tokenizer tests, only the way it was saved). This is only a 3x slowdown vs like a 10x but I think the slowdown is most likely due to this.
```
trained tokenizer - tokenizer.json save (same results for AutoTokenizer legacy_format=False):
Tokenizer time(seconds): 0.32767510414123535
Tokenized avg. length: 323.01
trained tokenizer - AutoTokenizer legacy_format=True:
Tokenizer time(seconds): 0.09258866310119629
Tokenized avg. length: 301.01
GPT2 Tokenizer from huggingface
Tokenizer time(seconds): 0.1010282039642334
Tokenized avg. length: 461.21
``` | This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
| 124 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer?
This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
Hi yes, I'm closing the loop here with some timings below. The issue seems to be at least somewhat/mainly with the tokenizer's themselves. Moreover legacy saves of the trainer tokenizer perform faster but differently than the new tokenizer.json saves(note nothing about the training process/adding of special tokens changed between the top two trained tokenizer tests, only the way it was saved). This is only a 3x slowdown vs like a 10x but I think the slowdown is most likely due to this.
```
trained tokenizer - tokenizer.json save (same results for AutoTokenizer legacy_format=False):
Tokenizer time(seconds): 0.32767510414123535
Tokenized avg. length: 323.01
trained tokenizer - AutoTokenizer legacy_format=True:
Tokenizer time(seconds): 0.09258866310119629
Tokenized avg. length: 301.01
GPT2 Tokenizer from huggingface
Tokenizer time(seconds): 0.1010282039642334
Tokenized avg. length: 461.21
``` | [
-0.40404737,
-0.0130074006,
-0.1024704129,
0.1034294739,
0.1453052163,
-0.1225538552,
0.2550543845,
0.1890889108,
0.1306776851,
-0.006502152,
-0.0542232022,
0.4988860786,
-0.1724810451,
-0.2727595866,
-0.1320427358,
0.0650426075,
0.2197590768,
0.0224167742,
0.241645202,
-0.0342864916,
-0.1218727008,
0.1023018658,
-0.1767258048,
0.2413994074,
-0.3152629733,
-0.07799308,
0.0812310278,
-0.209633559,
-0.0027562869,
-0.5689615011,
-0.2084297538,
0.1581246704,
0.0209431909,
0.5331247449,
-0.0001148737,
0.0403424352,
-0.0291635897,
0.2731474936,
0.1347175837,
0.0443615541,
0.3529543579,
-0.1942857206,
-0.1685833186,
-0.2257664502,
-0.0541707911,
-0.2808631659,
-0.0221224949,
-0.2241772413,
0.0683083087,
0.0300420634,
0.1608586162,
0.1151948944,
-0.3964318931,
-0.0595158376,
-0.0024587174,
-0.1042250991,
-0.0991548225,
0.0140271476,
0.0713294595,
-0.255187124,
-0.2116563171,
0.1949045062,
-0.2130432874,
-0.1478140056,
0.2687232494,
0.2163694352,
0.0346122161,
-0.2425244898,
0.1680866778,
0.2316349894,
0.0670108199,
-0.0272127744,
-0.0171247311,
-0.3350792825,
-0.3706912398,
-0.0284825563,
0.1461225599,
-0.4334976971,
-0.1206514686,
-0.0896025151,
-0.4140654504,
0.2037733048,
0.2642426789,
-0.1223936826,
-0.2039304525,
0.4352439344,
0.0954283923,
0.1497345716,
0.1041519642,
-0.0997518077,
-0.2807915509,
-0.264377743,
-0.1595771015,
0.3733043075,
-0.3415874839,
-0.1739549935,
0.2692954838,
-0.3091348112,
-0.1407883614,
0.1142804325,
-0.1424312741,
0.1946653128,
0.2083412707,
-0.0471199378,
0.0663069785,
0.2460044473,
0.038447544,
0.1738463342,
0.0296909045,
-0.4802924693,
-0.3160503805,
-0.0903608724,
-0.1888757348,
0.0202141274,
0.345872134,
-0.2424586564,
-0.2370805889,
-0.0725834295,
-0.0205962602,
-0.1713075787,
-0.3799442649,
-0.0983374491,
0.0658609793,
0.1854549646,
0.058747232,
0.0610379986,
-0.364798218,
-0.2021664977,
-0.092831552,
-0.076726146,
-0.1286276728,
-0.1720003635,
-0.1044917852,
0.2542574704,
-0.1882733256,
0.0913058221,
0.2601751089,
0.0789948776,
-0.1153762266,
0.2103087008,
0.2196047604,
-0.3643231392,
0.104728356,
-0.1130543202,
0.0748010278,
0.4360268116,
-0.0055077421,
0.0017844305,
-0.2595285475,
0.2082756162,
-0.264908731,
-0.2264891863,
0.2413855642,
0.1191598997,
-0.0831421167,
-0.1221607774,
-0.4942295849,
0.4385454655,
0.2539224625,
-0.1163534075,
-0.0749134943,
-0.1809134334,
-0.5298197269,
-0.2167423815,
0.267924726,
-0.0187719055,
-0.0722124949,
-0.193780005,
0.3418036997,
0.1921719909,
0.3103511035,
0.643055737,
-0.3864825368,
0.7953375578,
-0.1250497997,
0.7483618259,
0.2579940856,
-0.2477055043,
-0.377818048,
0.1166384593,
-0.1784684807,
0.2722211778,
-0.2818517089,
-0.1200629249,
0.702637136,
-0.2252788097,
0.3419843614,
0.106144309,
0.2469955385,
0.3040956855,
-0.2483735234,
-0.0491900817,
0.5504584312,
-0.0802224502,
-0.2242528796,
-0.1509811729,
-0.1534065008,
0.1111334488,
-0.0315547623,
-0.1203735694,
-0.1554093063,
0.0617320612,
0.0151113877,
0.0270558447,
-0.0637359023,
0.2192265391,
0.1471123695,
0.2171942145,
0.0741172284,
0.0683927312,
0.429030776,
-0.0061166505,
0.105516538,
-0.0645507649,
-0.1504325718,
-0.1419281512,
0.1726527661,
0.1282208711,
0.0678982735,
0.0891925842,
0.231172502,
-0.1069800332,
0.0154443318,
0.1270229667,
0.4437766969,
-0.3041421473,
0.1406869292,
-0.1602892578,
-0.1061220318,
-0.1936034113,
0.1408743411,
0.1087324023,
-0.1834658831,
0.1624327451,
0.1247906908,
0.3094664812,
-0.1730700582,
0.2074124068,
0.1145596206,
0.2654833496,
0.0448613949,
0.1117051616,
0.0164179187,
-0.1618008763,
-0.1011433154,
0.2487524599,
0.7665549517,
0.2934232652,
-0.0981311202,
-0.1918503195,
-0.0074496386,
0.2052227855,
0.1254599392,
0.0902862996,
-0.0172136594,
0.3012904525,
0.4247046113,
0.1712669581,
0.350859046,
0.4743337929,
0.5267605186,
-0.1261988878,
-0.2109233439,
0.1169244573,
-0.3413846493,
-0.4390027821,
-0.0324557349,
-0.4132478535,
0.1679464877,
0.1043306813,
0.2238327563,
-0.1689834744,
-0.0138752004,
0.0025530215,
0.2727620602,
0.2319282591,
-0.0062526651,
-0.0347079486,
0.1677316129,
0.2354775071,
-0.3278359175,
-0.1683430672,
-0.0177448075,
0.2466843426,
-0.0202031638,
-0.0880930498,
0.0660285205,
0.1790388525,
0.4836560786,
-0.0730331838,
0.0438802801,
-0.2336484939,
-0.0868268013,
0.0112863081,
0.0730062202,
0.1429344863,
0.2016054988,
0.0416047648,
0.0553794317,
-0.1324758232,
-0.032636188,
-0.2036225647,
-0.3690443933,
0.0673271939,
0.0478157252,
-0.1053123549,
0.3012901545,
0.1895496845,
-0.0706469119,
-0.0284741428,
-0.4572890997,
0.0877391323,
-0.1803112626,
0.0098783216,
-0.1076650098,
-0.1534429491,
-0.1983680278,
0.040002957,
0.116860263,
-0.2781752944,
-0.2616516054,
-0.3224227428,
-0.1180725992,
-0.1744087487,
0.1405442208,
-0.0200541932,
0.0511424616,
-0.0312802494,
0.1222997606,
0.1008712053,
0.1293455213,
-0.2491522133,
-0.167208299,
0.1939768642,
-0.052004464,
-0.0121717164,
-0.3335225284,
-0.2497051358,
0.3890590072,
-0.0699700862,
-0.0141934697,
-0.2141370624,
0.0942139849,
0.1669800282,
0.1398718059,
-0.2460225075,
0.2176398635,
-0.3044710755,
0.2614801526,
0.0384431593,
-0.2167222351,
0.3941025734,
0.2282126844,
-0.1222437844,
0.1697707325,
-0.2478059977,
0.169134587,
-0.0590035915,
-0.2350637317,
0.0723135695,
0.4840386212,
0.2467960119,
0.6211674809,
0.0489818081,
-0.0133376727,
-0.000104659,
-0.3113280237,
-0.1315823197,
-0.4311896563,
-0.0755137727,
0.2071561366,
-0.0991366208,
0.025744576,
0.4865766764,
-0.0850559846,
-0.3330842257,
0.2221699953,
-0.1734429002,
0.0490760766,
-0.1999393553,
0.1273281276,
-0.094773449,
0.0593056194,
0.001397786,
0.4046106339,
-0.5339139104,
-0.1491030306,
0.2374676615,
-0.2787155807,
0.2525823712,
-0.2517897785,
-0.9455536008,
0.3512923419,
-0.8524879813,
0.0949762985,
0.0165478121,
0.2276024818,
0.0475076474,
-0.0270617194,
0.116301097,
-0.0324513875,
0.1658133417,
-0.0538088381,
-0.0845551938,
0.2370496392,
-0.5604740977,
-0.1172572598,
-0.1456516236,
-0.0787851959,
0.1936263442,
0.5949997902,
0.7412644029,
-0.0944306627,
-0.2862771749,
-0.3504448533,
-0.0479066707,
0.0696777776,
0.0392844714,
-0.0138419215,
-0.1023690179,
-0.1808015108,
0.0108177979,
0.1023748741,
0.1822671741,
0.1334198415,
-0.1541094631,
-0.0875531435,
0.1505204439,
0.3036971986,
0.2778021693,
0.2423069924,
-0.0387685634,
0.3437796235,
0.3173718452,
0.1055742577,
-0.1110975668,
-0.1575467139,
0.218151778,
-0.3695305884,
0.0900226161,
0.0998717472,
0.0671067163,
0.1695055962,
-0.0323254652,
0.2138264328,
-0.2696320713,
0.3467109203,
-0.1918302476,
0.3990118504,
0.5268699527,
0.1344356239,
-0.5008948445,
-0.3026988208,
0.0710378662,
0.5278066397,
-0.2671489716,
0.436906606,
-0.480276674,
-0.4048760533,
0.4786455631,
0.2622503936,
0.5893495679,
-0.0001973089,
0.2131255269,
0.2467376292,
0.2820874751,
0.1871794313,
-0.4422437549,
-0.128349781,
-0.2351829559,
0.218982175,
0.0433000661,
-0.0735478103,
0.0681040883,
0.2392939478,
-0.1190580502,
-0.070746474,
0.1343747228,
0.8829228282,
-0.0130435945,
0.302734077,
0.4876134098,
-0.3995562196,
0.3429581225,
0.139388144,
0.2241424024,
0.0627054423,
0.0940345749,
0.0973554701,
-0.0682933852,
-0.1550719887,
-0.2499285191,
-0.2025585771,
-0.5686982274,
0.297793299,
-0.2047142088,
0.0308007114,
0.079801023,
0.1448376179,
0.0416583233,
0.240643099,
0.006632573,
0.288567096,
0.2132267505,
0.3364418149,
0.2534502149,
-0.5096055269,
-0.1977290064,
-0.0098065846,
-0.0152438125,
0.1644135565,
-0.2644810379,
-0.3185323477,
-0.6420419812,
-0.0458641909,
0.304049015,
-0.3656049669,
0.0190449804,
0.1011227295,
-0.0792651102,
-0.1980583966,
0.0806414336,
-0.1534317732,
0.0853770971,
0.4080637991,
-0.0744124949,
-0.2806638777,
0.018494064,
0.3022502661,
0.1215463802,
-0.2107042223,
0.4307022393,
-0.4703118503,
-0.2629355788,
-0.1035873294,
0.2154366076,
0.1363150179,
0.1198757887,
0.0926351324,
-0.1318541765,
-0.1832281202,
0.0951460227,
0.2641551197,
-0.1274953336,
-0.1099076942,
-0.1724203676,
-0.0183413699,
-0.3060437143,
-0.010590571,
-0.059931308,
0.0916232169,
0.0973536149,
0.1349284202,
-0.3185408711,
0.1697501987,
-0.257768333,
-0.1210308895,
0.1259122789,
0.153881073,
-0.201411128,
-0.1586651802,
0.1208087951,
0.0411623493,
0.0997673124,
0.2575888932,
0.0350962058,
-0.2286946476,
-0.0834931955,
0.1424898654,
0.0466305539,
-0.360457778,
0.065940775,
0.1358203888,
-0.0845476836,
-0.5128016472,
0.2053452879,
0.1716240197,
0.0137767466,
-0.4263346195,
0.1967775226,
-0.0045446618,
-0.006976604,
0.1540152282,
-0.0409203246,
0.0195883419,
0.109384343,
0.216730237,
0.1208918095,
-0.203953445,
0.0436545424,
0.2604888678,
0.3350318968,
0.1718847156,
0.0119803064,
-0.0260329749,
-0.0632948205,
0.1637772322,
-0.169979617,
0.212677896,
-0.2245703191,
-0.4430893362,
0.206537962,
0.1477204561,
0.0679500699,
-0.2368669212,
0.4112254679,
-0.2698411942,
0.1705465615,
0.0537063852,
0.2234907448,
0.2558572292,
-0.2167447656,
-0.1678138673,
0.458050251,
-0.1856303066,
0.0927563384,
0.1185214072,
-0.0464377776,
0.0143658705,
0.323636502,
0.089629747,
0.1318291128,
0.4207835197,
0.206501469,
0.2570440471,
0.2392932624,
0.3731355369,
-0.1887238175,
-0.2324148864,
-0.0579186045,
0.4835403562,
-0.3375785649,
0.1452248394,
-0.0031017212,
-0.0090718167,
0.0150641305,
-0.557723999,
-0.0361897498,
0.3808558285,
-0.3738012612,
-0.2634641826,
-0.1039748564,
0.0000506653,
-0.0444149971,
0.357973367,
-0.1306928843,
-0.0440517105,
-0.3228885531,
-0.1085640565,
-0.070135884,
0.1116298735,
-0.2539830506,
-0.2345301956,
0.218488574,
-0.2175603509,
0.2340624183,
-0.4240420461,
0.1349431425,
-0.0556654632,
0.3740639389,
0.3734025061,
0.2763726115,
-0.1379141659,
0.0604413971,
-0.0782147869,
0.0910297781,
0.0376119427,
0.1411616653,
-0.073115699,
-0.3212689757,
0.1342653185,
0.0041141552,
-0.1798273921,
-0.3566518426,
0.0329825208,
-0.1090816036,
0.1966266483,
0.2209126055,
0.0509851798,
-0.1480569839,
0.1166607291,
0.0628017634,
0.0814494416,
-0.1601274163,
0.1489978284,
0.0793071836,
0.1826461107,
-0.0843047053,
0.0706104264,
0.0378759503,
0.4189381897,
0.0274147801,
-0.1120420322,
-0.3786530495,
-0.3307703435,
-0.3441820443,
-0.0883446783,
-0.1933035403,
0.1373800337,
-0.0022711691,
0.090537779,
0.176057294,
0.1948622763,
0.2074846625,
0.1234854013,
-0.2083262205,
-0.099849984,
-0.2851066887,
0.4816953838,
-0.1726652533,
0.039655365,
0.0064430898,
-0.3506655395,
0.4216939509,
0.016045969,
0.1311934143,
-0.1760371476,
0.0523304716,
-0.0212396886,
0.0931963027,
0.6377807856,
0.1688712984,
0.0617192015,
-0.0346785784,
0.1621492803,
0.1541452855,
0.1810175478,
-0.2202599496,
0.0676567107,
-0.0157292094,
-0.0018751784,
0.0582157932,
0.0275884606,
-0.0795356333,
-0.1120132655,
0.1741835624,
-0.0966246724,
-0.2279874831,
-0.0935886577,
0.0079854485,
0.12249396,
-0.2413400263,
0.3319844604,
0.0734153017,
0.2080665082,
-0.3973878324,
-0.0614512414,
0.4318277836,
-0.6654881239,
-0.1201496348,
-0.2693096101,
-0.0117829209,
0.3286217153,
0.1732207388,
-0.105751805,
-0.2817884088,
0.5291824341,
0.0278507657,
-0.2813952565,
0.3174489141,
-0.0696156919,
-0.0076538348,
-0.0337327458,
0.3865730762,
-0.2410534322,
-0.1833972335,
-0.0738726333,
-0.044959195
] |
https://github.com/huggingface/datasets/issues/1830 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? | @lhoestq ,
Hi, which version of datasets has datasets.set_caching_enabled(False)? I get
module 'datasets' has no attribute 'set_caching_enabled'. To hopefully get around this, I reran my code on a new set of data, and did so only once.
@johncookds , thanks for chiming in, it looks this might be an issue of Tokenizer.
**Tokenizer**: The runtime of GPT2TokenizerFast.from_pretrained("gpt2") on 1000 chars is: **143 ms**
**SlowTokenizer**: The runtime of a locally saved and loaded Tokenizer using the same vocab on 1000 chars is: **4.43 s**
That being said, I compared performance on the map function:
Running Tokenizer versus using it in the map function for 1000 chars goes from **141 ms** to **356 ms**
Running SlowTokenizer versus using it in the map function for 1000 chars with a single element goes from **4.43 s** to **9.76 s**
I'm trying to figure out why the overhead of map would increase the time by double (figured it would be a fixed increase in time)? Though maybe this is expected behavior.
@lhoestq, do you by chance know how I can redirect this issue to Tokenizer?
Regards,
Michael | This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
| 182 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer?
This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
@lhoestq ,
Hi, which version of datasets has datasets.set_caching_enabled(False)? I get
module 'datasets' has no attribute 'set_caching_enabled'. To hopefully get around this, I reran my code on a new set of data, and did so only once.
@johncookds , thanks for chiming in, it looks this might be an issue of Tokenizer.
**Tokenizer**: The runtime of GPT2TokenizerFast.from_pretrained("gpt2") on 1000 chars is: **143 ms**
**SlowTokenizer**: The runtime of a locally saved and loaded Tokenizer using the same vocab on 1000 chars is: **4.43 s**
That being said, I compared performance on the map function:
Running Tokenizer versus using it in the map function for 1000 chars goes from **141 ms** to **356 ms**
Running SlowTokenizer versus using it in the map function for 1000 chars with a single element goes from **4.43 s** to **9.76 s**
I'm trying to figure out why the overhead of map would increase the time by double (figured it would be a fixed increase in time)? Though maybe this is expected behavior.
@lhoestq, do you by chance know how I can redirect this issue to Tokenizer?
Regards,
Michael | [
-0.40404737,
-0.0130074006,
-0.1024704129,
0.1034294739,
0.1453052163,
-0.1225538552,
0.2550543845,
0.1890889108,
0.1306776851,
-0.006502152,
-0.0542232022,
0.4988860786,
-0.1724810451,
-0.2727595866,
-0.1320427358,
0.0650426075,
0.2197590768,
0.0224167742,
0.241645202,
-0.0342864916,
-0.1218727008,
0.1023018658,
-0.1767258048,
0.2413994074,
-0.3152629733,
-0.07799308,
0.0812310278,
-0.209633559,
-0.0027562869,
-0.5689615011,
-0.2084297538,
0.1581246704,
0.0209431909,
0.5331247449,
-0.0001148737,
0.0403424352,
-0.0291635897,
0.2731474936,
0.1347175837,
0.0443615541,
0.3529543579,
-0.1942857206,
-0.1685833186,
-0.2257664502,
-0.0541707911,
-0.2808631659,
-0.0221224949,
-0.2241772413,
0.0683083087,
0.0300420634,
0.1608586162,
0.1151948944,
-0.3964318931,
-0.0595158376,
-0.0024587174,
-0.1042250991,
-0.0991548225,
0.0140271476,
0.0713294595,
-0.255187124,
-0.2116563171,
0.1949045062,
-0.2130432874,
-0.1478140056,
0.2687232494,
0.2163694352,
0.0346122161,
-0.2425244898,
0.1680866778,
0.2316349894,
0.0670108199,
-0.0272127744,
-0.0171247311,
-0.3350792825,
-0.3706912398,
-0.0284825563,
0.1461225599,
-0.4334976971,
-0.1206514686,
-0.0896025151,
-0.4140654504,
0.2037733048,
0.2642426789,
-0.1223936826,
-0.2039304525,
0.4352439344,
0.0954283923,
0.1497345716,
0.1041519642,
-0.0997518077,
-0.2807915509,
-0.264377743,
-0.1595771015,
0.3733043075,
-0.3415874839,
-0.1739549935,
0.2692954838,
-0.3091348112,
-0.1407883614,
0.1142804325,
-0.1424312741,
0.1946653128,
0.2083412707,
-0.0471199378,
0.0663069785,
0.2460044473,
0.038447544,
0.1738463342,
0.0296909045,
-0.4802924693,
-0.3160503805,
-0.0903608724,
-0.1888757348,
0.0202141274,
0.345872134,
-0.2424586564,
-0.2370805889,
-0.0725834295,
-0.0205962602,
-0.1713075787,
-0.3799442649,
-0.0983374491,
0.0658609793,
0.1854549646,
0.058747232,
0.0610379986,
-0.364798218,
-0.2021664977,
-0.092831552,
-0.076726146,
-0.1286276728,
-0.1720003635,
-0.1044917852,
0.2542574704,
-0.1882733256,
0.0913058221,
0.2601751089,
0.0789948776,
-0.1153762266,
0.2103087008,
0.2196047604,
-0.3643231392,
0.104728356,
-0.1130543202,
0.0748010278,
0.4360268116,
-0.0055077421,
0.0017844305,
-0.2595285475,
0.2082756162,
-0.264908731,
-0.2264891863,
0.2413855642,
0.1191598997,
-0.0831421167,
-0.1221607774,
-0.4942295849,
0.4385454655,
0.2539224625,
-0.1163534075,
-0.0749134943,
-0.1809134334,
-0.5298197269,
-0.2167423815,
0.267924726,
-0.0187719055,
-0.0722124949,
-0.193780005,
0.3418036997,
0.1921719909,
0.3103511035,
0.643055737,
-0.3864825368,
0.7953375578,
-0.1250497997,
0.7483618259,
0.2579940856,
-0.2477055043,
-0.377818048,
0.1166384593,
-0.1784684807,
0.2722211778,
-0.2818517089,
-0.1200629249,
0.702637136,
-0.2252788097,
0.3419843614,
0.106144309,
0.2469955385,
0.3040956855,
-0.2483735234,
-0.0491900817,
0.5504584312,
-0.0802224502,
-0.2242528796,
-0.1509811729,
-0.1534065008,
0.1111334488,
-0.0315547623,
-0.1203735694,
-0.1554093063,
0.0617320612,
0.0151113877,
0.0270558447,
-0.0637359023,
0.2192265391,
0.1471123695,
0.2171942145,
0.0741172284,
0.0683927312,
0.429030776,
-0.0061166505,
0.105516538,
-0.0645507649,
-0.1504325718,
-0.1419281512,
0.1726527661,
0.1282208711,
0.0678982735,
0.0891925842,
0.231172502,
-0.1069800332,
0.0154443318,
0.1270229667,
0.4437766969,
-0.3041421473,
0.1406869292,
-0.1602892578,
-0.1061220318,
-0.1936034113,
0.1408743411,
0.1087324023,
-0.1834658831,
0.1624327451,
0.1247906908,
0.3094664812,
-0.1730700582,
0.2074124068,
0.1145596206,
0.2654833496,
0.0448613949,
0.1117051616,
0.0164179187,
-0.1618008763,
-0.1011433154,
0.2487524599,
0.7665549517,
0.2934232652,
-0.0981311202,
-0.1918503195,
-0.0074496386,
0.2052227855,
0.1254599392,
0.0902862996,
-0.0172136594,
0.3012904525,
0.4247046113,
0.1712669581,
0.350859046,
0.4743337929,
0.5267605186,
-0.1261988878,
-0.2109233439,
0.1169244573,
-0.3413846493,
-0.4390027821,
-0.0324557349,
-0.4132478535,
0.1679464877,
0.1043306813,
0.2238327563,
-0.1689834744,
-0.0138752004,
0.0025530215,
0.2727620602,
0.2319282591,
-0.0062526651,
-0.0347079486,
0.1677316129,
0.2354775071,
-0.3278359175,
-0.1683430672,
-0.0177448075,
0.2466843426,
-0.0202031638,
-0.0880930498,
0.0660285205,
0.1790388525,
0.4836560786,
-0.0730331838,
0.0438802801,
-0.2336484939,
-0.0868268013,
0.0112863081,
0.0730062202,
0.1429344863,
0.2016054988,
0.0416047648,
0.0553794317,
-0.1324758232,
-0.032636188,
-0.2036225647,
-0.3690443933,
0.0673271939,
0.0478157252,
-0.1053123549,
0.3012901545,
0.1895496845,
-0.0706469119,
-0.0284741428,
-0.4572890997,
0.0877391323,
-0.1803112626,
0.0098783216,
-0.1076650098,
-0.1534429491,
-0.1983680278,
0.040002957,
0.116860263,
-0.2781752944,
-0.2616516054,
-0.3224227428,
-0.1180725992,
-0.1744087487,
0.1405442208,
-0.0200541932,
0.0511424616,
-0.0312802494,
0.1222997606,
0.1008712053,
0.1293455213,
-0.2491522133,
-0.167208299,
0.1939768642,
-0.052004464,
-0.0121717164,
-0.3335225284,
-0.2497051358,
0.3890590072,
-0.0699700862,
-0.0141934697,
-0.2141370624,
0.0942139849,
0.1669800282,
0.1398718059,
-0.2460225075,
0.2176398635,
-0.3044710755,
0.2614801526,
0.0384431593,
-0.2167222351,
0.3941025734,
0.2282126844,
-0.1222437844,
0.1697707325,
-0.2478059977,
0.169134587,
-0.0590035915,
-0.2350637317,
0.0723135695,
0.4840386212,
0.2467960119,
0.6211674809,
0.0489818081,
-0.0133376727,
-0.000104659,
-0.3113280237,
-0.1315823197,
-0.4311896563,
-0.0755137727,
0.2071561366,
-0.0991366208,
0.025744576,
0.4865766764,
-0.0850559846,
-0.3330842257,
0.2221699953,
-0.1734429002,
0.0490760766,
-0.1999393553,
0.1273281276,
-0.094773449,
0.0593056194,
0.001397786,
0.4046106339,
-0.5339139104,
-0.1491030306,
0.2374676615,
-0.2787155807,
0.2525823712,
-0.2517897785,
-0.9455536008,
0.3512923419,
-0.8524879813,
0.0949762985,
0.0165478121,
0.2276024818,
0.0475076474,
-0.0270617194,
0.116301097,
-0.0324513875,
0.1658133417,
-0.0538088381,
-0.0845551938,
0.2370496392,
-0.5604740977,
-0.1172572598,
-0.1456516236,
-0.0787851959,
0.1936263442,
0.5949997902,
0.7412644029,
-0.0944306627,
-0.2862771749,
-0.3504448533,
-0.0479066707,
0.0696777776,
0.0392844714,
-0.0138419215,
-0.1023690179,
-0.1808015108,
0.0108177979,
0.1023748741,
0.1822671741,
0.1334198415,
-0.1541094631,
-0.0875531435,
0.1505204439,
0.3036971986,
0.2778021693,
0.2423069924,
-0.0387685634,
0.3437796235,
0.3173718452,
0.1055742577,
-0.1110975668,
-0.1575467139,
0.218151778,
-0.3695305884,
0.0900226161,
0.0998717472,
0.0671067163,
0.1695055962,
-0.0323254652,
0.2138264328,
-0.2696320713,
0.3467109203,
-0.1918302476,
0.3990118504,
0.5268699527,
0.1344356239,
-0.5008948445,
-0.3026988208,
0.0710378662,
0.5278066397,
-0.2671489716,
0.436906606,
-0.480276674,
-0.4048760533,
0.4786455631,
0.2622503936,
0.5893495679,
-0.0001973089,
0.2131255269,
0.2467376292,
0.2820874751,
0.1871794313,
-0.4422437549,
-0.128349781,
-0.2351829559,
0.218982175,
0.0433000661,
-0.0735478103,
0.0681040883,
0.2392939478,
-0.1190580502,
-0.070746474,
0.1343747228,
0.8829228282,
-0.0130435945,
0.302734077,
0.4876134098,
-0.3995562196,
0.3429581225,
0.139388144,
0.2241424024,
0.0627054423,
0.0940345749,
0.0973554701,
-0.0682933852,
-0.1550719887,
-0.2499285191,
-0.2025585771,
-0.5686982274,
0.297793299,
-0.2047142088,
0.0308007114,
0.079801023,
0.1448376179,
0.0416583233,
0.240643099,
0.006632573,
0.288567096,
0.2132267505,
0.3364418149,
0.2534502149,
-0.5096055269,
-0.1977290064,
-0.0098065846,
-0.0152438125,
0.1644135565,
-0.2644810379,
-0.3185323477,
-0.6420419812,
-0.0458641909,
0.304049015,
-0.3656049669,
0.0190449804,
0.1011227295,
-0.0792651102,
-0.1980583966,
0.0806414336,
-0.1534317732,
0.0853770971,
0.4080637991,
-0.0744124949,
-0.2806638777,
0.018494064,
0.3022502661,
0.1215463802,
-0.2107042223,
0.4307022393,
-0.4703118503,
-0.2629355788,
-0.1035873294,
0.2154366076,
0.1363150179,
0.1198757887,
0.0926351324,
-0.1318541765,
-0.1832281202,
0.0951460227,
0.2641551197,
-0.1274953336,
-0.1099076942,
-0.1724203676,
-0.0183413699,
-0.3060437143,
-0.010590571,
-0.059931308,
0.0916232169,
0.0973536149,
0.1349284202,
-0.3185408711,
0.1697501987,
-0.257768333,
-0.1210308895,
0.1259122789,
0.153881073,
-0.201411128,
-0.1586651802,
0.1208087951,
0.0411623493,
0.0997673124,
0.2575888932,
0.0350962058,
-0.2286946476,
-0.0834931955,
0.1424898654,
0.0466305539,
-0.360457778,
0.065940775,
0.1358203888,
-0.0845476836,
-0.5128016472,
0.2053452879,
0.1716240197,
0.0137767466,
-0.4263346195,
0.1967775226,
-0.0045446618,
-0.006976604,
0.1540152282,
-0.0409203246,
0.0195883419,
0.109384343,
0.216730237,
0.1208918095,
-0.203953445,
0.0436545424,
0.2604888678,
0.3350318968,
0.1718847156,
0.0119803064,
-0.0260329749,
-0.0632948205,
0.1637772322,
-0.169979617,
0.212677896,
-0.2245703191,
-0.4430893362,
0.206537962,
0.1477204561,
0.0679500699,
-0.2368669212,
0.4112254679,
-0.2698411942,
0.1705465615,
0.0537063852,
0.2234907448,
0.2558572292,
-0.2167447656,
-0.1678138673,
0.458050251,
-0.1856303066,
0.0927563384,
0.1185214072,
-0.0464377776,
0.0143658705,
0.323636502,
0.089629747,
0.1318291128,
0.4207835197,
0.206501469,
0.2570440471,
0.2392932624,
0.3731355369,
-0.1887238175,
-0.2324148864,
-0.0579186045,
0.4835403562,
-0.3375785649,
0.1452248394,
-0.0031017212,
-0.0090718167,
0.0150641305,
-0.557723999,
-0.0361897498,
0.3808558285,
-0.3738012612,
-0.2634641826,
-0.1039748564,
0.0000506653,
-0.0444149971,
0.357973367,
-0.1306928843,
-0.0440517105,
-0.3228885531,
-0.1085640565,
-0.070135884,
0.1116298735,
-0.2539830506,
-0.2345301956,
0.218488574,
-0.2175603509,
0.2340624183,
-0.4240420461,
0.1349431425,
-0.0556654632,
0.3740639389,
0.3734025061,
0.2763726115,
-0.1379141659,
0.0604413971,
-0.0782147869,
0.0910297781,
0.0376119427,
0.1411616653,
-0.073115699,
-0.3212689757,
0.1342653185,
0.0041141552,
-0.1798273921,
-0.3566518426,
0.0329825208,
-0.1090816036,
0.1966266483,
0.2209126055,
0.0509851798,
-0.1480569839,
0.1166607291,
0.0628017634,
0.0814494416,
-0.1601274163,
0.1489978284,
0.0793071836,
0.1826461107,
-0.0843047053,
0.0706104264,
0.0378759503,
0.4189381897,
0.0274147801,
-0.1120420322,
-0.3786530495,
-0.3307703435,
-0.3441820443,
-0.0883446783,
-0.1933035403,
0.1373800337,
-0.0022711691,
0.090537779,
0.176057294,
0.1948622763,
0.2074846625,
0.1234854013,
-0.2083262205,
-0.099849984,
-0.2851066887,
0.4816953838,
-0.1726652533,
0.039655365,
0.0064430898,
-0.3506655395,
0.4216939509,
0.016045969,
0.1311934143,
-0.1760371476,
0.0523304716,
-0.0212396886,
0.0931963027,
0.6377807856,
0.1688712984,
0.0617192015,
-0.0346785784,
0.1621492803,
0.1541452855,
0.1810175478,
-0.2202599496,
0.0676567107,
-0.0157292094,
-0.0018751784,
0.0582157932,
0.0275884606,
-0.0795356333,
-0.1120132655,
0.1741835624,
-0.0966246724,
-0.2279874831,
-0.0935886577,
0.0079854485,
0.12249396,
-0.2413400263,
0.3319844604,
0.0734153017,
0.2080665082,
-0.3973878324,
-0.0614512414,
0.4318277836,
-0.6654881239,
-0.1201496348,
-0.2693096101,
-0.0117829209,
0.3286217153,
0.1732207388,
-0.105751805,
-0.2817884088,
0.5291824341,
0.0278507657,
-0.2813952565,
0.3174489141,
-0.0696156919,
-0.0076538348,
-0.0337327458,
0.3865730762,
-0.2410534322,
-0.1833972335,
-0.0738726333,
-0.044959195
] |
https://github.com/huggingface/datasets/issues/1830 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? | Thanks for the experiments @johncookds and @wumpusman !
> Hi, which version of datasets has datasets.set_caching_enabled(False)?
Currently you have to install `datasets` from source to have this feature, but this will be available in the next release in a few days.
> I'm trying to figure out why the overhead of map would increase the time by double (figured it would be a fixed increase in time)? Though maybe this is expected behavior.
Could you also try with double the number of characters ? This should let us have an idea of the fixed cost (hashing) and the dynamic cost (actual tokenization, grows with the size of the input)
> @lhoestq, do you by chance know how I can redirect this issue to Tokenizer?
Feel free to post an issue on the `transformers` repo. Also I'm sure there should be related issues so you can also look for someone with the same concerns on the `transformers` repo. | This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
| 157 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer?
This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
Thanks for the experiments @johncookds and @wumpusman !
> Hi, which version of datasets has datasets.set_caching_enabled(False)?
Currently you have to install `datasets` from source to have this feature, but this will be available in the next release in a few days.
> I'm trying to figure out why the overhead of map would increase the time by double (figured it would be a fixed increase in time)? Though maybe this is expected behavior.
Could you also try with double the number of characters ? This should let us have an idea of the fixed cost (hashing) and the dynamic cost (actual tokenization, grows with the size of the input)
> @lhoestq, do you by chance know how I can redirect this issue to Tokenizer?
Feel free to post an issue on the `transformers` repo. Also I'm sure there should be related issues so you can also look for someone with the same concerns on the `transformers` repo. | [
-0.40404737,
-0.0130074006,
-0.1024704129,
0.1034294739,
0.1453052163,
-0.1225538552,
0.2550543845,
0.1890889108,
0.1306776851,
-0.006502152,
-0.0542232022,
0.4988860786,
-0.1724810451,
-0.2727595866,
-0.1320427358,
0.0650426075,
0.2197590768,
0.0224167742,
0.241645202,
-0.0342864916,
-0.1218727008,
0.1023018658,
-0.1767258048,
0.2413994074,
-0.3152629733,
-0.07799308,
0.0812310278,
-0.209633559,
-0.0027562869,
-0.5689615011,
-0.2084297538,
0.1581246704,
0.0209431909,
0.5331247449,
-0.0001148737,
0.0403424352,
-0.0291635897,
0.2731474936,
0.1347175837,
0.0443615541,
0.3529543579,
-0.1942857206,
-0.1685833186,
-0.2257664502,
-0.0541707911,
-0.2808631659,
-0.0221224949,
-0.2241772413,
0.0683083087,
0.0300420634,
0.1608586162,
0.1151948944,
-0.3964318931,
-0.0595158376,
-0.0024587174,
-0.1042250991,
-0.0991548225,
0.0140271476,
0.0713294595,
-0.255187124,
-0.2116563171,
0.1949045062,
-0.2130432874,
-0.1478140056,
0.2687232494,
0.2163694352,
0.0346122161,
-0.2425244898,
0.1680866778,
0.2316349894,
0.0670108199,
-0.0272127744,
-0.0171247311,
-0.3350792825,
-0.3706912398,
-0.0284825563,
0.1461225599,
-0.4334976971,
-0.1206514686,
-0.0896025151,
-0.4140654504,
0.2037733048,
0.2642426789,
-0.1223936826,
-0.2039304525,
0.4352439344,
0.0954283923,
0.1497345716,
0.1041519642,
-0.0997518077,
-0.2807915509,
-0.264377743,
-0.1595771015,
0.3733043075,
-0.3415874839,
-0.1739549935,
0.2692954838,
-0.3091348112,
-0.1407883614,
0.1142804325,
-0.1424312741,
0.1946653128,
0.2083412707,
-0.0471199378,
0.0663069785,
0.2460044473,
0.038447544,
0.1738463342,
0.0296909045,
-0.4802924693,
-0.3160503805,
-0.0903608724,
-0.1888757348,
0.0202141274,
0.345872134,
-0.2424586564,
-0.2370805889,
-0.0725834295,
-0.0205962602,
-0.1713075787,
-0.3799442649,
-0.0983374491,
0.0658609793,
0.1854549646,
0.058747232,
0.0610379986,
-0.364798218,
-0.2021664977,
-0.092831552,
-0.076726146,
-0.1286276728,
-0.1720003635,
-0.1044917852,
0.2542574704,
-0.1882733256,
0.0913058221,
0.2601751089,
0.0789948776,
-0.1153762266,
0.2103087008,
0.2196047604,
-0.3643231392,
0.104728356,
-0.1130543202,
0.0748010278,
0.4360268116,
-0.0055077421,
0.0017844305,
-0.2595285475,
0.2082756162,
-0.264908731,
-0.2264891863,
0.2413855642,
0.1191598997,
-0.0831421167,
-0.1221607774,
-0.4942295849,
0.4385454655,
0.2539224625,
-0.1163534075,
-0.0749134943,
-0.1809134334,
-0.5298197269,
-0.2167423815,
0.267924726,
-0.0187719055,
-0.0722124949,
-0.193780005,
0.3418036997,
0.1921719909,
0.3103511035,
0.643055737,
-0.3864825368,
0.7953375578,
-0.1250497997,
0.7483618259,
0.2579940856,
-0.2477055043,
-0.377818048,
0.1166384593,
-0.1784684807,
0.2722211778,
-0.2818517089,
-0.1200629249,
0.702637136,
-0.2252788097,
0.3419843614,
0.106144309,
0.2469955385,
0.3040956855,
-0.2483735234,
-0.0491900817,
0.5504584312,
-0.0802224502,
-0.2242528796,
-0.1509811729,
-0.1534065008,
0.1111334488,
-0.0315547623,
-0.1203735694,
-0.1554093063,
0.0617320612,
0.0151113877,
0.0270558447,
-0.0637359023,
0.2192265391,
0.1471123695,
0.2171942145,
0.0741172284,
0.0683927312,
0.429030776,
-0.0061166505,
0.105516538,
-0.0645507649,
-0.1504325718,
-0.1419281512,
0.1726527661,
0.1282208711,
0.0678982735,
0.0891925842,
0.231172502,
-0.1069800332,
0.0154443318,
0.1270229667,
0.4437766969,
-0.3041421473,
0.1406869292,
-0.1602892578,
-0.1061220318,
-0.1936034113,
0.1408743411,
0.1087324023,
-0.1834658831,
0.1624327451,
0.1247906908,
0.3094664812,
-0.1730700582,
0.2074124068,
0.1145596206,
0.2654833496,
0.0448613949,
0.1117051616,
0.0164179187,
-0.1618008763,
-0.1011433154,
0.2487524599,
0.7665549517,
0.2934232652,
-0.0981311202,
-0.1918503195,
-0.0074496386,
0.2052227855,
0.1254599392,
0.0902862996,
-0.0172136594,
0.3012904525,
0.4247046113,
0.1712669581,
0.350859046,
0.4743337929,
0.5267605186,
-0.1261988878,
-0.2109233439,
0.1169244573,
-0.3413846493,
-0.4390027821,
-0.0324557349,
-0.4132478535,
0.1679464877,
0.1043306813,
0.2238327563,
-0.1689834744,
-0.0138752004,
0.0025530215,
0.2727620602,
0.2319282591,
-0.0062526651,
-0.0347079486,
0.1677316129,
0.2354775071,
-0.3278359175,
-0.1683430672,
-0.0177448075,
0.2466843426,
-0.0202031638,
-0.0880930498,
0.0660285205,
0.1790388525,
0.4836560786,
-0.0730331838,
0.0438802801,
-0.2336484939,
-0.0868268013,
0.0112863081,
0.0730062202,
0.1429344863,
0.2016054988,
0.0416047648,
0.0553794317,
-0.1324758232,
-0.032636188,
-0.2036225647,
-0.3690443933,
0.0673271939,
0.0478157252,
-0.1053123549,
0.3012901545,
0.1895496845,
-0.0706469119,
-0.0284741428,
-0.4572890997,
0.0877391323,
-0.1803112626,
0.0098783216,
-0.1076650098,
-0.1534429491,
-0.1983680278,
0.040002957,
0.116860263,
-0.2781752944,
-0.2616516054,
-0.3224227428,
-0.1180725992,
-0.1744087487,
0.1405442208,
-0.0200541932,
0.0511424616,
-0.0312802494,
0.1222997606,
0.1008712053,
0.1293455213,
-0.2491522133,
-0.167208299,
0.1939768642,
-0.052004464,
-0.0121717164,
-0.3335225284,
-0.2497051358,
0.3890590072,
-0.0699700862,
-0.0141934697,
-0.2141370624,
0.0942139849,
0.1669800282,
0.1398718059,
-0.2460225075,
0.2176398635,
-0.3044710755,
0.2614801526,
0.0384431593,
-0.2167222351,
0.3941025734,
0.2282126844,
-0.1222437844,
0.1697707325,
-0.2478059977,
0.169134587,
-0.0590035915,
-0.2350637317,
0.0723135695,
0.4840386212,
0.2467960119,
0.6211674809,
0.0489818081,
-0.0133376727,
-0.000104659,
-0.3113280237,
-0.1315823197,
-0.4311896563,
-0.0755137727,
0.2071561366,
-0.0991366208,
0.025744576,
0.4865766764,
-0.0850559846,
-0.3330842257,
0.2221699953,
-0.1734429002,
0.0490760766,
-0.1999393553,
0.1273281276,
-0.094773449,
0.0593056194,
0.001397786,
0.4046106339,
-0.5339139104,
-0.1491030306,
0.2374676615,
-0.2787155807,
0.2525823712,
-0.2517897785,
-0.9455536008,
0.3512923419,
-0.8524879813,
0.0949762985,
0.0165478121,
0.2276024818,
0.0475076474,
-0.0270617194,
0.116301097,
-0.0324513875,
0.1658133417,
-0.0538088381,
-0.0845551938,
0.2370496392,
-0.5604740977,
-0.1172572598,
-0.1456516236,
-0.0787851959,
0.1936263442,
0.5949997902,
0.7412644029,
-0.0944306627,
-0.2862771749,
-0.3504448533,
-0.0479066707,
0.0696777776,
0.0392844714,
-0.0138419215,
-0.1023690179,
-0.1808015108,
0.0108177979,
0.1023748741,
0.1822671741,
0.1334198415,
-0.1541094631,
-0.0875531435,
0.1505204439,
0.3036971986,
0.2778021693,
0.2423069924,
-0.0387685634,
0.3437796235,
0.3173718452,
0.1055742577,
-0.1110975668,
-0.1575467139,
0.218151778,
-0.3695305884,
0.0900226161,
0.0998717472,
0.0671067163,
0.1695055962,
-0.0323254652,
0.2138264328,
-0.2696320713,
0.3467109203,
-0.1918302476,
0.3990118504,
0.5268699527,
0.1344356239,
-0.5008948445,
-0.3026988208,
0.0710378662,
0.5278066397,
-0.2671489716,
0.436906606,
-0.480276674,
-0.4048760533,
0.4786455631,
0.2622503936,
0.5893495679,
-0.0001973089,
0.2131255269,
0.2467376292,
0.2820874751,
0.1871794313,
-0.4422437549,
-0.128349781,
-0.2351829559,
0.218982175,
0.0433000661,
-0.0735478103,
0.0681040883,
0.2392939478,
-0.1190580502,
-0.070746474,
0.1343747228,
0.8829228282,
-0.0130435945,
0.302734077,
0.4876134098,
-0.3995562196,
0.3429581225,
0.139388144,
0.2241424024,
0.0627054423,
0.0940345749,
0.0973554701,
-0.0682933852,
-0.1550719887,
-0.2499285191,
-0.2025585771,
-0.5686982274,
0.297793299,
-0.2047142088,
0.0308007114,
0.079801023,
0.1448376179,
0.0416583233,
0.240643099,
0.006632573,
0.288567096,
0.2132267505,
0.3364418149,
0.2534502149,
-0.5096055269,
-0.1977290064,
-0.0098065846,
-0.0152438125,
0.1644135565,
-0.2644810379,
-0.3185323477,
-0.6420419812,
-0.0458641909,
0.304049015,
-0.3656049669,
0.0190449804,
0.1011227295,
-0.0792651102,
-0.1980583966,
0.0806414336,
-0.1534317732,
0.0853770971,
0.4080637991,
-0.0744124949,
-0.2806638777,
0.018494064,
0.3022502661,
0.1215463802,
-0.2107042223,
0.4307022393,
-0.4703118503,
-0.2629355788,
-0.1035873294,
0.2154366076,
0.1363150179,
0.1198757887,
0.0926351324,
-0.1318541765,
-0.1832281202,
0.0951460227,
0.2641551197,
-0.1274953336,
-0.1099076942,
-0.1724203676,
-0.0183413699,
-0.3060437143,
-0.010590571,
-0.059931308,
0.0916232169,
0.0973536149,
0.1349284202,
-0.3185408711,
0.1697501987,
-0.257768333,
-0.1210308895,
0.1259122789,
0.153881073,
-0.201411128,
-0.1586651802,
0.1208087951,
0.0411623493,
0.0997673124,
0.2575888932,
0.0350962058,
-0.2286946476,
-0.0834931955,
0.1424898654,
0.0466305539,
-0.360457778,
0.065940775,
0.1358203888,
-0.0845476836,
-0.5128016472,
0.2053452879,
0.1716240197,
0.0137767466,
-0.4263346195,
0.1967775226,
-0.0045446618,
-0.006976604,
0.1540152282,
-0.0409203246,
0.0195883419,
0.109384343,
0.216730237,
0.1208918095,
-0.203953445,
0.0436545424,
0.2604888678,
0.3350318968,
0.1718847156,
0.0119803064,
-0.0260329749,
-0.0632948205,
0.1637772322,
-0.169979617,
0.212677896,
-0.2245703191,
-0.4430893362,
0.206537962,
0.1477204561,
0.0679500699,
-0.2368669212,
0.4112254679,
-0.2698411942,
0.1705465615,
0.0537063852,
0.2234907448,
0.2558572292,
-0.2167447656,
-0.1678138673,
0.458050251,
-0.1856303066,
0.0927563384,
0.1185214072,
-0.0464377776,
0.0143658705,
0.323636502,
0.089629747,
0.1318291128,
0.4207835197,
0.206501469,
0.2570440471,
0.2392932624,
0.3731355369,
-0.1887238175,
-0.2324148864,
-0.0579186045,
0.4835403562,
-0.3375785649,
0.1452248394,
-0.0031017212,
-0.0090718167,
0.0150641305,
-0.557723999,
-0.0361897498,
0.3808558285,
-0.3738012612,
-0.2634641826,
-0.1039748564,
0.0000506653,
-0.0444149971,
0.357973367,
-0.1306928843,
-0.0440517105,
-0.3228885531,
-0.1085640565,
-0.070135884,
0.1116298735,
-0.2539830506,
-0.2345301956,
0.218488574,
-0.2175603509,
0.2340624183,
-0.4240420461,
0.1349431425,
-0.0556654632,
0.3740639389,
0.3734025061,
0.2763726115,
-0.1379141659,
0.0604413971,
-0.0782147869,
0.0910297781,
0.0376119427,
0.1411616653,
-0.073115699,
-0.3212689757,
0.1342653185,
0.0041141552,
-0.1798273921,
-0.3566518426,
0.0329825208,
-0.1090816036,
0.1966266483,
0.2209126055,
0.0509851798,
-0.1480569839,
0.1166607291,
0.0628017634,
0.0814494416,
-0.1601274163,
0.1489978284,
0.0793071836,
0.1826461107,
-0.0843047053,
0.0706104264,
0.0378759503,
0.4189381897,
0.0274147801,
-0.1120420322,
-0.3786530495,
-0.3307703435,
-0.3441820443,
-0.0883446783,
-0.1933035403,
0.1373800337,
-0.0022711691,
0.090537779,
0.176057294,
0.1948622763,
0.2074846625,
0.1234854013,
-0.2083262205,
-0.099849984,
-0.2851066887,
0.4816953838,
-0.1726652533,
0.039655365,
0.0064430898,
-0.3506655395,
0.4216939509,
0.016045969,
0.1311934143,
-0.1760371476,
0.0523304716,
-0.0212396886,
0.0931963027,
0.6377807856,
0.1688712984,
0.0617192015,
-0.0346785784,
0.1621492803,
0.1541452855,
0.1810175478,
-0.2202599496,
0.0676567107,
-0.0157292094,
-0.0018751784,
0.0582157932,
0.0275884606,
-0.0795356333,
-0.1120132655,
0.1741835624,
-0.0966246724,
-0.2279874831,
-0.0935886577,
0.0079854485,
0.12249396,
-0.2413400263,
0.3319844604,
0.0734153017,
0.2080665082,
-0.3973878324,
-0.0614512414,
0.4318277836,
-0.6654881239,
-0.1201496348,
-0.2693096101,
-0.0117829209,
0.3286217153,
0.1732207388,
-0.105751805,
-0.2817884088,
0.5291824341,
0.0278507657,
-0.2813952565,
0.3174489141,
-0.0696156919,
-0.0076538348,
-0.0337327458,
0.3865730762,
-0.2410534322,
-0.1833972335,
-0.0738726333,
-0.044959195
] |
https://github.com/huggingface/datasets/issues/1830 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? | @lhoestq,
I just checked that previous run time was actually 3000 chars. I increased it to 6k chars, again, roughly double.
SlowTokenizer **7.4 s** to **15.7 s**
Tokenizer: **276 ms** to **616 ms**
I'll post this issue on Tokenizer, seems it hasn't quite been raised (albeit I noticed a similar issue that might relate).
Regards,
Michael | This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
| 56 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer?
This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
@lhoestq,
I just checked that previous run time was actually 3000 chars. I increased it to 6k chars, again, roughly double.
SlowTokenizer **7.4 s** to **15.7 s**
Tokenizer: **276 ms** to **616 ms**
I'll post this issue on Tokenizer, seems it hasn't quite been raised (albeit I noticed a similar issue that might relate).
Regards,
Michael | [
-0.40404737,
-0.0130074006,
-0.1024704129,
0.1034294739,
0.1453052163,
-0.1225538552,
0.2550543845,
0.1890889108,
0.1306776851,
-0.006502152,
-0.0542232022,
0.4988860786,
-0.1724810451,
-0.2727595866,
-0.1320427358,
0.0650426075,
0.2197590768,
0.0224167742,
0.241645202,
-0.0342864916,
-0.1218727008,
0.1023018658,
-0.1767258048,
0.2413994074,
-0.3152629733,
-0.07799308,
0.0812310278,
-0.209633559,
-0.0027562869,
-0.5689615011,
-0.2084297538,
0.1581246704,
0.0209431909,
0.5331247449,
-0.0001148737,
0.0403424352,
-0.0291635897,
0.2731474936,
0.1347175837,
0.0443615541,
0.3529543579,
-0.1942857206,
-0.1685833186,
-0.2257664502,
-0.0541707911,
-0.2808631659,
-0.0221224949,
-0.2241772413,
0.0683083087,
0.0300420634,
0.1608586162,
0.1151948944,
-0.3964318931,
-0.0595158376,
-0.0024587174,
-0.1042250991,
-0.0991548225,
0.0140271476,
0.0713294595,
-0.255187124,
-0.2116563171,
0.1949045062,
-0.2130432874,
-0.1478140056,
0.2687232494,
0.2163694352,
0.0346122161,
-0.2425244898,
0.1680866778,
0.2316349894,
0.0670108199,
-0.0272127744,
-0.0171247311,
-0.3350792825,
-0.3706912398,
-0.0284825563,
0.1461225599,
-0.4334976971,
-0.1206514686,
-0.0896025151,
-0.4140654504,
0.2037733048,
0.2642426789,
-0.1223936826,
-0.2039304525,
0.4352439344,
0.0954283923,
0.1497345716,
0.1041519642,
-0.0997518077,
-0.2807915509,
-0.264377743,
-0.1595771015,
0.3733043075,
-0.3415874839,
-0.1739549935,
0.2692954838,
-0.3091348112,
-0.1407883614,
0.1142804325,
-0.1424312741,
0.1946653128,
0.2083412707,
-0.0471199378,
0.0663069785,
0.2460044473,
0.038447544,
0.1738463342,
0.0296909045,
-0.4802924693,
-0.3160503805,
-0.0903608724,
-0.1888757348,
0.0202141274,
0.345872134,
-0.2424586564,
-0.2370805889,
-0.0725834295,
-0.0205962602,
-0.1713075787,
-0.3799442649,
-0.0983374491,
0.0658609793,
0.1854549646,
0.058747232,
0.0610379986,
-0.364798218,
-0.2021664977,
-0.092831552,
-0.076726146,
-0.1286276728,
-0.1720003635,
-0.1044917852,
0.2542574704,
-0.1882733256,
0.0913058221,
0.2601751089,
0.0789948776,
-0.1153762266,
0.2103087008,
0.2196047604,
-0.3643231392,
0.104728356,
-0.1130543202,
0.0748010278,
0.4360268116,
-0.0055077421,
0.0017844305,
-0.2595285475,
0.2082756162,
-0.264908731,
-0.2264891863,
0.2413855642,
0.1191598997,
-0.0831421167,
-0.1221607774,
-0.4942295849,
0.4385454655,
0.2539224625,
-0.1163534075,
-0.0749134943,
-0.1809134334,
-0.5298197269,
-0.2167423815,
0.267924726,
-0.0187719055,
-0.0722124949,
-0.193780005,
0.3418036997,
0.1921719909,
0.3103511035,
0.643055737,
-0.3864825368,
0.7953375578,
-0.1250497997,
0.7483618259,
0.2579940856,
-0.2477055043,
-0.377818048,
0.1166384593,
-0.1784684807,
0.2722211778,
-0.2818517089,
-0.1200629249,
0.702637136,
-0.2252788097,
0.3419843614,
0.106144309,
0.2469955385,
0.3040956855,
-0.2483735234,
-0.0491900817,
0.5504584312,
-0.0802224502,
-0.2242528796,
-0.1509811729,
-0.1534065008,
0.1111334488,
-0.0315547623,
-0.1203735694,
-0.1554093063,
0.0617320612,
0.0151113877,
0.0270558447,
-0.0637359023,
0.2192265391,
0.1471123695,
0.2171942145,
0.0741172284,
0.0683927312,
0.429030776,
-0.0061166505,
0.105516538,
-0.0645507649,
-0.1504325718,
-0.1419281512,
0.1726527661,
0.1282208711,
0.0678982735,
0.0891925842,
0.231172502,
-0.1069800332,
0.0154443318,
0.1270229667,
0.4437766969,
-0.3041421473,
0.1406869292,
-0.1602892578,
-0.1061220318,
-0.1936034113,
0.1408743411,
0.1087324023,
-0.1834658831,
0.1624327451,
0.1247906908,
0.3094664812,
-0.1730700582,
0.2074124068,
0.1145596206,
0.2654833496,
0.0448613949,
0.1117051616,
0.0164179187,
-0.1618008763,
-0.1011433154,
0.2487524599,
0.7665549517,
0.2934232652,
-0.0981311202,
-0.1918503195,
-0.0074496386,
0.2052227855,
0.1254599392,
0.0902862996,
-0.0172136594,
0.3012904525,
0.4247046113,
0.1712669581,
0.350859046,
0.4743337929,
0.5267605186,
-0.1261988878,
-0.2109233439,
0.1169244573,
-0.3413846493,
-0.4390027821,
-0.0324557349,
-0.4132478535,
0.1679464877,
0.1043306813,
0.2238327563,
-0.1689834744,
-0.0138752004,
0.0025530215,
0.2727620602,
0.2319282591,
-0.0062526651,
-0.0347079486,
0.1677316129,
0.2354775071,
-0.3278359175,
-0.1683430672,
-0.0177448075,
0.2466843426,
-0.0202031638,
-0.0880930498,
0.0660285205,
0.1790388525,
0.4836560786,
-0.0730331838,
0.0438802801,
-0.2336484939,
-0.0868268013,
0.0112863081,
0.0730062202,
0.1429344863,
0.2016054988,
0.0416047648,
0.0553794317,
-0.1324758232,
-0.032636188,
-0.2036225647,
-0.3690443933,
0.0673271939,
0.0478157252,
-0.1053123549,
0.3012901545,
0.1895496845,
-0.0706469119,
-0.0284741428,
-0.4572890997,
0.0877391323,
-0.1803112626,
0.0098783216,
-0.1076650098,
-0.1534429491,
-0.1983680278,
0.040002957,
0.116860263,
-0.2781752944,
-0.2616516054,
-0.3224227428,
-0.1180725992,
-0.1744087487,
0.1405442208,
-0.0200541932,
0.0511424616,
-0.0312802494,
0.1222997606,
0.1008712053,
0.1293455213,
-0.2491522133,
-0.167208299,
0.1939768642,
-0.052004464,
-0.0121717164,
-0.3335225284,
-0.2497051358,
0.3890590072,
-0.0699700862,
-0.0141934697,
-0.2141370624,
0.0942139849,
0.1669800282,
0.1398718059,
-0.2460225075,
0.2176398635,
-0.3044710755,
0.2614801526,
0.0384431593,
-0.2167222351,
0.3941025734,
0.2282126844,
-0.1222437844,
0.1697707325,
-0.2478059977,
0.169134587,
-0.0590035915,
-0.2350637317,
0.0723135695,
0.4840386212,
0.2467960119,
0.6211674809,
0.0489818081,
-0.0133376727,
-0.000104659,
-0.3113280237,
-0.1315823197,
-0.4311896563,
-0.0755137727,
0.2071561366,
-0.0991366208,
0.025744576,
0.4865766764,
-0.0850559846,
-0.3330842257,
0.2221699953,
-0.1734429002,
0.0490760766,
-0.1999393553,
0.1273281276,
-0.094773449,
0.0593056194,
0.001397786,
0.4046106339,
-0.5339139104,
-0.1491030306,
0.2374676615,
-0.2787155807,
0.2525823712,
-0.2517897785,
-0.9455536008,
0.3512923419,
-0.8524879813,
0.0949762985,
0.0165478121,
0.2276024818,
0.0475076474,
-0.0270617194,
0.116301097,
-0.0324513875,
0.1658133417,
-0.0538088381,
-0.0845551938,
0.2370496392,
-0.5604740977,
-0.1172572598,
-0.1456516236,
-0.0787851959,
0.1936263442,
0.5949997902,
0.7412644029,
-0.0944306627,
-0.2862771749,
-0.3504448533,
-0.0479066707,
0.0696777776,
0.0392844714,
-0.0138419215,
-0.1023690179,
-0.1808015108,
0.0108177979,
0.1023748741,
0.1822671741,
0.1334198415,
-0.1541094631,
-0.0875531435,
0.1505204439,
0.3036971986,
0.2778021693,
0.2423069924,
-0.0387685634,
0.3437796235,
0.3173718452,
0.1055742577,
-0.1110975668,
-0.1575467139,
0.218151778,
-0.3695305884,
0.0900226161,
0.0998717472,
0.0671067163,
0.1695055962,
-0.0323254652,
0.2138264328,
-0.2696320713,
0.3467109203,
-0.1918302476,
0.3990118504,
0.5268699527,
0.1344356239,
-0.5008948445,
-0.3026988208,
0.0710378662,
0.5278066397,
-0.2671489716,
0.436906606,
-0.480276674,
-0.4048760533,
0.4786455631,
0.2622503936,
0.5893495679,
-0.0001973089,
0.2131255269,
0.2467376292,
0.2820874751,
0.1871794313,
-0.4422437549,
-0.128349781,
-0.2351829559,
0.218982175,
0.0433000661,
-0.0735478103,
0.0681040883,
0.2392939478,
-0.1190580502,
-0.070746474,
0.1343747228,
0.8829228282,
-0.0130435945,
0.302734077,
0.4876134098,
-0.3995562196,
0.3429581225,
0.139388144,
0.2241424024,
0.0627054423,
0.0940345749,
0.0973554701,
-0.0682933852,
-0.1550719887,
-0.2499285191,
-0.2025585771,
-0.5686982274,
0.297793299,
-0.2047142088,
0.0308007114,
0.079801023,
0.1448376179,
0.0416583233,
0.240643099,
0.006632573,
0.288567096,
0.2132267505,
0.3364418149,
0.2534502149,
-0.5096055269,
-0.1977290064,
-0.0098065846,
-0.0152438125,
0.1644135565,
-0.2644810379,
-0.3185323477,
-0.6420419812,
-0.0458641909,
0.304049015,
-0.3656049669,
0.0190449804,
0.1011227295,
-0.0792651102,
-0.1980583966,
0.0806414336,
-0.1534317732,
0.0853770971,
0.4080637991,
-0.0744124949,
-0.2806638777,
0.018494064,
0.3022502661,
0.1215463802,
-0.2107042223,
0.4307022393,
-0.4703118503,
-0.2629355788,
-0.1035873294,
0.2154366076,
0.1363150179,
0.1198757887,
0.0926351324,
-0.1318541765,
-0.1832281202,
0.0951460227,
0.2641551197,
-0.1274953336,
-0.1099076942,
-0.1724203676,
-0.0183413699,
-0.3060437143,
-0.010590571,
-0.059931308,
0.0916232169,
0.0973536149,
0.1349284202,
-0.3185408711,
0.1697501987,
-0.257768333,
-0.1210308895,
0.1259122789,
0.153881073,
-0.201411128,
-0.1586651802,
0.1208087951,
0.0411623493,
0.0997673124,
0.2575888932,
0.0350962058,
-0.2286946476,
-0.0834931955,
0.1424898654,
0.0466305539,
-0.360457778,
0.065940775,
0.1358203888,
-0.0845476836,
-0.5128016472,
0.2053452879,
0.1716240197,
0.0137767466,
-0.4263346195,
0.1967775226,
-0.0045446618,
-0.006976604,
0.1540152282,
-0.0409203246,
0.0195883419,
0.109384343,
0.216730237,
0.1208918095,
-0.203953445,
0.0436545424,
0.2604888678,
0.3350318968,
0.1718847156,
0.0119803064,
-0.0260329749,
-0.0632948205,
0.1637772322,
-0.169979617,
0.212677896,
-0.2245703191,
-0.4430893362,
0.206537962,
0.1477204561,
0.0679500699,
-0.2368669212,
0.4112254679,
-0.2698411942,
0.1705465615,
0.0537063852,
0.2234907448,
0.2558572292,
-0.2167447656,
-0.1678138673,
0.458050251,
-0.1856303066,
0.0927563384,
0.1185214072,
-0.0464377776,
0.0143658705,
0.323636502,
0.089629747,
0.1318291128,
0.4207835197,
0.206501469,
0.2570440471,
0.2392932624,
0.3731355369,
-0.1887238175,
-0.2324148864,
-0.0579186045,
0.4835403562,
-0.3375785649,
0.1452248394,
-0.0031017212,
-0.0090718167,
0.0150641305,
-0.557723999,
-0.0361897498,
0.3808558285,
-0.3738012612,
-0.2634641826,
-0.1039748564,
0.0000506653,
-0.0444149971,
0.357973367,
-0.1306928843,
-0.0440517105,
-0.3228885531,
-0.1085640565,
-0.070135884,
0.1116298735,
-0.2539830506,
-0.2345301956,
0.218488574,
-0.2175603509,
0.2340624183,
-0.4240420461,
0.1349431425,
-0.0556654632,
0.3740639389,
0.3734025061,
0.2763726115,
-0.1379141659,
0.0604413971,
-0.0782147869,
0.0910297781,
0.0376119427,
0.1411616653,
-0.073115699,
-0.3212689757,
0.1342653185,
0.0041141552,
-0.1798273921,
-0.3566518426,
0.0329825208,
-0.1090816036,
0.1966266483,
0.2209126055,
0.0509851798,
-0.1480569839,
0.1166607291,
0.0628017634,
0.0814494416,
-0.1601274163,
0.1489978284,
0.0793071836,
0.1826461107,
-0.0843047053,
0.0706104264,
0.0378759503,
0.4189381897,
0.0274147801,
-0.1120420322,
-0.3786530495,
-0.3307703435,
-0.3441820443,
-0.0883446783,
-0.1933035403,
0.1373800337,
-0.0022711691,
0.090537779,
0.176057294,
0.1948622763,
0.2074846625,
0.1234854013,
-0.2083262205,
-0.099849984,
-0.2851066887,
0.4816953838,
-0.1726652533,
0.039655365,
0.0064430898,
-0.3506655395,
0.4216939509,
0.016045969,
0.1311934143,
-0.1760371476,
0.0523304716,
-0.0212396886,
0.0931963027,
0.6377807856,
0.1688712984,
0.0617192015,
-0.0346785784,
0.1621492803,
0.1541452855,
0.1810175478,
-0.2202599496,
0.0676567107,
-0.0157292094,
-0.0018751784,
0.0582157932,
0.0275884606,
-0.0795356333,
-0.1120132655,
0.1741835624,
-0.0966246724,
-0.2279874831,
-0.0935886577,
0.0079854485,
0.12249396,
-0.2413400263,
0.3319844604,
0.0734153017,
0.2080665082,
-0.3973878324,
-0.0614512414,
0.4318277836,
-0.6654881239,
-0.1201496348,
-0.2693096101,
-0.0117829209,
0.3286217153,
0.1732207388,
-0.105751805,
-0.2817884088,
0.5291824341,
0.0278507657,
-0.2813952565,
0.3174489141,
-0.0696156919,
-0.0076538348,
-0.0337327458,
0.3865730762,
-0.2410534322,
-0.1833972335,
-0.0738726333,
-0.044959195
] |
https://github.com/huggingface/datasets/issues/1830 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? | Hi,
I'm following up here as I found my exact issue. It was with saving and re-loading the tokenizer. When I trained then processed the data without saving and reloading it, it was 10x-100x faster than when I saved and re-loaded it.
Both resulted in the exact same tokenized datasets as well.
There is additionally a bug where the older legacy tokenizer save does not preserve a learned tokenizing behavior if trained from scratch.
Understand its not exactly Datasets related but hope it can help someone if they have the same issue.
Thanks! | This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
| 93 | using map on loaded Tokenizer 10x - 100x slower than default Tokenizer?
This could total relate to me misunderstanding particular call functions, but I added words to a GPT2Tokenizer, and saved it to disk (note I'm only showing snippets but I can share more) and the map function ran much slower:
````
def save_tokenizer(original_tokenizer,text,path="simpledata/tokenizer"):
words_unique = set(text.split(" "))
for i in words_unique:
original_tokenizer.add_tokens(i)
original_tokenizer.save_pretrained(path)
tokenizer2 = GPT2Tokenizer.from_pretrained(os.path.join(experiment_path,experiment_name,"tokenizer_squad"))
train_set_baby=Dataset.from_dict({"text":[train_set["text"][0][0:50]]})
````
I then applied the dataset map function on a fairly small set of text:
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The run time for train_set_baby.map was 6 seconds, and the batch itself was 2.6 seconds
**100% 1/1 [00:02<00:00, 2.60s/ba] CPU times: user 5.96 s, sys: 36 ms, total: 5.99 s Wall time: 5.99 s**
In comparison using (even after adding additional tokens):
`
tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")`
```
%%time
train_set_baby = train_set_baby.map(lambda d:tokenizer2(d["text"]),batched=True)
```
The time is
**100% 1/1 [00:00<00:00, 34.09ba/s] CPU times: user 68.1 ms, sys: 16 Β΅s, total: 68.1 ms Wall time: 62.9 ms**
It seems this might relate to the tokenizer save or load function, however, the issue appears to come up when I apply the loaded tokenizer to the map function.
I should also add that playing around with the amount of words I add to the tokenizer before I save it to disk and load it into memory appears to impact the time it takes to run the map function.
Hi,
I'm following up here as I found my exact issue. It was with saving and re-loading the tokenizer. When I trained then processed the data without saving and reloading it, it was 10x-100x faster than when I saved and re-loaded it.
Both resulted in the exact same tokenized datasets as well.
There is additionally a bug where the older legacy tokenizer save does not preserve a learned tokenizing behavior if trained from scratch.
Understand its not exactly Datasets related but hope it can help someone if they have the same issue.
Thanks! | [
-0.40404737,
-0.0130074006,
-0.1024704129,
0.1034294739,
0.1453052163,
-0.1225538552,
0.2550543845,
0.1890889108,
0.1306776851,
-0.006502152,
-0.0542232022,
0.4988860786,
-0.1724810451,
-0.2727595866,
-0.1320427358,
0.0650426075,
0.2197590768,
0.0224167742,
0.241645202,
-0.0342864916,
-0.1218727008,
0.1023018658,
-0.1767258048,
0.2413994074,
-0.3152629733,
-0.07799308,
0.0812310278,
-0.209633559,
-0.0027562869,
-0.5689615011,
-0.2084297538,
0.1581246704,
0.0209431909,
0.5331247449,
-0.0001148737,
0.0403424352,
-0.0291635897,
0.2731474936,
0.1347175837,
0.0443615541,
0.3529543579,
-0.1942857206,
-0.1685833186,
-0.2257664502,
-0.0541707911,
-0.2808631659,
-0.0221224949,
-0.2241772413,
0.0683083087,
0.0300420634,
0.1608586162,
0.1151948944,
-0.3964318931,
-0.0595158376,
-0.0024587174,
-0.1042250991,
-0.0991548225,
0.0140271476,
0.0713294595,
-0.255187124,
-0.2116563171,
0.1949045062,
-0.2130432874,
-0.1478140056,
0.2687232494,
0.2163694352,
0.0346122161,
-0.2425244898,
0.1680866778,
0.2316349894,
0.0670108199,
-0.0272127744,
-0.0171247311,
-0.3350792825,
-0.3706912398,
-0.0284825563,
0.1461225599,
-0.4334976971,
-0.1206514686,
-0.0896025151,
-0.4140654504,
0.2037733048,
0.2642426789,
-0.1223936826,
-0.2039304525,
0.4352439344,
0.0954283923,
0.1497345716,
0.1041519642,
-0.0997518077,
-0.2807915509,
-0.264377743,
-0.1595771015,
0.3733043075,
-0.3415874839,
-0.1739549935,
0.2692954838,
-0.3091348112,
-0.1407883614,
0.1142804325,
-0.1424312741,
0.1946653128,
0.2083412707,
-0.0471199378,
0.0663069785,
0.2460044473,
0.038447544,
0.1738463342,
0.0296909045,
-0.4802924693,
-0.3160503805,
-0.0903608724,
-0.1888757348,
0.0202141274,
0.345872134,
-0.2424586564,
-0.2370805889,
-0.0725834295,
-0.0205962602,
-0.1713075787,
-0.3799442649,
-0.0983374491,
0.0658609793,
0.1854549646,
0.058747232,
0.0610379986,
-0.364798218,
-0.2021664977,
-0.092831552,
-0.076726146,
-0.1286276728,
-0.1720003635,
-0.1044917852,
0.2542574704,
-0.1882733256,
0.0913058221,
0.2601751089,
0.0789948776,
-0.1153762266,
0.2103087008,
0.2196047604,
-0.3643231392,
0.104728356,
-0.1130543202,
0.0748010278,
0.4360268116,
-0.0055077421,
0.0017844305,
-0.2595285475,
0.2082756162,
-0.264908731,
-0.2264891863,
0.2413855642,
0.1191598997,
-0.0831421167,
-0.1221607774,
-0.4942295849,
0.4385454655,
0.2539224625,
-0.1163534075,
-0.0749134943,
-0.1809134334,
-0.5298197269,
-0.2167423815,
0.267924726,
-0.0187719055,
-0.0722124949,
-0.193780005,
0.3418036997,
0.1921719909,
0.3103511035,
0.643055737,
-0.3864825368,
0.7953375578,
-0.1250497997,
0.7483618259,
0.2579940856,
-0.2477055043,
-0.377818048,
0.1166384593,
-0.1784684807,
0.2722211778,
-0.2818517089,
-0.1200629249,
0.702637136,
-0.2252788097,
0.3419843614,
0.106144309,
0.2469955385,
0.3040956855,
-0.2483735234,
-0.0491900817,
0.5504584312,
-0.0802224502,
-0.2242528796,
-0.1509811729,
-0.1534065008,
0.1111334488,
-0.0315547623,
-0.1203735694,
-0.1554093063,
0.0617320612,
0.0151113877,
0.0270558447,
-0.0637359023,
0.2192265391,
0.1471123695,
0.2171942145,
0.0741172284,
0.0683927312,
0.429030776,
-0.0061166505,
0.105516538,
-0.0645507649,
-0.1504325718,
-0.1419281512,
0.1726527661,
0.1282208711,
0.0678982735,
0.0891925842,
0.231172502,
-0.1069800332,
0.0154443318,
0.1270229667,
0.4437766969,
-0.3041421473,
0.1406869292,
-0.1602892578,
-0.1061220318,
-0.1936034113,
0.1408743411,
0.1087324023,
-0.1834658831,
0.1624327451,
0.1247906908,
0.3094664812,
-0.1730700582,
0.2074124068,
0.1145596206,
0.2654833496,
0.0448613949,
0.1117051616,
0.0164179187,
-0.1618008763,
-0.1011433154,
0.2487524599,
0.7665549517,
0.2934232652,
-0.0981311202,
-0.1918503195,
-0.0074496386,
0.2052227855,
0.1254599392,
0.0902862996,
-0.0172136594,
0.3012904525,
0.4247046113,
0.1712669581,
0.350859046,
0.4743337929,
0.5267605186,
-0.1261988878,
-0.2109233439,
0.1169244573,
-0.3413846493,
-0.4390027821,
-0.0324557349,
-0.4132478535,
0.1679464877,
0.1043306813,
0.2238327563,
-0.1689834744,
-0.0138752004,
0.0025530215,
0.2727620602,
0.2319282591,
-0.0062526651,
-0.0347079486,
0.1677316129,
0.2354775071,
-0.3278359175,
-0.1683430672,
-0.0177448075,
0.2466843426,
-0.0202031638,
-0.0880930498,
0.0660285205,
0.1790388525,
0.4836560786,
-0.0730331838,
0.0438802801,
-0.2336484939,
-0.0868268013,
0.0112863081,
0.0730062202,
0.1429344863,
0.2016054988,
0.0416047648,
0.0553794317,
-0.1324758232,
-0.032636188,
-0.2036225647,
-0.3690443933,
0.0673271939,
0.0478157252,
-0.1053123549,
0.3012901545,
0.1895496845,
-0.0706469119,
-0.0284741428,
-0.4572890997,
0.0877391323,
-0.1803112626,
0.0098783216,
-0.1076650098,
-0.1534429491,
-0.1983680278,
0.040002957,
0.116860263,
-0.2781752944,
-0.2616516054,
-0.3224227428,
-0.1180725992,
-0.1744087487,
0.1405442208,
-0.0200541932,
0.0511424616,
-0.0312802494,
0.1222997606,
0.1008712053,
0.1293455213,
-0.2491522133,
-0.167208299,
0.1939768642,
-0.052004464,
-0.0121717164,
-0.3335225284,
-0.2497051358,
0.3890590072,
-0.0699700862,
-0.0141934697,
-0.2141370624,
0.0942139849,
0.1669800282,
0.1398718059,
-0.2460225075,
0.2176398635,
-0.3044710755,
0.2614801526,
0.0384431593,
-0.2167222351,
0.3941025734,
0.2282126844,
-0.1222437844,
0.1697707325,
-0.2478059977,
0.169134587,
-0.0590035915,
-0.2350637317,
0.0723135695,
0.4840386212,
0.2467960119,
0.6211674809,
0.0489818081,
-0.0133376727,
-0.000104659,
-0.3113280237,
-0.1315823197,
-0.4311896563,
-0.0755137727,
0.2071561366,
-0.0991366208,
0.025744576,
0.4865766764,
-0.0850559846,
-0.3330842257,
0.2221699953,
-0.1734429002,
0.0490760766,
-0.1999393553,
0.1273281276,
-0.094773449,
0.0593056194,
0.001397786,
0.4046106339,
-0.5339139104,
-0.1491030306,
0.2374676615,
-0.2787155807,
0.2525823712,
-0.2517897785,
-0.9455536008,
0.3512923419,
-0.8524879813,
0.0949762985,
0.0165478121,
0.2276024818,
0.0475076474,
-0.0270617194,
0.116301097,
-0.0324513875,
0.1658133417,
-0.0538088381,
-0.0845551938,
0.2370496392,
-0.5604740977,
-0.1172572598,
-0.1456516236,
-0.0787851959,
0.1936263442,
0.5949997902,
0.7412644029,
-0.0944306627,
-0.2862771749,
-0.3504448533,
-0.0479066707,
0.0696777776,
0.0392844714,
-0.0138419215,
-0.1023690179,
-0.1808015108,
0.0108177979,
0.1023748741,
0.1822671741,
0.1334198415,
-0.1541094631,
-0.0875531435,
0.1505204439,
0.3036971986,
0.2778021693,
0.2423069924,
-0.0387685634,
0.3437796235,
0.3173718452,
0.1055742577,
-0.1110975668,
-0.1575467139,
0.218151778,
-0.3695305884,
0.0900226161,
0.0998717472,
0.0671067163,
0.1695055962,
-0.0323254652,
0.2138264328,
-0.2696320713,
0.3467109203,
-0.1918302476,
0.3990118504,
0.5268699527,
0.1344356239,
-0.5008948445,
-0.3026988208,
0.0710378662,
0.5278066397,
-0.2671489716,
0.436906606,
-0.480276674,
-0.4048760533,
0.4786455631,
0.2622503936,
0.5893495679,
-0.0001973089,
0.2131255269,
0.2467376292,
0.2820874751,
0.1871794313,
-0.4422437549,
-0.128349781,
-0.2351829559,
0.218982175,
0.0433000661,
-0.0735478103,
0.0681040883,
0.2392939478,
-0.1190580502,
-0.070746474,
0.1343747228,
0.8829228282,
-0.0130435945,
0.302734077,
0.4876134098,
-0.3995562196,
0.3429581225,
0.139388144,
0.2241424024,
0.0627054423,
0.0940345749,
0.0973554701,
-0.0682933852,
-0.1550719887,
-0.2499285191,
-0.2025585771,
-0.5686982274,
0.297793299,
-0.2047142088,
0.0308007114,
0.079801023,
0.1448376179,
0.0416583233,
0.240643099,
0.006632573,
0.288567096,
0.2132267505,
0.3364418149,
0.2534502149,
-0.5096055269,
-0.1977290064,
-0.0098065846,
-0.0152438125,
0.1644135565,
-0.2644810379,
-0.3185323477,
-0.6420419812,
-0.0458641909,
0.304049015,
-0.3656049669,
0.0190449804,
0.1011227295,
-0.0792651102,
-0.1980583966,
0.0806414336,
-0.1534317732,
0.0853770971,
0.4080637991,
-0.0744124949,
-0.2806638777,
0.018494064,
0.3022502661,
0.1215463802,
-0.2107042223,
0.4307022393,
-0.4703118503,
-0.2629355788,
-0.1035873294,
0.2154366076,
0.1363150179,
0.1198757887,
0.0926351324,
-0.1318541765,
-0.1832281202,
0.0951460227,
0.2641551197,
-0.1274953336,
-0.1099076942,
-0.1724203676,
-0.0183413699,
-0.3060437143,
-0.010590571,
-0.059931308,
0.0916232169,
0.0973536149,
0.1349284202,
-0.3185408711,
0.1697501987,
-0.257768333,
-0.1210308895,
0.1259122789,
0.153881073,
-0.201411128,
-0.1586651802,
0.1208087951,
0.0411623493,
0.0997673124,
0.2575888932,
0.0350962058,
-0.2286946476,
-0.0834931955,
0.1424898654,
0.0466305539,
-0.360457778,
0.065940775,
0.1358203888,
-0.0845476836,
-0.5128016472,
0.2053452879,
0.1716240197,
0.0137767466,
-0.4263346195,
0.1967775226,
-0.0045446618,
-0.006976604,
0.1540152282,
-0.0409203246,
0.0195883419,
0.109384343,
0.216730237,
0.1208918095,
-0.203953445,
0.0436545424,
0.2604888678,
0.3350318968,
0.1718847156,
0.0119803064,
-0.0260329749,
-0.0632948205,
0.1637772322,
-0.169979617,
0.212677896,
-0.2245703191,
-0.4430893362,
0.206537962,
0.1477204561,
0.0679500699,
-0.2368669212,
0.4112254679,
-0.2698411942,
0.1705465615,
0.0537063852,
0.2234907448,
0.2558572292,
-0.2167447656,
-0.1678138673,
0.458050251,
-0.1856303066,
0.0927563384,
0.1185214072,
-0.0464377776,
0.0143658705,
0.323636502,
0.089629747,
0.1318291128,
0.4207835197,
0.206501469,
0.2570440471,
0.2392932624,
0.3731355369,
-0.1887238175,
-0.2324148864,
-0.0579186045,
0.4835403562,
-0.3375785649,
0.1452248394,
-0.0031017212,
-0.0090718167,
0.0150641305,
-0.557723999,
-0.0361897498,
0.3808558285,
-0.3738012612,
-0.2634641826,
-0.1039748564,
0.0000506653,
-0.0444149971,
0.357973367,
-0.1306928843,
-0.0440517105,
-0.3228885531,
-0.1085640565,
-0.070135884,
0.1116298735,
-0.2539830506,
-0.2345301956,
0.218488574,
-0.2175603509,
0.2340624183,
-0.4240420461,
0.1349431425,
-0.0556654632,
0.3740639389,
0.3734025061,
0.2763726115,
-0.1379141659,
0.0604413971,
-0.0782147869,
0.0910297781,
0.0376119427,
0.1411616653,
-0.073115699,
-0.3212689757,
0.1342653185,
0.0041141552,
-0.1798273921,
-0.3566518426,
0.0329825208,
-0.1090816036,
0.1966266483,
0.2209126055,
0.0509851798,
-0.1480569839,
0.1166607291,
0.0628017634,
0.0814494416,
-0.1601274163,
0.1489978284,
0.0793071836,
0.1826461107,
-0.0843047053,
0.0706104264,
0.0378759503,
0.4189381897,
0.0274147801,
-0.1120420322,
-0.3786530495,
-0.3307703435,
-0.3441820443,
-0.0883446783,
-0.1933035403,
0.1373800337,
-0.0022711691,
0.090537779,
0.176057294,
0.1948622763,
0.2074846625,
0.1234854013,
-0.2083262205,
-0.099849984,
-0.2851066887,
0.4816953838,
-0.1726652533,
0.039655365,
0.0064430898,
-0.3506655395,
0.4216939509,
0.016045969,
0.1311934143,
-0.1760371476,
0.0523304716,
-0.0212396886,
0.0931963027,
0.6377807856,
0.1688712984,
0.0617192015,
-0.0346785784,
0.1621492803,
0.1541452855,
0.1810175478,
-0.2202599496,
0.0676567107,
-0.0157292094,
-0.0018751784,
0.0582157932,
0.0275884606,
-0.0795356333,
-0.1120132655,
0.1741835624,
-0.0966246724,
-0.2279874831,
-0.0935886577,
0.0079854485,
0.12249396,
-0.2413400263,
0.3319844604,
0.0734153017,
0.2080665082,
-0.3973878324,
-0.0614512414,
0.4318277836,
-0.6654881239,
-0.1201496348,
-0.2693096101,
-0.0117829209,
0.3286217153,
0.1732207388,
-0.105751805,
-0.2817884088,
0.5291824341,
0.0278507657,
-0.2813952565,
0.3174489141,
-0.0696156919,
-0.0076538348,
-0.0337327458,
0.3865730762,
-0.2410534322,
-0.1833972335,
-0.0738726333,
-0.044959195
] |
https://github.com/huggingface/datasets/issues/1827 | Regarding On-the-fly Data Loading | Hi @acul3
Issue #1776 talks about doing on-the-fly data pre-processing, which I think is solved in the next release as mentioned in the issue #1825. I also look forward to using this feature, though :)
I wanted to ask about on-the-fly data loading from the cache (before pre-processing). | Hi,
I was wondering if it is possible to load images/texts as a batch during the training process, without loading the entire dataset on the RAM at any given point.
Thanks,
Gunjan | 48 | Regarding On-the-fly Data Loading
Hi,
I was wondering if it is possible to load images/texts as a batch during the training process, without loading the entire dataset on the RAM at any given point.
Thanks,
Gunjan
Hi @acul3
Issue #1776 talks about doing on-the-fly data pre-processing, which I think is solved in the next release as mentioned in the issue #1825. I also look forward to using this feature, though :)
I wanted to ask about on-the-fly data loading from the cache (before pre-processing). | [
-0.172684744,
-0.283598572,
-0.1183969453,
0.2190789282,
0.3321972787,
0.0917308331,
0.5707204938,
0.1317173839,
0.1204760075,
0.0670048892,
0.0713879615,
-0.0857143775,
-0.0965600759,
0.2116190642,
0.2725099325,
0.2309677899,
0.0025833191,
0.069000423,
0.0591213591,
-0.0284567494,
-0.0402435139,
-0.0728218555,
-0.0123695564,
-0.3621985614,
-0.4274350703,
-0.0935059562,
-0.1793474704,
0.0571450144,
-0.1536557525,
-0.2890402675,
0.1886153072,
0.2540032566,
0.2708253562,
0.1172407717,
-0.0001203638,
-0.0124503793,
0.3828079402,
-0.1435647309,
-0.3206502795,
0.1220704168,
-0.0993445665,
0.1157690287,
0.1064212173,
-0.1725357324,
-0.0760353804,
0.424257189,
0.1247473285,
-0.3189669847,
0.4757881165,
-0.0819708556,
0.045612175,
-0.0693500936,
-0.3194619119,
0.0307375304,
0.2106880546,
0.1520227343,
-0.0428888984,
-0.0413794443,
0.3662906587,
-0.1179746017,
-0.102231577,
0.3062212467,
-0.0025014055,
0.0041445238,
0.2204099298,
-0.0154388817,
0.0600905828,
-0.4758676589,
-0.0239067916,
0.1586287469,
0.5854740143,
0.0645012781,
-0.3178859353,
-0.3903408647,
0.0198408738,
-0.3572821915,
0.0862499624,
0.382142812,
-0.3288043737,
0.0932318196,
-0.537832737,
-0.408722043,
-0.2208576649,
-0.1140246987,
-0.0902026221,
-0.2912572026,
0.0688990206,
-0.0724284798,
0.0858770013,
0.2078730911,
0.6285198331,
-0.111976929,
-0.1109060645,
0.4937472641,
-0.2721393108,
-0.2085572332,
-0.4864160419,
-0.19672364,
-0.0057811686,
-0.1826287657,
0.2753624022,
0.179765135,
-0.1919866949,
0.0621589907,
0.3562072217,
0.0273072496,
0.1653116643,
-0.0311497189,
0.006468269,
-0.2958643436,
-0.23737894,
-0.0634203255,
-0.4045853317,
0.1368605793,
-0.1152531132,
-0.268152982,
-0.4467124641,
-0.2506438196,
0.2545191944,
-0.25272277,
0.1836286485,
-0.0403486006,
-0.2313979715,
0.3127173483,
-0.0288000759,
0.0083065107,
0.2975398004,
-0.1674128324,
-0.0775291845,
-0.2540170848,
-0.0478608869,
-0.0181819201,
-0.2493311465,
0.1330199987,
0.2042916566,
0.0589195713,
0.1179034412,
-0.1313332021,
0.0041414993,
0.0270397235,
-0.0003010074,
-0.3179264665,
0.3636932969,
0.2754965127,
-0.0150981732,
-0.2916891575,
0.0312476642,
0.3335388601,
-0.0201604925,
0.5988051891,
-0.2974315286,
-0.0827195272,
0.3635725975,
0.0118182506,
-0.0296234656,
-0.2398855239,
-0.2626537979,
0.4184544981,
0.2489561886,
0.0859442204,
0.2036077082,
0.0772559643,
-0.2851472497,
-0.0212871376,
0.1105751619,
0.3501606882,
-0.402687043,
-0.3087044358,
0.2794794142,
0.022266645,
-0.1220830753,
-0.0091870371,
-0.2488167733,
0.3373200595,
0.0116718756,
0.037483383,
0.112332128,
-0.2921565771,
-0.0236151256,
0.4355229139,
0.0490383953,
-0.0319648013,
-0.0090760114,
0.4269597232,
0.1020321399,
0.1715195775,
0.2959528267,
0.7635228038,
0.0538491048,
0.0748614222,
-0.1958503127,
-0.3414074779,
-0.2395244092,
0.362111479,
0.2415040284,
0.2589145601,
0.2517332137,
0.027311394,
0.0837513059,
-0.2263397425,
-0.0170133635,
0.1305216253,
-0.0317250527,
0.1669830084,
-0.0416579247,
0.2819931507,
-0.4686065316,
0.2828412354,
-0.1840274781,
-0.0459724106,
0.1098972708,
-0.0095280893,
0.3888609111,
-0.2076936513,
0.0993757024,
0.1737116128,
-0.0955862626,
-0.212809518,
-0.0997157767,
-0.0099678058,
-0.4909349382,
0.8521468043,
-0.4758828878,
0.211495176,
-0.1044540182,
0.1074163839,
0.4491935372,
-0.1081210151,
-0.1963791549,
-0.1719343513,
-0.2991923988,
0.0181721412,
0.0061654486,
0.4675188959,
0.1323869973,
0.2539481223,
-0.0984476879,
0.1048577353,
0.2965150476,
0.0731374621,
0.2004059106,
-0.3838967979,
0.040769197,
-0.1957341135,
-0.4062645435,
0.6067579389,
0.0608742796,
0.1954907477,
0.2967915237,
-0.2305459529,
-0.0120990044,
-0.1654074788,
-0.0860127732,
0.1190432534,
0.007978471,
0.1060783714,
0.5033364892,
-0.031371031,
-0.1819934547,
-0.2241878211,
-0.0393428393,
-0.0225380044,
-0.1010945588,
0.1562385559,
-0.0333748013,
-0.096843794,
0.0403098017,
-0.0376495719,
0.306470722,
0.0865684524,
-0.008804773,
0.1440638453,
0.2152055055,
-0.0710986853,
0.1003782302,
-0.025685966,
0.400247395,
0.0196017269,
0.0668523759,
0.054219868,
-0.4141890109,
0.3761073053,
0.2402522713,
-0.2068136483,
-0.1194649935,
0.0249520019,
0.180202499,
-0.2877338231,
0.0511294603,
0.0785603076,
-0.2679386437,
0.2447862625,
0.0626739189,
-0.0354729518,
0.2312706858,
-0.1007864773,
-0.0505560674,
1.0589146614,
-0.077869989,
0.0396904796,
-0.1933267415,
-0.0724980533,
0.2199306786,
0.0177282281,
0.1843344122,
-0.1126133949,
0.2349985838,
0.129840076,
-0.1127244383,
0.2563572228,
-0.1056974456,
0.1894394755,
0.2193924487,
0.1237749085,
-0.3309442997,
-0.0084989043,
-0.2049749643,
0.0421057008,
-0.1971977949,
-0.4081792831,
-0.2879915833,
-0.4751536548,
0.377895534,
0.1120874286,
-0.1671584398,
0.0250959042,
-0.4167979658,
-0.0401692875,
0.2077398449,
0.3384679854,
0.1406714618,
0.3773106039,
0.0208094101,
-0.1806996614,
-0.1592863053,
-0.1036747247,
-0.202918455,
-0.6760938168,
-0.0939392298,
-0.1416723728,
-0.1950514615,
-0.0356870629,
0.0936200097,
0.0362049863,
0.6651352048,
-0.873555541,
-0.0531989336,
0.0262281764,
-0.1240392178,
-0.2042837143,
-0.0786604062,
0.1373702586,
-0.2599745393,
-0.0103772301,
-0.0497466139,
0.2246379405,
0.1929003894,
0.0336732604,
0.0733996928,
0.278747201,
0.031900119,
0.1225321367,
0.88317132,
-0.3712194264,
-0.0659414455,
0.2678945363,
0.1573869735,
0.3801430464,
-0.2386514097,
0.2636005282,
-0.1346940845,
-0.1658605039,
-0.1958544254,
0.1565246135,
0.0872743502,
-0.5369457006,
-0.4127477705,
0.4158636332,
-0.1284592748,
0.1169914603,
0.2079682499,
-0.3225348592,
0.2557945848,
0.0267962217,
0.0214499254,
-0.1968211979,
-0.2115892172,
0.0191262532,
-0.0576585531,
0.6054167747,
-0.2114353627,
-0.1240896657,
0.3219366968,
-0.2747209966,
0.0078734271,
0.0306296367,
0.216282472,
-0.0298616458,
-0.1958160251,
0.3248188198,
-0.0149484165,
0.6353760362,
-0.1768060923,
0.0008975203,
0.0656322986,
-0.4618179202,
0.0665302277,
0.0197555646,
-0.0642729923,
-0.1148602143,
0.0466999002,
0.2646921575,
0.1351754963,
-0.1173198745,
-0.0877335891,
-0.2665192485,
-0.3192572296,
-0.3963138461,
-0.0701058879,
0.1605164707,
-0.2127300501,
0.0817423761,
0.1631470174,
-0.0408694148,
-0.2503912151,
-0.0283843502,
-0.3545407653,
0.4247925282,
-0.1319827735,
-0.247856766,
-0.0554513894,
0.2683358192,
0.1844052672,
0.2386132032,
0.1415828317,
-0.0152647989,
0.2034436911,
-0.2024104893,
0.0800788626,
-0.1507409066,
-0.1296239793,
0.2492763251,
0.6636556983,
0.2860675752,
-0.0303025246,
0.150605306,
-0.118929781,
-0.2937454879,
0.1309515983,
0.0313463509,
-0.2929355502,
-0.1620036513,
-0.5915786624,
0.6851971745,
0.2224940509,
0.0230625458,
0.3544330001,
-0.5506944656,
-0.3202624917,
0.2900858521,
0.3368039727,
0.9200332165,
-0.3764574826,
0.5159749389,
-0.2994267344,
0.3096639216,
0.0008137145,
-0.327621907,
0.2093080133,
-0.3369631171,
-0.2832551599,
-0.1473208964,
-0.1753265113,
-0.1173825935,
0.377111733,
0.1250201762,
-0.0722641125,
0.1168526337,
0.0181827042,
0.0548079051,
-0.0946769193,
0.0608395934,
-0.4045920968,
-0.0636875257,
0.0648536757,
0.2162376344,
0.2144349962,
-0.2849907279,
0.0548532456,
0.1731053442,
-0.1351605952,
0.0026147345,
0.062008068,
-0.2733362317,
0.0041459543,
-0.2019819468,
-0.2839854658,
-0.3501133323,
0.1486512721,
0.3003537655,
-0.1588249505,
0.0428691059,
0.2137991041,
0.2311347425,
0.1083907932,
-0.0447535589,
-0.0045007104,
0.3801798522,
-0.0869497135,
0.1371848136,
0.139053762,
-0.2454120368,
-0.5426342487,
-0.0188655667,
0.1041585058,
0.2103518099,
-0.0124631505,
-0.2162298858,
0.2761098146,
0.0940302312,
0.0987998843,
0.0736875758,
0.2683964968,
-0.1985173672,
0.3451651335,
0.083017841,
-0.1866431832,
0.0497791618,
0.6502136588,
0.174926281,
-0.44052279,
0.1786126196,
0.1150550172,
-0.0882909372,
-0.0799116865,
0.0166131295,
0.2343141288,
-0.2239980698,
0.0934886187,
0.0793307722,
0.1605615616,
-0.0854921713,
0.2037148625,
0.0990562141,
-0.0556939542,
-0.1945217252,
-0.2388640642,
-0.3176458478,
0.1662856191,
-0.1389890015,
0.329090327,
0.1582848132,
-0.2370776534,
0.2533076108,
0.1814440638,
-0.2273148,
0.1966859102,
0.1132531688,
0.2126765251,
-0.0204173699,
0.1259810477,
-0.121722728,
-0.0782728866,
-0.0608333573,
0.0926748663,
0.0013122924,
-0.1889595687,
0.0894672498,
0.2597552538,
0.1029035076,
-0.0615429133,
-0.0641866848,
-0.2494581789,
-0.2111489028,
-0.010369123,
0.2952494621,
0.087061666,
-0.1629936099,
-0.1616749167,
0.2854122519,
0.5793206692,
-0.1693764776,
0.4471304715,
0.0124735413,
0.3442240655,
0.0885527059,
-0.0301330164,
-0.2365308851,
0.1098898649,
0.2594615221,
-0.0917700306,
0.2493804842,
0.0170957167,
0.1877783388,
-0.4105764031,
0.1509672105,
-0.1571804434,
0.1854478568,
0.273578614,
-0.4995343089,
0.0643147826,
0.3117897213,
0.1444230378,
0.06996838,
-0.1901301593,
-0.1092526242,
-0.362182647,
-0.16494973,
0.2804119587,
0.5584881902,
0.0302951876,
0.00034351,
0.0439928435,
0.3751170635,
-0.4146688282,
0.0782158151,
0.4015353918,
-0.0463286787,
0.049077969,
0.0858731642,
0.5185029507,
-0.0125634698,
0.1787181944,
0.0150607051,
0.2180618346,
0.0458538122,
0.0936098993,
-0.2677708864,
-0.4308394492,
0.0587027334,
0.6751397848,
-0.0713502914,
0.4519224763,
-0.3695741892,
-0.0558463782,
-0.0169711318,
-0.2555280626,
-0.1590132266,
0.1286562681,
-0.1327879578,
0.0760778636,
-0.1052351147,
-0.1248512864,
-0.1445703059,
0.4197899401,
-0.1007564291,
-0.1425278187,
0.2564863563,
0.2617850602,
0.0130309742,
0.1989989132,
-0.1012508869,
0.0968431607,
0.2134020627,
-0.2731973231,
0.2259693295,
-0.4411210418,
0.1773985028,
0.4834470153,
0.3473464251,
-0.0813816637,
0.3185935616,
-0.1027417183,
0.0960773006,
0.0967179984,
0.0691892207,
-0.0256329849,
0.3193223774,
0.3588231802,
0.0635121316,
0.1042463481,
0.0253968313,
-0.0752461255,
0.4104228616,
-0.0105713038,
-0.0307153109,
-0.3659184873,
0.1415159255,
0.2978211045,
-0.1230255142,
0.0002619906,
0.006374965,
-0.395848453,
0.0855420083,
0.2274095863,
-0.4957817197,
0.0051387101,
0.4473087788,
0.016177712,
-0.2025238872,
0.5034618378,
0.3643023074,
0.1137145609,
-0.2773652375,
-0.285884589,
-0.3451360762,
0.0241381042,
0.0438244045,
0.1658492982,
-0.0062255478,
0.2346558273,
0.1811323017,
0.1554619819,
-0.1374715716,
-0.4772333205,
-0.101814948,
0.1482331902,
-0.3347150087,
0.2280405909,
0.1797845662,
0.4630300403,
-0.2251702249,
-0.2288309187,
0.1836902648,
0.1424227953,
-0.2046664208,
0.374040693,
-0.0874625146,
0.006389834,
0.0731381774,
0.4084907174,
-0.4653457105,
0.3128404617,
0.0173081737,
0.0075585954,
-0.115836516,
-0.3511054516,
-0.26859501,
-0.1359154135,
0.11389222,
0.0028499695,
-0.2171606719,
-0.0792468041,
-0.0178182386,
-0.258998245,
-0.0852828696,
-0.1233858243,
-0.1446755975,
-0.4979201555,
-0.0809313357,
-0.0383519977,
0.2050120533,
0.3365010023,
-0.0431852043,
-0.2461979389,
-0.34404248,
-0.0021831207,
0.309920609,
-0.4316572845,
0.0084864562,
-0.226437971,
0.0324327163,
-0.0082225194,
0.1528892964,
-0.4410762489,
0.1689272821,
0.2995243371,
-0.1188209653,
-0.0464242697,
0.3388528526,
0.1388071924,
-0.0459358543,
-0.1166080385,
0.2619565725,
0.0111125745,
-0.091146335,
-0.6637381315,
-0.4207080007
] |
https://github.com/huggingface/datasets/issues/1827 | Regarding On-the-fly Data Loading | Hi ! Currently when you load a dataset via `load_dataset` for example, then the dataset is memory-mapped from an Arrow file on disk. Therefore there's almost no RAM usage even if your dataset contains TB of data.
Usually at training time only one batch of data at a time is loaded in memory.
Does that answer your question or were you thinking about something else ? | Hi,
I was wondering if it is possible to load images/texts as a batch during the training process, without loading the entire dataset on the RAM at any given point.
Thanks,
Gunjan | 66 | Regarding On-the-fly Data Loading
Hi,
I was wondering if it is possible to load images/texts as a batch during the training process, without loading the entire dataset on the RAM at any given point.
Thanks,
Gunjan
Hi ! Currently when you load a dataset via `load_dataset` for example, then the dataset is memory-mapped from an Arrow file on disk. Therefore there's almost no RAM usage even if your dataset contains TB of data.
Usually at training time only one batch of data at a time is loaded in memory.
Does that answer your question or were you thinking about something else ? | [
-0.286942631,
-0.3630419075,
-0.1495333463,
0.2731826007,
0.4143626094,
0.1709424108,
0.4223021269,
0.1292586327,
0.1851397008,
0.0802383944,
0.1216422841,
-0.0679908991,
-0.2427963316,
0.1963997334,
0.1893506497,
0.2370750606,
-0.0065638581,
0.1383549273,
-0.1860134453,
0.0667946562,
-0.0094697801,
-0.2281021029,
-0.1345321387,
-0.3600883782,
-0.3519834876,
-0.1788707525,
-0.2061012089,
-0.0816746503,
-0.0664417148,
-0.1807877272,
0.0383012071,
0.145457983,
0.2661629021,
0.2168917954,
-0.0001134483,
0.0263618529,
0.1878574044,
-0.1615200192,
-0.4358330071,
0.1928044111,
-0.084927097,
0.0534440577,
0.14894633,
-0.2591665387,
-0.0432946384,
0.2636417449,
0.1821038276,
-0.3938760757,
0.3936269283,
-0.0597929284,
0.1287946552,
-0.0312943496,
-0.3372347355,
0.0115781454,
0.0496061631,
0.1317645311,
0.07075537,
0.0703822896,
0.2710400522,
-0.0599781647,
-0.1753792316,
0.3019685745,
0.0040442906,
0.0481206067,
0.3422018588,
0.0536040701,
0.0754284188,
-0.3361241817,
-0.032416027,
0.0897566602,
0.5630343556,
-0.0347455181,
-0.1553305984,
-0.3663961589,
0.1146518737,
-0.2698695362,
-0.0625269413,
0.4893333018,
-0.4659107924,
0.0407535061,
-0.568321228,
-0.425609231,
-0.2526450157,
-0.0436526723,
-0.0367211178,
-0.4735997915,
0.1323297173,
0.0079849586,
0.1394611895,
0.1308272332,
0.3437523544,
-0.2316766083,
-0.0460173711,
0.4015501738,
-0.2577869892,
-0.0960030779,
-0.6005837917,
-0.2998293042,
0.0383349992,
-0.2760588229,
0.1747637391,
0.1581801623,
-0.0951352641,
0.106140852,
0.3347073793,
-0.0193862263,
0.0244124997,
0.0254780483,
-0.0001035208,
-0.275927037,
-0.2644040287,
-0.0578749366,
-0.4595867991,
0.0949928164,
0.0331915617,
-0.394300431,
-0.4661897719,
0.0087624127,
0.1717681438,
-0.2818393707,
0.0412121527,
-0.0137913842,
-0.243588984,
0.2964888513,
0.0139824189,
-0.048142273,
0.4604892135,
-0.2862052023,
-0.1249799356,
-0.2746883929,
-0.0637199357,
0.0656900182,
-0.3060082793,
0.2646065652,
0.133171007,
0.1531424671,
0.0667291656,
-0.1371393502,
-0.0669991896,
0.0364050344,
0.0199882593,
-0.3356125057,
0.2059192359,
0.1551752985,
-0.1178064942,
-0.2792703211,
-0.0381689146,
0.3118377626,
0.0060956851,
0.5027796626,
-0.2631537914,
-0.0698120743,
0.4293095767,
0.08178211,
0.0833738819,
-0.1546332091,
-0.6008712649,
0.3655920029,
0.1369956136,
0.1333422065,
0.070576787,
-0.0077770739,
-0.3763466775,
0.0051173284,
0.2648200691,
0.3271276951,
-0.3991859257,
-0.3566910326,
0.4185028672,
-0.0158254504,
-0.1391630322,
0.1062799618,
-0.308632642,
0.4188513756,
0.0300431345,
-0.1001224071,
0.0982154757,
-0.2143739909,
-0.0543932617,
0.3533627987,
0.0158601869,
-0.1013926044,
0.0247093681,
0.5722174048,
0.0938573405,
0.2492917776,
0.3291520774,
0.7063399553,
0.1441550702,
0.1200049743,
-0.1268435717,
-0.2603088617,
-0.3210429549,
0.3683959544,
0.1643719524,
0.1685016155,
0.0841634572,
0.0194548555,
0.2347206473,
-0.2200760692,
0.0599160492,
0.2151896358,
-0.0518269949,
0.1326138675,
-0.1009774357,
0.22995992,
-0.4385000765,
0.2532021403,
0.044466272,
0.0821054727,
0.1139746904,
-0.0054875272,
0.363119036,
-0.2487814873,
0.1507820338,
0.2011343241,
-0.0444285534,
-0.310113579,
-0.225203827,
-0.0229291804,
-0.4112914205,
0.6960086226,
-0.4796497822,
0.2173446566,
-0.1416356564,
0.098939009,
0.500331521,
-0.0849593207,
-0.0852531791,
-0.2335909754,
-0.4635134935,
0.0353132263,
0.068944104,
0.381808728,
0.1407143176,
0.1782446057,
0.0316988081,
0.0492443591,
0.1813833117,
0.0268358067,
0.182676971,
-0.3104830682,
0.1619307548,
-0.1521641761,
-0.3586107492,
0.4180772305,
0.0945809186,
0.2759921849,
0.3086819351,
-0.1523554623,
0.0141112152,
-0.1444023401,
-0.0534744263,
0.1024153456,
0.0438672677,
0.2268583924,
0.4621655345,
0.1707959026,
-0.2648863494,
-0.3457975984,
0.0504016392,
-0.1120197549,
-0.0432915464,
0.2249032408,
-0.1269933283,
0.036462985,
0.0329796486,
-0.0982065052,
0.2339930534,
0.2031130195,
-0.0120154899,
0.1703815311,
0.2188821584,
0.0095248334,
0.0882777423,
0.0622380972,
0.4783917367,
-0.1956155896,
-0.0780265108,
-0.0296745636,
-0.264093399,
0.2508115172,
0.1417490393,
-0.1726943105,
-0.1391682923,
-0.0242393296,
0.0047017415,
-0.3065867722,
-0.0998251215,
0.3313086927,
-0.1850057095,
0.360114187,
-0.0126784993,
0.0224997494,
0.169631049,
0.0071447529,
-0.0975897089,
0.9094576836,
-0.0469646379,
-0.2100369185,
-0.0211733859,
-0.0736699924,
-0.0035657745,
0.0343072601,
0.3430948257,
-0.0483930632,
0.3704326153,
0.1406489611,
-0.1775661409,
0.1492756903,
0.2240160257,
0.1529070586,
0.2234521359,
-0.0167877525,
-0.3906624019,
0.1024203449,
-0.254272908,
0.0477849357,
-0.0878186971,
-0.3387581706,
-0.2243399918,
-0.346924901,
0.3597925603,
0.0980084836,
-0.0353976712,
-0.0074069533,
-0.4434203506,
-0.0958466381,
0.1404808313,
0.1994834542,
0.1051897034,
0.3841190636,
0.1694537848,
-0.1420044601,
-0.1363411695,
-0.0258121397,
0.0546568036,
-0.4763893187,
-0.089855969,
0.0492233709,
-0.1751330048,
-0.0948599502,
0.0402584262,
0.0185467172,
0.8389364481,
-0.8290775418,
0.1393473595,
-0.0379308313,
-0.2141061872,
-0.2819702029,
0.0518491194,
0.03995502,
-0.2387922704,
-0.0956739485,
0.0473072305,
0.3101843297,
0.158817485,
-0.1029089019,
0.0373464897,
0.298879087,
0.1454367042,
0.1473432332,
0.7117275,
-0.2123529613,
-0.1662728339,
0.1837856174,
-0.0557092428,
0.2883811593,
-0.1327326447,
0.2319424003,
-0.162826702,
-0.2090507895,
-0.260818392,
0.178902626,
0.0665001348,
-0.3049503267,
-0.4226721525,
0.2403940856,
-0.0813536122,
-0.0320501029,
0.3473744988,
-0.3740391731,
0.3303477168,
-0.0016485729,
-0.0334113315,
-0.0969609469,
-0.2357495725,
-0.0053576897,
-0.1043845415,
0.414375037,
-0.2544371188,
-0.2346522808,
0.4172890186,
-0.2592052221,
0.0629909784,
-0.0961624384,
0.1816752106,
0.0727686584,
-0.1402254254,
0.2659955621,
0.1421540529,
0.5721116662,
0.0801074356,
-0.1290569156,
0.048235137,
-0.4424249828,
-0.2215892822,
0.0046015084,
-0.137778759,
-0.0947396606,
-0.0602913722,
0.3573643267,
-0.0340164863,
-0.2430555075,
-0.0223228168,
-0.0218736902,
-0.4067217708,
-0.3591226935,
-0.1792960316,
0.1477944106,
-0.0813551396,
0.070000425,
0.1895978004,
0.0160896555,
0.046732787,
-0.1547947675,
-0.3114151359,
0.3588235378,
0.0349280424,
-0.2902464867,
0.0128697753,
0.2783671021,
0.2972323596,
0.156008929,
0.1676652282,
0.2824074924,
0.2115089446,
-0.2807260752,
0.0307465531,
-0.1402093321,
-0.0448335968,
0.3898750544,
0.4764643013,
0.2214211375,
0.0638552681,
0.1461298019,
0.0189741794,
-0.5502629876,
0.1762142926,
0.0959276482,
-0.1931821406,
-0.2183630019,
-0.6674817801,
0.7044336796,
0.226547122,
0.0304394253,
0.371471256,
-0.4017284214,
-0.3358764946,
0.1563836038,
0.3137791455,
0.7594901323,
-0.508361876,
0.5862455964,
-0.2089074403,
0.3120793998,
-0.0432063155,
-0.2429619581,
0.2859004438,
-0.2782699168,
-0.2186477631,
-0.0573674254,
-0.2283290774,
-0.1376566291,
0.400331229,
0.1875219345,
0.0805416852,
0.1148524731,
0.051225055,
-0.0216510799,
-0.0426978357,
0.0049441364,
-0.3637230098,
-0.0700796321,
0.1293797642,
0.2027827054,
0.0689089522,
-0.2274376601,
0.1318278909,
0.0569336303,
-0.0522893518,
0.1077697575,
-0.0969801694,
-0.3252197206,
0.0566040725,
-0.2804449499,
-0.1579395682,
-0.2129371911,
0.2018788755,
-0.0126545746,
-0.129857108,
0.1094612777,
0.163595885,
0.0348534994,
0.2512392402,
-0.0455207415,
-0.0214390699,
0.3898709714,
-0.0218957085,
0.0292106718,
0.1299553812,
-0.2188922763,
-0.3678269088,
-0.0035802564,
0.0904559046,
0.1948286295,
-0.0676590279,
-0.1820920855,
0.1736177057,
0.2327826917,
0.206348449,
0.1096126661,
0.1880127043,
-0.1446283162,
0.4939881861,
0.2086309046,
-0.2386705428,
0.0895971805,
0.4949344993,
0.1367443353,
-0.303352803,
0.2160910368,
-0.0414569713,
-0.113397114,
-0.1351356804,
0.2718051076,
0.483199209,
-0.0381479375,
0.160602361,
0.1519205868,
0.2268359214,
-0.0794178843,
0.1180792525,
0.0783065781,
-0.1671866924,
-0.1144028082,
-0.1036436558,
-0.4050600827,
0.2820174694,
0.1186197773,
0.3430782855,
0.1811314076,
-0.2666764259,
0.181914866,
0.1119837537,
-0.2680925429,
0.1936521679,
0.0865638182,
0.2839425206,
-0.1136797294,
0.1599309444,
-0.0207434762,
-0.0552255027,
0.0529274046,
0.0634660423,
0.0021787575,
-0.2107870132,
0.1371089369,
0.2034443617,
-0.0163178332,
0.0004690836,
-0.007761653,
-0.4162226617,
-0.1493645012,
-0.1376377791,
0.1833474487,
0.1661133915,
-0.0933712795,
-0.1546976119,
0.354157269,
0.4425536692,
-0.2050751299,
0.4429436624,
-0.1198161393,
0.3913667202,
0.1933414936,
-0.0782010257,
0.0165952891,
0.0673755631,
-0.0023890666,
-0.0114155971,
0.357513696,
-0.1186276674,
-0.0139956912,
-0.3259765208,
0.1605258286,
-0.1186752543,
0.2884550095,
0.3929077089,
-0.5295216441,
0.0210720617,
0.2882758975,
0.2199261338,
0.0413382612,
-0.0999146774,
0.0013914863,
-0.3731640279,
-0.0823177025,
0.2886895537,
0.2444266528,
0.0573420487,
-0.2947584689,
-0.1455801576,
0.2715759277,
-0.2606424987,
-0.0618506037,
0.2537120283,
0.1017386392,
-0.0880401656,
-0.0667774677,
0.5002999306,
0.0994487926,
0.2923496068,
-0.1078580245,
0.3313671052,
-0.0780326203,
0.0673844665,
-0.3112195134,
-0.360411793,
0.0117538339,
0.6964073181,
-0.0603916906,
0.1763446629,
-0.3629173338,
0.1245691925,
0.1141187623,
-0.3701485097,
-0.0549513996,
-0.0252003428,
-0.1251751781,
0.2137397975,
-0.168369323,
-0.1392388344,
-0.148805216,
0.4257664979,
-0.0214824583,
-0.3161220551,
0.1841954291,
0.3428274095,
0.0629121363,
0.2339560986,
-0.0558647849,
0.1977969408,
0.0929988474,
-0.2929552495,
-0.0018577472,
-0.3005571365,
0.2502623498,
0.4217055142,
0.3071511984,
-0.0888091102,
0.2305086404,
-0.0098299282,
0.0692277253,
0.1632236242,
0.0619339831,
-0.1380837262,
0.1137987822,
0.3265500367,
0.2447985411,
0.1347538084,
0.0764113441,
-0.1088598892,
0.2404528856,
0.0029706401,
-0.1757609099,
-0.4388476014,
0.0652569905,
0.2699502707,
-0.1519253999,
-0.0684701279,
0.0186508968,
-0.243613705,
0.0455426201,
0.3752803206,
-0.5222756267,
-0.0179570261,
0.4855552912,
0.0530990474,
-0.218710348,
0.5302196741,
0.1026280224,
0.2320314646,
-0.3197327256,
-0.3163999021,
-0.3911036551,
-0.0813908279,
-0.1839071363,
0.1252807528,
-0.0581022538,
0.1672068685,
0.2231076509,
0.1155927256,
-0.1143736318,
-0.4481284916,
-0.1608467549,
0.2227236629,
-0.3137450516,
0.0800441355,
0.0210040007,
0.4221848249,
-0.122995086,
-0.3117895424,
0.0642926991,
-0.1346099377,
-0.1530558169,
0.3762383759,
0.0729845837,
-0.0030936489,
0.2004398406,
0.4600739181,
-0.4780103862,
0.3159681261,
0.0674665794,
0.0163114108,
0.0193635095,
-0.1592830867,
-0.2847010493,
0.001584803,
0.1615588516,
-0.0372263193,
-0.2762800157,
-0.0611418821,
-0.0320593975,
-0.1948690265,
-0.0641592443,
-0.2005609274,
-0.1224494427,
-0.4066179991,
0.0587395206,
0.0516070314,
0.1041536704,
0.3399558067,
-0.1439996511,
-0.2960096002,
-0.3409699798,
0.0431044623,
0.3233137727,
-0.4750150144,
0.0190590899,
-0.2495694011,
0.1382081211,
-0.0614198819,
0.167885527,
-0.3513654768,
0.1177770197,
0.422001332,
-0.0616202429,
-0.1031267419,
0.3565876484,
0.2294966578,
-0.0286255535,
-0.0584891289,
0.2589512765,
-0.2766316235,
-0.1549825221,
-0.60725981,
-0.4248476923
] |
https://github.com/huggingface/datasets/issues/1825 | Datasets library not suitable for huge text datasets. | Hi ! Looks related to #861
You are right: tokenizing a dataset using map takes a lot of space since it can store `input_ids` but also `token_type_ids`, `attention_mask` and `special_tokens_mask`. Moreover if your tokenization function returns python integers then by default they'll be stored as int64 which can take a lot of space. Padding can also increase the size of the tokenized dataset.
To make things more convenient, we recently added a "lazy map" feature that allows to tokenize each batch at training time as you mentioned. For example you'll be able to do
```python
from transformers import BertTokenizer
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
def encode(batch):
return tokenizer(batch["text"], padding="longest", truncation=True, max_length=512, return_tensors="pt")
dataset.set_transform(encode)
print(dataset.format)
# {'type': 'custom', 'format_kwargs': {'transform': <function __main__.encode(batch)>}, 'columns': ['idx', 'label', 'sentence1', 'sentence2'], 'output_all_columns': False}
print(dataset[:2])
# {'input_ids': tensor([[ 101, 2572, 3217, ... 102]]), 'token_type_ids': tensor([[0, 0, 0, ... 0]]), 'attention_mask': tensor([[1, 1, 1, ... 1]])}
```
In this example the `encode` transform is applied on-the-fly on the "text" column.
This feature will be available in the next release 2.0 which will happen in a few days.
You can already play with it by installing `datasets` from source if you want :)
Hope that helps ! | Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions?? | 197 | Datasets library not suitable for huge text datasets.
Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions??
Hi ! Looks related to #861
You are right: tokenizing a dataset using map takes a lot of space since it can store `input_ids` but also `token_type_ids`, `attention_mask` and `special_tokens_mask`. Moreover if your tokenization function returns python integers then by default they'll be stored as int64 which can take a lot of space. Padding can also increase the size of the tokenized dataset.
To make things more convenient, we recently added a "lazy map" feature that allows to tokenize each batch at training time as you mentioned. For example you'll be able to do
```python
from transformers import BertTokenizer
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
def encode(batch):
return tokenizer(batch["text"], padding="longest", truncation=True, max_length=512, return_tensors="pt")
dataset.set_transform(encode)
print(dataset.format)
# {'type': 'custom', 'format_kwargs': {'transform': <function __main__.encode(batch)>}, 'columns': ['idx', 'label', 'sentence1', 'sentence2'], 'output_all_columns': False}
print(dataset[:2])
# {'input_ids': tensor([[ 101, 2572, 3217, ... 102]]), 'token_type_ids': tensor([[0, 0, 0, ... 0]]), 'attention_mask': tensor([[1, 1, 1, ... 1]])}
```
In this example the `encode` transform is applied on-the-fly on the "text" column.
This feature will be available in the next release 2.0 which will happen in a few days.
You can already play with it by installing `datasets` from source if you want :)
Hope that helps ! | [
-0.2644475698,
0.0704936087,
0.0091306139,
0.1295919567,
0.3082515597,
0.0080510415,
0.2901794314,
0.3717777729,
-0.2807388604,
-0.0181722827,
-0.0488237031,
0.1473778933,
-0.2360718995,
0.0108855795,
0.0396098159,
0.0288688075,
0.2195766121,
0.2025509626,
0.1469030827,
0.0644166395,
-0.0421972461,
-0.2423410416,
-0.2289886326,
-0.0132893175,
-0.4302167296,
-0.2289026976,
-0.1301005334,
-0.2940587997,
-0.357735455,
-0.4037179053,
-0.0329179354,
0.1460275203,
0.4799692929,
0.433044821,
-0.0001187578,
-0.1787716597,
0.1574261338,
0.0388377942,
-0.0915221274,
0.0657220483,
0.2080893219,
-0.3404703438,
-0.15106754,
-0.2540647686,
0.1679103523,
-0.1874024421,
0.0126407733,
-0.1223174557,
0.2558722794,
-0.022112051,
0.1069587171,
0.1478158534,
-0.1175833866,
0.1175927669,
0.2055493295,
-0.0257248469,
-0.0671748966,
-0.0461691394,
0.3811223507,
-0.0764789954,
-0.1874812245,
0.3004253805,
-0.1841916591,
-0.0576366335,
0.392002672,
-0.0049805916,
-0.1302285641,
-0.3429000378,
0.2336871475,
0.2656778097,
0.3912028372,
-0.3416000307,
-0.2912170291,
-0.4751842916,
-0.1442976147,
-0.1671047509,
-0.1160397157,
0.1333684176,
0.1011423618,
0.1327648163,
-0.5343758464,
-0.330026865,
-0.0942186937,
0.2805026472,
-0.1244558021,
0.2533673346,
-0.0309923477,
0.0617217533,
0.0674951971,
-0.301127553,
0.1197618172,
-0.3782682419,
0.1251963377,
0.4119563401,
-0.2103306204,
-0.196703881,
-0.1620582491,
-0.1319679618,
0.4441079795,
-0.214640677,
-0.3352546692,
0.0751733184,
-0.2477161586,
-0.0298866238,
0.2738422453,
0.2010716051,
-0.1895845383,
0.3804609776,
0.1412707418,
-0.2511977851,
-0.0760983229,
-0.1168314591,
-0.5041648746,
0.0023233271,
0.2423706949,
-0.3414865732,
-0.2537663877,
-0.0109221414,
0.0321965292,
0.0937677771,
-0.3200735152,
0.2049038708,
0.1570598781,
0.2677529752,
-0.1823853999,
0.1182556525,
-0.2504810095,
0.1530010849,
-0.1295622736,
0.013684311,
-0.0348926038,
-0.0809213519,
-0.3118556738,
0.0885425806,
0.1323876232,
0.0369312242,
0.1483547986,
-0.0311595537,
0.0830835477,
0.1199528575,
0.2286500931,
-0.3431079686,
0.0696900636,
0.0881681591,
-0.0551423207,
0.361456424,
-0.2426368892,
0.0543856546,
-0.2421158999,
0.3458733261,
-0.3575133383,
-0.3633337915,
0.1150058061,
0.0956481099,
-0.2124391645,
-0.019232545,
-0.477178067,
0.3124536574,
0.4131702185,
0.0353510529,
0.0308051724,
-0.2233494073,
-0.2891538143,
-0.1119893864,
0.2520446777,
0.2172582746,
-0.3746162355,
-0.0462595485,
-0.0060774479,
0.2774540484,
0.3547431827,
0.7049415708,
-0.2344235927,
0.4682487249,
-0.0217173807,
0.5970694423,
0.1308766603,
-0.0120306369,
-0.5504748225,
0.3064101934,
0.136111632,
-0.062627919,
-0.0474241525,
0.048703175,
0.5649159551,
-0.1264644712,
0.2421898544,
0.347728163,
-0.1075709462,
0.2397235632,
-0.2524234653,
-0.389459461,
0.25437361,
0.2126839012,
0.2313423157,
-0.4073576629,
-0.1076534986,
0.5631250739,
0.1074656546,
-0.2344981134,
0.3512014151,
0.069459714,
0.1932826489,
0.1367790699,
-0.0244934633,
-0.1917745471,
-0.1133493558,
0.1387602538,
0.1284853816,
-0.0340242237,
-0.0177694913,
-0.3649344146,
0.1988361031,
-0.0558938608,
-0.0451729894,
0.0023124891,
-0.0087506184,
-0.2987194061,
-0.0523149632,
0.0450562499,
-0.1235792339,
-0.2520161271,
-0.1439159364,
0.1190633029,
-0.0510432832,
0.0653498098,
0.0642399192,
-0.0879655927,
-0.0818806142,
0.2881652415,
-0.1019602045,
-0.1098921299,
-0.0430197567,
0.1155032665,
0.1792634726,
-0.1729747951,
-0.1989776045,
0.6291498542,
0.3313725591,
-0.0527771711,
0.2620900869,
0.0579494424,
0.087484628,
-0.1010523513,
-0.0608755164,
0.1980132908,
0.1038437113,
0.1809870899,
0.0371336006,
-0.2367586493,
0.1842659414,
-0.0231457539,
0.0577141829,
-0.0625004992,
0.0631768256,
0.1399937719,
0.4071207047,
0.3443514109,
-0.0991740748,
-0.1226790771,
0.3456890881,
-0.2547418177,
0.0944560245,
0.3692591786,
-0.4270766377,
-0.370239526,
0.0560604185,
-0.2841128707,
0.0736775994,
0.1215595007,
0.0545075685,
-0.0743530318,
0.3321838975,
0.0049927216,
0.2567669451,
0.1768514663,
0.0905409753,
0.0599089749,
0.1524800062,
0.2476589829,
-0.0831809193,
-0.1484982371,
0.2264689654,
0.2812066972,
-0.0641533658,
0.0165544655,
-0.1782044917,
-0.1478780359,
0.0071278801,
-0.0921135545,
-0.1096903756,
0.0529508218,
0.149816826,
-0.050359875,
-0.0050369236,
0.2096641362,
0.0560786687,
0.3908671737,
0.0888426825,
-0.2763009071,
0.0869959146,
-0.0899238884,
-0.3656364977,
-0.01939133,
0.2563132346,
-0.331230998,
0.295576036,
0.1239058673,
0.1111487746,
-0.3529422581,
-0.5111263394,
0.0553660318,
-0.0807592943,
0.0430212691,
0.0051291632,
0.0119366096,
-0.3470669389,
0.0450908653,
-0.0829576403,
-0.2204848379,
-0.0486795418,
0.0377846137,
-0.1488907486,
-0.1909846961,
0.0991195664,
-0.1178261116,
-0.2849356234,
-0.1407162398,
0.182179749,
-0.1708400995,
0.144347474,
0.0215971265,
0.0585144348,
0.0398074836,
-0.0908533037,
-0.2165599912,
0.039611537,
-0.3456558883,
0.4540535808,
0.0537761226,
-0.1599425077,
-0.073915571,
-0.0598626509,
-0.0437618382,
0.3011981547,
-0.4520864487,
0.2026536167,
-0.2943244576,
0.2322740108,
-0.0625725985,
0.1154090539,
0.062830545,
0.0229553096,
0.0532675646,
0.0854735076,
-0.1402456164,
-0.1986550242,
-0.0442463271,
0.1966251135,
0.0458275005,
0.1926077753,
0.3319134414,
0.8323060274,
0.0649981722,
-0.1224134937,
0.2346019149,
0.1743756235,
0.1243968755,
-0.3345835507,
-0.1610758305,
0.1468510032,
-0.0445961617,
-0.1165467575,
0.5374456644,
0.13780424,
-0.1528318375,
0.3503894806,
-0.3317061961,
-0.0801907405,
-0.1775427163,
0.3647337556,
-0.2959561646,
0.2762162685,
0.000235758,
-0.0691210106,
-0.2257587761,
-0.3720053136,
0.0028130738,
-0.0108761257,
0.0650558844,
0.11884626,
-0.3358929455,
0.1355590522,
-0.5341356993,
0.189534232,
0.0412226804,
0.2819492221,
0.1803764254,
0.1240454614,
0.151119709,
0.126598686,
0.5065214038,
-0.0254912507,
-0.1990229189,
-0.1221660301,
-0.2344266772,
-0.0770515427,
0.0300616659,
-0.2233586013,
0.1062349603,
0.4797860384,
0.6534515619,
-0.3339406848,
-0.2007192224,
-0.3113007843,
0.432264626,
-0.0292310715,
-0.1336648911,
0.0284203328,
-0.0316573828,
-0.5678434372,
0.2233589292,
0.1654523611,
0.3397710025,
0.2408816814,
-0.1090206429,
-0.2026440799,
-0.0134128127,
0.2838233709,
0.0837168172,
0.1670538336,
0.0003051508,
0.2988264561,
-0.0417262726,
0.074447535,
0.431532681,
-0.0293055046,
-0.2243984938,
-0.4143538177,
-0.0252462495,
0.0462162644,
0.5054764152,
0.0984769687,
-0.0385241061,
0.2553430498,
-0.1259788275,
0.2532569468,
-0.2888217866,
0.5742151737,
0.218874827,
0.0965439379,
-0.737646699,
-0.5411157012,
0.0903891698,
0.2293256372,
-0.0981861949,
0.1740107983,
-0.153296113,
-0.3754506707,
0.5328888297,
0.2531070411,
0.9069619179,
-0.3994154632,
0.4245499671,
-0.2723043561,
0.4491719902,
0.5515662432,
-0.5493834615,
0.029903736,
-0.3276281655,
0.0971275121,
0.105132319,
0.0285460055,
-0.0868093148,
0.2766432464,
-0.0814037323,
0.2470187843,
0.0972768739,
0.3555195332,
-0.1267230213,
0.4976908267,
0.1301132441,
-0.5027884245,
-0.104188621,
0.0738881528,
-0.0947314128,
-0.0715887472,
-0.1766843945,
0.0566980988,
0.0730206892,
-0.0675734282,
-0.2201565653,
-0.189680472,
-0.185776338,
0.2202738374,
-0.0419982709,
0.0303263273,
0.4612099528,
-0.0011073138,
0.2244466245,
0.5506524444,
-0.1509454101,
0.1174334884,
-0.17306225,
-0.0176463127,
0.0873551294,
-0.2422231734,
0.1032314897,
0.0627398491,
0.1997381896,
-0.1990750879,
0.0809133351,
-0.0542824641,
-0.3179368079,
-0.1111049652,
0.6560409069,
-0.3565066457,
-0.1661114395,
-0.1440650672,
-0.0968540683,
0.006193277,
0.0565190464,
0.1002255306,
-0.0452601761,
0.3752140403,
0.0347154029,
-0.2648662329,
-0.0726716965,
0.0646325126,
0.0507313013,
-0.0524652265,
0.5686107874,
0.031816408,
-0.2139263451,
-0.1469619572,
0.3851611912,
0.2808521092,
-0.1480037272,
0.1107223034,
0.149030894,
0.0435370579,
-0.117678076,
0.1838832349,
0.1670870185,
-0.3886722624,
-0.0599258766,
-0.1476564258,
-0.4500802457,
0.1174713075,
-0.0276115853,
0.2204979956,
0.1344052553,
0.2206274867,
-0.1693746597,
0.0529473089,
-0.2138481736,
0.3104969561,
0.0079938387,
0.3019278646,
-0.3741822839,
0.0043554013,
-0.1641305983,
-0.0982666165,
-0.0976641253,
0.2237658054,
0.0310724322,
-0.1915960908,
-0.2536720634,
0.1974971443,
0.2984792292,
-0.3040184379,
0.0982728153,
-0.2110511363,
-0.0752809122,
-0.4249739945,
0.2353437543,
0.1522123367,
0.0180686731,
-0.1894284636,
0.2478582859,
-0.1959645748,
-0.2526568174,
0.1285891831,
0.0337719209,
0.1977978647,
0.0746601149,
0.2385920435,
0.3486386538,
-0.1484002769,
-0.0132971518,
0.1799264699,
0.6943487525,
-0.0666867197,
0.0668376237,
-0.0838263556,
0.1475383639,
0.3351516128,
0.0089717647,
0.3940819502,
-0.2136284411,
-0.386099875,
0.6833880544,
0.172422722,
-0.0602163337,
-0.1880694628,
-0.028869763,
-0.179068312,
-0.1656183004,
0.1121013984,
0.1801542044,
0.2911600769,
-0.4418910444,
-0.0985674262,
0.3846247196,
0.1857511401,
0.0258365925,
0.4675316215,
0.0653677285,
-0.0693072602,
0.3300029635,
0.305134207,
0.2250808775,
0.4662766457,
-0.0665650666,
0.4718082249,
0.0667064339,
0.1253406852,
-0.1344001591,
-0.3910472393,
-0.2368485183,
0.4256218672,
0.1948473305,
0.0373421907,
-0.2140035927,
0.2732303143,
0.2574637234,
-0.2321343422,
-0.0505206361,
0.3097577095,
-0.2751245797,
-0.166729182,
-0.058716055,
-0.0501799993,
0.0308764521,
0.2555801272,
-0.2814870179,
-0.2813138068,
0.1018579602,
0.0614645965,
0.0013056692,
-0.2767418623,
0.2092771381,
0.0969456658,
0.0506160818,
-0.2989829779,
0.2383567542,
-0.3614274561,
0.0396075845,
-0.2037045509,
0.2652470469,
0.316750288,
0.4223526716,
-0.1601740271,
0.040251676,
-0.1901483834,
0.1461489499,
-0.1259521395,
0.3894743919,
0.0751188174,
0.137794137,
0.1000467986,
-0.06780231,
-0.0697038844,
-0.107438162,
0.0438320264,
-0.328068316,
-0.0221283678,
0.0759528354,
0.2382019013,
-0.2457775176,
-0.0323609598,
0.0971808508,
-0.3176351488,
0.1855526417,
0.8031601906,
-0.3024762571,
0.1586750746,
-0.1604955941,
0.0480638035,
-0.1616029292,
0.4464982152,
0.4236750603,
-0.0030976401,
-0.5891638994,
-0.0724819452,
-0.391068846,
0.1330500096,
-0.4093895555,
0.2987822592,
-0.0047311964,
0.0367050841,
-0.1346131414,
0.0945016369,
-0.2672284544,
0.1531137526,
-0.4629122913,
0.0851814598,
-0.0476907194,
0.2911082208,
-0.1900389194,
0.2047684193,
-0.0044685532,
-0.3701976836,
0.3627032638,
-0.1943225414,
-0.1329682171,
-0.1911633313,
0.2968976498,
0.1788277626,
-0.1411943734,
0.4452566206,
0.1750631928,
0.1358043551,
0.0607833266,
0.2444523871,
-0.0074360492,
0.0730455518,
-0.247715354,
0.0883704349,
-0.0207429845,
-0.0447112694,
-0.2221277505,
0.1344269365,
-0.1506132483,
-0.1317331046,
-0.0069139553,
-0.1570843011,
-0.2271622866,
-0.0132328207,
-0.1807029992,
0.1478372365,
-0.0815055668,
0.4159238935,
-0.1348462999,
-0.0150566325,
-0.2692970932,
-0.2827502191,
0.2788336277,
-0.6746143103,
-0.4008939564,
-0.1481911391,
-0.0568874367,
0.5397031307,
-0.1090694368,
-0.6030368805,
0.1040229201,
0.4999961257,
0.1065344959,
-0.4595340788,
0.1034716144,
-0.0113229398,
0.0178212561,
-0.1956008673,
0.5466091037,
-0.194295302,
-0.2376629412,
0.0750035197,
-0.2591935098
] |
https://github.com/huggingface/datasets/issues/1825 | Datasets library not suitable for huge text datasets. | How recently was `set_transform` added? I am actually trying to implement it and getting an error:
`AttributeError: 'Dataset' object has no attribute 'set_transform'
`
I'm on v.1.2.1.
EDIT: Oh, wait I see now it's in the v.2.0. Whoops! This should be really useful. | Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions?? | 43 | Datasets library not suitable for huge text datasets.
Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions??
How recently was `set_transform` added? I am actually trying to implement it and getting an error:
`AttributeError: 'Dataset' object has no attribute 'set_transform'
`
I'm on v.1.2.1.
EDIT: Oh, wait I see now it's in the v.2.0. Whoops! This should be really useful. | [
-0.4678062797,
0.1656075567,
0.030423278,
0.1393030733,
0.3698441982,
-0.0799574032,
0.1343444437,
0.4200882912,
-0.4338595271,
-0.1087071672,
0.1051202863,
0.09787485,
-0.2596932948,
0.1617353112,
0.1377581209,
0.0071737007,
0.2880678177,
0.1773833036,
-0.0256084912,
0.1219858676,
-0.0683430061,
-0.1277214587,
-0.2867693305,
-0.0004000686,
-0.5252422094,
-0.263471663,
-0.0174380783,
-0.2435954511,
-0.4448637962,
-0.3248978555,
-0.1924745888,
0.1364666969,
0.4324245155,
0.5125051737,
-0.0001255966,
-0.2210252434,
0.2472048551,
-0.038425114,
-0.2875907719,
-0.0394755416,
0.293053776,
-0.3577699959,
-0.196844995,
-0.2132425904,
0.1938284785,
-0.3745192587,
-0.0414700694,
-0.1099503338,
0.1161911115,
0.2161801308,
0.0858881623,
0.0541304089,
0.070166029,
0.0395162962,
0.1645483673,
-0.0014555308,
-0.1042268276,
-0.02287977,
0.4538723528,
0.0654924512,
-0.1268362254,
0.1399395466,
-0.1216532961,
-0.0212640949,
0.4577087462,
-0.0739730522,
-0.2455075681,
-0.2150256485,
0.1715573817,
0.2889243364,
0.5197041035,
-0.4864003658,
-0.3977511525,
-0.5967864394,
-0.1693623662,
-0.2333571762,
-0.0051259943,
0.1050857678,
0.0644776225,
0.1954609901,
-0.5726390481,
-0.4743476808,
-0.1159554124,
0.3932581842,
-0.2551800609,
0.1143133193,
-0.1285424232,
0.0937682763,
0.1853440702,
-0.1451209933,
0.13376531,
-0.2565790415,
0.0210568868,
0.1875144839,
-0.3344247341,
-0.1271078587,
-0.1622016877,
-0.0211644769,
0.4064773619,
0.0946194679,
-0.4326747656,
0.0650007352,
-0.13599962,
-0.0083530843,
0.2543177307,
0.4710549712,
-0.2227851152,
0.2742274404,
0.2237855196,
-0.2196389288,
0.0120656583,
-0.0800842419,
-0.4790992439,
-0.1735176593,
0.07928022,
-0.3584180176,
-0.1200912669,
-0.1453280747,
-0.0396949202,
-0.001461811,
-0.1404424757,
0.1979497224,
0.1161107793,
0.1320021302,
-0.0579983927,
0.1802784055,
-0.1072320491,
0.2354940027,
-0.1325277984,
-0.2000353187,
0.0021077031,
-0.0203931648,
-0.2910281718,
0.1360286325,
0.1617563814,
-0.0009597046,
0.0848511085,
-0.109762378,
0.0947210565,
0.1195634082,
0.1449593455,
-0.3230379224,
0.0003707891,
0.169229582,
-0.127981782,
0.4077439904,
-0.1729891896,
-0.0469153635,
-0.2752203643,
0.3672423065,
-0.2981246412,
-0.3904720247,
-0.0615490973,
0.0727413073,
-0.4090562165,
-0.0488920771,
-0.5169220567,
0.413136512,
0.4666951299,
0.0010688318,
0.0228557903,
-0.2046529949,
-0.1611894965,
-0.0093320301,
0.1703174114,
0.1939946115,
-0.6206807494,
-0.0736393183,
-0.024231948,
0.1578421593,
0.2399744689,
0.6512372494,
-0.141007036,
0.340270102,
-0.0592870414,
0.3595708013,
0.2331755757,
0.1929224581,
-0.5321208239,
0.293427825,
-0.0334728099,
-0.2285967171,
-0.018056618,
0.0428131521,
0.3913394511,
-0.119369112,
0.0282693915,
0.4206732512,
-0.061683137,
0.1134216562,
-0.2282678336,
-0.3263327181,
0.1932421923,
0.2130990773,
0.2006418109,
-0.1420842558,
0.0438174903,
0.4546665251,
0.0379384458,
-0.1514839083,
0.4403599203,
0.0919938758,
0.2173001617,
0.1510067582,
0.0594994165,
-0.2520760596,
0.1766460091,
0.0390716717,
0.1651213467,
-0.0873568207,
-0.0359876193,
-0.2174771577,
0.0089025805,
-0.0221342426,
0.0318893753,
0.0726806074,
-0.1267324686,
-0.1551418453,
-0.0079077436,
0.1740849465,
-0.1608184725,
-0.1197563857,
-0.2361317724,
0.0724434033,
-0.1739456654,
0.070998311,
0.0937707201,
-0.1703378111,
0.0002911715,
0.1770594269,
-0.1185423732,
-0.1547639072,
-0.063391231,
0.2232183218,
-0.0343863368,
-0.168115899,
-0.3214411139,
0.6541765928,
0.2707797289,
-0.0625529364,
0.2410972118,
-0.0750870854,
0.041662626,
-0.1014061198,
-0.0262596421,
0.1974640638,
0.0318032689,
0.1712823808,
0.0407972001,
-0.2116278261,
0.0912052542,
-0.0658043995,
0.1283010691,
-0.0092191305,
0.1961651891,
0.0282078665,
0.3526706696,
0.2581018806,
-0.0891507715,
-0.1441116631,
0.54281497,
-0.2562140226,
0.2579789162,
0.4638551772,
-0.4305690229,
-0.3219676614,
0.0750785768,
-0.1099266931,
0.2708721459,
0.1814124137,
0.0384939872,
-0.0050508757,
0.2958003581,
-0.0585587397,
0.2269822657,
0.1292662472,
0.2312541902,
0.165501371,
0.1857071221,
0.1758006364,
-0.1652545631,
-0.1809601486,
0.2347023487,
0.3232019246,
-0.195605889,
0.0806346834,
-0.2088698298,
-0.1941363364,
-0.0987126231,
0.1454790384,
-0.1387940794,
0.0052880007,
0.0636099577,
-0.0917777568,
0.143972531,
0.1453877985,
0.1162512079,
0.3910383582,
0.0875248164,
-0.3043810129,
0.1152974218,
-0.058972694,
-0.4323796332,
-0.0351221561,
0.2794806063,
-0.4264618754,
0.2161748707,
0.1520199627,
0.0763975978,
-0.2842858732,
-0.5105537772,
0.0153104383,
0.0186662432,
0.2145486325,
-0.0979570299,
0.0204442348,
-0.1042168215,
0.130488798,
-0.0322460495,
-0.1589452475,
-0.1028219238,
0.0985745043,
-0.1815343201,
-0.2435968369,
0.1276802123,
-0.1638975739,
-0.2868720591,
-0.2101883143,
0.2809814513,
-0.1480193734,
0.0006389227,
0.1361134648,
0.153278321,
-0.0221643262,
0.0062425355,
-0.0760247409,
0.1199327409,
-0.2126327008,
0.5063886046,
0.1551690549,
-0.2401786894,
-0.1168238148,
0.0823827758,
-0.1706950516,
0.4046606421,
-0.4827157855,
0.2901177704,
-0.3174146414,
0.1822002828,
-0.0747015625,
0.1196027026,
0.1363299489,
-0.0662220493,
0.0911952406,
0.0743867084,
-0.2566072643,
-0.2644275129,
-0.0348305292,
0.3190365732,
-0.0538877286,
0.3580653369,
0.5046021342,
0.57071805,
-0.1284005195,
-0.2025968432,
0.3022205532,
0.0581375919,
0.1859379113,
-0.3812962472,
-0.2078490406,
0.3076784909,
-0.1130780801,
-0.1500233561,
0.4042947888,
0.0733633265,
-0.1256057024,
0.182213515,
-0.2858064473,
-0.0770430043,
0.0022835268,
0.1816805005,
-0.2554915845,
0.1949703395,
-0.0332256518,
-0.1473337561,
-0.0552726313,
-0.3543818593,
0.006502402,
0.0854857713,
-0.0398812369,
0.2780983746,
-0.5231357217,
0.1445458531,
-0.3172294796,
0.1839581281,
-0.1198383868,
0.3176474273,
0.0893476531,
0.0443347804,
0.1728509665,
-0.002982015,
0.6573578119,
0.1614987552,
-0.2243918329,
-0.080206722,
-0.18498905,
-0.2815259993,
0.0307365675,
-0.1564117968,
0.2526804507,
0.396907419,
0.4458355904,
-0.284660697,
-0.0874877796,
-0.1563076675,
0.599565804,
-0.0287431329,
-0.2090799361,
0.0097265923,
-0.193761155,
-0.6171143055,
0.1411235034,
0.1184751838,
0.3723033071,
0.0513246581,
-0.01769666,
-0.1607234627,
-0.1487680227,
0.3314807415,
-0.0212378856,
0.1076568142,
-0.0759272277,
0.2275632322,
-0.1148313507,
0.1661523283,
0.509688139,
-0.0112085436,
0.1589722484,
-0.2057617158,
0.0160308108,
0.0860806033,
0.4228658974,
-0.0182473976,
-0.1591089964,
0.2727677524,
-0.1592999101,
0.3351099789,
-0.2517127395,
0.4993903935,
0.142431438,
0.0247757789,
-0.7850490808,
-0.4419436157,
0.3065384328,
0.1834488362,
-0.0020834978,
0.233221814,
-0.0898343474,
-0.3548892438,
0.2965230346,
0.1264454573,
0.9342725277,
-0.3664007485,
0.2955782115,
-0.3144507408,
0.3217412233,
0.5618304014,
-0.6394956708,
-0.0108735766,
-0.3764119148,
0.0519122556,
0.0855143368,
-0.0542234108,
0.1334862262,
0.4011876881,
-0.103924796,
0.2485840172,
0.0921481997,
0.0529664867,
-0.0280639939,
0.6024864316,
-0.1124616414,
-0.3547428846,
-0.1395693272,
0.0302560888,
-0.1978613287,
-0.0176333282,
-0.1501986384,
0.1268521696,
-0.0480030887,
0.0881524757,
-0.3702216744,
-0.0857851207,
-0.0762251019,
0.1309332997,
-0.0710071772,
-0.1586060375,
0.5522642136,
-0.0243854355,
0.2939378023,
0.4906292856,
-0.1599324495,
0.1951518506,
-0.3952569664,
0.0072430228,
0.2270343304,
-0.2535533011,
0.1769525409,
-0.0029716429,
0.0467277393,
-0.227457568,
0.1215275601,
-0.0144595914,
-0.1863146126,
-0.1406601071,
0.5457143188,
-0.2815809846,
-0.1525869817,
-0.1081250906,
0.0739673674,
-0.0937484875,
0.012491337,
0.1646725535,
-0.020394573,
0.3688541651,
-0.0650465041,
-0.2675851583,
-0.1635231078,
0.2240000814,
0.0383483618,
-0.0482341535,
0.5090437531,
0.1999020576,
-0.1995315105,
-0.0959963873,
0.3914940953,
0.2192795128,
-0.2844051421,
0.2249101102,
0.1075526848,
-0.0183576103,
-0.1117916703,
0.0926161781,
0.1175077781,
-0.443125397,
-0.0679436326,
-0.2272989005,
-0.3753503859,
0.132586658,
-0.0316812992,
0.1135020554,
0.0622487552,
0.120356515,
0.0003966364,
0.112057656,
-0.1463400126,
0.1943095773,
0.0917975157,
0.2783544064,
-0.1562719643,
0.0478583723,
-0.2649523914,
-0.0907747597,
-0.1531645805,
0.1001147479,
0.1419310272,
-0.137661323,
-0.2068959326,
0.2038152814,
0.2516918182,
-0.2625120878,
0.1488555223,
-0.2941526175,
-0.13338992,
-0.3269463181,
0.2188900262,
0.2685706317,
-0.010176436,
-0.0553013869,
0.2593248785,
-0.3359719515,
-0.2528074384,
0.0586053729,
-0.0326534361,
0.1197474003,
0.1532149464,
0.3857434988,
0.5578311086,
-0.0974076018,
-0.3966266513,
0.2364943922,
0.4823635519,
-0.1004021913,
0.1028595865,
-0.2452235967,
0.1180026159,
0.3210249543,
0.1504741758,
0.4841672778,
-0.1821767837,
-0.388813138,
0.5509512424,
0.0933207572,
-0.1055201367,
-0.1948434114,
0.0620899796,
-0.1472336054,
-0.2354940921,
0.1320222169,
0.2544415593,
0.1740473807,
-0.4353879094,
-0.0554231182,
0.5197486877,
0.2001790255,
0.0402679704,
0.4844231009,
0.1650190651,
-0.0563522838,
0.3396511376,
0.2591528893,
0.2522543669,
0.5600366592,
-0.0156499129,
0.5746824741,
0.2159357667,
0.2291242778,
-0.17783463,
-0.4864791036,
-0.1272127777,
0.3517718017,
0.2182938904,
-0.0824784487,
-0.2162064016,
0.287764132,
0.3367441595,
-0.1225602403,
-0.0357289687,
0.1663769037,
-0.1916000545,
-0.1216513664,
-0.1463640481,
-0.1660090983,
-0.0130388746,
0.2312282622,
-0.2712216079,
-0.3700609207,
0.0600813963,
0.0320280604,
-0.1057992429,
-0.4628710747,
0.4335579872,
0.0649346635,
0.024106266,
-0.2738915086,
0.2926000059,
-0.2164277732,
0.0736270919,
0.0415441766,
0.2999279797,
0.4472157061,
0.4638704956,
-0.0596711971,
0.0109045217,
-0.2410857677,
0.0245370734,
-0.1439652443,
0.4624991417,
0.0349775888,
0.2712834775,
0.1345174611,
-0.0633617714,
-0.0324463919,
0.0050670868,
0.1022721305,
-0.317035526,
-0.1514538825,
0.037028566,
0.1535604298,
-0.3451302946,
-0.1238739118,
0.1821554601,
-0.2598913908,
0.0171435624,
0.9408843517,
-0.3457409143,
0.0535708033,
-0.1901855022,
0.0102616549,
-0.1116010174,
0.4436600804,
0.45705688,
0.0764182732,
-0.3387860656,
-0.0778190196,
-0.3848975003,
0.2020053267,
-0.2915290892,
0.2598515153,
0.0068155164,
0.0922792703,
-0.0870104134,
0.052169133,
-0.2772394717,
0.3317894638,
-0.3469388187,
0.0712582767,
-0.0766108707,
0.0129409526,
-0.1179919913,
0.242227003,
-0.1184536666,
-0.3655266166,
0.3441645205,
-0.1634908468,
-0.1625527143,
-0.221751377,
0.2344189733,
0.1863704622,
-0.1241048425,
0.5211455822,
0.163993001,
0.2844228745,
0.0696416795,
0.3814973533,
-0.0657798946,
0.029626919,
-0.3679363132,
0.2523975372,
-0.0413010381,
0.0206541829,
-0.2122360617,
0.1473591477,
-0.0459805876,
0.0547391661,
-0.0601739883,
-0.025084598,
-0.2111238688,
-0.0575818382,
-0.1792095155,
0.1422644705,
0.0848786235,
0.2873155773,
-0.0560957529,
0.0088383975,
-0.3809771836,
-0.2963830829,
0.282984972,
-0.4146690965,
-0.3906493485,
-0.1051528677,
-0.0266616624,
0.5343503952,
-0.2405609339,
-0.534579277,
0.0504023544,
0.5844873786,
0.0505461991,
-0.3297667503,
0.308981508,
-0.2321649641,
0.0101886215,
-0.1443694681,
0.5861443281,
-0.1608720124,
-0.270983547,
0.0085741393,
-0.1008410379
] |
https://github.com/huggingface/datasets/issues/1825 | Datasets library not suitable for huge text datasets. | Yes indeed it was added a few days ago. The code is available on master
We'll do a release next week :)
Feel free to install `datasets` from source to try it out though, I would love to have some feedbacks | Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions?? | 41 | Datasets library not suitable for huge text datasets.
Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions??
Yes indeed it was added a few days ago. The code is available on master
We'll do a release next week :)
Feel free to install `datasets` from source to try it out though, I would love to have some feedbacks | [
-0.4051039219,
0.1390957683,
0.0155029371,
0.2904538512,
0.2991150618,
0.007427345,
0.074768804,
0.3566737473,
-0.3289949894,
-0.0648281649,
0.0511005744,
0.0604725927,
-0.2490898669,
0.1777266264,
0.0443809293,
0.0889958888,
0.1888466775,
0.1591740102,
0.1126291826,
0.1340800226,
0.0361788683,
-0.1229674071,
-0.2318735421,
0.0238545742,
-0.533865571,
-0.247526899,
-0.0014845239,
-0.2042944729,
-0.4535928369,
-0.3168499172,
-0.1865609288,
0.1878174841,
0.5089609027,
0.4989701807,
-0.0001241754,
-0.2766104043,
0.2280960083,
-0.0018142433,
-0.2488394082,
0.0375927128,
0.4174689054,
-0.2963127494,
-0.2088590115,
-0.1917600632,
0.1633436233,
-0.2845401466,
-0.0240782686,
-0.0812099949,
0.1066379771,
0.079483211,
0.0776781216,
0.089176096,
0.0327629037,
0.1611441374,
0.1430721879,
0.0420884266,
-0.069255434,
0.068550542,
0.4472154677,
0.0410755314,
-0.1649743319,
0.180810824,
-0.1345978677,
-0.0035425855,
0.325260371,
-0.0841967911,
-0.1148665696,
-0.1845380217,
0.2241887301,
0.2748838663,
0.531857729,
-0.4414389431,
-0.2680337131,
-0.5356900096,
-0.1947641969,
-0.299777925,
-0.0366853438,
0.1811597645,
-0.0221888255,
0.2049568146,
-0.4301466644,
-0.4338744879,
-0.1384978294,
0.3633367121,
-0.2156598717,
0.1345005035,
-0.13689138,
0.1114956737,
0.1807054877,
-0.2048989981,
0.1003354043,
-0.3374052048,
0.0127525767,
0.1920610517,
-0.3882726431,
-0.1360714287,
-0.1989925355,
-0.0134857614,
0.4718785882,
-0.0272691939,
-0.4255779982,
0.1566310674,
-0.1229028702,
0.0211919099,
0.3621504009,
0.2150786519,
-0.1023105308,
0.2536747456,
0.1884469986,
-0.1695379764,
-0.0573533699,
-0.0731210038,
-0.5236899853,
-0.0749365985,
0.108167015,
-0.4771715999,
-0.2528763711,
-0.1971196234,
-0.0683676973,
0.0907616317,
-0.1943469644,
0.2627513111,
0.1845913529,
0.1667826325,
-0.0995505452,
0.0795410797,
-0.2099237144,
0.1964032799,
-0.1286839098,
-0.1992129087,
0.0066114874,
-0.0878105387,
-0.2628051639,
0.1638804823,
0.1636521369,
-0.0238199048,
0.1044934914,
-0.0577499606,
0.0845346749,
-0.0026515888,
0.1463346779,
-0.3493957222,
-0.0723239332,
0.0937068015,
-0.0408831537,
0.3709302247,
-0.2378409356,
0.0360969491,
-0.2047557831,
0.378934741,
-0.2517653406,
-0.3602265418,
-0.0587218851,
0.0722680539,
-0.3575673401,
0.028874876,
-0.5238498449,
0.369104445,
0.4520554543,
0.0841349885,
0.0100023886,
-0.1078973413,
-0.2290682793,
-0.0152360536,
0.1661331505,
0.1557084471,
-0.6027981043,
0.0375129394,
-0.0748697221,
0.1012729108,
0.3304003477,
0.7473346591,
-0.1570432484,
0.3759785593,
-0.1028383076,
0.447592169,
0.1434930116,
0.1725681722,
-0.5138145089,
0.4206910431,
0.0045100478,
-0.144560799,
-0.0063966601,
0.0962307081,
0.37775594,
-0.1191313565,
0.193528831,
0.331550926,
-0.0646064207,
0.0937099531,
-0.3203212619,
-0.3219232857,
0.1349286586,
0.3081051111,
0.1901599169,
-0.2884483635,
-0.0160416998,
0.3337592185,
0.1509051025,
-0.1702379584,
0.3706078827,
0.131439209,
0.2265495062,
0.1637719423,
-0.0087410361,
-0.225875482,
0.1498988569,
0.0636250302,
0.1120889783,
-0.1439845264,
-0.0422222763,
-0.2829773426,
0.1273656338,
-0.0255167466,
0.0055884207,
0.1112151295,
-0.0991992354,
-0.2185769975,
-0.0950811282,
0.1362292469,
-0.0690709054,
-0.1132751256,
-0.3314357102,
0.1292933673,
-0.1011644676,
0.0312826186,
0.0371804014,
-0.1410602629,
0.0365892611,
0.228133142,
-0.1317254901,
-0.1346917152,
0.0014941273,
0.1887517571,
0.0156656466,
-0.2401512116,
-0.259506613,
0.5918121338,
0.24000974,
0.0207168087,
0.248529911,
-0.0443753786,
0.0471284837,
-0.1107602343,
0.0558444001,
0.2861931622,
0.0867253393,
0.1239674538,
0.0046204175,
-0.2903571129,
0.0834712237,
-0.0330149531,
0.1967631578,
0.0264621619,
0.2717000544,
0.068382211,
0.3077635765,
0.318215251,
-0.1597679555,
-0.1507176608,
0.3479210436,
-0.3244884312,
0.1942494363,
0.4423329532,
-0.4264603555,
-0.3297382891,
0.0858767778,
-0.239774704,
0.1328827292,
0.1559307277,
0.0524385609,
-0.0497584157,
0.3660888374,
-0.0712771341,
0.1652619392,
0.1384436935,
0.1298761517,
0.2031745166,
0.1204416975,
0.1302974969,
-0.1725422591,
-0.064716503,
0.1956179887,
0.3540204167,
-0.1527121514,
0.0529188551,
-0.2162586004,
-0.3077144027,
-0.0110400738,
0.1897612065,
-0.1802605242,
0.0459264182,
0.1223607808,
0.0164132752,
0.1256355792,
0.0556494445,
0.1618562043,
0.3633155823,
0.0336526297,
-0.3247650862,
0.1699574739,
-0.0947101414,
-0.4917178154,
-0.0354664624,
0.3435525894,
-0.3346316516,
0.2998605967,
0.2190070003,
0.0502543896,
-0.315539211,
-0.4621924162,
0.0175772235,
0.1138876975,
0.2294163108,
-0.1505285352,
0.0415530577,
-0.1999852955,
0.162247479,
-0.0843454227,
-0.127807945,
-0.0805025846,
0.073614873,
-0.1590746641,
-0.218530342,
0.1113521606,
-0.030093953,
-0.2708159387,
-0.1825366169,
0.2240138203,
-0.1710543931,
0.0879485682,
0.0159657262,
0.0831059292,
-0.0141350646,
-0.0620024912,
-0.1454130113,
0.0298048873,
-0.3128145635,
0.4159115255,
0.2049838305,
-0.2109167427,
-0.0561017394,
0.1267621815,
-0.0717336312,
0.3511763811,
-0.5438869596,
0.3058476746,
-0.1919423342,
0.1967355311,
-0.1046425253,
0.0440996327,
0.0190378018,
-0.1551858336,
0.1073556989,
0.1218108684,
-0.2267127186,
-0.2391879857,
-0.1558681875,
0.3402345479,
-0.0448818952,
0.3125683963,
0.425499022,
0.5209855437,
-0.0903388262,
-0.1613206565,
0.3123966753,
0.1599564105,
0.2083930075,
-0.306710273,
-0.1090812683,
0.2963910699,
-0.0646376237,
-0.149852246,
0.4975774884,
0.142086789,
-0.1262379885,
0.2444569618,
-0.3252073228,
-0.0537727028,
-0.071248129,
0.2029608488,
-0.2755320072,
0.210680306,
-0.0213304255,
-0.1758276969,
-0.0468524359,
-0.3733196557,
-0.0410231426,
0.1587290466,
-0.0383769944,
0.219647646,
-0.5036864877,
0.2241736799,
-0.3506965339,
0.1727130264,
-0.1008412614,
0.3289102912,
0.1193175092,
0.1923475862,
0.2529751956,
0.0295971539,
0.5905704498,
0.1286063939,
-0.1712749898,
-0.1472329646,
-0.1064745486,
-0.19701083,
0.0440700985,
-0.1064045578,
0.2871231139,
0.4626607895,
0.467831254,
-0.3716436327,
-0.1510198563,
-0.2931526303,
0.55991292,
-0.0111812009,
-0.3234749138,
-0.0211637374,
-0.1401323825,
-0.5439131856,
0.1772214621,
0.1554722339,
0.3789795041,
0.1098547727,
-0.0748982206,
-0.1285219193,
-0.0583996363,
0.3375990987,
-0.0386173502,
0.1393354386,
-0.1615230888,
0.2351151407,
-0.2048265934,
0.1606556326,
0.5302137733,
-0.0235487353,
0.1311443448,
-0.270522356,
0.0150601063,
0.0480278321,
0.4064319432,
0.0143541563,
-0.1317489594,
0.3606282771,
-0.272470504,
0.2747164369,
-0.1869233996,
0.5377910733,
0.1321881413,
0.0761111304,
-0.8546541929,
-0.3134073019,
0.2389553934,
0.2096376717,
-0.020394465,
0.2407511175,
-0.1654564142,
-0.2896410823,
0.2982036769,
0.0951959714,
0.8781986833,
-0.4335552454,
0.3147645891,
-0.3794056177,
0.3414397538,
0.5416301489,
-0.6066262722,
-0.0487489663,
-0.4083095193,
0.161525175,
0.1442630887,
0.0018780527,
0.0331326015,
0.4243251979,
0.0419180579,
0.2461101413,
0.1147083342,
0.1426830143,
0.0231639277,
0.6419767141,
-0.0407159179,
-0.3181241155,
-0.1395404041,
0.0397098064,
-0.2120798528,
-0.0449907854,
-0.2248384058,
0.0811412558,
0.0633498132,
0.0467652977,
-0.2977199554,
-0.1569369286,
-0.106802769,
0.1042602807,
-0.0331256613,
-0.1095273495,
0.5250967145,
-0.0911672488,
0.2498139441,
0.5259622335,
-0.1830590516,
0.1304571778,
-0.3457989991,
-0.1237148792,
0.1785324961,
-0.2479605824,
0.0235180184,
-0.0207602661,
0.0566467084,
-0.2709760964,
0.1404961348,
-0.0610767826,
-0.1720450073,
-0.0925640613,
0.530939281,
-0.2246365398,
-0.1855243146,
-0.2013041228,
0.0065349154,
-0.0588910542,
0.0140480064,
0.2020163089,
-0.0909736827,
0.3338698745,
-0.0031674278,
-0.2340917289,
-0.1526644975,
0.1435001194,
0.0647661015,
-0.0494584069,
0.4163270593,
0.2087787241,
-0.1609241366,
-0.1365436912,
0.3690233827,
0.2042339891,
-0.1333569735,
0.1669919789,
0.2157004029,
0.0336741582,
-0.0534231365,
0.0314000249,
0.1624216139,
-0.4770179093,
-0.0215209369,
-0.2094073594,
-0.4017367661,
0.0650746375,
-0.0659416243,
0.1400867701,
0.0986139551,
0.1832356155,
-0.1213973984,
0.0774229765,
-0.1426041573,
0.3031953871,
0.0717247874,
0.2567866445,
-0.2012079358,
0.0669809133,
-0.2717163861,
-0.0734874979,
-0.1367840618,
0.18100366,
0.0861926898,
-0.1584146917,
-0.1302120835,
0.2053361237,
0.2879725099,
-0.3035105169,
0.1958216131,
-0.2923232615,
-0.1571635753,
-0.2866822779,
0.2603017986,
0.2527885139,
0.0190024283,
-0.2047918737,
0.2475491166,
-0.1835204512,
-0.3007824421,
0.1086713299,
-0.0695389211,
0.1680459976,
0.1572904289,
0.3060736656,
0.5086445808,
-0.1263926625,
-0.2461177111,
0.2235289961,
0.5379694104,
-0.1390587986,
0.0469006225,
-0.2240176201,
0.056261491,
0.3431702256,
0.1255343407,
0.4919004738,
-0.1794983894,
-0.439112395,
0.5194436312,
0.113829419,
-0.062784493,
-0.1875596195,
0.0103211282,
-0.2073719949,
-0.2274607122,
0.1133361831,
0.2939916849,
0.231871739,
-0.4301716387,
-0.1073142737,
0.4482292533,
0.2221772224,
-0.0320121869,
0.3989516199,
0.2036204487,
-0.0728803426,
0.3351423144,
0.3068633974,
0.2198587805,
0.5268708467,
-0.0581776462,
0.4922592044,
0.166291073,
0.2116735578,
-0.2272536755,
-0.5121085644,
-0.2115657628,
0.4970754683,
0.2400821447,
-0.1219466403,
-0.2991294861,
0.2617676556,
0.2839816511,
-0.1622591764,
-0.0132667236,
0.1090706065,
-0.2722468674,
-0.1288958788,
-0.1676673591,
-0.1421464384,
0.0024210322,
0.2354131788,
-0.2957063317,
-0.362026602,
-0.1098736301,
-0.0170902461,
-0.1344925165,
-0.4729761183,
0.3292241991,
0.1380203366,
-0.0384657569,
-0.2397852242,
0.3410394192,
-0.2583073974,
0.0637732819,
0.008056391,
0.1592170596,
0.380053848,
0.4069365859,
-0.0449399017,
-0.0394805968,
-0.2551727891,
0.126979664,
-0.1580906361,
0.4713906646,
0.1255232841,
0.244582057,
0.2040171921,
-0.0757748783,
-0.0273605343,
0.0225055795,
0.1525156945,
-0.3925789893,
-0.1344256997,
-0.0289975107,
0.1252283007,
-0.3083193898,
-0.1817845702,
0.129235819,
-0.2639212608,
0.0268081408,
0.9157550335,
-0.3334181309,
0.0808729082,
-0.1699113697,
0.0257630646,
-0.2719905972,
0.4641676247,
0.453032434,
0.0959296972,
-0.4936908782,
-0.1008709446,
-0.423951149,
0.2393166274,
-0.4164299369,
0.26480335,
-0.0322676674,
0.0965502337,
-0.0368506983,
0.083442457,
-0.3513626456,
0.4076352119,
-0.3663594127,
0.0291205328,
-0.1237227544,
0.1158566624,
-0.1410602033,
0.1594541818,
-0.1152452156,
-0.4063184261,
0.3437704444,
-0.2157748044,
-0.1688445508,
-0.1341072768,
0.2802436054,
0.1360771656,
-0.151736483,
0.4600012302,
0.1406884193,
0.234168455,
0.1425189227,
0.297013849,
-0.0326542817,
0.1505416185,
-0.3552690744,
0.1838353723,
0.0279491171,
-0.0022605979,
-0.1371672302,
0.2312853038,
-0.0470787659,
0.038046781,
-0.0372090787,
-0.0808861032,
-0.1327138543,
-0.0746404678,
-0.1198438257,
0.1599337757,
0.0416635461,
0.3343161047,
-0.0387918949,
-0.037447013,
-0.3385150433,
-0.2272847742,
0.2538479567,
-0.4144104123,
-0.2750646174,
-0.1406802535,
0.0405464359,
0.6282327771,
-0.2390319556,
-0.5446510911,
0.0836585239,
0.5542654991,
0.0989967585,
-0.2914942503,
0.2658553421,
-0.1875572354,
0.0611146055,
-0.123735778,
0.4827391207,
-0.1363035589,
-0.2857729495,
0.0782937482,
-0.1773689687
] |
https://github.com/huggingface/datasets/issues/1825 | Datasets library not suitable for huge text datasets. | For information: it's now available in `datasets` 1.3.0.
The 2.0 is reserved for even cooler features ;) | Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions?? | 17 | Datasets library not suitable for huge text datasets.
Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions??
For information: it's now available in `datasets` 1.3.0.
The 2.0 is reserved for even cooler features ;) | [
-0.4345218837,
0.1332364529,
0.0117715104,
0.2648241818,
0.267734766,
0.0202759318,
0.0753501356,
0.3607456386,
-0.3179923296,
-0.0622063875,
0.0359684601,
0.0512574278,
-0.2549734712,
0.1889113784,
0.0521264076,
0.0839584023,
0.1855184883,
0.1725188643,
0.1144119576,
0.1579608917,
0.0227796137,
-0.1485539526,
-0.2536758482,
0.0014493805,
-0.500429213,
-0.2469412386,
0.001542429,
-0.2171643972,
-0.449196279,
-0.3404018879,
-0.1768149287,
0.1993859112,
0.5116477609,
0.4627271593,
-0.0001238177,
-0.2813290358,
0.2467758358,
0.0012897033,
-0.2723439336,
0.0447508805,
0.387678057,
-0.3245376945,
-0.2008231282,
-0.1749606282,
0.1608985513,
-0.2847050726,
0.01489041,
-0.0699784085,
0.0965196118,
0.0494217053,
0.0779270455,
0.0929794237,
0.0187181849,
0.1376075745,
0.1242062077,
0.0346614867,
-0.0822471529,
0.0537680015,
0.4505402744,
0.0497521237,
-0.1552139372,
0.1750815362,
-0.116612345,
0.0095224772,
0.3391450047,
-0.1126097068,
-0.1405124515,
-0.188411206,
0.2254880667,
0.2983858585,
0.5142073035,
-0.4272149801,
-0.2893553078,
-0.5464209318,
-0.2044093907,
-0.3196331561,
-0.0669305325,
0.1782542318,
-0.013110755,
0.2042058706,
-0.4558202028,
-0.4421233535,
-0.1168553457,
0.36539042,
-0.2350142896,
0.1488132924,
-0.1368507594,
0.1141695529,
0.165915072,
-0.2179450393,
0.112626709,
-0.3288343549,
0.0219100118,
0.1951114535,
-0.3774074912,
-0.1529269814,
-0.2038585097,
-0.0359362811,
0.4822557867,
-0.0165512525,
-0.4332740307,
0.1530094296,
-0.1389315426,
0.029494483,
0.3459945023,
0.2049815953,
-0.1033098474,
0.2640488148,
0.1982869208,
-0.1752957702,
-0.0434120633,
-0.0784639642,
-0.521792531,
-0.0583363958,
0.115369834,
-0.4676723182,
-0.2794631422,
-0.1709813178,
-0.0768824443,
0.0893993452,
-0.166105777,
0.3055481613,
0.17283912,
0.1523609161,
-0.1039776355,
0.0859915912,
-0.2191547006,
0.1837836206,
-0.0974595547,
-0.1802393645,
0.0022476802,
-0.1083155647,
-0.234727487,
0.1755831689,
0.1531200558,
-0.0435903259,
0.1302112192,
-0.0576465577,
0.0576003715,
0.012180116,
0.1697938889,
-0.3426533937,
-0.0727013573,
0.1154425815,
-0.0238890946,
0.3663885593,
-0.2478743792,
0.0542967059,
-0.2058061808,
0.3545787334,
-0.2399350107,
-0.3611768782,
-0.0457574837,
0.0719051436,
-0.34077999,
0.0206717998,
-0.5490443707,
0.3761830926,
0.4263474941,
0.0905838758,
0.0118538849,
-0.1186690405,
-0.2479609698,
-0.0161011443,
0.1722045988,
0.1334882826,
-0.5778154135,
0.036607787,
-0.0681397021,
0.1124099568,
0.3034363091,
0.7545217872,
-0.1512487531,
0.3304148018,
-0.0916666314,
0.4423211515,
0.1452019811,
0.1598956585,
-0.5134210587,
0.4223713875,
0.0371212959,
-0.1640301645,
-0.0128785698,
0.107542485,
0.3807857335,
-0.1396205872,
0.1872460693,
0.3340222538,
-0.0645643845,
0.0848616585,
-0.2775013149,
-0.343834579,
0.1302628964,
0.288087219,
0.1969876438,
-0.2810751796,
-0.009794225,
0.3730165362,
0.1329234838,
-0.1553367078,
0.3648220003,
0.1345097423,
0.1909364313,
0.1730597764,
-0.0348840989,
-0.2371496558,
0.1483792812,
0.0740293339,
0.1063022166,
-0.1766884774,
-0.0091571612,
-0.3077904582,
0.1440497786,
-0.0243836679,
0.03118743,
0.110327594,
-0.1044522002,
-0.2197159976,
-0.085450545,
0.1351990402,
-0.1043639705,
-0.1191576868,
-0.3198541999,
0.1355398297,
-0.0892160535,
-0.0005721452,
0.0629658401,
-0.1361073703,
0.0411916375,
0.2246116996,
-0.147646904,
-0.1313589662,
0.0219079275,
0.1872602254,
0.0183315556,
-0.2357048988,
-0.2702258825,
0.5758535266,
0.2275516391,
0.0480049476,
0.2099346817,
-0.0309426207,
0.0352991819,
-0.0920437947,
0.0470423885,
0.2821455002,
0.1014198735,
0.1170902476,
0.0349611603,
-0.2804763913,
0.103620097,
-0.0223460924,
0.1937519908,
0.0064906389,
0.2591930628,
0.0792197362,
0.3156828284,
0.3179974556,
-0.1806907356,
-0.174574852,
0.3581421375,
-0.3210417628,
0.215085417,
0.4250733852,
-0.4366926551,
-0.338296175,
0.0725770742,
-0.2350002825,
0.1056230292,
0.1427423209,
0.0731132999,
-0.0428088233,
0.3631474674,
-0.0525317453,
0.1752878875,
0.131713897,
0.1352781057,
0.209144339,
0.1257627457,
0.1298956573,
-0.1594122052,
-0.0640986785,
0.1919551194,
0.3366984129,
-0.109040603,
0.0508371741,
-0.2087421864,
-0.3060902655,
0.0004508336,
0.2116794735,
-0.1640039831,
0.0426930562,
0.1251251549,
0.0437285528,
0.1306493878,
0.0544445887,
0.1263917536,
0.3693228066,
0.0503857732,
-0.3098164201,
0.1500759721,
-0.0545790493,
-0.4672503173,
-0.0370833278,
0.3112078011,
-0.3574157059,
0.2815756202,
0.2022110671,
0.0586504601,
-0.318808347,
-0.4476560652,
0.0214610808,
0.1317866743,
0.2077721804,
-0.1410449892,
0.0467338748,
-0.1914001107,
0.1635478586,
-0.1014140472,
-0.1061109751,
-0.0787280872,
0.0649727061,
-0.1645176709,
-0.1977962106,
0.1205721647,
-0.0024960795,
-0.2704382241,
-0.1932477355,
0.2242641747,
-0.1564695984,
0.0722557902,
0.0276173186,
0.0643830746,
-0.025846377,
-0.0570878088,
-0.1401275545,
0.0512429513,
-0.3130623102,
0.4259620607,
0.2022452354,
-0.1976530403,
-0.0776711181,
0.1161192879,
-0.0912990421,
0.3588640094,
-0.526943326,
0.311467886,
-0.1990623921,
0.1910690367,
-0.0856880099,
0.0177110266,
0.0093991309,
-0.1782577187,
0.104414165,
0.1252229214,
-0.2186257988,
-0.2550843954,
-0.1566655189,
0.3327916265,
-0.0344829559,
0.3154124916,
0.4613993168,
0.5344967246,
-0.0702421218,
-0.1545268148,
0.3131116927,
0.1734436452,
0.2241770178,
-0.3325263262,
-0.0860122964,
0.266209662,
-0.0626250356,
-0.1146857738,
0.4754681885,
0.1411810964,
-0.1146159321,
0.2510148585,
-0.3503865302,
-0.0248320885,
-0.0610996597,
0.1744009256,
-0.3004294932,
0.2343145609,
-0.0234202966,
-0.1732248366,
-0.0275204889,
-0.3812796772,
-0.0580094792,
0.176690653,
-0.0298213083,
0.2385102063,
-0.479123354,
0.2534343302,
-0.3464237452,
0.1705216616,
-0.1004621759,
0.361798346,
0.1357783675,
0.1863540858,
0.2199886292,
0.0214752648,
0.5436987281,
0.1241027489,
-0.1632372141,
-0.1701988578,
-0.1254707128,
-0.2008713484,
0.0512493849,
-0.106446743,
0.291657865,
0.4566515088,
0.4787528813,
-0.3634490967,
-0.1394795477,
-0.298951894,
0.5648917556,
-0.0116855605,
-0.2951664925,
-0.0116858184,
-0.143779844,
-0.5237722993,
0.1901263446,
0.1533014029,
0.3718515337,
0.1237611026,
-0.0931891054,
-0.1831273139,
-0.0919847935,
0.32825315,
-0.0300570745,
0.0913554877,
-0.1428197473,
0.2336043864,
-0.2097426951,
0.1448849738,
0.505381763,
-0.0385294482,
0.1447774172,
-0.2899255157,
0.0055155852,
0.0698987991,
0.3870850205,
-0.0314584337,
-0.1435098946,
0.3864059746,
-0.2510173619,
0.2598463893,
-0.1936825216,
0.5484662652,
0.1282876432,
0.0551665984,
-0.8614723682,
-0.3365223706,
0.2391015291,
0.2278056294,
-0.0184535999,
0.2278821468,
-0.1837543249,
-0.2924679518,
0.2764530778,
0.1032717377,
0.8179159164,
-0.4555812478,
0.3244092464,
-0.4055631459,
0.3411644995,
0.5398201346,
-0.5751264095,
-0.0365347564,
-0.3981422186,
0.1355866045,
0.1298666,
0.0066973576,
0.0402744003,
0.4150403142,
0.0717969462,
0.2767038047,
0.115662843,
0.1328900754,
0.0083337603,
0.6496938467,
-0.077886194,
-0.3102952242,
-0.1348369569,
0.0370050594,
-0.1922158599,
-0.0505620092,
-0.2243538797,
0.1070404574,
0.1151739061,
0.0607995912,
-0.3009158373,
-0.1705035269,
-0.1133764088,
0.1218416095,
-0.031833481,
-0.1087734178,
0.5061593056,
-0.0841539353,
0.2461420298,
0.5565771461,
-0.1738188565,
0.1275269389,
-0.3588402271,
-0.1274368167,
0.1747507751,
-0.2499729842,
0.026444383,
-0.0169456005,
0.0973864645,
-0.2636164725,
0.1535226256,
-0.0709163323,
-0.1601660997,
-0.086598359,
0.536949873,
-0.2056361735,
-0.1871607453,
-0.2134482563,
0.0121410126,
-0.0626672804,
0.0102581419,
0.1915260255,
-0.0572933331,
0.2991553545,
-0.0133972634,
-0.2419013679,
-0.1446449906,
0.1430331022,
0.0640013814,
-0.0426903889,
0.4207987785,
0.1829646528,
-0.1477909088,
-0.1278964579,
0.3998603821,
0.2036780268,
-0.1033187062,
0.1846521944,
0.2032353133,
0.0290574972,
-0.0601438321,
0.0495668128,
0.1374866664,
-0.4985467494,
-0.052676525,
-0.2140191197,
-0.3960345685,
0.0668351576,
-0.0665156394,
0.1478192657,
0.1198976934,
0.1561048925,
-0.1483900398,
0.0702318326,
-0.1334624738,
0.3090940714,
0.0708298981,
0.2612694204,
-0.2005295753,
0.082450524,
-0.2894153297,
-0.059585236,
-0.1407783926,
0.1734315604,
0.0907125473,
-0.1506279856,
-0.1572407186,
0.2040565312,
0.3015047908,
-0.28974998,
0.19620426,
-0.2798905969,
-0.1721051931,
-0.3013718724,
0.2562595904,
0.2545863688,
0.0247844346,
-0.2037383169,
0.2178127617,
-0.1880244315,
-0.3108054996,
0.11956276,
-0.063184686,
0.1413165927,
0.1413945109,
0.3235110343,
0.5331250429,
-0.1139004305,
-0.2503629625,
0.2166425437,
0.5411877036,
-0.162524119,
0.0464539826,
-0.1985040307,
0.05624827,
0.3416443765,
0.1208994985,
0.4793937206,
-0.1609939784,
-0.4485670924,
0.5291867852,
0.1018118486,
-0.0579218455,
-0.1864109635,
-0.0204842351,
-0.1886228919,
-0.216328755,
0.1032049134,
0.2899166346,
0.2510037124,
-0.4375893176,
-0.1248648241,
0.4320608675,
0.2399139702,
-0.0240663718,
0.4210994542,
0.2311270833,
-0.0921543017,
0.3365710974,
0.3232382238,
0.2409476042,
0.5528316498,
-0.0477682427,
0.526771903,
0.1754156798,
0.1959539205,
-0.1960279495,
-0.5036004782,
-0.2226984799,
0.4708331227,
0.2283301204,
-0.1109242886,
-0.3145104945,
0.2295250446,
0.2637504339,
-0.1477517337,
-0.0191177633,
0.1155164316,
-0.2704106569,
-0.1847076118,
-0.1443496048,
-0.1364814639,
0.0266381782,
0.2635381222,
-0.2816626132,
-0.3591855168,
-0.1041406468,
-0.0335506164,
-0.0890955254,
-0.4542912245,
0.3771340251,
0.1530847847,
-0.0305492021,
-0.237596184,
0.3415531814,
-0.2511642873,
0.068558149,
0.0139336558,
0.1642071754,
0.3705230951,
0.3742658794,
-0.0429956168,
-0.0434733815,
-0.2629962862,
0.1246313378,
-0.1643608212,
0.4631356001,
0.1134567335,
0.2455963641,
0.2111254483,
-0.0780475065,
-0.015469023,
0.0147951031,
0.1294233948,
-0.4031862617,
-0.1628546864,
-0.0139065469,
0.1217600778,
-0.2851451337,
-0.1575858444,
0.1719264686,
-0.2431898266,
0.0065637943,
0.9193086624,
-0.3252096176,
0.0808189884,
-0.1628734916,
0.0249120016,
-0.2839208543,
0.4645771682,
0.4519178867,
0.0823255181,
-0.445536375,
-0.0914770588,
-0.4034664333,
0.2238798887,
-0.4040197134,
0.2532669902,
-0.0449523404,
0.1031087488,
-0.0548036769,
0.0809807628,
-0.3658024967,
0.4317957461,
-0.3566427827,
0.0201067328,
-0.0732475817,
0.0947924256,
-0.134071067,
0.1532257944,
-0.1174075156,
-0.4135876596,
0.335391134,
-0.2376119345,
-0.1686394066,
-0.1295076013,
0.2847557366,
0.1521080583,
-0.1714215577,
0.448664695,
0.1417049468,
0.2121008337,
0.143633008,
0.2874580622,
-0.0233935975,
0.1706353873,
-0.3489334285,
0.1779579371,
0.0055746818,
-0.0166501012,
-0.1431227177,
0.2426626086,
-0.0186137296,
0.0469749905,
-0.0603480525,
-0.0916924626,
-0.1263712198,
-0.078971073,
-0.1517828405,
0.1540198177,
0.0576653332,
0.34082672,
-0.0482659154,
-0.0625471175,
-0.3105647266,
-0.2342230082,
0.2298221886,
-0.4213122129,
-0.2648096085,
-0.1801564544,
0.0154332025,
0.6642018557,
-0.2201963067,
-0.525272429,
0.1011430472,
0.5639673471,
0.0911809728,
-0.3091644049,
0.2561301291,
-0.1819327772,
0.0629255623,
-0.1353605092,
0.4806588888,
-0.1493546218,
-0.2951602936,
0.0539432652,
-0.1682290733
] |
https://github.com/huggingface/datasets/issues/1825 | Datasets library not suitable for huge text datasets. | Hi @alexvaca0 , we have optimized Datasets' disk usage in the latest release v1.5.
Feel free to update your Datasets version
```shell
pip install -U datasets
```
and see if it better suits your needs. | Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions?? | 35 | Datasets library not suitable for huge text datasets.
Hi,
I'm trying to use datasets library to load a 187GB dataset of pure text, with the intention of building a Language Model. The problem is that from the 187GB it goes to some TB when processed by Datasets. First of all, I think the pre-tokenizing step (with tokenizer.map()) is not really thought for datasets this big, but for fine-tuning datasets, as this process alone takes so much time, usually in expensive machines (due to the need of tpus - gpus) which is not being used for training. It would possibly be more efficient in such cases to tokenize each batch at training time (receive batch - tokenize batch - train with batch), so that the whole time the machine is up it's being used for training.
Moreover, the pyarrow objects created from a 187 GB datasets are huge, I mean, we always receive OOM, or No Space left on device errors when only 10-12% of the dataset has been processed, and only that part occupies 2.1TB in disk, which is so many times the disk usage of the pure text (and this doesn't make sense, as tokenized texts should be lighter than pure texts).
Any suggestions??
Hi @alexvaca0 , we have optimized Datasets' disk usage in the latest release v1.5.
Feel free to update your Datasets version
```shell
pip install -U datasets
```
and see if it better suits your needs. | [
-0.4028153419,
0.0771395713,
0.0086004063,
0.3193157017,
0.3035771251,
0.0233493038,
0.0301560517,
0.3559311628,
-0.2499684542,
-0.0241902955,
0.0388909876,
0.1070221886,
-0.2629811466,
0.1188514903,
0.0347162038,
0.1091511548,
0.2107037008,
0.1721990108,
0.1067035198,
0.1461049467,
0.003363926,
-0.0768992007,
-0.2359557897,
-0.0442242213,
-0.4917670488,
-0.246796459,
-0.0052546794,
-0.2256905884,
-0.4161318243,
-0.3108103275,
-0.1463018209,
0.2057923526,
0.4900791049,
0.4980648458,
-0.0001231333,
-0.2699462771,
0.2363725007,
0.0186441857,
-0.3187194765,
0.0508895926,
0.4693197906,
-0.357768029,
-0.2028604448,
-0.2081340253,
0.1659419686,
-0.2171030641,
-0.0014260364,
-0.1183155403,
0.1075647473,
0.0541206524,
0.0970020592,
0.1303242743,
0.0105504794,
0.1590500623,
0.1015548185,
0.0934821069,
-0.0940496698,
0.0596257895,
0.4631816447,
0.0898428783,
-0.1676842272,
0.2201167643,
-0.1535093337,
0.0275999904,
0.3630453944,
-0.0872995406,
-0.0916156992,
-0.1663147062,
0.2746694684,
0.2592948377,
0.5688686967,
-0.4413162768,
-0.2612149417,
-0.54551965,
-0.2219268531,
-0.2722454965,
0.0044183242,
0.1677700579,
-0.0375922918,
0.1915649623,
-0.4412502646,
-0.4712104797,
-0.0885309651,
0.3492919505,
-0.2183879167,
0.079929091,
-0.1663343906,
0.1026662365,
0.2382715195,
-0.2418372035,
0.1028120071,
-0.3338504434,
0.0022662724,
0.1644577682,
-0.3736109734,
-0.1478250921,
-0.2142488658,
-0.057693664,
0.4252463579,
0.0029206865,
-0.4150719345,
0.1444518417,
-0.1237988546,
0.0363092124,
0.3516073823,
0.2578933239,
-0.0990970582,
0.2503684759,
0.1979776472,
-0.1737041026,
-0.0160008725,
-0.1105488688,
-0.5208444595,
-0.0662999079,
0.1376721412,
-0.5249604583,
-0.2645240128,
-0.1763339639,
-0.0862717554,
0.0780044571,
-0.098049745,
0.245983243,
0.1834301949,
0.1818473041,
-0.0734424815,
0.1200842112,
-0.18787615,
0.1694706678,
-0.122616753,
-0.167670548,
0.0043568374,
-0.10667032,
-0.2287059724,
0.1115946248,
0.1700579226,
-0.0129800988,
0.1193296909,
-0.060493663,
0.0389971808,
0.0096374247,
0.1425359994,
-0.3770751059,
-0.0747799054,
0.1250584871,
-0.0162473284,
0.3819414079,
-0.2452011853,
0.0438578613,
-0.2310596406,
0.3684507906,
-0.2714809477,
-0.3721606731,
-0.1170410514,
0.0728530288,
-0.3259705305,
-0.0053126342,
-0.6098570824,
0.359302789,
0.4154553115,
0.0878378227,
-0.0540281199,
-0.1027543694,
-0.2495370805,
-0.0512956455,
0.1633384377,
0.1536835581,
-0.5558544397,
0.0424052216,
-0.1050057188,
0.1381259114,
0.3448685706,
0.781845212,
-0.154068917,
0.3443176448,
-0.083731249,
0.3829894364,
0.1397251487,
0.0865029693,
-0.5390252471,
0.4260478616,
0.0805560201,
-0.1469301432,
0.0165786985,
0.1089469492,
0.3508240283,
-0.1401628554,
0.1549426764,
0.3197365999,
-0.0168228298,
0.0955381319,
-0.3492799699,
-0.3166877627,
0.1213875711,
0.3060806692,
0.1666432172,
-0.3364424407,
-0.0267377645,
0.3738550246,
0.1500833929,
-0.125728786,
0.3451298773,
0.1695323139,
0.2498044521,
0.179723233,
-0.0031751159,
-0.2126870751,
0.128649354,
0.0907980874,
0.1697636098,
-0.1913998425,
-0.0275453329,
-0.2772669792,
0.1492591053,
-0.0167026222,
0.0196448024,
0.1086305901,
-0.0833172426,
-0.2104956508,
-0.0578192696,
0.1369720995,
-0.0665686801,
-0.1515645534,
-0.3148000538,
0.140007183,
-0.0645669177,
0.0235899184,
0.0524301715,
-0.1167233586,
0.0183348376,
0.2091656625,
-0.1672682017,
-0.1363949031,
0.0121230623,
0.1948985159,
0.0151766613,
-0.2138115615,
-0.1999001056,
0.554561317,
0.2331964821,
0.0591158457,
0.2807886004,
-0.0021755209,
0.0538060516,
-0.0984088778,
0.0032169607,
0.2129259706,
0.0822624341,
0.1509800851,
-0.0122648133,
-0.2621986866,
0.1246826947,
0.0181971416,
0.2300265133,
0.017934775,
0.2678824365,
0.0690592378,
0.3252795935,
0.3191106617,
-0.1439491659,
-0.1528829932,
0.3700923026,
-0.3132963181,
0.2127896547,
0.4723604918,
-0.4098828137,
-0.3531782329,
0.0724830553,
-0.171594277,
0.1418943256,
0.1543643624,
0.0579907559,
-0.0924885944,
0.3867771924,
-0.0452661067,
0.2055204958,
0.1396348178,
0.1116910055,
0.1776805967,
0.1302110106,
0.1157867089,
-0.1611311436,
-0.0654387623,
0.1719738394,
0.3680223525,
-0.1127545536,
0.0396665819,
-0.2015715241,
-0.2762778699,
0.0119578289,
0.2238870859,
-0.1521975994,
0.0127021968,
0.0925224051,
0.0416020602,
0.1437937766,
0.0740732625,
0.2089531422,
0.3292385042,
0.0085598808,
-0.3077066839,
0.1153599918,
-0.0328586549,
-0.4963887036,
-0.0283089299,
0.3630423844,
-0.3414939344,
0.294813484,
0.1539150327,
0.0766330361,
-0.3204392791,
-0.4033300579,
-0.0133969979,
0.1026636139,
0.2224614918,
-0.1516815722,
0.0797145739,
-0.2505562603,
0.1806444675,
-0.0657985732,
-0.1377868056,
-0.057444822,
0.0679608509,
-0.1512974501,
-0.2519560754,
0.0981158763,
-0.0180101041,
-0.3014730811,
-0.1782747209,
0.2398395538,
-0.1504434049,
0.113177672,
0.0142039899,
0.0704071745,
-0.016082475,
-0.0572491176,
-0.1329592764,
0.0318352729,
-0.3583617508,
0.4102056921,
0.2523448169,
-0.1754555702,
-0.0017284752,
0.1510430127,
-0.0866942853,
0.2985330224,
-0.5361641049,
0.2482324243,
-0.2271320373,
0.1707011759,
-0.0989370123,
0.0939539671,
0.0085233729,
-0.1408995688,
0.1126373783,
0.135752216,
-0.2377644032,
-0.2494042069,
-0.1299274713,
0.3253561258,
-0.0392631888,
0.3188126087,
0.5074322224,
0.4777013659,
-0.0744749978,
-0.1131633073,
0.309705019,
0.1841124594,
0.2432105839,
-0.3235910535,
-0.1137645543,
0.2541651428,
-0.0705374256,
-0.1344350874,
0.4563224316,
0.1818728,
-0.1035491675,
0.2594856024,
-0.3549364209,
-0.0414933041,
-0.0583157241,
0.2022919506,
-0.2457619607,
0.2087106109,
-0.0166273434,
-0.1609215885,
-0.0318124928,
-0.3627415299,
-0.0547644421,
0.167793408,
-0.0110035995,
0.2217928618,
-0.4764860272,
0.2394004911,
-0.399272114,
0.1984273493,
-0.1730272025,
0.3066079021,
0.1419066191,
0.2114695907,
0.2595523298,
0.0174004734,
0.5492849946,
0.1528873444,
-0.1475337148,
-0.169897601,
-0.1421876848,
-0.2579241693,
0.0550857559,
-0.1505864114,
0.2799943686,
0.435759902,
0.503867209,
-0.3647418022,
-0.201285854,
-0.3397355676,
0.5800448656,
-0.0480564125,
-0.2907162905,
-0.0267972257,
-0.2180372328,
-0.5310127735,
0.1750019044,
0.1872734427,
0.3673220873,
0.174111411,
-0.0582790934,
-0.1614658684,
-0.0703889355,
0.3420439959,
-0.0464396365,
0.1844156981,
-0.1968511045,
0.2335072309,
-0.2128456533,
0.118910253,
0.5117978454,
-0.0424065366,
0.0731492564,
-0.2060352862,
-0.0037426201,
0.0500435717,
0.3726010919,
-0.0330479145,
-0.1493563652,
0.3144881725,
-0.2959535718,
0.2798679173,
-0.2172097564,
0.4888461828,
0.1572148949,
0.0978676379,
-0.7616376877,
-0.3631926775,
0.2361015528,
0.2465046048,
-0.0222334135,
0.1951892227,
-0.1537142545,
-0.2862217724,
0.3004185259,
0.1105558202,
0.8260045648,
-0.468646735,
0.2963405252,
-0.363117069,
0.3105923235,
0.5010316968,
-0.6091920137,
-0.0321785063,
-0.3963600695,
0.1395545602,
0.154620558,
0.0086517427,
0.0458435901,
0.4068329632,
0.0398775078,
0.307838589,
0.1045459658,
0.0989683568,
-0.013291317,
0.6598165035,
-0.1008164808,
-0.317669034,
-0.1528227031,
0.0603334829,
-0.2292145789,
-0.0482931063,
-0.1904264688,
0.0984812453,
0.1104764938,
0.0445941314,
-0.3024245203,
-0.2183116078,
-0.1078226417,
0.1403214782,
-0.0309801046,
-0.0960667133,
0.4986236393,
-0.0021382046,
0.2062823623,
0.5608211756,
-0.16030249,
0.1573557258,
-0.3864063323,
-0.0873466507,
0.1849467009,
-0.1999982446,
-0.0410524644,
-0.0567885637,
0.0958381221,
-0.3077461421,
0.1138440818,
-0.0688258484,
-0.1552896947,
-0.0821396038,
0.4945066273,
-0.176137045,
-0.2396704555,
-0.2425159961,
-0.0239896514,
-0.0590675622,
0.0263952203,
0.2346216589,
-0.0767952278,
0.3747396171,
-0.0302202441,
-0.2205344886,
-0.1249228865,
0.1324592084,
0.0872408077,
-0.0343003273,
0.4078711271,
0.1404269189,
-0.1649447381,
-0.1530835927,
0.4082036018,
0.1247077137,
-0.1289006025,
0.2105676532,
0.2344243079,
0.0088985702,
-0.0501607507,
0.0030256344,
0.1752152145,
-0.5009047985,
-0.0918842554,
-0.1805163622,
-0.3987696767,
0.0736568496,
-0.0459938832,
0.1356541812,
0.1200381741,
0.061238043,
-0.1396029741,
0.0608019903,
-0.1573095173,
0.3485962152,
0.0797349885,
0.2396011502,
-0.2243045419,
0.0398440473,
-0.2172418833,
-0.0972268432,
-0.1267705411,
0.1385208815,
0.093940258,
-0.1650672853,
-0.1413878649,
0.1879233271,
0.2528236508,
-0.267334193,
0.1879464686,
-0.2861520052,
-0.1580538005,
-0.3490871489,
0.2193031311,
0.2547698915,
0.02225364,
-0.1858414859,
0.2162825912,
-0.2088620216,
-0.2859120965,
0.1125048101,
-0.0678047016,
0.1309940517,
0.148081705,
0.3166669309,
0.5489240289,
-0.1366275251,
-0.2980538011,
0.1985018253,
0.5358869433,
-0.1197688878,
0.0347275622,
-0.2065895796,
0.0574979894,
0.3748191297,
0.1081884578,
0.4812158048,
-0.1683336347,
-0.4468154013,
0.4947702289,
0.1289745122,
-0.0571265779,
-0.2476886809,
0.0029822646,
-0.1806351095,
-0.2533294559,
0.080994159,
0.3137273192,
0.2014208436,
-0.4066839516,
-0.1012642086,
0.5237573981,
0.1653323621,
0.0029214567,
0.4272447228,
0.2243706733,
-0.1126740053,
0.3166331351,
0.2939410806,
0.2337685972,
0.590465188,
-0.0754010677,
0.5070323348,
0.2195578665,
0.1999549717,
-0.2541432679,
-0.4688103497,
-0.2125879824,
0.4607968926,
0.2010647207,
-0.1069237888,
-0.3281903267,
0.2388103604,
0.2232538462,
-0.1692102551,
-0.0501069836,
0.0795331076,
-0.297247082,
-0.1967017353,
-0.0497736149,
-0.0938538611,
0.031549152,
0.2399545312,
-0.2930007279,
-0.3910031617,
-0.1438050866,
-0.0094448579,
-0.1031277701,
-0.3992471099,
0.3458119333,
0.1379221231,
-0.0330605395,
-0.2205663174,
0.3262318969,
-0.2420053482,
0.0778661594,
-0.0303839631,
0.1417757124,
0.3925179243,
0.3610640168,
-0.0422690734,
-0.0485454686,
-0.271145016,
0.1492198259,
-0.1828677207,
0.4642488658,
0.061044421,
0.275778532,
0.1816594899,
-0.0559629351,
-0.0337355137,
-0.0268848743,
0.1235692576,
-0.3364809453,
-0.1484850794,
-0.0217155665,
0.0802413747,
-0.2911400795,
-0.1484191269,
0.1495286822,
-0.2476089597,
-0.0356490463,
0.8947806358,
-0.2939737141,
0.0742620379,
-0.150441587,
0.0362366773,
-0.2652700245,
0.4319396019,
0.418151021,
0.0045709051,
-0.4741911292,
-0.0920988992,
-0.4654784799,
0.1554792225,
-0.3860726357,
0.2582814991,
-0.0038844016,
0.1088588983,
-0.0433051363,
0.0417877622,
-0.3536684811,
0.4079423845,
-0.3383269012,
-0.0126241455,
-0.1160094887,
0.1326438934,
-0.130485788,
0.1457920372,
-0.0697082281,
-0.4247713685,
0.302736938,
-0.220645532,
-0.161644578,
-0.1389223486,
0.3290129006,
0.135947451,
-0.0847078338,
0.4330038428,
0.146490708,
0.1933503002,
0.1440930068,
0.2300016135,
-0.0101874694,
0.1664083302,
-0.3035311103,
0.1640971005,
0.0135093285,
0.0317509733,
-0.1838487387,
0.2569761872,
-0.0370002873,
0.0674786866,
-0.0618180521,
-0.0744782239,
-0.1171975434,
-0.0723752007,
-0.1005485132,
0.1552350819,
0.0650889203,
0.3275765181,
-0.0324823335,
-0.0594365299,
-0.3826101124,
-0.2208422124,
0.2281024158,
-0.36163041,
-0.2914258838,
-0.1502734572,
0.0420756526,
0.6636846066,
-0.1947218776,
-0.5574442148,
0.0941897258,
0.5367165208,
0.0990344509,
-0.3179400265,
0.2728792727,
-0.1779841632,
0.0576392189,
-0.0885170028,
0.5082886815,
-0.158369422,
-0.3004291356,
0.0639643893,
-0.154406473
] |
https://github.com/huggingface/datasets/issues/1821 | Provide better exception message when one of many files results in an exception | Hi!
Thank you for reporting this issue. I agree that the information about the exception should be more clear and explicit.
I could take on this issue.
On the meantime, as you can see from the exception stack trace, HF Datasets uses pandas to read the CSV files. You can pass arguments to `pandas.read_csv` by passing additional keyword arguments to `load_dataset`. For example, you may find useful this argument:
- `error_bad_lines` : bool, default True
Lines with too many fields (e.g. a csv line with too many commas) will by default cause an exception to be raised, and no DataFrame will be returned. If False, then these βbad linesβ will be dropped from the DataFrame that is returned.
You could try:
```python
datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files), error_bad_lines=False)
```
| I find when I process many files, i.e.
```
train_files = glob.glob('rain*.csv')
validation_files = glob.glob(validation*.csv')
datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files))
```
I sometimes encounter an error due to one of the files being misformed (i.e. no data, or a comma in a field that isn't quoted, etc).
For example, this is the tail of an exception which I suspect is due to a stray comma.
> File "pandas/_libs/parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read
> File "pandas/_libs/parsers.pyx", line 783, in pandas._libs.parsers.TextReader._read_low_memory
> File "pandas/_libs/parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows
> File "pandas/_libs/parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows
> File "pandas/_libs/parsers.pyx", line 1951, in pandas._libs.parsers.raise_parser_error
> pandas.errors.ParserError: Error tokenizing data. C error: Expected 2 fields in line 559, saw 3
It would be nice if the exception trace contained the name of the file being processed (I have 250 separate files!) | 129 | Provide better exception message when one of many files results in an exception
I find when I process many files, i.e.
```
train_files = glob.glob('rain*.csv')
validation_files = glob.glob(validation*.csv')
datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files))
```
I sometimes encounter an error due to one of the files being misformed (i.e. no data, or a comma in a field that isn't quoted, etc).
For example, this is the tail of an exception which I suspect is due to a stray comma.
> File "pandas/_libs/parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read
> File "pandas/_libs/parsers.pyx", line 783, in pandas._libs.parsers.TextReader._read_low_memory
> File "pandas/_libs/parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows
> File "pandas/_libs/parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows
> File "pandas/_libs/parsers.pyx", line 1951, in pandas._libs.parsers.raise_parser_error
> pandas.errors.ParserError: Error tokenizing data. C error: Expected 2 fields in line 559, saw 3
It would be nice if the exception trace contained the name of the file being processed (I have 250 separate files!)
Hi!
Thank you for reporting this issue. I agree that the information about the exception should be more clear and explicit.
I could take on this issue.
On the meantime, as you can see from the exception stack trace, HF Datasets uses pandas to read the CSV files. You can pass arguments to `pandas.read_csv` by passing additional keyword arguments to `load_dataset`. For example, you may find useful this argument:
- `error_bad_lines` : bool, default True
Lines with too many fields (e.g. a csv line with too many commas) will by default cause an exception to be raised, and no DataFrame will be returned. If False, then these βbad linesβ will be dropped from the DataFrame that is returned.
You could try:
```python
datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files), error_bad_lines=False)
```
| [
-0.1087330952,
-0.4190312028,
0.0075153699,
0.2815203071,
0.1845358312,
0.1635629386,
0.140922457,
0.3934291601,
0.2262881696,
0.2882855833,
0.2727561295,
-0.2174749225,
-0.0589209236,
-0.2714681923,
-0.2407846749,
-0.1619682014,
0.0860742554,
0.1235783771,
0.2567389011,
-0.0407726839,
-0.0435575284,
0.1729318649,
0.1145246103,
0.2511812449,
-0.4897429645,
-0.2769160569,
-0.3172522187,
0.3817558289,
0.2166704386,
-0.5677111745,
0.0001506092,
0.0310574509,
0.1003035903,
0.5251939893,
-0.0001157862,
-0.1504171342,
0.1501868814,
0.0271879584,
-0.3778845966,
-0.1116748601,
-0.1856663525,
-0.6877271533,
-0.0241561551,
-0.281329602,
0.3580899537,
-0.0366706997,
0.2445523292,
-0.1590945423,
0.3761557937,
0.3548000753,
0.0947954282,
-0.1653119177,
0.2582827508,
-0.0023044429,
0.342438519,
0.1431550682,
0.0669532716,
0.2645774484,
0.3179497421,
-0.42845276,
-0.2257969528,
0.0672469363,
-0.2100597024,
0.0604889952,
0.0722260103,
0.0547767878,
0.3765807152,
-0.1714560091,
-0.2216405272,
0.4012446404,
0.2046243995,
-0.1446515024,
-0.5563562512,
-0.6639552116,
0.1868023276,
-0.299066633,
-0.0956108719,
0.3052098751,
-0.2246570289,
0.1164678261,
0.3411988318,
-0.1564714164,
-0.3696017563,
-0.0656501353,
-0.0943443924,
-0.1774513423,
0.1163332686,
-0.0665725023,
0.0795391202,
-0.0301017817,
-0.2295915484,
-0.0244010407,
-0.140524134,
-0.0659565777,
-0.5154397488,
-0.0611240752,
0.1398731768,
-0.5946625471,
0.2344195098,
-0.3872505724,
0.3423086107,
0.1268078089,
-0.0876092836,
0.3240605891,
0.3673040867,
-0.1802645922,
0.0446510799,
-0.0735894963,
0.4588176608,
0.0975563601,
-0.1286379248,
-0.178625688,
0.058048144,
-0.2865338027,
0.0131829055,
0.4915903807,
0.0972697362,
-0.2422266603,
-0.5625765324,
0.1740456671,
-0.2998232245,
-0.129500106,
-0.1019075736,
0.3863113225,
-0.1491401941,
0.2941471636,
-0.0718409643,
0.0743072331,
0.1058582291,
-0.3490169048,
0.0190028641,
0.0955065042,
-0.1309892088,
0.1971979588,
-0.1066792682,
0.0426531956,
-0.1053276062,
0.212528348,
0.1612884104,
-0.1958127469,
-0.0266664233,
-0.4223651886,
-0.0123044318,
0.1347551793,
0.0360872597,
0.2787171006,
0.1180073321,
-0.1997920871,
-0.0155297285,
0.0390921682,
-0.5052164793,
-0.4055263996,
-0.1516359746,
-0.0190638211,
0.2258602232,
0.2026077658,
-0.1184597909,
0.2543494701,
-0.0653014779,
-0.1149036214,
-0.0961177498,
-0.1168492213,
0.2591307461,
-0.3146847486,
0.0744724125,
0.5779364705,
-0.3668698668,
0.2835255265,
-0.1532493234,
0.0071678464,
0.3014099002,
0.5016702414,
-0.2213501036,
0.3920571208,
-0.3043756783,
0.2214912027,
0.021441726,
-0.2410393506,
0.0696125403,
0.5922527909,
-0.0995077491,
0.3384658396,
0.449650377,
-0.0548263788,
0.0299319252,
-0.1319981366,
0.2314147949,
0.1058333144,
-0.2101560384,
0.1193098873,
-0.1383867264,
-0.016488025,
0.0586400218,
-0.0880045071,
-0.0457932204,
-0.169871822,
0.3214454651,
-0.1717793941,
0.6836056113,
-0.2008428574,
-0.1986035258,
0.3270803392,
0.3706168234,
0.1801685393,
-0.3365704119,
0.1081394777,
-0.1433930993,
-0.0562942177,
-0.0956452489,
-0.0406307392,
-0.3002384007,
-0.3844312727,
0.0482086241,
-0.1880552769,
0.1139162779,
0.0421369821,
0.0909382552,
0.1164956838,
-0.2879984677,
-0.1191724092,
0.1267441809,
0.4215732515,
-0.3311342895,
0.2209106982,
0.2074857354,
0.0408955365,
-0.1284811795,
-0.0950808153,
0.1966290176,
0.0105176866,
0.3892311454,
-0.2385661155,
-0.0453906395,
0.4332703352,
0.0857673064,
-0.0695132539,
-0.0058440417,
0.0081369588,
0.1619239897,
0.1554265618,
-0.2069428563,
-0.108288914,
-0.207297653,
0.0152075067,
-0.1600507051,
0.1527826339,
0.1803388745,
0.1812220067,
0.135561049,
0.0601342544,
0.1999211311,
0.0841965526,
0.2385478318,
-0.018100189,
0.0409562364,
-0.188100189,
-0.1225961149,
-0.0814209282,
-0.5105938315,
-0.0667409524,
0.3919045329,
-0.0359767899,
0.1042288691,
0.3644505143,
0.2609384656,
0.0450895205,
0.4243877232,
0.2009595931,
0.3029170036,
0.2737500668,
-0.1668340862,
-0.1221467927,
-0.2403468639,
-0.0530330986,
0.155833289,
0.2600558102,
-0.0753523186,
0.2811390162,
-0.0913242698,
0.1730601043,
-0.0010685154,
-0.5670700669,
-0.0049579879,
0.1933507919,
-0.4135928154,
0.1167608425,
-0.3286727667,
-0.4525236487,
-0.3685522377,
0.0141994338,
-0.1077618077,
-0.288392216,
-0.0081440741,
0.107721746,
-0.1718175709,
-0.0819019377,
0.0299160406,
0.168855831,
0.0349317305,
0.2562252879,
-0.0761336163,
0.1002631262,
-0.1177722216,
-0.1330837905,
0.3697406352,
-0.1396034956,
0.0051864469,
-0.0098293321,
-0.2386259437,
-0.3681987822,
0.0867848992,
0.0194473155,
-0.0267845113,
-0.1194075495,
0.2449993789,
0.3923151195,
-0.1222420409,
-0.5848966837,
0.1295443624,
0.0119563062,
0.0188376047,
0.0164075159,
0.1567736268,
0.0439009033,
-0.0345853716,
-0.1233542413,
-0.1896685511,
-0.4294612706,
0.1302316636,
-0.4879534245,
0.3233161569,
0.2519039512,
0.2206078619,
0.1107887104,
-0.0591553561,
0.3506517112,
0.296302706,
-0.268956095,
0.1074776426,
-0.1403619498,
-0.1288822442,
0.0123324795,
0.059969943,
-0.1671212167,
0.1541715115,
-0.4859211743,
-0.2744221985,
-0.0720596761,
-0.0810687393,
-0.1790813059,
0.0421769693,
-0.053237237,
0.0425298326,
-0.1384541541,
0.1540127695,
-0.0546144359,
-0.0860621855,
0.0819200501,
0.5511022806,
-0.1832883656,
0.3804512322,
0.2542595863,
0.4371028244,
0.079958424,
0.2348531336,
0.3483048975,
0.1514680684,
0.2243075818,
0.4164159596,
-0.0817877203,
0.0672471449,
-0.4160611928,
-0.1437940001,
0.0633480027,
-0.0692748278,
0.0354940407,
0.08474911,
-0.150784269,
-0.3204997182,
-0.4465425014,
0.2643260956,
-0.3387427032,
0.0958342478,
-0.1978267431,
-0.2251453102,
0.1519887894,
0.1821350902,
0.1994278133,
0.3629794419,
0.4580831826,
-0.032093484,
0.4049341381,
-0.4784293771,
-0.2203937918,
0.2758818269,
0.1289042979,
0.4157721996,
-0.2298939526,
0.2235707939,
-0.1301994473,
0.0188215896,
0.8039574623,
-0.2620458603,
-0.3299179375,
-0.0154310223,
0.0681545734,
0.1336503327,
-0.1578280032,
-0.1799952686,
0.4455317259,
0.2653979659,
0.3116160333,
-0.4177493453,
-0.2524324954,
-0.0584326945,
0.4364772141,
-0.0185253136,
0.0429912359,
-0.0998031944,
0.0102291433,
-0.2890790999,
0.2386062294,
0.2925155461,
-0.0136917215,
-0.0169362687,
-0.2078026086,
-0.0076674051,
-0.0479657389,
0.4319796562,
0.104621537,
0.1274832338,
-0.3237043023,
-0.0890050754,
-0.0513636507,
0.4259845614,
0.8350524306,
0.2568824887,
-0.4463809431,
-0.4004330933,
-0.0267005302,
-0.1182923317,
0.6949506998,
0.5460373759,
0.0011485075,
0.3498133719,
-0.2061712742,
0.1629811972,
-0.0017578002,
0.2405007482,
0.4419851005,
0.2451387644,
-0.5271652937,
-0.2777051926,
-0.01431893,
0.2728557587,
-0.1527775526,
0.2488197684,
0.2822424769,
-0.3482762277,
0.448181957,
-0.2180052847,
0.9202814102,
-0.1081000865,
0.1769842058,
-0.2334660739,
-0.2355282605,
0.4540652633,
-0.4126850367,
0.2460377216,
-0.3492019773,
-0.4742132425,
-0.1100324392,
0.0365056172,
0.3672526181,
0.3979193866,
-0.0953565016,
0.471098274,
-0.0768573284,
-0.059470918,
-0.1357295066,
0.4952110946,
-0.0808082148,
-0.209891662,
-0.4640030563,
-0.0342162848,
0.0577562898,
-0.1429523975,
-0.0774756968,
-0.2687588036,
0.1536499411,
-0.3202189803,
-0.5534128547,
-0.2738956213,
-0.123866573,
0.0520060658,
-0.1065473258,
-0.2890202403,
0.2439142615,
0.0601761155,
0.0170919262,
0.2996910512,
0.0748782307,
0.0250023808,
-0.155689016,
0.0086948127,
-0.2661746442,
-0.2534128428,
0.424394846,
0.2638280988,
-0.147656709,
0.3652547002,
-0.1935147196,
-0.3234773576,
0.1794550121,
0.0400715843,
0.0007882364,
0.1152524278,
-0.0381950699,
-0.2317097485,
-0.2358818948,
-0.2420248836,
0.0861754715,
0.2091706991,
-0.1811236888,
0.3741346896,
-0.0825567394,
-0.2004745454,
-0.0525822677,
-0.0787110925,
-0.4278914332,
-0.0917410776,
0.2446844876,
-0.0592812635,
-0.1956136972,
-0.1246199608,
0.0944463834,
0.1489366591,
-0.0456994437,
0.1569084525,
-0.0389286093,
0.0742425174,
0.0140254823,
-0.1312746406,
0.4664574862,
0.1307409704,
-0.2354866266,
-0.3894788325,
-0.3047164679,
-0.0004167506,
0.0312523879,
0.38605389,
0.0768797249,
0.1696020514,
-0.0221417975,
0.2160576582,
-0.2095839828,
-0.1860387623,
-0.1528146714,
-0.0540537424,
-0.1907169074,
0.2986856103,
0.0557190776,
-0.0465522408,
0.0703083053,
0.2521034181,
0.3689204156,
-0.0473033376,
-0.0336488448,
0.1581772119,
-0.0297822151,
0.1915012002,
0.2068060338,
-0.2573684454,
0.2554958463,
-0.254452467,
-0.0062642475,
0.2262756377,
0.0535784401,
0.1188180819,
0.0879491493,
0.0235852506,
-0.1865265816,
0.0087527819,
-0.11537873,
0.2938222885,
0.3038096428,
0.1885798424,
-0.1978465617,
-0.0713794604,
0.1604602337,
0.2074497491,
-0.1234299466,
-0.0735502094,
0.1111280546,
0.1211489886,
-0.486656934,
0.3509526551,
0.263712436,
0.1089419499,
-0.0653703362,
0.0964130163,
0.3562043011,
0.0854203403,
-0.0353141688,
-0.1407132298,
0.0487707295,
-0.3552118242,
-0.0006578826,
0.2693493366,
0.2658033669,
-0.1856264621,
-0.1421914846,
-0.0903942212,
0.3831518888,
0.1608847231,
0.0113520464,
0.3325922489,
0.0484102294,
0.0151843335,
0.1616111696,
-0.0812550709,
0.4215297699,
0.3943681419,
-0.1059538946,
-0.1336728632,
0.0422803834,
-0.2566131353,
-0.2990852594,
-0.333537817,
0.3333736062,
0.1232998073,
-0.2008335739,
-0.2057079375,
0.1558202803,
0.581908226,
-0.3255526423,
-0.1698463112,
0.0932433233,
0.0151966522,
-0.1296873689,
0.1355937868,
0.2539345324,
0.1188135892,
-0.1187752858,
-0.3039394617,
0.1671480387,
-0.1479537338,
0.1235579997,
-0.0113670966,
0.2726223767,
-0.0429069102,
-0.1298953593,
0.1385738105,
0.586818397,
-0.2482187301,
-0.1109956875,
0.2599123716,
-0.1228406429,
0.0991812497,
-0.1952547282,
0.6805849671,
0.3961872458,
0.2024146467,
-0.2139313072,
-0.2139331996,
0.143814519,
0.0880246013,
-0.2117617279,
-0.2278226763,
-0.1733569652,
0.2931329906,
0.0596402586,
-0.0600831062,
0.172162056,
0.2266809791,
0.0493761227,
-0.109007068,
-0.0734019354,
0.0593280233,
-0.2405631095,
-0.1325252354,
-0.1790395379,
-0.2729078531,
-0.2147060186,
0.4603156149,
-0.2889190912,
0.1828611195,
0.1995467097,
0.0662999973,
0.1559035182,
0.0591120757,
0.4475525022,
0.2244103551,
-0.4179140925,
0.0879036784,
-0.8058604002,
-0.1965545416,
-0.1332131326,
0.0353206508,
0.1043249145,
0.0707275793,
-0.1179596484,
-0.1067902967,
0.344220072,
0.0314411707,
0.1797848344,
0.2814747393,
-0.4411145747,
-0.1865924597,
-0.206050083,
-0.0418428332,
-0.0726902187,
-0.0307983235,
0.2907046974,
0.3199257255,
0.0122961579,
-0.1926452667,
0.087967366,
-0.0157398991,
0.1223673224,
0.1741414964,
0.0154717267,
0.490105778,
-0.2843931317,
-0.2433410734,
0.1756734401,
0.0526329502,
-0.2411287874,
0.2213324904,
0.0903313607,
0.2468902618,
-0.0907967761,
-0.3145154119,
-0.2964183986,
0.3545729816,
0.1674231887,
-0.157546863,
-0.2645469904,
0.425902009,
0.0076895095,
-0.0380668268,
-0.0111228842,
-0.0175952259,
0.0060379365,
0.1518339366,
-0.2819747627,
-0.3354224265,
0.3631478548,
0.1472550333,
-0.0215619467,
-0.2779442966,
0.5018215179,
-0.1264555603,
0.4052017033,
-0.3974801898,
-0.3426754177,
0.3026513755,
0.2451997399,
-0.5436031222,
-0.1363784522,
0.049259644,
0.0748069286,
-0.0160512608,
0.1413266063,
0.157842949,
-0.2588277161,
0.2586651444,
-0.1373972446
] |
https://github.com/huggingface/datasets/issues/1818 | Loading local dataset raise requests.exceptions.ConnectTimeout | Hi ! Thanks for reporting. This was indeed a bug introduced when we moved the `json` dataset loader inside the `datasets` package (before that, the `json` loader was fetched online, as all the other dataset scripts).
This should be fixed on master now. Feel free to install `datasets` from source to try it out.
The fix will be available in the next release of `datasets` in a few days | Load local dataset:
```
dataset = load_dataset('json', data_files=["../../data/json.json"])
train = dataset["train"]
print(train.features)
train1 = train.map(lambda x: {"labels": 1})
print(train1[:2])
```
but it raised requests.exceptions.ConnectTimeout:
```
/Users/littlely/myvirtual/tf2/bin/python3.7 /Users/littlely/projects/python_projects/pytorch_learning/nlp/dataset/transformers_datasets.py
Traceback (most recent call last):
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
chunked=chunked,
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
conn.connect()
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connection.py", line 309, in connect
conn = self._new_conn()
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connection.py", line 167, in _new_conn
% (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x1181e9940>, 'Connection to s3.amazonaws.com timed out. (connect timeout=10)')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connectionpool.py", line 727, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='s3.amazonaws.com', port=443): Max retries exceeded with url: /datasets.huggingface.co/datasets/datasets/json/json.py (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x1181e9940>, 'Connection to s3.amazonaws.com timed out. (connect timeout=10)'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/littlely/projects/python_projects/pytorch_learning/nlp/dataset/transformers_datasets.py", line 12, in <module>
dataset = load_dataset('json', data_files=["../../data/json.json"])
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/load.py", line 591, in load_dataset
path, script_version=script_version, download_config=download_config, download_mode=download_mode, dataset=True
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/load.py", line 263, in prepare_module
head_hf_s3(path, filename=name, dataset=dataset, max_retries=download_config.max_retries)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/utils/file_utils.py", line 232, in head_hf_s3
max_retries=max_retries,
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/utils/file_utils.py", line 523, in http_head
max_retries=max_retries,
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/utils/file_utils.py", line 458, in _request_with_retry
raise err
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/utils/file_utils.py", line 454, in _request_with_retry
response = requests.request(verb.upper(), url, **params)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/adapters.py", line 504, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='s3.amazonaws.com', port=443): Max retries exceeded with url: /datasets.huggingface.co/datasets/datasets/json/json.py (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x1181e9940>, 'Connection to s3.amazonaws.com timed out. (connect timeout=10)'))
Process finished with exit code 1
```
Why it want to connect a remote url when I load local datasets, and how can I fix it? | 69 | Loading local dataset raise requests.exceptions.ConnectTimeout
Load local dataset:
```
dataset = load_dataset('json', data_files=["../../data/json.json"])
train = dataset["train"]
print(train.features)
train1 = train.map(lambda x: {"labels": 1})
print(train1[:2])
```
but it raised requests.exceptions.ConnectTimeout:
```
/Users/littlely/myvirtual/tf2/bin/python3.7 /Users/littlely/projects/python_projects/pytorch_learning/nlp/dataset/transformers_datasets.py
Traceback (most recent call last):
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
chunked=chunked,
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
conn.connect()
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connection.py", line 309, in connect
conn = self._new_conn()
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connection.py", line 167, in _new_conn
% (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x1181e9940>, 'Connection to s3.amazonaws.com timed out. (connect timeout=10)')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/connectionpool.py", line 727, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='s3.amazonaws.com', port=443): Max retries exceeded with url: /datasets.huggingface.co/datasets/datasets/json/json.py (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x1181e9940>, 'Connection to s3.amazonaws.com timed out. (connect timeout=10)'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/littlely/projects/python_projects/pytorch_learning/nlp/dataset/transformers_datasets.py", line 12, in <module>
dataset = load_dataset('json', data_files=["../../data/json.json"])
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/load.py", line 591, in load_dataset
path, script_version=script_version, download_config=download_config, download_mode=download_mode, dataset=True
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/load.py", line 263, in prepare_module
head_hf_s3(path, filename=name, dataset=dataset, max_retries=download_config.max_retries)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/utils/file_utils.py", line 232, in head_hf_s3
max_retries=max_retries,
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/utils/file_utils.py", line 523, in http_head
max_retries=max_retries,
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/utils/file_utils.py", line 458, in _request_with_retry
raise err
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/datasets/utils/file_utils.py", line 454, in _request_with_retry
response = requests.request(verb.upper(), url, **params)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/Users/littlely/myvirtual/tf2/lib/python3.7/site-packages/requests/adapters.py", line 504, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='s3.amazonaws.com', port=443): Max retries exceeded with url: /datasets.huggingface.co/datasets/datasets/json/json.py (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x1181e9940>, 'Connection to s3.amazonaws.com timed out. (connect timeout=10)'))
Process finished with exit code 1
```
Why it want to connect a remote url when I load local datasets, and how can I fix it?
Hi ! Thanks for reporting. This was indeed a bug introduced when we moved the `json` dataset loader inside the `datasets` package (before that, the `json` loader was fetched online, as all the other dataset scripts).
This should be fixed on master now. Feel free to install `datasets` from source to try it out.
The fix will be available in the next release of `datasets` in a few days | [
-0.0876655653,
-0.3096541166,
-0.0747827217,
0.2496919334,
0.3151806891,
0.0891385004,
0.3149231672,
0.288544178,
-0.1467543393,
0.0568147749,
-0.0469758138,
0.3553400636,
0.0624655485,
-0.072461091,
-0.0074791657,
-0.3571034074,
-0.1442811042,
0.0838933513,
-0.0475475229,
-0.1543696225,
-0.2529875934,
0.0257252511,
-0.1874687374,
0.2330834568,
-0.2529923618,
-0.2066889107,
-0.0868970826,
0.1169290841,
0.0257288516,
-0.4841196537,
0.1179935411,
-0.3125515282,
0.0555522144,
0.5283834338,
-0.0001154436,
0.1222109273,
0.0945107117,
0.0215759631,
-0.1321408302,
-0.0498597324,
-0.0674965084,
-0.2368900925,
0.2450838834,
-0.3710688353,
-0.107516095,
-0.3912543356,
0.0075892969,
-0.2066581547,
0.5702972412,
0.5039223433,
0.1457756609,
0.5681712627,
0.0515227839,
0.0785588771,
0.2667641342,
0.1773373634,
-0.2064678371,
0.2898199856,
0.2549915314,
-0.4005660117,
0.0400109962,
-0.0825460032,
-0.0017518577,
0.0780523121,
0.0907534957,
0.1272234917,
-0.1359149069,
-0.348036319,
-0.1655739099,
0.3539238274,
0.310098052,
0.0707032904,
-0.2927103341,
-0.2270767689,
-0.2015626132,
-0.0293269772,
0.1347277761,
0.1666533053,
-0.3210847676,
0.1775444746,
-0.3006034493,
0.0551212169,
-0.453517586,
0.5489298105,
0.086512804,
0.5155923963,
0.083038643,
0.3091308177,
-0.0458226837,
0.0133978929,
-0.0089780632,
-0.0843446627,
0.0171155371,
0.1844491214,
-0.1963670552,
-0.1544386148,
0.1146629378,
-0.4060583413,
0.1601898819,
0.0676576421,
0.1546437442,
-0.087882854,
-0.1699436903,
0.3116520941,
-0.0025948782,
0.1281775385,
-0.0578198098,
0.3318802118,
0.3709952831,
0.0912053958,
-0.1829871237,
0.1557960063,
0.1085648686,
-0.1445656717,
0.0419753082,
-0.0599972568,
0.4929862022,
0.0511100851,
0.0875484347,
-0.0159911122,
-0.5868579149,
-0.0332806073,
0.1956100464,
0.349311769,
-0.3422441483,
0.0827535614,
0.0123645961,
-0.0544691384,
-0.3163070679,
0.0691053197,
-0.2425964773,
0.2482572049,
0.0804516003,
-0.0591254458,
0.1660154909,
0.0636306852,
0.4791112542,
-0.1673445851,
-0.0349100009,
-0.0415872,
0.5842093229,
-0.3233098984,
0.1414041072,
0.2345122397,
-0.2718017995,
0.0687617064,
0.2806972265,
0.1037613153,
-0.1080799103,
0.0201460812,
-0.2452027351,
-0.4628189504,
-0.0414955504,
0.2253667861,
0.0443511754,
-0.1087395698,
0.0094920695,
-0.1632415354,
0.4137926698,
-0.3300023973,
0.0524002053,
-0.2123019844,
-0.2179457396,
-0.1649779379,
0.2293942869,
0.3468135297,
-0.2586832345,
0.0798253715,
0.2683033347,
-0.0013027159,
0.2266993076,
0.4093843997,
-0.5121424794,
0.474384129,
-0.3170548081,
0.1415548772,
0.5460796952,
-0.4671508372,
-0.2384580076,
0.5044528842,
-0.251095742,
-0.0711538866,
0.0435651429,
0.2766906321,
0.1196678802,
0.0741796941,
0.4246087372,
0.350993216,
-0.2929824293,
0.1134740785,
-0.2766139805,
-0.2069237977,
0.0072744461,
0.0785307363,
0.0622737147,
0.0114247855,
0.1617799252,
0.0338041186,
0.2731344104,
-0.0619284362,
0.1070541516,
0.3353098333,
0.0764932185,
-0.0913645104,
0.0302907433,
-0.0215979572,
-0.205333367,
0.2261997908,
-0.0307399575,
0.2425402701,
-0.267367065,
-0.0202198923,
-0.3861398697,
0.063886404,
-0.3079499304,
0.085165374,
0.0618033595,
0.2712071538,
0.1725235581,
0.1565876007,
0.042503614,
-0.0275295805,
-0.2579173148,
0.1061818078,
-0.377877146,
0.2617046833,
-0.0599823333,
-0.0379348882,
-0.0919815972,
-0.1287302524,
0.1428045034,
-0.2689324915,
-0.2771677375,
0.1943449974,
0.0190404635,
0.1645131558,
0.0183444116,
0.0385954045,
0.0624704659,
-0.1664234102,
0.0212310441,
0.0946422145,
0.1148082539,
-0.1870046854,
-0.1732778549,
0.299890697,
0.2156785727,
0.3294456899,
0.1182268783,
-0.125840649,
0.2493576109,
0.0717815682,
-0.0189659614,
-0.0102476263,
0.0795537829,
0.0412089154,
0.1136683673,
-0.0922209173,
-0.2574562728,
0.0602613725,
0.446049422,
-0.1701762229,
0.0450153351,
0.0696919784,
0.3061301112,
-0.1095024496,
0.1763371527,
0.1549544036,
0.6341341734,
0.2085806578,
0.1621568352,
0.1511494964,
-0.1348974854,
-0.2292597443,
0.0644128099,
-0.0266801752,
0.2473058403,
0.3175879121,
0.3057262301,
0.0243180003,
-0.4263646007,
-0.2775951028,
0.1161994264,
0.3775261343,
-0.2742399275,
0.2351563871,
-0.1033197716,
-0.156478703,
-0.0477511138,
0.0394215547,
-0.2301472723,
-0.4215003252,
0.058336094,
0.2158532292,
-0.0731705055,
0.2756846547,
-0.0093071051,
0.0201465823,
0.3500890732,
-0.4383779466,
-0.1064933166,
-0.176118508,
-0.3641542792,
0.0252939034,
0.1525000632,
-0.0963635445,
0.4177518487,
-0.0499241352,
-0.4756878316,
-0.1872624904,
-0.2943214476,
0.0119484002,
-0.0652063489,
0.2479959279,
0.1509260684,
0.3515702784,
-0.0174458493,
-0.1918195635,
0.4221315682,
-0.0898677558,
-0.1238977909,
-0.0267954767,
0.024070939,
0.1492927074,
-0.0307472628,
-0.6379081011,
-0.4048391283,
-0.4066762924,
0.2181979418,
0.0466198288,
0.2775185406,
0.0849542916,
0.0358154401,
0.359721303,
0.1112167388,
0.1276402622,
-0.0538618043,
-0.3271386325,
0.2574605942,
-0.2653141916,
-0.2633669376,
-0.0142948534,
-0.1172881722,
0.0885663256,
0.0501004532,
-0.5194665194,
-0.4453580081,
-0.2787285447,
0.2407431006,
-0.2776931226,
-0.1170525998,
0.2960999906,
-0.1703326106,
-0.1082186028,
-0.0064746439,
-0.044476714,
0.3415368497,
0.2659060359,
0.1737861186,
0.0614485852,
0.7596715689,
-0.033246994,
0.5413730145,
0.0296803638,
0.0352777131,
0.4892272949,
-0.2829691172,
-0.0174786318,
-0.0779779106,
-0.2684918642,
0.0801822543,
0.140926376,
-0.2075179815,
-0.0933664069,
0.1615559459,
-0.1225310639,
-0.2405094802,
-0.2304324508,
-0.2888834178,
-0.2335734367,
0.0097269891,
-0.146550715,
0.289532721,
-0.0222469997,
0.0659927875,
-0.1431169659,
-0.0516234636,
-0.1466684043,
0.0693068877,
-0.0167992059,
-0.162440151,
-0.6813388467,
-0.1749102175,
-0.5136032104,
0.2706354558,
0.1567563564,
0.5439186692,
-0.264136672,
-0.068438679,
0.2611938715,
-0.1415595859,
0.8109993339,
-0.2408432066,
0.1052410305,
0.0250694789,
0.1355767846,
-0.3428853154,
0.0058178343,
-0.0008366459,
0.2688808441,
0.2481940091,
0.5743728876,
-0.1280057728,
-0.2865647972,
0.2069716454,
0.2740257382,
-0.235822469,
-0.0762404948,
-0.2177329957,
-0.6896689534,
-0.1968455017,
0.083269693,
-0.0547157526,
0.2028000802,
0.0924307704,
-0.4169501662,
0.0952305049,
0.1664062738,
-0.0523583069,
0.0799485967,
-0.1108464673,
0.0158891361,
0.1148236394,
-0.2471913099,
0.2845288217,
0.245039463,
0.3522231877,
-0.1490686834,
-0.2630352974,
0.1436478198,
0.1238206849,
0.3318552077,
0.294762224,
-0.0212467276,
0.1408845484,
0.1599985957,
0.3401944339,
-0.0828355774,
0.3873806894,
0.5323922634,
-0.1223367825,
-0.2031581551,
-0.50395298,
0.1332385689,
-0.0471888222,
-0.0636862516,
0.2192022949,
-0.2862212956,
-0.2772032022,
0.3792082667,
0.1395540237,
0.9921341538,
-0.0113061443,
0.2558077872,
0.6406010389,
-0.0664969906,
0.6649608612,
-0.2646172941,
0.2580273747,
-0.3804025054,
0.0429762639,
-0.1054765061,
-0.2358801961,
0.0285095274,
0.0944373086,
-0.1649481654,
0.1491955519,
-0.1172835156,
0.1959852725,
-0.1463425308,
0.5414193869,
0.0756281018,
-0.0598481856,
-0.5874487162,
0.1064095944,
-0.0261030123,
0.0985837132,
-0.0268353093,
-0.1081688851,
0.0200304203,
-0.373174578,
0.1574335843,
0.0943820924,
-0.2812205553,
0.5121895075,
-0.1859299093,
-0.075869292,
-0.0156014338,
0.3076259494,
0.0348660275,
-0.0000249194,
-0.1064445823,
0.0362807475,
-0.1130684391,
0.1308700889,
-0.1006317735,
-0.0095307175,
0.1547370404,
-0.116320461,
-0.4218947887,
0.4718745053,
-0.3494648933,
-0.3757621944,
-0.070901528,
0.1223011687,
-0.0595237613,
-0.4409899116,
-0.1029622778,
-0.1443652064,
-0.2691300809,
-0.2003670037,
0.0858177319,
0.0195274558,
-0.3188182414,
0.3204016685,
0.0177513808,
-0.315361917,
-0.0215747561,
0.4522785246,
0.1165136918,
0.2216841877,
0.7525092363,
0.1699733436,
0.0249585714,
-0.3292615712,
0.4612757266,
-0.0180305317,
-0.289280355,
0.104687281,
0.2482041419,
0.2518326044,
0.0637085289,
0.2772767246,
0.2292512506,
0.1389220357,
0.0036965881,
-0.3916378319,
-0.4703882933,
0.1692254543,
0.0765441209,
0.2141619772,
0.2396151721,
0.249891296,
-0.189387545,
0.2043240219,
-0.2954697609,
0.0561624281,
-0.5371046662,
0.1856479347,
-0.0375427343,
-0.1155711338,
0.378370434,
0.0621665195,
0.1401453167,
-0.0213006455,
-0.3744773269,
-0.1664372087,
-0.0505244546,
0.1663369834,
0.0718504339,
-0.1864739954,
-0.4386375546,
-0.5062550902,
-0.0181477815,
0.0965658352,
0.0535421297,
0.01884735,
-0.0811803564,
0.0175818242,
0.0141580096,
0.1220888868,
0.0841594934,
0.0472677276,
-0.153811276,
-0.015742844,
0.2301689088,
0.0772615671,
0.1983970702,
-0.1885781735,
-0.0674611852,
0.0197661743,
0.0356260985,
-0.1773954779,
0.2926693261,
-0.2847869396,
-0.2742280066,
-0.0748813003,
0.2242606431,
0.3945913911,
-0.1961328089,
0.0283794738,
0.1952045709,
0.2080866396,
-0.1833199114,
-0.2920611501,
0.4560912251,
-0.2019455284,
0.1378973424,
0.1103225052,
-0.2127420604,
0.0894701481,
-0.2245320678,
0.2033675164,
0.2341231257,
0.022326082,
0.0371880084,
0.3005512655,
-0.2989982069,
-0.0828120932,
0.1474564523,
0.127095148,
0.3212960362,
0.0047754617,
-0.0055456711,
0.0433280393,
-0.3767876625,
0.3542630374,
-0.0860255584,
-0.4847980142,
0.0512525998,
-0.1688599139,
-0.2988899946,
-0.1300306767,
-0.0237508193,
0.4819837213,
-0.2367397249,
-0.1881798655,
-0.1995150894,
0.3600145876,
-0.1028244272,
-0.1955420077,
-0.2295156419,
-0.2858204246,
0.1354683936,
-0.1978503317,
0.1609135717,
0.0190453678,
-0.0650870204,
0.0894730836,
0.038387116,
-0.2019247413,
-0.0201456547,
0.0612039417,
0.0640064925,
-0.3245760798,
0.1949737817,
0.2483702451,
-0.0607038848,
-0.4171531796,
0.0106872292,
0.3459573388,
0.4239963293,
-0.0218451694,
0.3124996722,
-0.0947108194,
-0.1583963186,
-0.0055410247,
0.1134832576,
0.2338087112,
-0.0364381261,
0.3514870405,
0.0933528766,
-0.1481020898,
0.2936783135,
-0.0237192623,
0.1534289867,
-0.2211735994,
0.509334147,
0.0122407852,
-0.292875737,
0.0004252951,
0.0211052727,
-0.4169076979,
0.1007508487,
0.4297307134,
-0.1344192624,
0.3220784962,
-0.098874405,
0.0500603542,
-0.39507249,
0.6884117126,
0.2332842052,
0.1067481488,
-0.34255445,
0.0008536167,
-0.340724498,
0.0283504128,
-0.4788585007,
-0.0240353793,
0.0740339234,
0.1004005373,
0.0750101879,
-0.0460600592,
-0.1270331442,
0.0030354592,
0.0218559261,
0.1133120283,
-0.2876616716,
-0.2759697139,
-0.0043595834,
0.2354529202,
-0.0187373497,
-0.4727281034,
0.2163543105,
-0.2600305974,
-0.0307255071,
-0.2679132223,
-0.0484621152,
0.2021927088,
-0.0579151958,
0.4343679845,
0.349629432,
0.4295275807,
0.072088711,
-0.0606514215,
0.0439474173,
-0.4789811969,
0.0459217429,
-0.004792315,
0.1576927751,
0.5942358375,
-0.188474223,
-0.0180716198,
-0.3390834332,
0.1729626656,
-0.1238196567,
-0.3846410811,
0.323759377,
-0.0524620675,
0.0261462647,
0.0659152046,
0.100164637,
0.1330550462,
0.0819864422,
0.0297977477,
-0.2536602318,
-0.2163212895,
0.7234710455,
-0.3179050088,
-0.1667279303,
-0.0437355451,
0.1857218444,
0.097798489,
0.0049680425,
-0.1586291045,
-0.080399096,
0.6721759439,
0.0862088799,
-0.3109280467,
0.4904256463,
0.157873854,
0.0310349558,
0.0725697577,
-0.0335413851,
-0.1904414743,
-0.2747127116,
-0.040226955,
-0.3100723028
] |
https://github.com/huggingface/datasets/issues/1817 | pyarrow.lib.ArrowInvalid: Column 1 named input_ids expected length 599 but got length 1500 | Hi !
The error you have is due to the `input_ids` column not having the same number of examples as the other columns.
Indeed you're concatenating the `input_ids` at this line:
https://github.com/LuCeHe/GenericTools/blob/431835d8e13ec24dceb5ee4dc4ae58f0e873b091/KerasTools/lm_preprocessing.py#L134
However the other columns are kept unchanged, and therefore you end up with an `input_ids` column with 599 elements while the others columns like `attention_mask` have 1500.
To fix that you can instead concatenate them all using
```python
concatenated_examples = {k: sum(examples[k], []) for k in examples.keys()}
```
Also you may need to drop the "text" column before applying `group_texts` since strings can't be concatenated with lists. You can drop it at the tokenization step:
```python
dset = dset.map(
tokenize_function,
batched=True,
remove_columns=["text"]
)
``` | I am trying to preprocess any dataset in this package with GPT-2 tokenizer, so I need to structure the datasets as long sequences of text without padding. I've been following a couple of your tutorials and here you can find the script that is failing right at the end
https://github.com/LuCeHe/GenericTools/blob/master/KerasTools/lm_preprocessing.py
In the last iteration of the last dset.map, it gives the error that I copied in the title. Another issue that I have, if I leave the batch_size set as 1000 in the last .map, I'm afraid it's going to lose most text, so I'm considering setting both writer_batch_size and batch_size to 300 K, but I'm not sure it's the best way to go.
Can you help me?
Thanks! | 116 | pyarrow.lib.ArrowInvalid: Column 1 named input_ids expected length 599 but got length 1500
I am trying to preprocess any dataset in this package with GPT-2 tokenizer, so I need to structure the datasets as long sequences of text without padding. I've been following a couple of your tutorials and here you can find the script that is failing right at the end
https://github.com/LuCeHe/GenericTools/blob/master/KerasTools/lm_preprocessing.py
In the last iteration of the last dset.map, it gives the error that I copied in the title. Another issue that I have, if I leave the batch_size set as 1000 in the last .map, I'm afraid it's going to lose most text, so I'm considering setting both writer_batch_size and batch_size to 300 K, but I'm not sure it's the best way to go.
Can you help me?
Thanks!
Hi !
The error you have is due to the `input_ids` column not having the same number of examples as the other columns.
Indeed you're concatenating the `input_ids` at this line:
https://github.com/LuCeHe/GenericTools/blob/431835d8e13ec24dceb5ee4dc4ae58f0e873b091/KerasTools/lm_preprocessing.py#L134
However the other columns are kept unchanged, and therefore you end up with an `input_ids` column with 599 elements while the others columns like `attention_mask` have 1500.
To fix that you can instead concatenate them all using
```python
concatenated_examples = {k: sum(examples[k], []) for k in examples.keys()}
```
Also you may need to drop the "text" column before applying `group_texts` since strings can't be concatenated with lists. You can drop it at the tokenization step:
```python
dset = dset.map(
tokenize_function,
batched=True,
remove_columns=["text"]
)
``` | [
-0.1550028175,
-0.070364207,
-0.0086344378,
0.1708289683,
0.2552529871,
0.036447458,
0.5036026239,
0.5221663713,
-0.5246614218,
0.0104546156,
0.3807773292,
0.2319068611,
0.0748814568,
-0.1745076776,
0.126140371,
-0.2886478901,
0.0141822826,
0.2477587461,
-0.0138816629,
0.1944545805,
-0.0676674321,
0.3307290375,
-0.3295418918,
0.2716699541,
-0.3865055442,
-0.0922518373,
-0.1422724128,
-0.1698894203,
-0.1691985577,
-0.5931816697,
0.0828089416,
-0.2285581231,
0.0478053577,
0.2794108987,
-0.0001236288,
-0.1168292612,
0.4077008367,
-0.1066745594,
0.0701528415,
-0.0044738441,
0.0422805212,
-0.2361375093,
0.0165135283,
-0.2340284586,
0.0912675485,
-0.5475608706,
-0.2920789421,
0.2607318759,
0.2835213244,
0.3589546382,
0.125784725,
-0.0448946655,
0.1790401936,
-0.041285973,
0.5702493787,
0.0536100119,
0.0055337665,
0.1160504445,
0.1458777189,
-0.2013939619,
0.0534411371,
0.2144297361,
-0.2680256069,
-0.1032517403,
0.0580861345,
-0.0039268225,
0.0565319881,
-0.2023721784,
0.2105338722,
0.1588904858,
0.3037465513,
-0.3780480027,
-0.0483499877,
-0.2628533542,
0.1766874492,
-0.3986364305,
-0.0885516256,
-0.0606476292,
-0.1943921149,
0.1883022934,
-0.1021536216,
0.1745143384,
-0.2574056685,
0.0938395038,
0.0956303999,
0.2773377895,
0.1587262899,
0.2896916866,
-0.0706556737,
-0.1704555154,
0.0365097411,
0.1347860694,
-0.2240159512,
0.2108973265,
-0.2329891324,
-0.0353560932,
-0.1298374236,
-0.2215498686,
0.4244501293,
-0.1432872713,
0.2827807367,
-0.1606893241,
0.7112702727,
-0.1186460629,
-0.0855472237,
0.4598975778,
0.2372590005,
0.2067827731,
-0.1270626038,
-0.3863638043,
0.29139781,
0.147092551,
-0.2602185011,
-0.6117146611,
0.2757363617,
0.1679494083,
0.0617794655,
0.1802979261,
-0.1971884519,
0.480027616,
-0.4964812696,
-0.0251220427,
-0.1530762166,
0.0553496853,
0.0796749443,
0.0637724772,
-0.0022889245,
0.0737529099,
0.0643043444,
-0.2553141415,
-0.1027695984,
0.2139761448,
-0.3910427094,
0.0601491742,
0.1080490202,
0.0560679436,
0.3017203212,
0.0623577759,
0.0746018067,
0.0635032505,
-0.0101667484,
-0.0717615932,
0.2443723828,
0.2771905065,
-0.1186135188,
0.182849586,
0.2038536221,
-0.1445944905,
-0.3017872572,
0.2960034013,
-0.327039808,
-0.3279037178,
-0.1085566133,
0.0631790385,
0.1062354669,
0.1053578481,
-0.2185854763,
0.1509512663,
0.6920495033,
-0.0988643244,
0.1823329031,
-0.4258132577,
0.1980243623,
-0.3123605251,
0.1485880911,
0.1613927931,
-0.567312181,
0.1217049807,
0.3949625194,
0.3733771145,
0.33287552,
0.3813623786,
-0.0831795782,
0.5039742589,
-0.0906989872,
0.7552222013,
0.3342806101,
-0.0888390616,
-0.2165762931,
0.3936940134,
-0.0643305108,
-0.2323004156,
0.0295618046,
-0.2319586277,
0.2128832638,
-0.0096778134,
0.1547477394,
-0.1016397104,
-0.1074725688,
-0.0029563289,
-0.2887980044,
-0.1346037239,
0.1084655747,
-0.0687080994,
-0.1076744944,
-0.256362319,
-0.2608839273,
-0.4103668332,
0.1153547615,
-0.1635284871,
0.3597878218,
0.3475107551,
0.0196290072,
0.0267152917,
0.3291781545,
0.09509404,
-0.1781707406,
-0.0235903002,
0.0442914069,
-0.0349593833,
-0.2201662809,
-0.3523423374,
-0.2672821879,
0.1990020275,
0.0381782614,
0.1776503772,
0.0093464218,
-0.226512149,
0.1835490018,
-0.1633616388,
-0.0336495191,
-0.2718363404,
0.0508425348,
0.0964218825,
-0.1822096705,
-0.1217022017,
-0.1731586307,
-0.4061909914,
0.0997495726,
-0.0075105587,
0.2952217758,
-0.0537829809,
0.0143547338,
0.3127261698,
0.1311427504,
-0.3347697556,
-0.3954313397,
0.2027166635,
-0.0828413814,
-0.1941531301,
-0.1910976022,
-0.1059260145,
-0.0302319545,
-0.0867646486,
0.1134170815,
0.3114245236,
0.0878982544,
0.3004992604,
-0.2077564597,
-0.0319662951,
0.0630752817,
0.0686766952,
-0.2348008752,
0.0100700408,
0.0778636932,
-0.0475965403,
0.132637471,
0.0023548657,
-0.3153675795,
0.1728617996,
0.17700544,
0.0155087356,
-0.0637862161,
0.1986923367,
-0.0801164135,
-0.0147262821,
0.1154867858,
-0.1970092803,
0.1011903286,
0.1659038812,
-0.0247779023,
-0.0547355227,
-0.2063380927,
-0.1961252987,
0.2262761444,
0.0736099705,
0.2035345137,
0.5516644716,
0.0526559763,
0.1273685098,
0.0501687862,
-0.0934743583,
0.2298326939,
0.355068922,
-0.3621886969,
0.193380326,
-0.2526604533,
0.0196314976,
-0.0059756506,
-0.611400187,
0.1719789058,
-0.030618608,
0.0457912646,
-0.1291826516,
-0.1622223556,
0.3853451014,
0.1819876134,
0.1849829108,
0.5495918393,
-0.1675561816,
-0.1204286516,
-0.2368339449,
-0.1843619496,
-0.0954643413,
0.2132759541,
-0.1506296694,
-0.0212397017,
0.1077952087,
-0.1174565032,
-0.2242490947,
-0.5022531748,
0.3119059503,
-0.3466985524,
-0.1121641845,
0.402456075,
0.1223672107,
-0.2633652985,
-0.2280540913,
0.055442594,
0.2299546599,
-0.279807657,
0.3484919071,
-0.0896362588,
-0.2746525109,
-0.1506219208,
-0.1697362959,
0.1745995432,
-0.1914544404,
0.1772337854,
-0.1534637809,
0.14684017,
0.0637496337,
0.4653074443,
0.0369054489,
-0.0069361315,
0.0424284413,
0.0574550666,
0.2105317861,
0.434368521,
-0.2766294181,
-0.2573383749,
0.0865591764,
-0.1728404164,
0.3282190859,
0.2733303607,
-0.3643849194,
0.1617098749,
-0.0685938746,
0.0936413482,
-0.3578870893,
0.05903304,
0.4605172575,
0.1466500312,
0.005105956,
-0.1141967475,
0.0346327871,
0.3736735582,
-0.2701496482,
0.0551126972,
0.0552536659,
0.6357029676,
-0.0250456557,
0.7274158597,
0.2814565897,
-0.1197827756,
0.1013612896,
-0.2490905821,
-0.1202093363,
-0.2398967594,
0.1625427604,
-0.2318485975,
-0.0949839205,
0.0369534083,
0.3688108921,
-0.2972483635,
-0.3330020308,
0.221014902,
0.1925226748,
-0.2142068446,
-0.0720817298,
0.3196912706,
0.0360594839,
0.3239008784,
-0.0419195071,
0.0790793374,
-0.1929030418,
-0.0333551913,
0.0495350473,
-0.3764075935,
0.0325696617,
0.0649056509,
-0.231773451,
-0.4118336737,
-0.6226691604,
0.3684793115,
0.3064646125,
0.4693976045,
0.1016399488,
-0.3109785318,
-0.0006428947,
-0.2770528793,
0.517624855,
-0.1439094394,
-0.3334730566,
0.3643977344,
0.125467509,
-0.4200968146,
-0.3367703259,
-0.0527213588,
0.145567596,
0.3767844439,
0.1362761259,
-0.5397259593,
-0.0318676308,
0.3549748659,
-0.0261206161,
-0.0126673384,
-0.1469439268,
-0.2477854043,
-0.3502267599,
-0.2020339668,
-0.0166321751,
0.6145429611,
0.3996125758,
-0.0125637818,
-0.0049709235,
-0.0547664575,
-0.2995448411,
0.097713843,
0.0095575629,
0.3902046978,
0.0011863867,
0.2208580673,
-0.2235009819,
0.3756489456,
0.3819263577,
0.1147091314,
0.1507870853,
-0.2386596054,
0.2495275438,
-0.2736165524,
0.4812791348,
0.2760550082,
-0.2233426273,
0.2875678539,
-0.4445218444,
0.2794282436,
-0.0792396292,
0.1409679204,
0.3965916336,
-0.1731874198,
-0.3562678099,
-0.1305024028,
0.2430722564,
0.0210248027,
-0.0263373386,
0.456723094,
0.0673951656,
-0.3701599538,
0.3138678372,
0.2621950805,
1.1447811127,
0.3166948855,
0.2496210039,
0.3733640313,
0.0835128948,
0.0062092957,
0.0769704729,
0.1055410057,
-0.5544158816,
-0.0051709786,
0.0093710981,
-0.1675926,
-0.0138097107,
0.201398164,
-0.3329413831,
-0.1281971931,
-0.3151692748,
0.1709834933,
-0.1320949197,
0.1428225189,
-0.0059345313,
-0.0872805268,
0.2379437685,
-0.0208472181,
-0.0131023321,
-0.3700397015,
-0.1652092338,
-0.0691828057,
-0.3673366904,
-0.3569473326,
-0.411229223,
-0.0752255246,
-0.2250599563,
0.0391514115,
0.1121887192,
-0.2581790686,
0.1797895879,
0.0262508746,
0.2069529295,
0.1652824879,
-0.1984623224,
0.0085506607,
0.0443300679,
-0.2909438312,
-0.1584412158,
-0.140994668,
0.1220933273,
-0.017199466,
0.0525764339,
0.1850581169,
0.0425045751,
0.0694970861,
-0.3031351566,
-0.1627691984,
0.2704519629,
-0.4907823205,
-0.0921756104,
0.0304883774,
0.0029679562,
-0.1565637439,
-0.006744571,
0.0492535494,
-0.220921725,
0.2321988046,
-0.1529704034,
-0.2571036518,
0.0601378158,
0.0723257735,
0.0023338576,
-0.0311883669,
0.6073064804,
0.3159711063,
-0.1589478701,
-0.1069920436,
0.1637087315,
0.5035052896,
-0.6606782675,
0.0749179572,
-0.1885086745,
0.0594584644,
0.050985992,
0.5169562101,
0.2717175782,
0.3059383631,
0.121623069,
-0.0753785595,
-0.299827069,
0.2028270364,
0.2588070631,
0.3612178564,
-0.2054403424,
0.0983744189,
-0.1620799601,
0.1159506366,
-0.1893983483,
-0.0878789127,
-0.0577511787,
0.1876956969,
-0.1030353531,
-0.0182808265,
-0.2642346919,
0.051464282,
-0.0315393209,
0.3885489404,
-0.0102439942,
-0.1027790606,
-0.2301062942,
0.1527895778,
0.0681773946,
-0.0534089357,
0.2742185593,
-0.1448957175,
-0.298536092,
-0.1450140029,
0.0136728017,
-0.0535814166,
-0.0210786648,
-0.0242108759,
0.4298158288,
0.0646909326,
-0.0873842835,
0.0276945792,
0.0022442241,
0.1453479975,
0.1146918833,
0.2281083167,
0.095837526,
0.0262140892,
0.136153236,
0.3351013958,
0.0527841672,
-0.3552295268,
0.1339012235,
-0.4393781722,
-0.1296576113,
-0.0578080267,
0.2475418746,
0.3009126186,
-0.3606338501,
-0.1328802556,
0.4503160119,
0.1535473466,
-0.2865344286,
-0.1164166853,
-0.1829866767,
0.0641658157,
-0.137984857,
0.2008393407,
0.1094478741,
-0.0606064573,
-0.2202551663,
0.1737434715,
0.3542886674,
0.1231873259,
-0.3958589435,
0.3194215894,
-0.1859207153,
0.1239872575,
0.3163274229,
0.2035694569,
0.2621987164,
0.0297566503,
-0.1187682152,
0.2451476306,
0.267840147,
0.0912136957,
-0.2393344641,
-0.2031652331,
-0.0724442378,
0.2762995064,
0.0883819833,
0.0028183388,
0.1790753454,
0.3353703022,
0.4524992406,
-0.2289246023,
0.0278902426,
0.3590202332,
-0.1949387342,
-0.0660150349,
-0.7122881413,
0.0824290216,
-0.2180037946,
-0.1749486625,
-0.1023460254,
0.073731117,
0.434352994,
0.0964007601,
-0.0904744491,
-0.1987380534,
0.0707282573,
-0.0068393662,
0.0945069119,
-0.3231537938,
0.4119295478,
0.1004952937,
-0.2849639058,
-0.1137818769,
0.3278911114,
0.6728411913,
0.4071212411,
-0.1261104941,
-0.3004499972,
-0.2880665362,
0.1028204709,
0.1032603085,
0.3540622592,
0.3359218836,
0.1313994974,
0.2158364356,
-0.0917937383,
-0.0349794105,
-0.0927520692,
0.3317201436,
-0.0684673041,
0.2488198876,
-0.0547334552,
-0.1573166698,
-0.4111021459,
-0.0005268923,
0.2015107274,
-0.5054786801,
0.2205101997,
0.5505584478,
0.1804080456,
0.1515893042,
-0.0997029692,
0.0322802141,
-0.0781506523,
0.4440885484,
0.3804037273,
0.1010722294,
-0.3919536173,
-0.3986079097,
-0.2410694659,
0.137129873,
-0.4373248219,
-0.1312001795,
0.2652820647,
0.1691050678,
0.240635708,
0.0195801891,
0.1167044193,
0.1667091846,
-0.3454829156,
0.5820029378,
-0.2765936255,
0.2108575106,
0.1482136697,
0.0865803733,
0.027279688,
-0.1982695013,
0.4266260564,
-0.0151000153,
-0.010772856,
-0.3655939698,
0.0269140322,
0.1797390282,
0.2164815664,
0.2508493662,
0.0789010897,
0.283663094,
-0.0113753295,
0.1057760566,
-0.3002664447,
-0.1518848687,
-0.177440539,
0.3001044989,
0.096073851,
0.0366606899,
-0.1852333695,
-0.2117047012,
0.0342736505,
-0.1169183031,
-0.0780774951,
-0.0607339554,
-0.3419030607,
0.1300677955,
-0.200025782,
0.1868886501,
-0.0354953483,
0.1137790084,
0.1058963835,
0.2066837847,
-0.3272296488,
-0.6539342403,
0.7069845796,
-0.4853316545,
-0.4971396625,
-0.0232495777,
-0.0063091083,
0.3170478642,
0.1148772091,
-0.1392878741,
-0.1747902483,
0.2745012641,
0.111971125,
-0.5378229022,
0.3033051491,
-0.0773033276,
0.0450054631,
-0.1753377616,
0.2336110473,
0.0831824243,
-0.2244839668,
-0.4705747962,
-0.6530275345
] |
https://github.com/huggingface/datasets/issues/1811 | Unable to add Multi-label Datasets | Thanks for adding this dataset! As far as I know `supervised_keys` is mostly a holdover from TFDS, but isn't really used, so feel free to drop it (@lhoestq or @thomwolf correct me if I'm wrong). It definitely shouldn't be blocking :) | I am trying to add [CIFAR-100](https://www.cs.toronto.edu/~kriz/cifar.html) dataset. The dataset contains two labels per image - `fine label` and `coarse label`. Using just one label in supervised keys as
`supervised_keys=("img", "fine_label")` raises no issue. But trying `supervised_keys=("img", "fine_label","coarse_label")` leads to this error :
```python
Traceback (most recent call last):
File "test_script.py", line 2, in <module>
d = load_dataset('./datasets/cifar100')
File "~/datasets/src/datasets/load.py", line 668, in load_dataset
**config_kwargs,
File "~/datasets/src/datasets/builder.py", line 896, in __init__
super(GeneratorBasedBuilder, self).__init__(*args, **kwargs)
File "~/datasets/src/datasets/builder.py", line 247, in __init__
info.update(self._info())
File "~/.cache/huggingface/modules/datasets_modules/datasets/cifar100/61d2489b2d4a4abc34201432541b7380984ec714e290817d9a1ee318e4b74e0f/cifar100.py", line 79, in _info
citation=_CITATION,
File "<string>", line 19, in __init__
File "~/datasets/src/datasets/info.py", line 136, in __post_init__
self.supervised_keys = SupervisedKeysData(*self.supervised_keys)
TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
```
Is there a way I can fix this?
Also, what does adding `supervised_keys` do? Is it necessary? How would I specify `supervised_keys` for a multi-input, multi-label dataset?
Thanks,
Gunjan | 41 | Unable to add Multi-label Datasets
I am trying to add [CIFAR-100](https://www.cs.toronto.edu/~kriz/cifar.html) dataset. The dataset contains two labels per image - `fine label` and `coarse label`. Using just one label in supervised keys as
`supervised_keys=("img", "fine_label")` raises no issue. But trying `supervised_keys=("img", "fine_label","coarse_label")` leads to this error :
```python
Traceback (most recent call last):
File "test_script.py", line 2, in <module>
d = load_dataset('./datasets/cifar100')
File "~/datasets/src/datasets/load.py", line 668, in load_dataset
**config_kwargs,
File "~/datasets/src/datasets/builder.py", line 896, in __init__
super(GeneratorBasedBuilder, self).__init__(*args, **kwargs)
File "~/datasets/src/datasets/builder.py", line 247, in __init__
info.update(self._info())
File "~/.cache/huggingface/modules/datasets_modules/datasets/cifar100/61d2489b2d4a4abc34201432541b7380984ec714e290817d9a1ee318e4b74e0f/cifar100.py", line 79, in _info
citation=_CITATION,
File "<string>", line 19, in __init__
File "~/datasets/src/datasets/info.py", line 136, in __post_init__
self.supervised_keys = SupervisedKeysData(*self.supervised_keys)
TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
```
Is there a way I can fix this?
Also, what does adding `supervised_keys` do? Is it necessary? How would I specify `supervised_keys` for a multi-input, multi-label dataset?
Thanks,
Gunjan
Thanks for adding this dataset! As far as I know `supervised_keys` is mostly a holdover from TFDS, but isn't really used, so feel free to drop it (@lhoestq or @thomwolf correct me if I'm wrong). It definitely shouldn't be blocking :) | [
0.0216592364,
-0.2712219954,
0.018145876,
0.1329571903,
0.3712171912,
0.3166499734,
0.6164790988,
-0.4762450159,
0.1994252801,
0.2660481632,
-0.2177259028,
0.1535527259,
-0.2759884596,
0.3479332328,
0.108032465,
-0.1204762161,
0.1780961454,
-0.2174015343,
0.025600791,
-0.0332674868,
-0.2215408832,
0.0074297874,
-0.2346250415,
-0.2840359211,
-0.6864251494,
-0.2522578239,
-0.3487628996,
-0.1600370407,
-0.2611854672,
-0.6842923164,
0.1742347032,
0.3276167512,
-0.1799797267,
0.4868170619,
-0.0001189697,
0.0539396182,
0.0060149985,
-0.0270138942,
-0.1315757483,
-0.0884085521,
0.0338957384,
-0.0997656062,
-0.0230807289,
-0.1876838356,
-0.0205909442,
-0.3216594458,
-0.0478543676,
-0.2678295672,
0.2622791231,
0.1708981693,
0.1447006017,
-0.1211825386,
0.3119579256,
-0.1777846813,
-0.0340043716,
0.2013509721,
-0.1293977946,
0.1572746038,
0.1325558275,
-0.1618614197,
0.4810107052,
0.2527094185,
-0.0045298152,
-0.1883503348,
0.4128496945,
-0.0407813266,
-0.1479686946,
-0.5755075216,
0.1524926871,
0.3097066581,
0.6528838873,
-0.0376972482,
-0.6485278606,
-0.1441023499,
0.3986090422,
-0.1604738533,
-0.1403427422,
0.0104317302,
-0.0038596361,
-0.2375005633,
-0.3692444563,
-0.0498813801,
-0.2118252665,
0.2764362693,
0.3331709802,
0.3576142788,
0.0522685796,
0.3509879708,
0.2702969909,
-0.0573839359,
-0.0252628792,
-0.1056550294,
0.0451552942,
0.2221504748,
-0.2898241878,
0.1726470143,
-0.0475980416,
0.1391518116,
0.1451032609,
-0.1027216315,
0.0525574982,
-0.3232677281,
-0.2117193341,
0.1196937263,
0.1027331054,
-0.0196694657,
-0.0022726313,
0.402592361,
-0.036664281,
-0.0274586752,
0.1102099642,
-0.2352029681,
-0.0683440417,
-0.1296104044,
0.3619586229,
0.187002629,
-0.1424214691,
0.1166466549,
0.0462243967,
-0.1570323408,
-0.0611529313,
-0.0322757177,
0.3567192554,
0.3096894324,
0.2346780151,
0.0138949808,
0.1058847085,
0.4291903079,
0.1078813374,
0.0548972152,
-0.1495379806,
0.3543498516,
-0.1401569098,
0.0218007732,
0.2909841537,
0.0014128905,
0.127166912,
0.320697844,
0.2556933463,
-0.1487237662,
0.0474538691,
-0.2202003002,
0.1937614679,
0.3569913507,
-0.0255857501,
0.2145911306,
-0.0456781127,
-0.3797814846,
-0.1100405678,
0.0452661887,
-0.3311828971,
-0.0257801339,
-0.0522254966,
0.0699771792,
0.1953083426,
-0.0917194709,
-0.4771168828,
0.2014684975,
0.123515971,
0.0339206606,
-0.0702253729,
-0.2045564055,
-0.2669655979,
-0.2525112629,
0.275182426,
0.4011731446,
-0.2575547099,
-0.2091663778,
-0.1150707901,
0.169390291,
-0.2034940273,
0.2128368765,
-0.2620729804,
0.4487381279,
-0.0940307006,
0.0628931373,
0.0426741652,
-0.8922803402,
-0.0666826069,
-0.0147580002,
0.0866601989,
-0.1285035014,
0.1614069045,
0.3256174326,
0.1087991223,
0.0289790705,
0.1426027119,
0.1137606576,
-0.1924499273,
-0.0482095443,
0.1788375974,
0.1565866172,
-0.1048273966,
0.3070022762,
0.2102843374,
-0.2103250027,
0.156422019,
-0.1566660106,
-0.0160317365,
-0.1635687798,
0.1207386926,
0.3795166016,
0.2092373371,
-0.0499867946,
0.0313232914,
0.03800359,
-0.4350195527,
0.4339157343,
0.295579493,
0.3049954772,
-0.1049285531,
-0.1757049859,
-0.0116094071,
0.0613492168,
-0.4852900207,
-0.1146173403,
0.0656742007,
0.2741547525,
-0.0914810151,
-0.0599609651,
0.0205958597,
0.1393008828,
0.4397168458,
0.1631941199,
0.0898365378,
0.0351097919,
-0.1254134178,
0.0317968093,
-0.0982275978,
0.0179512575,
0.4089218378,
-0.0632738099,
0.0348854735,
0.4561130702,
0.185580045,
-0.3028661907,
-0.1581850946,
0.0631941929,
0.4092924893,
-0.2760543227,
-0.2940941155,
-0.200740248,
0.2320428193,
-0.3411728442,
-0.1550139785,
0.0775262713,
-0.3345645964,
0.2867106497,
-0.0063105603,
0.1957472563,
0.1347314715,
0.1028224379,
-0.1135908738,
-0.2067492455,
0.0379192978,
-0.1822337508,
-0.0228358191,
-0.2354650646,
0.041387815,
0.0655712336,
0.0258155428,
0.0400971361,
-0.0610706024,
-0.0535846949,
0.0286563337,
0.2431070805,
0.156030938,
0.5032746792,
0.2892154157,
0.266580075,
-0.1650920808,
-0.201362595,
-0.2896964252,
0.0578937903,
0.1002950147,
-0.0812714323,
0.1857183278,
0.1985811144,
0.1882680506,
0.033480525,
-0.2237831205,
-0.4800539017,
0.3684945107,
0.1311242729,
-0.2911790907,
0.013699946,
-0.3054612875,
-0.2097307295,
-0.0478185304,
-0.2719693184,
-0.0329394229,
-0.2731937766,
0.1002846733,
0.2303827852,
0.1110884994,
0.2187399864,
0.05057339,
0.2245622277,
-0.2533394694,
0.0736533627,
-0.0290042013,
-0.1045129076,
-0.0029995681,
-0.0265574791,
0.3638056219,
-0.3310751021,
0.502433002,
0.0892854109,
-0.1429113746,
-0.2049165517,
-0.4361689389,
0.0277465824,
-0.1707714945,
0.2560726404,
0.0792689547,
-0.0453788824,
-0.1205532551,
-0.2528283298,
0.3231554627,
0.1433299184,
-0.0671825483,
-0.0222598054,
-0.2092653215,
-0.3181767464,
-0.329182148,
-0.0019012312,
-0.2415917069,
-0.0313349925,
0.1783397049,
0.0039088461,
-0.0620981306,
0.6229846478,
0.1421978325,
-0.3269358277,
0.1114382595,
0.1087917462,
-0.0204632599,
-0.3791363239,
0.2307923287,
-0.3280831873,
-0.245816052,
0.111275211,
-0.2078544199,
0.4561770856,
-0.0236301553,
-0.0742412582,
-0.0516699478,
0.0600442402,
0.0250433609,
-0.0242210031,
0.2214043438,
0.1233271658,
0.1223815829,
0.001223471,
-0.2397069782,
-0.4332716465,
0.3612815142,
-0.2303787768,
0.2302519232,
-0.3453046679,
0.2405829877,
0.0744776949,
0.2453036755,
0.00809032,
0.0415515378,
0.4380140007,
-0.2188449353,
0.3824878335,
-0.1967355907,
-0.5095447898,
0.2663564384,
0.0068041096,
0.0746749192,
-0.0564308986,
0.00251194,
-0.1534560323,
-0.1369741112,
0.4596607089,
-0.2982487679,
-0.0714151338,
-0.1395439506,
-0.061400786,
0.1793227643,
-0.1286797822,
-0.2386006713,
-0.4252120852,
-0.0979251936,
-0.3168430924,
0.0837058648,
0.0300570261,
-0.0836133882,
-0.5794292688,
-0.2799663544,
-0.2095400244,
0.0962750837,
0.201560244,
0.1998215169,
-0.2501437962,
0.3073732853,
0.0423246101,
0.0750110298,
0.6299782395,
-0.507837832,
-0.207209155,
0.4064024389,
0.0823349357,
-0.4420147836,
-0.3596887887,
-0.0637628809,
0.2939632237,
0.0598799288,
0.3375253975,
-0.3172761202,
0.1752974838,
0.1442772448,
0.0290731862,
-0.1157469526,
-0.2602498829,
-0.165069893,
-0.3463682532,
-0.2542930543,
0.0387579836,
0.2610558271,
0.2220250517,
0.0756108463,
0.055787582,
0.0451995097,
0.0471869148,
0.1067096591,
-0.0073397346,
0.0891598761,
0.599957943,
0.3521910608,
0.0442494713,
-0.2238943726,
0.5654517412,
0.499717474,
-0.3498898447,
-0.2776920795,
-0.0696076155,
-0.2492356151,
0.2417491674,
-0.0740421191,
0.2450898737,
0.207423225,
0.256608218,
0.032664407,
0.0169426724,
0.1901456267,
0.532022655,
-0.0338641517,
-0.5876458883,
-0.3630561233,
0.1882240772,
0.0840374008,
-0.0925071985,
0.390568018,
0.0355889909,
-0.3100588322,
0.2069024593,
0.1520160437,
0.7129698992,
-0.5040870309,
0.2006383687,
-0.1281061769,
-0.0514071845,
0.6691422462,
0.0259145163,
0.1060547754,
-0.1650913954,
-0.2414848655,
0.1075207144,
0.0631439537,
0.0530461781,
0.3399397731,
-0.1476924866,
0.1040078774,
-0.19961676,
0.1442143023,
-0.2286390066,
0.0942786559,
0.2413909286,
-0.3566122651,
0.315527916,
0.1148123592,
-0.0379255079,
-0.2212825418,
0.0147402799,
-0.0131456619,
-0.0485541895,
-0.2762640715,
-0.4560350776,
-0.1082492769,
-0.3264351785,
0.351482898,
-0.0545662828,
-0.0829473883,
0.0922913775,
0.3642335534,
0.6377288103,
-0.0870181471,
-0.012160317,
0.1931255311,
-0.0072708018,
-0.1853410453,
-0.4156342149,
-0.2583946288,
0.1583055556,
-0.0967746079,
-0.3491543829,
0.0630332977,
0.0483211875,
-0.2924519777,
-0.1737174988,
0.1112408638,
-0.1338453591,
0.084307164,
0.0194526818,
0.2658881545,
0.225315392,
-0.3193775415,
0.0304356385,
0.0522685423,
-0.0975164324,
0.3346410096,
-0.1579446495,
0.0292433165,
-0.0027383885,
0.3327621818,
0.0285512302,
0.2265633345,
0.4172632694,
-0.0195384845,
0.0441502444,
-0.0707633942,
-0.0785977468,
0.2807225585,
-0.3569045961,
-0.0215918384,
0.4509515762,
0.0682091713,
-0.0082825478,
0.4070377946,
0.0060868273,
0.103297323,
0.0879298374,
-0.1227887645,
-0.4140320718,
0.0571799092,
-0.40070346,
0.2787562013,
-0.0407934785,
0.447204411,
0.175511077,
0.4107344151,
-0.2010179013,
-0.0609042421,
-0.2943556607,
-0.0041193813,
0.4779884219,
0.0559544116,
-0.1362131089,
0.086593233,
0.1084027812,
-0.1853460521,
0.1712531447,
-0.0311150271,
-0.1749440283,
0.1246729568,
0.2514071167,
0.174978599,
0.0139204906,
-0.4309505522,
-0.1583897322,
-0.1143200174,
0.2133872509,
0.2629472017,
-0.0949871019,
0.3122136295,
-0.4964765906,
0.0038021572,
0.0238738135,
0.1440282762,
0.0420851074,
-0.0607592911,
0.3293672204,
0.0790249333,
0.1272111833,
-0.1499329656,
-0.348826915,
0.0482537337,
-0.4432697892,
-0.1288995594,
0.0841797218,
-0.3632189333,
0.4464633167,
0.256711781,
0.239989683,
-0.1217627227,
-0.2593410015,
0.4296594262,
0.0848013088,
0.073372215,
-0.2197785825,
-0.4196273983,
-0.0084308023,
0.023884872,
0.1413664818,
0.2538610101,
0.2197542042,
-0.0843566731,
0.0170370582,
-0.1205663309,
0.0592124648,
0.0718343109,
0.1195050031,
0.1281973422,
-0.0726764575,
0.083764419,
0.281983912,
0.2315362692,
0.0600667074,
0.1948665529,
-0.0722380057,
0.3028276265,
-0.1764682233,
-0.075714156,
0.2405504584,
-0.3558899164,
0.4976217449,
-0.1813223511,
-0.0065755444,
-0.0445874147,
-0.0960166678,
0.2008921206,
-0.2110217214,
-0.388705045,
-0.2711663544,
0.3218337297,
-0.1305861622,
-0.1066607684,
-0.1825622469,
-0.1056455523,
-0.056314297,
-0.0584492162,
0.0690639839,
-0.1914360225,
0.3167052865,
-0.1098628193,
-0.1567378193,
-0.1262353063,
-0.4305459559,
0.4618841112,
0.2834601402,
-0.2831431031,
0.2036374956,
0.3541096151,
-0.4410459697,
0.1897423565,
0.3322363198,
0.6006937623,
0.2195313424,
0.2928979397,
0.083877705,
-0.1760640889,
-0.1078900471,
0.17421332,
0.0496438853,
0.4417836666,
-0.068627432,
0.1369452029,
0.0067783301,
-0.0832348019,
0.2980148494,
0.1812418699,
0.3393848836,
-0.016795449,
-0.3750318885,
-0.0341070257,
-0.1780610234,
-0.0763005912,
0.3583649993,
-0.3215564191,
-0.0696090534,
0.2845405638,
-0.0804058909,
0.0143416319,
-0.3408435583,
0.0184786767,
0.1767685264,
0.4923864007,
0.1872955561,
0.1653290391,
-0.2372945249,
-0.123961553,
-0.5642417669,
-0.2042976916,
-0.3196800053,
-0.233751446,
-0.0577934645,
-0.0994746163,
0.3641079962,
-0.2035190761,
0.6210823059,
-0.2856464088,
0.3848316669,
0.3869747519,
-0.2538064122,
0.065770492,
0.2019011229,
0.0772046521,
0.0396992713,
-0.1581978649,
-0.0872713849,
0.036885459,
0.0007559566,
-0.1040417627,
0.1626859754,
-0.2012911886,
-0.2207448184,
0.1988333464,
0.0763102695,
0.8045889735,
-0.0558601208,
0.0646560416,
-0.1496204287,
-0.0560617931,
-0.1025547087,
0.068121098,
0.4282153249,
0.5867261887,
-0.2910676003,
-0.0661172792,
-0.0673987344,
-0.0161995739,
-0.0980610475,
-0.0475923866,
-0.2880603075,
0.3186068535,
-0.0191521775,
0.0055988738,
0.262262404,
0.2214762121,
-0.0565427169,
0.0405983403,
-0.0261391457,
-0.369487524,
0.5187730193,
-0.191469878,
-0.1348088086,
-0.1738880277,
0.0139729064,
0.0507746227,
0.1048738658,
-0.3421272039,
0.1284422278,
0.2554289699,
0.0750764459,
-0.7180346847,
0.4141144454,
-0.2150640041,
-0.0544047318,
0.0822754651,
0.0061148838,
-0.1176433042,
0.0204468723,
-0.13533324,
-0.1060191393
] |
https://github.com/huggingface/datasets/issues/1811 | Unable to add Multi-label Datasets | Thanks @yjernite @lhoestq
The template for new dataset makes it slightly confusing. I suppose the comment suggesting its update can be removed. | I am trying to add [CIFAR-100](https://www.cs.toronto.edu/~kriz/cifar.html) dataset. The dataset contains two labels per image - `fine label` and `coarse label`. Using just one label in supervised keys as
`supervised_keys=("img", "fine_label")` raises no issue. But trying `supervised_keys=("img", "fine_label","coarse_label")` leads to this error :
```python
Traceback (most recent call last):
File "test_script.py", line 2, in <module>
d = load_dataset('./datasets/cifar100')
File "~/datasets/src/datasets/load.py", line 668, in load_dataset
**config_kwargs,
File "~/datasets/src/datasets/builder.py", line 896, in __init__
super(GeneratorBasedBuilder, self).__init__(*args, **kwargs)
File "~/datasets/src/datasets/builder.py", line 247, in __init__
info.update(self._info())
File "~/.cache/huggingface/modules/datasets_modules/datasets/cifar100/61d2489b2d4a4abc34201432541b7380984ec714e290817d9a1ee318e4b74e0f/cifar100.py", line 79, in _info
citation=_CITATION,
File "<string>", line 19, in __init__
File "~/datasets/src/datasets/info.py", line 136, in __post_init__
self.supervised_keys = SupervisedKeysData(*self.supervised_keys)
TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
```
Is there a way I can fix this?
Also, what does adding `supervised_keys` do? Is it necessary? How would I specify `supervised_keys` for a multi-input, multi-label dataset?
Thanks,
Gunjan | 22 | Unable to add Multi-label Datasets
I am trying to add [CIFAR-100](https://www.cs.toronto.edu/~kriz/cifar.html) dataset. The dataset contains two labels per image - `fine label` and `coarse label`. Using just one label in supervised keys as
`supervised_keys=("img", "fine_label")` raises no issue. But trying `supervised_keys=("img", "fine_label","coarse_label")` leads to this error :
```python
Traceback (most recent call last):
File "test_script.py", line 2, in <module>
d = load_dataset('./datasets/cifar100')
File "~/datasets/src/datasets/load.py", line 668, in load_dataset
**config_kwargs,
File "~/datasets/src/datasets/builder.py", line 896, in __init__
super(GeneratorBasedBuilder, self).__init__(*args, **kwargs)
File "~/datasets/src/datasets/builder.py", line 247, in __init__
info.update(self._info())
File "~/.cache/huggingface/modules/datasets_modules/datasets/cifar100/61d2489b2d4a4abc34201432541b7380984ec714e290817d9a1ee318e4b74e0f/cifar100.py", line 79, in _info
citation=_CITATION,
File "<string>", line 19, in __init__
File "~/datasets/src/datasets/info.py", line 136, in __post_init__
self.supervised_keys = SupervisedKeysData(*self.supervised_keys)
TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
```
Is there a way I can fix this?
Also, what does adding `supervised_keys` do? Is it necessary? How would I specify `supervised_keys` for a multi-input, multi-label dataset?
Thanks,
Gunjan
Thanks @yjernite @lhoestq
The template for new dataset makes it slightly confusing. I suppose the comment suggesting its update can be removed. | [
0.0216592364,
-0.2712219954,
0.018145876,
0.1329571903,
0.3712171912,
0.3166499734,
0.6164790988,
-0.4762450159,
0.1994252801,
0.2660481632,
-0.2177259028,
0.1535527259,
-0.2759884596,
0.3479332328,
0.108032465,
-0.1204762161,
0.1780961454,
-0.2174015343,
0.025600791,
-0.0332674868,
-0.2215408832,
0.0074297874,
-0.2346250415,
-0.2840359211,
-0.6864251494,
-0.2522578239,
-0.3487628996,
-0.1600370407,
-0.2611854672,
-0.6842923164,
0.1742347032,
0.3276167512,
-0.1799797267,
0.4868170619,
-0.0001189697,
0.0539396182,
0.0060149985,
-0.0270138942,
-0.1315757483,
-0.0884085521,
0.0338957384,
-0.0997656062,
-0.0230807289,
-0.1876838356,
-0.0205909442,
-0.3216594458,
-0.0478543676,
-0.2678295672,
0.2622791231,
0.1708981693,
0.1447006017,
-0.1211825386,
0.3119579256,
-0.1777846813,
-0.0340043716,
0.2013509721,
-0.1293977946,
0.1572746038,
0.1325558275,
-0.1618614197,
0.4810107052,
0.2527094185,
-0.0045298152,
-0.1883503348,
0.4128496945,
-0.0407813266,
-0.1479686946,
-0.5755075216,
0.1524926871,
0.3097066581,
0.6528838873,
-0.0376972482,
-0.6485278606,
-0.1441023499,
0.3986090422,
-0.1604738533,
-0.1403427422,
0.0104317302,
-0.0038596361,
-0.2375005633,
-0.3692444563,
-0.0498813801,
-0.2118252665,
0.2764362693,
0.3331709802,
0.3576142788,
0.0522685796,
0.3509879708,
0.2702969909,
-0.0573839359,
-0.0252628792,
-0.1056550294,
0.0451552942,
0.2221504748,
-0.2898241878,
0.1726470143,
-0.0475980416,
0.1391518116,
0.1451032609,
-0.1027216315,
0.0525574982,
-0.3232677281,
-0.2117193341,
0.1196937263,
0.1027331054,
-0.0196694657,
-0.0022726313,
0.402592361,
-0.036664281,
-0.0274586752,
0.1102099642,
-0.2352029681,
-0.0683440417,
-0.1296104044,
0.3619586229,
0.187002629,
-0.1424214691,
0.1166466549,
0.0462243967,
-0.1570323408,
-0.0611529313,
-0.0322757177,
0.3567192554,
0.3096894324,
0.2346780151,
0.0138949808,
0.1058847085,
0.4291903079,
0.1078813374,
0.0548972152,
-0.1495379806,
0.3543498516,
-0.1401569098,
0.0218007732,
0.2909841537,
0.0014128905,
0.127166912,
0.320697844,
0.2556933463,
-0.1487237662,
0.0474538691,
-0.2202003002,
0.1937614679,
0.3569913507,
-0.0255857501,
0.2145911306,
-0.0456781127,
-0.3797814846,
-0.1100405678,
0.0452661887,
-0.3311828971,
-0.0257801339,
-0.0522254966,
0.0699771792,
0.1953083426,
-0.0917194709,
-0.4771168828,
0.2014684975,
0.123515971,
0.0339206606,
-0.0702253729,
-0.2045564055,
-0.2669655979,
-0.2525112629,
0.275182426,
0.4011731446,
-0.2575547099,
-0.2091663778,
-0.1150707901,
0.169390291,
-0.2034940273,
0.2128368765,
-0.2620729804,
0.4487381279,
-0.0940307006,
0.0628931373,
0.0426741652,
-0.8922803402,
-0.0666826069,
-0.0147580002,
0.0866601989,
-0.1285035014,
0.1614069045,
0.3256174326,
0.1087991223,
0.0289790705,
0.1426027119,
0.1137606576,
-0.1924499273,
-0.0482095443,
0.1788375974,
0.1565866172,
-0.1048273966,
0.3070022762,
0.2102843374,
-0.2103250027,
0.156422019,
-0.1566660106,
-0.0160317365,
-0.1635687798,
0.1207386926,
0.3795166016,
0.2092373371,
-0.0499867946,
0.0313232914,
0.03800359,
-0.4350195527,
0.4339157343,
0.295579493,
0.3049954772,
-0.1049285531,
-0.1757049859,
-0.0116094071,
0.0613492168,
-0.4852900207,
-0.1146173403,
0.0656742007,
0.2741547525,
-0.0914810151,
-0.0599609651,
0.0205958597,
0.1393008828,
0.4397168458,
0.1631941199,
0.0898365378,
0.0351097919,
-0.1254134178,
0.0317968093,
-0.0982275978,
0.0179512575,
0.4089218378,
-0.0632738099,
0.0348854735,
0.4561130702,
0.185580045,
-0.3028661907,
-0.1581850946,
0.0631941929,
0.4092924893,
-0.2760543227,
-0.2940941155,
-0.200740248,
0.2320428193,
-0.3411728442,
-0.1550139785,
0.0775262713,
-0.3345645964,
0.2867106497,
-0.0063105603,
0.1957472563,
0.1347314715,
0.1028224379,
-0.1135908738,
-0.2067492455,
0.0379192978,
-0.1822337508,
-0.0228358191,
-0.2354650646,
0.041387815,
0.0655712336,
0.0258155428,
0.0400971361,
-0.0610706024,
-0.0535846949,
0.0286563337,
0.2431070805,
0.156030938,
0.5032746792,
0.2892154157,
0.266580075,
-0.1650920808,
-0.201362595,
-0.2896964252,
0.0578937903,
0.1002950147,
-0.0812714323,
0.1857183278,
0.1985811144,
0.1882680506,
0.033480525,
-0.2237831205,
-0.4800539017,
0.3684945107,
0.1311242729,
-0.2911790907,
0.013699946,
-0.3054612875,
-0.2097307295,
-0.0478185304,
-0.2719693184,
-0.0329394229,
-0.2731937766,
0.1002846733,
0.2303827852,
0.1110884994,
0.2187399864,
0.05057339,
0.2245622277,
-0.2533394694,
0.0736533627,
-0.0290042013,
-0.1045129076,
-0.0029995681,
-0.0265574791,
0.3638056219,
-0.3310751021,
0.502433002,
0.0892854109,
-0.1429113746,
-0.2049165517,
-0.4361689389,
0.0277465824,
-0.1707714945,
0.2560726404,
0.0792689547,
-0.0453788824,
-0.1205532551,
-0.2528283298,
0.3231554627,
0.1433299184,
-0.0671825483,
-0.0222598054,
-0.2092653215,
-0.3181767464,
-0.329182148,
-0.0019012312,
-0.2415917069,
-0.0313349925,
0.1783397049,
0.0039088461,
-0.0620981306,
0.6229846478,
0.1421978325,
-0.3269358277,
0.1114382595,
0.1087917462,
-0.0204632599,
-0.3791363239,
0.2307923287,
-0.3280831873,
-0.245816052,
0.111275211,
-0.2078544199,
0.4561770856,
-0.0236301553,
-0.0742412582,
-0.0516699478,
0.0600442402,
0.0250433609,
-0.0242210031,
0.2214043438,
0.1233271658,
0.1223815829,
0.001223471,
-0.2397069782,
-0.4332716465,
0.3612815142,
-0.2303787768,
0.2302519232,
-0.3453046679,
0.2405829877,
0.0744776949,
0.2453036755,
0.00809032,
0.0415515378,
0.4380140007,
-0.2188449353,
0.3824878335,
-0.1967355907,
-0.5095447898,
0.2663564384,
0.0068041096,
0.0746749192,
-0.0564308986,
0.00251194,
-0.1534560323,
-0.1369741112,
0.4596607089,
-0.2982487679,
-0.0714151338,
-0.1395439506,
-0.061400786,
0.1793227643,
-0.1286797822,
-0.2386006713,
-0.4252120852,
-0.0979251936,
-0.3168430924,
0.0837058648,
0.0300570261,
-0.0836133882,
-0.5794292688,
-0.2799663544,
-0.2095400244,
0.0962750837,
0.201560244,
0.1998215169,
-0.2501437962,
0.3073732853,
0.0423246101,
0.0750110298,
0.6299782395,
-0.507837832,
-0.207209155,
0.4064024389,
0.0823349357,
-0.4420147836,
-0.3596887887,
-0.0637628809,
0.2939632237,
0.0598799288,
0.3375253975,
-0.3172761202,
0.1752974838,
0.1442772448,
0.0290731862,
-0.1157469526,
-0.2602498829,
-0.165069893,
-0.3463682532,
-0.2542930543,
0.0387579836,
0.2610558271,
0.2220250517,
0.0756108463,
0.055787582,
0.0451995097,
0.0471869148,
0.1067096591,
-0.0073397346,
0.0891598761,
0.599957943,
0.3521910608,
0.0442494713,
-0.2238943726,
0.5654517412,
0.499717474,
-0.3498898447,
-0.2776920795,
-0.0696076155,
-0.2492356151,
0.2417491674,
-0.0740421191,
0.2450898737,
0.207423225,
0.256608218,
0.032664407,
0.0169426724,
0.1901456267,
0.532022655,
-0.0338641517,
-0.5876458883,
-0.3630561233,
0.1882240772,
0.0840374008,
-0.0925071985,
0.390568018,
0.0355889909,
-0.3100588322,
0.2069024593,
0.1520160437,
0.7129698992,
-0.5040870309,
0.2006383687,
-0.1281061769,
-0.0514071845,
0.6691422462,
0.0259145163,
0.1060547754,
-0.1650913954,
-0.2414848655,
0.1075207144,
0.0631439537,
0.0530461781,
0.3399397731,
-0.1476924866,
0.1040078774,
-0.19961676,
0.1442143023,
-0.2286390066,
0.0942786559,
0.2413909286,
-0.3566122651,
0.315527916,
0.1148123592,
-0.0379255079,
-0.2212825418,
0.0147402799,
-0.0131456619,
-0.0485541895,
-0.2762640715,
-0.4560350776,
-0.1082492769,
-0.3264351785,
0.351482898,
-0.0545662828,
-0.0829473883,
0.0922913775,
0.3642335534,
0.6377288103,
-0.0870181471,
-0.012160317,
0.1931255311,
-0.0072708018,
-0.1853410453,
-0.4156342149,
-0.2583946288,
0.1583055556,
-0.0967746079,
-0.3491543829,
0.0630332977,
0.0483211875,
-0.2924519777,
-0.1737174988,
0.1112408638,
-0.1338453591,
0.084307164,
0.0194526818,
0.2658881545,
0.225315392,
-0.3193775415,
0.0304356385,
0.0522685423,
-0.0975164324,
0.3346410096,
-0.1579446495,
0.0292433165,
-0.0027383885,
0.3327621818,
0.0285512302,
0.2265633345,
0.4172632694,
-0.0195384845,
0.0441502444,
-0.0707633942,
-0.0785977468,
0.2807225585,
-0.3569045961,
-0.0215918384,
0.4509515762,
0.0682091713,
-0.0082825478,
0.4070377946,
0.0060868273,
0.103297323,
0.0879298374,
-0.1227887645,
-0.4140320718,
0.0571799092,
-0.40070346,
0.2787562013,
-0.0407934785,
0.447204411,
0.175511077,
0.4107344151,
-0.2010179013,
-0.0609042421,
-0.2943556607,
-0.0041193813,
0.4779884219,
0.0559544116,
-0.1362131089,
0.086593233,
0.1084027812,
-0.1853460521,
0.1712531447,
-0.0311150271,
-0.1749440283,
0.1246729568,
0.2514071167,
0.174978599,
0.0139204906,
-0.4309505522,
-0.1583897322,
-0.1143200174,
0.2133872509,
0.2629472017,
-0.0949871019,
0.3122136295,
-0.4964765906,
0.0038021572,
0.0238738135,
0.1440282762,
0.0420851074,
-0.0607592911,
0.3293672204,
0.0790249333,
0.1272111833,
-0.1499329656,
-0.348826915,
0.0482537337,
-0.4432697892,
-0.1288995594,
0.0841797218,
-0.3632189333,
0.4464633167,
0.256711781,
0.239989683,
-0.1217627227,
-0.2593410015,
0.4296594262,
0.0848013088,
0.073372215,
-0.2197785825,
-0.4196273983,
-0.0084308023,
0.023884872,
0.1413664818,
0.2538610101,
0.2197542042,
-0.0843566731,
0.0170370582,
-0.1205663309,
0.0592124648,
0.0718343109,
0.1195050031,
0.1281973422,
-0.0726764575,
0.083764419,
0.281983912,
0.2315362692,
0.0600667074,
0.1948665529,
-0.0722380057,
0.3028276265,
-0.1764682233,
-0.075714156,
0.2405504584,
-0.3558899164,
0.4976217449,
-0.1813223511,
-0.0065755444,
-0.0445874147,
-0.0960166678,
0.2008921206,
-0.2110217214,
-0.388705045,
-0.2711663544,
0.3218337297,
-0.1305861622,
-0.1066607684,
-0.1825622469,
-0.1056455523,
-0.056314297,
-0.0584492162,
0.0690639839,
-0.1914360225,
0.3167052865,
-0.1098628193,
-0.1567378193,
-0.1262353063,
-0.4305459559,
0.4618841112,
0.2834601402,
-0.2831431031,
0.2036374956,
0.3541096151,
-0.4410459697,
0.1897423565,
0.3322363198,
0.6006937623,
0.2195313424,
0.2928979397,
0.083877705,
-0.1760640889,
-0.1078900471,
0.17421332,
0.0496438853,
0.4417836666,
-0.068627432,
0.1369452029,
0.0067783301,
-0.0832348019,
0.2980148494,
0.1812418699,
0.3393848836,
-0.016795449,
-0.3750318885,
-0.0341070257,
-0.1780610234,
-0.0763005912,
0.3583649993,
-0.3215564191,
-0.0696090534,
0.2845405638,
-0.0804058909,
0.0143416319,
-0.3408435583,
0.0184786767,
0.1767685264,
0.4923864007,
0.1872955561,
0.1653290391,
-0.2372945249,
-0.123961553,
-0.5642417669,
-0.2042976916,
-0.3196800053,
-0.233751446,
-0.0577934645,
-0.0994746163,
0.3641079962,
-0.2035190761,
0.6210823059,
-0.2856464088,
0.3848316669,
0.3869747519,
-0.2538064122,
0.065770492,
0.2019011229,
0.0772046521,
0.0396992713,
-0.1581978649,
-0.0872713849,
0.036885459,
0.0007559566,
-0.1040417627,
0.1626859754,
-0.2012911886,
-0.2207448184,
0.1988333464,
0.0763102695,
0.8045889735,
-0.0558601208,
0.0646560416,
-0.1496204287,
-0.0560617931,
-0.1025547087,
0.068121098,
0.4282153249,
0.5867261887,
-0.2910676003,
-0.0661172792,
-0.0673987344,
-0.0161995739,
-0.0980610475,
-0.0475923866,
-0.2880603075,
0.3186068535,
-0.0191521775,
0.0055988738,
0.262262404,
0.2214762121,
-0.0565427169,
0.0405983403,
-0.0261391457,
-0.369487524,
0.5187730193,
-0.191469878,
-0.1348088086,
-0.1738880277,
0.0139729064,
0.0507746227,
0.1048738658,
-0.3421272039,
0.1284422278,
0.2554289699,
0.0750764459,
-0.7180346847,
0.4141144454,
-0.2150640041,
-0.0544047318,
0.0822754651,
0.0061148838,
-0.1176433042,
0.0204468723,
-0.13533324,
-0.1060191393
] |
https://github.com/huggingface/datasets/issues/1810 | Add Hateful Memes Dataset | Hi @gchhablani since Array2D doesn't support images of different sizes, I would suggest to store in the dataset the paths to the image file instead of the image data. This has the advantage of not decompressing the data (images are often compressed using jpeg, png etc.). Users can still apply `.map` to load the images if they want to. Though it would en up being Sequences features.
In the future we'll add support for ragged tensors for this case and update the relevant dataset with this feature. | ## Add Hateful Memes Dataset
- **Name:** Hateful Memes
- **Description:** [https://ai.facebook.com/blog/hateful-memes-challenge-and-data-set]( https://ai.facebook.com/blog/hateful-memes-challenge-and-data-set)
- **Paper:** [https://arxiv.org/pdf/2005.04790.pdf](https://arxiv.org/pdf/2005.04790.pdf)
- **Data:** [This link](https://drivendata-competition-fb-hateful-memes-data.s3.amazonaws.com/XjiOc5ycDBRRNwbhRlgH.zip?AWSAccessKeyId=AKIARVBOBDCY4MWEDJKS&Signature=DaUuGgZWUgDHzEPPbyJ2PhSJ56Q%3D&Expires=1612816874)
- **Motivation:** Including multi-modal datasets to π€ datasets.
I will be adding this dataset. It requires the user to sign an agreement on DrivenData. So, it will be used with a manual download.
The issue with this dataset is that the images are of different sizes. The image datasets added so far (CIFAR-10 and MNIST) have a uniform shape throughout.
So something like
```python
datasets.Array2D(shape=(28, 28), dtype="uint8")
```
won't work for the images. How would I add image features then? I checked `datasets/features.py` but couldn't figure out the appropriate class for this. I'm assuming I would want to avoid re-sizing at all since we want the user to be able to access the original images.
Also, in case I want to load only a subset of the data, since the actual data is around 8.8GB, how would that be possible?
Thanks,
Gunjan | 87 | Add Hateful Memes Dataset
## Add Hateful Memes Dataset
- **Name:** Hateful Memes
- **Description:** [https://ai.facebook.com/blog/hateful-memes-challenge-and-data-set]( https://ai.facebook.com/blog/hateful-memes-challenge-and-data-set)
- **Paper:** [https://arxiv.org/pdf/2005.04790.pdf](https://arxiv.org/pdf/2005.04790.pdf)
- **Data:** [This link](https://drivendata-competition-fb-hateful-memes-data.s3.amazonaws.com/XjiOc5ycDBRRNwbhRlgH.zip?AWSAccessKeyId=AKIARVBOBDCY4MWEDJKS&Signature=DaUuGgZWUgDHzEPPbyJ2PhSJ56Q%3D&Expires=1612816874)
- **Motivation:** Including multi-modal datasets to π€ datasets.
I will be adding this dataset. It requires the user to sign an agreement on DrivenData. So, it will be used with a manual download.
The issue with this dataset is that the images are of different sizes. The image datasets added so far (CIFAR-10 and MNIST) have a uniform shape throughout.
So something like
```python
datasets.Array2D(shape=(28, 28), dtype="uint8")
```
won't work for the images. How would I add image features then? I checked `datasets/features.py` but couldn't figure out the appropriate class for this. I'm assuming I would want to avoid re-sizing at all since we want the user to be able to access the original images.
Also, in case I want to load only a subset of the data, since the actual data is around 8.8GB, how would that be possible?
Thanks,
Gunjan
Hi @gchhablani since Array2D doesn't support images of different sizes, I would suggest to store in the dataset the paths to the image file instead of the image data. This has the advantage of not decompressing the data (images are often compressed using jpeg, png etc.). Users can still apply `.map` to load the images if they want to. Though it would en up being Sequences features.
In the future we'll add support for ragged tensors for this case and update the relevant dataset with this feature. | [
-0.2504214346,
0.1592068225,
-0.1446142346,
0.0486406796,
0.1048058197,
0.2664601803,
0.4449888766,
-0.073212333,
-0.0832346678,
-0.2253455967,
-0.0230499022,
-0.2821848691,
-0.5021378398,
0.247500807,
0.015648948,
-0.1245205775,
0.0323908478,
0.0315233804,
-0.1846613586,
-0.0556139797,
-0.0390982963,
-0.1718229204,
0.1833569407,
-0.2621172071,
-0.572902441,
-0.0794125721,
-0.2922711372,
0.274302721,
-0.1746700257,
-0.4757303894,
0.0342118293,
0.366872251,
0.1425359994,
0.5114074349,
-0.0001180375,
0.0613288358,
-0.0814563334,
-0.1974322051,
0.0460135266,
0.0979809985,
0.0788961127,
-0.5317851901,
-0.1205243021,
-0.2593846619,
0.1425027996,
-0.4997735918,
0.207667172,
-0.0505464263,
0.6721631289,
-0.000518229,
0.1403405517,
-0.1678139716,
0.2236773968,
-0.0295419786,
0.0302441567,
0.7310447097,
-0.0535114594,
-0.2448932976,
0.0850690156,
0.1053892225,
0.2414757311,
0.2661067843,
-0.1824456304,
0.0981592536,
0.4686677456,
-0.1495055556,
-0.0850304663,
-0.3651394844,
0.0692546144,
0.3533003926,
0.3158091009,
-0.1157739237,
-0.2830894589,
-0.4789533019,
-0.0519869626,
0.0470750593,
-0.0973816663,
0.2933700979,
-0.0024280325,
-0.0083625466,
-0.4078708291,
-0.1113791689,
-0.3908489943,
0.4031020403,
-0.0128044998,
-0.1113747805,
0.0441608354,
0.3313262165,
-0.0470419191,
-0.3176803589,
-0.0503535233,
-0.0321194567,
0.3344109952,
0.2942707837,
0.2471241504,
0.0357243344,
-0.2338343561,
-0.2644750476,
0.4943547845,
-0.2746841013,
-0.0365184695,
-0.0611693673,
-0.5127972364,
-0.1091964766,
0.1728675514,
-0.2186560631,
-0.4133867323,
0.2884224951,
0.1423450857,
0.0239076018,
-0.0680185109,
-0.0000660008,
-0.1721002162,
0.085260056,
-0.0206122324,
-0.0413674824,
0.2201976776,
0.0065692062,
-0.2225714475,
-0.223670423,
0.1090389341,
0.0613115318,
-0.0797584057,
0.1821875721,
0.0928370878,
-0.0467921868,
-0.0691648051,
0.2312923968,
0.0642930716,
-0.1113332361,
-0.1213240623,
-0.0465074107,
-0.0835092366,
0.2189406604,
0.3173373044,
0.4066414833,
0.3729762435,
-0.0502353124,
0.0361437723,
0.1877488047,
0.1703288257,
-0.153627947,
0.2397408187,
0.1025631651,
0.1239589155,
-0.044304207,
-0.0259082075,
0.1373511702,
-0.1783611029,
0.1234838516,
-0.2965263426,
-0.0349517874,
-0.0787501633,
0.0607704744,
-0.3073104322,
0.1393745989,
-0.095275417,
0.3325942457,
0.0445988551,
-0.0998571068,
0.0798220634,
-0.0691165999,
-0.2916133702,
-0.4136888683,
0.073145628,
0.5717694759,
-0.4198010564,
-0.038867861,
-0.2598007321,
0.0048770956,
-0.3514773846,
0.1411675066,
-0.073846221,
0.080482997,
-0.1422957629,
-0.0395542383,
0.1971671134,
-0.1646538079,
-0.2917402685,
0.1448027343,
0.0503730848,
0.2691357732,
0.199737072,
0.4102456272,
0.167988047,
-0.0923596472,
-0.0039955745,
0.6235696077,
-0.2270170301,
-0.0232372917,
0.2167758644,
-0.4549305439,
0.0900896043,
0.3774318099,
0.3031719029,
-0.2699359953,
0.3662008941,
-0.0529147536,
0.1597317159,
-0.2786394358,
0.1843121201,
0.0729181394,
0.3280516863,
0.0044644931,
0.0812784806,
-0.1909702569,
-0.58328408,
0.2914874554,
-0.1301624477,
-0.2425612807,
-0.1890537441,
-0.0745364502,
-0.2226566672,
-0.1695445329,
-0.5431597233,
-0.1439876556,
0.080965206,
0.0673680082,
0.1173335165,
-0.0855123028,
-0.1075574458,
0.3108454347,
0.0377637334,
0.0376631469,
0.0759400204,
0.3562741876,
0.2526933551,
-0.2590899467,
-0.155034855,
0.1933310181,
-0.0770662576,
-0.277697891,
0.0310585871,
0.465775609,
0.2533088624,
0.1999029964,
-0.0602826476,
0.5921088457,
0.3864940703,
-0.4306572974,
0.424651891,
0.298119545,
0.1676471233,
-0.1962485015,
-0.144814834,
0.4161930382,
-0.1086042225,
0.0944966972,
-0.0901602507,
-0.1568719447,
0.1208517104,
0.1988418698,
-0.069734931,
-0.4860264063,
-0.137558192,
0.3124350905,
-0.035283193,
-0.0333196931,
0.0816608146,
-0.0311005041,
0.1444078982,
0.1584202051,
0.195087865,
0.117477946,
-0.2045091987,
0.2176681012,
0.11602474,
-0.0820591673,
0.5058943629,
0.2438028902,
-0.2884394526,
0.1893194765,
0.0441548154,
0.070334591,
-0.0591772757,
0.0718807802,
0.1592857242,
0.1814648658,
0.292396307,
-0.0972119719,
-0.293505162,
-0.3649152517,
-0.046410311,
-0.1391709298,
0.0285091624,
-0.2159312069,
-0.1760034114,
-0.0752427354,
-0.177173093,
0.06190034,
-0.2731125951,
0.3103002906,
0.2432677895,
-0.0844476148,
-0.0076462482,
0.0986702517,
-0.179038763,
0.4522791505,
0.190300405,
-0.1124388799,
0.2018893212,
0.2738089859,
-0.1722246706,
0.0234750248,
0.3414863646,
0.0180949196,
0.3103944659,
-0.2085750401,
0.2875605524,
-0.3016795814,
-0.5269960761,
-0.0177561026,
-0.1278627366,
0.4184363186,
0.1583189964,
0.0569809526,
0.1466145664,
-0.0490891412,
0.254594028,
0.0839700177,
-0.1261508167,
-0.3579853475,
-0.3124555945,
-0.1176280901,
0.0876335725,
0.1875388026,
-0.2937674522,
-0.2434358448,
0.4645287097,
0.5125319958,
0.1423605084,
0.2152912617,
0.5227332115,
-0.1563183069,
0.1688376069,
0.2114793658,
-0.0623734482,
-0.0816044956,
0.4824645817,
-0.2617920339,
-0.2787493467,
-0.001184236,
-0.2005171329,
-0.2126511186,
0.3634602427,
-0.4871138632,
-0.1780947596,
-0.1202251315,
0.1878045052,
0.032054022,
-0.0260778535,
0.0824710876,
-0.0281691924,
0.1132402346,
-0.0663224161,
-0.0998322293,
0.0764130205,
0.3912822306,
0.2211258113,
0.089154847,
-0.0360581353,
0.2834276557,
0.4973534346,
0.0504421331,
-0.0778695494,
0.4475951195,
0.0592902526,
0.2628367245,
-0.0026231452,
-0.3571561873,
0.3998302519,
0.1978181303,
-0.1814903766,
0.1413679272,
0.1234124303,
0.0140402317,
0.0465475544,
0.3846581876,
-0.1950739622,
-0.150194481,
0.2425004542,
0.0356560238,
0.2080598921,
-0.2231538892,
-0.2774918377,
-0.7103013396,
-0.2136515081,
0.0608368106,
0.241923824,
-0.2063892931,
0.2661418915,
-0.6109215617,
-0.0451592021,
0.1607519239,
0.3234852254,
0.1610219926,
0.0686574206,
-0.1207006201,
-0.0736890808,
-0.0431584753,
0.0290514603,
0.7224550843,
0.0184897352,
-0.3272473514,
-0.0201019067,
0.2369354963,
-0.3815586865,
-0.2712814808,
0.1092840731,
-0.0826964751,
-0.1491670012,
0.6568528414,
-0.2573142052,
0.0512711257,
0.2450478226,
0.3219651282,
-0.1487639695,
-0.2222959846,
-0.0937420651,
-0.3714406788,
-0.4741391838,
-0.1325507611,
0.1794003248,
0.0563346446,
0.1760861129,
-0.4480548799,
-0.0918849036,
-0.1943969578,
0.1649778336,
0.1058012173,
0.0951879844,
0.2612834871,
-0.0345724486,
0.1756409407,
-0.1584342569,
0.2575207949,
0.3741611242,
0.0439131744,
-0.1428475678,
0.0949463695,
-0.1685842872,
0.1172894239,
0.4597494304,
0.2344308048,
-0.2063052207,
0.0265829116,
-0.077354975,
-0.1809723973,
0.4501096308,
0.141269654,
-0.2658029497,
-0.0244551599,
-0.5977190733,
0.1939567477,
0.1625720263,
0.03873365,
0.0833346173,
-0.1662769765,
-0.2910216451,
0.3688751459,
0.4148889482,
0.8890542388,
-0.1004759818,
0.3690147698,
-0.1744821221,
0.187228933,
0.029185418,
-0.2127094567,
-0.2151516229,
0.1023071557,
0.0166736618,
-0.1287180185,
-0.0617996193,
0.3094147444,
0.2182047665,
0.1082589477,
0.0370075181,
0.1305920184,
0.1451582909,
-0.0833367705,
0.1909998208,
-0.291030407,
-0.3754472733,
-0.0224433932,
0.0718092769,
0.0025822655,
-0.0975055248,
-0.1028367504,
-0.1750884801,
-0.1285844743,
-0.0624644198,
-0.313939482,
-0.4170058072,
-0.6177828908,
0.3116015196,
0.095915094,
-0.1583430022,
-0.0477428809,
0.4364583492,
0.2387738377,
-0.0216690656,
-0.0999174863,
0.1813479662,
0.1393330842,
0.0159073342,
-0.3843264282,
-0.4722926617,
0.3890895247,
-0.0097457068,
-0.0883991048,
0.040819332,
0.18522273,
-0.0622622855,
-0.6213223934,
-0.1009948254,
0.3510935009,
-0.2371732295,
-0.3729327917,
-0.046039056,
0.0845939294,
-0.0351508968,
0.0482118465,
0.1355675161,
0.0513293073,
0.2593280673,
0.2925769091,
-0.1346600205,
0.0144938529,
0.0537605658,
0.1415532678,
-0.2485700399,
0.3979209661,
0.0191126745,
0.2050876766,
-0.1009723768,
0.4004034698,
0.2464225441,
-0.2275556624,
0.0301118549,
0.055887688,
-0.0923079848,
-0.3010914028,
0.1867815256,
0.304751128,
0.1123450547,
0.1786675453,
-0.4206005335,
-0.3385639489,
0.3300172687,
-0.0448726863,
0.3595154881,
-0.0959176123,
0.2453263849,
-0.1896498501,
0.2075490057,
-0.2435892969,
0.2797914743,
0.0342172459,
0.0165742338,
0.013361427,
-0.0864680409,
-0.3129187226,
0.186913833,
0.0548303872,
-0.008456137,
-0.4545390904,
-0.0819848925,
-0.1728127748,
0.2163760513,
0.1508248895,
-0.1186474785,
0.0461592823,
-0.3085321784,
-0.0792781711,
-0.0771323293,
0.1993966848,
-0.1210664809,
-0.3016907573,
-0.0212106891,
-0.2817973495,
-0.0210442133,
-0.0050855828,
0.1918304712,
0.0055683651,
0.0947468355,
0.4647139013,
0.4612269104,
-0.0899203196,
-0.0705758035,
0.1159429923,
0.2631660402,
0.1321069598,
0.0130429724,
0.2711666226,
-0.2114790976,
0.1537316144,
0.1622493565,
0.0216146708,
0.3007538319,
-0.3699853122,
0.1090489775,
0.2009073347,
0.121393621,
-0.2129844874,
0.1097906977,
0.433789283,
-0.0872264132,
0.1015937328,
0.3715549707,
0.3916653991,
0.2633986473,
-0.2922075093,
0.1028848886,
0.255181551,
0.0022373782,
0.048315037,
0.1876872182,
-0.302691251,
0.0690412819,
0.1746184081,
0.444933176,
0.2387215942,
0.5049598813,
-0.3436604738,
0.4133916199,
0.11043863,
-0.1653071493,
0.2926426828,
-0.514285326,
0.2334798723,
0.322068423,
0.1003447175,
0.4405693114,
-0.1411520541,
0.1429874599,
-0.0843479484,
-0.3823217154,
-0.1536344439,
0.1817496121,
0.2389144152,
-0.1287263781,
-0.3973867297,
-0.3295616508,
-0.5255419016,
-0.0513874888,
-0.0321119167,
-0.57790941,
0.1415555477,
-0.1235465035,
-0.1133025438,
-0.3197177649,
0.0532001369,
0.2641003132,
0.0214330088,
-0.3121997714,
0.2355463207,
0.4401598871,
-0.0962105617,
0.2448839992,
-0.0619920343,
0.2725957334,
0.1712175757,
-0.2464678884,
0.2377242893,
-0.1022486985,
-0.2724086344,
-0.1546004862,
0.1053096727,
0.0545737259,
0.3160357177,
0.1064423993,
0.064245373,
-0.1034050286,
-0.2114146054,
-0.1423080266,
-0.0897924155,
-0.4951947033,
-0.1446511745,
-0.1938594133,
-0.1958302557,
-0.0647404417,
0.056684725,
-0.4392281473,
-0.6049895883,
0.4906970561,
-0.5163567066,
0.2248383313,
-0.0296898093,
0.0092393747,
-0.4217176437,
0.0520846471,
0.3018874824,
-0.0143103153,
0.0345556438,
-0.0447394252,
-0.384090364,
0.1674563736,
-0.2783687413,
-0.2578517795,
-0.0539680049,
0.2680947483,
0.2295307815,
0.0208569393,
0.3160776198,
-0.1001036018,
0.0873316452,
0.2617769241,
-0.2485550344,
0.0713349432,
0.1462795287,
0.5599986315,
0.0346908085,
-0.0936443284,
0.0408401117,
0.0030867653,
-0.0220299922,
-0.1176197305,
-0.175127849,
0.0550968759,
-0.3370946348,
0.3505986035,
0.0402446352,
0.1881271899,
-0.0477155,
-0.0568388514,
-0.367163986,
0.142049104,
-0.0202488154,
-0.0100384969,
0.154393658,
0.723508358,
-0.3094787896,
0.2260929495,
-0.0420954078,
0.3157183826,
0.0397890098,
-0.3485493362,
-0.0814390853,
0.3176932335,
-0.2902961373,
0.0474669188,
0.1136439964,
0.2330193669,
-0.0386278816,
-0.1395374835,
0.3328945041,
-0.3573354185,
0.4361349642,
-0.1375584602,
-0.4307521582,
0.0136344498,
-0.0708094016,
0.0960581154,
0.4268598258,
-0.2791134417,
0.2198582441,
0.3455356956,
0.0700151846,
-0.0514797904,
0.3274361193,
-0.0098307533,
-0.4515476823,
-0.0036138934,
0.1303825527,
-0.3480065465,
-0.212998867,
-0.0162920225,
-0.3059487343
] |
https://github.com/huggingface/datasets/issues/1808 | writing Datasets in a human readable format | AFAIK, there is currently no built-in method on the `Dataset` object to do this.
However, a workaround is to directly use the Arrow table backing the dataset, **but it implies loading the whole dataset in memory** (correct me if I'm mistaken @lhoestq).
You can convert the Arrow table to a pandas dataframe to save the data as csv as follows:
```python
arrow_table = dataset.data
dataframe = arrow_table.to_pandas()
dataframe.to_csv("/path/to/file.csv")
```
Similarly, you can convert the dataset to a Python dict and save it as JSON:
```python
import json
arrow_table = dataset.data
py_dict = arrow_table.to_pydict()
with open("/path/to/file.json", "w+") as f:
json.dump(py_dict, f)
``` | Hi
I see there is a save_to_disk function to save data, but this is not human readable format, is there a way I could save a Dataset object in a human readable format to a file like json? thanks @lhoestq | 101 | writing Datasets in a human readable format
Hi
I see there is a save_to_disk function to save data, but this is not human readable format, is there a way I could save a Dataset object in a human readable format to a file like json? thanks @lhoestq
AFAIK, there is currently no built-in method on the `Dataset` object to do this.
However, a workaround is to directly use the Arrow table backing the dataset, **but it implies loading the whole dataset in memory** (correct me if I'm mistaken @lhoestq).
You can convert the Arrow table to a pandas dataframe to save the data as csv as follows:
```python
arrow_table = dataset.data
dataframe = arrow_table.to_pandas()
dataframe.to_csv("/path/to/file.csv")
```
Similarly, you can convert the dataset to a Python dict and save it as JSON:
```python
import json
arrow_table = dataset.data
py_dict = arrow_table.to_pydict()
with open("/path/to/file.json", "w+") as f:
json.dump(py_dict, f)
``` | [
-0.1064517871,
0.2575987279,
-0.0731423274,
0.1242810637,
0.4906322956,
0.297419548,
-0.1625234634,
0.3496722877,
0.0443107896,
0.0258972459,
-0.1533558071,
0.3309131861,
-0.4147043228,
0.2707338631,
0.2647761405,
-0.1661129594,
0.0718679354,
-0.0046491921,
0.0115188723,
0.1498276144,
-0.1541504115,
-0.0508934446,
0.2294981629,
-0.0256733932,
-0.0389475152,
-0.3820807338,
-0.2350028902,
-0.1319587678,
-0.2951256335,
-0.211511299,
-0.0870230421,
0.0582862757,
0.1421894729,
0.0619914606,
-0.000117436,
-0.0903464779,
0.0592741966,
-0.1883004755,
-0.4185786545,
-0.1192438975,
-0.2572651803,
-0.4672527313,
0.2826541066,
-0.3885618746,
0.057232514,
-0.5000998974,
0.167214036,
-0.3590872884,
0.4838617444,
0.2706116438,
0.2117938995,
-0.1439219862,
0.3098011315,
0.2972796559,
0.0524504706,
0.6159297824,
-0.3162021339,
0.1544306129,
-0.0757000297,
0.0732608214,
0.3559266031,
-0.1744703799,
-0.1545523107,
-0.3159641027,
0.3756183088,
0.078259401,
-0.2154066116,
-0.0293776169,
-0.0379321836,
0.2223852724,
0.7566879988,
-0.7057833672,
-0.5702955127,
-0.014892878,
0.036219351,
-0.0766565353,
-0.1443182677,
0.5130927563,
0.0262533072,
0.2297065109,
-0.1699938029,
-0.5853193998,
-0.3661930859,
0.0704639852,
0.385995388,
-0.1131257564,
-0.1840334088,
-0.04029819,
0.0515583605,
0.0164257418,
0.3137089312,
-0.1765545756,
-0.0960147157,
0.1227475628,
-0.1509610564,
-0.2741806507,
-0.5675683022,
-0.2052544653,
0.0101160379,
0.0844314247,
0.4611464441,
-0.0475821868,
-0.0811261758,
0.0940760076,
0.3766884208,
0.0881231278,
0.1881899685,
0.07472644,
0.1809168607,
-0.2470787615,
0.0940367952,
-0.2720764279,
0.0188919827,
0.1625404954,
0.4624990225,
-0.0868975818,
0.0454673655,
-0.2265893221,
-0.0494800359,
0.0183054525,
-0.1780699044,
0.1294330806,
-0.3326535523,
0.1597585231,
0.0246280506,
0.1252073348,
0.1071005538,
0.238810271,
0.1295623183,
-0.0150890015,
0.1851650476,
0.1889402121,
0.0421169512,
0.1680561155,
-0.0994378179,
0.0223751925,
0.0488008596,
-0.0798072815,
0.0742930621,
-0.4312084019,
0.3465843797,
-0.1666999906,
0.2300369442,
0.2840812206,
0.1565832645,
0.0880092457,
-0.0418888591,
-0.5203971863,
-0.2893022299,
0.2648201585,
0.0096721854,
-0.1103150994,
-0.3392947316,
0.0516568907,
-0.1047599018,
-0.1274160892,
-0.7118956447,
0.0507395826,
0.0460143127,
0.0264462344,
0.148179695,
-0.0401068926,
-0.1091861427,
-0.5510827899,
0.1095228717,
0.0285972338,
-0.5763205886,
0.1701297164,
0.0707033649,
-0.0269817635,
0.0793612599,
0.2944978178,
0.1584197581,
0.3940741122,
0.0567225851,
0.1613833457,
0.3168121874,
-0.1142696068,
-0.0339382626,
0.3281464875,
0.1536330134,
0.0527911372,
-0.2635240555,
0.4900129139,
0.4048585892,
0.0110458229,
-0.112562187,
0.0533572026,
0.143419385,
0.0167617779,
-0.1362844259,
-0.3738784194,
0.1573846936,
0.0359615609,
-0.3810767233,
-0.0902454332,
0.3390374184,
-0.002624423,
0.3020036519,
-0.297960043,
0.2616699934,
0.5488734841,
0.3298591077,
0.0892500505,
-0.1869287193,
-0.2176182717,
-0.2303955853,
-0.1483855546,
0.473742485,
-0.1687743515,
-0.1578412801,
-0.341140002,
0.1417449266,
0.0717257261,
-0.1318059415,
0.2105413824,
0.064636685,
-0.2472126037,
-0.1737648696,
0.1570231915,
-0.2253967673,
0.3347907364,
-0.0315159708,
0.1102835238,
-0.2123125792,
0.1414783001,
-0.0043063131,
-0.2985955477,
0.1239465922,
0.0093761096,
0.0077000079,
0.0071595935,
-0.0397447757,
0.3718752265,
0.1717892587,
0.0548247024,
0.0678473413,
0.5374658108,
0.069266364,
-0.2176717669,
0.1381902695,
0.2048178613,
0.2182478607,
-0.0328976549,
-0.6860600114,
0.5157958865,
0.0122281071,
0.0096764937,
-0.0234441143,
0.2769926786,
0.1521536857,
0.196156159,
-0.1398268342,
0.0576454028,
0.0091587389,
0.0627289638,
-0.1090609506,
-0.2286322266,
-0.4677334428,
0.049114421,
0.5178412199,
-0.3079946339,
0.5596219301,
0.024520237,
-0.0674514249,
-0.1197860762,
0.1391737461,
0.169433549,
0.0988085568,
0.0131213004,
0.0084053567,
-0.015211218,
-0.1322945356,
0.0793194175,
0.1636236906,
-0.1759058684,
0.218953833,
-0.1926092356,
-0.0880048797,
-0.1375405043,
-0.2838562131,
0.2554499209,
-0.1744093895,
0.028631309,
-0.2344363481,
0.096348688,
-0.1480452865,
0.0690906569,
-0.0803008005,
0.0835792869,
-0.104716152,
-0.2666879594,
-0.3607381284,
0.1366753578,
0.1016833037,
-0.1860565692,
-0.0687290952,
0.2181335688,
-0.1224074662,
-0.0292225778,
-0.2400658876,
-0.078985177,
0.0528297611,
0.0032245012,
0.1677333266,
0.2358338535,
0.4595133662,
-0.1864617914,
0.3139981627,
-0.3245364726,
0.0425705127,
-0.235277012,
-0.0733078122,
0.2968513966,
-0.0385019891,
0.3675040305,
-0.4057821929,
0.0554117523,
-0.0578183457,
0.0680500716,
-0.1202371344,
0.0670581609,
0.131090045,
-0.1453341097,
0.0033633024,
0.1358359009,
-0.3315481842,
-0.091880843,
0.5880924463,
-0.0212845225,
0.0851840302,
-0.201500982,
0.1822724491,
0.0390196927,
-0.0594494119,
-0.1134717017,
0.1022590995,
-0.4799203575,
0.3875847161,
-0.2450954318,
-0.3918480277,
0.2173524946,
0.3804705441,
-0.1191380993,
-0.0605497807,
-0.1390841305,
0.0108354203,
-0.1433645934,
-0.1700054258,
-0.0538380742,
0.1813925505,
0.0168657955,
0.2060140222,
0.1637834758,
0.064200066,
-0.2167955935,
0.1224524975,
0.3177887797,
0.0929097012,
-0.0520330556,
0.3663928509,
0.0803734884,
-0.0182103775,
0.3591734767,
0.247193262,
0.2278042287,
-0.0486975871,
0.4381061792,
-0.1248675063,
0.0292694066,
0.0408791415,
-0.3164154291,
-0.18999134,
-0.1023088545,
0.169130981,
0.0362688191,
0.2131181359,
-0.0089112874,
-0.2511672676,
-0.252301991,
0.2345304787,
-0.242294088,
0.0265633706,
-0.1178323478,
0.110016495,
-0.017566219,
-0.1718045622,
0.0806342065,
0.3837935925,
0.2663042545,
0.0322685204,
-0.5151156783,
-0.2940561771,
-0.5803806186,
0.0998746306,
-0.0295963008,
0.3618459702,
0.1022810265,
0.1812068224,
0.2147045583,
-0.1119505093,
0.3909144998,
-0.1343432069,
-0.2980667949,
0.0561336875,
0.1621565521,
-0.3671405315,
0.2348610312,
-0.0473510958,
0.2741595507,
-0.2787130475,
0.3191592097,
-0.1746150255,
-0.1206109375,
-0.2288215756,
0.3668922186,
-0.4481756389,
-0.1200767234,
0.0821694285,
-0.4218106568,
-0.1823730618,
-0.3053174019,
0.1513222158,
-0.1954495609,
0.006747528,
-0.122150071,
-0.3344156742,
0.0702107325,
0.1866708398,
-0.2903486788,
0.2243078053,
-0.011988245,
-0.1412696838,
0.328546524,
0.3046220243,
0.1024218351,
0.3054981232,
-0.0795760527,
-0.3287601173,
-0.2732929289,
-0.1670094728,
0.398163259,
-0.098088868,
0.0966517329,
-0.0320459306,
0.2533675432,
-0.2423792779,
-0.3861221671,
-0.1294438541,
0.0660814345,
0.1474064738,
-0.5840485096,
-0.6087496281,
0.3970061541,
0.1133665442,
0.0549411625,
0.0138992369,
0.1954512745,
-0.171869278,
0.4643929601,
0.3657188118,
0.9020746946,
-0.6044502854,
0.5735937357,
-0.0385323241,
-0.6457204819,
0.2766194046,
-0.4204302132,
-0.0273247603,
-0.3712977469,
0.1174390614,
-0.1189438775,
-0.0093261125,
0.3070975542,
0.232809484,
-0.2221039683,
0.1798439771,
-0.11371921,
-0.1695740223,
0.0838306099,
0.2791962624,
-0.1214256436,
-0.1039378345,
-0.1601459235,
0.1506624669,
-0.1781387329,
-0.3596467972,
0.089534089,
-0.3730086982,
-0.061066512,
0.2402314693,
-0.29005,
-0.00706201,
-0.1904813051,
0.1023720875,
-0.3404385746,
-0.2851460874,
0.1627355814,
0.251329422,
0.2861890197,
0.2359694391,
-0.0347438194,
-0.0771180242,
-0.2271258235,
0.0297579691,
0.046688281,
-0.0615854897,
0.1257040799,
0.2127917707,
-0.0325126052,
0.2309789658,
-0.0446456075,
-0.3499726355,
0.1107668951,
-0.026931962,
-0.0427052826,
-0.208444491,
-0.2369853407,
-0.1178413779,
-0.1680609137,
-0.1451386064,
0.0968287066,
0.409371078,
0.3144996464,
0.4892161191,
-0.047016494,
-0.0696011931,
0.0739858001,
0.0777782649,
0.0151668712,
0.0650847256,
0.2172193974,
-0.0387639478,
-0.2438250482,
-0.2203439474,
0.6501060724,
0.1738114357,
0.0053954693,
0.2061900347,
-0.2736009061,
0.1468952,
-0.2225253731,
0.0149073508,
0.0925174206,
-0.2587203383,
-0.2671194971,
-0.4189402461,
-0.3676984608,
0.1884378195,
0.3738776445,
0.2795002759,
0.1300152391,
-0.2986118495,
-0.2512316406,
-0.1085194275,
-0.1967222095,
0.0870151445,
-0.053890802,
-0.0562733039,
0.0787373856,
0.2680083513,
0.2168205231,
-0.3074112236,
0.0350421071,
-0.051960595,
0.1876036227,
-0.0996493176,
-0.190095216,
0.1305592805,
0.0866740718,
-0.1253445297,
-0.1687790006,
-0.452685535,
-0.0305361804,
-0.1521852314,
-0.3153105676,
0.3631750047,
-0.0966382772,
0.3008650243,
0.0125912875,
0.1385028064,
-0.0113983899,
-0.0335731208,
0.0614380613,
0.3263466358,
-0.1698084921,
0.0586510375,
0.2863139808,
-0.0419735871,
-0.1188760549,
0.1244865432,
0.1370640993,
-0.1231820509,
0.3291628659,
-0.1266667247,
-0.0109351352,
-0.0754384845,
0.3813678026,
0.3408976197,
-0.1769039184,
0.2275377661,
0.2048677355,
0.0786914825,
0.1729991883,
-0.134119153,
0.2587118447,
-0.0603925474,
-0.1156147942,
0.1173651218,
-0.1337971538,
0.0944370478,
-0.3814757168,
-0.3169582784,
0.0581980832,
-0.1218340546,
-0.1312619299,
0.2519335747,
0.1693172455,
-0.115447849,
0.0012944787,
0.2567516863,
0.2531092763,
0.6264760494,
0.1446099728,
0.1117550135,
0.5608847737,
0.1677170545,
0.0637158751,
0.0563955083,
0.0664290562,
-0.1512658745,
0.0879573748,
0.3625526726,
0.4243086874,
0.0104288068,
-0.0020098286,
-0.2219340503,
0.083037585,
0.1312358975,
-0.0474900417,
-0.0755932778,
-0.0296516865,
-0.0509904996,
0.1968562603,
-0.1094435677,
-0.2953990102,
-0.4354917705,
0.038758833,
0.1948024333,
0.4805167615,
0.0781078115,
0.3756711483,
0.1052033603,
0.18894656,
-0.2450512946,
-0.2562156916,
-0.0034826749,
0.0284076873,
-0.3446307778,
0.1636253297,
0.2867845297,
0.0134551357,
-0.1108853221,
0.4924835265,
-0.1011633277,
-0.1818977296,
0.1060709134,
0.034140218,
0.1640357822,
-0.1392962039,
0.3932145238,
0.1226921976,
0.1094272956,
0.2109398544,
0.0213193521,
-0.0144721335,
-0.0988776013,
0.0922456384,
-0.018853901,
-0.5013267994,
-0.1279324144,
-0.1039540693,
-0.127195254,
-0.2156637609,
0.5050706267,
-0.0352518857,
0.1124871895,
-0.0289674718,
0.0482331738,
0.047404848,
0.3016920388,
0.4544296265,
0.0897113457,
-0.0695184693,
0.0308585763,
-0.1595068574,
-0.1504455656,
-0.0818228722,
-0.0607451573,
-0.0279470552,
0.0946063399,
0.3062111139,
0.3246448338,
-0.0154577596,
0.350158751,
-0.0966228098,
0.4746276438,
-0.1529735327,
-0.1095174998,
0.3460101485,
0.3962834477,
0.0240954533,
-0.4002615809,
0.4055837691,
0.249922365,
0.0269376133,
-0.3491509259,
0.3835624456,
-0.3014108539,
-0.0613450631,
0.3309570849,
0.0696277916,
-0.0606318489,
-0.02143934,
-0.2752471864,
0.2633812129,
0.3521861434,
0.0958075225,
0.3177364171,
-0.0724048838,
0.3416814208,
-0.277528137,
0.1618972421,
-0.0880662128,
-0.2432599664,
-0.5080468655,
-0.0426237993,
-0.2744732499,
0.1040449589,
-0.1105253845,
-0.0234463848,
0.1629514545,
0.2395677865,
-0.2278755009,
0.2146223933,
-0.129856512,
0.344545573,
-0.060025122,
-0.086983338,
-0.2443917394,
0.385341078,
-0.1268391907,
-0.0440097935,
-0.0251779016,
-0.4408192635,
-0.0154447043,
0.3302832246,
-0.2197274268,
0.0105373692,
0.2405091524,
-0.0074135149,
0.2687165141,
-0.0039453115,
0.6607910395,
-0.0080850068,
-0.0002101133,
-0.289273262,
-0.3808012009
] |
https://github.com/huggingface/datasets/issues/1808 | writing Datasets in a human readable format | Indeed this works as long as you have enough memory.
It would be amazing to have export options like csv, json etc. !
It should be doable to implement something that iterates through the dataset batch by batch to write to csv for example.
There is already an `export` method but currently the only export type that is supported is `tfrecords`. | Hi
I see there is a save_to_disk function to save data, but this is not human readable format, is there a way I could save a Dataset object in a human readable format to a file like json? thanks @lhoestq | 61 | writing Datasets in a human readable format
Hi
I see there is a save_to_disk function to save data, but this is not human readable format, is there a way I could save a Dataset object in a human readable format to a file like json? thanks @lhoestq
Indeed this works as long as you have enough memory.
It would be amazing to have export options like csv, json etc. !
It should be doable to implement something that iterates through the dataset batch by batch to write to csv for example.
There is already an `export` method but currently the only export type that is supported is `tfrecords`. | [
-0.2098386586,
0.0492691956,
-0.1076667532,
0.0664266124,
0.5001393557,
0.2327687889,
-0.1172598526,
0.3574726284,
0.0007517958,
0.1492747217,
-0.1676974446,
0.05272457,
-0.371142,
0.4290179908,
0.304838866,
-0.1157783568,
0.0749910921,
-0.139986217,
0.0092277611,
0.1033089906,
-0.1731933653,
0.0031020502,
0.1856798083,
-0.1044701859,
-0.0075999005,
-0.4232767224,
-0.2167163938,
-0.216621995,
-0.1934355348,
-0.1114806235,
-0.1856018752,
0.0026594645,
0.3307574391,
0.0372147895,
-0.0001181302,
-0.1858899295,
-0.0230946597,
-0.1615506709,
-0.3787549734,
-0.0889041275,
-0.2690255046,
-0.2977551818,
0.0627994388,
-0.4023829103,
0.0958818421,
-0.247190088,
0.4078350365,
-0.3925504982,
0.2636529505,
0.2429077029,
0.1875608712,
-0.1289435327,
0.2089093029,
0.2194778025,
0.091898568,
0.6853559017,
-0.3673556745,
0.0276129395,
0.0916350707,
0.1872602552,
0.4378953278,
-0.2874054313,
-0.1316047311,
-0.3443318605,
0.3439821005,
0.056166824,
-0.0894860923,
-0.0855562687,
-0.0113038961,
0.228447184,
0.8819463849,
-0.5850656629,
-0.4965890646,
0.0562340207,
-0.0367570743,
-0.0845803469,
-0.1327416748,
0.4962067604,
0.0031535348,
0.2550379634,
-0.3079484999,
-0.6020659804,
-0.4352658093,
0.0158187747,
0.4432983994,
-0.0723045692,
-0.1896704882,
-0.0486625843,
0.0651548505,
0.1475460082,
0.395962894,
-0.1175902262,
-0.1520476639,
0.1304977983,
-0.1174585521,
-0.3553516567,
-0.616209209,
-0.0790424198,
0.0551154427,
0.0091142785,
0.353156209,
-0.0813898519,
0.0763223246,
0.0985914841,
0.4005743861,
0.0226747245,
0.3162568212,
-0.0479764976,
0.1818597019,
-0.4053879976,
0.1173191741,
-0.2435547262,
0.0092507163,
0.1748857498,
0.4574070275,
-0.0047271508,
-0.076897271,
-0.2648997307,
0.0425275974,
-0.0964036211,
-0.0780490339,
-0.0268155225,
-0.4872849286,
0.0815215036,
0.0194435995,
-0.1135362238,
0.0742607638,
0.0766621381,
-0.0136127779,
-0.149993673,
0.2075236738,
0.139362663,
0.0309043713,
0.1772509664,
-0.1824783683,
-0.0466998294,
-0.0887519941,
-0.0720064417,
0.1316603124,
-0.3586093485,
0.3845715225,
-0.2493530214,
0.2336793244,
0.0582667068,
0.1374217421,
0.1378743351,
-0.1352055967,
-0.5077314377,
-0.3294370472,
0.2013818026,
-0.1224829331,
-0.1518187821,
-0.3533751965,
0.0441594049,
-0.061738681,
-0.2341737896,
-0.6611488461,
0.1238479242,
0.1232441962,
-0.038136024,
0.0982437804,
-0.0732542723,
-0.1500758976,
-0.4955062866,
0.0272692498,
-0.0362045877,
-0.6494601369,
0.1883053333,
0.1602354646,
-0.0922062024,
0.1351407319,
0.3854271472,
0.2524663806,
0.5349966884,
-0.0050935238,
0.1908498108,
0.2792837322,
0.0055639446,
0.1569124609,
0.3973155916,
0.1233955845,
-0.1115939692,
-0.2646245658,
0.4624731243,
0.5034455061,
-0.1858537346,
-0.1742169708,
0.0487020873,
0.1154663786,
-0.0147591187,
-0.1799326837,
-0.3490655124,
0.0157869142,
-0.0664075911,
-0.2319363505,
-0.0439233184,
0.5080921054,
0.0998143777,
0.2476149946,
-0.3435504735,
0.3596274853,
0.5124644041,
0.3237615228,
0.1429354101,
-0.2747883797,
-0.2920852304,
-0.2649782002,
-0.2304357439,
0.350591898,
-0.2540546656,
0.2577134371,
-0.334251672,
0.2862890661,
0.0189475883,
0.0523893274,
0.2952236533,
0.0199202411,
-0.0535012633,
-0.1708800793,
0.1500769109,
-0.3343762457,
0.2304335535,
-0.0469821692,
-0.0708580166,
-0.1806439161,
0.1290427148,
0.0067978161,
-0.2635651231,
0.0730489641,
-0.1115209237,
-0.0074961456,
-0.1651374102,
0.025362391,
0.3055085838,
0.0756189898,
0.0746355355,
0.1550767571,
0.6029984951,
0.0291010402,
-0.0924291238,
0.0618126728,
0.0457077846,
0.0842039734,
-0.0397247896,
-0.7325782776,
0.4708710611,
-0.0299043059,
-0.0231570005,
-0.0380998515,
0.1662542224,
0.0391306132,
0.0894583687,
0.0318249874,
0.08887925,
0.1403707713,
0.0402232185,
-0.2641539872,
-0.2821544409,
-0.4200900197,
0.0944666192,
0.6116840243,
-0.3029910326,
0.4891395271,
-0.0324112102,
0.1629303247,
-0.0735491887,
0.159059912,
0.0599538907,
0.1638481319,
0.006339076,
0.1523172557,
-0.0200327076,
-0.1002851278,
0.0414521173,
0.1809065491,
-0.3330415487,
0.1086973175,
-0.1366848946,
-0.2732611299,
-0.0263079163,
-0.2412547916,
0.2050080448,
-0.1510561407,
0.002807375,
-0.2534694672,
-0.0020915389,
-0.1439945251,
0.0682080537,
-0.0892926976,
0.2924492061,
-0.0737612695,
-0.2302347869,
-0.2821518481,
0.221707508,
0.0110720135,
-0.271515131,
0.0190671943,
0.394903928,
-0.2087049633,
0.1366723478,
-0.2805608213,
-0.0104769543,
0.0772216395,
0.0013888074,
0.1501663178,
0.2121296078,
0.5001712441,
-0.2471009344,
0.2344090194,
-0.3675444424,
-0.0073751989,
-0.160047546,
-0.0063724229,
0.3519592881,
-0.1012436971,
0.3395304084,
-0.4360645711,
0.0627959371,
-0.1589546055,
0.0349305421,
-0.0650754273,
-0.0743054748,
0.1325967163,
-0.208640635,
-0.0840452686,
0.1942924708,
-0.3629708886,
-0.1273270994,
0.5436403751,
-0.0702463463,
0.1053248122,
-0.2141473591,
0.0746372864,
-0.0660374686,
-0.1418340206,
-0.1646412611,
0.0744825676,
-0.6360769868,
0.2971098721,
-0.3602564037,
-0.467017442,
0.2232368886,
0.5383543372,
-0.1780401468,
0.0747439414,
-0.2141809165,
0.1051233411,
0.0104012275,
-0.2355578691,
-0.0313847102,
0.2207895368,
0.0310313832,
0.0849166811,
0.1721575707,
0.062260177,
-0.1802072525,
0.031777557,
0.328579843,
0.2549754381,
-0.0333703831,
0.2822730243,
0.2257810682,
0.0145830233,
0.2588455975,
0.2226625681,
0.1427477151,
0.0221683234,
0.4139012396,
-0.0327832401,
0.0022065539,
0.347581774,
-0.3031909168,
-0.2985249162,
-0.0196206924,
0.072002463,
0.0848770291,
0.1824377328,
0.0174717344,
-0.0904314891,
-0.234834373,
0.3269669712,
0.003028177,
0.1502866894,
-0.1556911469,
0.1154049784,
-0.1132464111,
-0.1336515695,
0.0767766461,
0.3554424047,
0.3367664814,
0.1070486531,
-0.6552957892,
-0.2315314859,
-0.48529917,
0.1907074004,
0.050158307,
0.2119169682,
-0.1267175376,
0.1747841239,
0.1891008168,
-0.0203106143,
0.409702152,
-0.2429732084,
-0.2298624963,
0.0398619063,
0.105892621,
-0.1899778992,
0.1949258894,
-0.0307499971,
0.2844807506,
-0.0784661174,
0.3948438466,
-0.1224789321,
-0.1046810523,
-0.183570683,
0.2617669106,
-0.4513823688,
-0.2274120748,
0.2144456059,
-0.2858094871,
-0.0793603212,
-0.2414368093,
0.1410574615,
-0.2363557667,
-0.0683968216,
-0.1851714104,
-0.2665019929,
0.135085538,
0.1919200271,
-0.3439517021,
-0.0101494296,
0.0290648863,
-0.2233084291,
0.2827489972,
0.3313413262,
0.0968822092,
0.0708974302,
-0.1467024982,
-0.2290759087,
-0.0741187632,
-0.3246364594,
0.5238561034,
-0.1108003035,
0.1860693842,
-0.0708479062,
0.3306652904,
-0.1715367287,
-0.3715518713,
-0.2041893303,
0.0513591282,
0.1517583728,
-0.7371711135,
-0.4786504209,
0.1942820549,
0.0169833433,
0.0677904785,
-0.0319630727,
0.1035453975,
-0.1954327822,
0.2718693018,
0.5431912541,
0.9837471247,
-0.6078290939,
0.4128286839,
-0.1637286842,
-0.5005874038,
0.3284199536,
-0.4307343662,
0.0627745315,
-0.3551384807,
-0.0276476461,
-0.1078197509,
0.0088212388,
0.2886621356,
0.247626096,
-0.2568735778,
0.111445792,
0.0429645479,
-0.0276017822,
0.0065245372,
0.2042028606,
-0.0899185985,
-0.0616596267,
-0.0040142848,
0.1460143179,
-0.1574333757,
-0.320599556,
-0.0201734249,
-0.3327824473,
0.1395348161,
0.4025574327,
-0.202018857,
-0.0209281202,
-0.1463060379,
0.015044827,
-0.308262825,
-0.2517387569,
0.1647440791,
0.2179531306,
0.5345998406,
0.26768291,
-0.0082502179,
-0.2146232426,
-0.2167551816,
0.0655891523,
-0.0220924504,
-0.0354238451,
0.093972221,
0.1627647877,
-0.0731020421,
0.3064504862,
0.0288080834,
-0.3392605782,
0.022816658,
-0.0798976198,
-0.0847575292,
-0.2946387827,
-0.1190949753,
-0.0714355111,
-0.0903843641,
-0.083837606,
0.0825991556,
0.4026636183,
0.3868675828,
0.6266880035,
-0.1138433293,
-0.0243493486,
-0.0264972504,
0.0735807046,
0.0862440243,
-0.1006961018,
0.0623359419,
-0.0058064228,
-0.2779268026,
-0.2418329269,
0.6459096074,
0.022128664,
-0.0729257464,
0.2438968569,
-0.316108942,
0.1931052655,
-0.1895982474,
0.1027760133,
0.0620115548,
-0.3043515086,
-0.3431843221,
-0.2934036255,
-0.1822021455,
0.1060882285,
0.3513626158,
0.2742486,
0.1964375973,
-0.2088545263,
-0.1980816275,
-0.0715915486,
-0.1946105957,
-0.0148157841,
-0.0851608217,
0.0202355254,
0.1642276645,
0.2659724653,
0.0690857917,
-0.2713039517,
-0.0321458094,
-0.0136919888,
0.1524147838,
-0.0729750693,
-0.2203808725,
0.1443682313,
0.0652040541,
0.0645053387,
-0.0626737028,
-0.3862690032,
0.002805369,
-0.1917510778,
-0.3020139635,
0.4181833863,
-0.1112123877,
0.3120131493,
0.0823349133,
0.1562833786,
-0.0018335526,
-0.0398663878,
0.2709315717,
0.4351330101,
-0.2582452595,
0.1065222546,
0.2574402094,
-0.0351613797,
-0.120685406,
0.14193362,
0.3585571349,
-0.005471888,
0.2918898463,
-0.1320081502,
0.0210155584,
0.0817457885,
0.192292124,
0.223027125,
-0.1513839215,
0.2095309794,
0.2021974027,
0.0894818678,
0.3666162789,
-0.0980457962,
0.2809937894,
-0.021984851,
-0.1846568286,
0.174745664,
-0.0888471603,
0.0154184802,
-0.04158362,
-0.3821216226,
0.0678360835,
-0.205319494,
-0.1655509472,
0.2034166306,
0.1272657514,
-0.0663162246,
-0.0298963916,
0.1465526223,
0.2336004823,
0.4929719269,
0.2062363774,
0.0732569173,
0.4920810759,
0.2002184838,
0.0824680552,
-0.0982074216,
0.1632051468,
-0.1484129578,
0.1188443899,
0.4701642692,
0.4780253768,
-0.2022808194,
-0.1375740767,
-0.2050092518,
0.0606813841,
0.0712555349,
-0.0733533055,
0.0407072417,
-0.1687210202,
-0.0187057871,
0.2555474341,
0.0180925336,
-0.308013618,
-0.3289763629,
0.0334216505,
0.2333349138,
0.5413273573,
0.1409210712,
0.3044000566,
-0.0077627334,
0.1501618028,
-0.2206455171,
-0.1622949094,
-0.154322803,
0.0149486298,
-0.3174992502,
0.3099465668,
0.1703504175,
0.0588461198,
0.0753084347,
0.411894232,
-0.1623410583,
-0.0831414163,
0.0934856832,
0.1500547975,
0.0717754215,
-0.052423913,
0.464769721,
0.0988009945,
0.1652534902,
0.3295050561,
0.0059086676,
-0.1236520186,
-0.134171918,
-0.0283536054,
0.1266489327,
-0.4638587534,
-0.1727948934,
-0.1395135671,
-0.1048983261,
-0.1019239575,
0.439747721,
-0.1383690089,
0.1056911796,
0.0689347088,
0.0451065153,
0.0810732245,
0.3107047677,
0.5162876844,
0.0313303694,
-0.068472065,
0.0654620677,
-0.0065771397,
0.0252946354,
0.0163492616,
0.0962508917,
-0.1207718626,
0.1353666484,
0.3248270154,
0.3486242592,
0.0382464789,
0.1583915204,
-0.07539168,
0.5430314541,
-0.1199701875,
-0.16421175,
0.3302966952,
0.389503777,
0.0072048027,
-0.3909873068,
0.5046796799,
0.2837263346,
-0.0130073708,
-0.4221143425,
0.4101161659,
-0.2834378481,
-0.221048519,
0.3415217698,
0.0683488548,
-0.1018352285,
-0.0187305566,
-0.2133675963,
0.2306765467,
0.392539531,
0.122063756,
0.2381236255,
0.0703168958,
0.2417999059,
-0.3717212081,
0.0908147395,
-0.1417987347,
-0.1396602094,
-0.4831588268,
0.1779389083,
-0.1455751956,
-0.0111701954,
-0.1442711353,
-0.1653169692,
0.3295235038,
0.195349887,
-0.205749169,
0.2056866586,
-0.1991419345,
0.5085463524,
-0.1622636169,
-0.0935355648,
-0.2657580376,
0.2492879778,
-0.1632485837,
-0.0005454473,
-0.0438027307,
-0.3620735407,
-0.0830063,
0.3840694726,
-0.2108114362,
0.1024114341,
0.299664855,
-0.0099465847,
0.2332295179,
0.0598656088,
0.532420516,
0.1018794328,
-0.0518434756,
-0.2351114154,
-0.3200592697
] |
https://github.com/huggingface/datasets/issues/1805 | can't pickle SwigPyObject objects when calling dataset.get_nearest_examples from FAISS index | Hi ! Indeed we used to require mapping functions to be picklable with `pickle` or `dill` in order to cache the resulting datasets. And FAISS indexes are not picklable unfortunately.
But since #1703 this is no longer required (the caching will simply be disabled). This change will be available in the next release of `datasets`, or you can also install `datasets` from source. | So, I have the following instances in my dataset
```
{'question': 'An astronomer observes that a planet rotates faster after a meteorite impact. Which is the most likely effect of
this increase in rotation?',
'answer': 'C',
'example_id': 'ARCCH_Mercury_7175875',
'options':[{'option_context': 'One effect of increased amperage in the planetary world (..)', 'option_id': 'A', 'option_text': 'Planetary density will decrease.'},
(...)]}
```
The `options` value is always an list with 4 options, each one is a dict with `option_context`; `option_id` and `option_text`.
I would like to overwrite the `option_context` of each instance of my dataset for a dpr result that I am developing. Then, I trained a model already and save it in a FAISS index
```
dpr_dataset = load_dataset(
"text",
data_files=ARC_CORPUS_TEXT,
cache_dir=CACHE_DIR,
split="train[:100%]",
)
dpr_dataset.load_faiss_index("embeddings", f"{ARC_CORPUS_FAISS}")
torch.set_grad_enabled(False)
```
Then, as a processor of my dataset, I created a map function that calls the `dpr_dataset` for each _option_
```
def generate_context(example):
question_text = example['question']
for option in example['options']:
question_with_option = question_text + " " + option['option_text']
tokenize_text = question_tokenizer(question_with_option, return_tensors="pt").to(device)
question_embed = (
question_encoder(**tokenize_text)
)[0][0].cpu().numpy()
_, retrieved_examples = dpr_dataset.get_nearest_examples(
"embeddings", question_embed, k=10
)
# option["option_context"] = retrieved_examples["text"]
# option["option_context"] = " ".join(option["option_context"]).strip()
#result_dict = {
# 'example_id': example['example_id'],
# 'answer': example['answer'],
# 'question': question_text,
#options': example['options']
# }
return example
```
I intentionally commented on this portion of the code.
But when I call the `map` method, `ds_with_context = dataset.map(generate_context,load_from_cache_file=False)`
It calls the following error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-55-75a458ce205c> in <module>
----> 1 ds_with_context = dataset.map(generate_context,load_from_cache_file=False)
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc)
301 num_proc=num_proc,
302 )
--> 303 for k, dataset in self.items()
304 }
305 )
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0)
301 num_proc=num_proc,
302 )
--> 303 for k, dataset in self.items()
304 }
305 )
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint)
1257 fn_kwargs=fn_kwargs,
1258 new_fingerprint=new_fingerprint,
-> 1259 update_data=update_data,
1260 )
1261 else:
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs)
155 }
156 # apply actual function
--> 157 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
158 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
159 # re-apply format to the output
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs)
156 kwargs_for_fingerprint["fingerprint_name"] = fingerprint_name
157 kwargs[fingerprint_name] = update_fingerprint(
--> 158 self._fingerprint, transform, kwargs_for_fingerprint
159 )
160
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in update_fingerprint(fingerprint, transform, transform_args)
103 for key in sorted(transform_args):
104 hasher.update(key)
--> 105 hasher.update(transform_args[key])
106 return hasher.hexdigest()
107
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in update(self, value)
55 def update(self, value):
56 self.m.update(f"=={type(value)}==".encode("utf8"))
---> 57 self.m.update(self.hash(value).encode("utf-8"))
58
59 def hexdigest(self):
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in hash(cls, value)
51 return cls.dispatch[type(value)](cls, value)
52 else:
---> 53 return cls.hash_default(value)
54
55 def update(self, value):
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in hash_default(cls, value)
44 @classmethod
45 def hash_default(cls, value):
---> 46 return cls.hash_bytes(dumps(value))
47
48 @classmethod
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in dumps(obj)
387 file = StringIO()
388 with _no_cache_fields(obj):
--> 389 dump(obj, file)
390 return file.getvalue()
391
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in dump(obj, file)
359 def dump(obj, file):
360 """pickle an object to a file"""
--> 361 Pickler(file, recurse=True).dump(obj)
362 return
363
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in dump(self, obj)
452 raise PicklingError(msg)
453 else:
--> 454 StockPickler.dump(self, obj)
455 stack.clear() # clear record of 'recursion-sensitive' pickled objects
456 return
/usr/lib/python3.7/pickle.py in dump(self, obj)
435 if self.proto >= 4:
436 self.framer.start_framing()
--> 437 self.save(obj)
438 self.write(STOP)
439 self.framer.end_framing()
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in save_function(pickler, obj)
554 dill._dill._create_function,
555 (obj.__code__, globs, obj.__name__, obj.__defaults__, obj.__closure__, obj.__dict__, fkwdefaults),
--> 556 obj=obj,
557 )
558 else:
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
636 else:
637 save(func)
--> 638 save(args)
639 write(REDUCE)
640
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
/usr/lib/python3.7/pickle.py in save_tuple(self, obj)
784 write(MARK)
785 for element in obj:
--> 786 save(element)
787
788 if id(obj) in memo:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
885 k, v = tmp[0]
886 save(k)
--> 887 save(v)
888 write(SETITEM)
889 # else tmp is empty, and we're done
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
885 k, v = tmp[0]
886 save(k)
--> 887 save(v)
888 write(SETITEM)
889 # else tmp is empty, and we're done
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
522 reduce = getattr(obj, "__reduce_ex__", None)
523 if reduce is not None:
--> 524 rv = reduce(self.proto)
525 else:
526 reduce = getattr(obj, "__reduce__", None)
TypeError: can't pickle SwigPyObject objects
```
Which I have no idea how to solve/deal with it
| 63 | can't pickle SwigPyObject objects when calling dataset.get_nearest_examples from FAISS index
So, I have the following instances in my dataset
```
{'question': 'An astronomer observes that a planet rotates faster after a meteorite impact. Which is the most likely effect of
this increase in rotation?',
'answer': 'C',
'example_id': 'ARCCH_Mercury_7175875',
'options':[{'option_context': 'One effect of increased amperage in the planetary world (..)', 'option_id': 'A', 'option_text': 'Planetary density will decrease.'},
(...)]}
```
The `options` value is always an list with 4 options, each one is a dict with `option_context`; `option_id` and `option_text`.
I would like to overwrite the `option_context` of each instance of my dataset for a dpr result that I am developing. Then, I trained a model already and save it in a FAISS index
```
dpr_dataset = load_dataset(
"text",
data_files=ARC_CORPUS_TEXT,
cache_dir=CACHE_DIR,
split="train[:100%]",
)
dpr_dataset.load_faiss_index("embeddings", f"{ARC_CORPUS_FAISS}")
torch.set_grad_enabled(False)
```
Then, as a processor of my dataset, I created a map function that calls the `dpr_dataset` for each _option_
```
def generate_context(example):
question_text = example['question']
for option in example['options']:
question_with_option = question_text + " " + option['option_text']
tokenize_text = question_tokenizer(question_with_option, return_tensors="pt").to(device)
question_embed = (
question_encoder(**tokenize_text)
)[0][0].cpu().numpy()
_, retrieved_examples = dpr_dataset.get_nearest_examples(
"embeddings", question_embed, k=10
)
# option["option_context"] = retrieved_examples["text"]
# option["option_context"] = " ".join(option["option_context"]).strip()
#result_dict = {
# 'example_id': example['example_id'],
# 'answer': example['answer'],
# 'question': question_text,
#options': example['options']
# }
return example
```
I intentionally commented on this portion of the code.
But when I call the `map` method, `ds_with_context = dataset.map(generate_context,load_from_cache_file=False)`
It calls the following error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-55-75a458ce205c> in <module>
----> 1 ds_with_context = dataset.map(generate_context,load_from_cache_file=False)
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc)
301 num_proc=num_proc,
302 )
--> 303 for k, dataset in self.items()
304 }
305 )
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0)
301 num_proc=num_proc,
302 )
--> 303 for k, dataset in self.items()
304 }
305 )
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint)
1257 fn_kwargs=fn_kwargs,
1258 new_fingerprint=new_fingerprint,
-> 1259 update_data=update_data,
1260 )
1261 else:
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs)
155 }
156 # apply actual function
--> 157 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
158 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
159 # re-apply format to the output
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs)
156 kwargs_for_fingerprint["fingerprint_name"] = fingerprint_name
157 kwargs[fingerprint_name] = update_fingerprint(
--> 158 self._fingerprint, transform, kwargs_for_fingerprint
159 )
160
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in update_fingerprint(fingerprint, transform, transform_args)
103 for key in sorted(transform_args):
104 hasher.update(key)
--> 105 hasher.update(transform_args[key])
106 return hasher.hexdigest()
107
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in update(self, value)
55 def update(self, value):
56 self.m.update(f"=={type(value)}==".encode("utf8"))
---> 57 self.m.update(self.hash(value).encode("utf-8"))
58
59 def hexdigest(self):
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in hash(cls, value)
51 return cls.dispatch[type(value)](cls, value)
52 else:
---> 53 return cls.hash_default(value)
54
55 def update(self, value):
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in hash_default(cls, value)
44 @classmethod
45 def hash_default(cls, value):
---> 46 return cls.hash_bytes(dumps(value))
47
48 @classmethod
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in dumps(obj)
387 file = StringIO()
388 with _no_cache_fields(obj):
--> 389 dump(obj, file)
390 return file.getvalue()
391
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in dump(obj, file)
359 def dump(obj, file):
360 """pickle an object to a file"""
--> 361 Pickler(file, recurse=True).dump(obj)
362 return
363
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in dump(self, obj)
452 raise PicklingError(msg)
453 else:
--> 454 StockPickler.dump(self, obj)
455 stack.clear() # clear record of 'recursion-sensitive' pickled objects
456 return
/usr/lib/python3.7/pickle.py in dump(self, obj)
435 if self.proto >= 4:
436 self.framer.start_framing()
--> 437 self.save(obj)
438 self.write(STOP)
439 self.framer.end_framing()
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in save_function(pickler, obj)
554 dill._dill._create_function,
555 (obj.__code__, globs, obj.__name__, obj.__defaults__, obj.__closure__, obj.__dict__, fkwdefaults),
--> 556 obj=obj,
557 )
558 else:
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
636 else:
637 save(func)
--> 638 save(args)
639 write(REDUCE)
640
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
/usr/lib/python3.7/pickle.py in save_tuple(self, obj)
784 write(MARK)
785 for element in obj:
--> 786 save(element)
787
788 if id(obj) in memo:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
885 k, v = tmp[0]
886 save(k)
--> 887 save(v)
888 write(SETITEM)
889 # else tmp is empty, and we're done
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
885 k, v = tmp[0]
886 save(k)
--> 887 save(v)
888 write(SETITEM)
889 # else tmp is empty, and we're done
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
522 reduce = getattr(obj, "__reduce_ex__", None)
523 if reduce is not None:
--> 524 rv = reduce(self.proto)
525 else:
526 reduce = getattr(obj, "__reduce__", None)
TypeError: can't pickle SwigPyObject objects
```
Which I have no idea how to solve/deal with it
Hi ! Indeed we used to require mapping functions to be picklable with `pickle` or `dill` in order to cache the resulting datasets. And FAISS indexes are not picklable unfortunately.
But since #1703 this is no longer required (the caching will simply be disabled). This change will be available in the next release of `datasets`, or you can also install `datasets` from source. | [
0.0690419376,
-0.3887842894,
-0.0696357638,
0.2468253374,
0.1642264873,
0.027764339,
0.1784276366,
0.0541121922,
0.4089653194,
0.5476049781,
-0.0500993133,
0.4959973991,
0.1157931685,
-0.1273347586,
-0.2676261365,
0.0515105985,
0.0849943459,
0.013422451,
0.0216208585,
-0.2425850332,
-0.5357055664,
-0.0484027304,
-0.1984260529,
0.0493391603,
-0.0398413055,
0.0180334598,
-0.0332832076,
0.0954478011,
-0.0584460385,
-0.453925401,
0.4045755267,
0.2576844692,
0.2116613388,
-0.0134232575,
-0.0001266745,
0.0679020658,
0.2053472847,
-0.0212521944,
-0.1646227986,
0.0867502242,
-0.0015752311,
0.3058413267,
0.2944121659,
-0.3542492688,
-0.2179246843,
-0.2550705075,
-0.0504560918,
-0.1345559061,
0.0680650696,
0.1915956587,
0.06709259,
0.1456796527,
-0.1130728349,
-0.1586892605,
0.2215851396,
-0.0109134782,
-0.0620619506,
0.1621500403,
0.2719886303,
0.3066602349,
0.2544572353,
0.2748858333,
-0.2460707277,
0.0368728638,
-0.0725998655,
0.0926400349,
0.3378049135,
0.0920078605,
0.1556721777,
0.0969464555,
0.2498127818,
-0.2737823725,
-0.47020787,
-0.4137727618,
-0.0613962971,
-0.1567487717,
-0.2627950311,
-0.5509216189,
-0.0172369387,
0.24829261,
0.1254628897,
0.1021859795,
-0.0639563724,
0.5212544203,
0.4118609726,
0.0359548852,
0.0144237978,
0.2109335661,
0.1066410914,
-0.0576485768,
0.1366035491,
-0.1332528889,
-0.0283689201,
-0.1321198344,
-0.2131485492,
-0.1242144853,
0.4846387804,
-0.2354142368,
0.2450581491,
0.084626101,
-0.1290585548,
0.4014527202,
0.0691415444,
0.1075496301,
0.1615174562,
-0.1186267734,
-0.0983867869,
0.0395726003,
-0.1171171367,
0.0870356336,
-0.1678488702,
0.1142572612,
0.0268999226,
-0.0553065538,
-0.6315291524,
-0.0129410308,
0.3205948472,
-0.1449029595,
-0.1014325395,
0.2506066859,
-0.6014735103,
0.3429088593,
0.1318705082,
0.5309945941,
0.0145979645,
0.1166361868,
0.1949885637,
0.2470779717,
-0.2960153818,
0.4217509627,
-0.2266984731,
-0.0420271866,
0.0346691571,
-0.0588206649,
-0.1218070611,
0.4785677195,
0.2849896848,
-0.2606021464,
0.0978315249,
-0.0784842595,
0.0227259304,
-0.110662438,
0.3640692532,
0.1970127076,
-0.0533646606,
0.0772827864,
0.1710083932,
-0.0954404399,
-0.174489975,
0.1174801439,
0.1384010464,
-0.1021390706,
0.1903929114,
0.0709636509,
-0.1389862001,
-0.131798625,
-0.2130444795,
0.1211961061,
-0.0878356695,
0.2369574606,
0.1870570183,
-0.1878825724,
-0.0876030326,
-0.1486044228,
0.2090399712,
0.5161313415,
-0.2350451052,
-0.0758554786,
0.0244940259,
0.1951781958,
0.3501952589,
0.2010137439,
-0.3267982006,
0.256172359,
0.0371250585,
0.2322168946,
0.3163651526,
-0.4490188062,
-0.6639242768,
-0.0901995376,
-0.0756991059,
0.0397731885,
0.3317386806,
0.0975896716,
0.3703520298,
0.2930629849,
-0.1459471732,
0.517279923,
0.1696161181,
0.0434673503,
-0.2609555423,
-0.3448404372,
0.0231418386,
0.1270142943,
-0.0733680651,
0.1632383764,
-0.0440483578,
-0.2676259577,
0.3614015579,
-0.1503374577,
-0.1021284238,
0.2690655291,
0.5216954947,
0.215987131,
0.2130894959,
-0.2032638788,
-0.084426254,
0.128285557,
-0.1522226632,
0.0228897352,
-0.0782169998,
-0.2090479285,
-0.0135676069,
0.1977491379,
-0.3135471046,
-0.1740485877,
-0.0746522471,
0.152976945,
0.288199544,
-0.1318623573,
-0.0989452675,
0.0493431352,
-0.3399662971,
0.2049804181,
-0.5214463472,
0.4270996451,
-0.0935478881,
-0.3137367964,
-0.1872017384,
0.2583496571,
0.0134846233,
-0.1509951055,
-0.1589761823,
0.1067028642,
0.4748961627,
-0.4063609838,
0.1756882519,
-0.3079209328,
-0.0195667427,
-0.1098887622,
0.1134151667,
0.0090820603,
0.144397378,
0.2156582773,
-0.0095154187,
0.622720778,
0.3724328578,
0.1507986039,
-0.0765271783,
0.1891472936,
0.1473812014,
-0.1591728479,
-0.0528286844,
-0.5078775883,
-0.1828076094,
0.3740832508,
0.1135972589,
0.028329758,
-0.440877378,
0.4054225683,
0.240116924,
0.0603240877,
-0.1184274107,
0.1541836113,
-0.0568144135,
-0.0367471986,
0.0292891208,
-0.2139267623,
0.1052959934,
0.3675740659,
-0.2779199183,
-0.3208731413,
0.008762042,
-0.042188555,
0.0650622323,
0.373608917,
-0.0423654243,
-0.2475414127,
0.0935089663,
-0.0054280525,
-0.3840717971,
-0.3060503602,
-0.0381189995,
0.0701654032,
-0.1114427224,
0.1743903011,
-0.374951601,
-0.1492135674,
0.087208204,
-0.4578384757,
0.1916308999,
-0.0981231481,
0.1739200056,
0.2258579582,
-0.2370434701,
0.4466657043,
0.1191978082,
0.1598462015,
0.0529773571,
-0.1998585612,
-0.1200763583,
-0.1755335033,
-0.4576168358,
-0.0922897384,
-0.2286257446,
0.4021475017,
0.1773946136,
0.215804413,
-0.0975216478,
-0.2927098274,
0.0211019404,
0.0287383385,
0.1406078339,
0.2020926774,
0.1879705191,
0.0467986465,
-0.2393502444,
-0.1135706902,
0.0707940906,
0.1661297232,
-0.2033127248,
-0.1762377322,
-0.0430421755,
-0.0814639553,
0.1018627658,
-0.21136114,
-0.2890200615,
-0.2259372473,
0.1515955776,
0.0919152722,
0.109553732,
0.0218208209,
0.3725822568,
0.0551364943,
-0.2080986798,
-0.1080141738,
-0.2729106843,
0.0094553968,
-0.0735265464,
-0.0414994806,
-0.2861771286,
-0.5065014362,
-0.3398022652,
-0.2370946854,
0.1956368536,
-0.2353992611,
-0.3361150026,
-0.3440830112,
0.1592897773,
0.1556720138,
0.1409610957,
0.3760392666,
0.2247822285,
-0.0875744298,
-0.1666591167,
-0.3055535257,
0.4445737898,
0.140002057,
0.0883000046,
0.1077336594,
0.4067178667,
-0.1840822548,
0.5277171731,
0.1247857288,
-0.5209574103,
0.3717171848,
-0.0140295811,
0.0158725176,
-0.0675411001,
-0.2851008177,
0.1656641364,
0.1925269514,
-0.1816553771,
0.1626511216,
-0.1984015703,
0.0591690205,
0.3394256532,
0.3197871745,
-0.3819198906,
-0.27683568,
-0.0537334718,
-0.1595196873,
-0.3160978258,
0.0252678134,
0.3339837492,
-0.5367693305,
0.2368258983,
0.0828458667,
0.1489063799,
0.1879774779,
-0.0566982776,
-0.0769122541,
-0.1068075001,
-0.3594060838,
0.4149491787,
0.0144541357,
0.240124017,
0.0846146643,
-0.0340126231,
0.3434587419,
0.0684321597,
0.9571902752,
-0.061478775,
-0.0239520688,
0.3976439238,
-0.2214731723,
-0.3634821773,
0.0256642625,
-0.1771549582,
0.079758361,
0.1019297019,
0.2299426794,
-0.1601285785,
-0.3377130628,
0.0265322421,
0.016738914,
-0.1257558167,
0.0394157693,
-0.0708354861,
-0.4167459011,
-0.4663289785,
0.1146948636,
-0.0202142969,
0.1422991306,
0.0958662629,
-0.21130234,
-0.504160881,
-0.1101823822,
-0.136493504,
0.1517461836,
0.3936245441,
0.1454341412,
0.1311240345,
0.1425933242,
0.3486031294,
0.623842597,
0.2257176638,
-0.0752178878,
-0.2151193321,
-0.006214743,
0.1642841995,
0.0945564508,
0.428067714,
-0.0638239607,
0.4363098443,
-0.0415077582,
0.1246344671,
0.0061393776,
0.2227658778,
0.2262483984,
0.2113565058,
0.0564514585,
-0.4379891157,
0.5630466342,
0.0210872497,
-0.1794915795,
0.3136000633,
0.1618501097,
-0.2578880191,
1.0739570856,
0.2233301252,
1.0657092333,
-0.0835494325,
0.2263789922,
0.1986541748,
0.064455241,
0.4328966141,
0.122805804,
0.1599915624,
-0.3314411938,
0.2574234605,
0.007882921,
-0.3100055456,
0.1413200498,
0.2411956638,
-0.0830922723,
-0.0947632715,
-0.2193004191,
-0.2675542235,
-0.0694855601,
0.0392062552,
0.3647850752,
-0.349655807,
-0.3084584177,
-0.0315425619,
0.2854219973,
0.2928269207,
0.2488316,
-0.1491138041,
-0.4724775255,
-0.1838761866,
-0.2159604281,
0.0052996236,
-0.2775571048,
0.2701745927,
0.1710419506,
-0.3057253659,
-0.1693383157,
0.2380592972,
0.1891989112,
-0.1477199346,
-0.1746554077,
0.1169823185,
0.1554353386,
-0.0974493846,
-0.0089843469,
-0.2751390636,
0.3802000284,
0.1556448042,
-0.3932551146,
0.0153316176,
0.1589363813,
-0.4387567639,
-0.0904450417,
-0.0801716223,
-0.2309859246,
-0.2791681588,
-0.351500988,
-0.065742135,
-0.1390072405,
-0.4286188185,
-0.0218833257,
0.0130572785,
-0.2057515532,
0.415224731,
-0.1201147214,
-0.3386862874,
-0.1725047976,
0.576625526,
0.2049619853,
0.0953759104,
0.4988759756,
0.2045175582,
-0.1476263404,
-0.1861621886,
-0.4698063433,
0.4244087934,
0.0736838207,
0.3030473888,
-0.0764293969,
-0.3145205379,
-0.1098782569,
-0.0109323841,
0.0322495252,
-0.133823961,
-0.5415476561,
-0.2227722853,
-0.5453009009,
0.1993275583,
0.0189192854,
0.4727432132,
-0.2054035813,
0.5167486072,
-0.5072892308,
-0.2756149173,
-0.1670344919,
-0.0221071243,
-0.4664251804,
0.023472596,
-0.3302721679,
-0.1691893935,
0.0772076398,
0.0515028909,
0.0324487649,
-0.0511221588,
-0.0658899918,
-0.1055540666,
-0.1573595107,
0.1804270297,
0.0931682587,
-0.1917532831,
-0.1235965937,
-0.0418644063,
-0.1471068412,
-0.1790009886,
0.182298407,
0.2753229141,
-0.0650034398,
0.1734468341,
0.0464402586,
0.0953358859,
0.2519488037,
0.0938530266,
-0.0296615623,
0.3096498251,
0.0970651582,
0.1175346524,
-0.1214081943,
-0.031148253,
-0.0639293492,
0.0233556144,
-0.0015802872,
-0.0470110252,
-0.0850182772,
-0.0344836861,
-0.3594438732,
0.3289602697,
0.2795449495,
0.5147304535,
0.0854525194,
-0.2399227768,
0.2423895746,
0.0463318825,
-0.2119930685,
-0.2285026163,
0.3535672128,
-0.2673208714,
0.2338822186,
0.2101587057,
-0.0903714374,
0.1981292665,
-0.3148199916,
-0.0522817858,
0.2038477808,
0.3505207896,
0.1475191414,
0.2091765255,
0.131710127,
0.0515641682,
0.136632815,
0.4851373434,
0.7115124464,
0.5667837262,
-0.010982289,
0.6284353137,
-0.233982116,
0.0387725905,
0.0330127925,
-0.5802500248,
0.5933228135,
0.0816221312,
-0.0160703845,
0.0552338772,
0.0665337965,
0.1697085202,
0.1220054403,
-0.2425165921,
-0.0767810419,
0.285615176,
-0.2219860405,
-0.5239714384,
-0.1637641191,
0.0134421373,
0.0549098551,
-0.1030841619,
-0.0041456423,
-0.2838755846,
0.1822269857,
-0.1851774901,
-0.2403618097,
-0.2812504172,
-0.2857098877,
-0.0640087649,
0.1365904659,
-0.0753129721,
-0.1024112999,
-0.100636214,
-0.1416369528,
-0.1163165644,
0.0588547625,
0.0947046578,
0.1416911483,
-0.5192409754,
-0.037828967,
-0.0573734865,
-0.1766137481,
-0.2065092325,
0.0233232342,
-0.1637975723,
-0.0212644376,
0.197740823,
-0.0061105313,
-0.0758737698,
-0.3445661366,
0.2321971655,
0.3549711704,
0.0381553471,
0.0939721242,
0.0618268177,
0.078184031,
0.0891680419,
-0.0918709636,
-0.2969631851,
-0.0976454169,
0.3326541185,
-0.0406774879,
0.1927183419,
0.1647500843,
0.0005435805,
-0.2479169369,
0.3903943598,
0.3924216032,
0.324752599,
-0.2164477855,
0.3476311266,
-0.0362353921,
0.2104083002,
-0.0479442738,
-0.3185999393,
0.377913475,
0.1847468168,
0.0428150631,
-0.0657227114,
0.0145695256,
0.3071997762,
0.3281788826,
0.6772938967,
-0.2702368796,
-0.1875335723,
-0.3799322546,
0.0430868566,
0.2865405381,
-0.3073633313,
-0.0778109729,
0.0472266488,
-0.1265608966,
-0.33982113,
-0.0070950259,
0.1033459008,
-0.1698275954,
0.2588122487,
0.3162373006,
0.146572873,
-0.0743975714,
-0.1218500584,
-0.1294411421,
-0.2518592179,
-0.2222987115,
-0.2623868287,
-0.1795755327,
0.1798288226,
-0.0964838117,
-0.0973354876,
-0.1671266854,
0.0176446419,
0.399120152,
-0.2093282044,
-0.1668925881,
0.317743212,
-0.2315444946,
0.0597220436,
0.0446629822,
0.2218234688,
-0.0057721669,
0.4940704703,
-0.2855693698,
-0.078523986,
0.786021173,
-0.3918511868,
-0.0228455681,
-0.2092846036,
0.2463771105,
-0.0842901021,
-0.1669452488,
-0.2345831394,
0.0083821137,
0.2062710375,
0.0018959455,
-0.3033871055,
0.0600999035,
0.4667140841,
-0.0710080341,
-0.1460603029,
0.3939971626,
0.1948146075,
0.1731725633,
0.1124255583,
-0.2069986612
] |
https://github.com/huggingface/datasets/issues/1805 | can't pickle SwigPyObject objects when calling dataset.get_nearest_examples from FAISS index | I totally forgot to answer this issue, I'm so sorry.
I was able to get it working by installing `datasets` from source. Huge thanks! | So, I have the following instances in my dataset
```
{'question': 'An astronomer observes that a planet rotates faster after a meteorite impact. Which is the most likely effect of
this increase in rotation?',
'answer': 'C',
'example_id': 'ARCCH_Mercury_7175875',
'options':[{'option_context': 'One effect of increased amperage in the planetary world (..)', 'option_id': 'A', 'option_text': 'Planetary density will decrease.'},
(...)]}
```
The `options` value is always an list with 4 options, each one is a dict with `option_context`; `option_id` and `option_text`.
I would like to overwrite the `option_context` of each instance of my dataset for a dpr result that I am developing. Then, I trained a model already and save it in a FAISS index
```
dpr_dataset = load_dataset(
"text",
data_files=ARC_CORPUS_TEXT,
cache_dir=CACHE_DIR,
split="train[:100%]",
)
dpr_dataset.load_faiss_index("embeddings", f"{ARC_CORPUS_FAISS}")
torch.set_grad_enabled(False)
```
Then, as a processor of my dataset, I created a map function that calls the `dpr_dataset` for each _option_
```
def generate_context(example):
question_text = example['question']
for option in example['options']:
question_with_option = question_text + " " + option['option_text']
tokenize_text = question_tokenizer(question_with_option, return_tensors="pt").to(device)
question_embed = (
question_encoder(**tokenize_text)
)[0][0].cpu().numpy()
_, retrieved_examples = dpr_dataset.get_nearest_examples(
"embeddings", question_embed, k=10
)
# option["option_context"] = retrieved_examples["text"]
# option["option_context"] = " ".join(option["option_context"]).strip()
#result_dict = {
# 'example_id': example['example_id'],
# 'answer': example['answer'],
# 'question': question_text,
#options': example['options']
# }
return example
```
I intentionally commented on this portion of the code.
But when I call the `map` method, `ds_with_context = dataset.map(generate_context,load_from_cache_file=False)`
It calls the following error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-55-75a458ce205c> in <module>
----> 1 ds_with_context = dataset.map(generate_context,load_from_cache_file=False)
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc)
301 num_proc=num_proc,
302 )
--> 303 for k, dataset in self.items()
304 }
305 )
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0)
301 num_proc=num_proc,
302 )
--> 303 for k, dataset in self.items()
304 }
305 )
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint)
1257 fn_kwargs=fn_kwargs,
1258 new_fingerprint=new_fingerprint,
-> 1259 update_data=update_data,
1260 )
1261 else:
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs)
155 }
156 # apply actual function
--> 157 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
158 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
159 # re-apply format to the output
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs)
156 kwargs_for_fingerprint["fingerprint_name"] = fingerprint_name
157 kwargs[fingerprint_name] = update_fingerprint(
--> 158 self._fingerprint, transform, kwargs_for_fingerprint
159 )
160
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in update_fingerprint(fingerprint, transform, transform_args)
103 for key in sorted(transform_args):
104 hasher.update(key)
--> 105 hasher.update(transform_args[key])
106 return hasher.hexdigest()
107
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in update(self, value)
55 def update(self, value):
56 self.m.update(f"=={type(value)}==".encode("utf8"))
---> 57 self.m.update(self.hash(value).encode("utf-8"))
58
59 def hexdigest(self):
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in hash(cls, value)
51 return cls.dispatch[type(value)](cls, value)
52 else:
---> 53 return cls.hash_default(value)
54
55 def update(self, value):
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in hash_default(cls, value)
44 @classmethod
45 def hash_default(cls, value):
---> 46 return cls.hash_bytes(dumps(value))
47
48 @classmethod
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in dumps(obj)
387 file = StringIO()
388 with _no_cache_fields(obj):
--> 389 dump(obj, file)
390 return file.getvalue()
391
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in dump(obj, file)
359 def dump(obj, file):
360 """pickle an object to a file"""
--> 361 Pickler(file, recurse=True).dump(obj)
362 return
363
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in dump(self, obj)
452 raise PicklingError(msg)
453 else:
--> 454 StockPickler.dump(self, obj)
455 stack.clear() # clear record of 'recursion-sensitive' pickled objects
456 return
/usr/lib/python3.7/pickle.py in dump(self, obj)
435 if self.proto >= 4:
436 self.framer.start_framing()
--> 437 self.save(obj)
438 self.write(STOP)
439 self.framer.end_framing()
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in save_function(pickler, obj)
554 dill._dill._create_function,
555 (obj.__code__, globs, obj.__name__, obj.__defaults__, obj.__closure__, obj.__dict__, fkwdefaults),
--> 556 obj=obj,
557 )
558 else:
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
636 else:
637 save(func)
--> 638 save(args)
639 write(REDUCE)
640
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
/usr/lib/python3.7/pickle.py in save_tuple(self, obj)
784 write(MARK)
785 for element in obj:
--> 786 save(element)
787
788 if id(obj) in memo:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
885 k, v = tmp[0]
886 save(k)
--> 887 save(v)
888 write(SETITEM)
889 # else tmp is empty, and we're done
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
885 k, v = tmp[0]
886 save(k)
--> 887 save(v)
888 write(SETITEM)
889 # else tmp is empty, and we're done
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
522 reduce = getattr(obj, "__reduce_ex__", None)
523 if reduce is not None:
--> 524 rv = reduce(self.proto)
525 else:
526 reduce = getattr(obj, "__reduce__", None)
TypeError: can't pickle SwigPyObject objects
```
Which I have no idea how to solve/deal with it
| 24 | can't pickle SwigPyObject objects when calling dataset.get_nearest_examples from FAISS index
So, I have the following instances in my dataset
```
{'question': 'An astronomer observes that a planet rotates faster after a meteorite impact. Which is the most likely effect of
this increase in rotation?',
'answer': 'C',
'example_id': 'ARCCH_Mercury_7175875',
'options':[{'option_context': 'One effect of increased amperage in the planetary world (..)', 'option_id': 'A', 'option_text': 'Planetary density will decrease.'},
(...)]}
```
The `options` value is always an list with 4 options, each one is a dict with `option_context`; `option_id` and `option_text`.
I would like to overwrite the `option_context` of each instance of my dataset for a dpr result that I am developing. Then, I trained a model already and save it in a FAISS index
```
dpr_dataset = load_dataset(
"text",
data_files=ARC_CORPUS_TEXT,
cache_dir=CACHE_DIR,
split="train[:100%]",
)
dpr_dataset.load_faiss_index("embeddings", f"{ARC_CORPUS_FAISS}")
torch.set_grad_enabled(False)
```
Then, as a processor of my dataset, I created a map function that calls the `dpr_dataset` for each _option_
```
def generate_context(example):
question_text = example['question']
for option in example['options']:
question_with_option = question_text + " " + option['option_text']
tokenize_text = question_tokenizer(question_with_option, return_tensors="pt").to(device)
question_embed = (
question_encoder(**tokenize_text)
)[0][0].cpu().numpy()
_, retrieved_examples = dpr_dataset.get_nearest_examples(
"embeddings", question_embed, k=10
)
# option["option_context"] = retrieved_examples["text"]
# option["option_context"] = " ".join(option["option_context"]).strip()
#result_dict = {
# 'example_id': example['example_id'],
# 'answer': example['answer'],
# 'question': question_text,
#options': example['options']
# }
return example
```
I intentionally commented on this portion of the code.
But when I call the `map` method, `ds_with_context = dataset.map(generate_context,load_from_cache_file=False)`
It calls the following error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-55-75a458ce205c> in <module>
----> 1 ds_with_context = dataset.map(generate_context,load_from_cache_file=False)
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc)
301 num_proc=num_proc,
302 )
--> 303 for k, dataset in self.items()
304 }
305 )
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0)
301 num_proc=num_proc,
302 )
--> 303 for k, dataset in self.items()
304 }
305 )
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint)
1257 fn_kwargs=fn_kwargs,
1258 new_fingerprint=new_fingerprint,
-> 1259 update_data=update_data,
1260 )
1261 else:
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs)
155 }
156 # apply actual function
--> 157 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
158 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
159 # re-apply format to the output
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs)
156 kwargs_for_fingerprint["fingerprint_name"] = fingerprint_name
157 kwargs[fingerprint_name] = update_fingerprint(
--> 158 self._fingerprint, transform, kwargs_for_fingerprint
159 )
160
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in update_fingerprint(fingerprint, transform, transform_args)
103 for key in sorted(transform_args):
104 hasher.update(key)
--> 105 hasher.update(transform_args[key])
106 return hasher.hexdigest()
107
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in update(self, value)
55 def update(self, value):
56 self.m.update(f"=={type(value)}==".encode("utf8"))
---> 57 self.m.update(self.hash(value).encode("utf-8"))
58
59 def hexdigest(self):
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in hash(cls, value)
51 return cls.dispatch[type(value)](cls, value)
52 else:
---> 53 return cls.hash_default(value)
54
55 def update(self, value):
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/fingerprint.py in hash_default(cls, value)
44 @classmethod
45 def hash_default(cls, value):
---> 46 return cls.hash_bytes(dumps(value))
47
48 @classmethod
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in dumps(obj)
387 file = StringIO()
388 with _no_cache_fields(obj):
--> 389 dump(obj, file)
390 return file.getvalue()
391
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in dump(obj, file)
359 def dump(obj, file):
360 """pickle an object to a file"""
--> 361 Pickler(file, recurse=True).dump(obj)
362 return
363
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in dump(self, obj)
452 raise PicklingError(msg)
453 else:
--> 454 StockPickler.dump(self, obj)
455 stack.clear() # clear record of 'recursion-sensitive' pickled objects
456 return
/usr/lib/python3.7/pickle.py in dump(self, obj)
435 if self.proto >= 4:
436 self.framer.start_framing()
--> 437 self.save(obj)
438 self.write(STOP)
439 self.framer.end_framing()
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/datasets/utils/py_utils.py in save_function(pickler, obj)
554 dill._dill._create_function,
555 (obj.__code__, globs, obj.__name__, obj.__defaults__, obj.__closure__, obj.__dict__, fkwdefaults),
--> 556 obj=obj,
557 )
558 else:
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
636 else:
637 save(func)
--> 638 save(args)
639 write(REDUCE)
640
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
/usr/lib/python3.7/pickle.py in save_tuple(self, obj)
784 write(MARK)
785 for element in obj:
--> 786 save(element)
787
788 if id(obj) in memo:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
885 k, v = tmp[0]
886 save(k)
--> 887 save(v)
888 write(SETITEM)
889 # else tmp is empty, and we're done
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
880 for k, v in tmp:
881 save(k)
--> 882 save(v)
883 write(SETITEMS)
884 elif n:
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
547
548 # Save the reduce() output and finally memoize the object
--> 549 self.save_reduce(obj=obj, *rv)
550
551 def persistent_id(self, obj):
/usr/lib/python3.7/pickle.py in save_reduce(self, func, args, state, listitems, dictitems, obj)
660
661 if state is not None:
--> 662 save(state)
663 write(BUILD)
664
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
502 f = self.dispatch.get(t)
503 if f is not None:
--> 504 f(self, obj) # Call unbound method with explicit self
505 return
506
~/.cache/pypoetry/virtualenvs/masters-utTTC0p8-py3.7/lib/python3.7/site-packages/dill/_dill.py in save_module_dict(pickler, obj)
939 # we only care about session the first pass thru
940 pickler._session = False
--> 941 StockPickler.save_dict(pickler, obj)
942 log.info("# D2")
943 return
/usr/lib/python3.7/pickle.py in save_dict(self, obj)
854
855 self.memoize(obj)
--> 856 self._batch_setitems(obj.items())
857
858 dispatch[dict] = save_dict
/usr/lib/python3.7/pickle.py in _batch_setitems(self, items)
885 k, v = tmp[0]
886 save(k)
--> 887 save(v)
888 write(SETITEM)
889 # else tmp is empty, and we're done
/usr/lib/python3.7/pickle.py in save(self, obj, save_persistent_id)
522 reduce = getattr(obj, "__reduce_ex__", None)
523 if reduce is not None:
--> 524 rv = reduce(self.proto)
525 else:
526 reduce = getattr(obj, "__reduce__", None)
TypeError: can't pickle SwigPyObject objects
```
Which I have no idea how to solve/deal with it
I totally forgot to answer this issue, I'm so sorry.
I was able to get it working by installing `datasets` from source. Huge thanks! | [
0.0690419376,
-0.3887842894,
-0.0696357638,
0.2468253374,
0.1642264873,
0.027764339,
0.1784276366,
0.0541121922,
0.4089653194,
0.5476049781,
-0.0500993133,
0.4959973991,
0.1157931685,
-0.1273347586,
-0.2676261365,
0.0515105985,
0.0849943459,
0.013422451,
0.0216208585,
-0.2425850332,
-0.5357055664,
-0.0484027304,
-0.1984260529,
0.0493391603,
-0.0398413055,
0.0180334598,
-0.0332832076,
0.0954478011,
-0.0584460385,
-0.453925401,
0.4045755267,
0.2576844692,
0.2116613388,
-0.0134232575,
-0.0001266745,
0.0679020658,
0.2053472847,
-0.0212521944,
-0.1646227986,
0.0867502242,
-0.0015752311,
0.3058413267,
0.2944121659,
-0.3542492688,
-0.2179246843,
-0.2550705075,
-0.0504560918,
-0.1345559061,
0.0680650696,
0.1915956587,
0.06709259,
0.1456796527,
-0.1130728349,
-0.1586892605,
0.2215851396,
-0.0109134782,
-0.0620619506,
0.1621500403,
0.2719886303,
0.3066602349,
0.2544572353,
0.2748858333,
-0.2460707277,
0.0368728638,
-0.0725998655,
0.0926400349,
0.3378049135,
0.0920078605,
0.1556721777,
0.0969464555,
0.2498127818,
-0.2737823725,
-0.47020787,
-0.4137727618,
-0.0613962971,
-0.1567487717,
-0.2627950311,
-0.5509216189,
-0.0172369387,
0.24829261,
0.1254628897,
0.1021859795,
-0.0639563724,
0.5212544203,
0.4118609726,
0.0359548852,
0.0144237978,
0.2109335661,
0.1066410914,
-0.0576485768,
0.1366035491,
-0.1332528889,
-0.0283689201,
-0.1321198344,
-0.2131485492,
-0.1242144853,
0.4846387804,
-0.2354142368,
0.2450581491,
0.084626101,
-0.1290585548,
0.4014527202,
0.0691415444,
0.1075496301,
0.1615174562,
-0.1186267734,
-0.0983867869,
0.0395726003,
-0.1171171367,
0.0870356336,
-0.1678488702,
0.1142572612,
0.0268999226,
-0.0553065538,
-0.6315291524,
-0.0129410308,
0.3205948472,
-0.1449029595,
-0.1014325395,
0.2506066859,
-0.6014735103,
0.3429088593,
0.1318705082,
0.5309945941,
0.0145979645,
0.1166361868,
0.1949885637,
0.2470779717,
-0.2960153818,
0.4217509627,
-0.2266984731,
-0.0420271866,
0.0346691571,
-0.0588206649,
-0.1218070611,
0.4785677195,
0.2849896848,
-0.2606021464,
0.0978315249,
-0.0784842595,
0.0227259304,
-0.110662438,
0.3640692532,
0.1970127076,
-0.0533646606,
0.0772827864,
0.1710083932,
-0.0954404399,
-0.174489975,
0.1174801439,
0.1384010464,
-0.1021390706,
0.1903929114,
0.0709636509,
-0.1389862001,
-0.131798625,
-0.2130444795,
0.1211961061,
-0.0878356695,
0.2369574606,
0.1870570183,
-0.1878825724,
-0.0876030326,
-0.1486044228,
0.2090399712,
0.5161313415,
-0.2350451052,
-0.0758554786,
0.0244940259,
0.1951781958,
0.3501952589,
0.2010137439,
-0.3267982006,
0.256172359,
0.0371250585,
0.2322168946,
0.3163651526,
-0.4490188062,
-0.6639242768,
-0.0901995376,
-0.0756991059,
0.0397731885,
0.3317386806,
0.0975896716,
0.3703520298,
0.2930629849,
-0.1459471732,
0.517279923,
0.1696161181,
0.0434673503,
-0.2609555423,
-0.3448404372,
0.0231418386,
0.1270142943,
-0.0733680651,
0.1632383764,
-0.0440483578,
-0.2676259577,
0.3614015579,
-0.1503374577,
-0.1021284238,
0.2690655291,
0.5216954947,
0.215987131,
0.2130894959,
-0.2032638788,
-0.084426254,
0.128285557,
-0.1522226632,
0.0228897352,
-0.0782169998,
-0.2090479285,
-0.0135676069,
0.1977491379,
-0.3135471046,
-0.1740485877,
-0.0746522471,
0.152976945,
0.288199544,
-0.1318623573,
-0.0989452675,
0.0493431352,
-0.3399662971,
0.2049804181,
-0.5214463472,
0.4270996451,
-0.0935478881,
-0.3137367964,
-0.1872017384,
0.2583496571,
0.0134846233,
-0.1509951055,
-0.1589761823,
0.1067028642,
0.4748961627,
-0.4063609838,
0.1756882519,
-0.3079209328,
-0.0195667427,
-0.1098887622,
0.1134151667,
0.0090820603,
0.144397378,
0.2156582773,
-0.0095154187,
0.622720778,
0.3724328578,
0.1507986039,
-0.0765271783,
0.1891472936,
0.1473812014,
-0.1591728479,
-0.0528286844,
-0.5078775883,
-0.1828076094,
0.3740832508,
0.1135972589,
0.028329758,
-0.440877378,
0.4054225683,
0.240116924,
0.0603240877,
-0.1184274107,
0.1541836113,
-0.0568144135,
-0.0367471986,
0.0292891208,
-0.2139267623,
0.1052959934,
0.3675740659,
-0.2779199183,
-0.3208731413,
0.008762042,
-0.042188555,
0.0650622323,
0.373608917,
-0.0423654243,
-0.2475414127,
0.0935089663,
-0.0054280525,
-0.3840717971,
-0.3060503602,
-0.0381189995,
0.0701654032,
-0.1114427224,
0.1743903011,
-0.374951601,
-0.1492135674,
0.087208204,
-0.4578384757,
0.1916308999,
-0.0981231481,
0.1739200056,
0.2258579582,
-0.2370434701,
0.4466657043,
0.1191978082,
0.1598462015,
0.0529773571,
-0.1998585612,
-0.1200763583,
-0.1755335033,
-0.4576168358,
-0.0922897384,
-0.2286257446,
0.4021475017,
0.1773946136,
0.215804413,
-0.0975216478,
-0.2927098274,
0.0211019404,
0.0287383385,
0.1406078339,
0.2020926774,
0.1879705191,
0.0467986465,
-0.2393502444,
-0.1135706902,
0.0707940906,
0.1661297232,
-0.2033127248,
-0.1762377322,
-0.0430421755,
-0.0814639553,
0.1018627658,
-0.21136114,
-0.2890200615,
-0.2259372473,
0.1515955776,
0.0919152722,
0.109553732,
0.0218208209,
0.3725822568,
0.0551364943,
-0.2080986798,
-0.1080141738,
-0.2729106843,
0.0094553968,
-0.0735265464,
-0.0414994806,
-0.2861771286,
-0.5065014362,
-0.3398022652,
-0.2370946854,
0.1956368536,
-0.2353992611,
-0.3361150026,
-0.3440830112,
0.1592897773,
0.1556720138,
0.1409610957,
0.3760392666,
0.2247822285,
-0.0875744298,
-0.1666591167,
-0.3055535257,
0.4445737898,
0.140002057,
0.0883000046,
0.1077336594,
0.4067178667,
-0.1840822548,
0.5277171731,
0.1247857288,
-0.5209574103,
0.3717171848,
-0.0140295811,
0.0158725176,
-0.0675411001,
-0.2851008177,
0.1656641364,
0.1925269514,
-0.1816553771,
0.1626511216,
-0.1984015703,
0.0591690205,
0.3394256532,
0.3197871745,
-0.3819198906,
-0.27683568,
-0.0537334718,
-0.1595196873,
-0.3160978258,
0.0252678134,
0.3339837492,
-0.5367693305,
0.2368258983,
0.0828458667,
0.1489063799,
0.1879774779,
-0.0566982776,
-0.0769122541,
-0.1068075001,
-0.3594060838,
0.4149491787,
0.0144541357,
0.240124017,
0.0846146643,
-0.0340126231,
0.3434587419,
0.0684321597,
0.9571902752,
-0.061478775,
-0.0239520688,
0.3976439238,
-0.2214731723,
-0.3634821773,
0.0256642625,
-0.1771549582,
0.079758361,
0.1019297019,
0.2299426794,
-0.1601285785,
-0.3377130628,
0.0265322421,
0.016738914,
-0.1257558167,
0.0394157693,
-0.0708354861,
-0.4167459011,
-0.4663289785,
0.1146948636,
-0.0202142969,
0.1422991306,
0.0958662629,
-0.21130234,
-0.504160881,
-0.1101823822,
-0.136493504,
0.1517461836,
0.3936245441,
0.1454341412,
0.1311240345,
0.1425933242,
0.3486031294,
0.623842597,
0.2257176638,
-0.0752178878,
-0.2151193321,
-0.006214743,
0.1642841995,
0.0945564508,
0.428067714,
-0.0638239607,
0.4363098443,
-0.0415077582,
0.1246344671,
0.0061393776,
0.2227658778,
0.2262483984,
0.2113565058,
0.0564514585,
-0.4379891157,
0.5630466342,
0.0210872497,
-0.1794915795,
0.3136000633,
0.1618501097,
-0.2578880191,
1.0739570856,
0.2233301252,
1.0657092333,
-0.0835494325,
0.2263789922,
0.1986541748,
0.064455241,
0.4328966141,
0.122805804,
0.1599915624,
-0.3314411938,
0.2574234605,
0.007882921,
-0.3100055456,
0.1413200498,
0.2411956638,
-0.0830922723,
-0.0947632715,
-0.2193004191,
-0.2675542235,
-0.0694855601,
0.0392062552,
0.3647850752,
-0.349655807,
-0.3084584177,
-0.0315425619,
0.2854219973,
0.2928269207,
0.2488316,
-0.1491138041,
-0.4724775255,
-0.1838761866,
-0.2159604281,
0.0052996236,
-0.2775571048,
0.2701745927,
0.1710419506,
-0.3057253659,
-0.1693383157,
0.2380592972,
0.1891989112,
-0.1477199346,
-0.1746554077,
0.1169823185,
0.1554353386,
-0.0974493846,
-0.0089843469,
-0.2751390636,
0.3802000284,
0.1556448042,
-0.3932551146,
0.0153316176,
0.1589363813,
-0.4387567639,
-0.0904450417,
-0.0801716223,
-0.2309859246,
-0.2791681588,
-0.351500988,
-0.065742135,
-0.1390072405,
-0.4286188185,
-0.0218833257,
0.0130572785,
-0.2057515532,
0.415224731,
-0.1201147214,
-0.3386862874,
-0.1725047976,
0.576625526,
0.2049619853,
0.0953759104,
0.4988759756,
0.2045175582,
-0.1476263404,
-0.1861621886,
-0.4698063433,
0.4244087934,
0.0736838207,
0.3030473888,
-0.0764293969,
-0.3145205379,
-0.1098782569,
-0.0109323841,
0.0322495252,
-0.133823961,
-0.5415476561,
-0.2227722853,
-0.5453009009,
0.1993275583,
0.0189192854,
0.4727432132,
-0.2054035813,
0.5167486072,
-0.5072892308,
-0.2756149173,
-0.1670344919,
-0.0221071243,
-0.4664251804,
0.023472596,
-0.3302721679,
-0.1691893935,
0.0772076398,
0.0515028909,
0.0324487649,
-0.0511221588,
-0.0658899918,
-0.1055540666,
-0.1573595107,
0.1804270297,
0.0931682587,
-0.1917532831,
-0.1235965937,
-0.0418644063,
-0.1471068412,
-0.1790009886,
0.182298407,
0.2753229141,
-0.0650034398,
0.1734468341,
0.0464402586,
0.0953358859,
0.2519488037,
0.0938530266,
-0.0296615623,
0.3096498251,
0.0970651582,
0.1175346524,
-0.1214081943,
-0.031148253,
-0.0639293492,
0.0233556144,
-0.0015802872,
-0.0470110252,
-0.0850182772,
-0.0344836861,
-0.3594438732,
0.3289602697,
0.2795449495,
0.5147304535,
0.0854525194,
-0.2399227768,
0.2423895746,
0.0463318825,
-0.2119930685,
-0.2285026163,
0.3535672128,
-0.2673208714,
0.2338822186,
0.2101587057,
-0.0903714374,
0.1981292665,
-0.3148199916,
-0.0522817858,
0.2038477808,
0.3505207896,
0.1475191414,
0.2091765255,
0.131710127,
0.0515641682,
0.136632815,
0.4851373434,
0.7115124464,
0.5667837262,
-0.010982289,
0.6284353137,
-0.233982116,
0.0387725905,
0.0330127925,
-0.5802500248,
0.5933228135,
0.0816221312,
-0.0160703845,
0.0552338772,
0.0665337965,
0.1697085202,
0.1220054403,
-0.2425165921,
-0.0767810419,
0.285615176,
-0.2219860405,
-0.5239714384,
-0.1637641191,
0.0134421373,
0.0549098551,
-0.1030841619,
-0.0041456423,
-0.2838755846,
0.1822269857,
-0.1851774901,
-0.2403618097,
-0.2812504172,
-0.2857098877,
-0.0640087649,
0.1365904659,
-0.0753129721,
-0.1024112999,
-0.100636214,
-0.1416369528,
-0.1163165644,
0.0588547625,
0.0947046578,
0.1416911483,
-0.5192409754,
-0.037828967,
-0.0573734865,
-0.1766137481,
-0.2065092325,
0.0233232342,
-0.1637975723,
-0.0212644376,
0.197740823,
-0.0061105313,
-0.0758737698,
-0.3445661366,
0.2321971655,
0.3549711704,
0.0381553471,
0.0939721242,
0.0618268177,
0.078184031,
0.0891680419,
-0.0918709636,
-0.2969631851,
-0.0976454169,
0.3326541185,
-0.0406774879,
0.1927183419,
0.1647500843,
0.0005435805,
-0.2479169369,
0.3903943598,
0.3924216032,
0.324752599,
-0.2164477855,
0.3476311266,
-0.0362353921,
0.2104083002,
-0.0479442738,
-0.3185999393,
0.377913475,
0.1847468168,
0.0428150631,
-0.0657227114,
0.0145695256,
0.3071997762,
0.3281788826,
0.6772938967,
-0.2702368796,
-0.1875335723,
-0.3799322546,
0.0430868566,
0.2865405381,
-0.3073633313,
-0.0778109729,
0.0472266488,
-0.1265608966,
-0.33982113,
-0.0070950259,
0.1033459008,
-0.1698275954,
0.2588122487,
0.3162373006,
0.146572873,
-0.0743975714,
-0.1218500584,
-0.1294411421,
-0.2518592179,
-0.2222987115,
-0.2623868287,
-0.1795755327,
0.1798288226,
-0.0964838117,
-0.0973354876,
-0.1671266854,
0.0176446419,
0.399120152,
-0.2093282044,
-0.1668925881,
0.317743212,
-0.2315444946,
0.0597220436,
0.0446629822,
0.2218234688,
-0.0057721669,
0.4940704703,
-0.2855693698,
-0.078523986,
0.786021173,
-0.3918511868,
-0.0228455681,
-0.2092846036,
0.2463771105,
-0.0842901021,
-0.1669452488,
-0.2345831394,
0.0083821137,
0.2062710375,
0.0018959455,
-0.3033871055,
0.0600999035,
0.4667140841,
-0.0710080341,
-0.1460603029,
0.3939971626,
0.1948146075,
0.1731725633,
0.1124255583,
-0.2069986612
] |
https://github.com/huggingface/datasets/issues/1803 | Querying examples from big datasets is slower than small datasets | Hello, @lhoestq / @gaceladri : We have been seeing similar behavior with bigger datasets, where querying time increases. Are you folks aware of any solution that fixes this problem yet? | After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed. | 30 | Querying examples from big datasets is slower than small datasets
After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed.
Hello, @lhoestq / @gaceladri : We have been seeing similar behavior with bigger datasets, where querying time increases. Are you folks aware of any solution that fixes this problem yet? | [
-0.4054937661,
0.058644373,
-0.0799715444,
0.131532535,
-0.0796942189,
-0.177691564,
0.2441748083,
0.4918093979,
-0.2313988209,
0.1801939607,
0.0814937055,
0.0550893359,
0.1250858158,
-0.1007566899,
0.1307258159,
-0.273406595,
0.0807414576,
0.1248459145,
-0.0751321092,
-0.0345287286,
0.0240302868,
-0.1902867854,
-0.3486272097,
0.0184701234,
-0.0663275197,
-0.2240722775,
-0.2307067364,
0.1072062477,
-0.1658503264,
-0.4173947275,
-0.0595364235,
-0.1528191417,
0.2299300432,
0.4270309806,
-0.0001130733,
0.0164050516,
0.2279307693,
0.089417696,
-0.1997471303,
0.1829342395,
0.174807474,
-0.2838543952,
0.0868746042,
-0.4097664654,
-0.047154028,
-0.2971981466,
0.0934278518,
0.0189006701,
-0.0412533991,
0.3089760244,
0.1403642595,
0.5131547451,
-0.1917047948,
-0.1336634606,
0.6230677962,
0.2051521838,
-0.3506301343,
0.5299630761,
0.5806370974,
-0.0487997942,
-0.3053151965,
0.1361404061,
-0.0814443007,
0.2701411247,
0.0370223783,
0.1979731321,
-0.1128053069,
0.1795918941,
0.123810336,
0.4088887572,
0.3083907664,
-0.0893914253,
-0.314886421,
-0.2920186222,
-0.0569282286,
-0.2332931459,
0.0203077532,
0.3264190555,
-0.2583793104,
0.2713419497,
-0.3137760758,
0.1547778696,
-0.1056507826,
0.1795517504,
-0.1511591077,
-0.0686158985,
0.1150509268,
0.1985103935,
0.0937959924,
0.0133131156,
0.1511933506,
-0.1696210355,
0.0284059588,
-0.0521108434,
-0.2883044481,
-0.0881550089,
0.1556631625,
0.1755785048,
0.2685058117,
0.159310326,
0.4223206937,
0.1182837933,
0.265193373,
0.0943621695,
0.045135688,
-0.0090213399,
-0.2695649862,
-0.0009782977,
0.3478800952,
0.2753002644,
-0.2945163548,
0.0208777506,
-0.2383214086,
-0.1844542176,
0.1815628409,
-0.1973295361,
-0.0274536777,
-0.133716926,
0.0043231249,
-0.0873045102,
-0.3421144783,
-0.1278228015,
-0.0265573822,
0.4784686267,
-0.1834657937,
-0.026572492,
-0.2126669139,
0.1222239435,
-0.3353428841,
-0.2540251911,
-0.1243123338,
-0.1883357167,
-0.1600800753,
0.2303076535,
0.1097954586,
0.056097813,
0.3020734787,
0.0585403554,
-0.1985151023,
0.2419625521,
0.3923715055,
-0.1808657944,
0.1044564769,
0.0197550524,
0.0112556247,
0.0635321811,
-0.1637399793,
0.2447642088,
-0.3910899758,
0.1972705871,
-0.1953565329,
-0.338478148,
0.0306391455,
0.0919929966,
-0.1056952402,
-0.0997600779,
-0.2270812392,
0.246245265,
-0.0694223642,
-0.1997458488,
-0.0774376392,
-0.0941937268,
0.0402901322,
-0.1531326622,
0.1413004994,
0.0776269808,
-0.2506593168,
0.2018508017,
-0.0451864563,
0.3970348537,
0.2543900013,
0.5308366418,
-0.5031033158,
0.1623611599,
-0.1327785552,
0.2966159284,
0.2320236266,
-0.0281318966,
-0.6667605639,
0.4973528087,
-0.0042585502,
0.0241889916,
0.2724843323,
0.1617121547,
0.351677835,
0.1078482866,
-0.0490624197,
0.3837118745,
0.1839480996,
0.2279310226,
-0.3400997818,
-0.2303103656,
-0.0487274714,
0.3479748964,
-0.324473232,
-0.1571210772,
0.3112509847,
-0.3645974696,
0.490659833,
-0.2065639645,
-0.1836266071,
0.2509784698,
0.0870237574,
-0.2777456343,
0.1183486357,
0.0964875445,
0.0859435499,
0.2421767265,
-0.1894866824,
-0.0184648018,
0.0450903215,
-0.1888089329,
-0.0722151995,
0.0619629808,
-0.0552601777,
-0.0473854542,
-0.0448972695,
-0.0918301195,
0.3306872547,
-0.0035312627,
0.1647334397,
-0.1632061899,
-0.2693368793,
-0.009445671,
-0.2626185715,
0.0792924166,
0.0950682834,
-0.1213107705,
0.0093064299,
-0.2492530793,
-0.0884236023,
-0.0017328872,
-0.1519373357,
0.3275277615,
0.1502290815,
0.1502470672,
0.2235310078,
0.1522478461,
0.1419565976,
-0.0849311128,
0.3879738152,
0.2968659997,
0.0753156692,
0.0365263224,
-0.4053477645,
0.5263325572,
0.3933129311,
0.316054523,
0.2904032469,
-0.3733907342,
0.1644445509,
0.0483794436,
0.1105024591,
0.410638839,
0.2937987745,
0.2421560138,
0.5489555597,
0.1663257033,
-0.3161972165,
0.1155822724,
0.4506135881,
-0.249601692,
0.0180422086,
0.1873043329,
-0.4217132628,
-0.1856171042,
0.370215714,
-0.1509690881,
0.326580286,
0.3312531114,
0.1606445163,
-0.1239555106,
0.0274432246,
-0.2904405296,
0.2625499666,
0.0967947692,
0.1414085627,
-0.2201083302,
0.4368431568,
-0.0920058191,
-0.2460107803,
-0.3815978765,
-0.0392078236,
0.1921320558,
-0.1264010519,
0.3072986901,
-0.0982983783,
0.0536191501,
-0.0324512906,
0.1308006644,
0.0790723488,
-0.086535424,
0.0450387262,
0.193540886,
-0.1812106073,
-0.1583382338,
-0.055191271,
0.227895245,
0.2617881298,
-0.2087614238,
-0.0017744595,
-0.0716874078,
-0.3983872235,
0.0803132057,
0.2775995731,
0.1493918747,
0.1450456977,
-0.0469180755,
-0.1854478717,
-0.2801739275,
-0.3152383566,
-0.006573176,
0.0799069703,
0.2866190076,
-0.0709004924,
0.0763943642,
-0.3244523406,
-0.144766435,
0.0637097806,
-0.2329102308,
-0.151325807,
0.2760072351,
-0.180747658,
0.0008986764,
0.0887833238,
-0.3163753748,
-0.1673076898,
-0.3001770377,
0.3784308434,
0.1727609187,
0.2083456069,
0.107555218,
0.3943434656,
0.1223712638,
0.0096600028,
0.1228195205,
0.0379164666,
-0.4149514139,
0.5190880895,
-0.1802637726,
-0.4500642121,
-0.4888218045,
-0.242930308,
-0.1641490459,
0.4524992704,
-0.534160912,
-0.0311469082,
-0.5311314464,
0.4127759039,
0.1235399023,
0.1021673679,
0.0496033803,
-0.2131574303,
-0.2089556605,
0.1292297393,
0.0826180205,
-0.0064191269,
-0.0878510624,
0.2021378875,
-0.061521288,
0.0337112136,
-0.0098686498,
0.7692421079,
0.0689439699,
-0.0129046617,
0.263535887,
-0.0949029922,
0.0519068129,
-0.1647451967,
0.1458876729,
0.0905034766,
-0.260880053,
-0.2699274719,
0.418389827,
0.164147228,
-0.3080242574,
0.0591343157,
-0.1851302683,
-0.0976590887,
-0.2781838179,
0.2541962862,
0.158824414,
0.1743983328,
0.069860667,
0.3926581144,
-0.3018997908,
-0.1359267533,
0.0707093626,
-0.2578144372,
0.0201727953,
-0.1169836372,
-0.3373415172,
-0.059715718,
-0.6845933199,
0.2021395713,
-0.0698043853,
0.0391391516,
0.2540457249,
-0.3021758795,
0.2348046452,
-0.0662641972,
0.5487118363,
0.1905718595,
-0.1996440589,
-0.1152184904,
-0.2325005829,
-0.4247894287,
-0.1554236263,
-0.4956257045,
0.113651678,
-0.0005395525,
0.3345814347,
-0.3185555339,
0.111836426,
0.0000605079,
0.3112286031,
0.1916498095,
-0.0442787297,
-0.167655021,
-0.2823409438,
-0.1325234771,
0.1623778045,
-0.1995147318,
0.0504497029,
-0.2694345117,
-0.1696106195,
-0.1472622007,
0.1772929281,
0.116819948,
0.4819426239,
0.2846929133,
-0.4382566214,
0.3633344471,
0.0272249877,
0.1518049985,
0.3828197122,
0.4000196755,
0.3224878907,
-0.1235771254,
0.1998888403,
0.1022289097,
0.0747965574,
0.5333116651,
-0.0012650299,
0.1972726285,
0.0611075796,
0.2763023376,
-0.0564489476,
0.0823672041,
0.3274202347,
-0.0823387057,
-0.062497247,
-0.3168289363,
0.7024027705,
0.0998986438,
0.0085827522,
0.2355284095,
-0.1901878715,
0.1304430664,
0.30139485,
-0.102206707,
0.914337337,
-0.1250880808,
0.2525976598,
0.3494725227,
0.0667310059,
0.0075899558,
-0.0959176421,
0.1510163844,
-0.3135030866,
-0.2316494584,
0.1761054695,
-0.2805036604,
0.08492098,
0.2128593326,
-0.1312743872,
0.0862878561,
-0.0537314564,
0.1990431845,
-0.2258604467,
0.2392510474,
-0.2529600263,
-0.0510921925,
-0.4353418052,
0.0288211089,
0.097289443,
-0.0646519139,
0.0886060447,
-0.1453690082,
-0.5541807413,
0.0102532646,
-0.0938769057,
0.038914416,
-0.2355803996,
0.1632980108,
0.0593761653,
-0.4771614969,
-0.0842534155,
0.1212544218,
-0.4953687191,
0.0789547488,
-0.245811969,
0.4174096286,
0.0435453989,
0.2301589549,
0.530809164,
-0.3330540657,
-0.0087198084,
-0.02921905,
-0.2165679336,
0.249541074,
-0.1539895684,
-0.2520103455,
0.0252855346,
0.143731311,
0.3611814678,
-0.167501986,
-0.2776464224,
-0.1240045801,
-0.4408732355,
-0.2431270033,
0.0841378048,
-0.0427367575,
0.0855584666,
0.2314763367,
0.3174691796,
-0.3549930751,
-0.2242874503,
0.3709996045,
0.0943127424,
0.2603206336,
0.3130874038,
0.0880959854,
-0.2163753808,
-0.1274373829,
0.2965532243,
0.411142379,
-0.4757105112,
0.0690820217,
0.013951323,
0.1246266812,
0.2461801022,
0.0182093326,
0.0741975009,
-0.2569900453,
-0.3386790156,
-0.0690866932,
0.0099440571,
0.3278675973,
0.120761618,
0.1357960254,
0.0576914698,
-0.0145965433,
-0.3653219044,
0.0142487707,
-0.2701687217,
0.1390895545,
-0.0243228301,
0.1828632504,
-0.4315899312,
0.0174093843,
0.0081376666,
0.1431653053,
0.1091621891,
0.1063815057,
-0.1234384924,
-0.2166474015,
0.0291856732,
0.1290724277,
-0.1361881196,
-0.2797193825,
0.2394433171,
-0.2063069791,
-0.0508660935,
-0.3758655787,
0.1421239376,
-0.1364210844,
-0.0316603966,
-0.4254382551,
0.2596432269,
-0.1692033708,
-0.3019404113,
0.3180859983,
-0.4044683278,
0.177998364,
0.0607637577,
0.1787562966,
0.0040057274,
-0.1559252292,
0.0720915645,
0.2029665858,
0.1648199707,
0.13967821,
0.3797293603,
-0.0262121763,
-0.0972279608,
-0.1073898897,
0.3312669694,
0.3493905663,
0.0380295403,
-0.1387912482,
0.1757906228,
0.2256357968,
-0.3251367509,
-0.2828208804,
-0.1296371669,
-0.2570060492,
0.2418892533,
0.0095795682,
0.2093760073,
0.1670227647,
-0.0789556578,
-0.206896916,
0.0986439735,
0.5504128933,
-0.1451754272,
0.6776701212,
0.3272511363,
-0.1993044913,
0.2702797353,
0.0020870382,
0.3459143639,
0.3618882298,
-0.1196034476,
0.5368241668,
0.232074514,
0.2449537963,
-0.1339673102,
-0.3090496063,
0.1352113336,
-0.0015170389,
-0.0136431558,
0.1391918808,
0.0621288344,
0.449041903,
0.0052276254,
0.0771016181,
-0.3266302943,
-0.1267496794,
0.0290438887,
-0.0826169401,
-0.0433855243,
-0.1177397668,
-0.0748513341,
0.1068686321,
-0.3724666536,
-0.1312436312,
0.3648230433,
0.0338449776,
0.1812085211,
-0.4446077049,
0.2035415769,
-0.1569178551,
0.218098551,
-0.2398339212,
0.1747610867,
0.050084684,
-0.0667938218,
0.0713925883,
0.1016838029,
0.3679462969,
0.1852423549,
-0.1066011861,
-0.173093006,
-0.0566397719,
-0.0385057107,
-0.0139070116,
-0.0869696215,
0.0414151885,
-0.0986003429,
0.3017621934,
0.0308141485,
-0.1557210833,
-0.1387580186,
-0.0228549819,
-0.2242792696,
-0.3263449371,
-0.3453313708,
-0.2006978095,
-0.328232646,
-0.1295246333,
-0.1895686537,
-0.2536433041,
0.1835203618,
0.2279346138,
-0.3133317828,
-0.0675588474,
0.0006712062,
0.0845005736,
-0.5105262995,
0.6805173159,
0.4650323689,
0.5556753278,
-0.3209068477,
-0.116044797,
-0.4356545508,
0.0629211515,
-0.6595266461,
-0.0497879386,
0.2942714691,
0.3931100965,
0.1516691744,
0.2153778821,
0.1646079421,
0.1359258741,
-0.1916751415,
0.3211125135,
-0.5305005312,
-0.0809502825,
-0.0275069494,
0.0169768427,
-0.2176151127,
-0.6412060857,
0.4145413339,
-0.4362513423,
0.0196192767,
-0.1795401275,
-0.1805548966,
0.3991860747,
0.2217819095,
0.5155704618,
0.0022800644,
0.1430403441,
0.0240670182,
-0.1811050475,
-0.1920025796,
-0.0376323424,
0.0861413926,
0.1762728393,
-0.0916484073,
0.0870482624,
0.1293836981,
-0.1807275414,
0.0944082662,
0.6064496636,
-0.1033740491,
0.0085013788,
0.1139354184,
-0.1410083175,
-0.2004247308,
0.1103876457,
-0.1858650446,
-0.0338985585,
-0.0985820293,
-0.2373307496,
-0.1588728726,
-0.1999847144,
0.4235753119,
-0.4598164558,
0.057306245,
-0.1773608923,
0.2722937763,
0.2497566193,
0.3505439758,
-0.1962873936,
0.029730957,
0.3197359443,
0.0932121798,
-0.0431471467,
0.231146276,
0.1514274925,
0.1145223826,
-0.0749373063,
0.3918390274,
-0.3036595583,
-0.3066390753,
-0.2293880433,
-0.3594547808
] |
https://github.com/huggingface/datasets/issues/1803 | Querying examples from big datasets is slower than small datasets | Hi ! I'm pretty sure that it can be fixed by using the Arrow IPC file format instead of the raw streaming format but I haven't tested yet.
I'll take a look at it soon and let you know | After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed. | 39 | Querying examples from big datasets is slower than small datasets
After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed.
Hi ! I'm pretty sure that it can be fixed by using the Arrow IPC file format instead of the raw streaming format but I haven't tested yet.
I'll take a look at it soon and let you know | [
-0.4054937661,
0.058644373,
-0.0799715444,
0.131532535,
-0.0796942189,
-0.177691564,
0.2441748083,
0.4918093979,
-0.2313988209,
0.1801939607,
0.0814937055,
0.0550893359,
0.1250858158,
-0.1007566899,
0.1307258159,
-0.273406595,
0.0807414576,
0.1248459145,
-0.0751321092,
-0.0345287286,
0.0240302868,
-0.1902867854,
-0.3486272097,
0.0184701234,
-0.0663275197,
-0.2240722775,
-0.2307067364,
0.1072062477,
-0.1658503264,
-0.4173947275,
-0.0595364235,
-0.1528191417,
0.2299300432,
0.4270309806,
-0.0001130733,
0.0164050516,
0.2279307693,
0.089417696,
-0.1997471303,
0.1829342395,
0.174807474,
-0.2838543952,
0.0868746042,
-0.4097664654,
-0.047154028,
-0.2971981466,
0.0934278518,
0.0189006701,
-0.0412533991,
0.3089760244,
0.1403642595,
0.5131547451,
-0.1917047948,
-0.1336634606,
0.6230677962,
0.2051521838,
-0.3506301343,
0.5299630761,
0.5806370974,
-0.0487997942,
-0.3053151965,
0.1361404061,
-0.0814443007,
0.2701411247,
0.0370223783,
0.1979731321,
-0.1128053069,
0.1795918941,
0.123810336,
0.4088887572,
0.3083907664,
-0.0893914253,
-0.314886421,
-0.2920186222,
-0.0569282286,
-0.2332931459,
0.0203077532,
0.3264190555,
-0.2583793104,
0.2713419497,
-0.3137760758,
0.1547778696,
-0.1056507826,
0.1795517504,
-0.1511591077,
-0.0686158985,
0.1150509268,
0.1985103935,
0.0937959924,
0.0133131156,
0.1511933506,
-0.1696210355,
0.0284059588,
-0.0521108434,
-0.2883044481,
-0.0881550089,
0.1556631625,
0.1755785048,
0.2685058117,
0.159310326,
0.4223206937,
0.1182837933,
0.265193373,
0.0943621695,
0.045135688,
-0.0090213399,
-0.2695649862,
-0.0009782977,
0.3478800952,
0.2753002644,
-0.2945163548,
0.0208777506,
-0.2383214086,
-0.1844542176,
0.1815628409,
-0.1973295361,
-0.0274536777,
-0.133716926,
0.0043231249,
-0.0873045102,
-0.3421144783,
-0.1278228015,
-0.0265573822,
0.4784686267,
-0.1834657937,
-0.026572492,
-0.2126669139,
0.1222239435,
-0.3353428841,
-0.2540251911,
-0.1243123338,
-0.1883357167,
-0.1600800753,
0.2303076535,
0.1097954586,
0.056097813,
0.3020734787,
0.0585403554,
-0.1985151023,
0.2419625521,
0.3923715055,
-0.1808657944,
0.1044564769,
0.0197550524,
0.0112556247,
0.0635321811,
-0.1637399793,
0.2447642088,
-0.3910899758,
0.1972705871,
-0.1953565329,
-0.338478148,
0.0306391455,
0.0919929966,
-0.1056952402,
-0.0997600779,
-0.2270812392,
0.246245265,
-0.0694223642,
-0.1997458488,
-0.0774376392,
-0.0941937268,
0.0402901322,
-0.1531326622,
0.1413004994,
0.0776269808,
-0.2506593168,
0.2018508017,
-0.0451864563,
0.3970348537,
0.2543900013,
0.5308366418,
-0.5031033158,
0.1623611599,
-0.1327785552,
0.2966159284,
0.2320236266,
-0.0281318966,
-0.6667605639,
0.4973528087,
-0.0042585502,
0.0241889916,
0.2724843323,
0.1617121547,
0.351677835,
0.1078482866,
-0.0490624197,
0.3837118745,
0.1839480996,
0.2279310226,
-0.3400997818,
-0.2303103656,
-0.0487274714,
0.3479748964,
-0.324473232,
-0.1571210772,
0.3112509847,
-0.3645974696,
0.490659833,
-0.2065639645,
-0.1836266071,
0.2509784698,
0.0870237574,
-0.2777456343,
0.1183486357,
0.0964875445,
0.0859435499,
0.2421767265,
-0.1894866824,
-0.0184648018,
0.0450903215,
-0.1888089329,
-0.0722151995,
0.0619629808,
-0.0552601777,
-0.0473854542,
-0.0448972695,
-0.0918301195,
0.3306872547,
-0.0035312627,
0.1647334397,
-0.1632061899,
-0.2693368793,
-0.009445671,
-0.2626185715,
0.0792924166,
0.0950682834,
-0.1213107705,
0.0093064299,
-0.2492530793,
-0.0884236023,
-0.0017328872,
-0.1519373357,
0.3275277615,
0.1502290815,
0.1502470672,
0.2235310078,
0.1522478461,
0.1419565976,
-0.0849311128,
0.3879738152,
0.2968659997,
0.0753156692,
0.0365263224,
-0.4053477645,
0.5263325572,
0.3933129311,
0.316054523,
0.2904032469,
-0.3733907342,
0.1644445509,
0.0483794436,
0.1105024591,
0.410638839,
0.2937987745,
0.2421560138,
0.5489555597,
0.1663257033,
-0.3161972165,
0.1155822724,
0.4506135881,
-0.249601692,
0.0180422086,
0.1873043329,
-0.4217132628,
-0.1856171042,
0.370215714,
-0.1509690881,
0.326580286,
0.3312531114,
0.1606445163,
-0.1239555106,
0.0274432246,
-0.2904405296,
0.2625499666,
0.0967947692,
0.1414085627,
-0.2201083302,
0.4368431568,
-0.0920058191,
-0.2460107803,
-0.3815978765,
-0.0392078236,
0.1921320558,
-0.1264010519,
0.3072986901,
-0.0982983783,
0.0536191501,
-0.0324512906,
0.1308006644,
0.0790723488,
-0.086535424,
0.0450387262,
0.193540886,
-0.1812106073,
-0.1583382338,
-0.055191271,
0.227895245,
0.2617881298,
-0.2087614238,
-0.0017744595,
-0.0716874078,
-0.3983872235,
0.0803132057,
0.2775995731,
0.1493918747,
0.1450456977,
-0.0469180755,
-0.1854478717,
-0.2801739275,
-0.3152383566,
-0.006573176,
0.0799069703,
0.2866190076,
-0.0709004924,
0.0763943642,
-0.3244523406,
-0.144766435,
0.0637097806,
-0.2329102308,
-0.151325807,
0.2760072351,
-0.180747658,
0.0008986764,
0.0887833238,
-0.3163753748,
-0.1673076898,
-0.3001770377,
0.3784308434,
0.1727609187,
0.2083456069,
0.107555218,
0.3943434656,
0.1223712638,
0.0096600028,
0.1228195205,
0.0379164666,
-0.4149514139,
0.5190880895,
-0.1802637726,
-0.4500642121,
-0.4888218045,
-0.242930308,
-0.1641490459,
0.4524992704,
-0.534160912,
-0.0311469082,
-0.5311314464,
0.4127759039,
0.1235399023,
0.1021673679,
0.0496033803,
-0.2131574303,
-0.2089556605,
0.1292297393,
0.0826180205,
-0.0064191269,
-0.0878510624,
0.2021378875,
-0.061521288,
0.0337112136,
-0.0098686498,
0.7692421079,
0.0689439699,
-0.0129046617,
0.263535887,
-0.0949029922,
0.0519068129,
-0.1647451967,
0.1458876729,
0.0905034766,
-0.260880053,
-0.2699274719,
0.418389827,
0.164147228,
-0.3080242574,
0.0591343157,
-0.1851302683,
-0.0976590887,
-0.2781838179,
0.2541962862,
0.158824414,
0.1743983328,
0.069860667,
0.3926581144,
-0.3018997908,
-0.1359267533,
0.0707093626,
-0.2578144372,
0.0201727953,
-0.1169836372,
-0.3373415172,
-0.059715718,
-0.6845933199,
0.2021395713,
-0.0698043853,
0.0391391516,
0.2540457249,
-0.3021758795,
0.2348046452,
-0.0662641972,
0.5487118363,
0.1905718595,
-0.1996440589,
-0.1152184904,
-0.2325005829,
-0.4247894287,
-0.1554236263,
-0.4956257045,
0.113651678,
-0.0005395525,
0.3345814347,
-0.3185555339,
0.111836426,
0.0000605079,
0.3112286031,
0.1916498095,
-0.0442787297,
-0.167655021,
-0.2823409438,
-0.1325234771,
0.1623778045,
-0.1995147318,
0.0504497029,
-0.2694345117,
-0.1696106195,
-0.1472622007,
0.1772929281,
0.116819948,
0.4819426239,
0.2846929133,
-0.4382566214,
0.3633344471,
0.0272249877,
0.1518049985,
0.3828197122,
0.4000196755,
0.3224878907,
-0.1235771254,
0.1998888403,
0.1022289097,
0.0747965574,
0.5333116651,
-0.0012650299,
0.1972726285,
0.0611075796,
0.2763023376,
-0.0564489476,
0.0823672041,
0.3274202347,
-0.0823387057,
-0.062497247,
-0.3168289363,
0.7024027705,
0.0998986438,
0.0085827522,
0.2355284095,
-0.1901878715,
0.1304430664,
0.30139485,
-0.102206707,
0.914337337,
-0.1250880808,
0.2525976598,
0.3494725227,
0.0667310059,
0.0075899558,
-0.0959176421,
0.1510163844,
-0.3135030866,
-0.2316494584,
0.1761054695,
-0.2805036604,
0.08492098,
0.2128593326,
-0.1312743872,
0.0862878561,
-0.0537314564,
0.1990431845,
-0.2258604467,
0.2392510474,
-0.2529600263,
-0.0510921925,
-0.4353418052,
0.0288211089,
0.097289443,
-0.0646519139,
0.0886060447,
-0.1453690082,
-0.5541807413,
0.0102532646,
-0.0938769057,
0.038914416,
-0.2355803996,
0.1632980108,
0.0593761653,
-0.4771614969,
-0.0842534155,
0.1212544218,
-0.4953687191,
0.0789547488,
-0.245811969,
0.4174096286,
0.0435453989,
0.2301589549,
0.530809164,
-0.3330540657,
-0.0087198084,
-0.02921905,
-0.2165679336,
0.249541074,
-0.1539895684,
-0.2520103455,
0.0252855346,
0.143731311,
0.3611814678,
-0.167501986,
-0.2776464224,
-0.1240045801,
-0.4408732355,
-0.2431270033,
0.0841378048,
-0.0427367575,
0.0855584666,
0.2314763367,
0.3174691796,
-0.3549930751,
-0.2242874503,
0.3709996045,
0.0943127424,
0.2603206336,
0.3130874038,
0.0880959854,
-0.2163753808,
-0.1274373829,
0.2965532243,
0.411142379,
-0.4757105112,
0.0690820217,
0.013951323,
0.1246266812,
0.2461801022,
0.0182093326,
0.0741975009,
-0.2569900453,
-0.3386790156,
-0.0690866932,
0.0099440571,
0.3278675973,
0.120761618,
0.1357960254,
0.0576914698,
-0.0145965433,
-0.3653219044,
0.0142487707,
-0.2701687217,
0.1390895545,
-0.0243228301,
0.1828632504,
-0.4315899312,
0.0174093843,
0.0081376666,
0.1431653053,
0.1091621891,
0.1063815057,
-0.1234384924,
-0.2166474015,
0.0291856732,
0.1290724277,
-0.1361881196,
-0.2797193825,
0.2394433171,
-0.2063069791,
-0.0508660935,
-0.3758655787,
0.1421239376,
-0.1364210844,
-0.0316603966,
-0.4254382551,
0.2596432269,
-0.1692033708,
-0.3019404113,
0.3180859983,
-0.4044683278,
0.177998364,
0.0607637577,
0.1787562966,
0.0040057274,
-0.1559252292,
0.0720915645,
0.2029665858,
0.1648199707,
0.13967821,
0.3797293603,
-0.0262121763,
-0.0972279608,
-0.1073898897,
0.3312669694,
0.3493905663,
0.0380295403,
-0.1387912482,
0.1757906228,
0.2256357968,
-0.3251367509,
-0.2828208804,
-0.1296371669,
-0.2570060492,
0.2418892533,
0.0095795682,
0.2093760073,
0.1670227647,
-0.0789556578,
-0.206896916,
0.0986439735,
0.5504128933,
-0.1451754272,
0.6776701212,
0.3272511363,
-0.1993044913,
0.2702797353,
0.0020870382,
0.3459143639,
0.3618882298,
-0.1196034476,
0.5368241668,
0.232074514,
0.2449537963,
-0.1339673102,
-0.3090496063,
0.1352113336,
-0.0015170389,
-0.0136431558,
0.1391918808,
0.0621288344,
0.449041903,
0.0052276254,
0.0771016181,
-0.3266302943,
-0.1267496794,
0.0290438887,
-0.0826169401,
-0.0433855243,
-0.1177397668,
-0.0748513341,
0.1068686321,
-0.3724666536,
-0.1312436312,
0.3648230433,
0.0338449776,
0.1812085211,
-0.4446077049,
0.2035415769,
-0.1569178551,
0.218098551,
-0.2398339212,
0.1747610867,
0.050084684,
-0.0667938218,
0.0713925883,
0.1016838029,
0.3679462969,
0.1852423549,
-0.1066011861,
-0.173093006,
-0.0566397719,
-0.0385057107,
-0.0139070116,
-0.0869696215,
0.0414151885,
-0.0986003429,
0.3017621934,
0.0308141485,
-0.1557210833,
-0.1387580186,
-0.0228549819,
-0.2242792696,
-0.3263449371,
-0.3453313708,
-0.2006978095,
-0.328232646,
-0.1295246333,
-0.1895686537,
-0.2536433041,
0.1835203618,
0.2279346138,
-0.3133317828,
-0.0675588474,
0.0006712062,
0.0845005736,
-0.5105262995,
0.6805173159,
0.4650323689,
0.5556753278,
-0.3209068477,
-0.116044797,
-0.4356545508,
0.0629211515,
-0.6595266461,
-0.0497879386,
0.2942714691,
0.3931100965,
0.1516691744,
0.2153778821,
0.1646079421,
0.1359258741,
-0.1916751415,
0.3211125135,
-0.5305005312,
-0.0809502825,
-0.0275069494,
0.0169768427,
-0.2176151127,
-0.6412060857,
0.4145413339,
-0.4362513423,
0.0196192767,
-0.1795401275,
-0.1805548966,
0.3991860747,
0.2217819095,
0.5155704618,
0.0022800644,
0.1430403441,
0.0240670182,
-0.1811050475,
-0.1920025796,
-0.0376323424,
0.0861413926,
0.1762728393,
-0.0916484073,
0.0870482624,
0.1293836981,
-0.1807275414,
0.0944082662,
0.6064496636,
-0.1033740491,
0.0085013788,
0.1139354184,
-0.1410083175,
-0.2004247308,
0.1103876457,
-0.1858650446,
-0.0338985585,
-0.0985820293,
-0.2373307496,
-0.1588728726,
-0.1999847144,
0.4235753119,
-0.4598164558,
0.057306245,
-0.1773608923,
0.2722937763,
0.2497566193,
0.3505439758,
-0.1962873936,
0.029730957,
0.3197359443,
0.0932121798,
-0.0431471467,
0.231146276,
0.1514274925,
0.1145223826,
-0.0749373063,
0.3918390274,
-0.3036595583,
-0.3066390753,
-0.2293880433,
-0.3594547808
] |
https://github.com/huggingface/datasets/issues/1803 | Querying examples from big datasets is slower than small datasets | My workaround is to shard the dataset into splits in my ssd disk and feed the data in different training sessions. But it is a bit of a pain when we need to reload the last training session with the rest of the split with the Trainer in transformers.
I mean, when I split the training and then reloads the model and optimizer, it not gets the correct global_status of the optimizer, so I need to hardcode some things. I'm planning to open an issue in transformers and think about it.
```
from datasets import load_dataset
book_corpus = load_dataset("bookcorpus", split="train[:25%]")
wikicorpus = load_dataset("wikicorpus", split="train[:25%]")
openwebtext = load_dataset("openwebtext", split="train[:25%]")
big_dataset = datasets.concatenate_datasets([wikicorpus, openwebtext, book_corpus])
big_dataset.shuffle(seed=42)
big_dataset = big_dataset.map(encode, batched=True, num_proc=20, load_from_cache_file=True, writer_batch_size=5000)
big_dataset.set_format(type='torch', columns=["text", "input_ids", "attention_mask", "token_type_ids"])
training_args = TrainingArguments(
output_dir="./linear_bert",
overwrite_output_dir=True,
per_device_train_batch_size=71,
save_steps=500,
save_total_limit=10,
logging_first_step=True,
logging_steps=100,
gradient_accumulation_steps=9,
fp16=True,
dataloader_num_workers=20,
warmup_steps=24000,
learning_rate=0.000545205002870214,
adam_epsilon=1e-6,
adam_beta2=0.98,
weight_decay=0.01,
max_steps=138974, # the total number of steps after concatenating 100% datasets
max_grad_norm=1.0,
)
trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=big_dataset,
tokenizer=tokenizer))
```
I do one training pass with the total steps of this shard and I use len(bbig)/batchsize to stop the training (hardcoded in the trainer.py) when I pass over all the examples in this split.
Now Im working, I will edit the comment with a more elaborated answer when I left the work. | After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed. | 218 | Querying examples from big datasets is slower than small datasets
After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed.
My workaround is to shard the dataset into splits in my ssd disk and feed the data in different training sessions. But it is a bit of a pain when we need to reload the last training session with the rest of the split with the Trainer in transformers.
I mean, when I split the training and then reloads the model and optimizer, it not gets the correct global_status of the optimizer, so I need to hardcode some things. I'm planning to open an issue in transformers and think about it.
```
from datasets import load_dataset
book_corpus = load_dataset("bookcorpus", split="train[:25%]")
wikicorpus = load_dataset("wikicorpus", split="train[:25%]")
openwebtext = load_dataset("openwebtext", split="train[:25%]")
big_dataset = datasets.concatenate_datasets([wikicorpus, openwebtext, book_corpus])
big_dataset.shuffle(seed=42)
big_dataset = big_dataset.map(encode, batched=True, num_proc=20, load_from_cache_file=True, writer_batch_size=5000)
big_dataset.set_format(type='torch', columns=["text", "input_ids", "attention_mask", "token_type_ids"])
training_args = TrainingArguments(
output_dir="./linear_bert",
overwrite_output_dir=True,
per_device_train_batch_size=71,
save_steps=500,
save_total_limit=10,
logging_first_step=True,
logging_steps=100,
gradient_accumulation_steps=9,
fp16=True,
dataloader_num_workers=20,
warmup_steps=24000,
learning_rate=0.000545205002870214,
adam_epsilon=1e-6,
adam_beta2=0.98,
weight_decay=0.01,
max_steps=138974, # the total number of steps after concatenating 100% datasets
max_grad_norm=1.0,
)
trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=big_dataset,
tokenizer=tokenizer))
```
I do one training pass with the total steps of this shard and I use len(bbig)/batchsize to stop the training (hardcoded in the trainer.py) when I pass over all the examples in this split.
Now Im working, I will edit the comment with a more elaborated answer when I left the work. | [
-0.4054937661,
0.058644373,
-0.0799715444,
0.131532535,
-0.0796942189,
-0.177691564,
0.2441748083,
0.4918093979,
-0.2313988209,
0.1801939607,
0.0814937055,
0.0550893359,
0.1250858158,
-0.1007566899,
0.1307258159,
-0.273406595,
0.0807414576,
0.1248459145,
-0.0751321092,
-0.0345287286,
0.0240302868,
-0.1902867854,
-0.3486272097,
0.0184701234,
-0.0663275197,
-0.2240722775,
-0.2307067364,
0.1072062477,
-0.1658503264,
-0.4173947275,
-0.0595364235,
-0.1528191417,
0.2299300432,
0.4270309806,
-0.0001130733,
0.0164050516,
0.2279307693,
0.089417696,
-0.1997471303,
0.1829342395,
0.174807474,
-0.2838543952,
0.0868746042,
-0.4097664654,
-0.047154028,
-0.2971981466,
0.0934278518,
0.0189006701,
-0.0412533991,
0.3089760244,
0.1403642595,
0.5131547451,
-0.1917047948,
-0.1336634606,
0.6230677962,
0.2051521838,
-0.3506301343,
0.5299630761,
0.5806370974,
-0.0487997942,
-0.3053151965,
0.1361404061,
-0.0814443007,
0.2701411247,
0.0370223783,
0.1979731321,
-0.1128053069,
0.1795918941,
0.123810336,
0.4088887572,
0.3083907664,
-0.0893914253,
-0.314886421,
-0.2920186222,
-0.0569282286,
-0.2332931459,
0.0203077532,
0.3264190555,
-0.2583793104,
0.2713419497,
-0.3137760758,
0.1547778696,
-0.1056507826,
0.1795517504,
-0.1511591077,
-0.0686158985,
0.1150509268,
0.1985103935,
0.0937959924,
0.0133131156,
0.1511933506,
-0.1696210355,
0.0284059588,
-0.0521108434,
-0.2883044481,
-0.0881550089,
0.1556631625,
0.1755785048,
0.2685058117,
0.159310326,
0.4223206937,
0.1182837933,
0.265193373,
0.0943621695,
0.045135688,
-0.0090213399,
-0.2695649862,
-0.0009782977,
0.3478800952,
0.2753002644,
-0.2945163548,
0.0208777506,
-0.2383214086,
-0.1844542176,
0.1815628409,
-0.1973295361,
-0.0274536777,
-0.133716926,
0.0043231249,
-0.0873045102,
-0.3421144783,
-0.1278228015,
-0.0265573822,
0.4784686267,
-0.1834657937,
-0.026572492,
-0.2126669139,
0.1222239435,
-0.3353428841,
-0.2540251911,
-0.1243123338,
-0.1883357167,
-0.1600800753,
0.2303076535,
0.1097954586,
0.056097813,
0.3020734787,
0.0585403554,
-0.1985151023,
0.2419625521,
0.3923715055,
-0.1808657944,
0.1044564769,
0.0197550524,
0.0112556247,
0.0635321811,
-0.1637399793,
0.2447642088,
-0.3910899758,
0.1972705871,
-0.1953565329,
-0.338478148,
0.0306391455,
0.0919929966,
-0.1056952402,
-0.0997600779,
-0.2270812392,
0.246245265,
-0.0694223642,
-0.1997458488,
-0.0774376392,
-0.0941937268,
0.0402901322,
-0.1531326622,
0.1413004994,
0.0776269808,
-0.2506593168,
0.2018508017,
-0.0451864563,
0.3970348537,
0.2543900013,
0.5308366418,
-0.5031033158,
0.1623611599,
-0.1327785552,
0.2966159284,
0.2320236266,
-0.0281318966,
-0.6667605639,
0.4973528087,
-0.0042585502,
0.0241889916,
0.2724843323,
0.1617121547,
0.351677835,
0.1078482866,
-0.0490624197,
0.3837118745,
0.1839480996,
0.2279310226,
-0.3400997818,
-0.2303103656,
-0.0487274714,
0.3479748964,
-0.324473232,
-0.1571210772,
0.3112509847,
-0.3645974696,
0.490659833,
-0.2065639645,
-0.1836266071,
0.2509784698,
0.0870237574,
-0.2777456343,
0.1183486357,
0.0964875445,
0.0859435499,
0.2421767265,
-0.1894866824,
-0.0184648018,
0.0450903215,
-0.1888089329,
-0.0722151995,
0.0619629808,
-0.0552601777,
-0.0473854542,
-0.0448972695,
-0.0918301195,
0.3306872547,
-0.0035312627,
0.1647334397,
-0.1632061899,
-0.2693368793,
-0.009445671,
-0.2626185715,
0.0792924166,
0.0950682834,
-0.1213107705,
0.0093064299,
-0.2492530793,
-0.0884236023,
-0.0017328872,
-0.1519373357,
0.3275277615,
0.1502290815,
0.1502470672,
0.2235310078,
0.1522478461,
0.1419565976,
-0.0849311128,
0.3879738152,
0.2968659997,
0.0753156692,
0.0365263224,
-0.4053477645,
0.5263325572,
0.3933129311,
0.316054523,
0.2904032469,
-0.3733907342,
0.1644445509,
0.0483794436,
0.1105024591,
0.410638839,
0.2937987745,
0.2421560138,
0.5489555597,
0.1663257033,
-0.3161972165,
0.1155822724,
0.4506135881,
-0.249601692,
0.0180422086,
0.1873043329,
-0.4217132628,
-0.1856171042,
0.370215714,
-0.1509690881,
0.326580286,
0.3312531114,
0.1606445163,
-0.1239555106,
0.0274432246,
-0.2904405296,
0.2625499666,
0.0967947692,
0.1414085627,
-0.2201083302,
0.4368431568,
-0.0920058191,
-0.2460107803,
-0.3815978765,
-0.0392078236,
0.1921320558,
-0.1264010519,
0.3072986901,
-0.0982983783,
0.0536191501,
-0.0324512906,
0.1308006644,
0.0790723488,
-0.086535424,
0.0450387262,
0.193540886,
-0.1812106073,
-0.1583382338,
-0.055191271,
0.227895245,
0.2617881298,
-0.2087614238,
-0.0017744595,
-0.0716874078,
-0.3983872235,
0.0803132057,
0.2775995731,
0.1493918747,
0.1450456977,
-0.0469180755,
-0.1854478717,
-0.2801739275,
-0.3152383566,
-0.006573176,
0.0799069703,
0.2866190076,
-0.0709004924,
0.0763943642,
-0.3244523406,
-0.144766435,
0.0637097806,
-0.2329102308,
-0.151325807,
0.2760072351,
-0.180747658,
0.0008986764,
0.0887833238,
-0.3163753748,
-0.1673076898,
-0.3001770377,
0.3784308434,
0.1727609187,
0.2083456069,
0.107555218,
0.3943434656,
0.1223712638,
0.0096600028,
0.1228195205,
0.0379164666,
-0.4149514139,
0.5190880895,
-0.1802637726,
-0.4500642121,
-0.4888218045,
-0.242930308,
-0.1641490459,
0.4524992704,
-0.534160912,
-0.0311469082,
-0.5311314464,
0.4127759039,
0.1235399023,
0.1021673679,
0.0496033803,
-0.2131574303,
-0.2089556605,
0.1292297393,
0.0826180205,
-0.0064191269,
-0.0878510624,
0.2021378875,
-0.061521288,
0.0337112136,
-0.0098686498,
0.7692421079,
0.0689439699,
-0.0129046617,
0.263535887,
-0.0949029922,
0.0519068129,
-0.1647451967,
0.1458876729,
0.0905034766,
-0.260880053,
-0.2699274719,
0.418389827,
0.164147228,
-0.3080242574,
0.0591343157,
-0.1851302683,
-0.0976590887,
-0.2781838179,
0.2541962862,
0.158824414,
0.1743983328,
0.069860667,
0.3926581144,
-0.3018997908,
-0.1359267533,
0.0707093626,
-0.2578144372,
0.0201727953,
-0.1169836372,
-0.3373415172,
-0.059715718,
-0.6845933199,
0.2021395713,
-0.0698043853,
0.0391391516,
0.2540457249,
-0.3021758795,
0.2348046452,
-0.0662641972,
0.5487118363,
0.1905718595,
-0.1996440589,
-0.1152184904,
-0.2325005829,
-0.4247894287,
-0.1554236263,
-0.4956257045,
0.113651678,
-0.0005395525,
0.3345814347,
-0.3185555339,
0.111836426,
0.0000605079,
0.3112286031,
0.1916498095,
-0.0442787297,
-0.167655021,
-0.2823409438,
-0.1325234771,
0.1623778045,
-0.1995147318,
0.0504497029,
-0.2694345117,
-0.1696106195,
-0.1472622007,
0.1772929281,
0.116819948,
0.4819426239,
0.2846929133,
-0.4382566214,
0.3633344471,
0.0272249877,
0.1518049985,
0.3828197122,
0.4000196755,
0.3224878907,
-0.1235771254,
0.1998888403,
0.1022289097,
0.0747965574,
0.5333116651,
-0.0012650299,
0.1972726285,
0.0611075796,
0.2763023376,
-0.0564489476,
0.0823672041,
0.3274202347,
-0.0823387057,
-0.062497247,
-0.3168289363,
0.7024027705,
0.0998986438,
0.0085827522,
0.2355284095,
-0.1901878715,
0.1304430664,
0.30139485,
-0.102206707,
0.914337337,
-0.1250880808,
0.2525976598,
0.3494725227,
0.0667310059,
0.0075899558,
-0.0959176421,
0.1510163844,
-0.3135030866,
-0.2316494584,
0.1761054695,
-0.2805036604,
0.08492098,
0.2128593326,
-0.1312743872,
0.0862878561,
-0.0537314564,
0.1990431845,
-0.2258604467,
0.2392510474,
-0.2529600263,
-0.0510921925,
-0.4353418052,
0.0288211089,
0.097289443,
-0.0646519139,
0.0886060447,
-0.1453690082,
-0.5541807413,
0.0102532646,
-0.0938769057,
0.038914416,
-0.2355803996,
0.1632980108,
0.0593761653,
-0.4771614969,
-0.0842534155,
0.1212544218,
-0.4953687191,
0.0789547488,
-0.245811969,
0.4174096286,
0.0435453989,
0.2301589549,
0.530809164,
-0.3330540657,
-0.0087198084,
-0.02921905,
-0.2165679336,
0.249541074,
-0.1539895684,
-0.2520103455,
0.0252855346,
0.143731311,
0.3611814678,
-0.167501986,
-0.2776464224,
-0.1240045801,
-0.4408732355,
-0.2431270033,
0.0841378048,
-0.0427367575,
0.0855584666,
0.2314763367,
0.3174691796,
-0.3549930751,
-0.2242874503,
0.3709996045,
0.0943127424,
0.2603206336,
0.3130874038,
0.0880959854,
-0.2163753808,
-0.1274373829,
0.2965532243,
0.411142379,
-0.4757105112,
0.0690820217,
0.013951323,
0.1246266812,
0.2461801022,
0.0182093326,
0.0741975009,
-0.2569900453,
-0.3386790156,
-0.0690866932,
0.0099440571,
0.3278675973,
0.120761618,
0.1357960254,
0.0576914698,
-0.0145965433,
-0.3653219044,
0.0142487707,
-0.2701687217,
0.1390895545,
-0.0243228301,
0.1828632504,
-0.4315899312,
0.0174093843,
0.0081376666,
0.1431653053,
0.1091621891,
0.1063815057,
-0.1234384924,
-0.2166474015,
0.0291856732,
0.1290724277,
-0.1361881196,
-0.2797193825,
0.2394433171,
-0.2063069791,
-0.0508660935,
-0.3758655787,
0.1421239376,
-0.1364210844,
-0.0316603966,
-0.4254382551,
0.2596432269,
-0.1692033708,
-0.3019404113,
0.3180859983,
-0.4044683278,
0.177998364,
0.0607637577,
0.1787562966,
0.0040057274,
-0.1559252292,
0.0720915645,
0.2029665858,
0.1648199707,
0.13967821,
0.3797293603,
-0.0262121763,
-0.0972279608,
-0.1073898897,
0.3312669694,
0.3493905663,
0.0380295403,
-0.1387912482,
0.1757906228,
0.2256357968,
-0.3251367509,
-0.2828208804,
-0.1296371669,
-0.2570060492,
0.2418892533,
0.0095795682,
0.2093760073,
0.1670227647,
-0.0789556578,
-0.206896916,
0.0986439735,
0.5504128933,
-0.1451754272,
0.6776701212,
0.3272511363,
-0.1993044913,
0.2702797353,
0.0020870382,
0.3459143639,
0.3618882298,
-0.1196034476,
0.5368241668,
0.232074514,
0.2449537963,
-0.1339673102,
-0.3090496063,
0.1352113336,
-0.0015170389,
-0.0136431558,
0.1391918808,
0.0621288344,
0.449041903,
0.0052276254,
0.0771016181,
-0.3266302943,
-0.1267496794,
0.0290438887,
-0.0826169401,
-0.0433855243,
-0.1177397668,
-0.0748513341,
0.1068686321,
-0.3724666536,
-0.1312436312,
0.3648230433,
0.0338449776,
0.1812085211,
-0.4446077049,
0.2035415769,
-0.1569178551,
0.218098551,
-0.2398339212,
0.1747610867,
0.050084684,
-0.0667938218,
0.0713925883,
0.1016838029,
0.3679462969,
0.1852423549,
-0.1066011861,
-0.173093006,
-0.0566397719,
-0.0385057107,
-0.0139070116,
-0.0869696215,
0.0414151885,
-0.0986003429,
0.3017621934,
0.0308141485,
-0.1557210833,
-0.1387580186,
-0.0228549819,
-0.2242792696,
-0.3263449371,
-0.3453313708,
-0.2006978095,
-0.328232646,
-0.1295246333,
-0.1895686537,
-0.2536433041,
0.1835203618,
0.2279346138,
-0.3133317828,
-0.0675588474,
0.0006712062,
0.0845005736,
-0.5105262995,
0.6805173159,
0.4650323689,
0.5556753278,
-0.3209068477,
-0.116044797,
-0.4356545508,
0.0629211515,
-0.6595266461,
-0.0497879386,
0.2942714691,
0.3931100965,
0.1516691744,
0.2153778821,
0.1646079421,
0.1359258741,
-0.1916751415,
0.3211125135,
-0.5305005312,
-0.0809502825,
-0.0275069494,
0.0169768427,
-0.2176151127,
-0.6412060857,
0.4145413339,
-0.4362513423,
0.0196192767,
-0.1795401275,
-0.1805548966,
0.3991860747,
0.2217819095,
0.5155704618,
0.0022800644,
0.1430403441,
0.0240670182,
-0.1811050475,
-0.1920025796,
-0.0376323424,
0.0861413926,
0.1762728393,
-0.0916484073,
0.0870482624,
0.1293836981,
-0.1807275414,
0.0944082662,
0.6064496636,
-0.1033740491,
0.0085013788,
0.1139354184,
-0.1410083175,
-0.2004247308,
0.1103876457,
-0.1858650446,
-0.0338985585,
-0.0985820293,
-0.2373307496,
-0.1588728726,
-0.1999847144,
0.4235753119,
-0.4598164558,
0.057306245,
-0.1773608923,
0.2722937763,
0.2497566193,
0.3505439758,
-0.1962873936,
0.029730957,
0.3197359443,
0.0932121798,
-0.0431471467,
0.231146276,
0.1514274925,
0.1145223826,
-0.0749373063,
0.3918390274,
-0.3036595583,
-0.3066390753,
-0.2293880433,
-0.3594547808
] |
https://github.com/huggingface/datasets/issues/1803 | Querying examples from big datasets is slower than small datasets | I just tested and using the Arrow File format doesn't improve the speed... This will need further investigation.
My guess is that it has to iterate over the record batches or chunks of a ChunkedArray in order to retrieve elements.
However if we know in advance in which chunk the element is, and at what index it is, then we can access it instantaneously. But this requires dealing with the chunked arrays instead of the pyarrow Table directly which is not practical. | After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed. | 82 | Querying examples from big datasets is slower than small datasets
After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed.
I just tested and using the Arrow File format doesn't improve the speed... This will need further investigation.
My guess is that it has to iterate over the record batches or chunks of a ChunkedArray in order to retrieve elements.
However if we know in advance in which chunk the element is, and at what index it is, then we can access it instantaneously. But this requires dealing with the chunked arrays instead of the pyarrow Table directly which is not practical. | [
-0.4054937661,
0.058644373,
-0.0799715444,
0.131532535,
-0.0796942189,
-0.177691564,
0.2441748083,
0.4918093979,
-0.2313988209,
0.1801939607,
0.0814937055,
0.0550893359,
0.1250858158,
-0.1007566899,
0.1307258159,
-0.273406595,
0.0807414576,
0.1248459145,
-0.0751321092,
-0.0345287286,
0.0240302868,
-0.1902867854,
-0.3486272097,
0.0184701234,
-0.0663275197,
-0.2240722775,
-0.2307067364,
0.1072062477,
-0.1658503264,
-0.4173947275,
-0.0595364235,
-0.1528191417,
0.2299300432,
0.4270309806,
-0.0001130733,
0.0164050516,
0.2279307693,
0.089417696,
-0.1997471303,
0.1829342395,
0.174807474,
-0.2838543952,
0.0868746042,
-0.4097664654,
-0.047154028,
-0.2971981466,
0.0934278518,
0.0189006701,
-0.0412533991,
0.3089760244,
0.1403642595,
0.5131547451,
-0.1917047948,
-0.1336634606,
0.6230677962,
0.2051521838,
-0.3506301343,
0.5299630761,
0.5806370974,
-0.0487997942,
-0.3053151965,
0.1361404061,
-0.0814443007,
0.2701411247,
0.0370223783,
0.1979731321,
-0.1128053069,
0.1795918941,
0.123810336,
0.4088887572,
0.3083907664,
-0.0893914253,
-0.314886421,
-0.2920186222,
-0.0569282286,
-0.2332931459,
0.0203077532,
0.3264190555,
-0.2583793104,
0.2713419497,
-0.3137760758,
0.1547778696,
-0.1056507826,
0.1795517504,
-0.1511591077,
-0.0686158985,
0.1150509268,
0.1985103935,
0.0937959924,
0.0133131156,
0.1511933506,
-0.1696210355,
0.0284059588,
-0.0521108434,
-0.2883044481,
-0.0881550089,
0.1556631625,
0.1755785048,
0.2685058117,
0.159310326,
0.4223206937,
0.1182837933,
0.265193373,
0.0943621695,
0.045135688,
-0.0090213399,
-0.2695649862,
-0.0009782977,
0.3478800952,
0.2753002644,
-0.2945163548,
0.0208777506,
-0.2383214086,
-0.1844542176,
0.1815628409,
-0.1973295361,
-0.0274536777,
-0.133716926,
0.0043231249,
-0.0873045102,
-0.3421144783,
-0.1278228015,
-0.0265573822,
0.4784686267,
-0.1834657937,
-0.026572492,
-0.2126669139,
0.1222239435,
-0.3353428841,
-0.2540251911,
-0.1243123338,
-0.1883357167,
-0.1600800753,
0.2303076535,
0.1097954586,
0.056097813,
0.3020734787,
0.0585403554,
-0.1985151023,
0.2419625521,
0.3923715055,
-0.1808657944,
0.1044564769,
0.0197550524,
0.0112556247,
0.0635321811,
-0.1637399793,
0.2447642088,
-0.3910899758,
0.1972705871,
-0.1953565329,
-0.338478148,
0.0306391455,
0.0919929966,
-0.1056952402,
-0.0997600779,
-0.2270812392,
0.246245265,
-0.0694223642,
-0.1997458488,
-0.0774376392,
-0.0941937268,
0.0402901322,
-0.1531326622,
0.1413004994,
0.0776269808,
-0.2506593168,
0.2018508017,
-0.0451864563,
0.3970348537,
0.2543900013,
0.5308366418,
-0.5031033158,
0.1623611599,
-0.1327785552,
0.2966159284,
0.2320236266,
-0.0281318966,
-0.6667605639,
0.4973528087,
-0.0042585502,
0.0241889916,
0.2724843323,
0.1617121547,
0.351677835,
0.1078482866,
-0.0490624197,
0.3837118745,
0.1839480996,
0.2279310226,
-0.3400997818,
-0.2303103656,
-0.0487274714,
0.3479748964,
-0.324473232,
-0.1571210772,
0.3112509847,
-0.3645974696,
0.490659833,
-0.2065639645,
-0.1836266071,
0.2509784698,
0.0870237574,
-0.2777456343,
0.1183486357,
0.0964875445,
0.0859435499,
0.2421767265,
-0.1894866824,
-0.0184648018,
0.0450903215,
-0.1888089329,
-0.0722151995,
0.0619629808,
-0.0552601777,
-0.0473854542,
-0.0448972695,
-0.0918301195,
0.3306872547,
-0.0035312627,
0.1647334397,
-0.1632061899,
-0.2693368793,
-0.009445671,
-0.2626185715,
0.0792924166,
0.0950682834,
-0.1213107705,
0.0093064299,
-0.2492530793,
-0.0884236023,
-0.0017328872,
-0.1519373357,
0.3275277615,
0.1502290815,
0.1502470672,
0.2235310078,
0.1522478461,
0.1419565976,
-0.0849311128,
0.3879738152,
0.2968659997,
0.0753156692,
0.0365263224,
-0.4053477645,
0.5263325572,
0.3933129311,
0.316054523,
0.2904032469,
-0.3733907342,
0.1644445509,
0.0483794436,
0.1105024591,
0.410638839,
0.2937987745,
0.2421560138,
0.5489555597,
0.1663257033,
-0.3161972165,
0.1155822724,
0.4506135881,
-0.249601692,
0.0180422086,
0.1873043329,
-0.4217132628,
-0.1856171042,
0.370215714,
-0.1509690881,
0.326580286,
0.3312531114,
0.1606445163,
-0.1239555106,
0.0274432246,
-0.2904405296,
0.2625499666,
0.0967947692,
0.1414085627,
-0.2201083302,
0.4368431568,
-0.0920058191,
-0.2460107803,
-0.3815978765,
-0.0392078236,
0.1921320558,
-0.1264010519,
0.3072986901,
-0.0982983783,
0.0536191501,
-0.0324512906,
0.1308006644,
0.0790723488,
-0.086535424,
0.0450387262,
0.193540886,
-0.1812106073,
-0.1583382338,
-0.055191271,
0.227895245,
0.2617881298,
-0.2087614238,
-0.0017744595,
-0.0716874078,
-0.3983872235,
0.0803132057,
0.2775995731,
0.1493918747,
0.1450456977,
-0.0469180755,
-0.1854478717,
-0.2801739275,
-0.3152383566,
-0.006573176,
0.0799069703,
0.2866190076,
-0.0709004924,
0.0763943642,
-0.3244523406,
-0.144766435,
0.0637097806,
-0.2329102308,
-0.151325807,
0.2760072351,
-0.180747658,
0.0008986764,
0.0887833238,
-0.3163753748,
-0.1673076898,
-0.3001770377,
0.3784308434,
0.1727609187,
0.2083456069,
0.107555218,
0.3943434656,
0.1223712638,
0.0096600028,
0.1228195205,
0.0379164666,
-0.4149514139,
0.5190880895,
-0.1802637726,
-0.4500642121,
-0.4888218045,
-0.242930308,
-0.1641490459,
0.4524992704,
-0.534160912,
-0.0311469082,
-0.5311314464,
0.4127759039,
0.1235399023,
0.1021673679,
0.0496033803,
-0.2131574303,
-0.2089556605,
0.1292297393,
0.0826180205,
-0.0064191269,
-0.0878510624,
0.2021378875,
-0.061521288,
0.0337112136,
-0.0098686498,
0.7692421079,
0.0689439699,
-0.0129046617,
0.263535887,
-0.0949029922,
0.0519068129,
-0.1647451967,
0.1458876729,
0.0905034766,
-0.260880053,
-0.2699274719,
0.418389827,
0.164147228,
-0.3080242574,
0.0591343157,
-0.1851302683,
-0.0976590887,
-0.2781838179,
0.2541962862,
0.158824414,
0.1743983328,
0.069860667,
0.3926581144,
-0.3018997908,
-0.1359267533,
0.0707093626,
-0.2578144372,
0.0201727953,
-0.1169836372,
-0.3373415172,
-0.059715718,
-0.6845933199,
0.2021395713,
-0.0698043853,
0.0391391516,
0.2540457249,
-0.3021758795,
0.2348046452,
-0.0662641972,
0.5487118363,
0.1905718595,
-0.1996440589,
-0.1152184904,
-0.2325005829,
-0.4247894287,
-0.1554236263,
-0.4956257045,
0.113651678,
-0.0005395525,
0.3345814347,
-0.3185555339,
0.111836426,
0.0000605079,
0.3112286031,
0.1916498095,
-0.0442787297,
-0.167655021,
-0.2823409438,
-0.1325234771,
0.1623778045,
-0.1995147318,
0.0504497029,
-0.2694345117,
-0.1696106195,
-0.1472622007,
0.1772929281,
0.116819948,
0.4819426239,
0.2846929133,
-0.4382566214,
0.3633344471,
0.0272249877,
0.1518049985,
0.3828197122,
0.4000196755,
0.3224878907,
-0.1235771254,
0.1998888403,
0.1022289097,
0.0747965574,
0.5333116651,
-0.0012650299,
0.1972726285,
0.0611075796,
0.2763023376,
-0.0564489476,
0.0823672041,
0.3274202347,
-0.0823387057,
-0.062497247,
-0.3168289363,
0.7024027705,
0.0998986438,
0.0085827522,
0.2355284095,
-0.1901878715,
0.1304430664,
0.30139485,
-0.102206707,
0.914337337,
-0.1250880808,
0.2525976598,
0.3494725227,
0.0667310059,
0.0075899558,
-0.0959176421,
0.1510163844,
-0.3135030866,
-0.2316494584,
0.1761054695,
-0.2805036604,
0.08492098,
0.2128593326,
-0.1312743872,
0.0862878561,
-0.0537314564,
0.1990431845,
-0.2258604467,
0.2392510474,
-0.2529600263,
-0.0510921925,
-0.4353418052,
0.0288211089,
0.097289443,
-0.0646519139,
0.0886060447,
-0.1453690082,
-0.5541807413,
0.0102532646,
-0.0938769057,
0.038914416,
-0.2355803996,
0.1632980108,
0.0593761653,
-0.4771614969,
-0.0842534155,
0.1212544218,
-0.4953687191,
0.0789547488,
-0.245811969,
0.4174096286,
0.0435453989,
0.2301589549,
0.530809164,
-0.3330540657,
-0.0087198084,
-0.02921905,
-0.2165679336,
0.249541074,
-0.1539895684,
-0.2520103455,
0.0252855346,
0.143731311,
0.3611814678,
-0.167501986,
-0.2776464224,
-0.1240045801,
-0.4408732355,
-0.2431270033,
0.0841378048,
-0.0427367575,
0.0855584666,
0.2314763367,
0.3174691796,
-0.3549930751,
-0.2242874503,
0.3709996045,
0.0943127424,
0.2603206336,
0.3130874038,
0.0880959854,
-0.2163753808,
-0.1274373829,
0.2965532243,
0.411142379,
-0.4757105112,
0.0690820217,
0.013951323,
0.1246266812,
0.2461801022,
0.0182093326,
0.0741975009,
-0.2569900453,
-0.3386790156,
-0.0690866932,
0.0099440571,
0.3278675973,
0.120761618,
0.1357960254,
0.0576914698,
-0.0145965433,
-0.3653219044,
0.0142487707,
-0.2701687217,
0.1390895545,
-0.0243228301,
0.1828632504,
-0.4315899312,
0.0174093843,
0.0081376666,
0.1431653053,
0.1091621891,
0.1063815057,
-0.1234384924,
-0.2166474015,
0.0291856732,
0.1290724277,
-0.1361881196,
-0.2797193825,
0.2394433171,
-0.2063069791,
-0.0508660935,
-0.3758655787,
0.1421239376,
-0.1364210844,
-0.0316603966,
-0.4254382551,
0.2596432269,
-0.1692033708,
-0.3019404113,
0.3180859983,
-0.4044683278,
0.177998364,
0.0607637577,
0.1787562966,
0.0040057274,
-0.1559252292,
0.0720915645,
0.2029665858,
0.1648199707,
0.13967821,
0.3797293603,
-0.0262121763,
-0.0972279608,
-0.1073898897,
0.3312669694,
0.3493905663,
0.0380295403,
-0.1387912482,
0.1757906228,
0.2256357968,
-0.3251367509,
-0.2828208804,
-0.1296371669,
-0.2570060492,
0.2418892533,
0.0095795682,
0.2093760073,
0.1670227647,
-0.0789556578,
-0.206896916,
0.0986439735,
0.5504128933,
-0.1451754272,
0.6776701212,
0.3272511363,
-0.1993044913,
0.2702797353,
0.0020870382,
0.3459143639,
0.3618882298,
-0.1196034476,
0.5368241668,
0.232074514,
0.2449537963,
-0.1339673102,
-0.3090496063,
0.1352113336,
-0.0015170389,
-0.0136431558,
0.1391918808,
0.0621288344,
0.449041903,
0.0052276254,
0.0771016181,
-0.3266302943,
-0.1267496794,
0.0290438887,
-0.0826169401,
-0.0433855243,
-0.1177397668,
-0.0748513341,
0.1068686321,
-0.3724666536,
-0.1312436312,
0.3648230433,
0.0338449776,
0.1812085211,
-0.4446077049,
0.2035415769,
-0.1569178551,
0.218098551,
-0.2398339212,
0.1747610867,
0.050084684,
-0.0667938218,
0.0713925883,
0.1016838029,
0.3679462969,
0.1852423549,
-0.1066011861,
-0.173093006,
-0.0566397719,
-0.0385057107,
-0.0139070116,
-0.0869696215,
0.0414151885,
-0.0986003429,
0.3017621934,
0.0308141485,
-0.1557210833,
-0.1387580186,
-0.0228549819,
-0.2242792696,
-0.3263449371,
-0.3453313708,
-0.2006978095,
-0.328232646,
-0.1295246333,
-0.1895686537,
-0.2536433041,
0.1835203618,
0.2279346138,
-0.3133317828,
-0.0675588474,
0.0006712062,
0.0845005736,
-0.5105262995,
0.6805173159,
0.4650323689,
0.5556753278,
-0.3209068477,
-0.116044797,
-0.4356545508,
0.0629211515,
-0.6595266461,
-0.0497879386,
0.2942714691,
0.3931100965,
0.1516691744,
0.2153778821,
0.1646079421,
0.1359258741,
-0.1916751415,
0.3211125135,
-0.5305005312,
-0.0809502825,
-0.0275069494,
0.0169768427,
-0.2176151127,
-0.6412060857,
0.4145413339,
-0.4362513423,
0.0196192767,
-0.1795401275,
-0.1805548966,
0.3991860747,
0.2217819095,
0.5155704618,
0.0022800644,
0.1430403441,
0.0240670182,
-0.1811050475,
-0.1920025796,
-0.0376323424,
0.0861413926,
0.1762728393,
-0.0916484073,
0.0870482624,
0.1293836981,
-0.1807275414,
0.0944082662,
0.6064496636,
-0.1033740491,
0.0085013788,
0.1139354184,
-0.1410083175,
-0.2004247308,
0.1103876457,
-0.1858650446,
-0.0338985585,
-0.0985820293,
-0.2373307496,
-0.1588728726,
-0.1999847144,
0.4235753119,
-0.4598164558,
0.057306245,
-0.1773608923,
0.2722937763,
0.2497566193,
0.3505439758,
-0.1962873936,
0.029730957,
0.3197359443,
0.0932121798,
-0.0431471467,
0.231146276,
0.1514274925,
0.1145223826,
-0.0749373063,
0.3918390274,
-0.3036595583,
-0.3066390753,
-0.2293880433,
-0.3594547808
] |
https://github.com/huggingface/datasets/issues/1803 | Querying examples from big datasets is slower than small datasets | I have a dataset with about 2.7 million rows (which I'm loading via `load_from_disk`), and I need to fetch around 300k (particular) rows of it, by index. Currently this is taking a really long time (~8 hours). I tried sharding the large dataset but overall it doesn't change how long it takes to fetch the desired rows.
I actually have enough RAM that I could fit the large dataset in memory. Would having the large dataset in memory speed up querying? To find out, I tried to load (a column of) the large dataset into memory like this:
```
column_data = large_ds['column_name']
```
but in itself this takes a really long time.
I'm pretty stuck - do you have any ideas what I should do? | After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed. | 125 | Querying examples from big datasets is slower than small datasets
After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed.
I have a dataset with about 2.7 million rows (which I'm loading via `load_from_disk`), and I need to fetch around 300k (particular) rows of it, by index. Currently this is taking a really long time (~8 hours). I tried sharding the large dataset but overall it doesn't change how long it takes to fetch the desired rows.
I actually have enough RAM that I could fit the large dataset in memory. Would having the large dataset in memory speed up querying? To find out, I tried to load (a column of) the large dataset into memory like this:
```
column_data = large_ds['column_name']
```
but in itself this takes a really long time.
I'm pretty stuck - do you have any ideas what I should do? | [
-0.4054937661,
0.058644373,
-0.0799715444,
0.131532535,
-0.0796942189,
-0.177691564,
0.2441748083,
0.4918093979,
-0.2313988209,
0.1801939607,
0.0814937055,
0.0550893359,
0.1250858158,
-0.1007566899,
0.1307258159,
-0.273406595,
0.0807414576,
0.1248459145,
-0.0751321092,
-0.0345287286,
0.0240302868,
-0.1902867854,
-0.3486272097,
0.0184701234,
-0.0663275197,
-0.2240722775,
-0.2307067364,
0.1072062477,
-0.1658503264,
-0.4173947275,
-0.0595364235,
-0.1528191417,
0.2299300432,
0.4270309806,
-0.0001130733,
0.0164050516,
0.2279307693,
0.089417696,
-0.1997471303,
0.1829342395,
0.174807474,
-0.2838543952,
0.0868746042,
-0.4097664654,
-0.047154028,
-0.2971981466,
0.0934278518,
0.0189006701,
-0.0412533991,
0.3089760244,
0.1403642595,
0.5131547451,
-0.1917047948,
-0.1336634606,
0.6230677962,
0.2051521838,
-0.3506301343,
0.5299630761,
0.5806370974,
-0.0487997942,
-0.3053151965,
0.1361404061,
-0.0814443007,
0.2701411247,
0.0370223783,
0.1979731321,
-0.1128053069,
0.1795918941,
0.123810336,
0.4088887572,
0.3083907664,
-0.0893914253,
-0.314886421,
-0.2920186222,
-0.0569282286,
-0.2332931459,
0.0203077532,
0.3264190555,
-0.2583793104,
0.2713419497,
-0.3137760758,
0.1547778696,
-0.1056507826,
0.1795517504,
-0.1511591077,
-0.0686158985,
0.1150509268,
0.1985103935,
0.0937959924,
0.0133131156,
0.1511933506,
-0.1696210355,
0.0284059588,
-0.0521108434,
-0.2883044481,
-0.0881550089,
0.1556631625,
0.1755785048,
0.2685058117,
0.159310326,
0.4223206937,
0.1182837933,
0.265193373,
0.0943621695,
0.045135688,
-0.0090213399,
-0.2695649862,
-0.0009782977,
0.3478800952,
0.2753002644,
-0.2945163548,
0.0208777506,
-0.2383214086,
-0.1844542176,
0.1815628409,
-0.1973295361,
-0.0274536777,
-0.133716926,
0.0043231249,
-0.0873045102,
-0.3421144783,
-0.1278228015,
-0.0265573822,
0.4784686267,
-0.1834657937,
-0.026572492,
-0.2126669139,
0.1222239435,
-0.3353428841,
-0.2540251911,
-0.1243123338,
-0.1883357167,
-0.1600800753,
0.2303076535,
0.1097954586,
0.056097813,
0.3020734787,
0.0585403554,
-0.1985151023,
0.2419625521,
0.3923715055,
-0.1808657944,
0.1044564769,
0.0197550524,
0.0112556247,
0.0635321811,
-0.1637399793,
0.2447642088,
-0.3910899758,
0.1972705871,
-0.1953565329,
-0.338478148,
0.0306391455,
0.0919929966,
-0.1056952402,
-0.0997600779,
-0.2270812392,
0.246245265,
-0.0694223642,
-0.1997458488,
-0.0774376392,
-0.0941937268,
0.0402901322,
-0.1531326622,
0.1413004994,
0.0776269808,
-0.2506593168,
0.2018508017,
-0.0451864563,
0.3970348537,
0.2543900013,
0.5308366418,
-0.5031033158,
0.1623611599,
-0.1327785552,
0.2966159284,
0.2320236266,
-0.0281318966,
-0.6667605639,
0.4973528087,
-0.0042585502,
0.0241889916,
0.2724843323,
0.1617121547,
0.351677835,
0.1078482866,
-0.0490624197,
0.3837118745,
0.1839480996,
0.2279310226,
-0.3400997818,
-0.2303103656,
-0.0487274714,
0.3479748964,
-0.324473232,
-0.1571210772,
0.3112509847,
-0.3645974696,
0.490659833,
-0.2065639645,
-0.1836266071,
0.2509784698,
0.0870237574,
-0.2777456343,
0.1183486357,
0.0964875445,
0.0859435499,
0.2421767265,
-0.1894866824,
-0.0184648018,
0.0450903215,
-0.1888089329,
-0.0722151995,
0.0619629808,
-0.0552601777,
-0.0473854542,
-0.0448972695,
-0.0918301195,
0.3306872547,
-0.0035312627,
0.1647334397,
-0.1632061899,
-0.2693368793,
-0.009445671,
-0.2626185715,
0.0792924166,
0.0950682834,
-0.1213107705,
0.0093064299,
-0.2492530793,
-0.0884236023,
-0.0017328872,
-0.1519373357,
0.3275277615,
0.1502290815,
0.1502470672,
0.2235310078,
0.1522478461,
0.1419565976,
-0.0849311128,
0.3879738152,
0.2968659997,
0.0753156692,
0.0365263224,
-0.4053477645,
0.5263325572,
0.3933129311,
0.316054523,
0.2904032469,
-0.3733907342,
0.1644445509,
0.0483794436,
0.1105024591,
0.410638839,
0.2937987745,
0.2421560138,
0.5489555597,
0.1663257033,
-0.3161972165,
0.1155822724,
0.4506135881,
-0.249601692,
0.0180422086,
0.1873043329,
-0.4217132628,
-0.1856171042,
0.370215714,
-0.1509690881,
0.326580286,
0.3312531114,
0.1606445163,
-0.1239555106,
0.0274432246,
-0.2904405296,
0.2625499666,
0.0967947692,
0.1414085627,
-0.2201083302,
0.4368431568,
-0.0920058191,
-0.2460107803,
-0.3815978765,
-0.0392078236,
0.1921320558,
-0.1264010519,
0.3072986901,
-0.0982983783,
0.0536191501,
-0.0324512906,
0.1308006644,
0.0790723488,
-0.086535424,
0.0450387262,
0.193540886,
-0.1812106073,
-0.1583382338,
-0.055191271,
0.227895245,
0.2617881298,
-0.2087614238,
-0.0017744595,
-0.0716874078,
-0.3983872235,
0.0803132057,
0.2775995731,
0.1493918747,
0.1450456977,
-0.0469180755,
-0.1854478717,
-0.2801739275,
-0.3152383566,
-0.006573176,
0.0799069703,
0.2866190076,
-0.0709004924,
0.0763943642,
-0.3244523406,
-0.144766435,
0.0637097806,
-0.2329102308,
-0.151325807,
0.2760072351,
-0.180747658,
0.0008986764,
0.0887833238,
-0.3163753748,
-0.1673076898,
-0.3001770377,
0.3784308434,
0.1727609187,
0.2083456069,
0.107555218,
0.3943434656,
0.1223712638,
0.0096600028,
0.1228195205,
0.0379164666,
-0.4149514139,
0.5190880895,
-0.1802637726,
-0.4500642121,
-0.4888218045,
-0.242930308,
-0.1641490459,
0.4524992704,
-0.534160912,
-0.0311469082,
-0.5311314464,
0.4127759039,
0.1235399023,
0.1021673679,
0.0496033803,
-0.2131574303,
-0.2089556605,
0.1292297393,
0.0826180205,
-0.0064191269,
-0.0878510624,
0.2021378875,
-0.061521288,
0.0337112136,
-0.0098686498,
0.7692421079,
0.0689439699,
-0.0129046617,
0.263535887,
-0.0949029922,
0.0519068129,
-0.1647451967,
0.1458876729,
0.0905034766,
-0.260880053,
-0.2699274719,
0.418389827,
0.164147228,
-0.3080242574,
0.0591343157,
-0.1851302683,
-0.0976590887,
-0.2781838179,
0.2541962862,
0.158824414,
0.1743983328,
0.069860667,
0.3926581144,
-0.3018997908,
-0.1359267533,
0.0707093626,
-0.2578144372,
0.0201727953,
-0.1169836372,
-0.3373415172,
-0.059715718,
-0.6845933199,
0.2021395713,
-0.0698043853,
0.0391391516,
0.2540457249,
-0.3021758795,
0.2348046452,
-0.0662641972,
0.5487118363,
0.1905718595,
-0.1996440589,
-0.1152184904,
-0.2325005829,
-0.4247894287,
-0.1554236263,
-0.4956257045,
0.113651678,
-0.0005395525,
0.3345814347,
-0.3185555339,
0.111836426,
0.0000605079,
0.3112286031,
0.1916498095,
-0.0442787297,
-0.167655021,
-0.2823409438,
-0.1325234771,
0.1623778045,
-0.1995147318,
0.0504497029,
-0.2694345117,
-0.1696106195,
-0.1472622007,
0.1772929281,
0.116819948,
0.4819426239,
0.2846929133,
-0.4382566214,
0.3633344471,
0.0272249877,
0.1518049985,
0.3828197122,
0.4000196755,
0.3224878907,
-0.1235771254,
0.1998888403,
0.1022289097,
0.0747965574,
0.5333116651,
-0.0012650299,
0.1972726285,
0.0611075796,
0.2763023376,
-0.0564489476,
0.0823672041,
0.3274202347,
-0.0823387057,
-0.062497247,
-0.3168289363,
0.7024027705,
0.0998986438,
0.0085827522,
0.2355284095,
-0.1901878715,
0.1304430664,
0.30139485,
-0.102206707,
0.914337337,
-0.1250880808,
0.2525976598,
0.3494725227,
0.0667310059,
0.0075899558,
-0.0959176421,
0.1510163844,
-0.3135030866,
-0.2316494584,
0.1761054695,
-0.2805036604,
0.08492098,
0.2128593326,
-0.1312743872,
0.0862878561,
-0.0537314564,
0.1990431845,
-0.2258604467,
0.2392510474,
-0.2529600263,
-0.0510921925,
-0.4353418052,
0.0288211089,
0.097289443,
-0.0646519139,
0.0886060447,
-0.1453690082,
-0.5541807413,
0.0102532646,
-0.0938769057,
0.038914416,
-0.2355803996,
0.1632980108,
0.0593761653,
-0.4771614969,
-0.0842534155,
0.1212544218,
-0.4953687191,
0.0789547488,
-0.245811969,
0.4174096286,
0.0435453989,
0.2301589549,
0.530809164,
-0.3330540657,
-0.0087198084,
-0.02921905,
-0.2165679336,
0.249541074,
-0.1539895684,
-0.2520103455,
0.0252855346,
0.143731311,
0.3611814678,
-0.167501986,
-0.2776464224,
-0.1240045801,
-0.4408732355,
-0.2431270033,
0.0841378048,
-0.0427367575,
0.0855584666,
0.2314763367,
0.3174691796,
-0.3549930751,
-0.2242874503,
0.3709996045,
0.0943127424,
0.2603206336,
0.3130874038,
0.0880959854,
-0.2163753808,
-0.1274373829,
0.2965532243,
0.411142379,
-0.4757105112,
0.0690820217,
0.013951323,
0.1246266812,
0.2461801022,
0.0182093326,
0.0741975009,
-0.2569900453,
-0.3386790156,
-0.0690866932,
0.0099440571,
0.3278675973,
0.120761618,
0.1357960254,
0.0576914698,
-0.0145965433,
-0.3653219044,
0.0142487707,
-0.2701687217,
0.1390895545,
-0.0243228301,
0.1828632504,
-0.4315899312,
0.0174093843,
0.0081376666,
0.1431653053,
0.1091621891,
0.1063815057,
-0.1234384924,
-0.2166474015,
0.0291856732,
0.1290724277,
-0.1361881196,
-0.2797193825,
0.2394433171,
-0.2063069791,
-0.0508660935,
-0.3758655787,
0.1421239376,
-0.1364210844,
-0.0316603966,
-0.4254382551,
0.2596432269,
-0.1692033708,
-0.3019404113,
0.3180859983,
-0.4044683278,
0.177998364,
0.0607637577,
0.1787562966,
0.0040057274,
-0.1559252292,
0.0720915645,
0.2029665858,
0.1648199707,
0.13967821,
0.3797293603,
-0.0262121763,
-0.0972279608,
-0.1073898897,
0.3312669694,
0.3493905663,
0.0380295403,
-0.1387912482,
0.1757906228,
0.2256357968,
-0.3251367509,
-0.2828208804,
-0.1296371669,
-0.2570060492,
0.2418892533,
0.0095795682,
0.2093760073,
0.1670227647,
-0.0789556578,
-0.206896916,
0.0986439735,
0.5504128933,
-0.1451754272,
0.6776701212,
0.3272511363,
-0.1993044913,
0.2702797353,
0.0020870382,
0.3459143639,
0.3618882298,
-0.1196034476,
0.5368241668,
0.232074514,
0.2449537963,
-0.1339673102,
-0.3090496063,
0.1352113336,
-0.0015170389,
-0.0136431558,
0.1391918808,
0.0621288344,
0.449041903,
0.0052276254,
0.0771016181,
-0.3266302943,
-0.1267496794,
0.0290438887,
-0.0826169401,
-0.0433855243,
-0.1177397668,
-0.0748513341,
0.1068686321,
-0.3724666536,
-0.1312436312,
0.3648230433,
0.0338449776,
0.1812085211,
-0.4446077049,
0.2035415769,
-0.1569178551,
0.218098551,
-0.2398339212,
0.1747610867,
0.050084684,
-0.0667938218,
0.0713925883,
0.1016838029,
0.3679462969,
0.1852423549,
-0.1066011861,
-0.173093006,
-0.0566397719,
-0.0385057107,
-0.0139070116,
-0.0869696215,
0.0414151885,
-0.0986003429,
0.3017621934,
0.0308141485,
-0.1557210833,
-0.1387580186,
-0.0228549819,
-0.2242792696,
-0.3263449371,
-0.3453313708,
-0.2006978095,
-0.328232646,
-0.1295246333,
-0.1895686537,
-0.2536433041,
0.1835203618,
0.2279346138,
-0.3133317828,
-0.0675588474,
0.0006712062,
0.0845005736,
-0.5105262995,
0.6805173159,
0.4650323689,
0.5556753278,
-0.3209068477,
-0.116044797,
-0.4356545508,
0.0629211515,
-0.6595266461,
-0.0497879386,
0.2942714691,
0.3931100965,
0.1516691744,
0.2153778821,
0.1646079421,
0.1359258741,
-0.1916751415,
0.3211125135,
-0.5305005312,
-0.0809502825,
-0.0275069494,
0.0169768427,
-0.2176151127,
-0.6412060857,
0.4145413339,
-0.4362513423,
0.0196192767,
-0.1795401275,
-0.1805548966,
0.3991860747,
0.2217819095,
0.5155704618,
0.0022800644,
0.1430403441,
0.0240670182,
-0.1811050475,
-0.1920025796,
-0.0376323424,
0.0861413926,
0.1762728393,
-0.0916484073,
0.0870482624,
0.1293836981,
-0.1807275414,
0.0944082662,
0.6064496636,
-0.1033740491,
0.0085013788,
0.1139354184,
-0.1410083175,
-0.2004247308,
0.1103876457,
-0.1858650446,
-0.0338985585,
-0.0985820293,
-0.2373307496,
-0.1588728726,
-0.1999847144,
0.4235753119,
-0.4598164558,
0.057306245,
-0.1773608923,
0.2722937763,
0.2497566193,
0.3505439758,
-0.1962873936,
0.029730957,
0.3197359443,
0.0932121798,
-0.0431471467,
0.231146276,
0.1514274925,
0.1145223826,
-0.0749373063,
0.3918390274,
-0.3036595583,
-0.3066390753,
-0.2293880433,
-0.3594547808
] |
https://github.com/huggingface/datasets/issues/1803 | Querying examples from big datasets is slower than small datasets | Hi ! Feel free to post a message on the [forum](https://discuss.huggingface.co/c/datasets/10). I'd be happy to help you with this.
In your post on the forum, feel free to add more details about your setup:
What are column names and types of your dataset ?
How was the dataset constructed ?
Is the dataset shuffled ?
Is the dataset tokenized ?
Are you on a SSD or an HDD ?
I'm sure we can figure something out.
For example on my laptop I can access the 6 millions articles from wikipedia in less than a minute. | After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed. | 95 | Querying examples from big datasets is slower than small datasets
After some experiments with bookcorpus I noticed that querying examples from big datasets is slower than small datasets.
For example
```python
from datasets import load_dataset
b1 = load_dataset("bookcorpus", split="train[:1%]")
b50 = load_dataset("bookcorpus", split="train[:50%]")
b100 = load_dataset("bookcorpus", split="train[:100%]")
%timeit _ = b1[-1]
# 12.2 Β΅s Β± 70.4 ns per loop (mean Β± std. dev. of 7 runs, 100000 loops each)
%timeit _ = b50[-1]
# 92.5 Β΅s Β± 1.24 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
%timeit _ = b100[-1]
# 177 Β΅s Β± 3.13 Β΅s per loop (mean Β± std. dev. of 7 runs, 10000 loops each)
```
It looks like the time to fetch the example increases with the size of the dataset.
This is maybe due to the use of the Arrow streaming format to store the data on disk. I guess pyarrow needs to iterate through the file as a stream to find the queried sample.
Maybe switching to the Arrow IPC file format could help fixing this issue.
Indeed according to the [documentation](https://arrow.apache.org/docs/format/Columnar.html?highlight=arrow1#ipc-file-format), it's identical to the streaming format except that it contains the memory offsets of each sample, which could fix the issue:
> We define a βfile formatβ supporting random access that is build with the stream format. The file starts and ends with a magic string ARROW1 (plus padding). What follows in the file is identical to the stream format. At the end of the file, we write a footer containing a redundant copy of the schema (which is a part of the streaming format) plus memory offsets and sizes for each of the data blocks in the file. This enables random access any record batch in the file. See File.fbs for the precise details of the file footer.
cc @gaceladri since it can help speed up your training when this one is fixed.
Hi ! Feel free to post a message on the [forum](https://discuss.huggingface.co/c/datasets/10). I'd be happy to help you with this.
In your post on the forum, feel free to add more details about your setup:
What are column names and types of your dataset ?
How was the dataset constructed ?
Is the dataset shuffled ?
Is the dataset tokenized ?
Are you on a SSD or an HDD ?
I'm sure we can figure something out.
For example on my laptop I can access the 6 millions articles from wikipedia in less than a minute. | [
-0.4054937661,
0.058644373,
-0.0799715444,
0.131532535,
-0.0796942189,
-0.177691564,
0.2441748083,
0.4918093979,
-0.2313988209,
0.1801939607,
0.0814937055,
0.0550893359,
0.1250858158,
-0.1007566899,
0.1307258159,
-0.273406595,
0.0807414576,
0.1248459145,
-0.0751321092,
-0.0345287286,
0.0240302868,
-0.1902867854,
-0.3486272097,
0.0184701234,
-0.0663275197,
-0.2240722775,
-0.2307067364,
0.1072062477,
-0.1658503264,
-0.4173947275,
-0.0595364235,
-0.1528191417,
0.2299300432,
0.4270309806,
-0.0001130733,
0.0164050516,
0.2279307693,
0.089417696,
-0.1997471303,
0.1829342395,
0.174807474,
-0.2838543952,
0.0868746042,
-0.4097664654,
-0.047154028,
-0.2971981466,
0.0934278518,
0.0189006701,
-0.0412533991,
0.3089760244,
0.1403642595,
0.5131547451,
-0.1917047948,
-0.1336634606,
0.6230677962,
0.2051521838,
-0.3506301343,
0.5299630761,
0.5806370974,
-0.0487997942,
-0.3053151965,
0.1361404061,
-0.0814443007,
0.2701411247,
0.0370223783,
0.1979731321,
-0.1128053069,
0.1795918941,
0.123810336,
0.4088887572,
0.3083907664,
-0.0893914253,
-0.314886421,
-0.2920186222,
-0.0569282286,
-0.2332931459,
0.0203077532,
0.3264190555,
-0.2583793104,
0.2713419497,
-0.3137760758,
0.1547778696,
-0.1056507826,
0.1795517504,
-0.1511591077,
-0.0686158985,
0.1150509268,
0.1985103935,
0.0937959924,
0.0133131156,
0.1511933506,
-0.1696210355,
0.0284059588,
-0.0521108434,
-0.2883044481,
-0.0881550089,
0.1556631625,
0.1755785048,
0.2685058117,
0.159310326,
0.4223206937,
0.1182837933,
0.265193373,
0.0943621695,
0.045135688,
-0.0090213399,
-0.2695649862,
-0.0009782977,
0.3478800952,
0.2753002644,
-0.2945163548,
0.0208777506,
-0.2383214086,
-0.1844542176,
0.1815628409,
-0.1973295361,
-0.0274536777,
-0.133716926,
0.0043231249,
-0.0873045102,
-0.3421144783,
-0.1278228015,
-0.0265573822,
0.4784686267,
-0.1834657937,
-0.026572492,
-0.2126669139,
0.1222239435,
-0.3353428841,
-0.2540251911,
-0.1243123338,
-0.1883357167,
-0.1600800753,
0.2303076535,
0.1097954586,
0.056097813,
0.3020734787,
0.0585403554,
-0.1985151023,
0.2419625521,
0.3923715055,
-0.1808657944,
0.1044564769,
0.0197550524,
0.0112556247,
0.0635321811,
-0.1637399793,
0.2447642088,
-0.3910899758,
0.1972705871,
-0.1953565329,
-0.338478148,
0.0306391455,
0.0919929966,
-0.1056952402,
-0.0997600779,
-0.2270812392,
0.246245265,
-0.0694223642,
-0.1997458488,
-0.0774376392,
-0.0941937268,
0.0402901322,
-0.1531326622,
0.1413004994,
0.0776269808,
-0.2506593168,
0.2018508017,
-0.0451864563,
0.3970348537,
0.2543900013,
0.5308366418,
-0.5031033158,
0.1623611599,
-0.1327785552,
0.2966159284,
0.2320236266,
-0.0281318966,
-0.6667605639,
0.4973528087,
-0.0042585502,
0.0241889916,
0.2724843323,
0.1617121547,
0.351677835,
0.1078482866,
-0.0490624197,
0.3837118745,
0.1839480996,
0.2279310226,
-0.3400997818,
-0.2303103656,
-0.0487274714,
0.3479748964,
-0.324473232,
-0.1571210772,
0.3112509847,
-0.3645974696,
0.490659833,
-0.2065639645,
-0.1836266071,
0.2509784698,
0.0870237574,
-0.2777456343,
0.1183486357,
0.0964875445,
0.0859435499,
0.2421767265,
-0.1894866824,
-0.0184648018,
0.0450903215,
-0.1888089329,
-0.0722151995,
0.0619629808,
-0.0552601777,
-0.0473854542,
-0.0448972695,
-0.0918301195,
0.3306872547,
-0.0035312627,
0.1647334397,
-0.1632061899,
-0.2693368793,
-0.009445671,
-0.2626185715,
0.0792924166,
0.0950682834,
-0.1213107705,
0.0093064299,
-0.2492530793,
-0.0884236023,
-0.0017328872,
-0.1519373357,
0.3275277615,
0.1502290815,
0.1502470672,
0.2235310078,
0.1522478461,
0.1419565976,
-0.0849311128,
0.3879738152,
0.2968659997,
0.0753156692,
0.0365263224,
-0.4053477645,
0.5263325572,
0.3933129311,
0.316054523,
0.2904032469,
-0.3733907342,
0.1644445509,
0.0483794436,
0.1105024591,
0.410638839,
0.2937987745,
0.2421560138,
0.5489555597,
0.1663257033,
-0.3161972165,
0.1155822724,
0.4506135881,
-0.249601692,
0.0180422086,
0.1873043329,
-0.4217132628,
-0.1856171042,
0.370215714,
-0.1509690881,
0.326580286,
0.3312531114,
0.1606445163,
-0.1239555106,
0.0274432246,
-0.2904405296,
0.2625499666,
0.0967947692,
0.1414085627,
-0.2201083302,
0.4368431568,
-0.0920058191,
-0.2460107803,
-0.3815978765,
-0.0392078236,
0.1921320558,
-0.1264010519,
0.3072986901,
-0.0982983783,
0.0536191501,
-0.0324512906,
0.1308006644,
0.0790723488,
-0.086535424,
0.0450387262,
0.193540886,
-0.1812106073,
-0.1583382338,
-0.055191271,
0.227895245,
0.2617881298,
-0.2087614238,
-0.0017744595,
-0.0716874078,
-0.3983872235,
0.0803132057,
0.2775995731,
0.1493918747,
0.1450456977,
-0.0469180755,
-0.1854478717,
-0.2801739275,
-0.3152383566,
-0.006573176,
0.0799069703,
0.2866190076,
-0.0709004924,
0.0763943642,
-0.3244523406,
-0.144766435,
0.0637097806,
-0.2329102308,
-0.151325807,
0.2760072351,
-0.180747658,
0.0008986764,
0.0887833238,
-0.3163753748,
-0.1673076898,
-0.3001770377,
0.3784308434,
0.1727609187,
0.2083456069,
0.107555218,
0.3943434656,
0.1223712638,
0.0096600028,
0.1228195205,
0.0379164666,
-0.4149514139,
0.5190880895,
-0.1802637726,
-0.4500642121,
-0.4888218045,
-0.242930308,
-0.1641490459,
0.4524992704,
-0.534160912,
-0.0311469082,
-0.5311314464,
0.4127759039,
0.1235399023,
0.1021673679,
0.0496033803,
-0.2131574303,
-0.2089556605,
0.1292297393,
0.0826180205,
-0.0064191269,
-0.0878510624,
0.2021378875,
-0.061521288,
0.0337112136,
-0.0098686498,
0.7692421079,
0.0689439699,
-0.0129046617,
0.263535887,
-0.0949029922,
0.0519068129,
-0.1647451967,
0.1458876729,
0.0905034766,
-0.260880053,
-0.2699274719,
0.418389827,
0.164147228,
-0.3080242574,
0.0591343157,
-0.1851302683,
-0.0976590887,
-0.2781838179,
0.2541962862,
0.158824414,
0.1743983328,
0.069860667,
0.3926581144,
-0.3018997908,
-0.1359267533,
0.0707093626,
-0.2578144372,
0.0201727953,
-0.1169836372,
-0.3373415172,
-0.059715718,
-0.6845933199,
0.2021395713,
-0.0698043853,
0.0391391516,
0.2540457249,
-0.3021758795,
0.2348046452,
-0.0662641972,
0.5487118363,
0.1905718595,
-0.1996440589,
-0.1152184904,
-0.2325005829,
-0.4247894287,
-0.1554236263,
-0.4956257045,
0.113651678,
-0.0005395525,
0.3345814347,
-0.3185555339,
0.111836426,
0.0000605079,
0.3112286031,
0.1916498095,
-0.0442787297,
-0.167655021,
-0.2823409438,
-0.1325234771,
0.1623778045,
-0.1995147318,
0.0504497029,
-0.2694345117,
-0.1696106195,
-0.1472622007,
0.1772929281,
0.116819948,
0.4819426239,
0.2846929133,
-0.4382566214,
0.3633344471,
0.0272249877,
0.1518049985,
0.3828197122,
0.4000196755,
0.3224878907,
-0.1235771254,
0.1998888403,
0.1022289097,
0.0747965574,
0.5333116651,
-0.0012650299,
0.1972726285,
0.0611075796,
0.2763023376,
-0.0564489476,
0.0823672041,
0.3274202347,
-0.0823387057,
-0.062497247,
-0.3168289363,
0.7024027705,
0.0998986438,
0.0085827522,
0.2355284095,
-0.1901878715,
0.1304430664,
0.30139485,
-0.102206707,
0.914337337,
-0.1250880808,
0.2525976598,
0.3494725227,
0.0667310059,
0.0075899558,
-0.0959176421,
0.1510163844,
-0.3135030866,
-0.2316494584,
0.1761054695,
-0.2805036604,
0.08492098,
0.2128593326,
-0.1312743872,
0.0862878561,
-0.0537314564,
0.1990431845,
-0.2258604467,
0.2392510474,
-0.2529600263,
-0.0510921925,
-0.4353418052,
0.0288211089,
0.097289443,
-0.0646519139,
0.0886060447,
-0.1453690082,
-0.5541807413,
0.0102532646,
-0.0938769057,
0.038914416,
-0.2355803996,
0.1632980108,
0.0593761653,
-0.4771614969,
-0.0842534155,
0.1212544218,
-0.4953687191,
0.0789547488,
-0.245811969,
0.4174096286,
0.0435453989,
0.2301589549,
0.530809164,
-0.3330540657,
-0.0087198084,
-0.02921905,
-0.2165679336,
0.249541074,
-0.1539895684,
-0.2520103455,
0.0252855346,
0.143731311,
0.3611814678,
-0.167501986,
-0.2776464224,
-0.1240045801,
-0.4408732355,
-0.2431270033,
0.0841378048,
-0.0427367575,
0.0855584666,
0.2314763367,
0.3174691796,
-0.3549930751,
-0.2242874503,
0.3709996045,
0.0943127424,
0.2603206336,
0.3130874038,
0.0880959854,
-0.2163753808,
-0.1274373829,
0.2965532243,
0.411142379,
-0.4757105112,
0.0690820217,
0.013951323,
0.1246266812,
0.2461801022,
0.0182093326,
0.0741975009,
-0.2569900453,
-0.3386790156,
-0.0690866932,
0.0099440571,
0.3278675973,
0.120761618,
0.1357960254,
0.0576914698,
-0.0145965433,
-0.3653219044,
0.0142487707,
-0.2701687217,
0.1390895545,
-0.0243228301,
0.1828632504,
-0.4315899312,
0.0174093843,
0.0081376666,
0.1431653053,
0.1091621891,
0.1063815057,
-0.1234384924,
-0.2166474015,
0.0291856732,
0.1290724277,
-0.1361881196,
-0.2797193825,
0.2394433171,
-0.2063069791,
-0.0508660935,
-0.3758655787,
0.1421239376,
-0.1364210844,
-0.0316603966,
-0.4254382551,
0.2596432269,
-0.1692033708,
-0.3019404113,
0.3180859983,
-0.4044683278,
0.177998364,
0.0607637577,
0.1787562966,
0.0040057274,
-0.1559252292,
0.0720915645,
0.2029665858,
0.1648199707,
0.13967821,
0.3797293603,
-0.0262121763,
-0.0972279608,
-0.1073898897,
0.3312669694,
0.3493905663,
0.0380295403,
-0.1387912482,
0.1757906228,
0.2256357968,
-0.3251367509,
-0.2828208804,
-0.1296371669,
-0.2570060492,
0.2418892533,
0.0095795682,
0.2093760073,
0.1670227647,
-0.0789556578,
-0.206896916,
0.0986439735,
0.5504128933,
-0.1451754272,
0.6776701212,
0.3272511363,
-0.1993044913,
0.2702797353,
0.0020870382,
0.3459143639,
0.3618882298,
-0.1196034476,
0.5368241668,
0.232074514,
0.2449537963,
-0.1339673102,
-0.3090496063,
0.1352113336,
-0.0015170389,
-0.0136431558,
0.1391918808,
0.0621288344,
0.449041903,
0.0052276254,
0.0771016181,
-0.3266302943,
-0.1267496794,
0.0290438887,
-0.0826169401,
-0.0433855243,
-0.1177397668,
-0.0748513341,
0.1068686321,
-0.3724666536,
-0.1312436312,
0.3648230433,
0.0338449776,
0.1812085211,
-0.4446077049,
0.2035415769,
-0.1569178551,
0.218098551,
-0.2398339212,
0.1747610867,
0.050084684,
-0.0667938218,
0.0713925883,
0.1016838029,
0.3679462969,
0.1852423549,
-0.1066011861,
-0.173093006,
-0.0566397719,
-0.0385057107,
-0.0139070116,
-0.0869696215,
0.0414151885,
-0.0986003429,
0.3017621934,
0.0308141485,
-0.1557210833,
-0.1387580186,
-0.0228549819,
-0.2242792696,
-0.3263449371,
-0.3453313708,
-0.2006978095,
-0.328232646,
-0.1295246333,
-0.1895686537,
-0.2536433041,
0.1835203618,
0.2279346138,
-0.3133317828,
-0.0675588474,
0.0006712062,
0.0845005736,
-0.5105262995,
0.6805173159,
0.4650323689,
0.5556753278,
-0.3209068477,
-0.116044797,
-0.4356545508,
0.0629211515,
-0.6595266461,
-0.0497879386,
0.2942714691,
0.3931100965,
0.1516691744,
0.2153778821,
0.1646079421,
0.1359258741,
-0.1916751415,
0.3211125135,
-0.5305005312,
-0.0809502825,
-0.0275069494,
0.0169768427,
-0.2176151127,
-0.6412060857,
0.4145413339,
-0.4362513423,
0.0196192767,
-0.1795401275,
-0.1805548966,
0.3991860747,
0.2217819095,
0.5155704618,
0.0022800644,
0.1430403441,
0.0240670182,
-0.1811050475,
-0.1920025796,
-0.0376323424,
0.0861413926,
0.1762728393,
-0.0916484073,
0.0870482624,
0.1293836981,
-0.1807275414,
0.0944082662,
0.6064496636,
-0.1033740491,
0.0085013788,
0.1139354184,
-0.1410083175,
-0.2004247308,
0.1103876457,
-0.1858650446,
-0.0338985585,
-0.0985820293,
-0.2373307496,
-0.1588728726,
-0.1999847144,
0.4235753119,
-0.4598164558,
0.057306245,
-0.1773608923,
0.2722937763,
0.2497566193,
0.3505439758,
-0.1962873936,
0.029730957,
0.3197359443,
0.0932121798,
-0.0431471467,
0.231146276,
0.1514274925,
0.1145223826,
-0.0749373063,
0.3918390274,
-0.3036595583,
-0.3066390753,
-0.2293880433,
-0.3594547808
] |
https://github.com/huggingface/datasets/issues/1797 | Connection error | Hi ! For future references let me add a link to our discussion here : https://github.com/huggingface/datasets/issues/759#issuecomment-770684693
Let me know if you manage to fix your proxy issue or if we can do something on our end to help you :) | Hi
I am hitting to the error, help me and thanks.
`train_data = datasets.load_dataset("xsum", split="train")`
`ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.0.2/datasets/xsum/xsum.py` | 40 | Connection error
Hi
I am hitting to the error, help me and thanks.
`train_data = datasets.load_dataset("xsum", split="train")`
`ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.0.2/datasets/xsum/xsum.py`
Hi ! For future references let me add a link to our discussion here : https://github.com/huggingface/datasets/issues/759#issuecomment-770684693
Let me know if you manage to fix your proxy issue or if we can do something on our end to help you :) | [
-0.2624682486,
-0.4733127356,
-0.1055454537,
0.178715542,
0.5621637106,
-0.1030883864,
-0.017072212,
0.2268310785,
0.1645881385,
0.2273810804,
-0.3096102774,
-0.0045985235,
0.2044960409,
0.4432291687,
0.2047397494,
-0.2917328775,
-0.0440436788,
-0.0842049718,
-0.4558962286,
0.0675013363,
0.0823034942,
0.0975517184,
-0.1073438451,
0.0312044062,
-0.3415582478,
-0.0755452365,
-0.1273661554,
0.2207469493,
-0.268661052,
-0.1070598364,
0.4869897664,
0.1393876374,
0.023210628,
0.5769349337,
-0.0001075649,
0.1149472073,
0.3164844513,
0.0242444985,
-0.2239994258,
-0.3311401904,
-0.1180702671,
-0.0296366829,
0.2868142724,
-0.0743956193,
-0.3245801032,
0.0551903509,
0.1663984358,
-0.2252038568,
0.597260654,
0.1780352592,
0.2932913601,
0.445443809,
0.3417459726,
-0.1741366088,
-0.0087849423,
-0.2359606624,
-0.0033458418,
0.49215433,
0.1815267354,
0.0471879356,
0.2132836133,
0.2337233722,
0.0923609063,
-0.1159159467,
0.2341251969,
-0.1357224286,
0.0822610855,
-0.3459508419,
0.0348139852,
0.3595280647,
0.5571647882,
-0.1973256916,
-0.289779067,
0.0463785008,
-0.0473953374,
-0.1539389044,
0.2277335227,
0.0708231032,
-0.0782246813,
0.1751244515,
-0.224984929,
-0.2149580568,
-0.2798594236,
0.2543142438,
-0.0623601824,
0.0234310031,
-0.233323887,
0.1285450161,
0.0662392899,
-0.1325379759,
-0.1261298656,
0.157585308,
0.0271808598,
0.1737779528,
-0.467726469,
-0.0263176635,
-0.151063472,
0.2300412655,
0.2147612423,
0.1480176002,
-0.1089280546,
0.1767995358,
-0.1645571738,
0.2396333665,
0.2342701107,
0.0991907045,
-0.0924918875,
-0.0806316733,
0.2583270371,
0.2595567405,
-0.1094026342,
-0.1085266024,
-0.0784774572,
-0.2059410363,
-0.3137501776,
-0.0620307885,
0.2355896086,
-0.2644434273,
-0.2093428075,
0.0777384937,
0.1508231163,
-0.0532451309,
0.1676166803,
0.4941650331,
-0.2439726293,
0.1843065023,
0.0398413464,
0.151065588,
-0.2680299282,
-0.0373111106,
-0.3129375875,
0.1806302816,
-0.1964213848,
-0.0615588576,
-0.0442415476,
-0.1772383302,
0.2160775512,
-0.0785507709,
0.3434204161,
-0.1640194505,
0.0547124147,
-0.104493916,
-0.3085643053,
0.2629112005,
0.1635640264,
-0.0282102488,
0.2825824618,
-0.060751304,
-0.034877304,
-0.2365301847,
-0.3340732157,
-0.3741345406,
-0.0552137084,
0.2754740715,
-0.056611944,
-0.008533705,
-0.3372321427,
0.0182859935,
-0.039647162,
0.1264607161,
-0.1866015047,
-0.063207455,
-0.1109022051,
-0.1256735027,
0.4100501239,
0.226944223,
-0.0682609826,
-0.2711590528,
0.3355160058,
-0.3717988729,
0.1890808195,
0.1869223118,
-0.1268949509,
-0.019446414,
-0.1061923355,
0.1100190878,
0.1655587107,
-0.3452139497,
-0.3684441745,
0.1967098713,
-0.2838746011,
-0.073460564,
0.0429041125,
0.0068495353,
0.0907797515,
0.1455778778,
0.2033007741,
0.2076737285,
-0.0318411924,
-0.0436765254,
-0.1337381601,
-0.2656519413,
0.0427702144,
0.2702591717,
0.0227739569,
0.0227790717,
0.1320149601,
-0.0515484028,
0.2843166292,
0.0502961725,
0.0927807316,
0.2592826784,
0.2045938075,
0.227003932,
0.0053050634,
-0.3561687469,
0.0282294024,
0.091185689,
0.0471843258,
0.2919331789,
-0.0791225731,
-0.1105628461,
-0.3629340827,
-0.1520822197,
-0.1835040599,
-0.0659435764,
0.1536895335,
-0.2198694944,
0.1973171681,
0.2385952473,
-0.1191702858,
0.2829244435,
-0.1795577705,
0.2405002862,
-0.4697934985,
0.4009585083,
-0.1937503368,
0.0068574524,
0.0877897292,
0.093488425,
0.1160452813,
-0.2712266147,
-0.1282043159,
0.440864116,
-0.2160942703,
0.3192711771,
0.3897526264,
0.0405474827,
0.2562574148,
-0.4583197236,
-0.0476713106,
-0.0960998982,
0.0659597516,
0.0526324064,
0.2186976522,
0.2048567235,
0.0553216189,
0.1382390708,
0.1353874803,
0.1918750554,
0.3227005601,
0.0606966689,
-0.0891447663,
0.0702666864,
0.2163233608,
-0.1981063038,
0.0355751403,
-0.1962532997,
-0.2209893912,
-0.0054439055,
0.007767743,
-0.0190757811,
-0.0522504374,
0.0720912665,
-0.1022573858,
-0.0005347053,
0.0729400888,
0.0690678582,
0.2663547695,
0.2399249077,
-0.0378363803,
0.2792977691,
0.0580011383,
-0.1021744981,
0.1855021715,
0.068430312,
0.0449506082,
-0.0382116735,
-0.1211702526,
-0.1182551458,
-0.2871048152,
-0.0011870526,
-0.2210565209,
0.1795216799,
-0.2470751554,
-0.0214799456,
-0.0927762091,
-0.3123777509,
0.0658892468,
-0.1617259234,
-0.2731581628,
-0.3480958641,
-0.0534441657,
0.1365809888,
0.0331342295,
0.198812142,
-0.3494461775,
0.1007374823,
0.1558248252,
0.0168123152,
-0.1158866137,
-0.1174211204,
-0.1286857873,
0.1565781236,
0.0093749659,
0.0626327544,
0.3976941407,
-0.2893913686,
-0.1418684572,
-0.1058540717,
-0.2319444716,
0.0629834011,
-0.1083932593,
0.3044182658,
0.277815938,
0.4564886093,
-0.0864186212,
-0.0520352088,
0.6056531072,
-0.1802675128,
-0.0275544375,
-0.0341371596,
0.0227979347,
-0.1331536919,
0.1109787449,
-0.2991695702,
-0.5104172826,
-0.2131535858,
0.1405190676,
-0.0693684444,
0.1047185957,
0.1160706729,
0.0068445825,
0.1172983199,
-0.1809824407,
0.137224555,
-0.3094082773,
-0.8145681024,
0.1136590615,
-0.0933670327,
-0.4647523761,
0.1229596734,
0.1953831017,
0.2569903731,
0.1191844866,
-0.328904599,
-0.3935403228,
-0.0334091336,
0.0985695571,
0.1863354594,
0.140939042,
0.1660903841,
-0.2663913667,
-0.1748817861,
-0.0119508747,
0.0266892631,
-0.0368767045,
-0.2150580585,
0.4406509697,
-0.0084779784,
0.4517734349,
-0.0168992896,
0.403078407,
0.2012057453,
0.0466530174,
0.4095165431,
-0.3087842166,
0.2212133706,
-0.0356289111,
-0.6038442254,
0.204298988,
-0.1897951066,
0.0618307814,
0.00960516,
0.1967375427,
0.2806485593,
-0.4943080246,
-0.2354854047,
-0.2183480263,
-0.2715519369,
-0.2354329675,
-0.0054229391,
0.1608942151,
0.0405543558,
-0.1433329135,
-0.0249082092,
-0.0667842105,
-0.0164610557,
0.5720891356,
-0.0693980679,
0.1114212647,
-0.6191424727,
0.0422339812,
-0.6355404854,
0.3562632501,
-0.144863084,
0.1651327461,
-0.2958748639,
0.0792202428,
0.0938228965,
-0.0150767528,
0.7718530297,
0.0018987914,
-0.0179305729,
-0.1105165258,
-0.1907027811,
-0.2759568095,
0.1091516465,
-0.0089848088,
0.4083504975,
0.4919061959,
0.247371152,
-0.347073704,
-0.1145486459,
0.0872871429,
-0.0210560355,
-0.2440115511,
-0.2094925791,
-0.3656121492,
-0.2786715925,
-0.1774246544,
0.0564008765,
-0.0437282249,
0.381551832,
0.0810396895,
-0.2656275034,
0.0091094617,
-0.0542901829,
0.2826077342,
0.0385259576,
0.1447789073,
0.0094429944,
0.1691835225,
0.3119987547,
0.4208044708,
0.1319472641,
0.4850693941,
-0.2108378559,
-0.2717653811,
-0.0984514579,
0.1013872623,
0.1231099069,
0.2183834463,
-0.1941260546,
0.2023683637,
0.2547455728,
0.4601500034,
-0.1706766188,
0.2522601485,
0.2773419321,
0.2792245746,
-0.3641135097,
-0.4865391552,
0.1555070281,
-0.0917388871,
0.0943060517,
0.2631675601,
0.2964455187,
-0.0355947241,
-0.1662319005,
-0.2842917144,
1.0478129387,
-0.0956731364,
0.0067075179,
0.1944359988,
0.1370845586,
0.450758785,
-0.0921951756,
0.1417494714,
-0.2144231349,
-0.2949659526,
-0.0541798435,
-0.1743753999,
0.1680574715,
-0.2362245172,
-0.0537432022,
0.3484443128,
-0.0203505885,
0.0292559061,
-0.1320036203,
0.2688500583,
-0.2967132926,
0.0120329782,
-0.3091321588,
0.2553618252,
-0.1343014389,
0.4604223073,
-0.0302182324,
-0.1518832296,
-0.1035432294,
-0.3361427784,
-0.063612707,
0.1191885918,
-0.2714743316,
0.109589316,
0.1017433554,
-0.2224694341,
0.0017540825,
0.1140814647,
0.0938337222,
0.0761764497,
-0.2716827691,
0.2065556943,
-0.5015836954,
-0.1528688669,
0.1270388216,
0.1177477911,
0.1461580992,
-0.200683102,
-0.4935423434,
0.1187354252,
0.124982819,
-0.1905113161,
-0.0510727912,
-0.1371849626,
0.0943688303,
-0.4705702066,
-0.1956136376,
-0.3145428002,
0.0358890407,
-0.1969574988,
0.2031294256,
0.1291758269,
-0.2606882155,
0.0935677066,
0.2006009519,
-0.1175682098,
-0.0630935431,
0.5965725183,
-0.0924626365,
0.005406219,
0.4578070045,
0.1677639037,
-0.1380166858,
-0.1807495505,
-0.0779087022,
0.2252723277,
-0.2601616681,
-0.0446518771,
0.0442488641,
0.1300584823,
-0.2083079666,
0.0384572819,
0.2260817438,
0.0097825741,
0.2754863203,
-0.5902450681,
-0.4207303226,
0.1600783616,
0.0696796849,
0.1743369102,
0.2952531874,
0.3555337191,
0.118881993,
0.0842631981,
-0.3726804256,
0.014194536,
-0.257959336,
-0.0338924937,
0.3824027181,
-0.3016344607,
0.3503543735,
-0.1016359776,
0.2228461802,
-0.0641882792,
-0.3282791078,
-0.2289401442,
-0.0984086096,
0.0898086131,
-0.0183259975,
-0.3839888573,
-0.0003592862,
-0.1192762926,
-0.0685904995,
0.0058194664,
0.1239215359,
0.1958065182,
0.0229749251,
-0.1963895261,
0.073845759,
-0.0365411937,
-0.0993711501,
0.1559782773,
0.1055222452,
0.2584664226,
0.0365739428,
-0.0811824426,
-0.1045224965,
-0.2432991862,
-0.2736444175,
-0.0624733642,
0.2513034344,
-0.1278460175,
0.2676115632,
-0.1688307077,
-0.0725647062,
0.1447961032,
0.5498504043,
0.3072590828,
-0.2752390206,
0.3285319209,
0.1525740772,
0.2810033262,
-0.2495318502,
-0.0088567445,
0.2969358265,
-0.0427343473,
-0.0819264352,
-0.162222594,
0.0722942054,
0.1996447295,
0.0240231417,
0.0446377881,
0.5042864084,
-0.0238162093,
0.1788910925,
-0.0350745171,
-0.0562042482,
0.0050123427,
0.1521485746,
0.2320994288,
-0.0585866496,
0.3224657476,
-0.3049380183,
0.3366058469,
-0.2997875214,
0.2508378625,
-0.1354236752,
-0.3039556146,
-0.1447140574,
0.1380615383,
-0.2659607232,
-0.1088378876,
-0.2559172511,
0.7806466818,
-0.3334016204,
-0.013906532,
-0.223239243,
0.3534823656,
-0.0758549422,
-0.3060182035,
-0.0491389073,
-0.2112848759,
-0.0329264402,
-0.1981337219,
0.1309958249,
-0.2458432466,
0.0111712757,
0.0343957618,
-0.0802693218,
-0.5813342333,
-0.1702586561,
0.1976888627,
0.1456969678,
-0.0387902856,
0.2339258343,
0.2654060125,
0.120195061,
0.0710984468,
0.3345951438,
0.460347265,
0.2285657376,
0.1212584153,
0.1023031324,
0.144017458,
-0.0438804552,
0.0165888034,
0.058318682,
0.1513797641,
0.0268123541,
0.2794591188,
0.2609656155,
-0.2058106065,
0.0252846722,
-0.0916613266,
0.3647481799,
-0.2482303679,
0.3037287295,
-0.1616887152,
0.0187717415,
-0.4195709825,
0.0384397916,
-0.7279619575,
0.3941760659,
0.1401261091,
-0.089067243,
0.1646357924,
-0.3102860451,
0.109173283,
-0.1697919667,
0.5486783385,
0.274063468,
0.2621697783,
-0.2371130586,
-0.1858243942,
-0.5177455544,
0.1752019823,
-0.0475243703,
-0.2880721688,
-0.0966670439,
0.046647124,
-0.1142756939,
0.0965363979,
0.1236988157,
0.0150240762,
0.1897217333,
-0.0559557006,
-0.1848660409,
0.0535529293,
-0.3134875894,
0.1869216114,
0.1249469966,
-0.133535549,
0.2388921827,
0.1444464773,
0.0627691969,
-0.0373317748,
0.2129232436,
-0.2674390674,
-0.2997756004,
0.2467645705,
0.1838714778,
0.5290331841,
-0.0266213678,
0.0692392141,
-0.1084939539,
-0.4502313435,
-0.2254646271,
0.0992142335,
0.1485065818,
0.1336235702,
-0.0102898274,
-0.2486867607,
-0.2791526914,
0.4303965867,
-0.0519701354,
-0.3362524807,
-0.0394177586,
-0.063052319,
0.1515260935,
-0.0076331599,
0.1565962285,
0.3153598309,
-0.0226593297,
0.086046949,
-0.0989818573,
-0.2700570822,
0.6556454301,
-0.2379181981,
-0.0130219404,
-0.251904726,
0.2108678669,
0.3994062841,
-0.121389769,
-0.4444726706,
0.253652066,
0.238093242,
0.0883378237,
-0.0961512774,
0.4788862467,
-0.0321512371,
0.187000975,
0.0243746527,
0.0740244612,
0.0143948598,
-0.1268231124,
0.1934874952,
-0.0743511692
] |
https://github.com/huggingface/datasets/issues/1796 | Filter on dataset too much slowww | When I use the filter on the arrow table directly, it works like butter. But I can't find a way to update the table in `Dataset` object.
```
ds_table = dataset.data.filter(mask=dataset['flag'])
``` | I have a dataset with 50M rows.
For pre-processing, I need to tokenize this and filter rows with the large sequence.
My tokenization took roughly 12mins. I used `map()` with batch size 1024 and multi-process with 96 processes.
When I applied the `filter()` function it is taking too much time. I need to filter sequences based on a boolean column.
Below are the variants I tried.
1. filter() with batch size 1024, single process (takes roughly 3 hr)
2. filter() with batch size 1024, 96 processes (takes 5-6 hrs Β―\\\_(γ)\_/Β―)
3. filter() with loading all data in memory, only a single boolean column (never ends).
Can someone please help?
Below is a sample code for small dataset.
```
from datasets import load_dataset
dataset = load_dataset('glue', 'mrpc', split='train')
dataset = dataset.map(lambda x: {'flag': random.randint(0,1)==1})
def _amplify(data):
return data
dataset = dataset.filter(_amplify, batch_size=1024, keep_in_memory=False, input_columns=['flag'])
```
| 32 | Filter on dataset too much slowww
I have a dataset with 50M rows.
For pre-processing, I need to tokenize this and filter rows with the large sequence.
My tokenization took roughly 12mins. I used `map()` with batch size 1024 and multi-process with 96 processes.
When I applied the `filter()` function it is taking too much time. I need to filter sequences based on a boolean column.
Below are the variants I tried.
1. filter() with batch size 1024, single process (takes roughly 3 hr)
2. filter() with batch size 1024, 96 processes (takes 5-6 hrs Β―\\\_(γ)\_/Β―)
3. filter() with loading all data in memory, only a single boolean column (never ends).
Can someone please help?
Below is a sample code for small dataset.
```
from datasets import load_dataset
dataset = load_dataset('glue', 'mrpc', split='train')
dataset = dataset.map(lambda x: {'flag': random.randint(0,1)==1})
def _amplify(data):
return data
dataset = dataset.filter(_amplify, batch_size=1024, keep_in_memory=False, input_columns=['flag'])
```
When I use the filter on the arrow table directly, it works like butter. But I can't find a way to update the table in `Dataset` object.
```
ds_table = dataset.data.filter(mask=dataset['flag'])
``` | [
-0.2712090909,
-0.0597310849,
-0.1147630438,
-0.2779482007,
-0.1706506312,
-0.2504285872,
0.1707621664,
0.2090245038,
0.2598770559,
-0.1163968518,
-0.0861834064,
0.2958265245,
-0.0557145849,
0.4060814381,
-0.1804259419,
0.2453582436,
0.1307905763,
0.297056824,
0.196013242,
0.0333571546,
-0.022402823,
-0.1882677078,
-0.292941153,
-0.070388034,
-0.009625636,
-0.2621650696,
0.185986951,
-0.3086514175,
-0.2785187364,
-0.2126027495,
-0.0173909273,
0.5965908766,
-0.0182769578,
0.503816247,
-0.0001307184,
-0.2338380367,
0.2439538389,
0.0724603236,
0.0831186324,
0.1498078853,
-0.2113011181,
-0.1286037862,
-0.0140377972,
-0.0004980626,
-0.1250068843,
0.0027302138,
-0.3318001032,
-0.2216517329,
0.3499700725,
0.0944688022,
-0.0277750567,
-0.1412247121,
-0.2549344897,
0.3521132469,
0.2052823752,
0.3541745543,
0.1411340088,
-0.1513691396,
0.5533319712,
-0.3358142376,
0.0539455041,
0.6059806347,
-0.4179317653,
-0.131328851,
0.2100652903,
-0.2898602188,
0.0583833829,
-0.1515574604,
0.2810193002,
0.0848346055,
0.1335705221,
-0.1620165706,
-0.2986919284,
-0.2322743833,
-0.0849646106,
-0.4459284842,
-0.014386679,
-0.0934051648,
-0.2579457164,
0.0345795453,
-0.512816906,
-0.3484370112,
0.0861517042,
0.1266558468,
-0.3261456788,
0.3600155115,
-0.0063065267,
0.2096573412,
0.1311977059,
-0.2452673763,
0.0699503422,
-0.2122397423,
0.1913419962,
0.3051821589,
-0.6571980715,
-0.1016248986,
-0.0962862447,
0.1605431139,
-0.0209177155,
0.0603331476,
-0.1847843081,
0.5039319992,
0.2157584429,
-0.0072757616,
0.0003439454,
0.250377208,
0.1227046922,
0.4484065175,
0.2802663445,
-0.1453334391,
-0.2991341054,
0.18511343,
-0.0733834431,
0.0487983003,
0.0876705348,
-0.057178501,
-0.3887729049,
-0.1275839806,
-0.3137274981,
-0.0533895381,
-0.2973858118,
-0.0597960614,
0.6444664598,
0.5041764975,
-0.1133062765,
-0.0650426224,
-0.0732964277,
-0.2993190289,
-0.1293629259,
0.0170783252,
0.0323412828,
-0.1580842137,
-0.10481181,
0.2392276525,
0.0378135182,
-0.2345516384,
-0.1911474466,
-0.0324772634,
-0.1686947197,
0.1806275994,
0.0712085739,
-0.362106204,
0.2372620404,
0.4139117002,
-0.2685701549,
0.3007686138,
0.0842116922,
0.0556683615,
-0.1265520006,
0.1775271297,
-0.3156157136,
-0.3334102631,
0.221410796,
-0.0167183168,
-0.0847423226,
0.1368691474,
-0.1805810332,
0.4090794325,
0.2862334251,
-0.2051100582,
-0.1643704027,
-0.1768734604,
-0.595266521,
-0.1606845707,
0.2633840144,
0.2223777473,
-0.5520039201,
0.0523663051,
-0.3266302943,
0.2614661753,
0.4948301911,
0.3584707975,
-0.0671722665,
0.2171266228,
0.1002385989,
-0.0703614205,
0.298415482,
-0.0785396919,
-0.4758496583,
0.5441424251,
-0.0614158511,
0.0120770363,
0.1328436732,
0.1559420675,
0.5201342106,
-0.2442359626,
0.3975710571,
0.33754614,
-0.1997921467,
0.0735180378,
0.0002536828,
-0.0091579463,
0.2259212434,
0.1488592476,
-0.3431072831,
-0.0221702605,
-0.0321322568,
-0.42664814,
0.1524591595,
0.1380379945,
-0.0138798999,
0.2082134932,
0.2469472736,
0.1468659639,
0.0114975506,
-0.1173822209,
-0.0029033117,
-0.0856793672,
0.0895480067,
-0.2041619718,
-0.2678195238,
-0.2276495695,
-0.2681232393,
0.1229257807,
0.0763176382,
0.2027754933,
-0.1417340636,
-0.1732809395,
0.1918349415,
-0.2997711599,
-0.0245423559,
0.4423803389,
-0.1199386716,
-0.0766717643,
0.1876755655,
0.0041584168,
0.3773687184,
-0.1478651613,
0.1558627188,
-0.0638165101,
0.256628722,
0.0597916692,
-0.0512209795,
0.2228675038,
0.4853754342,
-0.2909351587,
-0.3249587119,
0.191172123,
0.090726316,
0.3223305941,
0.1594700664,
-0.0299947038,
0.2172131836,
-0.0669634268,
-0.1975264698,
0.5968000889,
-0.0842723548,
0.4515286982,
0.0961709246,
-0.0534647442,
0.3551804721,
0.2579825819,
-0.1379966289,
-0.2240041196,
0.248391971,
-0.0168590453,
0.1414316595,
0.1916797459,
-0.1041449383,
0.3914269209,
-0.0069529936,
-0.1684071869,
-0.057875257,
0.2389457971,
0.1703024656,
0.0307576042,
0.1890269518,
0.0051110252,
0.1146774143,
0.1844973415,
-0.1427404433,
-0.0982925668,
0.0815939978,
-0.0547584742,
0.2547178268,
0.1561015099,
0.307512939,
-0.2542978227,
0.3530649245,
-0.113733083,
-0.1732011139,
-0.1776497066,
0.2034718841,
0.3338278532,
-0.2167351842,
0.0699751973,
-0.3757008016,
-0.5355601311,
0.2271120995,
-0.1121493801,
0.2265580893,
0.0880119056,
0.2230784595,
0.0783293247,
0.1746551096,
0.2855865955,
0.1994996816,
0.1593721062,
0.1661269069,
-0.4469210804,
-0.1344803274,
-0.1596937925,
-0.0713533163,
-0.1074966341,
0.2684337497,
0.3947562277,
0.3735954762,
0.2810976505,
0.0489866436,
-0.1861353219,
-0.5580238104,
-0.2156650275,
-0.0151027627,
0.0744733661,
0.2174892724,
0.13041991,
-0.3905109167,
-0.0501934811,
0.0361121595,
-0.1326580495,
-0.1809355021,
0.0968123525,
-0.2643178701,
0.0712427124,
0.1325806379,
0.1171381772,
-0.2342651635,
-0.0533798151,
-0.1480298489,
-0.090170905,
0.2890064716,
-0.2378838658,
0.0384711549,
-0.3095991015,
-0.2900484502,
-0.0745965987,
0.0627020895,
-0.154251501,
0.2361344397,
0.2845225632,
-0.0103317127,
-0.1767282486,
-0.0545513965,
-0.2922155857,
0.5495021343,
-0.2610017657,
0.1806711853,
-0.4031960368,
-0.2862223983,
0.1927293986,
0.018468488,
0.3718924522,
-0.1154165342,
0.1365425736,
-0.0016427677,
-0.4650853872,
-0.1635535359,
-0.1761950999,
0.0963355079,
0.2124690264,
0.8827465773,
0.0940155834,
0.3070506155,
0.062835291,
-0.0016839239,
0.0701517612,
0.2428093553,
-0.1153802201,
-0.217984587,
-0.3367718458,
-0.2030337155,
0.1458653063,
0.0642520264,
0.0387095734,
0.1361506283,
-0.1435865164,
-0.0339634344,
-0.2271149904,
-0.0657967627,
-0.1354944855,
0.0942663774,
-0.2203655094,
0.2903559506,
0.3504482806,
-0.0555739515,
-0.5428820252,
-0.34754619,
-0.2544791102,
0.0263414606,
0.1311548352,
-0.1841545254,
-0.6282451153,
-0.318633467,
-0.343301177,
0.4391600788,
0.1865680963,
0.4412319362,
0.1740359515,
0.0723440051,
0.1996858418,
-0.0993005931,
0.7873362303,
-0.179536432,
-0.0000881086,
0.0532540679,
-0.5388455391,
-0.4195427597,
0.0940793753,
-0.0101871239,
0.2481466532,
0.2991226614,
0.3818724155,
-0.2770798206,
-0.358981967,
-0.0407963693,
0.1242228076,
-0.1010716781,
-0.1960700452,
-0.2369448096,
-0.2199011743,
-0.3587258458,
0.2803165615,
-0.0494062789,
0.2188859135,
0.3615351319,
-0.3112304509,
-0.0476939045,
-0.1954779625,
0.1896837056,
0.0493269525,
0.0551217906,
0.3121327162,
0.3041160703,
-0.0797563866,
0.195019573,
0.0565644875,
-0.1036897078,
-0.1127291545,
0.027073659,
-0.0091858041,
0.1956085861,
0.3815271854,
0.5263149142,
-0.124636963,
0.5532615185,
0.062992543,
0.4241695106,
0.0678064674,
0.213475123,
-0.1809375733,
0.174836129,
-0.5886359811,
-0.74352175,
0.1466278881,
0.4004864395,
-0.3319709897,
0.5015224814,
0.1510136127,
-0.0640745014,
0.4643266499,
0.0759483725,
0.8864938617,
-0.3235604763,
-0.1276144385,
-0.0528231561,
0.0650776327,
0.3599278629,
-0.1648577899,
0.11933247,
0.0267444663,
-0.3669936359,
0.0609793477,
-0.0934690014,
0.0710566863,
0.0802966803,
0.0669526607,
0.3530904055,
-0.1266107112,
0.0602887347,
0.060692329,
0.2552213669,
0.2188885361,
-0.3514134884,
-0.2449194342,
-0.0771521181,
0.1735340506,
-0.1433550864,
0.0447942764,
0.0445485339,
0.2399153113,
-0.301866442,
-0.2113611698,
-0.5126227736,
-0.4052534401,
-0.008172418,
-0.1805770993,
-0.1766787618,
0.1086181328,
-0.2058491111,
-0.2409988344,
0.4316933453,
0.1569408327,
0.2249772549,
0.2834921479,
0.3169197142,
-0.0349665321,
-0.3678517342,
0.2215467393,
-0.1324400306,
-0.1802749038,
0.0131074963,
-0.0311694071,
-0.5412837863,
0.0419515222,
0.1744588763,
0.4846718907,
0.0853864923,
-0.1789313704,
0.0405985713,
0.0019730211,
-0.2304075509,
-0.0539916456,
0.0655846447,
0.091843538,
0.6818692684,
0.0109309684,
-0.3466657102,
-0.0823411271,
0.2244319916,
0.2488315403,
-0.1049907282,
0.3481358886,
0.1715012044,
-0.3952925801,
-0.1170045435,
0.0336575359,
0.2506342828,
0.1648852974,
0.1414193213,
-0.1345140785,
-0.2305838168,
0.4424913526,
0.0179604441,
-0.1558718532,
0.0163454171,
-0.1148774028,
-0.6028128266,
-0.1591873765,
0.0887797698,
-0.0339456648,
-0.2836896479,
0.0792490691,
0.1788769215,
-0.2286403328,
0.4104106426,
-0.1429886073,
-0.1034457162,
0.0149187278,
0.1952462792,
-0.2978612781,
0.3553290367,
-0.1092387736,
-0.0254914407,
-0.058435522,
0.0818284974,
0.0158341955,
-0.1095687896,
0.15820086,
0.1992669553,
-0.1821384132,
-0.1482774466,
0.1193575487,
-0.3192933202,
-0.27852723,
-0.1667117774,
0.0863983035,
-0.0945424289,
0.0135388859,
-0.6226952672,
0.0796450898,
-0.3068787456,
-0.0308552496,
0.1479804814,
-0.0689832121,
-0.2993611395,
0.0393474586,
0.1808092892,
0.2547490001,
-0.0701488629,
0.0305703543,
-0.0425860584,
0.0087942686,
-0.137334913,
0.1609220654,
-0.0131395403,
-0.0361733623,
0.1334585547,
0.1339655071,
0.3425040543,
0.1542831063,
-0.2189279646,
0.4608941078,
-0.0892685801,
-0.3246287704,
-0.1629707962,
0.186881274,
0.1323440522,
0.1914498061,
0.1589535028,
-0.1432948411,
0.4014594555,
-0.1859276593,
0.1897579134,
0.2408554703,
0.0335239545,
-0.1840331107,
0.3610527515,
0.3969343603,
-0.1160280257,
0.4024516344,
0.3945574164,
-0.2262270302,
0.6142660975,
0.2224930972,
0.4195974469,
0.4634609818,
0.4451640546,
-0.3034522831,
-0.3380828202,
-0.2056552917,
0.6224387288,
-0.1491272897,
-0.2401639968,
0.106000036,
-0.2050469369,
0.402974546,
-0.4408560395,
0.1021222249,
0.3491744101,
0.2446171343,
-0.1234745681,
-0.4045473933,
0.0168195497,
0.1725479811,
-0.0365310609,
-0.0128715346,
-0.0016644215,
0.2551495731,
0.0111503862,
0.2619936168,
-0.3760178983,
-0.233049795,
-0.1158902645,
0.2028703541,
0.0230051279,
0.1552747041,
-0.2527199686,
0.3291517496,
0.3357109129,
-0.3138513267,
0.1728478819,
0.424010843,
-0.0268684998,
0.1570848674,
-0.3043258488,
-0.1973878294,
-0.015256214,
0.3792420924,
0.1525566131,
0.145167321,
-0.0693074837,
-0.1082882211,
-0.0344023369,
-0.02530233,
0.2767589688,
0.1954935938,
0.0847868547,
0.3311170042,
0.2029563487,
0.0142708858,
-0.038432464,
0.0576429591,
-0.1150838211,
0.2869706452,
0.2904756367,
-0.3353184462,
0.1686611325,
0.1297984719,
-0.0057099229,
-0.2572616935,
0.1182310209,
-0.0713956878,
0.3901487589,
-0.207811147,
-0.3351302147,
-0.441658318,
-0.3361503482,
-0.3414926231,
-0.0613204166,
0.1446583271,
0.0870983005,
0.2598429322,
0.041154705,
0.1491355449,
0.039258495,
-0.2425345629,
0.0631313324,
-0.1808053255,
0.3376827836,
-0.1651824117,
0.3906685412,
-0.0743540302,
-0.3516143858,
0.3682200909,
-0.2127819061,
-0.0578487031,
-0.0417918898,
0.0814253911,
0.2041246295,
0.1451190114,
0.0432647914,
-0.0145803327,
0.3600328267,
0.1521869302,
0.5289026499,
-0.0460164621,
0.0723427534,
-0.3264321983,
0.2590904236,
0.2396051884,
0.1181287318,
-0.0328035951,
0.0460819341,
0.1615455002,
0.0981586277,
-0.1329070032,
-0.1898024976,
-0.0765678063,
0.1568206847,
0.1963783354,
0.3022772968,
-0.3197207749,
0.1080465838,
0.0558899418,
0.0469929427,
-0.3058782518,
-0.0662633777,
0.5844329596,
-0.5551501513,
-0.2744621933,
-0.3311438859,
0.2266701609,
0.4001957476,
0.0762995183,
0.0532930382,
-0.1094824225,
0.1079560667,
-0.1184766814,
-0.3128961921,
0.3040600419,
0.0193842985,
0.0772825032,
-0.2103269249,
-0.1349585354,
0.0183362514,
-0.1712663025,
-0.4492629468,
-0.1877034903
] |
https://github.com/huggingface/datasets/issues/1796 | Filter on dataset too much slowww | Hi ! Currently the filter method reads the dataset batch by batch to write a new, filtered, arrow file on disk. Therefore all the reading + writing can take some time.
Using a mask directly on the arrow table doesn't do any read or write operation therefore it's way quicker.
Replacing the old table by the new one should do the job:
```python
dataset._data = dataset._data.filter(...)
```
Note: this is a **workaround** and in general users shouldn't have to do that. In particular if you did some `shuffle` or `select` before that then it would not work correctly since the indices mapping (index from `__getitem__` -> index in the table) would not be valid anymore. But if you haven't done any `shuffle`, `select`, `shard`, `train_test_split` etc. then it should work.
Ideally it would be awesome to update the filter function to allow masking this way !
If you would like to give it a shot I will be happy to help :) | I have a dataset with 50M rows.
For pre-processing, I need to tokenize this and filter rows with the large sequence.
My tokenization took roughly 12mins. I used `map()` with batch size 1024 and multi-process with 96 processes.
When I applied the `filter()` function it is taking too much time. I need to filter sequences based on a boolean column.
Below are the variants I tried.
1. filter() with batch size 1024, single process (takes roughly 3 hr)
2. filter() with batch size 1024, 96 processes (takes 5-6 hrs Β―\\\_(γ)\_/Β―)
3. filter() with loading all data in memory, only a single boolean column (never ends).
Can someone please help?
Below is a sample code for small dataset.
```
from datasets import load_dataset
dataset = load_dataset('glue', 'mrpc', split='train')
dataset = dataset.map(lambda x: {'flag': random.randint(0,1)==1})
def _amplify(data):
return data
dataset = dataset.filter(_amplify, batch_size=1024, keep_in_memory=False, input_columns=['flag'])
```
| 162 | Filter on dataset too much slowww
I have a dataset with 50M rows.
For pre-processing, I need to tokenize this and filter rows with the large sequence.
My tokenization took roughly 12mins. I used `map()` with batch size 1024 and multi-process with 96 processes.
When I applied the `filter()` function it is taking too much time. I need to filter sequences based on a boolean column.
Below are the variants I tried.
1. filter() with batch size 1024, single process (takes roughly 3 hr)
2. filter() with batch size 1024, 96 processes (takes 5-6 hrs Β―\\\_(γ)\_/Β―)
3. filter() with loading all data in memory, only a single boolean column (never ends).
Can someone please help?
Below is a sample code for small dataset.
```
from datasets import load_dataset
dataset = load_dataset('glue', 'mrpc', split='train')
dataset = dataset.map(lambda x: {'flag': random.randint(0,1)==1})
def _amplify(data):
return data
dataset = dataset.filter(_amplify, batch_size=1024, keep_in_memory=False, input_columns=['flag'])
```
Hi ! Currently the filter method reads the dataset batch by batch to write a new, filtered, arrow file on disk. Therefore all the reading + writing can take some time.
Using a mask directly on the arrow table doesn't do any read or write operation therefore it's way quicker.
Replacing the old table by the new one should do the job:
```python
dataset._data = dataset._data.filter(...)
```
Note: this is a **workaround** and in general users shouldn't have to do that. In particular if you did some `shuffle` or `select` before that then it would not work correctly since the indices mapping (index from `__getitem__` -> index in the table) would not be valid anymore. But if you haven't done any `shuffle`, `select`, `shard`, `train_test_split` etc. then it should work.
Ideally it would be awesome to update the filter function to allow masking this way !
If you would like to give it a shot I will be happy to help :) | [
-0.2580145895,
-0.1224424988,
-0.0864248201,
-0.2601466179,
-0.16526559,
-0.245699659,
0.2593750358,
0.2613681555,
0.3136885762,
-0.1532162279,
0.0066367043,
0.2217892259,
-0.1138354316,
0.3481481373,
-0.2551463246,
0.2076894641,
0.0726487339,
0.2243814766,
0.3868041635,
0.0485852771,
-0.0817236304,
-0.1438358128,
-0.2755507827,
-0.0574542359,
-0.0197121836,
-0.351165086,
0.2738277614,
-0.1885665804,
-0.2887652814,
-0.2391114831,
-0.0230927374,
0.4542040229,
-0.011225068,
0.4893323183,
-0.0001260598,
-0.3033393025,
0.2190797031,
0.0967457443,
0.096907489,
0.1311699301,
-0.1555372179,
-0.0342099406,
-0.0015716746,
-0.0732348338,
-0.1380981505,
-0.0277740527,
-0.2938838601,
-0.3395697176,
0.4358002841,
0.0762711242,
-0.0212181117,
-0.164091289,
-0.3436227441,
0.3906525671,
0.148646608,
0.3552732468,
0.1600952297,
-0.1355318874,
0.6643036604,
-0.3910477161,
-0.0594229884,
0.5160924792,
-0.5235147476,
-0.0935739651,
0.2468021065,
-0.2897866368,
0.1473239511,
-0.2044603974,
0.2251318693,
0.1434736848,
0.0414355695,
-0.1305048764,
-0.2387336791,
-0.3114273846,
-0.0841017365,
-0.4326245785,
0.058440391,
0.0501058958,
-0.3467148542,
0.0126456581,
-0.5090168118,
-0.243846342,
0.0958382338,
0.1211494505,
-0.3476195335,
0.3207412362,
0.0449046753,
0.1487961113,
0.2462177873,
-0.1956781745,
0.0892600417,
-0.2859344482,
0.2442050725,
0.3371780813,
-0.5745359659,
-0.1418315172,
-0.1381054819,
0.1576307565,
-0.0300544612,
0.0824055895,
-0.2531946898,
0.4543229938,
0.2301658094,
-0.0332318731,
-0.0178978369,
0.2066559941,
0.07948035,
0.507843256,
0.2514454722,
-0.195093438,
-0.1972018629,
0.2502978444,
-0.0304296836,
0.0641797706,
0.1051937565,
-0.0808327794,
-0.4626238644,
-0.1382439137,
-0.2418836951,
-0.0940401405,
-0.3737148941,
-0.0942640305,
0.6346342564,
0.4418670833,
-0.0783584043,
-0.134126693,
-0.0508995913,
-0.2795557082,
-0.1667901427,
0.083887279,
0.0413887389,
-0.1199254021,
-0.0650092363,
0.2181842923,
0.099667497,
-0.2918972969,
-0.2306300253,
0.0494006276,
-0.1871844083,
0.1988064796,
0.225919947,
-0.3643766642,
0.2283468693,
0.3430494368,
-0.3088803887,
0.3217534125,
0.1475789845,
0.0212172344,
-0.1408425122,
0.1872082651,
-0.34728387,
-0.3065004349,
0.2215019464,
0.0037913453,
-0.1534257084,
0.1652535647,
-0.1067527011,
0.3195848167,
0.2384778857,
-0.1845530272,
-0.2099702358,
-0.2296188921,
-0.538913548,
-0.1934917718,
0.232615903,
0.1322150826,
-0.5897628069,
0.0171472225,
-0.314319104,
0.2596709728,
0.5231365561,
0.4517054558,
-0.0743229315,
0.2232605815,
-0.0143171642,
0.0126740066,
0.2559302747,
-0.0851266459,
-0.4165560901,
0.6068707705,
-0.0548084639,
0.0906557366,
0.1787695587,
0.1575143337,
0.5775743127,
-0.2714685202,
0.4816092849,
0.3299987316,
-0.2129821479,
0.0879461095,
-0.0300118327,
-0.1323310137,
0.1419952512,
0.1850211322,
-0.350785017,
-0.1207070872,
-0.0437388904,
-0.4507982731,
0.2112185657,
0.0466444269,
0.0334005356,
0.1372989416,
0.2628428936,
0.0677379146,
0.0024271749,
-0.1319778264,
0.0437038355,
-0.0079641938,
0.0262261629,
-0.1991897672,
-0.2843852341,
-0.2172748446,
-0.2058336288,
-0.0102898041,
0.0502195694,
0.22812666,
-0.128611654,
-0.2074563801,
0.1340390146,
-0.2319645733,
-0.0181156397,
0.4373141229,
-0.1152952611,
-0.041279465,
0.141591236,
-0.0606078394,
0.3979136348,
-0.0976240784,
0.1006914452,
-0.031405665,
0.3001842499,
0.0400553606,
0.045470573,
0.1611025482,
0.4899815321,
-0.2906466126,
-0.2897324264,
0.1746488661,
0.1120863482,
0.3210211098,
0.158534646,
0.0342961662,
0.1842803061,
-0.0922884718,
-0.2971899211,
0.5812554359,
-0.1030586883,
0.4783247709,
0.1044819206,
-0.0394964218,
0.3194073141,
0.2093017399,
-0.1225638837,
-0.1995681822,
0.4308719337,
-0.0314355642,
0.1005752757,
0.2806020379,
-0.0277569145,
0.3283559382,
-0.0127496058,
-0.2614406049,
-0.0546490811,
0.245074138,
0.166177243,
0.0988612622,
0.1766042113,
0.0861361772,
0.0534120053,
0.2262301892,
-0.1610714942,
-0.1625952572,
0.0040003373,
-0.0623852238,
0.28744331,
0.1224416271,
0.2521750927,
-0.2539429963,
0.2011267096,
-0.1105846539,
-0.1166066304,
-0.2918697298,
0.1945299059,
0.3008256555,
-0.2301909029,
0.0814738125,
-0.3432753682,
-0.5400553346,
0.2144393325,
-0.0921166614,
0.2033648789,
0.0089940839,
0.1777586341,
0.0631354675,
0.1822883189,
0.1455849111,
0.0892182738,
0.227685973,
0.2094934732,
-0.5467383265,
-0.1483850777,
-0.212875396,
-0.0616177097,
-0.0649383515,
0.3395972848,
0.3524471819,
0.391884625,
0.3119644523,
-0.1020378619,
-0.1546337456,
-0.4452129602,
-0.158507809,
-0.0286895819,
0.1104626134,
0.1032713279,
0.1338424683,
-0.3872925639,
-0.154507488,
-0.0147918053,
-0.0254877117,
-0.1784636974,
0.1289549172,
-0.138927564,
0.1105797291,
0.0965416878,
0.1577351689,
-0.2108276039,
-0.0657867268,
-0.1922362298,
-0.0803295895,
0.3034644425,
-0.1891368479,
-0.0917608589,
-0.227867201,
-0.3064530194,
-0.0987775847,
0.0939663574,
-0.1424891353,
0.2768472433,
0.303876549,
-0.0370684937,
-0.093828164,
-0.1172879115,
-0.3516657054,
0.6226112247,
-0.2873893082,
0.1780136079,
-0.4116136432,
-0.225409314,
0.154264316,
0.0324838087,
0.269156605,
-0.0742151737,
0.1376710236,
0.0273184218,
-0.2938505113,
-0.1813466102,
-0.1916177273,
0.2125632316,
0.2483041734,
0.7651824951,
0.1278290749,
0.3413033783,
0.1974574327,
0.1569410712,
-0.0195173938,
0.2924417555,
-0.155592069,
-0.1801238209,
-0.345939368,
-0.1539194882,
0.1461711526,
0.0725649223,
0.0339546315,
0.1557674557,
-0.1621881127,
-0.0385266803,
-0.1408113986,
-0.0474459864,
-0.2200167328,
0.1565879434,
-0.2120191604,
0.2928076982,
0.2550819218,
-0.0010022478,
-0.5004400015,
-0.3563645482,
-0.234047398,
0.0245728083,
0.1940563619,
-0.1826560348,
-0.4920960665,
-0.142657876,
-0.4179573059,
0.3404889405,
0.1994543821,
0.2822417915,
0.0868158713,
0.036565654,
0.11486388,
0.0004406407,
0.8182600141,
-0.1471986771,
0.0154001405,
0.1322245747,
-0.4685990214,
-0.460278064,
0.1328985095,
-0.0798726752,
0.1653359532,
0.29584378,
0.3902946711,
-0.2847401202,
-0.3065439165,
-0.0625820756,
0.182698071,
-0.0667348206,
-0.287494421,
-0.1903694123,
-0.2101449966,
-0.3705477417,
0.2802366614,
-0.0175917652,
0.2808856964,
0.3762198091,
-0.3433225751,
0.0080509782,
-0.2611863315,
0.3136884868,
0.0138878841,
0.0069038961,
0.2061003596,
0.3031760454,
0.019346796,
0.1766959131,
0.0116154831,
-0.1248457432,
-0.0295881219,
0.0242841654,
0.0136289326,
0.080065988,
0.361687541,
0.5575125217,
-0.1202877834,
0.5586549044,
0.0533805899,
0.4472555816,
-0.00338007,
0.179639101,
-0.1985719949,
0.1545090824,
-0.6475360394,
-0.666144371,
0.0821382925,
0.3528614044,
-0.3209253848,
0.4958523214,
0.1206012964,
-0.0689840615,
0.4795326293,
0.0689442754,
0.9122271538,
-0.4223342836,
-0.1293204725,
-0.0037964736,
0.1887134016,
0.4288330078,
-0.0892131403,
0.1283967346,
0.0789817497,
-0.3048504889,
0.0442273542,
-0.1779504567,
0.0511390567,
0.0752142519,
0.0846467912,
0.3383796215,
-0.1061581746,
0.0073744273,
0.0275457595,
0.3325159252,
0.1898477525,
-0.3797967136,
-0.146201551,
-0.0556654334,
0.1084279567,
-0.1734427214,
0.0630045906,
0.0359469466,
0.1965930462,
-0.2196017355,
-0.1999836564,
-0.4815898836,
-0.3552475572,
0.0192444697,
-0.2322670519,
-0.1909115762,
0.1824411601,
-0.2131923139,
-0.2439893186,
0.4488254786,
0.091785945,
0.1708306521,
0.2580386996,
0.2994171977,
-0.0158790294,
-0.4601497948,
0.1972993016,
-0.1218348742,
-0.1465220302,
0.0549797565,
-0.0540580489,
-0.5098162889,
0.048308365,
0.2030019909,
0.4885255396,
0.0099239526,
-0.2172056437,
-0.0251096003,
-0.0074485624,
-0.1663379222,
-0.0355488472,
0.1535980403,
0.0961094499,
0.6945757866,
-0.0525582135,
-0.3168728352,
-0.0998816416,
0.1070698723,
0.1990887374,
-0.2146317512,
0.29944399,
0.1840759516,
-0.4404842556,
-0.1097447127,
0.072201632,
0.2474163771,
0.2998215258,
0.1541188955,
-0.0664503351,
-0.2158153951,
0.4328505993,
0.0284718648,
-0.0817724019,
0.0312950276,
-0.0928014442,
-0.5693458915,
-0.2018583268,
0.1144266054,
-0.0439683013,
-0.211752966,
0.0614688955,
0.1806744188,
-0.2705646753,
0.361346066,
-0.1649131328,
-0.0791561678,
-0.0128513779,
0.2124868482,
-0.2546989918,
0.2238378823,
-0.0781835616,
-0.0072291712,
-0.0163496397,
0.0788105056,
-0.0027594534,
-0.1311947405,
0.1103280559,
0.1862534881,
-0.1803197116,
-0.2964834869,
0.2364365011,
-0.3541326225,
-0.2470615804,
-0.215427354,
0.0686767399,
0.0040950468,
0.0105028143,
-0.6836891174,
0.0963218361,
-0.4543239772,
-0.1039834023,
0.1455974579,
-0.1669251919,
-0.2937223911,
0.0120155523,
0.2149537802,
0.186313495,
-0.0142358299,
0.0982929617,
-0.0320915319,
0.0350413807,
-0.0960117504,
0.2655914128,
0.0278561302,
-0.0443386808,
0.1940906644,
0.1606882364,
0.3102347255,
0.0813851655,
-0.1666776091,
0.4834389687,
-0.0591805428,
-0.2837423384,
-0.2047855258,
0.1989352107,
0.1791320741,
0.1836615354,
0.1498319358,
-0.2726894319,
0.3341100216,
-0.2075677067,
0.1090359315,
0.3740892708,
-0.0703384429,
-0.2158269882,
0.3936488926,
0.4317412078,
-0.2141317576,
0.4373219907,
0.344805181,
-0.1633818299,
0.6248002648,
0.1625694335,
0.323556304,
0.4254295826,
0.5249888897,
-0.3500038683,
-0.4269684851,
-0.0866611004,
0.6189132929,
-0.234491244,
-0.183445558,
0.0928304195,
-0.244238019,
0.2608452737,
-0.3488543928,
0.1344257742,
0.3292417228,
0.1828828454,
-0.025894152,
-0.3440882862,
-0.0044807424,
0.2810173631,
0.0080978414,
-0.0444008708,
-0.0167209096,
0.1577598304,
0.1425011009,
0.2987145483,
-0.2946137488,
-0.1925164163,
-0.1364804804,
0.2268218845,
-0.0764758959,
0.0530296899,
-0.2720612884,
0.2915358841,
0.289827913,
-0.3670109212,
0.2098893821,
0.4030945003,
-0.0381554179,
0.1471686512,
-0.3606919944,
-0.1813368648,
-0.0150077278,
0.4001681209,
0.1676850319,
0.1575704962,
-0.0220814627,
-0.0604054555,
-0.0522031821,
-0.1389403194,
0.2176387161,
0.0740094557,
0.1071447879,
0.3026018739,
0.2705260515,
0.0071113659,
-0.0615188591,
0.0523055233,
-0.1224307269,
0.3401495516,
0.2895958424,
-0.2651775181,
0.2117099315,
0.2369525433,
0.0192529298,
-0.2257690132,
0.0452475809,
-0.0455715358,
0.3995999992,
-0.2582890987,
-0.247811228,
-0.4215647876,
-0.4059768319,
-0.4042251408,
-0.0365701653,
0.1455504596,
0.0629473403,
0.2698784769,
0.0955259651,
0.043549329,
0.1298080385,
-0.2022350281,
0.0265408456,
-0.137274012,
0.3220694959,
0.0594359636,
0.3153894842,
-0.1090591252,
-0.3862200379,
0.472835362,
-0.2299932837,
-0.0308477804,
0.1162136942,
0.0425749943,
0.2271542847,
0.0803690031,
-0.055226393,
0.0678233057,
0.3736476004,
0.1915313303,
0.5193092227,
0.0005668646,
0.1978705972,
-0.2546801865,
0.2054693401,
0.2659473419,
0.1792628765,
-0.1063977405,
-0.0012778589,
0.0430169813,
0.2105870098,
-0.1673604995,
-0.19143641,
-0.1458098441,
0.1135414168,
0.1374346316,
0.3232656717,
-0.3512887657,
0.1273342222,
-0.0530493706,
0.0673585534,
-0.2710543275,
-0.0772756115,
0.5529333949,
-0.6079835296,
-0.279253751,
-0.2729257941,
0.243274793,
0.3418398201,
0.1827058196,
0.1242088899,
-0.0995531976,
0.1359941661,
-0.1705010533,
-0.3291719854,
0.2202585638,
-0.0508965328,
0.0331558995,
-0.2044653147,
-0.172746256,
0.0590474978,
-0.1852391511,
-0.3525725305,
-0.1822316945
] |
https://github.com/huggingface/datasets/issues/1796 | Filter on dataset too much slowww | Hi @lhoestq @ayubSubhaniya,
If there's no progress on this one, can I try working on it?
Thanks,
Gunjan | I have a dataset with 50M rows.
For pre-processing, I need to tokenize this and filter rows with the large sequence.
My tokenization took roughly 12mins. I used `map()` with batch size 1024 and multi-process with 96 processes.
When I applied the `filter()` function it is taking too much time. I need to filter sequences based on a boolean column.
Below are the variants I tried.
1. filter() with batch size 1024, single process (takes roughly 3 hr)
2. filter() with batch size 1024, 96 processes (takes 5-6 hrs Β―\\\_(γ)\_/Β―)
3. filter() with loading all data in memory, only a single boolean column (never ends).
Can someone please help?
Below is a sample code for small dataset.
```
from datasets import load_dataset
dataset = load_dataset('glue', 'mrpc', split='train')
dataset = dataset.map(lambda x: {'flag': random.randint(0,1)==1})
def _amplify(data):
return data
dataset = dataset.filter(_amplify, batch_size=1024, keep_in_memory=False, input_columns=['flag'])
```
| 18 | Filter on dataset too much slowww
I have a dataset with 50M rows.
For pre-processing, I need to tokenize this and filter rows with the large sequence.
My tokenization took roughly 12mins. I used `map()` with batch size 1024 and multi-process with 96 processes.
When I applied the `filter()` function it is taking too much time. I need to filter sequences based on a boolean column.
Below are the variants I tried.
1. filter() with batch size 1024, single process (takes roughly 3 hr)
2. filter() with batch size 1024, 96 processes (takes 5-6 hrs Β―\\\_(γ)\_/Β―)
3. filter() with loading all data in memory, only a single boolean column (never ends).
Can someone please help?
Below is a sample code for small dataset.
```
from datasets import load_dataset
dataset = load_dataset('glue', 'mrpc', split='train')
dataset = dataset.map(lambda x: {'flag': random.randint(0,1)==1})
def _amplify(data):
return data
dataset = dataset.filter(_amplify, batch_size=1024, keep_in_memory=False, input_columns=['flag'])
```
Hi @lhoestq @ayubSubhaniya,
If there's no progress on this one, can I try working on it?
Thanks,
Gunjan | [
-0.2252545655,
-0.2595493495,
-0.1091807112,
-0.2148157656,
-0.1230366528,
-0.269241482,
0.2215607762,
0.2114839256,
0.2634299099,
-0.1233140007,
0.0279619396,
0.0908805579,
-0.116068095,
0.4082368016,
-0.2278895378,
0.1516524553,
0.1011282802,
0.2131099403,
0.4031715393,
0.0390014984,
-0.0577567182,
-0.0807917193,
-0.3609128892,
-0.0298265275,
-0.08470653,
-0.2762128711,
0.2782405317,
-0.247679472,
-0.2799650431,
-0.1902087331,
-0.1176555157,
0.432862699,
0.0416846946,
0.5227162242,
-0.000128576,
-0.3842287064,
0.2686328292,
0.101689361,
0.225177139,
0.1034965962,
-0.1696643382,
-0.008082604,
-0.0367201567,
-0.0586647578,
-0.2172695845,
0.066933915,
-0.2896470726,
-0.2367755175,
0.4300411642,
0.1496512741,
-0.0269950628,
-0.2186437845,
-0.3358837366,
0.3563359082,
0.1525760442,
0.3359156251,
0.1869011819,
-0.2261261642,
0.7080860734,
-0.3562735021,
0.0696435496,
0.4721480906,
-0.4560541213,
-0.1615432501,
0.1487725824,
-0.3453471363,
0.1096851155,
-0.3132959008,
0.2409455776,
0.1769207567,
0.0656612217,
-0.0571095347,
-0.2008105516,
-0.2538344264,
-0.0454386659,
-0.410320729,
0.0202634353,
0.0456012301,
-0.3242428005,
-0.0042453213,
-0.5788227916,
-0.218912676,
0.0876277015,
0.1583897173,
-0.3853454888,
0.3735462427,
0.0321886428,
0.1135236248,
0.1993606687,
-0.2155294865,
0.0075016082,
-0.2545442283,
0.2832425535,
0.3554541767,
-0.6740974784,
-0.1508337259,
-0.158191219,
0.2203151137,
0.0110634528,
0.0257151555,
-0.3736513257,
0.4627344608,
0.2508269548,
-0.0402112566,
-0.0583135672,
0.2461995184,
0.0641974211,
0.4818008542,
0.2978993356,
-0.2198607326,
-0.2987450957,
0.2547265291,
-0.0507869795,
0.0679052547,
0.0823749825,
-0.0540156327,
-0.5015364289,
-0.1702795476,
-0.2727938592,
-0.1028561443,
-0.4168029428,
-0.1203472242,
0.6683409214,
0.4683459699,
-0.1007532924,
-0.1219638959,
-0.1264317334,
-0.2415730655,
-0.1646135151,
0.0298383273,
0.0279094167,
-0.0445403978,
-0.0681125894,
0.1991350353,
0.0899439454,
-0.2929747999,
-0.1792654246,
0.047301475,
-0.1829544157,
0.1261354834,
0.2369166613,
-0.3831788898,
0.132381469,
0.29230389,
-0.285466671,
0.3071511388,
0.082302697,
0.1024767607,
-0.1182382777,
0.118631646,
-0.3777611852,
-0.336771518,
0.2411239594,
0.0114387292,
-0.112051636,
0.1816658825,
-0.0739682987,
0.3442538083,
0.3069842756,
-0.0880860835,
-0.221400097,
-0.1915691495,
-0.5816184878,
-0.158752203,
0.2008321881,
0.0921892226,
-0.4657711983,
0.0186847989,
-0.2798203826,
0.2105334103,
0.5880838037,
0.4387435317,
-0.0369402058,
0.224987641,
-0.0430895761,
0.0483518131,
0.2181495577,
-0.1122599021,
-0.3453875482,
0.6233466864,
-0.0395006947,
0.0077324179,
0.1885050982,
0.0785483047,
0.5663006902,
-0.2632849514,
0.5140786767,
0.3756265938,
-0.2153287977,
0.1178365499,
-0.0218423475,
-0.1036480889,
0.1589713395,
0.2371780425,
-0.281635046,
-0.0733491778,
-0.0703741089,
-0.3758480251,
0.1747685373,
0.0260584354,
0.0309028383,
0.170975998,
0.2361923009,
0.0627348348,
0.0111597646,
-0.1820667386,
0.1184111312,
-0.0608217381,
-0.0504306704,
-0.1652128696,
-0.1754472554,
-0.1815260798,
-0.2594468892,
-0.0090873484,
0.0641421527,
0.233210206,
-0.1163489893,
-0.1710829586,
0.1199573353,
-0.2128813267,
0.0389987379,
0.4870578349,
-0.0661608726,
-0.0465144292,
0.1828292906,
-0.0481047221,
0.328016609,
-0.1143482998,
0.1694706082,
0.0258434191,
0.3714915812,
0.0142313484,
0.0571063869,
0.1386634707,
0.5027496219,
-0.2991533875,
-0.3137467802,
0.176704213,
0.154236272,
0.3389374018,
0.1094480976,
0.0164358485,
0.1302592009,
-0.1143235117,
-0.1493639648,
0.5312942863,
-0.0404825509,
0.4238989949,
0.0877423435,
-0.0993586406,
0.3138716221,
0.1738132536,
-0.0924372897,
-0.2166418284,
0.5034922361,
0.013821491,
0.1286027431,
0.2449537516,
-0.1035162657,
0.3022044003,
-0.0475001149,
-0.3135297894,
-0.0592061542,
0.2680287659,
0.1906662136,
0.0849727616,
0.1419329345,
-0.0174569301,
0.0390061513,
0.1978615969,
-0.1883349568,
-0.1547813714,
0.0823923796,
-0.0621348694,
0.258713752,
0.1034960225,
0.235314101,
-0.2182342261,
0.2533363402,
-0.1286803484,
-0.0980201736,
-0.2866783142,
0.2284124643,
0.3222564459,
-0.2280867249,
0.0149425194,
-0.3553004861,
-0.5684861541,
0.234461531,
-0.1010883301,
0.2024694383,
0.0458729453,
0.1592309624,
0.0498126261,
0.2844614089,
0.1175139025,
0.1196428165,
0.2055428624,
0.2214316875,
-0.4647489488,
-0.1081777737,
-0.1323723048,
-0.0417072661,
-0.0571201742,
0.2584054172,
0.3142127991,
0.3845158815,
0.306491226,
-0.0974844247,
-0.113129437,
-0.5374432206,
-0.14814879,
0.010501151,
0.1324184388,
0.1226701662,
0.1452452242,
-0.314394474,
-0.1035706401,
-0.0251874384,
0.0196895283,
-0.1629321724,
0.0662417039,
-0.1998528093,
0.0767847672,
0.109900035,
0.1567246467,
-0.2886811495,
-0.0323663205,
-0.2201775908,
-0.0711627007,
0.2759139538,
-0.3124833703,
-0.117224656,
-0.2404731661,
-0.2843366563,
-0.0630579367,
0.0203150697,
-0.1998872608,
0.2910324037,
0.2740528882,
-0.0175064243,
-0.1282384545,
-0.0829761699,
-0.3217392266,
0.5405507684,
-0.2413505167,
0.1424675733,
-0.4174324274,
-0.233966887,
0.1934642494,
-0.0433745459,
0.2607780695,
-0.1583854258,
0.1518048495,
0.0461019427,
-0.317204982,
-0.1860857755,
-0.187258631,
0.2764712274,
0.2739782631,
0.7350676656,
0.0479090139,
0.3134375811,
0.1614058018,
0.0978114083,
0.023463482,
0.2742675543,
-0.2951159477,
-0.1754238904,
-0.3233993053,
-0.0374852717,
0.2471009642,
0.0507656112,
0.0771015808,
0.1735539734,
-0.1551259756,
-0.0521913543,
-0.2132918537,
-0.0872249082,
-0.142120257,
0.1017118767,
-0.1648365408,
0.3068121374,
0.2345012426,
-0.0391526818,
-0.4587773681,
-0.3636747003,
-0.3014777601,
0.0613550059,
0.1693893373,
-0.182785973,
-0.506577611,
-0.2059260309,
-0.3918889165,
0.3594692051,
0.2159309387,
0.2798335254,
0.0462320298,
0.1300625652,
0.1529965401,
-0.000764163,
0.8587452769,
-0.1964033097,
0.0236837678,
0.0773431063,
-0.5784469247,
-0.2750439942,
0.1098081023,
-0.0400724597,
0.0650055408,
0.419752419,
0.3936816752,
-0.3051290214,
-0.3487202525,
-0.0523088463,
0.1268807501,
0.007771424,
-0.3749648035,
-0.1559258699,
-0.1641942561,
-0.3765982091,
0.3039282262,
-0.0235088672,
0.3030174673,
0.3059746027,
-0.4037964344,
0.0278200917,
-0.2339781821,
0.3217282891,
-0.0272872988,
-0.0450220071,
0.143934086,
0.2509565055,
-0.055760812,
0.1492970288,
-0.001695419,
-0.2590818107,
-0.0302044973,
0.0440484472,
0.0972665474,
0.0444828793,
0.3970540762,
0.4827744663,
-0.1612477154,
0.5882354379,
0.0505077429,
0.4886028767,
0.0116297631,
0.2173452079,
-0.0917054415,
0.2079639435,
-0.6904318333,
-0.6199192405,
0.0585212037,
0.3905727565,
-0.3461595178,
0.3499725163,
0.0200452171,
-0.0846654698,
0.4471518695,
0.0663008988,
0.9581961036,
-0.4153416753,
-0.2108307183,
-0.0812214836,
0.2532028556,
0.4408661723,
-0.1588866413,
0.1169547662,
0.0642560795,
-0.3563608229,
0.0335154571,
-0.1627473235,
0.0319046825,
0.1154623702,
0.0592165925,
0.358559221,
-0.0994345769,
0.0464690104,
0.0220799819,
0.3321061134,
0.303319782,
-0.3577499986,
-0.198660478,
-0.0548403524,
0.1066497415,
-0.0445860401,
0.01512527,
0.0325655863,
0.2558645606,
-0.208243221,
-0.1969841421,
-0.4552558959,
-0.3432826996,
-0.0408171266,
-0.1839425862,
-0.1707672626,
0.2155317664,
-0.145385474,
-0.1489433646,
0.4777181745,
0.0395528451,
0.2064715028,
0.2317768484,
0.2153297514,
-0.0568483323,
-0.4187889993,
0.1855116487,
-0.1786764115,
-0.195890367,
0.0447833762,
-0.0129554449,
-0.4329486787,
-0.0632165223,
0.140157789,
0.48463884,
-0.002097501,
-0.2411371171,
0.0008224435,
-0.0012014483,
-0.1708168685,
-0.0320652463,
0.1475130469,
0.0614320785,
0.7015864849,
-0.0356988981,
-0.2789461613,
-0.1368633956,
0.122128062,
0.2942488194,
-0.2797679901,
0.3097615838,
0.2331237942,
-0.4130249321,
-0.1083010957,
0.0172182936,
0.1657751054,
0.346547693,
0.0790227428,
0.0083406558,
-0.2764845788,
0.4665232301,
0.0402587391,
-0.1502177715,
-0.0065304963,
0.0210222751,
-0.6080695391,
-0.2222399563,
0.0133886784,
-0.1192980334,
-0.23514539,
0.0938158035,
0.2466766387,
-0.2269976884,
0.4047361612,
-0.1552990824,
-0.1191566139,
-0.0896129757,
0.2054951042,
-0.175151974,
0.173269406,
-0.1048567593,
0.0844783857,
-0.0092603611,
0.0975959599,
0.0234884806,
-0.1187349185,
0.1299325824,
0.1904267073,
-0.1591578126,
-0.2345914543,
0.2908118367,
-0.2887119055,
-0.2566344738,
-0.159792915,
0.0984030217,
-0.01792893,
0.0577173457,
-0.6547788382,
0.0694826394,
-0.486140579,
-0.1320484877,
0.113509506,
-0.1249686852,
-0.3016547263,
0.065113835,
0.1955118626,
0.1558883339,
-0.0396990888,
0.0083106253,
-0.0594496392,
0.1363201886,
-0.0981676728,
0.2446375042,
0.0385852605,
-0.0546673387,
0.2382380664,
0.1201960966,
0.1842216253,
0.0489123501,
-0.1412813812,
0.4671066701,
-0.0722420663,
-0.2741682827,
-0.1641024649,
0.1977158338,
0.1868244261,
0.1511613131,
0.1790212244,
-0.2410616726,
0.3629324436,
-0.1833378971,
0.099806875,
0.4350858629,
-0.0554786623,
-0.2217372507,
0.31301108,
0.4332219958,
-0.2051404715,
0.446144551,
0.3638695776,
-0.2131381482,
0.5768559575,
0.1865544468,
0.3318866491,
0.3495146334,
0.5341727734,
-0.2553032637,
-0.3887854815,
-0.11096365,
0.7703390121,
-0.2449409217,
-0.2136728466,
0.0333936401,
-0.2079732418,
0.334908694,
-0.3433467746,
0.1132224873,
0.4351329207,
0.1481794715,
-0.0408241414,
-0.3570049703,
0.0204018131,
0.2482734025,
-0.0369984508,
0.003689101,
0.018553786,
0.1613124758,
0.1794336736,
0.277525425,
-0.2858621478,
-0.2290665507,
-0.1520702541,
0.1804331541,
-0.059107624,
0.1522856951,
-0.2897802889,
0.2591447234,
0.3215398788,
-0.3563665748,
0.2093614936,
0.4154401124,
-0.0153535418,
0.1073977351,
-0.3542913496,
-0.1556840092,
0.0286299996,
0.4394167662,
0.2068326175,
0.2189009786,
-0.0373838022,
-0.0680970922,
-0.0727639943,
-0.0777660459,
0.232556656,
0.0656388327,
0.157876417,
0.2685891986,
0.2677961886,
0.0526472032,
-0.132434696,
0.0658370331,
-0.1772331744,
0.3990632296,
0.1876475066,
-0.2525113225,
0.2420500964,
0.2378871441,
0.008193695,
-0.2458669841,
0.0123946192,
-0.0878853127,
0.4355202615,
-0.2969925106,
-0.3003427386,
-0.3489141464,
-0.3365275562,
-0.3431505561,
-0.0251457132,
0.0969922692,
0.001071378,
0.2146295011,
0.0203987323,
0.0080329943,
0.1167680696,
-0.2403492182,
0.0444589369,
-0.1369325668,
0.374976486,
-0.0254137423,
0.3593271971,
-0.0807766244,
-0.3088652194,
0.4820464253,
-0.2655581236,
-0.042215094,
0.0557010286,
0.0875639915,
0.1483188272,
0.0405415185,
-0.1082426235,
0.036923591,
0.4210780859,
0.1204251572,
0.5725921392,
0.0505463295,
0.1496590227,
-0.2269870043,
0.1850088835,
0.3237878978,
0.1223640814,
-0.0324245244,
0.0748084858,
0.0803687945,
0.2249293923,
-0.1496293992,
-0.277356863,
-0.0969025344,
0.077147834,
0.1535182744,
0.293628037,
-0.2447821498,
0.1370540559,
-0.0368245468,
0.0204690117,
-0.2410460263,
-0.1227078736,
0.5522249341,
-0.5193557739,
-0.2587078214,
-0.360883832,
0.255736053,
0.2829856277,
0.2068323195,
0.1441439688,
-0.0422925465,
0.1479316801,
-0.1221393421,
-0.2939153016,
0.3119494319,
0.0089957193,
0.0091704065,
-0.2084154934,
-0.2674075663,
0.095736675,
-0.1376583129,
-0.3251848221,
-0.1448201984
] |
https://github.com/huggingface/datasets/issues/1796 | Filter on dataset too much slowww | Sure @gchhablani feel free to start working on it, this would be very appreciated :)
This feature is would be really awesome, especially since arrow allows to mask really quickly and without having to rewrite the dataset on disk | I have a dataset with 50M rows.
For pre-processing, I need to tokenize this and filter rows with the large sequence.
My tokenization took roughly 12mins. I used `map()` with batch size 1024 and multi-process with 96 processes.
When I applied the `filter()` function it is taking too much time. I need to filter sequences based on a boolean column.
Below are the variants I tried.
1. filter() with batch size 1024, single process (takes roughly 3 hr)
2. filter() with batch size 1024, 96 processes (takes 5-6 hrs Β―\\\_(γ)\_/Β―)
3. filter() with loading all data in memory, only a single boolean column (never ends).
Can someone please help?
Below is a sample code for small dataset.
```
from datasets import load_dataset
dataset = load_dataset('glue', 'mrpc', split='train')
dataset = dataset.map(lambda x: {'flag': random.randint(0,1)==1})
def _amplify(data):
return data
dataset = dataset.filter(_amplify, batch_size=1024, keep_in_memory=False, input_columns=['flag'])
```
| 39 | Filter on dataset too much slowww
I have a dataset with 50M rows.
For pre-processing, I need to tokenize this and filter rows with the large sequence.
My tokenization took roughly 12mins. I used `map()` with batch size 1024 and multi-process with 96 processes.
When I applied the `filter()` function it is taking too much time. I need to filter sequences based on a boolean column.
Below are the variants I tried.
1. filter() with batch size 1024, single process (takes roughly 3 hr)
2. filter() with batch size 1024, 96 processes (takes 5-6 hrs Β―\\\_(γ)\_/Β―)
3. filter() with loading all data in memory, only a single boolean column (never ends).
Can someone please help?
Below is a sample code for small dataset.
```
from datasets import load_dataset
dataset = load_dataset('glue', 'mrpc', split='train')
dataset = dataset.map(lambda x: {'flag': random.randint(0,1)==1})
def _amplify(data):
return data
dataset = dataset.filter(_amplify, batch_size=1024, keep_in_memory=False, input_columns=['flag'])
```
Sure @gchhablani feel free to start working on it, this would be very appreciated :)
This feature is would be really awesome, especially since arrow allows to mask really quickly and without having to rewrite the dataset on disk | [
-0.2547402978,
-0.2351186275,
-0.101451993,
-0.2257346809,
-0.142864421,
-0.287168771,
0.2794651389,
0.2359779328,
0.3127667904,
-0.1190766096,
0.0621095262,
0.1304161251,
-0.1263470352,
0.4224113226,
-0.2473777086,
0.1691475809,
0.0948601365,
0.2099194527,
0.3651646674,
0.0446348861,
-0.0494469851,
-0.1138268858,
-0.3327174485,
-0.0442434326,
-0.0404983982,
-0.2961439788,
0.2930484116,
-0.2661837637,
-0.2599882782,
-0.1789188385,
-0.089338325,
0.4252873063,
0.043773815,
0.4724213481,
-0.0001284532,
-0.3640067875,
0.2625662088,
0.1131878495,
0.1909707934,
0.1135955676,
-0.1848616302,
-0.0163563751,
-0.0218525138,
-0.0593498535,
-0.2138733119,
0.0530101769,
-0.2731752396,
-0.3023945689,
0.4287187159,
0.100616388,
-0.028960634,
-0.1832486242,
-0.3738383651,
0.3723736703,
0.1458552629,
0.3561846316,
0.143724069,
-0.2502306402,
0.6577316523,
-0.3737891018,
0.0461211428,
0.5352953076,
-0.470541507,
-0.1681780368,
0.1968520582,
-0.3184740245,
0.1125075817,
-0.2822365463,
0.2291530222,
0.1690669656,
0.0149928164,
-0.0777097419,
-0.214353174,
-0.2915638983,
-0.0615596399,
-0.4139200449,
0.0252863076,
0.0286113508,
-0.3154195845,
0.0164227076,
-0.5580665469,
-0.2037366331,
0.0965509266,
0.1403740495,
-0.3547915518,
0.3611058295,
0.0346125178,
0.131369859,
0.2142252177,
-0.2130945921,
0.022694502,
-0.2870531082,
0.2648452818,
0.3623133302,
-0.6492139101,
-0.1423451602,
-0.1743777394,
0.1750464141,
0.0069198459,
0.0786335543,
-0.3529718816,
0.4686012268,
0.2220182866,
-0.0259514228,
-0.0626641065,
0.2397357076,
0.074098058,
0.4572775066,
0.2873616517,
-0.2147796601,
-0.2366796136,
0.2544236183,
-0.0684946477,
0.0798997283,
0.0800585523,
-0.0319134817,
-0.4939533472,
-0.1388381869,
-0.2648063302,
-0.1102306768,
-0.395186305,
-0.1192373633,
0.6373212337,
0.425801158,
-0.0795861036,
-0.1344536096,
-0.1196870655,
-0.2380563468,
-0.1651939899,
0.0285186451,
0.0324384905,
-0.0963222608,
-0.069513768,
0.1784166247,
0.0781029984,
-0.2720378041,
-0.1977616847,
0.0326229036,
-0.1777713001,
0.1730164587,
0.2551946938,
-0.3473982811,
0.1557761282,
0.3013787568,
-0.3203008175,
0.3183274269,
0.1355060935,
0.090402998,
-0.1295001358,
0.1477259845,
-0.3459281027,
-0.3141600192,
0.2130756527,
-0.0019208458,
-0.1204017028,
0.1689202487,
-0.1210172325,
0.3417937458,
0.2751412392,
-0.1006940231,
-0.2016451359,
-0.1915017217,
-0.5472354889,
-0.1620807499,
0.2093984932,
0.1171443239,
-0.4860532582,
-0.011903435,
-0.2796177566,
0.2233318985,
0.6011427641,
0.4344094396,
-0.0460532084,
0.1472397447,
-0.0299069788,
0.0564315803,
0.2358343601,
-0.1227663681,
-0.3312917352,
0.6238359213,
-0.0638757944,
0.0400919504,
0.2126487494,
0.1053388789,
0.5331237316,
-0.2556836903,
0.4627816379,
0.394464761,
-0.1878146082,
0.109103851,
0.0033413623,
-0.1312588453,
0.1949512511,
0.2179061323,
-0.3320952952,
-0.075794071,
-0.0696715936,
-0.4481106997,
0.1965842843,
0.0232224856,
0.0347893834,
0.1189479157,
0.2403095663,
0.0163258463,
0.0206496604,
-0.1357768476,
0.088433139,
-0.0511190817,
-0.0140725235,
-0.1671029776,
-0.2494914085,
-0.1959039569,
-0.2026104778,
-0.0224118531,
0.0633284301,
0.2025331855,
-0.1286607981,
-0.1770586073,
0.0898273438,
-0.2292309999,
0.0088757919,
0.4807581604,
-0.0409271047,
-0.0277848821,
0.1705214828,
-0.074628599,
0.3705915213,
-0.0782504976,
0.145150423,
0.0169991199,
0.3502374291,
0.0186620653,
0.0410103835,
0.1407469958,
0.4962438941,
-0.2891914845,
-0.2919786572,
0.1777760386,
0.1451970637,
0.3355658054,
0.1232618019,
0.0453377813,
0.1189536527,
-0.1018490195,
-0.2242900431,
0.5475724339,
-0.049496457,
0.4638310373,
0.070809029,
-0.0753635913,
0.3280291557,
0.1719776392,
-0.1158202738,
-0.2379233241,
0.4602113068,
-0.014344315,
0.1340287328,
0.2429944426,
-0.0889171287,
0.3365107477,
-0.0756701678,
-0.2729931176,
-0.062709868,
0.2376002371,
0.1726809144,
0.1039546877,
0.1899483353,
0.0109505113,
0.005681931,
0.2170875818,
-0.1980080456,
-0.1666433364,
0.0511952862,
-0.0437556393,
0.2654487491,
0.0814945027,
0.2596525848,
-0.247097373,
0.2572681308,
-0.1374317259,
-0.1171308085,
-0.3422017395,
0.2011795044,
0.2727070749,
-0.209035337,
0.0312488135,
-0.3480929732,
-0.5751773715,
0.2541058958,
-0.0879076868,
0.2226928622,
0.0729398429,
0.1610176265,
0.0471448377,
0.2452380955,
0.140863061,
0.0855321586,
0.2216344625,
0.234506011,
-0.5197231174,
-0.1105313301,
-0.1512377709,
-0.0394730866,
-0.0571240336,
0.2479062527,
0.315669626,
0.3780956268,
0.3416633904,
-0.0667105839,
-0.1172677502,
-0.521343112,
-0.1506474018,
-0.0124809183,
0.1178540513,
0.1023148894,
0.1462201476,
-0.3354575336,
-0.1229352355,
-0.0298259053,
0.04915227,
-0.1772671342,
0.072665453,
-0.1669162512,
0.0829740986,
0.0800649002,
0.1700885147,
-0.235768199,
-0.0381799862,
-0.2073810995,
-0.0565626062,
0.2702920437,
-0.2656606138,
-0.0730580091,
-0.2781138122,
-0.2712407708,
-0.1031878367,
0.0364700072,
-0.2044027001,
0.2926089168,
0.2826995552,
0.019652687,
-0.1517454982,
-0.0983475447,
-0.3492052555,
0.5780210495,
-0.2696864903,
0.1584291458,
-0.4038263261,
-0.2313586473,
0.2019391358,
-0.0334443077,
0.2865877748,
-0.1035004929,
0.1401914507,
0.0275014099,
-0.3251668215,
-0.1949955672,
-0.2094119638,
0.2677612901,
0.2775139213,
0.745136559,
0.0741665959,
0.3454884589,
0.1802721173,
0.1070335433,
0.0168003608,
0.2816304266,
-0.2569596171,
-0.1691364795,
-0.3194507062,
-0.0622097515,
0.2351967841,
0.0858154744,
0.0257595852,
0.1553875357,
-0.1771258861,
-0.0389000215,
-0.2113518268,
-0.0666952059,
-0.1591697186,
0.1071520597,
-0.2032227814,
0.2908295989,
0.2369370013,
-0.0089531103,
-0.4920892417,
-0.3526346982,
-0.2461753041,
0.0338329449,
0.2247827053,
-0.1775361598,
-0.5154921412,
-0.1536711603,
-0.3968795538,
0.3571223319,
0.2105642259,
0.2496907115,
0.0733300447,
0.0918409675,
0.1379288435,
0.0048199184,
0.8831475377,
-0.1925908476,
0.0478242449,
0.0855074599,
-0.5386547446,
-0.3299156725,
0.1213035062,
-0.0266267657,
0.0627537295,
0.3690216839,
0.4005454779,
-0.3076558709,
-0.336124748,
-0.059670344,
0.1310088933,
-0.0072172959,
-0.3539112508,
-0.1504345387,
-0.128759563,
-0.3918295801,
0.3001624346,
-0.0020009959,
0.2927742004,
0.327032268,
-0.3938692212,
0.0023753031,
-0.2537273765,
0.3102674484,
-0.017485451,
-0.0331125557,
0.1579237431,
0.2585355937,
0.0094519462,
0.1730179638,
-0.0365031958,
-0.2073554397,
-0.0223441366,
-0.0015389201,
0.0565206222,
0.0482674986,
0.3998785913,
0.4951078296,
-0.1465214342,
0.5836420059,
0.0694029853,
0.4908261299,
-0.0113029853,
0.2272512615,
-0.1186981276,
0.1846878678,
-0.664324224,
-0.6317515373,
0.0898284167,
0.3616833091,
-0.3592296541,
0.4149481356,
0.0539053567,
-0.0925546885,
0.4846363664,
0.0796501264,
0.9722080231,
-0.4101477563,
-0.1564438343,
-0.1024759784,
0.2348392159,
0.4491519034,
-0.1452315003,
0.1185020581,
0.0526879691,
-0.312782228,
0.0187686197,
-0.1789842993,
0.0131358299,
0.1035689265,
0.1015669182,
0.3528615236,
-0.1354783773,
0.0532924496,
0.017389724,
0.3033020794,
0.2745911777,
-0.3907108605,
-0.1281693578,
-0.0674053878,
0.1484356523,
-0.0544954315,
0.0417408347,
0.0231093355,
0.2586684823,
-0.2181494981,
-0.1786285639,
-0.4309234321,
-0.3346199691,
-0.0290315878,
-0.186109215,
-0.2180694193,
0.185608685,
-0.1499717087,
-0.1546511054,
0.4800974727,
0.0550313927,
0.1872083545,
0.2562003434,
0.2629366517,
-0.0710087195,
-0.4394881427,
0.1941316724,
-0.1478517503,
-0.189398393,
0.039927721,
-0.0202836338,
-0.4675249159,
-0.0285941213,
0.1664801836,
0.4765831232,
0.016073158,
-0.2211512625,
-0.0090736328,
0.0133572361,
-0.1800497174,
-0.0390073061,
0.1601356715,
0.0872106031,
0.680351615,
-0.0118062068,
-0.2712481022,
-0.1171463057,
0.1355697513,
0.2716130316,
-0.2544379234,
0.3072367311,
0.2026949525,
-0.4166203439,
-0.1117486805,
0.0054925862,
0.2209941596,
0.3390144706,
0.1124828607,
-0.0173630416,
-0.2973784506,
0.4311400354,
0.0399322547,
-0.1429936737,
0.02260134,
-0.0035557041,
-0.6040540338,
-0.1978468299,
0.0445598476,
-0.1624218971,
-0.2262352407,
0.0922237113,
0.2347444147,
-0.2562171817,
0.3702440262,
-0.1560823917,
-0.1145805344,
-0.0422538146,
0.2249818742,
-0.1870000213,
0.2397277057,
-0.0696395785,
0.0781730115,
-0.0215617511,
0.0846771151,
0.0055008237,
-0.1249879822,
0.0938566849,
0.1914308369,
-0.1692730486,
-0.2661700845,
0.285449028,
-0.3040847778,
-0.2480562627,
-0.2004135102,
0.118116051,
-0.0329117738,
0.0581702292,
-0.6831441522,
0.0294049755,
-0.4843920171,
-0.1465281993,
0.0845039263,
-0.1279474348,
-0.3025520444,
0.0446089208,
0.1762181669,
0.1422257721,
-0.0272617657,
0.048413977,
-0.0653511956,
0.1146878749,
-0.0626345351,
0.2472893149,
0.0431433804,
-0.0827456117,
0.213344276,
0.1262267381,
0.1769422889,
0.0563256815,
-0.1567686498,
0.4866523445,
-0.0668556392,
-0.2868573964,
-0.1953934729,
0.1671300381,
0.2077479511,
0.1736728251,
0.1619257778,
-0.2451898307,
0.357937336,
-0.1853936017,
0.0889694169,
0.4020834863,
-0.0821812749,
-0.2352082878,
0.3388043046,
0.4077506363,
-0.2249970734,
0.4805637002,
0.3468933702,
-0.1938000619,
0.6008089781,
0.1963531524,
0.326964587,
0.4239933193,
0.5279598832,
-0.3396155238,
-0.3884893656,
-0.1107795984,
0.7172067761,
-0.2031839937,
-0.1873831451,
0.0708059967,
-0.2135525197,
0.3435969055,
-0.3242047727,
0.1368951052,
0.3997924328,
0.168961212,
-0.0689870119,
-0.3674277067,
0.0155460965,
0.2693639696,
-0.025864901,
0.0015566391,
0.0039910148,
0.2068347037,
0.1559249014,
0.3189150691,
-0.2765103579,
-0.2405989617,
-0.1286067367,
0.2134978622,
-0.0510532148,
0.1259864271,
-0.2663528323,
0.2794304788,
0.3113367856,
-0.3693413436,
0.2065238059,
0.3697750866,
-0.0400803797,
0.0977606624,
-0.3742182255,
-0.1569202691,
0.0034287798,
0.4361079335,
0.2118592411,
0.191519469,
-0.0341021456,
-0.0733797029,
-0.0547665581,
-0.0629167482,
0.2353904992,
0.0497870743,
0.1619337946,
0.2595260143,
0.2800490558,
0.0348718725,
-0.1228136346,
0.0269113518,
-0.1231810823,
0.3983189762,
0.2354517132,
-0.2709558308,
0.2363281399,
0.2429218739,
0.0075737471,
-0.2389286011,
-0.0133878291,
-0.0855353251,
0.4185399413,
-0.2886804342,
-0.26699242,
-0.3452303112,
-0.3425402045,
-0.3784067631,
-0.0410969369,
0.0931633636,
0.0125886146,
0.2585784793,
0.0449904352,
0.0296727289,
0.102023147,
-0.1909072995,
0.0283050686,
-0.139493987,
0.3953852654,
0.009559907,
0.3836018145,
-0.0542447455,
-0.3450880647,
0.4803271592,
-0.2367369533,
-0.0424051806,
0.0815749019,
0.0867152959,
0.1680948734,
0.028279867,
-0.0564316399,
0.0356683359,
0.3896332979,
0.1423924416,
0.5392437577,
0.0255772863,
0.166427508,
-0.2396233529,
0.1745081246,
0.3232297003,
0.1623242348,
-0.0563942119,
0.0658030286,
0.065319322,
0.235682562,
-0.1420141906,
-0.2512161136,
-0.1008310094,
0.1202275082,
0.1188261658,
0.2824154496,
-0.3085884452,
0.1336143315,
-0.0352305546,
0.0329058394,
-0.2267473191,
-0.143549487,
0.5653971434,
-0.5540589094,
-0.3062086701,
-0.3145029843,
0.2423719168,
0.3347373307,
0.1990550756,
0.1113852262,
-0.0586150847,
0.1164707467,
-0.1394053251,
-0.3094705641,
0.2706579864,
0.0268354509,
0.0200901106,
-0.2097320259,
-0.2281594425,
0.0892247558,
-0.1314506829,
-0.3454653919,
-0.174268648
] |
https://github.com/huggingface/datasets/issues/1790 | ModuleNotFoundError: No module named 'apache_beam', when specific languages. | Hi !
Apache Beam is a framework used to define data transformation pipelines. These pipeline can then be run in many runtimes: DataFlow, Spark, Flink, etc. There also exist a local runner called the DirectRunner.
Wikipedia is a dataset that requires some parsing, so to allow the processing to be run on this kind of runtime we're using Apache Beam.
At Hugging Face we've already processed certain versions of wikipedia (the `20200501.en` one for example) so that users can directly download the processed version instead of using Apache Beam to process it.
However for the japanese language we haven't processed it so you'll have to run the processing on your side.
So you do need Apache Beam to process `20200501.ja`.
You can install Apache Beam with
```
pip install apache-beam
```
I think we can probably improve the error message to let users know of this subtlety.
What #498 implied is that Apache Beam is not needed when you process a dataset that doesn't use Apache Beam. | ```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct? | 167 | ModuleNotFoundError: No module named 'apache_beam', when specific languages.
```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct?
Hi !
Apache Beam is a framework used to define data transformation pipelines. These pipeline can then be run in many runtimes: DataFlow, Spark, Flink, etc. There also exist a local runner called the DirectRunner.
Wikipedia is a dataset that requires some parsing, so to allow the processing to be run on this kind of runtime we're using Apache Beam.
At Hugging Face we've already processed certain versions of wikipedia (the `20200501.en` one for example) so that users can directly download the processed version instead of using Apache Beam to process it.
However for the japanese language we haven't processed it so you'll have to run the processing on your side.
So you do need Apache Beam to process `20200501.ja`.
You can install Apache Beam with
```
pip install apache-beam
```
I think we can probably improve the error message to let users know of this subtlety.
What #498 implied is that Apache Beam is not needed when you process a dataset that doesn't use Apache Beam. | [
0.191167891,
0.0017937372,
-0.0041887765,
0.1869836748,
0.2713819742,
0.1396205425,
0.4213475585,
0.3950366378,
0.2294802219,
0.1781060398,
0.1076989919,
-0.091416806,
0.0533492379,
-0.1092454046,
0.1017364934,
-0.4603550136,
0.312389791,
0.075500913,
-0.1031828523,
-0.1862582713,
-0.3473692238,
0.0844961405,
-0.3394606411,
0.2037170529,
-0.2264510244,
0.1729814112,
-0.1223800555,
0.0795246586,
0.0796694681,
-0.3102602363,
0.0695770979,
-0.2526940107,
-0.0015343584,
0.378924042,
-0.0001123201,
0.1725936979,
0.4942121506,
-0.1868752539,
-0.3528475761,
-0.2001892328,
-0.0440736003,
-0.526899159,
0.0270451065,
-0.4995654821,
-0.1185737848,
-0.3200573325,
0.124841623,
-0.3306963146,
0.660889864,
0.2097998708,
0.182145521,
0.3544296622,
0.0479208231,
-0.0867461339,
0.4274946451,
0.0936126634,
-0.149034515,
-0.0419641845,
-0.0831070691,
0.0119519886,
-0.0941680595,
0.5700827241,
-0.3236296177,
-0.0393852517,
0.2292387187,
-0.2227155715,
0.056658268,
-0.6094754338,
0.1776166856,
0.3224821687,
0.7865331769,
-0.1351764947,
-0.2221817076,
-0.1530816257,
-0.1098431647,
0.2351431847,
0.1595033556,
0.1091492251,
-0.2148614973,
0.046317108,
0.4381079674,
-0.2706965506,
-0.1476813108,
0.0733522549,
0.1302393377,
0.431597501,
0.070652768,
0.3176282346,
-0.0545340255,
-0.0860569179,
-0.1191400141,
-0.3226894736,
0.252566576,
0.3874097466,
-0.1137110218,
0.0848222673,
0.101793386,
0.1508980095,
-0.0367010534,
-0.2810487747,
-0.1921419501,
0.1158808917,
0.1053407565,
0.1082062274,
0.1243437678,
0.1274575889,
0.3880295157,
-0.0257627945,
0.3348401189,
-0.2162709385,
0.1098148376,
0.0442707166,
0.0299779829,
-0.2803065181,
-0.3338728845,
0.2226014882,
0.3565323055,
-0.0905373245,
-0.0576840229,
0.0482546575,
-0.4567848742,
-0.3259346187,
-0.2221909761,
0.3378891349,
0.1325862557,
0.4152707756,
0.1352867484,
0.2345645428,
-0.2575587034,
-0.454652518,
-0.0323014073,
0.3424352109,
-0.4076470733,
0.1976640075,
-0.0461327061,
0.0144780139,
0.2195373625,
-0.1552636027,
0.1326282173,
0.1820785999,
-0.0900049955,
-0.0856826678,
-0.0457455739,
0.4503149688,
0.0657335371,
0.4466488659,
0.2975469828,
-0.1272506714,
-0.2159792781,
0.2281533331,
-0.2719877362,
-0.2765989602,
0.1818427444,
0.0594421774,
-0.3565079272,
0.2080851793,
-0.0104246018,
-0.074067153,
0.0480916239,
-0.0854225978,
0.2088579834,
0.0514473245,
-0.027733773,
-0.2898871303,
-0.0214106757,
0.749896884,
-0.2269249409,
-0.0638567805,
-0.0097221369,
-0.1436581463,
-0.131008625,
-0.0040014326,
-0.1556620598,
0.2832134962,
-0.2314027995,
-0.0215375945,
0.5308300853,
-0.5257616639,
0.058436282,
0.194416061,
-0.098203674,
0.2102935165,
0.2612051666,
0.002672777,
-0.4192949831,
-0.2195367813,
-0.2881307304,
0.050639715,
0.1025504917,
-0.0246720109,
-0.2568201423,
-0.0081706,
0.1157976761,
0.1537028551,
0.193826288,
0.0787257701,
0.1328653693,
0.4823883772,
0.2445162833,
-0.1990594566,
0.2263820469,
0.4565427303,
-0.0051685506,
0.1091253608,
0.22361359,
0.0644488707,
-0.0629836768,
0.2775995433,
-0.085578762,
0.4019981921,
-0.0905068517,
-0.1003320664,
-0.1479928792,
-0.0885238573,
-0.2833201587,
-0.3008553386,
0.0780689269,
0.0352994353,
-0.0723939613,
0.331641525,
-0.2848320603,
0.4456301928,
-0.1219723597,
0.050128784,
-0.5256506801,
-0.0278601591,
-0.2387652546,
0.1458373666,
-0.033900626,
0.0709547698,
0.2233175635,
-0.1908291727,
-0.0455725826,
0.1484088302,
0.1055574417,
0.1109234318,
-0.0744640455,
-0.0624692775,
0.1449840069,
-0.3980555534,
0.3778226376,
0.1355360448,
0.126410827,
-0.034706831,
0.1138774902,
0.263661474,
0.1505614519,
0.5216032863,
0.0231503714,
-0.0100321146,
0.049537614,
0.0356117487,
-0.3438962102,
-0.1951042563,
0.2003543228,
0.2368831187,
0.299970001,
0.0473007448,
0.1174449623,
-0.3627563715,
0.5069278479,
-0.0543008298,
0.1757465452,
-0.0242700465,
-0.324691236,
0.1475042254,
0.1711485237,
-0.2194788009,
0.241033867,
0.1912721694,
-0.126013279,
0.0883796141,
0.2026085258,
-0.1247965097,
0.0700961649,
0.224394545,
0.4852195084,
-0.0354691632,
-0.2386367023,
0.0484004505,
-0.1771227419,
-0.0702499077,
-0.2258549929,
-0.0329049751,
-0.247507453,
0.1603959203,
-0.1956041008,
-0.6308537126,
-0.3146684766,
0.0494067371,
-0.5606021881,
-0.2840158343,
-0.0563856326,
-0.2035320401,
-0.2767910063,
0.2280880958,
0.1178846508,
-0.0494031571,
0.0303967223,
-0.4305201769,
-0.3263078034,
-0.3265706599,
-0.3022223115,
0.0115314452,
0.2494440675,
0.0808148906,
0.1863833219,
-0.4000442922,
0.0187863801,
-0.2099527121,
-0.2723643482,
0.2021514326,
-0.1723351628,
-0.0010474599,
-0.0152865322,
0.5179565549,
-0.056417305,
-0.0476005822,
0.4222885966,
-0.1399167627,
-0.1939955652,
0.1210297793,
0.1419622451,
0.0817628577,
0.04713412,
-0.5049284697,
-0.1154190153,
-0.4123277664,
-0.0873087421,
0.0832736716,
0.1298009306,
0.2418059707,
0.1741640568,
0.2212676555,
0.0440375656,
0.019462578,
0.0029389188,
-0.0079016527,
0.2857332528,
-0.1334024966,
-0.3504651189,
0.3051893711,
-0.1546022743,
0.1144622937,
0.1189529076,
-0.2039327621,
-0.1464454085,
0.24334912,
0.0775509551,
-0.0539501086,
0.3316075206,
0.4205644727,
-0.1318390071,
0.0001820313,
-0.1190086231,
-0.0543218441,
-0.1399504244,
-0.176915735,
0.3257744908,
0.2829321325,
0.3171045184,
-0.0185836926,
0.8535454273,
-0.0275242832,
0.4695925713,
0.4642806649,
0.147020027,
0.3714670837,
-0.4112056792,
-0.1172696948,
-0.091610074,
0.0645115525,
-0.1340085566,
0.1620412767,
-0.0790207237,
0.0574373826,
-0.6090329289,
-0.3949505091,
-0.3404393196,
-0.221966967,
0.1575286835,
-0.1700624824,
0.2305216342,
0.0265097562,
0.0417209566,
0.1240235344,
0.101832062,
0.2508081198,
0.3875487745,
0.1745313406,
0.0880678967,
-0.0849716291,
-0.0875834599,
-0.2883144915,
0.3871931434,
-0.0084185917,
0.1123482957,
-0.0652784929,
-0.3105086684,
0.0889983922,
0.0730066523,
0.4744766355,
-0.2369821221,
-0.2140559554,
0.2444824576,
-0.0033574582,
-0.654532671,
-0.0518580638,
0.0534757636,
0.0339649618,
-0.0903272033,
0.1465222239,
-0.2105577588,
-0.3132276535,
0.1991849244,
0.4235745072,
-0.1190469265,
-0.209280774,
-0.5875595808,
-0.0709562972,
-0.4787137806,
-0.094979614,
-0.0751947314,
-0.0542525277,
0.0713018999,
0.3650436997,
0.1260065734,
-0.0556117445,
0.0407625958,
-0.0285093915,
0.070158273,
-0.1987766922,
-0.3843261898,
0.1629840881,
0.2838367224,
-0.1293618381,
0.3129346967,
-0.0545833558,
-0.4171646535,
-0.2030956,
-0.0646224469,
0.129516989,
0.4219567776,
0.0074733701,
-0.1024842933,
0.0093757221,
-0.22136271,
0.0771463141,
-0.0407825187,
0.1367145926,
-0.0255439077,
-0.4656979442,
-0.4260050356,
0.727545023,
0.057301417,
-0.1102522761,
0.2195150554,
0.3865072131,
-0.0961201862,
0.4131182134,
0.1205051765,
1.0968140364,
-0.0403656587,
0.2054995596,
0.1531870067,
0.114594385,
0.7433240414,
-0.6203220487,
0.1198613197,
-0.1833265722,
0.1576322466,
-0.1322311312,
-0.0103875231,
0.6084544659,
0.0741042942,
0.0390939564,
0.5708758235,
0.1639003605,
0.2875730097,
-0.0295882504,
0.165696457,
-0.2634518743,
-0.0626112968,
-0.4114673138,
0.0360435061,
-0.1083328128,
0.7435284257,
-0.1365130246,
-0.1755884737,
-0.3005133867,
-0.4897768795,
-0.0995775387,
-0.0115366997,
-0.2393388748,
0.1199965253,
-0.2641691566,
-0.3201239407,
-0.0009486935,
0.3039796054,
0.3844964206,
-0.0567822792,
-0.2318539321,
0.1234673187,
-0.1061982885,
-0.0880048573,
-0.2654597759,
-0.0403256565,
0.4411508143,
-0.1480445117,
-0.1679430455,
0.1714526117,
-0.4244390428,
-0.0879570022,
-0.1084513068,
0.1357583702,
0.5168758631,
0.2983567715,
-0.1830003709,
0.2779880762,
0.0278042387,
0.0789500251,
0.1227024198,
-0.192829743,
-0.069757849,
-0.1583997011,
-0.2607503235,
-0.1299847811,
-0.0765772089,
0.2389580905,
0.2075751573,
-0.1365613937,
0.2965823412,
0.0048327763,
-0.2153781503,
-0.1935855597,
0.2620069385,
0.196881175,
-0.1408137679,
-0.244277969,
0.1170086041,
0.0080762934,
-0.2089565247,
0.0671192631,
0.067916289,
-0.1068508998,
-0.038212616,
-0.2769325972,
-0.2390615642,
0.3213486671,
0.0108336965,
-0.2085025012,
0.0373122096,
0.1167574003,
0.541667223,
-0.0854341462,
-0.2512435317,
-0.2362713069,
0.1338644773,
0.2141528577,
0.5877953172,
0.3229280114,
0.0615967289,
0.0207409915,
0.0353408754,
-0.0073235366,
-0.3004597127,
-0.1186438948,
0.0404926054,
0.2043308318,
0.1712897569,
0.0379311033,
0.2153564095,
-0.2638363838,
0.2779996395,
-0.1914842576,
0.0485911369,
0.297819823,
-0.186531648,
0.2497087568,
0.1298917979,
0.3748375475,
-0.3129644096,
0.1826846302,
-0.2493488193,
0.1914863884,
0.2297152579,
-0.0310409404,
0.3727423549,
0.1146910489,
-0.1360597759,
-0.133481577,
-0.1840708107,
-0.0747602805,
-0.0018255075,
-0.1629542261,
0.0507635102,
-0.0449642129,
0.1263656914,
0.1798333824,
-0.2456466109,
-0.0594852977,
0.2569031417,
0.1356152743,
-0.3840174973,
0.1147181466,
0.4462441206,
-0.2306538224,
-0.1444596797,
0.3152915835,
0.2557354569,
0.0696520954,
0.2864887416,
0.0793635696,
0.1090920866,
-0.0833654329,
0.3604847789,
0.3540112674,
0.1339811236,
0.1699280441,
0.1193099171,
-0.0394220501,
0.1235610098,
0.6183958054,
-0.3597973883,
0.5293436646,
0.1383292377,
0.2234867066,
-0.2095676959,
-0.171987325,
0.4043191373,
0.3491846621,
0.0307412576,
-0.0637232661,
-0.0098118056,
-0.0151649527,
-0.0383450463,
-0.0439841375,
-0.1558842808,
0.1526423991,
-0.0238105301,
0.1840654761,
0.060699299,
-0.2756788731,
-0.0898633674,
-0.0042635659,
0.0583704375,
-0.3857108951,
0.2008375823,
0.1657792777,
-0.0824830756,
-0.0335784331,
0.28675583,
-0.0610285141,
0.189162612,
-0.0892437175,
-0.1562722325,
0.0612952448,
-0.2288974375,
0.0749253631,
0.0788589343,
0.2476973981,
0.262133956,
-0.120302029,
-0.0215709768,
-0.0137324547,
-0.0387166925,
0.1328179985,
0.1091328338,
-0.0945223868,
0.2317103446,
0.2226292938,
0.0645290688,
-0.1721491814,
-0.0432612598,
0.13900958,
0.0033631187,
-0.4188855588,
0.0442826934,
-0.4233120084,
-0.1423740536,
-0.4599450827,
0.1326026171,
-0.4896371961,
0.0648630336,
0.1420060545,
0.2148463279,
-0.1376212686,
-0.3698984683,
0.0368540511,
-0.1593539864,
0.2568938732,
0.3579009771,
0.114451997,
-0.2953967154,
-0.1813542843,
-0.66223979,
0.0893713087,
-0.3208748996,
0.1805420816,
-0.1669026166,
-0.1049254164,
0.2438536435,
0.3968712091,
-0.0135988193,
0.0720952153,
-0.0804832205,
0.0321499184,
-0.3542991281,
-0.1191496477,
-0.0947059691,
0.1253854036,
-0.1326466352,
-0.2455042601,
0.0859806761,
0.0227904003,
-0.0070103812,
-0.1017631069,
-0.3187882006,
0.4922677875,
-0.0574584603,
0.5561668873,
0.0317359157,
0.3317184448,
0.0810962766,
-0.1596714258,
0.0483924486,
0.0461772606,
-0.2101216763,
0.2767444849,
0.0403252058,
0.244318977,
-0.2023214251,
-0.1389500797,
-0.3106032908,
0.5070670247,
-0.0894301385,
0.0841184333,
-0.2534944415,
-0.0817406401,
-0.0257493947,
0.1667093337,
-0.1138289422,
0.0313685648,
-0.0296890754,
-0.1530407816,
-0.5479576588,
-0.0543606393,
0.4010425806,
-0.6405131817,
-0.3518933952,
0.0424925387,
0.2713647485,
-0.0068680709,
-0.0719661415,
-0.4508558214,
0.0561414845,
0.2868240476,
0.2098809779,
0.092585437,
-0.0562561303,
-0.2399142534,
-0.1344614029,
-0.0398825482,
-0.4349628389,
-0.1276827455,
-0.0872318968,
-0.0755798668,
-0.3943341672
] |
https://github.com/huggingface/datasets/issues/1790 | ModuleNotFoundError: No module named 'apache_beam', when specific languages. | Thanks for your reply!
I understood.
I tried again with installing apache-beam, add ` beam_runner="DirectRunner"` and an anther `mwparserfromhell` is also required so I installed it.
but, it also failed. It exited 1 without error message.
```py
import datasets
# BTW, 20200501.ja doesn't exist at wikipedia, so I specified date argument
wiki = datasets.load_dataset("wikipedia", language="ja", date="20210120", cache_dir="./datasets", beam_runner="DirectRunner")
print(wiki)
```
and its log is below
```
Using custom data configuration 20210120.ja
Downloading and preparing dataset wikipedia/20210120.ja-date=20210120,language=ja (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to ./datasets/wikipedia/20210120.ja-date=20210120,language=ja/0.0.0/4021357e28509391eab2f8300d9b689e7e8f3a877ebb3d354b01577d497ebc63...
Killed
```
I also tried on another machine because it may caused by insufficient resources.
```
$ python main.py
Using custom data configuration 20210120.ja
Downloading and preparing dataset wikipedia/20210120.ja-date=20210120,language=ja (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to ./datasets/wikipedia/20210120.ja-date=20210120,language=ja/0.0.0/4021357e28509391eab2f8300d9b689e7e8f3a877ebb3d354b01577d497ebc63...
Traceback (most recent call last):
File "main.py", line 3, in <module>
wiki = datasets.load_dataset("wikipedia", language="ja", date="20210120", cache_dir="./datasets", beam_runner="DirectRunner")
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/datasets/load.py", line 609, in load_dataset
builder_instance.download_and_prepare(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 526, in download_and_prepare
self._download_and_prepare(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 1069, in _download_and_prepare
pipeline_results = pipeline.run()
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/pipeline.py", line 561, in run
return self.runner.run_pipeline(self, self._options)
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/direct/direct_runner.py", line 126, in run_pipeline
return runner.run_pipeline(pipeline, options)
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 182, in run_pipeline
self._latest_run_result = self.run_via_runner_api(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 193, in run_via_runner_api
return self.run_stages(stage_context, stages)
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 358, in run_stages
stage_results = self._run_stage(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 549, in _run_stage
last_result, deferred_inputs, fired_timers = self._run_bundle(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 595, in _run_bundle
result, splits = bundle_manager.process_bundle(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 888, in process_bundle
self._send_input_to_worker(process_bundle_id, transform_id, elements)
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 765, in _send_input_to_worker
data_out.write(byte_stream)
File "apache_beam/coders/stream.pyx", line 42, in apache_beam.coders.stream.OutputStream.write
File "apache_beam/coders/stream.pyx", line 47, in apache_beam.coders.stream.OutputStream.write
File "apache_beam/coders/stream.pyx", line 109, in apache_beam.coders.stream.OutputStream.extend
AssertionError: OutputStream realloc failed.
```
| ```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct? | 279 | ModuleNotFoundError: No module named 'apache_beam', when specific languages.
```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct?
Thanks for your reply!
I understood.
I tried again with installing apache-beam, add ` beam_runner="DirectRunner"` and an anther `mwparserfromhell` is also required so I installed it.
but, it also failed. It exited 1 without error message.
```py
import datasets
# BTW, 20200501.ja doesn't exist at wikipedia, so I specified date argument
wiki = datasets.load_dataset("wikipedia", language="ja", date="20210120", cache_dir="./datasets", beam_runner="DirectRunner")
print(wiki)
```
and its log is below
```
Using custom data configuration 20210120.ja
Downloading and preparing dataset wikipedia/20210120.ja-date=20210120,language=ja (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to ./datasets/wikipedia/20210120.ja-date=20210120,language=ja/0.0.0/4021357e28509391eab2f8300d9b689e7e8f3a877ebb3d354b01577d497ebc63...
Killed
```
I also tried on another machine because it may caused by insufficient resources.
```
$ python main.py
Using custom data configuration 20210120.ja
Downloading and preparing dataset wikipedia/20210120.ja-date=20210120,language=ja (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to ./datasets/wikipedia/20210120.ja-date=20210120,language=ja/0.0.0/4021357e28509391eab2f8300d9b689e7e8f3a877ebb3d354b01577d497ebc63...
Traceback (most recent call last):
File "main.py", line 3, in <module>
wiki = datasets.load_dataset("wikipedia", language="ja", date="20210120", cache_dir="./datasets", beam_runner="DirectRunner")
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/datasets/load.py", line 609, in load_dataset
builder_instance.download_and_prepare(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 526, in download_and_prepare
self._download_and_prepare(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 1069, in _download_and_prepare
pipeline_results = pipeline.run()
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/pipeline.py", line 561, in run
return self.runner.run_pipeline(self, self._options)
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/direct/direct_runner.py", line 126, in run_pipeline
return runner.run_pipeline(pipeline, options)
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 182, in run_pipeline
self._latest_run_result = self.run_via_runner_api(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 193, in run_via_runner_api
return self.run_stages(stage_context, stages)
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 358, in run_stages
stage_results = self._run_stage(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 549, in _run_stage
last_result, deferred_inputs, fired_timers = self._run_bundle(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 595, in _run_bundle
result, splits = bundle_manager.process_bundle(
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 888, in process_bundle
self._send_input_to_worker(process_bundle_id, transform_id, elements)
File "/home/miyamonz/.cache/pypoetry/virtualenvs/try-datasets-4t4JWXxu-py3.8/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 765, in _send_input_to_worker
data_out.write(byte_stream)
File "apache_beam/coders/stream.pyx", line 42, in apache_beam.coders.stream.OutputStream.write
File "apache_beam/coders/stream.pyx", line 47, in apache_beam.coders.stream.OutputStream.write
File "apache_beam/coders/stream.pyx", line 109, in apache_beam.coders.stream.OutputStream.extend
AssertionError: OutputStream realloc failed.
```
| [
0.0917947292,
0.0745990351,
0.0195859279,
0.2518456876,
0.257083565,
0.0409057848,
0.3200167716,
0.348071456,
0.1667262614,
0.1959525049,
0.2174152136,
0.0488915034,
-0.097461924,
-0.2695727646,
0.0972720534,
-0.3023028672,
0.2464137226,
0.0408719443,
-0.1644422412,
-0.2330401838,
-0.3931179643,
0.1340928972,
-0.3705987632,
0.0350908116,
-0.1296225786,
0.3397008777,
-0.0780814439,
0.0638151839,
0.0173256174,
-0.2700100541,
0.0453570224,
-0.3246164024,
0.1215120703,
0.373932004,
-0.0001173204,
0.1343808174,
0.4923771918,
-0.2628590167,
-0.3836724758,
-0.256967783,
-0.1403350234,
-0.4439761937,
0.0448289514,
-0.4475934207,
-0.1867608726,
-0.269749403,
0.0532006957,
-0.3586478531,
0.3953624666,
0.2671947181,
0.1607774198,
0.2647910416,
0.1899024248,
-0.0418007635,
0.4182233512,
0.0558922999,
-0.2807168365,
0.0011080614,
-0.077878356,
0.1042615175,
0.0328847729,
0.3811948299,
-0.2652492821,
0.0351824053,
0.2196082175,
-0.2989070117,
0.0275770165,
-0.532227397,
0.1891090572,
0.1666528583,
0.7942330837,
-0.316986531,
-0.1359948516,
0.0134904236,
-0.0399669223,
0.0834229663,
0.2887853384,
0.114921011,
-0.1483091563,
-0.0395825692,
0.4454574585,
-0.2758434713,
-0.1213793978,
0.3104603589,
0.0970905796,
0.4800926149,
0.0280744396,
0.2852404416,
-0.222067371,
-0.1609825045,
-0.019383749,
-0.3305299878,
0.2255716026,
0.3868535757,
-0.2711617649,
0.0091114715,
0.0303923208,
0.1701530069,
0.0020985401,
-0.2076066583,
-0.2619357407,
0.1003811881,
0.1692397594,
-0.0123883821,
0.0890528411,
0.152899906,
0.3734167516,
0.1121670678,
0.2206745297,
-0.1710112393,
0.0056282901,
0.0340125374,
-0.0521676205,
-0.3492521644,
-0.3236457407,
0.1878948659,
0.3179503977,
-0.1621291786,
-0.0892105997,
0.0642646328,
-0.6158860922,
-0.2876562178,
-0.2265934199,
0.3501833975,
0.0944344103,
0.3287701607,
0.152771309,
0.2902513742,
-0.2045258135,
-0.3957129717,
-0.0542581938,
0.4753559232,
-0.3645496666,
0.2409630567,
0.0873939469,
0.1367837489,
0.150634259,
-0.1451438665,
-0.0452820137,
0.0375526175,
-0.0371274129,
0.0036607694,
-0.1230322644,
0.3735719025,
0.1352757365,
0.5192133784,
0.2212897986,
-0.0427362472,
-0.0936331898,
0.1430324167,
-0.1821733117,
-0.2547639608,
0.0409879945,
0.019826578,
-0.3785462677,
0.1690729558,
0.041864045,
-0.1529212594,
-0.0193210151,
-0.0137387542,
0.1795716584,
0.0659218878,
-0.0775271058,
-0.2482933253,
0.1928218305,
0.7632595897,
-0.1837842911,
-0.0071700695,
-0.0386879221,
-0.0945176035,
-0.1337481588,
-0.1851740628,
-0.010763702,
0.3875402808,
-0.2644916177,
-0.0652228072,
0.6910912395,
-0.5287434459,
-0.0048346124,
0.1956304014,
-0.0111864936,
0.033899188,
0.2492820919,
-0.1067637205,
-0.2923359871,
-0.1760917306,
-0.2596347928,
0.0050267861,
0.1304205507,
-0.0345543437,
-0.3318172991,
-0.071458593,
0.0876159295,
0.2745761573,
0.3723238111,
0.0291087888,
0.28891927,
0.6823455691,
0.1276974529,
-0.0668425187,
0.2065407336,
0.5193421245,
-0.0871526226,
-0.0227724761,
0.1958386749,
-0.0088048782,
-0.2356020957,
0.255571574,
-0.1881494522,
0.2531146407,
0.0075528119,
0.0816442445,
-0.1720117182,
-0.1806827039,
-0.3440955877,
-0.214448154,
0.0655370802,
0.0168306474,
0.0882707983,
0.3130513728,
-0.3127645254,
0.4396044016,
-0.1976926923,
0.0134640597,
-0.4467650354,
0.081201002,
-0.1344240606,
-0.0401019976,
-0.0064321626,
0.0986570865,
0.3700566888,
-0.2254783958,
-0.1251109242,
0.136841625,
0.0944712758,
-0.0113429334,
-0.050103806,
-0.1107396036,
0.1207016036,
-0.3321649432,
0.4237891734,
0.1321915239,
0.137866497,
-0.1063947007,
0.1518632174,
0.0876189917,
0.3021605015,
0.4313707948,
0.0128358724,
-0.0354973413,
-0.0844976678,
-0.0023272387,
-0.2098858804,
-0.2393538803,
0.2860514522,
0.3622853756,
0.2126556933,
-0.0158598255,
0.1649520099,
-0.3541209102,
0.4365088344,
0.0414415821,
0.2351136208,
-0.0608066805,
-0.450204432,
0.2783481777,
0.0984192416,
-0.1064570472,
0.3670892715,
0.1384745985,
-0.2372381389,
0.129394576,
0.2279010862,
-0.0575795323,
0.0922067016,
0.1565441042,
0.4523301125,
0.1082718223,
-0.2713343203,
0.0434038416,
-0.0382357575,
-0.1230826303,
-0.0780402124,
0.11596293,
-0.2822548151,
-0.0589117594,
-0.3727225959,
-0.4914530516,
-0.327052325,
0.0718240738,
-0.4088908434,
-0.2334058732,
-0.1688346416,
-0.1222827584,
-0.1346063465,
0.3930951655,
0.2123801708,
-0.2270427644,
-0.0681199431,
-0.3959474266,
-0.2092332393,
-0.2032677084,
-0.2683122456,
-0.0390978642,
0.297636807,
0.1895361543,
0.1925696731,
-0.2675946057,
-0.0959040076,
-0.209943831,
-0.1003020331,
0.1910176873,
0.0083407871,
-0.0994830951,
-0.0512178279,
0.4569111764,
-0.0361204557,
0.0497276634,
0.3699607253,
-0.0084840385,
-0.1452652514,
0.1777407974,
0.0052207438,
0.1532685757,
-0.0275914725,
-0.5211429,
-0.2453731447,
-0.3921805024,
-0.289865911,
0.2246524841,
0.052217219,
0.0134097273,
0.1566922665,
0.1527422369,
-0.0422592387,
0.0668442696,
0.089185074,
0.0916850865,
0.4245994687,
-0.1491640508,
-0.2796569467,
0.3423870504,
-0.1902857572,
0.0289854575,
0.0970070809,
-0.1730142981,
-0.0193444807,
0.3139026463,
-0.1163844764,
-0.0652334392,
0.2874521911,
0.519010663,
-0.1943496317,
0.09282469,
-0.0690187737,
0.0083451364,
-0.1444004178,
-0.2441487312,
0.4245214164,
0.2974085212,
0.3056077957,
-0.0435311608,
0.7822396159,
0.0108602187,
0.2556969821,
0.4260957241,
0.0762993023,
0.2692807913,
-0.348682493,
-0.0499944314,
0.0104914969,
0.2544056475,
-0.0323166549,
0.1112648025,
-0.0598253012,
0.0762267262,
-0.6192238331,
-0.3698078692,
-0.2994991839,
-0.2159061134,
0.1090986878,
-0.274140656,
0.1910424381,
-0.0487075187,
0.0950107872,
0.1237660795,
0.0207050201,
0.2188324183,
0.4647520781,
0.0035705869,
0.0639353171,
-0.0234034006,
-0.092217572,
-0.2643970251,
0.3273771107,
-0.0421187766,
0.1358175576,
-0.0947876051,
-0.2361926436,
0.0894805863,
0.0631986484,
0.3092838824,
-0.4035591781,
-0.1606225222,
0.386954695,
0.0780750588,
-0.6535660028,
-0.1758491546,
0.0604872368,
-0.0153946038,
-0.0175038408,
0.010282089,
-0.1933236122,
-0.2447000593,
0.2950001359,
0.4285179675,
-0.1423176825,
-0.3749651909,
-0.4727918506,
0.0281872731,
-0.4894364178,
-0.188393712,
-0.1379600316,
0.0788534209,
0.242151618,
0.2184171826,
0.0651049092,
-0.0924426988,
0.0236947779,
-0.1127032489,
0.1126640663,
-0.1607255936,
-0.1610542089,
-0.0255069006,
0.3260905743,
-0.1186317578,
0.063138701,
0.1046712026,
-0.2547031641,
-0.0499395132,
-0.0169841275,
0.0706429705,
0.2264760286,
-0.0151433898,
-0.0195699371,
-0.1449171007,
-0.197061941,
0.1059785336,
-0.1217360124,
0.0783259124,
-0.2491559833,
-0.3910135031,
-0.3480045795,
0.7426954508,
0.0271399971,
-0.0159643143,
0.3429037631,
0.2017014027,
-0.151466608,
0.3397690654,
0.0474292412,
0.9796896577,
0.0141839236,
0.0064000865,
0.0223958604,
0.1022483483,
0.8341009617,
-0.6507049799,
0.0667035133,
-0.2045767754,
0.2286321223,
-0.0545771979,
-0.085001938,
0.571810782,
0.1132342368,
0.0078879204,
0.6712854505,
0.1403368711,
0.4805466831,
-0.0816388577,
0.2062823772,
-0.1636158824,
-0.0353387929,
-0.350926131,
0.0182057265,
-0.1721029282,
0.8090725541,
-0.1634286195,
-0.0957967043,
-0.2525319755,
-0.3281347156,
-0.2581403852,
0.1180369779,
-0.2528874874,
0.1364772618,
-0.3172071576,
-0.3505349755,
0.0723374113,
0.3597851396,
0.4233640432,
0.0166258849,
-0.1673574448,
0.1833547354,
-0.0774709731,
-0.1585698873,
-0.2163073421,
0.1075417176,
0.2258041352,
-0.1334332973,
-0.1807709336,
0.1690980047,
-0.3425918221,
-0.119355917,
-0.0113396058,
0.0227902271,
0.668975234,
0.2682596743,
-0.2767084539,
0.3553760052,
0.1283433586,
0.0693108663,
0.1103161648,
-0.2117782831,
-0.0266516805,
0.0278242398,
-0.3508478701,
-0.0341710784,
-0.1292223483,
0.3872738481,
0.2311328053,
-0.1130415052,
0.3309107125,
0.1251434088,
-0.123367399,
-0.2332202792,
0.2853121758,
0.1719539016,
-0.2076361924,
-0.2752786279,
0.2128840983,
0.1703673303,
-0.0983966738,
0.0386647768,
0.0335195549,
-0.0663086101,
0.0395463146,
-0.268111527,
-0.1334898174,
0.2705458999,
-0.0388372391,
-0.1897755712,
-0.0689273849,
0.2141503543,
0.4571786821,
-0.2815126479,
-0.193730548,
-0.2539085448,
0.0339948051,
0.1256141514,
0.4958904088,
0.3753303885,
-0.0051883142,
0.0660260543,
0.0335872136,
-0.0018727211,
-0.1946711838,
-0.1027394608,
0.0161385294,
0.2142413706,
0.206105262,
0.1632523239,
0.1095706522,
-0.4472339749,
0.2173191309,
-0.159572497,
-0.0223158654,
0.2547009885,
-0.1646431088,
0.2865307033,
0.1736471802,
0.3211053908,
-0.5296329856,
0.2142917812,
-0.1817488521,
0.3453174233,
0.194726333,
0.0170993637,
0.4853262901,
0.1384411305,
-0.4599794745,
-0.177335903,
-0.3498988152,
-0.0312796198,
0.0323652364,
-0.1172964349,
0.0418919623,
-0.0186136793,
0.0521195196,
0.1834577024,
-0.275888592,
-0.0591308549,
0.2848198712,
0.1028098911,
-0.2974637449,
0.1754072607,
0.489099443,
-0.0981934741,
-0.1404958665,
0.2333763987,
0.1426938325,
-0.0916716307,
0.3412104249,
0.1548686624,
0.1631512195,
-0.1787315458,
0.2053097188,
0.184096545,
0.2948669195,
0.157599628,
0.0475280024,
-0.0538383462,
0.0880152509,
0.6539550424,
-0.2858647406,
0.4924990833,
0.1011865884,
0.1677301675,
-0.2116197795,
-0.2416175753,
0.3595823646,
0.4214580059,
0.0517490841,
-0.1443927735,
-0.1237960681,
-0.0773716047,
-0.0147106051,
-0.019691661,
-0.2302415371,
0.1290174872,
0.0224811975,
0.2884572446,
-0.1276945472,
-0.2530806363,
-0.055131305,
0.0297633968,
0.0555025749,
-0.3724521101,
0.1534012407,
0.2548289001,
-0.1121661589,
-0.033941254,
0.3947482109,
0.0025757598,
0.0506306067,
-0.1041764393,
-0.0266680401,
-0.0051421104,
-0.1853563339,
-0.0603181608,
0.1111038402,
0.2266118973,
0.3590022624,
-0.1547212303,
-0.0779512748,
0.1268205643,
-0.0255474467,
0.18806988,
0.0604324043,
-0.1555502713,
0.2081418037,
0.2435006052,
0.0489712209,
-0.152484864,
-0.0412456915,
0.2414974272,
0.0703482032,
-0.2723356485,
0.067777507,
-0.3573554158,
0.0387388244,
-0.4263153076,
0.2583353519,
-0.564267695,
0.0693698227,
0.012265523,
0.3249205649,
-0.1382799894,
-0.319653362,
0.0110140024,
-0.2432872057,
0.1348070502,
0.2248660773,
0.1185954139,
-0.4263069332,
-0.3554023206,
-0.4867430329,
0.0426194891,
-0.3128665984,
0.1308722198,
-0.2051991671,
0.0502479225,
0.0146708451,
0.3552874327,
0.0461794585,
0.2269868702,
-0.1186083481,
0.2433989346,
-0.3425808251,
-0.1701989323,
-0.0914430842,
0.110093981,
-0.0911926627,
-0.2694911063,
-0.03060643,
-0.226007387,
-0.0242983401,
-0.1080486178,
-0.4202316999,
0.5537157059,
-0.0947478041,
0.5825887322,
-0.1459339559,
0.3008621037,
0.0713767707,
-0.1396203637,
-0.0046734302,
-0.0106658814,
-0.0691249967,
0.1544357538,
-0.0537480712,
0.2252953053,
-0.2020619959,
-0.0179009512,
-0.3485685289,
0.4514455795,
-0.2499374449,
0.1921252012,
-0.1374954879,
0.0063456399,
0.0350948013,
0.2750196159,
-0.0353063904,
-0.0754016712,
-0.1648885459,
0.0065833097,
-0.5357225537,
-0.0180696175,
0.2722670436,
-0.4996757805,
-0.2172189355,
-0.0332434028,
0.3454781473,
-0.1404287964,
-0.026226921,
-0.4189308882,
0.1473215371,
0.3714238405,
0.1580148637,
0.1390684694,
-0.011535815,
-0.1583790034,
-0.0784909874,
0.0356109478,
-0.5600673556,
-0.1644399762,
-0.025775753,
-0.0694186166,
-0.2995333672
] |
https://github.com/huggingface/datasets/issues/1790 | ModuleNotFoundError: No module named 'apache_beam', when specific languages. | Hi @miyamonz,
I tried replicating this issue using the same snippet used by you. I am able to download the dataset without any issues, although I stopped it in the middle because the dataset is huge.
Based on a similar issue [here](https://github.com/google-research/fixmatch/issues/23), it could be related to your environment setup, although I am just guessing here. Can you share these details? | ```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct? | 61 | ModuleNotFoundError: No module named 'apache_beam', when specific languages.
```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct?
Hi @miyamonz,
I tried replicating this issue using the same snippet used by you. I am able to download the dataset without any issues, although I stopped it in the middle because the dataset is huge.
Based on a similar issue [here](https://github.com/google-research/fixmatch/issues/23), it could be related to your environment setup, although I am just guessing here. Can you share these details? | [
-0.0868909806,
0.1544121802,
0.034921281,
0.2511789203,
0.3533329964,
0.1083715335,
0.3212843537,
0.4499051571,
0.3734619021,
0.0088105854,
0.1023254767,
0.0063316659,
-0.0099076126,
-0.0225595571,
-0.0207930878,
-0.2547833025,
0.1721133143,
0.0012148418,
-0.2130485773,
-0.2989025712,
-0.3872272372,
0.0866744593,
-0.3275979161,
0.0159582328,
-0.0521655791,
0.1556020528,
-0.0279717147,
0.1574118733,
0.0401066802,
-0.1749255955,
0.2103826851,
-0.1249949411,
-0.0505452789,
0.3043379784,
-0.000107928,
0.0701227188,
0.4934639931,
-0.2194037586,
-0.3645664454,
-0.4068617523,
-0.0887664929,
-0.3472993672,
0.021476008,
-0.4108134508,
-0.1609842628,
-0.1692380607,
0.027584644,
-0.4244210124,
0.2876332998,
0.2971322834,
0.2558146417,
0.3765886724,
0.1853017658,
-0.0902391523,
0.4627017975,
-0.2508677244,
-0.1734850705,
0.1522738189,
0.1026160195,
-0.0133815892,
0.0926946923,
0.4647523165,
-0.332159996,
0.1229281127,
0.3978906572,
-0.210409373,
-0.1099660769,
-0.5223606825,
0.1911681592,
0.2853014469,
0.8053056598,
-0.3187530935,
-0.2136244625,
-0.0639344081,
-0.0466215909,
0.0935500786,
0.166907087,
0.1960048229,
-0.1385708749,
0.0132208709,
0.2564673424,
-0.27760759,
-0.1129507869,
0.2547969818,
0.0206990652,
0.434543401,
0.113051407,
0.2906377316,
-0.1213330105,
-0.1309855282,
0.0601090565,
-0.3038207889,
0.179028973,
0.4227375686,
-0.3936534524,
0.0983674452,
0.0753657445,
0.0314878188,
0.2047478259,
-0.0097006029,
-0.1731486171,
0.2701096237,
0.178129226,
0.0558499657,
0.1880671829,
0.242536068,
0.2048564255,
0.2180307359,
0.3791832924,
-0.0918195173,
-0.0715205073,
0.0213903859,
0.0087916534,
-0.3030605316,
-0.2551549971,
0.206525296,
0.3416901231,
-0.2393629998,
-0.2113461494,
0.1680406928,
-0.3932997286,
-0.1952903569,
-0.1890360713,
0.4464723766,
0.0903827175,
0.3386280239,
0.1270756721,
0.3620223999,
-0.2277980596,
-0.4340923429,
-0.1698251963,
0.2832835019,
-0.2518641949,
0.1006731391,
0.1977662891,
0.1170085967,
0.1428785622,
-0.1512924284,
0.0498558469,
0.0672361255,
0.1198380068,
0.0282124355,
-0.0978276655,
0.3394678533,
0.1440698504,
0.5026989579,
0.1971621215,
-0.0773210078,
-0.1979626715,
0.0690229908,
-0.3356410265,
-0.0876069367,
0.0300216787,
0.1454828531,
-0.4106611907,
0.1392476261,
0.0276991725,
-0.1609507501,
-0.02605699,
-0.1307490468,
0.0702850521,
-0.0336304754,
-0.0718868077,
-0.3641682267,
0.1907553077,
0.7568347454,
-0.1171795428,
-0.0507882386,
0.1492204368,
-0.0326978005,
-0.0346769057,
0.0621210113,
-0.0179949384,
0.089755021,
-0.2658486366,
0.049391292,
0.5301238894,
-0.4971590638,
-0.3745909631,
0.149223119,
-0.1303746104,
0.0674141347,
0.1934700459,
0.0981658623,
-0.2233921885,
-0.0491436943,
-0.0737071931,
0.321620822,
0.1220700964,
0.1127695516,
-0.3805290461,
-0.0859911814,
0.2065781504,
0.1555687785,
0.218037352,
0.0378916822,
0.2462634146,
0.176445961,
0.1007472053,
-0.2408955544,
0.230017215,
0.4026341438,
0.0822456479,
-0.0768727362,
0.2185533941,
-0.0472878926,
-0.3427562118,
0.3855519593,
-0.2262896895,
0.253264904,
-0.126678884,
0.0323278271,
-0.245829165,
-0.0815850794,
-0.3950967491,
-0.3153589368,
0.1326068044,
-0.0861046389,
0.1729104668,
0.4195106626,
-0.0904737934,
0.547996521,
-0.0806824043,
0.0869767815,
-0.3802216053,
0.3531744182,
-0.1568664312,
-0.0223211218,
0.0899970233,
0.1627473384,
0.2166810334,
-0.2049011141,
-0.1471846998,
0.2453874648,
0.0316127203,
0.1753814965,
0.0656093433,
-0.1363480687,
0.1981261224,
-0.417429626,
0.2811173201,
0.305963248,
0.2019190043,
0.0005685532,
-0.0248594936,
0.3194140196,
0.2762658298,
0.3443270028,
0.1001222879,
0.1419813484,
0.1740660369,
-0.1156532168,
-0.1184248403,
-0.2050985694,
0.3828373253,
0.2041461319,
0.264770031,
-0.0008263875,
0.0527260154,
-0.1929024011,
0.4928576648,
-0.0328531936,
0.3465647399,
-0.0434928946,
-0.455396235,
0.1410555989,
0.0728565007,
0.0346842371,
0.3330878913,
0.1398337036,
-0.165471077,
0.1523961425,
0.1527924836,
-0.0811330602,
0.0703576431,
0.0401982255,
0.2829311192,
0.1309207827,
-0.0361877419,
0.050258033,
-0.1252745688,
-0.0067714439,
-0.2078783065,
0.1457993388,
-0.291956991,
0.0663337186,
-0.3126633763,
-0.3919142187,
-0.1884227693,
0.250411123,
-0.4732927978,
-0.3105265498,
-0.1453040838,
-0.0280138645,
-0.198622629,
0.2472378165,
-0.0033547645,
-0.1925318092,
0.1633856893,
-0.4583187401,
-0.1651171595,
-0.3762445748,
-0.3328975439,
0.017306909,
0.3358546197,
0.1337058395,
0.2784572542,
-0.2997747362,
0.0515952632,
-0.4177364111,
-0.2721672058,
0.1581749767,
-0.0346399918,
0.0360917039,
0.0005482159,
0.4427487254,
-0.0048961174,
0.0365112126,
0.3516401052,
-0.2354395539,
-0.1929250211,
0.3119668961,
0.0282664932,
-0.0133798383,
0.0411227047,
-0.6374547482,
-0.3070064187,
-0.4252648652,
-0.1391489953,
0.0489381887,
-0.0108335633,
0.0516512096,
0.1416079849,
-0.0006670149,
0.0320222192,
-0.008255682,
-0.0140779782,
0.132750079,
0.5062488317,
-0.1456730813,
-0.5656458735,
0.3194143474,
-0.1603343189,
0.0624307469,
0.195693627,
-0.195565179,
-0.0620265864,
0.137566179,
-0.0365846194,
0.0259969532,
0.292680949,
0.3939030468,
-0.25718081,
0.0382182151,
-0.1365454346,
0.0062152343,
-0.0437450856,
-0.0114896307,
0.2950164974,
0.2645324767,
0.1776742786,
-0.0364729948,
0.7936726809,
0.00735409,
0.2100250274,
0.4813814759,
0.0773184523,
0.2936624885,
-0.3421627879,
-0.1942971796,
0.0083297314,
-0.0027576543,
0.014970364,
0.1873182803,
-0.0818460807,
-0.1355631351,
-0.644276619,
-0.3588295877,
-0.2766450644,
-0.3226228356,
0.0453202464,
-0.2160212398,
0.1843607575,
0.2023991644,
0.0938605964,
0.0738987997,
-0.1065474898,
0.2340163738,
0.2605073154,
-0.175954029,
0.0929547995,
-0.1118321344,
-0.1769471169,
-0.3282278478,
0.4158120751,
0.0226238705,
0.2022847235,
0.0030379202,
-0.2317768633,
0.0856689811,
0.0189484842,
0.4692162573,
-0.3120106757,
-0.0437583663,
0.1216038391,
0.2594096959,
-0.5550557971,
-0.1870957315,
-0.0322665907,
0.032129623,
-0.0438287146,
0.1810925603,
-0.2550391853,
-0.0802218094,
0.0668696612,
0.454551965,
-0.0828831196,
-0.1274316162,
-0.436799854,
-0.0502199829,
-0.5733696818,
-0.0828640088,
-0.0977897346,
0.1422576308,
0.0972931683,
0.1623548269,
0.0961019993,
-0.0142737702,
-0.0320801958,
-0.0085723521,
0.3404171765,
-0.2043997049,
-0.0354573913,
0.0853669867,
0.1748306602,
0.0460115187,
0.456700474,
0.103470996,
-0.4493018687,
-0.0529025234,
-0.2239478081,
-0.0457784683,
0.1897383481,
-0.0751507878,
-0.2041160762,
-0.1439588815,
-0.085496828,
0.0563914925,
-0.0305151567,
0.0876145065,
-0.0236540753,
-0.435292691,
-0.3729907274,
0.5270693898,
-0.0330390483,
-0.0570131615,
0.3110022545,
0.1127653643,
-0.1070812941,
0.4222756028,
0.0187407769,
0.8645872474,
-0.018870756,
0.210195601,
0.0582885966,
-0.0400821716,
0.7248640656,
-0.5399269462,
0.0771638453,
-0.2701840103,
0.0008100059,
-0.0879066437,
-0.1371292174,
0.3018960357,
0.0046133525,
-0.0912818983,
0.7011969686,
0.1136353612,
0.3072916567,
-0.0284122527,
0.1268318295,
-0.2231795788,
0.0247503743,
-0.2159256637,
0.0936155692,
-0.2517370284,
0.7930033207,
-0.114682816,
-0.1685600281,
-0.3997271955,
-0.4847643077,
-0.2735729814,
0.2067972571,
-0.3265918195,
0.1057647541,
-0.1365811527,
-0.2755324841,
-0.0160136912,
0.1685112417,
0.3396864831,
0.0835613906,
-0.3524110615,
0.1991567761,
-0.0432496481,
-0.0633540675,
-0.0457836203,
0.0030714765,
0.2717383504,
-0.0967705399,
-0.2318739146,
0.1485336423,
-0.2545041442,
-0.1019378826,
-0.115730226,
0.0610879473,
0.3317452371,
0.2247248739,
-0.2792204618,
0.2246248871,
0.1533651054,
-0.063028492,
0.1800224632,
-0.0494342409,
-0.0303300805,
-0.0032992808,
-0.1809819192,
-0.2474682927,
-0.1228530183,
0.5205885172,
0.1839737743,
-0.2424338609,
0.4066538215,
0.1723617017,
-0.2104173005,
-0.2410999388,
0.1621389687,
0.1905710548,
-0.265022099,
-0.1460514665,
-0.0318618342,
0.0957715288,
-0.1386878788,
0.167730853,
-0.0113466857,
-0.1096295863,
0.0953373909,
-0.4442574978,
-0.0326410271,
0.1852377057,
-0.0854346082,
-0.101063624,
0.0033142075,
0.0053182961,
0.4032239616,
-0.2971629798,
-0.2888949811,
-0.1376588196,
-0.1059078127,
0.0224618111,
0.5605171919,
0.293512553,
0.0023231581,
-0.058145415,
0.093764849,
-0.1268182248,
-0.1937803477,
-0.2027929872,
-0.0149477432,
0.1385531276,
0.0434804074,
0.1630504429,
0.0703656152,
-0.4823303521,
0.2021601796,
-0.1527928114,
0.0567931868,
0.2536280453,
-0.199474439,
0.1771408916,
0.1085898429,
0.1843017042,
-0.3525301218,
0.2674994171,
-0.3646934628,
0.1721935421,
0.1304798871,
0.0686092228,
0.3867251277,
0.1516539156,
-0.1735510975,
-0.1742300838,
-0.3743777573,
-0.0482580774,
0.2108212709,
-0.1414894462,
-0.0068630474,
0.1340984255,
0.1062336192,
0.2562636435,
-0.3503275812,
-0.1075854227,
0.1836729497,
0.1969269961,
-0.4555109739,
-0.0751977265,
0.4037581086,
-0.1358787417,
-0.0214964822,
0.1843522191,
0.2636781931,
-0.2410951108,
0.3059704006,
0.1916550696,
0.3945595026,
-0.1170291454,
0.3011955321,
0.3527541757,
0.1779987812,
0.1396122873,
-0.0304128677,
0.0474550687,
0.1353858709,
0.6484869719,
-0.2091656029,
0.4114723206,
0.0674021468,
0.1030041948,
-0.2624191046,
-0.3011832535,
0.2992066145,
0.2204037309,
-0.0695171282,
0.0292885676,
-0.02401614,
-0.0019987503,
0.0860408694,
-0.0565789007,
-0.1585499942,
0.1666674018,
0.0012737643,
0.2253452837,
0.017971402,
-0.351901114,
-0.072907865,
0.1331724077,
0.0312034208,
-0.2385889888,
0.2281274945,
0.1682944447,
-0.1240407377,
-0.1239721999,
0.3742432594,
-0.1189198941,
0.0136318579,
-0.1376558989,
0.0254040174,
0.0463539027,
-0.1598246992,
0.0069208383,
0.1635753512,
0.260630101,
0.3488026857,
-0.2866473794,
-0.0238139071,
0.178434059,
-0.067525357,
-0.0155991232,
0.0920841172,
-0.0621976778,
-0.0524860993,
0.2890608907,
0.1136480123,
-0.1780465394,
0.0953822136,
0.043313127,
-0.0369700156,
-0.2705108821,
-0.0533742383,
-0.3792496622,
0.0871788636,
-0.3402259648,
0.0389809906,
-0.6098290086,
-0.0060964157,
0.1512968093,
0.1895903051,
-0.006375771,
-0.3605641127,
0.0605464354,
-0.1073406935,
0.3097569942,
0.4319079518,
0.1203089505,
-0.3997268975,
-0.2315179259,
-0.7111358047,
0.2788397968,
-0.4106047451,
0.1450008303,
-0.1495791823,
0.0707300752,
0.0984139964,
0.2337603122,
0.1786877662,
0.3277378976,
-0.2366160154,
0.1039686203,
-0.3699015677,
-0.3021473289,
-0.2403442413,
-0.0011572673,
-0.1039975882,
-0.3225292861,
0.1565544605,
-0.1339521557,
0.0949149653,
-0.1408352256,
-0.3069469631,
0.3905304968,
-0.0223495811,
0.5410963893,
0.0151771866,
0.4371800125,
0.0846311077,
0.0127382614,
-0.0869755968,
-0.0852239728,
-0.1114195287,
0.1609826833,
-0.0790183842,
0.0597910099,
-0.1316002905,
-0.163412869,
-0.2565715313,
0.4323997796,
0.1219810992,
0.1696544886,
-0.1993856132,
0.0667921007,
0.0294770598,
0.1640387774,
-0.1357732415,
-0.0447175987,
-0.2038329095,
-0.0330541991,
-0.3078815639,
-0.2646475434,
0.2891612351,
-0.4281413555,
-0.3605466485,
-0.0024639575,
0.1913997531,
-0.2226691693,
0.0112382676,
-0.3648003042,
0.2167714238,
0.3255022466,
0.1010456979,
-0.1234169453,
-0.012208743,
-0.145468697,
-0.0881905705,
0.0029761111,
-0.3081104755,
0.0867413357,
-0.1296567768,
0.0083830971,
-0.2291346043
] |
https://github.com/huggingface/datasets/issues/1790 | ModuleNotFoundError: No module named 'apache_beam', when specific languages. | thanks for your reply and sorry for my late response.
## environment
my local machine environment info
- Ubuntu on WSL2
`lsb_release -a`
```
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
```
RTX 2070 super
Inside WSL, there is no nvidia-msi command. I don't know why.
But, `torch.cuda.is_available()` is true and when I start something ML training code GPU usage is growing up, so I think it works.
From PowerShell, there is nvidia-smi.exe and result is below.
```
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.05 Driver Version: 470.05 CUDA Version: 11.3 |
|-------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... WDDM | 00000000:09:00.0 On | N/A |
| 0% 30C P8 19W / 175W | 523MiB / 8192MiB | 3% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1728 C+G Insufficient Permissions N/A |
| 0 N/A N/A 3672 C+G ...ekyb3d8bbwe\YourPhone.exe N/A |
| 0 N/A N/A 6304 C+G ...2txyewy\TextInputHost.exe N/A |
| 0 N/A N/A 8648 C+G C:\Windows\explorer.exe N/A |
| 0 N/A N/A 9536 C+G ...y\ShellExperienceHost.exe N/A |
| 0 N/A N/A 10668 C+G ...5n1h2txyewy\SearchApp.exe N/A |
| 0 N/A N/A 10948 C+G ...artMenuExperienceHost.exe N/A |
| 0 N/A N/A 11988 C+G ...8wekyb3d8bbwe\Cortana.exe N/A |
| 0 N/A N/A 12464 C+G ...cw5n1h2txyewy\LockApp.exe N/A |
| 0 N/A N/A 13280 C+G ...upport\CEF\Max Helper.exe N/A |
| 0 N/A N/A 15948 C+G ...t\GoogleIMEJaRenderer.exe N/A |
| 0 N/A N/A 16128 C+G ...ram Files\Slack\Slack.exe N/A |
| 0 N/A N/A 19096 C+G ...8bbwe\WindowsTerminal.exe N/A |
+-----------------------------------------------------------------------------+
```
I don't know what should I show in such a case. If it's not enough, please tell me some commands.
---
## what I did
I surveyed more and I found 2 issues.
About the first one, I wrote it as a new issue.
https://github.com/huggingface/datasets/issues/2031
The error I mentioned in the previous comment above, which occurred on my local machine, is no longer occurring.
But, it still failed. In the previous comment, I wrote `AssertionError: OutputStream realloc failed.` happen on another machine. It also happens on my local machine.
Here's what I've tried.
the wikipedia.py downloads these xml.bz2 files based on dumpstatus.json
In Japanese Wikipedia dataset that I specified, it will download these 6 files.
`https://dumps.wikimedia.org/jawiki/20210120/dumpstatus.json`
and filtered json based on wikipedia.py is below.
```json
{
"jobs": {
"articlesmultistreamdump": {
"files": {
"jawiki-20210120-pages-articles-multistream1.xml-p1p114794.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream1.xml-p1p114794.bz2"
},
"jawiki-20210120-pages-articles-multistream2.xml-p114795p390428.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream2.xml-p114795p390428.bz2"
},
"jawiki-20210120-pages-articles-multistream3.xml-p390429p902407.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream3.xml-p390429p902407.bz2"
},
"jawiki-20210120-pages-articles-multistream4.xml-p902408p1721646.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream4.xml-p902408p1721646.bz2"
},
"jawiki-20210120-pages-articles-multistream5.xml-p1721647p2807947.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream5.xml-p1721647p2807947.bz2"
},
"jawiki-20210120-pages-articles-multistream6.xml-p2807948p4290013.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream6.xml-p2807948p4290013.bz2"
}
}
}
}
}
```
So, I tried running with fewer resources by modifying this line.
https://github.com/huggingface/datasets/blob/13a5b7db992ad5cf77895e4c0f76595314390418/datasets/wikipedia/wikipedia.py#L524
I changed it like this. just change filepaths list.
` | "Initialize" >> beam.Create(filepaths[:1])`
and I added a print line inside for the loop of _extract_content.
like this `if(i % 100000 == 0): print(i)`
first, without modification, it always stops after all _extract_content is done.
- `filepaths[:1]` then it succeeded.
- `filepaths[:2]` then it failed.
I don't try all patterns because each pattern takes a long time.
### my opinion
It seems it's successful when the entire file size is small.
so, at least it doesn't file-specific issue.
I don't know it's true but I think when beam_writter writes into a file, it consumes memory depends on its entire file.
but It's correct Apache Beam's behavior? I'm not familiar with this library.
| ```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct? | 606 | ModuleNotFoundError: No module named 'apache_beam', when specific languages.
```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct?
thanks for your reply and sorry for my late response.
## environment
my local machine environment info
- Ubuntu on WSL2
`lsb_release -a`
```
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
```
RTX 2070 super
Inside WSL, there is no nvidia-msi command. I don't know why.
But, `torch.cuda.is_available()` is true and when I start something ML training code GPU usage is growing up, so I think it works.
From PowerShell, there is nvidia-smi.exe and result is below.
```
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.05 Driver Version: 470.05 CUDA Version: 11.3 |
|-------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... WDDM | 00000000:09:00.0 On | N/A |
| 0% 30C P8 19W / 175W | 523MiB / 8192MiB | 3% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1728 C+G Insufficient Permissions N/A |
| 0 N/A N/A 3672 C+G ...ekyb3d8bbwe\YourPhone.exe N/A |
| 0 N/A N/A 6304 C+G ...2txyewy\TextInputHost.exe N/A |
| 0 N/A N/A 8648 C+G C:\Windows\explorer.exe N/A |
| 0 N/A N/A 9536 C+G ...y\ShellExperienceHost.exe N/A |
| 0 N/A N/A 10668 C+G ...5n1h2txyewy\SearchApp.exe N/A |
| 0 N/A N/A 10948 C+G ...artMenuExperienceHost.exe N/A |
| 0 N/A N/A 11988 C+G ...8wekyb3d8bbwe\Cortana.exe N/A |
| 0 N/A N/A 12464 C+G ...cw5n1h2txyewy\LockApp.exe N/A |
| 0 N/A N/A 13280 C+G ...upport\CEF\Max Helper.exe N/A |
| 0 N/A N/A 15948 C+G ...t\GoogleIMEJaRenderer.exe N/A |
| 0 N/A N/A 16128 C+G ...ram Files\Slack\Slack.exe N/A |
| 0 N/A N/A 19096 C+G ...8bbwe\WindowsTerminal.exe N/A |
+-----------------------------------------------------------------------------+
```
I don't know what should I show in such a case. If it's not enough, please tell me some commands.
---
## what I did
I surveyed more and I found 2 issues.
About the first one, I wrote it as a new issue.
https://github.com/huggingface/datasets/issues/2031
The error I mentioned in the previous comment above, which occurred on my local machine, is no longer occurring.
But, it still failed. In the previous comment, I wrote `AssertionError: OutputStream realloc failed.` happen on another machine. It also happens on my local machine.
Here's what I've tried.
the wikipedia.py downloads these xml.bz2 files based on dumpstatus.json
In Japanese Wikipedia dataset that I specified, it will download these 6 files.
`https://dumps.wikimedia.org/jawiki/20210120/dumpstatus.json`
and filtered json based on wikipedia.py is below.
```json
{
"jobs": {
"articlesmultistreamdump": {
"files": {
"jawiki-20210120-pages-articles-multistream1.xml-p1p114794.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream1.xml-p1p114794.bz2"
},
"jawiki-20210120-pages-articles-multistream2.xml-p114795p390428.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream2.xml-p114795p390428.bz2"
},
"jawiki-20210120-pages-articles-multistream3.xml-p390429p902407.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream3.xml-p390429p902407.bz2"
},
"jawiki-20210120-pages-articles-multistream4.xml-p902408p1721646.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream4.xml-p902408p1721646.bz2"
},
"jawiki-20210120-pages-articles-multistream5.xml-p1721647p2807947.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream5.xml-p1721647p2807947.bz2"
},
"jawiki-20210120-pages-articles-multistream6.xml-p2807948p4290013.bz2": {
"url": "/jawiki/20210120/jawiki-20210120-pages-articles-multistream6.xml-p2807948p4290013.bz2"
}
}
}
}
}
```
So, I tried running with fewer resources by modifying this line.
https://github.com/huggingface/datasets/blob/13a5b7db992ad5cf77895e4c0f76595314390418/datasets/wikipedia/wikipedia.py#L524
I changed it like this. just change filepaths list.
` | "Initialize" >> beam.Create(filepaths[:1])`
and I added a print line inside for the loop of _extract_content.
like this `if(i % 100000 == 0): print(i)`
first, without modification, it always stops after all _extract_content is done.
- `filepaths[:1]` then it succeeded.
- `filepaths[:2]` then it failed.
I don't try all patterns because each pattern takes a long time.
### my opinion
It seems it's successful when the entire file size is small.
so, at least it doesn't file-specific issue.
I don't know it's true but I think when beam_writter writes into a file, it consumes memory depends on its entire file.
but It's correct Apache Beam's behavior? I'm not familiar with this library.
| [
-0.0164618678,
-0.1208428219,
-0.0449259691,
0.1289525926,
0.3602371216,
0.0117901508,
0.4635161459,
0.3990748525,
0.2657026649,
0.2212448716,
0.3692161143,
-0.0926491693,
0.0788545087,
-0.0503800772,
0.3171316981,
-0.3475855887,
0.389339447,
-0.102307491,
-0.0446153246,
-0.2853877544,
-0.3970679641,
0.0972743258,
-0.3274345696,
0.2043332607,
-0.2763908803,
0.3834487796,
0.0855949819,
0.0011821893,
0.2684018314,
-0.0742643923,
0.0483056493,
-0.3112157285,
0.2795861363,
0.1183505058,
-0.0001173796,
0.1539296657,
0.2787108421,
-0.3796843886,
-0.2545410395,
-0.3259485662,
0.1180821508,
-0.5497902632,
0.0536577068,
-0.4102146327,
-0.3081612885,
-0.3167406917,
-0.0167244989,
-0.3641587496,
0.2351647168,
0.2283264995,
0.1696380377,
0.2152369022,
-0.0553047992,
0.0463572107,
0.4933217466,
0.0602148734,
-0.3058099151,
-0.0181189198,
0.0697606951,
0.0744795799,
0.1465841383,
0.6420864463,
-0.231460765,
-0.0152310915,
0.0673134774,
-0.016785834,
0.1663648933,
-0.3263396025,
0.1945958287,
0.0899542272,
0.4828101695,
-0.2662921548,
-0.016271865,
0.0410083421,
-0.1090238467,
-0.1496425271,
0.2806897759,
0.2335035801,
-0.2153159976,
0.0255011562,
0.446775943,
-0.0751213729,
0.0193944611,
0.1508822441,
-0.0414786413,
0.6642959714,
0.0698073506,
0.3139584064,
-0.1830179691,
-0.038737338,
-0.2058110535,
-0.1763623357,
0.2024043798,
0.1869179606,
-0.4122222066,
0.0578315295,
0.1730616242,
-0.1539802998,
-0.1882953048,
0.0296370629,
-0.2198072076,
0.02295422,
0.5886100531,
0.0437285043,
-0.1492432058,
0.1641064733,
0.2641572058,
-0.1119216383,
0.2892178595,
-0.2116502672,
-0.052946277,
-0.0375727266,
-0.1176790372,
-0.3208052516,
-0.611405015,
0.2161325365,
0.3799573481,
-0.1107204705,
-0.3758542538,
0.0015662601,
-0.784484446,
-0.1767553389,
-0.0009918434,
0.5293396711,
0.2928490639,
0.4186643958,
0.289136976,
0.2036615759,
-0.2172861993,
-0.3478891551,
-0.0793720409,
0.2945081294,
-0.3448714018,
0.2523286045,
0.1170188934,
0.1859698594,
0.2121744603,
-0.2013958395,
-0.0995039344,
0.0343452096,
0.0177219938,
-0.0544660799,
0.1690148562,
0.4799576998,
0.0484014489,
0.4080633521,
0.2257785052,
0.0116722453,
-0.1172761545,
0.2429513335,
-0.1548590213,
-0.3944119811,
-0.146882236,
0.0511060804,
-0.0167562608,
0.1968869567,
0.3628742993,
0.0426821746,
0.1228848323,
0.0123577565,
0.2530311644,
0.0178574231,
-0.1054159999,
-0.2124257237,
0.2507416904,
0.5459204316,
-0.3039045334,
-0.1106561124,
0.3961589634,
-0.1053836048,
-0.0786057636,
0.1152246967,
-0.0978567749,
0.1636814475,
-0.2283569723,
-0.0972191542,
0.4880373478,
-0.5070935488,
-0.0110670822,
0.0804195702,
-0.1673004031,
-0.1454683989,
0.4160166383,
-0.0158102699,
-0.2155858725,
-0.1384606808,
-0.2177504301,
0.0179401301,
0.0955033004,
-0.0426161177,
-0.2979277372,
-0.0848432779,
0.2965355515,
0.2143165916,
0.2368060201,
-0.1862460524,
0.106600903,
0.7018896937,
0.1804239303,
-0.1468918622,
0.1232181117,
0.1206344143,
0.201799646,
-0.0314942114,
0.2057332247,
0.0816738158,
-0.3195109665,
0.1778331399,
-0.1611636579,
0.2450399399,
-0.0391565226,
0.0096768662,
0.1222385019,
-0.0296210032,
-0.1899359226,
-0.4091176093,
0.0764830559,
0.118289344,
0.0033132755,
0.2217070907,
-0.3516418338,
0.2491336465,
-0.6650173068,
0.023083888,
-0.1228883639,
0.0653186366,
-0.2248589098,
-0.1393242478,
-0.2083539665,
0.2041691691,
0.1631703973,
-0.2657232583,
-0.0550112948,
-0.0124197798,
0.086343579,
-0.1019484252,
-0.1688936055,
0.10010539,
0.1083896235,
-0.1080821082,
0.3500639796,
0.075937219,
0.219000265,
0.0002389218,
-0.0466161035,
0.190219298,
0.391353935,
0.4031086266,
0.0441155545,
-0.0826885402,
0.1671352237,
-0.0675749257,
-0.232024163,
-0.2165592015,
0.1896585077,
0.3165906072,
0.0288631152,
-0.0392218977,
0.0378777012,
-0.1052472219,
0.5922948122,
0.1246693507,
0.297246933,
-0.0710369051,
-0.3637949824,
0.1717134565,
0.2669871449,
-0.1361999065,
0.3765209615,
0.1118713021,
-0.2514682412,
0.074088484,
0.1832261086,
-0.1975178272,
0.1446843892,
0.0935381576,
0.1617264152,
0.1095689237,
-0.1530918628,
-0.0049603535,
-0.1756979227,
0.0117728868,
-0.0014161806,
-0.1109334379,
-0.2594309747,
0.1029186621,
-0.3478598297,
-0.485915482,
-0.2813385427,
0.0404136702,
-0.2785393596,
-0.0732486993,
-0.1160380617,
-0.0294322111,
-0.2187063843,
0.4304549694,
0.2571212053,
0.0219325181,
-0.0411654301,
-0.3306415379,
-0.102605477,
-0.2048812658,
-0.2449600995,
-0.0036244548,
0.3105492592,
0.1761790663,
0.255048573,
-0.3488145769,
0.0870179683,
-0.1086342186,
-0.3360553384,
0.1465451866,
0.0418367125,
-0.2310841531,
-0.1000547409,
0.1832407117,
0.0651180148,
-0.0239214599,
0.4265316725,
-0.1253952235,
-0.1427242905,
-0.0013664747,
-0.0498998389,
-0.0958695412,
-0.1020316929,
-0.496443361,
-0.2645771503,
-0.4758715034,
-0.4259919822,
0.2412473857,
0.0810971186,
-0.128132239,
0.1606527865,
0.2923528254,
-0.1703211367,
0.0371361598,
0.0311212316,
0.207980901,
0.2317314744,
-0.0090699056,
-0.3604699969,
0.4372161627,
-0.084203802,
0.0385989435,
0.1158175096,
-0.2603437304,
0.0137456963,
0.2989227474,
-0.0371981598,
-0.0009432243,
0.2632431984,
0.7203303576,
-0.2250905484,
0.0127089061,
-0.0141629269,
-0.329092145,
0.0510526635,
0.0073771002,
0.5198997259,
0.1697767526,
0.4387986958,
0.0848533735,
0.8618528843,
-0.0845358148,
-0.0700840503,
0.3741455674,
0.0939900652,
0.2071830481,
-0.3162723184,
-0.0314852521,
0.2195480764,
0.0864555091,
-0.0109637668,
0.1871256679,
-0.0883607119,
0.1706032008,
-0.5178009272,
-0.2898620665,
-0.011130048,
-0.1790736467,
0.3663790822,
-0.2854355574,
0.1987073272,
0.0410360806,
0.1937969476,
0.0469064787,
0.1392714381,
0.1639207006,
0.6295228601,
-0.012657023,
0.0139246965,
-0.1779279411,
-0.1202638373,
-0.1199806556,
0.2195672542,
0.0725234225,
0.2189495116,
-0.1290302277,
-0.474514246,
0.1856988668,
0.0349478014,
0.3213560283,
-0.0358856432,
-0.2871360481,
0.3316367567,
-0.232150957,
-0.3496998847,
-0.3062481284,
-0.0189682301,
-0.1487322599,
-0.057085976,
0.0013778643,
-0.0317173675,
-0.4585867226,
0.3761839569,
0.2340421677,
-0.2524056137,
-0.2274867147,
-0.4287630916,
-0.0469680093,
-0.5095893741,
0.0084899552,
-0.1324006766,
-0.1292976439,
0.0264416337,
0.1764397174,
-0.0690714121,
-0.201769948,
-0.056205906,
-0.0629934743,
0.0851253495,
-0.0699710622,
-0.2636387944,
-0.2326473594,
0.7186848521,
-0.1507542729,
-0.0402487442,
0.1925617903,
-0.001810387,
0.1199081987,
-0.1079839393,
0.2137890607,
0.4486491978,
-0.1768035591,
0.1594312638,
-0.2837941349,
-0.1207113788,
-0.1063010842,
-0.1808040887,
0.3044557869,
-0.0509131439,
-0.0430606678,
-0.3201408684,
0.6241832972,
-0.1073557734,
0.0044309744,
0.147189945,
0.1318544149,
-0.104413107,
0.3319959342,
0.2336581051,
1.035811305,
0.1642738581,
0.132445991,
0.1799948812,
0.1077854782,
0.8329395056,
-0.5984464288,
0.2173623294,
-0.085107334,
0.1365103424,
-0.1082871333,
-0.0818740875,
0.5945870876,
-0.0067096734,
0.0705298409,
0.3790997863,
0.2664603889,
0.6037871242,
0.0037627218,
-0.1099147126,
0.0355481058,
-0.1497259438,
-0.5489439368,
-0.0168925431,
-0.0744284764,
0.7894796729,
-0.2071016431,
-0.1128806993,
-0.2280255407,
-0.3641821742,
-0.09889552,
0.0411764234,
-0.2909250259,
0.1858051568,
-0.3828185201,
-0.3268054426,
-0.0402577072,
0.1437875181,
0.3549681902,
-0.0868405551,
-0.1235941052,
0.0426942147,
0.007606646,
0.0000146226,
-0.2081599981,
0.0367931426,
0.3847234845,
-0.2481490225,
-0.2196932137,
0.1634670794,
-0.1109331101,
-0.0494437441,
0.0160128456,
0.0696562901,
0.7141789794,
0.2927413285,
-0.2967755795,
0.3870976567,
0.0980725735,
0.0052477028,
0.0951582938,
-0.2514202595,
-0.1515534222,
-0.0723020732,
-0.21721071,
-0.1010130569,
-0.2248368412,
0.3276057839,
0.1999416202,
-0.0972821116,
0.2712370753,
0.1732696593,
-0.174106434,
-0.2119039744,
0.162362054,
0.0368800759,
-0.4369899631,
-0.2890704572,
0.302382946,
-0.1709166467,
-0.1562229842,
0.1783197224,
0.0681604594,
-0.1861295551,
-0.0853959545,
-0.2221889794,
-0.2340112329,
0.2098846585,
-0.1233102307,
-0.2150212377,
-0.0631810203,
0.2806889117,
0.4156888425,
-0.1537002325,
-0.2261552513,
-0.2628735304,
-0.1230094954,
0.1928090304,
0.442723453,
0.2965598702,
-0.0127698081,
0.189549759,
0.0074952431,
-0.0380017236,
-0.218623966,
-0.1312116086,
-0.0150047159,
0.1765696108,
0.2285007387,
0.1959928125,
0.1880877018,
-0.2676890492,
0.0865138024,
-0.0725879967,
0.0992606953,
0.1864971519,
-0.0894794762,
0.350802362,
-0.0306739602,
0.3316594362,
-0.4477112591,
0.2372738719,
-0.2499568313,
0.3688061237,
0.2676358819,
-0.0803977251,
0.4092097282,
0.2389475852,
-0.3746150136,
-0.152371034,
-0.3645436764,
0.0104732215,
-0.0546278097,
-0.0719812587,
-0.1021177173,
-0.1859801859,
-0.0245211869,
0.1607097685,
-0.3545149565,
-0.0365306102,
0.2327326387,
0.1266967803,
-0.4543904662,
0.3731454015,
0.2427685559,
-0.2154419124,
-0.0772719234,
0.306043148,
0.4231768548,
-0.0923661441,
0.3880968988,
0.1781985909,
0.0841991976,
-0.2030155957,
0.2066866755,
0.3618159294,
0.2963565588,
0.3598017693,
0.0202725045,
0.1120371222,
0.1950111389,
0.5736838579,
-0.1265516281,
0.5901020765,
0.1574229598,
0.3495476544,
-0.0969413966,
-0.1490584612,
0.3120420575,
0.3322594166,
-0.01469584,
-0.3303586543,
-0.2264350504,
-0.3042711914,
0.0454342365,
-0.1949992776,
-0.2628132701,
0.1808093488,
-0.1972091198,
0.0793898106,
-0.1102149338,
-0.1240671203,
-0.0704077184,
0.0157016162,
0.0519339293,
-0.1951787025,
-0.0949364752,
0.121505104,
-0.1331937015,
0.0533887111,
0.1281684339,
-0.0643570349,
0.030802099,
-0.0860057548,
0.0869322941,
0.1445925683,
-0.1378284544,
-0.0600602888,
0.0844448805,
0.219766438,
0.4621066153,
-0.0828694105,
-0.0258001052,
0.1449407786,
0.0030349714,
0.0541768521,
0.1591964364,
-0.0613806807,
0.2768365443,
0.2779886723,
0.0565827452,
-0.1591498852,
0.1218315512,
0.15829584,
-0.0883103088,
-0.2958940566,
0.2388641238,
-0.4307889044,
0.051020842,
-0.5330101252,
0.2233331352,
-0.3449478149,
-0.0787930638,
0.0157658551,
0.1041167602,
-0.0151450383,
-0.2899125516,
0.017829122,
-0.2573353648,
0.2379450649,
-0.0647527799,
0.0380460732,
-0.2512815595,
-0.230419293,
-0.3195028901,
0.1034676358,
-0.2553524077,
0.2922730744,
-0.2727170885,
0.1275991052,
0.1763636023,
0.2395234853,
-0.0413034447,
0.1959233731,
0.0757295862,
0.0428487211,
-0.3069567084,
-0.219702363,
-0.3401431143,
0.1160202622,
-0.1083827391,
-0.254575789,
-0.0424586385,
-0.2332200557,
-0.0129375448,
-0.3310773671,
-0.2316154242,
0.4752679169,
0.0814737454,
0.5481074452,
-0.0275502428,
0.2614422441,
0.1008104384,
-0.0696965531,
-0.0400294065,
0.039120134,
-0.2041770816,
0.1928941458,
0.0422974676,
0.0197435264,
-0.0921118185,
-0.1000734791,
-0.2449550331,
0.3905463815,
-0.0151443435,
-0.0077195088,
-0.1053687036,
0.0947116986,
-0.088548623,
0.068778187,
0.2280657887,
-0.0909727961,
-0.1401729733,
-0.1901366115,
-0.4491508305,
0.0603896938,
0.28304708,
-0.3310953379,
-0.1412519664,
-0.0922322273,
0.3614769578,
-0.2765082419,
0.0967675075,
-0.3255518377,
0.0648279339,
0.2081926614,
0.099997744,
0.0435724519,
0.1568869948,
0.0078007095,
-0.2377977967,
-0.0828834251,
-0.714918673,
-0.1067865491,
-0.0013869072,
-0.1434369087,
-0.4423045814
] |
https://github.com/huggingface/datasets/issues/1790 | ModuleNotFoundError: No module named 'apache_beam', when specific languages. | I don't know if this is related, but there is this issue on the wikipedia processing that you reported at #2031 (open PR is at #2037 ) .
Does the fix your proposed at #2037 helps in your case ?
And for information, the DirectRunner of Apache Beam is not optimized for memory intensive tasks, so you must be right when you say that it uses the memory for the entire file. | ```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct? | 72 | ModuleNotFoundError: No module named 'apache_beam', when specific languages.
```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct?
I don't know if this is related, but there is this issue on the wikipedia processing that you reported at #2031 (open PR is at #2037 ) .
Does the fix your proposed at #2037 helps in your case ?
And for information, the DirectRunner of Apache Beam is not optimized for memory intensive tasks, so you must be right when you say that it uses the memory for the entire file. | [
0.1117344648,
-0.0064414921,
0.0087710219,
0.3851287961,
0.376698494,
0.0904636085,
0.1866942942,
0.4343984425,
0.2380294055,
0.1273686588,
0.1705145091,
0.0224920511,
-0.0121388407,
-0.2175728083,
0.0293771736,
-0.3352377117,
0.2749055624,
-0.0193752274,
-0.1703933328,
-0.2335792035,
-0.3629104495,
0.1133486107,
-0.4148782194,
-0.1094511077,
-0.1601736695,
0.1928721815,
-0.0480315983,
0.0954622701,
0.1394947767,
-0.3413198888,
-0.1171519533,
-0.1067334041,
-0.0180486478,
0.3060229719,
-0.0001087955,
0.0912564546,
0.5745629072,
-0.1888058633,
-0.2846512794,
0.0406401381,
-0.0371730253,
-0.4954470694,
-0.0139749842,
-0.4732249379,
-0.0351132154,
-0.2119352072,
0.1526016891,
-0.3777805865,
0.3918658495,
0.1425276101,
0.2509560585,
0.2651478648,
0.0663075745,
-0.007842808,
0.5856631398,
-0.0968205035,
-0.0510735847,
-0.1122036874,
-0.2888482213,
-0.0498993099,
-0.2235360593,
0.5995767117,
-0.2624768317,
0.0702700987,
0.3599031866,
-0.2300792336,
-0.1492043287,
-0.4521155357,
0.3267111182,
0.1715230048,
0.8122543097,
-0.2932117879,
-0.1780868769,
-0.1161257699,
-0.1816052049,
0.0567492284,
0.2139711231,
0.3344721794,
-0.1897803545,
-0.0612508617,
0.4706634283,
-0.2275059223,
-0.0409825891,
0.0693849623,
0.0202941783,
0.3031225204,
0.0945488885,
0.1988317072,
0.1080077663,
-0.0590916127,
-0.0815233812,
-0.2535690665,
0.0567312501,
0.287417382,
-0.3248102963,
0.1121487841,
0.1160268113,
0.0625172481,
0.1234364659,
-0.263925463,
-0.2927087545,
0.2417604178,
0.2671031356,
0.0355524682,
0.2241144627,
0.1502584368,
0.0286992602,
0.1377188265,
0.5333327055,
-0.1961991489,
-0.1896422207,
-0.0155714005,
0.025725361,
-0.2397146672,
-0.0835572109,
-0.0701145455,
0.1421352476,
-0.1068671122,
-0.0019678266,
0.1800702512,
-0.2986364365,
-0.1659315825,
-0.2292383164,
0.5316999555,
0.0575341508,
0.5937870145,
0.2013930827,
0.1262186766,
-0.3433278501,
-0.2992620766,
-0.1430038214,
0.3405373096,
-0.3400126696,
0.2080899626,
0.0598624572,
0.220974803,
0.2671979964,
-0.1440650821,
0.0279359445,
-0.0987526774,
0.1566368043,
-0.171219185,
-0.0322682187,
0.447067678,
0.0875974298,
0.448697269,
0.1538456976,
-0.0098930411,
-0.0720624924,
0.2632386982,
-0.2432985306,
-0.3493453264,
0.2551337481,
0.117376551,
-0.2879621983,
0.2902913988,
0.0025139968,
-0.0284826942,
0.1678847373,
-0.0079857064,
0.0465840399,
-0.0180216953,
-0.2205020934,
-0.3830625713,
0.203221038,
0.7963464856,
-0.0692893192,
0.047790572,
0.0506921299,
-0.0662884861,
0.158443138,
0.1949174851,
-0.0704007223,
0.208695665,
-0.167657271,
-0.0316930898,
0.5124146342,
-0.5858021975,
-0.1874887049,
0.2188701183,
0.0223699249,
0.0330210812,
0.266482234,
0.1075236946,
-0.1900942624,
-0.1260580868,
-0.0653749481,
0.1762629896,
0.1519226581,
0.3302554488,
-0.5582461953,
0.0229575243,
0.081349574,
0.1652376503,
0.3261905909,
-0.0923689529,
-0.0132217854,
0.5644577742,
0.2360057533,
-0.277353853,
0.2775586843,
0.4496911764,
-0.145709902,
-0.0214723591,
0.3341242075,
-0.017070435,
0.0314777978,
0.2832884789,
-0.2546026707,
0.2395660132,
0.0171525832,
-0.1440321058,
-0.0935747772,
-0.0090362467,
-0.2172044665,
-0.3565834165,
0.1877317578,
-0.037038181,
-0.0251048561,
0.2928382754,
-0.0906114504,
0.3070316017,
-0.1983902007,
-0.044098299,
-0.3090108633,
0.0575742126,
-0.2160296142,
-0.0091514867,
0.0731726363,
0.0985507667,
0.1550629437,
-0.0391973816,
-0.1397495717,
0.2085855603,
0.2723043263,
0.0015522866,
0.0643666685,
-0.0344759561,
0.1558851004,
-0.2128018737,
0.3646450043,
0.2092393935,
0.2507328987,
-0.1380885094,
-0.011131444,
0.1207705736,
0.2412225008,
0.3808267415,
0.1354596615,
-0.0667672828,
0.064280808,
0.0613383912,
-0.0879729167,
-0.2283333242,
0.196417436,
0.3356743157,
0.0988570899,
0.0624625757,
0.0435920022,
-0.2446836978,
0.5019389391,
0.0910701454,
0.1994128674,
0.0351186022,
-0.5036809444,
-0.0295863971,
0.1220315695,
-0.1232214719,
0.204437688,
0.1894410104,
-0.0085469084,
-0.0047068121,
0.3041697145,
-0.0965254679,
0.2194779813,
0.1881991774,
0.3777444959,
0.0212146919,
0.0054693623,
-0.0665688962,
-0.10159868,
0.0596394204,
-0.1179075688,
0.18422243,
-0.1934271753,
-0.0259492956,
-0.2864807546,
-0.4760197401,
-0.1996368319,
0.3563887477,
-0.3619391024,
-0.2971886098,
-0.0733863264,
-0.0943987295,
-0.2513523698,
0.2048183829,
0.1730591208,
-0.0069652549,
0.0783340633,
-0.2935423851,
-0.1500488818,
-0.5236817002,
-0.2300800085,
0.0003819179,
0.3928465247,
0.0505260937,
0.2879630029,
-0.0820047706,
-0.0886783898,
-0.1884258986,
-0.0557332523,
0.0971690118,
0.0015285232,
-0.0784614682,
-0.1432335824,
0.4003279209,
0.0184106324,
0.0845484585,
0.3466522396,
-0.1144118533,
-0.0997575074,
0.1798040122,
0.1147884429,
0.1361715645,
0.0201297775,
-0.4075710773,
-0.1568488926,
-0.5240033269,
-0.0364499502,
0.1353273839,
0.1469873935,
-0.040976204,
0.1697187424,
0.0780950934,
0.1428805143,
0.1414457411,
-0.0451131091,
0.1010596231,
0.3315562606,
-0.1958373785,
-0.4916896522,
0.2615274489,
-0.1101641282,
0.0772579908,
0.2027610689,
-0.3696202338,
-0.1323046386,
0.0450657755,
-0.0470007844,
-0.0215640273,
0.3600572944,
0.4021163285,
-0.1137848049,
-0.0945900232,
-0.055474855,
-0.0545098968,
-0.1878402084,
-0.3114810586,
0.1262686253,
0.1768585145,
0.2660350204,
0.1244636402,
0.8918667436,
0.061335519,
0.5280165672,
0.4090193808,
0.106537275,
0.2370454073,
-0.3116823733,
-0.0100683337,
0.087122269,
-0.0212935489,
-0.1122223735,
0.2411686331,
0.0693528503,
-0.2553131878,
-0.4276474714,
-0.4160269797,
-0.2520229518,
-0.3027329147,
0.2996937633,
-0.1315900385,
0.2387936562,
0.1150134429,
0.1127486899,
-0.1054299921,
-0.0923343822,
0.2437112331,
0.1362130046,
0.1016863659,
-0.0783148482,
0.1050666273,
-0.0967989862,
-0.4224518836,
0.3081120849,
-0.0670120642,
0.0607822537,
0.0079728877,
-0.3941714168,
0.1360589266,
-0.1513962448,
0.5284689665,
-0.1971019655,
-0.1498374194,
0.2106809169,
-0.0545680635,
-0.6518242359,
-0.0845869184,
0.0267257448,
0.0095117521,
0.0669478923,
-0.0528254732,
-0.3164813519,
-0.1907037646,
0.1585881114,
0.4411771894,
-0.193405807,
-0.1890025437,
-0.5053489804,
-0.0205359086,
-0.56225425,
-0.0558287799,
-0.1067503691,
0.0558156259,
0.1581386924,
0.2365365922,
0.1242458075,
-0.0472103842,
-0.0412542336,
0.0051667616,
0.3255873621,
-0.2354881614,
-0.1083524078,
-0.0681348443,
0.1213601083,
-0.1879372597,
0.2294454277,
0.0457890406,
-0.1827740222,
-0.0938021764,
-0.079641141,
0.0277248062,
0.3150013983,
-0.0404919833,
-0.0408109166,
-0.1707969606,
-0.1193849221,
-0.1208505109,
0.0131124957,
0.1002242491,
-0.1311948299,
-0.2984966636,
-0.4836436212,
0.6179898977,
0.096046485,
-0.0949287638,
0.4127900898,
0.0930462554,
-0.2057655901,
0.57788831,
0.1268904209,
0.985617578,
-0.098003611,
0.2745048702,
0.0798083767,
0.0544578917,
0.6281548738,
-0.7983612418,
0.2477318197,
-0.295081377,
0.0890975967,
0.0915511474,
-0.0233629234,
0.2411327958,
-0.0934450701,
0.0697582737,
0.4806115627,
0.180444777,
0.2832385302,
-0.1868930012,
0.2330121249,
-0.1742580533,
-0.1990816593,
-0.2856556773,
0.1044498757,
-0.0655609071,
0.444069922,
-0.1535348594,
-0.0071034799,
-0.1861334145,
-0.2392895818,
-0.3046661615,
-0.009920205,
-0.1477643996,
0.1759127527,
-0.3943837881,
-0.3973291218,
-0.1162179261,
0.3625176251,
0.2008931637,
0.163995862,
-0.2189242542,
0.2082361579,
-0.1592372358,
-0.0306057539,
-0.1227030307,
0.1668753922,
0.2763909996,
-0.2980983555,
-0.1943887174,
0.0629002526,
-0.3802570105,
-0.1166153252,
-0.1380205899,
0.1541888416,
0.4423930943,
0.2177789211,
-0.3047640324,
0.2423823923,
-0.1472383887,
-0.0508676395,
0.1976381689,
-0.0842674598,
-0.1481403708,
0.1261873394,
-0.1883121729,
-0.1309754103,
-0.0109777786,
0.3976470232,
0.3433179557,
-0.0041508027,
0.4232972562,
0.0521043241,
-0.3017270565,
-0.2160416692,
0.1823891401,
-0.0104287649,
-0.1183825955,
0.0265464876,
0.1244936287,
-0.0301534124,
-0.2032161951,
-0.0371120498,
-0.0755900443,
-0.1407431811,
-0.0820232034,
-0.2634492218,
-0.2033627182,
0.2270507962,
-0.1080819368,
-0.101523973,
-0.0274178125,
0.0469671488,
0.2720536888,
-0.0508880094,
-0.3056166172,
-0.1709725261,
-0.0949800536,
0.2063297182,
0.3415113688,
0.2306924164,
0.0489353165,
0.1019948497,
0.0767377838,
0.1110588759,
-0.2087026983,
-0.2281424999,
0.0516659729,
0.1599778682,
0.0309398118,
0.0177850761,
0.198880583,
-0.391528815,
0.1825534403,
-0.3639065027,
0.1421439052,
0.1092842743,
-0.272272557,
0.2204235494,
0.1361769438,
0.270543009,
-0.171628952,
0.2488495559,
-0.228834182,
0.3137668967,
0.2543605566,
0.0372394994,
0.4439240694,
0.0092061833,
-0.3684695661,
-0.1206263229,
-0.2661691904,
-0.0666713864,
0.1150610298,
-0.101301007,
-0.188252911,
0.0767025948,
0.0809450075,
0.2771129906,
-0.18835181,
0.0011663995,
0.2110154331,
0.2167643458,
-0.298440069,
0.0378494859,
0.3729890883,
-0.3067618906,
-0.0739123598,
0.1783725917,
0.2772952616,
-0.116182752,
0.196516484,
0.2012997419,
0.1917830259,
-0.3311789334,
0.1913972646,
0.0333520956,
0.2625001073,
0.0091251796,
-0.0425490178,
-0.0267027505,
0.2035579085,
0.6850832701,
-0.1094502062,
0.5020678043,
0.2098354846,
0.1165132895,
-0.3393757641,
-0.3047338426,
0.362703383,
0.3669025898,
-0.0226040855,
0.0368798971,
-0.0835042521,
-0.0752132684,
0.2278699875,
-0.1050914302,
-0.1897900403,
0.2455680668,
-0.0877795964,
0.0067217196,
0.0493447185,
-0.2445985079,
0.0870343149,
0.2050685734,
0.1063701361,
-0.266458571,
0.1961644441,
0.2542014718,
-0.1388521641,
-0.0565974787,
0.447915256,
-0.0961100385,
0.2970236242,
-0.276293993,
-0.1655037403,
0.0654661208,
-0.0799275562,
-0.0222030822,
0.0861080289,
0.327760309,
0.3482869864,
-0.3159307539,
-0.0767403767,
0.0297199525,
-0.0269049499,
-0.0978558511,
0.1472107917,
-0.0032562127,
0.3576390147,
0.1961806864,
0.0948205665,
-0.2257529497,
-0.150610581,
0.21033521,
-0.1046939418,
-0.2842310965,
-0.0389176235,
-0.1862665415,
-0.2125802934,
-0.3217767477,
0.0565659367,
-0.461781323,
0.1619289219,
0.0885244235,
0.1317564696,
-0.1158986986,
-0.2898353934,
0.0823645219,
-0.1569629461,
0.3282440603,
0.1139905602,
0.122156769,
-0.3864792287,
-0.2317991555,
-0.5559619069,
0.1474360824,
-0.4531604946,
0.1083785966,
-0.1252705157,
0.2878430784,
0.0056684399,
0.1955993772,
-0.0177469626,
-0.0319791958,
-0.0608997308,
0.2072952539,
-0.4182606041,
-0.1043715402,
-0.2251000702,
-0.0161751285,
-0.0684763268,
-0.332456708,
0.0818642527,
-0.1801072508,
0.0814110786,
-0.0909271836,
-0.3238875866,
0.4874148071,
0.0769173279,
0.6690849662,
0.0324622542,
0.253243655,
0.0384893008,
-0.153632462,
-0.1856960952,
-0.0469214357,
-0.1451806426,
-0.0742818043,
0.0275630839,
0.2506352961,
-0.2115619332,
-0.2013022751,
-0.2911406457,
0.5944092274,
-0.1731041372,
0.2295297384,
0.0483157821,
-0.0574908741,
0.1654848009,
0.2090784162,
-0.1006285474,
0.0978661478,
-0.1423153579,
-0.1428383291,
-0.5927696228,
-0.2566540837,
0.3185787499,
-0.6523004174,
-0.3354022205,
0.027040571,
0.3586628139,
-0.2010261714,
-0.0247715469,
-0.4774935842,
0.1134857982,
0.2376120985,
0.2094259709,
-0.1371398717,
-0.0500028655,
-0.2336892039,
-0.0083020749,
-0.0635837018,
-0.3490172625,
-0.1845495254,
-0.2370744646,
-0.0594089366,
-0.3310348988
] |
https://github.com/huggingface/datasets/issues/1790 | ModuleNotFoundError: No module named 'apache_beam', when specific languages. | the #2037 doesn't solve my problem directly, but I found the point!
https://github.com/huggingface/datasets/blob/349ac4398a3bcae6356f14c5754483383a60e8a4/datasets/wikipedia/wikipedia.py#L523
this `beam.transforms.Reshuffle()` cause the memory error.
it makes sense if I consider the shuffle means. Beam's reshuffle seems need put all data in memory.
Previously I doubt that this line causes error, but at that time another bug showed in #2037 made error, so I can't found it.
Anyway, I comment out this line, and run load_dataset, then it works!
```python
wiki = datasets.load_dataset(
"./wikipedia.py",
cache_dir="./datasets",
beam_runner="DirectRunner",
language="ja",
date="20210120",
)["train"]
```
![image](https://user-images.githubusercontent.com/6331508/112283369-6a9f3300-8ccb-11eb-82e5-827bf7fddfb9.png)
Dataset has already shuffle function. https://github.com/huggingface/datasets/blob/349ac4398a3bcae6356f14c5754483383a60e8a4/src/datasets/arrow_dataset.py#L2069
So, though I don't know it's difference correctly, but I think Beam's reshuffle isn't be needed. How do you think? | ```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct? | 111 | ModuleNotFoundError: No module named 'apache_beam', when specific languages.
```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct?
the #2037 doesn't solve my problem directly, but I found the point!
https://github.com/huggingface/datasets/blob/349ac4398a3bcae6356f14c5754483383a60e8a4/datasets/wikipedia/wikipedia.py#L523
this `beam.transforms.Reshuffle()` cause the memory error.
it makes sense if I consider the shuffle means. Beam's reshuffle seems need put all data in memory.
Previously I doubt that this line causes error, but at that time another bug showed in #2037 made error, so I can't found it.
Anyway, I comment out this line, and run load_dataset, then it works!
```python
wiki = datasets.load_dataset(
"./wikipedia.py",
cache_dir="./datasets",
beam_runner="DirectRunner",
language="ja",
date="20210120",
)["train"]
```
![image](https://user-images.githubusercontent.com/6331508/112283369-6a9f3300-8ccb-11eb-82e5-827bf7fddfb9.png)
Dataset has already shuffle function. https://github.com/huggingface/datasets/blob/349ac4398a3bcae6356f14c5754483383a60e8a4/src/datasets/arrow_dataset.py#L2069
So, though I don't know it's difference correctly, but I think Beam's reshuffle isn't be needed. How do you think? | [
0.1194349378,
0.110886246,
0.0094728423,
0.4295068383,
0.5010865927,
0.0540744588,
0.1819474697,
0.4008019567,
-0.0547775179,
0.3162616789,
0.111268647,
0.0270882044,
-0.1956252307,
-0.30971542,
0.08737766,
-0.3430970311,
0.2697753012,
-0.0960950926,
-0.248987332,
-0.2321131378,
-0.3576428592,
0.0421391577,
-0.4852923751,
-0.1931641251,
-0.2590047717,
0.3534102738,
-0.1904879659,
0.2451302707,
-0.0117137395,
-0.1757078022,
-0.0820925012,
-0.1067038998,
-0.1121076867,
0.3131394386,
-0.0001133347,
0.1047416925,
0.3758172691,
-0.2779261172,
-0.3259072602,
-0.1989420503,
-0.0553082265,
-0.3000110984,
-0.162595287,
-0.3917809725,
-0.0717182755,
-0.2675778568,
0.1196644008,
-0.3548968136,
0.4223274887,
0.2012149245,
0.2053964138,
0.2258870006,
0.028129369,
-0.0164728146,
0.6700219512,
0.0871261284,
-0.1116376221,
0.0683365241,
-0.1488497406,
0.009839505,
-0.1615006924,
0.5495010614,
-0.2070957571,
0.0743290856,
0.2397664487,
-0.2371824384,
-0.2322133631,
-0.3541304767,
0.2216894478,
0.1782289296,
0.632361114,
-0.3489940166,
-0.1243471727,
-0.1607487053,
-0.0539472066,
0.1443855017,
0.2540587783,
0.1864248216,
-0.1200920716,
-0.1221164092,
0.1319262981,
-0.1353093386,
0.0127925482,
0.2098914683,
0.2306221575,
0.4240316749,
0.0276735164,
0.2996920049,
0.1630719751,
-0.183621496,
0.1571723819,
-0.2461176068,
0.0766196027,
0.3572934568,
-0.3937426507,
0.0347966887,
0.0281329658,
0.001492561,
0.1085037291,
-0.1232894734,
-0.1755147278,
0.1744699627,
0.3144144118,
-0.0094593521,
0.1199688539,
0.4047935307,
0.0989431739,
0.2647189796,
0.1185762435,
-0.1872930229,
-0.0639558583,
-0.0435257778,
-0.0904999822,
-0.4336494505,
-0.262034595,
0.2131782919,
0.1339183301,
-0.0305912867,
-0.1540098637,
0.0565461442,
-0.4272992015,
-0.1620936841,
-0.0612861887,
0.4848381579,
0.1439733654,
0.5003720522,
0.2122718543,
0.1486695111,
-0.2858891487,
-0.2623577416,
-0.2568902671,
0.4522443116,
-0.4812204242,
0.1976670772,
0.0383404903,
0.2481760383,
0.2800935209,
-0.1724490374,
0.1591965854,
0.03342079,
0.0613642372,
-0.1664859802,
0.0487570055,
0.4103955626,
0.0119136758,
0.3502828479,
0.1928025335,
0.1393465251,
-0.0928637832,
0.2679369748,
-0.3535980582,
-0.3601426184,
0.2299660593,
0.0713832974,
-0.3113716543,
0.192052111,
-0.1264995486,
-0.0647271797,
0.1432965696,
0.0446434394,
0.2136847824,
-0.0210934393,
-0.154117763,
-0.3666600883,
0.1856181026,
0.7775568366,
-0.1079000607,
-0.0855644867,
0.0330543444,
-0.2180711925,
0.1770855188,
0.0684082359,
-0.0754174143,
0.0966388136,
-0.2716711462,
0.0151543273,
0.5695835352,
-0.4580417275,
-0.1668785959,
-0.0221467167,
-0.0789949298,
0.0365230106,
0.1895154566,
0.1257301867,
-0.2894611955,
-0.1047199592,
0.1173080504,
0.104308188,
0.0383790098,
0.256696105,
-0.4343809783,
-0.1676722318,
0.0616066419,
0.2503468692,
0.282843709,
-0.0925020725,
0.0311435238,
0.5866726637,
0.1889617145,
-0.1102681011,
0.2881115973,
0.452478379,
-0.0726473555,
0.0778377205,
0.1638423502,
-0.0598282292,
-0.2577005625,
0.2902612686,
-0.1085455045,
0.2222910225,
0.0507584773,
-0.0135213789,
-0.0683134794,
-0.2290741503,
-0.2977705896,
-0.2829668224,
0.1336337179,
0.0285771433,
0.0880181789,
0.1543253213,
-0.2626300752,
0.3814665377,
-0.3416258097,
0.0295178462,
-0.5024128556,
0.2508628666,
-0.1954640746,
-0.146216616,
0.0308584943,
0.0873253196,
0.191751197,
-0.1371606737,
-0.138165608,
0.391384244,
0.2522925735,
-0.0563738607,
-0.0376482494,
-0.0895878524,
0.132511422,
-0.2032929957,
0.3407708704,
0.0584764704,
0.1820219755,
-0.1298590451,
0.1848866194,
0.132573843,
0.0625202507,
0.3970299661,
0.115646854,
-0.0693381056,
-0.0677485764,
0.1494115144,
-0.113608472,
-0.3245389163,
0.3509786725,
0.3328657746,
0.1574705094,
0.0885930806,
0.0377293304,
-0.2971397042,
0.6881406307,
0.1426718831,
0.1136759073,
-0.0574945509,
-0.4095012248,
0.0693989322,
0.151395157,
0.0344953761,
0.4079183042,
0.1365347654,
-0.1149395257,
0.1409751922,
0.2153790891,
-0.0987568051,
0.1317027062,
0.2377413958,
0.4221459627,
0.0527265482,
-0.0896578208,
-0.011226072,
-0.1930360943,
-0.1728314608,
0.0667531118,
0.1590050459,
-0.2549690902,
-0.1209207773,
-0.4197221994,
-0.5174449682,
-0.2753362954,
0.1492742747,
-0.3977884054,
-0.2453018427,
-0.1070486903,
-0.0726699904,
-0.3224291503,
0.3194850087,
0.279014647,
-0.0490605608,
0.0168625955,
-0.3235236704,
-0.171897471,
-0.2900436223,
-0.2571323216,
0.0216140598,
0.3672422469,
0.0608444735,
0.2379076332,
-0.2665832341,
-0.1685304344,
-0.108795844,
-0.1508058608,
0.1511536986,
0.026301099,
-0.1442516893,
-0.1114373356,
0.3510279953,
-0.182026431,
-0.1018857732,
0.4775199294,
-0.0571263731,
-0.2166933864,
0.2488491237,
0.1831469387,
0.0790497214,
-0.1002006754,
-0.4466012418,
-0.1296705902,
-0.5109669566,
-0.0740840957,
0.0898634866,
0.0974503383,
0.1583664268,
0.2631680965,
0.1819610894,
-0.1276186854,
-0.0301728267,
-0.1160966009,
-0.0521416552,
0.2722154558,
-0.1465055197,
-0.3368284702,
0.2014805377,
-0.104479216,
-0.0021728144,
0.3633415401,
-0.1813988388,
-0.0972968563,
0.0007993199,
-0.2872740328,
-0.0532516986,
0.3520983756,
0.5604921579,
-0.1533249617,
-0.0316332206,
-0.0331120268,
-0.0858617797,
-0.1202541068,
0.0027145734,
0.3534730077,
0.0590056852,
0.2731179595,
0.1735914797,
0.9325159788,
-0.0268989224,
0.462121278,
0.4056243002,
0.0499275513,
0.31168589,
-0.3958242536,
-0.0405505896,
0.2475838065,
0.1420387626,
-0.0782606378,
0.1939634234,
-0.0112835113,
-0.0358977728,
-0.5152165294,
-0.3167855144,
-0.2198877335,
-0.3144631982,
0.3542352021,
-0.1514078677,
0.0098826606,
-0.0006800305,
0.047347486,
0.0278678462,
-0.0633757561,
0.0390425958,
0.2465273291,
-0.0347130857,
0.0417486243,
-0.2293192446,
-0.1894802749,
-0.3416492045,
0.2945889533,
0.0248190388,
0.1704502702,
-0.0590174049,
-0.3400986493,
0.1011069119,
0.0709240586,
0.6148952842,
-0.2257055789,
-0.246726647,
0.2860554159,
0.0270741526,
-0.6423113942,
-0.1949951053,
-0.0242506824,
-0.1003396586,
-0.1818846017,
0.0819020718,
-0.2344072461,
-0.1979135573,
0.1702036262,
0.3472844064,
-0.0462824926,
-0.1886785328,
-0.4585421979,
-0.0359801278,
-0.5773239136,
-0.1374498159,
-0.0305474885,
0.0302877426,
0.089948222,
0.316358,
0.1898747832,
-0.1917275935,
-0.0215156637,
-0.1119426563,
0.3413629532,
-0.1046373993,
-0.1710596979,
0.1090288386,
0.0424702838,
0.0303457789,
0.2900731564,
0.1259761751,
-0.1707871109,
0.0434147902,
0.0294683352,
0.0508782938,
0.4066847861,
-0.072173886,
-0.0411551259,
-0.0437263772,
-0.0693141669,
-0.0208203588,
0.0298810825,
0.1085255444,
-0.2762966454,
-0.2065790296,
-0.6122493744,
0.6164753437,
0.0779393166,
-0.007047351,
0.442312032,
0.1935300976,
-0.2312546074,
0.5099320412,
0.1472664475,
1.1177161932,
-0.1503801942,
0.281502068,
0.1789485812,
0.1342024058,
0.6970811486,
-0.6101931334,
0.3381556869,
-0.190233767,
0.0593843907,
0.0498275608,
-0.1147464737,
0.3421472907,
0.0742261857,
0.0520730875,
0.5547212362,
0.0944092497,
0.3872457743,
-0.3301384449,
-0.0382318348,
-0.4087437391,
-0.0995560884,
-0.286285013,
0.0773016661,
-0.1073559523,
0.5356622934,
-0.1105021909,
0.0492257364,
-0.367870599,
-0.2697419226,
-0.2712929845,
0.0676360652,
-0.2752241492,
0.2253467739,
-0.4388574064,
-0.1412003934,
-0.1835289448,
0.2323128134,
0.2649609447,
-0.0146420375,
-0.0779356137,
0.2345307767,
0.0545263179,
0.014443282,
-0.1612458974,
0.0704638809,
0.3199259341,
-0.1493272781,
-0.2023090571,
-0.0072201509,
-0.2528012693,
-0.1998404413,
-0.2708639205,
0.1244185269,
0.5775043964,
0.2529715002,
-0.3201371729,
0.3392542601,
-0.0437237732,
0.0853201449,
0.144281581,
-0.1620110571,
-0.0689978823,
0.0958445668,
-0.3166088164,
-0.0318890996,
-0.04099999,
0.4114472568,
0.3425065875,
-0.0451263897,
0.3743168414,
0.0268037263,
-0.1699328572,
-0.1892458797,
0.1815707684,
0.2453127056,
-0.2064423561,
0.04059764,
0.0530038513,
-0.0656870678,
-0.1135319993,
-0.0082210451,
-0.0316909477,
0.0257287603,
0.0861474723,
-0.2623574138,
-0.2688730359,
0.4009700716,
0.0285685379,
0.0962439924,
-0.1838033646,
0.1682522148,
0.2581400871,
-0.2804537416,
-0.2636615038,
-0.1664467752,
-0.1379230171,
0.2131750286,
0.1611239463,
0.2940630019,
0.0711479485,
0.026065778,
0.0308840554,
0.1700145453,
-0.3657002151,
-0.1506893486,
0.0269948579,
0.1648257971,
0.1837412268,
0.0149639705,
0.1629315466,
-0.4742912054,
0.1331104189,
-0.3103108406,
0.1451511532,
0.3282079399,
-0.1741096973,
0.3330098689,
0.3119803667,
0.1528916359,
-0.1263670921,
0.2810008526,
-0.208089456,
0.181109637,
0.2060037106,
-0.0202516317,
0.3747198284,
0.1296893209,
-0.4093850553,
-0.1814794987,
-0.326529026,
-0.0267218817,
-0.0540514104,
-0.0679626986,
-0.0941458568,
-0.0720660537,
0.1391074806,
0.3085330725,
-0.272041887,
-0.1431086361,
0.2774804831,
0.1624224335,
-0.2192171514,
0.0750610679,
0.3696584702,
-0.073268488,
-0.0315307528,
0.1624494791,
0.0274782851,
-0.0455581844,
0.1803495288,
0.191620931,
0.2042515129,
-0.2743168473,
0.3263816535,
0.1230563223,
0.2487041652,
-0.0368458033,
0.0143048735,
-0.0407123454,
0.2321395874,
0.6695381403,
-0.1790861338,
0.5875694156,
0.0621428005,
0.1620478928,
-0.2189344317,
-0.398702085,
0.2998222411,
0.6812431216,
-0.0985095873,
0.1004624441,
-0.1580051333,
-0.0540074036,
0.176388666,
-0.0204281118,
-0.0960501581,
0.1124385595,
-0.0607524514,
0.1433699131,
0.021404177,
-0.2690527439,
-0.1828233153,
0.1030613855,
0.0882197917,
-0.3828248978,
0.3714802563,
0.1974014193,
-0.1855777055,
-0.0804096237,
0.341703862,
0.1561096609,
0.0718712285,
-0.2412333488,
-0.1007753611,
0.1273661554,
-0.158171311,
0.1788201034,
0.1164054722,
0.2657681704,
0.413448751,
-0.0676168501,
-0.0847825333,
0.1543546468,
-0.0182006806,
-0.018674463,
0.1784266531,
0.0545295067,
0.1362746507,
0.1742999554,
0.0870505348,
-0.2107060254,
-0.1594393998,
0.278229475,
0.0892290622,
-0.2767752707,
-0.0333553702,
-0.3387448788,
0.0231566802,
-0.2729211748,
0.0958560631,
-0.6517592072,
0.0046342351,
-0.0973907337,
0.150931567,
0.0231208783,
-0.1643295437,
0.0431654751,
-0.1716596484,
0.2587974966,
0.1433946341,
-0.136745587,
-0.319221884,
-0.3952594697,
-0.5910950899,
0.0117546963,
-0.318498373,
0.3399734497,
-0.1448810399,
0.2900011539,
0.0270658936,
0.1840905249,
-0.0946340114,
0.0659246743,
-0.0728729144,
0.1686778516,
-0.408397764,
-0.1803995371,
-0.1847618818,
0.0844622403,
0.082800895,
-0.3851661384,
-0.0301346313,
-0.0941681564,
-0.032818079,
-0.0980991498,
-0.2634515464,
0.4284457266,
-0.1124790087,
0.5186238289,
-0.106207408,
0.2381477803,
0.0832460746,
-0.1408232749,
-0.2633819282,
-0.1576006562,
-0.0788619965,
-0.0940655842,
0.0313769765,
0.442989558,
-0.2951672077,
-0.0622901246,
-0.324388355,
0.4698701501,
-0.2132890373,
0.2390983701,
-0.1712669879,
0.1514722854,
0.1471275985,
0.3593337536,
-0.1664115936,
0.0064463541,
-0.0772221833,
-0.0631925091,
-0.5480510592,
-0.2193654031,
0.5287932158,
-0.4788553417,
-0.2819332778,
-0.0606863983,
0.2528176606,
-0.1767330319,
-0.0653752908,
-0.5018325448,
0.1924412698,
0.2456647903,
0.1923523098,
-0.0027937805,
0.0548758917,
-0.2297173589,
-0.0328226723,
-0.0410185419,
-0.3641453981,
-0.2055200636,
-0.1534762532,
0.1743489206,
-0.2991896868
] |
https://github.com/huggingface/datasets/issues/1790 | ModuleNotFoundError: No module named 'apache_beam', when specific languages. | The reshuffle is needed when you use parallelism.
The objective is to redistribute the articles evenly on the workers, since the `_extract_content` step generated many articles per file. By using reshuffle, we can split the processing of the articles of one file into several workers. Without reshuffle, all the articles of one file would be processed on the same worker that read the file, making the whole process take a very long time. | ```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct? | 73 | ModuleNotFoundError: No module named 'apache_beam', when specific languages.
```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct?
The reshuffle is needed when you use parallelism.
The objective is to redistribute the articles evenly on the workers, since the `_extract_content` step generated many articles per file. By using reshuffle, we can split the processing of the articles of one file into several workers. Without reshuffle, all the articles of one file would be processed on the same worker that read the file, making the whole process take a very long time. | [
0.0401643589,
0.0101207774,
-0.0058726529,
0.1293458045,
-0.0119505981,
0.0596709512,
0.3661441803,
0.3480099738,
0.022974778,
0.2797617912,
0.1604570746,
0.0736092255,
0.1980749965,
-0.1953661591,
-0.0845639408,
-0.2648459673,
0.3423891366,
-0.0130629241,
-0.0566422231,
-0.3558189273,
-0.4479027092,
0.2000837773,
-0.5033822656,
-0.1780142188,
-0.1696122736,
0.2718341649,
-0.1433468908,
0.3892428577,
0.1860794872,
-0.0491477326,
-0.04007186,
-0.0870494619,
-0.0869860128,
0.2562695146,
-0.0001181821,
0.0990974605,
0.2742290199,
-0.2264610082,
-0.2354049236,
-0.135538131,
-0.000166621,
-0.5018973947,
-0.0932026803,
-0.4231702089,
0.0232974123,
-0.0400471836,
0.0391364619,
-0.2083496004,
0.5846297145,
0.1001813188,
0.103046082,
0.2666606307,
0.0476952195,
-0.0251141619,
0.3200202882,
-0.0474893078,
-0.0405142419,
0.1522979587,
-0.0020845945,
0.2132856995,
-0.1075007319,
0.4607252777,
-0.2558428049,
0.1357322186,
-0.058637049,
-0.1971606761,
-0.1175448149,
-0.4867197275,
0.3078397214,
0.261000514,
0.4405617416,
0.0164711718,
-0.1753840894,
-0.2519321144,
-0.133092165,
0.1144906655,
0.1225964502,
0.193790853,
0.112303324,
0.0998712555,
0.5713419318,
-0.3144806027,
0.0563262627,
0.0551685542,
0.232682541,
0.5872220397,
0.1105985194,
0.4362626076,
0.0444843434,
0.1545604169,
0.2064007819,
-0.2861564755,
0.2010477781,
0.2365496159,
-0.2430973947,
-0.0052307043,
-0.0373824835,
-0.2237178832,
-0.0731733814,
-0.1004005596,
-0.5007816553,
0.2464474887,
0.4761475623,
0.1704073995,
0.1579051316,
0.1818658113,
0.1793932468,
0.219405219,
0.264375627,
-0.2684375346,
-0.0538063943,
-0.0212681387,
0.1332737058,
-0.3763230443,
-0.4731956124,
0.2896768749,
0.0331058614,
-0.1172798574,
-0.1124834567,
-0.2394610196,
-0.2518794239,
-0.3447419703,
-0.2870918512,
0.279663831,
0.3040519059,
0.5849858522,
0.030953927,
0.2881348431,
-0.5063957572,
-0.1919752955,
-0.1429307312,
0.1993657798,
-0.2677184939,
0.1640224308,
-0.0752117559,
0.1458442956,
0.1551927179,
-0.1586451679,
0.221036315,
0.0329930261,
0.092692107,
-0.0229868367,
0.0294056386,
0.4956111908,
0.1296815425,
0.3343686759,
0.3818499446,
0.0441215858,
-0.3361370862,
0.2725724876,
-0.5118632913,
-0.49851197,
0.1436737627,
0.031097455,
-0.1891686618,
0.1958589852,
-0.0187792797,
-0.0286520161,
0.2861871719,
-0.1459289491,
0.2613283396,
-0.003873162,
-0.0005567517,
-0.3166024685,
-0.0428891405,
0.6379070282,
-0.1172444075,
0.0082373144,
-0.0107365279,
-0.1041545495,
0.2127788067,
0.193970114,
-0.1101896539,
0.0763257965,
-0.2047850043,
0.0210153125,
0.5991593003,
-0.5733520985,
-0.120327495,
0.0884785727,
-0.2460714877,
0.1072987244,
0.4706139266,
-0.0097041009,
-0.0795363113,
-0.2263074368,
0.0292201377,
0.1647596508,
0.0946114957,
0.1012685075,
-0.4208419323,
0.0282598455,
0.1501705945,
0.166688785,
0.1931990683,
0.1797625273,
0.0612407662,
0.1191943288,
0.2179638743,
-0.030802669,
0.2628242075,
0.2563931346,
-0.1955598742,
0.2426508367,
0.3924928308,
0.2315065861,
-0.0732826367,
0.2811629772,
-0.1374691278,
0.3438963592,
0.0679796115,
-0.1475525647,
-0.0213425905,
-0.4191905856,
-0.3652011752,
-0.5023625493,
-0.0390963703,
-0.0010687102,
0.2320948839,
0.2806373537,
-0.4111868143,
0.3606015444,
-0.3701223433,
0.0576596707,
-0.5175856352,
0.2484355569,
-0.1954283565,
-0.0150763784,
-0.0902093127,
0.116037555,
-0.0062016398,
-0.2410621941,
-0.027879579,
0.3686267734,
0.2898943126,
0.1484851986,
0.1862211376,
-0.227881968,
0.1058300808,
-0.2935654819,
0.360509783,
0.2167859524,
0.1143656075,
-0.1836789995,
0.2624616921,
0.3334523439,
0.0331232399,
0.4286051989,
0.0929737836,
-0.0501370654,
0.1583973616,
-0.0014182897,
-0.1741598547,
-0.1964770555,
0.2689025998,
0.2168021053,
0.0400732011,
-0.0840645581,
0.0163171161,
-0.121680811,
0.615557611,
0.0400266983,
0.1203417033,
-0.0023307311,
-0.2098278552,
-0.0071059358,
0.0358044095,
0.0477510467,
0.4985299408,
0.1664864421,
0.0284510702,
0.091031909,
0.3129203022,
-0.2214425057,
-0.0211746488,
0.1403501183,
0.3321324289,
0.2238541394,
-0.2455615699,
0.0303167831,
-0.3016818762,
-0.1041561887,
-0.1987624764,
0.0637182444,
-0.047432486,
-0.0213098004,
-0.0229488406,
-0.3624950051,
-0.4416368008,
0.0558631793,
-0.3911738694,
-0.3372014761,
0.0788689926,
-0.0377293043,
-0.2612819076,
0.3961455524,
0.347946614,
-0.064943552,
-0.0434288234,
-0.1267154068,
-0.2274431735,
-0.3022426963,
-0.2869902253,
-0.0414455049,
0.1613827646,
0.244111672,
0.0500851162,
-0.3857808113,
-0.1624460369,
-0.1729756892,
-0.1353344321,
0.0865203291,
-0.0582747683,
-0.1021673381,
-0.1136887595,
0.3374113441,
-0.0435152687,
-0.1603803635,
0.3628312945,
-0.049733419,
-0.1989870816,
0.2759111822,
0.1007406712,
0.0926554501,
0.0612150803,
-0.6890726686,
-0.391489923,
-0.4526815712,
0.0283048172,
0.1488549113,
-0.0023451259,
-0.1121014953,
0.1457038969,
-0.1862114072,
0.0437312052,
-0.1842692643,
-0.141288653,
-0.1482245177,
0.18394804,
-0.1587507874,
-0.3171838522,
0.1166823432,
-0.1749303788,
-0.19349958,
0.1352563649,
-0.0955842733,
-0.00559102,
0.1183069199,
-0.2816365063,
-0.1481219679,
0.6191089749,
0.6890799403,
-0.1661868989,
0.0601065084,
-0.0240419917,
0.1223904639,
-0.0701786578,
0.0990806669,
0.3527525365,
-0.0878821313,
0.0569438934,
0.079982616,
0.8017921448,
0.1350188255,
0.6213973165,
0.2583410144,
0.1399968714,
0.2320953161,
-0.4885396361,
-0.043335963,
0.166204989,
0.0175428335,
-0.1670777053,
0.2452233434,
0.0493524931,
0.0112377061,
-0.4611929655,
-0.4745743275,
-0.3980813622,
-0.2800991833,
0.2716123462,
-0.0590542555,
0.1806711257,
0.0098425904,
-0.143556565,
0.1308440715,
0.1081403345,
0.0183615945,
0.5039036274,
0.0818249881,
0.0498272479,
-0.3906684518,
-0.2206050456,
-0.2547485828,
0.3904038668,
0.1038838252,
0.0071673477,
0.2192422897,
-0.4376811385,
0.1756002605,
0.0366981588,
0.751088202,
-0.2891375422,
-0.2462833673,
0.1214048043,
0.0734255239,
-0.4148047864,
-0.2408629358,
-0.0132126799,
0.001745565,
-0.0753205568,
0.1231322587,
-0.3026682734,
-0.0831562728,
0.1161785051,
0.2808744907,
-0.2045970261,
-0.2897413969,
-0.6348304749,
-0.196039021,
-0.7667272687,
-0.1009177566,
-0.224574104,
-0.0269015878,
-0.0457419418,
0.2402989566,
0.2664463818,
-0.1687164158,
-0.1306379139,
0.04956742,
0.0420689918,
-0.2761183083,
-0.3636623919,
0.1034522355,
-0.1921045184,
0.2361413091,
0.2059917748,
-0.0251833629,
-0.1817454249,
-0.0661986247,
-0.1538832635,
0.2551397085,
0.360437423,
-0.0031677205,
0.0669379458,
-0.0211365465,
-0.0070202989,
-0.0431656241,
-0.4192325473,
-0.004598923,
-0.0795826614,
-0.2701923549,
-0.5315516591,
0.4778111577,
-0.1089428067,
-0.0097234035,
0.220469594,
0.1652799249,
-0.0740982965,
0.54551965,
-0.0370406806,
1.1979781389,
0.0697287768,
0.2619320452,
0.0200012829,
0.0673671365,
0.8408923149,
-0.7155605555,
0.3852579594,
-0.1788085252,
0.0753542036,
-0.1027161032,
-0.0964370444,
0.5330151916,
0.1523682773,
-0.1115494519,
0.6340996027,
0.0897982344,
0.1107654572,
-0.3829465806,
0.0491494946,
-0.5872066617,
-0.0020175532,
-0.0955372006,
-0.1017632782,
0.1078921482,
0.5783394575,
-0.1541684419,
0.140535444,
-0.4126494527,
-0.4174628556,
-0.0435712524,
-0.0402045883,
0.1563468426,
0.3821922541,
-0.2015430629,
-0.2772362232,
-0.2275538296,
0.0341186486,
0.3032435179,
-0.2450384796,
0.1195625886,
0.0719767436,
0.1027844772,
-0.1334930658,
-0.0851186737,
0.0266555678,
0.3381586075,
-0.1617871523,
-0.26839149,
-0.1418525875,
-0.2589021921,
-0.299610436,
-0.1787230074,
0.2115919441,
0.3893189728,
0.1588394344,
-0.3468773365,
0.6813216209,
-0.1538219154,
-0.0783032924,
0.0517500937,
-0.0718400478,
-0.3309109509,
0.2146336585,
-0.4696040452,
-0.0516258366,
-0.1445709765,
0.284522146,
0.5598360896,
-0.0852776915,
0.2096581757,
0.0481221639,
-0.1559474617,
-0.1406455636,
0.206129387,
0.0663562417,
-0.1167548448,
-0.0088439668,
-0.0003367674,
-0.0602786951,
-0.1183353886,
0.1223806664,
0.0960981473,
0.175645113,
-0.1687561125,
-0.508020699,
0.0360029638,
0.3683111668,
0.088549152,
-0.1269353032,
-0.0267044157,
0.2383685708,
0.3466286063,
-0.0447961204,
-0.1975693852,
-0.0443148538,
-0.099152118,
0.308721453,
0.1973844916,
0.1657432616,
0.0202006847,
0.098366864,
-0.0506109707,
0.0820612535,
-0.2794936597,
-0.0896705762,
0.1034570858,
0.2129495293,
0.130128473,
0.0839394033,
0.1040166989,
-0.2892779708,
0.1351738423,
-0.1096882522,
0.0343007892,
0.1533062458,
-0.282415241,
0.418838501,
0.3241230547,
0.227462396,
-0.415766716,
0.3026827574,
-0.3377507627,
0.0373844095,
0.0953712314,
0.1226105243,
0.3036296666,
0.1579972506,
-0.2214695066,
-0.1125484258,
-0.1013614163,
0.0859856829,
0.1019835696,
-0.0053943489,
0.0509432741,
-0.3437865376,
0.2998645902,
0.5285129547,
-0.0004932784,
-0.1901671439,
0.1603439003,
0.0536319241,
-0.3772276044,
-0.0003574702,
0.6144309044,
-0.1160393655,
-0.0262057409,
0.2547370791,
0.2971381247,
-0.1633601487,
0.1214410514,
0.1717966944,
0.3075537086,
-0.3022237122,
0.3114135265,
0.2198168635,
0.2022479773,
0.1023769155,
0.043800693,
-0.0593719147,
0.2315731794,
0.4631900191,
0.0525061972,
0.7212814689,
0.285292834,
0.1726115644,
-0.2643494606,
-0.3424150944,
0.3993782103,
0.4465336204,
0.0446773916,
-0.0783047974,
0.0100713698,
-0.1394177228,
0.0058777831,
0.1516019255,
0.0343410708,
0.2824626565,
-0.0321252756,
0.1338590533,
0.1411110908,
-0.2624063492,
0.0187197737,
-0.0741359293,
0.1088450029,
-0.0734164715,
0.4331256747,
0.1227408499,
-0.0267006196,
0.128441304,
0.2447279841,
-0.2824224532,
0.1447906345,
-0.0760188475,
-0.2901901603,
0.244031772,
0.0011968865,
0.1647979915,
0.2264441699,
0.2207717001,
0.1477452368,
-0.1869583279,
-0.0110664349,
0.1191352978,
-0.0742232502,
-0.0400304198,
0.2172244191,
-0.0867469013,
0.1863645464,
0.0443028957,
0.0615514927,
-0.1333114654,
-0.0444111526,
0.1823523194,
-0.1542585045,
-0.1811796278,
0.0117925499,
-0.1430219561,
-0.1555946022,
-0.1952769011,
0.2217182219,
-0.4802033901,
-0.031469658,
-0.0326494575,
-0.1143595129,
-0.1712021828,
-0.137338385,
0.0024434477,
-0.1196258813,
0.2270771414,
0.415124923,
0.0142978467,
-0.1361877471,
-0.3554024994,
-0.3997884095,
0.1810667664,
-0.462787807,
0.1659281552,
-0.1951672882,
0.3386710584,
0.1467346996,
0.350442946,
-0.051254347,
0.1434314251,
-0.2581035793,
0.2402313501,
-0.1519414335,
-0.1650688648,
-0.1928877831,
-0.0824906603,
-0.1049788296,
-0.3492974043,
-0.0071600252,
0.2173500359,
-0.0368053578,
0.073521778,
-0.2756353021,
0.541072309,
-0.1676591933,
0.3580455184,
0.1330914497,
0.2596683502,
0.047048755,
-0.0877511054,
0.246174708,
-0.0556870215,
-0.2559541464,
0.182791546,
-0.0121116182,
0.2132976204,
-0.4219234884,
-0.0811937451,
-0.214940697,
0.4899176359,
-0.0249408148,
0.1334861219,
-0.332462728,
0.1876620799,
0.1471928209,
0.1325832009,
-0.0528520346,
0.3269249797,
0.0415283926,
-0.1088427082,
-0.4738568962,
-0.0035288809,
0.2111255378,
-0.4024797082,
-0.4467401206,
-0.0865475237,
0.2853620052,
-0.1469682157,
0.0271624383,
-0.4059706032,
0.0087407893,
0.2635792494,
0.1890696436,
0.0547973253,
0.0043814783,
-0.164589718,
-0.3674695492,
0.0327625275,
-0.4655790031,
-0.1391334981,
-0.157022357,
0.0946327075,
-0.4148329496
] |
https://github.com/huggingface/datasets/issues/1790 | ModuleNotFoundError: No module named 'apache_beam', when specific languages. | Maybe the reshuffle step can be added only if the runner is not a DirectRunner ? | ```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct? | 16 | ModuleNotFoundError: No module named 'apache_beam', when specific languages.
```py
import datasets
wiki = datasets.load_dataset('wikipedia', '20200501.ja', cache_dir='./datasets')
```
then `ModuleNotFoundError: No module named 'apache_beam'` happend.
The error doesn't appear when it's '20200501.en'.
I don't know Apache Beam, but according to #498 it isn't necessary when it's saved to local. is it correct?
Maybe the reshuffle step can be added only if the runner is not a DirectRunner ? | [
-0.0378295816,
0.0517894439,
0.0459224246,
0.1618946493,
0.2217683345,
0.0495495535,
0.2877705991,
0.3032410443,
0.0259335935,
0.1799332201,
0.2910350263,
-0.0192489214,
0.1045148596,
-0.0232276116,
0.110032022,
-0.3740753531,
0.307103008,
-0.0370497182,
-0.0959917903,
-0.2818304002,
-0.4426355064,
0.1054400578,
-0.3799929321,
-0.1579356641,
-0.003188967,
0.2331447154,
-0.056835942,
0.2654174268,
0.2003730834,
-0.1437360048,
-0.0345399752,
-0.2057223171,
-0.0999972224,
0.3504474461,
-0.000123889,
0.2205035239,
0.3199233413,
-0.2937648892,
-0.2419770658,
-0.1562590003,
0.023121478,
-0.3215470314,
-0.1388468444,
-0.3631033599,
-0.101666227,
-0.0253455397,
0.0665037706,
-0.3819904625,
0.6048760414,
0.1928147972,
0.1098595113,
0.42100209,
-0.0207723863,
-0.0147781391,
0.3787574768,
-0.0865186602,
-0.1000082642,
-0.07794597,
-0.2010745704,
0.229372859,
-0.1714307964,
0.3713361621,
-0.238827616,
0.0087699136,
0.0032124165,
-0.2786224782,
-0.0851295963,
-0.4114530385,
0.1897357404,
0.268794924,
0.4893790483,
-0.2717168331,
-0.2248740345,
-0.2171137929,
0.0023346932,
-0.0665181279,
0.2809658349,
0.0015106825,
0.0660388544,
0.0086568855,
0.511803627,
-0.3065737188,
0.1025716662,
-0.0175948516,
-0.1090352386,
0.6667249799,
0.2183997631,
0.3571635187,
-0.0904255062,
0.195364818,
0.332996279,
-0.2005525529,
0.0652888641,
0.1246235296,
-0.3468625247,
-0.0545843877,
0.0373447053,
0.1232196242,
-0.1677460223,
-0.0091981692,
-0.247233659,
0.1628329605,
0.3050274849,
0.0636526719,
0.0405443199,
0.2389967293,
0.1641888022,
0.3014989495,
0.2608811855,
-0.3187678158,
0.1340392977,
0.0162617583,
0.1202594787,
-0.5691351891,
-0.5156909227,
0.3740119934,
0.0190281812,
-0.0261212401,
-0.1588701308,
-0.0768230408,
-0.3505404592,
-0.2740906477,
-0.0533220768,
0.3207166493,
0.1593186557,
0.3862249851,
0.1374739558,
0.3043716848,
-0.2998507023,
-0.1806763113,
-0.0933372602,
0.1023257747,
-0.2912923992,
0.0453902185,
-0.0807785913,
0.0810588151,
0.179328844,
-0.1545542032,
0.1975852102,
0.2324460596,
-0.0161840264,
0.0808046833,
-0.0513105541,
0.4848628342,
0.2038980424,
0.3424087167,
0.430280447,
0.1734016538,
-0.2173182517,
0.3705194294,
-0.4540524185,
-0.3109499216,
0.1928402632,
-0.0105658891,
-0.1869195998,
0.0678291321,
-0.0408775695,
-0.0447851121,
0.1960520297,
-0.1627372652,
0.2673737109,
-0.1260740608,
-0.1356470287,
-0.2988693118,
0.0402598046,
0.6308398843,
-0.1694734693,
-0.0710989013,
0.0578630827,
-0.0961322337,
0.1474751383,
-0.0768609568,
-0.031953644,
0.2058145553,
-0.2901692986,
-0.0351820104,
0.9126726389,
-0.5441173911,
0.0465964936,
-0.0909168124,
-0.3012405634,
0.0395176411,
0.5204702616,
-0.0860052183,
-0.2685618699,
-0.2502494752,
-0.0669795796,
0.2802210152,
0.0710944608,
0.1019850448,
-0.2831767797,
0.1158960387,
0.199693799,
0.2040525228,
0.3477714658,
0.1337683648,
-0.0263226442,
0.3089299202,
0.1329001039,
-0.043742042,
0.2109898627,
0.3810606897,
-0.3102935851,
0.0953510627,
0.3288871944,
0.1389879286,
-0.036351271,
0.2736402154,
-0.2340337485,
0.1261845082,
0.2200855911,
-0.0863326564,
-0.0491343401,
-0.3538448811,
-0.4471890628,
-0.1766672432,
-0.0177154709,
0.0479140878,
0.1006741747,
0.2592093945,
-0.438626647,
0.3504108191,
-0.23825863,
0.1331079155,
-0.3313280344,
0.3779860437,
-0.1291904449,
-0.0094745951,
-0.0357466564,
0.1551730335,
0.102394484,
-0.2608759999,
-0.0117667038,
0.3821974099,
0.1847783178,
0.0009455582,
0.0661205873,
-0.2647802234,
0.1108390987,
-0.0088179698,
0.3106171489,
0.2222775966,
-0.0423320048,
-0.1995379776,
0.1582317799,
0.38154006,
-0.0263563022,
0.5533998609,
0.0767529756,
0.0388495214,
0.0933388323,
0.0327161923,
-0.1753464043,
-0.099721618,
0.3674667776,
0.2749307454,
0.1782637537,
-0.1733293235,
-0.0387801938,
-0.1163841188,
0.6952417493,
0.183093816,
0.1338067055,
0.0048368229,
-0.2690499425,
0.1514982581,
-0.0059788609,
0.0746214986,
0.3360258043,
0.2021523863,
0.038128648,
0.1766221225,
0.2083054334,
-0.1654424816,
0.0427259132,
0.1187445223,
0.3286022544,
0.3047620058,
-0.2040672302,
-0.0914361328,
-0.3562947512,
-0.0728418604,
-0.0272836126,
0.0737781376,
-0.1998994946,
-0.0119140521,
-0.2538816929,
-0.4885877967,
-0.4647908807,
-0.0220781043,
-0.5278829336,
-0.3266158998,
0.1899414808,
0.0178200267,
-0.1534128934,
0.5467298627,
0.3333821893,
-0.1433528811,
-0.0060544205,
-0.41901353,
-0.2095362991,
-0.2616888583,
-0.2897979915,
0.0098997243,
0.3442020118,
-0.0150849735,
0.0647742972,
-0.3819513023,
-0.090169616,
-0.1610026062,
-0.2000041008,
0.0520418435,
-0.035718482,
-0.3044555485,
-0.0490271188,
0.3831199408,
-0.1667334139,
0.0269655511,
0.3886790872,
0.1256407946,
-0.2855381966,
0.2123603225,
0.1414209902,
0.0906040072,
0.0217538942,
-0.5343980193,
-0.2619633377,
-0.4425388575,
-0.1127428114,
0.3377594054,
-0.0179365966,
-0.2148830742,
0.2542979419,
-0.1770938784,
0.0141038746,
-0.2195474058,
-0.0476565622,
-0.0188097041,
0.2171596438,
-0.0823242664,
-0.2377472818,
0.1454090476,
-0.1483948231,
-0.0491364487,
0.1627829224,
-0.1970967203,
-0.2041373104,
0.2359638512,
-0.2119006962,
-0.1554115713,
0.6291611791,
0.7919956446,
-0.0584628321,
0.0516696796,
-0.0522564277,
-0.0450741202,
-0.1296368092,
-0.0457175188,
0.4874376357,
-0.0442970954,
0.3777838051,
-0.0016311154,
0.8330236673,
-0.0795276687,
0.5151053071,
0.2486049086,
0.0314508341,
0.3576627672,
-0.5895617008,
0.0750973448,
0.140081346,
0.1810805947,
-0.0809001178,
0.1826244295,
0.0848842189,
0.2279673219,
-0.4252327979,
-0.2832066715,
-0.1590493768,
-0.3067366779,
0.2424541414,
-0.2019101083,
0.0492008291,
-0.0209227353,
-0.007636833,
-0.0459682904,
0.0837609544,
0.1303994656,
0.4588715732,
-0.0162468664,
0.1149081439,
-0.371406883,
-0.198264122,
-0.2697688639,
0.4062989354,
-0.0375504866,
0.0089869285,
-0.0109701063,
-0.3440271914,
0.0577889271,
0.0095757805,
0.7247852087,
-0.2223727703,
-0.2159997672,
0.1361850798,
0.065836966,
-0.3969595134,
-0.2671535611,
0.1685897857,
0.1104612947,
-0.1129762381,
-0.060325224,
-0.1990755349,
0.0028694747,
0.2013634443,
0.350261271,
-0.1858436316,
-0.2565716207,
-0.6710650921,
-0.1283436567,
-0.6659098864,
0.0345694348,
-0.0235289782,
-0.038082052,
0.1507721841,
0.1970324665,
0.1336763948,
-0.410520494,
0.0060413284,
-0.0339903012,
0.1067852974,
-0.1963940263,
-0.3931010365,
0.0838726237,
0.1498657763,
0.0119268904,
0.1818653643,
0.0489207022,
-0.1927952617,
-0.0224616714,
-0.0940001234,
0.305722028,
0.3254755735,
-0.1210918576,
0.2026845366,
-0.098802872,
-0.1369827539,
0.0581118464,
-0.2772010267,
0.0825003162,
0.0212355461,
-0.2918606102,
-0.5804409385,
0.5959303379,
0.0238304269,
-0.0611400791,
0.4912585616,
0.2390517592,
-0.2107003331,
0.5178579688,
-0.1179180592,
1.1283650398,
-0.0416322984,
0.2160153389,
0.1365788877,
-0.0306077711,
0.6529220343,
-0.7152815461,
0.3328054547,
-0.2499713749,
0.1918948889,
-0.1073212698,
-0.1381450444,
0.4551342428,
0.0230788328,
-0.000085843,
0.6919451952,
-0.069671385,
0.2239042819,
-0.2821065784,
-0.1195755452,
-0.2298956513,
0.0141804805,
-0.2873302996,
-0.1048292294,
0.0490017273,
0.5750827193,
-0.2609502971,
0.1015172303,
-0.2526403964,
-0.3439986706,
-0.0964749679,
-0.0538981073,
-0.1133995801,
0.100381285,
-0.2506744266,
-0.356253922,
-0.1733187139,
0.1902552247,
0.4215753376,
-0.1046225429,
0.0631271973,
0.2058879286,
0.0568379648,
0.0017739472,
-0.112562798,
0.1085178927,
0.2183763087,
-0.1717536747,
-0.1444948912,
-0.0625029504,
-0.2645851374,
-0.3730092347,
-0.1124177054,
0.0927062705,
0.788813293,
0.2436781973,
-0.1366638094,
0.5964677334,
0.0447729267,
-0.0597375222,
0.0402125344,
-0.1973059624,
-0.0520928577,
0.0244716816,
-0.3202798367,
-0.0879470035,
-0.1904219091,
0.3382104039,
0.5054774284,
-0.1090088114,
0.3684285283,
0.0020971522,
-0.0641613603,
-0.1022733375,
0.1413152367,
0.0933736414,
-0.1211453155,
0.0321341492,
0.1755931675,
-0.1490767747,
-0.1830690056,
-0.0648157224,
0.0359760597,
0.1165767089,
-0.1092981696,
-0.3471045494,
0.0097770141,
0.1867247969,
0.081800133,
-0.07499028,
-0.1192831174,
0.4146800041,
0.3110108674,
-0.2838913202,
-0.1570916176,
-0.1663304567,
0.0561401807,
0.138980642,
0.0468081944,
0.3287315667,
-0.0659126937,
0.2154003531,
0.0019713969,
-0.085981153,
-0.2071029544,
-0.075469844,
0.0507457815,
0.2360820919,
0.1155921519,
0.1225412562,
0.2319327742,
-0.2529884875,
0.1190033033,
-0.133307308,
-0.0471673235,
0.2049924284,
-0.1743319482,
0.2479433417,
0.4722277224,
0.1558710337,
-0.4540855885,
0.1151992232,
-0.2590802908,
-0.0721194074,
0.0176857468,
0.2242809385,
0.2557979822,
0.1642474085,
-0.3291210234,
-0.0661544055,
-0.0070637683,
0.0523627773,
0.0173699949,
-0.1378445029,
0.0108229965,
-0.2007793784,
0.2597388327,
0.4037544727,
-0.1165412441,
-0.1918817163,
0.235677138,
0.0097521553,
-0.614834547,
0.12831828,
0.5827646255,
-0.0436285138,
0.0342314206,
0.2916868627,
0.2184491754,
-0.2475518286,
0.3061933815,
0.1987028122,
0.1265825033,
-0.368098259,
0.3958078325,
0.2837430537,
0.1989348084,
0.1737139672,
0.3414799273,
-0.1861772388,
0.1620642543,
0.6131904125,
-0.0779114738,
0.5723163486,
0.2195225358,
-0.0528068505,
-0.3409300148,
-0.3440141976,
0.3430029154,
0.4752599597,
0.2266084999,
-0.2065158337,
0.1544107348,
-0.1298748404,
-0.0306213144,
-0.0297719389,
-0.192720592,
0.087481156,
-0.1007989272,
0.0834337845,
0.0292316787,
-0.3153879642,
0.0002239325,
-0.0326272398,
0.1068399027,
-0.0736550391,
0.2326969653,
-0.0119548319,
-0.0000041738,
0.0383538976,
0.2689739764,
-0.2507519424,
0.0448513441,
-0.0744480789,
-0.1020019129,
0.2303340435,
-0.098278299,
0.2454407215,
0.1394629031,
0.0990581214,
0.0319893323,
-0.0642368048,
-0.1891165227,
0.0995637029,
0.0698035732,
-0.0910216495,
0.0897794813,
-0.1794641167,
0.1652263552,
0.1663865596,
0.0541424938,
-0.163356185,
0.1356812716,
0.052620925,
-0.1210122481,
-0.1623201966,
0.2607011795,
-0.1448886245,
-0.0855362788,
-0.2999682426,
0.1323328167,
-0.4391361475,
-0.0361806042,
0.0692013353,
0.1096901894,
-0.2089390606,
-0.2250740379,
-0.0050088349,
0.0577383563,
0.1765891165,
0.3686091006,
-0.1502881646,
-0.1989365667,
-0.2875456214,
-0.4894709885,
0.1540003121,
-0.4054335952,
0.218338117,
-0.2065913975,
0.2182587534,
0.1433669329,
0.2793425024,
0.1631579101,
-0.0037901916,
-0.1784083694,
0.1113903224,
-0.2246067375,
-0.1581053287,
-0.1996612251,
0.0984456465,
-0.1441680193,
-0.368192941,
-0.0305781104,
0.0476012491,
-0.0159631036,
0.0230945069,
-0.283721,
0.5991744995,
-0.2503395081,
0.2883056104,
0.0000727244,
0.215801537,
0.1250245571,
-0.0017148346,
0.1506816894,
-0.1211901978,
-0.437341094,
0.114683494,
-0.0757658556,
0.2590180337,
-0.3916987777,
-0.1559028924,
-0.3126987517,
0.4246473014,
0.033418186,
0.3534766436,
-0.2941410244,
0.2738614082,
0.1248204485,
0.2421263158,
-0.0782945976,
0.2404733896,
0.0372117497,
-0.0417717695,
-0.5601402521,
-0.0901343003,
0.2070988715,
-0.4825281799,
-0.3584975898,
-0.0474840216,
0.1790842861,
-0.068018809,
0.0958560482,
-0.4054121673,
0.1350022256,
0.306163013,
0.0924022272,
0.1401242614,
0.0371975861,
-0.436436981,
-0.1897845417,
-0.0181784797,
-0.6344156265,
-0.1510042697,
-0.1968304068,
0.102077283,
-0.3524163365
] |
https://github.com/huggingface/datasets/issues/1786 | How to use split dataset | By default, all 3 splits will be loaded if you run the following:
```python
from datasets import load_dataset
dataset = load_dataset("lambada")
print(dataset["train"])
print(dataset["valid"])
```
If you wanted to do load this manually, you could do this:
```python
from datasets import load_dataset
data_files = {
"train": "data/lambada/train.txt",
"valid": "data/lambada/valid.txt",
"test": "data/lambada/test.txt",
}
ds = load_dataset("text", data_files=data_files)
``` | ![Capture1](https://user-images.githubusercontent.com/78090287/106057436-cb6a1f00-6111-11eb-8c9c-3658065b1fdf.PNG)
Hey,
I want to split the lambada dataset into corpus, test, train and valid txt files (like penn treebank) but I am not able to achieve this. What I am doing is, executing the lambada.py file in my project but its not giving desired results. Any help will be appreciated! | 56 | How to use split dataset
![Capture1](https://user-images.githubusercontent.com/78090287/106057436-cb6a1f00-6111-11eb-8c9c-3658065b1fdf.PNG)
Hey,
I want to split the lambada dataset into corpus, test, train and valid txt files (like penn treebank) but I am not able to achieve this. What I am doing is, executing the lambada.py file in my project but its not giving desired results. Any help will be appreciated!
By default, all 3 splits will be loaded if you run the following:
```python
from datasets import load_dataset
dataset = load_dataset("lambada")
print(dataset["train"])
print(dataset["valid"])
```
If you wanted to do load this manually, you could do this:
```python
from datasets import load_dataset
data_files = {
"train": "data/lambada/train.txt",
"valid": "data/lambada/valid.txt",
"test": "data/lambada/test.txt",
}
ds = load_dataset("text", data_files=data_files)
``` | [
-0.3074782789,
-0.046430856,
-0.0625263825,
0.4651073217,
0.1305699348,
0.203790769,
0.2765960097,
0.5807618499,
-0.4295652211,
0.0150460266,
-0.3925747275,
0.2540954351,
0.1838490069,
0.3340370059,
-0.1944947243,
-0.4850150943,
0.0906332433,
0.2447198927,
0.0513655134,
-0.1060137525,
-0.0785972774,
0.1636878252,
-0.4311265349,
-0.1009090096,
-0.5181130171,
-0.1812313646,
-0.291336596,
0.112613216,
-0.3164637983,
0.0334359594,
0.0643466488,
0.1915282309,
0.277076304,
0.4318369627,
-0.0001236601,
0.0267233849,
-0.0548699535,
-0.2515759766,
-0.1459669024,
-0.0903866068,
0.045801647,
0.0903776288,
0.1970301867,
-0.332878679,
-0.1814204752,
-0.4163512886,
-0.0681708381,
0.0015489107,
0.6935945153,
0.4342884421,
0.0081107859,
-0.4164194167,
-0.0055433875,
0.1647208929,
0.367272377,
0.3402590752,
-0.0229087137,
-0.0657094941,
0.1916346252,
0.0812231898,
0.0823047385,
0.0832444727,
-0.0158376731,
0.3440507352,
0.0033667425,
0.1852825433,
-0.2075950801,
-0.4350947142,
0.020141663,
0.197395578,
0.6681491733,
-0.3729459047,
-0.1618388146,
-0.2038088441,
-0.1345121711,
-0.4180257618,
-0.0778999254,
0.4423208535,
-0.1205712259,
0.137814641,
-0.2383985668,
0.1256262362,
-0.2445560396,
0.3950928152,
-0.06539689,
0.2446013093,
-0.0851912275,
0.1580072641,
0.1469617039,
0.2207309157,
0.1795392632,
-0.2389501333,
-0.1969653219,
0.0609343722,
-0.339017719,
-0.1809932142,
-0.4194637239,
-0.23347269,
0.2693915367,
0.4270796776,
-0.1869291812,
-0.1305601746,
-0.1368006766,
-0.1355264634,
0.5117036104,
0.0301422048,
0.2042327523,
0.3433422744,
0.038957838,
-0.0347347967,
-0.2185378969,
-0.1680016816,
-0.1378881335,
-0.2395497561,
-0.0726652071,
0.346591413,
0.29151088,
-0.2763410211,
-0.1029529124,
-0.5062013268,
-0.568762064,
-0.2831334174,
0.0132069588,
0.2261785716,
0.0955336615,
-0.0874019489,
-0.0726817027,
0.3877472281,
-0.3162637651,
-0.1819903553,
0.023104595,
0.071856752,
-0.2617368698,
-0.0702701956,
0.3142620623,
-0.442453444,
0.1238227785,
-0.0749287233,
0.045228526,
-0.3328417838,
0.1651384234,
-0.3937927485,
0.0545791574,
0.2088656276,
0.2188966721,
-0.0664287955,
0.1271421462,
0.1447398067,
-0.2334044874,
0.1048999876,
-0.1808667034,
-0.080176197,
0.1558270156,
-0.0196957253,
0.0611532293,
0.1351348013,
-0.4866173565,
0.2976646125,
0.0896811187,
0.1010287181,
0.0367787369,
0.1594926864,
-0.1407072097,
-0.0847328231,
0.2250469476,
0.1343903989,
-0.2925605476,
0.0847754553,
0.0228860434,
-0.28190431,
0.2453168184,
0.1108602881,
-0.1238229945,
0.5956163406,
-0.033051189,
0.0815178901,
0.4777336419,
-0.7511566281,
-0.1438723505,
0.3750924468,
0.2684718072,
-0.2678814828,
0.0732861534,
-0.1370614469,
0.5824894309,
-0.0600706972,
-0.191247642,
0.5537317991,
-0.2710950077,
0.0165224224,
0.0668277517,
-0.2530244589,
-0.088829346,
0.2614714503,
0.019068446,
-0.0778128356,
0.2262897044,
0.1465777904,
0.3665561378,
-0.1042810157,
0.3087859452,
-0.0434686691,
0.2427291274,
0.0071521183,
0.1786871701,
-0.3716313839,
-0.235885933,
0.0932082087,
0.0062296861,
-0.0141477874,
0.0756587386,
-0.2274846286,
-0.2097717822,
-0.3526072502,
-0.3782560229,
-0.1538071185,
0.004806906,
-0.1962913871,
0.2621347904,
0.010923977,
-0.2893615961,
0.0339714475,
0.0975751355,
0.4323086441,
0.0469643623,
0.4479081929,
0.1255494952,
-0.0886189789,
0.0299216788,
0.0520882607,
0.06349013,
-0.1969067007,
-0.1304465532,
0.4200090468,
0.3873398304,
-0.0858753473,
-0.0276353359,
-0.2635816634,
0.2716657519,
-0.2346803546,
0.0363777727,
-0.0131426016,
0.0668623894,
-0.2364052236,
-0.3931201994,
0.1513239592,
-0.2954008281,
0.250755012,
-0.0045373626,
0.1367307156,
0.1403151155,
-0.2662445605,
0.1603450179,
0.0253536683,
-0.1090279147,
-0.2627274096,
0.2647827566,
-0.3021569252,
0.1317908019,
-0.0627252236,
0.4427019954,
-0.134483546,
-0.0271012075,
0.0019469192,
-0.014633012,
0.3422632515,
0.1277847439,
0.4383702874,
0.3600809872,
0.1405369043,
0.1169457659,
0.1188060716,
0.2640935779,
-0.033017911,
0.1776481122,
0.1477965266,
0.2139979154,
0.1553719193,
-0.2412399501,
-0.1930328459,
-0.0302048605,
-0.0356369093,
0.2965059876,
0.3059887588,
-0.0889389291,
0.1264163554,
-0.2307715863,
-0.4963017106,
-0.3396853507,
-0.3279792368,
0.1289579719,
0.0233280156,
0.0331726559,
0.0473305546,
0.2906076312,
0.1235112175,
0.1898518056,
0.0364793688,
-0.074011974,
0.0600008927,
-0.0685783699,
-0.151494652,
-0.1349992156,
0.0668268055,
0.3735646605,
0.791811645,
0.2371255159,
-0.3188592792,
0.0106521463,
-0.2567156255,
0.0796772689,
0.2232893407,
-0.309864223,
0.0498284139,
0.1674468666,
-0.0184573177,
0.009667851,
-0.0992564857,
0.1296454966,
0.0814136639,
-0.1913520098,
0.0079762796,
-0.049873367,
0.0759783015,
-0.0945534408,
-0.5739890933,
-0.1470648348,
-0.2587655485,
0.4122138917,
0.2381134629,
0.1185840741,
-0.09718512,
0.082304284,
0.091028817,
0.0020555193,
0.0315580592,
0.189935565,
-0.1119549125,
0.1132452339,
-0.2350585908,
-0.2499634922,
0.3675470054,
0.1742353588,
-0.0573563389,
-0.0786818787,
-0.2121851891,
0.2335442454,
-0.0393018462,
-0.0227114595,
0.0712001398,
0.1150880307,
0.2429210842,
-0.2319126576,
0.1688638628,
-0.0902313814,
0.0654574409,
0.1491009742,
-0.2139848322,
0.262665391,
-0.1342072636,
0.3909491003,
0.0201900434,
0.6240466833,
0.4335102141,
-0.0120475348,
0.0362733677,
-0.1909749806,
-0.3649743199,
-0.0788716003,
-0.218203634,
0.0700498074,
-0.1186103523,
0.0122598428,
0.4296045899,
0.2938132584,
-0.0210728291,
-0.3732333779,
-0.324396044,
-0.3882585466,
-0.362678498,
0.034423504,
-0.1725736111,
-0.0155389253,
-0.2830411494,
0.0333824009,
0.2826633453,
-0.1496886164,
-0.3008391261,
0.2882889807,
0.0686449558,
-0.026858354,
-0.4724095762,
0.0764360875,
-0.2553851604,
0.3712051511,
-0.0017330876,
-0.1647524387,
-0.0501848198,
0.1439054012,
0.3047734499,
0.0562231578,
0.6318741441,
0.0120183518,
-0.0175543297,
0.0538036712,
-0.039511878,
0.1283360869,
0.0321728438,
-0.3007615805,
0.1802006811,
0.2179472744,
0.0696547106,
-0.460387826,
-0.3480937183,
0.347425133,
0.0905087516,
-0.107382752,
-0.0542227887,
-0.2201903611,
-0.1384022981,
-0.4269972444,
-0.0372312069,
0.2381215841,
0.0470559746,
-0.1664709747,
-0.202565521,
-0.0576918647,
-0.1789471656,
0.2900051177,
0.083204478,
0.2673642039,
-0.1505031437,
0.1634497792,
0.0319856852,
-0.0256317295,
0.5261569619,
0.550986886,
-0.2388632298,
-0.6641390324,
-0.0823729038,
-0.2544229925,
0.4143174589,
0.0188770276,
-0.1984588951,
-0.0576793589,
-0.0474884212,
-0.0492347889,
-0.0493975691,
0.0503168218,
0.2752568722,
-0.0799270421,
-0.4217451215,
-0.3295519352,
0.2977848947,
-0.0490427837,
0.1013775095,
0.3222386241,
-0.0535085872,
-0.3448224366,
0.4046643376,
0.1755126119,
0.8032972217,
-0.3154440522,
-0.0005888806,
-0.0163415652,
0.022042688,
0.4005246162,
-0.6602146626,
0.0886542201,
-0.2385677695,
-0.1123944372,
-0.1394271553,
-0.0939429253,
0.2245836556,
0.4019751847,
-0.4566557705,
0.1663924456,
0.1698406041,
-0.0922526419,
-0.2540281117,
0.1580016166,
-0.1684262604,
-0.1770732701,
-0.1891630739,
-0.0005676033,
-0.1797833741,
0.124298133,
0.0883834586,
-0.0329317749,
-0.1870013773,
-0.0197586045,
-0.0014658938,
0.0808523074,
-0.1125742793,
-0.1086507216,
-0.1998763382,
-0.2284725308,
0.2189380527,
0.6059164405,
0.2206417024,
-0.1742939055,
-0.1218367741,
0.1038348302,
-0.0908454582,
-0.1631280035,
-0.0984105319,
-0.0659006089,
0.1742142886,
-0.0648381934,
-0.3266786039,
0.1432161033,
0.1472800523,
-0.1852096468,
0.2426715046,
0.1704329401,
0.1030173898,
-0.5554350019,
-0.0098948274,
0.0667539909,
-0.0916174874,
-0.1178815365,
0.0122631053,
0.0074494183,
-0.2226941586,
0.3630225956,
-0.3571637571,
-0.2547812164,
-0.0981250852,
-0.0154842725,
0.0817957446,
-0.0431548655,
0.2503522635,
0.4610137939,
0.0802973211,
-0.2130612284,
0.331315577,
-0.0468948781,
-0.5658298731,
0.1925090104,
-0.0715365186,
0.2121954262,
0.2029462606,
0.6457027793,
-0.1237532049,
-0.0773305148,
-0.1040320173,
-0.3982211053,
-0.1800464243,
0.1881073415,
0.0979688615,
0.2443711758,
0.1031341106,
0.4572245777,
0.1946161687,
0.1644678861,
-0.0912947133,
0.4208090603,
0.016016176,
0.2344454378,
-0.2441109866,
0.0202299859,
0.1939492375,
0.0831430107,
-0.072645016,
0.1258039773,
-0.0110149868,
-0.1045786068,
-0.132672444,
0.2093547136,
0.0392488204,
-0.0429211594,
-0.1682126075,
-0.204652518,
-0.2691370547,
-0.2062190771,
0.1293132752,
-0.0536734089,
0.0404616371,
0.3889118135,
0.5246461034,
0.0588929951,
-0.5523726344,
-0.0831444114,
-0.0314933099,
0.0178720094,
0.1262948215,
0.1004040763,
-0.024442276,
0.0050220271,
-0.5351832509,
-0.0438054092,
0.4880591929,
-0.0485444926,
0.32296139,
0.0124439383,
0.3669817746,
-0.1774814278,
0.4626227319,
0.378272295,
-0.0179463662,
0.1993534565,
0.1697981507,
0.0539515913,
0.017697908,
0.1849733144,
0.2205456793,
-0.0006580853,
0.016036598,
0.4903226793,
-0.2690651417,
0.1666281521,
-0.3717580736,
-0.042149283,
0.3210775554,
0.1542686969,
0.303319484,
0.9101151824,
-0.0595884509,
0.0866480842,
0.1254603267,
0.0057803961,
0.08390221,
0.4529549181,
-0.063401714,
0.3624619246,
-0.2818380296,
0.1066174731,
0.2083311826,
-0.1350651532,
0.1179995537,
0.1469712704,
-0.1605193764,
-0.242438361,
-0.0634816587,
0.6651054025,
-0.0648376942,
-0.1775451154,
-0.2696161866,
0.3691826165,
0.2023307681,
0.084626101,
-0.3215959668,
-0.0835635141,
0.2510620058,
-0.1073638946,
-0.1984581649,
-0.2229513079,
0.0666635484,
0.2417348921,
0.0216235835,
-0.0559883378,
0.0558454953,
-0.0804673061,
0.1826960295,
-0.0439482331,
0.0037152267,
0.1432081461,
-0.0718040317,
0.3600771725,
0.1603082716,
0.0938419029,
0.0030690718,
-0.1667498648,
0.0194929503,
-0.0423206575,
-0.0701034889,
0.3184690177,
0.2982742488,
0.1052556708,
0.4170577526,
0.244734481,
0.0421322249,
-0.02367354,
-0.1360379606,
-0.014391534,
-0.0399270765,
-0.2733767331,
0.386454463,
0.0119800335,
-0.0934822261,
-0.0182080083,
-0.0559805892,
-0.3887081742,
-0.1473827958,
0.0218490437,
-0.2804154754,
0.06265264,
-0.0745948479,
-0.0414687693,
-0.0644684285,
0.2426130474,
-0.0561755896,
0.2943320572,
-0.3316037655,
-0.149858132,
-0.1963466108,
-0.1389787495,
-0.4514510036,
-0.5549047589,
-0.072099261,
0.067326948,
0.0214772187,
0.2326613963,
0.0926976651,
-0.1600026637,
0.1497941315,
0.5700587034,
-0.1629796624,
-0.2597332299,
-0.2790682912,
0.349046737,
-0.1956107467,
-0.3895208538,
0.0840137824,
0.3195916712,
-0.2047347724,
0.145926863,
-0.1514396071,
0.4545047879,
0.0031892876,
-0.359899193,
0.0629174784,
0.5531314015,
0.2346212119,
0.3608320057,
0.1640867591,
0.0573133975,
-0.0704561695,
0.2012002319,
0.1174851805,
0.2913323939,
-0.3149188757,
0.2003577352,
-0.1085395366,
0.0894613117,
-0.0003402847,
-0.0149925817,
-0.3560352623,
0.0652303919,
-0.0707266331,
0.1926892698,
0.5887854695,
0.5346590877,
-0.2799522281,
-0.1900988519,
-0.2888097465,
-0.1398527026,
0.1622962356,
-0.5503790975,
-0.1900802106,
0.1941522211,
0.0497573316,
0.3609690368,
-0.0554297827,
-0.5752096176,
-0.0025692077,
0.2839443088,
-0.1510567516,
-0.1649817079,
0.2527158558,
0.3656672835,
-0.1321681887,
0.0594672263,
0.052702222,
0.1399407089,
-0.2519499063,
-0.0149262259,
-0.2372123152
] |
https://github.com/huggingface/datasets/issues/1785 | Not enough disk space (Needed: Unknown size) when caching on a cluster | Hi !
What do you mean by "disk_usage(".").free` can't compute on the cluster's shared disk" exactly ?
Does it return 0 ? | I'm running some experiments where I'm caching datasets on a cluster and accessing it through multiple compute nodes. However, I get an error when loading the cached dataset from the shared disk.
The exact error thrown:
```bash
>>> load_dataset(dataset, cache_dir="/path/to/cluster/shared/path")
OSError: Not enough disk space. Needed: Unknown size (download: Unknown size, generated: Unknown size, post-processed: Unknown size)
```
[`utils.has_sufficient_disk_space`](https://github.com/huggingface/datasets/blob/8a03ab7d123a76ee744304f21ce868c75f411214/src/datasets/utils/py_utils.py#L332) fails on each job because of how the cluster system is designed (`disk_usage(".").free` can't compute on the cluster's shared disk).
This is exactly where the error gets thrown:
https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L502
```python
if not utils.has_sufficient_disk_space(self.info.size_in_bytes or 0, directory=self._cache_dir_root):
raise IOError(
"Not enough disk space. Needed: {} (download: {}, generated: {}, post-processed: {})".format(
utils.size_str(self.info.size_in_bytes or 0),
utils.size_str(self.info.download_size or 0),
utils.size_str(self.info.dataset_size or 0),
utils.size_str(self.info.post_processing_size or 0),
)
)
```
What would be a good way to circumvent this? my current fix is to manually comment out that part, but that is not ideal.
Would it be possible to pass a flag to skip this check on disk space? | 22 | Not enough disk space (Needed: Unknown size) when caching on a cluster
I'm running some experiments where I'm caching datasets on a cluster and accessing it through multiple compute nodes. However, I get an error when loading the cached dataset from the shared disk.
The exact error thrown:
```bash
>>> load_dataset(dataset, cache_dir="/path/to/cluster/shared/path")
OSError: Not enough disk space. Needed: Unknown size (download: Unknown size, generated: Unknown size, post-processed: Unknown size)
```
[`utils.has_sufficient_disk_space`](https://github.com/huggingface/datasets/blob/8a03ab7d123a76ee744304f21ce868c75f411214/src/datasets/utils/py_utils.py#L332) fails on each job because of how the cluster system is designed (`disk_usage(".").free` can't compute on the cluster's shared disk).
This is exactly where the error gets thrown:
https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L502
```python
if not utils.has_sufficient_disk_space(self.info.size_in_bytes or 0, directory=self._cache_dir_root):
raise IOError(
"Not enough disk space. Needed: {} (download: {}, generated: {}, post-processed: {})".format(
utils.size_str(self.info.size_in_bytes or 0),
utils.size_str(self.info.download_size or 0),
utils.size_str(self.info.dataset_size or 0),
utils.size_str(self.info.post_processing_size or 0),
)
)
```
What would be a good way to circumvent this? my current fix is to manually comment out that part, but that is not ideal.
Would it be possible to pass a flag to skip this check on disk space?
Hi !
What do you mean by "disk_usage(".").free` can't compute on the cluster's shared disk" exactly ?
Does it return 0 ? | [
-0.077743046,
-0.4187169075,
-0.0846218616,
0.2431603819,
-0.0970101953,
0.1506602615,
0.0705344975,
0.340121299,
0.3962351978,
0.3933159411,
0.4183928967,
-0.1389312744,
-0.0912500247,
0.0038916988,
-0.1739585549,
0.2417322844,
-0.008229685,
-0.0606452934,
0.3455673754,
0.1274864972,
-0.4057287276,
0.013044103,
0.0944504216,
-0.3736139238,
-0.5426239967,
-0.1880922168,
-0.1662808508,
0.1566854864,
0.2269620895,
-0.2247433364,
0.3221060932,
-0.0054951115,
-0.1011394337,
0.57207793,
-0.000115944,
0.0363122933,
0.1715254039,
-0.1809052825,
-0.4399377406,
-0.0386958495,
0.2173041552,
-0.4069225192,
-0.2233587652,
-0.3619659543,
-0.0103092957,
0.1603567153,
-0.0511812568,
-0.4436120391,
0.1765251011,
-0.0691840351,
0.167969346,
0.3530051112,
-0.2203018218,
-0.0926141888,
-0.2659411132,
0.1767233014,
-0.0469130538,
0.5180591345,
0.2992624342,
0.0753152594,
-0.278730154,
0.220809415,
-0.1333252341,
0.1601160318,
0.4138146937,
-0.1359975785,
-0.0745275617,
-0.1845135838,
0.196237728,
-0.0268669985,
0.4277344346,
-0.1950323582,
-0.5273439884,
-0.5711026192,
0.0500526577,
-0.1597714126,
0.4396585226,
0.0364260562,
-0.4096873403,
0.1226714551,
-0.3018591404,
-0.3372612596,
-0.2010518312,
-0.2099773586,
0.0532088876,
0.1641298532,
0.001683414,
0.083085306,
0.3270327449,
0.0175013412,
-0.0256257895,
0.0264363289,
0.1729608923,
0.2536418736,
-0.286546737,
0.015176001,
-0.0948408619,
0.2101235539,
0.1011191458,
0.210698545,
0.0610056967,
-0.1125410125,
0.0735731199,
0.2540668845,
0.0136579322,
0.2466120869,
-0.2650672793,
-0.0978882983,
0.2030571997,
-0.0030464942,
0.1735391766,
-0.1133198515,
0.0481718257,
-0.3508068919,
0.1162028611,
-0.0180882458,
0.2040127963,
-0.0714850351,
-0.3821853697,
0.1272477657,
0.2050052136,
0.3049911857,
0.2122821063,
0.2848547697,
0.081049867,
0.2399785221,
0.2188418359,
0.1994529068,
-0.0902342796,
-0.0968263671,
-0.1159809977,
-0.0147070605,
0.0885306448,
0.1693160534,
0.3448052108,
0.0367702097,
0.2115975618,
-0.0179044642,
0.4590660036,
-0.1054459512,
-0.0721762404,
-0.2352616042,
-0.1191627383,
0.4233518839,
0.1197761372,
0.0117572416,
0.2519825101,
0.150050655,
-0.151038453,
0.267791003,
-0.3836438954,
-0.4553595483,
0.0440195017,
0.0724626854,
-0.3528415859,
0.201118812,
-0.4066090882,
-0.0384399742,
0.3097245991,
-0.1824394166,
0.1011643708,
0.0928385854,
-0.388710171,
-0.2462708652,
0.1381941438,
0.3473313451,
-0.1142510697,
0.0037162027,
-0.3107170761,
0.1621557176,
0.0525875054,
0.4145956337,
0.1311629415,
0.1386435181,
-0.4277252555,
0.1380107254,
0.112706773,
-0.3308421671,
-0.5418027043,
0.3061304092,
-0.1718518734,
0.251601547,
0.5377888083,
0.2614460588,
-0.0163329206,
-0.2336916924,
0.2327865213,
0.2714537084,
-0.2196910083,
0.0563452803,
-0.3533274829,
-0.2634564638,
0.0278722569,
0.0614293441,
0.3454006314,
0.1085645631,
0.0109478934,
-0.0060029062,
0.181870684,
0.0549798459,
0.2010060102,
0.319323808,
0.3190515637,
-0.3444589972,
-0.0738657489,
0.0217246003,
-0.5194780827,
0.3491621912,
0.1930717975,
-0.210014835,
-0.0646496564,
-0.4432948828,
-0.2809631526,
0.0622079372,
0.2482937425,
0.3274296522,
0.0486466475,
-0.0373881832,
0.2494668663,
-0.3069352806,
-0.0596501715,
0.1668298095,
-0.2572430074,
-0.0578985289,
0.1028768942,
-0.037163388,
-0.0423911139,
-0.1400398463,
0.0494483598,
0.0646106005,
0.065027073,
0.1349681467,
-0.0143348835,
0.4134911895,
-0.1063749939,
0.2247715741,
-0.0903510526,
0.1345997751,
0.1523135155,
0.3512611985,
0.0020520738,
0.1752401441,
0.0069471248,
-0.1697660834,
-0.1110438034,
0.2095980346,
-0.0455697738,
0.2853601277,
-0.0826583356,
0.0640583113,
0.062438,
0.0560383089,
0.1237754896,
-0.0592895821,
0.2901299894,
-0.1966569424,
0.4879350662,
0.0813177079,
0.0228466559,
-0.0144202309,
0.0694394708,
0.1592282355,
0.2913538516,
0.1565067917,
0.2970968783,
-0.0345214307,
-0.0058795158,
0.281740725,
0.2664144933,
0.1560028344,
0.0153094009,
-0.1753183603,
0.0451873355,
-0.2055585831,
0.0528199226,
-0.0503013469,
0.1580186039,
0.2922109067,
0.0067302659,
-0.2964169681,
0.0960464776,
-0.3090456724,
0.2155116647,
0.0772977546,
-0.2874604762,
-0.0579076111,
0.0557800084,
0.1828183085,
0.0615938306,
0.1889596581,
-0.458917141,
-0.3148480952,
0.1746361405,
0.6444194913,
-0.2373902053,
-0.0952424482,
-0.3729639053,
0.47324121,
0.0780527741,
-0.4257941842,
-0.0265632924,
-0.2685462832,
-0.105551824,
0.0170709025,
0.3254655302,
-0.2578275204,
0.3435429633,
0.009413938,
0.0713444501,
-0.4250701964,
0.1581228077,
-0.1697875708,
0.026744483,
0.160488829,
-0.1307637393,
0.3355616331,
-0.1221083775,
-0.161101833,
0.1600524932,
-0.0386516824,
-0.0417478904,
0.0091871368,
0.157061711,
0.1753278822,
-0.3232639432,
0.0315407254,
-0.1793825924,
-0.5495166779,
0.1743901223,
-0.1816839725,
0.2716464996,
0.1036405638,
0.1733865887,
-0.1049474105,
0.7099816799,
-0.1731762439,
-0.2496192008,
-0.6116565466,
0.2382910997,
-0.0803578198,
-0.0295519698,
-0.0471712351,
0.0296281688,
0.2122026235,
0.4242190421,
-0.4782416224,
-0.4002625942,
-0.1671660691,
0.2294673622,
-0.2420356572,
-0.0321568176,
0.1791037619,
-0.1486546844,
-0.0734727383,
-0.1409639269,
-0.0281639285,
0.0528291315,
0.0094647231,
0.2762104273,
0.2927937806,
0.2192623466,
0.3207841218,
0.7062375546,
-0.1594573408,
0.2500558794,
0.2755180895,
0.1817435026,
0.6162170768,
0.0905261114,
-0.0536034405,
0.0400998928,
0.0080744736,
-0.6150439978,
0.018974917,
-0.0332710035,
0.1380775571,
-0.0282102246,
-0.3949749768,
0.0797365531,
-0.2690036893,
0.3064283133,
-0.4407607913,
0.2631148696,
-0.2624961436,
0.0036536045,
-0.3661700189,
-0.0888017491,
-0.0278777946,
0.0957246572,
0.5163893104,
0.1993707418,
-0.2578813434,
-0.2660911977,
-0.5647939444,
0.3253155053,
-0.006048427,
0.1244612709,
-0.3100083172,
0.0745291859,
-0.0808813274,
0.010127387,
0.7869898081,
-0.0905365199,
0.2198172063,
0.0822388679,
0.0257655121,
-0.5359351635,
-0.0108492747,
0.1368561238,
0.3804581165,
-0.0719699562,
0.4385928512,
-0.1767696738,
0.1249717698,
-0.4394178391,
0.3606897295,
-0.3306918144,
-0.2415883839,
-0.3854802251,
-0.3814748526,
-0.4833007753,
0.4473902285,
0.4565168023,
0.2527857721,
-0.0483523719,
0.3299102485,
-0.1702632904,
-0.0149609568,
0.1736516953,
-0.0075803809,
0.443208307,
-0.1366668791,
0.0413892493,
0.10192018,
-0.0565784611,
0.427754879,
0.4132583737,
0.1096960157,
0.153211087,
0.2755295634,
0.0156118544,
0.3339525759,
0.3349297047,
-0.0720828325,
0.0272417124,
0.1159466431,
0.2456975579,
-0.4392110109,
-0.0649362803,
-0.3937532604,
-0.053410694,
-0.0902631804,
-0.0206969175,
0.3726739585,
0.3526022732,
0.0177913681,
0.0702154934,
0.3179870546,
-0.3127156496,
0.260708034,
-0.0260276962,
0.8725861311,
-0.0851956457,
0.0190442987,
0.0668717548,
0.3008273542,
0.3401437104,
-0.4726660252,
0.3613075316,
0.0440848432,
-0.2942005396,
0.0325816348,
-0.0121936025,
-0.0210776478,
0.2959339917,
-0.1688451916,
0.4016992748,
-0.5068142414,
0.0121939871,
-0.0954149067,
0.1365531087,
-0.6846151948,
-0.3742956817,
-0.2389674634,
0.1206891164,
-0.1377955079,
0.2103003263,
-0.2451043129,
0.1086564139,
0.0337139294,
-0.3128850758,
-0.3662667572,
-0.1701535881,
0.0267178789,
0.3035692275,
-0.1789853871,
0.0236432031,
-0.0893728659,
0.1346774697,
0.2152775079,
0.3010419011,
-0.1435464621,
0.102480419,
-0.1572921276,
-0.0557976216,
0.0648061261,
0.0752228796,
0.1123975292,
0.0016257297,
-0.3096866906,
0.1574650109,
-0.2591038048,
-0.4899291098,
0.0290623084,
-0.0438139178,
-0.2942897677,
-0.0338732265,
-0.2902981043,
-0.4566005468,
-0.0054636048,
-0.0876832604,
0.0665068105,
0.0191742908,
-0.1189481318,
0.1476352364,
0.0235257652,
-0.2044097036,
0.1164215952,
0.190723449,
0.1715484113,
-0.3462994993,
0.3859964311,
-0.373198539,
-0.0873680115,
-0.1736938357,
-0.1504092216,
-0.1342985183,
0.0950826779,
0.3430255353,
-0.0794039145,
-0.1285796314,
-0.2427508384,
-0.2310127616,
0.6502942443,
0.4262383878,
-0.144083187,
-0.478376627,
-0.3731829822,
0.2676647007,
0.0803002268,
0.2381605655,
-0.0641208291,
-0.0984875932,
0.0306086056,
0.1129468083,
-0.2559909523,
-0.0557872131,
-0.440733999,
0.0071715456,
0.2117858827,
0.1263764799,
0.2143027186,
-0.0947058052,
-0.0827279761,
0.1265942901,
-0.0557575412,
-0.1126359105,
0.0449619144,
0.1506277472,
0.0469186604,
0.1951723546,
0.1735436618,
-0.4588237107,
0.2376365513,
-0.2655064762,
0.175375998,
0.4182689488,
-0.0454815663,
-0.3415571749,
0.0746574774,
0.4974748492,
-0.1709237695,
0.1422319114,
0.1285944581,
0.1546489745,
-0.2296800911,
0.1842871457,
0.1251477748,
0.141740188,
0.2366863787,
-0.1120783761,
0.2201439738,
0.0385218523,
-0.1545709521,
0.0684715435,
-0.0448020846,
0.2478228211,
0.2652956843,
-0.0790445432,
-0.0293991696,
0.0338056535,
0.0698839277,
0.2173097581,
-0.23949036,
-0.11724893,
0.2396283597,
-0.0299390592,
0.1197566837,
0.501385808,
0.3876141608,
-0.3748737574,
0.0745424256,
0.092380546,
0.56485641,
-0.26017645,
0.0413095504,
0.1336950809,
0.0506066494,
0.0030421845,
0.1490101367,
-0.0633012205,
0.3891545832,
0.3070391119,
-0.1713533849,
0.2159720361,
0.240812093,
-0.1208609343,
-0.1497632712,
-0.4051087499,
0.0863525793,
0.0817292184,
0.0425833166,
0.1304463446,
-0.3192768693,
-0.047600206,
-0.3641908169,
-0.1965409219,
-0.2249183059,
-0.1132415608,
-0.4139752984,
-0.0106493738,
-0.0181172919,
-0.0879317522,
-0.0273675881,
-0.12374755,
0.3569253981,
-0.3851692677,
0.3071929514,
0.0091477921,
0.0622751303,
0.2990062833,
-0.2994196117,
0.4684782326,
0.1641291231,
-0.3684591651,
0.0377963446,
0.2732796669,
-0.2538941205,
0.2997133136,
0.1712868065,
0.678319037,
0.2227465063,
-0.0918961242,
0.0675154552,
0.0342150964,
0.0763493478,
-0.3394199014,
-0.0230130032,
0.0669184253,
-0.1332620233,
0.1145668402,
0.1374944746,
-0.094496116,
0.2236459851,
0.0117417332,
0.2606367469,
-0.2572072446,
-0.1200351939,
-0.1719236225,
-0.1995497942,
-0.1337638944,
0.0917496905,
-0.2527790368,
-0.2110940516,
0.3524631262,
-0.0509158187,
0.1831525564,
0.1991887689,
0.0672124773,
-0.0960667655,
0.2713785768,
0.3381308615,
-0.5006517768,
-0.3073892295,
0.0890708044,
-0.5300476551,
0.2179004103,
-0.287971586,
-0.0791888833,
-0.0316293128,
0.2162606716,
-0.0353246778,
-0.1100046113,
0.0923836902,
-0.0869553685,
-0.0684574097,
-0.1544494778,
-0.2633786798,
-0.2788787782,
-0.0878152847,
-0.2979598641,
0.2715919018,
-0.5973241925,
-0.0476715043,
0.1096990034,
0.0626047477,
0.0808957145,
-0.0069346298,
0.2312021703,
0.442114681,
0.3236790001,
-0.0014011161,
0.4533216655,
0.0691782013,
-0.1578181237,
-0.3555994332,
-0.0512273945,
-0.1567315906,
0.0503356569,
0.122981824,
0.2397242337,
-0.6420226693,
0.0890368819,
-0.2371955812,
0.2477699816,
0.0678071156,
-0.0797339901,
0.0980476961,
-0.0238936469,
-0.3431889117,
0.1982949972,
0.2360746413,
0.2301771939,
-0.0658627003,
0.3270432949,
-0.1933470517,
-0.156314835,
0.4829874933,
-0.139692843,
-0.3495691717,
-0.2246769518,
0.4760476947,
0.0577695742,
-0.0404225364,
-0.1970505118,
-0.0889567733,
0.1853538901,
0.0791053846,
0.0632002577,
-0.1794751287,
-0.2648897171,
-0.2492374778,
-0.0139694149,
0.209180519,
-0.3121143878,
-0.3135882318,
0.0350735225,
-0.2094390094
] |
https://github.com/huggingface/datasets/issues/1785 | Not enough disk space (Needed: Unknown size) when caching on a cluster | Yes, that's right. It shows 0 free space even though there is. I suspect it might have to do with permissions on the shared disk.
```python
>>> disk_usage(".")
usage(total=999999, used=999999, free=0)
``` | I'm running some experiments where I'm caching datasets on a cluster and accessing it through multiple compute nodes. However, I get an error when loading the cached dataset from the shared disk.
The exact error thrown:
```bash
>>> load_dataset(dataset, cache_dir="/path/to/cluster/shared/path")
OSError: Not enough disk space. Needed: Unknown size (download: Unknown size, generated: Unknown size, post-processed: Unknown size)
```
[`utils.has_sufficient_disk_space`](https://github.com/huggingface/datasets/blob/8a03ab7d123a76ee744304f21ce868c75f411214/src/datasets/utils/py_utils.py#L332) fails on each job because of how the cluster system is designed (`disk_usage(".").free` can't compute on the cluster's shared disk).
This is exactly where the error gets thrown:
https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L502
```python
if not utils.has_sufficient_disk_space(self.info.size_in_bytes or 0, directory=self._cache_dir_root):
raise IOError(
"Not enough disk space. Needed: {} (download: {}, generated: {}, post-processed: {})".format(
utils.size_str(self.info.size_in_bytes or 0),
utils.size_str(self.info.download_size or 0),
utils.size_str(self.info.dataset_size or 0),
utils.size_str(self.info.post_processing_size or 0),
)
)
```
What would be a good way to circumvent this? my current fix is to manually comment out that part, but that is not ideal.
Would it be possible to pass a flag to skip this check on disk space? | 32 | Not enough disk space (Needed: Unknown size) when caching on a cluster
I'm running some experiments where I'm caching datasets on a cluster and accessing it through multiple compute nodes. However, I get an error when loading the cached dataset from the shared disk.
The exact error thrown:
```bash
>>> load_dataset(dataset, cache_dir="/path/to/cluster/shared/path")
OSError: Not enough disk space. Needed: Unknown size (download: Unknown size, generated: Unknown size, post-processed: Unknown size)
```
[`utils.has_sufficient_disk_space`](https://github.com/huggingface/datasets/blob/8a03ab7d123a76ee744304f21ce868c75f411214/src/datasets/utils/py_utils.py#L332) fails on each job because of how the cluster system is designed (`disk_usage(".").free` can't compute on the cluster's shared disk).
This is exactly where the error gets thrown:
https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L502
```python
if not utils.has_sufficient_disk_space(self.info.size_in_bytes or 0, directory=self._cache_dir_root):
raise IOError(
"Not enough disk space. Needed: {} (download: {}, generated: {}, post-processed: {})".format(
utils.size_str(self.info.size_in_bytes or 0),
utils.size_str(self.info.download_size or 0),
utils.size_str(self.info.dataset_size or 0),
utils.size_str(self.info.post_processing_size or 0),
)
)
```
What would be a good way to circumvent this? my current fix is to manually comment out that part, but that is not ideal.
Would it be possible to pass a flag to skip this check on disk space?
Yes, that's right. It shows 0 free space even though there is. I suspect it might have to do with permissions on the shared disk.
```python
>>> disk_usage(".")
usage(total=999999, used=999999, free=0)
``` | [
-0.077743046,
-0.4187169075,
-0.0846218616,
0.2431603819,
-0.0970101953,
0.1506602615,
0.0705344975,
0.340121299,
0.3962351978,
0.3933159411,
0.4183928967,
-0.1389312744,
-0.0912500247,
0.0038916988,
-0.1739585549,
0.2417322844,
-0.008229685,
-0.0606452934,
0.3455673754,
0.1274864972,
-0.4057287276,
0.013044103,
0.0944504216,
-0.3736139238,
-0.5426239967,
-0.1880922168,
-0.1662808508,
0.1566854864,
0.2269620895,
-0.2247433364,
0.3221060932,
-0.0054951115,
-0.1011394337,
0.57207793,
-0.000115944,
0.0363122933,
0.1715254039,
-0.1809052825,
-0.4399377406,
-0.0386958495,
0.2173041552,
-0.4069225192,
-0.2233587652,
-0.3619659543,
-0.0103092957,
0.1603567153,
-0.0511812568,
-0.4436120391,
0.1765251011,
-0.0691840351,
0.167969346,
0.3530051112,
-0.2203018218,
-0.0926141888,
-0.2659411132,
0.1767233014,
-0.0469130538,
0.5180591345,
0.2992624342,
0.0753152594,
-0.278730154,
0.220809415,
-0.1333252341,
0.1601160318,
0.4138146937,
-0.1359975785,
-0.0745275617,
-0.1845135838,
0.196237728,
-0.0268669985,
0.4277344346,
-0.1950323582,
-0.5273439884,
-0.5711026192,
0.0500526577,
-0.1597714126,
0.4396585226,
0.0364260562,
-0.4096873403,
0.1226714551,
-0.3018591404,
-0.3372612596,
-0.2010518312,
-0.2099773586,
0.0532088876,
0.1641298532,
0.001683414,
0.083085306,
0.3270327449,
0.0175013412,
-0.0256257895,
0.0264363289,
0.1729608923,
0.2536418736,
-0.286546737,
0.015176001,
-0.0948408619,
0.2101235539,
0.1011191458,
0.210698545,
0.0610056967,
-0.1125410125,
0.0735731199,
0.2540668845,
0.0136579322,
0.2466120869,
-0.2650672793,
-0.0978882983,
0.2030571997,
-0.0030464942,
0.1735391766,
-0.1133198515,
0.0481718257,
-0.3508068919,
0.1162028611,
-0.0180882458,
0.2040127963,
-0.0714850351,
-0.3821853697,
0.1272477657,
0.2050052136,
0.3049911857,
0.2122821063,
0.2848547697,
0.081049867,
0.2399785221,
0.2188418359,
0.1994529068,
-0.0902342796,
-0.0968263671,
-0.1159809977,
-0.0147070605,
0.0885306448,
0.1693160534,
0.3448052108,
0.0367702097,
0.2115975618,
-0.0179044642,
0.4590660036,
-0.1054459512,
-0.0721762404,
-0.2352616042,
-0.1191627383,
0.4233518839,
0.1197761372,
0.0117572416,
0.2519825101,
0.150050655,
-0.151038453,
0.267791003,
-0.3836438954,
-0.4553595483,
0.0440195017,
0.0724626854,
-0.3528415859,
0.201118812,
-0.4066090882,
-0.0384399742,
0.3097245991,
-0.1824394166,
0.1011643708,
0.0928385854,
-0.388710171,
-0.2462708652,
0.1381941438,
0.3473313451,
-0.1142510697,
0.0037162027,
-0.3107170761,
0.1621557176,
0.0525875054,
0.4145956337,
0.1311629415,
0.1386435181,
-0.4277252555,
0.1380107254,
0.112706773,
-0.3308421671,
-0.5418027043,
0.3061304092,
-0.1718518734,
0.251601547,
0.5377888083,
0.2614460588,
-0.0163329206,
-0.2336916924,
0.2327865213,
0.2714537084,
-0.2196910083,
0.0563452803,
-0.3533274829,
-0.2634564638,
0.0278722569,
0.0614293441,
0.3454006314,
0.1085645631,
0.0109478934,
-0.0060029062,
0.181870684,
0.0549798459,
0.2010060102,
0.319323808,
0.3190515637,
-0.3444589972,
-0.0738657489,
0.0217246003,
-0.5194780827,
0.3491621912,
0.1930717975,
-0.210014835,
-0.0646496564,
-0.4432948828,
-0.2809631526,
0.0622079372,
0.2482937425,
0.3274296522,
0.0486466475,
-0.0373881832,
0.2494668663,
-0.3069352806,
-0.0596501715,
0.1668298095,
-0.2572430074,
-0.0578985289,
0.1028768942,
-0.037163388,
-0.0423911139,
-0.1400398463,
0.0494483598,
0.0646106005,
0.065027073,
0.1349681467,
-0.0143348835,
0.4134911895,
-0.1063749939,
0.2247715741,
-0.0903510526,
0.1345997751,
0.1523135155,
0.3512611985,
0.0020520738,
0.1752401441,
0.0069471248,
-0.1697660834,
-0.1110438034,
0.2095980346,
-0.0455697738,
0.2853601277,
-0.0826583356,
0.0640583113,
0.062438,
0.0560383089,
0.1237754896,
-0.0592895821,
0.2901299894,
-0.1966569424,
0.4879350662,
0.0813177079,
0.0228466559,
-0.0144202309,
0.0694394708,
0.1592282355,
0.2913538516,
0.1565067917,
0.2970968783,
-0.0345214307,
-0.0058795158,
0.281740725,
0.2664144933,
0.1560028344,
0.0153094009,
-0.1753183603,
0.0451873355,
-0.2055585831,
0.0528199226,
-0.0503013469,
0.1580186039,
0.2922109067,
0.0067302659,
-0.2964169681,
0.0960464776,
-0.3090456724,
0.2155116647,
0.0772977546,
-0.2874604762,
-0.0579076111,
0.0557800084,
0.1828183085,
0.0615938306,
0.1889596581,
-0.458917141,
-0.3148480952,
0.1746361405,
0.6444194913,
-0.2373902053,
-0.0952424482,
-0.3729639053,
0.47324121,
0.0780527741,
-0.4257941842,
-0.0265632924,
-0.2685462832,
-0.105551824,
0.0170709025,
0.3254655302,
-0.2578275204,
0.3435429633,
0.009413938,
0.0713444501,
-0.4250701964,
0.1581228077,
-0.1697875708,
0.026744483,
0.160488829,
-0.1307637393,
0.3355616331,
-0.1221083775,
-0.161101833,
0.1600524932,
-0.0386516824,
-0.0417478904,
0.0091871368,
0.157061711,
0.1753278822,
-0.3232639432,
0.0315407254,
-0.1793825924,
-0.5495166779,
0.1743901223,
-0.1816839725,
0.2716464996,
0.1036405638,
0.1733865887,
-0.1049474105,
0.7099816799,
-0.1731762439,
-0.2496192008,
-0.6116565466,
0.2382910997,
-0.0803578198,
-0.0295519698,
-0.0471712351,
0.0296281688,
0.2122026235,
0.4242190421,
-0.4782416224,
-0.4002625942,
-0.1671660691,
0.2294673622,
-0.2420356572,
-0.0321568176,
0.1791037619,
-0.1486546844,
-0.0734727383,
-0.1409639269,
-0.0281639285,
0.0528291315,
0.0094647231,
0.2762104273,
0.2927937806,
0.2192623466,
0.3207841218,
0.7062375546,
-0.1594573408,
0.2500558794,
0.2755180895,
0.1817435026,
0.6162170768,
0.0905261114,
-0.0536034405,
0.0400998928,
0.0080744736,
-0.6150439978,
0.018974917,
-0.0332710035,
0.1380775571,
-0.0282102246,
-0.3949749768,
0.0797365531,
-0.2690036893,
0.3064283133,
-0.4407607913,
0.2631148696,
-0.2624961436,
0.0036536045,
-0.3661700189,
-0.0888017491,
-0.0278777946,
0.0957246572,
0.5163893104,
0.1993707418,
-0.2578813434,
-0.2660911977,
-0.5647939444,
0.3253155053,
-0.006048427,
0.1244612709,
-0.3100083172,
0.0745291859,
-0.0808813274,
0.010127387,
0.7869898081,
-0.0905365199,
0.2198172063,
0.0822388679,
0.0257655121,
-0.5359351635,
-0.0108492747,
0.1368561238,
0.3804581165,
-0.0719699562,
0.4385928512,
-0.1767696738,
0.1249717698,
-0.4394178391,
0.3606897295,
-0.3306918144,
-0.2415883839,
-0.3854802251,
-0.3814748526,
-0.4833007753,
0.4473902285,
0.4565168023,
0.2527857721,
-0.0483523719,
0.3299102485,
-0.1702632904,
-0.0149609568,
0.1736516953,
-0.0075803809,
0.443208307,
-0.1366668791,
0.0413892493,
0.10192018,
-0.0565784611,
0.427754879,
0.4132583737,
0.1096960157,
0.153211087,
0.2755295634,
0.0156118544,
0.3339525759,
0.3349297047,
-0.0720828325,
0.0272417124,
0.1159466431,
0.2456975579,
-0.4392110109,
-0.0649362803,
-0.3937532604,
-0.053410694,
-0.0902631804,
-0.0206969175,
0.3726739585,
0.3526022732,
0.0177913681,
0.0702154934,
0.3179870546,
-0.3127156496,
0.260708034,
-0.0260276962,
0.8725861311,
-0.0851956457,
0.0190442987,
0.0668717548,
0.3008273542,
0.3401437104,
-0.4726660252,
0.3613075316,
0.0440848432,
-0.2942005396,
0.0325816348,
-0.0121936025,
-0.0210776478,
0.2959339917,
-0.1688451916,
0.4016992748,
-0.5068142414,
0.0121939871,
-0.0954149067,
0.1365531087,
-0.6846151948,
-0.3742956817,
-0.2389674634,
0.1206891164,
-0.1377955079,
0.2103003263,
-0.2451043129,
0.1086564139,
0.0337139294,
-0.3128850758,
-0.3662667572,
-0.1701535881,
0.0267178789,
0.3035692275,
-0.1789853871,
0.0236432031,
-0.0893728659,
0.1346774697,
0.2152775079,
0.3010419011,
-0.1435464621,
0.102480419,
-0.1572921276,
-0.0557976216,
0.0648061261,
0.0752228796,
0.1123975292,
0.0016257297,
-0.3096866906,
0.1574650109,
-0.2591038048,
-0.4899291098,
0.0290623084,
-0.0438139178,
-0.2942897677,
-0.0338732265,
-0.2902981043,
-0.4566005468,
-0.0054636048,
-0.0876832604,
0.0665068105,
0.0191742908,
-0.1189481318,
0.1476352364,
0.0235257652,
-0.2044097036,
0.1164215952,
0.190723449,
0.1715484113,
-0.3462994993,
0.3859964311,
-0.373198539,
-0.0873680115,
-0.1736938357,
-0.1504092216,
-0.1342985183,
0.0950826779,
0.3430255353,
-0.0794039145,
-0.1285796314,
-0.2427508384,
-0.2310127616,
0.6502942443,
0.4262383878,
-0.144083187,
-0.478376627,
-0.3731829822,
0.2676647007,
0.0803002268,
0.2381605655,
-0.0641208291,
-0.0984875932,
0.0306086056,
0.1129468083,
-0.2559909523,
-0.0557872131,
-0.440733999,
0.0071715456,
0.2117858827,
0.1263764799,
0.2143027186,
-0.0947058052,
-0.0827279761,
0.1265942901,
-0.0557575412,
-0.1126359105,
0.0449619144,
0.1506277472,
0.0469186604,
0.1951723546,
0.1735436618,
-0.4588237107,
0.2376365513,
-0.2655064762,
0.175375998,
0.4182689488,
-0.0454815663,
-0.3415571749,
0.0746574774,
0.4974748492,
-0.1709237695,
0.1422319114,
0.1285944581,
0.1546489745,
-0.2296800911,
0.1842871457,
0.1251477748,
0.141740188,
0.2366863787,
-0.1120783761,
0.2201439738,
0.0385218523,
-0.1545709521,
0.0684715435,
-0.0448020846,
0.2478228211,
0.2652956843,
-0.0790445432,
-0.0293991696,
0.0338056535,
0.0698839277,
0.2173097581,
-0.23949036,
-0.11724893,
0.2396283597,
-0.0299390592,
0.1197566837,
0.501385808,
0.3876141608,
-0.3748737574,
0.0745424256,
0.092380546,
0.56485641,
-0.26017645,
0.0413095504,
0.1336950809,
0.0506066494,
0.0030421845,
0.1490101367,
-0.0633012205,
0.3891545832,
0.3070391119,
-0.1713533849,
0.2159720361,
0.240812093,
-0.1208609343,
-0.1497632712,
-0.4051087499,
0.0863525793,
0.0817292184,
0.0425833166,
0.1304463446,
-0.3192768693,
-0.047600206,
-0.3641908169,
-0.1965409219,
-0.2249183059,
-0.1132415608,
-0.4139752984,
-0.0106493738,
-0.0181172919,
-0.0879317522,
-0.0273675881,
-0.12374755,
0.3569253981,
-0.3851692677,
0.3071929514,
0.0091477921,
0.0622751303,
0.2990062833,
-0.2994196117,
0.4684782326,
0.1641291231,
-0.3684591651,
0.0377963446,
0.2732796669,
-0.2538941205,
0.2997133136,
0.1712868065,
0.678319037,
0.2227465063,
-0.0918961242,
0.0675154552,
0.0342150964,
0.0763493478,
-0.3394199014,
-0.0230130032,
0.0669184253,
-0.1332620233,
0.1145668402,
0.1374944746,
-0.094496116,
0.2236459851,
0.0117417332,
0.2606367469,
-0.2572072446,
-0.1200351939,
-0.1719236225,
-0.1995497942,
-0.1337638944,
0.0917496905,
-0.2527790368,
-0.2110940516,
0.3524631262,
-0.0509158187,
0.1831525564,
0.1991887689,
0.0672124773,
-0.0960667655,
0.2713785768,
0.3381308615,
-0.5006517768,
-0.3073892295,
0.0890708044,
-0.5300476551,
0.2179004103,
-0.287971586,
-0.0791888833,
-0.0316293128,
0.2162606716,
-0.0353246778,
-0.1100046113,
0.0923836902,
-0.0869553685,
-0.0684574097,
-0.1544494778,
-0.2633786798,
-0.2788787782,
-0.0878152847,
-0.2979598641,
0.2715919018,
-0.5973241925,
-0.0476715043,
0.1096990034,
0.0626047477,
0.0808957145,
-0.0069346298,
0.2312021703,
0.442114681,
0.3236790001,
-0.0014011161,
0.4533216655,
0.0691782013,
-0.1578181237,
-0.3555994332,
-0.0512273945,
-0.1567315906,
0.0503356569,
0.122981824,
0.2397242337,
-0.6420226693,
0.0890368819,
-0.2371955812,
0.2477699816,
0.0678071156,
-0.0797339901,
0.0980476961,
-0.0238936469,
-0.3431889117,
0.1982949972,
0.2360746413,
0.2301771939,
-0.0658627003,
0.3270432949,
-0.1933470517,
-0.156314835,
0.4829874933,
-0.139692843,
-0.3495691717,
-0.2246769518,
0.4760476947,
0.0577695742,
-0.0404225364,
-0.1970505118,
-0.0889567733,
0.1853538901,
0.0791053846,
0.0632002577,
-0.1794751287,
-0.2648897171,
-0.2492374778,
-0.0139694149,
0.209180519,
-0.3121143878,
-0.3135882318,
0.0350735225,
-0.2094390094
] |
https://github.com/huggingface/datasets/issues/1785 | Not enough disk space (Needed: Unknown size) when caching on a cluster | That's an interesting behavior...
Do you know any other way to get the free space that works in your case ?
Also if it's a permission issue could you try fix the permissions and let mus know if that helped ? | I'm running some experiments where I'm caching datasets on a cluster and accessing it through multiple compute nodes. However, I get an error when loading the cached dataset from the shared disk.
The exact error thrown:
```bash
>>> load_dataset(dataset, cache_dir="/path/to/cluster/shared/path")
OSError: Not enough disk space. Needed: Unknown size (download: Unknown size, generated: Unknown size, post-processed: Unknown size)
```
[`utils.has_sufficient_disk_space`](https://github.com/huggingface/datasets/blob/8a03ab7d123a76ee744304f21ce868c75f411214/src/datasets/utils/py_utils.py#L332) fails on each job because of how the cluster system is designed (`disk_usage(".").free` can't compute on the cluster's shared disk).
This is exactly where the error gets thrown:
https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L502
```python
if not utils.has_sufficient_disk_space(self.info.size_in_bytes or 0, directory=self._cache_dir_root):
raise IOError(
"Not enough disk space. Needed: {} (download: {}, generated: {}, post-processed: {})".format(
utils.size_str(self.info.size_in_bytes or 0),
utils.size_str(self.info.download_size or 0),
utils.size_str(self.info.dataset_size or 0),
utils.size_str(self.info.post_processing_size or 0),
)
)
```
What would be a good way to circumvent this? my current fix is to manually comment out that part, but that is not ideal.
Would it be possible to pass a flag to skip this check on disk space? | 41 | Not enough disk space (Needed: Unknown size) when caching on a cluster
I'm running some experiments where I'm caching datasets on a cluster and accessing it through multiple compute nodes. However, I get an error when loading the cached dataset from the shared disk.
The exact error thrown:
```bash
>>> load_dataset(dataset, cache_dir="/path/to/cluster/shared/path")
OSError: Not enough disk space. Needed: Unknown size (download: Unknown size, generated: Unknown size, post-processed: Unknown size)
```
[`utils.has_sufficient_disk_space`](https://github.com/huggingface/datasets/blob/8a03ab7d123a76ee744304f21ce868c75f411214/src/datasets/utils/py_utils.py#L332) fails on each job because of how the cluster system is designed (`disk_usage(".").free` can't compute on the cluster's shared disk).
This is exactly where the error gets thrown:
https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L502
```python
if not utils.has_sufficient_disk_space(self.info.size_in_bytes or 0, directory=self._cache_dir_root):
raise IOError(
"Not enough disk space. Needed: {} (download: {}, generated: {}, post-processed: {})".format(
utils.size_str(self.info.size_in_bytes or 0),
utils.size_str(self.info.download_size or 0),
utils.size_str(self.info.dataset_size or 0),
utils.size_str(self.info.post_processing_size or 0),
)
)
```
What would be a good way to circumvent this? my current fix is to manually comment out that part, but that is not ideal.
Would it be possible to pass a flag to skip this check on disk space?
That's an interesting behavior...
Do you know any other way to get the free space that works in your case ?
Also if it's a permission issue could you try fix the permissions and let mus know if that helped ? | [
-0.077743046,
-0.4187169075,
-0.0846218616,
0.2431603819,
-0.0970101953,
0.1506602615,
0.0705344975,
0.340121299,
0.3962351978,
0.3933159411,
0.4183928967,
-0.1389312744,
-0.0912500247,
0.0038916988,
-0.1739585549,
0.2417322844,
-0.008229685,
-0.0606452934,
0.3455673754,
0.1274864972,
-0.4057287276,
0.013044103,
0.0944504216,
-0.3736139238,
-0.5426239967,
-0.1880922168,
-0.1662808508,
0.1566854864,
0.2269620895,
-0.2247433364,
0.3221060932,
-0.0054951115,
-0.1011394337,
0.57207793,
-0.000115944,
0.0363122933,
0.1715254039,
-0.1809052825,
-0.4399377406,
-0.0386958495,
0.2173041552,
-0.4069225192,
-0.2233587652,
-0.3619659543,
-0.0103092957,
0.1603567153,
-0.0511812568,
-0.4436120391,
0.1765251011,
-0.0691840351,
0.167969346,
0.3530051112,
-0.2203018218,
-0.0926141888,
-0.2659411132,
0.1767233014,
-0.0469130538,
0.5180591345,
0.2992624342,
0.0753152594,
-0.278730154,
0.220809415,
-0.1333252341,
0.1601160318,
0.4138146937,
-0.1359975785,
-0.0745275617,
-0.1845135838,
0.196237728,
-0.0268669985,
0.4277344346,
-0.1950323582,
-0.5273439884,
-0.5711026192,
0.0500526577,
-0.1597714126,
0.4396585226,
0.0364260562,
-0.4096873403,
0.1226714551,
-0.3018591404,
-0.3372612596,
-0.2010518312,
-0.2099773586,
0.0532088876,
0.1641298532,
0.001683414,
0.083085306,
0.3270327449,
0.0175013412,
-0.0256257895,
0.0264363289,
0.1729608923,
0.2536418736,
-0.286546737,
0.015176001,
-0.0948408619,
0.2101235539,
0.1011191458,
0.210698545,
0.0610056967,
-0.1125410125,
0.0735731199,
0.2540668845,
0.0136579322,
0.2466120869,
-0.2650672793,
-0.0978882983,
0.2030571997,
-0.0030464942,
0.1735391766,
-0.1133198515,
0.0481718257,
-0.3508068919,
0.1162028611,
-0.0180882458,
0.2040127963,
-0.0714850351,
-0.3821853697,
0.1272477657,
0.2050052136,
0.3049911857,
0.2122821063,
0.2848547697,
0.081049867,
0.2399785221,
0.2188418359,
0.1994529068,
-0.0902342796,
-0.0968263671,
-0.1159809977,
-0.0147070605,
0.0885306448,
0.1693160534,
0.3448052108,
0.0367702097,
0.2115975618,
-0.0179044642,
0.4590660036,
-0.1054459512,
-0.0721762404,
-0.2352616042,
-0.1191627383,
0.4233518839,
0.1197761372,
0.0117572416,
0.2519825101,
0.150050655,
-0.151038453,
0.267791003,
-0.3836438954,
-0.4553595483,
0.0440195017,
0.0724626854,
-0.3528415859,
0.201118812,
-0.4066090882,
-0.0384399742,
0.3097245991,
-0.1824394166,
0.1011643708,
0.0928385854,
-0.388710171,
-0.2462708652,
0.1381941438,
0.3473313451,
-0.1142510697,
0.0037162027,
-0.3107170761,
0.1621557176,
0.0525875054,
0.4145956337,
0.1311629415,
0.1386435181,
-0.4277252555,
0.1380107254,
0.112706773,
-0.3308421671,
-0.5418027043,
0.3061304092,
-0.1718518734,
0.251601547,
0.5377888083,
0.2614460588,
-0.0163329206,
-0.2336916924,
0.2327865213,
0.2714537084,
-0.2196910083,
0.0563452803,
-0.3533274829,
-0.2634564638,
0.0278722569,
0.0614293441,
0.3454006314,
0.1085645631,
0.0109478934,
-0.0060029062,
0.181870684,
0.0549798459,
0.2010060102,
0.319323808,
0.3190515637,
-0.3444589972,
-0.0738657489,
0.0217246003,
-0.5194780827,
0.3491621912,
0.1930717975,
-0.210014835,
-0.0646496564,
-0.4432948828,
-0.2809631526,
0.0622079372,
0.2482937425,
0.3274296522,
0.0486466475,
-0.0373881832,
0.2494668663,
-0.3069352806,
-0.0596501715,
0.1668298095,
-0.2572430074,
-0.0578985289,
0.1028768942,
-0.037163388,
-0.0423911139,
-0.1400398463,
0.0494483598,
0.0646106005,
0.065027073,
0.1349681467,
-0.0143348835,
0.4134911895,
-0.1063749939,
0.2247715741,
-0.0903510526,
0.1345997751,
0.1523135155,
0.3512611985,
0.0020520738,
0.1752401441,
0.0069471248,
-0.1697660834,
-0.1110438034,
0.2095980346,
-0.0455697738,
0.2853601277,
-0.0826583356,
0.0640583113,
0.062438,
0.0560383089,
0.1237754896,
-0.0592895821,
0.2901299894,
-0.1966569424,
0.4879350662,
0.0813177079,
0.0228466559,
-0.0144202309,
0.0694394708,
0.1592282355,
0.2913538516,
0.1565067917,
0.2970968783,
-0.0345214307,
-0.0058795158,
0.281740725,
0.2664144933,
0.1560028344,
0.0153094009,
-0.1753183603,
0.0451873355,
-0.2055585831,
0.0528199226,
-0.0503013469,
0.1580186039,
0.2922109067,
0.0067302659,
-0.2964169681,
0.0960464776,
-0.3090456724,
0.2155116647,
0.0772977546,
-0.2874604762,
-0.0579076111,
0.0557800084,
0.1828183085,
0.0615938306,
0.1889596581,
-0.458917141,
-0.3148480952,
0.1746361405,
0.6444194913,
-0.2373902053,
-0.0952424482,
-0.3729639053,
0.47324121,
0.0780527741,
-0.4257941842,
-0.0265632924,
-0.2685462832,
-0.105551824,
0.0170709025,
0.3254655302,
-0.2578275204,
0.3435429633,
0.009413938,
0.0713444501,
-0.4250701964,
0.1581228077,
-0.1697875708,
0.026744483,
0.160488829,
-0.1307637393,
0.3355616331,
-0.1221083775,
-0.161101833,
0.1600524932,
-0.0386516824,
-0.0417478904,
0.0091871368,
0.157061711,
0.1753278822,
-0.3232639432,
0.0315407254,
-0.1793825924,
-0.5495166779,
0.1743901223,
-0.1816839725,
0.2716464996,
0.1036405638,
0.1733865887,
-0.1049474105,
0.7099816799,
-0.1731762439,
-0.2496192008,
-0.6116565466,
0.2382910997,
-0.0803578198,
-0.0295519698,
-0.0471712351,
0.0296281688,
0.2122026235,
0.4242190421,
-0.4782416224,
-0.4002625942,
-0.1671660691,
0.2294673622,
-0.2420356572,
-0.0321568176,
0.1791037619,
-0.1486546844,
-0.0734727383,
-0.1409639269,
-0.0281639285,
0.0528291315,
0.0094647231,
0.2762104273,
0.2927937806,
0.2192623466,
0.3207841218,
0.7062375546,
-0.1594573408,
0.2500558794,
0.2755180895,
0.1817435026,
0.6162170768,
0.0905261114,
-0.0536034405,
0.0400998928,
0.0080744736,
-0.6150439978,
0.018974917,
-0.0332710035,
0.1380775571,
-0.0282102246,
-0.3949749768,
0.0797365531,
-0.2690036893,
0.3064283133,
-0.4407607913,
0.2631148696,
-0.2624961436,
0.0036536045,
-0.3661700189,
-0.0888017491,
-0.0278777946,
0.0957246572,
0.5163893104,
0.1993707418,
-0.2578813434,
-0.2660911977,
-0.5647939444,
0.3253155053,
-0.006048427,
0.1244612709,
-0.3100083172,
0.0745291859,
-0.0808813274,
0.010127387,
0.7869898081,
-0.0905365199,
0.2198172063,
0.0822388679,
0.0257655121,
-0.5359351635,
-0.0108492747,
0.1368561238,
0.3804581165,
-0.0719699562,
0.4385928512,
-0.1767696738,
0.1249717698,
-0.4394178391,
0.3606897295,
-0.3306918144,
-0.2415883839,
-0.3854802251,
-0.3814748526,
-0.4833007753,
0.4473902285,
0.4565168023,
0.2527857721,
-0.0483523719,
0.3299102485,
-0.1702632904,
-0.0149609568,
0.1736516953,
-0.0075803809,
0.443208307,
-0.1366668791,
0.0413892493,
0.10192018,
-0.0565784611,
0.427754879,
0.4132583737,
0.1096960157,
0.153211087,
0.2755295634,
0.0156118544,
0.3339525759,
0.3349297047,
-0.0720828325,
0.0272417124,
0.1159466431,
0.2456975579,
-0.4392110109,
-0.0649362803,
-0.3937532604,
-0.053410694,
-0.0902631804,
-0.0206969175,
0.3726739585,
0.3526022732,
0.0177913681,
0.0702154934,
0.3179870546,
-0.3127156496,
0.260708034,
-0.0260276962,
0.8725861311,
-0.0851956457,
0.0190442987,
0.0668717548,
0.3008273542,
0.3401437104,
-0.4726660252,
0.3613075316,
0.0440848432,
-0.2942005396,
0.0325816348,
-0.0121936025,
-0.0210776478,
0.2959339917,
-0.1688451916,
0.4016992748,
-0.5068142414,
0.0121939871,
-0.0954149067,
0.1365531087,
-0.6846151948,
-0.3742956817,
-0.2389674634,
0.1206891164,
-0.1377955079,
0.2103003263,
-0.2451043129,
0.1086564139,
0.0337139294,
-0.3128850758,
-0.3662667572,
-0.1701535881,
0.0267178789,
0.3035692275,
-0.1789853871,
0.0236432031,
-0.0893728659,
0.1346774697,
0.2152775079,
0.3010419011,
-0.1435464621,
0.102480419,
-0.1572921276,
-0.0557976216,
0.0648061261,
0.0752228796,
0.1123975292,
0.0016257297,
-0.3096866906,
0.1574650109,
-0.2591038048,
-0.4899291098,
0.0290623084,
-0.0438139178,
-0.2942897677,
-0.0338732265,
-0.2902981043,
-0.4566005468,
-0.0054636048,
-0.0876832604,
0.0665068105,
0.0191742908,
-0.1189481318,
0.1476352364,
0.0235257652,
-0.2044097036,
0.1164215952,
0.190723449,
0.1715484113,
-0.3462994993,
0.3859964311,
-0.373198539,
-0.0873680115,
-0.1736938357,
-0.1504092216,
-0.1342985183,
0.0950826779,
0.3430255353,
-0.0794039145,
-0.1285796314,
-0.2427508384,
-0.2310127616,
0.6502942443,
0.4262383878,
-0.144083187,
-0.478376627,
-0.3731829822,
0.2676647007,
0.0803002268,
0.2381605655,
-0.0641208291,
-0.0984875932,
0.0306086056,
0.1129468083,
-0.2559909523,
-0.0557872131,
-0.440733999,
0.0071715456,
0.2117858827,
0.1263764799,
0.2143027186,
-0.0947058052,
-0.0827279761,
0.1265942901,
-0.0557575412,
-0.1126359105,
0.0449619144,
0.1506277472,
0.0469186604,
0.1951723546,
0.1735436618,
-0.4588237107,
0.2376365513,
-0.2655064762,
0.175375998,
0.4182689488,
-0.0454815663,
-0.3415571749,
0.0746574774,
0.4974748492,
-0.1709237695,
0.1422319114,
0.1285944581,
0.1546489745,
-0.2296800911,
0.1842871457,
0.1251477748,
0.141740188,
0.2366863787,
-0.1120783761,
0.2201439738,
0.0385218523,
-0.1545709521,
0.0684715435,
-0.0448020846,
0.2478228211,
0.2652956843,
-0.0790445432,
-0.0293991696,
0.0338056535,
0.0698839277,
0.2173097581,
-0.23949036,
-0.11724893,
0.2396283597,
-0.0299390592,
0.1197566837,
0.501385808,
0.3876141608,
-0.3748737574,
0.0745424256,
0.092380546,
0.56485641,
-0.26017645,
0.0413095504,
0.1336950809,
0.0506066494,
0.0030421845,
0.1490101367,
-0.0633012205,
0.3891545832,
0.3070391119,
-0.1713533849,
0.2159720361,
0.240812093,
-0.1208609343,
-0.1497632712,
-0.4051087499,
0.0863525793,
0.0817292184,
0.0425833166,
0.1304463446,
-0.3192768693,
-0.047600206,
-0.3641908169,
-0.1965409219,
-0.2249183059,
-0.1132415608,
-0.4139752984,
-0.0106493738,
-0.0181172919,
-0.0879317522,
-0.0273675881,
-0.12374755,
0.3569253981,
-0.3851692677,
0.3071929514,
0.0091477921,
0.0622751303,
0.2990062833,
-0.2994196117,
0.4684782326,
0.1641291231,
-0.3684591651,
0.0377963446,
0.2732796669,
-0.2538941205,
0.2997133136,
0.1712868065,
0.678319037,
0.2227465063,
-0.0918961242,
0.0675154552,
0.0342150964,
0.0763493478,
-0.3394199014,
-0.0230130032,
0.0669184253,
-0.1332620233,
0.1145668402,
0.1374944746,
-0.094496116,
0.2236459851,
0.0117417332,
0.2606367469,
-0.2572072446,
-0.1200351939,
-0.1719236225,
-0.1995497942,
-0.1337638944,
0.0917496905,
-0.2527790368,
-0.2110940516,
0.3524631262,
-0.0509158187,
0.1831525564,
0.1991887689,
0.0672124773,
-0.0960667655,
0.2713785768,
0.3381308615,
-0.5006517768,
-0.3073892295,
0.0890708044,
-0.5300476551,
0.2179004103,
-0.287971586,
-0.0791888833,
-0.0316293128,
0.2162606716,
-0.0353246778,
-0.1100046113,
0.0923836902,
-0.0869553685,
-0.0684574097,
-0.1544494778,
-0.2633786798,
-0.2788787782,
-0.0878152847,
-0.2979598641,
0.2715919018,
-0.5973241925,
-0.0476715043,
0.1096990034,
0.0626047477,
0.0808957145,
-0.0069346298,
0.2312021703,
0.442114681,
0.3236790001,
-0.0014011161,
0.4533216655,
0.0691782013,
-0.1578181237,
-0.3555994332,
-0.0512273945,
-0.1567315906,
0.0503356569,
0.122981824,
0.2397242337,
-0.6420226693,
0.0890368819,
-0.2371955812,
0.2477699816,
0.0678071156,
-0.0797339901,
0.0980476961,
-0.0238936469,
-0.3431889117,
0.1982949972,
0.2360746413,
0.2301771939,
-0.0658627003,
0.3270432949,
-0.1933470517,
-0.156314835,
0.4829874933,
-0.139692843,
-0.3495691717,
-0.2246769518,
0.4760476947,
0.0577695742,
-0.0404225364,
-0.1970505118,
-0.0889567733,
0.1853538901,
0.0791053846,
0.0632002577,
-0.1794751287,
-0.2648897171,
-0.2492374778,
-0.0139694149,
0.209180519,
-0.3121143878,
-0.3135882318,
0.0350735225,
-0.2094390094
] |
https://github.com/huggingface/datasets/issues/1785 | Not enough disk space (Needed: Unknown size) when caching on a cluster | I think its an issue on the clusters end (unclear exactly why -- maybe something with docker containers?), will close the issue | I'm running some experiments where I'm caching datasets on a cluster and accessing it through multiple compute nodes. However, I get an error when loading the cached dataset from the shared disk.
The exact error thrown:
```bash
>>> load_dataset(dataset, cache_dir="/path/to/cluster/shared/path")
OSError: Not enough disk space. Needed: Unknown size (download: Unknown size, generated: Unknown size, post-processed: Unknown size)
```
[`utils.has_sufficient_disk_space`](https://github.com/huggingface/datasets/blob/8a03ab7d123a76ee744304f21ce868c75f411214/src/datasets/utils/py_utils.py#L332) fails on each job because of how the cluster system is designed (`disk_usage(".").free` can't compute on the cluster's shared disk).
This is exactly where the error gets thrown:
https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L502
```python
if not utils.has_sufficient_disk_space(self.info.size_in_bytes or 0, directory=self._cache_dir_root):
raise IOError(
"Not enough disk space. Needed: {} (download: {}, generated: {}, post-processed: {})".format(
utils.size_str(self.info.size_in_bytes or 0),
utils.size_str(self.info.download_size or 0),
utils.size_str(self.info.dataset_size or 0),
utils.size_str(self.info.post_processing_size or 0),
)
)
```
What would be a good way to circumvent this? my current fix is to manually comment out that part, but that is not ideal.
Would it be possible to pass a flag to skip this check on disk space? | 22 | Not enough disk space (Needed: Unknown size) when caching on a cluster
I'm running some experiments where I'm caching datasets on a cluster and accessing it through multiple compute nodes. However, I get an error when loading the cached dataset from the shared disk.
The exact error thrown:
```bash
>>> load_dataset(dataset, cache_dir="/path/to/cluster/shared/path")
OSError: Not enough disk space. Needed: Unknown size (download: Unknown size, generated: Unknown size, post-processed: Unknown size)
```
[`utils.has_sufficient_disk_space`](https://github.com/huggingface/datasets/blob/8a03ab7d123a76ee744304f21ce868c75f411214/src/datasets/utils/py_utils.py#L332) fails on each job because of how the cluster system is designed (`disk_usage(".").free` can't compute on the cluster's shared disk).
This is exactly where the error gets thrown:
https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L502
```python
if not utils.has_sufficient_disk_space(self.info.size_in_bytes or 0, directory=self._cache_dir_root):
raise IOError(
"Not enough disk space. Needed: {} (download: {}, generated: {}, post-processed: {})".format(
utils.size_str(self.info.size_in_bytes or 0),
utils.size_str(self.info.download_size or 0),
utils.size_str(self.info.dataset_size or 0),
utils.size_str(self.info.post_processing_size or 0),
)
)
```
What would be a good way to circumvent this? my current fix is to manually comment out that part, but that is not ideal.
Would it be possible to pass a flag to skip this check on disk space?
I think its an issue on the clusters end (unclear exactly why -- maybe something with docker containers?), will close the issue | [
-0.077743046,
-0.4187169075,
-0.0846218616,
0.2431603819,
-0.0970101953,
0.1506602615,
0.0705344975,
0.340121299,
0.3962351978,
0.3933159411,
0.4183928967,
-0.1389312744,
-0.0912500247,
0.0038916988,
-0.1739585549,
0.2417322844,
-0.008229685,
-0.0606452934,
0.3455673754,
0.1274864972,
-0.4057287276,
0.013044103,
0.0944504216,
-0.3736139238,
-0.5426239967,
-0.1880922168,
-0.1662808508,
0.1566854864,
0.2269620895,
-0.2247433364,
0.3221060932,
-0.0054951115,
-0.1011394337,
0.57207793,
-0.000115944,
0.0363122933,
0.1715254039,
-0.1809052825,
-0.4399377406,
-0.0386958495,
0.2173041552,
-0.4069225192,
-0.2233587652,
-0.3619659543,
-0.0103092957,
0.1603567153,
-0.0511812568,
-0.4436120391,
0.1765251011,
-0.0691840351,
0.167969346,
0.3530051112,
-0.2203018218,
-0.0926141888,
-0.2659411132,
0.1767233014,
-0.0469130538,
0.5180591345,
0.2992624342,
0.0753152594,
-0.278730154,
0.220809415,
-0.1333252341,
0.1601160318,
0.4138146937,
-0.1359975785,
-0.0745275617,
-0.1845135838,
0.196237728,
-0.0268669985,
0.4277344346,
-0.1950323582,
-0.5273439884,
-0.5711026192,
0.0500526577,
-0.1597714126,
0.4396585226,
0.0364260562,
-0.4096873403,
0.1226714551,
-0.3018591404,
-0.3372612596,
-0.2010518312,
-0.2099773586,
0.0532088876,
0.1641298532,
0.001683414,
0.083085306,
0.3270327449,
0.0175013412,
-0.0256257895,
0.0264363289,
0.1729608923,
0.2536418736,
-0.286546737,
0.015176001,
-0.0948408619,
0.2101235539,
0.1011191458,
0.210698545,
0.0610056967,
-0.1125410125,
0.0735731199,
0.2540668845,
0.0136579322,
0.2466120869,
-0.2650672793,
-0.0978882983,
0.2030571997,
-0.0030464942,
0.1735391766,
-0.1133198515,
0.0481718257,
-0.3508068919,
0.1162028611,
-0.0180882458,
0.2040127963,
-0.0714850351,
-0.3821853697,
0.1272477657,
0.2050052136,
0.3049911857,
0.2122821063,
0.2848547697,
0.081049867,
0.2399785221,
0.2188418359,
0.1994529068,
-0.0902342796,
-0.0968263671,
-0.1159809977,
-0.0147070605,
0.0885306448,
0.1693160534,
0.3448052108,
0.0367702097,
0.2115975618,
-0.0179044642,
0.4590660036,
-0.1054459512,
-0.0721762404,
-0.2352616042,
-0.1191627383,
0.4233518839,
0.1197761372,
0.0117572416,
0.2519825101,
0.150050655,
-0.151038453,
0.267791003,
-0.3836438954,
-0.4553595483,
0.0440195017,
0.0724626854,
-0.3528415859,
0.201118812,
-0.4066090882,
-0.0384399742,
0.3097245991,
-0.1824394166,
0.1011643708,
0.0928385854,
-0.388710171,
-0.2462708652,
0.1381941438,
0.3473313451,
-0.1142510697,
0.0037162027,
-0.3107170761,
0.1621557176,
0.0525875054,
0.4145956337,
0.1311629415,
0.1386435181,
-0.4277252555,
0.1380107254,
0.112706773,
-0.3308421671,
-0.5418027043,
0.3061304092,
-0.1718518734,
0.251601547,
0.5377888083,
0.2614460588,
-0.0163329206,
-0.2336916924,
0.2327865213,
0.2714537084,
-0.2196910083,
0.0563452803,
-0.3533274829,
-0.2634564638,
0.0278722569,
0.0614293441,
0.3454006314,
0.1085645631,
0.0109478934,
-0.0060029062,
0.181870684,
0.0549798459,
0.2010060102,
0.319323808,
0.3190515637,
-0.3444589972,
-0.0738657489,
0.0217246003,
-0.5194780827,
0.3491621912,
0.1930717975,
-0.210014835,
-0.0646496564,
-0.4432948828,
-0.2809631526,
0.0622079372,
0.2482937425,
0.3274296522,
0.0486466475,
-0.0373881832,
0.2494668663,
-0.3069352806,
-0.0596501715,
0.1668298095,
-0.2572430074,
-0.0578985289,
0.1028768942,
-0.037163388,
-0.0423911139,
-0.1400398463,
0.0494483598,
0.0646106005,
0.065027073,
0.1349681467,
-0.0143348835,
0.4134911895,
-0.1063749939,
0.2247715741,
-0.0903510526,
0.1345997751,
0.1523135155,
0.3512611985,
0.0020520738,
0.1752401441,
0.0069471248,
-0.1697660834,
-0.1110438034,
0.2095980346,
-0.0455697738,
0.2853601277,
-0.0826583356,
0.0640583113,
0.062438,
0.0560383089,
0.1237754896,
-0.0592895821,
0.2901299894,
-0.1966569424,
0.4879350662,
0.0813177079,
0.0228466559,
-0.0144202309,
0.0694394708,
0.1592282355,
0.2913538516,
0.1565067917,
0.2970968783,
-0.0345214307,
-0.0058795158,
0.281740725,
0.2664144933,
0.1560028344,
0.0153094009,
-0.1753183603,
0.0451873355,
-0.2055585831,
0.0528199226,
-0.0503013469,
0.1580186039,
0.2922109067,
0.0067302659,
-0.2964169681,
0.0960464776,
-0.3090456724,
0.2155116647,
0.0772977546,
-0.2874604762,
-0.0579076111,
0.0557800084,
0.1828183085,
0.0615938306,
0.1889596581,
-0.458917141,
-0.3148480952,
0.1746361405,
0.6444194913,
-0.2373902053,
-0.0952424482,
-0.3729639053,
0.47324121,
0.0780527741,
-0.4257941842,
-0.0265632924,
-0.2685462832,
-0.105551824,
0.0170709025,
0.3254655302,
-0.2578275204,
0.3435429633,
0.009413938,
0.0713444501,
-0.4250701964,
0.1581228077,
-0.1697875708,
0.026744483,
0.160488829,
-0.1307637393,
0.3355616331,
-0.1221083775,
-0.161101833,
0.1600524932,
-0.0386516824,
-0.0417478904,
0.0091871368,
0.157061711,
0.1753278822,
-0.3232639432,
0.0315407254,
-0.1793825924,
-0.5495166779,
0.1743901223,
-0.1816839725,
0.2716464996,
0.1036405638,
0.1733865887,
-0.1049474105,
0.7099816799,
-0.1731762439,
-0.2496192008,
-0.6116565466,
0.2382910997,
-0.0803578198,
-0.0295519698,
-0.0471712351,
0.0296281688,
0.2122026235,
0.4242190421,
-0.4782416224,
-0.4002625942,
-0.1671660691,
0.2294673622,
-0.2420356572,
-0.0321568176,
0.1791037619,
-0.1486546844,
-0.0734727383,
-0.1409639269,
-0.0281639285,
0.0528291315,
0.0094647231,
0.2762104273,
0.2927937806,
0.2192623466,
0.3207841218,
0.7062375546,
-0.1594573408,
0.2500558794,
0.2755180895,
0.1817435026,
0.6162170768,
0.0905261114,
-0.0536034405,
0.0400998928,
0.0080744736,
-0.6150439978,
0.018974917,
-0.0332710035,
0.1380775571,
-0.0282102246,
-0.3949749768,
0.0797365531,
-0.2690036893,
0.3064283133,
-0.4407607913,
0.2631148696,
-0.2624961436,
0.0036536045,
-0.3661700189,
-0.0888017491,
-0.0278777946,
0.0957246572,
0.5163893104,
0.1993707418,
-0.2578813434,
-0.2660911977,
-0.5647939444,
0.3253155053,
-0.006048427,
0.1244612709,
-0.3100083172,
0.0745291859,
-0.0808813274,
0.010127387,
0.7869898081,
-0.0905365199,
0.2198172063,
0.0822388679,
0.0257655121,
-0.5359351635,
-0.0108492747,
0.1368561238,
0.3804581165,
-0.0719699562,
0.4385928512,
-0.1767696738,
0.1249717698,
-0.4394178391,
0.3606897295,
-0.3306918144,
-0.2415883839,
-0.3854802251,
-0.3814748526,
-0.4833007753,
0.4473902285,
0.4565168023,
0.2527857721,
-0.0483523719,
0.3299102485,
-0.1702632904,
-0.0149609568,
0.1736516953,
-0.0075803809,
0.443208307,
-0.1366668791,
0.0413892493,
0.10192018,
-0.0565784611,
0.427754879,
0.4132583737,
0.1096960157,
0.153211087,
0.2755295634,
0.0156118544,
0.3339525759,
0.3349297047,
-0.0720828325,
0.0272417124,
0.1159466431,
0.2456975579,
-0.4392110109,
-0.0649362803,
-0.3937532604,
-0.053410694,
-0.0902631804,
-0.0206969175,
0.3726739585,
0.3526022732,
0.0177913681,
0.0702154934,
0.3179870546,
-0.3127156496,
0.260708034,
-0.0260276962,
0.8725861311,
-0.0851956457,
0.0190442987,
0.0668717548,
0.3008273542,
0.3401437104,
-0.4726660252,
0.3613075316,
0.0440848432,
-0.2942005396,
0.0325816348,
-0.0121936025,
-0.0210776478,
0.2959339917,
-0.1688451916,
0.4016992748,
-0.5068142414,
0.0121939871,
-0.0954149067,
0.1365531087,
-0.6846151948,
-0.3742956817,
-0.2389674634,
0.1206891164,
-0.1377955079,
0.2103003263,
-0.2451043129,
0.1086564139,
0.0337139294,
-0.3128850758,
-0.3662667572,
-0.1701535881,
0.0267178789,
0.3035692275,
-0.1789853871,
0.0236432031,
-0.0893728659,
0.1346774697,
0.2152775079,
0.3010419011,
-0.1435464621,
0.102480419,
-0.1572921276,
-0.0557976216,
0.0648061261,
0.0752228796,
0.1123975292,
0.0016257297,
-0.3096866906,
0.1574650109,
-0.2591038048,
-0.4899291098,
0.0290623084,
-0.0438139178,
-0.2942897677,
-0.0338732265,
-0.2902981043,
-0.4566005468,
-0.0054636048,
-0.0876832604,
0.0665068105,
0.0191742908,
-0.1189481318,
0.1476352364,
0.0235257652,
-0.2044097036,
0.1164215952,
0.190723449,
0.1715484113,
-0.3462994993,
0.3859964311,
-0.373198539,
-0.0873680115,
-0.1736938357,
-0.1504092216,
-0.1342985183,
0.0950826779,
0.3430255353,
-0.0794039145,
-0.1285796314,
-0.2427508384,
-0.2310127616,
0.6502942443,
0.4262383878,
-0.144083187,
-0.478376627,
-0.3731829822,
0.2676647007,
0.0803002268,
0.2381605655,
-0.0641208291,
-0.0984875932,
0.0306086056,
0.1129468083,
-0.2559909523,
-0.0557872131,
-0.440733999,
0.0071715456,
0.2117858827,
0.1263764799,
0.2143027186,
-0.0947058052,
-0.0827279761,
0.1265942901,
-0.0557575412,
-0.1126359105,
0.0449619144,
0.1506277472,
0.0469186604,
0.1951723546,
0.1735436618,
-0.4588237107,
0.2376365513,
-0.2655064762,
0.175375998,
0.4182689488,
-0.0454815663,
-0.3415571749,
0.0746574774,
0.4974748492,
-0.1709237695,
0.1422319114,
0.1285944581,
0.1546489745,
-0.2296800911,
0.1842871457,
0.1251477748,
0.141740188,
0.2366863787,
-0.1120783761,
0.2201439738,
0.0385218523,
-0.1545709521,
0.0684715435,
-0.0448020846,
0.2478228211,
0.2652956843,
-0.0790445432,
-0.0293991696,
0.0338056535,
0.0698839277,
0.2173097581,
-0.23949036,
-0.11724893,
0.2396283597,
-0.0299390592,
0.1197566837,
0.501385808,
0.3876141608,
-0.3748737574,
0.0745424256,
0.092380546,
0.56485641,
-0.26017645,
0.0413095504,
0.1336950809,
0.0506066494,
0.0030421845,
0.1490101367,
-0.0633012205,
0.3891545832,
0.3070391119,
-0.1713533849,
0.2159720361,
0.240812093,
-0.1208609343,
-0.1497632712,
-0.4051087499,
0.0863525793,
0.0817292184,
0.0425833166,
0.1304463446,
-0.3192768693,
-0.047600206,
-0.3641908169,
-0.1965409219,
-0.2249183059,
-0.1132415608,
-0.4139752984,
-0.0106493738,
-0.0181172919,
-0.0879317522,
-0.0273675881,
-0.12374755,
0.3569253981,
-0.3851692677,
0.3071929514,
0.0091477921,
0.0622751303,
0.2990062833,
-0.2994196117,
0.4684782326,
0.1641291231,
-0.3684591651,
0.0377963446,
0.2732796669,
-0.2538941205,
0.2997133136,
0.1712868065,
0.678319037,
0.2227465063,
-0.0918961242,
0.0675154552,
0.0342150964,
0.0763493478,
-0.3394199014,
-0.0230130032,
0.0669184253,
-0.1332620233,
0.1145668402,
0.1374944746,
-0.094496116,
0.2236459851,
0.0117417332,
0.2606367469,
-0.2572072446,
-0.1200351939,
-0.1719236225,
-0.1995497942,
-0.1337638944,
0.0917496905,
-0.2527790368,
-0.2110940516,
0.3524631262,
-0.0509158187,
0.1831525564,
0.1991887689,
0.0672124773,
-0.0960667655,
0.2713785768,
0.3381308615,
-0.5006517768,
-0.3073892295,
0.0890708044,
-0.5300476551,
0.2179004103,
-0.287971586,
-0.0791888833,
-0.0316293128,
0.2162606716,
-0.0353246778,
-0.1100046113,
0.0923836902,
-0.0869553685,
-0.0684574097,
-0.1544494778,
-0.2633786798,
-0.2788787782,
-0.0878152847,
-0.2979598641,
0.2715919018,
-0.5973241925,
-0.0476715043,
0.1096990034,
0.0626047477,
0.0808957145,
-0.0069346298,
0.2312021703,
0.442114681,
0.3236790001,
-0.0014011161,
0.4533216655,
0.0691782013,
-0.1578181237,
-0.3555994332,
-0.0512273945,
-0.1567315906,
0.0503356569,
0.122981824,
0.2397242337,
-0.6420226693,
0.0890368819,
-0.2371955812,
0.2477699816,
0.0678071156,
-0.0797339901,
0.0980476961,
-0.0238936469,
-0.3431889117,
0.1982949972,
0.2360746413,
0.2301771939,
-0.0658627003,
0.3270432949,
-0.1933470517,
-0.156314835,
0.4829874933,
-0.139692843,
-0.3495691717,
-0.2246769518,
0.4760476947,
0.0577695742,
-0.0404225364,
-0.1970505118,
-0.0889567733,
0.1853538901,
0.0791053846,
0.0632002577,
-0.1794751287,
-0.2648897171,
-0.2492374778,
-0.0139694149,
0.209180519,
-0.3121143878,
-0.3135882318,
0.0350735225,
-0.2094390094
] |
https://github.com/huggingface/datasets/issues/1784 | JSONDecodeError on JSON with multiple lines | Hi !
The `json` dataset script does support this format. For example loading a dataset with this format works on my side:
```json
{"key1":11, "key2":12, "key3":13}
{"key1":21, "key2":22, "key3":23}
```
Can you show the full stacktrace please ? Also which version of datasets and pyarrow are you using ?
| Hello :),
I have been trying to load data using a JSON file. Based on the [docs](https://huggingface.co/docs/datasets/loading_datasets.html#json-files), the following format is supported:
```json
{"key1":11, "key2":12, "key3":13}
{"key1":21, "key2":22, "key3":23}
```
But, when I try loading a dataset with the same format, I get a JSONDecodeError : `JSONDecodeError: Extra data: line 2 column 1 (char 7142)`. Now, this is expected when using `json` to load a JSON file. But I was wondering if there are any special arguments to pass when using `load_dataset` as the docs suggest that this format is supported.
When I convert the JSON file to a list of dictionaries format, I get AttributeError: `AttributeError: 'list' object has no attribute 'keys'`. So, I can't convert them to list of dictionaries either.
Please let me know :)
Thanks,
Gunjan | 49 | JSONDecodeError on JSON with multiple lines
Hello :),
I have been trying to load data using a JSON file. Based on the [docs](https://huggingface.co/docs/datasets/loading_datasets.html#json-files), the following format is supported:
```json
{"key1":11, "key2":12, "key3":13}
{"key1":21, "key2":22, "key3":23}
```
But, when I try loading a dataset with the same format, I get a JSONDecodeError : `JSONDecodeError: Extra data: line 2 column 1 (char 7142)`. Now, this is expected when using `json` to load a JSON file. But I was wondering if there are any special arguments to pass when using `load_dataset` as the docs suggest that this format is supported.
When I convert the JSON file to a list of dictionaries format, I get AttributeError: `AttributeError: 'list' object has no attribute 'keys'`. So, I can't convert them to list of dictionaries either.
Please let me know :)
Thanks,
Gunjan
Hi !
The `json` dataset script does support this format. For example loading a dataset with this format works on my side:
```json
{"key1":11, "key2":12, "key3":13}
{"key1":21, "key2":22, "key3":23}
```
Can you show the full stacktrace please ? Also which version of datasets and pyarrow are you using ?
| [
0.0756986365,
-0.0048342287,
-0.0292826574,
0.4874005914,
0.3547828794,
0.1495193839,
0.4615654051,
0.0634567812,
0.1587533802,
0.0187908541,
0.1641429663,
0.2806328535,
-0.0464720055,
0.2131018043,
0.0773413777,
-0.257919699,
0.0545292273,
0.2539742291,
0.2304694057,
0.0939232707,
-0.1753568053,
0.2821832895,
-0.1558837891,
-0.0859776512,
-0.1164930984,
0.1821443588,
-0.147819221,
0.223066017,
0.1152195334,
-0.6116786003,
0.1991687417,
0.1072017252,
0.1027609408,
0.438429147,
-0.0001222827,
0.1784518063,
0.279802084,
-0.2406273931,
-0.4377516508,
-0.2415917069,
-0.3200461566,
-0.2146714032,
0.3941476047,
-0.2164661586,
-0.0171032958,
-0.5522251725,
-0.1071555912,
-0.2231714725,
0.8473547697,
0.3154250085,
0.0736972764,
-0.0370575376,
0.1545829177,
0.0937760025,
0.1382788867,
0.3976794481,
0.1040198505,
0.3903297186,
0.1572728753,
0.3830770552,
0.0803719312,
-0.1940743476,
-0.0791404694,
0.1125905961,
0.2857995331,
0.1097655371,
-0.071705766,
-0.0807542279,
0.0151101295,
0.4550837576,
0.6541773081,
-0.1046297103,
-0.4009037316,
-0.430703938,
-0.12883614,
-0.1373526454,
0.2610408962,
0.1544525921,
-0.1068271399,
0.1755382419,
-0.2287271619,
-0.1890082657,
-0.253189832,
0.2583875358,
-0.0928343013,
-0.317347616,
-0.2160383314,
0.2146329433,
0.1909273565,
-0.1639518142,
-0.1476037651,
-0.21648404,
-0.3134981096,
0.161016807,
-0.0158155859,
0.0244270917,
-0.1692643315,
-0.2996097803,
0.3776486516,
0.0606458373,
0.2912251055,
0.0090574361,
-0.3051206768,
0.1320207417,
0.4233738482,
-0.0412972607,
0.4679247737,
-0.2059041858,
0.0228299852,
-0.050950069,
0.2377182245,
-0.2316975594,
-0.1745300889,
-0.0246614236,
0.0667582154,
-0.2337432206,
0.1367669255,
-0.1931567341,
0.0409571081,
-0.1141453832,
-0.3299008608,
-0.2379555702,
-0.0778573975,
0.2825758755,
0.3413723409,
0.1305533499,
0.0085196458,
0.4388344884,
0.151241377,
-0.1779144406,
0.0612650551,
0.0336145088,
0.1091154739,
0.1203233823,
0.2002601773,
-0.1847386062,
0.154673174,
0.1673329175,
-0.0312027559,
-0.1802987605,
-0.2248148918,
0.0954530388,
0.0053399163,
0.203465417,
0.1514879167,
0.0381724499,
0.0465458035,
-0.3754884601,
-0.1229785159,
0.261493057,
-0.366422534,
-0.1086112931,
-0.2158958763,
0.0045941165,
-0.2165374905,
-0.0427545197,
-0.7504184246,
0.2429644912,
-0.0581945591,
-0.359373033,
0.0278873164,
-0.1414282173,
0.1401708126,
-0.2898020148,
0.0539405383,
0.4843591154,
-0.5632109046,
-0.3126642108,
0.2905025482,
-0.1905967444,
-0.1055357903,
0.362650305,
-0.4107254148,
0.2188342363,
-0.2073310167,
0.3010172248,
0.3687206209,
-0.3092292845,
-0.230179891,
0.5485827923,
0.1091071069,
0.3371362686,
0.2294212729,
-0.1662468463,
0.2583562434,
-0.0088671856,
0.2358898073,
0.1111457646,
0.1393966973,
0.0451237075,
0.1017302647,
-0.0208237525,
0.315166682,
0.2690215707,
-0.3838228583,
0.0342159234,
0.0319788344,
0.0770256892,
0.3040088713,
-0.2865879536,
-0.1244974658,
0.3002170026,
-0.2268987745,
0.0445504971,
0.031766165,
0.1740535945,
-0.782789886,
0.0318349153,
0.1511204988,
-0.1865002811,
-0.3102796972,
-0.0598723069,
-0.0096399672,
0.0180449523,
-0.4591429234,
-0.052004803,
-0.0432898328,
0.0529057607,
0.186169073,
0.0698306337,
-0.1512101144,
0.2602818608,
0.0843930468,
0.12722902,
-0.2944522798,
0.3275436461,
0.1130034477,
-0.1274396777,
0.0821478888,
-0.0147799198,
0.1743898988,
-0.3622351289,
-0.0237970948,
0.3017581999,
0.4365185797,
-0.2380352318,
-0.1748333275,
0.0855645314,
0.2663765848,
0.2200504988,
-0.0744528398,
0.2505379319,
0.223716557,
-0.2906740606,
-0.3921763003,
0.2784982324,
-0.0886457562,
0.4363916814,
0.0388428681,
-0.1501079053,
0.4239457846,
0.104575485,
-0.2950930297,
-0.1024180278,
0.1572767645,
0.1999422312,
0.0250990447,
0.0371616669,
-0.3032550514,
-0.1938173473,
0.5734391212,
-0.1982162446,
0.136687085,
0.3101387918,
-0.1643848717,
-0.1224134192,
0.0132788075,
-0.0233275536,
0.3320558369,
0.1498828679,
-0.3159898818,
0.0376025885,
0.2749460936,
-0.2184944898,
0.1245728955,
-0.108482264,
0.2380924523,
0.0401963554,
0.1783388704,
-0.0797341391,
-0.3305122256,
-0.438595444,
0.1077530459,
0.0704085603,
-0.5264183879,
0.1137505993,
-0.4291847348,
-0.0921922401,
-0.0660930946,
-0.2417518348,
-0.1806000173,
-0.2090835273,
-0.1459433585,
0.0689224973,
0.0243191607,
-0.0922084227,
0.094338946,
0.1706514359,
0.1414880902,
-0.1998652816,
-0.1468557566,
-0.1468743235,
-0.237973392,
-0.0691627413,
0.2437769622,
-0.0099240066,
0.0070755403,
-0.3262993693,
-0.1477710158,
-0.1586069018,
-0.0661569387,
0.1092127264,
-0.1067408994,
0.158682555,
0.1463218033,
0.482786864,
-0.086145401,
-0.0333810411,
0.3210743368,
0.258628428,
-0.2111029476,
0.2427033037,
0.1239624768,
-0.0303510502,
-0.0638523251,
-0.0726984739,
0.0486170836,
-0.1663968563,
0.6842477918,
-0.0452208668,
0.1938864738,
-0.0541443489,
0.1299837679,
0.0972088873,
-0.2045084238,
0.0939912871,
-0.1179482564,
-0.2161601782,
0.2748555839,
-0.1578397006,
-0.4564422667,
0.0866723284,
0.137607798,
-0.1101882011,
-0.0661051869,
-0.4292572439,
-0.1951761842,
-0.0504836328,
0.1136903018,
-0.1206954792,
-0.0474417359,
0.231842801,
-0.0019963509,
0.0809706375,
-0.0558325648,
-0.3087209463,
0.1214719191,
0.0186988637,
0.0840987265,
0.2554667592,
0.7511205673,
-0.1643747687,
0.1048239395,
0.4095943272,
-0.0908320323,
0.3358145058,
-0.2318022549,
0.279676497,
-0.261341542,
-0.0558580719,
-0.1485668272,
-0.1008692756,
0.0553968437,
0.2300319374,
-0.0044680387,
0.1011440605,
-0.1548944861,
0.0414441749,
-0.4394158125,
-0.1142982244,
0.1158777475,
-0.0837006941,
-0.2346477509,
-0.2505990863,
0.0827205256,
0.08235313,
0.1297956407,
-0.2238009721,
0.4012432098,
0.2909096479,
0.0108790202,
-0.4823313653,
-0.1782714128,
-0.2993757725,
0.3115852475,
0.0724719986,
0.3987674117,
-0.0525592826,
0.305671066,
0.1513417661,
-0.1640332043,
0.8771929741,
-0.0720191449,
-0.1486295611,
0.1351093501,
0.0790694505,
-0.4990382493,
0.023159327,
-0.0832152814,
0.3365110457,
0.112819396,
0.1889236867,
-0.5262196064,
-0.1411767602,
-0.1502993852,
0.1219518334,
-0.1306490302,
-0.3131034672,
-0.1105350703,
-0.4094935358,
-0.5487591624,
-0.2788082957,
0.0503898226,
0.2496144623,
0.0547450595,
-0.117346175,
0.0764081329,
-0.2830378711,
0.0264883544,
0.1006234586,
0.1723237485,
0.1050179005,
-0.0677219257,
0.1160439998,
0.0810786858,
0.6050031781,
0.6168929935,
0.2200414389,
-0.5725250244,
-0.1515592188,
-0.377913624,
0.338691324,
0.1236374304,
0.0089895483,
0.0958791524,
-0.1069691628,
-0.0281355139,
0.0381138176,
-0.2126394063,
0.4485839903,
-0.152348429,
-0.3894654512,
-0.4445135891,
0.5677695274,
0.0223048311,
-0.0151196495,
0.0311269127,
0.2863837779,
-0.4327486455,
0.3331759572,
-0.2572876215,
0.5948886871,
-0.0670591146,
0.3598081172,
0.4278512895,
-0.2802690566,
0.5248783231,
-0.0857868865,
-0.0531440414,
-0.1445716769,
0.1677121371,
-0.1333740056,
-0.1318366379,
0.2990582883,
0.463565141,
-0.2111042589,
0.1994571984,
-0.3796829581,
-0.0257816911,
0.0219226945,
0.3363604546,
-0.044759497,
-0.2403120697,
-0.6766853929,
0.0142873768,
-0.0731550306,
-0.2198833525,
-0.0554787666,
-0.1762809306,
0.0918207914,
-0.3764569759,
-0.3643437922,
-0.0236472432,
0.0180891808,
-0.0852232054,
0.2905057669,
-0.2800566554,
0.3040168583,
0.2946940362,
0.0030286845,
-0.137763232,
-0.1765663922,
0.0029852176,
-0.3240698278,
-0.1500299871,
-0.3393166661,
-0.0613904744,
0.1898655891,
-0.0163223781,
-0.2327296883,
0.1667874306,
-0.1638561487,
-0.49184075,
-0.0593731217,
0.250664562,
-0.5110675693,
-0.4745008349,
-0.3947391212,
-0.1168438345,
0.0519517325,
-0.0442527719,
-0.0072201374,
0.2400054336,
-0.0497964025,
-0.1048770249,
0.062991038,
-0.0384452455,
-0.0195881575,
0.1853260845,
0.0224061031,
-0.1815968156,
0.6452673078,
0.4009434283,
0.0333051905,
-0.1279841512,
0.3129695654,
0.678783536,
-0.1460886747,
0.3107437193,
0.1308349967,
0.4295877218,
-0.0704201311,
0.3472554386,
-0.0749997422,
0.1801515222,
0.3063795269,
-0.6065921783,
-0.0971380696,
0.2598367333,
0.0545561761,
0.1040459499,
0.2366105616,
-0.0283827335,
0.0236271061,
-0.0122390557,
-0.124607712,
0.3266863227,
0.0775352716,
0.0731420591,
0.1894125491,
0.1207104772,
0.2873909771,
-0.0857671946,
-0.011272273,
0.086157687,
0.0055682445,
-0.0671928599,
-0.0116520189,
0.1908574998,
0.2449627072,
-0.1065149158,
-0.2095549405,
-0.1429028213,
-0.0313248783,
-0.1739066541,
0.324398607,
0.064442955,
-0.1287900507,
0.2100992054,
0.3157558739,
0.1497424692,
-0.3055720329,
0.1047448814,
-0.1872399896,
0.5721404552,
-0.0215311702,
0.0584526397,
-0.1145421341,
0.0733320862,
-0.2476496547,
0.3973832726,
0.1267003268,
0.06468229,
0.2737925947,
-0.4780190289,
0.2461461276,
0.0544704236,
0.1764316857,
0.5079082847,
-0.4632911682,
0.2767199278,
-0.087152198,
-0.0323949941,
0.0746792927,
-0.1712876558,
0.3691150248,
0.1350057423,
-0.1295899898,
0.1843110025,
-0.0573186912,
-0.1345748603,
-0.0280415211,
-0.1097543538,
0.2922799587,
0.1591729969,
-0.0371068381,
0.4146480262,
-0.1724984646,
-0.078438282,
0.0897985771,
0.3331097364,
0.2535049319,
0.3189612627,
-0.283382684,
-0.0099928631,
0.2608400583,
0.1258876473,
-0.0723960474,
-0.3877485394,
-0.0550847277,
0.351982981,
0.0916907638,
0.1211036518,
0.1613059044,
0.1335010678,
0.0547607988,
0.1395139545,
-0.1904908717,
0.0833462402,
0.010280475,
-0.2840883732,
-0.0998751596,
-0.113230601,
-0.125478372,
0.0288863461,
-0.2928874195,
-0.2805132568,
0.1353380829,
0.0819417909,
0.0951071009,
-0.4350183904,
0.313197881,
-0.0405783281,
-0.0153840343,
-0.2048436552,
0.2946709394,
0.3339356184,
-0.1596250534,
0.5769931078,
0.0090870503,
0.5483867526,
0.2124695033,
0.1156957597,
0.0132710151,
-0.4909019768,
-0.0946569592,
0.2071466893,
0.3553979099,
0.0508531779,
0.0046824771,
0.2090476751,
0.0558938347,
0.0869760886,
0.3290419579,
0.0325116329,
0.1568680555,
-0.3156080842,
0.0302322786,
-0.3788298666,
-0.0873628259,
-0.1211289465,
-0.1011804342,
-0.1344499588,
-0.4340040684,
0.1330699176,
0.1707013994,
0.079333283,
0.0714914575,
-0.0028354093,
-0.1310883462,
0.4665917754,
0.3894785047,
0.2655847669,
0.0237389859,
-0.0335918479,
-0.1656287163,
-0.2036828548,
-0.2785918713,
-0.1370724291,
0.2476900518,
0.0628393739,
0.2403697968,
0.2577143908,
-0.0058909976,
0.28449893,
-0.3355715573,
0.0001502131,
-0.2361422926,
-0.2020063102,
0.3589683473,
0.2450480759,
-0.1921957135,
0.0815472752,
0.3909069598,
-0.082666494,
-0.0857478976,
-0.2182663083,
0.3969541192,
-0.2062810659,
-0.1763966531,
0.2374649197,
0.2302737385,
0.5443314314,
0.1605998278,
-0.0869175643,
-0.0404686257,
-0.1670811474,
0.013556215,
0.6156163812,
-0.037002828,
0.4068601727,
-0.2951592803,
0.0592506267,
-0.1242645532,
0.025125416,
-0.4160121083,
-0.0127062555,
-0.3439691961,
0.2034493387,
-0.0015566277,
-0.1828736216,
0.0542491488,
0.0863016173,
-0.1540885121,
0.0811344236,
-0.0142948106,
-0.109211877,
0.2355829477,
-0.3649302125,
-0.1855000257,
0.1340003759,
-0.0453589335,
-0.148526147,
-0.0898534432,
-0.5390958786,
0.1714609563,
0.436840862,
-0.0269899834,
-0.5867698789,
0.1004967093,
-0.0533169992,
-0.1755786091,
-0.1529474258,
0.3230694234,
0.0704882964,
-0.2000650913,
-0.1911255121,
-0.3086667657
] |
https://github.com/huggingface/datasets/issues/1784 | JSONDecodeError on JSON with multiple lines | Hi Quentin!
I apologize for bothering you. There was some issue with my pyarrow version as far as I understand. I don't remember the exact version I was using as I didn't check it.
I repeated it with `datasets 1.2.1` and `pyarrow 2.0.0` and it worked.
Closing this issue. Again, sorry for the bother.
Thanks,
Gunjan | Hello :),
I have been trying to load data using a JSON file. Based on the [docs](https://huggingface.co/docs/datasets/loading_datasets.html#json-files), the following format is supported:
```json
{"key1":11, "key2":12, "key3":13}
{"key1":21, "key2":22, "key3":23}
```
But, when I try loading a dataset with the same format, I get a JSONDecodeError : `JSONDecodeError: Extra data: line 2 column 1 (char 7142)`. Now, this is expected when using `json` to load a JSON file. But I was wondering if there are any special arguments to pass when using `load_dataset` as the docs suggest that this format is supported.
When I convert the JSON file to a list of dictionaries format, I get AttributeError: `AttributeError: 'list' object has no attribute 'keys'`. So, I can't convert them to list of dictionaries either.
Please let me know :)
Thanks,
Gunjan | 56 | JSONDecodeError on JSON with multiple lines
Hello :),
I have been trying to load data using a JSON file. Based on the [docs](https://huggingface.co/docs/datasets/loading_datasets.html#json-files), the following format is supported:
```json
{"key1":11, "key2":12, "key3":13}
{"key1":21, "key2":22, "key3":23}
```
But, when I try loading a dataset with the same format, I get a JSONDecodeError : `JSONDecodeError: Extra data: line 2 column 1 (char 7142)`. Now, this is expected when using `json` to load a JSON file. But I was wondering if there are any special arguments to pass when using `load_dataset` as the docs suggest that this format is supported.
When I convert the JSON file to a list of dictionaries format, I get AttributeError: `AttributeError: 'list' object has no attribute 'keys'`. So, I can't convert them to list of dictionaries either.
Please let me know :)
Thanks,
Gunjan
Hi Quentin!
I apologize for bothering you. There was some issue with my pyarrow version as far as I understand. I don't remember the exact version I was using as I didn't check it.
I repeated it with `datasets 1.2.1` and `pyarrow 2.0.0` and it worked.
Closing this issue. Again, sorry for the bother.
Thanks,
Gunjan | [
0.1118792519,
-0.0649543181,
-0.0127834212,
0.5094956756,
0.366851002,
0.1452075243,
0.4116664827,
0.0697855949,
0.1164880544,
0.0775828138,
0.1227523834,
0.3139996231,
-0.0133126387,
0.1743166149,
0.1052535996,
-0.3321567178,
0.0563052371,
0.2422202677,
0.2812243104,
0.0448313579,
-0.1883261204,
0.3222274184,
-0.1211520284,
-0.0215250105,
-0.1003588736,
0.20094648,
-0.1490634978,
0.2098397017,
0.0983381197,
-0.5983390212,
0.1811593622,
0.0787488073,
0.0896524563,
0.409478724,
-0.0001244392,
0.1713655591,
0.2335568666,
-0.238509804,
-0.419300139,
-0.2048565745,
-0.2344137877,
-0.183765918,
0.4074416757,
-0.2153499871,
-0.0434504636,
-0.6132318974,
-0.1171404794,
-0.0572152548,
0.8382023573,
0.2899007797,
0.055700548,
0.0221737046,
0.2437992096,
0.0981307998,
0.1929416209,
0.3184739053,
0.1145069674,
0.4430995882,
0.2087321132,
0.3381674588,
0.0679092035,
-0.1586395204,
-0.0711871535,
0.0835567638,
0.2809578776,
0.1195685863,
-0.0219781809,
-0.1146163791,
-0.0106241051,
0.4550395906,
0.6182889342,
-0.1244444326,
-0.3540066779,
-0.4397034347,
-0.1298507154,
-0.2184528857,
0.2876079082,
0.1772157252,
-0.1519281715,
0.1779495925,
-0.159524411,
-0.1754688174,
-0.3075227737,
0.3047270179,
-0.0470939465,
-0.2925514877,
-0.1445955485,
0.242364496,
0.2514729202,
-0.1574361771,
-0.1731507331,
-0.1707074344,
-0.3005774617,
0.1942364126,
-0.0374581218,
0.0332616381,
-0.1622178704,
-0.2602838278,
0.3593867719,
0.0219994057,
0.2777706683,
-0.0156079866,
-0.2210020572,
0.1750970036,
0.3867212236,
-0.0310706738,
0.3983150423,
-0.2118357718,
0.0357384235,
-0.0887705758,
0.1991064399,
-0.1957680434,
-0.1575289369,
-0.0030411386,
0.0626834258,
-0.2527765334,
0.142438367,
-0.204782024,
0.0941170081,
-0.1280956119,
-0.3872185946,
-0.2571391165,
-0.1042992622,
0.3170134723,
0.3308332562,
0.0327448025,
0.0213840511,
0.4348157048,
0.1162054166,
-0.2527852356,
0.0686018914,
0.026087001,
0.1068152711,
0.124743849,
0.176832512,
-0.2131348997,
0.157749176,
0.1446981728,
-0.0201770607,
-0.1401215941,
-0.2365126163,
0.1040513366,
-0.0314322524,
0.2174636573,
0.093353413,
0.0051285964,
0.0656848028,
-0.3857872188,
-0.1371872872,
0.2650327384,
-0.3571531475,
-0.1853627115,
-0.2478068769,
-0.013029079,
-0.210179612,
-0.0484982505,
-0.7054874301,
0.2720553279,
-0.0497146808,
-0.3916545212,
0.0422809869,
-0.1151323766,
0.2001673728,
-0.2836832702,
0.0393826142,
0.4265242517,
-0.5727180839,
-0.3258417547,
0.3022895753,
-0.2016309798,
-0.0620366186,
0.3925490975,
-0.4634453356,
0.2692920566,
-0.1763111502,
0.3346168697,
0.3625283837,
-0.3054616451,
-0.286409229,
0.4760513008,
0.0608111545,
0.3308359981,
0.2555822432,
-0.1510690004,
0.2409438193,
0.039310392,
0.2559548914,
0.0936086178,
0.1579338461,
0.0332766585,
0.0208977833,
-0.040127404,
0.3830370009,
0.2622579634,
-0.34673208,
0.0336252451,
0.0298388172,
0.0210787989,
0.3198064864,
-0.3416236639,
-0.1486135423,
0.3134539127,
-0.1775079966,
0.0725345463,
0.041867733,
0.1931004971,
-0.7275479436,
0.0468465984,
0.0616338961,
-0.0923422053,
-0.3281356394,
-0.0458588153,
-0.0145275248,
0.0376032367,
-0.4042334855,
-0.0969729498,
-0.0637846738,
0.0427361503,
0.218138665,
0.1092856005,
-0.1538804173,
0.2307792306,
0.031264469,
0.1312132478,
-0.3026622534,
0.3729830086,
0.0696920604,
-0.1885005981,
0.0212979764,
-0.0272981804,
0.206064865,
-0.3279632628,
-0.0248574205,
0.2660457194,
0.3668583035,
-0.2670184672,
-0.1989664435,
0.065298453,
0.258785814,
0.0962706506,
-0.0828849971,
0.2987166643,
0.2130890191,
-0.2320665419,
-0.3045405447,
0.3062799871,
0.0069993245,
0.4205735624,
0.0265318546,
-0.1826451719,
0.3832911551,
0.1058387831,
-0.2332841605,
-0.0060080034,
0.2103117853,
0.2088833004,
0.0312986374,
0.0615093149,
-0.3478975892,
-0.1770056784,
0.5678307414,
-0.2046073675,
0.1121407226,
0.3307671845,
-0.1569917798,
-0.0826685205,
0.0503763929,
-0.1266834587,
0.3211075068,
0.1670219153,
-0.3652741909,
0.0371902734,
0.2347431481,
-0.2011920214,
0.1160395965,
-0.0974497944,
0.2182055861,
0.0531888269,
0.2291599661,
-0.0788062811,
-0.4170313478,
-0.4203802347,
0.1339418143,
0.1108309701,
-0.5512764454,
0.1252055168,
-0.3722786307,
-0.0822068974,
-0.0405488312,
-0.3005827665,
-0.2753337622,
-0.1956273466,
-0.0834284574,
0.0990592018,
0.0312620252,
-0.0518525131,
0.1712453812,
0.170026958,
0.1119887754,
-0.2457605153,
-0.207104817,
-0.2123646438,
-0.2687693238,
-0.0905148685,
0.215716213,
-0.0490051582,
-0.0251576118,
-0.3031784892,
-0.2045315653,
-0.1507425606,
-0.1372850984,
0.0808486491,
-0.170614928,
0.2122221887,
0.0848782882,
0.4887612164,
-0.0839298591,
-0.1283810437,
0.3590871692,
0.2363951802,
-0.2614623308,
0.2470538914,
0.0831590369,
0.0184301566,
-0.0464085229,
-0.0690746233,
0.0052782516,
-0.1544254124,
0.7430197597,
-0.0833437815,
0.2016303241,
-0.0415605754,
0.164539203,
0.1299039572,
-0.2662782371,
0.1000530943,
-0.1210285798,
-0.2139340788,
0.2681328952,
-0.12438941,
-0.4402169287,
0.0721984804,
0.1469228566,
-0.0704938024,
-0.0599187203,
-0.4526901841,
-0.2472373396,
-0.038853839,
0.2286967635,
-0.1373571903,
-0.0575729422,
0.2596031725,
-0.0101236599,
0.0912242532,
-0.0265843645,
-0.3342388272,
0.1173291504,
0.0551329702,
0.1163618565,
0.1643099785,
0.6633322835,
-0.2180379927,
0.2359457314,
0.305279851,
-0.0470108464,
0.367423147,
-0.2426073402,
0.2596140504,
-0.243277207,
-0.0913031399,
-0.126805231,
-0.125375852,
0.0130451163,
0.1845622361,
-0.0201929919,
0.0507538579,
-0.1736583561,
-0.0452295467,
-0.460967958,
-0.10127794,
0.1402493268,
0.0856634825,
-0.2287008017,
-0.2212108225,
0.0866018087,
0.0337411501,
0.1150735617,
-0.1839327365,
0.4028844535,
0.3039782047,
0.0090633044,
-0.4590246975,
-0.2491079122,
-0.2739680707,
0.3141447008,
0.0809367299,
0.3002000451,
-0.0620874539,
0.2909628749,
0.2164380252,
-0.1976758689,
0.9261081815,
0.0026834738,
-0.1659577042,
0.1430735737,
0.0866747871,
-0.4900356531,
0.0012996281,
-0.0514397062,
0.2541290224,
0.1277289093,
0.2014629543,
-0.6062142849,
-0.1465936005,
-0.1256860644,
0.1696176082,
-0.1325752884,
-0.3024125993,
-0.170227468,
-0.4666593373,
-0.5862988234,
-0.2181211412,
0.0285963491,
0.2952232957,
0.0815347657,
-0.0359524749,
0.0951206684,
-0.2656361461,
0.0024543824,
0.1268093139,
0.1854032725,
0.080439806,
-0.0903359652,
0.0820384249,
0.0542670004,
0.5888192654,
0.6108230352,
0.2106248587,
-0.6033204198,
-0.1698660702,
-0.3187559545,
0.4119628966,
0.1917915195,
-0.033370018,
0.1753226668,
-0.1057088524,
-0.0074271681,
0.073449634,
-0.2139062434,
0.4310307503,
-0.1350054592,
-0.3312544823,
-0.360796988,
0.5874243379,
0.00335962,
-0.012739718,
0.0707013533,
0.3162634671,
-0.3953837454,
0.3670034707,
-0.2552438378,
0.7166473269,
-0.0982210338,
0.3945841491,
0.4653703272,
-0.2684083581,
0.5387396216,
-0.1318393052,
0.0256850198,
-0.1567897201,
0.1508015394,
-0.1145972535,
-0.1021995321,
0.2868118882,
0.4203558266,
-0.1900788695,
0.1530015767,
-0.3553853929,
-0.005156497,
0.0449539088,
0.2930899262,
0.0029420154,
-0.2236184329,
-0.8049350381,
-0.0073048663,
-0.0906870589,
-0.1672312319,
-0.0486390777,
-0.2482414544,
0.0377585143,
-0.4397954941,
-0.3008873761,
-0.0289537404,
-0.0417472906,
-0.0845264271,
0.3456769586,
-0.3072957397,
0.2221975476,
0.309356153,
-0.0634281039,
-0.1697476506,
-0.2068006545,
0.0339384377,
-0.2961463332,
-0.2027096152,
-0.3475340903,
-0.0442655534,
0.1643637866,
-0.0564824119,
-0.2733548284,
0.2610816658,
-0.2105810642,
-0.5443148613,
-0.0701416358,
0.2332808822,
-0.4967070818,
-0.4386481643,
-0.312733978,
-0.1415803283,
0.0350837857,
-0.0848482326,
-0.0190850403,
0.1989035755,
-0.1074971929,
-0.1280620098,
0.0554454811,
-0.07897643,
-0.0511300527,
0.2231668234,
0.0287348721,
-0.1254389584,
0.6856865287,
0.3832615316,
0.0582154766,
-0.1036357284,
0.2032696009,
0.6720965505,
-0.2489134818,
0.3087472022,
0.1828708798,
0.4318404496,
-0.1328355223,
0.4236624241,
0.021997761,
0.1273988336,
0.3115242124,
-0.5580518842,
-0.153503567,
0.301692903,
0.0815710053,
0.0776999593,
0.2658527195,
0.0633562356,
0.0652713329,
0.0579958744,
-0.1272095442,
0.3353776932,
0.0415444449,
0.0779566765,
0.2087290585,
0.08264599,
0.3267768621,
-0.0425709076,
-0.0193540677,
0.1076970845,
-0.0010705239,
-0.0558861606,
-0.0491490141,
0.2018557489,
0.2419833541,
-0.0960254371,
-0.194938615,
-0.1539125293,
0.0119557725,
-0.1337751597,
0.3213222623,
0.0384285077,
-0.0873593092,
0.195522517,
0.3714819551,
0.164338991,
-0.3251367807,
0.1141154468,
-0.1638462096,
0.605987668,
0.0469972789,
-0.0119017335,
-0.1791576445,
0.0803646967,
-0.2306512594,
0.3374820948,
0.0988277495,
0.0001541488,
0.2705645561,
-0.4505709112,
0.1796672195,
-0.0524172038,
0.2017091662,
0.4938376546,
-0.4585255086,
0.3138845563,
-0.0284845587,
-0.0570583716,
0.0034636648,
-0.1709429026,
0.4224452376,
0.0875826403,
-0.1638116688,
0.1700981259,
0.0028254513,
-0.1336952746,
0.0171118584,
-0.1054552346,
0.2873851359,
0.2006531656,
-0.0894227773,
0.4312494993,
-0.1834628433,
-0.0569862165,
0.1248566285,
0.3617696464,
0.2412102073,
0.2141116261,
-0.3609217703,
-0.0355871618,
0.1423890442,
0.1633583903,
-0.1051955223,
-0.3548904359,
-0.0279863719,
0.3401580155,
0.2029380798,
0.061626669,
0.119415313,
0.2362378389,
0.1331354529,
0.1293346584,
-0.1833062172,
0.2270360142,
0.0308605228,
-0.3004810214,
-0.0711383596,
-0.1158105806,
-0.0918034837,
0.0500386842,
-0.2572752237,
-0.3297427297,
0.1884557605,
0.1104965061,
0.0763767511,
-0.4972603321,
0.1957598627,
0.0194556918,
-0.0014931412,
-0.2102143914,
0.3131483197,
0.3145588934,
-0.2211557478,
0.5350202918,
0.0256421249,
0.5477105379,
0.2180268317,
0.0665229037,
0.0182381459,
-0.5012835264,
-0.0442915522,
0.1924673319,
0.3591533899,
0.117642276,
0.0810042173,
0.2109431475,
0.0274811722,
0.057717558,
0.2730029225,
0.0655145496,
0.1863234043,
-0.3028696179,
-0.036933165,
-0.3501707315,
-0.1001455486,
-0.1512100995,
-0.1170872226,
-0.1513700932,
-0.3333920836,
0.094449915,
0.2090521753,
0.0679279268,
0.1047091633,
-0.0146006402,
-0.1393784285,
0.5112258792,
0.4039309919,
0.3075302243,
-0.0957835689,
-0.0280129295,
-0.2047961354,
-0.1363400817,
-0.3467089534,
-0.1190750524,
0.2723598778,
0.0867547467,
0.2639309168,
0.2851454616,
-0.0107749188,
0.2542980313,
-0.320068717,
0.0292568859,
-0.3025752306,
-0.1702691913,
0.3497335017,
0.231520474,
-0.1659981608,
0.1436178833,
0.4026560783,
-0.0710459948,
-0.0964014083,
-0.2188059539,
0.3641435504,
-0.1985041052,
-0.0947704166,
0.3104702234,
0.1703800708,
0.5703426003,
0.1612480581,
-0.1028219536,
0.0325656347,
-0.1898337603,
-0.0179048963,
0.5546193123,
0.0107955243,
0.3781963885,
-0.2969705164,
0.0308741778,
-0.180039078,
0.0773291662,
-0.3476778269,
-0.069900997,
-0.293413341,
0.2021337748,
0.0524855927,
-0.181460008,
0.0146749625,
0.0893938243,
-0.1310039163,
0.0649522319,
-0.1094194651,
-0.1019575149,
0.3342760503,
-0.4352570176,
-0.1552678794,
0.1767792702,
-0.031763386,
-0.1027400941,
-0.1141516343,
-0.567745924,
0.1682780534,
0.4463464022,
-0.0140642338,
-0.5691123009,
0.1102259904,
-0.0618530624,
-0.1592486352,
-0.1474104822,
0.2672375441,
0.073858656,
-0.1737384349,
-0.2226580381,
-0.3186437488
] |
https://github.com/huggingface/datasets/issues/1783 | Dataset Examples Explorer | Hi @ChewKokWah,
We're working on it! In the meantime, you can still find the dataset explorer at the following URL: https://huggingface.co/datasets/viewer/ | In the Older version of the Dataset, there are a useful Dataset Explorer that allow user to visualize the examples (training, test and validation) of a particular dataset, it is no longer there in current version.
Hope HuggingFace can re-enable the feature that at least allow viewing of the first 20 examples of a particular dataset, or alternatively can extract 20 examples for each datasets and make those part of the Dataset Card Documentation. | 21 | Dataset Examples Explorer
In the Older version of the Dataset, there are a useful Dataset Explorer that allow user to visualize the examples (training, test and validation) of a particular dataset, it is no longer there in current version.
Hope HuggingFace can re-enable the feature that at least allow viewing of the first 20 examples of a particular dataset, or alternatively can extract 20 examples for each datasets and make those part of the Dataset Card Documentation.
Hi @ChewKokWah,
We're working on it! In the meantime, you can still find the dataset explorer at the following URL: https://huggingface.co/datasets/viewer/ | [
-0.3861372173,
-0.387398392,
-0.0618845783,
0.2974123359,
0.1567153335,
0.2989472449,
0.0844827667,
0.355283916,
-0.0643110797,
0.3763423264,
0.0037851783,
0.2994420826,
-0.2900573909,
0.5288338661,
0.3926571906,
-0.2897696495,
0.0115510263,
0.2083533108,
-0.1008175164,
0.1148871183,
0.0792254806,
0.0855691135,
-0.1743279696,
0.1514348388,
-0.4029161334,
-0.1880394816,
-0.3037716448,
-0.0746548399,
-0.2611448765,
-0.5259741545,
0.0975276008,
-0.0969805121,
0.3257600069,
0.0875246823,
-0.0001094514,
-0.1372067332,
0.2247063518,
0.0796679556,
-0.4892881513,
-0.0592528172,
-0.3846618235,
-0.0151576251,
0.3065686226,
-0.160369873,
-0.2138926387,
-0.4064328074,
0.2569763958,
0.060766764,
0.3277088702,
-0.0574039929,
0.1862078309,
0.466473937,
-0.1011997014,
-0.309589535,
-0.0577799901,
0.593261838,
-0.3776035905,
0.1418807358,
0.4056650102,
0.1719204783,
-0.0558737963,
0.3942483664,
0.4434017837,
0.1074615866,
0.0666832104,
0.1224722266,
-0.0140310163,
-0.1412602663,
0.0352265537,
0.6123384833,
0.4841229916,
0.1082841903,
-0.3699078262,
-0.4363873601,
-0.0279571712,
-0.165865615,
-0.1121708378,
0.3824402988,
0.0701823533,
0.2538602948,
-0.3750243783,
0.1134658307,
-0.1830790639,
-0.0366973206,
-0.0914132074,
-0.0198505167,
-0.3480016291,
-0.0712084174,
0.468024075,
-0.0432208069,
0.0942930132,
0.2341704369,
-0.0011734816,
0.165216133,
-0.0263173189,
-0.2085908502,
0.1860803366,
0.1761120409,
0.1291076839,
0.2292696238,
0.1167377084,
0.32466802,
-0.0312280189,
0.1755797863,
0.2116529197,
-0.1055742055,
0.4409829676,
0.2119697481,
0.1845702529,
0.3149195015,
0.047623165,
-0.0426713936,
-0.3810488284,
0.1570367068,
-0.3530599773,
-0.2361382991,
-0.0104280412,
-0.1697172374,
-0.0877128541,
-0.1154188216,
-0.2391983867,
-0.0636855215,
0.1094629839,
0.4093827903,
-0.0947331563,
-0.3719475865,
-0.3213818073,
-0.1324315518,
0.0660620034,
-0.3266574442,
-0.1745933443,
0.0009159861,
-0.2827332914,
0.0300795473,
0.1448106766,
-0.5260004401,
0.4474388659,
-0.0701303855,
-0.0689210296,
0.0031329049,
0.3343259394,
0.1553655565,
0.3408134282,
0.1037811488,
-0.0048322864,
-0.2238626778,
0.1557135135,
0.073941797,
-0.2017608583,
-0.0292447116,
-0.1053105295,
-0.3409499526,
-0.3423967659,
0.1137072146,
-0.2802439928,
0.0596916601,
-0.3804875612,
0.478071779,
-0.4661557376,
-0.2010664046,
-0.0501740985,
0.1169522777,
-0.255343765,
0.0600067638,
0.3718671203,
0.2557032108,
-0.3894895613,
-0.377259165,
0.0182704311,
-0.2124768347,
-0.3901623189,
-0.0374629647,
-0.3442841172,
0.3350664675,
-0.5363284349,
0.2352287024,
0.3367296755,
-0.2228102535,
-0.0518805534,
0.0936631784,
0.1573925167,
-0.0549475513,
0.0014533733,
-0.1481587887,
0.4459005296,
-0.0305541623,
-0.3026455343,
-0.0790589675,
0.0599406771,
-0.0368748493,
0.0009243204,
-0.1719296873,
-0.0129105896,
0.0563328937,
-0.1486151665,
0.101053223,
0.1191321909,
0.0383444354,
0.4723881781,
-0.231759727,
-0.1125413626,
0.1484723538,
0.2192693651,
0.2432037145,
0.0111545017,
-0.4020671546,
-0.1583315879,
0.0949404091,
0.0038213043,
-0.1807396859,
0.3076314926,
-0.3185964227,
-0.1131108105,
-0.0341545828,
-0.2596442699,
-0.2621261477,
0.1584980935,
-0.1365665495,
0.161181733,
0.1251429915,
-0.1892431974,
0.0885896385,
-0.3987359703,
0.1870053113,
-0.3901410997,
0.209032625,
0.1105592325,
0.05360654,
0.0102648064,
0.0267263185,
-0.0408344083,
-0.2687211335,
0.0686031878,
0.2217152119,
0.1641523093,
-0.1090135202,
0.1630972773,
0.4362353384,
0.2089856565,
-0.3917671442,
-0.0104676085,
-0.133177951,
-0.1332425475,
0.2064633816,
-0.7598806024,
0.3216647506,
0.2521365583,
0.1578048319,
0.317338109,
0.1152514592,
0.0231769215,
0.1110880747,
-0.2549540401,
-0.2837449908,
0.1308500171,
0.076930806,
0.1748404503,
-0.0528694056,
-0.640616715,
0.1478692889,
0.2648250163,
-0.0942748636,
-0.0380186513,
0.0963485241,
-0.3271735013,
-0.0201583374,
0.4219532907,
0.052404806,
0.0221043229,
0.2686969042,
0.2439734191,
0.085768342,
-0.1344520897,
0.1146748737,
0.1895124614,
0.0684709549,
0.0004232779,
-0.357930392,
-0.1732079536,
0.0783767998,
-0.2876155674,
-0.0603781343,
0.1106496528,
0.1175419316,
-0.2738900781,
0.0905590802,
-0.3630374968,
-0.4837637544,
-0.0697945505,
0.0704646409,
0.1552467495,
-0.3996531069,
0.0803673267,
0.2161304206,
-0.114375174,
0.0583187491,
-0.1625738293,
0.3223586082,
-0.2975400686,
0.7413788438,
-0.1173183471,
0.1161013916,
-0.1537312567,
0.1364967376,
0.2291522324,
0.3248564303,
0.3808384538,
-0.2231338173,
0.1128323227,
-0.5781586766,
-0.5961934328,
0.4128218889,
0.0946189538,
0.2726972103,
0.3713107407,
0.1063178554,
-0.4431185126,
-0.080897972,
0.0142681468,
-0.3306339383,
-0.2247577012,
-0.1559306681,
-0.064511247,
0.1442426294,
-0.044717174,
-0.1804035902,
-0.169399485,
-0.1982712299,
0.3752357066,
-0.0849379972,
0.199865669,
0.1477505714,
0.041228123,
0.3752746582,
-0.5501066446,
-0.0154577689,
-0.118994303,
-0.4080892503,
0.037752673,
-0.6036459208,
-0.3449811637,
0.1304652542,
-0.1481446624,
-0.0367348045,
-0.1181496009,
-0.2437897325,
-0.2489360422,
-0.2817430794,
-0.0464461483,
-0.0438787043,
0.0582119189,
0.336622566,
-0.0722353756,
-0.0918442756,
0.0653492883,
-0.1439102441,
-0.0627382621,
-0.0116690574,
0.114991039,
-0.1781763434,
-0.0343369059,
0.1868716627,
0.3779297769,
0.2188416719,
-0.1248089746,
0.0270540286,
-0.4515986443,
0.2974493206,
-0.0454940125,
-0.0707405955,
0.1005070284,
-0.1144088805,
0.1488365084,
0.1586333066,
0.2225461751,
0.3080057502,
0.3026152253,
0.2815344632,
-0.3162564039,
-0.1943414807,
0.054528743,
-0.1732912511,
0.2260577381,
-0.1356072426,
0.1330336034,
-0.0513311774,
0.106368795,
0.0045784228,
0.0369432159,
0.2384204566,
0.0258270781,
-0.3806379437,
0.039896477,
0.0520675704,
-0.0444803871,
-0.0089074261,
-0.1164747402,
-0.286759913,
-0.1160022244,
0.0673917755,
0.231689766,
0.6677559614,
-0.0412938595,
-0.0051499167,
0.0473206155,
-0.471927613,
-0.3972481787,
-0.0349905677,
-0.2830821276,
0.0984151959,
0.1577622145,
0.4498454034,
0.1115661561,
-0.2531615794,
0.6400965452,
0.1472348422,
-0.1924184859,
0.1099447086,
0.1065793112,
0.1087524146,
-0.1604260802,
0.003370594,
0.1266915053,
-0.0600125715,
-0.0714540929,
-0.2331008762,
-0.3549361527,
0.0225642882,
0.01384845,
0.4331594408,
0.3815614283,
0.0909097716,
0.2579391003,
0.5203462243,
0.3753033578,
0.3056421578,
0.354917109,
0.1044134721,
-0.120968096,
0.3064052761,
-0.0617565848,
0.3310106993,
0.1565058082,
0.0389384143,
0.1024664864,
-0.0421239026,
0.1390386969,
-0.3317562044,
0.3228489459,
0.2974024117,
0.0894571319,
-0.3194745481,
-0.2341732234,
0.5605680943,
0.2237870246,
-0.1851389408,
0.4620555341,
0.4765684009,
0.1422175765,
-0.2373578995,
0.0535312444,
0.6876668334,
0.036522992,
0.0843452066,
0.2455759495,
-0.1716546416,
0.5021947622,
0.1209286153,
-0.1125572845,
-0.2956692278,
-0.477871716,
-0.1147816777,
-0.2216897458,
0.2821294069,
0.1816496849,
-0.1988606602,
-0.0246848818,
-0.0100785168,
0.1824439615,
-0.0426991358,
0.06374529,
0.0157806333,
-0.0726714656,
-0.381989032,
0.123799406,
0.1878640056,
-0.0032549596,
0.0093380027,
-0.1006217971,
0.0058431323,
-0.0603998564,
-0.4639253914,
-0.215630576,
-0.1343783736,
0.0016825735,
0.2792566419,
-0.2689449489,
0.3096627295,
0.3147809505,
0.0312163979,
0.0395607352,
-0.2702922225,
0.0169412773,
-0.4660323262,
-0.0458327681,
-0.1562336236,
-0.0017328471,
0.2650190592,
-0.1244600266,
-0.205722928,
0.2733052969,
-0.014413733,
0.0176642369,
-0.0818945244,
0.1602961272,
-0.2555716634,
-0.1735801101,
-0.0668572783,
-0.103481926,
0.0298795551,
-0.2667162716,
0.1227919981,
0.2154371589,
-0.1349742711,
-0.0131824473,
0.3866212964,
0.1808193624,
0.0047534467,
0.1999900639,
-0.1486935914,
-0.00186888,
0.275264591,
0.1902957708,
0.0427182131,
-0.2142772228,
0.2983701825,
0.4879493117,
-0.2186921388,
-0.0052251634,
-0.1280593276,
0.0626682043,
0.1973384917,
0.3569822609,
0.1994886994,
-0.1900320947,
-0.2914750278,
-0.0581811331,
-0.3802821934,
0.211499691,
-0.1183483228,
0.4987815022,
-0.1797662973,
0.0155374324,
0.0540674552,
0.1239063889,
-0.3196072876,
0.2481545061,
-0.3238676488,
0.0638505518,
-0.0027059752,
0.299105227,
0.1134035289,
-0.3290359378,
-0.0358924605,
0.1201807559,
-0.1838931888,
-0.2319046557,
-0.3390772343,
0.1232621074,
0.0479894243,
-0.001572492,
0.2810545862,
0.3564522862,
-0.0047399579,
-0.2098504156,
0.1643417329,
0.0381745286,
0.2374486923,
0.2311758697,
0.0434191264,
-0.1417313367,
0.2041553706,
-0.0501083918,
0.2943198383,
0.1833574027,
0.3143185675,
-0.0947324932,
-0.1675236523,
-0.0726326406,
-0.0399609432,
0.1879500151,
-0.0444884896,
-0.3453725576,
0.0505960807,
0.0246744826,
0.1378044635,
-0.0245431885,
0.3533419669,
0.08927688,
0.025667632,
0.1503742784,
0.3059253991,
0.2060719132,
-0.1718243212,
-0.1820331663,
0.094153367,
-0.0817898065,
0.2399889082,
-0.0283040162,
0.1882384717,
0.3200186491,
0.1430030614,
-0.1456786692,
-0.0193490256,
-0.0278934017,
0.4929859936,
0.3488088846,
-0.2583789229,
0.0763229579,
0.1167523116,
0.0699776411,
0.3328177631,
-0.0869749039,
-0.0373556726,
0.3632179797,
-0.2329983562,
0.0822148696,
0.5594726801,
-0.2854762673,
-0.0367404558,
0.0957807004,
-0.1388899535,
0.0861749724,
-0.2034255862,
0.5114122033,
-0.1582647711,
-0.3456504047,
-0.2892790139,
-0.0635988712,
0.0663788319,
-0.0988222063,
-0.0952320248,
-0.2246951312,
0.077516824,
0.1003463864,
0.1074532866,
-0.4275768399,
0.1521023959,
-0.3320242763,
-0.0672016144,
-0.4065210819,
-0.0077388175,
0.2845519781,
0.2409391701,
0.0388465784,
-0.0567139909,
-0.1350167692,
0.0345030911,
0.0069476082,
0.622680366,
0.1937184781,
-0.2719532251,
0.4494184256,
-0.0038369137,
-0.2786709964,
-0.0097364858,
0.0881031007,
-0.0938066021,
0.0963918939,
-0.3321147561,
0.246011883,
0.1230236813,
-0.1396177113,
0.1429751068,
-0.1674233079,
0.2251501828,
-0.4204903841,
-0.141907379,
-0.1662170291,
-0.2215797007,
0.1382442117,
-0.2380772084,
-0.2436444461,
0.1490852833,
0.3808837235,
0.0073078866,
-0.0184754934,
0.1062794924,
0.0704991743,
0.0176712815,
0.3879521191,
0.5070169568,
0.0912008509,
0.0155649893,
-0.4338001609,
-0.4961234033,
-0.047770191,
-0.2083726227,
-0.0755690262,
0.2671863735,
0.0514979474,
0.0792369694,
0.1202500686,
0.1934062093,
-0.1729040593,
0.1122846231,
0.1488932371,
-0.3747888505,
-0.2444618046,
0.1333275288,
0.1647690684,
-0.1115220487,
0.0973019078,
0.1833660603,
-0.2671877146,
-0.0605350323,
-0.0539661534,
0.4409009218,
-0.3858109713,
-0.2134542465,
0.2742441297,
-0.0893199071,
0.2211430222,
-0.054288812,
-0.0579264984,
-0.1133800223,
0.1059221923,
0.0567836612,
0.3305472136,
0.1192981824,
0.3175494373,
-0.0366032347,
-0.2714533508,
-0.0694229752,
-0.1528833061,
0.4136188328,
0.1176899821,
-0.2102361917,
0.0262813941,
0.0310721677,
-0.0865950137,
0.5606871843,
0.3495244682,
-0.1818980575,
-0.2859416008,
-0.0456777327,
-0.075135462,
0.2033851147,
-0.424295783,
0.020381365,
-0.0072014714,
0.0730977058,
0.285140425,
-0.1397033632,
-0.532112062,
-0.0779316649,
0.3862551749,
-0.2537596226,
0.0817722455,
0.4235804677,
0.0683879629,
0.0249758828,
-0.0616192408,
0.7284912467,
0.2601011992,
-0.1255478561,
0.0781494528,
-0.2238432765
] |
https://github.com/huggingface/datasets/issues/1783 | Dataset Examples Explorer | Glad to see that it still exist, this existing one is more than good enough for me, it is feature rich, simple to use and concise.
Hope similar feature can be retain in the future version. | In the Older version of the Dataset, there are a useful Dataset Explorer that allow user to visualize the examples (training, test and validation) of a particular dataset, it is no longer there in current version.
Hope HuggingFace can re-enable the feature that at least allow viewing of the first 20 examples of a particular dataset, or alternatively can extract 20 examples for each datasets and make those part of the Dataset Card Documentation. | 36 | Dataset Examples Explorer
In the Older version of the Dataset, there are a useful Dataset Explorer that allow user to visualize the examples (training, test and validation) of a particular dataset, it is no longer there in current version.
Hope HuggingFace can re-enable the feature that at least allow viewing of the first 20 examples of a particular dataset, or alternatively can extract 20 examples for each datasets and make those part of the Dataset Card Documentation.
Glad to see that it still exist, this existing one is more than good enough for me, it is feature rich, simple to use and concise.
Hope similar feature can be retain in the future version. | [
-0.3628718853,
-0.4238751531,
-0.0469129309,
0.3083789647,
0.1272352934,
0.2346737236,
0.171014607,
0.3707433939,
-0.0460053198,
0.3754512668,
0.0373595208,
0.2407731265,
-0.310693413,
0.5867728591,
0.4250448048,
-0.3711117506,
0.0176206063,
0.1814073175,
-0.0853758901,
0.0868426785,
0.0558810905,
0.0799580961,
-0.1806430966,
0.1946163774,
-0.4375638366,
-0.203209579,
-0.2906790972,
-0.0181121603,
-0.2234525234,
-0.5350552201,
0.0933510885,
-0.1131595969,
0.3181227744,
0.0995316803,
-0.0001116613,
-0.1911392659,
0.2427990884,
0.1175147966,
-0.5374827981,
-0.0170243718,
-0.3509195149,
-0.0632480606,
0.3206754625,
-0.1844152808,
-0.1859280765,
-0.3335362077,
0.2009566873,
0.0871429071,
0.362575978,
-0.1000137702,
0.1540151387,
0.4514330626,
-0.1147696152,
-0.2746317685,
0.0215256009,
0.6503051519,
-0.4158146083,
0.1027739644,
0.4872647226,
0.1220443547,
-0.0628315434,
0.4364341795,
0.3849206567,
0.1084418073,
0.0827867612,
0.135982424,
0.0367400013,
-0.1285454929,
-0.0026760062,
0.6877959967,
0.4381467402,
0.0931987911,
-0.3632137775,
-0.5371537805,
-0.0944300666,
-0.2077553123,
-0.1235666275,
0.3460617065,
0.04566174,
0.2922644317,
-0.3274422884,
0.1238084137,
-0.201406464,
-0.0435202979,
-0.031608969,
-0.04195299,
-0.3505463004,
-0.0388572291,
0.4434105456,
-0.0454549789,
0.0321442559,
0.1650789082,
0.0274944734,
0.1676371545,
-0.036264237,
-0.1789745688,
0.2143941373,
0.1790529788,
0.2006741315,
0.1832562983,
0.0436741151,
0.2886768579,
-0.0051314989,
0.1875262707,
0.2100377977,
-0.1485776156,
0.4455881417,
0.1579920202,
0.1987576038,
0.2905832529,
0.1111951321,
-0.0247340556,
-0.3412183225,
0.1907039434,
-0.3514390588,
-0.2364158332,
0.0480777696,
-0.1570363194,
-0.074546203,
-0.1104140654,
-0.1966984272,
-0.1001116633,
0.0987716913,
0.3787339032,
-0.0820650086,
-0.3699349761,
-0.304392606,
-0.1323146969,
0.095330134,
-0.3404928744,
-0.163353011,
0.0134241302,
-0.2573070824,
0.076516971,
0.1408936828,
-0.4891142845,
0.4031633437,
-0.0637200624,
-0.0823208317,
0.018205598,
0.3176812828,
0.137645781,
0.3231968582,
0.0846773982,
-0.0698208511,
-0.2001847774,
0.1453600824,
0.046680741,
-0.2402200699,
-0.0332046188,
-0.1150541082,
-0.4029283524,
-0.319767803,
0.0904973447,
-0.1786216944,
0.1010479257,
-0.509186089,
0.5675261021,
-0.4719491899,
-0.1423956901,
-0.0522874221,
0.168827951,
-0.2888944149,
0.0808210596,
0.3657827377,
0.3202441037,
-0.3815146387,
-0.4023029804,
0.004049724,
-0.202449888,
-0.3541720808,
-0.0102660619,
-0.3748867512,
0.3842634559,
-0.5060608983,
0.1932108998,
0.3482881486,
-0.2705028057,
-0.026890263,
0.0732421353,
0.1342186481,
-0.015300299,
0.0547207631,
-0.1656397879,
0.5171089768,
-0.0580825694,
-0.3266584873,
-0.005883886,
0.0500523411,
0.0045677912,
-0.0057812189,
-0.1436332911,
-0.0126430066,
0.0987415686,
-0.1880909503,
0.082975477,
0.1046868712,
-0.0291378293,
0.5324886441,
-0.2547031343,
-0.0623809956,
0.1240162104,
0.2447227687,
0.1867267489,
0.0332896821,
-0.3907250762,
-0.2663161755,
0.0874270648,
0.0173915643,
-0.1704369634,
0.3375404775,
-0.3268711865,
-0.1081180573,
-0.0301378909,
-0.2641526461,
-0.2458118796,
0.1156628728,
-0.1632664353,
0.1129678488,
0.119404994,
-0.2301287651,
0.1028629243,
-0.4876908362,
0.1937000602,
-0.3489359021,
0.1925221831,
0.1154592782,
0.0896765217,
-0.0020306744,
0.0805485845,
-0.0232974291,
-0.2826878726,
0.0523238853,
0.1806113124,
0.1651830375,
-0.1275325269,
0.2021796405,
0.4183843732,
0.2501941621,
-0.3330257535,
-0.0042099576,
-0.2055594325,
-0.0718845949,
0.1867927909,
-0.735193491,
0.3116652369,
0.2892591059,
0.1737937331,
0.2762282193,
0.0559667274,
0.0272191036,
0.0849292874,
-0.2509570718,
-0.2338691056,
0.1624346972,
0.0834240317,
0.1351509094,
0.0118410913,
-0.6773619652,
0.1799949855,
0.3371829391,
-0.1255379468,
-0.0636918545,
0.1597155929,
-0.2830047309,
-0.0718509629,
0.422870785,
0.0580270328,
0.0078621795,
0.2213020623,
0.1757677048,
0.0611360967,
-0.1028247848,
0.1389878243,
0.2311140895,
0.0595358908,
-0.0213477518,
-0.3625929952,
-0.1599091589,
0.1234789565,
-0.2691359818,
-0.0851846337,
0.1261217147,
0.0675015152,
-0.2492977679,
0.0882231966,
-0.3124132454,
-0.4699496925,
-0.0558278151,
0.0536707416,
0.1064355448,
-0.3449404538,
0.0961489007,
0.1833515614,
-0.1305016875,
0.0808018073,
-0.0739754811,
0.440916568,
-0.2626435459,
0.6817625165,
-0.1589348316,
0.1216822118,
-0.1466043293,
0.0929053053,
0.1964096725,
0.2997835577,
0.3955370486,
-0.1922944188,
0.1253750324,
-0.6362913847,
-0.5710223317,
0.4147367775,
0.1140513718,
0.2819751203,
0.3237909675,
0.1212586835,
-0.4809721112,
-0.0920614749,
0.0238982458,
-0.3108509183,
-0.1952955872,
-0.1606524736,
-0.0696497709,
0.0866158754,
-0.0036354377,
-0.1760455519,
-0.2337189019,
-0.1928887218,
0.3730758727,
-0.135029614,
0.2156970352,
0.1801917851,
0.022220714,
0.3586764336,
-0.5773916245,
0.065688163,
-0.1230052486,
-0.4196790755,
-0.0341911651,
-0.5392008424,
-0.3599956632,
0.0488107651,
-0.1813383996,
-0.1222138181,
-0.0861301422,
-0.2249406874,
-0.2832895815,
-0.2888916731,
-0.0127120642,
-0.0550171211,
0.1428120434,
0.3644662797,
-0.0129617192,
-0.0480524376,
0.0823387131,
-0.2271726876,
-0.0411861613,
-0.0195226595,
0.1034805104,
-0.1157058924,
0.0113717997,
0.1424407065,
0.4282981455,
0.1344207674,
-0.0786098391,
0.0477126837,
-0.4147194028,
0.2543257773,
-0.0843590721,
-0.1063031629,
0.1534172744,
-0.0989837423,
0.171402961,
0.1308540404,
0.2102694213,
0.3452125192,
0.2885035276,
0.2634057999,
-0.2960063517,
-0.2334069163,
0.0258639809,
-0.0685661733,
0.2710052729,
-0.0581059605,
0.0561372899,
-0.0502935164,
0.114802435,
0.0017156522,
0.1360843033,
0.2629629672,
0.0426918603,
-0.4515695572,
0.0488927774,
0.0635930002,
-0.0651576519,
0.0423952602,
-0.1487873942,
-0.2744348943,
-0.1030249745,
0.0133105004,
0.2753253579,
0.6601599455,
0.0227464829,
-0.0210921671,
0.0015429297,
-0.5326406956,
-0.3859304786,
-0.0235721096,
-0.2493938059,
0.0746178403,
0.1191318035,
0.4595214128,
0.0635117069,
-0.3181060553,
0.6373790503,
0.2131970823,
-0.1942306459,
0.1262272,
0.1192456409,
0.1060939133,
-0.2007534802,
0.0158856027,
0.1677351445,
-0.0721869022,
-0.0692642778,
-0.2534734905,
-0.3691614866,
0.0623062626,
-0.0160834678,
0.4453267455,
0.388785243,
0.0738942549,
0.327236712,
0.4302355945,
0.4262764156,
0.3560320139,
0.2934801877,
0.0179011989,
-0.1467509717,
0.259575665,
-0.1083228365,
0.4040627778,
0.2071858943,
-0.0402673781,
0.138090089,
-0.1056490317,
0.1593226492,
-0.3352411389,
0.2904128134,
0.320535332,
0.1410129368,
-0.3666874468,
-0.2220759839,
0.564984858,
0.2509384155,
-0.1964270771,
0.4854008257,
0.5616514087,
0.1654267758,
-0.2337637395,
-0.0134837013,
0.7488549352,
0.0113565521,
0.1794236749,
0.2811604142,
-0.0862898007,
0.5181324482,
0.2136398554,
-0.0785979554,
-0.3509379625,
-0.4129319787,
-0.1072376668,
-0.2359377146,
0.2514561415,
0.2131425738,
-0.1995894611,
-0.0309330672,
0.0339613557,
0.1847020686,
-0.0806807727,
0.0858267769,
0.067186892,
-0.1996517181,
-0.4594392776,
0.0668152794,
0.1864131242,
-0.0313172117,
-0.0020041738,
-0.1454934627,
0.0337261371,
-0.0769511387,
-0.4161770642,
-0.2480277568,
-0.1253672391,
-0.0278666802,
0.3732723296,
-0.3237705231,
0.3246670961,
0.2412867546,
-0.0232416019,
0.0666112751,
-0.2086133361,
-0.0316213183,
-0.5383202434,
0.0119532989,
-0.2288869619,
-0.0497356281,
0.2615384459,
-0.1323260069,
-0.237470746,
0.1870979965,
-0.0615189113,
0.0161331035,
-0.0706648678,
0.1741615087,
-0.1979464293,
-0.1789819598,
-0.0728762746,
-0.1146973595,
0.0056844889,
-0.2668553293,
0.0995807722,
0.2071618587,
-0.1186470315,
-0.0114446636,
0.3965775669,
0.165059641,
0.0238774307,
0.1108319387,
-0.176314041,
-0.0161290206,
0.2718545198,
0.1713451594,
0.0496564098,
-0.1989774406,
0.2984876633,
0.5128173828,
-0.205611974,
0.040533632,
-0.0790152848,
-0.004781696,
0.1420994699,
0.4264117479,
0.2334618419,
-0.1881691068,
-0.2181655169,
-0.0426885225,
-0.3736994565,
0.2281521708,
-0.1707383245,
0.4515783787,
-0.1238325313,
-0.0085978825,
0.0644110069,
0.1072044373,
-0.2979230583,
0.2373310328,
-0.2675720155,
0.0675866902,
0.1066539511,
0.2853390574,
0.1486872882,
-0.2966265976,
-0.0560371056,
0.0898985416,
-0.1692587286,
-0.2235216945,
-0.3569561541,
0.144978106,
0.0643262267,
-0.0398162641,
0.2931801081,
0.3415267169,
-0.0312435422,
-0.2159669995,
0.2144908905,
0.0533114634,
0.2625319958,
0.2650322318,
0.0118770013,
-0.1454115808,
0.2332729846,
0.026836928,
0.2896946669,
0.1986462176,
0.3081663251,
-0.1180164143,
-0.1354851574,
-0.0996297598,
0.0139545985,
0.195192188,
-0.0486498699,
-0.3119460642,
0.0135784801,
0.0048814067,
0.0742330253,
0.0398387052,
0.3551677763,
0.1148306131,
0.0165189691,
0.1727309525,
0.2973674238,
0.1809265167,
-0.1903831214,
-0.2095321417,
0.1714635789,
-0.1108704209,
0.2763525844,
0.0186879076,
0.2120938152,
0.3231053948,
0.1600313038,
-0.1867731214,
0.0366659686,
-0.0178793296,
0.4736908972,
0.281827569,
-0.2511591017,
0.0975117758,
0.1115472615,
0.1697710156,
0.3672657907,
-0.1209313422,
-0.0234210324,
0.3076198697,
-0.1960165203,
0.0861857235,
0.558036387,
-0.3268480003,
0.0336430147,
0.0866760761,
-0.1684753299,
0.0443018265,
-0.2090537548,
0.5345988274,
-0.1278412044,
-0.4057993293,
-0.251426816,
-0.0618169792,
0.0548416339,
-0.1127426028,
-0.0393093675,
-0.2156904936,
0.0880427659,
0.0932184383,
0.107428737,
-0.372995913,
0.2144728601,
-0.3236888051,
-0.0083959186,
-0.4254331291,
0.0057017994,
0.3477915227,
0.265750736,
0.0909908116,
-0.0972997397,
-0.099301368,
0.0328819603,
-0.0346274711,
0.6206563115,
0.1180764362,
-0.2262900472,
0.4333231747,
0.0406723879,
-0.3129925728,
0.002246188,
0.0734698996,
-0.120793961,
0.1067875251,
-0.3400853276,
0.232807368,
0.0746833608,
-0.1075116321,
0.1573759168,
-0.1454618275,
0.0912462696,
-0.4371273816,
-0.1730301827,
-0.1889235377,
-0.2234086245,
0.0394579545,
-0.2309258282,
-0.2144012451,
0.0947490335,
0.5052250624,
0.0336166397,
0.0103735095,
0.0725557432,
0.0557907522,
0.007100875,
0.3296575248,
0.5122720599,
0.1003583521,
0.0307940133,
-0.3707311451,
-0.4566683471,
-0.0553623214,
-0.2726143301,
-0.1133475304,
0.3075875938,
0.0595561266,
0.0208585188,
0.1412316114,
0.2326319665,
-0.1926283389,
0.1496746689,
0.0902004614,
-0.4039143324,
-0.2468185723,
0.1658664197,
0.1431379616,
-0.1139868945,
0.0197617728,
0.1975493878,
-0.2165278047,
-0.0819169879,
-0.0905738622,
0.4436957538,
-0.3907443881,
-0.1234759837,
0.230035156,
-0.0508331396,
0.179104045,
-0.0547772981,
-0.1305194348,
-0.1095266789,
0.1321539134,
0.0601373687,
0.3216053545,
0.1370902508,
0.2485490441,
-0.0404415503,
-0.2820134163,
-0.1084605679,
-0.1037032679,
0.4561387002,
0.0615924112,
-0.2457844615,
0.0784035921,
0.0684581771,
-0.0974804685,
0.5709721446,
0.358867377,
-0.2080977559,
-0.2477645576,
-0.1020755097,
-0.1012575105,
0.2366830707,
-0.3834225833,
-0.0257164333,
-0.0323446468,
0.0827092677,
0.2758225501,
-0.1074644178,
-0.530341804,
-0.1059398577,
0.3487039804,
-0.2784737945,
0.0735509917,
0.4093363285,
0.0977711827,
-0.0054468545,
-0.0686585084,
0.6830688715,
0.2762746811,
-0.1177213565,
0.099652119,
-0.2393693477
] |
https://github.com/huggingface/datasets/issues/1781 | AttributeError: module 'pyarrow' has no attribute 'PyExtensionType' during import | Hi ! I'm not able to reproduce the issue. Can you try restarting your runtime ?
The PyExtensionType is available in pyarrow starting 0.17.1 iirc. If restarting your runtime doesn't fix this, can you try updating pyarrow ?
```
pip install pyarrow --upgrade
``` | I'm using Colab. And suddenly this morning, there is this error. Have a look below!
![screenshot-colab research google com-2021 01 26-08-15-36](https://user-images.githubusercontent.com/45964869/105799890-fdaf3b80-5fae-11eb-8f06-11b65cdccc30.png)
| 44 | AttributeError: module 'pyarrow' has no attribute 'PyExtensionType' during import
I'm using Colab. And suddenly this morning, there is this error. Have a look below!
![screenshot-colab research google com-2021 01 26-08-15-36](https://user-images.githubusercontent.com/45964869/105799890-fdaf3b80-5fae-11eb-8f06-11b65cdccc30.png)
Hi ! I'm not able to reproduce the issue. Can you try restarting your runtime ?
The PyExtensionType is available in pyarrow starting 0.17.1 iirc. If restarting your runtime doesn't fix this, can you try updating pyarrow ?
```
pip install pyarrow --upgrade
``` | [
-0.179066211,
-0.1585773528,
-0.0443939418,
0.2205855548,
0.1801976413,
-0.063926667,
0.1799791008,
0.2682423294,
-0.3114222884,
0.1932341605,
-0.0361046493,
0.4329883754,
-0.1667322218,
-0.1118564904,
0.0816415101,
-0.067264542,
0.25074929,
0.3972361386,
0.228316322,
0.0152992755,
-0.1987969726,
0.221433267,
-0.3317899704,
0.2289113849,
-0.3630695045,
0.2572511733,
0.0558957122,
-0.1920560598,
-0.2301742285,
-0.5764157772,
0.462282598,
-0.457690388,
0.1837865859,
0.0198196359,
-0.0001144319,
-0.0085835783,
0.3469850719,
0.0369327143,
-0.0782000348,
-0.1799270213,
0.0146691715,
-0.0796008408,
0.3153557777,
-0.0688826814,
0.1376845539,
-0.0490984172,
-0.0455622524,
0.3671182692,
-0.0516868122,
0.2796533108,
0.2375448346,
-0.0251757056,
0.5402343869,
0.0167236347,
0.5227000117,
-0.1609017849,
-0.2256377786,
0.6437645555,
0.3970013857,
-0.3397269547,
0.3303515017,
-0.0623880364,
-0.3161488473,
0.1467279196,
0.3413373828,
0.0093864799,
0.4785273373,
-0.2968398035,
-0.0349209383,
0.0639048815,
0.1993097812,
-0.1061325446,
-0.0536233447,
0.132171452,
0.2737746835,
-0.4418088496,
0.1780538112,
0.3744233847,
-0.0651032031,
0.1674178839,
0.3446935117,
-0.0282737724,
-0.1547166109,
0.1121771559,
-0.329946965,
0.4400117695,
-0.0608913787,
-0.0126787322,
0.1606595963,
-0.0143534588,
0.438403219,
0.172019437,
-0.1464571953,
0.1746092737,
-0.1346680224,
0.1695788801,
0.0346122049,
0.3614489734,
-0.016897602,
-0.3039343059,
-0.1646401733,
-0.220255807,
0.1852379739,
0.4585882127,
-0.1547240615,
0.2969103754,
0.0425982662,
-0.1898491979,
0.1939643919,
0.0431142077,
-0.1044294834,
0.1421603113,
-0.1413404197,
-0.3777514994,
0.2381356806,
-0.0861329734,
0.4219926894,
-0.1524941176,
-0.4551398754,
-0.3460400701,
-0.5161127448,
0.0715427548,
-0.0819105729,
0.2317308784,
-0.1786214709,
0.1398227364,
0.0135103101,
0.2279354632,
-0.1297754943,
-0.2341374159,
-0.0415705405,
0.3183739781,
-0.1867558509,
-0.2240166068,
-0.0605835021,
-0.1977540404,
-0.0344869383,
0.0647210032,
0.0029573513,
-0.1728653163,
-0.3638980687,
-0.2314032912,
-0.2383740693,
0.3250187933,
-0.1241198108,
-0.014452273,
0.1709779054,
-0.5575415492,
-0.1424940228,
0.3194750249,
-0.5617522001,
-0.4043889046,
-0.2904804647,
0.1659997255,
-0.1723258048,
-0.1548972875,
-0.3065097034,
-0.180351004,
-0.0339650288,
-0.2712188065,
-0.1344474107,
-0.4794243872,
-0.016060682,
-0.4012237489,
-0.077994369,
0.0237127021,
-0.4536842704,
-0.1713842601,
-0.0673350617,
-0.0593351871,
0.3455155492,
0.0348361954,
-0.1741033196,
0.0599539876,
-0.0843449533,
0.1987010092,
0.0848143101,
-0.1136740819,
-0.2233839333,
-0.2362246662,
-0.0785073936,
-0.0386035368,
-0.0020763595,
-0.2877234221,
-0.0197689943,
-0.0431309938,
0.4431331754,
0.2906012833,
-0.1093343496,
0.2179861814,
-0.3110336065,
-0.1981667131,
0.3580447733,
0.1255993396,
0.0955357626,
-0.1678241789,
0.0892779529,
-0.2828475833,
0.090903163,
-0.1441043466,
-0.0333425589,
-0.0247799959,
0.5660243034,
0.0915234685,
-0.1175734997,
-0.0555668175,
0.0603021681,
0.1770726293,
-0.1671853065,
0.152255699,
-0.3447425067,
-0.0380014516,
-0.3247752786,
0.3926259279,
-0.2453925163,
-0.0746599287,
0.0887515321,
-0.1059180126,
-0.1791073829,
0.4000239372,
-0.0704848915,
0.0581476539,
0.1778245717,
0.1856284291,
0.0744911805,
0.4301852286,
-0.270831883,
-0.4979071617,
-0.1084051207,
0.0034127755,
0.2324231565,
0.0094569614,
-0.1076801345,
-0.0669999868,
-0.0296542831,
0.1820951253,
-0.2738327086,
0.1543225944,
0.0993480757,
-0.4678508043,
-0.0098043708,
-0.223481968,
0.0692760572,
-0.0187454242,
0.8860570192,
0.1675923467,
0.2548610866,
0.1322638839,
-0.2607863247,
0.1686571538,
0.0046347072,
0.0924633369,
0.2096390128,
0.1399047673,
0.0681172237,
0.2411943376,
-0.1811215281,
-0.1170750335,
-0.0255326759,
0.054254353,
0.283424288,
0.202645272,
0.1976954341,
0.0019478981,
-0.4756844938,
0.0932434648,
0.2365923375,
-0.1732940972,
0.3250069916,
0.0668009967,
-0.359757036,
0.0757199079,
0.0793353245,
-0.0889666975,
0.2429632992,
0.1491231173,
0.5926091671,
-0.0030888037,
0.2650881708,
0.0802499205,
-0.1685390472,
-0.2275588214,
-0.0866513029,
0.2750094235,
-0.2485770285,
0.2147494406,
-0.3447979689,
-0.0234027449,
-0.1641616821,
-0.549045682,
-0.1036437675,
-0.1264575124,
-0.1215840578,
0.285643667,
0.1915259361,
0.0521731861,
0.2701267302,
-0.0963662639,
0.0707285106,
-0.4580155611,
-0.0769521669,
-0.2203985155,
-0.3743091226,
0.0262892134,
0.1251773536,
-0.0590723194,
-0.0304247476,
-0.3601934016,
0.130164966,
0.0701579228,
-0.3697498441,
0.1027365625,
-0.2174157351,
0.3510778546,
0.1288845092,
0.1389358044,
-0.2283434123,
-0.2265940756,
0.341027528,
-0.2279567719,
-0.2316580862,
0.1729714721,
-0.2530030012,
-0.1466667801,
-0.0388244539,
-0.0024365932,
-0.4087465107,
-0.135674879,
-0.0016151702,
0.06178106,
0.0647764206,
0.2473358661,
0.3024417758,
0.2300610393,
0.0246636942,
-0.0055180965,
0.1005852297,
0.166260466,
0.4291495085,
-0.1283851266,
-0.1799857169,
0.3432487249,
-0.2596541643,
-0.0454662256,
-0.102590397,
-0.2102574259,
-0.4968867898,
-0.0208503958,
0.4942530394,
-0.1182473078,
-0.0494854003,
0.1953199804,
0.1326888055,
0.0062992023,
0.096387662,
-0.0298702661,
-0.4402617812,
0.3675143719,
0.2336596698,
0.0597362481,
0.0384738185,
-0.1328353584,
0.5266129971,
-0.315018177,
-0.034939833,
0.3293398917,
-0.2715454996,
-0.061686106,
0.0273058806,
-0.3756973147,
-0.0280950256,
-0.1555026919,
-0.2060227543,
0.1761332452,
-0.2777554393,
-0.1640520692,
-0.1638622582,
-0.077484183,
-0.238301903,
-0.2118123323,
0.1579074413,
0.3201149106,
0.2225838453,
-0.1609208137,
-0.1791940182,
-0.0132110436,
-0.1428378224,
0.1238499135,
0.205128178,
-0.2716386616,
0.0700985491,
0.4383118451,
-0.6262354255,
-0.059639331,
0.2981524467,
0.3296101093,
-0.0452160947,
0.1585372239,
0.0653333366,
0.0440485217,
-0.0163500551,
0.351873517,
0.2703383267,
-0.0755225271,
0.1412082911,
0.0766279027,
-0.149099201,
-0.4287261367,
-0.1191014647,
-0.2681031525,
0.0243273936,
-0.4682480693,
-0.1296651661,
0.2163130194,
0.3303776383,
0.4147615135,
-0.1004250199,
0.2933027744,
-0.3792912066,
-0.4569358826,
-0.1829231679,
-0.1471693963,
0.1107231975,
0.5425563455,
0.0442091897,
0.2326033711,
-0.1123694852,
-0.119501099,
0.0481866263,
0.2808309197,
0.0800945759,
-0.0887426212,
-0.0581212342,
-0.2451634258,
-0.1497918218,
0.4851495624,
0.3575551808,
0.3432016373,
-0.5243743658,
-0.2735808194,
0.1761346757,
0.2826772928,
-0.0850719661,
-0.3356334865,
0.147204712,
-0.6066704392,
-0.1070988104,
0.2576445937,
-0.055998113,
0.2430213839,
0.1222140789,
-0.0310083032,
0.1505090445,
0.5593097806,
0.052469328,
0.0837614089,
-0.1632106304,
0.4474863708,
-0.104082346,
0.1998445988,
0.0331471525,
0.8620263934,
0.0962164029,
-0.1062675342,
0.5184586048,
-0.0881284699,
0.1878961921,
-0.0081637325,
0.1899984777,
-0.3045164347,
-0.0799034834,
-0.0812916011,
-0.2375044972,
0.3007558286,
-0.3801080287,
-0.1855721474,
0.0321744382,
-0.1073663905,
0.0412659161,
0.2691587806,
-0.3244304359,
0.1020286232,
-0.0270946976,
-0.1815609038,
0.1279206276,
-0.3390736878,
0.3881623745,
-0.2331752032,
0.0897138268,
-0.2383811474,
-0.0345179699,
-0.3565085828,
0.1594756246,
-0.4747301638,
0.0953371748,
0.4025705159,
-0.2607307136,
0.2180152982,
0.2544822395,
-0.088171728,
-0.2051601261,
-0.1190968454,
0.1531813294,
0.2104897052,
-0.2932993472,
-0.1400911957,
-0.0148194842,
0.3789055347,
-0.2663353682,
-0.2053687274,
0.3243811429,
-0.1200551987,
0.0190125182,
0.2079233229,
0.2172120214,
0.2174225748,
-0.139769122,
-0.1159705967,
-0.1548204869,
0.4396516085,
-0.1793827862,
0.0974546298,
0.102286391,
-0.1480681151,
0.2389146984,
0.0597931668,
-0.1215437427,
-0.0676656738,
0.0342870429,
0.0530835874,
0.1256927401,
0.4378906488,
0.0360094458,
-0.1338088363,
-0.0892589465,
0.0835769698,
-0.2452509999,
-0.392393589,
0.1614234149,
0.0413193144,
0.0945869014,
0.1541695446,
0.6016369462,
0.2200905681,
0.1959429681,
-0.0029779358,
-0.393583715,
0.0153972022,
0.1952130049,
0.2234053761,
-0.1829373986,
0.1482764035,
0.4871101677,
0.2310220003,
-0.2154342681,
-0.2355453223,
0.1699390262,
-0.0202159416,
0.1654954851,
-0.2081312835,
-0.0237616319,
0.1376885474,
-0.0255883411,
0.1706533879,
0.1360502243,
0.0790042952,
-0.2413070649,
-0.2038367838,
0.1567435265,
0.0473499,
0.1087637991,
0.1444315612,
0.0323913842,
0.1363896132,
0.107562542,
-0.0144930454,
-0.0115747517,
-0.2664196491,
0.020627901,
0.5048086643,
0.0116714463,
-0.1032409593,
0.1398864985,
-0.1736043394,
0.4591965973,
0.1729912609,
0.0851140097,
0.0556666702,
0.1222587749,
0.0067548277,
-0.1525086612,
-0.3688287735,
-0.0822527409,
0.2527534068,
-0.5157040358,
-0.0102976775,
-0.3664904237,
-0.080444172,
0.3681672812,
-0.2823775113,
0.1550215632,
0.3580296934,
0.1487147212,
-0.2343889177,
0.0802347213,
0.1561590433,
0.0121040102,
-0.0657281503,
0.2085698247,
0.0962713063,
0.1325170845,
0.0135205491,
0.1941374391,
0.1125746742,
0.3337905407,
0.0733125657,
0.1991669387,
-0.1907486022,
0.3111234605,
0.3012806177,
-0.0447266176,
0.0997252986,
0.107146129,
-0.284871161,
0.1915014237,
-0.1223456562,
-0.0366435647,
0.3447071016,
-0.2727974355,
0.0545441546,
-0.0499814637,
0.2050121725,
-0.1866606921,
0.222948432,
0.4996076822,
-0.0381263793,
-0.0852460116,
0.045039691,
0.4715332091,
-0.0909213573,
0.2189591676,
0.2121889889,
0.0400193185,
-0.110288851,
0.0615602173,
0.0899293274,
-0.1647672802,
0.1405578256,
0.3287214041,
-0.2781494856,
-0.1683351547,
0.1341963857,
0.1551509947,
0.2446394712,
-0.151016891,
-0.0291922726,
-0.0126027204,
-0.2535862923,
-0.3425182104,
0.3309093118,
0.5272142291,
0.3617965281,
-0.2228710651,
-0.3505693674,
-0.2627762258,
-0.086315304,
0.1195724085,
-0.1643645912,
0.1971999407,
0.5600972772,
0.0767564774,
0.1942418665,
-0.1704494208,
0.1397041827,
-0.0916650072,
-0.0431892611,
-0.0491227731,
0.1625779569,
-0.0082927402,
-0.2567866743,
-0.5138966441,
0.0966706797,
-0.0504026935,
0.3500348628,
0.112572968,
0.114815332,
-0.1855022311,
0.044288151,
0.0609000586,
0.1665428877,
0.3051975965,
0.3875773847,
0.4755405486,
-0.2138944566,
-0.1814344227,
-0.2916365266,
0.3696192503,
-0.2389660627,
0.0414592624,
0.1105274409,
-0.0062889527,
-0.1999729723,
0.3702286482,
-0.0114936288,
0.176571101,
0.0734888166,
0.029802816,
-0.3209838569,
-0.2221900821,
0.1444747448,
-0.3279423416,
0.071449317,
-0.1231063306,
0.2319751084,
-0.6399852037,
0.1101720855,
-0.3500310481,
-0.2746464908,
0.0027535162,
-0.0029039532,
0.6594691873,
-0.0845692828,
0.4161300659,
0.1328029186,
0.0950929299,
0.0378227457,
-0.3472765386,
-0.0520948432,
0.2472888231,
-0.0002781875,
0.2236514688,
0.1149881557,
0.0075578997,
-0.363307029,
0.3691528738,
0.0104589416,
-0.1032638997,
-0.1003399938,
0.0807715952,
0.0182327684,
0.1612392664,
-0.1669696867,
0.017748557,
-0.1094031632,
0.0470386408,
-0.3611801267,
-0.5371570587,
0.4243586063,
-0.3146581352,
-0.3414468169,
0.0673391595,
0.2100277096,
-0.1327817142,
-0.1468292922,
-0.4087653458,
0.0332325213,
0.2969632745,
0.1331402957,
-0.2754376233,
0.2085575908,
0.0338272303,
0.0557056554,
-0.0335557126,
0.3838146627,
-0.0997878462,
0.1347155124,
-0.2518531084,
-0.0629427508
] |
https://github.com/huggingface/datasets/issues/1781 | AttributeError: module 'pyarrow' has no attribute 'PyExtensionType' during import | Yes indeed.
Also it looks like Pyarrow 3.0.0 got released on pypi 10 hours ago. This might be related to the bug, I'll investigate
EDIT: looks like the 3.0.0 release doesn't have unexpected breaking changes for us, so I don't think the issue comes from that | I'm using Colab. And suddenly this morning, there is this error. Have a look below!
![screenshot-colab research google com-2021 01 26-08-15-36](https://user-images.githubusercontent.com/45964869/105799890-fdaf3b80-5fae-11eb-8f06-11b65cdccc30.png)
| 46 | AttributeError: module 'pyarrow' has no attribute 'PyExtensionType' during import
I'm using Colab. And suddenly this morning, there is this error. Have a look below!
![screenshot-colab research google com-2021 01 26-08-15-36](https://user-images.githubusercontent.com/45964869/105799890-fdaf3b80-5fae-11eb-8f06-11b65cdccc30.png)
Yes indeed.
Also it looks like Pyarrow 3.0.0 got released on pypi 10 hours ago. This might be related to the bug, I'll investigate
EDIT: looks like the 3.0.0 release doesn't have unexpected breaking changes for us, so I don't think the issue comes from that | [
-0.0131393643,
-0.0668325648,
-0.0331191905,
0.1483882517,
0.1552636027,
-0.1366583854,
0.2972117066,
0.3255245686,
-0.3937352002,
0.1865731776,
-0.0172688719,
0.3017126918,
-0.0978722274,
-0.1359523833,
0.1570974439,
-0.0766469836,
0.36922279,
0.3322660625,
0.2101119757,
0.0341323279,
-0.2047905624,
0.2435747832,
-0.3605642319,
0.281629771,
-0.3349714577,
0.2964655757,
-0.0501945317,
-0.2114923596,
-0.1720487475,
-0.5515250564,
0.4652977884,
-0.3716568947,
0.1718028188,
0.0862079039,
-0.0001152871,
0.0478763729,
0.3382734358,
0.0108993975,
-0.0602637269,
-0.0971447825,
0.0056824549,
-0.049479235,
0.2477091253,
-0.0170458108,
0.1799537987,
-0.0465858839,
-0.1243835315,
0.3421862423,
-0.0906015709,
0.3016497791,
0.2360052615,
0.0828579441,
0.4873181581,
0.0309320074,
0.6077609062,
-0.0773167461,
-0.2693597376,
0.5535905361,
0.3471967578,
-0.3623815179,
0.3086411655,
-0.0397060774,
-0.2690622807,
0.1196530536,
0.2864125073,
0.0299369693,
0.4240364134,
-0.2688586414,
-0.0992744043,
0.1516017467,
0.1677064747,
-0.1728441715,
-0.1481739879,
0.057955008,
0.2575570047,
-0.4599100351,
0.231768176,
0.3112021089,
-0.1151483357,
0.1562723219,
0.3843084872,
0.0039484389,
-0.2121082395,
0.056687925,
-0.3574640751,
0.4364008307,
0.0000956801,
-0.0321238488,
0.1804157346,
-0.0024625338,
0.4826470017,
0.2176444083,
-0.225059852,
0.187458396,
-0.1264520884,
0.1205261201,
0.0969839022,
0.2131739259,
0.0326535814,
-0.2434334606,
-0.1718936712,
-0.2731764913,
0.2743751407,
0.3453643024,
-0.1747222245,
0.2405587584,
0.0511561409,
-0.0985385105,
0.2141360193,
-0.0170268137,
0.0022325241,
0.1582268178,
-0.1324885786,
-0.3309863806,
0.1595117301,
-0.1174668446,
0.3887006938,
-0.1071970016,
-0.4032923281,
-0.3672436178,
-0.4772162735,
0.0425831266,
-0.2066434771,
0.1653785855,
-0.0999652147,
0.1763215661,
-0.0519441441,
0.2494451702,
-0.2004778981,
-0.1350600421,
-0.0154273286,
0.3069821596,
-0.138140142,
-0.1166272536,
-0.1501953751,
-0.1173734665,
-0.1203548834,
-0.0288929213,
0.0037054804,
-0.0938862041,
-0.3903514743,
-0.2269087583,
-0.1927278489,
0.4000966847,
-0.2094474435,
0.0106312828,
0.0361661799,
-0.4328805506,
-0.1751115322,
0.3084086776,
-0.510522604,
-0.418953985,
-0.3386983573,
0.1622044891,
-0.2392555028,
-0.1590327621,
-0.2101454288,
-0.153917253,
-0.0257822834,
-0.2977169454,
-0.0679368973,
-0.4593392313,
0.0661232844,
-0.3761539459,
-0.0889947042,
0.117200233,
-0.4600571096,
-0.2082940936,
-0.0396744162,
-0.100249514,
0.2123403698,
0.0334529541,
-0.1382897198,
0.0476341955,
-0.1362772137,
0.230742991,
-0.024285702,
-0.05946251,
-0.2722763419,
-0.2320827246,
-0.0442515425,
-0.0388595797,
0.0928499922,
-0.3169509172,
0.034344241,
-0.0749514103,
0.4046435654,
0.2313241363,
-0.1184697002,
0.2528600395,
-0.2151907384,
-0.2250580043,
0.4088804126,
0.0668418407,
0.0973034352,
-0.2397804856,
0.069202058,
-0.219310239,
0.144956246,
-0.1628498435,
-0.0161280483,
-0.0041737072,
0.5557934642,
0.011431505,
-0.0856290236,
-0.050572183,
0.0189573895,
0.2229178548,
-0.1853206903,
0.1959264427,
-0.3770171702,
0.0508204214,
-0.2732281089,
0.4390933812,
-0.2399700582,
-0.2291372269,
0.0691436529,
-0.0709552839,
-0.1686137021,
0.4575909674,
-0.1253299564,
0.084566474,
0.2847536504,
0.1448571235,
0.1470869929,
0.4999444485,
-0.2506093085,
-0.453047663,
-0.1584195495,
0.0097185792,
0.1861777008,
-0.0356310941,
-0.0880457088,
-0.0568739995,
0.0108953267,
0.2653045952,
-0.2652030885,
0.1235498041,
0.1738429219,
-0.3929582536,
-0.0181138963,
-0.1742797792,
0.0877439231,
-0.0335607119,
0.8921660185,
0.1687955409,
0.4038020968,
0.160256803,
-0.1517966837,
0.1315706074,
-0.0135128079,
0.1269462258,
0.171995759,
0.1579271108,
0.0358104408,
0.3080631495,
-0.1634720117,
-0.0871259645,
0.0040983944,
0.0815085098,
0.3480776846,
0.0909013152,
0.1321676075,
0.0951321051,
-0.4533492327,
0.108583875,
0.2875910401,
-0.2044251114,
0.3006253242,
-0.0027226075,
-0.3478749096,
0.0968063399,
0.0687795952,
-0.1036332846,
0.2312452048,
0.1464687884,
0.6274520159,
-0.0539621152,
0.2600462437,
0.1208147705,
-0.1754732281,
-0.1735770255,
-0.0345084518,
0.1754892766,
-0.3216810822,
0.2472688556,
-0.286573559,
-0.0330846049,
-0.1837985367,
-0.6172887087,
-0.2467287481,
-0.0972246453,
-0.0863638669,
0.2397947609,
0.1439485997,
0.0494822972,
0.1944265664,
-0.1363158673,
0.1318313777,
-0.3939234614,
-0.0659634024,
-0.1660009623,
-0.4110147953,
0.0342336558,
0.0789110959,
-0.1280232817,
-0.0826191977,
-0.3824841678,
0.0980388671,
0.0232924949,
-0.4178723097,
0.1835726202,
-0.236706093,
0.2517474294,
0.1566992551,
0.046433799,
-0.1301651299,
-0.1829271913,
0.282011956,
-0.2733283043,
-0.3171105683,
0.2481305748,
-0.1968503594,
-0.0255362634,
-0.0423545726,
0.001637442,
-0.4315142334,
-0.1270965636,
0.0063966028,
0.0411538966,
0.0813725367,
0.4008954465,
0.3015106618,
0.2564192116,
-0.0694127902,
-0.0516871512,
0.2051508725,
0.1729594618,
0.4019711614,
-0.045333989,
-0.2462500483,
0.1988833845,
-0.211072728,
-0.1946012527,
-0.0431775413,
-0.2507730424,
-0.4114255607,
0.0060348772,
0.5550532937,
-0.0497530177,
-0.0697415769,
0.3415046334,
0.0640970543,
0.0203940459,
0.1028010175,
-0.057550732,
-0.42462942,
0.3636844158,
0.195073843,
0.0209974814,
-0.0470947064,
-0.0910299271,
0.534406662,
-0.3050166965,
0.0196945872,
0.3806326389,
-0.3165950775,
0.0085187573,
-0.0075046755,
-0.3508320749,
0.0020643587,
-0.2164060771,
-0.2069074363,
0.1151531935,
-0.202102229,
-0.1999471039,
-0.232425496,
-0.0081791673,
-0.1488266736,
-0.2450309396,
0.1605930775,
0.1723380834,
0.2058913112,
-0.1472098231,
-0.0359696485,
-0.080349192,
-0.1351228654,
0.1414112896,
0.0991825238,
-0.2391813397,
0.0221704934,
0.373747766,
-0.4715349674,
-0.1865344495,
0.209076941,
0.3911676705,
-0.0005619336,
0.215510726,
-0.1019378975,
0.0302232206,
-0.0597646907,
0.4634602368,
0.3329996467,
-0.0764132887,
0.2497053593,
0.1063944772,
-0.1925333142,
-0.4660720229,
-0.1530638188,
-0.3820134401,
0.0467142873,
-0.3956743777,
-0.0991572738,
0.1917423755,
0.3078096211,
0.3542788029,
-0.0524162985,
0.2326926142,
-0.3907873929,
-0.5037893057,
-0.1083226278,
-0.1856617779,
0.073541902,
0.406732738,
-0.0511608683,
0.202198565,
-0.0522496812,
-0.1719231457,
-0.0551184043,
0.2742958963,
-0.026355667,
-0.1114035621,
-0.0432216749,
-0.2032577395,
-0.120107159,
0.4974155426,
0.3016121686,
0.4307506382,
-0.5198168755,
-0.2346643507,
0.1539541036,
0.2733050585,
0.028220335,
-0.263287127,
0.1659515798,
-0.5596696734,
-0.1724909097,
0.2411609888,
-0.1367809325,
0.3588764369,
0.0973064229,
-0.0596347265,
0.2025462985,
0.5289086103,
0.0248948354,
0.074985981,
-0.2459072173,
0.4537629187,
-0.0983143598,
0.0699341223,
0.0436742157,
0.8350270987,
0.1248506233,
0.0305075608,
0.6416876316,
-0.2158604562,
0.2537656426,
0.094504118,
0.1731381416,
-0.2961374819,
-0.1071066409,
-0.1075479686,
-0.2412971407,
0.3092471361,
-0.5395001769,
-0.1265195906,
-0.0160750747,
-0.062882252,
0.1311436743,
0.3468616009,
-0.4278762043,
0.0938200653,
-0.0330337584,
-0.2038726807,
0.1121440753,
-0.213820681,
0.396659404,
-0.2033083588,
0.0648428798,
-0.2075215727,
-0.0953239501,
-0.3254086971,
0.2572104633,
-0.3843846023,
0.0723650306,
0.4309490025,
-0.3136196136,
0.08976008,
0.1476747543,
-0.1038964093,
-0.3308497071,
-0.1381651014,
0.1379953623,
0.2811754346,
-0.1602492183,
-0.0330577902,
-0.075894393,
0.4511497915,
-0.2567558885,
-0.240704149,
0.3248723745,
-0.172444284,
-0.0252042208,
0.1689877063,
0.2126979828,
0.3129538894,
-0.0634054542,
0.0474485643,
-0.1949807703,
0.4568566978,
-0.1830205321,
0.0838969797,
0.0512904711,
-0.1537175626,
0.1318117231,
-0.0672406033,
-0.0820611119,
-0.0933935866,
0.1422646493,
0.1050035879,
0.1677749455,
0.4702967703,
0.091643706,
-0.0756587386,
-0.0608486123,
0.1444072276,
-0.1836298853,
-0.4542885125,
0.0926686823,
-0.0591412522,
0.0339045003,
0.0791586041,
0.5761158466,
0.2180943191,
0.0987736434,
-0.0183405112,
-0.3346140087,
-0.0040288037,
0.1269533783,
0.1444272399,
-0.2800021172,
0.158999458,
0.4735194743,
0.308825165,
-0.2921721041,
-0.2072615623,
0.1344073862,
0.0139313489,
0.1114376709,
-0.1984352171,
-0.0344795473,
0.1641915739,
-0.0530163459,
0.1802766472,
0.1762221903,
0.0299034733,
-0.1960486621,
-0.2763874829,
0.164642483,
0.0262454785,
0.0828448609,
0.2277652323,
-0.0142273605,
0.1288473457,
0.1400889456,
-0.0335572921,
-0.0232175793,
-0.3132750988,
0.0749500766,
0.468621254,
-0.0035446621,
-0.0383275673,
0.1672219187,
-0.1821653396,
0.4613620341,
0.1279820949,
0.1962508559,
-0.0048737545,
0.1413670331,
-0.0738825202,
-0.0500205122,
-0.5202836394,
-0.0969449952,
0.3002703488,
-0.5328302383,
0.0007334152,
-0.4318063557,
-0.0064553544,
0.4072596729,
-0.3208839297,
0.0898789018,
0.4028597474,
0.1345387995,
-0.2542096376,
0.068183884,
0.0502431393,
-0.0042673475,
-0.1172658578,
0.2047823071,
0.1054390222,
0.0983835161,
0.1125994399,
0.2177937031,
0.095118247,
0.4087660909,
0.0784461051,
0.3108328283,
-0.2199383974,
0.3216122687,
0.3078152537,
-0.0826825351,
0.0700755566,
0.0491851568,
-0.2488766164,
0.1971557736,
-0.1439424008,
-0.0132069103,
0.3123978376,
-0.2327860147,
0.0940201655,
-0.0964868739,
0.1734163463,
-0.2089206576,
0.3062179983,
0.4925248623,
-0.0597421527,
-0.0954319313,
-0.0726948828,
0.4616529047,
-0.0985453129,
0.2110272646,
0.2701739371,
-0.0040656393,
-0.0381482951,
0.0233465191,
0.036444962,
-0.1881675869,
0.2913280427,
0.2702756822,
-0.256688416,
-0.2534963489,
0.1303732097,
0.0896568,
0.2583932579,
-0.1812178642,
0.0337639339,
-0.0694994554,
-0.2266218364,
-0.3217247427,
0.3388971686,
0.5313587189,
0.3796489537,
-0.1952032745,
-0.321788609,
-0.1860151738,
-0.072991468,
0.1196315512,
-0.1308955997,
0.2220327705,
0.6603374481,
0.1193672195,
0.1698140949,
-0.1256333292,
0.1839617342,
-0.0307589248,
0.0563008413,
-0.1492143124,
0.2286603153,
-0.1467947066,
-0.2453062385,
-0.46568501,
0.123205848,
-0.0555098802,
0.3984953463,
0.0743232518,
0.0825466663,
-0.1017232016,
0.0300507415,
0.0563482381,
0.1842731833,
0.344596386,
0.4053153396,
0.3979041874,
-0.110890232,
-0.1044434384,
-0.2590640783,
0.4423455894,
-0.2495423555,
0.0895812735,
0.1316606402,
-0.0088869864,
-0.1571722925,
0.3125438094,
-0.0154561009,
0.2476419955,
-0.0797139853,
-0.085119538,
-0.3925020695,
-0.2460028082,
0.1071514934,
-0.205327794,
-0.0182972755,
-0.1419056207,
0.3042197526,
-0.651969254,
0.1224000305,
-0.2782096565,
-0.2564263344,
0.0777497217,
0.04539565,
0.6552140117,
-0.0219032802,
0.3961558044,
0.1705239266,
-0.0270977933,
-0.0799269751,
-0.3554827869,
-0.0862279385,
0.204666689,
-0.0640855953,
0.1238139868,
0.1020912006,
-0.0947148725,
-0.3230879009,
0.4325676262,
0.051791802,
-0.0371951573,
-0.1337213963,
0.1391984522,
0.0638656616,
0.0863114223,
-0.1177843586,
-0.046327021,
-0.1643604934,
-0.0378952995,
-0.327434063,
-0.5092478395,
0.3003085554,
-0.4232924879,
-0.3363006115,
0.0668108091,
0.1847187132,
-0.2212517262,
-0.1529460102,
-0.3810842335,
0.0995873585,
0.3112214208,
0.1313260049,
-0.3076266348,
0.2013766021,
-0.0241781753,
0.0009539943,
-0.0122423973,
0.4474129677,
-0.1461007148,
0.0542349331,
-0.1215178892,
-0.0445527844
] |
https://github.com/huggingface/datasets/issues/1781 | AttributeError: module 'pyarrow' has no attribute 'PyExtensionType' during import | Installing datasets installs pyarrow>=0.17.1 so in theory it doesn't matter which version of pyarrow colab has by default (which is currently pyarrow 0.14.1).
Also now the colab runtime refresh the pyarrow version automatically after the update from pip (previously you needed to restart your runtime).
I guess what happened is that Colab didn't refresh pyarrow for some reason, and the AttributeError was raised *before* the pyarrow version check from `datasets` at https://github.com/huggingface/datasets/blob/master/src/datasets/__init__.py#L60 | I'm using Colab. And suddenly this morning, there is this error. Have a look below!
![screenshot-colab research google com-2021 01 26-08-15-36](https://user-images.githubusercontent.com/45964869/105799890-fdaf3b80-5fae-11eb-8f06-11b65cdccc30.png)
| 72 | AttributeError: module 'pyarrow' has no attribute 'PyExtensionType' during import
I'm using Colab. And suddenly this morning, there is this error. Have a look below!
![screenshot-colab research google com-2021 01 26-08-15-36](https://user-images.githubusercontent.com/45964869/105799890-fdaf3b80-5fae-11eb-8f06-11b65cdccc30.png)
Installing datasets installs pyarrow>=0.17.1 so in theory it doesn't matter which version of pyarrow colab has by default (which is currently pyarrow 0.14.1).
Also now the colab runtime refresh the pyarrow version automatically after the update from pip (previously you needed to restart your runtime).
I guess what happened is that Colab didn't refresh pyarrow for some reason, and the AttributeError was raised *before* the pyarrow version check from `datasets` at https://github.com/huggingface/datasets/blob/master/src/datasets/__init__.py#L60 | [
-0.4181624651,
0.150439024,
-0.0190766156,
0.1533479691,
0.1342269182,
-0.023693433,
0.2542459369,
0.2454889417,
-0.3241710067,
0.1116404161,
0.0381209292,
0.3774306774,
-0.0813133642,
-0.0478630066,
-0.0118859382,
0.0418874472,
0.3027804196,
0.3409288228,
0.2071902454,
0.0259102769,
-0.2342768162,
0.0909717679,
-0.3210463822,
0.2035171688,
-0.4118346572,
0.2203691006,
-0.0174813196,
-0.1700018793,
-0.3172970414,
-0.6792120934,
0.5830788612,
-0.2323218584,
0.2768800557,
0.1425852925,
-0.0001209328,
-0.0209165141,
0.3580554128,
0.1024649069,
-0.2893365622,
-0.1401553601,
-0.1511048675,
-0.1866817474,
0.3294045329,
0.0138394916,
0.2098614424,
-0.2561298311,
-0.0134523865,
0.2181425691,
-0.080727376,
0.2746794522,
0.16976583,
0.0567856766,
0.497056514,
0.0424643941,
0.3831531405,
-0.0710193664,
-0.1261996329,
0.5384055972,
0.2573758662,
-0.3175977468,
0.3273624182,
0.095568873,
-0.3002936542,
0.2453085482,
0.3384177089,
0.0261109155,
0.3156371415,
-0.1950558722,
-0.0080027711,
0.232688114,
0.4724453688,
-0.2055785358,
-0.3742719591,
-0.1450867802,
0.2462431937,
-0.3504837751,
0.2955636978,
0.1823575646,
0.0134680383,
0.1489956528,
0.1497541368,
-0.0184531398,
-0.066981554,
0.0797984302,
-0.3698368967,
0.4304916263,
-0.1151572093,
0.0948724076,
0.1171312407,
-0.0667927191,
0.5531334877,
-0.035331782,
-0.2178257406,
0.2489418834,
-0.2337919772,
0.1079050377,
0.0849388838,
0.3836952746,
0.0191434454,
-0.163480714,
-0.2799124122,
-0.3150510788,
0.0434293896,
0.3021690547,
-0.0314211734,
0.2702072263,
0.0722961202,
-0.045567669,
0.2369810641,
0.0130284922,
-0.0343975686,
0.116237089,
-0.1001424044,
-0.360330075,
0.2520413101,
-0.0574507602,
0.6233627796,
-0.2348871231,
-0.4208146334,
-0.2791058719,
-0.495939225,
-0.1293875873,
-0.1401712745,
0.1667962074,
-0.2977567315,
0.2598458827,
-0.1432749182,
0.1083351225,
-0.2539902329,
-0.1861822605,
-0.0646512955,
0.1568894535,
-0.1410633028,
-0.1038212627,
-0.0783214271,
-0.1958211958,
-0.0038994041,
0.0601157285,
-0.1246232316,
-0.0684760809,
-0.2699032724,
-0.3182121217,
-0.1636870056,
0.4307078719,
-0.2343378365,
0.1612662822,
0.1176146343,
-0.5139943957,
-0.1687965244,
0.2821597457,
-0.5118227601,
-0.4434718192,
-0.2082924843,
0.0998680964,
-0.3005480468,
-0.1936513335,
-0.4257186353,
-0.0990354642,
0.0882478207,
-0.4811267257,
-0.0242850166,
-0.5677360892,
0.0094438102,
-0.3748413324,
-0.0311758984,
0.2954779863,
-0.6035423279,
-0.1913350821,
-0.1196311116,
-0.1438694745,
0.1422237307,
-0.0320601203,
-0.135550037,
0.0877709314,
-0.0691845715,
0.0052968096,
0.0978055671,
-0.2019424438,
-0.4289779067,
-0.1281324178,
0.0391551144,
0.0890588835,
0.06298998,
-0.1787742674,
0.0733828023,
-0.0738649219,
0.3456245065,
0.212033987,
-0.1600933224,
0.0766814873,
-0.0946314558,
-0.1960214227,
0.3323123753,
0.1353758872,
0.0791468546,
-0.0963714644,
0.105117932,
-0.1528166831,
0.1042481065,
-0.0824323073,
-0.0228677131,
0.015180341,
0.5127728581,
0.0129781989,
-0.116485633,
-0.1611536145,
-0.1859287918,
0.2242624909,
0.0850027204,
-0.0598824434,
-0.4205748439,
-0.1836569309,
-0.2416519374,
0.2941111922,
-0.1884557605,
-0.2594415247,
-0.0057252543,
0.1202162579,
-0.1577468365,
0.3912127912,
-0.1406077594,
0.3141978979,
0.069994323,
0.2449352741,
-0.0793027878,
0.3649936616,
-0.1673133075,
-0.3892544508,
-0.1534986943,
0.0461942814,
0.1388095617,
-0.0449938998,
-0.1133978665,
0.1098343432,
-0.0093774516,
0.2966071665,
-0.2214617729,
0.1578572541,
0.1264435947,
-0.1821916401,
0.0310817771,
-0.3086498082,
-0.0047080531,
0.0026353661,
0.693474412,
0.1561757028,
0.2425141186,
0.1873313636,
-0.1939786226,
0.0710171983,
0.0452383123,
0.1769445539,
0.0338250771,
0.0847997442,
-0.0266789813,
0.2097434103,
0.0241804738,
0.0152948415,
-0.1246280596,
0.1560422629,
0.3652108908,
0.1491885036,
0.1532501578,
-0.0186702088,
-0.4601619542,
0.0689492151,
0.3831283748,
0.1304518282,
0.429689765,
0.0333594531,
-0.3057473898,
0.042786289,
-0.0728984922,
0.0013498854,
0.0672051162,
0.1850845367,
0.5060129762,
-0.0201590471,
0.2183593512,
0.2089817226,
-0.158814922,
-0.3102000058,
0.0411303081,
0.3739794791,
-0.3386670351,
0.2943223417,
-0.3655649126,
-0.1117811874,
-0.1900115907,
-0.6143969297,
-0.2298163474,
-0.1397654563,
-0.1837112457,
0.3203371167,
0.2036807239,
0.1484707147,
0.0623818748,
-0.13522017,
0.0419021137,
-0.4303118885,
0.0690356568,
-0.1785091907,
-0.2635132372,
-0.0004695468,
0.0800383836,
-0.14336887,
0.0108111734,
-0.4225105047,
0.0828152075,
-0.0152943172,
-0.3495782018,
0.0856366158,
-0.327542901,
0.4431427419,
0.2561699152,
0.1518145949,
-0.2441194504,
-0.1336630136,
0.3365135789,
-0.2175850421,
-0.2805584073,
-0.0804268494,
-0.1813363582,
-0.0858775526,
0.0960070044,
-0.0889931619,
-0.4324344993,
-0.1147842184,
0.0239350237,
0.1166308001,
0.0384810492,
0.3249642551,
0.2670055926,
0.1228090301,
-0.0381517112,
0.0272235572,
0.0604037307,
0.0145734325,
0.343232125,
-0.0439677052,
-0.0917211026,
0.2418821007,
-0.1861957461,
-0.1578912288,
0.0988414809,
-0.3921026289,
-0.6064205766,
-0.1058823541,
0.4493831098,
-0.0804871991,
0.0285758283,
0.3183552921,
0.2103991956,
0.0588822514,
-0.0014331602,
-0.1303639114,
-0.5016964674,
0.2687036097,
0.1951234043,
0.0392834619,
0.159284994,
-0.1193321422,
0.5885621309,
-0.1180832312,
-0.1307071298,
0.1967376918,
-0.2780765891,
0.2577853799,
0.0037795128,
-0.399959743,
0.0001087509,
-0.1838211417,
-0.1722365171,
0.0561546013,
-0.0889740661,
0.0206055865,
-0.1776573509,
-0.1040868983,
-0.2045786381,
-0.1649921536,
0.0485992171,
0.1484631896,
0.2544666231,
0.0124212597,
0.0146215754,
-0.1989306957,
-0.1270340085,
-0.0133115798,
0.3179433942,
-0.1033571064,
0.0975216031,
0.2111829817,
-0.3801300228,
-0.1920147687,
0.3192767203,
0.3189557195,
0.0780693814,
0.2148052156,
0.0115072951,
0.011719387,
-0.0136030065,
0.3772996962,
0.1215168387,
-0.0888894573,
0.1494612396,
0.0307088755,
-0.2940442562,
-0.3276793957,
-0.07797084,
-0.1999315023,
-0.0321914181,
-0.291595906,
-0.1149147749,
0.0800373852,
0.4781747162,
0.4865285158,
0.0007785589,
0.272939384,
-0.2663763463,
-0.4203900993,
-0.1045849472,
-0.1371219009,
-0.0841330439,
0.2471646667,
-0.0090550035,
0.3496673405,
-0.2689822316,
-0.1279773563,
0.0009084608,
0.2837117612,
0.1002658606,
-0.0145209879,
0.0328848809,
-0.0677737743,
-0.0991421193,
0.6560024619,
0.5683663487,
0.2228671461,
-0.5871344805,
-0.3114330471,
0.2615461648,
0.3081309199,
0.0385415964,
-0.3654318452,
0.1598128974,
-0.4349409044,
-0.2039361447,
0.1181140542,
-0.0032238101,
0.3611795008,
0.2568579018,
-0.2989949286,
-0.1709062308,
0.6227722168,
0.187038362,
-0.0497831181,
-0.0120428149,
0.4989393055,
-0.1086797044,
0.0867683142,
-0.0708631799,
0.7722876668,
0.2161622643,
-0.0164658353,
0.5215465426,
-0.0375140086,
0.3984512389,
0.0963152722,
0.2034587115,
-0.308424443,
-0.2251470387,
-0.1771803051,
-0.2383138984,
0.4370366335,
-0.3925250471,
-0.1204816774,
0.1257025898,
0.109955363,
0.1674300581,
0.2934601307,
-0.23572357,
-0.0970845446,
0.0407845266,
-0.2799019516,
0.0703096166,
-0.2062651813,
0.4521022737,
-0.2394187748,
0.1916546822,
-0.1744402796,
-0.1181282476,
-0.3269028962,
0.0272019543,
-0.4223392904,
0.0469850041,
0.3487402499,
-0.3465303779,
0.1412333548,
0.3082629442,
0.1490027755,
-0.1105609983,
-0.1429967284,
0.1925392151,
0.1203574911,
-0.0830730572,
-0.0876868442,
-0.14316006,
0.4585086405,
-0.0869705305,
-0.2914060056,
0.1181494445,
-0.1757515222,
-0.1169968247,
0.1927833855,
0.1780388802,
0.1803470403,
-0.1606607884,
-0.0084345471,
-0.2092550397,
0.4160996974,
-0.2062874138,
0.0337353311,
0.0291546099,
-0.0308182202,
0.2589294314,
-0.041564595,
-0.2023431212,
-0.2383622229,
0.2251692861,
0.0538902618,
0.2207307816,
0.5160394907,
0.0045138742,
-0.1424064338,
-0.0259940028,
0.0368428864,
-0.204050988,
-0.4193035364,
0.0943089873,
-0.04726284,
0.1737487912,
0.1484477371,
0.55794698,
0.1887618005,
0.0739828572,
-0.0120352861,
-0.4998328388,
-0.017501127,
0.2965073586,
0.1705466658,
-0.1402316242,
0.2619217336,
0.3161822855,
0.146299243,
-0.2080896795,
-0.1621001959,
0.1114125326,
0.0875496045,
0.2187371105,
-0.1014425233,
0.1857638061,
0.2712576687,
-0.1186802164,
0.0882632285,
0.1107570231,
0.0232379474,
-0.1679697186,
-0.1551798731,
0.1952310055,
0.0790808499,
-0.0309847891,
0.144366473,
-0.0506841391,
0.0514108986,
-0.0166521966,
0.1229136437,
0.143535167,
-0.2517280579,
0.0204633716,
0.3447138369,
0.1018142402,
-0.1064433753,
0.2578164041,
-0.1646612734,
0.3178769946,
0.1187175438,
0.2142815292,
0.0441240743,
0.1659110487,
-0.0493742786,
-0.0369117633,
-0.3980922997,
-0.0909592956,
0.2025741339,
-0.5558547974,
0.0694071651,
-0.2835443318,
0.2389630824,
0.4619527161,
-0.2067473829,
0.0361853987,
0.4877444804,
0.0747225881,
-0.2718814015,
0.1139422879,
0.2718527615,
0.1040507033,
0.0084565561,
0.3226698339,
0.1910164952,
0.2318345308,
0.0050498266,
0.2871258557,
0.2534641325,
0.3062471449,
0.2237190306,
0.3408564031,
-0.118385978,
0.3203248382,
0.4664039016,
0.1085290015,
-0.0223921519,
0.2567120194,
-0.2122320384,
0.2128287405,
0.0245731398,
-0.0816998407,
0.1981664896,
-0.4361230731,
0.3141305447,
-0.0638899431,
0.1463705748,
-0.2770727277,
0.3593447804,
0.4206174314,
-0.1748633385,
-0.097249873,
-0.1061299816,
0.428022176,
-0.1015810594,
0.0380417705,
0.2254813462,
-0.0710924268,
0.0765769854,
0.0310194418,
-0.009999698,
-0.2566746175,
0.315335542,
0.1951399297,
-0.3157758713,
-0.4515141249,
0.1660027802,
0.1537612975,
0.2545728981,
-0.0800386146,
0.0687818527,
-0.0559655167,
-0.1540689021,
-0.1322261244,
0.5119329691,
0.6078239083,
0.332393676,
-0.0730934739,
-0.2313453704,
-0.3119515479,
-0.0285722725,
0.0980185345,
-0.0754058436,
-0.0635235757,
0.363493979,
0.1849326491,
0.1777667701,
-0.105739966,
0.2683843672,
-0.1154607087,
-0.0876859948,
-0.3277675807,
0.3378292024,
-0.0771919042,
-0.1504779905,
-0.2973748744,
0.266649127,
0.0063826563,
0.2759138048,
0.2482227087,
0.0690192133,
-0.1253394485,
-0.0256369822,
0.0088807801,
0.113421768,
0.3014831841,
0.5731634498,
0.3423218131,
-0.0488621779,
-0.0322650149,
-0.5246587396,
0.2737062871,
-0.3799617589,
-0.0126914391,
0.1221082658,
-0.1102098003,
-0.1972217113,
0.4066539407,
0.1094075143,
0.1486454457,
0.0448761731,
-0.0550348386,
-0.3251520395,
-0.3328723013,
-0.0518052727,
-0.2736153007,
-0.0470763519,
-0.2848774791,
0.2699871361,
-0.6724923849,
-0.0098380651,
-0.1648216993,
-0.1948523521,
0.1339521706,
-0.2329447865,
0.6932852268,
-0.0060903877,
0.5324743986,
0.153900072,
0.0189523511,
-0.2397971749,
-0.3865701556,
-0.2289654613,
0.3694832623,
-0.1253315359,
0.3657644987,
-0.1208418757,
-0.009806999,
-0.2979020476,
0.4230302274,
0.0462110825,
0.0518478379,
-0.1854895502,
0.1832354069,
-0.0671852753,
0.0773552507,
-0.1123984829,
0.0336336866,
-0.0960213989,
0.2061692774,
-0.3234833181,
-0.5417069197,
0.4071373045,
-0.4471999407,
-0.2611280382,
-0.1382686943,
0.1575763673,
-0.0201769024,
-0.2910699248,
-0.5523155332,
0.1713496596,
0.3971261084,
0.0870345682,
-0.3133406937,
0.1738692075,
-0.0106522357,
0.0655375794,
-0.0747492388,
0.5040861368,
-0.3182083964,
-0.0150992619,
-0.0719005242,
-0.0107887294
] |
https://github.com/huggingface/datasets/issues/1781 | AttributeError: module 'pyarrow' has no attribute 'PyExtensionType' during import | Yes colab doesnβt reload preloaded library unless you restart the instance. Maybe we should move the check on top of the init | I'm using Colab. And suddenly this morning, there is this error. Have a look below!
![screenshot-colab research google com-2021 01 26-08-15-36](https://user-images.githubusercontent.com/45964869/105799890-fdaf3b80-5fae-11eb-8f06-11b65cdccc30.png)
| 22 | AttributeError: module 'pyarrow' has no attribute 'PyExtensionType' during import
I'm using Colab. And suddenly this morning, there is this error. Have a look below!
![screenshot-colab research google com-2021 01 26-08-15-36](https://user-images.githubusercontent.com/45964869/105799890-fdaf3b80-5fae-11eb-8f06-11b65cdccc30.png)
Yes colab doesnβt reload preloaded library unless you restart the instance. Maybe we should move the check on top of the init | [
-0.1401676834,
-0.1440017968,
-0.0386942588,
0.2877447307,
0.2086880356,
-0.157532692,
0.1334632784,
0.1926027089,
-0.2747632265,
0.1211348623,
-0.061840076,
0.417986542,
-0.1491586268,
0.037328884,
0.1723477691,
0.2285046726,
0.2047671527,
0.4507704377,
0.1933161914,
-0.0358725525,
-0.0563337281,
0.0911346301,
-0.4517783225,
-0.0227690786,
-0.3740769625,
0.1728886664,
0.0168108921,
-0.0385992005,
-0.1438814849,
-0.5761189461,
0.510991931,
-0.2018952668,
0.1176529378,
0.0456298664,
-0.0001169598,
-0.0215619765,
0.2957280874,
-0.0815276653,
-0.1828681082,
-0.0304472074,
0.103999272,
0.0859089866,
0.4524636269,
-0.0387611575,
0.1377262771,
0.0620984584,
-0.1428722143,
0.226814881,
0.0426717475,
0.2654356956,
0.2162775397,
-0.0245506335,
0.2785425782,
0.2467481941,
0.3330409527,
-0.0338502824,
-0.109925501,
0.5772960186,
0.3482243419,
-0.3117034435,
0.2219972014,
0.0770806298,
-0.3472618163,
0.1298995614,
0.5009502172,
-0.1533365697,
0.2511973381,
-0.1369097531,
-0.0713900104,
0.0851652846,
0.1308466345,
-0.180709973,
-0.038549073,
-0.0226830523,
0.3367500603,
-0.4357970357,
0.2943397462,
0.1536548138,
0.0482852682,
0.1406813413,
0.4038323462,
-0.1159278303,
-0.0492079295,
0.0561700575,
-0.297742337,
0.5725082755,
-0.0990442187,
0.0298045762,
0.2147826403,
0.0776146576,
0.5299271941,
0.1352573335,
-0.3125368655,
0.2130873799,
-0.1809973568,
0.0572745763,
0.1509381831,
0.3558631837,
-0.2009799629,
-0.060528174,
0.0495063066,
-0.1632778049,
0.1300141662,
0.36768502,
-0.14249596,
0.3776364326,
0.1548834741,
-0.0959656984,
0.359474957,
0.1658727676,
-0.2740060985,
0.1589540541,
-0.2349024117,
-0.3367798328,
0.45076105,
-0.0824935809,
0.3774911761,
-0.2482680976,
-0.3130384386,
-0.2947346866,
-0.5301501155,
-0.1343026757,
0.1129384041,
0.2356719971,
-0.2533465624,
0.2633480728,
0.0208702311,
0.062007539,
-0.3324306309,
0.0141466754,
-0.0426387601,
0.3480691612,
-0.2938278019,
-0.0135672614,
0.0325775556,
-0.2584101856,
0.1664141268,
-0.1595479548,
0.2574121952,
-0.3906570077,
-0.2437107265,
-0.2300012112,
-0.1325034499,
0.4801092148,
-0.2656364739,
-0.117490828,
0.2300432175,
-0.5545185208,
-0.206215471,
0.3420902193,
-0.4835703075,
-0.4480426908,
-0.0692130849,
0.1318642348,
-0.2776031196,
-0.143528074,
-0.1711689681,
-0.3030305803,
0.0746001378,
-0.4376576841,
-0.0581507683,
-0.4439563155,
0.0284818485,
-0.3985580802,
0.0237917807,
0.1919602305,
-0.4507102072,
-0.1807585955,
-0.0612378605,
0.0278930031,
0.1731996834,
-0.0307790153,
-0.2933190763,
0.0139536001,
-0.2074745297,
-0.0857501552,
0.0822564065,
-0.1066972613,
-0.2593955994,
-0.2776184082,
-0.0503496528,
-0.0017585901,
0.0750195459,
-0.2023131102,
-0.0372993723,
-0.1282963455,
0.3937429786,
0.2658711374,
-0.0960767418,
0.167116493,
-0.3055384755,
-0.1047832593,
0.2357507199,
-0.0243390352,
0.171882242,
-0.0098853614,
0.2645917833,
-0.0580475703,
0.0703270435,
-0.0737958252,
-0.2017795444,
-0.0384662077,
0.5287056565,
-0.0025241051,
-0.0461850241,
0.0231028534,
0.0909544602,
0.1952459514,
-0.09398707,
0.0149223721,
-0.3915699124,
-0.012315277,
-0.3587922156,
0.3929844499,
-0.2013743371,
-0.2269887328,
0.0655968189,
0.0814307332,
-0.1832759827,
0.4519273043,
-0.133431077,
0.1085772514,
-0.0099229142,
0.055428002,
0.0271671712,
0.4176918864,
-0.155555144,
-0.4423775971,
-0.2066217363,
0.0164658036,
0.0704900548,
-0.0276795346,
-0.2374278754,
0.0117332349,
0.0611471385,
0.3287151456,
-0.2297955304,
0.113417238,
0.2255120426,
-0.3239574134,
-0.0130356308,
-0.3053935766,
0.2059910148,
-0.0975385383,
0.854945004,
0.2274993509,
0.1324661523,
0.1277950108,
-0.167280972,
-0.0512828603,
0.0174079053,
0.0339291953,
0.0438179374,
0.1433740109,
0.0099966116,
0.3170181513,
0.0156322997,
0.0575687587,
-0.0104981316,
-0.0532745011,
0.2539074421,
0.1852035671,
0.1830990613,
-0.0392840877,
-0.3725683689,
0.0153122852,
0.3927864432,
-0.1042216793,
0.35374856,
-0.0030457422,
-0.4114218056,
0.0008039328,
0.1020721048,
-0.1002082303,
0.1456442475,
0.1736979336,
0.8331606984,
0.0913992003,
0.2913970649,
0.0990438461,
-0.3745930493,
-0.2292359173,
0.0848099515,
0.1412868053,
-0.3006950021,
0.1962330192,
-0.2893141508,
0.0214097127,
-0.1627855152,
-0.5309422612,
-0.0738257617,
-0.1034968421,
-0.124385938,
0.4379892349,
0.2560115755,
0.1048150882,
0.2743667662,
-0.0679701492,
-0.0091140931,
-0.635160327,
-0.0303660389,
-0.2195123732,
-0.3502954841,
-0.0034260552,
0.2406205684,
0.0253646225,
0.0885534585,
-0.2230239362,
0.1152780354,
0.1969491988,
-0.4630784988,
0.0964264646,
-0.1084732264,
0.3668429255,
0.034061607,
0.1044905186,
-0.1882028729,
-0.2383419126,
0.2162092626,
-0.2671551704,
-0.2033486664,
0.0590683483,
-0.0798354819,
0.0052183797,
-0.0440485924,
-0.1136507541,
-0.284756124,
-0.1694562584,
-0.1283540279,
0.1254848987,
0.0338841863,
0.398645401,
0.3249466419,
0.2000762224,
0.1735306233,
0.076669082,
0.1222383007,
-0.092714645,
0.3231502175,
-0.0346932448,
0.0231617503,
0.2990021408,
-0.3058591485,
0.0286031011,
-0.1258529723,
-0.4488916695,
-0.5858919621,
0.0146215707,
0.2705053687,
-0.0449818932,
0.022895325,
0.3292978406,
0.1701288819,
-0.009939475,
0.1031594127,
-0.1817326397,
-0.3934589326,
0.2843806148,
0.249062106,
-0.0437382869,
-0.0391655788,
-0.2207204103,
0.5412877798,
-0.4730608165,
-0.0344150923,
0.3007104397,
-0.0463124476,
0.1220676601,
-0.093837671,
-0.3473145962,
0.0026161519,
-0.1770348549,
-0.3872646093,
0.1603215784,
-0.1921955049,
-0.1894462109,
-0.2503656447,
0.027951885,
-0.2932750583,
-0.2187056243,
0.1310600936,
0.0105107985,
0.0252697393,
-0.0920436084,
-0.0690285861,
-0.0432198532,
-0.1032591686,
0.0107469512,
0.295959115,
-0.2220544666,
0.0204844289,
0.3319792151,
-0.6371982694,
0.0114332978,
0.0785693601,
0.2924874425,
0.0161093064,
0.2801786065,
-0.1238992214,
0.0581368767,
-0.1154009849,
0.2588286102,
0.2669908106,
-0.1222727373,
0.1879419088,
-0.1569964886,
0.0872346163,
-0.4683201313,
0.0024568781,
-0.3910138309,
-0.0371955708,
-0.5108367205,
-0.0007464592,
0.3016478121,
0.3158561289,
0.2830544114,
-0.0746997371,
0.1845622808,
-0.4773102403,
-0.4928886592,
-0.4238073826,
-0.1448925436,
-0.0340281948,
0.2792028785,
0.0137783783,
0.1574703157,
-0.1167863607,
-0.2421433181,
0.0762997642,
0.3607855439,
0.1209135875,
0.1257698983,
-0.0493438691,
-0.2595839798,
-0.1350413859,
0.4870655239,
0.4426616132,
0.2938047945,
-0.3357528448,
-0.308001101,
0.2927728295,
0.3107410669,
0.0434999987,
-0.394192338,
0.1987719536,
-0.4934764504,
-0.1911951005,
0.1731110811,
0.0440082476,
0.112798728,
0.2055022717,
-0.2596435249,
-0.0505586043,
0.5910873413,
0.00344749,
0.0358359665,
0.0617535152,
0.3198785484,
-0.1341251582,
0.2430289686,
0.2231682688,
0.965651989,
0.0120151648,
-0.0546537451,
0.4602912068,
0.0327182561,
0.2713980079,
-0.0514925346,
0.3049480617,
-0.3573490977,
-0.2458046079,
-0.0611771494,
-0.2653255463,
0.3560565412,
-0.6037131548,
-0.222478494,
-0.0300627202,
0.0151703721,
-0.0567902103,
0.1870260835,
-0.2615450025,
-0.0575118214,
-0.0694343895,
-0.22461465,
0.046108108,
-0.2375419289,
0.5531844497,
-0.3224277198,
0.2120824605,
-0.0156271216,
-0.1024765074,
-0.2567564845,
0.1074161306,
-0.3843135834,
0.081949085,
0.1826647669,
-0.1906042099,
-0.0020572983,
0.2088581473,
-0.0480973572,
0.025895156,
-0.0038118304,
0.205335483,
0.2875345051,
-0.2509104311,
-0.2406322211,
-0.0412308797,
0.4544916451,
-0.0739619508,
-0.2232003808,
0.1632988304,
-0.1486965567,
-0.1203095838,
0.2079340816,
0.2491943538,
0.2404620349,
-0.0666802898,
-0.1194641218,
0.0503872745,
0.1910234988,
-0.2349576801,
0.0667046681,
0.0519961603,
-0.158168152,
0.1981551498,
0.151141569,
-0.3012101054,
-0.1404925883,
0.0968232751,
0.1954908371,
0.1271102726,
0.4786179066,
0.0046552443,
-0.0343613662,
-0.1182940155,
0.1016348526,
-0.4566189647,
-0.2994999588,
0.2755728662,
0.1854288727,
-0.0628449544,
0.2035858184,
0.5781243443,
0.1484232843,
0.28338781,
0.0016783761,
-0.4137293696,
-0.0685866624,
0.1447932422,
0.1112537012,
-0.0606703833,
0.202784434,
0.5849719644,
0.1415169686,
-0.0208867434,
-0.2094156593,
0.076033555,
-0.0795702115,
0.1131139994,
-0.3074970245,
0.1867478937,
0.043092981,
-0.0073709344,
0.1148912236,
0.2219358683,
0.0825925767,
-0.2004007101,
-0.0969473124,
0.1931075454,
0.0397293195,
0.3005507588,
0.2324899286,
-0.0833235607,
0.0887916535,
0.0431921147,
0.0707473382,
-0.045478262,
-0.272046864,
0.0044177137,
0.5248972774,
-0.0293155331,
-0.139484942,
0.2138797343,
-0.2634385526,
0.3821101189,
0.0388785675,
-0.0040828348,
-0.0215805285,
0.1026024148,
0.0395449884,
-0.0718548447,
-0.4443146586,
0.002552249,
0.1375379711,
-0.4270154834,
-0.0080810776,
-0.4568272233,
-0.0880281404,
0.4660226703,
-0.1164562777,
0.1230648234,
0.3373892605,
0.0909792483,
-0.3088121116,
0.1949316561,
-0.0460893922,
-0.0582606345,
0.0389130041,
0.4427157044,
0.0595051758,
0.1074466556,
0.2294198424,
0.2066301852,
-0.0231664795,
0.2925179005,
0.1275265664,
0.1681662649,
-0.2863567472,
0.2210295647,
0.3486666679,
-0.0868721604,
0.0117011797,
-0.0556900837,
-0.1806064546,
0.4193440378,
-0.116628252,
0.1621092558,
0.0819764361,
-0.5037826896,
0.3588398099,
0.0932251438,
0.1893328428,
-0.1108096018,
0.3356676996,
0.4114014804,
0.0175604019,
-0.114958778,
0.0365131907,
0.3873965144,
-0.1941826493,
0.2069129348,
0.296849966,
-0.0104499292,
-0.0987942368,
0.1528920978,
0.2635689974,
-0.1121150479,
0.1424231827,
0.2765936553,
-0.3965967,
-0.3444945514,
-0.0058120247,
0.0751990974,
0.1885020584,
-0.1558038443,
0.0897363201,
-0.0908200517,
-0.1286638081,
-0.2432137579,
0.3294363916,
0.4504806101,
0.4281202257,
-0.0795048177,
-0.322937578,
-0.1604533345,
0.0746456757,
0.1047826931,
-0.1451221406,
0.2769163549,
0.6709737778,
0.0522964112,
0.174808532,
-0.195282191,
0.3402730227,
-0.0967916995,
-0.3059835136,
-0.1856520772,
0.1936621666,
0.2526381016,
-0.1094965115,
-0.4630559683,
0.2653677464,
-0.0621713549,
0.3748280108,
0.064719893,
-0.0029490585,
-0.1486264765,
0.0214043334,
0.0385717377,
0.280028671,
0.3117569089,
0.5116198063,
0.3169770837,
-0.1398620754,
-0.1157508641,
-0.5177515745,
0.4010749459,
-0.1786643267,
0.184211418,
0.0220359322,
-0.0267885625,
-0.0997657329,
0.3125270903,
-0.0283734966,
0.1194558591,
0.0742441118,
-0.1069630533,
-0.2954263985,
-0.331892699,
-0.0963866487,
-0.3195108175,
-0.0000723627,
-0.2787986994,
0.162981838,
-0.6408562064,
0.08287929,
-0.1802208275,
-0.3284862339,
0.1035500169,
-0.0689846501,
0.7786422372,
-0.1724226773,
0.3721236587,
0.1072879061,
0.0892629772,
0.1509099901,
-0.414445281,
-0.1447091848,
0.0910981819,
0.1098466143,
0.3065454364,
0.0231364835,
-0.0199299026,
-0.3485967219,
0.3524791002,
0.1307272911,
-0.0824346766,
-0.2510978281,
-0.0061518555,
0.0335112736,
0.1983194947,
-0.1538295448,
0.3151007891,
-0.1176370606,
0.0559944622,
-0.2864590287,
-0.461040169,
0.4683494568,
-0.2231796086,
-0.2698680162,
0.0057844389,
0.1729333103,
-0.2487135977,
-0.2186256498,
-0.5525948405,
0.0779680163,
0.2595116794,
0.1068582833,
-0.217087552,
0.2491263151,
0.0512750149,
0.0937591344,
-0.1307455003,
0.2270706743,
-0.1303287446,
0.1138670072,
-0.193269521,
-0.061311163
] |
https://github.com/huggingface/datasets/issues/1776 | [Question & Bug Report] Can we preprocess a dataset on the fly? | We are very actively working on this. How does your dataset look like in practice (number/size/type of files)? | I know we can use `Datasets.map` to preprocess a dataset, but I'm using it with very large corpus which generates huge cache file (several TB cache from a 400 GB text file). I have no disk large enough to save it. Can we preprocess a dataset on the fly without generating cache?
BTW, I tried raising `writer_batch_size`. Seems that argument doesn't have any effect when it's larger than `batch_size`, because you are saving all the batch instantly after it's processed. Please check the following code:
https://github.com/huggingface/datasets/blob/0281f9d881f3a55c89aeaa642f1ba23444b64083/src/datasets/arrow_dataset.py#L1532 | 18 | [Question & Bug Report] Can we preprocess a dataset on the fly?
I know we can use `Datasets.map` to preprocess a dataset, but I'm using it with very large corpus which generates huge cache file (several TB cache from a 400 GB text file). I have no disk large enough to save it. Can we preprocess a dataset on the fly without generating cache?
BTW, I tried raising `writer_batch_size`. Seems that argument doesn't have any effect when it's larger than `batch_size`, because you are saving all the batch instantly after it's processed. Please check the following code:
https://github.com/huggingface/datasets/blob/0281f9d881f3a55c89aeaa642f1ba23444b64083/src/datasets/arrow_dataset.py#L1532
We are very actively working on this. How does your dataset look like in practice (number/size/type of files)? | [
-0.3903960884,
-0.1971481442,
-0.0773907453,
-0.003823878,
0.3977740407,
0.335642606,
0.2610038817,
0.2968966663,
-0.0846412703,
0.1327670515,
0.069347851,
0.1286530495,
-0.1356009841,
0.2288655192,
0.2126400024,
0.1509193927,
0.2128422856,
0.0664261207,
0.0356723927,
0.2065106332,
-0.2539820373,
-0.1531419307,
-0.110058032,
-0.2128917873,
-0.4570016265,
-0.2720249295,
-0.1605052203,
0.0205967259,
-0.2341964394,
-0.1767743528,
0.3146639764,
0.321479857,
0.0866018534,
0.5502462983,
-0.0001117338,
0.008893121,
0.4019139111,
-0.0934247896,
-0.1076297909,
-0.1060750186,
0.1285005808,
-0.2643044889,
-0.1480513066,
-0.2470782846,
-0.1567155272,
-0.0504480191,
0.1196826026,
-0.637354672,
0.3856013417,
0.1254338473,
0.211514622,
0.1286570281,
-0.0810713917,
0.1382957697,
0.3179633915,
0.3585824668,
-0.3582457602,
-0.0789363757,
0.2596547306,
-0.0795596093,
0.0480676331,
0.1202430353,
-0.3685799539,
-0.0111848582,
0.3391452134,
0.1131043807,
-0.2082388252,
-0.6446154714,
0.1036308706,
0.2764860392,
0.4921408892,
-0.5251836181,
-0.6757849455,
-0.234873727,
0.1164423153,
-0.3433660269,
0.0445725694,
0.4104193747,
-0.1506754905,
0.0462532789,
-0.4445933402,
-0.3685856164,
0.0073839859,
-0.3361420035,
0.2708494663,
-0.1538693756,
-0.2351510227,
0.0023273567,
0.0621332377,
0.1466433108,
0.3794544637,
-0.2408937067,
-0.3575362563,
0.5096226335,
-0.2625169456,
-0.2431844026,
-0.2934469879,
0.1031617522,
0.2890482843,
0.1290296763,
0.0322178975,
-0.134764865,
-0.0453484207,
-0.0331236757,
0.1808279753,
0.0479213782,
-0.0593690127,
-0.1961773932,
0.3188604712,
-0.2196498215,
0.075432986,
-0.0793791488,
0.0598627031,
-0.3965127468,
0.3271102905,
0.0377091132,
0.3040318191,
-0.3226732314,
0.4087905586,
-0.0180788916,
0.0922288746,
-0.0135144154,
-0.4056243896,
0.1021771953,
-0.1372484565,
-0.0178538784,
0.1294896752,
0.0807886571,
0.0287716966,
-0.1734166294,
-0.104025349,
0.0153777245,
0.0140406471,
0.276253283,
0.1291562021,
-0.2255572081,
0.0598060228,
0.1925708801,
-0.0866798237,
-0.1647260934,
0.1988245398,
-0.4564759135,
0.1030173823,
0.3438339531,
0.0327931903,
0.0540709831,
-0.0675214604,
0.3300349712,
-0.1948369443,
0.484969914,
-0.2016842216,
-0.2776720524,
0.0362527594,
0.1042881981,
-0.0199730098,
0.0556139201,
-0.6019013524,
0.1712474525,
0.5740999579,
0.2262293398,
0.2237459868,
0.2339284569,
-0.2646641135,
-0.1679984182,
0.1193476915,
0.444964081,
-0.1898951232,
0.2122201025,
0.2736873627,
0.0231913608,
0.1523588002,
0.1042373702,
0.027539026,
0.2540637553,
-0.0630075783,
-0.1503756344,
0.3098078966,
-0.106660895,
0.1157016903,
0.4008812904,
-0.0550090671,
-0.2682391703,
0.0742105097,
0.1855353415,
-0.0364893861,
-0.1308400184,
0.0000578183,
0.3976076841,
0.0050132731,
0.1950964332,
-0.1847908944,
-0.4482400417,
-0.3217772841,
0.0058109495,
-0.0378200747,
0.1062786654,
-0.1856066138,
-0.301410675,
0.0877305418,
-0.1978134066,
0.1949756742,
0.3726012707,
-0.0443876795,
0.0690670609,
0.0505195297,
-0.1592520624,
-0.366135776,
0.2145511061,
-0.123057954,
0.0163032282,
0.181682989,
-0.4576365054,
0.1819763482,
0.0651791543,
0.0800103769,
0.1132605448,
0.0453956909,
-0.3407961726,
0.303275466,
-0.0114895441,
-0.4556632042,
0.2294507474,
-0.1917678118,
0.1052216887,
-0.3946018517,
-0.081409879,
0.1480355412,
-0.0604752265,
-0.0355984904,
-0.1678521335,
-0.2173681557,
-0.0086433319,
-0.0828093514,
0.3009220064,
-0.0961249694,
0.1768972278,
-0.0134269483,
0.168675974,
-0.1474284381,
-0.147606045,
-0.0205905531,
-0.1321052015,
0.1468913406,
-0.1920769513,
-0.2768490314,
0.2378065884,
-0.1526383758,
0.4071860611,
-0.0565593839,
-0.1704911888,
0.2015396953,
-0.0626926273,
-0.0467206389,
0.1874065101,
0.0113472473,
-0.0184701588,
0.7148054838,
-0.1235884726,
-0.0870061293,
-0.1725436002,
-0.0114091486,
-0.0265266057,
-0.0448288247,
0.2636302412,
-0.0986314639,
-0.1139736176,
-0.2289430499,
0.0929388627,
0.2143613696,
0.1423553526,
0.048432216,
0.1799987108,
0.0954064429,
-0.0961784646,
0.2947973311,
0.0102291824,
0.4094163477,
-0.0306618661,
0.2173748612,
0.1128181592,
-0.1889411807,
0.1710869223,
0.0641640127,
0.0664079338,
-0.1352334172,
0.1167892367,
0.1735373735,
-0.1463000178,
0.1443754882,
0.0346313715,
-0.2236535549,
0.1055330038,
-0.1247568578,
0.0065266327,
0.0684497952,
-0.0014728963,
-0.432400018,
0.4077483714,
0.0714964867,
-0.1607209295,
-0.1685138345,
-0.1798397452,
0.2189039439,
0.0133902486,
0.2648713589,
-0.16334714,
0.4653586745,
-0.0518571585,
0.047822576,
-0.3106504381,
0.1889937073,
0.0980871171,
0.036841061,
0.363149941,
-0.0228803009,
0.0573131777,
0.2028740495,
0.1895761788,
-0.0003711744,
-0.1338359565,
-0.1611997783,
-0.2465215027,
-0.0330793634,
0.0012593467,
-0.2042115778,
0.0467960946,
-0.1116844192,
-0.2437696308,
0.1459948719,
-0.0001908697,
0.0341539867,
0.2436154038,
0.0226549637,
-0.1487400234,
-0.1455847323,
0.0798744261,
-0.0226013083,
-0.7236915231,
0.288831979,
-0.0164140724,
-0.3574147522,
0.0216522384,
0.0053141671,
-0.0362317599,
0.3411470354,
-0.605407238,
0.0128709944,
-0.3743884861,
0.0355545133,
-0.1713721752,
0.1643205434,
0.2667717636,
0.0743672699,
-0.0715068355,
0.022015959,
-0.1048546284,
0.001819103,
-0.1901125908,
0.0152305011,
0.282119453,
0.4061175287,
0.0109552685,
0.6870186925,
0.1741275936,
0.0132041611,
0.3461167514,
0.0442668162,
0.5539387465,
-0.2773264349,
-0.0958694518,
-0.1771089733,
-0.2428264171,
-0.1766518205,
0.1236021146,
0.2735067904,
-0.3021137714,
-0.1938185096,
0.0253618192,
-0.0795212463,
-0.0992977917,
0.1347559094,
-0.2884261608,
0.288729012,
-0.0055790883,
0.0322165601,
-0.2510040104,
-0.4088845551,
0.1039894745,
0.0649317205,
0.6988078952,
-0.1419105381,
-0.1913319379,
0.2181937695,
-0.6576191783,
0.2069142461,
-0.0033274272,
0.2896778584,
0.128138721,
0.0671627,
0.0759671181,
-0.3018742502,
0.5862103701,
-0.2058387399,
0.0302287787,
0.4009719193,
-0.0075555914,
-0.2386107892,
0.1260062009,
0.0773038492,
0.5740272403,
-0.1925809383,
0.3010319769,
-0.0307213329,
-0.1716300696,
0.0872897431,
0.3777669966,
-0.2151724845,
-0.5332975388,
-0.1703982204,
-0.1797483563,
-0.1750021279,
0.150467217,
0.0549044833,
-0.19732894,
-0.1321409941,
-0.1062018126,
-0.3844800293,
0.3052109182,
-0.0211573858,
-0.1930194348,
0.1160208285,
-0.0337626375,
0.4853580892,
0.039434582,
-0.169962585,
-0.0728723556,
0.5232403278,
-0.2595115006,
-0.1893889755,
-0.1474989504,
-0.0363619886,
0.3864382505,
0.2437524647,
0.0483536497,
0.2093799561,
-0.0149336848,
0.0861013457,
-0.5349302292,
0.1091595292,
0.1268615574,
-0.0836396813,
-0.6452923417,
-0.6370646954,
0.6103528142,
0.4527733028,
0.0547732599,
0.4409402311,
0.0547216497,
-0.1575471163,
0.2837333083,
0.2144522071,
0.8360587955,
-0.3474940062,
0.2523156106,
-0.3638064861,
0.1622584611,
0.2669762969,
-0.3113695979,
0.0150996167,
-0.3076030612,
-0.4002590179,
0.0424685962,
-0.1455600262,
0.1053685248,
0.3223259449,
0.0580710955,
0.2982224524,
-0.0511150993,
-0.0921740457,
-0.1188707501,
-0.0743382648,
-0.0784390494,
-0.5844621658,
-0.1622672379,
0.1747302413,
-0.0435515866,
0.1200109869,
-0.1409794092,
0.2036854625,
0.2561592758,
-0.1187514365,
-0.391130209,
-0.0167691987,
-0.2120414078,
-0.2802058458,
-0.1674093902,
-0.1748957038,
-0.1033792496,
0.0724104121,
0.479193598,
0.5132245421,
-0.0546385832,
-0.0849707052,
0.103952691,
0.1152409092,
-0.0986634418,
0.1121684611,
0.1111839339,
-0.0754238144,
0.0722717494,
-0.0286083221,
-0.39298594,
-0.1395229697,
0.1768445075,
-0.0854210928,
0.0860090181,
0.0270313434,
-0.2994519174,
0.0694882497,
0.2213981301,
-0.0579575449,
0.107732147,
0.3272390664,
0.0183357242,
0.3171111941,
-0.150640443,
-0.3271249235,
0.0125233028,
0.2531429231,
0.1449329853,
-0.3179356456,
0.2900616229,
0.1992647201,
-0.237403363,
-0.137988627,
0.2061213851,
-0.0179357678,
-0.3303298056,
0.2150023729,
0.1320089996,
0.2330529541,
-0.0694903433,
0.1627016217,
0.0822033584,
-0.2622518837,
0.1388379186,
-0.1855165511,
-0.5902348161,
-0.0965857655,
0.1428099871,
0.2233103067,
0.5382518172,
-0.373631686,
0.1490958482,
0.3163089156,
-0.2533814311,
-0.010181576,
0.0427112691,
0.1136296317,
0.1111272871,
0.2753556967,
0.0298252832,
-0.1789195389,
-0.0052513094,
0.053913895,
0.0332931541,
-0.2794552743,
-0.047746364,
0.1669956297,
-0.1420473754,
-0.0874353573,
0.2233612984,
-0.2128168941,
-0.2577118576,
-0.3818079531,
0.0933891833,
0.3412837982,
-0.0700265616,
-0.2541683614,
0.3046007156,
0.145024538,
-0.3586770296,
0.3340474665,
0.0700192824,
0.1435259581,
-0.1232575551,
0.1237585992,
0.1664767414,
-0.0555975251,
0.1118844077,
-0.1866807044,
0.2464662343,
-0.0238260329,
0.1362110376,
-0.1701818109,
0.06103082,
0.2766334713,
0.2868181467,
0.1773667634,
-0.0933018401,
0.1268343776,
0.2990508378,
0.1772525162,
-0.2163120955,
-0.2040120661,
0.1293662637,
-0.0591136403,
0.1035018265,
0.2595470846,
0.2191543281,
0.1358409971,
-0.1556209773,
0.2655942142,
0.2433727384,
-0.4232628644,
0.0423720032,
0.2177228481,
0.1372024119,
0.1452836394,
0.2677956223,
0.3036686182,
0.1623483598,
0.3597693443,
0.2897258103,
0.5725319386,
0.337169528,
0.0547584333,
-0.2753029466,
-0.6611907482,
0.3065602183,
0.0854212418,
0.3103349209,
0.3788239956,
-0.013585072,
0.2490012497,
0.0256536268,
-0.1785308421,
-0.2163430601,
0.1090385839,
-0.1140522137,
-0.1785176694,
0.3778686225,
0.0201884415,
0.3296591043,
0.1227003485,
-0.047256358,
-0.1081706956,
0.265204072,
0.0449245982,
0.1607595235,
0.1678285003,
0.1748287231,
0.05635456,
0.3255893886,
-0.139004156,
0.1670773923,
0.0338009894,
0.0520106666,
-0.0451623835,
0.5297792554,
0.2772935033,
0.3780843914,
-0.0987550244,
0.1468122751,
-0.0556049794,
0.0012173546,
-0.029947808,
0.2641468942,
-0.1150574833,
-0.1527372599,
0.163434878,
0.0694900453,
-0.081806533,
0.2432889044,
-0.1549185216,
0.3400703669,
-0.1396978498,
0.2530259788,
0.0932918414,
-0.3390541375,
-0.2198703587,
0.1748740077,
-0.2293975204,
0.1370788962,
0.6883221269,
-0.3523360491,
-0.0466697775,
-0.0549991131,
0.077894792,
0.1893009245,
0.4720000327,
0.3703414798,
0.0690937638,
-0.1510738581,
0.0763525218,
-0.4328628182,
-0.1537939608,
-0.1426943094,
0.2503023148,
-0.2072929293,
-0.1127906963,
0.1592162102,
0.2857861817,
-0.0219077878,
-0.3598349392,
0.073904559,
0.4348345995,
-0.3127695024,
-0.1881671995,
-0.1850737929,
0.0751492754,
0.0557162985,
-0.5030344129,
0.1237587035,
0.1257852167,
-0.074268885,
0.0443493724,
0.0941213146,
0.1537400037,
-0.0111312075,
0.4049519002,
0.0043678782,
0.1726040691,
-0.1656092703,
-0.0145586058,
-0.3031445146,
-0.0436843522,
-0.2267342508,
0.1296516657,
0.0770133883,
-0.0606907867,
-0.5568871498,
-0.2705359161,
-0.0729452521,
-0.2407099903,
-0.2368828952,
0.0600512289,
-0.3554623425,
-0.2455929071,
-0.1167486161,
-0.0597560555,
0.1881880462,
0.201066643,
-0.0200573932,
0.0895661935,
-0.3076409996,
-0.2897493541,
0.5246589184,
-0.1734449863,
-0.2983179092,
-0.2442419231,
0.0616429523,
0.061412137,
-0.1606089622,
-0.3795975447,
0.2405108362,
0.2741990983,
-0.1191729009,
0.1551204026,
0.310964793,
-0.351644814,
0.064696528,
-0.2036036402,
0.6356158853,
-0.1921977252,
0.0002169232,
-0.402925849,
-0.3338169158
] |
https://github.com/huggingface/datasets/issues/1776 | [Question & Bug Report] Can we preprocess a dataset on the fly? | It's a text file with many lines (about 1B) of Chinese sentences. I use it to train language model using https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm_wwm.py | I know we can use `Datasets.map` to preprocess a dataset, but I'm using it with very large corpus which generates huge cache file (several TB cache from a 400 GB text file). I have no disk large enough to save it. Can we preprocess a dataset on the fly without generating cache?
BTW, I tried raising `writer_batch_size`. Seems that argument doesn't have any effect when it's larger than `batch_size`, because you are saving all the batch instantly after it's processed. Please check the following code:
https://github.com/huggingface/datasets/blob/0281f9d881f3a55c89aeaa642f1ba23444b64083/src/datasets/arrow_dataset.py#L1532 | 21 | [Question & Bug Report] Can we preprocess a dataset on the fly?
I know we can use `Datasets.map` to preprocess a dataset, but I'm using it with very large corpus which generates huge cache file (several TB cache from a 400 GB text file). I have no disk large enough to save it. Can we preprocess a dataset on the fly without generating cache?
BTW, I tried raising `writer_batch_size`. Seems that argument doesn't have any effect when it's larger than `batch_size`, because you are saving all the batch instantly after it's processed. Please check the following code:
https://github.com/huggingface/datasets/blob/0281f9d881f3a55c89aeaa642f1ba23444b64083/src/datasets/arrow_dataset.py#L1532
It's a text file with many lines (about 1B) of Chinese sentences. I use it to train language model using https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm_wwm.py | [
-0.3749499619,
-0.3105452359,
-0.0253562815,
0.0781464577,
0.4190764725,
0.3276049495,
0.2523880303,
0.2493896484,
-0.1120237559,
0.0602597371,
-0.0421743393,
0.080749467,
-0.1185979024,
0.1677816212,
0.318941921,
0.0842123181,
0.2063731849,
0.0334924795,
-0.00253722,
0.1758530736,
-0.2277180254,
-0.1650639176,
-0.0601742938,
-0.1133636609,
-0.5667705536,
-0.276830256,
-0.245332703,
-0.0490855798,
-0.1583474576,
-0.2284193635,
0.275698334,
0.234081924,
0.0893832892,
0.517862618,
-0.0001183977,
0.0513977706,
0.3754439652,
-0.0806588829,
-0.1265791953,
-0.1006739661,
0.1375203729,
-0.2211701125,
-0.1770981401,
-0.1919108182,
-0.1763419062,
-0.0012005513,
0.1539304256,
-0.4922322631,
0.5047304034,
0.1946834028,
0.1448630542,
0.2098600417,
-0.0517701507,
0.2219604701,
0.218523249,
0.3186275065,
-0.2461316735,
0.1444979906,
0.2155949771,
-0.0166624263,
-0.0376084447,
0.1634668857,
-0.3166071177,
-0.0151865594,
0.2694857121,
0.1486748457,
-0.1537854224,
-0.5454913974,
0.1296335757,
0.3487482965,
0.3943712413,
-0.5621159077,
-0.6745550036,
-0.2740338147,
0.1808798909,
-0.3332335949,
0.0932868868,
0.4548131824,
-0.140977025,
0.2020019591,
-0.4392780662,
-0.4125902057,
0.078161642,
-0.3117170334,
0.2973234653,
-0.0474813171,
-0.2603076696,
0.0327827744,
0.0513392128,
0.1321082264,
0.3066859245,
-0.2835431993,
-0.3123466969,
0.5733695626,
-0.2480732203,
-0.2415745407,
-0.3126247823,
0.1712335795,
0.2013996392,
-0.0665585175,
0.0682617128,
-0.128922537,
0.0041906429,
-0.0502713732,
0.1260249317,
0.0392939374,
-0.0833769441,
-0.2117568105,
0.2936161458,
-0.1786150783,
0.0200479198,
-0.0229566153,
0.0223848633,
-0.3257003427,
0.230551064,
0.0885231718,
0.2718848884,
-0.1417562217,
0.3139844537,
-0.0136683993,
-0.0189773105,
-0.0311281737,
-0.3354022205,
0.1593688428,
-0.1914642751,
-0.0439447165,
0.144510597,
0.1041969359,
-0.0308412779,
-0.2627184391,
-0.0954937711,
0.089927122,
-0.055390384,
0.3115382791,
0.1160628647,
-0.1680897474,
0.0953003988,
0.1865531057,
-0.1242667958,
-0.2649587989,
0.0811402053,
-0.4365722239,
0.0148296971,
0.2506143749,
-0.0197156183,
0.0720882788,
-0.0367935076,
0.3380575776,
-0.1779043674,
0.4492944479,
-0.2043383569,
-0.257389158,
0.1642539054,
0.0534857325,
-0.0083526326,
0.0555139259,
-0.4702358544,
0.3273878396,
0.6150687337,
0.287658304,
0.2803549469,
0.3247430325,
-0.3547720015,
-0.0543346554,
0.1112444401,
0.5088638663,
-0.2824390233,
0.044528313,
0.3910320103,
-0.0378992632,
0.1227310225,
0.2004509121,
-0.0386203565,
0.3778629303,
-0.0348489322,
-0.1377106905,
0.2549003661,
-0.0279568061,
-0.0049304846,
0.429784447,
-0.1329644024,
-0.2408826649,
0.0994629785,
0.2273845822,
-0.1922974586,
-0.0534686707,
0.0641368255,
0.394348979,
0.0507268161,
0.1347923428,
-0.1889542788,
-0.5016101003,
-0.2405152172,
-0.0254903343,
-0.0514848083,
0.1133785471,
-0.1985218674,
-0.0784511641,
0.1419787407,
-0.1865406781,
0.1762099117,
0.3741007745,
-0.1776564419,
0.1049662754,
-0.0246021897,
-0.2391482443,
-0.356500119,
0.2378041148,
-0.18518354,
0.0727883875,
0.1977108121,
-0.4412867427,
0.256416589,
0.0928593799,
0.0211975966,
0.0967225954,
-0.004148446,
-0.3817104995,
0.3277626038,
0.0220817793,
-0.4443691075,
0.2501783669,
-0.3590979576,
0.0738285258,
-0.4026619196,
-0.1143504009,
0.1062478945,
0.0095001459,
-0.1003314257,
-0.0945284069,
-0.2604740262,
0.00716375,
-0.1008776873,
0.2901643813,
-0.1616962403,
0.2272224724,
-0.1203623712,
0.0991881937,
-0.0737567842,
-0.2234308571,
-0.0107728085,
-0.1301413476,
0.1044432446,
-0.2295478135,
-0.2490976453,
0.2669835091,
-0.0294237528,
0.4033819735,
0.025611572,
-0.2489111423,
0.2217791826,
-0.041125454,
-0.0857891664,
0.0846274719,
0.1030279249,
-0.0495609939,
0.7756671906,
-0.0289045237,
-0.1323897839,
-0.2946955264,
0.1223668084,
-0.0322113521,
0.0509433001,
0.2729352117,
-0.1622237563,
-0.1328099668,
-0.2435215414,
0.0138939312,
0.2328963578,
0.0966449603,
0.0882692263,
0.3098804653,
0.0511682294,
-0.1263477355,
0.2850106359,
0.0187537856,
0.439648658,
-0.0250515211,
0.1615844071,
0.1324831247,
-0.2792650461,
0.2479460537,
0.0971258134,
0.0697616488,
-0.2154581994,
0.1413434744,
0.0990858153,
-0.179344669,
0.0310034771,
0.0360493511,
-0.2645478249,
0.1805560142,
-0.2056175023,
-0.1350844353,
0.1120666042,
0.0225046929,
-0.3421093822,
0.3792150915,
0.1037957296,
-0.0551778935,
-0.0645871982,
-0.176441893,
0.1415842324,
-0.0590536781,
0.3099807501,
-0.2132005841,
0.3635681868,
-0.0960217267,
-0.0447247587,
-0.2309785187,
0.1858300716,
0.1836380064,
0.0575984567,
0.3153479993,
0.0150037967,
0.0612772815,
0.1458823532,
0.1730891764,
0.0315097049,
-0.1268612146,
-0.2293548286,
-0.2512017787,
0.0078262752,
-0.0029189694,
-0.1471857578,
0.0929357857,
-0.1853149384,
-0.1976008564,
0.2195746601,
-0.0661496818,
0.0594114028,
0.3334248066,
-0.0181250535,
0.004022697,
-0.1771631837,
0.0646653846,
-0.0010531365,
-0.7291207314,
0.3107970357,
0.0556922294,
-0.3598349392,
-0.0095338523,
-0.0833321661,
0.02467422,
0.3075174987,
-0.6023689508,
0.0590272956,
-0.3641528785,
0.0222922619,
-0.1750626564,
0.1446501017,
0.1694185734,
-0.0068360069,
0.002027475,
0.0335192606,
-0.0329027623,
0.0712472424,
-0.1892558932,
0.0448545665,
0.2905825377,
0.6020949483,
0.0019181586,
0.6774528623,
0.2382273525,
-0.01010295,
0.3234529793,
0.1135634929,
0.5247785449,
-0.2154267281,
-0.0926542506,
-0.167107746,
-0.2162947506,
-0.1027713344,
0.2582955658,
0.2151994556,
-0.2334211171,
-0.1804964244,
-0.0443669036,
-0.0072845817,
-0.093548812,
0.1971038729,
-0.3860429823,
0.3524754047,
0.0431218632,
0.0404767618,
-0.2245040238,
-0.3934686482,
0.1024746671,
0.0265662279,
0.6047847867,
-0.0617152974,
-0.2506678104,
0.135646373,
-0.7349540591,
0.1575910002,
0.0608927272,
0.3999406397,
0.116118364,
0.1423438042,
0.1530470997,
-0.2671489716,
0.6611446738,
-0.1820891201,
0.0236955043,
0.2840819359,
-0.0700309277,
-0.2258532345,
0.1690513641,
0.0049061519,
0.5148665905,
0.0192251634,
0.3401058316,
-0.0085864272,
-0.2024801373,
0.0908488706,
0.3764361143,
-0.2770529985,
-0.5819286108,
-0.218664512,
-0.1276069432,
-0.2294229716,
0.1933107376,
0.1035653204,
-0.1981812268,
-0.061747428,
-0.0676766858,
-0.3200574815,
0.2900866866,
0.0510930941,
-0.1866369098,
0.0040523554,
0.0837673768,
0.4016824365,
0.0518748984,
-0.0788614973,
-0.1687555164,
0.5229564905,
-0.259731859,
-0.2651681602,
-0.1819012463,
-0.0811788216,
0.3944951296,
0.3223762512,
0.0941208377,
0.2992990315,
0.1786827296,
0.1138532385,
-0.5120096803,
0.1892687976,
0.1549812257,
0.0719949082,
-0.7229219079,
-0.622250855,
0.6525928974,
0.351983279,
0.1259383708,
0.2537679076,
0.1220530346,
-0.2655967474,
0.2247304767,
0.2336195111,
0.895252943,
-0.319447428,
0.2945694923,
-0.2977176905,
0.1884460896,
0.4412756264,
-0.3313083649,
0.0870245174,
-0.1864240021,
-0.3148829937,
-0.0036825263,
-0.1161767989,
0.1716419756,
0.3708027601,
0.0952130929,
0.300853461,
-0.017984286,
-0.0516085215,
-0.0166101623,
0.0293024331,
-0.082047686,
-0.5858250856,
-0.2183349878,
0.1013283208,
-0.0855739564,
0.1453361958,
-0.19209975,
0.1840759069,
0.2510241866,
-0.0993481129,
-0.4174711406,
-0.0366445929,
-0.3467866182,
-0.1779518127,
-0.1979887933,
-0.1622327864,
0.0526020527,
0.0865082145,
0.5049936771,
0.515825212,
-0.0750928819,
-0.0995385423,
0.019286152,
0.0976049304,
-0.1561748385,
0.0864426717,
0.1889237761,
-0.0573592372,
0.054486122,
-0.0292992927,
-0.3847138584,
-0.1260061562,
0.1087398306,
-0.1294971108,
0.0852854699,
0.1332559288,
-0.4105954766,
0.0430440716,
0.1881160438,
-0.0803620294,
0.0460289344,
0.2664837837,
-0.08431115,
0.176682353,
-0.1003565416,
-0.3924736083,
-0.0170776229,
0.3325718045,
0.1509129703,
-0.2541075051,
0.4268797934,
0.3013951182,
-0.278174758,
-0.0730167106,
0.1619434208,
0.0966808796,
-0.4329403639,
0.1042792052,
0.1879657209,
0.2459782064,
-0.2142019421,
0.0548304394,
0.1220947951,
-0.2156114578,
0.1215832904,
-0.2027390152,
-0.6988819838,
-0.1157463565,
0.1937432885,
0.0963307694,
0.5451951623,
-0.095300518,
0.1898052096,
0.4475334883,
-0.1852531731,
-0.0341504812,
-0.0051073455,
0.0938498303,
0.1589475274,
0.247689262,
0.0246214867,
-0.1350829303,
-0.0457720459,
0.0844506696,
0.0626785755,
-0.2373906374,
-0.09886913,
0.2000258714,
-0.0570258498,
-0.1207514629,
0.2125354707,
-0.1871809661,
-0.167941913,
-0.4030841589,
0.0339223482,
0.3511117697,
-0.0069713891,
-0.209728539,
0.2676529586,
0.2040483654,
-0.3131276965,
0.2779679596,
0.0748592466,
0.1064922139,
-0.0686851293,
0.0969450697,
0.2907653153,
0.0461496934,
0.065822795,
-0.1529538482,
0.2815492749,
-0.1276479214,
0.0869905055,
-0.2359277755,
0.0880423039,
0.2308559269,
0.2229378521,
0.1889080405,
-0.1196662337,
0.0540843122,
0.3452787101,
0.096586898,
-0.3158838749,
-0.1373807639,
0.2207079083,
-0.1279360056,
0.1054339856,
0.2710894346,
0.2083107531,
0.2108285725,
-0.1556240022,
0.2213842273,
0.155481562,
-0.3679106832,
-0.0255753472,
0.3143433928,
0.2194729894,
0.2891560197,
0.3471427858,
0.3937496245,
0.1932378262,
0.3604696691,
0.296665132,
0.5566429496,
0.1156127006,
0.1460448354,
-0.2761045694,
-0.6948467493,
0.1686467677,
0.111916177,
0.143764928,
0.3430638611,
-0.1404847652,
0.2499821484,
0.0134367114,
-0.2159703821,
-0.1870096326,
0.1724847853,
-0.2066755295,
-0.2646565139,
0.3597430885,
0.0299955625,
0.3080591559,
0.1755876541,
-0.0062245745,
-0.175853014,
0.1199120879,
0.0362679772,
0.105983384,
0.0291433483,
0.1209730357,
0.0765615255,
0.1871216893,
-0.2097546607,
0.1574238241,
0.0188927297,
0.1319533885,
-0.1634798944,
0.4289204478,
0.1874070764,
0.3955986202,
-0.0757285729,
0.1927971542,
-0.0569290519,
0.0233519711,
-0.0576293878,
0.1993986666,
0.002304751,
-0.0740152895,
0.178621769,
0.0053613032,
-0.0582533441,
0.1853409559,
-0.0793755203,
0.3324708939,
-0.2297220975,
0.2897552848,
-0.038106557,
-0.3007814288,
-0.2321139574,
0.2577093244,
-0.3346061707,
0.3339973092,
0.7271059155,
-0.4429171979,
-0.0402121544,
-0.0623484515,
0.0351395383,
0.1675345153,
0.5127872229,
0.3862251937,
0.1302078217,
-0.2132239938,
0.1055068672,
-0.5249495506,
-0.1979755461,
-0.1035249755,
0.3607323766,
-0.2679540515,
-0.1362633556,
0.1628435552,
0.2141896039,
-0.1237194464,
-0.2999059558,
-0.055915568,
0.3310475945,
-0.2579765618,
-0.2018975317,
-0.3481366932,
0.186728701,
0.0171722528,
-0.43533355,
0.1584533453,
0.2004406005,
-0.1738943458,
-0.0889286771,
0.1638791561,
0.0304906201,
-0.0180215798,
0.3460174203,
0.0734669566,
0.2587005794,
-0.1941830367,
0.0096102692,
-0.3058738708,
0.02320344,
-0.2586737871,
0.2087650001,
0.0514143221,
0.0079053091,
-0.5748568773,
-0.3172647357,
-0.1032143682,
-0.2164856791,
-0.1374963075,
-0.0587226935,
-0.3331207037,
-0.2301082164,
-0.1784721613,
0.0029495126,
0.3238133192,
0.2766810656,
-0.0085445493,
0.1011757553,
-0.2328113616,
-0.1817190349,
0.4950388372,
-0.3164904118,
-0.3039829135,
-0.2405494153,
0.0564857796,
0.1237998009,
-0.2566738129,
-0.4457376897,
0.1504120827,
0.2864786685,
-0.1394606978,
0.0588700734,
0.3648119271,
-0.3023825586,
0.0923660249,
-0.2112693936,
0.626319468,
-0.1821258813,
-0.0996519923,
-0.3672670424,
-0.4044739604
] |
https://github.com/huggingface/datasets/issues/1776 | [Question & Bug Report] Can we preprocess a dataset on the fly? | Indeed I will submit a PR in a fez days to enable processing on-the-fly :)
This can be useful in language modeling for tokenization, padding etc.
| I know we can use `Datasets.map` to preprocess a dataset, but I'm using it with very large corpus which generates huge cache file (several TB cache from a 400 GB text file). I have no disk large enough to save it. Can we preprocess a dataset on the fly without generating cache?
BTW, I tried raising `writer_batch_size`. Seems that argument doesn't have any effect when it's larger than `batch_size`, because you are saving all the batch instantly after it's processed. Please check the following code:
https://github.com/huggingface/datasets/blob/0281f9d881f3a55c89aeaa642f1ba23444b64083/src/datasets/arrow_dataset.py#L1532 | 26 | [Question & Bug Report] Can we preprocess a dataset on the fly?
I know we can use `Datasets.map` to preprocess a dataset, but I'm using it with very large corpus which generates huge cache file (several TB cache from a 400 GB text file). I have no disk large enough to save it. Can we preprocess a dataset on the fly without generating cache?
BTW, I tried raising `writer_batch_size`. Seems that argument doesn't have any effect when it's larger than `batch_size`, because you are saving all the batch instantly after it's processed. Please check the following code:
https://github.com/huggingface/datasets/blob/0281f9d881f3a55c89aeaa642f1ba23444b64083/src/datasets/arrow_dataset.py#L1532
Indeed I will submit a PR in a fez days to enable processing on-the-fly :)
This can be useful in language modeling for tokenization, padding etc.
| [
-0.380630374,
-0.196968928,
-0.0746241361,
-0.0068638455,
0.4007772505,
0.3399396241,
0.2778782547,
0.2634272575,
-0.0995359048,
0.1461999267,
0.1342770457,
0.1849375218,
-0.1421178579,
0.2875475883,
0.2689658105,
0.1431528628,
0.1967976987,
0.0332214274,
0.0725331381,
0.237766102,
-0.2820772827,
-0.1595615447,
-0.1298618764,
-0.1796598285,
-0.4086599946,
-0.3066295385,
-0.1548001468,
-0.0939177647,
-0.2736938298,
-0.2001533806,
0.2956175506,
0.2963148057,
0.0653252006,
0.4654719532,
-0.0001154027,
0.0105220964,
0.4278814495,
-0.0547124892,
-0.0995462984,
-0.143534556,
0.1376841515,
-0.2483468205,
-0.13861157,
-0.2409493476,
-0.1121580079,
-0.0338169821,
0.0784301758,
-0.6800124049,
0.3494406343,
0.115815267,
0.1876231432,
0.1196273193,
-0.0841416046,
0.1558763087,
0.2843361199,
0.3790517151,
-0.3493451178,
-0.1307845861,
0.1972597241,
-0.0772142187,
0.0815448314,
0.0771729276,
-0.3598993421,
-0.0484262295,
0.2894829512,
0.0892700776,
-0.2145828307,
-0.6604300141,
0.1388299614,
0.2746992111,
0.4689069688,
-0.5630962849,
-0.7029759288,
-0.2193478048,
0.1402738541,
-0.3208353519,
0.0382907055,
0.4482019842,
-0.1715642363,
0.0731240287,
-0.4151314497,
-0.4202466309,
0.0413669795,
-0.3086304665,
0.2753443122,
-0.0720976591,
-0.2119607925,
0.0252018161,
0.0342019461,
0.1810991019,
0.4665646553,
-0.2718545198,
-0.309037447,
0.4835746288,
-0.2577777803,
-0.1970092654,
-0.2645564377,
0.0677480623,
0.2692096531,
0.0593972169,
0.0312878191,
-0.1208762228,
-0.0593944713,
-0.0603432879,
0.185762912,
0.0467240177,
-0.0205963682,
-0.1888609976,
0.2885478139,
-0.2618696988,
0.1094836965,
-0.0513227284,
0.0204733424,
-0.3383105099,
0.3059311509,
0.0955197513,
0.2437419295,
-0.2711468041,
0.3885358274,
-0.0272218771,
0.0765129551,
-0.0235701408,
-0.400827378,
0.0876813009,
-0.1159519181,
-0.0047161733,
0.1546855569,
0.0961960182,
0.0672433227,
-0.2288591564,
-0.0770788416,
0.0140275713,
0.0041488027,
0.2325497717,
0.0727710575,
-0.1973728687,
0.0311661251,
0.2105324417,
-0.0917338133,
-0.2058475316,
0.1751337498,
-0.4416750968,
0.0907110646,
0.2982268333,
0.0351357609,
0.0468141511,
-0.0299171209,
0.3525291085,
-0.2366732508,
0.5580147505,
-0.1571927965,
-0.2958836257,
0.0467772447,
0.0742287859,
-0.0204162914,
0.0069828872,
-0.5607433319,
0.2342841476,
0.6066607833,
0.2160428464,
0.2605377138,
0.232074216,
-0.305367589,
-0.1547009945,
0.1365790218,
0.4368866682,
-0.2761690319,
0.1823853701,
0.2781618834,
0.0397012681,
0.2247021198,
0.0285133589,
-0.0242420193,
0.2706716359,
-0.0475755744,
-0.1463969052,
0.3211702704,
-0.0999134779,
0.1367202252,
0.3996351361,
-0.0590500422,
-0.2813993096,
0.081068337,
0.165516004,
-0.063207455,
-0.0565830506,
-0.0004902144,
0.4461776912,
0.0238897,
0.1589465439,
-0.1804378182,
-0.4752099216,
-0.2243530303,
-0.0135991955,
0.0118638817,
0.1263297051,
-0.1286602318,
-0.2577131987,
0.0810361579,
-0.202831462,
0.1990295947,
0.3393396139,
-0.0400337726,
0.0700504333,
0.0501673333,
-0.2194067538,
-0.3255533278,
0.2392320633,
-0.1290397346,
0.0725406185,
0.1684772372,
-0.4414999485,
0.2057805806,
0.1176258177,
0.0929608643,
0.1650897563,
0.0184883885,
-0.3471727967,
0.2571829855,
0.0080342358,
-0.4888255894,
0.2847564816,
-0.2818238139,
0.0605556183,
-0.3192244768,
-0.0891122445,
0.1544456482,
-0.0264190193,
-0.072977297,
-0.1170580238,
-0.2385208309,
0.0320942067,
-0.1021129191,
0.2757897377,
-0.0663900301,
0.1682732999,
-0.0866346881,
0.1256417781,
-0.1447452009,
-0.1290699542,
-0.0076085976,
-0.1717791855,
0.1499705613,
-0.1908591241,
-0.187991634,
0.2441374511,
-0.0906545743,
0.455109179,
-0.0186683517,
-0.1764631718,
0.1805123687,
0.0065298919,
-0.0552362539,
0.125054732,
0.0155820455,
-0.0882805586,
0.738835156,
-0.1510334164,
-0.0979687199,
-0.1166277826,
0.026518736,
0.0043681357,
-0.0117036635,
0.2582090497,
-0.1133450642,
-0.1405483931,
-0.2205934972,
0.0856267139,
0.210799396,
0.1212836877,
0.0395464301,
0.2407398969,
0.0709574744,
-0.0643180534,
0.3207210004,
0.0227348618,
0.456312865,
-0.04685314,
0.2302239388,
0.157525748,
-0.212162286,
0.1479541808,
0.0611931384,
0.0646841377,
-0.138688162,
0.1182625741,
0.1323520988,
-0.1580019146,
0.139246732,
-0.0285876207,
-0.2757461965,
0.0956979543,
-0.1378238052,
-0.1189017445,
0.1435195357,
-0.0278891027,
-0.4474337995,
0.4689070582,
0.051171612,
-0.1783304811,
-0.1720499992,
-0.25060606,
0.2144928724,
-0.0087661138,
0.2332843989,
-0.1438085586,
0.4303094745,
-0.0180496946,
0.0589524917,
-0.2585682273,
0.1374774426,
0.1043520868,
0.0309751891,
0.3830711246,
-0.0061093653,
0.0010171041,
0.2085378021,
0.2050907016,
-0.0019417221,
-0.1447567195,
-0.2003002465,
-0.2609398663,
-0.0236170813,
-0.0058719665,
-0.2088483572,
0.0928853676,
-0.1521235704,
-0.2390486598,
0.1361913085,
-0.0025107204,
0.052035857,
0.1913917214,
-0.0341628268,
-0.0971087515,
-0.1601896137,
0.068032071,
-0.0249220207,
-0.6827623248,
0.2437422574,
0.0176172908,
-0.3386533856,
-0.0238721836,
0.0088690957,
0.0437362343,
0.3255076408,
-0.5940136909,
0.0640684441,
-0.4057158232,
0.0709719732,
-0.2209234238,
0.1615332663,
0.3194850087,
0.1000272557,
-0.0216582324,
0.0339365937,
-0.1603555083,
-0.0201174282,
-0.1682433188,
-0.0235504359,
0.3433023989,
0.4535855651,
0.0314810872,
0.6971468925,
0.1354644448,
-0.0072677992,
0.3471179307,
0.0375197977,
0.4989185929,
-0.3026139736,
-0.1154116318,
-0.1929936558,
-0.2688210011,
-0.1742164344,
0.0781139433,
0.2036478668,
-0.2888613045,
-0.2173532397,
0.0515048094,
-0.1161352172,
-0.0403539352,
0.0860865489,
-0.3470904529,
0.3549284339,
0.0275554601,
0.0275922306,
-0.2921553254,
-0.3815270662,
0.1133364737,
0.0050598686,
0.7152578831,
-0.1412917227,
-0.1982316673,
0.1818395853,
-0.6152508259,
0.1812921762,
0.0240408797,
0.3918981254,
0.1309016347,
0.0447120778,
0.1315590441,
-0.2936674058,
0.5625485182,
-0.2596134543,
0.0218202639,
0.3942944109,
-0.0488949902,
-0.248400867,
0.1503466517,
0.0803656653,
0.5243752003,
-0.1954709589,
0.2850284874,
-0.020366719,
-0.1341272891,
0.0474236533,
0.3616244495,
-0.2078998685,
-0.5691263676,
-0.2100686431,
-0.1369137317,
-0.1960625648,
0.1672901064,
0.0506859869,
-0.1484781802,
-0.0989841819,
-0.0793979615,
-0.4353749752,
0.3044627607,
-0.0492163971,
-0.2059289962,
0.0309127066,
-0.0521688424,
0.4565043151,
0.0107048983,
-0.2476539165,
-0.16799061,
0.4879387617,
-0.1882152408,
-0.2456015348,
-0.1580663323,
-0.0051015564,
0.4487924576,
0.2274591327,
0.0468066931,
0.2421492636,
0.0288117584,
0.0678720549,
-0.5434040427,
0.0580656454,
0.1293226182,
-0.0768530741,
-0.6611810923,
-0.6796527505,
0.5924069285,
0.4728294313,
0.0690128431,
0.4679060578,
0.0373832397,
-0.1862163693,
0.3434480727,
0.2481504977,
0.8984996676,
-0.3707826734,
0.2124948949,
-0.3760992587,
0.1162078455,
0.2998489141,
-0.3049740493,
0.0756968632,
-0.3092540801,
-0.3410373032,
0.0316977352,
-0.1626029164,
0.1744957864,
0.3247881234,
0.0713595226,
0.2498452216,
-0.0499540605,
-0.0841629058,
-0.0228541587,
-0.1055413559,
-0.0549488887,
-0.5814418197,
-0.1364499629,
0.1379917115,
-0.0684121624,
0.1358139217,
-0.1396817565,
0.2095082998,
0.2830488682,
-0.1300168037,
-0.4388832748,
-0.0014410296,
-0.2389286608,
-0.2830254734,
-0.1929849982,
-0.1482585669,
-0.0205201264,
0.0289844126,
0.5220216513,
0.5669854283,
0.0151478276,
-0.101706855,
0.144986853,
0.1029070467,
-0.0549155585,
0.1144180596,
0.0950661972,
-0.087657325,
0.0644193441,
-0.0018638226,
-0.3893854618,
-0.169649452,
0.1456437707,
-0.0497543141,
0.1266862154,
0.0535050668,
-0.3307954073,
0.1241158098,
0.2743763328,
-0.0897078365,
0.083544068,
0.3032917976,
-0.000567014,
0.2926298976,
-0.1984927058,
-0.3364449143,
0.00168111,
0.2342016101,
0.1770997792,
-0.2752555907,
0.2237225473,
0.2338780612,
-0.2575757802,
-0.1063043475,
0.1724001169,
-0.0763131082,
-0.3368684649,
0.1599054933,
0.1280329078,
0.2558526397,
-0.1217141673,
0.1438897252,
0.0312530138,
-0.186990276,
0.0978012756,
-0.2196780294,
-0.5614850521,
-0.0840026438,
0.0762472376,
0.1519247293,
0.5885524154,
-0.3070672452,
0.1264451891,
0.3701988757,
-0.2179432958,
-0.010918024,
0.0840468258,
0.0907298028,
0.1064975932,
0.2765711546,
-0.0261672866,
-0.1470149904,
-0.0235526711,
0.0801506937,
0.0814551711,
-0.2511889637,
-0.0210666452,
0.1889359951,
-0.1097428426,
-0.0278192721,
0.2378380299,
-0.199259609,
-0.3205326498,
-0.3503120542,
0.0754180774,
0.3556347191,
-0.1250248104,
-0.2205462307,
0.3059661686,
0.1924343556,
-0.3947244287,
0.3645472825,
0.1125158444,
0.1303453147,
-0.1061447933,
0.1755120903,
0.2099292278,
-0.0145889679,
0.122322768,
-0.165209949,
0.2344042957,
-0.0214200299,
0.1516186893,
-0.2099455297,
0.107414782,
0.1961650252,
0.2712398469,
0.1962306648,
-0.0628974736,
0.0937997699,
0.3183846772,
0.1273358166,
-0.2558270097,
-0.1813250631,
0.1610769928,
-0.0221008658,
0.1044316739,
0.2958102226,
0.2726112008,
0.1973698288,
-0.1681462973,
0.2517394423,
0.2223004401,
-0.4465557337,
0.0478885099,
0.2298189551,
0.1601934582,
0.1691001207,
0.2685851455,
0.3256413043,
0.0999971852,
0.3341899514,
0.3340489864,
0.5820024014,
0.398899287,
0.0812576711,
-0.2637982368,
-0.6308769584,
0.3162616491,
0.0625254437,
0.241230011,
0.3569069207,
-0.0555265024,
0.2297917902,
0.0353861712,
-0.170692578,
-0.1988726258,
0.1212287769,
-0.1375642419,
-0.1665377021,
0.3772591949,
0.0165349152,
0.3176463842,
0.1049214303,
-0.0418568179,
-0.0992720425,
0.2685160339,
0.0013304806,
0.1823673248,
0.1183916852,
0.1652446091,
0.0600970834,
0.2857717872,
-0.183423683,
0.1760759503,
-0.0436939523,
0.0471840799,
-0.1334075779,
0.5387241244,
0.2672434449,
0.3809128404,
-0.124164708,
0.1615903974,
-0.1029653326,
0.0101561695,
-0.0124834655,
0.2942134738,
-0.0430895239,
-0.0743367225,
0.1786456555,
0.0455707498,
-0.0442041382,
0.2325779796,
-0.1303554922,
0.385547936,
-0.1641395837,
0.3359884024,
0.0904146433,
-0.2982100546,
-0.1875429451,
0.2061237991,
-0.2436429411,
0.1571837813,
0.7409971356,
-0.3596803546,
-0.1059648097,
-0.0848392025,
0.0538698472,
0.1989264041,
0.442160815,
0.3787408173,
0.0970765352,
-0.129815191,
0.0690915287,
-0.3757621348,
-0.1561979353,
-0.104411006,
0.2584378123,
-0.2027388364,
-0.1442377865,
0.1973620206,
0.3004539907,
-0.0320043415,
-0.2971873879,
-0.001405614,
0.4319017529,
-0.2911930978,
-0.1324738562,
-0.2300366163,
0.0653185025,
0.0283208415,
-0.4767261446,
0.1169423312,
0.1917360723,
-0.1106870398,
0.035242755,
0.070424363,
0.1664671451,
-0.0603745729,
0.4525505304,
0.0339961275,
0.1825512052,
-0.1279180199,
0.005865139,
-0.3119244576,
-0.0759389326,
-0.2287694216,
0.2396230847,
0.0511366986,
-0.1284497678,
-0.5494624376,
-0.3066654205,
-0.1070032418,
-0.2587786019,
-0.2332359701,
0.0391210169,
-0.3262361586,
-0.2682568431,
-0.1688869447,
-0.0569061935,
0.2241004407,
0.1854245067,
0.0212510079,
0.0982696638,
-0.2764484286,
-0.2764076591,
0.4450548887,
-0.1166563705,
-0.3241905272,
-0.2345123142,
0.0578571185,
0.0800358355,
-0.2177997828,
-0.3854014874,
0.1555531472,
0.2995448112,
-0.1309606433,
0.2152192295,
0.3185411096,
-0.3890827298,
0.1024346054,
-0.2206640989,
0.6346166134,
-0.2192077041,
0.0336231291,
-0.4068102241,
-0.3738468289
] |
https://github.com/huggingface/datasets/issues/1776 | [Question & Bug Report] Can we preprocess a dataset on the fly? | Hi @acul3,
Please look at the discussion on a related Issue #1825. I think using `set_transform` after building from source should do. | I know we can use `Datasets.map` to preprocess a dataset, but I'm using it with very large corpus which generates huge cache file (several TB cache from a 400 GB text file). I have no disk large enough to save it. Can we preprocess a dataset on the fly without generating cache?
BTW, I tried raising `writer_batch_size`. Seems that argument doesn't have any effect when it's larger than `batch_size`, because you are saving all the batch instantly after it's processed. Please check the following code:
https://github.com/huggingface/datasets/blob/0281f9d881f3a55c89aeaa642f1ba23444b64083/src/datasets/arrow_dataset.py#L1532 | 22 | [Question & Bug Report] Can we preprocess a dataset on the fly?
I know we can use `Datasets.map` to preprocess a dataset, but I'm using it with very large corpus which generates huge cache file (several TB cache from a 400 GB text file). I have no disk large enough to save it. Can we preprocess a dataset on the fly without generating cache?
BTW, I tried raising `writer_batch_size`. Seems that argument doesn't have any effect when it's larger than `batch_size`, because you are saving all the batch instantly after it's processed. Please check the following code:
https://github.com/huggingface/datasets/blob/0281f9d881f3a55c89aeaa642f1ba23444b64083/src/datasets/arrow_dataset.py#L1532
Hi @acul3,
Please look at the discussion on a related Issue #1825. I think using `set_transform` after building from source should do. | [
-0.4329630733,
-0.1497626305,
-0.0210899822,
0.0117293578,
0.4850178361,
0.2730878592,
0.3065050244,
0.2762750685,
-0.1747132987,
0.1026610509,
0.098205395,
0.1963545233,
-0.0868418962,
0.246045053,
0.2638713121,
0.1422840804,
0.2081042677,
0.0898797959,
-0.0966305137,
0.187596783,
-0.295986861,
-0.1425745338,
-0.0633271113,
-0.1839762181,
-0.469417721,
-0.2427726537,
-0.1292231381,
0.0019165516,
-0.1816211194,
-0.2031061798,
0.2927233577,
0.2324054986,
-0.0148587385,
0.4824580252,
-0.0001141936,
0.0488190353,
0.412786454,
-0.1013960466,
-0.1420306563,
-0.1252628714,
0.1022017524,
-0.3030609787,
-0.134837538,
-0.2586304843,
-0.1555446982,
-0.1020513326,
0.0397008546,
-0.6355348825,
0.432135731,
0.1466099322,
0.2200482488,
0.1474145949,
-0.0451228656,
0.1245692372,
0.261100173,
0.3140592873,
-0.382160008,
-0.1072559953,
0.180837065,
0.0386674479,
0.0378094912,
0.1519305557,
-0.3269193769,
0.0053006955,
0.3591572344,
0.1101513132,
-0.236342296,
-0.5635487437,
0.1477529258,
0.2872587442,
0.4784780741,
-0.5608301163,
-0.7194268107,
-0.2661271989,
0.1451827288,
-0.3385508358,
0.1005583927,
0.415474534,
-0.1705152392,
0.0658450201,
-0.4523689449,
-0.4309619963,
0.0252116527,
-0.3683647811,
0.2405143231,
-0.1445683688,
-0.2335284352,
0.0204998422,
0.0057091685,
0.1899291426,
0.4107082188,
-0.218843475,
-0.3381605744,
0.4355345666,
-0.2185555249,
-0.2187633663,
-0.2661304474,
0.0814249814,
0.2457327247,
0.1398302764,
0.0155078443,
-0.1161651835,
-0.0325907581,
-0.0893719643,
0.1360760629,
0.1203239486,
-0.0844901279,
-0.1408301592,
0.2896369696,
-0.2251354009,
0.095000267,
-0.098081097,
0.0825611129,
-0.4091347158,
0.3306638598,
0.1045780629,
0.3203133643,
-0.3002015054,
0.3989453316,
0.0140087223,
0.1325963736,
0.0150180692,
-0.3814519942,
0.1457345933,
-0.1104526594,
0.0512312949,
0.1466380358,
0.1422730386,
0.0613344163,
-0.1713287681,
-0.1215859503,
-0.0579743013,
-0.0176574979,
0.3037646115,
0.1017586514,
-0.2035064101,
0.0960329175,
0.1968316585,
-0.0693057328,
-0.1474776119,
0.1593563706,
-0.4074445963,
0.1773693264,
0.3492158949,
-0.0258463621,
0.089580223,
-0.0435275137,
0.3530143499,
-0.1998039782,
0.5373976231,
-0.135440886,
-0.3122021556,
0.0356283151,
0.0945883021,
-0.0531801023,
0.03737377,
-0.5619781613,
0.1426611841,
0.6161592603,
0.2149140984,
0.2612343729,
0.1844772249,
-0.2494731843,
-0.1610205472,
0.1391242296,
0.4578094482,
-0.242422536,
0.1542512327,
0.3046620786,
0.0511817299,
0.1385350078,
0.0961020589,
-0.028949935,
0.2064511031,
-0.0387378782,
-0.1997521371,
0.3259774745,
-0.0721959174,
0.0467534438,
0.3394367695,
-0.0908211768,
-0.2645244598,
0.0823536962,
0.1384712905,
-0.0276601277,
-0.0962674394,
-0.054836113,
0.4266059995,
-0.0195709951,
0.2360436618,
-0.1810709983,
-0.44252792,
-0.2827942669,
-0.0746696591,
0.0176093373,
0.137852028,
-0.1969928443,
-0.2738490403,
0.0570901968,
-0.182134673,
0.2325854301,
0.3486989737,
-0.0456055962,
0.0465127975,
0.0585951209,
-0.1447850466,
-0.3847305775,
0.2210921943,
-0.1042703241,
0.0422118939,
0.1136273593,
-0.4316210151,
0.1256342679,
0.1094217598,
0.0725461319,
0.1065261737,
0.0396176465,
-0.3019028902,
0.2947497964,
-0.0410907753,
-0.4444381595,
0.2486056536,
-0.1694126278,
0.1128234938,
-0.4200753868,
-0.0761256889,
0.1506419927,
-0.0647381246,
-0.0618649796,
-0.1236237139,
-0.1879747361,
-0.0074728997,
-0.1552285403,
0.3102421463,
-0.1509394795,
0.2376551479,
-0.083366096,
0.1479145139,
-0.1031505167,
-0.2216741592,
0.0134709906,
-0.1461160928,
0.1204979345,
-0.1898350269,
-0.237429738,
0.240559265,
-0.1254413277,
0.4528132081,
-0.0244470313,
-0.1067398712,
0.1965593994,
-0.0574268848,
-0.0650349408,
0.0989397094,
-0.046994593,
-0.0435778201,
0.7283754945,
-0.0893420875,
-0.0646386147,
-0.0855535045,
0.071688354,
0.0146108847,
-0.0450500958,
0.2503602207,
-0.1430050135,
-0.1239447221,
-0.2058185488,
0.11238987,
0.2271232754,
0.1460503638,
0.0281830877,
0.2094623297,
0.0540079176,
-0.1065890864,
0.3312437236,
0.0195440892,
0.4602996409,
-0.0285262894,
0.2461504638,
0.1056513339,
-0.215244025,
0.2044367343,
0.085165821,
0.0561344214,
-0.1728530675,
0.1126301661,
0.155061245,
-0.0694650337,
0.0361561291,
0.0005297039,
-0.2245989591,
0.0833591893,
-0.1207844764,
-0.0309182722,
0.024062505,
0.0583939552,
-0.4411793351,
0.3388664126,
0.0531034283,
-0.1855518371,
-0.185367465,
-0.2100473046,
0.2090857178,
0.0030894482,
0.1911825389,
-0.1702626497,
0.4499084353,
-0.0654062703,
0.0290904902,
-0.2961730957,
0.1470840275,
0.0948986933,
-0.0052770535,
0.3585245311,
0.0148649747,
0.0273948703,
0.2091139704,
0.1998991817,
0.0595946722,
-0.1688086689,
-0.1806280613,
-0.2080810517,
-0.056435056,
0.0179907568,
-0.1513291895,
-0.0069002411,
-0.0297330078,
-0.2902208567,
0.131775558,
-0.0271704197,
0.0225431751,
0.2314045578,
0.0408413298,
-0.1508440673,
-0.060904108,
0.0651346892,
-0.0411669724,
-0.6186642647,
0.3016768694,
-0.0587814115,
-0.3465434015,
-0.0441341475,
-0.0279055722,
0.0178735536,
0.3690831065,
-0.6034704447,
0.0759538561,
-0.4336879551,
0.078758657,
-0.1546197832,
0.1942056119,
0.3209497035,
0.134301737,
-0.0956200734,
-0.0347256251,
-0.1735880375,
0.0148209045,
-0.1583307534,
-0.0087435367,
0.2583471835,
0.4254816175,
-0.0141153559,
0.7667753696,
0.1563381553,
-0.0408220142,
0.3145268559,
0.0177238528,
0.5878831744,
-0.356418699,
-0.1258503646,
-0.1813509762,
-0.2166438103,
-0.1491371989,
0.071843721,
0.2537595332,
-0.2575012743,
-0.2045567632,
0.0701102391,
-0.1112940609,
-0.1172045022,
0.1579770893,
-0.3516555727,
0.2993708551,
0.0467632897,
0.1009600088,
-0.2630334795,
-0.3549569845,
0.1259234846,
-0.0599191226,
0.6850693226,
-0.1539003253,
-0.1800369769,
0.1375825405,
-0.6912072301,
0.2251764536,
0.0109914774,
0.2751891911,
0.1694922894,
0.012462059,
0.0676197931,
-0.3236369193,
0.5596726537,
-0.2098635435,
-0.018577924,
0.39164868,
-0.0410808921,
-0.3185816109,
0.1438380033,
0.0832033232,
0.5215530396,
-0.1703879982,
0.2730245292,
-0.0799726993,
-0.1630998999,
0.1364083737,
0.4082418382,
-0.2205162644,
-0.4579713643,
-0.2055648565,
-0.2104369253,
-0.2233047783,
0.1625538468,
-0.0004979323,
-0.1777329296,
-0.1616406888,
-0.110822089,
-0.3879926205,
0.2419282943,
-0.1016709656,
-0.1816687286,
0.1594801992,
-0.0070231296,
0.5028968453,
0.0914541259,
-0.1354881078,
-0.046701286,
0.6026399136,
-0.1695323288,
-0.1621045023,
-0.1636357903,
0.0054739658,
0.3667347431,
0.3100364506,
0.028796941,
0.1405537874,
0.0074565713,
0.1056366265,
-0.5073131919,
0.060098514,
0.131506592,
-0.0806747898,
-0.560320437,
-0.6287382841,
0.6531296968,
0.3827989697,
0.0311171599,
0.4319266081,
0.1165405959,
-0.1684406847,
0.3139210343,
0.2665284574,
0.8644784093,
-0.346803546,
0.2490420491,
-0.2838605046,
0.0972331837,
0.3066903949,
-0.2182270586,
0.0343564562,
-0.3303466141,
-0.3620763719,
0.0688374266,
-0.1925000548,
0.1141515523,
0.2670464814,
0.0511517935,
0.235942468,
-0.0958777368,
-0.1219235361,
-0.1197627038,
-0.0817143545,
-0.1360371858,
-0.6008028984,
-0.1783627272,
0.1515985131,
-0.0468026958,
0.1319124252,
-0.1145197004,
0.2092532665,
0.1811385602,
-0.1507105231,
-0.4558628201,
0.0270152912,
-0.2561565638,
-0.2469818741,
-0.1386921108,
-0.2268923968,
-0.06806577,
0.040602088,
0.5350573063,
0.4937662482,
-0.0453581512,
-0.0554351211,
0.1498515159,
0.139345929,
-0.0006827216,
0.104004845,
0.1361525953,
-0.0553035177,
0.0626222342,
0.0052339467,
-0.3632958829,
-0.1164646,
0.1880639046,
-0.1644738764,
0.0754113197,
-0.0557454154,
-0.2545490265,
0.0733778924,
0.2466441542,
-0.1198311523,
0.0957561806,
0.2751672864,
0.0035111008,
0.2970243692,
-0.1572024822,
-0.3641900718,
-0.0224305,
0.2522278726,
0.1832284033,
-0.2786246836,
0.3542683125,
0.1972771585,
-0.2224345654,
-0.1341265589,
0.1842359602,
0.0182398763,
-0.4513963461,
0.2480623424,
0.1262969375,
0.1829120219,
-0.1139216349,
0.1716470271,
0.0206690729,
-0.1863152534,
0.1057582349,
-0.16074875,
-0.5908617973,
-0.0775448009,
0.137988016,
0.2136131376,
0.4876227379,
-0.3452978432,
0.1147184074,
0.3632789254,
-0.2515029609,
-0.0527471565,
0.0716379508,
0.1376983672,
0.0814593434,
0.2629787028,
0.0363622047,
-0.1899966449,
-0.0067939949,
0.0413635746,
0.00509432,
-0.2564019859,
-0.0651596114,
0.1668858528,
-0.1567249745,
-0.0877524838,
0.1447249502,
-0.1997512281,
-0.2308961898,
-0.4138133526,
0.1614040136,
0.3609609604,
-0.107685186,
-0.2222439796,
0.2847191691,
0.1251553148,
-0.3574776947,
0.2958548367,
0.0576339513,
0.143090561,
-0.1466938257,
0.1799290478,
0.1828741878,
-0.0703941956,
0.0689475015,
-0.1754452288,
0.2120847851,
0.0560050793,
0.1681277752,
-0.2220021486,
0.0552007817,
0.2648108304,
0.3314077854,
0.1910045743,
-0.0749560446,
0.0767024755,
0.2916676104,
0.1731110066,
-0.260394901,
-0.164877072,
0.0726813078,
-0.0823380575,
0.1157801971,
0.2786783874,
0.2320000678,
0.1014921293,
-0.1081488505,
0.2868593037,
0.1727775335,
-0.4057710469,
0.0897596851,
0.2512678802,
0.1278174222,
0.1547181308,
0.3263250887,
0.3106881082,
0.1880294979,
0.3593752384,
0.2982603908,
0.5835421085,
0.3375903368,
0.0854639187,
-0.2475428432,
-0.6166618466,
0.2919546664,
0.012683535,
0.2537061572,
0.3417037725,
0.0011656779,
0.2255642563,
0.0410304517,
-0.2557654679,
-0.2489863932,
0.144586876,
-0.1577440947,
-0.1740818322,
0.3542082906,
0.0349887237,
0.3517547548,
0.1345757097,
-0.0684279501,
-0.0899404585,
0.3206824362,
0.0430109762,
0.1703484803,
0.1047033742,
0.224706918,
0.0074587483,
0.3076194525,
-0.1570517421,
0.1943329722,
-0.0012038398,
0.03919347,
-0.0729847327,
0.5906713605,
0.3127561212,
0.3928546011,
-0.1074756905,
0.1859052032,
-0.0150373969,
-0.0197709259,
-0.0328729004,
0.2742160857,
-0.0866412818,
-0.1349048316,
0.1934504956,
0.0645883754,
-0.0940358564,
0.1881127656,
-0.1571761966,
0.3570964336,
-0.1075853407,
0.3226364553,
0.0969846845,
-0.3717991114,
-0.2190296799,
0.1861294359,
-0.185323894,
0.129869774,
0.7191511393,
-0.3829756975,
-0.066141963,
-0.1163970754,
0.0697057247,
0.2253584862,
0.5203014612,
0.3859865963,
0.0675293729,
-0.1704457104,
0.0798051506,
-0.3966829777,
-0.1173792854,
-0.1092894599,
0.2891941369,
-0.1593008041,
-0.0939623415,
0.1794188023,
0.2901894748,
-0.0023135606,
-0.3146266341,
0.0482031889,
0.431145817,
-0.2662267089,
-0.2024326473,
-0.1907080859,
0.0574132353,
0.0234136488,
-0.534294486,
0.1379930079,
0.135262087,
-0.0791160762,
0.0726099014,
0.1056386754,
0.1728837788,
-0.0099300211,
0.4256457686,
0.071387589,
0.1645061076,
-0.1374815851,
-0.0105165821,
-0.3001010716,
-0.1640689373,
-0.2427420467,
0.1930493265,
0.0539636761,
-0.0371851288,
-0.4960955977,
-0.2699706852,
-0.1496704966,
-0.2413803935,
-0.1611330509,
0.1025707051,
-0.3433539271,
-0.1769255847,
-0.1870297492,
-0.0430504642,
0.1983017772,
0.2129072398,
-0.0182537865,
0.1253941059,
-0.3085354865,
-0.3872485459,
0.589802146,
-0.1565363109,
-0.3682811558,
-0.2112174034,
0.1110895276,
0.0912110433,
-0.2258027643,
-0.3942165077,
0.2338774055,
0.2611790299,
-0.1221781448,
0.1215259507,
0.2710576653,
-0.3783170581,
0.0823224857,
-0.2273857445,
0.6979739666,
-0.225420326,
-0.0171110649,
-0.4264145195,
-0.2989899516
] |
https://github.com/huggingface/datasets/issues/1775 | Efficient ways to iterate the dataset | It seems that selecting a subset of colums directly from the dataset, i.e., dataset["column"], is slow. | For a large dataset that does not fits the memory, how can I select only a subset of features from each example?
If I iterate over the dataset and then select the subset of features one by one, the resulted memory usage will be huge. Any ways to solve this?
Thanks | 16 | Efficient ways to iterate the dataset
For a large dataset that does not fits the memory, how can I select only a subset of features from each example?
If I iterate over the dataset and then select the subset of features one by one, the resulted memory usage will be huge. Any ways to solve this?
Thanks
It seems that selecting a subset of colums directly from the dataset, i.e., dataset["column"], is slow. | [
-0.2726210356,
-0.384242624,
-0.0938194096,
0.3328417242,
-0.064883627,
0.0687172934,
-0.0869262218,
0.2765877843,
0.1568151861,
0.1853519678,
0.1041570455,
0.096872665,
0.0757732168,
0.1713014692,
0.0594493337,
0.0244091898,
-0.1179830208,
0.2368058562,
-0.1938431859,
-0.0943647474,
-0.3235395849,
-0.3371297717,
-0.3414104879,
-0.4139211774,
-0.0448211208,
-0.2763502002,
-0.0030553115,
-0.0701161325,
-0.1004957631,
-0.2022735476,
0.064909935,
-0.105920352,
0.1723704785,
0.1313781291,
-0.0001110768,
-0.3096607029,
-0.0061719716,
-0.0167971849,
-0.2181176692,
0.2127899826,
-0.4324008524,
-0.1536877602,
-0.2096732259,
-0.4574201703,
0.0789364427,
-0.1935445815,
0.0418518782,
-0.3434141874,
-0.3945267797,
0.0019654441,
0.1722189337,
0.3632742167,
-0.4281519949,
-0.2193820626,
0.1636475623,
0.202066347,
-0.1860643625,
-0.1688095033,
0.3972516656,
-0.0317175463,
0.110510394,
0.1986815333,
0.0027408882,
0.0643333569,
0.4581539035,
-0.0933370292,
-0.2695299089,
-0.0912528485,
0.2907188535,
0.3570753038,
0.7055130601,
0.0142394472,
-0.0204159636,
-0.2548286915,
-0.114691332,
-0.4821659029,
-0.0554719456,
0.209776029,
-0.1812405884,
0.1794071496,
-0.3754856586,
-0.2821711302,
-0.1214112863,
0.1009943187,
0.2251812965,
-0.1510584056,
0.0702474639,
0.0095483223,
0.5192241073,
-0.2228608727,
0.2806360424,
-0.1883520633,
0.0423956513,
0.1281942874,
-0.5794631243,
-0.3097939789,
-0.1118838489,
-0.0624920465,
0.3452714384,
0.1076843068,
0.081512101,
0.0904843882,
0.2307038009,
0.0643644109,
0.3840841055,
-0.1338303983,
-0.1883255392,
0.1345578283,
0.1456446946,
-0.1606633663,
-0.0020948125,
-0.090780966,
-0.2182658166,
0.0937924087,
0.2085402459,
-0.4199843705,
-0.1569329798,
-0.1290027648,
-0.1494206339,
-0.1261436045,
-0.1378622502,
-0.0162504259,
-0.0246442575,
0.4202544093,
0.0619460307,
-0.1889307797,
-0.4265066683,
-0.0111109577,
-0.2233894765,
-0.2640574276,
-0.2986492217,
0.2844234407,
-0.0498714931,
0.0189673696,
0.0652076453,
0.1994221807,
0.154055804,
-0.1386212558,
-0.1547175795,
-0.1392388344,
0.0547332913,
-0.3360628188,
0.2683525681,
-0.0082827164,
-0.135843873,
-0.0077020531,
-0.0597724542,
0.3361250758,
-0.3245050609,
0.2191703767,
0.1463290751,
-0.5682114959,
0.1834122986,
0.0710726604,
0.0017381518,
-0.0667317361,
-0.3420162797,
0.4201233387,
-0.0989890993,
0.4257790744,
-0.0995340869,
0.070647575,
-0.3074535429,
-0.1526207775,
0.3723747432,
0.4698697329,
-0.3293993771,
0.0510871895,
0.1202648804,
0.1393199414,
0.3856442273,
0.4193017781,
-0.2203957438,
0.1525847316,
-0.1224394962,
0.0959466547,
0.190254733,
0.182003811,
-0.502599299,
0.3416081965,
0.1080680639,
0.07228937,
0.2504363358,
0.5023418665,
0.0730347261,
0.0638116151,
-0.129810065,
0.3935355842,
-0.2775792778,
0.1868897229,
-0.0036724138,
-0.3479521275,
0.2195584923,
0.0396699496,
0.2890776992,
0.2412095666,
-0.008328462,
0.0443272553,
0.285730511,
-0.3043044806,
-0.150611341,
0.1334233433,
0.5146899819,
-0.0039332365,
-0.0409265533,
-0.3039369881,
-0.3744558096,
0.2273036391,
0.4574956894,
-0.5265105367,
0.3239098191,
-0.1340289712,
0.1073582619,
0.0188047979,
0.1776630431,
0.1412483752,
0.0175360981,
-0.0444856882,
0.2947909534,
-0.4913444519,
-0.2310363799,
0.0905999467,
-0.304867357,
-0.1007343829,
-0.2995918691,
-0.0163096562,
0.5265926719,
0.0019099499,
0.21377635,
-0.0286798663,
-0.0328832567,
-0.2907179296,
0.1498335153,
0.1483506113,
0.3771876693,
-0.0658316165,
0.1169125065,
0.3529290855,
0.0880185962,
-0.1726697087,
0.0474599637,
-0.3250954747,
0.2133402824,
0.0310354792,
-0.210538879,
0.1571555436,
0.0987471566,
0.519926548,
0.2963037789,
-0.0036352351,
0.0279970653,
-0.0309290234,
0.2764965296,
0.0714424476,
0.1936666965,
0.173686102,
0.1350107342,
0.3530489504,
-0.6447683573,
0.0454972275,
0.1994259804,
0.0886543617,
-0.0918917507,
0.0251975674,
-0.1220786124,
0.0939575583,
0.1217486858,
-0.3537805676,
-0.0296609327,
0.0877935216,
0.0354813375,
-0.1350250393,
0.0879066512,
0.1048286483,
0.1275730431,
0.2802191973,
0.3064312637,
-0.3647535443,
-0.0424481742,
-0.2706398964,
-0.1003276557,
0.0671238303,
0.0494890921,
0.1145843863,
0.0018405565,
0.0724697709,
-0.3552097976,
-0.1168475449,
0.2057605386,
0.3313175142,
0.2393417358,
-0.110475041,
-0.112465553,
0.5158167481,
-0.0581073277,
-0.1062868088,
-0.1323308051,
0.5061991215,
-0.0120505011,
0.0168137811,
0.1103373617,
-0.0603424534,
-0.0699994564,
0.0045811664,
0.354658097,
0.1378186792,
0.3736890554,
0.12142355,
-0.1678831875,
-0.4728030264,
0.1906894445,
0.1277216375,
0.2162526399,
0.083569169,
-0.1990767121,
0.1286506057,
-0.3519138992,
0.1047186404,
-0.1672061682,
0.1980486959,
-0.0278879143,
0.0853996947,
-0.0343409777,
-0.0196800865,
0.3902204037,
-0.320862323,
-0.2228167653,
-0.2923350036,
0.3292639852,
0.0246352851,
0.2442334145,
-0.0116651207,
0.0537038147,
-0.2610080838,
-0.0664391741,
0.0236434955,
0.058667589,
-0.1673666835,
0.2899854481,
-0.072057873,
-0.1938502491,
-0.0757571682,
0.0666711926,
-0.0286640134,
0.5141794682,
-0.4075914621,
0.0645167679,
-0.5274324417,
-0.0467713848,
-0.1802235693,
0.034719158,
-0.0563658588,
-0.2087925971,
-0.0364184305,
0.0583291538,
-0.0273863338,
0.201537624,
0.1771994978,
0.05472745,
0.3681702614,
0.1776548624,
0.2260531187,
0.2913785875,
0.3049385846,
0.2829529941,
0.2341085523,
-0.0918733105,
-0.1326287389,
0.075549759,
-0.0428375751,
0.2239382565,
-0.1186181456,
-0.2447641641,
0.2743475139,
-0.1057319716,
-0.2245055288,
-0.0041373447,
-0.0618052557,
0.0859005973,
-0.1929442436,
0.252365917,
0.0101645421,
0.2669515908,
0.1592274159,
-0.0574015118,
-0.3361459076,
0.0413212068,
0.0789016113,
-0.3824480176,
0.3009423018,
0.0097932415,
-0.6226491332,
-0.1496894956,
-0.315005511,
-0.0049219928,
-0.1470126063,
0.3232966363,
0.1405626088,
-0.3313433826,
0.035827104,
0.2714029551,
0.5188842416,
0.2771602869,
-0.1971919239,
-0.0996636301,
-0.606325388,
-0.004660029,
0.1985524893,
-0.338318646,
0.4118951857,
-0.0864852518,
0.1271383315,
-0.1311615109,
-0.3343246281,
0.3492302895,
0.5830068588,
-0.187855348,
-0.1890679449,
0.2267916501,
-0.2329861522,
-0.0603498183,
0.2388965338,
0.2808482051,
0.0524782501,
0.2656183243,
-0.0532161221,
-0.3900204897,
-0.0699556842,
0.4186626375,
0.1585328579,
0.0948844925,
-0.0974436402,
0.3590678275,
0.0423908681,
-0.0083675925,
0.4233680367,
0.5041761994,
0.2458582073,
-0.4154841304,
0.0452451892,
-0.1006386355,
0.7665140629,
0.2695269585,
0.018678192,
0.2186740339,
-0.2198275179,
0.178937465,
-0.3878570199,
-0.1302850246,
0.0250327792,
-0.1545524001,
-0.2564934194,
-0.3809867501,
0.4144181311,
0.0153404381,
-0.0022169584,
0.2992091477,
-0.0444114655,
0.1037930474,
0.0025706794,
0.2479051203,
0.7095934153,
-0.133607313,
-0.1503457874,
-0.1070072651,
0.3820203543,
0.2121769488,
-0.03533227,
0.306155622,
-0.1831868887,
-0.8363987207,
0.0446949527,
-0.1112047732,
-0.0182264056,
0.2377367914,
0.1937702596,
0.4545471668,
-0.0720035881,
0.1075690985,
0.0659200847,
-0.1468535066,
-0.0741962343,
-0.2159578651,
0.0487661436,
0.0783155039,
0.1801820993,
-0.0230883881,
0.0946115702,
0.1520498097,
0.1482015699,
-0.0146761639,
-0.2205898613,
-0.0444680676,
-0.3808140457,
0.0430253595,
0.0243887771,
-0.3118443489,
0.0591274537,
-0.0249102227,
0.0035382831,
0.2777451277,
0.1099119484,
0.0352248065,
0.250372529,
0.1068687141,
-0.1262622029,
0.0785342529,
-0.0459505916,
0.0317994654,
-0.1842191517,
0.1145007983,
-0.0049382327,
0.0529030934,
-0.0910715908,
-0.0822483748,
0.21729289,
0.0548583567,
-0.4014465511,
0.116902329,
-0.1205477118,
-0.1110371351,
0.1151477098,
0.0813660473,
-0.0654049143,
0.4636636972,
0.0919789821,
-0.1415276825,
-0.1286736131,
-0.1442206204,
0.225292936,
0.0965717733,
0.37563923,
0.1870129257,
-0.2087514699,
-0.2521997988,
0.1631617546,
0.3087824881,
0.171421349,
-0.0227551199,
-0.3325638771,
0.1336074471,
-0.0184559617,
0.1659058481,
0.0621697791,
-0.2094887644,
-0.2350201756,
-0.0221909527,
-0.0307510626,
0.3404420614,
0.2304008007,
0.2985272706,
-0.2309799045,
-0.3417857587,
-0.4882930219,
0.4365469813,
-0.2348097414,
-0.0507626794,
-0.3153347671,
0.2696286142,
0.1566268057,
0.3287502229,
-0.1983399838,
-0.0383745991,
0.1348451078,
0.1753710955,
0.0400101468,
-0.1948372722,
-0.0821792185,
0.1031887606,
0.0268354826,
-0.2245438993,
0.0337740295,
-0.2329857349,
-0.3304444849,
-0.4621058106,
0.242794767,
-0.0296161752,
0.1497240961,
-0.0282515828,
0.25597018,
-0.4835479856,
-0.2318073809,
0.37301597,
0.1059624553,
0.1376318783,
0.1328080446,
0.2342756689,
0.3057884276,
-0.151667133,
-0.1500679404,
0.0125362342,
0.0622961745,
-0.1901886314,
-0.1272411495,
0.1784272045,
0.0779715255,
0.3225123882,
-0.132490322,
0.6161224246,
0.2012061775,
0.1732310355,
0.3271649182,
0.2236048728,
-0.1429849863,
-0.4484680593,
0.0136412093,
-0.2504253387,
0.187343806,
0.5648921132,
0.2223633975,
0.2721701562,
-0.1308402419,
-0.36729002,
0.1098505631,
-0.0540546626,
0.0232722331,
0.2495568246,
0.2116695344,
-0.4596951902,
0.0172508657,
0.5931332707,
0.4760162532,
0.5107027888,
-0.0848306939,
0.3243481517,
0.2221826315,
0.1353189051,
-0.121624507,
-0.6607635617,
-0.0843940079,
0.4037324488,
-0.0318578668,
0.0155976564,
-0.1882159859,
-0.4264805019,
0.0212305468,
-0.1018529534,
-0.2572140694,
-0.0009442555,
0.0771643147,
-0.1222025454,
-0.0241954084,
-0.2490434647,
-0.1489127576,
0.2084704041,
0.0189621039,
-0.4960002005,
0.361043781,
0.0067271087,
0.3690362275,
-0.201627031,
0.5517865419,
-0.0104256393,
0.2209770679,
-0.397364378,
0.0490522422,
-0.2184405923,
0.085200429,
-0.0450377129,
0.0911324993,
-0.2329305857,
0.1148799509,
-0.0150887277,
-0.0266085789,
-0.1786055863,
-0.2313800454,
-0.134518221,
-0.2221692801,
-0.2319945842,
0.1745184064,
0.3362201452,
-0.0219491906,
0.0188030098,
0.1220081896,
0.0644326732,
-0.2388847619,
-0.6822425723,
-0.2142415196,
0.1744693518,
-0.2910797894,
0.1559345126,
0.0221106056,
0.0655490011,
-0.2823661566,
0.4207377732,
-0.4660414159,
0.1919428855,
0.5151319504,
0.0926827416,
-0.528908968,
0.470502615,
0.0161604006,
0.0309731998,
-0.2906501889,
-0.2319732606,
-0.0849877,
-0.06963972,
-0.4132070839,
-0.1349157095,
0.5719473362,
0.4682939053,
0.0096733589,
0.1252075583,
-0.079814814,
0.0434406586,
-0.0545617528,
0.4297471046,
-0.240033716,
-0.4153183401,
0.0612086058,
0.2196920216,
0.0498349071,
-0.3647940457,
0.4084434509,
-0.2142224163,
0.0282030571,
-0.137608856,
0.0682930797,
0.2423675209,
0.1012115777,
0.2061182708,
-0.1186035722,
-0.0502856858,
0.0660859421,
-0.0480228439,
0.0322184451,
-0.0795102343,
0.0072773872,
0.1419920772,
-0.0371356569,
0.0833228827,
-0.2190542519,
0.3915693164,
0.0881102309,
0.1482819468,
-0.0699859411,
-0.1448043138,
0.070467785,
0.0794522539,
-0.1418894231,
0.3347403407,
0.2606511414,
0.100375101,
-0.2480084449,
-0.0457482971,
-0.0300719589,
0.0121019054,
0.1946261823,
0.0748129785,
-0.3734343946,
-0.2700418234,
0.163222909,
0.297054857,
-0.0165147837,
-0.1167202815,
-0.0852267146,
0.3182209134,
-0.252009958,
-0.0121925259,
0.2000527829,
0.0126723517,
-0.2384373993,
-0.0195358656,
0.4232862592,
-0.3153410852,
-0.2699566185,
-0.2308862358,
-0.3392122686
] |
https://github.com/huggingface/datasets/issues/1774 | is it possible to make slice to be more compatible like python list and numpy? | Hi ! Thanks for reporting.
I am working on changes in the way data are sliced from arrow. I can probably fix your issue with the changes I'm doing.
If you have some code to reproduce the issue it would be nice so I can make sure that this case will be supported :)
I'll make a PR in a few days | Hi,
see below error:
```
AssertionError: Requested slice [:10000000000000000] incompatible with 20 examples.
``` | 62 | is it possible to make slice to be more compatible like python list and numpy?
Hi,
see below error:
```
AssertionError: Requested slice [:10000000000000000] incompatible with 20 examples.
```
Hi ! Thanks for reporting.
I am working on changes in the way data are sliced from arrow. I can probably fix your issue with the changes I'm doing.
If you have some code to reproduce the issue it would be nice so I can make sure that this case will be supported :)
I'll make a PR in a few days | [
0.0045193993,
-0.0687454194,
-0.2415331304,
0.0569712296,
0.4289460778,
-0.3012441695,
0.126703158,
0.3713269234,
-0.1317174137,
0.4324043393,
-0.0149546964,
0.765730083,
-0.0799332485,
0.2857099771,
-0.3763239086,
-0.4880154729,
-0.0210640579,
0.1064820215,
0.2514835298,
0.1202102378,
0.055242084,
0.0996664837,
-0.3396669924,
0.1170676127,
-0.1888773739,
-0.1790934205,
0.2490352541,
-0.0215797201,
-0.0056369663,
-0.2691525221,
-0.1261416972,
-0.4162089527,
0.0354161002,
0.1907057166,
-0.0001093078,
0.1138290688,
0.5290837288,
0.0426962785,
-0.2076611966,
-0.050746087,
0.2870479822,
-0.4879580438,
0.2421299368,
-0.2416448295,
0.0444298014,
0.0554977991,
-0.3735235631,
0.010754304,
0.4677681029,
-0.0264655985,
0.2545257509,
0.0062988708,
0.349064827,
0.045964364,
0.0709797964,
0.3102606535,
-0.2072951794,
-0.1372473538,
0.5058740973,
0.4029473662,
0.2683990002,
0.103242442,
-0.0779394656,
0.0405436456,
-0.4270557761,
0.0044291094,
-0.0684797764,
-0.3739690781,
-0.1177274734,
0.5738005042,
0.1728355289,
0.1928465068,
-0.2151762992,
-0.0106725087,
-0.3015366495,
-0.2650508285,
-0.155495286,
0.1012287438,
-0.0972410291,
0.1049899906,
0.0690570548,
0.0057897521,
-0.1316057742,
0.3030083477,
0.2846272886,
0.489672482,
-0.0355275832,
0.1082355529,
0.1635647863,
-0.3503349125,
0.2268581837,
0.1243716925,
-0.0745614395,
-0.0966619179,
-0.1592773199,
-0.0053476533,
-0.5801075697,
0.1688662618,
0.1484343708,
-0.0063064648,
0.3238729835,
0.4233803451,
-0.1502628028,
0.1502196938,
0.2346865535,
-0.063878417,
-0.0861091167,
0.0048741763,
0.1310964376,
-0.1369229555,
0.1043628529,
-0.0289421417,
0.2619710863,
-0.3201715648,
-0.2399542928,
0.0034458686,
-0.0258920845,
-0.0790592805,
-0.0733678192,
-0.2654661536,
-0.3296069801,
-0.0969411954,
0.3133117259,
0.1284627169,
-0.021201225,
0.0965298787,
-0.177913636,
0.2430861443,
-0.1994258314,
-0.1251431406,
0.0082125878,
0.0385230444,
0.1689667404,
-0.4833794832,
-0.0331377424,
-0.2485743016,
-0.005878116,
-0.0048195692,
0.3314137161,
0.0867035091,
-0.1492840499,
-0.014887454,
0.0628197715,
0.0198610201,
0.0747854784,
-0.2142449617,
0.1739360094,
0.0672097057,
-0.0024388314,
0.4090493917,
-0.5157787204,
-0.1685251147,
-0.1478640735,
0.1307653636,
0.445774585,
0.2731145024,
0.2207438499,
-0.1539465785,
0.0057320828,
-0.3226756155,
-0.0811063424,
-0.1813516617,
0.2451285273,
-0.3095431626,
0.2209002376,
-0.3931462169,
-0.3490614593,
0.0853372142,
-0.4180671871,
0.2275343388,
0.2932496071,
0.7705188394,
-0.1812041402,
-0.2930043936,
-0.0307128262,
0.337046653,
0.4182477295,
0.105032675,
-0.245384708,
0.2037250847,
0.0509392768,
-0.1719102412,
-0.3283394575,
0.2673071325,
0.1533446759,
-0.2094569355,
-0.0209725406,
0.1696024388,
0.0461626612,
-0.0351623222,
-0.2500963807,
-0.4086684287,
0.289860785,
-0.0888149738,
-0.0698139071,
-0.1406369358,
0.205048576,
-0.376881212,
0.2609751225,
-0.0919982418,
0.0247559752,
0.0110762296,
0.4300153553,
-0.4044121206,
0.1026901007,
-0.0949772298,
0.1602245867,
-0.192335397,
-0.1811700016,
-0.0422616564,
-0.1741901487,
0.0141707184,
0.1139549613,
0.2723792493,
0.2118365765,
0.1726776063,
0.1438180655,
-0.4210806787,
0.3586549163,
-0.1922205538,
0.0335088037,
-0.033112172,
-0.194982022,
0.0527646579,
-0.1643980891,
0.3395624161,
-0.3022042811,
-0.3105171323,
-0.1181157455,
0.1678342223,
0.2398446202,
-0.1890412122,
-0.2328323424,
0.2748935819,
0.1014761701,
-0.1820400804,
-0.2686283588,
0.0532163605,
0.1615170091,
-0.4648517966,
0.2335284799,
0.2280950397,
0.0137515496,
-0.0216454994,
0.0080416817,
0.2652310133,
-0.5424758196,
0.3630342484,
0.0904719159,
0.2836494148,
0.1975425482,
0.1266444027,
0.065236263,
-0.0316095501,
0.3338300884,
0.1231469065,
-0.1631329209,
-0.1990456283,
-0.1483727098,
0.0126213338,
-0.0037903886,
-0.0754328892,
0.2589484751,
0.2821460664,
0.0397439264,
0.117644012,
-0.0154708568,
-0.4251081347,
0.1360588223,
0.2354197353,
-0.0837448016,
-0.1584737301,
0.2301815748,
-0.335963279,
0.2332281023,
0.4529043734,
0.0288972221,
-0.1256342232,
0.0725973472,
-0.0046528447,
0.0529952347,
0.220635131,
-0.2965286672,
0.0165033601,
-0.0617352501,
0.1354550719,
-0.3268112242,
0.2384212166,
0.0465468168,
-0.84125489,
-0.1915152669,
-0.3362053037,
0.0675206184,
0.0370617136,
-0.2109218389,
0.3076391816,
0.1330839396,
0.1019633561,
-0.0271364842,
0.3244499266,
-0.1016391516,
-0.1711581647,
-0.3002120852,
0.1642320156,
0.1031268314,
0.3488461673,
-0.0832881927,
0.1877926588,
0.0227539558,
0.0295582339,
-0.4092306793,
0.0001538587,
-0.034647543,
0.5563634038,
0.1088163555,
-0.0025662296,
-0.1718283296,
-0.3161522448,
0.182759434,
-0.4125510156,
-0.0562064908,
0.3178082407,
0.0368711166,
-0.2372612804,
0.0107534109,
0.0160019509,
-0.6098568439,
-0.3351959288,
0.3220387101,
0.2363471687,
0.1585870385,
-0.1259809583,
0.1917730868,
-0.1530330479,
0.2735913098,
-0.0746408403,
-0.0318099894,
0.0687903836,
0.1247193515,
-0.1566829085,
-0.1934564114,
-0.1348922253,
-0.1770820469,
-0.116783686,
-0.0765605047,
0.0415164828,
0.1929944158,
-0.302978009,
-0.0505103059,
-0.1226357445,
0.1321016699,
0.3967481256,
0.1560402662,
-0.1027521342,
-0.0566877425,
-0.1804214418,
0.1074580178,
0.0232552122,
-0.1332283467,
0.481172353,
0.3465816975,
0.1279285103,
0.3688399494,
0.2477862239,
-0.1196169034,
0.2847773135,
0.2797138393,
0.0390909836,
-0.1042085588,
-0.2776116729,
0.2276646644,
-0.0037571953,
-0.2275748551,
0.0122457594,
0.0141047928,
0.0418602861,
0.037719816,
-0.2182124257,
-0.4395803809,
-0.176120922,
0.2133847773,
0.0921326727,
-0.0486650243,
-0.1101057604,
-0.1205698699,
-0.2722117007,
-0.2261461467,
0.1058271527,
-0.123703897,
0.447604239,
-0.2446351498,
-0.3568993211,
-0.5452688932,
0.0441708714,
0.5647820234,
0.3321603835,
0.2490006685,
-0.0278464463,
-0.1814687103,
0.0598043315,
0.059417516,
0.6105980873,
-0.2074546367,
-0.3850251138,
-0.105248481,
0.0917271301,
-0.1567699313,
0.2288678139,
-0.1590210795,
0.3620493114,
0.2798974216,
-0.1927831173,
-0.0845235661,
0.0735426843,
0.283246398,
0.2585209906,
-0.050709568,
-0.0452481844,
0.2243755609,
0.2511667311,
-0.1911724359,
-0.0640020147,
-0.0868367329,
0.0999157354,
-0.1130232215,
-0.2351840734,
-0.4449388087,
-0.4831211865,
-0.1476331651,
-0.2586733103,
0.3886400163,
-0.2742812335,
-0.0184734501,
-0.325206846,
0.2851641774,
0.2168978602,
0.259951055,
-0.1063731089,
0.1940313429,
-0.2688566744,
0.0768448338,
0.258160919,
0.0847628564,
0.0405714363,
0.1307296455,
0.0482748896,
0.1561047435,
0.1198094487,
-0.5726235509,
-0.0314530618,
-0.1110069081,
-0.212909624,
0.369769007,
0.4043019414,
0.300557673,
-0.0325878449,
0.4440709949,
-0.1986137182,
0.0789543241,
0.1998645216,
0.45214504,
0.9886343479,
0.1013304219,
-0.1530084312,
-0.0159245413,
-0.0597200952,
0.4266945124,
0.1008193642,
0.166397512,
-0.3995170295,
-0.1502483189,
-0.0319389887,
-0.2249177545,
-0.1185267046,
0.0561291352,
-0.3110298812,
-0.0563963354,
-0.5337849855,
-0.0403968394,
-0.2572264075,
0.0648102537,
0.079650186,
-0.196876213,
-0.3503136039,
0.1315543801,
-0.1524084061,
-0.3069134653,
-0.0183408745,
-0.3018185794,
-0.2096471936,
-0.2561690211,
-0.1240012273,
0.0877362937,
-0.3059894443,
0.4180995822,
0.2314324379,
-0.458601743,
0.2111604959,
0.0515433699,
0.2225203812,
0.0978382528,
-0.1563038081,
-0.0360194854,
0.1318299323,
-0.0493439734,
0.0660980418,
0.2049188167,
0.144484207,
0.0021687811,
-0.112563096,
0.149508357,
0.0704614222,
-0.5966783166,
-0.2847769856,
0.1402311474,
0.1145458445,
-0.2185786366,
-0.222958982,
-0.2625517547,
-0.4028540552,
-0.1619106084,
0.1460352242,
0.2562430799,
-0.0379578434,
0.38832739,
0.5429611802,
0.1784560084,
-0.04049192,
-0.0327425972,
0.1441870332,
0.0696644187,
0.1716312766,
0.3212611079,
-0.2490283698,
-0.1890685558,
0.1801007837,
-0.1816726625,
-0.0541251786,
0.0256878808,
-0.0807539448,
0.0155017274,
0.0634424537,
0.324616313,
0.142408222,
0.4862168431,
-0.4675273001,
-0.3633797765,
-0.2418724597,
0.3637573719,
0.0507293604,
0.1370356083,
-0.2009011507,
-0.0810730681,
-0.2109215856,
0.2939006686,
-0.2792304158,
0.2067289948,
0.0603095591,
0.1292990893,
-0.3833132386,
-0.1093003526,
-0.0650038645,
0.0169277862,
0.0719959587,
0.2888394296,
-0.2490578145,
-0.2088915408,
0.1214206219,
0.0957686454,
0.036979951,
-0.5805706978,
-0.3033238947,
-0.1584571898,
0.0030396667,
-0.1595591456,
-0.4319696426,
-0.2644381523,
-0.0336925462,
-0.181998536,
0.495941937,
-0.00869451,
0.1645431519,
0.2707717121,
-0.1768411994,
0.3435398638,
0.1144155115,
-0.0168847088,
0.3338821828,
-0.0011246525,
-0.0050522159,
0.0724371448,
0.2027821839,
0.0538879707,
0.0777539164,
-0.231301114,
-0.3053880632,
-0.0528203845,
0.4625082016,
0.2455819994,
0.1443075538,
0.152499795,
0.2244812399,
0.1997743398,
-0.0548329055,
-0.2919039428,
0.2320186645,
0.2011734396,
0.0303215608,
0.3115659356,
0.0192215387,
0.1655311137,
0.3544038236,
-0.0071892207,
0.1710476577,
-0.6634289026,
0.0769564584,
0.3633344471,
0.086072199,
-0.1353576928,
-0.2520191371,
-0.379385978,
0.2799767256,
-0.0165054183,
-0.298917532,
0.1296316981,
0.1696755737,
-0.075823471,
0.3128224909,
0.0548950769,
-0.1294255257,
0.0404877029,
-0.0090990439,
0.054023847,
0.3673407137,
0.3564635217,
-0.0172520373,
-0.1925060749,
-0.2261398286,
0.1992283911,
0.0159932598,
-0.128341198,
-0.1642079353,
-0.1144074127,
0.0476977676,
-0.333788693,
0.0281414036,
0.266284138,
0.4338028729,
0.2356032431,
0.0121935848,
-0.2688332498,
0.0040644635,
0.2407895029,
0.1526182294,
-0.2270523906,
-0.0184956081,
0.0678808838,
-0.0465255082,
-0.1567806154,
-0.0096861413,
0.5891758204,
0.2141219974,
-0.4062788486,
-0.1657729149,
-0.1119145751,
-0.1672049761,
0.0304751154,
0.1676189303,
0.1938884854,
0.1115807444,
0.1253652424,
0.2348319888,
-0.1369704157,
0.0620135963,
0.131462574,
0.2517553866,
-0.2453316897,
0.3672528565,
0.1214342192,
-0.2679495811,
-0.302744031,
-0.360424459,
-0.1830501258,
0.1741008312,
-0.2602979243,
-0.3829798698,
-0.0166715067,
0.2625744641,
0.0917007476,
-0.2118700147,
0.3728054762,
0.1517225802,
0.1552774757,
-0.2208614349,
0.0982097313,
0.1039777324,
0.0218624268,
-0.2331647277,
0.1711070091,
0.2647581697,
-0.0954852179,
0.3805435896,
0.4274761081,
0.2128986269,
0.0471869111,
0.0323063023,
0.1043118611,
-0.5206045508,
0.1669881642,
0.3593797982,
-0.1979933083,
0.0848283842,
-0.0323781222,
0.0864917189,
0.0843960941,
0.0388534777,
-0.2193256617,
0.0182624757,
0.020891536,
0.1753846854,
0.1576267928,
0.4535903335,
-0.0117714172,
-0.1680050194,
-0.0772647858,
0.1454776376,
-0.0514577366,
-0.000928257,
0.6229224205,
0.2327602506,
0.2851271927,
-0.2586369812,
-0.4273085296,
-0.3670191765,
-0.2845762074,
-0.3651993871,
0.3357767761,
0.1669150442,
0.1830337346,
-0.094747752,
0.0311852191,
0.1386931092,
-0.0341286063,
0.146721676,
0.2278102934,
-0.0313040018,
-0.2833382487,
0.2253671288,
-0.0052033393,
-0.0835771933,
-0.0154668717,
-0.0148500185,
0.0944105461,
-0.1263693124,
-0.0704235509,
-0.2874098718,
0.2488091737,
-0.1169526055,
0.3575587571,
0.0694595799,
0.3240206242,
-0.1032736301,
-0.0204293262,
0.2113592029,
0.305373311,
0.0561129823,
-0.1807694435,
-0.0801795125
] |
https://github.com/huggingface/datasets/issues/1773 | bug in loading datasets | Looks like an issue with your csv file. Did you use the right delimiter ?
Apparently at line 37 the CSV reader from pandas reads 2 fields instead of 1. | Hi,
I need to load a dataset, I use these commands:
```
from datasets import load_dataset
dataset = load_dataset('csv', data_files={'train': 'sick/train.csv',
'test': 'sick/test.csv',
'validation': 'sick/validation.csv'})
print(dataset['validation'])
```
the dataset in sick/train.csv are simple csv files representing the data. I am getting this error, do you have an idea how I can solve this? thank you @lhoestq
```
Using custom data configuration default
Downloading and preparing dataset csv/default-61468fc71a743ec1 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /julia/cache_home_2/datasets/csv/default-61468fc71a743ec1/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2...
Traceback (most recent call last):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 485, in incomplete_dir
yield tmp_dir
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 527, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 604, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 959, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/tqdm-4.49.0-py3.7.egg/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/julia/cache_home_2/modules/datasets_modules/datasets/csv/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2/csv.py", line 129, in _generate_tables
for batch_idx, df in enumerate(csv_file_reader):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1029, in __next__
return self.get_chunk()
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1079, in get_chunk
return self.read(nrows=size)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1052, in read
index, columns, col_dict = self._engine.read(nrows)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 2056, in read
data = self._reader.read(nrows)
File "pandas/_libs/parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read
File "pandas/_libs/parsers.pyx", line 783, in pandas._libs.parsers.TextReader._read_low_memory
File "pandas/_libs/parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows
File "pandas/_libs/parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows
File "pandas/_libs/parsers.pyx", line 1951, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 37, saw 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "write_sick.py", line 19, in <module>
'validation': 'sick/validation.csv'})
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/load.py", line 612, in load_dataset
ignore_verifications=ignore_verifications,
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 534, in download_and_prepare
self._save_info()
File "/julia/libs/anaconda3/envs/success/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 491, in incomplete_dir
shutil.rmtree(tmp_dir)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/shutil.py", line 498, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "/julia/libs/anaconda3/envs/success/lib/python3.7/shutil.py", line 496, in rmtree
os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/julia/cache_home_2/datasets/csv/default-61468fc71a743ec1/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2.incomplete'
```
| 30 | bug in loading datasets
Hi,
I need to load a dataset, I use these commands:
```
from datasets import load_dataset
dataset = load_dataset('csv', data_files={'train': 'sick/train.csv',
'test': 'sick/test.csv',
'validation': 'sick/validation.csv'})
print(dataset['validation'])
```
the dataset in sick/train.csv are simple csv files representing the data. I am getting this error, do you have an idea how I can solve this? thank you @lhoestq
```
Using custom data configuration default
Downloading and preparing dataset csv/default-61468fc71a743ec1 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /julia/cache_home_2/datasets/csv/default-61468fc71a743ec1/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2...
Traceback (most recent call last):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 485, in incomplete_dir
yield tmp_dir
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 527, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 604, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 959, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/tqdm-4.49.0-py3.7.egg/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/julia/cache_home_2/modules/datasets_modules/datasets/csv/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2/csv.py", line 129, in _generate_tables
for batch_idx, df in enumerate(csv_file_reader):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1029, in __next__
return self.get_chunk()
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1079, in get_chunk
return self.read(nrows=size)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1052, in read
index, columns, col_dict = self._engine.read(nrows)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 2056, in read
data = self._reader.read(nrows)
File "pandas/_libs/parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read
File "pandas/_libs/parsers.pyx", line 783, in pandas._libs.parsers.TextReader._read_low_memory
File "pandas/_libs/parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows
File "pandas/_libs/parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows
File "pandas/_libs/parsers.pyx", line 1951, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 37, saw 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "write_sick.py", line 19, in <module>
'validation': 'sick/validation.csv'})
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/load.py", line 612, in load_dataset
ignore_verifications=ignore_verifications,
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 534, in download_and_prepare
self._save_info()
File "/julia/libs/anaconda3/envs/success/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 491, in incomplete_dir
shutil.rmtree(tmp_dir)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/shutil.py", line 498, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "/julia/libs/anaconda3/envs/success/lib/python3.7/shutil.py", line 496, in rmtree
os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/julia/cache_home_2/datasets/csv/default-61468fc71a743ec1/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2.incomplete'
```
Looks like an issue with your csv file. Did you use the right delimiter ?
Apparently at line 37 the CSV reader from pandas reads 2 fields instead of 1. | [
-0.2842664719,
-0.271476686,
-0.1463157535,
0.4608482122,
0.3019686639,
0.2408370525,
0.0834565386,
0.5121126771,
0.0764497593,
0.0585812256,
-0.0004540475,
-0.2665968835,
-0.1081025898,
0.2536352575,
-0.0337030478,
0.0352055877,
-0.0331644267,
0.1680261642,
-0.0946209356,
0.0193861518,
-0.2684040368,
0.2590363622,
-0.0957386643,
0.0894596949,
-0.0035115581,
-0.12193463,
0.0992637575,
0.2603849173,
-0.2975811064,
-0.3687262237,
0.3527496755,
-0.1765223444,
0.3671298623,
0.2056515962,
-0.0001100329,
0.1097224653,
0.4414514899,
-0.2222377956,
-0.2273048013,
-0.2782838345,
-0.318643868,
-0.5255684853,
-0.042416878,
-0.2519200742,
-0.0720891431,
-0.1986101121,
-0.1186179146,
-0.358505398,
0.1968755573,
0.4839044809,
0.3277643323,
-0.2024366856,
-0.077297084,
-0.2182597965,
0.1736678183,
0.0825362876,
0.0177820828,
0.0985001102,
0.0383217074,
0.1259894371,
0.545725286,
0.2248152047,
-0.0871024504,
0.0622768179,
0.1328182817,
-0.065029107,
0.2201794386,
-0.3268527091,
0.1852119714,
0.1893907636,
0.8423666954,
-0.1272011846,
-0.1620606482,
-0.1417183131,
0.1230335981,
-0.309578687,
0.0035668015,
0.3891045451,
-0.1592624933,
0.1557284743,
-0.1961616725,
0.0226351004,
-0.0563272573,
0.1439461559,
0.1991672665,
-0.1276441067,
-0.2566346824,
0.226553455,
-0.066450499,
-0.0968800932,
0.0019841888,
-0.0634835437,
-0.1318114251,
0.2200770825,
-0.3061935902,
-0.0059897224,
-0.0865266994,
-0.0474983081,
0.1305489987,
0.0191281177,
0.2057313025,
-0.362254411,
0.141655907,
0.1029279977,
0.3085213006,
0.3533764482,
-0.0966353267,
0.0186190549,
0.0468765497,
0.1750158519,
0.0544107668,
-0.2243263721,
-0.1458094567,
-0.4689758718,
0.2325952202,
0.2488864064,
0.3317736983,
-0.1506781876,
-0.2495947778,
0.1341958791,
-0.0551044866,
0.2364847064,
0.120582968,
0.5153108835,
-0.3071181774,
0.1684071571,
-0.0629566759,
0.025600899,
-0.0268061478,
-0.2216440886,
-0.2956093252,
0.0240087435,
-0.1846616566,
-0.1395942718,
0.20676364,
-0.2110506296,
0.2445816845,
0.0795357451,
0.0408380255,
-0.3071089685,
0.053824909,
-0.3537350893,
-0.023229694,
0.4643991292,
0.0900523663,
0.1324354261,
0.2597094476,
-0.0839310065,
-0.2189940661,
0.1771683693,
-0.3590297699,
-0.5951445699,
-0.011070786,
0.2614987791,
-0.1140654013,
0.1193496063,
-0.4246467948,
0.0700019598,
0.1609547436,
-0.0954995602,
-0.0518161394,
-0.1787495613,
-0.2614166141,
-0.3476528525,
0.1499702185,
0.3107525408,
-0.5323681831,
0.1687191278,
-0.3266538084,
-0.2732281387,
0.2976888418,
0.2120355368,
-0.1209665537,
0.3310963213,
-0.2531273365,
0.0592160001,
0.3152397275,
-0.3005897999,
-0.3999978602,
0.3908524215,
0.0163175911,
0.1309876591,
0.0034009956,
0.0098104933,
0.3307878077,
0.0078692269,
0.1102346629,
0.2126964033,
-0.1486563236,
-0.0314865038,
-0.2620573938,
-0.1641780287,
-0.0509143062,
0.156482771,
0.1396573335,
0.110945873,
0.1691530943,
-0.3006531,
-0.0518826991,
-0.0655680522,
0.2696273029,
0.3614275455,
0.2116630077,
0.1624412984,
0.1707908064,
0.0812942311,
-0.5355843306,
0.3256809711,
0.0115936995,
-0.1998820007,
-0.0919438377,
-0.1241048202,
-0.5685516,
-0.0164452046,
-0.1286684722,
-0.0026954906,
0.1094134748,
-0.1054463387,
-0.0243033711,
-0.0921541527,
-0.030218184,
0.5924561024,
-0.1262023151,
-0.1524438858,
-0.1371082813,
0.2782706022,
0.0124592334,
0.055331178,
0.0212130826,
0.0994585156,
0.181347385,
-0.1014739051,
-0.3069877923,
0.3099378049,
0.0669190139,
-0.0598003492,
-0.0390999652,
-0.0881184787,
-0.1291055083,
-0.1401405334,
-0.0137781585,
0.1573583782,
0.2477230132,
-0.0469301455,
0.1126646027,
0.1488337517,
-0.2980320156,
0.0036973604,
-0.118460983,
0.0627787709,
0.5067970753,
0.0400964357,
0.0703586936,
-0.3693781197,
0.2232141644,
-0.166230008,
0.3108952045,
-0.0223936122,
-0.217339471,
-0.3514187038,
0.1450280547,
0.0782160386,
-0.097468704,
0.431317389,
-0.0909134969,
-0.1065372452,
-0.084054105,
0.3009826541,
0.5254254937,
0.0834562108,
-0.1675476879,
0.2054766566,
0.2845362723,
-0.0061827791,
0.2890942991,
-0.1024242118,
0.3282968998,
0.2726708651,
-0.0958030894,
-0.1561962962,
-0.1069376245,
-0.1512011141,
0.1809899658,
0.4802764654,
-0.296161294,
0.0076898104,
-0.039297305,
-0.1293670088,
-0.0263263714,
-0.125998497,
0.0485747121,
-0.0580259413,
-0.10105405,
0.1505692303,
0.0410417654,
-0.1340406388,
-0.1771065891,
0.2878248394,
0.1359103024,
-0.2367091626,
-0.1092016697,
-0.1559363753,
-0.2683489621,
0.1195481494,
0.035031613,
0.0196763258,
0.2585454285,
-0.1997406334,
0.0914036334,
-0.1030228734,
-0.0498593561,
-0.0447157286,
-0.001954708,
0.3377039731,
0.1962084323,
0.2400902361,
0.0899588913,
0.0516655929,
0.2236874253,
-0.050268881,
-0.0530635677,
0.3498874307,
-0.1486123949,
-0.0987841859,
-0.0612152182,
-0.4378130734,
-0.5983156562,
-0.3591504991,
0.0012709746,
0.0437380522,
0.0452360027,
0.2158262283,
0.2280221283,
-0.1275929511,
0.3982062936,
-0.0774033964,
-0.3031054139,
-0.5205019116,
0.237676397,
-0.3503075838,
-0.1679314077,
0.0081504956,
-0.029173566,
0.1761377901,
0.0675560832,
-0.5610893369,
0.3567281663,
-0.2383804172,
0.0649895296,
-0.2308615297,
-0.3174833059,
0.2204198539,
-0.1381318718,
-0.0619106889,
-0.248017773,
-0.1541718096,
-0.0304519031,
0.0611271709,
0.1230328158,
-0.0677222461,
0.53850317,
0.0502664037,
0.5127769709,
0.3299141526,
-0.0016039918,
0.4850444794,
0.0683038533,
0.3586148322,
-0.2322539687,
-0.3839126825,
-0.044841446,
-0.0905617699,
-0.2724584043,
0.1639662832,
-0.0662222579,
-0.1001959369,
-0.1565472633,
-0.0477783568,
-0.3332803547,
0.0539400019,
0.1047427505,
-0.1628107131,
0.3125786781,
0.0887056291,
-0.1207631677,
-0.3875434399,
-0.1475303918,
-0.2114035189,
0.3583050668,
-0.0312437024,
0.2129056305,
-0.3576202691,
0.0854414776,
-0.3756483793,
0.4200848937,
0.1093479097,
0.4523640275,
-0.1290502101,
0.2127711773,
0.0378856808,
0.0534795113,
0.710398376,
-0.464559108,
0.0358814783,
0.1659943461,
0.0275683794,
-0.304250598,
-0.2851872146,
-0.0084802257,
0.3178518713,
0.314132899,
0.580329597,
-0.0361215472,
0.0007450015,
-0.0464965068,
0.1986040473,
-0.2785788774,
-0.3796182871,
-0.345366925,
-0.2140880823,
-0.241249308,
-0.0628155246,
0.1035617739,
0.4664240479,
-0.0524133109,
-0.1179067791,
-0.157749787,
0.0153486375,
0.1427039802,
0.0880367979,
0.3629488051,
-0.0144227985,
0.3649490178,
0.0744692087,
0.0885613933,
0.1970504522,
0.6999536753,
0.1273984313,
-0.5392552018,
-0.1261570007,
0.0696685463,
0.095437333,
-0.0811015815,
-0.2950467467,
-0.1615701318,
-0.0361090042,
0.254014641,
-0.1686357856,
0.2842821181,
0.2741620243,
-0.0936938822,
-0.5076521039,
-0.486708492,
0.2544365525,
0.0747537836,
-0.0489865206,
0.2786591947,
-0.2135265172,
-0.2284801751,
0.0430669039,
0.037637312,
0.6544898152,
-0.0589200966,
-0.1074389443,
0.1674172729,
-0.2733142078,
0.2432312369,
-0.4013946056,
0.080224365,
-0.3252429664,
-0.4311294258,
-0.0189838335,
-0.2221656442,
0.0923745111,
0.1845078319,
-0.1360656321,
0.3313302696,
-0.247643441,
0.3380995393,
-0.0432729237,
0.0570545122,
0.0132915936,
-0.1616702378,
-0.1127721369,
0.2004104257,
-0.2213425487,
0.2725205123,
-0.2305127382,
-0.0070640701,
0.0349442698,
-0.2116751224,
-0.3580959439,
0.0895577967,
-0.0012527441,
0.3320587873,
-0.133765623,
-0.2141951025,
0.026465252,
0.3820573688,
0.2773965895,
0.2747618854,
-0.1680820137,
0.1762896776,
0.0078902878,
-0.0227798093,
-0.067792803,
0.1592405438,
0.0574327335,
-0.0700749904,
-0.2695396543,
0.1729299724,
-0.1512601972,
-0.1990178823,
0.0742826834,
-0.055200655,
-0.0439747646,
-0.3788850605,
-0.4944426715,
-0.2080941349,
0.1806278825,
-0.069963403,
0.1461117864,
-0.0117005426,
-0.0562955812,
0.2779733837,
0.0098774554,
-0.4934685826,
-0.093457967,
0.2358596325,
0.1504456997,
0.0423073769,
0.5770391822,
-0.0227460247,
-0.126764074,
-0.2060650289,
0.1569141746,
0.1524963379,
-0.4153020978,
0.2984956205,
0.0065650935,
0.2282923013,
-0.0564338267,
0.1067050099,
0.2867484689,
-0.0137909818,
0.2696351707,
-0.6932896376,
-0.2438650876,
0.0520339347,
-0.2252726555,
0.1804030687,
0.1651542932,
0.0428263471,
-0.0882504508,
-0.049500756,
-0.3103481829,
0.1951560527,
-0.2436400056,
-0.0127719073,
0.1171144843,
0.0246870276,
0.1024993658,
-0.0507662594,
0.122980617,
0.0568692423,
-0.2471610159,
-0.295801878,
-0.1120595783,
0.129828617,
-0.0144994464,
-0.1231971905,
0.0595684275,
-0.2221881449,
-0.2636026144,
-0.0755086616,
0.0633004755,
0.2292276621,
0.059643589,
0.1509577036,
-0.1756052226,
0.0745843649,
-0.3001887202,
0.3205672204,
0.0679093525,
0.2082366645,
-0.0075412509,
0.2315398902,
0.1362181008,
-0.0870123059,
-0.4957449734,
-0.1165433973,
0.1486168504,
0.0311064478,
0.3345165849,
-0.2841583788,
0.4677669406,
0.1859949231,
0.1772846282,
0.2053659111,
-0.1843369752,
0.1366562098,
0.2792660296,
0.245955959,
-0.3412805498,
-0.0360045657,
-0.0271833707,
0.2645360827,
-0.1516099274,
0.0192743801,
0.305303067,
-0.0335899889,
-0.0239054784,
0.0817206725,
0.3608448505,
0.1403885335,
0.1985138506,
0.4787997007,
0.055089239,
0.1043441743,
0.1473935694,
0.152968049,
0.1486538351,
0.84327811,
-0.0870848522,
0.0475054719,
0.2190110832,
0.1941463053,
-0.2537893653,
-0.7259448171,
0.2099426091,
0.2318012416,
-0.1292048395,
0.0636876076,
0.0515898541,
0.0154763442,
-0.0568929017,
0.0287107527,
-0.3996514678,
-0.1123386174,
-0.197414577,
-0.0439043231,
-0.1145655289,
-0.0935092643,
-0.095046863,
0.0906766951,
-0.1025839671,
-0.0517635457,
-0.0532693751,
0.0804566368,
-0.2873499095,
-0.3159594238,
0.1776091009,
0.4647831917,
-0.0634762123,
-0.3196804821,
0.231306538,
0.195895806,
0.0570132174,
0.1599379033,
0.11801292,
0.5215350986,
0.5515784621,
-0.0306072086,
0.1069466695,
0.157719478,
-0.1133503243,
-0.0408966616,
0.1973387748,
0.3230095506,
0.3432396054,
0.2013499141,
0.2322908044,
-0.1237465367,
0.3629773855,
0.1353281438,
0.2386200726,
-0.1582260579,
0.0627808124,
-0.1321888715,
0.0853873715,
-0.2960374057,
0.1692753434,
-0.2322699726,
0.0723848194,
0.537406683,
0.1737910956,
0.1843810081,
0.0281954575,
0.081904985,
-0.179472506,
0.3207795322,
0.1872993857,
-0.0046043033,
-0.4473470151,
-0.1420503557,
-0.4908000827,
0.1574256569,
-0.3643205166,
-0.1044758111,
0.1451110095,
0.1177000552,
-0.0711464211,
0.0115685249,
0.033162646,
-0.0390997455,
-0.10488756,
0.268735081,
-0.1599754542,
-0.3986560702,
-0.0576158315,
0.1079311892,
0.1156315804,
-0.5605538487,
-0.0155962696,
-0.1182358041,
0.1090887636,
-0.2412688583,
-0.1559863091,
0.0716183558,
-0.0598635338,
0.4797489941,
0.0273874588,
0.4527478516,
-0.0294720065,
0.1498543173,
-0.3443869352,
-0.3039681613,
-0.0468846671,
0.3253206611,
0.193905741,
0.2710700631,
-0.282869637,
0.1123748645,
-0.1649845541,
-0.0021799223,
0.0596381985,
0.1852114052,
-0.0965946689,
-0.0817463174,
-0.1364640296,
0.1857877821,
0.1331343651,
0.2467500865,
-0.1912282258,
0.0723955482,
-0.0053282459,
-0.3337084353,
0.5975274444,
-0.0790107101,
-0.2732950747,
0.0007335006,
0.0964824334,
0.2757703364,
-0.1867086142,
-0.2042180002,
0.1991379261,
0.478746742,
-0.1332234442,
-0.0488584824,
0.1719311625,
0.0861929879,
0.111177519,
-0.005996854,
0.1856501698,
0.0163134746,
-0.194456026,
0.1022794992,
-0.3659286797
] |
https://github.com/huggingface/datasets/issues/1773 | bug in loading datasets | Note that you can pass any argument you would pass to `pandas.read_csv` as kwargs to `load_dataset`. For example you can do
```python
from datasets import load_dataset
dataset = load_dataset('csv', data_files=data_files, sep="\t")
```
for example to use a tab separator.
You can see the full list of arguments here: https://github.com/huggingface/datasets/blob/master/src/datasets/packaged_modules/csv/csv.py
(I've not found the list in the documentation though, we definitely must add them !) | Hi,
I need to load a dataset, I use these commands:
```
from datasets import load_dataset
dataset = load_dataset('csv', data_files={'train': 'sick/train.csv',
'test': 'sick/test.csv',
'validation': 'sick/validation.csv'})
print(dataset['validation'])
```
the dataset in sick/train.csv are simple csv files representing the data. I am getting this error, do you have an idea how I can solve this? thank you @lhoestq
```
Using custom data configuration default
Downloading and preparing dataset csv/default-61468fc71a743ec1 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /julia/cache_home_2/datasets/csv/default-61468fc71a743ec1/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2...
Traceback (most recent call last):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 485, in incomplete_dir
yield tmp_dir
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 527, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 604, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 959, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/tqdm-4.49.0-py3.7.egg/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/julia/cache_home_2/modules/datasets_modules/datasets/csv/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2/csv.py", line 129, in _generate_tables
for batch_idx, df in enumerate(csv_file_reader):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1029, in __next__
return self.get_chunk()
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1079, in get_chunk
return self.read(nrows=size)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1052, in read
index, columns, col_dict = self._engine.read(nrows)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 2056, in read
data = self._reader.read(nrows)
File "pandas/_libs/parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read
File "pandas/_libs/parsers.pyx", line 783, in pandas._libs.parsers.TextReader._read_low_memory
File "pandas/_libs/parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows
File "pandas/_libs/parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows
File "pandas/_libs/parsers.pyx", line 1951, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 37, saw 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "write_sick.py", line 19, in <module>
'validation': 'sick/validation.csv'})
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/load.py", line 612, in load_dataset
ignore_verifications=ignore_verifications,
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 534, in download_and_prepare
self._save_info()
File "/julia/libs/anaconda3/envs/success/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 491, in incomplete_dir
shutil.rmtree(tmp_dir)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/shutil.py", line 498, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "/julia/libs/anaconda3/envs/success/lib/python3.7/shutil.py", line 496, in rmtree
os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/julia/cache_home_2/datasets/csv/default-61468fc71a743ec1/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2.incomplete'
```
| 64 | bug in loading datasets
Hi,
I need to load a dataset, I use these commands:
```
from datasets import load_dataset
dataset = load_dataset('csv', data_files={'train': 'sick/train.csv',
'test': 'sick/test.csv',
'validation': 'sick/validation.csv'})
print(dataset['validation'])
```
the dataset in sick/train.csv are simple csv files representing the data. I am getting this error, do you have an idea how I can solve this? thank you @lhoestq
```
Using custom data configuration default
Downloading and preparing dataset csv/default-61468fc71a743ec1 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /julia/cache_home_2/datasets/csv/default-61468fc71a743ec1/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2...
Traceback (most recent call last):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 485, in incomplete_dir
yield tmp_dir
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 527, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 604, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 959, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/tqdm-4.49.0-py3.7.egg/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/julia/cache_home_2/modules/datasets_modules/datasets/csv/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2/csv.py", line 129, in _generate_tables
for batch_idx, df in enumerate(csv_file_reader):
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1029, in __next__
return self.get_chunk()
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1079, in get_chunk
return self.read(nrows=size)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 1052, in read
index, columns, col_dict = self._engine.read(nrows)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/io/parsers.py", line 2056, in read
data = self._reader.read(nrows)
File "pandas/_libs/parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read
File "pandas/_libs/parsers.pyx", line 783, in pandas._libs.parsers.TextReader._read_low_memory
File "pandas/_libs/parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows
File "pandas/_libs/parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows
File "pandas/_libs/parsers.pyx", line 1951, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 37, saw 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "write_sick.py", line 19, in <module>
'validation': 'sick/validation.csv'})
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/load.py", line 612, in load_dataset
ignore_verifications=ignore_verifications,
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 534, in download_and_prepare
self._save_info()
File "/julia/libs/anaconda3/envs/success/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets-1.2.0-py3.7.egg/datasets/builder.py", line 491, in incomplete_dir
shutil.rmtree(tmp_dir)
File "/julia/libs/anaconda3/envs/success/lib/python3.7/shutil.py", line 498, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "/julia/libs/anaconda3/envs/success/lib/python3.7/shutil.py", line 496, in rmtree
os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/julia/cache_home_2/datasets/csv/default-61468fc71a743ec1/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2.incomplete'
```
Note that you can pass any argument you would pass to `pandas.read_csv` as kwargs to `load_dataset`. For example you can do
```python
from datasets import load_dataset
dataset = load_dataset('csv', data_files=data_files, sep="\t")
```
for example to use a tab separator.
You can see the full list of arguments here: https://github.com/huggingface/datasets/blob/master/src/datasets/packaged_modules/csv/csv.py
(I've not found the list in the documentation though, we definitely must add them !) | [
-0.2842664719,
-0.271476686,
-0.1463157535,
0.4608482122,
0.3019686639,
0.2408370525,
0.0834565386,
0.5121126771,
0.0764497593,
0.0585812256,
-0.0004540475,
-0.2665968835,
-0.1081025898,
0.2536352575,
-0.0337030478,
0.0352055877,
-0.0331644267,
0.1680261642,
-0.0946209356,
0.0193861518,
-0.2684040368,
0.2590363622,
-0.0957386643,
0.0894596949,
-0.0035115581,
-0.12193463,
0.0992637575,
0.2603849173,
-0.2975811064,
-0.3687262237,
0.3527496755,
-0.1765223444,
0.3671298623,
0.2056515962,
-0.0001100329,
0.1097224653,
0.4414514899,
-0.2222377956,
-0.2273048013,
-0.2782838345,
-0.318643868,
-0.5255684853,
-0.042416878,
-0.2519200742,
-0.0720891431,
-0.1986101121,
-0.1186179146,
-0.358505398,
0.1968755573,
0.4839044809,
0.3277643323,
-0.2024366856,
-0.077297084,
-0.2182597965,
0.1736678183,
0.0825362876,
0.0177820828,
0.0985001102,
0.0383217074,
0.1259894371,
0.545725286,
0.2248152047,
-0.0871024504,
0.0622768179,
0.1328182817,
-0.065029107,
0.2201794386,
-0.3268527091,
0.1852119714,
0.1893907636,
0.8423666954,
-0.1272011846,
-0.1620606482,
-0.1417183131,
0.1230335981,
-0.309578687,
0.0035668015,
0.3891045451,
-0.1592624933,
0.1557284743,
-0.1961616725,
0.0226351004,
-0.0563272573,
0.1439461559,
0.1991672665,
-0.1276441067,
-0.2566346824,
0.226553455,
-0.066450499,
-0.0968800932,
0.0019841888,
-0.0634835437,
-0.1318114251,
0.2200770825,
-0.3061935902,
-0.0059897224,
-0.0865266994,
-0.0474983081,
0.1305489987,
0.0191281177,
0.2057313025,
-0.362254411,
0.141655907,
0.1029279977,
0.3085213006,
0.3533764482,
-0.0966353267,
0.0186190549,
0.0468765497,
0.1750158519,
0.0544107668,
-0.2243263721,
-0.1458094567,
-0.4689758718,
0.2325952202,
0.2488864064,
0.3317736983,
-0.1506781876,
-0.2495947778,
0.1341958791,
-0.0551044866,
0.2364847064,
0.120582968,
0.5153108835,
-0.3071181774,
0.1684071571,
-0.0629566759,
0.025600899,
-0.0268061478,
-0.2216440886,
-0.2956093252,
0.0240087435,
-0.1846616566,
-0.1395942718,
0.20676364,
-0.2110506296,
0.2445816845,
0.0795357451,
0.0408380255,
-0.3071089685,
0.053824909,
-0.3537350893,
-0.023229694,
0.4643991292,
0.0900523663,
0.1324354261,
0.2597094476,
-0.0839310065,
-0.2189940661,
0.1771683693,
-0.3590297699,
-0.5951445699,
-0.011070786,
0.2614987791,
-0.1140654013,
0.1193496063,
-0.4246467948,
0.0700019598,
0.1609547436,
-0.0954995602,
-0.0518161394,
-0.1787495613,
-0.2614166141,
-0.3476528525,
0.1499702185,
0.3107525408,
-0.5323681831,
0.1687191278,
-0.3266538084,
-0.2732281387,
0.2976888418,
0.2120355368,
-0.1209665537,
0.3310963213,
-0.2531273365,
0.0592160001,
0.3152397275,
-0.3005897999,
-0.3999978602,
0.3908524215,
0.0163175911,
0.1309876591,
0.0034009956,
0.0098104933,
0.3307878077,
0.0078692269,
0.1102346629,
0.2126964033,
-0.1486563236,
-0.0314865038,
-0.2620573938,
-0.1641780287,
-0.0509143062,
0.156482771,
0.1396573335,
0.110945873,
0.1691530943,
-0.3006531,
-0.0518826991,
-0.0655680522,
0.2696273029,
0.3614275455,
0.2116630077,
0.1624412984,
0.1707908064,
0.0812942311,
-0.5355843306,
0.3256809711,
0.0115936995,
-0.1998820007,
-0.0919438377,
-0.1241048202,
-0.5685516,
-0.0164452046,
-0.1286684722,
-0.0026954906,
0.1094134748,
-0.1054463387,
-0.0243033711,
-0.0921541527,
-0.030218184,
0.5924561024,
-0.1262023151,
-0.1524438858,
-0.1371082813,
0.2782706022,
0.0124592334,
0.055331178,
0.0212130826,
0.0994585156,
0.181347385,
-0.1014739051,
-0.3069877923,
0.3099378049,
0.0669190139,
-0.0598003492,
-0.0390999652,
-0.0881184787,
-0.1291055083,
-0.1401405334,
-0.0137781585,
0.1573583782,
0.2477230132,
-0.0469301455,
0.1126646027,
0.1488337517,
-0.2980320156,
0.0036973604,
-0.118460983,
0.0627787709,
0.5067970753,
0.0400964357,
0.0703586936,
-0.3693781197,
0.2232141644,
-0.166230008,
0.3108952045,
-0.0223936122,
-0.217339471,
-0.3514187038,
0.1450280547,
0.0782160386,
-0.097468704,
0.431317389,
-0.0909134969,
-0.1065372452,
-0.084054105,
0.3009826541,
0.5254254937,
0.0834562108,
-0.1675476879,
0.2054766566,
0.2845362723,
-0.0061827791,
0.2890942991,
-0.1024242118,
0.3282968998,
0.2726708651,
-0.0958030894,
-0.1561962962,
-0.1069376245,
-0.1512011141,
0.1809899658,
0.4802764654,
-0.296161294,
0.0076898104,
-0.039297305,
-0.1293670088,
-0.0263263714,
-0.125998497,
0.0485747121,
-0.0580259413,
-0.10105405,
0.1505692303,
0.0410417654,
-0.1340406388,
-0.1771065891,
0.2878248394,
0.1359103024,
-0.2367091626,
-0.1092016697,
-0.1559363753,
-0.2683489621,
0.1195481494,
0.035031613,
0.0196763258,
0.2585454285,
-0.1997406334,
0.0914036334,
-0.1030228734,
-0.0498593561,
-0.0447157286,
-0.001954708,
0.3377039731,
0.1962084323,
0.2400902361,
0.0899588913,
0.0516655929,
0.2236874253,
-0.050268881,
-0.0530635677,
0.3498874307,
-0.1486123949,
-0.0987841859,
-0.0612152182,
-0.4378130734,
-0.5983156562,
-0.3591504991,
0.0012709746,
0.0437380522,
0.0452360027,
0.2158262283,
0.2280221283,
-0.1275929511,
0.3982062936,
-0.0774033964,
-0.3031054139,
-0.5205019116,
0.237676397,
-0.3503075838,
-0.1679314077,
0.0081504956,
-0.029173566,
0.1761377901,
0.0675560832,
-0.5610893369,
0.3567281663,
-0.2383804172,
0.0649895296,
-0.2308615297,
-0.3174833059,
0.2204198539,
-0.1381318718,
-0.0619106889,
-0.248017773,
-0.1541718096,
-0.0304519031,
0.0611271709,
0.1230328158,
-0.0677222461,
0.53850317,
0.0502664037,
0.5127769709,
0.3299141526,
-0.0016039918,
0.4850444794,
0.0683038533,
0.3586148322,
-0.2322539687,
-0.3839126825,
-0.044841446,
-0.0905617699,
-0.2724584043,
0.1639662832,
-0.0662222579,
-0.1001959369,
-0.1565472633,
-0.0477783568,
-0.3332803547,
0.0539400019,
0.1047427505,
-0.1628107131,
0.3125786781,
0.0887056291,
-0.1207631677,
-0.3875434399,
-0.1475303918,
-0.2114035189,
0.3583050668,
-0.0312437024,
0.2129056305,
-0.3576202691,
0.0854414776,
-0.3756483793,
0.4200848937,
0.1093479097,
0.4523640275,
-0.1290502101,
0.2127711773,
0.0378856808,
0.0534795113,
0.710398376,
-0.464559108,
0.0358814783,
0.1659943461,
0.0275683794,
-0.304250598,
-0.2851872146,
-0.0084802257,
0.3178518713,
0.314132899,
0.580329597,
-0.0361215472,
0.0007450015,
-0.0464965068,
0.1986040473,
-0.2785788774,
-0.3796182871,
-0.345366925,
-0.2140880823,
-0.241249308,
-0.0628155246,
0.1035617739,
0.4664240479,
-0.0524133109,
-0.1179067791,
-0.157749787,
0.0153486375,
0.1427039802,
0.0880367979,
0.3629488051,
-0.0144227985,
0.3649490178,
0.0744692087,
0.0885613933,
0.1970504522,
0.6999536753,
0.1273984313,
-0.5392552018,
-0.1261570007,
0.0696685463,
0.095437333,
-0.0811015815,
-0.2950467467,
-0.1615701318,
-0.0361090042,
0.254014641,
-0.1686357856,
0.2842821181,
0.2741620243,
-0.0936938822,
-0.5076521039,
-0.486708492,
0.2544365525,
0.0747537836,
-0.0489865206,
0.2786591947,
-0.2135265172,
-0.2284801751,
0.0430669039,
0.037637312,
0.6544898152,
-0.0589200966,
-0.1074389443,
0.1674172729,
-0.2733142078,
0.2432312369,
-0.4013946056,
0.080224365,
-0.3252429664,
-0.4311294258,
-0.0189838335,
-0.2221656442,
0.0923745111,
0.1845078319,
-0.1360656321,
0.3313302696,
-0.247643441,
0.3380995393,
-0.0432729237,
0.0570545122,
0.0132915936,
-0.1616702378,
-0.1127721369,
0.2004104257,
-0.2213425487,
0.2725205123,
-0.2305127382,
-0.0070640701,
0.0349442698,
-0.2116751224,
-0.3580959439,
0.0895577967,
-0.0012527441,
0.3320587873,
-0.133765623,
-0.2141951025,
0.026465252,
0.3820573688,
0.2773965895,
0.2747618854,
-0.1680820137,
0.1762896776,
0.0078902878,
-0.0227798093,
-0.067792803,
0.1592405438,
0.0574327335,
-0.0700749904,
-0.2695396543,
0.1729299724,
-0.1512601972,
-0.1990178823,
0.0742826834,
-0.055200655,
-0.0439747646,
-0.3788850605,
-0.4944426715,
-0.2080941349,
0.1806278825,
-0.069963403,
0.1461117864,
-0.0117005426,
-0.0562955812,
0.2779733837,
0.0098774554,
-0.4934685826,
-0.093457967,
0.2358596325,
0.1504456997,
0.0423073769,
0.5770391822,
-0.0227460247,
-0.126764074,
-0.2060650289,
0.1569141746,
0.1524963379,
-0.4153020978,
0.2984956205,
0.0065650935,
0.2282923013,
-0.0564338267,
0.1067050099,
0.2867484689,
-0.0137909818,
0.2696351707,
-0.6932896376,
-0.2438650876,
0.0520339347,
-0.2252726555,
0.1804030687,
0.1651542932,
0.0428263471,
-0.0882504508,
-0.049500756,
-0.3103481829,
0.1951560527,
-0.2436400056,
-0.0127719073,
0.1171144843,
0.0246870276,
0.1024993658,
-0.0507662594,
0.122980617,
0.0568692423,
-0.2471610159,
-0.295801878,
-0.1120595783,
0.129828617,
-0.0144994464,
-0.1231971905,
0.0595684275,
-0.2221881449,
-0.2636026144,
-0.0755086616,
0.0633004755,
0.2292276621,
0.059643589,
0.1509577036,
-0.1756052226,
0.0745843649,
-0.3001887202,
0.3205672204,
0.0679093525,
0.2082366645,
-0.0075412509,
0.2315398902,
0.1362181008,
-0.0870123059,
-0.4957449734,
-0.1165433973,
0.1486168504,
0.0311064478,
0.3345165849,
-0.2841583788,
0.4677669406,
0.1859949231,
0.1772846282,
0.2053659111,
-0.1843369752,
0.1366562098,
0.2792660296,
0.245955959,
-0.3412805498,
-0.0360045657,
-0.0271833707,
0.2645360827,
-0.1516099274,
0.0192743801,
0.305303067,
-0.0335899889,
-0.0239054784,
0.0817206725,
0.3608448505,
0.1403885335,
0.1985138506,
0.4787997007,
0.055089239,
0.1043441743,
0.1473935694,
0.152968049,
0.1486538351,
0.84327811,
-0.0870848522,
0.0475054719,
0.2190110832,
0.1941463053,
-0.2537893653,
-0.7259448171,
0.2099426091,
0.2318012416,
-0.1292048395,
0.0636876076,
0.0515898541,
0.0154763442,
-0.0568929017,
0.0287107527,
-0.3996514678,
-0.1123386174,
-0.197414577,
-0.0439043231,
-0.1145655289,
-0.0935092643,
-0.095046863,
0.0906766951,
-0.1025839671,
-0.0517635457,
-0.0532693751,
0.0804566368,
-0.2873499095,
-0.3159594238,
0.1776091009,
0.4647831917,
-0.0634762123,
-0.3196804821,
0.231306538,
0.195895806,
0.0570132174,
0.1599379033,
0.11801292,
0.5215350986,
0.5515784621,
-0.0306072086,
0.1069466695,
0.157719478,
-0.1133503243,
-0.0408966616,
0.1973387748,
0.3230095506,
0.3432396054,
0.2013499141,
0.2322908044,
-0.1237465367,
0.3629773855,
0.1353281438,
0.2386200726,
-0.1582260579,
0.0627808124,
-0.1321888715,
0.0853873715,
-0.2960374057,
0.1692753434,
-0.2322699726,
0.0723848194,
0.537406683,
0.1737910956,
0.1843810081,
0.0281954575,
0.081904985,
-0.179472506,
0.3207795322,
0.1872993857,
-0.0046043033,
-0.4473470151,
-0.1420503557,
-0.4908000827,
0.1574256569,
-0.3643205166,
-0.1044758111,
0.1451110095,
0.1177000552,
-0.0711464211,
0.0115685249,
0.033162646,
-0.0390997455,
-0.10488756,
0.268735081,
-0.1599754542,
-0.3986560702,
-0.0576158315,
0.1079311892,
0.1156315804,
-0.5605538487,
-0.0155962696,
-0.1182358041,
0.1090887636,
-0.2412688583,
-0.1559863091,
0.0716183558,
-0.0598635338,
0.4797489941,
0.0273874588,
0.4527478516,
-0.0294720065,
0.1498543173,
-0.3443869352,
-0.3039681613,
-0.0468846671,
0.3253206611,
0.193905741,
0.2710700631,
-0.282869637,
0.1123748645,
-0.1649845541,
-0.0021799223,
0.0596381985,
0.1852114052,
-0.0965946689,
-0.0817463174,
-0.1364640296,
0.1857877821,
0.1331343651,
0.2467500865,
-0.1912282258,
0.0723955482,
-0.0053282459,
-0.3337084353,
0.5975274444,
-0.0790107101,
-0.2732950747,
0.0007335006,
0.0964824334,
0.2757703364,
-0.1867086142,
-0.2042180002,
0.1991379261,
0.478746742,
-0.1332234442,
-0.0488584824,
0.1719311625,
0.0861929879,
0.111177519,
-0.005996854,
0.1856501698,
0.0163134746,
-0.194456026,
0.1022794992,
-0.3659286797
] |
https://github.com/huggingface/datasets/issues/1771 | Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.2.1/datasets/csv/csv.py | Indeed in 1.2.1 the script to process csv file is downloaded. Starting from the next release though we include the csv processing directly in the library.
See PR #1726
We'll do a new release soon :) | Hi,
When I load_dataset from local csv files, below error happened, looks raw.githubusercontent.com was blocked by the chinese government. But why it need to download csv.py? should it include when pip install the dataset?
```
Traceback (most recent call last):
File "/home/tom/pyenv/pystory/lib/python3.6/site-packages/datasets/load.py", line 267, in prepare_module
local_path = cached_path(file_path, download_config=download_config)
File "/home/tom/pyenv/pystory/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 343, in cached_path
max_retries=download_config.max_retries,
File "/home/tom/pyenv/pystory/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 617, in get_from_cache
raise ConnectionError("Couldn't reach {}".format(url))
ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.2.1/datasets/csv/csv.py
``` | 36 | Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.2.1/datasets/csv/csv.py
Hi,
When I load_dataset from local csv files, below error happened, looks raw.githubusercontent.com was blocked by the chinese government. But why it need to download csv.py? should it include when pip install the dataset?
```
Traceback (most recent call last):
File "/home/tom/pyenv/pystory/lib/python3.6/site-packages/datasets/load.py", line 267, in prepare_module
local_path = cached_path(file_path, download_config=download_config)
File "/home/tom/pyenv/pystory/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 343, in cached_path
max_retries=download_config.max_retries,
File "/home/tom/pyenv/pystory/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 617, in get_from_cache
raise ConnectionError("Couldn't reach {}".format(url))
ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.2.1/datasets/csv/csv.py
```
Indeed in 1.2.1 the script to process csv file is downloaded. Starting from the next release though we include the csv processing directly in the library.
See PR #1726
We'll do a new release soon :) | [
-0.0955532715,
-0.2019754946,
-0.1823531836,
0.0995746404,
0.1923656315,
-0.0114180837,
0.2810027897,
0.1859904528,
0.2537336946,
0.2542535067,
0.0892186016,
-0.1967476606,
0.2385468036,
0.0940235183,
0.2848535478,
0.005462911,
0.0613933541,
0.1827713847,
-0.0548007153,
0.0738354772,
-0.221904844,
0.1612168998,
-0.0770462975,
0.2406686544,
0.183008641,
-0.0438244678,
-0.0183392595,
0.24996759,
-0.1553301066,
-0.6863776445,
0.5335743427,
-0.08772064,
0.0872389451,
0.3809683919,
-0.0001219624,
0.1784873158,
0.2266521007,
0.0600899495,
-0.304137826,
-0.4302999675,
-0.2043637186,
-0.4646512866,
0.2093787789,
-0.0881475508,
-0.1116303951,
0.0846513808,
0.0986054689,
-0.0679889917,
0.5056244135,
0.257109791,
0.1253384948,
0.4090686142,
0.1611116081,
-0.0237109493,
0.079730466,
-0.2780308127,
0.0383104198,
0.6396935582,
0.2506094575,
0.0791780427,
0.1863253117,
0.0641186312,
0.0218928233,
0.0369012579,
0.0472995676,
-0.1882138401,
-0.1258435696,
-0.4115509391,
0.1586072743,
0.184128657,
0.4187724888,
-0.0393406637,
-0.4462426603,
-0.1533687711,
-0.1058286354,
-0.2536842227,
0.2397562414,
0.2356261611,
-0.1876692772,
0.3894169331,
-0.3782463968,
-0.4112765789,
-0.2539043725,
0.0796007812,
0.1502712518,
-0.1225685328,
-0.2733918726,
0.2718202174,
-0.0534090251,
0.2579773068,
-0.1241600811,
-0.2064068466,
0.2385279983,
0.2558236122,
-0.1334979385,
0.076788947,
0.0650764033,
0.1773648113,
0.0727835447,
0.0202906262,
-0.1572666466,
-0.0684020221,
0.087065056,
0.2111350596,
0.282173723,
0.0334910862,
-0.2121038139,
0.2013407499,
0.4550288618,
0.0691016689,
0.2622929513,
-0.0102668861,
-0.1029179245,
-0.2107794583,
-0.2703858912,
0.0307911187,
0.321187228,
-0.2815461755,
-0.3093494475,
0.0659013391,
0.0390481763,
-0.0104024066,
-0.1799646169,
0.2581599653,
-0.2859200835,
-0.0678927079,
-0.2721948326,
0.2000263333,
0.0214112736,
0.2753879726,
-0.1119690239,
-0.0004647154,
0.0060166768,
-0.0009938792,
0.0340763628,
-0.4372746348,
0.3914864361,
0.0934396386,
0.0480778478,
-0.0987749025,
0.1128346547,
-0.0641058907,
-0.0430663489,
0.6849479675,
0.1744443476,
0.1752893329,
0.2168379128,
-0.1809906363,
-0.1927258819,
-0.0909492746,
-0.3817341924,
-0.5966465473,
0.1252201945,
0.0914470106,
-0.2169651389,
0.0871367902,
-0.2984276116,
-0.2251372784,
0.1321948618,
-0.1171603352,
0.0286835693,
-0.0901566073,
0.1095229015,
-0.2676124871,
0.1917377412,
0.3740242124,
-0.3153309524,
0.0494480357,
-0.0734261498,
-0.2135501802,
0.176274389,
0.3705995381,
-0.3056228161,
0.0591847263,
-0.3774470091,
-0.1362131536,
0.2382946461,
-0.5621120334,
-0.4215042591,
0.599270761,
-0.5369256735,
0.1285010576,
0.3748977482,
-0.0943394229,
0.0501164831,
-0.1642114669,
-0.0010969611,
0.2005173266,
-0.1767108142,
-0.0859078988,
-0.0647001788,
-0.2305062562,
0.1496224701,
0.051224079,
0.1470539719,
0.2475225925,
0.4015805125,
-0.3437529206,
0.2249789387,
0.0798388273,
0.0593375228,
0.3031327426,
0.1127030253,
0.1874865294,
0.0576476194,
-0.0678092614,
-0.018061189,
0.1433224529,
0.0969166532,
0.133173421,
-0.4544298947,
-0.2827014923,
-0.3851603568,
0.0597076565,
-0.2557536662,
-0.1976464242,
-0.0729223788,
0.1620245427,
0.1989422888,
0.0629702583,
-0.1394385546,
0.261464566,
-0.2417072803,
0.1346646994,
-0.3927442431,
-0.0052875364,
-0.3166234791,
0.252117604,
0.0628739372,
0.2250804156,
0.1026253626,
-0.3936480582,
0.0388783589,
0.3471482694,
-0.1636750996,
0.2459465563,
0.4471334517,
-0.0768294185,
0.1481193751,
-0.2535530329,
-0.0019224517,
0.0207377728,
0.1652928293,
0.0995791703,
0.2445021123,
0.4189685285,
-0.138177529,
0.3534338176,
0.2430635989,
0.1018152237,
0.4970534146,
0.1846905351,
-0.1638277769,
-0.0549108423,
0.1627466828,
0.2569488287,
0.2440240383,
0.0510583296,
-0.3063213527,
0.0358604267,
0.3714100122,
-0.2061377317,
-0.1045365185,
0.2198978066,
-0.0375457555,
-0.1541122645,
0.2689559162,
0.3254326582,
0.2397071421,
0.1287347823,
0.0073771132,
0.0084864525,
0.0245218519,
-0.2758024931,
0.2178352475,
0.0225246754,
-0.0848598629,
-0.0997314006,
-0.1577927768,
0.0239043552,
-0.2462340146,
-0.2599892616,
-0.081886299,
0.1003528088,
-0.2951285541,
0.0956833959,
-0.1791389734,
-0.2106065005,
0.0305510424,
-0.1278255433,
-0.0708779469,
-0.0244658887,
-0.2541637719,
-0.076877363,
0.0034973808,
0.0543404594,
-0.1177082658,
0.0808909684,
-0.000080882,
-0.2572305202,
0.014919606,
-0.1822191924,
-0.116703704,
0.0802342072,
0.0735343844,
-0.2460044324,
0.3860694468,
-0.3160519302,
-0.1374776661,
-0.2647013068,
-0.2660464644,
-0.0025327983,
-0.2927844822,
0.1916860491,
0.1971206814,
0.5703706741,
-0.0727636442,
0.1112002879,
0.1009880453,
0.1587014645,
-0.0927198082,
0.094724074,
-0.1793780923,
-0.3052487969,
-0.0293632876,
-0.411269784,
-0.6069232225,
-0.2414166927,
0.5490337014,
0.0594550818,
0.1699184477,
0.1289371252,
0.1287507862,
0.2001086175,
-0.0949769169,
0.1896914989,
-0.1098500341,
-0.736692667,
0.1865400374,
-0.2187229693,
-0.4208387733,
0.0948561803,
0.1742122322,
0.1524998993,
0.1145447865,
-0.4824324548,
-0.0435415208,
-0.2732464969,
0.5928388238,
0.2286838293,
0.2681688368,
0.2591040134,
-0.1083409041,
-0.0190776084,
0.0581811145,
-0.1092539132,
-0.1205401123,
-0.0330047607,
0.0799576789,
0.2373789102,
0.6281403303,
0.0022581576,
0.8966239095,
0.1433392763,
0.2809492052,
0.3366566002,
-0.1672467887,
0.678781271,
-0.1122264937,
-0.3695980608,
0.1828483045,
-0.1843003929,
-0.0341748223,
-0.034952689,
0.0113926921,
0.1826464534,
-0.3542366922,
-0.2172438651,
-0.4547278285,
-0.0131867584,
-0.251299113,
-0.043946635,
0.3033426106,
0.3213041425,
-0.2542966604,
-0.0445459485,
-0.0465726815,
-0.1392972767,
0.517552197,
0.3043706417,
0.1067071185,
-0.1937412024,
-0.4147571325,
-0.4655104578,
0.1850390434,
0.1652393192,
0.3033649027,
-0.203922689,
0.1496022344,
0.1451834589,
-0.0264938865,
0.4634085894,
-0.0855549425,
0.2608707547,
-0.2503010035,
-0.2143214047,
-0.2421768457,
0.0859910175,
0.135806486,
0.3931618333,
0.4021689296,
0.3111836016,
-0.2517565489,
-0.0634315684,
0.2403288484,
0.4169411063,
0.0360829905,
0.032294631,
-0.4389886856,
-0.4671420157,
-0.3043811321,
0.0443475768,
0.0750482604,
-0.0327414759,
-0.0796366483,
-0.3801332414,
0.1397909671,
0.0495757945,
-0.0849313885,
0.0108675631,
-0.1756716669,
-0.1639827639,
-0.0881421268,
0.0292920675,
-0.0119901597,
0.2336807847,
0.8473033905,
-0.0543312244,
-0.4416356087,
0.1069410145,
-0.0873412788,
0.2426242977,
0.4287486374,
-0.3434512019,
0.2248141915,
0.2938656509,
0.1941402406,
0.0278722867,
-0.0889987499,
0.2278604358,
0.2560949922,
-0.2686395943,
-0.5812898278,
0.2368518114,
-0.1923529059,
-0.0798063949,
0.1616537273,
0.3225770593,
-0.0231528003,
0.0887569785,
-0.3266091347,
0.9755813479,
-0.06189771,
0.1599710435,
0.273692131,
-0.2049051523,
0.6905868649,
-0.0752925351,
-0.026011467,
-0.0312332064,
0.0121629937,
-0.2138666511,
-0.1836464107,
0.3075835407,
-0.1075579599,
0.1308748573,
0.5412425399,
0.1051569507,
0.279381156,
0.281858623,
0.4345101118,
-0.1370303184,
0.1518075764,
-0.2523873448,
0.0112935752,
0.0890045613,
0.3492091,
-0.0967983454,
-0.1812428087,
-0.2169580013,
-0.4635493159,
-0.3159098029,
0.0770950019,
-0.1700167656,
0.2835496962,
-0.2618564069,
-0.3819082975,
0.0394768119,
0.2156236768,
0.3661670387,
0.1271670759,
-0.3483723104,
0.1041694805,
-0.0325815827,
-0.2253561914,
0.1193987653,
0.2196256518,
0.0585102476,
-0.2676689327,
-0.1631457061,
0.0912334025,
-0.3837053478,
-0.4753273726,
0.1165171862,
0.1606829166,
-0.0886342824,
0.0285579003,
-0.2594716847,
-0.3641318083,
-0.1353179216,
-0.2234558314,
0.0221922603,
0.0332574062,
0.0855410323,
-0.1595683694,
0.1000853777,
-0.4792577922,
-0.308331877,
0.2961959541,
0.1011109874,
0.0086645447,
0.3008601069,
-0.0254838653,
-0.2978416681,
-0.0730058029,
-0.1070541888,
0.1128732786,
-0.3831176162,
-0.0554382056,
0.0093057221,
0.190303877,
-0.2904723287,
0.1213995069,
0.3454097211,
-0.1291728169,
-0.1401871443,
-0.7301217914,
-0.2574653029,
-0.0440689847,
-0.0860195085,
-0.0467878133,
0.2605700791,
0.1884116381,
0.2191006839,
-0.1121382937,
-0.1931421608,
-0.0352064148,
-0.1189068556,
0.1893435866,
0.3981721103,
0.128067717,
0.4042638838,
-0.0418101661,
0.096335344,
-0.2398320884,
-0.2778912783,
-0.0938006118,
0.1272534132,
0.1937196702,
-0.0159860495,
-0.211334154,
-0.1374361664,
-0.1894383132,
-0.030294694,
0.1373151243,
0.1910875738,
0.088514857,
0.0768459514,
-0.2128359079,
-0.3246437013,
0.0326536149,
-0.1514024287,
0.2506735623,
-0.4052930176,
0.2931369841,
0.0419883616,
0.1846661419,
-0.0547003336,
-0.0628470927,
-0.1790297776,
-0.1747975498,
-0.0010287233,
-0.0156444032,
0.4725158215,
-0.3057201505,
0.1217361912,
0.1238188669,
0.3870140612,
0.3176066875,
-0.0764720067,
0.1636551768,
0.0920121148,
0.0528600216,
-0.2982036173,
0.1763183475,
0.0198563077,
-0.0124962078,
-0.0869375914,
0.0837001428,
0.396900475,
-0.0511393249,
0.2406800538,
-0.007404597,
0.7359583378,
-0.0351997316,
0.0986526683,
0.3116623759,
0.2028189749,
0.2901832163,
-0.0074153631,
0.3918149769,
-0.0961788371,
0.2838305235,
-0.2792786956,
-0.0649527386,
-0.0066282577,
0.2520180345,
-0.2160855681,
-0.4989340901,
0.5282223225,
0.1405056715,
-0.4128898084,
-0.2227040082,
0.2649855018,
0.4716643691,
-0.3868044913,
0.161742717,
0.0028841321,
0.1396621615,
0.0008567985,
0.0548566692,
0.0867651328,
-0.0528750718,
0.0536497645,
-0.0138529427,
0.0497173853,
-0.1499880254,
0.0732263848,
0.082976386,
-0.1660105139,
-0.4901473224,
0.0985207707,
-0.0611772947,
0.0640602633,
-0.1050398424,
0.2438175529,
0.0441355109,
-0.1199346706,
-0.056458585,
0.2529462278,
0.6069967747,
0.2839480639,
0.1196369529,
0.0438910834,
0.1174878106,
-0.2431918085,
-0.0309547652,
0.2385394126,
-0.0226954073,
0.381031841,
0.2282350957,
0.1363203526,
-0.0333247185,
0.2987473607,
0.0323641561,
-0.0079730181,
-0.2900754213,
0.2597247958,
-0.2596826255,
-0.3766296208,
-0.1175563186,
0.1649690568,
-0.5120316744,
0.1394944787,
0.2924076319,
-0.1979346722,
0.0157304984,
-0.4259530902,
0.0349396877,
0.0278185606,
0.2674635947,
0.7155249119,
0.4606136382,
-0.3348762989,
-0.1098515838,
-0.5381650925,
0.170589149,
-0.2221708298,
-0.1982747167,
0.0511966422,
0.0114329904,
-0.1057403758,
0.3257555664,
-0.0462971255,
0.1087361798,
0.0759242848,
0.0574221835,
0.1789705306,
-0.0208208188,
-0.1078760475,
0.1753506809,
-0.1996834427,
-0.3156132102,
0.4249688983,
-0.3957901001,
-0.0479641668,
-0.1112157851,
0.2341021001,
0.1720629781,
-0.3405557573,
0.4727348983,
0.0987477452,
0.4923419654,
-0.1560231,
-0.1178596392,
-0.1519263238,
-0.0938046426,
-0.1615957618,
0.2455443591,
-0.0167907644,
0.0068978192,
-0.1859281063,
-0.2319278121,
-0.2419972122,
0.3104191124,
0.0172112957,
0.0564078987,
0.2882193029,
-0.1637436599,
-0.0938535705,
0.0140683223,
0.2250898182,
0.013341397,
0.0627990589,
-0.0355004855,
-0.2181968689,
-0.3019967079,
0.4021444321,
-0.4057482481,
-0.039643582,
0.132057339,
0.3493549824,
0.1719121337,
-0.2641634643,
-0.2059084028,
0.180251807,
0.3741891682,
0.1197129488,
-0.3547090292,
0.2156616002,
-0.2529557049,
0.1879665554,
-0.044560764,
0.3003156483,
-0.1705957651,
-0.3227392733,
0.0059779864,
-0.2893489897
] |
https://github.com/huggingface/datasets/issues/1770 | how can I combine 2 dataset with different/same features? | Hi ! Currently we don't have a way to `zip` datasets but we plan to add this soon :)
For now you'll need to use `map` to add the fields from one dataset to the other. See the comment here for more info : https://github.com/huggingface/datasets/issues/853#issuecomment-727872188 | to combine 2 dataset by one-one map like ds = zip(ds1, ds2):
ds1: {'text'}, ds2: {'text'}, combine ds:{'src', 'tgt'}
or different feature:
ds1: {'src'}, ds2: {'tgt'}, combine ds:{'src', 'tgt'} | 45 | how can I combine 2 dataset with different/same features?
to combine 2 dataset by one-one map like ds = zip(ds1, ds2):
ds1: {'text'}, ds2: {'text'}, combine ds:{'src', 'tgt'}
or different feature:
ds1: {'src'}, ds2: {'tgt'}, combine ds:{'src', 'tgt'}
Hi ! Currently we don't have a way to `zip` datasets but we plan to add this soon :)
For now you'll need to use `map` to add the fields from one dataset to the other. See the comment here for more info : https://github.com/huggingface/datasets/issues/853#issuecomment-727872188 | [
-0.3618092239,
-0.4964472353,
-0.0687221438,
0.1217598021,
0.0697284117,
0.3581108749,
-0.0922455043,
0.2210624069,
-0.0352848805,
0.013870283,
-0.3246745467,
0.4096492529,
0.0693914145,
0.7398913503,
0.1613288075,
-0.2478820235,
0.0789491534,
0.1294562817,
-0.4716951847,
0.1984135658,
0.012885116,
0.0042591137,
-0.0246832259,
-0.0849267468,
-0.0984387994,
0.2673224211,
-0.2330105156,
-0.1992993653,
-0.1573345661,
0.0235671178,
0.3827170134,
0.269384414,
-0.0531160608,
0.2027808428,
-0.0001115768,
0.0722316578,
-0.0460225865,
-0.1208759099,
0.107782945,
-0.4201936126,
-0.0392921492,
-0.5601703525,
-0.1074663773,
-0.0181255508,
-0.1781564206,
-0.2882148325,
-0.2893859148,
-0.2174084485,
0.3418448567,
-0.169003889,
0.1079963893,
0.1024666056,
0.1639193892,
-0.0635812357,
0.2932222784,
0.4440599084,
-0.0876195356,
-0.0696485862,
0.456232965,
0.0492849275,
0.5520348549,
0.1969707608,
-0.0197899994,
0.0005702373,
0.2822979093,
0.1590325534,
-0.2205990404,
-0.200296253,
-0.0121473474,
0.3940692544,
0.4385499954,
-0.285718441,
-0.3185836375,
-0.1896539629,
0.1420854479,
-0.1715213507,
-0.1700830758,
0.3175994158,
0.0211349167,
0.0232089404,
-0.4666422009,
-0.3988067508,
0.0761493072,
0.1548093408,
-0.0889578536,
0.1069055125,
-0.0845474526,
0.1540900916,
-0.0578116626,
-0.2493234873,
0.1112817302,
-0.41025576,
-0.089173533,
0.2716373801,
-0.2897032499,
-0.3540630341,
-0.2580058873,
-0.2053417414,
0.7211523652,
0.1921921074,
-0.1244395375,
-0.1314029396,
-0.4426650107,
0.2014518976,
0.2647919357,
0.2856195569,
0.2340370268,
0.0185885094,
0.0427908599,
-0.2273824215,
-0.1311994344,
-0.0583617128,
0.4423027039,
-0.1362012178,
-0.1892874986,
-0.2544166744,
0.4779636264,
-0.2223194242,
0.1482371837,
-0.4064995646,
0.0526717715,
-0.213223964,
-0.1734147519,
-0.0509312339,
0.0698623508,
-0.0080111949,
-0.2046570033,
0.287887603,
0.2749114931,
-0.295486629,
-0.1059869826,
-0.073790133,
0.1206282601,
0.1911254674,
-0.0125081595,
-0.386259228,
0.1450713724,
0.6239697933,
-0.1406674981,
0.2539289296,
0.312440455,
-0.1426236629,
-0.1376316249,
-0.1937670708,
0.3240770102,
0.154308334,
0.0961581767,
0.1441504806,
-0.213341549,
-0.0007745997,
-0.3544186056,
-0.1190918609,
0.0511285812,
0.1720263809,
-0.1338262558,
-0.1185326129,
-0.3662882745,
0.669705987,
-0.0450401492,
-0.1963849068,
-0.1601147205,
0.4825178087,
-0.3460587859,
-0.1729306579,
0.1248905882,
0.0466943793,
-0.2356795073,
-0.4060330391,
0.1128407791,
-0.040867079,
-0.2736006081,
0.4258357584,
-0.2547855675,
0.0148464451,
-0.2920530438,
0.0254389774,
0.4448812902,
-0.0706945211,
-0.2393835336,
0.4166380465,
-0.0338700488,
-0.0262855534,
-0.0796058029,
0.1589784175,
0.157869041,
0.1973280311,
0.052820988,
0.5103902817,
-0.2451845556,
-0.210113883,
0.0171057507,
-0.4156888425,
0.4063561261,
-0.0769313276,
-0.0820078999,
0.0215604696,
0.0277166348,
-0.4218938053,
0.144521907,
-0.1599113196,
0.2335322797,
0.1152571961,
0.0342926309,
0.0504976362,
-0.0890547112,
-0.4413532317,
-0.4822225571,
-0.0164514408,
-0.1436121315,
-0.1910775304,
0.1615774781,
-0.4283261895,
-0.0080512762,
-0.3666364849,
-0.0625190958,
-0.1186320409,
0.0343079418,
0.018757591,
0.1252594888,
-0.1757806391,
-0.2722328305,
0.2241860181,
0.5275174975,
0.0491100475,
-0.3530472815,
0.5951496363,
0.2401289493,
0.0126928836,
-0.0470198393,
0.1135404259,
0.0824421793,
-0.0154715255,
0.1004679054,
0.0125803687,
-0.5362692475,
0.3304074407,
0.4451418519,
-0.1900835484,
0.2659786344,
-0.2425031215,
0.1363278627,
-0.0252019856,
0.0164541397,
-0.2492332458,
-0.3427090943,
0.3071551919,
0.036262393,
0.2554854453,
0.1160892099,
0.0826601759,
0.1574558765,
-0.1364688873,
0.0478172041,
0.0063437102,
-0.011840417,
0.0121241827,
0.371906966,
0.2906233966,
-0.1891371459,
0.1635455936,
0.2540834844,
0.000637335,
0.0233999677,
0.0033060592,
-0.3710801899,
0.0487009846,
0.0733458027,
-0.045792561,
0.5803028345,
0.3118935823,
-0.0138465771,
0.165496856,
0.1007251665,
0.1608838886,
-0.0108848894,
-0.0204666648,
-0.0809136108,
0.1754923761,
0.3073765934,
0.1203592718,
-0.041877009,
0.2153897583,
0.1384511292,
-0.1983053535,
-0.0339095406,
-0.2077616155,
-0.230503574,
-0.2206585556,
-0.3354870677,
-0.1023767665,
-0.4055418372,
0.0058900584,
-0.0967233926,
0.1889792383,
0.0675260052,
0.0023475781,
0.2830420732,
0.2402463555,
-0.1767147034,
-0.1294566691,
-0.0370173678,
0.2873999178,
0.2032703757,
0.1446807683,
0.1542172879,
0.101480633,
0.3842554688,
-0.0276636817,
-0.0555934086,
-0.6561791301,
-0.3905447125,
0.1056406945,
-0.1866331697,
0.162651062,
-0.0132694822,
0.0612564571,
0.0317173973,
-0.2150374353,
0.2902243435,
0.3680698276,
-0.1453752518,
-0.1525584608,
-0.0711421147,
0.0424223095,
-0.1534927189,
-0.2626844943,
-0.2550146282,
-0.1307690144,
0.4938807786,
-0.21221295,
0.0253910851,
-0.3388876021,
0.0590584949,
-0.1455034763,
-0.0381393321,
-0.0373348035,
-0.2105336487,
-0.4417382479,
0.3633478284,
-0.101906307,
-0.1232510358,
-0.0622192509,
-0.1185196787,
0.0129733318,
0.058218386,
-0.0850691795,
-0.111394316,
-0.379811883,
0.2991841435,
-0.0581448525,
0.3092566431,
0.2840958834,
0.0622069389,
0.1154543236,
0.0281775426,
-0.4375108778,
0.0236823689,
0.0776254758,
0.2953585088,
0.0861721262,
0.0952158347,
-0.1847838312,
0.5392617583,
0.4855141342,
0.2069984078,
0.3148103356,
-0.0207611993,
0.2014729381,
-0.1138302684,
-0.3359414935,
-0.1546173096,
0.0052294899,
0.2537073493,
0.0774526149,
0.1430763155,
0.1139902249,
-0.3639834821,
-0.3012902737,
-0.019032469,
-0.1052180529,
-0.0961651728,
0.0764962062,
0.0234002694,
-0.1047776192,
-0.416726917,
-0.2212543637,
0.0701888502,
0.1113705784,
0.306845963,
-0.0301220026,
0.0763070434,
-0.4565533996,
-0.195942089,
-0.2196296453,
0.2435433865,
0.1135358438,
-0.3452656269,
0.1435212493,
0.0839313343,
-0.2891017795,
-0.0461753532,
0.4688132703,
0.0044270749,
-0.1657567918,
-0.2415520996,
-0.3337163329,
-0.1596201807,
-0.1541399062,
0.2101825178,
-0.1223798171,
-0.0428112,
0.7450358868,
-0.4150357544,
-0.1063110605,
0.2144476324,
0.3093693852,
-0.0340209231,
-0.2858569026,
0.2248767018,
-0.1265197098,
-0.2038751394,
-0.3736384511,
-0.0918769985,
-0.0946599469,
-0.0005783258,
-0.3123129308,
-0.2255403101,
-0.110694021,
0.4122419357,
0.0931332707,
0.1979771107,
0.0016146483,
0.3067940772,
0.1092077643,
0.1054371074,
-0.1184786782,
0.714466393,
0.0923733264,
-0.5906252861,
-0.3595559001,
-0.1414743513,
0.4458450675,
-0.1541210711,
-0.0330141895,
0.4973279238,
-0.3980497122,
-0.0312883668,
-0.153601706,
0.0443202592,
0.222900793,
0.3378211558,
-0.3514524698,
-0.2078116089,
0.6163509488,
0.4150250256,
-0.085363701,
0.2741284072,
-0.1544023603,
-0.0853123963,
-0.0610342585,
-0.4421525896,
0.7151213288,
0.001920037,
0.2235157937,
-0.1618158519,
0.0517003536,
0.4223557115,
-0.0141941048,
-0.1407140493,
0.0445347875,
-0.4924369156,
-0.1345442384,
-0.0360834524,
-0.0127559584,
0.2731685042,
-0.3648451269,
0.387542516,
0.0279476717,
0.3813566566,
-0.1812820733,
0.1914042085,
0.0356787331,
0.0019292975,
-0.2923057079,
0.0774029791,
-0.3082004488,
0.2018807232,
0.03185701,
-0.1815773547,
-0.0393771045,
-0.2110559344,
-0.1716475189,
0.1150207743,
0.0215130802,
0.1849933118,
0.2158887535,
-0.1307342201,
0.0861612335,
0.121813044,
0.1773826927,
0.147975713,
-0.1574467123,
-0.1855000705,
-0.0523377769,
0.1065879613,
-0.3663007617,
-0.1125912368,
-0.0478983186,
0.0185203571,
-0.1067312807,
0.2390482873,
0.2548416257,
0.0043042805,
-0.1485949755,
-0.020375235,
-0.0757180676,
-0.3721717298,
-0.306766361,
0.4104667902,
0.2765320539,
-0.1722232848,
0.0149113331,
0.1202458143,
-0.1559036225,
0.144732371,
0.0585456192,
-0.1185307354,
-0.1087362245,
0.0966591164,
0.2115074992,
0.0077755428,
0.1847673208,
-0.0656261891,
0.236804679,
0.0324388184,
0.1078705639,
0.1853030771,
-0.0826608762,
0.094147183,
-0.052857507,
0.0864878222,
-0.0487324074,
0.2020091563,
0.1860229969,
0.3130827546,
0.2421098948,
-0.1659173965,
-0.3828410506,
0.194269985,
0.1468084157,
0.2859947085,
0.0524923354,
0.237154007,
-0.0772295669,
0.58657974,
-0.2435095459,
0.1217965484,
0.2938934267,
0.1696382016,
0.4679047465,
0.0920032561,
-0.1409839541,
-0.0514320135,
0.0716399401,
-0.1116876677,
-0.0237845778,
-0.2098344415,
-0.1993464977,
0.0840245187,
0.1305217743,
-0.0360221155,
-0.0042901114,
-0.0485141762,
0.3371497393,
-0.1892850846,
0.4083266258,
0.0316528492,
0.0519720428,
0.0441102348,
0.1356365383,
-0.1600204259,
-0.455737859,
0.3019764423,
0.082519725,
-0.0855898187,
0.0340581983,
-0.0427309424,
-0.1179130152,
-0.1373352408,
-0.2232819647,
-0.1955260485,
0.4275317788,
-0.0626695901,
0.0048003439,
0.2037333548,
-0.0406901166,
0.1561908275,
0.161137417,
-0.007436167,
-0.1330080032,
0.4312369525,
0.0191971511,
0.131415695,
-0.2810482383,
-0.1722837538,
0.2121522874,
0.0001842071,
0.1162936538,
0.0445543677,
-0.0169121418,
0.3816168308,
-0.1187456995,
-0.0249924641,
0.0680542365,
0.2002502531,
0.1851524264,
0.4368994236,
0.119671911,
-0.077546224,
0.0855026096,
0.3447014987,
0.1528348625,
-0.0628437921,
-0.2231145054,
0.095092386,
-0.0355561338,
0.0095632533,
0.6225678921,
-0.1861011833,
0.0067544477,
0.1668474972,
0.0266053732,
-0.0159046706,
0.1713167429,
0.3761456013,
0.0212119389,
-0.4307380617,
0.1032131165,
0.5190814137,
0.1420275271,
-0.2155851722,
0.124086231,
-0.2345858067,
-0.1258781552,
0.1448840797,
0.1114490405,
-0.5025011301,
0.7270308137,
-0.0855777636,
0.0586721227,
0.0205251127,
0.362676084,
0.3423200846,
0.0683145523,
0.0319000818,
0.1234926507,
0.2584227026,
-0.3591665626,
-0.0128000528,
0.4288056195,
0.1311597228,
0.0650769249,
0.1156104654,
0.3647969365,
-0.0392973907,
-0.1133825481,
0.1524166912,
-0.1405669004,
-0.1483445019,
-0.2890030444,
0.1610241085,
0.1670104861,
-0.0702813491,
0.0520771928,
-0.5179769397,
0.1358424127,
-0.6229062676,
0.2271410227,
0.0051211445,
-0.2663626373,
-0.1237839758,
-0.123827219,
-0.2615604699,
-0.4799647033,
0.5373874307,
0.1291899979,
-0.0313791484,
-0.0803101808,
0.0965202823,
-0.062920332,
0.0792927593,
0.3690905869,
-0.0724234805,
-0.2462379485,
-0.1202213988,
-0.4041544795,
-0.0201991927,
0.0593254231,
-0.0565924644,
-0.2689471245,
0.0749183074,
0.1075353548,
0.0945203453,
0.1419163793,
0.0593487322,
0.3613250256,
0.0193936173,
-0.3074981868,
-0.1817612648,
0.0881315693,
0.0771059394,
0.2435368896,
-0.147233963,
0.3143061697,
0.1537708044,
-0.0558650829,
-0.1373120993,
0.2451801449,
0.0664100274,
-0.3503930271,
0.1685195863,
0.1277627498,
0.3754202425,
-0.3541482091,
0.1319276392,
0.4446251988,
0.0321804546,
-0.3205442131,
0.2490742207,
0.1502968967,
0.0839505941,
-0.4384071827,
0.1390394568,
0.1322806776,
-0.0707601011,
-0.0463987663,
-0.4495651126,
-0.2335364968,
0.1850862205,
0.0243399721,
-0.0596532412,
0.1690427512,
0.52406919,
-0.0794887096,
-0.0281584524,
0.1459883004,
-0.1959227175,
0.4356804788,
0.0627723262,
-0.1813950539,
-0.1825110763,
-0.280718863,
0.2014478296,
-0.1435725093,
-0.4898813963,
-0.1636503339,
0.2929661572,
-0.0049862857,
0.3040724397,
0.3011698127,
0.0274862442,
-0.114382498,
-0.2004225254,
0.354157716,
0.2150263339,
-0.2349356115,
0.043008212,
-0.2074889839
] |
https://github.com/huggingface/datasets/issues/1770 | how can I combine 2 dataset with different/same features? | Good to hear.
Currently I did not use map , just fetch src and tgt from the 2 dataset and merge them.
It will be a release if you can deal with it at the backend.
Thanks. | to combine 2 dataset by one-one map like ds = zip(ds1, ds2):
ds1: {'text'}, ds2: {'text'}, combine ds:{'src', 'tgt'}
or different feature:
ds1: {'src'}, ds2: {'tgt'}, combine ds:{'src', 'tgt'} | 37 | how can I combine 2 dataset with different/same features?
to combine 2 dataset by one-one map like ds = zip(ds1, ds2):
ds1: {'text'}, ds2: {'text'}, combine ds:{'src', 'tgt'}
or different feature:
ds1: {'src'}, ds2: {'tgt'}, combine ds:{'src', 'tgt'}
Good to hear.
Currently I did not use map , just fetch src and tgt from the 2 dataset and merge them.
It will be a release if you can deal with it at the backend.
Thanks. | [
-0.3885655701,
-0.4940946698,
-0.1406935453,
0.0185404755,
-0.0224655606,
0.2798507512,
-0.1746795774,
0.3226884305,
-0.0510884263,
0.0088927988,
-0.1925194412,
0.6096795201,
0.0999665707,
0.5465121865,
0.069801718,
-0.1127221882,
0.0745650232,
0.1688350588,
-0.455271244,
0.1778494269,
0.0620452873,
-0.0594894439,
-0.033458475,
-0.0982745141,
-0.0798536092,
0.28181234,
-0.1274136603,
-0.2967353761,
-0.2358779609,
0.0145081123,
0.2774325013,
0.2345996946,
-0.127366513,
0.2523553967,
-0.0001082497,
0.1177334264,
0.0513776653,
-0.1531061232,
0.2523334622,
-0.4381471276,
-0.1970332414,
-0.4797201157,
-0.1601138413,
-0.1272795051,
-0.1080752388,
-0.1871518791,
-0.2989041805,
-0.3243279159,
0.250318706,
-0.1271039099,
0.1325851232,
-0.0880203322,
0.122392647,
-0.0137142073,
0.2999746203,
0.3637711108,
-0.0602157488,
-0.1029032096,
0.5676071048,
0.0092758397,
0.4451419115,
0.2175048888,
-0.1230509356,
-0.007324561,
0.3124164045,
0.0486221425,
-0.038041614,
-0.2631063461,
0.0710007101,
0.2478633523,
0.5259116292,
-0.1586421132,
-0.0991823971,
0.062192671,
0.031650912,
-0.0059683002,
-0.1653365791,
0.2786550224,
0.0410579257,
0.0446242616,
-0.5148199797,
-0.44294855,
0.0948952734,
0.1656854451,
-0.0767565072,
0.2319708019,
0.0322265662,
0.1849225461,
-0.2162772566,
-0.2405795306,
0.2670077085,
-0.430185914,
-0.0571950637,
0.3326958418,
-0.2123257369,
-0.3501250744,
-0.2511492074,
-0.443923682,
0.6490114331,
-0.0200992171,
0.0990226939,
-0.0340395942,
-0.3805946708,
0.2804827988,
0.2375016063,
0.2917188108,
0.3173269928,
0.1898632348,
-0.0087107252,
-0.4177416563,
-0.3030487001,
0.0329583175,
0.4209111035,
-0.2382073402,
-0.1569514275,
-0.1717441976,
0.4447455108,
-0.3677548766,
0.2103084475,
-0.5202788711,
-0.0881638601,
-0.1420807242,
-0.226205349,
-0.0958219394,
0.1750538051,
0.0489228256,
-0.2405051589,
0.167670846,
0.3340082467,
-0.2938679457,
-0.0370179415,
-0.0422514528,
0.1603025198,
0.0471824966,
-0.0015432575,
-0.1771238297,
0.0949375182,
0.562164247,
-0.3058843017,
0.1829919517,
0.3147558868,
-0.1040005833,
-0.0195237044,
-0.2901402116,
0.3635195494,
0.0882704854,
0.0345525108,
0.2711076438,
-0.2068246454,
0.129970327,
-0.4372510612,
-0.1448741406,
0.1334382296,
0.2379767299,
0.0191796161,
-0.0671925768,
-0.2039434016,
0.5709996819,
0.046818573,
-0.271445334,
-0.1705268472,
0.5460535884,
-0.237455219,
-0.2488662153,
-0.0948716328,
-0.0343844034,
-0.3212700784,
-0.3335894942,
0.0642854497,
-0.0274075847,
-0.228708759,
0.3375682831,
-0.3624531627,
0.0571284965,
-0.1392395049,
0.041039329,
0.5528928041,
-0.0943097025,
-0.3914400637,
0.5118291974,
-0.0071980953,
-0.146579802,
-0.1156990677,
0.2643764913,
0.2004472613,
0.1718616039,
0.1076655388,
0.5094720125,
-0.2747675776,
-0.0966091529,
-0.0189081468,
-0.4181535542,
0.4239631891,
-0.1348891258,
-0.0575222522,
-0.0474156886,
0.1543737352,
-0.4866880178,
0.1541963667,
-0.1080196574,
0.2645325065,
0.1089467704,
0.0176144503,
-0.1733415872,
-0.076255545,
-0.3590359688,
-0.3984609544,
-0.1078945026,
-0.3227748573,
-0.18230474,
0.0847266018,
-0.3686956465,
-0.0110872872,
-0.4826445282,
-0.0400575362,
0.0088728629,
0.0902562588,
-0.0263375342,
0.0050442233,
-0.2365912199,
-0.156092152,
0.1332930475,
0.5647343993,
-0.0498310067,
-0.2055798024,
0.5626949072,
0.2106457651,
0.0336610265,
0.0225733425,
-0.047239121,
0.135543704,
-0.0224670488,
-0.0492446348,
0.0592308827,
-0.4545075893,
0.3014395237,
0.3840031624,
-0.2035783678,
0.2649066448,
-0.3029327691,
0.1429382861,
0.0698786974,
0.0661110729,
-0.2787415087,
-0.2938680053,
0.2300539315,
0.1171719879,
0.2025706321,
0.0860559344,
0.0840895399,
0.1174590215,
-0.1769444048,
0.0689538419,
-0.0474319644,
-0.1171294227,
-0.0302803889,
0.2370966673,
0.4099989831,
0.0255229026,
0.2372204512,
0.2471357286,
0.0381259546,
0.1396587193,
-0.0745831579,
-0.3314554691,
-0.034624584,
-0.018752452,
-0.0686755627,
0.5103155971,
0.254094094,
-0.1636127383,
0.1103902906,
0.2492557764,
0.2375882566,
-0.0140336901,
-0.1093534157,
0.0952234566,
0.1363037378,
0.3759464025,
0.1634880602,
0.1028359607,
0.1159214228,
0.2855808735,
-0.1664952636,
0.1135336459,
-0.3573135734,
-0.2230838984,
-0.1297074258,
-0.2990346551,
-0.0198958945,
-0.2856923342,
-0.0178761352,
-0.0423256904,
0.0760572478,
0.0820799619,
0.0532875732,
0.3012833893,
0.0908267647,
-0.1270111352,
-0.1823033392,
0.045442868,
0.1271012723,
0.1881292909,
0.1879554391,
0.1435556412,
0.1582487971,
0.3156920671,
0.0445803069,
-0.0184113663,
-0.4888223708,
-0.3923448324,
0.1243813559,
-0.0000136544,
-0.0214340501,
-0.0514347628,
-0.0697950944,
0.0403110571,
-0.1614386141,
0.115288876,
0.2696068883,
-0.1647182107,
-0.2373157442,
-0.156506896,
-0.0114665898,
-0.1103405133,
-0.310477525,
-0.2459207624,
-0.2052777112,
0.182214573,
-0.2187639773,
0.0829839036,
-0.5726178885,
0.0895796344,
-0.2523792684,
0.0419623516,
-0.0752219856,
-0.1315327287,
-0.3683958948,
0.3846785724,
-0.1310069412,
-0.1836593598,
-0.0639636442,
-0.0795928314,
0.1381900162,
0.1339146644,
-0.0233509745,
0.0152280536,
-0.2839079201,
0.2396763414,
-0.1025737599,
0.1269345582,
0.2458894104,
0.2217750549,
0.0532565229,
0.0195345357,
-0.32573542,
-0.0101708677,
0.1243047416,
0.2586681247,
0.1649142802,
-0.0023147562,
-0.1266417056,
0.4759714603,
0.4102107584,
0.0864423364,
0.2461434603,
0.069026798,
-0.0310464669,
-0.0720845312,
-0.2650802433,
-0.1932803541,
-0.0270618685,
0.2228743881,
0.0077952724,
-0.0200224556,
-0.2028654814,
-0.4187777936,
-0.3887884319,
-0.1032175794,
-0.0901831016,
-0.0248360876,
0.0225977823,
0.1172926202,
-0.0844551176,
-0.4240664244,
-0.2681206167,
0.0643288866,
0.1787191629,
0.1185796261,
-0.0168635026,
0.0371458232,
-0.4187369943,
-0.1615973264,
-0.0375839174,
0.2943128645,
0.2055927068,
-0.34507671,
0.188076362,
0.0988818407,
-0.3641401231,
-0.0752878785,
0.3639459312,
-0.006733967,
-0.0272206143,
-0.2934646904,
-0.1550571024,
-0.0181937683,
-0.1162450016,
0.2589884698,
0.0121606775,
-0.0418913476,
0.6412333846,
-0.3157117367,
-0.0394968241,
0.1368405223,
0.1856137961,
-0.0850630179,
-0.2468769848,
0.2709826231,
-0.0777586401,
-0.2421097755,
-0.4657283127,
-0.0692938343,
-0.1497348696,
0.0614926629,
-0.4079431593,
-0.2114312053,
-0.0460077859,
0.335444361,
0.1244232655,
0.1765256524,
-0.1636611968,
0.1690294892,
-0.0456601381,
0.1065556556,
-0.1433042586,
0.6272713542,
0.2670291066,
-0.4620836377,
-0.2423051149,
-0.2583220601,
0.4511784613,
-0.1259615272,
0.0580204278,
0.4277217984,
-0.4641081095,
-0.1543428153,
0.0512972511,
-0.0932701603,
0.0950443,
0.2546092868,
-0.4261366427,
-0.1574272364,
0.5728211999,
0.3493757248,
-0.1567673683,
0.3115530312,
-0.4469199479,
-0.0828489587,
0.1440853179,
-0.3016001582,
0.8176677227,
0.0391676798,
0.0679657683,
-0.330532223,
0.1054152772,
0.1836752295,
-0.1053979546,
-0.0440058522,
0.0527382605,
-0.3161377311,
-0.1374401748,
0.0265801884,
-0.0556864105,
0.473074317,
-0.4407372475,
0.3485813141,
0.0469173044,
0.3959119022,
-0.1265678555,
0.2334692776,
0.1905296594,
0.1281436831,
-0.1501763612,
0.0895573795,
-0.3499031365,
0.0966258273,
0.0604889579,
-0.3020160496,
-0.0989622101,
-0.1232644096,
-0.0856968611,
0.1203915179,
0.0427156538,
0.3616163433,
0.0299584065,
-0.0661436021,
0.0478941873,
0.098160252,
-0.105415985,
0.1261379272,
-0.0819062069,
-0.1535653323,
0.1932196021,
0.1397262216,
-0.2461335957,
-0.0519548841,
-0.0711552873,
-0.083435066,
-0.1991079152,
0.3462423384,
0.1320004314,
-0.0813196972,
-0.1592236608,
-0.0524584539,
0.0770973638,
-0.2919890881,
-0.29797858,
0.5363789797,
0.0895885527,
-0.072403051,
0.0567634255,
0.0446153209,
-0.1053934395,
0.234903127,
0.0937961265,
-0.2018084675,
-0.0544938184,
0.1176374182,
0.4531313181,
0.0468376577,
0.082865864,
-0.1654902548,
0.2697140574,
-0.0222481359,
0.1073924974,
0.0532892309,
-0.0576487966,
0.0545430519,
-0.2332496196,
0.0694819093,
0.0910302326,
0.1202278361,
0.1606688797,
0.5604797602,
0.1323273033,
-0.1157590523,
-0.3453599215,
0.123727873,
0.2395763546,
0.2470712364,
-0.0365745686,
0.1985190064,
-0.0793557093,
0.6873176694,
-0.2969149351,
0.1318295151,
0.3975135982,
0.3426423073,
0.3198750019,
0.1796251982,
-0.37512514,
-0.0741950646,
0.1279969066,
-0.0654594302,
-0.0295176543,
-0.24207367,
-0.0677838326,
0.0826019868,
0.0908952355,
0.0578958355,
-0.1134131849,
-0.2265946269,
0.2689420879,
-0.0860188082,
0.3376496732,
0.0107869282,
0.059125375,
0.0466692485,
0.1443538368,
-0.2734318674,
-0.4316167831,
0.3497261107,
-0.0207214262,
-0.0865009055,
-0.0390620604,
-0.0109063834,
-0.0280410033,
-0.1253493577,
-0.1689089686,
-0.2858797312,
0.3722506762,
0.0713136271,
0.0568390936,
0.169073537,
0.0196757633,
0.1826633364,
-0.0616476834,
-0.0913357362,
-0.2369186431,
0.3942173421,
-0.1218970567,
0.2006999403,
-0.292450577,
-0.2348062843,
0.2931777835,
-0.0259796288,
0.1450149268,
-0.0636133477,
0.0103194723,
0.3602036834,
-0.0889461637,
0.0661938265,
0.1304408163,
0.0912624151,
0.184140265,
0.4665006697,
0.1780335754,
-0.0550873615,
0.0136532262,
0.2035765797,
0.1864256412,
-0.0048269257,
-0.170094341,
0.1611708105,
0.1710531265,
-0.051000949,
0.7275780439,
-0.0116874818,
-0.0057894913,
0.2497447431,
-0.0912280828,
0.0694124922,
0.4447433949,
0.1390614808,
0.0992989391,
-0.4390279055,
0.1337791383,
0.4352563024,
0.1393813938,
-0.0699821636,
-0.0423335768,
-0.2399267107,
-0.1427194029,
0.1366897672,
0.0697480589,
-0.2833138108,
0.815246582,
0.0431855544,
0.1011750326,
0.2025988698,
0.4424373209,
0.3067191541,
0.2169556469,
0.0006868403,
0.00797721,
0.2020894438,
-0.4203090668,
-0.067483969,
0.3493858874,
0.0268329717,
0.1826026291,
0.0041168085,
0.3164587319,
0.0658693686,
-0.1819420457,
0.1106705219,
-0.1567561179,
-0.0701434016,
-0.3488503993,
0.0923331454,
0.2150822729,
-0.079674229,
0.0480161421,
-0.385304451,
0.1449499875,
-0.3666716218,
0.146102652,
0.0895380452,
-0.3051272929,
-0.0472589545,
-0.1326813251,
-0.1727474928,
-0.643335104,
0.5588118434,
0.1113870144,
-0.0329864807,
-0.110485822,
0.110361658,
-0.1595533788,
0.091131255,
0.2793377936,
-0.1291179657,
-0.223106131,
-0.1268818229,
-0.3720626533,
0.1155211702,
0.0454916023,
-0.0228080377,
-0.2274467647,
0.1429172009,
0.218825832,
0.1887910962,
0.1171536818,
-0.0265936889,
0.3292476535,
0.1265399754,
-0.3300286233,
-0.098764874,
0.1161151901,
0.0971552357,
0.2759954035,
-0.2498865277,
0.3398550749,
0.0256451722,
0.0259946827,
-0.2597186267,
0.0440510325,
0.2548989058,
-0.2090632319,
0.2395811826,
0.0702370554,
0.2490376085,
-0.4570767581,
0.1363018304,
0.5659571886,
0.1062540635,
-0.2446698546,
0.2806099653,
0.3050474823,
-0.0316502675,
-0.4182461798,
0.3034988046,
0.1939332336,
-0.1193654686,
-0.2073644847,
-0.3572681546,
-0.2085310519,
0.038777262,
-0.0009310243,
-0.0102531034,
0.0332767777,
0.395582974,
-0.0155342836,
-0.0519189909,
0.1367719322,
-0.1302715689,
0.3534799814,
0.1321192384,
-0.2396326661,
-0.1321879625,
-0.2882092297,
0.1360858828,
-0.0368308946,
-0.348439306,
-0.2428430617,
0.3459312022,
-0.0116856089,
0.3151524365,
0.2930341959,
0.0231121108,
-0.0914196596,
-0.2050621957,
0.1921302974,
0.1376335174,
-0.212432012,
-0.1246579513,
-0.2591711283
] |
https://github.com/huggingface/datasets/issues/1769 | _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union when calling datasets.map with num_proc=2 | Hi ! What version of python and datasets do you have ? And also what version of dill and pickle ? | It may be a bug of multiprocessing with Datasets, when I disable the multiprocessing by set num_proc to None, everything works fine.
The script I use is https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm_wwm.py
Script args:
```
--model_name_or_path
../../../model/chinese-roberta-wwm-ext
--train_file
/nfs/volume-377-2/bert/data/test/train.txt
--output_dir
test
--do_train
--per_device_train_batch_size
2
--gradient_accumulation_steps
2
--learning_rate
1e-4
--max_steps
1000
--warmup_steps
10
--save_steps
1000
--save_total_limit
1
--seed
23333
--max_seq_length
512
--preprocessing_num_workers
2
--cache_dir
/nfs/volume-377-2/bert/data/test/cache
```
Where the `/nfs/volume-377-2/bert/data/test/train.txt` is just a toy example with 10000 lines of random string, you should be able to reproduce this error esaily.
Full Traceback:
```
Traceback (most recent call last):
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 398, in <module>
main()
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 325, in main
load_from_cache_file=not data_args.overwrite_cache,
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in map
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in <dictcomp>
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in map
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in <listcomp>
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 644, in get
raise self._value
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 424, in _handle_tasks
put(task)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/connection.py", line 209, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump
StockPickler.dump(self, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 409, in dump
self.save(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function
obj.__dict__, fkwdefaults), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell
pickler.save_reduce(_create_cell, (f,), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 521, in save
self.save_reduce(obj=obj, *rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 605, in save_reduce
save(cls)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type
obj.__bases__, _dict), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 507, in save
self.save_global(obj, rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 927, in save_global
(obj, module_name, name))
_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union
```
| 21 | _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union when calling datasets.map with num_proc=2
It may be a bug of multiprocessing with Datasets, when I disable the multiprocessing by set num_proc to None, everything works fine.
The script I use is https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm_wwm.py
Script args:
```
--model_name_or_path
../../../model/chinese-roberta-wwm-ext
--train_file
/nfs/volume-377-2/bert/data/test/train.txt
--output_dir
test
--do_train
--per_device_train_batch_size
2
--gradient_accumulation_steps
2
--learning_rate
1e-4
--max_steps
1000
--warmup_steps
10
--save_steps
1000
--save_total_limit
1
--seed
23333
--max_seq_length
512
--preprocessing_num_workers
2
--cache_dir
/nfs/volume-377-2/bert/data/test/cache
```
Where the `/nfs/volume-377-2/bert/data/test/train.txt` is just a toy example with 10000 lines of random string, you should be able to reproduce this error esaily.
Full Traceback:
```
Traceback (most recent call last):
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 398, in <module>
main()
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 325, in main
load_from_cache_file=not data_args.overwrite_cache,
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in map
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in <dictcomp>
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in map
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in <listcomp>
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 644, in get
raise self._value
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 424, in _handle_tasks
put(task)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/connection.py", line 209, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump
StockPickler.dump(self, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 409, in dump
self.save(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function
obj.__dict__, fkwdefaults), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell
pickler.save_reduce(_create_cell, (f,), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 521, in save
self.save_reduce(obj=obj, *rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 605, in save_reduce
save(cls)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type
obj.__bases__, _dict), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 507, in save
self.save_global(obj, rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 927, in save_global
(obj, module_name, name))
_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union
```
Hi ! What version of python and datasets do you have ? And also what version of dill and pickle ? | [
-0.2903596759,
-0.297428906,
0.113244459,
0.1903710514,
0.1661586612,
-0.0522101186,
0.332113564,
0.2303638011,
0.2993956208,
0.2801508307,
0.0167169757,
0.3376861513,
-0.111044623,
0.2174143046,
0.0041830107,
-0.1060651168,
-0.1158020496,
-0.1348112375,
-0.3830085397,
0.0106053464,
-0.2922797203,
0.3295295537,
-0.3364179432,
0.178581059,
-0.6447756886,
-0.0980493948,
-0.0480727851,
0.2914253175,
0.0867960826,
-0.0838412195,
0.0912964344,
-0.0355662666,
0.0124875624,
0.4959759116,
-0.0001100203,
0.0433962531,
0.2030377239,
-0.0829198435,
-0.0667255968,
-0.4173733592,
0.0713779405,
-0.0390123427,
0.0707583129,
-0.0548069179,
0.1504489481,
0.1799489707,
0.1406909078,
-0.0804707259,
0.2613467276,
0.1155146435,
0.194408372,
0.5662002563,
0.1144359112,
-0.0761355981,
-0.1252600253,
0.2157487869,
-0.0322175324,
0.2660857439,
0.1158299074,
-0.1664743721,
-0.2567045093,
0.2081438899,
-0.0091969697,
0.2851696312,
-0.155352667,
0.3262344599,
0.0900291428,
-0.2589211762,
0.1284048259,
0.3979731202,
0.0784634501,
-0.2320567071,
-0.3231722713,
-0.0680227131,
-0.0854360536,
-0.1713584363,
0.0877537951,
0.1660901159,
-0.1176945865,
0.085168153,
-0.2029173523,
0.1319693625,
0.220704332,
0.1039849296,
0.2320754826,
0.3622329235,
-0.0313422158,
0.3686206043,
0.2795687318,
-0.1373412907,
-0.2073920518,
-0.1868889779,
0.0720699802,
0.0632181838,
-0.0458194204,
-0.1408385187,
0.0455081388,
-0.0947568119,
0.0736563802,
-0.1785828471,
-0.1766466051,
0.1712975502,
-0.2389758974,
0.3193747699,
0.3000177443,
-0.1272126883,
-0.0990269929,
0.2027034312,
0.4027113616,
-0.0739722922,
-0.2251318693,
0.1159952953,
0.3312566578,
-0.3447963297,
-0.1041946858,
0.1564332694,
0.329223305,
-0.1115077958,
-0.1496975422,
-0.1945508868,
-0.1339908391,
-0.1725839972,
-0.0103021571,
0.2903746068,
0.0592748523,
0.3461206555,
0.0566080995,
0.187803492,
-0.5467140079,
-0.0829291418,
-0.33981058,
0.2189269662,
-0.1916942894,
0.0626075193,
0.2220833898,
0.2673143446,
0.3550159335,
0.1994699836,
-0.0371263959,
-0.1523097157,
0.2351192236,
-0.2494035065,
-0.1287895888,
0.1925626397,
0.1652553231,
0.2886992097,
0.2680858076,
-0.3080252111,
-0.0635942146,
0.0783040598,
-0.2370542437,
-0.2890687287,
-0.0729558393,
0.1396500021,
-0.014291049,
0.1257888079,
-0.1699091941,
0.0447562858,
0.4315926433,
-0.0497589856,
-0.1882438511,
-0.2977279425,
-0.3939256072,
-0.2207494676,
-0.0378484242,
0.3762209713,
-0.23416619,
-0.1520402879,
0.1977586299,
-0.1235370636,
0.5048831105,
0.5401952863,
-0.2475930154,
-0.0822769031,
-0.1492325813,
0.6606736183,
0.0360708609,
0.1096853539,
-0.2572190762,
0.2026089877,
-0.0988951176,
-0.1114995554,
-0.0841933936,
0.037050046,
-0.3572829068,
-0.0326679833,
0.4061435759,
0.1351238787,
0.0573738404,
0.1923567206,
-0.2711720467,
-0.3141673505,
0.1697523743,
-0.0544771701,
0.0685291514,
-0.275788933,
-0.126200825,
-0.0896319523,
0.4380549788,
-0.2241079062,
0.0792601183,
-0.0038883744,
0.1627583802,
-0.0515407659,
-0.0201107152,
-0.2338373959,
-0.5796086192,
0.2878188789,
-0.2233291715,
0.2118990868,
-0.0640439391,
-0.1344355494,
0.2768063545,
-0.0169790089,
-0.3259688914,
-0.0686182231,
0.075660713,
0.0722177327,
0.0509035662,
-0.182272777,
-0.0842780098,
-0.1165587604,
-0.1049534157,
-0.0149970017,
-0.4686060846,
0.0425726362,
-0.4037324488,
-0.4181522727,
-0.1895168573,
0.2076248527,
0.1067514941,
-0.0068624108,
-0.1171694919,
0.1369664818,
0.1502614319,
-0.0461103544,
-0.0495145172,
0.0562660508,
-0.0190870669,
-0.0961282179,
0.0217988361,
0.2198568881,
0.1103199273,
-0.1780937314,
-0.2147067189,
0.475146234,
0.0284070577,
0.2698735595,
0.0416777655,
0.095799461,
0.2242285162,
0.041359894,
0.1322546601,
-0.1709279269,
0.1677090377,
0.1714062542,
0.1670323312,
0.0913196206,
-0.2392710894,
0.0395234153,
0.5964307189,
0.2025490403,
0.4119848013,
0.0081309201,
-0.205907017,
-0.1373885274,
-0.1942454129,
0.0325801112,
0.6064071655,
0.1613006294,
0.0643861145,
0.001883914,
-0.1250700206,
-0.118636705,
0.0121867321,
-0.0157126375,
0.0383683443,
0.1391063035,
0.1101771966,
-0.0765569285,
-0.303314805,
-0.1031184122,
0.0103041679,
0.318467468,
-0.3177981675,
0.0145383384,
-0.3326050639,
0.4729814231,
-0.2347500324,
0.0097455867,
-0.191803962,
-0.2922730148,
-0.1737025678,
0.3688523471,
-0.2211099863,
0.1546903104,
0.1278085858,
-0.2074622214,
-0.1040063351,
0.2358912677,
0.0728946328,
-0.0771440715,
-0.2809193432,
-0.001913549,
0.4048871994,
-0.0430671014,
0.0471237302,
0.1536122561,
-0.2586249411,
-0.055386439,
-0.1395985782,
0.0791327581,
-0.0761687234,
0.2284357399,
0.2975741923,
0.2531299293,
-0.0203261152,
-0.3027899861,
0.2781988978,
-0.2991172075,
-0.1905634999,
-0.0421643481,
0.0779535845,
-0.118189998,
-0.3645499945,
-0.3952229321,
-0.4591896534,
-0.334587872,
0.4066638947,
-0.0599520653,
0.1627809107,
0.2841716111,
0.1749651879,
0.2511927485,
0.1270662397,
-0.1767323762,
-0.2883631289,
0.1619478762,
0.2229670137,
0.0186428484,
-0.2608917058,
-0.0488842018,
-0.1683621705,
-0.0411668718,
-0.2099182457,
-0.1619538218,
0.0679083094,
-0.4185373187,
0.2506227195,
0.1012953594,
0.2987335324,
0.6218906641,
0.2733476758,
-0.15714477,
-0.0458589159,
-0.2676424384,
0.1766681671,
0.2072681487,
0.2516288757,
-0.0044126855,
0.1994469464,
-0.009048962,
0.7935594916,
0.2588759661,
-0.2274363786,
0.2747074068,
0.0024316993,
-0.1775774807,
-0.0838077143,
-0.1573297232,
-0.06351991,
-0.3232713342,
0.1069676727,
0.2216328979,
-0.1139479056,
-0.1790082157,
0.0517216399,
0.1503134668,
-0.0914622843,
-0.2932104468,
0.4917779267,
0.2086159736,
-0.1075983793,
0.0574083552,
-0.0566315912,
-0.1271752417,
0.0405727886,
-0.0875589326,
0.0143407974,
0.0110161034,
-0.1077002138,
-0.17657502,
-0.2057752162,
-0.5075410604,
0.503591001,
0.1288685203,
0.3068886995,
-0.1078220308,
-0.2095699459,
-0.0616330244,
-0.0828854367,
0.8502635956,
-0.3850914836,
0.0100379772,
0.1193700731,
-0.2391629517,
-0.251441896,
-0.2370383739,
-0.2766326368,
0.3788049817,
0.3212099373,
0.4916626811,
-0.2372593135,
-0.1024899632,
0.3546543419,
0.0173878614,
-0.1381927729,
-0.3041336834,
-0.3489316404,
-0.2444817722,
-0.4569969773,
-0.0768627226,
0.2236949652,
0.1462451369,
-0.1781132668,
0.056918148,
-0.0031949945,
-0.2490134388,
0.2492821068,
0.0251971763,
0.1551801264,
0.2063274533,
0.0066009229,
-0.0015962312,
0.2242493033,
-0.1629244089,
0.2497968674,
-0.1691099107,
0.0070374175,
0.2945016325,
-0.2529670596,
0.3081227541,
0.177214548,
0.0588470362,
0.3214896619,
0.2185169458,
0.3157063425,
-0.0787475184,
0.1128966883,
0.3214443624,
0.2550253868,
-0.152122438,
-0.2701737583,
0.5763700008,
0.2069913298,
0.0711069852,
0.2796464562,
-0.2895083129,
-0.2001235485,
0.1952394545,
-0.0853106305,
0.8592374921,
-0.0334539264,
0.1365755498,
0.1039630845,
0.0401420668,
0.396315366,
0.1884867847,
0.1458000839,
-0.4285915494,
0.0199722834,
0.0063633164,
-0.1561585218,
0.0699793547,
0.1950135529,
-0.4718107879,
0.398937732,
-0.1540241838,
-0.1372061223,
-0.0209685564,
0.2605489492,
0.0444880314,
-0.267472595,
0.0987743214,
0.1068308651,
-0.0973727927,
0.2509977221,
0.0981686935,
-0.0154080102,
0.0768261999,
-0.3066432178,
-0.3827332258,
0.1194456667,
-0.2119662762,
0.568112433,
0.2654309273,
0.1176432967,
0.3349753618,
0.1474426389,
0.0042989673,
0.1244659647,
-0.1284873486,
-0.013692799,
0.0300501008,
0.1223832667,
-0.213833034,
-0.0197316576,
0.219378978,
0.038054768,
-0.3936787546,
-0.161358878,
-0.0826721489,
0.0640948638,
-0.1460668296,
0.0284339637,
0.0239788275,
-0.2233828157,
-0.4673123956,
0.0605950467,
-0.3597425818,
-0.2393893003,
0.1097849086,
-0.0251403619,
-0.4206593931,
0.2320711613,
0.0984067097,
-0.2648562789,
0.0974481776,
0.4654228985,
0.1427572221,
0.3938292265,
0.6578114033,
0.4816330075,
-0.1619143784,
-0.2177281082,
-0.1378335208,
0.2559017539,
-0.51920259,
0.2636252344,
0.1261709481,
-0.1565433741,
-0.0247527994,
0.3667329848,
0.0422929339,
0.2563845217,
-0.2222355157,
-0.2846603394,
-0.4323418438,
0.0412189364,
-0.0124556748,
0.1584906727,
0.0377330631,
0.4392096698,
0.0725224763,
0.3446769714,
-0.3166030049,
0.1015891731,
-0.4592546523,
0.1270507574,
0.0869546682,
-0.388499856,
0.0071809054,
0.1028388292,
0.1086363941,
0.3090006411,
-0.2994250953,
-0.2348469943,
-0.2264027745,
0.0722890869,
-0.0692547262,
-0.059401188,
0.2124276757,
0.2266765982,
-0.0329502895,
-0.1760736555,
-0.007587662,
0.0521181636,
-0.0104458621,
0.1474793553,
0.2194553912,
0.0195674393,
-0.1188959256,
0.0047814054,
-0.240738973,
0.0302963499,
0.1427272409,
0.0124202687,
0.1459381878,
0.0674339458,
-0.1345791221,
-0.1771808118,
0.0809550062,
0.1359448731,
-0.1907651275,
-0.3552043438,
-0.2111648768,
-0.19629623,
0.2878014445,
0.1750218719,
-0.1338814795,
0.0425298139,
0.0711075589,
0.229493916,
-0.3894508481,
0.1009598225,
0.3159348667,
-0.0812981948,
0.2417638302,
0.2346811593,
-0.1067333296,
0.165550679,
-0.2935239971,
0.1267088503,
0.002271441,
-0.4911993742,
-0.0092728231,
0.0905084312,
-0.1272119284,
0.1393160671,
0.3981225491,
-0.0438104235,
0.2180087268,
0.1734298766,
-0.0295288712,
0.2861862183,
-0.3371942043,
0.1603491306,
0.0428447872,
-0.6167392135,
0.2229513675,
0.3042711318,
-0.1545280069,
0.2104465067,
-0.0307248626,
0.3675804436,
-0.5919651985,
-0.1959851831,
-0.085137859,
0.2790285945,
-0.3977423608,
-0.4198271036,
-0.0324660912,
-0.0547240786,
-0.217980504,
0.0574034154,
-0.071031101,
0.1367315799,
0.3471319973,
0.0215958953,
-0.1445553303,
-0.3487922251,
-0.1260677874,
-0.0126960967,
0.1340657622,
-0.295692265,
0.0682362393,
0.2749159634,
-0.0459633283,
-0.5047231317,
0.2228363603,
0.5591905713,
0.3988352716,
-0.3692158163,
0.072574921,
-0.0395946242,
0.0618858784,
-0.1044702381,
0.0768813044,
0.0960941613,
0.1491709501,
0.2230304629,
0.1165980473,
-0.2096038908,
-0.0821887478,
0.1226789802,
0.3338049948,
0.0517793037,
0.4257689416,
-0.0936319977,
-0.2233311236,
-0.0471885055,
0.1381964982,
-0.4184858799,
0.2153059244,
0.5088742375,
-0.2176353633,
0.2733809352,
-0.0391261838,
0.0981447622,
-0.001267156,
0.634100616,
0.1495896131,
0.0237325393,
-0.4357897937,
0.2468437105,
-0.5064617991,
0.0341479145,
-0.2610830069,
0.1438061595,
-0.3708486855,
0.3476607502,
0.1202935427,
-0.0631868765,
-0.0096284701,
0.3259033263,
0.2164499015,
0.353852421,
-0.3152365088,
-0.1542020291,
-0.2725808322,
-0.2114034444,
0.3093434274,
-0.4370570183,
0.012966074,
0.1691233218,
0.0520184897,
-0.362164259,
0.0353428684,
0.0055552851,
0.1597290188,
-0.0082194023,
0.2578549981,
0.4893648326,
-0.2150484025,
-0.0147049995,
-0.0939580202,
-0.0348747075,
-0.1650542915,
0.0245870166,
0.0982369184,
0.5375679731,
-0.2332441807,
0.3349668086,
-0.4291659594,
0.1068599969,
0.0017597415,
0.0730224103,
-0.1125724912,
0.184457168,
0.1445151716,
0.0153929684,
0.004369895,
0.3746377528,
0.0124349715,
-0.0591240451,
-0.196019277,
-0.2834496796,
0.640127182,
-0.292301029,
-0.4539926052,
-0.4232748747,
0.1518880129,
-0.2287296504,
-0.0712870285,
-0.5009864569,
0.0414506011,
0.1367102861,
-0.0241664965,
-0.4582681358,
0.2389634848,
0.0122076673,
-0.2194103897,
-0.0912202373,
0.3244310617,
0.1423427016,
-0.29269135,
0.1541835219,
-0.3422248363
] |
https://github.com/huggingface/datasets/issues/1769 | _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union when calling datasets.map with num_proc=2 | > Hi ! What version of python and datasets do you have ? And also what version of dill and pickle ?
python==3.6.10
datasets==1.2.1
dill==0.3.2
pickle.format_version==4.0 | It may be a bug of multiprocessing with Datasets, when I disable the multiprocessing by set num_proc to None, everything works fine.
The script I use is https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm_wwm.py
Script args:
```
--model_name_or_path
../../../model/chinese-roberta-wwm-ext
--train_file
/nfs/volume-377-2/bert/data/test/train.txt
--output_dir
test
--do_train
--per_device_train_batch_size
2
--gradient_accumulation_steps
2
--learning_rate
1e-4
--max_steps
1000
--warmup_steps
10
--save_steps
1000
--save_total_limit
1
--seed
23333
--max_seq_length
512
--preprocessing_num_workers
2
--cache_dir
/nfs/volume-377-2/bert/data/test/cache
```
Where the `/nfs/volume-377-2/bert/data/test/train.txt` is just a toy example with 10000 lines of random string, you should be able to reproduce this error esaily.
Full Traceback:
```
Traceback (most recent call last):
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 398, in <module>
main()
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 325, in main
load_from_cache_file=not data_args.overwrite_cache,
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in map
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in <dictcomp>
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in map
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in <listcomp>
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 644, in get
raise self._value
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 424, in _handle_tasks
put(task)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/connection.py", line 209, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump
StockPickler.dump(self, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 409, in dump
self.save(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function
obj.__dict__, fkwdefaults), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell
pickler.save_reduce(_create_cell, (f,), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 521, in save
self.save_reduce(obj=obj, *rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 605, in save_reduce
save(cls)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type
obj.__bases__, _dict), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 507, in save
self.save_global(obj, rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 927, in save_global
(obj, module_name, name))
_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union
```
| 26 | _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union when calling datasets.map with num_proc=2
It may be a bug of multiprocessing with Datasets, when I disable the multiprocessing by set num_proc to None, everything works fine.
The script I use is https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm_wwm.py
Script args:
```
--model_name_or_path
../../../model/chinese-roberta-wwm-ext
--train_file
/nfs/volume-377-2/bert/data/test/train.txt
--output_dir
test
--do_train
--per_device_train_batch_size
2
--gradient_accumulation_steps
2
--learning_rate
1e-4
--max_steps
1000
--warmup_steps
10
--save_steps
1000
--save_total_limit
1
--seed
23333
--max_seq_length
512
--preprocessing_num_workers
2
--cache_dir
/nfs/volume-377-2/bert/data/test/cache
```
Where the `/nfs/volume-377-2/bert/data/test/train.txt` is just a toy example with 10000 lines of random string, you should be able to reproduce this error esaily.
Full Traceback:
```
Traceback (most recent call last):
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 398, in <module>
main()
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 325, in main
load_from_cache_file=not data_args.overwrite_cache,
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in map
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in <dictcomp>
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in map
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in <listcomp>
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 644, in get
raise self._value
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 424, in _handle_tasks
put(task)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/connection.py", line 209, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump
StockPickler.dump(self, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 409, in dump
self.save(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function
obj.__dict__, fkwdefaults), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell
pickler.save_reduce(_create_cell, (f,), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 521, in save
self.save_reduce(obj=obj, *rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 605, in save_reduce
save(cls)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type
obj.__bases__, _dict), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 507, in save
self.save_global(obj, rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 927, in save_global
(obj, module_name, name))
_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union
```
> Hi ! What version of python and datasets do you have ? And also what version of dill and pickle ?
python==3.6.10
datasets==1.2.1
dill==0.3.2
pickle.format_version==4.0 | [
-0.2903596759,
-0.297428906,
0.113244459,
0.1903710514,
0.1661586612,
-0.0522101186,
0.332113564,
0.2303638011,
0.2993956208,
0.2801508307,
0.0167169757,
0.3376861513,
-0.111044623,
0.2174143046,
0.0041830107,
-0.1060651168,
-0.1158020496,
-0.1348112375,
-0.3830085397,
0.0106053464,
-0.2922797203,
0.3295295537,
-0.3364179432,
0.178581059,
-0.6447756886,
-0.0980493948,
-0.0480727851,
0.2914253175,
0.0867960826,
-0.0838412195,
0.0912964344,
-0.0355662666,
0.0124875624,
0.4959759116,
-0.0001100203,
0.0433962531,
0.2030377239,
-0.0829198435,
-0.0667255968,
-0.4173733592,
0.0713779405,
-0.0390123427,
0.0707583129,
-0.0548069179,
0.1504489481,
0.1799489707,
0.1406909078,
-0.0804707259,
0.2613467276,
0.1155146435,
0.194408372,
0.5662002563,
0.1144359112,
-0.0761355981,
-0.1252600253,
0.2157487869,
-0.0322175324,
0.2660857439,
0.1158299074,
-0.1664743721,
-0.2567045093,
0.2081438899,
-0.0091969697,
0.2851696312,
-0.155352667,
0.3262344599,
0.0900291428,
-0.2589211762,
0.1284048259,
0.3979731202,
0.0784634501,
-0.2320567071,
-0.3231722713,
-0.0680227131,
-0.0854360536,
-0.1713584363,
0.0877537951,
0.1660901159,
-0.1176945865,
0.085168153,
-0.2029173523,
0.1319693625,
0.220704332,
0.1039849296,
0.2320754826,
0.3622329235,
-0.0313422158,
0.3686206043,
0.2795687318,
-0.1373412907,
-0.2073920518,
-0.1868889779,
0.0720699802,
0.0632181838,
-0.0458194204,
-0.1408385187,
0.0455081388,
-0.0947568119,
0.0736563802,
-0.1785828471,
-0.1766466051,
0.1712975502,
-0.2389758974,
0.3193747699,
0.3000177443,
-0.1272126883,
-0.0990269929,
0.2027034312,
0.4027113616,
-0.0739722922,
-0.2251318693,
0.1159952953,
0.3312566578,
-0.3447963297,
-0.1041946858,
0.1564332694,
0.329223305,
-0.1115077958,
-0.1496975422,
-0.1945508868,
-0.1339908391,
-0.1725839972,
-0.0103021571,
0.2903746068,
0.0592748523,
0.3461206555,
0.0566080995,
0.187803492,
-0.5467140079,
-0.0829291418,
-0.33981058,
0.2189269662,
-0.1916942894,
0.0626075193,
0.2220833898,
0.2673143446,
0.3550159335,
0.1994699836,
-0.0371263959,
-0.1523097157,
0.2351192236,
-0.2494035065,
-0.1287895888,
0.1925626397,
0.1652553231,
0.2886992097,
0.2680858076,
-0.3080252111,
-0.0635942146,
0.0783040598,
-0.2370542437,
-0.2890687287,
-0.0729558393,
0.1396500021,
-0.014291049,
0.1257888079,
-0.1699091941,
0.0447562858,
0.4315926433,
-0.0497589856,
-0.1882438511,
-0.2977279425,
-0.3939256072,
-0.2207494676,
-0.0378484242,
0.3762209713,
-0.23416619,
-0.1520402879,
0.1977586299,
-0.1235370636,
0.5048831105,
0.5401952863,
-0.2475930154,
-0.0822769031,
-0.1492325813,
0.6606736183,
0.0360708609,
0.1096853539,
-0.2572190762,
0.2026089877,
-0.0988951176,
-0.1114995554,
-0.0841933936,
0.037050046,
-0.3572829068,
-0.0326679833,
0.4061435759,
0.1351238787,
0.0573738404,
0.1923567206,
-0.2711720467,
-0.3141673505,
0.1697523743,
-0.0544771701,
0.0685291514,
-0.275788933,
-0.126200825,
-0.0896319523,
0.4380549788,
-0.2241079062,
0.0792601183,
-0.0038883744,
0.1627583802,
-0.0515407659,
-0.0201107152,
-0.2338373959,
-0.5796086192,
0.2878188789,
-0.2233291715,
0.2118990868,
-0.0640439391,
-0.1344355494,
0.2768063545,
-0.0169790089,
-0.3259688914,
-0.0686182231,
0.075660713,
0.0722177327,
0.0509035662,
-0.182272777,
-0.0842780098,
-0.1165587604,
-0.1049534157,
-0.0149970017,
-0.4686060846,
0.0425726362,
-0.4037324488,
-0.4181522727,
-0.1895168573,
0.2076248527,
0.1067514941,
-0.0068624108,
-0.1171694919,
0.1369664818,
0.1502614319,
-0.0461103544,
-0.0495145172,
0.0562660508,
-0.0190870669,
-0.0961282179,
0.0217988361,
0.2198568881,
0.1103199273,
-0.1780937314,
-0.2147067189,
0.475146234,
0.0284070577,
0.2698735595,
0.0416777655,
0.095799461,
0.2242285162,
0.041359894,
0.1322546601,
-0.1709279269,
0.1677090377,
0.1714062542,
0.1670323312,
0.0913196206,
-0.2392710894,
0.0395234153,
0.5964307189,
0.2025490403,
0.4119848013,
0.0081309201,
-0.205907017,
-0.1373885274,
-0.1942454129,
0.0325801112,
0.6064071655,
0.1613006294,
0.0643861145,
0.001883914,
-0.1250700206,
-0.118636705,
0.0121867321,
-0.0157126375,
0.0383683443,
0.1391063035,
0.1101771966,
-0.0765569285,
-0.303314805,
-0.1031184122,
0.0103041679,
0.318467468,
-0.3177981675,
0.0145383384,
-0.3326050639,
0.4729814231,
-0.2347500324,
0.0097455867,
-0.191803962,
-0.2922730148,
-0.1737025678,
0.3688523471,
-0.2211099863,
0.1546903104,
0.1278085858,
-0.2074622214,
-0.1040063351,
0.2358912677,
0.0728946328,
-0.0771440715,
-0.2809193432,
-0.001913549,
0.4048871994,
-0.0430671014,
0.0471237302,
0.1536122561,
-0.2586249411,
-0.055386439,
-0.1395985782,
0.0791327581,
-0.0761687234,
0.2284357399,
0.2975741923,
0.2531299293,
-0.0203261152,
-0.3027899861,
0.2781988978,
-0.2991172075,
-0.1905634999,
-0.0421643481,
0.0779535845,
-0.118189998,
-0.3645499945,
-0.3952229321,
-0.4591896534,
-0.334587872,
0.4066638947,
-0.0599520653,
0.1627809107,
0.2841716111,
0.1749651879,
0.2511927485,
0.1270662397,
-0.1767323762,
-0.2883631289,
0.1619478762,
0.2229670137,
0.0186428484,
-0.2608917058,
-0.0488842018,
-0.1683621705,
-0.0411668718,
-0.2099182457,
-0.1619538218,
0.0679083094,
-0.4185373187,
0.2506227195,
0.1012953594,
0.2987335324,
0.6218906641,
0.2733476758,
-0.15714477,
-0.0458589159,
-0.2676424384,
0.1766681671,
0.2072681487,
0.2516288757,
-0.0044126855,
0.1994469464,
-0.009048962,
0.7935594916,
0.2588759661,
-0.2274363786,
0.2747074068,
0.0024316993,
-0.1775774807,
-0.0838077143,
-0.1573297232,
-0.06351991,
-0.3232713342,
0.1069676727,
0.2216328979,
-0.1139479056,
-0.1790082157,
0.0517216399,
0.1503134668,
-0.0914622843,
-0.2932104468,
0.4917779267,
0.2086159736,
-0.1075983793,
0.0574083552,
-0.0566315912,
-0.1271752417,
0.0405727886,
-0.0875589326,
0.0143407974,
0.0110161034,
-0.1077002138,
-0.17657502,
-0.2057752162,
-0.5075410604,
0.503591001,
0.1288685203,
0.3068886995,
-0.1078220308,
-0.2095699459,
-0.0616330244,
-0.0828854367,
0.8502635956,
-0.3850914836,
0.0100379772,
0.1193700731,
-0.2391629517,
-0.251441896,
-0.2370383739,
-0.2766326368,
0.3788049817,
0.3212099373,
0.4916626811,
-0.2372593135,
-0.1024899632,
0.3546543419,
0.0173878614,
-0.1381927729,
-0.3041336834,
-0.3489316404,
-0.2444817722,
-0.4569969773,
-0.0768627226,
0.2236949652,
0.1462451369,
-0.1781132668,
0.056918148,
-0.0031949945,
-0.2490134388,
0.2492821068,
0.0251971763,
0.1551801264,
0.2063274533,
0.0066009229,
-0.0015962312,
0.2242493033,
-0.1629244089,
0.2497968674,
-0.1691099107,
0.0070374175,
0.2945016325,
-0.2529670596,
0.3081227541,
0.177214548,
0.0588470362,
0.3214896619,
0.2185169458,
0.3157063425,
-0.0787475184,
0.1128966883,
0.3214443624,
0.2550253868,
-0.152122438,
-0.2701737583,
0.5763700008,
0.2069913298,
0.0711069852,
0.2796464562,
-0.2895083129,
-0.2001235485,
0.1952394545,
-0.0853106305,
0.8592374921,
-0.0334539264,
0.1365755498,
0.1039630845,
0.0401420668,
0.396315366,
0.1884867847,
0.1458000839,
-0.4285915494,
0.0199722834,
0.0063633164,
-0.1561585218,
0.0699793547,
0.1950135529,
-0.4718107879,
0.398937732,
-0.1540241838,
-0.1372061223,
-0.0209685564,
0.2605489492,
0.0444880314,
-0.267472595,
0.0987743214,
0.1068308651,
-0.0973727927,
0.2509977221,
0.0981686935,
-0.0154080102,
0.0768261999,
-0.3066432178,
-0.3827332258,
0.1194456667,
-0.2119662762,
0.568112433,
0.2654309273,
0.1176432967,
0.3349753618,
0.1474426389,
0.0042989673,
0.1244659647,
-0.1284873486,
-0.013692799,
0.0300501008,
0.1223832667,
-0.213833034,
-0.0197316576,
0.219378978,
0.038054768,
-0.3936787546,
-0.161358878,
-0.0826721489,
0.0640948638,
-0.1460668296,
0.0284339637,
0.0239788275,
-0.2233828157,
-0.4673123956,
0.0605950467,
-0.3597425818,
-0.2393893003,
0.1097849086,
-0.0251403619,
-0.4206593931,
0.2320711613,
0.0984067097,
-0.2648562789,
0.0974481776,
0.4654228985,
0.1427572221,
0.3938292265,
0.6578114033,
0.4816330075,
-0.1619143784,
-0.2177281082,
-0.1378335208,
0.2559017539,
-0.51920259,
0.2636252344,
0.1261709481,
-0.1565433741,
-0.0247527994,
0.3667329848,
0.0422929339,
0.2563845217,
-0.2222355157,
-0.2846603394,
-0.4323418438,
0.0412189364,
-0.0124556748,
0.1584906727,
0.0377330631,
0.4392096698,
0.0725224763,
0.3446769714,
-0.3166030049,
0.1015891731,
-0.4592546523,
0.1270507574,
0.0869546682,
-0.388499856,
0.0071809054,
0.1028388292,
0.1086363941,
0.3090006411,
-0.2994250953,
-0.2348469943,
-0.2264027745,
0.0722890869,
-0.0692547262,
-0.059401188,
0.2124276757,
0.2266765982,
-0.0329502895,
-0.1760736555,
-0.007587662,
0.0521181636,
-0.0104458621,
0.1474793553,
0.2194553912,
0.0195674393,
-0.1188959256,
0.0047814054,
-0.240738973,
0.0302963499,
0.1427272409,
0.0124202687,
0.1459381878,
0.0674339458,
-0.1345791221,
-0.1771808118,
0.0809550062,
0.1359448731,
-0.1907651275,
-0.3552043438,
-0.2111648768,
-0.19629623,
0.2878014445,
0.1750218719,
-0.1338814795,
0.0425298139,
0.0711075589,
0.229493916,
-0.3894508481,
0.1009598225,
0.3159348667,
-0.0812981948,
0.2417638302,
0.2346811593,
-0.1067333296,
0.165550679,
-0.2935239971,
0.1267088503,
0.002271441,
-0.4911993742,
-0.0092728231,
0.0905084312,
-0.1272119284,
0.1393160671,
0.3981225491,
-0.0438104235,
0.2180087268,
0.1734298766,
-0.0295288712,
0.2861862183,
-0.3371942043,
0.1603491306,
0.0428447872,
-0.6167392135,
0.2229513675,
0.3042711318,
-0.1545280069,
0.2104465067,
-0.0307248626,
0.3675804436,
-0.5919651985,
-0.1959851831,
-0.085137859,
0.2790285945,
-0.3977423608,
-0.4198271036,
-0.0324660912,
-0.0547240786,
-0.217980504,
0.0574034154,
-0.071031101,
0.1367315799,
0.3471319973,
0.0215958953,
-0.1445553303,
-0.3487922251,
-0.1260677874,
-0.0126960967,
0.1340657622,
-0.295692265,
0.0682362393,
0.2749159634,
-0.0459633283,
-0.5047231317,
0.2228363603,
0.5591905713,
0.3988352716,
-0.3692158163,
0.072574921,
-0.0395946242,
0.0618858784,
-0.1044702381,
0.0768813044,
0.0960941613,
0.1491709501,
0.2230304629,
0.1165980473,
-0.2096038908,
-0.0821887478,
0.1226789802,
0.3338049948,
0.0517793037,
0.4257689416,
-0.0936319977,
-0.2233311236,
-0.0471885055,
0.1381964982,
-0.4184858799,
0.2153059244,
0.5088742375,
-0.2176353633,
0.2733809352,
-0.0391261838,
0.0981447622,
-0.001267156,
0.634100616,
0.1495896131,
0.0237325393,
-0.4357897937,
0.2468437105,
-0.5064617991,
0.0341479145,
-0.2610830069,
0.1438061595,
-0.3708486855,
0.3476607502,
0.1202935427,
-0.0631868765,
-0.0096284701,
0.3259033263,
0.2164499015,
0.353852421,
-0.3152365088,
-0.1542020291,
-0.2725808322,
-0.2114034444,
0.3093434274,
-0.4370570183,
0.012966074,
0.1691233218,
0.0520184897,
-0.362164259,
0.0353428684,
0.0055552851,
0.1597290188,
-0.0082194023,
0.2578549981,
0.4893648326,
-0.2150484025,
-0.0147049995,
-0.0939580202,
-0.0348747075,
-0.1650542915,
0.0245870166,
0.0982369184,
0.5375679731,
-0.2332441807,
0.3349668086,
-0.4291659594,
0.1068599969,
0.0017597415,
0.0730224103,
-0.1125724912,
0.184457168,
0.1445151716,
0.0153929684,
0.004369895,
0.3746377528,
0.0124349715,
-0.0591240451,
-0.196019277,
-0.2834496796,
0.640127182,
-0.292301029,
-0.4539926052,
-0.4232748747,
0.1518880129,
-0.2287296504,
-0.0712870285,
-0.5009864569,
0.0414506011,
0.1367102861,
-0.0241664965,
-0.4582681358,
0.2389634848,
0.0122076673,
-0.2194103897,
-0.0912202373,
0.3244310617,
0.1423427016,
-0.29269135,
0.1541835219,
-0.3422248363
] |
https://github.com/huggingface/datasets/issues/1769 | _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union when calling datasets.map with num_proc=2 | Multiprocessing in python require all the functions to be picklable. More specifically, functions need to be picklable with `dill`.
However objects like `typing.Union[str, NoneType]` are not picklable in python <3.7.
Can you try to update your python version to python>=3.7 ?
| It may be a bug of multiprocessing with Datasets, when I disable the multiprocessing by set num_proc to None, everything works fine.
The script I use is https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm_wwm.py
Script args:
```
--model_name_or_path
../../../model/chinese-roberta-wwm-ext
--train_file
/nfs/volume-377-2/bert/data/test/train.txt
--output_dir
test
--do_train
--per_device_train_batch_size
2
--gradient_accumulation_steps
2
--learning_rate
1e-4
--max_steps
1000
--warmup_steps
10
--save_steps
1000
--save_total_limit
1
--seed
23333
--max_seq_length
512
--preprocessing_num_workers
2
--cache_dir
/nfs/volume-377-2/bert/data/test/cache
```
Where the `/nfs/volume-377-2/bert/data/test/train.txt` is just a toy example with 10000 lines of random string, you should be able to reproduce this error esaily.
Full Traceback:
```
Traceback (most recent call last):
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 398, in <module>
main()
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 325, in main
load_from_cache_file=not data_args.overwrite_cache,
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in map
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in <dictcomp>
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in map
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in <listcomp>
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 644, in get
raise self._value
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 424, in _handle_tasks
put(task)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/connection.py", line 209, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump
StockPickler.dump(self, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 409, in dump
self.save(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function
obj.__dict__, fkwdefaults), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell
pickler.save_reduce(_create_cell, (f,), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 521, in save
self.save_reduce(obj=obj, *rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 605, in save_reduce
save(cls)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type
obj.__bases__, _dict), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 507, in save
self.save_global(obj, rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 927, in save_global
(obj, module_name, name))
_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union
```
| 41 | _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union when calling datasets.map with num_proc=2
It may be a bug of multiprocessing with Datasets, when I disable the multiprocessing by set num_proc to None, everything works fine.
The script I use is https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm_wwm.py
Script args:
```
--model_name_or_path
../../../model/chinese-roberta-wwm-ext
--train_file
/nfs/volume-377-2/bert/data/test/train.txt
--output_dir
test
--do_train
--per_device_train_batch_size
2
--gradient_accumulation_steps
2
--learning_rate
1e-4
--max_steps
1000
--warmup_steps
10
--save_steps
1000
--save_total_limit
1
--seed
23333
--max_seq_length
512
--preprocessing_num_workers
2
--cache_dir
/nfs/volume-377-2/bert/data/test/cache
```
Where the `/nfs/volume-377-2/bert/data/test/train.txt` is just a toy example with 10000 lines of random string, you should be able to reproduce this error esaily.
Full Traceback:
```
Traceback (most recent call last):
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 398, in <module>
main()
File "/nfs/volume-377-2/bert/transformers/examples/language-modeling/run_mlm_wwm.py", line 325, in main
load_from_cache_file=not data_args.overwrite_cache,
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in map
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/dataset_dict.py", line 303, in <dictcomp>
for k, dataset in self.items()
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in map
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1318, in <listcomp>
transformed_shards = [r.get() for r in results]
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 644, in get
raise self._value
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/pool.py", line 424, in _handle_tasks
put(task)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/connection.py", line 209, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump
StockPickler.dump(self, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 409, in dump
self.save(obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function
obj.__dict__, fkwdefaults), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell
pickler.save_reduce(_create_cell, (f,), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 736, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 521, in save
self.save_reduce(obj=obj, *rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 605, in save_reduce
save(cls)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type
obj.__bases__, _dict), obj=obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 610, in save_reduce
save(args)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 751, in save_tuple
save(element)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 476, in save
f(self, obj) # Call unbound method with explicit self
File "/home/luban/miniconda3/envs/py36/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 821, in save_dict
self._batch_setitems(obj.items())
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 847, in _batch_setitems
save(v)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 507, in save
self.save_global(obj, rv)
File "/home/luban/miniconda3/envs/py36/lib/python3.6/pickle.py", line 927, in save_global
(obj, module_name, name))
_pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union
```
Multiprocessing in python require all the functions to be picklable. More specifically, functions need to be picklable with `dill`.
However objects like `typing.Union[str, NoneType]` are not picklable in python <3.7.
Can you try to update your python version to python>=3.7 ?
| [
-0.2903596759,
-0.297428906,
0.113244459,
0.1903710514,
0.1661586612,
-0.0522101186,
0.332113564,
0.2303638011,
0.2993956208,
0.2801508307,
0.0167169757,
0.3376861513,
-0.111044623,
0.2174143046,
0.0041830107,
-0.1060651168,
-0.1158020496,
-0.1348112375,
-0.3830085397,
0.0106053464,
-0.2922797203,
0.3295295537,
-0.3364179432,
0.178581059,
-0.6447756886,
-0.0980493948,
-0.0480727851,
0.2914253175,
0.0867960826,
-0.0838412195,
0.0912964344,
-0.0355662666,
0.0124875624,
0.4959759116,
-0.0001100203,
0.0433962531,
0.2030377239,
-0.0829198435,
-0.0667255968,
-0.4173733592,
0.0713779405,
-0.0390123427,
0.0707583129,
-0.0548069179,
0.1504489481,
0.1799489707,
0.1406909078,
-0.0804707259,
0.2613467276,
0.1155146435,
0.194408372,
0.5662002563,
0.1144359112,
-0.0761355981,
-0.1252600253,
0.2157487869,
-0.0322175324,
0.2660857439,
0.1158299074,
-0.1664743721,
-0.2567045093,
0.2081438899,
-0.0091969697,
0.2851696312,
-0.155352667,
0.3262344599,
0.0900291428,
-0.2589211762,
0.1284048259,
0.3979731202,
0.0784634501,
-0.2320567071,
-0.3231722713,
-0.0680227131,
-0.0854360536,
-0.1713584363,
0.0877537951,
0.1660901159,
-0.1176945865,
0.085168153,
-0.2029173523,
0.1319693625,
0.220704332,
0.1039849296,
0.2320754826,
0.3622329235,
-0.0313422158,
0.3686206043,
0.2795687318,
-0.1373412907,
-0.2073920518,
-0.1868889779,
0.0720699802,
0.0632181838,
-0.0458194204,
-0.1408385187,
0.0455081388,
-0.0947568119,
0.0736563802,
-0.1785828471,
-0.1766466051,
0.1712975502,
-0.2389758974,
0.3193747699,
0.3000177443,
-0.1272126883,
-0.0990269929,
0.2027034312,
0.4027113616,
-0.0739722922,
-0.2251318693,
0.1159952953,
0.3312566578,
-0.3447963297,
-0.1041946858,
0.1564332694,
0.329223305,
-0.1115077958,
-0.1496975422,
-0.1945508868,
-0.1339908391,
-0.1725839972,
-0.0103021571,
0.2903746068,
0.0592748523,
0.3461206555,
0.0566080995,
0.187803492,
-0.5467140079,
-0.0829291418,
-0.33981058,
0.2189269662,
-0.1916942894,
0.0626075193,
0.2220833898,
0.2673143446,
0.3550159335,
0.1994699836,
-0.0371263959,
-0.1523097157,
0.2351192236,
-0.2494035065,
-0.1287895888,
0.1925626397,
0.1652553231,
0.2886992097,
0.2680858076,
-0.3080252111,
-0.0635942146,
0.0783040598,
-0.2370542437,
-0.2890687287,
-0.0729558393,
0.1396500021,
-0.014291049,
0.1257888079,
-0.1699091941,
0.0447562858,
0.4315926433,
-0.0497589856,
-0.1882438511,
-0.2977279425,
-0.3939256072,
-0.2207494676,
-0.0378484242,
0.3762209713,
-0.23416619,
-0.1520402879,
0.1977586299,
-0.1235370636,
0.5048831105,
0.5401952863,
-0.2475930154,
-0.0822769031,
-0.1492325813,
0.6606736183,
0.0360708609,
0.1096853539,
-0.2572190762,
0.2026089877,
-0.0988951176,
-0.1114995554,
-0.0841933936,
0.037050046,
-0.3572829068,
-0.0326679833,
0.4061435759,
0.1351238787,
0.0573738404,
0.1923567206,
-0.2711720467,
-0.3141673505,
0.1697523743,
-0.0544771701,
0.0685291514,
-0.275788933,
-0.126200825,
-0.0896319523,
0.4380549788,
-0.2241079062,
0.0792601183,
-0.0038883744,
0.1627583802,
-0.0515407659,
-0.0201107152,
-0.2338373959,
-0.5796086192,
0.2878188789,
-0.2233291715,
0.2118990868,
-0.0640439391,
-0.1344355494,
0.2768063545,
-0.0169790089,
-0.3259688914,
-0.0686182231,
0.075660713,
0.0722177327,
0.0509035662,
-0.182272777,
-0.0842780098,
-0.1165587604,
-0.1049534157,
-0.0149970017,
-0.4686060846,
0.0425726362,
-0.4037324488,
-0.4181522727,
-0.1895168573,
0.2076248527,
0.1067514941,
-0.0068624108,
-0.1171694919,
0.1369664818,
0.1502614319,
-0.0461103544,
-0.0495145172,
0.0562660508,
-0.0190870669,
-0.0961282179,
0.0217988361,
0.2198568881,
0.1103199273,
-0.1780937314,
-0.2147067189,
0.475146234,
0.0284070577,
0.2698735595,
0.0416777655,
0.095799461,
0.2242285162,
0.041359894,
0.1322546601,
-0.1709279269,
0.1677090377,
0.1714062542,
0.1670323312,
0.0913196206,
-0.2392710894,
0.0395234153,
0.5964307189,
0.2025490403,
0.4119848013,
0.0081309201,
-0.205907017,
-0.1373885274,
-0.1942454129,
0.0325801112,
0.6064071655,
0.1613006294,
0.0643861145,
0.001883914,
-0.1250700206,
-0.118636705,
0.0121867321,
-0.0157126375,
0.0383683443,
0.1391063035,
0.1101771966,
-0.0765569285,
-0.303314805,
-0.1031184122,
0.0103041679,
0.318467468,
-0.3177981675,
0.0145383384,
-0.3326050639,
0.4729814231,
-0.2347500324,
0.0097455867,
-0.191803962,
-0.2922730148,
-0.1737025678,
0.3688523471,
-0.2211099863,
0.1546903104,
0.1278085858,
-0.2074622214,
-0.1040063351,
0.2358912677,
0.0728946328,
-0.0771440715,
-0.2809193432,
-0.001913549,
0.4048871994,
-0.0430671014,
0.0471237302,
0.1536122561,
-0.2586249411,
-0.055386439,
-0.1395985782,
0.0791327581,
-0.0761687234,
0.2284357399,
0.2975741923,
0.2531299293,
-0.0203261152,
-0.3027899861,
0.2781988978,
-0.2991172075,
-0.1905634999,
-0.0421643481,
0.0779535845,
-0.118189998,
-0.3645499945,
-0.3952229321,
-0.4591896534,
-0.334587872,
0.4066638947,
-0.0599520653,
0.1627809107,
0.2841716111,
0.1749651879,
0.2511927485,
0.1270662397,
-0.1767323762,
-0.2883631289,
0.1619478762,
0.2229670137,
0.0186428484,
-0.2608917058,
-0.0488842018,
-0.1683621705,
-0.0411668718,
-0.2099182457,
-0.1619538218,
0.0679083094,
-0.4185373187,
0.2506227195,
0.1012953594,
0.2987335324,
0.6218906641,
0.2733476758,
-0.15714477,
-0.0458589159,
-0.2676424384,
0.1766681671,
0.2072681487,
0.2516288757,
-0.0044126855,
0.1994469464,
-0.009048962,
0.7935594916,
0.2588759661,
-0.2274363786,
0.2747074068,
0.0024316993,
-0.1775774807,
-0.0838077143,
-0.1573297232,
-0.06351991,
-0.3232713342,
0.1069676727,
0.2216328979,
-0.1139479056,
-0.1790082157,
0.0517216399,
0.1503134668,
-0.0914622843,
-0.2932104468,
0.4917779267,
0.2086159736,
-0.1075983793,
0.0574083552,
-0.0566315912,
-0.1271752417,
0.0405727886,
-0.0875589326,
0.0143407974,
0.0110161034,
-0.1077002138,
-0.17657502,
-0.2057752162,
-0.5075410604,
0.503591001,
0.1288685203,
0.3068886995,
-0.1078220308,
-0.2095699459,
-0.0616330244,
-0.0828854367,
0.8502635956,
-0.3850914836,
0.0100379772,
0.1193700731,
-0.2391629517,
-0.251441896,
-0.2370383739,
-0.2766326368,
0.3788049817,
0.3212099373,
0.4916626811,
-0.2372593135,
-0.1024899632,
0.3546543419,
0.0173878614,
-0.1381927729,
-0.3041336834,
-0.3489316404,
-0.2444817722,
-0.4569969773,
-0.0768627226,
0.2236949652,
0.1462451369,
-0.1781132668,
0.056918148,
-0.0031949945,
-0.2490134388,
0.2492821068,
0.0251971763,
0.1551801264,
0.2063274533,
0.0066009229,
-0.0015962312,
0.2242493033,
-0.1629244089,
0.2497968674,
-0.1691099107,
0.0070374175,
0.2945016325,
-0.2529670596,
0.3081227541,
0.177214548,
0.0588470362,
0.3214896619,
0.2185169458,
0.3157063425,
-0.0787475184,
0.1128966883,
0.3214443624,
0.2550253868,
-0.152122438,
-0.2701737583,
0.5763700008,
0.2069913298,
0.0711069852,
0.2796464562,
-0.2895083129,
-0.2001235485,
0.1952394545,
-0.0853106305,
0.8592374921,
-0.0334539264,
0.1365755498,
0.1039630845,
0.0401420668,
0.396315366,
0.1884867847,
0.1458000839,
-0.4285915494,
0.0199722834,
0.0063633164,
-0.1561585218,
0.0699793547,
0.1950135529,
-0.4718107879,
0.398937732,
-0.1540241838,
-0.1372061223,
-0.0209685564,
0.2605489492,
0.0444880314,
-0.267472595,
0.0987743214,
0.1068308651,
-0.0973727927,
0.2509977221,
0.0981686935,
-0.0154080102,
0.0768261999,
-0.3066432178,
-0.3827332258,
0.1194456667,
-0.2119662762,
0.568112433,
0.2654309273,
0.1176432967,
0.3349753618,
0.1474426389,
0.0042989673,
0.1244659647,
-0.1284873486,
-0.013692799,
0.0300501008,
0.1223832667,
-0.213833034,
-0.0197316576,
0.219378978,
0.038054768,
-0.3936787546,
-0.161358878,
-0.0826721489,
0.0640948638,
-0.1460668296,
0.0284339637,
0.0239788275,
-0.2233828157,
-0.4673123956,
0.0605950467,
-0.3597425818,
-0.2393893003,
0.1097849086,
-0.0251403619,
-0.4206593931,
0.2320711613,
0.0984067097,
-0.2648562789,
0.0974481776,
0.4654228985,
0.1427572221,
0.3938292265,
0.6578114033,
0.4816330075,
-0.1619143784,
-0.2177281082,
-0.1378335208,
0.2559017539,
-0.51920259,
0.2636252344,
0.1261709481,
-0.1565433741,
-0.0247527994,
0.3667329848,
0.0422929339,
0.2563845217,
-0.2222355157,
-0.2846603394,
-0.4323418438,
0.0412189364,
-0.0124556748,
0.1584906727,
0.0377330631,
0.4392096698,
0.0725224763,
0.3446769714,
-0.3166030049,
0.1015891731,
-0.4592546523,
0.1270507574,
0.0869546682,
-0.388499856,
0.0071809054,
0.1028388292,
0.1086363941,
0.3090006411,
-0.2994250953,
-0.2348469943,
-0.2264027745,
0.0722890869,
-0.0692547262,
-0.059401188,
0.2124276757,
0.2266765982,
-0.0329502895,
-0.1760736555,
-0.007587662,
0.0521181636,
-0.0104458621,
0.1474793553,
0.2194553912,
0.0195674393,
-0.1188959256,
0.0047814054,
-0.240738973,
0.0302963499,
0.1427272409,
0.0124202687,
0.1459381878,
0.0674339458,
-0.1345791221,
-0.1771808118,
0.0809550062,
0.1359448731,
-0.1907651275,
-0.3552043438,
-0.2111648768,
-0.19629623,
0.2878014445,
0.1750218719,
-0.1338814795,
0.0425298139,
0.0711075589,
0.229493916,
-0.3894508481,
0.1009598225,
0.3159348667,
-0.0812981948,
0.2417638302,
0.2346811593,
-0.1067333296,
0.165550679,
-0.2935239971,
0.1267088503,
0.002271441,
-0.4911993742,
-0.0092728231,
0.0905084312,
-0.1272119284,
0.1393160671,
0.3981225491,
-0.0438104235,
0.2180087268,
0.1734298766,
-0.0295288712,
0.2861862183,
-0.3371942043,
0.1603491306,
0.0428447872,
-0.6167392135,
0.2229513675,
0.3042711318,
-0.1545280069,
0.2104465067,
-0.0307248626,
0.3675804436,
-0.5919651985,
-0.1959851831,
-0.085137859,
0.2790285945,
-0.3977423608,
-0.4198271036,
-0.0324660912,
-0.0547240786,
-0.217980504,
0.0574034154,
-0.071031101,
0.1367315799,
0.3471319973,
0.0215958953,
-0.1445553303,
-0.3487922251,
-0.1260677874,
-0.0126960967,
0.1340657622,
-0.295692265,
0.0682362393,
0.2749159634,
-0.0459633283,
-0.5047231317,
0.2228363603,
0.5591905713,
0.3988352716,
-0.3692158163,
0.072574921,
-0.0395946242,
0.0618858784,
-0.1044702381,
0.0768813044,
0.0960941613,
0.1491709501,
0.2230304629,
0.1165980473,
-0.2096038908,
-0.0821887478,
0.1226789802,
0.3338049948,
0.0517793037,
0.4257689416,
-0.0936319977,
-0.2233311236,
-0.0471885055,
0.1381964982,
-0.4184858799,
0.2153059244,
0.5088742375,
-0.2176353633,
0.2733809352,
-0.0391261838,
0.0981447622,
-0.001267156,
0.634100616,
0.1495896131,
0.0237325393,
-0.4357897937,
0.2468437105,
-0.5064617991,
0.0341479145,
-0.2610830069,
0.1438061595,
-0.3708486855,
0.3476607502,
0.1202935427,
-0.0631868765,
-0.0096284701,
0.3259033263,
0.2164499015,
0.353852421,
-0.3152365088,
-0.1542020291,
-0.2725808322,
-0.2114034444,
0.3093434274,
-0.4370570183,
0.012966074,
0.1691233218,
0.0520184897,
-0.362164259,
0.0353428684,
0.0055552851,
0.1597290188,
-0.0082194023,
0.2578549981,
0.4893648326,
-0.2150484025,
-0.0147049995,
-0.0939580202,
-0.0348747075,
-0.1650542915,
0.0245870166,
0.0982369184,
0.5375679731,
-0.2332441807,
0.3349668086,
-0.4291659594,
0.1068599969,
0.0017597415,
0.0730224103,
-0.1125724912,
0.184457168,
0.1445151716,
0.0153929684,
0.004369895,
0.3746377528,
0.0124349715,
-0.0591240451,
-0.196019277,
-0.2834496796,
0.640127182,
-0.292301029,
-0.4539926052,
-0.4232748747,
0.1518880129,
-0.2287296504,
-0.0712870285,
-0.5009864569,
0.0414506011,
0.1367102861,
-0.0241664965,
-0.4582681358,
0.2389634848,
0.0122076673,
-0.2194103897,
-0.0912202373,
0.3244310617,
0.1423427016,
-0.29269135,
0.1541835219,
-0.3422248363
] |
https://github.com/huggingface/datasets/issues/1766 | Issues when run two programs compute the same metrics | Hi ! To avoid collisions you can specify a `experiment_id` when instantiating your metric using `load_metric`. It will replace "default_experiment" with the experiment id that you provide in the arrow filename.
Also when two `experiment_id` collide we're supposed to detect it using our locking mechanism. Not sure why it didn't work in your case. Could you share some code that reproduces the issue ? This would help us investigate. | I got the following error when running two different programs that both compute sacreblue metrics. It seems that both read/and/write to the same location (.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow) where it caches the batches:
```
File "train_matching_min.py", line 160, in <module>ch_9_label
avg_loss = valid(epoch, args.batch, args.validation, args.with_label)
File "train_matching_min.py", line 93, in valid
bleu += eval.compute()
File "/u/tlhoang/projects/seal/match/models/eval.py", line 23, in compute
return self.metric.compute()['score']
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/metric.py", line 387, in compute
self._finalize()
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/metric.py", line 355, in _finalize
self.data = Dataset(**reader.read_files([{"filename": f} for f in file_paths]))
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 231, in read_files
pa_table = self._read_files(files)
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 170, in _read_files
pa_table: pa.Table = self._get_dataset_from_filename(f_dict)
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 299, in _get_dataset_from_filename
pa_table = f.read_all()
File "pyarrow/ipc.pxi", line 481, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Expected to read 1819307375 metadata bytes, but only read 454396
``` | 69 | Issues when run two programs compute the same metrics
I got the following error when running two different programs that both compute sacreblue metrics. It seems that both read/and/write to the same location (.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow) where it caches the batches:
```
File "train_matching_min.py", line 160, in <module>ch_9_label
avg_loss = valid(epoch, args.batch, args.validation, args.with_label)
File "train_matching_min.py", line 93, in valid
bleu += eval.compute()
File "/u/tlhoang/projects/seal/match/models/eval.py", line 23, in compute
return self.metric.compute()['score']
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/metric.py", line 387, in compute
self._finalize()
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/metric.py", line 355, in _finalize
self.data = Dataset(**reader.read_files([{"filename": f} for f in file_paths]))
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 231, in read_files
pa_table = self._read_files(files)
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 170, in _read_files
pa_table: pa.Table = self._get_dataset_from_filename(f_dict)
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 299, in _get_dataset_from_filename
pa_table = f.read_all()
File "pyarrow/ipc.pxi", line 481, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Expected to read 1819307375 metadata bytes, but only read 454396
```
Hi ! To avoid collisions you can specify a `experiment_id` when instantiating your metric using `load_metric`. It will replace "default_experiment" with the experiment id that you provide in the arrow filename.
Also when two `experiment_id` collide we're supposed to detect it using our locking mechanism. Not sure why it didn't work in your case. Could you share some code that reproduces the issue ? This would help us investigate. | [
-0.3611739874,
-0.1505348682,
-0.0431875437,
0.3872226477,
0.2670592666,
-0.1068402156,
0.0815508589,
0.3045550883,
-0.1409018636,
0.2166145891,
-0.3760762811,
-0.0134596685,
0.0852671862,
0.0051950905,
-0.1859993935,
-0.0460624062,
0.0034710031,
-0.0094137117,
0.0772824436,
-0.0010647849,
-0.2850643694,
0.2279988378,
0.0163464509,
0.2554322481,
-0.1016234234,
-0.1028562263,
-0.0135520753,
-0.1215875819,
-0.0857028663,
-0.4742897749,
0.4356844425,
0.0281860791,
-0.1604654342,
0.7840997577,
-0.0001188638,
0.0990641415,
0.2483719885,
0.025843326,
-0.0703955591,
-0.3716359437,
0.0305293389,
-0.0560129061,
0.1552927941,
-0.2752089202,
0.0879633427,
-0.1430892944,
0.0955483913,
-0.5427467227,
0.3801246583,
0.1647429615,
0.1546674222,
0.5314352512,
-0.4868217409,
-0.1824202985,
0.1283856332,
-0.0579498634,
-0.0503400452,
0.544521153,
0.0008056565,
0.204407081,
0.0235877614,
0.4144552946,
-0.1186396852,
0.2631289959,
0.0570788011,
0.0971548408,
0.4060329199,
-0.0158636495,
0.1656937748,
-0.124043487,
0.257058233,
-0.3838201761,
-0.2255288959,
0.1382776201,
-0.1987223029,
-0.5372884274,
0.1851032674,
0.1369578987,
-0.1783016622,
-0.1763567179,
-0.2779462337,
0.0720573664,
-0.2121040821,
-0.1963712126,
0.0815002918,
-0.2687270045,
-0.1574118435,
0.1643318981,
0.1694015414,
0.3121425807,
0.1240121648,
0.001844292,
-0.1553132087,
-0.0082678627,
-0.4027776718,
0.0542566627,
-0.3037118316,
-0.3437740803,
-0.0953911617,
0.2882912755,
0.3789707124,
-0.0451942608,
0.2840239406,
0.2224461734,
0.0309232138,
0.7004983425,
0.149849996,
0.2902024686,
0.2009003013,
0.1810622364,
-0.3100052476,
-0.1913625598,
0.1990119964,
-0.5310233235,
0.2414132357,
0.2200145423,
-0.013256222,
-0.3235706389,
-0.4480688274,
0.0615481362,
0.1938806623,
-0.0467139259,
0.1330564916,
0.3195026815,
0.0339148641,
0.0123235928,
0.1278749406,
0.4262724817,
-0.2209418714,
0.2100049257,
-0.2910305262,
0.1002698764,
-0.4435736537,
0.3646079898,
0.0474662036,
-0.0839140117,
0.2243039757,
-0.0320464708,
0.4031940997,
-0.308930546,
0.3652124405,
-0.4421755672,
-0.0029978855,
0.0954084992,
0.0782012269,
0.2251206189,
0.2995716333,
-0.0981403291,
-0.0811050013,
-0.0738897398,
-0.1872104555,
-0.1491117179,
0.5365417004,
0.1563583761,
-0.0131785385,
0.4289541543,
-0.3462411165,
-0.0732100904,
0.3937606215,
-0.217310071,
0.0699690878,
0.006571196,
-0.4017103612,
-0.3470821083,
0.1470746845,
0.3551439643,
-0.2117387354,
-0.0738256574,
0.2929493487,
0.1298287809,
-0.0102832066,
0.468542099,
-0.2201553434,
0.1626341641,
-0.2866149843,
-0.0245942734,
0.5620936751,
-0.8298754692,
-0.3216197491,
0.1176253334,
-0.1634728462,
-0.3332689404,
0.0825221762,
0.0429989398,
0.3266255856,
-0.0876052603,
0.0890729427,
-0.2243261039,
0.1395228356,
-0.1509534419,
-0.3216230571,
-0.3151447177,
-0.0638329163,
-0.2678599954,
0.2974454463,
-0.0471402109,
0.243496716,
-0.206374079,
-0.0600684211,
-0.1215572506,
0.0200317577,
0.2438933253,
0.1884081215,
-0.0286049657,
0.099135071,
-0.2850906551,
0.2925026715,
0.1448740363,
-0.5383431315,
-0.2961363792,
0.1691066027,
-0.2005107701,
-0.1927507371,
-0.0857768208,
-0.0706391037,
-0.1958031654,
0.0659020245,
0.1360586137,
0.2209206969,
0.278021276,
-0.0576282218,
0.3118049204,
-0.0584467687,
0.0707679763,
-0.0973505527,
0.0738312453,
-0.1232284084,
-0.2663716674,
-0.0980602577,
0.0787085444,
0.3763606548,
-0.0226038303,
-0.1681239158,
0.3127593994,
-0.1168538556,
0.2160869986,
0.1792307347,
0.1188419387,
0.1721315235,
-0.2322573364,
0.0048488309,
-0.0386071727,
0.1945937723,
-0.0987801179,
0.4015490711,
0.2953326106,
-0.022890877,
0.1296619475,
0.2755025923,
0.0170341525,
-0.100752458,
0.0285556391,
0.1727865785,
-0.1901309192,
0.3023919165,
-0.0971516743,
0.0521631874,
-0.1124894917,
0.0968034342,
-0.1043635607,
0.1355573684,
0.1627226919,
-0.0012207121,
-0.1695544422,
-0.036949832,
0.073287949,
-0.2711123526,
0.2889000177,
0.7128474116,
0.0229041874,
0.1526314765,
0.1330120713,
0.0188373923,
-0.1760330647,
0.1453157514,
0.209442988,
-0.1075594053,
0.0993785411,
0.166222021,
-0.0816873088,
-0.0364566781,
0.0903406739,
0.0381225385,
-0.0213954281,
-0.1647394449,
0.392378211,
-0.0219713096,
0.07535588,
-0.5359924436,
0.0141770495,
-0.0288163591,
-0.1689181775,
-0.1003931761,
0.3601458073,
0.0499681905,
0.0707450435,
-0.2301942259,
0.5003134608,
-0.2754375339,
0.2575499713,
0.0213136859,
-0.155104205,
-0.3020186722,
-0.0712805539,
0.1685052216,
0.0605502389,
0.3412748277,
-0.1754941493,
-0.0699495673,
-0.2088632435,
-0.1869239658,
-0.0449573398,
0.2885993123,
0.488894999,
-0.0525452532,
-0.1393488497,
-0.3070412874,
-0.3469005525,
0.3138328493,
-0.404835552,
-0.2079188079,
-0.1324312985,
0.0150447311,
-0.2289838195,
-0.1872953773,
-0.1068752855,
-0.024506839,
-0.2213676274,
0.2083865106,
-0.200125441,
0.0360721424,
0.0712471977,
-0.174055621,
0.1142759025,
0.0748569593,
0.1112006903,
-0.277882427,
-0.1941747963,
0.0222590081,
-0.4008956254,
-0.1950280666,
-0.0420212485,
0.1363779157,
0.4599738121,
0.2368848622,
-0.4259492457,
-0.4368488193,
-0.1682189256,
-0.117376022,
0.1020150259,
-0.0418611877,
0.0551186502,
-0.0682304278,
-0.1335439533,
-0.1503507644,
-0.1933319569,
0.5020689368,
-0.2520497441,
0.0685733706,
-0.1603964716,
-0.1222268417,
0.0443002358,
0.8054543734,
0.4146432877,
0.0838827416,
0.3142865598,
0.2035723478,
0.3654498756,
0.003969444,
-0.3886854947,
0.1884926558,
0.0200653877,
-0.2714689076,
0.127963841,
-0.0859000906,
0.105466418,
-0.1473998874,
-0.1158736274,
-0.2137656212,
-0.0955248922,
-0.1489700079,
-0.2166235447,
0.2357062548,
0.0829565674,
0.0911732167,
-0.321669966,
0.0277164839,
0.2208308131,
0.2361792475,
-0.2803711891,
0.0243197847,
-0.1450073123,
-0.1817687303,
-0.2225547433,
0.5148037672,
0.0891623795,
0.2446998805,
-0.2091471851,
0.1408787519,
0.0523313321,
-0.0709713027,
0.6638154984,
-0.0739479512,
-0.0868658498,
-0.1109796166,
-0.0193758309,
-0.4094041586,
-0.1419024169,
0.0550741404,
0.1366430968,
0.1798200905,
0.4839467108,
-0.1208596677,
-0.0051791277,
-0.0153059997,
0.0120948935,
-0.1854644567,
-0.2006286234,
-0.3357677758,
-0.3831155002,
0.0732775107,
0.0737478733,
-0.0195127334,
0.0452136211,
-0.0937865824,
0.094069913,
-0.1731127501,
0.0474344417,
0.2436569333,
-0.0133806104,
0.5679036379,
-0.36991027,
0.1197623536,
0.277443856,
0.081316106,
0.2905483842,
0.2618487179,
-0.1487619877,
-0.4146741033,
0.1154792979,
0.0839686096,
-0.0068025379,
0.4959120452,
-0.1706466228,
0.1998106837,
-0.0143724103,
-0.0525067374,
0.1222910061,
0.0716387033,
0.2608546317,
0.3012567759,
-0.0817965046,
-0.1803608537,
0.0001942228,
0.4088627994,
-0.1110963821,
0.4448749125,
-0.3718874156,
-0.1304302216,
0.1831737608,
0.2075397819,
1.1415234804,
0.1096202582,
0.0940428302,
0.3654056787,
-0.378801018,
0.1448805332,
-0.1338839829,
0.3521232903,
-0.2913299501,
-0.4262790978,
0.04439836,
-0.4234814942,
0.0784709305,
-0.25822559,
-0.0987936482,
0.2994015217,
-0.2575716972,
0.022854127,
-0.1675747484,
-0.0094809094,
-0.1764464825,
0.1637747884,
0.2784409523,
0.1187393889,
-0.1347371638,
0.1918251216,
-0.1957796514,
-0.2062196881,
-0.2727338672,
-0.124128446,
-0.1999100745,
0.125476554,
-0.3591464162,
0.547729969,
-0.0289823767,
-0.1873504817,
-0.0564384162,
0.3179166615,
1.0567494631,
-0.0337516703,
-0.053227745,
0.1115202978,
0.1322744191,
0.07698147,
0.0788676068,
-0.4823551178,
0.1216790751,
-0.1621989906,
-0.2046579272,
-0.0102406843,
0.1712740064,
0.0545480289,
0.1436230391,
0.0065043219,
-0.0442722067,
-0.1453603357,
0.0713086799,
0.0538247004,
-0.0382304862,
-0.1429395229,
0.03658586,
-0.0503246076,
-0.2049170732,
0.129308641,
-0.2136396021,
-0.3586627841,
0.1601791233,
0.2391819209,
0.3221598268,
-0.3406074941,
0.5207620263,
-0.4181825519,
-0.1647209078,
-0.1229279861,
-0.4281489253,
-0.1048448309,
-0.4858561754,
0.3519492447,
-0.3284838498,
-0.0230384041,
-0.1290414631,
0.4235874414,
0.369602263,
0.2082637697,
-0.0514330156,
-0.257573694,
-0.3079731464,
0.0665429905,
-0.2560644448,
0.2094359994,
-0.066782251,
0.2033174783,
-0.1151049957,
0.2468769997,
-0.2290827334,
0.1491089165,
-0.223580271,
-0.0578613654,
-0.0239928402,
-0.3083408475,
0.273968786,
0.0583665222,
-0.0829619691,
0.244974494,
-0.4150683284,
-0.1025744304,
-0.1703069061,
0.1670020968,
-0.2010877132,
-0.1663453132,
-0.1639755219,
-0.0849380791,
0.2917102575,
-0.0966842994,
0.0385239571,
0.4952760041,
-0.0047271764,
-0.1825710535,
-0.0801017806,
0.3579134643,
0.0760423616,
0.311290741,
0.0722696185,
-0.0891170353,
0.0455705412,
0.2249445021,
-0.1751981974,
-0.1544536203,
-0.2151746303,
-0.1035950184,
0.1023804098,
0.1173026338,
-0.2384694666,
-0.3789306879,
-0.2773681581,
0.0492624752,
0.2394447178,
0.1593903005,
-0.0221531745,
-0.1676269472,
0.0452719815,
0.1217803434,
0.0035557242,
0.0100834323,
0.0712794214,
-0.0665709674,
-0.2697436213,
0.2501282096,
0.4367045462,
-0.0595399588,
0.2153591216,
0.0835737139,
0.3153460026,
-0.3591237366,
0.4809871912,
-0.3079813719,
0.2562136352,
0.2291850001,
0.2896815538,
0.1402169466,
0.1642460972,
-0.1615502834,
-0.257815063,
0.3288826942,
0.1009147093,
-0.065624401,
-0.1758929789,
-0.1831432283,
-0.1239007339,
-0.1155412942,
-0.1164162681,
0.1536556035,
-0.0742527246,
0.4652305543,
-0.2960214913,
-0.339676708,
-0.2351729572,
0.0977833346,
-0.2720488012,
-0.1077876911,
0.0314898975,
-0.3171126246,
0.2278344929,
0.0468037911,
0.2442207187,
0.2121109366,
0.2209789306,
0.0465212464,
-0.2491005063,
0.060720399,
-0.273798883,
0.6104676127,
0.0576189123,
-0.1199757382,
0.3298228383,
0.2280459702,
-0.041749496,
0.0415109247,
0.6623184681,
0.5221059918,
0.3618001938,
0.091081515,
-0.1146945879,
0.2342062891,
0.1228308305,
-0.014762016,
0.1736105233,
0.252183497,
-0.1960240155,
0.247168988,
0.1507106274,
-0.1146791056,
0.3636131883,
-0.0644531697,
0.2004001588,
-0.2909460664,
0.2844317257,
-0.1778315604,
0.0205781162,
-0.1967292577,
-0.0421836525,
-0.5328441858,
0.1024000198,
0.2991533577,
-0.179036051,
0.2391098291,
-0.0970063433,
0.071795851,
0.1840811968,
0.2452762276,
0.4780640006,
0.1257412434,
-0.5874686241,
0.0541214123,
-0.4772073627,
0.4764413238,
0.059209913,
0.4164778292,
-0.2925384939,
0.2583390474,
-0.2482524663,
-0.162359193,
0.4818671942,
0.1885390431,
-0.0308831874,
0.0682152212,
-0.5626353025,
0.1788058728,
0.0410296991,
-0.3143729866,
0.2532075942,
-0.3407097459,
0.0291235354,
0.000925413,
0.0330467857,
0.2292574644,
0.0543097109,
0.0794536471,
-0.0988799557,
0.339713037,
0.1724282503,
0.3838354349,
0.0864273459,
0.0152714215,
-0.0633854568,
-0.1108326316,
-0.241247952,
-0.1147981957,
0.0356720276,
0.222644344,
-0.5101050735,
0.0544220693,
-0.3817656636,
0.203305766,
0.2425131202,
-0.2194540799,
0.0528793447,
-0.0975426957,
0.0198447853,
0.0163122732,
0.4529067576,
0.4042088389,
0.0936901718,
0.4554380476,
-0.3360856473,
-0.1296243519,
0.5763479471,
-0.5234943032,
-0.2780393958,
0.1190043911,
0.4433910847,
0.3935000598,
0.0013249628,
-0.653067112,
-0.0659775957,
0.2789849043,
-0.1601077616,
-0.0528022796,
0.1729200631,
-0.3497535288,
-0.0094574085,
0.1064968929,
0.0148757817,
0.026049193,
-0.3596190214,
0.0831908733,
-0.2089134604
] |
https://github.com/huggingface/datasets/issues/1766 | Issues when run two programs compute the same metrics | Thank you for your response. I fixed the issue by set "keep_in_memory=True" when load_metric.
I cannot share the entire source code but below is the wrapper I wrote:
```python
class Evaluation:
def __init__(self, metric='sacrebleu'):
# self.metric = load_metric(metric, keep_in_memory=True)
self.metric = load_metric(metric)
def add(self, predictions, references):
self.metric.add_batch(predictions=predictions, references=references)
def compute(self):
return self.metric.compute()['score']
```
Then call the given wrapper as follows:
```python
eval = Evaluation(metric='sacrebleu')
for query, candidates, labels in tqdm(dataset):
predictions = net.generate(query)
references = [[s] for s in labels]
eval.add(predictions, references)
if n % 100 == 0:
bleu += eval.compute()
eval = Evaluation(metric='sacrebleu') | I got the following error when running two different programs that both compute sacreblue metrics. It seems that both read/and/write to the same location (.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow) where it caches the batches:
```
File "train_matching_min.py", line 160, in <module>ch_9_label
avg_loss = valid(epoch, args.batch, args.validation, args.with_label)
File "train_matching_min.py", line 93, in valid
bleu += eval.compute()
File "/u/tlhoang/projects/seal/match/models/eval.py", line 23, in compute
return self.metric.compute()['score']
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/metric.py", line 387, in compute
self._finalize()
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/metric.py", line 355, in _finalize
self.data = Dataset(**reader.read_files([{"filename": f} for f in file_paths]))
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 231, in read_files
pa_table = self._read_files(files)
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 170, in _read_files
pa_table: pa.Table = self._get_dataset_from_filename(f_dict)
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 299, in _get_dataset_from_filename
pa_table = f.read_all()
File "pyarrow/ipc.pxi", line 481, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Expected to read 1819307375 metadata bytes, but only read 454396
``` | 94 | Issues when run two programs compute the same metrics
I got the following error when running two different programs that both compute sacreblue metrics. It seems that both read/and/write to the same location (.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow) where it caches the batches:
```
File "train_matching_min.py", line 160, in <module>ch_9_label
avg_loss = valid(epoch, args.batch, args.validation, args.with_label)
File "train_matching_min.py", line 93, in valid
bleu += eval.compute()
File "/u/tlhoang/projects/seal/match/models/eval.py", line 23, in compute
return self.metric.compute()['score']
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/metric.py", line 387, in compute
self._finalize()
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/metric.py", line 355, in _finalize
self.data = Dataset(**reader.read_files([{"filename": f} for f in file_paths]))
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 231, in read_files
pa_table = self._read_files(files)
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 170, in _read_files
pa_table: pa.Table = self._get_dataset_from_filename(f_dict)
File "/dccstor/know/anaconda3/lib/python3.7/site-packages/datasets/arrow_reader.py", line 299, in _get_dataset_from_filename
pa_table = f.read_all()
File "pyarrow/ipc.pxi", line 481, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Expected to read 1819307375 metadata bytes, but only read 454396
```
Thank you for your response. I fixed the issue by set "keep_in_memory=True" when load_metric.
I cannot share the entire source code but below is the wrapper I wrote:
```python
class Evaluation:
def __init__(self, metric='sacrebleu'):
# self.metric = load_metric(metric, keep_in_memory=True)
self.metric = load_metric(metric)
def add(self, predictions, references):
self.metric.add_batch(predictions=predictions, references=references)
def compute(self):
return self.metric.compute()['score']
```
Then call the given wrapper as follows:
```python
eval = Evaluation(metric='sacrebleu')
for query, candidates, labels in tqdm(dataset):
predictions = net.generate(query)
references = [[s] for s in labels]
eval.add(predictions, references)
if n % 100 == 0:
bleu += eval.compute()
eval = Evaluation(metric='sacrebleu') | [
-0.3611739874,
-0.1505348682,
-0.0431875437,
0.3872226477,
0.2670592666,
-0.1068402156,
0.0815508589,
0.3045550883,
-0.1409018636,
0.2166145891,
-0.3760762811,
-0.0134596685,
0.0852671862,
0.0051950905,
-0.1859993935,
-0.0460624062,
0.0034710031,
-0.0094137117,
0.0772824436,
-0.0010647849,
-0.2850643694,
0.2279988378,
0.0163464509,
0.2554322481,
-0.1016234234,
-0.1028562263,
-0.0135520753,
-0.1215875819,
-0.0857028663,
-0.4742897749,
0.4356844425,
0.0281860791,
-0.1604654342,
0.7840997577,
-0.0001188638,
0.0990641415,
0.2483719885,
0.025843326,
-0.0703955591,
-0.3716359437,
0.0305293389,
-0.0560129061,
0.1552927941,
-0.2752089202,
0.0879633427,
-0.1430892944,
0.0955483913,
-0.5427467227,
0.3801246583,
0.1647429615,
0.1546674222,
0.5314352512,
-0.4868217409,
-0.1824202985,
0.1283856332,
-0.0579498634,
-0.0503400452,
0.544521153,
0.0008056565,
0.204407081,
0.0235877614,
0.4144552946,
-0.1186396852,
0.2631289959,
0.0570788011,
0.0971548408,
0.4060329199,
-0.0158636495,
0.1656937748,
-0.124043487,
0.257058233,
-0.3838201761,
-0.2255288959,
0.1382776201,
-0.1987223029,
-0.5372884274,
0.1851032674,
0.1369578987,
-0.1783016622,
-0.1763567179,
-0.2779462337,
0.0720573664,
-0.2121040821,
-0.1963712126,
0.0815002918,
-0.2687270045,
-0.1574118435,
0.1643318981,
0.1694015414,
0.3121425807,
0.1240121648,
0.001844292,
-0.1553132087,
-0.0082678627,
-0.4027776718,
0.0542566627,
-0.3037118316,
-0.3437740803,
-0.0953911617,
0.2882912755,
0.3789707124,
-0.0451942608,
0.2840239406,
0.2224461734,
0.0309232138,
0.7004983425,
0.149849996,
0.2902024686,
0.2009003013,
0.1810622364,
-0.3100052476,
-0.1913625598,
0.1990119964,
-0.5310233235,
0.2414132357,
0.2200145423,
-0.013256222,
-0.3235706389,
-0.4480688274,
0.0615481362,
0.1938806623,
-0.0467139259,
0.1330564916,
0.3195026815,
0.0339148641,
0.0123235928,
0.1278749406,
0.4262724817,
-0.2209418714,
0.2100049257,
-0.2910305262,
0.1002698764,
-0.4435736537,
0.3646079898,
0.0474662036,
-0.0839140117,
0.2243039757,
-0.0320464708,
0.4031940997,
-0.308930546,
0.3652124405,
-0.4421755672,
-0.0029978855,
0.0954084992,
0.0782012269,
0.2251206189,
0.2995716333,
-0.0981403291,
-0.0811050013,
-0.0738897398,
-0.1872104555,
-0.1491117179,
0.5365417004,
0.1563583761,
-0.0131785385,
0.4289541543,
-0.3462411165,
-0.0732100904,
0.3937606215,
-0.217310071,
0.0699690878,
0.006571196,
-0.4017103612,
-0.3470821083,
0.1470746845,
0.3551439643,
-0.2117387354,
-0.0738256574,
0.2929493487,
0.1298287809,
-0.0102832066,
0.468542099,
-0.2201553434,
0.1626341641,
-0.2866149843,
-0.0245942734,
0.5620936751,
-0.8298754692,
-0.3216197491,
0.1176253334,
-0.1634728462,
-0.3332689404,
0.0825221762,
0.0429989398,
0.3266255856,
-0.0876052603,
0.0890729427,
-0.2243261039,
0.1395228356,
-0.1509534419,
-0.3216230571,
-0.3151447177,
-0.0638329163,
-0.2678599954,
0.2974454463,
-0.0471402109,
0.243496716,
-0.206374079,
-0.0600684211,
-0.1215572506,
0.0200317577,
0.2438933253,
0.1884081215,
-0.0286049657,
0.099135071,
-0.2850906551,
0.2925026715,
0.1448740363,
-0.5383431315,
-0.2961363792,
0.1691066027,
-0.2005107701,
-0.1927507371,
-0.0857768208,
-0.0706391037,
-0.1958031654,
0.0659020245,
0.1360586137,
0.2209206969,
0.278021276,
-0.0576282218,
0.3118049204,
-0.0584467687,
0.0707679763,
-0.0973505527,
0.0738312453,
-0.1232284084,
-0.2663716674,
-0.0980602577,
0.0787085444,
0.3763606548,
-0.0226038303,
-0.1681239158,
0.3127593994,
-0.1168538556,
0.2160869986,
0.1792307347,
0.1188419387,
0.1721315235,
-0.2322573364,
0.0048488309,
-0.0386071727,
0.1945937723,
-0.0987801179,
0.4015490711,
0.2953326106,
-0.022890877,
0.1296619475,
0.2755025923,
0.0170341525,
-0.100752458,
0.0285556391,
0.1727865785,
-0.1901309192,
0.3023919165,
-0.0971516743,
0.0521631874,
-0.1124894917,
0.0968034342,
-0.1043635607,
0.1355573684,
0.1627226919,
-0.0012207121,
-0.1695544422,
-0.036949832,
0.073287949,
-0.2711123526,
0.2889000177,
0.7128474116,
0.0229041874,
0.1526314765,
0.1330120713,
0.0188373923,
-0.1760330647,
0.1453157514,
0.209442988,
-0.1075594053,
0.0993785411,
0.166222021,
-0.0816873088,
-0.0364566781,
0.0903406739,
0.0381225385,
-0.0213954281,
-0.1647394449,
0.392378211,
-0.0219713096,
0.07535588,
-0.5359924436,
0.0141770495,
-0.0288163591,
-0.1689181775,
-0.1003931761,
0.3601458073,
0.0499681905,
0.0707450435,
-0.2301942259,
0.5003134608,
-0.2754375339,
0.2575499713,
0.0213136859,
-0.155104205,
-0.3020186722,
-0.0712805539,
0.1685052216,
0.0605502389,
0.3412748277,
-0.1754941493,
-0.0699495673,
-0.2088632435,
-0.1869239658,
-0.0449573398,
0.2885993123,
0.488894999,
-0.0525452532,
-0.1393488497,
-0.3070412874,
-0.3469005525,
0.3138328493,
-0.404835552,
-0.2079188079,
-0.1324312985,
0.0150447311,
-0.2289838195,
-0.1872953773,
-0.1068752855,
-0.024506839,
-0.2213676274,
0.2083865106,
-0.200125441,
0.0360721424,
0.0712471977,
-0.174055621,
0.1142759025,
0.0748569593,
0.1112006903,
-0.277882427,
-0.1941747963,
0.0222590081,
-0.4008956254,
-0.1950280666,
-0.0420212485,
0.1363779157,
0.4599738121,
0.2368848622,
-0.4259492457,
-0.4368488193,
-0.1682189256,
-0.117376022,
0.1020150259,
-0.0418611877,
0.0551186502,
-0.0682304278,
-0.1335439533,
-0.1503507644,
-0.1933319569,
0.5020689368,
-0.2520497441,
0.0685733706,
-0.1603964716,
-0.1222268417,
0.0443002358,
0.8054543734,
0.4146432877,
0.0838827416,
0.3142865598,
0.2035723478,
0.3654498756,
0.003969444,
-0.3886854947,
0.1884926558,
0.0200653877,
-0.2714689076,
0.127963841,
-0.0859000906,
0.105466418,
-0.1473998874,
-0.1158736274,
-0.2137656212,
-0.0955248922,
-0.1489700079,
-0.2166235447,
0.2357062548,
0.0829565674,
0.0911732167,
-0.321669966,
0.0277164839,
0.2208308131,
0.2361792475,
-0.2803711891,
0.0243197847,
-0.1450073123,
-0.1817687303,
-0.2225547433,
0.5148037672,
0.0891623795,
0.2446998805,
-0.2091471851,
0.1408787519,
0.0523313321,
-0.0709713027,
0.6638154984,
-0.0739479512,
-0.0868658498,
-0.1109796166,
-0.0193758309,
-0.4094041586,
-0.1419024169,
0.0550741404,
0.1366430968,
0.1798200905,
0.4839467108,
-0.1208596677,
-0.0051791277,
-0.0153059997,
0.0120948935,
-0.1854644567,
-0.2006286234,
-0.3357677758,
-0.3831155002,
0.0732775107,
0.0737478733,
-0.0195127334,
0.0452136211,
-0.0937865824,
0.094069913,
-0.1731127501,
0.0474344417,
0.2436569333,
-0.0133806104,
0.5679036379,
-0.36991027,
0.1197623536,
0.277443856,
0.081316106,
0.2905483842,
0.2618487179,
-0.1487619877,
-0.4146741033,
0.1154792979,
0.0839686096,
-0.0068025379,
0.4959120452,
-0.1706466228,
0.1998106837,
-0.0143724103,
-0.0525067374,
0.1222910061,
0.0716387033,
0.2608546317,
0.3012567759,
-0.0817965046,
-0.1803608537,
0.0001942228,
0.4088627994,
-0.1110963821,
0.4448749125,
-0.3718874156,
-0.1304302216,
0.1831737608,
0.2075397819,
1.1415234804,
0.1096202582,
0.0940428302,
0.3654056787,
-0.378801018,
0.1448805332,
-0.1338839829,
0.3521232903,
-0.2913299501,
-0.4262790978,
0.04439836,
-0.4234814942,
0.0784709305,
-0.25822559,
-0.0987936482,
0.2994015217,
-0.2575716972,
0.022854127,
-0.1675747484,
-0.0094809094,
-0.1764464825,
0.1637747884,
0.2784409523,
0.1187393889,
-0.1347371638,
0.1918251216,
-0.1957796514,
-0.2062196881,
-0.2727338672,
-0.124128446,
-0.1999100745,
0.125476554,
-0.3591464162,
0.547729969,
-0.0289823767,
-0.1873504817,
-0.0564384162,
0.3179166615,
1.0567494631,
-0.0337516703,
-0.053227745,
0.1115202978,
0.1322744191,
0.07698147,
0.0788676068,
-0.4823551178,
0.1216790751,
-0.1621989906,
-0.2046579272,
-0.0102406843,
0.1712740064,
0.0545480289,
0.1436230391,
0.0065043219,
-0.0442722067,
-0.1453603357,
0.0713086799,
0.0538247004,
-0.0382304862,
-0.1429395229,
0.03658586,
-0.0503246076,
-0.2049170732,
0.129308641,
-0.2136396021,
-0.3586627841,
0.1601791233,
0.2391819209,
0.3221598268,
-0.3406074941,
0.5207620263,
-0.4181825519,
-0.1647209078,
-0.1229279861,
-0.4281489253,
-0.1048448309,
-0.4858561754,
0.3519492447,
-0.3284838498,
-0.0230384041,
-0.1290414631,
0.4235874414,
0.369602263,
0.2082637697,
-0.0514330156,
-0.257573694,
-0.3079731464,
0.0665429905,
-0.2560644448,
0.2094359994,
-0.066782251,
0.2033174783,
-0.1151049957,
0.2468769997,
-0.2290827334,
0.1491089165,
-0.223580271,
-0.0578613654,
-0.0239928402,
-0.3083408475,
0.273968786,
0.0583665222,
-0.0829619691,
0.244974494,
-0.4150683284,
-0.1025744304,
-0.1703069061,
0.1670020968,
-0.2010877132,
-0.1663453132,
-0.1639755219,
-0.0849380791,
0.2917102575,
-0.0966842994,
0.0385239571,
0.4952760041,
-0.0047271764,
-0.1825710535,
-0.0801017806,
0.3579134643,
0.0760423616,
0.311290741,
0.0722696185,
-0.0891170353,
0.0455705412,
0.2249445021,
-0.1751981974,
-0.1544536203,
-0.2151746303,
-0.1035950184,
0.1023804098,
0.1173026338,
-0.2384694666,
-0.3789306879,
-0.2773681581,
0.0492624752,
0.2394447178,
0.1593903005,
-0.0221531745,
-0.1676269472,
0.0452719815,
0.1217803434,
0.0035557242,
0.0100834323,
0.0712794214,
-0.0665709674,
-0.2697436213,
0.2501282096,
0.4367045462,
-0.0595399588,
0.2153591216,
0.0835737139,
0.3153460026,
-0.3591237366,
0.4809871912,
-0.3079813719,
0.2562136352,
0.2291850001,
0.2896815538,
0.1402169466,
0.1642460972,
-0.1615502834,
-0.257815063,
0.3288826942,
0.1009147093,
-0.065624401,
-0.1758929789,
-0.1831432283,
-0.1239007339,
-0.1155412942,
-0.1164162681,
0.1536556035,
-0.0742527246,
0.4652305543,
-0.2960214913,
-0.339676708,
-0.2351729572,
0.0977833346,
-0.2720488012,
-0.1077876911,
0.0314898975,
-0.3171126246,
0.2278344929,
0.0468037911,
0.2442207187,
0.2121109366,
0.2209789306,
0.0465212464,
-0.2491005063,
0.060720399,
-0.273798883,
0.6104676127,
0.0576189123,
-0.1199757382,
0.3298228383,
0.2280459702,
-0.041749496,
0.0415109247,
0.6623184681,
0.5221059918,
0.3618001938,
0.091081515,
-0.1146945879,
0.2342062891,
0.1228308305,
-0.014762016,
0.1736105233,
0.252183497,
-0.1960240155,
0.247168988,
0.1507106274,
-0.1146791056,
0.3636131883,
-0.0644531697,
0.2004001588,
-0.2909460664,
0.2844317257,
-0.1778315604,
0.0205781162,
-0.1967292577,
-0.0421836525,
-0.5328441858,
0.1024000198,
0.2991533577,
-0.179036051,
0.2391098291,
-0.0970063433,
0.071795851,
0.1840811968,
0.2452762276,
0.4780640006,
0.1257412434,
-0.5874686241,
0.0541214123,
-0.4772073627,
0.4764413238,
0.059209913,
0.4164778292,
-0.2925384939,
0.2583390474,
-0.2482524663,
-0.162359193,
0.4818671942,
0.1885390431,
-0.0308831874,
0.0682152212,
-0.5626353025,
0.1788058728,
0.0410296991,
-0.3143729866,
0.2532075942,
-0.3407097459,
0.0291235354,
0.000925413,
0.0330467857,
0.2292574644,
0.0543097109,
0.0794536471,
-0.0988799557,
0.339713037,
0.1724282503,
0.3838354349,
0.0864273459,
0.0152714215,
-0.0633854568,
-0.1108326316,
-0.241247952,
-0.1147981957,
0.0356720276,
0.222644344,
-0.5101050735,
0.0544220693,
-0.3817656636,
0.203305766,
0.2425131202,
-0.2194540799,
0.0528793447,
-0.0975426957,
0.0198447853,
0.0163122732,
0.4529067576,
0.4042088389,
0.0936901718,
0.4554380476,
-0.3360856473,
-0.1296243519,
0.5763479471,
-0.5234943032,
-0.2780393958,
0.1190043911,
0.4433910847,
0.3935000598,
0.0013249628,
-0.653067112,
-0.0659775957,
0.2789849043,
-0.1601077616,
-0.0528022796,
0.1729200631,
-0.3497535288,
-0.0094574085,
0.1064968929,
0.0148757817,
0.026049193,
-0.3596190214,
0.0831908733,
-0.2089134604
] |
https://github.com/huggingface/datasets/issues/1765 | Error iterating over Dataset with DataLoader | Instead of:
```python
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
```
It should be:
```python
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_size=32)
```
`batch_sampler` accepts a Sampler object or an Iterable, so you get an error. | I have a Dataset that I've mapped a tokenizer over:
```
encoded_dataset.set_format(type='torch',columns=['attention_mask','input_ids','token_type_ids'])
encoded_dataset[:1]
```
```
{'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]),
'input_ids': tensor([[ 101, 178, 1198, 1400, 1714, 22233, 21365, 4515, 8618, 1113,
102]]),
'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])}
```
When I try to iterate as in the docs, I get errors:
```
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
next(iter(dataloader))
```
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-45-05180ba8aa35> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
----> 2 next(iter(dataloader))
3 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in __init__(self, loader)
411 self._timeout = loader.timeout
412 self._collate_fn = loader.collate_fn
--> 413 self._sampler_iter = iter(self._index_sampler)
414 self._base_seed = torch.empty((), dtype=torch.int64).random_(generator=loader.generator).item()
415 self._persistent_workers = loader.persistent_workers
TypeError: 'int' object is not iterable
``` | 30 | Error iterating over Dataset with DataLoader
I have a Dataset that I've mapped a tokenizer over:
```
encoded_dataset.set_format(type='torch',columns=['attention_mask','input_ids','token_type_ids'])
encoded_dataset[:1]
```
```
{'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]),
'input_ids': tensor([[ 101, 178, 1198, 1400, 1714, 22233, 21365, 4515, 8618, 1113,
102]]),
'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])}
```
When I try to iterate as in the docs, I get errors:
```
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
next(iter(dataloader))
```
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-45-05180ba8aa35> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
----> 2 next(iter(dataloader))
3 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in __init__(self, loader)
411 self._timeout = loader.timeout
412 self._collate_fn = loader.collate_fn
--> 413 self._sampler_iter = iter(self._index_sampler)
414 self._base_seed = torch.empty((), dtype=torch.int64).random_(generator=loader.generator).item()
415 self._persistent_workers = loader.persistent_workers
TypeError: 'int' object is not iterable
```
Instead of:
```python
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
```
It should be:
```python
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_size=32)
```
`batch_sampler` accepts a Sampler object or an Iterable, so you get an error. | [
-0.2379292995,
0.055456318,
-0.0456709191,
0.2057333589,
0.1531802714,
0.0001413128,
0.7921317816,
0.3068522513,
0.0211306568,
0.1527127177,
0.0467957295,
0.2304262072,
-0.2809543908,
-0.2416440994,
-0.0902263597,
-0.0604500175,
-0.0764537454,
0.0790704489,
-0.1224218458,
0.0328941159,
-0.1435404718,
-0.0867298841,
-0.1925973892,
0.0319355614,
-0.2509384155,
-0.1322707981,
-0.1035913378,
-0.0947075114,
-0.3341252804,
-0.5228332877,
0.2897110879,
0.1179488078,
0.4238478541,
0.681245923,
-0.0001170856,
0.0532656237,
0.1204966158,
-0.1216142997,
-0.2641810775,
-0.2320629656,
0.1392340064,
-0.0516225547,
0.0336747169,
-0.3547688723,
0.2605600059,
-0.3312721848,
-0.0172063671,
-0.2235836387,
0.1987375766,
0.240710929,
0.1273105443,
0.4878686666,
-0.0130664511,
0.0686060563,
0.0452416725,
0.2505431175,
-0.0195117034,
0.1971430033,
0.1916248947,
0.0102276374,
-0.3597654402,
0.1168681905,
-0.1690706313,
0.0475238077,
0.1359685808,
-0.1127388328,
-0.2177607268,
-0.1320606321,
-0.0326833501,
-0.0796291456,
0.5732848644,
-0.2473983765,
-0.3338906467,
-0.1655158848,
-0.2215298563,
-0.2673027515,
0.3192117214,
-0.1650725901,
-0.1586041898,
-0.213989988,
0.115756996,
0.2405706644,
-0.2040266097,
0.1367145777,
-0.2591601312,
0.2086893767,
-0.0498502329,
0.3045001626,
0.2167699933,
-0.2556965947,
0.3407103717,
0.100551635,
0.0440496989,
0.2752287984,
-0.5098054409,
-0.2515715361,
0.0933655873,
-0.4813283682,
-0.0889513567,
0.1817472726,
0.2512767315,
0.0659235492,
-0.0267226119,
0.2420648336,
0.4608972371,
0.186747238,
0.1686097234,
0.3430073857,
0.0560027063,
-0.1008405611,
0.1115822867,
-0.0628374964,
-0.3309625089,
-0.3040353358,
0.2297863513,
0.1007606909,
0.2355148196,
0.0638041869,
-0.2407522351,
-0.0010412384,
-0.2854396105,
-0.1408833265,
0.1115426198,
0.1466976553,
0.2154823989,
0.0784652233,
-0.0211965814,
0.0494476445,
-0.0294590052,
-0.1010555252,
-0.0631029308,
0.1225908548,
-0.2360041142,
0.0062329904,
0.2692130506,
-0.0449522175,
-0.0005978719,
0.137932241,
-0.0163491201,
0.1064940467,
0.1838303804,
-0.1677455455,
0.2751209736,
-0.0668306872,
0.0526378267,
0.3259078264,
0.2427884638,
0.052704487,
-0.1517042518,
0.0064418842,
-0.4252363443,
-0.0854079127,
-0.0711297169,
0.1343849152,
-0.0657274276,
-0.0596551597,
-0.4029013515,
-0.1930606663,
0.3476110399,
-0.1592842042,
0.099020876,
-0.2618944943,
0.0679653063,
-0.0949436054,
0.0716987625,
0.3785109818,
-0.4588418603,
-0.1389314979,
0.1558686197,
0.1005790308,
0.2683535218,
0.2800277174,
-0.2775179148,
0.5750991702,
-0.4041409194,
0.3146151602,
0.3382747769,
-0.4575732648,
-0.3010722399,
0.302323699,
-0.1728588194,
0.1828439534,
0.1311058551,
0.0220964327,
0.4072544575,
-0.2117988765,
0.1262144446,
0.1312222928,
-0.1754143238,
-0.0844983682,
-0.0188896675,
0.4073567688,
0.5204415321,
0.0579208843,
0.1899081618,
0.0911745206,
-0.2563124001,
0.1866552234,
0.0407242253,
-0.1624023914,
0.0752801076,
0.1461820602,
0.0872924775,
0.1154014543,
0.2047132999,
-0.1541337967,
-0.2414142787,
0.017452905,
0.0847357586,
0.1103397533,
-0.1569615304,
0.1011083201,
0.0156294927,
0.1833892614,
-0.4093038142,
-0.1476444453,
0.1057990193,
0.3391776085,
-0.108505182,
-0.2262799889,
-0.2782577276,
0.0101971161,
-0.1502239406,
0.1229054853,
-0.3177072108,
0.0756458938,
0.0731090605,
-0.1621203572,
-0.1109918877,
0.0012578749,
0.2185537368,
-0.230595082,
-0.0198756754,
0.1527437717,
0.0733501613,
0.0837660953,
-0.1409204155,
0.0840367079,
0.2027755678,
-0.0805915445,
-0.0350412726,
0.0263241101,
0.0633542091,
-0.2463468164,
0.2860273719,
0.3557418585,
-0.0415121019,
0.5438953638,
-0.1846142113,
0.1865570694,
0.0854833424,
0.1429632455,
-0.2297748476,
0.1214376092,
0.29159531,
0.1652789414,
0.2727057934,
-0.0742384493,
-0.1061882153,
-0.016253937,
0.1357863694,
0.0346565694,
-0.1672894359,
0.0645059273,
-0.2023289055,
0.0787327364,
0.1431889981,
-0.3583348989,
0.2936252654,
-0.0419643037,
0.1355625838,
-0.2297317982,
0.1093871891,
0.0548777692,
-0.0068243896,
0.137367323,
0.0501093939,
0.1365747154,
-0.0179891326,
0.0329905003,
-0.1993449777,
-0.261903882,
-0.0321639143,
0.403047353,
-0.2017508447,
0.4200808704,
-0.2251234502,
-0.0806141496,
-0.1357367039,
-0.4637429714,
-0.1244160831,
-0.4885834754,
-0.2934885919,
0.4377198219,
-0.0523559451,
0.2884222567,
0.1593023241,
0.0659951195,
0.6007105112,
-0.1201815531,
-0.1299341917,
-0.1651611775,
-0.1434865147,
0.0020232061,
0.3916656673,
-0.3905929029,
0.3192388415,
-0.1485728025,
-0.0364400372,
-0.4931817949,
-0.1713026464,
0.2343467772,
-0.2515107393,
-0.1061095968,
0.2501231432,
0.1603117734,
-0.1276741028,
-0.3462353051,
0.2360217571,
-0.0971406177,
-0.0598606355,
0.3538430333,
-0.0178581066,
0.164885059,
0.1942383051,
-0.1618052572,
-0.1143743992,
-0.2210423648,
0.14889431,
-0.0242254268,
0.3098030388,
0.127951473,
0.0508768596,
0.0688193068,
0.053886503,
-0.0885349661,
-0.0529176332,
-0.4608558118,
0.4211564362,
-0.3188977838,
-0.2935516834,
-0.0610980801,
-0.0051954277,
0.3583407998,
0.374879539,
-0.295447588,
-0.0019786817,
0.1968030035,
0.0960599482,
-0.1780668497,
0.0133008994,
0.1617016941,
0.1165707856,
-0.0526863299,
-0.0528676808,
0.1458164752,
0.1710806787,
-0.1876335442,
0.2580990195,
0.1593024433,
0.4765363336,
0.2614044547,
0.6606869102,
0.0389069952,
-0.3858363032,
0.3321020901,
-0.1400645375,
-0.0007827042,
0.0866577998,
-0.6534715295,
0.183066234,
-0.2897426784,
-0.0263242908,
-0.1086073071,
-0.3637521565,
-0.2020134032,
-0.1655699164,
0.1691448241,
-0.0271606147,
-0.3952349722,
0.4657105505,
-0.4304014444,
0.2838456333,
-0.0792961791,
0.1368127912,
-0.6179903746,
-0.0159707945,
0.1340288073,
0.001461645,
0.2550833225,
-0.0820337683,
-0.3944139183,
0.0771884248,
-0.4658886194,
0.2320284247,
0.0853062123,
0.7238261104,
0.1851676106,
-0.2038862407,
-0.1605454981,
-0.033894185,
0.7261371017,
0.2351623774,
-0.0131856222,
0.0982148275,
-0.3114117086,
-0.4381259978,
-0.0794281512,
-0.2774269581,
0.6424903274,
0.1563334465,
0.2806633115,
-0.2328459024,
-0.1301856786,
0.1159900352,
0.1067453176,
-0.2158437669,
-0.2748224735,
-0.0760233179,
-0.068043299,
-0.3532236516,
-0.0140914749,
0.0438391231,
0.2820525765,
0.0923699439,
0.0220609028,
-0.3040830195,
-0.027666267,
0.3623539209,
-0.0427858792,
0.066070132,
-0.1614816338,
0.1583145708,
0.1936409473,
0.2400770783,
0.6411283016,
0.3070536256,
0.2450910807,
-0.4524519145,
0.3747630119,
0.0567932613,
0.2789524198,
0.1266826987,
-0.1120253131,
-0.0463845395,
-0.3257369101,
0.0500909425,
-0.4352755249,
0.5216366053,
0.5002288222,
0.1470032483,
-0.5732989907,
-0.3403779566,
0.2020386457,
0.1137957647,
0.1821293831,
0.7328404188,
-0.1325452179,
-0.1383226067,
0.1305198818,
0.1368959248,
0.7372894883,
0.0599585064,
0.1241549328,
0.4110814631,
0.5742581487,
0.2874031961,
-0.5326964855,
0.0999790281,
-0.2278513312,
-0.0477598421,
-0.1629468352,
-0.25533095,
0.0387579612,
0.1704581082,
-0.0596478768,
0.1802616715,
-0.0350547805,
0.5183292627,
0.0984522998,
0.0610765144,
-0.3110623956,
-0.2922026217,
0.0958927274,
0.1132939979,
-0.1642979831,
0.1464619935,
-0.0775096118,
-0.0749973804,
0.1822131574,
-0.2826292217,
-0.2507403493,
-0.0257557705,
-0.2285090983,
0.1024933532,
0.0329167247,
-0.4766203165,
0.1010434702,
0.0133418655,
0.0507275052,
-0.0903598666,
0.0723627806,
-0.2212267667,
-0.0407181494,
-0.1306502968,
-0.1328617334,
-0.084642455,
0.4096860588,
0.1249373332,
0.1308968812,
0.2817063332,
0.2302458882,
-0.3494544327,
0.0834643319,
0.2228662074,
0.2381529659,
-0.5538778901,
0.1067489982,
-0.11697644,
-0.2001721114,
-0.2225137204,
0.0751270503,
0.0035707846,
-0.3264314234,
0.0061722314,
-0.1581955105,
-0.0941700488,
0.0912849382,
0.4193666279,
0.0990062431,
-0.4401393235,
0.7563031316,
0.1833337992,
-0.2378753722,
-0.160160318,
0.1304144561,
0.4554123282,
-0.2698961198,
0.1051626801,
-0.3681174815,
0.1937123537,
-0.2056512237,
0.0954534784,
0.0749830157,
0.0011241229,
-0.0847065747,
-0.3185293972,
-0.3763855994,
0.0641731918,
-0.1275969148,
0.2709616125,
0.0657138526,
0.1442404538,
-0.2424862534,
0.1084677801,
-0.2284085006,
-0.0599613264,
-0.1304064989,
0.2170205861,
0.0687656701,
-0.1155500114,
-0.0299654584,
0.1643113941,
0.0875987187,
0.3649317622,
0.0772953033,
-0.2171726972,
-0.1124108583,
0.1081869155,
0.1269551963,
-0.2696896791,
0.0701319873,
-0.0216649901,
-0.0106123444,
-0.316885829,
0.0920087323,
0.0593077317,
-0.0337995999,
0.2827906013,
0.383587271,
0.045312129,
0.1048736423,
0.0202995371,
0.2444043607,
0.2644287944,
0.186061427,
0.3221852481,
-0.0346974693,
-0.0614789501,
-0.2507392168,
0.3639921844,
0.3781986833,
-0.1171505898,
0.1562584639,
-0.4842173457,
0.1358975172,
-0.130947262,
0.2535528541,
0.6113291383,
-0.3544901907,
-0.1553912908,
0.1691126078,
0.1126622632,
-0.0045485348,
0.0386664979,
0.0609533191,
-0.057821475,
-0.0058270902,
0.1932299733,
-0.0571367368,
-0.0611662231,
0.1354422271,
-0.0829461366,
0.2889601886,
-0.163466379,
0.1883116364,
0.064177081,
-0.4278974831,
-0.0858653784,
0.3677483797,
0.2824954391,
0.1013356969,
0.2784428596,
-0.107880272,
0.4273208976,
0.0708390996,
-0.2493038177,
-0.0165873189,
-0.4929739237,
-0.3299541473,
0.1111968383,
0.246336475,
0.1948018223,
0.0489692651,
0.320019722,
-0.0799893066,
-0.1117730886,
-0.0213638302,
0.1956694275,
-0.2775021493,
0.0963110328,
-0.3862144351,
-0.2213355303,
-0.2077881694,
-0.1047487855,
-0.0772701502,
-0.1806129962,
0.001915719,
0.1187873855,
-0.187499404,
-0.4298034906,
0.062750563,
-0.0045478209,
-0.112351723,
-0.3342281282,
0.217959106,
0.160262838,
0.1170849428,
0.0349094234,
0.2651890218,
0.5087577105,
0.4610846043,
-0.1494462788,
0.1769153029,
-0.5010873079,
-0.1911617666,
-0.0631126016,
0.1125182509,
-0.4148904979,
-0.1014756709,
0.386738658,
0.0840831771,
-0.1143441349,
-0.2153678387,
0.134074524,
0.0735939816,
0.000148272,
0.1247917041,
-0.0815561712,
0.0414280295,
-0.0814752057,
-0.044169452,
-0.4062022865,
-0.118234016,
0.4678343534,
0.1166638359,
0.196858868,
0.0207540877,
0.0589621812,
-0.2503392994,
0.4257990122,
0.4754781127,
0.2222503275,
-0.4092895389,
-0.2357501686,
-0.2958707809,
0.3727258444,
-0.1213888004,
-0.1949656606,
-0.0196233001,
0.1651483476,
0.3228290975,
0.2691094279,
0.2435300946,
-0.1453227103,
-0.0710383654,
0.3360806108,
-0.3235666752,
-0.3320511878,
0.0356341265,
0.2394294441,
-0.0671314895,
-0.277808845,
0.2334064245,
-0.1008596569,
0.1332826614,
-0.2046565562,
-0.3008010685,
0.0800731629,
0.0444455668,
0.4428641498,
0.1897004992,
0.4272843897,
0.0945998356,
0.0628772452,
-0.278421998,
-0.2361572236,
-0.1914743483,
0.0452264026,
0.0448539294,
0.2142350227,
-0.032453049,
-0.1344617456,
-0.5011918545,
0.2168957293,
-0.1091528907,
-0.2911403179,
-0.3574871719,
0.2795460224,
0.0037161098,
0.0702275783,
-0.0714732781,
0.2456232458,
0.2120579034,
0.5372607112,
-0.3672762513,
-0.2944156528,
0.4216323495,
-0.6915379763,
-0.4907263517,
0.02503521,
-0.1989058703,
0.1786560267,
0.27032426,
-0.5640618801,
0.0031022418,
0.317204237,
-0.1694210321,
-0.1327277124,
0.0034330208,
0.0969766378,
0.0240146872,
-0.1689355075,
0.388994813,
0.1035360545,
-0.0350188576,
-0.0177481119,
-0.2236269265
] |
https://github.com/huggingface/datasets/issues/1765 | Error iterating over Dataset with DataLoader | @mariosasko I thought that would fix it, but now I'm getting a different error:
```
/usr/local/lib/python3.6/dist-packages/datasets/arrow_dataset.py:851: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:141.)
return torch.tensor(x, **format_kwargs)
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-20-3af1d82bf93a> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_size=32)
----> 2 next(iter(dataloader))
5 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/collate.py in default_collate(batch)
53 storage = elem.storage()._new_shared(numel)
54 out = elem.new(storage)
---> 55 return torch.stack(batch, 0, out=out)
56 elif elem_type.__module__ == 'numpy' and elem_type.__name__ != 'str_' \
57 and elem_type.__name__ != 'string_':
RuntimeError: stack expects each tensor to be equal size, but got [7] at entry 0 and [10] at entry 1
```
Any thoughts what this means?I Do I need padding? | I have a Dataset that I've mapped a tokenizer over:
```
encoded_dataset.set_format(type='torch',columns=['attention_mask','input_ids','token_type_ids'])
encoded_dataset[:1]
```
```
{'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]),
'input_ids': tensor([[ 101, 178, 1198, 1400, 1714, 22233, 21365, 4515, 8618, 1113,
102]]),
'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])}
```
When I try to iterate as in the docs, I get errors:
```
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
next(iter(dataloader))
```
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-45-05180ba8aa35> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
----> 2 next(iter(dataloader))
3 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in __init__(self, loader)
411 self._timeout = loader.timeout
412 self._collate_fn = loader.collate_fn
--> 413 self._sampler_iter = iter(self._index_sampler)
414 self._base_seed = torch.empty((), dtype=torch.int64).random_(generator=loader.generator).item()
415 self._persistent_workers = loader.persistent_workers
TypeError: 'int' object is not iterable
``` | 169 | Error iterating over Dataset with DataLoader
I have a Dataset that I've mapped a tokenizer over:
```
encoded_dataset.set_format(type='torch',columns=['attention_mask','input_ids','token_type_ids'])
encoded_dataset[:1]
```
```
{'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]),
'input_ids': tensor([[ 101, 178, 1198, 1400, 1714, 22233, 21365, 4515, 8618, 1113,
102]]),
'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])}
```
When I try to iterate as in the docs, I get errors:
```
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
next(iter(dataloader))
```
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-45-05180ba8aa35> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
----> 2 next(iter(dataloader))
3 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in __init__(self, loader)
411 self._timeout = loader.timeout
412 self._collate_fn = loader.collate_fn
--> 413 self._sampler_iter = iter(self._index_sampler)
414 self._base_seed = torch.empty((), dtype=torch.int64).random_(generator=loader.generator).item()
415 self._persistent_workers = loader.persistent_workers
TypeError: 'int' object is not iterable
```
@mariosasko I thought that would fix it, but now I'm getting a different error:
```
/usr/local/lib/python3.6/dist-packages/datasets/arrow_dataset.py:851: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:141.)
return torch.tensor(x, **format_kwargs)
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-20-3af1d82bf93a> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_size=32)
----> 2 next(iter(dataloader))
5 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/collate.py in default_collate(batch)
53 storage = elem.storage()._new_shared(numel)
54 out = elem.new(storage)
---> 55 return torch.stack(batch, 0, out=out)
56 elif elem_type.__module__ == 'numpy' and elem_type.__name__ != 'str_' \
57 and elem_type.__name__ != 'string_':
RuntimeError: stack expects each tensor to be equal size, but got [7] at entry 0 and [10] at entry 1
```
Any thoughts what this means?I Do I need padding? | [
-0.2379292995,
0.055456318,
-0.0456709191,
0.2057333589,
0.1531802714,
0.0001413128,
0.7921317816,
0.3068522513,
0.0211306568,
0.1527127177,
0.0467957295,
0.2304262072,
-0.2809543908,
-0.2416440994,
-0.0902263597,
-0.0604500175,
-0.0764537454,
0.0790704489,
-0.1224218458,
0.0328941159,
-0.1435404718,
-0.0867298841,
-0.1925973892,
0.0319355614,
-0.2509384155,
-0.1322707981,
-0.1035913378,
-0.0947075114,
-0.3341252804,
-0.5228332877,
0.2897110879,
0.1179488078,
0.4238478541,
0.681245923,
-0.0001170856,
0.0532656237,
0.1204966158,
-0.1216142997,
-0.2641810775,
-0.2320629656,
0.1392340064,
-0.0516225547,
0.0336747169,
-0.3547688723,
0.2605600059,
-0.3312721848,
-0.0172063671,
-0.2235836387,
0.1987375766,
0.240710929,
0.1273105443,
0.4878686666,
-0.0130664511,
0.0686060563,
0.0452416725,
0.2505431175,
-0.0195117034,
0.1971430033,
0.1916248947,
0.0102276374,
-0.3597654402,
0.1168681905,
-0.1690706313,
0.0475238077,
0.1359685808,
-0.1127388328,
-0.2177607268,
-0.1320606321,
-0.0326833501,
-0.0796291456,
0.5732848644,
-0.2473983765,
-0.3338906467,
-0.1655158848,
-0.2215298563,
-0.2673027515,
0.3192117214,
-0.1650725901,
-0.1586041898,
-0.213989988,
0.115756996,
0.2405706644,
-0.2040266097,
0.1367145777,
-0.2591601312,
0.2086893767,
-0.0498502329,
0.3045001626,
0.2167699933,
-0.2556965947,
0.3407103717,
0.100551635,
0.0440496989,
0.2752287984,
-0.5098054409,
-0.2515715361,
0.0933655873,
-0.4813283682,
-0.0889513567,
0.1817472726,
0.2512767315,
0.0659235492,
-0.0267226119,
0.2420648336,
0.4608972371,
0.186747238,
0.1686097234,
0.3430073857,
0.0560027063,
-0.1008405611,
0.1115822867,
-0.0628374964,
-0.3309625089,
-0.3040353358,
0.2297863513,
0.1007606909,
0.2355148196,
0.0638041869,
-0.2407522351,
-0.0010412384,
-0.2854396105,
-0.1408833265,
0.1115426198,
0.1466976553,
0.2154823989,
0.0784652233,
-0.0211965814,
0.0494476445,
-0.0294590052,
-0.1010555252,
-0.0631029308,
0.1225908548,
-0.2360041142,
0.0062329904,
0.2692130506,
-0.0449522175,
-0.0005978719,
0.137932241,
-0.0163491201,
0.1064940467,
0.1838303804,
-0.1677455455,
0.2751209736,
-0.0668306872,
0.0526378267,
0.3259078264,
0.2427884638,
0.052704487,
-0.1517042518,
0.0064418842,
-0.4252363443,
-0.0854079127,
-0.0711297169,
0.1343849152,
-0.0657274276,
-0.0596551597,
-0.4029013515,
-0.1930606663,
0.3476110399,
-0.1592842042,
0.099020876,
-0.2618944943,
0.0679653063,
-0.0949436054,
0.0716987625,
0.3785109818,
-0.4588418603,
-0.1389314979,
0.1558686197,
0.1005790308,
0.2683535218,
0.2800277174,
-0.2775179148,
0.5750991702,
-0.4041409194,
0.3146151602,
0.3382747769,
-0.4575732648,
-0.3010722399,
0.302323699,
-0.1728588194,
0.1828439534,
0.1311058551,
0.0220964327,
0.4072544575,
-0.2117988765,
0.1262144446,
0.1312222928,
-0.1754143238,
-0.0844983682,
-0.0188896675,
0.4073567688,
0.5204415321,
0.0579208843,
0.1899081618,
0.0911745206,
-0.2563124001,
0.1866552234,
0.0407242253,
-0.1624023914,
0.0752801076,
0.1461820602,
0.0872924775,
0.1154014543,
0.2047132999,
-0.1541337967,
-0.2414142787,
0.017452905,
0.0847357586,
0.1103397533,
-0.1569615304,
0.1011083201,
0.0156294927,
0.1833892614,
-0.4093038142,
-0.1476444453,
0.1057990193,
0.3391776085,
-0.108505182,
-0.2262799889,
-0.2782577276,
0.0101971161,
-0.1502239406,
0.1229054853,
-0.3177072108,
0.0756458938,
0.0731090605,
-0.1621203572,
-0.1109918877,
0.0012578749,
0.2185537368,
-0.230595082,
-0.0198756754,
0.1527437717,
0.0733501613,
0.0837660953,
-0.1409204155,
0.0840367079,
0.2027755678,
-0.0805915445,
-0.0350412726,
0.0263241101,
0.0633542091,
-0.2463468164,
0.2860273719,
0.3557418585,
-0.0415121019,
0.5438953638,
-0.1846142113,
0.1865570694,
0.0854833424,
0.1429632455,
-0.2297748476,
0.1214376092,
0.29159531,
0.1652789414,
0.2727057934,
-0.0742384493,
-0.1061882153,
-0.016253937,
0.1357863694,
0.0346565694,
-0.1672894359,
0.0645059273,
-0.2023289055,
0.0787327364,
0.1431889981,
-0.3583348989,
0.2936252654,
-0.0419643037,
0.1355625838,
-0.2297317982,
0.1093871891,
0.0548777692,
-0.0068243896,
0.137367323,
0.0501093939,
0.1365747154,
-0.0179891326,
0.0329905003,
-0.1993449777,
-0.261903882,
-0.0321639143,
0.403047353,
-0.2017508447,
0.4200808704,
-0.2251234502,
-0.0806141496,
-0.1357367039,
-0.4637429714,
-0.1244160831,
-0.4885834754,
-0.2934885919,
0.4377198219,
-0.0523559451,
0.2884222567,
0.1593023241,
0.0659951195,
0.6007105112,
-0.1201815531,
-0.1299341917,
-0.1651611775,
-0.1434865147,
0.0020232061,
0.3916656673,
-0.3905929029,
0.3192388415,
-0.1485728025,
-0.0364400372,
-0.4931817949,
-0.1713026464,
0.2343467772,
-0.2515107393,
-0.1061095968,
0.2501231432,
0.1603117734,
-0.1276741028,
-0.3462353051,
0.2360217571,
-0.0971406177,
-0.0598606355,
0.3538430333,
-0.0178581066,
0.164885059,
0.1942383051,
-0.1618052572,
-0.1143743992,
-0.2210423648,
0.14889431,
-0.0242254268,
0.3098030388,
0.127951473,
0.0508768596,
0.0688193068,
0.053886503,
-0.0885349661,
-0.0529176332,
-0.4608558118,
0.4211564362,
-0.3188977838,
-0.2935516834,
-0.0610980801,
-0.0051954277,
0.3583407998,
0.374879539,
-0.295447588,
-0.0019786817,
0.1968030035,
0.0960599482,
-0.1780668497,
0.0133008994,
0.1617016941,
0.1165707856,
-0.0526863299,
-0.0528676808,
0.1458164752,
0.1710806787,
-0.1876335442,
0.2580990195,
0.1593024433,
0.4765363336,
0.2614044547,
0.6606869102,
0.0389069952,
-0.3858363032,
0.3321020901,
-0.1400645375,
-0.0007827042,
0.0866577998,
-0.6534715295,
0.183066234,
-0.2897426784,
-0.0263242908,
-0.1086073071,
-0.3637521565,
-0.2020134032,
-0.1655699164,
0.1691448241,
-0.0271606147,
-0.3952349722,
0.4657105505,
-0.4304014444,
0.2838456333,
-0.0792961791,
0.1368127912,
-0.6179903746,
-0.0159707945,
0.1340288073,
0.001461645,
0.2550833225,
-0.0820337683,
-0.3944139183,
0.0771884248,
-0.4658886194,
0.2320284247,
0.0853062123,
0.7238261104,
0.1851676106,
-0.2038862407,
-0.1605454981,
-0.033894185,
0.7261371017,
0.2351623774,
-0.0131856222,
0.0982148275,
-0.3114117086,
-0.4381259978,
-0.0794281512,
-0.2774269581,
0.6424903274,
0.1563334465,
0.2806633115,
-0.2328459024,
-0.1301856786,
0.1159900352,
0.1067453176,
-0.2158437669,
-0.2748224735,
-0.0760233179,
-0.068043299,
-0.3532236516,
-0.0140914749,
0.0438391231,
0.2820525765,
0.0923699439,
0.0220609028,
-0.3040830195,
-0.027666267,
0.3623539209,
-0.0427858792,
0.066070132,
-0.1614816338,
0.1583145708,
0.1936409473,
0.2400770783,
0.6411283016,
0.3070536256,
0.2450910807,
-0.4524519145,
0.3747630119,
0.0567932613,
0.2789524198,
0.1266826987,
-0.1120253131,
-0.0463845395,
-0.3257369101,
0.0500909425,
-0.4352755249,
0.5216366053,
0.5002288222,
0.1470032483,
-0.5732989907,
-0.3403779566,
0.2020386457,
0.1137957647,
0.1821293831,
0.7328404188,
-0.1325452179,
-0.1383226067,
0.1305198818,
0.1368959248,
0.7372894883,
0.0599585064,
0.1241549328,
0.4110814631,
0.5742581487,
0.2874031961,
-0.5326964855,
0.0999790281,
-0.2278513312,
-0.0477598421,
-0.1629468352,
-0.25533095,
0.0387579612,
0.1704581082,
-0.0596478768,
0.1802616715,
-0.0350547805,
0.5183292627,
0.0984522998,
0.0610765144,
-0.3110623956,
-0.2922026217,
0.0958927274,
0.1132939979,
-0.1642979831,
0.1464619935,
-0.0775096118,
-0.0749973804,
0.1822131574,
-0.2826292217,
-0.2507403493,
-0.0257557705,
-0.2285090983,
0.1024933532,
0.0329167247,
-0.4766203165,
0.1010434702,
0.0133418655,
0.0507275052,
-0.0903598666,
0.0723627806,
-0.2212267667,
-0.0407181494,
-0.1306502968,
-0.1328617334,
-0.084642455,
0.4096860588,
0.1249373332,
0.1308968812,
0.2817063332,
0.2302458882,
-0.3494544327,
0.0834643319,
0.2228662074,
0.2381529659,
-0.5538778901,
0.1067489982,
-0.11697644,
-0.2001721114,
-0.2225137204,
0.0751270503,
0.0035707846,
-0.3264314234,
0.0061722314,
-0.1581955105,
-0.0941700488,
0.0912849382,
0.4193666279,
0.0990062431,
-0.4401393235,
0.7563031316,
0.1833337992,
-0.2378753722,
-0.160160318,
0.1304144561,
0.4554123282,
-0.2698961198,
0.1051626801,
-0.3681174815,
0.1937123537,
-0.2056512237,
0.0954534784,
0.0749830157,
0.0011241229,
-0.0847065747,
-0.3185293972,
-0.3763855994,
0.0641731918,
-0.1275969148,
0.2709616125,
0.0657138526,
0.1442404538,
-0.2424862534,
0.1084677801,
-0.2284085006,
-0.0599613264,
-0.1304064989,
0.2170205861,
0.0687656701,
-0.1155500114,
-0.0299654584,
0.1643113941,
0.0875987187,
0.3649317622,
0.0772953033,
-0.2171726972,
-0.1124108583,
0.1081869155,
0.1269551963,
-0.2696896791,
0.0701319873,
-0.0216649901,
-0.0106123444,
-0.316885829,
0.0920087323,
0.0593077317,
-0.0337995999,
0.2827906013,
0.383587271,
0.045312129,
0.1048736423,
0.0202995371,
0.2444043607,
0.2644287944,
0.186061427,
0.3221852481,
-0.0346974693,
-0.0614789501,
-0.2507392168,
0.3639921844,
0.3781986833,
-0.1171505898,
0.1562584639,
-0.4842173457,
0.1358975172,
-0.130947262,
0.2535528541,
0.6113291383,
-0.3544901907,
-0.1553912908,
0.1691126078,
0.1126622632,
-0.0045485348,
0.0386664979,
0.0609533191,
-0.057821475,
-0.0058270902,
0.1932299733,
-0.0571367368,
-0.0611662231,
0.1354422271,
-0.0829461366,
0.2889601886,
-0.163466379,
0.1883116364,
0.064177081,
-0.4278974831,
-0.0858653784,
0.3677483797,
0.2824954391,
0.1013356969,
0.2784428596,
-0.107880272,
0.4273208976,
0.0708390996,
-0.2493038177,
-0.0165873189,
-0.4929739237,
-0.3299541473,
0.1111968383,
0.246336475,
0.1948018223,
0.0489692651,
0.320019722,
-0.0799893066,
-0.1117730886,
-0.0213638302,
0.1956694275,
-0.2775021493,
0.0963110328,
-0.3862144351,
-0.2213355303,
-0.2077881694,
-0.1047487855,
-0.0772701502,
-0.1806129962,
0.001915719,
0.1187873855,
-0.187499404,
-0.4298034906,
0.062750563,
-0.0045478209,
-0.112351723,
-0.3342281282,
0.217959106,
0.160262838,
0.1170849428,
0.0349094234,
0.2651890218,
0.5087577105,
0.4610846043,
-0.1494462788,
0.1769153029,
-0.5010873079,
-0.1911617666,
-0.0631126016,
0.1125182509,
-0.4148904979,
-0.1014756709,
0.386738658,
0.0840831771,
-0.1143441349,
-0.2153678387,
0.134074524,
0.0735939816,
0.000148272,
0.1247917041,
-0.0815561712,
0.0414280295,
-0.0814752057,
-0.044169452,
-0.4062022865,
-0.118234016,
0.4678343534,
0.1166638359,
0.196858868,
0.0207540877,
0.0589621812,
-0.2503392994,
0.4257990122,
0.4754781127,
0.2222503275,
-0.4092895389,
-0.2357501686,
-0.2958707809,
0.3727258444,
-0.1213888004,
-0.1949656606,
-0.0196233001,
0.1651483476,
0.3228290975,
0.2691094279,
0.2435300946,
-0.1453227103,
-0.0710383654,
0.3360806108,
-0.3235666752,
-0.3320511878,
0.0356341265,
0.2394294441,
-0.0671314895,
-0.277808845,
0.2334064245,
-0.1008596569,
0.1332826614,
-0.2046565562,
-0.3008010685,
0.0800731629,
0.0444455668,
0.4428641498,
0.1897004992,
0.4272843897,
0.0945998356,
0.0628772452,
-0.278421998,
-0.2361572236,
-0.1914743483,
0.0452264026,
0.0448539294,
0.2142350227,
-0.032453049,
-0.1344617456,
-0.5011918545,
0.2168957293,
-0.1091528907,
-0.2911403179,
-0.3574871719,
0.2795460224,
0.0037161098,
0.0702275783,
-0.0714732781,
0.2456232458,
0.2120579034,
0.5372607112,
-0.3672762513,
-0.2944156528,
0.4216323495,
-0.6915379763,
-0.4907263517,
0.02503521,
-0.1989058703,
0.1786560267,
0.27032426,
-0.5640618801,
0.0031022418,
0.317204237,
-0.1694210321,
-0.1327277124,
0.0034330208,
0.0969766378,
0.0240146872,
-0.1689355075,
0.388994813,
0.1035360545,
-0.0350188576,
-0.0177481119,
-0.2236269265
] |
https://github.com/huggingface/datasets/issues/1765 | Error iterating over Dataset with DataLoader | Yes, padding is an answer.
This can be solved easily by passing a callable to the collate_fn arg of DataLoader that adds padding. | I have a Dataset that I've mapped a tokenizer over:
```
encoded_dataset.set_format(type='torch',columns=['attention_mask','input_ids','token_type_ids'])
encoded_dataset[:1]
```
```
{'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]),
'input_ids': tensor([[ 101, 178, 1198, 1400, 1714, 22233, 21365, 4515, 8618, 1113,
102]]),
'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])}
```
When I try to iterate as in the docs, I get errors:
```
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
next(iter(dataloader))
```
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-45-05180ba8aa35> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
----> 2 next(iter(dataloader))
3 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in __init__(self, loader)
411 self._timeout = loader.timeout
412 self._collate_fn = loader.collate_fn
--> 413 self._sampler_iter = iter(self._index_sampler)
414 self._base_seed = torch.empty((), dtype=torch.int64).random_(generator=loader.generator).item()
415 self._persistent_workers = loader.persistent_workers
TypeError: 'int' object is not iterable
``` | 23 | Error iterating over Dataset with DataLoader
I have a Dataset that I've mapped a tokenizer over:
```
encoded_dataset.set_format(type='torch',columns=['attention_mask','input_ids','token_type_ids'])
encoded_dataset[:1]
```
```
{'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]),
'input_ids': tensor([[ 101, 178, 1198, 1400, 1714, 22233, 21365, 4515, 8618, 1113,
102]]),
'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])}
```
When I try to iterate as in the docs, I get errors:
```
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
next(iter(dataloader))
```
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-45-05180ba8aa35> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
----> 2 next(iter(dataloader))
3 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in __init__(self, loader)
411 self._timeout = loader.timeout
412 self._collate_fn = loader.collate_fn
--> 413 self._sampler_iter = iter(self._index_sampler)
414 self._base_seed = torch.empty((), dtype=torch.int64).random_(generator=loader.generator).item()
415 self._persistent_workers = loader.persistent_workers
TypeError: 'int' object is not iterable
```
Yes, padding is an answer.
This can be solved easily by passing a callable to the collate_fn arg of DataLoader that adds padding. | [
-0.2379292995,
0.055456318,
-0.0456709191,
0.2057333589,
0.1531802714,
0.0001413128,
0.7921317816,
0.3068522513,
0.0211306568,
0.1527127177,
0.0467957295,
0.2304262072,
-0.2809543908,
-0.2416440994,
-0.0902263597,
-0.0604500175,
-0.0764537454,
0.0790704489,
-0.1224218458,
0.0328941159,
-0.1435404718,
-0.0867298841,
-0.1925973892,
0.0319355614,
-0.2509384155,
-0.1322707981,
-0.1035913378,
-0.0947075114,
-0.3341252804,
-0.5228332877,
0.2897110879,
0.1179488078,
0.4238478541,
0.681245923,
-0.0001170856,
0.0532656237,
0.1204966158,
-0.1216142997,
-0.2641810775,
-0.2320629656,
0.1392340064,
-0.0516225547,
0.0336747169,
-0.3547688723,
0.2605600059,
-0.3312721848,
-0.0172063671,
-0.2235836387,
0.1987375766,
0.240710929,
0.1273105443,
0.4878686666,
-0.0130664511,
0.0686060563,
0.0452416725,
0.2505431175,
-0.0195117034,
0.1971430033,
0.1916248947,
0.0102276374,
-0.3597654402,
0.1168681905,
-0.1690706313,
0.0475238077,
0.1359685808,
-0.1127388328,
-0.2177607268,
-0.1320606321,
-0.0326833501,
-0.0796291456,
0.5732848644,
-0.2473983765,
-0.3338906467,
-0.1655158848,
-0.2215298563,
-0.2673027515,
0.3192117214,
-0.1650725901,
-0.1586041898,
-0.213989988,
0.115756996,
0.2405706644,
-0.2040266097,
0.1367145777,
-0.2591601312,
0.2086893767,
-0.0498502329,
0.3045001626,
0.2167699933,
-0.2556965947,
0.3407103717,
0.100551635,
0.0440496989,
0.2752287984,
-0.5098054409,
-0.2515715361,
0.0933655873,
-0.4813283682,
-0.0889513567,
0.1817472726,
0.2512767315,
0.0659235492,
-0.0267226119,
0.2420648336,
0.4608972371,
0.186747238,
0.1686097234,
0.3430073857,
0.0560027063,
-0.1008405611,
0.1115822867,
-0.0628374964,
-0.3309625089,
-0.3040353358,
0.2297863513,
0.1007606909,
0.2355148196,
0.0638041869,
-0.2407522351,
-0.0010412384,
-0.2854396105,
-0.1408833265,
0.1115426198,
0.1466976553,
0.2154823989,
0.0784652233,
-0.0211965814,
0.0494476445,
-0.0294590052,
-0.1010555252,
-0.0631029308,
0.1225908548,
-0.2360041142,
0.0062329904,
0.2692130506,
-0.0449522175,
-0.0005978719,
0.137932241,
-0.0163491201,
0.1064940467,
0.1838303804,
-0.1677455455,
0.2751209736,
-0.0668306872,
0.0526378267,
0.3259078264,
0.2427884638,
0.052704487,
-0.1517042518,
0.0064418842,
-0.4252363443,
-0.0854079127,
-0.0711297169,
0.1343849152,
-0.0657274276,
-0.0596551597,
-0.4029013515,
-0.1930606663,
0.3476110399,
-0.1592842042,
0.099020876,
-0.2618944943,
0.0679653063,
-0.0949436054,
0.0716987625,
0.3785109818,
-0.4588418603,
-0.1389314979,
0.1558686197,
0.1005790308,
0.2683535218,
0.2800277174,
-0.2775179148,
0.5750991702,
-0.4041409194,
0.3146151602,
0.3382747769,
-0.4575732648,
-0.3010722399,
0.302323699,
-0.1728588194,
0.1828439534,
0.1311058551,
0.0220964327,
0.4072544575,
-0.2117988765,
0.1262144446,
0.1312222928,
-0.1754143238,
-0.0844983682,
-0.0188896675,
0.4073567688,
0.5204415321,
0.0579208843,
0.1899081618,
0.0911745206,
-0.2563124001,
0.1866552234,
0.0407242253,
-0.1624023914,
0.0752801076,
0.1461820602,
0.0872924775,
0.1154014543,
0.2047132999,
-0.1541337967,
-0.2414142787,
0.017452905,
0.0847357586,
0.1103397533,
-0.1569615304,
0.1011083201,
0.0156294927,
0.1833892614,
-0.4093038142,
-0.1476444453,
0.1057990193,
0.3391776085,
-0.108505182,
-0.2262799889,
-0.2782577276,
0.0101971161,
-0.1502239406,
0.1229054853,
-0.3177072108,
0.0756458938,
0.0731090605,
-0.1621203572,
-0.1109918877,
0.0012578749,
0.2185537368,
-0.230595082,
-0.0198756754,
0.1527437717,
0.0733501613,
0.0837660953,
-0.1409204155,
0.0840367079,
0.2027755678,
-0.0805915445,
-0.0350412726,
0.0263241101,
0.0633542091,
-0.2463468164,
0.2860273719,
0.3557418585,
-0.0415121019,
0.5438953638,
-0.1846142113,
0.1865570694,
0.0854833424,
0.1429632455,
-0.2297748476,
0.1214376092,
0.29159531,
0.1652789414,
0.2727057934,
-0.0742384493,
-0.1061882153,
-0.016253937,
0.1357863694,
0.0346565694,
-0.1672894359,
0.0645059273,
-0.2023289055,
0.0787327364,
0.1431889981,
-0.3583348989,
0.2936252654,
-0.0419643037,
0.1355625838,
-0.2297317982,
0.1093871891,
0.0548777692,
-0.0068243896,
0.137367323,
0.0501093939,
0.1365747154,
-0.0179891326,
0.0329905003,
-0.1993449777,
-0.261903882,
-0.0321639143,
0.403047353,
-0.2017508447,
0.4200808704,
-0.2251234502,
-0.0806141496,
-0.1357367039,
-0.4637429714,
-0.1244160831,
-0.4885834754,
-0.2934885919,
0.4377198219,
-0.0523559451,
0.2884222567,
0.1593023241,
0.0659951195,
0.6007105112,
-0.1201815531,
-0.1299341917,
-0.1651611775,
-0.1434865147,
0.0020232061,
0.3916656673,
-0.3905929029,
0.3192388415,
-0.1485728025,
-0.0364400372,
-0.4931817949,
-0.1713026464,
0.2343467772,
-0.2515107393,
-0.1061095968,
0.2501231432,
0.1603117734,
-0.1276741028,
-0.3462353051,
0.2360217571,
-0.0971406177,
-0.0598606355,
0.3538430333,
-0.0178581066,
0.164885059,
0.1942383051,
-0.1618052572,
-0.1143743992,
-0.2210423648,
0.14889431,
-0.0242254268,
0.3098030388,
0.127951473,
0.0508768596,
0.0688193068,
0.053886503,
-0.0885349661,
-0.0529176332,
-0.4608558118,
0.4211564362,
-0.3188977838,
-0.2935516834,
-0.0610980801,
-0.0051954277,
0.3583407998,
0.374879539,
-0.295447588,
-0.0019786817,
0.1968030035,
0.0960599482,
-0.1780668497,
0.0133008994,
0.1617016941,
0.1165707856,
-0.0526863299,
-0.0528676808,
0.1458164752,
0.1710806787,
-0.1876335442,
0.2580990195,
0.1593024433,
0.4765363336,
0.2614044547,
0.6606869102,
0.0389069952,
-0.3858363032,
0.3321020901,
-0.1400645375,
-0.0007827042,
0.0866577998,
-0.6534715295,
0.183066234,
-0.2897426784,
-0.0263242908,
-0.1086073071,
-0.3637521565,
-0.2020134032,
-0.1655699164,
0.1691448241,
-0.0271606147,
-0.3952349722,
0.4657105505,
-0.4304014444,
0.2838456333,
-0.0792961791,
0.1368127912,
-0.6179903746,
-0.0159707945,
0.1340288073,
0.001461645,
0.2550833225,
-0.0820337683,
-0.3944139183,
0.0771884248,
-0.4658886194,
0.2320284247,
0.0853062123,
0.7238261104,
0.1851676106,
-0.2038862407,
-0.1605454981,
-0.033894185,
0.7261371017,
0.2351623774,
-0.0131856222,
0.0982148275,
-0.3114117086,
-0.4381259978,
-0.0794281512,
-0.2774269581,
0.6424903274,
0.1563334465,
0.2806633115,
-0.2328459024,
-0.1301856786,
0.1159900352,
0.1067453176,
-0.2158437669,
-0.2748224735,
-0.0760233179,
-0.068043299,
-0.3532236516,
-0.0140914749,
0.0438391231,
0.2820525765,
0.0923699439,
0.0220609028,
-0.3040830195,
-0.027666267,
0.3623539209,
-0.0427858792,
0.066070132,
-0.1614816338,
0.1583145708,
0.1936409473,
0.2400770783,
0.6411283016,
0.3070536256,
0.2450910807,
-0.4524519145,
0.3747630119,
0.0567932613,
0.2789524198,
0.1266826987,
-0.1120253131,
-0.0463845395,
-0.3257369101,
0.0500909425,
-0.4352755249,
0.5216366053,
0.5002288222,
0.1470032483,
-0.5732989907,
-0.3403779566,
0.2020386457,
0.1137957647,
0.1821293831,
0.7328404188,
-0.1325452179,
-0.1383226067,
0.1305198818,
0.1368959248,
0.7372894883,
0.0599585064,
0.1241549328,
0.4110814631,
0.5742581487,
0.2874031961,
-0.5326964855,
0.0999790281,
-0.2278513312,
-0.0477598421,
-0.1629468352,
-0.25533095,
0.0387579612,
0.1704581082,
-0.0596478768,
0.1802616715,
-0.0350547805,
0.5183292627,
0.0984522998,
0.0610765144,
-0.3110623956,
-0.2922026217,
0.0958927274,
0.1132939979,
-0.1642979831,
0.1464619935,
-0.0775096118,
-0.0749973804,
0.1822131574,
-0.2826292217,
-0.2507403493,
-0.0257557705,
-0.2285090983,
0.1024933532,
0.0329167247,
-0.4766203165,
0.1010434702,
0.0133418655,
0.0507275052,
-0.0903598666,
0.0723627806,
-0.2212267667,
-0.0407181494,
-0.1306502968,
-0.1328617334,
-0.084642455,
0.4096860588,
0.1249373332,
0.1308968812,
0.2817063332,
0.2302458882,
-0.3494544327,
0.0834643319,
0.2228662074,
0.2381529659,
-0.5538778901,
0.1067489982,
-0.11697644,
-0.2001721114,
-0.2225137204,
0.0751270503,
0.0035707846,
-0.3264314234,
0.0061722314,
-0.1581955105,
-0.0941700488,
0.0912849382,
0.4193666279,
0.0990062431,
-0.4401393235,
0.7563031316,
0.1833337992,
-0.2378753722,
-0.160160318,
0.1304144561,
0.4554123282,
-0.2698961198,
0.1051626801,
-0.3681174815,
0.1937123537,
-0.2056512237,
0.0954534784,
0.0749830157,
0.0011241229,
-0.0847065747,
-0.3185293972,
-0.3763855994,
0.0641731918,
-0.1275969148,
0.2709616125,
0.0657138526,
0.1442404538,
-0.2424862534,
0.1084677801,
-0.2284085006,
-0.0599613264,
-0.1304064989,
0.2170205861,
0.0687656701,
-0.1155500114,
-0.0299654584,
0.1643113941,
0.0875987187,
0.3649317622,
0.0772953033,
-0.2171726972,
-0.1124108583,
0.1081869155,
0.1269551963,
-0.2696896791,
0.0701319873,
-0.0216649901,
-0.0106123444,
-0.316885829,
0.0920087323,
0.0593077317,
-0.0337995999,
0.2827906013,
0.383587271,
0.045312129,
0.1048736423,
0.0202995371,
0.2444043607,
0.2644287944,
0.186061427,
0.3221852481,
-0.0346974693,
-0.0614789501,
-0.2507392168,
0.3639921844,
0.3781986833,
-0.1171505898,
0.1562584639,
-0.4842173457,
0.1358975172,
-0.130947262,
0.2535528541,
0.6113291383,
-0.3544901907,
-0.1553912908,
0.1691126078,
0.1126622632,
-0.0045485348,
0.0386664979,
0.0609533191,
-0.057821475,
-0.0058270902,
0.1932299733,
-0.0571367368,
-0.0611662231,
0.1354422271,
-0.0829461366,
0.2889601886,
-0.163466379,
0.1883116364,
0.064177081,
-0.4278974831,
-0.0858653784,
0.3677483797,
0.2824954391,
0.1013356969,
0.2784428596,
-0.107880272,
0.4273208976,
0.0708390996,
-0.2493038177,
-0.0165873189,
-0.4929739237,
-0.3299541473,
0.1111968383,
0.246336475,
0.1948018223,
0.0489692651,
0.320019722,
-0.0799893066,
-0.1117730886,
-0.0213638302,
0.1956694275,
-0.2775021493,
0.0963110328,
-0.3862144351,
-0.2213355303,
-0.2077881694,
-0.1047487855,
-0.0772701502,
-0.1806129962,
0.001915719,
0.1187873855,
-0.187499404,
-0.4298034906,
0.062750563,
-0.0045478209,
-0.112351723,
-0.3342281282,
0.217959106,
0.160262838,
0.1170849428,
0.0349094234,
0.2651890218,
0.5087577105,
0.4610846043,
-0.1494462788,
0.1769153029,
-0.5010873079,
-0.1911617666,
-0.0631126016,
0.1125182509,
-0.4148904979,
-0.1014756709,
0.386738658,
0.0840831771,
-0.1143441349,
-0.2153678387,
0.134074524,
0.0735939816,
0.000148272,
0.1247917041,
-0.0815561712,
0.0414280295,
-0.0814752057,
-0.044169452,
-0.4062022865,
-0.118234016,
0.4678343534,
0.1166638359,
0.196858868,
0.0207540877,
0.0589621812,
-0.2503392994,
0.4257990122,
0.4754781127,
0.2222503275,
-0.4092895389,
-0.2357501686,
-0.2958707809,
0.3727258444,
-0.1213888004,
-0.1949656606,
-0.0196233001,
0.1651483476,
0.3228290975,
0.2691094279,
0.2435300946,
-0.1453227103,
-0.0710383654,
0.3360806108,
-0.3235666752,
-0.3320511878,
0.0356341265,
0.2394294441,
-0.0671314895,
-0.277808845,
0.2334064245,
-0.1008596569,
0.1332826614,
-0.2046565562,
-0.3008010685,
0.0800731629,
0.0444455668,
0.4428641498,
0.1897004992,
0.4272843897,
0.0945998356,
0.0628772452,
-0.278421998,
-0.2361572236,
-0.1914743483,
0.0452264026,
0.0448539294,
0.2142350227,
-0.032453049,
-0.1344617456,
-0.5011918545,
0.2168957293,
-0.1091528907,
-0.2911403179,
-0.3574871719,
0.2795460224,
0.0037161098,
0.0702275783,
-0.0714732781,
0.2456232458,
0.2120579034,
0.5372607112,
-0.3672762513,
-0.2944156528,
0.4216323495,
-0.6915379763,
-0.4907263517,
0.02503521,
-0.1989058703,
0.1786560267,
0.27032426,
-0.5640618801,
0.0031022418,
0.317204237,
-0.1694210321,
-0.1327277124,
0.0034330208,
0.0969766378,
0.0240146872,
-0.1689355075,
0.388994813,
0.1035360545,
-0.0350188576,
-0.0177481119,
-0.2236269265
] |
https://github.com/huggingface/datasets/issues/1765 | Error iterating over Dataset with DataLoader | dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_size=4)
batch = next(iter(dataloader))
getting
ValueError: cannot reshape array of size 8192 into shape (1,512,4)
I had put padding as 2048 for encoded_dataset
kindly help | I have a Dataset that I've mapped a tokenizer over:
```
encoded_dataset.set_format(type='torch',columns=['attention_mask','input_ids','token_type_ids'])
encoded_dataset[:1]
```
```
{'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]),
'input_ids': tensor([[ 101, 178, 1198, 1400, 1714, 22233, 21365, 4515, 8618, 1113,
102]]),
'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])}
```
When I try to iterate as in the docs, I get errors:
```
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
next(iter(dataloader))
```
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-45-05180ba8aa35> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
----> 2 next(iter(dataloader))
3 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in __init__(self, loader)
411 self._timeout = loader.timeout
412 self._collate_fn = loader.collate_fn
--> 413 self._sampler_iter = iter(self._index_sampler)
414 self._base_seed = torch.empty((), dtype=torch.int64).random_(generator=loader.generator).item()
415 self._persistent_workers = loader.persistent_workers
TypeError: 'int' object is not iterable
``` | 28 | Error iterating over Dataset with DataLoader
I have a Dataset that I've mapped a tokenizer over:
```
encoded_dataset.set_format(type='torch',columns=['attention_mask','input_ids','token_type_ids'])
encoded_dataset[:1]
```
```
{'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]),
'input_ids': tensor([[ 101, 178, 1198, 1400, 1714, 22233, 21365, 4515, 8618, 1113,
102]]),
'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])}
```
When I try to iterate as in the docs, I get errors:
```
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
next(iter(dataloader))
```
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-45-05180ba8aa35> in <module>()
1 dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_sampler=32)
----> 2 next(iter(dataloader))
3 frames
/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py in __init__(self, loader)
411 self._timeout = loader.timeout
412 self._collate_fn = loader.collate_fn
--> 413 self._sampler_iter = iter(self._index_sampler)
414 self._base_seed = torch.empty((), dtype=torch.int64).random_(generator=loader.generator).item()
415 self._persistent_workers = loader.persistent_workers
TypeError: 'int' object is not iterable
```
dataloader = torch.utils.data.DataLoader(encoded_dataset, batch_size=4)
batch = next(iter(dataloader))
getting
ValueError: cannot reshape array of size 8192 into shape (1,512,4)
I had put padding as 2048 for encoded_dataset
kindly help | [
-0.2379292995,
0.055456318,
-0.0456709191,
0.2057333589,
0.1531802714,
0.0001413128,
0.7921317816,
0.3068522513,
0.0211306568,
0.1527127177,
0.0467957295,
0.2304262072,
-0.2809543908,
-0.2416440994,
-0.0902263597,
-0.0604500175,
-0.0764537454,
0.0790704489,
-0.1224218458,
0.0328941159,
-0.1435404718,
-0.0867298841,
-0.1925973892,
0.0319355614,
-0.2509384155,
-0.1322707981,
-0.1035913378,
-0.0947075114,
-0.3341252804,
-0.5228332877,
0.2897110879,
0.1179488078,
0.4238478541,
0.681245923,
-0.0001170856,
0.0532656237,
0.1204966158,
-0.1216142997,
-0.2641810775,
-0.2320629656,
0.1392340064,
-0.0516225547,
0.0336747169,
-0.3547688723,
0.2605600059,
-0.3312721848,
-0.0172063671,
-0.2235836387,
0.1987375766,
0.240710929,
0.1273105443,
0.4878686666,
-0.0130664511,
0.0686060563,
0.0452416725,
0.2505431175,
-0.0195117034,
0.1971430033,
0.1916248947,
0.0102276374,
-0.3597654402,
0.1168681905,
-0.1690706313,
0.0475238077,
0.1359685808,
-0.1127388328,
-0.2177607268,
-0.1320606321,
-0.0326833501,
-0.0796291456,
0.5732848644,
-0.2473983765,
-0.3338906467,
-0.1655158848,
-0.2215298563,
-0.2673027515,
0.3192117214,
-0.1650725901,
-0.1586041898,
-0.213989988,
0.115756996,
0.2405706644,
-0.2040266097,
0.1367145777,
-0.2591601312,
0.2086893767,
-0.0498502329,
0.3045001626,
0.2167699933,
-0.2556965947,
0.3407103717,
0.100551635,
0.0440496989,
0.2752287984,
-0.5098054409,
-0.2515715361,
0.0933655873,
-0.4813283682,
-0.0889513567,
0.1817472726,
0.2512767315,
0.0659235492,
-0.0267226119,
0.2420648336,
0.4608972371,
0.186747238,
0.1686097234,
0.3430073857,
0.0560027063,
-0.1008405611,
0.1115822867,
-0.0628374964,
-0.3309625089,
-0.3040353358,
0.2297863513,
0.1007606909,
0.2355148196,
0.0638041869,
-0.2407522351,
-0.0010412384,
-0.2854396105,
-0.1408833265,
0.1115426198,
0.1466976553,
0.2154823989,
0.0784652233,
-0.0211965814,
0.0494476445,
-0.0294590052,
-0.1010555252,
-0.0631029308,
0.1225908548,
-0.2360041142,
0.0062329904,
0.2692130506,
-0.0449522175,
-0.0005978719,
0.137932241,
-0.0163491201,
0.1064940467,
0.1838303804,
-0.1677455455,
0.2751209736,
-0.0668306872,
0.0526378267,
0.3259078264,
0.2427884638,
0.052704487,
-0.1517042518,
0.0064418842,
-0.4252363443,
-0.0854079127,
-0.0711297169,
0.1343849152,
-0.0657274276,
-0.0596551597,
-0.4029013515,
-0.1930606663,
0.3476110399,
-0.1592842042,
0.099020876,
-0.2618944943,
0.0679653063,
-0.0949436054,
0.0716987625,
0.3785109818,
-0.4588418603,
-0.1389314979,
0.1558686197,
0.1005790308,
0.2683535218,
0.2800277174,
-0.2775179148,
0.5750991702,
-0.4041409194,
0.3146151602,
0.3382747769,
-0.4575732648,
-0.3010722399,
0.302323699,
-0.1728588194,
0.1828439534,
0.1311058551,
0.0220964327,
0.4072544575,
-0.2117988765,
0.1262144446,
0.1312222928,
-0.1754143238,
-0.0844983682,
-0.0188896675,
0.4073567688,
0.5204415321,
0.0579208843,
0.1899081618,
0.0911745206,
-0.2563124001,
0.1866552234,
0.0407242253,
-0.1624023914,
0.0752801076,
0.1461820602,
0.0872924775,
0.1154014543,
0.2047132999,
-0.1541337967,
-0.2414142787,
0.017452905,
0.0847357586,
0.1103397533,
-0.1569615304,
0.1011083201,
0.0156294927,
0.1833892614,
-0.4093038142,
-0.1476444453,
0.1057990193,
0.3391776085,
-0.108505182,
-0.2262799889,
-0.2782577276,
0.0101971161,
-0.1502239406,
0.1229054853,
-0.3177072108,
0.0756458938,
0.0731090605,
-0.1621203572,
-0.1109918877,
0.0012578749,
0.2185537368,
-0.230595082,
-0.0198756754,
0.1527437717,
0.0733501613,
0.0837660953,
-0.1409204155,
0.0840367079,
0.2027755678,
-0.0805915445,
-0.0350412726,
0.0263241101,
0.0633542091,
-0.2463468164,
0.2860273719,
0.3557418585,
-0.0415121019,
0.5438953638,
-0.1846142113,
0.1865570694,
0.0854833424,
0.1429632455,
-0.2297748476,
0.1214376092,
0.29159531,
0.1652789414,
0.2727057934,
-0.0742384493,
-0.1061882153,
-0.016253937,
0.1357863694,
0.0346565694,
-0.1672894359,
0.0645059273,
-0.2023289055,
0.0787327364,
0.1431889981,
-0.3583348989,
0.2936252654,
-0.0419643037,
0.1355625838,
-0.2297317982,
0.1093871891,
0.0548777692,
-0.0068243896,
0.137367323,
0.0501093939,
0.1365747154,
-0.0179891326,
0.0329905003,
-0.1993449777,
-0.261903882,
-0.0321639143,
0.403047353,
-0.2017508447,
0.4200808704,
-0.2251234502,
-0.0806141496,
-0.1357367039,
-0.4637429714,
-0.1244160831,
-0.4885834754,
-0.2934885919,
0.4377198219,
-0.0523559451,
0.2884222567,
0.1593023241,
0.0659951195,
0.6007105112,
-0.1201815531,
-0.1299341917,
-0.1651611775,
-0.1434865147,
0.0020232061,
0.3916656673,
-0.3905929029,
0.3192388415,
-0.1485728025,
-0.0364400372,
-0.4931817949,
-0.1713026464,
0.2343467772,
-0.2515107393,
-0.1061095968,
0.2501231432,
0.1603117734,
-0.1276741028,
-0.3462353051,
0.2360217571,
-0.0971406177,
-0.0598606355,
0.3538430333,
-0.0178581066,
0.164885059,
0.1942383051,
-0.1618052572,
-0.1143743992,
-0.2210423648,
0.14889431,
-0.0242254268,
0.3098030388,
0.127951473,
0.0508768596,
0.0688193068,
0.053886503,
-0.0885349661,
-0.0529176332,
-0.4608558118,
0.4211564362,
-0.3188977838,
-0.2935516834,
-0.0610980801,
-0.0051954277,
0.3583407998,
0.374879539,
-0.295447588,
-0.0019786817,
0.1968030035,
0.0960599482,
-0.1780668497,
0.0133008994,
0.1617016941,
0.1165707856,
-0.0526863299,
-0.0528676808,
0.1458164752,
0.1710806787,
-0.1876335442,
0.2580990195,
0.1593024433,
0.4765363336,
0.2614044547,
0.6606869102,
0.0389069952,
-0.3858363032,
0.3321020901,
-0.1400645375,
-0.0007827042,
0.0866577998,
-0.6534715295,
0.183066234,
-0.2897426784,
-0.0263242908,
-0.1086073071,
-0.3637521565,
-0.2020134032,
-0.1655699164,
0.1691448241,
-0.0271606147,
-0.3952349722,
0.4657105505,
-0.4304014444,
0.2838456333,
-0.0792961791,
0.1368127912,
-0.6179903746,
-0.0159707945,
0.1340288073,
0.001461645,
0.2550833225,
-0.0820337683,
-0.3944139183,
0.0771884248,
-0.4658886194,
0.2320284247,
0.0853062123,
0.7238261104,
0.1851676106,
-0.2038862407,
-0.1605454981,
-0.033894185,
0.7261371017,
0.2351623774,
-0.0131856222,
0.0982148275,
-0.3114117086,
-0.4381259978,
-0.0794281512,
-0.2774269581,
0.6424903274,
0.1563334465,
0.2806633115,
-0.2328459024,
-0.1301856786,
0.1159900352,
0.1067453176,
-0.2158437669,
-0.2748224735,
-0.0760233179,
-0.068043299,
-0.3532236516,
-0.0140914749,
0.0438391231,
0.2820525765,
0.0923699439,
0.0220609028,
-0.3040830195,
-0.027666267,
0.3623539209,
-0.0427858792,
0.066070132,
-0.1614816338,
0.1583145708,
0.1936409473,
0.2400770783,
0.6411283016,
0.3070536256,
0.2450910807,
-0.4524519145,
0.3747630119,
0.0567932613,
0.2789524198,
0.1266826987,
-0.1120253131,
-0.0463845395,
-0.3257369101,
0.0500909425,
-0.4352755249,
0.5216366053,
0.5002288222,
0.1470032483,
-0.5732989907,
-0.3403779566,
0.2020386457,
0.1137957647,
0.1821293831,
0.7328404188,
-0.1325452179,
-0.1383226067,
0.1305198818,
0.1368959248,
0.7372894883,
0.0599585064,
0.1241549328,
0.4110814631,
0.5742581487,
0.2874031961,
-0.5326964855,
0.0999790281,
-0.2278513312,
-0.0477598421,
-0.1629468352,
-0.25533095,
0.0387579612,
0.1704581082,
-0.0596478768,
0.1802616715,
-0.0350547805,
0.5183292627,
0.0984522998,
0.0610765144,
-0.3110623956,
-0.2922026217,
0.0958927274,
0.1132939979,
-0.1642979831,
0.1464619935,
-0.0775096118,
-0.0749973804,
0.1822131574,
-0.2826292217,
-0.2507403493,
-0.0257557705,
-0.2285090983,
0.1024933532,
0.0329167247,
-0.4766203165,
0.1010434702,
0.0133418655,
0.0507275052,
-0.0903598666,
0.0723627806,
-0.2212267667,
-0.0407181494,
-0.1306502968,
-0.1328617334,
-0.084642455,
0.4096860588,
0.1249373332,
0.1308968812,
0.2817063332,
0.2302458882,
-0.3494544327,
0.0834643319,
0.2228662074,
0.2381529659,
-0.5538778901,
0.1067489982,
-0.11697644,
-0.2001721114,
-0.2225137204,
0.0751270503,
0.0035707846,
-0.3264314234,
0.0061722314,
-0.1581955105,
-0.0941700488,
0.0912849382,
0.4193666279,
0.0990062431,
-0.4401393235,
0.7563031316,
0.1833337992,
-0.2378753722,
-0.160160318,
0.1304144561,
0.4554123282,
-0.2698961198,
0.1051626801,
-0.3681174815,
0.1937123537,
-0.2056512237,
0.0954534784,
0.0749830157,
0.0011241229,
-0.0847065747,
-0.3185293972,
-0.3763855994,
0.0641731918,
-0.1275969148,
0.2709616125,
0.0657138526,
0.1442404538,
-0.2424862534,
0.1084677801,
-0.2284085006,
-0.0599613264,
-0.1304064989,
0.2170205861,
0.0687656701,
-0.1155500114,
-0.0299654584,
0.1643113941,
0.0875987187,
0.3649317622,
0.0772953033,
-0.2171726972,
-0.1124108583,
0.1081869155,
0.1269551963,
-0.2696896791,
0.0701319873,
-0.0216649901,
-0.0106123444,
-0.316885829,
0.0920087323,
0.0593077317,
-0.0337995999,
0.2827906013,
0.383587271,
0.045312129,
0.1048736423,
0.0202995371,
0.2444043607,
0.2644287944,
0.186061427,
0.3221852481,
-0.0346974693,
-0.0614789501,
-0.2507392168,
0.3639921844,
0.3781986833,
-0.1171505898,
0.1562584639,
-0.4842173457,
0.1358975172,
-0.130947262,
0.2535528541,
0.6113291383,
-0.3544901907,
-0.1553912908,
0.1691126078,
0.1126622632,
-0.0045485348,
0.0386664979,
0.0609533191,
-0.057821475,
-0.0058270902,
0.1932299733,
-0.0571367368,
-0.0611662231,
0.1354422271,
-0.0829461366,
0.2889601886,
-0.163466379,
0.1883116364,
0.064177081,
-0.4278974831,
-0.0858653784,
0.3677483797,
0.2824954391,
0.1013356969,
0.2784428596,
-0.107880272,
0.4273208976,
0.0708390996,
-0.2493038177,
-0.0165873189,
-0.4929739237,
-0.3299541473,
0.1111968383,
0.246336475,
0.1948018223,
0.0489692651,
0.320019722,
-0.0799893066,
-0.1117730886,
-0.0213638302,
0.1956694275,
-0.2775021493,
0.0963110328,
-0.3862144351,
-0.2213355303,
-0.2077881694,
-0.1047487855,
-0.0772701502,
-0.1806129962,
0.001915719,
0.1187873855,
-0.187499404,
-0.4298034906,
0.062750563,
-0.0045478209,
-0.112351723,
-0.3342281282,
0.217959106,
0.160262838,
0.1170849428,
0.0349094234,
0.2651890218,
0.5087577105,
0.4610846043,
-0.1494462788,
0.1769153029,
-0.5010873079,
-0.1911617666,
-0.0631126016,
0.1125182509,
-0.4148904979,
-0.1014756709,
0.386738658,
0.0840831771,
-0.1143441349,
-0.2153678387,
0.134074524,
0.0735939816,
0.000148272,
0.1247917041,
-0.0815561712,
0.0414280295,
-0.0814752057,
-0.044169452,
-0.4062022865,
-0.118234016,
0.4678343534,
0.1166638359,
0.196858868,
0.0207540877,
0.0589621812,
-0.2503392994,
0.4257990122,
0.4754781127,
0.2222503275,
-0.4092895389,
-0.2357501686,
-0.2958707809,
0.3727258444,
-0.1213888004,
-0.1949656606,
-0.0196233001,
0.1651483476,
0.3228290975,
0.2691094279,
0.2435300946,
-0.1453227103,
-0.0710383654,
0.3360806108,
-0.3235666752,
-0.3320511878,
0.0356341265,
0.2394294441,
-0.0671314895,
-0.277808845,
0.2334064245,
-0.1008596569,
0.1332826614,
-0.2046565562,
-0.3008010685,
0.0800731629,
0.0444455668,
0.4428641498,
0.1897004992,
0.4272843897,
0.0945998356,
0.0628772452,
-0.278421998,
-0.2361572236,
-0.1914743483,
0.0452264026,
0.0448539294,
0.2142350227,
-0.032453049,
-0.1344617456,
-0.5011918545,
0.2168957293,
-0.1091528907,
-0.2911403179,
-0.3574871719,
0.2795460224,
0.0037161098,
0.0702275783,
-0.0714732781,
0.2456232458,
0.2120579034,
0.5372607112,
-0.3672762513,
-0.2944156528,
0.4216323495,
-0.6915379763,
-0.4907263517,
0.02503521,
-0.1989058703,
0.1786560267,
0.27032426,
-0.5640618801,
0.0031022418,
0.317204237,
-0.1694210321,
-0.1327277124,
0.0034330208,
0.0969766378,
0.0240146872,
-0.1689355075,
0.388994813,
0.1035360545,
-0.0350188576,
-0.0177481119,
-0.2236269265
] |
https://github.com/huggingface/datasets/issues/1762 | Unable to format dataset to CUDA Tensors | Hi ! You can get CUDA tensors with
```python
dataset.set_format("torch", columns=columns, device="cuda")
```
Indeed `set_format` passes the `**kwargs` to `torch.tensor` | Hi,
I came across this [link](https://huggingface.co/docs/datasets/torch_tensorflow.html) where the docs show show to convert a dataset to a particular format. I see that there is an option to convert it to tensors, but I don't see any option to convert it to CUDA tensors.
I tried this, but Dataset doesn't support assignment:
```
columns=['input_ids', 'token_type_ids', 'attention_mask', 'start_positions','end_positions']
samples.set_format(type='torch', columns = columns)
for column in columns:
samples[column].to(torch.device(self.config.device))
```
There should be an option to do so, or if there is already a way to do this, please let me know.
Thanks,
Gunjan | 20 | Unable to format dataset to CUDA Tensors
Hi,
I came across this [link](https://huggingface.co/docs/datasets/torch_tensorflow.html) where the docs show show to convert a dataset to a particular format. I see that there is an option to convert it to tensors, but I don't see any option to convert it to CUDA tensors.
I tried this, but Dataset doesn't support assignment:
```
columns=['input_ids', 'token_type_ids', 'attention_mask', 'start_positions','end_positions']
samples.set_format(type='torch', columns = columns)
for column in columns:
samples[column].to(torch.device(self.config.device))
```
There should be an option to do so, or if there is already a way to do this, please let me know.
Thanks,
Gunjan
Hi ! You can get CUDA tensors with
```python
dataset.set_format("torch", columns=columns, device="cuda")
```
Indeed `set_format` passes the `**kwargs` to `torch.tensor` | [
-0.2256218493,
-0.4427933097,
-0.0796789601,
0.1839717627,
0.5433500409,
0.3885731101,
0.5336819887,
0.3345811069,
-0.0096711563,
0.1427577734,
-0.0833447576,
0.2423237413,
-0.2235850543,
0.0973635241,
0.1539928466,
-0.3738491833,
0.2507271171,
-0.1545419246,
-0.0661571473,
0.0754859373,
-0.1834038198,
0.0132905096,
-0.1419785172,
-0.298579365,
-0.2301397026,
-0.1756633073,
-0.0042092809,
-0.3617511988,
-0.1628381759,
-0.07049869,
0.2917988002,
0.0672330484,
0.2707693875,
0.478096813,
-0.0001229248,
-0.0246179122,
-0.0642264336,
-0.0974277109,
-0.1229582429,
-0.3244965971,
0.0951582417,
-0.3088738322,
0.3264770806,
-0.2337548733,
-0.4170432091,
0.16387555,
0.0245887898,
-0.3956412077,
0.2314237356,
0.5253637433,
0.119892545,
0.1924464703,
0.2394108027,
0.0240937099,
-0.174058646,
0.3766065836,
-0.3542352915,
0.0254850555,
0.1695799083,
0.1583284289,
0.2881678939,
0.137188822,
-0.141746819,
0.0376534462,
0.2801635861,
0.0131861679,
-0.3805174232,
-0.3432410359,
0.0215505753,
0.1126779839,
0.6594465375,
-0.3422843814,
-0.3564410806,
0.0958750546,
0.0935507938,
-0.3833394349,
-0.2534758151,
0.6357637644,
-0.3619587421,
0.0637376308,
-0.3649027944,
-0.0060931086,
-0.2450169921,
0.1199355796,
-0.2295884192,
0.0090735266,
-0.1717317104,
0.0108393114,
0.0507863723,
0.1569462121,
0.342322439,
0.1247880757,
0.2225868553,
0.1706424952,
-0.4807889163,
-0.0802843049,
-0.5487515926,
-0.1374808997,
0.1584181786,
0.0792689696,
0.1561626047,
0.0094163585,
-0.1356782317,
0.031078808,
-0.236645788,
0.2848205864,
0.0388160013,
0.223769322,
-0.0503089726,
-0.2578218579,
0.3450124264,
-0.069499664,
-0.2909882367,
-0.5439584851,
-0.3113092482,
0.2484919578,
0.064755246,
-0.0952001512,
-0.2748990953,
-0.0943067893,
-0.0721348748,
0.1659944057,
-0.2177156061,
0.2759563923,
0.0138930418,
0.1429405361,
0.4675444365,
0.195800364,
0.0387671404,
0.0351163186,
-0.0183570534,
0.1494892836,
-0.2646303475,
-0.1256723851,
0.0721445903,
-0.4210523069,
-0.0233482849,
0.113988243,
0.0096134711,
0.0315900929,
-0.1051624864,
0.136878103,
0.4796122909,
0.1230212897,
-0.0158105902,
0.3791807294,
0.2303940952,
0.2479827702,
-0.1812105477,
0.1148492694,
-0.4754991531,
-0.1314102113,
-0.4951536655,
0.0048490409,
0.2056555152,
0.0164861605,
-0.2150599211,
0.1820430011,
0.2101213336,
0.1832932234,
0.0954420641,
-0.1238449886,
-0.1386011392,
-0.3152531683,
0.4940917492,
0.0894367769,
-0.3502282798,
0.034581013,
0.4406888187,
-0.0463684909,
0.2261007875,
0.2932244241,
0.1481194049,
-0.085508205,
-0.1110271141,
-0.3296709359,
0.4267119169,
-0.4239212275,
-0.0523389168,
-0.1957856417,
0.1323823184,
-0.2657714486,
-0.0977083594,
0.1303256303,
0.2611170411,
0.0910995528,
0.1769357473,
0.2144691348,
-0.0166979991,
-0.025544906,
-0.0110305529,
-0.0166319963,
0.5035654306,
-0.0718853846,
-0.1488170773,
0.3139472902,
-0.2549301982,
-0.0558853783,
0.1944794059,
-0.0787514821,
-0.0455780141,
0.0698696971,
0.2203968167,
0.0215007104,
-0.1393844932,
0.0578471757,
-0.4551049173,
-0.0518701337,
0.376541853,
0.2090653181,
0.0017817856,
-0.154199332,
-0.0092121223,
0.0174243804,
-0.0316410325,
-0.0423276909,
-0.0057314667,
-0.3412945867,
-0.0105291335,
-0.1243203059,
-0.2345961481,
0.283226341,
-0.2481101006,
0.1815064102,
-0.335683614,
0.0683286712,
0.0299715586,
-0.0916068181,
0.1092942655,
0.2145721614,
0.0308761224,
-0.2610087693,
0.0671414286,
0.101812087,
0.1645312011,
-0.0581312478,
-0.4233419597,
0.2127871215,
0.2228581458,
-0.0367754623,
-0.0745976493,
0.123450622,
-0.0332944654,
-0.1430663913,
-0.3616460562,
0.3625271916,
-0.0108389268,
0.1866386682,
-0.3714400232,
0.4350888431,
0.1689337641,
0.1201379821,
-0.0524894558,
0.0288174525,
0.0178160314,
0.1589604318,
0.1490105689,
-0.0830549747,
-0.8168125749,
-0.0437465124,
0.0440927967,
0.0056202817,
0.0737129748,
0.0615217164,
-0.1806372255,
0.128930077,
0.2762048841,
-0.3634000421,
-0.1357694566,
0.0835301131,
0.1757230759,
0.0601646714,
0.0710736066,
-0.1641989797,
0.028269833,
-0.0812103525,
-0.0660021529,
-0.1247669756,
0.1195551604,
-0.0269374829,
0.0500961058,
0.2913750708,
-0.0298886187,
0.1166298464,
-0.4848845899,
-0.0065649324,
-0.3681721985,
0.0670636967,
-0.4132382572,
-0.3664826453,
0.010741408,
-0.0310967863,
-0.1577300429,
0.1503383815,
0.3468292058,
0.2500931919,
0.2051337361,
0.1608517319,
0.2119720876,
-0.1426743269,
-0.1758131087,
-0.2458099276,
0.1105067208,
0.0328496546,
0.3166612387,
-0.1641022861,
0.2430423349,
-0.2375466228,
0.1929851472,
-0.3415491879,
0.0782576501,
-0.124256961,
-0.1230963618,
-0.1152372062,
0.0981336236,
0.3823601902,
0.0002366568,
-0.0251262039,
0.1249269247,
0.1794397086,
-0.0476492979,
0.0180806108,
-0.3153511286,
-0.0419400409,
-0.1957779825,
-0.2927685082,
-0.2447790056,
-0.2122535557,
0.2192923129,
-0.0179447792,
0.1260715127,
-0.3188108802,
0.3760597706,
-0.1312128901,
0.0854475722,
-0.0370540842,
0.0366185308,
-0.5210582018,
0.6136802435,
-0.2563225329,
-0.5021973252,
0.1569045037,
0.178688392,
0.4287463129,
0.4022276103,
-0.0092979362,
0.1788422167,
0.1736887842,
0.0001516695,
0.0375472084,
0.0406188332,
0.293846041,
0.0051615657,
0.1208503991,
0.1078771204,
-0.1107718125,
-0.0639939159,
0.0457477346,
0.3260577321,
0.1296520084,
0.5017366409,
0.0955555514,
0.7273527384,
0.1096756682,
-0.575406909,
0.0250866152,
-0.2393108606,
0.3088156283,
-0.105642803,
-0.3586207628,
0.2695135176,
-0.0499893203,
0.1267044544,
-0.0085071176,
-0.1291823238,
-0.0067323158,
-0.1740819961,
0.186376676,
-0.3261074424,
-0.1349492073,
0.1382607669,
-0.3389182091,
0.2386585474,
-0.3227365613,
0.3202265203,
-0.0496729724,
-0.1763439178,
0.2526323199,
0.3094440699,
0.2343841642,
0.130215764,
-0.077821359,
0.0152142411,
-0.6871011257,
0.2909297943,
-0.1383938789,
0.4108789265,
-0.084523052,
0.2319001704,
0.1422141045,
0.2238976806,
0.7626752257,
0.1783865094,
-0.4628428817,
-0.0055346508,
-0.0901672095,
-0.4889873564,
-0.1416971684,
0.0379627496,
0.1972915232,
-0.0523720309,
0.0690906271,
-0.1246237084,
-0.2433521301,
-0.0321109444,
0.2817809582,
-0.2991708219,
0.0557020269,
-0.1103805751,
-0.0708338842,
-0.1124794781,
0.0760319233,
0.2284830958,
0.2087953836,
0.0493771024,
-0.2428570539,
-0.2562503517,
0.1293088943,
0.429092586,
-0.1435294151,
0.1916424334,
0.2431156188,
-0.1228985786,
0.1585059166,
0.2474366128,
0.2909750044,
-0.0748078227,
-0.1656505913,
-0.1268555969,
-0.0157535896,
-0.0794739425,
0.4617821276,
-0.0818611979,
0.0343345068,
-0.1174076349,
-0.2418865561,
-0.0596986338,
-0.3334887028,
0.2495236099,
0.2493161857,
0.2935779393,
-0.7081378102,
-0.5079491735,
0.2671420872,
0.1704099178,
0.201154694,
0.5503252745,
0.2755130529,
-0.0937253311,
0.1817551404,
0.5460437536,
0.7262755036,
-0.4373692274,
0.0883292705,
0.169521451,
-0.1852006912,
0.4915031195,
-0.4952091575,
0.2678433657,
-0.3490416408,
-0.0129419453,
-0.3435453475,
-0.1704231948,
0.0923677087,
0.154736042,
0.0693903342,
0.2467311919,
-0.4792624116,
0.1329329163,
-0.0765670761,
-0.0640294254,
0.1686973572,
-0.2746073604,
0.0459035598,
0.0735662803,
-0.2213016897,
0.1633023322,
0.0387776159,
0.0078239078,
-0.082080394,
0.2580878735,
-0.2444152683,
-0.1008852869,
-0.3394668996,
0.0662848502,
0.0043604486,
-0.924551785,
0.307977587,
0.6653308272,
0.6603670716,
-0.0115602082,
-0.1696526408,
-0.0574397929,
-0.1245383322,
-0.1532784402,
-0.1686954349,
0.024165364,
0.2793967426,
0.076240696,
0.0564431064,
0.3012826145,
0.2693251371,
-0.0793766603,
0.0156170577,
0.032960467,
0.0515445657,
-0.3542851508,
-0.5156935453,
0.0778121278,
0.3148763776,
0.0347287431,
0.0476151966,
0.1336492598,
-0.1509750187,
0.2008598298,
-0.0868734643,
-0.1367922574,
0.0985729769,
0.2253590077,
-0.0048614396,
-0.2825208306,
0.3255102932,
0.4667449892,
-0.2335279137,
-0.0720069259,
-0.0452550687,
0.5412316322,
-0.1509994566,
0.0699635968,
-0.1486242265,
0.3061977625,
-0.1462111175,
0.2523738146,
-0.22613433,
0.0204297621,
-0.0249018706,
-0.109975405,
-0.2874637544,
-0.1830468625,
-0.2217332423,
0.3471127748,
0.2211425155,
0.1099038869,
0.0347801894,
-0.2116914839,
-0.15497379,
0.0499273278,
0.0292914193,
0.2112976313,
0.1265249848,
0.3123992383,
-0.0772057995,
-0.2509690225,
0.0137804449,
0.0757982433,
0.0760445818,
-0.1355062425,
-0.1599954218,
0.1292594969,
0.0249468926,
0.1285493225,
0.1513335854,
-0.0317275599,
-0.2759662569,
-0.2957114577,
0.2763575017,
0.5281389952,
-0.0334192477,
0.5064693689,
-0.0431854911,
0.1148931757,
-0.1124214157,
-0.1123215482,
0.2780424058,
-0.0100900838,
0.105144389,
0.037738286,
0.0768371299,
-0.066794768,
-0.3280540407,
0.233783409,
0.1334264576,
-0.2346496284,
0.1191403493,
-0.0016484528,
0.2164835334,
-0.0482489504,
0.0902826712,
-0.0337738171,
-0.0817687213,
0.3144364357,
0.2636377811,
0.0512534827,
-0.001574873,
0.0905370638,
-0.0152504751,
-0.0281642601,
-0.1318355501,
0.0769978091,
0.1474350244,
-0.0191242397,
-0.2113024741,
-0.17674312,
0.1221662089,
-0.3572856784,
0.2631489933,
0.060049925,
0.2629469037,
0.0300519336,
0.2148788869,
0.010832442,
-0.0188160818,
-0.1008992195,
0.1697941124,
0.4328986704,
0.3964438438,
-0.1226715893,
0.2822855413,
-0.124477379,
-0.2815708816,
-0.3143922985,
0.0735904053,
0.2375870943,
-0.0060708709,
0.3808268011,
-0.1185417622,
-0.3919458687,
-0.154963553,
0.1733685285,
-0.3100360334,
0.0316710137,
-0.1686133146,
0.11809396,
0.2738741636,
0.0992391631,
-0.0267530512,
-0.4498536289,
0.2340623289,
0.1182745919,
-0.0248377919,
0.2466266602,
0.1177194715,
0.2841740549,
0.0447550863,
0.0399524681,
-0.1534442753,
-0.2346266061,
-0.1117724851,
-0.0916306227,
0.2085825503,
0.3270855248,
0.1454713494,
0.1321723908,
0.1781022251,
-0.0922007114,
-0.076066941,
0.3173438609,
0.2029471248,
-0.0109716142,
-0.0393636487,
0.0972822905,
0.1139339358,
0.0900126696,
-0.0789600983,
-0.0132520478,
0.2696389258,
-0.2736497819,
-0.1661754698,
-0.3909122348,
-0.3425942957,
-0.4184504747,
-0.0018124597,
-0.1765223444,
0.057806991,
0.3780955076,
0.0690374076,
-0.1483122408,
0.0484111421,
-0.0011281437,
0.0168216769,
0.3757731616,
0.0264279116,
0.3644811213,
-0.1024349779,
-0.3040475845,
-0.1069055796,
0.0779599622,
0.270878166,
0.1656136811,
-0.1299975514,
-0.0976868346,
0.1329163313,
0.0638889596,
-0.2048263252,
-0.1444840431,
0.1746781766,
0.4526620209,
-0.0779573321,
-0.0537577011,
-0.4576846063,
0.0474801771,
0.0657897145,
0.0188357569,
0.0524390824,
-0.0736979023,
-0.0982628539,
-0.2549459338,
0.4785960019,
-0.0774044842,
0.2852933705,
0.1914911419,
-0.0014074222,
0.3393487334,
0.2105215192,
0.2949733138,
-0.0881436914,
0.1394771039,
-0.0894133002,
0.3484449387,
-0.1745029688,
0.1316315979,
-0.1218910888,
-0.4343793392,
-0.1767449677,
0.5815296173,
0.1364261806,
-0.1919686645,
-0.1335178763,
0.2131028175,
-0.2032686472,
-0.2481189221,
0.6295919418,
0.3496638238,
0.0629958063,
0.1778909266,
-0.2997425497,
-0.0053986465,
0.2633987665,
-0.2851153016,
-0.177572161,
0.0267935432,
-0.2837471366,
0.3643315136,
0.1285241544,
-1.0042158365,
-0.0508148745,
0.0431104787,
-0.2969078124,
-0.1156269088,
0.2367577106,
0.0655903444,
0.1566388458,
-0.175094977,
0.3621439636,
0.1089463905,
0.0532209016,
-0.4503197372,
-0.3442661762
] |
https://github.com/huggingface/datasets/issues/1762 | Unable to format dataset to CUDA Tensors | Hi @lhoestq,
Thanks a lot. Is this true for all format types?
As in, for 'torch', I can have `**kwargs` to `torch.tensor` and for 'tf' those args are passed to `tf.Tensor`, and the same for 'numpy' and 'pandas'? | Hi,
I came across this [link](https://huggingface.co/docs/datasets/torch_tensorflow.html) where the docs show show to convert a dataset to a particular format. I see that there is an option to convert it to tensors, but I don't see any option to convert it to CUDA tensors.
I tried this, but Dataset doesn't support assignment:
```
columns=['input_ids', 'token_type_ids', 'attention_mask', 'start_positions','end_positions']
samples.set_format(type='torch', columns = columns)
for column in columns:
samples[column].to(torch.device(self.config.device))
```
There should be an option to do so, or if there is already a way to do this, please let me know.
Thanks,
Gunjan | 38 | Unable to format dataset to CUDA Tensors
Hi,
I came across this [link](https://huggingface.co/docs/datasets/torch_tensorflow.html) where the docs show show to convert a dataset to a particular format. I see that there is an option to convert it to tensors, but I don't see any option to convert it to CUDA tensors.
I tried this, but Dataset doesn't support assignment:
```
columns=['input_ids', 'token_type_ids', 'attention_mask', 'start_positions','end_positions']
samples.set_format(type='torch', columns = columns)
for column in columns:
samples[column].to(torch.device(self.config.device))
```
There should be an option to do so, or if there is already a way to do this, please let me know.
Thanks,
Gunjan
Hi @lhoestq,
Thanks a lot. Is this true for all format types?
As in, for 'torch', I can have `**kwargs` to `torch.tensor` and for 'tf' those args are passed to `tf.Tensor`, and the same for 'numpy' and 'pandas'? | [
-0.1914240569,
-0.4953544438,
-0.0635153577,
0.1430508196,
0.5737581253,
0.3578243256,
0.6109963655,
0.3751017153,
-0.0064690006,
0.0933136046,
-0.1843089908,
0.2385639697,
-0.1888937503,
0.2082742751,
0.185547173,
-0.3550988734,
0.2348215282,
-0.1543386877,
-0.0376627445,
0.0704860911,
-0.2085145563,
-0.0241097603,
-0.1562636793,
-0.2900011241,
-0.1949909478,
-0.1617195606,
0.0201716442,
-0.440032661,
-0.1024809256,
-0.0641934276,
0.2913288772,
0.1048882827,
0.3066851199,
0.4878616333,
-0.0001256564,
-0.0178643595,
-0.0497947447,
-0.1510568112,
-0.1228254065,
-0.2663964927,
0.0131859509,
-0.2795285881,
0.3273177147,
-0.2697502375,
-0.361690402,
0.1351328641,
0.050388962,
-0.3767500222,
0.2008642256,
0.5606643558,
0.087332204,
0.1567416936,
0.2239812165,
0.0313127451,
-0.140110746,
0.4742644429,
-0.3869947791,
0.0321356654,
0.1239138618,
0.2313417941,
0.2390955985,
0.1219476238,
-0.1170620993,
0.0366932862,
0.2436487824,
0.0068774354,
-0.3590631485,
-0.2845259011,
0.0415750593,
0.2316782475,
0.7356418967,
-0.3058366179,
-0.4198357165,
0.0801289156,
0.0384076312,
-0.3957467973,
-0.1968507767,
0.6596466303,
-0.3205677569,
0.0670802593,
-0.3185798228,
0.1147157922,
-0.2370991707,
0.12597543,
-0.2630986571,
0.0228495598,
-0.2386254817,
-0.0052828169,
0.0134358658,
0.1373593062,
0.2915564477,
0.108481884,
0.1864103526,
0.1729705334,
-0.4968360364,
-0.1123950481,
-0.5637842417,
-0.1750736684,
0.1455131918,
0.075093627,
0.1889844239,
0.0470552146,
-0.1527157277,
0.0456818528,
-0.1689352989,
0.2241688669,
0.0323080085,
0.1593717635,
-0.0521194376,
-0.2683008909,
0.3393743932,
-0.0639513731,
-0.2907772064,
-0.5000956059,
-0.294485867,
0.1828470081,
0.0936032012,
-0.074678801,
-0.2550734282,
-0.1188577786,
-0.0248169284,
0.1076059118,
-0.2666124403,
0.2495331019,
0.0253214594,
0.3020796776,
0.3945818543,
0.1859079748,
0.0624373928,
0.088502191,
0.0459994376,
0.0976754501,
-0.2249604315,
-0.2046594769,
0.0503197387,
-0.34944278,
-0.052041512,
0.131943509,
-0.0298441909,
-0.0050225365,
-0.1101643145,
0.0849641636,
0.4755418897,
0.1198235601,
-0.1078409776,
0.4093901813,
0.210804835,
0.2150565237,
-0.2697771192,
0.1633628607,
-0.4828787148,
-0.0503402352,
-0.4977715313,
-0.0458524227,
0.2782034874,
-0.00523677,
-0.2089640498,
0.2063408941,
0.2674427927,
0.1263453811,
0.1163300276,
-0.1863860488,
-0.1187277436,
-0.2959931493,
0.4839716852,
0.0943366066,
-0.346241951,
-0.0135648455,
0.5384858251,
-0.0493879654,
0.2286547869,
0.3445949554,
0.1999174356,
-0.1558274031,
-0.116152592,
-0.3076293766,
0.5141445994,
-0.3327647746,
0.0620908961,
-0.2046287954,
0.2385943681,
-0.2397406697,
-0.0306932256,
0.0901031941,
0.2652631104,
0.0417133495,
0.1719371527,
0.2446943372,
-0.0256075505,
0.0062518655,
-0.0202020574,
0.0564032048,
0.4594364762,
-0.0907294825,
-0.1993739903,
0.3107618093,
-0.2633803785,
-0.1151413769,
0.1621512473,
-0.0987522826,
-0.0622769482,
0.0123845292,
0.2049012333,
0.0305002928,
-0.1359104812,
0.0358943492,
-0.4950875938,
-0.1287978292,
0.3969783485,
0.1687710583,
0.1217770353,
-0.1747485101,
-0.0030756991,
-0.0099150566,
0.0079434458,
0.0448174812,
-0.0464094542,
-0.2493266016,
-0.0874046087,
-0.0615765229,
-0.3723646998,
0.1812835038,
-0.2245939821,
0.1582474858,
-0.2071204484,
-0.1247378364,
0.0592539608,
-0.0716331005,
0.0630287826,
0.2352626771,
0.0131813586,
-0.212483719,
0.0284210593,
0.0819355547,
0.2183369994,
-0.0558923297,
-0.5166808367,
0.2893254757,
0.2828789949,
0.1045514122,
-0.1155060679,
0.0311217755,
0.0055085574,
-0.1629833579,
-0.3709151447,
0.4067360163,
0.0599331409,
0.2309544981,
-0.3554265499,
0.3759164512,
0.1866152138,
0.1095321327,
-0.0815116391,
0.0628499016,
-0.0306957364,
0.154332757,
0.1242306679,
-0.0269196816,
-0.8723095059,
-0.0826108158,
0.08933568,
-0.0524719059,
0.1247085184,
0.0851077959,
-0.159585461,
0.1669843048,
0.2630161345,
-0.397827208,
-0.1376065463,
0.0414259546,
0.1940868646,
-0.0485708714,
0.0565145537,
-0.2335636616,
0.0186634753,
-0.0982430577,
-0.0915795416,
-0.0727773234,
0.1071514562,
-0.0184024703,
0.0337334499,
0.3695031404,
-0.0305228941,
0.0190546717,
-0.536211133,
-0.0158572309,
-0.3519633114,
0.097747393,
-0.3490994275,
-0.3521321118,
0.1291351318,
-0.0189530067,
-0.1611274779,
0.053475596,
0.3019582033,
0.2789478302,
0.1680698842,
0.272107482,
0.1798409224,
-0.1224960536,
-0.211898759,
-0.2402275503,
0.1241371632,
0.0009449809,
0.4400054514,
-0.2165762931,
0.2178511471,
-0.2075903863,
0.1460316479,
-0.2733970881,
0.0451165959,
-0.1020591557,
-0.111259453,
-0.1189442128,
0.0832446367,
0.3903747499,
0.0218297429,
-0.0288240761,
0.1350184083,
0.1823804379,
-0.0211636275,
0.0235006046,
-0.3299602568,
-0.03737735,
-0.2545596659,
-0.2003008127,
-0.232990697,
-0.2443696707,
0.2478483319,
-0.0416193344,
0.1478680521,
-0.3123803139,
0.3225724995,
-0.1367617399,
-0.0515977256,
0.0416278541,
0.054570917,
-0.4584088027,
0.6442710757,
-0.277574718,
-0.4975638092,
0.1916212589,
0.1685623825,
0.3659407496,
0.4488738179,
0.0472362377,
0.1143315583,
0.147389397,
-0.1106016263,
0.0562096722,
0.0760412067,
0.2353338301,
-0.0226626955,
0.1571548581,
0.1175531745,
-0.0740972012,
-0.0103898197,
0.0545893237,
0.2211625278,
0.2090293616,
0.4589601159,
0.0763141438,
0.612846911,
0.0670989454,
-0.6483484507,
0.0579885095,
-0.2046810985,
0.3649876714,
-0.1180185378,
-0.2335180044,
0.326643914,
-0.0169425439,
0.1533857733,
0.0291702989,
-0.1508011073,
-0.0952664688,
-0.1970419884,
0.2728227973,
-0.3071234226,
-0.1540927887,
0.2696655393,
-0.3257267177,
0.2577628195,
-0.3124789,
0.2771007717,
-0.0672111437,
-0.1610767841,
0.2538987398,
0.3399350941,
0.2657429278,
0.1425736845,
-0.1545019597,
-0.0029820155,
-0.5467546582,
0.2598887682,
-0.0741063505,
0.4347223938,
-0.0868903324,
0.1399037391,
0.0934225842,
0.2414610982,
0.7726780772,
0.202732414,
-0.5556978583,
-0.0118656326,
-0.0835212693,
-0.4828514159,
-0.1213543117,
0.0065444987,
0.1386802197,
-0.1353885382,
0.1908853352,
-0.2186717391,
-0.2697862089,
-0.0511342436,
0.2668799162,
-0.2181892991,
0.0268844943,
-0.0829346702,
-0.0512742177,
-0.0673809052,
0.0994904116,
0.2984828055,
0.1287566274,
0.0215685479,
-0.2902406752,
-0.3583567142,
0.1438712925,
0.4408703744,
-0.196293503,
0.1931110919,
0.2548775673,
-0.2116422057,
0.087754339,
0.2692281008,
0.2353905737,
-0.1807315499,
-0.168445453,
-0.0917916,
0.0657558069,
-0.0601531081,
0.4541963637,
-0.0447349995,
0.0373753831,
-0.1145980805,
-0.226980105,
-0.1090818495,
-0.3234998584,
0.2126028538,
0.2521570027,
0.3025762141,
-0.788406074,
-0.5442996025,
0.2448836863,
0.1512768865,
0.2036591172,
0.4967102706,
0.3014929593,
-0.0893104225,
0.1331835985,
0.516767025,
0.7235735655,
-0.4403666854,
0.2087449282,
0.1528611034,
-0.1352051795,
0.4863535464,
-0.4683975279,
0.27371943,
-0.3209704161,
-0.0333504081,
-0.4079744816,
-0.24025774,
0.0910375416,
0.1453147382,
0.1042107567,
0.1746627837,
-0.4771816432,
0.2962515056,
-0.0020691999,
-0.1051372439,
0.0622181334,
-0.3006750643,
0.0242572185,
0.0447034799,
-0.2382389605,
0.0619882457,
0.0513071418,
-0.049845133,
-0.0427677929,
0.2735275626,
-0.2546386123,
-0.1487122029,
-0.3635268211,
-0.024082141,
0.0802915767,
-0.9106854796,
0.3314267695,
0.6718659997,
0.6400457621,
-0.0299202297,
-0.1160826832,
-0.1233914122,
-0.0824021995,
-0.1175474003,
-0.1499609798,
0.0598964915,
0.2463069409,
0.1009033173,
0.1222561449,
0.3658828735,
0.2592411637,
-0.0899254829,
-0.0198987089,
0.0085754385,
-0.0084147882,
-0.3936411738,
-0.6244145632,
0.0060454858,
0.3228119016,
0.0891003609,
0.0279465206,
0.1268390268,
-0.1233135611,
0.2705702186,
-0.101655744,
-0.1050186232,
0.1336262375,
0.1531160772,
0.0065716505,
-0.2178822458,
0.3395915329,
0.354899615,
-0.2539771497,
-0.036724057,
-0.032797426,
0.4872440994,
-0.1175084934,
0.0898444504,
-0.1211319268,
0.1823830158,
-0.1915603727,
0.314158529,
-0.2143554688,
0.0506000184,
-0.0304672085,
-0.1168166548,
-0.1696016043,
-0.0866608545,
-0.2223853767,
0.3939134181,
0.1930727959,
0.1474799365,
0.0428568423,
-0.2638691366,
-0.1246192008,
-0.0007999237,
0.0246535558,
0.2186474353,
0.0373854451,
0.342235595,
-0.074458614,
-0.1857151985,
0.0047262735,
0.1263847947,
0.0988328382,
-0.1255889982,
-0.186020419,
0.157183066,
0.0885666907,
0.1546736062,
0.192203775,
-0.0290547553,
-0.3014988005,
-0.2998073995,
0.2054165602,
0.4749243259,
-0.082279183,
0.5092018247,
-0.039516829,
0.153643012,
-0.0376480035,
-0.0112228794,
0.2795647085,
-0.0268448405,
0.1563316286,
0.0051208194,
0.0481977947,
-0.0066691926,
-0.301235795,
0.3035325408,
0.2208904773,
-0.2415974885,
0.034743987,
-0.0162922274,
0.1615005583,
0.0111290114,
0.0818252042,
0.0272700302,
-0.0798233375,
0.3388366997,
0.2370689809,
-0.0012148442,
0.0374928303,
0.1251110584,
0.0685418323,
-0.0216489621,
-0.0595894307,
0.1306429803,
0.1558701098,
-0.1192543507,
-0.1088079438,
-0.2447169423,
0.0351109318,
-0.3608441651,
0.2779550254,
0.0782325044,
0.2904630601,
0.0649636537,
0.1931930631,
0.0119621521,
-0.0322426297,
-0.2728925943,
0.2033380419,
0.3375236094,
0.3924201727,
-0.1142240986,
0.3086024821,
-0.2124439329,
-0.2520950437,
-0.295330584,
0.0957647339,
0.3000321388,
0.0520974733,
0.4198808372,
-0.0845127329,
-0.400732547,
-0.1573779285,
0.1022641808,
-0.3023597896,
0.0060130735,
-0.2600736618,
0.1281618029,
0.290325582,
0.0516582169,
-0.0867058486,
-0.3957055509,
0.2572457194,
0.1843478978,
0.0914097726,
0.2649305761,
0.1433958411,
0.219256103,
0.0652463213,
0.0689196661,
-0.0540589616,
-0.2141499817,
-0.0996983722,
-0.0414922722,
0.2261921614,
0.2643826008,
0.2051022351,
0.1496019065,
0.1185394973,
-0.1286422163,
-0.0508817136,
0.3582122028,
0.1805956215,
0.0865356922,
-0.0661828518,
0.1045112982,
0.0872215256,
0.1204346418,
-0.0297857597,
-0.0625432953,
0.1956662536,
-0.2986262143,
-0.1839805692,
-0.3819999397,
-0.2986165583,
-0.3454686999,
-0.0250277258,
-0.1950409263,
0.0397911072,
0.3429343998,
0.0748338029,
-0.1223473474,
0.1172992438,
-0.0189203508,
0.06898617,
0.3252041936,
-0.028658852,
0.3553133905,
-0.0247251317,
-0.2297627926,
-0.1227490827,
0.0783763453,
0.3053515553,
0.2091904283,
-0.1296177804,
-0.0933267251,
0.19918257,
0.0890191868,
-0.1796436459,
-0.1754829288,
0.145262748,
0.4372386336,
-0.0852477774,
-0.1261152178,
-0.4263879657,
0.099757418,
0.016286049,
-0.0552184954,
0.0447838344,
-0.046619866,
-0.1109091938,
-0.2146396488,
0.4659699202,
-0.0741571859,
0.3106870949,
0.1252732426,
0.0046410216,
0.2990765274,
0.2199094743,
0.2212869078,
-0.0824817643,
0.1476167887,
-0.1360058635,
0.2829578519,
-0.2025214881,
0.1033231542,
-0.2090319842,
-0.3423644602,
-0.1338417828,
0.5338135362,
0.0748821571,
-0.2111458182,
-0.0729000196,
0.1870831549,
-0.1991675198,
-0.3507272601,
0.6488536596,
0.3711217642,
0.0672062933,
0.1906408519,
-0.2452261895,
0.0379549675,
0.2480578572,
-0.3406535685,
-0.1891872585,
0.0841760784,
-0.3319996893,
0.3432603478,
0.2048110813,
-0.9493132234,
-0.0206998959,
0.0416905396,
-0.2652865946,
-0.0787374228,
0.2311908305,
0.0780442208,
0.0643083304,
-0.228823632,
0.3666219711,
0.1664107889,
0.050181292,
-0.5354930758,
-0.385512799
] |
https://github.com/huggingface/datasets/issues/1762 | Unable to format dataset to CUDA Tensors | Yes the keywords arguments are passed to the convert function like `np.array`, `torch.tensor` or `tensorflow.ragged.constant`.
We don't support the kwargs for pandas on the other hand. | Hi,
I came across this [link](https://huggingface.co/docs/datasets/torch_tensorflow.html) where the docs show show to convert a dataset to a particular format. I see that there is an option to convert it to tensors, but I don't see any option to convert it to CUDA tensors.
I tried this, but Dataset doesn't support assignment:
```
columns=['input_ids', 'token_type_ids', 'attention_mask', 'start_positions','end_positions']
samples.set_format(type='torch', columns = columns)
for column in columns:
samples[column].to(torch.device(self.config.device))
```
There should be an option to do so, or if there is already a way to do this, please let me know.
Thanks,
Gunjan | 26 | Unable to format dataset to CUDA Tensors
Hi,
I came across this [link](https://huggingface.co/docs/datasets/torch_tensorflow.html) where the docs show show to convert a dataset to a particular format. I see that there is an option to convert it to tensors, but I don't see any option to convert it to CUDA tensors.
I tried this, but Dataset doesn't support assignment:
```
columns=['input_ids', 'token_type_ids', 'attention_mask', 'start_positions','end_positions']
samples.set_format(type='torch', columns = columns)
for column in columns:
samples[column].to(torch.device(self.config.device))
```
There should be an option to do so, or if there is already a way to do this, please let me know.
Thanks,
Gunjan
Yes the keywords arguments are passed to the convert function like `np.array`, `torch.tensor` or `tensorflow.ragged.constant`.
We don't support the kwargs for pandas on the other hand. | [
-0.2339966446,
-0.4713831842,
-0.0587258562,
0.1454276443,
0.5945416093,
0.3813998997,
0.5536248684,
0.3486230075,
0.0204018541,
0.0847376511,
-0.13873972,
0.3407217562,
-0.1757795662,
0.1476909369,
0.1723190397,
-0.3778468966,
0.3084686697,
-0.0880435109,
-0.0487243719,
0.0729146153,
-0.2402444333,
-0.0089957714,
-0.1322966218,
-0.2712605,
-0.1739535183,
-0.2240071893,
-0.0373400971,
-0.3639820814,
-0.1242672279,
-0.0815784559,
0.2801266313,
0.0425559022,
0.2684723735,
0.4797209799,
-0.0001250429,
-0.0380647108,
-0.0376146138,
-0.1130808741,
-0.0815804526,
-0.3308825791,
0.1433860064,
-0.3101423979,
0.3145222664,
-0.230960384,
-0.4044007361,
0.1008604169,
0.0041846409,
-0.3171215951,
0.2870208919,
0.5416357517,
0.1036706641,
0.1582942307,
0.2337692976,
0.0570035353,
-0.2884039879,
0.3508219421,
-0.3622892201,
0.0290852692,
0.1062360927,
0.0989786386,
0.2423036098,
0.1262857765,
-0.144719854,
-0.0099329194,
0.3419010043,
-0.0117046647,
-0.3300116956,
-0.3430464566,
0.0289548263,
0.1749108583,
0.5755489469,
-0.3697308302,
-0.3937684298,
0.0476248153,
0.1024227068,
-0.4620790482,
-0.2309359312,
0.6167894006,
-0.3567798138,
0.1083153486,
-0.3492470384,
0.0367214009,
-0.2219843864,
0.1147981361,
-0.2369438708,
-0.0129355118,
-0.1936633885,
-0.0190674998,
0.1113532558,
0.1237544566,
0.3501029015,
0.113402091,
0.2030451149,
0.1549073011,
-0.44869712,
-0.0980172828,
-0.548556447,
-0.1681696028,
0.1375160366,
0.0402066186,
0.1304197162,
0.0079594795,
-0.127887249,
0.0056560799,
-0.2242071927,
0.3471831679,
0.0669080243,
0.1643439978,
-0.0432010591,
-0.2695733011,
0.3038643599,
-0.0564142279,
-0.2316735983,
-0.5269576311,
-0.3164830208,
0.1881123185,
0.0535002388,
-0.0537040308,
-0.2678464949,
-0.1250570267,
-0.0247985274,
0.207338497,
-0.2367477566,
0.3064675927,
0.0266958605,
0.1756038666,
0.4172637761,
0.2402887642,
0.0884252116,
0.114711456,
0.0082563031,
0.1830561608,
-0.2545363009,
-0.1619743258,
0.0182343479,
-0.4084238112,
-0.0000097114,
0.1144775376,
-0.0146228578,
0.0369335078,
-0.1712638587,
0.1097173765,
0.480671823,
0.1500867307,
-0.055573009,
0.3168991208,
0.2587451339,
0.1715792865,
-0.1793723255,
0.1278157383,
-0.4333976507,
-0.0524578057,
-0.4958713055,
-0.0392540507,
0.1906520277,
0.0205780733,
-0.2681029737,
0.2509735525,
0.1977761239,
0.1804836839,
0.1070224345,
-0.1601636261,
-0.1691135168,
-0.3387619853,
0.4698258638,
0.0842394903,
-0.3453789055,
0.0297362525,
0.4349882603,
0.0004085407,
0.2666265368,
0.3180945516,
0.1747045666,
-0.1362378746,
-0.0582675561,
-0.3067201674,
0.5030118823,
-0.3811712265,
-0.0021105104,
-0.1177431643,
0.1807862371,
-0.2046897709,
-0.1161086261,
0.0791501328,
0.2161780596,
0.059812706,
0.1382631063,
0.2432870716,
-0.0262610577,
-0.0294420719,
-0.0116637284,
-0.0437622666,
0.5554080009,
-0.1015027314,
-0.1470305324,
0.331807971,
-0.2507638931,
-0.1131055355,
0.1760647893,
-0.0809089839,
-0.0702735484,
0.0636461899,
0.2080050111,
0.0232507065,
-0.1183816046,
0.0695904642,
-0.4207933843,
-0.0812508687,
0.3631973565,
0.1965858638,
-0.0006355626,
-0.1281881779,
-0.067100361,
0.0156984664,
0.0038451231,
-0.055603195,
-0.0155435707,
-0.3884952366,
-0.0255305115,
-0.0298722722,
-0.2764242589,
0.2545249462,
-0.2664057612,
0.1723468453,
-0.2724767923,
0.0402162299,
0.0574772954,
-0.1314871162,
0.1593993455,
0.2320959717,
0.0638309941,
-0.2490208596,
0.0484069362,
0.1410154253,
0.175293684,
-0.0210816376,
-0.4079717994,
0.2039383501,
0.2236027867,
0.0174954049,
-0.0682969987,
0.1413945258,
-0.0304878671,
-0.1648556888,
-0.409050107,
0.3824997544,
-0.02572033,
0.212033093,
-0.3623808622,
0.4157851636,
0.2095382363,
0.0852200761,
-0.037051402,
0.0753451213,
-0.0228062458,
0.0823446065,
0.1773438603,
-0.075522095,
-0.8429780602,
-0.0377741754,
0.0881043077,
0.0032723688,
0.0982849523,
0.1012565494,
-0.1349602491,
0.0992461145,
0.293107599,
-0.3925174177,
-0.1315830499,
0.0586476065,
0.1630245596,
0.0702606663,
0.0551953837,
-0.1624017209,
0.0284021236,
-0.0688167587,
-0.0366206467,
-0.1723266095,
0.1315053701,
-0.0544206984,
0.0410273559,
0.3336190581,
-0.0218045954,
0.13820301,
-0.463352114,
0.0450825691,
-0.4018613994,
-0.0179237723,
-0.3308510482,
-0.3282231987,
0.0491724685,
-0.0365943722,
-0.2419451773,
0.1314431578,
0.3399287164,
0.3103053272,
0.232282564,
0.1405815184,
0.2255206704,
-0.0986831933,
-0.2828425765,
-0.255012989,
0.1266610622,
0.0233456958,
0.3692155778,
-0.1241344959,
0.1733715087,
-0.1953943521,
0.2128215134,
-0.3078776002,
0.0772549212,
-0.13897717,
-0.1688549072,
-0.0307461154,
0.1255291849,
0.3994470835,
-0.116626516,
-0.0213173181,
0.1272455752,
0.1648907512,
0.027348686,
0.0256967321,
-0.2978482544,
-0.0583027154,
-0.1860080063,
-0.2147426456,
-0.2217249125,
-0.2360038459,
0.2539243996,
-0.0015280449,
0.1012186408,
-0.2703936994,
0.4285292923,
-0.1214859858,
0.0936644003,
-0.0723858923,
0.0945975259,
-0.4932851493,
0.6376003027,
-0.2505541146,
-0.5051740408,
0.1750524342,
0.1669685692,
0.4039466381,
0.3599305749,
-0.0157583188,
0.1210848838,
0.1616234183,
-0.0264712274,
0.0623376928,
0.0371967368,
0.236834988,
-0.0230730474,
0.1312921643,
0.1076189503,
-0.0747549906,
-0.0488991812,
0.0995978117,
0.3001364172,
0.1771584153,
0.5592432022,
0.0930161774,
0.6866158247,
0.1286580265,
-0.5674319267,
0.0107480995,
-0.2740854323,
0.3683100045,
-0.1180503145,
-0.341098994,
0.2362449169,
-0.0375309363,
0.1796844453,
0.0199724101,
-0.115637213,
-0.0244522616,
-0.1877107322,
0.1029737592,
-0.3049916029,
-0.1181727201,
0.1908493191,
-0.3305314183,
0.1651810855,
-0.3155156076,
0.3517724276,
-0.0692254603,
-0.1802681983,
0.2391379476,
0.3620738387,
0.2759839892,
0.1826495379,
-0.0466217361,
-0.0065914057,
-0.6597192883,
0.2536441386,
-0.1483207941,
0.4231064022,
-0.0879115164,
0.2414021343,
0.1323263049,
0.2363468409,
0.8280130029,
0.196852982,
-0.5567102432,
0.0190379694,
-0.1075338423,
-0.5107786059,
-0.1107199267,
0.0723911077,
0.1427488327,
-0.0774391666,
0.094102256,
-0.1357243657,
-0.2569349706,
-0.08631704,
0.3119139671,
-0.2843700945,
0.0239944831,
-0.1211042404,
-0.1073610038,
-0.102880992,
0.0914709046,
0.2308843434,
0.1489975005,
0.0312935933,
-0.2396963984,
-0.265747577,
0.0934982672,
0.4447605014,
-0.1039800122,
0.1937541366,
0.2402021736,
-0.1588637829,
0.0563892312,
0.1761803478,
0.2523502111,
-0.130062446,
-0.2216260433,
-0.1375312358,
-0.07664942,
-0.101409398,
0.4849340916,
-0.0676993877,
-0.0314502344,
-0.1294442564,
-0.2315017879,
-0.0598912016,
-0.2750644088,
0.1962395906,
0.2176710963,
0.2921276987,
-0.6761104465,
-0.5005919933,
0.3080512583,
0.1360966861,
0.2173369974,
0.5419604182,
0.3116104007,
-0.0733250305,
0.2043451071,
0.4828855097,
0.7467299104,
-0.4484691918,
0.0871144086,
0.2286560088,
-0.2027851939,
0.5286079645,
-0.4583531022,
0.2617255449,
-0.3106411099,
-0.0468289852,
-0.3594836593,
-0.1660861373,
0.1121761426,
0.1560602635,
0.030176647,
0.2758593261,
-0.4692663252,
0.1199283004,
-0.0416720025,
-0.0396450348,
0.1339378208,
-0.2912848592,
-0.0638096258,
0.052245032,
-0.1875170171,
0.1136717647,
0.0789013281,
-0.0623904988,
-0.1171059459,
0.2801489532,
-0.2094518393,
-0.0915094912,
-0.2913134098,
0.0351175107,
0.0444837883,
-0.9460864067,
0.2878392339,
0.692085743,
0.6729730964,
-0.0539447181,
-0.1622531265,
-0.0928837806,
-0.1192679778,
-0.1274365485,
-0.1747276336,
0.0548550785,
0.3042759597,
0.0911562443,
0.1132737026,
0.2836306989,
0.2406710982,
-0.0439342968,
-0.0002024275,
0.024204338,
-0.0465831235,
-0.3549318314,
-0.5426563025,
0.0033767009,
0.2708292902,
0.0374262705,
0.0289779119,
0.1265205741,
-0.0738215968,
0.2401245385,
-0.1189149842,
-0.1349516958,
0.0792444944,
0.1422633678,
-0.0135106919,
-0.2353619039,
0.311252743,
0.4385103583,
-0.2563998699,
-0.022135172,
-0.0889920741,
0.4913954735,
-0.0746981651,
0.1575952917,
-0.1627230346,
0.2984324694,
-0.1670406163,
0.2334008962,
-0.2054911107,
0.0543496348,
-0.0556943491,
-0.1090751886,
-0.2791041732,
-0.172331363,
-0.1887346655,
0.32043311,
0.2089359611,
0.1702373773,
0.0825770721,
-0.1930777282,
-0.1443174481,
0.017290378,
0.0009179925,
0.2042663246,
0.1081133485,
0.3062471151,
-0.1017630249,
-0.2382641882,
0.0002161449,
0.0964023322,
0.0771971345,
-0.1164923012,
-0.1810881346,
0.1445775032,
0.0485257395,
0.1201603338,
0.1659925729,
-0.0196213927,
-0.2690390646,
-0.3319355249,
0.2213336676,
0.5063863397,
-0.052091755,
0.5310233831,
0.0156915672,
0.1246670187,
-0.0467448272,
-0.1051017344,
0.2283626944,
0.0009693105,
0.0690019354,
0.0398610644,
0.1266221851,
-0.048246678,
-0.2575534284,
0.1838673055,
0.1103388295,
-0.2583169639,
0.1548942924,
0.0688122883,
0.1719317138,
-0.0313288979,
0.0243296791,
0.0608488023,
-0.0913805217,
0.3637609184,
0.2778078318,
0.0094634397,
-0.0219559483,
0.1275048554,
0.0253049806,
-0.0299198125,
-0.1048785597,
0.0950120464,
0.1831589639,
-0.1008543521,
-0.1703537703,
-0.2146996111,
0.1838192493,
-0.4327238798,
0.1902827471,
0.1170278341,
0.2538709641,
0.0556349196,
0.2116871327,
0.0399439596,
-0.0420729481,
-0.0849585161,
0.178319931,
0.3768411279,
0.3827631772,
-0.1203700975,
0.3099438548,
-0.1055232659,
-0.2833262682,
-0.2708874941,
0.0052582589,
0.2114013582,
0.0384193659,
0.3883088827,
-0.0909428596,
-0.3526309133,
-0.1037721634,
0.2078641057,
-0.2998800576,
0.0348778181,
-0.148034066,
0.1560296416,
0.3107508719,
0.0497479029,
-0.0431058668,
-0.4737074971,
0.1968723834,
0.1356640756,
0.0340195261,
0.3772855401,
0.0854439735,
0.2362264991,
0.0820139796,
0.009649287,
-0.2035853565,
-0.1631766707,
-0.1027632207,
-0.1156550422,
0.1711798757,
0.3749363422,
0.154298991,
0.1124269664,
0.1536955237,
-0.0506164655,
-0.0966269076,
0.3804787099,
0.2438126802,
0.0128499381,
0.0483911783,
0.0619364567,
0.0990795568,
0.1020309255,
-0.0945561975,
-0.0530296937,
0.2216545045,
-0.2926777601,
-0.1310749948,
-0.3994075656,
-0.3589652777,
-0.3850873113,
-0.0181529429,
-0.151403904,
0.1021502018,
0.3458808661,
0.0406319834,
-0.1477545947,
0.0673395991,
-0.0160405729,
0.0564908125,
0.3583319783,
0.0135492049,
0.3651580513,
-0.0624678284,
-0.2486882657,
-0.1333653331,
0.039507322,
0.2420815527,
0.1670301557,
-0.1253892481,
-0.1192724705,
0.1132577509,
0.0601060204,
-0.2492971718,
-0.1358509809,
0.1473103315,
0.4346063733,
-0.0511642694,
-0.1123147309,
-0.4668068588,
0.058228869,
0.0485131368,
0.0328893773,
0.1192576811,
-0.0798922926,
-0.1070710644,
-0.2286000848,
0.5114031434,
-0.0823110119,
0.3495625556,
0.1186045334,
0.0059266826,
0.3164977431,
0.2320824564,
0.2943647206,
-0.0598481633,
0.1566630304,
-0.0823220238,
0.3606933653,
-0.1621678174,
0.102458775,
-0.1270541251,
-0.488117069,
-0.1648626477,
0.5384292603,
0.1112362221,
-0.1752999425,
-0.0873455182,
0.2083651274,
-0.2033677697,
-0.2847557664,
0.6637993455,
0.3430197537,
0.04693776,
0.1581350267,
-0.2644056678,
-0.0194739159,
0.2774274349,
-0.3332236707,
-0.2580162287,
0.0428672582,
-0.3855659366,
0.3643035591,
0.1272259504,
-0.9844717383,
-0.0503293946,
0.0165101998,
-0.2429480851,
-0.1102327704,
0.2102179527,
0.0143804848,
0.1292787194,
-0.1888146847,
0.2801195085,
0.1004269347,
0.0505047143,
-0.501950264,
-0.3692332804
] |
https://github.com/huggingface/datasets/issues/1762 | Unable to format dataset to CUDA Tensors | Thanks @lhoestq,
Would it be okay if I added this to the docs and made a PR? | Hi,
I came across this [link](https://huggingface.co/docs/datasets/torch_tensorflow.html) where the docs show show to convert a dataset to a particular format. I see that there is an option to convert it to tensors, but I don't see any option to convert it to CUDA tensors.
I tried this, but Dataset doesn't support assignment:
```
columns=['input_ids', 'token_type_ids', 'attention_mask', 'start_positions','end_positions']
samples.set_format(type='torch', columns = columns)
for column in columns:
samples[column].to(torch.device(self.config.device))
```
There should be an option to do so, or if there is already a way to do this, please let me know.
Thanks,
Gunjan | 17 | Unable to format dataset to CUDA Tensors
Hi,
I came across this [link](https://huggingface.co/docs/datasets/torch_tensorflow.html) where the docs show show to convert a dataset to a particular format. I see that there is an option to convert it to tensors, but I don't see any option to convert it to CUDA tensors.
I tried this, but Dataset doesn't support assignment:
```
columns=['input_ids', 'token_type_ids', 'attention_mask', 'start_positions','end_positions']
samples.set_format(type='torch', columns = columns)
for column in columns:
samples[column].to(torch.device(self.config.device))
```
There should be an option to do so, or if there is already a way to do this, please let me know.
Thanks,
Gunjan
Thanks @lhoestq,
Would it be okay if I added this to the docs and made a PR? | [
-0.2076083869,
-0.4493274391,
-0.0808781311,
0.1429592818,
0.567246139,
0.3796425462,
0.5310694575,
0.3309663534,
-0.0181648768,
0.1409580857,
-0.0788681433,
0.2365305573,
-0.2230985761,
0.1325980276,
0.1703114957,
-0.3306936026,
0.2573103011,
-0.0979153141,
-0.0379617885,
0.079033643,
-0.1359184831,
-0.0128563056,
-0.1050754189,
-0.3105602264,
-0.2359380573,
-0.1902676821,
0.0561589822,
-0.3857475221,
-0.1967528462,
-0.0576163232,
0.1955189556,
0.1002450809,
0.2974624634,
0.4419077337,
-0.0001257112,
-0.0405383296,
-0.0763705298,
-0.1063871682,
-0.0802320167,
-0.2797964811,
0.1008527279,
-0.2619593441,
0.3520947695,
-0.1931513101,
-0.4167788923,
0.1588606536,
0.0376695693,
-0.3366959691,
0.2211165726,
0.520123601,
0.1055460796,
0.2019815743,
0.250479728,
0.0240185726,
-0.1411984563,
0.4127916098,
-0.4059521258,
0.05938242,
0.1868833154,
0.1419472247,
0.2361408621,
0.1956162602,
-0.1018037573,
0.0367224552,
0.2884669602,
-0.0079525122,
-0.3925339878,
-0.3323218524,
0.0225079041,
0.1464350969,
0.7426344752,
-0.3099430501,
-0.352789104,
0.1035457253,
0.0786291063,
-0.3819108605,
-0.2360117286,
0.6073790193,
-0.3357323706,
0.1058310196,
-0.3175976276,
-0.0252774302,
-0.2114553899,
0.113524884,
-0.2010385692,
-0.0210831705,
-0.2168880254,
-0.0134135708,
0.0800356641,
0.1509759128,
0.3454315364,
0.212830618,
0.2072886974,
0.1462771744,
-0.4573123753,
-0.1075192392,
-0.5549700856,
-0.1373182088,
0.1715205014,
0.0919845477,
0.1974637508,
-0.0025133078,
-0.1347370595,
0.0147336079,
-0.2574054301,
0.2582008541,
0.0727009326,
0.2164322585,
-0.0381976962,
-0.2039440423,
0.3264057338,
-0.052257169,
-0.3161254823,
-0.5621750355,
-0.3139207363,
0.2240674943,
0.0709718987,
-0.1325155646,
-0.2899288237,
-0.063058652,
-0.0203233045,
0.1519997418,
-0.1952329576,
0.3259001076,
0.0424672849,
0.1394881308,
0.4517863095,
0.193862617,
0.0105005521,
0.0338832512,
0.0050431653,
0.1696886271,
-0.3044996262,
-0.0738301426,
0.0310797002,
-0.3389306962,
-0.0471710116,
0.0743235946,
-0.0217702016,
-0.007042658,
-0.1374232769,
0.1592933238,
0.5288166404,
0.1485942006,
-0.0566932783,
0.3177835047,
0.216593042,
0.2340794206,
-0.2023090124,
0.1190706939,
-0.4427163601,
-0.1329213232,
-0.5485042334,
-0.020791566,
0.2262342572,
0.0080709318,
-0.1792022437,
0.2097904533,
0.2465564907,
0.1304867715,
0.1013706252,
-0.0826843157,
-0.1323799193,
-0.3094057441,
0.4982711077,
0.1535871774,
-0.3233243525,
0.0316362493,
0.4733218849,
-0.0435242951,
0.2070113719,
0.3417696655,
0.1974048465,
-0.0503649339,
-0.1204218566,
-0.3095734715,
0.4586008191,
-0.4009729922,
-0.0244467389,
-0.1857913435,
0.117742002,
-0.2924158275,
-0.0787743181,
0.0899524614,
0.2781097591,
0.0961892158,
0.1539411992,
0.162305966,
-0.01193118,
0.0019589621,
-0.0272790063,
-0.011946152,
0.4723084569,
-0.0996464416,
-0.1939264387,
0.3507114351,
-0.2216271013,
-0.0664068311,
0.1824703217,
-0.0920226872,
-0.0442126542,
0.0883368328,
0.260104239,
0.0278740358,
-0.1492639333,
0.0622366518,
-0.4646397531,
-0.1267795414,
0.4345223904,
0.2147192508,
0.0734809935,
-0.172520116,
-0.0275026932,
0.0007659204,
-0.0201719571,
-0.0845567435,
-0.028565852,
-0.3560158312,
-0.0588524602,
-0.116713129,
-0.2934117317,
0.2282379568,
-0.3179703951,
0.2113444358,
-0.3106458783,
0.0084488075,
0.0547570586,
-0.0987832695,
0.0593864322,
0.2388006151,
0.0139863836,
-0.2556926012,
0.0610444993,
0.0880656242,
0.1665399522,
-0.0616918765,
-0.3724158406,
0.2719941139,
0.2509320974,
-0.0638868734,
-0.1255124211,
0.0395870544,
-0.0599655397,
-0.1379622519,
-0.4441964328,
0.3333820701,
0.0095325364,
0.1833407879,
-0.3780228794,
0.3914255798,
0.1607536972,
0.1127119586,
-0.0941014066,
0.0192781128,
0.0129382964,
0.1788819879,
0.1063870564,
-0.0939073712,
-0.8347510099,
-0.0346030593,
0.0099744052,
-0.0093528638,
0.1038296744,
0.0902128667,
-0.0889419615,
0.1563894153,
0.2987085581,
-0.3835810721,
-0.1463306248,
0.0697985515,
0.1932675987,
0.0536923632,
0.0900283307,
-0.1724131852,
-0.006565046,
-0.1495099217,
-0.0629123151,
-0.1108785421,
0.1053052396,
-0.0268623624,
0.0198157094,
0.3037306368,
-0.0329219848,
0.1207721829,
-0.5268213749,
-0.0821065009,
-0.3464765847,
0.0970353186,
-0.3644326925,
-0.3428703249,
0.0165928546,
0.0103522222,
-0.1444886178,
0.1534785628,
0.3193196058,
0.2531529665,
0.2624109387,
0.1782205254,
0.1932380199,
-0.0999086276,
-0.159899503,
-0.2299981117,
0.181582883,
0.0119406525,
0.3474970758,
-0.156092003,
0.2044473886,
-0.3022923172,
0.1655819267,
-0.3841089606,
0.0206678621,
-0.0932871476,
-0.1044853181,
-0.1126241982,
0.1318238825,
0.4242875576,
-0.0067454027,
0.0133426925,
0.1077391505,
0.1408374459,
-0.0286891796,
-0.02826293,
-0.3399510682,
-0.0449548438,
-0.2176357806,
-0.2819055021,
-0.1910871416,
-0.2567908466,
0.2568635046,
-0.0152868992,
0.1554702222,
-0.3396692872,
0.3959319293,
-0.1299620867,
0.0046283142,
-0.0234762207,
0.02885033,
-0.5347703099,
0.6057140827,
-0.292480737,
-0.5323601365,
0.1957690269,
0.1842218786,
0.3844263554,
0.392991215,
0.0005281479,
0.1903713346,
0.1710220128,
-0.0711642578,
0.0433814786,
0.0737033039,
0.3059943616,
-0.014076571,
0.1499236673,
0.1225321144,
-0.1269412935,
-0.0466789342,
0.0888376981,
0.2946559191,
0.1153135374,
0.4837459624,
0.0614366755,
0.6757723689,
0.0886687264,
-0.5966692567,
0.0748069659,
-0.2757520378,
0.3746648133,
-0.1389728189,
-0.2873618603,
0.2956434786,
-0.0318160355,
0.1092246249,
0.0229960829,
-0.1211835518,
0.039765887,
-0.14700903,
0.228189379,
-0.3481969237,
-0.1224867776,
0.2093815506,
-0.3385238647,
0.1809760481,
-0.3129070699,
0.3045589924,
-0.0584181361,
-0.15167512,
0.1967681199,
0.3891715705,
0.3139396608,
0.1189286113,
-0.1016837656,
0.0703645274,
-0.6821165085,
0.2481827438,
-0.1574200094,
0.3805263638,
-0.1512129903,
0.2029241174,
0.1421328634,
0.2285235226,
0.787183702,
0.1639452875,
-0.5181643963,
-0.0609190241,
-0.0635139048,
-0.4389622211,
-0.1175815761,
0.0592318103,
0.1737294346,
-0.1141629368,
0.156843558,
-0.1653037071,
-0.2418538779,
-0.0125083951,
0.2245450318,
-0.2485741228,
0.0428933017,
-0.1151408702,
-0.0653065816,
-0.1427766085,
0.1266494393,
0.3015600741,
0.1439419538,
0.0740273073,
-0.278203249,
-0.2106910497,
0.1488361061,
0.4324989319,
-0.1354565322,
0.1918823272,
0.2367682755,
-0.1541232616,
0.1587654054,
0.2291406244,
0.2965295017,
-0.0599351078,
-0.207841441,
-0.1069344804,
0.0463183224,
-0.0780025572,
0.4774353802,
-0.0192233864,
0.086326845,
-0.1339593828,
-0.196445331,
-0.0529191047,
-0.3171694875,
0.2225006968,
0.2268723547,
0.3045935929,
-0.7227422595,
-0.4659355581,
0.2787936926,
0.1624547988,
0.2051005512,
0.5931316018,
0.3560984731,
-0.0579250529,
0.1473769844,
0.532117784,
0.7870175242,
-0.4854317605,
0.1115229651,
0.169010669,
-0.2026638389,
0.4901741445,
-0.5520542264,
0.214034766,
-0.3513668776,
-0.0185121577,
-0.3378237784,
-0.200426802,
0.1204777583,
0.1363216937,
0.0724511072,
0.2074891627,
-0.4844920337,
0.2136547863,
-0.0438518971,
-0.0662567466,
0.1448488533,
-0.3037320673,
0.0800592974,
0.0359202698,
-0.222434938,
0.1497514844,
0.007113493,
0.0018467695,
-0.0907901004,
0.2409531325,
-0.2458493114,
-0.1143793389,
-0.3347643912,
-0.0400818773,
0.0403621271,
-0.8884336352,
0.3341016471,
0.6728860736,
0.6103251576,
-0.0293980427,
-0.1831835359,
-0.0758503303,
-0.1074198782,
-0.147621125,
-0.2166456282,
0.0443933643,
0.233973667,
0.0690469816,
0.055142086,
0.2488982826,
0.2439637184,
-0.0811579078,
-0.0194428265,
0.0190797616,
0.0443793088,
-0.4064263999,
-0.5095792413,
0.0706914663,
0.2918234169,
0.0428248085,
0.0334734246,
0.1449056119,
-0.1694500148,
0.1561664343,
-0.0355581939,
-0.1128102466,
0.0877245218,
0.2027309239,
-0.046067737,
-0.2352349013,
0.255271256,
0.4344183207,
-0.2322798669,
-0.0719460621,
-0.0610613227,
0.6061148047,
-0.1389587522,
0.0365317315,
-0.1724817604,
0.1928210258,
-0.1596535146,
0.2387517542,
-0.1975669414,
0.0277720187,
0.0053687715,
-0.0947653204,
-0.2900636196,
-0.1597345769,
-0.2699219882,
0.3686086833,
0.1735460907,
0.1552819759,
0.0558238998,
-0.2245474607,
-0.1342835724,
0.063272953,
0.0518477522,
0.220160991,
0.1218951643,
0.2995174229,
-0.0751095861,
-0.262898922,
-0.0003998541,
0.1126527563,
0.066086106,
-0.1165143028,
-0.1565998346,
0.1453290433,
0.0634854063,
0.1447237283,
0.1579529196,
0.0045556319,
-0.2916792333,
-0.3206231892,
0.261051476,
0.5018330812,
-0.0261959061,
0.5026633739,
0.0075255702,
0.0791920796,
-0.0773142427,
-0.0966020301,
0.29399243,
0.0002711947,
0.0600577928,
0.0017513983,
0.0430058613,
-0.0644945204,
-0.2975945175,
0.2500184774,
0.210089162,
-0.2192619592,
0.075701572,
0.0438812934,
0.2049108595,
-0.0795015767,
0.1120114475,
-0.0127640162,
-0.075376682,
0.3390369415,
0.2564385235,
0.0205130186,
0.0415291376,
0.1302809864,
0.0348271057,
-0.0434778668,
-0.1071996242,
0.0841319636,
0.1625442505,
-0.023662366,
-0.1965321004,
-0.2139081955,
0.088165015,
-0.3737872541,
0.2155652046,
0.0374123491,
0.2139493227,
0.0640224069,
0.2510872185,
0.0048767547,
-0.0291457921,
-0.1208119988,
0.1924335212,
0.4192005396,
0.3636756837,
-0.0985710993,
0.2845049202,
-0.1430582404,
-0.2455262095,
-0.3108022511,
0.150447309,
0.2094429135,
-0.0165160131,
0.374138087,
-0.0452176817,
-0.402001977,
-0.1395905912,
0.1565154195,
-0.3509290218,
0.0147744073,
-0.1718000174,
0.1291992217,
0.3239370286,
0.0625626594,
-0.066717349,
-0.4656115174,
0.2416135073,
0.1107539013,
0.0372458063,
0.2784292996,
0.1098633409,
0.2368881106,
0.0604938157,
0.0329405852,
-0.0933828875,
-0.279263109,
-0.0987307206,
-0.0773724839,
0.2119201124,
0.3134059608,
0.1710141152,
0.195171684,
0.172524929,
-0.1121424809,
-0.0668846294,
0.3330704272,
0.2009200007,
0.0205649696,
-0.0387236997,
0.0629110783,
0.0913385376,
0.0867864415,
-0.0760747865,
-0.0480678715,
0.2358457297,
-0.2489835322,
-0.2699626684,
-0.3898547888,
-0.375875771,
-0.3808152378,
-0.0015238931,
-0.1787271947,
0.100325942,
0.3658070564,
0.0336301401,
-0.1460152715,
0.0823106021,
-0.021311244,
0.0583302453,
0.3585035801,
-0.0015693437,
0.338372916,
-0.0702759549,
-0.292306602,
-0.1447416842,
0.1255771369,
0.2702937126,
0.1637939215,
-0.106275022,
-0.0835557282,
0.1526224464,
0.0980311185,
-0.1812797189,
-0.2074801177,
0.1495787501,
0.4486218691,
-0.0912015513,
-0.0646636635,
-0.4672200084,
0.0905516446,
0.0718427077,
0.0319593288,
0.0767272338,
-0.0218784232,
-0.1141313836,
-0.2506000102,
0.5121709704,
-0.1104846746,
0.3139120638,
0.1758179814,
-0.0079047428,
0.3140556812,
0.1937717646,
0.2147172689,
-0.0985922515,
0.1259610206,
-0.0971217528,
0.3895473778,
-0.1474763602,
0.0831447244,
-0.1647632271,
-0.3862556815,
-0.1834248602,
0.5290040374,
0.1201300323,
-0.1372963935,
-0.1372115463,
0.227336973,
-0.132464692,
-0.2655062079,
0.6308996677,
0.3584333062,
0.0822623521,
0.182230249,
-0.3089642525,
-0.0003804044,
0.3028072715,
-0.2566518486,
-0.1460651904,
0.1207098439,
-0.2959150672,
0.4274279773,
0.0967220888,
-1.0665235519,
-0.0314473324,
-0.0032906909,
-0.3078852892,
-0.1359235346,
0.2489355206,
0.0394868255,
0.1263049245,
-0.1835101247,
0.3833092451,
0.1133232266,
0.0715672299,
-0.4916666448,
-0.3911877573
] |
https://github.com/huggingface/datasets/issues/1759 | wikipedia dataset incomplete | Hi !
From what pickle file fo you get this ?
I guess you mean the dataset loaded using `load_dataset` ? | Hey guys,
I am using the https://github.com/huggingface/datasets/tree/master/datasets/wikipedia dataset.
Unfortunately, I found out that there is an incompleteness for the German dataset.
For reasons unknown to me, the number of inhabitants has been removed from many pages:
Thorey-sur-Ouche has 128 inhabitants according to the webpage (https://de.wikipedia.org/wiki/Thorey-sur-Ouche).
The pickle file however shows: franzΓΆsische Gemeinde mit Einwohnern (Stand).
Is it possible to fix this?
Best regards
Chris
| 21 | wikipedia dataset incomplete
Hey guys,
I am using the https://github.com/huggingface/datasets/tree/master/datasets/wikipedia dataset.
Unfortunately, I found out that there is an incompleteness for the German dataset.
For reasons unknown to me, the number of inhabitants has been removed from many pages:
Thorey-sur-Ouche has 128 inhabitants according to the webpage (https://de.wikipedia.org/wiki/Thorey-sur-Ouche).
The pickle file however shows: franzΓΆsische Gemeinde mit Einwohnern (Stand).
Is it possible to fix this?
Best regards
Chris
Hi !
From what pickle file fo you get this ?
I guess you mean the dataset loaded using `load_dataset` ? | [
0.1241123378,
0.0906562135,
-0.0648523346,
0.4390088022,
-0.1451848894,
0.1351811439,
0.1400449425,
-0.0993285626,
0.3315920532,
0.1742717028,
0.1878571659,
-0.0555861592,
0.3833339512,
-0.3714289665,
0.0213763453,
-0.2188197523,
0.1357133538,
0.1867663413,
-0.353669554,
-0.2992883921,
-0.1205293462,
0.4303142428,
-0.2972927988,
-0.3738277555,
0.004158847,
0.1912924498,
0.0423988365,
-0.026565399,
-0.0398972593,
-0.2545051575,
0.0718953013,
-0.1289303452,
0.0232159887,
0.2944533229,
-0.0001212063,
-0.2076830268,
0.1829905808,
0.0327177085,
-0.5496044755,
-0.0704218,
-0.3186747432,
-0.3378354907,
-0.0553491563,
-0.3048529923,
0.335639745,
0.1256951243,
0.2353797704,
0.0285399891,
-0.0430290252,
-0.1988060474,
0.1099370643,
-0.3088946044,
0.1718199104,
0.0193356816,
0.3870482147,
0.5492721796,
0.129969269,
0.4180329442,
-0.0086954199,
-0.1311779022,
0.0025487279,
0.5580917001,
0.1151677743,
-0.0844881162,
0.1515882313,
-0.0853332207,
0.0486634523,
-0.3207390308,
0.4474428594,
0.4326770306,
0.7783443928,
0.0387788303,
-0.2873816788,
-0.2301686704,
-0.0255639367,
0.0607126616,
0.4423190355,
0.0954177305,
-0.0011091613,
0.0861818418,
0.0174798761,
-0.3801378608,
0.0836793929,
0.2865540385,
-0.2406738549,
0.6932727695,
-0.0522081591,
0.1574095488,
-0.1112745777,
0.0383663587,
-0.5061635971,
-0.1751051694,
-0.1195128188,
0.6439188123,
-0.0120002143,
0.1531446874,
0.1128863096,
0.0546699613,
0.3744638562,
-0.1240143105,
-0.3182376623,
-0.1055599153,
-0.4076493979,
0.0868474022,
0.4266243577,
-0.0020247337,
0.3739511073,
-0.2473473996,
0.248518005,
0.0315781385,
0.0509771705,
0.253721118,
0.1115051284,
-0.2443266213,
-0.074232921,
-0.0230275467,
0.0975890458,
-0.2007693797,
0.0104228361,
0.4637051821,
-0.220674172,
-0.2525125742,
-0.1857875586,
0.022953894,
-0.1924724579,
0.3144139647,
0.0461674258,
-0.0150528662,
-0.3274428248,
-0.3958060443,
0.0411141366,
0.0460368916,
-0.0717362538,
-0.1020290703,
-0.1323872358,
-0.2279978096,
0.3639762402,
0.0687114373,
-0.0924397781,
-0.1216054708,
0.0250200666,
-0.3007547557,
0.0401270688,
0.1244296655,
0.2084526569,
0.2604511678,
-0.1159794554,
-0.6150659323,
0.018996615,
0.0594440848,
-0.3399090469,
-0.1113064438,
-0.714304924,
0.1314145029,
-0.1911711097,
-0.0315865092,
-0.2961344719,
0.1198504195,
0.2013315111,
-0.4083997607,
0.116767332,
0.0557350777,
-0.1401758492,
-0.0329449922,
0.3443152905,
0.578354001,
-0.1809434742,
-0.2524649501,
-0.2087495476,
0.0897935778,
0.3532004058,
0.4228058755,
-0.0118459594,
0.3736519516,
-0.175129354,
0.1606288999,
0.0374032669,
0.0762985796,
-0.449375391,
0.0295910873,
0.1274162382,
0.0128369331,
-0.3067495525,
0.0343673676,
0.0258888807,
0.3042880595,
0.0671056956,
0.1469596177,
0.3602668643,
-0.0720260665,
-0.3002054393,
-0.1694296151,
0.5182991028,
-0.0393483192,
0.1673230231,
0.0278055724,
0.2274995595,
0.1395629644,
0.6033779979,
0.1070421785,
0.3978747427,
0.7896962762,
0.0262639895,
0.2337702513,
0.2118060887,
-0.0106211072,
-0.2573166788,
-0.0086754169,
-0.0164199267,
0.3641387224,
0.1543468833,
-0.0990671217,
-0.1662695706,
-0.013634312,
0.0195923075,
-0.1372881234,
0.0141812544,
0.1456440687,
-0.0317265615,
0.0626529828,
0.1838211268,
-0.3371163309,
-0.2549681067,
-0.0783704594,
-0.6629975438,
0.3918356001,
-0.1417581886,
0.099244006,
-0.3523253202,
0.1621438265,
-0.0117896115,
-0.1420514882,
-0.1318245232,
0.007983407,
0.3144645989,
-0.0784610659,
0.4909603,
0.0006878949,
0.1212995574,
-0.3434092999,
-0.0658254549,
0.1046493351,
0.0298576429,
0.0752249509,
-0.6009052396,
-0.1981950551,
0.2485597879,
0.2267449051,
-0.2269639969,
0.2283162624,
0.5967851877,
0.1458377242,
0.0836338401,
-0.4401924908,
0.386523813,
0.2097623795,
0.1051053479,
0.0693036094,
-0.2616159916,
0.0292553157,
-0.0195678119,
0.1131460443,
0.3585662246,
0.3546279669,
-0.29358688,
-0.3039521575,
0.2648385763,
-0.2347453982,
-0.1661776751,
0.1754750162,
0.3176705241,
-0.1919919699,
0.3871269226,
0.0223830268,
0.1180271506,
0.2003118992,
0.1394441277,
0.1772620678,
0.152594462,
0.1820430607,
-0.3302624226,
-0.1329106241,
-0.0710379779,
0.3756259382,
-0.0305541269,
-0.0649509281,
-0.0540686958,
-0.011312345,
0.0340104699,
0.0396415144,
-0.8664522767,
-0.1790497452,
0.0303657651,
-0.0061966507,
-0.1516413689,
0.216419071,
-0.0783864558,
-0.125205934,
-0.2134806216,
0.1640908718,
-0.1619289219,
-0.1873650551,
-0.2594037652,
-0.0083930148,
0.00209335,
-0.0685688704,
0.1145579964,
-0.4670064747,
-0.4988546669,
-0.6564523578,
-0.3859998584,
0.2722924054,
0.0006183523,
0.0336337164,
0.1947733611,
0.4568447471,
-0.4254086316,
0.1016555056,
0.131040588,
-0.0450764969,
0.0273405649,
0.0357403122,
-0.2880315185,
0.0095885722,
-0.071097374,
-0.1275347024,
-0.2320473343,
0.0671185106,
0.1465855241,
0.3558943272,
0.2403898388,
0.3179811537,
0.0428697132,
-0.2407633066,
-0.0785086378,
-0.1428986341,
-0.3738856912,
-0.4261965156,
0.089301005,
-0.2573983669,
-0.2928770185,
0.0356933661,
-0.0971709192,
-0.0374456756,
-0.1153732166,
-0.5714579225,
0.0845571533,
-0.1595597863,
0.1899252385,
-0.3796051741,
0.1761976331,
0.4080471694,
-0.0137710962,
0.1159530953,
-0.0897344127,
-0.1603075415,
-0.0024277717,
0.309569478,
0.625623703,
-0.1449141204,
0.1137356982,
0.0443242602,
0.6312342882,
0.4565296471,
0.4432752728,
0.1186549664,
0.0140658775,
0.2230181247,
-0.1847379357,
-0.0118874535,
0.1425246894,
-0.0815662667,
-0.0956152454,
0.4853447974,
0.1688071936,
0.0298477616,
-0.0498668514,
-0.1189438775,
-0.5683522224,
-0.1573638022,
0.1096544415,
0.2222975641,
0.4297433197,
0.0724689364,
0.0042682658,
-0.4546712637,
-0.3010436296,
-0.0173498672,
0.0997501314,
0.4043807089,
0.2055343091,
-0.2559732795,
-0.0552054457,
-0.3435915411,
0.2963939905,
0.1967508197,
-0.1161653996,
-0.0431458578,
0.2480864823,
0.1920322478,
0.0599629804,
0.2783233821,
-0.3235585392,
0.3307549357,
0.0630650967,
0.3061444163,
-0.1952380836,
0.124337405,
-0.0076757483,
0.0780839771,
0.3835103512,
-0.145899564,
-0.3941356242,
0.0068216566,
0.1317757517,
0.3869903386,
-0.4159856141,
-0.1628047675,
-0.1502659321,
-0.0955923647,
-0.0743830353,
-0.2400770038,
0.1050747037,
0.1407226175,
0.4571061432,
0.2124798298,
0.2755676806,
0.3150885105,
-0.0278871171,
0.1234167516,
0.3730915487,
0.5226806402,
-0.1958730966,
0.0950234234,
0.1847804338,
0.230608955,
0.6488135457,
-0.0811298341,
-0.204132542,
0.2236938924,
-0.2276502848,
0.2851320803,
0.0481974147,
0.1541278809,
0.1433591694,
0.3147251606,
0.0176209584,
-0.2084539533,
-0.001911398,
0.0730572715,
0.2191824019,
-0.1945893764,
-0.2165084928,
0.4007441103,
-0.1713005006,
-0.2189118415,
0.1593727469,
0.3846006989,
-0.2809464335,
0.2617731094,
0.1700270027,
1.099468112,
0.3411225677,
0.0965651944,
-0.049511876,
0.0070654033,
0.3117258847,
-0.1347501278,
0.1021700501,
-0.3982688487,
0.1721237004,
0.0311944,
0.1471393704,
-0.0875840113,
0.1679607332,
-0.0116097918,
0.0379861444,
-0.3027435541,
0.1452645063,
-0.1494726986,
0.5097945333,
0.2185718417,
-0.0646298304,
0.0943343043,
0.0636622682,
-0.0737539008,
0.5269138217,
-0.3921823502,
0.1309327036,
-0.0216828771,
-0.0639730617,
-0.462346226,
-0.1099234596,
0.1634229124,
0.2898719311,
0.0740603656,
-0.3698223531,
0.0629415587,
0.3448389471,
-0.0424827524,
0.2795943916,
-0.1665314734,
0.2678976953,
-0.122532025,
0.0890750214,
0.2536833584,
0.2560853064,
-0.0957193598,
-0.1574681997,
-0.28874138,
0.0607151873,
-0.2990493476,
-0.1858643144,
-0.2878057659,
-0.2203773856,
-0.2034486979,
-0.2111726999,
0.2374620289,
0.0578253195,
0.032700967,
-0.2778075337,
0.0405840725,
0.3265537918,
-0.0773852393,
-0.0328525044,
0.0400158428,
-0.2750094533,
-0.0557422601,
0.2483492643,
0.0966592878,
0.0433192365,
0.5435919166,
0.3383607566,
-0.2557899058,
-0.0880203769,
0.042348396,
-0.2499468923,
-0.3204172254,
-0.1307281554,
-0.1373304129,
0.3106865287,
-0.5650639534,
0.0534808822,
0.2527607679,
-0.0783644393,
-0.2076031715,
-0.4911598265,
-0.2866075337,
0.1836095005,
0.0466200709,
-0.0691139624,
0.098691076,
-0.3289675415,
0.1177264675,
0.1879463643,
-0.2075762153,
-0.214439705,
-0.1628057659,
0.2485564798,
0.080027774,
0.0706922933,
-0.2035686076,
-0.1712410599,
0.0082641449,
-0.4229910374,
0.209029451,
-0.1092145741,
0.0070717731,
0.2164008915,
0.0040406506,
-0.2575331032,
0.1536418945,
-0.1462587565,
0.0072742854,
-0.2359383702,
-0.1799971759,
0.0627088249,
0.1607578248,
0.3790538311,
-0.0113617815,
0.2351303548,
-0.3436380923,
0.2361387312,
0.208863318,
0.1010831371,
0.0122878011,
0.2078625709,
0.4228380919,
-0.0371353403,
-0.0647034496,
0.0304244496,
-0.087531738,
-0.0714623034,
0.0140392324,
-0.2621012926,
0.4172371328,
0.4105348885,
0.1569611579,
0.0194439739,
-0.1367607564,
0.1276402473,
0.1322265416,
0.19447124,
-0.5206781626,
-0.0753169805,
0.3623283207,
0.1386779249,
-0.0603635795,
0.0273071323,
-0.0727724582,
-0.0995895565,
0.0091201365,
0.0946716294,
-0.0029426361,
-0.0711896494,
0.044344496,
0.2746730745,
-0.0135109406,
0.1159088016,
-0.2780140042,
0.2060649246,
0.0291395392,
0.2886101604,
0.2312504798,
-0.0053353733,
-0.0740167797,
-0.0161953438,
0.0289749466,
-0.1542556882,
0.2203481197,
0.2141866386,
-0.0943240449,
0.1877344549,
0.2088026702,
-0.0468164347,
0.1082426831,
-0.0126320319,
-0.3118575811,
0.1510063708,
-0.1738506556,
-0.0970465988,
-0.5045149922,
-0.1496816278,
0.1221643537,
-0.0212418754,
-0.0276512709,
-0.3495686054,
0.0585048683,
0.1448530704,
-0.3765430748,
-0.5085454583,
0.0045266692,
0.1714473665,
0.2790910006,
-0.2493132502,
0.0415736809,
0.1924791783,
-0.1547216028,
-0.2463206798,
0.5353742838,
0.221872732,
-0.0933484808,
-0.0847053081,
-0.0881296247,
0.0008307952,
-0.0353853889,
-0.219194591,
0.1410605013,
0.0154905543,
-0.210436359,
0.0953914896,
0.0374168344,
-0.1108055934,
-0.0878581554,
0.2928646207,
0.1717209667,
0.0481255949,
-0.3466183245,
-0.1448610723,
-0.2381437868,
-0.1054682434,
-0.0719590783,
0.0435565859,
-0.0610153638,
0.3149774373,
0.3373504877,
0.0707161948,
-0.1007740274,
0.023752097,
-0.0149041032,
0.1300120801,
0.2392904758,
0.0557317026,
-0.089216657,
-0.4169372916,
-0.4850447476,
0.2806759775,
-0.4443152547,
-0.4358863235,
0.1570366472,
0.1774456203,
0.0588552803,
0.1095638573,
0.1656244546,
0.3773579597,
-0.2004367858,
0.5021964908,
-0.1642213762,
-0.0699218363,
0.0462781042,
0.1959471852,
-0.1062895581,
-0.2104583234,
0.3261580467,
0.2263187915,
-0.1130206883,
-0.2087389827,
0.0149735967,
0.0139919631,
0.3081994951,
0.2971161604,
0.2244357616,
0.2409467101,
-0.3251005113,
-0.219353199,
-0.0829476491,
-0.293271929,
-0.0631550401,
0.7308730483,
0.0041924105,
0.0557398163,
-0.1740664542,
-0.1332310885,
0.052239757,
0.3003106713,
0.1083898172,
0.1931817234,
-0.577288866,
-0.0473175235,
0.0324312635,
0.1926532686,
0.0499003492,
-0.0750656798,
0.1249438748,
-0.2492324114,
-0.4154956043,
-0.2398275435,
0.0237053987,
-0.4101731777,
-0.2318983674,
-0.6320624352,
0.0406713001,
0.0872414112,
-0.3288664222,
-0.2046056837,
-0.1694366634,
0.4141498208,
0.1858736128,
-0.0287332311,
-0.369137764,
-0.1478296369,
0.0498785563,
-0.1312879175,
0.3941731155,
0.0958983898,
-0.4242753088,
0.0694527626,
-0.2967582345
] |
https://github.com/huggingface/datasets/issues/1759 | wikipedia dataset incomplete | yes sorry, I used the `load_dataset`function and saved the data to a pickle file so I don't always have to reload it and are able to work offline. | Hey guys,
I am using the https://github.com/huggingface/datasets/tree/master/datasets/wikipedia dataset.
Unfortunately, I found out that there is an incompleteness for the German dataset.
For reasons unknown to me, the number of inhabitants has been removed from many pages:
Thorey-sur-Ouche has 128 inhabitants according to the webpage (https://de.wikipedia.org/wiki/Thorey-sur-Ouche).
The pickle file however shows: franzΓΆsische Gemeinde mit Einwohnern (Stand).
Is it possible to fix this?
Best regards
Chris
| 28 | wikipedia dataset incomplete
Hey guys,
I am using the https://github.com/huggingface/datasets/tree/master/datasets/wikipedia dataset.
Unfortunately, I found out that there is an incompleteness for the German dataset.
For reasons unknown to me, the number of inhabitants has been removed from many pages:
Thorey-sur-Ouche has 128 inhabitants according to the webpage (https://de.wikipedia.org/wiki/Thorey-sur-Ouche).
The pickle file however shows: franzΓΆsische Gemeinde mit Einwohnern (Stand).
Is it possible to fix this?
Best regards
Chris
yes sorry, I used the `load_dataset`function and saved the data to a pickle file so I don't always have to reload it and are able to work offline. | [
0.0643154606,
0.0894950107,
-0.0597211011,
0.4419094324,
-0.1323367804,
0.1083994061,
0.1577169299,
-0.1221324801,
0.2750076056,
0.1589433104,
0.173834309,
-0.1358432323,
0.4038768113,
-0.4070718288,
0.0144942477,
-0.2074820846,
0.1505153775,
0.1527746618,
-0.3166954219,
-0.302136004,
-0.1133537218,
0.4350939095,
-0.3123500645,
-0.3774805963,
0.0437860079,
0.2163711935,
0.0335687548,
-0.0815828368,
-0.0119254636,
-0.2183102518,
0.0533050299,
-0.1486276239,
0.0443647131,
0.2822429836,
-0.0001218747,
-0.2125065625,
0.1440677047,
0.0306984819,
-0.5327082276,
-0.0756022483,
-0.320605725,
-0.3069420755,
-0.0897943154,
-0.3360281289,
0.3274798691,
0.1198891252,
0.2581579089,
0.0344282053,
-0.0294544827,
-0.1684189737,
0.110597156,
-0.3508933783,
0.1684127152,
0.0006385617,
0.3564842939,
0.5651244521,
0.1221899837,
0.3544336259,
-0.0117503442,
-0.1791209728,
0.0342152715,
0.5692539215,
0.0489686765,
-0.083135739,
0.1574835181,
-0.0839777887,
0.0501946062,
-0.3444972634,
0.5438238382,
0.4237298369,
0.7482108474,
0.0076446692,
-0.2656745017,
-0.2140217572,
-0.0473107137,
0.0873437524,
0.4619981647,
0.1152034998,
-0.0019733086,
0.1031652316,
-0.0077711917,
-0.3689867854,
0.0687637702,
0.3272418082,
-0.3060219586,
0.6822794676,
-0.086140506,
0.142123431,
-0.1508948058,
0.0387474224,
-0.4797347784,
-0.2150190026,
-0.1107822806,
0.6301548481,
-0.011760599,
0.1536503434,
0.1211951375,
0.0564346574,
0.3472963572,
-0.1567852199,
-0.3279044926,
-0.1055677533,
-0.3150286376,
0.0851416513,
0.439557761,
0.0223503411,
0.3921343088,
-0.2581220269,
0.2694421113,
0.0293089543,
0.0256404877,
0.2339449674,
0.104544349,
-0.2102550119,
-0.0032204031,
-0.0132923527,
0.1446971297,
-0.2322027534,
0.0543961897,
0.4595735371,
-0.2129660696,
-0.2590145469,
-0.1943204701,
0.0714291558,
-0.1848260611,
0.3223715425,
0.048869621,
0.0114345411,
-0.3538568616,
-0.381011188,
0.0648378357,
0.0386600271,
-0.0400859378,
-0.0960808247,
-0.1224542558,
-0.1822862029,
0.295270592,
0.0197276808,
-0.0703629702,
-0.1389851719,
0.0344720259,
-0.3196364045,
0.0993150622,
0.1180769503,
0.2433473617,
0.2680313289,
-0.1300935745,
-0.624984026,
0.0362713933,
0.0963545367,
-0.2753036916,
-0.135343045,
-0.7036634088,
0.1318922937,
-0.2303447723,
-0.017563602,
-0.2686010003,
0.154235661,
0.2390293032,
-0.3774129748,
0.119495064,
0.070510678,
-0.1370929331,
-0.0309501868,
0.3859170675,
0.5811338425,
-0.1503597349,
-0.2410181314,
-0.1784708351,
0.0995241627,
0.3083508611,
0.3931100667,
-0.0097177075,
0.3673388064,
-0.1232054755,
0.0689337552,
0.0478424095,
0.1104080006,
-0.4387207329,
0.0502611771,
0.1064191237,
-0.0024919098,
-0.326364696,
0.060717795,
0.0681006834,
0.3225801885,
0.0500688329,
0.1457122713,
0.3562042713,
-0.0380587727,
-0.3022037148,
-0.1661611944,
0.506703496,
-0.0243810732,
0.2399938405,
0.0606650487,
0.2152318358,
0.1761259139,
0.5853971839,
0.0900949836,
0.4497522414,
0.8086162806,
0.0410140753,
0.259958595,
0.2317346334,
-0.0186159723,
-0.2249162644,
-0.0196687579,
0.0085129375,
0.3689701855,
0.153593719,
-0.1252013445,
-0.1137938574,
-0.0342599638,
0.0428101048,
-0.1327241808,
0.0137878461,
0.1244755387,
0.0139549384,
0.103322804,
0.1956516802,
-0.3357091546,
-0.187132284,
-0.1004584134,
-0.62842381,
0.4010466933,
-0.1259019375,
0.1213174313,
-0.3517935872,
0.1536546201,
-0.0062450818,
-0.0991639793,
-0.1660704762,
0.0231197923,
0.244348526,
-0.0934231207,
0.4642225802,
0.0366496854,
0.1356393993,
-0.32894364,
-0.0140463226,
0.095228456,
0.0065339236,
0.1135988683,
-0.6195915341,
-0.2180342823,
0.3033245504,
0.2615132332,
-0.2023948133,
0.2310918123,
0.6155298352,
0.1041674465,
0.118588455,
-0.4379399419,
0.3753537238,
0.178649649,
0.0308937617,
0.0456810072,
-0.2653457224,
0.0838878602,
-0.0787141994,
0.1410298496,
0.3548551202,
0.327673614,
-0.3154001832,
-0.2769110501,
0.2495280355,
-0.2054149359,
-0.1864509881,
0.1718003005,
0.2963223755,
-0.1858100742,
0.4059667289,
0.0281813964,
0.1268700361,
0.2485370785,
0.1192483231,
0.1118604913,
0.180456385,
0.1863764077,
-0.3563385904,
-0.1338768303,
-0.0549653731,
0.3730305731,
-0.0320131034,
-0.0760621727,
-0.0214121006,
-0.0800322145,
0.0657877773,
0.0811089724,
-0.8917041421,
-0.1627468616,
0.0567931272,
-0.0055604819,
-0.1735199988,
0.2210016102,
-0.0586626455,
-0.1721408516,
-0.2347707152,
0.1137969121,
-0.1291857362,
-0.2169314176,
-0.2443748415,
-0.0020233402,
-0.0328178741,
-0.0597377308,
0.1563057154,
-0.4442383051,
-0.4988529682,
-0.6673246622,
-0.3995532691,
0.249388203,
0.0330018215,
-0.0058587259,
0.1518761814,
0.4192476273,
-0.4625675678,
0.1145005822,
0.1680909842,
-0.0909885392,
0.079301849,
0.0523317531,
-0.278863132,
-0.0128772585,
-0.1035126746,
-0.1117373779,
-0.2085937709,
0.0770719126,
0.151525259,
0.3591690063,
0.2418565005,
0.2694680691,
0.0467884354,
-0.2720734775,
-0.1089182645,
-0.1376689672,
-0.3673327565,
-0.4052073061,
0.102306582,
-0.2623263299,
-0.3153403699,
0.0601709522,
-0.0712211281,
-0.0488249436,
-0.060137786,
-0.6084823608,
0.0356833376,
-0.1298266202,
0.1229627803,
-0.3658173978,
0.1698870957,
0.3927967548,
-0.033941336,
0.1076797321,
-0.067357786,
-0.1049568579,
0.0132313184,
0.3028678894,
0.5987234116,
-0.1778347343,
0.1194869652,
0.0519920103,
0.5267828703,
0.4268623292,
0.5182899237,
0.07355804,
-0.011333596,
0.2064491063,
-0.1893416196,
-0.026311364,
0.1609651148,
-0.0731869563,
-0.1525501758,
0.5049318075,
0.1899757683,
-0.0368415974,
-0.0840222985,
-0.1401459575,
-0.572070837,
-0.1805714518,
0.1014309302,
0.2487937361,
0.5083114505,
0.0969918594,
0.0378732234,
-0.497372359,
-0.3354012072,
-0.0251509324,
0.0841020644,
0.3870463073,
0.17601493,
-0.2663964629,
-0.0613651946,
-0.4050893486,
0.3238611221,
0.1768580675,
-0.1495717913,
-0.0401822291,
0.2509094775,
0.1589119732,
0.0247876756,
0.2293134034,
-0.3580598831,
0.3446397483,
0.0843649954,
0.2656255364,
-0.2265176177,
0.1304503828,
-0.0130927432,
-0.0009669561,
0.413572371,
-0.1608143002,
-0.3760301173,
-0.0049716686,
0.1477151215,
0.3667692244,
-0.4045112431,
-0.1316162199,
-0.1284350455,
-0.1067701802,
-0.1258196682,
-0.2567428946,
0.1178540885,
0.1275596768,
0.4597361386,
0.2020023912,
0.309612751,
0.37507388,
-0.0222707484,
0.1082211584,
0.3880184293,
0.5211102962,
-0.1680448502,
0.0485166758,
0.1964557916,
0.2341530025,
0.5824500322,
-0.0569687299,
-0.2218943238,
0.2266022563,
-0.2282983661,
0.3059274256,
0.0471698791,
0.0986551866,
0.1458794773,
0.3456741869,
0.10336034,
-0.2108806074,
-0.0053259968,
0.0337199382,
0.2130786479,
-0.1709383726,
-0.2221276164,
0.3496198356,
-0.1516682506,
-0.1745559871,
0.1300292909,
0.3755858839,
-0.274025172,
0.2951129079,
0.1486349851,
1.0607907772,
0.3447884321,
0.0788977221,
-0.1236356497,
0.009215978,
0.2861760259,
-0.1518214792,
0.1172869205,
-0.3929426968,
0.1485292912,
0.0549722277,
0.1671449542,
-0.0804550424,
0.1859729141,
-0.0198751278,
0.0259388462,
-0.2554929256,
0.276476711,
-0.1621091813,
0.4707963169,
0.2257468253,
-0.0783593059,
0.0818224624,
0.0511322096,
-0.0212815218,
0.48808375,
-0.374294132,
0.1539590508,
-0.0073191249,
-0.0668251067,
-0.4324817955,
-0.140126735,
0.1286016554,
0.2918870449,
0.0101487646,
-0.353690058,
0.0581821389,
0.3371960521,
0.0042058886,
0.2881407738,
-0.200099051,
0.227630958,
-0.1306280792,
0.1145421118,
0.2848287523,
0.2474772632,
-0.1515915394,
-0.1420459598,
-0.2853094339,
0.0626697019,
-0.2895980775,
-0.1410527527,
-0.3069057763,
-0.255382359,
-0.2306338549,
-0.2116295546,
0.3574078381,
0.0723326951,
0.030395681,
-0.3096146584,
0.0463452265,
0.3127030134,
-0.0626067445,
0.0086878445,
-0.019082183,
-0.2581135035,
-0.0561032742,
0.2872315943,
0.0907895193,
-0.0236312598,
0.4977653921,
0.3514390588,
-0.22644943,
-0.0814527124,
0.0067700446,
-0.3021362126,
-0.3260261118,
-0.1122289151,
-0.160314396,
0.3005995452,
-0.5272341371,
0.0222008247,
0.2055335939,
-0.0706894919,
-0.175959602,
-0.4852509797,
-0.2740544081,
0.2114828676,
0.1044384241,
-0.1064961106,
0.1058683693,
-0.3244021833,
0.1323315352,
0.1528976858,
-0.2119720876,
-0.2077439725,
-0.1508572102,
0.2941689789,
-0.0118109183,
0.0504617468,
-0.2046802044,
-0.1677409112,
0.0085927481,
-0.4053916335,
0.2234889567,
-0.1143295392,
0.0449708551,
0.2320536375,
-0.0507530756,
-0.2713606358,
0.1506616175,
-0.1844347268,
-0.0352686197,
-0.2412577569,
-0.1594511867,
0.074861601,
0.1108352244,
0.2966978252,
-0.0648252144,
0.2221535742,
-0.3317201138,
0.2220246196,
0.209919706,
0.1152128056,
-0.0242194217,
0.2436480969,
0.41474998,
-0.0241700225,
-0.0524011068,
0.0270157438,
-0.1087438762,
-0.0767958388,
0.0569047853,
-0.2534984946,
0.3784094751,
0.4685870707,
0.1953285187,
0.0135248043,
-0.1067932174,
0.1757262349,
0.0882330239,
0.1909667104,
-0.5340117812,
-0.0693594292,
0.3859980702,
0.1083143428,
-0.0403887667,
0.0816604793,
-0.03185324,
-0.153762117,
0.0482423194,
0.1064627171,
0.0540368333,
-0.0889346302,
0.0465967692,
0.2780445516,
-0.0205419958,
0.1160142124,
-0.3238054514,
0.2555986345,
0.0249911454,
0.3017579317,
0.288700223,
-0.0545161031,
-0.0528356098,
0.0232012793,
0.0257222895,
-0.1221860275,
0.1985286474,
0.1686082184,
-0.0738743469,
0.186211884,
0.1652342528,
-0.1427029818,
0.1433387697,
0.0247071218,
-0.30946666,
0.1690117717,
-0.1509306282,
-0.0258259568,
-0.5115841627,
-0.1569619179,
0.130171448,
-0.0323114768,
-0.0002206735,
-0.3970230222,
0.0464688912,
0.1543810368,
-0.3306346834,
-0.4434218109,
0.0411057062,
0.1818972677,
0.2838748097,
-0.2849945426,
-0.0035642984,
0.1924326569,
-0.142148599,
-0.267296344,
0.5577535629,
0.2276387066,
-0.095847182,
-0.1166280806,
-0.0531111769,
-0.0016039019,
-0.0355978757,
-0.2380160242,
0.1267372221,
0.0315538757,
-0.1447692215,
0.108707428,
0.0258535687,
-0.0964854509,
-0.1042923182,
0.2709614933,
0.1727026105,
0.0668985546,
-0.3142921627,
-0.1021552905,
-0.2569535673,
-0.0656745508,
-0.112678133,
0.0564751737,
-0.1030589864,
0.3124278784,
0.3262054324,
0.0918548107,
-0.1263725609,
0.0192982852,
-0.0242654923,
0.1104478464,
0.200664252,
0.0578148067,
-0.06270165,
-0.4903542399,
-0.5188621879,
0.2414769083,
-0.4477033019,
-0.3777935505,
0.1942806095,
0.1893029213,
0.0575315468,
0.1087443829,
0.1562179476,
0.4024173915,
-0.2073470652,
0.5081564784,
-0.1827881187,
-0.0603976957,
0.0534943789,
0.2580351532,
-0.0862742215,
-0.21084629,
0.3570452631,
0.1798707694,
-0.1149010286,
-0.1822196394,
-0.0029857226,
-0.0081469566,
0.2827711999,
0.2995381057,
0.2044021636,
0.1713005155,
-0.3087404966,
-0.2129371911,
-0.0485414304,
-0.2621198893,
-0.0270406771,
0.7471526861,
0.0397932008,
0.0338849165,
-0.1692427397,
-0.1632169783,
0.0909646228,
0.2456416041,
0.113173835,
0.188164413,
-0.5572511554,
-0.0396216735,
0.0552950799,
0.2511414886,
0.0060986592,
-0.087254025,
0.1238470748,
-0.2110015303,
-0.4428654313,
-0.2427511066,
0.0140888477,
-0.3984429836,
-0.2658976018,
-0.7156361938,
0.1114248857,
0.0852636993,
-0.3103725612,
-0.2007279098,
-0.1691341549,
0.4191298485,
0.1735119373,
-0.0139667969,
-0.3795804679,
-0.1692905277,
0.0258112308,
-0.1268441826,
0.3520088196,
0.1013599411,
-0.4374334514,
0.0498605557,
-0.2752314806
] |
https://github.com/huggingface/datasets/issues/1759 | wikipedia dataset incomplete | The wikipedia articles are processed using the `mwparserfromhell` library. Even if it works well in most cases, such issues can happen unfortunately. You can find the repo here: https://github.com/earwig/mwparserfromhell
There also exist other datasets based on wikipedia that were processed differently (and are often cleaner) such as `wiki40b`.
| Hey guys,
I am using the https://github.com/huggingface/datasets/tree/master/datasets/wikipedia dataset.
Unfortunately, I found out that there is an incompleteness for the German dataset.
For reasons unknown to me, the number of inhabitants has been removed from many pages:
Thorey-sur-Ouche has 128 inhabitants according to the webpage (https://de.wikipedia.org/wiki/Thorey-sur-Ouche).
The pickle file however shows: franzΓΆsische Gemeinde mit Einwohnern (Stand).
Is it possible to fix this?
Best regards
Chris
| 48 | wikipedia dataset incomplete
Hey guys,
I am using the https://github.com/huggingface/datasets/tree/master/datasets/wikipedia dataset.
Unfortunately, I found out that there is an incompleteness for the German dataset.
For reasons unknown to me, the number of inhabitants has been removed from many pages:
Thorey-sur-Ouche has 128 inhabitants according to the webpage (https://de.wikipedia.org/wiki/Thorey-sur-Ouche).
The pickle file however shows: franzΓΆsische Gemeinde mit Einwohnern (Stand).
Is it possible to fix this?
Best regards
Chris
The wikipedia articles are processed using the `mwparserfromhell` library. Even if it works well in most cases, such issues can happen unfortunately. You can find the repo here: https://github.com/earwig/mwparserfromhell
There also exist other datasets based on wikipedia that were processed differently (and are often cleaner) such as `wiki40b`.
| [
0.1457833946,
0.165130645,
-0.0604216233,
0.4512960315,
-0.1779640764,
0.1422894001,
0.1325684041,
-0.0599783808,
0.2211329639,
0.1373943835,
0.1483721733,
-0.0644867122,
0.4038361907,
-0.4707551599,
-0.0247412547,
-0.1964902431,
0.1687638164,
0.1441212744,
-0.3371715844,
-0.2833013833,
-0.1504705697,
0.4101847708,
-0.3018544018,
-0.3771215677,
0.0009894167,
0.1730691642,
0.0294007845,
-0.1099493206,
0.0388541743,
-0.2551024556,
0.0370925628,
-0.1234475747,
0.0171353258,
0.269483,
-0.0001211163,
-0.1979539245,
0.1709192544,
0.0784727708,
-0.4775891006,
-0.0129321506,
-0.2857729495,
-0.3218947947,
-0.0640131161,
-0.3470282257,
0.3659271002,
0.1441551447,
0.2030156106,
0.0585192218,
-0.0170048717,
-0.1380969286,
0.1241209805,
-0.3913949132,
0.200590685,
0.0655084029,
0.4258055687,
0.5858445168,
0.1269977093,
0.2719857097,
-0.0048445342,
-0.1762052029,
0.0176585335,
0.5391581059,
0.0057501467,
-0.0616088398,
0.1903233677,
-0.0977574959,
0.0417255908,
-0.3754291534,
0.5308151245,
0.4282437563,
0.6989921927,
0.0609150678,
-0.2956070304,
-0.2108038813,
-0.0446786061,
0.1271711141,
0.4841118753,
0.1465954185,
0.0158948191,
0.0581625029,
-0.0173051748,
-0.3101016581,
0.0548867509,
0.2982163727,
-0.2402051389,
0.7044148445,
-0.0301206298,
0.1586295366,
-0.1816010326,
0.04384505,
-0.3793135285,
-0.2826716304,
-0.0948736742,
0.6344090104,
0.0443101749,
0.1643260419,
0.0751376301,
0.077243492,
0.3611148894,
-0.2755669951,
-0.3678847849,
-0.1502044499,
-0.3200319111,
0.0574988835,
0.4369733334,
-0.0295738075,
0.3606518805,
-0.2009491622,
0.2603802085,
0.0274022352,
0.0076455246,
0.2808776796,
0.1464324594,
-0.1832090765,
0.0047893967,
-0.0615610592,
0.0689777508,
-0.2187532634,
0.0432224646,
0.5090513229,
-0.2550530732,
-0.2354687601,
-0.2305581719,
-0.0571924821,
-0.1718483269,
0.3587581515,
0.0155741023,
0.0492519923,
-0.3456347585,
-0.3288670778,
0.0548177697,
0.0684344769,
-0.0149544459,
-0.0760123059,
-0.1218013912,
-0.1956167668,
0.3033376336,
0.0875604376,
-0.1614001542,
-0.1439448595,
0.0059453542,
-0.3173173964,
0.0513226576,
0.1171250939,
0.2250035852,
0.2758550942,
-0.1570949256,
-0.6372518539,
0.0443666168,
0.1000974625,
-0.3013817668,
-0.0364336148,
-0.6779910326,
0.1429633945,
-0.2141106278,
-0.0380948223,
-0.2095006108,
0.1293666959,
0.2918626368,
-0.3391789496,
0.0900606588,
0.0538965352,
-0.1480181366,
-0.0453011394,
0.3423947692,
0.5277431607,
-0.0726072714,
-0.2131536752,
-0.2400626242,
0.1856557727,
0.3504774272,
0.4081871808,
0.0336732157,
0.3773178458,
-0.0445006937,
0.0923471749,
-0.0536391996,
0.1296360195,
-0.4094781578,
0.027595412,
0.1863748133,
0.0908564478,
-0.3522014618,
0.0342829414,
0.0083403103,
0.2894447744,
0.0280097649,
0.1449131072,
0.3542478681,
-0.0304774549,
-0.3212763667,
-0.1869339794,
0.4860833585,
-0.0571014658,
0.2496021092,
0.0195017606,
0.1994180381,
0.1431910247,
0.56971699,
0.0964566991,
0.4354119301,
0.7665311098,
0.0510881767,
0.2489739358,
0.2217188925,
-0.0409099162,
-0.1405913681,
-0.0486742295,
0.0215397216,
0.3681217432,
0.1580459923,
-0.1656516045,
-0.1193706617,
0.0043173404,
0.0545833781,
-0.163484171,
0.0601624623,
0.1263918728,
0.003624409,
0.1342671961,
0.2368515879,
-0.4029852152,
-0.2450558841,
-0.1003006026,
-0.5714447498,
0.4301274121,
-0.157439962,
0.0866300911,
-0.3112457693,
0.1544341296,
-0.0469834246,
-0.0862773359,
-0.1597280651,
-0.0192471016,
0.2688751817,
-0.0900055617,
0.527232945,
0.0586884432,
0.1302472204,
-0.3522473872,
-0.0622085072,
0.1057255939,
0.0245696809,
0.1013293713,
-0.6246510148,
-0.2231550515,
0.1938697845,
0.2869720161,
-0.2390445769,
0.2374240309,
0.5918764472,
0.1011635065,
0.1432623267,
-0.4077336192,
0.3371963203,
0.1860397011,
-0.0232663751,
0.0664847568,
-0.1998918802,
0.0710161626,
-0.0652068406,
0.1524333954,
0.3409905732,
0.3338629305,
-0.2944646776,
-0.3108475804,
0.2318411469,
-0.2295025289,
-0.2038973123,
0.1474938691,
0.2784415483,
-0.2145889848,
0.3905886412,
0.0154751614,
0.1806614399,
0.2805584669,
0.1175009608,
0.1110362783,
0.1559867859,
0.2408440858,
-0.3074936867,
-0.0712038949,
-0.0985702276,
0.3704070151,
-0.0236849878,
-0.0726827011,
-0.0377209373,
-0.0324176736,
0.0389567614,
0.0751195252,
-0.8128614426,
-0.2056322396,
0.037233796,
-0.0130471988,
-0.188279897,
0.1903687119,
-0.0759149268,
-0.1974060088,
-0.1964820474,
0.204097718,
-0.1688505858,
-0.2201682627,
-0.2426238209,
0.0149347577,
0.0277102627,
-0.0396469496,
0.0803909674,
-0.4445260763,
-0.5066562891,
-0.6288619041,
-0.4411583245,
0.2037250549,
0.0128165465,
0.0592473522,
0.0856284648,
0.3786282539,
-0.4475952983,
0.0401364267,
0.1387774944,
-0.0454165377,
0.1066057011,
0.0998870581,
-0.2520991266,
-0.1221778542,
-0.0513883755,
-0.1038913578,
-0.1540358961,
0.1118792519,
0.0949262008,
0.3399056792,
0.2324994802,
0.24521029,
0.0753847063,
-0.2840759456,
-0.0840274766,
-0.1073355898,
-0.3288807273,
-0.2740887702,
0.1363540888,
-0.2322099209,
-0.3054610193,
0.0712977275,
-0.0898422003,
-0.0707058832,
-0.058320079,
-0.5821250677,
0.0886528715,
-0.136785239,
0.1188963875,
-0.3265384734,
0.1683313698,
0.3140133023,
0.0313090347,
0.1092465073,
-0.0234484784,
-0.0973199755,
-0.0231411774,
0.2916717827,
0.5615309477,
-0.1569958329,
0.1271218956,
0.0614071004,
0.5506911874,
0.522111237,
0.4804534018,
0.0566063039,
0.0543396138,
0.1798394173,
-0.1528553218,
0.0092243273,
0.1997856796,
-0.1374714524,
-0.1388489753,
0.5862262845,
0.1349095106,
-0.0819988102,
-0.0399245881,
-0.1424111724,
-0.6010251641,
-0.1871094108,
0.0840949863,
0.2459482551,
0.5408473611,
0.1182596162,
0.0256260969,
-0.4206120968,
-0.3877401948,
-0.0325783491,
0.0469782837,
0.4023587108,
0.2233220339,
-0.2932399213,
-0.1286976039,
-0.3533387482,
0.2833378911,
0.1879225671,
-0.1200781614,
0.0142863933,
0.2271014601,
0.142109409,
0.0559375137,
0.1480296403,
-0.3797413707,
0.2764491737,
0.034630198,
0.2937158346,
-0.2467795014,
0.1407268345,
-0.0480143502,
0.0527352542,
0.3260177076,
-0.1593942046,
-0.3618429005,
0.040627975,
0.1157187447,
0.3878134787,
-0.3619179428,
-0.1815861911,
-0.0694167167,
-0.0828782916,
-0.0923162401,
-0.2579606473,
0.0976451561,
0.1278556287,
0.3521018326,
0.1546680927,
0.2665953338,
0.3562871814,
-0.0003054272,
0.1349258423,
0.3300658762,
0.482042551,
-0.1621253192,
0.0101771643,
0.1432147622,
0.2127494812,
0.5548611283,
-0.0642779842,
-0.1784171462,
0.1429616362,
-0.2956858575,
0.2526401877,
0.0168635473,
0.1204578355,
0.1171631292,
0.3544506431,
0.0122521566,
-0.1734018475,
-0.0570186302,
0.0792109966,
0.195433706,
-0.0970923528,
-0.1670969725,
0.3800332844,
-0.1346751451,
-0.1745976806,
0.1131976694,
0.3719498515,
-0.2953278124,
0.2891610861,
0.2699329853,
1.0011183023,
0.3788386285,
0.0121554658,
-0.179325968,
-0.0529597178,
0.2972717881,
-0.10714899,
0.1084456444,
-0.3848906457,
0.1584661901,
0.0686543658,
0.1911525279,
-0.0917754993,
0.2376817912,
0.0016860646,
0.0374543779,
-0.2867053747,
0.2256292552,
-0.1718361825,
0.5127314329,
0.2711778283,
-0.0895367041,
0.1535365433,
0.0653077587,
-0.050921157,
0.4138067365,
-0.3755306005,
0.174742654,
-0.0412145145,
0.0088908859,
-0.4454414248,
-0.141869083,
0.1368914396,
0.2824142575,
0.054976888,
-0.3239550889,
0.1039002836,
0.3498429954,
-0.0466881804,
0.2900587916,
-0.1569159031,
0.2296325862,
-0.161282599,
0.0859039649,
0.3205882907,
0.2394995689,
-0.1280837953,
-0.1320457608,
-0.2758927047,
-0.004474889,
-0.278329432,
-0.1323284209,
-0.2475752532,
-0.2759234607,
-0.1543505341,
-0.191869989,
0.3122683465,
0.0656158328,
-0.0326025337,
-0.3162341714,
0.0795124546,
0.2867479622,
-0.0426282287,
0.101309441,
-0.038517572,
-0.2451888621,
-0.043415267,
0.2008706331,
0.0943080634,
0.0440777019,
0.4918827415,
0.3106237054,
-0.304317683,
-0.0675351471,
0.0073159523,
-0.3844085038,
-0.3108673692,
-0.1408265978,
-0.1906193942,
0.2942611277,
-0.5391881466,
0.0431106053,
0.2096440941,
-0.0622674599,
-0.1616137028,
-0.4557009339,
-0.2316178679,
0.1932722032,
0.1517164409,
-0.1242121756,
0.0442092307,
-0.3824692369,
0.1184572056,
0.2389193028,
-0.2095685154,
-0.2484272867,
-0.1406659037,
0.2769830525,
0.0125342421,
0.0473864153,
-0.3052443266,
-0.1483775228,
0.0197530836,
-0.3925035,
0.3026610613,
-0.1368870437,
0.055495169,
0.202874139,
-0.0349629857,
-0.2961300313,
0.1907844394,
-0.1808451712,
-0.0280477609,
-0.2980056405,
-0.2192566693,
-0.035118375,
0.0956456512,
0.3528509736,
-0.04688913,
0.1906130016,
-0.3021706939,
0.2236241847,
0.1446105391,
0.0907533616,
-0.0123569397,
0.2586516142,
0.520139575,
-0.005280206,
-0.06173563,
0.0004937749,
-0.1591586024,
-0.0417903699,
0.1035337821,
-0.2429112494,
0.3560661376,
0.5593596101,
0.131352976,
0.0726647079,
-0.1182193905,
0.106729798,
0.0877887383,
0.2283996046,
-0.5155934691,
-0.0981060117,
0.3583301306,
0.1445647776,
-0.0694257021,
0.106020458,
-0.0033222151,
-0.2009485811,
0.0152545916,
0.1081548706,
0.057489872,
-0.0894694701,
0.0416970216,
0.2708218098,
0.0354922712,
0.1084890589,
-0.3412258029,
0.171248287,
0.0292046573,
0.2962408364,
0.3516979218,
-0.0876998752,
-0.0002046938,
-0.0155999213,
0.0786092579,
0.0215555727,
0.2241314799,
0.1309172958,
-0.0751386434,
0.2060133517,
0.2162438929,
-0.1399490088,
0.1883501858,
0.0065365341,
-0.3409823775,
0.134070918,
-0.1309177577,
-0.0184520669,
-0.5098683238,
-0.1693206578,
0.1387698203,
-0.0741068497,
-0.0382839665,
-0.3801880479,
0.0856133178,
0.1762545407,
-0.3443517089,
-0.4727267325,
0.1152073443,
0.1771209687,
0.354185313,
-0.3139342666,
-0.03194011,
0.2008036971,
-0.1550041884,
-0.3127721548,
0.5225102305,
0.2265102714,
-0.0742241144,
-0.1609315723,
-0.0873169899,
-0.0264175572,
-0.0357023142,
-0.177858144,
0.1859542578,
-0.0164362881,
-0.1689248979,
0.099792175,
0.0280409679,
-0.1042821631,
-0.1733640283,
0.2708336711,
0.186890766,
0.0621003248,
-0.3633449078,
-0.1073138863,
-0.2540301383,
-0.0255060643,
-0.1426612884,
0.1547557563,
-0.0709242001,
0.2788180709,
0.2775568962,
0.0554705337,
-0.120573543,
0.0273896214,
-0.0635492355,
0.1031077579,
0.2089658678,
0.0098678786,
-0.0618141294,
-0.4642455876,
-0.4811488986,
0.2121975869,
-0.4761247933,
-0.4154520929,
0.2206807584,
0.1804602146,
-0.0116340546,
0.1107138097,
0.0977725163,
0.3260554969,
-0.2338539958,
0.5221577883,
-0.1762695462,
-0.0663126931,
0.0272839908,
0.171291396,
-0.0882776007,
-0.1848087609,
0.3778122067,
0.1932528168,
-0.1162317768,
-0.1612394303,
-0.0358334258,
0.0842573494,
0.3710422516,
0.2509284914,
0.2829444706,
0.1493947059,
-0.3115492761,
-0.174460426,
-0.044033695,
-0.2770477533,
-0.0549364388,
0.7693369985,
-0.0266974699,
0.0448487066,
-0.1694969684,
-0.1429621875,
0.1333087832,
0.2583148479,
0.0921493694,
0.1760732085,
-0.56997931,
-0.0860631913,
0.0051489174,
0.2407627255,
0.0549505875,
-0.0580492504,
0.1391149908,
-0.2182603329,
-0.4384661019,
-0.3041389585,
-0.0382786542,
-0.3999020755,
-0.2851285338,
-0.6287999749,
0.0630681813,
0.1092444435,
-0.3254572749,
-0.1430909187,
-0.2490008473,
0.4475743473,
0.1568648666,
0.0031939282,
-0.4028250277,
-0.1381458938,
0.0274073984,
-0.0907365456,
0.2588890493,
0.0797082856,
-0.4124221802,
0.0294042844,
-0.2853694558
] |
https://github.com/huggingface/datasets/issues/1758 | dataset.search() (elastic) cannot reliably retrieve search results | Hi !
I tried your code on my side and I was able to workaround this issue by waiting a few seconds before querying the index.
Maybe this is because the index is not updated yet on the ElasticSearch side ? | I am trying to use elastic search to retrieve the indices of items in the dataset in their precise order, given shuffled training indices.
The problem I have is that I cannot retrieve reliable results with my data on my first search. I have to run the search **twice** to get the right answer.
I am indexing data that looks like the following from the HF SQuAD 2.0 data set:
```
['57318658e6313a140071d02b',
'56f7165e3d8e2e1400e3733a',
'570e2f6e0b85d914000d7d21',
'5727e58aff5b5019007d97d0',
'5a3b5a503ff257001ab8441f',
'57262fab271a42140099d725']
```
To reproduce the issue, try:
```
from datasets import load_dataset, load_metric
from transformers import BertTokenizerFast, BertForQuestionAnswering
from elasticsearch import Elasticsearch
import numpy as np
import collections
from tqdm.auto import tqdm
import torch
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
max_length = 384 # The maximum length of a feature (question and context)
doc_stride = 128 # The authorized overlap between two part of the context when splitting it is needed.
pad_on_right = tokenizer.padding_side == "right"
squad_v2 = True
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
def prepare_validation_features(examples):
# Tokenize our examples with truncation and maybe padding, but keep the overflows using a stride. This results
# in one example possible giving several features when a context is long, each of those features having a
# context that overlaps a bit the context of the previous feature.
tokenized_examples = tokenizer(
examples["question" if pad_on_right else "context"],
examples["context" if pad_on_right else "question"],
truncation="only_second" if pad_on_right else "only_first",
max_length=max_length,
stride=doc_stride,
return_overflowing_tokens=True,
return_offsets_mapping=True,
padding="max_length",
)
# Since one example might give us several features if it has a long context, we need a map from a feature to
# its corresponding example. This key gives us just that.
sample_mapping = tokenized_examples.pop("overflow_to_sample_mapping")
# We keep the example_id that gave us this feature and we will store the offset mappings.
tokenized_examples["example_id"] = []
for i in range(len(tokenized_examples["input_ids"])):
# Grab the sequence corresponding to that example (to know what is the context and what is the question).
sequence_ids = tokenized_examples.sequence_ids(i)
context_index = 1 if pad_on_right else 0
# One example can give several spans, this is the index of the example containing this span of text.
sample_index = sample_mapping[i]
tokenized_examples["example_id"].append(examples["id"][sample_index])
# Set to None the offset_mapping that are not part of the context so it's easy to determine if a token
# position is part of the context or not.
tokenized_examples["offset_mapping"][i] = [
(list(o) if sequence_ids[k] == context_index else None)
for k, o in enumerate(tokenized_examples["offset_mapping"][i])
]
return tokenized_examples
# build base examples, features set of training data
shuffled_idx = pd.read_csv('https://raw.githubusercontent.com/afogarty85/temp/main/idx.csv')['idx'].to_list()
examples = load_dataset("squad_v2").shuffle(seed=1)['train']
features = load_dataset("squad_v2").shuffle(seed=1)['train'].map(
prepare_validation_features,
batched=True,
remove_columns=['answers', 'context', 'id', 'question', 'title'])
# reorder features by the training process
features = features.select(indices=shuffled_idx)
# get the example ids to match with the "example" data; get unique entries
id_list = list(dict.fromkeys(features['example_id']))
# now search for their index positions in the examples data set; load elastic search
es = Elasticsearch([{'host': 'localhost'}]).ping()
# add an index to the id column for the examples
examples.add_elasticsearch_index(column='id')
# retrieve the example index
example_idx_k1 = [examples.search(index_name='id', query=i, k=1).indices for i in id_list]
example_idx_k1 = [item for sublist in example_idx_k1 for item in sublist]
example_idx_k2 = [examples.search(index_name='id', query=i, k=3).indices for i in id_list]
example_idx_k2 = [item for sublist in example_idx_k2 for item in sublist]
len(example_idx_k1) # should be 130319
len(example_idx_k2) # should be 130319
#trial 1 lengths:
# k=1: 130314
# k=3: 130319
# trial 2:
# just run k=3 first: 130310
# try k=1 after k=3: 130319
```
| 41 | dataset.search() (elastic) cannot reliably retrieve search results
I am trying to use elastic search to retrieve the indices of items in the dataset in their precise order, given shuffled training indices.
The problem I have is that I cannot retrieve reliable results with my data on my first search. I have to run the search **twice** to get the right answer.
I am indexing data that looks like the following from the HF SQuAD 2.0 data set:
```
['57318658e6313a140071d02b',
'56f7165e3d8e2e1400e3733a',
'570e2f6e0b85d914000d7d21',
'5727e58aff5b5019007d97d0',
'5a3b5a503ff257001ab8441f',
'57262fab271a42140099d725']
```
To reproduce the issue, try:
```
from datasets import load_dataset, load_metric
from transformers import BertTokenizerFast, BertForQuestionAnswering
from elasticsearch import Elasticsearch
import numpy as np
import collections
from tqdm.auto import tqdm
import torch
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
max_length = 384 # The maximum length of a feature (question and context)
doc_stride = 128 # The authorized overlap between two part of the context when splitting it is needed.
pad_on_right = tokenizer.padding_side == "right"
squad_v2 = True
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
def prepare_validation_features(examples):
# Tokenize our examples with truncation and maybe padding, but keep the overflows using a stride. This results
# in one example possible giving several features when a context is long, each of those features having a
# context that overlaps a bit the context of the previous feature.
tokenized_examples = tokenizer(
examples["question" if pad_on_right else "context"],
examples["context" if pad_on_right else "question"],
truncation="only_second" if pad_on_right else "only_first",
max_length=max_length,
stride=doc_stride,
return_overflowing_tokens=True,
return_offsets_mapping=True,
padding="max_length",
)
# Since one example might give us several features if it has a long context, we need a map from a feature to
# its corresponding example. This key gives us just that.
sample_mapping = tokenized_examples.pop("overflow_to_sample_mapping")
# We keep the example_id that gave us this feature and we will store the offset mappings.
tokenized_examples["example_id"] = []
for i in range(len(tokenized_examples["input_ids"])):
# Grab the sequence corresponding to that example (to know what is the context and what is the question).
sequence_ids = tokenized_examples.sequence_ids(i)
context_index = 1 if pad_on_right else 0
# One example can give several spans, this is the index of the example containing this span of text.
sample_index = sample_mapping[i]
tokenized_examples["example_id"].append(examples["id"][sample_index])
# Set to None the offset_mapping that are not part of the context so it's easy to determine if a token
# position is part of the context or not.
tokenized_examples["offset_mapping"][i] = [
(list(o) if sequence_ids[k] == context_index else None)
for k, o in enumerate(tokenized_examples["offset_mapping"][i])
]
return tokenized_examples
# build base examples, features set of training data
shuffled_idx = pd.read_csv('https://raw.githubusercontent.com/afogarty85/temp/main/idx.csv')['idx'].to_list()
examples = load_dataset("squad_v2").shuffle(seed=1)['train']
features = load_dataset("squad_v2").shuffle(seed=1)['train'].map(
prepare_validation_features,
batched=True,
remove_columns=['answers', 'context', 'id', 'question', 'title'])
# reorder features by the training process
features = features.select(indices=shuffled_idx)
# get the example ids to match with the "example" data; get unique entries
id_list = list(dict.fromkeys(features['example_id']))
# now search for their index positions in the examples data set; load elastic search
es = Elasticsearch([{'host': 'localhost'}]).ping()
# add an index to the id column for the examples
examples.add_elasticsearch_index(column='id')
# retrieve the example index
example_idx_k1 = [examples.search(index_name='id', query=i, k=1).indices for i in id_list]
example_idx_k1 = [item for sublist in example_idx_k1 for item in sublist]
example_idx_k2 = [examples.search(index_name='id', query=i, k=3).indices for i in id_list]
example_idx_k2 = [item for sublist in example_idx_k2 for item in sublist]
len(example_idx_k1) # should be 130319
len(example_idx_k2) # should be 130319
#trial 1 lengths:
# k=1: 130314
# k=3: 130319
# trial 2:
# just run k=3 first: 130310
# try k=1 after k=3: 130319
```
Hi !
I tried your code on my side and I was able to workaround this issue by waiting a few seconds before querying the index.
Maybe this is because the index is not updated yet on the ElasticSearch side ? | [
0.2319183797,
-0.0181093998,
-0.1212054417,
0.1662060171,
0.1539811045,
-0.3275493681,
-0.1240266562,
0.1151944697,
-0.2562257349,
0.2235437483,
-0.09199889,
-0.0185619444,
-0.0620764457,
-0.5503269434,
-0.2119903266,
0.0474042371,
-0.1246100962,
0.1536927521,
0.0321474522,
-0.3201373816,
-0.0627462193,
0.0043779984,
-0.2288939059,
0.0211869013,
-0.4899492264,
-0.0326172896,
-0.0106747299,
0.0597609505,
-0.2692682147,
-0.2286838144,
0.5223036408,
0.0061601689,
-0.0448919088,
0.3566156924,
-0.0001214736,
0.0496644787,
0.1778371334,
-0.1051906124,
-0.1969795674,
-0.3112073541,
-0.1039010659,
0.0208721738,
0.2502503097,
-0.1207280457,
-0.2994047701,
-0.0313750468,
0.016231982,
-0.4722242951,
0.4968914688,
0.1408977807,
0.1539393365,
0.0794693157,
-0.2473959774,
-0.0978698134,
0.5316759348,
0.1491985321,
0.0635456964,
-0.537103653,
0.3572326005,
0.0466666445,
-0.1673320979,
0.2593121231,
-0.0130427554,
0.127995044,
0.0269336756,
0.31273067,
-0.4903326631,
-0.1085786372,
0.1012374461,
0.0566996932,
0.2948664725,
0.1065646932,
-0.5151873231,
-0.173710674,
0.0258476045,
0.1346712112,
0.0453901514,
-0.0322917067,
0.0384984016,
-0.0453943536,
-0.3651886582,
0.0745273679,
-0.1190355197,
0.2235463113,
-0.3281978667,
0.3586454093,
0.0217063297,
-0.082572408,
0.1564614028,
-0.2332244813,
0.335416913,
0.1929097176,
0.0828037262,
0.2111803144,
-0.3941690624,
0.0141275916,
0.1393808722,
-0.3425759375,
0.1961891502,
-0.1744428277,
0.1355976313,
0.2152330726,
-0.110787876,
-0.1329716891,
0.1402100176,
0.3549907506,
0.0715607628,
0.6889233589,
0.0562936664,
-0.3481685817,
-0.4805217981,
-0.1533407271,
0.0640204176,
0.1087691486,
0.3282480836,
-0.1395203471,
-0.1512973309,
-0.2715940177,
-0.3633507192,
0.2554883361,
-0.7213670611,
-0.2695729434,
0.1087378934,
0.2101599425,
0.0075201532,
-0.227646932,
0.2753214836,
0.1703202575,
-0.0937595665,
-0.0165956914,
-0.2273171544,
-0.2755909264,
-0.1744350195,
0.1264994442,
0.293063581,
-0.3172923923,
0.3059697449,
-0.0172566883,
0.3794787526,
-0.2384904176,
0.2275487334,
-0.1642404795,
0.501740396,
-0.0497201011,
-0.0622422025,
0.1019669399,
-0.2309204042,
-0.0008209025,
0.0803697705,
-0.0531153716,
-0.3773983419,
-0.1401286423,
0.0950885043,
0.1630227715,
0.0189068206,
0.0635309368,
0.0570507236,
0.1438111663,
-0.0320245065,
0.2286982387,
0.0316674933,
-0.2421648502,
-0.0283872373,
0.1248353571,
0.2620404959,
0.0838136524,
0.0766109899,
0.0478055999,
-0.2097932696,
0.539223671,
-0.1937483549,
0.5320907831,
-0.3519344032,
0.3588709533,
-0.1959838271,
0.4532101154,
0.343878299,
-0.3066940308,
-0.4178410172,
-0.0070616808,
0.0701467246,
0.0818504542,
-0.1956540346,
-0.0772004649,
0.5850792527,
0.0584456846,
0.1684946269,
-0.1058125347,
-0.0147512881,
-0.1798431873,
-0.2057994306,
0.0793083236,
-0.1324018091,
0.1225371733,
0.3650590479,
-0.3190762997,
0.205954805,
0.2002010792,
0.1033790261,
0.1383925676,
0.1309669912,
0.1993985474,
0.12902686,
0.2451244444,
0.1009811163,
-0.0176463705,
-0.1045698524,
0.3578746319,
-0.1139288843,
-0.1758182496,
-0.1187239662,
0.0789473578,
-0.0378454216,
-0.1796457469,
-0.3683210611,
0.1106187478,
0.0799580216,
-0.0667588264,
-0.1576199085,
0.1252177954,
0.0373861678,
0.0911081284,
-0.1036001667,
-0.0239478983,
-0.1346370578,
0.5873188972,
0.1401750296,
0.061847236,
-0.1289615631,
0.0682048425,
0.3323589563,
0.1408948153,
-0.0288239904,
0.2554712594,
-0.0950422361,
-0.0953592062,
0.2429703325,
0.062127158,
0.0064193341,
-0.456957221,
0.0902888253,
0.1820322722,
-0.0453463271,
-0.1043458581,
-0.189361915,
0.2133303732,
-0.1096129268,
0.2979293466,
-0.1006126329,
-0.3357075453,
0.0486052893,
0.0263248421,
-0.3719769716,
-0.1223483682,
0.1710478067,
-0.2374024093,
0.0927952304,
-0.1622455716,
-0.2991942167,
-0.1154294834,
0.3506641388,
0.0298582073,
0.0070002163,
0.2359532863,
0.1895968914,
0.1017939821,
-0.2224409282,
-0.0980563164,
0.1962486953,
0.1883401871,
0.1611736119,
-0.131604597,
-0.1498197466,
0.0884239823,
-0.1883003414,
0.1864959449,
0.0751937181,
0.3247421086,
0.3557136655,
0.1353530735,
-0.1519441158,
-0.0239978619,
0.075867869,
-0.1002443507,
-0.0602426752,
0.0886290371,
-0.5449984074,
0.183871761,
-0.2592953742,
-0.0696902722,
-0.0694549084,
-0.0686877817,
0.0790018067,
0.0417685322,
0.196946457,
-0.0094869835,
-0.191313684,
-0.040425159,
0.3600954115,
-0.1786870509,
0.0208673738,
0.095041357,
-0.1861401051,
-0.0053193867,
-0.2531756163,
0.1226850152,
0.2429983318,
0.1191357225,
0.0263545308,
-0.3971425891,
-0.233256042,
0.2191594243,
0.2508252859,
-0.0781757236,
-0.0317706577,
-0.3412439823,
-0.7546485662,
-0.2112497091,
0.1506477147,
-0.0891418979,
-0.2272865325,
0.176714927,
0.0478030294,
0.1599811018,
0.2062617391,
-0.2788502574,
-0.0083801448,
0.1596734226,
-0.1973228455,
-0.118205674,
-0.1904232055,
0.2377608567,
-0.2137344927,
0.0460079648,
-0.3016382754,
-0.0945712999,
-0.3605508506,
-0.2301444709,
0.3662575185,
-0.0772942603,
-0.0925501883,
-0.3487817347,
-0.2428895682,
-0.3498478532,
0.6523900032,
-0.3380329609,
0.1325746477,
0.188734591,
-0.0874460638,
-0.346224755,
0.1892596483,
0.2127605677,
-0.2267208248,
-0.0007457561,
-0.1576298773,
-0.0001610241,
0.2392982692,
0.4229533374,
0.487431109,
-0.148301661,
0.1631300002,
0.314147681,
0.9544948936,
0.1182297617,
-0.0469501205,
0.002596606,
0.2337535471,
0.0497344472,
-0.1628335118,
-0.2231666744,
-0.0578457192,
-0.0823693424,
-0.0777805522,
0.1365779191,
0.0194901954,
-0.014460179,
-0.0024007929,
0.2149405032,
-0.4264389277,
-0.2490732074,
-0.0195308086,
-0.0126170255,
0.3440343142,
0.2669637203,
0.6866031885,
0.2155230045,
-0.271879822,
-0.4153936505,
-0.4057599008,
0.0980996788,
0.0687076598,
0.2006710172,
-0.2229745537,
-0.3778162897,
0.1756174117,
0.1501042396,
0.4039023817,
0.3343908191,
0.1257064939,
0.2573718131,
0.3225033581,
0.4669121206,
0.0720626935,
0.0438119881,
-0.132805109,
-0.334066391,
-0.0256501287,
-0.1807625741,
-0.3394306004,
0.2815590203,
-0.1100583524,
0.4821234047,
-0.2550402284,
-0.0481169112,
-0.2062543482,
-0.0797448158,
-0.1733808219,
-0.157074973,
-0.1262796521,
-0.022432683,
0.4037593603,
0.1792228222,
0.1237858608,
0.1246487647,
-0.0701938197,
-0.1975955367,
-0.2033238411,
0.0158268642,
0.1126545444,
-0.0686700419,
0.5717347264,
-0.0629524961,
0.3072263002,
0.7875508666,
-0.0241908263,
0.1152011305,
0.3683218062,
-0.2191746235,
0.4279132485,
-0.0050386153,
-0.1256176233,
-0.0697354525,
0.3411680758,
-0.0148837911,
0.0142016802,
-0.0078938967,
0.0300535951,
0.0397821553,
-0.087764062,
0.5422751904,
-0.3086490929,
-0.3892698884,
-0.0221056938,
0.3651224673,
-0.3544043005,
-0.0099977879,
0.0689873472,
0.5028803349,
-0.3959295154,
0.2949847579,
0.2928874791,
0.5569571257,
-0.0255053714,
-0.1178327203,
-0.1432170868,
0.1455273628,
0.374435842,
-0.2167768031,
0.4011744261,
-0.1790359765,
-0.4535488784,
-0.1155649573,
-0.0676671714,
-0.27436921,
0.4145801365,
-0.1395337582,
0.3018549085,
0.2184749395,
0.1198491454,
-0.1107998788,
0.3054758608,
0.3888861239,
-0.0484047867,
-0.0716838911,
0.0975020602,
0.0452109501,
0.3173329234,
0.0045346888,
0.0331096724,
0.1601284742,
-0.2046087533,
-0.2156310678,
0.0715781599,
-0.3322106302,
0.3397744894,
0.5011979938,
-0.4189104736,
0.1553664804,
-0.3061594367,
0.0958516002,
0.0976356417,
-0.137238428,
0.1370797008,
0.302398324,
0.1333867311,
0.3347493112,
-0.112400502,
0.1055386961,
0.1609681547,
-0.2286612242,
-0.1176991165,
0.218393594,
-0.4788444638,
-0.2822569311,
0.1897846609,
-0.1204183996,
-0.1570331156,
0.0703287944,
0.205644384,
-0.0054779914,
-0.0223847982,
0.0564024188,
0.3085349798,
-0.0129828695,
0.5014365911,
0.4594118297,
-0.20574449,
-0.0384185389,
0.6241492629,
-0.0392481871,
0.0801607445,
0.155570358,
-0.0122022275,
-0.2864848375,
-0.0284059048,
0.2435368598,
0.2989929616,
-0.1358130574,
-0.248971507,
-0.5415059924,
0.3340105414,
0.4406497777,
0.138490513,
0.1985385418,
-0.3680633307,
-0.3013120294,
-0.057669282,
0.2907005548,
0.2671510577,
0.4164355695,
-0.0426882319,
-0.2128514647,
0.0697953254,
-0.0651042759,
0.1052980796,
-0.2458115816,
0.1288778782,
-0.0663753524,
0.1809224933,
-0.6103870869,
-0.1602730602,
0.3117673695,
-0.019064093,
0.0531069525,
0.1648202389,
-0.1333870888,
-0.1044773385,
0.0219225902,
0.1273991615,
0.0057217116,
0.2300188541,
-0.2366716564,
-0.3809960485,
-0.0191570185,
-0.2873553038,
-0.1722266674,
0.5963318348,
0.3391681314,
0.1285147369,
0.160730049,
-0.268452853,
0.1595599055,
-0.0520421155,
0.0400285572,
-0.028034376,
0.0801936984,
0.2192450762,
0.2671088278,
-0.0457935072,
-0.207648471,
0.0715231448,
-0.0080307592,
0.0070220293,
0.3336578012,
-0.3741815686,
-0.0541522354,
0.212754786,
0.5488234758,
0.4308079779,
-0.2640266716,
-0.5410853624,
0.1240554377,
0.1717006713,
-0.1271344125,
-0.3978878558,
0.0317805298,
0.3413986266,
-0.0880507901,
0.2219773531,
-0.1419968307,
-0.2504144907,
0.1384325027,
0.234442234,
0.3853816688,
-0.2593210936,
0.0194241144,
-0.0569813959,
0.1952125132,
-0.2900903821,
0.2023230195,
-0.1742207259,
0.1853568554,
0.3222086728,
0.2221048325,
0.4281586409,
-0.1703192592,
0.1965888888,
0.1464489102,
-0.1715500653,
-0.0959244743,
0.3868347406,
-0.1653012335,
0.1305286288,
-0.2231543362,
0.3798936307,
-0.0463739038,
-0.0868945941,
-0.3670882583,
-0.1713472307,
-0.054860428,
0.2007004321,
0.2769953609,
-0.3592944741,
-0.2113572359,
-0.2130504102,
-0.1868739277,
0.1379604936,
-0.1687572747,
0.0883289501,
0.0146618681,
-0.180916205,
-0.1828182191,
-0.1264399439,
0.2019329965,
-0.2738082409,
0.3066408634,
0.1707686335,
0.0124307722,
0.2588484585,
0.1947531253,
-0.1559539735,
0.2856388986,
-0.4338253736,
0.2635902166,
-0.0902259871,
-0.2458147854,
-0.0114253806,
0.0880515575,
-0.0440071933,
-0.7379398346,
0.2653434277,
0.0217673406,
-0.0454742126,
0.0760258734,
0.1709292084,
0.3233114779,
-0.2415289283,
-0.0746499225,
0.0779384524,
0.3614703119,
0.0754794329,
-0.1379220039,
-0.3765062988,
-0.0245188158,
-0.1823031604,
-0.0379732847,
0.1886954159,
0.0824734718,
0.0594121963,
-0.2205647081,
0.1172611862,
0.1997217834,
-0.0821482539,
-0.1809227318,
-0.1568581015,
-0.4860468209,
0.0663302466,
-0.3449665606,
0.2042010576,
0.4468432963,
0.5287168622,
-0.1400734782,
-0.1025343612,
0.3878421187,
-0.4869924784,
-0.135486424,
0.2283738405,
-0.225852266,
-0.1665972769,
-0.2700254917,
-0.0003969173,
-0.0444550328,
-0.0698095933,
0.0432663821,
-0.1307409853,
0.0677451417,
0.0380586311,
0.0204466134,
0.0603121631,
-0.0367267542,
0.2781246901,
0.1148318276,
-0.0658266544,
0.1099119931,
0.1881404668,
0.0709434673,
-0.2103187442,
-0.0628601313,
-0.0054704123,
0.073587954,
0.2926044762,
-0.0658661947,
-0.3773882091,
-0.1498061419,
0.0059063532,
-0.0139127159,
-0.0626696795,
-0.469681114,
0.0090110535,
-0.1425820142,
0.0877597257,
-0.3129694164,
0.3146182597,
-0.0055830437,
0.3284257054,
-0.1333075017,
-0.2391646653,
0.7692411542,
-0.3602598608,
-0.0566505268,
-0.3632565439,
0.2906859219,
0.5245933533,
0.0564526245,
-0.3426837921,
-0.1364880353,
0.4094574451,
-0.0500623174,
0.0035277819,
-0.2560935915,
0.1643546224,
0.0586029775,
-0.1332414597,
-0.0374308228,
0.2646917403,
-0.0371250771,
-0.0444124304,
-0.0341036879
] |
https://github.com/huggingface/datasets/issues/1758 | dataset.search() (elastic) cannot reliably retrieve search results | Thanks for the feedback! I added a 30 second "sleep" and that seemed to work well! | I am trying to use elastic search to retrieve the indices of items in the dataset in their precise order, given shuffled training indices.
The problem I have is that I cannot retrieve reliable results with my data on my first search. I have to run the search **twice** to get the right answer.
I am indexing data that looks like the following from the HF SQuAD 2.0 data set:
```
['57318658e6313a140071d02b',
'56f7165e3d8e2e1400e3733a',
'570e2f6e0b85d914000d7d21',
'5727e58aff5b5019007d97d0',
'5a3b5a503ff257001ab8441f',
'57262fab271a42140099d725']
```
To reproduce the issue, try:
```
from datasets import load_dataset, load_metric
from transformers import BertTokenizerFast, BertForQuestionAnswering
from elasticsearch import Elasticsearch
import numpy as np
import collections
from tqdm.auto import tqdm
import torch
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
max_length = 384 # The maximum length of a feature (question and context)
doc_stride = 128 # The authorized overlap between two part of the context when splitting it is needed.
pad_on_right = tokenizer.padding_side == "right"
squad_v2 = True
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
def prepare_validation_features(examples):
# Tokenize our examples with truncation and maybe padding, but keep the overflows using a stride. This results
# in one example possible giving several features when a context is long, each of those features having a
# context that overlaps a bit the context of the previous feature.
tokenized_examples = tokenizer(
examples["question" if pad_on_right else "context"],
examples["context" if pad_on_right else "question"],
truncation="only_second" if pad_on_right else "only_first",
max_length=max_length,
stride=doc_stride,
return_overflowing_tokens=True,
return_offsets_mapping=True,
padding="max_length",
)
# Since one example might give us several features if it has a long context, we need a map from a feature to
# its corresponding example. This key gives us just that.
sample_mapping = tokenized_examples.pop("overflow_to_sample_mapping")
# We keep the example_id that gave us this feature and we will store the offset mappings.
tokenized_examples["example_id"] = []
for i in range(len(tokenized_examples["input_ids"])):
# Grab the sequence corresponding to that example (to know what is the context and what is the question).
sequence_ids = tokenized_examples.sequence_ids(i)
context_index = 1 if pad_on_right else 0
# One example can give several spans, this is the index of the example containing this span of text.
sample_index = sample_mapping[i]
tokenized_examples["example_id"].append(examples["id"][sample_index])
# Set to None the offset_mapping that are not part of the context so it's easy to determine if a token
# position is part of the context or not.
tokenized_examples["offset_mapping"][i] = [
(list(o) if sequence_ids[k] == context_index else None)
for k, o in enumerate(tokenized_examples["offset_mapping"][i])
]
return tokenized_examples
# build base examples, features set of training data
shuffled_idx = pd.read_csv('https://raw.githubusercontent.com/afogarty85/temp/main/idx.csv')['idx'].to_list()
examples = load_dataset("squad_v2").shuffle(seed=1)['train']
features = load_dataset("squad_v2").shuffle(seed=1)['train'].map(
prepare_validation_features,
batched=True,
remove_columns=['answers', 'context', 'id', 'question', 'title'])
# reorder features by the training process
features = features.select(indices=shuffled_idx)
# get the example ids to match with the "example" data; get unique entries
id_list = list(dict.fromkeys(features['example_id']))
# now search for their index positions in the examples data set; load elastic search
es = Elasticsearch([{'host': 'localhost'}]).ping()
# add an index to the id column for the examples
examples.add_elasticsearch_index(column='id')
# retrieve the example index
example_idx_k1 = [examples.search(index_name='id', query=i, k=1).indices for i in id_list]
example_idx_k1 = [item for sublist in example_idx_k1 for item in sublist]
example_idx_k2 = [examples.search(index_name='id', query=i, k=3).indices for i in id_list]
example_idx_k2 = [item for sublist in example_idx_k2 for item in sublist]
len(example_idx_k1) # should be 130319
len(example_idx_k2) # should be 130319
#trial 1 lengths:
# k=1: 130314
# k=3: 130319
# trial 2:
# just run k=3 first: 130310
# try k=1 after k=3: 130319
```
| 16 | dataset.search() (elastic) cannot reliably retrieve search results
I am trying to use elastic search to retrieve the indices of items in the dataset in their precise order, given shuffled training indices.
The problem I have is that I cannot retrieve reliable results with my data on my first search. I have to run the search **twice** to get the right answer.
I am indexing data that looks like the following from the HF SQuAD 2.0 data set:
```
['57318658e6313a140071d02b',
'56f7165e3d8e2e1400e3733a',
'570e2f6e0b85d914000d7d21',
'5727e58aff5b5019007d97d0',
'5a3b5a503ff257001ab8441f',
'57262fab271a42140099d725']
```
To reproduce the issue, try:
```
from datasets import load_dataset, load_metric
from transformers import BertTokenizerFast, BertForQuestionAnswering
from elasticsearch import Elasticsearch
import numpy as np
import collections
from tqdm.auto import tqdm
import torch
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
max_length = 384 # The maximum length of a feature (question and context)
doc_stride = 128 # The authorized overlap between two part of the context when splitting it is needed.
pad_on_right = tokenizer.padding_side == "right"
squad_v2 = True
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
def prepare_validation_features(examples):
# Tokenize our examples with truncation and maybe padding, but keep the overflows using a stride. This results
# in one example possible giving several features when a context is long, each of those features having a
# context that overlaps a bit the context of the previous feature.
tokenized_examples = tokenizer(
examples["question" if pad_on_right else "context"],
examples["context" if pad_on_right else "question"],
truncation="only_second" if pad_on_right else "only_first",
max_length=max_length,
stride=doc_stride,
return_overflowing_tokens=True,
return_offsets_mapping=True,
padding="max_length",
)
# Since one example might give us several features if it has a long context, we need a map from a feature to
# its corresponding example. This key gives us just that.
sample_mapping = tokenized_examples.pop("overflow_to_sample_mapping")
# We keep the example_id that gave us this feature and we will store the offset mappings.
tokenized_examples["example_id"] = []
for i in range(len(tokenized_examples["input_ids"])):
# Grab the sequence corresponding to that example (to know what is the context and what is the question).
sequence_ids = tokenized_examples.sequence_ids(i)
context_index = 1 if pad_on_right else 0
# One example can give several spans, this is the index of the example containing this span of text.
sample_index = sample_mapping[i]
tokenized_examples["example_id"].append(examples["id"][sample_index])
# Set to None the offset_mapping that are not part of the context so it's easy to determine if a token
# position is part of the context or not.
tokenized_examples["offset_mapping"][i] = [
(list(o) if sequence_ids[k] == context_index else None)
for k, o in enumerate(tokenized_examples["offset_mapping"][i])
]
return tokenized_examples
# build base examples, features set of training data
shuffled_idx = pd.read_csv('https://raw.githubusercontent.com/afogarty85/temp/main/idx.csv')['idx'].to_list()
examples = load_dataset("squad_v2").shuffle(seed=1)['train']
features = load_dataset("squad_v2").shuffle(seed=1)['train'].map(
prepare_validation_features,
batched=True,
remove_columns=['answers', 'context', 'id', 'question', 'title'])
# reorder features by the training process
features = features.select(indices=shuffled_idx)
# get the example ids to match with the "example" data; get unique entries
id_list = list(dict.fromkeys(features['example_id']))
# now search for their index positions in the examples data set; load elastic search
es = Elasticsearch([{'host': 'localhost'}]).ping()
# add an index to the id column for the examples
examples.add_elasticsearch_index(column='id')
# retrieve the example index
example_idx_k1 = [examples.search(index_name='id', query=i, k=1).indices for i in id_list]
example_idx_k1 = [item for sublist in example_idx_k1 for item in sublist]
example_idx_k2 = [examples.search(index_name='id', query=i, k=3).indices for i in id_list]
example_idx_k2 = [item for sublist in example_idx_k2 for item in sublist]
len(example_idx_k1) # should be 130319
len(example_idx_k2) # should be 130319
#trial 1 lengths:
# k=1: 130314
# k=3: 130319
# trial 2:
# just run k=3 first: 130310
# try k=1 after k=3: 130319
```
Thanks for the feedback! I added a 30 second "sleep" and that seemed to work well! | [
0.2319183797,
-0.0181093998,
-0.1212054417,
0.1662060171,
0.1539811045,
-0.3275493681,
-0.1240266562,
0.1151944697,
-0.2562257349,
0.2235437483,
-0.09199889,
-0.0185619444,
-0.0620764457,
-0.5503269434,
-0.2119903266,
0.0474042371,
-0.1246100962,
0.1536927521,
0.0321474522,
-0.3201373816,
-0.0627462193,
0.0043779984,
-0.2288939059,
0.0211869013,
-0.4899492264,
-0.0326172896,
-0.0106747299,
0.0597609505,
-0.2692682147,
-0.2286838144,
0.5223036408,
0.0061601689,
-0.0448919088,
0.3566156924,
-0.0001214736,
0.0496644787,
0.1778371334,
-0.1051906124,
-0.1969795674,
-0.3112073541,
-0.1039010659,
0.0208721738,
0.2502503097,
-0.1207280457,
-0.2994047701,
-0.0313750468,
0.016231982,
-0.4722242951,
0.4968914688,
0.1408977807,
0.1539393365,
0.0794693157,
-0.2473959774,
-0.0978698134,
0.5316759348,
0.1491985321,
0.0635456964,
-0.537103653,
0.3572326005,
0.0466666445,
-0.1673320979,
0.2593121231,
-0.0130427554,
0.127995044,
0.0269336756,
0.31273067,
-0.4903326631,
-0.1085786372,
0.1012374461,
0.0566996932,
0.2948664725,
0.1065646932,
-0.5151873231,
-0.173710674,
0.0258476045,
0.1346712112,
0.0453901514,
-0.0322917067,
0.0384984016,
-0.0453943536,
-0.3651886582,
0.0745273679,
-0.1190355197,
0.2235463113,
-0.3281978667,
0.3586454093,
0.0217063297,
-0.082572408,
0.1564614028,
-0.2332244813,
0.335416913,
0.1929097176,
0.0828037262,
0.2111803144,
-0.3941690624,
0.0141275916,
0.1393808722,
-0.3425759375,
0.1961891502,
-0.1744428277,
0.1355976313,
0.2152330726,
-0.110787876,
-0.1329716891,
0.1402100176,
0.3549907506,
0.0715607628,
0.6889233589,
0.0562936664,
-0.3481685817,
-0.4805217981,
-0.1533407271,
0.0640204176,
0.1087691486,
0.3282480836,
-0.1395203471,
-0.1512973309,
-0.2715940177,
-0.3633507192,
0.2554883361,
-0.7213670611,
-0.2695729434,
0.1087378934,
0.2101599425,
0.0075201532,
-0.227646932,
0.2753214836,
0.1703202575,
-0.0937595665,
-0.0165956914,
-0.2273171544,
-0.2755909264,
-0.1744350195,
0.1264994442,
0.293063581,
-0.3172923923,
0.3059697449,
-0.0172566883,
0.3794787526,
-0.2384904176,
0.2275487334,
-0.1642404795,
0.501740396,
-0.0497201011,
-0.0622422025,
0.1019669399,
-0.2309204042,
-0.0008209025,
0.0803697705,
-0.0531153716,
-0.3773983419,
-0.1401286423,
0.0950885043,
0.1630227715,
0.0189068206,
0.0635309368,
0.0570507236,
0.1438111663,
-0.0320245065,
0.2286982387,
0.0316674933,
-0.2421648502,
-0.0283872373,
0.1248353571,
0.2620404959,
0.0838136524,
0.0766109899,
0.0478055999,
-0.2097932696,
0.539223671,
-0.1937483549,
0.5320907831,
-0.3519344032,
0.3588709533,
-0.1959838271,
0.4532101154,
0.343878299,
-0.3066940308,
-0.4178410172,
-0.0070616808,
0.0701467246,
0.0818504542,
-0.1956540346,
-0.0772004649,
0.5850792527,
0.0584456846,
0.1684946269,
-0.1058125347,
-0.0147512881,
-0.1798431873,
-0.2057994306,
0.0793083236,
-0.1324018091,
0.1225371733,
0.3650590479,
-0.3190762997,
0.205954805,
0.2002010792,
0.1033790261,
0.1383925676,
0.1309669912,
0.1993985474,
0.12902686,
0.2451244444,
0.1009811163,
-0.0176463705,
-0.1045698524,
0.3578746319,
-0.1139288843,
-0.1758182496,
-0.1187239662,
0.0789473578,
-0.0378454216,
-0.1796457469,
-0.3683210611,
0.1106187478,
0.0799580216,
-0.0667588264,
-0.1576199085,
0.1252177954,
0.0373861678,
0.0911081284,
-0.1036001667,
-0.0239478983,
-0.1346370578,
0.5873188972,
0.1401750296,
0.061847236,
-0.1289615631,
0.0682048425,
0.3323589563,
0.1408948153,
-0.0288239904,
0.2554712594,
-0.0950422361,
-0.0953592062,
0.2429703325,
0.062127158,
0.0064193341,
-0.456957221,
0.0902888253,
0.1820322722,
-0.0453463271,
-0.1043458581,
-0.189361915,
0.2133303732,
-0.1096129268,
0.2979293466,
-0.1006126329,
-0.3357075453,
0.0486052893,
0.0263248421,
-0.3719769716,
-0.1223483682,
0.1710478067,
-0.2374024093,
0.0927952304,
-0.1622455716,
-0.2991942167,
-0.1154294834,
0.3506641388,
0.0298582073,
0.0070002163,
0.2359532863,
0.1895968914,
0.1017939821,
-0.2224409282,
-0.0980563164,
0.1962486953,
0.1883401871,
0.1611736119,
-0.131604597,
-0.1498197466,
0.0884239823,
-0.1883003414,
0.1864959449,
0.0751937181,
0.3247421086,
0.3557136655,
0.1353530735,
-0.1519441158,
-0.0239978619,
0.075867869,
-0.1002443507,
-0.0602426752,
0.0886290371,
-0.5449984074,
0.183871761,
-0.2592953742,
-0.0696902722,
-0.0694549084,
-0.0686877817,
0.0790018067,
0.0417685322,
0.196946457,
-0.0094869835,
-0.191313684,
-0.040425159,
0.3600954115,
-0.1786870509,
0.0208673738,
0.095041357,
-0.1861401051,
-0.0053193867,
-0.2531756163,
0.1226850152,
0.2429983318,
0.1191357225,
0.0263545308,
-0.3971425891,
-0.233256042,
0.2191594243,
0.2508252859,
-0.0781757236,
-0.0317706577,
-0.3412439823,
-0.7546485662,
-0.2112497091,
0.1506477147,
-0.0891418979,
-0.2272865325,
0.176714927,
0.0478030294,
0.1599811018,
0.2062617391,
-0.2788502574,
-0.0083801448,
0.1596734226,
-0.1973228455,
-0.118205674,
-0.1904232055,
0.2377608567,
-0.2137344927,
0.0460079648,
-0.3016382754,
-0.0945712999,
-0.3605508506,
-0.2301444709,
0.3662575185,
-0.0772942603,
-0.0925501883,
-0.3487817347,
-0.2428895682,
-0.3498478532,
0.6523900032,
-0.3380329609,
0.1325746477,
0.188734591,
-0.0874460638,
-0.346224755,
0.1892596483,
0.2127605677,
-0.2267208248,
-0.0007457561,
-0.1576298773,
-0.0001610241,
0.2392982692,
0.4229533374,
0.487431109,
-0.148301661,
0.1631300002,
0.314147681,
0.9544948936,
0.1182297617,
-0.0469501205,
0.002596606,
0.2337535471,
0.0497344472,
-0.1628335118,
-0.2231666744,
-0.0578457192,
-0.0823693424,
-0.0777805522,
0.1365779191,
0.0194901954,
-0.014460179,
-0.0024007929,
0.2149405032,
-0.4264389277,
-0.2490732074,
-0.0195308086,
-0.0126170255,
0.3440343142,
0.2669637203,
0.6866031885,
0.2155230045,
-0.271879822,
-0.4153936505,
-0.4057599008,
0.0980996788,
0.0687076598,
0.2006710172,
-0.2229745537,
-0.3778162897,
0.1756174117,
0.1501042396,
0.4039023817,
0.3343908191,
0.1257064939,
0.2573718131,
0.3225033581,
0.4669121206,
0.0720626935,
0.0438119881,
-0.132805109,
-0.334066391,
-0.0256501287,
-0.1807625741,
-0.3394306004,
0.2815590203,
-0.1100583524,
0.4821234047,
-0.2550402284,
-0.0481169112,
-0.2062543482,
-0.0797448158,
-0.1733808219,
-0.157074973,
-0.1262796521,
-0.022432683,
0.4037593603,
0.1792228222,
0.1237858608,
0.1246487647,
-0.0701938197,
-0.1975955367,
-0.2033238411,
0.0158268642,
0.1126545444,
-0.0686700419,
0.5717347264,
-0.0629524961,
0.3072263002,
0.7875508666,
-0.0241908263,
0.1152011305,
0.3683218062,
-0.2191746235,
0.4279132485,
-0.0050386153,
-0.1256176233,
-0.0697354525,
0.3411680758,
-0.0148837911,
0.0142016802,
-0.0078938967,
0.0300535951,
0.0397821553,
-0.087764062,
0.5422751904,
-0.3086490929,
-0.3892698884,
-0.0221056938,
0.3651224673,
-0.3544043005,
-0.0099977879,
0.0689873472,
0.5028803349,
-0.3959295154,
0.2949847579,
0.2928874791,
0.5569571257,
-0.0255053714,
-0.1178327203,
-0.1432170868,
0.1455273628,
0.374435842,
-0.2167768031,
0.4011744261,
-0.1790359765,
-0.4535488784,
-0.1155649573,
-0.0676671714,
-0.27436921,
0.4145801365,
-0.1395337582,
0.3018549085,
0.2184749395,
0.1198491454,
-0.1107998788,
0.3054758608,
0.3888861239,
-0.0484047867,
-0.0716838911,
0.0975020602,
0.0452109501,
0.3173329234,
0.0045346888,
0.0331096724,
0.1601284742,
-0.2046087533,
-0.2156310678,
0.0715781599,
-0.3322106302,
0.3397744894,
0.5011979938,
-0.4189104736,
0.1553664804,
-0.3061594367,
0.0958516002,
0.0976356417,
-0.137238428,
0.1370797008,
0.302398324,
0.1333867311,
0.3347493112,
-0.112400502,
0.1055386961,
0.1609681547,
-0.2286612242,
-0.1176991165,
0.218393594,
-0.4788444638,
-0.2822569311,
0.1897846609,
-0.1204183996,
-0.1570331156,
0.0703287944,
0.205644384,
-0.0054779914,
-0.0223847982,
0.0564024188,
0.3085349798,
-0.0129828695,
0.5014365911,
0.4594118297,
-0.20574449,
-0.0384185389,
0.6241492629,
-0.0392481871,
0.0801607445,
0.155570358,
-0.0122022275,
-0.2864848375,
-0.0284059048,
0.2435368598,
0.2989929616,
-0.1358130574,
-0.248971507,
-0.5415059924,
0.3340105414,
0.4406497777,
0.138490513,
0.1985385418,
-0.3680633307,
-0.3013120294,
-0.057669282,
0.2907005548,
0.2671510577,
0.4164355695,
-0.0426882319,
-0.2128514647,
0.0697953254,
-0.0651042759,
0.1052980796,
-0.2458115816,
0.1288778782,
-0.0663753524,
0.1809224933,
-0.6103870869,
-0.1602730602,
0.3117673695,
-0.019064093,
0.0531069525,
0.1648202389,
-0.1333870888,
-0.1044773385,
0.0219225902,
0.1273991615,
0.0057217116,
0.2300188541,
-0.2366716564,
-0.3809960485,
-0.0191570185,
-0.2873553038,
-0.1722266674,
0.5963318348,
0.3391681314,
0.1285147369,
0.160730049,
-0.268452853,
0.1595599055,
-0.0520421155,
0.0400285572,
-0.028034376,
0.0801936984,
0.2192450762,
0.2671088278,
-0.0457935072,
-0.207648471,
0.0715231448,
-0.0080307592,
0.0070220293,
0.3336578012,
-0.3741815686,
-0.0541522354,
0.212754786,
0.5488234758,
0.4308079779,
-0.2640266716,
-0.5410853624,
0.1240554377,
0.1717006713,
-0.1271344125,
-0.3978878558,
0.0317805298,
0.3413986266,
-0.0880507901,
0.2219773531,
-0.1419968307,
-0.2504144907,
0.1384325027,
0.234442234,
0.3853816688,
-0.2593210936,
0.0194241144,
-0.0569813959,
0.1952125132,
-0.2900903821,
0.2023230195,
-0.1742207259,
0.1853568554,
0.3222086728,
0.2221048325,
0.4281586409,
-0.1703192592,
0.1965888888,
0.1464489102,
-0.1715500653,
-0.0959244743,
0.3868347406,
-0.1653012335,
0.1305286288,
-0.2231543362,
0.3798936307,
-0.0463739038,
-0.0868945941,
-0.3670882583,
-0.1713472307,
-0.054860428,
0.2007004321,
0.2769953609,
-0.3592944741,
-0.2113572359,
-0.2130504102,
-0.1868739277,
0.1379604936,
-0.1687572747,
0.0883289501,
0.0146618681,
-0.180916205,
-0.1828182191,
-0.1264399439,
0.2019329965,
-0.2738082409,
0.3066408634,
0.1707686335,
0.0124307722,
0.2588484585,
0.1947531253,
-0.1559539735,
0.2856388986,
-0.4338253736,
0.2635902166,
-0.0902259871,
-0.2458147854,
-0.0114253806,
0.0880515575,
-0.0440071933,
-0.7379398346,
0.2653434277,
0.0217673406,
-0.0454742126,
0.0760258734,
0.1709292084,
0.3233114779,
-0.2415289283,
-0.0746499225,
0.0779384524,
0.3614703119,
0.0754794329,
-0.1379220039,
-0.3765062988,
-0.0245188158,
-0.1823031604,
-0.0379732847,
0.1886954159,
0.0824734718,
0.0594121963,
-0.2205647081,
0.1172611862,
0.1997217834,
-0.0821482539,
-0.1809227318,
-0.1568581015,
-0.4860468209,
0.0663302466,
-0.3449665606,
0.2042010576,
0.4468432963,
0.5287168622,
-0.1400734782,
-0.1025343612,
0.3878421187,
-0.4869924784,
-0.135486424,
0.2283738405,
-0.225852266,
-0.1665972769,
-0.2700254917,
-0.0003969173,
-0.0444550328,
-0.0698095933,
0.0432663821,
-0.1307409853,
0.0677451417,
0.0380586311,
0.0204466134,
0.0603121631,
-0.0367267542,
0.2781246901,
0.1148318276,
-0.0658266544,
0.1099119931,
0.1881404668,
0.0709434673,
-0.2103187442,
-0.0628601313,
-0.0054704123,
0.073587954,
0.2926044762,
-0.0658661947,
-0.3773882091,
-0.1498061419,
0.0059063532,
-0.0139127159,
-0.0626696795,
-0.469681114,
0.0090110535,
-0.1425820142,
0.0877597257,
-0.3129694164,
0.3146182597,
-0.0055830437,
0.3284257054,
-0.1333075017,
-0.2391646653,
0.7692411542,
-0.3602598608,
-0.0566505268,
-0.3632565439,
0.2906859219,
0.5245933533,
0.0564526245,
-0.3426837921,
-0.1364880353,
0.4094574451,
-0.0500623174,
0.0035277819,
-0.2560935915,
0.1643546224,
0.0586029775,
-0.1332414597,
-0.0374308228,
0.2646917403,
-0.0371250771,
-0.0444124304,
-0.0341036879
] |
https://github.com/huggingface/datasets/issues/1757 | FewRel | @dspoka Please check the following link : https://github.com/thunlp/FewRel
This link mentions two versions of the datasets. Also, this one seems to be the official link.
I am assuming this is the correct link and implementing based on the same. | ## Adding a Dataset
- **Name:** FewRel
- **Description:** Large-Scale Supervised Few-Shot Relation Classification Dataset
- **Paper:** @inproceedings{han2018fewrel,
title={FewRel:A Large-Scale Supervised Few-Shot Relation Classification Dataset with State-of-the-Art Evaluation},
author={Han, Xu and Zhu, Hao and Yu, Pengfei and Wang, Ziyun and Yao, Yuan and Liu, Zhiyuan and Sun, Maosong},
booktitle={EMNLP},
year={2018}}
- **Data:** https://github.com/ProKil/FewRel
- **Motivation:** relationship extraction dataset that's been used by some state of the art systems that should be incorporated.
Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
| 39 | FewRel
## Adding a Dataset
- **Name:** FewRel
- **Description:** Large-Scale Supervised Few-Shot Relation Classification Dataset
- **Paper:** @inproceedings{han2018fewrel,
title={FewRel:A Large-Scale Supervised Few-Shot Relation Classification Dataset with State-of-the-Art Evaluation},
author={Han, Xu and Zhu, Hao and Yu, Pengfei and Wang, Ziyun and Yao, Yuan and Liu, Zhiyuan and Sun, Maosong},
booktitle={EMNLP},
year={2018}}
- **Data:** https://github.com/ProKil/FewRel
- **Motivation:** relationship extraction dataset that's been used by some state of the art systems that should be incorporated.
Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
@dspoka Please check the following link : https://github.com/thunlp/FewRel
This link mentions two versions of the datasets. Also, this one seems to be the official link.
I am assuming this is the correct link and implementing based on the same. | [
-0.1948350221,
-0.0344231725,
-0.1016145349,
0.1268532425,
-0.0582779981,
-0.125049293,
0.4315412939,
0.1708206832,
0.1060706675,
0.1873809695,
-0.4312258661,
0.0766160786,
-0.0305744056,
-0.3551292121,
0.2079174519,
-0.1194451377,
-0.0137297492,
0.2213973552,
0.0144301234,
-0.2777476907,
-0.2085162848,
0.2417957634,
0.0616170801,
-0.1108964831,
-0.2568879128,
-0.3504306972,
-0.2791403234,
0.2126299292,
-0.234627828,
-0.3258253932,
0.3127014935,
0.3423484266,
0.2360860258,
0.4270271063,
-0.000102641,
-0.1168437675,
0.1504652053,
-0.0227653235,
0.2300339341,
0.0652284995,
0.2461843789,
-0.581530571,
0.0220022127,
-0.2704454362,
-0.0693215728,
-0.3054867089,
-0.0593076944,
-0.0659848973,
0.3989917338,
0.2640652359,
0.3045373559,
-0.0256965198,
0.2329768986,
-0.4150321484,
0.0251857862,
0.0579349324,
-0.1375131905,
0.3970343471,
0.4069153666,
-0.0484835692,
-0.0412055068,
-0.0503177159,
0.1264363974,
-0.1019396111,
0.3068552613,
-0.0098812981,
-0.0730454177,
-0.587565124,
0.0355401225,
0.470245719,
0.303593725,
0.1698889136,
-0.2683261037,
0.1041891649,
-0.030911684,
-0.1546922326,
-0.1621081382,
-0.0901772305,
-0.0814457983,
0.0900969058,
-0.0095680458,
-0.1053603217,
-0.3569052219,
0.2582898736,
-0.1199410483,
0.1873027533,
-0.1128008962,
-0.0755117089,
0.1000801772,
-0.0299589857,
-0.291490972,
0.0547139011,
-0.0248714555,
0.226285845,
-0.1493635923,
-0.2985910773,
0.0451098867,
0.2989334762,
0.5806904435,
0.2920952141,
-0.1349265277,
-0.0020116293,
-0.0244324654,
0.1738011241,
-0.0050682351,
0.0620809346,
0.1071796641,
-0.0976181328,
0.2153973132,
0.0976598635,
0.1153569147,
0.136046052,
-0.3167724907,
0.0317346826,
-0.0946737006,
-0.2656798661,
-0.2686155438,
-0.1873127818,
0.0141024496,
0.3091269433,
-0.1353948414,
0.1039837673,
-0.1042133048,
0.3705089986,
-0.1415279657,
0.3739584684,
-0.1348129809,
0.0459486432,
0.1294863671,
0.0374452211,
-0.236531809,
0.2692069709,
-0.0996678472,
-0.1687612236,
0.162519753,
0.0585832186,
0.2478314489,
-0.2568925023,
0.0748607293,
0.0678149164,
-0.0504783504,
-0.1628351361,
0.304209739,
0.1541781574,
-0.1740551591,
-0.0858006999,
0.0715482086,
-0.2308280021,
-0.3051959872,
-0.1649235487,
-0.0587765202,
0.0251883846,
-0.2654544115,
0.2546763718,
-0.0919787586,
-0.1681694537,
0.1078649387,
0.4329476357,
-0.1162304133,
0.0310746469,
-0.0215808954,
0.175845176,
-0.2366051823,
-0.0912675932,
0.2016699761,
0.270917207,
-0.4070509672,
-0.0816617832,
-0.2495730072,
-0.0352466442,
0.1647789776,
0.1570713371,
-0.1957981437,
0.114488624,
0.0200558025,
0.0757204518,
0.4357152283,
-0.1356098056,
-0.329234302,
0.561694324,
-0.1428673118,
0.0439672619,
0.1381467283,
0.3059667051,
0.3618836999,
-0.0729375482,
0.0767349079,
0.2616867125,
-0.2014495581,
-0.1164131016,
-0.1320560724,
-0.3785001338,
-0.3847467899,
-0.0944838226,
0.5402753353,
0.1610289961,
0.3405370414,
-0.1514064521,
0.3001450002,
0.1266346872,
0.2024376839,
0.1396225095,
0.530210793,
0.1900880486,
-0.0358965062,
-0.2318317443,
-0.1146023348,
0.0589501001,
-0.0395763405,
0.1955926716,
0.1803218573,
-0.1537190527,
-0.2410764843,
-0.1356582344,
-0.0562957749,
-0.3382447362,
0.193591252,
0.2385709137,
0.1584198177,
-0.2077824026,
-0.1073492765,
0.2992666662,
0.178881526,
-0.1213112324,
-0.0368948095,
0.2745822668,
-0.4515449107,
0.1772143543,
0.0068603093,
0.2530306876,
0.0016301133,
-0.2303428501,
0.38060534,
0.3563604951,
-0.105383642,
-0.2045086175,
0.4283845723,
-0.0621720292,
0.14581047,
-0.2260696441,
0.1204101145,
-0.1315041035,
0.0909257904,
0.2448997349,
-0.0000734771,
0.5810726881,
0.2931474745,
0.0285526402,
0.1140240729,
-0.0070646014,
0.1190366372,
0.0095455768,
0.1411257833,
-0.3736829162,
0.0873136967,
0.3077260256,
-0.0203570817,
-0.1098165587,
-0.4671916366,
0.1483646482,
-0.107078582,
-0.0307745971,
0.011305484,
0.1671342403,
0.109193325,
-0.0787723213,
-0.1423222572,
0.3321636021,
0.2356975973,
0.4182392359,
-0.06498079,
-0.0916901007,
-0.0043936255,
-0.0287386607,
0.0683250651,
0.2646045685,
0.3027414382,
0.0663107038,
0.2482175976,
0.2664304674,
-0.2229568213,
-0.2070319802,
-0.0658157244,
0.1552607268,
0.0077505424,
0.1695452631,
0.1440909952,
0.2144914865,
-0.2617083192,
0.0228631552,
-0.065987438,
-0.2564623654,
0.2115866244,
-0.1428838968,
0.2090880871,
0.3292404711,
-0.4815838933,
0.2273491174,
-0.4066334665,
0.3680800796,
0.098332718,
-0.0784762725,
-0.3023245633,
0.2722125351,
0.1302015185,
-0.2210624963,
0.5940270424,
0.0488380753,
-0.1143661588,
-0.4036473036,
-0.7340561748,
0.3076912761,
-0.2309062034,
0.4652513564,
0.1293062568,
-0.0113286236,
-0.0347548015,
-0.1014851704,
0.0613072328,
-0.5267003179,
-0.2977417111,
-0.2505538762,
-0.394777149,
0.0163212717,
0.0256119911,
-0.4342484772,
-0.34705773,
-0.2429417968,
0.2471619844,
0.1174122021,
0.1606266946,
0.2522356808,
-0.0767196417,
-0.0131174289,
0.0112108989,
0.0919825882,
-0.188359946,
-0.1630577147,
0.2885794938,
-0.4790606797,
-0.5077258945,
0.1003754809,
-0.1816788018,
-0.0489656962,
-0.0948415473,
-0.165597707,
-0.4807661772,
-0.0752688348,
0.3006833494,
0.2141381055,
-0.089953199,
0.2338049114,
-0.303753823,
-0.3084409833,
0.0085157081,
0.2025720626,
0.4028569758,
-0.4210576415,
0.1648029834,
-0.0959572494,
0.5690148473,
-0.1091206446,
0.3569282889,
0.0350182429,
-0.3291342854,
-0.0378542244,
-0.1166754737,
0.4221535325,
0.0258362498,
-0.151975885,
0.2515671849,
-0.160484761,
0.097137861,
0.3257712126,
-0.1527764648,
-0.4096335769,
-0.1608093083,
0.1710221022,
-0.2514336705,
0.1008222997,
-0.1981506944,
-0.148513481,
0.1992207766,
-0.1356605589,
-0.3192768097,
-0.0273621436,
-0.1692516506,
-0.0095627271,
0.3584058881,
-0.0911245719,
0.0196217075,
-0.6412320137,
0.1002483219,
-0.3555566967,
0.3508533239,
0.3263655305,
0.0846560225,
-0.1404086202,
-0.3038270772,
-0.0280990954,
-0.1446857303,
0.3904826343,
-0.4032161236,
-0.2489656359,
-0.0755451322,
0.2410814613,
-0.2321610898,
0.1924748272,
-0.2888330519,
0.0281452127,
0.0378838927,
0.1959312707,
-0.1764366627,
-0.2767351568,
0.5746405125,
-0.0118689639,
-0.0618813112,
0.0060387147,
-0.1643147022,
-0.1177977324,
-0.0228784848,
-0.0069782729,
-0.1040868014,
0.0514111556,
0.0060761874,
0.0381993316,
0.005098667,
0.0457029343,
0.3633357584,
0.0900890082,
-0.0893750489,
0.2335478216,
0.2089572102,
0.0448451117,
0.1686366349,
0.520855546,
0.0773422197,
-0.4342053831,
0.009228928,
0.2245378941,
-0.1899527907,
0.4233028293,
0.1524063498,
0.0886672735,
-0.0919309109,
0.2043443918,
0.1073885933,
0.108780086,
0.1067835689,
0.3649699688,
-0.1767455786,
-0.2914910614,
-0.1994680911,
0.2086270303,
0.1136721671,
-0.0447601192,
-0.2344745845,
0.2381377518,
0.0613949262,
-0.2016073167,
0.1958929151,
0.7938677073,
0.0535372011,
0.0564453006,
0.07176359,
-0.555924654,
0.4628688097,
-0.1370231211,
-0.0152129345,
-0.3494102955,
-0.1274486333,
-0.191397965,
0.0301339701,
0.1231657192,
0.1210029721,
0.015967356,
0.0021430701,
-0.0495674908,
-0.0844678506,
0.0293212067,
0.2075285167,
0.3125413954,
-0.1744142473,
-0.0345434844,
0.2706572115,
0.2149135321,
-0.0426108278,
-0.0016284601,
-0.0616665743,
-0.5263208747,
-0.0678344518,
-0.0818146691,
-0.0919506475,
-0.1133591011,
0.2590900362,
0.3719119728,
-0.6455822587,
0.0334826335,
-0.0275620651,
0.2099269629,
-0.1769391894,
-0.0650677979,
0.0897771195,
-0.1560290456,
-0.3026633859,
0.2249402255,
-0.1417624503,
0.2554253936,
-0.1679506004,
-0.0738023072,
0.364220798,
-0.0728304312,
0.065731898,
-0.2658987939,
0.0691032931,
-0.0296816919,
0.1194772795,
0.023178203,
0.2226533145,
-0.0533247665,
-0.2640280426,
0.179490611,
0.0596046411,
-0.1977022886,
-0.1584540904,
-0.043063812,
-0.034480311,
-0.0806507915,
0.4147304296,
0.1429397464,
0.0305212885,
0.2401254475,
0.1684054732,
-0.2359339595,
-0.3452756405,
-0.1083540246,
0.5156995058,
-0.5914088488,
-0.2685298622,
-0.0390962064,
-0.2759581804,
0.3413716853,
0.5564897656,
0.1793881059,
-0.1912807524,
-0.1530122161,
-0.2031971663,
-0.5415029526,
0.1473395675,
-0.5056757927,
0.2357786447,
-0.0727167875,
0.377127111,
-0.0197015628,
0.2641435266,
-0.4471136928,
0.0071394695,
-0.129650116,
-0.0045192707,
-0.199221611,
-0.222364217,
0.1353752315,
0.0397880077,
0.1324139982,
-0.0320297778,
-0.348690033,
-0.2173282802,
-0.1669684201,
0.0621907599,
-0.0684455484,
0.1250793338,
0.1526532173,
0.1905922443,
-0.4427494407,
0.204212755,
0.2229613811,
-0.1053898558,
0.0292232167,
-0.1503472775,
-0.108160913,
-0.2333945334,
-0.0313128904,
-0.1561747491,
0.2293697596,
0.0695952326,
0.2426781952,
0.0235764049,
-0.1477924138,
-0.2319276035,
-0.0494962148,
0.4965569377,
0.1277207732,
-0.1563827693,
0.3315271139,
-0.1826728284,
-0.1078135222,
0.6040503979,
0.4646677673,
0.0868364275,
0.1145822406,
0.128539145,
-0.0904754698,
0.2801992893,
-0.4079575837,
-0.1464690417,
-0.2841693759,
-0.3106563091,
0.1986572742,
0.3563961685,
0.3766655922,
0.078120999,
0.1118502915,
0.1665925831,
0.4697535038,
-0.2706464827,
-0.0113697313,
0.1131823286,
0.2222959995,
0.2097013742,
0.4822470248,
0.1330942661,
0.3767608404,
-0.0205600318,
0.0293651503,
0.2121932209,
0.0055863475,
0.4002186358,
0.4163551629,
-0.1765594333,
0.2393300682,
0.0699884966,
0.0705058575,
-0.2296881229,
-0.1267512888,
0.5943975449,
0.1086572111,
0.133195892,
-0.1361579448,
0.2083364278,
0.0184065495,
-0.071142666,
-0.0612208769,
-0.3688547015,
-0.2815543115,
-0.1877404451,
0.0114332391,
-0.0446935333,
0.3664059639,
-0.1655045897,
-0.1093174815,
-0.3379770219,
-0.0985407606,
0.0970789492,
0.3179982305,
-0.1744045615,
0.2670804262,
-0.1424379647,
-0.2200055122,
0.1298745871,
0.350733161,
0.3833197653,
-0.037086349,
0.2647222877,
-0.0580474585,
0.0102727013,
-0.3191220462,
-0.1735744625,
0.0845660716,
0.2251167148,
-0.2941140532,
0.0996499881,
0.2031762302,
-0.2700675726,
0.1751098186,
0.1986064315,
0.1831949502,
0.0721770003,
0.2444218248,
0.0410773568,
-0.2169225365,
-0.0434681773,
0.1895227879,
-0.3223092258,
0.1835825741,
-0.0219362471,
-0.0963081047,
-0.0567442141,
-0.0955540612,
0.1596498787,
-0.1057007015,
0.2242293656,
0.1842167079,
-0.0698262975,
-0.1372910738,
-0.2968896627,
-0.4947131574,
0.1266512126,
0.058674302,
-0.1929430068,
-0.0974276662,
0.2545589507,
0.1445434988,
-0.0740211979,
0.0113141285,
-0.1953834146,
0.0658581853,
-0.047768198,
-0.2914222181,
0.0688738972,
0.040769089,
0.2265986204,
0.1290671825,
-0.1045506299,
-0.2551735342,
-0.1046208441,
0.0858758762,
-0.0853229836,
-0.2774786055,
-0.0243856367,
0.1511464119,
0.2302409858,
0.0873777345,
0.4935258925,
-0.1358514875,
-0.2504101396,
-0.2734027803,
-0.1217619032,
-0.3229371011,
0.3654846251,
0.2327885777,
0.2945095599,
-0.1016467363,
-0.0075412812,
0.1279547215,
-0.1188657358,
0.2819199264,
0.1379444897,
-0.3423038423,
0.0486827865,
-0.0289282762,
-0.1913626194,
0.3845238686,
0.3300602436,
0.2339158058,
-0.0888853744,
-0.2191724628,
-0.3465104401,
0.4386175275,
0.13181445,
0.0666040927,
-0.163577795,
0.2013248056,
0.0277908444,
-0.1799485087,
-0.3909991384,
0.0589269102,
0.4154227972,
-0.0094551863,
-0.2802791297,
0.2262725234,
-0.0470428579,
-0.1045427173,
-0.0862362385,
-0.0681234375,
0.029842617,
-0.1870169789,
-0.1349452436,
-0.0159288589
] |
https://github.com/huggingface/datasets/issues/1755 | Using select/reordering datasets slows operations down immensely | Thanks for the input! I gave that a try by adding this after my selection / reordering operations, but before the big computation task of `score_squad`
```
examples = examples.flatten_indices()
features = features.flatten_indices()
```
That helped quite a bit! | I am using portions of HF's helpful work in preparing / scoring the SQuAD 2.0 data. The problem I have is that after using `select` to re-ordering the dataset, computations slow down immensely where the total scoring process on 131k training examples would take maybe 3 minutes, now take over an hour.
The below example should be reproducible and I have ran myself down this path because I want to use HF's scoring functions and helpful data preparation, but use my own trainer. The training process uses shuffle and therefore the order I trained on no longer matches the original data set order. So, to score my results correctly, the original data set needs to match the order of the training. This requires that I: (1) collect the index for each row of data emitted during training, and (2) use this index information to re-order the datasets correctly so the orders match when I go to score.
The problem is, the dataset class starts performing very poorly as soon as you start manipulating its order by immense magnitudes.
```
from datasets import load_dataset, load_metric
from transformers import BertTokenizerFast, BertForQuestionAnswering
from elasticsearch import Elasticsearch
import numpy as np
import collections
from tqdm.auto import tqdm
import torch
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
max_length = 384 # The maximum length of a feature (question and context)
doc_stride = 128 # The authorized overlap between two part of the context when splitting it is needed.
pad_on_right = tokenizer.padding_side == "right"
squad_v2 = True
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
def prepare_validation_features(examples):
# Tokenize our examples with truncation and maybe padding, but keep the overflows using a stride. This results
# in one example possible giving several features when a context is long, each of those features having a
# context that overlaps a bit the context of the previous feature.
tokenized_examples = tokenizer(
examples["question" if pad_on_right else "context"],
examples["context" if pad_on_right else "question"],
truncation="only_second" if pad_on_right else "only_first",
max_length=max_length,
stride=doc_stride,
return_overflowing_tokens=True,
return_offsets_mapping=True,
padding="max_length",
)
# Since one example might give us several features if it has a long context, we need a map from a feature to
# its corresponding example. This key gives us just that.
sample_mapping = tokenized_examples.pop("overflow_to_sample_mapping")
# We keep the example_id that gave us this feature and we will store the offset mappings.
tokenized_examples["example_id"] = []
for i in range(len(tokenized_examples["input_ids"])):
# Grab the sequence corresponding to that example (to know what is the context and what is the question).
sequence_ids = tokenized_examples.sequence_ids(i)
context_index = 1 if pad_on_right else 0
# One example can give several spans, this is the index of the example containing this span of text.
sample_index = sample_mapping[i]
tokenized_examples["example_id"].append(examples["id"][sample_index])
# Set to None the offset_mapping that are not part of the context so it's easy to determine if a token
# position is part of the context or not.
tokenized_examples["offset_mapping"][i] = [
(list(o) if sequence_ids[k] == context_index else None)
for k, o in enumerate(tokenized_examples["offset_mapping"][i])
]
return tokenized_examples
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
def postprocess_qa_predictions(examples, features, starting_logits, ending_logits, n_best_size = 20, max_answer_length = 30):
all_start_logits, all_end_logits = starting_logits, ending_logits
# Build a map example to its corresponding features.
example_id_to_index = {k: i for i, k in enumerate(examples["id"])}
features_per_example = collections.defaultdict(list)
for i, feature in enumerate(features):
features_per_example[example_id_to_index[feature["example_id"]]].append(i)
# The dictionaries we have to fill.
predictions = collections.OrderedDict()
# Logging.
print(f"Post-processing {len(examples)} example predictions split into {len(features)} features.")
# Let's loop over all the examples!
for example_index, example in enumerate(tqdm(examples)):
# Those are the indices of the features associated to the current example.
feature_indices = features_per_example[example_index]
min_null_score = None # Only used if squad_v2 is True.
valid_answers = []
context = example["context"]
# Looping through all the features associated to the current example.
for feature_index in feature_indices:
# We grab the predictions of the model for this feature.
start_logits = all_start_logits[feature_index]
end_logits = all_end_logits[feature_index]
# This is what will allow us to map some the positions in our logits to span of texts in the original
# context.
offset_mapping = features[feature_index]["offset_mapping"]
# Update minimum null prediction.
cls_index = features[feature_index]["input_ids"].index(tokenizer.cls_token_id)
feature_null_score = start_logits[cls_index] + end_logits[cls_index]
if min_null_score is None or min_null_score < feature_null_score:
min_null_score = feature_null_score
# Go through all possibilities for the `n_best_size` greater start and end logits.
start_indexes = np.argsort(start_logits)[-1 : -n_best_size - 1 : -1].tolist()
end_indexes = np.argsort(end_logits)[-1 : -n_best_size - 1 : -1].tolist()
for start_index in start_indexes:
for end_index in end_indexes:
# Don't consider out-of-scope answers, either because the indices are out of bounds or correspond
# to part of the input_ids that are not in the context.
if (
start_index >= len(offset_mapping)
or end_index >= len(offset_mapping)
or offset_mapping[start_index] is None
or offset_mapping[end_index] is None
):
continue
# Don't consider answers with a length that is either < 0 or > max_answer_length.
if end_index < start_index or end_index - start_index + 1 > max_answer_length:
continue
start_char = offset_mapping[start_index][0]
end_char = offset_mapping[end_index][1]
valid_answers.append(
{
"score": start_logits[start_index] + end_logits[end_index],
"text": context[start_char: end_char]
}
)
if len(valid_answers) > 0:
best_answer = sorted(valid_answers, key=lambda x: x["score"], reverse=True)[0]
else:
# In the very rare edge case we have not a single non-null prediction, we create a fake prediction to avoid
# failure.
best_answer = {"text": "", "score": 0.0}
# Let's pick our final answer: the best one or the null answer (only for squad_v2)
if not squad_v2:
predictions[example["id"]] = best_answer["text"]
else:
answer = best_answer["text"] if best_answer["score"] > min_null_score else ""
predictions[example["id"]] = answer
return predictions
# build base examples, features from training data
examples = load_dataset("squad_v2").shuffle(seed=5)['train']
features = load_dataset("squad_v2").shuffle(seed=5)['train'].map(
prepare_validation_features,
batched=True,
remove_columns=['answers', 'context', 'id', 'question', 'title'])
# sim some shuffled training indices that we want to use to re-order the data to compare how we did
shuffle_idx = np.arange(0, 131754)
np.random.shuffle(shuffle_idx)
# create a new dataset with rows selected following the training shuffle
features = features.select(indices=shuffle_idx)
# get unique example ids to match with the "example" data
id_list = list(dict.fromkeys(features['example_id']))
# now search for their index positions; load elastic search
es = Elasticsearch([{'host': 'localhost'}]).ping()
# add an index to the id column for the examples
examples.add_elasticsearch_index(column='id')
# search the examples for their index position
example_idx = [examples.search(index_name='id', query=i, k=1).indices for i in id_list]
# drop the elastic search
examples.drop_index(index_name='id')
# put examples in the right order
examples = examples.select(indices=example_idx)
# generate some fake data
logits = {'starting_logits': torch.randn(131754, 384), 'ending_logits': torch.randn(131754, 384)}
def score_squad(logits, n_best_size, max_answer):
# proceed with QA calculation
final_predictions = postprocess_qa_predictions(examples=examples,
features=features,
starting_logits=logits['starting_logits'],
ending_logits=logits['ending_logits'],
n_best_size=20,
max_answer_length=30)
metric = load_metric("squad_v2")
formatted_predictions = [{"id": k, "prediction_text": v, "no_answer_probability": 0.0} for k, v in final_predictions.items()]
references = [{"id": ex["id"], "answers": ex["answers"]} for ex in examples]
metrics = metric.compute(predictions=formatted_predictions, references=references)
return metrics
metrics = score_squad(logits, n_best_size=20, max_answer=30)
```
| 39 | Using select/reordering datasets slows operations down immensely
I am using portions of HF's helpful work in preparing / scoring the SQuAD 2.0 data. The problem I have is that after using `select` to re-ordering the dataset, computations slow down immensely where the total scoring process on 131k training examples would take maybe 3 minutes, now take over an hour.
The below example should be reproducible and I have ran myself down this path because I want to use HF's scoring functions and helpful data preparation, but use my own trainer. The training process uses shuffle and therefore the order I trained on no longer matches the original data set order. So, to score my results correctly, the original data set needs to match the order of the training. This requires that I: (1) collect the index for each row of data emitted during training, and (2) use this index information to re-order the datasets correctly so the orders match when I go to score.
The problem is, the dataset class starts performing very poorly as soon as you start manipulating its order by immense magnitudes.
```
from datasets import load_dataset, load_metric
from transformers import BertTokenizerFast, BertForQuestionAnswering
from elasticsearch import Elasticsearch
import numpy as np
import collections
from tqdm.auto import tqdm
import torch
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
max_length = 384 # The maximum length of a feature (question and context)
doc_stride = 128 # The authorized overlap between two part of the context when splitting it is needed.
pad_on_right = tokenizer.padding_side == "right"
squad_v2 = True
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
def prepare_validation_features(examples):
# Tokenize our examples with truncation and maybe padding, but keep the overflows using a stride. This results
# in one example possible giving several features when a context is long, each of those features having a
# context that overlaps a bit the context of the previous feature.
tokenized_examples = tokenizer(
examples["question" if pad_on_right else "context"],
examples["context" if pad_on_right else "question"],
truncation="only_second" if pad_on_right else "only_first",
max_length=max_length,
stride=doc_stride,
return_overflowing_tokens=True,
return_offsets_mapping=True,
padding="max_length",
)
# Since one example might give us several features if it has a long context, we need a map from a feature to
# its corresponding example. This key gives us just that.
sample_mapping = tokenized_examples.pop("overflow_to_sample_mapping")
# We keep the example_id that gave us this feature and we will store the offset mappings.
tokenized_examples["example_id"] = []
for i in range(len(tokenized_examples["input_ids"])):
# Grab the sequence corresponding to that example (to know what is the context and what is the question).
sequence_ids = tokenized_examples.sequence_ids(i)
context_index = 1 if pad_on_right else 0
# One example can give several spans, this is the index of the example containing this span of text.
sample_index = sample_mapping[i]
tokenized_examples["example_id"].append(examples["id"][sample_index])
# Set to None the offset_mapping that are not part of the context so it's easy to determine if a token
# position is part of the context or not.
tokenized_examples["offset_mapping"][i] = [
(list(o) if sequence_ids[k] == context_index else None)
for k, o in enumerate(tokenized_examples["offset_mapping"][i])
]
return tokenized_examples
# from https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb#scrollTo=941LPhDWeYv-
def postprocess_qa_predictions(examples, features, starting_logits, ending_logits, n_best_size = 20, max_answer_length = 30):
all_start_logits, all_end_logits = starting_logits, ending_logits
# Build a map example to its corresponding features.
example_id_to_index = {k: i for i, k in enumerate(examples["id"])}
features_per_example = collections.defaultdict(list)
for i, feature in enumerate(features):
features_per_example[example_id_to_index[feature["example_id"]]].append(i)
# The dictionaries we have to fill.
predictions = collections.OrderedDict()
# Logging.
print(f"Post-processing {len(examples)} example predictions split into {len(features)} features.")
# Let's loop over all the examples!
for example_index, example in enumerate(tqdm(examples)):
# Those are the indices of the features associated to the current example.
feature_indices = features_per_example[example_index]
min_null_score = None # Only used if squad_v2 is True.
valid_answers = []
context = example["context"]
# Looping through all the features associated to the current example.
for feature_index in feature_indices:
# We grab the predictions of the model for this feature.
start_logits = all_start_logits[feature_index]
end_logits = all_end_logits[feature_index]
# This is what will allow us to map some the positions in our logits to span of texts in the original
# context.
offset_mapping = features[feature_index]["offset_mapping"]
# Update minimum null prediction.
cls_index = features[feature_index]["input_ids"].index(tokenizer.cls_token_id)
feature_null_score = start_logits[cls_index] + end_logits[cls_index]
if min_null_score is None or min_null_score < feature_null_score:
min_null_score = feature_null_score
# Go through all possibilities for the `n_best_size` greater start and end logits.
start_indexes = np.argsort(start_logits)[-1 : -n_best_size - 1 : -1].tolist()
end_indexes = np.argsort(end_logits)[-1 : -n_best_size - 1 : -1].tolist()
for start_index in start_indexes:
for end_index in end_indexes:
# Don't consider out-of-scope answers, either because the indices are out of bounds or correspond
# to part of the input_ids that are not in the context.
if (
start_index >= len(offset_mapping)
or end_index >= len(offset_mapping)
or offset_mapping[start_index] is None
or offset_mapping[end_index] is None
):
continue
# Don't consider answers with a length that is either < 0 or > max_answer_length.
if end_index < start_index or end_index - start_index + 1 > max_answer_length:
continue
start_char = offset_mapping[start_index][0]
end_char = offset_mapping[end_index][1]
valid_answers.append(
{
"score": start_logits[start_index] + end_logits[end_index],
"text": context[start_char: end_char]
}
)
if len(valid_answers) > 0:
best_answer = sorted(valid_answers, key=lambda x: x["score"], reverse=True)[0]
else:
# In the very rare edge case we have not a single non-null prediction, we create a fake prediction to avoid
# failure.
best_answer = {"text": "", "score": 0.0}
# Let's pick our final answer: the best one or the null answer (only for squad_v2)
if not squad_v2:
predictions[example["id"]] = best_answer["text"]
else:
answer = best_answer["text"] if best_answer["score"] > min_null_score else ""
predictions[example["id"]] = answer
return predictions
# build base examples, features from training data
examples = load_dataset("squad_v2").shuffle(seed=5)['train']
features = load_dataset("squad_v2").shuffle(seed=5)['train'].map(
prepare_validation_features,
batched=True,
remove_columns=['answers', 'context', 'id', 'question', 'title'])
# sim some shuffled training indices that we want to use to re-order the data to compare how we did
shuffle_idx = np.arange(0, 131754)
np.random.shuffle(shuffle_idx)
# create a new dataset with rows selected following the training shuffle
features = features.select(indices=shuffle_idx)
# get unique example ids to match with the "example" data
id_list = list(dict.fromkeys(features['example_id']))
# now search for their index positions; load elastic search
es = Elasticsearch([{'host': 'localhost'}]).ping()
# add an index to the id column for the examples
examples.add_elasticsearch_index(column='id')
# search the examples for their index position
example_idx = [examples.search(index_name='id', query=i, k=1).indices for i in id_list]
# drop the elastic search
examples.drop_index(index_name='id')
# put examples in the right order
examples = examples.select(indices=example_idx)
# generate some fake data
logits = {'starting_logits': torch.randn(131754, 384), 'ending_logits': torch.randn(131754, 384)}
def score_squad(logits, n_best_size, max_answer):
# proceed with QA calculation
final_predictions = postprocess_qa_predictions(examples=examples,
features=features,
starting_logits=logits['starting_logits'],
ending_logits=logits['ending_logits'],
n_best_size=20,
max_answer_length=30)
metric = load_metric("squad_v2")
formatted_predictions = [{"id": k, "prediction_text": v, "no_answer_probability": 0.0} for k, v in final_predictions.items()]
references = [{"id": ex["id"], "answers": ex["answers"]} for ex in examples]
metrics = metric.compute(predictions=formatted_predictions, references=references)
return metrics
metrics = score_squad(logits, n_best_size=20, max_answer=30)
```
Thanks for the input! I gave that a try by adding this after my selection / reordering operations, but before the big computation task of `score_squad`
```
examples = examples.flatten_indices()
features = features.flatten_indices()
```
That helped quite a bit! | [
-0.2229693085,
0.2477028668,
-0.0138684902,
-0.1000716537,
-0.0033287662,
-0.1465101242,
-0.0916016847,
0.1460768282,
-0.3497592509,
0.1094218791,
-0.2728038132,
0.3873888552,
0.2126541138,
-0.1992181987,
-0.0613099448,
-0.0526455604,
-0.1135228574,
0.0000032496,
-0.0314249583,
-0.0937863514,
-0.1005086154,
-0.348492682,
-0.3477398157,
-0.1455437988,
-0.221824795,
-0.1603694856,
0.0549748577,
0.3512457013,
-0.1260464191,
-0.3404075503,
0.0977791473,
0.5284632444,
-0.0601432361,
0.3460885882,
-0.0001203739,
-0.1140628681,
-0.3013567328,
-0.0590986907,
-0.4936902821,
0.0832122937,
-0.0697160214,
-0.0438397527,
-0.1616152823,
0.0779752061,
-0.121685721,
-0.1129818112,
-0.0549109317,
-0.3639617264,
0.4560748041,
-0.0008518379,
0.1208518744,
0.2204818726,
-0.5714426637,
-0.2556706965,
0.1670393795,
0.0162417386,
-0.0953833759,
-0.0365808755,
0.418320626,
0.1212784946,
-0.1140873432,
0.3431174159,
-0.0950436369,
-0.1506790668,
0.2451232523,
0.1294504851,
-0.2699117661,
0.1256275028,
0.0051747751,
0.0222796053,
0.202670604,
-0.1132046357,
-0.5826926231,
-0.3719269037,
0.3417559564,
-0.0127385454,
0.2049165964,
-0.2810360193,
0.4607772231,
-0.0416239873,
-0.3063011765,
0.2016854137,
0.0358904786,
0.0214371365,
0.1613188833,
0.2261900753,
0.0236476753,
-0.0106986081,
-0.0192315951,
-0.1237981692,
0.1931626648,
-0.1877471358,
0.0458309427,
0.3385603428,
-0.4851061702,
-0.2102173269,
-0.1109892651,
-0.2480470389,
0.0309245605,
0.1953477114,
0.0991410166,
0.4193669856,
0.0793584809,
-0.310554862,
0.1926968843,
0.2943912745,
-0.0932464451,
0.3354052007,
0.0661655739,
-0.055829566,
-0.0670940578,
-0.0272623803,
0.0575198047,
-0.3548845947,
-0.1153058037,
0.0621314794,
-0.4168903828,
-0.139667362,
-0.4675750732,
0.0101277092,
-0.2367886603,
0.0264243502,
0.3597140312,
0.3569376767,
-0.1339117289,
-0.1230954751,
0.0204744004,
0.1510912627,
-0.3827778101,
0.1194276959,
-0.1549316496,
-0.18075113,
-0.1282603741,
0.4981128871,
0.0682009086,
0.010568575,
-0.0445274338,
0.1479118913,
0.6504567862,
0.1346221715,
0.1789737791,
-0.062560223,
0.304941684,
0.1330020726,
-0.164421007,
0.0284396447,
-0.0693842992,
-0.0828602016,
-0.2640684545,
0.24049595,
-0.4224530756,
-0.1730777472,
0.2738601267,
0.1426496506,
0.0532415211,
-0.1324371397,
-0.0261702836,
0.1152576804,
0.0700726137,
-0.3271813989,
0.0334455334,
-0.2640087306,
0.0580386743,
0.0417542495,
0.1055180579,
0.2644105256,
-0.466219455,
-0.0805212334,
0.0947198495,
0.564375937,
0.2235654891,
0.3344967067,
-0.2951168716,
0.0774920434,
0.0623125695,
0.2190617025,
0.4485760629,
-0.168210119,
-0.4064478278,
0.0793168247,
-0.333314985,
0.1301807016,
0.1100044101,
0.2987500727,
0.4087423086,
-0.1437914521,
-0.0917465612,
0.2847902179,
0.0783124641,
-0.0005595387,
-0.2430838048,
-0.1494387984,
-0.1460277587,
0.2493929416,
-0.0854728967,
0.0004535677,
0.0658754036,
0.2544439733,
0.0936772972,
-0.2124374211,
-0.1569136232,
0.1440962851,
-0.0487084873,
0.2361468375,
0.009082431,
-0.2017505318,
-0.2624254227,
0.2542324662,
-0.148253575,
-0.0874455124,
0.1352853775,
-0.2490596324,
-0.267416209,
-0.2243237644,
-0.3613670766,
-0.0841279551,
-0.0326934457,
-0.0000496973,
0.2648528814,
-0.374301374,
-0.1358236521,
0.2545202672,
-0.2980072498,
0.1125549302,
0.1867351085,
0.3353075981,
0.0942643806,
-0.0836714506,
-0.1753813922,
0.2231800705,
0.0413800664,
-0.0102595827,
-0.0425318405,
0.4816074967,
-0.0305586141,
-0.2010593116,
0.3003449142,
0.1919037998,
0.1189255714,
-0.0048330426,
0.1848537624,
-0.0567656718,
-0.1038586423,
-0.0857223943,
-0.411277771,
0.7307938933,
-0.6390334368,
0.3906634748,
-0.00818907,
-0.3914916813,
-0.1364451796,
0.2339701355,
-0.0671848282,
0.028089473,
0.1946615875,
0.0692242533,
0.3068404496,
0.0219235886,
-0.170894295,
0.1148178801,
0.3807361126,
0.1116099134,
-0.1161913648,
0.0593312532,
0.1933868825,
0.0581157394,
-0.1526626498,
-0.4381037056,
0.2674152851,
0.21447514,
-0.0098129231,
-0.0738034546,
-0.0876859874,
-0.0899259448,
-0.0617197603,
-0.0451001003,
-0.0257451497,
0.3969434798,
0.3169578314,
0.2558147013,
-0.2715597153,
-0.0461909361,
0.0497649834,
-0.0269540101,
-0.3187943399,
0.3653790653,
-0.2655485272,
0.3262255788,
-0.0995716304,
0.099532865,
-0.2339484841,
-0.1894763112,
0.2998906672,
-0.0532458015,
0.0420345701,
0.228046298,
0.0082484605,
0.2510021925,
0.1936222464,
-0.4015030861,
0.0486459658,
0.1283147484,
-0.0853394046,
-0.0386847816,
0.1792995781,
0.2340385169,
0.2996414602,
0.1631268561,
-0.2064592689,
-0.0706808642,
-0.3488855362,
-0.0585123338,
0.0901510715,
0.1498828828,
-0.094786562,
-0.1986876726,
-0.5059827566,
-0.3361071348,
-0.0967884883,
0.1074075326,
-0.1892311722,
0.0047535677,
-0.2101002336,
0.069036819,
0.1734791547,
-0.4781152606,
0.0168379527,
0.0162554905,
0.034449406,
0.0098378258,
0.0669544712,
0.1476115584,
-0.1610151082,
-0.1116628572,
-0.1796434075,
0.088068448,
-0.3538635671,
-0.2686768472,
0.2319983244,
-0.1055770591,
-0.0082862498,
-0.4196909368,
-0.0765762925,
-0.5765685439,
0.2538778186,
0.0160378702,
-0.1266465783,
-0.0915807784,
-0.0984587744,
-0.3653621078,
0.2959348559,
0.3322467208,
-0.2109396309,
0.0321388133,
0.1102817357,
-0.0774026066,
0.062342912,
0.5486826301,
0.0462286137,
-0.4003956616,
0.1239525601,
0.1109856889,
1.1333423853,
-0.0141808102,
0.111445792,
-0.0653474629,
0.1698570251,
0.0690060556,
-0.349622339,
-0.1672000587,
0.2396912426,
-0.0060797734,
0.0631311536,
0.3585752547,
0.0024384563,
0.2197258174,
0.3613544703,
0.4713774323,
-0.1210380942,
-0.1453611255,
0.1049262583,
0.1241665184,
0.1314240694,
0.2344908714,
0.3305244744,
-0.2545458376,
-0.1899586171,
-0.0217923764,
-0.2138456255,
0.2415393442,
-0.1783572286,
-0.4820561111,
0.0176173206,
-0.088734597,
0.1038672626,
0.1211589798,
0.0310364272,
0.306571722,
-0.0894948989,
0.4382133782,
-0.1552443951,
0.6033061743,
0.0103275822,
-0.0748457462,
0.2094708979,
-0.3021302223,
0.0317639075,
-0.0028446584,
-0.3103165925,
0.1381147802,
0.0280376095,
0.2992951274,
-0.3955968618,
-0.1468598545,
0.2374913096,
0.0136859817,
0.0182700157,
0.0168009344,
-0.1574246883,
0.0457495041,
0.0769337416,
0.4116093218,
-0.276858598,
0.1689109504,
0.0499897264,
0.1534058303,
-0.2058270723,
0.0772600994,
0.1089903712,
0.0978837684,
0.2320630848,
0.3968158364,
0.2968210578,
0.5759823322,
-0.0820014775,
0.2667079568,
0.365435034,
-0.0405630246,
-0.0320805125,
0.1777070314,
0.0213753898,
0.1245085821,
0.7451148629,
0.1889924854,
0.1802194268,
-0.009155402,
0.3382089138,
-0.2709102333,
-0.0570231304,
0.3755313158,
-0.1951372921,
-0.1541287154,
-0.2498484701,
0.3288460672,
0.0089339558,
-0.0365887582,
-0.1135577336,
0.5571148992,
-0.1169481501,
0.3699226081,
0.6643728018,
1.1539641619,
-0.3158581257,
0.2839170098,
0.0857242122,
-0.0627597347,
0.2783317864,
-0.4572000504,
0.3110566437,
-0.3608015776,
-0.5183973908,
0.1271019131,
-0.2768593132,
0.1780617088,
0.3513541818,
0.048725117,
0.2352937013,
-0.3827721179,
0.0779593363,
-0.3664310277,
0.2086067647,
0.1052867547,
-0.5642211437,
-0.0995807722,
0.034208294,
0.0851490572,
-0.1615061015,
-0.1026570946,
0.1778128445,
-0.0776006356,
0.2319291681,
-0.0566127077,
-0.1408684701,
-0.3118818998,
-0.0234600082,
-0.0495736487,
-0.3439305127,
0.6047797203,
-0.0415185578,
0.177450642,
0.1372202933,
0.2033916563,
0.1746312231,
0.1708432436,
0.4651061893,
0.456569761,
-0.1060808823,
0.0508965515,
0.1657199413,
0.1711340696,
-0.1148242056,
0.1943955272,
-0.4318303764,
-0.3854593635,
0.115066044,
0.0980383679,
-0.194683224,
-0.0203520693,
0.2804599702,
0.1253671646,
-0.2001908422,
0.0503735617,
0.0382371321,
-0.0283565372,
0.5486469269,
0.163539499,
-0.251838237,
-0.2608957887,
0.6345751286,
0.096552223,
-0.0834740549,
0.4297217131,
-0.048774749,
-0.3911807537,
-0.1019709334,
0.2128719389,
0.2624302506,
-0.3412109315,
-0.0872749165,
-0.1879288405,
-0.2794424593,
0.1587750167,
0.2018288821,
0.1933792382,
-0.0701100975,
-0.2999262214,
0.1244064718,
0.3185898662,
0.0201227348,
0.6046159267,
0.0398606956,
-0.3336847723,
0.2227035016,
-0.5289216638,
0.356367141,
-0.261619091,
-0.1069981381,
-0.2482592613,
0.2899229228,
-0.5045489073,
-0.1483783424,
0.2586855292,
-0.1163727194,
0.0048724473,
-0.0601767227,
-0.1983084679,
-0.144825235,
-0.1970013231,
0.0980263054,
-0.1997063607,
0.1243185624,
-0.0188036188,
-0.2507639527,
-0.270480454,
-0.4096263647,
0.2014549971,
0.3396629691,
0.2517516911,
-0.0794487968,
0.201529935,
-0.2823913395,
0.1224731281,
-0.0024229542,
0.1681147069,
-0.1667633802,
0.041164346,
0.2453431636,
-0.1037379429,
-0.1357138455,
-0.0697520301,
0.2789189517,
0.5007076859,
0.0211993791,
0.2153328061,
-0.2984634638,
-0.0545404218,
0.4007713497,
0.4186483324,
0.6963024139,
0.296982795,
-0.6313234568,
0.089222163,
0.0435881838,
-0.062851876,
-0.3881578445,
0.0211629532,
-0.1007334217,
0.0100009842,
0.1811840534,
-0.1866114289,
0.3341408372,
0.1153282672,
0.1421733648,
-0.0810375437,
-0.0633161366,
0.1096310914,
0.2210964113,
0.2158700079,
-0.1135801449,
0.3845515549,
-0.1954143196,
0.1096798629,
0.0798890665,
0.1793092042,
0.4664365947,
-0.041129984,
0.3082846105,
-0.308021903,
-0.2969993055,
-0.2421711087,
0.444257915,
0.1990971118,
-0.0469323695,
0.0693909675,
0.1385659128,
-0.066620186,
-0.5457811952,
-0.0916194916,
0.1064576656,
-0.0849103853,
-0.1199189499,
-0.0566291995,
-0.1938598603,
-0.1650537401,
-0.1094782054,
-0.3108011782,
0.1294759512,
0.039264001,
-0.1247129217,
0.4548838735,
-0.3548501134,
-0.0778771862,
-0.2523678243,
0.3607307971,
-0.175051868,
-0.0198753402,
-0.0690099299,
0.3045783639,
0.3067367971,
0.0552976206,
-0.174099043,
0.1050490886,
-0.3952314258,
-0.0766806826,
-0.0727442205,
0.0688729733,
0.256072551,
-0.0455826074,
-0.2837683558,
-0.3933630884,
0.4206234813,
-0.0183734968,
-0.1651882082,
-0.6061074138,
0.2266856581,
0.0555942208,
-0.2718514204,
0.0316606201,
0.2860609889,
0.0470650643,
0.4065903127,
-0.0323084816,
0.0613483004,
-0.0003614112,
-0.2930675149,
-0.1541665494,
0.0500854738,
0.2389614135,
0.0626749769,
0.1489727646,
0.5292368531,
0.1847599894,
-0.0745073557,
-0.3575541079,
0.0056568705,
-0.5157694221,
-0.0746012703,
-0.0146508813,
0.051974535,
0.4381354749,
0.475474894,
0.1372814029,
0.0549254529,
0.129278481,
-0.594335258,
0.0565181486,
0.0893722102,
-0.1599141359,
-0.0063516651,
-0.2795808017,
-0.0928773656,
-0.2524856925,
-0.2728766501,
0.110064365,
0.3300589025,
-0.0536875948,
0.1298535317,
0.0280911084,
0.0561371408,
0.2114116251,
0.0452305563,
-0.0933141559,
-0.0210879557,
0.0484021902,
0.1092743427,
0.1135339439,
-0.213820383,
-0.2178073972,
0.0998912752,
-0.2642329335,
0.3201898932,
-0.1137271449,
-0.1714499444,
-0.1460871994,
0.1175536588,
-0.0223566052,
0.1953673214,
-0.5066772103,
0.1262381822,
0.1293937862,
0.5172361732,
-0.2342355549,
0.4483050406,
0.0020682535,
0.4348350763,
-0.2447373718,
-0.053066384,
0.4661417603,
0.0571617186,
-0.1567381322,
-0.0178664867,
0.3398122787,
0.2781736255,
0.0795371979,
0.1954001933,
-0.100785926,
0.303578496,
-0.093135938,
-0.0184628852,
0.1331178546,
-0.054318063,
-0.1423794478,
-0.2693758011,
-0.0274894927,
-0.0685163885,
-0.1467157453,
-0.2096290737,
-0.2694699168
] |
https://github.com/huggingface/datasets/issues/1747 | datasets slicing with seed | Hi :)
The slicing API from https://huggingface.co/docs/datasets/splits.html doesn't shuffle the data.
You can shuffle and then take a subset of your dataset with
```python
# shuffle and take the first 100 examples
dataset = dataset.shuffle(seed=42).select(range(100))
```
You can find more information about shuffling and selecting rows in the documentation: https://huggingface.co/docs/datasets/processing.html#selecting-sorting-shuffling-splitting-rows | Hi
I need to slice a dataset with random seed, I looked into documentation here https://huggingface.co/docs/datasets/splits.html
I could not find a seed option, could you assist me please how I can get a slice for different seeds?
thank you.
@lhoestq | 50 | datasets slicing with seed
Hi
I need to slice a dataset with random seed, I looked into documentation here https://huggingface.co/docs/datasets/splits.html
I could not find a seed option, could you assist me please how I can get a slice for different seeds?
thank you.
@lhoestq
Hi :)
The slicing API from https://huggingface.co/docs/datasets/splits.html doesn't shuffle the data.
You can shuffle and then take a subset of your dataset with
```python
# shuffle and take the first 100 examples
dataset = dataset.shuffle(seed=42).select(range(100))
```
You can find more information about shuffling and selecting rows in the documentation: https://huggingface.co/docs/datasets/processing.html#selecting-sorting-shuffling-splitting-rows | [
0.0095473081,
-0.6955251694,
-0.1016980335,
0.1060838029,
0.2887976468,
-0.0554465577,
0.0833857134,
0.063473843,
-0.1392816305,
0.6284064651,
-0.0467902385,
0.0993471518,
-0.1830737144,
0.7351147532,
0.1561356932,
-0.3828530908,
0.123708643,
-0.2180429846,
0.3468201756,
-0.1670891643,
-0.1487395763,
-0.0430827513,
-0.2222317904,
-0.1483154595,
-0.2410772294,
-0.2185827941,
-0.1768478751,
0.1884933263,
-0.1170750111,
-0.0675892606,
-0.0007689384,
0.0190950725,
0.2182831019,
0.2653710842,
-0.0001224413,
-0.1700751483,
0.0218281485,
0.0203416795,
0.0527787022,
-0.0495619737,
-0.2632198036,
0.2918643355,
-0.1174257845,
-0.1212329343,
-0.4069699645,
-0.0068349834,
0.0658835471,
-0.1543093771,
0.0397257321,
-0.1973048896,
0.0544659309,
0.0421162024,
-0.0192038473,
-0.1066149026,
0.3257077336,
0.6462308764,
-0.0514414571,
-0.1793919355,
0.0944862142,
0.4545610249,
0.3125537038,
-0.0050212452,
0.1066772491,
0.1581705809,
0.0530147217,
0.089087382,
-0.391790837,
-0.4616827667,
0.0310131032,
0.4272669852,
0.4352067411,
0.0732967481,
-0.3272963464,
-0.2401064634,
-0.0137620755,
-0.3003648221,
-0.2683159411,
0.5809766054,
-0.1436819583,
-0.084544383,
-0.0431805179,
-0.0514529236,
-0.1303498447,
0.1159755886,
0.278624326,
0.6345120072,
-0.1247464046,
0.1643835157,
0.4493526816,
-0.062266849,
-0.078629829,
-0.0007801733,
-0.041215878,
0.2373901904,
0.0242678486,
-0.2484134138,
-0.4149947464,
0.7269174457,
0.4642120302,
0.1487488151,
-0.1918439716,
0.0850187987,
-0.0767041072,
-0.0869181752,
0.339769274,
-0.3440186083,
0.1506423801,
0.3478378356,
0.0303420704,
-0.0713102818,
0.1579863727,
0.0249993261,
0.1558551639,
0.1213514656,
-0.2965351343,
-0.2008726746,
-0.0705739558,
0.0100819152,
0.0192764737,
-0.5418999791,
-0.134182021,
-0.3639206588,
-0.0333028957,
0.204619661,
-0.0193076916,
-0.3753101826,
-0.2521541119,
0.0529923886,
-0.1427576393,
-0.385255605,
-0.275934875,
0.1075638682,
0.061752636,
0.0967911631,
-0.1246313006,
-0.2775679231,
0.1823153198,
0.1278391927,
0.1188353822,
-0.0221495926,
-0.3988851607,
0.2535948753,
-0.1487495452,
0.1161139682,
0.145652011,
-0.1353642642,
0.1568271369,
0.1440228522,
-0.1639461517,
-0.0276226085,
-0.1059764028,
-0.1007242426,
0.109610267,
-0.0228940398,
0.1034320816,
0.0206289664,
-0.5214861035,
0.28180632,
-0.160329476,
0.0818922594,
-0.0345448442,
0.2468313724,
-0.369951576,
-0.216103673,
0.3508657217,
0.0122974981,
-0.1378554702,
-0.3832708597,
0.0940630138,
0.0147687923,
0.3416872323,
0.3521432877,
-0.1484611332,
-0.1812334508,
-0.1329238713,
0.2817608118,
0.0835432857,
0.3524157703,
-0.1219633073,
0.1441714019,
-0.0311124977,
-0.1135111749,
0.1805297434,
0.1857648492,
0.1282108277,
0.0182742216,
-0.0982353315,
0.1557999104,
-0.400655061,
0.1039378941,
-0.1521549225,
-0.2310302407,
0.1609901041,
0.2237420827,
0.0479386821,
-0.0844173655,
0.2544508576,
-0.2822083831,
0.4949574769,
0.0642023012,
0.1098060384,
-0.0205257162,
0.1160776094,
0.3239252269,
0.0567648336,
-0.3433821201,
-0.1044877023,
0.0508573391,
0.0214896444,
-0.0372125693,
0.1731484681,
-0.2949849665,
-0.0790552124,
-0.0670875907,
-0.0073475097,
-0.0415526703,
-0.115839906,
-0.0344085321,
0.5063340068,
0.1177539155,
-0.1835812777,
-0.0488933623,
-0.1026113033,
0.1379623413,
-0.7429705858,
0.3961385787,
0.0598830581,
-0.2251467258,
0.0123453261,
-0.0442430228,
0.0640272871,
-0.1030633971,
0.0469687209,
0.3983739316,
0.2964778244,
-0.0860213935,
0.1261244714,
0.1368531883,
0.2491818219,
-0.2031773925,
0.0765058175,
-0.2056943178,
0.1138839871,
-0.0848918408,
-0.1547458917,
0.3523128927,
-0.4909170866,
0.0638663173,
-0.1260857582,
-0.1007661372,
-0.0347460173,
0.1185104772,
-0.1544189751,
-0.0178790949,
0.128422007,
-0.2224132419,
0.078767702,
-0.0738223419,
-0.5414639115,
0.115698427,
0.063287124,
-0.3731787503,
0.0503696725,
0.0907503441,
0.0763198733,
0.2655423582,
0.0472898632,
0.1305417866,
0.1447493583,
0.335288614,
0.1010303497,
-0.1944216788,
0.3914381266,
-0.1287427992,
0.0541450009,
0.1907893866,
-0.0312007982,
-0.1542371511,
-0.279114753,
-0.1743430793,
-0.0398008935,
0.2993862033,
-0.17209737,
0.1142059267,
-0.1102464497,
-0.2132909894,
-0.3585129976,
-0.035897214,
-0.1769142598,
-0.5306730866,
-0.2908897698,
-0.1259765029,
0.1057340503,
0.3068056405,
0.1082259715,
0.1551926136,
0.0926232561,
0.0965645164,
-0.1541960835,
0.4554953575,
-0.2244458348,
0.0699026436,
0.0342397578,
0.0505517051,
-0.0491163135,
0.6051309705,
0.2825825214,
-0.1961032897,
-0.2100270838,
-0.1335385293,
0.0447517037,
0.0280577876,
-0.2764393389,
0.6539117098,
0.3125837743,
0.2114893943,
-0.3241721988,
-0.1267127246,
0.3424210548,
-0.162231788,
0.0195053462,
-0.0833902359,
0.2167857736,
-0.1330221593,
0.251712054,
-0.0121232159,
-0.4640730321,
-0.0953937247,
0.230337128,
-0.0390127897,
-0.124697648,
-0.0943552852,
0.038382709,
-0.3634668887,
-0.0090795681,
-0.3386926353,
-0.0542812347,
-0.505566299,
0.0504828654,
-0.190212816,
-0.1662492454,
0.0919756293,
-0.0106832273,
-0.2968221307,
0.0837211683,
0.0697621107,
0.5544332862,
-0.09501037,
0.0956509486,
-0.1617534459,
0.1615987271,
0.5859103799,
-0.2568831444,
0.226647988,
-0.0340309814,
-0.0718515366,
-0.0921677649,
-0.3189781308,
0.2888513505,
0.3687153161,
0.3478618562,
-0.0704155043,
0.7969766259,
0.0661665797,
0.2158705592,
-0.0724333897,
-0.0264471527,
-0.0002842243,
0.054150112,
-0.306551367,
0.3096848726,
0.4177288115,
-0.332727015,
0.3756403923,
0.1726528257,
0.2435275018,
-0.0054202043,
-0.3924668729,
-0.1362072676,
-0.1476923376,
-0.0267192516,
0.108938165,
-0.0608603805,
-0.2926634848,
-0.1087172106,
-0.0969125554,
-0.0877781883,
-0.3429723084,
0.3228103518,
0.6068432927,
0.0465485454,
-0.533896625,
-0.3214607537,
-0.364589721,
0.1100879684,
0.370457083,
-0.1880291849,
-0.0531865619,
-0.1404212713,
0.4958545864,
0.2846362591,
0.8806205392,
-0.0834171325,
-0.1512144655,
-0.2613044083,
-0.3685556352,
-0.1362064183,
0.2458346933,
-0.1690739691,
-0.1273735166,
-0.087545462,
0.0294916946,
-0.5456349254,
-0.381264776,
0.2368129194,
0.0162884481,
-0.0401973724,
-0.1685616523,
-0.0815595984,
0.1758321822,
-0.0546017028,
0.1231884807,
0.0644008219,
0.044566907,
-0.13556768,
0.0218297299,
-0.0120064998,
-0.2656209469,
0.0618258119,
-0.1280233711,
0.1829461753,
0.1233972088,
0.077312991,
0.3261017501,
0.0946140289,
0.2468690574,
0.0424089544,
-0.0906761736,
-0.0603666641,
-0.1720471084,
0.0105895912,
0.4419590235,
0.0912346542,
0.0083019687,
0.079552047,
-0.0138763692,
0.2005521059,
-0.3427182436,
-0.3676576018,
0.2233266383,
-0.1688139588,
-0.3760849237,
-0.3293673098,
0.3520814776,
0.0732195377,
-0.1938610077,
0.5608248115,
0.4099504948,
-0.0569722168,
0.1035944819,
0.0406198539,
0.7752845287,
-0.0103727188,
-0.0919959918,
0.1127670556,
0.2219065875,
0.2127143443,
0.5584769845,
0.2137179524,
-0.3080766499,
-0.4992985129,
-0.2018874139,
0.1580109894,
0.0638273582,
0.1913168579,
-0.0572690703,
0.1850072891,
-0.0547648296,
-0.1005603448,
-0.3885395527,
-0.1939565986,
-0.2248801589,
-0.0032213975,
-0.1430078894,
-0.0336681381,
-0.2274882048,
0.2590165734,
0.0589293092,
0.1890159249,
-0.0609453991,
-0.2277987748,
-0.2339082658,
-0.0759948194,
-0.3006747365,
-0.1416206956,
0.0431924425,
-0.1364132166,
0.0026110176,
0.3202063739,
0.2756867409,
0.0858452916,
0.0137400907,
0.2838686407,
-0.0923783332,
-0.2239918858,
-0.2897009552,
0.2096969187,
0.0199787263,
0.1456448883,
-0.4162991345,
-0.1392608136,
0.0684591979,
-0.4474933743,
-0.8403383493,
0.0033898754,
0.1823559999,
-0.5605274439,
-0.1671975404,
-0.1617657542,
0.2584702075,
-0.0225806963,
-0.0110908924,
0.1377936602,
0.0547354743,
0.2562350333,
0.1947609484,
0.084973,
-0.2678751349,
0.2098755687,
0.087848112,
0.4105135798,
0.1986328363,
0.114910081,
-0.1642539799,
-0.1973211914,
0.5678087473,
0.1755660325,
0.0983543396,
0.0772538409,
0.0783282146,
0.3218280971,
0.140038684,
0.3459119797,
0.09773653,
-0.0591801144,
0.1046874449,
-0.3396754563,
0.0934100151,
0.3857949376,
0.1244161651,
0.3020278513,
0.1752880365,
0.2373278439,
-0.2597448528,
0.2616391778,
-0.1473516375,
0.2337993085,
0.2653440237,
0.0466202162,
0.1707776934,
0.3170278668,
0.3241882622,
0.1005757377,
0.0166592021,
0.0941781774,
0.1193484589,
0.0067498283,
-0.1122625023,
0.142274335,
-0.0904709399,
-0.027986791,
-0.0473504066,
-0.0587888546,
-0.1873567104,
-0.0922980905,
0.1419070661,
0.3153978586,
0.2707656622,
0.0861412287,
1.2160906792,
0.0939446837,
-0.1745876521,
0.32965675,
-0.153055504,
0.2653259933,
-0.1119082198,
-0.0509431772,
-0.0297368951,
-0.1117943898,
-0.1885168552,
0.0322830342,
0.5101651549,
0.0154174175,
0.1380628943,
0.0736907944,
-0.0157252755,
0.0804564804,
0.2490065694,
0.0058051865,
0.2402935177,
0.2699508369,
0.1849490106,
0.0672849491,
0.0092550283,
-0.2049557865,
0.0901462361,
0.2932854891,
0.0805140063,
0.5057784319,
-0.4518730342,
0.2890126109,
0.0591700561,
-0.0799055174,
0.4291380346,
-0.1815354973,
0.2624653876,
0.213427037,
-0.1114844754,
-0.3146132529,
0.04641046,
0.0968530029,
0.1788672358,
-0.0478866585,
-0.3192086518,
0.4151835144,
-0.4028056562,
-0.0699218586,
0.1929901093,
-0.1915124953,
-0.2740604281,
0.4229441583,
-0.1345814914,
0.1036739945,
0.0598587021,
0.5918383598,
-0.4613355696,
0.0373021588,
-0.1354267299,
0.4274471402,
0.2274971604,
-0.0788805559,
-0.4201159775,
-0.2546605766,
-0.0546233878,
-0.0765409172,
0.0722229034,
-0.1821108013,
0.4113157094,
0.084975265,
-0.004828833,
-0.2381500453,
-0.0982732847,
0.1170513853,
0.1821960211,
-0.0969474167,
0.0293954723,
-0.3142323494,
-0.0825219899,
0.419038415,
-0.019556215,
-0.0495142303,
-0.2980828583,
0.0816007406,
-0.1910801977,
-0.3140589595,
-0.1701981127,
0.1534586698,
0.2465095818,
-0.1668252051,
0.1121321619,
0.1433654875,
0.0645340681,
-0.0270922258,
-0.0833772346,
0.1351466775,
0.4787383378,
-0.4653787911,
0.2377958149,
-0.4024116099,
0.0649114251,
-0.1906552464,
-0.0835270211,
-0.2828077972,
0.4337541759,
-0.7622523308,
-0.3180724382,
-0.1321802586,
0.1753840744,
0.0179739539,
-0.0986810476,
0.2209618837,
0.1497927159,
-0.4015919864,
-0.1154053807,
-0.3428228199,
0.1860016584,
-0.2979774475,
-0.130638808,
-0.0382648483,
-0.0205508303,
-0.0626407862,
0.093358025,
-0.0205484647,
-0.037142925,
0.1172765195,
-0.0490413867,
0.5686758161,
0.0801251903,
-0.2503062487,
-0.3237128258,
0.2560370266,
0.0651098415,
0.0279080421,
0.07508751,
0.2733126879,
-0.2028953731,
-0.1034879908,
0.2581922114,
-0.0324738994,
-0.5140288472,
-0.1780578345,
0.287412256,
0.0611245856,
-0.1079596654,
-0.0091320127,
0.0712559745,
-0.1119282842,
-0.379003793,
0.277179569,
0.0665905774,
0.6011484861,
-0.03424545,
-0.4451889396,
-0.2468305081,
0.0783799663,
-0.1015954092,
0.1680880934,
0.0300932694,
0.2269435227,
-0.1531110853,
0.0279314183,
0.2849902213,
0.2729873061,
-0.2187120169,
0.0370074585,
0.3146006763,
-0.0239034388,
0.4214172661,
-0.3195386827,
0.0510876141,
-0.2341622114,
-0.1059206352,
0.1615005881,
-0.4090162814,
0.0091466038,
-0.0598210469,
0.1622522622,
0.1562794745,
0.4829615951,
0.0694245026,
0.332328707,
-0.2731134593,
0.1071470082,
0.5657522082,
0.3125080764,
-0.0431898274,
0.370121032,
-0.1503660232
] |
https://github.com/huggingface/datasets/issues/1747 | datasets slicing with seed | thank you so much
On Mon, Jan 18, 2021 at 3:17 PM Quentin Lhoest <[email protected]>
wrote:
> Hi :)
> The slicing API doesn't shuffle the data.
> You can shuffle and then take a subset of your dataset with
>
> # shuffle and take the first 100 examplesdataset = dataset.shuffle(seed=42).select(range(100))
>
> You can find more information about shuffling and selecting rows in the
> documentation:
> https://huggingface.co/docs/datasets/processing.html#selecting-sorting-shuffling-splitting-rows
>
> β
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/1747#issuecomment-762278134>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AM3GZM5D5MDPLJGI4IG3UADS2Q7GPANCNFSM4WHLOZJQ>
> .
>
| Hi
I need to slice a dataset with random seed, I looked into documentation here https://huggingface.co/docs/datasets/splits.html
I could not find a seed option, could you assist me please how I can get a slice for different seeds?
thank you.
@lhoestq | 103 | datasets slicing with seed
Hi
I need to slice a dataset with random seed, I looked into documentation here https://huggingface.co/docs/datasets/splits.html
I could not find a seed option, could you assist me please how I can get a slice for different seeds?
thank you.
@lhoestq
thank you so much
On Mon, Jan 18, 2021 at 3:17 PM Quentin Lhoest <[email protected]>
wrote:
> Hi :)
> The slicing API doesn't shuffle the data.
> You can shuffle and then take a subset of your dataset with
>
> # shuffle and take the first 100 examplesdataset = dataset.shuffle(seed=42).select(range(100))
>
> You can find more information about shuffling and selecting rows in the
> documentation:
> https://huggingface.co/docs/datasets/processing.html#selecting-sorting-shuffling-splitting-rows
>
> β
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/1747#issuecomment-762278134>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AM3GZM5D5MDPLJGI4IG3UADS2Q7GPANCNFSM4WHLOZJQ>
> .
>
| [
-0.0242704693,
-0.5800482631,
-0.1025026888,
0.0901766196,
0.3337328732,
-0.0313545354,
0.0862427354,
0.0778435618,
-0.1555907428,
0.6615403891,
-0.0357806534,
0.1159347147,
-0.1422756463,
0.6808799505,
0.1332577169,
-0.3228481412,
0.0889166296,
-0.1975935251,
0.2540715337,
-0.1492352039,
-0.0809885487,
-0.0049859188,
-0.1872227341,
-0.1387488395,
-0.2912376225,
-0.256000042,
-0.1710700691,
0.22264871,
-0.1419475228,
-0.0095596323,
0.0738407969,
0.05761794,
0.2052415013,
0.1588167697,
-0.000118139,
-0.1391045302,
0.0257984027,
0.0376941599,
0.0179533251,
-0.0529341027,
-0.2801007628,
0.3696418703,
-0.1711484492,
-0.1028148979,
-0.403396219,
0.039284125,
0.1133554876,
-0.2076660991,
0.0146944048,
-0.1915637702,
0.0985177383,
0.050631322,
0.0284840874,
-0.1905968785,
0.2813758254,
0.6558922529,
-0.0894709155,
-0.1163898408,
0.0631316751,
0.5073186755,
0.2269357145,
0.0002392552,
0.1760696173,
0.1714321524,
0.0334673896,
0.0956163704,
-0.3726252615,
-0.4360307753,
0.050883878,
0.4526304305,
0.4963740408,
0.107324563,
-0.3182220161,
-0.1937033236,
-0.001561731,
-0.298430562,
-0.234482348,
0.5080896616,
-0.112981461,
-0.0207736995,
-0.0342490412,
0.0239943247,
-0.1083313525,
0.096086897,
0.3298546672,
0.455276221,
-0.1264501363,
0.1400951743,
0.4577618241,
-0.0861061737,
-0.0909514651,
0.0599519201,
-0.1416311115,
0.2137377113,
-0.0388237946,
-0.2371639013,
-0.3499300182,
0.7325927019,
0.5226101279,
0.1343271732,
-0.1152154729,
0.1385986954,
-0.075108178,
-0.1247149855,
0.3147116899,
-0.3212523758,
0.1867844015,
0.2914988995,
-0.0277671516,
-0.0767464563,
0.1510375738,
0.0350166857,
0.165556848,
0.1850874126,
-0.3834688067,
-0.1994808763,
-0.0857706144,
-0.0148035949,
-0.0018438047,
-0.5842659473,
-0.1403474957,
-0.3088259995,
-0.0198215619,
0.191083625,
0.0416997299,
-0.4040729105,
-0.2972895503,
-0.0018221557,
-0.1055935547,
-0.4199669659,
-0.329048574,
0.1051819995,
0.0158045944,
0.1110039577,
-0.0712980479,
-0.301440239,
0.1724162996,
0.1104670316,
0.1535440981,
0.0028021329,
-0.4736950696,
0.234803766,
-0.1354741603,
0.1330886632,
0.1170670986,
-0.1257555932,
0.1066310406,
0.130778864,
-0.1033919752,
-0.0394006483,
-0.1314307153,
-0.0652165338,
0.1241779849,
0.012737372,
0.0695368424,
0.0033156467,
-0.4873549342,
0.311891675,
-0.2089269757,
0.0477045774,
-0.0773765966,
0.3150745034,
-0.3417729437,
-0.2146974802,
0.3613391221,
0.0137942908,
-0.2427796721,
-0.3567778766,
0.0290713068,
0.0296071954,
0.3583237231,
0.3538287878,
-0.1359317452,
-0.2312394232,
-0.1669854522,
0.3993637562,
0.0080511961,
0.3812057972,
-0.1486323327,
0.1341966093,
-0.1041429192,
-0.1667920947,
0.1973544657,
0.1176742017,
0.1574714631,
-0.0099300444,
-0.0779608041,
0.0508330241,
-0.3968101442,
0.0489629023,
-0.1658020616,
-0.2540096045,
0.0554117635,
0.2026690394,
0.0343659855,
-0.0920497924,
0.2964073718,
-0.2191880196,
0.4803550243,
0.0400295295,
0.1040020362,
0.0423702337,
0.1516967863,
0.2454889566,
0.03787072,
-0.2893223166,
-0.150935486,
0.0731014833,
0.0028934933,
-0.0156619325,
0.2078373432,
-0.2937503457,
-0.0610112324,
-0.0298587363,
0.0571584366,
-0.0456085429,
-0.0513974838,
0.0000222234,
0.4871122539,
0.102358669,
-0.1233882979,
-0.0375186205,
-0.1614746153,
0.0974079147,
-0.7664040327,
0.3914410472,
0.038875103,
-0.2232469618,
0.0756952167,
-0.0344888531,
0.0620722286,
-0.1102514416,
0.0592328496,
0.3625946939,
0.2247781456,
-0.0178071223,
0.1429626942,
0.1382008344,
0.2544496655,
-0.1579789966,
0.0077885739,
-0.2979332805,
0.1091156155,
-0.0585159026,
-0.2237077653,
0.3307850659,
-0.4219641089,
0.0152344536,
-0.1238244548,
-0.1087068096,
-0.0145639619,
0.0868040547,
-0.1273790449,
-0.0657807514,
0.1646885574,
-0.2167826593,
0.0568321981,
-0.0496254452,
-0.5082011223,
0.2045126855,
0.115257889,
-0.3140592277,
-0.0271636378,
0.0599229075,
0.0868313983,
0.232312277,
0.0578235574,
0.1366961747,
0.1389484406,
0.3809366524,
0.1306703389,
-0.2710241675,
0.3954216838,
-0.1604274362,
0.0631253421,
0.1573941559,
0.0463625602,
-0.1512768567,
-0.2365285605,
-0.19281362,
-0.1225317493,
0.2646410167,
-0.0871590525,
0.1277069747,
-0.0990574136,
-0.2676282525,
-0.421146661,
-0.0128328549,
-0.143507272,
-0.4676620364,
-0.2551900446,
-0.1288242638,
0.1196714491,
0.3570854366,
0.0584840439,
0.1540055573,
0.117205061,
0.1035317555,
-0.192457512,
0.4856255054,
-0.3060839474,
0.095651783,
0.0159236044,
0.1082331836,
0.0052156192,
0.5828415155,
0.2883778512,
-0.1631916165,
-0.2167945355,
-0.1514894515,
-0.0317192636,
0.0742448494,
-0.2648353875,
0.686940372,
0.267488569,
0.1740370542,
-0.3678111434,
-0.1260759234,
0.288269341,
-0.1811949909,
-0.0253334884,
-0.1145412028,
0.1908088624,
-0.1281624734,
0.2003380358,
-0.0837969482,
-0.375982374,
-0.1047149748,
0.2560347319,
-0.0970777199,
-0.1402121186,
-0.0218534637,
0.0314278342,
-0.3185785115,
-0.0446520634,
-0.3788218796,
-0.138982594,
-0.5120390654,
0.0317755155,
-0.2471354902,
-0.2191500664,
0.0938065201,
-0.0099170152,
-0.245313555,
0.0794131458,
0.0780088082,
0.5433707237,
-0.0363136344,
0.1234695092,
-0.1115001664,
0.0138579439,
0.6331729293,
-0.3010630906,
0.1640506387,
-0.0399138592,
-0.1221876517,
-0.0517041832,
-0.2836709619,
0.3046169877,
0.3274870515,
0.3123353124,
-0.0451565944,
0.7688196301,
0.032335408,
0.2276031822,
-0.0585771687,
-0.0526451319,
0.0181539133,
0.0496932603,
-0.266048491,
0.3946563005,
0.3597622514,
-0.3642842472,
0.3904458582,
0.1737832874,
0.1833560616,
0.0529088527,
-0.3258439004,
-0.1548326612,
-0.1775917858,
0.007640312,
0.1233652607,
-0.1138256267,
-0.1910023242,
-0.1076812074,
-0.087289609,
-0.0686332062,
-0.3474593759,
0.276755482,
0.608689189,
0.0353085995,
-0.5521407723,
-0.277580291,
-0.4109006524,
0.0925831571,
0.3612717688,
-0.1448525339,
-0.1316084415,
-0.0899694562,
0.457563132,
0.2928397954,
0.9118692279,
-0.0480405353,
-0.0764623359,
-0.2678033113,
-0.3367665112,
-0.0698805526,
0.2615613341,
-0.1675385982,
-0.16044043,
-0.097782895,
0.0080097681,
-0.5629237294,
-0.3688336611,
0.2234752625,
-0.0423945412,
-0.0119401356,
-0.1646340489,
-0.0375976264,
0.1303618997,
-0.08185523,
0.114841558,
0.0997271314,
0.1194925383,
-0.135134995,
-0.0092963763,
0.0160998069,
-0.3069129884,
0.0547068603,
-0.1615725905,
0.1988472641,
0.1703479737,
0.0921556205,
0.3174724579,
0.0863786042,
0.3073708415,
0.0350335576,
0.0105654215,
-0.0355811641,
-0.1031764671,
-0.0827478319,
0.4001296163,
0.1128335372,
-0.0206639227,
0.0576552562,
0.0313653536,
0.1760914326,
-0.3059211075,
-0.3526522815,
0.2256848663,
-0.2040526271,
-0.3664290607,
-0.2355873436,
0.3317004144,
0.1174634695,
-0.1695297807,
0.5695176721,
0.3859554231,
-0.0499191023,
0.0382431373,
0.0924310237,
0.7290911078,
0.0294327382,
-0.1381932646,
0.146416083,
0.2581762969,
0.253515929,
0.5658341646,
0.2663365901,
-0.3213185072,
-0.560905695,
-0.1801815778,
0.1945435703,
0.07013762,
0.2883495986,
-0.0299658366,
0.1047846451,
0.0862352028,
-0.0319910832,
-0.3092241287,
-0.214629814,
-0.2465344369,
-0.0768426508,
-0.1547738314,
0.0205518883,
-0.2051935643,
0.1990472674,
0.047339756,
0.1271192729,
-0.0826352909,
-0.2482586652,
-0.2205244601,
-0.0395420641,
-0.3270931542,
-0.1997732371,
0.0493600965,
-0.0938181579,
-0.0173339769,
0.283957392,
0.2538838685,
0.1005020738,
-0.0461257696,
0.2969196439,
-0.1870474666,
-0.2214700878,
-0.3022739291,
0.1434089988,
0.0238753334,
0.093917422,
-0.3886088133,
-0.2284819037,
0.051928848,
-0.440286994,
-0.7552899122,
-0.0343234204,
0.1560224146,
-0.4987486303,
-0.1597288251,
-0.1754287779,
0.2033162117,
-0.0585875921,
0.0171045326,
0.1049086526,
0.0587451756,
0.1825890243,
0.2684274912,
0.1431347132,
-0.2712364793,
0.2703587413,
0.0882670134,
0.4458447099,
0.1689552367,
0.1485592872,
-0.1471714973,
-0.2188888341,
0.5108018517,
0.1886906773,
0.0121514341,
0.0519050099,
0.116807662,
0.2932374775,
0.1533012688,
0.3414397538,
0.0736493692,
-0.0661102682,
0.0901012123,
-0.3865048885,
0.0707790628,
0.4137651622,
0.0008947842,
0.308298409,
0.1829462945,
0.2645631135,
-0.2461036295,
0.2580796778,
-0.1961766332,
0.2095334679,
0.2055712789,
0.010487943,
0.1557116807,
0.2658088505,
0.3691785932,
0.053416267,
0.053871315,
0.2029086798,
0.0868856907,
-0.0415693782,
-0.0816560909,
0.1096635759,
-0.093094565,
0.0800830498,
-0.0148897339,
-0.0118025644,
-0.2303003073,
-0.0752514973,
0.1897693276,
0.2808615863,
0.2509466112,
0.0298433956,
1.171104908,
0.1738694012,
-0.1717870086,
0.3409661651,
-0.1159721687,
0.2363991141,
-0.1439260691,
-0.0527300015,
-0.1090844125,
-0.1064583063,
-0.1660860181,
0.0044812392,
0.435790658,
0.0557048991,
0.1303507239,
0.0545393042,
-0.0873415694,
0.1037438065,
0.2103661895,
-0.0572843924,
0.2755920887,
0.2576659918,
0.1125283912,
0.1159228384,
0.0014913499,
-0.1673840284,
0.0919459313,
0.2776230872,
0.0923942924,
0.4643513262,
-0.4044196904,
0.2489085943,
0.1218212321,
-0.0440366194,
0.4120548069,
-0.1648294032,
0.2424530089,
0.1935705841,
-0.1634542942,
-0.2682673037,
0.1122435555,
0.0482798181,
0.1798920184,
-0.0163137782,
-0.3425216675,
0.4168280065,
-0.419164449,
0.0038347186,
0.2048425078,
-0.2509160042,
-0.2212839425,
0.4851027727,
-0.1065090522,
0.1006896272,
0.0395356081,
0.5624910593,
-0.408831358,
0.0537931286,
-0.1628302932,
0.3841962516,
0.1737345606,
-0.057838697,
-0.4703173041,
-0.2601883709,
-0.0356056578,
-0.0807705596,
0.0447902381,
-0.1512199044,
0.4077135324,
0.0227881745,
-0.0748026371,
-0.2502101064,
-0.1570414156,
0.1276264638,
0.129643932,
-0.0733404607,
0.0684465766,
-0.3397678435,
-0.0903372243,
0.4200606942,
-0.0090484247,
-0.0451187417,
-0.3887082636,
0.203023538,
-0.241693601,
-0.2977420688,
-0.1950833946,
0.1429153681,
0.2987177968,
-0.1367261559,
0.0560594872,
0.1678357869,
0.1176630557,
-0.0504578352,
-0.0840739384,
0.1555876732,
0.5019214153,
-0.4701642394,
0.1706535816,
-0.3687231541,
0.0971891806,
-0.1885648519,
-0.0868102908,
-0.2128152251,
0.4047722518,
-0.7692503333,
-0.3894667625,
-0.1174427345,
0.161235854,
0.0490508601,
-0.1257902533,
0.2492707074,
0.1120210662,
-0.4836629331,
-0.1140961647,
-0.3321506381,
0.1894539744,
-0.2385613024,
-0.1081532314,
0.0517783947,
-0.0050427816,
-0.0495232791,
0.1552316844,
-0.0473095626,
-0.057628952,
0.0768439472,
-0.0536826067,
0.5405690074,
0.0167321041,
-0.2378336042,
-0.2922281325,
0.202641055,
0.0832484588,
0.0292578153,
0.1403605193,
0.3057790995,
-0.16531232,
-0.138594985,
0.2969425023,
-0.059510082,
-0.5467323661,
-0.1643438935,
0.3374172449,
0.0138295135,
-0.1412118673,
-0.0477768295,
-0.0052817576,
-0.1105586365,
-0.3598605096,
0.2565425038,
0.0893585309,
0.6455034614,
-0.0133889187,
-0.4323684275,
-0.2270382792,
0.0555314049,
-0.0681266487,
0.2774096727,
-0.0389789343,
0.3033765256,
-0.1828289181,
0.0322630629,
0.2802880406,
0.2584703565,
-0.1828205884,
0.0236726198,
0.3140504062,
-0.0918687731,
0.4399705827,
-0.2999428809,
0.1169456393,
-0.2075855583,
-0.1133518368,
0.1766425222,
-0.4431579113,
0.0033017246,
-0.031394735,
0.1449699402,
0.1314010769,
0.5045565367,
0.0795724913,
0.2805847526,
-0.253916502,
0.1061658785,
0.5807647109,
0.3482684195,
-0.0909174606,
0.3747272193,
-0.1533651948
] |
https://github.com/huggingface/datasets/issues/1745 | difference between wsc and wsc.fixed for superglue | From the description given in the dataset script for `wsc.fixed`:
```
This version fixes issues where the spans are not actually substrings of the text.
``` | Hi
I see two versions of wsc in superglue, and I am not sure what is the differences and which one is the original one. could you help to discuss the differences? thanks @lhoestq | 26 | difference between wsc and wsc.fixed for superglue
Hi
I see two versions of wsc in superglue, and I am not sure what is the differences and which one is the original one. could you help to discuss the differences? thanks @lhoestq
From the description given in the dataset script for `wsc.fixed`:
```
This version fixes issues where the spans are not actually substrings of the text.
``` | [
-0.1165048108,
-0.4438872337,
0.0426136293,
-0.3368444443,
-0.0602852926,
-0.382475704,
0.4176897109,
-0.2519405484,
-0.1031501666,
0.0544862896,
0.1969243139,
-0.1466969401,
0.1097190455,
0.1931587756,
0.0983611122,
-0.2450374514,
0.3370180726,
-0.029704906,
0.2183906585,
-0.0973015726,
-0.2882763147,
-0.0660793483,
-0.4690126181,
-0.0129363844,
-0.6201684475,
-0.0405251049,
-0.0461755134,
-0.0209754854,
-0.202447027,
-0.2518568337,
0.574929595,
0.3391044438,
0.3738509119,
-0.0397943296,
-0.0001158088,
-0.1998219937,
0.531886518,
0.0798773319,
0.3641515672,
0.4048226774,
-0.4408574402,
-0.492715776,
-0.0975275785,
-0.0858862773,
0.1681793928,
0.2493118048,
-0.1676395237,
-0.3478980958,
0.1804485023,
-0.1944319904,
0.1312808096,
-0.0228099357,
0.0137678236,
-0.1547961384,
-0.0083534149,
-0.2238354236,
-0.1393194497,
0.2698024809,
0.3193905056,
0.0427221581,
0.1924661249,
0.4580577314,
-0.2261029333,
-0.089621298,
0.1591404676,
0.0118365325,
-0.5829806328,
-0.0270517711,
0.061317917,
0.4081569016,
0.4068087637,
0.0251668114,
-0.448076576,
-0.0524283536,
-0.0332934596,
0.1166871935,
0.195229888,
0.3218772709,
0.3227186203,
0.1619339734,
-0.408154428,
-0.0240218434,
0.1407890171,
-0.414975673,
-0.3853111565,
0.3058302701,
-0.1230530068,
0.2891017199,
-0.122335732,
0.077081047,
0.2488514781,
-0.0006773865,
-0.1661951542,
-0.0300213881,
-0.4951642752,
-0.2110800594,
-0.2171235681,
0.20300816,
-0.1595702618,
0.2685797513,
0.1453613788,
0.0540379025,
0.1727085114,
-0.0746781155,
-0.0876557454,
0.1890465468,
0.08041583,
-0.0715223774,
0.1665004939,
-0.1243543178,
-0.2451317906,
0.061713919,
0.4321231246,
-0.3441906273,
-0.2333057821,
-0.0550081804,
0.3404219747,
-0.1166875511,
-0.2876285315,
0.1818103641,
-0.0015119558,
-0.4694726169,
-0.03720228,
0.2117016017,
0.0783709511,
0.2736049592,
-0.0158580076,
0.252820462,
-0.046746403,
-0.2208692431,
-0.1682070643,
0.0275321268,
0.0647714138,
0.2110200524,
-0.1216973215,
-0.4539432526,
-0.0339432806,
0.4554687142,
-0.5253103375,
-0.1398455352,
-0.4471267164,
-0.1749224365,
0.0238407049,
-0.1458445638,
-0.2342798263,
0.1647827923,
-0.0649745911,
0.0967292115,
0.0823720172,
0.084646605,
-0.0599706993,
-0.0825930759,
-0.1808072031,
0.0868718326,
-0.0978944302,
-0.2788570225,
0.483441025,
0.2546780407,
-0.1537859887,
0.0886734575,
0.2153271139,
-0.0972265974,
-0.1082555354,
-0.2127085626,
0.0479025654,
0.1230947673,
-0.6595557928,
-0.0180033781,
0.1797145754,
-0.0761961788,
0.3189202845,
0.0976556242,
0.134698078,
-0.2406015992,
-0.0522275083,
0.2427651733,
-0.0070213135,
0.0770992339,
-0.5214037299,
0.2309278548,
0.4672338963,
0.0627567768,
0.075889051,
0.0268511977,
0.2087684274,
-0.0016144916,
-0.3322055936,
-0.2706947923,
-0.0721658617,
-0.2226542979,
-0.2867246568,
0.0091014951,
0.2818880081,
-0.1519309878,
0.0136293815,
0.0160742793,
0.0633377731,
-0.0027106549,
0.2329680324,
0.1287261099,
0.0150281051,
-0.1269878596,
-0.0684644803,
0.1541464031,
-0.0469534434,
-0.3897002041,
-0.358169049,
-0.1079812348,
-0.2921328843,
-0.0466267131,
0.2770768404,
-0.0608712994,
-0.0595486537,
0.1147934273,
0.2504431903,
-0.1975949556,
-0.0149175124,
0.1125037,
-0.0262014624,
-0.4090227485,
-0.4172937572,
0.0371238776,
-0.2061020434,
0.1091821715,
0.2301717103,
0.2716721296,
-0.0824755803,
-0.330368042,
0.1588198096,
0.3281595707,
0.1995611936,
0.1326562017,
-0.2715260088,
0.6245142221,
-0.3346571624,
0.2080750167,
-0.1988585591,
-0.1412714422,
0.179233551,
-0.5478564501,
0.3255385458,
0.110153392,
0.1726593226,
-0.0353354849,
-0.2805933356,
0.2657679915,
0.1534333378,
-0.0480338633,
-0.0009915025,
-0.0549676903,
-0.0492550209,
-0.2937420309,
-0.0547298416,
-0.069532685,
-0.057746578,
-0.0149123548,
0.277233839,
0.0630939677,
-0.5504789948,
0.149110496,
0.7143083811,
-0.2740683258,
0.0435123146,
0.1654292494,
-0.3776519299,
-0.2486042082,
-0.139463976,
0.280959487,
0.3068526685,
0.0137188304,
0.0569089353,
0.0276713762,
-0.0188715216,
-0.0925226733,
0.448879838,
-0.1777629852,
-0.4682581127,
-0.069994837,
-0.1501350254,
0.0450519808,
0.0252178945,
0.3341431916,
-0.5453560352,
-0.204014644,
0.0825195462,
-0.448271215,
-0.3298110068,
-0.1052337512,
-0.4454064667,
-0.0635503158,
-0.2789915502,
-0.0894786716,
-0.1312388182,
-0.4173155427,
-0.1389558613,
0.2662657797,
-0.0660322979,
0.5702059269,
-0.2510116398,
0.7024797201,
-0.2471655905,
0.0324252807,
-0.2356300354,
0.0417770557,
-0.0437819809,
-0.1581280679,
-0.0723072961,
0.1260561794,
0.3512500525,
-0.164039284,
-0.3056470752,
0.0262426883,
-0.0177333578,
0.1230627522,
0.3480786681,
0.1450386345,
0.1119326204,
-0.1225033998,
0.1085023805,
-0.5787020922,
0.3448263407,
-0.2222725153,
0.2646606266,
0.0796502754,
-0.0194843858,
-0.262485683,
-0.2568074465,
-0.1245547906,
-0.117643021,
-0.3266423047,
-0.1079658121,
-0.1618297249,
-0.1626625955,
0.0219604522,
0.4068730474,
0.1268579513,
-0.1189533323,
-0.3631409407,
0.2663445175,
0.2002223432,
-0.3214403689,
0.0324534401,
-0.2388675362,
-0.2139354795,
-0.212058723,
-0.0501977988,
0.3093804419,
-0.3111263812,
-0.4103976786,
0.3222428858,
0.2700645924,
0.2628371119,
-0.1162112802,
-0.0704910755,
-0.3537477255,
-0.3785716295,
-0.2535000741,
-0.0969455615,
0.2145971805,
0.3455377519,
-0.0914844051,
-0.0452796742,
0.1181724593,
0.2031228095,
0.0522396788,
0.2694359124,
0.3256169856,
-0.1411492229,
0.0911585689,
-0.1026597023,
0.3240303993,
-0.0613537543,
0.3414683044,
0.3343435228,
0.2504622042,
0.2113294899,
0.3287373781,
0.0730563179,
-0.2365047783,
-0.0412862822,
-0.200849697,
0.1837058216,
0.1138681993,
0.1185920089,
0.1139983609,
0.1917088777,
0.032032907,
0.0897368863,
0.3430531323,
0.3720321953,
-0.1509699374,
-0.5998117924,
-0.0014666538,
-0.0510221981,
0.5443959236,
0.1676470041,
0.1514752656,
0.1254290193,
-0.202234596,
-0.0010720758,
0.0742148384,
0.2895818055,
-0.2946629822,
-0.2194705456,
-0.2821371257,
0.1496330053,
-0.1376450062,
-0.3736903071,
0.0785980448,
-0.0116496468,
0.300595969,
0.0199008286,
0.1665446609,
-0.0905204564,
0.3712957799,
0.0989199579,
-0.2228336036,
-0.1065157428,
0.1200200692,
-0.1837932169,
0.2333816737,
-0.1639438719,
-0.3374069035,
0.1049895138,
-0.1425291598,
-0.0196294244,
-0.4854219854,
-0.1621074677,
0.1448293328,
-0.0715438798,
0.4643678367,
-0.0747644231,
-0.1323194355,
-0.0417545289,
0.3151389956,
-0.1964724511,
0.3328537941,
-0.0415208675,
0.1277207434,
0.0566012599,
-0.1474508345,
0.3766087592,
0.072724469,
-0.0516806953,
0.0949764177,
0.2785261869,
0.0665104389,
-0.733427465,
-0.1142556518,
0.0152769415,
0.3676269054,
-0.4343623817,
-0.4931998849,
0.412624687,
0.2666191161,
-0.1380538344,
0.0734548643,
0.2209328413,
-0.0491464026,
0.2081398815,
0.0505728535,
0.9365343451,
0.1980690062,
-0.2469335645,
-0.1019621268,
-0.2741839886,
0.3697304726,
0.0405957326,
0.0432201847,
-0.3002444506,
-0.4480789602,
-0.0852696374,
-0.1426514685,
0.150859952,
-0.0020696092,
-0.3891644776,
0.2941820621,
0.2201842964,
0.1418271512,
0.0852310061,
0.032553155,
-0.0698260665,
0.217684269,
0.3613614738,
0.0449693277,
-0.0370149575,
-0.0552392602,
-0.1562979519,
0.1887684166,
0.2473214716,
-0.3652150929,
-0.5746686459,
0.0253223274,
-0.0232663322,
-0.258708626,
0.30164662,
-0.3251588047,
0.3217351139,
0.3093060851,
0.1426474899,
-0.0370717458,
0.0989452899,
0.2027400881,
0.0756096318,
0.4827195704,
0.1381397247,
0.2285454869,
0.1422355771,
0.040242821,
-0.1778758764,
-0.1407412738,
-0.1174150258,
-0.1111763567,
-0.3783492148,
0.1505163163,
0.0274444465,
-0.3826551735,
0.0916952044,
0.0696371421,
0.4628218412,
-0.3492790759,
0.0851810575,
-0.1707525551,
0.1437141597,
0.3847945333,
-0.0324678794,
-0.1817153096,
-0.1388542205,
0.0127844559,
0.2796836495,
0.0065390142,
-0.0110841636,
0.1339949071,
-0.2759572864,
-0.1533312052,
-0.0854338706,
-0.1519999057,
-0.2181311548,
0.1788479984,
-0.3036334515,
-0.1310918331,
0.1493569016,
0.2421169132,
0.0134802843,
0.4598400295,
-0.2012215406,
-0.0795494989,
-0.2525124848,
-0.12916556,
0.0468887575,
0.3807411492,
-0.1464851052,
0.0773130208,
0.1458465457,
0.4178492725,
-0.2300198525,
0.1093070582,
0.0891276747,
-0.0381932817,
-0.2304638773,
0.1413811743,
-0.0614196211,
-0.0160037633,
0.046311982,
0.1518713385,
0.1652252674,
-0.1143792197,
-0.0602277219,
0.1549897045,
-0.0431239605,
-0.4361819029,
-0.0579773411,
0.3159970045,
0.5292284489,
-0.0179572292,
0.1852384359,
0.1282753944,
0.0576702543,
0.4169334769,
-0.0482065529,
0.088025324,
-0.2638801932,
0.0522681884,
-0.0435410738,
0.7487372756,
-0.0017942094,
0.1936086565,
0.2278984189,
-0.0316660553,
0.1052271426,
0.0779993758,
0.2765854895,
0.3018429577,
-0.0159570687,
0.0317954719,
-0.0017222479,
-0.0121679706,
0.304569006,
0.0512973554,
-0.0264316015,
-0.1751223803,
-0.0587979704,
0.1952405721,
-0.11606922,
0.1136825979,
0.0659980252,
-0.001575894,
-0.0387682132,
0.1221809462,
0.2216411382,
-0.0462209471,
-0.2587590814,
-0.0778966919,
0.8659677505,
-0.0654852092,
0.419764787,
0.2804833353,
0.2366859764,
0.0050814366,
0.3150864542,
-0.1764653772,
-0.1408133954,
-0.007936446,
0.3237074018,
0.1673203111,
0.2659124732,
0.1955086291,
0.1513555646,
0.0168418456,
-0.0060146498,
0.3988688886,
-0.4364007413,
0.0441029593,
-0.0471872017,
0.046668373,
-0.0800790116,
-0.3324154019,
0.0883186981,
0.1127825528,
-0.0003436549,
-0.606363833,
-0.2023250014,
-0.0830753595,
0.0823902413,
0.1436346322,
0.0192308351,
0.2930007577,
0.3953755498,
-0.1128223613,
0.0609157383,
0.0618284941,
0.1219066083,
-0.0333817452,
0.1890120357,
-0.1018292978,
0.0895107538,
0.4069797099,
0.5108786821,
0.6194599867,
0.6993114948,
0.3044995666,
0.1465720385,
-0.1528841108,
0.1024467945,
0.0640253499,
0.1051127538,
0.0857804567,
0.0151710212,
-0.2231173217,
-0.0410409532,
0.215152204,
0.1484855711,
-0.054031834,
0.4727930427,
-0.2869014442,
0.0217145607,
-0.3567309678,
0.1425771117,
-0.0946091935,
-0.0245342143,
0.1575755626,
0.1210764423,
-0.255140841,
-0.1617352068,
0.2509947717,
-0.2055133581,
0.0300445203,
-0.0569228344,
0.0575965829,
0.1609440297,
0.4223002493,
0.3717052341,
0.3308534324,
0.1262886971,
-0.396030575,
0.1680614054,
-0.2094759345,
0.4219667017,
0.1094525605,
-0.1022145674,
0.010941009,
-0.2573257685,
-0.4651071429,
0.3291641176,
0.3728501201,
-0.0181741267,
0.3111791015,
-0.0353105254,
0.2168151736,
0.429009527,
0.1149638891,
-0.136786744,
-0.0433996245,
-0.0255731605,
-0.1515860707,
-0.0207641572,
-0.0036236863,
0.0147146499,
0.275873661,
-0.2911989093,
0.5122100711,
0.3826968968,
0.0351489671,
-0.2888609171,
0.0521691442,
-0.224128291,
-0.1043325141,
-0.2918564379,
0.1459980756,
-0.1513600647,
0.2586990595,
0.0715011954,
0.0758016557,
-0.0526810661,
-0.0911576301,
-0.1767736375,
0.5641887784,
-0.3511337638,
-0.0915282592,
-0.0921095833,
-0.3570472598,
0.2390085161,
0.2044111788,
-0.0453020595,
0.4551430643,
-0.1789672524,
-0.2361582518,
0.0921660289,
0.101984553,
-0.0491841733,
-0.1732168943,
0.0368489996,
0.0346577987,
0.4055051506,
-0.6999352574,
-0.3297369182,
0.1721245199,
0.1971316487,
-0.0230201911,
0.0124483453,
0.4854850173,
-0.2080427855,
0.0844947398,
-0.2390801311,
0.3287643194,
-0.0839251876,
0.011059572,
-0.1954714656
] |
https://github.com/huggingface/datasets/issues/1743 | Issue while Creating Custom Metric | Currently it's only possible to define the features for the two columns `references` and `predictions`.
The data for these columns can then be passed to `metric.add_batch` and `metric.compute`.
Instead of defining more columns `text`, `offset_mapping` and `ground` you must include them in either references and predictions.
For example
```python
features = datasets.Features({
'predictions':datasets.Sequence(datasets.Value("int32")),
"references": datasets.Sequence({
"references_ids": datasets.Value("int32"),
"offset_mapping": datasets.Value("int32"),
'text': datasets.Value('string'),
"ground": datasets.Value("int32")
}),
})
```
Another option would be to simply have the two features like
```python
features = datasets.Features({
'predictions':datasets.Sequence(datasets.Value("int32")),
"references": datasets.Sequence(datasets.Value("int32")),
})
```
and keep `offset_mapping`, `text` and `ground` as as parameters for the computation (i.e. kwargs when calling `metric.compute`).
What is the metric you would like to implement ?
I'm asking since we consider allowing additional fields as requested in the `Comet` metric (see PR and discussion [here](https://github.com/huggingface/datasets/pull/1577)) and I'd like to know if it's something that can be interesting for users.
What do you think ? | Hi Team,
I am trying to create a custom metric for my training as follows, where f1 is my own metric:
```python
def _info(self):
# TODO: Specifies the datasets.MetricInfo object
return datasets.MetricInfo(
# This is the description that will appear on the metrics page.
description=_DESCRIPTION,
citation=_CITATION,
inputs_description=_KWARGS_DESCRIPTION,
# This defines the format of each prediction and reference
features = datasets.Features({'predictions':datasets.Sequence(datasets.Value("int32")), "references": datasets.Sequence(datasets.Value("int32")),"offset_mapping":datasets.Sequence(datasets.Value("int32")),'text':datasets.Sequence(datasets.Value('string')),"ground":datasets.Sequence(datasets.Value("int32")),}),
# Homepage of the metric for documentation
homepage="http://metric.homepage",
# Additional links to the codebase or references
codebase_urls=["http://github.com/path/to/codebase/of/new_metric"],
reference_urls=["http://path.to.reference.url/new_metric"]
)
def _compute(self,predictions,references,text,offset_mapping,spans):
pred_spans = []
for i,preds in enumerate(predictions):
current_preds = []
for j,token_preds in enumerate(preds):
if (preds>0.5):
current_preds+=list(range(offset_mapping[i][j][0],offset_mapping[i][j][1]))
pred_spans.append(current_spans)
return {
"Token Wise F1": f1_score(references,predictions,labels=[0,1]),
"Offset Wise F1": np.mean([f1(preds,gold) for preds,fold in zip(pred_spans,ground)])
}
```
I believe this is not correct. But that's not the issue I am facing right now. I get this error :
```python
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-144-ed7349b50821> in <module>()
----> 1 new_metric.compute(predictions=inputs["labels"],references=inputs["labels"], text=inputs["text"], offset_mapping=inputs["offset_mapping"],ground=inputs["ground"] )
2 frames
/usr/local/lib/python3.6/dist-packages/datasets/features.py in encode_batch(self, batch)
802 encoded_batch = {}
803 if set(batch) != set(self):
--> 804 print(batch)
805 print(self)
806 raise ValueError("Column mismatch between batch {} and features {}".format(set(batch), set(self)))
ValueError: Column mismatch between batch {'references', 'predictions'} and features {'ground', 'predictions', 'offset_mapping', 'text', 'references'}
```
On checking the features.py file, I see the call is made from add_batch() in metrics.py which only takes in predictions and references.
How do I make my custom metric work? Will it work with a trainer even if I am able to make this metric work?
Thanks,
Gunjan | 151 | Issue while Creating Custom Metric
Hi Team,
I am trying to create a custom metric for my training as follows, where f1 is my own metric:
```python
def _info(self):
# TODO: Specifies the datasets.MetricInfo object
return datasets.MetricInfo(
# This is the description that will appear on the metrics page.
description=_DESCRIPTION,
citation=_CITATION,
inputs_description=_KWARGS_DESCRIPTION,
# This defines the format of each prediction and reference
features = datasets.Features({'predictions':datasets.Sequence(datasets.Value("int32")), "references": datasets.Sequence(datasets.Value("int32")),"offset_mapping":datasets.Sequence(datasets.Value("int32")),'text':datasets.Sequence(datasets.Value('string')),"ground":datasets.Sequence(datasets.Value("int32")),}),
# Homepage of the metric for documentation
homepage="http://metric.homepage",
# Additional links to the codebase or references
codebase_urls=["http://github.com/path/to/codebase/of/new_metric"],
reference_urls=["http://path.to.reference.url/new_metric"]
)
def _compute(self,predictions,references,text,offset_mapping,spans):
pred_spans = []
for i,preds in enumerate(predictions):
current_preds = []
for j,token_preds in enumerate(preds):
if (preds>0.5):
current_preds+=list(range(offset_mapping[i][j][0],offset_mapping[i][j][1]))
pred_spans.append(current_spans)
return {
"Token Wise F1": f1_score(references,predictions,labels=[0,1]),
"Offset Wise F1": np.mean([f1(preds,gold) for preds,fold in zip(pred_spans,ground)])
}
```
I believe this is not correct. But that's not the issue I am facing right now. I get this error :
```python
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-144-ed7349b50821> in <module>()
----> 1 new_metric.compute(predictions=inputs["labels"],references=inputs["labels"], text=inputs["text"], offset_mapping=inputs["offset_mapping"],ground=inputs["ground"] )
2 frames
/usr/local/lib/python3.6/dist-packages/datasets/features.py in encode_batch(self, batch)
802 encoded_batch = {}
803 if set(batch) != set(self):
--> 804 print(batch)
805 print(self)
806 raise ValueError("Column mismatch between batch {} and features {}".format(set(batch), set(self)))
ValueError: Column mismatch between batch {'references', 'predictions'} and features {'ground', 'predictions', 'offset_mapping', 'text', 'references'}
```
On checking the features.py file, I see the call is made from add_batch() in metrics.py which only takes in predictions and references.
How do I make my custom metric work? Will it work with a trainer even if I am able to make this metric work?
Thanks,
Gunjan
Currently it's only possible to define the features for the two columns `references` and `predictions`.
The data for these columns can then be passed to `metric.add_batch` and `metric.compute`.
Instead of defining more columns `text`, `offset_mapping` and `ground` you must include them in either references and predictions.
For example
```python
features = datasets.Features({
'predictions':datasets.Sequence(datasets.Value("int32")),
"references": datasets.Sequence({
"references_ids": datasets.Value("int32"),
"offset_mapping": datasets.Value("int32"),
'text': datasets.Value('string'),
"ground": datasets.Value("int32")
}),
})
```
Another option would be to simply have the two features like
```python
features = datasets.Features({
'predictions':datasets.Sequence(datasets.Value("int32")),
"references": datasets.Sequence(datasets.Value("int32")),
})
```
and keep `offset_mapping`, `text` and `ground` as as parameters for the computation (i.e. kwargs when calling `metric.compute`).
What is the metric you would like to implement ?
I'm asking since we consider allowing additional fields as requested in the `Comet` metric (see PR and discussion [here](https://github.com/huggingface/datasets/pull/1577)) and I'd like to know if it's something that can be interesting for users.
What do you think ? | [
-0.2388353348,
-0.3020202518,
-0.1457838863,
0.1864611059,
0.4193514287,
-0.0384189971,
0.1069304571,
0.1982862502,
0.0518294983,
0.299782902,
-0.0557400435,
0.2383319736,
-0.1781436652,
0.1406404972,
-0.0143400328,
-0.1415148228,
-0.3350708485,
0.1471370459,
0.3345439732,
-0.0345633551,
-0.3107737303,
0.1606325805,
-0.0695877299,
0.1216963977,
-0.2355848551,
-0.0933225378,
0.2366886884,
-0.0159127973,
-0.4124858677,
-0.3041526079,
0.0990644842,
0.0513420738,
-0.1496007293,
0.5381694436,
-0.0000985569,
0.0695146024,
0.2994534969,
-0.0466107763,
-0.0341312289,
-0.1648350805,
0.0899350569,
-0.0930586904,
-0.0194853842,
-0.3661282361,
-0.3656155169,
-0.2527798712,
-0.3794955611,
-0.2056538761,
0.1416985691,
0.5694257021,
0.3465052247,
0.2177309096,
-0.0514514334,
-0.4145723283,
-0.0320219249,
-0.2802482843,
-0.2366340011,
0.1862058342,
-0.3302082121,
-0.1422022432,
-0.0290145352,
0.23736763,
0.0977391973,
0.2280805111,
0.4603565931,
0.0747327581,
0.464099437,
-0.0288448092,
-0.0639060736,
0.0993282795,
-0.0348309465,
-0.2291297019,
-0.1389288753,
-0.0865060464,
-0.0435683466,
-0.6063229442,
0.0008667331,
0.0412976332,
-0.1401288807,
0.0708579719,
-0.2137238383,
0.2448110431,
-0.2425159812,
0.1692856401,
-0.2068611085,
0.2759692669,
-0.1333458424,
-0.0129318237,
0.2290191352,
0.0137924897,
0.0881571248,
-0.1253053546,
0.1343978345,
-0.0300867148,
-0.0864600688,
-0.1028654426,
0.0322972275,
-0.249929741,
0.0712893009,
-0.0608590357,
0.1571663171,
-0.0135508291,
0.0931813717,
-0.0254777763,
-0.2397665083,
0.410728544,
-0.1583964229,
0.1640750319,
0.0718857199,
0.2834458649,
-0.1001683846,
-0.0766567811,
0.2461405247,
-0.245243147,
0.0941840187,
0.1683178991,
0.0826830044,
0.0549365096,
-0.4134447873,
0.1224453375,
0.0171107501,
0.0622441396,
0.363204807,
0.1792096198,
-0.0475458242,
-0.0578013621,
-0.0745772421,
0.1806987077,
-0.3036070764,
0.1323250532,
-0.3576906025,
0.1868122369,
-0.2822224498,
0.2094500959,
0.1023094282,
0.3251956701,
0.4162545502,
-0.082967937,
0.2864042521,
-0.4359331429,
0.0148108164,
-0.1164850518,
0.0146781057,
-0.0376987755,
-0.1169468835,
-0.090692699,
0.23224096,
-0.3248185813,
-0.032556247,
-0.0127762491,
-0.0772036389,
-0.2612805963,
-0.0464587547,
0.3655206859,
-0.103321977,
0.0883794278,
0.1066242009,
0.2783163488,
0.1253259182,
0.1891437918,
0.0639014244,
0.0877344236,
-0.6182097197,
-0.1497566551,
0.2072358876,
-0.040612679,
-0.0707486644,
0.0159721393,
0.0374545418,
0.0529676862,
0.085364677,
0.1257973164,
0.001591187,
0.5011467338,
-0.123123236,
0.071517773,
0.4473970532,
-0.3901568353,
-0.2748816907,
-0.0695148557,
-0.2604044676,
-0.1826819032,
-0.0402024277,
0.1134253442,
0.263974458,
-0.0010216982,
0.3351186514,
-0.0332486965,
0.0672770366,
-0.0819636136,
-0.3366430998,
-0.0550780967,
-0.1101376936,
0.0128996409,
0.2926908731,
0.1166745722,
0.1156805679,
0.0590456389,
-0.0790485293,
-0.0697925016,
-0.046203129,
0.292301327,
0.1704944521,
-0.1382118464,
-0.1373238415,
-0.3439495265,
0.0773457959,
0.1063653454,
-0.1482768506,
0.1029538214,
0.1586437076,
-0.1641626954,
-0.7732864022,
-0.0339806713,
-0.1352517009,
-0.1356811821,
0.3323923349,
-0.0662694201,
0.051231578,
-0.0233431626,
-0.1197001711,
-0.0865130424,
-0.4374272525,
-0.0387743637,
0.0409117118,
0.1444450468,
-0.0776677206,
-0.1523498744,
0.2320803553,
0.6334596276,
0.3142648935,
0.2431087643,
-0.1536218375,
0.4181964099,
0.1928747743,
-0.0966610983,
0.070949398,
0.2647998333,
0.1443881989,
-0.4176363945,
0.0823049173,
0.0835839212,
0.0380931199,
-0.1041172817,
-0.1718856692,
0.4496613443,
-0.0595271774,
-0.0188565459,
-0.0873196945,
-0.0377629288,
0.0356231332,
-0.0133335814,
-0.2262200862,
-0.3605844975,
0.1040816754,
-0.2649140358,
-0.0744181201,
-0.1512781084,
0.0140223335,
-0.046946086,
0.5437558293,
0.0859438702,
0.0209978353,
-0.0018736643,
0.09272632,
-0.0672308952,
-0.4087887704,
-0.1390049011,
0.3537850082,
0.2374163866,
0.0789088532,
0.3056024015,
-0.1816531122,
-0.2899184227,
0.1207428426,
0.1682117879,
-0.2001344264,
0.1640182137,
0.1174231172,
-0.1201038808,
-0.083690837,
0.0853292271,
-0.1367688924,
0.1860301197,
-0.3435233235,
-0.0631684512,
-0.1156025156,
0.1328384727,
-0.0778239071,
-0.3552177548,
0.0478062853,
-0.3057579994,
0.0757077411,
0.1828735173,
0.164163366,
0.2744426131,
0.1596274525,
0.1497502774,
0.2517192066,
-0.0102642914,
0.0825759321,
-0.2220391631,
0.0131278615,
0.2060865909,
-0.1667333692,
0.0321331061,
0.3787148595,
0.0630212501,
0.2129552066,
-0.1641375422,
-0.3228059709,
0.0167387556,
-0.0855586529,
0.3682923019,
0.2106134146,
-0.0868878365,
-0.1201218069,
0.0202160478,
0.4172612727,
-0.0720684379,
-0.0597001053,
0.0572300628,
-0.148922801,
-0.0393496901,
-0.1512387097,
-0.0986143425,
0.1086127833,
-0.3211776018,
-0.1853630394,
0.2116491199,
-0.0162883792,
0.2403929234,
0.177232042,
0.2700443864,
0.3833009601,
-0.1196691096,
-0.4149220288,
-0.2728315294,
0.3139651716,
-0.4965397418,
-0.1606484503,
0.0105523961,
-0.2040607482,
0.3531616926,
-0.065951243,
-0.4769183993,
-0.4896352291,
0.020047687,
0.2011553645,
-0.0679570809,
-0.1374585181,
0.1257936507,
-0.1389675587,
-0.2248542756,
-0.2828627229,
-0.3725371957,
0.0969548896,
-0.1559906453,
0.0767359287,
-0.1679983288,
0.2963859737,
0.0796192363,
0.537986815,
0.3091498911,
-0.0959011167,
0.1537612081,
-0.1665038913,
0.1702275723,
-0.2196134925,
-0.2937709391,
0.0400273427,
0.2761954963,
-0.009206715,
0.3007905185,
0.0125203477,
0.0655874312,
-0.0821675956,
-0.0163451452,
-0.1726568043,
-0.0903280824,
-0.2720504403,
0.0268464517,
0.2756063342,
-0.0166567303,
0.2943207324,
-0.3079782426,
-0.0173058696,
0.1736264378,
0.1240035892,
-0.2654491365,
-0.2161292881,
-0.2026865333,
0.0979781002,
-0.1469543427,
0.1126968265,
-0.0043463032,
0.0319837704,
0.0253149513,
0.278198272,
0.0260561612,
0.0583922192,
0.3026012182,
-0.2847105861,
-0.0721263587,
0.1879704148,
0.0299129616,
-0.2612211406,
0.0207334738,
0.0607771426,
0.2170862257,
-0.0766195655,
0.7068266869,
-0.3140385449,
-0.2015744001,
0.3677610159,
-0.0866842121,
-0.1156784892,
-0.2455520332,
-0.2079696953,
-0.4916191697,
0.0866602212,
0.1118829846,
0.0345400348,
0.4062202275,
0.2088233829,
-0.1182317808,
0.0021238292,
-0.2255104929,
0.1432762295,
-0.0509579219,
0.2105502039,
0.1123031527,
0.0916013047,
0.0428008474,
-0.1372725219,
-0.1102943122,
0.0896129459,
-0.0622722469,
-0.2546938956,
-0.009431879,
-0.1743391156,
0.1378943324,
0.143189922,
-0.124052003,
-0.0086782994,
-0.0085592801,
0.3078176677,
-0.1836655289,
0.2394237369,
0.241636768,
-0.0930790976,
-0.0456482582,
-0.3316990733,
0.4245660901,
0.0737657696,
0.0202899463,
0.3158138394,
-0.0291647948,
-0.222344175,
-0.0226507708,
0.1994322091,
0.6062896252,
0.1603306085,
-0.3175833225,
0.5252524018,
-0.146967724,
0.0887880772,
-0.2753627598,
0.0864623263,
-0.2138993889,
-0.1080955341,
0.0103713926,
-0.0206055306,
-0.0015154064,
-0.0870496407,
-0.0405260511,
0.1582220197,
0.0064194272,
0.1279785782,
0.0123805162,
0.1309276372,
0.2566300929,
-0.2243103534,
-0.256495744,
0.3084741235,
-0.1585791558,
-0.0529760718,
-0.0328531116,
-0.0789765194,
-0.1387614459,
-0.1088169739,
0.0663620085,
-0.259967953,
-0.3353090882,
-0.0554851107,
0.0048333621,
-0.2521209419,
0.003799425,
0.0339757912,
0.6332516074,
0.1763833761,
-0.1933757663,
0.1461805105,
-0.2148812413,
0.0211609285,
-0.1543851197,
0.0354209244,
-0.0282584913,
-0.165634796,
-0.1136272401,
0.0832110569,
0.1465190798,
-0.1040132269,
-0.052391436,
-0.2039107382,
0.0592290536,
-0.2386750132,
0.0388641395,
-0.1454924941,
-0.0332795866,
-0.2638091445,
0.2938853502,
-0.1383423954,
-0.1521503329,
0.1905479431,
0.1626862586,
-0.3084411621,
-0.0262026284,
0.0629232526,
0.0559828877,
0.0739612579,
0.1647736132,
-0.1561602205,
-0.1534175277,
-0.3211122155,
-0.0512613058,
-0.1514143944,
0.0145033197,
0.360753715,
0.0004531162,
-0.0166291595,
0.2318441719,
0.414393872,
0.1999178678,
0.2255795747,
0.1316358,
-0.1300477386,
-0.3161061108,
-0.1467147022,
-0.0892664641,
0.2483054996,
-0.2668389678,
0.6535883546,
-0.110259667,
-0.0258170757,
-0.5168287158,
0.0210984908,
-0.3219110072,
0.0016515864,
-0.0877803713,
-0.2357413769,
-0.0257898718,
0.2199917436,
0.2234497815,
0.2000250816,
-0.4137077034,
-0.3525777757,
-0.2297541797,
0.0474801585,
0.0519214608,
-0.054414209,
0.0205131583,
0.1132491678,
-0.4150604904,
-0.0894881189,
-0.1021689624,
0.3201111853,
0.1548327804,
0.1540997624,
-0.2030624598,
0.3304716647,
0.1944780201,
-0.2278047651,
0.1355090588,
0.394510746,
0.0560095012,
-0.0594257563,
-0.0535649247,
-0.0257706139,
-0.0678883418,
-0.0250609908,
0.117646262,
0.0966679305,
0.2362033576,
-0.0858821422,
-0.1094242856,
0.3337863684,
0.2333498299,
-0.0174506176,
-0.269690901,
-0.1854154468,
-0.0912889093,
0.3808516264,
-0.1617776304,
0.1138702109,
0.1146674007,
0.0822918862,
0.459689796,
0.3710057139,
0.1696257293,
-0.0328819416,
-0.1256030202,
0.0606864765,
0.3149348199,
-0.2551381886,
-0.0310555454,
0.0309939869,
0.0848926082,
0.0113149798,
0.4787459671,
0.1104655191,
0.1877094805,
0.4650905728,
-0.0248463415,
0.2866054177,
0.1135600805,
0.0256372094,
-0.1688524038,
0.246398285,
-0.1097466871,
0.1416637301,
-0.0437035188,
-0.1601412743,
-0.2172694951,
-0.0553399138,
-0.1343213618,
0.1474779844,
-0.163410157,
-0.0035558695,
-0.0300315823,
-0.0843850672,
-0.4169692695,
-0.1988134533,
-0.0874231905,
-0.1785979718,
0.1360295117,
0.2287363112,
0.0039015363,
-0.2996531725,
0.02453411,
0.1027037203,
0.0521598645,
0.2422716916,
0.2836423814,
-0.2555302083,
0.2037385255,
0.2507943809,
0.3229713142,
-0.0833273605,
0.3195425868,
0.1042080224,
0.1733375043,
-0.3330547512,
-0.2613293231,
0.0299531259,
-0.2656731009,
0.0219601728,
0.1441776007,
0.3015913069,
-0.1541231424,
0.4029774964,
0.288274467,
-0.4048208594,
0.2984382212,
0.1974195689,
-0.0133802723,
-0.4324824214,
0.3722926378,
-0.0042623733,
-0.033342313,
-0.0184288193,
-0.0564745776,
-0.1463489234,
-0.0918449238,
0.1887687445,
0.0247337818,
0.3445624709,
-0.1197895184,
0.1697073579,
-0.0821186528,
0.3426366448,
-0.0398551151,
0.0763786286,
-0.4161767066,
-0.1355719566,
-0.402767837,
0.1609248072,
-0.0098997764,
0.1158460453,
0.0341134034,
0.2473653555,
-0.2458716184,
0.2662315369,
0.1309254915,
0.0437192805,
-0.0359612219,
0.0830051675,
-0.3444512486,
0.0456632525,
-0.2424387187,
-0.1139570922,
0.2453492284,
-0.1367608905,
-0.1752687991,
-0.1287544966,
0.2528265119,
-0.1321384311,
0.16158925,
0.1247489601,
0.4439776838,
0.2961934805,
0.0682060421,
0.1773565859,
-0.1089348793,
0.1017326787,
-0.0991780534,
0.0317045338,
-0.0573242866,
0.2549757957,
0.1116755083,
0.3584684134,
-0.019524131,
-0.1864133775,
-0.2227336913,
0.2448713779,
0.3298003674,
-0.2393912077,
-0.0345268734,
0.274284631,
-0.1462465078,
-0.1039075479,
0.0426046401,
0.275770992,
0.0453789905,
0.4797607064,
-0.1038706228,
-0.4449883401,
0.5055990219,
0.0036407087,
-0.3741856515,
0.2025413215,
0.3159137964,
0.33651191,
-0.1287275106,
-0.4725495875,
0.1250621825,
0.4936554134,
-0.1135325506,
-0.0947744623,
0.2826546431,
-0.2521481216,
0.0280761868,
0.198281154,
-0.1538529843,
0.0279013272,
-0.0774058774,
0.095403254,
-0.0694283471
] |
https://github.com/huggingface/datasets/issues/1743 | Issue while Creating Custom Metric | Hi @lhoestq,
I am doing text segmentation and the metric is effectively dice score on character offsets. So I need to pass the actual spans and I want to be able to get the spans based on predictions using offset_mapping.
Including them in references seems like a good idea. I'll try it out and get back to you. If there's a better way to write a metric function for the same, please let me know. | Hi Team,
I am trying to create a custom metric for my training as follows, where f1 is my own metric:
```python
def _info(self):
# TODO: Specifies the datasets.MetricInfo object
return datasets.MetricInfo(
# This is the description that will appear on the metrics page.
description=_DESCRIPTION,
citation=_CITATION,
inputs_description=_KWARGS_DESCRIPTION,
# This defines the format of each prediction and reference
features = datasets.Features({'predictions':datasets.Sequence(datasets.Value("int32")), "references": datasets.Sequence(datasets.Value("int32")),"offset_mapping":datasets.Sequence(datasets.Value("int32")),'text':datasets.Sequence(datasets.Value('string')),"ground":datasets.Sequence(datasets.Value("int32")),}),
# Homepage of the metric for documentation
homepage="http://metric.homepage",
# Additional links to the codebase or references
codebase_urls=["http://github.com/path/to/codebase/of/new_metric"],
reference_urls=["http://path.to.reference.url/new_metric"]
)
def _compute(self,predictions,references,text,offset_mapping,spans):
pred_spans = []
for i,preds in enumerate(predictions):
current_preds = []
for j,token_preds in enumerate(preds):
if (preds>0.5):
current_preds+=list(range(offset_mapping[i][j][0],offset_mapping[i][j][1]))
pred_spans.append(current_spans)
return {
"Token Wise F1": f1_score(references,predictions,labels=[0,1]),
"Offset Wise F1": np.mean([f1(preds,gold) for preds,fold in zip(pred_spans,ground)])
}
```
I believe this is not correct. But that's not the issue I am facing right now. I get this error :
```python
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-144-ed7349b50821> in <module>()
----> 1 new_metric.compute(predictions=inputs["labels"],references=inputs["labels"], text=inputs["text"], offset_mapping=inputs["offset_mapping"],ground=inputs["ground"] )
2 frames
/usr/local/lib/python3.6/dist-packages/datasets/features.py in encode_batch(self, batch)
802 encoded_batch = {}
803 if set(batch) != set(self):
--> 804 print(batch)
805 print(self)
806 raise ValueError("Column mismatch between batch {} and features {}".format(set(batch), set(self)))
ValueError: Column mismatch between batch {'references', 'predictions'} and features {'ground', 'predictions', 'offset_mapping', 'text', 'references'}
```
On checking the features.py file, I see the call is made from add_batch() in metrics.py which only takes in predictions and references.
How do I make my custom metric work? Will it work with a trainer even if I am able to make this metric work?
Thanks,
Gunjan | 75 | Issue while Creating Custom Metric
Hi Team,
I am trying to create a custom metric for my training as follows, where f1 is my own metric:
```python
def _info(self):
# TODO: Specifies the datasets.MetricInfo object
return datasets.MetricInfo(
# This is the description that will appear on the metrics page.
description=_DESCRIPTION,
citation=_CITATION,
inputs_description=_KWARGS_DESCRIPTION,
# This defines the format of each prediction and reference
features = datasets.Features({'predictions':datasets.Sequence(datasets.Value("int32")), "references": datasets.Sequence(datasets.Value("int32")),"offset_mapping":datasets.Sequence(datasets.Value("int32")),'text':datasets.Sequence(datasets.Value('string')),"ground":datasets.Sequence(datasets.Value("int32")),}),
# Homepage of the metric for documentation
homepage="http://metric.homepage",
# Additional links to the codebase or references
codebase_urls=["http://github.com/path/to/codebase/of/new_metric"],
reference_urls=["http://path.to.reference.url/new_metric"]
)
def _compute(self,predictions,references,text,offset_mapping,spans):
pred_spans = []
for i,preds in enumerate(predictions):
current_preds = []
for j,token_preds in enumerate(preds):
if (preds>0.5):
current_preds+=list(range(offset_mapping[i][j][0],offset_mapping[i][j][1]))
pred_spans.append(current_spans)
return {
"Token Wise F1": f1_score(references,predictions,labels=[0,1]),
"Offset Wise F1": np.mean([f1(preds,gold) for preds,fold in zip(pred_spans,ground)])
}
```
I believe this is not correct. But that's not the issue I am facing right now. I get this error :
```python
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-144-ed7349b50821> in <module>()
----> 1 new_metric.compute(predictions=inputs["labels"],references=inputs["labels"], text=inputs["text"], offset_mapping=inputs["offset_mapping"],ground=inputs["ground"] )
2 frames
/usr/local/lib/python3.6/dist-packages/datasets/features.py in encode_batch(self, batch)
802 encoded_batch = {}
803 if set(batch) != set(self):
--> 804 print(batch)
805 print(self)
806 raise ValueError("Column mismatch between batch {} and features {}".format(set(batch), set(self)))
ValueError: Column mismatch between batch {'references', 'predictions'} and features {'ground', 'predictions', 'offset_mapping', 'text', 'references'}
```
On checking the features.py file, I see the call is made from add_batch() in metrics.py which only takes in predictions and references.
How do I make my custom metric work? Will it work with a trainer even if I am able to make this metric work?
Thanks,
Gunjan
Hi @lhoestq,
I am doing text segmentation and the metric is effectively dice score on character offsets. So I need to pass the actual spans and I want to be able to get the spans based on predictions using offset_mapping.
Including them in references seems like a good idea. I'll try it out and get back to you. If there's a better way to write a metric function for the same, please let me know. | [
-0.2388353348,
-0.3020202518,
-0.1457838863,
0.1864611059,
0.4193514287,
-0.0384189971,
0.1069304571,
0.1982862502,
0.0518294983,
0.299782902,
-0.0557400435,
0.2383319736,
-0.1781436652,
0.1406404972,
-0.0143400328,
-0.1415148228,
-0.3350708485,
0.1471370459,
0.3345439732,
-0.0345633551,
-0.3107737303,
0.1606325805,
-0.0695877299,
0.1216963977,
-0.2355848551,
-0.0933225378,
0.2366886884,
-0.0159127973,
-0.4124858677,
-0.3041526079,
0.0990644842,
0.0513420738,
-0.1496007293,
0.5381694436,
-0.0000985569,
0.0695146024,
0.2994534969,
-0.0466107763,
-0.0341312289,
-0.1648350805,
0.0899350569,
-0.0930586904,
-0.0194853842,
-0.3661282361,
-0.3656155169,
-0.2527798712,
-0.3794955611,
-0.2056538761,
0.1416985691,
0.5694257021,
0.3465052247,
0.2177309096,
-0.0514514334,
-0.4145723283,
-0.0320219249,
-0.2802482843,
-0.2366340011,
0.1862058342,
-0.3302082121,
-0.1422022432,
-0.0290145352,
0.23736763,
0.0977391973,
0.2280805111,
0.4603565931,
0.0747327581,
0.464099437,
-0.0288448092,
-0.0639060736,
0.0993282795,
-0.0348309465,
-0.2291297019,
-0.1389288753,
-0.0865060464,
-0.0435683466,
-0.6063229442,
0.0008667331,
0.0412976332,
-0.1401288807,
0.0708579719,
-0.2137238383,
0.2448110431,
-0.2425159812,
0.1692856401,
-0.2068611085,
0.2759692669,
-0.1333458424,
-0.0129318237,
0.2290191352,
0.0137924897,
0.0881571248,
-0.1253053546,
0.1343978345,
-0.0300867148,
-0.0864600688,
-0.1028654426,
0.0322972275,
-0.249929741,
0.0712893009,
-0.0608590357,
0.1571663171,
-0.0135508291,
0.0931813717,
-0.0254777763,
-0.2397665083,
0.410728544,
-0.1583964229,
0.1640750319,
0.0718857199,
0.2834458649,
-0.1001683846,
-0.0766567811,
0.2461405247,
-0.245243147,
0.0941840187,
0.1683178991,
0.0826830044,
0.0549365096,
-0.4134447873,
0.1224453375,
0.0171107501,
0.0622441396,
0.363204807,
0.1792096198,
-0.0475458242,
-0.0578013621,
-0.0745772421,
0.1806987077,
-0.3036070764,
0.1323250532,
-0.3576906025,
0.1868122369,
-0.2822224498,
0.2094500959,
0.1023094282,
0.3251956701,
0.4162545502,
-0.082967937,
0.2864042521,
-0.4359331429,
0.0148108164,
-0.1164850518,
0.0146781057,
-0.0376987755,
-0.1169468835,
-0.090692699,
0.23224096,
-0.3248185813,
-0.032556247,
-0.0127762491,
-0.0772036389,
-0.2612805963,
-0.0464587547,
0.3655206859,
-0.103321977,
0.0883794278,
0.1066242009,
0.2783163488,
0.1253259182,
0.1891437918,
0.0639014244,
0.0877344236,
-0.6182097197,
-0.1497566551,
0.2072358876,
-0.040612679,
-0.0707486644,
0.0159721393,
0.0374545418,
0.0529676862,
0.085364677,
0.1257973164,
0.001591187,
0.5011467338,
-0.123123236,
0.071517773,
0.4473970532,
-0.3901568353,
-0.2748816907,
-0.0695148557,
-0.2604044676,
-0.1826819032,
-0.0402024277,
0.1134253442,
0.263974458,
-0.0010216982,
0.3351186514,
-0.0332486965,
0.0672770366,
-0.0819636136,
-0.3366430998,
-0.0550780967,
-0.1101376936,
0.0128996409,
0.2926908731,
0.1166745722,
0.1156805679,
0.0590456389,
-0.0790485293,
-0.0697925016,
-0.046203129,
0.292301327,
0.1704944521,
-0.1382118464,
-0.1373238415,
-0.3439495265,
0.0773457959,
0.1063653454,
-0.1482768506,
0.1029538214,
0.1586437076,
-0.1641626954,
-0.7732864022,
-0.0339806713,
-0.1352517009,
-0.1356811821,
0.3323923349,
-0.0662694201,
0.051231578,
-0.0233431626,
-0.1197001711,
-0.0865130424,
-0.4374272525,
-0.0387743637,
0.0409117118,
0.1444450468,
-0.0776677206,
-0.1523498744,
0.2320803553,
0.6334596276,
0.3142648935,
0.2431087643,
-0.1536218375,
0.4181964099,
0.1928747743,
-0.0966610983,
0.070949398,
0.2647998333,
0.1443881989,
-0.4176363945,
0.0823049173,
0.0835839212,
0.0380931199,
-0.1041172817,
-0.1718856692,
0.4496613443,
-0.0595271774,
-0.0188565459,
-0.0873196945,
-0.0377629288,
0.0356231332,
-0.0133335814,
-0.2262200862,
-0.3605844975,
0.1040816754,
-0.2649140358,
-0.0744181201,
-0.1512781084,
0.0140223335,
-0.046946086,
0.5437558293,
0.0859438702,
0.0209978353,
-0.0018736643,
0.09272632,
-0.0672308952,
-0.4087887704,
-0.1390049011,
0.3537850082,
0.2374163866,
0.0789088532,
0.3056024015,
-0.1816531122,
-0.2899184227,
0.1207428426,
0.1682117879,
-0.2001344264,
0.1640182137,
0.1174231172,
-0.1201038808,
-0.083690837,
0.0853292271,
-0.1367688924,
0.1860301197,
-0.3435233235,
-0.0631684512,
-0.1156025156,
0.1328384727,
-0.0778239071,
-0.3552177548,
0.0478062853,
-0.3057579994,
0.0757077411,
0.1828735173,
0.164163366,
0.2744426131,
0.1596274525,
0.1497502774,
0.2517192066,
-0.0102642914,
0.0825759321,
-0.2220391631,
0.0131278615,
0.2060865909,
-0.1667333692,
0.0321331061,
0.3787148595,
0.0630212501,
0.2129552066,
-0.1641375422,
-0.3228059709,
0.0167387556,
-0.0855586529,
0.3682923019,
0.2106134146,
-0.0868878365,
-0.1201218069,
0.0202160478,
0.4172612727,
-0.0720684379,
-0.0597001053,
0.0572300628,
-0.148922801,
-0.0393496901,
-0.1512387097,
-0.0986143425,
0.1086127833,
-0.3211776018,
-0.1853630394,
0.2116491199,
-0.0162883792,
0.2403929234,
0.177232042,
0.2700443864,
0.3833009601,
-0.1196691096,
-0.4149220288,
-0.2728315294,
0.3139651716,
-0.4965397418,
-0.1606484503,
0.0105523961,
-0.2040607482,
0.3531616926,
-0.065951243,
-0.4769183993,
-0.4896352291,
0.020047687,
0.2011553645,
-0.0679570809,
-0.1374585181,
0.1257936507,
-0.1389675587,
-0.2248542756,
-0.2828627229,
-0.3725371957,
0.0969548896,
-0.1559906453,
0.0767359287,
-0.1679983288,
0.2963859737,
0.0796192363,
0.537986815,
0.3091498911,
-0.0959011167,
0.1537612081,
-0.1665038913,
0.1702275723,
-0.2196134925,
-0.2937709391,
0.0400273427,
0.2761954963,
-0.009206715,
0.3007905185,
0.0125203477,
0.0655874312,
-0.0821675956,
-0.0163451452,
-0.1726568043,
-0.0903280824,
-0.2720504403,
0.0268464517,
0.2756063342,
-0.0166567303,
0.2943207324,
-0.3079782426,
-0.0173058696,
0.1736264378,
0.1240035892,
-0.2654491365,
-0.2161292881,
-0.2026865333,
0.0979781002,
-0.1469543427,
0.1126968265,
-0.0043463032,
0.0319837704,
0.0253149513,
0.278198272,
0.0260561612,
0.0583922192,
0.3026012182,
-0.2847105861,
-0.0721263587,
0.1879704148,
0.0299129616,
-0.2612211406,
0.0207334738,
0.0607771426,
0.2170862257,
-0.0766195655,
0.7068266869,
-0.3140385449,
-0.2015744001,
0.3677610159,
-0.0866842121,
-0.1156784892,
-0.2455520332,
-0.2079696953,
-0.4916191697,
0.0866602212,
0.1118829846,
0.0345400348,
0.4062202275,
0.2088233829,
-0.1182317808,
0.0021238292,
-0.2255104929,
0.1432762295,
-0.0509579219,
0.2105502039,
0.1123031527,
0.0916013047,
0.0428008474,
-0.1372725219,
-0.1102943122,
0.0896129459,
-0.0622722469,
-0.2546938956,
-0.009431879,
-0.1743391156,
0.1378943324,
0.143189922,
-0.124052003,
-0.0086782994,
-0.0085592801,
0.3078176677,
-0.1836655289,
0.2394237369,
0.241636768,
-0.0930790976,
-0.0456482582,
-0.3316990733,
0.4245660901,
0.0737657696,
0.0202899463,
0.3158138394,
-0.0291647948,
-0.222344175,
-0.0226507708,
0.1994322091,
0.6062896252,
0.1603306085,
-0.3175833225,
0.5252524018,
-0.146967724,
0.0887880772,
-0.2753627598,
0.0864623263,
-0.2138993889,
-0.1080955341,
0.0103713926,
-0.0206055306,
-0.0015154064,
-0.0870496407,
-0.0405260511,
0.1582220197,
0.0064194272,
0.1279785782,
0.0123805162,
0.1309276372,
0.2566300929,
-0.2243103534,
-0.256495744,
0.3084741235,
-0.1585791558,
-0.0529760718,
-0.0328531116,
-0.0789765194,
-0.1387614459,
-0.1088169739,
0.0663620085,
-0.259967953,
-0.3353090882,
-0.0554851107,
0.0048333621,
-0.2521209419,
0.003799425,
0.0339757912,
0.6332516074,
0.1763833761,
-0.1933757663,
0.1461805105,
-0.2148812413,
0.0211609285,
-0.1543851197,
0.0354209244,
-0.0282584913,
-0.165634796,
-0.1136272401,
0.0832110569,
0.1465190798,
-0.1040132269,
-0.052391436,
-0.2039107382,
0.0592290536,
-0.2386750132,
0.0388641395,
-0.1454924941,
-0.0332795866,
-0.2638091445,
0.2938853502,
-0.1383423954,
-0.1521503329,
0.1905479431,
0.1626862586,
-0.3084411621,
-0.0262026284,
0.0629232526,
0.0559828877,
0.0739612579,
0.1647736132,
-0.1561602205,
-0.1534175277,
-0.3211122155,
-0.0512613058,
-0.1514143944,
0.0145033197,
0.360753715,
0.0004531162,
-0.0166291595,
0.2318441719,
0.414393872,
0.1999178678,
0.2255795747,
0.1316358,
-0.1300477386,
-0.3161061108,
-0.1467147022,
-0.0892664641,
0.2483054996,
-0.2668389678,
0.6535883546,
-0.110259667,
-0.0258170757,
-0.5168287158,
0.0210984908,
-0.3219110072,
0.0016515864,
-0.0877803713,
-0.2357413769,
-0.0257898718,
0.2199917436,
0.2234497815,
0.2000250816,
-0.4137077034,
-0.3525777757,
-0.2297541797,
0.0474801585,
0.0519214608,
-0.054414209,
0.0205131583,
0.1132491678,
-0.4150604904,
-0.0894881189,
-0.1021689624,
0.3201111853,
0.1548327804,
0.1540997624,
-0.2030624598,
0.3304716647,
0.1944780201,
-0.2278047651,
0.1355090588,
0.394510746,
0.0560095012,
-0.0594257563,
-0.0535649247,
-0.0257706139,
-0.0678883418,
-0.0250609908,
0.117646262,
0.0966679305,
0.2362033576,
-0.0858821422,
-0.1094242856,
0.3337863684,
0.2333498299,
-0.0174506176,
-0.269690901,
-0.1854154468,
-0.0912889093,
0.3808516264,
-0.1617776304,
0.1138702109,
0.1146674007,
0.0822918862,
0.459689796,
0.3710057139,
0.1696257293,
-0.0328819416,
-0.1256030202,
0.0606864765,
0.3149348199,
-0.2551381886,
-0.0310555454,
0.0309939869,
0.0848926082,
0.0113149798,
0.4787459671,
0.1104655191,
0.1877094805,
0.4650905728,
-0.0248463415,
0.2866054177,
0.1135600805,
0.0256372094,
-0.1688524038,
0.246398285,
-0.1097466871,
0.1416637301,
-0.0437035188,
-0.1601412743,
-0.2172694951,
-0.0553399138,
-0.1343213618,
0.1474779844,
-0.163410157,
-0.0035558695,
-0.0300315823,
-0.0843850672,
-0.4169692695,
-0.1988134533,
-0.0874231905,
-0.1785979718,
0.1360295117,
0.2287363112,
0.0039015363,
-0.2996531725,
0.02453411,
0.1027037203,
0.0521598645,
0.2422716916,
0.2836423814,
-0.2555302083,
0.2037385255,
0.2507943809,
0.3229713142,
-0.0833273605,
0.3195425868,
0.1042080224,
0.1733375043,
-0.3330547512,
-0.2613293231,
0.0299531259,
-0.2656731009,
0.0219601728,
0.1441776007,
0.3015913069,
-0.1541231424,
0.4029774964,
0.288274467,
-0.4048208594,
0.2984382212,
0.1974195689,
-0.0133802723,
-0.4324824214,
0.3722926378,
-0.0042623733,
-0.033342313,
-0.0184288193,
-0.0564745776,
-0.1463489234,
-0.0918449238,
0.1887687445,
0.0247337818,
0.3445624709,
-0.1197895184,
0.1697073579,
-0.0821186528,
0.3426366448,
-0.0398551151,
0.0763786286,
-0.4161767066,
-0.1355719566,
-0.402767837,
0.1609248072,
-0.0098997764,
0.1158460453,
0.0341134034,
0.2473653555,
-0.2458716184,
0.2662315369,
0.1309254915,
0.0437192805,
-0.0359612219,
0.0830051675,
-0.3444512486,
0.0456632525,
-0.2424387187,
-0.1139570922,
0.2453492284,
-0.1367608905,
-0.1752687991,
-0.1287544966,
0.2528265119,
-0.1321384311,
0.16158925,
0.1247489601,
0.4439776838,
0.2961934805,
0.0682060421,
0.1773565859,
-0.1089348793,
0.1017326787,
-0.0991780534,
0.0317045338,
-0.0573242866,
0.2549757957,
0.1116755083,
0.3584684134,
-0.019524131,
-0.1864133775,
-0.2227336913,
0.2448713779,
0.3298003674,
-0.2393912077,
-0.0345268734,
0.274284631,
-0.1462465078,
-0.1039075479,
0.0426046401,
0.275770992,
0.0453789905,
0.4797607064,
-0.1038706228,
-0.4449883401,
0.5055990219,
0.0036407087,
-0.3741856515,
0.2025413215,
0.3159137964,
0.33651191,
-0.1287275106,
-0.4725495875,
0.1250621825,
0.4936554134,
-0.1135325506,
-0.0947744623,
0.2826546431,
-0.2521481216,
0.0280761868,
0.198281154,
-0.1538529843,
0.0279013272,
-0.0774058774,
0.095403254,
-0.0694283471
] |
https://github.com/huggingface/datasets/issues/1733 | connection issue with glue, what is the data url for glue? | Hello @juliahane, which config of GLUE causes you trouble?
The URLs are defined in the dataset script source code: https://github.com/huggingface/datasets/blob/master/datasets/glue/glue.py | Hi
my codes sometimes fails due to connection issue with glue, could you tell me how I can have the URL datasets library is trying to read GLUE from to test the machines I am working on if there is an issue on my side or not
thanks | 20 | connection issue with glue, what is the data url for glue?
Hi
my codes sometimes fails due to connection issue with glue, could you tell me how I can have the URL datasets library is trying to read GLUE from to test the machines I am working on if there is an issue on my side or not
thanks
Hello @juliahane, which config of GLUE causes you trouble?
The URLs are defined in the dataset script source code: https://github.com/huggingface/datasets/blob/master/datasets/glue/glue.py | [
-0.0552914403,
0.0118693495,
-0.0427739918,
0.2993859947,
0.3010599017,
-0.2684806287,
0.2035406679,
0.0815815851,
0.1122900471,
0.1263365895,
0.064289175,
-0.0648154169,
0.2632437348,
0.1945553571,
0.2005842328,
-0.0129128052,
-0.1107107103,
-0.0857952461,
-0.3790934086,
0.0695379972,
-0.2274180204,
0.1339349896,
-0.2569566667,
0.1540933102,
-0.2331766486,
-0.0182276014,
-0.2408937067,
0.1416755915,
-0.1169200167,
-0.3114697933,
0.2458859384,
0.2722535729,
0.0157694649,
0.2451800555,
-0.0001094538,
-0.0854323357,
0.447622776,
0.051865384,
-0.0857246593,
-0.0963326171,
-0.4144307673,
-0.1583483815,
0.1298843473,
-0.2039458007,
-0.172820285,
0.4333642423,
0.1408487707,
-0.3225313723,
0.186143592,
0.1474583596,
0.2255822718,
0.3084512353,
0.2373652309,
0.037909694,
0.3510047495,
-0.2436031252,
0.152184993,
0.4593857825,
0.3264586329,
-0.1734832078,
0.1133606583,
0.1072214618,
0.137802422,
-0.0038305654,
-0.0707272291,
0.0960998908,
-0.2217193991,
-0.3329149485,
0.0700250939,
0.3006031215,
0.3522766531,
-0.145694688,
-0.2870567143,
0.0623583607,
-0.1634307802,
0.3614005744,
0.3465101421,
0.2372850776,
0.0861446857,
0.2820419669,
-0.178160876,
-0.2360921353,
-0.2536135018,
0.2970755994,
0.0505382605,
-0.0472004861,
-0.2656106353,
0.207294479,
-0.0061236969,
-0.214340359,
-0.0764591843,
-0.1481075138,
-0.0374756008,
0.1016431823,
-0.1890323311,
-0.1231699586,
-0.1298277825,
0.5392323136,
0.3787512779,
0.0442044027,
0.0274433345,
0.0363214165,
-0.1351927817,
0.2267660499,
0.453475982,
-0.126563251,
0.1274651438,
-0.0749851465,
0.558650434,
0.1327302307,
-0.1617053449,
-0.2315635085,
0.0721815526,
-0.2383840531,
-0.1969605684,
-0.1852639914,
0.4247689247,
-0.3179556727,
-0.0180468448,
-0.0207220949,
-0.2300950885,
0.0216082651,
0.0870368779,
0.3594590724,
-0.3293737769,
0.0328832939,
-0.0079370029,
-0.1125490665,
-0.1614851207,
-0.1475442052,
-0.1700425148,
0.0387516133,
-0.2326638848,
0.0795595199,
0.0292005874,
-0.2172805965,
0.0885175839,
0.0719201416,
-0.1632148772,
-0.0856617466,
0.0172572136,
-0.1295015514,
0.1328125447,
0.1723617017,
0.1386317015,
0.2162533104,
-0.1134446934,
-0.3098357022,
-0.0390173197,
-0.102417469,
-0.3364965916,
-0.0733488947,
-0.01414527,
0.1698185503,
-0.4461424947,
0.0614762455,
-0.0504904874,
-0.1832019687,
-0.3620139062,
0.0506998003,
0.0676262453,
0.0361978523,
0.0771712661,
-0.4720365703,
0.32859689,
0.4581775367,
-0.2045363933,
0.0299884677,
0.2047375292,
-0.2899805307,
-0.1610528976,
0.2446178496,
-0.0275422838,
-0.2317220718,
-0.3104971349,
0.3071648479,
0.2097475678,
-0.4537997842,
-0.5420527458,
0.5876685381,
-0.1791020781,
-0.2067998499,
-0.0125935404,
0.18525365,
0.1498972476,
0.0511214882,
0.0089086518,
0.5321074128,
-0.0603237525,
-0.1297144741,
-0.2670769691,
-0.2808824182,
0.0112551665,
0.0750849769,
-0.1924653798,
-0.1969622821,
0.3012686968,
-0.3112699091,
0.258402288,
0.2315501869,
-0.0003223532,
0.2314705253,
0.4709129632,
0.1136939451,
0.1910981685,
0.0146152368,
-0.3011434078,
0.0670153052,
0.0895374119,
0.0161554907,
-0.1345145404,
-0.1280486137,
-0.0405260734,
0.0316536799,
-0.051964134,
-0.0366878957,
0.1640716344,
-0.0981395468,
0.1427840889,
0.2040521652,
-0.0956535786,
0.5069957376,
0.0449104235,
0.2054912895,
-0.3476512432,
0.7957615852,
-0.0628450289,
-0.0831363872,
0.1679749042,
0.1581299901,
0.3577300608,
-0.240621388,
-0.0793364346,
0.5479313731,
0.0030465859,
0.2087196708,
0.4648138285,
0.3619558811,
0.261600703,
-0.2679558992,
0.1766914725,
0.1234835982,
0.1318589896,
0.0528853387,
0.2697487772,
0.0565303415,
-0.0929101408,
0.3933546543,
0.2558864355,
0.2535198927,
-0.0885494128,
-0.2306993008,
-0.3375173509,
0.025789123,
0.1821231693,
-0.0102815321,
0.3197614849,
0.0665564537,
-0.1968087107,
0.0343663506,
0.2283055037,
-0.2139410377,
0.1477042586,
-0.1218863279,
-0.242770195,
-0.0533956848,
0.0949440226,
0.424790889,
0.3973083496,
0.1556915492,
-0.1571699083,
0.1278555393,
-0.1030100882,
-0.1715968996,
0.1571451277,
0.0120753273,
-0.1970630288,
-0.2106176466,
-0.1756365597,
-0.1759064794,
-0.0628199205,
-0.0401065424,
-0.2609094381,
0.0049226154,
-0.489007771,
-0.1162075773,
-0.4256094396,
-0.4683547318,
-0.2294390351,
-0.2413152605,
-0.4593436122,
-0.4235489666,
-0.2111190856,
-0.1315101534,
0.0404942594,
0.041947782,
-0.0451758876,
0.2296129912,
-0.164471373,
0.0167803746,
-0.0442779064,
-0.1598862112,
-0.3016821146,
0.0908691064,
0.038463559,
0.3077385426,
0.3564950824,
-0.1310588717,
0.2043779492,
-0.3110779524,
-0.1825405657,
0.0033887371,
0.1127296537,
0.5722733736,
0.4303121567,
0.3833502531,
0.3812004328,
0.0102158654,
0.3864462674,
-0.088432312,
0.1346811652,
-0.1440853775,
0.1837702394,
-0.1304984689,
0.1290676147,
-0.1468417048,
-0.3778320849,
-0.0945280492,
0.2201988995,
-0.3047661185,
0.088040024,
-0.1557005197,
-0.0484125018,
0.2364872098,
-0.38314116,
-0.1040024459,
-0.2310825586,
-0.5189390779,
0.1645468324,
-0.0906725079,
-0.4740206301,
-0.0076209791,
0.0513652787,
0.1766808629,
0.0559085235,
-0.399325937,
-0.5216787457,
-0.0929370001,
0.02214453,
0.3070882261,
0.3270327151,
0.1475024819,
-0.2089835554,
0.0304433554,
-0.1695892066,
-0.247397095,
0.1664075404,
0.0020561006,
0.2740554214,
0.5102773905,
0.2605575323,
0.0484123752,
0.1950864047,
0.1677782238,
-0.1330778152,
0.2533979714,
-0.1815493554,
0.4770169854,
0.3129315078,
-0.3273972273,
-0.0628940091,
-0.0154643655,
-0.0486292355,
0.0327871591,
0.2938309014,
0.1585819274,
-0.3641503155,
-0.1114481986,
-0.3802974224,
-0.373803556,
-0.1508466303,
0.0350631513,
0.1327314973,
0.0921057165,
-0.0486223698,
0.1415051371,
-0.1445543319,
0.0976967216,
0.4092243314,
0.065371193,
-0.1441708803,
-0.3791984916,
-0.4537935257,
-0.3430479467,
0.4417436719,
-0.0403177068,
0.5260640383,
-0.2394114435,
0.2421416491,
0.1949617416,
0.0228846651,
0.6257149577,
-0.8164910078,
-0.0070505626,
0.092834942,
0.0328910351,
-0.3561480939,
0.128404066,
-0.115755111,
-0.0272789169,
0.3937648535,
0.2405101359,
-0.2447445095,
-0.1883089095,
0.1386578232,
0.0054342491,
-0.112837255,
-0.2477955222,
0.003002034,
-0.2437548637,
-0.0549952909,
-0.1995415986,
-0.1693074703,
-0.0894127786,
0.2424607128,
-0.0916551128,
-0.0216373727,
-0.0464586169,
0.0621434972,
-0.1363262534,
0.1105244979,
-0.1554068178,
0.2256639749,
0.437585175,
0.2917256951,
-0.1947758347,
0.2232234478,
-0.266870141,
0.1280411035,
-0.045473367,
-0.0228967965,
0.5653002858,
0.3047225475,
-0.1275053173,
0.2242004275,
0.0120506426,
0.0939893052,
-0.2646260858,
0.0565562844,
0.368678242,
0.1756887287,
-0.2953343391,
-0.3789607882,
0.294713676,
0.0836954489,
-0.2495904863,
0.1924502403,
0.3177803457,
-0.1595832407,
0.2043219507,
-0.1447806209,
1.0169461966,
0.0349389799,
-0.084538281,
-0.0615026169,
-0.4995143414,
0.3972772956,
0.0536319874,
-0.0996957943,
-0.4945425093,
-0.2277208269,
-0.2082974911,
-0.2642941177,
0.2048656046,
-0.0383231789,
-0.1943508536,
0.5626397133,
-0.155604884,
0.254873842,
-0.0557970218,
0.3983103335,
-0.0434017219,
0.1283490062,
-0.2900548577,
0.2098004073,
-0.1040627956,
0.3654922843,
-0.0500561744,
-0.1420090944,
0.1566394269,
-0.2494006753,
-0.3668978512,
0.0266251843,
-0.7568401098,
-0.04917375,
0.2383578867,
0.0457230359,
-0.1346177757,
0.0537238792,
0.1496385783,
0.4605715275,
-0.2692960501,
0.1116432548,
-0.0248333886,
-0.1819414347,
0.2858279049,
0.2463257164,
0.0267922692,
-0.1077812985,
-0.3296500146,
0.0096890796,
0.1551784575,
-0.1951408386,
-0.0431732312,
-0.0618030503,
-0.0139544131,
-0.3604126871,
-0.1586526483,
-0.1269038469,
0.2136033475,
0.076133661,
0.1427555382,
0.2127286345,
0.0423799939,
0.298039794,
0.2540825009,
-0.1287965178,
-0.0947678834,
0.4355383217,
-0.308675468,
0.006369655,
0.0378936343,
-0.0339663438,
-0.2220365405,
-0.1452681422,
0.2257873118,
0.2803984582,
-0.1841595918,
-0.1570625454,
-0.1335283369,
0.2181236744,
-0.2223344892,
-0.2338035703,
0.213887006,
0.1519242674,
-0.0702139512,
-0.5190091133,
0.0507641509,
0.3575648963,
0.1958249509,
0.1384166181,
-0.0674848035,
-0.2428609878,
0.1987521499,
-0.1309933662,
-0.3228833079,
0.2070924193,
-0.2509309351,
0.0342992283,
0.504277885,
-0.1279546767,
0.3872491717,
-0.1507938206,
0.1516044289,
-0.232969299,
-0.1897887439,
-0.1367391795,
-0.091343306,
0.1242058501,
-0.0518358946,
-0.1987398267,
-0.1399903893,
-0.5320917368,
0.0867603123,
0.0653607473,
-0.0412715711,
0.1310140342,
-0.0736202002,
-0.1985258311,
-0.1111867726,
-0.1988465935,
-0.234399572,
0.5295159817,
-0.0517395288,
0.4288690686,
0.0220477134,
-0.0075596347,
-0.1291712224,
-0.2968685925,
-0.0157879908,
0.1475242376,
-0.1545955837,
-0.0495596044,
0.2362098545,
-0.0682053864,
-0.1005273834,
0.2418270409,
0.466055423,
0.0894191265,
-0.2641603351,
0.1111510321,
0.1586782187,
0.1903086007,
0.0985201374,
0.0805363208,
0.2481310219,
0.0509820953,
0.0627992228,
0.0710277557,
0.1104894429,
0.1608980894,
0.0799778327,
-0.0279995259,
0.6018795371,
-0.0124748051,
-0.153420195,
-0.0428464934,
-0.1130862013,
-0.0245189033,
0.1392492801,
0.159964785,
-0.0297672078,
-0.1557418257,
0.0245948732,
0.0581395887,
0.3666992784,
0.1528994888,
0.2531642914,
0.0034273609,
-0.1608127952,
0.1576145142,
-0.2578918338,
-0.1013396829,
-0.1850722283,
0.7514370084,
-0.3354583681,
-0.0197869558,
0.0422042087,
0.2192431092,
0.1011176705,
-0.1890847683,
0.0355265811,
-0.0211015511,
-0.4360975027,
-0.237021789,
0.023532968,
-0.2358254641,
0.2895056009,
0.0476796255,
0.2070528418,
-0.3042058051,
0.0768794566,
0.0670940727,
0.1367952377,
-0.1674615294,
0.220710516,
-0.271069169,
0.5232746601,
0.2478222847,
0.4361561835,
0.4109047949,
0.2475243509,
-0.0898540691,
0.0824172497,
0.01357642,
-0.0878049955,
0.0734699443,
0.1821490526,
-0.0129205547,
0.0544778593,
0.4246552587,
0.2085855007,
-0.0741775855,
0.0050215288,
-0.2670273483,
0.264757514,
-0.1759055853,
0.437674731,
-0.3028049171,
-0.044096265,
-0.4799282551,
-0.1268559247,
-0.5758997202,
-0.1265251786,
0.3075519204,
-0.334597379,
0.1155704185,
-0.2402158976,
0.0843651071,
-0.0755842328,
0.4613204598,
0.4923446178,
0.6064281464,
-0.3703456819,
-0.387916714,
-0.5264346004,
-0.1173709184,
-0.1129509658,
-0.1075246185,
-0.097699739,
0.0565409698,
-0.2380265146,
0.2443147749,
0.1563058197,
0.3593221903,
-0.1874042749,
-0.0764412358,
-0.1741309017,
-0.0336343683,
-0.1541619748,
0.0143576553,
0.0307835713,
-0.2010678053,
0.2596474588,
-0.0500957631,
0.028705446,
0.0635405779,
0.0763312578,
-0.0695215762,
-0.3577855825,
0.2602362931,
0.1772952378,
0.4283645153,
0.1720945388,
0.0787238926,
-0.3032383323,
-0.3302254975,
0.0490187705,
-0.0578020364,
-0.1350288689,
-0.1704175621,
0.1871258616,
-0.1900779158,
-0.2916154265,
0.0989703387,
-0.1606832296,
0.5082815289,
0.2039371133,
-0.2726272047,
0.1324833483,
0.0322692618,
0.1410632432,
-0.0009933085,
-0.1701031923,
0.1290652901,
0.1595218778,
-0.2460216135,
0.3463919163,
-0.26441136,
0.0783221871,
-0.1526685506,
0.415890485,
-0.0216398332,
-0.0334010981,
-0.3338149488,
-0.1911589652,
0.4394246936,
0.0418403186,
-0.1830797046,
0.360408783,
0.0428948849,
0.2880261242,
0.1544222534,
0.1137441173,
0.1443606317,
-0.1935793608,
0.0694857836,
-0.0632313266
] |
https://github.com/huggingface/datasets/issues/1731 | Couldn't reach swda.py | Hi @yangp725,
The SWDA has been added very recently and has not been released yet, thus it is not available in the `1.2.0` version of π€`datasets`.
You can still access it by installing the latest version of the library (master branch), by following instructions in [this issue](https://github.com/huggingface/datasets/issues/1641#issuecomment-751571471).
Let me know if this helps ! | ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.2.0/datasets/swda/swda.py
| 54 | Couldn't reach swda.py
ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.2.0/datasets/swda/swda.py
Hi @yangp725,
The SWDA has been added very recently and has not been released yet, thus it is not available in the `1.2.0` version of π€`datasets`.
You can still access it by installing the latest version of the library (master branch), by following instructions in [this issue](https://github.com/huggingface/datasets/issues/1641#issuecomment-751571471).
Let me know if this helps ! | [
-0.2362144887,
-0.3874822259,
-0.15831846,
-0.0046996097,
0.3615032434,
-0.0226997025,
-0.0685168654,
0.2251033485,
0.0263327397,
0.2184049785,
-0.1205208823,
-0.0072957999,
0.0098906429,
0.3339483142,
-0.0140379285,
-0.2254327983,
0.0509143099,
0.0313129015,
-0.2564316988,
0.0775599778,
0.0202031657,
0.3259122074,
-0.1554063708,
0.2297449261,
-0.1134690791,
-0.0685833171,
-0.0201577377,
-0.0775323734,
-0.1757897586,
-0.4362723529,
0.5638244748,
0.1927216202,
0.1256828159,
0.3472212851,
-0.0001007638,
-0.077124767,
0.4186197221,
-0.0503709689,
-0.1755159199,
-0.3098740876,
0.0497581623,
-0.1840836853,
0.2123493552,
0.1146648973,
-0.2763561606,
-0.3036896586,
0.1272521913,
-0.0963159725,
0.4207451642,
0.0446711592,
0.3689472079,
0.2689454556,
0.483821094,
-0.4246513546,
-0.092454195,
0.1234189495,
-0.0821550041,
0.244276166,
0.0605739132,
-0.0762190372,
0.1396975517,
0.3529838622,
0.1305268854,
-0.0450911485,
0.3011721075,
-0.0452801064,
-0.1961444169,
-0.2342962623,
0.2390603572,
0.1528021395,
0.5129563808,
-0.2608685195,
-0.4449080229,
-0.0117749097,
0.0631322265,
0.0231451709,
0.1606131047,
-0.0162838791,
-0.1544132531,
0.1218492016,
-0.0956054777,
-0.086633563,
-0.1289824694,
0.1462024599,
0.1154019013,
0.0305995923,
-0.2691116631,
0.0719905049,
0.206619218,
-0.3192816973,
0.0528108068,
0.195965603,
-0.10888163,
0.2442480922,
-0.1789728701,
0.0687171444,
0.0610100627,
-0.0150782531,
0.3950172365,
0.0805762485,
-0.1344827414,
0.0119043943,
0.0585583076,
0.0515340194,
0.129762575,
0.0434679911,
0.0165331848,
-0.3237160444,
0.2677386403,
0.2697736025,
0.187641874,
-0.2395908386,
-0.0104301488,
-0.257124275,
-0.3182111382,
-0.3037603796,
0.2617522478,
-0.2514617741,
-0.1170673519,
0.0519807115,
-0.0632576495,
-0.0098855877,
0.0848206356,
0.4707407057,
0.0258668531,
0.0295213647,
0.1808133423,
0.2489557415,
0.0418969803,
0.2536993325,
-0.3355826437,
-0.0228678845,
-0.0963062644,
-0.0400750302,
0.1465429366,
-0.2771795988,
0.3220080733,
-0.0852719769,
0.0394151807,
-0.0062831729,
-0.2069950551,
0.172177434,
-0.0638184398,
0.3616156876,
0.1384341866,
0.103431873,
0.1152967438,
0.0605930798,
-0.0969777703,
-0.2377071977,
-0.1938385367,
-0.2642820776,
-0.2458225638,
0.2662174404,
-0.0662669986,
0.083341293,
-0.1018323824,
0.0710768476,
-0.1863037199,
-0.106562905,
-0.0815841481,
0.033406049,
0.0264020711,
-0.1412681788,
0.3396386504,
0.3164155483,
-0.2243429124,
-0.1330294609,
0.2190389633,
-0.395637393,
-0.0767424107,
0.2020382881,
-0.2344355732,
-0.0362958647,
-0.2745138109,
0.076254651,
0.2386871874,
-0.2935955822,
-0.4345350564,
0.0180811752,
-0.0682201385,
-0.1456339657,
0.0590170734,
-0.0120172799,
-0.1774286181,
0.1605427712,
0.0308522601,
0.0477608815,
-0.0305403545,
-0.0809974819,
0.0124894017,
-0.2905768156,
-0.1029105932,
0.0454878844,
-0.008516849,
0.1289529651,
0.1767853945,
-0.0447489768,
0.2707518637,
0.0093453564,
0.0446857288,
0.2154068053,
0.2782869041,
0.3302980363,
-0.0016547273,
-0.2491439283,
-0.2228254527,
0.0563066863,
0.1059806719,
0.1817085445,
-0.2402730733,
-0.1508600414,
-0.2314829826,
0.0776702315,
0.0272419322,
-0.2084970623,
0.2749222517,
0.0467881374,
0.4856117666,
0.2913157046,
-0.2161176354,
0.2894095182,
-0.0706812367,
0.2030583173,
-0.3141875863,
0.3132791221,
-0.1704609692,
-0.0810312852,
0.2489076704,
0.3151205182,
-0.0067895493,
-0.1510171294,
-0.0285708569,
0.237943396,
-0.323061794,
0.0675036833,
0.2759996951,
0.0608954392,
0.0068594571,
-0.3545849323,
0.0661717206,
-0.0347227678,
0.1070295498,
0.0750184655,
-0.0060903281,
0.2346140891,
-0.0405362211,
0.1180556417,
0.0864084885,
0.2939909399,
0.5806784034,
0.1721523851,
-0.1451497078,
-0.0839137509,
0.0711124912,
-0.3425204158,
0.2790349126,
-0.2193441689,
-0.1918277293,
0.0295596775,
0.296975553,
-0.0106134675,
-0.0616574697,
0.2379883677,
-0.2565303445,
0.0416484103,
0.036580205,
0.2131389976,
0.2801844776,
0.3061872423,
-0.0144226775,
0.1521450281,
-0.0207856297,
-0.1786593199,
0.1268226504,
0.0331971608,
0.0013123092,
-0.0468086042,
0.0002218873,
-0.026139399,
-0.4086172283,
-0.1547626257,
-0.4498319626,
0.1796075851,
-0.0121432664,
-0.0576356575,
-0.2008187026,
-0.4285293519,
-0.0639545619,
-0.3473836482,
-0.4321453273,
-0.3055024445,
-0.0869299695,
0.1230399981,
0.0512894504,
0.2503718138,
-0.034496367,
0.2276601344,
0.0568354204,
0.1265102178,
-0.2285926789,
-0.0626287013,
-0.0975804627,
0.1578878611,
0.0749975815,
0.1486071944,
0.4697659016,
-0.1726647466,
0.2427735627,
-0.307808578,
-0.3838954866,
-0.0681610405,
-0.1170023903,
0.1350693107,
0.4359375834,
0.2606775761,
0.1073091626,
-0.3065447509,
0.3773047328,
-0.3965025842,
-0.2221936285,
-0.1747205257,
-0.1398120224,
-0.1904288232,
-0.1356688291,
-0.0715870187,
-0.3290015161,
-0.3216326237,
0.4432862401,
0.0032813167,
0.013870067,
-0.1150312945,
0.1491565704,
0.3548086584,
-0.3191218972,
0.0954774395,
-0.2415756136,
-0.5166892409,
0.1373101473,
-0.2456364334,
-0.5283468366,
0.2935695052,
0.0682732537,
0.3508425057,
-0.3473398685,
-0.31842345,
-0.2784533501,
-0.2883042097,
0.0639862791,
0.053760197,
0.1304267198,
0.3673383594,
-0.0554450713,
-0.1585009694,
-0.0401853323,
-0.367146343,
0.0235888995,
-0.2736009061,
0.2128952891,
-0.0115491822,
0.5309566259,
0.0039978884,
0.3552600443,
0.256066829,
-0.017917864,
0.2243463993,
-0.0852123424,
0.3694256246,
-0.1641631573,
-0.4451017976,
0.1452632993,
-0.0163215678,
0.334674418,
0.1585908979,
0.2155843973,
0.2309575379,
-0.2864503562,
-0.2261157781,
-0.230014056,
-0.1561430246,
-0.2680588067,
0.0996602699,
-0.1023977771,
-0.0105199702,
-0.0012380924,
-0.1558272541,
-0.0800503269,
0.0561879054,
0.4081969261,
-0.0166642629,
0.2063532025,
-0.456130296,
0.0164850969,
-0.6440908909,
0.2902687788,
-0.1089192778,
0.1169142947,
-0.1910178661,
-0.0648415312,
0.1081864312,
-0.1142507643,
0.7474423647,
0.2149778605,
-0.0458333902,
-0.037172921,
-0.2370028049,
-0.2169667631,
0.0175530463,
0.1022653654,
0.0018342145,
0.1910142601,
0.2641948164,
-0.1633615047,
-0.2779793739,
0.2271233052,
-0.0633484274,
-0.0807681307,
-0.1196163073,
-0.1826631278,
-0.3779202104,
-0.2293116897,
-0.0106892912,
-0.0802819505,
0.366784066,
0.037574321,
-0.1185254976,
-0.097249411,
-0.2570382059,
0.0907770544,
0.2076943517,
0.0661017001,
0.0247234572,
0.12022385,
0.3205240667,
0.2657814622,
0.2866655588,
0.3943687379,
0.1303093135,
-0.3760013282,
-0.0277020819,
0.0071176575,
0.2320279926,
0.1390185356,
-0.2231502235,
0.2771843672,
0.0751575232,
0.3167051673,
-0.3357447684,
-0.0248060506,
0.3693125248,
0.2216687202,
-0.1189089268,
-0.1189016029,
0.2103305459,
0.0107561061,
0.0994335115,
0.1974934638,
0.5864681005,
-0.0503742024,
0.1407934129,
-0.1289323568,
0.8587402105,
-0.1729921252,
0.0596926101,
0.1039237976,
-0.1804527193,
0.7909547687,
0.0750592425,
-0.010505259,
-0.1966326088,
-0.1860005558,
0.0389674418,
-0.0827530026,
0.3374517262,
-0.2728675604,
-0.0060350276,
0.1484437436,
0.0743965432,
0.2465988249,
-0.0903532282,
0.1225633621,
-0.1150697023,
-0.1350623369,
-0.423807025,
0.295578599,
0.0525459126,
0.5171594024,
-0.0467538238,
-0.2380641997,
-0.1474397033,
-0.3192451298,
-0.2377870381,
0.0677688345,
0.0275908764,
-0.0119500021,
0.2533757985,
-0.118350096,
0.0417807885,
0.3251806498,
0.3742046356,
0.130764395,
-0.3935616314,
0.0735671967,
-0.2684693038,
-0.2233151793,
-0.1534224153,
0.2687024474,
0.090008311,
-0.2140217721,
-0.134714365,
0.1969276369,
0.1610653698,
-0.1661102623,
-0.1285463274,
-0.1134868786,
-0.3286352754,
-0.1834148169,
-0.1063455939,
-0.1068628728,
0.0609457493,
-0.2337657511,
0.2167894989,
0.1759257019,
-0.1900969893,
-0.1561125517,
0.2755557597,
-0.0521454141,
-0.0395325944,
0.5391182899,
-0.1666144878,
-0.1935071349,
0.3695307076,
0.1841916293,
-0.1976191103,
-0.2024124563,
-0.235991165,
0.3632259071,
-0.471595794,
-0.0329788774,
0.1850075871,
-0.0187848099,
0.0037763633,
0.1230329126,
0.2124694586,
-0.2078507394,
0.1133642495,
-0.3853943646,
-0.5158317685,
0.2861070335,
-0.0498594046,
0.2116557956,
-0.0426577888,
0.433370471,
0.0629356429,
0.084409602,
-0.4175315797,
0.0381261893,
-0.2708229721,
-0.160228014,
-0.0243168324,
-0.214662075,
0.3230577707,
0.043703936,
0.2889897227,
-0.0086580403,
-0.4189893603,
-0.2767115831,
-0.0424883105,
0.0254527777,
-0.0507051721,
-0.1335798502,
0.1350365728,
-0.1641878933,
-0.1690312922,
-0.0202438701,
0.138589412,
0.2416797429,
0.026136592,
-0.0839851946,
0.1395800114,
-0.0528469123,
-0.0023199092,
0.0482761227,
0.1449995786,
0.1412596703,
-0.0748835728,
-0.0746162981,
-0.3047421873,
-0.08737351,
0.0242527779,
0.1072817743,
0.0247854125,
-0.0389523059,
0.2696347535,
-0.0875187591,
-0.1188456193,
0.1732930392,
0.6467873454,
0.0991854668,
-0.1012161076,
0.3181516528,
0.2585597634,
0.2481139451,
-0.4696616232,
-0.0516959019,
0.0433530882,
0.0658455715,
-0.0724093169,
0.0034566193,
0.015744973,
-0.0013172606,
0.0847940817,
0.0394552872,
0.36806041,
-0.1525167525,
0.2127613127,
0.2981662452,
0.0615513884,
-0.0217195358,
0.2573702037,
0.2060713023,
0.1557852179,
0.4488227069,
-0.3339225054,
0.2098379135,
-0.3700531423,
0.2186115682,
0.00459021,
-0.2674556375,
-0.1844621897,
0.0444293283,
-0.0307831205,
-0.2394089401,
-0.2490414381,
0.4403613806,
-0.2364707887,
-0.1967807561,
-0.3007940352,
0.2721995413,
-0.0936317518,
-0.3123006523,
0.0833825171,
-0.2114218622,
0.1632489264,
-0.134203434,
0.092300795,
-0.2154897898,
0.2986693084,
-0.1910538375,
0.0306886993,
-0.3790188134,
-0.341752857,
0.1006173342,
0.0817703307,
0.1027988642,
0.139815405,
0.1021646112,
-0.0774204135,
0.1495229453,
0.449565649,
0.4510250688,
0.1356547773,
0.2426742762,
0.1698469222,
-0.227265358,
-0.1259880364,
-0.0107407458,
0.3142698109,
0.2791317701,
0.0453249104,
0.2673902214,
0.2546359003,
-0.215630129,
0.0708927512,
-0.1534290612,
0.3682321012,
-0.1705949455,
0.1954408586,
-0.4465489686,
-0.0082835313,
-0.3041037321,
0.2065589726,
-0.3922938704,
0.0303476304,
0.0115933036,
-0.1388447434,
0.0324863866,
-0.3460272849,
0.1592812091,
-0.0455875732,
0.5311892629,
0.2424553186,
0.3454273045,
0.0757068694,
-0.334086895,
-0.4518874288,
0.023365017,
-0.0387931094,
0.1890483648,
-0.204227224,
-0.0423686877,
-0.0280794855,
-0.044406753,
0.1455203444,
-0.0560371317,
0.0207112357,
-0.2269635499,
-0.1657603979,
-0.0735023618,
-0.2578941286,
-0.0830430761,
0.111626707,
0.0362979956,
0.1515350342,
-0.2637986839,
0.101152949,
0.0703667849,
0.5182722807,
-0.1915937215,
-0.1213171557,
0.1917879134,
0.1084796637,
0.2277488559,
0.0284309816,
0.0128327645,
-0.3024170399,
-0.4064075351,
-0.1753894836,
0.2050894797,
0.0517959967,
0.3251954317,
-0.1819048971,
-0.25654459,
-0.1585441083,
0.1949698925,
0.0109829847,
0.2420245409,
-0.2220570743,
0.3535389304,
-0.0386140011,
0.0018602884,
0.3870488405,
0.1296755821,
-0.0972552598,
0.1025543213,
-0.1259049326,
-0.2123663723,
0.6435744762,
-0.2412495166,
0.0517189056,
-0.0005431868,
0.093807891,
0.2518319786,
-0.4103261232,
-0.4838003516,
0.2961051166,
0.1420931965,
0.1774173975,
-0.0935302228,
0.3457148075,
-0.2220896184,
-0.1139116138,
0.0008393633,
0.3805653751,
0.0373099446,
-0.0207492728,
0.2242957801,
-0.0514386185
] |
https://github.com/huggingface/datasets/issues/1729 | Is there support for Deep learning datasets? | Hi @ZurMaD!
Thanks for your interest in π€ `datasets`. Support for image datasets is at an early stage, with CIFAR-10 added in #1617
MNIST is also on the way: #1730
If you feel like adding another image dataset, I would advise starting by reading the [ADD_NEW_DATASET.md](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md) guide. New datasets are always very much appreciated π
| I looked around this repository and looking the datasets I think that there's no support for images-datasets. Or am I missing something? For example to add a repo like this https://github.com/DZPeru/fish-datasets | 55 | Is there support for Deep learning datasets?
I looked around this repository and looking the datasets I think that there's no support for images-datasets. Or am I missing something? For example to add a repo like this https://github.com/DZPeru/fish-datasets
Hi @ZurMaD!
Thanks for your interest in π€ `datasets`. Support for image datasets is at an early stage, with CIFAR-10 added in #1617
MNIST is also on the way: #1730
If you feel like adding another image dataset, I would advise starting by reading the [ADD_NEW_DATASET.md](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md) guide. New datasets are always very much appreciated π
| [
-0.2464447618,
-0.073237747,
-0.2349894494,
-0.0977335721,
0.2804594934,
0.0302641187,
0.2250184864,
0.0864043236,
0.0842461586,
0.2471519411,
-0.0170773175,
0.0281186439,
-0.3046903312,
0.3419504166,
0.2932602167,
-0.1668529958,
0.3030383885,
0.0297716595,
0.1124467254,
-0.1883489341,
-0.1011667475,
-0.0620983168,
-0.1791172624,
-0.3200938702,
-0.1909745187,
-0.0778028145,
-0.2675437629,
-0.2924896479,
-0.2347603291,
-0.2387116402,
0.3272102475,
0.037278574,
0.2575367689,
0.608825624,
-0.0001094966,
0.0936006159,
0.1888520569,
0.0344998576,
0.1902189553,
-0.248905465,
-0.4143953919,
-0.3501293659,
-0.0992010608,
-0.1630507857,
-0.1417375654,
-0.1659958363,
0.340552479,
-0.0920911953,
0.2136178166,
0.1095004156,
0.1909377426,
0.02865275,
0.1526862234,
-0.0124512911,
0.1259149164,
0.4637611508,
-0.4192463756,
0.078726612,
0.363512367,
-0.0840877295,
0.3061644435,
0.3910600543,
-0.0415558256,
-0.0781776607,
0.0574284196,
0.1204651073,
0.0095718252,
-0.6005347371,
-0.0693711415,
0.3455678523,
0.4273529947,
0.1694892645,
-0.4737811983,
-0.2742058039,
0.1135308817,
-0.3056729734,
-0.3639110029,
0.3375840187,
0.0854368955,
-0.0274841953,
-0.5430438519,
-0.5504986048,
-0.1716227531,
0.3525954485,
0.0071944003,
0.1653151512,
0.0343289748,
0.059622962,
0.027578488,
-0.0464015901,
-0.035012152,
-0.1218508929,
-0.0354858376,
0.1890715063,
-0.3749035597,
-0.3790487945,
-0.3840420544,
-0.0489447787,
0.3786397278,
0.1953842193,
0.0268183127,
0.0727600083,
-0.5005360246,
0.1983215511,
0.2776094675,
-0.0487883314,
-0.526248455,
0.2384262234,
0.4992912114,
-0.1025964618,
0.2686317861,
0.0182731505,
-0.2126103938,
0.0345906727,
-0.0959779173,
-0.355653733,
0.0820334256,
0.0555134974,
0.2450481802,
-0.3079969585,
-0.2041279078,
-0.1634492725,
-0.0028694,
-0.0029013548,
-0.0299652647,
-0.0549216866,
-0.0771601275,
0.3101504445,
0.0049458481,
-0.2031582743,
-0.0077232211,
0.1446849555,
-0.3078579903,
0.1587821543,
0.1561159492,
-0.0348394737,
0.1697464883,
-0.3572028577,
0.2749168575,
0.1219057441,
0.1673988849,
-0.1888690591,
0.0184280984,
0.4009967446,
-0.1780538559,
-0.3972993493,
-0.0999810249,
0.1693808436,
-0.1083388329,
0.0679152459,
-0.404515475,
0.0720819905,
-0.2208458483,
0.112301223,
-0.0265457854,
-0.3100791276,
-0.5300803185,
0.4608229995,
-0.1473253965,
-0.1077616662,
0.1482386887,
-0.0510058366,
-0.3330502212,
-0.1678076982,
0.3007889688,
-0.0945540965,
-0.1657099277,
-0.1141157448,
-0.3624179959,
0.2976292968,
-0.0095214983,
0.1803175062,
-0.1027760059,
-0.1470510215,
-0.0156495329,
0.1419139653,
0.4793441594,
-0.116075933,
-0.1822013706,
-0.0977259278,
0.3983663321,
-0.3402422369,
-0.2129779756,
0.486484915,
0.2005527616,
0.0731719211,
-0.2701016963,
0.3275516629,
-0.140384838,
-0.1825857908,
0.164753899,
-0.2831168771,
-0.2380247861,
0.4602393508,
0.4331451654,
-0.0126946839,
0.3475661576,
-0.2191441655,
-0.1625745296,
-0.0068640681,
0.0831412748,
-0.0199105702,
0.6625742912,
0.1291887164,
0.1037044376,
-0.3360136449,
-0.0976159424,
0.2703980803,
0.2004429549,
0.4144098163,
0.0911867991,
0.0119064776,
0.2750262022,
0.2026729882,
-0.0872695297,
-0.1572871059,
0.0078640683,
-0.1088450477,
0.1064416096,
0.0308880918,
-0.3539696932,
0.0372101367,
-0.0923408791,
0.2923875153,
-0.2196454406,
0.6330334544,
-0.1056524739,
-0.0154702682,
0.0786025003,
0.1963057369,
-0.187923491,
-0.1049828753,
0.2716380954,
0.0510786511,
-0.015254301,
-0.0681523159,
0.3380046487,
0.4709869027,
0.5233407021,
-0.6096268296,
0.1475698203,
0.0129982121,
0.0229648035,
0.0183823314,
-0.223199755,
0.2636468709,
-0.0607782304,
0.2634520531,
-0.0805982277,
0.0552258864,
0.2424297035,
-0.0176498163,
-0.1863027066,
0.0340174288,
-0.1354720592,
-0.231754601,
0.0777992606,
-0.3133500218,
-0.3291058838,
-0.4214862585,
-0.0325010754,
-0.0755662024,
0.1321129054,
0.2652237415,
-0.1466513723,
0.1360953897,
0.2810119689,
0.458081007,
0.2789269984,
0.2799296081,
-0.1267133504,
-0.2005003542,
-0.0899405405,
0.0111511378,
-0.0068552047,
0.2319173068,
0.4414567947,
-0.0922075287,
0.2556336522,
0.0863191932,
-0.2216320783,
-0.1761962026,
-0.0946414769,
-0.0566556044,
0.2319621891,
-0.060315758,
-0.0935869589,
-0.4871144593,
0.1330733448,
0.1424442828,
-0.3022171259,
-0.0720267743,
0.0389213711,
-0.2811464071,
0.3109104037,
0.2504755855,
-0.1876746714,
0.5262497067,
-0.1141059101,
0.168660447,
-0.3002618849,
0.0219659805,
0.0994810462,
0.1673242003,
0.1026540473,
-0.319242537,
0.3941643238,
0.4315931201,
-0.0025455817,
-0.2596160471,
-0.6218694448,
0.3442949057,
-0.1961562485,
0.1873704344,
-0.0038361477,
0.038286034,
0.1127836555,
0.31848225,
0.1826595068,
-0.2116437703,
-0.1564265043,
-0.3393567204,
0.0348303914,
-0.126583308,
-0.1262585819,
0.2830402851,
-0.4299686253,
-0.0198201127,
0.1755001694,
0.2003930062,
-0.0757170543,
0.3603029847,
0.4419180155,
-0.196856156,
0.0153547367,
-0.1385999471,
-0.0145580713,
-0.284270227,
0.4448159337,
-0.1399223655,
-0.2531706095,
0.3671401739,
-0.0729260147,
0.0827733353,
0.2562762201,
-0.6753512621,
-0.1112542525,
-0.2079390585,
0.0338670872,
0.2140514851,
0.0628790781,
-0.0092198355,
-0.2110789716,
-0.0579750016,
-0.0709017888,
-0.2626715302,
-0.1191503033,
0.2377871573,
0.3308424056,
0.3337477744,
0.3474174738,
-0.0508265942,
0.2955154479,
0.04184651,
-0.3043085635,
0.5080926418,
0.1708454639,
0.3578546941,
-0.0822674707,
-0.0730765611,
0.1549726427,
-0.013997471,
-0.1258407235,
-0.1660049707,
0.301125288,
-0.2082642019,
-0.3810061812,
0.1994309723,
-0.2339511812,
0.2077827752,
-0.2149607837,
-0.3136377633,
0.3180968165,
-0.2900026739,
-0.2464131266,
-0.0132355141,
-0.0552354343,
-0.2524008453,
0.3302022815,
0.3994358778,
-0.087525934,
-0.4125698209,
-0.0641661361,
-0.3355792761,
0.1341336071,
-0.1440153867,
0.1293900758,
-0.2495230883,
0.5356867313,
0.0486146025,
0.1078268066,
0.4328628778,
-0.4323402047,
-0.4585814476,
-0.2489067167,
-0.2840657532,
0.2490469217,
0.0137832537,
0.0322507657,
-0.0804289132,
-0.1285142452,
0.4602341056,
0.1161305606,
-0.0563444979,
0.5523476601,
-0.2404551506,
-0.2236588001,
-0.2206922919,
0.0754099414,
-0.0589253269,
-0.1352549493,
-0.2169573456,
-0.0127182091,
-0.2157990783,
0.1938744932,
-0.3250811994,
-0.2172664404,
-0.2820438743,
0.0835777372,
-0.1445719898,
-0.0860546306,
0.2058273256,
0.0775972679,
-0.0432378203,
0.2464956045,
0.4906102419,
0.3285130858,
-0.2036204934,
-0.3507890701,
0.1024306044,
0.0513098128,
0.326613903,
-0.0016978503,
0.1138847545,
-0.0288494788,
0.0664542764,
0.0831648856,
-0.2991630435,
0.0079618748,
0.5065004826,
0.2099129111,
-0.3440678716,
-0.4111043811,
0.303799063,
-0.0803540498,
0.1457876861,
0.0603416115,
0.2356192917,
-0.0985827819,
0.1996969283,
0.2182702124,
0.7865891457,
-0.3661303818,
0.021723289,
-0.1699560583,
-0.0276448224,
0.6699266434,
-0.1017893925,
0.1004911959,
0.1861002445,
-0.0697484836,
-0.1985665411,
-0.0281914808,
0.0019196006,
0.0711046681,
0.1636198461,
0.2225093842,
0.509308815,
0.0615022629,
-0.0986589044,
0.139078781,
0.2285279185,
-0.1587291211,
-0.1139914915,
0.2322119176,
-0.117317155,
-0.014721686,
-0.1691865474,
-0.1279063076,
-0.1667532027,
0.3324784636,
-0.4615358114,
-0.1730368584,
0.0875829682,
0.127798751,
0.1244043857,
-0.4775349498,
0.3379824162,
0.3541288078,
0.3576816618,
-0.0059586773,
-0.2773000598,
0.2542754114,
-0.182115227,
-0.2067136019,
-0.2546041608,
-0.1713718176,
0.1231672764,
-0.0283396561,
-0.2673969567,
-0.0030282624,
0.1565461606,
-0.5180782676,
-0.4821410179,
0.0698830634,
0.282066226,
0.3480664492,
0.0350987837,
0.1954478621,
-0.090008162,
-0.0028622074,
0.174632743,
0.2746792138,
0.2125204802,
0.1904275119,
0.2809982598,
0.0064607579,
-0.2811052203,
0.1441838741,
0.1661397666,
-0.040057268,
0.2079947144,
0.0924573839,
-0.0652014762,
-0.1144262925,
0.2407432944,
0.313051343,
-0.0680659488,
-0.1212751046,
-0.1804793775,
0.1700892448,
0.0368521437,
-0.0250450578,
0.1844713092,
-0.3268201947,
-0.1332450211,
-0.3180105984,
0.1126063094,
0.2135601491,
-0.4756159484,
0.4511298537,
-0.1247861385,
-0.0726485401,
0.1455392987,
0.0709101409,
-0.2572882175,
-0.0732547566,
-0.1358040422,
-0.1226662993,
0.1898766458,
0.1770218611,
-0.077791743,
-0.280328691,
0.0019589907,
-0.1329589337,
-0.1806687415,
-0.1255863905,
0.3036169708,
0.1159870923,
0.2453401983,
-0.1540646553,
-0.1141806766,
-0.0983618572,
-0.379880935,
-0.0291683748,
-0.0869642347,
-0.0318116136,
-0.0399777032,
0.1403690279,
0.2658540308,
-0.0729502738,
0.1383340359,
0.2148321271,
0.0143399425,
0.4625807106,
0.3712100983,
-0.0650177822,
0.4889165759,
-0.075488247,
-0.1743278056,
0.0902899131,
-0.1349329799,
-0.2563120723,
0.7665197849,
-0.1000463814,
0.2560341954,
0.0946253464,
0.3729101121,
-0.0319289714,
-0.2949266732,
0.3698742092,
0.2496509701,
0.1652739495,
-0.1704830825,
-0.1848821193,
0.0436837226,
0.2250020951,
-0.0009230613,
0.1780538112,
0.2021027207,
0.3823188841,
-0.1252904832,
0.1218771413,
0.4000945985,
-0.1958662421,
0.3291005194,
-0.1569526345,
0.1640086174,
0.1983258575,
0.0127403308,
0.227869451,
0.0634802952,
0.2766060531,
-0.0325786434,
0.5885313153,
0.1290866137,
0.0567678697,
0.5713601112,
-0.1318249851,
0.0687384456,
0.1127162129,
-0.0274138246,
0.0210778564,
-0.1410952359,
0.1185602024,
-0.0948642418,
-0.1092775911,
-0.1550275683,
0.070473887,
0.1049080938,
0.1272919923,
-0.5323835015,
-0.0167648941,
-0.1656366289,
0.1219399422,
-0.0024040898,
-0.2331487983,
0.0134636527,
0.0971714333,
-0.1814600825,
0.0835474506,
0.029699022,
0.2149151862,
0.0793799385,
-0.0034220605,
0.2248188406,
0.0490241088,
-0.2759842575,
0.0976136476,
0.4896696508,
0.1253912598,
0.051601667,
0.0371331498,
0.0226302333,
0.0143883107,
-0.1855716854,
0.1290103644,
0.0461361296,
-0.0168131273,
-0.1357357055,
-0.0582037345,
0.1124752238,
0.0605412647,
0.2560665309,
-0.1724519581,
0.1230978891,
-0.3439573348,
-0.1288015395,
-0.1697562486,
-0.0752941146,
-0.107289061,
0.1784672588,
-0.3433597386,
0.0491381101,
0.3856395483,
-0.4856769145,
-0.1887184829,
0.1320597082,
0.0575545356,
-0.4405554831,
0.2636917233,
0.4373855889,
0.0780702159,
-0.0032714356,
-0.3652274311,
-0.1010647863,
-0.1627757996,
-0.2862775028,
0.0384079888,
-0.0583504327,
0.0766446367,
0.241432339,
0.1381831914,
0.1278273612,
-0.3685331345,
0.1556268036,
0.0460253954,
-0.2545473576,
-0.1693395078,
-0.0619373694,
0.279389441,
0.0035314017,
0.2072131783,
0.2506817877,
-0.2790713906,
-0.0912711844,
0.0267614853,
0.1174782068,
-0.246589005,
0.0616710372,
0.338470161,
0.0565451905,
0.1937890202,
-0.1457110196,
0.0391256064,
0.0145707512,
-0.2286938131,
-0.0986884087,
0.1057051793,
-0.1536144763,
0.2978625,
-0.2515074015,
-0.177813828,
0.0429251157,
-0.1701202691,
-0.1572859287,
-0.2763393223,
-0.0353283808,
-0.1203955933,
-0.0496348068,
-0.0983005837,
0.2921790183,
-0.1022782847,
-0.03851166,
-0.3568790257,
-0.0475927703,
0.038505327,
0.1455024332,
-0.2158134729,
0.1605534106,
-0.1748200059,
-0.3451701701,
-0.0188896582,
0.2482507378,
-0.4402967095,
-0.1968695372,
0.29896456,
0.2130806595,
-0.1564777046,
0.4072243571,
0.5054078102,
-0.1011881754,
0.0181351621,
0.142724067,
-0.1118075401,
0.0107197342,
-0.2021877319,
-0.1147720069
] |
https://github.com/huggingface/datasets/issues/1728 | Add an entry to an arrow dataset | Hi @ameet-1997,
I think what you are looking for is the `concatenate_datasets` function: https://huggingface.co/docs/datasets/processing.html?highlight=concatenate#concatenate-several-datasets
For your use case, I would use the [`map` method](https://huggingface.co/docs/datasets/processing.html?highlight=concatenate#processing-data-with-map) to transform the SQuAD sentences and the `concatenate` the original and mapped dataset.
Let me know If this helps! | Is it possible to add an entry to a dataset object?
**Motivation: I want to transform the sentences in the dataset and add them to the original dataset**
For example, say we have the following code:
``` python
from datasets import load_dataset
# Load a dataset and print the first examples in the training set
squad_dataset = load_dataset('squad')
print(squad_dataset['train'][0])
```
Is it possible to add an entry to `squad_dataset`? Something like the following?
``` python
squad_dataset.append({'text': "This is a new sentence"})
```
The motivation for doing this is that I want to transform the sentences in the squad dataset and add them to the original dataset.
If the above doesn't work, is there any other way of achieving the motivation mentioned above? Perhaps by creating a new arrow dataset by using the older one and the transformer sentences?
| 43 | Add an entry to an arrow dataset
Is it possible to add an entry to a dataset object?
**Motivation: I want to transform the sentences in the dataset and add them to the original dataset**
For example, say we have the following code:
``` python
from datasets import load_dataset
# Load a dataset and print the first examples in the training set
squad_dataset = load_dataset('squad')
print(squad_dataset['train'][0])
```
Is it possible to add an entry to `squad_dataset`? Something like the following?
``` python
squad_dataset.append({'text': "This is a new sentence"})
```
The motivation for doing this is that I want to transform the sentences in the squad dataset and add them to the original dataset.
If the above doesn't work, is there any other way of achieving the motivation mentioned above? Perhaps by creating a new arrow dataset by using the older one and the transformer sentences?
Hi @ameet-1997,
I think what you are looking for is the `concatenate_datasets` function: https://huggingface.co/docs/datasets/processing.html?highlight=concatenate#concatenate-several-datasets
For your use case, I would use the [`map` method](https://huggingface.co/docs/datasets/processing.html?highlight=concatenate#processing-data-with-map) to transform the SQuAD sentences and the `concatenate` the original and mapped dataset.
Let me know If this helps! | [
0.1183494925,
0.12276797,
-0.0548611805,
-0.02185384,
0.1973935366,
0.30988276,
0.1708182693,
-0.1640381366,
-0.0837009549,
-0.0505273826,
0.2646121085,
0.5609713197,
-0.2010445595,
0.0916977674,
0.3351855278,
-0.2962876558,
0.1142138541,
0.0437107496,
-0.29227525,
-0.0279930662,
0.0021190257,
-0.1372907311,
0.2007563412,
-0.0317323804,
-0.2767155468,
-0.1182214171,
-0.1379704177,
-0.212379247,
-0.1384887248,
-0.5027132034,
0.0087827472,
-0.0272246338,
0.0590721928,
0.3376497924,
-0.000117042,
0.0920340493,
0.2727535963,
0.1627476662,
-0.5811192393,
-0.3001926541,
-0.3158356249,
-0.5750210285,
0.1763756126,
-0.1296512634,
0.1810122877,
-0.34057042,
0.1682193875,
-0.5160607696,
0.3616967201,
0.1440823078,
0.1551564634,
0.0048571159,
0.3422507942,
-0.1587884873,
0.1316576153,
0.2934288681,
-0.1651617587,
0.0660047978,
0.0775926188,
0.1870577037,
0.2107714862,
0.1433062702,
0.2321269512,
-0.1839474291,
0.5127685666,
0.2322123945,
-0.0962179825,
-0.1791200638,
-0.1925226599,
0.1984659284,
0.6475900412,
-0.4157200158,
-0.7800767422,
-0.3988773227,
0.5506302118,
-0.1682529896,
-0.2445784509,
0.2328118682,
0.0239020698,
0.1169854254,
0.0696601421,
-0.4716578722,
-0.192149803,
0.2013755739,
0.0445769802,
0.2364698946,
0.0233942904,
0.0998459309,
0.0355717354,
-0.1198578551,
0.2599286437,
0.0791537017,
-0.1234590262,
0.2387580127,
-0.3096903861,
0.035170801,
-0.2527568042,
-0.1268172264,
0.066355966,
-0.029791655,
0.4854210615,
-0.1098812595,
-0.3336729705,
0.0790679753,
0.2000619024,
-0.0342736132,
0.1430096179,
0.0687185079,
-0.3912688196,
-0.3791763186,
-0.1096802428,
-0.2170019597,
-0.1550949961,
-0.1713347733,
0.2424238324,
-0.167309925,
0.1473713219,
0.3136834204,
0.0629964098,
-0.0935478285,
-0.3020160794,
0.0591253005,
-0.2725583017,
0.0612750761,
0.4182108045,
0.1091534942,
0.1732088476,
0.4408244491,
0.3726043701,
-0.1566443443,
0.025316583,
0.0513318256,
-0.0543775447,
0.3669013977,
-0.2423495948,
-0.0477181263,
0.0371125042,
-0.1206807941,
0.1456052512,
-0.1919992268,
0.0828309283,
-0.0404510871,
0.2058393657,
0.0076232222,
-0.0446059182,
0.1492535025,
0.1150151268,
-0.1696120799,
-0.0430956483,
0.2046018988,
-0.0826666206,
-0.0649525151,
-0.4545917511,
0.0880452767,
-0.027590774,
-0.333545804,
-0.0333482884,
0.4336045682,
-0.0151354801,
0.0004982737,
0.1414940208,
0.009133257,
-0.270319134,
-0.1619906873,
-0.0206432119,
0.1551442146,
-0.5128888488,
-0.4108775854,
-0.2430014014,
0.0905042961,
-0.5492097139,
-0.0854313746,
-0.1658567637,
0.4677466452,
0.0052207587,
0.0477194637,
0.5233315825,
-0.1115104407,
-0.1672391295,
-0.1299366951,
-0.342825532,
0.0833970383,
-0.0064478111,
0.4439300299,
0.1647197753,
0.2340111136,
0.0283421557,
0.2201441973,
0.0826973915,
-0.335924387,
0.2786369026,
0.001565904,
0.2065098137,
-0.1058209315,
-0.3012520671,
-0.0254257545,
0.1261385828,
-0.1821463406,
0.1216384843,
-0.2194677889,
0.2375242114,
0.3060151041,
0.1686581522,
0.2052364647,
-0.1291641742,
-0.1226722598,
-0.2524816692,
-0.0185622517,
0.1810262203,
0.0529474244,
-0.0552388877,
-0.2419681847,
-0.032253813,
0.3225969374,
-0.0610447787,
0.0148525806,
0.0318086669,
0.0758637413,
-0.0819453821,
-0.2782069147,
-0.390285641,
0.4074020982,
-0.0087648444,
0.2047670335,
-0.2296222746,
0.1660538763,
0.2363982797,
0.0036826704,
-0.3240821362,
0.2122142911,
-0.1640316993,
0.0895014554,
0.078945145,
0.1134711504,
-0.1195058227,
0.2341032922,
0.1487383395,
0.0327496007,
0.1080176979,
-0.3662585616,
0.0763281658,
-0.0375731364,
0.0954274833,
-0.0913993642,
-0.354054898,
0.2417163998,
0.1802272201,
0.3580397964,
-0.1495781094,
0.2765899003,
0.1072114855,
-0.0300822742,
-0.4279772639,
-0.2050342113,
-0.1618534029,
0.0159432665,
0.2799842954,
-0.1748910993,
-0.1389583349,
0.0067604072,
-0.0259441957,
-0.1193044335,
0.101304844,
0.1819252521,
-0.5684722662,
0.2896317244,
-0.0735915229,
0.3036426306,
0.361544311,
0.2742062509,
-0.0376006812,
0.1356415004,
0.1420549303,
0.0517569594,
0.0522802249,
0.1145410314,
0.4417295456,
0.0077750878,
0.4800369143,
0.1265676916,
-0.0580534898,
-0.0096647684,
-0.0327761658,
-0.0302464738,
-0.3340158761,
-0.0168454256,
-0.051850535,
-0.1416763812,
-0.5122770667,
-0.1967369914,
-0.0311987568,
-0.3337020278,
-0.0532389395,
-0.2285894305,
-0.071763508,
0.1076776385,
0.1049500257,
0.2497823536,
-0.0766003057,
-0.0839087814,
0.157904774,
-0.1696771234,
0.2582080364,
-0.0121930903,
-0.0431307591,
0.0414118916,
0.3619519472,
0.099379316,
0.108710207,
-0.3433416486,
-0.1797899008,
0.0348750837,
-0.0459055081,
0.1033413112,
0.0131805865,
0.0726373568,
-0.1497794539,
-0.2909353971,
0.081687063,
0.0237179734,
-0.1779967844,
-0.1926496178,
-0.0532521866,
-0.0540066659,
0.0458996855,
-0.0440835617,
-0.567484498,
-0.1944703013,
0.4599407911,
0.1678509712,
-0.0582456365,
0.1613591313,
0.2073465586,
0.2443645895,
-0.0269288402,
-0.0540947467,
0.0441001877,
-0.1064446718,
0.4240248203,
-0.1946118474,
-0.1915543228,
-0.0302556567,
-0.3298680782,
0.0344485231,
0.0987450406,
-0.2150246501,
0.0016386252,
-0.1454132795,
0.2108082622,
-0.1521885395,
0.1087916568,
0.3900869787,
0.0494312271,
-0.0747972652,
-0.1380808502,
-0.4104961753,
0.1876417547,
0.2697167695,
0.1381595731,
-0.039737042,
0.2633513808,
0.0126134679,
0.3805567324,
0.1919940859,
-0.3043583333,
0.046021454,
-0.3049997091,
0.2573344409,
-0.0679782405,
-0.3093287945,
-0.2927862108,
-0.3105884492,
-0.1926642805,
-0.2148533314,
0.142958045,
0.0314570479,
0.1148937866,
0.0599793755,
-0.2940510809,
-0.1667506993,
0.2652805746,
-0.5815131664,
0.2634643912,
-0.1513065547,
-0.2137213796,
-0.4562425911,
0.0570243374,
0.0172464699,
0.0119304759,
0.2096431553,
-0.1302230507,
-0.5189206004,
-0.1052692831,
-0.1825604439,
0.187044844,
0.2848892212,
0.0409297682,
0.2111170143,
-0.1281002611,
-0.0544874743,
0.128632918,
0.4015105069,
-0.2101169676,
-0.5021836758,
0.3108864725,
0.1300799847,
-0.5276563764,
0.1357313246,
0.0001153752,
0.3417446613,
0.0279723052,
0.1077675968,
-0.2061165422,
0.3304410577,
0.2148548216,
0.2868596613,
-0.267498076,
-0.1786042899,
0.0959059671,
0.0080992877,
-0.3620218635,
-0.2194251567,
0.0332349017,
0.0782866105,
0.4012641013,
-0.1648361236,
-0.3028609455,
0.0789415687,
0.1901787966,
-0.1019091681,
0.16427508,
0.3630394638,
0.0984759778,
0.2240504473,
0.1412563622,
0.0841496438,
0.57982409,
-0.0055795047,
-0.5680826306,
-0.3137508929,
-0.2384532094,
0.6173960567,
0.101193741,
0.3702188432,
0.5125345588,
0.0721116811,
-0.1607178897,
-0.0868126601,
0.0316268094,
0.1669403613,
0.1239071786,
-0.4113565087,
-0.4321607649,
0.5005095601,
0.0362602882,
-0.0168645978,
0.2640678585,
0.2928217053,
-0.4001206458,
0.4860455096,
0.1219492778,
0.9126853943,
-0.1145877764,
0.3797576427,
0.0232583657,
-0.3634341955,
0.6220878363,
0.1060950831,
-0.1080736518,
-0.1013952345,
-0.1234061122,
-0.052601099,
-0.2997168601,
0.0754949376,
0.1275456697,
-0.4212496877,
-0.1573469639,
-0.3843894005,
0.0647301972,
0.0013180281,
0.2870394588,
0.0207653064,
-0.3447217643,
-0.2162037194,
0.1235493571,
0.2255607247,
-0.1749015898,
-0.1564712226,
-0.2046266496,
-0.3168250024,
0.0599343367,
-0.6070039868,
-0.289613694,
-0.1706381291,
-0.1501218528,
0.2276557684,
-0.5194823742,
0.2985538244,
0.4806922376,
0.2422144413,
-0.1505768746,
0.010035621,
0.2047695518,
-0.0675520524,
0.2147723287,
0.1130864322,
-0.3405280411,
0.2628996968,
0.2204295397,
-0.2200184464,
0.3842211366,
0.1054165885,
-0.5912261009,
0.2402302474,
0.0444691926,
0.029643666,
-0.2897057831,
-0.2757451236,
0.4203804731,
0.0223817769,
-0.1884149313,
0.0896282867,
0.1498453468,
-0.1582797021,
-0.0848677903,
0.30825001,
-0.212880671,
0.1340118498,
0.0668445379,
-0.0161559023,
0.0898437276,
0.6236746311,
0.1486744434,
0.0013381079,
-0.0669523105,
0.1851018071,
0.3109863997,
-0.3935835361,
-0.0033085041,
0.1122308671,
0.0195168443,
-0.3946281672,
-0.1075056568,
0.1711090207,
0.2316145897,
-0.3769903183,
-0.2538278401,
-0.3830398619,
0.320563823,
-0.057648398,
0.2032016069,
-0.2092087716,
0.2275729775,
-0.0503256433,
0.4206245542,
-0.2381624132,
-0.0382595398,
0.1344932616,
0.0123552568,
0.2349124253,
0.1758815795,
-0.1389643848,
-0.2987450361,
0.0955362543,
0.1382968873,
0.3021365702,
-0.1650758237,
-0.214596808,
0.1436088085,
0.108474344,
-0.0549199842,
-0.0708810613,
-0.1440373212,
0.361142993,
-0.305728972,
-0.2458439916,
0.2038039416,
-0.075425148,
0.103579402,
0.4034572244,
0.2424577773,
-0.1424090564,
0.0249778368,
0.2437244654,
0.1948854625,
0.0925837755,
0.2005089372,
0.1676690876,
0.124620147,
-0.1107251346,
0.3039933443,
0.409586072,
0.0034352359,
0.0307547376,
-0.2148517221,
0.1017240956,
-0.0100515671,
0.2032633871,
0.1487458795,
-0.3235372603,
0.4601845741,
0.0889041498,
0.1834095716,
-0.221522823,
0.0492055044,
0.2862811089,
-0.1571288556,
-0.0184967294,
0.1438930184,
-0.0952476636,
0.3241393864,
-0.3016682565,
-0.0336547382,
-0.2822118104,
0.0678140894,
0.2013260424,
0.1810993701,
0.2624462843,
-0.0867184177,
0.1089947671,
0.1661398858,
0.2174194455,
0.1549298018,
-0.179784745,
0.2321446687,
0.430088222,
-0.0374775454,
0.295637399,
0.2165902257,
0.2032027245,
0.0660922229,
0.3515619338,
0.0029346065,
0.3370351195,
0.4048222005,
0.3064146936,
-0.2324182838,
0.0884145796,
0.251427114,
0.1240268275,
-0.2480945736,
-0.0932429433,
0.0365999602,
-0.0284845028,
-0.1121463701,
0.0026526377,
-0.5771661401,
0.1557991803,
-0.0457029045,
0.1306902021,
-0.3807970583,
0.3548986614,
0.2698543668,
0.0829006284,
-0.1574143767,
-0.0642105043,
-0.1329984367,
0.2097124606,
0.2874041498,
0.4605227113,
0.145506084,
0.0901296586,
-0.0937161073,
0.6465040445,
-0.2929739356,
-0.1388490945,
0.0141245695,
-0.111555174,
-0.0682275072,
-0.1355386078,
0.2433317006,
0.1671343446,
-0.0767859817,
0.1482757926,
0.0829100311,
0.2942552865,
-0.595110774,
0.1925400645,
-0.0541332662,
-0.1810989231,
-0.1505552381,
0.2217445076,
-0.1482460648,
0.0335928798,
0.5801298022,
-0.2220920771,
-0.0291157179,
0.1627807766,
0.03062189,
0.03702062,
0.3156170249,
0.4071693718,
0.5021683574,
-0.08574453,
-0.1438608021,
-0.5734360218,
-0.0659408122,
-0.079212755,
-0.152441144,
-0.0374571979,
0.0093769487,
0.3101042211,
0.3368248641,
0.3097118735,
-0.1413750648,
-0.3536221683,
0.1710348725,
-0.1950475872,
-0.3425098062,
0.3337599635,
0.3418862522,
0.0802904814,
0.1111699343,
-0.2285285741,
0.1602797359,
0.0043952991,
-0.035168238,
-0.0819212645,
-0.1506331116,
-0.07124497,
0.5276622176,
-0.1153397188,
0.3695674241,
-0.0902274549,
0.0822122395,
-0.1922504008,
-0.4513826966,
-0.4487344325,
0.4448752403,
-0.0723154321,
0.3471493721,
-0.3197867572,
0.0114933103,
0.1620357484,
-0.2662710249,
-0.0795007423,
-0.14207533,
-0.4082278311,
0.3657565415,
-0.1145642996,
-0.0250447504,
-0.1423920542,
0.1617484242,
0.0176027585,
0.2556729019,
0.0724256784,
-0.150309667,
0.2750246525,
-0.3098266721,
-0.1333384067,
0.2292266637,
-0.0305892937,
0.1441352814,
-0.1657261997,
-0.763292551,
-0.1766390949,
0.3928309083,
-0.0794501081,
0.0721660554,
0.1734802723,
0.0661077499,
0.0923299491,
-0.1821917593,
0.5891473293,
-0.1789295375,
0.0542210713,
-0.4637469947,
-0.2602522969
] |