html_url
stringlengths
48
51
title
stringlengths
5
268
comments
stringlengths
70
51.8k
body
stringlengths
0
29.8k
comment_length
int64
16
1.52k
text
stringlengths
164
54.1k
embeddings
sequence
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
Hi ! Yes we are working on making `filter` significantly faster. You can look at related PRs here: #2060 #2178 I think you can expect to have the fast version of `filter` available next week. We'll make it only select one column, and we'll also make the overall filtering operation way faster by avoiding many arrow<->python conversions especially during writing. I'll let you know how it goes !
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
68
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. Hi ! Yes we are working on making `filter` significantly faster. You can look at related PRs here: #2060 #2178 I think you can expect to have the fast version of `filter` available next week. We'll make it only select one column, and we'll also make the overall filtering operation way faster by avoiding many arrow<->python conversions especially during writing. I'll let you know how it goes !
[ -0.1237306967, 0.2983857393, -0.020849403, -0.2533700168, 0.1016573384, -0.1387865841, 0.3027841151, 0.6129099727, 0.2476258874, -0.0328548402, -0.0985997468, 0.4860817194, 0.038135834, -0.1835790277, -0.0157278515, 0.1854574829, 0.0900915042, 0.3238479793, 0.3035543561, 0.1020883918, -0.0896563977, -0.1577691436, -0.1881164461, -0.0899893269, -0.0092690364, -0.0232013166, 0.239587307, -0.4195280671, -0.3287960589, -0.1773721725, 0.2975452542, 0.2998763323, -0.1726778299, 0.1115234941, -0.0001252739, -0.0511704162, 0.0480974019, 0.0077386573, -0.2174407691, -0.0757362694, 0.1736851931, -0.2435380816, 0.1387729049, -0.1812334359, 0.0790454894, -0.0927500948, 0.0311846267, -0.0050547943, 0.0181250013, -0.0703877583, 0.0492277145, -0.1021517217, -0.2875939012, 0.274389416, 0.4761997461, 0.2047459781, -0.0083873868, -0.1396255046, 0.3575636744, -0.3982305825, -0.1014354676, 0.5694907904, -0.4970217347, -0.058973778, 0.3547711074, 0.0128876269, 0.1070792973, -0.2253790945, 0.3161905408, 0.1574978977, 0.1816734672, -0.265752703, -0.137652725, -0.2395193279, -0.0685055405, -0.230499655, -0.0747088566, 0.0416634977, -0.4605603516, 0.0094685657, -0.2457594275, -0.2786823213, -0.1020749509, 0.4110221267, -0.4475062788, 0.4533462524, 0.1792584807, 0.2715731263, 0.2482568622, -0.2148009986, 0.0170702189, -0.0379103944, 0.4353071749, 0.55984056, -0.4327189624, -0.188532725, 0.0590472631, 0.0518124104, 0.1920054555, -0.2098819762, -0.1892128289, 0.4369453192, 0.3875010014, 0.0874743387, 0.3505067825, 0.0362561457, -0.0684564561, 0.6006131172, 0.3717555404, -0.1598749012, 0.1043104678, 0.0937727541, 0.0169145465, 0.2993761301, 0.1783024669, -0.383556515, -0.2213902771, -0.1921918094, -0.0098197237, -0.0626159757, -0.2706887126, 0.0100913569, 0.1224387959, 0.3963265419, 0.2601256073, 0.2985356152, -0.1823650151, -0.0098770782, -0.2351268828, 0.0012539662, 0.0751000494, 0.0637566298, -0.0144741312, 0.1764779985, 0.127189815, 0.1445114613, -0.1922738254, 0.00704927, -0.0052529909, 0.1212490574, -0.0002689213, -0.1912534535, 0.2603037059, 0.4908872843, -0.1221283376, 0.3843762279, 0.2474316061, -0.2563824654, -0.3247016668, 0.2783825994, -0.1615213901, -0.2274027467, 0.0900189206, -0.0268312506, -0.0578176416, 0.2852577567, -0.1246040538, 0.6093719602, 0.352545917, -0.1533309966, -0.1372532099, -0.1558423787, -0.2802354693, -0.2027676702, 0.3308410048, -0.0845789611, -0.4108806849, -0.1949425787, -0.2197654545, 0.2936514914, 0.4690003991, 0.3666894436, -0.1443484277, 0.0736396462, 0.3656387031, 0.3744417429, 0.6236246824, -0.0126940235, -0.579128027, 0.0714808106, -0.1642439961, 0.1080872118, -0.1843076348, 0.3767102361, 0.6824874282, 0.1427908093, 0.2814698815, 0.1935899854, -0.0623287559, 0.2590735555, -0.1493915021, -0.1364690065, 0.1592234969, 0.0572828352, -0.017575983, -0.1859791279, -0.0208688937, 0.0384187363, 0.0531386174, 0.0237399787, 0.154809773, 0.0545603335, 0.1606440991, -0.0651809424, 0.121370554, -0.271641314, -0.2506516874, 0.0501647145, 0.4665890336, 0.135252133, -0.3585747182, -0.3654569983, -0.1568948627, 0.1310864985, 0.4029454291, 0.1300917119, -0.0620346889, -0.3364860415, 0.2275575995, -0.204411447, -0.2051122934, -0.0941831172, -0.0602980331, 0.0857653916, 0.0432428755, 0.0083488747, 0.2371554822, -0.0684362054, -0.0852612779, -0.131729722, 0.2426041961, 0.2441399693, 0.1396604776, 0.0777212828, 0.2486260831, -0.1695634723, -0.2477500737, 0.4770073891, 0.0623663142, 0.0963865593, 0.1250980496, -0.1157191545, 0.1698830128, -0.1404643059, -0.5081627965, 0.2969229221, 0.1103785187, 0.6598654985, 0.0501082093, 0.154075399, 0.1797196269, 0.0642937273, -0.1062133238, -0.3445335329, 0.0360429585, 0.0097846836, -0.1476868838, 0.1191623881, -0.0164020807, 0.3111936748, 0.2018047869, -0.0426719859, 0.0906062871, 0.3051791191, -0.1029428467, -0.1918520033, 0.1773735732, -0.1114641353, -0.0233580843, 0.2024943233, 0.1365884542, -0.2860153913, -0.1919524074, -0.0219912864, 0.2376992553, 0.21295017, -0.1489863694, -0.245225504, 0.2079778761, -0.0522847436, -0.3534879684, 0.033016108, -0.0490601696, 0.33630687, -0.2336785495, -0.1825108528, -0.2598515749, -0.142643109, 0.3249368072, -0.1080732793, 0.0476652943, -0.2792333364, 0.3316098154, 0.1832595468, 0.1082331091, 0.1978940517, -0.1676238626, 0.2757029235, 0.0065291449, -0.1713166833, -0.3011425734, -0.4677057862, 0.0129963607, -0.065876551, 0.0555219948, 0.4877011478, 0.2073121816, 0.3975654244, -0.3270416558, -0.2520027757, -0.4476262331, 0.0363564715, -0.0938585028, 0.2299015522, 0.0694780797, 0.532862246, -0.3596932292, 0.0280112401, -0.0339046419, -0.0420933217, -0.0976936966, 0.1281559616, -0.0612135977, 0.230092898, -0.1059905887, 0.2067676634, 0.0523469448, -0.115433991, -0.1115756929, -0.0638524443, 0.3551962674, -0.4245606959, 0.0063694566, -0.298771441, -0.1701814681, -0.0975964814, -0.0731263906, 0.2677830458, 0.428162545, 0.2718479633, -0.0998914763, -0.1488034576, -0.0964545161, -0.1978410184, 0.5476942658, -0.2510445416, -0.0182166398, -0.2387061268, -0.0076115876, 0.1322060227, 0.1117510051, 0.4148821235, -0.0027590096, 0.0404852778, 0.0841104239, -0.2670806944, -0.2934964001, -0.121453926, -0.1879382879, 0.2416301072, 0.6311590075, 0.2827459872, 0.7758924365, 0.1585033536, 0.2212497741, -0.0352502614, 0.0000665616, -0.019969482, -0.0265546367, -0.2585277259, -0.2028666139, -0.2288308144, 0.0017704219, 0.1533157229, 0.2056680173, -0.5505746603, -0.034959957, 0.1599179208, -0.1243150085, -0.3024809957, 0.3074432611, 0.0429908819, 0.1299295872, 0.3579553962, 0.0900827199, -0.4467232823, -0.4382315278, -0.0686123222, -0.1267531514, 0.0090315826, -0.1507374048, -0.6066058874, -0.2665181756, -0.6999787092, 0.2868987322, 0.1216504425, 0.1199996024, 0.2492077947, -0.2503608465, 0.2562128603, -0.1206317097, 0.6425052881, -0.0756214857, -0.2868641317, 0.1585035324, -0.0402054079, -0.6319990158, 0.2532655299, -0.1052063107, 0.1121055037, 0.1583259851, 0.4987237453, -0.5397430658, -0.2433735579, 0.0737015158, 0.1668107808, -0.1530794054, 0.0764807463, -0.0852577388, -0.3236051798, -0.1550812274, 0.2726483941, 0.0012732968, 0.1353931129, 0.472676158, -0.0452168584, 0.1200147495, -0.1234325916, 0.1013452038, 0.3883759081, -0.0829364061, 0.2034127414, 0.0647979677, 0.2924255431, -0.3008711934, -0.0861675665, 0.0826907307, -0.0724690109, -0.1351947039, -0.0698231161, 0.121474877, 0.2875908911, 0.5704535246, 0.0263031386, 0.3826786876, -0.1464603543, 0.2083722353, -0.0090282578, -0.0144841373, -0.2250092328, 0.0013282672, -0.2829304039, -0.3367444873, 0.4052061141, 0.2880268097, -0.2896944284, 0.6709107161, 0.2133117318, -0.1537071317, 0.4451867938, 0.3529539406, 1.0079760551, -0.484875679, 0.1318351924, 0.0028194152, 0.0846739262, 0.3737158775, -0.397153914, 0.2397609055, -0.1637782454, -0.0604240522, -0.0320758596, -0.0690369532, -0.1288758218, 0.1712001115, 0.1313426197, 0.1395166814, -0.0944090933, 0.4635602534, 0.1023126915, 0.1462409794, 0.2702811658, -0.4677020907, -0.0909073204, -0.0055959858, -0.0260199532, -0.2302765548, 0.0807615072, 0.3179076314, -0.1683580428, -0.4044846296, -0.270526439, -0.3155382574, -0.1868192554, 0.0461287685, -0.1413330287, -0.0896043032, -0.1633403301, -0.1179498583, -0.3856495917, 0.1154303774, 0.1286413521, 0.1160672158, 0.4527556002, 0.293882519, 0.1255627275, -0.1649269909, 0.0901219696, 0.0425590053, -0.0523627177, 0.2120886147, -0.0867420509, -0.3952047527, -0.2785109878, 0.1678527445, 0.6052414179, 0.1069876701, -0.0429315753, -0.0353726745, 0.1367548704, -0.2750188708, -0.0082140351, -0.0976499692, 0.035023924, 0.4042137563, 0.0630759001, -0.262144506, -0.0026687132, 0.3417322636, 0.3048810959, 0.0388077199, 0.1938857883, -0.113260068, -0.5539798141, -0.0429440439, -0.0578189902, 0.1937415302, 0.0155413896, 0.0119010024, -0.3469988108, -0.1012730524, 0.0332416333, 0.1828553081, -0.0593057722, -0.0367572829, -0.2799467444, -0.4299450517, -0.0247349814, 0.411711514, 0.1347902715, 0.0436266176, -0.0223998576, -0.1254227459, -0.4318518341, 0.4749074876, -0.1643548012, -0.1609070003, -0.0701544657, 0.3995198607, -0.1253774166, 0.2816862166, -0.1014355347, -0.048559323, 0.0809799582, -0.020003384, -0.0000309497, -0.123020798, 0.1012770534, 0.2107244432, -0.1763363481, -0.1292171776, 0.1146145016, -0.1573331356, -0.1441315114, -0.432955116, 0.1776149869, 0.0241639391, -0.0330143496, -0.3705618083, 0.3870608509, -0.1899459809, -0.0303930454, 0.1495629996, -0.2027789503, -0.1067697927, 0.0635471418, 0.3398326635, 0.0760188848, 0.0470575839, -0.095773302, 0.1340183616, 0.0065676384, -0.2462806404, 0.0288025178, 0.1185763478, 0.041329056, 0.2025999725, 0.1136431843, 0.3781633675, -0.0227019545, -0.0405417681, 0.3674141765, 0.0015127116, -0.2030048072, -0.324555248, 0.3961251974, -0.0828286707, 0.212798506, 0.3578578532, -0.0304120034, 0.118925333, 0.0621137843, -0.231724754, 0.5323961973, -0.2480444908, -0.3125814497, 0.3860904574, 0.2828719616, -0.1621649116, 0.1166019887, 0.1299551278, -0.1021377891, 0.2557515502, -0.118098177, 0.2251508683, 0.1457100809, 0.1153858602, -0.4327335656, -0.0669912249, 0.0590893887, 0.4809486568, -0.1702384055, 0.0535877049, 0.0727178156, -0.1600971818, 0.527610302, -0.0994009078, 0.221912235, 0.2778370082, 0.1126369983, -0.235158965, -0.3627426028, -0.2615090609, 0.0753774047, 0.0202127919, -0.0492385849, -0.3334949911, 0.4740832746, 0.0513869971, 0.254229933, -0.4175321758, 0.1141129583, -0.2918195128, 0.2974714041, -0.1703625321, 0.0429236814, -0.4668003917, 0.312924087, 0.0506230369, -0.3800782561, 0.118115291, 0.3163570166, 0.0049838126, -0.058767762, -0.3002194166, -0.2340755314, -0.0624200329, 0.0377320386, 0.0890230462, 0.0551046841, -0.0459934175, -0.0437046513, -0.0474134423, -0.2555034459, 0.3206149638, 0.194321081, -0.0108286701, -0.0755021274, 0.1178064942, -0.2721931934, 0.027799461, -0.0904488266, 0.2527707219, 0.0565550737, 0.0049552061, -0.1734618992, 0.1501865983, 0.0472343788, 0.009915296, 0.0468126014, 0.241823867, -0.0901387557, -0.0123422798, -0.1436458528, -0.3169911802, -0.4253727794, -0.0527303703, -0.7110068202, -0.3438417614, 0.3633756042, 0.3256100714, 0.4668025672, 0.3856763244, -0.0218872726, -0.1853245646, -0.3303774893, 0.3546030223, -0.1234024614, 0.4170961678, -0.0245325565, 0.1251488775, -0.0768925846, -0.5126942396, 0.3433000743, -0.1628068537, -0.0592576936, -0.0112877609, 0.0658436567, 0.2929893136, 0.2172854543, 0.2603948116, -0.1421015859, 0.1607443541, 0.0618617386, 0.1467075944, -0.118607536, 0.349737674, -0.4658872187, 0.148811996, -0.0536531247, 0.1863916814, -0.1162659824, -0.1365161091, 0.0254056752, 0.074252665, -0.2378189862, -0.1673731655, 0.2110533416, 0.0836496502, 0.2566668987, 0.2304345965, -0.3541635871, -0.0726130158, 0.005215765, 0.0728051364, -0.2791230381, -0.2218243629, 0.547624588, -0.8053920865, -0.4464309812, -0.212472409, 0.0680944175, -0.0251126401, -0.1262600273, -0.13207528, -0.3772803545, 0.2484421879, -0.15590325, -0.305333674, 0.0773434639, 0.1260429919, -0.1556924134, -0.3427357674, -0.0300384574, -0.0093358187, -0.0752350911, -0.5701993108, -0.5153657794 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
@lhoestq Thanks for the response— it's great to hear that we'll be getting a much faster `filter` method soon. However, my use case does also involve using `map` over a single column in order to pre-compute roughly uniformly sized batches, and right now that is also very slow. Is there any plan to make `map` faster for single column operations? If that's not a priority for the maintainers right now, I could try my hand at adding the feature, but I can't guarantee I would do a good job given my lack of familiarity with pyarrow.
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
96
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. @lhoestq Thanks for the response— it's great to hear that we'll be getting a much faster `filter` method soon. However, my use case does also involve using `map` over a single column in order to pre-compute roughly uniformly sized batches, and right now that is also very slow. Is there any plan to make `map` faster for single column operations? If that's not a priority for the maintainers right now, I could try my hand at adding the feature, but I can't guarantee I would do a good job given my lack of familiarity with pyarrow.
[ -0.188561812, 0.3007328808, -0.0062209852, -0.2915564775, 0.1139057577, -0.1251909733, 0.377454102, 0.6256684661, 0.2875322104, 0.0172809847, -0.0364473052, 0.504114151, 0.029043816, -0.1641892046, -0.0369142853, 0.1709659994, 0.1048239544, 0.2638178468, 0.2762958109, 0.1285977662, -0.1054987162, -0.230432421, -0.2212542295, -0.056287501, 0.0027706139, -0.1056097895, 0.1589291096, -0.483915776, -0.2446201742, -0.1703582853, 0.2296720743, 0.3419602811, -0.1645797491, 0.185438022, -0.0001265591, -0.0152951553, 0.0672801584, 0.0046596825, -0.1326863021, -0.0347869769, 0.1036191732, -0.2461565137, 0.0807674676, -0.2282915562, 0.144936949, -0.0729280263, 0.0921784267, -0.0480939299, -0.0118827075, -0.1497034729, 0.0260401443, -0.1085721552, -0.2673381865, 0.2866572738, 0.3932990134, 0.147678718, -0.033367794, -0.1472427696, 0.3618589938, -0.499388963, -0.1028716713, 0.5538045168, -0.4942293763, -0.0468574911, 0.3240176439, 0.0596820973, 0.1114336699, -0.1639346182, 0.2983196974, 0.1498268545, 0.1279605329, -0.2527841926, -0.2238490582, -0.2600061893, -0.0924416855, -0.1685853601, -0.0613484569, -0.0341117308, -0.3952659965, -0.0476743132, -0.2808188498, -0.3235605359, -0.0451245978, 0.3968586922, -0.4360876083, 0.4768283665, 0.2962535322, 0.2747287452, 0.344202131, -0.156251654, 0.0028864257, 0.0076631717, 0.4512864351, 0.5650328994, -0.483846724, -0.1833856106, 0.0761879236, 0.0020669214, 0.1733240336, -0.2895019352, -0.1337256581, 0.4674760103, 0.3749388456, 0.1282305568, 0.3100214303, 0.0715180635, -0.1525915712, 0.5785236359, 0.4499472082, -0.1290876716, 0.0587531254, 0.1226568073, -0.0138662681, 0.2276317924, 0.1756638139, -0.3141234815, -0.3155640662, -0.1293070614, 0.1225789487, -0.1538137197, -0.2330206484, -0.0025996082, 0.0703269541, 0.3658009768, 0.2422052473, 0.2920157909, -0.2204378098, -0.0425458327, -0.1804531515, 0.0192147158, 0.1090092212, 0.0703659281, -0.0252906308, 0.2317007035, 0.1311380714, 0.1572612822, -0.2627331913, 0.0225900412, -0.0427705571, 0.1445609629, 0.0022027418, -0.1336309314, 0.2234645039, 0.3903021216, -0.1576904058, 0.3427305818, 0.1693409383, -0.102992855, -0.3292447925, 0.2667770982, -0.1952236295, -0.2769996822, 0.1620928198, -0.0420511961, -0.0549542867, 0.2621855438, -0.1286168694, 0.5985472798, 0.3813326061, -0.2264778316, -0.161816746, -0.0694187284, -0.3165628314, -0.178333953, 0.2890984416, -0.1079115719, -0.3547851741, -0.2313260585, -0.1878270656, 0.3709039688, 0.4160897732, 0.3849087358, -0.1198676825, 0.1343071163, 0.3266311288, 0.332178086, 0.5479460955, -0.104264386, -0.563965559, 0.0655856431, -0.2416364551, 0.0511497557, -0.1321460158, 0.3440310955, 0.6694215536, 0.0902324617, 0.3183017969, 0.1980743259, -0.1306651235, 0.3279160261, -0.1836321056, -0.2531141043, 0.1532050967, 0.0489019528, 0.0427229814, -0.1249031648, -0.0157542042, 0.0445994698, -0.0129510053, -0.0185177792, 0.1647890359, 0.0602266528, 0.065570727, -0.0913714543, 0.1133536994, -0.2321178168, -0.2884660363, 0.055540055, 0.386517942, 0.1459060013, -0.322902739, -0.3966252506, -0.0392707437, 0.0619345903, 0.431682229, 0.1690210253, -0.0822233111, -0.2904554009, 0.3275696337, -0.2072604597, -0.170535475, -0.1253024936, 0.0233982652, 0.0944539011, 0.0706554949, -0.0197447091, 0.2438314259, -0.0827938914, -0.1178136095, -0.0614261143, 0.2267118543, 0.1529107988, 0.1414234638, 0.0943184495, 0.1466478705, -0.0662407577, -0.1786344349, 0.507537365, 0.0700756013, 0.2343175709, 0.1177431569, -0.1211803481, 0.1545410454, -0.1719129682, -0.5523520112, 0.2861990631, 0.1465555429, 0.6651864052, 0.0841304138, 0.1220775247, 0.1631965935, 0.061851494, -0.070491612, -0.32363832, 0.0100722611, 0.0261883549, -0.1350474954, 0.1274301708, 0.0202221051, 0.2641679645, 0.2843723893, -0.068258971, 0.1308688372, 0.304765135, -0.0523110852, -0.220718652, 0.209638834, -0.1084976867, 0.0057852492, 0.1629598141, 0.1217779219, -0.2879888713, -0.1651798487, 0.0005724281, 0.2164827734, 0.1794388741, -0.1415692717, -0.2166478932, 0.259043932, -0.0143970475, -0.2989132404, -0.010607712, 0.003357023, 0.3582735956, -0.1539957076, -0.2632884383, -0.2762297988, -0.0915412158, 0.3394621313, -0.0426129177, 0.0372454002, -0.3098645806, 0.3070691526, 0.1898730248, 0.1026943475, 0.2113778591, -0.1225051582, 0.2939247787, -0.0268258154, -0.172889635, -0.3328279257, -0.5393304229, 0.0738206357, -0.0852857381, 0.0609380789, 0.3177289963, 0.1754732579, 0.3763108552, -0.3800208271, -0.2234458923, -0.4325367808, 0.0378247499, -0.085877426, 0.0967654735, 0.0850850418, 0.4276984632, -0.356662333, 0.066708602, -0.0191576574, -0.1304147243, -0.0418006554, 0.0976940617, 0.002719827, 0.2611277103, -0.1275750101, 0.2719995379, 0.0730156675, -0.1125069186, -0.069745943, -0.1818048954, 0.3236169219, -0.4373997152, 0.0072228946, -0.2794032991, -0.1387148649, -0.1494147182, -0.0410581827, 0.1951171756, 0.4307053089, 0.2713386416, -0.0999779552, -0.238967061, -0.1302751601, -0.1822678149, 0.571095109, -0.2226638794, -0.016939763, -0.2043391168, 0.0421477854, 0.121865198, 0.0817672089, 0.4627898932, 0.037551593, 0.0420408621, 0.1029869244, -0.2466262281, -0.2813119292, -0.0661423355, -0.2550459802, 0.280043304, 0.5683463812, 0.3082818687, 0.7266681194, 0.0995227247, 0.1849898845, -0.043340303, -0.0169093832, -0.0830328017, 0.0083541032, -0.2422626913, -0.1618504971, -0.2642277181, 0.0175661817, 0.1437633932, 0.1747599244, -0.5115404725, -0.0572758652, 0.1953597814, -0.0673124716, -0.294724822, 0.3095502555, 0.0013087317, 0.1959349215, 0.3222127259, 0.1213773638, -0.5042790174, -0.384334743, 0.0024957284, -0.138325125, 0.0402852073, -0.2440768182, -0.5901769996, -0.201911658, -0.77722615, 0.3221865296, 0.1993766427, 0.1177181602, 0.2021473497, -0.2040206194, 0.1921759546, -0.1418825537, 0.631762743, -0.1416503191, -0.2654161453, 0.1212949455, -0.0658721551, -0.5496021509, 0.1885110885, -0.1124100536, 0.1748042256, 0.143468678, 0.6085751057, -0.5473338366, -0.2011223584, 0.0751435757, 0.1330285817, -0.1246815622, 0.0884884149, -0.0653650612, -0.2612019777, -0.1589335501, 0.2646705508, -0.028597571, 0.080499053, 0.4317058921, -0.0816914588, 0.1488003582, -0.0747328103, 0.0849914625, 0.3523804843, -0.0977419987, 0.1742150486, 0.0473539308, 0.3824130595, -0.3722230196, -0.0965271592, 0.0484999977, -0.0851116702, -0.1281924546, -0.0551701374, 0.0793753564, 0.2917893529, 0.5293637514, 0.0455493964, 0.410818994, -0.1715716869, 0.2378078401, -0.0840342045, -0.1195890829, -0.1207847819, 0.0624491796, -0.296533227, -0.3106877208, 0.3419625163, 0.3424164653, -0.3179951608, 0.7173669934, 0.0572213791, -0.1750313938, 0.4352225065, 0.3283764124, 0.9149359465, -0.5607412457, 0.1422016174, -0.0261076018, 0.168954432, 0.3355848789, -0.3939292431, 0.2626979649, -0.1080004871, -0.0748513639, -0.0103268772, -0.0113868788, -0.1241634339, 0.2502501011, 0.0524289161, 0.1525123864, -0.015694961, 0.5056081414, 0.0496896878, 0.1444935799, 0.3504320681, -0.5191717148, -0.0689041167, -0.0282111336, 0.0522503033, -0.235769242, 0.0680917203, 0.3266518116, -0.1470907629, -0.3844148517, -0.2798957825, -0.3103635311, -0.1332496107, 0.0652173758, -0.163283959, 0.0363331288, -0.2110342681, -0.099297978, -0.3842192292, 0.1073062345, 0.1282981932, 0.0274972171, 0.4499255419, 0.3063402176, 0.1378816217, -0.1738570035, 0.0324998945, 0.0718317777, -0.0743711144, 0.1883497238, -0.133444488, -0.4151906967, -0.3370566368, 0.1551697552, 0.5482295752, 0.0980451852, 0.0058051869, -0.0651198477, 0.0711112767, -0.3431614041, -0.0311352387, -0.0942017958, 0.0626093, 0.4800370336, 0.0269001052, -0.2448756993, 0.0245454088, 0.3853034079, 0.2751038671, 0.0067283511, 0.2028691769, -0.1543507129, -0.5062568188, -0.0726518854, -0.0528795645, 0.1456574053, 0.0340625048, 0.0834870487, -0.3774344623, -0.1931775808, 0.0424481966, 0.207409054, -0.1004486233, -0.0333154872, -0.3305814266, -0.423265636, -0.0712769553, 0.4162351191, 0.2322440892, 0.0238804165, 0.0567829087, -0.1345335543, -0.4628412127, 0.5339360237, -0.1395246387, -0.1586113274, -0.0122110918, 0.3892357647, -0.0375512317, 0.2797934115, -0.0810598433, -0.0000290871, 0.074213706, 0.0025763009, 0.0576241203, -0.0986019447, 0.1095753238, 0.2336111963, -0.230523169, -0.1115555316, 0.188057363, -0.1836696118, -0.158171162, -0.4777016342, 0.2033781707, 0.0635815486, -0.0704590902, -0.3293755352, 0.3687350154, -0.1591832787, -0.0086855143, 0.184200868, -0.1702008843, -0.1051284075, 0.0022570416, 0.3636327982, 0.0898705423, 0.0451489463, -0.0060333014, 0.1071893871, 0.0324232094, -0.1778635085, 0.1130439267, 0.1745916605, 0.0287487209, 0.2241038829, 0.108093448, 0.2784985006, -0.0144755468, -0.0748521388, 0.2693948448, -0.0352370143, -0.2041104287, -0.3471258879, 0.4577022791, -0.0549655072, 0.2916862965, 0.3726934791, 0.0294674933, 0.1111130863, 0.0538084507, -0.280992955, 0.4950437248, -0.2272440791, -0.2665419579, 0.4440735877, 0.3002643287, -0.1433018148, 0.1471914798, 0.0509749167, -0.0859000832, 0.2235790342, -0.0608493015, 0.2653491497, 0.1429328024, 0.1563303471, -0.3695166707, -0.103869766, 0.1376335919, 0.4576833248, -0.0954740047, 0.1299726218, 0.0675003156, -0.1041140854, 0.3830341697, -0.0945927426, 0.2381736934, 0.2927367389, 0.0518168621, -0.2534307539, -0.3368820548, -0.2654070854, 0.0807974637, 0.0562043414, -0.0898933262, -0.2092668116, 0.6242591739, 0.0587937534, 0.3631587029, -0.3136519194, 0.0905774385, -0.3196904063, 0.4099571109, -0.160174489, 0.0982750207, -0.455058068, 0.2978038788, 0.0457875393, -0.2566094995, 0.1654208153, 0.3744316101, -0.0223905426, 0.0160354525, -0.3487822413, -0.2221980095, -0.0723250136, 0.0730133653, 0.0582255125, -0.0306649823, -0.0743527859, -0.0727118105, -0.0337032452, -0.2058105916, 0.2698540688, 0.1440161467, 0.0443665422, -0.1139961556, 0.2203513384, -0.3583985865, 0.0894810408, -0.0856515989, 0.3273704052, 0.0101838559, -0.048624564, -0.2447471917, 0.0983691812, 0.0658927858, -0.0035480876, 0.1109226495, 0.3180925548, -0.0563123971, -0.0112248734, -0.1563533247, -0.3178822994, -0.4366072714, -0.0439393446, -0.7775231004, -0.3388484716, 0.3656426072, 0.2502535582, 0.4327199161, 0.3576800227, 0.0594948903, -0.2541883588, -0.312001735, 0.3594670594, -0.1705428809, 0.4331062436, -0.0254812054, 0.0763305351, -0.0630653352, -0.6112695932, 0.4074577093, -0.0563084073, -0.0882132649, -0.0075219739, 0.0589532256, 0.2174143046, 0.1186418086, 0.3269605935, -0.1543502659, 0.1257506013, 0.0076245144, 0.1343771815, -0.1755223274, 0.4124652445, -0.4547964931, 0.1857275665, -0.0626002103, 0.1543039829, -0.1882399321, -0.1462154686, -0.0242185593, 0.0578405336, -0.2225524187, -0.1250485778, 0.2061218768, 0.1301379651, 0.2073743194, 0.1720455289, -0.3358872533, -0.0327051654, 0.0141505133, 0.0218521208, -0.2987917662, -0.1553069651, 0.484051466, -0.7961947918, -0.465547353, -0.2211010754, 0.0340084694, -0.1171960756, -0.1112646013, -0.1842517555, -0.372202605, 0.2183485031, -0.0547121689, -0.275354594, 0.0352670848, 0.1045649946, -0.1995068789, -0.3591187894, -0.0041882731, -0.0378075913, -0.0730046183, -0.5274661779, -0.5042609572 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
Currently the optimal setup for single-column computations is probably to do something like ```python result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names) ``` This has two advantages: - input_columns="my_col" allows to only read the column "my_col" - remove_columns=dataset.column_names makes `map` only keep the output of your function `f`, and it drops the other columns of the dataset instead of keeping them. Let me know if it improves speed on your side. You can also get more speed by using `batched=True` and setting `num_proc=` for multiprocessing
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
82
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. Currently the optimal setup for single-column computations is probably to do something like ```python result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names) ``` This has two advantages: - input_columns="my_col" allows to only read the column "my_col" - remove_columns=dataset.column_names makes `map` only keep the output of your function `f`, and it drops the other columns of the dataset instead of keeping them. Let me know if it improves speed on your side. You can also get more speed by using `batched=True` and setting `num_proc=` for multiprocessing
[ -0.129483521, 0.3391115367, 0.0107456334, -0.2183184177, 0.0991214514, -0.0936413854, 0.40800789, 0.5750510693, 0.2324597538, 0.0821524635, -0.0695115849, 0.4634191692, 0.0280995145, -0.1797306836, -0.028819738, 0.2203611135, 0.0991646349, 0.3066150546, 0.3233725429, 0.0617820472, -0.1302561164, -0.2138473541, -0.1926398277, -0.0478347726, -0.0517787002, -0.1371711642, 0.1724524945, -0.4266522527, -0.246224761, -0.1342863441, 0.3095405996, 0.3318147659, -0.1605595052, 0.1470036805, -0.0001253524, -0.0406684428, 0.0192109905, -0.02761418, -0.1973939091, -0.0811641067, 0.1680787802, -0.2034989297, 0.1236245334, -0.2444312572, 0.0947879404, -0.1301444322, 0.0337787494, -0.0696482956, -0.0037100017, -0.1487483978, 0.0337339714, -0.1216607168, -0.3191206455, 0.2640786171, 0.4368254542, 0.11920093, 0.0292858183, -0.1973634958, 0.2728894949, -0.3919939697, -0.1034411564, 0.5533385873, -0.4737559557, -0.0747155696, 0.3379893601, 0.0730807036, 0.1299578846, -0.2082923055, 0.3107066751, 0.1420642734, 0.155823037, -0.2844787836, -0.2145439386, -0.2602308393, -0.0650968254, -0.2818906307, -0.0909781605, 0.0619441271, -0.4108319581, -0.0512524731, -0.2575703561, -0.281957984, -0.1185123175, 0.4137210846, -0.5403962731, 0.4640471339, 0.1953421086, 0.2909294963, 0.1714856327, -0.1724506915, -0.000387013, -0.0425583795, 0.4799713492, 0.592042923, -0.4159094989, -0.1651495695, 0.0710030496, -0.03794121, 0.205700919, -0.2445921004, -0.1593007892, 0.4084402323, 0.3382356167, 0.1511623561, 0.3294965029, 0.0680307671, -0.0791233629, 0.5972885489, 0.4532562494, -0.1002959535, 0.174566254, 0.0794558674, -0.034586627, 0.3752579689, 0.2228340507, -0.3177230358, -0.190141201, -0.2148231566, 0.0109903365, -0.007694805, -0.2603749633, 0.0728771985, 0.0439944938, 0.3605628908, 0.2810072005, 0.3244582713, -0.1984218508, 0.0045823324, -0.1865283847, -0.0042485781, 0.0518905893, 0.1187335402, -0.0268215314, 0.1671205461, 0.1928976774, 0.1814215779, -0.1461574137, 0.0213636644, -0.0123188756, 0.0233147144, -0.0547801182, -0.2017877996, 0.2513332665, 0.455992341, -0.0558081903, 0.3779975772, 0.2080504447, -0.2995771468, -0.3604400754, 0.2355452776, -0.1126079932, -0.2335229069, 0.1333260387, -0.0212275833, -0.0874711573, 0.342386961, -0.1555572748, 0.5529486537, 0.3655698895, -0.0892599151, -0.164872244, -0.1550863385, -0.2858023047, -0.1917106211, 0.3239210248, -0.1121317744, -0.3836997449, -0.1963754594, -0.1693080813, 0.2926420867, 0.4127452672, 0.3783280253, -0.0817162991, 0.1228252798, 0.3835410476, 0.3930473924, 0.5803683996, -0.1034063697, -0.5420404077, 0.0425313935, -0.2090379, 0.1126553416, -0.1759264469, 0.3581138849, 0.7156690955, 0.1406579018, 0.3412389755, 0.1964564919, -0.0874867588, 0.2358849347, -0.1443505734, -0.1909594238, 0.0868707746, 0.0933991, 0.0729548484, -0.1783012599, 0.0013813414, 0.0436719805, 0.0437355414, -0.0355438665, 0.2024371922, 0.0922084078, 0.1031506434, -0.0610243306, 0.0884075165, -0.2997897267, -0.4036321938, 0.080364719, 0.4533419609, 0.1321221143, -0.31842345, -0.4617905617, -0.1174542904, 0.0867152512, 0.4272181392, 0.1464285851, -0.056034606, -0.2921651006, 0.2219503075, -0.1985522509, -0.2281974256, -0.1070431396, -0.0053622201, 0.1575300246, 0.0297098346, -0.0352749415, 0.2604258657, -0.0967656821, -0.035677921, -0.044093173, 0.2602743208, 0.2296836674, 0.1976291835, 0.0972479731, 0.2005935758, -0.1151907146, -0.2620401978, 0.4657937288, 0.0628672615, 0.2084217668, 0.073745966, -0.1619643122, 0.161136806, -0.1653589904, -0.5710923076, 0.2745727897, 0.0802077651, 0.6571449637, 0.052398935, 0.114822045, 0.1762300134, 0.0400785953, -0.1104949638, -0.3743604422, 0.025173258, 0.0522623993, -0.1696223319, 0.0909885392, -0.0342405364, 0.2365600467, 0.2350625694, -0.0920961723, 0.1094540954, 0.2645369768, -0.0854294896, -0.1937574148, 0.2097467184, -0.0749381632, -0.0109995231, 0.1932284087, 0.150215894, -0.2479687631, -0.1998438984, 0.0215493031, 0.1492286772, 0.2268423885, -0.1879799962, -0.1777149141, 0.250549376, -0.0165847894, -0.3266108632, 0.0432186052, -0.0124855749, 0.358206898, -0.202712208, -0.2141213864, -0.2567456067, -0.1363751143, 0.3243541121, -0.0836756155, 0.0062988903, -0.3239733875, 0.2826364338, 0.2296165526, 0.0995097905, 0.2094610333, -0.1435080767, 0.3257273138, -0.0073616579, -0.1692800671, -0.2807355523, -0.4938739538, 0.0047151307, -0.0653578416, -0.0360512212, 0.4081599712, 0.2390297502, 0.3726724386, -0.3311494291, -0.2339541912, -0.3956115246, 0.0620726533, -0.1111675724, 0.170346126, 0.0949767455, 0.46699664, -0.331518054, 0.0566568151, -0.0435333252, -0.0225026831, -0.0211130083, 0.0907097459, 0.0183934569, 0.2062327266, -0.1446016133, 0.2502628267, 0.0640239716, -0.1108155251, -0.0677072555, -0.0787984952, 0.366122514, -0.4411119819, -0.0846926793, -0.3175469935, -0.0489357263, -0.0837778747, -0.1027953923, 0.2463254333, 0.4151184261, 0.3067743778, -0.0962075889, -0.1359817833, -0.1121385396, -0.1576298028, 0.6070972085, -0.2828308642, -0.0360733569, -0.1843348444, -0.003188394, 0.1298580468, 0.150556162, 0.4464663267, 0.0410571545, 0.0530789793, 0.0689034164, -0.2580907643, -0.2522447109, -0.1246064603, -0.2612763047, 0.2092583776, 0.5654307008, 0.3206357062, 0.7258671522, 0.1424074769, 0.1577912122, -0.066836834, -0.0433973819, -0.0177741237, 0.0256422572, -0.1868590117, -0.2026441991, -0.2535115778, -0.026058618, 0.1770980805, 0.1996233463, -0.5090253353, -0.0756215155, 0.1815345585, -0.1252079308, -0.3385487795, 0.237581417, 0.0109047154, 0.191151455, 0.3765668273, 0.1332769245, -0.4534006715, -0.4018690288, -0.0390886515, -0.0890866145, -0.0157254115, -0.1809642315, -0.5789365768, -0.1956320405, -0.7405363917, 0.2922461033, 0.1310437918, 0.0847018212, 0.2528215647, -0.2260341048, 0.1941351295, -0.1366335452, 0.5798611641, -0.0825059712, -0.2240749002, 0.1575076878, -0.0124607459, -0.6134452224, 0.1907952577, -0.1679947674, 0.1235226318, 0.1410182714, 0.6254457235, -0.5886573195, -0.2078293562, 0.068564713, 0.1660811603, -0.1751502603, 0.0899862051, -0.1042115986, -0.307954073, -0.1583369076, 0.2863938212, 0.0088716298, 0.0992229953, 0.4500452876, -0.0252193511, 0.0567621291, -0.0831179097, 0.145752877, 0.4208123684, -0.0992943123, 0.1749058813, 0.039794758, 0.3401390314, -0.3165376782, -0.0387110822, 0.0795938596, -0.0590485223, -0.1550712585, -0.0173388608, 0.0238963626, 0.3053066134, 0.5189318061, 0.0065893531, 0.343962431, -0.2133318186, 0.2341221869, -0.0951708853, -0.0126865096, -0.1836413145, 0.0253209807, -0.3267573416, -0.3109097481, 0.4088347554, 0.3397988975, -0.3074756265, 0.6517522335, 0.1854648888, -0.2204728425, 0.4290180504, 0.3837021887, 0.9632580876, -0.5312175751, 0.1537016481, 0.0519700386, 0.1483115256, 0.4319677949, -0.4409226477, 0.2472382486, -0.153526172, -0.0678970888, -0.0565942824, -0.0382302776, -0.1370845735, 0.2240662277, 0.1218887568, 0.2110777497, -0.0712220222, 0.4896337092, 0.122594893, 0.1071575582, 0.3036723435, -0.5117375851, -0.1088018119, -0.0205417983, -0.0519749224, -0.1958558857, 0.0174119212, 0.4405876994, -0.1976060867, -0.3893169761, -0.2506983876, -0.3046149909, -0.1109613553, 0.0474569649, -0.218246296, -0.0003559887, -0.2450837195, -0.0840407908, -0.310416162, 0.1532731801, 0.1600227505, 0.0433561243, 0.4482524395, 0.298635006, 0.1100804359, -0.1192905605, 0.0398939401, 0.081014663, -0.0170776397, 0.2253191024, -0.0950903744, -0.2768139541, -0.2861357927, 0.1231282875, 0.5650429726, 0.0438575111, 0.0576895513, -0.0678043887, 0.1874901056, -0.3127432466, -0.0283287056, -0.0911500379, 0.033296898, 0.416670531, 0.0199962948, -0.2361268997, 0.0099521019, 0.3401908278, 0.3162246644, 0.0180032253, 0.1913573444, -0.1530793905, -0.4885406494, -0.0606078915, -0.0689179525, 0.1285402477, 0.0677285343, 0.0568901338, -0.3558068275, -0.121118851, -0.0483740643, 0.2245288044, -0.0695582777, 0.0142333545, -0.2056831419, -0.4497350454, -0.0702769831, 0.4310664535, 0.2193416208, 0.1123795211, 0.0700830072, -0.1089038551, -0.5081055164, 0.4486722052, -0.1567643434, -0.171313554, -0.1201053113, 0.4468562305, -0.026239112, 0.2871850729, -0.1272632629, -0.0708991066, 0.0952429548, -0.0560170151, 0.0530660115, -0.1106325015, 0.016216211, 0.2148145288, -0.1731275022, -0.0934675634, 0.1737359166, -0.1355859041, -0.1125463471, -0.4212663174, 0.2841620147, 0.0927285552, -0.0122849308, -0.2881918848, 0.3486792743, -0.0896975696, -0.1130396947, 0.1339293569, -0.1787054241, -0.0896439701, 0.0537481904, 0.376432091, 0.0356944501, 0.0578477979, -0.0855769962, 0.1384299248, 0.0209032148, -0.2208878696, 0.0139914714, 0.1287961006, 0.0483879745, 0.2053150833, 0.1468270272, 0.3270039558, -0.0773038715, -0.0844792724, 0.3128418326, 0.0135721145, -0.202216655, -0.2793888748, 0.4110394716, -0.1318182051, 0.2403958142, 0.4100228846, -0.0333230123, 0.1102990657, -0.031325724, -0.2870815694, 0.5734831691, -0.2287263572, -0.2615215182, 0.3842895627, 0.2309412509, -0.1336111426, 0.0989187881, 0.1595329195, -0.1070571393, 0.2939473987, -0.0647356585, 0.2178287059, 0.1471163779, 0.0862332061, -0.4544856846, -0.1338348985, 0.1037921458, 0.4685186148, -0.1169148684, 0.0719065666, 0.0245760735, -0.1990137547, 0.4639550745, -0.0639426783, 0.2119172812, 0.3197754025, 0.077464357, -0.2459578216, -0.365427196, -0.2698217034, 0.0696312785, 0.0449938476, -0.0696031153, -0.3188224435, 0.4536855221, 0.0790151879, 0.2794363797, -0.3466837704, 0.0999404639, -0.2763340473, 0.3596678078, -0.1741618216, 0.0696489513, -0.4111557901, 0.2742772698, 0.0356764272, -0.3283547461, 0.1366630346, 0.2756024897, 0.0271962695, -0.0081169866, -0.3326177001, -0.2413625717, -0.1090972871, -0.0015371554, 0.0518129282, 0.0962477922, 0.0000792742, -0.0458264351, -0.0548204556, -0.1857497692, 0.2693296969, 0.1811868399, -0.0363210663, -0.0674094856, 0.1468576938, -0.3282648027, 0.0668369457, -0.1062715054, 0.3088834286, 0.0234813802, -0.0188530888, -0.141492039, 0.1683294922, 0.0559608378, 0.007331647, 0.0538590364, 0.2261190563, -0.0254494138, -0.0580112003, -0.1612186581, -0.3147874475, -0.4354116321, -0.0354608335, -0.7556965947, -0.482160151, 0.3296384215, 0.2776810527, 0.4234730005, 0.3575218916, -0.038102977, -0.1960169375, -0.3290933967, 0.3978023529, -0.1346129477, 0.4052015841, -0.0876090899, 0.0390785411, -0.0431054235, -0.5718619823, 0.3007230163, -0.0505398586, -0.0730251595, 0.0493573472, 0.0969881862, 0.2359213233, 0.1218984425, 0.2772585452, -0.1566973329, 0.1534970552, 0.0622585192, 0.0690809712, -0.1328701228, 0.4088366926, -0.5085701346, 0.1719643176, -0.0920556486, 0.1988611519, -0.1279171109, -0.1135875881, -0.0078775845, 0.07228145, -0.1708053946, -0.1761431992, 0.1931821108, 0.1397039294, 0.1968315691, 0.2184042633, -0.2370510995, 0.0053682113, -0.0120603759, 0.0910362899, -0.2862002552, -0.2247095555, 0.5315033197, -0.7931775451, -0.4790952504, -0.2157013714, 0.1210277081, -0.057140518, -0.1644338071, -0.1864482164, -0.339509666, 0.2887535095, -0.1777638197, -0.3770124912, 0.0114196651, 0.0803588033, -0.280143559, -0.3226735592, -0.0827906057, -0.0371744893, -0.084702298, -0.5192145109, -0.5552361012 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
Hi @lhoestq , I'm hijacking this issue, because I'm currently trying to do the approach you recommend: > Currently the optimal setup for single-column computations is probably to do something like > > ```python > result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names) > ``` Here is my code: (see edit, in which I added a simplified version ``` This is the error: ```bash pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000 ``` I wonder why this error occurs, when I delete every column? Can you give me a hint? ### Edit: I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the complete dataset and print every sample before calling map. There seems to be no other problem with the dataset. I tried to simplify the code that crashes: ```python # works log.debug(dataset.column_names) log.debug(dataset) for i, sample in enumerate(dataset): log.debug(i, sample) # crashes counted_dataset = dataset.map( lambda x: {"a": list(range(20))}, input_columns=column, remove_columns=dataset.column_names, load_from_cache_file=False, num_proc=num_workers, batched=True, ) ``` ``` pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000 ``` Edit2: May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error: ```python # crashes counted_dataset = dataset.map( lambda x: {"a": list(range(20))}, input_columns=column, remove_columns=dataset.column_names, load_from_cache_file=False, num_proc=num_workers, batched=True, features=datasets.Features( { "a": datasets.Sequence(datasets.Value("int32")) } ) ) ``` ``` File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single writer.write_batch(batch) File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch col_type = schema.field(col).type if schema is not None else None File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field KeyError: 'Column tokens does not exist in schema' ```
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
285
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. Hi @lhoestq , I'm hijacking this issue, because I'm currently trying to do the approach you recommend: > Currently the optimal setup for single-column computations is probably to do something like > > ```python > result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names) > ``` Here is my code: (see edit, in which I added a simplified version ``` This is the error: ```bash pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000 ``` I wonder why this error occurs, when I delete every column? Can you give me a hint? ### Edit: I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the complete dataset and print every sample before calling map. There seems to be no other problem with the dataset. I tried to simplify the code that crashes: ```python # works log.debug(dataset.column_names) log.debug(dataset) for i, sample in enumerate(dataset): log.debug(i, sample) # crashes counted_dataset = dataset.map( lambda x: {"a": list(range(20))}, input_columns=column, remove_columns=dataset.column_names, load_from_cache_file=False, num_proc=num_workers, batched=True, ) ``` ``` pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000 ``` Edit2: May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error: ```python # crashes counted_dataset = dataset.map( lambda x: {"a": list(range(20))}, input_columns=column, remove_columns=dataset.column_names, load_from_cache_file=False, num_proc=num_workers, batched=True, features=datasets.Features( { "a": datasets.Sequence(datasets.Value("int32")) } ) ) ``` ``` File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single writer.write_batch(batch) File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch col_type = schema.field(col).type if schema is not None else None File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field KeyError: 'Column tokens does not exist in schema' ```
[ -0.1297884881, 0.3438466489, 0.0056277923, -0.2346834391, 0.1094862744, -0.1253668666, 0.3955198526, 0.5808494091, 0.2243221849, 0.0691064596, -0.0648775548, 0.4875029027, 0.0244311839, -0.1736373305, -0.0233187862, 0.2062173337, 0.1099479944, 0.3038490117, 0.3059216142, 0.0706641972, -0.0972663537, -0.1960179061, -0.196914807, -0.0473394655, -0.0616182946, -0.096933648, 0.1700526476, -0.4098371863, -0.2656675875, -0.134344101, 0.3225797713, 0.340604037, -0.1604739726, 0.1512901634, -0.0001253172, -0.0479155332, 0.0150219193, -0.0417701527, -0.1860090941, -0.0878246427, 0.1646133363, -0.215706408, 0.1242413744, -0.2357676774, 0.0668420196, -0.1099048257, 0.0184357334, -0.0702935681, 0.0177385211, -0.1491788179, 0.0378247239, -0.1153197065, -0.3119519949, 0.2564550638, 0.4294273853, 0.1337283552, 0.013510868, -0.1886966079, 0.3076251149, -0.416977495, -0.107803449, 0.553212285, -0.4494972229, -0.0867572576, 0.3468252718, 0.0665667504, 0.1131559163, -0.2048593014, 0.2837947309, 0.1231321394, 0.1522665322, -0.2929816246, -0.2057831287, -0.2492103428, -0.0813228786, -0.2832043767, -0.0763931647, 0.0381773189, -0.4349864721, -0.0562033467, -0.265576154, -0.2840896845, -0.1205127686, 0.4191443622, -0.5168408155, 0.4453451037, 0.2073736042, 0.2835459709, 0.1737061441, -0.1643483639, -0.0238908511, -0.0488696694, 0.4914848804, 0.5992773175, -0.4381171167, -0.1678369045, 0.0869322866, -0.0217093043, 0.2280963361, -0.2405299544, -0.1810516566, 0.4192119241, 0.3674303889, 0.1295279562, 0.331545651, 0.0803945661, -0.0740258098, 0.5757722855, 0.4447899163, -0.0879588425, 0.1487138718, 0.0883332938, -0.0260098167, 0.3440795839, 0.2287720889, -0.2832648754, -0.2009661794, -0.2048859894, 0.0376364812, -0.0027049892, -0.2731018662, 0.066160202, 0.0608099476, 0.3648389578, 0.2870670259, 0.2879380584, -0.1871753335, 0.0238856263, -0.2208127081, 0.0010179728, 0.0552802049, 0.1150853634, -0.0744160265, 0.1614283621, 0.2063452899, 0.1675105393, -0.1636314243, 0.0466469191, 0.0027349293, 0.0358752087, -0.0592753105, -0.1801028103, 0.2324699312, 0.4378070235, -0.065989472, 0.3828451037, 0.2269886732, -0.2831006944, -0.3427930474, 0.2607618272, -0.0827740207, -0.2477097511, 0.1496958435, -0.021677006, -0.0964407623, 0.3550900221, -0.1667313725, 0.5624733567, 0.3837341368, -0.1071811989, -0.1672743559, -0.1610995382, -0.2877024114, -0.1954725683, 0.3321767151, -0.0849981308, -0.3995153904, -0.1915384829, -0.1742319316, 0.28517735, 0.4178022146, 0.3706714213, -0.0936105251, 0.1220273674, 0.3517780006, 0.423168838, 0.5522978306, -0.0770866126, -0.5348979235, 0.0360715836, -0.2243871987, 0.1220819354, -0.1777932048, 0.3341088593, 0.7191381454, 0.140087828, 0.3616188169, 0.2063519657, -0.1054340675, 0.2566286325, -0.1739207953, -0.1875507683, 0.1082148105, 0.1010324508, 0.073797524, -0.1838000864, -0.0069083646, 0.013457939, 0.0576997437, -0.0499885045, 0.2077868879, 0.0752975643, 0.1167885363, -0.0806708485, 0.0855278522, -0.2948939204, -0.3675554097, 0.1026487052, 0.4557942152, 0.1674705148, -0.3501775563, -0.4428631663, -0.1378015578, 0.0900199264, 0.4087939858, 0.1375356764, -0.0490505584, -0.3041943312, 0.2227520198, -0.1991464645, -0.2078984976, -0.1095261797, 0.0005808026, 0.1515119523, 0.0227784589, -0.0070037618, 0.2466132194, -0.0959860831, -0.0374679118, -0.0547048375, 0.2666030526, 0.2137800902, 0.1916839778, 0.0870014727, 0.1957301199, -0.1171953157, -0.269302696, 0.4498793781, 0.0647736937, 0.2017661929, 0.0769659355, -0.1623330116, 0.1554093659, -0.1814913452, -0.532812655, 0.3011566401, 0.0802625269, 0.6450636387, 0.0309945494, 0.1309302449, 0.1760701984, 0.0390138179, -0.1072936654, -0.3742184043, 0.0231640954, 0.071396336, -0.1661326587, 0.0815338269, -0.0277553871, 0.2639752626, 0.1907890886, -0.0964990035, 0.0930833519, 0.2626734078, -0.0679097027, -0.1828455925, 0.2262336314, -0.0757436901, 0.0200796872, 0.1824526191, 0.1405411661, -0.2518353462, -0.1768809557, 0.0360903181, 0.1681698859, 0.2130683661, -0.1704659015, -0.1802038252, 0.2561201155, -0.038231723, -0.3358976841, 0.0600581467, 0.0034637973, 0.3546958864, -0.2224045694, -0.2182590365, -0.2511996329, -0.1353281438, 0.3232794404, -0.0828271508, 0.0066936612, -0.2888738215, 0.2953871787, 0.2205251157, 0.1083200127, 0.2351677716, -0.1334855855, 0.3227452934, -0.0152808353, -0.1918011904, -0.2713225484, -0.4650267363, -0.0009277482, -0.0592176691, -0.0043335967, 0.4244781137, 0.2421149313, 0.3905327022, -0.3245842457, -0.2451092601, -0.4025378823, 0.0513648428, -0.1198888123, 0.1941349208, 0.1099304259, 0.4666309655, -0.3420132399, 0.0523040332, -0.0229986031, -0.0488412008, -0.0397744998, 0.091889888, 0.0137827955, 0.2035853863, -0.1543298513, 0.2484566271, 0.0468142033, -0.1075425595, -0.0762661621, -0.0906671435, 0.3686668575, -0.4598108828, -0.0609561391, -0.3338882923, -0.0207143687, -0.1050695479, -0.1179808229, 0.2465786785, 0.4201831222, 0.2896749079, -0.1053841859, -0.1386387199, -0.1294745505, -0.1599314213, 0.6129695773, -0.2647591829, -0.0381002054, -0.1784412265, 0.0093411505, 0.1334379613, 0.1467615515, 0.446778357, 0.0264443643, 0.0575173348, 0.06083785, -0.275960654, -0.2290020287, -0.1141933948, -0.2464479506, 0.2201983929, 0.5735794902, 0.324006319, 0.7751105428, 0.1520699114, 0.1780719161, -0.0513782874, -0.0341672599, -0.0482406206, -0.0013015941, -0.2136192024, -0.1924021691, -0.269032836, -0.0360370837, 0.169447571, 0.2143824697, -0.5216485858, -0.0756611004, 0.1756905615, -0.128286317, -0.3454464674, 0.2591950595, 0.0102546476, 0.1966411918, 0.3793599904, 0.1261279285, -0.4769867361, -0.3877556026, -0.0377532393, -0.088796325, -0.0059978962, -0.1740471274, -0.568756938, -0.1773727536, -0.7664278746, 0.2751239538, 0.1402769685, 0.0863993689, 0.2430048734, -0.216409564, 0.2072668076, -0.1244172454, 0.6251431704, -0.0670730099, -0.2090535164, 0.1638413221, -0.0260794908, -0.6028428078, 0.186306417, -0.1351170689, 0.139392212, 0.159744665, 0.5891288519, -0.6044455171, -0.2002256513, 0.02727044, 0.1462673545, -0.1492121816, 0.0842122212, -0.0748716891, -0.3018999398, -0.1549273431, 0.297274977, 0.041231215, 0.1232825816, 0.4362007678, -0.0189577863, 0.0935053453, -0.0593143925, 0.1476086527, 0.3977613449, -0.0844948888, 0.1703259647, 0.0470633656, 0.3293285668, -0.3318586648, -0.0449539423, 0.0953386873, -0.0621817149, -0.1341527998, -0.0250849407, 0.0251082815, 0.2897004187, 0.552698195, 0.0097047612, 0.3432312012, -0.2175802886, 0.2243481278, -0.0855378807, -0.0361493677, -0.1952144802, 0.0326361395, -0.3006546497, -0.3092264533, 0.3831389844, 0.3159522116, -0.3090575337, 0.6614326835, 0.1723918617, -0.2290066481, 0.460701555, 0.3709947467, 0.9752557278, -0.5129278302, 0.164195627, 0.068820335, 0.1409443021, 0.4058243036, -0.4298226237, 0.2410654724, -0.1704450548, -0.065489091, -0.0597469658, -0.0482002981, -0.1479977667, 0.2164141983, 0.1176717356, 0.1895919442, -0.0597132817, 0.4660337269, 0.1189336181, 0.1150356084, 0.3079611063, -0.5089708567, -0.1210524812, -0.0193633586, -0.0442142859, -0.1744910777, 0.0146517456, 0.3953197002, -0.2156658471, -0.396053493, -0.2694069743, -0.3082790971, -0.1529440731, 0.0520541966, -0.1991597563, -0.0068827718, -0.2173345834, -0.0921343863, -0.3370638788, 0.1279223859, 0.1543778777, 0.0470734052, 0.474373579, 0.3202131987, 0.1288526356, -0.1476275921, 0.0394136831, 0.0699228719, -0.0086879134, 0.1831962168, -0.1061239839, -0.2918615043, -0.2966053486, 0.1253705919, 0.5700808764, 0.0377564281, 0.0270302035, -0.0742999315, 0.1840212047, -0.3169252276, -0.0260618888, -0.0776811838, 0.0350934155, 0.4307334423, 0.0009047682, -0.2017874867, 0.020938484, 0.3638758063, 0.3006708324, 0.0080590174, 0.206295073, -0.1151028723, -0.4882872701, -0.0527709052, -0.0696430057, 0.149847433, 0.04103598, 0.0476446748, -0.3652267456, -0.1214284152, -0.0371271819, 0.2336248755, -0.0485735275, 0.0217264276, -0.1903946698, -0.4643522501, -0.0804055184, 0.4110322297, 0.2061309367, 0.0998194069, 0.0502309874, -0.0862698108, -0.4749447703, 0.4416932464, -0.1632985175, -0.1535956562, -0.0957393646, 0.4342614114, -0.0482693315, 0.2722998261, -0.1264177263, -0.0808701515, 0.0900958702, -0.0530615933, 0.0126380324, -0.1142885759, 0.032047987, 0.2085016668, -0.1704892814, -0.1092703715, 0.1840133667, -0.1446893364, -0.1090039611, -0.4130847454, 0.2695924938, 0.0926883966, -0.0381621905, -0.3210905194, 0.3805539608, -0.1182939261, -0.1029511914, 0.1259244084, -0.1646889299, -0.1021381393, 0.0821014345, 0.3613914549, 0.0257419646, 0.0502006486, -0.0561579242, 0.1461237222, 0.0020496398, -0.1900010705, 0.0345624648, 0.131363526, 0.0368836224, 0.1965009719, 0.1575853825, 0.329246223, -0.0979901552, -0.0720921978, 0.3070290387, 0.0204178914, -0.1972119808, -0.2758507729, 0.4279963076, -0.1215464473, 0.2314720005, 0.40828982, -0.0206351206, 0.0943656117, -0.0256957226, -0.2720079124, 0.5573040247, -0.2318076491, -0.2705377936, 0.3658286929, 0.2138032764, -0.1216494739, 0.0923687071, 0.1510498524, -0.1193655431, 0.2973031104, -0.0749469325, 0.2211152017, 0.1364603341, 0.0955069736, -0.4624135792, -0.1484964788, 0.0889829099, 0.4589466155, -0.1110125631, 0.0684058592, 0.0383400619, -0.1675709933, 0.482098341, -0.0855095759, 0.2303493023, 0.3141025007, 0.0710154176, -0.2378038913, -0.3685977757, -0.2726425529, 0.0645473301, 0.0334116518, -0.0883203745, -0.3147932887, 0.4633408785, 0.0729861557, 0.2775479853, -0.3419553339, 0.065392673, -0.2865809202, 0.3539492488, -0.1692408621, 0.0790556073, -0.4063331187, 0.276299417, 0.0364350528, -0.3371810317, 0.1465806067, 0.304651469, 0.0188883394, -0.0193374734, -0.3063298762, -0.2333144993, -0.1015716195, 0.0132324919, 0.0755575895, 0.0966717303, 0.004931625, -0.048810035, -0.0566598848, -0.2034196258, 0.2960618138, 0.1627052426, -0.0144276582, -0.0858471543, 0.1537095755, -0.3200942278, 0.0671882629, -0.120693855, 0.3084368408, 0.0249783769, -0.0243554134, -0.1464888304, 0.1711667329, 0.048662547, 0.0071859695, 0.0341339037, 0.2107688785, -0.0506977849, -0.048993025, -0.2168072164, -0.3345029652, -0.4528568983, -0.0412935056, -0.7500759363, -0.4522313178, 0.3353931904, 0.2778220475, 0.4331786335, 0.3551088572, -0.0425159559, -0.2030099928, -0.3337240815, 0.4259214401, -0.1469492018, 0.4066607058, -0.0923306271, 0.0507735461, -0.0451680012, -0.5560511351, 0.3085947335, -0.0577568486, -0.062417578, 0.0469006523, 0.0726418123, 0.2363191992, 0.1304048151, 0.2742678523, -0.1506303251, 0.1588124931, 0.0602742881, 0.0844885483, -0.1354201585, 0.4218727946, -0.5123556852, 0.1772308946, -0.0861489624, 0.2297603339, -0.1129932255, -0.1143666804, -0.0214144718, 0.0569009222, -0.16774863, -0.1756370962, 0.1880342364, 0.1494571418, 0.1913278252, 0.2306423932, -0.283662796, 0.0284292046, -0.0291078202, 0.1143974662, -0.2971748114, -0.230112642, 0.5320165753, -0.8063479066, -0.4839924872, -0.208768025, 0.1079519615, -0.0636687055, -0.1608316004, -0.1949750781, -0.348387301, 0.2565124035, -0.1921047866, -0.3577035069, 0.0221793652, 0.0823840946, -0.2597565055, -0.326410681, -0.0814181864, -0.0375559144, -0.0764016435, -0.5289856195, -0.5630182028 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
Hi ! Can you open a separate issue for that ? Also if you could provide a google colab or a sample code to reproduce this issue that would be helpful. On my side I was not able to reproduce this error.
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
42
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. Hi ! Can you open a separate issue for that ? Also if you could provide a google colab or a sample code to reproduce this issue that would be helpful. On my side I was not able to reproduce this error.
[ -0.0739278421, 0.2622621655, 0.0104532465, -0.1460136026, 0.1726151407, -0.0921145678, 0.3422678709, 0.5855397582, 0.2409635484, 0.0138789862, -0.0288185682, 0.4858113527, 0.0747993141, -0.2420251071, -0.0771974474, 0.2121571153, 0.0645875484, 0.352430582, 0.3226825595, 0.0753296092, -0.1231598035, -0.095893234, -0.2396638244, -0.0273081213, -0.1052388698, -0.075635545, 0.2402052283, -0.3865372241, -0.3200218976, -0.1982574761, 0.3132261038, 0.2609865069, -0.2287145704, 0.1817970127, -0.0001276501, -0.0581162609, 0.1082800925, -0.0010414943, -0.1381464899, -0.025062412, 0.109964259, -0.1435804069, 0.1595810652, -0.2177060246, 0.0609917045, -0.1062186137, 0.0007785261, 0.0064210594, 0.0571452342, -0.0390551165, 0.0349225886, -0.082354486, -0.2686337233, 0.2206537426, 0.5313364267, 0.1463050395, 0.0038699359, -0.1021068245, 0.3115447164, -0.3857915998, -0.1269281954, 0.5586368442, -0.4722701013, -0.0148971183, 0.375916183, 0.0052530579, 0.1003194302, -0.258534044, 0.3394192755, 0.134626016, 0.2470729351, -0.2523736656, -0.0744807646, -0.2339120507, -0.0812008232, -0.2421167791, 0.0057816226, 0.069717519, -0.454905957, -0.0236453395, -0.2457006276, -0.2589137256, -0.1095362976, 0.397783339, -0.5061329007, 0.4292735457, 0.1459524035, 0.2955043018, 0.1822727472, -0.2157251835, -0.030717982, 0.0070942976, 0.3852950335, 0.5473135114, -0.5153126717, -0.1205784678, 0.1305546612, -0.0011703353, 0.2056517303, -0.2471280694, -0.2166627944, 0.384457171, 0.3991673589, 0.1074464023, 0.3933252692, 0.1232142076, -0.0664460063, 0.6163375974, 0.397547543, -0.0870264545, 0.07496503, 0.0728809237, -0.0070857927, 0.3263714314, 0.2278842181, -0.3896748424, -0.1523711979, -0.2447276562, -0.0461861975, -0.0112263206, -0.2754250765, 0.0753841996, 0.1497297287, 0.4403755665, 0.2603336275, 0.2501381636, -0.2040502429, 0.0413906462, -0.2743715346, 0.06895037, 0.0466029495, 0.0728697479, -0.1434800923, 0.1552460492, 0.123694554, 0.1516344249, -0.1084839702, 0.0524868034, -0.0320188887, 0.0488276556, -0.0413984954, -0.2150831521, 0.2280820459, 0.5221580267, -0.1386474371, 0.4291600287, 0.229203403, -0.2557507157, -0.3305650055, 0.2962751389, -0.2245362699, -0.2434123755, 0.0945883691, -0.0493417233, -0.0717153251, 0.350597769, -0.1128610075, 0.5079698563, 0.4323571324, -0.1694267392, -0.0945494473, -0.1912848651, -0.3159539104, -0.2156184763, 0.2965352833, 0.0022867098, -0.4213633239, -0.1952866316, -0.2165255845, 0.2711443305, 0.5304784179, 0.4404325187, -0.1246314347, 0.0786658973, 0.2929181755, 0.4428161085, 0.5207014084, -0.0072950423, -0.6128536463, 0.1197997183, -0.21502617, 0.092403248, -0.2039802969, 0.3250975907, 0.6797484159, 0.1578982174, 0.3617908061, 0.1648359597, -0.0221158043, 0.2446765006, -0.1920100451, -0.0925864801, 0.1381863207, 0.0686160028, 0.0109991441, -0.1415878385, 0.020232074, 0.0064285919, -0.0117273405, -0.0229039155, 0.1731660664, 0.1595009565, 0.1444870085, -0.0474598594, 0.1431256235, -0.2540426254, -0.2715234458, 0.0644925088, 0.3877620399, 0.1844186932, -0.3709636629, -0.3565758467, -0.2604983747, 0.1445243359, 0.3517887294, 0.1155857593, -0.0966625959, -0.3039397001, 0.156277597, -0.1436885446, -0.1705749929, -0.0988524854, -0.0689980015, 0.0802978128, 0.0136120021, -0.0565730967, 0.1670725346, -0.106738776, -0.0188669339, -0.1260796189, 0.2792254984, 0.2390749753, 0.0818330422, 0.0696507245, 0.2735041976, -0.1891261637, -0.2591294646, 0.4771986008, 0.0727241188, 0.0756568462, 0.1348818839, -0.1028708592, 0.1460473686, -0.2113200128, -0.4426254928, 0.2642630935, 0.1258785725, 0.6324937344, 0.0156596377, 0.1364631057, 0.2505249083, 0.0159851909, -0.0756257623, -0.3630045354, 0.0850605518, 0.0069791228, -0.0781268403, 0.0950101539, -0.0385917053, 0.2597825229, 0.26162377, -0.0216928609, 0.1133341193, 0.3650848866, -0.1223694384, -0.2129503191, 0.1746501029, -0.1219653487, 0.0306896344, 0.1632502675, 0.1556092352, -0.2093406171, -0.1445567161, -0.0418504849, 0.1894765794, 0.2225819528, -0.1069730818, -0.1777325273, 0.251249671, -0.0443398394, -0.3463543355, 0.057275258, 0.0166500211, 0.3730436862, -0.2785398364, -0.1976840645, -0.2901165783, -0.1320260167, 0.3040946126, -0.101624541, -0.0022885464, -0.3022092581, 0.330300957, 0.1749197841, 0.1361003071, 0.2405021191, -0.1292819083, 0.3036352992, 0.0538430959, -0.1591778249, -0.2672786117, -0.5161722302, -0.014073316, -0.0943456963, 0.0272436589, 0.4950299263, 0.2363529205, 0.3811717927, -0.2868726552, -0.1996531487, -0.4601122141, 0.0901708454, -0.1253235936, 0.2369727939, 0.0723383278, 0.5490540266, -0.3248768449, 0.0652613863, 0.0097932741, -0.0948728025, -0.1028263941, 0.1818609536, -0.0713993758, 0.1781483591, -0.1312663704, 0.2205966115, 0.0725916997, -0.1176747829, -0.106068939, -0.116534844, 0.3740614057, -0.3518951237, -0.0339259058, -0.2666487694, -0.1013845578, -0.1289847046, -0.1214598864, 0.2334732115, 0.4066541493, 0.2464245558, -0.0668165386, -0.0993941426, -0.048872143, -0.1490197778, 0.5926892757, -0.3425277472, 0.0154615268, -0.2961545587, -0.0117683038, 0.0977885127, 0.0548850447, 0.5126541257, -0.0307219531, 0.0438489132, 0.0353365839, -0.3410559595, -0.2484963834, -0.1060232818, -0.1593164206, 0.2240360975, 0.6323901415, 0.2220183462, 0.8341839314, 0.1447575539, 0.2216543257, 0.0119510349, -0.0426452644, 0.0267108195, -0.0763686448, -0.2541620433, -0.1907684207, -0.2126717269, -0.1055903435, 0.1826871932, 0.1845566779, -0.6039084196, -0.0340679064, 0.1278665215, -0.1548551172, -0.292381525, 0.2587529421, 0.0390251242, 0.1774884164, 0.3480664492, 0.1299903244, -0.4443025589, -0.4553520083, -0.0618759245, -0.1176090539, -0.004012987, -0.183815226, -0.6025509834, -0.2310372293, -0.743396461, 0.2902022004, 0.0570854135, 0.1852453351, 0.148081392, -0.1874945313, 0.3190457225, -0.1060246229, 0.6654679179, -0.0883317441, -0.205275923, 0.2013680041, 0.0137273818, -0.6145782471, 0.2049717754, -0.1121037751, 0.1562265754, 0.1993312836, 0.5296481848, -0.5742840171, -0.2019667476, 0.0575856864, 0.1104302704, -0.1622000039, 0.0468528979, -0.1731903553, -0.3812522888, -0.173196286, 0.2843077779, 0.0413602218, 0.1488560885, 0.4511504769, -0.0074327067, 0.1518256962, -0.0816289857, 0.0701244622, 0.392329663, -0.0236006472, 0.1812708825, 0.0604778379, 0.2708534002, -0.2992089391, -0.0366490148, 0.1903485954, -0.0141540393, -0.1260769963, 0.0524566025, 0.0761804283, 0.2690078616, 0.5618199706, -0.0107328855, 0.3450730145, -0.1956552565, 0.2114357352, -0.027457431, 0.0478353165, -0.1078942195, -0.0300554708, -0.3140520751, -0.2903095782, 0.3591681719, 0.2698413134, -0.295355022, 0.6984678507, 0.1862795949, -0.1885773838, 0.510373354, 0.3394590914, 1.0705473423, -0.5219205022, 0.112832725, 0.0534608103, 0.1015214771, 0.3691097796, -0.3902155757, 0.2997530103, -0.2043588161, -0.0891991854, -0.0158888921, -0.1083138064, -0.1283223182, 0.175734356, 0.1561746299, 0.1369955391, -0.1475340426, 0.5164924264, 0.1043540016, 0.1136054844, 0.331913501, -0.454777956, -0.1312395334, -0.0187242627, -0.0495641716, -0.1737530231, 0.0326618217, 0.3124899268, -0.160041362, -0.4126215577, -0.3091059923, -0.2302290201, -0.1692226231, 0.0307714865, -0.1888955235, -0.0267333686, -0.1538738012, -0.1176722422, -0.3874801695, 0.1451997757, 0.0607587025, 0.1745339036, 0.4286746383, 0.218349576, 0.138530314, -0.0833630413, 0.0809009597, 0.0445023626, -0.0414430797, 0.1639079452, -0.1121714264, -0.3609419465, -0.3497933745, 0.1797664613, 0.5157939196, 0.0604192801, -0.0660661161, -0.08892712, 0.1701791286, -0.2673873901, -0.0290574972, -0.122656621, 0.0278314725, 0.4215629101, -0.0281729847, -0.3202714324, 0.0122579262, 0.3402387202, 0.3003232479, 0.0592589676, 0.2638508976, -0.1190322042, -0.5321377516, -0.0510329157, -0.1074717566, 0.1750038415, -0.0514302924, 0.039516665, -0.3658225834, -0.0924720913, 0.0257018134, 0.1605288982, -0.0497599952, -0.0211826414, -0.1983175129, -0.4951261282, -0.0815917403, 0.3578312993, 0.1081928909, 0.0487749614, -0.0044609085, -0.0874784738, -0.4045781493, 0.499032706, -0.1465854496, -0.136707902, -0.1801361442, 0.4135911167, -0.0844877809, 0.2446784824, -0.0438891798, -0.0772113204, 0.0335728079, -0.0159073994, 0.0133826472, -0.0906626806, 0.0758156478, 0.242848888, -0.1449744552, -0.1170036718, 0.0985662937, -0.2193205655, -0.1534195244, -0.4113559127, 0.2653711438, 0.0858707279, -0.0441931076, -0.3793165386, 0.3709972799, -0.1514460146, -0.0596792474, 0.147484675, -0.1912383139, -0.0801937655, 0.1186013296, 0.2735249996, 0.0598948896, 0.0670489073, -0.125429213, 0.1386252642, 0.0044339485, -0.2434278429, 0.0321885571, 0.0120221339, 0.082252413, 0.1938510239, 0.1171854138, 0.3672377467, -0.110228911, -0.0767586827, 0.3427893519, -0.0209615603, -0.2146288753, -0.3234682381, 0.4670251608, -0.0744038075, 0.1410493255, 0.33507967, 0.029564783, 0.1144275367, 0.0224726945, -0.2200227231, 0.5852680802, -0.2514871061, -0.3143303394, 0.3529464602, 0.2052785307, -0.1159586906, 0.196690008, 0.1865802854, -0.1286758929, 0.2911347747, -0.0344511941, 0.1995793283, 0.1337285042, 0.072776258, -0.473195374, -0.1582415402, 0.0127446363, 0.5391822457, -0.1250971556, 0.0851219594, 0.053765662, -0.1533166915, 0.4815628529, -0.1459680647, 0.1932910681, 0.3204517066, 0.0353756361, -0.1911689341, -0.303199321, -0.2898066342, 0.0900631547, 0.037303023, -0.0463065729, -0.234121576, 0.4957739413, 0.017861221, 0.1024554223, -0.397415936, 0.0679678023, -0.2486335635, 0.3070701957, -0.2145028561, 0.0901392326, -0.4960907102, 0.2895279527, 0.0633163601, -0.3176862001, 0.1985583305, 0.3613948524, 0.0273041911, -0.1305035204, -0.2642963827, -0.2342981994, -0.0443608388, 0.0992719382, 0.1438561827, 0.1085518748, -0.0531794354, -0.0908094198, -0.0422813743, -0.2001727223, 0.3480274081, 0.258194983, 0.0295268744, -0.1088975593, 0.0416660421, -0.338994503, 0.0077637564, -0.0848872364, 0.1925149858, 0.1259736568, 0.0392455347, -0.15770787, 0.1781601161, -0.0043511167, -0.0021170806, 0.013780199, 0.2925408185, -0.0124639738, -0.0241866149, -0.2196209133, -0.3401700258, -0.5015772581, 0.0472732484, -0.8133055568, -0.3624010086, 0.4201368392, 0.3210954964, 0.4156704247, 0.2800281644, -0.0129209608, -0.2078254074, -0.3595885932, 0.3166344464, -0.1748296618, 0.4127568305, -0.0687729418, 0.0782633498, -0.0556002557, -0.4907155335, 0.3658679426, -0.1014885381, -0.090752013, -0.0139153693, 0.0890984982, 0.231448859, 0.1879885197, 0.2940821052, -0.1103711724, 0.268280834, 0.0706142932, 0.1088131368, -0.1420526803, 0.280286938, -0.4864359498, 0.1273783594, -0.0036766389, 0.1834309995, -0.0712682456, -0.1329746842, -0.0715486482, 0.0855353326, -0.2166691124, -0.1765099168, 0.205485642, 0.075735867, 0.2305586338, 0.2810199857, -0.244957611, -0.0296313614, 0.0169442184, 0.0897109881, -0.2991916835, -0.2776009738, 0.6093686223, -0.7927549481, -0.5057582259, -0.1406863034, 0.1032544971, -0.0435934663, -0.2085206509, -0.205346182, -0.3382760286, 0.2539302707, -0.1302685142, -0.3445848823, 0.0682523698, 0.0589742884, -0.169132024, -0.2935920656, -0.0291198641, -0.0129505713, -0.1184018999, -0.5401830673, -0.4864799976 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
@lhoestq Sorry I'm just responding now. I'm currently using your recommendation for the map on a single column, and I've gotten it to be fast enough to sort of work for my use case by just setting `num_proc=10`, although it's still quite slow. It's clear that it is still loading the entirety of each row into memory and then discarding everything except the selected column, instead of exploiting the columnar data format to only load the selected column. My code is like this: ``` self.dataset = self.dataset.sort('num_tokens') batch_dataset = self.dataset.map( compute_uniform_sized_batches, batched=True, batch_size=10_000, num_proc=10, input_columns=['num_tokens'], remove_columns=get_columns_all_equal(self.dataset), with_indices=True, fn_kwargs=dict(max_size=tokens_per_batch) ) self.batches = { name: list(zip(split['start'], split['length'])) for name, split in batch_dataset.items() } ``` I find that the processes with higher IDs take significantly longer to complete, presumably because the dataset is sorted by article length and they're loading the entire article text into memory, instead of just the 'num_tokens' column. I should note that my batching procedure would work best if I just used `batch_size=None` and loaded the whole column into memory at once, but I found that this was intolerably slow and gave me no progress information, so I'm using the less than ideal `batch_size=10_000`.
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
195
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. @lhoestq Sorry I'm just responding now. I'm currently using your recommendation for the map on a single column, and I've gotten it to be fast enough to sort of work for my use case by just setting `num_proc=10`, although it's still quite slow. It's clear that it is still loading the entirety of each row into memory and then discarding everything except the selected column, instead of exploiting the columnar data format to only load the selected column. My code is like this: ``` self.dataset = self.dataset.sort('num_tokens') batch_dataset = self.dataset.map( compute_uniform_sized_batches, batched=True, batch_size=10_000, num_proc=10, input_columns=['num_tokens'], remove_columns=get_columns_all_equal(self.dataset), with_indices=True, fn_kwargs=dict(max_size=tokens_per_batch) ) self.batches = { name: list(zip(split['start'], split['length'])) for name, split in batch_dataset.items() } ``` I find that the processes with higher IDs take significantly longer to complete, presumably because the dataset is sorted by article length and they're loading the entire article text into memory, instead of just the 'num_tokens' column. I should note that my batching procedure would work best if I just used `batch_size=None` and loaded the whole column into memory at once, but I found that this was intolerably slow and gave me no progress information, so I'm using the less than ideal `batch_size=10_000`.
[ -0.1100344062, 0.2694857717, -0.0035481937, -0.2267880887, 0.1348386109, -0.1574562788, 0.3228948414, 0.5779768229, 0.2516375184, 0.0171540268, -0.0084353834, 0.5262537003, -0.0003766716, -0.219946593, -0.0524404757, 0.2328758538, 0.0863024667, 0.2980627418, 0.323153913, 0.1050169617, -0.1054407656, -0.1746152639, -0.1898674667, -0.0851238072, -0.0808419585, -0.0479379557, 0.2107253075, -0.3849205971, -0.2996506095, -0.199813813, 0.2933185697, 0.2998623848, -0.1688533425, 0.1480012089, -0.0001249938, -0.0329317972, 0.0593606718, -0.0150164925, -0.1549154669, -0.0841841698, 0.135383755, -0.2224758565, 0.0945757553, -0.2144911587, 0.0507807732, -0.1102485061, 0.0543325245, -0.034723036, 0.0267528556, -0.0667864531, 0.0478332937, -0.0883958191, -0.3118807673, 0.2385988683, 0.4412197173, 0.1660654545, 0.0005607754, -0.1601060629, 0.338162303, -0.3996120989, -0.1329920292, 0.4940267503, -0.4622112811, -0.0765881017, 0.3967832327, 0.031940572, 0.0792655796, -0.2212286144, 0.308726728, 0.1258923113, 0.197462216, -0.2818249166, -0.0885779932, -0.2058187276, -0.0772379488, -0.2547156215, -0.0588704161, 0.0190498158, -0.4656489789, -0.0028988915, -0.2404752672, -0.2685698271, -0.1122996658, 0.4409019351, -0.5037671328, 0.4319306314, 0.2216347307, 0.2682174444, 0.2149715126, -0.2014350891, -0.0521682315, -0.021135129, 0.4715500474, 0.5985532999, -0.4138294756, -0.183000803, 0.1064463332, 0.0227844715, 0.2341976166, -0.2586017251, -0.1823877543, 0.435572505, 0.3492280245, 0.1186511368, 0.3513983488, 0.0338762067, -0.0562197343, 0.5463653207, 0.4081634879, -0.0972750112, 0.1370316446, 0.0992178321, 0.0056038685, 0.3168945909, 0.225174427, -0.3960948586, -0.235884726, -0.1837450415, 0.0351983085, -0.0079398584, -0.2091795951, 0.0445252843, 0.0754380077, 0.4448007643, 0.2787966728, 0.3084744811, -0.2266312242, -0.0192544982, -0.2351521552, 0.0280100107, 0.0535935424, 0.0838450938, -0.0949302018, 0.1802846789, 0.1423443854, 0.1708377004, -0.1454723626, 0.014830675, -0.0590240881, 0.1263820529, -0.0375050828, -0.183740139, 0.2449112535, 0.4446517229, -0.1490410566, 0.373437047, 0.2086370885, -0.1996189654, -0.3181156516, 0.3277809024, -0.1003848612, -0.2305616736, 0.110336259, -0.0251124352, -0.0854819268, 0.3163961768, -0.0983735919, 0.5966131091, 0.3636239171, -0.1567467898, -0.1268095076, -0.1794045717, -0.3244420886, -0.2377981395, 0.3155623972, -0.0559913516, -0.4163646996, -0.2329701334, -0.1773408055, 0.301484108, 0.4253208041, 0.3679704964, -0.1312419921, 0.0589309782, 0.3872958422, 0.4368958473, 0.5277867913, -0.027613759, -0.6045194864, 0.0641091764, -0.1901940703, 0.0697049052, -0.1573719084, 0.3717439771, 0.6730758548, 0.1712279767, 0.3508667648, 0.202046603, -0.0436726809, 0.2744268477, -0.1774671972, -0.2010708451, 0.1675621867, 0.0992525965, 0.0320844203, -0.2219466865, -0.0036628209, 0.0244347304, 0.0568583533, 0.0123089245, 0.1843397617, 0.0709386617, 0.130535394, -0.0961135179, 0.1153457612, -0.273971051, -0.2958950698, 0.0815800875, 0.3843159974, 0.1637856215, -0.3264376223, -0.3511690199, -0.1811511666, 0.0926749408, 0.3969916403, 0.0968649685, -0.0634367317, -0.3534479439, 0.1967140585, -0.148975879, -0.1934260726, -0.1466524154, 0.002497904, 0.1042878628, 0.0114266239, -0.0093632489, 0.206490919, -0.1165341735, -0.0471432135, -0.1154089868, 0.2352764606, 0.2410051525, 0.1672468632, 0.0823832303, 0.2372438908, -0.1647633314, -0.3285941184, 0.4697250128, 0.1023415774, 0.1482243091, 0.116306074, -0.1425988823, 0.1648343205, -0.1604893804, -0.5011024475, 0.2884661555, 0.1480736583, 0.6134448051, 0.0310938507, 0.111445412, 0.1854690015, 0.0051050261, -0.0606540404, -0.3591533303, 0.0357490331, 0.0971322283, -0.1129213497, 0.1017361581, -0.0033516586, 0.2966713011, 0.1944945604, -0.0443627238, 0.0852870867, 0.3028742373, -0.1270781308, -0.1970973611, 0.2345538586, -0.1604049206, 0.032026682, 0.1957665086, 0.0991942585, -0.281847626, -0.1702194512, 0.0116473772, 0.198062405, 0.1764260679, -0.1119158268, -0.1793753058, 0.2269994617, -0.0561371557, -0.3452412486, 0.0782020763, -0.0096060969, 0.3562092185, -0.2056917697, -0.2208712995, -0.2761364281, -0.1030509025, 0.3162034452, -0.1026304811, -0.0073959539, -0.256550163, 0.3267334998, 0.2095457315, 0.133966893, 0.2215712667, -0.1613436341, 0.297568202, 0.0058619082, -0.1849834472, -0.2740887105, -0.5016185641, 0.0176582951, -0.0662833527, 0.0460663624, 0.4536602497, 0.2173229307, 0.4591346085, -0.3362982273, -0.179595679, -0.396332562, 0.0620957427, -0.1257806122, 0.2041711062, 0.0657642186, 0.5384757519, -0.311121434, 0.0434606634, -0.0108583905, -0.1486569494, -0.0590966716, 0.133243382, -0.0285289995, 0.1866469979, -0.1014212668, 0.2132214308, 0.0452918261, -0.1045641899, -0.0941850096, -0.0347687602, 0.3498977423, -0.4197886288, 0.0379531756, -0.2923448682, -0.0674608126, -0.1448164433, -0.1258464307, 0.2819061279, 0.4338941872, 0.2763318121, -0.1003727764, -0.1484422386, -0.0836176127, -0.1696135104, 0.5442783833, -0.2675813735, -0.0086103007, -0.2266429812, 0.0212723911, 0.1478113532, 0.0819821507, 0.5152599216, 0.002617199, 0.0346799865, 0.0704882145, -0.2937100232, -0.22697559, -0.0938411057, -0.1578364223, 0.2495296299, 0.5338845253, 0.3260045052, 0.7934352756, 0.1655192971, 0.1323275566, -0.0513936579, -0.0149195381, -0.0418810956, -0.0051872283, -0.1926887631, -0.1869393438, -0.2549143434, -0.0303341709, 0.1843655258, 0.1866320968, -0.5919130445, -0.021659784, 0.167176947, -0.0917180255, -0.3089049757, 0.2933987379, 0.0843447298, 0.1379098296, 0.3415700197, 0.1316806972, -0.4720875025, -0.4646474719, -0.027671406, -0.126592055, -0.0257077925, -0.1839931905, -0.5926154256, -0.1910199821, -0.7978944182, 0.2661315203, 0.1182486713, 0.1145837232, 0.2113719285, -0.2573487461, 0.2431062162, -0.1332241297, 0.6605281234, -0.0738666877, -0.2266157269, 0.1603887528, 0.0352549553, -0.6176285148, 0.2366259098, -0.0847609937, 0.1380903721, 0.1354447007, 0.5151340961, -0.5808651447, -0.1864309311, -0.0015592687, 0.1045729965, -0.1565128118, 0.0389334038, -0.1103154644, -0.2894622087, -0.1778403074, 0.2542252839, 0.0160691068, 0.1212346554, 0.4547691941, 0.0177705809, 0.1650834978, -0.1009040996, 0.102508232, 0.3889808655, -0.0775689781, 0.1896749884, 0.040972352, 0.3473919332, -0.3493168354, -0.0358290821, 0.1072767675, -0.0601994991, -0.0921043083, -0.014563608, 0.0785513967, 0.262989223, 0.5754068494, 0.0660439506, 0.3655551076, -0.1661544442, 0.1807443202, -0.0545159876, -0.0270432159, -0.1794124246, -0.0380457416, -0.2959173024, -0.2920765281, 0.3691779673, 0.2954034805, -0.3009770811, 0.672113657, 0.1318917871, -0.1752947271, 0.4907176793, 0.3872978091, 1.0202455521, -0.5151746869, 0.1723367572, 0.0334808156, 0.1508071423, 0.332259953, -0.3836836517, 0.2518130541, -0.2208799422, -0.0677123517, -0.0308353715, -0.0808010921, -0.151211679, 0.2147797644, 0.0942202508, 0.1282655895, -0.0474691018, 0.510155201, 0.0963327289, 0.1301908791, 0.3080349267, -0.4673939943, -0.0732322186, -0.00138136, -0.0190657098, -0.2065101862, 0.0376518555, 0.3536545038, -0.203134805, -0.3892400861, -0.2511253655, -0.2868536115, -0.2169195712, 0.0470671803, -0.1523421556, -0.0498478636, -0.1734867394, -0.0575116128, -0.426120162, 0.0908012092, 0.0768962726, 0.1112437546, 0.4666805267, 0.2333109379, 0.1339196563, -0.1408436149, 0.0918303579, 0.070733726, -0.0359876305, 0.2393048704, -0.0997866243, -0.3629200161, -0.3013518155, 0.1551560163, 0.5723895431, 0.032322254, -0.0212120637, -0.0529673994, 0.1434833109, -0.2560230196, -0.0062222192, -0.1069570929, 0.0837671906, 0.4150019288, 0.0248401631, -0.2222279757, 0.0027733278, 0.3920271099, 0.2615512013, 0.0367485508, 0.213591665, -0.1123169139, -0.520922482, -0.0463463962, -0.0708208382, 0.1633600146, 0.0231659487, -0.0265087467, -0.3171162307, -0.1171123236, 0.01957497, 0.1998365968, -0.0635650754, -0.0542220734, -0.2133339047, -0.4395652711, -0.0956654474, 0.4088522792, 0.122377798, 0.0639258623, -0.0121866614, -0.0877248347, -0.4353477955, 0.4807342589, -0.1761666834, -0.1444410533, -0.0618594661, 0.3912006915, -0.1011156142, 0.2439952046, -0.095853813, -0.117139861, 0.0701483786, -0.0281528533, 0.0058825538, -0.1220167652, 0.0532573536, 0.2138762921, -0.1364700645, -0.1235968247, 0.1105300486, -0.1912610233, -0.1196228266, -0.4049902856, 0.2113596201, 0.0740710869, -0.0717807114, -0.3361970782, 0.4533843398, -0.1535308063, -0.0540485755, 0.1692801267, -0.1950562, -0.0557622947, 0.1005156338, 0.3331465423, 0.0248840861, 0.051539056, -0.0787414163, 0.191961363, 0.0267483201, -0.2102128416, 0.0367625579, 0.1012554765, 0.0444505662, 0.1786357462, 0.1139470339, 0.3573234677, -0.1206505969, -0.0631424189, 0.3542404175, 0.023921432, -0.1925200969, -0.3094850481, 0.4062330127, -0.0966022164, 0.220908761, 0.3701666594, 0.0328850001, 0.0865342319, 0.0035622455, -0.2328658253, 0.5390008092, -0.2743961215, -0.3363250196, 0.3552636802, 0.2743501067, -0.1701663584, 0.1596385688, 0.1653810143, -0.0558429509, 0.2616036832, -0.0424908474, 0.2302850336, 0.1165558398, 0.0800238401, -0.4942274392, -0.1290121675, 0.0336449556, 0.5174557567, -0.1757682711, 0.0897555649, 0.095224686, -0.0697379559, 0.4977816641, -0.0909486189, 0.2404044122, 0.2748414278, 0.083155863, -0.2219696343, -0.3533064723, -0.278216064, 0.0571990311, 0.0608379394, -0.0785313621, -0.3210175633, 0.513825953, 0.0657214373, 0.188808918, -0.3860411048, 0.1302871704, -0.2775844634, 0.340927124, -0.1915676892, 0.07723701, -0.4894477129, 0.2793102562, 0.0836869627, -0.3684571087, 0.149759993, 0.3017207682, -0.0487072878, -0.041964367, -0.3215754628, -0.2263537347, -0.091624245, 0.0591269806, 0.0959442109, 0.0303703472, -0.0479739867, -0.044466354, -0.0575386882, -0.2394274771, 0.3788042665, 0.1721911132, 0.0436848812, -0.1113567054, 0.1614056826, -0.3382186294, 0.0898444131, -0.1136473715, 0.2642889917, 0.085645929, -0.0494223312, -0.1938247234, 0.1661051065, 0.0220226981, 0.0127769038, 0.0175334662, 0.2497020066, -0.1321566403, -0.0404033437, -0.1920134127, -0.3410745859, -0.4634930193, -0.0235705525, -0.7484761477, -0.3901869059, 0.3368365169, 0.2894302607, 0.4407715201, 0.346067518, -0.0725474954, -0.1604888439, -0.3481917977, 0.3894008994, -0.1362976134, 0.4280391335, -0.0501282476, 0.104673475, -0.0555282794, -0.525703907, 0.3427485228, -0.1517550349, -0.0740505606, -0.0272012651, 0.0453906357, 0.2259250283, 0.2163020819, 0.2984825075, -0.1649972796, 0.1771683842, 0.0547535121, 0.0956384465, -0.1418910474, 0.4147329628, -0.5043900609, 0.1182054281, -0.0312296189, 0.1689736694, -0.1039677039, -0.1184642762, -0.0020998046, 0.0843593627, -0.205490157, -0.1556858569, 0.1682893038, 0.0690803081, 0.2219384909, 0.2420840114, -0.3701492846, 0.0222016387, -0.0190852024, 0.1013264135, -0.293906033, -0.2079079747, 0.4910786152, -0.8021828532, -0.4429042935, -0.1894975454, 0.0487754084, -0.0894785523, -0.1487005204, -0.1571355462, -0.3269066215, 0.2224560529, -0.153099522, -0.3893985152, 0.0274789594, 0.0684687942, -0.2264367044, -0.3367838264, 0.0118872179, -0.0051300945, -0.0711206049, -0.5593319535, -0.515224874 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
Hi @norabelrose ! I'm glad you managed to make this work on your side. Regarding memory usage, you can try to drop the columns that you don't want to use for your `map` for now. In the future we'll try to find a way to not load unnecessary columns in memory in `map`. Currently the way it works is that it gets the batch as a python dict, then it updates it using the output of your mapping function, and finally it removes columns from `remove_columns`. Therefore for a moment some columns are loaded in memory even if you remove them or don't use them for your mapping function. It would be nice to have a way to optimize memory for cases such as yours !
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
126
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. Hi @norabelrose ! I'm glad you managed to make this work on your side. Regarding memory usage, you can try to drop the columns that you don't want to use for your `map` for now. In the future we'll try to find a way to not load unnecessary columns in memory in `map`. Currently the way it works is that it gets the batch as a python dict, then it updates it using the output of your mapping function, and finally it removes columns from `remove_columns`. Therefore for a moment some columns are loaded in memory even if you remove them or don't use them for your mapping function. It would be nice to have a way to optimize memory for cases such as yours !
[ -0.1090222299, 0.2856530845, -0.0173124038, -0.1360489279, 0.174315542, -0.0846631527, 0.2768234909, 0.5508021116, 0.2953394055, -0.0280731618, -0.0430036262, 0.4847537279, -0.0104957372, -0.2168286145, -0.076649189, 0.1780526638, 0.087916553, 0.2981180251, 0.2514614165, 0.1253353357, -0.1527183056, -0.1559895128, -0.1923486143, -0.1331227124, -0.1440613866, -0.0799408033, 0.1867876053, -0.3805734217, -0.2664019465, -0.2372179627, 0.2627158165, 0.3139123023, -0.1195454895, 0.140026927, -0.000123181, -0.065513894, 0.037922658, 0.0187599286, -0.187478289, -0.0091842711, 0.1147257313, -0.2367013544, 0.1002808288, -0.2135511637, 0.1023748964, -0.1358707398, -0.0096763037, -0.0671400279, 0.0681034401, -0.0473484732, 0.0690714493, -0.0756958425, -0.2891827822, 0.2594840825, 0.470477283, 0.1618333012, 0.0502098203, -0.1637223661, 0.3472459614, -0.3854164183, -0.1927091777, 0.5658637881, -0.4568241537, 0.0031641442, 0.3684157133, 0.0001988336, 0.12138699, -0.2628813982, 0.3536189795, 0.1201614738, 0.2966677845, -0.3108714223, -0.0337214731, -0.2469121367, -0.0874593109, -0.24553895, -0.0481365994, 0.0224937461, -0.465524435, -0.0642245561, -0.2485089004, -0.2779917717, -0.100702621, 0.3768825531, -0.4120354652, 0.4298380613, 0.1846136153, 0.2694780827, 0.2300577462, -0.2425143719, -0.0344192982, -0.0763401389, 0.3317642212, 0.5829606056, -0.4369304478, -0.1821170747, 0.0819495097, -0.0360534526, 0.2144132555, -0.2783696353, -0.2595427334, 0.3622380197, 0.3828552365, 0.0960841179, 0.445716083, 0.1008036509, -0.0724330842, 0.5937908888, 0.3524027169, -0.1336072385, 0.0922418386, 0.0355104655, -0.0083409064, 0.2875798047, 0.3077014983, -0.4224056602, -0.1465070546, -0.1777960658, -0.0036212727, -0.023357287, -0.214867413, 0.0137572363, 0.1195843369, 0.4628035426, 0.2295094579, 0.2768381238, -0.1977343112, -0.0248470902, -0.2141761184, 0.0515227467, 0.0254432075, 0.0953231007, -0.1413808018, 0.1797486544, 0.1237723678, 0.2349212766, -0.0849076658, 0.0241602808, -0.0277582258, 0.0716109127, 0.0253310204, -0.2372817248, 0.2751717567, 0.4669007063, -0.1456156373, 0.3750051856, 0.194927901, -0.2103819251, -0.3377522826, 0.2783411741, -0.1568899602, -0.2745813131, 0.1174590513, -0.0101027731, -0.0357577801, 0.3091067672, -0.1921069473, 0.5416849256, 0.3905116618, -0.1119553447, -0.1409578621, -0.1778869331, -0.2912265956, -0.2638459504, 0.3307377696, 0.0047738105, -0.400905937, -0.2362160087, -0.2102875113, 0.2777674198, 0.451069057, 0.4538520575, -0.1082939059, 0.111513719, 0.3450726867, 0.3644188046, 0.5249234438, -0.1185902581, -0.5643752813, 0.0911749601, -0.0897124261, 0.1206973493, -0.1512247622, 0.4033988714, 0.652567625, 0.1655060351, 0.3023567498, 0.1939818859, -0.0593863651, 0.302056253, -0.1542256027, -0.1881448328, 0.1357927024, 0.0740099102, 0.0358703323, -0.2453614175, -0.0491575114, 0.0437317565, 0.0210188888, -0.0810315907, 0.216793865, 0.088056393, 0.165996328, -0.0188014396, 0.1049727052, -0.2512111068, -0.339176476, 0.0935986191, 0.3977252245, 0.1697489023, -0.3231752515, -0.366900593, -0.1637740582, 0.0814841539, 0.3438121676, 0.0508627295, -0.0270686019, -0.3686044514, 0.201023519, -0.1962228119, -0.1454140097, -0.1403483301, -0.012780726, 0.0920536369, 0.0132704787, -0.067517601, 0.1958552748, -0.0875231177, -0.0153838769, -0.0478948206, 0.2411511391, 0.2710720897, 0.1745266467, 0.0639069378, 0.2763479352, -0.1552937031, -0.2778624296, 0.4768838882, 0.0327287763, 0.1264173239, 0.1915235519, -0.1480117291, 0.1535406262, -0.1665281653, -0.4134831429, 0.2336411476, 0.1651545316, 0.6565907598, 0.0086747706, 0.1331654191, 0.1882092953, -0.0068120956, -0.0356930867, -0.3979205787, 0.0318741873, 0.0217272788, -0.0778416246, 0.1329746097, 0.0074176192, 0.1980527192, 0.2051880211, -0.0078432336, 0.0878047049, 0.3099792302, -0.2001465559, -0.2421216071, 0.1981221437, -0.1498926282, 0.0176192895, 0.2220950723, 0.0836343989, -0.2559229434, -0.1016596034, 0.0087208375, 0.2313444763, 0.2254358828, -0.0668540075, -0.2380704731, 0.1779941022, -0.0571115278, -0.3067790866, 0.0590055287, -0.0237059109, 0.3478137851, -0.2445158064, -0.2061145157, -0.254701376, -0.1980948001, 0.340611577, -0.0816506743, 0.0087110512, -0.2504313588, 0.2866854072, 0.1881872565, 0.1070010811, 0.2564494014, -0.1198148429, 0.3113121986, 0.0290829539, -0.2222060859, -0.2729597688, -0.5268829465, -0.0290297475, -0.0305161979, 0.110855639, 0.3845771253, 0.3267249465, 0.4251877069, -0.2760052085, -0.1865747571, -0.3498571515, 0.0308898874, -0.1473957896, 0.2165367901, 0.0386561379, 0.5493988395, -0.3426370621, 0.0491898358, -0.0027288869, -0.1080834344, -0.0340952873, 0.129964307, -0.0471409187, 0.1786491275, -0.0442438982, 0.1530382484, 0.0591474175, -0.1323925257, -0.1048722714, -0.0440554209, 0.3658528626, -0.3394888937, 0.0361536555, -0.2583796084, -0.1067753062, -0.136156708, -0.138572529, 0.2278957516, 0.4098502994, 0.2368450463, -0.0491839312, -0.0461337343, -0.0541710369, -0.0778103694, 0.553491652, -0.3383617699, 0.005987972, -0.242931217, -0.0015420318, 0.1468022019, 0.1258044541, 0.437774837, 0.0251517668, 0.0017537959, 0.0893938392, -0.2488971949, -0.2838340998, -0.1181728542, -0.1418952346, 0.2551563084, 0.5586392879, 0.2956331968, 0.8239874244, 0.1558608115, 0.2164776474, 0.0134826535, 0.0023204591, 0.0195047315, -0.0187358968, -0.2057397813, -0.227146551, -0.2426344156, -0.0351007171, 0.1851110756, 0.2311796844, -0.5529462099, -0.0075121596, 0.115980193, -0.0865240172, -0.3321226835, 0.3729743659, 0.018517755, 0.1834988594, 0.331944257, 0.0540251136, -0.4832003117, -0.4939586818, -0.0439359546, -0.1727937013, -0.0043344311, -0.1839498281, -0.5975130796, -0.2067457139, -0.7730186582, 0.2885379195, 0.0515271463, 0.0626808256, 0.1622112095, -0.1980968267, 0.2604492605, -0.0520280525, 0.6324747801, -0.1064115167, -0.2887436152, 0.1640313268, -0.0244974345, -0.6307041049, 0.2311372757, -0.1395321786, 0.1357928813, 0.1455192715, 0.5015467405, -0.5444860458, -0.2731393278, 0.0227792263, 0.1601585597, -0.2109160423, 0.0412262194, -0.0777449757, -0.3415341079, -0.24751845, 0.2455597073, 0.0549145639, 0.1496190429, 0.500621736, 0.0109204948, 0.128972277, -0.0532471836, 0.1641124189, 0.3766267896, -0.0041639768, 0.214535892, 0.0170879737, 0.3097977936, -0.2957211435, 0.0482384339, 0.095011875, -0.0958033875, -0.1314445138, -0.0914091468, 0.0859839246, 0.3421503901, 0.5212578177, 0.0167564079, 0.3089969754, -0.1656338722, 0.1997570992, -0.0987807438, 0.0243706219, -0.127379477, 0.0123826675, -0.3444960713, -0.3687977493, 0.3483824134, 0.3398557603, -0.282612741, 0.7005106211, 0.1345763654, -0.2693929076, 0.491973877, 0.4547047317, 1.0030088425, -0.509275496, 0.1918295026, 0.1041992605, 0.1524892896, 0.3764021695, -0.3755291104, 0.2738719881, -0.1744570732, 0.0193378814, 0.0076185018, -0.0686172172, -0.103651464, 0.1873569638, 0.1057579145, 0.1570837647, -0.1172847971, 0.4785133302, -0.00237922, 0.1666827798, 0.2566238344, -0.5155162215, -0.1256044954, 0.0300086886, -0.0233560205, -0.2395555526, -0.0016498752, 0.360432893, -0.1163906157, -0.4067579508, -0.2394735515, -0.3339538276, -0.1764796674, 0.0764963776, -0.2180508971, -0.0000620186, -0.0966369212, -0.0341451578, -0.3839143217, 0.099960506, 0.1196130365, 0.1239840388, 0.43675524, 0.2180311531, 0.0789834112, -0.1147109568, 0.0638254434, 0.0545116141, -0.030629307, 0.2301746458, -0.0844711661, -0.369997859, -0.3310754895, 0.1422875524, 0.5918895006, -0.0156177506, -0.0570485555, -0.0731879994, 0.1384320408, -0.1705455482, 0.0139004067, -0.1172697395, 0.0375612564, 0.4882904589, 0.0093265008, -0.2604599595, 0.0049465569, 0.2434518188, 0.3391022682, 0.0581788421, 0.2930651903, -0.0815021694, -0.4987188578, -0.0857778713, -0.0699473619, 0.2039610147, 0.0262366161, 0.0186412744, -0.2155820876, -0.0963980705, -0.0305517111, 0.1936427802, -0.0464118123, -0.0499742851, -0.1869862676, -0.4001560807, -0.126462996, 0.4127480984, 0.1567987353, 0.1442383677, -0.0115683973, -0.1527843773, -0.4431918859, 0.5253609419, -0.1937605441, -0.179710567, -0.0994728431, 0.4249875546, -0.0759308189, 0.2984487116, -0.021544164, -0.1423898488, 0.0567688644, -0.0781059414, -0.02799372, -0.1443947852, 0.0546852201, 0.2024955153, -0.1670417488, -0.2009325922, 0.1073825583, -0.20263502, -0.0884777755, -0.4500788748, 0.2485094368, 0.0877198502, -0.0673261955, -0.3250300586, 0.3965339661, -0.2247076184, -0.0517582744, 0.2174762487, -0.1652267724, -0.0836828351, 0.1474943459, 0.328617841, 0.1112592667, 0.0327109843, -0.0768907964, 0.1567069292, 0.0865012109, -0.2299768329, -0.0654058456, 0.0911870375, -0.022237353, 0.2265075743, 0.077757597, 0.3255525231, -0.1188306659, -0.0702000186, 0.3611972034, 0.0489183739, -0.1887325644, -0.2899715304, 0.3760864735, -0.1546105444, 0.1473892778, 0.3530823886, -0.0040379539, 0.0852665752, -0.0218475908, -0.2005933821, 0.5574964881, -0.259749651, -0.2453698814, 0.2899139225, 0.2669283748, -0.1869502366, 0.1434138268, 0.2223603129, -0.0730319321, 0.2246968895, -0.0497387126, 0.1983330399, 0.1444981247, 0.0901538581, -0.5114420056, -0.1211971343, 0.0495834127, 0.5318869948, -0.183029905, 0.0672333613, 0.039836891, -0.1401379853, 0.5727425218, -0.164299652, 0.1831100881, 0.2923383415, 0.0271730497, -0.2031529099, -0.315385282, -0.2637042403, 0.1272264421, 0.049883604, -0.0062658843, -0.4017657042, 0.4743152857, 0.0501121804, 0.1437918395, -0.3458487391, 0.1734967977, -0.1804648042, 0.3057921827, -0.2012144625, -0.0011614393, -0.4704735875, 0.2981128097, 0.053575255, -0.2909852564, 0.2042211145, 0.3116223812, -0.0056866854, -0.0455111526, -0.2424697876, -0.2219535261, -0.1456357539, 0.0876775533, 0.0622469857, 0.0538624115, -0.0818434954, -0.0303666759, -0.056874238, -0.2863599658, 0.3476958573, 0.182497859, 0.0264547989, -0.0813606977, 0.1229304671, -0.3137008846, 0.0713346377, -0.0916883796, 0.2021406591, 0.0537364446, 0.0780513063, -0.1932754517, 0.174487412, 0.0030704215, 0.0275522135, 0.0026180129, 0.299587518, -0.0786049962, -0.0460830294, -0.2731843293, -0.3212511837, -0.4879871309, -0.0796560496, -0.8037532568, -0.3432796597, 0.3171458542, 0.2904573083, 0.3600547314, 0.3319470286, -0.0512445197, -0.153069824, -0.4010703564, 0.3075762093, -0.1426284909, 0.3985097408, -0.0483071357, 0.1764251441, -0.0004773885, -0.4729264379, 0.3123587966, -0.1248278692, -0.0591291748, -0.0413188115, 0.0913438722, 0.2551095486, 0.252037704, 0.318608582, -0.1116297394, 0.2177824676, 0.0628044084, 0.0907694697, -0.1198382452, 0.3120596409, -0.4494712651, 0.0692379326, 0.0040294472, 0.1768661737, -0.2057840973, -0.1238449514, -0.0555479005, 0.1101205051, -0.2011118233, -0.1833704114, 0.2157502025, 0.0367239639, 0.2610106766, 0.2835198343, -0.348564297, 0.0232503209, -0.0253288597, 0.0744887292, -0.3010800481, -0.2312054336, 0.5163494349, -0.8135402799, -0.4936995506, -0.1942997277, 0.1085393727, -0.0466179438, -0.2379193306, -0.1640185416, -0.2879091203, 0.2436061949, -0.1206538677, -0.3347290158, 0.0481674187, 0.0469660684, -0.1878630817, -0.3019768, -0.0490132868, -0.0736181065, -0.1330052316, -0.5351456404, -0.4960492253 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
@lhoestq After looking through the source code, it looks like the following solution has at least some chance of working: - refactor `Dataset.map()` so that the `input_columns` parameter is implemented by using the `self.formatted_as()` context manager with `columns=input_columns` - change `Dataset._getitem()` so that it passes `self._data.drop(drop_columns)` to the `query_table()` function whenever `format_columns` is non-None and `output_all_columns` is False, instead of `self._data` itself
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
62
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. @lhoestq After looking through the source code, it looks like the following solution has at least some chance of working: - refactor `Dataset.map()` so that the `input_columns` parameter is implemented by using the `self.formatted_as()` context manager with `columns=input_columns` - change `Dataset._getitem()` so that it passes `self._data.drop(drop_columns)` to the `query_table()` function whenever `format_columns` is non-None and `output_all_columns` is False, instead of `self._data` itself
[ -0.1273221523, 0.3481044173, -0.0064757019, -0.1535293758, 0.1438028216, -0.1467354298, 0.3634428084, 0.6069025993, 0.1660750508, -0.0057869256, -0.1035188809, 0.5548495054, 0.0025604852, -0.1955349743, -0.0578185916, 0.1826299131, 0.0585309044, 0.2830989957, 0.2737962306, 0.1041020006, -0.0951173306, -0.170508787, -0.2150656879, -0.0666615814, -0.0642237514, -0.0613076538, 0.1991729438, -0.3850060403, -0.2869394124, -0.2271060199, 0.2922722399, 0.3593522906, -0.1801967621, 0.1267358959, -0.0001259425, -0.0458019897, 0.0389491543, -0.0200659186, -0.1705733389, -0.0551256984, 0.147995308, -0.1761645973, 0.0846667141, -0.2403678596, 0.0551325753, -0.1327309906, -0.0106195956, -0.0117521286, 0.0406141207, -0.1128472388, 0.0341308601, -0.0340775959, -0.3017614186, 0.2565585375, 0.4595094621, 0.1940966547, 0.0270517021, -0.1416133195, 0.2707462311, -0.3485604525, -0.1681901962, 0.5096774697, -0.4922267199, -0.058093816, 0.3593023717, 0.0253373124, 0.1058124527, -0.2550094128, 0.2683981061, 0.1529862285, 0.292106837, -0.3296054006, -0.151749298, -0.3154856563, -0.0439146049, -0.2649433017, -0.070756726, 0.0200016983, -0.4546420574, -0.0154968761, -0.2215277255, -0.2403393388, -0.1327633113, 0.4017280936, -0.4890254438, 0.466496259, 0.1749095023, 0.2699733675, 0.2008435726, -0.2302259654, 0.0042695142, -0.0303561389, 0.4081299901, 0.5703796148, -0.4117674232, -0.2143028677, 0.1393150836, 0.0036533624, 0.2306439877, -0.1923805326, -0.2197024822, 0.4396784008, 0.3002085388, 0.1032504737, 0.39378196, 0.0823249221, -0.0117407776, 0.613016963, 0.4194805622, -0.0690279081, 0.1520484984, 0.1106832027, -0.0377936549, 0.2828659117, 0.1912230998, -0.2766187787, -0.1490796506, -0.1855109036, -0.0168781653, -0.017803371, -0.2466081083, 0.0188309886, 0.086686492, 0.36930269, 0.2553949356, 0.3317070901, -0.1854813099, -0.0037352359, -0.2259200215, 0.0245298333, 0.0904610455, 0.0658390373, -0.075316757, 0.1368269622, 0.1243726313, 0.2003507763, -0.1117544323, 0.0193882622, -0.0111763664, 0.1090579331, -0.0483327247, -0.1529540718, 0.2417970598, 0.4411389232, -0.166181922, 0.3761272132, 0.2155161649, -0.3126179576, -0.383208245, 0.2430935353, -0.1104761437, -0.1868736893, 0.0666756332, -0.0289038457, -0.0771972612, 0.323099196, -0.1639084518, 0.5878398418, 0.3482170105, -0.149363488, -0.098027274, -0.1733253598, -0.2845934629, -0.2081663609, 0.3253327012, -0.0149537772, -0.4749377668, -0.2395088226, -0.1989280581, 0.2556533217, 0.4086404145, 0.3316074312, -0.1002430171, 0.1415999979, 0.3397715986, 0.4450962245, 0.5255149603, -0.078006953, -0.5603325367, 0.0560347922, -0.1952272803, 0.0996110216, -0.1634826362, 0.3420076966, 0.7027941942, 0.1154095381, 0.2961071432, 0.2033745646, -0.0511500686, 0.2437442839, -0.1246561408, -0.2059466392, 0.1755494773, 0.1367104053, 0.029253114, -0.2447057068, 0.0477046147, -0.0039330013, 0.0220563058, -0.0478289612, 0.2118878514, 0.0858209282, 0.1237950698, -0.0884236693, 0.0869384855, -0.281935811, -0.3313646019, 0.0774914026, 0.4104801118, 0.2247710228, -0.3545201719, -0.4367654324, -0.1847042888, 0.1123169735, 0.384404242, 0.0683843791, -0.0719926953, -0.3210816979, 0.1843954474, -0.1295588762, -0.1944353878, -0.1407886893, -0.0147875622, 0.1092910767, -0.0360373184, -0.041291263, 0.247871533, -0.0388695672, -0.0346047543, -0.0625138581, 0.2811251283, 0.2168860734, 0.1725885123, 0.0954234749, 0.242354542, -0.1273519397, -0.3383035064, 0.4517207146, 0.1155747324, 0.1782616675, 0.1248258874, -0.1141846478, 0.130077973, -0.1701492816, -0.5284742117, 0.3342112005, 0.1444131285, 0.6386409402, 0.0327839181, 0.1267502457, 0.1661229134, 0.0019879043, -0.1329385936, -0.3860223889, -0.0053124717, 0.0512736216, -0.0726256967, 0.0961117968, -0.0275741667, 0.3275288045, 0.2445507199, -0.0626859814, 0.1090942249, 0.2773000598, -0.1371353567, -0.1556409299, 0.2355411202, -0.0841583014, 0.0132603124, 0.2041251659, 0.1494021118, -0.1876809597, -0.120946303, 0.0262489207, 0.2114545107, 0.23945418, -0.1365425289, -0.161326766, 0.2345715165, -0.0368099026, -0.3467926979, 0.01882983, 0.0038080961, 0.3276862204, -0.2645941079, -0.2206594944, -0.3071567714, -0.177390784, 0.3076580167, -0.1017004997, -0.0127013037, -0.2653776109, 0.317301929, 0.2154942155, 0.0401484668, 0.3119370639, -0.1661812663, 0.3087301254, 0.0243714005, -0.1637328416, -0.244771719, -0.5096173882, 0.0633461177, -0.0686662644, 0.0641943961, 0.4734525084, 0.2361045629, 0.4196449518, -0.303725183, -0.214243412, -0.4320299029, 0.0937006772, -0.1424223483, 0.2290278524, 0.1384039521, 0.5033740997, -0.3042505383, 0.0128719807, -0.0201116595, -0.0442608036, -0.0917535871, 0.0790371001, -0.0349729508, 0.2020379007, -0.130269289, 0.2140202969, 0.0292719174, -0.1585882008, -0.0912218988, -0.090836294, 0.3771422207, -0.3267349899, -0.0654541627, -0.2527084947, -0.0476642549, -0.1487681717, -0.0874361023, 0.2180919349, 0.4490578175, 0.2227488309, -0.043377392, -0.1537193358, -0.0969228223, -0.1233660281, 0.5705342293, -0.2659857869, -0.0307173915, -0.1824509501, 0.089189522, 0.1391222775, 0.1379882842, 0.4991466105, 0.0553050078, 0.0428190008, 0.0685394257, -0.280960083, -0.2711596191, -0.0988809243, -0.2212446183, 0.2532503605, 0.6047788858, 0.2968129218, 0.8351002336, 0.1069739461, 0.1818826795, -0.0387487747, -0.0171389729, 0.0519239716, 0.014879005, -0.2078214884, -0.1637066156, -0.2221998274, -0.064008072, 0.1698117256, 0.1435194314, -0.5510612726, 0.0033140928, 0.1110486388, -0.1422185153, -0.3159614503, 0.2571169436, 0.0388078876, 0.1549910009, 0.3217480183, 0.1841273457, -0.4510053992, -0.4142404497, -0.0209764093, -0.1442965418, 0.0042881407, -0.1905400753, -0.6768003702, -0.1820839047, -0.7496144176, 0.2724263072, 0.1283869743, 0.1044468135, 0.2136635482, -0.2561149001, 0.2302794904, -0.1493788958, 0.6817166805, -0.1297954321, -0.2012693733, 0.2135446072, 0.0631827116, -0.6210016012, 0.2086019665, -0.0594421029, 0.1769919991, 0.1192825586, 0.4989866614, -0.598418653, -0.2423059344, 0.0295482576, 0.1255259365, -0.1567391455, 0.0966095477, -0.0112243667, -0.3419353068, -0.1949514449, 0.2824058533, 0.0686623156, 0.1367494017, 0.4177075624, 0.0197619945, 0.1251192242, -0.0417040475, 0.0763838589, 0.4052553475, -0.0119336322, 0.2226389796, 0.0638306141, 0.3394082785, -0.3068765104, -0.015382384, 0.0988523662, -0.07767272, -0.1732518375, -0.0052549206, 0.0673846006, 0.2934229076, 0.5596971512, 0.023644045, 0.3625143468, -0.1349500567, 0.204237625, -0.0689314902, 0.0086082034, -0.1927109361, -0.0298144873, -0.3097384572, -0.310367167, 0.3756297231, 0.2721711397, -0.2979208231, 0.6662808061, 0.1824179739, -0.257231921, 0.4809884131, 0.3857999146, 0.9818709493, -0.4391014576, 0.1944669038, 0.0656747669, 0.1238081753, 0.4268322289, -0.3922563791, 0.2636384368, -0.2277780324, -0.0156039819, -0.0482394472, -0.0663244128, -0.1452965885, 0.2381994575, 0.1275868565, 0.1684182435, -0.1042024642, 0.5085715055, 0.0684885904, 0.135370791, 0.2738368213, -0.524356246, -0.1250848472, -0.0153763555, -0.0862960145, -0.2240331322, 0.0297228135, 0.333756417, -0.1380544305, -0.3959973454, -0.2638472319, -0.2780075073, -0.1923870444, 0.0325110592, -0.1721452773, -0.0582661703, -0.1527359188, -0.0771737546, -0.3341742456, 0.0837204605, 0.1058539599, 0.1438484788, 0.4252266586, 0.3069605231, 0.1827415675, -0.1586418599, 0.0996922031, 0.0837218314, -0.0102695972, 0.1840321571, -0.0719708651, -0.3719840646, -0.299648881, 0.1372820884, 0.5914366841, 0.0275000669, -0.0068539977, -0.0893054456, 0.1800950617, -0.2673332095, -0.0323387012, -0.1305843592, 0.0310473926, 0.4102389812, -0.0517867394, -0.2097819299, 0.0114971735, 0.3610183895, 0.2665206194, 0.0627215803, 0.2423953116, -0.0836218446, -0.5424604416, -0.0597628094, -0.0298944265, 0.1459827572, -0.0243047401, 0.0082401559, -0.3483143449, -0.1090192497, -0.0436429977, 0.1970876604, -0.1089276373, -0.0193236768, -0.2348047495, -0.4801249802, -0.1004068106, 0.4124399424, 0.1363641024, 0.1101142168, 0.0255635157, -0.1032995284, -0.4717288017, 0.4218452573, -0.1611301452, -0.1528007686, -0.0824983343, 0.4136499465, -0.0525790192, 0.2995501161, -0.0834407359, -0.1278384179, 0.0404474363, -0.0157470517, 0.0060277805, -0.1082220525, -0.0180256665, 0.2158907503, -0.1520172954, -0.1767698824, 0.1595077664, -0.1610104442, -0.128353253, -0.4170396328, 0.2688871622, 0.0739141703, -0.0247999951, -0.2930173278, 0.3755995929, -0.1098563671, -0.0850410089, 0.1856269985, -0.0925673544, -0.0441625193, 0.1314782202, 0.3624935448, 0.0163753442, 0.1023389623, -0.0212150495, 0.1830402762, 0.076491341, -0.23109667, 0.0298055485, 0.05794378, -0.0244717672, 0.2433539182, 0.1706034094, 0.3392590284, -0.1147819161, -0.0680907667, 0.4051101208, 0.0090435352, -0.2317367047, -0.3160846233, 0.4245136678, -0.1597129405, 0.2071768045, 0.3458246589, 0.0047679693, 0.0788897723, 0.0172808878, -0.202501446, 0.6030322313, -0.2612037063, -0.2481486052, 0.3932272196, 0.236740008, -0.1405759156, 0.1525173336, 0.1961877942, -0.1034133434, 0.2099775523, 0.0134103671, 0.2117500305, 0.1433822364, 0.0495014451, -0.4571826756, -0.1390479207, 0.0719526783, 0.4697217941, -0.0802278668, 0.0991028249, 0.1034098268, -0.1375617236, 0.5090919733, -0.148508653, 0.2394257486, 0.2918792367, 0.05182999, -0.2284318805, -0.3881028891, -0.2717408538, 0.0887423307, 0.0431637987, -0.0877017751, -0.393712759, 0.4382043481, 0.0317191705, 0.1805927604, -0.4497791529, 0.0854623392, -0.2634507418, 0.3338374496, -0.2152816951, 0.0529085323, -0.4307364523, 0.2762865722, 0.0397212394, -0.3055504858, 0.1705826223, 0.2844312787, -0.0580194741, -0.111785084, -0.2988741398, -0.189337045, -0.074996613, 0.0306659974, 0.0724841058, -0.0202625133, -0.0377771743, -0.0616245046, -0.043164704, -0.2216567844, 0.37072137, 0.155682981, -0.022482872, -0.1269095093, 0.1448965371, -0.3175267875, 0.1032468155, -0.1658273935, 0.267575711, 0.0687756389, 0.0433633737, -0.1203856319, 0.190107435, -0.0016947053, 0.0097625405, 0.0085388869, 0.2075279653, -0.0391883627, -0.0659176558, -0.184433043, -0.282777518, -0.5424224138, -0.0785275698, -0.678316474, -0.4402119815, 0.3769552112, 0.2896398306, 0.4799546003, 0.3359670639, -0.0373754129, -0.1987977922, -0.3016085029, 0.3532305658, -0.1548739076, 0.3796230853, -0.094821617, 0.0696676597, -0.0461299941, -0.560762763, 0.3027584553, -0.064745307, -0.0920319408, -0.01194885, 0.1074288338, 0.2510440648, 0.1420671344, 0.2661869526, -0.1468736082, 0.150116235, 0.0665977597, 0.1073784903, -0.1670600772, 0.3415953815, -0.5109819174, 0.1398368031, -0.0354841016, 0.2615733445, -0.1015488058, -0.1498741508, -0.064422965, 0.048589319, -0.1707939953, -0.1590425372, 0.1794199497, 0.109179467, 0.1894635111, 0.235708937, -0.3155452907, -0.0114716645, -0.0222355612, 0.1398942918, -0.2780250907, -0.2221184522, 0.5493471026, -0.8324964046, -0.4792656004, -0.1653926075, 0.0701069087, -0.0641957447, -0.1915359199, -0.1486912668, -0.3194426298, 0.2589015663, -0.1735184491, -0.3030001521, 0.0436289757, 0.0690992177, -0.2117329389, -0.3254095018, -0.0479787737, 0.0009034965, -0.1098848507, -0.5369402766, -0.5348815322 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
Looks like a great direction :) Note that `query_table` doesn't bring data into memory. Only `format_table` does. Also the dataset may already have a format with `columns=` already defined so we would need to define the formatted `input_dataset` like: ```python # before the `map` main for loop input_columns = input_columns if input_columns is not None else self.column_names if not self._output_all_columns: columns = [col for col in input_columns if self._format_columns is None or col in self._format_columns] input_dataset = self.with_format( type=self._format_type, columns=columns ) else: # in this case we could find a way to filter both format_columns and unformatted columns eventually input_dataset = self # then input_dataset can be used in the main for loop of `map` ``` EDIT: oh and regarding streaming format versus file format for arrow, we plan to start using the file format #1933 at one point (though I'm not sure if it would improve performance)
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
148
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. Looks like a great direction :) Note that `query_table` doesn't bring data into memory. Only `format_table` does. Also the dataset may already have a format with `columns=` already defined so we would need to define the formatted `input_dataset` like: ```python # before the `map` main for loop input_columns = input_columns if input_columns is not None else self.column_names if not self._output_all_columns: columns = [col for col in input_columns if self._format_columns is None or col in self._format_columns] input_dataset = self.with_format( type=self._format_type, columns=columns ) else: # in this case we could find a way to filter both format_columns and unformatted columns eventually input_dataset = self # then input_dataset can be used in the main for loop of `map` ``` EDIT: oh and regarding streaming format versus file format for arrow, we plan to start using the file format #1933 at one point (though I'm not sure if it would improve performance)
[ -0.1205224171, 0.2916719019, -0.0068578757, -0.1955767572, 0.1112998128, -0.1071507335, 0.2545418739, 0.5994859934, 0.2043485343, -0.0285108536, -0.0340007916, 0.4793541431, 0.0217376687, -0.2131698728, 0.0204915367, 0.2257363498, 0.1094411463, 0.3549480438, 0.2541978955, 0.096620664, -0.1538399607, -0.1982914507, -0.1836565584, -0.1087917536, -0.0737461895, -0.0132575259, 0.1467773169, -0.3689959347, -0.3287631273, -0.1571342349, 0.2981297374, 0.3351166546, -0.1511103362, 0.1153095514, -0.0001276158, -0.0219642594, -0.0039138226, -0.0525662638, -0.1830682606, -0.0591205657, 0.1285030097, -0.2101272345, 0.0795889273, -0.2305579484, 0.0204800218, -0.0886209756, 0.0288888682, -0.0736887008, 0.014809832, -0.1144903824, 0.0261801779, -0.0833347514, -0.3116622567, 0.2302704155, 0.4493206143, 0.1998946667, 0.0042841956, -0.1619113088, 0.2894335389, -0.4011123776, -0.1172275692, 0.5342764258, -0.4963220358, -0.0241854992, 0.3617821336, 0.0233745277, 0.0134988986, -0.1979039758, 0.3108478189, 0.1128363311, 0.2250440717, -0.3431988955, -0.1086051241, -0.2292712629, -0.0838759392, -0.2694157958, -0.0652148575, 0.058578752, -0.4512799382, -0.0089032231, -0.2625633478, -0.2576967776, -0.0991567001, 0.4092384279, -0.5199314356, 0.4321990609, 0.1646629125, 0.2750138938, 0.1986686587, -0.2195453346, -0.0431817994, -0.029707633, 0.3957518935, 0.5969598889, -0.4020286202, -0.2055868208, 0.137819171, -0.0239011683, 0.2302290201, -0.2287325263, -0.1678281575, 0.3932458162, 0.3833599389, 0.102979809, 0.3581875861, 0.0063785501, -0.0522427633, 0.6364858747, 0.3577843606, -0.133960247, 0.1019661725, 0.0639415979, -0.0322117582, 0.3444749117, 0.2406600416, -0.3781086802, -0.164212361, -0.1726718098, 0.0016425923, -0.0048701242, -0.2048109025, 0.0503238104, 0.0754773542, 0.4536678195, 0.2588708699, 0.225984484, -0.1784387529, 0.011035718, -0.2188382149, 0.0681123286, 0.0662756413, 0.0588552617, -0.0594328418, 0.2203584015, 0.1725187153, 0.1975575984, -0.1392246783, 0.0358781256, -0.0783823133, 0.0963128507, -0.002850756, -0.2358972877, 0.3039044738, 0.4720262289, -0.1210362986, 0.3792855442, 0.2375582159, -0.216723755, -0.3476660848, 0.311639905, -0.119954139, -0.199136138, 0.1178498268, -0.0398998708, -0.1022518575, 0.3331944942, -0.0838698223, 0.6144602299, 0.3624878824, -0.1243356466, -0.1075505167, -0.1345475316, -0.323404789, -0.2182025909, 0.3730610907, -0.0377681181, -0.4412721694, -0.2263317108, -0.1503976882, 0.2870779634, 0.4017946422, 0.3283831775, -0.1041111946, 0.1448109597, 0.3399393559, 0.4092049003, 0.5807512403, 0.0020425394, -0.5462441444, 0.0586958751, -0.1678371131, 0.1042348966, -0.1550774425, 0.382892698, 0.6717814207, 0.1935446858, 0.3389425576, 0.2051126808, -0.0929735824, 0.2500670254, -0.0852627382, -0.1095491871, 0.1974383146, 0.1217210814, 0.0077491174, -0.148339048, -0.0093659647, 0.0399955101, 0.0263682716, -0.0251080915, 0.1214189231, 0.0646113455, 0.1171693355, -0.0716159642, 0.0811885595, -0.2945950627, -0.2906382382, 0.0719176233, 0.4683173001, 0.1420728862, -0.340886265, -0.3782498837, -0.1787259877, 0.1433284581, 0.4013046622, 0.1306818426, -0.078343302, -0.3235481679, 0.2239702642, -0.1672378778, -0.2348144352, -0.1474262476, -0.0294379666, 0.098839432, 0.0033342503, 0.002542831, 0.2784748673, -0.0976321101, -0.0320749506, -0.0948891044, 0.2482024729, 0.2585178614, 0.2177055776, 0.0754667819, 0.2817990184, -0.1683758646, -0.2904418111, 0.4979357123, 0.0264391843, 0.1684325486, 0.1303660274, -0.2077955306, 0.1808966398, -0.1695896536, -0.4422305822, 0.3461419344, 0.1428609788, 0.6261826158, 0.0383625105, 0.0879713893, 0.1729707122, 0.0151636153, -0.1029486358, -0.3706106544, 0.0246627145, 0.0675800741, -0.1296297908, 0.1175784394, -0.0286364928, 0.262838304, 0.2400075197, -0.0757464767, 0.1183065325, 0.2568656504, -0.1232649088, -0.1520131528, 0.1783410162, -0.1688497663, 0.016351372, 0.174679637, 0.1380662024, -0.2322895676, -0.1784208417, 0.001826562, 0.2231832296, 0.1911958754, -0.1504742801, -0.2071063519, 0.1783087552, -0.0749044344, -0.3234237731, 0.0882710516, -0.0030706786, 0.3133066297, -0.228229925, -0.2052069306, -0.2555495203, -0.1922774315, 0.3304745555, -0.1014567316, 0.0395307876, -0.2535789013, 0.3107283711, 0.1738025844, 0.0868995339, 0.2332751751, -0.1845209748, 0.3074071109, 0.0328973979, -0.2708676457, -0.264932245, -0.4880025685, 0.062291801, -0.0660041273, 0.0105123371, 0.434378773, 0.2581010461, 0.3665306568, -0.2448258847, -0.2507920861, -0.3883435428, 0.0792067647, -0.136558488, 0.2166881561, 0.1166439205, 0.5547267795, -0.3538580537, 0.044388596, -0.0130546242, -0.0474989489, -0.0637935549, 0.1721648276, -0.0247790758, 0.1852323264, -0.0968936682, 0.2254286408, 0.0812081471, -0.0963442773, -0.1229766607, -0.0644629449, 0.3656049371, -0.3716360331, -0.0098518953, -0.2970948219, -0.1427564621, -0.1317304373, -0.1191973537, 0.2455676645, 0.4853582978, 0.2650068402, -0.0503654033, -0.1151809394, -0.1063334346, -0.155970335, 0.6325250864, -0.3378854096, 0.0153184235, -0.2393228114, 0.0202765018, 0.1652298868, 0.1230259091, 0.4506613016, -0.0520641916, 0.0475988202, 0.0480045378, -0.2972129881, -0.2780135572, -0.0886455253, -0.2216759175, 0.2424535751, 0.6447240114, 0.3033607006, 0.7878704071, 0.083835125, 0.17958951, 0.0335376486, -0.0619436502, 0.0475944728, 0.0101663414, -0.2111123949, -0.2400129139, -0.2072141767, -0.0753120184, 0.1416136026, 0.2063372731, -0.5454416871, -0.0550725274, 0.1644572914, -0.1403355002, -0.3017392159, 0.3235959411, 0.066549316, 0.190079838, 0.3558622003, 0.1475861073, -0.4759310782, -0.443143487, -0.0849098414, -0.1160169914, 0.0462108925, -0.1550176293, -0.6074306369, -0.2667901516, -0.7115894556, 0.2854952812, 0.0791323483, 0.1452512443, 0.2168408781, -0.2947314382, 0.2204005271, -0.0925423279, 0.6694391966, -0.0520821661, -0.2414199412, 0.1431229413, -0.0561404042, -0.6001131535, 0.2190062404, -0.0769917667, 0.172332406, 0.0756412297, 0.5250890851, -0.5840337873, -0.1827313602, 0.0584263913, 0.1571162492, -0.1851095408, 0.0542647429, -0.1085367203, -0.3439586163, -0.147136271, 0.2608180344, 0.0282209814, 0.1079776064, 0.4737846553, -0.0192322209, 0.0674174279, -0.0903820619, 0.0966004282, 0.4231263101, -0.0435207263, 0.2096164823, 0.0681553558, 0.3000501096, -0.3356435895, -0.0294004623, 0.106785506, -0.0257601887, -0.0809921548, 0.015473932, 0.0973514095, 0.3004750013, 0.5683053136, 0.0342304371, 0.3881702721, -0.1295007467, 0.1878234148, -0.1390420794, 0.0039837621, -0.2006267607, -0.0432828404, -0.3406224549, -0.3927218914, 0.3689993322, 0.3045250773, -0.2760224938, 0.6531161666, 0.1705699265, -0.2066045105, 0.4587955177, 0.3477600813, 1.019508481, -0.5214765072, 0.1699341834, 0.0322638974, 0.1440640092, 0.3666467667, -0.4250973165, 0.2500385344, -0.1836035252, -0.0954938233, -0.0526845828, -0.1069662794, -0.1003901586, 0.1931834221, 0.1298272312, 0.1475316137, -0.0991599262, 0.5432228446, 0.1006643176, 0.0851833075, 0.2250950038, -0.4429329038, -0.1512703151, -0.0196226574, -0.0472357199, -0.2359913588, 0.0416931994, 0.3622324169, -0.1557518393, -0.4161444604, -0.2355289459, -0.2978553772, -0.2282816172, -0.0113712214, -0.2222593725, -0.0533128753, -0.2118133754, -0.081832096, -0.4060819149, 0.142872259, 0.1504832357, 0.0990860984, 0.458684355, 0.2568594813, 0.1095418334, -0.1178546324, 0.1019916385, 0.1032885537, -0.0114842355, 0.2659311891, -0.0809340477, -0.3675949574, -0.3423033357, 0.1643648297, 0.5911536217, 0.034018442, -0.0623522066, -0.0798485279, 0.2068805397, -0.214700371, -0.029355865, -0.1153369695, 0.0567738265, 0.3959183991, 0.0095642339, -0.285538584, 0.0040001599, 0.3544890881, 0.2855493128, 0.0208349228, 0.2044816762, -0.1106402576, -0.5134522915, -0.0425503924, -0.0506715775, 0.2281656265, 0.0060097426, -0.0121157113, -0.2796093822, -0.0588050485, -0.0362698659, 0.1761830449, -0.0499721393, -0.0529457107, -0.199681744, -0.4386968613, -0.0182062462, 0.442536056, 0.1786853075, 0.102282688, 0.0539023876, -0.1254322231, -0.4615598321, 0.4586749673, -0.1486274153, -0.1921131909, -0.0985350162, 0.4340787828, -0.145181492, 0.3470756114, -0.1242184043, -0.12381652, 0.0593398958, -0.0372590534, 0.0099962167, -0.11108163, 0.0633869022, 0.2302578539, -0.1380211115, -0.127582401, 0.0664632171, -0.1967456043, -0.1203839928, -0.4393716455, 0.2562835217, 0.0678955466, -0.0392499752, -0.3404692411, 0.4545372427, -0.1667315066, -0.1042165011, 0.1259800196, -0.1754604876, -0.064346537, 0.0691106915, 0.3398541808, 0.0253191441, 0.0868798494, -0.0635239705, 0.1758935302, 0.0753099322, -0.2827731073, 0.0058804974, 0.0976224244, 0.0337169766, 0.1995993406, 0.1574257165, 0.3863252103, -0.1026549935, -0.0637381077, 0.3855549395, -0.0013762168, -0.1756064594, -0.2820308805, 0.3754218221, -0.1159963161, 0.2112381905, 0.4110932946, -0.0155053884, 0.1346481889, 0.03786394, -0.2541956007, 0.5481323004, -0.1878698468, -0.2755918801, 0.392019093, 0.2921042442, -0.1242123246, 0.1140776649, 0.2238340378, -0.1109484583, 0.2314635366, -0.0381138138, 0.2487499565, 0.1422788799, 0.0404577442, -0.4667988122, -0.1206578463, 0.034343835, 0.4787989855, -0.1020074189, 0.1082384735, 0.0011625625, -0.1533782333, 0.5385460258, -0.0922691897, 0.1676844656, 0.2412601858, 0.0828594267, -0.1849398315, -0.3271008432, -0.2880987525, 0.0628871471, 0.0237304494, -0.0346034728, -0.350415647, 0.4097351134, 0.0497015715, 0.2264172882, -0.3599366248, 0.2024379671, -0.2352502197, 0.2522644103, -0.2211432606, 0.070850186, -0.4758045971, 0.2940943241, 0.1046742648, -0.3440803289, 0.109756209, 0.3184897602, -0.014380049, -0.036772918, -0.2831409872, -0.2473112345, -0.1265822351, 0.0822506547, 0.0449783355, 0.0433467142, -0.0522307679, -0.0464487337, -0.0263266563, -0.2710569799, 0.340297699, 0.1830482632, -0.0185470618, -0.1184856296, 0.0944028199, -0.2621903419, 0.1225151643, -0.1087831408, 0.2234493494, 0.0629799813, 0.0031008571, -0.1863149852, 0.1544460207, 0.0642119572, 0.0005111955, 0.006081298, 0.2094148397, -0.086123459, 0.0205600392, -0.2128864825, -0.3577105403, -0.4625991285, -0.0634600371, -0.7106277347, -0.4246841967, 0.3601843119, 0.2865706086, 0.4639977515, 0.3493736088, -0.0730077326, -0.1968186796, -0.4219461083, 0.4059288204, -0.094086051, 0.3259025216, -0.0937170088, 0.1215589643, -0.095441699, -0.4906405807, 0.2663344443, -0.1491529047, -0.0930132791, -0.0397673026, 0.0610730052, 0.2796288729, 0.2296254188, 0.2637282908, -0.1626535207, 0.2027771175, 0.0390216634, 0.1617891937, -0.1238082051, 0.3242392838, -0.4712224901, 0.118545495, -0.0569971427, 0.1671808809, -0.1209936664, -0.1547785401, -0.0034629703, 0.0753989071, -0.2015691102, -0.1348521709, 0.2402376235, 0.0925467759, 0.1910645664, 0.235341534, -0.3011477888, 0.0027840675, -0.0161228981, 0.1544590294, -0.225538671, -0.20506455, 0.4881334901, -0.8047509193, -0.4586585164, -0.1668251306, 0.0745779797, -0.056059815, -0.1588745415, -0.1639575958, -0.3209578395, 0.2653916776, -0.1165279597, -0.2881030142, 0.0956866145, 0.0898055136, -0.1982931197, -0.3410838544, 0.0114867883, -0.0575588308, -0.1320005506, -0.5714486241, -0.5315232873 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
Good to know about `query_table` not bringing anything into memory. I was under the impression that it did because a while back I looked at my `map` operation in pdb and it looked like it was spending forever in line 93 of formatting.py, `return pa.concat_tables(....)`, although that was before the `fast_slice` interpolation search was implemented, so it may have had more to do with the slow ChunkedArray slice implementation than anything else. If `query_table` is I/O free then the fix may be as simple as just adding this to line 1779 of arrow_dataset.py: ```python # Only load the columns we actually need if input_columns: stack.enter_context(self.formatted_as( self._format_type, columns=input_columns, output_all_columns=False, **self._format_kwargs )) ``` It's not clear to me why the `[col for col in input_columns if self._format_columns is None or col in self._format_columns]` check would be necessary— it seems like either `input_columns` should simply temporarily override the `_format_columns` within the `map` operation, or we should throw an error if there are any conflicts. Currently it doesn't look like this case is checked for at all within `map`, but maybe I'm just missing it.
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
181
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. Good to know about `query_table` not bringing anything into memory. I was under the impression that it did because a while back I looked at my `map` operation in pdb and it looked like it was spending forever in line 93 of formatting.py, `return pa.concat_tables(....)`, although that was before the `fast_slice` interpolation search was implemented, so it may have had more to do with the slow ChunkedArray slice implementation than anything else. If `query_table` is I/O free then the fix may be as simple as just adding this to line 1779 of arrow_dataset.py: ```python # Only load the columns we actually need if input_columns: stack.enter_context(self.formatted_as( self._format_type, columns=input_columns, output_all_columns=False, **self._format_kwargs )) ``` It's not clear to me why the `[col for col in input_columns if self._format_columns is None or col in self._format_columns]` check would be necessary— it seems like either `input_columns` should simply temporarily override the `_format_columns` within the `map` operation, or we should throw an error if there are any conflicts. Currently it doesn't look like this case is checked for at all within `map`, but maybe I'm just missing it.
[ -0.1046057418, 0.3224449158, -0.015833769, -0.1899835169, 0.0996763334, -0.0926468074, 0.2255839705, 0.5739009976, 0.1345912814, -0.0051861033, -0.0915139616, 0.4579324424, 0.0769859552, -0.2375071347, 0.007108029, 0.256791085, 0.0978267044, 0.3570866585, 0.3204874098, 0.1195372194, -0.1944886148, -0.2011040449, -0.1671693325, -0.0931123644, -0.1043967381, -0.0672501102, 0.1529693455, -0.3571103811, -0.3311986029, -0.1571362019, 0.2827630639, 0.3201691806, -0.2016058713, 0.1288631409, -0.000126842, -0.0501119718, 0.0091099525, -0.0208222531, -0.1327053905, 0.0189622939, 0.2041421384, -0.2184468806, 0.0786347687, -0.2216872126, 0.0527094156, -0.0613877848, 0.0214830805, -0.0298989862, -0.0216248035, -0.0822023228, 0.0331358984, -0.0527436733, -0.3226947188, 0.211495176, 0.4797377884, 0.1571222544, 0.0235044807, -0.2126514763, 0.2892076373, -0.4368456304, -0.1270745844, 0.5308565497, -0.5316393375, -0.0464948118, 0.3427624702, 0.0491608456, 0.0022189021, -0.20073241, 0.3583233953, 0.0518087558, 0.160558328, -0.2960645258, -0.0898214728, -0.2226341218, -0.0841384903, -0.2170467228, -0.0664930567, 0.0542095974, -0.4561916292, -0.0182686597, -0.2613743842, -0.2506404817, -0.0523679331, 0.3157965243, -0.5186733007, 0.4236078262, 0.1705065966, 0.2459536046, 0.3076341748, -0.2111771405, -0.042785611, 0.0078036338, 0.4094473124, 0.541829586, -0.3882900774, -0.1447074115, 0.21660918, -0.0046079159, 0.244050324, -0.278187573, -0.178322643, 0.3794896603, 0.4178125262, 0.0922845155, 0.3731512725, 0.0572139099, -0.1314654499, 0.6420699954, 0.3668271303, -0.1592872739, 0.0897907615, 0.0827539414, 0.0434359387, 0.3798613846, 0.1911717355, -0.4334312379, -0.1847690642, -0.1714395285, -0.025348559, -0.0084881261, -0.1762733459, 0.1174385846, 0.0855486318, 0.48917979, 0.2316110879, 0.225787282, -0.1678629071, -0.0405793041, -0.2845214605, 0.0734626651, 0.0280697457, 0.0345126614, -0.0512354486, 0.2307012975, 0.1601489484, 0.1830992997, -0.1646120995, 0.0152630061, -0.0722632185, 0.1157181114, -0.0101244226, -0.279997766, 0.3596169353, 0.5151503682, -0.1593509912, 0.3464237452, 0.217025876, -0.2327196151, -0.3488968611, 0.3377685249, -0.1324558556, -0.2263544202, 0.1486911029, -0.0374891162, -0.0669675916, 0.3339707553, -0.0396514907, 0.628792882, 0.394513756, -0.1595231593, -0.1377300769, -0.1415909976, -0.3631260991, -0.2324801087, 0.4056430459, 0.0062038451, -0.4137159288, -0.2668800056, -0.1262898445, 0.3257219791, 0.4485498965, 0.4173037112, -0.0687521547, 0.1465702206, 0.3328165412, 0.440639466, 0.4901854396, 0.0109503269, -0.5700106621, 0.0405080393, -0.1876827776, 0.0902726948, -0.1475190371, 0.3816790879, 0.6364921927, 0.2377494276, 0.3549271822, 0.1779021621, -0.0855331272, 0.2613483369, -0.1656879187, -0.1175128892, 0.2443191409, 0.1028598025, 0.0680370703, -0.1726322025, -0.0305093154, 0.031701941, 0.0234102905, 0.0258355159, 0.0950575918, 0.0940839797, 0.1272771955, -0.0584887341, 0.0846118778, -0.2734280527, -0.2215222418, 0.0759866685, 0.421875447, 0.1808431596, -0.3522838354, -0.3539557457, -0.1467494071, 0.1585353464, 0.3680201471, 0.0825596452, -0.0650568381, -0.3180900812, 0.1961795837, -0.1326884776, -0.2265256643, -0.1426742375, -0.052441448, 0.0599182509, -0.0610493124, -0.0308262669, 0.206848532, -0.1080192029, -0.0747323781, -0.0408545546, 0.1979225278, 0.3113131523, 0.1773788333, 0.0573525243, 0.2771246433, -0.2035664916, -0.2185437083, 0.4961541891, 0.0398582295, 0.1094277576, 0.1492645442, -0.2200749516, 0.1322614849, -0.2009375691, -0.4113143682, 0.3036414385, 0.1208435446, 0.6467666626, 0.0456712469, 0.0394131914, 0.186606735, 0.0499048904, -0.0209066533, -0.3467067182, 0.0559413247, 0.1037927046, -0.0900083035, 0.1854764074, 0.0254999697, 0.273661226, 0.2416230887, -0.0639332905, 0.0869313106, 0.2822873592, -0.0984453708, -0.2455403209, 0.1920065582, -0.2486239076, 0.0268252268, 0.2137014419, 0.1858731806, -0.2289255559, -0.1750140786, -0.013244886, 0.2093525529, 0.2164666355, -0.1856966317, -0.2287490219, 0.193964541, -0.0516947582, -0.3180812001, 0.1175256148, -0.0644952804, 0.2998572886, -0.2273159027, -0.2105186433, -0.2503576279, -0.1601746976, 0.3770163357, -0.0750865936, -0.0129983183, -0.2862332761, 0.3427687585, 0.1238391027, 0.1124929637, 0.2113859653, -0.2102445066, 0.342367053, 0.0275170878, -0.2496314943, -0.2695375085, -0.5140573978, 0.0300201699, -0.0644229352, -0.0016975291, 0.4669358134, 0.2170314193, 0.3613241315, -0.2467991412, -0.1738607883, -0.4038596451, 0.058160875, -0.1109810397, 0.2604951859, 0.1097898185, 0.4814262092, -0.3645493984, 0.0615463853, -0.0480228737, -0.1158277094, -0.0675557703, 0.1509258598, -0.0420301072, 0.1865851134, -0.0737376958, 0.2256580293, 0.0664138123, -0.1036399156, -0.0674204603, -0.1274869144, 0.3572298884, -0.3141645193, -0.0175235644, -0.217800945, -0.1374753565, -0.0886401013, -0.1316665113, 0.2906398475, 0.4122539461, 0.2820617259, -0.0256647095, -0.1306436211, -0.0831023306, -0.1489640176, 0.5557093024, -0.3557236195, 0.0762021393, -0.2389131337, 0.0555395335, 0.1153744757, 0.1321070492, 0.4308938384, -0.0446395613, 0.0358336754, 0.0726101398, -0.3384999633, -0.2934177518, -0.0454603098, -0.1858826876, 0.2047915161, 0.5843624473, 0.2935065627, 0.7721483111, 0.0733560175, 0.2170887589, 0.0129311569, -0.0168374125, 0.0995334238, -0.0675669387, -0.2521345615, -0.2696582973, -0.2066067457, -0.151266709, 0.1877739578, 0.2309907228, -0.5564442873, -0.0622036569, 0.1338442564, -0.0898359418, -0.2923493683, 0.3094573617, 0.1377822459, 0.1617706269, 0.3674429059, 0.1456876695, -0.463714838, -0.4544997513, -0.0988751799, -0.1702693105, 0.0169053711, -0.1957838833, -0.5587351918, -0.2824578583, -0.7603421807, 0.2780368924, 0.0803081095, 0.1472102404, 0.161999613, -0.3202676177, 0.2465570569, -0.0714155138, 0.6872807145, -0.0104196277, -0.3197701573, 0.1650807709, -0.039980758, -0.5558208227, 0.2617912591, -0.0753832012, 0.1620530635, 0.1187626496, 0.5174380541, -0.5288389325, -0.1607709527, 0.0649640262, 0.1406829208, -0.1829619259, 0.082018137, -0.1768846512, -0.4218448699, -0.0769357607, 0.2829671204, 0.0335436389, 0.0901067182, 0.4562000036, -0.0388986878, 0.1134733781, -0.1031079292, 0.1004562974, 0.3970750272, -0.0307703819, 0.1656960845, 0.0527826101, 0.3227798939, -0.3491333127, -0.0113406591, 0.1368065774, -0.1160185561, -0.0272124, 0.0151857212, 0.1074853837, 0.3381063342, 0.5932179689, 0.0359439179, 0.3888603449, -0.130417496, 0.1923788935, -0.1143195182, -0.0236530695, -0.1840964258, -0.0883664861, -0.2721227407, -0.3375439048, 0.3402323723, 0.2814844549, -0.2885203063, 0.6071956754, 0.1475518793, -0.1815363169, 0.4796705842, 0.3666978478, 1.0546466112, -0.5467888117, 0.1906892657, 0.0070266556, 0.1227302477, 0.3516570628, -0.4375030398, 0.287771225, -0.1726365089, -0.185995549, 0.0071150362, -0.0953335017, -0.1211981326, 0.16274786, 0.1264433265, 0.1171512604, -0.0559109226, 0.5475069284, 0.1061088219, 0.043499589, 0.2786795795, -0.4434580207, -0.1778914332, -0.0017233267, -0.0110877436, -0.2943687141, 0.0281584859, 0.3908114135, -0.1466887295, -0.3729055822, -0.216804564, -0.2689220607, -0.2742674947, 0.0710579604, -0.2382917106, 0.010642454, -0.2562417388, -0.0652527213, -0.4524875879, 0.1239845008, 0.1430535018, 0.0936324149, 0.4910563827, 0.2933094203, 0.1694730222, -0.0947190896, 0.0999563485, 0.0882193446, -0.0490513742, 0.2174961716, -0.1155948341, -0.3844927549, -0.3565835357, 0.1957245767, 0.541051805, 0.0535354093, -0.013500113, -0.0737215579, 0.2004080117, -0.2042749673, -0.0176930837, -0.1041296721, 0.0264190212, 0.4646109343, -0.0085955877, -0.3243324757, -0.0151907261, 0.3858380616, 0.2920018733, 0.0562836826, 0.1858606637, -0.1234940812, -0.5478107929, -0.0282436833, -0.0300152749, 0.1806603074, 0.056926012, 0.004683286, -0.2886974812, -0.1033007577, -0.0024994053, 0.1498053968, -0.0124311112, -0.1362503022, -0.2823069692, -0.3563693762, -0.0686287582, 0.4347739816, 0.2062357068, 0.1038128436, 0.0580777973, -0.1695519388, -0.4256274402, 0.5064361691, -0.1533576995, -0.2173798084, -0.1600068212, 0.4036406577, -0.2167794108, 0.2944271564, -0.0808225423, -0.1172752231, 0.0371399298, 0.009843953, 0.0286146887, -0.1156681329, 0.1221240014, 0.2382363081, -0.1640379429, -0.0912226439, 0.0329152122, -0.1731160283, -0.128194347, -0.4739847481, 0.2547743618, 0.0811574459, -0.0105226077, -0.3706905842, 0.4491296411, -0.1695689559, -0.047170978, 0.1714465916, -0.1817425787, -0.0698385239, 0.0787624568, 0.3315686584, 0.0072499923, 0.065605551, -0.0210310984, 0.2076463252, 0.0554324724, -0.3246942163, -0.0300756581, 0.0958472341, -0.019771941, 0.203446418, 0.1249016821, 0.419164449, -0.063769035, -0.0818423927, 0.3650664389, -0.0094162058, -0.1428359151, -0.3040503561, 0.4143344462, -0.1500127316, 0.1602363288, 0.4338811934, 0.046345599, 0.1727830619, 0.0426418744, -0.2313519269, 0.5329791903, -0.1897873729, -0.2840985656, 0.3717330694, 0.271936208, -0.1213113964, 0.1473492235, 0.1920561492, -0.0682759881, 0.2579432726, -0.0198372826, 0.2973338962, 0.0691005141, 0.0615572445, -0.4594758451, -0.146694839, 0.0268919803, 0.4805703163, -0.1504915655, 0.1339511275, -0.0326375812, -0.0540246591, 0.4316009581, -0.1216275096, 0.1498163044, 0.256814599, 0.0415892489, -0.1748087108, -0.2070778012, -0.2911294699, 0.0330200195, 0.035049215, 0.0190113168, -0.3109898567, 0.4285988808, -0.0039088354, 0.1566877216, -0.3297461271, 0.1822064221, -0.2607098818, 0.28370893, -0.2353380024, 0.0545077994, -0.4959181547, 0.3333553076, 0.0746462196, -0.3306189477, 0.1200235635, 0.3252443969, -0.0473218784, -0.0790774226, -0.259773165, -0.2576856613, -0.1574634612, 0.1137760654, 0.0249791034, 0.0598859303, -0.0813168436, -0.0540573224, -0.0252095722, -0.2818568051, 0.3496994674, 0.2898430526, -0.0031583793, -0.1131203324, 0.0707381517, -0.3256595731, 0.1132197082, -0.1082585007, 0.207645148, 0.096694544, -0.0187658817, -0.2357942313, 0.1526088715, 0.0616222993, 0.0044911541, 0.0336207859, 0.2721970081, -0.0687188357, 0.0013842341, -0.2263070792, -0.3218940198, -0.4398280978, -0.0292009003, -0.6811190844, -0.3565356433, 0.3824739158, 0.2835347056, 0.4024674892, 0.2974589765, -0.0878109336, -0.2426255792, -0.3541280627, 0.2983639538, -0.1090958714, 0.3451603651, -0.1417731196, 0.1289978176, -0.083311148, -0.4821413755, 0.2896772027, -0.1179271638, -0.0886595249, -0.0606938191, 0.0506660193, 0.2764613032, 0.311332494, 0.3039518297, -0.1210214719, 0.1925038099, 0.0212960616, 0.1368172318, -0.1140907556, 0.3005505502, -0.4723969698, 0.0878933445, -0.0672234595, 0.1004681289, -0.1225906983, -0.1978380829, -0.0027771145, 0.1293994039, -0.1618320793, -0.1365451515, 0.2370934635, 0.0221229643, 0.2247183621, 0.2171256542, -0.2882349789, -0.0360393077, -0.0173348356, 0.1500175893, -0.2527906299, -0.209210813, 0.5330389738, -0.719319582, -0.4463277757, -0.1595333815, 0.0914134532, -0.0455705561, -0.1843867898, -0.2144661546, -0.3904000521, 0.2421589494, -0.0916076601, -0.3103508949, 0.1091040447, 0.0371695906, -0.1971427202, -0.3341418505, -0.0097183958, -0.1004763693, -0.1067948267, -0.5324400663, -0.4777886868 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
`query_table` simply slices/concatenates parts of the table. The actual data inside the table is not brought in memory. Also I'm more in favor of declaring `input_dataset = self.with_format(...)` since `formatted_as` may update the dataset fingerprint of `self`, which is not expected when someone runs `map`. > It's not clear to me why the [col for col in input_columns if self._format_columns is None or col in self._format_columns] check would be necessary— it seems like either input_columns should simply temporarily override the _format_columns within the map operation, or we should throw an error if there are any conflicts. Currently it doesn't look like this case is checked for at all within map, but maybe I'm just missing it. Actually yes we can just use input_columns. And we do need to add a check to make sure there are not conflicts or this could lead to confusing errors.
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
145
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. `query_table` simply slices/concatenates parts of the table. The actual data inside the table is not brought in memory. Also I'm more in favor of declaring `input_dataset = self.with_format(...)` since `formatted_as` may update the dataset fingerprint of `self`, which is not expected when someone runs `map`. > It's not clear to me why the [col for col in input_columns if self._format_columns is None or col in self._format_columns] check would be necessary— it seems like either input_columns should simply temporarily override the _format_columns within the map operation, or we should throw an error if there are any conflicts. Currently it doesn't look like this case is checked for at all within map, but maybe I'm just missing it. Actually yes we can just use input_columns. And we do need to add a check to make sure there are not conflicts or this could lead to confusing errors.
[ -0.0905099213, 0.2783812881, -0.0073054954, -0.1781732142, 0.1408669204, -0.0961289778, 0.3184326291, 0.5706531405, 0.18682307, -0.0280763656, -0.0586420484, 0.484647572, 0.0940667689, -0.26581496, -0.0045915507, 0.2481259108, 0.1001638919, 0.3244250417, 0.2597138286, 0.0609557331, -0.1716759801, -0.2206239551, -0.215483129, -0.0906189531, -0.0869432837, -0.0568240508, 0.1601070464, -0.3758946657, -0.3585891724, -0.1589110494, 0.266477704, 0.3161300123, -0.2051471174, 0.1349194646, -0.0001272232, -0.0201996937, 0.0467347391, -0.0373278111, -0.1995200515, -0.0664868206, 0.1474396139, -0.1848529279, 0.1072841734, -0.2459904552, 0.0598432869, -0.1259110272, 0.0318900123, -0.0521759242, 0.0090083517, -0.1114034504, 0.0332685299, -0.0471821502, -0.3189131618, 0.2509439588, 0.4844823182, 0.2142708302, -0.0029352009, -0.1754945666, 0.283651948, -0.3993281424, -0.1439494789, 0.5009638667, -0.4719655812, -0.0450849682, 0.3814985752, 0.0277340673, 0.0133876354, -0.1974849999, 0.3342887163, 0.0723303258, 0.2053316534, -0.3297650516, -0.0984181613, -0.2013445795, -0.0895543993, -0.2471137047, -0.0652237684, 0.0728401542, -0.4196495116, -0.0061348593, -0.2666518688, -0.2152369022, -0.0831528157, 0.3996169567, -0.4749019146, 0.4343480468, 0.1701667309, 0.3172896504, 0.1965943724, -0.146007508, 0.0056468733, -0.0809226334, 0.4420043826, 0.5432041287, -0.4257611632, -0.139275983, 0.137889117, 0.0193599388, 0.2514256835, -0.2275914252, -0.1442240328, 0.3652476966, 0.382086724, 0.1383817494, 0.3823767304, 0.0552433841, -0.0678868443, 0.565472424, 0.3401664197, -0.1287792325, 0.0992509574, 0.086619027, 0.0072619468, 0.3771412969, 0.2361534983, -0.397177279, -0.1501548588, -0.1441701055, -0.003334932, -0.0359201021, -0.2364971787, 0.0379732959, 0.1146312281, 0.446728766, 0.2171151787, 0.221940279, -0.2395925224, 0.0069660209, -0.2428153306, 0.01671407, 0.0263267122, 0.036149513, -0.0885545388, 0.1784718037, 0.126309976, 0.1700143367, -0.1283933222, 0.0416776128, -0.0802162439, 0.1100664586, 0.0178497955, -0.2410556078, 0.3043305278, 0.5060300827, -0.1270372719, 0.4151406586, 0.2337828875, -0.2551229, -0.3541779816, 0.3156720996, -0.2056190372, -0.2452473342, 0.1567534208, -0.0432886705, -0.0533225089, 0.3144856393, -0.0819183588, 0.5806530714, 0.3763390779, -0.1514412165, -0.1035860181, -0.1623916626, -0.3125418425, -0.2653498352, 0.3400167525, -0.0321210995, -0.4576417208, -0.2199669033, -0.1748516858, 0.250041306, 0.4678743482, 0.4039687514, -0.1157770827, 0.1306845844, 0.3230547905, 0.4230683744, 0.5786602497, -0.0044511333, -0.6051672697, 0.0456339382, -0.1910752654, 0.1302182376, -0.125892669, 0.3633515537, 0.6630903482, 0.1699456125, 0.350297451, 0.2083820999, -0.0832404122, 0.2332908213, -0.1320050955, -0.0992472917, 0.2240941823, 0.0698583871, -0.0314693451, -0.1580111831, 0.0432079919, -0.0146942697, 0.0120329913, -0.0307440273, 0.1495978236, 0.0352641828, 0.1225032657, -0.0793453455, 0.0968368798, -0.1701589823, -0.3151440024, 0.0833320543, 0.4757760465, 0.1626961976, -0.3184890151, -0.4162277281, -0.1717950404, 0.1589780748, 0.3474315107, 0.0717157945, -0.0883720517, -0.306278944, 0.1927579343, -0.1530598104, -0.2230237871, -0.1582785696, -0.0786756873, 0.0918848142, -0.0018246602, -0.0461273566, 0.2228625268, -0.0545992032, -0.0833943412, -0.0686208308, 0.2227339745, 0.226854533, 0.1690959185, 0.1006864011, 0.3023970127, -0.2007378787, -0.3022832572, 0.4918419123, 0.036872983, 0.152469933, 0.1140560955, -0.2299970239, 0.1563225687, -0.22396034, -0.4133351445, 0.2558533549, 0.1995143294, 0.6288721561, 0.0527713895, 0.0841596425, 0.1763398945, 0.0580592155, -0.0930087715, -0.3284853995, -0.0237519331, 0.0519339889, -0.068455182, 0.1705929488, -0.0424999595, 0.2811126113, 0.3036043942, -0.0635399073, 0.1217750534, 0.2883030474, -0.1449164748, -0.2208013237, 0.2054196447, -0.1809397042, 0.0339855962, 0.174577862, 0.163983494, -0.2133016884, -0.187669754, -0.0083751492, 0.1992293596, 0.2124733776, -0.1250436902, -0.2343131751, 0.2074477375, -0.0626444519, -0.3354996443, 0.0732227489, 0.0212958679, 0.2981351316, -0.2283178121, -0.1893727779, -0.2869471014, -0.1307526976, 0.3210743964, -0.0955275148, 0.0365266278, -0.2719178796, 0.3166378736, 0.1489033848, 0.1104651168, 0.2225831896, -0.0962288678, 0.3324807882, 0.0444537997, -0.2473367304, -0.2861946225, -0.4948458076, 0.0235187449, -0.0699812695, 0.0105354004, 0.3992694616, 0.2383037806, 0.3589071631, -0.2722927928, -0.2329821587, -0.4402542114, 0.0664393753, -0.175351873, 0.2203934491, 0.1014787033, 0.5082468987, -0.353063792, 0.0723143592, 0.000810951, -0.0886776596, -0.1040693671, 0.1476089805, -0.0548233464, 0.1584560573, -0.132439658, 0.2103565484, 0.0645833686, -0.1025525481, -0.0885689557, -0.1085604355, 0.3564192653, -0.3576384485, -0.0122363269, -0.2859365344, -0.1159280688, -0.0990878567, -0.1391466856, 0.2119529396, 0.443318367, 0.2500693798, -0.0770412385, -0.1258709878, -0.08333233, -0.1012144983, 0.6114694476, -0.364541471, -0.0142553747, -0.209016338, 0.0716233253, 0.1647156328, 0.1409076601, 0.4514613748, -0.0423875041, 0.059007559, 0.0534382761, -0.3214301765, -0.2903229892, -0.0478873141, -0.2004416585, 0.213862747, 0.6448987126, 0.3093883395, 0.8403737545, 0.1130491793, 0.1725103706, 0.0337037146, -0.0510693043, 0.0815414488, -0.063332364, -0.2036997676, -0.2114544511, -0.235052079, -0.0964307636, 0.1833264232, 0.1717272103, -0.5537524819, -0.0195635706, 0.1473822743, -0.1255723089, -0.2622873187, 0.3043641746, 0.1472884864, 0.1680820286, 0.3741905689, 0.1579212546, -0.4175933003, -0.4230321646, -0.0638342947, -0.1295705587, 0.0286786482, -0.1340872049, -0.5923663974, -0.2360266, -0.7482568622, 0.3018722832, 0.0829414874, 0.152283296, 0.1874332875, -0.2930601239, 0.2830199599, -0.0755593926, 0.6906270981, -0.0455457419, -0.2970349193, 0.1469214559, -0.0236815587, -0.5939134955, 0.2209276408, -0.0780476928, 0.1537733078, 0.1613263786, 0.5281012654, -0.5880944133, -0.1972344071, 0.0655305162, 0.1682627201, -0.1555670351, 0.0721532404, -0.1180701703, -0.3797646761, -0.1486627609, 0.2245043963, -0.0023847967, 0.0908387899, 0.4537906051, -0.0277320147, 0.1108869389, -0.092906408, 0.0876655281, 0.4273620844, -0.0526523963, 0.1802548617, 0.0472498685, 0.265717268, -0.296256721, -0.012426516, 0.202689901, -0.0458397865, -0.1055433527, 0.0209689736, 0.1237260848, 0.3193657398, 0.5515723228, 0.018152006, 0.3794239163, -0.1454444826, 0.187247172, -0.1112790853, 0.0134000778, -0.130166322, -0.0295660198, -0.347138226, -0.3774891496, 0.3290826678, 0.2539482415, -0.2744832933, 0.6376811266, 0.1579563618, -0.15580374, 0.4983796179, 0.3384493589, 1.0316677094, -0.523704052, 0.1810262203, 0.0649036318, 0.1576910913, 0.3389489651, -0.4578656554, 0.2421643287, -0.1825536191, -0.1255980432, -0.0275493562, -0.1177876741, -0.0809305161, 0.2127179503, 0.1301223189, 0.1471437812, -0.0913339108, 0.5559555292, 0.1121522114, 0.1031304449, 0.3103382587, -0.4191629291, -0.0604598075, -0.0199584439, -0.0042770319, -0.2660845518, 0.0550702959, 0.3650120199, -0.182029292, -0.4132023752, -0.1793474704, -0.2829312086, -0.2284820527, 0.0317848921, -0.168881461, -0.034446083, -0.1854677498, -0.0827976018, -0.4226720333, 0.1179890186, 0.165964514, 0.1124050915, 0.5068201423, 0.2643394768, 0.1579756588, -0.1196403652, 0.1131160632, 0.0955270827, -0.0212479979, 0.2237524986, -0.1186209321, -0.4042241871, -0.3700036407, 0.1789551675, 0.5880463123, 0.0173715651, -0.0404587053, -0.0579556115, 0.1724024117, -0.2196785659, -0.0317841694, -0.1428269297, 0.0773453861, 0.4151412547, -0.0195989553, -0.3192186952, -0.0349478796, 0.3392708302, 0.2927275896, 0.0734843761, 0.1987023801, -0.147939533, -0.5300844312, -0.036232803, -0.0716011971, 0.2113043815, -0.0061025396, -0.0332691297, -0.3178266287, -0.0642099082, -0.0575800277, 0.1637300253, -0.0530695654, -0.0385550968, -0.2860911489, -0.4268896282, -0.0263915919, 0.3972121179, 0.18317689, 0.0775509849, 0.1022703201, -0.1148224771, -0.4360662997, 0.5048319697, -0.1520839185, -0.2250876427, -0.0594023317, 0.4260326326, -0.1437665224, 0.3060751557, -0.0553404391, -0.0834069028, 0.0524668954, -0.0266076028, -0.0302527659, -0.1135833934, 0.0803572983, 0.2378629148, -0.1588045061, -0.0903760344, 0.0642995387, -0.1745073795, -0.1558815837, -0.4696466029, 0.2788099647, 0.0590897352, -0.056916371, -0.3633276522, 0.3943200409, -0.1517093182, -0.0716863573, 0.1434637904, -0.1927839369, -0.0455463603, 0.0723630339, 0.298558563, 0.0111882575, 0.0529190898, -0.0957502723, 0.1875258833, 0.0862704366, -0.2638135552, 0.0045440202, 0.080519855, 0.0404202864, 0.1443314105, 0.1404487938, 0.3716207147, -0.0964737386, -0.1018290967, 0.3553166986, -0.0119077722, -0.1676962823, -0.284827441, 0.4189099073, -0.0634241626, 0.227940768, 0.4156303406, 0.0333215892, 0.1718689948, 0.0038924124, -0.2800185084, 0.5418035984, -0.1752538383, -0.2971151471, 0.3870226741, 0.2368101478, -0.1032681987, 0.1635177135, 0.1996379346, -0.0974576995, 0.252251476, -0.0348035954, 0.2527012229, 0.1692420989, 0.0488702692, -0.4442733228, -0.1520388573, 0.109821409, 0.4503722787, -0.1263176501, 0.1095263362, 0.0359788239, -0.1239172816, 0.51401335, -0.09647879, 0.1751799583, 0.2371952087, 0.0678904653, -0.1532940269, -0.3148584366, -0.253097266, 0.0662412941, 0.0134201422, -0.0530080758, -0.3334814012, 0.422704488, 0.0035084225, 0.1609497666, -0.338971734, 0.1463305354, -0.2596045732, 0.2895326316, -0.2076029778, 0.0851738974, -0.5017512441, 0.2916600108, 0.0855107456, -0.3297108412, 0.1519297212, 0.3821585476, 0.0403682329, -0.0721255988, -0.2558273077, -0.2519415617, -0.1346753538, 0.0848695487, 0.0511256941, 0.0589234866, -0.0254164822, -0.0539001599, -0.0340354554, -0.2723688483, 0.3616445661, 0.1971456856, -0.0291687753, -0.1404812634, 0.0581687354, -0.3104745448, 0.1202825159, -0.0976939276, 0.1871075779, 0.0659416616, 0.045058351, -0.2126417011, 0.1698902249, -0.0271921158, -0.0016709827, -0.0074149352, 0.273450613, -0.05350798, -0.0002117325, -0.2139617503, -0.3434698582, -0.4677130878, 0.0057681464, -0.7461006045, -0.3828419745, 0.3602569997, 0.3030541539, 0.4502289891, 0.3592272401, -0.0408316106, -0.2498151064, -0.3973613381, 0.3535869718, -0.1052341014, 0.3524166644, -0.1102698743, 0.1047955826, -0.0784876198, -0.5093356967, 0.3277422786, -0.1419185847, -0.0881254449, -0.0596212707, 0.0847381875, 0.2887510061, 0.2048825622, 0.3212366104, -0.1280442625, 0.1876015365, 0.0583331734, 0.1533364654, -0.1223327368, 0.3114010692, -0.4641098082, 0.1369899809, -0.0773248374, 0.1348334998, -0.0685960725, -0.1925359666, -0.0155429393, 0.1387906075, -0.151376918, -0.1522451043, 0.2654102147, 0.1188472509, 0.1583604515, 0.2228540033, -0.2743421793, -0.0407454632, 0.0157609135, 0.1023179069, -0.2132021338, -0.2157048285, 0.5233755708, -0.7930592895, -0.4431899786, -0.162582621, 0.0579367131, -0.0527236983, -0.1747991294, -0.1622187048, -0.3733669817, 0.2869020402, -0.1278047264, -0.3367221355, 0.1035344303, 0.0237301588, -0.171841085, -0.3246551752, -0.0177167878, -0.1019671857, -0.1382973492, -0.5111662149, -0.541341424 ]
https://github.com/huggingface/datasets/issues/2193
Filtering/mapping on one column is very slow
That sounds good to me! I just submitted a PR (#2246) implementing your approach. I also changed how `_query_table` handles Iterable keys since it still seemed like `pa.concat_tables` was taking a long time to create the table for each batch. Now my whole `map()` operation takes 1 min 46 seconds where it used to take somewhere on the order of 10 minutes.
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
62
Filtering/mapping on one column is very slow I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation. I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API. I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset. PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. That sounds good to me! I just submitted a PR (#2246) implementing your approach. I also changed how `_query_table` handles Iterable keys since it still seemed like `pa.concat_tables` was taking a long time to create the table for each batch. Now my whole `map()` operation takes 1 min 46 seconds where it used to take somewhere on the order of 10 minutes.
[ -0.173717767, 0.3303045928, -0.015150141, -0.2352603525, 0.0967266858, -0.1373568028, 0.2451969683, 0.6020464897, 0.1215747446, -0.0561252236, -0.0701218024, 0.5131320357, 0.0704804063, -0.2048010379, -0.017926218, 0.2067430764, 0.0910434276, 0.3320172727, 0.3077169657, 0.1418740302, -0.1245097145, -0.1790830642, -0.1606730968, -0.0990439802, -0.0650923029, -0.0865211412, 0.1429020464, -0.4043104649, -0.33234936, -0.2287280262, 0.3221343756, 0.3873365223, -0.1767812669, 0.1415215731, -0.0001248356, -0.054932192, 0.0140449777, 0.0137422085, -0.1824400574, -0.0295473859, 0.1309022605, -0.2167411745, 0.0755151212, -0.1730610877, 0.0476242602, -0.1083691865, 0.0306258071, -0.0478270091, 0.0215572082, -0.0948140025, 0.0412021987, -0.0476072542, -0.2681419849, 0.2097004652, 0.4645837843, 0.1935358793, -0.050210163, -0.1640959233, 0.3533455431, -0.4462712705, -0.1411143243, 0.5246970654, -0.459346354, -0.0403556675, 0.370593518, 0.0064205788, 0.0693932474, -0.2104830593, 0.2937602103, 0.1523417681, 0.1825719923, -0.3065946698, -0.1353577971, -0.261647135, -0.0473707095, -0.2595097721, -0.0601450652, 0.0456711352, -0.4410808086, -0.0086556841, -0.252053827, -0.2057040185, -0.0832185969, 0.3169910014, -0.4233547747, 0.4046778083, 0.2104638964, 0.2437730581, 0.2672820389, -0.2661039829, 0.0122516006, 0.0007130485, 0.3663116097, 0.5617975593, -0.4556775689, -0.1941937208, 0.1578666121, -0.0031945892, 0.3044347763, -0.2430675775, -0.2232781649, 0.4180021882, 0.3920200169, 0.0452780873, 0.3689549565, 0.075462684, -0.0427872948, 0.5948011279, 0.3502452374, -0.0975289047, 0.03986229, 0.0979133844, 0.0036888272, 0.2870083153, 0.20490852, -0.3669083714, -0.198736608, -0.1619669348, -0.0005876943, -0.01478016, -0.1699251831, 0.0222502202, 0.1173084974, 0.4559850693, 0.2418351769, 0.2840330601, -0.2097377479, 0.0206910633, -0.2422887087, 0.0668707713, 0.065980345, -0.0030265357, -0.1116452664, 0.2152009904, 0.1996006817, 0.1780089438, -0.2033909857, 0.0543161891, -0.0201786831, 0.1206370145, -0.0231198668, -0.2095012069, 0.2548904121, 0.4586891234, -0.1261474639, 0.3494057059, 0.2085408866, -0.2365359366, -0.362569809, 0.2813227177, -0.1292226166, -0.2616798282, 0.1350032091, -0.0050355941, -0.0949932411, 0.2969782054, -0.0937209129, 0.596853137, 0.4027433395, -0.1057944521, -0.1509809494, -0.1515807062, -0.3030477166, -0.1957912743, 0.3636773825, -0.022447966, -0.4293307066, -0.1934003383, -0.130592823, 0.3211942315, 0.4375311434, 0.4082218409, -0.1090674996, 0.1430214345, 0.3695865273, 0.3730921149, 0.5056324601, 0.0012929738, -0.5878247023, 0.0985961109, -0.1475343555, 0.0772133693, -0.0818872526, 0.3269076943, 0.6758553386, 0.1778355688, 0.3605338335, 0.1743612587, -0.098185122, 0.2690283656, -0.1825916767, -0.166639939, 0.2102351487, 0.141311422, -0.0145343021, -0.1957736909, -0.0167293511, -0.0238869078, 0.0183543861, -0.0340097733, 0.1450584233, 0.0538881607, 0.1372450888, -0.0590700544, 0.1375437379, -0.2296513021, -0.241596058, 0.0802756846, 0.3720582724, 0.2029229701, -0.3949056268, -0.4120776057, -0.1733497977, 0.1774888337, 0.3402575552, 0.0905262977, -0.0465652719, -0.3512786329, 0.2362407744, -0.1481237113, -0.2082930207, -0.1503551453, -0.038782943, 0.0938903093, -0.0214910656, -0.0832756385, 0.1942668259, -0.0556216985, -0.011072956, -0.0742616653, 0.2472742647, 0.2562747002, 0.1589204669, 0.0734021887, 0.2524617612, -0.1650277674, -0.1919419765, 0.4814748764, 0.0880995318, 0.132039994, 0.1218478382, -0.2094860226, 0.0983595178, -0.1908239722, -0.4711273909, 0.3587898612, 0.1109311059, 0.6832935214, 0.0562719405, 0.0770219266, 0.2420538664, 0.0231918618, -0.0858698338, -0.3186714053, 0.0534634702, 0.0744463876, -0.0931238756, 0.1344123632, 0.0041626096, 0.3699191511, 0.2097866684, -0.0482758097, 0.0577066131, 0.288036406, -0.1121291071, -0.2076293528, 0.1912910491, -0.1340466887, 0.0256761946, 0.198667109, 0.1250025034, -0.2327357978, -0.1954655349, -0.0191458948, 0.2358421832, 0.1909599602, -0.1508255154, -0.2134415507, 0.218603909, -0.0437208489, -0.3614633977, 0.0391206816, -0.0381608009, 0.3463044465, -0.2217035294, -0.1943615228, -0.2746431231, -0.1993753016, 0.3418700397, -0.0573144369, 0.0268592387, -0.2546791434, 0.3636476398, 0.147611782, 0.1041292697, 0.2501796782, -0.1866693646, 0.2861472368, 0.0559879765, -0.2362317741, -0.3087219596, -0.503446281, 0.0297077708, -0.057634782, 0.0336738452, 0.3986271918, 0.2478459477, 0.3540851176, -0.257527411, -0.2357905209, -0.4259320796, 0.0515647866, -0.1574472785, 0.2065596879, 0.1195915788, 0.5191637278, -0.3392124176, -0.0219040252, 0.0146868639, -0.1095935851, -0.0687235296, 0.1560561806, -0.1134048253, 0.1369805634, -0.0930721909, 0.155446142, 0.0553486124, -0.1131985933, -0.0398742445, -0.054862164, 0.3683740497, -0.3320028782, 0.0155546963, -0.310039103, -0.1693536788, -0.1076869071, -0.1219562739, 0.2462713271, 0.4157123268, 0.2412176728, -0.0508855656, -0.1137240678, -0.0976723209, -0.1423163712, 0.5603027344, -0.288372159, 0.0036246851, -0.2501582205, 0.0819395259, 0.1499507874, 0.1256529838, 0.4113702774, 0.0233378373, 0.0292192064, 0.07274656, -0.2747860253, -0.2659973204, -0.108974725, -0.1483223736, 0.2204152048, 0.5995188355, 0.3056703508, 0.82593292, 0.1461462677, 0.2041180432, 0.0113568306, -0.0393548086, 0.0351682417, -0.0617044829, -0.2360725105, -0.2448733598, -0.2205198258, -0.0732968897, 0.1571109742, 0.2240805626, -0.5832895637, -0.0232149512, 0.1542586088, -0.0750844032, -0.3146779835, 0.3322230279, 0.0594744012, 0.1893119365, 0.3733280301, 0.121884048, -0.472897768, -0.423855871, -0.0668866262, -0.1457631588, 0.0048058555, -0.1921513826, -0.6434122324, -0.2553214729, -0.8011314869, 0.2882490158, 0.0854263753, 0.1900913119, 0.201312989, -0.2591620684, 0.2519067824, -0.1105629057, 0.6910763979, -0.086325027, -0.2742424607, 0.2116947919, 0.0120941401, -0.5982695222, 0.2258570194, -0.0498228073, 0.1794186532, 0.1453023106, 0.5133735538, -0.5888467431, -0.1962421387, 0.0125880465, 0.119363822, -0.1398930252, 0.0663576424, -0.080712311, -0.3828617334, -0.1426974386, 0.298594147, 0.0233360156, 0.1394140124, 0.4171295762, -0.0118874982, 0.109866716, -0.0434918962, 0.0566919446, 0.4345964491, -0.0511909425, 0.1705739796, 0.1386632472, 0.3155055344, -0.3407428861, 0.0302702505, 0.0975705236, -0.0715782195, -0.1321180761, -0.0456641763, 0.1029338762, 0.244272545, 0.5856772065, 0.0237272196, 0.3712689579, -0.1306110471, 0.210814476, -0.0397325419, -0.0472766533, -0.1722219586, -0.0398455672, -0.3455403745, -0.4100880921, 0.294497937, 0.2769504786, -0.2877586484, 0.5986562371, 0.1083618701, -0.1681359112, 0.5244889855, 0.3236609697, 1.0571985245, -0.5189005733, 0.1504935771, 0.0092876516, 0.1536119133, 0.3635294139, -0.4427521229, 0.254960984, -0.2084512711, -0.1057655215, -0.0030289963, -0.0757243708, -0.1230416298, 0.2054663897, 0.0988987386, 0.1527143419, -0.0495307222, 0.4358768761, 0.0650617704, 0.1470279098, 0.2220458984, -0.5009418726, -0.1556420922, -0.0032369569, -0.0110683739, -0.2385222614, 0.0460571907, 0.3009205461, -0.1505009681, -0.3813906908, -0.2751623094, -0.2833557129, -0.2573632002, 0.0087852515, -0.161613211, -0.0412305221, -0.1846194416, -0.1071353406, -0.3667345047, 0.110355556, 0.1170675159, 0.1808416098, 0.4582233727, 0.2670480311, 0.1729894131, -0.1589829922, 0.0368417203, 0.0842366964, -0.0447853357, 0.1267388761, -0.1029132158, -0.4008793831, -0.3160427511, 0.1403672695, 0.5727045536, 0.0337956995, 0.0078351647, -0.0225751661, 0.1333249211, -0.2516574264, -0.0018534651, -0.1188050881, 0.0824054182, 0.4565773904, -0.0272303484, -0.2644681931, 0.0116970148, 0.3394797742, 0.2910996675, 0.0598038882, 0.16684255, -0.0950083286, -0.5276139379, -0.0585708953, -0.0580890551, 0.1581248194, -0.0314787328, -0.0513170213, -0.2905529141, -0.1098838374, 0.0539727211, 0.1859713197, -0.0263623912, -0.0672656149, -0.1996271312, -0.3950628936, -0.0409964696, 0.3940742016, 0.1895657927, 0.0728788152, 0.0619026944, -0.1057575345, -0.4257465601, 0.4849441648, -0.1800254136, -0.1897767186, -0.1056909189, 0.383682549, -0.1667008549, 0.256218493, -0.0814873204, -0.1283281446, 0.0692461729, -0.00557392, -0.0075382143, -0.1338733137, 0.0889947563, 0.1997959912, -0.1707243919, -0.107597746, 0.0280459821, -0.1739908457, -0.1748980582, -0.4453567863, 0.1998778731, 0.0480563939, -0.0530806258, -0.4007870555, 0.3999564648, -0.1710920185, -0.0482893661, 0.175654605, -0.1579751223, -0.0703109652, 0.108341828, 0.3241194189, -0.0289293043, 0.032918945, -0.035942167, 0.1754429936, 0.0681956783, -0.2027573138, 0.0485401936, 0.1107327193, -0.045144286, 0.2096825689, 0.1707159132, 0.3930057883, -0.0566607602, -0.02696326, 0.3714154661, 0.0193830896, -0.1883518398, -0.340180546, 0.4027526975, -0.1269008219, 0.1954557896, 0.3642883897, 0.0686026961, 0.1351907253, 0.0908435881, -0.2223107219, 0.6175416112, -0.2608847022, -0.2881406248, 0.3428646028, 0.2779904008, -0.1272324026, 0.1567320824, 0.2082571387, -0.0815167427, 0.2100407928, -0.0578180067, 0.251326412, 0.1970284581, 0.0649876893, -0.4335651398, -0.0970000625, 0.0148964096, 0.4516622126, -0.0940736905, 0.0669019222, 0.0287227631, -0.0680374056, 0.5121014118, -0.1372921169, 0.2153731734, 0.2418620735, 0.0878521204, -0.2178231627, -0.3109595776, -0.2795119882, 0.0975810587, -0.0165843293, -0.0641464144, -0.2964717746, 0.4300552011, 0.0347179547, 0.2284212261, -0.4378513992, 0.1886382103, -0.2358878851, 0.3433358073, -0.203097403, 0.0802778751, -0.475750953, 0.2709185481, 0.0657155141, -0.2793756425, 0.1804791987, 0.3388802409, -0.0215543397, -0.0323867984, -0.2759719789, -0.2054627091, -0.1266847253, 0.084899649, 0.0418895595, 0.0050508287, -0.0361386202, -0.0458711088, -0.0400179103, -0.269287169, 0.3161686063, 0.2101805657, 0.0587211289, -0.1758024544, 0.1078012139, -0.3133996427, 0.1336277574, -0.0684290975, 0.2310841233, 0.0788869113, 0.021928262, -0.1923198402, 0.1817890704, -0.030809829, 0.0192395449, 0.0393719934, 0.2859227359, -0.0379659124, 0.0100692119, -0.2129472196, -0.3246406317, -0.4845193326, -0.0508020669, -0.7596929669, -0.3530136049, 0.388836503, 0.3353845477, 0.4507123828, 0.370834887, -0.0408235863, -0.220857203, -0.3869848251, 0.4041165113, -0.1300007254, 0.3831001222, -0.0210200958, 0.1431987286, -0.0822181106, -0.5314818025, 0.3417708874, -0.1066256613, -0.0619853586, -0.0291413032, 0.0667938739, 0.3297046423, 0.210501194, 0.2903524339, -0.0934271663, 0.1745535731, 0.0669196695, 0.1510738283, -0.1747179925, 0.2675831318, -0.4393055737, 0.0974080786, -0.0462265238, 0.0972072706, -0.100297682, -0.1852228642, -0.0050046481, 0.0859042108, -0.1603620946, -0.1441849321, 0.1892617941, 0.0854236707, 0.2521850467, 0.2280614376, -0.379012078, 0.0066344249, -0.0243190974, 0.1235877573, -0.2594009638, -0.2491068989, 0.4583290815, -0.7934113145, -0.4857645035, -0.1487044692, 0.069374375, -0.0347618647, -0.1215016171, -0.1182696968, -0.3490398526, 0.2194591761, -0.1350418329, -0.3207777739, 0.098565042, 0.0716266334, -0.2151525021, -0.3376731277, -0.0159619153, -0.0440619215, -0.1244518235, -0.5616629124, -0.5143712163 ]
https://github.com/huggingface/datasets/issues/2190
News_commentary Dataset Translation Pairs are of Incorrect Language Specified Pairs
Hi @anassalamah, Could you please try with this: ```python train_ds = load_dataset("news_commentary", lang1="ar", lang2="en", split='train[:98%]') val_ds = load_dataset("news_commentary", lang1="ar", lang2="en", split='train[98%:]') ```
I used load_dataset to load the news_commentary dataset for "ar-en" translation pairs but found translations from Arabic to Hindi. ``` train_ds = load_dataset("news_commentary", "ar-en", split='train[:98%]') val_ds = load_dataset("news_commentary", "ar-en", split='train[98%:]') # filtering out examples that are not ar-en translations but ar-hi val_ds = val_ds.filter(lambda example, indice: indice not in chain(range(1312,1327) ,range(1384,1399), range(1030,1042)), with_indices=True) ``` * I'm fairly new to using datasets so I might be doing something wrong
22
News_commentary Dataset Translation Pairs are of Incorrect Language Specified Pairs I used load_dataset to load the news_commentary dataset for "ar-en" translation pairs but found translations from Arabic to Hindi. ``` train_ds = load_dataset("news_commentary", "ar-en", split='train[:98%]') val_ds = load_dataset("news_commentary", "ar-en", split='train[98%:]') # filtering out examples that are not ar-en translations but ar-hi val_ds = val_ds.filter(lambda example, indice: indice not in chain(range(1312,1327) ,range(1384,1399), range(1030,1042)), with_indices=True) ``` * I'm fairly new to using datasets so I might be doing something wrong Hi @anassalamah, Could you please try with this: ```python train_ds = load_dataset("news_commentary", lang1="ar", lang2="en", split='train[:98%]') val_ds = load_dataset("news_commentary", lang1="ar", lang2="en", split='train[98%:]') ```
[ -0.1603862792, 0.0044463277, -0.2170423716, 0.2492844164, -0.0537913777, 0.0885385573, 0.3200059533, 0.2294002324, -0.0253905691, -0.235799104, -0.2461352646, 0.1912744492, 0.1839799285, 0.2749132514, -0.0599654131, -0.3076823652, 0.0750909373, -0.1572855413, -0.0141735747, -0.1957398951, -0.1186237335, 0.4341783524, -0.1855175942, 0.0662629679, -0.0329696164, -0.0440254994, 0.0081101134, -0.0337006897, 0.1106165498, -0.1234147698, 0.0804371461, 0.2322266549, 0.1669613123, 0.0935732275, -0.000112882, 0.0626913011, 0.1198945343, -0.1591493785, -0.1555100381, -0.298266232, -0.1329166889, -0.2726252079, 0.1110210717, -0.2844846249, -0.1342523843, -0.4882694781, -0.2545559406, -0.5316691995, 0.561979413, 0.4927166402, 0.2283711433, 0.1886770576, -0.0293713212, -0.0626301318, 0.0920650065, -0.156319499, 0.1393921971, 0.3267948031, 0.3788948953, 0.233580485, -0.1417146772, 0.4323809445, -0.2732176185, -0.1382026821, -0.3607785404, -0.0472380221, 0.2317578197, -0.4424890578, 0.2594131231, 0.2092343271, 0.4308643937, -0.1978799552, -0.3025543094, -0.1495145708, -0.1247406751, 0.0732998922, 0.0783391744, 0.1791186035, -0.2363337725, 0.4208528996, 0.1015166491, -0.1204004437, 0.2136511952, 0.3579365909, 0.069538787, 0.0383976139, 0.0634349436, 0.1177148595, 0.005516992, -0.2202455103, 0.1597223282, -0.1910918653, 0.0891225785, 0.3495163918, -0.3829519153, 0.0538155288, -0.2302296013, -0.1596404612, -0.1328741312, -0.2417427599, -0.2591850758, 0.2534896731, -0.1386710852, 0.0434370227, 0.0932817534, 0.0334968567, 0.2530210614, 0.2435528785, -0.0637137592, -0.1580265164, -0.1277535111, 0.3061584532, -0.0908978581, -0.3678641617, -0.249577105, -0.0187952816, 0.010044679, -0.1621399671, -0.4117811918, 0.1917949766, -0.5404411554, -0.4620902836, -0.0832577795, 0.1982965171, 0.1635903269, 0.1188688204, 0.1320025772, 0.3674802482, -0.1292292178, -0.3483613431, -0.202529192, 0.1246428043, -0.2258712798, -0.0809419751, 0.1155195385, -0.1200005412, 0.3928956389, 0.0889491141, 0.0468150526, -0.2268925607, -0.0558343753, -0.2146733105, -0.0459014103, -0.0501575321, 0.1979779303, 0.3317027688, 0.2548565865, -0.2848149538, 0.0236389488, 0.3267102242, -0.4435577691, 0.3104053736, -0.1882556528, 0.1667384505, -0.1077542007, -0.0085982271, -0.169716388, 0.6289418936, 0.3114934266, -0.0870607272, -0.0063189566, -0.0197956711, -0.1462918967, -0.0890332013, 0.0914799199, 0.268612504, -0.7350518703, -0.1571094394, 0.2101727575, -0.0272704456, 0.1780682206, 0.4736939073, -0.2419959009, 0.2404445261, -0.2692960799, -0.1279768646, 0.3589184284, -0.0183163434, -0.1526153237, 0.0628185868, 0.1232643276, 0.1729452461, 0.2040345073, 0.1173773408, 0.2221217155, -0.0477190912, 0.28745386, 0.3555459082, 0.1821186095, 0.01387541, -0.1741804481, -0.1975988001, 0.8043532372, 0.1991025954, 0.3475906849, 0.0937267542, 0.1516380012, 0.0677663535, 0.4992113411, 0.0608984679, 0.0599409193, 0.2085178941, -0.3930372596, -0.0078785811, 0.0847020224, -0.0669235438, -0.1784450561, 0.022550635, -0.1481733173, 0.2782820463, 0.0313989408, 0.0713067055, -0.5101251006, -0.2441060394, -0.2283974141, 0.1128569618, 0.1740939915, -0.0561851971, -0.2003444731, 0.3978528082, 0.0161954314, 0.3494778574, -0.3953160644, -0.0775608048, -0.4699580371, 0.5394410491, 0.1512418091, -0.2488871813, 0.0358651355, 0.123057887, 0.232458204, 0.0670662373, -0.200137794, 0.0334923677, 0.2786712945, 0.3482086658, -0.0507934466, -0.0064073652, 0.221989423, -0.5121762753, 0.1271722019, 0.3674886525, 0.0434742868, -0.0011217073, 0.0626942962, 0.5724953413, -0.0685309172, 0.1539771557, -0.0435157232, 0.0383260623, 0.4436298311, 0.0863990113, -0.1897151172, -0.3766211271, 0.1505152583, 0.197663337, 0.3643491864, 0.4173544347, -0.1284818947, -0.029719092, 0.4801760018, 0.045636788, 0.1539313346, 0.2072930336, -0.0988581479, -0.1010799855, -0.0438235104, 0.14283593, 0.0806832686, 0.2600465715, 0.0762109607, -0.0822420567, 0.1274818778, -0.1235575601, 0.2154757679, -0.0048621502, 0.2227830291, -0.0436741635, -0.0389344692, -0.1674814224, -0.3917494416, 0.2549133003, 0.0917621627, 0.2471169382, -0.3253049552, 0.037904717, -0.393170476, -0.4345543981, -0.3691057563, -0.3373197615, -0.1522032917, -0.2440906167, 0.0691449344, -0.3370833397, -0.05165812, 0.2737575769, 0.0989736319, -0.1359253228, -0.005557999, -0.126044035, -0.0266693458, -0.2810831666, -0.1618700922, 0.1251727045, 0.2314508557, 0.0707539916, 0.1313432604, -0.4163937867, -0.4749513268, -0.1198276132, -0.4053298235, -0.0478650145, -0.2889056802, 0.1879489124, -0.167656213, 0.3506742716, -0.1211947054, -0.3291274905, 0.1718021929, 0.3448719978, -0.1739182323, 0.0501893014, -0.1361021698, 0.1287709177, 0.0959293619, -0.7553022504, -0.4478919208, -0.1858806759, -0.2732864618, -0.1029552668, 0.1373656839, -0.2782263756, 0.1378392577, -0.0699486136, -0.0187812652, 0.0390546173, -0.4745858908, -0.1095814407, 0.2636792064, 0.007869184, -0.2437194735, -0.1009239107, -0.0027440339, 0.1687005162, -0.145764038, -0.117799975, 0.1816826612, -0.1753923744, 0.2152721584, 0.0845401436, 0.0549145341, -0.0229637884, -0.0714280903, 0.065899469, -0.0468736403, -0.2789112329, 0.1696224958, -0.0225342922, 0.1660205722, 0.0673166439, 0.3073379099, -0.2233280689, 0.4089112878, 0.2515800595, -0.1983571351, 0.4292528629, -0.0283508003, 0.0025143563, -0.1306346953, -0.3173961043, -0.1287920177, 0.120776549, -0.0733570755, 0.3530523479, -0.2160769701, -0.528236866, -0.1642278731, -0.1892625093, -0.6420205832, -0.1335218847, 0.0415197834, -0.5166898966, 0.1264348477, 0.0708090737, -0.0150545537, 0.0889474154, -0.169295609, 0.0185510963, -0.0479633994, -0.1658101678, 0.2463033497, -0.3809500635, -0.2149633169, -0.0469633043, 0.1062625349, -0.0010406114, 0.4505559504, -0.1928530633, 0.0754272789, 0.2239798307, 0.2311148494, 0.5450601578, -0.0847502276, -0.0873197317, 0.1134038121, 0.0887213349, -0.2276887298, -0.1550700068, -0.3379344344, 0.2419279516, 0.2359017134, 0.2066492587, -0.2130776048, -0.2013264, -0.0040749293, 0.3539860845, -0.2952656746, -0.0009568781, -0.2916831374, -0.2589246035, -0.2787747979, 0.0459905975, 0.1793075651, 0.1624135077, -0.1072352082, -0.0954645723, 0.1414390802, 0.1182455644, 0.2900578678, 0.2143939584, 0.3774513006, 0.2690683901, 0.0625306219, 0.0205366015, 0.1457174718, -0.1414901018, 0.4112644792, 0.0600504912, -0.3950056434, -0.1237326264, -0.3656809926, 0.3682535291, 0.1666395217, -0.1312099397, 0.3721060157, 0.1139571816, -0.1772342026, 0.1557317674, -0.1156457067, 0.4012767375, 0.2329643518, -0.3053250015, -0.6735952497, 0.1488204598, -0.0954890102, -0.197221607, 0.1967377067, -0.004777506, -0.3827113509, 0.4975559711, 0.0628828555, 1.074434042, -0.0280651562, -0.0391545072, 0.1542208493, -0.1277805269, 0.1236492991, 0.2234505713, -0.2471267581, -0.2681131959, 0.2510405481, 0.0152117461, 0.1283027083, 0.1363776177, 0.249252975, -0.3342454433, 0.1956285983, -0.1802166551, -0.3561235368, 0.1753019392, 0.0931617916, 0.1528224349, -0.1095379218, -0.5600216389, 0.0805028379, -0.143625766, -0.0337956175, -0.0346261188, -0.0843453929, -0.0435274467, -0.122141175, -0.2342136204, 0.0002529994, -0.3061945438, 0.1942929327, -0.12667799, -0.0991636962, 0.2096234858, 0.589877367, 0.382543534, 0.0900688618, 0.1290687621, 0.045959089, -0.0162972398, 0.140383482, 0.1570027471, -0.077241227, 0.2753785253, 0.0077806488, -0.4079747498, 0.3461225927, 0.0816485286, 0.0866820216, -0.3897946477, -0.0271480493, 0.1086775959, -0.0551293902, -0.2895777524, 0.2188417763, 0.0350418389, -0.2126809508, 0.0971647277, 0.1919375062, -0.1699075252, 0.1545960456, -0.1013786271, -0.4117563963, -0.0543457828, 0.4425744414, 0.5296670794, -0.1368503124, 0.54718256, 0.3692960143, -0.213871032, -0.1849889755, 0.0622486174, -0.1013345718, -0.4705785513, 0.1147586852, 0.0867467523, -0.0498027802, -0.2640343308, 0.1789011359, -0.0241442937, 0.2092764825, 0.0941925645, -0.4357055426, -0.0603150353, 0.1707262397, 0.2167463303, -0.0992687345, 0.0820894763, -0.3421544135, 0.0714792088, 0.0785899609, -0.299454093, 0.0846595317, -0.1085874736, 0.2960161269, -0.2808213532, 0.1872191876, 0.0795307606, 0.0016340092, 0.0794661492, -0.329741776, 0.0653548688, -0.195499897, -0.1920431256, 0.0868406147, -0.1420462877, 0.0796726048, 0.0120769739, -0.2142710984, 0.2390348315, -0.0211502034, 0.2231057286, 0.4757257402, 0.1401371956, 0.2635380626, -0.0364012569, -0.1789247096, -0.3181318641, -0.1975481212, -0.0137959793, -0.1672095805, 0.2358391583, 0.1261306554, 0.188411817, -0.0956989899, -0.026754247, -0.0117566958, -0.0181869045, 0.174696818, 0.0015372173, -0.2785699964, 0.1076119393, 0.0364910439, 0.1765875965, 0.2028991878, -0.2308775485, -0.0796008557, 0.1853612065, 0.177266866, -0.6147270203, -0.0213381108, 0.5288524628, -0.2750107646, 0.1447556615, 0.2450879365, 0.2031956166, 0.235116601, 0.1567691565, -0.1907954216, 0.1878736019, -0.083634153, 0.2569766343, 0.4046109915, 0.2117765695, 0.1322847307, 0.0986595377, -0.0933855325, -0.1742671728, 0.1631148458, -0.3341970444, 0.5841135383, 0.1820129603, 0.0717120767, 0.0548619255, -0.0903358012, 0.1808565259, 0.2378700227, -0.3248427212, 0.0884140506, 0.1094148904, 0.2814010978, 0.379724741, -0.2312448621, -0.2180894911, 0.0207410343, -0.2322667539, -0.0766192973, -0.2955449522, -0.2896881104, -0.472628653, -0.176466763, 0.0326334387, -0.2177875638, 0.3586582243, 0.1761457622, -0.0041048229, -0.3209916055, 0.0277706906, -0.2209040374, -0.079335399, -0.0303448662, 0.3630647063, 0.1145585179, -0.1080794707, 0.2044367939, 0.3449500799, 0.1811066717, 0.2049925625, 0.0664623827, 0.0409103408, 0.1917156279, -0.0250575803, -0.0758972168, 0.3343344033, -0.0258312412, 0.2460725754, 0.1930473298, 0.1758647412, -0.2258743942, 0.1317781657, 0.4836496711, 0.1724401116, -0.1379544437, 0.1059484258, -0.491306752, 0.1809764355, -0.3183491826, -0.0482848287, -0.379301548, -0.1332993805, 0.3305274546, -0.1352651119, 0.1345624626, 0.0768385381, 0.1104672328, 0.0673262626, 0.4936191738, 0.3853740692, 0.3321908414, -0.4657474458, -0.1169254109, -0.5569059253, 0.1085770279, 0.0508560203, 0.0839954689, -0.0349526331, 0.0864710808, 0.5793500543, 0.4553442895, 0.2812595367, 0.1297931969, -0.2663860619, 0.1700764447, -0.3078100979, -0.0728087425, 0.0753232911, 0.3558692038, -0.1880236417, -0.1337622255, 0.0448233895, -0.0883315057, 0.0428946018, -0.1545839757, -0.2890213132, 0.20129475, 0.0260726064, 0.0915934145, 0.0575336292, 0.3487923741, -0.1918726563, 0.3104369044, 0.1170599759, -0.2838106453, -0.076225996, 0.3920165598, -0.0468337536, 0.46381706, -0.1197871715, 0.1886680722, -0.0152258873, 0.1342440248, 0.0824554637, -0.1377571374, -0.4191014767, 0.1097273678, 0.146279335, 0.0051872507, -0.0509905592, 0.3429947197, -0.0020061051, 0.1670832783, -0.0962200761, -0.151856035, 0.2185220569, -0.3656327426, -0.3418232203, -0.0787500367, 0.1099063158, 0.2867901325, 0.0220970605, -0.2997664809, 0.1584620774, 0.3886456788, 0.058672674, 0.2360068858, 0.3053852022, -0.0925669074, 0.2856920362, -0.0411748029, -0.4088050723, 0.2399356216, -0.0098833069, -0.1149382889, -0.402751416 ]
https://github.com/huggingface/datasets/issues/2190
News_commentary Dataset Translation Pairs are of Incorrect Language Specified Pairs
Hello @albertvillanova, Thanks for the suggestion. I didn't know you could do that. however, it didn't resolve the issue ![image](https://user-images.githubusercontent.com/8571003/114169966-ec819400-993a-11eb-8a67-930f9a9b2290.png)
I used load_dataset to load the news_commentary dataset for "ar-en" translation pairs but found translations from Arabic to Hindi. ``` train_ds = load_dataset("news_commentary", "ar-en", split='train[:98%]') val_ds = load_dataset("news_commentary", "ar-en", split='train[98%:]') # filtering out examples that are not ar-en translations but ar-hi val_ds = val_ds.filter(lambda example, indice: indice not in chain(range(1312,1327) ,range(1384,1399), range(1030,1042)), with_indices=True) ``` * I'm fairly new to using datasets so I might be doing something wrong
20
News_commentary Dataset Translation Pairs are of Incorrect Language Specified Pairs I used load_dataset to load the news_commentary dataset for "ar-en" translation pairs but found translations from Arabic to Hindi. ``` train_ds = load_dataset("news_commentary", "ar-en", split='train[:98%]') val_ds = load_dataset("news_commentary", "ar-en", split='train[98%:]') # filtering out examples that are not ar-en translations but ar-hi val_ds = val_ds.filter(lambda example, indice: indice not in chain(range(1312,1327) ,range(1384,1399), range(1030,1042)), with_indices=True) ``` * I'm fairly new to using datasets so I might be doing something wrong Hello @albertvillanova, Thanks for the suggestion. I didn't know you could do that. however, it didn't resolve the issue ![image](https://user-images.githubusercontent.com/8571003/114169966-ec819400-993a-11eb-8a67-930f9a9b2290.png)
[ -0.2070918679, 0.1082224995, -0.1750500798, 0.3257873952, -0.1173713282, 0.1063094586, 0.2994771898, 0.2640419304, -0.0422108956, -0.2637788653, -0.2876570225, 0.2302990705, 0.2286694646, 0.1873269826, -0.0158621687, -0.1873508245, 0.0602837577, -0.1162412465, -0.0766713172, -0.2078413665, -0.1206927747, 0.4833286405, -0.1554272771, 0.0874614716, -0.0198557228, -0.0757311732, 0.1117974222, -0.0085350089, 0.0858547091, -0.0731242672, 0.0822781473, 0.261482805, 0.108448565, 0.0069691613, -0.000112457, 0.038853392, 0.1481906176, -0.1804724336, -0.1509224176, -0.2352924794, -0.1899529994, -0.1916121393, 0.0494393706, -0.2331951112, -0.0486274399, -0.5036548972, -0.2592267394, -0.6031267643, 0.4965833426, 0.4825667441, 0.2310812771, 0.159232527, -0.0802420154, -0.0408689491, 0.1138493866, -0.0614908785, 0.1242372543, 0.3094264865, 0.4024915993, 0.2847636938, -0.2044502795, 0.4041460454, -0.2282706499, -0.1140777394, -0.35245502, -0.1065051109, 0.1520600915, -0.3482455015, 0.2825840116, 0.2758639753, 0.5080474019, -0.1678185165, -0.1993252337, -0.1636418104, -0.1394637376, 0.2181405425, 0.1707415283, 0.1603755355, -0.2545471489, 0.4165378809, 0.0235118233, -0.1333045959, 0.2564949393, 0.2740851641, 0.0819529444, 0.0065444037, 0.0261746086, 0.1473969668, -0.0265228413, -0.2402655482, 0.2194833755, -0.1835358739, -0.0394180045, 0.3342426419, -0.4208230078, 0.0948475599, -0.2715767622, -0.1111840606, -0.0361880921, -0.2702115476, -0.215966627, 0.2290374637, -0.212434113, 0.0176822674, 0.1101570278, 0.0204246268, 0.2749471962, 0.1409306526, -0.1145372838, -0.221906811, -0.0550831221, 0.3491466343, -0.074740082, -0.3854446709, -0.3508568108, -0.0075298101, -0.0393990315, -0.191829443, -0.4289533794, 0.1837584078, -0.4606364369, -0.4549332559, -0.0740872473, 0.1213780567, 0.198321566, 0.0735755637, 0.1456255019, 0.3672657609, -0.1184896082, -0.5046820045, -0.1860051751, 0.0585053638, -0.2199442089, -0.0350081548, 0.108413741, -0.0386633165, 0.327198565, 0.0896232948, 0.0091532739, -0.2344890237, -0.0678082779, -0.2075446099, -0.0875824168, -0.0745325685, 0.158888936, 0.3607530296, 0.166956678, -0.2650852501, 0.0145603716, 0.3440954387, -0.4482039511, 0.3166036606, -0.2072995156, 0.1357679814, -0.2083460987, -0.0145416725, -0.2116769701, 0.7168800235, 0.2936289907, -0.1661971509, -0.0369463861, -0.0093931863, -0.1457159072, -0.0237388834, 0.0767946467, 0.3361554742, -0.8569782972, -0.1413988918, 0.2179490924, -0.055922091, 0.1649336219, 0.4651125073, -0.2521301508, 0.2206263542, -0.2703157663, -0.0620371774, 0.2639397681, 0.1395988464, -0.1155771092, 0.0304961391, 0.1279388368, 0.1764541864, 0.1702403873, 0.0675703287, 0.2028355896, -0.0669738799, 0.2557017207, 0.3319883645, 0.204748705, 0.0191823915, -0.2514999509, -0.2176717818, 0.7432206273, 0.1392660439, 0.3220185041, 0.0856111199, 0.2037647814, 0.1042030528, 0.4789543152, 0.0701841563, 0.110098727, 0.2135411799, -0.4879896343, 0.0136604607, 0.1181339845, -0.006569095, -0.2372848243, 0.0525918901, -0.1922470033, 0.2402580678, 0.0976159871, 0.094660379, -0.5183295608, -0.2205010951, -0.1496953666, 0.1412651092, 0.1538340598, -0.0047626719, -0.3061052561, 0.4099660814, 0.0166393071, 0.3181894124, -0.4055166841, -0.1411063075, -0.5065103769, 0.5023488402, 0.2046549022, -0.1949004531, 0.0360704064, 0.0416822657, 0.2079782337, 0.0284687169, -0.2528674901, 0.027200494, 0.1903561354, 0.416333288, -0.0680364668, 0.0285496935, 0.1770005375, -0.5377520323, 0.1077109575, 0.2704427838, -0.0166984908, -0.0243043005, 0.0595324636, 0.5245127082, -0.0873623937, 0.1252805889, -0.1490868181, 0.0368919149, 0.4804257154, 0.1063953042, -0.1384668946, -0.3812029958, 0.1789484173, 0.2783131599, 0.3480252028, 0.5137358308, -0.0483734533, 0.0098334737, 0.4501888156, 0.1022342145, 0.136055544, 0.2385700047, -0.1030574739, -0.1707391143, -0.0370245948, 0.1684933007, 0.0658079684, 0.1991299838, 0.0308091845, -0.091486074, 0.1579202563, -0.1339718401, 0.1961493641, -0.0373547301, 0.3182069063, -0.014592642, -0.0755700096, -0.1697479635, -0.4137769341, 0.2959268093, 0.2264294028, 0.2362150848, -0.3682641685, 0.0184783563, -0.4315107465, -0.4144333601, -0.3770638108, -0.2337874472, -0.2051527351, -0.2250040919, 0.1289832592, -0.3780669272, -0.0888226405, 0.2565276623, 0.1377761811, -0.0182590336, -0.0960770398, -0.0535555966, -0.1146816611, -0.2418713123, -0.2124229074, 0.1237138286, 0.2201942652, 0.0656659231, 0.0410547182, -0.3897134066, -0.4834823608, -0.1878938824, -0.4103918076, -0.0015654378, -0.2613320947, 0.1828638762, -0.1427699775, 0.3141559958, -0.0985725895, -0.2879114151, 0.0858922005, 0.3214453161, -0.1512871683, 0.076854974, -0.1768757105, 0.1427930593, 0.045422405, -0.7031234503, -0.3522700369, -0.1656287313, -0.2152812481, -0.1919797659, 0.1147105843, -0.3081680834, 0.088097699, -0.0563028045, -0.0772615373, 0.0004884005, -0.5082882643, -0.1679225117, 0.2492829859, 0.0321362242, -0.2306917161, -0.1206716746, 0.0442688316, 0.1717720181, -0.1149342358, -0.1849764585, 0.2866251767, -0.1248211041, 0.203000024, 0.0720044672, -0.1507064998, -0.0101029761, -0.1209728196, 0.0821484402, -0.0942241326, -0.2967144847, 0.2079445124, -0.0237842072, 0.2100843638, 0.0603334941, 0.2478287369, -0.2029666752, 0.3356182575, 0.1705827415, -0.2107932121, 0.4412063062, 0.0188660566, 0.0747181177, -0.1253009886, -0.2115644664, -0.0604499876, 0.1711616516, -0.0759842768, 0.453176856, -0.2013961226, -0.5693999529, -0.085650228, -0.155174017, -0.5203015804, -0.1276293993, 0.0447620079, -0.5405321121, 0.1157746017, 0.12559551, -0.0463958457, 0.0934120268, -0.2187827975, -0.0159638077, -0.1084442437, -0.086830914, 0.3002152741, -0.4213472605, -0.1029062867, -0.0097133722, 0.0856029615, 0.0254890285, 0.477321893, -0.2653150856, 0.1275766492, 0.230305627, 0.2291088402, 0.532581687, -0.0887983218, -0.0412767343, 0.117279686, 0.192292735, -0.2439575195, -0.1629521549, -0.2884435654, 0.1725555211, 0.2764633298, 0.1522152722, -0.1978302896, -0.168487072, -0.0418218635, 0.3355359435, -0.3215472698, 0.0712496862, -0.2177110016, -0.2328760326, -0.2509145141, 0.0198231358, 0.1966993958, 0.1071151644, -0.0507810637, -0.0372979939, 0.1312950104, 0.1556158066, 0.2322294116, 0.2158610672, 0.3609078526, 0.312487781, 0.0315982625, 0.0424514525, 0.094246909, -0.1116564721, 0.4273662269, 0.1121568233, -0.4271693528, -0.0642732382, -0.4153336883, 0.3232226372, 0.1768145263, -0.1840079576, 0.3443749547, 0.1214609817, -0.2251707315, 0.1716859639, -0.1061777622, 0.3313927948, 0.1941071749, -0.2231345028, -0.6060092449, 0.1368164271, -0.149389714, -0.2557845116, 0.2395671308, -0.0266223364, -0.3724321723, 0.4852046072, 0.1678674966, 1.058958292, -0.0351574048, -0.1065523028, 0.0805296302, -0.1452805847, 0.1684011519, 0.178550899, -0.2806612849, -0.2597341537, 0.2365646809, 0.0398073867, 0.1408506185, 0.1140273362, 0.3115155697, -0.2300713807, 0.0468267389, -0.1089319587, -0.3886445761, 0.2423505932, 0.0483881235, 0.1796863973, -0.1412627995, -0.4036940932, 0.0855781958, -0.2182262987, -0.0689880773, -0.0555503145, -0.0272184052, 0.0629641563, -0.1132558733, -0.2976601124, 0.0212450027, -0.2934213281, 0.1737210751, -0.1397778839, 0.0001137853, 0.2800718248, 0.5999956131, 0.3800117075, 0.0967751592, 0.102737017, 0.1409985423, 0.0695198402, 0.1410851181, 0.1837735623, -0.0612157211, 0.2131124586, 0.0452284515, -0.341871798, 0.2424248755, 0.0667414367, 0.0292607769, -0.4200560451, -0.0834331065, 0.1453113556, 0.0165919848, -0.166887641, 0.1984100193, 0.0586385652, -0.1752559543, 0.0911571607, 0.1827019751, -0.1086889431, 0.1305871904, -0.1456709355, -0.4750134945, -0.1150652245, 0.4618608057, 0.5040041804, -0.151592195, 0.548220098, 0.3820111156, -0.1995592713, -0.1921116263, 0.0485898852, -0.1049567312, -0.6128007174, 0.1195228696, 0.0028248951, -0.1312382221, -0.2441660464, 0.1862149686, -0.0041136313, 0.1908035725, 0.0972849876, -0.4100597203, 0.0260742754, 0.1470232606, 0.1694383919, -0.1030796617, 0.1504964978, -0.3970627189, 0.0595296472, 0.1124792099, -0.2846499681, 0.0799207464, -0.1439440995, 0.3035816252, -0.2976051569, 0.2210139632, 0.0754348338, -0.0195182487, 0.0359819606, -0.2703358233, 0.0776737407, -0.1676854193, -0.1923036873, 0.0855726302, -0.1444281638, 0.1185438409, -0.0103988461, -0.2335656881, 0.2074428052, -0.0152420681, 0.2201705128, 0.4723277092, 0.1144116521, 0.1701890379, -0.0476435125, -0.2262438238, -0.3558189869, -0.1969035566, 0.0618402064, -0.1562180668, 0.1322896481, 0.1447284073, 0.170560509, -0.0989718735, -0.0260475334, 0.0426082835, -0.0046606399, 0.2062830031, -0.0048491266, -0.2688602805, 0.1709916294, 0.0225156285, 0.1297854483, 0.0968350023, -0.2307148576, -0.1970714033, 0.1862091124, 0.1450798512, -0.5371164083, 0.0039231814, 0.4899634421, -0.2088156492, 0.1046069041, 0.2514387369, 0.2955907881, 0.1768137515, 0.199625209, -0.2214525491, 0.2599439621, -0.0738696158, 0.2285895199, 0.4026238918, 0.1189535409, 0.1579729915, 0.1433981359, -0.0810467228, -0.1764239818, 0.1547015756, -0.3103891015, 0.5803030133, 0.2122043222, 0.0943989158, 0.0573749505, -0.1589539647, 0.2136093974, 0.2471562326, -0.2911057174, 0.1603901088, 0.1672289819, 0.2373126894, 0.3992870152, -0.239817977, -0.2351873517, 0.006520234, -0.2358169854, -0.0484423675, -0.3694184422, -0.3110376596, -0.4732297659, -0.1640119553, -0.0363925621, -0.1810348481, 0.3521002829, 0.1379117072, -0.022674609, -0.3563268483, 0.0450663306, -0.2528057098, -0.1494701058, 0.0124071091, 0.4107271135, 0.0713987947, -0.0816571862, 0.3319814205, 0.4165547788, 0.112961404, 0.2215243876, 0.2037570328, -0.0075837821, 0.2002257407, 0.0748291239, -0.1067426056, 0.3502703309, -0.0256736465, 0.178625077, 0.2434386611, 0.1610469073, -0.1904513091, 0.0812073946, 0.4890144169, 0.2658088505, -0.0332882591, 0.0065442808, -0.5003944635, 0.2084721625, -0.2983180881, -0.0586429797, -0.2563428283, -0.1303334981, 0.3003170192, -0.1850005686, 0.1647411883, 0.1264182329, 0.1150686964, 0.065795809, 0.601000607, 0.3236119747, 0.2309815735, -0.3963487148, -0.189457804, -0.5788679123, 0.1657882929, 0.0847197995, 0.136489898, 0.002474308, 0.1010721028, 0.6250315905, 0.3840380609, 0.2882045507, 0.1861672103, -0.3260059357, 0.1504502594, -0.3130935133, -0.0815060809, 0.1224747896, 0.3754124343, -0.1949743032, -0.0970986485, 0.1322991699, 0.0054932646, 0.0285953283, -0.1130391955, -0.3280519843, 0.1813623905, 0.0295795072, 0.0740899369, 0.0320031866, 0.2794810534, -0.1914893389, 0.3429440558, 0.0464441404, -0.3566100597, -0.1167315245, 0.4083712101, -0.0768363252, 0.4339624941, -0.1212073565, 0.2614524662, 0.0233433656, 0.0535386801, 0.0698969811, -0.011545632, -0.5153924823, 0.0900911614, 0.0836984962, 0.0525210574, -0.0656460151, 0.3392989337, 0.0372989252, 0.1431981027, -0.117903918, -0.1691691875, 0.2317996621, -0.3227148652, -0.3061880469, -0.0129737966, 0.1450248957, 0.3385317326, -0.0158713888, -0.288661629, 0.1198949367, 0.3938474953, 0.0513231158, 0.2838505805, 0.2297875136, -0.1901126355, 0.220076859, -0.0667837635, -0.4432999492, 0.2886589766, -0.0213214047, -0.0940580368, -0.344376862 ]
https://github.com/huggingface/datasets/issues/2189
save_to_disk doesn't work when we use concatenate_datasets function before creating the final dataset_object.
Hi ! We refactored save_to_disk in #2025 so this doesn't happen. Feel free to try it on master for now We'll do a new release soon
As you can see, it saves the entire dataset. @lhoestq You can check by going through the following example, ``` from datasets import load_from_disk,concatenate_datasets loaded_data=load_from_disk('/home/gsir059/HNSW-ori/my_knowledge_dataset') n=20 kb_list=[loaded_data.shard(n, i, contiguous=True) for i in range(n)] final_dataset=concatenate_datasets([kb_list[1],kb_list[2]]) final_dataset.save_to_disk('/home/gsir059/haha/k.arrow') ```
26
save_to_disk doesn't work when we use concatenate_datasets function before creating the final dataset_object. As you can see, it saves the entire dataset. @lhoestq You can check by going through the following example, ``` from datasets import load_from_disk,concatenate_datasets loaded_data=load_from_disk('/home/gsir059/HNSW-ori/my_knowledge_dataset') n=20 kb_list=[loaded_data.shard(n, i, contiguous=True) for i in range(n)] final_dataset=concatenate_datasets([kb_list[1],kb_list[2]]) final_dataset.save_to_disk('/home/gsir059/haha/k.arrow') ``` Hi ! We refactored save_to_disk in #2025 so this doesn't happen. Feel free to try it on master for now We'll do a new release soon
[ -0.2544759214, 0.0369030684, -0.0747915804, 0.0235322826, 0.2022773921, 0.2077014148, 0.3147448599, 0.3745855391, -0.0703065544, 0.2908636034, -0.1010368019, 0.1949496716, 0.0023284666, 0.2046325803, -0.0519779846, 0.1872818768, 0.326198101, 0.2545650303, -0.2024895102, -0.1318569779, -0.3687120676, 0.3375608325, -0.0871662125, -0.3545358181, -0.2599395216, 0.1303222328, -0.3702031374, 0.1801271737, 0.0867946669, -0.0932736099, 0.1130668372, 0.0303960778, 0.1794943362, 0.1613757908, -0.0001024196, -0.0183925331, 0.0984345302, -0.2301508486, -0.5061351061, 0.0002736449, -0.0454341546, -0.4297144711, -0.0318012796, -0.2701206803, 0.0554981977, 0.0306888148, -0.0264874659, -0.3492639959, 0.1595523059, 0.1346326172, 0.3092631102, -0.061512854, 0.2263929099, -0.1241280437, 0.0925931856, -0.0619513355, -0.1597601175, -0.017490074, -0.3068609536, 0.0766254812, 0.1838666201, 0.2538939714, -0.0520645864, -0.1528070867, 0.1029724479, 0.3315377831, 0.2000032961, -0.3587842286, 0.1949593127, 0.0508010238, 0.3223496675, -0.4228012562, -0.3215262592, -0.1421274245, -0.0708399117, -0.4146018922, 0.0688094199, 0.2725207508, -0.037271589, 0.1376818866, -0.2104519904, -0.094345443, -0.0698197037, 0.0858966857, -0.0970791504, -0.0578370169, -0.2149946988, 0.0483855195, 0.4175902605, -0.2034444511, 0.0756110698, -0.494094938, -0.0186774004, -0.0991519094, -0.371788919, -0.0662880838, -0.0382048078, -0.1302767098, 0.1177781895, 0.1654809415, 0.1567115486, 0.0172699727, 0.283965975, 0.1399288177, 0.1291771531, 0.1396843344, 0.2109782398, 0.06814605, 0.203574717, -0.1210987866, 0.0115744993, 0.0075939214, 0.1597274244, -0.0621646941, 0.3084389865, -0.1679115146, 0.2425522059, -0.0319235846, -0.0998063758, 0.2859274745, 0.2349764109, 0.0655606911, -0.2424152344, 0.3184431493, 0.0408471972, 0.1560939103, -0.0597214922, 0.3190595806, 0.1788873374, 0.0181818753, -0.3325875401, -0.1384910345, 0.0419949144, 0.1650953293, 0.1061084867, -0.1681781411, 0.2190974355, -0.1321574599, 0.1250537038, 0.0135272592, -0.034926001, -0.2764332891, 0.3223589957, 0.2634707391, 0.3512489796, -0.0020950586, -0.0024640844, -0.3695915937, -0.1427431256, 0.2944758534, -0.0911264941, -0.1671527922, -0.2289688587, 0.3325921595, -0.0890040547, 0.158902362, -0.3129993677, 0.1394111365, 0.3160460591, 0.0520768464, -0.1731430143, -0.1179572344, -0.1283721924, -0.5556749701, 0.377820909, 0.1488152444, -0.0492433384, 0.1413718611, -0.0439599343, -0.0754639879, 0.0834019035, 0.1271141469, 0.023508884, 0.0756957829, -0.3151823878, 0.4141363204, 0.3489591479, -0.0966067165, -0.3720921874, 0.1693567485, -0.0126690343, -0.0344885662, 0.0872749239, 0.1582108438, 0.2718800604, -0.0721342713, 0.2481266409, 0.2817782164, 0.0836536214, 0.0335968584, -0.3789060116, 0.1018802077, -0.0428094119, -0.1003162116, -0.2233699709, 0.2506660521, 0.0871279389, -0.1296690106, 0.3815089166, -0.2515322566, 0.2696839571, 0.4380357862, 0.2545848787, -0.2948098183, -0.1404699683, 0.125089094, -0.6262159944, 0.1282472759, 0.2535206676, -0.1669908166, 0.0085170344, -0.1840663701, -0.0659888089, 0.1249767244, -0.2429516017, 0.050855089, 0.2963761091, 0.2682267725, 0.1049841344, -0.0379340909, -0.1391396224, 0.1948613375, -0.0677435398, 0.008912839, -0.2562566996, 0.275426805, -0.166095078, -0.3440094888, 0.0040627718, 0.0395992622, 0.125523448, -0.0486762635, -0.0014972873, 0.5335174203, -0.1285198033, 0.0645718724, -0.0740873963, -0.0528818816, -0.0334747434, 0.0302069336, 0.0748109743, 0.0701767206, 0.1700238436, -0.0647118017, -0.3401036859, 0.3452370465, 0.1025318578, 0.2119354308, 0.2155985087, -0.0051220953, 0.1724713594, -0.1435658932, 0.0114302859, -0.2770321071, -0.09964744, 0.1160651296, 0.1534868479, -0.0418848842, -0.1850669533, 0.2772961855, 0.5342243314, 0.0047870204, 0.268475771, 0.1592025608, -0.3228471279, -0.22007972, -0.0512733459, 0.2949933708, 0.5205631256, 0.2487684786, 0.2373420298, -0.0739358589, -0.0226971209, -0.1503005922, 0.323952347, -0.0092432015, 0.1937919259, 0.4255511165, 0.0722198635, -0.1734609455, -0.2458447814, 0.2164746225, -0.0804642364, 0.0885644406, -0.2286977619, -0.1394912452, -0.1880013198, 0.1280586123, -0.1593551189, -0.1150401682, -0.1817214042, -0.5245652199, -0.132096827, 0.499386847, -0.1842717528, -0.0487548634, 0.1641301364, 0.0706617609, -0.0039135739, -0.1958076656, -0.075232029, 0.0643512756, -0.1250968874, 0.2130452096, -0.0566553473, -0.1815361977, 0.2067797929, -0.1099689081, 0.1588940918, -0.381065309, -0.0727514625, 0.0060044448, -0.1633946002, 0.0072642807, 0.0531137288, 0.2406403422, -0.0669143349, -0.2053181082, 0.157913655, 0.0342977569, -0.2009771764, 0.3223370314, 0.1404598206, -0.1537690312, -0.1958234161, -0.2867226899, -0.1278878152, -0.3667713702, 0.2408262193, 0.042530328, 0.1054978222, 0.0470769145, 0.3343978226, 0.0507684723, 0.1508998722, -0.1325421631, -0.2667571902, -0.4190297127, 0.5335763693, -0.3335798979, -0.4781664908, 0.2454315871, -0.0832559094, 0.0287267808, 0.0784362704, -0.4200792909, -0.0515727103, -0.0873605162, 0.0410648733, -0.0841629133, 0.2444753051, 0.2906349301, 0.1483314633, -0.1550349444, -0.1538980901, -0.2125994712, 0.2571293116, 0.11140389, 0.344255805, -0.1954374313, 0.1338011622, 0.1407624781, 0.1544995904, 0.1809570193, 0.10470815, 0.3695558906, 0.1015842631, 0.5001894832, -0.3050986826, -0.2166190743, -0.1263913959, -0.1631068289, -0.0570844077, 0.1586762667, 0.0147145726, 0.0458634943, -0.0112925097, -0.0382193737, -0.1091693714, -0.3177559078, 0.0651755631, 0.1224092245, 0.1376296133, -0.0586148575, -0.0128373951, 0.1147704273, 0.0393822119, -0.1008008569, 0.1192649305, 0.1517090201, -0.1176710576, -0.4989125133, -0.0271281134, -0.5107483268, 0.3123717904, -0.0537327565, 0.066575259, 0.1716882586, -0.3388545811, -0.1255562901, -0.1214795783, 0.5472688079, -0.1033600345, -0.1469319463, 0.264775157, -0.0213549361, -0.390055716, 0.0049924999, 0.1135870218, 0.0322966389, -0.0914122462, 0.4053321481, -0.2943362594, -0.0033264533, -0.0025433451, 0.5030465126, -0.2902573347, 0.0526019186, -0.3101167679, -0.1842462867, -0.5458338261, -0.2709187269, -0.1587413102, 0.2314000279, -0.1468464434, -0.1265230626, -0.1977180243, -0.5551074147, 0.1449789405, -0.1743404418, 0.5804969668, 0.0656959787, 0.354677856, -0.1276699752, 0.2457725406, 0.2979594469, 0.5010451078, -0.2553141117, -0.2001612782, 0.0832316577, -0.2154496312, 0.3007059693, 0.2000470161, -0.1495771706, -0.1918488443, -0.2488207072, 0.0843840986, -0.1546163261, 0.0426695235, 0.045974724, -0.1262765229, -0.3833068907, -0.0453319326, 0.3572865725, -0.1167089567, 0.1183476895, -0.0412219167, 0.0118027478, -0.3274761736, 0.4180618227, -0.0403689146, 0.7842452526, 0.21048823, 0.4815627038, 0.0452091396, -0.0732948333, 0.0327204168, 0.0996645316, 0.1373756677, -0.4184630513, -0.1445324719, 0.0372514874, -0.0154117271, 0.0415755324, 0.103491202, -0.4483250082, 0.1474432498, -0.3108687997, 0.0624462403, -0.2164749354, 0.1173089594, -0.183423683, -0.4166027308, -0.122185953, 0.2904288769, 0.275809586, -0.0950817987, 0.1101952419, -0.189283818, -0.2790109515, -0.0953040272, 0.0596400201, 0.284381628, -0.1293840855, 0.3061513007, -0.3621830344, -0.4505596757, -0.5449162722, 0.3328431845, 0.3889663219, 0.1015562564, -0.1239499152, -0.1875553578, 0.0174619928, 0.0126240514, -0.1784993708, -0.1696203351, 0.2127750218, -0.0724229068, 0.0666661412, 0.039962694, 0.0372539274, -0.1777830273, -0.0693107545, 0.0032457002, 0.0849569216, -0.2288416922, -0.2024766207, 0.1848589778, -0.2149603963, -0.3011004925, 0.2421293557, 0.1823653579, -0.2337660044, 0.2335451245, -0.2284678519, -0.0486504138, -0.0894214213, 0.4123315513, 0.3013586104, 0.0898724794, 0.3267379105, -0.1710888296, -0.0307905637, -0.2798594534, 0.265725255, -0.0210411493, -0.0508865528, 0.3845865726, -0.1155888736, 0.0356924087, -0.1603339016, 0.3472804129, -0.0324771553, 0.0431266725, -0.0502115041, -0.1576769501, -0.4056521356, -0.0964476615, 0.1587667912, 0.327634275, 0.0187356472, 0.0800637007, -0.0844473541, 0.1526058614, -0.4565461278, -0.0644525513, -0.0799506679, 0.0790912732, 0.1535953134, -0.0079386123, 0.2262555212, -0.1351849437, 0.2722095549, 0.1451885104, -0.0681957453, -0.4086964726, -0.0664042234, 0.0627454519, 0.0560971051, 0.090811871, -0.0868612677, -0.2218413949, -0.0972006917, -0.364107281, -0.0661831126, 0.0047876686, -0.078791678, -0.0098901391, 0.2135492861, 0.2411314547, 0.1394851357, -0.2031905502, -0.0645405278, 0.1836988628, -0.2426441461, 0.110142678, -0.2292162925, -0.205571115, -0.1175100952, -0.0215053149, -0.0502380021, 0.0065392377, 0.191669628, -0.1949599832, -0.3101609945, -0.2141376436, 0.4370494485, 0.1747402549, -0.2056212425, -0.0758354813, 0.0738586038, 0.3058640361, -0.1324887127, -0.3151202798, 0.1374551952, -0.1827313602, 0.0190910399, 0.1574221849, 0.1232966781, -0.05735448, -0.277420938, 0.1031671315, 0.1321495175, -0.0668756515, 0.0943441018, 0.3355686665, 0.0363538116, 0.4215301871, -0.0219185818, 0.1519079357, 0.2003867924, 0.4646334648, -0.20156461, 0.4510604441, 0.353126049, -0.2047065198, 0.0448160395, -0.2510583401, 0.3148809671, -0.0124377534, -0.1210379004, 0.2766671181, 0.0886273384, -0.0924842209, -0.1561161727, -0.2416663915, -0.1868080944, 0.2985249758, -0.1953544915, -0.1328550875, 0.1940385401, -0.0372731537, 0.0200108737, 0.0573374927, 0.0927768797, -0.3903914988, 0.2720746696, -0.0313365199, 0.2085286081, 0.0938593224, 0.1055418998, 0.0666660517, 0.0330839753, -0.1981871724, 0.0135863516, 0.1995749623, 0.0195503682, -0.0696282685, 0.121583961, 0.3711819053, 0.3659858406, 0.0907469988, 0.2423737943, 0.1431855857, -0.1749036908, -0.1607588679, -0.0036749132, -0.0122543983, 0.0423726849, 0.4947177768, 0.276106149, -0.2584261894, 0.1484414637, 0.2257324159, 0.0316297188, -0.2331470698, 0.1536015421, 0.0357050262, -0.410210073, -0.0663209409, -0.0989833772, -0.2807657123, -0.2876636982, 0.4731296897, -0.100541763, 0.1434699446, -0.1104005575, 0.1654276401, 0.0616374984, 0.4518495798, -0.0697257519, -0.044648014, -0.3877369761, -0.2134349644, -0.4200603068, 0.0223823003, 0.127705127, 0.2152196616, -0.2014204562, 0.4583126903, 0.0815736949, 0.1868250519, -0.1017852798, -0.0872713923, -0.0183254071, 0.3318607211, -0.205137983, -0.109273009, 0.07714881, 0.131472528, 0.1458147466, -0.4644192755, 0.308588177, -0.010423962, 0.2647196651, 0.028481625, 0.242205441, 0.1414974779, 0.1359397471, 0.3980332911, 0.1207733378, 0.1030344516, -0.3297483325, -0.2140921354, 0.1160086021, 0.0324002355, -0.0965126976, -0.0115342028, 0.1447605789, 0.3581965268, -0.2636269927, 0.1054231301, -0.0446594991, -0.0452229865, 0.3222956359, 0.133964926, -0.08967603, 0.2718455791, 0.182246536, 0.1133407503, 0.1858024895, 0.255870223, -0.176145196, 0.2921953201, -0.2606454492, -0.4027802944, 0.3502842188, -0.040687792, -0.2211071253, -0.0238404684, 0.2712757885, 0.1372815967, 0.1239910126, -0.5584982634, -0.0826583803, 0.3341215849, -0.1519653201, -0.3571299016, 0.3537926972, -0.1059932411, -0.0057552978, 0.0049680769, 0.333381325, 0.1975368857, -0.4678477049, -0.0325015895, -0.4594185352 ]
https://github.com/huggingface/datasets/issues/2188
Duplicate data in Timit dataset
Hi ! Thanks for reporting If I recall correctly this has been recently fixed #1995 Can you try to upgrade your local version of `datasets` ? ``` pip install --upgrade datasets ```
I ran a simple code to list all texts in Timit dataset and the texts were all the same. Is this dataset corrupted? **Code:** timit = load_dataset("timit_asr") print(*timit['train']['text'], sep='\n') **Result:** Would such an act of refusal be useful? Would such an act of refusal be useful? Would such an act of refusal be useful? Would such an act of refusal be useful? ... ... Would such an act of refusal be useful?
32
Duplicate data in Timit dataset I ran a simple code to list all texts in Timit dataset and the texts were all the same. Is this dataset corrupted? **Code:** timit = load_dataset("timit_asr") print(*timit['train']['text'], sep='\n') **Result:** Would such an act of refusal be useful? Would such an act of refusal be useful? Would such an act of refusal be useful? Would such an act of refusal be useful? ... ... Would such an act of refusal be useful? Hi ! Thanks for reporting If I recall correctly this has been recently fixed #1995 Can you try to upgrade your local version of `datasets` ? ``` pip install --upgrade datasets ```
[ -0.0085599497, -0.3116275072, -0.0845908821, 0.640843153, 0.297283411, 0.1798604429, 0.212722376, 0.3483657837, -0.3550943434, 0.0640652329, -0.1848576069, 0.36077407, -0.0370688885, 0.1377496123, 0.151465714, 0.1737730503, -0.0231210105, -0.0077552423, -0.2896778882, -0.2847211361, -0.0019157529, 0.1685193479, -0.0928685367, 0.061681293, -0.0929965079, 0.2439680845, -0.1059633791, -0.1654436737, -0.0110924784, -0.2916883528, 0.0391285643, 0.1391635388, -0.1956938207, 0.4862782359, -0.0001211682, 0.1176713854, 0.1419563293, 0.0384409949, -0.2202286124, -0.2915330529, -0.1174841672, -0.1514539868, 0.2768202722, -0.0930141509, -0.1665944159, 0.0084070042, 0.0813453197, -0.151522696, 0.3422286212, 0.1550573409, 0.1326091886, 0.1251024604, -0.0319639668, 0.1261971295, 0.2245518416, 0.1391941607, 0.0429698452, 0.1158418134, 0.3519426584, 0.3654198945, 0.4090770483, 0.161784932, -0.2078802586, 0.2010412514, -0.3571013212, 0.060709089, 0.0050466396, -0.1050856486, -0.0295723788, 0.3857051134, 0.818193078, -0.3492590487, -0.1290717125, 0.0266013443, -0.0413214453, -0.1824614704, 0.1129801422, 0.1279144138, -0.2183217555, 0.1619397104, -0.1877854913, 0.1523908973, 0.0413464904, 0.1306083947, 0.0817199349, -0.3430477381, -0.0316620693, 0.0668797642, -0.0958120823, 0.0588129535, 0.1280868351, -0.1315312386, -0.0388977267, -0.053078156, -0.0954162329, -0.0338916332, -0.5064445138, -0.1193035394, 0.172377795, 0.2862871587, 0.471080035, 0.0988896787, -0.2946041226, -0.0915641263, 0.4752918482, -0.0670489818, -0.1020938084, -0.0530314744, -0.138814643, -0.2779711187, -0.3967974484, -0.0261988137, 0.0038939714, 0.0036779046, 0.2771375775, -0.0767456517, 0.3120040596, -0.2282846272, -0.5888943076, -0.0935212821, -0.4488689601, -0.0916471779, -0.1306609213, -0.1027452648, 0.0775112808, 0.087441802, 0.0335714594, 0.0318370275, -0.2102266103, -0.1265278012, -0.1079946011, -0.3061451018, -0.0174627751, -0.0777558684, -0.0092896298, -0.3747309744, 0.1959091425, 0.2917188704, -0.0306808725, -0.2282078117, 0.009642221, -0.1862990409, -0.0141306967, 0.0944493487, 0.0140464678, 0.3920695484, 0.207887724, -0.0813202709, 0.0554699749, 0.2834262848, -0.2466737777, -0.109855108, 0.1137663871, 0.1410533637, -0.076658234, -0.1108225212, -0.1702797115, 0.102833204, 0.240324378, -0.1323532164, 0.0363373123, 0.0477540977, -0.218952626, -0.061044991, -0.1871497929, 0.3434598744, -0.5317341685, 0.0615802109, -0.0243836064, 0.0334305875, 0.0333391912, 0.3163553476, -0.1876565218, 0.3697363734, -0.2389820069, -0.1521956921, 0.1076036543, -0.2316113263, -0.3582295775, 0.0533434302, -0.0566045567, -0.0179931223, 0.0473610461, 0.2656923532, 0.1468072832, 0.0304089785, 0.0650878772, -0.256775707, 0.2930333614, -0.3015695512, -0.4290742278, -0.0626869202, 0.4001123309, -0.0568456277, -0.247936815, 0.0383782461, 0.0734915361, 0.0613335557, 0.3726985455, 0.2081892788, -0.1574119329, 0.2859970331, 0.2329321504, 0.3830019832, 0.2396136522, -0.1696215421, 0.2872487009, -0.0753624439, 0.1877301484, 0.214306742, 0.2333485782, -0.2413324118, -0.1373889148, -0.0262935273, -0.3445991874, 0.1045033634, 0.1936206222, 0.2245903909, -0.3319901526, 0.1008642018, -0.0979617685, 0.6168999672, -0.377968967, 0.0188991427, -0.1586880684, 0.1941650957, -0.1101719737, 0.1503382325, 0.0451616198, 0.0427665338, 0.0110734515, 0.0053408369, -0.1109581441, 0.1506654024, 0.1766406596, -0.1716471761, -0.2193172574, -0.3255206048, 0.2579404116, -0.5105293989, -0.2207474262, 0.5468989015, 0.2125024199, -0.115846388, -0.0344050713, -0.0573116541, -0.2229576409, -0.0068442151, -0.0107686296, 0.1831533015, 0.0709392726, -0.1089937091, 0.011386998, -0.2626823783, 0.3656529188, 0.1338627487, 0.1802451313, 0.32771945, -0.0700459555, 0.1865560114, 0.0942413956, -0.063716352, 0.0107963299, 0.0091217663, -0.0198523439, 0.3328454494, -0.1506565362, 0.1400277615, 0.2939412594, 0.1768114418, -0.0199786834, 0.1302333623, 0.0299673341, -0.0383364633, 0.2424829453, 0.1791710258, -0.1587688029, 0.2704190612, -0.0308716036, -0.0532162488, -0.5526505113, 0.2271170467, 0.2784296572, 0.340826422, -0.2932353616, -0.0568937026, -0.3629150987, -0.1330238432, -0.540828824, -0.03716328, -0.2454099357, -0.1514033228, 0.0793839097, 0.0795685127, 0.2793282866, 0.1364264339, -0.0461638495, -0.1637199968, -0.0556846559, 0.0606986508, -0.1150860935, 0.0971707404, -0.3198131323, 0.0955678225, 0.225795567, 0.1798106879, 0.23895441, -0.3659197092, 0.0553943366, -0.3434201479, -0.3129028678, 0.1037420109, -0.1895084828, 0.3461566865, 0.1730520278, 0.1027155221, -0.30565539, -0.2064389139, 0.0690838471, -0.11152713, -0.3633110821, 0.0304777473, 0.0058880001, -0.1495911628, -0.0017718077, -0.6204968691, -0.2918466628, 0.0623337179, 0.3842014968, 0.0756759942, 0.1663365364, 0.3559522033, -0.0517881103, -0.0216832999, 0.2291809916, 0.2381193042, -0.5113921762, -0.2132325619, -0.0249324851, 0.1379187107, -0.210608229, -0.1239940524, 0.0099257156, 0.1093063653, 0.0942357332, -0.5886982083, 0.0314732939, -0.013494065, -0.1855831891, 0.0318211727, -0.0464713499, 0.2385503054, 0.0799127966, -0.0116051324, -0.077203922, 0.0090624094, 0.0986082703, -0.1817128062, 0.309361428, 0.0258249342, 0.1898768693, 0.0985340625, 0.2369147688, 0.6378481388, 0.0301539041, 0.2011719346, -0.2357313037, 0.4956575334, -0.032033246, -0.4854996204, -0.2749165893, -0.1550839543, -0.237665236, 0.2133060694, -0.0062685739, 0.179237619, 0.0842149854, 0.1413422227, -0.4024022222, -0.1958310008, -0.209246546, -0.2632048726, 0.1199407727, 0.1868513972, -0.1118003428, 0.1284532547, -0.391972065, -0.1281606406, 0.2763440013, -0.2326480448, -0.0987098813, -0.517731607, -0.3856751025, -0.1572250277, 0.2232969254, 0.3914357722, 0.387185514, 0.012934953, 0.1227086484, 0.3271725774, 0.0899289772, 0.6433967352, -0.4577268064, -0.2255817503, 0.2776935101, 0.1923348904, -0.3458143771, 0.0036675408, -0.2985075712, 0.1101405472, 0.1936445236, 0.0200165082, -0.1690910459, -0.0577792749, 0.2804931998, 0.3153573871, -0.3922638893, -0.0374701172, -0.2901180089, -0.3878028989, -0.0596349277, -0.2520769536, 0.0017681122, 0.0339681022, -0.2614022493, 0.080812037, -0.1597421467, 0.2822009027, 0.4743408561, -0.2297736704, 0.5287470222, 0.0183323286, 0.3186362982, 0.0383572876, -0.0256385319, 0.0346136317, 0.7942622304, -0.1817186028, -0.0518700816, -0.2749041021, -0.5175098777, 0.3264540434, 0.2323885262, 0.1002615988, 0.2010605335, -0.3210876882, -0.2144901454, 0.0877311975, 0.022680182, 0.4050425291, 0.0403071865, -0.3864822686, -0.5881888866, 0.1536231041, 0.2283317149, -0.2125817537, 0.4853881001, -0.2419729084, -0.1396205276, 0.2389876693, 0.0198103525, 1.0326573849, -0.3713346422, 0.2594498396, -0.0434151031, 0.1413665414, 0.1241544932, -0.2882463336, -0.0225446112, -0.2724563479, -0.2003296018, -0.1822968125, -0.0019374415, -0.1124418676, 0.3325404227, -0.265935272, 0.1491216719, 0.0046444088, 0.4775801003, -0.0332909748, -0.0351791233, -0.0386379249, 0.2886988521, 0.162772581, 0.1069133282, -0.1234180182, 0.1513619125, 0.1287587285, -0.029884778, 0.1740524471, -0.2242055982, -0.6097683907, -0.2163856924, -0.2782772779, 0.2034092695, -0.160603866, -0.5160948038, -0.082931228, 0.2894198, 0.4077768624, 0.2702652812, -0.132321164, -0.0527479574, 0.3445215225, 0.1857605577, -0.1239496246, -0.0439123511, 0.0764126778, 0.1406892836, -0.2715591192, 0.0058443397, 0.3306662738, -0.3195131421, -0.4827296734, 0.2105577588, -0.0424487814, -0.5394482017, 0.2258799672, 0.3129873872, -0.1576697528, -0.2404384017, 0.0607079491, -0.1167861968, -0.1838815659, 0.2974875867, 0.0382165797, -0.3845881522, -0.0466836207, 0.3951344192, 0.6507580876, -0.0362950116, 0.5934002995, -0.0796875581, 0.0325685665, -0.2607861757, 0.2576849461, -0.078507565, -0.4097453654, 0.0536511876, -0.2556091249, 0.4455701709, 0.1403001547, 0.2326065749, 0.0997585431, 0.1492036879, -0.2308319658, -0.2159943283, -0.2349490225, 0.1496259868, 0.3456685245, 0.4682069719, -0.0830981582, 0.1155192405, 0.0606955215, -0.1624242812, -0.2127871215, 0.4024807513, 0.0188987181, 0.2500679493, -0.1053190455, -0.0827531815, 0.1098579988, -0.013324365, 0.0944069847, 0.1693226248, 0.0219435357, -0.143661052, -0.1135648936, 0.1853684187, -0.0106777083, -0.03867599, -0.4134533703, -0.2445090562, 0.2411624044, 0.0747656375, -0.1334320009, 0.366666317, 0.188875705, 0.1262805611, 0.0740832761, -0.0769253895, -0.0899792463, -0.1799810231, -0.1865111291, 0.2855625153, 0.326489836, -0.0304243267, 0.1567706764, 0.0246070325, -0.3166653812, 0.0635846257, 0.2275948673, -0.0632549375, 0.0260903239, -0.5054306984, 0.120867908, 0.1265207529, 0.4913755655, 0.4850873351, -0.2948517501, -0.0272346549, 0.0519158915, 0.1407961845, -0.2662791908, -0.150993228, 0.0380293019, 0.0394999795, -0.0849536434, 0.2165423632, 0.2520014644, -0.3805683553, 0.3474822342, -0.0954947174, 0.3520765007, -0.3051478267, 0.174756676, 0.4739431739, 0.2302882075, -0.2237280309, -0.0315307155, 0.1291672289, -0.0878964365, 0.5185220242, -0.0401067659, 0.137722373, -0.3086026609, -0.0972522795, 0.1541340351, 0.0535964519, 0.1003672332, 0.2339374125, -0.2164603919, 0.2790321112, 0.2260108888, 0.4698839486, 0.0167088136, -0.1919237524, -0.3830071092, -0.1604187638, -0.2408694923, 0.0084328018, -0.1273943186, -0.0666011199, -0.0035142526, 0.0644066334, -0.006433622, -0.1346311271, 0.2504634559, 0.2350129485, -0.0574407578, -0.7289215922, -0.1670001745, 0.2327001095, -0.0303838998, -0.21896182, 0.2196620256, 0.2771151066, 0.0529667735, 0.1772488505, 0.5775404572, 0.3732340336, 0.0633330941, 0.0164404958, 0.0206760094, -0.4486540258, -0.0110616274, -0.0365726873, 0.4057452679, -0.0987176597, -0.0670997053, 0.14466919, 0.0500504859, 0.0595598109, 0.1273133159, 0.2412571013, 0.0006833896, -0.5757219195, 0.3191532791, -0.0570680574, -0.0943148509, -0.1890246868, -0.0539692305, -0.4186166525, 0.1573537588, 0.7430902123, 0.1384952962, 0.1193904728, -0.0645653605, 0.0558847338, -0.046530582, 0.1426377296, 0.2912021279, 0.0155900586, -0.2468739897, -0.0864060223, -0.6696782708, 0.2713160515, -0.4794603884, 0.2054277062, 0.0925011933, -0.0102431066, 0.0602670312, 0.4230236411, 0.2584810853, 0.0538327359, -0.6601253748, 0.2825872302, -0.4204733372, -0.3259839714, 0.1669092923, 0.0943423733, -0.088654466, -0.1949441433, 0.1824273914, -0.1806589663, -0.0176794827, -0.2466898412, -0.0139554217, 0.0855449289, 0.3546451628, -0.083190836, 0.0379626974, 0.3189561069, 0.1843018234, -0.048669368, -0.0238227472, -0.4219787419, -0.1447992325, 0.6116065979, 0.1478208601, -0.1353458762, -0.1828471869, -0.1231043041, 0.0834422261, -0.009193629, 0.2873488069, 0.1239849329, -0.2562182546, -0.2145984024, -0.1380328536, 0.1892762482, 0.0116369203, 0.606058836, 0.2208258808, 0.3174075186, -0.1575764716, -0.544634223, 0.4519620538, -0.564443171, -0.2094042003, -0.0854327157, 0.0419428237, 0.1815063655, 0.1017207354, -0.5763422251, -0.116833359, 0.6631141901, -0.0973283798, -0.0683498606, 0.3364091516, 0.1263566464, 0.0116316155, -0.0046614408, 0.5800076723, 0.1627822816, -0.2072147131, 0.4560904503, -0.2182008028 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
An educated guess: does this refer to the fact that depending on the custom column names in the dataset files (csv in this case), there is a dataset loader being created? and this dataset loader - using the "custom data configuration" is used among all jobs running using this particular csv files? (thinking out loud here...) If this is the case, it may be ok for my use case (have to think about it more), still a bit surprising given that datasets caching is disabled (or so I hope) by the lines I pasted above.
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
95
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! An educated guess: does this refer to the fact that depending on the custom column names in the dataset files (csv in this case), there is a dataset loader being created? and this dataset loader - using the "custom data configuration" is used among all jobs running using this particular csv files? (thinking out loud here...) If this is the case, it may be ok for my use case (have to think about it more), still a bit surprising given that datasets caching is disabled (or so I hope) by the lines I pasted above.
[ -0.0747400373, 0.0329242945, -0.111252293, 0.1840388775, 0.2081030756, 0.1995861828, 0.3412375748, 0.0353644118, 0.3006590009, -0.1421152949, 0.1708118916, 0.0910152197, -0.2320550978, 0.0387958512, -0.0910930559, 0.4722391963, 0.086592257, 0.0711619258, -0.1339131296, 0.0554631352, -0.0745022446, -0.0144610256, -0.1561082304, 0.0823810399, -0.4832641184, -0.0868271589, 0.1125855446, -0.0244325027, 0.0212619528, -0.5053262711, 0.4776334465, 0.2666886747, 0.1665527523, 0.335103333, -0.0001139642, 0.0305279195, 0.1711916029, -0.0332141481, -0.2615793347, -0.0518320352, -0.5447486639, -0.456543237, 0.222207427, -0.1231802404, 0.003904283, -0.0361419395, 0.0507736579, -0.6826251149, 0.411722362, 0.2966953516, 0.2381751239, -0.1285125017, -0.4286360443, 0.0785945654, 0.011744773, 0.1088230759, -0.0908936933, -0.0873221159, 0.1938948929, -0.1112781242, -0.0507549904, 0.3164400458, -0.0971550941, 0.3233139813, 0.5042589903, 0.0171202831, -0.2412166893, -0.2511729002, 0.3183852136, 0.0218119211, 0.9332620502, -0.3090762794, -0.1231777892, -0.4111326635, -0.0318884104, -0.2988234758, 0.2127164602, -0.0283944719, 0.0482815281, 0.1094918847, -0.4467255175, -0.2396514714, -0.083724238, -0.2604037523, -0.2173207402, -0.1060875207, -0.3423904777, 0.1185137033, -0.0954379141, -0.07735309, 0.4783640504, -0.4291203022, 0.0521483272, 0.1758250147, -0.4903403223, -0.0390844867, 0.122455515, 0.3279426694, -0.1147696078, 0.1350920498, 0.1050543189, 0.0122761223, -0.0907438248, 0.0799774006, 0.4582877457, 0.2901145816, 0.0588693805, 0.1618070155, 0.1719785482, -0.1607417166, -0.2411602736, -0.1606789529, 0.106860511, -0.4139524698, 0.5185582638, 0.0468938835, 0.1974547803, -0.2680057883, -0.3001048565, 0.1110603586, 0.0948531926, -0.1812061965, 0.0791824758, 0.1522897631, 0.0211146474, 0.0074775591, -0.1893984228, 0.0162826665, -0.180498004, -0.1794099212, -0.1986327171, -0.1786898226, -0.2716118395, 0.0370227396, 0.1595566273, -0.1190401092, 0.0555739403, 0.3713515401, 0.1261795312, -0.2491984069, 0.1370882541, -0.008804556, 0.1465435028, 0.2985466421, -0.2595076263, 0.2414861321, 0.3928400278, -0.0316358283, -0.2273064852, 0.2966908514, -0.440854162, -0.5244541168, 0.083808735, 0.1510600597, -0.5156724453, -0.1743029356, -0.1659301519, -0.0480840988, 0.4366084635, 0.0913138986, 0.1581714749, -0.2211634815, -0.1835801601, -0.2487583458, -0.0916243196, 0.4071260095, -0.6090787649, 0.0580474287, -0.2302495837, -0.0686955303, 0.1020542085, 0.2040497512, -0.4850607812, 0.1768306792, -0.1797081977, -0.203573823, 0.0928329974, -0.1709413528, -0.2905776799, 0.2443111986, 0.1496292055, 0.4461428523, 0.1504228413, 0.0730722919, 0.0984585434, 0.0018103719, -0.0209938511, -0.0479279421, 0.1157691106, -0.1945615709, -0.0544960573, -0.2685347199, 0.2093881965, -0.118430987, 0.0805208385, 0.1271192133, -0.0038219281, -0.1973341405, 0.0553923696, -0.0919836909, 0.0335474387, 0.2680847645, -0.0206704382, 0.2839363813, 0.1013466567, 0.1371284723, -0.5190860033, 0.3768138587, 0.1972186565, -0.3630035818, -0.1326481849, -0.2342200577, -0.1636396646, -0.0399622172, -0.4563780427, -0.1838128865, 0.0451878123, 0.0128973536, -0.0490490943, -0.1572535336, -0.2302175909, 0.4298688471, -0.3645771742, -0.1283551008, -0.1698279083, 0.1035880893, 0.0485138744, 0.3051688075, -0.2094288468, 0.1295064986, 0.101369001, 0.1196151823, 0.0973197073, 0.1836391389, 0.1609490663, 0.4847692549, 0.0469980128, 0.3916103244, -0.0876894519, 0.0587858111, 0.3191917241, -0.0920874923, 0.1048940122, -0.1198228747, -0.1035621613, 0.4611104727, -0.1929129809, 0.2234093696, -0.2311306149, -0.2143967599, 0.1486460268, -0.0641656071, -0.0321686193, -0.1272866726, -0.0385256633, 0.0578001961, 0.0152755529, 0.3464540243, -0.3043401539, 0.1205621958, 0.2261322588, 0.0875349641, -0.044164151, -0.0178381577, -0.0513337776, -0.231588304, 0.1401086152, 0.4445004761, 0.5561183691, 0.077859208, 0.0189791843, 0.051058948, 0.0876902193, -0.166107744, 0.2612456977, -0.1427205205, 0.0464981459, 0.139462769, 0.0001478083, -0.1083628684, -0.2499702871, 0.0795988441, 0.1397582889, 0.1755785793, -0.5349952579, 0.24275738, -0.4415971339, -0.1433643848, -0.3243466616, 0.1396017522, -0.2296129465, -0.3920865655, -0.0558284521, 0.065404132, 0.1098910868, 0.0578590482, -0.2731127143, 0.4056162238, -0.1743050218, -0.0612870976, -0.0675237849, -0.1625194103, -0.1320426017, 0.0824303925, 0.1212185025, -0.1581971198, 0.2031899095, 0.0007401034, 0.0459610596, -0.2996456325, 0.1214199811, -0.0514580049, 0.0274216607, 0.2571715415, -0.0936724246, 0.0155689176, -0.0305418745, -0.0444959439, -0.06955228, 0.1485840678, 0.1438076645, -0.1593754888, -0.0334502906, 0.0861433893, 0.0265934393, -0.1934437752, -0.3771930039, -0.1723974347, -0.1766426861, 0.0177745596, -0.0237495489, 0.43630898, -0.0280570611, -0.0785347968, 0.1182725355, 0.0119341053, -0.5252435207, -0.5456596017, 0.2012656033, -0.0793225318, 0.0201250166, 0.1922748387, 0.1350901425, 0.3536136448, 0.0110694803, -0.6578816175, 0.0101154521, -0.1363930404, 0.0864207745, 0.121157527, -0.0074002855, 0.193414554, 0.0741373301, -0.0120978653, -0.1191141233, -0.1167678237, -0.1516045779, -0.1109014004, 0.3235321343, 0.1593184173, -0.0324484706, 0.0367515683, 0.9366266727, 0.3841565549, -0.1214681417, 0.1396237612, -0.1088362113, 0.6221186519, 0.0644048676, -0.2527453005, -0.1152314842, -0.2590204179, -0.3898259401, 0.0313540623, -0.0384905711, 0.0496641845, 0.1796965599, 0.3303647637, -0.0514570214, -0.2739365995, 0.2169682384, -0.4276329875, 0.3161677122, 0.1154601574, -0.1289366037, -0.2765467167, -0.0896551907, -0.323395431, 0.2079395503, 0.2542685866, -0.091225639, -0.1865714788, -0.1520026922, -0.2801686525, 0.239947021, -0.1212938577, 0.1672361344, -0.1665851474, 0.1557671726, 0.2747403979, 0.2953507304, 0.398981601, -0.5094987154, -0.0547713153, 0.247361809, -0.0301234573, -0.0246778615, -0.2044208199, 0.1053707898, 0.3304399848, -0.0029189605, 0.1057165414, 0.2741366029, -0.1856382936, -0.1463252902, 0.1368196309, -0.2211833894, -0.2176625282, -0.2295270413, -0.0647611469, -0.1236505434, -0.0071741492, -0.0346281528, -0.1003784537, -0.2729245424, 0.1329511255, -0.1421343237, 0.1635397971, 0.2158614546, 0.0707105175, 0.1651083976, 0.165827781, 0.0806577653, 0.3721834421, -0.0893876031, 0.3206748068, 0.5537675619, -0.1596211493, -0.1702967882, -0.0921292305, 0.0285202153, 0.223918438, 0.2774194181, -0.318615675, 0.2311957628, 0.0150813572, -0.1968952417, -0.4145431221, -0.2475343645, 0.3081843853, 0.2830772698, -0.2407494187, -0.6778432131, 0.4185900986, 0.2034242749, -0.2414292842, 0.0114897825, -0.1155929863, -0.3438018262, -0.082600832, 0.031149894, 0.6868379116, 0.0536784083, 0.151192978, -0.0873329341, -0.0505862385, 0.462456286, -0.229581818, 0.2173594832, -0.1653167158, -0.0813857317, -0.1341671348, -0.1254744381, 0.394257009, 0.1997702569, -0.0706664249, 0.3692272604, -0.3337558806, 0.4619780481, -0.1979234815, -0.0477024615, -0.1497227848, 0.0053803474, 0.0632496849, 0.1764404178, -0.0409988314, 0.3782216907, -0.1098468304, 0.2351154685, 0.2955279052, 0.1585524678, -0.3830780387, -0.2306853235, 0.0952183381, 0.258957088, -0.1065817773, -0.3580362201, 0.4108009338, 0.3930881321, 0.2602232695, -0.0794411302, -0.124039799, 0.2739797533, 0.2207243145, 0.2264374346, -0.1794320047, -0.0342839807, 0.2966906428, 0.1402219236, -0.3095149398, 0.1744706631, -0.0203973912, -0.2564278245, -0.0291425735, 0.4295301437, 0.0357083194, -0.6212304831, -0.193751052, 0.2860854268, 0.2380785942, 0.1409772187, 0.1657325029, 0.0975856185, 0.1726159006, 0.5359578729, -0.4709512591, -0.352612555, -0.0289778858, 0.21719262, 0.5373674035, -0.1034855098, 0.4559841156, -0.2134128064, -0.2968733311, -0.2070980668, 0.0560982674, 0.1261420399, -0.0860367715, 0.0951051936, 0.1212828159, 0.3870357275, 0.12584503, 0.0527884364, 0.0906801522, 0.0326523036, -0.1889146119, -0.1910331845, -0.0908902213, -0.0370000191, -0.0190093722, 0.4248799682, -0.1085395962, -0.1448486447, 0.0165488049, 0.0053798873, -0.2818008661, 0.205234766, -0.1517514288, 0.1312708855, 0.1264011264, 0.0177500602, 0.1077293679, -0.2185232341, -0.0413201861, -0.1166727394, -0.3801878393, -0.1926356703, 0.0644762367, 0.1426877379, -0.0326854363, -0.1700799763, 0.0117399096, -0.2476837784, 0.0291255713, -0.1259067655, 0.2186975628, 0.3635790348, 0.0053541679, 0.2291687131, -0.2157219946, -0.1443710625, -0.0980214998, -0.0127814393, 0.022647433, 0.4086838961, 0.3274836838, 0.3122506142, -0.1127822101, 0.1433490515, -0.2429712713, 0.2534458339, 0.0494389609, 0.1417553723, 0.137819767, -0.3263119161, 0.1708706915, 0.2178663015, 0.3389469385, 0.2562047541, -0.3132694364, -0.1951805651, 0.1058208868, 0.1471500993, -0.145052582, -0.1846277714, 0.1522570252, 0.1968635768, -0.1703168154, 0.2726593614, 0.5628313422, -0.0311791152, 0.480133146, -0.0712575167, 0.6081092358, -0.4641143084, 0.4534160197, 0.1287997067, 0.0151932985, -0.1285955757, 0.4395715892, 0.5133953691, 0.0374928005, 0.5916282535, 0.0516393296, 0.1914885789, 0.4715461135, 0.1481669545, -0.3705315888, -0.8666632771, 0.4774240851, 0.4776123166, -0.5016359091, 0.1033875346, 0.043157056, 0.0473800488, -0.1856461912, 0.2252574265, -0.1247980148, 0.1617404521, -0.2156003565, -0.150563553, 0.4182734787, -0.2759997547, 0.1143251508, 0.1305048466, -0.0543568656, -0.0419629999, 0.1496676207, -0.2406262159, -0.1486192197, -0.3659243286, 0.4533606768, -0.0087455055, 0.3205533624, -0.1618721485, 0.1212195605, -0.0863691866, 0.1227122843, 0.3090470135, 0.3091038465, 0.5185564756, 0.1061776876, 0.2864176333, 0.0258775875, -0.0574804768, 0.0429523885, -0.2093007863, 0.2197228074, -0.19782947, -0.0892028362, 0.1855272353, 0.1404806972, 0.0371158831, 0.1310310066, 0.1015049815, 0.2059727609, -0.4896323681, -0.1068910584, 0.1763572842, 0.0596952885, -0.0119098872, 0.2690346539, -0.2661560178, -0.2663977742, 0.7305529118, 0.0587831438, 0.3269720376, -0.12900877, 0.0735100508, -0.1336001009, 0.3655236363, 0.1005996391, 0.0710481927, -0.2286348343, -0.0154604912, -0.6817542315, -0.0881664678, -0.3139606714, 0.1447672546, 0.1171004921, 0.1118542477, -0.1319796145, -0.0138000585, 0.0433720835, -0.2220948339, -0.1332454681, -0.1272137612, -0.0476982817, -0.1649050266, -0.0732102096, -0.0108077601, -0.1269412786, -0.2174555659, 0.1390994638, -0.0047839209, 0.0037281737, -0.1258689761, 0.0488715619, 0.1192155778, 0.0717006326, 0.4264054298, 0.0970844999, 0.3955484927, 0.3030188084, 0.1015699059, -0.2562289834, -0.2654804289, -0.1641041636, 0.2406626344, 0.1155834943, -0.139557451, -0.542991817, 0.1047069281, -0.2227845788, 0.0548641905, -0.0120230541, -0.1266848743, 0.064317584, -0.1498857439, -0.0647277981, 0.2170042098, -0.0487024337, 0.2689603269, 0.0162310172, 0.3161890805, -0.2850947082, -0.0212374665, 0.3094379008, -0.1760538369, -0.2819664776, -0.0532598346, 0.1987364292, -0.0369923972, -0.1815894395, -0.5344365835, 0.0498644561, 0.5088614821, -0.2833266854, -0.0162014142, 0.0728505701, 0.0203093067, 0.0472291559, -0.0840393826, 0.2260666043, -0.0358379558, -0.0223102868, 0.0305847898, -0.3441295624 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
Hi ! Currently disabling the caching means that all the dataset transform like `map`, `filter` etc. ignore the cache: it doesn't write nor read processed cache files. However `load_dataset` reuses datasets that have already been prepared: it does reload prepared dataset files. Indeed from the documentation: > datasets.set_caching_enabled(boolean: bool) > When applying transforms on a dataset, the data are stored in cache files. The caching mechanism allows to reload an existing cache file if it’s already been computed. > Reloading a dataset is possible since the cache files are named using the dataset fingerprint, which is updated after each transform. > If disabled, the library will no longer reload cached datasets files when applying transforms to the datasets. More precisely, if the caching is disabled: > - cache files are always recreated > - cache files are written to a temporary directory that is deleted when session closes > - cache files are named using a random hash instead of the dataset fingerprint - use datasets.Dataset.save_to_disk() to save a transformed dataset or it will be deleted when session closes > - caching doesn’t affect datasets.load_dataset(). If you want to regenerate a dataset from scratch you should use the download_mode parameter in datasets.load_dataset().
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
202
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! Hi ! Currently disabling the caching means that all the dataset transform like `map`, `filter` etc. ignore the cache: it doesn't write nor read processed cache files. However `load_dataset` reuses datasets that have already been prepared: it does reload prepared dataset files. Indeed from the documentation: > datasets.set_caching_enabled(boolean: bool) > When applying transforms on a dataset, the data are stored in cache files. The caching mechanism allows to reload an existing cache file if it’s already been computed. > Reloading a dataset is possible since the cache files are named using the dataset fingerprint, which is updated after each transform. > If disabled, the library will no longer reload cached datasets files when applying transforms to the datasets. More precisely, if the caching is disabled: > - cache files are always recreated > - cache files are written to a temporary directory that is deleted when session closes > - cache files are named using a random hash instead of the dataset fingerprint - use datasets.Dataset.save_to_disk() to save a transformed dataset or it will be deleted when session closes > - caching doesn’t affect datasets.load_dataset(). If you want to regenerate a dataset from scratch you should use the download_mode parameter in datasets.load_dataset().
[ -0.0997080207, 0.0613424331, -0.0944523066, 0.1375738233, 0.2868356109, 0.156939283, 0.2946324348, 0.0576287135, 0.2189562768, -0.2274290174, 0.0563382655, 0.189158529, -0.1538448334, -0.1349177659, -0.015559949, 0.4577814937, 0.1715124249, 0.059994854, -0.1155786663, 0.0047332719, -0.0356273912, -0.0026575886, -0.2127189934, 0.0402782448, -0.4570405483, -0.1324047893, 0.1229299083, -0.07164976, -0.013050124, -0.553674221, 0.4886826575, 0.3283199668, 0.0741477013, 0.2518530488, -0.0001118015, 0.0728000402, 0.2476904243, -0.0178316496, -0.2822509706, -0.0032012314, -0.5275136828, -0.3997312188, 0.207716912, -0.1217703819, 0.0088245273, -0.2282436192, 0.0214826036, -0.7317455411, 0.398660779, 0.2624377906, 0.2537709475, -0.1417695284, -0.3225732744, 0.0698816553, 0.0294987597, 0.1056571007, -0.0790081397, -0.1197101399, 0.1755230576, 0.0011509508, -0.1297953427, 0.3401146531, -0.1820654869, 0.2184823155, 0.5376934409, -0.0251182113, -0.3009693325, -0.3138096929, 0.3533350825, -0.0475771949, 0.8824433088, -0.3004615307, -0.2132220268, -0.3719500899, -0.1303939521, -0.1072219238, 0.2515769601, -0.0626550466, 0.1068926007, 0.1626930833, -0.5890991688, -0.3423181772, -0.0354445651, -0.1216805205, -0.1883627772, -0.0987218916, -0.3428512812, 0.124754101, -0.0124883205, 0.0298064686, 0.5160681605, -0.487183094, -0.0295810476, 0.219856739, -0.458388418, 0.014255248, 0.1422318667, 0.4166750014, -0.0496472791, 0.2201070189, 0.1075855643, 0.0910667032, -0.1975069642, 0.0559330545, 0.3907081485, 0.3820315599, 0.0675786808, 0.1710543036, 0.0845613033, -0.2150835395, -0.1033619493, -0.1998726577, 0.1032039747, -0.3857401609, 0.5634829998, -0.026676029, 0.2618576586, -0.2945910692, -0.320486784, 0.0342997648, 0.0142827779, -0.2044893056, 0.1050426215, 0.132813096, -0.0418566726, 0.102039054, -0.1786977947, -0.0918798745, -0.1994802654, -0.2397160232, -0.2297836542, -0.1517889351, -0.3549551964, 0.0677676871, 0.2348690927, -0.3219411671, 0.027108036, 0.3597249091, 0.0614184923, -0.2675005496, 0.1516851187, -0.0396938957, 0.3635239005, 0.31020087, -0.3273583353, 0.2836118937, 0.3907002211, -0.056425795, -0.1284382939, 0.3827968538, -0.4262170494, -0.3516855538, 0.1925228089, 0.1590859294, -0.4444237351, -0.1102428436, -0.2061911225, 0.0902896672, 0.4188185632, -0.0466482192, 0.1753659993, -0.1439129561, -0.130047515, -0.2852767408, 0.1402715892, 0.4280158579, -0.5497477055, -0.0674497187, -0.2498909831, -0.0562170669, 0.1099891812, 0.239628002, -0.4815125763, 0.2011152804, -0.2263175249, -0.1987858117, 0.1428755075, -0.1215885729, -0.4337773323, 0.1803834289, 0.2499534339, 0.4296304584, 0.0207904279, 0.0782824159, 0.0647745654, -0.0365482345, -0.1067268997, -0.1406596154, 0.0618263185, -0.2457307279, -0.1365714967, -0.2602416873, 0.3213843107, -0.1354834884, 0.1037089825, 0.2238010764, 0.0367318764, 0.0181511082, 0.0311800018, -0.0368101522, 0.104553014, 0.3294174671, -0.0188396163, 0.1037489846, 0.1263506562, 0.0807273537, -0.4650690258, 0.3508909941, 0.1209329516, -0.4675596356, -0.1491146982, -0.1868677288, -0.15377675, -0.1211956218, -0.4467224479, -0.1915006787, 0.0879464298, -0.0069221891, -0.0161992721, -0.0809430033, -0.2429458648, 0.4812085629, -0.2107370198, -0.1352237314, -0.248937577, 0.1413379759, 0.0420285165, 0.2810896039, -0.2694531083, 0.0546436459, 0.1063111722, 0.0800700635, 0.0314386748, 0.2419424653, 0.0877586305, 0.4027655423, -0.005088903, 0.368514806, 0.025367083, -0.1032399237, 0.2767235339, -0.0941212028, 0.1489206254, -0.0821666643, -0.1542399079, 0.2779750228, -0.2706848085, 0.2121041119, -0.2125898898, -0.2112363726, 0.1240092069, -0.0346606001, -0.088496387, -0.170137465, -0.069836244, 0.0679312646, 0.1711434424, 0.3167242706, -0.0430298001, 0.0704458803, 0.3305058777, 0.0603821874, -0.1028053164, 0.0156824738, -0.1570169181, -0.3179258108, 0.0985312909, 0.444760114, 0.4994430542, 0.1275838166, 0.0666031837, -0.0098827761, 0.0787232146, -0.1767646372, 0.249533698, -0.0649067611, 0.0468864478, 0.1298072487, 0.0407710262, -0.0312099997, -0.3414980769, 0.1196831688, 0.2410698831, 0.1237348318, -0.4768821001, 0.3093512058, -0.4462125897, -0.0721966103, -0.1398264766, 0.1368020922, -0.2670973241, -0.4040006995, -0.1407970935, 0.0495775454, 0.2279472351, 0.1212402061, -0.203130886, 0.3428512216, -0.133613646, -0.0221775081, -0.1573784798, -0.1400098056, -0.1562617123, 0.0989417434, 0.1103481278, -0.3031522632, 0.220177874, -0.0197522901, 0.1069619507, -0.3282644749, 0.0002520159, 0.002827046, 0.0342083201, 0.1573207825, -0.2203423679, -0.0943111852, -0.1018785536, 0.0736059099, -0.0442596786, 0.0304599404, 0.1118765473, -0.1155053824, -0.0266526844, 0.0439228043, -0.0590395853, -0.2237264067, -0.255348146, -0.1147143915, -0.1969298124, -0.0365620926, -0.1048905104, 0.5499766469, -0.0062836148, -0.0027901195, 0.0241824985, -0.047535982, -0.5478751063, -0.4771887064, 0.2433175445, -0.010391105, -0.0927399993, 0.1800290644, 0.1821804345, 0.3579397202, 0.2090372592, -0.589866221, 0.0716200769, -0.1588022858, 0.0233937427, 0.0294226333, -0.0424999818, 0.2604376674, 0.1229924262, -0.0197213888, -0.1496982723, -0.0818621665, -0.1456713974, -0.1006150171, 0.2926934063, -0.0140614863, -0.0258153882, 0.1166398004, 0.8728514314, 0.3354344666, -0.1743581444, 0.1497430205, 0.0036005359, 0.6802713871, -0.0236991085, -0.2721689939, -0.1048573181, -0.3019874394, -0.2880854011, 0.0078905858, -0.0682231337, -0.0739513934, 0.1186829209, 0.2826233804, -0.0740707666, -0.2546602488, 0.1120000929, -0.4700663686, 0.3354951143, 0.1904258579, -0.031707488, -0.2627393901, -0.0764459372, -0.2539057732, 0.1647629887, 0.4068378508, -0.1122134626, -0.1564539522, -0.0322544202, -0.2148513794, 0.2287475616, -0.1043403149, 0.1942422539, -0.186687842, 0.1193085015, 0.2706303596, 0.2362112999, 0.4416405559, -0.3354637027, -0.128466934, 0.2465895414, 0.0022427589, -0.1495689154, -0.1514667869, 0.027650103, 0.358568579, -0.0740289539, 0.0572515279, 0.211376518, -0.2003386617, -0.3200255632, 0.1698257923, -0.1995248199, -0.1700765491, -0.2334343046, -0.0489893705, -0.2833400965, -0.0769562423, -0.0371070206, -0.1540484875, -0.2317910194, 0.02988974, -0.1639720351, 0.1110299975, 0.1563225389, 0.0292975754, 0.3012326956, 0.2159175724, 0.0202348307, 0.394447118, -0.0352935418, 0.3171942532, 0.4560657144, -0.0167691037, -0.1099896133, -0.0243504308, 0.0099986568, 0.0677472651, 0.1511390805, -0.417091608, 0.1462953389, 0.073684603, -0.1210204959, -0.3877401054, -0.0547520965, 0.2709855139, 0.2128455937, -0.3550460637, -0.6746977568, 0.4435946643, 0.1464604884, -0.2401802689, 0.1383090317, -0.0883964151, -0.2996912301, -0.0610641055, 0.1230763197, 0.6396490335, -0.0497899316, 0.0999637246, -0.1400755793, 0.0719699711, 0.5022537708, -0.3129162788, 0.3041852117, -0.0861968398, -0.1927684247, -0.1455081105, -0.1197858155, 0.3632360399, 0.2697048783, -0.1359047443, 0.307972461, -0.3161231279, 0.3013362288, -0.1505204439, -0.0549886152, -0.0285899621, -0.0406885818, 0.1442479044, 0.2281892151, -0.0997171924, 0.3356190324, -0.0689981654, 0.2048371136, 0.2493767142, 0.1936885864, -0.3374402523, -0.1257371753, 0.0690717325, 0.3066956997, -0.0890399963, -0.2670941949, 0.4590044618, 0.3506663144, 0.3423376679, -0.0457615778, -0.1775249839, 0.314799577, 0.138198778, 0.2338989079, -0.1689064801, -0.051008299, 0.3056408167, 0.1594473124, -0.2640144527, 0.1524904668, -0.0882914588, -0.2240956426, -0.0509478897, 0.4085108936, 0.0640562624, -0.5559611917, -0.0908328146, 0.3273924887, 0.2179464698, 0.1672279537, 0.1639007181, 0.1661960036, 0.2095594555, 0.4357347488, -0.3501190841, -0.354480505, -0.0227381382, 0.2921640575, 0.4367714822, -0.1963723302, 0.493460089, -0.2784532905, -0.2668257058, -0.1840013564, -0.059323974, 0.0768894777, -0.1987031102, 0.0320515968, 0.0503814183, 0.5129697323, 0.1112082005, 0.0021711141, -0.0117474571, 0.0196253099, -0.2182291299, -0.0911414176, -0.1519616395, -0.0252474695, -0.073380813, 0.3485891223, -0.0597648099, -0.1408622116, 0.0822804049, 0.0742956847, -0.3046661317, 0.1040651426, -0.0914506912, 0.1877191663, 0.0248713382, -0.0595068634, 0.102068916, -0.3310247362, -0.0254217237, -0.1343949139, -0.2966210246, -0.207581386, 0.1033255756, 0.1513065994, 0.0808230191, -0.2305880785, -0.1054555774, -0.1783614755, -0.0189119186, -0.1884192228, 0.2050106376, 0.3741441369, 0.0511077829, 0.2064266354, -0.1330073178, -0.1382598579, -0.1291485876, -0.1326714158, -0.0152385049, 0.2860147357, 0.3478197157, 0.2652786374, 0.0007204041, 0.1014991552, -0.3858973086, 0.3128342628, 0.1614361256, 0.1342074871, 0.1904035956, -0.3635290265, 0.2479934841, 0.1711934954, 0.2598031461, 0.1603670567, -0.2352408171, -0.2446567714, 0.0477944165, 0.1732890159, -0.1072360724, -0.1930186749, 0.1676573008, 0.2809455395, -0.0967926756, 0.2038504183, 0.4800881743, -0.0323562101, 0.5502659678, -0.0269424692, 0.6699720621, -0.450013876, 0.4508246183, 0.152966693, 0.1055641398, -0.068024613, 0.4651840329, 0.4063007236, -0.0237060152, 0.6273496151, 0.0144170728, 0.2521226406, 0.4498822391, 0.2904343605, -0.3405669928, -0.819208324, 0.3104334176, 0.3982145786, -0.4488947988, 0.1168085486, 0.0262727998, -0.010003686, -0.0453775264, 0.0183689184, -0.0888938978, 0.2448590994, -0.183466509, -0.1232042462, 0.3968525529, -0.2634815872, 0.0694976896, 0.0968415141, -0.043462608, -0.0514188744, 0.1646251082, -0.1588071734, -0.2100952417, -0.310275197, 0.418279767, 0.060717985, 0.3171713352, -0.0884845704, 0.2217870206, -0.0683785155, 0.0083078537, 0.2621366382, 0.3208216429, 0.3727637231, 0.0957437009, 0.2460522652, 0.1270029843, -0.0210858136, 0.0010045171, -0.1751105636, 0.3105116189, -0.188615486, -0.0904982761, 0.0898074657, 0.157391414, 0.0561005026, 0.104053393, 0.0010084324, 0.2535035908, -0.4775227606, -0.005623363, 0.1670276523, 0.0225882977, -0.0631174669, 0.2347108722, -0.3002535403, -0.2069143057, 0.7661935687, -0.0268253144, 0.2581925988, -0.2106382847, 0.0933529288, -0.0331008434, 0.3607285321, 0.1303015798, 0.1006152034, -0.183111921, -0.0573929027, -0.6422402859, -0.0962607116, -0.166290015, 0.293777585, 0.1058248058, 0.0946618095, -0.0822319984, 0.0579709485, 0.1092483401, -0.1807005405, -0.0588789247, -0.2368711084, -0.0097358972, -0.0535417311, -0.176929459, 0.0126564968, -0.2095715255, -0.1916646957, 0.1834267676, -0.0666875169, 0.0385412872, -0.0850880146, 0.011673294, 0.082224533, 0.1533951759, 0.4481310844, 0.2328591794, 0.2836712599, 0.2613921762, 0.1431045234, -0.3198749125, -0.2190732509, -0.1147538424, 0.2478030473, 0.0711661875, -0.1148604751, -0.4961170256, 0.022927599, -0.2213886082, 0.1173786819, 0.0895467848, -0.016669903, -0.0308834612, -0.2125701904, -0.0893310308, 0.1652235091, 0.0440973602, 0.2976621687, 0.0289045535, 0.3217286766, -0.3588088751, -0.0783864111, 0.2933991551, -0.3242953122, -0.2258912921, 0.0607288294, 0.149919942, 0.0497913845, -0.2368642241, -0.5234307051, -0.0139787346, 0.5846506357, -0.3617410362, -0.0685681924, 0.0632005036, -0.0964341983, 0.093758747, -0.1103021652, 0.2539665997, 0.0622681566, 0.0009359643, 0.0394209176, -0.2846997976 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
Thank you for the clarification. This is a bit confusing. On one hand, it says that cache files are always recreated and written to a temporary directory that is removed; on the other hand the last bullet point makes me think that since the default according to the docs for `download_mode (Optional datasets.GenerateMode) – select the download/generate mode - Default to REUSE_DATASET_IF_EXISTS` => it almost sounds that it could reload prepared dataset files. Where are these files stored? I guess not in the temporary directory that is removed... I find this type of api design error-prone. When I see as a programmer `datasets.set_caching_enabled(False)` I expect no reuse of anything in the cache.
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
112
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! Thank you for the clarification. This is a bit confusing. On one hand, it says that cache files are always recreated and written to a temporary directory that is removed; on the other hand the last bullet point makes me think that since the default according to the docs for `download_mode (Optional datasets.GenerateMode) – select the download/generate mode - Default to REUSE_DATASET_IF_EXISTS` => it almost sounds that it could reload prepared dataset files. Where are these files stored? I guess not in the temporary directory that is removed... I find this type of api design error-prone. When I see as a programmer `datasets.set_caching_enabled(False)` I expect no reuse of anything in the cache.
[ 0.0234997272, -0.006731227, -0.1006587446, 0.2295335382, 0.2193901986, 0.1646068841, 0.1426830143, -0.1221593171, 0.2681148648, -0.2213970125, 0.1463904232, 0.0476379581, -0.0811797827, -0.0989195928, 0.0419843309, 0.439771235, 0.1416728199, 0.1220704615, -0.1241386905, -0.0242457092, -0.1132139191, -0.0720724463, -0.2296928614, -0.0093613751, -0.3864178956, -0.1857892871, -0.0136257336, -0.0095075201, -0.1264186651, -0.6089862585, 0.5007251501, 0.3236506581, 0.1929258704, 0.1994945705, -0.0001181951, 0.0677731261, 0.2361240536, -0.1209785789, -0.273507148, -0.0727828667, -0.6044926643, -0.2693716288, 0.2145038247, -0.1004405618, 0.1328168809, -0.3968075514, 0.1487826705, -0.6915860176, 0.4652370811, 0.3504002988, 0.1721187234, -0.2823826671, -0.4284877181, 0.0757460371, -0.1182390824, 0.1931484789, -0.0309062004, -0.1335907876, 0.1799319535, 0.0853233561, 0.0445980728, 0.1798015982, -0.0702084452, 0.1382530034, 0.610314846, 0.0010879599, -0.3598740399, -0.4836098254, 0.309447825, -0.0379222967, 1.1107506752, -0.2843291461, -0.2158841789, -0.3374542594, -0.1147958711, -0.1629476845, 0.2030145079, 0.0141902529, 0.0817525238, 0.2514042854, -0.464525044, -0.4127130508, -0.103939414, -0.1423556358, -0.1313590705, -0.1855160147, -0.3275108635, 0.0561173931, -0.2420200408, 0.0381602906, 0.464862138, -0.5910776854, 0.0029417574, 0.3164909482, -0.2159609199, -0.0329932049, 0.1887455285, 0.3879157305, 0.00058157, 0.3070462346, 0.2229654938, 0.0402303077, -0.2444277853, 0.0954836905, 0.4019171596, 0.3555065095, 0.2171301395, 0.0207257122, 0.1586511582, -0.1143530235, -0.0675500035, -0.2549186051, 0.037896879, -0.1489848197, 0.614471674, 0.0111029632, 0.2402542531, -0.2406779379, -0.2174336612, 0.1185984612, -0.0145711973, -0.0895527601, 0.0217404813, 0.1052211374, -0.0551350676, 0.0611127429, -0.1994844079, 0.0208434425, -0.1996300519, -0.2355585694, -0.1645979881, -0.1472323537, -0.2722465992, 0.0655938536, 0.2371267676, -0.1996527165, 0.2041179091, 0.3499109745, 0.0142248794, -0.2714630067, 0.3167567849, 0.053475555, 0.3164255619, 0.3470381498, -0.1522305608, 0.2555712461, 0.2580892444, -0.0264404342, -0.1713910401, 0.4140845537, -0.4340628386, -0.4625377059, 0.2060811967, 0.1405346096, -0.4565962553, -0.0531906374, -0.1370823979, -0.0015279329, 0.4295648932, 0.0103740096, 0.1819976568, -0.0979931355, -0.0836930349, -0.3451648951, 0.0018538758, 0.5554586053, -0.6028241515, 0.017168045, -0.1815542579, -0.1036819369, -0.0311859138, 0.2099238932, -0.3868825734, 0.2438091338, -0.2664466202, -0.1506944597, 0.2950620055, -0.2705555558, -0.3486517966, -0.0232019033, 0.3061288595, 0.3065513074, 0.0396656841, 0.113166213, 0.1702813208, -0.0200744011, -0.0307630748, -0.0458787978, 0.0205203127, -0.3010166883, -0.1418018639, -0.2315363735, 0.1024650633, -0.2727433741, 0.012484218, 0.182221204, 0.0262567028, -0.130548954, 0.0150084812, 0.0417238995, 0.065758653, 0.2498113811, 0.0437642261, 0.1365918964, 0.0974457413, 0.0889293551, -0.5970899463, 0.3292790055, 0.0235643685, -0.4680372179, -0.0944331288, -0.2102168947, -0.1454630047, -0.1103564501, -0.4886603057, -0.1875456721, 0.0347708054, -0.0018734783, 0.152338922, -0.018237561, -0.2908664048, 0.3823856711, -0.2144012451, -0.0440169908, -0.2194143832, 0.146204859, 0.0243481342, 0.2098648548, -0.3131632209, 0.1022914648, 0.103808932, -0.0374071151, 0.0518372953, 0.2952744663, 0.1787336767, 0.4258135855, -0.0014285336, 0.4329091311, 0.1385595053, 0.0109965429, 0.2834737897, -0.1397242546, 0.0873667151, -0.0346959755, -0.19875139, 0.2592176795, -0.2250605226, 0.0767403767, -0.0830586702, -0.2420130372, 0.0986188948, 0.0978421718, -0.0763716549, -0.2709977031, -0.1368172169, 0.2496685386, 0.1502285898, 0.3429256082, -0.0461412743, 0.2502217293, 0.3018487394, -0.0566382967, -0.0451388136, -0.1202749088, -0.161577791, -0.3995041847, 0.160661906, 0.4072234631, 0.5993423462, 0.0622536354, 0.2182065845, -0.0258427691, 0.1038822085, -0.16439794, 0.2832359672, -0.0532161854, -0.0447375737, 0.1709441841, 0.0531282648, -0.0749826133, -0.3602159619, 0.1397023052, 0.2798993886, 0.1886998564, -0.36719203, 0.252940625, -0.4431508183, -0.1817047745, -0.1705856621, 0.1654937267, -0.1021195203, -0.4035174251, -0.0525822416, -0.0047764527, 0.1409047544, 0.0820238441, -0.1954797804, 0.3975161314, -0.1860216856, -0.0053795502, -0.1806027591, -0.0211063102, -0.2057395577, 0.0298246816, 0.1293587834, -0.2706011832, 0.289228797, -0.0767413005, 0.1035089344, -0.3255172968, 0.0774657503, 0.017413713, 0.204433918, 0.2359983027, -0.0490939431, 0.054511223, 0.1179456636, 0.2206739783, -0.1058523506, -0.0016605034, 0.0602979884, -0.1931712329, 0.08588361, 0.1474364102, -0.0783886909, -0.2904158235, -0.315256387, -0.1024323851, -0.2619401217, 0.0277820602, -0.0481703468, 0.3808299601, 0.0195104145, -0.0984848589, -0.0039824359, -0.0292457677, -0.501685977, -0.5709943175, 0.2443319559, -0.1307733506, -0.0042994134, 0.2075235099, 0.0845578015, 0.3798977733, 0.1197343916, -0.516089797, -0.1788176596, -0.0568521917, 0.1516494453, 0.0886652768, 0.0310541634, 0.3348368704, 0.0775807872, 0.0335269198, -0.1269311905, -0.0595846921, -0.0351210423, -0.0185821746, 0.1683896035, 0.1260139644, -0.0693976507, 0.0441117957, 0.9790999889, 0.408624351, -0.1154411212, 0.1760877371, 0.069602862, 0.7738029361, -0.037713822, -0.0741372705, -0.2078891993, -0.1884601116, -0.3139918447, 0.0167480335, 0.0886377245, -0.0161531176, 0.1868170798, 0.3473851085, -0.1313387007, -0.2165230066, 0.0515592694, -0.3629048169, 0.3482804298, 0.2650028765, -0.084252581, -0.3296338916, -0.0185544863, -0.2946539521, 0.1830748022, 0.4402165711, 0.0292312391, -0.1951732934, -0.1712910384, -0.2636552453, 0.1743568182, -0.0061188638, 0.2029762119, -0.0061153248, 0.2090799063, 0.3335348666, 0.1802457124, 0.3525330424, -0.5026125908, -0.1824569404, 0.1346825659, 0.1880277991, 0.019483462, -0.1133231521, 0.1127951965, 0.2617639899, 0.0060895551, -0.0353842638, 0.2537995875, -0.2336900681, -0.358902216, 0.231675595, -0.2619051337, -0.0648514628, -0.1865350604, -0.1826256514, -0.1798885167, -0.1747107655, 0.0035715923, -0.3195201159, -0.2146864086, 0.0176030025, -0.0704079941, 0.1649592072, 0.0369963795, -0.0473925993, 0.2551007867, 0.0189985298, 0.0032832995, 0.3809718192, -0.1457581818, 0.2899613976, 0.5449877977, -0.172226727, -0.0084875636, -0.0830255896, 0.04144058, -0.01484292, 0.1966679692, -0.3733760715, 0.1374656409, -0.0585766695, -0.2101404518, -0.4382800758, -0.1286464632, 0.2697998881, 0.0860320181, -0.1452622712, -0.8525399566, 0.4882224798, 0.1349605024, -0.3002377152, 0.256131202, -0.0263156071, -0.2982074618, -0.0291872509, 0.1631519049, 0.6705067158, 0.0342872106, 0.2532723844, -0.1095071733, -0.0696865618, 0.6333462, -0.3704906702, 0.260089159, -0.1389881372, -0.0534676202, -0.2236573696, -0.1458280385, 0.3658935726, 0.1596626192, -0.007823199, 0.3788110912, -0.1656182408, 0.3940687478, -0.0691817403, -0.074151054, -0.2906841636, 0.0225860663, 0.1784748286, 0.1118523851, 0.136402458, 0.3256078362, -0.2210947424, 0.256367147, 0.3178256452, 0.180958271, -0.3007849455, -0.2886204123, -0.0643323958, 0.2830477655, -0.2062582672, -0.2831355929, 0.293615371, 0.4367156029, 0.1942546517, -0.0588089153, -0.1622583121, 0.244544208, 0.1702602953, 0.1599706113, -0.1203071326, -0.0548459366, 0.2731929123, 0.1304356605, -0.2121498883, 0.1657133251, -0.1185848564, -0.0801919475, -0.2377200872, 0.3219050169, 0.1242241561, -0.5290647149, -0.2564129829, 0.2405344695, 0.1354174018, 0.1218914539, 0.0849766657, 0.2668369114, 0.2513146102, 0.420759201, -0.5648018718, -0.1899157614, -0.050577905, 0.2930497527, 0.5396539569, -0.2217862606, 0.4010858536, -0.3772260249, -0.244306013, -0.1587747633, 0.0501664877, -0.0241272058, -0.1426787078, 0.0522160903, 0.0530311577, 0.3743491173, 0.0272893272, 0.0046014925, 0.0209168885, 0.0095929001, -0.2336739004, -0.1644585431, -0.0868573338, 0.0352889411, 0.0572943687, 0.4075859785, -0.032691732, -0.3268318474, 0.0959443972, -0.1341899931, -0.2389649153, 0.1581131518, 0.0122105405, 0.1036858037, 0.0062940773, 0.0487023108, 0.0077853948, -0.257807821, -0.1230217144, -0.1365407705, -0.3432877362, -0.1299782991, 0.1342003644, 0.1895480752, 0.0832495689, -0.242934674, 0.0265564322, -0.2787335217, -0.0062217293, -0.1361240149, 0.2229903638, 0.2821004391, 0.0375669934, 0.142647475, -0.2779725492, -0.0224559754, -0.1634531468, 0.0448714457, 0.0462444313, 0.289272964, 0.3116778433, 0.3197031617, -0.1628530025, 0.0154930204, -0.3095218837, 0.376835525, 0.0573944449, 0.1486506909, 0.2582584023, -0.3487162292, 0.226274699, 0.11721313, 0.1990613639, 0.3502586782, -0.2852610052, -0.1070062965, 0.0274343044, 0.1120248735, -0.0820119902, -0.1429764628, 0.0683030337, 0.2846567333, -0.1225742549, 0.2854656279, 0.5204176903, -0.1154556423, 0.4649977088, -0.0577530079, 0.6504691839, -0.4031919241, 0.3757523298, 0.1190379709, 0.0685902536, 0.0092723612, 0.3274645507, 0.448120594, 0.1422033012, 0.6588885784, 0.1218707711, 0.3879486322, 0.467333734, 0.2016200721, -0.3833975196, -0.8955921531, 0.3078374863, 0.3818645179, -0.3685451448, 0.2639086246, 0.106483072, -0.03125038, -0.1380834579, 0.0902556628, -0.0998123437, 0.196806848, -0.1688737422, -0.1832996607, 0.3603133857, -0.3866861761, 0.187209636, 0.1168713421, -0.0066793365, -0.0898090303, 0.0141189434, -0.202032119, -0.2183409482, -0.3180066049, 0.484736979, 0.0347972997, 0.2326510847, -0.061707437, 0.2855440974, 0.0759228021, -0.0152517334, 0.159711808, 0.2611505389, 0.3983957171, 0.1181308776, 0.1448615491, 0.12760517, 0.0456532575, 0.0126988366, -0.1188006699, 0.2274232209, -0.1583294421, -0.1021403074, 0.0706801564, 0.1190620437, 0.1113487333, 0.0680556744, 0.0785312951, 0.0670675635, -0.4187905192, 0.0865258276, 0.1118573025, 0.0541389212, 0.0470943898, 0.2602121234, -0.2820614278, -0.200892508, 0.5995694995, -0.018512439, 0.188912794, -0.2611023784, 0.0533789843, -0.1386909336, 0.206206426, 0.2603815794, 0.1407028139, -0.1800918728, -0.0604566336, -0.6016355753, -0.0857687443, -0.1399373859, 0.208733052, 0.0244962424, 0.1647188365, -0.198947981, -0.0473619923, 0.0839218646, -0.0454460159, 0.0549815148, -0.0095490608, 0.0370474234, -0.1825580746, -0.1941013485, -0.0226570815, -0.290792644, -0.3785873652, 0.0232160278, -0.2155514956, -0.0512062237, -0.09246777, 0.0003641844, 0.183701545, 0.0372899733, 0.520575881, 0.2066612095, 0.1702024788, 0.3203723133, -0.0171446875, -0.2609780729, -0.0301306732, -0.124185577, 0.142986834, 0.0451504551, -0.1089261323, -0.5915424824, 0.0786103606, -0.2193135321, -0.0056599826, 0.1123647317, 0.0419398025, -0.0896684378, -0.187054038, -0.2448748648, 0.2106910646, 0.2306341231, 0.2907434702, -0.0177012682, 0.3030097783, -0.2997814119, 0.0832374841, 0.2538384199, -0.1835066676, -0.1611136794, -0.0786267221, 0.2735332847, 0.160391897, -0.2609640956, -0.4676234424, 0.0254453123, 0.5799103975, -0.3833325207, -0.104909718, 0.0173239298, -0.0641882122, -0.0145640075, -0.1484281719, 0.5461585522, 0.0278827883, 0.0070444942, 0.1480555534, -0.299567461 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
It would be nice if the documentation elaborated on all the possible values for `download_mode` and/or a link to `datasets.GenerateMode`. This info here: ``` """`Enum` for how to treat pre-existing downloads and data. The default mode is `REUSE_DATASET_IF_EXISTS`, which will reuse both raw downloads and the prepared dataset if they exist. The generations modes: | | Downloads | Dataset | | -----------------------------------|-----------|---------| | `REUSE_DATASET_IF_EXISTS` (default)| Reuse | Reuse | | `REUSE_CACHE_IF_EXISTS` | Reuse | Fresh | | `FORCE_REDOWNLOAD` | Fresh | Fresh | ```
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
84
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! It would be nice if the documentation elaborated on all the possible values for `download_mode` and/or a link to `datasets.GenerateMode`. This info here: ``` """`Enum` for how to treat pre-existing downloads and data. The default mode is `REUSE_DATASET_IF_EXISTS`, which will reuse both raw downloads and the prepared dataset if they exist. The generations modes: | | Downloads | Dataset | | -----------------------------------|-----------|---------| | `REUSE_DATASET_IF_EXISTS` (default)| Reuse | Reuse | | `REUSE_CACHE_IF_EXISTS` | Reuse | Fresh | | `FORCE_REDOWNLOAD` | Fresh | Fresh | ```
[ -0.1325750947, 0.0042608082, -0.100325495, 0.1450197697, 0.2611148953, 0.0885637924, 0.149780184, -0.005440102, 0.0523647591, -0.2209995389, -0.01053413, -0.0093214326, -0.0788026601, 0.0148018748, -0.0911452398, 0.4515506625, 0.171767205, 0.0544776544, -0.2703158259, -0.0126866475, -0.0795434117, -0.0508987904, -0.1528280675, -0.0177354589, -0.3257791102, -0.0017376132, 0.0608110353, -0.0484849773, -0.2403377742, -0.6755392551, 0.5190628767, 0.449483633, 0.20839113, 0.1146776825, -0.0001168151, 0.0489493459, 0.3039730191, -0.1338787973, -0.2875080407, -0.0103915781, -0.5450860262, -0.2912786007, 0.1124304086, -0.1120600551, 0.0395752415, -0.1538892239, 0.0811221823, -0.5785900354, 0.3715532422, 0.3695132434, 0.1818337739, -0.1832769215, -0.200106442, 0.0893237069, 0.1412220001, 0.2437104434, -0.1237792373, 0.0372410454, 0.3220757246, 0.1247810572, -0.0181997716, 0.2879495323, -0.0560560152, 0.2960295975, 0.5656487942, 0.0093442276, 0.1636773944, -0.4565843642, 0.2388892472, 0.0250145737, 1.1493661404, -0.2332355082, -0.2873542011, -0.3733202517, -0.1109540761, -0.3186916709, 0.2588659227, 0.0140751861, -0.0272199996, 0.1969656348, -0.665689826, -0.236951232, -0.1510464847, -0.1439845413, -0.1140456572, 0.0083219185, -0.3288092017, 0.0601478666, 0.0228603166, -0.0448700152, 0.5436964631, -0.4406124353, 0.017796509, 0.2235454619, -0.3665753901, -0.1350383461, 0.1707545817, 0.3412370682, 0.0559608042, 0.2809713185, 0.0043466464, -0.1090333089, -0.1632770151, 0.0796073377, 0.4099764228, 0.184731245, 0.1536180377, -0.1211037636, 0.1026656255, -0.06536033, -0.0127921999, -0.1522942781, 0.0578932427, -0.3024713695, 0.5569899082, 0.0259585679, 0.2239093035, -0.2749816179, -0.3039258122, -0.0038772821, 0.0141933262, -0.2060308456, 0.0928864703, 0.1861325204, -0.0754157677, 0.062171746, -0.2922914922, 0.0188442543, -0.1590115279, -0.3619896472, -0.1578514576, -0.1793254465, -0.3269337416, 0.0204795375, 0.2394787669, -0.2574569285, 0.100544326, 0.4393438101, 0.0420367345, -0.2138963938, 0.1889699548, 0.0254871361, 0.2010566592, 0.4977920651, -0.2865722775, 0.1973751783, 0.2685187161, 0.0111293942, -0.1918099225, 0.4145022929, -0.3691080511, -0.5318118334, 0.1474082619, 0.1390048712, -0.5060514808, -0.1422890723, -0.090061307, 0.110587433, 0.3779515922, -0.0056705847, 0.1612612307, -0.1432573944, -0.1368411481, -0.368462652, 0.0003974214, 0.4416202903, -0.6113401651, -0.0170367658, -0.370536983, -0.2274077535, 0.1591458321, 0.1475975513, -0.3789155483, 0.1754209995, -0.186342746, -0.2089994699, 0.1826337576, -0.1241740361, -0.3571069539, 0.1453818828, 0.3975533843, 0.2618072033, 0.0976004303, 0.1303772628, 0.1016699597, -0.120659247, -0.1181314588, -0.0377236977, -0.0049880706, -0.2503038049, -0.0772859305, -0.3503140211, 0.1276771724, -0.1639276296, 0.0155468425, 0.1499366313, 0.0802271515, -0.1014927104, -0.0588775799, -0.0537636615, 0.0857708827, 0.1736116111, 0.1347943246, 0.1471325904, 0.0282388739, 0.1696177274, -0.6066910625, 0.3852390945, 0.0662047714, -0.3480160236, -0.0871556625, -0.2118595243, -0.2996635735, -0.0250246972, -0.3529519737, -0.2120273411, 0.045829542, -0.0506739803, 0.1571799666, -0.1518159807, -0.2582431138, 0.3438590467, -0.2423757315, 0.0148016065, -0.1462845057, 0.1495354176, -0.0488026291, 0.2019357383, -0.2094463408, -0.0156089813, 0.1156179905, 0.0086220279, 0.0717080832, 0.4083186686, 0.1737720221, 0.4718438983, -0.1032987088, 0.4203930497, 0.1377691031, 0.0736765489, 0.2135798335, -0.1835940778, 0.1024537086, 0.0142308548, -0.2718121707, 0.3134011626, -0.1931472868, 0.0768744946, -0.1140332744, -0.2736137211, 0.1306158602, 0.0810393691, -0.0460012928, -0.2751425803, -0.0808303505, 0.1798797846, 0.0037941113, 0.3058408201, -0.0288731679, 0.2879080772, 0.2200861275, -0.2195734084, -0.0610302463, -0.0124931429, 0.0235609282, -0.4724954069, 0.1849093735, 0.492818892, 0.5551477075, 0.0222603194, 0.2973547876, 0.0433821157, -0.0461560413, -0.2960594296, 0.3671457171, -0.1907934844, 0.0465033688, 0.1567805111, -0.0506641753, -0.1499489695, -0.346131742, 0.1256600469, 0.3300361633, 0.3210258484, -0.4505418539, 0.1189450845, -0.4110972881, -0.0787219703, -0.0761827081, 0.1549045742, -0.2310667634, -0.3646589518, -0.1081449986, 0.1242576689, 0.1314707249, -0.016365204, -0.1997044832, 0.256054461, -0.1282806396, 0.0514580011, -0.128470391, -0.1792521924, -0.1449581683, 0.0650039688, 0.0717625543, -0.3010618687, 0.2586386502, -0.1313630641, 0.0943392143, -0.2228559554, -0.0122404695, 0.096245721, 0.0774574876, 0.2347012907, -0.1315715611, 0.0296801589, 0.1202931255, 0.1396787614, -0.0819180459, -0.0028210282, -0.0017426759, -0.2095080316, -0.0061241202, 0.1070559919, -0.1420657039, -0.3035120964, -0.2983779609, -0.0950418264, -0.2578518391, 0.0004816204, -0.0052527636, 0.5572147965, -0.0099969693, 0.0066039227, 0.0939479619, 0.0151626281, -0.5945011377, -0.4954148829, 0.2906998396, -0.1030747294, -0.0394014232, 0.2776834071, 0.0995813087, 0.3611540496, 0.2926028967, -0.5287020206, -0.0356634557, -0.1569281965, 0.1076136604, 0.1552855074, 0.0289057437, 0.2721234858, 0.0868231803, -0.0061669946, -0.1301564574, 0.0074913651, -0.1374364197, -0.0472734869, 0.2741395831, 0.0605775192, 0.0238110721, 0.0636950806, 0.9581975341, 0.4418132305, -0.0832929313, 0.1660141945, 0.0828535855, 0.6536434293, 0.0880160779, -0.0483277068, 0.0106887221, -0.2249956429, -0.2996985912, 0.0261033066, 0.0156352445, -0.0034115836, 0.0951903611, 0.4420707822, -0.1336169541, -0.2970889807, 0.055939272, -0.3286456168, 0.4383734167, 0.1199652553, -0.024677664, -0.1355340332, -0.0386380851, -0.3168526888, 0.2735340893, 0.3320981264, 0.0051926598, -0.2060045302, -0.0337156653, -0.2731870413, 0.1980528235, 0.0885884613, 0.1384668648, -0.076443404, 0.2041454911, 0.3053609133, 0.0551661067, 0.4123054743, -0.6105515957, -0.0105049862, 0.1238897145, 0.0826098174, -0.028857965, -0.171559751, -0.0109604448, 0.1350925863, 0.0507850647, -0.1205475256, 0.0707469434, -0.2454444617, -0.2502866983, 0.0775806606, -0.09452831, -0.1838324368, -0.200032264, -0.1234359294, -0.295568943, -0.042319946, -0.0776300654, -0.2414813936, -0.3587052822, 0.1035593376, -0.0516123436, 0.2731728554, 0.1097302437, 0.1589664221, 0.2044169307, 0.166143328, -0.0183428191, 0.3403426707, -0.4006917477, 0.3688637912, 0.5073346496, -0.0451883525, 0.0010626316, -0.0655851066, 0.0574605316, -0.0769570321, 0.2200245261, -0.353841126, 0.0212962255, -0.0334314853, -0.2535520196, -0.4195616543, -0.0767132491, 0.3313020766, 0.0247688591, -0.2231523544, -0.8084750175, 0.5134009719, 0.1843255758, -0.2629623413, 0.0629968718, 0.0593881607, -0.233833909, -0.3189500272, 0.2463939041, 0.6856471896, 0.02112123, 0.1604949832, 0.0181622058, -0.0361170843, 0.581777215, -0.2473654598, 0.1859797239, -0.0498426966, 0.0205073431, -0.1884729117, -0.1235984564, 0.4794457555, 0.2287913561, -0.1546935141, 0.3027615845, -0.1860236824, 0.3960480094, -0.1069140583, -0.1233857274, -0.222519204, 0.0205069445, 0.167672649, 0.1771557927, -0.0417634137, 0.3428209722, -0.1581335962, 0.2205706537, 0.2329136133, 0.2162553817, -0.4692495465, -0.251429975, 0.1275882572, 0.2413775921, -0.1821359843, -0.2639634013, 0.3876973987, 0.4182440042, 0.3648183048, -0.1093135476, -0.2285254151, 0.278344661, 0.0890799463, 0.1886732578, -0.1542812437, -0.0647229999, 0.3571134508, 0.0443256199, -0.2755440474, 0.2178255469, -0.0168755278, -0.0380721912, -0.0511510074, 0.1824414581, -0.0326612853, -0.5251841545, -0.1205988079, 0.2801268101, 0.1279419214, 0.1533233374, 0.0972220451, 0.1801124811, 0.1680443436, 0.3907108009, -0.575871706, -0.2164124846, -0.1327159256, 0.293894738, 0.4757040441, -0.2232353389, 0.2769853175, -0.3090807199, -0.2733969986, -0.1132371575, 0.0864717141, -0.1512523741, -0.2568321526, 0.0809843242, 0.0562290847, 0.33152619, 0.0911221355, 0.080809772, 0.0851496309, 0.1114175022, -0.1219341531, -0.0954739898, -0.1219085678, -0.0759998411, -0.0955837443, 0.3711846471, -0.0930883437, -0.2647476792, 0.1706951261, -0.1295156628, -0.2550218105, 0.0876840129, -0.0030139163, 0.1641934365, 0.0623023547, -0.1257252246, 0.0457175635, -0.3645153046, -0.1038499102, -0.1774617434, -0.5247849226, -0.1387738585, -0.0082630254, 0.1929164231, 0.1114770323, -0.3349024355, 0.0274390317, -0.250759244, -0.102653414, -0.0996652842, 0.1932179332, 0.2394444048, 0.0643021166, 0.2433058172, -0.1276581883, 0.0600165799, -0.1710185707, -0.0793193057, 0.0448627099, 0.3459498286, 0.3399980366, 0.3575981557, -0.1772588491, -0.0374862626, -0.3184014857, 0.3974719048, 0.1937232316, 0.0382943228, 0.2872056961, -0.2777394354, 0.2308433652, 0.0780108422, 0.323471725, 0.3506147563, -0.1437323987, -0.1888289154, 0.0375483483, 0.1337925047, -0.0908208415, -0.1459818184, -0.0368663296, 0.3552684784, -0.0866568908, 0.2495106161, 0.5172484517, 0.0803855211, 0.5661532283, -0.0108084232, 0.5127910376, -0.3276567459, 0.4368329644, 0.3536315262, 0.1125666946, -0.0184975043, 0.4581286907, 0.3813287914, 0.132094264, 0.5072700381, 0.032048095, 0.2237775922, 0.3761745393, 0.2062739134, -0.3331021667, -0.7990943193, 0.274598062, 0.4237222075, -0.4052146971, 0.2453992218, 0.109891884, -0.0461168587, -0.0603363961, 0.0330281518, -0.1960098743, 0.188532114, -0.1355805248, -0.2312069535, 0.2734338641, -0.3501800299, -0.0725107789, 0.2056946754, -0.2398758233, -0.1312089413, 0.1012742445, -0.1173488498, -0.1434187442, -0.4577669799, 0.4708827138, -0.0328091495, 0.2585251331, -0.0714809448, 0.2669598758, 0.2390206903, -0.0912993103, 0.2848148346, 0.2631332278, 0.5140573382, 0.1025295779, 0.0745019317, 0.1179380268, 0.0744434223, 0.0274632126, -0.1108153611, 0.236211732, -0.0721887499, 0.0271704979, 0.0854701772, 0.0888836607, 0.0558628142, 0.1025629342, -0.0258003846, 0.0754956827, -0.4381801784, 0.149644509, 0.1288441867, 0.0857993662, 0.137563616, 0.2785959542, -0.3378024101, -0.2569724917, 0.5932244658, -0.0463147089, 0.2142390013, -0.1442987025, 0.0704876259, -0.0217845831, 0.4156263769, 0.1063929796, 0.0766219646, -0.1099090427, -0.0176004469, -0.7548524737, -0.2957160175, -0.150121212, 0.1948820502, 0.2156327665, 0.1462046206, -0.1101191491, 0.2309692353, -0.0136862695, -0.1420096904, -0.0463031977, -0.058474876, 0.0807635784, -0.1495242417, -0.1093720198, -0.109974362, -0.2897756696, -0.2760652006, 0.2154345363, -0.1367382258, -0.056944225, -0.0696990564, -0.0235584527, 0.28477633, 0.1172649711, 0.4224746823, 0.2611922622, 0.2404793948, 0.28465873, 0.0044922903, -0.3045014143, -0.0507764518, -0.0870601833, 0.1580364555, 0.0261008702, -0.0540096462, -0.5192807913, 0.1436507404, -0.1828612387, 0.205690071, 0.1607749164, -0.1145812869, -0.0355271138, -0.1985423714, -0.1444986165, 0.1064961851, 0.1165488735, 0.2339962572, -0.0426433086, 0.420055747, -0.3301746845, -0.0878037214, 0.2840037346, -0.1189453974, -0.1438233852, -0.0291913282, 0.1371344179, 0.2747970223, -0.1208779886, -0.5332907438, 0.1804150492, 0.4839943945, -0.3293746412, -0.19500646, 0.0920221508, 0.0073720478, -0.0753995925, -0.1456325054, 0.5694738626, 0.1046596467, -0.1223840714, 0.1178272516, -0.3137854636 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
I have another question. Assuming that I understood correctly and there is reuse of datasets files when caching is disabled (!), I'm guessing there is a directory that is created based on some information on the dataset file. I'm interested in the situation where I'm loading a (custom) dataset from local disk. What information is used to create the directory/filenames where the files are stored? I'm concerned about the following scenario: if I have a file, let's say `train.csv` at path `the_path`, run once, the dataset is prepared, some models are run, etc. Now let's say there is an issue and I recreate `train.csv` at the same path `the_path`. Is there enough information in the temporary name/hash to *not* reload the *old* prepared dataset (e.g., timestamp of the file)? Or is it going to reload the *old* prepared file?
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
139
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! I have another question. Assuming that I understood correctly and there is reuse of datasets files when caching is disabled (!), I'm guessing there is a directory that is created based on some information on the dataset file. I'm interested in the situation where I'm loading a (custom) dataset from local disk. What information is used to create the directory/filenames where the files are stored? I'm concerned about the following scenario: if I have a file, let's say `train.csv` at path `the_path`, run once, the dataset is prepared, some models are run, etc. Now let's say there is an issue and I recreate `train.csv` at the same path `the_path`. Is there enough information in the temporary name/hash to *not* reload the *old* prepared dataset (e.g., timestamp of the file)? Or is it going to reload the *old* prepared file?
[ 0.0396143645, 0.1744788885, -0.1220533699, 0.3688907027, 0.1228984892, 0.0972480848, 0.3478939831, -0.0435184911, 0.1747946143, -0.1183368042, 0.0815540478, -0.0739898607, -0.0967105553, -0.1997421682, 0.1834368408, 0.4033865333, 0.2352864891, 0.0705638677, -0.1633930206, -0.211226061, -0.2158202529, -0.1136623472, 0.0287037492, 0.0257109776, -0.4653141201, -0.0532944277, -0.1611276567, 0.3412357271, 0.0454520211, -0.5218763947, 0.1373794675, 0.3655673563, 0.2634640336, 0.3919077814, -0.0001192328, 0.0900887251, 0.0751683265, -0.2078174949, -0.4899332821, -0.2357727885, -0.6089841127, -0.3132253289, 0.1052273586, -0.2591816783, 0.1430511028, -0.279746592, 0.196119383, -0.5753272772, 0.3598961234, 0.2168545276, 0.1316117048, -0.3067778945, -0.4450259805, 0.1514535993, 0.1042250395, 0.3387689888, -0.005234465, 0.0961136222, 0.1016790718, -0.0347758308, -0.0932450145, 0.0784427524, 0.0769728869, 0.0982002169, 0.5855482221, 0.1981261671, -0.1865918338, -0.1474260539, 0.1589406133, 0.0758654326, 0.8340938687, -0.3309269547, -0.4406977892, -0.3639884889, -0.0403450131, -0.0652807802, 0.3427960277, 0.0169863254, -0.0998441279, 0.103683956, -0.3586763144, -0.306771636, -0.1540293694, -0.1644049585, 0.1403195262, -0.1747606695, -0.2014998049, 0.0858064517, -0.1667189151, 0.0152184051, 0.4679965377, -0.6780712605, 0.1247474104, 0.3843236268, -0.1037429273, 0.0395145193, 0.0338588357, 0.4278026521, -0.1384792477, -0.0401634276, 0.3203819096, -0.087988466, -0.238732174, 0.1491918564, 0.3794379234, 0.1677573621, -0.027519457, 0.0827717632, 0.1578303427, -0.140179038, -0.261226356, -0.2612175643, -0.2172831297, -0.2086577863, 0.4720522761, -0.0031833909, 0.1987894028, -0.221971482, 0.0133670121, 0.0747105032, 0.0689273328, -0.1600148976, 0.0717229843, 0.163265422, -0.1020665914, -0.0446860865, -0.300752759, -0.1975359023, -0.0810197815, 0.0348191597, -0.1088869572, -0.2815069556, -0.3479227424, 0.0796192065, 0.2255407572, -0.2305429876, 0.203510657, 0.2208004296, -0.1127788275, -0.1163147315, 0.0974739119, -0.0763824433, 0.3487942517, 0.4564614594, -0.2026845217, 0.1994196475, 0.0794385374, -0.1199774891, -0.2430880815, 0.3181140125, -0.5094612241, -0.4343142509, 0.1935460567, 0.0951597691, -0.2897160053, 0.1831616312, -0.0094209276, -0.1164966375, 0.276157558, -0.0150650218, 0.1290667951, -0.1315946579, -0.1630369723, -0.3629796803, 0.0344611108, 0.5511757135, -0.7481015921, 0.0441922173, -0.0422224849, -0.1912372708, -0.2221765518, 0.3882532418, -0.4213086665, 0.2873208821, -0.2788358331, -0.0958223343, 0.3518694043, -0.1698625386, -0.1403253973, 0.0512459762, 0.0592427328, 0.2768937647, 0.1626453251, 0.274951309, -0.2181055695, -0.1565300822, -0.0365644731, 0.0067198277, -0.1402031332, -0.256018281, -0.0517064184, -0.0527876541, 0.0278318673, -0.147836104, -0.1344295889, 0.2383817136, 0.1785307825, -0.0397026688, 0.0203975514, 0.0235948227, 0.0684598833, 0.4347872138, 0.0913381651, 0.2837566435, 0.2616577148, 0.2461800724, -0.6048412323, 0.3834660649, -0.024956625, -0.5644059777, -0.1697786152, -0.2210452259, -0.1049436033, -0.0595596693, -0.3477903903, -0.0204884633, -0.0005915835, 0.2033090293, 0.1174132228, -0.1571398377, -0.331916362, 0.2712095976, -0.4437338114, -0.0700598061, -0.2444702238, -0.0145349354, -0.0495777056, 0.1621654034, -0.3741002679, 0.13648808, 0.0358713642, -0.1138861626, 0.0252654701, 0.4073792696, 0.1449670196, 0.5493706465, 0.2449403703, 0.5470479727, -0.021965459, 0.2867168784, 0.4552435279, -0.2784742713, 0.2444138825, -0.0584341697, -0.3102048039, 0.37250337, -0.5067825913, 0.1116782948, 0.0574622452, -0.4737315774, 0.2037764192, -0.0038112625, 0.0048186928, -0.1751119196, -0.0792366117, 0.2939701974, 0.390752852, 0.3153142631, -0.0746994168, 0.0330108181, 0.231861949, -0.100525111, -0.2088131458, -0.0361083113, -0.1767389178, -0.3452966809, 0.0123530235, 0.5395863056, 0.5537015796, 0.0178911984, 0.3181603253, -0.0884639621, -0.0170324165, -0.2547694147, 0.0898672193, -0.1171047688, -0.1454312205, 0.3790723383, -0.0249047615, -0.0418302976, -0.2419884503, 0.0240633637, 0.277297765, 0.0776956528, -0.2950510979, 0.2372206151, -0.1157868952, -0.1908862591, -0.2870164216, 0.1896912009, -0.0941098928, -0.1602422893, -0.0233613886, 0.0946947634, 0.0126698315, 0.0027123764, -0.1074912548, 0.3336410522, -0.1697275192, -0.1477844864, -0.1375890523, -0.2733898163, -0.0900295004, 0.0388461798, 0.1775084883, -0.1694715172, 0.0805361867, -0.085905306, 0.0763437003, -0.403863281, 0.2571550608, -0.0204168577, 0.0533887632, 0.247094363, -0.1725021452, 0.0728256181, 0.0072485581, 0.0569076687, 0.0198909789, 0.0912603363, -0.0118352063, -0.2892059088, 0.1912010163, 0.0224022232, -0.0786830708, -0.1699851304, -0.3214594722, 0.0282162726, 0.0466777235, 0.086300917, 0.0366170742, 0.4797013402, -0.1061564013, -0.007357046, -0.0287067145, 0.0170080923, -0.3930698633, -0.7377173901, 0.1330611557, -0.1119260341, 0.0786110014, 0.0585448593, -0.0297632068, 0.1121718735, 0.3737277389, -0.5044367909, -0.1825036556, 0.2108901143, 0.2946908772, 0.102655232, -0.0055986959, 0.3985085189, 0.0343540944, -0.0381633714, -0.2396538705, 0.1046173722, 0.0721840784, 0.0567213297, 0.2137649953, 0.1187242121, -0.0438154824, -0.1013191193, 1.05613029, 0.0656622797, -0.0950503871, 0.1984088421, 0.0055847745, 0.7749565244, -0.0111273453, 0.0602477267, -0.2000258416, -0.1283794641, -0.564475894, 0.1442536861, 0.1790537387, 0.1041956618, 0.080392316, 0.3580324054, -0.3325112164, -0.2472895384, 0.2445428222, -0.384909153, 0.4336819351, 0.1737385988, -0.2445267588, -0.212298885, -0.1468063891, -0.1929410696, 0.2209748626, 0.3969125152, -0.1111952811, -0.3127847016, -0.074049443, 0.0500066504, -0.0133442655, 0.2047040164, 0.2459461093, -0.090571478, 0.0419184789, 0.156848073, 0.1857423186, 0.3920872509, -0.4064939022, 0.0583010167, 0.2035023272, 0.0753716975, 0.0133510977, -0.0592623726, 0.0275282115, 0.1789465696, -0.2179644555, 0.2962106168, 0.3291772604, -0.2602209151, -0.2999028862, 0.4384304285, -0.3279013038, -0.022532016, -0.1101692095, 0.0909692645, 0.0019617155, -0.257727772, -0.2456550896, -0.3908722699, -0.1066592038, 0.1209404618, -0.1705134958, 0.1837505549, 0.0841671303, 0.0840810537, 0.2590395212, 0.0627165586, 0.0964842588, 0.4471680522, 0.0360600874, 0.4149878919, 0.4983242452, -0.4157919884, 0.0295081269, -0.0692333505, 0.0756575316, 0.0925726742, 0.4459819496, -0.2754131258, -0.0583276115, 0.0116504766, -0.3149539232, -0.557251811, 0.1016679108, 0.2380485833, 0.1453147978, -0.2457349598, -0.7298759222, 0.4616045356, 0.0442893058, -0.4533217549, 0.1364472657, -0.0430614427, -0.4334996343, 0.0092922933, 0.0433704481, 0.7851685882, -0.1377717853, 0.3983212411, -0.2703846097, 0.0335514471, 0.2256230116, -0.3931548297, -0.0027613882, -0.1618188322, -0.1194539145, -0.2122358829, -0.1050596461, 0.400674969, 0.4143879116, 0.2862844467, 0.4097852707, -0.0912252963, 0.4684944749, -0.1631308347, 0.103557758, -0.1008994207, -0.0715284646, 0.1278519034, 0.0950081721, 0.2018303722, 0.2626237571, -0.131626308, 0.265770793, 0.102904126, 0.2221250385, -0.0917192101, -0.2430610806, -0.1948890984, 0.3112288713, -0.3205519617, -0.4092468023, -0.2275765985, 0.444506526, 0.3319454193, -0.049968373, -0.0220466834, 0.3189424574, 0.0405942351, 0.2928320467, -0.2071424276, -0.0023626871, 0.2992728353, 0.2187444121, 0.0425272286, -0.0308257118, -0.3231317401, -0.0653744191, -0.2003769726, 0.2053970098, 0.2990845442, -0.4685588777, -0.2136060596, 0.0552728884, -0.0002944171, 0.1352767348, 0.0712407231, 0.1472806633, 0.2007041276, 0.2619281709, -0.39043805, -0.2276106179, -0.0714145303, 0.3039794564, 0.3663796186, -0.1873265803, 0.4460787177, -0.5390529633, -0.1543508172, -0.1125842705, 0.2306241095, -0.0064290687, -0.070281744, 0.1091835648, 0.1758557558, 0.2060983181, 0.001550436, 0.0645848066, 0.2470372021, 0.0373875201, -0.2635701001, -0.1857194602, -0.179227829, 0.0767906755, 0.2825475931, 0.5055933595, 0.0497811437, -0.326533258, -0.0195431858, -0.0959003717, -0.2332862616, 0.1494161636, -0.0492361635, 0.3271294236, 0.0763108283, 0.1545308977, 0.157922864, -0.3071279526, -0.0096325986, -0.281121552, -0.2304946482, -0.1399681121, 0.0323976949, 0.1811801493, 0.0003291555, -0.1888404191, -0.1868031621, -0.4582820237, 0.1054102406, -0.1665193588, 0.0591926277, 0.3447112441, 0.1310679615, 0.2091640681, 0.1343014538, 0.1419611424, -0.0352531821, 0.1301223636, -0.1393747628, 0.4549193978, 0.257846117, 0.1962607205, -0.3528994322, 0.023394458, -0.3583089113, 0.2972155213, 0.0489134267, -0.0411171094, 0.1730859876, -0.0618499368, 0.1825910509, 0.1147224903, 0.3548699021, 0.4522509575, -0.183212921, -0.3053300381, 0.323887825, 0.0878389552, -0.0550883412, -0.1283649504, 0.0072762035, 0.0875581503, -0.1063701883, 0.2416779399, 0.4929352999, -0.0420583859, 0.1961424053, -0.1603520513, 0.4638435543, -0.2952373624, 0.2642432153, 0.2453196049, 0.1432918012, 0.0542680211, 0.2146518677, 0.4828643799, 0.1201801747, 0.7716600299, -0.0163878426, 0.2793603837, 0.373804152, 0.2739771605, -0.2553505003, -0.6836416721, 0.290790081, 0.3437065482, -0.4014594555, 0.2547963262, -0.0376695618, 0.159791261, -0.1283017397, 0.1722544134, 0.0633052588, 0.160260886, -0.169529438, -0.4084585309, 0.2957372069, -0.39433828, 0.187686637, 0.1556519866, -0.0171741452, -0.0185813121, 0.0033889301, -0.0121167041, 0.1542952061, -0.1750787348, 0.4936146438, 0.118883118, 0.1785251945, -0.155194059, 0.1975997835, 0.2845062613, 0.0919047967, 0.2843462229, 0.0773596913, 0.2557860613, 0.1358575672, 0.0959458798, 0.1754264534, -0.0277322251, 0.010246262, -0.095482707, 0.1879787147, -0.1585475504, -0.1055002436, 0.1334711611, 0.1134379208, 0.0749186799, 0.2434408069, 0.0278371684, 0.1547424793, -0.2178727388, 0.0431209728, 0.1784567535, 0.0230480433, 0.0505613163, 0.2182838023, -0.179952383, -0.2894683182, 0.5751606226, 0.0298291594, 0.2406538427, 0.041693233, 0.0304982141, -0.1033739597, 0.3388955593, 0.2730052769, -0.0102564953, -0.2040198445, -0.1510638148, -0.5926516652, -0.1760674715, -0.1478042603, 0.1158549562, -0.1470405906, 0.1717143208, -0.0730913281, -0.0551586896, -0.0662261024, -0.1378733814, -0.1780124903, 0.0832471326, -0.0565333962, -0.3101803064, -0.3974451125, 0.0148077663, -0.1445539445, -0.4541033506, -0.0841968507, -0.095491603, -0.1085955799, 0.0121787414, -0.057054989, 0.1640078425, 0.376121372, 0.4088757634, -0.0518200882, 0.0744907483, 0.2234588116, 0.0243088901, -0.2947927117, -0.305948019, -0.0678382441, 0.2062371671, 0.032858558, -0.0975557789, -0.6697199345, 0.1179776639, -0.183128804, -0.142672047, -0.0076595768, -0.0265188701, -0.0208757147, -0.2445759177, -0.1177628562, 0.2600581348, 0.2057586163, 0.3443103433, 0.0408314243, 0.2696210146, -0.1667967439, 0.0884368271, 0.4007049799, -0.0664077401, -0.1173946485, 0.0312732831, 0.2196317017, -0.0166659355, -0.1236058772, -0.4434627891, 0.1094239354, 0.6644130349, -0.2521066368, -0.0318181366, -0.1384457946, -0.057436958, 0.0404932797, -0.1720846742, 0.1647001952, 0.0435861945, -0.1685228944, 0.0237752944, -0.2692071199 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
Thanks for the feedback, we'll work in improving this aspect of the documentation. > Where are these files stored? I guess not in the temporary directory that is removed... We're using the Arrow file format to load datasets. Therefore each time you load a dataset, it is prepared as an arrow file on your disk. By default the file is located in the ~/.cache/huggingface/datasets/<dataset_name>/<config_id>/<version> directory. > What information is used to create the directory/filenames where the files are stored? The config_id contains a hash that takes into account: - the dataset loader used and its source code (e.g. the "csv" loader) - the arguments passed to the loader (e.g. the csv delimiter) - metadata of the local data files if any (e.g. their timestamps) > I'm concerned about the following scenario: if I have a file, let's say train.csv at path the_path, run once, the dataset is prepared, some models are run, etc. Now let's say there is an issue and I recreate train.csv at the same path the_path. Is there enough information in the temporary name/hash to not reload the old prepared dataset (e.g., timestamp of the file)? Or is it going to reload the old prepared file? Yes the timestamp of the local csv file is taken into account. If you edit your csv file, the config_id will change and loading the dataset will create a new arrow file.
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
231
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! Thanks for the feedback, we'll work in improving this aspect of the documentation. > Where are these files stored? I guess not in the temporary directory that is removed... We're using the Arrow file format to load datasets. Therefore each time you load a dataset, it is prepared as an arrow file on your disk. By default the file is located in the ~/.cache/huggingface/datasets/<dataset_name>/<config_id>/<version> directory. > What information is used to create the directory/filenames where the files are stored? The config_id contains a hash that takes into account: - the dataset loader used and its source code (e.g. the "csv" loader) - the arguments passed to the loader (e.g. the csv delimiter) - metadata of the local data files if any (e.g. their timestamps) > I'm concerned about the following scenario: if I have a file, let's say train.csv at path the_path, run once, the dataset is prepared, some models are run, etc. Now let's say there is an issue and I recreate train.csv at the same path the_path. Is there enough information in the temporary name/hash to not reload the old prepared dataset (e.g., timestamp of the file)? Or is it going to reload the old prepared file? Yes the timestamp of the local csv file is taken into account. If you edit your csv file, the config_id will change and loading the dataset will create a new arrow file.
[ 0.0426525846, 0.1128463149, -0.0747743696, 0.365113616, 0.187513411, 0.1657913178, 0.3618485928, -0.0763978586, 0.1920936704, -0.145717442, 0.1244351119, 0.0901361406, -0.2694363296, -0.1203824878, 0.0926408321, 0.3132812679, 0.1218126118, 0.0018567778, -0.2674067616, -0.0612731986, -0.0238489583, 0.0139037017, -0.0476133451, 0.0775938183, -0.5502688289, -0.1778061241, -0.02847993, 0.1388771087, -0.0422449037, -0.5476480722, 0.4293835163, 0.2526208162, 0.1022149995, 0.443146795, -0.0001136524, 0.156430155, 0.1653490067, -0.0595049784, -0.3835012913, -0.0884683281, -0.4759690464, -0.2783874869, 0.2284000516, -0.1791341901, 0.0559506565, -0.1754128188, 0.0664181858, -0.7208994031, 0.4306548834, 0.3034112751, 0.2095776796, -0.1128292084, -0.3428084254, 0.166926831, 0.1212247014, 0.1176116019, -0.0647920221, 0.0958378017, 0.017120285, 0.0299993232, -0.1908133328, 0.3489201367, 0.0284838676, 0.0995284095, 0.6798652411, 0.1164379269, -0.3021634519, -0.2816373408, 0.1710203588, -0.0168926287, 0.8757189512, -0.3772921264, -0.3937723041, -0.4215784073, -0.0722441152, -0.291063875, 0.3705023527, -0.0349942967, 0.0338181295, 0.1965863407, -0.4137373269, -0.2978315949, -0.1873835921, -0.1798489839, -0.0950306207, -0.2104988694, -0.3281469047, 0.0431771576, 0.0529060587, 0.0894156024, 0.3412466645, -0.479688555, 0.0544820391, 0.3145649433, -0.3024859428, 0.0585056841, 0.0669264272, 0.3536749184, -0.1032309979, 0.1801583171, 0.3130632043, -0.0729676113, -0.2701880038, 0.1462640464, 0.3341297507, 0.3940932751, -0.0065452941, 0.0667707697, 0.2119108588, -0.1026699394, -0.1689469516, -0.285612762, -0.0797218233, -0.4382008612, 0.3683880866, 0.0000185017, 0.1821172237, -0.2402317077, -0.0969628617, 0.076255098, 0.0647128373, -0.1605027169, 0.2484935075, 0.1427244395, -0.0343201011, 0.0168877039, -0.1806506813, -0.1179086268, -0.1633678079, -0.0465737209, -0.1743832082, -0.1365134269, -0.3817651868, 0.1212827936, 0.2318616807, -0.2882328033, 0.1728552878, 0.2895810604, 0.1174066067, -0.1914012134, 0.1421866864, -0.0995831788, 0.3003717065, 0.3959776163, -0.365952611, 0.2547308803, 0.2532998025, 0.0470307022, -0.2382894754, 0.2351589799, -0.5508418083, -0.5308258533, 0.1095277667, 0.1173827648, -0.4187036753, -0.0184017159, -0.2455900609, -0.115626961, 0.3187912703, 0.0624009073, 0.2418776006, -0.2037985921, -0.1772338003, -0.3270474672, 0.0544245467, 0.5265337229, -0.6201188564, 0.0139230266, -0.101362139, -0.0569785349, -0.0566182807, 0.4388077259, -0.56444031, 0.2282956094, -0.2668420672, -0.0418813974, 0.2101626694, -0.2359635234, -0.2370518744, 0.0387333855, 0.0486462191, 0.3653501868, 0.1788058281, 0.0664747059, 0.0901675895, -0.1360751241, -0.038385652, -0.0327421464, 0.092536822, -0.2657948136, -0.1053951085, -0.2953510582, 0.0831989199, -0.210325405, -0.0497051328, -0.0136602782, 0.0565378964, -0.1861412674, -0.0096124373, -0.1338642538, 0.0811728835, 0.4035138488, 0.0486799143, 0.2840649486, 0.0954662487, 0.2152553499, -0.526791811, 0.4233044386, 0.1852604747, -0.4941209257, -0.2006006092, -0.2615773082, -0.0718733892, -0.0862333402, -0.4411373436, -0.1706931591, 0.0341379121, 0.0446688794, 0.115993917, -0.0514422879, -0.3322879374, 0.4101413786, -0.4049243331, -0.0417119972, -0.3104242682, 0.0845004916, 0.0234980416, 0.2354419231, -0.3102504909, 0.1405351162, 0.0299963895, -0.0629900247, 0.0427046977, 0.36036098, 0.1344786286, 0.4914349318, 0.1914766431, 0.5197808743, 0.0840325952, -0.0144382939, 0.3538704216, -0.1910291016, 0.116537869, 0.0307786316, -0.3368672729, 0.3540523052, -0.3387059271, 0.1638697386, -0.0121468008, -0.2903887928, 0.1131074727, 0.0169304386, -0.0755762607, -0.0768134892, -0.0301898308, 0.098509416, 0.2543655038, 0.4224380553, -0.2281020731, 0.1754334569, 0.3237637877, -0.0215610936, -0.2616907358, 0.0235326272, -0.1400743425, -0.2476536334, 0.1388082057, 0.480047524, 0.501401484, 0.1201579645, 0.2383860946, -0.0533891618, 0.0216731541, -0.2430943847, 0.2449923754, -0.0331890211, 0.0830228031, 0.190886423, -0.0131334066, 0.0383751877, -0.2990604043, -0.02897802, 0.1093658209, 0.0501198769, -0.4698911905, 0.3693457842, -0.3929539323, -0.0820747912, -0.3823749721, 0.0865268111, -0.2276220918, -0.2523645163, -0.0142978346, 0.002053872, 0.0541891009, 0.0533840954, -0.2774981856, 0.4074819386, -0.1261828244, -0.0919074193, -0.1295308769, -0.1039873511, -0.1594326347, 0.0164019391, 0.2174411267, -0.1975783557, 0.0960610434, -0.0307020806, 0.083879292, -0.3365895748, 0.1275616139, 0.0149003631, 0.0186425298, 0.2037234455, -0.1277352124, 0.0353868045, -0.1253303885, -0.0770096853, -0.1005405486, 0.0471429601, 0.0399332568, -0.181961149, 0.1469052732, 0.1284315884, -0.1161592081, -0.2377019227, -0.319260478, -0.132194519, 0.0855249465, 0.0390008092, 0.0027543008, 0.5872470737, -0.0016310997, 0.1230577379, -0.0244505722, 0.0663002059, -0.441637069, -0.6039818525, 0.3160151839, -0.1407756954, -0.0384189449, 0.1388535798, 0.0660286546, 0.2734754682, 0.1964792907, -0.623899579, -0.1205819845, -0.0345269442, 0.1573714167, 0.116235964, 0.070072487, 0.3097384274, 0.0374814346, -0.0466115437, -0.150801912, 0.002990827, 0.0816947892, -0.0783290341, 0.2549777627, 0.1132202521, -0.0473795496, 0.0169873089, 1.1582585573, 0.2377632856, -0.0377979912, 0.0956421643, 0.0073742084, 0.7471948862, -0.0396336727, -0.0848497897, -0.0874113739, -0.2571051717, -0.4753899574, 0.0898686647, 0.1911810189, 0.1373715997, 0.1831169277, 0.3430120349, -0.1310903579, -0.3341440558, 0.3024997711, -0.4036667645, 0.317687571, 0.0099280849, -0.0714738965, -0.2217428237, -0.0479292274, -0.1426384151, 0.3482539654, 0.3176628649, 0.0198276974, -0.1918479502, -0.166828692, -0.2231999487, 0.0548331887, -0.0498774461, 0.1097148508, -0.1733342856, 0.1313460171, 0.2701213956, 0.1460508406, 0.4943933487, -0.2504500151, -0.0759189427, 0.1707908213, 0.0724022985, -0.0138058588, -0.1366952062, 0.079468675, 0.2714105248, -0.0392793566, 0.1366447955, 0.2243174911, -0.2971726954, -0.1961429864, 0.2696307003, -0.2419204265, -0.0527350269, -0.1840975434, -0.0568297207, -0.0981642604, -0.1347902715, 0.0195164382, -0.2873508334, -0.2387717664, 0.0516468436, -0.1101531312, 0.0859106556, 0.1384114027, 0.0411048755, 0.377422601, 0.1493370235, -0.0511115156, 0.6349806786, 0.0398977697, 0.3729884923, 0.5501743555, -0.1853516549, -0.0917053148, -0.0443245396, -0.0234642066, 0.1364945173, 0.4127083719, -0.4581154883, 0.0470287688, 0.0467637815, -0.2780453563, -0.3946864009, -0.0761092752, 0.3407285511, 0.2532002032, -0.148525238, -0.6971560121, 0.5179474354, 0.2509444058, -0.2987611294, 0.2439561188, 0.0462421514, -0.410771817, -0.0370484218, 0.1446021795, 0.7890865803, -0.0115419738, 0.3534283042, -0.0712907687, -0.0696338266, 0.3899292946, -0.3019839525, 0.1157951057, -0.0856980085, -0.0856730789, -0.2145991176, -0.1433059722, 0.3582906425, 0.2706645131, 0.0100118071, 0.330850482, -0.2380571961, 0.2818346024, -0.2557391226, 0.0498597696, -0.0701774806, -0.1189830005, -0.0440062322, 0.146925047, 0.1189133674, 0.2945709527, -0.1537288725, 0.1041402519, 0.1377117634, 0.1940724552, -0.2254682481, -0.2816456556, -0.2321240008, 0.3175227046, -0.1013314426, -0.4438728094, 0.149494037, 0.4084867835, 0.201410681, -0.1299446225, -0.1075018868, 0.2657449245, 0.1492578685, 0.1895851791, -0.1285014749, -0.1794522405, 0.3612166941, 0.1541674882, -0.0561230034, 0.0460045412, -0.2187591493, -0.2864953279, 0.1323193014, 0.2304902375, 0.1065842211, -0.4199062288, -0.1353828013, 0.1652852595, 0.0821547508, 0.1623176634, 0.1254360825, 0.1747613102, 0.1839181036, 0.3437950015, -0.3938897252, -0.2065218985, -0.0358069465, 0.198530376, 0.2643137574, -0.170211494, 0.4318951368, -0.2670844793, -0.3354785144, -0.0778515711, 0.1133332476, 0.0880199224, -0.2367675304, 0.0549246967, 0.1126625836, 0.3235096335, -0.018843418, 0.0040830234, 0.2732169628, 0.0082894629, -0.361333847, -0.2348080873, -0.2408817112, 0.0922416449, 0.0175373275, 0.4436582923, -0.0335395299, -0.2856042087, 0.0626606718, -0.1526920646, -0.2890157402, 0.1619472802, -0.0786772147, 0.0942883193, 0.2255491614, 0.0305918008, 0.2534172535, -0.3031986952, -0.0509900488, -0.2666363716, -0.3077822626, -0.1608226597, 0.0104609504, 0.1589038521, -0.1022019535, -0.2055811733, -0.0441843569, -0.3034946024, 0.0315058082, -0.1685610265, 0.1219394058, 0.3316379786, 0.0964755788, 0.0860093534, -0.2051965892, 0.0163834728, -0.0808413476, 0.0041204179, 0.0177730471, 0.3359734118, 0.3906491399, 0.2816236615, -0.2716906369, 0.0024271235, -0.2317796946, 0.301543206, -0.0651258677, 0.1148612797, 0.1655113101, -0.2863472998, 0.1028353721, 0.1991580427, 0.3281066716, 0.3717805147, -0.264942944, -0.2294768691, 0.135725826, 0.1309859753, -0.0262096673, -0.2149589211, 0.0542247146, 0.1898081005, -0.1325534284, 0.258515954, 0.5278129578, -0.0127963275, 0.2924178541, 0.0566800125, 0.4073824883, -0.2825933695, 0.3838897943, 0.1359542906, 0.0083707348, 0.0159260239, 0.4383997917, 0.486839354, 0.2224417776, 0.6142735481, -0.0598109066, 0.182141602, 0.4852378368, 0.1930831373, -0.3621422946, -0.7948087454, 0.1853653193, 0.290217638, -0.3958208263, 0.1470619589, -0.008745037, 0.3306697905, -0.1507888287, -0.0326177776, -0.0210000686, 0.2075011432, -0.2223577201, -0.18779248, 0.3327510655, -0.3243265748, 0.138526842, 0.1337723732, -0.0966906473, -0.0753628016, 0.1147796288, -0.1287963837, -0.0892727524, -0.2601791024, 0.4980160296, 0.0721449256, 0.3708713949, -0.09352272, 0.2920444906, 0.0470706299, 0.0807700157, 0.1934072226, 0.1907142997, 0.4301682711, 0.0948305428, 0.2269955426, 0.0762031004, -0.0022000689, 0.0119244903, -0.0995879397, 0.1971945763, -0.1713887453, -0.1878995895, 0.1820631921, 0.1363785714, 0.019427076, 0.163291961, -0.0603631586, 0.1767079681, -0.3804505467, -0.0838849992, 0.2030137032, -0.0060397163, -0.0172501784, 0.1702435613, -0.285362184, -0.2765757442, 0.7414011359, 0.0565528385, 0.2432409525, -0.0573856793, 0.070983775, 0.0523097552, 0.4304019809, 0.2606304586, 0.1481002718, -0.1230069175, -0.028808251, -0.7707130909, -0.1841090024, -0.1568198949, 0.1471705437, 0.0206824578, 0.1961889863, -0.0730562508, 0.0521332882, 0.1274417937, -0.216012001, -0.0182248242, -0.1002861857, -0.0264580585, -0.0534798205, -0.131911546, 0.0254153889, -0.139377445, -0.2766144276, 0.0604266338, -0.0223570839, -0.0560374521, 0.0712020695, 0.0394560397, 0.0316877663, 0.1538895369, 0.4297095239, 0.0328069776, 0.1282012165, 0.3001411557, 0.0915507525, -0.3685916364, -0.1902424246, -0.1202826127, 0.164109543, -0.0257250145, -0.0122081302, -0.6058148146, 0.0169119574, -0.3258047402, 0.0379633792, 0.1219577789, -0.1550286263, -0.003743317, -0.1074890271, -0.1270573586, 0.2228341699, 0.1746292114, 0.3728478551, -0.0318344049, 0.2100907266, -0.2636838555, -0.0118858181, 0.4197933972, -0.2700088024, -0.1785032749, 0.144635275, 0.189906016, 0.2657698393, -0.117907621, -0.6296890974, 0.1073625833, 0.5160405636, -0.2359796762, -0.1337091029, -0.0295839012, -0.0820798576, 0.0360578597, -0.1067573577, 0.3352450132, -0.0085471822, -0.0522507913, 0.0372901931, -0.3499302864 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
Thank you for all your clarifications, really helpful! If you have the bandwidth, please do revisit the api wrt cache disabling. Anywhere in the computer stack (hardware included) where you disable the cache, one assumes there is no caching that happens.
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
41
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! Thank you for all your clarifications, really helpful! If you have the bandwidth, please do revisit the api wrt cache disabling. Anywhere in the computer stack (hardware included) where you disable the cache, one assumes there is no caching that happens.
[ -0.0806551501, -0.0190927833, -0.078458786, 0.1829437017, 0.2073648125, 0.2329126894, 0.1717560589, 0.012628315, 0.2039586902, -0.1684736311, 0.1043679267, 0.065179415, -0.1479162574, -0.0486047231, -0.0459726714, 0.4469535351, 0.1602656543, 0.1373855323, -0.1307974458, -0.0402543284, -0.0730124712, -0.0087378472, -0.2274748236, 0.1030512378, -0.5465353131, -0.1996646523, 0.0297566578, -0.0258189924, -0.0539498702, -0.4566875994, 0.4985801578, 0.1906563193, 0.1309053153, 0.2862367034, -0.0001159255, 0.002849713, 0.1477109194, 0.007445246, -0.2455655634, 0.1221066713, -0.552272737, -0.3764939308, 0.2959465981, -0.0734486282, -0.0296689011, -0.2271425873, 0.080321297, -0.6296420693, 0.4789685011, 0.3128569722, 0.2188513279, -0.0277703404, -0.3452480435, 0.1580727994, -0.0628928542, -0.0262001306, -0.1437475085, -0.0680623204, 0.2651391625, -0.1496256441, -0.0544327945, 0.354188621, -0.0805522278, 0.4096235335, 0.5019235611, 0.0515010096, -0.3145155013, -0.3835272789, 0.3074744344, 0.0309551675, 0.9555871487, -0.2958949208, -0.151022613, -0.3201631308, -0.0614939444, -0.252204895, 0.2153981179, -0.0423636883, 0.0364881158, 0.2256951928, -0.5020578504, -0.2865839005, -0.0761594474, -0.1078196689, -0.234030202, 0.0283328239, -0.2219642103, 0.0796208605, -0.1803814024, -0.0442372672, 0.4569607377, -0.4619448185, -0.0086367689, 0.1626581848, -0.5250945091, -0.1069000512, 0.1738810837, 0.4802710414, -0.1630520821, 0.1826247126, 0.0631818622, 0.0179973114, -0.0638798401, 0.0455496646, 0.4424835443, 0.2882964015, 0.0465801843, 0.0637087971, 0.1841564327, -0.2733980417, -0.1512683779, -0.1937049329, 0.1448384523, -0.3180257678, 0.5594483018, -0.0312633403, 0.3589951396, -0.3831408024, -0.3112590909, 0.0587369613, -0.0189178586, -0.1682015955, 0.0525003597, 0.1131048948, -0.065681383, -0.0090200603, -0.1372023672, -0.0024412069, -0.2364444137, -0.2604893148, -0.2496361732, -0.1963602006, -0.248480767, 0.0164702721, 0.2276222408, -0.1754541993, -0.0450236872, 0.3477349281, 0.1634491533, -0.2184279561, 0.1509353518, 0.0006865971, 0.2434150875, 0.3030890226, -0.2945021987, 0.3164535165, 0.4273716211, 0.0003931075, -0.1998231113, 0.4188991785, -0.4340384901, -0.4555511177, 0.0640677884, 0.1314563453, -0.4850305915, -0.2716364264, -0.1847331226, -0.0189423859, 0.408110261, -0.0017416403, 0.154374063, -0.1329515576, -0.2522608638, -0.2450331151, -0.0040234178, 0.3853208423, -0.6156473756, 0.0083778203, -0.2004258186, -0.0571061485, 0.1146912575, 0.3705384433, -0.4463196695, 0.1517273039, -0.1681307554, -0.1725257784, 0.1848117411, -0.1718282998, -0.5081837773, 0.217671901, 0.2019000351, 0.3354841173, -0.0228350684, 0.0741344094, 0.1265327185, 0.0012816228, -0.0319760256, -0.0523547567, 0.0951999128, -0.2044351101, -0.2159063518, -0.4232361317, 0.267224282, -0.1377510875, 0.0715650767, 0.1494500488, -0.0501817018, -0.1708873212, 0.0718721747, -0.0569424778, 0.0981404558, 0.1958925277, 0.1950850785, 0.0945542902, 0.1072173864, 0.0522581786, -0.4603856504, 0.3345038295, 0.1416353881, -0.366876781, -0.0786484033, -0.2039871216, -0.1024146825, -0.1082033515, -0.4313137531, -0.074234724, 0.0494786985, -0.052950196, 0.003721267, -0.0723170787, -0.2836417556, 0.413551569, -0.3291512132, -0.1031678617, -0.1165905446, 0.210801959, 0.0391821489, 0.1926306933, -0.2228363007, 0.1413664967, 0.0376593843, 0.186634779, 0.0262458064, 0.138447687, 0.0425360128, 0.3538771272, 0.0919528157, 0.3583667874, 0.0069249626, -0.0616684482, 0.3143140674, 0.0478436053, 0.2054934502, -0.0972664803, -0.1094151884, 0.2266595662, -0.1106719524, 0.1286314726, -0.2301411778, -0.1533770859, 0.1183972582, -0.0293302536, 0.056472607, -0.1460094452, -0.0302138813, 0.0089362748, -0.0356499664, 0.3004310131, -0.1030885875, 0.1872985065, 0.3256934285, 0.0171539932, 0.0325149372, 0.0430144109, -0.1350598633, -0.3747719228, 0.1514116973, 0.3989090323, 0.5773317814, 0.1253364682, 0.1422914565, 0.057608366, 0.0563106723, -0.1647052616, 0.3104420006, -0.0427398458, -0.0521650873, 0.0985174179, 0.0859911591, -0.1160693169, -0.3053373992, 0.0906661972, 0.2317035794, 0.2590827346, -0.5257884264, 0.2281613648, -0.5218100548, -0.1893332601, -0.1227463931, 0.014578741, -0.3121325076, -0.4009196758, -0.0026238337, -0.0152530354, 0.1822063625, 0.0625659078, -0.2080119997, 0.4678931832, -0.1262195855, 0.0463771224, -0.113929294, -0.1563693732, -0.2914363444, 0.0924052969, 0.0868107751, -0.1507681459, 0.2687638104, 0.0293925852, 0.0568588451, -0.225289613, 0.0984304696, -0.0356402695, 0.0268338136, 0.2886551023, -0.2070228159, 0.0631754175, -0.0600749552, 0.0365456156, -0.0255812984, 0.0490393937, 0.115266256, -0.2090689987, -0.0139640775, 0.1001367271, -0.0165683925, -0.1671079993, -0.3912501037, -0.1389487535, -0.1975909472, -0.0063311458, -0.040597856, 0.4335288405, -0.0328267291, -0.0438486859, 0.0445837341, -0.0258180425, -0.5719745755, -0.488393724, 0.2505272329, 0.0060659163, -0.154031992, 0.2757167518, 0.2353696525, 0.3690858781, 0.0922648907, -0.7071724534, -0.156172812, -0.2046677768, 0.1184474155, 0.1058260053, 0.0241533872, 0.2398290932, 0.0240921639, -0.0268916022, -0.1140976623, -0.1467260122, -0.1291040331, -0.0374847353, 0.3500133753, 0.0910488591, 0.0001160195, 0.04162395, 0.9497954845, 0.394379735, -0.141488418, 0.1439827681, -0.0240651891, 0.4980605245, 0.0316479653, -0.1973223388, -0.0223428216, -0.221856311, -0.3265600502, 0.1050059348, 0.0302492306, -0.0344939902, 0.0793091953, 0.3164927363, -0.0557480678, -0.2625715137, 0.1485172808, -0.3140107095, 0.2633892894, 0.1785900891, -0.0668600351, -0.2687123418, -0.1759432256, -0.3116211295, 0.2126882672, 0.2438855171, -0.0834518224, -0.0698423684, -0.1346960813, -0.3145467639, 0.2725905776, -0.09897165, 0.2434128523, -0.2030454576, 0.2065503448, 0.3731815815, 0.2971286476, 0.2507965565, -0.5127699971, -0.0630538464, 0.229084, 0.0103921741, -0.098690331, -0.1902769506, -0.0421012715, 0.1808189154, 0.0313360281, -0.0466325246, 0.2927327752, -0.2061232924, -0.1982193589, 0.0727552921, -0.2074225545, -0.1631847918, -0.2685340643, -0.0736336708, -0.1776900887, -0.0034781843, -0.0291663669, -0.1593927592, -0.2659488618, 0.0489089936, -0.2242677808, 0.2267317474, 0.1672308594, 0.0370892249, 0.2579163313, 0.1197769046, 0.0693137497, 0.2803868651, 0.0117835822, 0.2370013893, 0.4791491926, 0.0039305687, -0.1519688219, -0.0573559813, 0.0520151854, 0.147030592, 0.2802861929, -0.3597364426, 0.2402039319, 0.1647097617, -0.0412786789, -0.4268027544, -0.1556103677, 0.3061186969, 0.2207675874, -0.2533015311, -0.6095196009, 0.5321127772, 0.1871464103, -0.2384274006, 0.2558768392, -0.0618052259, -0.2736566365, -0.0648570359, 0.0623319857, 0.8591040969, 0.0976355895, 0.1440970302, -0.0029542148, -0.1681734324, 0.5544694662, -0.2190600634, 0.2768951356, -0.1044931412, -0.1345788687, -0.1915027797, -0.0520453006, 0.302208513, 0.2040857673, -0.1602408141, 0.3003247082, -0.270801425, 0.4485935867, -0.1492144763, -0.1534203887, -0.1431582272, 0.009088248, -0.0060545225, 0.1852537692, -0.1069359332, 0.384154886, -0.1476829946, 0.1969137043, 0.2623199522, 0.1741454601, -0.4287789762, -0.2461884618, 0.0591168068, 0.2823920846, -0.171505779, -0.3929846287, 0.4317489564, 0.3194622695, 0.276499331, -0.0535459481, -0.2857944965, 0.2667242885, 0.0634531826, 0.1829375476, -0.2152648866, -0.0134186149, 0.2422487736, 0.1089968979, -0.4047919512, 0.0933832377, -0.0107910596, -0.2129334807, -0.0464655757, 0.4137536883, 0.0230954736, -0.5987153649, -0.1530690491, 0.2957653999, 0.2590724826, 0.1559879035, 0.1557027549, 0.1950619221, 0.1615442336, 0.5383930206, -0.3727499545, -0.3319197595, -0.0751141459, 0.3418465853, 0.4800575674, -0.1337220818, 0.5248399973, -0.1896689981, -0.3283009231, -0.2143829912, -0.1198877245, 0.0537751615, -0.1673793942, 0.0300610363, 0.1847628057, 0.4469091296, 0.0859864652, 0.0942792371, 0.0386938006, 0.1691406518, -0.2848290503, -0.1499035358, -0.0869992524, -0.023354996, -0.0660740882, 0.4195613265, -0.1543795168, -0.2241765857, 0.1199375838, -0.0192358382, -0.2836767435, 0.2019930482, -0.1278947145, 0.0934848189, 0.0326920748, -0.1223997176, 0.1731605679, -0.2500202954, -0.0944231302, -0.1227530837, -0.3531884253, -0.1902601421, 0.1031417996, 0.1902192533, 0.0644192845, -0.2847710252, 0.0072890222, -0.2246752828, -0.0313430987, -0.1140369326, 0.2164701521, 0.3175141215, 0.0416081026, 0.2557591498, -0.1455195844, -0.1382398903, -0.040819291, 0.0162841063, 0.062076129, 0.3474433124, 0.3701218069, 0.2468788177, -0.0009163432, 0.1782297194, -0.2215669602, 0.2649019957, 0.0477011837, 0.0994331911, 0.1803844124, -0.4075654149, 0.155814603, 0.2178881615, 0.3242303729, 0.2714050412, -0.2259006798, -0.3062479794, 0.0838243663, 0.1407382488, -0.1409041584, -0.2209402025, 0.2345395982, 0.318521291, -0.1707042158, 0.1732645631, 0.4352175593, -0.0997244865, 0.394625783, -0.0300415009, 0.6261056066, -0.5539912581, 0.379345715, 0.0789634883, 0.0692978948, -0.120083794, 0.3651632965, 0.4278164804, 0.0224866867, 0.569940865, 0.0848642364, 0.1568871737, 0.5307422876, 0.2910477519, -0.3888598979, -0.9131240249, 0.420211345, 0.4402660728, -0.5396680832, 0.1072007716, 0.0947707593, -0.053423468, -0.1686116755, 0.1495591998, -0.1600317061, 0.2045978308, -0.2233534157, -0.0710279346, 0.4242421091, -0.1915763766, 0.204863742, 0.0651753396, -0.0621954203, -0.0769083053, 0.0825555846, -0.1635194719, -0.1894572228, -0.3350575566, 0.3617975116, 0.0639958233, 0.3503905535, -0.0971992761, 0.1679082513, 0.0634870529, 0.0434229672, 0.2047021985, 0.4444726408, 0.5200182796, 0.0289697312, 0.191411972, 0.2181699425, 0.0260917619, 0.0139703229, -0.1626807898, 0.2969217896, -0.1348583996, -0.0214277022, 0.1584324092, 0.1294739544, 0.0683175251, 0.0819698647, -0.0369923301, 0.1760772467, -0.4534130692, -0.0189834982, 0.1762526035, -0.0180622786, -0.0692689866, 0.2122765332, -0.290500313, -0.1447817981, 0.7292044163, 0.0316710547, 0.2395655364, -0.20098643, 0.0622640438, -0.1819659919, 0.4538908005, 0.3087110519, 0.2311468273, -0.1840927154, -0.0565364212, -0.6199724674, -0.0325408429, -0.2790194452, 0.1169054508, 0.1015520543, 0.1611328572, -0.1948216856, 0.037408717, 0.0814650282, -0.1598072946, -0.0768686533, -0.0674435943, -0.1633546501, -0.0760746896, -0.0253171921, -0.0050002076, -0.1898802221, -0.2545616031, 0.2036049217, -0.0289417673, -0.0221751891, -0.1108199358, -0.0322998911, 0.0367439315, 0.0414101817, 0.4271950424, 0.2819315493, 0.4047440886, 0.3656843305, 0.117565833, -0.2506979108, -0.1911175996, -0.1692756116, 0.2737905085, 0.0763388425, -0.1567209214, -0.4409974217, 0.0766616315, -0.1389283836, 0.1922299862, 0.0059986189, -0.0247930456, 0.0739345625, -0.2451404929, -0.0166009516, 0.1591039598, 0.1393740624, 0.2356671989, -0.0348673761, 0.2864539623, -0.3084512949, -0.0712319314, 0.298155427, -0.2871439755, -0.2383142114, -0.1336086392, 0.3350433707, 0.0122037595, -0.2180283666, -0.5311558247, -0.0422038659, 0.5525931716, -0.3209541142, -0.0749308616, 0.1568260491, 0.0607789792, 0.1323456317, -0.0880958363, 0.379491657, -0.0187160335, -0.0245169289, 0.0621992648, -0.3847383261 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
I have another question about caching, this time in the case where FORCE_REDOWNLOAD is used to load the dataset, the datasets cache is one directory as defined by HF_HOME and there are multiple concurrent jobs running in a cluster using the same local dataset (i.e., same local files in the cluster). Does anything in the naming convention and/or file access/locking that you're using prevent race conditions between the concurrent jobs on the caching of the local dataset they all use? I noticed some errors (can provide more details if helpful) in load_dataset/prepare_split that lead to my question above. Let me know if my question is clear, I can elaborate more if needed @lhoestq Thank you!
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
115
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! I have another question about caching, this time in the case where FORCE_REDOWNLOAD is used to load the dataset, the datasets cache is one directory as defined by HF_HOME and there are multiple concurrent jobs running in a cluster using the same local dataset (i.e., same local files in the cluster). Does anything in the naming convention and/or file access/locking that you're using prevent race conditions between the concurrent jobs on the caching of the local dataset they all use? I noticed some errors (can provide more details if helpful) in load_dataset/prepare_split that lead to my question above. Let me know if my question is clear, I can elaborate more if needed @lhoestq Thank you!
[ -0.1976585984, 0.0997743458, -0.1261471212, 0.2399426401, 0.0289442576, 0.0434313491, 0.456479609, 0.0984457284, 0.422070086, -0.2127023637, -0.0249834247, -0.0400111675, -0.0365917794, 0.0134084001, -0.134203881, 0.403080076, 0.2076880187, -0.0396345593, -0.0242151842, -0.1413462311, -0.1500364542, -0.0289534051, -0.0475726053, 0.0606779084, -0.5617073774, -0.0671418682, 0.00137306, 0.1623041183, 0.1725724936, -0.4235334098, 0.3519338369, 0.5294938087, 0.0670454875, 0.4914120138, -0.000113091, -0.040380761, 0.1958638728, -0.0477523506, -0.2622748911, -0.1576190442, -0.5350165367, -0.4387893081, 0.1720769852, -0.0988319218, 0.0574334115, -0.1514248848, 0.0411746651, -0.7131089568, 0.4519169927, 0.142745018, 0.2041776627, -0.109120965, -0.4887529016, 0.0160306878, 0.0962760821, 0.3353845477, 0.0161244124, 0.1014832407, 0.2383864075, -0.3198068142, -0.3291196227, 0.2688158751, -0.0138630718, 0.3965908289, 0.3954435885, 0.0086095259, -0.2763717175, -0.2745757997, 0.165548265, 0.0608958751, 0.7798290253, -0.2836914361, -0.3395364583, -0.4090895057, -0.1475394964, -0.1793082654, 0.2699654996, 0.0716016442, 0.0429678671, 0.0845785886, -0.3964809179, -0.2547956705, 0.0036559999, -0.2672637999, -0.0383918509, -0.0404894426, -0.1567977071, 0.0833070576, -0.0747069418, 0.0514644384, 0.6233448982, -0.5045344234, 0.1790411472, 0.1976586878, -0.4616889954, 0.0237274319, -0.0364600495, 0.391844064, -0.0540190488, -0.024508208, -0.1536821872, 0.0867669284, -0.1915483624, 0.1589515358, 0.4464429915, 0.1503169388, 0.1327714175, 0.2022627741, 0.2322850078, -0.3030022979, -0.3496903479, -0.0695609599, 0.066536583, -0.4245010614, 0.2996267378, 0.0340162367, 0.1059436575, -0.3955442905, -0.2909144759, 0.0781234503, 0.1319536716, -0.2782210112, 0.0458959565, 0.1907660961, 0.0533929244, 0.0282916203, -0.2514452934, 0.0839573443, -0.3625874519, -0.2256820649, -0.2220806479, -0.125238806, -0.2524291873, 0.1785209477, 0.206243977, -0.2326709181, 0.040270932, 0.395031333, 0.096252948, -0.1698831022, 0.1404357255, -0.1678614765, 0.2335448414, 0.3442670107, -0.254612416, 0.2355288267, 0.3324487805, 0.030890353, -0.1443062425, 0.2100906074, -0.4729038179, -0.4184190929, 0.1001293361, 0.103348732, -0.405164659, -0.0247245338, -0.1482536942, 0.0726759136, 0.5164403319, 0.0497851819, 0.0943618119, -0.2699441016, -0.2512400746, -0.1872328669, -0.0906445831, 0.5964114666, -0.6261847019, 0.0243638232, -0.1429247558, -0.0997801125, 0.072188437, 0.310985148, -0.4317258596, 0.1771503687, -0.2471140623, -0.0300256535, 0.1561936736, -0.2819257975, -0.2977416217, 0.2853238881, -0.0048163384, 0.2871131301, 0.1105004698, -0.0748476163, 0.0774110556, -0.2064441144, 0.0731692016, 0.0241685845, -0.0004381873, -0.127861619, -0.2169781476, -0.2795420587, 0.1265175343, -0.0591098182, 0.1558089554, 0.1283838749, 0.1315276027, -0.0641909018, 0.1397760659, -0.0422716625, 0.1320658773, 0.3305953741, -0.056215845, 0.2266030014, 0.1514286399, 0.2036532462, -0.6013008952, 0.4022015631, 0.0565554425, -0.4018243849, -0.0155668706, -0.1956534088, -0.1518980116, -0.1913247705, -0.4529679716, -0.0661185756, 0.0631240681, -0.12439394, -0.0742721707, -0.2170352787, -0.2007466108, 0.8151645064, -0.3109955192, -0.0313592777, -0.0666531026, 0.2341920733, -0.0657755882, 0.2016777694, -0.1721453816, 0.03475485, 0.2445913404, -0.0093639959, -0.0629993603, 0.3307785094, 0.2265689671, 0.5461755991, 0.183908999, 0.2227416933, 0.1407314986, 0.1049827039, 0.3516895175, -0.2002376467, 0.1083544418, -0.1767369509, -0.2546151876, 0.3825460076, -0.3531450331, 0.2602760196, -0.1692647487, -0.2800013423, 0.0722132549, -0.0253566802, 0.0578830913, -0.0620063804, 0.1634282917, -0.0544249006, 0.2642071247, 0.2155812681, -0.166854769, 0.145517543, 0.1983785331, 0.0810151324, -0.1046497598, -0.1036527604, 0.0311686546, -0.302670002, 0.1909435689, 0.4321053624, 0.6589484811, 0.0841456354, 0.1966480166, -0.027057251, -0.0880917758, -0.2778380215, 0.1220181733, -0.0720073879, -0.0023050979, 0.2029410005, 0.0612133853, -0.1524754465, -0.3158773184, -0.0474572107, 0.2898837626, 0.0772343576, -0.4448515773, 0.1399451047, -0.2746499181, 0.038469553, -0.1693125069, 0.122773774, -0.3491448164, -0.337418586, -0.0173501763, 0.1677835286, 0.0397744328, 0.0239770859, -0.3611676693, 0.3172855377, -0.359629333, -0.0370976999, -0.1784279048, -0.3712446094, -0.1486223936, 0.0270704329, 0.2050135434, 0.0677453876, 0.2444339097, 0.0925382674, -0.1358067691, -0.1985534579, 0.2229715437, -0.0905948728, -0.0714232326, 0.1459328681, -0.3722258508, -0.014396064, -0.04195356, -0.0836179256, 0.0012379251, -0.0441601053, 0.0252005532, -0.2760802507, 0.0767166764, 0.1379478276, -0.0329541005, -0.1260614693, -0.358548671, -0.2973440588, -0.1416450739, -0.066571936, -0.013350293, 0.3812196255, -0.1233074889, -0.109098509, 0.2232973427, -0.2107464671, -0.5925026536, -0.4445323646, 0.0657249764, -0.1588764936, -0.1897362173, -0.0171295628, 0.1173108816, 0.1880114973, 0.1741949469, -0.5063970089, 0.0306790397, -0.052200377, 0.1078684628, 0.1149185747, 0.011920562, 0.2383211553, 0.056173481, 0.0068715215, -0.1866168231, 0.0011004433, 0.0650859773, -0.0169901624, 0.2155076563, 0.0310273729, -0.1636011004, -0.1278614402, 0.9876947999, 0.2820962071, -0.0200458001, 0.2478427738, 0.209723413, 0.5658015013, 0.0727661401, -0.268219769, -0.0198028088, -0.3216585517, -0.4030306637, 0.0986347795, -0.0202114061, -0.0255672988, 0.0158951581, 0.2516836822, -0.1507885456, -0.3202368319, 0.0968192071, -0.4016380608, 0.2247708738, 0.1057191193, -0.157984972, -0.2311592996, -0.0638040975, -0.2034143955, 0.1252926588, 0.267179966, -0.1133416444, -0.3760954738, -0.01221231, -0.1509812772, 0.2174096555, 0.0030071028, 0.2297929823, -0.2213809192, 0.154153347, 0.2425589412, 0.252040416, 0.539583683, -0.4943316877, -0.0120089715, 0.308145225, 0.0935063809, -0.0350708999, -0.3314189911, 0.0597198009, 0.3186373115, -0.0601289682, 0.1686539054, 0.1850642264, -0.354840517, -0.2019772828, 0.1204965413, -0.1876206398, -0.3386183381, -0.1475475878, 0.0515872389, -0.0989235342, 0.1706442535, 0.0041624531, -0.1042347401, -0.4475526214, 0.1424415261, -0.0375593528, 0.1645590812, 0.182234928, -0.00635048, 0.2474913597, 0.0672517419, 0.1224882305, 0.4751346707, -0.116265744, 0.3912045062, 0.5132355094, -0.2522023916, -0.0745842382, 0.0655101389, 0.0436781235, 0.2390208393, 0.492099762, -0.1698341668, 0.0112337265, 0.0491349958, -0.1993608773, -0.3951823711, -0.0089399107, 0.0891339034, 0.1115372181, -0.2740194201, -0.5477330685, 0.4944399893, 0.1882710159, -0.2931147218, 0.227137804, -0.0794415846, -0.2718235552, 0.1646752208, 0.0818436295, 0.7546725273, -0.0053861979, 0.0857154429, -0.2928616703, -0.1523358226, 0.3615905344, -0.4735437036, 0.1916038245, -0.205830425, -0.1356477439, -0.0661597401, -0.1759927869, 0.303515166, 0.4233142734, 0.0698852092, 0.409953773, -0.1637896597, 0.3477379978, -0.3406013846, 0.1299732476, -0.0802547112, -0.0974592641, 0.1579232961, 0.1904121339, -0.0052905045, 0.4484211802, -0.1342689395, 0.2542357445, 0.1499660164, 0.2168227583, -0.3202623427, -0.0961831734, 0.0148670636, 0.3158015907, -0.3518647254, -0.486132443, 0.3081661463, 0.2944433093, 0.4739228189, -0.1809300184, -0.1067487821, 0.2365145236, 0.1502017379, 0.3250727654, -0.1963799894, 0.0158324577, 0.3516879082, 0.1532211602, -0.2486719042, -0.0203191191, -0.1314672381, -0.1292048395, -0.0536154509, 0.3481568992, 0.1101594493, -0.5068119168, -0.0620741323, 0.3035107851, 0.2639789283, 0.131488651, 0.1262328625, 0.1465287507, 0.1877061576, 0.4004673958, -0.4862881899, -0.2697877586, -0.1348172724, 0.3867878914, 0.4538160264, -0.3098533154, 0.4357560575, -0.1971487403, -0.296789676, -0.1681284457, -0.0168314427, 0.2014455199, -0.1655528843, 0.0588926747, -0.0716052949, 0.0945144296, 0.1081801206, -0.0181549378, 0.1278890371, 0.127620548, -0.0724170804, -0.138150543, -0.2885970771, -0.0941320732, -0.1662012041, 0.372923851, -0.0076633394, -0.2614079714, -0.0035439879, 0.1206899211, -0.2857524157, 0.0724876225, -0.1828871965, 0.131221652, 0.0144411027, -0.0669269413, 0.2288742661, -0.1978755593, -0.0724166781, -0.06048318, -0.3882534802, -0.1609353721, 0.1040428206, 0.1701237857, 0.0574103668, -0.1091037393, -0.1158857942, -0.2992545366, 0.1175631285, -0.1496620476, 0.2170009762, 0.3762130737, -0.0073146708, 0.2057650983, 0.2046087086, 0.0075706206, -0.0796662793, 0.096999228, 0.1692900509, 0.2467493564, 0.2833223641, 0.2763616145, -0.0494924895, 0.1230390891, -0.2391475737, 0.1309685707, 0.2271892875, 0.1936820894, 0.0724755973, -0.2769878209, 0.1188427359, 0.0833599791, 0.4556762278, 0.3623214066, -0.0685255975, -0.3023667634, 0.2224195749, 0.1409723163, -0.0703124702, -0.2093811333, 0.4214820266, 0.2121281475, -0.1001906991, 0.2593787313, 0.6226683855, -0.0030639172, 0.2651777864, 0.1284807473, 0.6269993782, -0.3409231901, 0.3178873658, 0.1241047829, 0.140591532, 0.072537154, 0.478607446, 0.4627035856, 0.0455110148, 0.4786473811, 0.1187349707, 0.2241658866, 0.3307624459, 0.2659922242, -0.2395766377, -0.7666535974, 0.3386409879, 0.4435622692, -0.3572900891, 0.1059564576, -0.1620753407, 0.0412577465, -0.2385785878, -0.0223234408, -0.01989251, 0.1341740489, -0.1757946908, -0.1652770638, 0.561144352, -0.2321901917, 0.0724459291, 0.0717931688, -0.0872566104, 0.0310543552, 0.2954609394, -0.1402343512, -0.0206402279, -0.1417829543, 0.3359813094, 0.0895526707, 0.2814582884, -0.1195766181, 0.1500714272, 0.0193080567, 0.0229665432, 0.2433668375, 0.3205233812, 0.4312111437, 0.0730757564, 0.0567894131, -0.0419803709, 0.0803494304, 0.0306581706, -0.1244742498, 0.2402953207, -0.28928262, -0.1411244273, 0.2796347439, 0.1205691919, 0.0544576421, 0.0997400656, 0.0347342566, 0.052223362, -0.2454397231, 0.0413270108, 0.1616994441, -0.1541537046, 0.0413748212, 0.0872316957, -0.2158908397, -0.2138017416, 0.6434294581, -0.041173324, 0.3312613964, -0.0874189138, 0.0671206266, -0.0899093151, 0.4424495101, 0.3044472933, 0.001684783, -0.2855187058, -0.0738331601, -0.6275616884, -0.0998571664, -0.3399469852, 0.3091219366, 0.012759991, 0.1506413221, -0.0677461028, 0.0091880783, -0.001842998, -0.1150775999, -0.2683275044, 0.160371542, -0.187192753, -0.078966178, -0.1476554871, -0.0946874693, -0.091022566, -0.2468649745, 0.1848932654, 0.0806934386, -0.0694915131, -0.0171887167, -0.0482565388, 0.3418277502, -0.0492818803, 0.3211779594, 0.0896972343, 0.3144818544, 0.3501134515, 0.1428951323, -0.3316802979, -0.2530387342, -0.2174375653, 0.177781105, -0.069834955, -0.0495418757, -0.6060165167, 0.0150944758, -0.1568980068, 0.1981022656, -0.0986491069, -0.1057600379, 0.1038862988, -0.1709439456, -0.0705882683, 0.201607272, 0.2013841718, 0.3171717525, 0.0810510218, 0.4173976481, -0.4404121041, -0.0809620395, 0.296179831, -0.2702328265, -0.2628026307, -0.0478425957, 0.3122299612, 0.0949086547, -0.2099299878, -0.4173206091, 0.0037844777, 0.4315961301, -0.2807968557, -0.0492600501, 0.0411786921, 0.1083438545, 0.0290372372, -0.0964805931, -0.0139835551, 0.0313167498, -0.0698072538, 0.167419374, -0.1769053191 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
I got another error that convinces me there is a race condition (one of the test files had zero samples at prediction time). I think it comes down to the fact that the `config_id` above (used in the naming for the cache) has no information on who's touching the data. If I have 2 concurrent jobs, both loading the same dataset and forcing redownload, they may step on each other foot/caching of the dataset.
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
74
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! I got another error that convinces me there is a race condition (one of the test files had zero samples at prediction time). I think it comes down to the fact that the `config_id` above (used in the naming for the cache) has no information on who's touching the data. If I have 2 concurrent jobs, both loading the same dataset and forcing redownload, they may step on each other foot/caching of the dataset.
[ -0.2517682612, 0.191368252, -0.1285431832, 0.225294739, -0.0270277057, 0.0778243393, 0.3286906779, 0.1005264968, 0.3222956359, -0.1650660038, 0.1239640862, -0.1279568821, -0.19243595, -0.0144359842, -0.0895965844, 0.5366290212, 0.107899785, -0.0252204798, -0.0901684165, 0.0365104526, -0.1266116202, 0.0053365491, -0.0214975402, 0.0335966535, -0.5114256144, -0.1194657609, 0.0914082825, 0.1005365551, 0.0635158643, -0.4727331996, 0.4316720665, 0.499807626, 0.118500784, 0.5272334814, -0.0001120525, -0.0287341923, 0.2750872374, -0.0498852096, -0.1975313872, -0.0401539132, -0.5221555233, -0.4225539565, 0.1734901071, -0.1565445215, -0.01928946, 0.1251880825, 0.0999643579, -0.664963305, 0.4458994269, 0.2068894804, 0.2239559144, 0.0063836649, -0.3632512987, 0.0565337949, 0.1321966946, 0.0316346772, 0.1112323999, 0.0179961734, 0.2499782592, -0.276514709, -0.1764032543, 0.3918350339, -0.1496850848, 0.2700967491, 0.3394787312, -0.049560003, -0.1456186175, -0.2498752922, 0.1793818921, 0.0785244256, 0.7550190687, -0.2804463506, -0.2590425611, -0.3573784828, -0.0003891587, -0.3408978581, 0.2716989219, 0.0059851147, -0.0621337593, 0.1301234215, -0.5325371027, -0.0447262265, 0.0544279516, -0.2020449042, -0.0876095146, -0.0325518399, -0.1824889779, 0.120684132, -0.1120892614, 0.0778151304, 0.5639135242, -0.4694675505, -0.0030595076, 0.1652616262, -0.5255541205, -0.0425235219, 0.1144299135, 0.3191136718, -0.071868889, 0.0461112224, -0.0258327089, -0.0575421862, -0.0753805488, 0.0962902904, 0.4880085289, 0.2864924371, -0.0163680241, 0.1548945606, 0.3341029882, -0.2074418515, -0.2292799056, -0.0197030175, 0.1273518354, -0.4306162, 0.5709228516, 0.0303967148, 0.237696588, -0.2874132693, -0.4723013937, 0.160081923, -0.0511508547, -0.1926122606, 0.1289617866, 0.1974540949, -0.0455316268, -0.0731102377, -0.036173448, -0.0604146682, -0.3438555598, -0.2678799927, -0.2570456862, -0.1845748723, -0.298189491, 0.02592301, 0.142329663, -0.1314677596, 0.0474157035, 0.3375695646, 0.0919067934, -0.2276921272, 0.1491728276, -0.1079983562, 0.1522395015, 0.4109432995, -0.2356166393, 0.2177988589, 0.2515304685, -0.0982944593, -0.1494985968, 0.2317407876, -0.4703752995, -0.3041457534, 0.2093477696, 0.1603923738, -0.624566853, -0.0508758128, -0.11545825, 0.1069262549, 0.5289376378, -0.0188321918, 0.1880380362, -0.1465044618, -0.1347685009, -0.1819500923, -0.0632880181, 0.6424160004, -0.4017944634, 0.0320387334, -0.0944016352, 0.0119821317, 0.0594304577, 0.2395131141, -0.4469093978, 0.1544791907, -0.1485107541, -0.1909795702, 0.1386923492, -0.1890892386, -0.4584931731, 0.190317601, -0.0515886024, 0.3528981805, 0.1084550917, 0.1193270683, -0.022229461, -0.1931738704, 0.0405068398, -0.1391271502, 0.0323300511, -0.0980472714, -0.1925178468, -0.4559208453, 0.2004025578, -0.091542244, 0.1057981849, 0.0321128592, -0.0470402054, -0.2174396813, 0.0696062595, 0.012223077, 0.0625415221, 0.3167733252, -0.0313240588, 0.0907535106, 0.0103257708, 0.0960562974, -0.6243477464, 0.3583468497, 0.1563858092, -0.353985846, 0.0139281787, -0.1468538791, -0.1040831953, -0.0771555454, -0.438985765, -0.1530056298, 0.0888964906, -0.0018818565, -0.0361589454, -0.196716994, -0.1879836023, 0.6546057463, -0.356873095, -0.1490766406, -0.271338433, 0.1059926897, 0.0194849055, 0.07495711, -0.2156203687, -0.0297374316, 0.1446016133, 0.1075267047, 0.044901818, 0.2335267663, 0.0997378975, 0.462431103, 0.0397951268, 0.4178234041, -0.0245629661, 0.1138096005, 0.1684465706, -0.0570361763, 0.1276119649, -0.1137055755, -0.0868542343, 0.4415453076, -0.348149389, 0.2157448679, -0.2746935487, -0.2525872886, 0.1577691734, -0.0914995894, -0.068484351, -0.0187279433, 0.1852869689, 0.0674138144, 0.1038759053, 0.2266267985, -0.3037702441, 0.1307942569, 0.1964211613, 0.0860400051, -0.0355747975, -0.0536784865, 0.0118194204, -0.1683060229, 0.1427566111, 0.4865140915, 0.601980567, 0.1609792113, 0.102702111, -0.0308136251, -0.0692353472, -0.2510654628, 0.1791907847, -0.084662959, -0.070723258, 0.1648724377, 0.0941825137, -0.0786522478, -0.235294044, -0.0024991482, 0.2213749439, 0.1878315955, -0.5408711433, 0.219358027, -0.1885172725, -0.0643247813, -0.2079835683, 0.0157939494, -0.2783073187, -0.2711945176, 0.0299682096, 0.2203121632, 0.0512736887, -0.0009048767, -0.4029426873, 0.3308382928, -0.2962322235, -0.0193091799, -0.1532668769, -0.3106406629, -0.1549329758, 0.0505177863, 0.2070083469, -0.0508816317, 0.2605377138, 0.0185469165, -0.0519027337, -0.0746046901, 0.138612479, -0.1986934841, 0.0166719407, 0.2831509113, -0.2718153298, 0.0186256003, 0.0076693743, -0.1196952835, -0.0598484389, 0.0348815694, -0.0434909239, -0.2097879648, 0.0749025941, 0.0885235369, -0.0312416032, -0.1403438598, -0.3080449998, -0.207253471, -0.1329467446, -0.0004844666, -0.0717663616, 0.5000899434, -0.0366151929, -0.1307930946, 0.1735213101, -0.0806696489, -0.5959799886, -0.6015764475, 0.0083437935, -0.0080360845, -0.1165084988, 0.0793118924, 0.0809104294, 0.3373697698, 0.2010285854, -0.4741952121, 0.0586168915, -0.1161698177, 0.1523580104, 0.1011248603, -0.0133300014, 0.328464359, 0.1294864565, -0.032244578, -0.1425665915, 0.0085591823, -0.0020874031, -0.0802745074, 0.3332746625, -0.0510391667, -0.0800950229, -0.0817689002, 1.0259207487, 0.4451493621, -0.2207208723, 0.1197509021, 0.1114840209, 0.5954013467, 0.0992717743, -0.2981826067, -0.1415584683, -0.2105116695, -0.4468586445, 0.0789372101, -0.081303291, -0.0102543198, 0.0256452933, 0.337888211, -0.2246457636, -0.30947119, 0.1535274088, -0.3852470219, 0.2110982835, 0.1298293173, -0.1262347996, -0.264189899, -0.1565331072, -0.3046490252, 0.156665355, 0.2108724415, -0.1292701811, -0.2809839249, -0.0529128425, -0.2109041661, 0.2140874565, -0.1104004905, 0.2288006991, -0.1527268142, 0.1393648535, 0.1894433945, 0.1234553605, 0.5261523724, -0.5408661366, 0.0187126882, 0.325886488, 0.0366342142, -0.0141301081, -0.2502394617, -0.0214142054, 0.2749579549, 0.0569705144, 0.1040941924, 0.1127328128, -0.1625838876, -0.1295723617, 0.0386362635, -0.2036715746, -0.3574633002, -0.3348813653, 0.0216142237, -0.0356381088, 0.2071161866, 0.0349812284, -0.1706220955, -0.4067673981, 0.0633658096, -0.179016158, 0.2599110603, 0.23798953, 0.0964002684, 0.1390655488, 0.1510612071, 0.1921013445, 0.528531611, -0.1943769753, 0.3289648294, 0.4249374568, -0.0288336407, -0.0411117636, -0.0333526134, 0.2387887985, 0.1610033512, 0.4802273512, -0.1635887325, 0.1184633672, 0.1118430868, -0.2244088054, -0.4298041165, -0.0539077036, 0.1832759082, 0.3433673978, -0.2981339991, -0.5379776955, 0.4298601449, 0.1825304925, -0.2888795137, 0.2886283398, -0.2511375248, -0.3057355285, -0.0478728935, 0.0606490374, 0.9063932896, 0.0238126405, 0.0896110088, -0.1680404097, -0.2043422461, 0.3515007198, -0.266515702, 0.2621554136, -0.1686118692, -0.119014129, -0.0768340454, -0.1368051767, 0.3444722593, 0.2039642483, -0.0256586596, 0.3815737665, -0.2514645457, 0.3177069426, -0.2536360919, 0.0545575023, -0.0312776864, 0.0408973135, 0.0482791029, 0.2011443973, -0.0915894955, 0.4211690426, -0.1481293738, 0.1660478115, 0.1732252389, 0.2095958591, -0.3672164083, -0.0758555904, -0.1288067698, 0.2412814498, -0.3847012818, -0.408542335, 0.2100901306, 0.3001431823, 0.2872571349, -0.0402123816, -0.0879066661, 0.3305514157, 0.1718913615, 0.2496002018, -0.1143167913, -0.0921345204, 0.2531343699, 0.0928102434, -0.4002296329, 0.1381379664, -0.1176001579, -0.0976190045, 0.0476062894, 0.405824244, 0.1681507975, -0.4719682932, -0.0661569387, 0.3432352543, 0.2380196601, 0.1225249618, 0.1486918777, 0.2173093706, 0.1809561998, 0.4563591778, -0.4931855798, -0.3539916277, -0.098002784, 0.4541850686, 0.4964263439, -0.1159432381, 0.4686358869, -0.3675578833, -0.1963132918, -0.1657245457, 0.0218103528, 0.2290475667, -0.101546064, 0.1191611737, -0.0079338737, 0.1827760041, 0.1918760985, 0.0799610913, 0.1043663323, 0.0297295488, -0.0993019789, -0.1074314564, -0.2284146845, 0.0016841218, -0.0087534916, 0.4354401827, -0.0215755552, -0.2398882508, -0.1233078241, 0.0886598378, -0.326821357, 0.040274851, -0.3119003177, 0.1347810328, 0.0895454288, -0.0904189646, 0.1559415013, -0.3188301325, -0.0550831705, -0.1348193437, -0.4211334288, -0.1929089129, 0.1011248082, 0.1473772377, -0.0453899242, -0.1048486307, 0.0359338857, -0.3042225242, 0.1155484468, -0.1196428537, 0.1508761346, 0.2795186639, 0.0709540173, 0.1298110038, 0.0144624924, 0.0089747999, -0.1445264667, 0.0718491077, 0.0618244372, 0.093399033, 0.2500113249, 0.2964650691, -0.079092063, 0.1362195909, -0.2720767856, 0.1582304984, 0.1796565652, 0.1432496905, 0.0405364409, -0.287912935, 0.059565559, 0.2745731473, 0.334869802, 0.3194318712, -0.1518948376, -0.2957105935, 0.159828797, 0.1814678013, -0.1841986775, -0.0681372881, 0.2696785331, 0.2918854952, -0.0290992707, 0.2303141207, 0.4189584553, 0.0286824554, 0.425845772, 0.0884434879, 0.6176127791, -0.4926782548, 0.4518832564, -0.0036271121, 0.1652177721, -0.0140561145, 0.4809514284, 0.3415839076, 0.1257572919, 0.3665902913, 0.0908315182, 0.2661990225, 0.4168553948, 0.179576546, -0.3835103214, -0.7729429603, 0.3268946707, 0.4059701264, -0.4040571749, 0.1575589031, 0.0464882478, 0.0945224017, -0.2413247973, 0.0773723423, -0.1642310023, 0.1319761723, -0.1541713178, -0.1720742136, 0.4650789797, -0.2134921849, 0.1724030077, 0.0140796527, -0.0729571879, -0.0196417384, 0.2851190567, -0.1888893098, -0.1902801096, -0.3847339153, 0.1992868483, 0.117581591, 0.3136015236, -0.2144120634, 0.1406807601, 0.1702443212, 0.0135519234, 0.2077641189, 0.488062799, 0.6151863337, 0.0458031073, 0.2123408318, 0.0407729372, 0.1567068398, -0.0211980231, -0.2275059521, 0.2416978627, -0.1272060275, -0.1402420998, 0.1282975376, 0.1625059843, 0.0109192133, 0.0844228342, 0.1475844979, 0.1768209487, -0.3624552488, -0.1245503277, 0.0180377588, -0.0987358838, -0.0387732983, 0.1679383814, -0.2236948013, -0.0650018454, 0.5706326365, -0.0086028576, 0.1929668933, -0.1190560535, 0.0842363387, -0.1275198311, 0.4512867928, 0.1960029006, 0.0122874547, -0.2609119713, 0.0184161365, -0.7642451525, -0.0648424774, -0.3708972931, 0.2149637938, 0.0195988715, 0.1942867041, -0.1366360188, 0.0275837667, 0.0445958152, -0.1766604036, -0.1415240914, 0.1689890921, -0.2013434917, -0.0542339832, -0.0901091248, -0.189970687, 0.022407338, -0.2785153389, 0.1121835858, 0.0400695242, 0.0102656633, 0.0393891111, 0.0243687183, 0.2430413961, 0.1524777412, 0.4254675508, 0.1209515631, 0.4215007424, 0.282309413, 0.0887161717, -0.3945355415, -0.2712375224, -0.2611301839, 0.2192792892, 0.0499733016, -0.0604163632, -0.5520476103, 0.1047298908, -0.1174670458, 0.13393794, -0.1022366136, -0.2000138313, 0.116301395, -0.2459810674, -0.0709170401, 0.3233189583, 0.0463846624, 0.3567878008, 0.0475158654, 0.4030322433, -0.4511671364, -0.0404342785, 0.3104498684, -0.2887721658, -0.2097819597, -0.0825659037, 0.2860710621, 0.0124395862, -0.2090423107, -0.448982954, 0.0666355342, 0.4374014735, -0.2764775753, -0.0816243812, 0.1540213227, 0.0156007409, 0.0642776936, -0.0405625664, 0.1321406066, 0.0544441007, -0.1222038269, 0.2334983051, -0.2742744982 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
We're using a locking mechanism to prevent two processes from writing at the same time. The locking is based on the `filelock` module. Also directories that are being written use a suffix ".incomplete" so that reading is not possible on a dataset being written. Do you think you could provide a simple code to reproduce the race condition you experienced ?
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
61
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! We're using a locking mechanism to prevent two processes from writing at the same time. The locking is based on the `filelock` module. Also directories that are being written use a suffix ".incomplete" so that reading is not possible on a dataset being written. Do you think you could provide a simple code to reproduce the race condition you experienced ?
[ -0.1967528164, 0.1176103204, -0.0897249207, 0.3552556038, 0.157759726, 0.1552675217, 0.1879121065, 0.1608637422, 0.3102245033, -0.1881489903, 0.191019237, 0.0179731771, -0.2734491527, 0.0268449932, -0.2476357818, 0.4049518406, 0.1267283708, -0.0034803636, -0.1405780762, 0.0179455504, 0.0459332541, 0.0447994545, -0.1037567854, -0.0012469068, -0.476983577, -0.2035489082, 0.0959884077, 0.1866523027, -0.0399645902, -0.5564553738, 0.3019807041, 0.4502323568, 0.0678041875, 0.5293136835, -0.0001150939, -0.127984643, 0.2920048535, -0.0531720296, -0.2578074336, -0.0726658925, -0.5385321379, -0.4082249701, 0.2471217662, -0.146911636, -0.0855540112, -0.0813928396, 0.1438265294, -0.8633798361, 0.5533200502, 0.2262481153, 0.1847568452, 0.049037762, -0.3496800661, 0.0953058302, 0.0084354933, 0.0291793868, -0.0481613502, 0.0714801401, 0.4345101118, -0.214053005, -0.1860694438, 0.3216885328, -0.2358111143, 0.2497448325, 0.4829367995, 0.0574803911, -0.186517626, -0.2884806991, 0.1342115104, 0.0174991861, 0.7710598707, -0.4393547177, -0.1225508079, -0.3344055414, -0.0687557906, -0.3336840868, 0.3206143379, -0.0728346705, -0.0339726433, 0.2561246157, -0.4723567367, -0.0451732874, 0.0078578517, -0.165863961, 0.0376526788, -0.0919712633, -0.1253418177, 0.0373960771, -0.117984727, 0.1216066033, 0.5495464206, -0.5747789145, 0.0110017341, 0.2291453481, -0.544428587, -0.0410543568, 0.0324345827, 0.4762229919, -0.1241323352, 0.1248384491, -0.0110149607, 0.0557424612, -0.04005339, 0.1130375937, 0.3680422306, 0.2238930464, 0.121543169, 0.2314200699, 0.2183248103, -0.169347167, -0.2075105011, -0.0547739714, 0.0730548352, -0.3701848686, 0.5901763439, 0.0753736496, 0.1406157166, -0.3174616992, -0.3990460038, 0.2899313569, -0.0197665393, -0.0911199003, 0.1224695444, 0.1468477845, -0.0552356392, -0.2533986568, -0.01594273, -0.0094254734, -0.2785452306, -0.1450183094, -0.1850531399, -0.118299067, -0.352662921, -0.0679663718, 0.1608493924, -0.162210837, -0.0802546516, 0.4727269113, -0.0296063982, -0.1480690241, 0.2859734595, -0.1099013463, 0.0946580023, 0.2131461799, -0.1637271494, 0.3256707191, 0.4162673354, -0.0792471394, -0.1719824672, 0.3135368228, -0.3567290902, -0.2460058928, 0.0298705231, 0.1221239865, -0.553622663, -0.0403476581, 0.0136222728, 0.0955771357, 0.475045681, 0.0389862359, 0.2495602071, -0.1382680684, -0.2923185229, -0.1906098574, -0.0443619713, 0.7311729193, -0.5330134034, 0.1285099983, -0.1396498084, -0.0286404379, 0.1445684582, 0.284194231, -0.2962818146, 0.1323600262, -0.211553365, -0.1310621053, 0.0573137105, -0.1184855849, -0.4381589293, 0.1742965281, -0.1678356528, 0.4191294909, 0.2183454037, 0.3029729128, 0.0468538105, -0.0431203954, 0.0522444658, -0.0761144683, 0.0460270271, -0.2244433165, -0.1492367536, -0.3316147327, 0.2219996452, -0.1010164022, 0.0453745052, 0.0104910657, 0.0069764704, -0.1455119252, 0.146955803, -0.0052159764, 0.1594042182, 0.347135067, 0.0670276582, 0.2349249572, 0.016208075, -0.1393256336, -0.4302178621, 0.3824397624, 0.1700237095, -0.327344656, -0.0764158815, -0.1682446897, -0.2741941214, -0.1506722271, -0.4196009636, -0.0648651868, 0.05592902, -0.1632689387, -0.0997351855, 0.0063889027, -0.058186505, 0.7144827247, -0.3550774157, -0.1178708971, -0.1787390262, 0.1654230356, -0.069513835, -0.0650653467, -0.1282576472, 0.0162385069, 0.1677400917, 0.0884350464, 0.0401572175, 0.197717905, 0.1437586844, 0.4981747866, -0.0173988026, 0.4018269181, 0.0288785789, 0.0421062261, 0.1149368286, 0.0580223799, 0.1100393087, -0.0902628154, -0.2157792151, 0.4076111615, -0.3188074827, 0.0771590769, -0.2222141325, -0.1766805649, 0.0708626285, -0.1201455221, 0.0369205177, -0.0532234199, 0.326100111, 0.0933613777, 0.039437227, 0.2987610698, -0.1140407845, 0.1542573124, 0.3554933369, 0.1300943345, 0.1081679016, -0.0364468694, 0.0031142347, -0.1081884056, 0.0884906203, 0.3828623891, 0.4414940476, 0.1244365498, 0.136468336, 0.0507014096, -0.0579842851, -0.2591861188, 0.3113620281, -0.176506862, -0.0299759451, 0.2807717621, 0.0883556306, -0.1850341558, -0.2827691734, -0.1310248822, 0.1508903801, 0.2686743438, -0.4140030742, 0.1892246008, -0.436393559, -0.006558679, -0.2460874319, 0.1756596714, -0.1134243757, -0.2515414953, 0.0480956808, 0.308319658, 0.1618435383, -0.0087755024, -0.3633635044, 0.186207667, -0.0862539187, -0.0292841997, -0.1167898625, -0.2754994631, -0.177116096, 0.0540669188, 0.2507046461, 0.049386058, 0.240713954, 0.0357820243, -0.0555943809, -0.1726720929, 0.0869024992, -0.1923732907, 0.003850311, 0.335683614, -0.1077344045, 0.0945144817, -0.0795745701, -0.0116859116, -0.1473882496, 0.0740207583, -0.078388907, -0.1255156994, 0.0772515684, 0.0360646993, -0.1096623391, -0.1280041784, -0.3082378507, -0.1841047406, -0.0727253184, -0.0917507857, 0.0108163217, 0.4160496294, 0.0477247797, 0.0082806833, 0.0806195736, -0.0969174132, -0.4676981568, -0.3725500107, 0.1579974145, 0.0714701265, -0.1243044287, 0.0383483768, 0.1377870739, 0.1091660261, 0.0639516115, -0.4974829555, -0.0647075325, -0.2150492668, 0.1265071481, 0.0788127035, -0.0567565113, 0.3888297677, 0.1091574207, -0.0349471644, -0.2198407501, 0.1228037179, 0.0552477911, -0.2224342078, 0.1876207888, -0.0696275309, 0.1301477104, 0.0980787873, 0.9211754799, 0.442130208, -0.1490120739, 0.1426529586, 0.0367860422, 0.5512971878, 0.0714664757, -0.2881066501, -0.2727802396, -0.2012753934, -0.5301855206, 0.0737024099, -0.1222468913, 0.1210193634, 0.1622666419, 0.2563952804, -0.0245229006, -0.2634497285, 0.0854233652, -0.3224427402, 0.3055690825, 0.1176083684, -0.1135855764, -0.1386609674, -0.1594529599, -0.2369191945, 0.3065062761, 0.1802806556, -0.0642329678, -0.2745895088, -0.0641613901, -0.3204014003, 0.1976516843, 0.0092159584, 0.1392197609, -0.3340424299, 0.2803925574, 0.3066824973, 0.1070358157, 0.529056251, -0.4673747718, 0.1154225618, 0.2394134998, 0.1314844042, -0.0981871188, -0.1250734031, -0.155183211, 0.385897696, 0.1222366542, 0.1415534914, 0.1297632605, -0.1207308173, -0.3352890611, 0.0299775638, -0.1702425778, -0.2717114985, -0.3003407717, -0.0513493828, -0.2229293883, 0.2612915933, 0.167481631, -0.1090227515, -0.3220363259, -0.1244563982, -0.1182033494, 0.2126158327, 0.2658469379, -0.0123000108, 0.2714412212, 0.0407207683, 0.2027819902, 0.3392230272, -0.3385329247, 0.2675184011, 0.416241914, 0.0638291836, 0.0301668663, 0.0778311789, 0.0254293866, 0.0431314036, 0.3892777562, -0.2104763091, 0.3602584004, 0.3159132302, -0.2228940129, -0.4493179023, -0.18460235, 0.186355561, 0.3459110856, -0.2317756414, -0.5013898611, 0.3324226737, 0.2090015411, -0.2888941765, 0.3288913071, -0.2253594249, -0.3025456965, -0.0679496303, 0.0877481848, 0.8110826015, -0.0809321404, 0.1577157229, -0.1047106534, -0.3233385682, 0.4059962928, -0.2327057123, 0.2079767436, -0.2531996369, -0.2549885511, -0.1602256, -0.2344595641, 0.4729739428, 0.1805526018, -0.1103877127, 0.3075830936, -0.4579270482, 0.3586803675, -0.1905741692, 0.1103416383, -0.24522838, 0.0999714881, 0.0334637612, 0.1664405316, -0.0294461884, 0.3087553978, -0.1583583057, 0.1298673302, 0.085704498, 0.2419231832, -0.4965530038, -0.1260901988, 0.0283942893, 0.2636705935, -0.3742271662, -0.4050732255, 0.4280454516, 0.2767011821, 0.3951703906, 0.0871891901, -0.2225191742, 0.3622685671, 0.1929381341, 0.1235756725, -0.1346282363, -0.1545105278, 0.14738442, 0.1390645504, -0.3111178279, 0.090287149, -0.0450939238, -0.1597729027, 0.043238759, 0.3093546629, 0.1202120036, -0.3497835994, -0.2250767052, 0.2266208231, 0.1959670037, 0.0931316316, 0.1234253645, 0.1805721372, 0.2332047522, 0.3488667905, -0.5268515348, -0.2841076851, -0.0600968525, 0.4590161443, 0.5724372268, -0.1469995528, 0.5827162266, -0.0361850187, -0.3093141913, -0.2024858594, -0.1136060134, 0.1153996289, -0.1437117904, 0.1465326399, -0.0635503083, 0.2393676341, 0.1057116762, 0.057504721, 0.1236135587, 0.0426458642, -0.1881809831, -0.2267200649, -0.2250870168, -0.1304014176, -0.0795431733, 0.4237508178, -0.1307201684, -0.124959439, -0.1547616273, 0.0462998077, -0.2889908254, 0.0783740729, -0.2232809514, 0.1012439132, 0.1913746446, -0.0936260521, 0.1094515175, -0.3080515265, -0.1040449664, -0.0126842987, -0.3979836106, -0.169321537, 0.0203969106, 0.1602524072, -0.1382477283, -0.2311488688, 0.0558579266, -0.3819753528, 0.038037952, -0.0533148237, 0.1250464618, 0.4172587395, 0.0579880923, -0.0271961875, -0.0339337513, -0.0306238718, -0.2523113191, -0.1675625443, -0.1354079396, 0.0299077891, 0.2597558498, 0.1947024763, 0.0351849273, 0.1711549312, -0.3019528091, 0.2385358959, 0.2598298192, 0.1949337721, 0.1614031792, -0.145969063, 0.0144772604, 0.3086938858, 0.4575977921, 0.1588777155, -0.1488351673, -0.3826072216, 0.0354974046, 0.1678586155, -0.1444536746, -0.2038938254, 0.1804098636, 0.1259716749, -0.126183629, 0.184687376, 0.4293409288, 0.0687761605, 0.3359305561, 0.13705194, 0.6464179754, -0.4157041609, 0.4020082355, -0.0214491598, 0.124148719, -0.1396702826, 0.4943686426, 0.1702252924, 0.1256911457, 0.4902682304, 0.2014725357, 0.1294520646, 0.52049613, 0.2998253703, -0.5431533456, -0.6889318228, 0.273827225, 0.3488749862, -0.3763976097, 0.2423749864, 0.0201688353, 0.0024438128, -0.260920167, 0.1678769439, -0.1381924152, 0.1791605204, -0.1543648243, -0.1634517908, 0.5487618446, -0.2669769228, 0.115844667, 0.0672508776, -0.0067789266, 0.1863046288, 0.1822023541, -0.1288622469, -0.0684219301, -0.4192672968, 0.2929191291, 0.2478071153, 0.3598953784, -0.2545067966, 0.1231473982, 0.099615179, -0.0398910679, 0.1149681062, 0.3805099428, 0.517098546, 0.0935733095, 0.1812500805, 0.051708404, 0.0577837713, 0.0136836246, -0.1843720078, 0.3988667428, -0.116481483, -0.0592682809, 0.0101741962, 0.112757802, -0.0093596112, 0.0828232616, 0.1456763446, 0.046597939, -0.4272488058, 0.016046267, 0.1558160484, -0.0448786691, 0.0233875327, 0.2268604934, -0.2670724988, -0.137284413, 0.6190406084, 0.0123453513, 0.2194405496, -0.1615924835, 0.071788922, -0.0920790508, 0.3734672368, 0.18229267, 0.1486894041, -0.3880923688, -0.0458999723, -0.7635442615, -0.0579609722, -0.433213532, 0.0615110025, 0.0375058539, 0.1487490386, -0.2146016955, -0.0109136226, 0.1640011072, -0.0992858633, -0.2824615538, 0.0789491236, -0.14918226, -0.032743413, -0.0718953088, -0.2404253781, -0.1748697758, -0.3282741904, 0.3216020167, -0.0223110802, 0.0536649078, -0.0545276664, -0.1020411476, 0.1952948123, -0.0020404672, 0.363530457, 0.1444203705, 0.4088546634, 0.2295742929, 0.0669232979, -0.3549904525, -0.221150443, -0.2582733333, 0.2048447132, 0.09216851, 0.1315235645, -0.6213536263, -0.1107708514, -0.1644388437, 0.3291618228, 0.0122516453, -0.200685069, 0.0399543419, -0.1441811174, -0.179424867, 0.4260332286, -0.0349130295, 0.3897731304, 0.1582593173, 0.4375877082, -0.3942761719, -0.0755255222, 0.2275888026, -0.3375063837, -0.3425861597, -0.0241610296, 0.2251670808, 0.1019809693, -0.1575054973, -0.4065973759, -0.0406342298, 0.4557801783, -0.2565909624, -0.0541674793, 0.2129298747, -0.0525501221, 0.0668796748, 0.0248620957, 0.1761420816, 0.0781630427, -0.1209690198, 0.188171804, -0.2954847217 ]
https://github.com/huggingface/datasets/issues/2187
Question (potential issue?) related to datasets caching
I can provide details about the code I'm running (it's really-really close to some official samples from the huggingface transformers examples, I can point to the exact sample file, I kept a record of that). I can also describe in which conditions this race occurs (I'm convinced it has to do with forcing the redownloading of the dataset, I've been running hundreds of experiments before and didn't have a problem before I forced the redownload). I also can provide samples of the different stack errors I get and some details about the level of concurrency of jobs I was running. I can also try to imagine how the race manifests (I'm fairly sure that it's a combo of one job cleaning up and another job being in the middle of the run). However, I have to cleanup all this to make sure I'm no spilling any info I shouldn't be spilling. I'll try to do it by the end of the week, if you think all this is helpful. For now, I have a workaround. Don't use forcing redownloading. And to be ultra careful (although I don't think this is a problem), I run a series of jobs that will prepare the datasets and I know there is no concurrency wrt the dataset. Once that's done (and I believe even having multiple jobs loading the datasets at the same time doesn't create problems, as long as REUSE_DATASET_IF_EXISTS is the policy for loading the dataset, so the filelock mechanism you're using is working in that scenario), the prepared datasets will be reused, no race possible in any way. Thanks for all the details you provided, it helped me understand the underlying implementation and coming up with workarounds when I ran into issues.
I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
291
Question (potential issue?) related to datasets caching I thought I had disabled datasets caching in my code, as follows: ``` from datasets import set_caching_enabled ... def main(): # disable caching in datasets set_caching_enabled(False) ``` However, in my log files I see messages like the following: ``` 04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877 04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93 ``` Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! I can provide details about the code I'm running (it's really-really close to some official samples from the huggingface transformers examples, I can point to the exact sample file, I kept a record of that). I can also describe in which conditions this race occurs (I'm convinced it has to do with forcing the redownloading of the dataset, I've been running hundreds of experiments before and didn't have a problem before I forced the redownload). I also can provide samples of the different stack errors I get and some details about the level of concurrency of jobs I was running. I can also try to imagine how the race manifests (I'm fairly sure that it's a combo of one job cleaning up and another job being in the middle of the run). However, I have to cleanup all this to make sure I'm no spilling any info I shouldn't be spilling. I'll try to do it by the end of the week, if you think all this is helpful. For now, I have a workaround. Don't use forcing redownloading. And to be ultra careful (although I don't think this is a problem), I run a series of jobs that will prepare the datasets and I know there is no concurrency wrt the dataset. Once that's done (and I believe even having multiple jobs loading the datasets at the same time doesn't create problems, as long as REUSE_DATASET_IF_EXISTS is the policy for loading the dataset, so the filelock mechanism you're using is working in that scenario), the prepared datasets will be reused, no race possible in any way. Thanks for all the details you provided, it helped me understand the underlying implementation and coming up with workarounds when I ran into issues.
[ -0.2184483707, -0.0956565291, -0.0137407295, 0.3255731761, 0.1443526447, 0.0401229486, 0.2102063298, -0.0006149393, 0.2891818583, -0.2389941812, -0.017255554, -0.122287713, -0.2192768306, 0.0667363852, -0.0892677978, 0.3100435138, 0.1153512597, -0.0467660688, -0.2045851648, 0.0261501074, -0.0979611054, 0.0027088244, -0.0717039183, 0.0735592693, -0.5078136325, -0.1520061195, 0.1791336536, 0.1339300275, 0.1075710803, -0.507486701, 0.4659927785, 0.3332923949, 0.1759842932, 0.5821757913, -0.0001166995, 0.0438800752, 0.2641132772, -0.0501921661, -0.2653782964, 0.0882523358, -0.2523035705, -0.2569716275, 0.2132928669, -0.0493345186, -0.1088622212, 0.0157410502, 0.1350110173, -0.6665103436, 0.7769579887, 0.1939106882, 0.1887286752, 0.2240135819, -0.3726794124, 0.0592404641, 0.0492231995, 0.2028091699, -0.0299785845, -0.0593013987, 0.3182840049, -0.1498448849, -0.2916332781, 0.3643890023, -0.1399882138, 0.2117859721, 0.5098316669, -0.0168477204, -0.2728925347, -0.2045926154, 0.1750508547, 0.135580495, 0.6188476086, -0.2201792747, -0.2451947778, -0.4416946769, -0.2497268319, -0.2914445698, 0.2839870155, -0.0784028918, -0.0207540728, 0.2485282719, -0.5805149674, -0.0892047659, -0.0174451247, -0.269136101, -0.0459528789, -0.0092215873, -0.2377450168, 0.1776919216, 0.0724420771, 0.1365373731, 0.4682552218, -0.4004387558, 0.0528008714, 0.146436125, -0.5663053989, -0.0044938028, 0.1840798408, 0.4157844186, -0.0239244215, 0.0996472016, -0.1134609729, 0.006555479, -0.0779410303, -0.0695118159, 0.4441513717, 0.3384642899, -0.1350045502, 0.1796701849, 0.2509439588, 0.0115088336, -0.0748263747, -0.044779215, 0.1517454684, -0.3178056479, 0.4623071551, 0.0269141309, 0.2113277912, -0.3225101233, -0.3603184223, 0.0980269313, 0.1430569589, -0.1305945516, 0.1650649458, 0.2228051275, -0.0674748793, -0.1174940169, 0.0155916587, -0.0915751159, -0.3483349681, -0.3060492277, -0.234436959, -0.1986524463, -0.32939744, 0.0883618072, 0.1922551692, -0.2432705462, -0.0837707743, 0.2886391878, 0.2113749832, -0.139336586, 0.05593808, -0.020942945, 0.1351682991, 0.3564773202, -0.3113026619, 0.3331823051, 0.3844088018, 0.0039457977, -0.1590265632, 0.1457966864, -0.2420636714, -0.4122131765, 0.0911553428, 0.0609006658, -0.5861329436, 0.0046571847, -0.2381554693, 0.1079231948, 0.4921093881, 0.1390793473, 0.163964361, -0.1510179341, -0.1433898509, -0.1491029263, -0.0015658587, 0.7684627771, -0.4081894159, -0.0344140977, -0.1229348481, 0.028286878, 0.1170179993, 0.3622055948, -0.5105875731, 0.1386978477, -0.1987220645, -0.2503764629, -0.1604592502, -0.2873805761, -0.4558068514, 0.1284735799, -0.0716119409, 0.4496456385, 0.1800093949, 0.0716421008, 0.0661641881, -0.1947532445, -0.0151455328, 0.0183859132, 0.0790264308, -0.0493957102, -0.1938405633, -0.5073305964, 0.1770640463, 0.0141507089, 0.1087332591, 0.0926751941, -0.1015163958, -0.0482050516, 0.0621734373, -0.1136099026, 0.1263995767, 0.2767603397, -0.0203790423, 0.0538354665, 0.0563507751, 0.0637692213, -0.7198371887, 0.3640690446, 0.0621957779, -0.1775555909, -0.0647809654, -0.1762676537, -0.2811448574, -0.0513726622, -0.4152140319, -0.2084296346, -0.0077644102, -0.0453627743, 0.0941109955, -0.1766500473, -0.1650436223, 0.6631064415, -0.2613234818, -0.0377371609, -0.4285821915, 0.209710896, -0.0056177853, 0.1183557957, -0.1302143633, 0.0049770586, 0.148341611, -0.0457021184, 0.05552084, 0.2990192175, -0.0373429842, 0.4231199622, 0.0562375784, 0.3884785473, 0.060231559, -0.0962393731, 0.2031459659, 0.0306120291, 0.0598438047, 0.0012684986, -0.2350691706, 0.3701173067, -0.3914733827, 0.2245016247, -0.1687198728, -0.1664041281, 0.1337195635, -0.1492455602, -0.0884990841, 0.0524172187, 0.1954357028, 0.1490412056, 0.0420343727, 0.2648721635, -0.1553646922, 0.0830847472, 0.3847405612, -0.0000492781, -0.0716431737, 0.0249559246, -0.1766464412, -0.2358374745, 0.134090811, 0.4145578444, 0.4774113894, 0.0927884281, 0.0733266324, 0.0247049537, -0.1316233277, -0.2188065201, 0.2385986149, -0.0333115719, -0.0063821636, 0.1322800815, 0.1501538306, -0.1033412218, -0.5073176026, -0.0526212528, 0.1299572587, 0.247608453, -0.4868391454, 0.3516367972, -0.2426549792, 0.0176860467, -0.2625910044, 0.085315153, -0.3560932279, -0.2444312871, 0.0534923524, 0.2039729059, 0.0836241767, 0.0649750605, -0.1669403911, 0.477325201, -0.1676077098, 0.0121736955, -0.262776196, -0.2786839604, -0.2398257256, -0.0141076781, 0.2255121171, -0.1726499349, 0.252011776, 0.0302070752, 0.0040561184, -0.1593362838, -0.0121280551, -0.1062168032, -0.0289149992, 0.3015745878, -0.1936889738, 0.1197011471, -0.0767588913, -0.171968177, -0.0160151459, -0.1238482818, -0.0658682436, -0.1261278093, -0.0156723037, 0.1032824591, -0.0041501448, -0.1276310682, -0.1971974373, -0.2334642559, 0.0609404594, -0.07192716, -0.1150186807, 0.6053478122, -0.029770026, -0.0719686821, 0.0590288304, -0.1717267781, -0.6445997357, -0.3447817862, 0.1292091608, 0.0916934907, -0.1958632171, 0.0055273175, 0.0989453197, 0.2120895386, 0.1458245963, -0.6791311502, 0.0002878122, -0.2181430161, -0.0537379012, 0.1720141619, 0.050024122, 0.3800396323, 0.1637681425, -0.0125734657, -0.0002624691, -0.0968446285, -0.0199534483, -0.0650366619, 0.3751191199, -0.0797758847, 0.0927567035, 0.0115721077, 0.9484991431, 0.3921335638, -0.192159161, 0.0230163485, 0.1780515015, 0.5541976094, -0.052403532, -0.3691073954, -0.0638644472, -0.3495124578, -0.4030982852, 0.0950818062, -0.0727010593, 0.1678201407, 0.1396744847, 0.3958055377, -0.0177402273, -0.3547948897, 0.1807865947, -0.1882044673, 0.2042851746, 0.1746906191, -0.1109634861, -0.3441927731, -0.2060511708, -0.1491052508, 0.177360788, 0.2643486261, -0.0551455393, -0.3965284824, 0.0762182921, -0.4206965864, 0.3041408658, -0.1695514172, 0.1284061372, -0.2336471826, 0.1175066009, 0.322324723, 0.1550055891, 0.6023414731, -0.3451424837, 0.0229811035, 0.0821799263, -0.0549183227, -0.2506535649, -0.2354978621, -0.0634936988, 0.1432365924, 0.0611966103, 0.2134842873, -0.0873483866, -0.1546728611, -0.0518682078, 0.0747045353, -0.2156248987, -0.1743055731, -0.3656368554, -0.2099666297, -0.2125595361, 0.2507588863, 0.1931663603, -0.1734550446, -0.3332678676, 0.0755572841, -0.1186508238, 0.1591360569, 0.2175833434, 0.049536597, 0.2550600469, 0.2173021734, 0.0375319719, 0.510997951, -0.2194156796, 0.1631360501, 0.490352273, 0.0542377494, -0.2091219723, 0.0817094222, 0.1843611747, 0.0765582994, 0.5475755334, -0.2433156818, 0.2171186209, 0.3171910644, -0.067529209, -0.5061044693, -0.0654043183, 0.2310701609, 0.3086538315, -0.2962414622, -0.3967841864, 0.4350887239, 0.161139071, -0.2826728225, 0.2136974335, -0.0432990603, -0.2798189521, 0.1505188793, 0.0942791477, 0.9982908964, -0.1949734986, 0.2090243548, -0.019153744, -0.1586572975, 0.6049422026, -0.2817753553, 0.264633745, -0.108577773, -0.2103366256, -0.1136727333, -0.1672252268, 0.2565818131, 0.2159820944, -0.0513338521, 0.3694308102, -0.2387758195, 0.4395716488, -0.1976953447, 0.0810444951, 0.0563271567, -0.147630468, -0.1512928307, 0.149290055, -0.1385560036, 0.4672681093, -0.1525171399, 0.1019643843, 0.1897742599, 0.1193224192, -0.420796752, -0.0937194899, -0.0053805746, 0.2596657574, -0.0195940062, -0.2217672765, 0.3719567657, 0.23655276, 0.4461589754, -0.0853943601, -0.1838990003, 0.3200931251, -0.0009720586, 0.1532411575, -0.1228831187, -0.0911114961, 0.2610341609, 0.1777867228, -0.3299683034, 0.1710202098, 0.0224032141, -0.3243247271, 0.0540723801, 0.2893798053, 0.0432856269, -0.5138395429, 0.063202925, 0.3218320012, 0.1608243585, 0.0619603097, 0.0875605494, 0.1086738557, 0.1139113158, 0.3072551191, -0.2990088761, -0.3236632645, -0.1141428202, 0.4120744765, 0.4970078766, -0.2377083004, 0.5076004863, -0.0371102914, -0.2190784216, -0.1393058896, -0.1854183674, 0.2526699007, -0.5142330527, 0.1806242615, -0.0955933928, 0.1075657904, 0.1148711368, 0.1174008399, 0.2029695809, -0.0126270764, -0.2576304674, -0.0290426016, -0.3065878749, -0.0058658011, -0.0665066689, 0.3970098794, 0.0137835816, -0.067938596, -0.1032980531, 0.172350958, -0.2670113444, -0.0026374869, -0.2696270049, 0.1142376661, 0.1528416872, -0.3196125925, 0.2932241559, -0.2459307313, -0.1411475241, -0.0386361331, -0.4665693641, -0.1316974759, 0.0504768863, 0.1920237243, -0.0836312398, -0.2960078716, -0.1130536497, -0.1597792953, 0.1190346032, -0.1632991135, 0.2240611762, 0.3359928131, 0.0280140284, -0.0113086775, 0.049461145, -0.0827817023, -0.0830925032, -0.081722796, 0.0550621971, 0.2035271227, 0.3943222165, 0.2428921312, -0.0679366067, 0.0793475956, -0.3300126493, 0.2858979702, 0.3381082714, 0.2159093469, 0.1693321615, -0.2660118639, -0.0638594627, 0.1596681923, 0.3380589187, 0.2196957469, -0.0931826979, -0.3879361451, -0.0108067021, 0.1076497808, -0.1728516817, -0.1275530457, 0.304849714, 0.273982048, -0.1411840171, 0.3339982927, 0.4254001081, 0.0563324392, 0.5450053811, 0.1230323017, 0.8266115785, -0.4311628044, 0.4370397329, -0.0314343348, 0.0473013073, -0.0394716449, 0.6299877763, 0.2780949175, 0.2424534857, 0.3363350928, 0.1222376078, 0.0032552294, 0.0569305457, 0.3076252937, -0.3858354092, -0.705435276, 0.1817714423, 0.4742477536, -0.3341673911, 0.1956606209, 0.0491508134, 0.1231237277, -0.2674401999, 0.0476265028, -0.3517277837, 0.2956911027, -0.1455843449, -0.2735616267, 0.5554331541, -0.1987347156, 0.1009410173, 0.1675458252, -0.0342249572, -0.0270053074, 0.294855237, -0.2003127486, -0.1536577642, -0.282043308, 0.1737098843, 0.1838053465, 0.3505780697, -0.1240312457, 0.2311262488, 0.2219637483, 0.0254685339, 0.1306249052, 0.4619572163, 0.5259418488, -0.0516011715, 0.083989948, 0.2164375484, 0.0298782513, 0.1085667089, -0.186169982, 0.3402247429, -0.1844011545, -0.0597759187, 0.0274577327, 0.1202936471, 0.0130257234, -0.0148181561, -0.1308912635, 0.122337006, -0.3265520036, -0.0460147373, 0.0294296928, -0.0492128469, -0.0707076192, 0.1818909347, -0.2867634296, -0.0290516876, 0.5673052669, -0.1833666563, 0.2569793463, -0.100605458, 0.0487733111, -0.1099192202, 0.5449647307, 0.3410853446, 0.1019505709, -0.2991896272, -0.0146677196, -0.6810795069, -0.0785883963, -0.2810330987, 0.2189972401, 0.1051526368, 0.2027107775, -0.1195543706, 0.0607271977, 0.0004607886, -0.1750669479, -0.3195894957, -0.0104575753, -0.0973802358, 0.0199283399, 0.0048054578, -0.0699747279, -0.103816554, -0.2499149889, 0.2984416187, 0.2389938533, -0.035439495, -0.0437828302, 0.0643720031, 0.1109832078, 0.0058756014, 0.2429562807, 0.2596435845, 0.2820844948, 0.3239371777, 0.0057566836, -0.4033369124, -0.2470774651, -0.1818034053, 0.1646514535, 0.0001340769, 0.1116919369, -0.4221593142, -0.0303592589, -0.2969039679, 0.1451148838, 0.149947837, -0.2467026412, -0.0663997903, -0.1645843685, -0.2145697922, 0.2962660193, 0.1407628506, 0.4002630115, 0.0999287292, 0.3906541169, -0.4157350659, -0.1032344103, 0.4054409266, -0.3376232982, -0.3259878159, 0.0948295295, 0.1858664751, 0.1200377122, -0.2982679307, -0.5435608625, 0.0448630899, 0.2724537551, -0.2036098242, -0.1230366752, 0.1326121688, -0.0984338671, 0.0288574696, -0.0705798864, 0.2866346836, 0.0962143838, -0.1128979251, 0.241896823, -0.2190688401 ]
https://github.com/huggingface/datasets/issues/2185
.map() and distributed training
Hi, one workaround would be to save the mapped(tokenized in your case) file using `save_to_disk`, and having each process load this file using `load_from_disk`. This is what I am doing, and in this case, I turn off the ability to automatically load from the cache. Also, multiprocessing the map function seems to be slower at the moment (#1992), hope this helps you.
Hi, I have a question regarding distributed training and the `.map` call on a dataset. I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`. `dataset` is then tokenized: ```python datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, ) ``` I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split). When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect. Everything so far was done by launching a **single process script**. I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files. I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it. **My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training. - I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case) - I am using 1.5.0 version of datasets if that matters.
62
.map() and distributed training Hi, I have a question regarding distributed training and the `.map` call on a dataset. I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`. `dataset` is then tokenized: ```python datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, ) ``` I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split). When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect. Everything so far was done by launching a **single process script**. I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files. I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it. **My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training. - I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case) - I am using 1.5.0 version of datasets if that matters. Hi, one workaround would be to save the mapped(tokenized in your case) file using `save_to_disk`, and having each process load this file using `load_from_disk`. This is what I am doing, and in this case, I turn off the ability to automatically load from the cache. Also, multiprocessing the map function seems to be slower at the moment (#1992), hope this helps you.
[ -0.2537619472, -0.2207169682, 0.1177767664, 0.0745748281, 0.2116163522, -0.1097596213, 0.517072916, 0.0102050584, 0.2801567912, 0.0237629861, 0.182247296, 0.3434495926, -0.2290641069, -0.585545063, 0.0941430628, 0.0615339167, 0.1861156076, 0.0366592631, -0.0377358235, -0.2008031309, -0.1529331058, 0.0759169385, -0.1542708427, 0.1170514226, -0.754070878, -0.1523152441, -0.1834535599, 0.1027399823, 0.2253177315, -0.3499085009, 0.2342272103, 0.2213347852, 0.4013624787, 0.533691287, -0.0001272091, 0.0312626213, 0.1878609806, -0.1983309984, 0.0397177264, -0.0476762652, 0.1641905904, 0.005025059, 0.1936111301, -0.2953359783, 0.1310727298, -0.1476739794, 0.3262221217, -0.4418165088, 0.4140007496, -0.1077296808, -0.0018774681, 0.094389841, -0.5714962482, 0.1398763508, -0.2214402407, 0.1234800816, 0.1711139083, 0.2180823535, 0.3029263616, -0.3416555524, -0.3789152503, 0.1582275778, -0.1466239989, 0.1340595335, 0.4135628343, 0.036602024, -0.078988269, -0.3487008512, -0.0757501423, -0.1218584031, 0.1076877862, -0.0743067116, -0.1881789863, -0.4665385485, -0.2733977735, -0.001658164, -0.0024628788, 0.1162435859, -0.0233726911, -0.1197141707, -0.512409389, -0.0625249892, 0.0552944392, 0.132654354, -0.273260951, 0.4564464986, -0.0254736356, 0.3163393736, 0.141992867, 0.0543378033, 0.0837464631, -0.1719923615, 0.1296370924, 0.3715827763, 0.0275524706, 0.0141743571, 0.0489276126, -0.3223411739, -0.023288928, 0.0356097408, 0.2321068347, 0.2598093748, -0.0479856357, 0.2657663226, 0.4007704258, 0.0927505344, -0.1391407102, 0.6415418386, 0.0301114023, -0.2004717439, -0.6418212652, -0.1724126041, -0.3519452512, -0.062735334, 0.3335890174, 0.0427099243, -0.2098454833, 0.0722273961, 0.4604044259, -0.2394171804, -0.0065295845, -0.132543534, 0.0212122351, 0.2508154511, 0.1287932247, 0.437037766, -0.0555273294, 0.1014267951, -0.1901603639, 0.1589484066, -0.0596043617, -0.3029897809, -0.3049107194, 0.3160682917, 0.161876902, 0.1877593845, 0.423969537, -0.100110516, 0.2894420028, -0.1613696516, 0.3981885314, -0.1120457947, 0.6585770845, 0.1044586003, -0.2513779104, 0.2223657221, 0.186222285, 0.3770999908, -0.1535632014, 0.3354170024, -0.5022830367, -0.4383485317, 0.4798752666, -0.0732972249, -0.0095937811, 0.0692020059, -0.1767220795, 0.0427593216, 0.5391664505, -0.2560786605, 0.1344240457, -0.3575461507, -0.2090657055, -0.1776280105, 0.2568798959, 0.4551612437, 0.3137150407, -0.341817081, 0.1241684109, 0.3162252903, 0.2081830353, 0.2290947139, -0.6239325404, 0.3898103237, -0.2199798524, 0.2747524381, 0.3872870207, -0.3571225405, -0.143522799, 0.2945979238, -0.0989741981, 0.0233591348, -0.157093972, -0.0249816477, 0.4641163051, -0.0252319407, 0.1258822232, 0.2964550555, -0.2162624151, 0.2001039684, -0.261736393, 0.0169192627, 0.0804381818, -0.0070854127, 0.1947209984, 0.0033708699, -0.0128012858, 0.1196199283, 0.2070771605, 0.0102299741, 0.2283789366, 0.0252540223, -0.3850676417, 0.0924093872, 0.1654823869, 0.0665196776, -0.1504981518, 0.1814237386, -0.0332354344, -0.395929575, -0.1602500081, -0.0522116944, 0.1628750861, -0.2076937109, -0.3108921647, -0.140207693, -0.1141550168, 0.1380292624, -0.0407927744, -0.2170622051, -0.3000540137, -0.0936287269, 0.141043365, -0.0588693954, 0.2177681029, 0.1037803665, 0.1914525926, -0.1203962192, -0.431758821, -0.1487240344, 0.1081420481, -0.2924800217, -0.1076145172, 0.3776342273, 0.0455736034, 0.2080195993, -0.1105848402, 0.3216449618, 0.2376917005, 0.0668992102, 0.1610090286, 0.1279922724, -0.1245719418, -0.1512018591, -0.1420783103, 0.3465424478, 0.1289894879, 0.1471359134, -0.0155484304, 0.0163483992, 0.0418231338, 0.0829827636, -0.2396876514, -0.0824882835, -0.3200369775, -0.1921789348, 0.2612731457, 0.1546634585, 0.0379147306, 0.0008641295, 0.3312497437, 0.0261269882, 0.0083662262, -0.14848122, -0.180636093, 0.0400648564, 0.1552489996, 0.1572334617, 0.3422778249, -0.0142573696, 0.3932814896, -0.1144815236, 0.1034137234, 0.0622592606, -0.0817418396, -0.0038882717, 0.2324123085, 0.1578573287, -0.0431561135, 0.1835178435, -0.2471134365, -0.1046326831, 0.3485344946, -0.2459665984, 0.0869296342, 0.2329534143, -0.0123325735, 0.1808803827, -0.5816081762, 0.0918161497, 0.0024794023, 0.0669040158, -0.1619980931, 0.2604070306, -0.0950390548, 0.4181236327, -0.0660850555, 0.2435845733, -0.1192761064, -0.2782997191, 0.1805500984, -0.1531218886, -0.0121599045, -0.1923268735, 0.1284363866, -0.2399803549, -0.0226503722, 0.0775609016, -0.0577870049, -0.142930001, 0.1827362478, 0.1133465171, 0.2074271441, -0.555270493, -0.2969097197, -0.0320735052, -0.3787957728, -0.1486829072, 0.168632552, -0.4979082942, 0.1192708388, -0.0551380515, 0.2452644408, -0.171756655, -0.1245702505, -0.3170385063, -0.2305707932, -0.0193638355, 0.1338817179, -0.0549431816, 0.1418406367, 0.0033791289, -0.1053655893, -0.239378795, -0.1764802337, -0.2918812037, 0.0651776791, -0.5251653194, 0.3886309266, -0.1867224574, -0.047136981, -0.1093478873, -0.0461092293, -0.0654087365, 0.639970541, -0.3348985016, 0.0144050941, 0.3095328808, -0.0101135373, -0.0965967774, 0.1116472706, 0.5424689054, 0.1066483036, 0.1266250014, -0.0549989305, 0.2443152219, 0.2560414374, 0.1710577011, 0.0513748713, 0.15952757, -0.1193903238, 0.1637128294, 1.278239131, 0.1522192508, -0.0518915243, 0.0262435935, 0.0314820632, -0.014047185, 0.0686669946, -0.1058128178, 0.061383713, -0.3951033354, -0.1308123171, 0.1793063432, 0.18719396, -0.5139592886, 0.0521273613, 0.1936311424, -0.0122206286, -0.3019164205, 0.3315780759, -0.7171850801, 0.582773149, 0.0590840429, 0.0178888738, -0.4254793525, 0.0453996658, 0.0945204943, -0.1513162851, 0.7113602757, 0.053421177, -0.4360211492, 0.08626692, -0.1918415129, 0.0394078717, 0.2148353308, 0.2028767169, 0.0952698588, -0.1703165025, 0.1477957815, 0.1729287803, 0.405384481, -0.063953355, 0.0224065613, 0.1169935167, -0.2179407179, -0.1327844262, -0.1501160115, 0.0643642396, 0.3700456619, 0.0236488804, 0.4308014512, -0.030336827, -0.1774691939, -0.4406906962, 0.0884209424, -0.3515691161, -0.0433642194, -0.1870868653, 0.0759659261, -0.2960947752, 0.2095095217, 0.3047896624, -0.1735833734, -0.0213713646, -0.2622390985, -0.0159955509, 0.3147194684, -0.1036772579, 0.0370822325, 0.2442337722, 0.1481230259, 0.0131701007, 0.4719133377, 0.2137568742, 0.2138779163, 0.3546655476, -0.3274185061, -0.139388755, 0.036832314, 0.0073548444, 0.2340704203, 0.1898226589, 0.0306466445, -0.2361026853, 0.1773867309, -0.1677423269, -0.2283786237, 0.2950415909, 0.1178725809, 0.0684983134, -0.1757792085, -0.4709652364, 0.0921666026, 0.1839779615, -0.2220707238, 0.4868580997, -0.8516541123, -0.261679858, 0.4181655049, 0.0608370043, 0.6925718784, -0.2607026696, 0.2272644192, -0.2504416406, 0.4874331057, 0.0204546265, -0.6066103578, 0.42003721, -0.2548579276, -0.204164952, -0.0412223041, -0.1717180312, -0.1559634209, 0.7070310712, 0.0804176033, 0.1725239605, 0.1165398508, 0.3262237012, -0.0640338063, 0.0934553519, 0.2966888249, -0.4377834797, 0.2290287763, -0.0624264441, 0.1829896122, 0.1569691002, -0.0804342628, 0.0565102436, 0.1240404099, -0.2584004402, 0.2086895406, 0.0717218891, -0.360072583, 0.3634981811, 0.0398199037, 0.0521443784, -0.2433338165, 0.6011245251, 0.0109047722, -0.2319957167, 0.0940761417, 0.0436989516, 0.1931170076, -0.0126968957, -0.262334615, -0.169743225, 0.1262997985, 0.0967981815, -0.1459383368, -0.1205742359, -0.3000963628, -0.4416498542, -0.2237545699, 0.3600804508, 0.6041751504, -0.0505639203, -0.0588484667, 0.2081899047, -0.0861716345, 0.1668844819, -0.0069434615, 0.0640016198, -0.1381702721, 0.3867055774, -0.0235092826, -0.124290362, 0.2014888674, 0.3131967187, -0.1574298441, -0.1682619452, 0.2568945587, -0.2654669881, -0.0969374478, -0.0573922843, -0.0330520421, 0.1389323622, -0.3625165224, 0.0169915408, -0.1065595821, 0.0166314691, 0.0993063748, 0.0837629214, 0.1839829534, 0.1075275317, -0.3239929974, -0.1815753281, -0.3717833757, -0.0278920494, -0.1365002841, 0.0505665839, 0.2734040618, 0.1305767596, 0.1053176671, 0.3764919043, -0.1317268908, 0.1228380427, 0.0817989707, 0.3973925412, -0.051866807, 0.0050210916, -0.1158293486, -0.0291920509, -0.1875381917, 0.0908715948, -0.1421472132, 0.0042556003, 0.0848782957, 0.2250857353, 0.194545269, -0.0718453526, -0.0755311549, -0.2173605263, 0.1162217557, -0.4500404298, 0.0487678051, 0.0160333216, -0.1881896853, 0.0467121862, 0.5341086984, 0.1623099893, -0.4041573107, 0.1451511979, -0.0866433829, -0.0505962074, -0.03202492, 0.1041377038, 0.1630801857, -0.0049901083, -0.0814535916, -0.034553919, 0.3659768105, 0.1690804958, 0.4754380584, -0.227211684, 0.0704820603, -0.0292813014, 0.1734143049, 0.2325784564, -0.3147430122, -0.0599207804, 0.3415471017, 0.0241224971, 0.0282655209, -0.1990051568, 0.3771485984, 0.0867176056, -0.1169267446, 0.2695806026, 0.291313231, -0.3984208405, 0.1071691513, 0.13878043, 0.5225747228, -0.3287660778, 0.2685765028, 0.0269058626, 0.0857228786, 0.1760593802, 0.2698517144, 0.3104492426, 0.1782117337, -0.07478185, 0.0293806009, 0.2496602088, 0.3985043764, -0.1035520285, -0.1874761581, -0.4894892871, -0.0736386031, -0.00440979, -0.0369605608, 0.1242682934, -0.2778053284, 0.272898376, -0.2847648561, -0.5857909322, 0.1254217029, 0.3274547458, -0.2013133466, -0.088679865, 0.0926785469, 0.0113809705, -0.0462345928, 0.0941593796, 0.0441684611, 0.209709987, 0.559330225, 0.0858864114, 0.018109601, 0.1541573405, -0.0717383325, 0.0019632252, 0.4593268633, -0.3261109591, 0.1913288832, -0.1725732386, 0.0807393491, 0.0200429894, -0.0315709189, 0.0498549007, 0.522872746, -0.1188719869, 0.1938308775, 0.0442507267, 0.1886545122, -0.1131995469, 0.1667530388, -0.1233739406, -0.300684303, 0.0307742395, -0.0814751685, -0.0131050814, 0.0288236253, -0.0665219277, 0.0668583736, 0.2088632584, 0.2820907235, 0.1485460997, -0.1038458049, 0.1028902605, 0.0694102198, -0.3599322438, 0.1259171963, 0.2366672605, -0.289726913, 0.1959314644, 0.0505573712, -0.0399407893, 0.0708529651, 0.2542790771, 0.1748006642, 0.0303766839, -0.2747747898, -0.3522975445, -0.6728183627, 0.3023856282, 0.0174809434, 0.2508773208, -0.1023808867, 0.0117321685, 0.0563801154, -0.0531249084, -0.2462202907, -0.2524301708, -0.0387766808, 0.352478534, -0.0957505926, 0.0024704244, -0.2875678539, 0.3995727003, 0.1458621621, -0.1972411871, 0.0653905943, -0.0597797446, -0.0863965303, 0.2657531798, -0.4236014485, -0.1760620624, 0.0676911324, 0.4964186847, 0.0649718791, 0.2099229097, 0.0600782335, 0.1801744699, -0.0981867015, 0.0451124385, -0.0188295692, -0.0528835915, -0.0837271884, 0.2601969242, -0.5280180573, -0.0028349936, -0.4991471171, -0.4763996303, 0.1246200353, -0.0155332424, 0.0108442381, -0.210577786, -0.2984158695, 0.0919266045, 0.2645702362, 0.4401882589, -0.0507175699, -0.0598964095, -0.2187688649, 0.0092305765, 0.2666279078, -0.6458786726, -0.2884698808, -0.2124375403, 0.1345546246, -0.0403621309, -0.0596353672, -0.4026407599, -0.072396636, 0.28345263, -0.0711671412, -0.4361753166, -0.1718804687, -0.0504204966, -0.170731619, -0.238054499, 0.4838342965, -0.0408490971, -0.2001534104, -0.0964372307, -0.1717200279 ]
https://github.com/huggingface/datasets/issues/2185
.map() and distributed training
Thanks @hwijeen for the workaround, feels a bit prototypical but it works! (it seems files are written twice then though) (I haven't observed slowness using multiprocessed map function but I could be wrong)
Hi, I have a question regarding distributed training and the `.map` call on a dataset. I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`. `dataset` is then tokenized: ```python datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, ) ``` I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split). When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect. Everything so far was done by launching a **single process script**. I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files. I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it. **My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training. - I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case) - I am using 1.5.0 version of datasets if that matters.
33
.map() and distributed training Hi, I have a question regarding distributed training and the `.map` call on a dataset. I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`. `dataset` is then tokenized: ```python datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, ) ``` I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split). When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect. Everything so far was done by launching a **single process script**. I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files. I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it. **My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training. - I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case) - I am using 1.5.0 version of datasets if that matters. Thanks @hwijeen for the workaround, feels a bit prototypical but it works! (it seems files are written twice then though) (I haven't observed slowness using multiprocessed map function but I could be wrong)
[ -0.2537619472, -0.2207169682, 0.1177767664, 0.0745748281, 0.2116163522, -0.1097596213, 0.517072916, 0.0102050584, 0.2801567912, 0.0237629861, 0.182247296, 0.3434495926, -0.2290641069, -0.585545063, 0.0941430628, 0.0615339167, 0.1861156076, 0.0366592631, -0.0377358235, -0.2008031309, -0.1529331058, 0.0759169385, -0.1542708427, 0.1170514226, -0.754070878, -0.1523152441, -0.1834535599, 0.1027399823, 0.2253177315, -0.3499085009, 0.2342272103, 0.2213347852, 0.4013624787, 0.533691287, -0.0001272091, 0.0312626213, 0.1878609806, -0.1983309984, 0.0397177264, -0.0476762652, 0.1641905904, 0.005025059, 0.1936111301, -0.2953359783, 0.1310727298, -0.1476739794, 0.3262221217, -0.4418165088, 0.4140007496, -0.1077296808, -0.0018774681, 0.094389841, -0.5714962482, 0.1398763508, -0.2214402407, 0.1234800816, 0.1711139083, 0.2180823535, 0.3029263616, -0.3416555524, -0.3789152503, 0.1582275778, -0.1466239989, 0.1340595335, 0.4135628343, 0.036602024, -0.078988269, -0.3487008512, -0.0757501423, -0.1218584031, 0.1076877862, -0.0743067116, -0.1881789863, -0.4665385485, -0.2733977735, -0.001658164, -0.0024628788, 0.1162435859, -0.0233726911, -0.1197141707, -0.512409389, -0.0625249892, 0.0552944392, 0.132654354, -0.273260951, 0.4564464986, -0.0254736356, 0.3163393736, 0.141992867, 0.0543378033, 0.0837464631, -0.1719923615, 0.1296370924, 0.3715827763, 0.0275524706, 0.0141743571, 0.0489276126, -0.3223411739, -0.023288928, 0.0356097408, 0.2321068347, 0.2598093748, -0.0479856357, 0.2657663226, 0.4007704258, 0.0927505344, -0.1391407102, 0.6415418386, 0.0301114023, -0.2004717439, -0.6418212652, -0.1724126041, -0.3519452512, -0.062735334, 0.3335890174, 0.0427099243, -0.2098454833, 0.0722273961, 0.4604044259, -0.2394171804, -0.0065295845, -0.132543534, 0.0212122351, 0.2508154511, 0.1287932247, 0.437037766, -0.0555273294, 0.1014267951, -0.1901603639, 0.1589484066, -0.0596043617, -0.3029897809, -0.3049107194, 0.3160682917, 0.161876902, 0.1877593845, 0.423969537, -0.100110516, 0.2894420028, -0.1613696516, 0.3981885314, -0.1120457947, 0.6585770845, 0.1044586003, -0.2513779104, 0.2223657221, 0.186222285, 0.3770999908, -0.1535632014, 0.3354170024, -0.5022830367, -0.4383485317, 0.4798752666, -0.0732972249, -0.0095937811, 0.0692020059, -0.1767220795, 0.0427593216, 0.5391664505, -0.2560786605, 0.1344240457, -0.3575461507, -0.2090657055, -0.1776280105, 0.2568798959, 0.4551612437, 0.3137150407, -0.341817081, 0.1241684109, 0.3162252903, 0.2081830353, 0.2290947139, -0.6239325404, 0.3898103237, -0.2199798524, 0.2747524381, 0.3872870207, -0.3571225405, -0.143522799, 0.2945979238, -0.0989741981, 0.0233591348, -0.157093972, -0.0249816477, 0.4641163051, -0.0252319407, 0.1258822232, 0.2964550555, -0.2162624151, 0.2001039684, -0.261736393, 0.0169192627, 0.0804381818, -0.0070854127, 0.1947209984, 0.0033708699, -0.0128012858, 0.1196199283, 0.2070771605, 0.0102299741, 0.2283789366, 0.0252540223, -0.3850676417, 0.0924093872, 0.1654823869, 0.0665196776, -0.1504981518, 0.1814237386, -0.0332354344, -0.395929575, -0.1602500081, -0.0522116944, 0.1628750861, -0.2076937109, -0.3108921647, -0.140207693, -0.1141550168, 0.1380292624, -0.0407927744, -0.2170622051, -0.3000540137, -0.0936287269, 0.141043365, -0.0588693954, 0.2177681029, 0.1037803665, 0.1914525926, -0.1203962192, -0.431758821, -0.1487240344, 0.1081420481, -0.2924800217, -0.1076145172, 0.3776342273, 0.0455736034, 0.2080195993, -0.1105848402, 0.3216449618, 0.2376917005, 0.0668992102, 0.1610090286, 0.1279922724, -0.1245719418, -0.1512018591, -0.1420783103, 0.3465424478, 0.1289894879, 0.1471359134, -0.0155484304, 0.0163483992, 0.0418231338, 0.0829827636, -0.2396876514, -0.0824882835, -0.3200369775, -0.1921789348, 0.2612731457, 0.1546634585, 0.0379147306, 0.0008641295, 0.3312497437, 0.0261269882, 0.0083662262, -0.14848122, -0.180636093, 0.0400648564, 0.1552489996, 0.1572334617, 0.3422778249, -0.0142573696, 0.3932814896, -0.1144815236, 0.1034137234, 0.0622592606, -0.0817418396, -0.0038882717, 0.2324123085, 0.1578573287, -0.0431561135, 0.1835178435, -0.2471134365, -0.1046326831, 0.3485344946, -0.2459665984, 0.0869296342, 0.2329534143, -0.0123325735, 0.1808803827, -0.5816081762, 0.0918161497, 0.0024794023, 0.0669040158, -0.1619980931, 0.2604070306, -0.0950390548, 0.4181236327, -0.0660850555, 0.2435845733, -0.1192761064, -0.2782997191, 0.1805500984, -0.1531218886, -0.0121599045, -0.1923268735, 0.1284363866, -0.2399803549, -0.0226503722, 0.0775609016, -0.0577870049, -0.142930001, 0.1827362478, 0.1133465171, 0.2074271441, -0.555270493, -0.2969097197, -0.0320735052, -0.3787957728, -0.1486829072, 0.168632552, -0.4979082942, 0.1192708388, -0.0551380515, 0.2452644408, -0.171756655, -0.1245702505, -0.3170385063, -0.2305707932, -0.0193638355, 0.1338817179, -0.0549431816, 0.1418406367, 0.0033791289, -0.1053655893, -0.239378795, -0.1764802337, -0.2918812037, 0.0651776791, -0.5251653194, 0.3886309266, -0.1867224574, -0.047136981, -0.1093478873, -0.0461092293, -0.0654087365, 0.639970541, -0.3348985016, 0.0144050941, 0.3095328808, -0.0101135373, -0.0965967774, 0.1116472706, 0.5424689054, 0.1066483036, 0.1266250014, -0.0549989305, 0.2443152219, 0.2560414374, 0.1710577011, 0.0513748713, 0.15952757, -0.1193903238, 0.1637128294, 1.278239131, 0.1522192508, -0.0518915243, 0.0262435935, 0.0314820632, -0.014047185, 0.0686669946, -0.1058128178, 0.061383713, -0.3951033354, -0.1308123171, 0.1793063432, 0.18719396, -0.5139592886, 0.0521273613, 0.1936311424, -0.0122206286, -0.3019164205, 0.3315780759, -0.7171850801, 0.582773149, 0.0590840429, 0.0178888738, -0.4254793525, 0.0453996658, 0.0945204943, -0.1513162851, 0.7113602757, 0.053421177, -0.4360211492, 0.08626692, -0.1918415129, 0.0394078717, 0.2148353308, 0.2028767169, 0.0952698588, -0.1703165025, 0.1477957815, 0.1729287803, 0.405384481, -0.063953355, 0.0224065613, 0.1169935167, -0.2179407179, -0.1327844262, -0.1501160115, 0.0643642396, 0.3700456619, 0.0236488804, 0.4308014512, -0.030336827, -0.1774691939, -0.4406906962, 0.0884209424, -0.3515691161, -0.0433642194, -0.1870868653, 0.0759659261, -0.2960947752, 0.2095095217, 0.3047896624, -0.1735833734, -0.0213713646, -0.2622390985, -0.0159955509, 0.3147194684, -0.1036772579, 0.0370822325, 0.2442337722, 0.1481230259, 0.0131701007, 0.4719133377, 0.2137568742, 0.2138779163, 0.3546655476, -0.3274185061, -0.139388755, 0.036832314, 0.0073548444, 0.2340704203, 0.1898226589, 0.0306466445, -0.2361026853, 0.1773867309, -0.1677423269, -0.2283786237, 0.2950415909, 0.1178725809, 0.0684983134, -0.1757792085, -0.4709652364, 0.0921666026, 0.1839779615, -0.2220707238, 0.4868580997, -0.8516541123, -0.261679858, 0.4181655049, 0.0608370043, 0.6925718784, -0.2607026696, 0.2272644192, -0.2504416406, 0.4874331057, 0.0204546265, -0.6066103578, 0.42003721, -0.2548579276, -0.204164952, -0.0412223041, -0.1717180312, -0.1559634209, 0.7070310712, 0.0804176033, 0.1725239605, 0.1165398508, 0.3262237012, -0.0640338063, 0.0934553519, 0.2966888249, -0.4377834797, 0.2290287763, -0.0624264441, 0.1829896122, 0.1569691002, -0.0804342628, 0.0565102436, 0.1240404099, -0.2584004402, 0.2086895406, 0.0717218891, -0.360072583, 0.3634981811, 0.0398199037, 0.0521443784, -0.2433338165, 0.6011245251, 0.0109047722, -0.2319957167, 0.0940761417, 0.0436989516, 0.1931170076, -0.0126968957, -0.262334615, -0.169743225, 0.1262997985, 0.0967981815, -0.1459383368, -0.1205742359, -0.3000963628, -0.4416498542, -0.2237545699, 0.3600804508, 0.6041751504, -0.0505639203, -0.0588484667, 0.2081899047, -0.0861716345, 0.1668844819, -0.0069434615, 0.0640016198, -0.1381702721, 0.3867055774, -0.0235092826, -0.124290362, 0.2014888674, 0.3131967187, -0.1574298441, -0.1682619452, 0.2568945587, -0.2654669881, -0.0969374478, -0.0573922843, -0.0330520421, 0.1389323622, -0.3625165224, 0.0169915408, -0.1065595821, 0.0166314691, 0.0993063748, 0.0837629214, 0.1839829534, 0.1075275317, -0.3239929974, -0.1815753281, -0.3717833757, -0.0278920494, -0.1365002841, 0.0505665839, 0.2734040618, 0.1305767596, 0.1053176671, 0.3764919043, -0.1317268908, 0.1228380427, 0.0817989707, 0.3973925412, -0.051866807, 0.0050210916, -0.1158293486, -0.0291920509, -0.1875381917, 0.0908715948, -0.1421472132, 0.0042556003, 0.0848782957, 0.2250857353, 0.194545269, -0.0718453526, -0.0755311549, -0.2173605263, 0.1162217557, -0.4500404298, 0.0487678051, 0.0160333216, -0.1881896853, 0.0467121862, 0.5341086984, 0.1623099893, -0.4041573107, 0.1451511979, -0.0866433829, -0.0505962074, -0.03202492, 0.1041377038, 0.1630801857, -0.0049901083, -0.0814535916, -0.034553919, 0.3659768105, 0.1690804958, 0.4754380584, -0.227211684, 0.0704820603, -0.0292813014, 0.1734143049, 0.2325784564, -0.3147430122, -0.0599207804, 0.3415471017, 0.0241224971, 0.0282655209, -0.1990051568, 0.3771485984, 0.0867176056, -0.1169267446, 0.2695806026, 0.291313231, -0.3984208405, 0.1071691513, 0.13878043, 0.5225747228, -0.3287660778, 0.2685765028, 0.0269058626, 0.0857228786, 0.1760593802, 0.2698517144, 0.3104492426, 0.1782117337, -0.07478185, 0.0293806009, 0.2496602088, 0.3985043764, -0.1035520285, -0.1874761581, -0.4894892871, -0.0736386031, -0.00440979, -0.0369605608, 0.1242682934, -0.2778053284, 0.272898376, -0.2847648561, -0.5857909322, 0.1254217029, 0.3274547458, -0.2013133466, -0.088679865, 0.0926785469, 0.0113809705, -0.0462345928, 0.0941593796, 0.0441684611, 0.209709987, 0.559330225, 0.0858864114, 0.018109601, 0.1541573405, -0.0717383325, 0.0019632252, 0.4593268633, -0.3261109591, 0.1913288832, -0.1725732386, 0.0807393491, 0.0200429894, -0.0315709189, 0.0498549007, 0.522872746, -0.1188719869, 0.1938308775, 0.0442507267, 0.1886545122, -0.1131995469, 0.1667530388, -0.1233739406, -0.300684303, 0.0307742395, -0.0814751685, -0.0131050814, 0.0288236253, -0.0665219277, 0.0668583736, 0.2088632584, 0.2820907235, 0.1485460997, -0.1038458049, 0.1028902605, 0.0694102198, -0.3599322438, 0.1259171963, 0.2366672605, -0.289726913, 0.1959314644, 0.0505573712, -0.0399407893, 0.0708529651, 0.2542790771, 0.1748006642, 0.0303766839, -0.2747747898, -0.3522975445, -0.6728183627, 0.3023856282, 0.0174809434, 0.2508773208, -0.1023808867, 0.0117321685, 0.0563801154, -0.0531249084, -0.2462202907, -0.2524301708, -0.0387766808, 0.352478534, -0.0957505926, 0.0024704244, -0.2875678539, 0.3995727003, 0.1458621621, -0.1972411871, 0.0653905943, -0.0597797446, -0.0863965303, 0.2657531798, -0.4236014485, -0.1760620624, 0.0676911324, 0.4964186847, 0.0649718791, 0.2099229097, 0.0600782335, 0.1801744699, -0.0981867015, 0.0451124385, -0.0188295692, -0.0528835915, -0.0837271884, 0.2601969242, -0.5280180573, -0.0028349936, -0.4991471171, -0.4763996303, 0.1246200353, -0.0155332424, 0.0108442381, -0.210577786, -0.2984158695, 0.0919266045, 0.2645702362, 0.4401882589, -0.0507175699, -0.0598964095, -0.2187688649, 0.0092305765, 0.2666279078, -0.6458786726, -0.2884698808, -0.2124375403, 0.1345546246, -0.0403621309, -0.0596353672, -0.4026407599, -0.072396636, 0.28345263, -0.0711671412, -0.4361753166, -0.1718804687, -0.0504204966, -0.170731619, -0.238054499, 0.4838342965, -0.0408490971, -0.2001534104, -0.0964372307, -0.1717200279 ]
https://github.com/huggingface/datasets/issues/2185
.map() and distributed training
To my understanding, files are written twice anyhow(one after load_dataset, another aftet map). It's just that you now have it at the location where you can see, whereas it was secretlely saved at caching folder(.cache/huggingface/datasets by default)! Correct me if I'm wrong!
Hi, I have a question regarding distributed training and the `.map` call on a dataset. I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`. `dataset` is then tokenized: ```python datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, ) ``` I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split). When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect. Everything so far was done by launching a **single process script**. I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files. I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it. **My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training. - I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case) - I am using 1.5.0 version of datasets if that matters.
42
.map() and distributed training Hi, I have a question regarding distributed training and the `.map` call on a dataset. I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`. `dataset` is then tokenized: ```python datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, ) ``` I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split). When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect. Everything so far was done by launching a **single process script**. I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files. I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it. **My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training. - I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case) - I am using 1.5.0 version of datasets if that matters. To my understanding, files are written twice anyhow(one after load_dataset, another aftet map). It's just that you now have it at the location where you can see, whereas it was secretlely saved at caching folder(.cache/huggingface/datasets by default)! Correct me if I'm wrong!
[ -0.2537619472, -0.2207169682, 0.1177767664, 0.0745748281, 0.2116163522, -0.1097596213, 0.517072916, 0.0102050584, 0.2801567912, 0.0237629861, 0.182247296, 0.3434495926, -0.2290641069, -0.585545063, 0.0941430628, 0.0615339167, 0.1861156076, 0.0366592631, -0.0377358235, -0.2008031309, -0.1529331058, 0.0759169385, -0.1542708427, 0.1170514226, -0.754070878, -0.1523152441, -0.1834535599, 0.1027399823, 0.2253177315, -0.3499085009, 0.2342272103, 0.2213347852, 0.4013624787, 0.533691287, -0.0001272091, 0.0312626213, 0.1878609806, -0.1983309984, 0.0397177264, -0.0476762652, 0.1641905904, 0.005025059, 0.1936111301, -0.2953359783, 0.1310727298, -0.1476739794, 0.3262221217, -0.4418165088, 0.4140007496, -0.1077296808, -0.0018774681, 0.094389841, -0.5714962482, 0.1398763508, -0.2214402407, 0.1234800816, 0.1711139083, 0.2180823535, 0.3029263616, -0.3416555524, -0.3789152503, 0.1582275778, -0.1466239989, 0.1340595335, 0.4135628343, 0.036602024, -0.078988269, -0.3487008512, -0.0757501423, -0.1218584031, 0.1076877862, -0.0743067116, -0.1881789863, -0.4665385485, -0.2733977735, -0.001658164, -0.0024628788, 0.1162435859, -0.0233726911, -0.1197141707, -0.512409389, -0.0625249892, 0.0552944392, 0.132654354, -0.273260951, 0.4564464986, -0.0254736356, 0.3163393736, 0.141992867, 0.0543378033, 0.0837464631, -0.1719923615, 0.1296370924, 0.3715827763, 0.0275524706, 0.0141743571, 0.0489276126, -0.3223411739, -0.023288928, 0.0356097408, 0.2321068347, 0.2598093748, -0.0479856357, 0.2657663226, 0.4007704258, 0.0927505344, -0.1391407102, 0.6415418386, 0.0301114023, -0.2004717439, -0.6418212652, -0.1724126041, -0.3519452512, -0.062735334, 0.3335890174, 0.0427099243, -0.2098454833, 0.0722273961, 0.4604044259, -0.2394171804, -0.0065295845, -0.132543534, 0.0212122351, 0.2508154511, 0.1287932247, 0.437037766, -0.0555273294, 0.1014267951, -0.1901603639, 0.1589484066, -0.0596043617, -0.3029897809, -0.3049107194, 0.3160682917, 0.161876902, 0.1877593845, 0.423969537, -0.100110516, 0.2894420028, -0.1613696516, 0.3981885314, -0.1120457947, 0.6585770845, 0.1044586003, -0.2513779104, 0.2223657221, 0.186222285, 0.3770999908, -0.1535632014, 0.3354170024, -0.5022830367, -0.4383485317, 0.4798752666, -0.0732972249, -0.0095937811, 0.0692020059, -0.1767220795, 0.0427593216, 0.5391664505, -0.2560786605, 0.1344240457, -0.3575461507, -0.2090657055, -0.1776280105, 0.2568798959, 0.4551612437, 0.3137150407, -0.341817081, 0.1241684109, 0.3162252903, 0.2081830353, 0.2290947139, -0.6239325404, 0.3898103237, -0.2199798524, 0.2747524381, 0.3872870207, -0.3571225405, -0.143522799, 0.2945979238, -0.0989741981, 0.0233591348, -0.157093972, -0.0249816477, 0.4641163051, -0.0252319407, 0.1258822232, 0.2964550555, -0.2162624151, 0.2001039684, -0.261736393, 0.0169192627, 0.0804381818, -0.0070854127, 0.1947209984, 0.0033708699, -0.0128012858, 0.1196199283, 0.2070771605, 0.0102299741, 0.2283789366, 0.0252540223, -0.3850676417, 0.0924093872, 0.1654823869, 0.0665196776, -0.1504981518, 0.1814237386, -0.0332354344, -0.395929575, -0.1602500081, -0.0522116944, 0.1628750861, -0.2076937109, -0.3108921647, -0.140207693, -0.1141550168, 0.1380292624, -0.0407927744, -0.2170622051, -0.3000540137, -0.0936287269, 0.141043365, -0.0588693954, 0.2177681029, 0.1037803665, 0.1914525926, -0.1203962192, -0.431758821, -0.1487240344, 0.1081420481, -0.2924800217, -0.1076145172, 0.3776342273, 0.0455736034, 0.2080195993, -0.1105848402, 0.3216449618, 0.2376917005, 0.0668992102, 0.1610090286, 0.1279922724, -0.1245719418, -0.1512018591, -0.1420783103, 0.3465424478, 0.1289894879, 0.1471359134, -0.0155484304, 0.0163483992, 0.0418231338, 0.0829827636, -0.2396876514, -0.0824882835, -0.3200369775, -0.1921789348, 0.2612731457, 0.1546634585, 0.0379147306, 0.0008641295, 0.3312497437, 0.0261269882, 0.0083662262, -0.14848122, -0.180636093, 0.0400648564, 0.1552489996, 0.1572334617, 0.3422778249, -0.0142573696, 0.3932814896, -0.1144815236, 0.1034137234, 0.0622592606, -0.0817418396, -0.0038882717, 0.2324123085, 0.1578573287, -0.0431561135, 0.1835178435, -0.2471134365, -0.1046326831, 0.3485344946, -0.2459665984, 0.0869296342, 0.2329534143, -0.0123325735, 0.1808803827, -0.5816081762, 0.0918161497, 0.0024794023, 0.0669040158, -0.1619980931, 0.2604070306, -0.0950390548, 0.4181236327, -0.0660850555, 0.2435845733, -0.1192761064, -0.2782997191, 0.1805500984, -0.1531218886, -0.0121599045, -0.1923268735, 0.1284363866, -0.2399803549, -0.0226503722, 0.0775609016, -0.0577870049, -0.142930001, 0.1827362478, 0.1133465171, 0.2074271441, -0.555270493, -0.2969097197, -0.0320735052, -0.3787957728, -0.1486829072, 0.168632552, -0.4979082942, 0.1192708388, -0.0551380515, 0.2452644408, -0.171756655, -0.1245702505, -0.3170385063, -0.2305707932, -0.0193638355, 0.1338817179, -0.0549431816, 0.1418406367, 0.0033791289, -0.1053655893, -0.239378795, -0.1764802337, -0.2918812037, 0.0651776791, -0.5251653194, 0.3886309266, -0.1867224574, -0.047136981, -0.1093478873, -0.0461092293, -0.0654087365, 0.639970541, -0.3348985016, 0.0144050941, 0.3095328808, -0.0101135373, -0.0965967774, 0.1116472706, 0.5424689054, 0.1066483036, 0.1266250014, -0.0549989305, 0.2443152219, 0.2560414374, 0.1710577011, 0.0513748713, 0.15952757, -0.1193903238, 0.1637128294, 1.278239131, 0.1522192508, -0.0518915243, 0.0262435935, 0.0314820632, -0.014047185, 0.0686669946, -0.1058128178, 0.061383713, -0.3951033354, -0.1308123171, 0.1793063432, 0.18719396, -0.5139592886, 0.0521273613, 0.1936311424, -0.0122206286, -0.3019164205, 0.3315780759, -0.7171850801, 0.582773149, 0.0590840429, 0.0178888738, -0.4254793525, 0.0453996658, 0.0945204943, -0.1513162851, 0.7113602757, 0.053421177, -0.4360211492, 0.08626692, -0.1918415129, 0.0394078717, 0.2148353308, 0.2028767169, 0.0952698588, -0.1703165025, 0.1477957815, 0.1729287803, 0.405384481, -0.063953355, 0.0224065613, 0.1169935167, -0.2179407179, -0.1327844262, -0.1501160115, 0.0643642396, 0.3700456619, 0.0236488804, 0.4308014512, -0.030336827, -0.1774691939, -0.4406906962, 0.0884209424, -0.3515691161, -0.0433642194, -0.1870868653, 0.0759659261, -0.2960947752, 0.2095095217, 0.3047896624, -0.1735833734, -0.0213713646, -0.2622390985, -0.0159955509, 0.3147194684, -0.1036772579, 0.0370822325, 0.2442337722, 0.1481230259, 0.0131701007, 0.4719133377, 0.2137568742, 0.2138779163, 0.3546655476, -0.3274185061, -0.139388755, 0.036832314, 0.0073548444, 0.2340704203, 0.1898226589, 0.0306466445, -0.2361026853, 0.1773867309, -0.1677423269, -0.2283786237, 0.2950415909, 0.1178725809, 0.0684983134, -0.1757792085, -0.4709652364, 0.0921666026, 0.1839779615, -0.2220707238, 0.4868580997, -0.8516541123, -0.261679858, 0.4181655049, 0.0608370043, 0.6925718784, -0.2607026696, 0.2272644192, -0.2504416406, 0.4874331057, 0.0204546265, -0.6066103578, 0.42003721, -0.2548579276, -0.204164952, -0.0412223041, -0.1717180312, -0.1559634209, 0.7070310712, 0.0804176033, 0.1725239605, 0.1165398508, 0.3262237012, -0.0640338063, 0.0934553519, 0.2966888249, -0.4377834797, 0.2290287763, -0.0624264441, 0.1829896122, 0.1569691002, -0.0804342628, 0.0565102436, 0.1240404099, -0.2584004402, 0.2086895406, 0.0717218891, -0.360072583, 0.3634981811, 0.0398199037, 0.0521443784, -0.2433338165, 0.6011245251, 0.0109047722, -0.2319957167, 0.0940761417, 0.0436989516, 0.1931170076, -0.0126968957, -0.262334615, -0.169743225, 0.1262997985, 0.0967981815, -0.1459383368, -0.1205742359, -0.3000963628, -0.4416498542, -0.2237545699, 0.3600804508, 0.6041751504, -0.0505639203, -0.0588484667, 0.2081899047, -0.0861716345, 0.1668844819, -0.0069434615, 0.0640016198, -0.1381702721, 0.3867055774, -0.0235092826, -0.124290362, 0.2014888674, 0.3131967187, -0.1574298441, -0.1682619452, 0.2568945587, -0.2654669881, -0.0969374478, -0.0573922843, -0.0330520421, 0.1389323622, -0.3625165224, 0.0169915408, -0.1065595821, 0.0166314691, 0.0993063748, 0.0837629214, 0.1839829534, 0.1075275317, -0.3239929974, -0.1815753281, -0.3717833757, -0.0278920494, -0.1365002841, 0.0505665839, 0.2734040618, 0.1305767596, 0.1053176671, 0.3764919043, -0.1317268908, 0.1228380427, 0.0817989707, 0.3973925412, -0.051866807, 0.0050210916, -0.1158293486, -0.0291920509, -0.1875381917, 0.0908715948, -0.1421472132, 0.0042556003, 0.0848782957, 0.2250857353, 0.194545269, -0.0718453526, -0.0755311549, -0.2173605263, 0.1162217557, -0.4500404298, 0.0487678051, 0.0160333216, -0.1881896853, 0.0467121862, 0.5341086984, 0.1623099893, -0.4041573107, 0.1451511979, -0.0866433829, -0.0505962074, -0.03202492, 0.1041377038, 0.1630801857, -0.0049901083, -0.0814535916, -0.034553919, 0.3659768105, 0.1690804958, 0.4754380584, -0.227211684, 0.0704820603, -0.0292813014, 0.1734143049, 0.2325784564, -0.3147430122, -0.0599207804, 0.3415471017, 0.0241224971, 0.0282655209, -0.1990051568, 0.3771485984, 0.0867176056, -0.1169267446, 0.2695806026, 0.291313231, -0.3984208405, 0.1071691513, 0.13878043, 0.5225747228, -0.3287660778, 0.2685765028, 0.0269058626, 0.0857228786, 0.1760593802, 0.2698517144, 0.3104492426, 0.1782117337, -0.07478185, 0.0293806009, 0.2496602088, 0.3985043764, -0.1035520285, -0.1874761581, -0.4894892871, -0.0736386031, -0.00440979, -0.0369605608, 0.1242682934, -0.2778053284, 0.272898376, -0.2847648561, -0.5857909322, 0.1254217029, 0.3274547458, -0.2013133466, -0.088679865, 0.0926785469, 0.0113809705, -0.0462345928, 0.0941593796, 0.0441684611, 0.209709987, 0.559330225, 0.0858864114, 0.018109601, 0.1541573405, -0.0717383325, 0.0019632252, 0.4593268633, -0.3261109591, 0.1913288832, -0.1725732386, 0.0807393491, 0.0200429894, -0.0315709189, 0.0498549007, 0.522872746, -0.1188719869, 0.1938308775, 0.0442507267, 0.1886545122, -0.1131995469, 0.1667530388, -0.1233739406, -0.300684303, 0.0307742395, -0.0814751685, -0.0131050814, 0.0288236253, -0.0665219277, 0.0668583736, 0.2088632584, 0.2820907235, 0.1485460997, -0.1038458049, 0.1028902605, 0.0694102198, -0.3599322438, 0.1259171963, 0.2366672605, -0.289726913, 0.1959314644, 0.0505573712, -0.0399407893, 0.0708529651, 0.2542790771, 0.1748006642, 0.0303766839, -0.2747747898, -0.3522975445, -0.6728183627, 0.3023856282, 0.0174809434, 0.2508773208, -0.1023808867, 0.0117321685, 0.0563801154, -0.0531249084, -0.2462202907, -0.2524301708, -0.0387766808, 0.352478534, -0.0957505926, 0.0024704244, -0.2875678539, 0.3995727003, 0.1458621621, -0.1972411871, 0.0653905943, -0.0597797446, -0.0863965303, 0.2657531798, -0.4236014485, -0.1760620624, 0.0676911324, 0.4964186847, 0.0649718791, 0.2099229097, 0.0600782335, 0.1801744699, -0.0981867015, 0.0451124385, -0.0188295692, -0.0528835915, -0.0837271884, 0.2601969242, -0.5280180573, -0.0028349936, -0.4991471171, -0.4763996303, 0.1246200353, -0.0155332424, 0.0108442381, -0.210577786, -0.2984158695, 0.0919266045, 0.2645702362, 0.4401882589, -0.0507175699, -0.0598964095, -0.2187688649, 0.0092305765, 0.2666279078, -0.6458786726, -0.2884698808, -0.2124375403, 0.1345546246, -0.0403621309, -0.0596353672, -0.4026407599, -0.072396636, 0.28345263, -0.0711671412, -0.4361753166, -0.1718804687, -0.0504204966, -0.170731619, -0.238054499, 0.4838342965, -0.0408490971, -0.2001534104, -0.0964372307, -0.1717200279 ]
https://github.com/huggingface/datasets/issues/2185
.map() and distributed training
So to answer my initial question, I was just doing something stupid as I was not re-giving the `preprocessing_num_workers` arguments when launching the distributed training (and it was then set to `None`). I initially thought the hash was computed only with the `tokenize_function` but it's all arguments. Thanks @lhoestq for clarifying!
Hi, I have a question regarding distributed training and the `.map` call on a dataset. I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`. `dataset` is then tokenized: ```python datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, ) ``` I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split). When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect. Everything so far was done by launching a **single process script**. I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files. I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it. **My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training. - I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case) - I am using 1.5.0 version of datasets if that matters.
51
.map() and distributed training Hi, I have a question regarding distributed training and the `.map` call on a dataset. I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`. `dataset` is then tokenized: ```python datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, ) ``` I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split). When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect. Everything so far was done by launching a **single process script**. I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files. I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it. **My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training. - I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case) - I am using 1.5.0 version of datasets if that matters. So to answer my initial question, I was just doing something stupid as I was not re-giving the `preprocessing_num_workers` arguments when launching the distributed training (and it was then set to `None`). I initially thought the hash was computed only with the `tokenize_function` but it's all arguments. Thanks @lhoestq for clarifying!
[ -0.2537619472, -0.2207169682, 0.1177767664, 0.0745748281, 0.2116163522, -0.1097596213, 0.517072916, 0.0102050584, 0.2801567912, 0.0237629861, 0.182247296, 0.3434495926, -0.2290641069, -0.585545063, 0.0941430628, 0.0615339167, 0.1861156076, 0.0366592631, -0.0377358235, -0.2008031309, -0.1529331058, 0.0759169385, -0.1542708427, 0.1170514226, -0.754070878, -0.1523152441, -0.1834535599, 0.1027399823, 0.2253177315, -0.3499085009, 0.2342272103, 0.2213347852, 0.4013624787, 0.533691287, -0.0001272091, 0.0312626213, 0.1878609806, -0.1983309984, 0.0397177264, -0.0476762652, 0.1641905904, 0.005025059, 0.1936111301, -0.2953359783, 0.1310727298, -0.1476739794, 0.3262221217, -0.4418165088, 0.4140007496, -0.1077296808, -0.0018774681, 0.094389841, -0.5714962482, 0.1398763508, -0.2214402407, 0.1234800816, 0.1711139083, 0.2180823535, 0.3029263616, -0.3416555524, -0.3789152503, 0.1582275778, -0.1466239989, 0.1340595335, 0.4135628343, 0.036602024, -0.078988269, -0.3487008512, -0.0757501423, -0.1218584031, 0.1076877862, -0.0743067116, -0.1881789863, -0.4665385485, -0.2733977735, -0.001658164, -0.0024628788, 0.1162435859, -0.0233726911, -0.1197141707, -0.512409389, -0.0625249892, 0.0552944392, 0.132654354, -0.273260951, 0.4564464986, -0.0254736356, 0.3163393736, 0.141992867, 0.0543378033, 0.0837464631, -0.1719923615, 0.1296370924, 0.3715827763, 0.0275524706, 0.0141743571, 0.0489276126, -0.3223411739, -0.023288928, 0.0356097408, 0.2321068347, 0.2598093748, -0.0479856357, 0.2657663226, 0.4007704258, 0.0927505344, -0.1391407102, 0.6415418386, 0.0301114023, -0.2004717439, -0.6418212652, -0.1724126041, -0.3519452512, -0.062735334, 0.3335890174, 0.0427099243, -0.2098454833, 0.0722273961, 0.4604044259, -0.2394171804, -0.0065295845, -0.132543534, 0.0212122351, 0.2508154511, 0.1287932247, 0.437037766, -0.0555273294, 0.1014267951, -0.1901603639, 0.1589484066, -0.0596043617, -0.3029897809, -0.3049107194, 0.3160682917, 0.161876902, 0.1877593845, 0.423969537, -0.100110516, 0.2894420028, -0.1613696516, 0.3981885314, -0.1120457947, 0.6585770845, 0.1044586003, -0.2513779104, 0.2223657221, 0.186222285, 0.3770999908, -0.1535632014, 0.3354170024, -0.5022830367, -0.4383485317, 0.4798752666, -0.0732972249, -0.0095937811, 0.0692020059, -0.1767220795, 0.0427593216, 0.5391664505, -0.2560786605, 0.1344240457, -0.3575461507, -0.2090657055, -0.1776280105, 0.2568798959, 0.4551612437, 0.3137150407, -0.341817081, 0.1241684109, 0.3162252903, 0.2081830353, 0.2290947139, -0.6239325404, 0.3898103237, -0.2199798524, 0.2747524381, 0.3872870207, -0.3571225405, -0.143522799, 0.2945979238, -0.0989741981, 0.0233591348, -0.157093972, -0.0249816477, 0.4641163051, -0.0252319407, 0.1258822232, 0.2964550555, -0.2162624151, 0.2001039684, -0.261736393, 0.0169192627, 0.0804381818, -0.0070854127, 0.1947209984, 0.0033708699, -0.0128012858, 0.1196199283, 0.2070771605, 0.0102299741, 0.2283789366, 0.0252540223, -0.3850676417, 0.0924093872, 0.1654823869, 0.0665196776, -0.1504981518, 0.1814237386, -0.0332354344, -0.395929575, -0.1602500081, -0.0522116944, 0.1628750861, -0.2076937109, -0.3108921647, -0.140207693, -0.1141550168, 0.1380292624, -0.0407927744, -0.2170622051, -0.3000540137, -0.0936287269, 0.141043365, -0.0588693954, 0.2177681029, 0.1037803665, 0.1914525926, -0.1203962192, -0.431758821, -0.1487240344, 0.1081420481, -0.2924800217, -0.1076145172, 0.3776342273, 0.0455736034, 0.2080195993, -0.1105848402, 0.3216449618, 0.2376917005, 0.0668992102, 0.1610090286, 0.1279922724, -0.1245719418, -0.1512018591, -0.1420783103, 0.3465424478, 0.1289894879, 0.1471359134, -0.0155484304, 0.0163483992, 0.0418231338, 0.0829827636, -0.2396876514, -0.0824882835, -0.3200369775, -0.1921789348, 0.2612731457, 0.1546634585, 0.0379147306, 0.0008641295, 0.3312497437, 0.0261269882, 0.0083662262, -0.14848122, -0.180636093, 0.0400648564, 0.1552489996, 0.1572334617, 0.3422778249, -0.0142573696, 0.3932814896, -0.1144815236, 0.1034137234, 0.0622592606, -0.0817418396, -0.0038882717, 0.2324123085, 0.1578573287, -0.0431561135, 0.1835178435, -0.2471134365, -0.1046326831, 0.3485344946, -0.2459665984, 0.0869296342, 0.2329534143, -0.0123325735, 0.1808803827, -0.5816081762, 0.0918161497, 0.0024794023, 0.0669040158, -0.1619980931, 0.2604070306, -0.0950390548, 0.4181236327, -0.0660850555, 0.2435845733, -0.1192761064, -0.2782997191, 0.1805500984, -0.1531218886, -0.0121599045, -0.1923268735, 0.1284363866, -0.2399803549, -0.0226503722, 0.0775609016, -0.0577870049, -0.142930001, 0.1827362478, 0.1133465171, 0.2074271441, -0.555270493, -0.2969097197, -0.0320735052, -0.3787957728, -0.1486829072, 0.168632552, -0.4979082942, 0.1192708388, -0.0551380515, 0.2452644408, -0.171756655, -0.1245702505, -0.3170385063, -0.2305707932, -0.0193638355, 0.1338817179, -0.0549431816, 0.1418406367, 0.0033791289, -0.1053655893, -0.239378795, -0.1764802337, -0.2918812037, 0.0651776791, -0.5251653194, 0.3886309266, -0.1867224574, -0.047136981, -0.1093478873, -0.0461092293, -0.0654087365, 0.639970541, -0.3348985016, 0.0144050941, 0.3095328808, -0.0101135373, -0.0965967774, 0.1116472706, 0.5424689054, 0.1066483036, 0.1266250014, -0.0549989305, 0.2443152219, 0.2560414374, 0.1710577011, 0.0513748713, 0.15952757, -0.1193903238, 0.1637128294, 1.278239131, 0.1522192508, -0.0518915243, 0.0262435935, 0.0314820632, -0.014047185, 0.0686669946, -0.1058128178, 0.061383713, -0.3951033354, -0.1308123171, 0.1793063432, 0.18719396, -0.5139592886, 0.0521273613, 0.1936311424, -0.0122206286, -0.3019164205, 0.3315780759, -0.7171850801, 0.582773149, 0.0590840429, 0.0178888738, -0.4254793525, 0.0453996658, 0.0945204943, -0.1513162851, 0.7113602757, 0.053421177, -0.4360211492, 0.08626692, -0.1918415129, 0.0394078717, 0.2148353308, 0.2028767169, 0.0952698588, -0.1703165025, 0.1477957815, 0.1729287803, 0.405384481, -0.063953355, 0.0224065613, 0.1169935167, -0.2179407179, -0.1327844262, -0.1501160115, 0.0643642396, 0.3700456619, 0.0236488804, 0.4308014512, -0.030336827, -0.1774691939, -0.4406906962, 0.0884209424, -0.3515691161, -0.0433642194, -0.1870868653, 0.0759659261, -0.2960947752, 0.2095095217, 0.3047896624, -0.1735833734, -0.0213713646, -0.2622390985, -0.0159955509, 0.3147194684, -0.1036772579, 0.0370822325, 0.2442337722, 0.1481230259, 0.0131701007, 0.4719133377, 0.2137568742, 0.2138779163, 0.3546655476, -0.3274185061, -0.139388755, 0.036832314, 0.0073548444, 0.2340704203, 0.1898226589, 0.0306466445, -0.2361026853, 0.1773867309, -0.1677423269, -0.2283786237, 0.2950415909, 0.1178725809, 0.0684983134, -0.1757792085, -0.4709652364, 0.0921666026, 0.1839779615, -0.2220707238, 0.4868580997, -0.8516541123, -0.261679858, 0.4181655049, 0.0608370043, 0.6925718784, -0.2607026696, 0.2272644192, -0.2504416406, 0.4874331057, 0.0204546265, -0.6066103578, 0.42003721, -0.2548579276, -0.204164952, -0.0412223041, -0.1717180312, -0.1559634209, 0.7070310712, 0.0804176033, 0.1725239605, 0.1165398508, 0.3262237012, -0.0640338063, 0.0934553519, 0.2966888249, -0.4377834797, 0.2290287763, -0.0624264441, 0.1829896122, 0.1569691002, -0.0804342628, 0.0565102436, 0.1240404099, -0.2584004402, 0.2086895406, 0.0717218891, -0.360072583, 0.3634981811, 0.0398199037, 0.0521443784, -0.2433338165, 0.6011245251, 0.0109047722, -0.2319957167, 0.0940761417, 0.0436989516, 0.1931170076, -0.0126968957, -0.262334615, -0.169743225, 0.1262997985, 0.0967981815, -0.1459383368, -0.1205742359, -0.3000963628, -0.4416498542, -0.2237545699, 0.3600804508, 0.6041751504, -0.0505639203, -0.0588484667, 0.2081899047, -0.0861716345, 0.1668844819, -0.0069434615, 0.0640016198, -0.1381702721, 0.3867055774, -0.0235092826, -0.124290362, 0.2014888674, 0.3131967187, -0.1574298441, -0.1682619452, 0.2568945587, -0.2654669881, -0.0969374478, -0.0573922843, -0.0330520421, 0.1389323622, -0.3625165224, 0.0169915408, -0.1065595821, 0.0166314691, 0.0993063748, 0.0837629214, 0.1839829534, 0.1075275317, -0.3239929974, -0.1815753281, -0.3717833757, -0.0278920494, -0.1365002841, 0.0505665839, 0.2734040618, 0.1305767596, 0.1053176671, 0.3764919043, -0.1317268908, 0.1228380427, 0.0817989707, 0.3973925412, -0.051866807, 0.0050210916, -0.1158293486, -0.0291920509, -0.1875381917, 0.0908715948, -0.1421472132, 0.0042556003, 0.0848782957, 0.2250857353, 0.194545269, -0.0718453526, -0.0755311549, -0.2173605263, 0.1162217557, -0.4500404298, 0.0487678051, 0.0160333216, -0.1881896853, 0.0467121862, 0.5341086984, 0.1623099893, -0.4041573107, 0.1451511979, -0.0866433829, -0.0505962074, -0.03202492, 0.1041377038, 0.1630801857, -0.0049901083, -0.0814535916, -0.034553919, 0.3659768105, 0.1690804958, 0.4754380584, -0.227211684, 0.0704820603, -0.0292813014, 0.1734143049, 0.2325784564, -0.3147430122, -0.0599207804, 0.3415471017, 0.0241224971, 0.0282655209, -0.1990051568, 0.3771485984, 0.0867176056, -0.1169267446, 0.2695806026, 0.291313231, -0.3984208405, 0.1071691513, 0.13878043, 0.5225747228, -0.3287660778, 0.2685765028, 0.0269058626, 0.0857228786, 0.1760593802, 0.2698517144, 0.3104492426, 0.1782117337, -0.07478185, 0.0293806009, 0.2496602088, 0.3985043764, -0.1035520285, -0.1874761581, -0.4894892871, -0.0736386031, -0.00440979, -0.0369605608, 0.1242682934, -0.2778053284, 0.272898376, -0.2847648561, -0.5857909322, 0.1254217029, 0.3274547458, -0.2013133466, -0.088679865, 0.0926785469, 0.0113809705, -0.0462345928, 0.0941593796, 0.0441684611, 0.209709987, 0.559330225, 0.0858864114, 0.018109601, 0.1541573405, -0.0717383325, 0.0019632252, 0.4593268633, -0.3261109591, 0.1913288832, -0.1725732386, 0.0807393491, 0.0200429894, -0.0315709189, 0.0498549007, 0.522872746, -0.1188719869, 0.1938308775, 0.0442507267, 0.1886545122, -0.1131995469, 0.1667530388, -0.1233739406, -0.300684303, 0.0307742395, -0.0814751685, -0.0131050814, 0.0288236253, -0.0665219277, 0.0668583736, 0.2088632584, 0.2820907235, 0.1485460997, -0.1038458049, 0.1028902605, 0.0694102198, -0.3599322438, 0.1259171963, 0.2366672605, -0.289726913, 0.1959314644, 0.0505573712, -0.0399407893, 0.0708529651, 0.2542790771, 0.1748006642, 0.0303766839, -0.2747747898, -0.3522975445, -0.6728183627, 0.3023856282, 0.0174809434, 0.2508773208, -0.1023808867, 0.0117321685, 0.0563801154, -0.0531249084, -0.2462202907, -0.2524301708, -0.0387766808, 0.352478534, -0.0957505926, 0.0024704244, -0.2875678539, 0.3995727003, 0.1458621621, -0.1972411871, 0.0653905943, -0.0597797446, -0.0863965303, 0.2657531798, -0.4236014485, -0.1760620624, 0.0676911324, 0.4964186847, 0.0649718791, 0.2099229097, 0.0600782335, 0.1801744699, -0.0981867015, 0.0451124385, -0.0188295692, -0.0528835915, -0.0837271884, 0.2601969242, -0.5280180573, -0.0028349936, -0.4991471171, -0.4763996303, 0.1246200353, -0.0155332424, 0.0108442381, -0.210577786, -0.2984158695, 0.0919266045, 0.2645702362, 0.4401882589, -0.0507175699, -0.0598964095, -0.2187688649, 0.0092305765, 0.2666279078, -0.6458786726, -0.2884698808, -0.2124375403, 0.1345546246, -0.0403621309, -0.0596353672, -0.4026407599, -0.072396636, 0.28345263, -0.0711671412, -0.4361753166, -0.1718804687, -0.0504204966, -0.170731619, -0.238054499, 0.4838342965, -0.0408490971, -0.2001534104, -0.0964372307, -0.1717200279 ]
https://github.com/huggingface/datasets/issues/2181
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi ! Can you try to increase the block size ? For example ```python block_size_10MB = 10<<20 load_dataset("json", ..., block_size=block_size_10MB) ``` The block size corresponds to how much bytes to process at a time from the input stream. This will determine multi-threading granularity as well as the size of individual chunks in the dataset. You can also try with bigger block sizes if needed
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
64
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! Hi ! Can you try to increase the block size ? For example ```python block_size_10MB = 10<<20 load_dataset("json", ..., block_size=block_size_10MB) ``` The block size corresponds to how much bytes to process at a time from the input stream. This will determine multi-threading granularity as well as the size of individual chunks in the dataset. You can also try with bigger block sizes if needed
[ 0.0165568739, 0.0126867145, -0.0075108744, 0.3409380913, 0.160453409, -0.264713943, 0.1936330795, 0.5859467387, -0.1621608585, -0.0815065205, 0.1654729992, 0.1441626847, -0.0150833149, 0.01456251, -0.1295211017, -0.1911916286, 0.0333678797, 0.0782744884, -0.0815539062, 0.1355071962, -0.0368868969, 0.2328725904, -0.0935277939, 0.2323914915, -0.0870282501, -0.0781513751, 0.1980637461, 0.3374814093, -0.3348848224, -0.4495864809, 0.1612246335, -0.2951849997, 0.0062585548, 0.3340713382, -0.0001156308, 0.0471058488, 0.2495898008, 0.1091790721, 0.0187434256, -0.2191215008, 0.2808354199, -0.3987069428, 0.2280117273, -0.1674177349, 0.1295844764, -0.4462139606, -0.3999219537, 0.3737814724, 0.427729398, -0.125554949, 0.165101558, 0.0912107527, 0.2657487988, 0.2669146359, 0.4368441105, -0.0652502477, 0.0273979381, 0.5041722059, 0.3052017689, -0.2382046282, -0.3354804814, -0.1370316744, -0.2495918274, 0.1381144822, 0.3779322207, -0.1172009334, 0.0762815028, 0.0589680783, -0.0799431354, 0.0377216265, 0.2263209522, -0.4086020291, -0.1033590436, -0.0781873837, -0.0856485665, -0.1830742359, 0.307918191, 0.3882308602, -0.2103948444, 0.0698303431, -0.1914449632, -0.1000009999, -0.1991206706, 0.1786512583, -0.3580314517, -0.1259491444, -0.0024535414, 0.3322297633, 0.2310531139, -0.0076111378, -0.0355753489, 0.0311065614, -0.2734941244, -0.0565980226, -0.2094624788, 0.0166391879, 0.0015146527, -0.3171830475, 0.1906489283, 0.2260885239, 0.1960858703, -0.0655949488, 0.2463151664, 0.2574919462, 0.6111612916, 0.0594755895, -0.3522538543, -0.1677472293, 0.2054001838, 0.2378149927, -0.0194872245, 0.0609877817, -0.0592072606, -0.5538617373, 0.0594820976, -0.2798269093, 0.2597754002, -0.2160241604, -0.210319832, 0.1333222091, -0.7950462103, 0.0500113703, 0.166253224, 0.2496995479, 0.027215872, 0.2363471687, 0.0485521629, 0.1581958979, 0.0089592859, -0.1194206029, -0.0078674164, 0.1263679564, -0.1525119394, 0.038596414, 0.1579914689, -0.1335816234, -0.0064157024, 0.1193346679, 0.2173472643, -0.2116393894, 0.1862064302, 0.0166175477, 0.0477703437, 0.3288212717, -0.0516764186, 0.1116403192, -0.05485975, -0.0126552582, -0.2687696517, 0.4798907936, -0.0626878217, -0.344812274, -0.1742749661, 0.1004123539, -0.2606139779, 0.2655540109, 0.0049832948, 0.0375166312, 0.1504193246, -0.3691315055, 0.216160357, -0.1311511695, 0.1778308898, -0.345772028, 0.1031698138, -0.0813743174, -0.6869223714, 0.017364569, 0.2560485303, 0.1754172295, -0.0944366753, 0.5446499586, -0.4150454104, 0.1447622329, -0.0459543578, 0.1615657806, 0.1449172646, 0.1606285274, -0.6060850024, 0.3728233874, -0.2745346427, 0.0576428846, 0.0307347607, -0.0146054924, -0.1264384389, -0.0241250247, -0.0301006548, 0.3515684307, 0.0832776129, 0.2309472263, -0.3654413223, -0.2369493693, 0.123363331, 0.3634352684, -0.1145452261, -0.4116989374, -0.049331978, -0.1916891038, 0.055319719, -0.1157419235, 0.1517812014, 0.4218284488, 0.1359185129, -0.1193929464, 0.102687344, 0.1130747795, -0.4654294848, 0.0214598104, 0.071772933, -0.0631103963, -0.3461887836, -0.0881968886, -0.0301498659, 0.2487496287, 0.0945117176, 0.2060093582, 0.0340393037, -0.1731153131, 0.0721886158, -0.0024393648, -0.0986387134, -0.4135909379, 0.1334336698, 0.0734616518, -0.0101107676, 0.3906270862, 0.0637329668, -0.2933793664, 0.0692315102, 0.1497816145, -0.0336899124, -0.1447107196, -0.0944388062, 0.184555918, -0.0829882994, 0.0026108883, -0.2447781116, 0.129320085, 0.2801519334, -0.3557437658, 0.0277640689, 0.103249982, 0.0765697062, -0.0654548556, 0.2241747528, 0.4178524613, -0.328894347, 0.2032139599, 0.0963194072, -0.2922593951, 0.0688128695, -0.0792856589, -0.0184271783, 0.1651138812, 0.2211026251, 0.3922339976, 0.2243862897, 0.138210699, -0.1602221578, -0.1194183007, 0.398599267, -0.1834306717, -0.0815002248, 0.1523450911, -0.1335784346, -0.0331329815, 0.0964191407, -0.1294159442, 0.1355017722, 0.2478065491, -0.1427010447, -0.0006220322, 0.0272531845, -0.1798281819, 0.2222774923, 0.1978258938, 0.1286402345, 0.2018651366, 0.5253883004, -0.1262489557, -0.2340528071, -0.223922655, 0.2441997081, 0.196128279, -0.2908228636, 0.1298103034, -0.0687722415, 0.0243005455, -0.0847826898, -0.6795876026, -0.3061878681, -0.092197001, 0.0006512664, 0.4704110324, -0.3309011459, 0.0706556514, 0.1599272043, 0.3159407675, 0.0793665126, -0.1885326952, -0.0443736129, -0.3438288867, -0.2535297275, -0.0260645002, 0.4630134404, 0.1464138329, 0.0704184026, 0.3701913953, 0.0221871138, -0.0610450581, -0.4288598299, 0.218477577, -0.0467990264, 0.0778332576, 0.0034070164, 0.1291549504, -0.2472119331, -0.2504463196, 0.3068670332, 0.0360251367, -0.2057614774, 0.3271161616, -0.1920835823, 0.0744267553, -0.1781021953, 0.1151922345, 0.212826252, -0.541801393, 0.3973288238, -0.1855194569, 0.0039906064, -0.2795964777, 0.2635203898, 0.096009925, 0.0679154322, -0.0404973775, 0.0594006591, -0.4201911688, 0.1961021721, -0.0403328687, -0.188174665, 0.0418394208, 0.1097165793, 0.1519097388, 0.1650314033, -0.605876267, -0.012862388, -0.0775756836, 0.5512678027, -0.3430550098, -0.2375438958, 0.1149813235, 0.1875804663, -0.0166975297, 0.1244235188, -0.1434652507, 0.0150683373, -0.0073906644, 0.2049880028, -0.1010251194, 0.527921617, 0.1304709613, 0.7018245459, -0.1654548049, -0.1430086195, 0.3313240409, 0.2419928908, 0.0773650408, 0.0481643602, -0.0284129605, -0.1179991215, -0.1809872985, -0.082166642, -0.0068381652, 0.0487270243, -0.1101651564, -0.0276326984, -0.1180324927, -0.2268261611, -0.1588105559, 0.3197793663, 0.0610070266, -0.1138889641, -0.2007413208, -0.2847954631, -0.0170084089, -0.0803113654, 0.0584910288, 0.0380897671, 0.1093086004, 0.1145235896, -0.0157518536, -0.3002442122, -0.0333696604, 0.0799984336, 0.3141290843, -0.1444273889, 0.0518036634, -0.1972085238, 0.1843084097, -0.4777925909, 0.7541437745, 0.4649644792, -0.0762623399, 0.1359016448, -0.0663606301, -0.3780809641, -0.0619560406, 0.0836299211, 0.198235631, 0.5710030198, 0.1032127365, -0.452648133, -0.1059832275, -0.1052923799, 0.3224130869, 0.0146235228, -0.4784034491, -0.4063739181, -0.4959048629, -0.4578321576, -0.0559185557, 0.0945281163, 0.1901107132, 0.1029647738, -0.098739177, 0.2796905041, -0.2547017336, -0.4795071185, 0.097819306, 0.1785519719, -0.5503333211, 0.1491030306, 0.051228784, 0.3193378448, 0.5359143615, 0.6146828532, 0.5909867883, -0.2183257043, -0.053836219, 0.3960567713, 0.1798867732, 0.1679471433, 0.1672121733, 0.2085579634, -0.1727024913, 0.2022820115, 0.2214762419, -0.0104978755, 0.1908642054, -0.1210767627, -0.0008763261, 0.2911648154, 0.5025098324, -0.2172299027, 0.1578595042, 0.4766682386, 0.2834440768, -0.0467167497, 0.22268641, -0.0596347228, 0.9461206198, -0.0210726671, 0.1325544864, 0.5243245363, -0.4252017736, 0.5806592703, -0.3188992143, 0.0976481736, -0.47740376, 0.3479598761, 0.0661804825, -0.2101876438, -0.0861987025, 0.0646333843, -0.0427131839, -0.1986046433, -0.0862126797, 0.0907084197, -0.1165642962, 0.0720051229, -0.0206810404, 0.0002179146, -0.3245541751, -0.0062563457, -0.345230937, -0.1282552183, -0.1717918664, -0.325017035, 0.0421546549, -0.1757343113, -0.1917933375, 0.2709344923, 0.1396906376, 0.3771395087, 0.2748386264, -0.1422748566, -0.0074553639, -0.4400264919, -0.2658146918, -0.1649733186, -0.0385794491, 0.2240043581, 0.0084365048, -0.1254260391, -0.0218853801, 0.1243400648, 0.1479468495, -0.1720812023, -0.1758477539, 0.1463665664, -0.1700339317, -0.1859630793, -0.140729785, 0.1831436753, -0.1518968344, -0.0311307032, -0.0627594441, -0.1478973329, 0.0817600042, -0.1284502745, 0.0683541, 0.0026662424, 0.0737184733, -0.3161939681, 0.0839199424, -0.3015912175, -0.084051162, 0.2698032856, -0.0315239951, 0.1463475376, 0.4538903236, 0.4027527273, -0.0726220831, -0.0956393853, -0.0567292199, 0.55154109, -0.6051451564, 0.2913154364, -0.1565792412, 0.1126882434, 0.0965900123, 0.3177770972, 0.2544374168, 0.0715058148, 0.0265480578, -0.3478245437, -0.2285253108, 0.4916566014, -0.0185182877, 0.0122019527, 0.102707006, 0.4117231369, -0.0780539066, 0.19734101, -0.2198727131, 0.302084446, 0.0287226886, 0.0564546995, -0.4602079391, -0.2132684737, -0.2015917897, 0.2550785542, 0.0270886347, 0.1679869294, -0.0712248012, -0.1259258389, -0.1276163161, 0.1012033597, 0.1020174026, -0.0968396962, -0.0645024031, -0.1031716466, 0.1211113185, 0.1297840774, 0.13172701, -0.2099904269, -0.05350063, -0.3004154265, 0.0015181461, -0.1877656132, -0.364243269, 0.0790169984, -0.0337791741, 0.289096266, 0.0804840475, 0.2754157782, -0.0237065386, -0.0644062608, -0.2298585474, 0.1052851677, 0.1529579461, -0.0467558764, 0.4014987051, -0.3238122463, -0.0387648121, -0.2653613091, 0.2756448984, 0.4593810141, -0.2252637148, -0.1238567829, 0.0152622275, 0.1677670181, 0.00166329, -0.2151911855, -0.2195244133, -0.0497763194, -0.1538696885, -0.0746735334, -0.0904242247, -0.2073936909, -0.1787253767, 0.1219562143, 0.2947430909, 0.2419091463, -0.3463653326, 0.3792240322, -0.2789326608, -0.1749601811, 0.2887688279, 0.1355135739, 0.5593860149, -0.0907417983, -0.0720366612, 0.180865556, -0.0511427335, 0.0833586007, -0.1531463563, -0.4281861484, -0.1786464155, 0.3637124598, 0.2060843408, -0.2417385131, 0.3044682443, 0.5248377919, 0.4010774493, -0.1126884669, -0.019808121, 0.225604713, -0.1309853047, 0.2223397046, -0.5097848177, -0.1980475187, -0.1236797273, 0.3870285153, -0.1253378391, 0.05571853, 0.4912979007, 0.1782962233, -0.0879886597, -0.6212043762, -0.1130402535, 0.0727153942, -0.0714722052, -0.2394380271, 0.2298416644, 0.6816924214, -0.4974333346, -0.0561953597, -0.2158794552, 0.4886182547, 0.2710983157, -0.2111815214, -0.4033637345, -0.2183921635, -0.0720911324, -0.0950078815, 0.1022535115, 0.5172536373, 0.349851042, 0.2333961427, 0.0662926212, -0.1418414116, 0.2303018868, 0.1463666856, 0.1384517848, 0.0005855188, -0.233346343, -0.2354169786, -0.3443225622, -0.1802336872, -0.22826536, -0.3921260834, -0.3310348988, 0.1211898774, -0.0312106609, -0.1318794936, -0.1365348399, 0.0630985647, -0.0726332217, 0.6978251338, 0.3485355377, 0.2058714479, -0.2465083748, -0.2613238096, -0.2471015751, 0.4796886146, -0.4091092944, 0.1983162463, 0.2130556703, 0.1833835095, 0.107047841, 0.3368975818, -0.0652040988, 0.5276258588, -0.1808631122, -0.2147905529, -0.385112673, 0.0368259735, 0.2935437858, -0.1667666137, -0.1844619513, -0.151456967, 0.338673681, -0.1768075526, 0.1125647649, -0.1182278842, 0.0232721418, 0.0539223999, 0.0855707824, 0.3299840093, 0.0818733126, 0.329172492, 0.028654255, -0.142923981, -0.1079834998, -0.2546293736, -0.1726094484, 0.3846238256, 0.0581522174, 0.4116556644, -0.078766495, 0.0795211047, -0.1733227819, 0.1052343696, -0.4348298907, -0.097911261, 0.1218620613, -0.2352114916, 0.0249756277, 0.1028490216, -0.0171118267, 0.1146760881, 0.0885697529, 0.1137048528, -0.4944940805, -0.1414474398, 0.4697197676, -0.3657931685, -0.2979661226, 0.497099936, 0.1034522653, 0.345236063, -0.1185089797, -0.5068211555, 0.0891442448, 0.1896466017, 0.0586637668, -0.3722426891, 0.2245829999, 0.0482143797, -0.060962975, 0.0519514233, 0.2235717475, 0.1836718023, -0.3651713431, -0.0317126438, -0.1290490478 ]
https://github.com/huggingface/datasets/issues/2181
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi @lhoestq! Thank you for your prompt reply. I have experimented with (10<<20, 10<<28, 10<<30, 10<<33, 10<<34), since my machine has 192G of memory, but it's either the above-mentioned error or processed killed because of OOM. Could you give me a bit of background on why block size needs to be exactly calibrated? To my understanding, small block sized should run just fine despite its slowness..
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
66
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! Hi @lhoestq! Thank you for your prompt reply. I have experimented with (10<<20, 10<<28, 10<<30, 10<<33, 10<<34), since my machine has 192G of memory, but it's either the above-mentioned error or processed killed because of OOM. Could you give me a bit of background on why block size needs to be exactly calibrated? To my understanding, small block sized should run just fine despite its slowness..
[ 0.0165568739, 0.0126867145, -0.0075108744, 0.3409380913, 0.160453409, -0.264713943, 0.1936330795, 0.5859467387, -0.1621608585, -0.0815065205, 0.1654729992, 0.1441626847, -0.0150833149, 0.01456251, -0.1295211017, -0.1911916286, 0.0333678797, 0.0782744884, -0.0815539062, 0.1355071962, -0.0368868969, 0.2328725904, -0.0935277939, 0.2323914915, -0.0870282501, -0.0781513751, 0.1980637461, 0.3374814093, -0.3348848224, -0.4495864809, 0.1612246335, -0.2951849997, 0.0062585548, 0.3340713382, -0.0001156308, 0.0471058488, 0.2495898008, 0.1091790721, 0.0187434256, -0.2191215008, 0.2808354199, -0.3987069428, 0.2280117273, -0.1674177349, 0.1295844764, -0.4462139606, -0.3999219537, 0.3737814724, 0.427729398, -0.125554949, 0.165101558, 0.0912107527, 0.2657487988, 0.2669146359, 0.4368441105, -0.0652502477, 0.0273979381, 0.5041722059, 0.3052017689, -0.2382046282, -0.3354804814, -0.1370316744, -0.2495918274, 0.1381144822, 0.3779322207, -0.1172009334, 0.0762815028, 0.0589680783, -0.0799431354, 0.0377216265, 0.2263209522, -0.4086020291, -0.1033590436, -0.0781873837, -0.0856485665, -0.1830742359, 0.307918191, 0.3882308602, -0.2103948444, 0.0698303431, -0.1914449632, -0.1000009999, -0.1991206706, 0.1786512583, -0.3580314517, -0.1259491444, -0.0024535414, 0.3322297633, 0.2310531139, -0.0076111378, -0.0355753489, 0.0311065614, -0.2734941244, -0.0565980226, -0.2094624788, 0.0166391879, 0.0015146527, -0.3171830475, 0.1906489283, 0.2260885239, 0.1960858703, -0.0655949488, 0.2463151664, 0.2574919462, 0.6111612916, 0.0594755895, -0.3522538543, -0.1677472293, 0.2054001838, 0.2378149927, -0.0194872245, 0.0609877817, -0.0592072606, -0.5538617373, 0.0594820976, -0.2798269093, 0.2597754002, -0.2160241604, -0.210319832, 0.1333222091, -0.7950462103, 0.0500113703, 0.166253224, 0.2496995479, 0.027215872, 0.2363471687, 0.0485521629, 0.1581958979, 0.0089592859, -0.1194206029, -0.0078674164, 0.1263679564, -0.1525119394, 0.038596414, 0.1579914689, -0.1335816234, -0.0064157024, 0.1193346679, 0.2173472643, -0.2116393894, 0.1862064302, 0.0166175477, 0.0477703437, 0.3288212717, -0.0516764186, 0.1116403192, -0.05485975, -0.0126552582, -0.2687696517, 0.4798907936, -0.0626878217, -0.344812274, -0.1742749661, 0.1004123539, -0.2606139779, 0.2655540109, 0.0049832948, 0.0375166312, 0.1504193246, -0.3691315055, 0.216160357, -0.1311511695, 0.1778308898, -0.345772028, 0.1031698138, -0.0813743174, -0.6869223714, 0.017364569, 0.2560485303, 0.1754172295, -0.0944366753, 0.5446499586, -0.4150454104, 0.1447622329, -0.0459543578, 0.1615657806, 0.1449172646, 0.1606285274, -0.6060850024, 0.3728233874, -0.2745346427, 0.0576428846, 0.0307347607, -0.0146054924, -0.1264384389, -0.0241250247, -0.0301006548, 0.3515684307, 0.0832776129, 0.2309472263, -0.3654413223, -0.2369493693, 0.123363331, 0.3634352684, -0.1145452261, -0.4116989374, -0.049331978, -0.1916891038, 0.055319719, -0.1157419235, 0.1517812014, 0.4218284488, 0.1359185129, -0.1193929464, 0.102687344, 0.1130747795, -0.4654294848, 0.0214598104, 0.071772933, -0.0631103963, -0.3461887836, -0.0881968886, -0.0301498659, 0.2487496287, 0.0945117176, 0.2060093582, 0.0340393037, -0.1731153131, 0.0721886158, -0.0024393648, -0.0986387134, -0.4135909379, 0.1334336698, 0.0734616518, -0.0101107676, 0.3906270862, 0.0637329668, -0.2933793664, 0.0692315102, 0.1497816145, -0.0336899124, -0.1447107196, -0.0944388062, 0.184555918, -0.0829882994, 0.0026108883, -0.2447781116, 0.129320085, 0.2801519334, -0.3557437658, 0.0277640689, 0.103249982, 0.0765697062, -0.0654548556, 0.2241747528, 0.4178524613, -0.328894347, 0.2032139599, 0.0963194072, -0.2922593951, 0.0688128695, -0.0792856589, -0.0184271783, 0.1651138812, 0.2211026251, 0.3922339976, 0.2243862897, 0.138210699, -0.1602221578, -0.1194183007, 0.398599267, -0.1834306717, -0.0815002248, 0.1523450911, -0.1335784346, -0.0331329815, 0.0964191407, -0.1294159442, 0.1355017722, 0.2478065491, -0.1427010447, -0.0006220322, 0.0272531845, -0.1798281819, 0.2222774923, 0.1978258938, 0.1286402345, 0.2018651366, 0.5253883004, -0.1262489557, -0.2340528071, -0.223922655, 0.2441997081, 0.196128279, -0.2908228636, 0.1298103034, -0.0687722415, 0.0243005455, -0.0847826898, -0.6795876026, -0.3061878681, -0.092197001, 0.0006512664, 0.4704110324, -0.3309011459, 0.0706556514, 0.1599272043, 0.3159407675, 0.0793665126, -0.1885326952, -0.0443736129, -0.3438288867, -0.2535297275, -0.0260645002, 0.4630134404, 0.1464138329, 0.0704184026, 0.3701913953, 0.0221871138, -0.0610450581, -0.4288598299, 0.218477577, -0.0467990264, 0.0778332576, 0.0034070164, 0.1291549504, -0.2472119331, -0.2504463196, 0.3068670332, 0.0360251367, -0.2057614774, 0.3271161616, -0.1920835823, 0.0744267553, -0.1781021953, 0.1151922345, 0.212826252, -0.541801393, 0.3973288238, -0.1855194569, 0.0039906064, -0.2795964777, 0.2635203898, 0.096009925, 0.0679154322, -0.0404973775, 0.0594006591, -0.4201911688, 0.1961021721, -0.0403328687, -0.188174665, 0.0418394208, 0.1097165793, 0.1519097388, 0.1650314033, -0.605876267, -0.012862388, -0.0775756836, 0.5512678027, -0.3430550098, -0.2375438958, 0.1149813235, 0.1875804663, -0.0166975297, 0.1244235188, -0.1434652507, 0.0150683373, -0.0073906644, 0.2049880028, -0.1010251194, 0.527921617, 0.1304709613, 0.7018245459, -0.1654548049, -0.1430086195, 0.3313240409, 0.2419928908, 0.0773650408, 0.0481643602, -0.0284129605, -0.1179991215, -0.1809872985, -0.082166642, -0.0068381652, 0.0487270243, -0.1101651564, -0.0276326984, -0.1180324927, -0.2268261611, -0.1588105559, 0.3197793663, 0.0610070266, -0.1138889641, -0.2007413208, -0.2847954631, -0.0170084089, -0.0803113654, 0.0584910288, 0.0380897671, 0.1093086004, 0.1145235896, -0.0157518536, -0.3002442122, -0.0333696604, 0.0799984336, 0.3141290843, -0.1444273889, 0.0518036634, -0.1972085238, 0.1843084097, -0.4777925909, 0.7541437745, 0.4649644792, -0.0762623399, 0.1359016448, -0.0663606301, -0.3780809641, -0.0619560406, 0.0836299211, 0.198235631, 0.5710030198, 0.1032127365, -0.452648133, -0.1059832275, -0.1052923799, 0.3224130869, 0.0146235228, -0.4784034491, -0.4063739181, -0.4959048629, -0.4578321576, -0.0559185557, 0.0945281163, 0.1901107132, 0.1029647738, -0.098739177, 0.2796905041, -0.2547017336, -0.4795071185, 0.097819306, 0.1785519719, -0.5503333211, 0.1491030306, 0.051228784, 0.3193378448, 0.5359143615, 0.6146828532, 0.5909867883, -0.2183257043, -0.053836219, 0.3960567713, 0.1798867732, 0.1679471433, 0.1672121733, 0.2085579634, -0.1727024913, 0.2022820115, 0.2214762419, -0.0104978755, 0.1908642054, -0.1210767627, -0.0008763261, 0.2911648154, 0.5025098324, -0.2172299027, 0.1578595042, 0.4766682386, 0.2834440768, -0.0467167497, 0.22268641, -0.0596347228, 0.9461206198, -0.0210726671, 0.1325544864, 0.5243245363, -0.4252017736, 0.5806592703, -0.3188992143, 0.0976481736, -0.47740376, 0.3479598761, 0.0661804825, -0.2101876438, -0.0861987025, 0.0646333843, -0.0427131839, -0.1986046433, -0.0862126797, 0.0907084197, -0.1165642962, 0.0720051229, -0.0206810404, 0.0002179146, -0.3245541751, -0.0062563457, -0.345230937, -0.1282552183, -0.1717918664, -0.325017035, 0.0421546549, -0.1757343113, -0.1917933375, 0.2709344923, 0.1396906376, 0.3771395087, 0.2748386264, -0.1422748566, -0.0074553639, -0.4400264919, -0.2658146918, -0.1649733186, -0.0385794491, 0.2240043581, 0.0084365048, -0.1254260391, -0.0218853801, 0.1243400648, 0.1479468495, -0.1720812023, -0.1758477539, 0.1463665664, -0.1700339317, -0.1859630793, -0.140729785, 0.1831436753, -0.1518968344, -0.0311307032, -0.0627594441, -0.1478973329, 0.0817600042, -0.1284502745, 0.0683541, 0.0026662424, 0.0737184733, -0.3161939681, 0.0839199424, -0.3015912175, -0.084051162, 0.2698032856, -0.0315239951, 0.1463475376, 0.4538903236, 0.4027527273, -0.0726220831, -0.0956393853, -0.0567292199, 0.55154109, -0.6051451564, 0.2913154364, -0.1565792412, 0.1126882434, 0.0965900123, 0.3177770972, 0.2544374168, 0.0715058148, 0.0265480578, -0.3478245437, -0.2285253108, 0.4916566014, -0.0185182877, 0.0122019527, 0.102707006, 0.4117231369, -0.0780539066, 0.19734101, -0.2198727131, 0.302084446, 0.0287226886, 0.0564546995, -0.4602079391, -0.2132684737, -0.2015917897, 0.2550785542, 0.0270886347, 0.1679869294, -0.0712248012, -0.1259258389, -0.1276163161, 0.1012033597, 0.1020174026, -0.0968396962, -0.0645024031, -0.1031716466, 0.1211113185, 0.1297840774, 0.13172701, -0.2099904269, -0.05350063, -0.3004154265, 0.0015181461, -0.1877656132, -0.364243269, 0.0790169984, -0.0337791741, 0.289096266, 0.0804840475, 0.2754157782, -0.0237065386, -0.0644062608, -0.2298585474, 0.1052851677, 0.1529579461, -0.0467558764, 0.4014987051, -0.3238122463, -0.0387648121, -0.2653613091, 0.2756448984, 0.4593810141, -0.2252637148, -0.1238567829, 0.0152622275, 0.1677670181, 0.00166329, -0.2151911855, -0.2195244133, -0.0497763194, -0.1538696885, -0.0746735334, -0.0904242247, -0.2073936909, -0.1787253767, 0.1219562143, 0.2947430909, 0.2419091463, -0.3463653326, 0.3792240322, -0.2789326608, -0.1749601811, 0.2887688279, 0.1355135739, 0.5593860149, -0.0907417983, -0.0720366612, 0.180865556, -0.0511427335, 0.0833586007, -0.1531463563, -0.4281861484, -0.1786464155, 0.3637124598, 0.2060843408, -0.2417385131, 0.3044682443, 0.5248377919, 0.4010774493, -0.1126884669, -0.019808121, 0.225604713, -0.1309853047, 0.2223397046, -0.5097848177, -0.1980475187, -0.1236797273, 0.3870285153, -0.1253378391, 0.05571853, 0.4912979007, 0.1782962233, -0.0879886597, -0.6212043762, -0.1130402535, 0.0727153942, -0.0714722052, -0.2394380271, 0.2298416644, 0.6816924214, -0.4974333346, -0.0561953597, -0.2158794552, 0.4886182547, 0.2710983157, -0.2111815214, -0.4033637345, -0.2183921635, -0.0720911324, -0.0950078815, 0.1022535115, 0.5172536373, 0.349851042, 0.2333961427, 0.0662926212, -0.1418414116, 0.2303018868, 0.1463666856, 0.1384517848, 0.0005855188, -0.233346343, -0.2354169786, -0.3443225622, -0.1802336872, -0.22826536, -0.3921260834, -0.3310348988, 0.1211898774, -0.0312106609, -0.1318794936, -0.1365348399, 0.0630985647, -0.0726332217, 0.6978251338, 0.3485355377, 0.2058714479, -0.2465083748, -0.2613238096, -0.2471015751, 0.4796886146, -0.4091092944, 0.1983162463, 0.2130556703, 0.1833835095, 0.107047841, 0.3368975818, -0.0652040988, 0.5276258588, -0.1808631122, -0.2147905529, -0.385112673, 0.0368259735, 0.2935437858, -0.1667666137, -0.1844619513, -0.151456967, 0.338673681, -0.1768075526, 0.1125647649, -0.1182278842, 0.0232721418, 0.0539223999, 0.0855707824, 0.3299840093, 0.0818733126, 0.329172492, 0.028654255, -0.142923981, -0.1079834998, -0.2546293736, -0.1726094484, 0.3846238256, 0.0581522174, 0.4116556644, -0.078766495, 0.0795211047, -0.1733227819, 0.1052343696, -0.4348298907, -0.097911261, 0.1218620613, -0.2352114916, 0.0249756277, 0.1028490216, -0.0171118267, 0.1146760881, 0.0885697529, 0.1137048528, -0.4944940805, -0.1414474398, 0.4697197676, -0.3657931685, -0.2979661226, 0.497099936, 0.1034522653, 0.345236063, -0.1185089797, -0.5068211555, 0.0891442448, 0.1896466017, 0.0586637668, -0.3722426891, 0.2245829999, 0.0482143797, -0.060962975, 0.0519514233, 0.2235717475, 0.1836718023, -0.3651713431, -0.0317126438, -0.1290490478 ]
https://github.com/huggingface/datasets/issues/2181
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
We're using the JSON loader of pyarrow. It parses the file chunk by chunk to load the dataset. This issue happens when there's no delimiter in one chunk of data. For json line, the delimiter is the end of line. So with a big value for chunk_size this should have worked unless you have one extremely long line in your file. Also what version of pyarrow are you using ? FInally I wonder if it could be an issue on pyarrow's side when using big json files. (I haven't tested big json files like yours)
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
95
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! We're using the JSON loader of pyarrow. It parses the file chunk by chunk to load the dataset. This issue happens when there's no delimiter in one chunk of data. For json line, the delimiter is the end of line. So with a big value for chunk_size this should have worked unless you have one extremely long line in your file. Also what version of pyarrow are you using ? FInally I wonder if it could be an issue on pyarrow's side when using big json files. (I haven't tested big json files like yours)
[ 0.0165568739, 0.0126867145, -0.0075108744, 0.3409380913, 0.160453409, -0.264713943, 0.1936330795, 0.5859467387, -0.1621608585, -0.0815065205, 0.1654729992, 0.1441626847, -0.0150833149, 0.01456251, -0.1295211017, -0.1911916286, 0.0333678797, 0.0782744884, -0.0815539062, 0.1355071962, -0.0368868969, 0.2328725904, -0.0935277939, 0.2323914915, -0.0870282501, -0.0781513751, 0.1980637461, 0.3374814093, -0.3348848224, -0.4495864809, 0.1612246335, -0.2951849997, 0.0062585548, 0.3340713382, -0.0001156308, 0.0471058488, 0.2495898008, 0.1091790721, 0.0187434256, -0.2191215008, 0.2808354199, -0.3987069428, 0.2280117273, -0.1674177349, 0.1295844764, -0.4462139606, -0.3999219537, 0.3737814724, 0.427729398, -0.125554949, 0.165101558, 0.0912107527, 0.2657487988, 0.2669146359, 0.4368441105, -0.0652502477, 0.0273979381, 0.5041722059, 0.3052017689, -0.2382046282, -0.3354804814, -0.1370316744, -0.2495918274, 0.1381144822, 0.3779322207, -0.1172009334, 0.0762815028, 0.0589680783, -0.0799431354, 0.0377216265, 0.2263209522, -0.4086020291, -0.1033590436, -0.0781873837, -0.0856485665, -0.1830742359, 0.307918191, 0.3882308602, -0.2103948444, 0.0698303431, -0.1914449632, -0.1000009999, -0.1991206706, 0.1786512583, -0.3580314517, -0.1259491444, -0.0024535414, 0.3322297633, 0.2310531139, -0.0076111378, -0.0355753489, 0.0311065614, -0.2734941244, -0.0565980226, -0.2094624788, 0.0166391879, 0.0015146527, -0.3171830475, 0.1906489283, 0.2260885239, 0.1960858703, -0.0655949488, 0.2463151664, 0.2574919462, 0.6111612916, 0.0594755895, -0.3522538543, -0.1677472293, 0.2054001838, 0.2378149927, -0.0194872245, 0.0609877817, -0.0592072606, -0.5538617373, 0.0594820976, -0.2798269093, 0.2597754002, -0.2160241604, -0.210319832, 0.1333222091, -0.7950462103, 0.0500113703, 0.166253224, 0.2496995479, 0.027215872, 0.2363471687, 0.0485521629, 0.1581958979, 0.0089592859, -0.1194206029, -0.0078674164, 0.1263679564, -0.1525119394, 0.038596414, 0.1579914689, -0.1335816234, -0.0064157024, 0.1193346679, 0.2173472643, -0.2116393894, 0.1862064302, 0.0166175477, 0.0477703437, 0.3288212717, -0.0516764186, 0.1116403192, -0.05485975, -0.0126552582, -0.2687696517, 0.4798907936, -0.0626878217, -0.344812274, -0.1742749661, 0.1004123539, -0.2606139779, 0.2655540109, 0.0049832948, 0.0375166312, 0.1504193246, -0.3691315055, 0.216160357, -0.1311511695, 0.1778308898, -0.345772028, 0.1031698138, -0.0813743174, -0.6869223714, 0.017364569, 0.2560485303, 0.1754172295, -0.0944366753, 0.5446499586, -0.4150454104, 0.1447622329, -0.0459543578, 0.1615657806, 0.1449172646, 0.1606285274, -0.6060850024, 0.3728233874, -0.2745346427, 0.0576428846, 0.0307347607, -0.0146054924, -0.1264384389, -0.0241250247, -0.0301006548, 0.3515684307, 0.0832776129, 0.2309472263, -0.3654413223, -0.2369493693, 0.123363331, 0.3634352684, -0.1145452261, -0.4116989374, -0.049331978, -0.1916891038, 0.055319719, -0.1157419235, 0.1517812014, 0.4218284488, 0.1359185129, -0.1193929464, 0.102687344, 0.1130747795, -0.4654294848, 0.0214598104, 0.071772933, -0.0631103963, -0.3461887836, -0.0881968886, -0.0301498659, 0.2487496287, 0.0945117176, 0.2060093582, 0.0340393037, -0.1731153131, 0.0721886158, -0.0024393648, -0.0986387134, -0.4135909379, 0.1334336698, 0.0734616518, -0.0101107676, 0.3906270862, 0.0637329668, -0.2933793664, 0.0692315102, 0.1497816145, -0.0336899124, -0.1447107196, -0.0944388062, 0.184555918, -0.0829882994, 0.0026108883, -0.2447781116, 0.129320085, 0.2801519334, -0.3557437658, 0.0277640689, 0.103249982, 0.0765697062, -0.0654548556, 0.2241747528, 0.4178524613, -0.328894347, 0.2032139599, 0.0963194072, -0.2922593951, 0.0688128695, -0.0792856589, -0.0184271783, 0.1651138812, 0.2211026251, 0.3922339976, 0.2243862897, 0.138210699, -0.1602221578, -0.1194183007, 0.398599267, -0.1834306717, -0.0815002248, 0.1523450911, -0.1335784346, -0.0331329815, 0.0964191407, -0.1294159442, 0.1355017722, 0.2478065491, -0.1427010447, -0.0006220322, 0.0272531845, -0.1798281819, 0.2222774923, 0.1978258938, 0.1286402345, 0.2018651366, 0.5253883004, -0.1262489557, -0.2340528071, -0.223922655, 0.2441997081, 0.196128279, -0.2908228636, 0.1298103034, -0.0687722415, 0.0243005455, -0.0847826898, -0.6795876026, -0.3061878681, -0.092197001, 0.0006512664, 0.4704110324, -0.3309011459, 0.0706556514, 0.1599272043, 0.3159407675, 0.0793665126, -0.1885326952, -0.0443736129, -0.3438288867, -0.2535297275, -0.0260645002, 0.4630134404, 0.1464138329, 0.0704184026, 0.3701913953, 0.0221871138, -0.0610450581, -0.4288598299, 0.218477577, -0.0467990264, 0.0778332576, 0.0034070164, 0.1291549504, -0.2472119331, -0.2504463196, 0.3068670332, 0.0360251367, -0.2057614774, 0.3271161616, -0.1920835823, 0.0744267553, -0.1781021953, 0.1151922345, 0.212826252, -0.541801393, 0.3973288238, -0.1855194569, 0.0039906064, -0.2795964777, 0.2635203898, 0.096009925, 0.0679154322, -0.0404973775, 0.0594006591, -0.4201911688, 0.1961021721, -0.0403328687, -0.188174665, 0.0418394208, 0.1097165793, 0.1519097388, 0.1650314033, -0.605876267, -0.012862388, -0.0775756836, 0.5512678027, -0.3430550098, -0.2375438958, 0.1149813235, 0.1875804663, -0.0166975297, 0.1244235188, -0.1434652507, 0.0150683373, -0.0073906644, 0.2049880028, -0.1010251194, 0.527921617, 0.1304709613, 0.7018245459, -0.1654548049, -0.1430086195, 0.3313240409, 0.2419928908, 0.0773650408, 0.0481643602, -0.0284129605, -0.1179991215, -0.1809872985, -0.082166642, -0.0068381652, 0.0487270243, -0.1101651564, -0.0276326984, -0.1180324927, -0.2268261611, -0.1588105559, 0.3197793663, 0.0610070266, -0.1138889641, -0.2007413208, -0.2847954631, -0.0170084089, -0.0803113654, 0.0584910288, 0.0380897671, 0.1093086004, 0.1145235896, -0.0157518536, -0.3002442122, -0.0333696604, 0.0799984336, 0.3141290843, -0.1444273889, 0.0518036634, -0.1972085238, 0.1843084097, -0.4777925909, 0.7541437745, 0.4649644792, -0.0762623399, 0.1359016448, -0.0663606301, -0.3780809641, -0.0619560406, 0.0836299211, 0.198235631, 0.5710030198, 0.1032127365, -0.452648133, -0.1059832275, -0.1052923799, 0.3224130869, 0.0146235228, -0.4784034491, -0.4063739181, -0.4959048629, -0.4578321576, -0.0559185557, 0.0945281163, 0.1901107132, 0.1029647738, -0.098739177, 0.2796905041, -0.2547017336, -0.4795071185, 0.097819306, 0.1785519719, -0.5503333211, 0.1491030306, 0.051228784, 0.3193378448, 0.5359143615, 0.6146828532, 0.5909867883, -0.2183257043, -0.053836219, 0.3960567713, 0.1798867732, 0.1679471433, 0.1672121733, 0.2085579634, -0.1727024913, 0.2022820115, 0.2214762419, -0.0104978755, 0.1908642054, -0.1210767627, -0.0008763261, 0.2911648154, 0.5025098324, -0.2172299027, 0.1578595042, 0.4766682386, 0.2834440768, -0.0467167497, 0.22268641, -0.0596347228, 0.9461206198, -0.0210726671, 0.1325544864, 0.5243245363, -0.4252017736, 0.5806592703, -0.3188992143, 0.0976481736, -0.47740376, 0.3479598761, 0.0661804825, -0.2101876438, -0.0861987025, 0.0646333843, -0.0427131839, -0.1986046433, -0.0862126797, 0.0907084197, -0.1165642962, 0.0720051229, -0.0206810404, 0.0002179146, -0.3245541751, -0.0062563457, -0.345230937, -0.1282552183, -0.1717918664, -0.325017035, 0.0421546549, -0.1757343113, -0.1917933375, 0.2709344923, 0.1396906376, 0.3771395087, 0.2748386264, -0.1422748566, -0.0074553639, -0.4400264919, -0.2658146918, -0.1649733186, -0.0385794491, 0.2240043581, 0.0084365048, -0.1254260391, -0.0218853801, 0.1243400648, 0.1479468495, -0.1720812023, -0.1758477539, 0.1463665664, -0.1700339317, -0.1859630793, -0.140729785, 0.1831436753, -0.1518968344, -0.0311307032, -0.0627594441, -0.1478973329, 0.0817600042, -0.1284502745, 0.0683541, 0.0026662424, 0.0737184733, -0.3161939681, 0.0839199424, -0.3015912175, -0.084051162, 0.2698032856, -0.0315239951, 0.1463475376, 0.4538903236, 0.4027527273, -0.0726220831, -0.0956393853, -0.0567292199, 0.55154109, -0.6051451564, 0.2913154364, -0.1565792412, 0.1126882434, 0.0965900123, 0.3177770972, 0.2544374168, 0.0715058148, 0.0265480578, -0.3478245437, -0.2285253108, 0.4916566014, -0.0185182877, 0.0122019527, 0.102707006, 0.4117231369, -0.0780539066, 0.19734101, -0.2198727131, 0.302084446, 0.0287226886, 0.0564546995, -0.4602079391, -0.2132684737, -0.2015917897, 0.2550785542, 0.0270886347, 0.1679869294, -0.0712248012, -0.1259258389, -0.1276163161, 0.1012033597, 0.1020174026, -0.0968396962, -0.0645024031, -0.1031716466, 0.1211113185, 0.1297840774, 0.13172701, -0.2099904269, -0.05350063, -0.3004154265, 0.0015181461, -0.1877656132, -0.364243269, 0.0790169984, -0.0337791741, 0.289096266, 0.0804840475, 0.2754157782, -0.0237065386, -0.0644062608, -0.2298585474, 0.1052851677, 0.1529579461, -0.0467558764, 0.4014987051, -0.3238122463, -0.0387648121, -0.2653613091, 0.2756448984, 0.4593810141, -0.2252637148, -0.1238567829, 0.0152622275, 0.1677670181, 0.00166329, -0.2151911855, -0.2195244133, -0.0497763194, -0.1538696885, -0.0746735334, -0.0904242247, -0.2073936909, -0.1787253767, 0.1219562143, 0.2947430909, 0.2419091463, -0.3463653326, 0.3792240322, -0.2789326608, -0.1749601811, 0.2887688279, 0.1355135739, 0.5593860149, -0.0907417983, -0.0720366612, 0.180865556, -0.0511427335, 0.0833586007, -0.1531463563, -0.4281861484, -0.1786464155, 0.3637124598, 0.2060843408, -0.2417385131, 0.3044682443, 0.5248377919, 0.4010774493, -0.1126884669, -0.019808121, 0.225604713, -0.1309853047, 0.2223397046, -0.5097848177, -0.1980475187, -0.1236797273, 0.3870285153, -0.1253378391, 0.05571853, 0.4912979007, 0.1782962233, -0.0879886597, -0.6212043762, -0.1130402535, 0.0727153942, -0.0714722052, -0.2394380271, 0.2298416644, 0.6816924214, -0.4974333346, -0.0561953597, -0.2158794552, 0.4886182547, 0.2710983157, -0.2111815214, -0.4033637345, -0.2183921635, -0.0720911324, -0.0950078815, 0.1022535115, 0.5172536373, 0.349851042, 0.2333961427, 0.0662926212, -0.1418414116, 0.2303018868, 0.1463666856, 0.1384517848, 0.0005855188, -0.233346343, -0.2354169786, -0.3443225622, -0.1802336872, -0.22826536, -0.3921260834, -0.3310348988, 0.1211898774, -0.0312106609, -0.1318794936, -0.1365348399, 0.0630985647, -0.0726332217, 0.6978251338, 0.3485355377, 0.2058714479, -0.2465083748, -0.2613238096, -0.2471015751, 0.4796886146, -0.4091092944, 0.1983162463, 0.2130556703, 0.1833835095, 0.107047841, 0.3368975818, -0.0652040988, 0.5276258588, -0.1808631122, -0.2147905529, -0.385112673, 0.0368259735, 0.2935437858, -0.1667666137, -0.1844619513, -0.151456967, 0.338673681, -0.1768075526, 0.1125647649, -0.1182278842, 0.0232721418, 0.0539223999, 0.0855707824, 0.3299840093, 0.0818733126, 0.329172492, 0.028654255, -0.142923981, -0.1079834998, -0.2546293736, -0.1726094484, 0.3846238256, 0.0581522174, 0.4116556644, -0.078766495, 0.0795211047, -0.1733227819, 0.1052343696, -0.4348298907, -0.097911261, 0.1218620613, -0.2352114916, 0.0249756277, 0.1028490216, -0.0171118267, 0.1146760881, 0.0885697529, 0.1137048528, -0.4944940805, -0.1414474398, 0.4697197676, -0.3657931685, -0.2979661226, 0.497099936, 0.1034522653, 0.345236063, -0.1185089797, -0.5068211555, 0.0891442448, 0.1896466017, 0.0586637668, -0.3722426891, 0.2245829999, 0.0482143797, -0.060962975, 0.0519514233, 0.2235717475, 0.1836718023, -0.3651713431, -0.0317126438, -0.1290490478 ]
https://github.com/huggingface/datasets/issues/2181
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
I'm using `pyarrow==3.0.0` with `datasets==1.5.0`. Your point totally makes sense. I will check if my jsonl file contains an extremely long file and let you know. Here are some different error messages that I got when tweaking `block_size`. I also suspect that this is related to the pyarrow... but I guess it would be wonderful if datasesets could give a clear guide on how to play with large datasets! (I am suddenly experiencing various issue when working with large datasets.. e.g. #1992 ) ```python return paj.ReadOptions(use_threads=self.use_threads, block_size=self.block_size) File "pyarrow/_json.pyx", line 56, in pyarrow._json.ReadOptions.__init__ File "pyarrow/_json.pyx", line 81, in pyarrow._json.ReadOptions.block_size.__set__ OverflowError: value too large to convert to int32_t ``` ```python line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Exceeded maximum rows ```
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
137
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! I'm using `pyarrow==3.0.0` with `datasets==1.5.0`. Your point totally makes sense. I will check if my jsonl file contains an extremely long file and let you know. Here are some different error messages that I got when tweaking `block_size`. I also suspect that this is related to the pyarrow... but I guess it would be wonderful if datasesets could give a clear guide on how to play with large datasets! (I am suddenly experiencing various issue when working with large datasets.. e.g. #1992 ) ```python return paj.ReadOptions(use_threads=self.use_threads, block_size=self.block_size) File "pyarrow/_json.pyx", line 56, in pyarrow._json.ReadOptions.__init__ File "pyarrow/_json.pyx", line 81, in pyarrow._json.ReadOptions.block_size.__set__ OverflowError: value too large to convert to int32_t ``` ```python line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Exceeded maximum rows ```
[ 0.0165568739, 0.0126867145, -0.0075108744, 0.3409380913, 0.160453409, -0.264713943, 0.1936330795, 0.5859467387, -0.1621608585, -0.0815065205, 0.1654729992, 0.1441626847, -0.0150833149, 0.01456251, -0.1295211017, -0.1911916286, 0.0333678797, 0.0782744884, -0.0815539062, 0.1355071962, -0.0368868969, 0.2328725904, -0.0935277939, 0.2323914915, -0.0870282501, -0.0781513751, 0.1980637461, 0.3374814093, -0.3348848224, -0.4495864809, 0.1612246335, -0.2951849997, 0.0062585548, 0.3340713382, -0.0001156308, 0.0471058488, 0.2495898008, 0.1091790721, 0.0187434256, -0.2191215008, 0.2808354199, -0.3987069428, 0.2280117273, -0.1674177349, 0.1295844764, -0.4462139606, -0.3999219537, 0.3737814724, 0.427729398, -0.125554949, 0.165101558, 0.0912107527, 0.2657487988, 0.2669146359, 0.4368441105, -0.0652502477, 0.0273979381, 0.5041722059, 0.3052017689, -0.2382046282, -0.3354804814, -0.1370316744, -0.2495918274, 0.1381144822, 0.3779322207, -0.1172009334, 0.0762815028, 0.0589680783, -0.0799431354, 0.0377216265, 0.2263209522, -0.4086020291, -0.1033590436, -0.0781873837, -0.0856485665, -0.1830742359, 0.307918191, 0.3882308602, -0.2103948444, 0.0698303431, -0.1914449632, -0.1000009999, -0.1991206706, 0.1786512583, -0.3580314517, -0.1259491444, -0.0024535414, 0.3322297633, 0.2310531139, -0.0076111378, -0.0355753489, 0.0311065614, -0.2734941244, -0.0565980226, -0.2094624788, 0.0166391879, 0.0015146527, -0.3171830475, 0.1906489283, 0.2260885239, 0.1960858703, -0.0655949488, 0.2463151664, 0.2574919462, 0.6111612916, 0.0594755895, -0.3522538543, -0.1677472293, 0.2054001838, 0.2378149927, -0.0194872245, 0.0609877817, -0.0592072606, -0.5538617373, 0.0594820976, -0.2798269093, 0.2597754002, -0.2160241604, -0.210319832, 0.1333222091, -0.7950462103, 0.0500113703, 0.166253224, 0.2496995479, 0.027215872, 0.2363471687, 0.0485521629, 0.1581958979, 0.0089592859, -0.1194206029, -0.0078674164, 0.1263679564, -0.1525119394, 0.038596414, 0.1579914689, -0.1335816234, -0.0064157024, 0.1193346679, 0.2173472643, -0.2116393894, 0.1862064302, 0.0166175477, 0.0477703437, 0.3288212717, -0.0516764186, 0.1116403192, -0.05485975, -0.0126552582, -0.2687696517, 0.4798907936, -0.0626878217, -0.344812274, -0.1742749661, 0.1004123539, -0.2606139779, 0.2655540109, 0.0049832948, 0.0375166312, 0.1504193246, -0.3691315055, 0.216160357, -0.1311511695, 0.1778308898, -0.345772028, 0.1031698138, -0.0813743174, -0.6869223714, 0.017364569, 0.2560485303, 0.1754172295, -0.0944366753, 0.5446499586, -0.4150454104, 0.1447622329, -0.0459543578, 0.1615657806, 0.1449172646, 0.1606285274, -0.6060850024, 0.3728233874, -0.2745346427, 0.0576428846, 0.0307347607, -0.0146054924, -0.1264384389, -0.0241250247, -0.0301006548, 0.3515684307, 0.0832776129, 0.2309472263, -0.3654413223, -0.2369493693, 0.123363331, 0.3634352684, -0.1145452261, -0.4116989374, -0.049331978, -0.1916891038, 0.055319719, -0.1157419235, 0.1517812014, 0.4218284488, 0.1359185129, -0.1193929464, 0.102687344, 0.1130747795, -0.4654294848, 0.0214598104, 0.071772933, -0.0631103963, -0.3461887836, -0.0881968886, -0.0301498659, 0.2487496287, 0.0945117176, 0.2060093582, 0.0340393037, -0.1731153131, 0.0721886158, -0.0024393648, -0.0986387134, -0.4135909379, 0.1334336698, 0.0734616518, -0.0101107676, 0.3906270862, 0.0637329668, -0.2933793664, 0.0692315102, 0.1497816145, -0.0336899124, -0.1447107196, -0.0944388062, 0.184555918, -0.0829882994, 0.0026108883, -0.2447781116, 0.129320085, 0.2801519334, -0.3557437658, 0.0277640689, 0.103249982, 0.0765697062, -0.0654548556, 0.2241747528, 0.4178524613, -0.328894347, 0.2032139599, 0.0963194072, -0.2922593951, 0.0688128695, -0.0792856589, -0.0184271783, 0.1651138812, 0.2211026251, 0.3922339976, 0.2243862897, 0.138210699, -0.1602221578, -0.1194183007, 0.398599267, -0.1834306717, -0.0815002248, 0.1523450911, -0.1335784346, -0.0331329815, 0.0964191407, -0.1294159442, 0.1355017722, 0.2478065491, -0.1427010447, -0.0006220322, 0.0272531845, -0.1798281819, 0.2222774923, 0.1978258938, 0.1286402345, 0.2018651366, 0.5253883004, -0.1262489557, -0.2340528071, -0.223922655, 0.2441997081, 0.196128279, -0.2908228636, 0.1298103034, -0.0687722415, 0.0243005455, -0.0847826898, -0.6795876026, -0.3061878681, -0.092197001, 0.0006512664, 0.4704110324, -0.3309011459, 0.0706556514, 0.1599272043, 0.3159407675, 0.0793665126, -0.1885326952, -0.0443736129, -0.3438288867, -0.2535297275, -0.0260645002, 0.4630134404, 0.1464138329, 0.0704184026, 0.3701913953, 0.0221871138, -0.0610450581, -0.4288598299, 0.218477577, -0.0467990264, 0.0778332576, 0.0034070164, 0.1291549504, -0.2472119331, -0.2504463196, 0.3068670332, 0.0360251367, -0.2057614774, 0.3271161616, -0.1920835823, 0.0744267553, -0.1781021953, 0.1151922345, 0.212826252, -0.541801393, 0.3973288238, -0.1855194569, 0.0039906064, -0.2795964777, 0.2635203898, 0.096009925, 0.0679154322, -0.0404973775, 0.0594006591, -0.4201911688, 0.1961021721, -0.0403328687, -0.188174665, 0.0418394208, 0.1097165793, 0.1519097388, 0.1650314033, -0.605876267, -0.012862388, -0.0775756836, 0.5512678027, -0.3430550098, -0.2375438958, 0.1149813235, 0.1875804663, -0.0166975297, 0.1244235188, -0.1434652507, 0.0150683373, -0.0073906644, 0.2049880028, -0.1010251194, 0.527921617, 0.1304709613, 0.7018245459, -0.1654548049, -0.1430086195, 0.3313240409, 0.2419928908, 0.0773650408, 0.0481643602, -0.0284129605, -0.1179991215, -0.1809872985, -0.082166642, -0.0068381652, 0.0487270243, -0.1101651564, -0.0276326984, -0.1180324927, -0.2268261611, -0.1588105559, 0.3197793663, 0.0610070266, -0.1138889641, -0.2007413208, -0.2847954631, -0.0170084089, -0.0803113654, 0.0584910288, 0.0380897671, 0.1093086004, 0.1145235896, -0.0157518536, -0.3002442122, -0.0333696604, 0.0799984336, 0.3141290843, -0.1444273889, 0.0518036634, -0.1972085238, 0.1843084097, -0.4777925909, 0.7541437745, 0.4649644792, -0.0762623399, 0.1359016448, -0.0663606301, -0.3780809641, -0.0619560406, 0.0836299211, 0.198235631, 0.5710030198, 0.1032127365, -0.452648133, -0.1059832275, -0.1052923799, 0.3224130869, 0.0146235228, -0.4784034491, -0.4063739181, -0.4959048629, -0.4578321576, -0.0559185557, 0.0945281163, 0.1901107132, 0.1029647738, -0.098739177, 0.2796905041, -0.2547017336, -0.4795071185, 0.097819306, 0.1785519719, -0.5503333211, 0.1491030306, 0.051228784, 0.3193378448, 0.5359143615, 0.6146828532, 0.5909867883, -0.2183257043, -0.053836219, 0.3960567713, 0.1798867732, 0.1679471433, 0.1672121733, 0.2085579634, -0.1727024913, 0.2022820115, 0.2214762419, -0.0104978755, 0.1908642054, -0.1210767627, -0.0008763261, 0.2911648154, 0.5025098324, -0.2172299027, 0.1578595042, 0.4766682386, 0.2834440768, -0.0467167497, 0.22268641, -0.0596347228, 0.9461206198, -0.0210726671, 0.1325544864, 0.5243245363, -0.4252017736, 0.5806592703, -0.3188992143, 0.0976481736, -0.47740376, 0.3479598761, 0.0661804825, -0.2101876438, -0.0861987025, 0.0646333843, -0.0427131839, -0.1986046433, -0.0862126797, 0.0907084197, -0.1165642962, 0.0720051229, -0.0206810404, 0.0002179146, -0.3245541751, -0.0062563457, -0.345230937, -0.1282552183, -0.1717918664, -0.325017035, 0.0421546549, -0.1757343113, -0.1917933375, 0.2709344923, 0.1396906376, 0.3771395087, 0.2748386264, -0.1422748566, -0.0074553639, -0.4400264919, -0.2658146918, -0.1649733186, -0.0385794491, 0.2240043581, 0.0084365048, -0.1254260391, -0.0218853801, 0.1243400648, 0.1479468495, -0.1720812023, -0.1758477539, 0.1463665664, -0.1700339317, -0.1859630793, -0.140729785, 0.1831436753, -0.1518968344, -0.0311307032, -0.0627594441, -0.1478973329, 0.0817600042, -0.1284502745, 0.0683541, 0.0026662424, 0.0737184733, -0.3161939681, 0.0839199424, -0.3015912175, -0.084051162, 0.2698032856, -0.0315239951, 0.1463475376, 0.4538903236, 0.4027527273, -0.0726220831, -0.0956393853, -0.0567292199, 0.55154109, -0.6051451564, 0.2913154364, -0.1565792412, 0.1126882434, 0.0965900123, 0.3177770972, 0.2544374168, 0.0715058148, 0.0265480578, -0.3478245437, -0.2285253108, 0.4916566014, -0.0185182877, 0.0122019527, 0.102707006, 0.4117231369, -0.0780539066, 0.19734101, -0.2198727131, 0.302084446, 0.0287226886, 0.0564546995, -0.4602079391, -0.2132684737, -0.2015917897, 0.2550785542, 0.0270886347, 0.1679869294, -0.0712248012, -0.1259258389, -0.1276163161, 0.1012033597, 0.1020174026, -0.0968396962, -0.0645024031, -0.1031716466, 0.1211113185, 0.1297840774, 0.13172701, -0.2099904269, -0.05350063, -0.3004154265, 0.0015181461, -0.1877656132, -0.364243269, 0.0790169984, -0.0337791741, 0.289096266, 0.0804840475, 0.2754157782, -0.0237065386, -0.0644062608, -0.2298585474, 0.1052851677, 0.1529579461, -0.0467558764, 0.4014987051, -0.3238122463, -0.0387648121, -0.2653613091, 0.2756448984, 0.4593810141, -0.2252637148, -0.1238567829, 0.0152622275, 0.1677670181, 0.00166329, -0.2151911855, -0.2195244133, -0.0497763194, -0.1538696885, -0.0746735334, -0.0904242247, -0.2073936909, -0.1787253767, 0.1219562143, 0.2947430909, 0.2419091463, -0.3463653326, 0.3792240322, -0.2789326608, -0.1749601811, 0.2887688279, 0.1355135739, 0.5593860149, -0.0907417983, -0.0720366612, 0.180865556, -0.0511427335, 0.0833586007, -0.1531463563, -0.4281861484, -0.1786464155, 0.3637124598, 0.2060843408, -0.2417385131, 0.3044682443, 0.5248377919, 0.4010774493, -0.1126884669, -0.019808121, 0.225604713, -0.1309853047, 0.2223397046, -0.5097848177, -0.1980475187, -0.1236797273, 0.3870285153, -0.1253378391, 0.05571853, 0.4912979007, 0.1782962233, -0.0879886597, -0.6212043762, -0.1130402535, 0.0727153942, -0.0714722052, -0.2394380271, 0.2298416644, 0.6816924214, -0.4974333346, -0.0561953597, -0.2158794552, 0.4886182547, 0.2710983157, -0.2111815214, -0.4033637345, -0.2183921635, -0.0720911324, -0.0950078815, 0.1022535115, 0.5172536373, 0.349851042, 0.2333961427, 0.0662926212, -0.1418414116, 0.2303018868, 0.1463666856, 0.1384517848, 0.0005855188, -0.233346343, -0.2354169786, -0.3443225622, -0.1802336872, -0.22826536, -0.3921260834, -0.3310348988, 0.1211898774, -0.0312106609, -0.1318794936, -0.1365348399, 0.0630985647, -0.0726332217, 0.6978251338, 0.3485355377, 0.2058714479, -0.2465083748, -0.2613238096, -0.2471015751, 0.4796886146, -0.4091092944, 0.1983162463, 0.2130556703, 0.1833835095, 0.107047841, 0.3368975818, -0.0652040988, 0.5276258588, -0.1808631122, -0.2147905529, -0.385112673, 0.0368259735, 0.2935437858, -0.1667666137, -0.1844619513, -0.151456967, 0.338673681, -0.1768075526, 0.1125647649, -0.1182278842, 0.0232721418, 0.0539223999, 0.0855707824, 0.3299840093, 0.0818733126, 0.329172492, 0.028654255, -0.142923981, -0.1079834998, -0.2546293736, -0.1726094484, 0.3846238256, 0.0581522174, 0.4116556644, -0.078766495, 0.0795211047, -0.1733227819, 0.1052343696, -0.4348298907, -0.097911261, 0.1218620613, -0.2352114916, 0.0249756277, 0.1028490216, -0.0171118267, 0.1146760881, 0.0885697529, 0.1137048528, -0.4944940805, -0.1414474398, 0.4697197676, -0.3657931685, -0.2979661226, 0.497099936, 0.1034522653, 0.345236063, -0.1185089797, -0.5068211555, 0.0891442448, 0.1896466017, 0.0586637668, -0.3722426891, 0.2245829999, 0.0482143797, -0.060962975, 0.0519514233, 0.2235717475, 0.1836718023, -0.3651713431, -0.0317126438, -0.1290490478 ]
https://github.com/huggingface/datasets/issues/2181
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
I am getting the same error. When I tweak the block_size, I also find: `OverflowError: value too large to convert to int32_t` and `pyarrow.lib.ArrowInvalid: Exceeded maximum rows`
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
27
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! I am getting the same error. When I tweak the block_size, I also find: `OverflowError: value too large to convert to int32_t` and `pyarrow.lib.ArrowInvalid: Exceeded maximum rows`
[ 0.0165568739, 0.0126867145, -0.0075108744, 0.3409380913, 0.160453409, -0.264713943, 0.1936330795, 0.5859467387, -0.1621608585, -0.0815065205, 0.1654729992, 0.1441626847, -0.0150833149, 0.01456251, -0.1295211017, -0.1911916286, 0.0333678797, 0.0782744884, -0.0815539062, 0.1355071962, -0.0368868969, 0.2328725904, -0.0935277939, 0.2323914915, -0.0870282501, -0.0781513751, 0.1980637461, 0.3374814093, -0.3348848224, -0.4495864809, 0.1612246335, -0.2951849997, 0.0062585548, 0.3340713382, -0.0001156308, 0.0471058488, 0.2495898008, 0.1091790721, 0.0187434256, -0.2191215008, 0.2808354199, -0.3987069428, 0.2280117273, -0.1674177349, 0.1295844764, -0.4462139606, -0.3999219537, 0.3737814724, 0.427729398, -0.125554949, 0.165101558, 0.0912107527, 0.2657487988, 0.2669146359, 0.4368441105, -0.0652502477, 0.0273979381, 0.5041722059, 0.3052017689, -0.2382046282, -0.3354804814, -0.1370316744, -0.2495918274, 0.1381144822, 0.3779322207, -0.1172009334, 0.0762815028, 0.0589680783, -0.0799431354, 0.0377216265, 0.2263209522, -0.4086020291, -0.1033590436, -0.0781873837, -0.0856485665, -0.1830742359, 0.307918191, 0.3882308602, -0.2103948444, 0.0698303431, -0.1914449632, -0.1000009999, -0.1991206706, 0.1786512583, -0.3580314517, -0.1259491444, -0.0024535414, 0.3322297633, 0.2310531139, -0.0076111378, -0.0355753489, 0.0311065614, -0.2734941244, -0.0565980226, -0.2094624788, 0.0166391879, 0.0015146527, -0.3171830475, 0.1906489283, 0.2260885239, 0.1960858703, -0.0655949488, 0.2463151664, 0.2574919462, 0.6111612916, 0.0594755895, -0.3522538543, -0.1677472293, 0.2054001838, 0.2378149927, -0.0194872245, 0.0609877817, -0.0592072606, -0.5538617373, 0.0594820976, -0.2798269093, 0.2597754002, -0.2160241604, -0.210319832, 0.1333222091, -0.7950462103, 0.0500113703, 0.166253224, 0.2496995479, 0.027215872, 0.2363471687, 0.0485521629, 0.1581958979, 0.0089592859, -0.1194206029, -0.0078674164, 0.1263679564, -0.1525119394, 0.038596414, 0.1579914689, -0.1335816234, -0.0064157024, 0.1193346679, 0.2173472643, -0.2116393894, 0.1862064302, 0.0166175477, 0.0477703437, 0.3288212717, -0.0516764186, 0.1116403192, -0.05485975, -0.0126552582, -0.2687696517, 0.4798907936, -0.0626878217, -0.344812274, -0.1742749661, 0.1004123539, -0.2606139779, 0.2655540109, 0.0049832948, 0.0375166312, 0.1504193246, -0.3691315055, 0.216160357, -0.1311511695, 0.1778308898, -0.345772028, 0.1031698138, -0.0813743174, -0.6869223714, 0.017364569, 0.2560485303, 0.1754172295, -0.0944366753, 0.5446499586, -0.4150454104, 0.1447622329, -0.0459543578, 0.1615657806, 0.1449172646, 0.1606285274, -0.6060850024, 0.3728233874, -0.2745346427, 0.0576428846, 0.0307347607, -0.0146054924, -0.1264384389, -0.0241250247, -0.0301006548, 0.3515684307, 0.0832776129, 0.2309472263, -0.3654413223, -0.2369493693, 0.123363331, 0.3634352684, -0.1145452261, -0.4116989374, -0.049331978, -0.1916891038, 0.055319719, -0.1157419235, 0.1517812014, 0.4218284488, 0.1359185129, -0.1193929464, 0.102687344, 0.1130747795, -0.4654294848, 0.0214598104, 0.071772933, -0.0631103963, -0.3461887836, -0.0881968886, -0.0301498659, 0.2487496287, 0.0945117176, 0.2060093582, 0.0340393037, -0.1731153131, 0.0721886158, -0.0024393648, -0.0986387134, -0.4135909379, 0.1334336698, 0.0734616518, -0.0101107676, 0.3906270862, 0.0637329668, -0.2933793664, 0.0692315102, 0.1497816145, -0.0336899124, -0.1447107196, -0.0944388062, 0.184555918, -0.0829882994, 0.0026108883, -0.2447781116, 0.129320085, 0.2801519334, -0.3557437658, 0.0277640689, 0.103249982, 0.0765697062, -0.0654548556, 0.2241747528, 0.4178524613, -0.328894347, 0.2032139599, 0.0963194072, -0.2922593951, 0.0688128695, -0.0792856589, -0.0184271783, 0.1651138812, 0.2211026251, 0.3922339976, 0.2243862897, 0.138210699, -0.1602221578, -0.1194183007, 0.398599267, -0.1834306717, -0.0815002248, 0.1523450911, -0.1335784346, -0.0331329815, 0.0964191407, -0.1294159442, 0.1355017722, 0.2478065491, -0.1427010447, -0.0006220322, 0.0272531845, -0.1798281819, 0.2222774923, 0.1978258938, 0.1286402345, 0.2018651366, 0.5253883004, -0.1262489557, -0.2340528071, -0.223922655, 0.2441997081, 0.196128279, -0.2908228636, 0.1298103034, -0.0687722415, 0.0243005455, -0.0847826898, -0.6795876026, -0.3061878681, -0.092197001, 0.0006512664, 0.4704110324, -0.3309011459, 0.0706556514, 0.1599272043, 0.3159407675, 0.0793665126, -0.1885326952, -0.0443736129, -0.3438288867, -0.2535297275, -0.0260645002, 0.4630134404, 0.1464138329, 0.0704184026, 0.3701913953, 0.0221871138, -0.0610450581, -0.4288598299, 0.218477577, -0.0467990264, 0.0778332576, 0.0034070164, 0.1291549504, -0.2472119331, -0.2504463196, 0.3068670332, 0.0360251367, -0.2057614774, 0.3271161616, -0.1920835823, 0.0744267553, -0.1781021953, 0.1151922345, 0.212826252, -0.541801393, 0.3973288238, -0.1855194569, 0.0039906064, -0.2795964777, 0.2635203898, 0.096009925, 0.0679154322, -0.0404973775, 0.0594006591, -0.4201911688, 0.1961021721, -0.0403328687, -0.188174665, 0.0418394208, 0.1097165793, 0.1519097388, 0.1650314033, -0.605876267, -0.012862388, -0.0775756836, 0.5512678027, -0.3430550098, -0.2375438958, 0.1149813235, 0.1875804663, -0.0166975297, 0.1244235188, -0.1434652507, 0.0150683373, -0.0073906644, 0.2049880028, -0.1010251194, 0.527921617, 0.1304709613, 0.7018245459, -0.1654548049, -0.1430086195, 0.3313240409, 0.2419928908, 0.0773650408, 0.0481643602, -0.0284129605, -0.1179991215, -0.1809872985, -0.082166642, -0.0068381652, 0.0487270243, -0.1101651564, -0.0276326984, -0.1180324927, -0.2268261611, -0.1588105559, 0.3197793663, 0.0610070266, -0.1138889641, -0.2007413208, -0.2847954631, -0.0170084089, -0.0803113654, 0.0584910288, 0.0380897671, 0.1093086004, 0.1145235896, -0.0157518536, -0.3002442122, -0.0333696604, 0.0799984336, 0.3141290843, -0.1444273889, 0.0518036634, -0.1972085238, 0.1843084097, -0.4777925909, 0.7541437745, 0.4649644792, -0.0762623399, 0.1359016448, -0.0663606301, -0.3780809641, -0.0619560406, 0.0836299211, 0.198235631, 0.5710030198, 0.1032127365, -0.452648133, -0.1059832275, -0.1052923799, 0.3224130869, 0.0146235228, -0.4784034491, -0.4063739181, -0.4959048629, -0.4578321576, -0.0559185557, 0.0945281163, 0.1901107132, 0.1029647738, -0.098739177, 0.2796905041, -0.2547017336, -0.4795071185, 0.097819306, 0.1785519719, -0.5503333211, 0.1491030306, 0.051228784, 0.3193378448, 0.5359143615, 0.6146828532, 0.5909867883, -0.2183257043, -0.053836219, 0.3960567713, 0.1798867732, 0.1679471433, 0.1672121733, 0.2085579634, -0.1727024913, 0.2022820115, 0.2214762419, -0.0104978755, 0.1908642054, -0.1210767627, -0.0008763261, 0.2911648154, 0.5025098324, -0.2172299027, 0.1578595042, 0.4766682386, 0.2834440768, -0.0467167497, 0.22268641, -0.0596347228, 0.9461206198, -0.0210726671, 0.1325544864, 0.5243245363, -0.4252017736, 0.5806592703, -0.3188992143, 0.0976481736, -0.47740376, 0.3479598761, 0.0661804825, -0.2101876438, -0.0861987025, 0.0646333843, -0.0427131839, -0.1986046433, -0.0862126797, 0.0907084197, -0.1165642962, 0.0720051229, -0.0206810404, 0.0002179146, -0.3245541751, -0.0062563457, -0.345230937, -0.1282552183, -0.1717918664, -0.325017035, 0.0421546549, -0.1757343113, -0.1917933375, 0.2709344923, 0.1396906376, 0.3771395087, 0.2748386264, -0.1422748566, -0.0074553639, -0.4400264919, -0.2658146918, -0.1649733186, -0.0385794491, 0.2240043581, 0.0084365048, -0.1254260391, -0.0218853801, 0.1243400648, 0.1479468495, -0.1720812023, -0.1758477539, 0.1463665664, -0.1700339317, -0.1859630793, -0.140729785, 0.1831436753, -0.1518968344, -0.0311307032, -0.0627594441, -0.1478973329, 0.0817600042, -0.1284502745, 0.0683541, 0.0026662424, 0.0737184733, -0.3161939681, 0.0839199424, -0.3015912175, -0.084051162, 0.2698032856, -0.0315239951, 0.1463475376, 0.4538903236, 0.4027527273, -0.0726220831, -0.0956393853, -0.0567292199, 0.55154109, -0.6051451564, 0.2913154364, -0.1565792412, 0.1126882434, 0.0965900123, 0.3177770972, 0.2544374168, 0.0715058148, 0.0265480578, -0.3478245437, -0.2285253108, 0.4916566014, -0.0185182877, 0.0122019527, 0.102707006, 0.4117231369, -0.0780539066, 0.19734101, -0.2198727131, 0.302084446, 0.0287226886, 0.0564546995, -0.4602079391, -0.2132684737, -0.2015917897, 0.2550785542, 0.0270886347, 0.1679869294, -0.0712248012, -0.1259258389, -0.1276163161, 0.1012033597, 0.1020174026, -0.0968396962, -0.0645024031, -0.1031716466, 0.1211113185, 0.1297840774, 0.13172701, -0.2099904269, -0.05350063, -0.3004154265, 0.0015181461, -0.1877656132, -0.364243269, 0.0790169984, -0.0337791741, 0.289096266, 0.0804840475, 0.2754157782, -0.0237065386, -0.0644062608, -0.2298585474, 0.1052851677, 0.1529579461, -0.0467558764, 0.4014987051, -0.3238122463, -0.0387648121, -0.2653613091, 0.2756448984, 0.4593810141, -0.2252637148, -0.1238567829, 0.0152622275, 0.1677670181, 0.00166329, -0.2151911855, -0.2195244133, -0.0497763194, -0.1538696885, -0.0746735334, -0.0904242247, -0.2073936909, -0.1787253767, 0.1219562143, 0.2947430909, 0.2419091463, -0.3463653326, 0.3792240322, -0.2789326608, -0.1749601811, 0.2887688279, 0.1355135739, 0.5593860149, -0.0907417983, -0.0720366612, 0.180865556, -0.0511427335, 0.0833586007, -0.1531463563, -0.4281861484, -0.1786464155, 0.3637124598, 0.2060843408, -0.2417385131, 0.3044682443, 0.5248377919, 0.4010774493, -0.1126884669, -0.019808121, 0.225604713, -0.1309853047, 0.2223397046, -0.5097848177, -0.1980475187, -0.1236797273, 0.3870285153, -0.1253378391, 0.05571853, 0.4912979007, 0.1782962233, -0.0879886597, -0.6212043762, -0.1130402535, 0.0727153942, -0.0714722052, -0.2394380271, 0.2298416644, 0.6816924214, -0.4974333346, -0.0561953597, -0.2158794552, 0.4886182547, 0.2710983157, -0.2111815214, -0.4033637345, -0.2183921635, -0.0720911324, -0.0950078815, 0.1022535115, 0.5172536373, 0.349851042, 0.2333961427, 0.0662926212, -0.1418414116, 0.2303018868, 0.1463666856, 0.1384517848, 0.0005855188, -0.233346343, -0.2354169786, -0.3443225622, -0.1802336872, -0.22826536, -0.3921260834, -0.3310348988, 0.1211898774, -0.0312106609, -0.1318794936, -0.1365348399, 0.0630985647, -0.0726332217, 0.6978251338, 0.3485355377, 0.2058714479, -0.2465083748, -0.2613238096, -0.2471015751, 0.4796886146, -0.4091092944, 0.1983162463, 0.2130556703, 0.1833835095, 0.107047841, 0.3368975818, -0.0652040988, 0.5276258588, -0.1808631122, -0.2147905529, -0.385112673, 0.0368259735, 0.2935437858, -0.1667666137, -0.1844619513, -0.151456967, 0.338673681, -0.1768075526, 0.1125647649, -0.1182278842, 0.0232721418, 0.0539223999, 0.0855707824, 0.3299840093, 0.0818733126, 0.329172492, 0.028654255, -0.142923981, -0.1079834998, -0.2546293736, -0.1726094484, 0.3846238256, 0.0581522174, 0.4116556644, -0.078766495, 0.0795211047, -0.1733227819, 0.1052343696, -0.4348298907, -0.097911261, 0.1218620613, -0.2352114916, 0.0249756277, 0.1028490216, -0.0171118267, 0.1146760881, 0.0885697529, 0.1137048528, -0.4944940805, -0.1414474398, 0.4697197676, -0.3657931685, -0.2979661226, 0.497099936, 0.1034522653, 0.345236063, -0.1185089797, -0.5068211555, 0.0891442448, 0.1896466017, 0.0586637668, -0.3722426891, 0.2245829999, 0.0482143797, -0.060962975, 0.0519514233, 0.2235717475, 0.1836718023, -0.3651713431, -0.0317126438, -0.1290490478 ]
https://github.com/huggingface/datasets/issues/2181
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
I made more tests. I used a smaller dataset and I was getting the same error, which means that it was not necessarily linked to the dataset size. To make both my smaller and larger datasets work, I got rid of lists with the json file. I had the following data format: ```python [ {'key': "a", 'value': ['one', 'two', 'three']}, {'key': "b", 'value': ['four', 'five', 'six']} ] ``` I changed to: ```python {'key': "a", 'value': 'one\ntwo\nthree'}, {'key': "b", 'value': 'four\nfive\nsix']} ``` and that worked! I used the following to reformat my json file: ```python with open(file_name, "w", encoding="utf-8") as f: for item in list_: f.write(json.dumps(item) + "\n") ``` This works with `block_size_10MB = 10 << 20` or without specifying `block_size`.
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
120
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! I made more tests. I used a smaller dataset and I was getting the same error, which means that it was not necessarily linked to the dataset size. To make both my smaller and larger datasets work, I got rid of lists with the json file. I had the following data format: ```python [ {'key': "a", 'value': ['one', 'two', 'three']}, {'key': "b", 'value': ['four', 'five', 'six']} ] ``` I changed to: ```python {'key': "a", 'value': 'one\ntwo\nthree'}, {'key': "b", 'value': 'four\nfive\nsix']} ``` and that worked! I used the following to reformat my json file: ```python with open(file_name, "w", encoding="utf-8") as f: for item in list_: f.write(json.dumps(item) + "\n") ``` This works with `block_size_10MB = 10 << 20` or without specifying `block_size`.
[ 0.0165568739, 0.0126867145, -0.0075108744, 0.3409380913, 0.160453409, -0.264713943, 0.1936330795, 0.5859467387, -0.1621608585, -0.0815065205, 0.1654729992, 0.1441626847, -0.0150833149, 0.01456251, -0.1295211017, -0.1911916286, 0.0333678797, 0.0782744884, -0.0815539062, 0.1355071962, -0.0368868969, 0.2328725904, -0.0935277939, 0.2323914915, -0.0870282501, -0.0781513751, 0.1980637461, 0.3374814093, -0.3348848224, -0.4495864809, 0.1612246335, -0.2951849997, 0.0062585548, 0.3340713382, -0.0001156308, 0.0471058488, 0.2495898008, 0.1091790721, 0.0187434256, -0.2191215008, 0.2808354199, -0.3987069428, 0.2280117273, -0.1674177349, 0.1295844764, -0.4462139606, -0.3999219537, 0.3737814724, 0.427729398, -0.125554949, 0.165101558, 0.0912107527, 0.2657487988, 0.2669146359, 0.4368441105, -0.0652502477, 0.0273979381, 0.5041722059, 0.3052017689, -0.2382046282, -0.3354804814, -0.1370316744, -0.2495918274, 0.1381144822, 0.3779322207, -0.1172009334, 0.0762815028, 0.0589680783, -0.0799431354, 0.0377216265, 0.2263209522, -0.4086020291, -0.1033590436, -0.0781873837, -0.0856485665, -0.1830742359, 0.307918191, 0.3882308602, -0.2103948444, 0.0698303431, -0.1914449632, -0.1000009999, -0.1991206706, 0.1786512583, -0.3580314517, -0.1259491444, -0.0024535414, 0.3322297633, 0.2310531139, -0.0076111378, -0.0355753489, 0.0311065614, -0.2734941244, -0.0565980226, -0.2094624788, 0.0166391879, 0.0015146527, -0.3171830475, 0.1906489283, 0.2260885239, 0.1960858703, -0.0655949488, 0.2463151664, 0.2574919462, 0.6111612916, 0.0594755895, -0.3522538543, -0.1677472293, 0.2054001838, 0.2378149927, -0.0194872245, 0.0609877817, -0.0592072606, -0.5538617373, 0.0594820976, -0.2798269093, 0.2597754002, -0.2160241604, -0.210319832, 0.1333222091, -0.7950462103, 0.0500113703, 0.166253224, 0.2496995479, 0.027215872, 0.2363471687, 0.0485521629, 0.1581958979, 0.0089592859, -0.1194206029, -0.0078674164, 0.1263679564, -0.1525119394, 0.038596414, 0.1579914689, -0.1335816234, -0.0064157024, 0.1193346679, 0.2173472643, -0.2116393894, 0.1862064302, 0.0166175477, 0.0477703437, 0.3288212717, -0.0516764186, 0.1116403192, -0.05485975, -0.0126552582, -0.2687696517, 0.4798907936, -0.0626878217, -0.344812274, -0.1742749661, 0.1004123539, -0.2606139779, 0.2655540109, 0.0049832948, 0.0375166312, 0.1504193246, -0.3691315055, 0.216160357, -0.1311511695, 0.1778308898, -0.345772028, 0.1031698138, -0.0813743174, -0.6869223714, 0.017364569, 0.2560485303, 0.1754172295, -0.0944366753, 0.5446499586, -0.4150454104, 0.1447622329, -0.0459543578, 0.1615657806, 0.1449172646, 0.1606285274, -0.6060850024, 0.3728233874, -0.2745346427, 0.0576428846, 0.0307347607, -0.0146054924, -0.1264384389, -0.0241250247, -0.0301006548, 0.3515684307, 0.0832776129, 0.2309472263, -0.3654413223, -0.2369493693, 0.123363331, 0.3634352684, -0.1145452261, -0.4116989374, -0.049331978, -0.1916891038, 0.055319719, -0.1157419235, 0.1517812014, 0.4218284488, 0.1359185129, -0.1193929464, 0.102687344, 0.1130747795, -0.4654294848, 0.0214598104, 0.071772933, -0.0631103963, -0.3461887836, -0.0881968886, -0.0301498659, 0.2487496287, 0.0945117176, 0.2060093582, 0.0340393037, -0.1731153131, 0.0721886158, -0.0024393648, -0.0986387134, -0.4135909379, 0.1334336698, 0.0734616518, -0.0101107676, 0.3906270862, 0.0637329668, -0.2933793664, 0.0692315102, 0.1497816145, -0.0336899124, -0.1447107196, -0.0944388062, 0.184555918, -0.0829882994, 0.0026108883, -0.2447781116, 0.129320085, 0.2801519334, -0.3557437658, 0.0277640689, 0.103249982, 0.0765697062, -0.0654548556, 0.2241747528, 0.4178524613, -0.328894347, 0.2032139599, 0.0963194072, -0.2922593951, 0.0688128695, -0.0792856589, -0.0184271783, 0.1651138812, 0.2211026251, 0.3922339976, 0.2243862897, 0.138210699, -0.1602221578, -0.1194183007, 0.398599267, -0.1834306717, -0.0815002248, 0.1523450911, -0.1335784346, -0.0331329815, 0.0964191407, -0.1294159442, 0.1355017722, 0.2478065491, -0.1427010447, -0.0006220322, 0.0272531845, -0.1798281819, 0.2222774923, 0.1978258938, 0.1286402345, 0.2018651366, 0.5253883004, -0.1262489557, -0.2340528071, -0.223922655, 0.2441997081, 0.196128279, -0.2908228636, 0.1298103034, -0.0687722415, 0.0243005455, -0.0847826898, -0.6795876026, -0.3061878681, -0.092197001, 0.0006512664, 0.4704110324, -0.3309011459, 0.0706556514, 0.1599272043, 0.3159407675, 0.0793665126, -0.1885326952, -0.0443736129, -0.3438288867, -0.2535297275, -0.0260645002, 0.4630134404, 0.1464138329, 0.0704184026, 0.3701913953, 0.0221871138, -0.0610450581, -0.4288598299, 0.218477577, -0.0467990264, 0.0778332576, 0.0034070164, 0.1291549504, -0.2472119331, -0.2504463196, 0.3068670332, 0.0360251367, -0.2057614774, 0.3271161616, -0.1920835823, 0.0744267553, -0.1781021953, 0.1151922345, 0.212826252, -0.541801393, 0.3973288238, -0.1855194569, 0.0039906064, -0.2795964777, 0.2635203898, 0.096009925, 0.0679154322, -0.0404973775, 0.0594006591, -0.4201911688, 0.1961021721, -0.0403328687, -0.188174665, 0.0418394208, 0.1097165793, 0.1519097388, 0.1650314033, -0.605876267, -0.012862388, -0.0775756836, 0.5512678027, -0.3430550098, -0.2375438958, 0.1149813235, 0.1875804663, -0.0166975297, 0.1244235188, -0.1434652507, 0.0150683373, -0.0073906644, 0.2049880028, -0.1010251194, 0.527921617, 0.1304709613, 0.7018245459, -0.1654548049, -0.1430086195, 0.3313240409, 0.2419928908, 0.0773650408, 0.0481643602, -0.0284129605, -0.1179991215, -0.1809872985, -0.082166642, -0.0068381652, 0.0487270243, -0.1101651564, -0.0276326984, -0.1180324927, -0.2268261611, -0.1588105559, 0.3197793663, 0.0610070266, -0.1138889641, -0.2007413208, -0.2847954631, -0.0170084089, -0.0803113654, 0.0584910288, 0.0380897671, 0.1093086004, 0.1145235896, -0.0157518536, -0.3002442122, -0.0333696604, 0.0799984336, 0.3141290843, -0.1444273889, 0.0518036634, -0.1972085238, 0.1843084097, -0.4777925909, 0.7541437745, 0.4649644792, -0.0762623399, 0.1359016448, -0.0663606301, -0.3780809641, -0.0619560406, 0.0836299211, 0.198235631, 0.5710030198, 0.1032127365, -0.452648133, -0.1059832275, -0.1052923799, 0.3224130869, 0.0146235228, -0.4784034491, -0.4063739181, -0.4959048629, -0.4578321576, -0.0559185557, 0.0945281163, 0.1901107132, 0.1029647738, -0.098739177, 0.2796905041, -0.2547017336, -0.4795071185, 0.097819306, 0.1785519719, -0.5503333211, 0.1491030306, 0.051228784, 0.3193378448, 0.5359143615, 0.6146828532, 0.5909867883, -0.2183257043, -0.053836219, 0.3960567713, 0.1798867732, 0.1679471433, 0.1672121733, 0.2085579634, -0.1727024913, 0.2022820115, 0.2214762419, -0.0104978755, 0.1908642054, -0.1210767627, -0.0008763261, 0.2911648154, 0.5025098324, -0.2172299027, 0.1578595042, 0.4766682386, 0.2834440768, -0.0467167497, 0.22268641, -0.0596347228, 0.9461206198, -0.0210726671, 0.1325544864, 0.5243245363, -0.4252017736, 0.5806592703, -0.3188992143, 0.0976481736, -0.47740376, 0.3479598761, 0.0661804825, -0.2101876438, -0.0861987025, 0.0646333843, -0.0427131839, -0.1986046433, -0.0862126797, 0.0907084197, -0.1165642962, 0.0720051229, -0.0206810404, 0.0002179146, -0.3245541751, -0.0062563457, -0.345230937, -0.1282552183, -0.1717918664, -0.325017035, 0.0421546549, -0.1757343113, -0.1917933375, 0.2709344923, 0.1396906376, 0.3771395087, 0.2748386264, -0.1422748566, -0.0074553639, -0.4400264919, -0.2658146918, -0.1649733186, -0.0385794491, 0.2240043581, 0.0084365048, -0.1254260391, -0.0218853801, 0.1243400648, 0.1479468495, -0.1720812023, -0.1758477539, 0.1463665664, -0.1700339317, -0.1859630793, -0.140729785, 0.1831436753, -0.1518968344, -0.0311307032, -0.0627594441, -0.1478973329, 0.0817600042, -0.1284502745, 0.0683541, 0.0026662424, 0.0737184733, -0.3161939681, 0.0839199424, -0.3015912175, -0.084051162, 0.2698032856, -0.0315239951, 0.1463475376, 0.4538903236, 0.4027527273, -0.0726220831, -0.0956393853, -0.0567292199, 0.55154109, -0.6051451564, 0.2913154364, -0.1565792412, 0.1126882434, 0.0965900123, 0.3177770972, 0.2544374168, 0.0715058148, 0.0265480578, -0.3478245437, -0.2285253108, 0.4916566014, -0.0185182877, 0.0122019527, 0.102707006, 0.4117231369, -0.0780539066, 0.19734101, -0.2198727131, 0.302084446, 0.0287226886, 0.0564546995, -0.4602079391, -0.2132684737, -0.2015917897, 0.2550785542, 0.0270886347, 0.1679869294, -0.0712248012, -0.1259258389, -0.1276163161, 0.1012033597, 0.1020174026, -0.0968396962, -0.0645024031, -0.1031716466, 0.1211113185, 0.1297840774, 0.13172701, -0.2099904269, -0.05350063, -0.3004154265, 0.0015181461, -0.1877656132, -0.364243269, 0.0790169984, -0.0337791741, 0.289096266, 0.0804840475, 0.2754157782, -0.0237065386, -0.0644062608, -0.2298585474, 0.1052851677, 0.1529579461, -0.0467558764, 0.4014987051, -0.3238122463, -0.0387648121, -0.2653613091, 0.2756448984, 0.4593810141, -0.2252637148, -0.1238567829, 0.0152622275, 0.1677670181, 0.00166329, -0.2151911855, -0.2195244133, -0.0497763194, -0.1538696885, -0.0746735334, -0.0904242247, -0.2073936909, -0.1787253767, 0.1219562143, 0.2947430909, 0.2419091463, -0.3463653326, 0.3792240322, -0.2789326608, -0.1749601811, 0.2887688279, 0.1355135739, 0.5593860149, -0.0907417983, -0.0720366612, 0.180865556, -0.0511427335, 0.0833586007, -0.1531463563, -0.4281861484, -0.1786464155, 0.3637124598, 0.2060843408, -0.2417385131, 0.3044682443, 0.5248377919, 0.4010774493, -0.1126884669, -0.019808121, 0.225604713, -0.1309853047, 0.2223397046, -0.5097848177, -0.1980475187, -0.1236797273, 0.3870285153, -0.1253378391, 0.05571853, 0.4912979007, 0.1782962233, -0.0879886597, -0.6212043762, -0.1130402535, 0.0727153942, -0.0714722052, -0.2394380271, 0.2298416644, 0.6816924214, -0.4974333346, -0.0561953597, -0.2158794552, 0.4886182547, 0.2710983157, -0.2111815214, -0.4033637345, -0.2183921635, -0.0720911324, -0.0950078815, 0.1022535115, 0.5172536373, 0.349851042, 0.2333961427, 0.0662926212, -0.1418414116, 0.2303018868, 0.1463666856, 0.1384517848, 0.0005855188, -0.233346343, -0.2354169786, -0.3443225622, -0.1802336872, -0.22826536, -0.3921260834, -0.3310348988, 0.1211898774, -0.0312106609, -0.1318794936, -0.1365348399, 0.0630985647, -0.0726332217, 0.6978251338, 0.3485355377, 0.2058714479, -0.2465083748, -0.2613238096, -0.2471015751, 0.4796886146, -0.4091092944, 0.1983162463, 0.2130556703, 0.1833835095, 0.107047841, 0.3368975818, -0.0652040988, 0.5276258588, -0.1808631122, -0.2147905529, -0.385112673, 0.0368259735, 0.2935437858, -0.1667666137, -0.1844619513, -0.151456967, 0.338673681, -0.1768075526, 0.1125647649, -0.1182278842, 0.0232721418, 0.0539223999, 0.0855707824, 0.3299840093, 0.0818733126, 0.329172492, 0.028654255, -0.142923981, -0.1079834998, -0.2546293736, -0.1726094484, 0.3846238256, 0.0581522174, 0.4116556644, -0.078766495, 0.0795211047, -0.1733227819, 0.1052343696, -0.4348298907, -0.097911261, 0.1218620613, -0.2352114916, 0.0249756277, 0.1028490216, -0.0171118267, 0.1146760881, 0.0885697529, 0.1137048528, -0.4944940805, -0.1414474398, 0.4697197676, -0.3657931685, -0.2979661226, 0.497099936, 0.1034522653, 0.345236063, -0.1185089797, -0.5068211555, 0.0891442448, 0.1896466017, 0.0586637668, -0.3722426891, 0.2245829999, 0.0482143797, -0.060962975, 0.0519514233, 0.2235717475, 0.1836718023, -0.3651713431, -0.0317126438, -0.1290490478 ]
https://github.com/huggingface/datasets/issues/2181
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Thanks @hwijeen for reporting and thanks @jpilaul for pointing this out. Indeed, those are different JSON-like formats: - the first one is the **standard JSON** format: all the file content is JSON-valid, thus all content is either a JSON object (between curly brackets `{...}`) or a JSON array (between square brackets `[...]`) - the second one is called **JSON Lines**: the entire file content is not JSON-valid, but only every line (newline-delimited) is JSON-valid Currently PyArrow only supports **JSON Lines** format: - https://arrow.apache.org/docs/python/generated/pyarrow.json.read_json.html > Currently only the line-delimited JSON format is supported. - https://arrow.apache.org/docs/python/json.html > Arrow supports reading columnar data from line-delimited JSON files.
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
104
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! Thanks @hwijeen for reporting and thanks @jpilaul for pointing this out. Indeed, those are different JSON-like formats: - the first one is the **standard JSON** format: all the file content is JSON-valid, thus all content is either a JSON object (between curly brackets `{...}`) or a JSON array (between square brackets `[...]`) - the second one is called **JSON Lines**: the entire file content is not JSON-valid, but only every line (newline-delimited) is JSON-valid Currently PyArrow only supports **JSON Lines** format: - https://arrow.apache.org/docs/python/generated/pyarrow.json.read_json.html > Currently only the line-delimited JSON format is supported. - https://arrow.apache.org/docs/python/json.html > Arrow supports reading columnar data from line-delimited JSON files.
[ 0.0165568739, 0.0126867145, -0.0075108744, 0.3409380913, 0.160453409, -0.264713943, 0.1936330795, 0.5859467387, -0.1621608585, -0.0815065205, 0.1654729992, 0.1441626847, -0.0150833149, 0.01456251, -0.1295211017, -0.1911916286, 0.0333678797, 0.0782744884, -0.0815539062, 0.1355071962, -0.0368868969, 0.2328725904, -0.0935277939, 0.2323914915, -0.0870282501, -0.0781513751, 0.1980637461, 0.3374814093, -0.3348848224, -0.4495864809, 0.1612246335, -0.2951849997, 0.0062585548, 0.3340713382, -0.0001156308, 0.0471058488, 0.2495898008, 0.1091790721, 0.0187434256, -0.2191215008, 0.2808354199, -0.3987069428, 0.2280117273, -0.1674177349, 0.1295844764, -0.4462139606, -0.3999219537, 0.3737814724, 0.427729398, -0.125554949, 0.165101558, 0.0912107527, 0.2657487988, 0.2669146359, 0.4368441105, -0.0652502477, 0.0273979381, 0.5041722059, 0.3052017689, -0.2382046282, -0.3354804814, -0.1370316744, -0.2495918274, 0.1381144822, 0.3779322207, -0.1172009334, 0.0762815028, 0.0589680783, -0.0799431354, 0.0377216265, 0.2263209522, -0.4086020291, -0.1033590436, -0.0781873837, -0.0856485665, -0.1830742359, 0.307918191, 0.3882308602, -0.2103948444, 0.0698303431, -0.1914449632, -0.1000009999, -0.1991206706, 0.1786512583, -0.3580314517, -0.1259491444, -0.0024535414, 0.3322297633, 0.2310531139, -0.0076111378, -0.0355753489, 0.0311065614, -0.2734941244, -0.0565980226, -0.2094624788, 0.0166391879, 0.0015146527, -0.3171830475, 0.1906489283, 0.2260885239, 0.1960858703, -0.0655949488, 0.2463151664, 0.2574919462, 0.6111612916, 0.0594755895, -0.3522538543, -0.1677472293, 0.2054001838, 0.2378149927, -0.0194872245, 0.0609877817, -0.0592072606, -0.5538617373, 0.0594820976, -0.2798269093, 0.2597754002, -0.2160241604, -0.210319832, 0.1333222091, -0.7950462103, 0.0500113703, 0.166253224, 0.2496995479, 0.027215872, 0.2363471687, 0.0485521629, 0.1581958979, 0.0089592859, -0.1194206029, -0.0078674164, 0.1263679564, -0.1525119394, 0.038596414, 0.1579914689, -0.1335816234, -0.0064157024, 0.1193346679, 0.2173472643, -0.2116393894, 0.1862064302, 0.0166175477, 0.0477703437, 0.3288212717, -0.0516764186, 0.1116403192, -0.05485975, -0.0126552582, -0.2687696517, 0.4798907936, -0.0626878217, -0.344812274, -0.1742749661, 0.1004123539, -0.2606139779, 0.2655540109, 0.0049832948, 0.0375166312, 0.1504193246, -0.3691315055, 0.216160357, -0.1311511695, 0.1778308898, -0.345772028, 0.1031698138, -0.0813743174, -0.6869223714, 0.017364569, 0.2560485303, 0.1754172295, -0.0944366753, 0.5446499586, -0.4150454104, 0.1447622329, -0.0459543578, 0.1615657806, 0.1449172646, 0.1606285274, -0.6060850024, 0.3728233874, -0.2745346427, 0.0576428846, 0.0307347607, -0.0146054924, -0.1264384389, -0.0241250247, -0.0301006548, 0.3515684307, 0.0832776129, 0.2309472263, -0.3654413223, -0.2369493693, 0.123363331, 0.3634352684, -0.1145452261, -0.4116989374, -0.049331978, -0.1916891038, 0.055319719, -0.1157419235, 0.1517812014, 0.4218284488, 0.1359185129, -0.1193929464, 0.102687344, 0.1130747795, -0.4654294848, 0.0214598104, 0.071772933, -0.0631103963, -0.3461887836, -0.0881968886, -0.0301498659, 0.2487496287, 0.0945117176, 0.2060093582, 0.0340393037, -0.1731153131, 0.0721886158, -0.0024393648, -0.0986387134, -0.4135909379, 0.1334336698, 0.0734616518, -0.0101107676, 0.3906270862, 0.0637329668, -0.2933793664, 0.0692315102, 0.1497816145, -0.0336899124, -0.1447107196, -0.0944388062, 0.184555918, -0.0829882994, 0.0026108883, -0.2447781116, 0.129320085, 0.2801519334, -0.3557437658, 0.0277640689, 0.103249982, 0.0765697062, -0.0654548556, 0.2241747528, 0.4178524613, -0.328894347, 0.2032139599, 0.0963194072, -0.2922593951, 0.0688128695, -0.0792856589, -0.0184271783, 0.1651138812, 0.2211026251, 0.3922339976, 0.2243862897, 0.138210699, -0.1602221578, -0.1194183007, 0.398599267, -0.1834306717, -0.0815002248, 0.1523450911, -0.1335784346, -0.0331329815, 0.0964191407, -0.1294159442, 0.1355017722, 0.2478065491, -0.1427010447, -0.0006220322, 0.0272531845, -0.1798281819, 0.2222774923, 0.1978258938, 0.1286402345, 0.2018651366, 0.5253883004, -0.1262489557, -0.2340528071, -0.223922655, 0.2441997081, 0.196128279, -0.2908228636, 0.1298103034, -0.0687722415, 0.0243005455, -0.0847826898, -0.6795876026, -0.3061878681, -0.092197001, 0.0006512664, 0.4704110324, -0.3309011459, 0.0706556514, 0.1599272043, 0.3159407675, 0.0793665126, -0.1885326952, -0.0443736129, -0.3438288867, -0.2535297275, -0.0260645002, 0.4630134404, 0.1464138329, 0.0704184026, 0.3701913953, 0.0221871138, -0.0610450581, -0.4288598299, 0.218477577, -0.0467990264, 0.0778332576, 0.0034070164, 0.1291549504, -0.2472119331, -0.2504463196, 0.3068670332, 0.0360251367, -0.2057614774, 0.3271161616, -0.1920835823, 0.0744267553, -0.1781021953, 0.1151922345, 0.212826252, -0.541801393, 0.3973288238, -0.1855194569, 0.0039906064, -0.2795964777, 0.2635203898, 0.096009925, 0.0679154322, -0.0404973775, 0.0594006591, -0.4201911688, 0.1961021721, -0.0403328687, -0.188174665, 0.0418394208, 0.1097165793, 0.1519097388, 0.1650314033, -0.605876267, -0.012862388, -0.0775756836, 0.5512678027, -0.3430550098, -0.2375438958, 0.1149813235, 0.1875804663, -0.0166975297, 0.1244235188, -0.1434652507, 0.0150683373, -0.0073906644, 0.2049880028, -0.1010251194, 0.527921617, 0.1304709613, 0.7018245459, -0.1654548049, -0.1430086195, 0.3313240409, 0.2419928908, 0.0773650408, 0.0481643602, -0.0284129605, -0.1179991215, -0.1809872985, -0.082166642, -0.0068381652, 0.0487270243, -0.1101651564, -0.0276326984, -0.1180324927, -0.2268261611, -0.1588105559, 0.3197793663, 0.0610070266, -0.1138889641, -0.2007413208, -0.2847954631, -0.0170084089, -0.0803113654, 0.0584910288, 0.0380897671, 0.1093086004, 0.1145235896, -0.0157518536, -0.3002442122, -0.0333696604, 0.0799984336, 0.3141290843, -0.1444273889, 0.0518036634, -0.1972085238, 0.1843084097, -0.4777925909, 0.7541437745, 0.4649644792, -0.0762623399, 0.1359016448, -0.0663606301, -0.3780809641, -0.0619560406, 0.0836299211, 0.198235631, 0.5710030198, 0.1032127365, -0.452648133, -0.1059832275, -0.1052923799, 0.3224130869, 0.0146235228, -0.4784034491, -0.4063739181, -0.4959048629, -0.4578321576, -0.0559185557, 0.0945281163, 0.1901107132, 0.1029647738, -0.098739177, 0.2796905041, -0.2547017336, -0.4795071185, 0.097819306, 0.1785519719, -0.5503333211, 0.1491030306, 0.051228784, 0.3193378448, 0.5359143615, 0.6146828532, 0.5909867883, -0.2183257043, -0.053836219, 0.3960567713, 0.1798867732, 0.1679471433, 0.1672121733, 0.2085579634, -0.1727024913, 0.2022820115, 0.2214762419, -0.0104978755, 0.1908642054, -0.1210767627, -0.0008763261, 0.2911648154, 0.5025098324, -0.2172299027, 0.1578595042, 0.4766682386, 0.2834440768, -0.0467167497, 0.22268641, -0.0596347228, 0.9461206198, -0.0210726671, 0.1325544864, 0.5243245363, -0.4252017736, 0.5806592703, -0.3188992143, 0.0976481736, -0.47740376, 0.3479598761, 0.0661804825, -0.2101876438, -0.0861987025, 0.0646333843, -0.0427131839, -0.1986046433, -0.0862126797, 0.0907084197, -0.1165642962, 0.0720051229, -0.0206810404, 0.0002179146, -0.3245541751, -0.0062563457, -0.345230937, -0.1282552183, -0.1717918664, -0.325017035, 0.0421546549, -0.1757343113, -0.1917933375, 0.2709344923, 0.1396906376, 0.3771395087, 0.2748386264, -0.1422748566, -0.0074553639, -0.4400264919, -0.2658146918, -0.1649733186, -0.0385794491, 0.2240043581, 0.0084365048, -0.1254260391, -0.0218853801, 0.1243400648, 0.1479468495, -0.1720812023, -0.1758477539, 0.1463665664, -0.1700339317, -0.1859630793, -0.140729785, 0.1831436753, -0.1518968344, -0.0311307032, -0.0627594441, -0.1478973329, 0.0817600042, -0.1284502745, 0.0683541, 0.0026662424, 0.0737184733, -0.3161939681, 0.0839199424, -0.3015912175, -0.084051162, 0.2698032856, -0.0315239951, 0.1463475376, 0.4538903236, 0.4027527273, -0.0726220831, -0.0956393853, -0.0567292199, 0.55154109, -0.6051451564, 0.2913154364, -0.1565792412, 0.1126882434, 0.0965900123, 0.3177770972, 0.2544374168, 0.0715058148, 0.0265480578, -0.3478245437, -0.2285253108, 0.4916566014, -0.0185182877, 0.0122019527, 0.102707006, 0.4117231369, -0.0780539066, 0.19734101, -0.2198727131, 0.302084446, 0.0287226886, 0.0564546995, -0.4602079391, -0.2132684737, -0.2015917897, 0.2550785542, 0.0270886347, 0.1679869294, -0.0712248012, -0.1259258389, -0.1276163161, 0.1012033597, 0.1020174026, -0.0968396962, -0.0645024031, -0.1031716466, 0.1211113185, 0.1297840774, 0.13172701, -0.2099904269, -0.05350063, -0.3004154265, 0.0015181461, -0.1877656132, -0.364243269, 0.0790169984, -0.0337791741, 0.289096266, 0.0804840475, 0.2754157782, -0.0237065386, -0.0644062608, -0.2298585474, 0.1052851677, 0.1529579461, -0.0467558764, 0.4014987051, -0.3238122463, -0.0387648121, -0.2653613091, 0.2756448984, 0.4593810141, -0.2252637148, -0.1238567829, 0.0152622275, 0.1677670181, 0.00166329, -0.2151911855, -0.2195244133, -0.0497763194, -0.1538696885, -0.0746735334, -0.0904242247, -0.2073936909, -0.1787253767, 0.1219562143, 0.2947430909, 0.2419091463, -0.3463653326, 0.3792240322, -0.2789326608, -0.1749601811, 0.2887688279, 0.1355135739, 0.5593860149, -0.0907417983, -0.0720366612, 0.180865556, -0.0511427335, 0.0833586007, -0.1531463563, -0.4281861484, -0.1786464155, 0.3637124598, 0.2060843408, -0.2417385131, 0.3044682443, 0.5248377919, 0.4010774493, -0.1126884669, -0.019808121, 0.225604713, -0.1309853047, 0.2223397046, -0.5097848177, -0.1980475187, -0.1236797273, 0.3870285153, -0.1253378391, 0.05571853, 0.4912979007, 0.1782962233, -0.0879886597, -0.6212043762, -0.1130402535, 0.0727153942, -0.0714722052, -0.2394380271, 0.2298416644, 0.6816924214, -0.4974333346, -0.0561953597, -0.2158794552, 0.4886182547, 0.2710983157, -0.2111815214, -0.4033637345, -0.2183921635, -0.0720911324, -0.0950078815, 0.1022535115, 0.5172536373, 0.349851042, 0.2333961427, 0.0662926212, -0.1418414116, 0.2303018868, 0.1463666856, 0.1384517848, 0.0005855188, -0.233346343, -0.2354169786, -0.3443225622, -0.1802336872, -0.22826536, -0.3921260834, -0.3310348988, 0.1211898774, -0.0312106609, -0.1318794936, -0.1365348399, 0.0630985647, -0.0726332217, 0.6978251338, 0.3485355377, 0.2058714479, -0.2465083748, -0.2613238096, -0.2471015751, 0.4796886146, -0.4091092944, 0.1983162463, 0.2130556703, 0.1833835095, 0.107047841, 0.3368975818, -0.0652040988, 0.5276258588, -0.1808631122, -0.2147905529, -0.385112673, 0.0368259735, 0.2935437858, -0.1667666137, -0.1844619513, -0.151456967, 0.338673681, -0.1768075526, 0.1125647649, -0.1182278842, 0.0232721418, 0.0539223999, 0.0855707824, 0.3299840093, 0.0818733126, 0.329172492, 0.028654255, -0.142923981, -0.1079834998, -0.2546293736, -0.1726094484, 0.3846238256, 0.0581522174, 0.4116556644, -0.078766495, 0.0795211047, -0.1733227819, 0.1052343696, -0.4348298907, -0.097911261, 0.1218620613, -0.2352114916, 0.0249756277, 0.1028490216, -0.0171118267, 0.1146760881, 0.0885697529, 0.1137048528, -0.4944940805, -0.1414474398, 0.4697197676, -0.3657931685, -0.2979661226, 0.497099936, 0.1034522653, 0.345236063, -0.1185089797, -0.5068211555, 0.0891442448, 0.1896466017, 0.0586637668, -0.3722426891, 0.2245829999, 0.0482143797, -0.060962975, 0.0519514233, 0.2235717475, 0.1836718023, -0.3651713431, -0.0317126438, -0.1290490478 ]
https://github.com/huggingface/datasets/issues/2181
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Thanks @albertvillanova for your explanation, it is helpful to know (maybe add to docs?)! However, the problem I described above happened when I was dealing with jsonl files 😿 Although I did not thoroughly inspect, I suspect the cause was the one extremely long document in my case.
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
48
Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project. When loading a huge json file of 500GB, pyarrow complains as follows: ``` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir yield tmp_dir File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose): File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables parse_options=self.config.pa_parse_options, File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?) ``` When using only a small portion of the sample file, say first 100 lines, it works perfectly well.. I see that it is the error from pyarrow, but could you give me a hint or possible solutions? #369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! Thanks @albertvillanova for your explanation, it is helpful to know (maybe add to docs?)! However, the problem I described above happened when I was dealing with jsonl files 😿 Although I did not thoroughly inspect, I suspect the cause was the one extremely long document in my case.
[ 0.0165568739, 0.0126867145, -0.0075108744, 0.3409380913, 0.160453409, -0.264713943, 0.1936330795, 0.5859467387, -0.1621608585, -0.0815065205, 0.1654729992, 0.1441626847, -0.0150833149, 0.01456251, -0.1295211017, -0.1911916286, 0.0333678797, 0.0782744884, -0.0815539062, 0.1355071962, -0.0368868969, 0.2328725904, -0.0935277939, 0.2323914915, -0.0870282501, -0.0781513751, 0.1980637461, 0.3374814093, -0.3348848224, -0.4495864809, 0.1612246335, -0.2951849997, 0.0062585548, 0.3340713382, -0.0001156308, 0.0471058488, 0.2495898008, 0.1091790721, 0.0187434256, -0.2191215008, 0.2808354199, -0.3987069428, 0.2280117273, -0.1674177349, 0.1295844764, -0.4462139606, -0.3999219537, 0.3737814724, 0.427729398, -0.125554949, 0.165101558, 0.0912107527, 0.2657487988, 0.2669146359, 0.4368441105, -0.0652502477, 0.0273979381, 0.5041722059, 0.3052017689, -0.2382046282, -0.3354804814, -0.1370316744, -0.2495918274, 0.1381144822, 0.3779322207, -0.1172009334, 0.0762815028, 0.0589680783, -0.0799431354, 0.0377216265, 0.2263209522, -0.4086020291, -0.1033590436, -0.0781873837, -0.0856485665, -0.1830742359, 0.307918191, 0.3882308602, -0.2103948444, 0.0698303431, -0.1914449632, -0.1000009999, -0.1991206706, 0.1786512583, -0.3580314517, -0.1259491444, -0.0024535414, 0.3322297633, 0.2310531139, -0.0076111378, -0.0355753489, 0.0311065614, -0.2734941244, -0.0565980226, -0.2094624788, 0.0166391879, 0.0015146527, -0.3171830475, 0.1906489283, 0.2260885239, 0.1960858703, -0.0655949488, 0.2463151664, 0.2574919462, 0.6111612916, 0.0594755895, -0.3522538543, -0.1677472293, 0.2054001838, 0.2378149927, -0.0194872245, 0.0609877817, -0.0592072606, -0.5538617373, 0.0594820976, -0.2798269093, 0.2597754002, -0.2160241604, -0.210319832, 0.1333222091, -0.7950462103, 0.0500113703, 0.166253224, 0.2496995479, 0.027215872, 0.2363471687, 0.0485521629, 0.1581958979, 0.0089592859, -0.1194206029, -0.0078674164, 0.1263679564, -0.1525119394, 0.038596414, 0.1579914689, -0.1335816234, -0.0064157024, 0.1193346679, 0.2173472643, -0.2116393894, 0.1862064302, 0.0166175477, 0.0477703437, 0.3288212717, -0.0516764186, 0.1116403192, -0.05485975, -0.0126552582, -0.2687696517, 0.4798907936, -0.0626878217, -0.344812274, -0.1742749661, 0.1004123539, -0.2606139779, 0.2655540109, 0.0049832948, 0.0375166312, 0.1504193246, -0.3691315055, 0.216160357, -0.1311511695, 0.1778308898, -0.345772028, 0.1031698138, -0.0813743174, -0.6869223714, 0.017364569, 0.2560485303, 0.1754172295, -0.0944366753, 0.5446499586, -0.4150454104, 0.1447622329, -0.0459543578, 0.1615657806, 0.1449172646, 0.1606285274, -0.6060850024, 0.3728233874, -0.2745346427, 0.0576428846, 0.0307347607, -0.0146054924, -0.1264384389, -0.0241250247, -0.0301006548, 0.3515684307, 0.0832776129, 0.2309472263, -0.3654413223, -0.2369493693, 0.123363331, 0.3634352684, -0.1145452261, -0.4116989374, -0.049331978, -0.1916891038, 0.055319719, -0.1157419235, 0.1517812014, 0.4218284488, 0.1359185129, -0.1193929464, 0.102687344, 0.1130747795, -0.4654294848, 0.0214598104, 0.071772933, -0.0631103963, -0.3461887836, -0.0881968886, -0.0301498659, 0.2487496287, 0.0945117176, 0.2060093582, 0.0340393037, -0.1731153131, 0.0721886158, -0.0024393648, -0.0986387134, -0.4135909379, 0.1334336698, 0.0734616518, -0.0101107676, 0.3906270862, 0.0637329668, -0.2933793664, 0.0692315102, 0.1497816145, -0.0336899124, -0.1447107196, -0.0944388062, 0.184555918, -0.0829882994, 0.0026108883, -0.2447781116, 0.129320085, 0.2801519334, -0.3557437658, 0.0277640689, 0.103249982, 0.0765697062, -0.0654548556, 0.2241747528, 0.4178524613, -0.328894347, 0.2032139599, 0.0963194072, -0.2922593951, 0.0688128695, -0.0792856589, -0.0184271783, 0.1651138812, 0.2211026251, 0.3922339976, 0.2243862897, 0.138210699, -0.1602221578, -0.1194183007, 0.398599267, -0.1834306717, -0.0815002248, 0.1523450911, -0.1335784346, -0.0331329815, 0.0964191407, -0.1294159442, 0.1355017722, 0.2478065491, -0.1427010447, -0.0006220322, 0.0272531845, -0.1798281819, 0.2222774923, 0.1978258938, 0.1286402345, 0.2018651366, 0.5253883004, -0.1262489557, -0.2340528071, -0.223922655, 0.2441997081, 0.196128279, -0.2908228636, 0.1298103034, -0.0687722415, 0.0243005455, -0.0847826898, -0.6795876026, -0.3061878681, -0.092197001, 0.0006512664, 0.4704110324, -0.3309011459, 0.0706556514, 0.1599272043, 0.3159407675, 0.0793665126, -0.1885326952, -0.0443736129, -0.3438288867, -0.2535297275, -0.0260645002, 0.4630134404, 0.1464138329, 0.0704184026, 0.3701913953, 0.0221871138, -0.0610450581, -0.4288598299, 0.218477577, -0.0467990264, 0.0778332576, 0.0034070164, 0.1291549504, -0.2472119331, -0.2504463196, 0.3068670332, 0.0360251367, -0.2057614774, 0.3271161616, -0.1920835823, 0.0744267553, -0.1781021953, 0.1151922345, 0.212826252, -0.541801393, 0.3973288238, -0.1855194569, 0.0039906064, -0.2795964777, 0.2635203898, 0.096009925, 0.0679154322, -0.0404973775, 0.0594006591, -0.4201911688, 0.1961021721, -0.0403328687, -0.188174665, 0.0418394208, 0.1097165793, 0.1519097388, 0.1650314033, -0.605876267, -0.012862388, -0.0775756836, 0.5512678027, -0.3430550098, -0.2375438958, 0.1149813235, 0.1875804663, -0.0166975297, 0.1244235188, -0.1434652507, 0.0150683373, -0.0073906644, 0.2049880028, -0.1010251194, 0.527921617, 0.1304709613, 0.7018245459, -0.1654548049, -0.1430086195, 0.3313240409, 0.2419928908, 0.0773650408, 0.0481643602, -0.0284129605, -0.1179991215, -0.1809872985, -0.082166642, -0.0068381652, 0.0487270243, -0.1101651564, -0.0276326984, -0.1180324927, -0.2268261611, -0.1588105559, 0.3197793663, 0.0610070266, -0.1138889641, -0.2007413208, -0.2847954631, -0.0170084089, -0.0803113654, 0.0584910288, 0.0380897671, 0.1093086004, 0.1145235896, -0.0157518536, -0.3002442122, -0.0333696604, 0.0799984336, 0.3141290843, -0.1444273889, 0.0518036634, -0.1972085238, 0.1843084097, -0.4777925909, 0.7541437745, 0.4649644792, -0.0762623399, 0.1359016448, -0.0663606301, -0.3780809641, -0.0619560406, 0.0836299211, 0.198235631, 0.5710030198, 0.1032127365, -0.452648133, -0.1059832275, -0.1052923799, 0.3224130869, 0.0146235228, -0.4784034491, -0.4063739181, -0.4959048629, -0.4578321576, -0.0559185557, 0.0945281163, 0.1901107132, 0.1029647738, -0.098739177, 0.2796905041, -0.2547017336, -0.4795071185, 0.097819306, 0.1785519719, -0.5503333211, 0.1491030306, 0.051228784, 0.3193378448, 0.5359143615, 0.6146828532, 0.5909867883, -0.2183257043, -0.053836219, 0.3960567713, 0.1798867732, 0.1679471433, 0.1672121733, 0.2085579634, -0.1727024913, 0.2022820115, 0.2214762419, -0.0104978755, 0.1908642054, -0.1210767627, -0.0008763261, 0.2911648154, 0.5025098324, -0.2172299027, 0.1578595042, 0.4766682386, 0.2834440768, -0.0467167497, 0.22268641, -0.0596347228, 0.9461206198, -0.0210726671, 0.1325544864, 0.5243245363, -0.4252017736, 0.5806592703, -0.3188992143, 0.0976481736, -0.47740376, 0.3479598761, 0.0661804825, -0.2101876438, -0.0861987025, 0.0646333843, -0.0427131839, -0.1986046433, -0.0862126797, 0.0907084197, -0.1165642962, 0.0720051229, -0.0206810404, 0.0002179146, -0.3245541751, -0.0062563457, -0.345230937, -0.1282552183, -0.1717918664, -0.325017035, 0.0421546549, -0.1757343113, -0.1917933375, 0.2709344923, 0.1396906376, 0.3771395087, 0.2748386264, -0.1422748566, -0.0074553639, -0.4400264919, -0.2658146918, -0.1649733186, -0.0385794491, 0.2240043581, 0.0084365048, -0.1254260391, -0.0218853801, 0.1243400648, 0.1479468495, -0.1720812023, -0.1758477539, 0.1463665664, -0.1700339317, -0.1859630793, -0.140729785, 0.1831436753, -0.1518968344, -0.0311307032, -0.0627594441, -0.1478973329, 0.0817600042, -0.1284502745, 0.0683541, 0.0026662424, 0.0737184733, -0.3161939681, 0.0839199424, -0.3015912175, -0.084051162, 0.2698032856, -0.0315239951, 0.1463475376, 0.4538903236, 0.4027527273, -0.0726220831, -0.0956393853, -0.0567292199, 0.55154109, -0.6051451564, 0.2913154364, -0.1565792412, 0.1126882434, 0.0965900123, 0.3177770972, 0.2544374168, 0.0715058148, 0.0265480578, -0.3478245437, -0.2285253108, 0.4916566014, -0.0185182877, 0.0122019527, 0.102707006, 0.4117231369, -0.0780539066, 0.19734101, -0.2198727131, 0.302084446, 0.0287226886, 0.0564546995, -0.4602079391, -0.2132684737, -0.2015917897, 0.2550785542, 0.0270886347, 0.1679869294, -0.0712248012, -0.1259258389, -0.1276163161, 0.1012033597, 0.1020174026, -0.0968396962, -0.0645024031, -0.1031716466, 0.1211113185, 0.1297840774, 0.13172701, -0.2099904269, -0.05350063, -0.3004154265, 0.0015181461, -0.1877656132, -0.364243269, 0.0790169984, -0.0337791741, 0.289096266, 0.0804840475, 0.2754157782, -0.0237065386, -0.0644062608, -0.2298585474, 0.1052851677, 0.1529579461, -0.0467558764, 0.4014987051, -0.3238122463, -0.0387648121, -0.2653613091, 0.2756448984, 0.4593810141, -0.2252637148, -0.1238567829, 0.0152622275, 0.1677670181, 0.00166329, -0.2151911855, -0.2195244133, -0.0497763194, -0.1538696885, -0.0746735334, -0.0904242247, -0.2073936909, -0.1787253767, 0.1219562143, 0.2947430909, 0.2419091463, -0.3463653326, 0.3792240322, -0.2789326608, -0.1749601811, 0.2887688279, 0.1355135739, 0.5593860149, -0.0907417983, -0.0720366612, 0.180865556, -0.0511427335, 0.0833586007, -0.1531463563, -0.4281861484, -0.1786464155, 0.3637124598, 0.2060843408, -0.2417385131, 0.3044682443, 0.5248377919, 0.4010774493, -0.1126884669, -0.019808121, 0.225604713, -0.1309853047, 0.2223397046, -0.5097848177, -0.1980475187, -0.1236797273, 0.3870285153, -0.1253378391, 0.05571853, 0.4912979007, 0.1782962233, -0.0879886597, -0.6212043762, -0.1130402535, 0.0727153942, -0.0714722052, -0.2394380271, 0.2298416644, 0.6816924214, -0.4974333346, -0.0561953597, -0.2158794552, 0.4886182547, 0.2710983157, -0.2111815214, -0.4033637345, -0.2183921635, -0.0720911324, -0.0950078815, 0.1022535115, 0.5172536373, 0.349851042, 0.2333961427, 0.0662926212, -0.1418414116, 0.2303018868, 0.1463666856, 0.1384517848, 0.0005855188, -0.233346343, -0.2354169786, -0.3443225622, -0.1802336872, -0.22826536, -0.3921260834, -0.3310348988, 0.1211898774, -0.0312106609, -0.1318794936, -0.1365348399, 0.0630985647, -0.0726332217, 0.6978251338, 0.3485355377, 0.2058714479, -0.2465083748, -0.2613238096, -0.2471015751, 0.4796886146, -0.4091092944, 0.1983162463, 0.2130556703, 0.1833835095, 0.107047841, 0.3368975818, -0.0652040988, 0.5276258588, -0.1808631122, -0.2147905529, -0.385112673, 0.0368259735, 0.2935437858, -0.1667666137, -0.1844619513, -0.151456967, 0.338673681, -0.1768075526, 0.1125647649, -0.1182278842, 0.0232721418, 0.0539223999, 0.0855707824, 0.3299840093, 0.0818733126, 0.329172492, 0.028654255, -0.142923981, -0.1079834998, -0.2546293736, -0.1726094484, 0.3846238256, 0.0581522174, 0.4116556644, -0.078766495, 0.0795211047, -0.1733227819, 0.1052343696, -0.4348298907, -0.097911261, 0.1218620613, -0.2352114916, 0.0249756277, 0.1028490216, -0.0171118267, 0.1146760881, 0.0885697529, 0.1137048528, -0.4944940805, -0.1414474398, 0.4697197676, -0.3657931685, -0.2979661226, 0.497099936, 0.1034522653, 0.345236063, -0.1185089797, -0.5068211555, 0.0891442448, 0.1896466017, 0.0586637668, -0.3722426891, 0.2245829999, 0.0482143797, -0.060962975, 0.0519514233, 0.2235717475, 0.1836718023, -0.3651713431, -0.0317126438, -0.1290490478 ]
https://github.com/huggingface/datasets/issues/2176
Converting a Value to a ClassLabel
Hi @nelson-liu! Here is what I do to convert a string to class label: ```python from datasets import load_dataset, features dset = load_dataset(...) col_name = "the string column name" class_names = dset.unique(col_name) class_feature = features.ClassLabel(names=sorted(class_names)) dset = dset.map(lambda str_value: {col_name: class_feature.str2int(str_value)}, input_columns=col_name) dset = dset.cast(features.Features({ ... col_name: class_feature }) ```
Hi! In the docs for `cast`, it's noted that `For non-trivial conversion, e.g. string <-> ClassLabel you should use map() to update the Dataset.` Would it be possible to have an example that demonstrates such a string <-> ClassLabel conversion using `map`? Thanks!
50
Converting a Value to a ClassLabel Hi! In the docs for `cast`, it's noted that `For non-trivial conversion, e.g. string <-> ClassLabel you should use map() to update the Dataset.` Would it be possible to have an example that demonstrates such a string <-> ClassLabel conversion using `map`? Thanks! Hi @nelson-liu! Here is what I do to convert a string to class label: ```python from datasets import load_dataset, features dset = load_dataset(...) col_name = "the string column name" class_names = dset.unique(col_name) class_feature = features.ClassLabel(names=sorted(class_names)) dset = dset.map(lambda str_value: {col_name: class_feature.str2int(str_value)}, input_columns=col_name) dset = dset.cast(features.Features({ ... col_name: class_feature }) ```
[ -0.0255653709, -0.1936045885, 0.0500333942, 0.0593828633, 0.627363801, 0.2115249038, 0.2829760015, 0.0898775309, 0.0759952515, -0.0568673238, 0.1029047668, 0.681489408, -0.033919353, 0.1158332378, -0.0638298839, -0.2042806149, 0.1750880778, 0.1827313006, -0.1002876312, -0.0568878241, -0.319929719, -0.0221356601, -0.4753821492, 0.1178040355, -0.0183529742, -0.013162314, -0.052139163, -0.174500376, -0.0095147416, -0.2616073787, -0.0025992766, -0.2266911864, -0.0235290937, 0.4040014446, -0.0001230374, -0.3252838254, 0.1713486612, 0.1276385635, -0.1027283594, -0.0012640357, -0.5446986556, 0.1509112716, -0.0493943989, -0.3124807477, -0.0679483935, 0.4585194588, 0.0102066305, -0.3518193066, -0.0797234923, -0.0385743305, 0.0643964559, -0.2685543895, 0.0433487147, 0.1502619237, 0.1173126325, -0.0639188886, 0.1979943514, 0.1961913407, 0.5107662082, 0.3812743127, -0.0233189836, 0.2310215235, -0.2420649678, -0.4479731917, 0.2709721923, 0.1409622878, 0.0147542022, -0.3441447914, 0.2141890377, 0.0697048753, 0.5089132786, -0.2787735164, -0.240618825, -0.0289246663, 0.2034195811, -0.1926493347, -0.1329816878, 0.0453149155, 0.1556026638, 0.0525096208, -0.5872040987, -0.0947452188, 0.0096690059, 0.0064493855, -0.0419832394, 0.3577372432, -0.0681062341, 0.2042173892, -0.1836027205, -0.3301820457, -0.0656690598, -0.1423176229, 0.0534257405, 0.4511689842, 0.0285002552, -0.162256971, -0.1803558171, 0.3080085516, -0.3923469186, -0.4623286724, -0.0825617313, 0.2044610977, -0.1535299122, 0.2360500842, 0.1304841638, -0.0718883723, 0.6325414777, 0.2619614899, -0.0377872214, -0.3972044587, -0.3506869972, 0.047099296, -0.1964602768, -0.0970515609, 0.3145186901, 0.2756204009, -0.0859176517, -0.2086136639, 0.0603284389, -0.0629562736, -0.6144179702, 0.1692008674, 0.0577349551, 0.1027680635, 0.1596760303, 0.153008759, 0.3831624091, 0.0127397608, 0.3372875452, -0.5151317716, 0.0256722532, 0.1687624156, -0.0594784841, -0.2546183467, -0.2046686113, 0.1303684264, -0.1657949686, 0.1104656979, -0.1394717544, -0.2411889583, -0.1913701594, 0.3533148468, 0.1423946321, 0.0091941794, -0.389941752, 0.0919625759, 0.362169832, -0.344641, -0.3618512154, 0.4646988809, -0.3172391355, 0.1052197963, 0.2430623025, 0.0626078099, 0.3431930542, -0.2344117165, -0.015707016, 0.1214720458, 0.2205846906, -0.3232610226, 0.2305156291, -0.3888459802, -0.2717777491, -0.1573468745, 0.109692879, 0.1466992497, -0.5220819712, -0.1722783148, 0.2204763889, 0.145060271, -0.2246679366, -0.3032842278, -0.0844214261, 0.4340301752, 0.1755695641, 0.067972675, 0.7431446314, -0.4040967822, -0.1180320159, 0.2816628516, -0.044224821, -0.5518222451, -0.1832589656, 0.4364500046, 0.1886935979, -0.1759250611, 0.128549844, 0.1844900548, -0.2581251562, 0.1220354959, 0.0849038512, 0.0374753624, 0.1188870072, -0.1132325381, -0.2043041289, 0.4207710028, 0.1227367222, 0.4091436863, -0.0281122662, -0.2878469527, 0.3498994708, 0.0733439475, -0.0331094749, 0.0556447133, -0.1548643708, -0.2334842682, 0.158382386, 0.0418307483, 0.3316721022, -0.0388469882, 0.2497369349, -0.2951241732, -0.0320844986, -0.0257871933, 0.2377431393, 0.2743283808, 0.0450926572, -0.2332090884, 0.057657361, -0.3211952746, 0.0445089415, -0.2223041207, -0.1409009099, 0.2288298905, -0.0443543866, -0.2813128829, 0.1206275597, -0.1339091063, -0.5128310919, -0.1144195125, 0.2241096497, 0.0126017146, -0.1962093264, 0.3364667594, 0.0232321732, -0.1875056773, -0.1845720559, 0.2407034338, 0.1928689927, -0.2362459302, 0.2976702452, 0.1409195513, 0.1962011456, -0.2853609324, -0.3096445203, 0.247677058, -0.0560093001, 0.2904863358, -0.0988104269, 0.2705561817, -0.0285013244, 0.011213243, -0.0903073847, 0.1164750308, -0.4181664586, -0.2635627687, 0.1799531132, 0.0261160191, -0.2478139549, 0.2360078841, 0.1281985939, -0.5026357174, 0.2705972791, 0.1162734181, -0.2514474392, 0.3145844936, -0.0029369127, 0.1560786813, 0.1207879931, -0.0455901325, 0.1869261265, 0.1183610484, -0.0162549615, 0.1488967687, 0.3097298741, 0.0846780241, 0.1536530405, -0.3800916374, 0.0024055764, 0.1814286858, 0.2393165678, -0.0628104061, 0.1377516687, 0.0139247272, -0.3364922404, 0.0362229273, 0.01750765, 0.2251253426, -0.1867708266, -0.1059155911, 0.1685805619, -0.3640713096, -0.1875959337, -0.0140829645, 0.0644873083, 0.1267002225, -0.2037025094, -0.089520663, 0.1548200846, -0.4496602118, 0.0989248604, -0.2649115324, -0.1420231909, -0.0725617185, -0.0077442788, -0.0715043768, 0.06439206, -0.1425609291, 0.1850319207, -0.1048151404, -0.5802630186, -0.0710168481, -0.2839053571, -0.193455562, 0.3171653152, -0.214844346, -0.4116516709, 0.1804641783, 0.1438297778, -0.3101682663, -0.0612028763, 0.1244388148, 0.0559950583, -0.1547825038, -0.1652973145, -0.0611052662, -0.000623133, -0.0131551921, 0.1270999759, -0.1438925713, -0.11166659, -0.2295335978, 0.1373452693, 0.4809713066, 0.2863420546, 0.1686647385, 0.1029808521, -0.1149906218, 0.0788238645, 0.0629106462, 0.0188948959, 0.0958620533, -0.0502322204, -0.1277494431, -0.0405733436, 0.0095835477, -0.046897918, -0.0986373499, 0.2942814231, 0.0259362347, 0.1530188024, 0.2664952576, 0.3972109854, 0.0180965587, -0.0478278957, -0.3397720456, -0.0846752971, 0.0018223263, -0.0003133714, 0.2170869708, 0.4192284048, 0.001985237, 0.1187845021, -0.1266330034, -0.3776562214, -0.2086678445, -0.2102740705, -0.106352374, -0.0071303584, -0.0226573534, -0.1015788168, -0.1895438731, -0.3195206821, -0.0882626772, 0.002903726, -0.1653679907, 0.1434975863, 0.1068407595, -0.4341830611, -0.1911120862, 0.1427051574, -0.2788324356, -0.0014223699, -0.2721329927, -0.1227787286, -0.1991495043, -0.1161537468, 0.003639739, -0.3099352717, -0.0294061974, -0.1133376807, -0.2600277364, -0.1979276091, 0.1056281775, 0.3141308427, 0.2474211752, -0.0124007184, -0.100508675, -0.0259745419, 0.1225772947, 0.0789213181, 0.5989866257, -0.3749782145, 0.5384548306, 0.397062242, 0.1023100615, 0.0220940858, 0.0963057429, -0.5713668466, 0.2216719538, 0.5073206425, 0.2008758187, -0.0468510613, -0.0228674579, 0.2609045208, 0.1410342306, -0.0725186542, 0.232444346, 0.1165141985, 0.009354718, -0.1606267095, 0.1001956612, 0.3373535573, 0.1128806919, 0.2035354078, 0.1686590016, -0.2296976298, 0.2530899942, 0.2245436758, -0.0782189742, -0.0245437156, 0.2291561514, 0.0548908263, -0.2350265086, -0.0252669901, -0.5373612642, 0.4027571678, -0.1361222714, -0.301122725, 0.0273722522, 0.2237889767, 0.66169101, 0.0804569572, 0.2298315316, -0.2139798701, 0.004138954, 0.0477281213, -0.2515520453, -0.0259644706, 0.1131284982, 0.2270323336, -0.4178062379, -0.2665719688, 0.7585987449, -0.0291902497, -0.385786891, 0.1773230284, 0.3100296259, -0.5557984114, 0.3557278216, 0.5645317435, 1.0125461817, -0.3431295156, 0.1454717815, -0.2484117597, -0.1621372998, 0.5679706335, 0.2519029975, 0.0880277827, -0.5652979612, 0.0916986242, -0.1793634146, -0.0906065255, -0.0089551955, 0.5965070128, -0.6097903848, 0.210753873, -0.2679899633, 0.1973945498, 0.2196619809, -0.227904439, 0.1847222596, -0.2431537807, 0.0256847963, 0.1945689321, 0.0789452642, -0.2898961306, 0.0106719732, 0.1411578357, -0.2379119396, -0.0533440113, -0.206177026, 0.0650886819, -0.0482120961, -0.0813579634, 0.2329941839, 0.0485211164, 0.3747679591, 0.6419814825, 0.1609932929, 0.1660034209, -0.0272733532, 0.048769258, 0.027217878, 0.2853082418, 0.2338417917, 0.1786555648, 0.2727909982, 0.409088999, -0.0385714322, 0.3694919348, -0.2036489844, -0.0529254898, -0.1899779886, 0.0168206096, 0.0808298588, -0.5354506373, -0.2883879542, 0.1659194827, -0.0394934528, -0.0337100849, 0.0246263817, -0.1796375811, -0.1675100327, 0.1386390179, 0.0447594747, -0.3176601529, 0.3458252251, 0.3615109026, -0.1783431023, 0.1018876731, 0.1702835262, -0.0447673425, 0.092207253, -0.0773491487, 0.4468335509, 0.0818076655, -0.0976533294, 0.0416790582, -0.0995440111, -0.2006270438, 0.1619393229, 0.1582717001, 0.0787002221, 0.3553594947, -0.265642643, -0.1228699386, -0.2867258787, -0.0527213179, 0.4271605313, 0.0177225657, -0.2163186669, 0.0249542482, 0.0018834993, -0.0971541703, -0.1648704857, 0.1144625098, 0.0444033146, 0.330768764, 0.2599432468, 0.5231442451, -0.2434344143, -0.034891881, 0.0268339626, 0.0751656741, 0.3260420859, -0.0992770493, -0.0185999833, 0.1596018523, 0.2455035597, 0.1522901952, -0.1651833206, 0.1069821715, -0.0486882627, -0.3041031361, -0.1637862921, 0.0876577795, -0.0636785924, 0.277374357, 0.0776104033, 0.2589271963, -0.0397042744, -0.0828626007, 0.0589865372, 0.250130415, -0.1656114459, 0.2256468832, 0.3910972476, 0.0243664309, 0.0973726884, 0.2583625317, 0.107572563, -0.4333239198, 0.3887707889, -0.2362124324, 0.4785030484, 0.1618556678, 0.1450475603, -0.1302817017, -0.1566515267, 0.1163129434, 0.160023436, 0.038798064, 0.0055736378, -0.0567883663, 0.4063164592, -0.0777646601, -0.1374930441, 0.0881367028, -0.4882026315, 0.1837024093, -0.2928001881, -0.1953429282, 0.6786150932, -0.4554276466, -0.0774899125, 0.5122254491, -0.0090324283, 0.0824032873, 0.3932997286, 0.2641245127, -0.0176843591, 0.1688560396, 0.1542431265, 0.1913856268, -0.0663405359, 0.2061370015, 0.1363456994, 0.1509135067, 0.4715072811, 0.4203933775, -0.054729186, 0.2940469384, 0.0100155305, -0.1320381165, -0.6468139887, -0.386957407, 0.0624811277, 0.2653107643, -0.1460635364, -0.2055397034, -0.1703096628, 0.0567073226, 0.0826713592, 0.0244154781, -0.2061887085, -0.1274565458, 0.7491564751, 0.0376738757, 0.4000740945, -0.1511315405, -0.4842129052, -0.2126101553, 0.2543243766, -0.247019276, -0.0663003251, -0.1899693012, 0.1491685957, 0.3778535724, 0.1601909548, 0.2957724035, 0.3590631187, -0.3054677844, 0.266451627, -0.0995982885, -0.1622080207, 0.2465295196, 0.0287702829, -0.0433149599, -0.1728657186, -0.1332030296, 0.0702795088, 0.0104689859, 0.1741267443, 0.0883015618, 0.3612294197, 0.1379592717, 0.3692830801, 0.1229494959, -0.3744259775, 0.0683621317, 0.0596383996, -0.1512698233, 0.0250936598, 0.347661227, -0.3015749753, 0.1799570918, 0.2458894402, 0.0189053193, 0.5963385105, 0.1128664762, 0.240588665, -0.1761268526, -0.1012262404, 0.1970667094, -0.3364040256, -0.2154929042, 0.1898290366, -0.3442467749, -0.017929038, -0.1552855968, 0.1908628792, 0.0833527595, 0.125782758, -0.4912690818, -0.1025470346, 0.1621189415, 0.3629323542, -0.3980663717, 0.2992559373, 0.1816751361, -0.0522300079, -0.2583376467, 0.1431860924, -0.0370671824, 0.0055400729, -0.1736437678, 0.0744595081, 0.0152736828, -0.2734265924, -0.0163706318, -0.0003850535, 0.3927970231, -0.0876835883, 0.1093405187, 0.417119205, -0.1196037531, -0.2028665543, 0.3020249307, -0.53589499, 0.0188863352, -0.0343908593, 0.067979157, -0.0220975503, -0.4184685946, -0.0114095509, -0.1128926501, -0.6668361425, 0.1493908465, -0.4806387126, 0.0590932854, 0.1179831624, 0.1565636098, -0.0001420695, 0.4983161092, 0.0398745686, -0.2799831033, 0.2041746974, -0.6204323173, -0.4009132087, 0.1542606056, 0.0369950645, -0.1645597219, 0.0300338026, -0.3541936576, -0.0812163353, 0.387024045, -0.0242356993, -0.378928721, 0.1472867876, -0.1123755723, -0.2048937678, -0.2524279356, 0.1457898021, -0.1181195825, 0.1565181911, -0.1777051538, -0.2537238598 ]
https://github.com/huggingface/datasets/issues/2175
dataset.search_batch() function outputs all -1 indices sometime.
Actually, I found the answer [here](https://github.com/facebookresearch/faiss/wiki/FAQ#what-does-it-mean-when-a-search-returns--1-ids). So we have to do some modifications to the code for instances where the index doesn't retrieve any IDs.
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq
25
dataset.search_batch() function outputs all -1 indices sometime. I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq Actually, I found the answer [here](https://github.com/facebookresearch/faiss/wiki/FAQ#what-does-it-mean-when-a-search-returns--1-ids). So we have to do some modifications to the code for instances where the index doesn't retrieve any IDs.
[ 0.011297293, -0.3721058071, -0.1019986123, 0.0192688387, 0.2021873742, -0.0966880247, 0.2803096175, 0.296843648, 0.1391416788, 0.4209128916, -0.2324288934, -0.2434539199, 0.1058326364, -0.0338979512, -0.1621745229, 0.1081453487, 0.2741160393, 0.3812990785, -0.0525575317, -0.5196727514, -0.3187379241, 0.1191089153, -0.0284686759, 0.3729508221, -0.2878592312, 0.2902801931, -0.0275248252, -0.089398779, -0.2744061351, -0.4506153464, 0.5258823633, -0.3038475215, 0.411450386, 0.2260933369, -0.0001312564, 0.1222992986, 0.3880340755, -0.0330381952, -0.0978067666, -0.1585950553, -0.0568627864, 0.153564766, 0.0832173154, -0.0496734604, 0.0529698133, -0.293507576, 0.2583491504, -0.0760007575, -0.0392878801, 0.2710103989, 0.0165875405, -0.1001902595, -0.2166368961, -0.0440467484, 0.6340438724, -0.3164774776, 0.0808621123, -0.1430781186, 0.4359709024, -0.0289206952, 0.1490155458, 0.1251528859, 0.0537865683, -0.0263430737, -0.2640728056, 0.1519916952, 0.6509364247, -0.3470194936, 0.1948391199, 0.2429178804, 0.213244468, -0.0165175982, -0.3425404429, 0.1010915712, 0.1615769863, 0.0643815845, -0.0493507721, 0.1699868143, -0.1023729667, 0.2492173761, -0.0735964626, 0.3226188719, -0.2642555535, 0.1283895373, 0.0921009928, 0.3048037589, 0.0520673841, 0.1365373433, 0.1266660392, 0.1793738008, 0.2614559829, 0.1650855839, 0.1424203068, 0.2667565644, -0.5452936292, -0.0396537818, 0.3013201356, -0.263591826, 0.1599816084, -0.3341231048, -0.2958825529, 0.0122053772, -0.1906158775, -0.0811454132, 0.1348098814, 0.0300396457, -0.0409568027, 0.0879250541, 0.2758271098, -0.4434858859, 0.022571668, 0.0564635843, 0.1405127794, 0.0172798596, -0.0684075579, 0.122676447, 0.0707819909, -0.292473793, -0.3751610518, -0.0922090113, -0.2851830721, 0.2287971675, -0.211773634, 0.1873225421, 0.3979750276, 0.0808832943, -0.0434575304, 0.0965686738, -0.1920486689, -0.0721824095, -0.1490165293, -0.1684362143, -0.1290246844, 0.0257085077, 0.1512944847, -0.4258547723, -0.1803211421, 0.0613473691, -0.1417215168, 0.1943152696, 0.12238352, -0.1732917726, 0.453353405, 0.5615361333, -0.1166197062, 0.3323792517, 0.13577196, 0.0466704518, -0.024434045, 0.0082995864, 0.0602015816, -0.5894426703, 0.1787385792, 0.0659678206, 0.0158017948, 0.3439201415, 0.3202599287, 0.3334341347, -0.2957115173, 0.3365437686, -0.0159029216, -0.4066883028, 0.0313610658, -0.0263190474, 0.2536778748, 0.1740863621, -0.0535257608, 0.1447271407, 0.0188021287, -0.2671528459, 0.1042294651, 0.3047016859, 0.0776821375, 0.2836076617, -0.4879199266, 0.1991421878, 0.1316747069, -0.2821635604, -0.3218089938, 0.0569447763, -0.2449695021, -0.6043917537, 0.0168585069, 0.2755216658, 0.2623559833, 0.2028292567, 0.2860123515, 0.1991927624, -0.0223766845, -0.1068086326, -0.4190152884, -0.0749165565, 0.2629500926, -0.0806500539, 0.2959194481, 0.2607783973, 0.0897120684, -0.77070719, 0.3443848789, 0.0783099756, 0.0974857882, -0.0759550333, 0.3600548804, 0.0039184131, 0.7175315022, -0.0647902116, -0.0875049978, 0.1142709404, -0.3557227254, 0.0644310042, 0.0200780556, -0.2087034136, -0.0145458989, -0.032961715, 0.0608666539, 0.2663135827, -0.0613429807, -0.1442534924, 0.2852407396, -0.1506956518, -0.2166905999, 0.0279041026, -0.1892899424, -0.1727769673, -0.461953789, 0.2869716883, -0.0044565941, -0.2153086066, 0.0080347359, -0.0235070512, 0.3108554482, -0.0657238215, 0.0083284862, 0.166346699, -0.2015218437, -0.2778989375, 0.7204374075, 0.1057650149, -0.2275295556, -0.4191127419, 0.1112757176, 0.4744248986, 0.1263321936, -0.1979952157, 0.15499717, 0.2241894007, -0.2468898296, 0.4735147655, -0.1225573123, -0.0014316738, 0.0749267042, 0.1421813965, -0.1148778051, -0.2041205168, 0.1019528061, -0.1453209072, -0.1148639992, 0.0365650877, -0.251742065, 0.180736661, -0.156697616, -0.4020547569, 0.0373721495, 0.2453040481, 0.0468483306, -0.0122242421, 0.1238987744, -0.2407317609, 0.3852645159, 0.146595329, -0.1858466566, -0.2387989312, -0.1886480451, -0.1494652629, 0.0910929367, 0.1543560475, -0.247214824, 0.1434973776, 0.3117803037, -0.0742416382, -0.3294374943, -0.2253189832, -0.3847641945, 0.2618562579, -0.2814088166, -0.0455773994, 0.0504939109, -0.0271462612, -0.3396141827, -0.0936513692, -0.0362691283, -0.0764933676, 0.2038690001, -0.3289227784, -0.0500360131, 0.0073312819, -0.1228786334, 0.2336869538, 0.0564923063, 0.3149161935, -0.6124581099, 0.0611078367, -0.3827646375, -0.2278801799, -0.5138925314, 0.3062329888, -0.06040214, -0.0381238721, -0.527985394, -0.510869205, 0.1429803669, 0.0286731943, -0.1098234206, -0.0350113213, 0.3234107792, 0.0188211966, -0.214234367, 0.302082181, -0.0022867993, -0.083117336, -0.1791341454, 0.1730703562, -0.2697460651, 0.3766940832, -0.2327559739, -0.2679131031, -0.0313490033, -0.0388199948, 0.1331946701, -0.2206419855, 0.1247271448, 0.0276664235, 0.1237579063, -0.1222938374, -0.0160314403, -0.0337289013, -0.2221765816, -0.2021136731, 0.2577732801, 0.3072981536, -0.3648934364, -0.2410872579, -0.1581916362, -0.5619199276, 0.4506981671, -0.1359997392, -0.1375063211, 0.07019265, 0.0001695827, 0.0629063845, 0.441385746, 0.1164397001, -0.069123596, -0.052051723, -0.245910272, -0.0521870926, 0.3002717495, -0.0251202099, 0.2634777129, 0.0242302306, -0.0936782584, -0.271623373, 0.7259997725, 0.1539807767, -0.0714418367, -0.0122892745, 0.1312196255, 0.1544188857, 0.1646028608, 0.0283250064, 0.2517504096, 0.2088073045, -0.3656689823, -0.0824301839, -0.0206992589, 0.1367794871, 0.2797056437, 0.1323605031, -0.1434503496, -0.1201966554, -0.0569844097, 0.2925824523, 0.2189825028, 0.0246619284, 0.150939703, -0.0940015912, 0.1088423729, 0.1891393811, 0.0688244626, 0.0959360525, 0.2566945255, 0.3786240816, -0.4972278476, -0.4568192959, 0.2242780328, -0.0808367729, 0.3757854998, 0.239374578, 0.1027820259, 0.4788728952, 0.2590559125, 1.2568013668, -0.1759703755, 0.2236910015, 0.2233045697, 0.1146904379, -0.2094757259, -0.4277402759, -0.3497858346, 0.1456703246, 0.2816673517, 0.3042633533, -0.1345706135, -0.2829898894, 0.3241884112, -0.0831249654, -0.0247054771, -0.4840521812, -0.4144076705, -0.3878673911, 0.3596352041, 0.1768426448, 0.070408307, -0.0257624611, -0.1287028044, -0.3183708489, -0.2886582911, 0.0842140168, -0.020928476, 0.0136783458, 0.1088997871, -0.0100783557, 0.0540215597, 0.5879080892, -0.0352985337, 0.0288296659, 0.0063311881, -0.2897152007, 0.1097689793, 0.1316751242, -0.2149087191, 0.1300610751, 0.4025415778, -0.0378957726, -0.0379730836, -0.0699873865, 0.1739649177, 0.0251755565, -0.1724172533, 0.3342431784, 0.0776078328, -0.2163951248, -0.25675717, 0.6706352234, -0.1897259355, -0.2443474233, -0.0455890894, 0.3609122038, -0.1271775216, 0.8627619147, 0.2036357969, 1.0294401646, -0.1593865156, 0.0449495316, -0.0330661312, -0.0576934926, 0.3887156546, -0.1368836164, 0.2788421214, -0.3323224485, -0.0388178229, -0.1417316198, -0.101749301, -0.3878503144, 0.4730279446, 0.0222502202, 0.3106593192, -0.0436052904, -0.2067585886, 0.1425083578, 0.0420784652, 0.4215949178, -0.0997208059, -0.2761309445, -0.0268138442, 0.2104556561, 0.3512396216, -0.1016686931, -0.0206809491, 0.0860845298, -0.0166555792, -0.2263440341, -0.2110869586, 0.065195702, 0.2944017351, 0.6096580029, -0.2668307722, -0.1942783296, -0.1585073471, 0.5273300409, -0.3109762371, -0.0649509579, -0.0632395446, 0.4260790348, 0.0647376925, 0.065994069, -0.2863042355, 0.353051424, 0.166960001, -0.4066243172, -0.0286880434, 0.0466233045, 0.1825839281, -0.2095664889, 0.0837354362, -0.3531546593, -0.1128299534, 0.1354658604, 0.0735300854, 0.1463965923, -0.1096655875, -0.0329745859, 0.3443635404, -0.2488818169, 0.5228223801, 0.0379224718, -0.5396447182, 0.0018795189, 0.0687787831, 0.3131368458, 0.1026278362, 0.028428521, -0.091001153, -0.1067883223, 0.0047642291, -0.3982793391, 0.2628670335, -0.0657190755, 0.3646072745, 0.0066467226, -0.0524574816, 0.0149266459, -0.065122962, -0.0535124205, -0.0393874981, -0.6319127083, -0.1118276045, -0.0674783662, 0.0020820964, 0.0426678173, 0.2827432156, 0.0436291099, -0.2224811912, 0.0494104251, -0.4360682368, -0.1517595798, -0.3070213497, -0.3297477365, 0.3338543475, -0.4554997385, 0.023390092, -0.1727029383, -0.0945393741, -0.0404481515, -0.0134355016, -0.1461304575, -0.0257276837, 0.0994814336, 0.2227834463, 0.1763507426, 0.2590285242, -0.252692312, -0.0301908404, -0.1449385583, 0.0389373414, 0.0625406802, 0.611351788, 0.0664357245, 0.2071972936, 0.1814810038, -0.1188334897, 0.067420803, 0.1603711247, 0.2201811224, 0.2092127949, 0.0098270774, 0.3986608684, -0.2479161173, -0.0045660436, -0.0807423592, 0.107974872, -0.0862932652, 0.124535352, 0.063847959, -0.144854635, -0.1157492101, 0.0802883804, 0.0730735809, 0.287204653, -0.3682043552, -0.2889964283, 0.0876009762, 0.0878474861, -0.0736149475, 0.031094525, 0.1891525984, -0.0096660033, -0.0857619718, 0.1576612741, -0.0857107267, -0.277079761, -0.08298482, 0.1212406754, 0.3878119886, 0.0845261365, -0.4620716572, -0.4683163762, 0.2818700075, 0.1255485713, 0.2182915807, -0.0888200775, 0.1867129356, 0.5988233089, 0.1066993549, 0.1163441837, 0.0078104753, 0.1931098551, -0.3157951832, -0.1006944403, 0.3579460979, 0.4545298815, -0.351331979, 0.0446387455, 0.2346816808, 0.1333731711, -0.1131420955, 0.0405172929, 0.1585412621, -0.2260124683, 0.0537520498, 0.0783933699, -0.1673157066, 0.2790887952, 0.0128533691, 0.1342286021, 0.0158728678, 0.0545015968, 0.0646352917, 0.2016747445, -0.0954066217, -0.0659716278, -0.1233312488, 0.4243821502, 0.2690966427, 0.0256965905, -0.1349171102, -0.183971867, 0.0624127127, 0.3232338428, 0.362646997, 0.2544462681, 0.4050598145, -0.2183092833, 0.1943678856, -0.0896435753, -0.1715773642, -0.1543342173, -0.157570377, -0.2221921235, -0.0709797442, -0.0498290174, 0.0249194913, 0.0257744491, -0.2098157704, -0.0548169166, 0.3915156722, -0.1408573985, -0.0055024885, 0.0987102091, -0.0644802302, -0.2178874016, 0.1257738322, -0.1987028122, 0.2333717197, 0.1554550529, -0.0973494276, 0.1492013931, 0.0634052679, -0.0192187447, -0.2836735845, 0.1690779179, 0.3973786533, 0.3210482895, -0.1404416561, 0.182525143, -0.1147374213, 0.0534048416, -0.0813333094, 0.2980790138, 0.4000995457, 0.3792738318, -0.3778193593, -0.2069662511, 0.4430239201, 0.5543785691, -0.0169581398, 0.5559705496, 0.132022962, -0.0057811644, -0.4808116555, -0.01631446, 0.0246726647, -0.215902552, 0.350721091, 0.0773192346, -0.0402617343, 0.1147013009, 0.0085248947, 0.1612534076, -0.2590676248, 0.3424574733, 0.218244195, -0.1450221837, 0.0004632026, 0.1746750027, -0.3607174754, -0.1042841822, -0.4627586603, -0.1236032248, -0.2472831309, -0.1884259582, -0.2096786201, -0.2898923159, 0.0043422878, 0.2782428265, 0.205418542, 0.0261444226, -0.1434519589, 0.3118307292, -0.5026419759, 0.0435678996, -0.1125665382, -0.0771073699, 0.2508092523, -0.0200799853, -0.3463617861, -0.306062609, 0.4788446724, -0.3345263898, -0.2170310318, -0.4942220747, 0.4417164922, 0.3645997047, 0.1880708337, -0.6248776913, -0.2481431216, 0.1785907298, 0.0756683797, -0.3999007642, -0.5031002164, 0.1167967618, 0.123627238, -0.1333016157, -0.3742970526, 0.4390970469, 0.078125827, 0.2793934047, -0.311200738 ]
https://github.com/huggingface/datasets/issues/2175
dataset.search_batch() function outputs all -1 indices sometime.
@lhoestq @patrickvonplaten I also found another short bug in the retrieval part. Especially, when retrieving documents. If Faiss returns the -1 as the index, the retriever will always use the last element in the dataset. please check [def get_doc_dicts function](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L222) Does the use of the HNSW guarantee to retrieve valid indexes always?
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq
52
dataset.search_batch() function outputs all -1 indices sometime. I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq @lhoestq @patrickvonplaten I also found another short bug in the retrieval part. Especially, when retrieving documents. If Faiss returns the -1 as the index, the retriever will always use the last element in the dataset. please check [def get_doc_dicts function](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L222) Does the use of the HNSW guarantee to retrieve valid indexes always?
[ 0.0158524439, -0.2806916833, -0.063292861, 0.0849649608, 0.0853547826, -0.1038462594, 0.236908257, 0.3023104072, 0.1052338481, 0.3437606692, -0.2517735362, -0.2153437734, 0.1649908274, -0.2617837787, -0.1169081181, 0.0578846484, 0.2875569165, 0.3696742356, -0.0135728195, -0.5771780014, -0.4364786744, 0.0454007089, -0.1087437421, 0.3599142134, -0.2922553122, 0.171409741, -0.0935414135, -0.0432226844, -0.2799686491, -0.4463258982, 0.5693718195, -0.2051212937, 0.4998080134, 0.1934942007, -0.0001310244, 0.060732469, 0.3989875913, -0.0673881546, -0.1178079844, -0.1064760759, -0.1419560164, 0.0830873176, 0.0018902794, -0.0588472188, 0.0330885649, -0.291115731, 0.2227628231, -0.1077732667, -0.0043291636, 0.3318609297, 0.0216134824, 0.0569211841, -0.1738264263, 0.0023265965, 0.7081762552, -0.3659302294, 0.0985158682, -0.0367787443, 0.4812433124, -0.0528160855, 0.1526664793, 0.1807489097, 0.0019856691, 0.0009159017, -0.3093777299, 0.2561921775, 0.6104994416, -0.2700278163, 0.1526670456, 0.3558497131, 0.3618956804, 0.0523847565, -0.4064418972, 0.0502593964, 0.1637896299, 0.0432623923, -0.0340015218, 0.2212758511, -0.0714896619, 0.2482030094, 0.0166669413, 0.3187109828, -0.3073364794, 0.2191095054, 0.0984985679, 0.2952780724, 0.0456279851, 0.0873527825, 0.1593001187, 0.2445999086, 0.3256033063, 0.0117046461, 0.0640358329, 0.2494963706, -0.4395671189, 0.0244552791, 0.2559683919, -0.1571496278, 0.1326080561, -0.3659855127, -0.2643686533, -0.0438169017, -0.1686108857, -0.0382479019, 0.2108125091, 0.0981183052, -0.1500431299, 0.1708922684, 0.3238217831, -0.3653720617, 0.0207299218, 0.0379845835, 0.148229599, 0.0402757786, -0.0610237643, 0.0817494243, 0.0378916785, -0.3919436932, -0.3166398108, -0.0747114271, -0.2071290463, 0.1259293258, -0.3126272857, 0.1812499166, 0.3250614703, 0.1952415258, -0.0645721555, 0.1933434606, -0.2017331719, 0.010371644, -0.1967395544, -0.196247533, -0.1573486924, 0.0827165991, 0.0814238787, -0.3686147332, -0.1698288023, 0.0812144727, -0.0815582871, 0.1601490974, 0.0442281887, -0.2015517801, 0.4831166863, 0.4733825028, -0.1933666915, 0.2601572275, 0.0769247338, 0.0277599469, -0.0702728331, 0.0068187639, 0.0162306856, -0.5032622814, 0.1661581397, 0.06403552, 0.1187809929, 0.3264332116, 0.3128569126, 0.251963079, -0.1443450153, 0.391618073, 0.0385280028, -0.5134456754, 0.038776949, -0.0768574104, 0.1956457198, 0.1660142541, 0.0098018795, 0.1663012356, 0.0855413973, -0.174909696, 0.076691702, 0.339322269, 0.0318908878, 0.3072897196, -0.5202444792, 0.2322781235, 0.1017867923, -0.4268250465, -0.4370737672, 0.0217669904, -0.0934104994, -0.4778689444, 0.0489128493, 0.2361737192, 0.421518594, 0.0948144421, 0.1668855399, 0.2142252028, -0.0300279353, -0.1694523394, -0.5196025968, -0.0608970486, 0.1508561671, -0.1074658707, 0.4080958068, 0.3055163622, 0.0542491488, -0.6813328862, 0.4600912929, 0.0416386984, 0.0762424916, -0.0491398349, 0.3157003224, 0.0517028198, 0.6557028294, -0.0099548697, -0.0952551961, 0.1157823503, -0.342685461, 0.099101536, 0.0702583194, -0.1577310115, 0.0223703794, -0.0416797996, -0.0441980399, 0.201641053, -0.0683344454, -0.0571704172, 0.2374500632, -0.0488141105, -0.140645504, 0.0389314666, -0.2022215724, -0.138872385, -0.5094872713, 0.3016094565, 0.0281651001, -0.1289513558, 0.0058399439, 0.0292825382, 0.2807446718, -0.05012789, -0.04983503, 0.0834941119, -0.1135854125, -0.2807568908, 0.5495072007, 0.1666020453, -0.1528516114, -0.5171638131, 0.2230282128, 0.5155273676, 0.1301403046, -0.2427324802, 0.1156459451, 0.2706038058, -0.2726710737, 0.38280496, -0.108343102, -0.0549604148, 0.066717498, 0.0663514212, -0.1498881429, -0.2030669302, 0.0003469335, -0.2384689748, -0.061184898, -0.0635791197, -0.2246356905, 0.0834553316, -0.0093100779, -0.392083019, 0.002927836, 0.2973246574, 0.0369532183, -0.0580254421, 0.0672344565, -0.2013526112, 0.3888044953, 0.1604970247, -0.1281761825, -0.2055945247, -0.2200168669, -0.1835312098, 0.0934476405, 0.1413721889, -0.2600218654, 0.2491228878, 0.1945118755, -0.0841558278, -0.2929005623, -0.1100273207, -0.4757438302, 0.1957868487, -0.256444633, -0.0163514353, 0.0148865581, -0.0253469199, -0.4278123081, -0.1020294204, 0.0343128145, -0.114487648, 0.1415251046, -0.2802917957, -0.0328772999, 0.0512910113, -0.2847649455, 0.1777866334, -0.0399979763, 0.3042401075, -0.5487372875, 0.0667046607, -0.4623081982, -0.2274499089, -0.4807326198, 0.2997172475, 0.0594247207, -0.0255935118, -0.5072210431, -0.4166647792, 0.1337876916, 0.1072621793, -0.0663942546, 0.0001826119, 0.2799880505, 0.0276468191, -0.1641699374, 0.3296677768, 0.034207508, -0.1100216508, -0.0985527784, 0.1459680051, -0.2561159432, 0.269208461, -0.1441014856, -0.3244905472, -0.0767010748, -0.0238159671, 0.0231355578, -0.228549093, 0.0347297713, 0.074874118, 0.0923197269, -0.1048883721, -0.0713524967, 0.0395769849, -0.2044110447, -0.1953289509, 0.3142091632, 0.3352858126, -0.400254935, -0.3519680202, -0.2729281783, -0.5548422337, 0.481803298, -0.1490301788, -0.0924093351, 0.0499772355, 0.0470276922, 0.1055966914, 0.493011862, 0.1570607871, -0.1823892891, -0.037744157, -0.3242684007, 0.0488730446, 0.3383648098, 0.0189885236, 0.3005692065, 0.1381307691, -0.1576917619, -0.3023750782, 0.7045289874, 0.2232642323, -0.0359441265, 0.0347889364, 0.2212920934, 0.2890366614, 0.1963259131, -0.005157657, 0.1791976988, 0.1580582261, -0.3494433761, 0.0392720848, -0.022123713, 0.1128418297, 0.2741546035, 0.0199250579, -0.1492033452, -0.1857705861, -0.0051589478, 0.2051897347, 0.2168473303, 0.0696575493, 0.2705715597, 0.0154572055, 0.0147527196, 0.1499033868, 0.0868915319, 0.1883240193, 0.2707948983, 0.4090042114, -0.3244125247, -0.4757459164, 0.1463628709, -0.0082475431, 0.4967693686, 0.3124477267, 0.1192590743, 0.4112007618, 0.2638064027, 1.1679069996, -0.2185725272, 0.2166094482, 0.2469867766, 0.0877018124, -0.1998642534, -0.4820183516, -0.4562118053, -0.08378461, 0.2651090622, 0.2621901929, -0.1808607429, -0.1812044382, 0.2296391279, -0.0946378708, -0.1061575338, -0.4746519923, -0.3367079198, -0.3955333233, 0.3641496003, 0.1785664707, 0.0283320621, -0.0206215642, -0.2030143738, -0.2718679309, -0.2557526827, 0.0980792642, -0.0298792683, -0.0057382546, 0.1531222165, -0.1616354883, 0.0615710318, 0.6109384298, 0.0642322749, 0.251960367, 0.0642029122, -0.5061046481, 0.1954033673, -0.0409363136, -0.3315084279, 0.1486863196, 0.467543304, -0.0435561463, -0.0231480375, -0.0333592892, 0.1408854127, -0.0037412792, -0.2420520186, 0.368968308, 0.0055334158, -0.291793406, -0.2453861535, 0.6936016679, -0.185000062, -0.3081681132, -0.0043122019, 0.381216228, -0.2878373265, 0.8606345654, 0.248453185, 1.0878504515, -0.0684339553, 0.136270538, -0.007668661, -0.1831636429, 0.4024516046, -0.2085949779, 0.2347268015, -0.416320622, -0.099844411, -0.1737678647, -0.135058105, -0.3575217724, 0.5084704757, -0.0502660535, 0.3532283604, -0.0885592997, -0.0280106366, 0.1135658547, 0.0916359648, 0.4454283714, -0.1015605479, -0.2362878621, -0.0383849703, 0.2732486129, 0.3471783102, -0.1548328251, -0.0595598593, 0.1147310734, -0.0937661529, -0.3056172729, -0.1230989993, 0.1350202262, 0.2377490699, 0.5968583822, -0.2270080596, -0.1667979658, -0.1047327816, 0.5608094931, -0.3332359791, -0.1165126637, -0.0511683635, 0.4098784626, 0.0548224896, 0.0997843444, -0.2400346845, 0.4137955904, 0.1398812234, -0.3905864358, -0.1648502201, 0.0024675913, 0.1172020286, -0.2933438718, 0.0426697508, -0.3670490682, -0.1194265634, 0.1269761622, 0.0542827249, 0.1731959581, -0.1075910553, -0.0152582247, 0.2759132087, -0.2465013266, 0.6874191165, 0.0532565899, -0.5199987888, -0.0296496004, 0.0724036098, 0.3525432944, 0.13330549, 0.0242213085, -0.0723084062, -0.2190025449, -0.0332486592, -0.4119995236, 0.2119609863, -0.0836991295, 0.3959654272, 0.0127276294, 0.01448147, -0.0114264488, -0.1274555027, 0.0600480065, -0.162442565, -0.5828801394, -0.1820282936, 0.0213950723, -0.0175687596, 0.0856904089, 0.3645199835, -0.0187089965, -0.2293545157, 0.0390162617, -0.3160557747, -0.1595783085, -0.3216890991, -0.2893073261, 0.2833938599, -0.3228814006, 0.1756572872, -0.1226774454, -0.0554294027, -0.0547152273, 0.0461011566, -0.1090928242, -0.0041226521, 0.0084140897, 0.221054703, 0.1829683781, 0.1836368442, -0.1699386537, -0.0438018888, -0.1710021645, -0.0237588994, -0.0287473649, 0.5818439722, 0.0738728791, 0.3687915802, 0.2246166915, -0.0456675701, 0.1085255221, 0.2580298185, 0.1259963661, 0.3041028082, 0.0026269555, 0.4426374435, -0.1826833487, -0.0350030065, -0.1058422774, 0.1277911365, -0.0277401246, 0.1321173459, 0.1057637036, -0.1753787398, -0.0949508622, -0.0052634962, 0.108754009, 0.3664781451, -0.3425270021, -0.348536998, 0.1282230318, 0.0778544694, -0.0981618389, -0.0787724555, 0.1822718829, -0.035382539, -0.1590310335, 0.1678362191, 0.0353367031, -0.3870276213, -0.1926215738, 0.0282443911, 0.3948740959, 0.0312690474, -0.4899245799, -0.2237725705, 0.2902978957, 0.1563054323, 0.1586345583, -0.1249933913, 0.1711172462, 0.5818681717, 0.1624410748, 0.1391309947, -0.0360261351, 0.2497748435, -0.2962177098, -0.1385936737, 0.3591981828, 0.4962320328, -0.3177928627, 0.0701235384, 0.1964791715, 0.0736660138, 0.0865558386, 0.0735377669, 0.020659171, -0.2292123139, 0.0370221809, 0.0223149024, -0.1508486122, 0.168217659, 0.1052331477, 0.1328174919, 0.0021785586, 0.1194752604, -0.0277927555, 0.173212558, -0.0450629406, -0.070988372, -0.0273772404, 0.2930561006, 0.2030255795, -0.0183956698, -0.1430911273, -0.1980171204, 0.1577097625, 0.3388198614, 0.272030592, 0.2620835006, 0.4358716011, -0.1678257883, 0.052726645, -0.0910183117, -0.1290215254, -0.1540766805, 0.0157372952, -0.229680106, -0.1882424653, 0.0609381571, 0.0027874447, 0.0417085327, -0.1089116633, -0.1202692538, 0.2378079593, -0.1023312956, 0.0736856014, 0.1758262217, -0.1136450469, -0.1925264448, 0.188875407, -0.0533291064, 0.3200597465, 0.3009599149, -0.0698475093, 0.2412292659, 0.1271770597, -0.0245256647, -0.2553520799, 0.2151847631, 0.4262212217, 0.3479797244, -0.1311558783, 0.1695003659, -0.1988389194, 0.0531282499, -0.164483726, 0.2272000313, 0.3382124901, 0.3163149655, -0.3079970777, -0.2095260322, 0.4614079595, 0.5569138527, 0.0321506262, 0.5386591554, 0.1523461938, -0.1554845273, -0.4630396366, 0.0073624905, -0.003043592, -0.3373906314, 0.2270671874, 0.0924110711, -0.0356258675, -0.0101508694, 0.1722430736, 0.1312751174, -0.2741591632, 0.3313334882, 0.3338258266, -0.0732920542, -0.048117727, 0.1569270939, -0.3059234619, -0.0399721451, -0.5270506144, -0.189317137, -0.2857978642, -0.1078231186, -0.2614032626, -0.3345789015, -0.1015725583, 0.246364221, 0.2668548226, 0.0416913815, -0.2155609876, 0.280028075, -0.4384512007, 0.0002976097, -0.0189950131, -0.0894302577, 0.179212749, 0.0236874446, -0.2966304719, -0.2883657813, 0.5323398113, -0.3443338573, -0.1925091147, -0.5042877197, 0.3939202726, 0.2632346749, 0.1275881082, -0.6056139469, -0.2095989287, 0.269682765, 0.0522323698, -0.4514895678, -0.4445721507, 0.2302814126, 0.1378472, -0.133626014, -0.3892812729, 0.4234298468, -0.0135804489, 0.1584173739, -0.2815931737 ]
https://github.com/huggingface/datasets/issues/2175
dataset.search_batch() function outputs all -1 indices sometime.
Hi ! No it happens sometimes to return -1, especially if your dataset is small. If your dataset is big enough it shouldn't happen in my experience. Ideally we should ignore all the -1 that are returned. It should be possible to change that in RAG's code
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq
47
dataset.search_batch() function outputs all -1 indices sometime. I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq Hi ! No it happens sometimes to return -1, especially if your dataset is small. If your dataset is big enough it shouldn't happen in my experience. Ideally we should ignore all the -1 that are returned. It should be possible to change that in RAG's code
[ -0.019722864, -0.4322831035, -0.0812415406, 0.0478307121, 0.2197972983, -0.0908180177, 0.3115733862, 0.2803557217, 0.1310122609, 0.4431151152, -0.2505158484, -0.1531093419, 0.0910184085, -0.0791351348, -0.1357797831, 0.0532654412, 0.2860961556, 0.3947457671, -0.1084836945, -0.5481681228, -0.3425458074, 0.0654459447, -0.0887327641, 0.3915579021, -0.2586425841, 0.2340942621, 0.0112101287, -0.1145114452, -0.2590102553, -0.4190972447, 0.5721328259, -0.3347860277, 0.5025040507, 0.1503541321, -0.00013128, 0.0766312629, 0.3688725531, -0.0625465959, -0.1117209643, -0.1611778289, -0.0739836991, 0.1744756997, 0.0725017861, -0.0385840908, 0.0562549904, -0.2273415923, 0.2482057512, -0.1148414463, -0.0062830895, 0.2285687029, 0.0220437814, 0.0227516741, -0.2356110811, 0.0053637028, 0.6570578218, -0.3688430488, 0.072284013, -0.0749814361, 0.4281035364, 0.0015933551, 0.0991465598, 0.1038107425, 0.0210787132, -0.0032237191, -0.2851937413, 0.2080059499, 0.604699254, -0.3206323385, 0.1641495526, 0.268999368, 0.3400608897, -0.050861232, -0.3605318666, 0.1214825511, 0.1793316603, -0.0378343686, -0.0686211884, 0.1795601547, -0.0993586481, 0.2582896352, -0.035082303, 0.3449513912, -0.2938511968, 0.1186883152, 0.0571068674, 0.3514518142, 0.0614332259, 0.1458185911, 0.1700644791, 0.2510415018, 0.2481166869, 0.1212694272, 0.1107935011, 0.2353054434, -0.5594884157, -0.014438279, 0.2380896807, -0.2268466353, 0.1221808642, -0.3115229011, -0.2844859362, -0.01634988, -0.1568189114, -0.0694279224, 0.1400139332, 0.0411848426, -0.0960755944, 0.1236310676, 0.3022822738, -0.4449904263, 0.0296697617, 0.0645203963, 0.14237912, 0.0233240016, -0.0470921285, 0.1370094717, 0.0471976995, -0.337482512, -0.3623557091, -0.141883105, -0.3032468855, 0.160307005, -0.2624213696, 0.0967038274, 0.3457140625, 0.0832178369, -0.1061626747, 0.1414312571, -0.182233572, -0.0328259394, -0.1593858451, -0.163670823, -0.1820600033, 0.0722584724, 0.0887964219, -0.4495786428, -0.2080675066, 0.1057759672, -0.1052308306, 0.1818162799, 0.0921700448, -0.1559054703, 0.3855247796, 0.5239185095, -0.1450589746, 0.3324652314, 0.1163736284, 0.08802028, -0.0329305679, 0.0009647589, 0.0366856158, -0.5844784975, 0.2138009965, 0.0606955141, 0.0174865052, 0.3481499553, 0.2698482871, 0.2174260616, -0.2486604154, 0.3894500434, -0.0429958813, -0.4340244532, 0.0442996025, -0.0562191419, 0.2539738119, 0.1359870881, -0.0387293957, 0.2369684428, 0.0419995151, -0.2390344441, 0.1674462557, 0.296487391, 0.0506462194, 0.2838560641, -0.4702190757, 0.1772666872, 0.0893877, -0.3046460748, -0.3688873053, 0.006100595, -0.2453838885, -0.5936499238, 0.0516958758, 0.2751006782, 0.3244102001, 0.1700237393, 0.267632544, 0.2598537803, -0.0128022023, -0.1208562553, -0.4410265982, -0.0023122579, 0.2443332076, -0.0659469962, 0.306071192, 0.2945915461, 0.0656389594, -0.7135810852, 0.4023997188, 0.0280543808, 0.0839305148, -0.1237928569, 0.3473554254, 0.0027058814, 0.6791752577, -0.0388451219, -0.0912726969, 0.0993103683, -0.3615148962, 0.0821182057, 0.0451400168, -0.1641353965, -0.0131607987, -0.0566077381, 0.0350173377, 0.3031968176, -0.0796023011, -0.0947858542, 0.2517351806, -0.115687266, -0.2033240795, 0.1115549058, -0.1613624394, -0.130351752, -0.523132205, 0.2891619205, 0.0498320982, -0.1892004013, 0.0171599686, 0.0105070528, 0.2565828264, -0.0857758075, -0.0181056559, 0.0827767774, -0.2165866494, -0.2311836481, 0.615242064, 0.0245229304, -0.2053004652, -0.43799299, 0.1390235126, 0.4631359577, 0.147993952, -0.199488759, 0.2235155404, 0.2833436131, -0.2941744626, 0.4283120334, -0.1830680817, 0.0042771026, 0.0652106702, 0.1207622811, -0.1361809224, -0.1715678871, 0.0841846913, -0.1806734502, -0.0789752752, 0.0343606472, -0.2360086739, 0.0575819947, -0.093529284, -0.3933070898, 0.0064134011, 0.2676648498, 0.0374964289, -0.0007015243, 0.1316288561, -0.2041493952, 0.3502351344, 0.177164346, -0.1632457227, -0.2239396125, -0.2237665057, -0.1491776705, 0.0740050003, 0.137021035, -0.1925207973, 0.1644243598, 0.2711192966, -0.1044163704, -0.3035336733, -0.2041677237, -0.4468979537, 0.2802046239, -0.2310409993, -0.0213748403, -0.0157342367, 0.0536570698, -0.3988628387, -0.0704353079, 0.0189252421, -0.0486696139, 0.1597717404, -0.3013107181, -0.0147579387, 0.0004012249, -0.1252851486, 0.206811741, -0.0207491331, 0.3305429518, -0.5354225039, 0.0539761782, -0.4510933757, -0.223998487, -0.5155105591, 0.2345587909, 0.0440516695, -0.0445380062, -0.4874237478, -0.4051349163, 0.1648567915, 0.0389439091, -0.1175606921, -0.0893237963, 0.2565197349, 0.0194466412, -0.1756543666, 0.2952640057, -0.0040652044, 0.0231821314, -0.1310555041, 0.2128731012, -0.2988218665, 0.3243875206, -0.2268587351, -0.3331542909, -0.0371429771, -0.0438874997, 0.0810982361, -0.307970345, 0.063973099, 0.0162995867, 0.0980025083, -0.1462938637, -0.0720575601, -0.0298193023, -0.1622830778, -0.2097994387, 0.2825422287, 0.3656990528, -0.3144033849, -0.3057962656, -0.2115170658, -0.51704669, 0.5374631286, -0.1317463964, -0.1213974655, 0.0975357592, -0.0199509636, 0.0872213393, 0.4435063004, 0.097621955, -0.0927801579, -0.0323479772, -0.2207286805, -0.0921770409, 0.3034675419, 0.036180079, 0.3236654401, 0.07134372, -0.042862691, -0.2759235799, 0.6984179616, 0.1545128971, -0.1129387468, -0.0368446223, 0.1865952313, 0.1347174346, 0.1537361145, 0.039546378, 0.210021764, 0.18505615, -0.4141755402, -0.0594651401, -0.0631648451, 0.1115482524, 0.2609258294, 0.1311187148, -0.0800762624, -0.1254225373, -0.0258485265, 0.254673183, 0.2224897444, 0.04654181, 0.1755640507, -0.0444883965, 0.0648726374, 0.1899703741, 0.0601818562, 0.1394729018, 0.2521350384, 0.3575158119, -0.5147716403, -0.4327395558, 0.1961583197, -0.0379749276, 0.3839316964, 0.292712152, 0.1412984878, 0.4802468419, 0.2687458396, 1.2012724876, -0.199432075, 0.1968930811, 0.2090414166, 0.1212085336, -0.2111749649, -0.466203779, -0.376219213, 0.1179506332, 0.2625868022, 0.3140960336, -0.121398367, -0.2203773856, 0.3250305951, 0.0044492744, -0.0341630019, -0.5240986347, -0.3997714818, -0.3855195045, 0.4010043442, 0.2155387402, -0.0039577186, -0.0078609176, -0.1093086004, -0.3480367064, -0.2681778371, 0.0921771526, 0.0093289427, 0.0210956447, 0.1582899988, -0.0985485688, 0.0732622743, 0.5732539296, 0.0143445358, 0.0252207387, 0.0064189699, -0.385468632, 0.1318615079, 0.0519404672, -0.2821505964, 0.1654087603, 0.3774557412, -0.0721029267, -0.0476558544, -0.1110113114, 0.1519590318, -0.0352651365, -0.2369253337, 0.3207535446, 0.1040847525, -0.2557938993, -0.2596052289, 0.6877688766, -0.2166752815, -0.2821054161, 0.0394137651, 0.2832060754, -0.1812404692, 0.8766022921, 0.2455627769, 1.0091705322, -0.1843688637, 0.0763753131, 0.0048683342, -0.0780312642, 0.390286684, -0.1610207856, 0.3290748894, -0.3745317459, 0.017898649, -0.1573522538, -0.1409615427, -0.4308478534, 0.4691518545, 0.0101767033, 0.3317355514, -0.0496719927, -0.1418056786, 0.1141156182, 0.0149966478, 0.4707396328, -0.1438021958, -0.265011549, -0.0456859358, 0.2187988162, 0.3855182528, -0.1249698699, -0.0634905845, 0.1340592206, 0.0123974085, -0.2642598748, -0.2053083181, 0.1748223603, 0.2478350103, 0.6476367116, -0.2919169068, -0.1821454465, -0.1085374504, 0.5909502506, -0.2857292593, -0.0287665054, -0.1408563256, 0.3821342587, 0.060941793, 0.0609081127, -0.2160615921, 0.3016310334, 0.1459930837, -0.4138073921, -0.0620549098, 0.0529666319, 0.1421031952, -0.2184959352, 0.1249320805, -0.2946154475, -0.0588997193, 0.1669799984, 0.1228137612, 0.2005662322, -0.1120926961, -0.0280544385, 0.29764992, -0.2442921996, 0.6148090959, 0.025307294, -0.5982125998, 0.0017281072, 0.0058565401, 0.3548898697, 0.1154062748, -0.0000143936, -0.0747383684, -0.1368254572, -0.0188425854, -0.425360024, 0.2005560696, -0.1114416793, 0.3863449395, 0.0171439424, -0.031424135, -0.0305695273, -0.1784035712, 0.0075116931, -0.1205597967, -0.6033830047, -0.1258963943, -0.0730070397, -0.0414948165, 0.050757613, 0.2873975635, 0.0348720476, -0.2175998092, 0.0542431399, -0.4236667752, -0.1410948038, -0.3288078308, -0.2730074525, 0.3394036293, -0.3267073035, 0.0706436038, -0.2071160972, -0.0144035183, -0.0259374529, 0.017540168, -0.1718309522, -0.001962807, 0.0633740649, 0.2224035859, 0.1406715214, 0.2365952879, -0.2138766348, -0.0150441155, -0.1310725361, 0.0232864171, 0.0718834028, 0.6227108836, 0.1043882519, 0.2232315242, 0.178725481, -0.1164205223, 0.0708974153, 0.1596696824, 0.1794396192, 0.1937538236, 0.019263301, 0.4420152307, -0.191033721, -0.0397485867, -0.166453898, 0.0411366709, -0.1019665152, 0.1038784832, 0.047521539, -0.1832728535, -0.0966233984, 0.0550632365, 0.0586793795, 0.2841096818, -0.3265292645, -0.3252604008, 0.1167267114, 0.0748211443, -0.0746405348, 0.0229987837, 0.1192851514, 0.0479479991, -0.1677699387, 0.1803189218, -0.0906990543, -0.3160063624, -0.1355918795, 0.0782521516, 0.426150322, 0.0611956641, -0.4527648985, -0.3825879395, 0.2901518643, 0.149091363, 0.1967359483, -0.0591326803, 0.1451511681, 0.6113205552, 0.1217515916, 0.1107537523, -0.0113495206, 0.1995959133, -0.371522218, -0.1344608665, 0.3394747674, 0.5218438506, -0.3490318656, 0.0508743078, 0.2930487096, 0.1431476027, -0.0056756306, 0.0780319124, 0.0807052329, -0.2815241516, 0.0190336537, 0.0291937217, -0.1254897118, 0.2548186779, 0.1008757949, 0.2151558101, 0.0169998482, 0.1244813129, 0.0994329005, 0.1951432824, -0.0595923774, -0.0192558616, -0.1417938173, 0.4372678995, 0.1537416428, 0.0426861644, -0.1426154971, -0.2369130552, 0.0918061584, 0.3338094652, 0.2461561412, 0.2434304953, 0.430619508, -0.1936024129, 0.1557517052, -0.1435733736, -0.1213180125, -0.1625492275, -0.1095951051, -0.2291346192, -0.0706925243, -0.0257986076, 0.0164093077, 0.0409960449, -0.0840599313, -0.0974237323, 0.3490946293, -0.1354084164, 0.0347182155, 0.1858804822, -0.0455697626, -0.2363216132, 0.1576511562, -0.1187545061, 0.3110812604, 0.2012789994, -0.0969727933, 0.1226819158, 0.0982028842, -0.026250938, -0.2952479422, 0.1485582739, 0.4027974308, 0.361317873, -0.1547199786, 0.223868683, -0.126778692, 0.0900348052, -0.1411444247, 0.2908810675, 0.3600699008, 0.3362488151, -0.3147234619, -0.161863625, 0.4526506066, 0.5721443295, -0.0233683214, 0.5273844004, 0.1373147219, -0.064449802, -0.4177998006, -0.0203016028, -0.0066610277, -0.2597429752, 0.3239432275, 0.1009853259, -0.0186072141, 0.0459341444, 0.0946536139, 0.1754491329, -0.255964011, 0.3542017937, 0.2255945504, -0.1032009721, 0.0405591801, 0.1807114482, -0.3297012746, -0.0746262819, -0.4674160182, -0.2327862978, -0.2586238384, -0.1115679741, -0.2286156416, -0.2888636291, -0.0895060003, 0.3101376593, 0.2296525538, 0.0700830147, -0.1351107508, 0.2806581557, -0.4428523183, -0.0036486387, -0.0204248354, -0.0758653581, 0.2608932257, -0.0316250622, -0.3340318799, -0.2992794514, 0.4845566154, -0.3352628648, -0.255225867, -0.4549150467, 0.4566246569, 0.3513974845, 0.1830572486, -0.6376382113, -0.2375079542, 0.1805982739, 0.0340803005, -0.3883373737, -0.4541919231, 0.2193976045, 0.1335380971, -0.1433111429, -0.4149549603, 0.4335042834, 0.0349700972, 0.2382239401, -0.3442329168 ]
https://github.com/huggingface/datasets/issues/2175
dataset.search_batch() function outputs all -1 indices sometime.
I also checked with some indexes it returns more -1s. Specially with IVF when nprobr is very low. It doesn't happen when using HNSW though. But at the moment if it happens, dataset will always return the last element. Maybe we should change it to repeat the most last valid retrieved doc id. What do you think? On Wed, Apr 7, 2021, 21:09 Quentin Lhoest ***@***.***> wrote: > Hi ! > No it happens sometimes to return -1, especially if your dataset is small. > If your dataset is big enough it shouldn't happen. > > Ideally we should ignore all the -1 that are returned. It should be > possible to change that in RAG's code > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2175#issuecomment-814746509>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AEA4FGTENOTLBEZTXEO2RS3THQOMPANCNFSM42PRVYDA> > . >
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq
150
dataset.search_batch() function outputs all -1 indices sometime. I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq I also checked with some indexes it returns more -1s. Specially with IVF when nprobr is very low. It doesn't happen when using HNSW though. But at the moment if it happens, dataset will always return the last element. Maybe we should change it to repeat the most last valid retrieved doc id. What do you think? On Wed, Apr 7, 2021, 21:09 Quentin Lhoest ***@***.***> wrote: > Hi ! > No it happens sometimes to return -1, especially if your dataset is small. > If your dataset is big enough it shouldn't happen. > > Ideally we should ignore all the -1 that are returned. It should be > possible to change that in RAG's code > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2175#issuecomment-814746509>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AEA4FGTENOTLBEZTXEO2RS3THQOMPANCNFSM42PRVYDA> > . >
[ -0.0352192223, -0.3799374104, -0.0478165261, 0.0425725132, 0.1534609199, -0.0822972134, 0.2974610031, 0.3594940305, 0.154549554, 0.4000558853, -0.2719640136, -0.135530293, 0.1801844984, -0.11624749, -0.1042531952, 0.0176872984, 0.251052022, 0.4117010832, -0.0238933638, -0.5655052662, -0.3472931087, 0.0554175451, -0.1621702313, 0.3566615582, -0.2797409594, 0.2079562545, -0.0260151997, -0.110310331, -0.256462425, -0.4766810238, 0.5943053961, -0.2659980059, 0.4845436811, 0.1558328569, -0.0001315398, 0.044687584, 0.3873679042, -0.0088380426, -0.1438090801, -0.1818875074, -0.1090588123, 0.144623518, 0.0432352424, -0.0554540828, 0.0236522257, -0.2460289299, 0.230086714, -0.1483961642, -0.0233965032, 0.2602905631, 0.0044122301, 0.1053059548, -0.1652545333, 0.0414582826, 0.6535948515, -0.2939596474, 0.0850198418, -0.0507770814, 0.4610897303, -0.0346093103, 0.0753294975, 0.1881513298, -0.001329504, 0.016123578, -0.2380201817, 0.2958971262, 0.532697916, -0.2921401262, 0.2075953335, 0.3135941923, 0.4642092586, -0.0597213171, -0.3771157861, 0.0416517779, 0.1993484199, -0.0407042317, -0.011102125, 0.1670990884, -0.095629707, 0.2709481716, -0.0423736908, 0.3521001637, -0.3264371753, 0.2192142904, 0.0522130579, 0.2759840488, 0.0092750378, 0.108893685, 0.2060455084, 0.2290039361, 0.2474693805, 0.0632586777, 0.0785053521, 0.2596688271, -0.5432366729, -0.0447991304, 0.2311133146, -0.149175778, 0.1683736295, -0.3305645585, -0.2783356011, -0.0451583788, -0.1775638908, -0.1095416844, 0.2284876704, 0.0602516755, -0.0660797954, 0.1812398732, 0.2954420149, -0.4274535179, 0.0121697262, 0.0389138907, 0.1758262515, 0.008305259, -0.0358681381, 0.0813365877, 0.0619079694, -0.3679014742, -0.3316134512, -0.1007402986, -0.280818224, 0.1629867107, -0.2730959356, 0.1317035258, 0.3634670377, 0.146359697, -0.0804843828, 0.1096704751, -0.2068979144, -0.0622218326, -0.1117540002, -0.1769568473, -0.2272163182, 0.0936458409, 0.1030371264, -0.4674132466, -0.2122444808, 0.1181563735, -0.1083407924, 0.1680170894, 0.0629029498, -0.1599714011, 0.4342667162, 0.5060639381, -0.1651236117, 0.3369481266, 0.1049577296, 0.0215297043, -0.0737529546, -0.0155769438, 0.0040882658, -0.5431571007, 0.1411886066, 0.0422843173, 0.0865261555, 0.2734597921, 0.2544467449, 0.2392119467, -0.1934600472, 0.3121080399, 0.001269076, -0.4304850399, -0.0292750821, -0.018434437, 0.2137637138, 0.2421735823, -0.0626737177, 0.2080484033, -0.0002855845, -0.1212485731, 0.1199434474, 0.3533532023, 0.033883471, 0.3021073341, -0.51250422, 0.2115638852, 0.0529591739, -0.410232842, -0.4800130129, 0.0852880776, -0.2135838568, -0.4950403273, 0.0450819731, 0.2997731566, 0.3912864923, 0.1524201483, 0.1798936129, 0.2190254033, -0.0094278036, -0.1238508821, -0.4738116264, -0.0203028768, 0.1659636199, -0.064144209, 0.2935773134, 0.298910588, 0.0591122359, -0.665115118, 0.5013081431, 0.0430335216, 0.0659960061, -0.1130267531, 0.3581510782, 0.007445313, 0.6426559091, -0.0502743647, -0.1780303717, 0.0940998346, -0.2164572626, 0.0910366774, 0.0303636678, -0.1974473, -0.0065677725, -0.0760184377, -0.0133750774, 0.2669555843, -0.1085204482, -0.0845132172, 0.2347446382, -0.1179972589, -0.2005400062, 0.1396356821, -0.1923643351, -0.1165501699, -0.5885254741, 0.2917745411, 0.0471415371, -0.12169718, 0.0123127028, -0.025951989, 0.2452688664, -0.0673241168, -0.0140779559, 0.0787072033, -0.1622737944, -0.2337717116, 0.6361714005, 0.0879750997, -0.1430278271, -0.4997429848, 0.1686105281, 0.4223237038, 0.1080621928, -0.1674084663, 0.0855954438, 0.2818098962, -0.2499456555, 0.3955379426, -0.1710406542, 0.0001394302, 0.0027463734, 0.109056823, -0.1679996997, -0.2835785747, 0.0963128209, -0.1664517075, 0.0276062861, 0.0002168156, -0.2364961505, 0.1579594314, 0.0416527614, -0.4263930023, -0.0353486016, 0.318325758, 0.0457658619, -0.0429298505, 0.0815227553, -0.181658566, 0.3200332522, 0.2101314515, -0.119013831, -0.193700254, -0.211512506, -0.1423905194, 0.1488104761, 0.1308148056, -0.2229636163, 0.2195239067, 0.2386861742, -0.0670408159, -0.3496904373, -0.1729843616, -0.4460813999, 0.2864308357, -0.2928532362, -0.0258859396, -0.0175160095, 0.0072541535, -0.399092108, -0.1714132577, 0.0129363313, -0.0954466015, 0.1556201577, -0.2962564826, 0.0372464731, 0.0285778493, -0.1710749269, 0.2711136937, -0.0011824667, 0.3199299276, -0.5916768909, 0.0757884979, -0.4536622167, -0.2365647852, -0.4173086286, 0.2427256107, 0.0915844962, -0.0534468032, -0.4779872894, -0.4758244753, 0.0625490174, 0.0882035196, -0.0828447789, -0.0033015627, 0.2853537202, 0.0243894178, -0.1791018248, 0.2776323259, -0.0406959653, -0.0596281216, -0.1343440861, 0.1894849092, -0.2842755318, 0.3387927413, -0.1425898373, -0.3792661428, -0.0355895683, -0.0484613255, 0.0492441729, -0.3014892936, 0.0841293037, 0.1359289289, 0.0926205665, -0.1223765612, -0.0579566099, -0.0589887314, -0.1991789192, -0.2659586966, 0.2765994966, 0.3525114655, -0.3270426989, -0.3649879992, -0.2087555677, -0.4985118508, 0.4951010346, -0.2142502218, -0.0898169354, 0.0495261252, 0.0754162222, 0.0916234553, 0.458217144, 0.0985498577, -0.1285072267, -0.0332207978, -0.2222561538, -0.0068690628, 0.2888507843, 0.0057803523, 0.268035084, 0.1182748377, -0.0085809436, -0.2806572914, 0.6924844384, 0.2454242706, -0.1094335616, 0.0033000708, 0.1748460829, 0.1834658533, 0.085043028, -0.0511147007, 0.18429178, 0.1242135167, -0.360214442, -0.0015486889, -0.0227119792, 0.1254471689, 0.2621417046, 0.0651478171, -0.1408729851, -0.1906815767, 0.0160578508, 0.2723434567, 0.1903140843, 0.0644935668, 0.2008593976, -0.0713965893, 0.0626235008, 0.1590748131, 0.1308518499, 0.1889721304, 0.2279016376, 0.3748854399, -0.3430369794, -0.4709907174, 0.2146636248, -0.037967559, 0.3748731613, 0.2928199768, 0.1698245406, 0.4761978388, 0.2678497732, 1.2380458117, -0.2207325995, 0.2397739887, 0.2109360993, 0.0684708282, -0.133333981, -0.3933831453, -0.3835386336, 0.0539189465, 0.2844853103, 0.2951929569, -0.1307266951, -0.2451578528, 0.3851927817, -0.043293763, -0.0225206614, -0.560254693, -0.3447219729, -0.3303633332, 0.3607953191, 0.2142215371, -0.0167532191, -0.0356717557, -0.0863246098, -0.3638092875, -0.26062572, 0.0319277272, -0.0040610433, -0.0172435753, 0.1569555998, -0.0351991355, 0.1268287003, 0.5927978158, 0.0563237742, 0.13548024, 0.0466015264, -0.4220657349, 0.1149934679, 0.0003928188, -0.320399493, 0.143997848, 0.4571453929, -0.0528084897, -0.0479093939, -0.0234420765, 0.1816636026, -0.0425872691, -0.2462250292, 0.3428117633, 0.1262633502, -0.3059759736, -0.306415081, 0.7411090732, -0.1855350733, -0.2672069073, 0.1069352031, 0.4109171331, -0.2264973223, 0.7764760852, 0.2357637286, 1.0908920765, -0.1659918576, 0.0971565992, 0.0304794982, -0.1151242331, 0.4454537332, -0.1803420782, 0.2873798013, -0.4076924324, -0.0588942058, -0.1609717906, -0.1220315173, -0.3867909312, 0.4929744303, -0.0134289116, 0.2915369868, -0.032785058, -0.1302914321, 0.117648989, 0.1352376044, 0.426361233, -0.1774724126, -0.3494232595, -0.064645052, 0.1964098513, 0.3611921668, -0.0817259401, -0.0556193292, 0.1696476638, -0.0655205846, -0.3079978228, -0.195783332, 0.166844368, 0.2483809888, 0.605091691, -0.2735133767, -0.0926158875, -0.1107755154, 0.5516929626, -0.2731859386, -0.0825292021, -0.105742991, 0.3689370155, 0.0818957388, 0.1000142619, -0.2633993924, 0.4028350115, 0.1485241055, -0.4183521271, -0.1264144033, 0.0918536782, 0.1044743955, -0.1990519911, 0.0399839506, -0.2782664001, -0.1274039149, 0.1478638202, 0.1152886301, 0.1704013944, -0.1256522685, -0.0417334214, 0.2570220828, -0.2283675075, 0.6009517908, 0.0229777973, -0.552015841, -0.0258274339, 0.0755629763, 0.3389899731, 0.0900313705, 0.0240295194, -0.006329976, -0.1868754029, -0.0373295061, -0.3733904958, 0.2717143595, -0.1918026805, 0.36437428, 0.030977983, 0.0142212063, -0.0025920309, -0.1666157395, -0.0068244282, -0.1368848234, -0.6075825691, -0.1545447707, -0.0980521441, 0.0054498594, 0.0585083738, 0.3379842043, 0.0525968373, -0.1713050604, 0.0245964527, -0.3661859632, -0.141757682, -0.3039371967, -0.2061250657, 0.3066471517, -0.2834742367, 0.0753316954, -0.1492099613, -0.0744475126, -0.0382263586, 0.0128113739, -0.1530415118, 0.0059129037, 0.0284619257, 0.2310506552, 0.1268339008, 0.1678778231, -0.1572225541, -0.0414524488, -0.1851230711, -0.0511416718, 0.0929044262, 0.6247397661, 0.1384486407, 0.227468431, 0.1712168604, -0.1496948451, 0.0927993357, 0.1731610298, 0.1757947505, 0.1908445507, 0.0336915441, 0.4374405742, -0.2129028141, -0.0112236142, -0.1696379334, 0.1339258254, -0.0512632839, 0.0851517022, 0.0876811743, -0.1978399456, -0.1283258498, 0.0589114726, 0.1164161116, 0.3177777231, -0.316421777, -0.3802134693, 0.0690346509, 0.0589251108, -0.1155009866, -0.0540945232, 0.1288800985, 0.0089744329, -0.1514479816, 0.1618000865, -0.0815635547, -0.3397395611, -0.1452523321, 0.0311047062, 0.4814720154, 0.0169143453, -0.4494760036, -0.2749432027, 0.255040586, 0.1599333137, 0.1452340931, -0.056798175, 0.1440954357, 0.6504954696, 0.0611681342, 0.0951554775, -0.0044947141, 0.2546858191, -0.3507913649, -0.1205263138, 0.3938988745, 0.5549637675, -0.3658359647, 0.1144751385, 0.3032386601, 0.0590787977, 0.0498137064, 0.0347509794, 0.0258076787, -0.2654339671, 0.0535270534, 0.045061186, -0.1681103706, 0.2421637326, 0.0718766898, 0.221941784, -0.061258249, 0.1321684867, 0.0572977625, 0.1927281022, -0.059372019, -0.095871143, -0.1027274877, 0.3466029465, 0.241403684, -0.0203103423, -0.0924161896, -0.2260825485, 0.1413003802, 0.283490181, 0.2858726978, 0.2577604055, 0.4385696352, -0.1007146239, 0.1342722625, -0.140362069, -0.1125694662, -0.1482646018, -0.0706934184, -0.2538695633, -0.1201608926, 0.0064013302, -0.0004376806, 0.0668116361, -0.1140035912, -0.0617011078, 0.3319974542, -0.2130601406, -0.0438319594, 0.176320076, -0.0799645036, -0.2092104852, 0.1814578474, -0.0862183496, 0.3858224154, 0.2377941161, -0.0724791661, 0.1383314282, 0.1076778695, -0.0228731409, -0.2899656594, 0.1609803438, 0.4326781332, 0.3409769237, -0.1819424629, 0.1936616451, -0.1942361593, 0.0695759878, -0.1200071871, 0.1969017088, 0.3757030368, 0.2980358005, -0.2654166818, -0.1884825528, 0.4569737315, 0.5234509706, -0.034562584, 0.5137480497, 0.1578450352, -0.085811913, -0.4482061863, 0.0031461176, -0.0429222956, -0.3278623223, 0.3053079247, 0.1365032047, -0.062827453, 0.0044301841, 0.2133937329, 0.1614728421, -0.256632477, 0.3023569584, 0.2806193233, -0.0812226683, -0.0041029975, 0.1284435689, -0.3599643707, -0.0700792223, -0.5363731384, -0.1271944493, -0.1923542321, -0.0623677336, -0.2078743279, -0.3585232794, -0.1056167036, 0.2334914804, 0.2771334052, 0.1271458864, -0.1819609106, 0.2790573239, -0.4390175045, 0.0158226043, -0.0636894703, -0.0178004336, 0.2450152487, 0.0175689757, -0.3433601856, -0.3317608237, 0.4912692308, -0.4107954502, -0.2306315899, -0.4675194323, 0.4894466996, 0.3603943586, 0.1244177967, -0.6537602544, -0.2610958517, 0.2394976765, 0.0226530284, -0.4419297576, -0.3901978731, 0.2465599477, 0.1512916088, -0.1403434426, -0.3127257228, 0.4764626324, -0.0298662782, 0.2219780385, -0.3673062921 ]
https://github.com/huggingface/datasets/issues/2175
dataset.search_batch() function outputs all -1 indices sometime.
That would be an easy way to workaround this issue. Feel free to open a PR on `transformers` and ping me ! :)
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq
23
dataset.search_batch() function outputs all -1 indices sometime. I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq That would be an easy way to workaround this issue. Feel free to open a PR on `transformers` and ping me ! :)
[ -0.0255079865, -0.4342888296, -0.0677888319, 0.0737093166, 0.25572142, -0.0868849903, 0.3684978783, 0.2831259966, 0.0772830844, 0.4528711736, -0.2223182321, -0.198430568, 0.0448378846, -0.0636606961, -0.125700444, -0.0068473211, 0.2816343009, 0.4138690829, -0.1538361162, -0.5060527921, -0.2846682668, 0.0919226706, -0.0996465087, 0.3383359015, -0.2817489803, 0.245802626, 0.0199469477, -0.1887717098, -0.2253593802, -0.4320189357, 0.5846903324, -0.3023688495, 0.4834949672, 0.285486728, -0.0001320533, 0.1387140453, 0.4092572331, -0.0608326942, -0.0931292772, -0.1343975216, -0.1120468676, 0.1853379607, 0.0772111565, -0.0690412596, 0.0472484976, -0.2181160748, 0.2536380589, -0.0957305133, 0.0374498516, 0.2091832459, 0.0222841222, 0.0297927856, -0.2128655761, -0.0140268225, 0.6179970503, -0.280487299, 0.0285133794, -0.1167520955, 0.4519714713, -0.0117915571, 0.1072007865, 0.1190894842, 0.0261776894, -0.0273777768, -0.2742780149, 0.1751958728, 0.6338201165, -0.3051924706, 0.1454397142, 0.2770223022, 0.3461783528, -0.0626919344, -0.3898919225, 0.1132111251, 0.1292074621, 0.0541256294, -0.0549931526, 0.139411211, -0.1022168547, 0.2307331562, -0.063199684, 0.3316144645, -0.3248741031, 0.0969751179, 0.0660298169, 0.4078654647, 0.0728811771, 0.1187466383, 0.1552824378, 0.2217084616, 0.3452391326, 0.1692687124, 0.1384443641, 0.2564409077, -0.5704567432, -0.0328685343, 0.2476681769, -0.3040000498, 0.0914048105, -0.3667513132, -0.2984806299, -0.0011986615, -0.1310699582, -0.0730980784, 0.1572882831, 0.0958084464, -0.1555743068, 0.1905961186, 0.2899276018, -0.4025510848, 0.0473156199, 0.0571681596, 0.1330020577, -0.0341472924, -0.0552358329, 0.163936317, 0.0571804568, -0.3014556766, -0.3065544069, -0.1873534024, -0.2294138968, 0.1778839082, -0.233643949, 0.1199394464, 0.363121599, 0.1038906574, -0.1139719263, 0.128608644, -0.2179737985, 0.0080415122, -0.1513518244, -0.1766061783, -0.1628476679, 0.0268832706, 0.127755031, -0.3845342398, -0.2226810455, 0.0798273757, -0.0499851033, 0.1883437932, 0.0910436437, -0.1283474118, 0.3764999807, 0.5422126055, -0.1805915087, 0.3457103968, 0.1473207921, 0.0648406446, -0.0523050129, 0.0569306239, 0.0623310134, -0.5635717511, 0.2131017447, 0.0429792404, -0.0099193491, 0.3326792717, 0.2444736362, 0.2408257872, -0.2267524749, 0.3575468659, -0.0646780953, -0.4154817164, 0.0750564486, -0.048254434, 0.2719377279, 0.1570003331, -0.0759209991, 0.198742345, 0.0016795471, -0.2054325193, 0.1476550102, 0.3099029362, 0.0314138457, 0.2916762531, -0.458126992, 0.13962318, 0.0980174989, -0.3492688239, -0.4021476805, -0.0138708055, -0.2424458265, -0.6214389205, 0.0572069623, 0.2899436951, 0.3333923221, 0.2120531499, 0.1955876946, 0.230257988, -0.0019289721, -0.050275296, -0.4343539476, -0.0875270218, 0.2455362678, -0.067328766, 0.3384168446, 0.3327717781, 0.0542201847, -0.6487194896, 0.3746262193, 0.0277141538, 0.1122426093, -0.0425459333, 0.3574846983, -0.0490814336, 0.6802944541, -0.0569766052, -0.0994704962, 0.1098420471, -0.4044045806, 0.1155567318, -0.0753008723, -0.1674621403, -0.0443623438, -0.028872747, 0.0516014062, 0.2574239671, -0.0835033506, -0.1358899176, 0.2232370377, -0.1738038361, -0.2003887594, 0.0807733685, -0.0530159399, -0.1851889193, -0.522593677, 0.2937067151, 0.0043016961, -0.2040100247, -0.0028494745, -0.0113275871, 0.2704211771, -0.1043976173, -0.0470288843, 0.1162899211, -0.2604331672, -0.1867757291, 0.6034036875, 0.0949817672, -0.2119151503, -0.5101866722, 0.1308422685, 0.5453124046, 0.1332518756, -0.1913260221, 0.1168148518, 0.280608505, -0.2984346449, 0.4549022913, -0.1223081723, 0.0325307697, 0.0806697682, 0.0950448886, -0.1291331649, -0.1698791534, 0.0585400052, -0.1538615376, -0.1018988192, 0.0576153025, -0.1809529364, 0.07244578, -0.0708558708, -0.3715220988, 0.0288231988, 0.2372297049, 0.0213534199, 0.0044943914, 0.1027631536, -0.1742996871, 0.3418672085, 0.159180671, -0.1636028439, -0.2321524173, -0.199249059, -0.13355349, 0.0652231947, 0.1495564133, -0.2263539135, 0.1603026092, 0.2735204697, -0.1297736317, -0.2528553009, -0.2256878465, -0.3778069913, 0.2927739024, -0.2615425885, 0.0061664954, -0.0009526759, 0.0838356167, -0.4358869493, -0.0872680694, -0.037238501, -0.0413086563, 0.1497712433, -0.2632547915, -0.0305018611, 0.0376622006, -0.1437920779, 0.2031647563, 0.0334751084, 0.2562787533, -0.566210568, 0.0405999422, -0.4012903273, -0.226755932, -0.5071382523, 0.2500786781, -0.042826578, -0.0016552284, -0.4777206779, -0.3937184215, 0.1553554088, 0.0370762944, -0.0991735458, -0.0453232937, 0.2388150096, 0.0361719877, -0.1780602783, 0.2443040311, -0.0010675974, -0.0549961813, -0.1276286691, 0.2173933387, -0.301399976, 0.32821998, -0.2105445415, -0.3242882192, -0.042646639, -0.0906962901, 0.0754313618, -0.29907763, 0.0941385627, 0.0747861862, 0.1288622618, -0.1666217744, -0.0098453164, -0.0191107467, -0.104561761, -0.1794234514, 0.3382856846, 0.3333112597, -0.3282367885, -0.3087780476, -0.2162128836, -0.4937135875, 0.528308332, -0.0928185508, -0.0157317705, 0.0018388554, -0.0691943839, 0.0996073782, 0.4600243568, 0.1996831298, -0.0514194593, -0.0385451764, -0.2258524001, -0.0831201971, 0.3009178042, 0.0581527911, 0.3111124039, 0.0482887067, -0.0592646897, -0.2736326456, 0.7122141123, 0.1361288428, -0.0920713693, -0.0344321132, 0.1491031349, 0.1136704907, 0.1592761576, 0.0019229129, 0.1652658433, 0.2288833559, -0.4103987813, -0.0656822473, -0.0133139482, 0.0773076862, 0.2662028372, 0.1429793686, -0.1251464784, -0.1810503751, -0.0159989484, 0.2515527606, 0.2669727802, 0.0143954009, 0.1463372409, -0.1024168134, 0.0564950816, 0.1641009003, 0.0309962519, 0.0924768299, 0.2320387065, 0.3905264437, -0.4612026811, -0.4391342998, 0.1856733412, -0.0407252163, 0.4382945299, 0.2652524412, 0.1048692912, 0.4620368481, 0.2753232718, 1.2533448935, -0.168203786, 0.2443878651, 0.2285846472, 0.1121662557, -0.2479836643, -0.453404665, -0.3643165827, 0.0991533399, 0.2433369905, 0.286257565, -0.1009632498, -0.2710575163, 0.3411566913, -0.0417641476, -0.0770752132, -0.5282347798, -0.3852576613, -0.398429513, 0.4009664059, 0.1933480501, 0.1002764329, -0.0016862974, -0.0981549919, -0.3518530726, -0.2977443337, 0.0587855801, -0.0235365257, 0.0146292672, 0.1803559363, -0.0844779164, 0.0557963401, 0.6131927967, -0.0663989931, -0.0055678468, -0.0284150112, -0.3356004953, 0.1228951067, 0.1098735034, -0.2699327767, 0.1230086088, 0.390727371, -0.0632376224, -0.0347639471, -0.032439664, 0.1370740682, -0.0038245134, -0.2497374564, 0.3184866905, 0.1094294637, -0.2624955177, -0.2656923831, 0.658067286, -0.1930511594, -0.2695930004, -0.0207185168, 0.2656034827, -0.199487403, 0.9289187789, 0.2211866975, 1.0775784254, -0.233635813, 0.1243536398, -0.0402224995, -0.0385020897, 0.3738062978, -0.1477872133, 0.3885955215, -0.4005363584, -0.0579812005, -0.1568464637, -0.1692634523, -0.4292779565, 0.470572412, -0.0453678854, 0.3410061598, -0.0935928971, -0.0992788821, 0.1152344495, -0.0186624229, 0.5046877861, -0.1451408863, -0.2361815721, -0.0453215465, 0.2728790343, 0.3918408155, -0.1352117807, -0.0827155933, 0.0907284096, -0.0187596902, -0.2966328859, -0.1587717235, 0.212632522, 0.3333905041, 0.6535939574, -0.2758545876, -0.1297224015, -0.0950346738, 0.5668451786, -0.2924180329, -0.0711948425, -0.0927343592, 0.3423767388, 0.0585613698, 0.0793098062, -0.2069381475, 0.293288976, 0.1730279177, -0.4413435757, -0.0749929547, 0.0813824534, 0.0970353633, -0.2128102481, 0.0719434097, -0.3438452482, -0.1062024236, 0.1761125922, 0.0801267177, 0.1485578716, -0.1392741948, -0.0243771933, 0.2996041477, -0.2540243864, 0.6346090436, 0.0144602247, -0.5885605812, 0.0614552572, 0.0554135181, 0.3862686753, 0.0927914605, 0.0231982917, -0.0478765368, -0.1428458691, -0.022815574, -0.4327025115, 0.1647471786, -0.1825353801, 0.4008666873, -0.0338536836, -0.0717813969, -0.0131972656, -0.1236335635, 0.0177664533, -0.0629776716, -0.673409462, -0.1147428006, -0.172039032, -0.0326651484, 0.0396825261, 0.3249146044, -0.004447341, -0.2103172541, 0.054947041, -0.3948970139, -0.1477695704, -0.337364167, -0.318605423, 0.3224569857, -0.318608284, 0.0102538588, -0.1454120427, -0.0666961372, -0.0523238741, 0.0033243448, -0.1456393003, -0.0006993897, 0.0434129685, 0.2336116582, 0.1369243115, 0.2370671034, -0.2467976809, -0.0148840845, -0.1199733764, 0.0132375881, 0.0394398645, 0.6291811466, 0.1146614999, 0.2691941261, 0.1905389279, -0.0973765552, 0.007606566, 0.1805886328, 0.2111604512, 0.1675792336, 0.0501722284, 0.4540920258, -0.2053149939, -0.0286082178, -0.171770215, 0.0796858519, -0.0547105819, 0.1496178806, 0.0422051251, -0.1746304631, -0.1131615713, 0.0815503895, 0.0865568817, 0.2704325318, -0.3065719604, -0.3265143335, 0.126902774, 0.0752310455, -0.1225905567, -0.0393658318, 0.1416324228, 0.036635831, -0.1312530488, 0.1692126095, -0.0751831532, -0.318349421, -0.0408225767, 0.1197023243, 0.4419664443, 0.0297926404, -0.4090227783, -0.3178195953, 0.2936322391, 0.1212726831, 0.2321815491, -0.1055876613, 0.1887023896, 0.6046786904, 0.0992950052, 0.059304662, -0.0757181346, 0.2035538256, -0.3737028837, -0.0705198497, 0.3196417093, 0.4683904052, -0.266939491, 0.0369863063, 0.2698328495, 0.1102559045, 0.0049412586, 0.1236926392, 0.1029186994, -0.2615014315, 0.0346318185, -0.0050764233, -0.0716742277, 0.2395760715, 0.043363899, 0.1515958607, 0.0264628325, 0.1367264837, 0.1029605418, 0.2031823099, -0.0519421585, -0.0167802218, -0.0875001475, 0.4751600027, 0.1755363047, 0.0319662169, -0.156506598, -0.2082108259, 0.1234942377, 0.2431228459, 0.34460935, 0.2604809999, 0.4134628773, -0.2396589965, 0.2142128348, -0.1261846423, -0.1410274059, -0.156886816, -0.1109906435, -0.2464741319, -0.0485984869, -0.0899069607, 0.0161396377, 0.0405251309, -0.0971037447, -0.1191767603, 0.3489647508, -0.0887703598, 0.0838767588, 0.1934063137, -0.1072788909, -0.1946725249, 0.1110507548, -0.1409391165, 0.2484158874, 0.2611742616, -0.1299314201, 0.1620999277, 0.1149599999, -0.0317188129, -0.2445863038, 0.1948194355, 0.3826383948, 0.4384091794, -0.1414259374, 0.2510775626, -0.17164433, 0.078400135, -0.0957528055, 0.3263391256, 0.3865193427, 0.3334311843, -0.3761415482, -0.1912062913, 0.447991699, 0.5177021027, -0.0460334495, 0.5572066903, 0.1300535798, -0.0306598097, -0.3718102276, -0.0292300396, 0.0206286162, -0.2748636603, 0.3173443079, 0.1746453047, -0.0274724886, 0.018897213, 0.0632613748, 0.1854256988, -0.2322798669, 0.2986275554, 0.2376523912, -0.0691027343, 0.012624003, 0.1746601611, -0.4002309144, -0.1194840372, -0.4669221938, -0.2581315637, -0.2126855254, -0.1061554253, -0.2768252492, -0.2955433726, -0.1151281595, 0.2654781342, 0.2090073973, 0.0321963429, -0.1818614453, 0.2971214056, -0.4628486037, 0.0397842675, -0.0534092598, -0.0780035555, 0.255630821, -0.028874021, -0.3407844901, -0.3159102798, 0.4795512557, -0.3244589567, -0.3055863976, -0.4587937593, 0.3932494521, 0.2971412838, 0.1950141639, -0.6422249079, -0.2094750106, 0.1584327966, 0.0496233664, -0.3588387966, -0.4520337284, 0.2327467054, 0.1298267245, -0.1456966847, -0.3039954007, 0.4553859234, 0.0320597216, 0.147500366, -0.3409582376 ]
https://github.com/huggingface/datasets/issues/2175
dataset.search_batch() function outputs all -1 indices sometime.
Sure. Will push everything together with RAG end to end. :) thanks a lot. On Wed, Apr 7, 2021, 21:16 Quentin Lhoest ***@***.***> wrote: > That would be an easy way to workaround this issue. Feel free to open a PR > on transformers and ping me ! :) > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2175#issuecomment-814752589>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AEA4FGWLROCGARKN7WOJYSTTHQPH5ANCNFSM42PRVYDA> > . >
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq
82
dataset.search_batch() function outputs all -1 indices sometime. I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**. During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker. ![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png) Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ? Is this a problem of the index, where the faiss can't find any similar vector? Is there documentation on the output index being -1? @lhoestq Sure. Will push everything together with RAG end to end. :) thanks a lot. On Wed, Apr 7, 2021, 21:16 Quentin Lhoest ***@***.***> wrote: > That would be an easy way to workaround this issue. Feel free to open a PR > on transformers and ping me ! :) > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2175#issuecomment-814752589>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AEA4FGWLROCGARKN7WOJYSTTHQPH5ANCNFSM42PRVYDA> > . >
[ -0.0283132717, -0.4459779263, -0.0621184111, 0.1084143817, 0.2921060324, -0.0717787817, 0.3549714088, 0.3072517514, 0.0994758457, 0.4373636246, -0.2883692086, -0.1778713465, 0.0475871898, -0.0405469052, -0.1186914891, 0.0098076034, 0.2470596433, 0.4063915014, -0.1565123349, -0.5071401596, -0.2862781286, 0.1293402165, -0.0813583881, 0.328083694, -0.3517277241, 0.2273843288, 0.0281685367, -0.1398201138, -0.2862048149, -0.4498893917, 0.6027758718, -0.2830131352, 0.4530461431, 0.2541904151, -0.0001301647, 0.1176811755, 0.439586848, -0.0651392564, -0.151789546, -0.1811906546, -0.0812220722, 0.213844642, 0.0726933107, -0.037177749, 0.0060922951, -0.2177124172, 0.2247651815, -0.1663434207, 0.0418866724, 0.1865680516, 0.0233884379, 0.1017680913, -0.1806956828, -0.0772506371, 0.5992839932, -0.2709937096, 0.0486721247, -0.0523502938, 0.4569101632, 0.0019479915, 0.092516467, 0.139799878, 0.0461414754, -0.0342068896, -0.2073288113, 0.1863568872, 0.552873075, -0.2722931504, 0.171079427, 0.2689871788, 0.3746108413, -0.0904796273, -0.4090768695, 0.0736160278, 0.1362153292, 0.0564790815, -0.0152638629, 0.141793713, -0.1147214621, 0.2588492036, -0.1016510129, 0.3451102376, -0.3150436878, 0.1087804139, 0.0793955028, 0.3879108727, -0.0039708875, 0.1147776917, 0.1775080562, 0.2319934666, 0.2189957201, 0.1565215886, 0.1433766633, 0.2508933842, -0.5799223781, -0.0268856585, 0.2490703911, -0.2496404648, 0.1563376784, -0.2913856804, -0.3163484335, 0.0053514317, -0.14512977, -0.1174500808, 0.1691084355, 0.1386012882, -0.091609627, 0.1230224669, 0.2601278126, -0.3778175712, 0.0464001, 0.0165742822, 0.1478917003, -0.0251176096, -0.1337239444, 0.1508807242, 0.0699099004, -0.3211229146, -0.3362389207, -0.1822970361, -0.2384530455, 0.1561426818, -0.1856637299, 0.1956369132, 0.3701726794, 0.0615761951, -0.1258406043, 0.1341768205, -0.188458249, -0.0083695091, -0.173541218, -0.1935447156, -0.2100248635, 0.0248550884, 0.1446507722, -0.4088213444, -0.184409216, 0.102848202, -0.0403669067, 0.2042437494, 0.0240629688, -0.1293122619, 0.3815371096, 0.5448857546, -0.1957633793, 0.3435322642, 0.1752252579, 0.0462618619, -0.0807228014, 0.0104639214, 0.056140814, -0.5754234195, 0.1869508326, 0.0365573056, -0.0247186683, 0.2832265198, 0.2651235163, 0.2736899853, -0.227535367, 0.3701696396, -0.0708192587, -0.3711777031, 0.0496200845, -0.0310727321, 0.2711123526, 0.1841754615, -0.1032496914, 0.1701689661, -0.0015586056, -0.2113312036, 0.1576529294, 0.3558748364, 0.0396363698, 0.2429689318, -0.4880299568, 0.2115792036, 0.0413328409, -0.3464725316, -0.4149975181, 0.0347523801, -0.2874717712, -0.550621748, 0.0943672508, 0.2539379895, 0.2913827598, 0.2167931944, 0.2211158276, 0.1762192398, -0.0184137765, -0.0822378919, -0.4449314475, -0.1094929129, 0.1820258647, -0.0668348819, 0.2814903855, 0.3015391231, 0.0567566343, -0.6469042897, 0.4162863791, -0.0154193584, 0.1333110482, -0.0414280742, 0.3924904466, 0.0089212237, 0.6352487803, -0.0670062602, -0.1997414529, 0.1173175573, -0.3723257482, 0.1516670287, -0.104178071, -0.206536904, -0.0788394287, -0.031902276, 0.0432046652, 0.2024581432, -0.0909034759, -0.1343252212, 0.271266073, -0.1845751107, -0.209910512, 0.1425682455, -0.0775696039, -0.1626154482, -0.5799484849, 0.3026263416, 0.0197172258, -0.1899345815, 0.0344839171, 0.0379856527, 0.2533740997, -0.1179474741, -0.0377238095, 0.1215902567, -0.2508455515, -0.1928156614, 0.6424356103, 0.0720800236, -0.1853333563, -0.5010787845, 0.1635935903, 0.4550586045, 0.1374625862, -0.1593978405, 0.0422651507, 0.3477855325, -0.3275404572, 0.4250099063, -0.1345339715, 0.0359939486, 0.0596401468, 0.084626548, -0.15955621, -0.2088911533, 0.0791566968, -0.1459157765, -0.0321507119, 0.0721165612, -0.1810095608, 0.1149875224, -0.0065550087, -0.3482497334, -0.0046556145, 0.2404880673, -0.0307824612, 0.0100293532, 0.0775884315, -0.1530270875, 0.3684749603, 0.1996846944, -0.153805241, -0.2296267152, -0.1705859452, -0.1761599332, 0.1038919166, 0.1313129365, -0.2240185738, 0.1574560702, 0.2851551175, -0.1116566807, -0.2977471054, -0.1965697408, -0.4191928804, 0.2730153799, -0.2794299126, -0.0117357261, -0.0167912953, 0.0561583042, -0.4519549012, -0.1189754307, -0.0843058228, -0.0798702538, 0.1432684213, -0.2832213342, -0.0262453109, 0.0633002445, -0.1149930954, 0.2100354135, 0.0624079704, 0.2334083915, -0.6038303971, 0.038408678, -0.4086798429, -0.2158354521, -0.4646938443, 0.2507136762, 0.0166679267, 0.0315376297, -0.4577504992, -0.4218870997, 0.0902841538, 0.0586623028, -0.1387367994, -0.0181442089, 0.2579155862, 0.0200826488, -0.2282145023, 0.2372670174, 0.0528728217, -0.0917409435, -0.1654133201, 0.1908504516, -0.2420122027, 0.3424965739, -0.1977432966, -0.3689600527, -0.0121997707, -0.1239929125, 0.1559953988, -0.3126057088, 0.0653306097, 0.1334223151, 0.1033990085, -0.1387469172, -0.0690941811, -0.0376080461, -0.1779904366, -0.1865133941, 0.3142644763, 0.3371856809, -0.3545957804, -0.3330664039, -0.183158353, -0.490752548, 0.5181806684, -0.1064134836, -0.0649665222, -0.0219288878, -0.0372574106, 0.1350488067, 0.4749003947, 0.1957833171, -0.0861118138, -0.0533938482, -0.2279219031, -0.1095680296, 0.3319779634, 0.0107252635, 0.2729145586, 0.0609411187, -0.0408686921, -0.2583758533, 0.7406026125, 0.249386847, -0.07727018, -0.0038319081, 0.146756649, 0.1696028411, 0.1052189544, -0.0348764472, 0.200017795, 0.1997404993, -0.3633257747, -0.0231818929, -0.0181914866, 0.1379130781, 0.2525856793, 0.1332002878, -0.120503135, -0.2060520649, 0.013361102, 0.2651363909, 0.2366912216, 0.0554274768, 0.1293676943, -0.1069729179, 0.0863466859, 0.1686655581, 0.0602950379, 0.1176762283, 0.2196998149, 0.3878765106, -0.3853282034, -0.5046998262, 0.2042443007, -0.0252880808, 0.3977496028, 0.2302017212, 0.0910199881, 0.4760734141, 0.2946365476, 1.2821092606, -0.1257204115, 0.2100655735, 0.2024419159, 0.0521937385, -0.2569008172, -0.3845193982, -0.3927998841, 0.1071789339, 0.2438452691, 0.3198536038, -0.1448897123, -0.3078739643, 0.3683766127, -0.0393613204, -0.0377903469, -0.5277109742, -0.3560357988, -0.364153415, 0.3309247196, 0.2116032094, 0.1023005322, 0.0373552218, -0.0724367946, -0.3457967043, -0.2657883465, 0.0430625826, 0.0285137445, -0.0076315366, 0.1817750335, -0.0545260124, 0.0753949955, 0.6259135604, 0.0040589105, 0.0351528823, 0.0407277048, -0.3378147483, 0.1058731452, 0.0830655396, -0.2505224943, 0.1562091112, 0.4710432291, -0.0778072104, -0.0682385713, -0.0047490299, 0.1829999983, -0.0190183576, -0.2835809588, 0.2942580581, 0.1262435615, -0.2307731956, -0.2612527013, 0.7115757465, -0.1999295652, -0.2380957603, -0.0338411368, 0.3728457391, -0.1944927871, 0.8509474397, 0.199422121, 1.1119365692, -0.2306785882, 0.1241328642, 0.0136605538, -0.0229495019, 0.423325032, -0.1478207111, 0.3599694371, -0.4168889821, -0.0745230913, -0.1267657876, -0.1625532508, -0.3965686262, 0.5001985431, -0.048585508, 0.3075246811, -0.0509979352, -0.0995346233, 0.1122647673, 0.0322757661, 0.4319415689, -0.1958490163, -0.3082027137, -0.0494013391, 0.2895001173, 0.4239197373, -0.1144876033, -0.1306634247, 0.060941264, -0.0434387848, -0.3266906738, -0.1706415713, 0.149587974, 0.313231051, 0.6839635372, -0.281319201, -0.0597471744, -0.129235208, 0.5940535069, -0.2949207723, -0.0975085497, -0.093280904, 0.2968192101, 0.044854816, 0.0878175348, -0.2085441351, 0.3264084756, 0.1658752114, -0.4087225795, -0.1181343645, 0.0887143165, 0.1004106998, -0.1945735067, 0.0399053767, -0.3729727864, -0.1658736467, 0.1346516311, 0.0667739511, 0.1419642419, -0.1279297769, -0.0285450127, 0.2953920066, -0.2502560318, 0.5640615821, 0.0565911084, -0.5724163055, 0.0212695729, 0.0987813175, 0.3291199207, 0.0724499971, 0.0501312427, 0.0008484125, -0.1735292524, -0.0331755802, -0.4581156671, 0.2036806941, -0.2213498354, 0.4114442468, 0.0110911466, -0.0499433726, 0.0116129369, -0.1267793626, 0.0472030975, -0.087239176, -0.670945406, -0.1352549195, -0.2030444443, -0.0041330233, 0.0396143906, 0.3588503897, -0.013322413, -0.1280948222, 0.0652357936, -0.3754580915, -0.1663907915, -0.3348734081, -0.2888956368, 0.2904345095, -0.2414187789, -0.0278274082, -0.1007801369, -0.0519360974, -0.0417563468, -0.0030182851, -0.2036741376, -0.0052226, 0.0491061434, 0.2304775566, 0.1264707893, 0.2335480601, -0.2158169746, 0.0247910172, -0.1576776505, -0.044103384, 0.1189127713, 0.6434120536, 0.1168074608, 0.2623490095, 0.2124278545, -0.1490015388, 0.0374214351, 0.17797786, 0.2131086439, 0.1592004597, 0.047037337, 0.395691067, -0.2537583411, -0.0300070494, -0.1442242712, 0.1031637564, -0.0178730898, 0.1729229242, 0.013255937, -0.1739441454, -0.1685117334, 0.1255564243, 0.1405683756, 0.2671737373, -0.2686235011, -0.3306469023, 0.100789465, 0.0750904754, -0.1332659721, -0.0001481362, 0.1461535096, 0.0295166895, -0.1004156321, 0.174688369, -0.0606291592, -0.2794895768, -0.0094925016, 0.1139696687, 0.4691478014, 0.0492527634, -0.4048436284, -0.282820642, 0.337328583, 0.1346958131, 0.2748318315, -0.0744078904, 0.2376716286, 0.6239994764, 0.0158931911, 0.0542860702, -0.1314184666, 0.2484115958, -0.3704627454, -0.1058533192, 0.3135045171, 0.5167593956, -0.3027833104, 0.0218013432, 0.2416454852, 0.2011869252, -0.0204312764, 0.1160018444, 0.0708290488, -0.2149724513, 0.0191194266, -0.0379172117, -0.0710587054, 0.2143708766, 0.0164967179, 0.1525221169, -0.0211423114, 0.1446316093, 0.1464314759, 0.1926599741, -0.02222725, -0.1095517725, -0.1289515495, 0.4419500828, 0.2132036686, 0.0392159596, -0.1258063018, -0.211379081, 0.1281358749, 0.241447106, 0.3575929999, 0.3136425316, 0.395290494, -0.1462367326, 0.2081688195, -0.1472527087, -0.1377400011, -0.1769447923, -0.0819484293, -0.2318560481, -0.091095835, -0.0467153452, 0.0268884823, 0.0375409797, -0.1590424776, -0.1036704779, 0.3495661914, -0.1056791395, 0.0548236631, 0.1510556042, -0.0851703361, -0.1924752444, 0.1248354614, -0.177525714, 0.2826811075, 0.2329523861, -0.119428277, 0.1866092235, 0.1175414696, -0.0125524048, -0.2626388669, 0.1983686686, 0.3687410951, 0.3809482753, -0.1608273983, 0.2081637979, -0.2221241742, 0.05552724, -0.0466013215, 0.2873368859, 0.3420757651, 0.3129172921, -0.3188912868, -0.1757491678, 0.4365795851, 0.4873604178, -0.0404291414, 0.5094993711, 0.1159964055, -0.0109987073, -0.3908466697, -0.0488446616, 0.0390698984, -0.2555008531, 0.3060808182, 0.2037489414, -0.0464076474, -0.0006296057, 0.1717253625, 0.166302681, -0.2835231423, 0.2716400623, 0.2651444077, -0.0683029145, -0.0019564778, 0.1600390971, -0.4410413206, -0.1277184635, -0.4847533107, -0.1873938292, -0.1983328313, -0.0594112091, -0.2815758288, -0.326552093, -0.111598134, 0.2839324772, 0.2401637584, 0.0392764695, -0.1936524212, 0.3200107813, -0.4926872551, 0.0414744169, -0.061620336, -0.0019817259, 0.261730969, -0.0137673318, -0.3590407372, -0.3816454411, 0.5597444773, -0.33553496, -0.314910531, -0.4205091894, 0.4017614424, 0.3072031438, 0.1281176805, -0.6617912054, -0.1746369898, 0.1516131461, 0.0570144914, -0.3895004094, -0.4049232304, 0.2210482657, 0.0872345194, -0.1423765123, -0.3343045413, 0.481069386, 0.0113400146, 0.171756506, -0.3487360477 ]
https://github.com/huggingface/datasets/issues/2170
Wikipedia historic dumps are deleted but hf/datasets hardcodes dump date
It seems that this can be fixed from user's end by including a `date` argument, like this: `dataset = datasets.load_dataset('wikipedia', '20200501.en', date='20210420')` You can get available dates from [here](https://dumps.wikimedia.org/enwiki/). This is not a proper fix however as all the files will still have '20200501' in their file names.
Wikimedia does not keep all historical dumps. For example, as of today https://dumps.wikimedia.org/kowiki/ only provides ``` 20201220/ 02-Feb-2021 01:36 - 20210101/ 21-Feb-2021 01:26 - 20210120/ 02-Mar-2021 01:25 - 20210201/ 21-Mar-2021 01:26 - 20210220/ 02-Apr-2021 01:26 - 20210301/ 03-Mar-2021 08:10 - 20210320/ 21-Mar-2021 18:13 - 20210401/ 03-Apr-2021 10:08 - latest/ 03-Apr-2021 10:08 - ``` However, the wikipedia dataset provided in the library, only supports the following configs, none of which are applicable anymore when disregarding the cached datasets: ``` ValueError: BuilderConfig 20210401.ko not found. Available: ['20200501.aa', '20200501.ab', '20200501.ace', '20200501.ady', '20200501.af', '20200501.ak', '20200501.als', '20200501.am', '20200501.an', '20200501.ang', '20200501.ar', '20200501.arc', '20200501.arz', '20200501.as', '20200501.ast', '20200501.atj', '20200501.av', '20200501.ay', '20200501.az', '20200501.azb', '20200501.ba', '20200501.bar', '20200501.bat-smg', '20200501.bcl', '20200501.be', '20200501.be-x-old', '20200501.bg', '20200501.bh', '20200501.bi', '20200501.bjn', '20200501.bm', '20200501.bn', '20200501.bo', '20200501.bpy', '20200501.br', '20200501.bs', '20200501.bug', '20200501.bxr', '20200501.ca', '20200501.cbk-zam', '20200501.cdo', '20200501.ce', '20200501.ceb', '20200501.ch', '20200501.cho', '20200501.chr', '20200501.chy', '20200501.ckb', '20200501.co', '20200501.cr', '20200501.crh', '20200501.cs', '20200501.csb', '20200501.cu', '20200501.cv', '20200501.cy', '20200501.da', '20200501.de', '20200501.din', '20200501.diq', '20200501.dsb', '20200501.dty', '20200501.dv', '20200501.dz', '20200501.ee', '20200501.el', '20200501.eml', '20200501.en', '20200501.eo', '20200501.es', '20200501.et', '20200501.eu', '20200501.ext', '20200501.fa', '20200501.ff', '20200501.fi', '20200501.fiu-vro', '20200501.fj', '20200501.fo', '20200501.fr', '20200501.frp', '20200501.frr', '20200501.fur', '20200501.fy', '20200501.ga', '20200501.gag', '20200501.gan', '20200501.gd', '20200501.gl', '20200501.glk', '20200501.gn', '20200501.gom', '20200501.gor', '20200501.got', '20200501.gu', '20200501.gv', '20200501.ha', '20200501.hak', '20200501.haw', '20200501.he', '20200501.hi', '20200501.hif', '20200501.ho', '20200501.hr', '20200501.hsb', '20200501.ht', '20200501.hu', '20200501.hy', '20200501.ia', '20200501.id', '20200501.ie', '20200501.ig', '20200501.ii', '20200501.ik', '20200501.ilo', '20200501.inh', '20200501.io', '20200501.is', '20200501.it', '20200501.iu', '20200501.ja', '20200501.jam', '20200501.jbo', '20200501.jv', '20200501.ka', '20200501.kaa', '20200501.kab', '20200501.kbd', '20200501.kbp', '20200501.kg', '20200501.ki', '20200501.kj', '20200501.kk', '20200501.kl', '20200501.km', '20200501.kn', '20200501.ko', '20200501.koi', '20200501.krc', '20200501.ks', '20200501.ksh', '20200501.ku', '20200501.kv', '20200501.kw', '20200501.ky', '20200501.la', '20200501.lad', '20200501.lb', '20200501.lbe', '20200501.lez', '20200501.lfn', '20200501.lg', '20200501.li', '20200501.lij', '20200501.lmo', '20200501.ln', '20200501.lo', '20200501.lrc', '20200501.lt', '20200501.ltg', '20200501.lv', '20200501.mai', '20200501.map-bms', '20200501.mdf', '20200501.mg', '20200501.mh', '20200501.mhr', '20200501.mi', '20200501.min', '20200501.mk', '20200501.ml', '20200501.mn', '20200501.mr', '20200501.mrj', '20200501.ms', '20200501.mt', '20200501.mus', '20200501.mwl', '20200501.my', '20200501.myv', '20200501.mzn', '20200501.na', '20200501.nah', '20200501.nap', '20200501.nds', '20200501.nds-nl', '20200501.ne', '20200501.new', '20200501.ng', '20200501.nl', '20200501.nn', '20200501.no', '20200501.nov', '20200501.nrm', '20200501.nso', '20200501.nv', '20200501.ny', '20200501.oc', '20200501.olo', '20200501.om', '20200501.or', '20200501.os', '20200501.pa', '20200501.pag', '20200501.pam', '20200501.pap', '20200501.pcd', '20200501.pdc', '20200501.pfl', '20200501.pi', '20200501.pih', '20200501.pl', '20200501.pms', '20200501.pnb', '20200501.pnt', '20200501.ps', '20200501.pt', '20200501.qu', '20200501.rm', '20200501.rmy', '20200501.rn', '20200501.ro', '20200501.roa-rup', '20200501.roa-tara', '20200501.ru', '20200501.rue', '20200501.rw', '20200501.sa', '20200501.sah', '20200501.sat', '20200501.sc', '20200501.scn', '20200501.sco', '20200501.sd', '20200501.se', '20200501.sg', '20200501.sh', '20200501.si', '20200501.simple', '20200501.sk', '20200501.sl', '20200501.sm', '20200501.sn', '20200501.so', '20200501.sq', '20200501.sr', '20200501.srn', '20200501.ss', '20200501.st', '20200501.stq', '20200501.su', '20200501.sv', '20200501.sw', '20200501.szl', '20200501.ta', '20200501.tcy', '20200501.te', '20200501.tet', '20200501.tg', '20200501.th', '20200501.ti', '20200501.tk', '20200501.tl', '20200501.tn', '20200501.to', '20200501.tpi', '20200501.tr', '20200501.ts', '20200501.tt', '20200501.tum', '20200501.tw', '20200501.ty', '20200501.tyv', '20200501.udm', '20200501.ug', '20200501.uk', '20200501.ur', '20200501.uz', '20200501.ve', '20200501.vec', '20200501.vep', '20200501.vi', '20200501.vls', '20200501.vo', '20200501.wa', '20200501.war', '20200501.wo', '20200501.wuu', '20200501.xal', '20200501.xh', '20200501.xmf', '20200501.yi', '20200501.yo', '20200501.za', '20200501.zea', '20200501.zh', '20200501.zh-classical', '20200501.zh-min-nan', '20200501.zh-yue', '20200501.zu'] ``` The cached datasets: ``` % aws s3 --no-sign-request --endpoint-url https://storage.googleapis.com ls s3://huggingface-nlp/cache/datasets/wikipedia/ PRE 20200501.de/ PRE 20200501.en/ PRE 20200501.fr/ PRE 20200501.frr/ PRE 20200501.it/ PRE 20200501.simple/ ```
48
Wikipedia historic dumps are deleted but hf/datasets hardcodes dump date Wikimedia does not keep all historical dumps. For example, as of today https://dumps.wikimedia.org/kowiki/ only provides ``` 20201220/ 02-Feb-2021 01:36 - 20210101/ 21-Feb-2021 01:26 - 20210120/ 02-Mar-2021 01:25 - 20210201/ 21-Mar-2021 01:26 - 20210220/ 02-Apr-2021 01:26 - 20210301/ 03-Mar-2021 08:10 - 20210320/ 21-Mar-2021 18:13 - 20210401/ 03-Apr-2021 10:08 - latest/ 03-Apr-2021 10:08 - ``` However, the wikipedia dataset provided in the library, only supports the following configs, none of which are applicable anymore when disregarding the cached datasets: ``` ValueError: BuilderConfig 20210401.ko not found. Available: ['20200501.aa', '20200501.ab', '20200501.ace', '20200501.ady', '20200501.af', '20200501.ak', '20200501.als', '20200501.am', '20200501.an', '20200501.ang', '20200501.ar', '20200501.arc', '20200501.arz', '20200501.as', '20200501.ast', '20200501.atj', '20200501.av', '20200501.ay', '20200501.az', '20200501.azb', '20200501.ba', '20200501.bar', '20200501.bat-smg', '20200501.bcl', '20200501.be', '20200501.be-x-old', '20200501.bg', '20200501.bh', '20200501.bi', '20200501.bjn', '20200501.bm', '20200501.bn', '20200501.bo', '20200501.bpy', '20200501.br', '20200501.bs', '20200501.bug', '20200501.bxr', '20200501.ca', '20200501.cbk-zam', '20200501.cdo', '20200501.ce', '20200501.ceb', '20200501.ch', '20200501.cho', '20200501.chr', '20200501.chy', '20200501.ckb', '20200501.co', '20200501.cr', '20200501.crh', '20200501.cs', '20200501.csb', '20200501.cu', '20200501.cv', '20200501.cy', '20200501.da', '20200501.de', '20200501.din', '20200501.diq', '20200501.dsb', '20200501.dty', '20200501.dv', '20200501.dz', '20200501.ee', '20200501.el', '20200501.eml', '20200501.en', '20200501.eo', '20200501.es', '20200501.et', '20200501.eu', '20200501.ext', '20200501.fa', '20200501.ff', '20200501.fi', '20200501.fiu-vro', '20200501.fj', '20200501.fo', '20200501.fr', '20200501.frp', '20200501.frr', '20200501.fur', '20200501.fy', '20200501.ga', '20200501.gag', '20200501.gan', '20200501.gd', '20200501.gl', '20200501.glk', '20200501.gn', '20200501.gom', '20200501.gor', '20200501.got', '20200501.gu', '20200501.gv', '20200501.ha', '20200501.hak', '20200501.haw', '20200501.he', '20200501.hi', '20200501.hif', '20200501.ho', '20200501.hr', '20200501.hsb', '20200501.ht', '20200501.hu', '20200501.hy', '20200501.ia', '20200501.id', '20200501.ie', '20200501.ig', '20200501.ii', '20200501.ik', '20200501.ilo', '20200501.inh', '20200501.io', '20200501.is', '20200501.it', '20200501.iu', '20200501.ja', '20200501.jam', '20200501.jbo', '20200501.jv', '20200501.ka', '20200501.kaa', '20200501.kab', '20200501.kbd', '20200501.kbp', '20200501.kg', '20200501.ki', '20200501.kj', '20200501.kk', '20200501.kl', '20200501.km', '20200501.kn', '20200501.ko', '20200501.koi', '20200501.krc', '20200501.ks', '20200501.ksh', '20200501.ku', '20200501.kv', '20200501.kw', '20200501.ky', '20200501.la', '20200501.lad', '20200501.lb', '20200501.lbe', '20200501.lez', '20200501.lfn', '20200501.lg', '20200501.li', '20200501.lij', '20200501.lmo', '20200501.ln', '20200501.lo', '20200501.lrc', '20200501.lt', '20200501.ltg', '20200501.lv', '20200501.mai', '20200501.map-bms', '20200501.mdf', '20200501.mg', '20200501.mh', '20200501.mhr', '20200501.mi', '20200501.min', '20200501.mk', '20200501.ml', '20200501.mn', '20200501.mr', '20200501.mrj', '20200501.ms', '20200501.mt', '20200501.mus', '20200501.mwl', '20200501.my', '20200501.myv', '20200501.mzn', '20200501.na', '20200501.nah', '20200501.nap', '20200501.nds', '20200501.nds-nl', '20200501.ne', '20200501.new', '20200501.ng', '20200501.nl', '20200501.nn', '20200501.no', '20200501.nov', '20200501.nrm', '20200501.nso', '20200501.nv', '20200501.ny', '20200501.oc', '20200501.olo', '20200501.om', '20200501.or', '20200501.os', '20200501.pa', '20200501.pag', '20200501.pam', '20200501.pap', '20200501.pcd', '20200501.pdc', '20200501.pfl', '20200501.pi', '20200501.pih', '20200501.pl', '20200501.pms', '20200501.pnb', '20200501.pnt', '20200501.ps', '20200501.pt', '20200501.qu', '20200501.rm', '20200501.rmy', '20200501.rn', '20200501.ro', '20200501.roa-rup', '20200501.roa-tara', '20200501.ru', '20200501.rue', '20200501.rw', '20200501.sa', '20200501.sah', '20200501.sat', '20200501.sc', '20200501.scn', '20200501.sco', '20200501.sd', '20200501.se', '20200501.sg', '20200501.sh', '20200501.si', '20200501.simple', '20200501.sk', '20200501.sl', '20200501.sm', '20200501.sn', '20200501.so', '20200501.sq', '20200501.sr', '20200501.srn', '20200501.ss', '20200501.st', '20200501.stq', '20200501.su', '20200501.sv', '20200501.sw', '20200501.szl', '20200501.ta', '20200501.tcy', '20200501.te', '20200501.tet', '20200501.tg', '20200501.th', '20200501.ti', '20200501.tk', '20200501.tl', '20200501.tn', '20200501.to', '20200501.tpi', '20200501.tr', '20200501.ts', '20200501.tt', '20200501.tum', '20200501.tw', '20200501.ty', '20200501.tyv', '20200501.udm', '20200501.ug', '20200501.uk', '20200501.ur', '20200501.uz', '20200501.ve', '20200501.vec', '20200501.vep', '20200501.vi', '20200501.vls', '20200501.vo', '20200501.wa', '20200501.war', '20200501.wo', '20200501.wuu', '20200501.xal', '20200501.xh', '20200501.xmf', '20200501.yi', '20200501.yo', '20200501.za', '20200501.zea', '20200501.zh', '20200501.zh-classical', '20200501.zh-min-nan', '20200501.zh-yue', '20200501.zu'] ``` The cached datasets: ``` % aws s3 --no-sign-request --endpoint-url https://storage.googleapis.com ls s3://huggingface-nlp/cache/datasets/wikipedia/ PRE 20200501.de/ PRE 20200501.en/ PRE 20200501.fr/ PRE 20200501.frr/ PRE 20200501.it/ PRE 20200501.simple/ ``` It seems that this can be fixed from user's end by including a `date` argument, like this: `dataset = datasets.load_dataset('wikipedia', '20200501.en', date='20210420')` You can get available dates from [here](https://dumps.wikimedia.org/enwiki/). This is not a proper fix however as all the files will still have '20200501' in their file names.
[ -0.0480471216, 0.3399817348, -0.0221922845, 0.0315803811, -0.3193787932, 0.1565128118, 0.3078282475, 0.5392647982, 0.1764219701, 0.1010855809, -0.0753564164, 0.0723983124, 0.2024513185, -0.2449926138, -0.1113701016, -0.1828335524, 0.0309122838, 0.0772669017, -0.1100764722, -0.2934592962, -0.1943480372, 0.1416634768, -0.2975396812, -0.1001332626, -0.1351926625, 0.1282681227, -0.1212267578, -0.1731771976, -0.236763522, -0.2825134099, 0.2279287875, 0.2149960101, 0.2150950432, 0.2445409298, -0.00011261, -0.0224171728, 0.4396786988, -0.0729154721, -0.6998186707, 0.3375675082, -0.4934144616, -0.2081644535, -0.2113407105, -0.280338347, 0.0249620155, 0.0599011779, 0.152305454, -0.0141651779, 0.2861969173, 0.1448764503, 0.2360974401, -0.0227915943, 0.2254754454, -0.1685296595, 0.3714101315, 0.3139842749, -0.1705526114, -0.1458381414, -0.3366080225, -0.0145524032, -0.0803971142, 0.5216308236, -0.0483498611, -0.23899813, 0.1012655795, -0.1834847331, -0.1664307564, -0.1672368199, 0.4476557374, 0.3567124903, 0.5580336452, -0.1420493722, -0.1736140549, 0.0477033854, -0.2691884637, -0.311994493, 0.3322286606, 0.1879582405, -0.0743199438, 0.0867362618, 0.0434377603, -0.1867391318, -0.1235559285, 0.4326097667, -0.2945712805, 0.6903672218, 0.0475941487, -0.0200516731, -0.2650397718, -0.0862205625, -0.0129313506, -0.3165673316, 0.0335619636, 0.3412550092, 0.1046114713, -0.1992750615, -0.0340662226, 0.1706593782, 0.1952960342, -0.229850933, -0.1247054636, 0.1728710532, 0.143699497, -0.0844557881, 0.2835513353, -0.2561605275, 0.2181192786, 0.1479283571, 0.488219738, 0.3513468802, -0.1992552876, -0.0234840363, 0.3428488374, 0.0529371351, -0.0747674778, -0.1216736436, 0.1743233204, -0.3396594524, 0.1949047744, 0.1505918652, 0.1067214161, -0.3127459288, -0.3135461211, 0.3275849819, -0.1723529994, 0.0550005436, -0.0030669719, -0.182092756, -0.1246299148, -0.1386280358, -0.1526300758, -0.0057442226, 0.1183301359, 0.1284079254, 0.2885450423, -0.1358130723, 0.3161965907, 0.2317121923, -0.0991329402, 0.1145831943, -0.1741474718, 0.0152746178, 0.2022370696, 0.3797017038, 0.0382674485, 0.1678477228, -0.1536103189, -0.2450581938, -0.3076086044, -0.0909031034, -0.269233644, 0.0034934655, -0.3159882724, 0.2036645114, 0.1309013963, 0.0235929061, 0.0376101099, 0.1419022083, 0.1953945756, -0.2002361864, 0.0092893504, -0.0318654701, -0.0295627192, -0.1204091609, 0.2662153244, 0.1527356505, -0.1783030033, -0.1148425862, -0.0741789415, 0.3705840111, 0.1859222502, 0.1107273623, -0.0983730257, 0.0929736719, -0.1122709289, -0.2385082543, 0.2569865286, -0.0488515422, -0.2477297634, -0.1422874629, 0.5185168982, 0.1292575002, -0.0351006426, -0.188984111, 0.5140382051, -0.2660748959, 0.0054181069, 0.1362959445, 0.1500755399, -0.0966951251, -0.1010833159, -0.332380712, 0.0940829739, -0.1349019259, 0.5809414387, -0.0463305973, 0.3364215493, 0.6471559405, 0.3777391613, 0.0675282776, 0.2076513767, 0.3722667098, -0.1182641089, -0.0895939022, 0.2840394676, -0.219519943, -0.3384566307, 0.2157476246, -0.1119538248, 0.1423027515, 0.0572792217, -0.2991662025, -0.2290911674, 0.0036073998, -0.1578155011, -0.1922060698, 0.2709795833, 0.1160457209, 0.2696569562, 0.3821339309, 0.0707483888, -0.2911678851, -0.0803749487, 0.0224435776, -0.1743049622, 0.2483406067, -0.3143910468, 0.0948142633, 0.0104763433, 0.162997216, 0.262475729, 0.0467960685, 0.1376545876, -0.1132879183, 0.1075479463, 0.1248567998, -0.0343469158, 0.0228775963, 0.2571223676, -0.2377165407, 0.1016274691, 0.3862405419, -0.0660330057, -0.1089656726, -0.3348833323, 0.2010371387, 0.3396967649, -0.0081818663, -0.0962738991, -0.0002624169, 0.2850742936, -0.0728483796, 0.1175118163, -0.4912269711, -0.1852971762, 0.2930184305, -0.1906877905, 0.0877470151, -0.0946010351, 0.2002780735, 0.6361350417, -0.0283582918, 0.0360683426, 0.3035475612, -0.3020720184, -0.3853172362, 0.3101590574, -0.1874303967, -0.3706720173, 0.1790654361, 0.2985034883, -0.1842731386, -0.1911590695, -0.1008625031, 0.3368107975, 0.0546804033, 0.2021882534, 0.0554029942, 0.3110337853, 0.2944015265, -0.3105646372, 0.1880520284, -0.1699731946, 0.0856259167, -0.0013884902, -0.0112572722, -0.5644825697, 0.0784607828, 0.1482223868, -0.097054258, -0.5503886938, -0.6236143112, 0.2578139901, 0.0797466189, -0.1217809618, 0.1836832166, -0.299144417, 0.2259610444, 0.1115835607, 0.2293132395, -0.3595902324, -0.3663405478, -0.1580594778, 0.0799811035, 0.026751589, -0.1627448797, 0.2104153037, -0.1402297467, -0.5127971172, -0.4433472157, -0.6245267391, 0.3214213252, -0.0778713673, -0.0595681667, 0.1482470185, 0.2876191139, 0.0446178317, -0.3598257005, -0.0445624702, -0.0845203772, -0.0961180329, -0.1044833511, -0.340677917, 0.2404455692, -0.0595719591, 0.1670762002, -0.1340947747, -0.1953469664, -0.1555749625, 0.4140327275, 0.0772173703, 0.2195168138, -0.085067153, -0.3220019639, 0.0055809729, 0.2086000592, -0.4126557112, -0.3447986245, 0.500190258, -0.329472363, -0.3419500589, 0.1693865806, -0.070169054, -0.0787321627, 0.0163808763, -0.4505987167, 0.1796370149, 0.0271936711, 0.3788496554, 0.3891838789, -0.026035076, 0.2755756974, 0.0348581001, -0.0446544886, -0.0865289271, 0.0076210424, -0.1113865376, -0.0580644123, 0.3612661362, 0.1532100886, 0.0982783139, 0.0466851145, 0.9649458528, 0.1296076328, 0.1752608567, 0.2703439593, 0.0933701992, 0.4229115844, -0.2968418598, 0.0313477218, 0.0888590962, 0.0506779701, 0.1441744268, 0.2668757141, 0.1142917275, -0.3368980885, 0.0401474833, -0.0561868921, -0.1404114515, -0.4507346451, -0.2183958143, 0.1395623833, 0.1739776731, 0.220825702, 0.1641783714, -0.318121016, -0.4052609801, 0.3040076792, 0.1644185185, 0.0470860638, 0.1440109462, -0.2075384259, 0.1267813444, -0.5879552364, 0.1699390411, -0.0450910293, 0.0630303025, -0.1274252236, 0.0217734501, -0.0962824821, 0.0595286749, -0.0420546606, -0.2388564199, 0.2718630433, 0.2691739798, 0.0239771008, -0.1405696571, 0.0205693841, -0.0479290374, 0.1030629352, 0.2742249668, 0.2927269936, -0.3884566128, -0.133947432, 0.4520693421, 0.314945668, -0.1313463449, 0.0320048667, 0.1103868932, -0.1165560782, -0.193027705, -0.3179682195, 0.0428571329, 0.148812905, -0.2054593116, 0.101059705, -0.2121364474, 0.0956855267, -0.0005829372, -0.0347555913, 0.1180447191, 0.3438923359, -0.0756224915, -0.0243574809, 0.2225073576, 0.1363648623, -0.0072101224, 0.0231025964, -0.003798984, -0.121556744, -0.2037763596, -0.0587101877, 0.1997335255, -0.0520161651, 0.0165817887, -0.0443900302, 0.0522498004, -0.102755785, -0.2034796178, -0.1904216856, -0.0853030384, -0.3912638724, 0.0338614658, 0.4699324071, -0.0343347006, 0.0513625294, 0.3707816899, 0.2155039459, -0.4664892554, 0.3854548037, 0.2939127684, 0.8347734213, 0.1898766607, 0.1881595552, 0.1820243001, 0.1101785898, 0.3675715625, 0.0527270213, 0.05215431, -0.1155318916, 0.0753993914, -0.0228813104, 0.3158734441, -0.0470615216, -0.2119177878, -0.1470106542, 0.3688454926, -0.115637742, 0.4955005944, -0.0295316055, 0.1209017783, 0.0672803968, -0.1079186648, -0.230971843, 0.1545196176, 0.1146319658, 0.2068965584, -0.1153966188, -0.0914431363, 0.289585948, -0.1751038432, -0.4062292874, -0.0956726223, 0.0261746831, 0.3426240087, -0.0390424877, -0.2834786177, -0.22383672, 0.3323228061, 0.2916025221, 0.0975845754, -0.060242936, 0.1861875802, -0.2744442523, -0.2148989737, -0.1029838696, 0.1444681436, 0.0479052216, -0.1917315722, -0.0940221623, 0.2343392968, -0.2672804594, -0.3892903924, -0.1091277301, -0.0915105492, -0.1745404303, 0.3141996264, -0.0561187491, -0.0780313015, -0.1603641957, -0.4524392784, 0.158275038, -0.1562495828, 0.269826442, 0.0558286235, -0.0296713095, -0.1778580397, -0.2163667083, 0.3298387825, 0.0466850363, 0.1715166569, 0.6110987663, 0.2423768193, -0.331379056, -0.1585519016, -0.1488045752, -0.3503171504, -0.12262059, 0.0027603805, -0.4130460918, 0.0118890405, -0.1797312051, 0.3767563403, 0.0177584775, -0.2951874435, -0.1263603121, -0.3745443523, -0.028724961, 0.2725763023, -0.1091433018, 0.0510797277, 0.1647902429, -0.0170253292, -0.1053793207, 0.1381779164, -0.3056142032, 0.0877613723, 0.0292149186, 0.1146587133, -0.2499314994, -0.037622679, -0.1758766323, -0.0679048672, 0.1059220955, -0.1951121241, 0.0084634311, -0.2114463151, -0.2095864117, 0.1348882169, -0.023482101, -0.0472015366, -0.0292447638, -0.1437856853, -0.0996538401, -0.2585891485, 0.0201121718, 0.0672351718, 0.0766697973, 0.2918258011, 0.3037974834, 0.045949094, 0.0538116097, 0.0972010419, 0.1759545654, 0.5515086055, 0.0319134705, 0.3699145317, -0.0455831997, -0.1020634621, -0.1002442986, 0.2322753221, -0.5310226679, -0.1332033575, 0.6618323922, -0.0191819742, -0.1777710021, 0.5489701033, 0.0790044963, -0.0890683606, -0.0443040542, -0.1241977066, -0.0672599226, 0.2155483365, -0.4151812792, -0.1710609347, 0.3353057206, 0.0469871014, 0.1376530379, 0.0936237201, 0.2512539029, -0.4399033189, 0.2132671475, 0.2694577277, 0.0880520493, -0.2221905291, 0.3708510101, 0.2173082232, 0.1169305593, 0.2881012559, -0.0560479686, 0.1715090424, -0.0184213035, -0.0354766473, 0.2547603846, 0.1002270058, 0.3619261086, 0.0141448509, 0.2070836425, -0.2588257194, 0.3600997925, 0.2614312768, -0.0748909712, 0.1805956662, 0.2045030594, -0.4046831429, 0.3852646053, 0.0291205719, -0.3738872707, 0.2746956944, -0.1384234428, -0.2239901721, -0.2610628903, -0.2730078101, 0.2544858754, 0.0904905498, 0.1310507655, -0.3175445795, 0.2628815174, 0.0146094523, -0.1453614831, -0.2687106431, 0.6404506564, -0.1838210821, 0.3839748204, -0.1375796646, 0.0341052115, -0.0687106103, -0.0616260692, 0.0359618217, 0.0860250965, 0.2202850431, -0.1411448121, -0.1487488449, 0.0484410748, -0.0286181457, -0.1927866489, -0.1696992517, 0.0362558477, 0.0899393186, -0.2654728293, 0.3961622119, 0.1518196762, -0.11176534, -0.5383559465, 0.2200964391, 0.1398580372, 0.0246105716, -0.2256582677, 0.0294111036, -0.192450732, 0.3682512939, 0.025192216, -0.0331527293, -0.0186045468, 0.1754933596, 0.0818286538, 0.3540490866, -0.1348264068, 0.1112554893, 0.0014081132, 0.2195780575, 0.3295510411, -0.3024103045, 0.0246561393, -0.3585801125, -0.2694028616, -0.1162964851, -0.4224756956, -0.1305840909, 0.3918167949, 0.3565282226, 0.1863861829, -0.0947758034, 0.2788999081, -0.2075874805, 0.0550673679, -0.0140287615, -0.305595696, 0.0359516665, 0.172183767, 0.1491938531, -0.2695626616, -0.4008758068, 0.3634433448, -0.1732612103, 0.0856611133, -0.0778291076, 0.071133472, 0.2079634964, 0.0433588177, -0.0263939053, 0.2128431052, -0.0716940984, -0.2881034911, -0.3227165341, -0.1422347128, 0.1642451286, 0.0366430432, 0.1561230123, -0.3485835195, 0.2843595147, -0.0423893146, -0.1827992201, -0.0463383868, 0.7152366042, -0.0573210344, 0.1616109014, -0.2237078846, 0.0877657458, -0.0971618444, 0.1019454598, 0.2723843455, 0.1690088511, -0.1890597939, 0.112948902, -0.0942371115, -0.509919703, 0.0974453539, -0.4027142823, -0.4580302238, -0.3972792625, -0.064022623, 0.0765794888, 0.1758396327, -0.2468997836, 0.0494570583, 0.3798079491, -0.2447844446, 0.0399643257, 0.0038365573, -0.0131431967, 0.1720323116, -0.088393949, 0.2015588433, 0.0890824348, -0.4260408878, -0.525103569, -0.2948700786 ]
https://github.com/huggingface/datasets/issues/2166
Regarding Test Sets for the GEM datasets
Hi @vyraun ! The test references for CommonGen are not publicly available: you can reach out to the original dataset authors if you would like to ask for them, but we will not be releasing them as part of GEM (March 31st was the release date for the test set inputs, references are incidentally released for some of the test sets but shouldn't really be used for benchmark submissions) cc @sebastiangehrmann
@yjernite Hi, are the test sets for the GEM datasets scheduled to be [added soon](https://gem-benchmark.com/shared_task)? e.g. ``` from datasets import load_dataset DATASET_NAME="common_gen" data = load_dataset("gem", DATASET_NAME) ``` The test set doesn't have the target or references. ``` data['test'][0] {'concept_set_id': 0, 'concepts': ['drill', 'field', 'run', 'team'], 'gem_id': 'common_gen-test-0', 'gem_parent_id': 'common_gen-test-0', 'references': [], 'target': ''} ```
71
Regarding Test Sets for the GEM datasets @yjernite Hi, are the test sets for the GEM datasets scheduled to be [added soon](https://gem-benchmark.com/shared_task)? e.g. ``` from datasets import load_dataset DATASET_NAME="common_gen" data = load_dataset("gem", DATASET_NAME) ``` The test set doesn't have the target or references. ``` data['test'][0] {'concept_set_id': 0, 'concepts': ['drill', 'field', 'run', 'team'], 'gem_id': 'common_gen-test-0', 'gem_parent_id': 'common_gen-test-0', 'references': [], 'target': ''} ``` Hi @vyraun ! The test references for CommonGen are not publicly available: you can reach out to the original dataset authors if you would like to ask for them, but we will not be releasing them as part of GEM (March 31st was the release date for the test set inputs, references are incidentally released for some of the test sets but shouldn't really be used for benchmark submissions) cc @sebastiangehrmann
[ -0.3199132681, -0.0961246714, -0.1973160505, 0.1844350994, -0.0919597894, 0.1184664369, 0.2837320864, 0.3940261006, -0.1052864045, -0.0161253959, 0.1892586052, 0.2699713409, -0.3344813585, 0.129402563, -0.0042844657, 0.2062070519, 0.0137713403, 0.0532649979, -0.1366807222, -0.182785362, -0.0030422062, 0.278280735, -0.1043489948, 0.0674216822, -0.4564502537, -0.2105980366, -0.1491962075, 0.1274921298, -0.0292935651, -0.2702156603, 0.3068472743, 0.1725852489, -0.1328511536, 0.4753211737, -0.0001048454, -0.0924757645, 0.2723984718, -0.1354856789, -0.2651568055, -0.3887259662, -0.3688611388, -0.099573642, -0.0375090837, -0.1074555144, -0.1079826057, -0.0469905883, -0.1061157063, -0.4838302433, 0.0354258493, 0.2401733696, 0.2840695083, 0.3282463551, -0.0739155412, -0.2256852686, 0.1541749537, -0.2887514234, -0.2577032447, 0.237208426, 0.0459526367, 0.0304733366, 0.2049222887, 0.1084310263, 0.06876605, 0.1535716653, 0.1378135979, 0.1191931218, -0.0138435252, -0.3732495904, -0.1442778409, 0.24804461, 0.6280164719, -0.3502284288, -0.481459558, -0.156306535, -0.2806763649, -0.0516629741, 0.0232109353, 0.2364028394, -0.1203914285, 0.1719744802, -0.3285426497, -0.3881804347, 0.0009274185, -0.2865283787, 0.1206909865, 0.058967784, -0.0700024515, -0.1194068342, -0.059966553, -0.0071772928, -0.1204124987, -0.1025009602, -0.1917670071, 0.0383689702, -0.3621033132, -0.4651755691, -0.1759569347, -0.1125510186, 0.3332555294, 0.4292493463, 0.5199066401, 0.1588802189, -0.181833759, 0.150222823, 0.34334144, 0.1893130988, 0.3401162326, -0.1188675389, 0.1506561339, -0.0951436833, -0.1557402909, 0.2906402349, -0.0817786977, -0.1565800458, -0.0089307502, 0.1021690071, 0.0856286436, -0.1682281196, -0.2093772143, 0.1630990654, 0.2056975961, -0.2603710592, -0.1541116536, 0.1218303144, -0.0569119602, -0.1605733335, -0.3958007991, 0.1040323228, -0.1188625246, -0.3285265565, -0.1978199184, 0.0562762879, 0.0054479241, 0.0675541386, 0.1492600143, -0.2012848258, 0.4375043511, -0.0745781958, 0.2316792011, -0.0567056239, 0.3254746497, -0.0189853385, 0.0689289421, 0.2251048833, -0.0693523288, 0.2178827226, -0.0323819928, -0.1107462123, -0.3100336492, 0.3561432362, -0.1294672191, -0.1646641046, 0.3178629875, 0.2424751371, -0.6210733652, -0.2433422804, -0.3021160066, 0.4153852463, -0.0981872529, -0.204107374, -0.0203389265, -0.1193991676, 0.0682355165, -0.2143629193, 0.3045639992, 0.1103174537, -0.1111435592, -0.0800723955, 0.2217066288, -0.0407886282, 0.0517827086, 0.0540543646, -0.0427650884, -0.2430046052, -0.0572341308, 0.1736017168, 0.3769559264, -0.1589792669, -0.1349398941, -0.033157181, -0.2171144783, -0.1006628051, 0.1498169005, -0.0805036947, 0.1672935337, -0.1374399066, -0.1856813431, 0.1218450665, -0.2028915584, 0.0184544846, -0.4238103032, -0.2053614557, 0.3437218666, -0.0682143867, 0.0103603872, -0.2939471602, 0.0078067929, 0.015528053, 0.136207819, 0.1302016526, -0.1227961257, 0.2104590386, 0.1868477166, -0.3276838362, 0.0944223255, -0.0963009894, -0.1995021254, 0.3398899138, 0.3615365028, 0.1620859504, 0.6675425768, -0.1309025884, -0.3988662958, 0.1048483104, -0.1167535484, -0.2448289692, 0.1276991069, 0.0224813297, 0.0640119165, -0.0409487449, -0.2648722231, -0.1205673516, -0.2782310247, -0.0588954724, 0.1076681912, 0.4514988661, -0.100334093, -0.092850253, 0.1537714899, 0.0597488992, -0.0592304431, -0.167974636, -0.0449833572, 0.2149648368, 0.2345023453, 0.3967010677, 0.592607379, 0.4832265973, 0.130234167, -0.4008479714, 0.0054556951, -0.142151922, -0.0121016465, 0.0782554746, -0.0040944051, 0.5423492789, -0.0047589084, -0.0244004205, 0.1844100058, -0.0400172547, 0.0160120428, 0.0228389278, -0.142511338, 0.0788014233, 0.0061025894, -0.2962937951, -0.1734939516, 0.0747581273, -0.1455051452, 0.1093974859, 0.3203470409, 0.0163725168, -0.0421183407, 0.0658584386, -0.0669593215, -0.352091074, -0.0452132523, 0.2316674739, 0.2718405128, 0.2748386264, 0.5183141232, -0.1675246656, 0.071811527, 0.1177204177, 0.2747017443, 0.1620256305, 0.3612321019, 0.0641384125, 0.0139865093, -0.0303534046, 0.0787400007, 0.0004980043, 0.2543188035, -0.0126082059, -0.2655352652, -0.1824521273, -0.0529923961, 0.4955037832, -0.1487338245, -0.2569105923, -0.2974273264, -0.181766212, 0.1917511821, -0.2066355497, 0.1184529513, 0.1440536976, -0.1022746116, 0.1683879197, -0.3601236045, -0.0104558757, -0.3628833294, -0.2907292545, -0.0691316426, 0.2497560978, 0.0202232599, -0.1943967044, 0.5272139311, -0.0249320306, -0.0333689041, 0.025106715, -0.3380872905, -0.0206468459, -0.233422786, 0.615162611, -0.0213522837, 0.1114929095, -0.1227341294, -0.0504867658, 0.1510164142, -0.3670947254, -0.2025052607, -0.4389247596, 0.0394204892, 0.1674709767, 0.0141839683, -0.7287325263, -0.3139707744, -0.1364330947, 0.0277880523, 0.0781335086, 0.0207948089, 0.0937434882, -0.076284349, -0.0136160329, 0.2463951409, 0.1230629608, -0.1112482697, -0.2469577789, 0.0709660053, -0.2565820217, -0.283436805, 0.0082682595, -0.2342489511, 0.536931932, -0.2553295195, -0.4300384521, 0.1072037965, 0.1385034621, 0.1700684428, 0.3131312728, -0.3208162189, -0.0004077069, 0.0782382041, -0.2634627819, -0.2218330503, -0.2145445645, 0.0192225333, 0.1301266551, 0.0001415797, 0.2200951576, -0.0504714735, 0.1129409373, 1.2106736898, 0.3273593187, -0.2195052505, 0.0636020899, -0.1927153915, 0.0751802474, -0.0221976154, -0.1251812577, -0.1512247622, 0.0874209851, -0.1855769753, 0.1736410409, 0.2079460025, -0.0467273518, -0.1202274561, 0.0999014154, -0.2788956463, -0.075118266, -0.2139844298, -0.3132948577, 0.1975213289, 0.1157156527, -0.1154127792, -0.0477225929, -0.1013531834, -0.0383366495, 0.1806687713, 0.0133110769, -0.1800636053, -0.5068638921, -0.0113038756, -0.0431138352, 0.2794253826, 0.0795167834, 0.1619375944, -0.1619588882, -0.0535286218, -0.0329804383, -0.1330485791, -0.0355494395, -0.3102977276, 0.0261690971, 0.1630443037, -0.2168926001, -0.0081145316, 0.0866062641, 0.0115357563, 0.056600742, 0.4807619154, -0.048989892, 0.0497591496, -0.370719254, 0.0235233903, 0.0425223522, -0.1889979243, 0.2285550833, -0.1610232294, -0.1048053727, -0.1623284519, 0.0350555591, 0.0179962441, -0.0748314261, -0.5981105566, -0.1424154937, 0.1041497663, 0.0443029031, 0.4162409008, -0.0220277198, 0.2759788036, 0.2045426965, 0.4596995711, 0.448551476, -0.1858813167, 0.0823457986, 0.3713403046, -0.0798934847, 0.367731899, 0.0714713186, -0.1460965872, 0.5774688721, 0.2619875669, 0.0281138904, -0.1851835847, -0.103974618, -0.2885439396, -0.3033471406, 0.1477824748, 0.134752959, 0.0864684433, -0.2001957595, -0.6305392385, 0.1975010633, 0.2010252774, -0.353679955, 0.3593757749, -0.0789748281, 0.0408885404, 0.0714414567, 0.0161137804, 0.7185248137, 0.031130353, 0.0408374928, -0.0633679777, -0.0831396878, -0.0582954735, -0.196909681, -0.0650121272, -0.451287061, -0.3052611947, 0.0646354333, -0.2399987429, 0.0965368897, 0.046173241, 0.053352952, 0.2137252688, 0.0748993456, -0.0926878452, -0.0279137995, 0.1169246584, 0.1915014386, 0.2568718791, 0.0779551193, 0.192930907, 0.0691703632, 0.1767725646, 0.1489315778, -0.0896165222, -0.2012272775, -0.3708190322, -0.517616868, -0.0316124298, -0.0510131828, -0.1126784459, 0.0256289393, -0.4053791165, 0.216178, 0.5042461157, 0.1690027416, -0.0211101361, -0.0940541327, 0.2346982211, -0.2069259882, 0.1775068045, 0.2685363889, 0.2643985748, 0.298704356, -0.1736250818, -0.2950646877, 0.2239082605, -0.2379505932, 0.121778138, -0.2031574249, -0.0356720276, 0.2882804871, -0.2387650311, 0.1726539731, 0.0429669283, -0.0536634326, -0.2230568081, 0.2215283811, 0.1827588677, -0.0591839738, 0.1484227479, 0.2733097672, -0.1622296274, -0.033139132, 0.3201951385, 0.181363225, -0.0981440321, 0.4658166468, -0.0653995499, -0.0376857147, -0.3925322294, 0.3945833743, 0.319717139, -0.1613171101, 0.1343165189, -0.0827919617, 0.0819564909, 0.1526434124, 0.5572664738, 0.3154764175, 0.0091167316, -0.1529156566, -0.1201263815, -0.0160591118, 0.0721239597, -0.3067627251, 0.4167075157, -0.1884611249, -0.5972594619, 0.0360755846, 0.2838350832, -0.4220008552, 0.0986538231, -0.1859420538, 0.101660952, 0.1157084256, 0.0426248796, 0.3107924163, 0.0213167742, 0.2126503885, -0.293431282, -0.1701076329, -0.3000238538, -0.0817707479, 0.10477864, -0.1281003654, 0.0412937403, -0.3866678774, 0.0008955598, -0.0565715618, -0.0235373899, 0.0773107409, -0.1803404987, 0.0496797487, 0.433550179, 0.1328220516, 0.1139929369, -0.0313405208, 0.0987038314, 0.0590462387, 0.6497113705, 0.0540720075, 0.1072620079, 0.2401764989, -0.1176836267, -0.0970345661, 0.1032773703, 0.0982732326, -0.1566593349, 0.2506430149, -0.182452932, 0.1813056618, 0.1521575153, 0.3487758636, -0.0782395974, -0.2179408818, 0.1871305555, 0.015774224, 0.256632477, -0.0791183859, -0.1002467424, 0.1507937163, 0.0553888232, 0.1126982272, 0.1759257913, 0.5118080378, -0.0121668056, 0.1419254094, 0.1605207026, 0.2285173386, -0.228369832, 0.350442946, -0.1774766743, -0.0784473121, 0.0397115797, 0.1137495488, 0.033849176, 0.1301719844, -0.1471464783, 0.1198165715, 0.6880677342, 0.3455753922, -0.021868024, 0.0029707663, -0.1939596832, 0.2410518974, -0.1361925751, 0.1080640256, 0.0413658395, 0.0950076133, 0.6839951873, -0.0069866125, 0.1802155077, -0.2407150269, -0.2542264163, 0.0474337712, -0.0468396991, 0.1862074137, -0.3324167132, -0.2405877858, -0.0999501795, -0.0467077829, 0.111554414, 0.2917161584, -0.0582833514, 0.1853183359, -0.1413296163, 0.3238018453, 0.2330874205, -0.0464064926, -0.2948653698, 0.2250228673, -0.016324129, -0.0854438841, 0.1405866295, 0.3934529126, 0.3710736036, -0.1066668779, -0.3742781281, -0.2025523186, 0.0403248742, -0.166834712, -0.0226201452, 0.3400898576, -0.1154894754, -0.3748776019, 0.3489946723, 0.2770541608, -0.060615927, -0.0007210477, 0.17012164, -0.1206800044, -0.2029058188, 0.5408697128, 0.0171919595, -0.0640411973, -0.0150462342, 0.021383917, -0.3221750855, -0.263794601, 0.3815340996, -0.0299416706, -0.0720611066, -0.0675548688, 0.1355533451, -0.0533795878, 0.494281888, -0.0191158392, 0.3656122983, -0.2919707894, -0.1607234925, -0.226488322, 0.0716511309, 0.5041435957, 0.1339231431, 0.1225114763, 0.0957558528, 0.1908081025, 0.1724909544, 0.1969132572, -0.2208018303, -0.0869122744, 0.3794533908, -0.4213507771, -0.0196721014, -0.3491998911, 0.1296294034, 0.0191063061, 0.0250672549, -0.1146989763, -0.2825497091, -0.0121563636, -0.2955868542, -0.2437653393, 0.4059179723, 0.0561932325, 0.4025733173, -0.1456018984, 0.8773338795, 0.0132249817, -0.1577970386, -0.0052942745, -0.469460547, 0.170876056, -0.0260083079, -0.269987911, 0.0613113195, -0.0630878061, -0.0651202649, -0.0958214477, -0.2657928765, 0.050117448, 0.0394807756, -0.0188558102, -0.2808689475, -0.1967353523, -0.0119321011, 0.2182395309, 0.2776321173, -0.0598590784, 0.1244899705, -0.152422145, 0.0226656571, 0.4759707749, 0.0715652853, 0.0338383168, -0.4323129058, 0.2209639102, 0.2272642702, -0.0178585816, -0.4435825646, -0.1076603904, 0.5402590036, 0.1289528012, -0.0759133548, 0.1978559792, 0.3213539124, 0.1204364449, -0.0154199526, 0.1594599485, -0.3088408709, 0.0737696066, -0.1196221411, -0.0594346672 ]
https://github.com/huggingface/datasets/issues/2165
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset
Hi, a HF dataset can be converted to a Torch Dataset with a simple wrapper as follows: ```python from torch.utils.data import Dataset class HFDataset(Dataset): def __init__(self, dset): self.dset = dset def __getitem__(self, idx): return self.dset[idx] def __len__(self): return len(self.dset) train_ds = HFDataset(train_ds) ``` @lhoestq Since the Arrow Dataset already provides `__getitem__` and `__len__`, I think we could use the [virtual subclass](https://docs.python.org/3/library/abc.html#abc.ABCMeta.register) mechanism from the `abc` module to elegantly solve this issue. This mechanism would allow the Arrow Dataset to be used in place of the Torch Dataset because the `isinstance(instance of Arrow Dataset, TorchDataset)` check would return True (DeepSpeed has this check [here](https://github.com/microsoft/DeepSpeed/blob/ab5534fc4c0f8ca21ada321f9730d723aa31288b/deepspeed/runtime/engine.py#L823)). And it requires a minimal change in the `arrow_dataset.py` file: ```python if config.TORCH_AVAILABLE: from torch.utils.data import Dataset as TorchDataset TorchDataset.register(Dataset) ```
Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset?
124
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset? Hi, a HF dataset can be converted to a Torch Dataset with a simple wrapper as follows: ```python from torch.utils.data import Dataset class HFDataset(Dataset): def __init__(self, dset): self.dset = dset def __getitem__(self, idx): return self.dset[idx] def __len__(self): return len(self.dset) train_ds = HFDataset(train_ds) ``` @lhoestq Since the Arrow Dataset already provides `__getitem__` and `__len__`, I think we could use the [virtual subclass](https://docs.python.org/3/library/abc.html#abc.ABCMeta.register) mechanism from the `abc` module to elegantly solve this issue. This mechanism would allow the Arrow Dataset to be used in place of the Torch Dataset because the `isinstance(instance of Arrow Dataset, TorchDataset)` check would return True (DeepSpeed has this check [here](https://github.com/microsoft/DeepSpeed/blob/ab5534fc4c0f8ca21ada321f9730d723aa31288b/deepspeed/runtime/engine.py#L823)). And it requires a minimal change in the `arrow_dataset.py` file: ```python if config.TORCH_AVAILABLE: from torch.utils.data import Dataset as TorchDataset TorchDataset.register(Dataset) ```
[ -0.2578475475, -0.2652204037, 0.0922904462, 0.3382239342, 0.1922440529, 0.2227147073, -0.0302727409, 0.3457018137, -0.1513579488, -0.188662827, -0.3486474752, 0.324899286, -0.1942692399, -0.1420532465, 0.1868406236, -0.2680389881, 0.1673273146, -0.0773855597, -0.2466962934, -0.1544105411, -0.1386658698, -0.1202892512, 0.0764642209, 0.0747127086, 0.0671002939, 0.0934036672, 0.0947785601, 0.1692149937, -0.0237057731, -0.337891221, 0.2977357805, 0.06488619, 0.5751036406, 0.2561473548, -0.0001273231, 0.276031673, 0.0935579836, -0.0755774081, 0.031279739, -0.0670309737, -0.0523286238, -0.0347762331, 0.1930174828, -0.1016478091, -0.3808218241, -0.5978335738, -0.1727228463, -0.5317307115, 0.0468850359, 0.4796395302, 0.0522027463, 0.2359526008, -0.0159182101, 0.0726410821, 0.288739264, -0.0978339314, -0.1821517944, 0.1489147693, 0.0003680661, 0.1105437055, -0.1440719068, 0.1899667233, -0.1628382802, -0.0048651807, 0.4622428715, -0.1983773112, -0.3828517199, -0.1405879557, -0.1110374331, 0.4482493997, 0.1785310507, -0.3304381371, -0.1622342169, 0.0913781375, -0.0402280577, -0.1471043527, -0.3329951763, 0.1591294259, 0.013326548, 0.1457208246, 0.0341932848, -0.034854129, -0.1720399708, 0.0566774197, 0.1703046858, 0.2567846179, 0.1148065627, 0.200509578, 0.1122350395, -0.3005605936, 0.4763330519, -0.2886345088, 0.0199535303, -0.1253504604, -0.1023315787, -0.0023472905, -0.325740546, -0.0770280957, 0.4265949726, 0.1055245399, 0.3500556052, 0.311578989, -0.150831461, 0.0488587618, -0.0783414841, -0.1055724472, 0.1002683491, 0.2584199011, -0.0067846384, -0.2417301089, 0.0126303881, 0.274179399, -0.0550222658, -0.3046226501, 0.0989656597, -0.0002230052, -0.1225695908, -0.1470832825, -0.2946826816, -0.0963816792, -0.3344511092, 0.004502438, 0.1658028513, 0.1950963736, -0.0069164522, 0.155990839, 0.4160034955, 0.5736423731, -0.2732746601, -0.044283323, 0.039262604, 0.1037556827, -0.0204077587, -0.2133427858, -0.0619506985, -0.1895152479, 0.0589850843, -0.0272744596, -0.1381996274, 0.208725214, 0.4373678565, -0.1368233413, 0.2677766681, 0.0341864303, 0.0437847972, 0.0107279941, 0.3737200499, 0.4464449584, -0.296280086, 0.2520727813, -0.3542588055, -0.2294126749, -0.0299930833, 0.0291099288, 0.1518910378, -0.3381065726, -0.2596779466, 0.3441299796, -0.0471923314, 0.0570967495, 0.0422882922, -0.4522698522, -0.3920987844, -0.1631956995, 0.2866367698, 0.2642973661, -0.4543382823, -0.108259052, 0.0669648349, -0.1349181682, 0.1149818897, 0.2226649225, -0.2385525256, -0.0212377347, -0.3799107671, -0.1190294325, 0.502168417, -0.3953183591, 0.0504107401, 0.0612171479, 0.1370857805, -0.0883584917, 0.0613235347, 0.0608318932, -0.1293747574, -0.1211574897, 0.1777421385, 0.1931715012, -0.1514973789, -0.2278325856, -0.1285723895, -0.1981903911, 0.3369712532, -0.0489434488, 0.2017854899, 0.2132305354, -0.1483508945, -0.3161420524, 0.2712275684, -0.0189263336, 0.1627964973, 0.2168647945, -0.2954395413, 0.1737282872, -0.0513658747, 0.1118237451, 0.0711634159, 0.1300421357, 0.064776212, 0.0738745034, 0.1080078036, 0.0362750441, -0.1997976154, 0.1803223789, -0.1132471412, 0.0170497857, -0.0658319741, -0.0846984982, -0.1495208144, -0.2479621172, -0.0476652496, 0.2230953425, -0.4051264524, 0.1576890945, -0.5375212431, 0.2642348707, 0.135172531, 0.1516147554, -0.0461901836, 0.2652031481, 0.0887988955, 0.0306285061, -0.1722033024, 0.2192762047, 0.0369969234, -0.0704303756, 0.2098776847, 0.291839987, 0.1083689108, -0.9760198593, 0.4055999517, 0.4391721189, 0.1616518497, -0.0263199732, -0.0654941052, 0.737254858, 0.2774627805, 0.300027281, -0.0249519795, 0.0133371502, 0.0203081518, 0.179613173, -0.2465769053, 0.048442699, -0.1590321958, 0.0646575242, 0.3350358009, -0.0673667043, -0.2600279748, 0.0720842257, -0.0637838766, -0.0697549433, 0.0892389119, 0.2696087658, -0.542938292, -0.0200526938, 0.2840874195, -0.1175015643, 0.2478155494, 0.1257992387, 0.2453291714, 0.0192357805, -0.1548356712, 0.1166772544, 0.3136956394, 0.1029241383, 0.3733657002, -0.0712378621, 0.0262525454, -0.0605895892, -0.2755172551, -0.0274270289, -0.1287205815, -0.108618997, -0.4903783202, 0.2309370935, -0.3518227339, 0.0477068871, -0.3123167157, -0.1259677708, 0.0694136173, -0.1767662168, -0.104216218, -0.0295040552, 0.1408050954, 0.1130039692, -0.415553689, -0.2949006557, 0.1695125401, -0.414300859, 0.0517659485, -0.1680518091, -0.1829597205, -0.0821089223, 0.1017922163, -0.0141250491, 0.3234535158, 0.2352633476, -0.0364729688, -0.4555364549, -0.1237666979, 0.0857319981, -0.1682260782, 0.1182561144, 0.166331172, 0.0459987596, 0.245570004, 0.0315162688, 0.0844991803, 0.0641371608, -0.0313024782, 0.094511345, -0.4060157537, 0.1735189557, 0.3860553205, -0.1754045039, -0.3225271404, -0.203417927, -0.4023962021, 0.0576415807, 0.0536065586, -0.0176011212, 0.3570223451, 0.1686809063, 0.2799851894, -0.0048595108, -0.1254452467, -0.0701351017, 0.376388371, -0.055545669, -0.2689592838, -0.1432137042, -0.3228364587, 0.2073330879, 0.3074099123, -0.3161615729, 0.0621643811, -0.2311652303, 0.3600257635, 0.0136121418, -0.0250630789, 0.301900357, -0.1703782678, 0.1023959368, -0.1909873784, -0.2149834186, -0.0230282135, -0.2790469229, 0.2952264547, 0.3544193804, 0.4846107662, -0.1506828815, 1.0412966013, -0.0465679355, -0.3697219491, 0.3973761201, -0.1264252216, 0.1498179138, -0.1833269894, -0.2263840139, -0.1105483919, -0.2265170962, 0.2802518308, 0.0799793005, -0.1003462225, -0.170522213, 0.0693361312, 0.121448487, -0.0306394175, -0.1660861075, 0.2329551578, -0.8961451054, 0.0176866967, 0.0021341518, 0.1300476044, -0.3229353428, 0.0231794976, 0.0732281804, 0.2152173519, 0.1483141929, 0.1805101484, -0.3862235546, 0.2053111196, -0.2371469289, 0.4286138415, 0.056274496, 0.4741936922, 0.1464481354, -0.1573109925, -0.0251615047, -0.0147807598, 0.2404381186, -0.1279582232, -0.0947267115, 0.0771025419, -0.0921521112, -0.54143399, -0.0246010348, 0.0846694857, -0.119491756, -0.1428971142, -0.0692430884, -0.1483658254, -0.3878343105, 0.0475910902, -0.0577730127, -0.0982013121, 0.3453834057, -0.0070091709, -0.2675893903, 0.0000854135, -0.0048482195, 0.112253122, -0.0689447448, -0.1097262949, -0.2179273516, -0.4557944834, -0.009742029, 0.2941734791, -0.200243324, 0.2585793734, -0.1388331801, 0.0753413215, -0.1527342796, 0.2849923372, 0.2438030392, 0.4379943609, -0.1970748752, -0.2902017534, 0.0096692257, 0.3952713311, 0.3297529519, 0.1525488198, -0.1225219965, 0.2307647616, 0.0732722729, -0.2015489936, -0.3593080044, 0.0972253159, 0.2285037041, 0.0436525755, -0.3781017363, -0.5780889392, 0.7419282198, 0.2688187659, 0.1454409361, 0.1953777075, 0.3553936779, -0.3011115789, 0.6170402765, 0.3395322859, 0.9867901206, -0.0691072941, 0.3258782029, 0.0542069152, -0.2959994972, 0.0721048862, -0.0504341312, -0.0582281128, -0.4126891196, -0.1477096975, -0.1338686943, -0.1622087955, 0.0057242159, 0.0689145029, 0.3153635859, 0.1780281961, -0.0744582713, -0.0383912139, 0.0962403566, 0.072368823, -0.1790564954, -0.2455158681, 0.0499620438, 0.1340462416, -0.146022588, 0.0349265672, 0.0267107859, -0.2325409949, -0.2148474753, -0.0474876016, -0.0926460773, 0.0968860984, -0.4661189318, 0.1713735163, -0.1045230031, -0.712253809, 0.3375082016, 0.2854368091, 0.3511967361, -0.1926306188, -0.1350197792, 0.1517780274, 0.3961054385, -0.0373028368, 0.0267663114, -0.2233529836, 0.410679996, 0.1068915501, 0.0353527367, 0.017552847, -0.0071006045, -0.3052247167, -0.314510107, -0.124523446, 0.5930755734, -0.2820000052, -0.3719062805, 0.2380304039, -0.0927091464, -0.0675929934, 0.0090437159, 0.0696065947, -0.1106253862, -0.0107090324, 0.1345482618, -0.3021258116, 0.0600138307, 0.3590589464, 0.2400669008, 0.3162533641, 0.3917658925, 0.1692464501, -0.0556958392, -0.0065320283, 0.2975603938, 1.0077916384, -0.2458745688, -0.009940993, -0.1170478836, -0.1609709412, 0.1037975848, -0.1634286791, 0.0081034936, -0.0553743392, -0.1087673604, -0.1185111254, -0.455599606, 0.0748568028, -0.4061065912, 0.2491327673, -0.1225530803, 0.0172260776, -0.3211317062, 0.0155153219, -0.1448335648, 0.1127309427, 0.2651414275, 0.1370836049, -0.1197653562, 0.1266105175, 0.0069290437, 0.1773063838, 0.0005028062, 0.079105258, -0.182822004, -0.1051899642, -0.2731460035, 0.196101591, 0.0683136135, -0.1551604569, 0.0994860306, -0.2853501439, -0.222906515, -0.0364951864, 0.1683731675, 0.206749022, 0.0059142075, 0.2294738889, 0.3034992516, -0.0259202048, -0.2105906606, 0.0383490287, 0.3125869334, 0.3946983516, -0.0605468489, 0.0965478793, -0.1757986844, -0.2931244969, -0.3873528242, 0.1752181798, 0.4720817506, 0.0273501277, 0.2311713099, -0.039883066, 0.1024810523, -0.2299895138, 0.2298425287, 0.3792036176, -0.0611141995, 0.047193706, 0.0231119804, -0.0648274496, -0.3075178862, -0.0568651147, -0.3594820797, -0.4126647115, 0.0003113672, 0.1142259091, 0.0826152414, 0.6105094552, -0.1618745625, -0.2463416606, 0.0081117414, -0.2925338745, -0.0741097182, 0.4579828084, 0.2106723785, 0.0325757116, 0.3636945486, 0.0911523998, 0.3156627715, 0.2562748194, 0.3217665255, 0.9033666253, 0.5328702927, 0.0519996323, 0.434022665, -0.3633097708, -0.2659891248, 0.2342762202, 0.1408530176, 0.2021416128, 0.1176671237, 0.4040747285, -0.0051708482, -0.4713330567, 0.0642773509, 0.0514757112, 0.0454384089, -0.381563127, -0.1736594737, 0.0116790682, -0.3381462693, -0.1598155499, -0.300989449, -0.2025419325, -0.0273908228, 0.1743181199, -0.0134381242, -0.1040216759, 0.0547180809, 0.2319031358, -0.1501419544, -0.0429551341, 0.0767045766, -0.0977956057, -0.0906886831, 0.0501100942, 0.2382849008, 0.1793131232, 0.0387448706, -0.3101735413, -0.0302370153, 0.5008476377, -0.15785034, 0.2633668184, -0.1167047471, 0.0330311842, -0.0895637721, 0.3350350857, -0.0045015235, 0.0456661806, -0.0018749854, -0.0360822231, -0.0118331611, -0.0806544051, 0.4686771333, 0.0380998962, 0.0139763802, -0.1736446917, 0.0824353546, -0.2970452905, -0.1447718441, 0.6065626144, -0.1959422827, 0.1275311708, 0.0394566134, -0.0156108364, -0.0559970811, 0.2712171972, 0.2909685075, 0.0128562562, -0.4178182781, 0.0564240217, -0.2842062712, -0.0600477159, -0.0816403329, 0.0632242039, -0.0166598149, 0.0056416616, 0.3884033859, 0.0199819077, -0.0046374574, -0.03724958, 0.2183658332, 0.4570043087, 0.0243276134, -0.2359936088, -0.1582068801, 0.3439804316, -0.0470927469, -0.3401723504, -0.1834380478, 0.2665220797, -0.0988294929, 0.041692026, -0.285351336, 0.5871301889, -0.0558395572, 0.36129722, 0.013453858, 0.442563355, -0.1935124993, 0.0562474355, 0.0560614988, -0.0514192767, -0.435149461, 0.186774224, -0.1683950424, 0.3249020278, -0.0179733224, -0.2146581262, -0.055523552, 0.1130814105, -0.0192127451, -0.4831694961, -0.3689865172, 0.5198542476, -0.336309433, 0.0545217581, 0.2158741057, 0.5405632854, 0.1599622816, 0.2815884948, -0.2493225038, -0.1977888346, 0.5602645874, 0.0879469141, -0.0127672553, 0.1000929028, -0.0909553319, 0.2509337664, 0.0842074975, -0.3041745722, -0.1044751406, 0.1396904439, -0.2259104103, 0.0817540735, 0.1331894696, 0.2929909229, 0.2363059372, -0.3110003471, 0.4001896977, 0.154628858, 0.0743893832, -0.1339150667, -0.2898062468 ]
https://github.com/huggingface/datasets/issues/2165
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset
Interesting ! Thanks for sharing this @mariosasko . I like the idea This looks like something we should add IMO
Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset?
20
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset? Interesting ! Thanks for sharing this @mariosasko . I like the idea This looks like something we should add IMO
[ -0.2704312801, -0.3552314043, 0.0578338429, 0.3274025023, 0.1308024079, 0.2287475318, -0.074670881, 0.3752877414, -0.1519820392, -0.24214077, -0.3885172606, 0.3905748129, -0.2419560254, 0.0159070268, 0.1749466658, -0.3065539896, 0.2215386033, 0.0879761726, -0.2604882419, -0.1844494045, -0.1150370017, -0.0907217115, 0.0623861253, 0.1066242009, 0.0754083693, 0.0218767431, 0.0603698939, 0.1361698806, -0.0912098289, -0.3727334142, 0.1620190144, 0.0805813372, 0.6023119092, 0.2542231679, -0.000129465, 0.1214097738, 0.047135625, -0.1353145838, 0.1333483458, -0.0648843572, -0.1909477711, -0.0160531178, 0.1982825696, -0.1445407122, -0.3125003278, -0.5852586031, -0.0864550844, -0.330288738, 0.1317974478, 0.5674698949, 0.0448211208, 0.2532970309, 0.0411305726, 0.0413687751, 0.2709916234, -0.1340618879, -0.1894198954, 0.0514472909, -0.0449582152, 0.1564193815, -0.1868777275, 0.1760749072, -0.1330000907, 0.0261197798, 0.3555385172, -0.3080777526, -0.3637715578, -0.1833695322, -0.0535962842, 0.5436589122, 0.2123096287, -0.247074455, -0.0536053032, 0.1764544994, -0.0406477526, -0.1832192689, -0.4047422409, 0.2438117266, -0.0344791822, 0.1389835775, -0.0193719864, -0.2209185958, -0.1599257886, 0.0496580824, 0.2337446511, 0.3325103819, 0.0863249898, 0.1720975786, 0.2195573002, -0.3176526427, 0.4350479245, -0.2300881147, 0.0136856232, -0.1905346364, -0.0844798461, -0.0536003336, -0.3678522706, -0.0870004445, 0.4450829923, 0.0914297402, 0.1940545738, 0.3110405505, -0.1877268702, 0.0876536593, -0.165500164, -0.2114876956, 0.1320843995, 0.2368786633, 0.0151885152, -0.2638655603, -0.0350545943, 0.2685379982, -0.1065917686, -0.403382659, 0.0268641189, 0.0132903419, -0.1553602815, -0.1946210861, -0.1789074242, -0.2201950699, -0.274425596, -0.0415353402, 0.025534045, 0.243205294, -0.0197863411, 0.032482665, 0.2451164871, 0.6499624252, -0.1770293266, -0.1200618148, 0.0231894143, 0.1186214536, -0.010444954, -0.1782737672, -0.0901768878, -0.1836854815, 0.083109878, -0.0311975367, -0.2837876678, 0.1042147428, 0.3755454719, -0.1094041318, 0.2886729538, 0.0350891091, 0.1142902598, 0.0078264326, 0.2785112858, 0.4119475484, -0.3310035467, 0.2717521489, -0.5120921135, -0.1923475862, -0.1678928286, 0.0259818621, 0.1766339839, -0.3390817642, -0.4178641438, 0.3362241983, 0.000645712, 0.1393367201, 0.0111860819, -0.4340929985, -0.3783959746, -0.1909059286, 0.1955819726, 0.2619057894, -0.3799598813, -0.1437559128, 0.1453680396, -0.1773046106, 0.2109765708, 0.3144456148, -0.2082759291, 0.0645738542, -0.4396534562, -0.0454903096, 0.6284140944, -0.3011908829, 0.1494972408, 0.1173238754, 0.132221669, -0.2706711888, 0.1166471615, -0.0181613322, -0.0784448385, -0.0447086431, 0.1449572146, 0.2285378575, -0.1309374273, -0.1571481973, -0.1241616234, -0.3072412908, 0.4866388142, -0.0557221211, 0.2174058259, 0.294662267, -0.1126178131, -0.2794395387, 0.3269387186, -0.0687172487, 0.1383546591, 0.2432396114, -0.3034932017, 0.0261791367, -0.0794046298, 0.1094829291, 0.1647334844, -0.042701073, 0.0162464008, 0.0033797882, 0.079503648, 0.0811144859, -0.224948436, 0.1649550498, -0.1156473607, 0.0749072134, -0.0818222091, -0.0752735138, -0.1724802852, -0.1560640931, -0.0423300527, 0.2044194788, -0.3709310591, 0.1121350527, -0.5358003974, 0.2550238967, 0.0991600081, 0.1160598397, 0.0869629085, 0.2077863961, 0.0999308228, 0.0034457631, -0.1313249469, 0.1819622517, 0.0038005039, 0.054771509, 0.3907220662, 0.382889986, 0.0789415613, -1.0408309698, 0.3747020662, 0.423089236, 0.1125191152, -0.1140041873, -0.0838938728, 0.704898119, 0.1983753443, 0.2045112997, -0.0233918801, -0.0807896405, 0.0893391222, 0.1275872886, -0.2039732784, 0.0450544208, -0.095815137, -0.0324644223, 0.2899928093, -0.0298492033, -0.3910631537, -0.026577957, 0.0611633211, 0.0086545572, 0.0978103727, 0.3565205634, -0.5009668469, -0.1333936602, 0.2598282099, -0.3266512156, 0.1245564148, 0.1496169269, 0.1668124199, 0.0315001681, -0.0519472435, 0.0357632302, 0.2676285505, -0.0245048739, 0.4564779401, 0.0383477509, 0.0988227278, -0.0827440917, -0.3403329849, 0.0135742724, -0.1481551826, -0.0426874794, -0.4770847261, 0.1296865046, -0.3740544915, -0.1077138484, -0.3232427835, 0.0160601474, 0.0922946259, -0.0635075495, -0.1585213244, -0.0373837203, 0.2656472921, 0.1264510751, -0.4192352891, -0.2399655581, 0.2190298736, -0.262365371, -0.0459454991, -0.1887424886, -0.0797469169, -0.0820252076, 0.0914014652, 0.0161288008, 0.2941833138, 0.1412699819, 0.1444800645, -0.4242696762, -0.1420469135, 0.0025839312, -0.0993425399, 0.0697794855, 0.1595064104, 0.1411957592, 0.2244946957, 0.0567412265, 0.0431841351, 0.0411015451, -0.0407089517, 0.1077580452, -0.4161677659, 0.1413841397, 0.4955782294, -0.130107075, -0.3275343776, -0.2123827338, -0.3685062528, 0.0493368357, 0.1444418132, -0.1609321535, 0.3607035875, 0.102772072, 0.1735192537, -0.0248914976, -0.0694722906, -0.0942181572, 0.3464500308, -0.0777981579, -0.2930302024, -0.174594909, -0.2663953304, 0.1151687205, 0.1990529299, -0.3448435068, 0.17936638, -0.1567099094, 0.310354352, -0.0029998438, -0.0515292883, 0.3110345602, -0.1472960263, 0.1452461481, -0.1825831085, -0.2098720968, -0.0008985661, -0.1738933623, 0.3357550502, 0.4362912476, 0.4567352831, -0.2110414058, 0.968773663, -0.0148852542, -0.3842709959, 0.5177221298, -0.1633143127, 0.1034207344, -0.1918204874, -0.2534877062, -0.038690377, -0.0802294463, 0.3667731285, 0.097416535, -0.1248236001, -0.1807954907, 0.0865010321, 0.1067031771, -0.105373092, -0.0593369715, 0.2345703691, -0.8194177747, -0.0726821423, 0.0025318861, -0.0068368092, -0.2437282801, -0.0556774437, 0.0777242705, 0.3136207163, 0.2601487041, 0.2205911577, -0.370706588, 0.1837081313, -0.212057218, 0.3850878477, -0.0528437868, 0.4841069579, 0.1041784585, -0.064112857, 0.0318517461, -0.0306219608, 0.3866947889, -0.1875586212, -0.0914017409, 0.0194156542, -0.0259633884, -0.4439343512, -0.0057253391, 0.0413165689, -0.0433619134, -0.1164480299, 0.1831138432, -0.1546755135, -0.3596232235, -0.0006946698, 0.0029349141, -0.1138092354, 0.2737457454, 0.0768163502, -0.2045685649, 0.0357516631, 0.053689681, -0.0164439194, -0.0990001857, -0.1160667613, -0.2233148813, -0.4766240418, 0.0645198002, 0.2487378269, -0.2038892508, 0.192040354, -0.0786590651, -0.0404599123, -0.2650976181, 0.2962007523, 0.2615865171, 0.2747355103, -0.2695290148, -0.1795162559, -0.0120421732, 0.3011475205, 0.3822052777, 0.0853852332, -0.0686253235, 0.2815310359, 0.0628932714, -0.0958312228, -0.337895155, 0.1491988599, 0.2903026938, -0.0034238063, -0.5377708077, -0.4617138505, 0.7115879655, 0.2423549742, 0.1123872548, 0.2173788995, 0.2269865423, -0.27272892, 0.7211723924, 0.2216561437, 1.1427093744, -0.1634587348, 0.327729851, -0.0689024627, -0.3151949644, 0.1440819502, -0.1366242915, -0.0438573025, -0.5092172027, -0.1337455958, -0.172420457, -0.2102553844, 0.0005090889, 0.1115138233, 0.3066325188, 0.173679769, -0.0907341242, -0.0430986211, 0.0739062726, 0.1339907646, -0.012722184, -0.2152226567, -0.0496795028, 0.0812612474, -0.2455008924, 0.0428515673, 0.0226381347, -0.3167786002, -0.0857654959, -0.0128045678, -0.0629137978, 0.1333413124, -0.3916159272, 0.2086814642, -0.1020076275, -0.7172003388, 0.2480070591, 0.321087122, 0.3370934129, -0.1327753067, -0.1462029666, 0.1636066139, 0.4743584096, -0.1735899448, -0.0122843012, -0.0925388336, 0.2693701684, 0.006993629, -0.0051267892, 0.0592467189, 0.0436878577, -0.3624275923, -0.3166550994, -0.1638196707, 0.4906709194, -0.2466344088, -0.5456697941, 0.2004904151, -0.0626045614, -0.0492504761, -0.0078771235, 0.0940500051, -0.0801145136, 0.0802998543, 0.2769866884, -0.3589982092, 0.0691728741, 0.3846994638, 0.1874383986, 0.378805995, 0.378767401, 0.1662436426, -0.0843460262, -0.0581624806, 0.2729898393, 0.8475376368, -0.2112776786, -0.055036746, -0.1017799005, -0.0667243153, 0.1764795333, -0.1538366079, -0.0242769998, -0.010791827, -0.0010595322, -0.1684327126, -0.3776629567, -0.0094206035, -0.5037515163, 0.2098775506, 0.032290414, -0.0654997155, -0.3649929762, 0.0716209263, -0.1308606118, 0.1892535686, 0.2305909395, 0.1326999366, -0.1198964417, 0.1519487351, -0.0308756344, 0.1419836581, -0.0059041083, 0.0213200003, -0.1980635822, -0.1242233366, -0.2340459526, 0.2140558809, 0.101651229, -0.1233232915, 0.108550936, -0.2530789375, -0.2654300332, 0.0349138789, 0.1609394699, 0.2066160291, 0.0862388462, 0.2973312736, 0.3402450085, -0.1025864854, -0.2123931646, 0.0754839331, 0.3458487988, 0.3790524006, -0.1384805888, 0.1107972637, -0.1813206971, -0.2900879383, -0.3661789894, 0.1722215265, 0.5551642179, 0.0176631249, 0.2392829955, -0.0788118094, 0.1425163448, -0.2420073897, 0.2221852541, 0.3790280819, -0.1063598394, 0.0677400753, 0.0594035648, -0.0754963532, -0.2994277775, -0.0385041013, -0.2173160464, -0.3141108453, -0.0723759979, 0.0272178724, 0.1255373657, 0.5410740376, -0.1436739415, -0.2965466976, 0.0447996333, -0.3451572061, -0.1395789236, 0.3816301525, 0.2292928696, 0.0080818506, 0.3678337038, 0.2350915521, 0.3199836314, 0.1539042145, 0.4099702239, 0.849285841, 0.6417720914, 0.0754530579, 0.4385544658, -0.4119924009, -0.3295013905, 0.2571874261, 0.143252477, 0.1258505583, 0.1502239406, 0.4933293164, 0.1703613251, -0.5665960908, 0.0716963261, 0.1914036274, 0.034636315, -0.4513970017, -0.1302144527, 0.0413922518, -0.3098058105, -0.1244270951, -0.3104375303, -0.1233872622, -0.0551060848, 0.2258519828, 0.0566275828, -0.0724432319, 0.1049896553, 0.2062295973, -0.1139234155, -0.0713275895, 0.1549411267, -0.1350674331, -0.0542066209, 0.0578976236, 0.1662690639, 0.2439159602, -0.0082276948, -0.3018836379, -0.0454336852, 0.4646236598, -0.1645204723, 0.3403019607, -0.0736193508, 0.2081257999, -0.1007423699, 0.3429597914, -0.0059630945, 0.0626547337, 0.1354293972, 0.0287159793, -0.0066626314, 0.0180633962, 0.248131752, 0.1146363318, 0.0294341296, -0.1742189378, -0.0112430565, -0.3586733937, -0.0496008247, 0.6691646576, -0.2396361232, 0.1143988147, 0.0804414824, -0.0062692203, -0.0650278032, 0.1841632724, 0.3714641929, 0.1079927534, -0.3948981464, 0.0223799348, -0.1956923604, 0.039269641, 0.0264247637, 0.1066623256, -0.0834689885, -0.0030415356, 0.3395576477, 0.0002310453, -0.0614798367, -0.0334357917, 0.2042382956, 0.5422480702, 0.019290641, -0.1077277809, -0.2591682076, 0.363824904, -0.1441084892, -0.3204354644, -0.0903423056, 0.2091030031, -0.0847720578, -0.0010738485, -0.2335558087, 0.5360319018, -0.0856623054, 0.3362801373, -0.0733782277, 0.4900248349, -0.2959281504, 0.1195826754, 0.1739210933, -0.0841970593, -0.4016542137, 0.2119204551, -0.092722699, 0.2605183423, -0.0029797703, -0.1320885867, -0.0440980569, 0.1206763908, -0.1207278296, -0.4478738904, -0.2386039793, 0.4975053668, -0.238929078, -0.0964185894, 0.2845880389, 0.4631789327, 0.1880176365, 0.2012937814, -0.1608359218, -0.1496621072, 0.567127049, 0.1585633904, -0.0479430705, 0.0831971467, -0.1093915701, 0.2654269338, 0.0603672937, -0.3633697033, -0.1027078629, 0.155767262, -0.2713347077, 0.1184529215, 0.2174606472, 0.2340919375, 0.2719827294, -0.3003630042, 0.4093891978, 0.2130361944, 0.0507343709, -0.2739736438, -0.3515224755 ]
https://github.com/huggingface/datasets/issues/2165
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset
@mariosasko Thx for your code! It perfectly works with a small modification for HF NLP dataset: ``` original_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds = HFDataset(train_ds['train']) # needs splitting ```
Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset?
28
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset? @mariosasko Thx for your code! It perfectly works with a small modification for HF NLP dataset: ``` original_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds = HFDataset(train_ds['train']) # needs splitting ```
[ -0.2263560146, -0.3335735798, 0.0703147277, 0.3271580338, 0.1331761628, 0.1971443743, -0.064295426, 0.373364985, -0.1391186714, -0.2662573457, -0.3984824419, 0.3849842548, -0.1794500947, -0.0095812157, 0.1554359794, -0.3008967638, 0.1781210005, 0.0767288506, -0.2033019215, -0.2192837149, -0.0984736681, -0.0496378466, 0.0211217552, 0.1258830875, 0.006090831, 0.0596892312, 0.046822913, 0.2068380117, -0.0479724929, -0.3290063143, 0.1856230497, 0.0352226943, 0.5887829661, 0.2546224594, -0.0001306744, 0.1232330948, 0.04751366, -0.1539011598, 0.1102607772, -0.1059947014, -0.1251384914, -0.0374399684, 0.1923867315, -0.1235967278, -0.352724731, -0.5381257534, -0.0982353091, -0.290035069, 0.1821317971, 0.5682997108, 0.0439836569, 0.2380839884, -0.0001739636, 0.0502141453, 0.2654595375, -0.1158187613, -0.1378006935, 0.0770628378, -0.0951837674, 0.1144729629, -0.2686016262, 0.1428052783, -0.1503307521, 0.0720831007, 0.3074947298, -0.3364241719, -0.4187688828, -0.1907432079, -0.0029429528, 0.5164993405, 0.1975759566, -0.216466561, -0.0486003868, 0.1461017579, -0.1083503962, -0.1705801785, -0.3670745194, 0.2305694818, -0.033645682, 0.1331619322, 0.0374289937, -0.1993559301, -0.1586772799, 0.0975331813, 0.205634743, 0.3252079189, 0.0735000372, 0.1826859713, 0.2181073427, -0.3050099015, 0.3931105435, -0.209629789, -0.032205604, -0.1784205586, -0.1522562057, -0.0226950794, -0.3895272911, -0.0581793264, 0.4548137188, 0.0893320888, 0.1379809827, 0.3401525915, -0.15598692, 0.0358814672, -0.1179903522, -0.1961132288, 0.1375549436, 0.2798588276, -0.0167926606, -0.3020295799, -0.078724198, 0.2333446741, -0.0840413049, -0.4121384919, 0.0535192266, 0.0179045051, -0.1774982214, -0.2150648087, -0.2046911716, -0.2606699467, -0.2944225967, -0.0563337207, 0.0382383429, 0.265632242, 0.0401875824, 0.0500872061, 0.1952548921, 0.6915660501, -0.2502999306, -0.1751054972, 0.011274226, 0.105631724, -0.022032097, -0.1828757823, -0.1040800586, -0.2147393227, 0.1593293846, -0.0057803653, -0.2855859697, 0.1035447419, 0.3521380126, -0.1735324413, 0.284581095, 0.0553725325, 0.1202840135, 0.0789880455, 0.3318808079, 0.3952587247, -0.3046817183, 0.2600637078, -0.5100747347, -0.2010752857, -0.1981968433, 0.0106508704, 0.1503175646, -0.2748128772, -0.424285084, 0.3067434132, 0.0271710865, 0.1364006549, 0.0167123005, -0.4317054749, -0.3108103275, -0.1870917678, 0.2145442069, 0.2237267196, -0.3245927095, -0.1132327095, 0.1227966994, -0.1630422622, 0.2324233204, 0.3118989766, -0.2270780057, 0.0936795697, -0.4663157463, 0.0080992877, 0.6656392217, -0.3257720172, 0.1022585407, 0.1635376811, 0.0983476341, -0.2311872542, 0.1086589843, -0.0553931929, -0.0797104686, -0.0385859236, 0.1303541809, 0.2308630049, -0.0946216285, -0.1622792184, -0.1658532917, -0.2639198303, 0.5142813325, -0.0872290879, 0.2348758876, 0.3476692438, -0.0908902436, -0.2052479833, 0.3716835678, -0.0414165743, 0.1036917493, 0.2142171562, -0.3256300092, 0.0535454787, -0.0730224922, 0.0921149999, 0.1350723058, -0.0252536051, 0.0498599559, -0.0339630581, 0.0881131291, 0.1063457876, -0.2813716829, 0.1484551728, -0.1486713588, 0.0176728256, -0.110321179, -0.0677543879, -0.2025364488, -0.1761355996, -0.0231414437, 0.2861522734, -0.3305155337, 0.1278510243, -0.4923218787, 0.2535888851, 0.0675133467, 0.1056317091, 0.1362589598, 0.1969210654, 0.1536068767, -0.0305047482, -0.1565905511, 0.2011709213, 0.0490438119, 0.0091489032, 0.3590286374, 0.2326782644, 0.0966185331, -1.0042270422, 0.3522103429, 0.4355178177, 0.1550199091, -0.1452269554, -0.0021775123, 0.6890769005, 0.2010133415, 0.2365345359, -0.0610619411, -0.0508689508, 0.0942548364, 0.1049326658, -0.1251618266, 0.0396531075, -0.085084185, -0.0466094129, 0.2758449912, -0.063929081, -0.3997495174, -0.014944274, 0.1547491103, -0.0097323954, 0.075100556, 0.3563734293, -0.5196489096, -0.1247841567, 0.3244450688, -0.3547012806, 0.1424792707, 0.1628666967, 0.1763050854, 0.0010703728, -0.0438616686, 0.0199415945, 0.262776494, 0.0312215667, 0.4762643576, 0.0328030661, 0.1253218353, -0.0937408134, -0.3203768432, 0.0578690916, -0.1390545666, -0.0352986008, -0.4970811605, 0.1807907224, -0.4068139195, -0.1239832342, -0.2987782061, -0.0224424656, 0.0396810286, -0.1091317832, -0.2386261225, 0.0302583948, 0.3040400147, 0.0953089073, -0.4173566103, -0.334381938, 0.2197837085, -0.2575615942, -0.0490854718, -0.1521479636, -0.1422961354, -0.0792500228, 0.0874342918, 0.0642261803, 0.2967348099, 0.1606132388, 0.117771551, -0.3894567192, -0.1165062189, 0.0104809031, -0.1332973391, 0.0998920798, 0.1726038009, 0.1334909201, 0.1722553968, 0.0761117488, 0.0592286699, 0.034676224, -0.0320951454, 0.1489338279, -0.3590314388, 0.1663264483, 0.4372859895, -0.1095227301, -0.2783698142, -0.2167599797, -0.3826253414, 0.0475440174, 0.1732871234, -0.1151541397, 0.3042677939, 0.1316342354, 0.2117644846, -0.0758676752, -0.1215802282, -0.0538327843, 0.360645473, -0.0776255876, -0.3281580508, -0.1559720933, -0.2494733334, 0.0884209424, 0.2179974318, -0.3521412015, 0.1593417227, -0.1564195305, 0.3416545391, -0.0553479716, -0.0349267647, 0.3035982549, -0.1843934357, 0.1471060365, -0.2114262283, -0.248805806, 0.061329931, -0.1483646333, 0.3629366159, 0.3649739325, 0.4517161846, -0.1608112156, 0.9838786125, -0.0303147696, -0.335904628, 0.5201298594, -0.126121372, 0.0862394422, -0.2030791938, -0.2672267258, -0.0298659001, -0.0799618214, 0.4489380121, 0.1056018919, -0.1356224865, -0.1475101709, 0.0822239965, 0.0455774441, -0.1306180656, -0.06609983, 0.2251465917, -0.8449303508, -0.1056761071, 0.0727222264, 0.0569751337, -0.2449698001, -0.0726713836, 0.0564687587, 0.3254695535, 0.2142679095, 0.2519316673, -0.3784075379, 0.1734533608, -0.2046068907, 0.4338722229, -0.0459957756, 0.5219180584, 0.1248014569, -0.0683133751, 0.0906440318, -0.0323842987, 0.4775120914, -0.1738084555, -0.0706754029, 0.0359211788, -0.0255808011, -0.4465416074, 0.0172569826, 0.0562240034, 0.0697536767, -0.0893029571, 0.1419756114, -0.1395868212, -0.4577145576, -0.0526839569, 0.0157328472, -0.0781968385, 0.2679592371, 0.0275435969, -0.2418020368, 0.0301983431, 0.032504335, 0.0150477961, -0.0481003448, -0.1440619826, -0.2042282075, -0.4858334959, 0.0070129931, 0.2883125842, -0.1957106441, 0.2373309582, -0.0884490162, -0.0736440644, -0.2873152196, 0.3368114531, 0.2056099176, 0.2770309746, -0.1854194105, -0.1713094711, 0.0132958964, 0.2324947119, 0.3811324239, 0.0995613486, -0.0634259284, 0.2771747112, 0.0227147266, -0.0596835613, -0.3146491051, 0.1943285763, 0.317125231, -0.0140809864, -0.5217671394, -0.442794621, 0.673605144, 0.1517964303, 0.1031019688, 0.1824989766, 0.2905762196, -0.2887246609, 0.6902828813, 0.1923063695, 1.0491650105, -0.1496042162, 0.3091433346, -0.0192479976, -0.3549839258, 0.1914817989, -0.0620067045, -0.0127193686, -0.5064070225, -0.0988878161, -0.1696775705, -0.1890803725, 0.0456675813, 0.1084339023, 0.345969975, 0.2118417621, -0.1081130952, -0.0356303789, 0.0932142138, 0.1610934734, 0.0246000122, -0.2186434865, -0.0476578921, 0.0867055804, -0.2787377834, 0.1409862787, 0.045418147, -0.3511816561, -0.1316139996, -0.0653835982, -0.0387329757, 0.135840863, -0.3878102899, 0.1912805736, -0.0955748111, -0.7221959829, 0.3027079701, 0.2570641339, 0.372900933, -0.1525343657, -0.0759720281, 0.1517223418, 0.454407692, -0.1220794022, -0.0165470578, -0.1029005125, 0.2754592001, 0.0021333024, -0.0121419728, 0.0144780893, 0.0496027805, -0.3540495038, -0.3075188398, -0.1008297652, 0.4927372634, -0.2824707627, -0.5382115245, 0.1809417009, -0.0280426405, -0.0404093303, -0.0311693363, 0.0760162845, -0.1006564051, 0.0231767911, 0.2196098864, -0.3577341735, 0.0479489043, 0.3908984661, 0.2444617897, 0.354552865, 0.4260511696, 0.1283818632, -0.0747563764, -0.0551734343, 0.242757529, 0.7975459695, -0.2431240678, -0.095593527, -0.0828490257, -0.0964282826, 0.1759668887, -0.1229593158, -0.1000611708, 0.0187574476, -0.0037023872, -0.2240096629, -0.3872652054, -0.0501666293, -0.5921082497, 0.12927863, 0.044595629, 0.0095894672, -0.3298639059, 0.1190789565, -0.1190347821, 0.1844638586, 0.2547361851, 0.1583482325, -0.1665882766, 0.1188057959, -0.0005613901, 0.1166003048, -0.0072355531, 0.0770440474, -0.1851372272, -0.1235982329, -0.2432996631, 0.2295061648, 0.0940969586, -0.1306689084, 0.0751339495, -0.2411130965, -0.2445297986, 0.0727368742, 0.1853951216, 0.1755364835, 0.1117694527, 0.3480851948, 0.3641875088, -0.0677337199, -0.2277563363, 0.0497229919, 0.3066654205, 0.3425447345, -0.1606394202, 0.110438168, -0.1617768109, -0.2147651911, -0.4247929752, 0.1144335121, 0.5022953749, -0.0028917408, 0.1857273281, -0.1026445925, 0.1288244873, -0.2557851672, 0.1771663427, 0.3922426403, -0.0652695894, -0.0092792325, 0.095493868, -0.0923824236, -0.3175991476, -0.0011594482, -0.2000230551, -0.3673341274, -0.1038195714, 0.0687590316, 0.137066558, 0.5545263886, -0.1259820014, -0.3066503108, 0.0544887185, -0.3451067209, -0.1011900008, 0.4092557132, 0.1976180971, 0.0214369241, 0.3924003243, 0.219571054, 0.2428044379, 0.228448987, 0.3846334219, 0.8282758594, 0.6093143821, 0.0693634599, 0.4093190134, -0.4392861128, -0.3943208754, 0.2902412713, 0.1612641066, 0.0955129415, 0.0909386575, 0.5308840871, 0.1345909089, -0.611635983, 0.1243950278, 0.1417171955, 0.0394369476, -0.387190491, -0.0720666498, 0.0942413211, -0.336030066, -0.1689390838, -0.304747045, -0.1319286674, -0.0257734992, 0.2366739959, 0.0376940593, -0.0770480931, 0.0455892012, 0.1857754588, -0.1383958012, -0.0701647401, 0.170315966, -0.1693472564, -0.0163694322, 0.1089868098, 0.1222433597, 0.2206778973, -0.0236987397, -0.3086423874, -0.1027003005, 0.4592532814, -0.1692237258, 0.3425980806, -0.0366074294, 0.2029948235, -0.059970919, 0.3750295043, -0.0327130035, 0.0678917617, 0.1241496652, 0.0405823179, 0.0066335127, -0.0242572986, 0.3539987803, 0.0674851537, 0.0228485987, -0.1710182875, -0.0509919748, -0.3561059833, -0.0426159017, 0.5597946048, -0.2557030618, 0.1359279603, 0.0525567159, -0.0106769875, -0.1017213911, 0.1591458023, 0.3113599122, 0.1135584787, -0.391685307, 0.0128199309, -0.2028859556, 0.019314561, -0.0143974675, 0.0728558451, -0.0521282293, -0.0008849949, 0.3236848116, -0.0529136695, -0.0882761925, -0.0321375355, 0.2348829508, 0.4995101988, 0.0454162657, -0.1006598994, -0.3244430125, 0.3683190048, -0.1543809772, -0.3648247123, -0.0524974875, 0.220897764, -0.1017181426, 0.03080808, -0.2137625217, 0.5447204113, -0.0581354201, 0.2709105611, -0.0344843566, 0.4849646091, -0.2545775771, 0.1276672035, 0.1671371162, -0.0664453208, -0.4173105657, 0.193307817, -0.1038349271, 0.329813391, -0.0180289298, -0.0523741171, -0.0487000123, 0.1613541096, -0.103182815, -0.3979179263, -0.2104852796, 0.5480267406, -0.2608941495, -0.0680660009, 0.3363808393, 0.5139483213, 0.1706795394, 0.2059371769, -0.2271480858, -0.1567136645, 0.5854462981, 0.1026790142, -0.0993438512, 0.1165447906, -0.0490632057, 0.3045932651, 0.017185593, -0.3708270192, -0.1677886248, 0.1889813542, -0.267077893, 0.1175101399, 0.2422825098, 0.2049199045, 0.2456116378, -0.2822865844, 0.3716866374, 0.2165392935, 0.0090612918, -0.1876167655, -0.3382447958 ]
https://github.com/huggingface/datasets/issues/2165
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset
@lhoestq Sadly, from Python 3.7 onwards `torch.utils.data.Dataset` doesn't support the virtual subclass mechanism due to `typing.Generic` type no longer having `abc.ABCMeta` as its metaclass. With that in mind, another option is to remove a direct type check (`isinstance(dataset, torch.utils.data.Dataset)`) in `deepspeed.initalize` and to rewrite the checks in a manner similar to `torch.utils.data.DataLoader` ([link](https://github.com/pytorch/pytorch/blob/b80c6f863f2327c712c478f67c248b94d66b65ac/torch/utils/data/dataloader.py#L197-L239)). This is exactly why the `DataLoader` works with arbitrary objects that provide `__getitem__` and `__len__` (and in our case, the `ArrowDataset`). By doing so, their code wouldn't be any stricter in comparison to the `DataLoader`. So if you agree, I can open an issue in their repo and fix this if they like the idea.
Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset?
108
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset? @lhoestq Sadly, from Python 3.7 onwards `torch.utils.data.Dataset` doesn't support the virtual subclass mechanism due to `typing.Generic` type no longer having `abc.ABCMeta` as its metaclass. With that in mind, another option is to remove a direct type check (`isinstance(dataset, torch.utils.data.Dataset)`) in `deepspeed.initalize` and to rewrite the checks in a manner similar to `torch.utils.data.DataLoader` ([link](https://github.com/pytorch/pytorch/blob/b80c6f863f2327c712c478f67c248b94d66b65ac/torch/utils/data/dataloader.py#L197-L239)). This is exactly why the `DataLoader` works with arbitrary objects that provide `__getitem__` and `__len__` (and in our case, the `ArrowDataset`). By doing so, their code wouldn't be any stricter in comparison to the `DataLoader`. So if you agree, I can open an issue in their repo and fix this if they like the idea.
[ -0.192057848, -0.2704026699, 0.0988817513, 0.3232177496, 0.2382785082, 0.1883172095, -0.0456597582, 0.3633682132, -0.1526028216, -0.2291757464, -0.2917281389, 0.3924196959, -0.2503363192, -0.1537754238, 0.1516402364, -0.2407062203, 0.1811589748, 0.0032432005, -0.269873023, -0.1991648078, -0.1094514653, -0.1029923558, 0.0290848017, 0.0508623943, 0.0944086239, 0.1040174291, 0.0816432387, 0.1808157265, -0.1128339171, -0.3632006049, 0.3348352909, 0.0631519258, 0.5683202147, 0.3380848169, -0.0001285924, 0.2495381236, 0.151609093, -0.0954123214, -0.0486182384, 0.0058685839, -0.0310989395, -0.1078800708, 0.2537959516, -0.0793688744, -0.2585174739, -0.6241514683, -0.1227698028, -0.5026622415, 0.0664019212, 0.4283708334, 0.0463511795, 0.3282434642, 0.0120558962, 0.0952220932, 0.2861973047, -0.0377573334, -0.164708674, 0.1939547062, 0.0586136207, 0.163357228, -0.1833065599, 0.0865233392, -0.1490783244, 0.0236568376, 0.4681111276, -0.2537769377, -0.3934952617, -0.1979159266, -0.1612959802, 0.5067213774, 0.2559037805, -0.3469011188, -0.2240124345, 0.0779629871, -0.0618263111, -0.1476533413, -0.2178596556, 0.104493916, -0.0763133988, 0.075104326, 0.0757468492, 0.0165285133, -0.1876957715, 0.1010663509, 0.1476612687, 0.1680383533, 0.1117824093, 0.1688791215, 0.1994538456, -0.3436611891, 0.3780584335, -0.2171823531, 0.0021822588, -0.1452049166, -0.1031781361, -0.1081250533, -0.3531705737, -0.1528615654, 0.3830359578, 0.130104959, 0.3453946412, 0.3318166137, -0.2277627885, 0.0814988315, -0.0249898974, -0.1177563816, 0.1623558253, 0.2724098265, 0.0154547952, -0.196226567, 0.0820426792, 0.2925753593, -0.142364502, -0.3170525432, 0.1186280847, 0.0623504966, -0.1232673228, -0.135972321, -0.1813089401, -0.1504850239, -0.2349576503, 0.0214679986, 0.1157315373, 0.1644117683, -0.0010171086, 0.2184426785, 0.3691659272, 0.5446547866, -0.2553102076, -0.1770916134, 0.0780242905, 0.1107357889, -0.075011313, -0.2217587233, 0.0215196162, -0.179235667, 0.0170277953, -0.0673136041, -0.1304962039, 0.3081125021, 0.2849660516, -0.1399290711, 0.2640924156, 0.0662934929, -0.0842039213, 0.0411606282, 0.3640844524, 0.4290804267, -0.3253012896, 0.2448958009, -0.3367204964, -0.1767989993, -0.1608818769, 0.0041706087, 0.1324419081, -0.3356075883, -0.3940817714, 0.1987403631, 0.0049033687, 0.0119570792, 0.0823146105, -0.558611393, -0.2367928028, -0.195395261, 0.2141402066, 0.2105924487, -0.4652601182, -0.1148306206, -0.0323483497, -0.1110006124, 0.1935071349, 0.3073975742, -0.2178398371, -0.0256788582, -0.3970094621, -0.0204567611, 0.5086791515, -0.2867498398, 0.0247854441, 0.1531436592, 0.104812637, -0.0957696587, 0.1215048805, 0.0464644842, -0.0526721105, -0.1397290528, 0.1875388622, 0.1678763777, -0.1229536757, -0.2729189992, -0.1068386883, -0.2577289939, 0.3619751036, -0.0371051431, 0.1300511062, 0.2110432088, -0.121366784, -0.2831218541, 0.2862466276, -0.0242852494, 0.1068467274, 0.1502740234, -0.2012930959, 0.1783106923, 0.0183903016, 0.0233058482, 0.0052240947, 0.154156208, 0.0099737123, 0.0297068264, -0.0348643325, 0.0375258178, -0.1254972368, 0.1646587253, -0.0355100483, 0.0571012385, -0.0778036863, -0.0694771484, -0.2363842279, -0.2742443383, -0.1225569919, 0.0787644312, -0.4409392476, 0.1783934832, -0.5549849272, 0.1552928835, 0.1712522209, 0.1183063611, -0.0533450358, 0.2489914298, 0.0549135841, -0.0293417014, -0.1652684361, 0.1796411425, 0.1238947362, -0.0634163693, 0.2238180637, 0.289555341, 0.0666509196, -0.8759513497, 0.3386188745, 0.47764045, 0.1758343279, -0.0606288202, -0.0306876153, 0.6746480465, 0.269923985, 0.2855537534, -0.0329920873, -0.0099479109, 0.0626336634, 0.2108589411, -0.2279219925, 0.0115738362, -0.1417210847, 0.1783373505, 0.2537432909, 0.0383245349, -0.2435815632, 0.0231188778, 0.0286005009, -0.1075291783, 0.1185364127, 0.3567152917, -0.5336508751, -0.0171269812, 0.2257867008, -0.1542959362, 0.2203959376, 0.0797828585, 0.2486360818, -0.0573246107, -0.10599944, 0.0514932871, 0.3088958859, 0.0781623721, 0.3587371707, -0.032341823, 0.0559453368, -0.0559261739, -0.3572989106, 0.0482361615, -0.1054935083, -0.091563791, -0.511428237, 0.2086583674, -0.4489861727, 0.0558849573, -0.3178323209, -0.114608556, -0.0138479713, -0.1688976288, -0.1546976566, 0.0197161417, 0.1207131445, 0.1362332255, -0.4001926482, -0.1381533593, 0.2074002624, -0.467045635, 0.048338756, -0.1286060512, -0.2392185479, -0.1104203016, 0.1444949657, -0.1327438951, 0.2613070011, 0.2039721906, 0.0211455747, -0.4411429763, -0.1653213501, 0.0843045413, -0.1655037552, 0.072438173, 0.2261060625, 0.0766591579, 0.3106865883, -0.0076398812, 0.0699215382, -0.0379850417, -0.0956488103, 0.1708253026, -0.3793536127, 0.2229391038, 0.3711147904, -0.1360010803, -0.3164052069, -0.2379694879, -0.3310386539, 0.0463843495, 0.121781528, -0.0089486707, 0.3633456826, 0.1398115456, 0.2525965273, 0.0753093138, -0.0746523291, -0.0394737422, 0.4306190312, 0.0210850872, -0.3091743588, -0.1776060462, -0.354142487, 0.1667935401, 0.3370672762, -0.3112229109, 0.0742644593, -0.2507444024, 0.3438510597, 0.0475700088, -0.0304726269, 0.3099018037, -0.1462942809, 0.0725222975, -0.2030640543, -0.1782543063, -0.0180772841, -0.2516229153, 0.312164396, 0.3920450509, 0.4929164946, -0.1153865755, 1.0432755947, -0.122042574, -0.5147121549, 0.4142385721, -0.1147443578, 0.1429578513, -0.1226010174, -0.2998678088, -0.0853657275, -0.2901656628, 0.2939035892, 0.0313188061, -0.1601836085, -0.2480986118, 0.1413031071, 0.1854308546, -0.0607379749, -0.1736498773, 0.3794944882, -0.8608569503, -0.0809375346, -0.0547407232, 0.1458545774, -0.3503082395, -0.0442953445, 0.0788316876, 0.280605197, 0.1299972832, 0.1442871392, -0.2763811052, 0.1273891628, -0.1922661662, 0.4928199649, 0.0262336992, 0.6061599255, 0.1682635993, -0.2415485084, -0.0266087167, -0.0479808748, 0.336804688, -0.1201386973, -0.0284863394, 0.1070724577, -0.1537739635, -0.5539867878, -0.0416312926, -0.009198755, 0.0008518249, -0.0880939141, -0.0115806609, -0.2062879503, -0.3495069742, -0.0042241402, -0.0204432718, -0.0742840767, 0.2395647168, -0.061891675, -0.1756764948, 0.0153799057, -0.0085255429, 0.1251473725, -0.0059990808, -0.1849316657, -0.1844235212, -0.4665317237, -0.0728021637, 0.319319725, -0.1954095662, 0.2066612691, -0.0913770795, -0.0270608142, -0.1993323117, 0.3776909709, 0.3188764453, 0.4460636973, -0.1958580017, -0.31458655, 0.1087745577, 0.3574342728, 0.3197104931, 0.1772992611, -0.1695222557, 0.2552006841, 0.103203997, -0.1656400561, -0.3990433812, 0.1485094279, 0.3337714076, -0.0139878355, -0.3849737048, -0.5564723611, 0.7538574934, 0.3035253584, 0.1560621858, 0.3382982314, 0.2668630481, -0.2794842124, 0.5248177648, 0.4079274833, 1.0512192249, -0.0509784818, 0.3578880727, 0.0595652349, -0.191204384, 0.1738314182, -0.0342136621, 0.0107819103, -0.4742810726, -0.1591958106, -0.1777701825, -0.1990579665, 0.0807507485, 0.0677644983, 0.3001704812, 0.1468987316, -0.156898424, 0.1233607084, 0.144384712, 0.1370037496, -0.2108581066, -0.2943649292, 0.0387039296, 0.0807715282, -0.1526232958, 0.0323705561, 0.0839409828, -0.2476137131, -0.1776068509, -0.0623993427, -0.1743369997, 0.0983657241, -0.3862045109, 0.2085453123, -0.0430507287, -0.621380806, 0.3718841672, 0.2089664489, 0.3346468508, -0.2072173357, -0.1145253703, 0.0898872912, 0.4293412268, -0.0604887679, -0.0188369509, -0.1988705844, 0.4383510351, 0.1158379465, 0.1028565913, -0.0041479953, 0.0040067062, -0.3716761768, -0.1788451523, -0.1418666244, 0.4884428978, -0.360005796, -0.3033030331, 0.0732418001, -0.1057726443, -0.0269545875, -0.0135334954, 0.0660571903, -0.0794527829, -0.0298244506, 0.2205510139, -0.3070402741, 0.1049225479, 0.3794657886, 0.2592764199, 0.2761068344, 0.4509202838, 0.1658734977, -0.0842058137, -0.0840313882, 0.2752796113, 0.938110292, -0.2417884469, 0.1131499261, -0.0707233176, -0.1823948175, 0.1009257212, -0.1334837973, 0.1055530608, 0.011717597, -0.1784546673, -0.200799793, -0.473012507, 0.1066847742, -0.4885847867, 0.2522220612, -0.1127748191, -0.0003833063, -0.2478292584, 0.0050858501, -0.1294638813, 0.1128220037, 0.2081630379, 0.0766922832, -0.1583958566, 0.1341680735, -0.0013008341, 0.1834420264, -0.0373185202, 0.1008871049, -0.2249791622, -0.0719659701, -0.2094804645, 0.2116008997, 0.0788344443, -0.048704505, 0.1003222391, -0.2600993514, -0.2248567045, -0.045503743, 0.1009888202, 0.0768971294, -0.025003273, 0.3361884654, 0.3974798322, -0.0176139772, -0.2065621912, 0.0856437087, 0.2487573624, 0.4111219049, -0.0284356531, 0.0919955, -0.1686855406, -0.2521201074, -0.3187127113, 0.2463506758, 0.4437053204, 0.0474103801, 0.2199502885, -0.074514091, 0.0695229173, -0.3206495941, 0.2149879485, 0.4866549671, -0.0578187741, -0.0545590483, -0.0114213098, -0.0757068843, -0.2705472708, -0.0455036201, -0.2741254568, -0.3820185959, 0.0093017817, 0.0925431848, 0.1122258529, 0.5620797276, -0.0893050879, -0.2566852272, 0.0706405789, -0.295481503, -0.0283845346, 0.4573875964, 0.1571799517, 0.0178327113, 0.4557398558, 0.1562422812, 0.3069687486, 0.2131177783, 0.3235086203, 0.8402157426, 0.5083609819, 0.0241862722, 0.4163292646, -0.4468280077, -0.1702665389, 0.3761988282, 0.2840806246, 0.1153381318, 0.138160333, 0.4704505801, -0.0412483662, -0.4836516678, 0.0164681673, -0.0143048661, 0.0409526862, -0.3381248713, -0.3427486718, -0.0142063722, -0.4155673981, -0.2136503458, -0.328461796, -0.1840655506, -0.0310498588, 0.1535819173, -0.0573644303, -0.2048216611, 0.0162404161, 0.1845864356, -0.1490475833, -0.0861727074, 0.0984741673, -0.0619468093, -0.0533340424, 0.0844016522, 0.1812230647, 0.2301817238, 0.1560851634, -0.3443413377, -0.0796004683, 0.3975014985, -0.1332998276, 0.285816133, -0.0066146851, 0.0329283103, -0.0504841097, 0.3187775016, -0.0040305555, 0.0654802173, 0.021026399, -0.0072604958, 0.0509195663, -0.0689638555, 0.5326979756, 0.1324304938, 0.032545045, -0.1482272148, 0.0540765598, -0.3688840866, -0.1557073742, 0.6477062702, -0.1662311554, 0.1110664457, 0.0502601564, -0.0144341514, -0.0233090483, 0.3688513935, 0.364702642, 0.0189682338, -0.346632719, 0.0738322139, -0.3001284003, 0.0229694135, -0.0210430436, 0.0045113713, 0.0339845978, 0.0613775477, 0.5213209987, 0.0317594409, -0.0474656001, 0.0604747199, 0.1181072071, 0.3871956766, -0.0312985703, -0.2424381375, -0.125830844, 0.343036741, -0.1222835183, -0.3957667649, -0.0955137983, 0.1792187989, -0.0882431716, 0.0777843371, -0.3348729014, 0.627992034, 0.0028237836, 0.3965134621, 0.0139710885, 0.477353543, -0.1456065774, -0.0347251631, 0.0490616709, -0.0706800371, -0.4631292522, 0.2110551894, -0.149964869, 0.3279790878, -0.0359973349, -0.1442198753, -0.1181407422, 0.1551755667, -0.1119900942, -0.4463452399, -0.3844430447, 0.5214523077, -0.32299757, -0.0472745784, 0.1672797352, 0.4711970687, 0.1661390811, 0.2436237037, -0.2501743734, -0.216193378, 0.5785573125, -0.0363398194, -0.1052248403, 0.0236456878, -0.0473427624, 0.228759259, 0.1911901236, -0.3108552694, -0.1146498621, 0.1373114437, -0.2019239366, 0.1190906763, 0.171131894, 0.2146115452, 0.2068585157, -0.3751350045, 0.4397042096, 0.1238743439, 0.0825857595, -0.2764618099, -0.3310403824 ]
https://github.com/huggingface/datasets/issues/2165
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset
That makes sense ! Feel free to open an issue on their repo and discuss this idea
Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset?
17
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset? That makes sense ! Feel free to open an issue on their repo and discuss this idea
[ -0.2620021105, -0.3059777617, 0.0482734963, 0.3386890888, 0.1174890622, 0.2266669869, -0.0971870944, 0.3648379445, -0.1662656367, -0.2185192853, -0.349786818, 0.394482851, -0.2521586418, -0.0014387369, 0.1679956913, -0.2934631705, 0.2071101516, 0.0787694082, -0.2426628768, -0.2180522084, -0.1317135841, -0.0721176788, 0.0561507195, 0.1099012047, 0.0453760475, 0.0387694016, 0.0631340668, 0.1353647262, -0.11498072, -0.3563356698, 0.2166967392, 0.0383349285, 0.5877936482, 0.2521913052, -0.0001278631, 0.1164885163, 0.0586813614, -0.1147668362, 0.106866695, -0.0929902643, -0.1743741632, -0.0208212137, 0.2010277808, -0.1319153756, -0.3075416982, -0.5764229298, -0.0690184012, -0.3266127706, 0.1039488316, 0.5637233257, 0.0582138598, 0.2589318752, 0.0555241704, 0.0262064375, 0.3165858388, -0.1475579739, -0.190179199, 0.0691052228, -0.0712908506, 0.1284112036, -0.1900315732, 0.1756012589, -0.157879442, 0.0448202603, 0.3596791029, -0.3286310732, -0.3591729999, -0.1928061247, -0.0682306141, 0.5270511508, 0.2203392386, -0.2135133743, -0.0389552154, 0.1802363843, -0.0732752532, -0.1967221648, -0.3787532747, 0.1982637644, -0.0162514374, 0.1270776987, -0.0345084071, -0.2056981772, -0.1423494518, 0.0715841651, 0.1724098623, 0.3733922541, 0.0766007155, 0.1745885462, 0.2233619839, -0.3262199461, 0.4041498899, -0.2009281516, 0.0032964582, -0.1929718554, -0.1247139499, -0.0328150243, -0.3565469086, -0.0698655099, 0.4570577741, 0.1322317421, 0.2172506452, 0.3089168668, -0.1965114325, 0.0849977434, -0.1674619764, -0.2068859786, 0.1313788146, 0.2410632819, 0.0171280652, -0.2703810334, -0.0161321089, 0.2712001204, -0.1041059494, -0.3959652781, 0.0039964467, 0.0003855843, -0.109118402, -0.2102984339, -0.1964522302, -0.2079258561, -0.268462956, -0.0502487458, 0.018877577, 0.2163885981, -0.0120289959, 0.0506803021, 0.2428292185, 0.6414880157, -0.2044615149, -0.0972007215, 0.0029478557, 0.0924844667, -0.0101871565, -0.1769014299, -0.0899686888, -0.1499866247, 0.1072870195, -0.031997472, -0.2831279635, 0.1549773216, 0.358820945, -0.0977343768, 0.2597135305, 0.0583751872, 0.0769044831, 0.0361858532, 0.2901770175, 0.4265044034, -0.3359181881, 0.2660285532, -0.5100518465, -0.1835342348, -0.1684624255, 0.0424548797, 0.1579412967, -0.3772471249, -0.4059721231, 0.328016758, -0.0173318014, 0.116955705, 0.0617809668, -0.4518922269, -0.3373083472, -0.1928303838, 0.1911067963, 0.2245468199, -0.3925153613, -0.1291612238, 0.1234336197, -0.1684452444, 0.2170879543, 0.330172807, -0.2159970999, 0.0313049853, -0.4144070148, -0.0111348778, 0.6295610666, -0.2943704426, 0.1210270226, 0.0977079421, 0.1029667407, -0.2821548581, 0.1250986755, -0.0195880421, -0.1065176949, -0.0370882638, 0.1584389359, 0.2269477397, -0.1056134701, -0.1747416854, -0.1187010705, -0.3208869696, 0.4772762954, -0.0665614977, 0.2013022751, 0.2817781568, -0.1068628207, -0.2452248037, 0.3179293275, -0.0725179985, 0.1154310554, 0.2461644262, -0.2807462513, 0.025296364, -0.0772585273, 0.1072365716, 0.1306118369, -0.0304074623, 0.0351785347, 0.0028213644, 0.0903303325, 0.0697007254, -0.2287644595, 0.1778739989, -0.1092271507, 0.0447429307, -0.0674027503, -0.0622883178, -0.1602268219, -0.1794359386, -0.0604320429, 0.1831256598, -0.3872934878, 0.1212605238, -0.5793861151, 0.2193061262, 0.0925740972, 0.1212814748, 0.0703065395, 0.209171921, 0.1279126406, -0.0046756826, -0.1303328723, 0.1874113977, -0.0221338943, 0.0734136477, 0.3958809972, 0.3856074512, 0.0828465745, -1.05823946, 0.3952001333, 0.4471335709, 0.1119964644, -0.0961244404, -0.0695657805, 0.6733709574, 0.1918670535, 0.2059760839, -0.0288745984, -0.0767914951, 0.1104536727, 0.1275687516, -0.2036572844, 0.0659691468, -0.0860861093, -0.0166579001, 0.3008361459, -0.018497549, -0.3902417123, -0.0255357176, 0.1084865034, 0.0096152425, 0.0751608536, 0.3450945616, -0.5225221515, -0.1504499316, 0.2817338705, -0.3142380714, 0.1200882494, 0.1677169502, 0.2351466864, 0.0198727716, -0.0947348624, -0.0013715252, 0.2785581946, -0.0029329769, 0.4571769238, 0.0140753631, 0.0845478475, -0.0685093403, -0.3553753197, 0.0135918483, -0.1594935209, -0.0283023585, -0.4566039741, 0.1471642554, -0.4094290137, -0.1325121671, -0.2963463366, -0.0165235698, 0.0800620541, -0.0948296338, -0.1525071561, -0.0411938094, 0.2538256347, 0.0888529643, -0.4279692173, -0.2591484487, 0.2284209728, -0.2501131296, -0.0765270144, -0.1794055849, -0.1035004258, -0.0624711663, 0.0933520794, 0.012155693, 0.2956860065, 0.1202920824, 0.1410051584, -0.4283613563, -0.1182047129, 0.0054057348, -0.1314726919, 0.0446436107, 0.1953774691, 0.1535258889, 0.1918287277, 0.0539568216, 0.0574832857, 0.0092915371, -0.036696218, 0.1131212935, -0.4322035909, 0.1673467755, 0.4726241529, -0.157284379, -0.3136515319, -0.2182980031, -0.3373822868, 0.0825213268, 0.141890347, -0.1249801069, 0.3699385524, 0.149887234, 0.1845365167, -0.0177838281, -0.0911418945, -0.0760117769, 0.344949156, -0.0636729524, -0.2971727848, -0.1309772283, -0.2379547358, 0.1214392334, 0.2287801802, -0.3549240232, 0.1684110314, -0.1870065331, 0.3227962255, 0.0330061093, -0.0170314461, 0.3250388801, -0.1784801185, 0.1134302765, -0.1828920841, -0.232137233, -0.0109381713, -0.159389168, 0.3865181208, 0.4134477973, 0.465954572, -0.2001304477, 0.9793558717, -0.0141026415, -0.3777911067, 0.5141608119, -0.138168782, 0.1083691642, -0.1941892952, -0.2245257199, -0.0368073955, -0.1004951745, 0.3606393039, 0.0945610553, -0.1277506351, -0.1838698983, 0.1019633859, 0.1188520938, -0.1341591179, -0.0463945307, 0.25151214, -0.8417858481, -0.1052170843, 0.0155227035, -0.0152484253, -0.2573597431, -0.073672682, 0.0508031063, 0.2974079251, 0.2227787822, 0.2117644548, -0.4028935432, 0.1966190189, -0.2293697, 0.4388888478, -0.0812730938, 0.4864453673, 0.0975406393, -0.079500705, 0.0515805185, -0.0645755678, 0.3845902681, -0.1764781028, -0.1200196743, 0.0444983169, -0.0103805065, -0.4325417876, 0.0031332895, 0.0112126619, -0.0199565813, -0.0984148905, 0.168967694, -0.1514190435, -0.3656145036, 0.0058572795, 0.0054321103, -0.097840488, 0.3364622593, 0.0604638383, -0.2607180774, 0.0461717099, 0.0432056896, -0.0223429389, -0.0855612531, -0.1329709888, -0.2263629436, -0.4594126046, 0.0577057451, 0.2551598549, -0.2010530233, 0.2151522785, -0.1025257781, -0.0914753154, -0.2516612709, 0.3307198286, 0.2434740216, 0.3105362058, -0.2324687541, -0.1777085513, 0.0115960911, 0.3291947544, 0.3991327882, 0.1161215231, -0.0486038215, 0.2798422575, 0.0726904348, -0.1082512289, -0.3122852445, 0.1556277871, 0.3349766135, -0.0060934164, -0.5391889811, -0.469795078, 0.7293047905, 0.2588544488, 0.1164353043, 0.1840457469, 0.2264001071, -0.2593996227, 0.6836548448, 0.2476068437, 1.1105139256, -0.1505961418, 0.3254760504, -0.0553833656, -0.3049469888, 0.1974315941, -0.1390773207, -0.0372843817, -0.4860217571, -0.113075003, -0.174011156, -0.202886343, 0.0212462619, 0.1251729727, 0.3290600479, 0.1844539195, -0.077312693, -0.0389897227, 0.0793222636, 0.1365744323, -0.0199590735, -0.1847097576, -0.0652610958, 0.1012165993, -0.243309319, 0.0594142638, 0.0162273236, -0.3013004661, -0.1052427739, -0.0508491546, -0.0633063465, 0.1296347827, -0.3992003202, 0.1822523475, -0.0962810367, -0.7509377003, 0.2139521092, 0.2963109612, 0.3420211375, -0.1596007645, -0.1480834484, 0.1683667898, 0.4576700926, -0.1613235474, -0.0013216697, -0.0938170627, 0.2785464823, 0.0020788088, 0.0218587816, 0.0619200617, 0.0477988236, -0.3985947967, -0.3425131738, -0.1530279517, 0.4711920917, -0.2364470512, -0.5164054036, 0.2092848122, -0.0526449159, -0.0617270172, 0.0075551099, 0.1004682481, -0.0716266483, 0.0738554299, 0.2897486389, -0.3646854162, 0.0436401814, 0.3805156648, 0.2072924674, 0.3583515286, 0.3787144125, 0.1604649425, -0.0877013505, -0.0713326633, 0.2488459796, 0.8871480823, -0.2445991337, -0.0749845728, -0.0994510651, -0.0787956566, 0.2101044804, -0.1447383165, 0.0072237253, 0.000794692, -0.0470400378, -0.1608398408, -0.3713756204, 0.0323584042, -0.5008922815, 0.2149918675, 0.0250550434, -0.0857822895, -0.3493959904, 0.054962039, -0.1430901736, 0.1865432262, 0.2190355361, 0.1205221564, -0.101257965, 0.1273958087, -0.013158761, 0.1512588263, 0.0032076836, 0.0194386058, -0.1998086721, -0.1410712898, -0.2307723761, 0.2048526406, 0.1036017686, -0.1494741887, 0.0814375132, -0.2535158396, -0.2487976551, 0.0392642133, 0.1388666481, 0.1848520637, 0.1014312431, 0.2950355411, 0.3234409094, -0.0625922307, -0.184987694, 0.0561651997, 0.3580035567, 0.3486051261, -0.1593194902, 0.1167334467, -0.1748818457, -0.2942559123, -0.3524003625, 0.1472952515, 0.5240926743, 0.0277556404, 0.2010704577, -0.0655576959, 0.1321328282, -0.2486332059, 0.2128686011, 0.4067136943, -0.0934372693, 0.0560362786, 0.078491129, -0.0621012524, -0.3087410033, -0.0584249794, -0.2066040635, -0.3107796013, -0.0911207348, 0.0011046454, 0.1392414719, 0.5642008781, -0.1139527708, -0.2999233902, 0.0501894131, -0.3612251878, -0.117828995, 0.4179740846, 0.1900864244, 0.0165004469, 0.3872237504, 0.2478434294, 0.3203353882, 0.1747996658, 0.3979454339, 0.8507424593, 0.6488268375, 0.0659123361, 0.4314876497, -0.3954395056, -0.3699274361, 0.2533233464, 0.1470919847, 0.1307242066, 0.1713157743, 0.5190116167, 0.1368675828, -0.5436134338, 0.0644953698, 0.1760170311, 0.0215305928, -0.4329630136, -0.1627657712, 0.0446736068, -0.3134480715, -0.1461360753, -0.3626265526, -0.1190506443, -0.022694394, 0.1918983907, 0.0151509345, -0.0894164667, 0.1009465009, 0.1629136205, -0.144950524, -0.0583669432, 0.1631776541, -0.1606595367, -0.0456529669, 0.0503521152, 0.1854741275, 0.2472784519, -0.0190693233, -0.2948699594, -0.0716001987, 0.4638658762, -0.1851459891, 0.3130325377, -0.0494703501, 0.1871952713, -0.1125675738, 0.3059998155, 0.0126174018, 0.0503679365, 0.1502805501, 0.0073726522, 0.0001855008, -0.001683902, 0.282561779, 0.0821029544, 0.0098571181, -0.1640135199, -0.0108398832, -0.3895702362, -0.0628780648, 0.65428859, -0.2125017345, 0.1270782948, 0.0697137564, 0.0010597631, -0.0440517552, 0.1833193004, 0.3698514998, 0.1064890474, -0.3608700335, 0.0290926248, -0.2346725464, 0.0396538451, 0.0235652737, 0.1058873311, -0.0842463672, -0.0097635612, 0.3654390574, 0.0080631766, -0.0615915805, -0.04781349, 0.194883436, 0.5103930235, 0.0251610428, -0.1059497967, -0.2576792836, 0.3504761159, -0.1483099014, -0.3171126842, -0.056367714, 0.2402728498, -0.0793898329, -0.0301050358, -0.2307636738, 0.5451129079, -0.0586868152, 0.3227193952, -0.0544056669, 0.5014358759, -0.2844735384, 0.1069042683, 0.1247166917, -0.083706677, -0.4017590284, 0.218914181, -0.1264358014, 0.2732655406, 0.0107220635, -0.1001704112, -0.0257066675, 0.1373886615, -0.1320916414, -0.4687432349, -0.2303670943, 0.4813533723, -0.2396200001, -0.1400434673, 0.290784359, 0.4693761766, 0.2053032368, 0.1607208103, -0.1676559448, -0.1560057402, 0.563408494, 0.1537973434, -0.0410721414, 0.0822810978, -0.112146385, 0.3160584867, 0.0659186319, -0.3561656773, -0.1133615971, 0.148704648, -0.2926999032, 0.1281114221, 0.2271984518, 0.241016537, 0.2620631456, -0.3164124787, 0.4251030087, 0.2194575667, 0.0516382828, -0.2475767285, -0.3496404886 ]
https://github.com/huggingface/datasets/issues/2165
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset
@y-rokutan Hi, now if you install `deepspeed` from master (this feature will be available in the next official release), the code should work without subclassing. Let us know if you still have any issues.
Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset?
34
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset? @y-rokutan Hi, now if you install `deepspeed` from master (this feature will be available in the next official release), the code should work without subclassing. Let us know if you still have any issues.
[ -0.263549149, -0.3762313128, 0.0858725533, 0.3691843748, 0.1816753596, 0.3435537815, -0.0518240556, 0.4010275006, -0.1650430858, -0.2584494352, -0.3508138657, 0.3204570115, -0.2445641905, 0.0142727271, 0.1966752112, -0.3255872726, 0.2107611299, 0.0282451659, -0.2117953897, -0.2563452721, -0.2183749974, -0.0660058111, 0.0091975033, 0.138698265, -0.0008853935, 0.0312694609, 0.0924517587, 0.1584641784, -0.1116142496, -0.3660575151, 0.2941597104, 0.0659786761, 0.6609082222, 0.2473992556, -0.000130302, 0.1516995877, 0.0485582165, -0.099754937, 0.1597804129, -0.0868280232, -0.2239149213, 0.0278997719, 0.2070778459, -0.1289735883, -0.4146133065, -0.6126386523, -0.0347186401, -0.3231691122, 0.126707688, 0.452029109, 0.0357436463, 0.1441907287, 0.0045096204, 0.0439587981, 0.2477651983, -0.1934702694, -0.1854257286, 0.0936606675, -0.0743704364, 0.1410137713, -0.2250967026, 0.0856282786, -0.1529571712, 0.025686048, 0.474463582, -0.305649519, -0.3226054013, -0.2647329271, -0.0733929873, 0.5432498455, 0.2157950699, -0.2298211157, -0.1046037823, 0.1822218746, -0.0550585613, -0.2311103195, -0.3596683443, 0.2333779633, 0.017058704, 0.1305225044, 0.0112075396, -0.129914552, -0.1863081455, 0.0875600427, 0.2806094289, 0.3632270992, 0.085109517, 0.1512034237, 0.215520665, -0.2419121861, 0.343670547, -0.2262788415, 0.0070466362, -0.1812538058, -0.1346873045, -0.0533127189, -0.3148996234, -0.0849065036, 0.3781305552, 0.1288090646, 0.1740024537, 0.3770184517, -0.1272420585, 0.0730316564, -0.1347579211, -0.1246929765, 0.2171280384, 0.2373773754, 0.0385420993, -0.2505723834, -0.0205381513, 0.2715174258, -0.1502736211, -0.2897741497, -0.0468763709, 0.0514925309, -0.1515409946, -0.1765363216, -0.1665546298, -0.1864982843, -0.3177583516, -0.0514320806, 0.0475086607, 0.2343058586, 0.0550107323, 0.0473903418, 0.2683136463, 0.6924921274, -0.2033872008, -0.1185874641, 0.0322332978, 0.1174829751, -0.0959677994, -0.1980099082, -0.0800254792, -0.1564627141, 0.0190546662, 0.0263230242, -0.3015544415, 0.1301092207, 0.3758250475, -0.099675253, 0.2288134694, 0.0459038503, 0.0318006948, 0.0737637952, 0.3789966106, 0.4413589239, -0.3008754253, 0.271504432, -0.4328230023, -0.2426430136, -0.115690127, -0.0130985007, 0.1889715791, -0.2756026387, -0.4165628552, 0.3720362484, 0.0163511597, 0.1343853921, 0.0108786412, -0.4601103067, -0.4295723438, -0.1702982485, 0.225114882, 0.1835811436, -0.4052044153, -0.143809393, 0.0620042235, -0.1478809267, 0.2841459513, 0.2974842191, -0.1768797189, 0.0165130105, -0.3843534589, -0.0178858861, 0.5604594946, -0.2282062769, 0.1074004248, 0.1166637167, 0.1041463912, -0.2193726599, 0.1730726063, 0.0408263132, -0.0429625958, -0.0621203147, 0.1227763742, 0.2229838967, -0.1218195558, -0.2111680806, -0.1040381566, -0.2291263938, 0.4387812018, -0.0603311881, 0.2165648937, 0.3418135047, -0.1543976665, -0.2581009269, 0.375008136, -0.038285289, 0.141697526, 0.2198249102, -0.269879669, 0.1213156581, -0.0675664321, 0.0889884531, 0.2008628398, 0.0510114878, 0.0607858896, 0.0659818053, 0.1656823009, 0.0506544709, -0.1664158255, 0.1074292958, -0.1352770627, 0.0021148752, -0.106223233, -0.0797211006, -0.2741827667, -0.2691040635, -0.0904029906, 0.2340278476, -0.4500228167, 0.1428388506, -0.5754762292, 0.1612207294, 0.1305391341, 0.1429699063, 0.0562030077, 0.180255577, 0.093450658, -0.0646033362, -0.1435522884, 0.2007332891, 0.0485010818, -0.0976662263, 0.3783786297, 0.250243187, 0.0699368268, -1.0497537851, 0.3432000875, 0.4532097876, 0.0923511535, -0.1317550093, -0.0381981507, 0.6848373413, 0.2695322335, 0.2214421332, -0.0369541086, -0.0438537523, 0.0043839142, 0.1337312311, -0.2001352608, 0.0169997588, -0.1230774522, -0.0709821358, 0.2662940621, -0.0146302963, -0.3610470593, -0.0365435556, 0.0466163568, -0.0357977152, 0.1359191388, 0.3326890469, -0.5043027997, -0.0583158396, 0.2491912842, -0.1609597951, 0.1241283119, 0.1438813359, 0.2088500559, 0.007288957, -0.1011402011, 0.028205242, 0.2873184085, 0.0236929879, 0.3778465092, -0.063754037, -0.0188886169, -0.0708827972, -0.3746265471, 0.0985847861, -0.1449113935, -0.0693302602, -0.4895892739, 0.1309628785, -0.4484525919, -0.0711469501, -0.2224130332, -0.0177479535, 0.0441775583, -0.0495124012, -0.1779140234, -0.0210454017, 0.2825014889, 0.1720362008, -0.4338255525, -0.2607577443, 0.2005133927, -0.2989144623, 0.0215105265, -0.1439201087, -0.1155605763, -0.0867559239, 0.1291494668, -0.0038983934, 0.2609841228, 0.1594060659, 0.056651704, -0.2899436355, -0.1649592966, -0.027435407, -0.2137407213, 0.1000062451, 0.1556868255, 0.1725541204, 0.1556284875, 0.0278069712, 0.1050843298, 0.0160124004, -0.0390337333, 0.0990422815, -0.3585255742, 0.1676236391, 0.4255627096, -0.168936342, -0.2158079892, -0.2354135364, -0.3735868335, 0.030824244, 0.1254538, -0.1326864064, 0.2924015224, 0.0698173866, 0.2185605019, 0.0046677999, -0.0764476433, -0.0743275732, 0.3837728798, -0.0212692805, -0.3230697811, -0.1505280286, -0.2576107383, 0.1067479402, 0.1544964612, -0.3151590824, 0.1952720284, -0.2176488191, 0.2480792105, 0.0706428587, -0.101424776, 0.3441767097, -0.1542800665, 0.1413183808, -0.1726018488, -0.2886222601, 0.0019522756, -0.1891166866, 0.3890925944, 0.3815205991, 0.5699661374, -0.1861283481, 0.9883285761, -0.037308909, -0.3312838674, 0.5028916597, -0.084915556, 0.0929304361, -0.1694963872, -0.310775578, -0.0327690393, -0.1209054887, 0.3107076883, 0.1139408648, -0.1250901222, -0.1988016814, 0.1134590507, 0.1678771377, -0.0181296989, -0.051773686, 0.2330697775, -0.8297380209, -0.0912513882, -0.0216027275, 0.1228055507, -0.2273715287, -0.0501348563, 0.012153428, 0.3278546035, 0.1979079545, 0.2163318992, -0.3806887269, 0.1577456892, -0.219328776, 0.4085029364, -0.0704608858, 0.4912367463, 0.0933743417, -0.094997406, 0.0861582309, 0.0220692195, 0.3633368909, -0.1793453097, -0.0308418069, 0.1117617786, -0.1261214018, -0.4755628705, -0.055881165, 0.0296044797, -0.0462330468, -0.0690714195, 0.0467015579, -0.142749384, -0.4097146392, 0.0651430935, -0.1442106962, -0.0870093256, 0.2494538128, -0.0412376039, -0.2178961039, 0.0369093344, 0.0778646767, 0.028340891, -0.0556216016, -0.1522570848, -0.2364596725, -0.4242434502, -0.0366366394, 0.3029745817, -0.235510096, 0.2133248597, -0.0416628048, -0.0484553948, -0.2323368788, 0.3077422082, 0.2700437307, 0.285497278, -0.2015431374, -0.1715505123, 0.0880806893, 0.3263980448, 0.4192616343, 0.1228464246, -0.1259830296, 0.2496308386, 0.0854066536, -0.1699382812, -0.3876944482, 0.120457232, 0.3908453882, 0.0005139932, -0.5109202862, -0.548414886, 0.7228654623, 0.2101605237, 0.1095935702, 0.1810742021, 0.1794037074, -0.2531597614, 0.6627234817, 0.2255910039, 1.122707963, -0.1567257792, 0.3088034093, -0.0989398584, -0.2254076898, 0.1381102651, -0.0955767557, 0.0803967193, -0.4583057761, -0.223197192, -0.2168098986, -0.1797728837, 0.0752978176, 0.1701572835, 0.3530696332, 0.1755510569, -0.112994656, 0.0249556489, 0.1306481063, 0.1007456034, -0.0128158834, -0.210947603, -0.0458246246, 0.0714130998, -0.1820751876, 0.0481952876, 0.0235538669, -0.32560426, -0.0910584331, -0.0490229689, -0.0971545652, 0.1439702809, -0.3985099792, 0.2058292478, -0.137506783, -0.7237475514, 0.3812140822, 0.3280155659, 0.372320056, -0.1627023816, -0.0940276012, 0.1356173754, 0.3901247978, -0.1575114876, -0.038642142, -0.1192773581, 0.2890611887, 0.0428451374, 0.0100758821, -0.0111495499, 0.0320056453, -0.4106135368, -0.3022833467, -0.1543987393, 0.4988345206, -0.2720608711, -0.4807466865, 0.1492034644, -0.038566459, -0.0865035579, -0.0084986249, 0.0408657007, -0.1314419508, 0.0605041273, 0.2716687918, -0.358628124, 0.0340237692, 0.423602283, 0.2787995934, 0.4550120234, 0.3825233579, 0.2173409313, -0.0311765671, -0.0744189173, 0.3133799434, 0.9300652742, -0.1052508578, -0.0382370837, -0.0390760899, -0.1128383949, 0.2114230096, -0.1719279885, 0.058748018, 0.0183193162, -0.0646201819, -0.1465442777, -0.3974840045, 0.0350998044, -0.5616657138, 0.2371178865, -0.0131261125, -0.0443719402, -0.2860123515, 0.1106176525, -0.1105932817, 0.1045891941, 0.1652837843, 0.1090119854, -0.0535764694, 0.1778021604, 0.0395169742, 0.1697933674, -0.0288617108, 0.0214287564, -0.2437858284, -0.0856213421, -0.2043776959, 0.2034528553, 0.1092087775, -0.0705144554, 0.1099067852, -0.2208588719, -0.3213769794, 0.0353788733, 0.1673648208, 0.1290810406, 0.0602773614, 0.3388201296, 0.3320458531, -0.0992207825, -0.2505176365, 0.0117372423, 0.2476687133, 0.3977490366, -0.1052652448, 0.0479068235, -0.1343839318, -0.2938900888, -0.3598108292, 0.128237009, 0.4391295016, 0.0138455834, 0.2401821613, -0.118467696, 0.1339883059, -0.2098096162, 0.2071190178, 0.3725753427, 0.0018704012, 0.033005096, -0.0609832928, -0.0930858105, -0.3016679585, -0.0422551632, -0.1800867021, -0.300239414, -0.0902884305, 0.0289975367, 0.1032247096, 0.5535039902, -0.1385714114, -0.2539669275, 0.0602766871, -0.3215013146, -0.0014767386, 0.4246537387, 0.198587209, 0.0489682592, 0.4345269203, 0.2401870489, 0.3080203831, 0.267652303, 0.4743524194, 0.8348224759, 0.5884382129, 0.0774725974, 0.3680679798, -0.4591240287, -0.2820627391, 0.3882304728, 0.156826064, 0.079038851, 0.0688008741, 0.5054256916, 0.0001398213, -0.6188645363, 0.015946649, 0.0685017705, 0.0143842213, -0.3718110025, -0.2234374434, 0.099588573, -0.2777833939, -0.1721454263, -0.3405421972, -0.1036870033, -0.0677406117, 0.1796112359, -0.0009892657, -0.0781411305, -0.0416696109, 0.1533585042, -0.1269318461, -0.0614897795, 0.1845897585, -0.2294325233, -0.0330867022, 0.0950706899, 0.1865212172, 0.1773936749, 0.0341176875, -0.2639219761, -0.0837150514, 0.4728595614, -0.1462548971, 0.3952941, -0.057339482, 0.2248157263, -0.0314528309, 0.3200481534, -0.0349094272, 0.0801532418, 0.0922418833, 0.0229729898, 0.0439743772, -0.022646673, 0.348664254, 0.0821724087, 0.0068174154, -0.1428258568, 0.0078709684, -0.3138802052, -0.0179929789, 0.6848990917, -0.2469415665, 0.0772482678, 0.0536721833, -0.0274706706, -0.0573346093, 0.2777771354, 0.3100698292, -0.0601117685, -0.3868313134, -0.0088446289, -0.2415473759, 0.0332232788, 0.0033742716, 0.1420803517, -0.0431408472, -0.0373948887, 0.4060946703, -0.0286311619, -0.0117792189, -0.0328302644, 0.1235854402, 0.5267850161, 0.0577879697, -0.0698456168, -0.2128748596, 0.3947787285, -0.1954040527, -0.2832946181, -0.0827917457, 0.1895258725, -0.1277542114, 0.1008324027, -0.2137655914, 0.5065092444, -0.1021383181, 0.3509514928, -0.0359175801, 0.5236024857, -0.25780797, 0.1195466742, 0.1606179774, -0.0764292032, -0.4228773713, 0.2357123345, -0.132761538, 0.3454505801, -0.0522753969, -0.1511161625, -0.0333355665, 0.1769848764, -0.0893199146, -0.4472338557, -0.2921130061, 0.5438431501, -0.3005523086, -0.0901238695, 0.3235526383, 0.4553418159, 0.1936604828, 0.1463962495, -0.1793062389, -0.1881178468, 0.5304228663, 0.0859737843, -0.0885765329, 0.0214536004, -0.0912609249, 0.2373922765, 0.1098616198, -0.2435684204, -0.1449950933, 0.0951247588, -0.190358296, 0.0469833165, 0.2565312088, 0.2410613596, 0.213490501, -0.2993459702, 0.3301889598, 0.1673753262, 0.0171648785, -0.2032991052, -0.3716494739 ]
https://github.com/huggingface/datasets/issues/2165
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset
Worth mentioning that any function that expects a `torch..Dataset` (like `torch..DataLoader`) will fail a mypy-esque typecheck if a `datasets.Dataset` is passed, even though it implements the interface correctly (I think). The virtual subclass idea was a good one- I wonder if there's another workaround given the Generic issue. What we're really talking about is something similar to the structural subtyping semantics that `typing.Protocol` defines. If `torch..DataLoader` accepted anything that supports `__getitem__` and `__len__` methods this would be much easier. Not sure if there's a way to do this without the wrapper from the perspective of `datasets`.
Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset?
96
How to convert datasets.arrow_dataset.Dataset to torch.utils.data.Dataset Hi, I'm trying to pretraine deep-speed model using HF arxiv dataset like: ``` train_ds = nlp.load_dataset('scientific_papers', 'arxiv') train_ds.set_format( type="torch", columns=["input_ids", "attention_mask", "global_attention_mask", "labels"], ) engine, _, _, _ = deepspeed.initialize( args=args, model=model, model_parameters=[p for p in model.parameters() if p.requires_grad], training_data=train_ds) ``` but deepspeed.initialize accepts torch.utils.data.Dataset only. How can I convert HF-style dataset to torch-style dataset? Worth mentioning that any function that expects a `torch..Dataset` (like `torch..DataLoader`) will fail a mypy-esque typecheck if a `datasets.Dataset` is passed, even though it implements the interface correctly (I think). The virtual subclass idea was a good one- I wonder if there's another workaround given the Generic issue. What we're really talking about is something similar to the structural subtyping semantics that `typing.Protocol` defines. If `torch..DataLoader` accepted anything that supports `__getitem__` and `__len__` methods this would be much easier. Not sure if there's a way to do this without the wrapper from the perspective of `datasets`.
[ -0.2078214884, -0.233148694, 0.1384681761, 0.2725796103, 0.266826719, 0.1537621021, -0.0031083301, 0.3240682781, -0.0748965517, -0.2203991562, -0.3576211333, 0.3906598389, -0.2636040151, 0.1052077338, 0.2797997296, -0.211358726, 0.1772635877, -0.050131198, -0.1659513712, -0.1595475972, -0.1771478951, -0.1184023321, 0.0547708869, 0.0935724527, 0.1425068378, 0.0650050491, 0.0786018223, 0.2379956692, -0.1792036444, -0.2768820524, 0.3760772943, 0.1968693286, 0.4361510277, 0.1904755831, -0.0001295324, 0.2556095421, 0.1330810785, -0.1514338851, -0.0350120068, 0.0231364146, -0.0956844762, -0.0058038235, 0.1660962105, -0.0608774573, -0.2630536556, -0.6010504365, -0.0813808292, -0.3644054234, -0.0128698982, 0.3584638238, 0.0206217021, 0.3547853827, 0.0011108294, 0.0559759103, 0.2998209, 0.0063132048, -0.1517211348, 0.0891330838, -0.1101552993, 0.1564472914, -0.2003159821, 0.0171440355, -0.1828864217, -0.0504501835, 0.4789531827, -0.2569851577, -0.4116527736, -0.1110195741, -0.114888154, 0.5390316248, 0.1896054149, -0.3263989985, -0.2952816486, 0.0647180974, -0.1126724631, -0.1941776872, -0.2395133525, 0.0374425873, 0.0168021582, 0.1477460265, 0.1189093441, -0.0822050571, -0.1484337747, 0.1507812887, 0.15865767, 0.1897278428, 0.055430267, 0.2007674277, 0.1981998682, -0.3664047122, 0.3242426515, -0.2328349501, -0.0055378941, -0.1253767163, -0.0184961557, -0.1147720143, -0.23626481, 0.068746306, 0.4641355872, 0.0720356852, 0.1962964088, 0.4362741113, -0.3657406271, 0.1652648002, -0.0035400521, -0.1884425581, 0.1268768013, 0.3190462291, 0.0136149842, -0.1865617633, 0.1171432808, 0.2503778934, -0.063226521, -0.1424940377, -0.021400813, 0.0687725693, -0.0095405132, -0.1376757026, -0.1544177234, -0.2173985392, -0.2425921261, 0.0071894675, 0.1731629223, 0.1989182383, 0.0464287028, 0.2016892284, 0.324608624, 0.5662381053, -0.297524631, -0.1407993436, 0.0386502035, 0.0852946937, -0.0998169556, -0.2087252587, -0.0367854461, -0.1110668778, -0.1289439201, 0.0083113611, -0.0774277598, 0.2705903053, 0.2934510112, 0.0112030618, 0.2924002111, -0.0088662803, -0.0506426767, 0.0339934453, 0.3592986465, 0.30191046, -0.3759588301, 0.1356444359, -0.4547365606, -0.1987842023, -0.0828806013, -0.0187599435, 0.0401505008, -0.2016351372, -0.3906699419, 0.2585842013, -0.0183182582, -0.0244554654, 0.0184878297, -0.486631304, -0.3768113852, -0.2238230258, 0.2163507044, 0.1883432567, -0.4176258147, -0.1818934679, 0.0440072007, -0.198169291, 0.191409409, 0.2892556489, -0.2226309776, -0.0521308221, -0.3271154761, 0.059764266, 0.5643674135, -0.1906428635, -0.0303820446, 0.129126057, 0.120006144, -0.0039575249, 0.0622877628, 0.0052823089, -0.0918733776, -0.1014153361, 0.219894588, 0.2000403404, -0.1793328375, -0.2974888086, -0.1309357882, -0.2400949597, 0.2908288836, -0.1476478577, 0.1456653327, 0.285587579, -0.1942013204, -0.2734147012, 0.3236293197, -0.0721283406, 0.1452773213, 0.0780831426, -0.2897861302, 0.3068270087, 0.0280977823, -0.0039130375, 0.1166115701, 0.1188362241, 0.0460417271, 0.0801188052, 0.0156895686, -0.103130281, -0.1284839064, 0.1592292786, -0.0084318612, 0.1284551919, -0.0995793939, 0.0432030819, -0.395570159, -0.2482414097, -0.1125764474, 0.0800004229, -0.3220635951, 0.1985421926, -0.616733551, 0.1133343875, 0.1474817693, 0.1528814733, -0.0825849995, 0.2855966985, 0.0134976022, -0.0205440875, -0.0565256998, 0.2021769285, 0.2115098834, -0.0618810318, 0.1903972328, 0.3349083066, 0.0072289426, -0.840179801, 0.3379892111, 0.415142417, 0.1432087421, -0.1016326398, -0.0548338331, 0.7059512734, 0.2606232166, 0.2426976711, -0.0817960352, -0.0120584965, 0.0649008229, 0.1966554224, -0.387208879, -0.0461579636, -0.2101977468, 0.0573002473, 0.2363507748, 0.1334767938, -0.3134966791, 0.0263526887, 0.1032710075, -0.1176699921, 0.2139061689, 0.3229412436, -0.3895617723, 0.0043241829, 0.223734796, -0.1559782922, 0.178251937, 0.1281374395, 0.2365187556, -0.01461423, -0.1825610399, 0.0960271955, 0.2678770423, 0.1079965457, 0.2084405571, -0.1348013729, -0.0106520988, -0.033047948, -0.3167883754, 0.1150295585, -0.210025847, -0.2024737895, -0.6494215727, 0.2454880476, -0.644499898, -0.1679467559, -0.2117987871, -0.1283807755, 0.0738044977, -0.132540375, -0.1838202327, -0.1610392928, 0.157422632, 0.1804310679, -0.4207697511, -0.0876200646, 0.1453915685, -0.3617412448, 0.1635016203, -0.1736217439, -0.1349204183, -0.1402757168, 0.1672250479, -0.0116369203, 0.3143470883, 0.2745063901, -0.074964866, -0.2894773185, -0.2304535508, 0.1569883674, -0.1682229787, 0.1051207557, 0.4179948568, 0.1087100208, 0.257650584, -0.011658404, 0.1355406493, 0.0952818766, -0.1142037883, 0.1711757928, -0.3422295153, 0.1466588527, 0.2856681049, -0.0005158, -0.2711351812, -0.2474180013, -0.1315761954, -0.1056087688, 0.1040341258, 0.1052231342, 0.2524413764, 0.0772709101, 0.1599099636, 0.0024248585, -0.1160767376, -0.1452412158, 0.2762694061, 0.0449747778, -0.1961496174, -0.2027569711, -0.3262170255, 0.12032713, 0.348385781, -0.1995395273, 0.1215453818, -0.0880673081, 0.2964408398, 0.1406214535, -0.0328139961, 0.2701461315, -0.0281771142, 0.1190586314, -0.2390900701, -0.2776738703, -0.047040835, -0.337487638, 0.2847624123, 0.5173729062, 0.4786024094, -0.157720238, 0.8596716523, -0.0879077911, -0.408899039, 0.42524454, -0.1249100119, 0.1847854853, -0.1103777736, -0.4013190567, -0.0969166756, -0.2668891549, 0.2396328598, 0.0914087594, -0.1537975818, -0.2068271339, 0.1639365852, 0.1523765326, -0.0264298245, -0.2613154948, 0.4399175644, -0.8675207496, -0.1050402969, -0.0578204319, 0.0795484185, -0.3812006414, 0.0011202842, 0.0686213225, 0.2858523726, 0.1166150421, 0.1581164747, -0.3939724267, 0.1059402674, -0.1882928908, 0.4757520556, 0.0191639289, 0.5118653178, 0.0879121721, -0.1726591438, -0.0696582943, 0.0268168449, 0.2896451354, -0.2780472934, -0.0805943608, 0.1641325802, -0.0390397273, -0.5347522497, 0.0066228136, -0.0439318754, 0.1003813446, -0.0451431051, 0.1103135645, -0.2395057082, -0.3378887475, 0.0294973515, -0.0553754419, -0.0326877907, 0.2306821942, -0.1315284073, -0.2091808915, 0.0484418496, -0.0030785277, 0.116532363, -0.1095059961, -0.1023848355, -0.2505790293, -0.4138956666, -0.0436238907, 0.3718593717, -0.2287892997, 0.2082282603, -0.0586986914, -0.053722173, -0.2406349331, 0.476431042, 0.2851333022, 0.3794769645, -0.3600589931, -0.3047220707, 0.0356571116, 0.3138697445, 0.4174481332, 0.1876987517, -0.1444203705, 0.3934051991, 0.1332852542, -0.2115070522, -0.5201492906, 0.1842910796, 0.3328474164, -0.0139123984, -0.4928366244, -0.6445833445, 0.7689055204, 0.2218129039, 0.0544253588, 0.3121087253, 0.337750107, -0.3339827061, 0.6794013977, 0.2577803135, 1.0996053219, -0.0346680842, 0.327434212, -0.0318781585, -0.1232236028, 0.2990595698, -0.0514365695, 0.0374189354, -0.3626797497, -0.1920160651, -0.231072098, -0.1870168149, -0.0066352636, 0.1129601896, 0.1887158155, 0.1578835249, -0.2065267861, 0.0865205228, 0.186357975, 0.1434386224, -0.1430524439, -0.313346535, -0.0725743622, 0.0737976879, -0.201846838, -0.0247667208, 0.0696130395, -0.2688635588, -0.1569672525, -0.0939245895, -0.1439596564, 0.0402994901, -0.4678854644, 0.1700505316, 0.0067253616, -0.4388859272, 0.3773152828, 0.2177987099, 0.3210293353, -0.0840631127, -0.1062158123, 0.0549594723, 0.393652916, -0.0869994685, -0.0647538379, -0.1884711534, 0.4313011765, 0.1897947937, 0.0387763977, -0.1223745346, 0.0134795159, -0.265139997, -0.3395314217, -0.1420840025, 0.5508431792, -0.449655503, -0.3465374708, 0.0302719101, 0.0008457154, -0.011415571, -0.0343916863, 0.0881356001, -0.0147055872, 0.0936478004, 0.2609143257, -0.3039738536, 0.0750021338, 0.3815479577, 0.1440954953, 0.3418429494, 0.3346380889, 0.1366575658, -0.085872069, -0.0354809128, 0.3121766448, 0.9939116836, -0.1061717719, 0.0196710154, -0.1317869425, -0.2180092931, 0.0851488933, -0.2070148289, 0.1507612467, 0.0491243452, -0.1872910559, -0.1722061783, -0.3375906348, 0.2550203204, -0.3870526552, 0.2985133231, -0.0794736594, 0.2165446877, -0.3035985529, 0.0311466325, -0.1346674263, 0.0342314094, 0.1797304302, 0.0705115497, -0.0291182883, 0.2059079111, 0.0574301481, 0.0696491674, -0.0349052995, 0.0624161474, -0.1884791255, -0.0458088666, -0.2914155722, 0.2247945815, 0.0019301269, 0.0069706552, 0.2205763459, -0.1755088866, -0.208871603, -0.1003459096, 0.0976727754, 0.099684149, 0.0047065709, 0.3070245981, 0.3442033529, 0.0926198512, -0.1428010166, 0.0978470445, 0.3370380998, 0.4264216721, -0.0894037709, 0.0438057669, -0.2029937357, -0.2533397973, -0.1870262474, 0.3083280921, 0.546150744, 0.0302507617, 0.1883121133, 0.019639479, 0.0237201825, -0.2299457788, 0.2487044036, 0.565882504, -0.0058659613, 0.0509621948, -0.0675121397, -0.1053527519, -0.2270375788, -0.0321213827, -0.0863207877, -0.3270876706, -0.0131163374, 0.1574241817, 0.0161941275, 0.5776232481, -0.134644419, -0.3196704984, 0.0066965818, -0.2881911397, -0.0220316909, 0.5073308945, 0.0964721441, 0.0737786591, 0.3497419357, 0.1650417149, 0.3461249471, 0.2299321294, 0.4368548393, 0.7877061367, 0.4616094232, 0.1401690692, 0.4382710457, -0.5139477849, -0.1959019005, 0.4214673936, 0.2564809918, 0.2017279565, 0.0750501603, 0.6161074042, -0.0600154698, -0.481281966, 0.1460747123, 0.125300169, 0.0005471809, -0.4632919431, -0.3377987742, -0.0295963064, -0.4231975675, -0.2846587598, -0.3085643649, -0.1266376376, -0.0241930448, 0.0743196532, 0.0771804005, -0.1394355893, -0.072941646, 0.0746724606, -0.0849191174, -0.1124606058, 0.1132898405, -0.1118324921, -0.0214529447, 0.1088948548, 0.1355239153, 0.2491074055, 0.0923753083, -0.2736178339, -0.0808619857, 0.347168833, -0.1542700678, 0.2459335178, -0.1530474722, 0.0572596937, -0.0728865191, 0.3427269161, -0.0630104542, 0.0821186006, -0.0155277578, -0.0536868051, 0.0572774708, -0.0625020266, 0.5547098517, 0.1199890301, 0.0866108313, -0.1235126406, 0.059317112, -0.4033989906, -0.1010095999, 0.69183743, -0.0552566051, 0.1558538377, 0.0879932418, -0.0238862671, 0.0356972888, 0.3571388423, 0.2786396146, -0.0012062266, -0.3143782914, 0.0869769901, -0.2824190259, 0.0191217251, -0.053867463, 0.0133890808, 0.0472502001, 0.0194259286, 0.5246510506, -0.0339057595, -0.0880303085, -0.0512897037, 0.1709918976, 0.3318522573, 0.0924043655, -0.2448704243, -0.1740094423, 0.2448076457, -0.0757257938, -0.3458245993, -0.1614002585, 0.310713619, -0.119849965, 0.0009036399, -0.2722068131, 0.4618014097, -0.1719903648, 0.3024444282, 0.0348049924, 0.5514163971, -0.2409497201, -0.0486090146, 0.115557462, -0.0889050364, -0.4955529571, 0.2672632933, -0.1680182219, 0.2821673751, -0.0952108949, -0.1633876115, -0.1532779038, 0.107804209, -0.0438830853, -0.4155342877, -0.393042624, 0.558059752, -0.3865447044, -0.1510735005, 0.1841351837, 0.5083804131, 0.1409493834, 0.2737411261, -0.1228887215, -0.209422186, 0.5849866271, 0.0536792092, 0.0076910704, -0.0119046792, -0.1061061621, 0.1365028024, 0.1702826321, -0.362013042, -0.1443609744, 0.1439766586, -0.2070528269, 0.0495487228, 0.1811147928, 0.2289019823, 0.1970973611, -0.4207521081, 0.4470786452, 0.1964855939, 0.0416077375, -0.1021853089, -0.3120920658 ]
https://github.com/huggingface/datasets/issues/2162
visualization for cc100 is broken
This looks like an issue with the cc100 dataset itself but not sure Did you try loading cc100 on your machine ?
Hi visualization through dataset viewer for cc100 is broken https://huggingface.co./datasets/viewer/ thanks a lot
22
visualization for cc100 is broken Hi visualization through dataset viewer for cc100 is broken https://huggingface.co./datasets/viewer/ thanks a lot This looks like an issue with the cc100 dataset itself but not sure Did you try loading cc100 on your machine ?
[ -0.5656796098, -0.2004439235, -0.0850355625, 0.1293197274, 0.2095071971, -0.0013307109, 0.1641539186, 0.1368134618, -0.0659236684, 0.4231900871, -0.0523653328, 0.2376997173, 0.1289268136, 0.4269974232, -0.0176099837, -0.2411684692, 0.0532902963, 0.4060420394, -0.3985908926, 0.021252349, 0.0434121042, 0.0523334816, -0.1739804596, -0.0693607926, -0.181258589, -0.2919966877, -0.095744282, 0.1488846242, -0.2506378293, -0.4322843254, 0.060996905, 0.1807225347, 0.1114193723, 0.3614214063, -0.0000948289, 0.0520826131, 0.3273297846, 0.1721239686, -0.1750353128, 0.1617924422, -0.3436124921, -0.0873222649, 0.2742393911, -0.0548347831, -0.1783527434, 0.1911076009, -0.0204066262, -0.0307971537, 0.3275453746, -0.2472634315, 0.4222187698, 0.2349866033, 0.0398904234, -0.3050336838, -0.1605334133, 0.1931781471, -0.113192305, 0.1625883579, 0.1607860625, -0.015757069, -0.0894082338, 0.2910953164, 0.1937404424, -0.0065566553, 0.0340784118, -0.1106693745, -0.0367659405, -0.2360447496, 0.2474202961, 0.0474845022, 0.4210411906, 0.0793648958, 0.1486471891, 0.1815606058, -0.0695402622, -0.6380500793, 0.1570042372, 0.1009481028, 0.0964076519, 0.2430052459, -0.3762996197, -0.0677686781, -0.2017343938, -0.0138397962, -0.2421448529, -0.1251512021, -0.2139438689, 0.0061437078, 0.0715350211, 0.0346727967, -0.0787407607, 0.2379067242, -0.3031327128, -0.0922413319, -0.2987852991, -0.0159618482, 0.1302253902, 0.4907619953, 0.0583914369, 0.1188843399, 0.3125006855, 0.1956058145, 0.2119921595, 0.2065152973, 0.1031227484, 0.0831063688, -0.2976169288, 0.1005255058, 0.4791634381, 0.3510069251, -0.079391323, -0.259262383, -0.11658144, -0.2494165301, -0.1120597795, -0.0014788844, 0.0683398172, -0.1943027377, -0.2914255559, 0.0996231586, 0.0628405064, 0.1832074225, 0.0965739936, 0.4411552548, 0.0086649098, 0.1357437372, 0.0215740949, 0.1259840578, -0.1545626521, -0.2653720975, -0.2535617948, -0.0937743783, -0.2249136269, -0.0452786237, 0.1392565668, -0.3511642218, 0.148614049, 0.2843304276, 0.2438904494, -0.0997054726, -0.078650482, 0.0231301375, -0.0841179639, 0.2223766893, 0.0920143574, -0.0371529758, 0.13593252, -0.0663185567, 0.3401284516, -0.1389590204, -0.1046524942, -0.1058118045, -0.3097951114, 0.3111565113, -0.0393327959, 0.0318805389, -0.1348146498, 0.041536022, 0.0054447018, -0.0063714534, -0.1271552891, 0.069032982, -0.0485788807, -0.106533289, 0.2176985592, 0.2176952958, -0.5703332424, 0.027573511, -0.1413708031, -0.1999804974, 0.0043481104, 0.1873579025, -0.1815027297, -0.0876337141, -0.1811662465, -0.0983161926, -0.1626345068, -0.2828269005, -0.3876283169, 0.1866453886, -0.0017751753, -0.0798950791, -0.1160929352, -0.2375925779, 0.2893235981, -0.0153165795, -0.3430393934, -0.2110934258, 0.0176127851, -0.0127846561, -0.2409083247, -0.2167170346, 0.0838878751, -0.0764978155, 0.1479020417, 0.1105542183, 0.1725350469, -0.2935751379, 0.2661365867, -0.1485099792, 0.1161036938, 0.0912746191, 0.2704188526, -0.1600846648, -0.1128769442, -0.0416107252, -0.0674103498, 0.0204777569, 0.0606133267, 0.2716893256, 0.0396322943, -0.008867085, -0.2549170852, -0.0335104987, -0.3341198564, -0.1676502824, 0.3803723156, 0.0921688974, -0.2315764576, 0.0005186275, -0.0421156436, 0.1758347601, 0.0126308873, 0.0483753085, 0.1761739254, 0.3433648944, -0.2752548754, -0.0637718141, 0.1673240513, -0.0719600916, 0.2455673218, -0.1013279036, -0.1643156558, 0.4407145977, -0.1486031562, 0.4009416699, 0.1041890904, -0.1629091203, 0.3613379598, -0.6228363514, 0.1109348312, -0.0870216191, 0.0760376155, 0.1592280716, -0.0845576823, -0.0961330757, 0.0773141235, -0.0738332644, -0.0045656711, 0.1905117333, 0.228079021, 0.0030774251, -0.0194357187, -0.2421628088, 0.1882215738, 0.2159338593, 0.3058046401, -0.1830739975, -0.3681042194, 0.158458814, 0.1430667043, 0.1536124051, 0.0109321931, -0.0728269368, -0.3498607576, 0.0213347077, 0.385071218, 0.00804355, -0.1321380287, 0.1849577874, -0.0770440996, 0.0816131607, -0.1488432437, -0.0276766643, 0.0297795571, -0.0575454719, 0.3187331557, 0.040170867, 0.0173401125, -0.154134497, -0.5369299054, 0.0395914167, 0.0058502108, 0.2060565054, -0.2513285279, -0.0886815637, -0.3233676553, -0.1130417362, 0.2310753018, 0.0394949242, 0.0922844261, -0.2377570122, 0.0139979981, 0.1969208717, -0.1181682423, 0.262460649, 0.0011999682, 0.2136727422, 0.0281767175, 0.5410405993, -0.2618632019, -0.1442383826, -0.1840661317, 0.2897136211, 0.0871279836, -0.0790611356, 0.1842191666, -0.0810153112, 0.2908609211, -0.1730745584, -0.385138005, 0.2910664976, -0.1283418387, 0.1904562116, -0.0026748702, 0.266526252, -0.3870863318, -0.0203627981, 0.1880903691, -0.0413361341, -0.0606840327, -0.0031812228, -0.0159593038, -0.3020131588, -0.2241057158, 0.0751425698, -0.1735683233, -0.3436996937, 0.0384506434, 0.1464444399, 0.0640092492, 0.1747080386, 0.2289255112, -0.0979765579, 0.1481274813, -0.0595276877, -0.3003804982, -0.5974050164, 0.1632576287, -0.5660867691, -0.463077426, 0.1409202367, 0.1243425831, 0.4092951119, 0.0419114381, -0.3749950528, 0.1733651459, -0.0801887885, -0.0343607478, 0.1711722612, -0.1160890386, 0.1028823555, 0.152343601, -0.2272925377, -0.1422841102, -0.2734928131, -0.0979779065, -0.1062641889, 0.1159406006, -0.2867877185, 0.0807191506, 0.1047688574, 0.4419481456, 0.1123190522, -0.0741319284, 0.4239268899, -0.0862237588, 0.5601351261, -0.1611280441, -0.3377250731, 0.1469468623, -0.1507562101, -0.0988628045, 0.2195906192, 0.0591340847, -0.3533902764, -0.3039925098, 0.035486497, -0.281431675, -0.2238369584, -0.3538103998, 0.0835166872, 0.2517738342, 0.0645770878, 0.2820883393, 0.1081139222, -0.1622389108, 0.1294880211, 0.120091632, 0.0353276953, -0.1414878368, -0.4134141207, -0.2049737871, -0.3734686375, 0.1895397007, -0.1099828333, -0.0502122119, -0.1996528208, -0.0842044502, 0.0514093712, -0.1056896299, 0.3423096836, -0.0683497787, -0.0004601884, 0.0954740942, -0.1732042134, 0.0656740367, 0.0295123383, -0.1048088521, 0.1432251632, -0.1582613289, -0.1050961018, 0.003760308, 0.0784185976, 0.1847964972, 0.0099395365, -0.1699627787, -0.0204204451, -0.0938848108, 0.0978897065, -0.2449436188, -0.2076078355, -0.2207293212, -0.0100953206, -0.2272650003, -0.266187489, -0.1380920559, -0.3244820237, 0.0185240805, 0.4938951731, 0.3863053918, -0.0652047396, 0.0860120654, 0.2924597859, 0.3374376297, 0.3303751349, 0.3128891587, 0.1370004863, -0.2071922123, 0.2908003926, -0.1313315928, 0.0928649008, 0.2617784142, 0.0430267751, -0.015297465, 0.210019052, 0.2225783616, -0.3074875474, 0.198071301, 0.25295946, 0.1679594517, -0.4825791717, 0.0580450892, 0.3693291545, 0.0141715109, -0.0597244948, 0.1262943745, 0.2100715339, -0.0813223347, -0.1351282895, 0.1255881488, 0.7209935188, 0.000104906, -0.2122114152, 0.1130356863, -0.1008676589, 0.3043750226, 0.0424391627, 0.0194627494, -0.2817113698, -0.2667111456, -0.0736100078, 0.0370210856, 0.2209495455, -0.0685558766, -0.2538509965, 0.055441428, -0.1838659793, 0.3419277966, -0.0456508622, -0.0496991947, 0.057432659, -0.0669079125, 0.0541140959, 0.3630206287, -0.0797081813, 0.0939114466, -0.2961656749, 0.0133894347, 0.0031090081, 0.0670562088, -0.2429051399, 0.092020005, -0.2276489735, 0.168682158, -0.1923021525, -0.5009311438, 0.1603825092, 0.063782081, 0.0975630805, 0.3254850805, -0.3234697878, 0.4022994339, -0.045781713, -0.1814328283, -0.18332389, 0.3055182099, 0.0101982318, -0.1501729637, -0.1779603362, 0.174185425, 0.1115859002, -0.0194320604, 0.0475309044, 0.1179087684, 0.1931282431, -0.0222879238, 0.1926675737, 0.0071363188, 0.0033138767, -0.3757093549, 0.2785083055, -0.0511807092, 0.066645965, -0.0360995866, 0.4344738722, 0.0669225007, -0.1159677133, 0.063756451, -0.1367862374, -0.1317864954, 0.177761808, 0.2601834834, -0.2765628994, -0.398859024, -0.0656846613, 0.1571888179, -0.2817639709, 0.0723022372, 0.0805476755, 0.0077479631, 0.0140636116, 0.3513557315, 0.1392953396, -0.1685830355, -0.0723092034, -0.2136257142, -0.4982852936, -0.0773467869, -0.2293804735, 0.2354178578, 0.1222248375, 0.2731161714, 0.06964425, 0.0219159294, -0.4724562764, -0.0437903218, -0.1993092597, -0.0929692835, 0.177961275, -0.0277196988, 0.0122173354, -0.1333379596, 0.2816727757, 0.24275738, -0.1752958596, -0.385391742, -0.0153469443, 0.0214831978, 0.0950368643, -0.3926619887, 0.1759339571, 0.2973403335, -0.0333292261, -0.0578468144, 0.0739079863, -0.1647578776, 0.0900411159, 0.0186314136, -0.2337354124, -0.0474629104, 0.0239735618, -0.1795482337, 0.2719548345, 0.2520775795, -0.069914028, -0.0998033285, 0.1286893189, -0.1220530719, 0.1165041476, 0.1664460152, -0.0365913138, 0.1958780289, 0.4097906053, -0.2700435817, 0.2672365904, 0.0104016326, 0.3953763545, 0.0123090819, 0.0397563279, 0.0226721168, 0.1892243773, 0.435575515, -0.2832292914, 0.1362298727, 0.0024189334, 0.0065334439, 0.2610805035, -0.1032954678, 0.2708553672, -0.1254645884, -0.0617530122, 0.0812323242, 0.3503269851, -0.1907883883, 0.3412300348, 0.4016757905, -0.0528335534, 0.1506222337, 0.06422548, 0.2355763018, -0.0181957558, 0.4345914125, -0.1618884653, -0.0178998392, 0.1488091201, 0.1640520543, 0.2202474028, -0.1720550656, 0.0562384203, 0.1335781515, -0.1476078779, -0.0115501881, 0.1621235013, 0.4196668267, 0.0223249942, -0.330617547, -0.3100752234, 0.1664959788, -0.17593427, 0.1114475131, -0.4876584113, -0.1929873228, -0.0160593837, 0.1783456504, 0.0034386897, 0.0139334649, 0.3328844011, -0.0348722264, -0.0487207137, -0.5029995441, 0.0837435052, 0.2177887112, 0.2639811039, 0.0242694169, 0.2061737925, 0.2265584171, -0.0002991948, 0.1532241255, 0.4285947978, 0.3149450421, 0.0677118301, 0.0359149612, -0.0532669052, 0.1089599654, -0.2051903009, 0.0273424126, -0.1149925217, 0.2129642516, 0.0950713754, 0.1885063499, 0.2647568583, -0.282762289, 0.08257889, -0.0216896944, 0.2163795829, -0.1022081375, -0.3874951899, -0.2982394099, -0.0977331325, -0.0861076787, -0.3890852332, -0.333291173, 0.1323381811, 0.2015293837, -0.2986508608, 0.078179121, -0.3521552086, 0.1648676991, 0.0640509576, 0.4023211598, 0.2431685925, 0.2007895559, -0.1250180602, -0.4483351111, -0.3504095674, 0.1526516229, 0.1033010781, -0.039885696, -0.305773586, 0.0511861145, 0.0918323845, 0.1235851049, 0.4952952862, 0.0001788847, 0.1944512427, -0.0594194159, -0.2752923369, 0.1799764931, 0.0094620548, 0.0195162762, -0.1272804141, -0.0661201999, 0.2582792938, -0.0021932498, 0.2210864127, -0.1490803361, 0.203129217, -0.4349628687, -0.2029471844, 0.3208514452, 0.1792405397, 0.3766890168, -0.110078387, -0.0005271137, -0.0858119279, -0.2289457321, -0.093520239, 0.2492440194, 0.2223965228, 0.3229874074, 0.1318789423, -0.1263433248, -0.0290870015, 0.0493220463, 0.2770045102, 0.3405130208, -0.295528084, 0.1076354384, 0.0787424892, -0.2278831899, 0.2594729364, 0.1059647202, -0.0409700312, -0.0755647868, -0.1921971142, -0.3657117784, 0.1892422438, -0.2603740096, -0.3046206832, -0.0842138678, -0.0746045113, 0.3660801649, -0.0851084515, -0.2530286312, 0.0696019381, 0.0732703954, -0.1121166646, -0.0957400352, 0.365701139, -0.0892179459, -0.0652138889, 0.1243475974, 0.5360302329, 0.3529991508, -0.1880023181, 0.0473646969, -0.0968634486 ]
https://github.com/huggingface/datasets/issues/2162
visualization for cc100 is broken
Hi loading works fine, but the viewer only is broken thanks On Wed, Apr 7, 2021 at 12:17 PM Quentin Lhoest ***@***.***> wrote: > This looks like an issue with the cc100 dataset itself but not sure > Did you try loading cc100 on your machine ? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2162#issuecomment-814793809>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AS37NMRUO33JSOYGT6RETWLTHQWNLANCNFSM42IUOR6Q> > . >
Hi visualization through dataset viewer for cc100 is broken https://huggingface.co./datasets/viewer/ thanks a lot
80
visualization for cc100 is broken Hi visualization through dataset viewer for cc100 is broken https://huggingface.co./datasets/viewer/ thanks a lot Hi loading works fine, but the viewer only is broken thanks On Wed, Apr 7, 2021 at 12:17 PM Quentin Lhoest ***@***.***> wrote: > This looks like an issue with the cc100 dataset itself but not sure > Did you try loading cc100 on your machine ? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2162#issuecomment-814793809>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AS37NMRUO33JSOYGT6RETWLTHQWNLANCNFSM42IUOR6Q> > . >
[ -0.489233315, -0.2571879625, -0.0154401399, 0.1678072363, 0.2279230952, 0.0367417634, 0.1436956525, 0.0804585218, -0.0384782217, 0.3180072308, -0.1425651312, 0.2456281781, 0.1419417113, 0.4538697898, 0.0949074402, -0.3206590414, 0.1359128356, 0.3763965368, -0.4416951537, 0.0868928432, 0.0558288693, 0.1035449579, -0.106332019, -0.1049202681, -0.1652597934, -0.243497625, -0.1958784759, 0.2551196814, -0.2148871422, -0.493445158, 0.0909604952, 0.2749294043, 0.1034731865, 0.3986741602, -0.0001022205, 0.0499556363, 0.3971211612, 0.1768862456, -0.2313633263, -0.0155356973, -0.334101975, -0.0857340693, 0.305644393, 0.0706031621, -0.0899706632, 0.1896810383, -0.0461138971, -0.0780907422, 0.4632004797, -0.3263452053, 0.3314780593, 0.1898192763, 0.2163902521, -0.2356245816, -0.2317937464, 0.3152169883, -0.113015011, 0.3244764507, 0.1339664608, 0.0188413039, -0.1388452351, 0.2810085416, 0.1435001045, -0.0581775606, 0.2358365357, -0.1443403065, -0.1305728257, -0.2075547129, 0.1319209784, 0.1367865801, 0.4491755664, -0.0257947613, 0.0039738379, 0.152594164, -0.1334010959, -0.7048448324, 0.2510016561, 0.0759369731, 0.1342732757, 0.2552891672, -0.4646978676, -0.0914585143, -0.1806111634, -0.0053146221, -0.2083681822, -0.2731883228, -0.270439893, 0.0497462228, 0.0847373456, 0.0378440246, -0.1317538023, 0.2829217613, -0.307027638, -0.0304717831, -0.3326729834, -0.0233379155, 0.0595651977, 0.6086740494, 0.1661483645, 0.1431819201, 0.2620120645, 0.1786368936, 0.1625328213, 0.1637374312, 0.1870712787, 0.11508964, -0.2575577796, 0.0041039735, 0.3975893259, 0.3946671188, -0.0249199793, -0.2377852798, -0.1014921665, -0.1884735227, -0.2739531696, -0.0525201149, 0.0503012463, -0.256316334, -0.2835168242, 0.0952256471, -0.0298539624, 0.2155106515, 0.1024068668, 0.4667979181, -0.0222320687, 0.1667990386, -0.0565112978, 0.0894867033, -0.1122331545, -0.2835862637, -0.1714643687, -0.1027711034, -0.2645994425, 0.0969907343, 0.1056803092, -0.5895857811, 0.1090203151, 0.3119137883, 0.2893699408, -0.1508764476, -0.2520391643, 0.034912087, -0.1531485766, 0.2180143446, -0.0182140321, -0.0133195594, 0.1382206082, -0.0576595142, 0.2959640622, -0.1241450161, -0.1790525615, -0.1323901415, -0.2980605364, 0.1988736391, -0.2029173672, 0.0301476754, -0.2107233107, 0.128604278, -0.0801802427, -0.065527074, -0.1545432359, 0.1827646047, -0.0919291079, -0.0699688196, 0.2726302445, 0.3414157033, -0.6863189936, 0.0113493577, -0.2106215656, -0.2142639756, -0.1314725578, 0.2222073972, -0.1535881162, -0.2164107114, -0.1873217225, -0.103962943, -0.3795116544, -0.3386240304, -0.3993171751, 0.2244600207, 0.0147256032, 0.1020727903, -0.1624565572, -0.3465772271, 0.2197379619, -0.1073611155, -0.4080575109, -0.3395629525, 0.0483304933, -0.0906974673, -0.2202286571, -0.2207838148, -0.0248323921, -0.1567665637, 0.0327052549, 0.052421432, 0.2398313284, -0.2631929517, 0.2512975335, -0.1058087796, 0.0842957422, 0.1203727871, 0.2442516685, -0.0352899469, -0.0389811471, -0.0316406265, -0.1632592976, 0.0935280398, 0.1100458205, 0.1650075465, 0.0794907808, 0.0177722499, -0.2871534228, 0.0784738585, -0.2831758559, -0.2864535749, 0.2292663753, -0.0078506544, -0.2204868048, -0.056829609, -0.1291801184, 0.282944262, -0.0350261442, 0.0403470695, 0.0812886804, 0.3608577251, -0.2117711902, 0.0663954318, 0.1169616207, 0.0159763508, 0.2351306677, -0.1477355212, -0.1826759875, 0.4865568578, -0.1353313923, 0.493232131, 0.063958697, -0.1806654632, 0.4445700347, -0.6863840818, 0.1042587087, -0.143659845, 0.0319807194, 0.11435543, -0.1996469647, -0.0951004475, -0.0258609951, -0.0602657944, -0.0047647357, 0.3002632558, 0.1752489507, 0.0208748728, -0.1129433662, -0.2815240026, 0.3239425123, 0.10328269, 0.3746679127, -0.1104338095, -0.3645004034, 0.094450213, 0.0589419939, 0.0663929954, -0.1505610794, -0.0212417133, -0.4246391654, 0.0587928295, 0.4740259349, 0.0202399194, -0.1344066113, 0.1091588885, -0.1784783304, 0.1640635729, -0.1147887111, -0.0054767802, 0.056266509, 0.0153739871, 0.3779701591, -0.0594745129, -0.0090440344, -0.0412557796, -0.4889644682, -0.0065909252, -0.036040701, 0.1884358227, -0.3148463368, -0.0544635057, -0.2563506961, -0.1135905683, 0.1614994854, -0.0664467812, -0.029406026, -0.2248457819, -0.1075394601, 0.2443357855, -0.0882510096, 0.2095919698, 0.0373777971, 0.2259053588, -0.0769364983, 0.5092436075, -0.3830866814, -0.0880488306, -0.1897036582, 0.2072616518, 0.1518360227, -0.158868283, 0.1316141784, -0.0541116185, 0.2230404317, -0.1354920864, -0.4229267538, 0.351303339, -0.2789327204, 0.2825941443, 0.018032046, 0.1744455248, -0.5256009102, 0.0149827637, 0.2019055933, -0.0165837705, -0.0259551033, -0.0310117416, 0.0307591781, -0.214936927, -0.1770556271, 0.1357313991, -0.0972957239, -0.2872205973, 0.2448734641, 0.1140971035, 0.0695608258, 0.2995310724, 0.1981417239, -0.0053707138, 0.0894732624, -0.1570620835, -0.2617683411, -0.650192976, 0.1145760119, -0.5803602934, -0.4522838593, 0.1640464216, 0.183376193, 0.4095657468, 0.0223090127, -0.4418851733, 0.2004328072, -0.0492387041, -0.0774398372, 0.1694940329, -0.2371670902, -0.0520736612, 0.1274529696, -0.1467647254, -0.1221010461, -0.2460594028, -0.2049296945, -0.1848906577, 0.1114115268, -0.2083913088, 0.1352380514, 0.1887239218, 0.4692264497, 0.3177906275, 0.0179008599, 0.3638764918, -0.0256514959, 0.6060580611, -0.0940380916, -0.3954621851, 0.1610117853, -0.2635264397, -0.1106088609, 0.2245450169, 0.1638228148, -0.2813154161, -0.3329941332, -0.0213941522, -0.1901985109, -0.2044191957, -0.4022081494, -0.0952070951, 0.2365482152, 0.0945555791, 0.3012016714, 0.1872933805, -0.2381775826, 0.1218910813, 0.2228386998, 0.1378755569, -0.0563400798, -0.3333060145, -0.1550251544, -0.4598308802, 0.19127056, -0.1192056537, -0.0245972574, -0.1621476412, 0.0897187442, 0.0431348532, -0.116687268, 0.4323552847, 0.083441712, -0.0657964945, 0.0206604749, -0.279353708, 0.0274509341, 0.1344773024, 0.0036598071, 0.191541627, -0.1758201122, 0.0077377167, 0.0332586467, -0.0226782802, 0.2441920936, 0.1092423499, -0.1373886317, -0.1233560666, -0.0592085645, 0.0876369029, -0.2600355148, -0.2787792087, -0.1868242919, -0.009048868, -0.2768269181, -0.245365262, -0.0309769493, -0.2705956101, 0.1344106197, 0.4063964188, 0.3771792054, -0.0564552918, 0.1148966998, 0.4774948657, 0.3243747354, 0.3528697491, 0.3981161714, 0.1790294945, -0.2628017664, 0.1974924356, -0.0177551284, 0.1450861096, 0.2858127952, -0.0325287022, -0.0653766841, 0.3229691684, 0.1560712457, -0.4014386535, 0.0218193233, 0.2814578414, 0.2107098997, -0.586905539, -0.032011427, 0.4865454137, 0.04252249, 0.0244373381, 0.1429231763, 0.4273273647, -0.0154762715, -0.1793302745, 0.2195118964, 0.7822975516, -0.0852203667, -0.2441665381, 0.1609072983, -0.0724489912, 0.5282040834, 0.0920657814, -0.0052014589, -0.2392445803, -0.263515383, -0.1081516445, 0.0192669332, 0.3487840295, -0.034712173, -0.1978699267, 0.0767206848, -0.115465492, 0.3633246124, 0.0274878256, -0.0209577754, -0.0317622125, -0.1243715137, 0.052406799, 0.2741874158, -0.0710231885, 0.1198070273, -0.3207532763, 0.0189967379, -0.0395037904, 0.0727083683, -0.4134106338, 0.0668169335, -0.2139831185, 0.0972496122, -0.1545438319, -0.5218374133, 0.3360897899, 0.1267321408, 0.052815333, 0.3062734902, -0.4049156308, 0.3605415821, -0.1570575982, -0.2065271139, -0.1192583293, 0.309253186, 0.0769668296, -0.1147349924, -0.1159135476, 0.1432214975, 0.0744676739, 0.052813068, -0.0045485198, 0.1390680522, 0.1204419136, -0.0198729225, 0.198644191, -0.0818979144, 0.0448004901, -0.3537903726, 0.1825722158, -0.0236161835, 0.0982242376, -0.0461267978, 0.3708561361, 0.0440846831, -0.1025626808, 0.0899794996, -0.2272092402, -0.2361450046, 0.2592031658, 0.37111938, -0.2947307527, -0.260366708, -0.0373255685, 0.1620598882, -0.4218551517, 0.0710397661, 0.0879320502, 0.1964738071, -0.0413640924, 0.3043952584, 0.1934484541, -0.214618966, 0.0477547944, -0.2464826554, -0.5051088929, 0.0095531251, -0.2503122687, 0.2647609115, 0.2067701668, 0.3871722221, 0.0558867902, 0.1240467504, -0.3818436861, -0.0157487411, -0.1078446507, -0.165028125, 0.2736260593, 0.0680392087, 0.0908037871, -0.1712994277, 0.1991845071, 0.3404522836, -0.1769590527, -0.2423434854, -0.0868765637, 0.0664083958, 0.0810749158, -0.4429334402, 0.1842285842, 0.2947707772, 0.0168446116, -0.100709185, 0.1171608269, -0.0522596613, 0.1438386887, -0.0333773568, -0.2583408952, -0.03542744, -0.0901005119, -0.1844912022, 0.3827038407, 0.3077847958, -0.1213061064, -0.0769076347, 0.0812678114, -0.1150848493, 0.083153598, 0.2045481354, -0.0781323314, 0.1085336059, 0.5183012486, -0.2559984922, 0.2800973356, -0.0350434855, 0.4954103231, 0.0593205243, 0.0501790084, 0.0827180445, 0.2220929861, 0.2963466346, -0.2159973532, 0.222535491, 0.0296186358, 0.0777665377, 0.1235864908, -0.0978555009, 0.2934841216, -0.1248735264, -0.0230829045, -0.0129560009, 0.4266716242, -0.1393713653, 0.4329895377, 0.4649489522, -0.0962629467, 0.1818495691, 0.067555137, 0.2581516504, -0.0089328289, 0.4877112508, -0.1989832968, -0.139460817, -0.0077656778, 0.3162933588, 0.1967285872, -0.2686851025, -0.0073736748, 0.13343741, -0.1398730427, 0.0344948471, 0.1266099811, 0.5635015368, -0.0401277691, -0.3392046094, -0.2308546156, 0.1940721124, -0.0562957488, 0.069608137, -0.4285203516, -0.1924721003, -0.0327326953, 0.2030671239, -0.0358548164, -0.0769786909, 0.3292372823, 0.0425866321, -0.060081888, -0.5967035294, 0.0047181211, 0.260142982, 0.3136414886, 0.0291533917, 0.1982823908, 0.2266046852, 0.0434600264, 0.0961249471, 0.4073173404, 0.3040818572, 0.0233555846, 0.1639558375, -0.0363516286, 0.0734033287, -0.1477891505, 0.1805890948, -0.0004241131, 0.1901203394, 0.0577219501, 0.223431617, 0.1660740227, -0.1932644844, 0.0568624586, -0.0404096022, 0.3502345681, -0.2300459296, -0.294456929, -0.3778142631, -0.0521232858, -0.0427740291, -0.3764000535, -0.3126109242, 0.1954148412, 0.2065280974, -0.3035638332, 0.0059865341, -0.3602223098, 0.1030218005, 0.1652546376, 0.375254631, 0.3739388287, 0.2587441802, -0.184034586, -0.4179104865, -0.3763249218, 0.1055431217, 0.1215545237, 0.1609398723, -0.2228064239, -0.0635878146, 0.1066198125, 0.1546383053, 0.4049461186, -0.0531758033, 0.2147497833, -0.0518632047, -0.1292671263, 0.1912104636, -0.0255184695, 0.0425748825, -0.1327253282, 0.0717549026, 0.3197351992, 0.082547754, 0.0700986832, -0.205837816, 0.2681623101, -0.4323087633, -0.3078069091, 0.2139190733, 0.2149381936, 0.3701923192, -0.0298632495, -0.1319438517, -0.2877646387, -0.2584186494, -0.1755839437, 0.2879809737, 0.1683014035, 0.3712054193, 0.0934681296, -0.2876019478, -0.0417514518, 0.0986434892, 0.2029400319, 0.3742453456, -0.4230100513, 0.098016724, -0.0467312336, -0.2117279619, 0.3160829544, 0.2755280733, -0.0386101604, 0.0674135536, -0.2401773781, -0.3253991008, 0.2884453535, -0.4104402065, -0.1738004386, 0.0159759633, -0.0622032732, 0.4638103843, -0.2478464991, -0.3457044959, 0.0219629407, 0.0650143921, -0.0513218194, -0.0197086409, 0.3315577805, -0.1098204851, -0.0618326701, 0.0984675139, 0.6605508327, 0.339009881, -0.2001921833, 0.1868810058, -0.029874973 ]
https://github.com/huggingface/datasets/issues/2161
any possibility to download part of large datasets only?
oh, great, really awesome feature to have, thank you very much for the great, fabulous work
Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks
16
any possibility to download part of large datasets only? Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks oh, great, really awesome feature to have, thank you very much for the great, fabulous work
[ -0.4569226503, -0.4417872429, -0.1896090508, 0.1484076083, 0.1038996428, 0.1881609261, -0.2670143843, 0.3661700487, 0.0632606, 0.4351862967, -0.4470097125, -0.1280027628, -0.1039806455, 0.3638652563, 0.1902366877, -0.0035723201, -0.1473827064, 0.2523769736, -0.2892187536, -0.1919610798, -0.0600634962, -0.1989708096, -0.2322039604, -0.2747713625, 0.1167173237, 0.0897203907, -0.0433794521, -0.1757759452, -0.5081451535, 0.0985451266, 0.1412109286, 0.2492479086, 0.1027184576, 0.095010832, -0.0001107031, -0.4209388793, 0.2668626606, -0.0625784025, -0.0843797699, -0.0519629642, -0.22100012, 0.1284931153, -0.2507514954, -0.332881093, -0.0196086057, 0.2339522392, 0.1992980391, 0.0525373369, 0.1239217967, 0.1056277305, 0.1930297464, 0.1519486308, -0.0723707974, -0.1902450621, 0.4425436854, 0.0775688738, -0.081824325, 0.0459747314, 0.5918858051, 0.2943480015, 0.1667646021, 0.0849434584, 0.1034171656, 0.2473488152, -0.1054592878, -0.2039709836, -0.0984306335, -0.6417450905, 0.233723864, 0.665956974, 0.6920176744, 0.0556282215, -0.1506167501, -0.1202961951, 0.0236589015, -0.1743654311, -0.2018055469, 0.6123734713, -0.3871226609, 0.23489815, -0.43875283, -0.2116992474, -0.1234647483, 0.2909560204, -0.3018235564, 0.2000406384, -0.1299530715, -0.1054303944, 0.4078007042, 0.0596904121, 0.1735429019, 0.1433303207, -0.1963624358, 0.3420017958, -0.1567714363, -0.5366549492, -0.1837792397, 0.2887184024, 0.5101743937, 0.2040086836, 0.1140415817, 0.1894533932, -0.0184948519, -0.1015853435, 0.5733483434, -0.112977311, -0.3923664689, 0.0809299275, 0.3171570003, -0.0752290338, -0.0010934174, -0.0670254827, 0.0463558994, 0.1651320457, -0.5736997724, 0.0215232074, -0.1362495869, -0.4492547214, 0.0948012918, -0.281965822, 0.3471706212, 0.0344667919, -0.0805371553, 0.1907562762, -0.0205789842, 0.0423796363, -0.4645514488, -0.168199122, -0.0162994936, -0.1974530518, -0.0918182284, 0.0224356726, 0.0416285396, -0.0880814642, 0.3229658604, -0.1877464503, 0.2957329154, -0.1981064081, 0.3834773898, 0.2267546058, -0.1125743836, -0.2475355268, -0.0029423796, 0.1985402256, 0.0700588971, 0.1578550786, -0.2934512794, 0.502081275, -0.1349245161, 0.3260572553, -0.2535350919, -0.2201763839, -0.0583019778, 0.1515716165, -0.2562197447, -0.1333433092, -0.2288073599, 0.1576193869, -0.1931796372, 0.0939431116, 0.0799117684, 0.1832105964, -0.05793529, -0.0438141897, 0.0031955615, -0.0112946555, -0.151325509, -0.0708583593, -0.1550829113, -0.2979605198, 0.3592863381, 0.1999576986, -0.1971529722, -0.2521310151, -0.1948242635, -0.1017805189, 0.2613486052, 0.0787255764, -0.5193732977, 0.2332692742, 0.0885040313, -0.2687841058, 0.0295889918, 0.155636549, 0.5315999985, -0.0201994013, -0.2623342276, 0.5017806292, 0.0501078814, 0.0913204923, -0.0916647911, -0.2254315168, -0.196118325, 0.2768274546, 0.2638248801, 0.3479861617, 0.4208671451, -0.0123441257, 0.5024280548, -0.185175091, 0.2358276248, 0.0584070385, 0.2728781998, -0.1755978912, -0.014329236, -0.439355731, -0.1206989288, 0.1615197212, -0.0966028273, -0.2584328055, 0.3596484065, -0.148689121, 0.044729583, -0.3190504313, 0.2947392166, -0.0419409871, -0.0287706256, -0.2965403199, 0.4093739986, -0.0676427558, -0.3393353224, -0.2134833187, -0.0733154938, 0.0736939311, 0.1995432973, -0.0110144541, 0.3500837088, 0.2485637516, 0.2441174835, -0.1814398468, 0.0056322254, -0.0823098198, 0.0218135454, 0.1309657246, 0.0395607166, 0.1180214658, 0.019910723, -0.027047962, 0.3809481859, -0.1138070077, 0.06397219, 0.1126642823, 0.1333450973, 0.0193934143, -0.4595881402, 0.3454848826, -0.2954246998, 0.0264133364, 0.1687257886, -0.0491248332, 0.3897067606, -0.234051913, 0.1279970855, 0.0550443083, 0.3604436517, 0.1630962193, 0.067540057, -0.0170679018, -0.2695914209, -0.1503734887, 0.0879047066, -0.0890916586, -0.1837016344, 0.2362306714, -0.2942356765, 0.1283311397, 0.1056604907, 0.1332112402, 0.2384627759, 0.2614436746, 0.4191230536, -0.0596986338, 0.5338897705, -0.0798916519, 0.0344994292, -0.1112047285, -0.2185867727, 0.0271368641, 0.1192573309, -0.2720864117, -0.1960969269, 0.1185512245, 0.1599407643, 0.1313767433, 0.1610587686, -0.5328856111, -0.1614169776, -0.5867484808, 0.2014304698, 0.1765573621, 0.0589457415, -0.0102746859, 0.1366425455, 0.3728677928, -0.1443716884, -0.1607405841, -0.0089779943, 0.4862964749, -0.1067719012, 0.3569278121, -0.1209157854, 0.0533810817, 0.2583845854, 0.2524825037, 0.0410922989, 0.0816705227, 0.2867904007, 0.1602695584, -0.1303246319, -0.416148603, -0.0071791261, 0.0893682986, 0.3147812486, -0.1491580904, -0.0932762921, 0.2668733299, -0.0285228044, 0.1035327017, -0.2054282427, -0.121476993, -0.2091583014, -0.1441282034, 0.0973674506, 0.064972125, -0.2281396985, 0.0051543638, -0.5068330765, -0.3248071074, 0.5314698815, 0.3946834803, 0.2537352145, -0.1494754255, -0.1242601871, -0.2517888844, -0.357312113, -0.4232785106, -0.1491886526, -0.7825841308, 0.4113956988, -0.2570542395, -0.3438842595, -0.0755719393, 0.1506991833, -0.1608593762, 0.4088253081, -0.2474160492, 0.0621275045, -0.2387616038, 0.0257505774, 0.1554753482, 0.1434167922, -0.1240391433, -0.7096169591, -0.1004809439, 0.1014401168, 0.3139618635, -0.2614523768, 0.2509828508, 0.3713076711, -0.0902179927, -0.1903647035, 0.0399544388, 0.5214745998, -0.0268343724, 0.2538583279, 0.1307036132, -0.0290281884, 0.0504799969, -0.0862843245, 0.0495518669, 0.3566077352, -0.0647659898, -0.2368633002, 0.2402048707, 0.0547214895, -0.4161047339, -0.3159686327, 0.0295121893, 0.0245012343, -0.0842438862, -0.1255430877, 0.0592539459, -0.1105323285, 0.1262477934, -0.0890262872, 0.0932173431, -0.2466397732, 0.1455629915, -0.0436631218, 0.2179506123, -0.1918682754, -0.5488735437, -0.088017568, -0.3732867539, 0.0275455862, -0.0887908638, -0.2204169035, 0.1540471315, 0.0118219778, 0.200257957, 0.1046787202, 0.5495655537, 0.1924214512, 0.0441888198, -0.1874066591, -0.1772264838, 0.066636242, 0.0763560236, -0.0516130887, -0.0296920296, 0.1616586447, -0.1188295782, -0.3217069507, 0.2123570144, 0.1185416281, 0.3280707598, -0.1773502827, -0.1671268046, 0.2144455165, -0.1191551238, -0.2957466543, 0.2118776143, -0.0948872417, -0.1333672851, -0.0956816375, -0.2035370618, -0.0976694226, 0.0478810817, -0.0564668104, -0.0978599042, 0.0401678346, 0.1136267781, 0.4426671267, 0.0353575982, 0.0149892252, 0.1644072831, 0.5174338222, 0.2307384014, 0.0437972434, 0.0463364832, -0.2539512217, 0.0378037393, 0.1980095208, 0.0985028073, 0.2301356196, 0.0144508556, 0.3215949535, -0.1256861687, 0.0775859654, -0.4251402617, -0.1687736809, -0.4518716037, -0.3695444465, 0.4214906991, 0.0701669306, 0.0333637744, 0.3626656234, -0.129297778, 0.1164962873, -0.1096645147, -0.0519141629, 0.910915494, 0.0007666517, 0.07578291, -0.4442180693, 0.0725765377, 0.520701766, -0.0016885698, 0.0603380799, -0.2513405383, -0.4070751071, -0.1607122123, -0.0440551303, -0.1269134581, 0.1275819093, -0.0306450874, 0.2152334899, 0.0330468416, 0.0687596202, -0.1061893478, 0.0132143423, -0.2566157281, -0.205228433, 0.2999652922, 0.1174325645, 0.0099956505, 0.4072092772, -0.0089246407, -0.0222106576, 0.0564129204, 0.0811625868, -0.1732973158, 0.0782128945, -0.2402408719, -0.1271180511, -0.2153341174, -0.1490629911, 0.011920169, -0.2115809321, -0.0911345035, 0.2856216729, -0.4071880579, 0.2673164904, 0.234970659, 0.1415298432, -0.0455121174, 0.1702987254, -0.2451648414, -0.1385823041, -0.0636675432, 0.1304791421, 0.0675148815, -0.223856017, -0.1592641473, 0.1630322337, -0.0017765081, 0.072884649, -0.148065865, 0.1476819664, -0.0107423961, -0.1184338555, 0.1171131954, 0.2189227641, -0.2218291163, 0.4116456509, 0.2776651382, -0.1695401371, -0.3347321749, 0.6299331784, 0.2015756369, -0.2579893172, -0.0588949621, -0.0949737281, -0.2412517071, -0.2029326558, 0.0254394412, -0.3619162142, -0.2489606291, 0.0684151128, -0.2431004643, 0.2482887506, -0.1463272721, 0.0954280198, 0.0726266727, 0.0065887831, -0.1642002761, -0.2006358206, -0.4192200303, 0.0153944883, -0.0635217354, 0.2517637014, -0.2178008556, 0.0093267038, -0.0072479844, 0.1959368736, -0.2795915902, 0.3235086799, 0.1009352952, 0.1888235211, 0.4417486787, 0.2852602899, -0.2603088915, -0.0910105407, 0.0227066241, 0.3770695031, -0.0110531598, -0.2271910608, 0.0212861076, 0.1728378981, 0.0746538788, -0.2443019748, 0.2491173148, 0.0081316009, -0.1254454255, 0.0937340111, 0.1706278026, 0.0679828227, 0.2518121302, -0.3036062121, 0.51300776, -0.3523676991, -0.4174027741, 0.5407014489, 0.0125266872, 0.0838824287, -0.0037675537, 0.4048579335, 0.12924923, -0.0992392451, -0.1200569123, -0.2527928352, 0.1453032494, -0.1895310134, 0.3002199531, 0.316228807, 0.164917618, 0.3023349941, 0.245777145, 0.5084361434, -0.0152828377, 0.1085114852, 0.4348974526, 0.2377789617, -0.2317807376, -0.1498550177, -0.2036656141, -0.0485084653, 0.015582867, 0.0273267291, -0.001094155, -0.2478486747, -0.0696707964, -0.2985465229, 0.1178782061, 0.2388335764, 0.0260508358, 0.7074030638, 0.1500036716, -0.3291203976, -0.0424696915, 0.1737630963, 0.2074753791, 0.4642714858, -0.1255782843, 0.2695053518, 0.2516712844, -0.0656983331, 0.0272627156, -0.632248342, 0.0490347408, 0.4742778838, -0.1550251693, 0.1333581507, 0.028125558, 0.0583108962, 0.1292911023, -0.0616117828, -0.2436537743, 0.3722508252, 0.2169625759, -0.0386294425, -0.0611899085, -0.3569635749, 0.0298325419, 0.4323065877, -0.0329569913, -0.3165528774, 0.4121622741, 0.060424231, 0.0055015385, -0.1391836256, 0.040139094, 0.0196081065, 0.1764252335, -0.4152515829, -0.1744776964, -0.0612942465, -0.0081062019, 0.297886759, 0.116027683, -0.1798856705, 0.1004526839, 0.2251490951, -0.0406416319, 0.1101350337, 0.0405048206, -0.2707308531, 0.0644743219, 0.302929908, 0.031311214, 0.4102824628, 0.0723475516, -0.1175647825, 0.2593789101, -0.0650704801, -0.1717312038, -0.3983203769, -0.2220228314, 0.2776272297, -0.0164541453, 0.0086398255, -0.1884791106, -0.0986082479, 0.0294518508, -0.362773478, -0.459348321, 0.247217983, 0.3025139868, 0.0553995892, -0.3028544486, 0.4305762649, 0.2326881438, 0.0304532256, -0.1031258404, -0.4151988029, -0.2457068115, 0.0794979781, -0.1626464427, 0.2742976546, -0.0632451996, 0.3734805882, 0.0651793927, 0.3338822722, -0.1283565611, 0.0352494493, 0.0676702112, 0.4144804478, -0.1857171059, -0.0640043169, 0.0284607876, 0.5671871901, -0.070319131, -0.4127243161, 0.3753581643, -0.1111039892, 0.0034157485, 0.2319038212, 0.1265770942, 0.0676538423, -0.2115829438, 0.2716363072, -0.2187781185, 0.1533123553, -0.1447094977, 0.1211736202, 0.028777713, -0.0959737748, -0.1997180879, -0.1962883174, 0.3393836617, -0.1301871687, 0.2296263278, 0.115304105, 0.0823764801, 0.1041027755, -0.0554954931, 0.2501111627, 0.0361601636, -0.4684178829, -0.0568597503, 0.0001645908, 0.1268479377, -0.0011091945, -0.2792009115, -0.3743987978, -0.1956625134, -0.1279829592, 0.5047436953, 0.0234209187, 0.1405041069, -0.4365862608, 0.2666721344, 0.1913577616, 0.0209439043, -0.235193491, 0.1179646999, 0.4022262096, -0.3174348176, 0.234778434, 0.2826933265, 0.1425818056, -0.2283661366, -0.1481785476, 0.269200176, 0.3289658725, -0.3923661113, -0.2372132689, -0.2452915162 ]
https://github.com/huggingface/datasets/issues/2161
any possibility to download part of large datasets only?
We'll work on dataset streaming soon. This should allow you to only load the examples you need ;)
Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks
18
any possibility to download part of large datasets only? Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks We'll work on dataset streaming soon. This should allow you to only load the examples you need ;)
[ -0.416008234, -0.4227994978, -0.0912121534, 0.2210885733, 0.1178916246, 0.2086140811, -0.2158917487, 0.3746376932, 0.1075316817, 0.3137334585, -0.2778742611, -0.2264844477, -0.0971201733, 0.3623843789, 0.2786151171, -0.1379799545, -0.1310560107, 0.2409260124, -0.1959343851, -0.1360584795, 0.0351953655, -0.371194303, -0.1557518691, -0.2762489021, 0.1072826684, 0.0065381136, -0.0016222298, -0.1528019905, -0.3216457367, 0.1749352366, 0.128682822, 0.0949427336, 0.296836108, 0.0225316621, -0.0001144941, -0.3012689948, 0.3300118148, -0.2018277347, -0.2040800005, -0.0629979372, -0.3263171911, 0.1633174121, -0.2283703387, -0.2755313814, 0.0555490404, 0.155889675, 0.1559823602, -0.0213034973, 0.3270634115, 0.1292211115, 0.1475347281, 0.0527241006, -0.1914352924, -0.0762384236, 0.2807139754, 0.1402222663, 0.0194406807, 0.0566957816, 0.6661749482, 0.3004217744, 0.1056195498, 0.0831308216, 0.0118729174, 0.1913021505, -0.0942526162, -0.3307495117, -0.1941795647, -0.6230317354, 0.2782781422, 0.8252425194, 0.638751626, 0.0939346701, -0.176077053, -0.2948755622, 0.1539803445, -0.1587242186, -0.2463077605, 0.6292654872, -0.3267941177, 0.1728769243, -0.5402044058, -0.2325883508, -0.1865911782, 0.2556458712, -0.2171284556, 0.0882262662, -0.0790156424, -0.0391913094, 0.3143949509, -0.0377390347, 0.3111804426, -0.0938630849, -0.2239780873, 0.1800580323, -0.2369109094, -0.3743757308, -0.3241962194, 0.3473262191, 0.3826081753, 0.1467503309, 0.2207318544, 0.1960917711, 0.0698592961, 0.0267219059, 0.4240182936, -0.1731640995, -0.2814111412, 0.2035136819, 0.2531692386, 0.0371987969, 0.0458768606, -0.0351085141, -0.1992000192, 0.2605750859, -0.5001296997, -0.0200259406, -0.3018493652, -0.4213241637, -0.0149689168, -0.264572531, 0.111875698, 0.1028684527, -0.0745219961, 0.1771865338, -0.0060782395, 0.202824384, -0.3606564999, 0.0311388783, 0.0746802464, -0.5046661496, -0.0934187472, -0.006317962, 0.0433680117, 0.0493437424, 0.3772123158, -0.2916143835, 0.3798225224, -0.1353833973, 0.2860985398, 0.1216545999, -0.0231393389, -0.1652134657, -0.0564624332, 0.1320162565, 0.1193646193, 0.1957208216, -0.0756729394, 0.4238183498, -0.1083752662, 0.3343406916, -0.1200218499, -0.2665343881, 0.1457667202, 0.1189230978, -0.3860334754, -0.0808253288, -0.5248142481, 0.2487920076, -0.1913021058, -0.0301385671, 0.0101990104, 0.0602893345, -0.0674405843, -0.0665499866, 0.2375759482, 0.0933559537, -0.2284577191, -0.0791617706, -0.1545652002, -0.1223681942, 0.3714396656, 0.2702901959, -0.2721641958, -0.2225674093, -0.1437160671, -0.2053653896, 0.2452469021, 0.0532234088, -0.441637814, 0.4437433183, 0.071886979, -0.0778923407, 0.0095832869, 0.1884520948, 0.6336513758, 0.079547748, -0.2656627893, 0.6198096275, -0.1294934452, 0.1018554196, -0.0497493446, -0.2907518148, -0.1316675693, 0.2972229719, 0.2475744039, 0.391423434, 0.1908109635, 0.0140922703, 0.3742013574, -0.2035213858, 0.2755431533, 0.1488897651, 0.1048040092, -0.1219550148, -0.1044194847, -0.3329708576, -0.2455964088, 0.2019155771, 0.1670380533, -0.557256937, 0.3659931421, -0.1457131505, 0.036295563, -0.332744211, 0.3766082823, 0.0140637886, -0.1043351665, -0.3237960935, 0.302369982, -0.2443419546, -0.3178133368, -0.069616586, -0.1488310248, 0.0794269443, 0.0792414993, 0.1160820276, 0.4168470502, 0.1795062423, 0.2777093649, -0.3217894137, -0.0120970253, -0.0677321181, 0.0181384757, 0.1762454808, 0.0013725683, 0.2247813642, 0.1153098494, -0.0137179643, 0.2783600986, -0.1971493959, 0.045734331, 0.2255696505, 0.1472246051, -0.0683516711, -0.4450110793, 0.3316786587, -0.2376502603, 0.1782502383, 0.1220900491, 0.0174171627, 0.272870332, -0.1368839294, 0.0763014406, 0.1350094229, 0.4504813552, 0.0766144469, 0.2161705047, -0.0247606412, -0.4326868057, -0.2301257849, -0.0211264584, -0.2638637722, -0.2799149752, 0.2115958333, -0.4132232368, 0.0817955434, 0.1887240112, 0.2074567974, 0.0813947096, 0.2328842431, 0.3495492339, -0.0828318298, 0.6517189741, -0.1666287184, -0.0071180016, -0.0003749281, -0.1914361417, -0.1143668443, 0.0506458282, -0.2767646611, -0.0760615692, 0.1437412798, 0.2027592957, 0.0762581751, -0.0086083859, -0.3400783539, -0.2441247702, -0.6714408398, 0.0762962028, 0.1519193053, 0.0577863902, 0.0029208101, 0.0193790942, 0.4107503295, -0.0264360234, -0.0868314952, -0.0315062627, 0.5220624804, -0.0951066613, 0.2493908554, -0.1078801081, -0.036583744, 0.0866007358, 0.2252972722, 0.1121647209, 0.1787578464, 0.2441753298, -0.0232834369, -0.0803797692, -0.3961847425, 0.0118818581, -0.0368463621, 0.3093237877, -0.0959340483, -0.1772045195, 0.423398912, -0.1610396802, -0.0174167976, -0.230372563, -0.1522229314, -0.03417743, 0.0224788561, 0.0635859072, 0.2688586712, -0.1699955165, 0.1525304914, -0.4189008176, -0.3468064666, 0.3461505771, 0.134147808, 0.16333583, -0.2418622226, -0.0921134502, -0.2322883755, -0.2644006908, -0.3277678192, 0.0947526246, -0.8488112092, 0.4130101204, -0.1486276686, -0.3536372781, -0.0303914472, 0.0645907968, -0.2282582372, 0.5403366089, -0.3521280885, 0.1787140667, -0.2025310248, -0.1195927411, 0.108503066, 0.0318410173, -0.2324285805, -0.7003278136, 0.0002424084, 0.0069479272, 0.2122764587, -0.1871310025, 0.1414141208, 0.3855122626, -0.0612121336, 0.0452300869, 0.1133163571, 0.6742671132, 0.1244413406, 0.1787573397, 0.0296517462, 0.0931015685, -0.0170449093, 0.0397599004, 0.0937467441, 0.3169901371, -0.0764263421, -0.184202224, 0.1732453704, 0.0769554973, -0.2560744584, -0.3300916553, 0.0518584549, -0.1199231595, -0.1267181337, -0.0537188724, -0.1582235545, -0.0047134291, 0.148406297, -0.0204932094, 0.0621160567, -0.2487457693, 0.0492594428, 0.0287837666, 0.3928288221, -0.0162778627, -0.4690265656, -0.0255299024, -0.3079202473, 0.0758049563, -0.0953143686, -0.1000259891, 0.0522104353, 0.1006635725, 0.0733547956, 0.2640863955, 0.3989116251, 0.0156198237, 0.1200767457, -0.1917633712, -0.1950030923, -0.1973485053, 0.0358570069, -0.0327314548, -0.0134563968, 0.2429582626, -0.1197203547, -0.3848583698, 0.2900088429, -0.0171888731, 0.4906188846, -0.0699080229, -0.1322180331, 0.1803020537, -0.0493801311, -0.2061176449, 0.2111074626, -0.0840542242, -0.214612782, -0.2539412379, -0.0784407109, -0.1251191944, 0.1815259159, 0.0560976863, -0.1242297292, 0.0518863276, 0.1346191019, 0.3988798857, 0.140956372, 0.117858693, 0.2378038168, 0.4254065454, 0.2991863489, -0.1155484542, 0.0455169156, -0.0836472884, -0.0475637168, 0.164221406, 0.0294941254, 0.2476630509, 0.3052617311, 0.2623025179, -0.1150102764, 0.1111806035, -0.4343548715, -0.1198327169, -0.4944819808, -0.6160653234, 0.4447357059, 0.1657910049, 0.042317912, 0.4265917838, -0.2824220657, 0.1392946839, -0.137976557, -0.1551314294, 0.7866649628, -0.0446679592, 0.056624759, -0.4420414269, 0.0823451951, 0.4862215817, 0.088880524, -0.0156092262, -0.1864540279, -0.5498303175, -0.1266833246, -0.1424373984, -0.1348600537, 0.1910955012, -0.0513050333, 0.3555555344, -0.1016651243, 0.2523548603, 0.0963888317, -0.0012905002, -0.3779744208, -0.2204289883, 0.0948164612, 0.0760562569, -0.1214834005, 0.3061076105, -0.0015227832, -0.0075030066, -0.0485643819, 0.0961136371, -0.195592016, 0.2064880729, -0.3052037358, -0.1430626959, -0.3039153218, -0.140544802, 0.1190782115, -0.010974478, -0.1744750887, 0.1768082678, -0.3655036688, 0.2938461304, 0.2110073417, 0.1051476598, -0.0190241542, 0.1918653995, -0.2770026028, -0.0221475512, -0.0550034866, 0.3291870654, 0.0409177653, -0.1103689298, -0.1155575812, -0.0003946163, 0.1025444567, 0.0863656104, -0.1962897778, 0.0315902196, 0.0739090145, -0.1351100504, 0.0788361579, 0.1967617571, -0.1610276401, 0.3221879005, 0.2844256461, -0.1205344349, -0.2411417663, 0.5982015133, 0.1175039262, -0.1930468082, 0.0567225106, -0.0242087767, -0.2109338939, -0.1459594071, 0.1243496686, -0.2360055447, -0.1271970123, -0.0554684177, -0.2937467396, 0.3160280883, -0.0912455767, -0.0532967746, 0.1353044808, -0.0562690422, -0.0229645073, -0.287710458, -0.3725259304, 0.2079889178, -0.0053921556, 0.1750869006, -0.1430560648, -0.0372063406, -0.0696321949, 0.2916398048, -0.2089210153, 0.3644315004, 0.1304095536, 0.2831205428, 0.2882482708, 0.349522531, -0.2443478853, -0.0633349791, -0.0329831652, 0.2173097581, -0.0284550674, -0.1330005229, 0.0020384118, 0.1984714568, 0.1089470983, -0.333796978, 0.1763238758, -0.1900525987, -0.0990203023, 0.0433450826, 0.1389496624, -0.0159241185, 0.2052645683, -0.3531025648, 0.508284688, -0.1798095107, -0.5356279016, 0.46202299, -0.1171628684, 0.1306310892, -0.0761514306, 0.322021246, 0.3210879564, -0.1224156469, -0.2100387514, -0.2230060995, 0.2127710879, -0.1388968378, 0.3544561863, 0.1668493748, 0.3332603574, 0.2461367249, 0.2445176989, 0.534257412, -0.0433652364, 0.2196805477, 0.441221714, 0.21130687, -0.0947918817, 0.0131519996, -0.0713929087, 0.073175624, -0.0042210221, 0.0684014186, -0.0928286016, -0.3367202282, -0.180469811, -0.3591632247, 0.1765954942, 0.2496605366, 0.2280019969, 0.7436216474, 0.2074039876, -0.2657699883, -0.3291835189, 0.254886061, 0.1826936752, 0.2631572783, -0.0423871763, 0.3229689896, 0.1779692024, -0.0002190927, 0.0075090118, -0.7347241044, -0.1277994812, 0.5495402813, -0.0863279402, 0.1695787907, -0.0750986934, 0.026685195, 0.129477948, -0.1292866617, -0.1657753587, 0.2464841306, 0.2347250432, 0.0446922928, -0.0985674039, -0.2884528041, -0.0108835697, 0.4674574435, 0.0264978576, -0.3120701015, 0.2790997028, 0.2482137233, 0.0383433886, -0.2654881179, -0.018595105, 0.1521428376, 0.1460032761, -0.4191280007, -0.1224379912, -0.033455085, 0.0014856514, 0.4145699441, 0.0735968053, -0.1740534008, 0.0690132827, 0.2184705287, 0.057653226, 0.2066495866, 0.0722352415, -0.1061975956, 0.0054669902, 0.3811668158, -0.0179981943, 0.3822940886, 0.0661659315, -0.1120460629, 0.2347367406, -0.1527879238, -0.1883719116, -0.4321074486, -0.2551420927, 0.1460384578, 0.054481402, -0.077669993, -0.1592255831, -0.0845688879, 0.1961087734, -0.2716819048, -0.3965242803, 0.1675685942, 0.3351819217, 0.0275687277, -0.2927802801, 0.3786402345, 0.2864266634, 0.1504724026, -0.2301661074, -0.5346698165, -0.1499334574, 0.0194742456, -0.2891176939, 0.3038635254, 0.0546503216, 0.1894906312, 0.018169662, 0.2077968866, -0.2392199337, 0.1931408644, -0.1128475443, 0.4548941553, -0.145768702, -0.172586903, -0.0497343242, 0.5787018538, -0.1278289258, -0.400983572, 0.3574503958, -0.0456189141, -0.0238703452, 0.2780325413, 0.0456856191, 0.0740408897, -0.2255826741, 0.1281095296, -0.1869565398, 0.299470365, -0.0536473915, 0.123494789, 0.0335416906, -0.1741550863, -0.1832645535, -0.0315528698, 0.194711864, -0.0502502695, 0.101226218, 0.1653433889, 0.0438489988, 0.0073730946, -0.1048273668, 0.2365270406, -0.1300776899, -0.4823199511, -0.1868065, 0.1812529415, 0.1828767657, -0.0484648831, -0.3840534389, -0.3502149582, -0.1270208061, -0.0526524633, 0.5525504351, -0.1313405037, 0.1620956361, -0.4143199623, 0.3236409426, 0.2318765521, 0.1669838578, -0.1339511722, 0.1610230356, 0.4107992053, -0.3414476514, 0.2553164959, 0.1687322259, 0.2022461295, -0.1833289415, -0.1224541068, 0.1712692082, 0.251616776, -0.4405367076, -0.2349566072, -0.3314542472 ]
https://github.com/huggingface/datasets/issues/2161
any possibility to download part of large datasets only?
thanks a lot Quentin, this would be really really a great feature to have On Wed, Apr 7, 2021 at 12:14 PM Quentin Lhoest ***@***.***> wrote: > We'll work on dataset streaming soon. This should allow you to only load > the examples you need ;) > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2161#issuecomment-814791922>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AS37NMROD62QAKIJMAKWISTTHQWBVANCNFSM42IUI5JQ> > . >
Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks
79
any possibility to download part of large datasets only? Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks thanks a lot Quentin, this would be really really a great feature to have On Wed, Apr 7, 2021 at 12:14 PM Quentin Lhoest ***@***.***> wrote: > We'll work on dataset streaming soon. This should allow you to only load > the examples you need ;) > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2161#issuecomment-814791922>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AS37NMROD62QAKIJMAKWISTTHQWBVANCNFSM42IUI5JQ> > . >
[ -0.4333570004, -0.4534873366, -0.0487324968, 0.2667760849, 0.1081291214, 0.243180275, -0.1623354405, 0.4673765302, 0.0734751821, 0.3738210499, -0.3642460704, -0.2017759979, -0.0959114581, 0.4577918053, 0.3195568323, -0.147272408, -0.1357191056, 0.2194817662, -0.2238371223, -0.168805331, 0.0174044296, -0.2593171299, -0.1123770475, -0.2532625198, 0.0350646786, 0.0898535475, -0.061715357, -0.0844497904, -0.3761278689, 0.1701028198, 0.1983956844, 0.2140853852, 0.2366966158, -0.0048214719, -0.0001184534, -0.2889573574, 0.2554898858, -0.1432122886, -0.1864689589, -0.0577483699, -0.1817247868, 0.1063680202, -0.2372538745, -0.2628687918, -0.0091606975, 0.1348170638, 0.0690668747, -0.0218830928, 0.3579902351, 0.0345511436, 0.1137141138, 0.1012042537, -0.1499210298, -0.1075809896, 0.2725988626, 0.1650010496, -0.0292278007, 0.0600768067, 0.5326686502, 0.2669930458, 0.1294607222, 0.1173668653, -0.0027755871, 0.2834873497, -0.090734303, -0.1894120425, -0.2640937865, -0.6127958894, 0.2104034871, 0.893574357, 0.557263732, 0.0032649557, -0.2365490049, -0.4016394019, 0.1302787662, -0.3426570892, -0.1672673374, 0.5966561437, -0.309320122, 0.1920769513, -0.5190603733, -0.1575798392, -0.1254055798, 0.2723096609, -0.2245434523, -0.0139278844, -0.1768502593, -0.045890104, 0.4784287512, -0.0008330839, 0.1448499411, -0.0473280996, -0.18770504, 0.2302683145, -0.2143139541, -0.4565866292, -0.2157701701, 0.2906160057, 0.5468565226, 0.2475870401, 0.0848186761, 0.1489577293, -0.0171017013, -0.0635390505, 0.491553992, -0.2148905694, -0.2800325751, 0.1818935126, 0.3234027624, 0.0830504596, 0.1106129438, -0.0376579799, -0.0844546556, 0.24532637, -0.5971102715, -0.0122541105, -0.2203571498, -0.4416051507, 0.0325091779, -0.2539963424, 0.138533935, 0.1137558222, -0.0686254576, 0.165299058, 0.0227537304, 0.1592403501, -0.3400883377, 0.0705229938, -0.0038735867, -0.4409326911, -0.132912904, -0.0432235748, 0.0712559074, 0.123853147, 0.4013693035, -0.3420194685, 0.3170059323, -0.1057772934, 0.3391905129, 0.1396168768, -0.1107198298, -0.1596134305, -0.0881124735, 0.1561317444, 0.0169005319, 0.2920121849, -0.0551252402, 0.483569175, -0.1643660367, 0.2821947932, -0.1610150784, -0.2401705384, 0.1469043046, 0.0407237522, -0.3738723993, -0.0618704632, -0.5082563758, 0.3586714864, -0.1699184328, 0.0181915537, -0.0189898275, 0.1638080925, -0.2160220146, -0.0025569722, 0.232224822, 0.2576269805, -0.2118473053, -0.1752519011, -0.1312911212, -0.1395864636, 0.3125015497, 0.3773927093, -0.2835656106, -0.2201150954, -0.2215558589, -0.0606912747, 0.1919153929, 0.0454827398, -0.4724432826, 0.3615727723, 0.0099889189, -0.0307085812, 0.0478570983, 0.1477381438, 0.6136128306, 0.0301966853, -0.1679203063, 0.5325428843, -0.0892710239, 0.0808938816, -0.0496496372, -0.3678535223, -0.1579563916, 0.2755120397, 0.1951167881, 0.4164228141, 0.1727065742, -0.0402593538, 0.4430028796, -0.22019279, 0.336822927, 0.1818810552, 0.1613423079, -0.0847180784, -0.1551971436, -0.4076604843, -0.2964690924, 0.2118468583, 0.1321216375, -0.4998213649, 0.3217774332, -0.2148119211, 0.0395306312, -0.3210992813, 0.4084581435, 0.0056837983, -0.1502961218, -0.3171791732, 0.3548722565, -0.1546441466, -0.3655126095, -0.075615488, -0.1111736074, 0.1478281468, 0.00361453, 0.1395067275, 0.4277284145, 0.184194088, 0.2695963979, -0.2078377157, 0.0122559667, -0.133146286, 0.0429857038, 0.144022882, -0.0245185755, 0.136562258, 0.093528524, 0.0826347694, 0.3256611824, -0.0734846741, 0.0104411375, 0.0894773081, 0.1080784649, -0.0458221883, -0.4931142926, 0.4346590042, -0.2044018954, 0.1076000854, 0.0549513772, 0.0469650403, 0.2766538858, -0.1762053818, 0.0548625439, 0.0512986183, 0.4707567096, 0.0086866543, 0.1812570691, -0.0498718023, -0.4779133797, -0.1523169577, 0.0950542092, -0.189729616, -0.2867539525, 0.2613023818, -0.3662055731, 0.1668248177, 0.1373103559, 0.149900198, 0.1633578837, 0.1919975877, 0.37670362, -0.0624543875, 0.6231998205, -0.1187391877, -0.0556431413, -0.0444185846, -0.2490235269, -0.0204356648, 0.0649899393, -0.1989006251, -0.1338720322, 0.1765614152, 0.1989264786, 0.1194390655, -0.0303288102, -0.3401846588, -0.3156104684, -0.5664641857, 0.0017028525, 0.1305924356, -0.0309440047, 0.0081283078, 0.0766012296, 0.4942080379, -0.0850626454, -0.1224117577, 0.0192587748, 0.5008317232, -0.1121080071, 0.2183010429, -0.135067597, 0.0262116231, 0.1769272685, 0.176134944, 0.0995413661, 0.1548145115, 0.2831909657, 0.0096909031, -0.1914439201, -0.4029517472, -0.0166047886, 0.0456124507, 0.1962953806, -0.044983387, -0.0982213914, 0.3928931057, -0.1275784969, 0.0537220463, -0.1555534899, -0.1446160972, -0.1366892606, -0.0164341852, 0.0568502024, 0.3071408272, -0.2456604689, 0.122818701, -0.3954454064, -0.3361864984, 0.5191755295, 0.2037495971, 0.1333259046, -0.1553140283, -0.1250763834, -0.1931602061, -0.3779404163, -0.3520568013, -0.0067363195, -0.8144294024, 0.3607503772, -0.1228068769, -0.3429991901, -0.0961321071, 0.040607661, -0.2655554116, 0.4734802246, -0.4235667884, -0.0079282932, -0.2472909391, 0.0260358974, 0.1307428926, 0.0601335317, -0.0914827287, -0.7272816896, 0.0136252157, 0.0473926514, 0.0997406989, -0.169402793, 0.1886521578, 0.3197817802, -0.0790273547, 0.0955644399, 0.0600276589, 0.7942323685, 0.2001704276, 0.2377908528, 0.0253896676, 0.0094835367, 0.1083214134, -0.0896688327, 0.0220871717, 0.3123311698, -0.0865290537, -0.1279292405, 0.1711142808, 0.090501152, -0.1765901744, -0.2894427478, 0.1126205325, -0.0648025051, -0.2297689319, -0.0853300095, -0.036088679, -0.0486707613, 0.1773183048, -0.0450429544, 0.1011379957, -0.2055665851, 0.0768798441, 0.1030450687, 0.426122725, -0.00326268, -0.5111987591, 0.0256016664, -0.4151403308, 0.0298556015, -0.1008166522, -0.1754585356, 0.0461765975, 0.1045518368, 0.1455364823, 0.2749372721, 0.6094441414, 0.1287351102, 0.0785776675, -0.1902300119, -0.3172529936, -0.1819412112, 0.0737122744, -0.0069059059, -0.0538489372, 0.2234915942, -0.036224585, -0.4989299178, 0.2183310091, 0.1101668775, 0.4760248661, -0.0809596479, -0.1244960949, 0.1341002882, -0.0801891908, -0.3476272523, 0.2703020573, -0.0027732924, -0.1474337876, -0.2224280834, -0.1043477878, -0.0786638558, 0.1369886547, -0.0433473811, -0.1367671192, 0.0629203245, 0.1720433235, 0.5014217496, 0.2424037009, 0.0527434945, 0.1936718822, 0.5433931947, 0.2950317264, -0.1828604937, -0.0381435305, -0.0484643877, -0.0636331737, 0.2625676095, -0.0025890581, 0.3213336468, 0.3059741259, 0.2316221595, -0.1925805956, 0.0793704167, -0.3739944398, -0.0820898712, -0.4709223211, -0.5614638329, 0.4475447834, 0.202879101, 0.1062162817, 0.434665978, -0.1795487404, 0.198241353, -0.188329652, -0.2163236439, 0.8998523951, -0.0903339088, 0.1644763947, -0.407610476, 0.1434991062, 0.5279067159, 0.0885770768, 0.0377226099, -0.2836926579, -0.4837169349, -0.1054597944, -0.1152039766, -0.1306112111, 0.1632206589, 0.0144836977, 0.3080943525, -0.0136225671, 0.2355787307, -0.108183831, -0.0506041162, -0.3240157664, -0.2965846956, 0.0336051583, 0.0432381555, -0.0538076311, 0.4086192846, 0.0487388223, -0.0098851807, -0.036771439, -0.00239373, -0.2605625689, 0.1173680574, -0.337446928, -0.1653788686, -0.1736392975, -0.1403454244, 0.0817822888, -0.0643990412, -0.0680084676, 0.2243029624, -0.4172193408, 0.1950128973, 0.0875792578, 0.0486803874, -0.0289877579, 0.1295096129, -0.2384092361, -0.0165439621, -0.0272000134, 0.2514561415, 0.0822015479, -0.1809625924, -0.0513050556, 0.0272661801, 0.0684538633, 0.0034612082, -0.159986645, 0.0955808461, 0.1455599368, -0.1736116409, 0.0297265276, 0.2340487391, -0.2063101679, 0.2809709013, 0.206608057, -0.0870754272, -0.2332038879, 0.6446013451, 0.0592903718, -0.1178618148, 0.057428427, 0.0331479907, -0.1950783134, -0.1573962867, 0.0382623821, -0.2670313716, -0.2920296192, 0.0826943293, -0.1529105753, 0.3014319241, -0.1664446294, 0.0802083835, 0.1290066838, -0.0819445848, -0.0128515884, -0.2683201432, -0.3731096685, 0.178023681, -0.069472082, 0.2584633827, -0.064384751, 0.0884527117, -0.1560297012, 0.273332119, -0.1831398904, 0.3751690686, 0.0650058687, 0.2167411745, 0.4075685441, 0.285474211, -0.1137750223, -0.0564873852, -0.0738375708, 0.3291237652, -0.1099061221, -0.1135167405, -0.0640316308, 0.1994958073, 0.07892479, -0.318459928, 0.3013946116, -0.0749775544, -0.175239116, -0.0162117034, 0.2714847624, 0.0736442357, 0.2812749147, -0.3258122206, 0.4892231524, -0.1573140621, -0.5090851188, 0.5505746603, -0.0986975133, 0.1000479013, -0.0494872481, 0.3082486093, 0.1302591264, -0.0771681219, -0.1866597235, -0.2183680087, 0.2284558713, -0.182815671, 0.3463942707, 0.1696285158, 0.2244617045, 0.3715803623, 0.3263930082, 0.4821104407, -0.0676550567, 0.2630613744, 0.4612111449, 0.1509507298, -0.1444546878, 0.0062384382, -0.0243894737, 0.0559237562, 0.036905244, 0.0973557383, -0.0270197988, -0.276356101, -0.111555025, -0.3886429071, 0.1320343018, 0.2663981915, 0.232332319, 0.7065258622, 0.1635610461, -0.239302963, -0.1509809792, 0.2523433864, 0.1701165885, 0.253554076, -0.1003316343, 0.1628602743, 0.0309786424, -0.0316493437, -0.0584558211, -0.8065461516, -0.0191522166, 0.5419050455, -0.0379737467, 0.1781444699, -0.153063193, 0.188534826, 0.0250431597, -0.1017904878, -0.204303816, 0.3760122955, 0.24793455, -0.0519261956, 0.024659887, -0.2595552206, 0.0205931067, 0.5150588155, 0.0020621766, -0.3844750226, 0.3281677961, 0.1726403832, 0.0208292641, -0.3904670477, -0.0901897103, 0.1719794273, 0.1882949919, -0.369643271, -0.1327729076, -0.0743301362, 0.0047088154, 0.408334136, 0.1221459582, -0.1973830163, -0.0800894499, 0.317168802, 0.0733504221, 0.1180298477, 0.10582266, -0.1125663891, 0.0590075999, 0.258284986, 0.0294453092, 0.4560606778, 0.0057618767, -0.0917913243, 0.1343685687, -0.1761391163, -0.1272949725, -0.540774703, -0.2045724839, 0.1228747889, 0.0578005016, -0.1624276042, -0.1606594026, 0.0118193924, 0.0922974795, -0.2890811861, -0.3772735, 0.1872646809, 0.3017647862, 0.0084913485, -0.2976930141, 0.3289000988, 0.335246563, 0.0406832173, -0.2348484397, -0.4091711044, -0.1602900028, 0.004114002, -0.2967252135, 0.3039314151, 0.0120667778, 0.234277457, 0.0612703115, 0.213632375, -0.2468574643, 0.1188302934, 0.0262545943, 0.4117545784, -0.1158749983, -0.172589168, -0.1143699586, 0.490988642, -0.08078596, -0.3751323223, 0.3062753677, 0.0404984541, -0.0982872024, 0.2537682652, 0.1508228928, -0.0326507948, -0.2881296873, 0.1547316611, -0.1046459004, 0.2012621462, -0.0296060741, 0.0327400044, -0.0694690421, -0.1801568717, -0.3215426207, -0.0871652588, 0.1265007406, 0.023267515, 0.0851306841, 0.1031202972, -0.0183850769, 0.0764910728, -0.0063396096, 0.2128140777, -0.0935365111, -0.3386486173, -0.1426963657, 0.1622716188, 0.1784216464, 0.0436686724, -0.3368486166, -0.2921511531, -0.0895115286, -0.1395902932, 0.6184889078, -0.1524661928, 0.194783181, -0.3990027905, 0.3505751491, 0.2527212501, 0.0121103022, -0.2960342169, 0.1454518437, 0.3403013349, -0.3048079014, 0.232601881, 0.262183696, 0.0720752627, -0.239323467, -0.1105469018, 0.3002929091, 0.3226249814, -0.4334452152, -0.1008866802, -0.3000040054 ]
https://github.com/huggingface/datasets/issues/2161
any possibility to download part of large datasets only?
Is streaming completed? On the 1.8.0 docs it is mentioned (https://huggingface.co./docs/datasets/dataset_streaming.html), but when following the example I get the following error: ``` >>> dataset2 = load_dataset("amazon_us_reviews", "Pet_Products_v1_00", split='train', streaming=True) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-21-1eedab26cff1> in <module>() ----> 1 en_dataset = load_dataset('oscar', "unshuffled_deduplicated_en", split='train', streaming=True) 3 frames /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _create_builder_config(self, name, custom_features, **config_kwargs) 339 if value is not None: 340 if not hasattr(builder_config, key): --> 341 raise ValueError(f"BuilderConfig {builder_config} doesn't have a '{key}' key.") 342 setattr(builder_config, key, value) 343 ValueError: BuilderConfig OscarConfig(name='unshuffled_deduplicated_en', version=1.0.0, data_dir=None, data_files=None, description='Unshuffled and deduplicated, English OSCAR dataset') doesn't have a 'streaming' key. ``` UPDATE: Managed to get streaming working by building from source and installing the additional `datasets[streaming]` package: ``` !pip install git+https://github.com/huggingface/datasets.git !pip install datasets[streaming] ```
Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks
123
any possibility to download part of large datasets only? Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks Is streaming completed? On the 1.8.0 docs it is mentioned (https://huggingface.co./docs/datasets/dataset_streaming.html), but when following the example I get the following error: ``` >>> dataset2 = load_dataset("amazon_us_reviews", "Pet_Products_v1_00", split='train', streaming=True) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-21-1eedab26cff1> in <module>() ----> 1 en_dataset = load_dataset('oscar', "unshuffled_deduplicated_en", split='train', streaming=True) 3 frames /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _create_builder_config(self, name, custom_features, **config_kwargs) 339 if value is not None: 340 if not hasattr(builder_config, key): --> 341 raise ValueError(f"BuilderConfig {builder_config} doesn't have a '{key}' key.") 342 setattr(builder_config, key, value) 343 ValueError: BuilderConfig OscarConfig(name='unshuffled_deduplicated_en', version=1.0.0, data_dir=None, data_files=None, description='Unshuffled and deduplicated, English OSCAR dataset') doesn't have a 'streaming' key. ``` UPDATE: Managed to get streaming working by building from source and installing the additional `datasets[streaming]` package: ``` !pip install git+https://github.com/huggingface/datasets.git !pip install datasets[streaming] ```
[ -0.4476094544, -0.388507843, 0.0095245689, 0.3701236248, 0.1067445278, 0.1929704845, -0.0340351127, 0.5148777962, 0.0819871873, 0.2324688435, -0.45345366, -0.1990630925, -0.1784161925, 0.4000231624, 0.3254312873, -0.1704493165, -0.1151956022, 0.1878744811, -0.0883972496, -0.1764554679, -0.0659911707, -0.0662000328, -0.1601545811, -0.137334913, 0.0878683925, -0.0127936164, -0.0002600998, -0.060689427, -0.395277679, -0.0482895225, 0.2791900039, 0.1899070591, 0.1114026606, 0.136345014, -0.0001268418, -0.1690051407, 0.3633389473, -0.1690451205, -0.3607493341, -0.1897484064, -0.1767889261, 0.0864566714, -0.0258888844, -0.1968064904, 0.0642870516, 0.0536653064, 0.0196070466, -0.020212166, 0.4206509888, 0.0790271759, 0.0756612569, 0.2862713039, 0.1064425707, 0.1084072515, 0.1896710247, 0.1896164864, 0.0424218848, 0.1744015366, 0.2637001276, 0.2539017797, 0.0544782914, 0.2674317062, 0.0258966386, 0.3122109473, 0.049410779, -0.1832498163, -0.1826817095, -0.668646276, 0.1587408036, 0.63454175, 0.2820595503, -0.0176110268, -0.5097762346, -0.4816656411, 0.1284911633, -0.6643291116, -0.0680877715, 0.6299393773, -0.4362096786, 0.0515865274, -0.6224969625, -0.2577052712, -0.2082428634, 0.3043959141, -0.1951345354, 0.1637152433, -0.2123504877, 0.131918937, 0.2644873261, -0.0100987973, 0.0959195122, -0.231999591, -0.048996415, 0.3651181459, -0.1721383631, -0.3230682611, -0.1300765574, 0.2823482156, 0.3912600875, 0.2919588089, -0.0171134509, 0.1264040768, 0.1318631619, -0.0820956156, 0.5853520036, -0.1074892506, -0.3332637846, 0.2814317942, 0.3189249635, 0.3265119791, 0.1355916709, -0.0895507038, -0.1213613451, 0.2551882565, -0.3615018725, -0.0669894814, 0.0641150028, -0.3408078849, -0.0459391326, -0.1280491054, 0.030527994, -0.0864461586, 0.0000252239, 0.2266819179, -0.0999818444, 0.2417337745, -0.2276194394, 0.0628779605, -0.0823989883, -0.282722652, -0.0952995718, 0.001926288, 0.1059900671, 0.1242706627, 0.2675988078, -0.573120594, 0.3885336518, -0.1137726009, 0.5026562214, 0.0964686871, -0.1554781497, -0.1604899466, 0.038918864, 0.3139610291, 0.0650517642, 0.4057743549, 0.0124907568, 0.2547514439, -0.2002496421, 0.2239138782, -0.1098950803, -0.4199580848, 0.0124077145, 0.0053588543, -0.3765231073, -0.0404928476, -0.3970385194, 0.2838449776, 0.0285332464, 0.1067955494, -0.0624935813, 0.117452547, -0.0911438912, -0.0263898037, 0.3707152307, 0.3494334817, -0.0923916698, -0.205437392, -0.1573991328, -0.0737660006, 0.2902519405, 0.4422822893, -0.3034175038, -0.1268012822, -0.211547479, -0.2598551214, 0.3551359773, -0.0856347904, -0.3528120816, 0.3833649755, 0.1783615798, 0.1554277986, 0.1417039037, -0.0104908533, 0.6427508593, 0.0784267187, 0.0167191103, 0.4966117144, -0.1728041768, -0.0436565317, -0.0887443125, -0.3199162483, -0.1930650771, 0.3292200565, 0.1675106436, 0.3437725604, -0.0655095726, 0.0158570781, 0.4304688275, -0.0927522331, 0.442292273, 0.1339258254, 0.2232973725, 0.0517350212, -0.2251438797, -0.4198055565, -0.3900242746, 0.2023003995, 0.2302106917, -0.3973639607, 0.132265687, -0.1938219517, -0.0703586563, -0.2523658872, 0.1331309676, -0.1378819346, -0.1556592286, -0.1328212321, 0.3140978813, -0.1343355179, -0.5509428382, -0.0244985707, -0.0420947485, 0.2612620592, -0.1101006791, 0.2821853757, 0.1781550795, -0.0102132428, 0.2728772461, -0.1592216939, -0.0508326702, -0.1912721694, -0.0481918268, 0.2164037377, -0.0373285674, 0.0216385052, -0.1655332744, 0.0964832902, 0.3940749764, -0.0028955415, -0.028051639, 0.1597700119, 0.0947016776, -0.052816093, -0.2889884114, 0.5896886587, -0.079375878, 0.1561118662, 0.2797577083, 0.0629937872, 0.2583141327, 0.0245998949, -0.1124245524, -0.0111217126, 0.3463191986, -0.1293140054, 0.3581706285, -0.1327633709, -0.5334996581, -0.2308388054, 0.3453399539, -0.1733858287, -0.3991054296, 0.2580745816, -0.297313422, 0.1224728599, 0.1615039408, 0.0103754252, 0.0803766698, 0.1109912619, 0.3299813867, 0.0556581169, 0.4505046308, -0.0324969664, 0.0974353403, 0.105053708, -0.2600084543, 0.0505797081, 0.0576698855, -0.1339038312, -0.3236029148, -0.0294130594, 0.1493065655, 0.2342585176, -0.1711519659, -0.1821261048, -0.236021027, -0.4625360966, -0.1564715803, -0.1158613786, -0.1308816671, -0.0992544442, -0.0840447024, 0.6108604074, 0.018610619, 0.0107476264, -0.0253540948, 0.1656915992, 0.0254361555, 0.2290915251, -0.2243381739, 0.0105295442, 0.1550068855, 0.0568731204, 0.1393428296, -0.0375016406, 0.3074815571, -0.0599759147, -0.2525289059, -0.2569152415, -0.0906152576, 0.0830257609, 0.0150330234, -0.0439837128, 0.0417106189, 0.5142200589, -0.1807917058, -0.1234091222, 0.0148857385, -0.0761072561, -0.1766091436, -0.0104601756, -0.0691784695, 0.2297689021, -0.094616048, 0.0419861972, -0.4150297046, -0.3144568503, 0.514834106, 0.3765215576, 0.2471688241, 0.0415060483, -0.1072002873, -0.1911923289, -0.4565022886, -0.1922218949, 0.0175262466, -0.8641297221, 0.3706216216, -0.0480119772, -0.2978561819, 0.0169304088, 0.0122653469, -0.1107023135, 0.364022553, -0.3850354552, 0.1171992123, -0.2212020457, 0.206400454, 0.0881160498, 0.1745103598, 0.0010339469, -0.5461444259, 0.1023331508, 0.0984678119, 0.0187485367, -0.2533034086, 0.2585520744, 0.2878211439, -0.1134539545, 0.303796947, 0.0108648166, 1.0486694574, 0.3577301502, 0.1942343116, 0.1153858304, -0.0145855565, 0.1851332486, -0.1911918521, -0.1458615959, 0.3457380831, -0.0789472014, -0.0668451041, 0.1051468104, 0.0415119119, -0.1388579607, -0.3954808712, 0.2484030128, -0.0438912287, -0.252828598, -0.1172268093, -0.2193704247, 0.0995958, 0.0906499475, 0.0542365834, 0.1259043515, -0.1767571419, -0.1605111659, 0.2112129331, 0.4497783482, 0.0769432262, -0.2806782424, -0.0941866487, -0.5484692454, -0.0183812678, -0.0968115032, 0.020768594, 0.0716717541, 0.1369584501, 0.1776130497, 0.1999528408, 0.4251608551, 0.015051702, -0.0851411223, -0.1003861278, -0.3912238479, -0.379296869, -0.0583370402, -0.0616401136, 0.0325776562, 0.2290617228, 0.2159032971, -0.598977685, 0.128358826, 0.2132705301, 0.4295918345, -0.0855614468, -0.0359845683, -0.1612872034, -0.25177145, -0.4768919051, 0.339289397, -0.0018538758, -0.0085676834, -0.137403518, -0.1114351153, 0.0696499646, 0.2064136863, -0.0332828388, -0.0765375793, -0.0547532849, 0.1620875299, 0.525814414, 0.2096892446, 0.1231719926, 0.1552082747, 0.5412438512, 0.2921207249, -0.3287693858, -0.1230677962, 0.1314024776, 0.0337636173, 0.2663980126, -0.0707629547, 0.2665629387, 0.456199795, 0.21694915, -0.0569785796, 0.0430734977, -0.111779131, -0.0314423814, -0.4366397858, -0.6649063826, 0.1833860576, 0.0289564729, 0.171999082, 0.5021620989, -0.0893519893, 0.0872229636, -0.1249870136, -0.3470997214, 0.8403224945, 0.0230594873, 0.2463891059, -0.0838518143, -0.0915786251, 0.4362728596, 0.3076654673, 0.0302493908, -0.3009407818, -0.2791680098, -0.0544980019, -0.0897178724, 0.0475792624, 0.0608510636, 0.0047928467, 0.4569298923, 0.0234943181, 0.4431340396, -0.150661245, 0.094379209, -0.3789505959, -0.2833106518, -0.1951296479, -0.043959178, -0.2036376446, 0.5190582871, -0.0276789051, -0.0529738516, 0.0900139362, -0.1041015163, -0.2623253763, -0.0305285342, -0.3110881448, -0.0773402154, -0.1820991188, -0.332074672, 0.044980377, -0.2058794945, -0.1879916042, 0.0597038493, -0.2648639977, 0.174445793, 0.0788605288, 0.0530684479, -0.0842143744, 0.166313976, -0.1594959497, -0.0951338857, -0.0796266422, 0.2896769643, 0.0260672122, -0.125926882, 0.0134980232, -0.0432059281, 0.228405863, 0.0498595871, -0.0776966661, 0.0118709039, -0.0022436902, -0.24759911, -0.0125002563, 0.0600456372, -0.2825706005, 0.2127390653, 0.1388473511, -0.0268461555, -0.2350723147, 0.7145009041, 0.0906660706, 0.0234101191, 0.241063118, -0.0689661354, -0.2382347137, -0.0698973835, 0.0650192723, -0.1627770662, -0.326515317, 0.1060187295, -0.0822250545, 0.4988996983, -0.3390575945, 0.0803494751, 0.1533053219, -0.0455193445, -0.0521174967, -0.2859505415, -0.4637409449, 0.2339498103, -0.0310895238, 0.1447181851, -0.2097665668, 0.2193256915, -0.0144757479, 0.2021398693, -0.1464585811, 0.1956729293, 0.0090672821, 0.2211418003, 0.3122570813, 0.1734319627, 0.0412191898, 0.0369425453, -0.0457014851, 0.1359823346, -0.1084391177, -0.0496177524, -0.031395372, 0.2314129174, 0.1327960342, -0.5099072456, 0.3159248829, 0.0068711415, -0.3046576977, 0.0213364959, 0.3179293275, 0.0578482151, 0.2031619251, -0.1624808311, 0.4404973686, -0.0921649039, -0.4527807832, 0.278236717, -0.1194797158, 0.2883818448, -0.0676693991, 0.2628513575, 0.2084854245, -0.1120108142, -0.251708895, -0.2253291905, 0.0856989846, -0.1128219664, 0.4809916615, -0.0277794935, 0.1876186877, 0.2091199905, 0.5395693183, 0.6694285274, -0.05301667, 0.2618055642, 0.4446729422, 0.0809475034, -0.1898658723, 0.1110778376, -0.0003321413, -0.0231846757, 0.0412074327, 0.0932054594, -0.1043453142, -0.2828887105, -0.2034034133, -0.2817725241, 0.1338910758, 0.2542670667, 0.2420216501, 0.7089777589, 0.1716314405, -0.1210034639, 0.0419050232, 0.261554718, 0.1352961808, 0.2326256335, -0.2285068482, 0.1435539275, 0.0493176952, 0.0102535263, 0.0283561684, -0.6977854967, -0.1262257397, 0.3491155505, 0.0734075829, 0.1799185127, -0.1520057619, 0.2228631973, -0.0722616315, -0.0845615193, -0.2514723837, 0.4807581007, 0.2058863044, -0.1214081421, -0.0505667664, -0.220891118, -0.0029636472, 0.4985955954, -0.0006192186, -0.3852562606, 0.364608109, 0.2382332683, -0.0054039322, -0.5793504715, -0.0796300918, 0.1195180416, 0.2672905326, -0.3746911287, 0.1289029568, 0.1669921577, 0.0234024655, 0.200747624, 0.2626672685, 0.0054999338, 0.0036875643, 0.1897206903, 0.1832104623, 0.2477819622, 0.0157305449, -0.0511977822, 0.07284154, 0.2460763454, 0.1826986969, 0.4314573705, -0.0748722553, -0.0686684847, 0.0753032044, -0.1466523558, -0.2283032984, -0.5099493265, 0.0423513651, -0.1217953265, -0.0097376481, -0.1389461011, -0.1062559634, -0.1694819331, 0.0534892194, -0.1733476669, -0.1776189357, 0.0898382142, 0.153576076, -0.0405296348, -0.2815022469, 0.4673686922, 0.3016179204, 0.0266279746, -0.287884295, -0.4712391794, -0.2998328805, -0.0577356294, -0.2856628299, 0.1777129024, 0.045723483, 0.3271951675, -0.1426303685, 0.1498185694, -0.1828512549, 0.0241612978, 0.0304707736, 0.434877038, -0.0860759541, -0.185168907, -0.0583438985, 0.4265656769, -0.1282646507, -0.2810758054, 0.3487746418, -0.0216726027, -0.1689996421, 0.2171525657, 0.1006582379, 0.0364660025, -0.2001007348, 0.085656926, -0.0234423913, 0.3311545253, -0.0020098835, -0.0788418204, 0.0014259443, -0.1774407625, -0.3367549181, 0.1356220841, 0.0134057235, 0.2751173079, 0.2030148208, -0.0970651507, -0.247208178, 0.2357611507, -0.0930081755, -0.1959497631, -0.0243991353, -0.2596938312, -0.127224341, 0.2460623085, 0.1297126263, 0.1128145605, -0.3708874583, -0.2948188782, -0.264823854, -0.200415045, 0.7916324735, -0.2839850187, -0.0090405494, -0.3863784075, 0.2918314338, 0.2459666878, -0.0674035177, -0.3543946743, 0.2752074003, 0.4130685627, -0.3291515112, -0.001619041, 0.2715643048, -0.074129805, -0.0661870316, -0.06462951, 0.3913556635, 0.2036429942, -0.4596036077, -0.1089764982, -0.2307866961 ]
https://github.com/huggingface/datasets/issues/2161
any possibility to download part of large datasets only?
Hi ! Streaming is available on `master` only right now. We'll make a new release 1.9.0 on Monday :)
Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks
19
any possibility to download part of large datasets only? Hi Some of the datasets I need like cc100 are very large, and then I wonder if I can download first X samples of the shuffled/unshuffled data without going through first downloading the whole data then sampling? thanks Hi ! Streaming is available on `master` only right now. We'll make a new release 1.9.0 on Monday :)
[ -0.4722627401, -0.4255562723, -0.1131870523, 0.1344199479, 0.0880464762, 0.1738646775, -0.3542892337, 0.3757151961, -0.050258562, 0.328656137, -0.4129244685, -0.227931425, -0.1485810876, 0.3793707192, 0.2008759081, -0.0660860389, -0.1095423847, 0.2192229927, -0.1483977735, -0.1135962233, 0.016390346, -0.2493555844, -0.2375254631, -0.3178961277, 0.201800406, 0.0277642775, -0.0485127978, -0.2904222906, -0.5257316828, 0.0757005289, 0.1052190363, 0.1233386248, 0.2134259492, 0.1093879789, -0.000115171, -0.3466499448, 0.4168192446, -0.1254800558, -0.0490661636, -0.1248015314, -0.3066554964, 0.1304214895, -0.1911244392, -0.1625906229, 0.0535931438, 0.1501369476, 0.2008935958, 0.0695644617, 0.1805626899, 0.1309278011, 0.1482645571, 0.0635438934, -0.1145857126, -0.0245387834, 0.2895705998, 0.0678122342, -0.0297180414, 0.0065400451, 0.5009750128, 0.3647525311, 0.1164339781, 0.0436581746, 0.0524161756, 0.1226049364, 0.0101256985, -0.3156892657, -0.1707394123, -0.6554218531, 0.3526364565, 0.7226449251, 0.6469689012, 0.1012223214, -0.2085971087, -0.0435764119, 0.1756425202, -0.2512718141, -0.1427430511, 0.6370517015, -0.3258790672, 0.1487769783, -0.5430156589, -0.3155017793, -0.1687670201, 0.3041642606, -0.2599725723, 0.3214054704, -0.000198815, -0.049997773, 0.3603449762, -0.0020154258, 0.2264086455, 0.0228021406, -0.3124680817, 0.2853650749, -0.2960831821, -0.3794877529, -0.3436781764, 0.2594526112, 0.2998426557, 0.0891993493, 0.1823867857, 0.2357151955, 0.080066368, 0.0151363965, 0.5451428294, -0.1076175794, -0.323325783, 0.0730132535, 0.3837716281, 0.0101132654, 0.1688046604, -0.0248713829, -0.0028992221, 0.2587713897, -0.5076771975, -0.0003631413, -0.2615730166, -0.4713283479, 0.15599823, -0.2777477503, 0.1362635791, 0.0707593709, -0.0810320377, 0.10706608, -0.0906698555, 0.2410540283, -0.4281463921, -0.073610872, 0.0975690559, -0.3220903575, -0.1091439426, -0.0105770491, 0.028052792, -0.0787927806, 0.2643789649, -0.5082527995, 0.3371803463, -0.0795178115, 0.3361352384, 0.1806773841, -0.1892698109, -0.1488173902, -0.0888089091, 0.2145670056, 0.1049947292, 0.2417758405, -0.2071611583, 0.5045182705, -0.0368061066, 0.2993343174, -0.1207159758, -0.2835349441, 0.1389858276, 0.1309600323, -0.2674580812, -0.0629856586, -0.3869694471, 0.2854519486, -0.1779267639, 0.0000471324, -0.0142696463, 0.0776571929, -0.0435364842, -0.1150780171, 0.2379498482, -0.1307850927, -0.2373151779, 0.0068901703, -0.1620622724, -0.1714999378, 0.4258077145, 0.3534020782, -0.1707285643, -0.396053344, -0.067400001, -0.1546260715, 0.2148635983, 0.0437491387, -0.5386932492, 0.3985548019, 0.1317854375, -0.2564823925, 0.0821296945, 0.1525526494, 0.6344278455, 0.1193681061, -0.2234909981, 0.5501548052, -0.0589091629, 0.0575009659, -0.0951402858, -0.3214318752, -0.2185793519, 0.1635004878, 0.342495501, 0.4317510128, 0.2950880826, 0.095077619, 0.4195165038, -0.0896088928, 0.2856125832, 0.1713017523, 0.182734549, -0.1341882199, -0.0874415189, -0.3088533282, -0.0879282653, 0.1430228055, 0.1239084303, -0.3638296723, 0.4067091346, -0.1922574043, 0.0884809867, -0.2914106846, 0.4060341716, -0.0655176267, -0.0696877539, -0.1784231812, 0.2960865498, -0.2208674997, -0.3730570972, -0.2006772459, -0.0802235827, 0.0889414176, 0.0760950595, 0.0453675985, 0.2278526127, 0.1880149841, 0.3012547493, -0.3396293819, 0.0182825886, -0.0757410824, 0.032717824, 0.2482905239, -0.0751576573, 0.1401790977, 0.0556409545, 0.0482327044, 0.4031476974, -0.1497118175, -0.0283269547, 0.3423368335, 0.1293027848, -0.0366098136, -0.3519753218, 0.2771187425, -0.2177251577, 0.1233278587, 0.1699347943, -0.0022150874, 0.3464895487, -0.075729005, 0.0770133212, 0.1272964776, 0.3411634266, 0.0372852869, 0.0722670928, -0.1566409916, -0.3699496984, -0.2574923337, 0.0630852729, -0.1521057785, -0.2622962892, 0.1761299372, -0.3542079031, 0.0377749428, 0.143231079, 0.1573666334, 0.0434844978, 0.1828323007, 0.5009163022, -0.0189325307, 0.5529604554, -0.1913039386, 0.0323059447, 0.0135215018, -0.3677518964, 0.0108493632, 0.077674821, -0.3239634335, -0.1185694262, 0.2415391058, 0.2291010022, 0.15484263, 0.1494726539, -0.4640164375, -0.3105861545, -0.5512291193, 0.1515313238, 0.050272923, -0.0246746391, -0.0118748881, 0.0819533914, 0.4645317197, 0.0342575982, -0.1236092299, 0.0287053958, 0.3785223663, -0.1320494711, 0.4409330785, -0.1768301427, -0.0413000956, 0.2356281728, 0.2211539596, 0.0218228251, 0.0270516947, 0.1783607006, 0.0761636347, -0.0646817461, -0.3325955868, -0.0639487356, -0.0094430093, 0.2617273629, -0.1962981224, -0.1334728897, 0.3212755322, -0.066232942, 0.0288739204, -0.2167481035, -0.3117702603, -0.1400716305, -0.0669213235, -0.0051098876, 0.1507522911, -0.1814938337, 0.142814219, -0.4396057129, -0.3790427446, 0.3784819841, 0.2214273512, 0.1600245535, -0.3005809188, -0.1210880727, -0.1877771467, -0.2930062711, -0.4380390048, 0.0462034903, -0.8105817437, 0.3229449391, -0.1686304063, -0.3520538211, 0.1457240582, 0.2076427788, -0.1211160049, 0.4795015454, -0.4310855865, 0.2508366704, -0.1192329079, -0.1019102335, 0.1876684874, -0.0328271948, -0.214714855, -0.6559677124, -0.0396957025, 0.0308427587, 0.2113588303, -0.320450902, 0.3215061426, 0.3877234757, -0.077719152, 0.0027178517, 0.1230208278, 0.6648045182, 0.0610288382, 0.3236868083, 0.0348333642, 0.1735767573, 0.0390225314, -0.0626727194, 0.0875245333, 0.3505370021, -0.0765627027, -0.1801751852, 0.2538128495, 0.0923458561, -0.3871077597, -0.4046891332, -0.0492944457, 0.0556894243, -0.0435905941, -0.1042500287, 0.0307581089, -0.0279366747, 0.1188506335, 0.0599454194, 0.1685610116, -0.312035799, 0.0869186223, 0.07484366, 0.3088530302, 0.007438127, -0.386328876, -0.1485588253, -0.3613514304, 0.063162744, -0.1004731134, 0.0825570971, 0.0680254996, 0.1643627435, 0.2066696733, 0.1446603984, 0.3816035986, -0.0374659188, 0.0500222743, -0.1897474229, -0.2201118171, -0.089511469, 0.0268403292, -0.0417055599, -0.0965521559, 0.3259875476, -0.1407382488, -0.3543404341, 0.2889572382, 0.0056224819, 0.3419517875, -0.0903492123, -0.0451269522, 0.1183283627, -0.0427907892, -0.1847223043, 0.2522401512, -0.2072149962, -0.1632263958, -0.1560112834, -0.1090735942, -0.0318549648, 0.0216321349, -0.0828888565, -0.1000518724, 0.0308271125, 0.0453292392, 0.3428441882, 0.177828908, 0.0819709897, 0.1284078509, 0.4695057273, 0.3658314347, -0.1156460419, 0.0867111087, -0.1306059957, -0.1015805006, 0.2093821764, 0.0437402092, 0.280816108, 0.4085552096, 0.2124497592, -0.031262815, 0.0622297414, -0.294973284, -0.0941513181, -0.5202362537, -0.5601613522, 0.3108981252, 0.0965797007, 0.0867081434, 0.4958633482, -0.3096111119, 0.1638140231, -0.0990546197, -0.1506310701, 0.8891243935, 0.0754092187, -0.006490401, -0.5325065851, -0.0284917727, 0.4200171828, 0.0276413336, 0.1356178671, -0.1975045353, -0.4614284933, -0.1423407197, -0.0167068094, -0.0932060033, 0.0716485232, -0.0662964135, 0.3452251554, 0.0734827369, 0.4262353182, 0.0041125901, 0.0317644775, -0.3003112972, -0.1115792245, 0.2346546501, 0.0693437457, -0.1433303803, 0.3273023665, -0.0557925031, -0.0327081494, 0.0900519788, 0.1534623057, -0.1626333594, 0.1220900863, -0.2919664383, -0.1220971197, -0.4284985065, -0.2095228136, -0.0900096297, -0.1598197371, -0.1767662615, 0.2245779335, -0.3927686214, 0.2770687938, 0.2208955884, 0.0614599399, -0.0097395591, 0.2679327726, -0.3007403612, -0.1530026197, -0.1218153313, 0.3161702752, 0.0162432902, -0.2604295313, -0.1198072061, 0.0095500834, 0.0472751148, 0.2062587887, -0.078736119, 0.0608954281, -0.0678575784, -0.1324035525, 0.084436506, 0.1405862719, -0.2451875508, 0.2926473916, 0.2806531191, -0.2030079067, -0.3127923012, 0.7061339617, 0.2217414081, -0.1477391273, -0.0309075639, -0.0348443463, -0.2691619396, -0.1094613746, 0.0344102383, -0.2847453952, -0.0970423892, -0.0436130799, -0.375463903, 0.2451199889, -0.0366514623, 0.0363684893, 0.0863696784, -0.0098605379, -0.2653487325, -0.309307456, -0.3473719358, 0.1356413364, -0.0308897365, 0.1335929185, -0.1747767627, -0.0131151825, 0.000168696, 0.2695533633, -0.2037924826, 0.269452244, 0.1999199092, 0.2387235314, 0.2172997147, 0.3061387241, -0.1917399168, -0.0193989053, -0.0467093363, 0.2147587538, -0.0651556402, -0.1116473451, 0.0771597922, 0.1865223944, 0.1970794499, -0.3018146753, 0.1085910127, -0.1156172603, -0.2113785595, 0.1027677134, 0.1767235994, -0.0382388569, 0.2515650988, -0.3463001847, 0.591129899, -0.2328621149, -0.4693998098, 0.4542545974, 0.0165074598, 0.097476244, -0.0787198395, 0.3140098155, 0.2915433049, -0.1683988273, -0.1722797751, -0.2812143564, 0.0852770656, -0.1030145586, 0.3749880791, 0.204278782, 0.3214717805, 0.2236577719, 0.3470144272, 0.55429703, 0.1461543441, 0.1856753528, 0.4167735577, 0.1880728006, -0.14973028, -0.1000319198, -0.1143852025, 0.1440719664, -0.0257479176, 0.0018496588, -0.0225777328, -0.3263652325, -0.05154882, -0.2704432607, 0.0888490081, 0.1533001065, 0.179341346, 0.8333562613, 0.1531043202, -0.2371094525, -0.1882932931, 0.206877321, 0.1592475921, 0.3730371594, -0.0479569025, 0.305962652, 0.3063519597, -0.0312644131, 0.0032446161, -0.5970544815, -0.2141679376, 0.4046421647, -0.0142369531, 0.2092539668, 0.0344607346, -0.048159074, -0.0106622111, -0.0931053683, -0.1816471219, 0.2660159767, 0.2127107084, -0.0039872043, -0.1150408238, -0.2785250545, 0.1094973534, 0.5113765001, 0.1322318166, -0.1980446577, 0.2608275414, 0.2490078509, 0.0308738891, -0.2651608586, -0.1359802037, 0.033269573, 0.1771014035, -0.3987109065, -0.1482173204, 0.0234414488, 0.0628862232, 0.4394263923, 0.064420186, -0.1614288986, 0.0587648936, 0.2105540037, 0.0568034388, 0.1634790003, 0.0355563238, -0.1301717311, 0.0776372701, 0.443059504, -0.0092201363, 0.2910926342, 0.0585155636, -0.0959535837, 0.3714146912, -0.2060942501, -0.0672065467, -0.3228957057, -0.1336224824, 0.1930326968, -0.0391326919, -0.0094226021, -0.1811570674, -0.1606292129, 0.1833279729, -0.3444311321, -0.4696622789, 0.1643547416, 0.1820181757, 0.0193005763, -0.2334380001, 0.4481791556, 0.1579573154, 0.010554783, -0.0990977958, -0.4864680171, -0.2503869534, 0.0959642082, -0.1351797581, 0.3514738083, -0.0042080171, 0.2430801094, 0.0163556207, 0.2670605779, -0.123520866, -0.0131922327, -0.0454171523, 0.4119946957, -0.1600765437, -0.0816617608, -0.0142872147, 0.5789080262, -0.1545488238, -0.2790961862, 0.4436948299, -0.1308503002, -0.0096988454, 0.3190700114, -0.0506644472, 0.1381156147, -0.1956160069, 0.1083931327, -0.2287506908, 0.1634791195, -0.1217410043, 0.0967455357, -0.0047982093, -0.1323551536, -0.2796779871, -0.0493526943, 0.2281524241, 0.0808741525, 0.1648786366, 0.0741770715, 0.0168764964, 0.1159248203, -0.1904604137, 0.1538945138, -0.0167449489, -0.504157722, -0.2152561247, 0.094738856, 0.153745681, -0.0536786094, -0.2692043185, -0.5225884914, -0.1821425259, -0.0793168023, 0.5730479956, -0.0971036255, 0.2402117848, -0.4517633319, 0.1212138236, 0.3278098106, 0.1860436499, -0.182570532, 0.1367774308, 0.2774828672, -0.2497421205, 0.2136401385, 0.1351708174, 0.0612911656, -0.113580592, -0.1727845073, 0.0957114324, 0.3469177186, -0.4755299985, -0.2574579716, -0.2557221055 ]
https://github.com/huggingface/datasets/issues/2160
data_args.preprocessing_num_workers almost freezes
Hi. I cannot always reproduce this issue, and on later runs I did not see it so far. Sometimes also I set 8 processes but I see less being showed, is this normal, here only 5 are shown for 8 being set, thanks ``` #3: 11%|███████████████▊ | 172/1583 [00:46<06:21, 3.70ba/s] #4: 9%|█████████████▏ | 143/1583 [00:46<07:46, 3.09ba/s] #7: 6%|█████████ | 98/1583 [00:45<11:34, 2.14ba/s] #5: 8%|███████████▍ | 124/1583 [00:46<09:03, 2.68ba/s] #6: 7%|██████████▏ ```
Hi @lhoestq I am running this code from huggingface transformers https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm.py to speed up tokenization, since I am running on multiple datasets, I am using data_args.preprocessing_num_workers = 4 with opus100 corpus but this moves on till a point and then this freezes almost for sometime during tokenization steps and then this is back again, overall to me taking more time than normal case, I appreciate your advice on how I can use this option properly to speed up. thanks
71
data_args.preprocessing_num_workers almost freezes Hi @lhoestq I am running this code from huggingface transformers https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_mlm.py to speed up tokenization, since I am running on multiple datasets, I am using data_args.preprocessing_num_workers = 4 with opus100 corpus but this moves on till a point and then this freezes almost for sometime during tokenization steps and then this is back again, overall to me taking more time than normal case, I appreciate your advice on how I can use this option properly to speed up. thanks Hi. I cannot always reproduce this issue, and on later runs I did not see it so far. Sometimes also I set 8 processes but I see less being showed, is this normal, here only 5 are shown for 8 being set, thanks ``` #3: 11%|███████████████▊ | 172/1583 [00:46<06:21, 3.70ba/s] #4: 9%|█████████████▏ | 143/1583 [00:46<07:46, 3.09ba/s] #7: 6%|█████████ | 98/1583 [00:45<11:34, 2.14ba/s] #5: 8%|███████████▍ | 124/1583 [00:46<09:03, 2.68ba/s] #6: 7%|██████████▏ ```
[ -0.2514106631, -0.2479188442, -0.166876182, 0.0695672929, 0.1297329664, -0.1807380021, 0.433470875, 0.0990601033, -0.3538163006, 0.2440420389, 0.0638784617, 0.2399454862, 0.0941162184, -0.1330181658, -0.0470906571, 0.1516228169, 0.1583945453, 0.0112237297, -0.1086992174, 0.1517173052, -0.3039165735, 0.2973913252, -0.181871593, -0.1495003551, -0.3720236719, 0.0712003261, 0.1070428789, -0.0386772789, 0.1266264915, -0.3786485195, -0.3722392321, 0.2621737719, -0.1717151999, 0.3977263272, -0.0001282334, 0.0551564768, 0.3310020864, 0.3341305256, -0.0993835628, 0.1854707003, 0.5246140957, -0.3683944941, 0.089279741, 0.0601533204, -0.0127815679, 0.0405190885, -0.0577858388, -0.1024641991, 0.4945959747, -0.0235323682, 0.0106404126, 0.5192907453, -0.1219604164, 0.2335591018, -0.320553869, 0.1153099984, -0.0788033381, 0.117370531, 0.4010336399, 0.1973481178, 0.3235229254, 0.1297676414, -0.1178328469, -0.0455490723, -0.0672250688, 0.2181200087, 0.4664081335, -0.6463075876, 0.2540327311, 0.116922155, -0.0574612729, 0.1287365407, -0.0659623444, -0.2802684009, -0.110962525, -0.5052868724, 0.0478969514, -0.2866013646, -0.0035854504, -0.0845630169, -0.1638436764, -0.0343456566, 0.038055636, 0.0745911598, 0.2919779122, 0.4023822248, -0.2579994202, 0.1412988156, 0.4859222472, 0.0520769395, -0.1439904124, -0.2433382273, 0.1748292595, 0.1739303768, -0.3967977464, 0.0948802605, -0.2360810339, 0.1659681797, -0.1208468676, 0.0911729187, -0.1102677956, 0.5134538412, 0.4665885568, -0.2004276812, -0.1314334869, -0.1684506387, 0.0231272019, -0.3938962519, 0.5149441957, 0.0773055851, 0.0125776455, 0.0659775138, -0.2428989112, -0.5354474187, 0.1613685787, 0.1407511681, 0.0415938795, -0.1196809113, 0.2090466917, 0.0800716132, 0.1907865405, -0.2290400863, 0.3454237878, 0.3752200305, -0.2789568305, 0.1992185563, -0.2575197816, 0.0450638495, -0.5872558951, -0.0557825789, 0.051854413, -0.2311391234, -0.0153393149, 0.1887837648, 0.2071907669, -0.2020411044, 0.1966591328, 0.2144080848, 0.6740505099, -0.4226007462, 0.3631924987, -0.1636648625, -0.0096496344, 0.244736582, -0.072754994, 0.3624319434, 0.0352872126, 0.3586983979, -0.31108886, 0.0150668379, 0.0074111745, -0.2275886536, 0.1634590626, -0.0480352156, -0.032365799, 0.243368119, 0.0056010559, 0.1432507038, 0.5009928942, 0.387571007, 0.0300537553, -0.1195359379, -0.4238317907, 0.0253992975, 0.2834200263, 0.4679893553, 0.5233023763, -0.040248163, -0.036437165, -0.0225381572, 0.7288457751, 0.2094698697, -0.0243386701, -0.0221090131, -0.0677255765, 0.144364357, -0.0810825527, 0.072325781, 0.0567134842, 0.2270413637, -0.2240650952, -0.0860362723, 0.2414157093, 0.072629407, 0.1347097158, -0.0877698511, 0.1700471342, 0.1761256605, 0.282387048, 0.1734233201, -0.2352314889, 0.0146295428, -0.0128332544, 0.0171708837, -0.3240708709, -0.0673825517, -0.5180616975, -0.0416163914, 0.0703363866, 0.0054425015, 0.1118424684, 0.1537815928, -0.0834671035, 0.0560842119, 0.3274908662, 0.0175317377, -0.1221804321, -0.0379404798, -0.319331944, 0.2669688761, 0.0784633011, -0.084226355, 0.032065168, 0.090971157, -0.186754629, -0.0062121684, -0.1380515099, -0.0347193331, 0.1920594722, -0.0670049489, 0.0034459084, -0.0831289515, 0.0475846455, 0.2688088715, -0.2574955523, 0.0044191256, 0.0832875893, -0.1455595791, -0.1100082099, 0.0941950977, 0.0614341162, -0.3610615432, 0.0165604241, 0.2966278195, 0.1466058344, 0.3110165, -0.4479560852, 0.5583022833, 0.2145093232, 0.129058376, 0.0892317817, 0.009279035, 0.0217732564, -0.145104304, 0.433565855, 0.4299765527, -0.2997781634, 0.3906129897, 0.107060805, -0.182105273, -0.0560042262, 0.2489267141, -0.2439724803, -0.0261758715, 0.4540876746, -0.047752101, 0.2301165015, 0.2223646194, -0.1836318523, 0.2125943005, 0.1237350106, 0.0111792013, -0.1703724414, 0.0403766222, -0.0734566003, -0.133479327, -0.2499897778, -0.6115140915, 0.1777781397, -0.0069288723, -0.0365600511, -0.0478603356, 0.0042380802, -0.2061081529, 0.2798289061, 0.4372165799, 0.1867595315, 0.1711969078, -0.1949300617, -0.0732359439, -0.1825197041, -0.129711628, 0.1186936274, 0.1672269553, -0.1895807981, 0.136636287, -0.2387170494, 0.2938966155, -0.1662996709, -0.1849085093, -0.4397238195, -0.0257228017, -0.1499883831, 0.0983162075, 0.0103323311, 0.1029524133, 0.0242333561, 0.088198334, -0.1002232879, 0.0622532442, -0.1612758636, 0.0371610224, -0.0491185226, -0.245303914, 0.2989144623, 0.1687111706, -0.0080342069, 0.1353290379, -0.3070050478, -0.0110724624, -0.2749913335, 0.1400468349, 0.1708559096, 0.3440095782, -0.0735172182, 0.1897303015, 0.0009127781, 0.0276051089, 0.1006859466, -0.1594693661, -0.0642060041, 0.0215206072, -0.1502988935, -0.1248287708, -0.132084161, 0.0152244624, -0.2438075095, -0.1898181736, 0.1589919031, -0.0782170445, -0.0424330272, 0.1317870021, -0.0138680227, 0.1339339316, 0.2590214014, 0.145291701, -0.1662137806, -0.0018486902, 0.3186673224, -0.1028507426, -0.1215233654, -0.3235511184, -0.1072705388, 0.1314612329, -0.2445207685, -0.0609119199, -0.0151931643, -0.5067571402, -0.2423239648, -0.1723923385, 0.0972390845, 0.4248438776, -0.0066829696, -0.0099412613, 0.1922747046, -0.2269100845, 0.2570294738, -0.0619240925, -0.3097361028, 0.139639914, 0.4708047807, -0.2967548966, 0.674112916, 0.074965626, -0.1954609603, 0.0505690835, 0.0368691534, -0.1507929415, -0.0553349741, -0.0852849334, 0.1318521351, 0.2249399573, -0.0552710667, 0.3454124331, -0.1059585512, 0.0814156756, 0.1267298758, -0.0824176148, 0.017004177, -0.3068866432, 0.3244257867, 0.1441498995, 0.402965188, -0.0234132409, 0.1108588725, -0.0862730891, -0.401660502, -0.096236676, 0.1196677834, 0.2414514571, -0.1695469916, -0.6161900163, 0.0137220956, -0.7858526111, 0.3828300834, -0.0458907709, 0.5199119449, 0.1082279533, 0.0056621656, 0.3145134449, -0.3467055559, 0.7670843005, 0.1822903156, -0.1279039532, 0.0962368995, -0.7098241448, -0.0582466125, 0.0075299814, -0.0926197246, 0.2724968493, 0.3566781282, 0.7060554028, -0.301721096, -0.3776784837, -0.0767092556, 0.0563512892, 0.0015052184, -0.4166151881, -0.4019545913, 0.050190255, -0.286370337, 0.5134525895, 0.090658322, 0.1405476928, -0.2109409273, -0.0332366489, 0.1202218235, -0.2873512506, 0.4236610234, 0.2079536319, -0.0913096964, -0.02370218, 0.380682379, 0.4786853492, -0.2290196419, 0.1489963979, -0.1707219332, -0.0779559016, -0.2364804149, 0.3810602427, -0.0867981836, 0.5450718999, 0.5472583771, 0.1362942308, 0.4063147902, 0.3780593872, 0.4374061227, -0.2749789655, 0.1259635687, 0.154768005, 0.5308864713, -0.4130478799, -0.0818809271, 0.1402873695, 0.2081383318, -0.0229313523, 0.0561509244, -0.1762444675, -0.0634084865, 0.2071319669, 0.3916882575, 1.1319557428, -0.3283146322, 0.1856962442, -0.4327250421, -0.0603082664, 0.5704901218, -0.3324202299, 0.2379962951, -0.3656906486, -0.2717865109, 0.1850219071, -0.3282358646, 0.3038598299, 0.1189041808, -0.2628194094, 0.1521396339, -0.3306326866, 0.0432284325, -0.4142539501, 0.3191809952, 0.0404130518, -0.6195268631, -0.0495097265, -0.028282512, 0.073361069, 0.2955292165, -0.1056539789, 0.083587423, 0.0109437183, 0.0497662425, 0.0896118134, -0.1360660493, -0.1693647504, -0.0388215482, 0.5821492076, 0.0324062854, 0.3180071712, -0.0777361169, 0.5598854423, 0.2434164584, 0.0780925006, -0.0341115892, -0.1588767022, -0.1468062997, -0.0515879765, -0.0682884604, 0.0123430882, -0.2124676704, 0.0511398911, -0.2381155342, 0.0821540356, 0.0058848783, -0.1636521518, 0.0166179426, 0.0232438482, 0.0467577502, -0.1821015924, 0.3080949485, -0.3214457929, -0.1167134047, -0.0423150435, 0.2404102087, -0.4403894246, 0.3303354383, -0.0288398936, -0.1738936901, -0.1171052009, 0.0892917663, -0.0264957212, -0.4030744135, 0.6092653871, 0.2181997001, -0.2666136026, -0.0854159296, -0.2937757671, -0.1068667173, -0.3492943645, 0.3741158247, 0.3237867951, -0.2295301706, -0.0780585557, -0.1987000853, -0.3508918583, -0.118224293, -0.3102804422, -0.2950766683, -0.4665009081, -0.3801028728, 0.0411477089, 0.1233234406, -0.047161106, 0.2644369602, -0.3896648884, 0.0624551326, -0.0785793588, -0.1725251377, -0.4062481225, 0.0899815634, -0.1120748147, -0.5190099478, -0.0281905066, 0.1142887473, -0.0714790821, 0.4420265853, -0.1587404162, -0.0638981313, -0.2271939814, 0.2349816561, -0.2800929844, -0.4436422288, 0.3615062833, 0.3001596332, -0.2331468612, -0.2703568339, -0.1595396101, -0.1643768549, -0.1993989795, -0.5072795153, 0.3599960804, 0.1198561713, 0.019919388, 0.191434592, -0.0674526244, -0.0008587018, 0.1864866018, 0.3077498674, 0.0294047743, -0.0558886081, -0.0084524006, 0.0732792243, 0.6394943595, -0.3363310099, 0.0188851431, 0.0433635451, -0.1731338501, 0.1465683579, -0.0477736816, 0.5118206143, 0.1813319921, -0.2633013725, 0.3250019252, -0.0217072722, 0.018075265, -0.0700406134, 0.1865512282, -0.0227420703, -0.0238567218, 0.4588426948, 0.3922022581, 0.2405368537, 0.1528816521, 0.2555945814, 0.1636408269, -0.3829545081, -0.107864365, -0.1812136471, -0.0154027864, 0.2450421005, 0.4365411401, 0.0375350378, 0.1505813599, -0.1797696948, 0.1335870922, 0.250767678, 0.2416340858, 0.4925801754, -0.1382800937, -0.2254938483, -0.417455554, 0.5522566438, -0.0057642758, 0.3790931404, -0.0028130785, 0.3359467983, -0.0554625876, -0.0098858103, -0.1745776534, 0.5061411262, -0.1261601895, -0.4475289881, 0.1426979005, 0.1112097949, -0.2979700565, 0.0771853849, 0.1318656206, 0.0256805196, -0.0423035994, 0.1080412269, 0.0119535513, -0.1828672886, -0.2537566125, -0.1672246903, 0.2278693616, -0.0983468518, 0.012512546, 0.0452597365, 0.0097421175, -0.0199357793, -0.0247961227, 0.5128126144, 0.2004427463, -0.1537483037, 0.0811638385, -0.1068248972, 0.3018489778, -0.151309073, 0.4270676374, 0.0419004597, 0.3001243472, -0.10478203, -0.2305850387, -0.1540284008, -0.5271898508, -0.0419681855, -0.0431492068, 0.0332792364, 0.2451079488, 0.1459528804, -0.1756978631, -0.2253250182, 0.1532505453, -0.2153149247, -0.061436981, 0.3286036253, -0.3338750601, -0.1148735583, -0.0067681484, -0.0201614667, -0.1126107275, 0.6130874157, -0.0589853637, 0.3415983617, -0.1647950411, -0.1436436474, -0.3964852393, -0.1860510111, 0.2374785542, 0.3587351441, 0.1647127867, -0.1060243994, 0.086748302, 0.0671767741, -0.0712866485, -0.3454672992, -0.0114505067, 0.3094777465, -0.3384151757, 0.3538841307, -0.4342475533, 0.0272095706, 0.1970864683, -0.1175381467, 0.2873231769, 0.1683011651, -0.1999628246, -0.3245334327, 0.0758441687, -0.2453704178, 0.2596357763, 0.0963906795, 0.3184598982, 0.1464158744, -0.0157888681, -0.0109736286, 0.0959524885, 0.2608547807, -0.0697438046, 0.0721200854, 0.1049500406, -0.1648035645, -0.1467457116, -0.1313745528, -0.2452244312, 0.056750685, -0.0118053854, -0.1745484769, -0.0568413809, 0.0469131395, -0.0768706426, 0.2094799578, 0.1592630744, 0.4812908769, 0.2651977539, -0.0506089851, -0.3223831654, -0.0804887414, 0.4254728556, -0.2499648035, -0.3929425478, -0.6206634045, 0.1766658574, 0.0027142446, 0.1121187955, -0.2380705774, -0.1182985455, 0.0157112479, -0.1303829104, -0.2840650082, 0.450607866, -0.1115772873, -0.2529273033, -0.2448706478, 0.1594264954, 0.1453015804, 0.1756259948, -0.1135019362, -0.2562186122 ]
https://github.com/huggingface/datasets/issues/2158
viewer "fake_news_english" error
Thanks for reporting ! The viewer doesn't have all the dependencies of the datasets. We may add openpyxl to be able to show this dataset properly
When I visit the [Huggingface - viewer](https://huggingface.co./datasets/viewer/) web site, under the dataset "fake_news_english" I've got this error: > ImportError: To be able to use this dataset, you need to install the following dependencies['openpyxl'] using 'pip install # noqa: requires this pandas optional dependency for reading xlsx files' for instance' as well as the error Traceback.
26
viewer "fake_news_english" error When I visit the [Huggingface - viewer](https://huggingface.co./datasets/viewer/) web site, under the dataset "fake_news_english" I've got this error: > ImportError: To be able to use this dataset, you need to install the following dependencies['openpyxl'] using 'pip install # noqa: requires this pandas optional dependency for reading xlsx files' for instance' as well as the error Traceback. Thanks for reporting ! The viewer doesn't have all the dependencies of the datasets. We may add openpyxl to be able to show this dataset properly
[ -0.1493435353, -0.1812811792, 0.033643242, 0.3416324258, 0.2343089283, 0.2863435447, -0.0157951266, 0.2244074047, 0.165427953, 0.0734670833, -0.2225703299, -0.125951156, -0.0306419116, 0.3286094666, -0.0807030797, -0.2097444832, 0.2249315977, 0.1918754876, -0.0383199379, -0.215414837, -0.1752157062, 0.2497070134, -0.2327593863, 0.0332999192, -0.1657816321, -0.0056501506, 0.0485555455, -0.109509781, -0.2481060326, -0.2244537771, 0.257348299, -0.0757725462, 0.0078950375, 0.4936807752, -0.0001168755, 0.0112853646, 0.2621286213, 0.0009632185, -0.0758978277, -0.1726917326, 0.1580377221, -0.5534414649, 0.25923118, 0.0051353127, -0.1263033897, -0.6198987961, 0.1344302893, -0.0443130657, 0.4444803894, 0.4118566215, 0.2116182297, 0.4163541198, 0.4214430749, 0.0597533919, -0.1707165539, 0.0774001181, -0.0333690532, 0.2485252917, -0.1120400578, 0.2506462336, 0.046439033, 0.358751893, -0.0722560659, -0.1672137082, -0.1182158887, -0.2060661316, -0.0668230429, -0.3877578974, 0.065018788, 0.2956515253, 0.2338841408, -0.1602154076, -0.1942187548, -0.1710207015, -0.0075114109, 0.1529851258, 0.2340551913, 0.3493385315, 0.0310774073, 0.2444140613, 0.0891733915, -0.3955402076, -0.0207315683, 0.1518012583, -0.2865381241, 0.2711386383, -0.2161861509, 0.1463052034, 0.285015434, -0.1231928989, 0.1981235892, -0.0080021154, -0.0066177398, 0.168779403, -0.1542186737, 0.0125710964, 0.0683277547, 0.4823486209, -0.1209614202, -0.4073602557, -0.4050123394, 0.0087041669, -0.224173218, 0.2380545437, 0.0841648728, 0.0210720375, -0.0141958781, 0.2033030987, 0.1795813739, 0.3211090565, 0.1527703404, 0.067923978, 0.008303009, -0.2380101979, -0.4805678725, -0.3320236802, 0.312184006, -0.2570631504, -0.3029875755, 0.2578766048, -0.0671017468, -0.0249174554, 0.0111848116, 0.1829613447, -0.155382216, 0.4950963557, 0.2343165874, 0.1126603633, -0.2211112976, -0.4079147577, -0.1736009717, 0.2763748169, 0.0510919243, -0.1620612442, -0.0328077041, -0.6860467196, 0.259198159, 0.1957402974, 0.1480440199, 0.0476570427, -0.1888782382, -0.0919520557, -0.2200556099, 0.3047617078, 0.1786775291, 0.1318139732, 0.553268671, -0.3143088818, -0.1588374823, 0.0255603734, -0.0247134976, -0.1193818152, -0.3907496929, 0.1378651112, -0.3698265254, -0.0951169208, 0.1383287609, 0.195248425, -0.292111963, -0.2234256417, -0.1163563877, 0.0132629462, -0.0202201307, 0.0533876568, 0.0504158661, 0.5927079916, -0.4545463622, -0.3469181359, 0.0944005698, -0.2169102281, 0.0935405269, 0.1010095552, -0.012033321, -0.06689924, -0.1673158407, -0.3382662833, 0.2603877187, -0.4653257728, -0.2659333944, 0.34731552, 0.0669156164, 0.2950734794, 0.1359107643, -0.1164167449, -0.2745511532, 0.234512344, -0.4540860653, 0.0552113242, 0.0520401001, -0.0751474723, -0.2216024101, -0.2808431387, 0.2575273514, 0.3178928196, 0.1873326004, 0.0692961663, -0.0543507747, -0.1554219425, 0.2374704778, 0.1147571057, 0.0038582385, 0.103856653, 0.1040420532, 0.3543668389, 0.0540340617, 0.0027964041, 0.0732587129, -0.0716021061, -0.0064709559, 0.2905815244, -0.1062058806, -0.2331239432, -0.3494344056, 0.0760540292, -0.1288510859, -0.3132872283, 0.0632412434, 0.141192168, -0.0140752494, 0.5048754215, -0.1575292498, 0.2717457414, -0.1571385264, 0.1240421832, -0.575268507, 0.1061154306, -0.2694676518, 0.1400140524, 0.1747434139, 0.0970167369, -0.0346791036, -0.0112215579, 0.0091679804, 0.191655308, -0.1517484784, 0.2544413805, 0.1007499993, 0.0872532278, 0.250277102, -0.4632275999, 0.19770585, 0.1617234647, 0.1071818024, 0.1465787292, -0.0417565815, 0.1484863758, 0.0535474047, 0.0759228021, -0.0791272447, 0.4016433954, 0.3749582469, 0.259193778, -0.0877760202, -0.3721303344, 0.4974477589, -0.1468613446, 0.377592206, -0.1414719373, -0.2833203077, -0.0737212896, 0.1207566112, 0.0512169302, 0.1060099974, 0.2926082313, -0.23280406, 0.1253170967, 0.2561500072, -0.0175859332, 0.1818635762, 0.0954408944, -0.1969888061, 0.2725210786, 0.0246930867, -0.2398646325, 0.1188210919, 0.0407808945, -0.1291141957, -0.0179603174, -0.1501006186, -0.0485611595, -0.5117400289, 0.1247874945, 0.0088857859, 0.2497186661, -0.3337168097, 0.0810151622, -0.1943713278, -0.3811689615, -0.2097661942, -0.409961313, -0.2709549367, -0.4224149585, -0.0119394129, 0.1051781848, -0.0280015618, 0.3039633632, -0.0188560002, 0.1006589606, -0.0498097837, 0.0785679966, -0.2276709527, -0.1652929783, -0.0761511549, 0.1163731292, 0.1672727764, 0.0746081397, 0.1345999092, -0.5980011821, 0.1774815023, -0.4021347761, -0.3951078653, 0.1637865305, -0.3234316409, 0.4101298749, 0.2941057682, 0.1234953031, -0.067427054, -0.087737754, 0.250264883, -0.1842279136, 0.1840976775, 0.0396198332, -0.1432319731, -0.1686982363, 0.0873316303, -0.14143911, -0.2506595254, -0.3166327775, 0.2217579782, 0.1017181948, 0.109829843, -0.0413942784, 0.195997417, 0.2456975281, -0.0987518728, 0.236141026, -0.2863525152, -0.5247051716, 0.378311038, -0.156801194, -0.3085818291, 0.2651652694, 0.0860079676, 0.1951527894, -0.4093190134, -0.7332420349, -0.2308117747, -0.1923143119, -0.04156534, 0.0334822983, 0.1754433811, 0.1946000904, 0.0358057059, 0.0847484767, -0.0624022335, -0.0508443713, -0.2867296338, -0.3271096051, 0.0163104795, -0.0000911448, 0.5346375108, -0.0564331003, 0.259688437, 0.4661248922, 0.1804060638, 0.3968826532, 0.1061623096, 0.7885670066, 0.0033061095, -0.4935969412, -0.0231898054, 0.1583245397, 0.2208786011, 0.3041402996, -0.0754184574, 0.2468591332, -0.5103857517, -0.3159962893, -0.327647835, -0.1706672311, -0.2363377362, -0.1083348989, 0.2060177028, 0.0129451379, 0.046730727, 0.0787630677, -0.1366555542, 0.107770443, 0.3479907215, 0.0770940781, 0.0365454666, -0.0738064125, -0.0912138671, -0.4185931683, 0.3242531717, -0.2333336771, 0.2012437433, -0.0008867532, 0.1214456558, 0.1684391797, 0.0369146019, 0.7025107145, 0.0302967858, -0.3258076608, -0.0525399446, -0.1223505288, -0.6611139774, 0.1079373285, -0.2527155876, -0.1881040335, 0.0247110799, 0.0034358595, -0.2656267583, -0.1243871897, 0.4412813187, 0.0804681033, -0.2095835209, -0.2385823429, -0.2916268408, -0.2214306295, -0.3525425792, -0.0845476761, -0.0090306997, 0.0804271102, -0.0301804245, 0.4483973384, -0.0971266776, -0.0236032195, 0.3017001748, 0.0508199558, 0.008144021, 0.0206428394, 0.0002470911, 0.4754728675, 0.1500504315, -0.0532305278, 0.7757800817, -0.0631161034, -0.7709523439, -0.0753828436, 0.0536331423, 0.0531326197, 0.3070096672, -0.1265823543, 0.0274936985, 0.2437782884, 0.1017826796, -0.2109921426, 0.1763732731, 0.3813944757, 0.2676439881, -0.1815089583, -0.2140792012, 0.3380758762, 0.1158888713, 0.1463098675, 0.184901312, 0.5283315182, -0.0841909125, 0.2648409307, -0.0969957784, 0.9988301992, 0.1961120516, 0.2482182682, 0.4241091609, -0.2455763966, 0.4833486378, -0.0700267851, -0.0292955004, -0.1444131583, -0.3055579662, -0.2449560165, 0.0516550541, 0.4823301435, -0.2462416291, -0.3096330464, 0.3389143944, -0.120904617, -0.0700884014, 0.1229673102, 0.157432735, -0.3809258342, -0.0709056556, -0.3266379535, 0.1354925632, 0.0377957746, 0.3158828914, -0.169290036, 0.1198322177, 0.0187711343, -0.1505930126, -0.2882559896, 0.051995784, 0.0278501064, 0.0180971697, 0.0684049577, -0.0966804624, 0.2472613454, 0.5656710267, 0.3669229448, 0.1865283102, -0.4858180285, 0.1671656519, -0.045915693, -0.444152534, 0.1770739853, 0.2046081871, 0.3137394488, -0.0114797205, -0.2831757665, 0.3268387616, -0.1206450015, 0.2323898077, -0.1977333128, -0.0111094527, -0.0575116798, -0.3667596877, -0.3333868682, -0.177124843, 0.0570145696, -0.1836522073, 0.1110577285, 0.0103434576, -0.1201194227, -0.0232843682, -0.0562227629, -0.1417722106, -0.2431451082, 0.1959314644, 0.0323251039, 0.0144019723, 0.2819172144, 0.2788677812, -0.3665271401, -0.116904743, 0.1877420247, 0.0454839133, -0.3456625938, -0.1701561362, 0.2914134264, -0.160687089, -0.2383994162, 0.0027349684, 0.1746842265, -0.0411228836, 0.0126879662, -0.3946432769, -0.0076745152, 0.1925795227, 0.103807494, -0.1245339215, 0.1717467308, 0.2776168287, 0.1337160468, 0.1878316551, -0.2733458579, 0.3751010299, -0.164579004, -0.0308968592, 0.1304589808, 0.2312325239, 0.3228491843, -0.1181521714, 0.0373162627, 0.1187984049, -0.1167221665, -0.1287345141, -0.1502197534, 0.125033915, 0.2712996006, -0.4052728117, 0.254858017, 0.0848727822, -0.2070201188, -0.0313602723, -0.1952663213, 0.3474895358, -0.0754379034, 0.1337974817, 0.0290040914, 0.0485040992, -0.0916019306, -0.075481616, -0.0463013649, 0.1908141375, 0.0429236256, -0.0622407831, 0.0316440985, 0.0093683377, 0.0889627784, 0.2149965465, 0.2068995386, 0.0593178086, 0.3137522936, -0.1371272653, 0.1256196052, 0.161172986, 0.4621784985, 0.2891744971, -0.4220871329, 0.149494946, 0.4947496653, 0.0427788571, -0.5449191928, 0.0137341432, 0.2964153588, -0.0359673351, 0.0966338292, 0.0143323652, 0.1898612231, 0.0388371497, 0.1929151714, 0.1015239358, 0.1329613477, -0.0326303542, 0.3157618642, 0.281804204, -0.1478826106, 0.1104032248, 0.2457273751, 0.166468963, -0.0167653486, 0.2051961273, -0.3525442183, 0.0279042553, -0.2922763228, 0.0825240836, -0.0355524123, -0.1481752694, 0.2657368183, 0.0649833679, -0.1496375948, -0.0404279605, -0.1202601194, 0.4565223157, -0.205438897, 0.0748907328, -0.2444637418, 0.3438743651, 0.0049215788, 0.025891237, 0.2523991168, -0.1254978478, -0.2077853531, 0.0125956088, 0.1929334998, -0.5256755352, -0.062693581, 0.0837931931, -0.1748889387, -0.409330368, -0.0262108445, 0.0982758552, 0.162449047, -0.0706344023, 0.1652641594, 0.303376019, 0.0084780036, 0.1473622471, 0.6045828462, 0.4527470469, 0.0702113733, 0.1158503145, 0.1578056812, -0.1719761789, -0.0460991524, 0.0782891214, 0.2830425501, -0.0351978764, 0.2945495844, 0.3073826134, 0.1182830557, -0.2352013439, -0.1192609444, -0.0033583045, 0.2711735368, -0.5004980564, 0.1815779954, -0.4764454365, 0.1020690054, -0.3031998873, -0.1503985077, -0.5871674418, 0.2847020328, 0.2014154494, -0.1557388157, -0.0761077777, -0.3292550743, 0.0349971838, 0.1634239405, 0.4378173053, 0.483725369, 0.3563599586, -0.2145858109, -0.375963062, -0.6806297302, 0.2766780853, -0.0359325856, -0.1828468889, -0.0877019167, -0.242352441, 0.0795428231, 0.290181011, -0.1649817824, 0.2002101541, -0.1299870759, -0.1870605946, -0.1312100142, -0.0886714086, -0.0190626569, 0.1277427077, -0.0501924455, 0.0209719539, 0.2831500769, -0.0812907442, 0.0103785321, 0.0650069863, 0.1038183048, -0.349129796, -0.2601622343, 0.141842261, 0.3700291812, 0.3323681056, -0.1182964295, -0.0788227022, 0.0622204579, -0.2541968524, -0.405244112, 0.4564961791, 0.0300649926, 0.1583376676, -0.3010481298, -0.5846757889, -0.0435883291, 0.3900035024, 0.1314128786, 0.1165825129, -0.426474154, 0.1334365606, -0.0666233227, 0.0021297187, 0.197408542, 0.2926413715, -0.0800684094, 0.2034486234, -0.1025536731, -0.1717098653, 0.4758616984, -0.2589902282, 0.0350630134, 0.0025698468, -0.0480374843, 0.2377600819, -0.4223095775, -0.6009993553, 0.2271062732, 0.125110209, 0.1089571118, -0.001215741, 0.136253193, -0.2136978507, -0.0375878736, -0.0279386938, 0.3252093494, 0.371755898, -0.157543838, 0.3425121903, -0.0167050622 ]
https://github.com/huggingface/datasets/issues/2153
load_dataset ignoring features
Nice question which helped me a lot! I have wasted a lot of time to the `DatasetDict` creation from a csv file. Hope the document of this module add some simple examples.
First of all, I'm sorry if it is a repeated issue or the changes are already in master, I searched and I didn't find anything. I'm using datasets 1.5.0 ![image](https://user-images.githubusercontent.com/37592763/113114369-8f376580-920b-11eb-900d-94365b59f04b.png) As you can see, when I load the dataset, the ClassLabels are ignored, I have to cast the dataset in order to make it work. Code to reproduce: ```python import datasets data_location = "/data/prueba_multiclase" features = datasets.Features( {"texto": datasets.Value("string"), "label": datasets.features.ClassLabel(names=["false", "true"])} ) dataset = datasets.load_dataset( "csv", data_files=data_location, delimiter="\t", features=features ) ``` Dataset I used: [prueba_multiclase.zip](https://github.com/huggingface/datasets/files/6235022/prueba_multiclase.zip) (it has to be unzipped) Thank you! ❤️
32
load_dataset ignoring features First of all, I'm sorry if it is a repeated issue or the changes are already in master, I searched and I didn't find anything. I'm using datasets 1.5.0 ![image](https://user-images.githubusercontent.com/37592763/113114369-8f376580-920b-11eb-900d-94365b59f04b.png) As you can see, when I load the dataset, the ClassLabels are ignored, I have to cast the dataset in order to make it work. Code to reproduce: ```python import datasets data_location = "/data/prueba_multiclase" features = datasets.Features( {"texto": datasets.Value("string"), "label": datasets.features.ClassLabel(names=["false", "true"])} ) dataset = datasets.load_dataset( "csv", data_files=data_location, delimiter="\t", features=features ) ``` Dataset I used: [prueba_multiclase.zip](https://github.com/huggingface/datasets/files/6235022/prueba_multiclase.zip) (it has to be unzipped) Thank you! ❤️ Nice question which helped me a lot! I have wasted a lot of time to the `DatasetDict` creation from a csv file. Hope the document of this module add some simple examples.
[ -0.0856144428, -0.0304918587, 0.0129401386, 0.2842153609, 0.4256821275, 0.2531651855, 0.6406398416, -0.0539472215, 0.2234636247, 0.0533242263, 0.1543197632, 0.3363249302, -0.1144231707, 0.4599346817, -0.151914075, -0.0312217213, 0.0632834956, 0.1389201581, 0.0868093818, -0.1416217387, -0.3790288568, 0.0661418661, -0.3810799122, -0.074804008, -0.1995218843, 0.2117883563, 0.0234552324, 0.0719205737, -0.0297585577, -0.5245153308, 0.4133906066, 0.2789029777, 0.3400851786, 0.2516960502, -0.0001132447, -0.0907420069, 0.0439932756, -0.1335794628, -0.1930739731, -0.1258174181, -0.4377949536, -0.3049482107, 0.2935543358, -0.3018358648, -0.3062901199, 0.170705691, -0.2648933232, -0.2134490907, -0.0529292636, 0.1210678071, 0.1923326701, 0.0092527047, -0.08710365, 0.1758140922, 0.0143903205, -0.0617422312, -0.3258312345, 0.2043391466, 0.1856565773, 0.2550997138, -0.0153447501, 0.2552686036, -0.2143632323, 0.0363500603, 0.5101964474, -0.1277290136, -0.0145434365, -0.3282906115, 0.0238243043, 0.1738417447, 0.7974795103, -0.2552066445, -0.4845222831, -0.2741532028, 0.136313349, -0.4022527039, 0.1647412777, 0.0906632915, 0.2678411901, 0.1801912636, -0.4022528827, -0.0693215802, -0.114445284, 0.0422428846, 0.0313484818, -0.0237453766, -0.1550962627, 0.1390871108, -0.1776060313, -0.0167389717, 0.3612680435, -0.2586156428, -0.0753733218, 0.2356112152, -0.2841075063, 0.1693635881, 0.0916747302, 0.1357545853, 0.0742881894, 0.1346579641, 0.019579798, 0.2739372253, -0.3180240691, 0.1293335855, 0.1421795785, -0.0020367801, 0.5196122527, 0.1570585668, 0.1980422735, 0.0485061631, -0.2741856575, 0.064961046, -0.1562922746, -0.0674709156, 0.2910916805, 0.04481088, 0.1363647729, -0.3723417521, -0.1389971972, 0.0318643376, -0.1400592774, -0.0162491165, 0.1177361757, 0.2474848032, 0.0247121379, 0.4246523678, 0.2354549468, 0.2400788963, -0.2873141766, -0.3280517459, -0.230176419, -0.1649017036, -0.0516047291, 0.0536996722, 0.4024193883, 0.1722322404, 0.1889072657, -0.093554154, -0.1197240353, -0.1503176987, -0.1773235053, 0.0644036084, -0.0126007125, 0.2159597129, -0.1039226651, 0.1599552929, 0.1865859032, -0.2099938393, 0.0202710032, 0.1871028244, -0.2052907199, -0.0912486315, 0.1930450648, 0.1692914814, -0.3488230705, -0.099219583, -0.4686617851, 0.1708806306, -0.0383037739, -0.0585591123, -0.0010499991, -0.476266861, -0.0743919462, -0.2339222282, 0.3303195238, 0.480104506, -0.4956293106, -0.1252070963, 0.3033343554, -0.1631097347, -0.0423819423, -0.1286757886, -0.0879170001, 0.1719543338, -0.0955555812, -0.3004547358, 0.2273968607, -0.1882334352, -0.3485091329, -0.1945337951, 0.098105669, 0.0058670044, 0.1647297293, 0.3072192073, -0.0137544721, 0.0016858019, -0.0981526971, 0.4130122364, 0.0815082937, -0.0161895677, -0.1648075283, -0.0039025471, 0.0153040569, 0.327522099, -0.0128154159, 0.2236019075, 0.1535401046, 0.0070143826, 0.1234480888, -0.2657750547, 0.241710335, 0.3734298646, 0.0262519028, 0.2091941088, 0.0803007632, -0.099613905, -0.4244222045, 0.3336116672, 0.196946919, -0.0301369503, 0.0143268704, -0.1335235834, 0.0164889246, -0.0420470722, -0.599829495, -0.0444379374, 0.0043737255, 0.108143732, -0.1282562464, -0.0561454818, -0.0211242214, 0.2936034203, -0.2329746783, 0.2568302751, -0.3175533414, 0.0984744802, 0.1104401499, -0.0933686644, -0.1049848869, 0.2762142122, 0.3593248129, -0.2134836912, -0.1395705938, 0.2520536184, 0.2794738412, -0.2395741343, -0.0033482667, 0.050388895, 0.1536210924, -0.3865433931, 0.030377863, 0.0651876628, 0.2595445216, -0.1391368508, -0.4149835408, 0.4254064858, -0.1629066765, 0.1436122358, 0.0709132552, -0.075983867, 0.3986668587, -0.0515847988, -0.1249038354, -0.0875486732, 0.0120537691, -0.0065014549, 0.2523192167, 0.2596166134, -0.4297819138, 0.1778015792, 0.3382622004, 0.0230806619, -0.0686439425, -0.0502457768, -0.1778648496, 0.084893316, 0.2156614661, 0.0609677285, 0.2490083575, 0.2434665859, -0.0681900308, 0.0026713312, -0.0539203919, -0.0883626342, 0.2646459341, -0.0272722021, -0.0585923344, -0.0459217504, 0.1281882674, 0.0731413215, -0.2991204262, -0.156928122, 0.0864326134, -0.0542882867, -0.5587558746, -0.0162466243, -0.1895411313, 0.0446089953, -0.1800445616, -0.1181470305, -0.2130715549, -0.2718035281, -0.1732322872, 0.3825282753, 0.0305419564, 0.0627365485, -0.4193843007, 0.1077655256, 0.0894378051, -0.541277349, 0.2205041647, 0.135554269, -0.4152528346, -0.0298728533, -0.1084802002, 0.2368006706, 0.2161875367, -0.1324636042, 0.1083874404, -0.2184616625, -0.2653663158, 0.038786184, -0.2468206286, 0.0459494963, 0.0089158975, -0.067990154, -0.0551453084, 0.1420688033, 0.3785452843, 0.0763232931, 0.0598122403, 0.2437892854, 0.207072407, -0.2385053486, -0.2769644856, -0.5045168996, -0.1614888012, -0.3960846961, 0.0413758606, 0.0946874693, -0.2516451776, 0.1389067918, 0.0573675148, 0.1830509603, 0.2809786797, 0.1540102661, -0.0310245994, -0.2355820537, 0.3494182825, -0.1501150131, -0.2869128883, 0.111715436, -0.0587877817, -0.0539901592, 0.0010022074, -0.3663876355, 0.088975504, -0.0896048471, 0.3901564181, 0.2198276073, 0.1605476141, 0.3285787404, 0.2460653186, 0.1037362069, -0.2389996946, -0.3663346171, 0.0832588598, -0.0620272085, 0.1914422512, -0.0777528137, 0.1106809229, -0.2450101674, 0.3476116955, -0.0138872676, 0.0028704642, 0.4750260413, -0.0642101169, 0.2776759565, -0.1557677239, -0.2877365351, 0.0507535525, -0.2303258181, 0.0119079202, 0.2468533814, 0.1611821651, 0.0501922667, -0.2115147859, 0.2637025416, -0.2098138183, -0.1581946611, -0.1451287717, -0.1216769889, 0.1039790511, 0.0837810487, 0.2170708627, -0.1675317585, -0.1631675065, -0.2661850154, 0.2213692367, -0.0045869276, 0.0102269128, -0.5514546037, -0.1828895211, -0.0553385764, 0.0938137472, -0.058030989, 0.1872236729, 0.0261193514, 0.0560865775, 0.0933769569, 0.1057455391, 0.573402226, -0.3399972022, 0.2928527892, 0.3923079967, 0.1141812578, -0.2291166484, -0.2148535848, -0.1900696456, -0.1029029712, -0.0881074592, 0.0920740366, -0.104928717, -0.2605797648, 0.1314918995, 0.4926408231, -0.2059617937, -0.061534442, -0.2721275687, -0.1646259725, -0.2355965078, -0.2033085674, 0.0396521464, 0.3704897463, -0.4324615598, -0.0091456398, -0.105340004, -0.0523020662, 0.1303985417, 0.2326043695, 0.2224344611, 0.1291309297, 0.4058960974, -0.0229821, 0.0852615535, 0.2154711336, 0.7898674607, -0.0779162049, -0.9518972635, 0.0684627146, -0.4182259142, 0.5247337818, -0.0762838051, -0.0203663446, -0.2259806097, -0.0906921253, -0.0732139498, -0.2362549007, 0.119515866, 0.1982824802, 0.1051266938, -0.436296165, -0.5934209228, 0.4223226011, -0.1847918481, -0.0875429958, 0.0275153015, 0.0065171495, -0.5263797045, 0.3839454055, 0.0043079145, 0.5469962358, -0.0652341694, 0.2061707079, 0.164244324, 0.1326801777, 0.5669624805, 0.1644975096, 0.1249316335, -0.3096996546, -0.2729046643, -0.0801166892, -0.0462648571, 0.2010450065, 0.537355721, -0.1247507855, 0.3956955969, -0.2290390879, -0.2270817161, -0.003567839, 0.2181623727, 0.3714715838, -0.3578475714, -0.1528425962, 0.1190252006, -0.0880044997, 0.01928371, 0.0827521011, 0.1017645746, -0.0791928545, -0.0693392307, -0.0784781277, 0.2588512301, 0.0013759881, 0.0804190934, -0.006197128, -0.0992327705, 0.3302909136, 0.4486834705, 0.3506097496, 0.1147856265, -0.1648312807, 0.1178840399, 0.0604454428, 0.1746526957, -0.0124877468, 0.0916749462, 0.4582447112, 0.1442280561, -0.261251986, -0.0861604959, -0.1898117065, -0.1628652662, -0.0252832174, -0.0830285251, 0.2034985572, -0.5895337462, -0.2081589997, -0.1479988992, 0.2661503255, -0.3238862157, 0.1126798317, 0.0957265198, -0.0205562375, 0.1644136161, -0.0115255741, -0.316532135, -0.1929320097, 0.2515876591, -0.0450100973, 0.0347442627, 0.5573703051, 0.3530455232, -0.0319894589, -0.1456607282, 0.2625563145, 0.396119833, -0.3901973367, -0.1040851772, 0.4095881581, -0.1070694104, 0.2239105105, 0.5827169418, -0.1966191977, -0.1878956109, -0.0146094486, -0.4081916213, -0.19601354, 0.0054684021, -0.0846170112, 0.1680945456, 0.2236245573, 0.1663229167, 0.2781647742, -0.2066335678, -0.2128274441, -0.1660309881, -0.2861818373, 0.0190423541, 0.3513840437, 0.3476587832, -0.1403682232, -0.0089217089, 0.1520304829, -0.2583587766, -0.0868975818, -0.1422887146, -0.1935821325, 0.1273211986, 0.1429847032, 0.2857293487, -0.2640105486, -0.3534657955, -0.1489557177, -0.2576413453, 0.1526485234, 0.1386086047, 0.1096444428, 0.4580556154, -0.3482676744, 0.4155032039, -0.2080926895, 0.0065493882, -0.1936618388, -0.0799280107, 0.2459101081, 0.0067640739, 0.1444019526, 0.0632148758, -0.3804648519, -0.0384013131, -0.2331897616, 0.0461412035, 0.2846545577, -0.3949284554, 0.4182242453, 0.3276234269, 0.1750586629, 0.1971662343, -0.0623291507, -0.0664046481, 0.141286999, 0.2240268141, -0.4584310949, -0.3629929423, 0.1607583016, -0.0078138262, 0.0382107794, 0.3136924207, -0.1171952635, 0.1066633761, -0.065133363, 0.0340410918, 0.6418429017, -0.0415934846, 0.2116550356, 0.3595904708, -0.0425313786, 0.1777718663, 0.3617375195, 0.3674906492, -0.0481478497, 0.4969026148, 0.0696467757, 0.1143562645, 0.1496314555, 0.3424574733, -0.1239909828, -0.4713847637, 0.2929891348, -0.1653479189, -0.2640783191, 0.1471142918, -0.291041255, 0.0563964024, -0.7303272486, -0.3448593915, -0.0291979462, -0.0853532255, -0.0668612719, -0.0754416212, -0.140150398, -0.0652366504, 0.2003003806, -0.1063699499, -0.0792106465, -0.1153399721, 0.3415640593, -0.1385678053, -0.0184498392, -0.5109072328, -0.0891854167, -0.0430597067, 0.1336765587, -0.029396493, 0.2339999676, -0.174999103, -0.0956814364, 0.2588126063, 0.0092804823, 0.1054126024, 0.2317334116, 0.1931944638, -0.1506311297, -0.3097060621, -0.0795973688, -0.1394519359, 0.2378838658, 0.0547457561, 0.234652251, 0.0977924913, 0.0997682065, -0.0947732031, 0.1536297351, 0.1820672601, 0.1523022801, -0.3820307553, 0.5445274115, 0.2070109397, -0.3416915238, -0.0559777729, -0.0295071043, -0.1854069233, -0.0874875188, 0.4824202359, 0.099635914, 0.1188282594, -0.0049259029, 0.0616282374, 0.2064939588, 0.2476282418, 0.2770635784, 0.0055533838, -0.1593335569, 0.392847836, -0.7810735703, 0.0616663769, 0.2918814719, -0.290762037, 0.3185738921, 0.0418268517, 0.3377400935, -0.0268268082, -0.0879088119, 0.0872559622, 0.3598933518, -0.0520294607, -0.1859558821, -0.1271453798, 0.0463940948, 0.3435320556, -0.2045231611, -0.416146338, 0.2103685737, -0.0327191204, -0.0380157717, 0.0165936314, 0.0412060022, 0.2931005955, -0.0927975401, 0.1887980998, -0.1301510781, 0.5564446449, 0.0033663288, 0.0893990695, -0.1195807159, -0.1518788636, -0.0851530805, 0.3002230227, -0.1061233953, 0.504805088, -0.2135780305, 0.1592863351, -0.1607827544, 0.1998844296, 0.3464807868, 0.0126961283, -0.3018125892, 0.3784742653, -0.2702767849, 0.1205830276, 0.2680621445, 0.1173257083, -0.1000175178, 0.0406341553, 0.0458657146, -0.3424757123, 0.2959661484, -0.466159761, -0.3100435138, -0.1048113555, 0.2468155921, -0.1140736267, -0.0544513538, -0.6054850817, 0.0529157966, 0.4427361786, -0.0387563854, -0.5960949063, 0.3080437779, -0.1771586239, 0.0096863508, -0.0662129074, 0.2158685029, -0.051997643, -0.0348672532, 0.0966069847, -0.0649608821 ]
https://github.com/huggingface/datasets/issues/2148
Add configurable options to `seqeval` metric
Hi @marrodion. Thanks for pointing this out. It would be great to incorporate this metric-specific enhancement. Another possibility would be to require the user to input the scheme as a string `mode="strict", scheme="IOB2"` and then dynamically import the corresponding module using Python `importlib`: ```python if scheme: scheme = importlib.import_module(f"seqeval.scheme.{scheme}") ``` Feel free to create a Pull Request to make this contribution.
Right now `load_metric("seqeval")` only works in the default mode of evaluation (equivalent to conll evaluation). However, seqeval library [supports](https://github.com/chakki-works/seqeval#support-features) different evaluation schemes (IOB1, IOB2, etc.), which can be plugged in just by supporting additional kwargs in `Seqeval._compute` https://github.com/huggingface/datasets/blob/85cf7ff920c90ca2e12bedca12b36d2a043c3da2/metrics/seqeval/seqeval.py#L109 Things that would be relevant are, for example, supporting `mode="strict", scheme=IOB2` to count only full entity match as a true positive and omit partial matches. The only problem I see is that the spirit of `metrics` seems to not require additional imports from user. `seqeval` only supports schemes as objects, without any string aliases. It can be solved naively with mapping like `{"IOB2": seqeval.scheme.IOB2}`. Or just left as is and require user to explicitly import scheme from `seqeval` if he wants to configure it past the default implementation. If that makes sense, I am happy to implement the change.
61
Add configurable options to `seqeval` metric Right now `load_metric("seqeval")` only works in the default mode of evaluation (equivalent to conll evaluation). However, seqeval library [supports](https://github.com/chakki-works/seqeval#support-features) different evaluation schemes (IOB1, IOB2, etc.), which can be plugged in just by supporting additional kwargs in `Seqeval._compute` https://github.com/huggingface/datasets/blob/85cf7ff920c90ca2e12bedca12b36d2a043c3da2/metrics/seqeval/seqeval.py#L109 Things that would be relevant are, for example, supporting `mode="strict", scheme=IOB2` to count only full entity match as a true positive and omit partial matches. The only problem I see is that the spirit of `metrics` seems to not require additional imports from user. `seqeval` only supports schemes as objects, without any string aliases. It can be solved naively with mapping like `{"IOB2": seqeval.scheme.IOB2}`. Or just left as is and require user to explicitly import scheme from `seqeval` if he wants to configure it past the default implementation. If that makes sense, I am happy to implement the change. Hi @marrodion. Thanks for pointing this out. It would be great to incorporate this metric-specific enhancement. Another possibility would be to require the user to input the scheme as a string `mode="strict", scheme="IOB2"` and then dynamically import the corresponding module using Python `importlib`: ```python if scheme: scheme = importlib.import_module(f"seqeval.scheme.{scheme}") ``` Feel free to create a Pull Request to make this contribution.
[ -0.4404144883, 0.1902091503, -0.0845154673, -0.1625580341, 0.0749472678, -0.1645829678, 0.1490215957, 0.2498324215, -0.0836082548, 0.3530941606, -0.4670089781, 0.2486553043, -0.0323203206, 0.2693852186, 0.0718926042, 0.3165940642, -0.2818852067, -0.0426247902, 0.0006640702, 0.1087299734, -0.5529806018, -0.0117781721, -0.1030306518, -0.1520731151, 0.0609821938, 0.2906386256, 0.0560520142, -0.0226276293, -0.1254417896, -0.5280549526, 0.0175921395, 0.4460298717, -0.2212207168, -0.0601568632, -0.0001078837, -0.158113122, 0.1689357907, -0.2260209918, -0.2090340853, -0.0844339803, -0.3633293509, -0.2911671996, 0.3062247634, -0.2748053074, 0.0388808697, 0.2660091519, -0.0165569112, -0.1161660403, 0.0370272473, 0.1991535276, 0.1833566427, 0.1182953566, -0.1218208373, -0.0621907674, -0.2097747475, -0.0393510871, -0.1454713345, 0.3663660586, 0.0825755894, 0.2260627747, -0.1475082636, 0.0548123196, -0.0825347453, -0.2424461842, 0.2761699855, -0.1193726212, 0.6835112572, -0.0490724482, -0.0101483734, 0.3530786633, 0.2922005355, -0.1381694973, -0.3030599952, -0.1382801831, 0.0993463993, -0.6759463549, 0.1466279626, -0.0960858688, -0.10308671, -0.0826962143, -0.147965163, -0.0334589407, -0.3022651672, 0.0747025609, -0.2574522793, 0.3939167559, 0.103162095, -0.0649497211, 0.3541359901, -0.0873660892, -0.280901432, 0.1270284951, -0.0665887892, 0.165654704, -0.7408688068, -0.1477437168, -0.0183482692, -0.1815030575, 0.2883768678, 0.1682549119, 0.1724754721, 0.4368012547, 0.251739949, 0.3541307151, -0.021023158, 0.3432516456, 0.3131857514, -0.0112347938, 0.2474580705, 0.0248376988, 0.3714902699, -0.0004126155, 0.0090160705, -0.6599240303, 0.0679210424, 0.1159391999, -0.1485633254, -0.2398645133, -0.4179401994, -0.1582227051, -0.0586347021, -0.1113009751, 0.5018101931, 0.1235097945, -0.1155991107, -0.0895079672, 0.0192274675, 0.4378792644, -0.1458705664, -0.0979551375, 0.0163525976, 0.041167099, 0.2045772076, 0.0621872619, 0.2487521619, -0.3678160608, 0.1303179264, -0.0490684062, 0.4444538355, -0.1659910977, 0.1460126638, 0.1006268039, -0.2069738209, 0.0788968131, -0.133262068, -0.421854794, 0.0916285142, -0.2899058461, -0.4019011855, -0.0714188069, -0.1759270728, -0.4768916368, 0.0616528839, 0.2252952605, -0.5246813893, -0.0130114295, -0.008132536, 0.8326736689, -0.322126627, 0.0141435564, -0.047621578, 0.1276528239, -0.4847742021, -0.0889541656, 0.5480532646, 0.3216398954, -0.222031638, -0.2398312688, -0.2551138699, -0.0794140697, -0.2599945366, -0.2022046596, -0.0602390505, 0.0837335959, 0.0311894864, -0.0284742787, 0.7662085891, -0.4222574234, -0.0210453607, -0.0803241432, 0.1119458079, -0.2272855043, 0.1323758215, -0.0373111367, 0.3576786816, 0.0049093589, 0.084307462, 0.2205338478, 0.1616144329, -0.2613898516, -0.266877532, -0.2711869776, -0.2316743582, 0.1784905344, 0.3956589699, -0.0351167098, 0.3203671277, -0.0065062828, -0.2160915881, -0.0357709564, 0.1151761711, 0.0618475489, 0.2012487054, -0.1130904704, 0.0918780193, -0.1234123856, 0.0600494556, 0.2182962298, -0.0904196575, 0.0480319224, 0.1216682792, -0.1127962396, -0.4679356217, 0.0559173897, -0.1898505092, 0.0555302463, 0.2089474499, -0.3269336224, -0.0342498757, 0.1159047931, 0.002093792, 0.0913386196, 0.2793195546, 0.0862988308, -0.0139890974, -0.0003465563, 0.211474359, 0.0567867607, 0.2087512612, 0.4165765941, 0.191333279, 0.2593637705, -0.1091645062, 0.4110056758, -0.0502914265, 0.1841276437, -0.0150860902, 0.5559145212, 0.0683775172, 0.0065895095, 0.0519290268, -0.0516527817, 0.0611870326, -0.0641520768, -0.2367987484, 0.586817503, -0.0794757456, 0.2356159836, -0.3424956203, 0.0648829117, 0.1319376975, -0.0953313485, -0.552742362, -0.3062810302, 0.1004477888, -0.0132671092, 0.2669743598, 0.0566562638, 0.0582373142, -0.3772335052, -0.1556093693, 0.1259266585, 0.141358912, 0.1581712961, 0.0661021769, -0.2052513212, 0.0382202938, -0.4662927985, 0.2903064191, 0.2150235325, 0.0154530602, -0.0470343009, -0.2343877256, -0.0794961527, 0.3340310454, 0.1572770476, 0.0158221535, 0.2130637765, 0.3205014467, -0.2190813124, -0.3135820329, -0.0800575539, 0.0409121364, -0.0422436893, -0.3572458625, -0.0943196639, -0.1978914738, 0.2450004816, 0.1717703044, 0.046035856, -0.2025748193, -0.4122638404, 0.5190325975, 0.2028548419, -0.1720628142, 0.180285275, -0.1151279286, 0.3317413628, -0.0443055034, -0.4356968403, -0.1409582198, -0.1817719936, 0.0940517336, 0.0956958383, 0.0057352707, 0.1029755473, 0.3749665618, -0.0675890595, 0.2991306782, 0.0355555043, -0.6364482641, -0.0239807777, 0.226826176, 0.5722036362, 0.1552385539, -0.405613035, -0.0692542046, -0.0509044155, 0.2231381238, 0.2037604749, -0.0061180368, 0.4136137664, -0.060964331, 0.2502987981, -0.221978277, 0.0178010371, 0.1000239626, -0.5327191353, 0.2453567684, 0.0594389439, -0.0078855827, 0.0686222687, 0.1769716144, 0.0562077947, 0.1112413704, 0.1771620214, -0.1424995214, 0.1927737594, 0.4930689335, -0.204859823, -0.0341394097, 0.0772611797, -0.278519094, 0.4551794231, 0.079875119, -0.1620341092, -0.5353201032, 0.3236709237, 0.2179785967, -0.0605300367, -0.4171499312, 0.0311843157, 0.1809618771, 0.0233632475, -0.0555090308, -0.181401819, 0.2989301383, 0.1583502889, 0.1338728368, -0.0115188621, 0.2164409459, 0.1655125171, 0.0562131777, -0.0208814442, 0.2980599701, 0.0986943543, 0.0352464616, 0.2259938419, 0.1511307359, -0.084105365, 0.1994832009, 0.34873119, -0.1657782197, 0.3828116357, 0.2678938508, 0.1650661677, -0.2781140506, -0.122435756, 0.1228319407, -0.2981288433, 0.1224511787, -0.2493656129, 0.2479148209, -0.1362846792, -0.0732634664, -0.320581913, -0.050680548, 0.1360851228, 0.3659796715, -0.0212373137, 0.0480642729, 0.1203468144, 0.2267451733, -0.1817408204, 0.2449277639, -0.2822354436, -0.1319660246, 0.1585784554, 0.0025966391, 0.1485466659, 0.0906286985, 0.4362580478, -0.1654891074, -0.2084533125, 0.1888998598, -0.08209984, -0.5329559445, 0.035661988, -0.0349516943, -0.4825755656, 0.2373021543, 0.2342270911, -0.6754449606, -0.0595335066, 0.1215939447, 0.1488146484, -0.2491261363, -0.3720695674, -0.2491946965, -0.1661500633, -0.1850428879, 0.1767452955, -0.0412339158, 0.2086205184, 0.0582408607, 0.0278213695, -0.2370103002, -0.2062324882, 0.2350770682, 0.2506455481, 0.1796316355, -0.2191856503, 0.2529242933, 0.134390071, -0.2753549516, -0.0382410288, 0.0560919307, 0.1188495532, -0.5144648552, 0.1194527, -0.0995485932, 0.4271161854, -0.014253214, -0.0842271373, 0.104725644, -0.4169355333, 0.0466159321, -0.241633743, 0.2342703789, 0.1022847146, 0.1387828141, 0.0718401372, -0.2300117612, 0.7161650658, 0.0334566832, -0.3667719364, -0.3400565684, -0.1941259652, -0.276260078, 0.1269847453, 0.5371963382, 0.6189171076, -0.229758203, -0.423022747, 0.1905957013, -0.1576028168, 0.1787087321, -0.2520559728, 0.0649108812, -0.1693065166, 0.3038465381, 0.1148397699, 0.0961575657, 0.1213558316, 0.0285859536, -0.3229552209, 0.262301296, -0.0876453519, -0.1266813278, 0.0731283799, 0.1338578612, -0.175150767, -0.3573801517, -0.1863690019, 0.1556977332, -0.0601057075, -0.1517752856, 0.0936811715, -0.1170484275, 0.1334589422, 0.0523661897, 0.0779813528, -0.330127269, -0.1485981941, 0.0718109608, -0.1227507144, -0.1340817064, 0.1538651586, 0.3677943647, 0.3159064651, 0.250695169, -0.2192078382, 0.0688006282, -0.1206844375, 0.4233390689, 0.1289048642, 0.0205714926, 0.0675248057, -0.1725013256, -0.0250885785, 0.1401515901, 0.0098186731, -0.2661957741, 0.1412726045, 0.0608112551, 0.256673038, 0.0033591539, 0.285425663, -0.2257716656, 0.2838926911, -0.1538017094, 0.1529940814, 0.2556664646, 0.0278819464, 0.2798297107, -0.0294748452, -0.2504780889, -0.0226103459, 0.0359693617, -0.119276911, -0.0034108832, 0.1109193414, -0.5640183687, -0.0269924626, -0.0785509124, -0.2152326405, -0.3589274287, -0.2481249124, 0.1937835962, 0.2345778346, -0.2313769609, 0.0745704547, 0.3725794554, 0.1676904708, -0.0997100472, 0.0897697657, -0.1951111853, -0.05834838, 0.228356421, -0.0534784719, 0.1799024343, -0.3127806485, 0.1394996047, -0.3911750317, 0.1289292425, -0.3697018027, -0.2773509324, -0.0878168717, 0.1667949557, -0.1807759553, 0.1421957314, -0.0388467684, 0.2374230623, 0.1220598668, 0.0381965786, -0.4078209996, -0.1503542066, -0.4157820642, 0.1182316989, -0.2259811759, 0.2852980196, 0.0547874719, 0.1516319811, -0.1848928928, -0.3355191946, -0.1151429713, 0.1512245983, -0.2504038811, 0.0327736214, -0.0120636243, 0.2532397807, 0.0426804274, 0.0884668455, 0.0761529729, 0.0691101551, -0.2445201874, 0.4089042544, -0.4262245893, 0.0013445616, 0.3232170939, 0.237890169, 0.1443796307, -0.2653340399, 0.073596105, 0.4012959003, -0.0727841556, 0.0548970923, 0.1699572504, 0.2629700899, 0.0851073861, -0.0324252397, 0.00583205, 0.2133553326, -0.2015920281, 0.1152645424, -0.3776822686, -0.1356103867, 0.3888044953, 0.4075065255, 0.4992362857, -0.2398553193, 0.6050270796, -0.0692228302, 0.0270401426, 0.0179139562, 0.0892329514, 0.1072708368, -0.1823897362, 0.1261912435, 0.6123809814, -0.0296224784, 0.3305943906, -0.2045362294, -0.2899585068, 0.0331652313, -0.0681629628, 0.2578575015, 0.0157054923, 0.0174085796, 0.2866870761, 0.0368601121, -0.2332395911, 0.0928658396, 0.0050939694, 0.3247486055, -0.1984855533, 0.0808284655, -0.3066542447, 0.0290482789, 0.1574489027, -0.1903540939, -0.1305322498, -0.4349575937, -0.2236599922, -0.1116327345, 0.1209932119, -0.2770492435, -0.0610651262, 0.082043007, 0.4553854167, -0.1370195895, -0.0792974681, 0.3357094228, 0.215069145, -0.3242680728, -0.0028113006, 0.1278243065, 0.0335071534, 0.4683334529, 0.3301253915, 0.0862674564, -0.0277188569, 0.0959933698, -0.2647822499, -0.199558273, 0.0546613261, -0.2562651932, 0.0792410448, 0.2268076688, -0.2233176231, 0.3783641458, 0.164914608, -0.1877299696, 0.2148336619, -0.3457731307, 0.0238631256, -0.6392328143, 0.0873930678, 0.4923711717, 0.0124289095, 0.0293331072, -0.4252646267, 0.029337436, -0.3556755185, -0.1338486671, -0.0051880889, 0.0981242359, -0.0843453184, 0.1254211962, 0.1143109351, -0.0538969152, -0.1814900488, -0.3265305758, -0.1567294896, 0.170960784, -0.645870924, 0.0052650049, 0.3642018735, 0.0321770608, 0.1904269755, 0.0564564764, -0.1080869883, 0.4374266565, -0.2179744095, -0.3041596711, 0.2744574249, -0.112793304, -0.3386616111, -0.0245661344, 0.1490686834, -0.0836657956, 0.0014882535, 0.0283096284, -0.000203033, -0.3106567264, 0.139176473, -0.0663409382, -0.0854628235, 0.3035058379, 0.2935442924, 0.1796829551, 0.1582034528, 0.3154583871, -0.138074711, 0.3068931401, -0.0322091468, 0.0993028432, -0.1724682301, -0.050414864, -0.1201309338, 0.1211796403, -0.0257845279, -0.1413268447, 0.0438548997, 0.5314904451, 0.0005541742, -0.6094725132, -0.0070516653, 0.0545104742, 0.1806102991, 0.0297052599, -0.2594842613, 0.2796794474, 0.2102258652, 0.1567271352, 0.0636737943, -0.1860809624, 0.2762588859, -0.1737949401, -0.0388328321, -0.0562235899, 0.335041821, 0.4395315647, 0.1541654021, -0.1488435715, -0.0303661302, 0.4258217812, 0.2423172146, 0.1391757578, 0.438721031, 0.0353352763, -0.0228174999, -0.249227941, -0.3756602108, 0.1360052526, 0.2666219473, -0.0287333727, -0.2172952741 ]
https://github.com/huggingface/datasets/issues/2146
Dataset file size on disk is very large with 3D Array
Hi ! In the arrow file we store all the integers as uint8. So your arrow file should weigh around `height x width x n_channels x n_images` bytes. What feature type do your TFDS dataset have ? If it uses a `tfds.features.Image` type, then what is stored is the encoded data (as png or jpg for example). Since these encodings are made for compression, the resulting tfrecord is smaller that the arrow file. We are working on adding a similar feature in `datasets`: the ability to store the encoded data instead of the raw integers for images, but also for audio data. This way, arrow files will have similar sizes as tfrecords for images.
Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help.
114
Dataset file size on disk is very large with 3D Array Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help. Hi ! In the arrow file we store all the integers as uint8. So your arrow file should weigh around `height x width x n_channels x n_images` bytes. What feature type do your TFDS dataset have ? If it uses a `tfds.features.Image` type, then what is stored is the encoded data (as png or jpg for example). Since these encodings are made for compression, the resulting tfrecord is smaller that the arrow file. We are working on adding a similar feature in `datasets`: the ability to store the encoded data instead of the raw integers for images, but also for audio data. This way, arrow files will have similar sizes as tfrecords for images.
[ -0.1452736408, -0.1132631153, -0.154417932, 0.4201559424, 0.2135636806, 0.1139129177, 0.5066813231, 0.2730788291, 0.0205231085, 0.0358477049, -0.1937045157, 0.0874155611, -0.1694586277, 0.3150441051, 0.0677501336, 0.100688152, -0.0745178759, 0.2513983548, -0.133478269, -0.0857201591, -0.009700872, 0.0191180836, -0.0179095119, -0.1838063598, -0.0615616925, -0.1613831371, 0.091349192, -0.0241848789, -0.0830985308, 0.0797271505, 0.2449778765, -0.0880117267, 0.1781993806, 0.5363874435, -0.0001173844, 0.0502765477, 0.1082944721, -0.1655321419, 0.0791867003, 0.2893511057, -0.0925559774, -0.4095059633, -0.0746669844, -0.3576087654, 0.076958403, -0.3249550462, -0.1521174908, -0.1535454094, 0.184890002, 0.0791000724, 0.2110456228, 0.1533053517, -0.0271133035, 0.4150459766, 0.0993780345, 0.5338883996, -0.1533458382, 0.1268557459, -0.143538624, 0.4372020662, 0.0842977464, 0.0795505643, 0.1613585055, 0.2877254188, 0.504050374, -0.0555180982, 0.2392117083, -0.2461921275, 0.129893899, 0.400113076, 0.8583649993, -0.2007376254, -0.1842804104, -0.3255720735, -0.1083303019, -0.0323390402, 0.0225406457, 0.3800633252, -0.0498899892, 0.0219307151, -0.6522023678, -0.1392245889, -0.2269417644, 0.1455016732, -0.2136535645, -0.4809676111, -0.1380902976, 0.1503391564, -0.1890008599, -0.2658364475, 0.2607783675, -0.3955922127, 0.073437497, -0.0997146219, -0.2659655809, -0.210180521, -0.2905138433, -0.3803427517, 0.3530269265, -0.1538061202, -0.0108277649, -0.1519933343, -0.364893347, -0.1477424502, 0.1039847508, 0.3860374987, -0.476847291, -0.1385977864, -0.1418680251, -0.2950902581, -0.0408815816, -0.0522946939, -0.2465379238, -0.0907577872, 0.1986331344, -0.4835402369, 0.0639367104, -0.0618669353, 0.044680886, 0.0238073729, 0.0864813477, -0.0952554718, -0.0751629621, 0.1316527575, 0.1410508454, 0.1352760345, -0.1400614977, -0.0392039046, -0.1859154403, 0.0416381247, -0.1229669601, -0.1046106517, 0.0626311749, -0.0817551613, 0.1144736707, 0.1505685598, 0.0522912145, -0.1904569119, 0.0903885216, 0.200100258, 0.2624741495, -0.3473195732, 0.4073759913, 0.3550085425, 0.1589063406, 0.1983183026, -0.2854206264, 0.1398649216, -0.1997081935, 0.494494766, -0.5467606783, -0.0453602448, -0.4173411131, 0.0906219259, -0.2234345078, -0.054319825, -0.5728364587, 0.009743222, 0.3395531178, -0.1186217144, 0.0678243861, -0.2173455656, -0.3785403371, -0.2943599522, -0.0371543877, 0.0312657617, -0.7563117743, 0.2612311542, -0.1514395773, 0.0817362815, 0.1952205598, 0.595215857, -0.0899516642, 0.4252850413, -0.4255608022, -0.0484713539, 0.0430040173, -0.0383998156, -0.661108017, 0.4873415828, 0.0706718862, 0.0485028401, 0.1124144942, 0.3201818764, 0.1636858582, -0.0163750499, -0.2228290141, 0.326606065, 0.0910480991, 0.042669341, -0.1908330023, -0.3811232448, 0.0882390887, 0.0459807143, -0.1374952048, -0.1405357569, 0.1314448863, 0.0834869966, 0.2107227594, -0.1292203516, 0.0360600501, 0.37058568, 0.2096632719, -0.2556738853, -0.0215889942, 0.1423660517, -0.6317532659, 0.183380872, 0.2472613752, -0.4363890886, 0.1557535678, -0.1044434085, 0.0382063501, -0.2296468019, -0.0895897448, 0.2013012469, 0.0237025842, -0.0005766023, -0.0091963932, -0.0104557797, -0.0085912123, -0.1477527469, 0.1148846969, -0.1881847084, -0.4114226997, 0.3561537564, 0.2135654241, -0.035041891, -0.1056866348, -0.0788612813, -0.3569893539, -0.341083318, -0.1865353584, 0.0800962001, 0.2511082292, 0.1212479025, -0.0773303956, 0.483738035, 0.2234309912, 0.0761170238, 0.3378686309, -0.1210734099, 0.0945777595, -0.220615685, -0.2020521611, 0.2165209055, -0.191824764, 0.0659021214, 0.0202878565, -0.3593145609, 0.2857809067, 0.1333051622, 0.105053544, -0.2576690316, -0.0769442916, 0.192902267, 0.3467417359, 0.2029426992, 0.1076559126, 0.046753481, 0.6398188472, -0.1667220742, 0.1070181876, 0.3645209074, -0.1265420318, -0.0783275738, 0.105871059, 0.2452512383, 0.5257761478, 0.2170312107, 0.0459645912, -0.0413737074, 0.4925530851, -0.1443801075, 0.0811916515, 0.0678964928, 0.5235674381, 0.2810912728, 0.1602382362, 0.0027568564, -0.2844555974, -0.1133064926, 0.2043944001, 0.2465661615, -0.3033528328, 0.1999261975, -0.1631351709, -0.2681360841, -0.0947999656, 0.1902987063, -0.0601119474, 0.1248415262, -0.3277062178, -0.1944485754, 0.0251020715, -0.079767555, 0.1439216882, 0.0847973377, 0.2937847376, -0.0679314658, 0.2701691985, 0.3433183432, -0.0878248811, 0.0354879275, 0.4142908454, -0.1485609412, 0.3000027537, -0.1635023654, 0.2096657455, -0.138071239, -0.2516806722, 0.1204531863, 0.0605553612, 0.0706451461, -0.1095741838, 0.274066329, -0.199559778, 0.2018909752, 0.0286063999, 0.0493996963, -0.2603569925, 0.0002532974, -0.0481880978, -0.1286523193, -0.2174703777, 0.0934466049, -0.2839458585, -0.0509910136, 0.2078642249, 0.1816901863, 0.2575589418, 0.3705636263, 0.1723434627, 0.0412284844, 0.1493279934, -0.0243311264, -0.1940807998, -0.4591633081, 0.145960927, -0.0282913819, -0.3725242615, 0.1432909667, 0.0114656538, 0.1920367926, 0.2045513093, -0.6480359435, -0.039491348, -0.2930948138, 0.0378663987, -0.1762447655, 0.1218835935, 0.0200798046, -0.2159729302, 0.0826532617, -0.0400287211, -0.1227324456, -0.080126375, 0.1514733732, 0.1209951863, 0.127742365, 0.5383255482, 0.2677575946, 0.4104944766, 0.1294863522, -0.3016059697, 0.1248357892, -0.1209922358, 0.370011121, -0.2481319457, 0.0517885834, 0.3423666954, 0.1794078648, -0.2017467171, 0.2401465327, -0.004897831, -0.0705831796, 0.3367038369, 0.028789714, -0.1383412778, 0.023906514, 0.1935493201, -0.0604688674, 0.0104938513, -0.0702694952, -0.0987720713, -0.1590378582, -0.3050753474, -0.0873736665, 0.1904461682, 0.2198338062, 0.0339710973, -0.3773393631, -0.1148495525, -0.3479647338, 0.1886433959, -0.1687083393, 0.3023189306, 0.0322840214, 0.2741391957, 0.2475179732, 0.1615710855, 0.9262685776, -0.0916073471, 0.0714726895, -0.1972738206, -0.0435678214, -0.5894110203, -0.1542813182, -0.0789641887, 0.0270804763, -0.0590395592, 0.5538505912, -0.0631092563, -0.0686066449, -0.2617591321, 0.2991939783, -0.316880703, -0.3877654374, -0.2755343318, -0.2933423519, -0.1356879473, -0.3935817778, 0.019994542, -0.0869561881, 0.0755999535, -0.3193261325, -0.2675707936, -0.1990124434, 0.0541380718, 0.0145461559, 0.3740361631, 0.3435082138, 0.2086752057, -0.086925745, 0.3284698427, 0.3661998808, 0.2595768571, 0.0718757436, 0.0568668842, 0.2052866369, -0.2167996466, 0.0861621797, 0.1083567664, -0.0250590965, -0.2877220213, -0.0670188963, 0.1119902283, -0.2830278277, 0.1024946123, 0.3718266785, -0.1586078256, -0.0864220932, -0.3929764032, 0.3548667431, 0.0121599287, 0.0940142423, 0.036005199, -0.051952336, -0.1494733542, 0.1480955929, 0.2831674218, 0.5525883436, -0.3548776507, 0.3033214509, 0.2974141836, 0.0017679706, 0.0114027672, -0.0265302286, -0.1680652499, -0.1445067227, -0.3122719526, 0.0030846074, -0.1878084838, -0.0254935101, 0.4849463105, 0.1750966609, 0.043912828, 0.2067074776, 0.0071271723, -0.1149759665, 0.5293210149, 0.2995491624, -0.2283004373, 0.0325019099, 0.0639347434, -0.2548328042, -0.1903494596, -0.0622592643, -0.0863793492, -0.0984941199, 0.2215803862, -0.0403396264, -0.2126668543, -0.1238955557, 0.3679513931, -0.1082211211, -0.2316220701, 0.1815725565, 0.0838661268, -0.20102036, 0.196623221, -0.1573188454, 0.1279700249, 0.0030060094, 0.3249217868, 0.1413982511, -0.1144990474, -0.0310454778, -0.0913246125, 0.0234272033, -0.1943866909, 0.1888038814, -0.1482691616, -0.0629261732, 0.0454888716, 0.0297895949, -0.0961101875, -0.6530040503, -0.3431921005, -0.2048238516, 0.4010300934, 0.0805630013, 0.1309612542, 0.2124831825, 0.4965966344, 0.0243890639, -0.3730359972, -0.1403265744, 0.1895270944, 0.2858309746, 0.1799473166, 0.3866919875, -0.1341090798, -0.1365936995, -0.0709895641, 0.6510816813, 0.1012728214, -0.1912544221, -0.0577657782, -0.0403907299, 0.3169393241, 0.0208150037, -0.3343824744, 0.188358143, -0.0939157456, -0.3599130511, -0.2077347934, -0.1373047531, 0.1214710772, -0.1601490378, 0.2943195701, 0.0504381582, -0.1864531785, 0.0016883984, -0.0764313266, -0.2049330175, 0.1969458908, 0.2957783341, 0.0060841385, -0.3328679502, 0.0645706505, -0.0876781121, -0.2682572901, -0.0669380575, -0.1471434385, -0.1714788377, -0.1753692925, 0.096780777, 0.1115375087, 0.1287064552, -0.2801168859, 0.1016184837, -0.3750437796, -0.4788469076, -0.1348807514, 0.1319558918, -0.0679690987, -0.0909876749, 0.1033130884, 0.0220809095, -0.2510060668, 0.0079657063, 0.141607821, 0.0354231745, 0.298848927, 0.189244926, 0.1612938344, 0.1742736101, 0.0425287783, -0.4761441946, 0.0175628811, -0.0588392541, 0.0995731279, 0.1874172539, -0.1962638944, 0.2503471375, 0.2590203881, 0.3225477934, 0.1073598266, -0.4383762479, -0.2273103595, -0.0798546299, 0.1225002632, 0.0510140806, -0.1831585467, 0.1945349425, 0.2868765891, -0.0688324273, 0.3184706867, 0.2352004349, 0.3476956487, -0.4201476872, 0.0468277037, 0.4110741317, 0.0671939254, -0.1297736466, 0.4717314243, -0.2036248446, 0.0523638166, 0.0846017748, 0.2946647704, 0.1201958656, 0.8587025404, 0.1290913522, 0.1891805381, 0.4139887094, -0.0303374827, 0.0068448931, -0.4966720939, -0.0952323973, 0.1984750628, -0.1680760235, 0.274112463, 0.1702122092, -0.3590529561, 0.1909859776, -0.3852769732, -0.2336920202, -0.0620268062, -0.2622533143, 0.1335816681, -0.0030271858, 0.0273249745, 0.1620101333, 0.2371409684, -0.3845198452, -0.3014770448, -0.2461310178, 0.1889076829, -0.2023760676, 0.2124778628, 0.4214306474, 0.0444426015, -0.0315243937, -0.0391091332, 0.3646275103, 0.0986835808, 0.101068154, -0.0881534517, 0.0778101906, 0.1303086877, 0.194221884, 0.186471805, -0.0245691855, 0.229917556, -0.0123418272, -0.0638060868, 0.0230800472, -0.10071145, -0.0150631778, 0.1352043748, 0.0769988298, -0.0195251126, -0.1023718417, 0.4225894511, -0.005135173, -0.4866003394, -0.0333420411, -0.4977215528, -0.0050529987, -0.0514771156, 0.0287459232, -0.4116463661, -0.235376969, 0.5690823197, -0.2013361007, 0.2559472322, 0.0774657652, 0.0456616282, -0.607973814, 0.6227490902, 0.1627822667, 0.0933040977, -0.0685406476, 0.1594239473, -0.5500159264, 0.0303857587, -0.2166629881, -0.1015652791, 0.2339972854, 0.4140377641, -0.0308635868, -0.0486868434, 0.1650851965, 0.0038430355, -0.1916438788, 0.0894424319, -0.2841001749, -0.1390905529, -0.1443408579, 0.1185546815, -0.1753245741, -0.4083870947, 0.3195689917, -0.0093015507, -0.076787971, -0.1066463739, 0.2173394412, -0.1415833086, 0.487829566, 0.4013831615, -0.0483229049, 0.3463920057, 0.0004340708, 0.0175026208, 0.0451892018, 0.1241306514, -0.0279618055, 0.7077245712, 0.0045387689, 0.1401189417, -0.0876322165, 0.0933171287, 0.1183361337, 0.0912864804, -0.0013900548, -0.158374235, -0.1358548403, 0.0508203506, -0.152741313, 0.0265372731, 0.1540858448, 0.1232054681, 0.0315914601, -0.0814921409, -0.0285232514, -0.0700531974, 0.318890214, 0.0257119015, -0.0847273543, 0.0533847101, -0.0156114995, -0.0210559815, -0.0187304858, -0.2966988683, 0.2012094557, 0.4706379771, -0.2481854409, -0.0093804151, 0.3947989345, -0.2101590931, 0.0058913678, -0.0756308064, 0.7668735385, -0.1517629474, -0.3578999043, -0.1258620173, -0.0418123528 ]
https://github.com/huggingface/datasets/issues/2146
Dataset file size on disk is very large with 3D Array
Thanks for the prompt response. You're right about the encoding, I have the `tfds.features.Image` feature type you mentioned. However, as described in the `dataset_info.json`, my dataset is made of 1479 (224x224x3) images. 1479 x 224 x 224 x 3 = 222630912 bytes which is far from the actual size 520803408 bytes. Anyway I look forward to the Image feature type in `datasets`.
Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help.
62
Dataset file size on disk is very large with 3D Array Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help. Thanks for the prompt response. You're right about the encoding, I have the `tfds.features.Image` feature type you mentioned. However, as described in the `dataset_info.json`, my dataset is made of 1479 (224x224x3) images. 1479 x 224 x 224 x 3 = 222630912 bytes which is far from the actual size 520803408 bytes. Anyway I look forward to the Image feature type in `datasets`.
[ -0.1452736408, -0.1132631153, -0.154417932, 0.4201559424, 0.2135636806, 0.1139129177, 0.5066813231, 0.2730788291, 0.0205231085, 0.0358477049, -0.1937045157, 0.0874155611, -0.1694586277, 0.3150441051, 0.0677501336, 0.100688152, -0.0745178759, 0.2513983548, -0.133478269, -0.0857201591, -0.009700872, 0.0191180836, -0.0179095119, -0.1838063598, -0.0615616925, -0.1613831371, 0.091349192, -0.0241848789, -0.0830985308, 0.0797271505, 0.2449778765, -0.0880117267, 0.1781993806, 0.5363874435, -0.0001173844, 0.0502765477, 0.1082944721, -0.1655321419, 0.0791867003, 0.2893511057, -0.0925559774, -0.4095059633, -0.0746669844, -0.3576087654, 0.076958403, -0.3249550462, -0.1521174908, -0.1535454094, 0.184890002, 0.0791000724, 0.2110456228, 0.1533053517, -0.0271133035, 0.4150459766, 0.0993780345, 0.5338883996, -0.1533458382, 0.1268557459, -0.143538624, 0.4372020662, 0.0842977464, 0.0795505643, 0.1613585055, 0.2877254188, 0.504050374, -0.0555180982, 0.2392117083, -0.2461921275, 0.129893899, 0.400113076, 0.8583649993, -0.2007376254, -0.1842804104, -0.3255720735, -0.1083303019, -0.0323390402, 0.0225406457, 0.3800633252, -0.0498899892, 0.0219307151, -0.6522023678, -0.1392245889, -0.2269417644, 0.1455016732, -0.2136535645, -0.4809676111, -0.1380902976, 0.1503391564, -0.1890008599, -0.2658364475, 0.2607783675, -0.3955922127, 0.073437497, -0.0997146219, -0.2659655809, -0.210180521, -0.2905138433, -0.3803427517, 0.3530269265, -0.1538061202, -0.0108277649, -0.1519933343, -0.364893347, -0.1477424502, 0.1039847508, 0.3860374987, -0.476847291, -0.1385977864, -0.1418680251, -0.2950902581, -0.0408815816, -0.0522946939, -0.2465379238, -0.0907577872, 0.1986331344, -0.4835402369, 0.0639367104, -0.0618669353, 0.044680886, 0.0238073729, 0.0864813477, -0.0952554718, -0.0751629621, 0.1316527575, 0.1410508454, 0.1352760345, -0.1400614977, -0.0392039046, -0.1859154403, 0.0416381247, -0.1229669601, -0.1046106517, 0.0626311749, -0.0817551613, 0.1144736707, 0.1505685598, 0.0522912145, -0.1904569119, 0.0903885216, 0.200100258, 0.2624741495, -0.3473195732, 0.4073759913, 0.3550085425, 0.1589063406, 0.1983183026, -0.2854206264, 0.1398649216, -0.1997081935, 0.494494766, -0.5467606783, -0.0453602448, -0.4173411131, 0.0906219259, -0.2234345078, -0.054319825, -0.5728364587, 0.009743222, 0.3395531178, -0.1186217144, 0.0678243861, -0.2173455656, -0.3785403371, -0.2943599522, -0.0371543877, 0.0312657617, -0.7563117743, 0.2612311542, -0.1514395773, 0.0817362815, 0.1952205598, 0.595215857, -0.0899516642, 0.4252850413, -0.4255608022, -0.0484713539, 0.0430040173, -0.0383998156, -0.661108017, 0.4873415828, 0.0706718862, 0.0485028401, 0.1124144942, 0.3201818764, 0.1636858582, -0.0163750499, -0.2228290141, 0.326606065, 0.0910480991, 0.042669341, -0.1908330023, -0.3811232448, 0.0882390887, 0.0459807143, -0.1374952048, -0.1405357569, 0.1314448863, 0.0834869966, 0.2107227594, -0.1292203516, 0.0360600501, 0.37058568, 0.2096632719, -0.2556738853, -0.0215889942, 0.1423660517, -0.6317532659, 0.183380872, 0.2472613752, -0.4363890886, 0.1557535678, -0.1044434085, 0.0382063501, -0.2296468019, -0.0895897448, 0.2013012469, 0.0237025842, -0.0005766023, -0.0091963932, -0.0104557797, -0.0085912123, -0.1477527469, 0.1148846969, -0.1881847084, -0.4114226997, 0.3561537564, 0.2135654241, -0.035041891, -0.1056866348, -0.0788612813, -0.3569893539, -0.341083318, -0.1865353584, 0.0800962001, 0.2511082292, 0.1212479025, -0.0773303956, 0.483738035, 0.2234309912, 0.0761170238, 0.3378686309, -0.1210734099, 0.0945777595, -0.220615685, -0.2020521611, 0.2165209055, -0.191824764, 0.0659021214, 0.0202878565, -0.3593145609, 0.2857809067, 0.1333051622, 0.105053544, -0.2576690316, -0.0769442916, 0.192902267, 0.3467417359, 0.2029426992, 0.1076559126, 0.046753481, 0.6398188472, -0.1667220742, 0.1070181876, 0.3645209074, -0.1265420318, -0.0783275738, 0.105871059, 0.2452512383, 0.5257761478, 0.2170312107, 0.0459645912, -0.0413737074, 0.4925530851, -0.1443801075, 0.0811916515, 0.0678964928, 0.5235674381, 0.2810912728, 0.1602382362, 0.0027568564, -0.2844555974, -0.1133064926, 0.2043944001, 0.2465661615, -0.3033528328, 0.1999261975, -0.1631351709, -0.2681360841, -0.0947999656, 0.1902987063, -0.0601119474, 0.1248415262, -0.3277062178, -0.1944485754, 0.0251020715, -0.079767555, 0.1439216882, 0.0847973377, 0.2937847376, -0.0679314658, 0.2701691985, 0.3433183432, -0.0878248811, 0.0354879275, 0.4142908454, -0.1485609412, 0.3000027537, -0.1635023654, 0.2096657455, -0.138071239, -0.2516806722, 0.1204531863, 0.0605553612, 0.0706451461, -0.1095741838, 0.274066329, -0.199559778, 0.2018909752, 0.0286063999, 0.0493996963, -0.2603569925, 0.0002532974, -0.0481880978, -0.1286523193, -0.2174703777, 0.0934466049, -0.2839458585, -0.0509910136, 0.2078642249, 0.1816901863, 0.2575589418, 0.3705636263, 0.1723434627, 0.0412284844, 0.1493279934, -0.0243311264, -0.1940807998, -0.4591633081, 0.145960927, -0.0282913819, -0.3725242615, 0.1432909667, 0.0114656538, 0.1920367926, 0.2045513093, -0.6480359435, -0.039491348, -0.2930948138, 0.0378663987, -0.1762447655, 0.1218835935, 0.0200798046, -0.2159729302, 0.0826532617, -0.0400287211, -0.1227324456, -0.080126375, 0.1514733732, 0.1209951863, 0.127742365, 0.5383255482, 0.2677575946, 0.4104944766, 0.1294863522, -0.3016059697, 0.1248357892, -0.1209922358, 0.370011121, -0.2481319457, 0.0517885834, 0.3423666954, 0.1794078648, -0.2017467171, 0.2401465327, -0.004897831, -0.0705831796, 0.3367038369, 0.028789714, -0.1383412778, 0.023906514, 0.1935493201, -0.0604688674, 0.0104938513, -0.0702694952, -0.0987720713, -0.1590378582, -0.3050753474, -0.0873736665, 0.1904461682, 0.2198338062, 0.0339710973, -0.3773393631, -0.1148495525, -0.3479647338, 0.1886433959, -0.1687083393, 0.3023189306, 0.0322840214, 0.2741391957, 0.2475179732, 0.1615710855, 0.9262685776, -0.0916073471, 0.0714726895, -0.1972738206, -0.0435678214, -0.5894110203, -0.1542813182, -0.0789641887, 0.0270804763, -0.0590395592, 0.5538505912, -0.0631092563, -0.0686066449, -0.2617591321, 0.2991939783, -0.316880703, -0.3877654374, -0.2755343318, -0.2933423519, -0.1356879473, -0.3935817778, 0.019994542, -0.0869561881, 0.0755999535, -0.3193261325, -0.2675707936, -0.1990124434, 0.0541380718, 0.0145461559, 0.3740361631, 0.3435082138, 0.2086752057, -0.086925745, 0.3284698427, 0.3661998808, 0.2595768571, 0.0718757436, 0.0568668842, 0.2052866369, -0.2167996466, 0.0861621797, 0.1083567664, -0.0250590965, -0.2877220213, -0.0670188963, 0.1119902283, -0.2830278277, 0.1024946123, 0.3718266785, -0.1586078256, -0.0864220932, -0.3929764032, 0.3548667431, 0.0121599287, 0.0940142423, 0.036005199, -0.051952336, -0.1494733542, 0.1480955929, 0.2831674218, 0.5525883436, -0.3548776507, 0.3033214509, 0.2974141836, 0.0017679706, 0.0114027672, -0.0265302286, -0.1680652499, -0.1445067227, -0.3122719526, 0.0030846074, -0.1878084838, -0.0254935101, 0.4849463105, 0.1750966609, 0.043912828, 0.2067074776, 0.0071271723, -0.1149759665, 0.5293210149, 0.2995491624, -0.2283004373, 0.0325019099, 0.0639347434, -0.2548328042, -0.1903494596, -0.0622592643, -0.0863793492, -0.0984941199, 0.2215803862, -0.0403396264, -0.2126668543, -0.1238955557, 0.3679513931, -0.1082211211, -0.2316220701, 0.1815725565, 0.0838661268, -0.20102036, 0.196623221, -0.1573188454, 0.1279700249, 0.0030060094, 0.3249217868, 0.1413982511, -0.1144990474, -0.0310454778, -0.0913246125, 0.0234272033, -0.1943866909, 0.1888038814, -0.1482691616, -0.0629261732, 0.0454888716, 0.0297895949, -0.0961101875, -0.6530040503, -0.3431921005, -0.2048238516, 0.4010300934, 0.0805630013, 0.1309612542, 0.2124831825, 0.4965966344, 0.0243890639, -0.3730359972, -0.1403265744, 0.1895270944, 0.2858309746, 0.1799473166, 0.3866919875, -0.1341090798, -0.1365936995, -0.0709895641, 0.6510816813, 0.1012728214, -0.1912544221, -0.0577657782, -0.0403907299, 0.3169393241, 0.0208150037, -0.3343824744, 0.188358143, -0.0939157456, -0.3599130511, -0.2077347934, -0.1373047531, 0.1214710772, -0.1601490378, 0.2943195701, 0.0504381582, -0.1864531785, 0.0016883984, -0.0764313266, -0.2049330175, 0.1969458908, 0.2957783341, 0.0060841385, -0.3328679502, 0.0645706505, -0.0876781121, -0.2682572901, -0.0669380575, -0.1471434385, -0.1714788377, -0.1753692925, 0.096780777, 0.1115375087, 0.1287064552, -0.2801168859, 0.1016184837, -0.3750437796, -0.4788469076, -0.1348807514, 0.1319558918, -0.0679690987, -0.0909876749, 0.1033130884, 0.0220809095, -0.2510060668, 0.0079657063, 0.141607821, 0.0354231745, 0.298848927, 0.189244926, 0.1612938344, 0.1742736101, 0.0425287783, -0.4761441946, 0.0175628811, -0.0588392541, 0.0995731279, 0.1874172539, -0.1962638944, 0.2503471375, 0.2590203881, 0.3225477934, 0.1073598266, -0.4383762479, -0.2273103595, -0.0798546299, 0.1225002632, 0.0510140806, -0.1831585467, 0.1945349425, 0.2868765891, -0.0688324273, 0.3184706867, 0.2352004349, 0.3476956487, -0.4201476872, 0.0468277037, 0.4110741317, 0.0671939254, -0.1297736466, 0.4717314243, -0.2036248446, 0.0523638166, 0.0846017748, 0.2946647704, 0.1201958656, 0.8587025404, 0.1290913522, 0.1891805381, 0.4139887094, -0.0303374827, 0.0068448931, -0.4966720939, -0.0952323973, 0.1984750628, -0.1680760235, 0.274112463, 0.1702122092, -0.3590529561, 0.1909859776, -0.3852769732, -0.2336920202, -0.0620268062, -0.2622533143, 0.1335816681, -0.0030271858, 0.0273249745, 0.1620101333, 0.2371409684, -0.3845198452, -0.3014770448, -0.2461310178, 0.1889076829, -0.2023760676, 0.2124778628, 0.4214306474, 0.0444426015, -0.0315243937, -0.0391091332, 0.3646275103, 0.0986835808, 0.101068154, -0.0881534517, 0.0778101906, 0.1303086877, 0.194221884, 0.186471805, -0.0245691855, 0.229917556, -0.0123418272, -0.0638060868, 0.0230800472, -0.10071145, -0.0150631778, 0.1352043748, 0.0769988298, -0.0195251126, -0.1023718417, 0.4225894511, -0.005135173, -0.4866003394, -0.0333420411, -0.4977215528, -0.0050529987, -0.0514771156, 0.0287459232, -0.4116463661, -0.235376969, 0.5690823197, -0.2013361007, 0.2559472322, 0.0774657652, 0.0456616282, -0.607973814, 0.6227490902, 0.1627822667, 0.0933040977, -0.0685406476, 0.1594239473, -0.5500159264, 0.0303857587, -0.2166629881, -0.1015652791, 0.2339972854, 0.4140377641, -0.0308635868, -0.0486868434, 0.1650851965, 0.0038430355, -0.1916438788, 0.0894424319, -0.2841001749, -0.1390905529, -0.1443408579, 0.1185546815, -0.1753245741, -0.4083870947, 0.3195689917, -0.0093015507, -0.076787971, -0.1066463739, 0.2173394412, -0.1415833086, 0.487829566, 0.4013831615, -0.0483229049, 0.3463920057, 0.0004340708, 0.0175026208, 0.0451892018, 0.1241306514, -0.0279618055, 0.7077245712, 0.0045387689, 0.1401189417, -0.0876322165, 0.0933171287, 0.1183361337, 0.0912864804, -0.0013900548, -0.158374235, -0.1358548403, 0.0508203506, -0.152741313, 0.0265372731, 0.1540858448, 0.1232054681, 0.0315914601, -0.0814921409, -0.0285232514, -0.0700531974, 0.318890214, 0.0257119015, -0.0847273543, 0.0533847101, -0.0156114995, -0.0210559815, -0.0187304858, -0.2966988683, 0.2012094557, 0.4706379771, -0.2481854409, -0.0093804151, 0.3947989345, -0.2101590931, 0.0058913678, -0.0756308064, 0.7668735385, -0.1517629474, -0.3578999043, -0.1258620173, -0.0418123528 ]
https://github.com/huggingface/datasets/issues/2146
Dataset file size on disk is very large with 3D Array
@lhoestq I changed the data structure so I have a 2D Array feature type instead of a 3D Array by grouping the two last dimensions ( a 224x672 2D Array instead of a 224x224x3 3D Array). The file size is now 223973964 bytes, nearly half the previous size! Which is around of what I would expect. I found similar behavior in existing `datasets` collection, when comparing black and white vs color image, for example MNIST vs CIFAR.
Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help.
77
Dataset file size on disk is very large with 3D Array Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help. @lhoestq I changed the data structure so I have a 2D Array feature type instead of a 3D Array by grouping the two last dimensions ( a 224x672 2D Array instead of a 224x224x3 3D Array). The file size is now 223973964 bytes, nearly half the previous size! Which is around of what I would expect. I found similar behavior in existing `datasets` collection, when comparing black and white vs color image, for example MNIST vs CIFAR.
[ -0.1452736408, -0.1132631153, -0.154417932, 0.4201559424, 0.2135636806, 0.1139129177, 0.5066813231, 0.2730788291, 0.0205231085, 0.0358477049, -0.1937045157, 0.0874155611, -0.1694586277, 0.3150441051, 0.0677501336, 0.100688152, -0.0745178759, 0.2513983548, -0.133478269, -0.0857201591, -0.009700872, 0.0191180836, -0.0179095119, -0.1838063598, -0.0615616925, -0.1613831371, 0.091349192, -0.0241848789, -0.0830985308, 0.0797271505, 0.2449778765, -0.0880117267, 0.1781993806, 0.5363874435, -0.0001173844, 0.0502765477, 0.1082944721, -0.1655321419, 0.0791867003, 0.2893511057, -0.0925559774, -0.4095059633, -0.0746669844, -0.3576087654, 0.076958403, -0.3249550462, -0.1521174908, -0.1535454094, 0.184890002, 0.0791000724, 0.2110456228, 0.1533053517, -0.0271133035, 0.4150459766, 0.0993780345, 0.5338883996, -0.1533458382, 0.1268557459, -0.143538624, 0.4372020662, 0.0842977464, 0.0795505643, 0.1613585055, 0.2877254188, 0.504050374, -0.0555180982, 0.2392117083, -0.2461921275, 0.129893899, 0.400113076, 0.8583649993, -0.2007376254, -0.1842804104, -0.3255720735, -0.1083303019, -0.0323390402, 0.0225406457, 0.3800633252, -0.0498899892, 0.0219307151, -0.6522023678, -0.1392245889, -0.2269417644, 0.1455016732, -0.2136535645, -0.4809676111, -0.1380902976, 0.1503391564, -0.1890008599, -0.2658364475, 0.2607783675, -0.3955922127, 0.073437497, -0.0997146219, -0.2659655809, -0.210180521, -0.2905138433, -0.3803427517, 0.3530269265, -0.1538061202, -0.0108277649, -0.1519933343, -0.364893347, -0.1477424502, 0.1039847508, 0.3860374987, -0.476847291, -0.1385977864, -0.1418680251, -0.2950902581, -0.0408815816, -0.0522946939, -0.2465379238, -0.0907577872, 0.1986331344, -0.4835402369, 0.0639367104, -0.0618669353, 0.044680886, 0.0238073729, 0.0864813477, -0.0952554718, -0.0751629621, 0.1316527575, 0.1410508454, 0.1352760345, -0.1400614977, -0.0392039046, -0.1859154403, 0.0416381247, -0.1229669601, -0.1046106517, 0.0626311749, -0.0817551613, 0.1144736707, 0.1505685598, 0.0522912145, -0.1904569119, 0.0903885216, 0.200100258, 0.2624741495, -0.3473195732, 0.4073759913, 0.3550085425, 0.1589063406, 0.1983183026, -0.2854206264, 0.1398649216, -0.1997081935, 0.494494766, -0.5467606783, -0.0453602448, -0.4173411131, 0.0906219259, -0.2234345078, -0.054319825, -0.5728364587, 0.009743222, 0.3395531178, -0.1186217144, 0.0678243861, -0.2173455656, -0.3785403371, -0.2943599522, -0.0371543877, 0.0312657617, -0.7563117743, 0.2612311542, -0.1514395773, 0.0817362815, 0.1952205598, 0.595215857, -0.0899516642, 0.4252850413, -0.4255608022, -0.0484713539, 0.0430040173, -0.0383998156, -0.661108017, 0.4873415828, 0.0706718862, 0.0485028401, 0.1124144942, 0.3201818764, 0.1636858582, -0.0163750499, -0.2228290141, 0.326606065, 0.0910480991, 0.042669341, -0.1908330023, -0.3811232448, 0.0882390887, 0.0459807143, -0.1374952048, -0.1405357569, 0.1314448863, 0.0834869966, 0.2107227594, -0.1292203516, 0.0360600501, 0.37058568, 0.2096632719, -0.2556738853, -0.0215889942, 0.1423660517, -0.6317532659, 0.183380872, 0.2472613752, -0.4363890886, 0.1557535678, -0.1044434085, 0.0382063501, -0.2296468019, -0.0895897448, 0.2013012469, 0.0237025842, -0.0005766023, -0.0091963932, -0.0104557797, -0.0085912123, -0.1477527469, 0.1148846969, -0.1881847084, -0.4114226997, 0.3561537564, 0.2135654241, -0.035041891, -0.1056866348, -0.0788612813, -0.3569893539, -0.341083318, -0.1865353584, 0.0800962001, 0.2511082292, 0.1212479025, -0.0773303956, 0.483738035, 0.2234309912, 0.0761170238, 0.3378686309, -0.1210734099, 0.0945777595, -0.220615685, -0.2020521611, 0.2165209055, -0.191824764, 0.0659021214, 0.0202878565, -0.3593145609, 0.2857809067, 0.1333051622, 0.105053544, -0.2576690316, -0.0769442916, 0.192902267, 0.3467417359, 0.2029426992, 0.1076559126, 0.046753481, 0.6398188472, -0.1667220742, 0.1070181876, 0.3645209074, -0.1265420318, -0.0783275738, 0.105871059, 0.2452512383, 0.5257761478, 0.2170312107, 0.0459645912, -0.0413737074, 0.4925530851, -0.1443801075, 0.0811916515, 0.0678964928, 0.5235674381, 0.2810912728, 0.1602382362, 0.0027568564, -0.2844555974, -0.1133064926, 0.2043944001, 0.2465661615, -0.3033528328, 0.1999261975, -0.1631351709, -0.2681360841, -0.0947999656, 0.1902987063, -0.0601119474, 0.1248415262, -0.3277062178, -0.1944485754, 0.0251020715, -0.079767555, 0.1439216882, 0.0847973377, 0.2937847376, -0.0679314658, 0.2701691985, 0.3433183432, -0.0878248811, 0.0354879275, 0.4142908454, -0.1485609412, 0.3000027537, -0.1635023654, 0.2096657455, -0.138071239, -0.2516806722, 0.1204531863, 0.0605553612, 0.0706451461, -0.1095741838, 0.274066329, -0.199559778, 0.2018909752, 0.0286063999, 0.0493996963, -0.2603569925, 0.0002532974, -0.0481880978, -0.1286523193, -0.2174703777, 0.0934466049, -0.2839458585, -0.0509910136, 0.2078642249, 0.1816901863, 0.2575589418, 0.3705636263, 0.1723434627, 0.0412284844, 0.1493279934, -0.0243311264, -0.1940807998, -0.4591633081, 0.145960927, -0.0282913819, -0.3725242615, 0.1432909667, 0.0114656538, 0.1920367926, 0.2045513093, -0.6480359435, -0.039491348, -0.2930948138, 0.0378663987, -0.1762447655, 0.1218835935, 0.0200798046, -0.2159729302, 0.0826532617, -0.0400287211, -0.1227324456, -0.080126375, 0.1514733732, 0.1209951863, 0.127742365, 0.5383255482, 0.2677575946, 0.4104944766, 0.1294863522, -0.3016059697, 0.1248357892, -0.1209922358, 0.370011121, -0.2481319457, 0.0517885834, 0.3423666954, 0.1794078648, -0.2017467171, 0.2401465327, -0.004897831, -0.0705831796, 0.3367038369, 0.028789714, -0.1383412778, 0.023906514, 0.1935493201, -0.0604688674, 0.0104938513, -0.0702694952, -0.0987720713, -0.1590378582, -0.3050753474, -0.0873736665, 0.1904461682, 0.2198338062, 0.0339710973, -0.3773393631, -0.1148495525, -0.3479647338, 0.1886433959, -0.1687083393, 0.3023189306, 0.0322840214, 0.2741391957, 0.2475179732, 0.1615710855, 0.9262685776, -0.0916073471, 0.0714726895, -0.1972738206, -0.0435678214, -0.5894110203, -0.1542813182, -0.0789641887, 0.0270804763, -0.0590395592, 0.5538505912, -0.0631092563, -0.0686066449, -0.2617591321, 0.2991939783, -0.316880703, -0.3877654374, -0.2755343318, -0.2933423519, -0.1356879473, -0.3935817778, 0.019994542, -0.0869561881, 0.0755999535, -0.3193261325, -0.2675707936, -0.1990124434, 0.0541380718, 0.0145461559, 0.3740361631, 0.3435082138, 0.2086752057, -0.086925745, 0.3284698427, 0.3661998808, 0.2595768571, 0.0718757436, 0.0568668842, 0.2052866369, -0.2167996466, 0.0861621797, 0.1083567664, -0.0250590965, -0.2877220213, -0.0670188963, 0.1119902283, -0.2830278277, 0.1024946123, 0.3718266785, -0.1586078256, -0.0864220932, -0.3929764032, 0.3548667431, 0.0121599287, 0.0940142423, 0.036005199, -0.051952336, -0.1494733542, 0.1480955929, 0.2831674218, 0.5525883436, -0.3548776507, 0.3033214509, 0.2974141836, 0.0017679706, 0.0114027672, -0.0265302286, -0.1680652499, -0.1445067227, -0.3122719526, 0.0030846074, -0.1878084838, -0.0254935101, 0.4849463105, 0.1750966609, 0.043912828, 0.2067074776, 0.0071271723, -0.1149759665, 0.5293210149, 0.2995491624, -0.2283004373, 0.0325019099, 0.0639347434, -0.2548328042, -0.1903494596, -0.0622592643, -0.0863793492, -0.0984941199, 0.2215803862, -0.0403396264, -0.2126668543, -0.1238955557, 0.3679513931, -0.1082211211, -0.2316220701, 0.1815725565, 0.0838661268, -0.20102036, 0.196623221, -0.1573188454, 0.1279700249, 0.0030060094, 0.3249217868, 0.1413982511, -0.1144990474, -0.0310454778, -0.0913246125, 0.0234272033, -0.1943866909, 0.1888038814, -0.1482691616, -0.0629261732, 0.0454888716, 0.0297895949, -0.0961101875, -0.6530040503, -0.3431921005, -0.2048238516, 0.4010300934, 0.0805630013, 0.1309612542, 0.2124831825, 0.4965966344, 0.0243890639, -0.3730359972, -0.1403265744, 0.1895270944, 0.2858309746, 0.1799473166, 0.3866919875, -0.1341090798, -0.1365936995, -0.0709895641, 0.6510816813, 0.1012728214, -0.1912544221, -0.0577657782, -0.0403907299, 0.3169393241, 0.0208150037, -0.3343824744, 0.188358143, -0.0939157456, -0.3599130511, -0.2077347934, -0.1373047531, 0.1214710772, -0.1601490378, 0.2943195701, 0.0504381582, -0.1864531785, 0.0016883984, -0.0764313266, -0.2049330175, 0.1969458908, 0.2957783341, 0.0060841385, -0.3328679502, 0.0645706505, -0.0876781121, -0.2682572901, -0.0669380575, -0.1471434385, -0.1714788377, -0.1753692925, 0.096780777, 0.1115375087, 0.1287064552, -0.2801168859, 0.1016184837, -0.3750437796, -0.4788469076, -0.1348807514, 0.1319558918, -0.0679690987, -0.0909876749, 0.1033130884, 0.0220809095, -0.2510060668, 0.0079657063, 0.141607821, 0.0354231745, 0.298848927, 0.189244926, 0.1612938344, 0.1742736101, 0.0425287783, -0.4761441946, 0.0175628811, -0.0588392541, 0.0995731279, 0.1874172539, -0.1962638944, 0.2503471375, 0.2590203881, 0.3225477934, 0.1073598266, -0.4383762479, -0.2273103595, -0.0798546299, 0.1225002632, 0.0510140806, -0.1831585467, 0.1945349425, 0.2868765891, -0.0688324273, 0.3184706867, 0.2352004349, 0.3476956487, -0.4201476872, 0.0468277037, 0.4110741317, 0.0671939254, -0.1297736466, 0.4717314243, -0.2036248446, 0.0523638166, 0.0846017748, 0.2946647704, 0.1201958656, 0.8587025404, 0.1290913522, 0.1891805381, 0.4139887094, -0.0303374827, 0.0068448931, -0.4966720939, -0.0952323973, 0.1984750628, -0.1680760235, 0.274112463, 0.1702122092, -0.3590529561, 0.1909859776, -0.3852769732, -0.2336920202, -0.0620268062, -0.2622533143, 0.1335816681, -0.0030271858, 0.0273249745, 0.1620101333, 0.2371409684, -0.3845198452, -0.3014770448, -0.2461310178, 0.1889076829, -0.2023760676, 0.2124778628, 0.4214306474, 0.0444426015, -0.0315243937, -0.0391091332, 0.3646275103, 0.0986835808, 0.101068154, -0.0881534517, 0.0778101906, 0.1303086877, 0.194221884, 0.186471805, -0.0245691855, 0.229917556, -0.0123418272, -0.0638060868, 0.0230800472, -0.10071145, -0.0150631778, 0.1352043748, 0.0769988298, -0.0195251126, -0.1023718417, 0.4225894511, -0.005135173, -0.4866003394, -0.0333420411, -0.4977215528, -0.0050529987, -0.0514771156, 0.0287459232, -0.4116463661, -0.235376969, 0.5690823197, -0.2013361007, 0.2559472322, 0.0774657652, 0.0456616282, -0.607973814, 0.6227490902, 0.1627822667, 0.0933040977, -0.0685406476, 0.1594239473, -0.5500159264, 0.0303857587, -0.2166629881, -0.1015652791, 0.2339972854, 0.4140377641, -0.0308635868, -0.0486868434, 0.1650851965, 0.0038430355, -0.1916438788, 0.0894424319, -0.2841001749, -0.1390905529, -0.1443408579, 0.1185546815, -0.1753245741, -0.4083870947, 0.3195689917, -0.0093015507, -0.076787971, -0.1066463739, 0.2173394412, -0.1415833086, 0.487829566, 0.4013831615, -0.0483229049, 0.3463920057, 0.0004340708, 0.0175026208, 0.0451892018, 0.1241306514, -0.0279618055, 0.7077245712, 0.0045387689, 0.1401189417, -0.0876322165, 0.0933171287, 0.1183361337, 0.0912864804, -0.0013900548, -0.158374235, -0.1358548403, 0.0508203506, -0.152741313, 0.0265372731, 0.1540858448, 0.1232054681, 0.0315914601, -0.0814921409, -0.0285232514, -0.0700531974, 0.318890214, 0.0257119015, -0.0847273543, 0.0533847101, -0.0156114995, -0.0210559815, -0.0187304858, -0.2966988683, 0.2012094557, 0.4706379771, -0.2481854409, -0.0093804151, 0.3947989345, -0.2101590931, 0.0058913678, -0.0756308064, 0.7668735385, -0.1517629474, -0.3578999043, -0.1258620173, -0.0418123528 ]
https://github.com/huggingface/datasets/issues/2146
Dataset file size on disk is very large with 3D Array
Interesting ! This may be because of the offsets that are stored with the array data. Currently the offsets are stored even if the `shape` of the arrays is fixed. This was needed because of some issues with pyarrow a few months ago. I think these issues have been addressed now, so we can probably try to remove them to make the file lighter. Ideally in your case the floats data should be 220 MB for both Array2D and Array3D
Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help.
80
Dataset file size on disk is very large with 3D Array Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help. Interesting ! This may be because of the offsets that are stored with the array data. Currently the offsets are stored even if the `shape` of the arrays is fixed. This was needed because of some issues with pyarrow a few months ago. I think these issues have been addressed now, so we can probably try to remove them to make the file lighter. Ideally in your case the floats data should be 220 MB for both Array2D and Array3D
[ -0.1452736408, -0.1132631153, -0.154417932, 0.4201559424, 0.2135636806, 0.1139129177, 0.5066813231, 0.2730788291, 0.0205231085, 0.0358477049, -0.1937045157, 0.0874155611, -0.1694586277, 0.3150441051, 0.0677501336, 0.100688152, -0.0745178759, 0.2513983548, -0.133478269, -0.0857201591, -0.009700872, 0.0191180836, -0.0179095119, -0.1838063598, -0.0615616925, -0.1613831371, 0.091349192, -0.0241848789, -0.0830985308, 0.0797271505, 0.2449778765, -0.0880117267, 0.1781993806, 0.5363874435, -0.0001173844, 0.0502765477, 0.1082944721, -0.1655321419, 0.0791867003, 0.2893511057, -0.0925559774, -0.4095059633, -0.0746669844, -0.3576087654, 0.076958403, -0.3249550462, -0.1521174908, -0.1535454094, 0.184890002, 0.0791000724, 0.2110456228, 0.1533053517, -0.0271133035, 0.4150459766, 0.0993780345, 0.5338883996, -0.1533458382, 0.1268557459, -0.143538624, 0.4372020662, 0.0842977464, 0.0795505643, 0.1613585055, 0.2877254188, 0.504050374, -0.0555180982, 0.2392117083, -0.2461921275, 0.129893899, 0.400113076, 0.8583649993, -0.2007376254, -0.1842804104, -0.3255720735, -0.1083303019, -0.0323390402, 0.0225406457, 0.3800633252, -0.0498899892, 0.0219307151, -0.6522023678, -0.1392245889, -0.2269417644, 0.1455016732, -0.2136535645, -0.4809676111, -0.1380902976, 0.1503391564, -0.1890008599, -0.2658364475, 0.2607783675, -0.3955922127, 0.073437497, -0.0997146219, -0.2659655809, -0.210180521, -0.2905138433, -0.3803427517, 0.3530269265, -0.1538061202, -0.0108277649, -0.1519933343, -0.364893347, -0.1477424502, 0.1039847508, 0.3860374987, -0.476847291, -0.1385977864, -0.1418680251, -0.2950902581, -0.0408815816, -0.0522946939, -0.2465379238, -0.0907577872, 0.1986331344, -0.4835402369, 0.0639367104, -0.0618669353, 0.044680886, 0.0238073729, 0.0864813477, -0.0952554718, -0.0751629621, 0.1316527575, 0.1410508454, 0.1352760345, -0.1400614977, -0.0392039046, -0.1859154403, 0.0416381247, -0.1229669601, -0.1046106517, 0.0626311749, -0.0817551613, 0.1144736707, 0.1505685598, 0.0522912145, -0.1904569119, 0.0903885216, 0.200100258, 0.2624741495, -0.3473195732, 0.4073759913, 0.3550085425, 0.1589063406, 0.1983183026, -0.2854206264, 0.1398649216, -0.1997081935, 0.494494766, -0.5467606783, -0.0453602448, -0.4173411131, 0.0906219259, -0.2234345078, -0.054319825, -0.5728364587, 0.009743222, 0.3395531178, -0.1186217144, 0.0678243861, -0.2173455656, -0.3785403371, -0.2943599522, -0.0371543877, 0.0312657617, -0.7563117743, 0.2612311542, -0.1514395773, 0.0817362815, 0.1952205598, 0.595215857, -0.0899516642, 0.4252850413, -0.4255608022, -0.0484713539, 0.0430040173, -0.0383998156, -0.661108017, 0.4873415828, 0.0706718862, 0.0485028401, 0.1124144942, 0.3201818764, 0.1636858582, -0.0163750499, -0.2228290141, 0.326606065, 0.0910480991, 0.042669341, -0.1908330023, -0.3811232448, 0.0882390887, 0.0459807143, -0.1374952048, -0.1405357569, 0.1314448863, 0.0834869966, 0.2107227594, -0.1292203516, 0.0360600501, 0.37058568, 0.2096632719, -0.2556738853, -0.0215889942, 0.1423660517, -0.6317532659, 0.183380872, 0.2472613752, -0.4363890886, 0.1557535678, -0.1044434085, 0.0382063501, -0.2296468019, -0.0895897448, 0.2013012469, 0.0237025842, -0.0005766023, -0.0091963932, -0.0104557797, -0.0085912123, -0.1477527469, 0.1148846969, -0.1881847084, -0.4114226997, 0.3561537564, 0.2135654241, -0.035041891, -0.1056866348, -0.0788612813, -0.3569893539, -0.341083318, -0.1865353584, 0.0800962001, 0.2511082292, 0.1212479025, -0.0773303956, 0.483738035, 0.2234309912, 0.0761170238, 0.3378686309, -0.1210734099, 0.0945777595, -0.220615685, -0.2020521611, 0.2165209055, -0.191824764, 0.0659021214, 0.0202878565, -0.3593145609, 0.2857809067, 0.1333051622, 0.105053544, -0.2576690316, -0.0769442916, 0.192902267, 0.3467417359, 0.2029426992, 0.1076559126, 0.046753481, 0.6398188472, -0.1667220742, 0.1070181876, 0.3645209074, -0.1265420318, -0.0783275738, 0.105871059, 0.2452512383, 0.5257761478, 0.2170312107, 0.0459645912, -0.0413737074, 0.4925530851, -0.1443801075, 0.0811916515, 0.0678964928, 0.5235674381, 0.2810912728, 0.1602382362, 0.0027568564, -0.2844555974, -0.1133064926, 0.2043944001, 0.2465661615, -0.3033528328, 0.1999261975, -0.1631351709, -0.2681360841, -0.0947999656, 0.1902987063, -0.0601119474, 0.1248415262, -0.3277062178, -0.1944485754, 0.0251020715, -0.079767555, 0.1439216882, 0.0847973377, 0.2937847376, -0.0679314658, 0.2701691985, 0.3433183432, -0.0878248811, 0.0354879275, 0.4142908454, -0.1485609412, 0.3000027537, -0.1635023654, 0.2096657455, -0.138071239, -0.2516806722, 0.1204531863, 0.0605553612, 0.0706451461, -0.1095741838, 0.274066329, -0.199559778, 0.2018909752, 0.0286063999, 0.0493996963, -0.2603569925, 0.0002532974, -0.0481880978, -0.1286523193, -0.2174703777, 0.0934466049, -0.2839458585, -0.0509910136, 0.2078642249, 0.1816901863, 0.2575589418, 0.3705636263, 0.1723434627, 0.0412284844, 0.1493279934, -0.0243311264, -0.1940807998, -0.4591633081, 0.145960927, -0.0282913819, -0.3725242615, 0.1432909667, 0.0114656538, 0.1920367926, 0.2045513093, -0.6480359435, -0.039491348, -0.2930948138, 0.0378663987, -0.1762447655, 0.1218835935, 0.0200798046, -0.2159729302, 0.0826532617, -0.0400287211, -0.1227324456, -0.080126375, 0.1514733732, 0.1209951863, 0.127742365, 0.5383255482, 0.2677575946, 0.4104944766, 0.1294863522, -0.3016059697, 0.1248357892, -0.1209922358, 0.370011121, -0.2481319457, 0.0517885834, 0.3423666954, 0.1794078648, -0.2017467171, 0.2401465327, -0.004897831, -0.0705831796, 0.3367038369, 0.028789714, -0.1383412778, 0.023906514, 0.1935493201, -0.0604688674, 0.0104938513, -0.0702694952, -0.0987720713, -0.1590378582, -0.3050753474, -0.0873736665, 0.1904461682, 0.2198338062, 0.0339710973, -0.3773393631, -0.1148495525, -0.3479647338, 0.1886433959, -0.1687083393, 0.3023189306, 0.0322840214, 0.2741391957, 0.2475179732, 0.1615710855, 0.9262685776, -0.0916073471, 0.0714726895, -0.1972738206, -0.0435678214, -0.5894110203, -0.1542813182, -0.0789641887, 0.0270804763, -0.0590395592, 0.5538505912, -0.0631092563, -0.0686066449, -0.2617591321, 0.2991939783, -0.316880703, -0.3877654374, -0.2755343318, -0.2933423519, -0.1356879473, -0.3935817778, 0.019994542, -0.0869561881, 0.0755999535, -0.3193261325, -0.2675707936, -0.1990124434, 0.0541380718, 0.0145461559, 0.3740361631, 0.3435082138, 0.2086752057, -0.086925745, 0.3284698427, 0.3661998808, 0.2595768571, 0.0718757436, 0.0568668842, 0.2052866369, -0.2167996466, 0.0861621797, 0.1083567664, -0.0250590965, -0.2877220213, -0.0670188963, 0.1119902283, -0.2830278277, 0.1024946123, 0.3718266785, -0.1586078256, -0.0864220932, -0.3929764032, 0.3548667431, 0.0121599287, 0.0940142423, 0.036005199, -0.051952336, -0.1494733542, 0.1480955929, 0.2831674218, 0.5525883436, -0.3548776507, 0.3033214509, 0.2974141836, 0.0017679706, 0.0114027672, -0.0265302286, -0.1680652499, -0.1445067227, -0.3122719526, 0.0030846074, -0.1878084838, -0.0254935101, 0.4849463105, 0.1750966609, 0.043912828, 0.2067074776, 0.0071271723, -0.1149759665, 0.5293210149, 0.2995491624, -0.2283004373, 0.0325019099, 0.0639347434, -0.2548328042, -0.1903494596, -0.0622592643, -0.0863793492, -0.0984941199, 0.2215803862, -0.0403396264, -0.2126668543, -0.1238955557, 0.3679513931, -0.1082211211, -0.2316220701, 0.1815725565, 0.0838661268, -0.20102036, 0.196623221, -0.1573188454, 0.1279700249, 0.0030060094, 0.3249217868, 0.1413982511, -0.1144990474, -0.0310454778, -0.0913246125, 0.0234272033, -0.1943866909, 0.1888038814, -0.1482691616, -0.0629261732, 0.0454888716, 0.0297895949, -0.0961101875, -0.6530040503, -0.3431921005, -0.2048238516, 0.4010300934, 0.0805630013, 0.1309612542, 0.2124831825, 0.4965966344, 0.0243890639, -0.3730359972, -0.1403265744, 0.1895270944, 0.2858309746, 0.1799473166, 0.3866919875, -0.1341090798, -0.1365936995, -0.0709895641, 0.6510816813, 0.1012728214, -0.1912544221, -0.0577657782, -0.0403907299, 0.3169393241, 0.0208150037, -0.3343824744, 0.188358143, -0.0939157456, -0.3599130511, -0.2077347934, -0.1373047531, 0.1214710772, -0.1601490378, 0.2943195701, 0.0504381582, -0.1864531785, 0.0016883984, -0.0764313266, -0.2049330175, 0.1969458908, 0.2957783341, 0.0060841385, -0.3328679502, 0.0645706505, -0.0876781121, -0.2682572901, -0.0669380575, -0.1471434385, -0.1714788377, -0.1753692925, 0.096780777, 0.1115375087, 0.1287064552, -0.2801168859, 0.1016184837, -0.3750437796, -0.4788469076, -0.1348807514, 0.1319558918, -0.0679690987, -0.0909876749, 0.1033130884, 0.0220809095, -0.2510060668, 0.0079657063, 0.141607821, 0.0354231745, 0.298848927, 0.189244926, 0.1612938344, 0.1742736101, 0.0425287783, -0.4761441946, 0.0175628811, -0.0588392541, 0.0995731279, 0.1874172539, -0.1962638944, 0.2503471375, 0.2590203881, 0.3225477934, 0.1073598266, -0.4383762479, -0.2273103595, -0.0798546299, 0.1225002632, 0.0510140806, -0.1831585467, 0.1945349425, 0.2868765891, -0.0688324273, 0.3184706867, 0.2352004349, 0.3476956487, -0.4201476872, 0.0468277037, 0.4110741317, 0.0671939254, -0.1297736466, 0.4717314243, -0.2036248446, 0.0523638166, 0.0846017748, 0.2946647704, 0.1201958656, 0.8587025404, 0.1290913522, 0.1891805381, 0.4139887094, -0.0303374827, 0.0068448931, -0.4966720939, -0.0952323973, 0.1984750628, -0.1680760235, 0.274112463, 0.1702122092, -0.3590529561, 0.1909859776, -0.3852769732, -0.2336920202, -0.0620268062, -0.2622533143, 0.1335816681, -0.0030271858, 0.0273249745, 0.1620101333, 0.2371409684, -0.3845198452, -0.3014770448, -0.2461310178, 0.1889076829, -0.2023760676, 0.2124778628, 0.4214306474, 0.0444426015, -0.0315243937, -0.0391091332, 0.3646275103, 0.0986835808, 0.101068154, -0.0881534517, 0.0778101906, 0.1303086877, 0.194221884, 0.186471805, -0.0245691855, 0.229917556, -0.0123418272, -0.0638060868, 0.0230800472, -0.10071145, -0.0150631778, 0.1352043748, 0.0769988298, -0.0195251126, -0.1023718417, 0.4225894511, -0.005135173, -0.4866003394, -0.0333420411, -0.4977215528, -0.0050529987, -0.0514771156, 0.0287459232, -0.4116463661, -0.235376969, 0.5690823197, -0.2013361007, 0.2559472322, 0.0774657652, 0.0456616282, -0.607973814, 0.6227490902, 0.1627822667, 0.0933040977, -0.0685406476, 0.1594239473, -0.5500159264, 0.0303857587, -0.2166629881, -0.1015652791, 0.2339972854, 0.4140377641, -0.0308635868, -0.0486868434, 0.1650851965, 0.0038430355, -0.1916438788, 0.0894424319, -0.2841001749, -0.1390905529, -0.1443408579, 0.1185546815, -0.1753245741, -0.4083870947, 0.3195689917, -0.0093015507, -0.076787971, -0.1066463739, 0.2173394412, -0.1415833086, 0.487829566, 0.4013831615, -0.0483229049, 0.3463920057, 0.0004340708, 0.0175026208, 0.0451892018, 0.1241306514, -0.0279618055, 0.7077245712, 0.0045387689, 0.1401189417, -0.0876322165, 0.0933171287, 0.1183361337, 0.0912864804, -0.0013900548, -0.158374235, -0.1358548403, 0.0508203506, -0.152741313, 0.0265372731, 0.1540858448, 0.1232054681, 0.0315914601, -0.0814921409, -0.0285232514, -0.0700531974, 0.318890214, 0.0257119015, -0.0847273543, 0.0533847101, -0.0156114995, -0.0210559815, -0.0187304858, -0.2966988683, 0.2012094557, 0.4706379771, -0.2481854409, -0.0093804151, 0.3947989345, -0.2101590931, 0.0058913678, -0.0756308064, 0.7668735385, -0.1517629474, -0.3578999043, -0.1258620173, -0.0418123528 ]
https://github.com/huggingface/datasets/issues/2146
Dataset file size on disk is very large with 3D Array
Yeah for sure, can you be a bit more specific about where the offset is stored in the code base ? And any reference to pyarrow issues if you have some. I would be very interested in contributing to `datasets` by trying to fix this issue.
Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help.
46
Dataset file size on disk is very large with 3D Array Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help. Yeah for sure, can you be a bit more specific about where the offset is stored in the code base ? And any reference to pyarrow issues if you have some. I would be very interested in contributing to `datasets` by trying to fix this issue.
[ -0.1452736408, -0.1132631153, -0.154417932, 0.4201559424, 0.2135636806, 0.1139129177, 0.5066813231, 0.2730788291, 0.0205231085, 0.0358477049, -0.1937045157, 0.0874155611, -0.1694586277, 0.3150441051, 0.0677501336, 0.100688152, -0.0745178759, 0.2513983548, -0.133478269, -0.0857201591, -0.009700872, 0.0191180836, -0.0179095119, -0.1838063598, -0.0615616925, -0.1613831371, 0.091349192, -0.0241848789, -0.0830985308, 0.0797271505, 0.2449778765, -0.0880117267, 0.1781993806, 0.5363874435, -0.0001173844, 0.0502765477, 0.1082944721, -0.1655321419, 0.0791867003, 0.2893511057, -0.0925559774, -0.4095059633, -0.0746669844, -0.3576087654, 0.076958403, -0.3249550462, -0.1521174908, -0.1535454094, 0.184890002, 0.0791000724, 0.2110456228, 0.1533053517, -0.0271133035, 0.4150459766, 0.0993780345, 0.5338883996, -0.1533458382, 0.1268557459, -0.143538624, 0.4372020662, 0.0842977464, 0.0795505643, 0.1613585055, 0.2877254188, 0.504050374, -0.0555180982, 0.2392117083, -0.2461921275, 0.129893899, 0.400113076, 0.8583649993, -0.2007376254, -0.1842804104, -0.3255720735, -0.1083303019, -0.0323390402, 0.0225406457, 0.3800633252, -0.0498899892, 0.0219307151, -0.6522023678, -0.1392245889, -0.2269417644, 0.1455016732, -0.2136535645, -0.4809676111, -0.1380902976, 0.1503391564, -0.1890008599, -0.2658364475, 0.2607783675, -0.3955922127, 0.073437497, -0.0997146219, -0.2659655809, -0.210180521, -0.2905138433, -0.3803427517, 0.3530269265, -0.1538061202, -0.0108277649, -0.1519933343, -0.364893347, -0.1477424502, 0.1039847508, 0.3860374987, -0.476847291, -0.1385977864, -0.1418680251, -0.2950902581, -0.0408815816, -0.0522946939, -0.2465379238, -0.0907577872, 0.1986331344, -0.4835402369, 0.0639367104, -0.0618669353, 0.044680886, 0.0238073729, 0.0864813477, -0.0952554718, -0.0751629621, 0.1316527575, 0.1410508454, 0.1352760345, -0.1400614977, -0.0392039046, -0.1859154403, 0.0416381247, -0.1229669601, -0.1046106517, 0.0626311749, -0.0817551613, 0.1144736707, 0.1505685598, 0.0522912145, -0.1904569119, 0.0903885216, 0.200100258, 0.2624741495, -0.3473195732, 0.4073759913, 0.3550085425, 0.1589063406, 0.1983183026, -0.2854206264, 0.1398649216, -0.1997081935, 0.494494766, -0.5467606783, -0.0453602448, -0.4173411131, 0.0906219259, -0.2234345078, -0.054319825, -0.5728364587, 0.009743222, 0.3395531178, -0.1186217144, 0.0678243861, -0.2173455656, -0.3785403371, -0.2943599522, -0.0371543877, 0.0312657617, -0.7563117743, 0.2612311542, -0.1514395773, 0.0817362815, 0.1952205598, 0.595215857, -0.0899516642, 0.4252850413, -0.4255608022, -0.0484713539, 0.0430040173, -0.0383998156, -0.661108017, 0.4873415828, 0.0706718862, 0.0485028401, 0.1124144942, 0.3201818764, 0.1636858582, -0.0163750499, -0.2228290141, 0.326606065, 0.0910480991, 0.042669341, -0.1908330023, -0.3811232448, 0.0882390887, 0.0459807143, -0.1374952048, -0.1405357569, 0.1314448863, 0.0834869966, 0.2107227594, -0.1292203516, 0.0360600501, 0.37058568, 0.2096632719, -0.2556738853, -0.0215889942, 0.1423660517, -0.6317532659, 0.183380872, 0.2472613752, -0.4363890886, 0.1557535678, -0.1044434085, 0.0382063501, -0.2296468019, -0.0895897448, 0.2013012469, 0.0237025842, -0.0005766023, -0.0091963932, -0.0104557797, -0.0085912123, -0.1477527469, 0.1148846969, -0.1881847084, -0.4114226997, 0.3561537564, 0.2135654241, -0.035041891, -0.1056866348, -0.0788612813, -0.3569893539, -0.341083318, -0.1865353584, 0.0800962001, 0.2511082292, 0.1212479025, -0.0773303956, 0.483738035, 0.2234309912, 0.0761170238, 0.3378686309, -0.1210734099, 0.0945777595, -0.220615685, -0.2020521611, 0.2165209055, -0.191824764, 0.0659021214, 0.0202878565, -0.3593145609, 0.2857809067, 0.1333051622, 0.105053544, -0.2576690316, -0.0769442916, 0.192902267, 0.3467417359, 0.2029426992, 0.1076559126, 0.046753481, 0.6398188472, -0.1667220742, 0.1070181876, 0.3645209074, -0.1265420318, -0.0783275738, 0.105871059, 0.2452512383, 0.5257761478, 0.2170312107, 0.0459645912, -0.0413737074, 0.4925530851, -0.1443801075, 0.0811916515, 0.0678964928, 0.5235674381, 0.2810912728, 0.1602382362, 0.0027568564, -0.2844555974, -0.1133064926, 0.2043944001, 0.2465661615, -0.3033528328, 0.1999261975, -0.1631351709, -0.2681360841, -0.0947999656, 0.1902987063, -0.0601119474, 0.1248415262, -0.3277062178, -0.1944485754, 0.0251020715, -0.079767555, 0.1439216882, 0.0847973377, 0.2937847376, -0.0679314658, 0.2701691985, 0.3433183432, -0.0878248811, 0.0354879275, 0.4142908454, -0.1485609412, 0.3000027537, -0.1635023654, 0.2096657455, -0.138071239, -0.2516806722, 0.1204531863, 0.0605553612, 0.0706451461, -0.1095741838, 0.274066329, -0.199559778, 0.2018909752, 0.0286063999, 0.0493996963, -0.2603569925, 0.0002532974, -0.0481880978, -0.1286523193, -0.2174703777, 0.0934466049, -0.2839458585, -0.0509910136, 0.2078642249, 0.1816901863, 0.2575589418, 0.3705636263, 0.1723434627, 0.0412284844, 0.1493279934, -0.0243311264, -0.1940807998, -0.4591633081, 0.145960927, -0.0282913819, -0.3725242615, 0.1432909667, 0.0114656538, 0.1920367926, 0.2045513093, -0.6480359435, -0.039491348, -0.2930948138, 0.0378663987, -0.1762447655, 0.1218835935, 0.0200798046, -0.2159729302, 0.0826532617, -0.0400287211, -0.1227324456, -0.080126375, 0.1514733732, 0.1209951863, 0.127742365, 0.5383255482, 0.2677575946, 0.4104944766, 0.1294863522, -0.3016059697, 0.1248357892, -0.1209922358, 0.370011121, -0.2481319457, 0.0517885834, 0.3423666954, 0.1794078648, -0.2017467171, 0.2401465327, -0.004897831, -0.0705831796, 0.3367038369, 0.028789714, -0.1383412778, 0.023906514, 0.1935493201, -0.0604688674, 0.0104938513, -0.0702694952, -0.0987720713, -0.1590378582, -0.3050753474, -0.0873736665, 0.1904461682, 0.2198338062, 0.0339710973, -0.3773393631, -0.1148495525, -0.3479647338, 0.1886433959, -0.1687083393, 0.3023189306, 0.0322840214, 0.2741391957, 0.2475179732, 0.1615710855, 0.9262685776, -0.0916073471, 0.0714726895, -0.1972738206, -0.0435678214, -0.5894110203, -0.1542813182, -0.0789641887, 0.0270804763, -0.0590395592, 0.5538505912, -0.0631092563, -0.0686066449, -0.2617591321, 0.2991939783, -0.316880703, -0.3877654374, -0.2755343318, -0.2933423519, -0.1356879473, -0.3935817778, 0.019994542, -0.0869561881, 0.0755999535, -0.3193261325, -0.2675707936, -0.1990124434, 0.0541380718, 0.0145461559, 0.3740361631, 0.3435082138, 0.2086752057, -0.086925745, 0.3284698427, 0.3661998808, 0.2595768571, 0.0718757436, 0.0568668842, 0.2052866369, -0.2167996466, 0.0861621797, 0.1083567664, -0.0250590965, -0.2877220213, -0.0670188963, 0.1119902283, -0.2830278277, 0.1024946123, 0.3718266785, -0.1586078256, -0.0864220932, -0.3929764032, 0.3548667431, 0.0121599287, 0.0940142423, 0.036005199, -0.051952336, -0.1494733542, 0.1480955929, 0.2831674218, 0.5525883436, -0.3548776507, 0.3033214509, 0.2974141836, 0.0017679706, 0.0114027672, -0.0265302286, -0.1680652499, -0.1445067227, -0.3122719526, 0.0030846074, -0.1878084838, -0.0254935101, 0.4849463105, 0.1750966609, 0.043912828, 0.2067074776, 0.0071271723, -0.1149759665, 0.5293210149, 0.2995491624, -0.2283004373, 0.0325019099, 0.0639347434, -0.2548328042, -0.1903494596, -0.0622592643, -0.0863793492, -0.0984941199, 0.2215803862, -0.0403396264, -0.2126668543, -0.1238955557, 0.3679513931, -0.1082211211, -0.2316220701, 0.1815725565, 0.0838661268, -0.20102036, 0.196623221, -0.1573188454, 0.1279700249, 0.0030060094, 0.3249217868, 0.1413982511, -0.1144990474, -0.0310454778, -0.0913246125, 0.0234272033, -0.1943866909, 0.1888038814, -0.1482691616, -0.0629261732, 0.0454888716, 0.0297895949, -0.0961101875, -0.6530040503, -0.3431921005, -0.2048238516, 0.4010300934, 0.0805630013, 0.1309612542, 0.2124831825, 0.4965966344, 0.0243890639, -0.3730359972, -0.1403265744, 0.1895270944, 0.2858309746, 0.1799473166, 0.3866919875, -0.1341090798, -0.1365936995, -0.0709895641, 0.6510816813, 0.1012728214, -0.1912544221, -0.0577657782, -0.0403907299, 0.3169393241, 0.0208150037, -0.3343824744, 0.188358143, -0.0939157456, -0.3599130511, -0.2077347934, -0.1373047531, 0.1214710772, -0.1601490378, 0.2943195701, 0.0504381582, -0.1864531785, 0.0016883984, -0.0764313266, -0.2049330175, 0.1969458908, 0.2957783341, 0.0060841385, -0.3328679502, 0.0645706505, -0.0876781121, -0.2682572901, -0.0669380575, -0.1471434385, -0.1714788377, -0.1753692925, 0.096780777, 0.1115375087, 0.1287064552, -0.2801168859, 0.1016184837, -0.3750437796, -0.4788469076, -0.1348807514, 0.1319558918, -0.0679690987, -0.0909876749, 0.1033130884, 0.0220809095, -0.2510060668, 0.0079657063, 0.141607821, 0.0354231745, 0.298848927, 0.189244926, 0.1612938344, 0.1742736101, 0.0425287783, -0.4761441946, 0.0175628811, -0.0588392541, 0.0995731279, 0.1874172539, -0.1962638944, 0.2503471375, 0.2590203881, 0.3225477934, 0.1073598266, -0.4383762479, -0.2273103595, -0.0798546299, 0.1225002632, 0.0510140806, -0.1831585467, 0.1945349425, 0.2868765891, -0.0688324273, 0.3184706867, 0.2352004349, 0.3476956487, -0.4201476872, 0.0468277037, 0.4110741317, 0.0671939254, -0.1297736466, 0.4717314243, -0.2036248446, 0.0523638166, 0.0846017748, 0.2946647704, 0.1201958656, 0.8587025404, 0.1290913522, 0.1891805381, 0.4139887094, -0.0303374827, 0.0068448931, -0.4966720939, -0.0952323973, 0.1984750628, -0.1680760235, 0.274112463, 0.1702122092, -0.3590529561, 0.1909859776, -0.3852769732, -0.2336920202, -0.0620268062, -0.2622533143, 0.1335816681, -0.0030271858, 0.0273249745, 0.1620101333, 0.2371409684, -0.3845198452, -0.3014770448, -0.2461310178, 0.1889076829, -0.2023760676, 0.2124778628, 0.4214306474, 0.0444426015, -0.0315243937, -0.0391091332, 0.3646275103, 0.0986835808, 0.101068154, -0.0881534517, 0.0778101906, 0.1303086877, 0.194221884, 0.186471805, -0.0245691855, 0.229917556, -0.0123418272, -0.0638060868, 0.0230800472, -0.10071145, -0.0150631778, 0.1352043748, 0.0769988298, -0.0195251126, -0.1023718417, 0.4225894511, -0.005135173, -0.4866003394, -0.0333420411, -0.4977215528, -0.0050529987, -0.0514771156, 0.0287459232, -0.4116463661, -0.235376969, 0.5690823197, -0.2013361007, 0.2559472322, 0.0774657652, 0.0456616282, -0.607973814, 0.6227490902, 0.1627822667, 0.0933040977, -0.0685406476, 0.1594239473, -0.5500159264, 0.0303857587, -0.2166629881, -0.1015652791, 0.2339972854, 0.4140377641, -0.0308635868, -0.0486868434, 0.1650851965, 0.0038430355, -0.1916438788, 0.0894424319, -0.2841001749, -0.1390905529, -0.1443408579, 0.1185546815, -0.1753245741, -0.4083870947, 0.3195689917, -0.0093015507, -0.076787971, -0.1066463739, 0.2173394412, -0.1415833086, 0.487829566, 0.4013831615, -0.0483229049, 0.3463920057, 0.0004340708, 0.0175026208, 0.0451892018, 0.1241306514, -0.0279618055, 0.7077245712, 0.0045387689, 0.1401189417, -0.0876322165, 0.0933171287, 0.1183361337, 0.0912864804, -0.0013900548, -0.158374235, -0.1358548403, 0.0508203506, -0.152741313, 0.0265372731, 0.1540858448, 0.1232054681, 0.0315914601, -0.0814921409, -0.0285232514, -0.0700531974, 0.318890214, 0.0257119015, -0.0847273543, 0.0533847101, -0.0156114995, -0.0210559815, -0.0187304858, -0.2966988683, 0.2012094557, 0.4706379771, -0.2481854409, -0.0093804151, 0.3947989345, -0.2101590931, 0.0058913678, -0.0756308064, 0.7668735385, -0.1517629474, -0.3578999043, -0.1258620173, -0.0418123528 ]
https://github.com/huggingface/datasets/issues/2146
Dataset file size on disk is very large with 3D Array
Pyarrow has two types of lists: variable length lists and fixed size lists. Currently we store the ArrayXD data as variable length lists. They take more disk space because they must store both actual data and offsets. In the `datasets` code this is done here: https://github.com/huggingface/nlp/blob/dbac87c8a083f806467f5afc4ec9b401a7e4c15c/src/datasets/features.py#L346-L352 To use a fixed length list, one should use the `list_size` argument of `pyarrow.list_()`. I believe this would work directly modulo some changes in the numpy conversion here: https://github.com/huggingface/nlp/blob/dbac87c8a083f806467f5afc4ec9b401a7e4c15c/src/datasets/features.py#L381-L395
Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help.
75
Dataset file size on disk is very large with 3D Array Hi, I have created my own dataset using the provided dataset loading script. It is an image dataset where images are stored as 3D Array with dtype=uint8. The actual size on disk is surprisingly large. It takes 520 MB. Here is some info from `dataset_info.json`. `{ "description": "", "citation": "", "homepage": "", "license": "", "features": { "image": { "shape": [224, 224, 3], "dtype": "uint8", "id": null, "_type": "Array3D", } }, "post_processed": null, "supervised_keys": null, "builder_name": "shot_type_image_dataset", "config_name": "default", "version": { "version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0, }, "splits": { "train": { "name": "train", "num_bytes": 520803408, "num_examples": 1479, "dataset_name": "shot_type_image_dataset", } }, "download_checksums": { "": { "num_bytes": 16940447118, "checksum": "5854035705efe08b0ed8f3cf3da7b4d29cba9055c2d2d702c79785350d72ee03", } }, "download_size": 16940447118, "post_processing_size": null, "dataset_size": 520803408, "size_in_bytes": 17461250526, }` I have created the same dataset with tensorflow_dataset and it takes only 125MB on disk. I am wondering, is it normal behavior ? I understand `Datasets` uses Arrow for serialization wheres tf uses TF Records. This might be a problem for large dataset. Thanks for your help. Pyarrow has two types of lists: variable length lists and fixed size lists. Currently we store the ArrayXD data as variable length lists. They take more disk space because they must store both actual data and offsets. In the `datasets` code this is done here: https://github.com/huggingface/nlp/blob/dbac87c8a083f806467f5afc4ec9b401a7e4c15c/src/datasets/features.py#L346-L352 To use a fixed length list, one should use the `list_size` argument of `pyarrow.list_()`. I believe this would work directly modulo some changes in the numpy conversion here: https://github.com/huggingface/nlp/blob/dbac87c8a083f806467f5afc4ec9b401a7e4c15c/src/datasets/features.py#L381-L395
[ -0.1452736408, -0.1132631153, -0.154417932, 0.4201559424, 0.2135636806, 0.1139129177, 0.5066813231, 0.2730788291, 0.0205231085, 0.0358477049, -0.1937045157, 0.0874155611, -0.1694586277, 0.3150441051, 0.0677501336, 0.100688152, -0.0745178759, 0.2513983548, -0.133478269, -0.0857201591, -0.009700872, 0.0191180836, -0.0179095119, -0.1838063598, -0.0615616925, -0.1613831371, 0.091349192, -0.0241848789, -0.0830985308, 0.0797271505, 0.2449778765, -0.0880117267, 0.1781993806, 0.5363874435, -0.0001173844, 0.0502765477, 0.1082944721, -0.1655321419, 0.0791867003, 0.2893511057, -0.0925559774, -0.4095059633, -0.0746669844, -0.3576087654, 0.076958403, -0.3249550462, -0.1521174908, -0.1535454094, 0.184890002, 0.0791000724, 0.2110456228, 0.1533053517, -0.0271133035, 0.4150459766, 0.0993780345, 0.5338883996, -0.1533458382, 0.1268557459, -0.143538624, 0.4372020662, 0.0842977464, 0.0795505643, 0.1613585055, 0.2877254188, 0.504050374, -0.0555180982, 0.2392117083, -0.2461921275, 0.129893899, 0.400113076, 0.8583649993, -0.2007376254, -0.1842804104, -0.3255720735, -0.1083303019, -0.0323390402, 0.0225406457, 0.3800633252, -0.0498899892, 0.0219307151, -0.6522023678, -0.1392245889, -0.2269417644, 0.1455016732, -0.2136535645, -0.4809676111, -0.1380902976, 0.1503391564, -0.1890008599, -0.2658364475, 0.2607783675, -0.3955922127, 0.073437497, -0.0997146219, -0.2659655809, -0.210180521, -0.2905138433, -0.3803427517, 0.3530269265, -0.1538061202, -0.0108277649, -0.1519933343, -0.364893347, -0.1477424502, 0.1039847508, 0.3860374987, -0.476847291, -0.1385977864, -0.1418680251, -0.2950902581, -0.0408815816, -0.0522946939, -0.2465379238, -0.0907577872, 0.1986331344, -0.4835402369, 0.0639367104, -0.0618669353, 0.044680886, 0.0238073729, 0.0864813477, -0.0952554718, -0.0751629621, 0.1316527575, 0.1410508454, 0.1352760345, -0.1400614977, -0.0392039046, -0.1859154403, 0.0416381247, -0.1229669601, -0.1046106517, 0.0626311749, -0.0817551613, 0.1144736707, 0.1505685598, 0.0522912145, -0.1904569119, 0.0903885216, 0.200100258, 0.2624741495, -0.3473195732, 0.4073759913, 0.3550085425, 0.1589063406, 0.1983183026, -0.2854206264, 0.1398649216, -0.1997081935, 0.494494766, -0.5467606783, -0.0453602448, -0.4173411131, 0.0906219259, -0.2234345078, -0.054319825, -0.5728364587, 0.009743222, 0.3395531178, -0.1186217144, 0.0678243861, -0.2173455656, -0.3785403371, -0.2943599522, -0.0371543877, 0.0312657617, -0.7563117743, 0.2612311542, -0.1514395773, 0.0817362815, 0.1952205598, 0.595215857, -0.0899516642, 0.4252850413, -0.4255608022, -0.0484713539, 0.0430040173, -0.0383998156, -0.661108017, 0.4873415828, 0.0706718862, 0.0485028401, 0.1124144942, 0.3201818764, 0.1636858582, -0.0163750499, -0.2228290141, 0.326606065, 0.0910480991, 0.042669341, -0.1908330023, -0.3811232448, 0.0882390887, 0.0459807143, -0.1374952048, -0.1405357569, 0.1314448863, 0.0834869966, 0.2107227594, -0.1292203516, 0.0360600501, 0.37058568, 0.2096632719, -0.2556738853, -0.0215889942, 0.1423660517, -0.6317532659, 0.183380872, 0.2472613752, -0.4363890886, 0.1557535678, -0.1044434085, 0.0382063501, -0.2296468019, -0.0895897448, 0.2013012469, 0.0237025842, -0.0005766023, -0.0091963932, -0.0104557797, -0.0085912123, -0.1477527469, 0.1148846969, -0.1881847084, -0.4114226997, 0.3561537564, 0.2135654241, -0.035041891, -0.1056866348, -0.0788612813, -0.3569893539, -0.341083318, -0.1865353584, 0.0800962001, 0.2511082292, 0.1212479025, -0.0773303956, 0.483738035, 0.2234309912, 0.0761170238, 0.3378686309, -0.1210734099, 0.0945777595, -0.220615685, -0.2020521611, 0.2165209055, -0.191824764, 0.0659021214, 0.0202878565, -0.3593145609, 0.2857809067, 0.1333051622, 0.105053544, -0.2576690316, -0.0769442916, 0.192902267, 0.3467417359, 0.2029426992, 0.1076559126, 0.046753481, 0.6398188472, -0.1667220742, 0.1070181876, 0.3645209074, -0.1265420318, -0.0783275738, 0.105871059, 0.2452512383, 0.5257761478, 0.2170312107, 0.0459645912, -0.0413737074, 0.4925530851, -0.1443801075, 0.0811916515, 0.0678964928, 0.5235674381, 0.2810912728, 0.1602382362, 0.0027568564, -0.2844555974, -0.1133064926, 0.2043944001, 0.2465661615, -0.3033528328, 0.1999261975, -0.1631351709, -0.2681360841, -0.0947999656, 0.1902987063, -0.0601119474, 0.1248415262, -0.3277062178, -0.1944485754, 0.0251020715, -0.079767555, 0.1439216882, 0.0847973377, 0.2937847376, -0.0679314658, 0.2701691985, 0.3433183432, -0.0878248811, 0.0354879275, 0.4142908454, -0.1485609412, 0.3000027537, -0.1635023654, 0.2096657455, -0.138071239, -0.2516806722, 0.1204531863, 0.0605553612, 0.0706451461, -0.1095741838, 0.274066329, -0.199559778, 0.2018909752, 0.0286063999, 0.0493996963, -0.2603569925, 0.0002532974, -0.0481880978, -0.1286523193, -0.2174703777, 0.0934466049, -0.2839458585, -0.0509910136, 0.2078642249, 0.1816901863, 0.2575589418, 0.3705636263, 0.1723434627, 0.0412284844, 0.1493279934, -0.0243311264, -0.1940807998, -0.4591633081, 0.145960927, -0.0282913819, -0.3725242615, 0.1432909667, 0.0114656538, 0.1920367926, 0.2045513093, -0.6480359435, -0.039491348, -0.2930948138, 0.0378663987, -0.1762447655, 0.1218835935, 0.0200798046, -0.2159729302, 0.0826532617, -0.0400287211, -0.1227324456, -0.080126375, 0.1514733732, 0.1209951863, 0.127742365, 0.5383255482, 0.2677575946, 0.4104944766, 0.1294863522, -0.3016059697, 0.1248357892, -0.1209922358, 0.370011121, -0.2481319457, 0.0517885834, 0.3423666954, 0.1794078648, -0.2017467171, 0.2401465327, -0.004897831, -0.0705831796, 0.3367038369, 0.028789714, -0.1383412778, 0.023906514, 0.1935493201, -0.0604688674, 0.0104938513, -0.0702694952, -0.0987720713, -0.1590378582, -0.3050753474, -0.0873736665, 0.1904461682, 0.2198338062, 0.0339710973, -0.3773393631, -0.1148495525, -0.3479647338, 0.1886433959, -0.1687083393, 0.3023189306, 0.0322840214, 0.2741391957, 0.2475179732, 0.1615710855, 0.9262685776, -0.0916073471, 0.0714726895, -0.1972738206, -0.0435678214, -0.5894110203, -0.1542813182, -0.0789641887, 0.0270804763, -0.0590395592, 0.5538505912, -0.0631092563, -0.0686066449, -0.2617591321, 0.2991939783, -0.316880703, -0.3877654374, -0.2755343318, -0.2933423519, -0.1356879473, -0.3935817778, 0.019994542, -0.0869561881, 0.0755999535, -0.3193261325, -0.2675707936, -0.1990124434, 0.0541380718, 0.0145461559, 0.3740361631, 0.3435082138, 0.2086752057, -0.086925745, 0.3284698427, 0.3661998808, 0.2595768571, 0.0718757436, 0.0568668842, 0.2052866369, -0.2167996466, 0.0861621797, 0.1083567664, -0.0250590965, -0.2877220213, -0.0670188963, 0.1119902283, -0.2830278277, 0.1024946123, 0.3718266785, -0.1586078256, -0.0864220932, -0.3929764032, 0.3548667431, 0.0121599287, 0.0940142423, 0.036005199, -0.051952336, -0.1494733542, 0.1480955929, 0.2831674218, 0.5525883436, -0.3548776507, 0.3033214509, 0.2974141836, 0.0017679706, 0.0114027672, -0.0265302286, -0.1680652499, -0.1445067227, -0.3122719526, 0.0030846074, -0.1878084838, -0.0254935101, 0.4849463105, 0.1750966609, 0.043912828, 0.2067074776, 0.0071271723, -0.1149759665, 0.5293210149, 0.2995491624, -0.2283004373, 0.0325019099, 0.0639347434, -0.2548328042, -0.1903494596, -0.0622592643, -0.0863793492, -0.0984941199, 0.2215803862, -0.0403396264, -0.2126668543, -0.1238955557, 0.3679513931, -0.1082211211, -0.2316220701, 0.1815725565, 0.0838661268, -0.20102036, 0.196623221, -0.1573188454, 0.1279700249, 0.0030060094, 0.3249217868, 0.1413982511, -0.1144990474, -0.0310454778, -0.0913246125, 0.0234272033, -0.1943866909, 0.1888038814, -0.1482691616, -0.0629261732, 0.0454888716, 0.0297895949, -0.0961101875, -0.6530040503, -0.3431921005, -0.2048238516, 0.4010300934, 0.0805630013, 0.1309612542, 0.2124831825, 0.4965966344, 0.0243890639, -0.3730359972, -0.1403265744, 0.1895270944, 0.2858309746, 0.1799473166, 0.3866919875, -0.1341090798, -0.1365936995, -0.0709895641, 0.6510816813, 0.1012728214, -0.1912544221, -0.0577657782, -0.0403907299, 0.3169393241, 0.0208150037, -0.3343824744, 0.188358143, -0.0939157456, -0.3599130511, -0.2077347934, -0.1373047531, 0.1214710772, -0.1601490378, 0.2943195701, 0.0504381582, -0.1864531785, 0.0016883984, -0.0764313266, -0.2049330175, 0.1969458908, 0.2957783341, 0.0060841385, -0.3328679502, 0.0645706505, -0.0876781121, -0.2682572901, -0.0669380575, -0.1471434385, -0.1714788377, -0.1753692925, 0.096780777, 0.1115375087, 0.1287064552, -0.2801168859, 0.1016184837, -0.3750437796, -0.4788469076, -0.1348807514, 0.1319558918, -0.0679690987, -0.0909876749, 0.1033130884, 0.0220809095, -0.2510060668, 0.0079657063, 0.141607821, 0.0354231745, 0.298848927, 0.189244926, 0.1612938344, 0.1742736101, 0.0425287783, -0.4761441946, 0.0175628811, -0.0588392541, 0.0995731279, 0.1874172539, -0.1962638944, 0.2503471375, 0.2590203881, 0.3225477934, 0.1073598266, -0.4383762479, -0.2273103595, -0.0798546299, 0.1225002632, 0.0510140806, -0.1831585467, 0.1945349425, 0.2868765891, -0.0688324273, 0.3184706867, 0.2352004349, 0.3476956487, -0.4201476872, 0.0468277037, 0.4110741317, 0.0671939254, -0.1297736466, 0.4717314243, -0.2036248446, 0.0523638166, 0.0846017748, 0.2946647704, 0.1201958656, 0.8587025404, 0.1290913522, 0.1891805381, 0.4139887094, -0.0303374827, 0.0068448931, -0.4966720939, -0.0952323973, 0.1984750628, -0.1680760235, 0.274112463, 0.1702122092, -0.3590529561, 0.1909859776, -0.3852769732, -0.2336920202, -0.0620268062, -0.2622533143, 0.1335816681, -0.0030271858, 0.0273249745, 0.1620101333, 0.2371409684, -0.3845198452, -0.3014770448, -0.2461310178, 0.1889076829, -0.2023760676, 0.2124778628, 0.4214306474, 0.0444426015, -0.0315243937, -0.0391091332, 0.3646275103, 0.0986835808, 0.101068154, -0.0881534517, 0.0778101906, 0.1303086877, 0.194221884, 0.186471805, -0.0245691855, 0.229917556, -0.0123418272, -0.0638060868, 0.0230800472, -0.10071145, -0.0150631778, 0.1352043748, 0.0769988298, -0.0195251126, -0.1023718417, 0.4225894511, -0.005135173, -0.4866003394, -0.0333420411, -0.4977215528, -0.0050529987, -0.0514771156, 0.0287459232, -0.4116463661, -0.235376969, 0.5690823197, -0.2013361007, 0.2559472322, 0.0774657652, 0.0456616282, -0.607973814, 0.6227490902, 0.1627822667, 0.0933040977, -0.0685406476, 0.1594239473, -0.5500159264, 0.0303857587, -0.2166629881, -0.1015652791, 0.2339972854, 0.4140377641, -0.0308635868, -0.0486868434, 0.1650851965, 0.0038430355, -0.1916438788, 0.0894424319, -0.2841001749, -0.1390905529, -0.1443408579, 0.1185546815, -0.1753245741, -0.4083870947, 0.3195689917, -0.0093015507, -0.076787971, -0.1066463739, 0.2173394412, -0.1415833086, 0.487829566, 0.4013831615, -0.0483229049, 0.3463920057, 0.0004340708, 0.0175026208, 0.0451892018, 0.1241306514, -0.0279618055, 0.7077245712, 0.0045387689, 0.1401189417, -0.0876322165, 0.0933171287, 0.1183361337, 0.0912864804, -0.0013900548, -0.158374235, -0.1358548403, 0.0508203506, -0.152741313, 0.0265372731, 0.1540858448, 0.1232054681, 0.0315914601, -0.0814921409, -0.0285232514, -0.0700531974, 0.318890214, 0.0257119015, -0.0847273543, 0.0533847101, -0.0156114995, -0.0210559815, -0.0187304858, -0.2966988683, 0.2012094557, 0.4706379771, -0.2481854409, -0.0093804151, 0.3947989345, -0.2101590931, 0.0058913678, -0.0756308064, 0.7668735385, -0.1517629474, -0.3578999043, -0.1258620173, -0.0418123528 ]
https://github.com/huggingface/datasets/issues/2144
Loading wikipedia 20200501.en throws pyarrow related error
That's how I loaded the dataset ```python from datasets import load_dataset ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') ```
**Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0]
17
Loading wikipedia 20200501.en throws pyarrow related error **Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0] That's how I loaded the dataset ```python from datasets import load_dataset ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') ```
[ -0.1041543707, 0.3526461124, 0.0340580381, 0.3633102775, 0.2745777369, 0.1802078336, 0.2762239277, 0.4623253345, -0.04348813, -0.1137841493, 0.0247376859, 0.2360223234, 0.1520678848, -0.1178016216, 0.1841086447, -0.1683139652, 0.0038772561, 0.0068801492, 0.0847922713, 0.1328447759, -0.2001204491, 0.1146742404, -0.1824863106, 0.1555174589, -0.5857796669, 0.0881164968, -0.0660181046, 0.0540416539, 0.0833242461, -0.6138044596, 0.3904816806, -0.0500538908, 0.2010908723, 0.212130636, -0.0001204597, 0.0749959573, 0.4643652439, -0.0041333362, -0.2960134149, -0.0811443627, 0.1865802705, -0.0205052793, 0.318087846, -0.3607695699, 0.1008787602, -0.2803387344, 0.2242593914, 0.0471994504, 0.1832179129, 0.0086326823, 0.1682858169, -0.1830529869, 0.3375391364, 0.0306438729, 0.7112435699, -0.1374691427, 0.0815055594, 0.4424602687, 0.1225972623, -0.1607154906, -0.1864348501, 0.2362977117, -0.2502577901, 0.1203090101, 0.2671834826, -0.0770429969, 0.38487643, -0.2004953772, 0.3921533525, 0.2679578364, 0.7762547731, -0.4092202187, 0.1730330586, -0.2313121557, -0.0328711569, -0.0229594894, 0.0938254297, 0.2307370007, -0.2767689228, 0.0545304492, 0.1571858823, -0.1188706309, -0.2609155178, 0.3013154268, -0.0642479509, 0.1997206807, 0.1399382651, 0.3910686672, 0.0163353682, -0.2268839329, 0.0019353963, 0.0632642806, 0.1672582775, 0.2208642364, -0.3931141198, 0.1072580889, -0.0683026388, 0.1139047146, 0.3778623044, -0.1693618596, -0.021596266, 0.0659418702, 0.2391711026, 0.2064650506, 0.4192268848, 0.1241853461, -0.3237410784, -0.2987225056, 0.2721662223, 0.198899731, -0.2542139888, -0.0364416838, -0.0612123758, -0.1137951463, 0.1385727525, -0.1709841043, 0.4291739464, -0.2699913383, -0.2205794901, 0.1195767969, -0.1446795911, -0.0715673715, -0.1552303135, 0.3867206573, -0.0916787833, 0.2425000072, 0.0672102422, 0.0622377098, -0.1821432412, -0.1878143847, 0.0057539046, 0.1186775565, -0.2124668062, 0.179793328, 0.2939303815, -0.1538042426, 0.258354187, 0.1435221136, -0.1506104171, -0.1206761301, 0.1700642258, 0.0130379125, -0.2326726764, 0.3098335862, 0.0075016022, 0.2468715757, -0.0328951888, -0.1449692249, -0.1790341437, 0.3182585835, -0.2848287523, -0.5152554512, -0.2622499466, 0.1209050715, -0.011662893, 0.0844509006, 0.1616872549, 0.0576541089, 0.4413496554, -0.5136592388, -0.100322932, -0.1257851273, -0.185528636, -0.4527531266, 0.170637399, 0.3363129199, -0.5569392443, 0.0798322931, -0.0507646501, 0.0824037194, 0.2173676938, 0.445002079, -0.2298555523, 0.1757659316, -0.1654863954, 0.1924013346, 0.1095906943, -0.3121574223, -0.541102767, 0.2140134573, -0.0612867624, 0.1959043443, 0.0259576514, 0.2906033099, 0.0093368851, 0.171762079, 0.4052649438, 0.2492505014, -0.0467648506, 0.078792274, -0.4085267782, -0.3879696429, 0.3385636508, 0.201665923, -0.0047452683, -0.1988983303, 0.1968248188, 0.3221476376, 0.258479774, -0.2035796195, 0.128796339, 0.0218389258, 0.0705179498, -0.0129468665, 0.2327661812, -0.2238292992, -0.4262201786, 0.1114463657, -0.3431404531, -0.0235895794, -0.3043863177, -0.3612283766, -0.5231872797, 0.0663696975, -0.1714642495, -0.2400974929, 0.1150503457, -0.06133366, 0.0953499526, 0.2569485605, 0.1027858034, -0.0896758884, -0.2042666674, -0.0175579116, -0.4030894041, 0.2405162156, -0.3087986112, -0.1786496639, -0.0221909061, 0.2451286167, 0.3246087134, 0.1002937853, 0.0431753099, 0.1558434218, 0.1467773467, 0.0931863189, -0.1324366033, -0.017700702, 0.2272261679, -0.2668776214, 0.204007864, 0.1240442246, 0.1868999898, -0.2210173905, 0.0509527475, 0.1322418153, -0.0019998802, 0.1718761325, -0.0822382644, -0.0712245181, 0.1570296586, -0.0034190267, 0.3967844546, -0.1355210245, 0.2599032819, 0.4711594284, 0.0430018008, 0.1037076563, -0.0057751313, 0.0103612356, 0.1143461242, -0.0471604168, 0.1531221569, 0.1461277753, -0.3416617215, -0.2851568758, 0.2188829184, -0.1442351043, 0.0782738924, 0.0937130675, 0.0280693173, 0.1398484111, -0.0689808056, -0.195102945, 0.1316027641, -0.1178802103, 0.4590720534, 0.3100677729, 0.3028900027, -0.0293435082, -0.3765668869, 0.0593947917, 0.0831139609, 0.3793655932, -0.3040894568, 0.0794886649, -0.1713319719, -0.2434594631, -0.0772663206, -0.0130445473, -0.2915110588, -0.3173152506, 0.0815708786, 0.5144314766, 0.0328680426, 0.0099859387, -0.0540030375, -0.0480347872, 0.0796884894, -0.1308912188, -0.0505061448, -0.7057310939, -0.3859116137, 0.0051475428, 0.257486254, -0.1339797378, 0.2502464652, -0.0254034996, -0.1927468926, -0.3766918182, -0.5513481498, -0.003672271, -0.1104059368, 0.3178440332, 0.0176335201, 0.395771265, 0.0727890283, -0.215288341, 0.2103868872, 0.013057977, -0.0248655081, 0.2813798785, -0.3631691337, 0.0844140947, -0.0089283213, -0.2284811437, -0.2832892537, -0.1489336193, 0.1993967593, 0.0630165339, 0.1870311499, 0.2383003384, 0.0628926009, 0.1012384146, 0.2758948505, 0.0676459968, -0.3717183769, -0.1608330458, 0.306096822, -0.2184316218, -0.2773066759, 0.1912305951, 0.0027230829, 0.1241861358, 0.221650973, -0.5899143219, 0.0072058924, 0.0857220739, 0.3271366358, 0.0319637917, -0.146209836, 0.2367206514, 0.0211272947, 0.0012417622, 0.0620592013, 0.0056531951, -0.120623365, -0.1537073404, 0.1662415862, 0.1140276641, 0.2094679624, 0.1647177637, 0.783613503, 0.0867719203, 0.0424957313, 0.4263213873, -0.1883070618, 0.0635276437, -0.1462814212, -0.0966462046, 0.0314846113, -0.3452986777, -0.2316505164, 0.1231541708, -0.1210032851, -0.3868953288, -0.0544539951, -0.2450860441, -0.2544878423, -0.2394924462, 0.044574365, -0.0382834151, 0.3793731332, 0.1044161022, -0.1685189158, -0.1514849365, -0.4424998164, -0.0287860688, 0.146330893, -0.0292477719, -0.0367808156, -0.1005665436, -0.2029286623, -0.5161780119, 0.4155933857, 0.285954386, 0.1105866209, -0.1718754768, 0.0878228918, 0.447886318, -0.1853179485, 0.6596495509, -0.1708531231, 0.0438122228, 0.0984819084, 0.1837500632, -0.7251462936, -0.0194136426, 0.1475443244, 0.1342762709, 0.2153127491, -0.1166660041, -0.5139328837, 0.0979647711, 0.3440999091, 0.3732792139, -0.0886277482, -0.1792945713, -0.1912721246, -0.3767271936, -0.5138627291, -0.164923504, -0.2111013532, 0.2683065534, -0.0255609937, 0.0310489014, 0.0503849462, 0.2014782727, -0.0147321112, 0.2821471691, 0.2859054208, 0.0165018737, 0.0235097632, 0.0959306508, 0.0991038829, 0.347071588, 0.3539324701, 0.288197279, -0.0423729159, -0.0889985636, 0.0853010118, -0.063820146, 0.1812104881, -0.150287196, 0.0666162521, -0.0016666111, -0.1978691369, -0.0734469295, -0.1572472006, 0.3747443855, -0.2212857008, -0.298209399, -0.238981694, 0.7085087895, 0.1589902788, -0.0960438922, 0.1231105626, -0.1088687479, -0.1373425871, 0.3652407229, 0.1177064627, 0.9276628494, -0.1522068679, 0.3289299607, 0.3286550045, -0.039698232, 0.5044326186, -0.2825067043, 0.1339880228, -0.4844108522, 0.2856453359, -0.0108887553, -0.0980819985, -0.1546723992, 0.0310812015, -0.1827831864, 0.0733062029, -0.2207053304, 0.0885882676, 0.0106325783, 0.3567407727, -0.0083512925, 0.1106860638, -0.0842743963, 0.0562638715, -0.3195543289, 0.2571132183, -0.261523217, -0.0009586066, 0.0979613811, -0.1563698649, -0.4544543028, 0.0785482526, -0.1875041574, 0.4533360302, -0.3069444895, -0.3188784122, 0.017606698, 0.059825398, -0.0411648974, -0.0937835649, -0.3611283004, 0.1809429228, -0.2230478525, -0.1647402942, -0.1060879976, 0.0703287944, 0.2264247537, -0.0705450922, -0.4650465846, 0.3104068637, -0.0331907868, -0.2690660954, -0.1951660961, 0.0056176819, 0.0766636878, -0.1938509941, -0.1571665853, -0.2530137002, -0.1191876531, -0.1358083189, 0.0734142065, -0.1295600384, 0.0084921271, 0.064658761, 0.068564266, -0.3869738877, 0.1155599803, 0.4719055593, 0.3767464161, 0.1686644405, 0.6754419804, 0.2683517337, -0.266392678, -0.013629999, -0.3504727781, -0.361133635, -0.3933808804, -0.0750967786, 0.1329663694, 0.4606645703, -0.2361183017, 0.1057870984, 0.1565126479, -0.1004550532, 0.1289461106, -0.4669054449, -0.2856479287, 0.345882833, -0.1558522284, 0.2150659114, 0.3333625793, 0.1371679306, 0.0941933021, 0.2817736566, -0.2074544877, 0.4754824936, -0.0808617994, 0.3691471219, 0.1022730172, -0.1045175344, -0.1664326191, 0.0043668598, 0.0278087705, 0.0733079761, -0.0842073858, -0.1873687208, -0.05974067, 0.1769646704, 0.0595370121, -0.2068471611, -0.122133024, -0.4088257253, 0.0580773987, -0.0109869558, 0.3590633869, 0.1042840108, -0.0777886808, 0.1733736247, 0.1805440187, 0.1427161992, -0.2289882004, 0.3619517088, -0.1334507465, 0.3957296014, 0.2669550478, 0.2385378033, -0.0947240219, -0.0126238018, -0.2449374199, 0.0805035084, 0.1154415682, -0.1886788458, 0.1852279902, -0.2776902616, -0.2030886859, -0.021379143, 0.0164038315, 0.3396819532, -0.1417617202, -0.0548672974, -0.0608211681, 0.1005866528, -0.2835870981, 0.0460617319, 0.4852419198, -0.1776812673, -0.2785927653, 0.0687628165, 0.5847010612, -0.043893069, 0.1663224697, 0.0466528311, 0.2393531501, 0.0115821473, 0.0854457617, 0.2219159454, 0.1098193526, -0.1377398819, 0.0567909405, 0.272084862, 0.1866965592, 0.4535921812, -0.1657374203, 0.0975394994, -0.1927060932, 0.0472141989, -0.1411456019, -0.3601850867, 0.1597555876, 0.4120804667, 0.1318733096, 0.0065877857, 0.0914898217, 0.371322602, 0.6368658543, 0.0102783926, -0.0483850539, 0.3622555733, -0.148677811, -0.180416882, -0.2978948057, -0.3707219064, 0.0285330117, 0.150821045, -0.2404497564, -0.2233100235, 0.2616768479, 0.1858804524, -0.3208233714, -0.6472075582, 0.5188279152, 0.283164084, 0.1351264417, -0.222577244, 0.2115806639, 0.1248403937, -0.0737037361, 0.1012161076, 0.289465785, 0.6575106978, 0.3211215436, -0.7122468352, 0.0241686217, -0.1587848961, 0.0964296982, -0.0956942737, -0.0255601853, 0.1547430009, -0.0726359338, 0.2175969332, 0.0557837002, -0.0313377567, -0.1637457609, 0.4401108921, 0.0479711257, -0.2145296335, -0.2602034807, -0.1867543757, -0.2116840631, 0.0047942176, 0.0889468938, -0.3720790148, 0.224848032, 0.4339291453, 0.0074969195, 0.1416676044, -0.0861910582, 0.0382656604, -0.2804439664, 0.4323860407, 0.242212832, 0.1094456762, -0.4453441799, -0.2630243599, -0.6950750947, 0.3619221449, -0.4275679886, -0.0046957806, 0.3281987011, 0.1819257587, -0.2007465959, 0.1665136367, 0.0720968693, -0.1435966343, -0.185102582, 0.3347551823, -0.2243231535, -0.1052200049, -0.12880373, -0.2936486304, -0.2516880929, -0.323635757, 0.2147365808, -0.1949798167, -0.04772323, -0.2938643098, -0.1443581581, 0.1363734603, 0.1835704148, 0.5083593726, 0.085528776, 0.6090763211, 0.0791575164, -0.030969914, -0.2001251876, -0.1561917812, 0.1780347079, 0.2961328626, 0.0426095575, 0.1194768697, -0.0950099006, -0.1640059501, -0.1698604673, 0.5059784651, -0.0187874734, 0.0761009455, -0.0015461221, -0.2256750464, 0.0126301944, 0.3037435412, -0.1414276063, 0.1818355024, -0.069385007, 0.312479198, -0.2922702432, -0.4456367791, 0.4373094738, -0.4284294844, -0.3710168898, 0.0440441296, 0.1237265766, -0.1983822882, -0.1003206745, -0.3580919504, 0.145456329, 0.4109819531, -0.0160897281, -0.1379523724, -0.1122564971, -0.0849026293, -0.1042081714, -0.2067105621, 0.0315534137, 0.0420016833, -0.1544651687, -0.3315708041, -0.5234954357 ]
https://github.com/huggingface/datasets/issues/2144
Loading wikipedia 20200501.en throws pyarrow related error
Hi ! It looks like the arrow file in the folder `/usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931` is corrupted. Can you take a look and check that it's 18.3GB ? If not, then maybe you need to redownload it: ```python from datasets import load_dataset ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache', download_mode="force_redownload") ```
**Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0]
46
Loading wikipedia 20200501.en throws pyarrow related error **Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0] Hi ! It looks like the arrow file in the folder `/usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931` is corrupted. Can you take a look and check that it's 18.3GB ? If not, then maybe you need to redownload it: ```python from datasets import load_dataset ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache', download_mode="force_redownload") ```
[ -0.1041543707, 0.3526461124, 0.0340580381, 0.3633102775, 0.2745777369, 0.1802078336, 0.2762239277, 0.4623253345, -0.04348813, -0.1137841493, 0.0247376859, 0.2360223234, 0.1520678848, -0.1178016216, 0.1841086447, -0.1683139652, 0.0038772561, 0.0068801492, 0.0847922713, 0.1328447759, -0.2001204491, 0.1146742404, -0.1824863106, 0.1555174589, -0.5857796669, 0.0881164968, -0.0660181046, 0.0540416539, 0.0833242461, -0.6138044596, 0.3904816806, -0.0500538908, 0.2010908723, 0.212130636, -0.0001204597, 0.0749959573, 0.4643652439, -0.0041333362, -0.2960134149, -0.0811443627, 0.1865802705, -0.0205052793, 0.318087846, -0.3607695699, 0.1008787602, -0.2803387344, 0.2242593914, 0.0471994504, 0.1832179129, 0.0086326823, 0.1682858169, -0.1830529869, 0.3375391364, 0.0306438729, 0.7112435699, -0.1374691427, 0.0815055594, 0.4424602687, 0.1225972623, -0.1607154906, -0.1864348501, 0.2362977117, -0.2502577901, 0.1203090101, 0.2671834826, -0.0770429969, 0.38487643, -0.2004953772, 0.3921533525, 0.2679578364, 0.7762547731, -0.4092202187, 0.1730330586, -0.2313121557, -0.0328711569, -0.0229594894, 0.0938254297, 0.2307370007, -0.2767689228, 0.0545304492, 0.1571858823, -0.1188706309, -0.2609155178, 0.3013154268, -0.0642479509, 0.1997206807, 0.1399382651, 0.3910686672, 0.0163353682, -0.2268839329, 0.0019353963, 0.0632642806, 0.1672582775, 0.2208642364, -0.3931141198, 0.1072580889, -0.0683026388, 0.1139047146, 0.3778623044, -0.1693618596, -0.021596266, 0.0659418702, 0.2391711026, 0.2064650506, 0.4192268848, 0.1241853461, -0.3237410784, -0.2987225056, 0.2721662223, 0.198899731, -0.2542139888, -0.0364416838, -0.0612123758, -0.1137951463, 0.1385727525, -0.1709841043, 0.4291739464, -0.2699913383, -0.2205794901, 0.1195767969, -0.1446795911, -0.0715673715, -0.1552303135, 0.3867206573, -0.0916787833, 0.2425000072, 0.0672102422, 0.0622377098, -0.1821432412, -0.1878143847, 0.0057539046, 0.1186775565, -0.2124668062, 0.179793328, 0.2939303815, -0.1538042426, 0.258354187, 0.1435221136, -0.1506104171, -0.1206761301, 0.1700642258, 0.0130379125, -0.2326726764, 0.3098335862, 0.0075016022, 0.2468715757, -0.0328951888, -0.1449692249, -0.1790341437, 0.3182585835, -0.2848287523, -0.5152554512, -0.2622499466, 0.1209050715, -0.011662893, 0.0844509006, 0.1616872549, 0.0576541089, 0.4413496554, -0.5136592388, -0.100322932, -0.1257851273, -0.185528636, -0.4527531266, 0.170637399, 0.3363129199, -0.5569392443, 0.0798322931, -0.0507646501, 0.0824037194, 0.2173676938, 0.445002079, -0.2298555523, 0.1757659316, -0.1654863954, 0.1924013346, 0.1095906943, -0.3121574223, -0.541102767, 0.2140134573, -0.0612867624, 0.1959043443, 0.0259576514, 0.2906033099, 0.0093368851, 0.171762079, 0.4052649438, 0.2492505014, -0.0467648506, 0.078792274, -0.4085267782, -0.3879696429, 0.3385636508, 0.201665923, -0.0047452683, -0.1988983303, 0.1968248188, 0.3221476376, 0.258479774, -0.2035796195, 0.128796339, 0.0218389258, 0.0705179498, -0.0129468665, 0.2327661812, -0.2238292992, -0.4262201786, 0.1114463657, -0.3431404531, -0.0235895794, -0.3043863177, -0.3612283766, -0.5231872797, 0.0663696975, -0.1714642495, -0.2400974929, 0.1150503457, -0.06133366, 0.0953499526, 0.2569485605, 0.1027858034, -0.0896758884, -0.2042666674, -0.0175579116, -0.4030894041, 0.2405162156, -0.3087986112, -0.1786496639, -0.0221909061, 0.2451286167, 0.3246087134, 0.1002937853, 0.0431753099, 0.1558434218, 0.1467773467, 0.0931863189, -0.1324366033, -0.017700702, 0.2272261679, -0.2668776214, 0.204007864, 0.1240442246, 0.1868999898, -0.2210173905, 0.0509527475, 0.1322418153, -0.0019998802, 0.1718761325, -0.0822382644, -0.0712245181, 0.1570296586, -0.0034190267, 0.3967844546, -0.1355210245, 0.2599032819, 0.4711594284, 0.0430018008, 0.1037076563, -0.0057751313, 0.0103612356, 0.1143461242, -0.0471604168, 0.1531221569, 0.1461277753, -0.3416617215, -0.2851568758, 0.2188829184, -0.1442351043, 0.0782738924, 0.0937130675, 0.0280693173, 0.1398484111, -0.0689808056, -0.195102945, 0.1316027641, -0.1178802103, 0.4590720534, 0.3100677729, 0.3028900027, -0.0293435082, -0.3765668869, 0.0593947917, 0.0831139609, 0.3793655932, -0.3040894568, 0.0794886649, -0.1713319719, -0.2434594631, -0.0772663206, -0.0130445473, -0.2915110588, -0.3173152506, 0.0815708786, 0.5144314766, 0.0328680426, 0.0099859387, -0.0540030375, -0.0480347872, 0.0796884894, -0.1308912188, -0.0505061448, -0.7057310939, -0.3859116137, 0.0051475428, 0.257486254, -0.1339797378, 0.2502464652, -0.0254034996, -0.1927468926, -0.3766918182, -0.5513481498, -0.003672271, -0.1104059368, 0.3178440332, 0.0176335201, 0.395771265, 0.0727890283, -0.215288341, 0.2103868872, 0.013057977, -0.0248655081, 0.2813798785, -0.3631691337, 0.0844140947, -0.0089283213, -0.2284811437, -0.2832892537, -0.1489336193, 0.1993967593, 0.0630165339, 0.1870311499, 0.2383003384, 0.0628926009, 0.1012384146, 0.2758948505, 0.0676459968, -0.3717183769, -0.1608330458, 0.306096822, -0.2184316218, -0.2773066759, 0.1912305951, 0.0027230829, 0.1241861358, 0.221650973, -0.5899143219, 0.0072058924, 0.0857220739, 0.3271366358, 0.0319637917, -0.146209836, 0.2367206514, 0.0211272947, 0.0012417622, 0.0620592013, 0.0056531951, -0.120623365, -0.1537073404, 0.1662415862, 0.1140276641, 0.2094679624, 0.1647177637, 0.783613503, 0.0867719203, 0.0424957313, 0.4263213873, -0.1883070618, 0.0635276437, -0.1462814212, -0.0966462046, 0.0314846113, -0.3452986777, -0.2316505164, 0.1231541708, -0.1210032851, -0.3868953288, -0.0544539951, -0.2450860441, -0.2544878423, -0.2394924462, 0.044574365, -0.0382834151, 0.3793731332, 0.1044161022, -0.1685189158, -0.1514849365, -0.4424998164, -0.0287860688, 0.146330893, -0.0292477719, -0.0367808156, -0.1005665436, -0.2029286623, -0.5161780119, 0.4155933857, 0.285954386, 0.1105866209, -0.1718754768, 0.0878228918, 0.447886318, -0.1853179485, 0.6596495509, -0.1708531231, 0.0438122228, 0.0984819084, 0.1837500632, -0.7251462936, -0.0194136426, 0.1475443244, 0.1342762709, 0.2153127491, -0.1166660041, -0.5139328837, 0.0979647711, 0.3440999091, 0.3732792139, -0.0886277482, -0.1792945713, -0.1912721246, -0.3767271936, -0.5138627291, -0.164923504, -0.2111013532, 0.2683065534, -0.0255609937, 0.0310489014, 0.0503849462, 0.2014782727, -0.0147321112, 0.2821471691, 0.2859054208, 0.0165018737, 0.0235097632, 0.0959306508, 0.0991038829, 0.347071588, 0.3539324701, 0.288197279, -0.0423729159, -0.0889985636, 0.0853010118, -0.063820146, 0.1812104881, -0.150287196, 0.0666162521, -0.0016666111, -0.1978691369, -0.0734469295, -0.1572472006, 0.3747443855, -0.2212857008, -0.298209399, -0.238981694, 0.7085087895, 0.1589902788, -0.0960438922, 0.1231105626, -0.1088687479, -0.1373425871, 0.3652407229, 0.1177064627, 0.9276628494, -0.1522068679, 0.3289299607, 0.3286550045, -0.039698232, 0.5044326186, -0.2825067043, 0.1339880228, -0.4844108522, 0.2856453359, -0.0108887553, -0.0980819985, -0.1546723992, 0.0310812015, -0.1827831864, 0.0733062029, -0.2207053304, 0.0885882676, 0.0106325783, 0.3567407727, -0.0083512925, 0.1106860638, -0.0842743963, 0.0562638715, -0.3195543289, 0.2571132183, -0.261523217, -0.0009586066, 0.0979613811, -0.1563698649, -0.4544543028, 0.0785482526, -0.1875041574, 0.4533360302, -0.3069444895, -0.3188784122, 0.017606698, 0.059825398, -0.0411648974, -0.0937835649, -0.3611283004, 0.1809429228, -0.2230478525, -0.1647402942, -0.1060879976, 0.0703287944, 0.2264247537, -0.0705450922, -0.4650465846, 0.3104068637, -0.0331907868, -0.2690660954, -0.1951660961, 0.0056176819, 0.0766636878, -0.1938509941, -0.1571665853, -0.2530137002, -0.1191876531, -0.1358083189, 0.0734142065, -0.1295600384, 0.0084921271, 0.064658761, 0.068564266, -0.3869738877, 0.1155599803, 0.4719055593, 0.3767464161, 0.1686644405, 0.6754419804, 0.2683517337, -0.266392678, -0.013629999, -0.3504727781, -0.361133635, -0.3933808804, -0.0750967786, 0.1329663694, 0.4606645703, -0.2361183017, 0.1057870984, 0.1565126479, -0.1004550532, 0.1289461106, -0.4669054449, -0.2856479287, 0.345882833, -0.1558522284, 0.2150659114, 0.3333625793, 0.1371679306, 0.0941933021, 0.2817736566, -0.2074544877, 0.4754824936, -0.0808617994, 0.3691471219, 0.1022730172, -0.1045175344, -0.1664326191, 0.0043668598, 0.0278087705, 0.0733079761, -0.0842073858, -0.1873687208, -0.05974067, 0.1769646704, 0.0595370121, -0.2068471611, -0.122133024, -0.4088257253, 0.0580773987, -0.0109869558, 0.3590633869, 0.1042840108, -0.0777886808, 0.1733736247, 0.1805440187, 0.1427161992, -0.2289882004, 0.3619517088, -0.1334507465, 0.3957296014, 0.2669550478, 0.2385378033, -0.0947240219, -0.0126238018, -0.2449374199, 0.0805035084, 0.1154415682, -0.1886788458, 0.1852279902, -0.2776902616, -0.2030886859, -0.021379143, 0.0164038315, 0.3396819532, -0.1417617202, -0.0548672974, -0.0608211681, 0.1005866528, -0.2835870981, 0.0460617319, 0.4852419198, -0.1776812673, -0.2785927653, 0.0687628165, 0.5847010612, -0.043893069, 0.1663224697, 0.0466528311, 0.2393531501, 0.0115821473, 0.0854457617, 0.2219159454, 0.1098193526, -0.1377398819, 0.0567909405, 0.272084862, 0.1866965592, 0.4535921812, -0.1657374203, 0.0975394994, -0.1927060932, 0.0472141989, -0.1411456019, -0.3601850867, 0.1597555876, 0.4120804667, 0.1318733096, 0.0065877857, 0.0914898217, 0.371322602, 0.6368658543, 0.0102783926, -0.0483850539, 0.3622555733, -0.148677811, -0.180416882, -0.2978948057, -0.3707219064, 0.0285330117, 0.150821045, -0.2404497564, -0.2233100235, 0.2616768479, 0.1858804524, -0.3208233714, -0.6472075582, 0.5188279152, 0.283164084, 0.1351264417, -0.222577244, 0.2115806639, 0.1248403937, -0.0737037361, 0.1012161076, 0.289465785, 0.6575106978, 0.3211215436, -0.7122468352, 0.0241686217, -0.1587848961, 0.0964296982, -0.0956942737, -0.0255601853, 0.1547430009, -0.0726359338, 0.2175969332, 0.0557837002, -0.0313377567, -0.1637457609, 0.4401108921, 0.0479711257, -0.2145296335, -0.2602034807, -0.1867543757, -0.2116840631, 0.0047942176, 0.0889468938, -0.3720790148, 0.224848032, 0.4339291453, 0.0074969195, 0.1416676044, -0.0861910582, 0.0382656604, -0.2804439664, 0.4323860407, 0.242212832, 0.1094456762, -0.4453441799, -0.2630243599, -0.6950750947, 0.3619221449, -0.4275679886, -0.0046957806, 0.3281987011, 0.1819257587, -0.2007465959, 0.1665136367, 0.0720968693, -0.1435966343, -0.185102582, 0.3347551823, -0.2243231535, -0.1052200049, -0.12880373, -0.2936486304, -0.2516880929, -0.323635757, 0.2147365808, -0.1949798167, -0.04772323, -0.2938643098, -0.1443581581, 0.1363734603, 0.1835704148, 0.5083593726, 0.085528776, 0.6090763211, 0.0791575164, -0.030969914, -0.2001251876, -0.1561917812, 0.1780347079, 0.2961328626, 0.0426095575, 0.1194768697, -0.0950099006, -0.1640059501, -0.1698604673, 0.5059784651, -0.0187874734, 0.0761009455, -0.0015461221, -0.2256750464, 0.0126301944, 0.3037435412, -0.1414276063, 0.1818355024, -0.069385007, 0.312479198, -0.2922702432, -0.4456367791, 0.4373094738, -0.4284294844, -0.3710168898, 0.0440441296, 0.1237265766, -0.1983822882, -0.1003206745, -0.3580919504, 0.145456329, 0.4109819531, -0.0160897281, -0.1379523724, -0.1122564971, -0.0849026293, -0.1042081714, -0.2067105621, 0.0315534137, 0.0420016833, -0.1544651687, -0.3315708041, -0.5234954357 ]
https://github.com/huggingface/datasets/issues/2144
Loading wikipedia 20200501.en throws pyarrow related error
> Hi ! It looks like the arrow file in the folder > `/usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931` is corrupted. > > Can you take a look and check that it's 18.3GB ? > > If not, then maybe you need to redownload it: > > ```python > from datasets import load_dataset > ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache', download_mode="force_redownload") > ``` Hi Ihoestq, thanks for the reply! Actually i think my issue is i couldn't download the dataset beyond 10.7G. It feels like the whole dataset is split into different volumes and after the first one was downloaded it crashed before proceeding to the next one. I did try 'force_redownload' mode but still got the same issue.
**Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0]
113
Loading wikipedia 20200501.en throws pyarrow related error **Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0] > Hi ! It looks like the arrow file in the folder > `/usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931` is corrupted. > > Can you take a look and check that it's 18.3GB ? > > If not, then maybe you need to redownload it: > > ```python > from datasets import load_dataset > ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache', download_mode="force_redownload") > ``` Hi Ihoestq, thanks for the reply! Actually i think my issue is i couldn't download the dataset beyond 10.7G. It feels like the whole dataset is split into different volumes and after the first one was downloaded it crashed before proceeding to the next one. I did try 'force_redownload' mode but still got the same issue.
[ -0.1041543707, 0.3526461124, 0.0340580381, 0.3633102775, 0.2745777369, 0.1802078336, 0.2762239277, 0.4623253345, -0.04348813, -0.1137841493, 0.0247376859, 0.2360223234, 0.1520678848, -0.1178016216, 0.1841086447, -0.1683139652, 0.0038772561, 0.0068801492, 0.0847922713, 0.1328447759, -0.2001204491, 0.1146742404, -0.1824863106, 0.1555174589, -0.5857796669, 0.0881164968, -0.0660181046, 0.0540416539, 0.0833242461, -0.6138044596, 0.3904816806, -0.0500538908, 0.2010908723, 0.212130636, -0.0001204597, 0.0749959573, 0.4643652439, -0.0041333362, -0.2960134149, -0.0811443627, 0.1865802705, -0.0205052793, 0.318087846, -0.3607695699, 0.1008787602, -0.2803387344, 0.2242593914, 0.0471994504, 0.1832179129, 0.0086326823, 0.1682858169, -0.1830529869, 0.3375391364, 0.0306438729, 0.7112435699, -0.1374691427, 0.0815055594, 0.4424602687, 0.1225972623, -0.1607154906, -0.1864348501, 0.2362977117, -0.2502577901, 0.1203090101, 0.2671834826, -0.0770429969, 0.38487643, -0.2004953772, 0.3921533525, 0.2679578364, 0.7762547731, -0.4092202187, 0.1730330586, -0.2313121557, -0.0328711569, -0.0229594894, 0.0938254297, 0.2307370007, -0.2767689228, 0.0545304492, 0.1571858823, -0.1188706309, -0.2609155178, 0.3013154268, -0.0642479509, 0.1997206807, 0.1399382651, 0.3910686672, 0.0163353682, -0.2268839329, 0.0019353963, 0.0632642806, 0.1672582775, 0.2208642364, -0.3931141198, 0.1072580889, -0.0683026388, 0.1139047146, 0.3778623044, -0.1693618596, -0.021596266, 0.0659418702, 0.2391711026, 0.2064650506, 0.4192268848, 0.1241853461, -0.3237410784, -0.2987225056, 0.2721662223, 0.198899731, -0.2542139888, -0.0364416838, -0.0612123758, -0.1137951463, 0.1385727525, -0.1709841043, 0.4291739464, -0.2699913383, -0.2205794901, 0.1195767969, -0.1446795911, -0.0715673715, -0.1552303135, 0.3867206573, -0.0916787833, 0.2425000072, 0.0672102422, 0.0622377098, -0.1821432412, -0.1878143847, 0.0057539046, 0.1186775565, -0.2124668062, 0.179793328, 0.2939303815, -0.1538042426, 0.258354187, 0.1435221136, -0.1506104171, -0.1206761301, 0.1700642258, 0.0130379125, -0.2326726764, 0.3098335862, 0.0075016022, 0.2468715757, -0.0328951888, -0.1449692249, -0.1790341437, 0.3182585835, -0.2848287523, -0.5152554512, -0.2622499466, 0.1209050715, -0.011662893, 0.0844509006, 0.1616872549, 0.0576541089, 0.4413496554, -0.5136592388, -0.100322932, -0.1257851273, -0.185528636, -0.4527531266, 0.170637399, 0.3363129199, -0.5569392443, 0.0798322931, -0.0507646501, 0.0824037194, 0.2173676938, 0.445002079, -0.2298555523, 0.1757659316, -0.1654863954, 0.1924013346, 0.1095906943, -0.3121574223, -0.541102767, 0.2140134573, -0.0612867624, 0.1959043443, 0.0259576514, 0.2906033099, 0.0093368851, 0.171762079, 0.4052649438, 0.2492505014, -0.0467648506, 0.078792274, -0.4085267782, -0.3879696429, 0.3385636508, 0.201665923, -0.0047452683, -0.1988983303, 0.1968248188, 0.3221476376, 0.258479774, -0.2035796195, 0.128796339, 0.0218389258, 0.0705179498, -0.0129468665, 0.2327661812, -0.2238292992, -0.4262201786, 0.1114463657, -0.3431404531, -0.0235895794, -0.3043863177, -0.3612283766, -0.5231872797, 0.0663696975, -0.1714642495, -0.2400974929, 0.1150503457, -0.06133366, 0.0953499526, 0.2569485605, 0.1027858034, -0.0896758884, -0.2042666674, -0.0175579116, -0.4030894041, 0.2405162156, -0.3087986112, -0.1786496639, -0.0221909061, 0.2451286167, 0.3246087134, 0.1002937853, 0.0431753099, 0.1558434218, 0.1467773467, 0.0931863189, -0.1324366033, -0.017700702, 0.2272261679, -0.2668776214, 0.204007864, 0.1240442246, 0.1868999898, -0.2210173905, 0.0509527475, 0.1322418153, -0.0019998802, 0.1718761325, -0.0822382644, -0.0712245181, 0.1570296586, -0.0034190267, 0.3967844546, -0.1355210245, 0.2599032819, 0.4711594284, 0.0430018008, 0.1037076563, -0.0057751313, 0.0103612356, 0.1143461242, -0.0471604168, 0.1531221569, 0.1461277753, -0.3416617215, -0.2851568758, 0.2188829184, -0.1442351043, 0.0782738924, 0.0937130675, 0.0280693173, 0.1398484111, -0.0689808056, -0.195102945, 0.1316027641, -0.1178802103, 0.4590720534, 0.3100677729, 0.3028900027, -0.0293435082, -0.3765668869, 0.0593947917, 0.0831139609, 0.3793655932, -0.3040894568, 0.0794886649, -0.1713319719, -0.2434594631, -0.0772663206, -0.0130445473, -0.2915110588, -0.3173152506, 0.0815708786, 0.5144314766, 0.0328680426, 0.0099859387, -0.0540030375, -0.0480347872, 0.0796884894, -0.1308912188, -0.0505061448, -0.7057310939, -0.3859116137, 0.0051475428, 0.257486254, -0.1339797378, 0.2502464652, -0.0254034996, -0.1927468926, -0.3766918182, -0.5513481498, -0.003672271, -0.1104059368, 0.3178440332, 0.0176335201, 0.395771265, 0.0727890283, -0.215288341, 0.2103868872, 0.013057977, -0.0248655081, 0.2813798785, -0.3631691337, 0.0844140947, -0.0089283213, -0.2284811437, -0.2832892537, -0.1489336193, 0.1993967593, 0.0630165339, 0.1870311499, 0.2383003384, 0.0628926009, 0.1012384146, 0.2758948505, 0.0676459968, -0.3717183769, -0.1608330458, 0.306096822, -0.2184316218, -0.2773066759, 0.1912305951, 0.0027230829, 0.1241861358, 0.221650973, -0.5899143219, 0.0072058924, 0.0857220739, 0.3271366358, 0.0319637917, -0.146209836, 0.2367206514, 0.0211272947, 0.0012417622, 0.0620592013, 0.0056531951, -0.120623365, -0.1537073404, 0.1662415862, 0.1140276641, 0.2094679624, 0.1647177637, 0.783613503, 0.0867719203, 0.0424957313, 0.4263213873, -0.1883070618, 0.0635276437, -0.1462814212, -0.0966462046, 0.0314846113, -0.3452986777, -0.2316505164, 0.1231541708, -0.1210032851, -0.3868953288, -0.0544539951, -0.2450860441, -0.2544878423, -0.2394924462, 0.044574365, -0.0382834151, 0.3793731332, 0.1044161022, -0.1685189158, -0.1514849365, -0.4424998164, -0.0287860688, 0.146330893, -0.0292477719, -0.0367808156, -0.1005665436, -0.2029286623, -0.5161780119, 0.4155933857, 0.285954386, 0.1105866209, -0.1718754768, 0.0878228918, 0.447886318, -0.1853179485, 0.6596495509, -0.1708531231, 0.0438122228, 0.0984819084, 0.1837500632, -0.7251462936, -0.0194136426, 0.1475443244, 0.1342762709, 0.2153127491, -0.1166660041, -0.5139328837, 0.0979647711, 0.3440999091, 0.3732792139, -0.0886277482, -0.1792945713, -0.1912721246, -0.3767271936, -0.5138627291, -0.164923504, -0.2111013532, 0.2683065534, -0.0255609937, 0.0310489014, 0.0503849462, 0.2014782727, -0.0147321112, 0.2821471691, 0.2859054208, 0.0165018737, 0.0235097632, 0.0959306508, 0.0991038829, 0.347071588, 0.3539324701, 0.288197279, -0.0423729159, -0.0889985636, 0.0853010118, -0.063820146, 0.1812104881, -0.150287196, 0.0666162521, -0.0016666111, -0.1978691369, -0.0734469295, -0.1572472006, 0.3747443855, -0.2212857008, -0.298209399, -0.238981694, 0.7085087895, 0.1589902788, -0.0960438922, 0.1231105626, -0.1088687479, -0.1373425871, 0.3652407229, 0.1177064627, 0.9276628494, -0.1522068679, 0.3289299607, 0.3286550045, -0.039698232, 0.5044326186, -0.2825067043, 0.1339880228, -0.4844108522, 0.2856453359, -0.0108887553, -0.0980819985, -0.1546723992, 0.0310812015, -0.1827831864, 0.0733062029, -0.2207053304, 0.0885882676, 0.0106325783, 0.3567407727, -0.0083512925, 0.1106860638, -0.0842743963, 0.0562638715, -0.3195543289, 0.2571132183, -0.261523217, -0.0009586066, 0.0979613811, -0.1563698649, -0.4544543028, 0.0785482526, -0.1875041574, 0.4533360302, -0.3069444895, -0.3188784122, 0.017606698, 0.059825398, -0.0411648974, -0.0937835649, -0.3611283004, 0.1809429228, -0.2230478525, -0.1647402942, -0.1060879976, 0.0703287944, 0.2264247537, -0.0705450922, -0.4650465846, 0.3104068637, -0.0331907868, -0.2690660954, -0.1951660961, 0.0056176819, 0.0766636878, -0.1938509941, -0.1571665853, -0.2530137002, -0.1191876531, -0.1358083189, 0.0734142065, -0.1295600384, 0.0084921271, 0.064658761, 0.068564266, -0.3869738877, 0.1155599803, 0.4719055593, 0.3767464161, 0.1686644405, 0.6754419804, 0.2683517337, -0.266392678, -0.013629999, -0.3504727781, -0.361133635, -0.3933808804, -0.0750967786, 0.1329663694, 0.4606645703, -0.2361183017, 0.1057870984, 0.1565126479, -0.1004550532, 0.1289461106, -0.4669054449, -0.2856479287, 0.345882833, -0.1558522284, 0.2150659114, 0.3333625793, 0.1371679306, 0.0941933021, 0.2817736566, -0.2074544877, 0.4754824936, -0.0808617994, 0.3691471219, 0.1022730172, -0.1045175344, -0.1664326191, 0.0043668598, 0.0278087705, 0.0733079761, -0.0842073858, -0.1873687208, -0.05974067, 0.1769646704, 0.0595370121, -0.2068471611, -0.122133024, -0.4088257253, 0.0580773987, -0.0109869558, 0.3590633869, 0.1042840108, -0.0777886808, 0.1733736247, 0.1805440187, 0.1427161992, -0.2289882004, 0.3619517088, -0.1334507465, 0.3957296014, 0.2669550478, 0.2385378033, -0.0947240219, -0.0126238018, -0.2449374199, 0.0805035084, 0.1154415682, -0.1886788458, 0.1852279902, -0.2776902616, -0.2030886859, -0.021379143, 0.0164038315, 0.3396819532, -0.1417617202, -0.0548672974, -0.0608211681, 0.1005866528, -0.2835870981, 0.0460617319, 0.4852419198, -0.1776812673, -0.2785927653, 0.0687628165, 0.5847010612, -0.043893069, 0.1663224697, 0.0466528311, 0.2393531501, 0.0115821473, 0.0854457617, 0.2219159454, 0.1098193526, -0.1377398819, 0.0567909405, 0.272084862, 0.1866965592, 0.4535921812, -0.1657374203, 0.0975394994, -0.1927060932, 0.0472141989, -0.1411456019, -0.3601850867, 0.1597555876, 0.4120804667, 0.1318733096, 0.0065877857, 0.0914898217, 0.371322602, 0.6368658543, 0.0102783926, -0.0483850539, 0.3622555733, -0.148677811, -0.180416882, -0.2978948057, -0.3707219064, 0.0285330117, 0.150821045, -0.2404497564, -0.2233100235, 0.2616768479, 0.1858804524, -0.3208233714, -0.6472075582, 0.5188279152, 0.283164084, 0.1351264417, -0.222577244, 0.2115806639, 0.1248403937, -0.0737037361, 0.1012161076, 0.289465785, 0.6575106978, 0.3211215436, -0.7122468352, 0.0241686217, -0.1587848961, 0.0964296982, -0.0956942737, -0.0255601853, 0.1547430009, -0.0726359338, 0.2175969332, 0.0557837002, -0.0313377567, -0.1637457609, 0.4401108921, 0.0479711257, -0.2145296335, -0.2602034807, -0.1867543757, -0.2116840631, 0.0047942176, 0.0889468938, -0.3720790148, 0.224848032, 0.4339291453, 0.0074969195, 0.1416676044, -0.0861910582, 0.0382656604, -0.2804439664, 0.4323860407, 0.242212832, 0.1094456762, -0.4453441799, -0.2630243599, -0.6950750947, 0.3619221449, -0.4275679886, -0.0046957806, 0.3281987011, 0.1819257587, -0.2007465959, 0.1665136367, 0.0720968693, -0.1435966343, -0.185102582, 0.3347551823, -0.2243231535, -0.1052200049, -0.12880373, -0.2936486304, -0.2516880929, -0.323635757, 0.2147365808, -0.1949798167, -0.04772323, -0.2938643098, -0.1443581581, 0.1363734603, 0.1835704148, 0.5083593726, 0.085528776, 0.6090763211, 0.0791575164, -0.030969914, -0.2001251876, -0.1561917812, 0.1780347079, 0.2961328626, 0.0426095575, 0.1194768697, -0.0950099006, -0.1640059501, -0.1698604673, 0.5059784651, -0.0187874734, 0.0761009455, -0.0015461221, -0.2256750464, 0.0126301944, 0.3037435412, -0.1414276063, 0.1818355024, -0.069385007, 0.312479198, -0.2922702432, -0.4456367791, 0.4373094738, -0.4284294844, -0.3710168898, 0.0440441296, 0.1237265766, -0.1983822882, -0.1003206745, -0.3580919504, 0.145456329, 0.4109819531, -0.0160897281, -0.1379523724, -0.1122564971, -0.0849026293, -0.1042081714, -0.2067105621, 0.0315534137, 0.0420016833, -0.1544651687, -0.3315708041, -0.5234954357 ]
https://github.com/huggingface/datasets/issues/2144
Loading wikipedia 20200501.en throws pyarrow related error
I just tried on my side and got no issues. When downloading the dataset again, did it crash at 10.7GB as well ?
**Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0]
23
Loading wikipedia 20200501.en throws pyarrow related error **Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0] I just tried on my side and got no issues. When downloading the dataset again, did it crash at 10.7GB as well ?
[ -0.1041543707, 0.3526461124, 0.0340580381, 0.3633102775, 0.2745777369, 0.1802078336, 0.2762239277, 0.4623253345, -0.04348813, -0.1137841493, 0.0247376859, 0.2360223234, 0.1520678848, -0.1178016216, 0.1841086447, -0.1683139652, 0.0038772561, 0.0068801492, 0.0847922713, 0.1328447759, -0.2001204491, 0.1146742404, -0.1824863106, 0.1555174589, -0.5857796669, 0.0881164968, -0.0660181046, 0.0540416539, 0.0833242461, -0.6138044596, 0.3904816806, -0.0500538908, 0.2010908723, 0.212130636, -0.0001204597, 0.0749959573, 0.4643652439, -0.0041333362, -0.2960134149, -0.0811443627, 0.1865802705, -0.0205052793, 0.318087846, -0.3607695699, 0.1008787602, -0.2803387344, 0.2242593914, 0.0471994504, 0.1832179129, 0.0086326823, 0.1682858169, -0.1830529869, 0.3375391364, 0.0306438729, 0.7112435699, -0.1374691427, 0.0815055594, 0.4424602687, 0.1225972623, -0.1607154906, -0.1864348501, 0.2362977117, -0.2502577901, 0.1203090101, 0.2671834826, -0.0770429969, 0.38487643, -0.2004953772, 0.3921533525, 0.2679578364, 0.7762547731, -0.4092202187, 0.1730330586, -0.2313121557, -0.0328711569, -0.0229594894, 0.0938254297, 0.2307370007, -0.2767689228, 0.0545304492, 0.1571858823, -0.1188706309, -0.2609155178, 0.3013154268, -0.0642479509, 0.1997206807, 0.1399382651, 0.3910686672, 0.0163353682, -0.2268839329, 0.0019353963, 0.0632642806, 0.1672582775, 0.2208642364, -0.3931141198, 0.1072580889, -0.0683026388, 0.1139047146, 0.3778623044, -0.1693618596, -0.021596266, 0.0659418702, 0.2391711026, 0.2064650506, 0.4192268848, 0.1241853461, -0.3237410784, -0.2987225056, 0.2721662223, 0.198899731, -0.2542139888, -0.0364416838, -0.0612123758, -0.1137951463, 0.1385727525, -0.1709841043, 0.4291739464, -0.2699913383, -0.2205794901, 0.1195767969, -0.1446795911, -0.0715673715, -0.1552303135, 0.3867206573, -0.0916787833, 0.2425000072, 0.0672102422, 0.0622377098, -0.1821432412, -0.1878143847, 0.0057539046, 0.1186775565, -0.2124668062, 0.179793328, 0.2939303815, -0.1538042426, 0.258354187, 0.1435221136, -0.1506104171, -0.1206761301, 0.1700642258, 0.0130379125, -0.2326726764, 0.3098335862, 0.0075016022, 0.2468715757, -0.0328951888, -0.1449692249, -0.1790341437, 0.3182585835, -0.2848287523, -0.5152554512, -0.2622499466, 0.1209050715, -0.011662893, 0.0844509006, 0.1616872549, 0.0576541089, 0.4413496554, -0.5136592388, -0.100322932, -0.1257851273, -0.185528636, -0.4527531266, 0.170637399, 0.3363129199, -0.5569392443, 0.0798322931, -0.0507646501, 0.0824037194, 0.2173676938, 0.445002079, -0.2298555523, 0.1757659316, -0.1654863954, 0.1924013346, 0.1095906943, -0.3121574223, -0.541102767, 0.2140134573, -0.0612867624, 0.1959043443, 0.0259576514, 0.2906033099, 0.0093368851, 0.171762079, 0.4052649438, 0.2492505014, -0.0467648506, 0.078792274, -0.4085267782, -0.3879696429, 0.3385636508, 0.201665923, -0.0047452683, -0.1988983303, 0.1968248188, 0.3221476376, 0.258479774, -0.2035796195, 0.128796339, 0.0218389258, 0.0705179498, -0.0129468665, 0.2327661812, -0.2238292992, -0.4262201786, 0.1114463657, -0.3431404531, -0.0235895794, -0.3043863177, -0.3612283766, -0.5231872797, 0.0663696975, -0.1714642495, -0.2400974929, 0.1150503457, -0.06133366, 0.0953499526, 0.2569485605, 0.1027858034, -0.0896758884, -0.2042666674, -0.0175579116, -0.4030894041, 0.2405162156, -0.3087986112, -0.1786496639, -0.0221909061, 0.2451286167, 0.3246087134, 0.1002937853, 0.0431753099, 0.1558434218, 0.1467773467, 0.0931863189, -0.1324366033, -0.017700702, 0.2272261679, -0.2668776214, 0.204007864, 0.1240442246, 0.1868999898, -0.2210173905, 0.0509527475, 0.1322418153, -0.0019998802, 0.1718761325, -0.0822382644, -0.0712245181, 0.1570296586, -0.0034190267, 0.3967844546, -0.1355210245, 0.2599032819, 0.4711594284, 0.0430018008, 0.1037076563, -0.0057751313, 0.0103612356, 0.1143461242, -0.0471604168, 0.1531221569, 0.1461277753, -0.3416617215, -0.2851568758, 0.2188829184, -0.1442351043, 0.0782738924, 0.0937130675, 0.0280693173, 0.1398484111, -0.0689808056, -0.195102945, 0.1316027641, -0.1178802103, 0.4590720534, 0.3100677729, 0.3028900027, -0.0293435082, -0.3765668869, 0.0593947917, 0.0831139609, 0.3793655932, -0.3040894568, 0.0794886649, -0.1713319719, -0.2434594631, -0.0772663206, -0.0130445473, -0.2915110588, -0.3173152506, 0.0815708786, 0.5144314766, 0.0328680426, 0.0099859387, -0.0540030375, -0.0480347872, 0.0796884894, -0.1308912188, -0.0505061448, -0.7057310939, -0.3859116137, 0.0051475428, 0.257486254, -0.1339797378, 0.2502464652, -0.0254034996, -0.1927468926, -0.3766918182, -0.5513481498, -0.003672271, -0.1104059368, 0.3178440332, 0.0176335201, 0.395771265, 0.0727890283, -0.215288341, 0.2103868872, 0.013057977, -0.0248655081, 0.2813798785, -0.3631691337, 0.0844140947, -0.0089283213, -0.2284811437, -0.2832892537, -0.1489336193, 0.1993967593, 0.0630165339, 0.1870311499, 0.2383003384, 0.0628926009, 0.1012384146, 0.2758948505, 0.0676459968, -0.3717183769, -0.1608330458, 0.306096822, -0.2184316218, -0.2773066759, 0.1912305951, 0.0027230829, 0.1241861358, 0.221650973, -0.5899143219, 0.0072058924, 0.0857220739, 0.3271366358, 0.0319637917, -0.146209836, 0.2367206514, 0.0211272947, 0.0012417622, 0.0620592013, 0.0056531951, -0.120623365, -0.1537073404, 0.1662415862, 0.1140276641, 0.2094679624, 0.1647177637, 0.783613503, 0.0867719203, 0.0424957313, 0.4263213873, -0.1883070618, 0.0635276437, -0.1462814212, -0.0966462046, 0.0314846113, -0.3452986777, -0.2316505164, 0.1231541708, -0.1210032851, -0.3868953288, -0.0544539951, -0.2450860441, -0.2544878423, -0.2394924462, 0.044574365, -0.0382834151, 0.3793731332, 0.1044161022, -0.1685189158, -0.1514849365, -0.4424998164, -0.0287860688, 0.146330893, -0.0292477719, -0.0367808156, -0.1005665436, -0.2029286623, -0.5161780119, 0.4155933857, 0.285954386, 0.1105866209, -0.1718754768, 0.0878228918, 0.447886318, -0.1853179485, 0.6596495509, -0.1708531231, 0.0438122228, 0.0984819084, 0.1837500632, -0.7251462936, -0.0194136426, 0.1475443244, 0.1342762709, 0.2153127491, -0.1166660041, -0.5139328837, 0.0979647711, 0.3440999091, 0.3732792139, -0.0886277482, -0.1792945713, -0.1912721246, -0.3767271936, -0.5138627291, -0.164923504, -0.2111013532, 0.2683065534, -0.0255609937, 0.0310489014, 0.0503849462, 0.2014782727, -0.0147321112, 0.2821471691, 0.2859054208, 0.0165018737, 0.0235097632, 0.0959306508, 0.0991038829, 0.347071588, 0.3539324701, 0.288197279, -0.0423729159, -0.0889985636, 0.0853010118, -0.063820146, 0.1812104881, -0.150287196, 0.0666162521, -0.0016666111, -0.1978691369, -0.0734469295, -0.1572472006, 0.3747443855, -0.2212857008, -0.298209399, -0.238981694, 0.7085087895, 0.1589902788, -0.0960438922, 0.1231105626, -0.1088687479, -0.1373425871, 0.3652407229, 0.1177064627, 0.9276628494, -0.1522068679, 0.3289299607, 0.3286550045, -0.039698232, 0.5044326186, -0.2825067043, 0.1339880228, -0.4844108522, 0.2856453359, -0.0108887553, -0.0980819985, -0.1546723992, 0.0310812015, -0.1827831864, 0.0733062029, -0.2207053304, 0.0885882676, 0.0106325783, 0.3567407727, -0.0083512925, 0.1106860638, -0.0842743963, 0.0562638715, -0.3195543289, 0.2571132183, -0.261523217, -0.0009586066, 0.0979613811, -0.1563698649, -0.4544543028, 0.0785482526, -0.1875041574, 0.4533360302, -0.3069444895, -0.3188784122, 0.017606698, 0.059825398, -0.0411648974, -0.0937835649, -0.3611283004, 0.1809429228, -0.2230478525, -0.1647402942, -0.1060879976, 0.0703287944, 0.2264247537, -0.0705450922, -0.4650465846, 0.3104068637, -0.0331907868, -0.2690660954, -0.1951660961, 0.0056176819, 0.0766636878, -0.1938509941, -0.1571665853, -0.2530137002, -0.1191876531, -0.1358083189, 0.0734142065, -0.1295600384, 0.0084921271, 0.064658761, 0.068564266, -0.3869738877, 0.1155599803, 0.4719055593, 0.3767464161, 0.1686644405, 0.6754419804, 0.2683517337, -0.266392678, -0.013629999, -0.3504727781, -0.361133635, -0.3933808804, -0.0750967786, 0.1329663694, 0.4606645703, -0.2361183017, 0.1057870984, 0.1565126479, -0.1004550532, 0.1289461106, -0.4669054449, -0.2856479287, 0.345882833, -0.1558522284, 0.2150659114, 0.3333625793, 0.1371679306, 0.0941933021, 0.2817736566, -0.2074544877, 0.4754824936, -0.0808617994, 0.3691471219, 0.1022730172, -0.1045175344, -0.1664326191, 0.0043668598, 0.0278087705, 0.0733079761, -0.0842073858, -0.1873687208, -0.05974067, 0.1769646704, 0.0595370121, -0.2068471611, -0.122133024, -0.4088257253, 0.0580773987, -0.0109869558, 0.3590633869, 0.1042840108, -0.0777886808, 0.1733736247, 0.1805440187, 0.1427161992, -0.2289882004, 0.3619517088, -0.1334507465, 0.3957296014, 0.2669550478, 0.2385378033, -0.0947240219, -0.0126238018, -0.2449374199, 0.0805035084, 0.1154415682, -0.1886788458, 0.1852279902, -0.2776902616, -0.2030886859, -0.021379143, 0.0164038315, 0.3396819532, -0.1417617202, -0.0548672974, -0.0608211681, 0.1005866528, -0.2835870981, 0.0460617319, 0.4852419198, -0.1776812673, -0.2785927653, 0.0687628165, 0.5847010612, -0.043893069, 0.1663224697, 0.0466528311, 0.2393531501, 0.0115821473, 0.0854457617, 0.2219159454, 0.1098193526, -0.1377398819, 0.0567909405, 0.272084862, 0.1866965592, 0.4535921812, -0.1657374203, 0.0975394994, -0.1927060932, 0.0472141989, -0.1411456019, -0.3601850867, 0.1597555876, 0.4120804667, 0.1318733096, 0.0065877857, 0.0914898217, 0.371322602, 0.6368658543, 0.0102783926, -0.0483850539, 0.3622555733, -0.148677811, -0.180416882, -0.2978948057, -0.3707219064, 0.0285330117, 0.150821045, -0.2404497564, -0.2233100235, 0.2616768479, 0.1858804524, -0.3208233714, -0.6472075582, 0.5188279152, 0.283164084, 0.1351264417, -0.222577244, 0.2115806639, 0.1248403937, -0.0737037361, 0.1012161076, 0.289465785, 0.6575106978, 0.3211215436, -0.7122468352, 0.0241686217, -0.1587848961, 0.0964296982, -0.0956942737, -0.0255601853, 0.1547430009, -0.0726359338, 0.2175969332, 0.0557837002, -0.0313377567, -0.1637457609, 0.4401108921, 0.0479711257, -0.2145296335, -0.2602034807, -0.1867543757, -0.2116840631, 0.0047942176, 0.0889468938, -0.3720790148, 0.224848032, 0.4339291453, 0.0074969195, 0.1416676044, -0.0861910582, 0.0382656604, -0.2804439664, 0.4323860407, 0.242212832, 0.1094456762, -0.4453441799, -0.2630243599, -0.6950750947, 0.3619221449, -0.4275679886, -0.0046957806, 0.3281987011, 0.1819257587, -0.2007465959, 0.1665136367, 0.0720968693, -0.1435966343, -0.185102582, 0.3347551823, -0.2243231535, -0.1052200049, -0.12880373, -0.2936486304, -0.2516880929, -0.323635757, 0.2147365808, -0.1949798167, -0.04772323, -0.2938643098, -0.1443581581, 0.1363734603, 0.1835704148, 0.5083593726, 0.085528776, 0.6090763211, 0.0791575164, -0.030969914, -0.2001251876, -0.1561917812, 0.1780347079, 0.2961328626, 0.0426095575, 0.1194768697, -0.0950099006, -0.1640059501, -0.1698604673, 0.5059784651, -0.0187874734, 0.0761009455, -0.0015461221, -0.2256750464, 0.0126301944, 0.3037435412, -0.1414276063, 0.1818355024, -0.069385007, 0.312479198, -0.2922702432, -0.4456367791, 0.4373094738, -0.4284294844, -0.3710168898, 0.0440441296, 0.1237265766, -0.1983822882, -0.1003206745, -0.3580919504, 0.145456329, 0.4109819531, -0.0160897281, -0.1379523724, -0.1122564971, -0.0849026293, -0.1042081714, -0.2067105621, 0.0315534137, 0.0420016833, -0.1544651687, -0.3315708041, -0.5234954357 ]
https://github.com/huggingface/datasets/issues/2144
Loading wikipedia 20200501.en throws pyarrow related error
> I just tried on my side and got no issues. > When downloading the dataset again, did it crash at 10.7GB as well ? Yes i have tried it multiple times on different machines. I am wondering if you could share the screenshot of your dependency versions and i will try to make them the same as yours?
**Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0]
59
Loading wikipedia 20200501.en throws pyarrow related error **Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0] > I just tried on my side and got no issues. > When downloading the dataset again, did it crash at 10.7GB as well ? Yes i have tried it multiple times on different machines. I am wondering if you could share the screenshot of your dependency versions and i will try to make them the same as yours?
[ -0.1041543707, 0.3526461124, 0.0340580381, 0.3633102775, 0.2745777369, 0.1802078336, 0.2762239277, 0.4623253345, -0.04348813, -0.1137841493, 0.0247376859, 0.2360223234, 0.1520678848, -0.1178016216, 0.1841086447, -0.1683139652, 0.0038772561, 0.0068801492, 0.0847922713, 0.1328447759, -0.2001204491, 0.1146742404, -0.1824863106, 0.1555174589, -0.5857796669, 0.0881164968, -0.0660181046, 0.0540416539, 0.0833242461, -0.6138044596, 0.3904816806, -0.0500538908, 0.2010908723, 0.212130636, -0.0001204597, 0.0749959573, 0.4643652439, -0.0041333362, -0.2960134149, -0.0811443627, 0.1865802705, -0.0205052793, 0.318087846, -0.3607695699, 0.1008787602, -0.2803387344, 0.2242593914, 0.0471994504, 0.1832179129, 0.0086326823, 0.1682858169, -0.1830529869, 0.3375391364, 0.0306438729, 0.7112435699, -0.1374691427, 0.0815055594, 0.4424602687, 0.1225972623, -0.1607154906, -0.1864348501, 0.2362977117, -0.2502577901, 0.1203090101, 0.2671834826, -0.0770429969, 0.38487643, -0.2004953772, 0.3921533525, 0.2679578364, 0.7762547731, -0.4092202187, 0.1730330586, -0.2313121557, -0.0328711569, -0.0229594894, 0.0938254297, 0.2307370007, -0.2767689228, 0.0545304492, 0.1571858823, -0.1188706309, -0.2609155178, 0.3013154268, -0.0642479509, 0.1997206807, 0.1399382651, 0.3910686672, 0.0163353682, -0.2268839329, 0.0019353963, 0.0632642806, 0.1672582775, 0.2208642364, -0.3931141198, 0.1072580889, -0.0683026388, 0.1139047146, 0.3778623044, -0.1693618596, -0.021596266, 0.0659418702, 0.2391711026, 0.2064650506, 0.4192268848, 0.1241853461, -0.3237410784, -0.2987225056, 0.2721662223, 0.198899731, -0.2542139888, -0.0364416838, -0.0612123758, -0.1137951463, 0.1385727525, -0.1709841043, 0.4291739464, -0.2699913383, -0.2205794901, 0.1195767969, -0.1446795911, -0.0715673715, -0.1552303135, 0.3867206573, -0.0916787833, 0.2425000072, 0.0672102422, 0.0622377098, -0.1821432412, -0.1878143847, 0.0057539046, 0.1186775565, -0.2124668062, 0.179793328, 0.2939303815, -0.1538042426, 0.258354187, 0.1435221136, -0.1506104171, -0.1206761301, 0.1700642258, 0.0130379125, -0.2326726764, 0.3098335862, 0.0075016022, 0.2468715757, -0.0328951888, -0.1449692249, -0.1790341437, 0.3182585835, -0.2848287523, -0.5152554512, -0.2622499466, 0.1209050715, -0.011662893, 0.0844509006, 0.1616872549, 0.0576541089, 0.4413496554, -0.5136592388, -0.100322932, -0.1257851273, -0.185528636, -0.4527531266, 0.170637399, 0.3363129199, -0.5569392443, 0.0798322931, -0.0507646501, 0.0824037194, 0.2173676938, 0.445002079, -0.2298555523, 0.1757659316, -0.1654863954, 0.1924013346, 0.1095906943, -0.3121574223, -0.541102767, 0.2140134573, -0.0612867624, 0.1959043443, 0.0259576514, 0.2906033099, 0.0093368851, 0.171762079, 0.4052649438, 0.2492505014, -0.0467648506, 0.078792274, -0.4085267782, -0.3879696429, 0.3385636508, 0.201665923, -0.0047452683, -0.1988983303, 0.1968248188, 0.3221476376, 0.258479774, -0.2035796195, 0.128796339, 0.0218389258, 0.0705179498, -0.0129468665, 0.2327661812, -0.2238292992, -0.4262201786, 0.1114463657, -0.3431404531, -0.0235895794, -0.3043863177, -0.3612283766, -0.5231872797, 0.0663696975, -0.1714642495, -0.2400974929, 0.1150503457, -0.06133366, 0.0953499526, 0.2569485605, 0.1027858034, -0.0896758884, -0.2042666674, -0.0175579116, -0.4030894041, 0.2405162156, -0.3087986112, -0.1786496639, -0.0221909061, 0.2451286167, 0.3246087134, 0.1002937853, 0.0431753099, 0.1558434218, 0.1467773467, 0.0931863189, -0.1324366033, -0.017700702, 0.2272261679, -0.2668776214, 0.204007864, 0.1240442246, 0.1868999898, -0.2210173905, 0.0509527475, 0.1322418153, -0.0019998802, 0.1718761325, -0.0822382644, -0.0712245181, 0.1570296586, -0.0034190267, 0.3967844546, -0.1355210245, 0.2599032819, 0.4711594284, 0.0430018008, 0.1037076563, -0.0057751313, 0.0103612356, 0.1143461242, -0.0471604168, 0.1531221569, 0.1461277753, -0.3416617215, -0.2851568758, 0.2188829184, -0.1442351043, 0.0782738924, 0.0937130675, 0.0280693173, 0.1398484111, -0.0689808056, -0.195102945, 0.1316027641, -0.1178802103, 0.4590720534, 0.3100677729, 0.3028900027, -0.0293435082, -0.3765668869, 0.0593947917, 0.0831139609, 0.3793655932, -0.3040894568, 0.0794886649, -0.1713319719, -0.2434594631, -0.0772663206, -0.0130445473, -0.2915110588, -0.3173152506, 0.0815708786, 0.5144314766, 0.0328680426, 0.0099859387, -0.0540030375, -0.0480347872, 0.0796884894, -0.1308912188, -0.0505061448, -0.7057310939, -0.3859116137, 0.0051475428, 0.257486254, -0.1339797378, 0.2502464652, -0.0254034996, -0.1927468926, -0.3766918182, -0.5513481498, -0.003672271, -0.1104059368, 0.3178440332, 0.0176335201, 0.395771265, 0.0727890283, -0.215288341, 0.2103868872, 0.013057977, -0.0248655081, 0.2813798785, -0.3631691337, 0.0844140947, -0.0089283213, -0.2284811437, -0.2832892537, -0.1489336193, 0.1993967593, 0.0630165339, 0.1870311499, 0.2383003384, 0.0628926009, 0.1012384146, 0.2758948505, 0.0676459968, -0.3717183769, -0.1608330458, 0.306096822, -0.2184316218, -0.2773066759, 0.1912305951, 0.0027230829, 0.1241861358, 0.221650973, -0.5899143219, 0.0072058924, 0.0857220739, 0.3271366358, 0.0319637917, -0.146209836, 0.2367206514, 0.0211272947, 0.0012417622, 0.0620592013, 0.0056531951, -0.120623365, -0.1537073404, 0.1662415862, 0.1140276641, 0.2094679624, 0.1647177637, 0.783613503, 0.0867719203, 0.0424957313, 0.4263213873, -0.1883070618, 0.0635276437, -0.1462814212, -0.0966462046, 0.0314846113, -0.3452986777, -0.2316505164, 0.1231541708, -0.1210032851, -0.3868953288, -0.0544539951, -0.2450860441, -0.2544878423, -0.2394924462, 0.044574365, -0.0382834151, 0.3793731332, 0.1044161022, -0.1685189158, -0.1514849365, -0.4424998164, -0.0287860688, 0.146330893, -0.0292477719, -0.0367808156, -0.1005665436, -0.2029286623, -0.5161780119, 0.4155933857, 0.285954386, 0.1105866209, -0.1718754768, 0.0878228918, 0.447886318, -0.1853179485, 0.6596495509, -0.1708531231, 0.0438122228, 0.0984819084, 0.1837500632, -0.7251462936, -0.0194136426, 0.1475443244, 0.1342762709, 0.2153127491, -0.1166660041, -0.5139328837, 0.0979647711, 0.3440999091, 0.3732792139, -0.0886277482, -0.1792945713, -0.1912721246, -0.3767271936, -0.5138627291, -0.164923504, -0.2111013532, 0.2683065534, -0.0255609937, 0.0310489014, 0.0503849462, 0.2014782727, -0.0147321112, 0.2821471691, 0.2859054208, 0.0165018737, 0.0235097632, 0.0959306508, 0.0991038829, 0.347071588, 0.3539324701, 0.288197279, -0.0423729159, -0.0889985636, 0.0853010118, -0.063820146, 0.1812104881, -0.150287196, 0.0666162521, -0.0016666111, -0.1978691369, -0.0734469295, -0.1572472006, 0.3747443855, -0.2212857008, -0.298209399, -0.238981694, 0.7085087895, 0.1589902788, -0.0960438922, 0.1231105626, -0.1088687479, -0.1373425871, 0.3652407229, 0.1177064627, 0.9276628494, -0.1522068679, 0.3289299607, 0.3286550045, -0.039698232, 0.5044326186, -0.2825067043, 0.1339880228, -0.4844108522, 0.2856453359, -0.0108887553, -0.0980819985, -0.1546723992, 0.0310812015, -0.1827831864, 0.0733062029, -0.2207053304, 0.0885882676, 0.0106325783, 0.3567407727, -0.0083512925, 0.1106860638, -0.0842743963, 0.0562638715, -0.3195543289, 0.2571132183, -0.261523217, -0.0009586066, 0.0979613811, -0.1563698649, -0.4544543028, 0.0785482526, -0.1875041574, 0.4533360302, -0.3069444895, -0.3188784122, 0.017606698, 0.059825398, -0.0411648974, -0.0937835649, -0.3611283004, 0.1809429228, -0.2230478525, -0.1647402942, -0.1060879976, 0.0703287944, 0.2264247537, -0.0705450922, -0.4650465846, 0.3104068637, -0.0331907868, -0.2690660954, -0.1951660961, 0.0056176819, 0.0766636878, -0.1938509941, -0.1571665853, -0.2530137002, -0.1191876531, -0.1358083189, 0.0734142065, -0.1295600384, 0.0084921271, 0.064658761, 0.068564266, -0.3869738877, 0.1155599803, 0.4719055593, 0.3767464161, 0.1686644405, 0.6754419804, 0.2683517337, -0.266392678, -0.013629999, -0.3504727781, -0.361133635, -0.3933808804, -0.0750967786, 0.1329663694, 0.4606645703, -0.2361183017, 0.1057870984, 0.1565126479, -0.1004550532, 0.1289461106, -0.4669054449, -0.2856479287, 0.345882833, -0.1558522284, 0.2150659114, 0.3333625793, 0.1371679306, 0.0941933021, 0.2817736566, -0.2074544877, 0.4754824936, -0.0808617994, 0.3691471219, 0.1022730172, -0.1045175344, -0.1664326191, 0.0043668598, 0.0278087705, 0.0733079761, -0.0842073858, -0.1873687208, -0.05974067, 0.1769646704, 0.0595370121, -0.2068471611, -0.122133024, -0.4088257253, 0.0580773987, -0.0109869558, 0.3590633869, 0.1042840108, -0.0777886808, 0.1733736247, 0.1805440187, 0.1427161992, -0.2289882004, 0.3619517088, -0.1334507465, 0.3957296014, 0.2669550478, 0.2385378033, -0.0947240219, -0.0126238018, -0.2449374199, 0.0805035084, 0.1154415682, -0.1886788458, 0.1852279902, -0.2776902616, -0.2030886859, -0.021379143, 0.0164038315, 0.3396819532, -0.1417617202, -0.0548672974, -0.0608211681, 0.1005866528, -0.2835870981, 0.0460617319, 0.4852419198, -0.1776812673, -0.2785927653, 0.0687628165, 0.5847010612, -0.043893069, 0.1663224697, 0.0466528311, 0.2393531501, 0.0115821473, 0.0854457617, 0.2219159454, 0.1098193526, -0.1377398819, 0.0567909405, 0.272084862, 0.1866965592, 0.4535921812, -0.1657374203, 0.0975394994, -0.1927060932, 0.0472141989, -0.1411456019, -0.3601850867, 0.1597555876, 0.4120804667, 0.1318733096, 0.0065877857, 0.0914898217, 0.371322602, 0.6368658543, 0.0102783926, -0.0483850539, 0.3622555733, -0.148677811, -0.180416882, -0.2978948057, -0.3707219064, 0.0285330117, 0.150821045, -0.2404497564, -0.2233100235, 0.2616768479, 0.1858804524, -0.3208233714, -0.6472075582, 0.5188279152, 0.283164084, 0.1351264417, -0.222577244, 0.2115806639, 0.1248403937, -0.0737037361, 0.1012161076, 0.289465785, 0.6575106978, 0.3211215436, -0.7122468352, 0.0241686217, -0.1587848961, 0.0964296982, -0.0956942737, -0.0255601853, 0.1547430009, -0.0726359338, 0.2175969332, 0.0557837002, -0.0313377567, -0.1637457609, 0.4401108921, 0.0479711257, -0.2145296335, -0.2602034807, -0.1867543757, -0.2116840631, 0.0047942176, 0.0889468938, -0.3720790148, 0.224848032, 0.4339291453, 0.0074969195, 0.1416676044, -0.0861910582, 0.0382656604, -0.2804439664, 0.4323860407, 0.242212832, 0.1094456762, -0.4453441799, -0.2630243599, -0.6950750947, 0.3619221449, -0.4275679886, -0.0046957806, 0.3281987011, 0.1819257587, -0.2007465959, 0.1665136367, 0.0720968693, -0.1435966343, -0.185102582, 0.3347551823, -0.2243231535, -0.1052200049, -0.12880373, -0.2936486304, -0.2516880929, -0.323635757, 0.2147365808, -0.1949798167, -0.04772323, -0.2938643098, -0.1443581581, 0.1363734603, 0.1835704148, 0.5083593726, 0.085528776, 0.6090763211, 0.0791575164, -0.030969914, -0.2001251876, -0.1561917812, 0.1780347079, 0.2961328626, 0.0426095575, 0.1194768697, -0.0950099006, -0.1640059501, -0.1698604673, 0.5059784651, -0.0187874734, 0.0761009455, -0.0015461221, -0.2256750464, 0.0126301944, 0.3037435412, -0.1414276063, 0.1818355024, -0.069385007, 0.312479198, -0.2922702432, -0.4456367791, 0.4373094738, -0.4284294844, -0.3710168898, 0.0440441296, 0.1237265766, -0.1983822882, -0.1003206745, -0.3580919504, 0.145456329, 0.4109819531, -0.0160897281, -0.1379523724, -0.1122564971, -0.0849026293, -0.1042081714, -0.2067105621, 0.0315534137, 0.0420016833, -0.1544651687, -0.3315708041, -0.5234954357 ]
https://github.com/huggingface/datasets/issues/2144
Loading wikipedia 20200501.en throws pyarrow related error
I tried using `datasets` from `master` on macos with python 3.7.2 I also have `requests==2.23.0` and `tqdm==4.45.0`.
**Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0]
17
Loading wikipedia 20200501.en throws pyarrow related error **Problem description** I am getting the following error when trying to load wikipedia/20200501.en dataset. **Error log** Downloading and preparing dataset wikipedia/20200501.en (download: 16.99 GiB, generated: 17.07 GiB, post-processed: Unknown size, total: 34.06 GiB) to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.6k/14.6k [00:00<00:00, 5.41MB/s] Downloading: 59%|███████████████████████████████████████████████████████████████████████████████████████▊ | 10.7G/18.3G [11:30<08:08, 15.5MB/s] Dataset wikipedia downloaded and prepared to /usr/local/workspace/NAS_NLP/cache/wikipedia/20200501.en/1.0.0/50aa706aa417bb77d910ad61211cc672c0ef3e0f224225a5e0a18277ade8b931. Subsequent calls will reuse this data. Traceback (most recent call last): File "load_wiki.py", line 2, in <module> ds = load_dataset('wikipedia', '20200501.en', cache_dir='/usr/local/workspace/NAS_NLP/cache') File "/usr/local/lib/python3.6/dist-packages/datasets/load.py", line 751, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 746, in as_dataset map_tuple=True, File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in map_nested _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/usr/local/lib/python3.6/dist-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 763, in _build_single_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/builder.py", line 835, in _as_dataset in_memory=in_memory, File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 215, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 236, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 171, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 302, in _get_dataset_from_filename pa_table = ArrowReader.read_table(filename, in_memory=in_memory) File "/usr/local/lib/python3.6/dist-packages/datasets/arrow_reader.py", line 324, in read_table pa_table = f.read_all() File "pyarrow/ipc.pxi", line 544, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: Expected to be able to read 9176784 bytes for message body, got 4918712 **Detailed version info** datasets==1.5.0 - dataclasses [required: Any, installed: 0.8] - dill [required: Any, installed: 0.3.3] - fsspec [required: Any, installed: 0.8.7] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - huggingface-hub [required: <0.1.0, installed: 0.0.7] - filelock [required: Any, installed: 3.0.12] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - requests [required: Any, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: Any, installed: 4.49.0] - importlib-metadata [required: Any, installed: 1.7.0] - zipp [required: >=0.5, installed: 3.1.0] - multiprocess [required: Any, installed: 0.70.11.1] - dill [required: >=0.3.3, installed: 0.3.3] - numpy [required: >=1.17, installed: 1.17.0] - pandas [required: Any, installed: 1.1.5] - numpy [required: >=1.15.4, installed: 1.17.0] - python-dateutil [required: >=2.7.3, installed: 2.8.0] - six [required: >=1.5, installed: 1.15.0] - pytz [required: >=2017.2, installed: 2020.1] - pyarrow [required: >=0.17.1, installed: 3.0.0] - numpy [required: >=1.16.6, installed: 1.17.0] - requests [required: >=2.19.0, installed: 2.24.0] - certifi [required: >=2017.4.17, installed: 2020.6.20] - chardet [required: >=3.0.2,<4, installed: 3.0.4] - idna [required: >=2.5,<3, installed: 2.6] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.10] - tqdm [required: >=4.27,<4.50.0, installed: 4.49.0] - xxhash [required: Any, installed: 2.0.0] I tried using `datasets` from `master` on macos with python 3.7.2 I also have `requests==2.23.0` and `tqdm==4.45.0`.
[ -0.1041543707, 0.3526461124, 0.0340580381, 0.3633102775, 0.2745777369, 0.1802078336, 0.2762239277, 0.4623253345, -0.04348813, -0.1137841493, 0.0247376859, 0.2360223234, 0.1520678848, -0.1178016216, 0.1841086447, -0.1683139652, 0.0038772561, 0.0068801492, 0.0847922713, 0.1328447759, -0.2001204491, 0.1146742404, -0.1824863106, 0.1555174589, -0.5857796669, 0.0881164968, -0.0660181046, 0.0540416539, 0.0833242461, -0.6138044596, 0.3904816806, -0.0500538908, 0.2010908723, 0.212130636, -0.0001204597, 0.0749959573, 0.4643652439, -0.0041333362, -0.2960134149, -0.0811443627, 0.1865802705, -0.0205052793, 0.318087846, -0.3607695699, 0.1008787602, -0.2803387344, 0.2242593914, 0.0471994504, 0.1832179129, 0.0086326823, 0.1682858169, -0.1830529869, 0.3375391364, 0.0306438729, 0.7112435699, -0.1374691427, 0.0815055594, 0.4424602687, 0.1225972623, -0.1607154906, -0.1864348501, 0.2362977117, -0.2502577901, 0.1203090101, 0.2671834826, -0.0770429969, 0.38487643, -0.2004953772, 0.3921533525, 0.2679578364, 0.7762547731, -0.4092202187, 0.1730330586, -0.2313121557, -0.0328711569, -0.0229594894, 0.0938254297, 0.2307370007, -0.2767689228, 0.0545304492, 0.1571858823, -0.1188706309, -0.2609155178, 0.3013154268, -0.0642479509, 0.1997206807, 0.1399382651, 0.3910686672, 0.0163353682, -0.2268839329, 0.0019353963, 0.0632642806, 0.1672582775, 0.2208642364, -0.3931141198, 0.1072580889, -0.0683026388, 0.1139047146, 0.3778623044, -0.1693618596, -0.021596266, 0.0659418702, 0.2391711026, 0.2064650506, 0.4192268848, 0.1241853461, -0.3237410784, -0.2987225056, 0.2721662223, 0.198899731, -0.2542139888, -0.0364416838, -0.0612123758, -0.1137951463, 0.1385727525, -0.1709841043, 0.4291739464, -0.2699913383, -0.2205794901, 0.1195767969, -0.1446795911, -0.0715673715, -0.1552303135, 0.3867206573, -0.0916787833, 0.2425000072, 0.0672102422, 0.0622377098, -0.1821432412, -0.1878143847, 0.0057539046, 0.1186775565, -0.2124668062, 0.179793328, 0.2939303815, -0.1538042426, 0.258354187, 0.1435221136, -0.1506104171, -0.1206761301, 0.1700642258, 0.0130379125, -0.2326726764, 0.3098335862, 0.0075016022, 0.2468715757, -0.0328951888, -0.1449692249, -0.1790341437, 0.3182585835, -0.2848287523, -0.5152554512, -0.2622499466, 0.1209050715, -0.011662893, 0.0844509006, 0.1616872549, 0.0576541089, 0.4413496554, -0.5136592388, -0.100322932, -0.1257851273, -0.185528636, -0.4527531266, 0.170637399, 0.3363129199, -0.5569392443, 0.0798322931, -0.0507646501, 0.0824037194, 0.2173676938, 0.445002079, -0.2298555523, 0.1757659316, -0.1654863954, 0.1924013346, 0.1095906943, -0.3121574223, -0.541102767, 0.2140134573, -0.0612867624, 0.1959043443, 0.0259576514, 0.2906033099, 0.0093368851, 0.171762079, 0.4052649438, 0.2492505014, -0.0467648506, 0.078792274, -0.4085267782, -0.3879696429, 0.3385636508, 0.201665923, -0.0047452683, -0.1988983303, 0.1968248188, 0.3221476376, 0.258479774, -0.2035796195, 0.128796339, 0.0218389258, 0.0705179498, -0.0129468665, 0.2327661812, -0.2238292992, -0.4262201786, 0.1114463657, -0.3431404531, -0.0235895794, -0.3043863177, -0.3612283766, -0.5231872797, 0.0663696975, -0.1714642495, -0.2400974929, 0.1150503457, -0.06133366, 0.0953499526, 0.2569485605, 0.1027858034, -0.0896758884, -0.2042666674, -0.0175579116, -0.4030894041, 0.2405162156, -0.3087986112, -0.1786496639, -0.0221909061, 0.2451286167, 0.3246087134, 0.1002937853, 0.0431753099, 0.1558434218, 0.1467773467, 0.0931863189, -0.1324366033, -0.017700702, 0.2272261679, -0.2668776214, 0.204007864, 0.1240442246, 0.1868999898, -0.2210173905, 0.0509527475, 0.1322418153, -0.0019998802, 0.1718761325, -0.0822382644, -0.0712245181, 0.1570296586, -0.0034190267, 0.3967844546, -0.1355210245, 0.2599032819, 0.4711594284, 0.0430018008, 0.1037076563, -0.0057751313, 0.0103612356, 0.1143461242, -0.0471604168, 0.1531221569, 0.1461277753, -0.3416617215, -0.2851568758, 0.2188829184, -0.1442351043, 0.0782738924, 0.0937130675, 0.0280693173, 0.1398484111, -0.0689808056, -0.195102945, 0.1316027641, -0.1178802103, 0.4590720534, 0.3100677729, 0.3028900027, -0.0293435082, -0.3765668869, 0.0593947917, 0.0831139609, 0.3793655932, -0.3040894568, 0.0794886649, -0.1713319719, -0.2434594631, -0.0772663206, -0.0130445473, -0.2915110588, -0.3173152506, 0.0815708786, 0.5144314766, 0.0328680426, 0.0099859387, -0.0540030375, -0.0480347872, 0.0796884894, -0.1308912188, -0.0505061448, -0.7057310939, -0.3859116137, 0.0051475428, 0.257486254, -0.1339797378, 0.2502464652, -0.0254034996, -0.1927468926, -0.3766918182, -0.5513481498, -0.003672271, -0.1104059368, 0.3178440332, 0.0176335201, 0.395771265, 0.0727890283, -0.215288341, 0.2103868872, 0.013057977, -0.0248655081, 0.2813798785, -0.3631691337, 0.0844140947, -0.0089283213, -0.2284811437, -0.2832892537, -0.1489336193, 0.1993967593, 0.0630165339, 0.1870311499, 0.2383003384, 0.0628926009, 0.1012384146, 0.2758948505, 0.0676459968, -0.3717183769, -0.1608330458, 0.306096822, -0.2184316218, -0.2773066759, 0.1912305951, 0.0027230829, 0.1241861358, 0.221650973, -0.5899143219, 0.0072058924, 0.0857220739, 0.3271366358, 0.0319637917, -0.146209836, 0.2367206514, 0.0211272947, 0.0012417622, 0.0620592013, 0.0056531951, -0.120623365, -0.1537073404, 0.1662415862, 0.1140276641, 0.2094679624, 0.1647177637, 0.783613503, 0.0867719203, 0.0424957313, 0.4263213873, -0.1883070618, 0.0635276437, -0.1462814212, -0.0966462046, 0.0314846113, -0.3452986777, -0.2316505164, 0.1231541708, -0.1210032851, -0.3868953288, -0.0544539951, -0.2450860441, -0.2544878423, -0.2394924462, 0.044574365, -0.0382834151, 0.3793731332, 0.1044161022, -0.1685189158, -0.1514849365, -0.4424998164, -0.0287860688, 0.146330893, -0.0292477719, -0.0367808156, -0.1005665436, -0.2029286623, -0.5161780119, 0.4155933857, 0.285954386, 0.1105866209, -0.1718754768, 0.0878228918, 0.447886318, -0.1853179485, 0.6596495509, -0.1708531231, 0.0438122228, 0.0984819084, 0.1837500632, -0.7251462936, -0.0194136426, 0.1475443244, 0.1342762709, 0.2153127491, -0.1166660041, -0.5139328837, 0.0979647711, 0.3440999091, 0.3732792139, -0.0886277482, -0.1792945713, -0.1912721246, -0.3767271936, -0.5138627291, -0.164923504, -0.2111013532, 0.2683065534, -0.0255609937, 0.0310489014, 0.0503849462, 0.2014782727, -0.0147321112, 0.2821471691, 0.2859054208, 0.0165018737, 0.0235097632, 0.0959306508, 0.0991038829, 0.347071588, 0.3539324701, 0.288197279, -0.0423729159, -0.0889985636, 0.0853010118, -0.063820146, 0.1812104881, -0.150287196, 0.0666162521, -0.0016666111, -0.1978691369, -0.0734469295, -0.1572472006, 0.3747443855, -0.2212857008, -0.298209399, -0.238981694, 0.7085087895, 0.1589902788, -0.0960438922, 0.1231105626, -0.1088687479, -0.1373425871, 0.3652407229, 0.1177064627, 0.9276628494, -0.1522068679, 0.3289299607, 0.3286550045, -0.039698232, 0.5044326186, -0.2825067043, 0.1339880228, -0.4844108522, 0.2856453359, -0.0108887553, -0.0980819985, -0.1546723992, 0.0310812015, -0.1827831864, 0.0733062029, -0.2207053304, 0.0885882676, 0.0106325783, 0.3567407727, -0.0083512925, 0.1106860638, -0.0842743963, 0.0562638715, -0.3195543289, 0.2571132183, -0.261523217, -0.0009586066, 0.0979613811, -0.1563698649, -0.4544543028, 0.0785482526, -0.1875041574, 0.4533360302, -0.3069444895, -0.3188784122, 0.017606698, 0.059825398, -0.0411648974, -0.0937835649, -0.3611283004, 0.1809429228, -0.2230478525, -0.1647402942, -0.1060879976, 0.0703287944, 0.2264247537, -0.0705450922, -0.4650465846, 0.3104068637, -0.0331907868, -0.2690660954, -0.1951660961, 0.0056176819, 0.0766636878, -0.1938509941, -0.1571665853, -0.2530137002, -0.1191876531, -0.1358083189, 0.0734142065, -0.1295600384, 0.0084921271, 0.064658761, 0.068564266, -0.3869738877, 0.1155599803, 0.4719055593, 0.3767464161, 0.1686644405, 0.6754419804, 0.2683517337, -0.266392678, -0.013629999, -0.3504727781, -0.361133635, -0.3933808804, -0.0750967786, 0.1329663694, 0.4606645703, -0.2361183017, 0.1057870984, 0.1565126479, -0.1004550532, 0.1289461106, -0.4669054449, -0.2856479287, 0.345882833, -0.1558522284, 0.2150659114, 0.3333625793, 0.1371679306, 0.0941933021, 0.2817736566, -0.2074544877, 0.4754824936, -0.0808617994, 0.3691471219, 0.1022730172, -0.1045175344, -0.1664326191, 0.0043668598, 0.0278087705, 0.0733079761, -0.0842073858, -0.1873687208, -0.05974067, 0.1769646704, 0.0595370121, -0.2068471611, -0.122133024, -0.4088257253, 0.0580773987, -0.0109869558, 0.3590633869, 0.1042840108, -0.0777886808, 0.1733736247, 0.1805440187, 0.1427161992, -0.2289882004, 0.3619517088, -0.1334507465, 0.3957296014, 0.2669550478, 0.2385378033, -0.0947240219, -0.0126238018, -0.2449374199, 0.0805035084, 0.1154415682, -0.1886788458, 0.1852279902, -0.2776902616, -0.2030886859, -0.021379143, 0.0164038315, 0.3396819532, -0.1417617202, -0.0548672974, -0.0608211681, 0.1005866528, -0.2835870981, 0.0460617319, 0.4852419198, -0.1776812673, -0.2785927653, 0.0687628165, 0.5847010612, -0.043893069, 0.1663224697, 0.0466528311, 0.2393531501, 0.0115821473, 0.0854457617, 0.2219159454, 0.1098193526, -0.1377398819, 0.0567909405, 0.272084862, 0.1866965592, 0.4535921812, -0.1657374203, 0.0975394994, -0.1927060932, 0.0472141989, -0.1411456019, -0.3601850867, 0.1597555876, 0.4120804667, 0.1318733096, 0.0065877857, 0.0914898217, 0.371322602, 0.6368658543, 0.0102783926, -0.0483850539, 0.3622555733, -0.148677811, -0.180416882, -0.2978948057, -0.3707219064, 0.0285330117, 0.150821045, -0.2404497564, -0.2233100235, 0.2616768479, 0.1858804524, -0.3208233714, -0.6472075582, 0.5188279152, 0.283164084, 0.1351264417, -0.222577244, 0.2115806639, 0.1248403937, -0.0737037361, 0.1012161076, 0.289465785, 0.6575106978, 0.3211215436, -0.7122468352, 0.0241686217, -0.1587848961, 0.0964296982, -0.0956942737, -0.0255601853, 0.1547430009, -0.0726359338, 0.2175969332, 0.0557837002, -0.0313377567, -0.1637457609, 0.4401108921, 0.0479711257, -0.2145296335, -0.2602034807, -0.1867543757, -0.2116840631, 0.0047942176, 0.0889468938, -0.3720790148, 0.224848032, 0.4339291453, 0.0074969195, 0.1416676044, -0.0861910582, 0.0382656604, -0.2804439664, 0.4323860407, 0.242212832, 0.1094456762, -0.4453441799, -0.2630243599, -0.6950750947, 0.3619221449, -0.4275679886, -0.0046957806, 0.3281987011, 0.1819257587, -0.2007465959, 0.1665136367, 0.0720968693, -0.1435966343, -0.185102582, 0.3347551823, -0.2243231535, -0.1052200049, -0.12880373, -0.2936486304, -0.2516880929, -0.323635757, 0.2147365808, -0.1949798167, -0.04772323, -0.2938643098, -0.1443581581, 0.1363734603, 0.1835704148, 0.5083593726, 0.085528776, 0.6090763211, 0.0791575164, -0.030969914, -0.2001251876, -0.1561917812, 0.1780347079, 0.2961328626, 0.0426095575, 0.1194768697, -0.0950099006, -0.1640059501, -0.1698604673, 0.5059784651, -0.0187874734, 0.0761009455, -0.0015461221, -0.2256750464, 0.0126301944, 0.3037435412, -0.1414276063, 0.1818355024, -0.069385007, 0.312479198, -0.2922702432, -0.4456367791, 0.4373094738, -0.4284294844, -0.3710168898, 0.0440441296, 0.1237265766, -0.1983822882, -0.1003206745, -0.3580919504, 0.145456329, 0.4109819531, -0.0160897281, -0.1379523724, -0.1122564971, -0.0849026293, -0.1042081714, -0.2067105621, 0.0315534137, 0.0420016833, -0.1544651687, -0.3315708041, -0.5234954357 ]
https://github.com/huggingface/datasets/issues/2139
TypeError when using save_to_disk in a dataset loaded with ReadInstruction split
Hi ! I think this has been fixed recently on `master`. Can you try again by installing `datasets` from `master` ? ``` pip install git+https://github.com/huggingface/datasets.git ```
Hi, Loading a dataset with `load_dataset` using a split defined via `ReadInstruction` and then saving it to disk results in the following error: `TypeError: Object of type ReadInstruction is not JSON serializable`. Here is the minimal reproducible example: ```python from datasets import load_dataset from datasets import ReadInstruction data_1 = load_dataset( "wikiann", "en", split="validation", ) data_1.save_to_disk("temporary_path_1") print("Save with regular split works.") data_2 = load_dataset( "wikiann", "en", split=ReadInstruction("validation", to=50, unit="%"), ) data_2.save_to_disk("temporary_path_2") ``` and the corresponding output: ``` Reusing dataset wikiann (/xxxxx/.cache/huggingface/datasets/wikiann/en/1.1.0/0b11a6fb31eea02f38ca17610657bfba3206100685283014daceb8da291c3be9) Save with regular split works. Reusing dataset wikiann (/xxxxx/.cache/huggingface/datasets/wikiann/en/1.1.0/0b11a6fb31eea02f38ca17610657bfba3206100685283014daceb8da291c3be9) Traceback (most recent call last): File "bug.py", line 20, in <module> data_2.save_to_disk("temporary_path_2") File "/xxxxx/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 645, in save_to_disk json.dump(state, state_file, indent=2, sort_keys=True) File "/usr/lib/python3.7/json/__init__.py", line 179, in dump for chunk in iterable: File "/usr/lib/python3.7/json/encoder.py", line 431, in _iterencode yield from _iterencode_dict(o, _current_indent_level) File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict yield from chunks File "/usr/lib/python3.7/json/encoder.py", line 438, in _iterencode o = _default(o) File "/usr/lib/python3.7/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type ReadInstruction is not JSON serializable ``` Let me know if there is some misuse from my end. Thanks in advance.
26
TypeError when using save_to_disk in a dataset loaded with ReadInstruction split Hi, Loading a dataset with `load_dataset` using a split defined via `ReadInstruction` and then saving it to disk results in the following error: `TypeError: Object of type ReadInstruction is not JSON serializable`. Here is the minimal reproducible example: ```python from datasets import load_dataset from datasets import ReadInstruction data_1 = load_dataset( "wikiann", "en", split="validation", ) data_1.save_to_disk("temporary_path_1") print("Save with regular split works.") data_2 = load_dataset( "wikiann", "en", split=ReadInstruction("validation", to=50, unit="%"), ) data_2.save_to_disk("temporary_path_2") ``` and the corresponding output: ``` Reusing dataset wikiann (/xxxxx/.cache/huggingface/datasets/wikiann/en/1.1.0/0b11a6fb31eea02f38ca17610657bfba3206100685283014daceb8da291c3be9) Save with regular split works. Reusing dataset wikiann (/xxxxx/.cache/huggingface/datasets/wikiann/en/1.1.0/0b11a6fb31eea02f38ca17610657bfba3206100685283014daceb8da291c3be9) Traceback (most recent call last): File "bug.py", line 20, in <module> data_2.save_to_disk("temporary_path_2") File "/xxxxx/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 645, in save_to_disk json.dump(state, state_file, indent=2, sort_keys=True) File "/usr/lib/python3.7/json/__init__.py", line 179, in dump for chunk in iterable: File "/usr/lib/python3.7/json/encoder.py", line 431, in _iterencode yield from _iterencode_dict(o, _current_indent_level) File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict yield from chunks File "/usr/lib/python3.7/json/encoder.py", line 438, in _iterencode o = _default(o) File "/usr/lib/python3.7/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type ReadInstruction is not JSON serializable ``` Let me know if there is some misuse from my end. Thanks in advance. Hi ! I think this has been fixed recently on `master`. Can you try again by installing `datasets` from `master` ? ``` pip install git+https://github.com/huggingface/datasets.git ```
[ -0.1317066997, 0.2105597258, 0.0438051671, 0.3900921345, 0.3082844615, 0.2542074025, 0.4115678966, 0.2183053195, 0.1559671313, 0.0927033722, -0.1810029149, 0.3821822703, -0.1831882298, 0.469206214, -0.3343833983, -0.2261846364, 0.1314817965, 0.0324933603, 0.0247836374, 0.1516533643, -0.2917745113, 0.2401539236, -0.209699288, -0.0722320378, -0.1023983806, -0.2237329185, -0.0900940001, 0.1784163117, -0.0479017012, -0.2700753808, 0.4981566966, -0.0863715261, 0.2484548092, 0.4595005512, -0.0001193325, 0.2449737191, 0.2752627134, -0.1217552871, -0.4869107604, -0.1442824006, -0.1124070585, -0.3307712972, 0.2289602906, -0.2849006653, 0.2563337684, 0.0324311331, -0.0967210606, -0.2834962606, 0.5513251424, -0.1404762119, 0.1310997754, 0.2201008201, 0.2116706818, -0.0764774233, -0.0196519084, 0.8181025386, -0.3116712868, 0.1208765209, -0.1681928635, 0.1594801247, 0.1860607266, 0.1397749782, 0.0775512084, -0.1289095581, 0.1089104414, -0.083956629, 0.0414063111, -0.1637930572, -0.0721091777, 0.0359597728, 0.6240741014, -0.2325592637, -0.5413185954, -0.5269165039, -0.098892495, 0.1037318558, 0.1883216053, 0.0515777245, 0.1023938879, 0.1159399524, -0.0749133006, -0.1888537109, -0.1452778876, -0.0556887351, -0.0028693154, -0.3264966905, -0.2233643681, 0.3309183717, 0.203916505, -0.0945510417, 0.1549257338, -0.2039528787, -0.0927103311, -0.0095428638, -0.2591286004, -0.2582910955, -0.4630259573, -0.1182585061, 0.0588774905, 0.2336981595, 0.1081127077, -0.1332110912, -0.2215162516, 0.1171841025, 0.6883968115, 0.1997384727, 0.1489497274, 0.40225631, 0.0291577317, 0.1394937932, 0.0054767728, -0.0856486708, 0.1668637842, -0.0762733519, 0.3958075047, 0.0007774699, 0.2863454223, -0.1103601083, -0.5084642172, -0.0236412436, -0.3658466935, -0.2045269459, -0.0995764732, 0.1125921085, 0.2994081974, 0.2819696963, 0.173693344, 0.4408880174, -0.0008400269, -0.0951214433, -0.072720021, -0.0292541347, 0.0549814403, 0.2533734143, 0.0195076615, -0.0273442846, 0.0528053567, 0.0067483783, -0.4714188576, -0.2150872052, 0.1913161576, -0.2646385431, 0.0638191104, 0.2851464748, 0.2803843021, 0.1533471048, 0.17737782, -0.3570282757, -0.3106737137, 0.1204815209, -0.0965009257, -0.0488859527, -0.043700587, 0.0947651118, -0.1267966628, 0.0659135357, -0.5947526693, -0.0187632013, 0.4436032176, -0.2635985017, -0.0719168037, -0.2288509607, -0.0116029009, -0.3403196037, 0.0138408542, 0.4004662633, -0.3379042745, -0.068168506, -0.2169625163, -0.2334201336, 0.1664642841, 0.4936628938, -0.0835335255, 0.5169417858, -0.195594281, 0.39820683, 0.1584654748, -0.2379552722, -0.2000245154, 0.5022703409, -0.1037769616, 0.1734890342, -0.0952559263, -0.0241523627, 0.4080353677, -0.1735252887, 0.1406645328, 0.0812346414, -0.0405475572, -0.0777480826, -0.1940616369, -0.2555302382, 0.1296401322, 0.0126433596, -0.1006326154, 0.1342627108, 0.1260571927, 0.1880755723, 0.311182797, -0.0541516468, 0.2493342459, 0.3054507077, 0.1177982092, -0.1352880895, -0.10753721, -0.0221284255, -0.3029609621, -0.0044430271, 0.2780948281, -0.2112734616, -0.09349107, -0.1717115343, -0.2598279715, 0.2303352356, -0.2763421535, 0.2911274731, 0.0529796854, 0.1208052337, -0.0248323902, 0.2489489466, -0.0919570848, 0.1896862239, -0.0352423564, 0.1281063557, -0.4389439821, 0.4238277972, -0.0409120768, -0.3451372087, 0.0302616581, 0.0569883808, 0.2687722147, -0.1344342083, -0.0043098871, 0.3361164629, 0.2367791235, 0.1300530434, -0.2204688787, -0.0598827153, 0.2161558419, -0.0719891861, -0.1192332804, 0.2150163651, 0.3863370717, -0.1784891784, -0.1886804104, 0.3041792512, -0.0705869645, 0.1873157471, 0.0063083917, 0.1126230285, 0.0241006985, -0.0023698211, -0.0940757245, -0.408126235, 0.0147505738, 0.0237153508, -0.1132685691, -0.2551980913, -0.0995127708, 0.1117104217, 0.4493328333, -0.2675611377, 0.2195765972, 0.0182684474, -0.1571049988, -0.0029315278, -0.0543792471, 0.4611753225, 0.5188762546, -0.0728520826, 0.2165547609, -0.1663921326, 0.0560954921, -0.04090783, 0.1319317222, 0.1509228647, 0.3151161671, 0.2516277134, 0.0549507961, 0.0588583238, -0.0803976431, 0.1499339938, -0.0055815503, 0.1412248611, -0.4040682316, 0.1511810422, -0.2129686475, 0.3331792653, -0.1819793433, -0.225749895, 0.0959368423, -0.6485620737, -0.4150825441, 0.4897369444, -0.1861346364, -0.0398072153, 0.0067068636, -0.0427004248, -0.0165356435, -0.0674779788, -0.1246945858, 0.1129418314, -0.2868050933, -0.0729241222, 0.2463178933, -0.2035422325, 0.2206843793, -0.1972503066, 0.0126172379, -0.2052570432, 0.036824882, 0.1174176782, -0.1562772095, 0.1773219854, 0.1652359962, 0.2820573747, 0.0242903978, -0.2725774348, 0.096450597, 0.1477795541, -0.1811761409, 0.1133566499, -0.0025248006, -0.0518949926, -0.1257264018, -0.1589466333, -0.3489079475, -0.1871428341, 0.5054351687, -0.1241575927, -0.2554839253, -0.1415612996, 0.118082583, 0.1391180456, 0.2809082866, -0.2997899055, -0.1871421933, -0.1292026192, 0.3373073041, -0.0742208436, -0.1497438103, 0.1376182735, 0.0473865718, -0.2108742297, -0.0256525222, -0.4338177145, 0.2235617787, -0.1067927927, 0.0417156667, -0.1858785897, 0.0072101634, 0.214930132, 0.1670220941, 0.1195027679, -0.0201800019, -0.4066406488, 0.2743181288, -0.1029170975, 0.2617075145, -0.3179400563, 0.3655719459, 0.2267263681, -0.0936274827, 0.1042674184, 0.1052587703, 0.4074468911, 0.4023138285, 0.2292528301, -0.2795909941, -0.046568267, -0.030543372, -0.4651509523, -0.3055946231, -0.0788275674, 0.0058602281, -0.4329890609, 0.0954168439, -0.4169625938, -0.0798512623, -0.4240087271, -0.0649458468, 0.041141469, 0.2644874454, -0.1293402612, 0.3300026953, 0.1213150322, 0.2686507702, 0.0854174048, 0.4426593482, 0.3040848374, -0.022593759, -0.6052623391, -0.3987894952, -0.1494775414, 0.0851713419, -0.0030243397, 0.3307608366, -0.1128200442, -0.1580198705, -0.0685726106, -0.0389403068, 0.5201874375, -0.051240243, 0.0012256575, 0.1916232556, 0.0426361561, -0.3706858754, -0.084585689, 0.1276458055, 0.2611559927, 0.099629499, 0.7260843515, -0.2869676352, 0.0848333165, 0.0986012146, 0.3608521223, -0.2686017156, -0.260660857, 0.0762175173, -0.6618025303, -0.4734542072, -0.065404579, 0.0891382024, 0.0840256363, 0.0445674658, 0.0613792837, -0.2863174379, -0.197455883, -0.0309641548, 0.0094024539, 0.2691717744, -0.1909770668, 0.1744085699, 0.2734709978, 0.0785733163, 0.4405233264, 0.4388537407, -0.0147158485, -0.3525548577, 0.1523870081, -0.0716160089, 0.0187628083, 0.1555838138, 0.050877884, -0.082126677, 0.088373743, -0.2365546823, -0.4633459449, -0.1488451064, 0.0904251039, -0.3374939561, -0.6183341146, -0.2228628695, 0.3830706179, 0.0004322678, 0.0913360715, -0.0558941811, 0.2712642252, -0.256621778, 0.4474663138, 0.1223125011, 0.6830678582, 0.0007451046, 0.0854567438, 0.4916384518, -0.6043207645, -0.0060892403, 0.1641175598, -0.0600036755, -0.4265597165, 0.193072021, -0.0806794912, -0.0681979284, 0.1394303143, -0.0234502107, -0.3511238694, -0.1151925176, -0.3808241785, -0.2052476406, -0.1649702191, 0.1392968893, -0.4981328547, -0.3532393873, -0.1283451915, 0.1440777332, 0.0093870899, -0.0194943883, 0.1407400221, -0.3155274689, -0.0234527737, -0.0966569185, -0.390583396, 0.0247120932, -0.075729236, 0.3466626704, -0.1778198332, -0.1701765954, 0.2836351395, 0.2573928237, 0.514472723, 0.0030208691, -0.0201173741, -0.1384012103, -0.2794148624, 0.0727893114, -0.0178477857, -0.2357200235, 0.4342165887, 0.1702366769, 0.0195979178, -0.2134183645, -0.1493427753, -0.129209891, -0.1325328946, 0.0547387376, -0.2243577093, -0.5140140653, -0.2109912634, -0.1133691445, 0.0389369056, -0.3093292117, 0.0128056891, 0.1201060563, -0.027482314, 0.1266260743, -0.3678088486, -0.0474942625, 0.0045264587, 0.3145180941, 0.2062477469, 0.2634676099, 0.6696696877, -0.0584005751, -0.1212423295, -0.2391157001, 0.7491883636, 0.2670485973, -0.0332002863, 0.3828854561, -0.356677264, 0.079108119, -0.1761876792, 0.2747240663, 0.2144104838, -0.302813381, -0.0459917225, -0.4061582088, -0.3587570786, 0.2031573802, 0.0973908827, 0.2266018242, 0.1682342887, 0.1613413393, -0.2150632143, -0.0841038898, -0.1487049311, -0.0051133111, -0.2340537608, -0.0138234459, -0.00796693, -0.061699573, 0.2066634893, -0.1218831465, 0.0526376963, 0.2026414275, 0.0701568052, -0.0461216047, -0.1765583158, 0.1328734159, 0.1106577814, 0.0928321332, -0.1284501553, -0.2062307745, 0.0730837137, -0.1389053762, -0.1202656701, 0.273217082, -0.0864554197, 0.1101710945, -0.0113607459, 0.3906762898, -0.1400338113, 0.1156812459, -0.0184721053, 0.1907475293, -0.0251063071, 0.237637639, 0.0582985878, 0.030797109, -0.3982854486, 0.0157233234, 0.3234843612, 0.323972851, 0.2735624611, -0.5291038752, 0.0136450827, -0.1279328018, 0.1995227337, 0.3046545088, -0.2359334975, -0.0323294252, -0.0842194706, 0.0597506166, 0.2379079312, -0.1244975999, 0.3456409574, -0.3701760769, -0.2507578135, 0.1945925951, -0.0075362474, 0.2263044268, -0.5040649772, 0.0490178838, 0.5733004212, 0.0245197006, 0.2739391327, 0.5586560369, -0.2972377539, 0.206201762, -0.0551294461, -0.0303291772, 0.2992992699, 0.1485155225, -0.0736932456, 0.3769676983, 0.204610154, 0.1215096414, 0.0530815572, -0.1914531291, -0.0007977005, -0.0545354784, 0.1000755429, 0.3828054368, 0.1555072218, -0.0381457731, -0.6030407548, -0.1078901142, -0.1749638617, 0.0733095556, -0.220365569, -0.0936851054, -0.0803634971, -0.2421418279, -0.0503130704, -0.0172620118, -0.1793980747, -0.1467367113, 0.2449444085, -0.0521291979, 0.0955901593, -0.1196795851, 0.0544790439, 0.157000035, 0.0720025599, -0.3394527435, -0.1150499582, 0.0763378367, -0.0231556445, -0.0515819788, 0.0262633394, 0.4611831307, 0.2230963856, -0.2993927002, -0.1687799096, -0.0456723869, -0.0893873125, 0.1947799921, 0.1658115536, -0.2169561386, 0.1562273353, 0.5898365974, 0.0546889566, 0.0335576572, 0.2126051337, 0.2061872035, 0.1679577529, -0.1390762925, 0.3739165962, -0.45255059, -0.1057958975, 0.0817321166, -0.0233930536, -0.1923723668, -0.0686580688, 0.2831573784, -0.0889569372, 0.2677442133, 0.1079685092, 0.030073069, 0.0063130911, 0.4416627884, 0.2064989954, -0.3510466218, -0.1622364372, 0.1728038788, -0.1454882771, -0.1226282269, -0.018130878, 0.010647513, -0.0071241241, 0.1739096045, 0.1665398329, 0.1428554356, 0.0265421756, 0.0155510157, 0.1411408633, 0.4424416423, 0.0177943856, -0.337584734, 0.5128378272, -0.1091877222, -0.0130156763, -0.4200245142, 0.2337828577, 0.3612351716, -0.0040313974, 0.0197011456, -0.0365730077, -0.0331174433, 0.0064802123, 0.1603880078, 0.4409675002, 0.2313554734, -0.0048695877, -0.3268093467, 0.0847199857, -0.1212445796, -0.1091054082, 0.1739547402, -0.1156603843, 0.7781213522, -0.3791898787, 0.4145939052, -0.2927049696, -0.215336293, -0.0463361889, 0.1783769131, -0.4962351918, 0.2853754759, -0.0774826407, 0.0432464406, 0.3445820212, 0.1797286868, 0.0849790424, 0.3774324954, -0.1755809486, -0.0792292953, 0.3478642702, -0.0715023503, -0.3467018008, 0.4105902016, -0.156423226, 0.3496383131, 0.2499444336, -0.6930732131, -0.0669036508, 0.3843771219, -0.2654727697, -0.100249894, 0.062813431, 0.2828069329, -0.1878263503, 0.0814793259, 0.4868473411, 0.0644616783, -0.2565097511, 0.3085879683, -0.0935586691 ]
https://github.com/huggingface/datasets/issues/2135
en language data from MLQA dataset is missing
Hi ! Indeed only the languages of the `translate-train` data are included... I can't find a link to download the english train set on https://github.com/facebookresearch/MLQA though, do you know where we can download it ?
Hi I need mlqa-translate-train.en dataset, but it is missing from the MLQA dataset. could you have a look please? @lhoestq thank you for your help to fix this issue.
35
en language data from MLQA dataset is missing Hi I need mlqa-translate-train.en dataset, but it is missing from the MLQA dataset. could you have a look please? @lhoestq thank you for your help to fix this issue. Hi ! Indeed only the languages of the `translate-train` data are included... I can't find a link to download the english train set on https://github.com/facebookresearch/MLQA though, do you know where we can download it ?
[ -0.0344624743, 0.2046838403, -0.22718741, 0.230805248, 0.0578233451, 0.2997931242, -0.0395336449, -0.046116475, -0.1498139054, 0.1264657825, 0.195892781, -0.1498143524, 0.0673905239, 0.4813952148, 0.2251040041, -0.2650110126, -0.0097858235, -0.0794422179, -0.1342738867, -0.4665369689, 0.0198141113, 0.5020958781, -0.0956804603, -0.0314679332, -0.1739676595, 0.1743476689, -0.3577693105, 0.0911986232, -0.1458941996, 0.057177797, 0.1609996259, -0.3259174228, 0.2097354233, -0.1647292972, -0.0001091284, 0.0488844961, 0.0214319006, -0.2748507261, -0.0866411179, -0.3655622005, -0.1191427782, -0.2956377268, -0.1769669652, -0.1298706234, -0.1838499308, -0.0736342371, 0.1559996903, -0.2765035629, 0.1190436557, 0.3667833805, 0.1788885295, -0.1254622936, 0.1327679753, -0.2215018421, 0.0960632712, -0.0015863907, 0.1220992357, 0.0806109011, 0.3105131686, 0.0426358655, 0.1654583514, 0.5170336962, 0.3657605648, -0.1951814592, -0.2743356228, 0.0918550119, 0.4387051463, -0.6130286455, 0.245910719, 0.2323864102, 0.3963027894, 0.0642601699, -0.2204281688, -0.0049438179, 0.2352890372, 0.1712482274, 0.0973938257, 0.4704559445, -0.331916362, 0.2780917287, -0.1069713235, -0.5191504955, -0.0931161195, 0.2702252865, -0.1711805314, 0.2614014149, 0.0409473553, -0.0682274103, -0.0980316997, 0.0551040098, 0.1683305502, 0.1132867932, -0.204364568, 0.207410872, -0.0596286654, -0.0694437623, -0.1071817577, -0.0628478527, 0.0442220122, -0.3017547429, -0.4466922283, 0.1175955236, -0.0982549191, 0.0766115412, 0.2756771445, -0.0042863302, 0.0451872386, -0.1117991954, -0.0182726793, -0.4221898913, -0.0167214349, -0.1126439646, -0.2181792259, 0.0549062788, -0.611618042, 0.2076262981, -0.1856243312, -0.3717591166, -0.227101475, -0.0178469215, -0.5481888056, -0.1329701245, -0.0842329264, 0.1708070934, 0.1391259432, 0.1097303927, 0.0387189984, 0.0876053274, -0.2127081454, -0.5654234886, -0.1886694282, 0.2166592777, -0.2004495263, -0.2025625706, -0.0060594678, 0.234291628, 0.4591827393, -0.1983035803, 0.0367989838, 0.0089178532, 0.1423788667, -0.1521295607, 0.163070932, 0.1273076534, 0.2819873095, 0.1840771437, -0.0005700151, -0.2114921212, 0.0147196949, 0.2187461555, -0.370755583, -0.1261292696, -0.3416650593, 0.2081027031, -0.0157132074, -0.2832198143, 0.226871863, 0.7006771564, -0.0515589006, 0.0173043609, 0.2035379112, 0.0313003026, -0.0789011642, 0.0856772959, 0.2000347525, 0.2012116909, -0.6012539268, -0.4723478258, 0.1324433833, -0.1496262699, 0.2162725627, 0.334710747, -0.3081378341, -0.0056158528, -0.2851573527, 0.1473450065, 0.3123141229, -0.0908836499, -0.3621455729, 0.0711621642, 0.0378510505, -0.1875445545, -0.1637817323, 0.2593783438, -0.0118401311, 0.1117786393, 0.2610755861, 0.4686018527, -0.1223034263, -0.1898303628, -0.1053927392, -0.2279415131, 0.6223261952, 0.2268796861, 0.2126405388, -0.1230188757, 0.104007408, 0.1111716181, 0.2606936991, -0.0795062184, 0.143319875, 0.5985341072, -0.1020625532, 0.0215905532, 0.2536547184, -0.0001962632, 0.018805135, -0.0132763311, -0.6309731007, 0.2035330236, 0.0095847584, 0.0219990388, -0.0432279259, -0.1058528721, -0.1966770589, -0.2617293596, 0.1333912611, -0.2965785265, -0.0784633458, 0.4289408922, 0.0495194495, -0.0088377837, -0.2400577366, -0.1317602694, -0.059211269, 0.4036953151, -0.2992995679, 0.0492515936, 0.2209754586, 0.4827619493, 0.0691574663, -0.0927280039, -0.0542093813, -0.0900359452, -0.018684281, 0.0758043304, 0.2721097171, 0.1493705809, 0.5323989391, -0.2613610029, 0.2088600248, 0.1365319192, -0.0400512628, 0.023165077, -0.09725409, 0.2465907931, 0.3171749413, -0.0219422802, 0.0535084605, 0.344753772, 0.3326192498, -0.0062586889, -0.0123572238, -0.3073705733, 0.3201684952, -0.0726651251, 0.1365264505, -0.0757594407, -0.1469400227, 0.2850210071, 0.738704741, 0.124065578, 0.2098560631, 0.0849577188, -0.4218395948, -0.2090278268, 0.2971543372, 0.0460439548, 0.0749299973, 0.1877484322, 0.3617950082, -0.0734827369, 0.4398926795, -0.1401206851, 0.2000079602, 0.1594544202, 0.136302188, -0.256934464, 0.0658929348, -0.0054350793, -0.4006046653, 0.1530466229, 0.2428846955, -0.0181933083, 0.1239671856, 0.1371140778, -0.3840936124, -0.8181409836, -0.1210193932, -0.3285422921, -0.2786880732, -0.1606534123, 0.1709369719, -0.7855651975, 0.0042887703, 0.2437332571, 0.3373643756, -0.0142114013, -0.116195038, 0.1168832704, -0.0756038576, -0.1245469898, -0.4825125039, 0.1762279421, -0.0289322957, 0.1055140048, 0.0067071076, -0.1609121263, 0.0697346851, -0.2360586375, -0.4895128608, 0.162756592, -0.0336750932, 0.1449293196, -0.0722269714, -0.0020545498, -0.4595686793, 0.0561483167, 0.0869890898, 0.1313927025, -0.3589527607, -0.0264957324, -0.1333759129, -0.0539583862, -0.0296467692, -0.448156029, -0.7942330241, 0.0471001193, -0.0254449397, 0.0235762671, 0.0455224253, -0.0960214511, -0.1811820269, -0.0012227856, -0.0862497687, -0.058854714, -0.4134362042, -0.1808992028, 0.192913577, -0.0892890543, -0.4240901172, 0.3333975077, 0.0575140119, 0.161589697, -0.2290339321, -0.4955675006, -0.2501129508, 0.1038497835, 0.0757000446, -0.2734214664, -0.0491301604, 0.3173698485, -0.1497464776, -0.0121672973, -0.0257461146, -0.05962421, 0.0275726952, 0.2583022714, 0.4377895296, -0.4849633276, 0.3810780942, 0.2894516587, 0.3349756598, 0.335442543, 0.1928783059, 0.1851141453, 0.0049765371, 0.2048328817, 0.0775879323, -0.0939625502, 0.4627107382, 0.0153502226, 0.0678962544, 0.245025754, -0.0310826171, -0.259521544, -0.1282047033, -0.1448739618, -0.1577749699, -0.1185042113, 0.0035323817, -0.3705379963, 0.4462803602, 0.278881669, 0.2835539579, 0.2334593236, -0.0040408261, 0.3108602166, 0.0581936762, 0.1092325747, 0.1489845216, -0.535648942, -0.6774758697, -0.4137745798, 0.0178145915, -0.0460201278, 0.3492564261, -0.2022687048, 0.3159274459, 0.1282983124, 0.0692241192, 0.6536628604, -0.1781611592, -0.3705919683, -0.0675853938, 0.0320621207, 0.0259086713, 0.0210633948, -0.0673513263, 0.3173507452, 0.5049278736, -0.1271524876, -0.0750951841, -0.1299311519, 0.1897287518, 0.2722419798, -0.3018901348, 0.2110727727, -0.0528508052, -0.2436062396, -0.1980117857, -0.0069023147, 0.1067409813, -0.0079731122, 0.0640234649, -0.0087011531, 0.2498303354, 0.2399795055, -0.0909940451, 0.0296720564, 0.2414084226, 0.2405938506, -0.006944783, 0.1101198643, 0.1675506681, -0.0403498262, 0.3628752828, 0.1135012209, -0.3394520581, 0.2700648904, -0.2651732266, 0.3873054683, 0.1473498642, 0.0750737861, -0.0203732923, 0.5720806718, -0.3262432814, 0.0356927849, 0.0072493553, 0.1877932847, 0.116331391, -0.1971906126, -0.3613517284, 0.1051106453, -0.1618571877, 0.1121187508, -0.228781566, -0.015963342, -0.1922404766, 0.4723277688, 0.1149990708, 0.8131115437, 0.1729177386, 0.2653674483, -0.2128793448, -0.1444631517, 0.1843684912, -0.2363999784, 0.120104298, -0.0790588781, 0.0088770166, -0.2042358518, 0.0908278152, -0.0466673523, 0.2055431455, -0.0521628894, 0.3298267722, 0.3807365596, -0.3269470632, 0.1866822243, 0.0681793392, 0.0490678027, -0.1569547951, -0.1394020021, 0.1233365312, 0.1078925356, 0.4474701583, -0.1518152356, -0.1950324625, 0.0474468023, -0.0101230219, -0.4358279705, 0.0342400074, -0.6181281805, 0.2651328444, -0.2025089264, -0.451423347, 0.1985461414, 0.2820284665, 0.362443924, 0.2047535479, -0.3248586953, 0.5658938885, 0.2798187733, -0.0865009651, 0.3733977675, -0.0790588856, 0.1902605891, -0.2697783113, -0.2434544563, 0.2396705598, -0.2098741829, 0.1143323928, -0.6147164702, 0.0983329564, 0.0974823087, 0.2014008462, -0.0643610209, 0.3105179667, 0.0140709728, -0.2111013383, 0.1187827513, 0.3033915162, -0.0453685075, 0.0930120498, 0.0480727702, -0.0674220249, -0.2774440646, 0.3492661417, 0.2116705924, -0.1594546139, 0.584169209, 0.1649899483, 0.0130451471, -0.1773336828, 0.1023617387, 0.0691418722, -0.1856681406, -0.2398854643, 0.052186735, 0.1877980977, -0.1963649988, 0.1287593991, -0.0096379183, -0.2768807709, -0.1318551004, -0.4883033037, -0.0330953375, 0.2231068015, 0.0115033332, -0.2465585023, 0.2071941793, 0.1146185249, 0.1737968326, -0.0177275464, -0.2826580405, 0.0990177542, -0.3407904208, 0.1170909405, -0.3109862804, -0.0273567885, 0.2107979804, 0.0098882765, 0.0411002561, -0.1670540124, 0.0556561053, -0.1659139693, 0.0944287106, 0.0442335457, 0.1019380912, 0.2109967768, 0.0532391183, -0.2525963187, -0.1904030144, 0.2619978189, -0.067416653, -0.0279330648, 0.0371684581, 0.2888004482, -0.0973702818, -0.0009416267, -0.2473880351, 0.0661415309, 0.2350027263, 0.1454190612, 0.2674194276, 0.2663161755, 0.3570342362, 0.0446495041, -0.1112377793, -0.1341846436, -0.1661475301, 0.0003793426, 0.107624054, -0.1778696626, 0.1229846478, 0.1210382283, -0.1532256305, 0.0044132136, -0.3717906475, 0.2839586735, 0.4176318944, 0.2205515504, -0.4797024131, -0.0664165765, 0.0775194168, -0.2523564398, -0.0204069316, -0.0181943402, 0.4070227742, 0.3347915113, 0.5049911737, 0.1084176078, -0.0866630897, -0.1322615743, 0.0833306611, -0.1251880378, 0.0438098758, 0.117137447, 0.1153696924, 0.1527489424, 0.012164209, 0.4706032872, 0.1794545203, 0.2413916141, 0.3241355121, 0.1357877553, 0.0458192602, -0.1199908406, -0.1456766129, -0.0049322322, -0.1080215722, 0.1095988303, 0.0138995592, 0.1421698183, -0.0046589673, -0.3037822545, -0.1372006685, 0.2461919934, -0.2555316687, 0.109611243, 0.0571779832, -0.1166887358, -0.0666644126, 0.0646628588, 0.0561557412, -0.2038901597, -0.2721969485, 0.2663778067, -0.2021350861, -0.0640050471, -0.0655524433, 0.2139688283, -0.2533402443, -0.0913540944, 0.4351052344, 0.0919249803, -0.1498564631, 0.1068013161, 0.1184950247, -0.1101509929, -0.1591198742, -0.3091271222, 0.064403452, 0.2533027232, -0.1815321445, -0.140374288, 0.2805755734, 0.5617469549, 0.208932206, 0.2611390352, 0.1185274944, -0.0966019481, 0.0250888262, 0.2744983435, 0.0262699388, -0.1715337634, 0.1727129817, -0.1618006825, 0.078970626, -0.4373011291, -0.1165169999, -0.4430787563, -0.0360762849, -0.0994549543, -0.1601615548, -0.1082496271, -0.1452094615, 0.0955013931, -0.173853144, 0.2952965498, 0.4899111092, 0.2807599902, -0.2185986191, -0.4658296406, -0.2478747517, -0.0861510783, -0.0069591058, 0.2598722875, 0.046769049, 0.3083915412, 0.3372926712, 0.213471055, 0.1028382778, 0.3506153226, -0.2340525538, -0.0428211018, -0.4953738451, -0.2108679414, -0.0311655477, 0.4508553147, -0.0775640532, 0.0645225793, 0.1477774829, 0.1814356744, -0.0305832885, -0.2744168043, -0.3053382635, -0.0724550188, 0.0184188932, 0.5293852091, 0.1815384775, 0.0855615512, -0.1395013034, 0.0197934583, 0.1657848656, -0.3820603192, -0.0141183361, 0.2694746852, 0.0222814418, 0.0334626809, -0.0601960532, -0.1295229793, 0.0392524414, 0.175238952, 0.0319484696, -0.172429204, -0.3260921538, 0.2349204719, 0.0191378891, 0.1085360497, 0.0108624585, 0.3288311958, -0.026960168, -0.2470643967, -0.22329849, 0.1386554837, 0.0727489963, -0.2553523779, 0.0324017182, -0.2219074219, -0.0193352625, 0.0205100067, -0.0427111238, -0.2704520822, -0.0044649243, 0.3768489063, 0.1395282447, 0.0286063105, 0.2439163923, 0.0668069124, 0.1847602427, -0.1373002678, 0.3015006185, 0.2160292566, -0.2874204814, 0.055680491, -0.1076180637 ]
https://github.com/huggingface/datasets/issues/2135
en language data from MLQA dataset is missing
Hi @lhoestq thank you very much for coming back to me, now I see, you are right, in the link you sent I see split of {split}-context-{context_language}-question-{question_language}.json with context_language=question_language=en, TFDS most probably has extracted english ones from these files as en language files, but translate-train/test do not have en indeed. thanks a lot for the great explanations
Hi I need mlqa-translate-train.en dataset, but it is missing from the MLQA dataset. could you have a look please? @lhoestq thank you for your help to fix this issue.
57
en language data from MLQA dataset is missing Hi I need mlqa-translate-train.en dataset, but it is missing from the MLQA dataset. could you have a look please? @lhoestq thank you for your help to fix this issue. Hi @lhoestq thank you very much for coming back to me, now I see, you are right, in the link you sent I see split of {split}-context-{context_language}-question-{question_language}.json with context_language=question_language=en, TFDS most probably has extracted english ones from these files as en language files, but translate-train/test do not have en indeed. thanks a lot for the great explanations
[ -0.0408197567, -0.0362208635, -0.1773769259, 0.3228134215, 0.1323034465, 0.2861717939, 0.0952835232, 0.1073278487, -0.2343607247, 0.119536005, 0.0948153585, 0.0513930842, 0.1680394113, 0.5239030719, 0.2062966675, -0.4014204144, -0.0716603026, 0.0019191951, -0.1760002524, -0.3533482552, 0.0575277656, 0.4546355009, -0.1336807162, 0.0977430865, -0.283597827, 0.0972492471, -0.4078721702, 0.2086158693, 0.1086851433, 0.060702458, 0.2069734633, -0.3061188161, 0.1648245007, 0.002481889, -0.0001026441, 0.033944577, 0.0562219918, -0.3316811919, -0.1245713681, -0.3011200726, -0.2936726809, -0.1166033, -0.1913675666, -0.2669696808, -0.210029304, -0.1600870639, 0.0102597401, -0.4025421739, 0.2945217192, 0.3969224989, 0.2244402468, 0.0597104132, 0.1115079597, -0.0750959814, 0.1472626776, 0.0179583374, 0.1538948417, 0.0909610242, 0.1666129082, 0.0342723206, 0.1306972653, 0.5047553182, 0.2061386704, -0.1100768149, -0.2966979146, 0.131900847, 0.2486950159, -0.6032837033, 0.2411037087, 0.3763132691, 0.5104181767, -0.0404774956, -0.2418507934, -0.1448256075, -0.0136255771, 0.0993715599, 0.1884405017, 0.2149869502, -0.1208995059, 0.2852536142, -0.01851888, -0.3122231662, -0.0564258583, 0.1563017964, -0.4507117569, 0.2781143785, 0.0598662645, -0.0272463039, -0.2076354027, 0.072033748, 0.2141708583, 0.0857241601, -0.2254956812, 0.1790016592, -0.221273452, -0.2123452127, 0.0013373885, -0.2044259608, -0.0787948146, -0.171671927, -0.5002163053, 0.0687909871, -0.0758402497, 0.0553398021, 0.1506576836, 0.1425787359, 0.0742118806, -0.0000409856, -0.0345677175, -0.5035305619, -0.126960367, -0.1095474139, -0.0571455881, -0.0474246815, -0.5842801929, 0.2645853162, -0.0489342362, -0.2018538117, -0.2747572362, -0.0557362027, -0.667956233, -0.2636979818, -0.163007021, 0.0584546402, 0.207579717, 0.1428810507, 0.0831874833, 0.1311981678, -0.3226513267, -0.4529730678, -0.2833185792, 0.2836949229, -0.0452452563, -0.1650168598, -0.0661566257, 0.2656960487, 0.5278736949, -0.2556882501, -0.0366102643, -0.011000596, 0.0745296478, -0.1067346185, 0.0769135654, 0.0889597684, 0.1962748766, 0.0763681978, 0.0843274891, -0.1846403331, 0.0152575672, 0.2290404886, -0.4823004007, -0.0396407321, -0.1821139306, 0.2690197527, -0.1023227423, -0.2360185534, 0.150303334, 0.6440028548, 0.1193220764, -0.0179716647, 0.1329052746, -0.0403434597, -0.1953154802, 0.0868195891, 0.2072444856, 0.2232120931, -0.7090598345, -0.2352011502, 0.2311967015, -0.1255782545, 0.064919427, 0.2192749977, -0.1816484183, 0.2974403203, -0.2996008694, 0.363166064, 0.1245925874, -0.3740581274, -0.1185469776, 0.261983037, 0.0106618926, -0.1634266973, -0.1058033854, -0.1710813344, 0.1601080894, 0.031851802, 0.0292904358, 0.3716143966, -0.2197674513, -0.1255999655, -0.1732638776, -0.1923581958, 0.505746007, 0.1941699386, 0.1641435474, -0.18534863, 0.0451193005, 0.1144301146, 0.255692184, -0.2323065698, 0.0895539224, 0.4553657174, -0.1292891651, -0.0670069307, 0.2314843684, -0.1167259589, -0.2401208729, 0.0309545696, -0.5036656857, 0.206700325, -0.0675949156, 0.0471132696, -0.1141041443, -0.1690891534, -0.1501902193, -0.2663768828, 0.2185668051, -0.1282700002, -0.150129199, 0.525580883, 0.1210808903, -0.0323453546, 0.0362354368, -0.1084238067, -0.1963131279, 0.4880461991, -0.1885196269, 0.0312876329, 0.1449318975, 0.3960083425, 0.1007951126, -0.237194106, -0.1993573904, 0.0358267836, 0.0104084238, 0.2304918319, 0.0124626681, -0.0573115051, 0.4358995855, -0.2884274125, -0.0393665805, 0.1249903068, 0.0571255647, -0.0100627989, -0.1664895117, 0.3173388243, 0.141789034, -0.0154541582, 0.0820578411, 0.1560010612, 0.274492085, -0.2671563625, 0.1516213119, -0.2489776909, 0.1365276873, -0.1008699834, -0.0263798907, -0.0152858496, -0.0500315204, 0.3457330465, 0.959710896, -0.0387768447, 0.0324346423, 0.1088814735, -0.2438544035, -0.2485950738, 0.3327146769, 0.2219969928, 0.3681363761, 0.255066514, 0.2786222398, -0.0596296713, 0.384978056, -0.2170823514, 0.2478820831, 0.1016417593, 0.1226854026, -0.0602644123, 0.0111215971, -0.1178101823, -0.372544378, 0.2336733192, 0.2865145206, 0.2004960626, -0.0297945663, 0.2682924569, -0.5310762525, -0.6335401535, -0.0419786163, -0.2432368696, -0.1427951306, -0.2481583357, 0.2725825012, -0.5574783087, -0.108546868, 0.2909507155, 0.4410872161, -0.0919118673, -0.1788233221, 0.1353019625, -0.2354327738, -0.274987638, -0.5670451522, 0.2050750405, 0.0931927338, 0.1703080386, 0.1206255481, -0.2440241873, 0.0810178891, -0.0437349416, -0.4981172681, 0.1700589508, -0.2002721578, 0.281632632, -0.0635290742, 0.0004736297, -0.4595284462, -0.0440798141, 0.0705250204, 0.1709949672, -0.3872296512, 0.0093740001, -0.0262726918, -0.0521982238, -0.1576289386, -0.7814694643, -0.5482571721, -0.0636084154, -0.1323072016, -0.1232257113, 0.0307009146, -0.0221328754, -0.1314078271, 0.0421978608, 0.0472829789, -0.107987158, -0.3893260658, -0.1267874539, 0.1431223303, -0.1554429531, -0.3047044277, 0.2366574407, 0.0481763631, 0.4225664735, -0.2196066976, -0.347296834, -0.1204654127, 0.0563915521, 0.1077350751, -0.3534256816, -0.1191997603, 0.5090581179, -0.0179277491, -0.0089257769, -0.1515682489, 0.038234964, 0.1233561635, 0.2782584429, 0.3900001049, -0.4099954069, 0.5990188718, 0.3242693543, 0.2691345215, 0.1265040636, 0.1426517218, 0.143293336, -0.0658832267, 0.1140461266, -0.0823447108, -0.0694597065, 0.4828378856, 0.0637096167, 0.0272547305, 0.4788175523, -0.0245167911, -0.1713119745, -0.1844299734, -0.1877020001, -0.1659408361, -0.2019788772, -0.0622821301, -0.432559818, 0.3646171987, 0.2551708221, 0.29610461, 0.1527628303, 0.015542239, 0.214296937, 0.0851204321, 0.2849899232, 0.1448103786, -0.6591541767, -0.4503851235, -0.1865546405, 0.1234262586, 0.0855080783, 0.2387639731, -0.2729606628, 0.1774844825, 0.2363273501, 0.0362734422, 0.6784837246, -0.2564087808, -0.2933883071, 0.0935813785, 0.1132452786, 0.0536970347, 0.0061188191, -0.0851855874, 0.3044101, 0.3356394172, -0.0737799108, -0.2037023008, -0.2334940284, 0.0725350901, 0.2756066322, -0.3622871637, 0.0017339028, 0.0183098093, -0.3184655309, -0.2057560682, -0.1192359403, 0.2498416305, -0.0027278252, 0.0554808974, -0.0868657753, 0.2147668302, 0.0321337506, -0.0261011869, 0.1267832071, 0.2505826056, 0.022690285, -0.0493063107, -0.0068110535, 0.133060962, 0.0133358296, 0.190278247, -0.0447797999, -0.1839898676, 0.1142015681, -0.3886478841, 0.4801164269, 0.1302573681, -0.022374317, 0.0211538188, 0.2246539891, -0.1637253016, -0.061212521, -0.0564255826, 0.3183376789, 0.0541255362, -0.0847123414, -0.2531457543, 0.0157669764, -0.1968727112, 0.07394135, -0.1369459629, -0.0791200101, -0.3975173831, 0.4556827247, 0.1212806553, 0.7878769636, 0.1390989721, 0.1330154836, 0.1484576315, -0.2146421075, 0.3469107747, -0.1996753514, 0.0509753898, -0.0857912228, 0.0808559507, -0.1684206426, 0.2117109299, -0.0176616162, 0.348562777, -0.1559047401, 0.3202444911, 0.3486589789, -0.2753962576, 0.3074085116, 0.0692006946, 0.2205928117, -0.0945587754, -0.0573926084, 0.1753157228, 0.1122529283, 0.2840490937, -0.0421051905, -0.2589122653, 0.085390076, -0.058369007, -0.2240601182, 0.0409723967, -0.3553410172, 0.2102051824, -0.1173309088, -0.4628446102, 0.3120926917, 0.2903682888, 0.3461302817, 0.1490778327, -0.2801380157, 0.4850562513, 0.0923700631, 0.1833778918, 0.3302989304, -0.0601474382, 0.4175025821, -0.2193598896, -0.247505635, 0.1360424757, -0.2273778915, 0.1020634919, -0.650419116, 0.0804630816, 0.0082204733, 0.1127504483, -0.1060498208, 0.1084770411, 0.0669878721, -0.2709406614, 0.1626634151, 0.1567840576, -0.1053352207, 0.228572011, -0.1622867286, -0.0724319443, -0.1819042861, 0.2074663639, 0.2294248044, 0.0350677222, 0.6079998612, 0.177573204, -0.0141877085, -0.2541287541, 0.1796360314, -0.0665782839, -0.325199008, -0.0479486473, 0.2189279348, 0.2051668167, -0.0850143731, 0.0971976668, -0.1367194355, -0.276907593, -0.0489876829, -0.4096365273, -0.0944937542, 0.2128801495, -0.0337426923, -0.2400588542, 0.1149062365, 0.3987501264, 0.1066143364, 0.1629965454, -0.3291783333, 0.2155854106, -0.2183157802, 0.160819605, -0.1214575171, -0.0708763152, 0.2643537223, -0.0111167654, 0.0817811862, -0.1284231395, 0.0617266782, -0.2129899561, -0.0690181553, 0.0385484546, 0.1084224582, 0.1545950472, 0.0985842049, -0.1769916415, -0.0905824453, 0.2229059041, -0.0325191282, -0.0857415125, 0.0031744055, 0.3812494874, -0.0563384406, 0.0034464933, -0.2623740435, 0.0191901028, 0.2412519306, -0.0005891062, 0.1244043782, 0.1977642775, 0.2756616473, 0.0010224208, -0.2014321536, -0.2218725979, -0.1708760858, 0.0243089311, 0.2697989941, -0.2374149263, 0.057311587, 0.054702539, -0.0651953816, -0.0607502013, -0.2839906812, 0.2237012982, 0.3925491869, 0.2249377668, -0.4344300926, 0.0377568118, 0.0820375532, -0.2965414524, -0.0091946051, -0.066365853, 0.2731380463, 0.2848383188, 0.4747730196, 0.0864742249, 0.1784644127, -0.2362237275, 0.0068642572, 0.143535316, -0.143645525, 0.1766198426, 0.1010343507, -0.1597588956, 0.0267660003, 0.3241794407, 0.2022078484, 0.2690439522, 0.1170289516, 0.2710116506, 0.0689442977, -0.1939541698, -0.1826101393, -0.043903023, 0.0042057075, 0.0085675102, 0.1069435626, 0.2234369665, 0.0276105069, -0.2771239281, -0.1273938864, 0.3374984264, -0.2935268879, -0.0225015171, 0.1256631017, -0.0453940928, -0.0166809633, -0.0035405606, -0.1144257635, -0.096877709, -0.2248789668, 0.2747930884, -0.2744379044, 0.0866867751, -0.2334065586, 0.0101316106, -0.2466107607, -0.0226038918, 0.5441878438, 0.1120966971, -0.0789515451, 0.0401856564, -0.0063092187, 0.0046298453, -0.1731769741, -0.3625851572, -0.0365521684, 0.0442517586, -0.1444821954, 0.0325332209, 0.4947679043, 0.2612550557, 0.190444693, 0.2604638934, 0.1738148928, -0.1474999785, 0.1729814708, 0.300262332, -0.0797090754, -0.2932744026, 0.1676613092, -0.0861578584, 0.0768185556, -0.324053973, -0.252967, -0.4617142081, 0.0657514334, -0.1046209633, -0.1675474197, -0.0957542285, -0.0988185704, 0.1194551513, -0.1426171958, 0.3566015959, 0.340472579, 0.1341150105, -0.1007144302, -0.2554681599, -0.3600755334, -0.0783694014, 0.0668040514, 0.1585810035, -0.1292597204, 0.1715534776, 0.4762702286, 0.0464806482, 0.0491879508, 0.1647152752, -0.0708701909, -0.0575918257, -0.4569234252, -0.2759056985, -0.1950781345, 0.3763602078, -0.1380447149, -0.0073046833, 0.1454736739, 0.4115010202, -0.0047128052, -0.3350495398, -0.0586323477, 0.1186081618, -0.0255452674, 0.3235163093, 0.3283948898, 0.293972075, -0.1925685555, 0.2201743126, 0.1869620085, -0.2465391755, -0.0961992368, 0.2874065638, 0.086451672, 0.1841493249, 0.0069164261, -0.2039062232, -0.0543045066, 0.2042928934, 0.0147122219, -0.1221378371, -0.3691647649, 0.2334662676, 0.0279792398, -0.0248183645, 0.2751078904, 0.4426382184, -0.0597260296, -0.1823960394, -0.3170248866, -0.0001689643, 0.1756588966, -0.2104924917, -0.1348284185, 0.0475177467, 0.0052326098, -0.0084626675, -0.104958415, -0.2532360554, -0.0389873087, 0.4291752875, 0.1130805239, 0.1306881011, 0.4553578198, 0.3467688262, 0.1456327885, -0.0524483323, 0.1252945215, 0.2982237935, -0.2289769948, 0.1635677069, -0.1215904206 ]
https://github.com/huggingface/datasets/issues/2135
en language data from MLQA dataset is missing
I close the ticket, since I do not see any en existing, they have trained on "SQuAD V1.1" instead. Thanks.
Hi I need mlqa-translate-train.en dataset, but it is missing from the MLQA dataset. could you have a look please? @lhoestq thank you for your help to fix this issue.
20
en language data from MLQA dataset is missing Hi I need mlqa-translate-train.en dataset, but it is missing from the MLQA dataset. could you have a look please? @lhoestq thank you for your help to fix this issue. I close the ticket, since I do not see any en existing, they have trained on "SQuAD V1.1" instead. Thanks.
[ -0.0614050925, -0.055039674, -0.1854838133, 0.083959043, 0.1434618384, 0.2676544189, 0.1858890802, -0.0415907912, -0.1807013452, 0.1482947469, 0.2283989787, 0.1972754598, 0.1776250899, 0.3383449316, 0.3166696131, -0.2478697002, -0.0484907776, -0.017990388, -0.0484795012, -0.4285932779, 0.0541551933, 0.2352595925, -0.3574400544, 0.0050517954, -0.2183550298, 0.156654641, -0.3980644941, 0.187737003, 0.0598654523, -0.1359651238, 0.2692226171, -0.3328849673, 0.3129377365, -0.2540805936, -0.0001056774, 0.0122205019, 0.081198141, -0.415936619, -0.1993283331, -0.162603274, -0.2880622149, -0.2823453546, -0.2393743396, -0.2648055553, -0.2193343639, 0.2201205641, 0.344327122, -0.5083237886, 0.3320853114, 0.3818939924, 0.1968887001, 0.0395648107, 0.0926602781, -0.1524073035, -0.0093365982, -0.0729983002, 0.1497445405, -0.0014476608, 0.2738119662, -0.0678198114, 0.156398803, 0.4081828892, 0.2631129622, -0.2174048126, -0.0966820568, 0.1399405599, 0.4089864194, -0.5473685861, 0.1374900937, 0.0993199795, 0.3717149794, -0.1057601571, -0.3758933842, -0.0194034204, 0.2659439743, -0.0150939897, 0.1812552065, 0.3444663882, -0.1382594556, 0.2090100348, -0.0271235593, -0.3029955626, -0.1229965389, 0.1439062655, -0.3219056726, 0.277784586, 0.180532217, -0.0605955273, -0.1598589867, 0.1292635649, 0.2392047197, 0.206847623, -0.1283605844, 0.2811946273, -0.3318508565, -0.2662267983, -0.0694768354, -0.1709131598, -0.0941290557, -0.3655152619, -0.3424853683, 0.1182674766, 0.1825279593, 0.0852196962, 0.165142417, 0.0044158548, 0.2554108202, 0.07121519, -0.0691667497, -0.4249578118, -0.0405896977, -0.0316136777, -0.1165061891, -0.0557380915, -0.4660693407, 0.3323317766, -0.0607327782, -0.2391404063, -0.3966360092, 0.0730464756, -0.6150509119, -0.0928712189, -0.0460387245, 0.0860480368, 0.0689229891, -0.0985741988, -0.0307652168, 0.0924641937, -0.2274391651, -0.4822271764, -0.2362546325, 0.2626545727, -0.1490527093, -0.1555287242, -0.0512125231, 0.1021776944, 0.4211606681, -0.1078578234, -0.0333038978, 0.0805080086, 0.1542167664, -0.077784799, 0.0942644924, -0.0650053248, 0.1820980161, 0.020961225, -0.005597468, -0.3666208386, 0.1188592017, 0.2223933935, -0.5026972294, -0.0869516879, -0.3409615159, 0.2205948234, -0.0634133816, -0.2910003364, 0.4000847042, 0.4645342529, -0.0290918797, -0.0116881654, 0.1916275173, 0.0152747128, -0.1655335426, 0.0587171391, 0.1839258373, 0.2479293793, -0.6743546128, -0.3153381646, 0.2034636736, -0.0352098197, 0.196829617, 0.2301512361, -0.2615665197, 0.0696139857, -0.1940802038, 0.112158969, 0.1704316735, -0.6116740704, -0.3677037358, 0.0222883448, -0.0779981166, -0.3776444793, -0.1448691785, 0.0998804718, 0.2610708773, -0.0236978792, 0.2579841316, 0.3530294299, -0.178316161, -0.197126478, -0.1738870889, -0.0527913533, 0.2627729475, 0.3654528558, 0.1484461725, -0.2631186843, 0.0485100783, 0.1426053643, 0.1779535115, -0.2317243367, 0.1725400388, 0.5178678632, -0.0805443227, -0.0635042191, 0.058481656, 0.1955316961, -0.2065800726, 0.0163487643, -0.780002296, 0.2138624787, -0.0132612213, -0.1210643724, -0.0612703934, -0.0453794077, -0.2260607779, -0.2495139539, 0.1818476766, -0.3295177817, -0.1632549465, 0.3572051227, 0.1028449684, 0.1105436683, -0.1355046332, 0.0349661894, -0.193773061, 0.4484164119, -0.3351696432, 0.0082158893, 0.1537080407, 0.4459815323, 0.1235240325, -0.0344229862, -0.0051254891, -0.0497262292, -0.0372594856, 0.0708750859, 0.2649090886, -0.2318826169, 0.5788725019, -0.3073803782, 0.1909391582, 0.1267109513, 0.0165007487, 0.0356324017, -0.3685254753, 0.3260650635, 0.2498883605, -0.2839770019, 0.0070404038, 0.3589638472, 0.1375345588, -0.1451908648, -0.0582831055, -0.1105428338, 0.1184331402, 0.0118988939, 0.0044006109, 0.0775824636, -0.1125825047, 0.1153248623, 0.7596583366, 0.2361645103, 0.2454379797, 0.0513625853, -0.2074975073, -0.1795810908, 0.3047201335, 0.0839869529, 0.2399900109, 0.1667072922, 0.0910313278, -0.0672454461, 0.2820443511, -0.0970268697, 0.2189870328, 0.0220772102, 0.1279477626, -0.217618227, 0.0640211478, -0.0449231826, -0.3568543792, 0.0635779053, 0.2387515604, 0.1498511881, 0.021278128, 0.0785309002, -0.3708968163, -0.5073184967, -0.1364303678, -0.2138954103, -0.2516548634, -0.1184655279, 0.200953424, -0.740101397, 0.1231379658, 0.3331770301, 0.3358399272, -0.0423548222, 0.0280857384, 0.0819606259, 0.0098552331, -0.1406043768, -0.349067539, 0.1282381415, -0.0401224121, -0.0030070059, -0.0462613925, 0.0058607757, 0.1768617481, -0.2486250699, -0.4871397316, 0.0777586251, 0.005794704, 0.2682493329, -0.0086447783, 0.0188809484, -0.7526347637, 0.00993203, 0.1184595525, 0.2236755192, -0.3405578732, -0.1409541965, -0.1712236106, -0.1047273874, -0.0248473808, -0.6468248963, -0.7372846007, 0.0305311307, -0.1459038407, -0.0095175132, 0.0076139132, 0.0457624085, -0.0772761852, 0.0728076249, -0.0398347788, -0.2196210623, -0.429032445, -0.2455874383, 0.2960591912, -0.0311711784, -0.3616070747, 0.1702851504, -0.010329634, 0.4533660412, -0.1900149137, -0.3280903697, -0.1765519083, 0.3218611777, -0.0206318349, -0.366864115, -0.053116031, 0.5032517314, -0.0359732062, 0.0076298416, -0.1105420887, -0.2325089276, 0.071372509, 0.3401717246, 0.5897239447, -0.5921171904, 0.4528934062, 0.2750667036, 0.2953700721, 0.1158090904, 0.1370681524, 0.1581323147, -0.0287461989, 0.1398791075, 0.161473006, -0.1506818384, 0.5780958533, 0.0713341162, 0.0526368767, 0.3350732625, -0.0279415026, -0.3929466605, -0.1691908836, -0.128537342, -0.0786943361, -0.1181917712, -0.0027432386, -0.1899479628, 0.3600900173, 0.2566944957, 0.4055581689, -0.0171050169, -0.0736015663, -0.0285913087, 0.0400485247, 0.3247717917, 0.1903120875, -0.6184052229, -0.5788434744, -0.1188432425, 0.122524634, -0.0285573769, 0.5415171981, -0.1055406928, 0.2024663836, 0.2616970539, 0.1445030719, 0.5555590391, -0.2430685759, -0.3454243541, -0.1314902008, 0.2881121039, -0.1918624192, 0.0003881529, 0.0294638202, 0.3925943971, 0.4314257205, -0.231402874, -0.0087483227, -0.0813298374, 0.3801353574, -0.0343821272, -0.2577850223, 0.0386751518, -0.2340866029, -0.1954464316, -0.2207711935, 0.1956866384, 0.0967209712, -0.1245616153, 0.2882354558, -0.1875132918, 0.2321537286, 0.1594731212, -0.0067620203, 0.1188303828, 0.2844281793, 0.0932019949, -0.0574471429, 0.1403882056, 0.2352663875, -0.0003655814, 0.1646571755, -0.0287072249, -0.2687041163, 0.307723254, -0.371004343, 0.659548521, 0.2251632214, 0.0923565179, 0.1156469136, 0.3028036952, -0.2651200891, 0.0741764754, -0.2305079997, 0.2964479923, 0.2582292855, -0.2570076883, -0.2314123213, -0.0073870346, -0.0777810067, 0.1871107519, -0.2283023894, -0.0687550902, -0.1671074182, 0.4020507932, 0.1825672984, 0.8222821951, 0.0411859825, 0.1029220819, -0.1251330525, -0.1052088663, 0.2631599009, -0.195330441, 0.2854100764, -0.2273685336, -0.057622306, -0.1682811975, 0.0172701105, 0.1919312775, 0.4000086486, -0.333861053, 0.2994181514, 0.300461024, -0.1776115149, 0.217597574, 0.0608497411, 0.0637609661, -0.2100921869, -0.3378988504, 0.1408401132, 0.0805337206, 0.3642495871, -0.2449507266, -0.1419682056, 0.1068862602, -0.0784859508, -0.1326034218, 0.0144890025, -0.3802135885, 0.1874953508, -0.0113340197, -0.4910612702, 0.2870210111, 0.4773975015, 0.3643171191, 0.355056107, -0.2171394527, 0.5245866776, 0.1262669861, 0.0144238323, 0.3423662484, 0.0047788024, 0.2060929984, -0.2244209647, -0.3705042303, 0.2566948533, -0.0961596742, -0.0323480517, -0.5521185994, 0.2968835235, 0.1679379344, 0.1947369576, 0.0181639753, 0.0970333368, 0.0722466856, -0.2222661972, 0.1337296516, 0.2241179347, -0.0378128625, 0.2564705908, 0.1661892235, -0.1043713093, -0.1268913895, 0.3687801361, 0.2147457302, -0.0532688871, 0.55889678, 0.0592471212, 0.0342617109, -0.2540688217, 0.1239343137, -0.0739684701, -0.1375688761, -0.2623915076, 0.1452249885, 0.1997595876, -0.0292997174, -0.207223177, -0.0644628704, -0.3883131444, -0.062243104, -0.3872435093, -0.2752887905, 0.0754098892, -0.1133894697, -0.1229306385, 0.2124044597, 0.1649701446, 0.2495990694, 0.0781826302, -0.32275635, 0.1679515839, -0.3973314464, 0.2239514887, -0.0156785902, -0.2213272303, 0.1106731892, -0.1090316176, 0.1154886112, -0.0890562385, -0.0444082767, -0.1464460641, 0.2121853232, 0.0551634878, -0.0651094317, 0.2640429437, 0.0133862086, -0.1056006253, -0.2285672128, 0.2656397521, -0.1158117205, -0.0032507852, 0.0955170691, 0.3260478079, -0.1100255325, 0.038317278, -0.0806021988, -0.1450046599, 0.3147145212, -0.0462799817, 0.1328766644, 0.3403071165, 0.2551242113, -0.0365941525, -0.1440804601, -0.0459792316, -0.0227453783, 0.2281866819, 0.1698561609, -0.3522878587, 0.0159065649, 0.1860780865, -0.2250194252, -0.0564572923, -0.303271234, 0.2272312343, 0.3637156785, 0.2269957811, -0.5343983173, 0.0066712834, 0.23716259, -0.1729505509, -0.0136546269, 0.01147414, 0.327737689, 0.2638813555, 0.4061787128, 0.2645317614, 0.1514027119, -0.3466751575, 0.0302949548, -0.0275241099, 0.0107519627, -0.01510581, 0.2258540094, -0.1222214103, -0.0129909329, 0.4565228522, 0.0838123858, 0.2531336248, 0.3350510001, 0.1993783414, 0.1543694586, -0.1966709197, -0.2339610308, 0.1665222496, -0.0543208122, -0.0105109215, 0.1204891056, 0.4063558578, 0.0876701921, -0.4291988611, -0.2303835601, 0.1484024376, -0.4381044209, 0.0428761393, 0.0961065292, -0.0571986511, 0.1284680814, -0.0854216293, 0.0644625276, -0.0612091757, -0.2336715907, 0.1906646788, -0.1822255105, 0.1038994044, 0.0218741931, 0.2557957172, -0.2054534256, -0.1098106802, 0.3854256272, -0.1390032619, -0.1274636835, 0.0623373538, -0.0519587733, -0.0155727603, -0.1701724082, -0.1637910157, 0.1574183106, 0.1103960723, -0.169378832, 0.0059028491, 0.3001662493, 0.4074697495, 0.057310205, 0.1915334016, 0.1729011238, -0.0654351041, 0.0593619794, 0.273845613, -0.0784708634, -0.1262732446, -0.02353964, 0.0622573942, 0.0210813656, -0.3662451208, -0.1674962789, -0.3806776702, -0.0889191255, 0.038485989, -0.0417639576, -0.0341715999, -0.1998296976, 0.110335961, -0.1457628608, 0.2659995556, 0.3386375904, 0.0957284123, -0.1506839842, -0.2072253227, -0.4805026352, -0.0058464184, 0.0607662052, 0.1942613572, -0.0576736704, 0.3267646432, 0.3132943213, 0.1676272452, 0.2692522109, 0.01585434, -0.0096583404, -0.1015054435, -0.5356667042, -0.1428375542, 0.060253907, 0.3365089297, -0.0301469341, -0.0276466608, 0.1668958664, 0.2043224722, 0.009736754, -0.3536173701, -0.1598586589, -0.0763356239, -0.0097768707, 0.3959163129, 0.0836946964, 0.3392042518, -0.0668991953, 0.1712938547, 0.1589924395, -0.1978261471, -0.0206470303, 0.2478116304, 0.1892027855, 0.1112446561, -0.0699776188, -0.2354997098, 0.018930085, 0.3167833388, 0.1663198769, -0.1713154167, -0.4148258567, 0.368324846, 0.0656669959, 0.1231917292, -0.1091121733, 0.2324762642, 0.0158611089, -0.0653180256, -0.2101465166, 0.0055042058, 0.3044304848, -0.156605199, 0.0137655437, -0.3062791228, 0.0810976774, -0.1050598919, 0.0411877036, -0.2789292932, -0.0896052867, 0.3944662213, 0.0517786704, 0.0519361645, 0.2999485731, 0.0418100357, 0.1855542362, -0.1216882169, 0.1529165953, 0.0919363275, -0.1553379595, 0.1783640683, -0.1917356253 ]
https://github.com/huggingface/datasets/issues/2134
Saving large in-memory datasets with save_to_disk crashes because of pickling
Hi ! Indeed `save_to_disk` doesn't call pickle anymore. Though the `OverflowError` can still appear for in-memory datasets bigger than 4GB. This happens when doing this for example: ```python import pyarrow as pa import pickle arr = pa.array([0] * ((4 * 8 << 30) // 64)) table = pa.Table.from_arrays([a], names=["foo"]) pickle.dumps(table) # fails with an OverflowError pickle.dumps(table, 4) # works ! ``` We'll do the change to use `protocol=4`. Moreover I've also seen other users complain about this error ``` struct.error: 'I' format requires 0 <= number <= 4294967295 ``` It looks like something related to the 4GB limit as well but I'm not able to reproduce on my side. Do you think you can provide a script that reproduces the issue ? How big is your dataset ? (number of bytes, number of rows)
Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ```
134
Saving large in-memory datasets with save_to_disk crashes because of pickling Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ``` Hi ! Indeed `save_to_disk` doesn't call pickle anymore. Though the `OverflowError` can still appear for in-memory datasets bigger than 4GB. This happens when doing this for example: ```python import pyarrow as pa import pickle arr = pa.array([0] * ((4 * 8 << 30) // 64)) table = pa.Table.from_arrays([a], names=["foo"]) pickle.dumps(table) # fails with an OverflowError pickle.dumps(table, 4) # works ! ``` We'll do the change to use `protocol=4`. Moreover I've also seen other users complain about this error ``` struct.error: 'I' format requires 0 <= number <= 4294967295 ``` It looks like something related to the 4GB limit as well but I'm not able to reproduce on my side. Do you think you can provide a script that reproduces the issue ? How big is your dataset ? (number of bytes, number of rows)
[ -0.3168885708, 0.0995954871, 0.1197798997, 0.370888114, 0.2521230876, 0.0021295473, -0.2834976614, 0.4639683366, 0.1905569285, 0.0964653268, 0.0808832496, 0.514664948, -0.398909539, 0.2905989587, -0.1574800611, -0.0833725929, 0.2200171351, -0.1045617238, -0.2615801692, 0.1710370332, -0.2519756556, -0.1009905338, 0.0205410123, -0.165963918, -0.1712374985, -0.3141446114, -0.0271554478, 0.3956109583, -0.319367975, -0.3452962041, -0.1409768164, -0.2231155038, 0.2281502336, 0.3274104893, -0.0001218503, 0.0387924537, 0.1374743879, -0.1475671828, -0.496276319, 0.0046150312, 0.0253552347, -0.5504591465, -0.1945041716, -0.250411272, 0.3338279128, -0.0910535157, 0.1185291335, -0.3753316402, 0.2385227084, 0.2061813623, 0.140699327, 0.3183524907, 0.2884154022, -0.0236260407, 0.0810792819, 0.2532388866, -0.2371629179, 0.2104443014, 0.2143959999, 0.0940104425, -0.0697053671, -0.1063087732, -0.0489086583, -0.2752484083, 0.0091197388, -0.0715226978, -0.3575344086, -0.2352929711, 0.1131326109, 0.1359725296, 0.205855757, -0.4716522396, -0.6115643382, -0.4440330863, -0.0978169739, -0.2725952268, 0.0673026741, 0.2560088336, -0.0856658816, -0.009138193, -0.148708716, -0.5428614616, 0.0650520623, 0.0935427099, 0.3128339648, -0.264057368, -0.2599281967, 0.2104807049, 0.4827488959, -0.2832578421, -0.2492698282, -0.198986277, 0.0249469057, -0.0148133207, -0.0100060422, -0.1636584103, -0.0667286366, -0.0531581528, 0.2876333594, 0.1288199872, -0.0264492668, 0.1699507833, -0.318428874, -0.0102005024, 0.3466803133, -0.054285422, -0.2104746997, 0.3277968168, 0.3184900284, 0.0511620082, 0.115170449, 0.0862564668, -0.0244315639, -0.1946862787, 0.0468380675, -0.139344722, 0.1426374167, -0.1221713424, -0.0298000276, 0.1717310995, -0.1409708261, 0.2041665614, -0.0327624828, 0.2195820212, -0.0259776246, 0.0620771274, -0.2864436507, 0.0794296265, -0.1583690643, 0.075129047, -0.1170247495, 0.1987028271, 0.0240922272, 0.2353447527, 0.1321486831, 0.0247919001, 0.2072656751, -0.0151788928, -0.2567569911, 0.1097204834, 0.0652007088, -0.4047945738, 0.1266949475, 0.2791753411, -0.0430322886, 0.1116226166, 0.0867823213, 0.0422738791, -0.2407934368, 0.1412681192, 0.0091914264, -0.2104310095, -0.0454821289, 0.0081622964, -0.1934384853, -0.1259149015, -0.5878511667, 0.0739091486, 0.3553925455, -0.176640898, -0.1262132823, -0.264007628, -0.1701361835, -0.3441281319, 0.0026653111, 0.3127558231, -0.3485508263, 0.1430540085, -0.0181170516, 0.176834926, 0.5048040748, 0.428178966, 0.0170926154, -0.0940090567, -0.2584463656, 0.4258441925, 0.2039241493, -0.0345925242, -0.4821709692, 0.1800986528, 0.0055720583, -0.0328228287, -0.1284404695, 0.1374111474, 0.0278898999, -0.0201428235, -0.0864941627, 0.175122112, 0.0206468049, 0.1888284981, -0.3232865036, -0.4281208813, -0.0569950119, 0.0229819864, -0.0687387213, -0.0665231943, 0.0438071229, -0.2526403069, 0.1586157084, -0.1642064005, 0.2267968506, 0.3692832589, 0.3107088506, -0.1413411498, -0.2410430312, -0.2540669143, -0.3209949732, 0.2904056311, 0.1346237361, -0.2128845006, -0.294292599, 0.0248157978, -0.0160083435, 0.0344790667, -0.0461658202, 0.392996043, -0.0561231896, -0.0432414189, 0.20988819, 0.1974905431, -0.0971102342, -0.1669193804, -0.2190025151, 0.122819148, -0.2471027374, 0.1366459131, -0.0582225993, -0.4469139874, 0.056894809, -0.0252147876, 0.0113013266, -0.1903936267, -0.0567968488, 0.1131046563, 0.2439712882, -0.0361532457, -0.084445715, 0.1641013324, 0.0477743447, 0.052743569, 0.1824994832, -0.0172294509, 0.2800441384, 0.0196369886, -0.1887227297, 0.3480972052, 0.0926223397, 0.1415980458, 0.3416218162, -0.1152978092, 0.0515542552, 0.0729830563, 0.2104122043, -0.1721228957, -0.1512311697, 0.1688512862, 0.3553532958, -0.0358187556, -0.3565799594, 0.0416288152, 0.5232880712, 0.0071558356, 0.413918376, 0.2888956666, -0.0300790071, -0.1796032637, 0.0495372862, 0.148982361, 0.4825510383, 0.0719781369, 0.2031984329, -0.0497339964, 0.0984950885, -0.0927228779, 0.0490244925, 0.1893743426, 0.21433267, 0.2653185427, 0.1862360686, -0.0225451607, -0.398563534, 0.0068511963, -0.0103280917, 0.2490283102, -0.1407551467, 0.1229114309, -0.3488911688, -0.0930569842, -0.1756008416, 0.0690053478, -0.0824649334, -0.3389723599, -0.2977800667, 0.398057729, -0.3791892231, 0.0952739343, -0.0824062303, 0.2396452129, 0.1588453948, 0.0193316843, 0.0811566561, 0.1053370982, -0.1719752997, -0.075300619, 0.3932116032, -0.1783617437, 0.4449947774, 0.294257164, -0.2515662909, -0.5642058849, -0.009631224, 0.09723261, -0.0446407646, 0.2913727164, 0.1569108665, 0.2594356835, -0.0637071878, 0.1674997509, 0.028589949, 0.1679050475, -0.204867363, -0.0965481028, 0.1249713972, 0.1148410589, 0.0120951533, -0.1214812249, -0.3409331143, -0.3965242505, 0.4174041152, -0.032572221, 0.1087350026, 0.2555637956, 0.3698807955, 0.3338322341, 0.164670378, 0.0131675787, -0.0795587897, -0.200690195, 0.2692922652, 0.0735172108, -0.2851144671, -0.1685408056, 0.116395101, -0.1761889458, 0.1963485032, -0.296160996, 0.2146088183, -0.5010896921, 0.1750911325, -0.0738696381, 0.1984625012, 0.3098812401, 0.067066513, -0.0232706964, 0.0926835686, -0.0622302257, -0.024926573, 0.3186886609, 0.2138708681, 0.0005783308, 0.2953262925, 0.2987184525, 0.658223629, 0.1857359111, -0.229964897, 0.5270457268, 0.1381633133, 0.2322870791, -0.2867576182, -0.1393385381, 0.0083176531, -0.383877933, -0.1529007852, -0.1136157513, -0.0768499896, -0.0046237167, 0.2487114519, -0.0195935704, 0.1959053278, -0.2433721423, 0.2963942885, -0.1548439264, 0.0354569778, -0.0472513661, 0.097138837, -0.0689582378, 0.0404468663, 0.0264080316, -0.0312320963, 0.4733625352, 0.0213882998, -0.2703006268, -0.0847993046, -0.6920446754, 0.1975384802, 0.1649115533, 0.411051482, -0.0430319682, -0.3325484395, -0.194201827, -0.0915497243, 0.427323997, -0.0838774219, -0.1816160977, 0.1226128638, -0.0661409646, -0.3708955944, 0.014026612, 0.0454738513, 0.5089049339, -0.0749645978, 0.6180592775, -0.2792036533, 0.0359989591, -0.0625112355, 0.5453642607, -0.0798204243, 0.0674054697, -0.1730719358, -0.3623583317, -0.4296311438, 0.0478501916, 0.0823839828, -0.0268802196, -0.1800902784, -0.0236998349, -0.1829954386, -0.1946382225, -0.0307063609, -0.2555564642, 0.1911633462, -0.232670933, 0.2806385458, -0.080012843, 0.1896322817, 0.6002491117, 0.4785455465, -0.0664899945, -0.1000175327, 0.0531213954, 0.2909657061, 0.3145469725, 0.2713963389, -0.0265566409, 0.1282557547, 0.1029752493, 0.0896628276, -0.4230407476, 0.2618329823, 0.0376053527, -0.159441039, -0.4124113917, -0.20015347, 0.5952424407, 0.2829304338, 0.1778112054, 0.1629557014, 0.0327455848, -0.111343272, 0.3195310831, 0.0468818508, 0.7377001047, -0.0492729656, 0.3859352171, 0.1443641186, -0.1329418272, 0.3299087286, 0.2714164853, -0.0185040757, -0.4534935653, 0.0080828443, 0.0699943677, -0.1160737127, 0.2320919484, -0.0774203837, -0.2293434292, 0.2342054546, -0.2464666367, -0.3401261568, -0.2011540979, 0.2974869609, -0.4525097311, -0.3228260279, -0.0318483375, 0.0820498988, -0.1890284121, -0.0520337299, 0.0382166021, -0.0260015372, -0.1816879064, 0.0875810534, -0.3797726035, 0.075262323, 0.0180658773, 0.4964676499, -0.2078647912, -0.0943588018, 0.1373577714, 0.0333012566, -0.0198605694, 0.1730112582, -0.1235758737, -0.1225467548, -0.1923442185, -0.0259399153, 0.1587088555, -0.1749717891, 0.3594848514, 0.1130883992, 0.0593723804, -0.0185119212, -0.2020337582, -0.0545754246, -0.1769027859, -0.1465854049, 0.0577869378, -0.2877600491, -0.6232830286, -0.111554645, -0.2177120596, -0.3020793796, -0.0084354663, 0.2467582226, 0.1524902582, 0.3774372935, -0.1662783474, -0.0138625503, -0.0960467085, 0.5426025987, -0.2170471996, 0.3648028374, 0.5068681836, 0.1799971461, -0.206427604, -0.1599705219, 0.3782242537, 0.0054587089, 0.1507755667, 0.5503352284, -0.0991170928, 0.0169371814, -0.1889048815, 0.2538342476, 0.1505653411, -0.370757997, -0.160915494, -0.1064633057, -0.5591672659, 0.2067395598, 0.0927723944, 0.396738708, -0.1763737202, -0.1226248741, -0.2903544307, -0.028007362, -0.1391881704, 0.157817468, -0.2676870227, 0.0016691666, 0.1658401787, -0.0137936454, -0.0525888391, -0.1007535011, -0.0595299341, 0.1842211038, -0.0486182198, -0.0748259053, -0.0830293, 0.1172453836, 0.2271108627, -0.1736915112, -0.0266162325, -0.3926926553, -0.0113017512, -0.1907859147, 0.0279922336, 0.2519244552, -0.0885427892, 0.1128100082, 0.1268066764, 0.0777301416, 0.2172164321, 0.2322371155, 0.0071799997, 0.2455638647, 0.023315873, 0.3543139696, 0.2311374098, -0.2054191828, -0.2343903035, 0.0184837319, 0.2907339633, 0.0028006211, 0.3051241934, -0.2582033277, -0.1423428357, 0.255576551, 0.1525259316, 0.6202744246, -0.1304682344, -0.2227960527, 0.2998892963, 0.0897814035, 0.0638143271, -0.3358578086, 0.0940017626, -0.1985317767, -0.0703840405, 0.0349965394, -0.1245132834, 0.1647943109, -0.836609304, 0.06960015, 0.2907021642, 0.0823387653, -0.0154764634, 0.1485920846, 0.0258134305, -0.0169611759, 0.1871799678, 0.0637979135, 0.5537105799, 0.5625141859, -0.0818328038, 0.6099120378, 0.0296857245, 0.2446462065, -0.0165887512, -0.7433123589, 0.1946711391, 0.4049607813, 0.0361098796, 0.2161794454, 0.0082662515, 0.3752156496, -0.3950869143, -0.3191030025, -0.0506716259, 0.2922394276, -0.3702155352, -0.269880861, 0.0688756034, -0.1035977453, 0.1086753607, 0.3668444753, -0.2612330914, -0.0977838337, 0.3455853164, -0.0249213353, 0.0179145262, -0.1097211465, 0.0959116146, -0.0420458242, 0.289090842, -0.3097183406, 0.0306309666, 0.0174910016, -0.1720920652, -0.6128516793, -0.0106835049, 0.5050379038, 0.2819990814, -0.1961210668, -0.0660643131, 0.0685521662, 0.0303373411, -0.12914069, 0.0992150009, -0.1238472834, 0.1970008165, 0.4543985724, -0.0504103452, -0.0348029807, -0.0234675221, 0.0882916152, 0.2930333316, -0.1039104685, -0.0321988352, -0.0701636449, -0.3222334683, 0.1069180891, 0.1219473183, -0.1603210717, 0.1898336262, 0.568036139, -0.1474343687, 0.2258225679, 0.0884490833, 0.0404938161, -0.0526779331, 0.7015366554, 0.4067878425, -0.2560660243, -0.4636141062, 0.1385059357, -0.0690149665, -0.0021164417, -0.2306672633, 0.0536314994, -0.1855025738, 0.137277171, 0.1532154977, 0.0236977823, -0.2460392118, 0.28593871, -0.0149230249, 0.1722000539, -0.0651210323, -0.3166809678, -0.053701371, -0.1375624835, 0.0910059661, -0.634848237, 0.3538064957, 0.0071763135, -0.0413394682, -0.1618842483, -0.1475742012, -0.0180505365, 0.0729029179, 0.5200448036, 0.216836676, 0.2093252242, -0.2043678463, -0.4473113418, 0.0667584911, -0.0612405837, -0.0172181875, 0.1486823857, -0.1969656348, 0.5546962023, -0.1838609576, 0.6516254544, -0.372813642, 0.0651056916, -0.0792423487, 0.0196861215, 0.0209766105, -0.0593981259, -0.0028048009, -0.0336449258, 0.1575345397, 0.2505612671, -0.0595527291, 0.1921729445, -0.3644733727, -0.2029283643, 0.4465302527, 0.116966255, -0.1790779531, -0.093782559, -0.0345238522, 0.2249454856, -0.0534387082, -0.5481232405, -0.0274885595, 0.2250312269, 0.006643964, -0.291582644, 0.2220801115, -0.0191371925, -0.1319442391, -0.067482844, 1.1606020927, -0.264290452, -0.2252514213, 0.2253786027, -0.0351088569 ]
https://github.com/huggingface/datasets/issues/2134
Saving large in-memory datasets with save_to_disk crashes because of pickling
Hi! So I've managed to created a minimum working (well technically crashing) example for the multiprocessing case, I create a huge list of zeros, like in your example, and then I try to .map(None, num_proc=2) over it, which then crashes, here's the code: ```python from datasets import Dataset if __name__ == '__main__': ton_of_zeroes = [0] * ((12 * 8 << 30) // 64) large_dataset = Dataset.from_dict({'col': ton_of_zeroes}) print("Start") large_dataset.map(function=None, num_proc=2) print("Done - should not print") ``` The amount of zeros could probably be reduced, I haven't tried to minimize it to find the breaking point, I just increased it from your code (which by quick glance I assumed tried to allocate over 4 GiB) Running this results in the following traceback: ``` Parameter 'indices'=[ 0 1 2 ... 805306365 805306366 805306367] of the transform datasets.arrow_dataset.Dataset.select couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. Traceback (most recent call last): File "./crash_multiproc_pickle.py", line 7, in <module> large_dataset.map(function=None, num_proc=2) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ``` My datasets usually have hundreds of thousands to low millions of rows, with each row containing a list of 10 strings and list of vectors of different length (the strings tokenized), which in the worst case have 10\*512\*8 = 40960 bytes (but usually it is much smaller, as the vectors tend to be shorter. I need these groups of text lines to create training data for the Inverse Cloze Task. Anyway I don't think my particular dataset is relevant, as the tiny script I created also manages to crash. But I think the issue is the same as the save_to_disk, from the traceback it seems that in multiprocessing, it tries to use dill to return the result of the map workers, which tries to pickle the data and can't do it, probably because it's again using the older pickle protocol. That's my guess anyway.
Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ```
832
Saving large in-memory datasets with save_to_disk crashes because of pickling Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ``` Hi! So I've managed to created a minimum working (well technically crashing) example for the multiprocessing case, I create a huge list of zeros, like in your example, and then I try to .map(None, num_proc=2) over it, which then crashes, here's the code: ```python from datasets import Dataset if __name__ == '__main__': ton_of_zeroes = [0] * ((12 * 8 << 30) // 64) large_dataset = Dataset.from_dict({'col': ton_of_zeroes}) print("Start") large_dataset.map(function=None, num_proc=2) print("Done - should not print") ``` The amount of zeros could probably be reduced, I haven't tried to minimize it to find the breaking point, I just increased it from your code (which by quick glance I assumed tried to allocate over 4 GiB) Running this results in the following traceback: ``` Parameter 'indices'=[ 0 1 2 ... 805306365 805306366 805306367] of the transform datasets.arrow_dataset.Dataset.select couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. Traceback (most recent call last): File "./crash_multiproc_pickle.py", line 7, in <module> large_dataset.map(function=None, num_proc=2) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ``` My datasets usually have hundreds of thousands to low millions of rows, with each row containing a list of 10 strings and list of vectors of different length (the strings tokenized), which in the worst case have 10\*512\*8 = 40960 bytes (but usually it is much smaller, as the vectors tend to be shorter. I need these groups of text lines to create training data for the Inverse Cloze Task. Anyway I don't think my particular dataset is relevant, as the tiny script I created also manages to crash. But I think the issue is the same as the save_to_disk, from the traceback it seems that in multiprocessing, it tries to use dill to return the result of the map workers, which tries to pickle the data and can't do it, probably because it's again using the older pickle protocol. That's my guess anyway.
[ -0.3168885708, 0.0995954871, 0.1197798997, 0.370888114, 0.2521230876, 0.0021295473, -0.2834976614, 0.4639683366, 0.1905569285, 0.0964653268, 0.0808832496, 0.514664948, -0.398909539, 0.2905989587, -0.1574800611, -0.0833725929, 0.2200171351, -0.1045617238, -0.2615801692, 0.1710370332, -0.2519756556, -0.1009905338, 0.0205410123, -0.165963918, -0.1712374985, -0.3141446114, -0.0271554478, 0.3956109583, -0.319367975, -0.3452962041, -0.1409768164, -0.2231155038, 0.2281502336, 0.3274104893, -0.0001218503, 0.0387924537, 0.1374743879, -0.1475671828, -0.496276319, 0.0046150312, 0.0253552347, -0.5504591465, -0.1945041716, -0.250411272, 0.3338279128, -0.0910535157, 0.1185291335, -0.3753316402, 0.2385227084, 0.2061813623, 0.140699327, 0.3183524907, 0.2884154022, -0.0236260407, 0.0810792819, 0.2532388866, -0.2371629179, 0.2104443014, 0.2143959999, 0.0940104425, -0.0697053671, -0.1063087732, -0.0489086583, -0.2752484083, 0.0091197388, -0.0715226978, -0.3575344086, -0.2352929711, 0.1131326109, 0.1359725296, 0.205855757, -0.4716522396, -0.6115643382, -0.4440330863, -0.0978169739, -0.2725952268, 0.0673026741, 0.2560088336, -0.0856658816, -0.009138193, -0.148708716, -0.5428614616, 0.0650520623, 0.0935427099, 0.3128339648, -0.264057368, -0.2599281967, 0.2104807049, 0.4827488959, -0.2832578421, -0.2492698282, -0.198986277, 0.0249469057, -0.0148133207, -0.0100060422, -0.1636584103, -0.0667286366, -0.0531581528, 0.2876333594, 0.1288199872, -0.0264492668, 0.1699507833, -0.318428874, -0.0102005024, 0.3466803133, -0.054285422, -0.2104746997, 0.3277968168, 0.3184900284, 0.0511620082, 0.115170449, 0.0862564668, -0.0244315639, -0.1946862787, 0.0468380675, -0.139344722, 0.1426374167, -0.1221713424, -0.0298000276, 0.1717310995, -0.1409708261, 0.2041665614, -0.0327624828, 0.2195820212, -0.0259776246, 0.0620771274, -0.2864436507, 0.0794296265, -0.1583690643, 0.075129047, -0.1170247495, 0.1987028271, 0.0240922272, 0.2353447527, 0.1321486831, 0.0247919001, 0.2072656751, -0.0151788928, -0.2567569911, 0.1097204834, 0.0652007088, -0.4047945738, 0.1266949475, 0.2791753411, -0.0430322886, 0.1116226166, 0.0867823213, 0.0422738791, -0.2407934368, 0.1412681192, 0.0091914264, -0.2104310095, -0.0454821289, 0.0081622964, -0.1934384853, -0.1259149015, -0.5878511667, 0.0739091486, 0.3553925455, -0.176640898, -0.1262132823, -0.264007628, -0.1701361835, -0.3441281319, 0.0026653111, 0.3127558231, -0.3485508263, 0.1430540085, -0.0181170516, 0.176834926, 0.5048040748, 0.428178966, 0.0170926154, -0.0940090567, -0.2584463656, 0.4258441925, 0.2039241493, -0.0345925242, -0.4821709692, 0.1800986528, 0.0055720583, -0.0328228287, -0.1284404695, 0.1374111474, 0.0278898999, -0.0201428235, -0.0864941627, 0.175122112, 0.0206468049, 0.1888284981, -0.3232865036, -0.4281208813, -0.0569950119, 0.0229819864, -0.0687387213, -0.0665231943, 0.0438071229, -0.2526403069, 0.1586157084, -0.1642064005, 0.2267968506, 0.3692832589, 0.3107088506, -0.1413411498, -0.2410430312, -0.2540669143, -0.3209949732, 0.2904056311, 0.1346237361, -0.2128845006, -0.294292599, 0.0248157978, -0.0160083435, 0.0344790667, -0.0461658202, 0.392996043, -0.0561231896, -0.0432414189, 0.20988819, 0.1974905431, -0.0971102342, -0.1669193804, -0.2190025151, 0.122819148, -0.2471027374, 0.1366459131, -0.0582225993, -0.4469139874, 0.056894809, -0.0252147876, 0.0113013266, -0.1903936267, -0.0567968488, 0.1131046563, 0.2439712882, -0.0361532457, -0.084445715, 0.1641013324, 0.0477743447, 0.052743569, 0.1824994832, -0.0172294509, 0.2800441384, 0.0196369886, -0.1887227297, 0.3480972052, 0.0926223397, 0.1415980458, 0.3416218162, -0.1152978092, 0.0515542552, 0.0729830563, 0.2104122043, -0.1721228957, -0.1512311697, 0.1688512862, 0.3553532958, -0.0358187556, -0.3565799594, 0.0416288152, 0.5232880712, 0.0071558356, 0.413918376, 0.2888956666, -0.0300790071, -0.1796032637, 0.0495372862, 0.148982361, 0.4825510383, 0.0719781369, 0.2031984329, -0.0497339964, 0.0984950885, -0.0927228779, 0.0490244925, 0.1893743426, 0.21433267, 0.2653185427, 0.1862360686, -0.0225451607, -0.398563534, 0.0068511963, -0.0103280917, 0.2490283102, -0.1407551467, 0.1229114309, -0.3488911688, -0.0930569842, -0.1756008416, 0.0690053478, -0.0824649334, -0.3389723599, -0.2977800667, 0.398057729, -0.3791892231, 0.0952739343, -0.0824062303, 0.2396452129, 0.1588453948, 0.0193316843, 0.0811566561, 0.1053370982, -0.1719752997, -0.075300619, 0.3932116032, -0.1783617437, 0.4449947774, 0.294257164, -0.2515662909, -0.5642058849, -0.009631224, 0.09723261, -0.0446407646, 0.2913727164, 0.1569108665, 0.2594356835, -0.0637071878, 0.1674997509, 0.028589949, 0.1679050475, -0.204867363, -0.0965481028, 0.1249713972, 0.1148410589, 0.0120951533, -0.1214812249, -0.3409331143, -0.3965242505, 0.4174041152, -0.032572221, 0.1087350026, 0.2555637956, 0.3698807955, 0.3338322341, 0.164670378, 0.0131675787, -0.0795587897, -0.200690195, 0.2692922652, 0.0735172108, -0.2851144671, -0.1685408056, 0.116395101, -0.1761889458, 0.1963485032, -0.296160996, 0.2146088183, -0.5010896921, 0.1750911325, -0.0738696381, 0.1984625012, 0.3098812401, 0.067066513, -0.0232706964, 0.0926835686, -0.0622302257, -0.024926573, 0.3186886609, 0.2138708681, 0.0005783308, 0.2953262925, 0.2987184525, 0.658223629, 0.1857359111, -0.229964897, 0.5270457268, 0.1381633133, 0.2322870791, -0.2867576182, -0.1393385381, 0.0083176531, -0.383877933, -0.1529007852, -0.1136157513, -0.0768499896, -0.0046237167, 0.2487114519, -0.0195935704, 0.1959053278, -0.2433721423, 0.2963942885, -0.1548439264, 0.0354569778, -0.0472513661, 0.097138837, -0.0689582378, 0.0404468663, 0.0264080316, -0.0312320963, 0.4733625352, 0.0213882998, -0.2703006268, -0.0847993046, -0.6920446754, 0.1975384802, 0.1649115533, 0.411051482, -0.0430319682, -0.3325484395, -0.194201827, -0.0915497243, 0.427323997, -0.0838774219, -0.1816160977, 0.1226128638, -0.0661409646, -0.3708955944, 0.014026612, 0.0454738513, 0.5089049339, -0.0749645978, 0.6180592775, -0.2792036533, 0.0359989591, -0.0625112355, 0.5453642607, -0.0798204243, 0.0674054697, -0.1730719358, -0.3623583317, -0.4296311438, 0.0478501916, 0.0823839828, -0.0268802196, -0.1800902784, -0.0236998349, -0.1829954386, -0.1946382225, -0.0307063609, -0.2555564642, 0.1911633462, -0.232670933, 0.2806385458, -0.080012843, 0.1896322817, 0.6002491117, 0.4785455465, -0.0664899945, -0.1000175327, 0.0531213954, 0.2909657061, 0.3145469725, 0.2713963389, -0.0265566409, 0.1282557547, 0.1029752493, 0.0896628276, -0.4230407476, 0.2618329823, 0.0376053527, -0.159441039, -0.4124113917, -0.20015347, 0.5952424407, 0.2829304338, 0.1778112054, 0.1629557014, 0.0327455848, -0.111343272, 0.3195310831, 0.0468818508, 0.7377001047, -0.0492729656, 0.3859352171, 0.1443641186, -0.1329418272, 0.3299087286, 0.2714164853, -0.0185040757, -0.4534935653, 0.0080828443, 0.0699943677, -0.1160737127, 0.2320919484, -0.0774203837, -0.2293434292, 0.2342054546, -0.2464666367, -0.3401261568, -0.2011540979, 0.2974869609, -0.4525097311, -0.3228260279, -0.0318483375, 0.0820498988, -0.1890284121, -0.0520337299, 0.0382166021, -0.0260015372, -0.1816879064, 0.0875810534, -0.3797726035, 0.075262323, 0.0180658773, 0.4964676499, -0.2078647912, -0.0943588018, 0.1373577714, 0.0333012566, -0.0198605694, 0.1730112582, -0.1235758737, -0.1225467548, -0.1923442185, -0.0259399153, 0.1587088555, -0.1749717891, 0.3594848514, 0.1130883992, 0.0593723804, -0.0185119212, -0.2020337582, -0.0545754246, -0.1769027859, -0.1465854049, 0.0577869378, -0.2877600491, -0.6232830286, -0.111554645, -0.2177120596, -0.3020793796, -0.0084354663, 0.2467582226, 0.1524902582, 0.3774372935, -0.1662783474, -0.0138625503, -0.0960467085, 0.5426025987, -0.2170471996, 0.3648028374, 0.5068681836, 0.1799971461, -0.206427604, -0.1599705219, 0.3782242537, 0.0054587089, 0.1507755667, 0.5503352284, -0.0991170928, 0.0169371814, -0.1889048815, 0.2538342476, 0.1505653411, -0.370757997, -0.160915494, -0.1064633057, -0.5591672659, 0.2067395598, 0.0927723944, 0.396738708, -0.1763737202, -0.1226248741, -0.2903544307, -0.028007362, -0.1391881704, 0.157817468, -0.2676870227, 0.0016691666, 0.1658401787, -0.0137936454, -0.0525888391, -0.1007535011, -0.0595299341, 0.1842211038, -0.0486182198, -0.0748259053, -0.0830293, 0.1172453836, 0.2271108627, -0.1736915112, -0.0266162325, -0.3926926553, -0.0113017512, -0.1907859147, 0.0279922336, 0.2519244552, -0.0885427892, 0.1128100082, 0.1268066764, 0.0777301416, 0.2172164321, 0.2322371155, 0.0071799997, 0.2455638647, 0.023315873, 0.3543139696, 0.2311374098, -0.2054191828, -0.2343903035, 0.0184837319, 0.2907339633, 0.0028006211, 0.3051241934, -0.2582033277, -0.1423428357, 0.255576551, 0.1525259316, 0.6202744246, -0.1304682344, -0.2227960527, 0.2998892963, 0.0897814035, 0.0638143271, -0.3358578086, 0.0940017626, -0.1985317767, -0.0703840405, 0.0349965394, -0.1245132834, 0.1647943109, -0.836609304, 0.06960015, 0.2907021642, 0.0823387653, -0.0154764634, 0.1485920846, 0.0258134305, -0.0169611759, 0.1871799678, 0.0637979135, 0.5537105799, 0.5625141859, -0.0818328038, 0.6099120378, 0.0296857245, 0.2446462065, -0.0165887512, -0.7433123589, 0.1946711391, 0.4049607813, 0.0361098796, 0.2161794454, 0.0082662515, 0.3752156496, -0.3950869143, -0.3191030025, -0.0506716259, 0.2922394276, -0.3702155352, -0.269880861, 0.0688756034, -0.1035977453, 0.1086753607, 0.3668444753, -0.2612330914, -0.0977838337, 0.3455853164, -0.0249213353, 0.0179145262, -0.1097211465, 0.0959116146, -0.0420458242, 0.289090842, -0.3097183406, 0.0306309666, 0.0174910016, -0.1720920652, -0.6128516793, -0.0106835049, 0.5050379038, 0.2819990814, -0.1961210668, -0.0660643131, 0.0685521662, 0.0303373411, -0.12914069, 0.0992150009, -0.1238472834, 0.1970008165, 0.4543985724, -0.0504103452, -0.0348029807, -0.0234675221, 0.0882916152, 0.2930333316, -0.1039104685, -0.0321988352, -0.0701636449, -0.3222334683, 0.1069180891, 0.1219473183, -0.1603210717, 0.1898336262, 0.568036139, -0.1474343687, 0.2258225679, 0.0884490833, 0.0404938161, -0.0526779331, 0.7015366554, 0.4067878425, -0.2560660243, -0.4636141062, 0.1385059357, -0.0690149665, -0.0021164417, -0.2306672633, 0.0536314994, -0.1855025738, 0.137277171, 0.1532154977, 0.0236977823, -0.2460392118, 0.28593871, -0.0149230249, 0.1722000539, -0.0651210323, -0.3166809678, -0.053701371, -0.1375624835, 0.0910059661, -0.634848237, 0.3538064957, 0.0071763135, -0.0413394682, -0.1618842483, -0.1475742012, -0.0180505365, 0.0729029179, 0.5200448036, 0.216836676, 0.2093252242, -0.2043678463, -0.4473113418, 0.0667584911, -0.0612405837, -0.0172181875, 0.1486823857, -0.1969656348, 0.5546962023, -0.1838609576, 0.6516254544, -0.372813642, 0.0651056916, -0.0792423487, 0.0196861215, 0.0209766105, -0.0593981259, -0.0028048009, -0.0336449258, 0.1575345397, 0.2505612671, -0.0595527291, 0.1921729445, -0.3644733727, -0.2029283643, 0.4465302527, 0.116966255, -0.1790779531, -0.093782559, -0.0345238522, 0.2249454856, -0.0534387082, -0.5481232405, -0.0274885595, 0.2250312269, 0.006643964, -0.291582644, 0.2220801115, -0.0191371925, -0.1319442391, -0.067482844, 1.1606020927, -0.264290452, -0.2252514213, 0.2253786027, -0.0351088569 ]
https://github.com/huggingface/datasets/issues/2134
Saving large in-memory datasets with save_to_disk crashes because of pickling
I just merged a fix #2150 that allows to pickle tables bigger than 4GiB Feel free to try it on the `master` branch !
Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ```
24
Saving large in-memory datasets with save_to_disk crashes because of pickling Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ``` I just merged a fix #2150 that allows to pickle tables bigger than 4GiB Feel free to try it on the `master` branch !
[ -0.3168885708, 0.0995954871, 0.1197798997, 0.370888114, 0.2521230876, 0.0021295473, -0.2834976614, 0.4639683366, 0.1905569285, 0.0964653268, 0.0808832496, 0.514664948, -0.398909539, 0.2905989587, -0.1574800611, -0.0833725929, 0.2200171351, -0.1045617238, -0.2615801692, 0.1710370332, -0.2519756556, -0.1009905338, 0.0205410123, -0.165963918, -0.1712374985, -0.3141446114, -0.0271554478, 0.3956109583, -0.319367975, -0.3452962041, -0.1409768164, -0.2231155038, 0.2281502336, 0.3274104893, -0.0001218503, 0.0387924537, 0.1374743879, -0.1475671828, -0.496276319, 0.0046150312, 0.0253552347, -0.5504591465, -0.1945041716, -0.250411272, 0.3338279128, -0.0910535157, 0.1185291335, -0.3753316402, 0.2385227084, 0.2061813623, 0.140699327, 0.3183524907, 0.2884154022, -0.0236260407, 0.0810792819, 0.2532388866, -0.2371629179, 0.2104443014, 0.2143959999, 0.0940104425, -0.0697053671, -0.1063087732, -0.0489086583, -0.2752484083, 0.0091197388, -0.0715226978, -0.3575344086, -0.2352929711, 0.1131326109, 0.1359725296, 0.205855757, -0.4716522396, -0.6115643382, -0.4440330863, -0.0978169739, -0.2725952268, 0.0673026741, 0.2560088336, -0.0856658816, -0.009138193, -0.148708716, -0.5428614616, 0.0650520623, 0.0935427099, 0.3128339648, -0.264057368, -0.2599281967, 0.2104807049, 0.4827488959, -0.2832578421, -0.2492698282, -0.198986277, 0.0249469057, -0.0148133207, -0.0100060422, -0.1636584103, -0.0667286366, -0.0531581528, 0.2876333594, 0.1288199872, -0.0264492668, 0.1699507833, -0.318428874, -0.0102005024, 0.3466803133, -0.054285422, -0.2104746997, 0.3277968168, 0.3184900284, 0.0511620082, 0.115170449, 0.0862564668, -0.0244315639, -0.1946862787, 0.0468380675, -0.139344722, 0.1426374167, -0.1221713424, -0.0298000276, 0.1717310995, -0.1409708261, 0.2041665614, -0.0327624828, 0.2195820212, -0.0259776246, 0.0620771274, -0.2864436507, 0.0794296265, -0.1583690643, 0.075129047, -0.1170247495, 0.1987028271, 0.0240922272, 0.2353447527, 0.1321486831, 0.0247919001, 0.2072656751, -0.0151788928, -0.2567569911, 0.1097204834, 0.0652007088, -0.4047945738, 0.1266949475, 0.2791753411, -0.0430322886, 0.1116226166, 0.0867823213, 0.0422738791, -0.2407934368, 0.1412681192, 0.0091914264, -0.2104310095, -0.0454821289, 0.0081622964, -0.1934384853, -0.1259149015, -0.5878511667, 0.0739091486, 0.3553925455, -0.176640898, -0.1262132823, -0.264007628, -0.1701361835, -0.3441281319, 0.0026653111, 0.3127558231, -0.3485508263, 0.1430540085, -0.0181170516, 0.176834926, 0.5048040748, 0.428178966, 0.0170926154, -0.0940090567, -0.2584463656, 0.4258441925, 0.2039241493, -0.0345925242, -0.4821709692, 0.1800986528, 0.0055720583, -0.0328228287, -0.1284404695, 0.1374111474, 0.0278898999, -0.0201428235, -0.0864941627, 0.175122112, 0.0206468049, 0.1888284981, -0.3232865036, -0.4281208813, -0.0569950119, 0.0229819864, -0.0687387213, -0.0665231943, 0.0438071229, -0.2526403069, 0.1586157084, -0.1642064005, 0.2267968506, 0.3692832589, 0.3107088506, -0.1413411498, -0.2410430312, -0.2540669143, -0.3209949732, 0.2904056311, 0.1346237361, -0.2128845006, -0.294292599, 0.0248157978, -0.0160083435, 0.0344790667, -0.0461658202, 0.392996043, -0.0561231896, -0.0432414189, 0.20988819, 0.1974905431, -0.0971102342, -0.1669193804, -0.2190025151, 0.122819148, -0.2471027374, 0.1366459131, -0.0582225993, -0.4469139874, 0.056894809, -0.0252147876, 0.0113013266, -0.1903936267, -0.0567968488, 0.1131046563, 0.2439712882, -0.0361532457, -0.084445715, 0.1641013324, 0.0477743447, 0.052743569, 0.1824994832, -0.0172294509, 0.2800441384, 0.0196369886, -0.1887227297, 0.3480972052, 0.0926223397, 0.1415980458, 0.3416218162, -0.1152978092, 0.0515542552, 0.0729830563, 0.2104122043, -0.1721228957, -0.1512311697, 0.1688512862, 0.3553532958, -0.0358187556, -0.3565799594, 0.0416288152, 0.5232880712, 0.0071558356, 0.413918376, 0.2888956666, -0.0300790071, -0.1796032637, 0.0495372862, 0.148982361, 0.4825510383, 0.0719781369, 0.2031984329, -0.0497339964, 0.0984950885, -0.0927228779, 0.0490244925, 0.1893743426, 0.21433267, 0.2653185427, 0.1862360686, -0.0225451607, -0.398563534, 0.0068511963, -0.0103280917, 0.2490283102, -0.1407551467, 0.1229114309, -0.3488911688, -0.0930569842, -0.1756008416, 0.0690053478, -0.0824649334, -0.3389723599, -0.2977800667, 0.398057729, -0.3791892231, 0.0952739343, -0.0824062303, 0.2396452129, 0.1588453948, 0.0193316843, 0.0811566561, 0.1053370982, -0.1719752997, -0.075300619, 0.3932116032, -0.1783617437, 0.4449947774, 0.294257164, -0.2515662909, -0.5642058849, -0.009631224, 0.09723261, -0.0446407646, 0.2913727164, 0.1569108665, 0.2594356835, -0.0637071878, 0.1674997509, 0.028589949, 0.1679050475, -0.204867363, -0.0965481028, 0.1249713972, 0.1148410589, 0.0120951533, -0.1214812249, -0.3409331143, -0.3965242505, 0.4174041152, -0.032572221, 0.1087350026, 0.2555637956, 0.3698807955, 0.3338322341, 0.164670378, 0.0131675787, -0.0795587897, -0.200690195, 0.2692922652, 0.0735172108, -0.2851144671, -0.1685408056, 0.116395101, -0.1761889458, 0.1963485032, -0.296160996, 0.2146088183, -0.5010896921, 0.1750911325, -0.0738696381, 0.1984625012, 0.3098812401, 0.067066513, -0.0232706964, 0.0926835686, -0.0622302257, -0.024926573, 0.3186886609, 0.2138708681, 0.0005783308, 0.2953262925, 0.2987184525, 0.658223629, 0.1857359111, -0.229964897, 0.5270457268, 0.1381633133, 0.2322870791, -0.2867576182, -0.1393385381, 0.0083176531, -0.383877933, -0.1529007852, -0.1136157513, -0.0768499896, -0.0046237167, 0.2487114519, -0.0195935704, 0.1959053278, -0.2433721423, 0.2963942885, -0.1548439264, 0.0354569778, -0.0472513661, 0.097138837, -0.0689582378, 0.0404468663, 0.0264080316, -0.0312320963, 0.4733625352, 0.0213882998, -0.2703006268, -0.0847993046, -0.6920446754, 0.1975384802, 0.1649115533, 0.411051482, -0.0430319682, -0.3325484395, -0.194201827, -0.0915497243, 0.427323997, -0.0838774219, -0.1816160977, 0.1226128638, -0.0661409646, -0.3708955944, 0.014026612, 0.0454738513, 0.5089049339, -0.0749645978, 0.6180592775, -0.2792036533, 0.0359989591, -0.0625112355, 0.5453642607, -0.0798204243, 0.0674054697, -0.1730719358, -0.3623583317, -0.4296311438, 0.0478501916, 0.0823839828, -0.0268802196, -0.1800902784, -0.0236998349, -0.1829954386, -0.1946382225, -0.0307063609, -0.2555564642, 0.1911633462, -0.232670933, 0.2806385458, -0.080012843, 0.1896322817, 0.6002491117, 0.4785455465, -0.0664899945, -0.1000175327, 0.0531213954, 0.2909657061, 0.3145469725, 0.2713963389, -0.0265566409, 0.1282557547, 0.1029752493, 0.0896628276, -0.4230407476, 0.2618329823, 0.0376053527, -0.159441039, -0.4124113917, -0.20015347, 0.5952424407, 0.2829304338, 0.1778112054, 0.1629557014, 0.0327455848, -0.111343272, 0.3195310831, 0.0468818508, 0.7377001047, -0.0492729656, 0.3859352171, 0.1443641186, -0.1329418272, 0.3299087286, 0.2714164853, -0.0185040757, -0.4534935653, 0.0080828443, 0.0699943677, -0.1160737127, 0.2320919484, -0.0774203837, -0.2293434292, 0.2342054546, -0.2464666367, -0.3401261568, -0.2011540979, 0.2974869609, -0.4525097311, -0.3228260279, -0.0318483375, 0.0820498988, -0.1890284121, -0.0520337299, 0.0382166021, -0.0260015372, -0.1816879064, 0.0875810534, -0.3797726035, 0.075262323, 0.0180658773, 0.4964676499, -0.2078647912, -0.0943588018, 0.1373577714, 0.0333012566, -0.0198605694, 0.1730112582, -0.1235758737, -0.1225467548, -0.1923442185, -0.0259399153, 0.1587088555, -0.1749717891, 0.3594848514, 0.1130883992, 0.0593723804, -0.0185119212, -0.2020337582, -0.0545754246, -0.1769027859, -0.1465854049, 0.0577869378, -0.2877600491, -0.6232830286, -0.111554645, -0.2177120596, -0.3020793796, -0.0084354663, 0.2467582226, 0.1524902582, 0.3774372935, -0.1662783474, -0.0138625503, -0.0960467085, 0.5426025987, -0.2170471996, 0.3648028374, 0.5068681836, 0.1799971461, -0.206427604, -0.1599705219, 0.3782242537, 0.0054587089, 0.1507755667, 0.5503352284, -0.0991170928, 0.0169371814, -0.1889048815, 0.2538342476, 0.1505653411, -0.370757997, -0.160915494, -0.1064633057, -0.5591672659, 0.2067395598, 0.0927723944, 0.396738708, -0.1763737202, -0.1226248741, -0.2903544307, -0.028007362, -0.1391881704, 0.157817468, -0.2676870227, 0.0016691666, 0.1658401787, -0.0137936454, -0.0525888391, -0.1007535011, -0.0595299341, 0.1842211038, -0.0486182198, -0.0748259053, -0.0830293, 0.1172453836, 0.2271108627, -0.1736915112, -0.0266162325, -0.3926926553, -0.0113017512, -0.1907859147, 0.0279922336, 0.2519244552, -0.0885427892, 0.1128100082, 0.1268066764, 0.0777301416, 0.2172164321, 0.2322371155, 0.0071799997, 0.2455638647, 0.023315873, 0.3543139696, 0.2311374098, -0.2054191828, -0.2343903035, 0.0184837319, 0.2907339633, 0.0028006211, 0.3051241934, -0.2582033277, -0.1423428357, 0.255576551, 0.1525259316, 0.6202744246, -0.1304682344, -0.2227960527, 0.2998892963, 0.0897814035, 0.0638143271, -0.3358578086, 0.0940017626, -0.1985317767, -0.0703840405, 0.0349965394, -0.1245132834, 0.1647943109, -0.836609304, 0.06960015, 0.2907021642, 0.0823387653, -0.0154764634, 0.1485920846, 0.0258134305, -0.0169611759, 0.1871799678, 0.0637979135, 0.5537105799, 0.5625141859, -0.0818328038, 0.6099120378, 0.0296857245, 0.2446462065, -0.0165887512, -0.7433123589, 0.1946711391, 0.4049607813, 0.0361098796, 0.2161794454, 0.0082662515, 0.3752156496, -0.3950869143, -0.3191030025, -0.0506716259, 0.2922394276, -0.3702155352, -0.269880861, 0.0688756034, -0.1035977453, 0.1086753607, 0.3668444753, -0.2612330914, -0.0977838337, 0.3455853164, -0.0249213353, 0.0179145262, -0.1097211465, 0.0959116146, -0.0420458242, 0.289090842, -0.3097183406, 0.0306309666, 0.0174910016, -0.1720920652, -0.6128516793, -0.0106835049, 0.5050379038, 0.2819990814, -0.1961210668, -0.0660643131, 0.0685521662, 0.0303373411, -0.12914069, 0.0992150009, -0.1238472834, 0.1970008165, 0.4543985724, -0.0504103452, -0.0348029807, -0.0234675221, 0.0882916152, 0.2930333316, -0.1039104685, -0.0321988352, -0.0701636449, -0.3222334683, 0.1069180891, 0.1219473183, -0.1603210717, 0.1898336262, 0.568036139, -0.1474343687, 0.2258225679, 0.0884490833, 0.0404938161, -0.0526779331, 0.7015366554, 0.4067878425, -0.2560660243, -0.4636141062, 0.1385059357, -0.0690149665, -0.0021164417, -0.2306672633, 0.0536314994, -0.1855025738, 0.137277171, 0.1532154977, 0.0236977823, -0.2460392118, 0.28593871, -0.0149230249, 0.1722000539, -0.0651210323, -0.3166809678, -0.053701371, -0.1375624835, 0.0910059661, -0.634848237, 0.3538064957, 0.0071763135, -0.0413394682, -0.1618842483, -0.1475742012, -0.0180505365, 0.0729029179, 0.5200448036, 0.216836676, 0.2093252242, -0.2043678463, -0.4473113418, 0.0667584911, -0.0612405837, -0.0172181875, 0.1486823857, -0.1969656348, 0.5546962023, -0.1838609576, 0.6516254544, -0.372813642, 0.0651056916, -0.0792423487, 0.0196861215, 0.0209766105, -0.0593981259, -0.0028048009, -0.0336449258, 0.1575345397, 0.2505612671, -0.0595527291, 0.1921729445, -0.3644733727, -0.2029283643, 0.4465302527, 0.116966255, -0.1790779531, -0.093782559, -0.0345238522, 0.2249454856, -0.0534387082, -0.5481232405, -0.0274885595, 0.2250312269, 0.006643964, -0.291582644, 0.2220801115, -0.0191371925, -0.1319442391, -0.067482844, 1.1606020927, -0.264290452, -0.2252514213, 0.2253786027, -0.0351088569 ]
https://github.com/huggingface/datasets/issues/2134
Saving large in-memory datasets with save_to_disk crashes because of pickling
awesome! I started getting this error as well when I tried to tokenize with a longer sequence length
Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ```
18
Saving large in-memory datasets with save_to_disk crashes because of pickling Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ``` awesome! I started getting this error as well when I tried to tokenize with a longer sequence length
[ -0.3168885708, 0.0995954871, 0.1197798997, 0.370888114, 0.2521230876, 0.0021295473, -0.2834976614, 0.4639683366, 0.1905569285, 0.0964653268, 0.0808832496, 0.514664948, -0.398909539, 0.2905989587, -0.1574800611, -0.0833725929, 0.2200171351, -0.1045617238, -0.2615801692, 0.1710370332, -0.2519756556, -0.1009905338, 0.0205410123, -0.165963918, -0.1712374985, -0.3141446114, -0.0271554478, 0.3956109583, -0.319367975, -0.3452962041, -0.1409768164, -0.2231155038, 0.2281502336, 0.3274104893, -0.0001218503, 0.0387924537, 0.1374743879, -0.1475671828, -0.496276319, 0.0046150312, 0.0253552347, -0.5504591465, -0.1945041716, -0.250411272, 0.3338279128, -0.0910535157, 0.1185291335, -0.3753316402, 0.2385227084, 0.2061813623, 0.140699327, 0.3183524907, 0.2884154022, -0.0236260407, 0.0810792819, 0.2532388866, -0.2371629179, 0.2104443014, 0.2143959999, 0.0940104425, -0.0697053671, -0.1063087732, -0.0489086583, -0.2752484083, 0.0091197388, -0.0715226978, -0.3575344086, -0.2352929711, 0.1131326109, 0.1359725296, 0.205855757, -0.4716522396, -0.6115643382, -0.4440330863, -0.0978169739, -0.2725952268, 0.0673026741, 0.2560088336, -0.0856658816, -0.009138193, -0.148708716, -0.5428614616, 0.0650520623, 0.0935427099, 0.3128339648, -0.264057368, -0.2599281967, 0.2104807049, 0.4827488959, -0.2832578421, -0.2492698282, -0.198986277, 0.0249469057, -0.0148133207, -0.0100060422, -0.1636584103, -0.0667286366, -0.0531581528, 0.2876333594, 0.1288199872, -0.0264492668, 0.1699507833, -0.318428874, -0.0102005024, 0.3466803133, -0.054285422, -0.2104746997, 0.3277968168, 0.3184900284, 0.0511620082, 0.115170449, 0.0862564668, -0.0244315639, -0.1946862787, 0.0468380675, -0.139344722, 0.1426374167, -0.1221713424, -0.0298000276, 0.1717310995, -0.1409708261, 0.2041665614, -0.0327624828, 0.2195820212, -0.0259776246, 0.0620771274, -0.2864436507, 0.0794296265, -0.1583690643, 0.075129047, -0.1170247495, 0.1987028271, 0.0240922272, 0.2353447527, 0.1321486831, 0.0247919001, 0.2072656751, -0.0151788928, -0.2567569911, 0.1097204834, 0.0652007088, -0.4047945738, 0.1266949475, 0.2791753411, -0.0430322886, 0.1116226166, 0.0867823213, 0.0422738791, -0.2407934368, 0.1412681192, 0.0091914264, -0.2104310095, -0.0454821289, 0.0081622964, -0.1934384853, -0.1259149015, -0.5878511667, 0.0739091486, 0.3553925455, -0.176640898, -0.1262132823, -0.264007628, -0.1701361835, -0.3441281319, 0.0026653111, 0.3127558231, -0.3485508263, 0.1430540085, -0.0181170516, 0.176834926, 0.5048040748, 0.428178966, 0.0170926154, -0.0940090567, -0.2584463656, 0.4258441925, 0.2039241493, -0.0345925242, -0.4821709692, 0.1800986528, 0.0055720583, -0.0328228287, -0.1284404695, 0.1374111474, 0.0278898999, -0.0201428235, -0.0864941627, 0.175122112, 0.0206468049, 0.1888284981, -0.3232865036, -0.4281208813, -0.0569950119, 0.0229819864, -0.0687387213, -0.0665231943, 0.0438071229, -0.2526403069, 0.1586157084, -0.1642064005, 0.2267968506, 0.3692832589, 0.3107088506, -0.1413411498, -0.2410430312, -0.2540669143, -0.3209949732, 0.2904056311, 0.1346237361, -0.2128845006, -0.294292599, 0.0248157978, -0.0160083435, 0.0344790667, -0.0461658202, 0.392996043, -0.0561231896, -0.0432414189, 0.20988819, 0.1974905431, -0.0971102342, -0.1669193804, -0.2190025151, 0.122819148, -0.2471027374, 0.1366459131, -0.0582225993, -0.4469139874, 0.056894809, -0.0252147876, 0.0113013266, -0.1903936267, -0.0567968488, 0.1131046563, 0.2439712882, -0.0361532457, -0.084445715, 0.1641013324, 0.0477743447, 0.052743569, 0.1824994832, -0.0172294509, 0.2800441384, 0.0196369886, -0.1887227297, 0.3480972052, 0.0926223397, 0.1415980458, 0.3416218162, -0.1152978092, 0.0515542552, 0.0729830563, 0.2104122043, -0.1721228957, -0.1512311697, 0.1688512862, 0.3553532958, -0.0358187556, -0.3565799594, 0.0416288152, 0.5232880712, 0.0071558356, 0.413918376, 0.2888956666, -0.0300790071, -0.1796032637, 0.0495372862, 0.148982361, 0.4825510383, 0.0719781369, 0.2031984329, -0.0497339964, 0.0984950885, -0.0927228779, 0.0490244925, 0.1893743426, 0.21433267, 0.2653185427, 0.1862360686, -0.0225451607, -0.398563534, 0.0068511963, -0.0103280917, 0.2490283102, -0.1407551467, 0.1229114309, -0.3488911688, -0.0930569842, -0.1756008416, 0.0690053478, -0.0824649334, -0.3389723599, -0.2977800667, 0.398057729, -0.3791892231, 0.0952739343, -0.0824062303, 0.2396452129, 0.1588453948, 0.0193316843, 0.0811566561, 0.1053370982, -0.1719752997, -0.075300619, 0.3932116032, -0.1783617437, 0.4449947774, 0.294257164, -0.2515662909, -0.5642058849, -0.009631224, 0.09723261, -0.0446407646, 0.2913727164, 0.1569108665, 0.2594356835, -0.0637071878, 0.1674997509, 0.028589949, 0.1679050475, -0.204867363, -0.0965481028, 0.1249713972, 0.1148410589, 0.0120951533, -0.1214812249, -0.3409331143, -0.3965242505, 0.4174041152, -0.032572221, 0.1087350026, 0.2555637956, 0.3698807955, 0.3338322341, 0.164670378, 0.0131675787, -0.0795587897, -0.200690195, 0.2692922652, 0.0735172108, -0.2851144671, -0.1685408056, 0.116395101, -0.1761889458, 0.1963485032, -0.296160996, 0.2146088183, -0.5010896921, 0.1750911325, -0.0738696381, 0.1984625012, 0.3098812401, 0.067066513, -0.0232706964, 0.0926835686, -0.0622302257, -0.024926573, 0.3186886609, 0.2138708681, 0.0005783308, 0.2953262925, 0.2987184525, 0.658223629, 0.1857359111, -0.229964897, 0.5270457268, 0.1381633133, 0.2322870791, -0.2867576182, -0.1393385381, 0.0083176531, -0.383877933, -0.1529007852, -0.1136157513, -0.0768499896, -0.0046237167, 0.2487114519, -0.0195935704, 0.1959053278, -0.2433721423, 0.2963942885, -0.1548439264, 0.0354569778, -0.0472513661, 0.097138837, -0.0689582378, 0.0404468663, 0.0264080316, -0.0312320963, 0.4733625352, 0.0213882998, -0.2703006268, -0.0847993046, -0.6920446754, 0.1975384802, 0.1649115533, 0.411051482, -0.0430319682, -0.3325484395, -0.194201827, -0.0915497243, 0.427323997, -0.0838774219, -0.1816160977, 0.1226128638, -0.0661409646, -0.3708955944, 0.014026612, 0.0454738513, 0.5089049339, -0.0749645978, 0.6180592775, -0.2792036533, 0.0359989591, -0.0625112355, 0.5453642607, -0.0798204243, 0.0674054697, -0.1730719358, -0.3623583317, -0.4296311438, 0.0478501916, 0.0823839828, -0.0268802196, -0.1800902784, -0.0236998349, -0.1829954386, -0.1946382225, -0.0307063609, -0.2555564642, 0.1911633462, -0.232670933, 0.2806385458, -0.080012843, 0.1896322817, 0.6002491117, 0.4785455465, -0.0664899945, -0.1000175327, 0.0531213954, 0.2909657061, 0.3145469725, 0.2713963389, -0.0265566409, 0.1282557547, 0.1029752493, 0.0896628276, -0.4230407476, 0.2618329823, 0.0376053527, -0.159441039, -0.4124113917, -0.20015347, 0.5952424407, 0.2829304338, 0.1778112054, 0.1629557014, 0.0327455848, -0.111343272, 0.3195310831, 0.0468818508, 0.7377001047, -0.0492729656, 0.3859352171, 0.1443641186, -0.1329418272, 0.3299087286, 0.2714164853, -0.0185040757, -0.4534935653, 0.0080828443, 0.0699943677, -0.1160737127, 0.2320919484, -0.0774203837, -0.2293434292, 0.2342054546, -0.2464666367, -0.3401261568, -0.2011540979, 0.2974869609, -0.4525097311, -0.3228260279, -0.0318483375, 0.0820498988, -0.1890284121, -0.0520337299, 0.0382166021, -0.0260015372, -0.1816879064, 0.0875810534, -0.3797726035, 0.075262323, 0.0180658773, 0.4964676499, -0.2078647912, -0.0943588018, 0.1373577714, 0.0333012566, -0.0198605694, 0.1730112582, -0.1235758737, -0.1225467548, -0.1923442185, -0.0259399153, 0.1587088555, -0.1749717891, 0.3594848514, 0.1130883992, 0.0593723804, -0.0185119212, -0.2020337582, -0.0545754246, -0.1769027859, -0.1465854049, 0.0577869378, -0.2877600491, -0.6232830286, -0.111554645, -0.2177120596, -0.3020793796, -0.0084354663, 0.2467582226, 0.1524902582, 0.3774372935, -0.1662783474, -0.0138625503, -0.0960467085, 0.5426025987, -0.2170471996, 0.3648028374, 0.5068681836, 0.1799971461, -0.206427604, -0.1599705219, 0.3782242537, 0.0054587089, 0.1507755667, 0.5503352284, -0.0991170928, 0.0169371814, -0.1889048815, 0.2538342476, 0.1505653411, -0.370757997, -0.160915494, -0.1064633057, -0.5591672659, 0.2067395598, 0.0927723944, 0.396738708, -0.1763737202, -0.1226248741, -0.2903544307, -0.028007362, -0.1391881704, 0.157817468, -0.2676870227, 0.0016691666, 0.1658401787, -0.0137936454, -0.0525888391, -0.1007535011, -0.0595299341, 0.1842211038, -0.0486182198, -0.0748259053, -0.0830293, 0.1172453836, 0.2271108627, -0.1736915112, -0.0266162325, -0.3926926553, -0.0113017512, -0.1907859147, 0.0279922336, 0.2519244552, -0.0885427892, 0.1128100082, 0.1268066764, 0.0777301416, 0.2172164321, 0.2322371155, 0.0071799997, 0.2455638647, 0.023315873, 0.3543139696, 0.2311374098, -0.2054191828, -0.2343903035, 0.0184837319, 0.2907339633, 0.0028006211, 0.3051241934, -0.2582033277, -0.1423428357, 0.255576551, 0.1525259316, 0.6202744246, -0.1304682344, -0.2227960527, 0.2998892963, 0.0897814035, 0.0638143271, -0.3358578086, 0.0940017626, -0.1985317767, -0.0703840405, 0.0349965394, -0.1245132834, 0.1647943109, -0.836609304, 0.06960015, 0.2907021642, 0.0823387653, -0.0154764634, 0.1485920846, 0.0258134305, -0.0169611759, 0.1871799678, 0.0637979135, 0.5537105799, 0.5625141859, -0.0818328038, 0.6099120378, 0.0296857245, 0.2446462065, -0.0165887512, -0.7433123589, 0.1946711391, 0.4049607813, 0.0361098796, 0.2161794454, 0.0082662515, 0.3752156496, -0.3950869143, -0.3191030025, -0.0506716259, 0.2922394276, -0.3702155352, -0.269880861, 0.0688756034, -0.1035977453, 0.1086753607, 0.3668444753, -0.2612330914, -0.0977838337, 0.3455853164, -0.0249213353, 0.0179145262, -0.1097211465, 0.0959116146, -0.0420458242, 0.289090842, -0.3097183406, 0.0306309666, 0.0174910016, -0.1720920652, -0.6128516793, -0.0106835049, 0.5050379038, 0.2819990814, -0.1961210668, -0.0660643131, 0.0685521662, 0.0303373411, -0.12914069, 0.0992150009, -0.1238472834, 0.1970008165, 0.4543985724, -0.0504103452, -0.0348029807, -0.0234675221, 0.0882916152, 0.2930333316, -0.1039104685, -0.0321988352, -0.0701636449, -0.3222334683, 0.1069180891, 0.1219473183, -0.1603210717, 0.1898336262, 0.568036139, -0.1474343687, 0.2258225679, 0.0884490833, 0.0404938161, -0.0526779331, 0.7015366554, 0.4067878425, -0.2560660243, -0.4636141062, 0.1385059357, -0.0690149665, -0.0021164417, -0.2306672633, 0.0536314994, -0.1855025738, 0.137277171, 0.1532154977, 0.0236977823, -0.2460392118, 0.28593871, -0.0149230249, 0.1722000539, -0.0651210323, -0.3166809678, -0.053701371, -0.1375624835, 0.0910059661, -0.634848237, 0.3538064957, 0.0071763135, -0.0413394682, -0.1618842483, -0.1475742012, -0.0180505365, 0.0729029179, 0.5200448036, 0.216836676, 0.2093252242, -0.2043678463, -0.4473113418, 0.0667584911, -0.0612405837, -0.0172181875, 0.1486823857, -0.1969656348, 0.5546962023, -0.1838609576, 0.6516254544, -0.372813642, 0.0651056916, -0.0792423487, 0.0196861215, 0.0209766105, -0.0593981259, -0.0028048009, -0.0336449258, 0.1575345397, 0.2505612671, -0.0595527291, 0.1921729445, -0.3644733727, -0.2029283643, 0.4465302527, 0.116966255, -0.1790779531, -0.093782559, -0.0345238522, 0.2249454856, -0.0534387082, -0.5481232405, -0.0274885595, 0.2250312269, 0.006643964, -0.291582644, 0.2220801115, -0.0191371925, -0.1319442391, -0.067482844, 1.1606020927, -0.264290452, -0.2252514213, 0.2253786027, -0.0351088569 ]
https://github.com/huggingface/datasets/issues/2134
Saving large in-memory datasets with save_to_disk crashes because of pickling
@prokopCerny does this fix work for you? I found that with the latest master, my container with 500GB RAM starts crashing when I try to map a large dataset using `num_proc`. @lhoestq would it be possible to implement some logic to keep the individual cache files small (say below 100mb)? I find this helps with loading large datasets, but the "hack" I was using (increasing `num_proc` to a large number) doesn't work anymore with the latest master; my container crashes even with `num_proc=200` now
Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ```
84
Saving large in-memory datasets with save_to_disk crashes because of pickling Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ``` @prokopCerny does this fix work for you? I found that with the latest master, my container with 500GB RAM starts crashing when I try to map a large dataset using `num_proc`. @lhoestq would it be possible to implement some logic to keep the individual cache files small (say below 100mb)? I find this helps with loading large datasets, but the "hack" I was using (increasing `num_proc` to a large number) doesn't work anymore with the latest master; my container crashes even with `num_proc=200` now
[ -0.3168885708, 0.0995954871, 0.1197798997, 0.370888114, 0.2521230876, 0.0021295473, -0.2834976614, 0.4639683366, 0.1905569285, 0.0964653268, 0.0808832496, 0.514664948, -0.398909539, 0.2905989587, -0.1574800611, -0.0833725929, 0.2200171351, -0.1045617238, -0.2615801692, 0.1710370332, -0.2519756556, -0.1009905338, 0.0205410123, -0.165963918, -0.1712374985, -0.3141446114, -0.0271554478, 0.3956109583, -0.319367975, -0.3452962041, -0.1409768164, -0.2231155038, 0.2281502336, 0.3274104893, -0.0001218503, 0.0387924537, 0.1374743879, -0.1475671828, -0.496276319, 0.0046150312, 0.0253552347, -0.5504591465, -0.1945041716, -0.250411272, 0.3338279128, -0.0910535157, 0.1185291335, -0.3753316402, 0.2385227084, 0.2061813623, 0.140699327, 0.3183524907, 0.2884154022, -0.0236260407, 0.0810792819, 0.2532388866, -0.2371629179, 0.2104443014, 0.2143959999, 0.0940104425, -0.0697053671, -0.1063087732, -0.0489086583, -0.2752484083, 0.0091197388, -0.0715226978, -0.3575344086, -0.2352929711, 0.1131326109, 0.1359725296, 0.205855757, -0.4716522396, -0.6115643382, -0.4440330863, -0.0978169739, -0.2725952268, 0.0673026741, 0.2560088336, -0.0856658816, -0.009138193, -0.148708716, -0.5428614616, 0.0650520623, 0.0935427099, 0.3128339648, -0.264057368, -0.2599281967, 0.2104807049, 0.4827488959, -0.2832578421, -0.2492698282, -0.198986277, 0.0249469057, -0.0148133207, -0.0100060422, -0.1636584103, -0.0667286366, -0.0531581528, 0.2876333594, 0.1288199872, -0.0264492668, 0.1699507833, -0.318428874, -0.0102005024, 0.3466803133, -0.054285422, -0.2104746997, 0.3277968168, 0.3184900284, 0.0511620082, 0.115170449, 0.0862564668, -0.0244315639, -0.1946862787, 0.0468380675, -0.139344722, 0.1426374167, -0.1221713424, -0.0298000276, 0.1717310995, -0.1409708261, 0.2041665614, -0.0327624828, 0.2195820212, -0.0259776246, 0.0620771274, -0.2864436507, 0.0794296265, -0.1583690643, 0.075129047, -0.1170247495, 0.1987028271, 0.0240922272, 0.2353447527, 0.1321486831, 0.0247919001, 0.2072656751, -0.0151788928, -0.2567569911, 0.1097204834, 0.0652007088, -0.4047945738, 0.1266949475, 0.2791753411, -0.0430322886, 0.1116226166, 0.0867823213, 0.0422738791, -0.2407934368, 0.1412681192, 0.0091914264, -0.2104310095, -0.0454821289, 0.0081622964, -0.1934384853, -0.1259149015, -0.5878511667, 0.0739091486, 0.3553925455, -0.176640898, -0.1262132823, -0.264007628, -0.1701361835, -0.3441281319, 0.0026653111, 0.3127558231, -0.3485508263, 0.1430540085, -0.0181170516, 0.176834926, 0.5048040748, 0.428178966, 0.0170926154, -0.0940090567, -0.2584463656, 0.4258441925, 0.2039241493, -0.0345925242, -0.4821709692, 0.1800986528, 0.0055720583, -0.0328228287, -0.1284404695, 0.1374111474, 0.0278898999, -0.0201428235, -0.0864941627, 0.175122112, 0.0206468049, 0.1888284981, -0.3232865036, -0.4281208813, -0.0569950119, 0.0229819864, -0.0687387213, -0.0665231943, 0.0438071229, -0.2526403069, 0.1586157084, -0.1642064005, 0.2267968506, 0.3692832589, 0.3107088506, -0.1413411498, -0.2410430312, -0.2540669143, -0.3209949732, 0.2904056311, 0.1346237361, -0.2128845006, -0.294292599, 0.0248157978, -0.0160083435, 0.0344790667, -0.0461658202, 0.392996043, -0.0561231896, -0.0432414189, 0.20988819, 0.1974905431, -0.0971102342, -0.1669193804, -0.2190025151, 0.122819148, -0.2471027374, 0.1366459131, -0.0582225993, -0.4469139874, 0.056894809, -0.0252147876, 0.0113013266, -0.1903936267, -0.0567968488, 0.1131046563, 0.2439712882, -0.0361532457, -0.084445715, 0.1641013324, 0.0477743447, 0.052743569, 0.1824994832, -0.0172294509, 0.2800441384, 0.0196369886, -0.1887227297, 0.3480972052, 0.0926223397, 0.1415980458, 0.3416218162, -0.1152978092, 0.0515542552, 0.0729830563, 0.2104122043, -0.1721228957, -0.1512311697, 0.1688512862, 0.3553532958, -0.0358187556, -0.3565799594, 0.0416288152, 0.5232880712, 0.0071558356, 0.413918376, 0.2888956666, -0.0300790071, -0.1796032637, 0.0495372862, 0.148982361, 0.4825510383, 0.0719781369, 0.2031984329, -0.0497339964, 0.0984950885, -0.0927228779, 0.0490244925, 0.1893743426, 0.21433267, 0.2653185427, 0.1862360686, -0.0225451607, -0.398563534, 0.0068511963, -0.0103280917, 0.2490283102, -0.1407551467, 0.1229114309, -0.3488911688, -0.0930569842, -0.1756008416, 0.0690053478, -0.0824649334, -0.3389723599, -0.2977800667, 0.398057729, -0.3791892231, 0.0952739343, -0.0824062303, 0.2396452129, 0.1588453948, 0.0193316843, 0.0811566561, 0.1053370982, -0.1719752997, -0.075300619, 0.3932116032, -0.1783617437, 0.4449947774, 0.294257164, -0.2515662909, -0.5642058849, -0.009631224, 0.09723261, -0.0446407646, 0.2913727164, 0.1569108665, 0.2594356835, -0.0637071878, 0.1674997509, 0.028589949, 0.1679050475, -0.204867363, -0.0965481028, 0.1249713972, 0.1148410589, 0.0120951533, -0.1214812249, -0.3409331143, -0.3965242505, 0.4174041152, -0.032572221, 0.1087350026, 0.2555637956, 0.3698807955, 0.3338322341, 0.164670378, 0.0131675787, -0.0795587897, -0.200690195, 0.2692922652, 0.0735172108, -0.2851144671, -0.1685408056, 0.116395101, -0.1761889458, 0.1963485032, -0.296160996, 0.2146088183, -0.5010896921, 0.1750911325, -0.0738696381, 0.1984625012, 0.3098812401, 0.067066513, -0.0232706964, 0.0926835686, -0.0622302257, -0.024926573, 0.3186886609, 0.2138708681, 0.0005783308, 0.2953262925, 0.2987184525, 0.658223629, 0.1857359111, -0.229964897, 0.5270457268, 0.1381633133, 0.2322870791, -0.2867576182, -0.1393385381, 0.0083176531, -0.383877933, -0.1529007852, -0.1136157513, -0.0768499896, -0.0046237167, 0.2487114519, -0.0195935704, 0.1959053278, -0.2433721423, 0.2963942885, -0.1548439264, 0.0354569778, -0.0472513661, 0.097138837, -0.0689582378, 0.0404468663, 0.0264080316, -0.0312320963, 0.4733625352, 0.0213882998, -0.2703006268, -0.0847993046, -0.6920446754, 0.1975384802, 0.1649115533, 0.411051482, -0.0430319682, -0.3325484395, -0.194201827, -0.0915497243, 0.427323997, -0.0838774219, -0.1816160977, 0.1226128638, -0.0661409646, -0.3708955944, 0.014026612, 0.0454738513, 0.5089049339, -0.0749645978, 0.6180592775, -0.2792036533, 0.0359989591, -0.0625112355, 0.5453642607, -0.0798204243, 0.0674054697, -0.1730719358, -0.3623583317, -0.4296311438, 0.0478501916, 0.0823839828, -0.0268802196, -0.1800902784, -0.0236998349, -0.1829954386, -0.1946382225, -0.0307063609, -0.2555564642, 0.1911633462, -0.232670933, 0.2806385458, -0.080012843, 0.1896322817, 0.6002491117, 0.4785455465, -0.0664899945, -0.1000175327, 0.0531213954, 0.2909657061, 0.3145469725, 0.2713963389, -0.0265566409, 0.1282557547, 0.1029752493, 0.0896628276, -0.4230407476, 0.2618329823, 0.0376053527, -0.159441039, -0.4124113917, -0.20015347, 0.5952424407, 0.2829304338, 0.1778112054, 0.1629557014, 0.0327455848, -0.111343272, 0.3195310831, 0.0468818508, 0.7377001047, -0.0492729656, 0.3859352171, 0.1443641186, -0.1329418272, 0.3299087286, 0.2714164853, -0.0185040757, -0.4534935653, 0.0080828443, 0.0699943677, -0.1160737127, 0.2320919484, -0.0774203837, -0.2293434292, 0.2342054546, -0.2464666367, -0.3401261568, -0.2011540979, 0.2974869609, -0.4525097311, -0.3228260279, -0.0318483375, 0.0820498988, -0.1890284121, -0.0520337299, 0.0382166021, -0.0260015372, -0.1816879064, 0.0875810534, -0.3797726035, 0.075262323, 0.0180658773, 0.4964676499, -0.2078647912, -0.0943588018, 0.1373577714, 0.0333012566, -0.0198605694, 0.1730112582, -0.1235758737, -0.1225467548, -0.1923442185, -0.0259399153, 0.1587088555, -0.1749717891, 0.3594848514, 0.1130883992, 0.0593723804, -0.0185119212, -0.2020337582, -0.0545754246, -0.1769027859, -0.1465854049, 0.0577869378, -0.2877600491, -0.6232830286, -0.111554645, -0.2177120596, -0.3020793796, -0.0084354663, 0.2467582226, 0.1524902582, 0.3774372935, -0.1662783474, -0.0138625503, -0.0960467085, 0.5426025987, -0.2170471996, 0.3648028374, 0.5068681836, 0.1799971461, -0.206427604, -0.1599705219, 0.3782242537, 0.0054587089, 0.1507755667, 0.5503352284, -0.0991170928, 0.0169371814, -0.1889048815, 0.2538342476, 0.1505653411, -0.370757997, -0.160915494, -0.1064633057, -0.5591672659, 0.2067395598, 0.0927723944, 0.396738708, -0.1763737202, -0.1226248741, -0.2903544307, -0.028007362, -0.1391881704, 0.157817468, -0.2676870227, 0.0016691666, 0.1658401787, -0.0137936454, -0.0525888391, -0.1007535011, -0.0595299341, 0.1842211038, -0.0486182198, -0.0748259053, -0.0830293, 0.1172453836, 0.2271108627, -0.1736915112, -0.0266162325, -0.3926926553, -0.0113017512, -0.1907859147, 0.0279922336, 0.2519244552, -0.0885427892, 0.1128100082, 0.1268066764, 0.0777301416, 0.2172164321, 0.2322371155, 0.0071799997, 0.2455638647, 0.023315873, 0.3543139696, 0.2311374098, -0.2054191828, -0.2343903035, 0.0184837319, 0.2907339633, 0.0028006211, 0.3051241934, -0.2582033277, -0.1423428357, 0.255576551, 0.1525259316, 0.6202744246, -0.1304682344, -0.2227960527, 0.2998892963, 0.0897814035, 0.0638143271, -0.3358578086, 0.0940017626, -0.1985317767, -0.0703840405, 0.0349965394, -0.1245132834, 0.1647943109, -0.836609304, 0.06960015, 0.2907021642, 0.0823387653, -0.0154764634, 0.1485920846, 0.0258134305, -0.0169611759, 0.1871799678, 0.0637979135, 0.5537105799, 0.5625141859, -0.0818328038, 0.6099120378, 0.0296857245, 0.2446462065, -0.0165887512, -0.7433123589, 0.1946711391, 0.4049607813, 0.0361098796, 0.2161794454, 0.0082662515, 0.3752156496, -0.3950869143, -0.3191030025, -0.0506716259, 0.2922394276, -0.3702155352, -0.269880861, 0.0688756034, -0.1035977453, 0.1086753607, 0.3668444753, -0.2612330914, -0.0977838337, 0.3455853164, -0.0249213353, 0.0179145262, -0.1097211465, 0.0959116146, -0.0420458242, 0.289090842, -0.3097183406, 0.0306309666, 0.0174910016, -0.1720920652, -0.6128516793, -0.0106835049, 0.5050379038, 0.2819990814, -0.1961210668, -0.0660643131, 0.0685521662, 0.0303373411, -0.12914069, 0.0992150009, -0.1238472834, 0.1970008165, 0.4543985724, -0.0504103452, -0.0348029807, -0.0234675221, 0.0882916152, 0.2930333316, -0.1039104685, -0.0321988352, -0.0701636449, -0.3222334683, 0.1069180891, 0.1219473183, -0.1603210717, 0.1898336262, 0.568036139, -0.1474343687, 0.2258225679, 0.0884490833, 0.0404938161, -0.0526779331, 0.7015366554, 0.4067878425, -0.2560660243, -0.4636141062, 0.1385059357, -0.0690149665, -0.0021164417, -0.2306672633, 0.0536314994, -0.1855025738, 0.137277171, 0.1532154977, 0.0236977823, -0.2460392118, 0.28593871, -0.0149230249, 0.1722000539, -0.0651210323, -0.3166809678, -0.053701371, -0.1375624835, 0.0910059661, -0.634848237, 0.3538064957, 0.0071763135, -0.0413394682, -0.1618842483, -0.1475742012, -0.0180505365, 0.0729029179, 0.5200448036, 0.216836676, 0.2093252242, -0.2043678463, -0.4473113418, 0.0667584911, -0.0612405837, -0.0172181875, 0.1486823857, -0.1969656348, 0.5546962023, -0.1838609576, 0.6516254544, -0.372813642, 0.0651056916, -0.0792423487, 0.0196861215, 0.0209766105, -0.0593981259, -0.0028048009, -0.0336449258, 0.1575345397, 0.2505612671, -0.0595527291, 0.1921729445, -0.3644733727, -0.2029283643, 0.4465302527, 0.116966255, -0.1790779531, -0.093782559, -0.0345238522, 0.2249454856, -0.0534387082, -0.5481232405, -0.0274885595, 0.2250312269, 0.006643964, -0.291582644, 0.2220801115, -0.0191371925, -0.1319442391, -0.067482844, 1.1606020927, -0.264290452, -0.2252514213, 0.2253786027, -0.0351088569 ]
https://github.com/huggingface/datasets/issues/2134
Saving large in-memory datasets with save_to_disk crashes because of pickling
Closing since the original issue was fixed in #2150 Feel free to reopen if you are still experiencing it. For the other problems, please open separate issues
Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ```
27
Saving large in-memory datasets with save_to_disk crashes because of pickling Using Datasets 1.5.0 on Python 3.7. Recently I've been working on medium to large size datasets (pretokenized raw text sizes from few gigabytes to low tens of gigabytes), and have found out that several preprocessing steps are massively faster when done in memory, and I have the ability to requisition a lot of RAM, so I decided to do these steps completely out of the datasets library. So my workflow is to do several .map() on datasets object, then for the operation which is faster in memory to extract the necessary columns from the dataset and then drop it whole, do the transformation in memory, and then create a fresh Dataset object using .from_dict() or other method. When I then try to call save_to_disk(path) on the dataset, it crashes because of pickling, which appears to be because of using old pickle protocol which doesn't support large files (over 4 GiB). ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 80, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 75, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 60, in tokenize_and_chunkify contexts_dataset.save_to_disk(chunked_path) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 457, in save_to_disk self = pickle.loads(pickle.dumps(self)) OverflowError: cannot serialize a bytes object larger than 4 GiB ``` From what I've seen this issue may be possibly fixed, as the line `self = pickle.loads(pickle.dumps(self))` does not appear to be present in the current state of the repository. To save these datasets to disk, I've resorted to calling .map() over them with `function=None` and specifying the .arrow cache file, and then creating a new dataset using the .from_file() method, which I can then safely save to disk. Additional issue when working with these large in-memory datasets is when using multiprocessing, is again to do with pickling. I've tried to speed up the mapping with function=None by specifying num_proc to the available cpu count, and I again get issues with transferring the dataset, with the following traceback. I am not sure if I should open a separate issue for that. ``` Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295Traceback (most recent call last): File "./tokenize_and_chunkify_in_memory.py", line 94, in <module> main() File "./tokenize_and_chunkify_in_memory.py", line 89, in main tokenize_and_chunkify(config) File "./tokenize_and_chunkify_in_memory.py", line 67, in tokenize_and_chunkify contexts_dataset.map(function=None, cache_file_name=str(output_dir_path / "tmp.arrow"), writer_batch_size=50000, num_proc=config.threads) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in map transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1485, in <listcomp> transformed_shards = [r.get() for r in results] File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 657, in get raise self._value File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/multiprocess/reduction.py", line 54, in dumps cls(buf, protocol, *args, **kwds).dump(obj) File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 454, in dump StockPickler.dump(self, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 437, in dump self.save(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 662, in save_reduce save(state) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/home/cernypro/dev/envs/huggingface_gpu/lib/python3.7/site-packages/dill/_dill.py", line 941, in save_module_dict StockPickler.save_dict(pickler, obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 859, in save_dict self._batch_setitems(obj.items()) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 885, in _batch_setitems save(v) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 846, in _batch_appends save(tmp[0]) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 789, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 819, in save_list self._batch_appends(obj) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 843, in _batch_appends save(x) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 549, in save self.save_reduce(obj=obj, *rv) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 638, in save_reduce save(args) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 774, in save_tuple save(element) File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 504, in save f(self, obj) # Call unbound method with explicit self File "/mnt/appl/software/Python/3.7.4-GCCcore-8.3.0/lib/python3.7/pickle.py", line 732, in save_bytes self._write_large_bytes(BINBYTES + pack("<I", n), obj) struct.error: 'I' format requires 0 <= number <= 4294967295 ``` Closing since the original issue was fixed in #2150 Feel free to reopen if you are still experiencing it. For the other problems, please open separate issues
[ -0.3168885708, 0.0995954871, 0.1197798997, 0.370888114, 0.2521230876, 0.0021295473, -0.2834976614, 0.4639683366, 0.1905569285, 0.0964653268, 0.0808832496, 0.514664948, -0.398909539, 0.2905989587, -0.1574800611, -0.0833725929, 0.2200171351, -0.1045617238, -0.2615801692, 0.1710370332, -0.2519756556, -0.1009905338, 0.0205410123, -0.165963918, -0.1712374985, -0.3141446114, -0.0271554478, 0.3956109583, -0.319367975, -0.3452962041, -0.1409768164, -0.2231155038, 0.2281502336, 0.3274104893, -0.0001218503, 0.0387924537, 0.1374743879, -0.1475671828, -0.496276319, 0.0046150312, 0.0253552347, -0.5504591465, -0.1945041716, -0.250411272, 0.3338279128, -0.0910535157, 0.1185291335, -0.3753316402, 0.2385227084, 0.2061813623, 0.140699327, 0.3183524907, 0.2884154022, -0.0236260407, 0.0810792819, 0.2532388866, -0.2371629179, 0.2104443014, 0.2143959999, 0.0940104425, -0.0697053671, -0.1063087732, -0.0489086583, -0.2752484083, 0.0091197388, -0.0715226978, -0.3575344086, -0.2352929711, 0.1131326109, 0.1359725296, 0.205855757, -0.4716522396, -0.6115643382, -0.4440330863, -0.0978169739, -0.2725952268, 0.0673026741, 0.2560088336, -0.0856658816, -0.009138193, -0.148708716, -0.5428614616, 0.0650520623, 0.0935427099, 0.3128339648, -0.264057368, -0.2599281967, 0.2104807049, 0.4827488959, -0.2832578421, -0.2492698282, -0.198986277, 0.0249469057, -0.0148133207, -0.0100060422, -0.1636584103, -0.0667286366, -0.0531581528, 0.2876333594, 0.1288199872, -0.0264492668, 0.1699507833, -0.318428874, -0.0102005024, 0.3466803133, -0.054285422, -0.2104746997, 0.3277968168, 0.3184900284, 0.0511620082, 0.115170449, 0.0862564668, -0.0244315639, -0.1946862787, 0.0468380675, -0.139344722, 0.1426374167, -0.1221713424, -0.0298000276, 0.1717310995, -0.1409708261, 0.2041665614, -0.0327624828, 0.2195820212, -0.0259776246, 0.0620771274, -0.2864436507, 0.0794296265, -0.1583690643, 0.075129047, -0.1170247495, 0.1987028271, 0.0240922272, 0.2353447527, 0.1321486831, 0.0247919001, 0.2072656751, -0.0151788928, -0.2567569911, 0.1097204834, 0.0652007088, -0.4047945738, 0.1266949475, 0.2791753411, -0.0430322886, 0.1116226166, 0.0867823213, 0.0422738791, -0.2407934368, 0.1412681192, 0.0091914264, -0.2104310095, -0.0454821289, 0.0081622964, -0.1934384853, -0.1259149015, -0.5878511667, 0.0739091486, 0.3553925455, -0.176640898, -0.1262132823, -0.264007628, -0.1701361835, -0.3441281319, 0.0026653111, 0.3127558231, -0.3485508263, 0.1430540085, -0.0181170516, 0.176834926, 0.5048040748, 0.428178966, 0.0170926154, -0.0940090567, -0.2584463656, 0.4258441925, 0.2039241493, -0.0345925242, -0.4821709692, 0.1800986528, 0.0055720583, -0.0328228287, -0.1284404695, 0.1374111474, 0.0278898999, -0.0201428235, -0.0864941627, 0.175122112, 0.0206468049, 0.1888284981, -0.3232865036, -0.4281208813, -0.0569950119, 0.0229819864, -0.0687387213, -0.0665231943, 0.0438071229, -0.2526403069, 0.1586157084, -0.1642064005, 0.2267968506, 0.3692832589, 0.3107088506, -0.1413411498, -0.2410430312, -0.2540669143, -0.3209949732, 0.2904056311, 0.1346237361, -0.2128845006, -0.294292599, 0.0248157978, -0.0160083435, 0.0344790667, -0.0461658202, 0.392996043, -0.0561231896, -0.0432414189, 0.20988819, 0.1974905431, -0.0971102342, -0.1669193804, -0.2190025151, 0.122819148, -0.2471027374, 0.1366459131, -0.0582225993, -0.4469139874, 0.056894809, -0.0252147876, 0.0113013266, -0.1903936267, -0.0567968488, 0.1131046563, 0.2439712882, -0.0361532457, -0.084445715, 0.1641013324, 0.0477743447, 0.052743569, 0.1824994832, -0.0172294509, 0.2800441384, 0.0196369886, -0.1887227297, 0.3480972052, 0.0926223397, 0.1415980458, 0.3416218162, -0.1152978092, 0.0515542552, 0.0729830563, 0.2104122043, -0.1721228957, -0.1512311697, 0.1688512862, 0.3553532958, -0.0358187556, -0.3565799594, 0.0416288152, 0.5232880712, 0.0071558356, 0.413918376, 0.2888956666, -0.0300790071, -0.1796032637, 0.0495372862, 0.148982361, 0.4825510383, 0.0719781369, 0.2031984329, -0.0497339964, 0.0984950885, -0.0927228779, 0.0490244925, 0.1893743426, 0.21433267, 0.2653185427, 0.1862360686, -0.0225451607, -0.398563534, 0.0068511963, -0.0103280917, 0.2490283102, -0.1407551467, 0.1229114309, -0.3488911688, -0.0930569842, -0.1756008416, 0.0690053478, -0.0824649334, -0.3389723599, -0.2977800667, 0.398057729, -0.3791892231, 0.0952739343, -0.0824062303, 0.2396452129, 0.1588453948, 0.0193316843, 0.0811566561, 0.1053370982, -0.1719752997, -0.075300619, 0.3932116032, -0.1783617437, 0.4449947774, 0.294257164, -0.2515662909, -0.5642058849, -0.009631224, 0.09723261, -0.0446407646, 0.2913727164, 0.1569108665, 0.2594356835, -0.0637071878, 0.1674997509, 0.028589949, 0.1679050475, -0.204867363, -0.0965481028, 0.1249713972, 0.1148410589, 0.0120951533, -0.1214812249, -0.3409331143, -0.3965242505, 0.4174041152, -0.032572221, 0.1087350026, 0.2555637956, 0.3698807955, 0.3338322341, 0.164670378, 0.0131675787, -0.0795587897, -0.200690195, 0.2692922652, 0.0735172108, -0.2851144671, -0.1685408056, 0.116395101, -0.1761889458, 0.1963485032, -0.296160996, 0.2146088183, -0.5010896921, 0.1750911325, -0.0738696381, 0.1984625012, 0.3098812401, 0.067066513, -0.0232706964, 0.0926835686, -0.0622302257, -0.024926573, 0.3186886609, 0.2138708681, 0.0005783308, 0.2953262925, 0.2987184525, 0.658223629, 0.1857359111, -0.229964897, 0.5270457268, 0.1381633133, 0.2322870791, -0.2867576182, -0.1393385381, 0.0083176531, -0.383877933, -0.1529007852, -0.1136157513, -0.0768499896, -0.0046237167, 0.2487114519, -0.0195935704, 0.1959053278, -0.2433721423, 0.2963942885, -0.1548439264, 0.0354569778, -0.0472513661, 0.097138837, -0.0689582378, 0.0404468663, 0.0264080316, -0.0312320963, 0.4733625352, 0.0213882998, -0.2703006268, -0.0847993046, -0.6920446754, 0.1975384802, 0.1649115533, 0.411051482, -0.0430319682, -0.3325484395, -0.194201827, -0.0915497243, 0.427323997, -0.0838774219, -0.1816160977, 0.1226128638, -0.0661409646, -0.3708955944, 0.014026612, 0.0454738513, 0.5089049339, -0.0749645978, 0.6180592775, -0.2792036533, 0.0359989591, -0.0625112355, 0.5453642607, -0.0798204243, 0.0674054697, -0.1730719358, -0.3623583317, -0.4296311438, 0.0478501916, 0.0823839828, -0.0268802196, -0.1800902784, -0.0236998349, -0.1829954386, -0.1946382225, -0.0307063609, -0.2555564642, 0.1911633462, -0.232670933, 0.2806385458, -0.080012843, 0.1896322817, 0.6002491117, 0.4785455465, -0.0664899945, -0.1000175327, 0.0531213954, 0.2909657061, 0.3145469725, 0.2713963389, -0.0265566409, 0.1282557547, 0.1029752493, 0.0896628276, -0.4230407476, 0.2618329823, 0.0376053527, -0.159441039, -0.4124113917, -0.20015347, 0.5952424407, 0.2829304338, 0.1778112054, 0.1629557014, 0.0327455848, -0.111343272, 0.3195310831, 0.0468818508, 0.7377001047, -0.0492729656, 0.3859352171, 0.1443641186, -0.1329418272, 0.3299087286, 0.2714164853, -0.0185040757, -0.4534935653, 0.0080828443, 0.0699943677, -0.1160737127, 0.2320919484, -0.0774203837, -0.2293434292, 0.2342054546, -0.2464666367, -0.3401261568, -0.2011540979, 0.2974869609, -0.4525097311, -0.3228260279, -0.0318483375, 0.0820498988, -0.1890284121, -0.0520337299, 0.0382166021, -0.0260015372, -0.1816879064, 0.0875810534, -0.3797726035, 0.075262323, 0.0180658773, 0.4964676499, -0.2078647912, -0.0943588018, 0.1373577714, 0.0333012566, -0.0198605694, 0.1730112582, -0.1235758737, -0.1225467548, -0.1923442185, -0.0259399153, 0.1587088555, -0.1749717891, 0.3594848514, 0.1130883992, 0.0593723804, -0.0185119212, -0.2020337582, -0.0545754246, -0.1769027859, -0.1465854049, 0.0577869378, -0.2877600491, -0.6232830286, -0.111554645, -0.2177120596, -0.3020793796, -0.0084354663, 0.2467582226, 0.1524902582, 0.3774372935, -0.1662783474, -0.0138625503, -0.0960467085, 0.5426025987, -0.2170471996, 0.3648028374, 0.5068681836, 0.1799971461, -0.206427604, -0.1599705219, 0.3782242537, 0.0054587089, 0.1507755667, 0.5503352284, -0.0991170928, 0.0169371814, -0.1889048815, 0.2538342476, 0.1505653411, -0.370757997, -0.160915494, -0.1064633057, -0.5591672659, 0.2067395598, 0.0927723944, 0.396738708, -0.1763737202, -0.1226248741, -0.2903544307, -0.028007362, -0.1391881704, 0.157817468, -0.2676870227, 0.0016691666, 0.1658401787, -0.0137936454, -0.0525888391, -0.1007535011, -0.0595299341, 0.1842211038, -0.0486182198, -0.0748259053, -0.0830293, 0.1172453836, 0.2271108627, -0.1736915112, -0.0266162325, -0.3926926553, -0.0113017512, -0.1907859147, 0.0279922336, 0.2519244552, -0.0885427892, 0.1128100082, 0.1268066764, 0.0777301416, 0.2172164321, 0.2322371155, 0.0071799997, 0.2455638647, 0.023315873, 0.3543139696, 0.2311374098, -0.2054191828, -0.2343903035, 0.0184837319, 0.2907339633, 0.0028006211, 0.3051241934, -0.2582033277, -0.1423428357, 0.255576551, 0.1525259316, 0.6202744246, -0.1304682344, -0.2227960527, 0.2998892963, 0.0897814035, 0.0638143271, -0.3358578086, 0.0940017626, -0.1985317767, -0.0703840405, 0.0349965394, -0.1245132834, 0.1647943109, -0.836609304, 0.06960015, 0.2907021642, 0.0823387653, -0.0154764634, 0.1485920846, 0.0258134305, -0.0169611759, 0.1871799678, 0.0637979135, 0.5537105799, 0.5625141859, -0.0818328038, 0.6099120378, 0.0296857245, 0.2446462065, -0.0165887512, -0.7433123589, 0.1946711391, 0.4049607813, 0.0361098796, 0.2161794454, 0.0082662515, 0.3752156496, -0.3950869143, -0.3191030025, -0.0506716259, 0.2922394276, -0.3702155352, -0.269880861, 0.0688756034, -0.1035977453, 0.1086753607, 0.3668444753, -0.2612330914, -0.0977838337, 0.3455853164, -0.0249213353, 0.0179145262, -0.1097211465, 0.0959116146, -0.0420458242, 0.289090842, -0.3097183406, 0.0306309666, 0.0174910016, -0.1720920652, -0.6128516793, -0.0106835049, 0.5050379038, 0.2819990814, -0.1961210668, -0.0660643131, 0.0685521662, 0.0303373411, -0.12914069, 0.0992150009, -0.1238472834, 0.1970008165, 0.4543985724, -0.0504103452, -0.0348029807, -0.0234675221, 0.0882916152, 0.2930333316, -0.1039104685, -0.0321988352, -0.0701636449, -0.3222334683, 0.1069180891, 0.1219473183, -0.1603210717, 0.1898336262, 0.568036139, -0.1474343687, 0.2258225679, 0.0884490833, 0.0404938161, -0.0526779331, 0.7015366554, 0.4067878425, -0.2560660243, -0.4636141062, 0.1385059357, -0.0690149665, -0.0021164417, -0.2306672633, 0.0536314994, -0.1855025738, 0.137277171, 0.1532154977, 0.0236977823, -0.2460392118, 0.28593871, -0.0149230249, 0.1722000539, -0.0651210323, -0.3166809678, -0.053701371, -0.1375624835, 0.0910059661, -0.634848237, 0.3538064957, 0.0071763135, -0.0413394682, -0.1618842483, -0.1475742012, -0.0180505365, 0.0729029179, 0.5200448036, 0.216836676, 0.2093252242, -0.2043678463, -0.4473113418, 0.0667584911, -0.0612405837, -0.0172181875, 0.1486823857, -0.1969656348, 0.5546962023, -0.1838609576, 0.6516254544, -0.372813642, 0.0651056916, -0.0792423487, 0.0196861215, 0.0209766105, -0.0593981259, -0.0028048009, -0.0336449258, 0.1575345397, 0.2505612671, -0.0595527291, 0.1921729445, -0.3644733727, -0.2029283643, 0.4465302527, 0.116966255, -0.1790779531, -0.093782559, -0.0345238522, 0.2249454856, -0.0534387082, -0.5481232405, -0.0274885595, 0.2250312269, 0.006643964, -0.291582644, 0.2220801115, -0.0191371925, -0.1319442391, -0.067482844, 1.1606020927, -0.264290452, -0.2252514213, 0.2253786027, -0.0351088569 ]
https://github.com/huggingface/datasets/issues/2133
bug in mlqa dataset
If you print those questions, you get readable texts: ```python >>> questions = [ ... "\u0645\u062a\u0649 \u0628\u062f\u0627\u062a \u0627\u0644\u0645\u062c\u0644\u0629 \u0627\u0644\u0645\u062f\u0631\u0633\u064a\u0629 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645 \u0628\u0627\u0644\u0646\u0634\u0631?", ... "\u0643\u0645 \u0645\u0631\u0629 \u064a\u062a\u0645 \u0646\u0634\u0631\u0647\u0627 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", ... "\u0645\u0627 \u0647\u064a \u0627\u0644\u0648\u0631\u0642\u0629 \u0627\u0644\u064a\u0648\u0645\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", ... "\u0643\u0645 \u0639\u062f\u062f \u0627\u0644\u0627\u0648\u0631\u0627\u0642 \u0627\u0644\u0627\u062e\u0628\u0627\u0631\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0627\u0644\u062a\u064a \u0648\u062c\u062f\u062a \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", ... "\u0641\u064a \u0627\u064a \u0633\u0646\u0629 \u0628\u062f\u0627\u062a \u0648\u0631\u0642\u0629 \u0627\u0644\u0637\u0627\u0644\u0628 \u0627\u0644\u062d\u0633 \u0627\u0644\u0633\u0644\u064a\u0645 \u0628\u0627\u0644\u0646\u0634\u0631 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?" ... ] >>> print(questions) ['متى بدات المجلة المدرسية في نوتردام بالنشر?', 'كم مرة يتم نشرها في نوتردام?', 'ما هي الورقة اليومية للطلاب في نوتردام?', 'كم عدد الاوراق الاخبارية للطلاب التي وجدت في نوتردام?', 'في اي سنة بدات ورقة الطالب الحس السليم بالنشر في نوتردام?'] ``` I don't think we can change this
Hi Looking into MLQA dataset for langauge "ar": ``` "question": [ "\u0645\u062a\u0649 \u0628\u062f\u0627\u062a \u0627\u0644\u0645\u062c\u0644\u0629 \u0627\u0644\u0645\u062f\u0631\u0633\u064a\u0629 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645 \u0628\u0627\u0644\u0646\u0634\u0631?", "\u0643\u0645 \u0645\u0631\u0629 \u064a\u062a\u0645 \u0646\u0634\u0631\u0647\u0627 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0645\u0627 \u0647\u064a \u0627\u0644\u0648\u0631\u0642\u0629 \u0627\u0644\u064a\u0648\u0645\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0643\u0645 \u0639\u062f\u062f \u0627\u0644\u0627\u0648\u0631\u0627\u0642 \u0627\u0644\u0627\u062e\u0628\u0627\u0631\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0627\u0644\u062a\u064a \u0648\u062c\u062f\u062a \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0641\u064a \u0627\u064a \u0633\u0646\u0629 \u0628\u062f\u0627\u062a \u0648\u0631\u0642\u0629 \u0627\u0644\u0637\u0627\u0644\u0628 \u0627\u0644\u062d\u0633 \u0627\u0644\u0633\u0644\u064a\u0645 \u0628\u0627\u0644\u0646\u0634\u0631 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?" ] ``` the questions are in the wrong format, and not readable, could you please have a look? thanks @lhoestq
111
bug in mlqa dataset Hi Looking into MLQA dataset for langauge "ar": ``` "question": [ "\u0645\u062a\u0649 \u0628\u062f\u0627\u062a \u0627\u0644\u0645\u062c\u0644\u0629 \u0627\u0644\u0645\u062f\u0631\u0633\u064a\u0629 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645 \u0628\u0627\u0644\u0646\u0634\u0631?", "\u0643\u0645 \u0645\u0631\u0629 \u064a\u062a\u0645 \u0646\u0634\u0631\u0647\u0627 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0645\u0627 \u0647\u064a \u0627\u0644\u0648\u0631\u0642\u0629 \u0627\u0644\u064a\u0648\u0645\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0643\u0645 \u0639\u062f\u062f \u0627\u0644\u0627\u0648\u0631\u0627\u0642 \u0627\u0644\u0627\u062e\u0628\u0627\u0631\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0627\u0644\u062a\u064a \u0648\u062c\u062f\u062a \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0641\u064a \u0627\u064a \u0633\u0646\u0629 \u0628\u062f\u0627\u062a \u0648\u0631\u0642\u0629 \u0627\u0644\u0637\u0627\u0644\u0628 \u0627\u0644\u062d\u0633 \u0627\u0644\u0633\u0644\u064a\u0645 \u0628\u0627\u0644\u0646\u0634\u0631 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?" ] ``` the questions are in the wrong format, and not readable, could you please have a look? thanks @lhoestq If you print those questions, you get readable texts: ```python >>> questions = [ ... "\u0645\u062a\u0649 \u0628\u062f\u0627\u062a \u0627\u0644\u0645\u062c\u0644\u0629 \u0627\u0644\u0645\u062f\u0631\u0633\u064a\u0629 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645 \u0628\u0627\u0644\u0646\u0634\u0631?", ... "\u0643\u0645 \u0645\u0631\u0629 \u064a\u062a\u0645 \u0646\u0634\u0631\u0647\u0627 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", ... "\u0645\u0627 \u0647\u064a \u0627\u0644\u0648\u0631\u0642\u0629 \u0627\u0644\u064a\u0648\u0645\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", ... "\u0643\u0645 \u0639\u062f\u062f \u0627\u0644\u0627\u0648\u0631\u0627\u0642 \u0627\u0644\u0627\u062e\u0628\u0627\u0631\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0627\u0644\u062a\u064a \u0648\u062c\u062f\u062a \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", ... "\u0641\u064a \u0627\u064a \u0633\u0646\u0629 \u0628\u062f\u0627\u062a \u0648\u0631\u0642\u0629 \u0627\u0644\u0637\u0627\u0644\u0628 \u0627\u0644\u062d\u0633 \u0627\u0644\u0633\u0644\u064a\u0645 \u0628\u0627\u0644\u0646\u0634\u0631 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?" ... ] >>> print(questions) ['متى بدات المجلة المدرسية في نوتردام بالنشر?', 'كم مرة يتم نشرها في نوتردام?', 'ما هي الورقة اليومية للطلاب في نوتردام?', 'كم عدد الاوراق الاخبارية للطلاب التي وجدت في نوتردام?', 'في اي سنة بدات ورقة الطالب الحس السليم بالنشر في نوتردام?'] ``` I don't think we can change this
[ -0.1158528477, -0.2315678, -0.2734041512, 0.2112119347, 0.3321492076, 0.0711948127, 0.3524686694, 0.1213380992, -0.3227720261, 0.2254541665, 0.061887309, 0.2817643285, 0.2518623173, 0.256121248, 0.1166762859, -0.0477858149, 0.1292084754, 0.1794564426, 0.0600869805, -0.197704643, -0.1964727938, 0.2453740388, -0.1337222606, 0.0539799333, -0.06799189, -0.033509694, -0.0207402669, 0.2208935171, -0.0425397307, 0.0830166042, -0.1433827579, -0.2492369115, -0.1639156342, 0.0051750429, -0.0001021291, -0.1083842516, 0.1797210574, -0.0530059636, -0.2548289001, 0.3303482831, -0.4433494508, 0.0542143509, -0.3197638988, -0.324565053, -0.1831695735, -0.1904881597, -0.0552759469, -0.5454844236, 0.315885365, 0.3931445181, 0.3555620909, 0.1169289052, -0.009352684, -0.0591307282, 0.2337929308, -0.0075344704, 0.0532884672, -0.0125401895, 0.0099400394, -0.0157069005, 0.0644995347, 0.5903980732, 0.1528966725, -0.0744413286, -0.2841551006, 0.0947688445, 0.2282184213, -0.1410569996, 0.3744465709, 0.2255225331, 0.2068459094, -0.2394520789, -0.1113861725, 0.0701103136, 0.0387010314, -0.1902518868, -0.0511133708, 0.2683143914, 0.048799932, 0.0880701467, 0.1475321949, 0.1784601063, -0.1978726089, 0.0273550116, -0.4308958352, 0.415948391, -0.1553923786, -0.0334865116, -0.1144849509, -0.243846342, -0.1090197787, 0.1160907894, -0.1431102455, 0.1030090004, -0.1794525087, -0.1882236004, -0.1247729212, 0.267688334, 0.0131062642, -0.0319192857, 0.1373085231, 0.1452644765, 0.2267719209, -0.0552488118, -0.1274059117, -0.0103750341, -0.1002313644, -0.1150461286, 0.22452268, -0.1293276548, -0.07697469, 0.0153342877, 0.0609566532, -0.2191797942, -0.1487829685, 0.2285623401, 0.1345373392, -0.1409998983, -0.3242004216, 0.0561230369, -0.3493773341, 0.0548069514, -0.1677000374, 0.3912611604, 0.2288831025, -0.0240961984, -0.1399517506, -0.0753450617, -0.1917121857, -0.3327357769, -0.3898275495, 0.1255717874, 0.1248719692, -0.2768229544, -0.0159335509, 0.3214125037, 0.2155390233, -0.0244431905, 0.126024276, 0.0829230845, 0.094971031, -0.1912809014, 0.2312820703, 0.2930064499, -0.1015833169, -0.0493383184, -0.0328688249, -0.0564301051, 0.0095264763, 0.1452573538, 0.0762136579, 0.0079343542, -0.3933086395, 0.3797928393, 0.3952756822, -0.0949569494, 0.1754640043, 0.2335368395, 0.2187479138, 0.0496394858, 0.1180227548, -0.106278643, -0.0218999013, -0.1518761367, 0.0634604245, 0.0898390934, -0.5268483758, 0.0284028649, -0.3689579666, -0.0933343247, 0.3024435043, 0.3060185313, 0.0991315916, -0.0708542094, -0.1700618118, 0.3025595248, 0.1694823354, -0.0779915601, -0.3400381207, 0.2042782754, -0.1599994153, -0.1875740886, 0.2839229107, 0.2088894993, -0.1037751511, -0.0227848999, 0.1018835008, 0.1511971653, -0.105543524, 0.0276851952, -0.123123616, -0.1423801333, 0.1725801975, 0.0685132146, -0.2583667934, -0.1137778312, 0.2595124245, 0.0241774656, 0.3915387988, -0.0147941429, -0.0749591887, 0.0135182906, 0.3583312929, -0.4317683876, 0.162547797, -0.072204262, -0.3222061098, -0.2190339863, -0.6098546982, 0.0809969231, -0.2334303707, -0.1778642982, -0.1760994345, -0.1031844392, 0.0356507376, 0.0966448337, 0.3250930607, 0.198095113, -0.0805994794, 0.2429172695, 0.0244634748, -0.0335515663, -0.038236659, -0.1474969834, -0.3175995946, 0.227022022, -0.1953136325, 0.0706110597, 0.1879198104, 0.3434305787, 0.1390684843, -0.0944971442, 0.1414387375, 0.0136979632, 0.0952922255, 0.2897175848, -0.1747561395, 0.1883357316, 0.2945401073, -0.2585282624, 0.0214189459, 0.3033975065, 0.3103999496, 0.0042769313, -0.1195695028, 0.3716928959, 0.0615129247, -0.0408307537, 0.0971447751, 0.0294479057, 0.4241670966, -0.0936099887, 0.1024364382, -0.5371358991, 0.1689566374, 0.1346679032, 0.2095031142, 0.0624081641, -0.5084813237, 0.4397792816, 0.4208016694, -0.0966069922, 0.0676752925, -0.1444755793, -0.1639983356, 0.0293987468, 0.0471221805, 0.1910908371, 0.2587711811, 0.278026402, 0.0747869536, 0.0024712011, -0.0050047822, -0.4039027691, 0.3473233581, -0.0582330264, 0.0497221872, 0.2490378916, 0.1140516549, -0.0766905695, -0.3842310607, 0.1208593175, -0.0701796636, 0.0866599604, -0.2455854118, 0.1962552071, -0.3665640056, -0.5910028815, -0.3121282458, -0.22074458, 0.164977774, -0.273204416, 0.2837465107, -0.1319197714, -0.2716564238, 0.2348254919, 0.1886446625, 0.3562224507, 0.2386366129, 0.2746743858, -0.310839206, -0.0177153759, -0.1842352152, 0.3107547462, 0.1267086267, 0.24907507, 0.1786776632, -0.2989785671, -0.1730293632, -0.2467733026, -0.4817385077, 0.0892968178, -0.0329140201, 0.361264348, 0.0369145423, -0.0061600693, -0.1015348434, -0.0593845174, -0.0475922376, 0.1554072201, -0.3217167556, -0.0999741778, -0.1066941768, -0.0564777441, -0.2586627305, -0.5629889369, -0.2710547447, -0.1909808517, -0.0850011408, -0.0118036494, 0.2423166484, -0.1813128293, -0.0354814827, 0.1197236627, 0.0902566835, -0.0801457167, -0.3614610732, 0.2991603017, 0.361500442, -0.1537982523, -0.444094032, -0.1383511871, -0.1057203263, 0.2217351794, -0.3010008633, -0.3994609714, -0.0869591534, -0.1401093155, -0.2230981588, -0.0174842849, -0.0737695247, 0.2164239734, -0.1130888164, -0.2328869998, -0.0172806382, -0.1985117793, 0.1154638082, 0.1303711385, 0.1697897762, -0.1722307205, 0.58268857, 0.0520811528, 0.1483303308, 0.1584413499, -0.1299766451, 0.1711342037, -0.1682366133, 0.126829043, -0.0480325446, -0.0453251898, 0.3635537028, 0.1533106863, -0.0188574009, 0.3690084219, -0.0572636165, -0.2640039325, 0.1094784513, 0.0063495785, -0.065322265, -0.1079195067, 0.0292383339, -0.291639477, -0.0198187009, 0.0833586603, 0.0959740728, 0.1944288611, -0.1557237953, 0.1136228591, 0.0154410377, 0.0269194171, -0.1321805716, -0.531431675, -0.2443505824, -0.2926124632, 0.3258085251, 0.0728761703, 0.3792928457, -0.2615158558, -0.1328956783, 0.1868350804, -0.1185834333, 0.5819473267, 0.1304206997, 0.1935623586, 0.213852942, 0.1884208173, 0.0790651664, 0.1521459818, -0.466581732, 0.3041166067, 0.1202669665, 0.2619280815, -0.1860759854, 0.0104631893, 0.1320600063, 0.270611316, -0.4115586877, 0.031306047, -0.3207560778, -0.2958230376, -0.0329888761, 0.1487251818, 0.1233903393, 0.3150465786, -0.0871901065, -0.0636227056, -0.1172881201, -0.4636471868, 0.0457350686, 0.2088247836, 0.3036417365, -0.0808655471, -0.0717989653, -0.1067920551, 0.3183945119, -0.1104691699, 0.3308580518, 0.1301065832, -0.0969372392, 0.0098025687, -0.4112183154, 0.2951392531, 0.0367313176, -0.1786260307, -0.009143699, 0.4109273553, 0.0753107518, -0.1215834618, -0.1314015687, 0.0782290697, 0.1548285931, -0.1019289047, -0.0663707405, 0.2100725472, -0.2370852977, -0.1019983739, -0.0266776644, 0.3568889797, -0.3343980312, 0.4691638649, 0.2304179072, 0.9524287581, 0.2300878614, 0.0048159454, 0.2026655078, -0.2724691927, 0.0495894961, 0.2469621748, 0.312580049, -0.360214293, 0.0808102489, -0.1237331256, -0.0259005725, 0.1456837952, 0.2686614692, -0.2391440868, 0.0368270837, -0.0991389453, 0.0187144633, 0.0578458905, -0.0420078821, 0.0123536196, 0.0667766184, -0.3098327219, 0.2407769859, 0.1604476124, -0.1262225658, -0.1036742851, -0.1553588212, 0.0229910314, -0.1915266663, -0.0891854465, 0.0344961137, -0.4054074585, 0.0044302791, 0.1254344881, -0.3809595108, -0.1101401374, 0.1247105002, 0.2879430652, 0.1120833158, 0.0355700701, 0.1754253656, 0.2798662782, 0.3331299722, 0.2754774094, 0.0300889015, 0.204837054, -0.3041775227, -0.162444517, 0.2047542632, 0.1176916212, -0.1924744695, -0.2655918598, 0.2533449531, 0.0037149284, 0.0201471709, -0.1261608601, -0.0415271968, -0.0486044884, -0.2539508641, 0.2601626813, -0.1233119667, -0.1218633652, 0.3450838923, -0.0151026305, -0.2232402414, -0.1870570481, 0.2631911337, 0.0915401578, 0.2749404311, 0.4604128301, 0.0735989511, -0.2701105177, -0.467040807, -0.1441358924, -0.0737693161, -0.2279801965, 0.1191657186, -0.1223843172, -0.225458473, -0.0895111412, 0.0805104524, -0.0582053848, 0.1274321377, -0.1490080953, -0.6126041412, -0.282582581, -0.0735412687, 0.0543803461, 0.1607298851, 0.1171975434, 0.0226547644, -0.1883124411, 0.0475361049, -0.4655612111, 0.1205716059, -0.1525131464, 0.068241477, -0.357603997, 0.0517569631, -0.056235373, 0.1945680678, 0.4125515819, -0.0648629367, -0.2503979206, -0.4053132534, -0.0830438435, 0.0675585866, -0.176130861, -0.1299039423, 0.0353784822, -0.0416137949, -0.2331760377, 0.1856705695, 0.0996724814, -0.1140599847, 0.0705625862, 0.0362367965, 0.1259874105, -0.0754712224, -0.0776157901, -0.0489321388, 0.1121364236, -0.1620779634, 0.173458159, 0.2188938856, -0.0234119091, -0.0476467162, 0.3097184896, -0.1309832633, -0.0507536791, 0.0357705727, 0.3090589941, -0.1389121115, -0.1823410243, 0.2213168144, 0.0059364513, 0.092344746, -0.3267613053, -0.1344146729, 0.0450520515, 0.4097962677, -0.5532667041, -0.0793980658, 0.0638041049, -0.0084644444, 0.1509257555, 0.1421747953, 0.2615836263, -0.1343316138, 0.1269419491, 0.2209291458, 0.3258604407, -0.2247743607, -0.172853142, 0.0507579073, -0.1218096167, 0.1692662239, 0.1125319526, 0.0999644101, 0.1192645431, 0.6916363239, -0.0437446758, 0.2923961878, 0.1101412028, 0.0679825246, 0.0815224946, 0.1393963993, 0.1451891214, 0.4456791878, -0.2920976281, 0.1568643004, 0.5386684537, -0.1165411472, 0.2051557004, 0.0246805288, -0.288428098, -0.148317948, -0.2918517888, -0.2522684932, -0.0286990479, -0.161662519, -0.0294934809, -0.1111191809, 0.0027755827, 0.042117022, 0.5325813293, -0.0071830489, -0.0443250909, -0.1829900444, -0.0525387228, -0.075263232, -0.0456417426, -0.1999219507, 0.3746515512, 0.3940323293, -0.0059071444, 0.2505500019, -0.0202578362, 0.1869514138, 0.0737285316, -0.0990661681, 0.0158183612, -0.1997043192, -0.281688273, -0.1842631996, 0.2646848857, 0.1495169103, 0.3046129644, 0.214852497, 0.3038096428, -0.2171557844, 0.1580083817, 0.5882332325, 0.1517387778, -0.069379203, 0.0392127633, -0.4237431288, -0.025701113, -0.320961386, 0.0478473678, -0.2464504838, 0.0778163075, 0.0034493841, -0.2867472172, 0.1594925374, 0.1201612577, 0.1503570378, 0.0604840666, 0.6015748978, 0.1133556366, -0.0661052018, -0.1337704659, -0.2346677184, -0.5674970746, 0.1958337873, 0.2363111228, -0.0519492552, -0.1713323146, 0.3429600596, 0.1597279608, -0.0710562468, 0.090209946, 0.0962436646, -0.0821879357, -0.0162223335, -0.4123510718, -0.1067944095, 0.1234899163, 0.2328350991, -0.1281643957, -0.370875746, 0.3792415261, 0.0888494253, 0.1948824376, -0.2314060032, -0.2158890963, -0.1824167669, 0.2466812134, 0.0318037793, 0.3799422085, 0.1526886672, -0.3498205543, 0.0361989513, 0.112077862, 0.0147677399, -0.1114463359, 0.2188643813, 0.2435278594, 0.217315495, 0.1415942013, 0.0435098335, 0.1522724628, 0.4297477901, 0.0463588983, -0.1174226105, -0.2635604441, 0.5547004938, -0.1008021384, -0.0520819947, -0.1178276539, 0.1396929026, 0.0085183112, -0.0532907844, -0.0157468915, -0.4543576241, 0.3082258105, -0.5355833173, -0.2539764047, -0.0591679588, 0.1182154119, 0.1231310517, -0.0180410836, -0.2814454734, 0.0923635662, 0.3500167131, -0.2909098268, 0.1102768406, 0.4204137921, 0.1702203751, -0.0142797753, -0.2048444599, 0.1536104232, 0.4446440637, -0.1842170656, -0.0485982411, -0.4758796096 ]
https://github.com/huggingface/datasets/issues/2133
bug in mlqa dataset
Hi @dorost1234. In Python 3, strings are sequences of Unicode _code points_. Unicode is a specification that maps all characters (and emoji symbols) with its unique representation in terms of code points. That is what you see: Unicode code points (represented by a \u escaped sequence of 16-bit hex values). Characters are usually represented (on screen and papers) with a graphical element called _glyph_. That is what you would like to see: glyphs. But Python does not care about glyphs: that is the job of the GUI or the terminal; glyphs are what you get with the `print` function (if your terminal is properly configured to display those glyphs). You have more detailed information about Unicode in the Python documentation: https://docs.python.org/3/howto/unicode.html
Hi Looking into MLQA dataset for langauge "ar": ``` "question": [ "\u0645\u062a\u0649 \u0628\u062f\u0627\u062a \u0627\u0644\u0645\u062c\u0644\u0629 \u0627\u0644\u0645\u062f\u0631\u0633\u064a\u0629 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645 \u0628\u0627\u0644\u0646\u0634\u0631?", "\u0643\u0645 \u0645\u0631\u0629 \u064a\u062a\u0645 \u0646\u0634\u0631\u0647\u0627 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0645\u0627 \u0647\u064a \u0627\u0644\u0648\u0631\u0642\u0629 \u0627\u0644\u064a\u0648\u0645\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0643\u0645 \u0639\u062f\u062f \u0627\u0644\u0627\u0648\u0631\u0627\u0642 \u0627\u0644\u0627\u062e\u0628\u0627\u0631\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0627\u0644\u062a\u064a \u0648\u062c\u062f\u062a \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0641\u064a \u0627\u064a \u0633\u0646\u0629 \u0628\u062f\u0627\u062a \u0648\u0631\u0642\u0629 \u0627\u0644\u0637\u0627\u0644\u0628 \u0627\u0644\u062d\u0633 \u0627\u0644\u0633\u0644\u064a\u0645 \u0628\u0627\u0644\u0646\u0634\u0631 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?" ] ``` the questions are in the wrong format, and not readable, could you please have a look? thanks @lhoestq
121
bug in mlqa dataset Hi Looking into MLQA dataset for langauge "ar": ``` "question": [ "\u0645\u062a\u0649 \u0628\u062f\u0627\u062a \u0627\u0644\u0645\u062c\u0644\u0629 \u0627\u0644\u0645\u062f\u0631\u0633\u064a\u0629 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645 \u0628\u0627\u0644\u0646\u0634\u0631?", "\u0643\u0645 \u0645\u0631\u0629 \u064a\u062a\u0645 \u0646\u0634\u0631\u0647\u0627 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0645\u0627 \u0647\u064a \u0627\u0644\u0648\u0631\u0642\u0629 \u0627\u0644\u064a\u0648\u0645\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0643\u0645 \u0639\u062f\u062f \u0627\u0644\u0627\u0648\u0631\u0627\u0642 \u0627\u0644\u0627\u062e\u0628\u0627\u0631\u064a\u0629 \u0644\u0644\u0637\u0644\u0627\u0628 \u0627\u0644\u062a\u064a \u0648\u062c\u062f\u062a \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?", "\u0641\u064a \u0627\u064a \u0633\u0646\u0629 \u0628\u062f\u0627\u062a \u0648\u0631\u0642\u0629 \u0627\u0644\u0637\u0627\u0644\u0628 \u0627\u0644\u062d\u0633 \u0627\u0644\u0633\u0644\u064a\u0645 \u0628\u0627\u0644\u0646\u0634\u0631 \u0641\u064a \u0646\u0648\u062a\u0631\u062f\u0627\u0645?" ] ``` the questions are in the wrong format, and not readable, could you please have a look? thanks @lhoestq Hi @dorost1234. In Python 3, strings are sequences of Unicode _code points_. Unicode is a specification that maps all characters (and emoji symbols) with its unique representation in terms of code points. That is what you see: Unicode code points (represented by a \u escaped sequence of 16-bit hex values). Characters are usually represented (on screen and papers) with a graphical element called _glyph_. That is what you would like to see: glyphs. But Python does not care about glyphs: that is the job of the GUI or the terminal; glyphs are what you get with the `print` function (if your terminal is properly configured to display those glyphs). You have more detailed information about Unicode in the Python documentation: https://docs.python.org/3/howto/unicode.html
[ -0.1158528477, -0.2315678, -0.2734041512, 0.2112119347, 0.3321492076, 0.0711948127, 0.3524686694, 0.1213380992, -0.3227720261, 0.2254541665, 0.061887309, 0.2817643285, 0.2518623173, 0.256121248, 0.1166762859, -0.0477858149, 0.1292084754, 0.1794564426, 0.0600869805, -0.197704643, -0.1964727938, 0.2453740388, -0.1337222606, 0.0539799333, -0.06799189, -0.033509694, -0.0207402669, 0.2208935171, -0.0425397307, 0.0830166042, -0.1433827579, -0.2492369115, -0.1639156342, 0.0051750429, -0.0001021291, -0.1083842516, 0.1797210574, -0.0530059636, -0.2548289001, 0.3303482831, -0.4433494508, 0.0542143509, -0.3197638988, -0.324565053, -0.1831695735, -0.1904881597, -0.0552759469, -0.5454844236, 0.315885365, 0.3931445181, 0.3555620909, 0.1169289052, -0.009352684, -0.0591307282, 0.2337929308, -0.0075344704, 0.0532884672, -0.0125401895, 0.0099400394, -0.0157069005, 0.0644995347, 0.5903980732, 0.1528966725, -0.0744413286, -0.2841551006, 0.0947688445, 0.2282184213, -0.1410569996, 0.3744465709, 0.2255225331, 0.2068459094, -0.2394520789, -0.1113861725, 0.0701103136, 0.0387010314, -0.1902518868, -0.0511133708, 0.2683143914, 0.048799932, 0.0880701467, 0.1475321949, 0.1784601063, -0.1978726089, 0.0273550116, -0.4308958352, 0.415948391, -0.1553923786, -0.0334865116, -0.1144849509, -0.243846342, -0.1090197787, 0.1160907894, -0.1431102455, 0.1030090004, -0.1794525087, -0.1882236004, -0.1247729212, 0.267688334, 0.0131062642, -0.0319192857, 0.1373085231, 0.1452644765, 0.2267719209, -0.0552488118, -0.1274059117, -0.0103750341, -0.1002313644, -0.1150461286, 0.22452268, -0.1293276548, -0.07697469, 0.0153342877, 0.0609566532, -0.2191797942, -0.1487829685, 0.2285623401, 0.1345373392, -0.1409998983, -0.3242004216, 0.0561230369, -0.3493773341, 0.0548069514, -0.1677000374, 0.3912611604, 0.2288831025, -0.0240961984, -0.1399517506, -0.0753450617, -0.1917121857, -0.3327357769, -0.3898275495, 0.1255717874, 0.1248719692, -0.2768229544, -0.0159335509, 0.3214125037, 0.2155390233, -0.0244431905, 0.126024276, 0.0829230845, 0.094971031, -0.1912809014, 0.2312820703, 0.2930064499, -0.1015833169, -0.0493383184, -0.0328688249, -0.0564301051, 0.0095264763, 0.1452573538, 0.0762136579, 0.0079343542, -0.3933086395, 0.3797928393, 0.3952756822, -0.0949569494, 0.1754640043, 0.2335368395, 0.2187479138, 0.0496394858, 0.1180227548, -0.106278643, -0.0218999013, -0.1518761367, 0.0634604245, 0.0898390934, -0.5268483758, 0.0284028649, -0.3689579666, -0.0933343247, 0.3024435043, 0.3060185313, 0.0991315916, -0.0708542094, -0.1700618118, 0.3025595248, 0.1694823354, -0.0779915601, -0.3400381207, 0.2042782754, -0.1599994153, -0.1875740886, 0.2839229107, 0.2088894993, -0.1037751511, -0.0227848999, 0.1018835008, 0.1511971653, -0.105543524, 0.0276851952, -0.123123616, -0.1423801333, 0.1725801975, 0.0685132146, -0.2583667934, -0.1137778312, 0.2595124245, 0.0241774656, 0.3915387988, -0.0147941429, -0.0749591887, 0.0135182906, 0.3583312929, -0.4317683876, 0.162547797, -0.072204262, -0.3222061098, -0.2190339863, -0.6098546982, 0.0809969231, -0.2334303707, -0.1778642982, -0.1760994345, -0.1031844392, 0.0356507376, 0.0966448337, 0.3250930607, 0.198095113, -0.0805994794, 0.2429172695, 0.0244634748, -0.0335515663, -0.038236659, -0.1474969834, -0.3175995946, 0.227022022, -0.1953136325, 0.0706110597, 0.1879198104, 0.3434305787, 0.1390684843, -0.0944971442, 0.1414387375, 0.0136979632, 0.0952922255, 0.2897175848, -0.1747561395, 0.1883357316, 0.2945401073, -0.2585282624, 0.0214189459, 0.3033975065, 0.3103999496, 0.0042769313, -0.1195695028, 0.3716928959, 0.0615129247, -0.0408307537, 0.0971447751, 0.0294479057, 0.4241670966, -0.0936099887, 0.1024364382, -0.5371358991, 0.1689566374, 0.1346679032, 0.2095031142, 0.0624081641, -0.5084813237, 0.4397792816, 0.4208016694, -0.0966069922, 0.0676752925, -0.1444755793, -0.1639983356, 0.0293987468, 0.0471221805, 0.1910908371, 0.2587711811, 0.278026402, 0.0747869536, 0.0024712011, -0.0050047822, -0.4039027691, 0.3473233581, -0.0582330264, 0.0497221872, 0.2490378916, 0.1140516549, -0.0766905695, -0.3842310607, 0.1208593175, -0.0701796636, 0.0866599604, -0.2455854118, 0.1962552071, -0.3665640056, -0.5910028815, -0.3121282458, -0.22074458, 0.164977774, -0.273204416, 0.2837465107, -0.1319197714, -0.2716564238, 0.2348254919, 0.1886446625, 0.3562224507, 0.2386366129, 0.2746743858, -0.310839206, -0.0177153759, -0.1842352152, 0.3107547462, 0.1267086267, 0.24907507, 0.1786776632, -0.2989785671, -0.1730293632, -0.2467733026, -0.4817385077, 0.0892968178, -0.0329140201, 0.361264348, 0.0369145423, -0.0061600693, -0.1015348434, -0.0593845174, -0.0475922376, 0.1554072201, -0.3217167556, -0.0999741778, -0.1066941768, -0.0564777441, -0.2586627305, -0.5629889369, -0.2710547447, -0.1909808517, -0.0850011408, -0.0118036494, 0.2423166484, -0.1813128293, -0.0354814827, 0.1197236627, 0.0902566835, -0.0801457167, -0.3614610732, 0.2991603017, 0.361500442, -0.1537982523, -0.444094032, -0.1383511871, -0.1057203263, 0.2217351794, -0.3010008633, -0.3994609714, -0.0869591534, -0.1401093155, -0.2230981588, -0.0174842849, -0.0737695247, 0.2164239734, -0.1130888164, -0.2328869998, -0.0172806382, -0.1985117793, 0.1154638082, 0.1303711385, 0.1697897762, -0.1722307205, 0.58268857, 0.0520811528, 0.1483303308, 0.1584413499, -0.1299766451, 0.1711342037, -0.1682366133, 0.126829043, -0.0480325446, -0.0453251898, 0.3635537028, 0.1533106863, -0.0188574009, 0.3690084219, -0.0572636165, -0.2640039325, 0.1094784513, 0.0063495785, -0.065322265, -0.1079195067, 0.0292383339, -0.291639477, -0.0198187009, 0.0833586603, 0.0959740728, 0.1944288611, -0.1557237953, 0.1136228591, 0.0154410377, 0.0269194171, -0.1321805716, -0.531431675, -0.2443505824, -0.2926124632, 0.3258085251, 0.0728761703, 0.3792928457, -0.2615158558, -0.1328956783, 0.1868350804, -0.1185834333, 0.5819473267, 0.1304206997, 0.1935623586, 0.213852942, 0.1884208173, 0.0790651664, 0.1521459818, -0.466581732, 0.3041166067, 0.1202669665, 0.2619280815, -0.1860759854, 0.0104631893, 0.1320600063, 0.270611316, -0.4115586877, 0.031306047, -0.3207560778, -0.2958230376, -0.0329888761, 0.1487251818, 0.1233903393, 0.3150465786, -0.0871901065, -0.0636227056, -0.1172881201, -0.4636471868, 0.0457350686, 0.2088247836, 0.3036417365, -0.0808655471, -0.0717989653, -0.1067920551, 0.3183945119, -0.1104691699, 0.3308580518, 0.1301065832, -0.0969372392, 0.0098025687, -0.4112183154, 0.2951392531, 0.0367313176, -0.1786260307, -0.009143699, 0.4109273553, 0.0753107518, -0.1215834618, -0.1314015687, 0.0782290697, 0.1548285931, -0.1019289047, -0.0663707405, 0.2100725472, -0.2370852977, -0.1019983739, -0.0266776644, 0.3568889797, -0.3343980312, 0.4691638649, 0.2304179072, 0.9524287581, 0.2300878614, 0.0048159454, 0.2026655078, -0.2724691927, 0.0495894961, 0.2469621748, 0.312580049, -0.360214293, 0.0808102489, -0.1237331256, -0.0259005725, 0.1456837952, 0.2686614692, -0.2391440868, 0.0368270837, -0.0991389453, 0.0187144633, 0.0578458905, -0.0420078821, 0.0123536196, 0.0667766184, -0.3098327219, 0.2407769859, 0.1604476124, -0.1262225658, -0.1036742851, -0.1553588212, 0.0229910314, -0.1915266663, -0.0891854465, 0.0344961137, -0.4054074585, 0.0044302791, 0.1254344881, -0.3809595108, -0.1101401374, 0.1247105002, 0.2879430652, 0.1120833158, 0.0355700701, 0.1754253656, 0.2798662782, 0.3331299722, 0.2754774094, 0.0300889015, 0.204837054, -0.3041775227, -0.162444517, 0.2047542632, 0.1176916212, -0.1924744695, -0.2655918598, 0.2533449531, 0.0037149284, 0.0201471709, -0.1261608601, -0.0415271968, -0.0486044884, -0.2539508641, 0.2601626813, -0.1233119667, -0.1218633652, 0.3450838923, -0.0151026305, -0.2232402414, -0.1870570481, 0.2631911337, 0.0915401578, 0.2749404311, 0.4604128301, 0.0735989511, -0.2701105177, -0.467040807, -0.1441358924, -0.0737693161, -0.2279801965, 0.1191657186, -0.1223843172, -0.225458473, -0.0895111412, 0.0805104524, -0.0582053848, 0.1274321377, -0.1490080953, -0.6126041412, -0.282582581, -0.0735412687, 0.0543803461, 0.1607298851, 0.1171975434, 0.0226547644, -0.1883124411, 0.0475361049, -0.4655612111, 0.1205716059, -0.1525131464, 0.068241477, -0.357603997, 0.0517569631, -0.056235373, 0.1945680678, 0.4125515819, -0.0648629367, -0.2503979206, -0.4053132534, -0.0830438435, 0.0675585866, -0.176130861, -0.1299039423, 0.0353784822, -0.0416137949, -0.2331760377, 0.1856705695, 0.0996724814, -0.1140599847, 0.0705625862, 0.0362367965, 0.1259874105, -0.0754712224, -0.0776157901, -0.0489321388, 0.1121364236, -0.1620779634, 0.173458159, 0.2188938856, -0.0234119091, -0.0476467162, 0.3097184896, -0.1309832633, -0.0507536791, 0.0357705727, 0.3090589941, -0.1389121115, -0.1823410243, 0.2213168144, 0.0059364513, 0.092344746, -0.3267613053, -0.1344146729, 0.0450520515, 0.4097962677, -0.5532667041, -0.0793980658, 0.0638041049, -0.0084644444, 0.1509257555, 0.1421747953, 0.2615836263, -0.1343316138, 0.1269419491, 0.2209291458, 0.3258604407, -0.2247743607, -0.172853142, 0.0507579073, -0.1218096167, 0.1692662239, 0.1125319526, 0.0999644101, 0.1192645431, 0.6916363239, -0.0437446758, 0.2923961878, 0.1101412028, 0.0679825246, 0.0815224946, 0.1393963993, 0.1451891214, 0.4456791878, -0.2920976281, 0.1568643004, 0.5386684537, -0.1165411472, 0.2051557004, 0.0246805288, -0.288428098, -0.148317948, -0.2918517888, -0.2522684932, -0.0286990479, -0.161662519, -0.0294934809, -0.1111191809, 0.0027755827, 0.042117022, 0.5325813293, -0.0071830489, -0.0443250909, -0.1829900444, -0.0525387228, -0.075263232, -0.0456417426, -0.1999219507, 0.3746515512, 0.3940323293, -0.0059071444, 0.2505500019, -0.0202578362, 0.1869514138, 0.0737285316, -0.0990661681, 0.0158183612, -0.1997043192, -0.281688273, -0.1842631996, 0.2646848857, 0.1495169103, 0.3046129644, 0.214852497, 0.3038096428, -0.2171557844, 0.1580083817, 0.5882332325, 0.1517387778, -0.069379203, 0.0392127633, -0.4237431288, -0.025701113, -0.320961386, 0.0478473678, -0.2464504838, 0.0778163075, 0.0034493841, -0.2867472172, 0.1594925374, 0.1201612577, 0.1503570378, 0.0604840666, 0.6015748978, 0.1133556366, -0.0661052018, -0.1337704659, -0.2346677184, -0.5674970746, 0.1958337873, 0.2363111228, -0.0519492552, -0.1713323146, 0.3429600596, 0.1597279608, -0.0710562468, 0.090209946, 0.0962436646, -0.0821879357, -0.0162223335, -0.4123510718, -0.1067944095, 0.1234899163, 0.2328350991, -0.1281643957, -0.370875746, 0.3792415261, 0.0888494253, 0.1948824376, -0.2314060032, -0.2158890963, -0.1824167669, 0.2466812134, 0.0318037793, 0.3799422085, 0.1526886672, -0.3498205543, 0.0361989513, 0.112077862, 0.0147677399, -0.1114463359, 0.2188643813, 0.2435278594, 0.217315495, 0.1415942013, 0.0435098335, 0.1522724628, 0.4297477901, 0.0463588983, -0.1174226105, -0.2635604441, 0.5547004938, -0.1008021384, -0.0520819947, -0.1178276539, 0.1396929026, 0.0085183112, -0.0532907844, -0.0157468915, -0.4543576241, 0.3082258105, -0.5355833173, -0.2539764047, -0.0591679588, 0.1182154119, 0.1231310517, -0.0180410836, -0.2814454734, 0.0923635662, 0.3500167131, -0.2909098268, 0.1102768406, 0.4204137921, 0.1702203751, -0.0142797753, -0.2048444599, 0.1536104232, 0.4446440637, -0.1842170656, -0.0485982411, -0.4758796096 ]
https://github.com/huggingface/datasets/issues/2132
TydiQA dataset is mixed and is not split per language
You can filter the languages this way: ```python tydiqa_en = tydiqa_dataset.filter(lambda x: x["language"] == "english") ``` Otherwise maybe we can have one configuration per language ? What do you think of this for example ? ```python load_dataset("tydiqa", "primary_task.en") ```
Hi @lhoestq Currently TydiQA is mixed and user can only access the whole training set of all languages: https://www.tensorflow.org/datasets/catalog/tydi_qa for using this dataset, one need to train/evaluate in each separate language, and having them mixed, makes it hard to use this dataset. This is much convenient for user to have them split and I appreciate your help on this. Meanwhile, till hopefully this is split per language, I greatly appreciate telling me how I can preprocess and get data per language. thanks a lot
39
TydiQA dataset is mixed and is not split per language Hi @lhoestq Currently TydiQA is mixed and user can only access the whole training set of all languages: https://www.tensorflow.org/datasets/catalog/tydi_qa for using this dataset, one need to train/evaluate in each separate language, and having them mixed, makes it hard to use this dataset. This is much convenient for user to have them split and I appreciate your help on this. Meanwhile, till hopefully this is split per language, I greatly appreciate telling me how I can preprocess and get data per language. thanks a lot You can filter the languages this way: ```python tydiqa_en = tydiqa_dataset.filter(lambda x: x["language"] == "english") ``` Otherwise maybe we can have one configuration per language ? What do you think of this for example ? ```python load_dataset("tydiqa", "primary_task.en") ```
[ -0.259206295, -0.2352885902, -0.2044115961, 0.2665458322, 0.2771569788, -0.0258291885, 0.3412587345, 0.3332071304, -0.1514983773, 0.0776817426, -0.3343152404, -0.0462715626, -0.0167532787, 0.4214192927, 0.0419182405, -0.3201329112, -0.1105373949, 0.0581464581, -0.1372380108, -0.0098228157, 0.0238346457, 0.1549571604, -0.1817222685, 0.131639272, 0.0915520489, -0.173620984, -0.0809655711, -0.0455804802, 0.0590334833, -0.0585783683, 0.4464204609, 0.1073088497, 0.2670316696, 0.3341659307, -0.0001084638, 0.1922282577, -0.0415639877, -0.3396551609, 0.1110021174, -0.2360352874, -0.1122630686, -0.3174520135, -0.0924159586, -0.2043165267, -0.536569953, -0.1827822328, 0.0295534339, -0.3825771213, 0.3870956302, 0.2981824279, 0.1465834379, 0.1663263887, -0.1849586666, 0.2282591164, -0.0572573841, 0.0546517596, -0.1057087556, -0.0530427285, 0.5951901674, -0.0774744898, 0.3307023346, 0.277723968, 0.1899044216, 0.0749690533, -0.4010952711, 0.1116973907, 0.0430987775, -0.5291082263, 0.0033929925, 0.5172390342, 0.4501476884, 0.0541579574, -0.3280534148, -0.1335923821, -0.0303184688, -0.2640709877, 0.1254834384, 0.38144207, -0.1881921291, 0.2486718446, 0.3558286428, 0.0850684494, -0.262557447, 0.1491751224, -0.293821305, 0.303758055, -0.0313542597, 0.060394045, -0.0548036024, -0.1423951983, 0.2361639142, 0.2435268909, 0.0689524561, 0.2564909756, -0.4733608067, -0.2544715703, -0.1434988678, -0.3753198087, -0.1192738116, -0.3847773671, 0.1379221827, 0.3340655565, -0.1463014185, -0.0021058256, 0.2769569159, -0.0824466795, 0.2340907305, 0.3656901121, 0.2035244703, -0.1067951694, 0.0105771199, 0.0757099688, -0.1920622289, -0.3306030929, -0.4287641048, 0.2712708116, 0.1740674227, 0.0394178927, -0.3159443736, -0.1879137456, -0.1263175756, -0.2216868252, 0.1088806316, 0.3437945247, -0.0275607668, -0.0091706943, 0.0795595571, 0.4542487562, -0.3114557266, -0.3753986955, -0.1421310902, -0.0536273718, -0.1073865965, -0.1681632102, 0.0842010826, 0.2148735821, -0.0248489175, 0.0667256713, -0.0025113728, -0.1574175656, 0.3517778516, -0.2013826221, 0.1175371632, 0.0731889457, 0.1900310516, 0.0227769539, 0.2191590965, -0.2975351214, -0.3487257361, 0.0580841042, -0.2783571184, -0.2406384051, 0.0743739679, 0.1674491167, 0.3175938129, 0.1445008665, 0.0269593373, 0.7229223251, 0.3423041403, 0.0413440019, -0.0289357975, 0.0486030802, -0.2848917544, -0.0555128828, 0.2881776989, 0.1628835052, -0.5802619457, -0.1281797588, 0.2130146176, -0.3220678866, 0.2155668736, 0.214967072, -0.1866119951, 0.3718903363, 0.0974324867, -0.2031814456, 0.7471083403, -0.2007605135, -0.3531039357, 0.0390422791, 0.1203385592, 0.1161095724, 0.0331048071, 0.0693074167, 0.134856075, -0.0257895645, 0.2053062171, 0.5336024761, -0.2365161926, 0.0297369808, 0.0447357222, -0.0627163798, 0.3733543754, 0.4188769758, -0.057233192, -0.2378857285, -0.012654487, 0.2349273562, 0.3820690215, -0.1548737586, 0.0942422971, 0.0616838522, -0.3036398292, 0.1535948217, 0.0307176448, -0.2157306373, -0.2534968853, 0.2257353067, -0.3984828591, 0.2190702409, 0.0171266776, -0.1806215644, 0.1356503665, -0.198494181, -0.3050168157, -0.2456898838, 0.1831279099, -0.1110467464, 0.0207428932, 0.162961632, -0.1032501385, 0.0985127538, -0.1514897943, -0.0800128579, -0.192206651, 0.0206567049, 0.0212979149, -0.0716992319, 0.0058192238, 0.2450120151, -0.1134708077, -0.2013848126, -0.0574633479, -0.093555823, 0.1642185152, 0.1159626096, -0.1913137734, -0.208558768, 0.3557848334, -0.07331267, -0.0767928958, 0.0469789766, 0.0040059052, -0.1576795578, 0.0584184937, 0.5854185224, -0.0236307345, 0.2771930099, 0.0699688122, -0.0590589717, 0.3816142082, -0.1984381229, -0.0212122351, -0.2191329002, 0.276999414, -0.1963721961, 0.000817664, -0.0419194326, -0.4412222803, 0.1670795977, 0.4789671898, 0.1411515921, 0.227794677, 0.0006078523, 0.305113554, 0.1892089993, -0.0941259712, 0.2189484835, 0.1907680333, 0.0479790904, 0.2750663459, -0.1851739138, 0.3741774261, -0.1362420619, 0.0320608169, -0.1583356857, 0.0158970952, 0.0188289881, -0.0313223302, -0.1062835902, -0.0132906362, 0.1975892782, 0.1503421068, 0.1288618147, -0.0227201506, 0.2100904286, -0.4768429697, -0.3273681104, -0.2023431063, -0.3072570264, 0.0733936206, 0.208788693, 0.206176579, -0.4034988284, -0.1359767467, 0.2662345171, 0.2984232605, -0.0250989348, -0.1683412492, -0.175829798, 0.0169531628, -0.2763133943, -0.2165088058, 0.1792733967, 0.2920336127, -0.0906249285, 0.2981309593, -0.3847179413, -0.2344311327, 0.0706422925, -0.2707391977, 0.0934719145, -0.2213931233, 0.0547200963, -0.1595891118, 0.1746495962, 0.0280355066, -0.1556291729, 0.3326015472, 0.2598110139, -0.1141361445, 0.1519023478, -0.0054756217, 0.1311877966, 0.0371145755, -0.6562103629, -0.7368296385, -0.1958164871, -0.2545369267, -0.1273785233, 0.3844644725, -0.4101473689, 0.0553296134, -0.1220947802, 0.05139561, 0.1855768412, -0.0182750169, -0.1578796804, 0.130866155, -0.3448562622, -0.351313889, -0.0799213275, -0.0584393702, 0.6852424741, 0.0431129336, -0.129910931, 0.3011082113, -0.1743428111, 0.0555237979, -0.1316675246, -0.0169698205, 0.298624754, -0.094156459, 0.1243959144, -0.0248787254, 0.2955361307, 0.1937159449, -0.2547278106, 0.2401015162, 0.0134678893, 0.3823543191, 0.1917833388, 0.7117958069, 0.2415474951, -0.0094929552, 0.2683727741, 0.0604746044, -0.2061231881, -0.0968329161, -0.3948801458, 0.0126799829, 0.2939457297, 0.1647690386, 0.2630430162, 0.0525143184, -0.4610903859, -0.3819293976, -0.2104381323, -0.3223954439, -0.4282875061, 0.3108149171, -0.233442232, 0.325969398, -0.1103403568, -0.1093481034, 0.041519478, 0.0197685696, -0.2085599303, 0.2697068453, -0.2869633436, 0.1213250905, -0.1540875733, -0.3814834654, -0.1956704408, 0.2603661716, 0.0273122415, 0.2598647475, -0.3271663785, -0.0667768344, 0.2577711642, 0.0129685998, 0.4652478695, -0.003033923, -0.0346147045, -0.1049609333, -0.2077573538, -0.0547853485, 0.0457563996, -0.1851529181, -0.0577436611, 0.285966903, 0.0354524292, -0.3558894992, -0.3494697511, -0.193521589, 0.2499519289, -0.403106451, 0.1149710566, -0.282882154, -0.418150723, -0.1601431221, 0.3174799681, 0.0429387018, 0.0426314324, 0.0948903188, -0.379386425, -0.2059390694, 0.1876852512, 0.0874074847, 0.3865201771, 0.0501491651, -0.142416954, 0.2228978872, -0.0953624099, -0.2537566423, 0.366915524, 0.5436350703, -0.11358051, -0.5056566596, 0.0044329595, -0.2693909407, 0.4042412937, 0.1753693223, -0.0647639483, 0.0708351508, -0.1406498551, -0.0317507423, -0.2224085033, 0.2009245753, 0.45449543, 0.207108438, -0.636208415, -0.5407912731, 0.1689661145, -0.0918036625, -0.0340851769, 0.4179155231, 0.1066998988, -0.3516063392, 0.4943618476, 0.1378396749, 0.8109484911, -0.2904719114, 0.1912714392, 0.0946338475, 0.1352832764, 0.1510021687, -0.202816397, -0.0893721282, -0.0699800104, -0.0036593247, -0.1287713498, 0.0796499848, 0.2045091093, 0.3761950731, -0.3296662867, 0.0417620353, -0.1871779561, -0.5379317403, 0.0161057487, 0.2127108425, -0.2093778253, -0.1705772579, -0.2777919471, 0.0850293338, -0.1662086546, 0.1448353976, -0.0725888461, -0.073076278, -0.080703631, 0.0600313097, -0.1282905936, -0.0290324949, -0.349860549, -0.1406414211, -0.16321446, -0.5811937451, 0.4124371409, 0.5101851821, 0.3279881775, 0.2206026018, -0.0412411466, 0.2668743432, 0.150714457, 0.0529298931, 0.0414052978, -0.2150476873, 0.1918549091, -0.0683288425, -0.339277029, 0.0616896674, 0.1848705709, 0.2014491558, -0.1583432555, 0.2512345016, 0.2051074356, -0.1945831478, -0.1419595331, 0.1469658017, 0.1715349555, -0.0241319202, 0.1722888052, 0.270211637, -0.2065199167, 0.1338063776, -0.2121039033, -0.2760446072, -0.1011272594, -0.3500294387, 0.4322403371, 0.2798497081, 0.4518118799, 0.2038096339, -0.0289554596, -0.1422360539, 0.3866252899, 0.0002724603, -0.1847755611, -0.1028970927, 0.3043477237, 0.0500917137, -0.0555194989, 0.2425950766, -0.2680445313, -0.1343913227, -0.0525049902, -0.371381104, -0.0147939622, 0.0284188911, -0.0023855572, 0.0218015406, 0.2537812591, 0.229823947, -0.0625416785, 0.6077544689, -0.2886663973, -0.0139999408, -0.086064443, 0.3429327607, -0.2048237771, 0.1122023165, 0.1519572437, 0.1797052473, 0.0378548428, -0.1501205266, 0.0580248162, -0.3018404841, -0.1762670875, 0.1387174875, 0.0194341168, 0.1557266712, 0.0683936402, -0.2810460925, 0.0348384455, -0.125488013, 0.1631981581, 0.0618572682, 0.189533174, 0.4650208056, 0.2440119088, 0.1847269684, -0.2461517602, 0.1380323172, -0.1916905642, -0.0349150896, -0.0188469552, 0.049347654, -0.1243448555, -0.2026324123, -0.1169789732, -0.0052629113, 0.1201918349, -0.1395371854, -0.1064236164, 0.1043248773, 0.4723399282, -0.2647074163, -0.0682185367, 0.2373574078, -0.0518936813, 0.2495448291, 0.4482098222, 0.178488344, -0.1083475649, 0.1239553392, -0.2226429135, -0.1907119006, 0.1714607477, 0.4320272207, -0.1884322912, 0.2997784615, 0.4383261502, -0.2500913739, 0.0253663436, -0.5639305711, 0.1725798994, 0.3753861785, -0.1560506523, 0.0294166524, 0.2055679113, -0.1107946634, -0.0382425934, -0.0020995834, -0.2823621631, 0.1047881842, -0.0546162613, -0.1241025925, 0.0581855625, -0.2883281708, -0.3489441872, -0.0700915009, -0.0738778263, -0.0301888287, 0.0473893844, 0.364328742, -0.0386858322, -0.1570384055, 0.0421865135, 0.1285608411, 0.0572404787, -0.192287907, -0.2062017471, 0.0678522587, -0.0501701385, -0.160856083, 0.0136614898, -0.1735759079, -0.1209882498, 0.3514299095, 0.0343762934, -0.0936689824, 0.1517289281, 0.0024561416, -0.1705126911, -0.0356273986, 0.3725079298, 0.1863264889, -0.0454807356, 0.0694923699, 0.1436003298, 0.0203579627, 0.0109443255, -0.3813977838, 0.3755219579, -0.1406776756, -0.1401247084, -0.101474911, 0.3969979286, 0.1822823286, 0.3812868297, 0.2599553168, 0.1357993335, -0.1200287938, -0.1728626192, 0.2138909847, 0.0051503666, -0.224353835, 0.5801810026, -0.1053803116, 0.1787990332, -0.1761499643, -0.0352077112, -0.5936297774, 0.0816387236, 0.1742515415, -0.2596289515, 0.1341775358, -0.20410043, 0.0519879535, 0.187639758, 0.3666481078, -0.1925257444, 0.5568442941, -0.2496999204, -0.0354933441, -0.2386243939, 0.0994288474, -0.1303416789, 0.0004954264, -0.202493757, 0.2077074945, 0.3562862277, 0.3590290546, 0.1907353401, -0.2272046804, 0.0411613733, 0.3413910568, -0.2184959054, -0.0689908713, -0.4191856682, 0.5319705606, -0.1182232276, -0.2942886949, 0.2460459322, -0.0494289845, -0.0780365169, -0.0757018253, -0.0791643709, 0.3901769519, 0.2521810234, 0.1452970803, 0.2444940507, 0.1770257056, -0.2114204466, 0.3767089844, -0.0797890723, 0.0217253156, -0.4029795527, 0.266086489, 0.2743576765, 0.0599224567, -0.4111657143, -0.291921556, -0.1245205998, 0.321674794, 0.0148347616, -0.1471541375, 0.1995238662, 0.0352680981, 0.493817389, -0.0977454334, 0.3207583427, 0.5601396561, 0.047207389, -0.1317709982, -0.3974681497, -0.0904373154, 0.1011983305, -0.1274485588, -0.2460401654, 0.1740923673, -0.0403297096, 0.0771201551, 0.2812561989, -0.3595993519, 0.0837734491, 0.3247871995, -0.1062040925, 0.0207078084, 0.2874740064, 0.3893787861, -0.1031332836, -0.2875151336, 0.3336117268, 0.1676431298, -0.0421696827, -0.2051714957, -0.2213900238 ]
https://github.com/huggingface/datasets/issues/2132
TydiQA dataset is mixed and is not split per language
Hi thank you very much for the great response, this will be really wonderful to have one configuration per language, as one need the dataset in majority of case per language for cross-lingual evaluations. This becomes also then more close to TFDS format, which is separated per language https://www.tensorflow.org/datasets/catalog/tydi_qa which will be really awesome to have. thanks On Mon, Mar 29, 2021 at 6:17 PM Quentin Lhoest ***@***.***> wrote: > You can filter the languages this way: > > tydiqa_en = tydiqa_dataset.filter(lambda x: x["language"] == "english") > > Otherwise maybe we can have one configuration per language ? > What do you think of this for example ? > > load_dataset("tydiqa", "primary_task.en") > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2132#issuecomment-809516799>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AS37NMXPW2PWSQ2RHG73O7TTGCY4LANCNFSM4Z7ER7IA> > . >
Hi @lhoestq Currently TydiQA is mixed and user can only access the whole training set of all languages: https://www.tensorflow.org/datasets/catalog/tydi_qa for using this dataset, one need to train/evaluate in each separate language, and having them mixed, makes it hard to use this dataset. This is much convenient for user to have them split and I appreciate your help on this. Meanwhile, till hopefully this is split per language, I greatly appreciate telling me how I can preprocess and get data per language. thanks a lot
145
TydiQA dataset is mixed and is not split per language Hi @lhoestq Currently TydiQA is mixed and user can only access the whole training set of all languages: https://www.tensorflow.org/datasets/catalog/tydi_qa for using this dataset, one need to train/evaluate in each separate language, and having them mixed, makes it hard to use this dataset. This is much convenient for user to have them split and I appreciate your help on this. Meanwhile, till hopefully this is split per language, I greatly appreciate telling me how I can preprocess and get data per language. thanks a lot Hi thank you very much for the great response, this will be really wonderful to have one configuration per language, as one need the dataset in majority of case per language for cross-lingual evaluations. This becomes also then more close to TFDS format, which is separated per language https://www.tensorflow.org/datasets/catalog/tydi_qa which will be really awesome to have. thanks On Mon, Mar 29, 2021 at 6:17 PM Quentin Lhoest ***@***.***> wrote: > You can filter the languages this way: > > tydiqa_en = tydiqa_dataset.filter(lambda x: x["language"] == "english") > > Otherwise maybe we can have one configuration per language ? > What do you think of this for example ? > > load_dataset("tydiqa", "primary_task.en") > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/huggingface/datasets/issues/2132#issuecomment-809516799>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AS37NMXPW2PWSQ2RHG73O7TTGCY4LANCNFSM4Z7ER7IA> > . >
[ -0.3552144766, -0.2323042154, -0.1865597665, 0.2470623106, 0.3051549196, -0.0820615441, 0.3825843334, 0.3362081051, -0.1914513111, 0.1315777749, -0.4605717957, -0.0628385544, 0.0637700185, 0.4531882405, 0.0351661667, -0.2893120646, -0.1692790389, 0.0985133424, -0.2443104982, 0.0038087592, 0.1467834413, 0.2375837862, -0.1056778207, 0.0857929289, 0.053536769, -0.2327952087, -0.0800038576, -0.0570414662, 0.0407803804, -0.086775437, 0.4129011929, 0.2202056795, 0.2382609248, 0.3516652882, -0.000102664, 0.2214548886, -0.0919179767, -0.2966125906, 0.0862297565, -0.1834036112, -0.1013009623, -0.2273289114, -0.1310020387, -0.1961813867, -0.5325120091, -0.1905820966, -0.0044926256, -0.3459677696, 0.3396967053, 0.2731973529, 0.1980175525, 0.2754569054, -0.1090013757, 0.1592267454, -0.0758002698, 0.0541527756, -0.150602594, -0.0746901184, 0.4563406408, -0.0522280671, 0.1966007203, 0.2734508514, 0.2479816377, 0.0726509765, -0.3480711579, 0.0870821625, -0.0185379274, -0.4929693937, 0.0308899134, 0.6588576436, 0.4845637977, -0.0275690481, -0.3650478125, -0.1043432802, -0.1176580563, -0.2458568215, 0.1216570586, 0.2802474201, -0.1396412551, 0.3281912208, 0.3242914975, 0.1832719147, -0.2296533883, 0.1559879333, -0.3659548759, 0.2008362412, -0.0907996669, -0.0041712038, 0.0995028466, -0.1770901084, 0.0782894343, 0.2008455992, 0.0825701505, 0.1947048604, -0.5239601135, -0.3435084224, 0.0030070227, -0.4299472272, 0.0216335729, -0.3731373847, 0.1823283285, 0.3100454211, -0.2238857448, -0.0205532536, 0.1694970429, 0.0432292074, 0.3170822859, 0.296672225, 0.1683046818, -0.0715255961, 0.1160189509, 0.0968126208, -0.1079169586, -0.2469828278, -0.5589662194, 0.1996994019, 0.0861090571, 0.0617254004, -0.2949923277, -0.2625297904, -0.0720702931, -0.194529146, 0.1462905854, 0.3152509928, -0.0117468834, -0.0516727567, 0.0411452502, 0.3388171792, -0.3357955515, -0.3760808706, -0.2025689781, 0.0154270157, -0.0782456547, -0.1298013628, 0.0722823143, 0.1535936743, -0.029724028, 0.0980605632, -0.0132702701, -0.0353596322, 0.2344278097, -0.193799898, 0.1276610792, 0.0803778321, 0.1863419712, 0.0069220811, 0.1699037254, -0.3082531989, -0.2829094529, -0.0149561726, -0.1393334717, -0.1989014149, -0.008901136, 0.2219690681, 0.1782560647, 0.1121168658, 0.0467120409, 0.8153550029, 0.2904577553, 0.0116437227, -0.0301057175, 0.0303067379, -0.338544786, -0.0141155459, 0.3378119171, 0.1740821451, -0.6436671615, -0.0770444572, 0.3162023425, -0.3413241804, 0.1643741727, 0.2579714954, -0.184535563, 0.2711562514, 0.0388608128, 0.0341989547, 0.5991302133, -0.1869714111, -0.3114598691, 0.0683095381, 0.067710191, 0.0123746023, 0.0292676892, -0.0617262349, 0.2344319224, -0.0872586519, 0.0991233885, 0.4348347783, -0.2404679656, 0.0294941142, -0.0098549351, -0.1206749901, 0.2951942682, 0.353076607, -0.1855426133, -0.2928940356, 0.062475659, 0.2671692073, 0.328212589, -0.2255352885, 0.0736840963, 0.1006434336, -0.267234534, 0.0892196372, 0.0731188208, -0.2335537672, -0.3995295167, 0.2664975524, -0.3235735297, 0.2553371787, 0.0927841142, -0.21691598, 0.1256579757, -0.2715000212, -0.1884756982, -0.2257439792, 0.2386911362, -0.015327733, 0.0980970562, 0.1489165425, -0.1053276211, -0.0331546739, -0.2175193578, -0.1276915669, -0.2352514565, -0.004217796, 0.011516463, -0.0245701242, 0.0336271524, 0.2056085169, -0.1945265532, -0.2773687243, -0.0686695278, -0.055468332, 0.0843354315, 0.1762464046, -0.1867502332, -0.0557048917, 0.3607554436, -0.0796795189, -0.1604561061, 0.0065564141, -0.043949414, -0.1347127408, -0.0142060816, 0.5713963509, -0.0082731098, 0.1534336805, 0.1384379268, -0.1114002615, 0.4390421212, -0.2118982673, -0.0669084489, -0.3066835403, 0.3075169623, -0.2405389249, -0.0250525102, -0.0206582528, -0.4667214155, 0.2938874364, 0.5241797566, 0.1195418015, 0.2275013626, 0.0260460153, 0.3398803174, 0.190987587, -0.0613887757, 0.2351475209, 0.1668777168, 0.1093577594, 0.3604391217, -0.2116723061, 0.3253705204, -0.1727222502, 0.0418736488, -0.228251189, -0.0006562993, 0.1424651891, 0.0121852756, -0.0922972783, -0.1998013854, 0.181636408, 0.1531483829, 0.1381653249, 0.013818793, 0.1529120207, -0.5816360712, -0.3761357069, -0.2104388475, -0.2378635854, 0.0063174702, 0.2482801229, 0.2964660227, -0.3051170707, -0.1677925289, 0.3162820339, 0.3392685056, 0.0744114369, -0.175060451, -0.0538643599, -0.0718544573, -0.1794320643, -0.2444065064, 0.2388398647, 0.3472925425, -0.0135218278, 0.3145672977, -0.3366046846, -0.2414298356, 0.0362311006, -0.3904020488, 0.1810482889, -0.2720424831, 0.0022114441, -0.1468354911, 0.1355133951, -0.0168849975, -0.1380898058, 0.273502171, 0.1713929474, -0.2211098969, 0.0685840845, -0.0055792145, 0.1013223901, -0.1264633685, -0.6710656285, -0.5951109529, -0.2512131333, -0.1333305538, -0.2451850027, 0.3593440056, -0.2196391821, 0.0570239462, -0.0083576292, 0.0164691806, 0.1544210613, -0.0893200785, -0.1075415462, 0.1558359712, -0.3837586939, -0.3826019168, -0.1815673113, -0.0794026852, 0.602825284, -0.0109305866, -0.1639608592, 0.1444202513, -0.2179676592, 0.0313018709, -0.135993436, -0.0464088432, 0.3886907697, -0.152351141, 0.0700263232, -0.0642267019, 0.2101171017, 0.2466242164, -0.1676121205, 0.1926051974, 0.021330595, 0.3507077694, 0.2853187919, 0.6870271564, 0.2225360423, -0.0186999775, 0.2611912191, 0.0376181826, -0.0973072946, -0.1640942991, -0.3305536509, 0.1045777202, 0.2790668905, 0.2494918853, 0.3200264871, 0.0075698085, -0.4194734395, -0.3046821952, -0.0682017058, -0.2497382164, -0.4224905968, 0.2797597945, -0.1485925615, 0.2589623034, -0.080786407, -0.1201805025, 0.0658529401, 0.0611246265, -0.1272090375, 0.2753647566, -0.2356356531, 0.1366681457, -0.1638369262, -0.2549642324, -0.2577463388, 0.2432105988, 0.1393214464, 0.1295707375, -0.4074017406, -0.0348054543, 0.2553428411, 0.0101977736, 0.4792658985, -0.0116426954, 0.0334230661, -0.0568103381, -0.2497849017, -0.0475510284, 0.051802434, -0.243752867, -0.2110764384, 0.2786965668, 0.0483307764, -0.4830058813, -0.4004107118, -0.1896267831, 0.2210506052, -0.3180154264, 0.1045718938, -0.1502373815, -0.4936717451, -0.1855925769, 0.2497284412, 0.1380712092, 0.0737951398, 0.1140900552, -0.3469451666, -0.0948420763, 0.0271495134, 0.0746501088, 0.3943496346, 0.0387785994, 0.0003898367, 0.1479100287, -0.0242579058, -0.3104054332, 0.3375666738, 0.4441432655, -0.0714128166, -0.4775905311, 0.0689732656, -0.2635335028, 0.225796923, 0.2028360069, -0.0787841082, 0.0508451089, -0.139434427, -0.0164052248, -0.22628133, 0.266433239, 0.4254594743, 0.2397476733, -0.4981901348, -0.3799901605, 0.1270402223, -0.1661977172, -0.0188150182, 0.4364909232, 0.223626554, -0.3434130549, 0.3876724839, 0.1485224664, 0.7250759602, -0.2446471304, 0.1286920607, 0.1899482906, 0.1315007657, 0.2746505737, -0.1346436739, -0.0511469431, -0.0727816373, -0.0371354818, -0.0880493298, 0.1354050636, 0.1841683835, 0.3696352839, -0.2419298887, -0.0197661798, -0.0026527643, -0.368293941, 0.0759805068, 0.2364655733, -0.1546996832, -0.240604341, -0.2274138927, 0.1521265954, -0.1377997845, 0.1421947777, -0.0244999975, -0.1441589296, 0.0232243016, 0.0637228787, -0.1509366482, -0.0486019924, -0.4481599331, -0.0678943694, -0.0977500677, -0.5241669416, 0.4261680245, 0.4877758026, 0.3539225459, 0.1410792172, -0.0583282113, 0.2123112082, 0.0495106317, 0.1084084064, -0.0114251077, -0.2722730041, 0.2864253223, -0.1215185523, -0.2456295937, -0.0700946301, 0.2272702456, 0.1699276716, -0.0587957501, 0.1454827189, 0.0873054266, -0.1410284936, -0.0046754368, 0.1079625636, 0.1413409859, -0.0187478364, 0.2128382921, 0.1345558167, -0.1931188554, 0.0653738678, -0.128415972, -0.1850832999, -0.0785555094, -0.281427592, 0.3756262362, 0.2322547436, 0.3384275734, 0.3050633669, -0.065804787, -0.1704978347, 0.301807344, 0.0218591653, -0.2949539423, -0.0365006626, 0.281005919, 0.0227464586, -0.0240748338, 0.3036062419, -0.2841656208, -0.0699390024, -0.0845456868, -0.292684257, 0.0099825114, 0.0420371369, -0.1245800927, 0.1054037586, 0.2771075964, 0.339100033, -0.1311745942, 0.5737304688, -0.3698701859, 0.0058859214, -0.0565498881, 0.2760067284, -0.1036488414, 0.0499209166, 0.241343528, 0.1679943353, 0.0667530075, -0.0381923914, -0.0351048782, -0.3488067985, -0.1829792261, 0.1007537171, 0.0071056262, 0.1759006679, 0.131399408, -0.1661434621, -0.0925511718, -0.1509745568, 0.2855467796, -0.0105732977, 0.1109220684, 0.4425671399, 0.1738984585, 0.1973272115, -0.137054801, 0.0630761087, -0.0370740145, -0.0110821053, -0.0142127313, 0.0821500719, -0.1756983697, -0.2209683955, -0.0653032809, 0.0966947526, 0.125573948, -0.1968713552, -0.1459976584, 0.1183368489, 0.3806867003, -0.1864888966, 0.0730318576, 0.0195797831, -0.073609516, 0.1659244448, 0.3901279271, 0.2354632318, -0.0950925425, 0.0966483653, -0.1705889106, -0.1390215307, 0.2327311188, 0.4411736131, -0.1391787827, 0.2975330949, 0.5234045386, -0.2016007304, 0.0235444829, -0.5701321363, 0.1358398944, 0.3579997122, -0.2482925504, 0.0147584137, 0.2565579712, -0.1580222249, 0.0489178374, -0.0746175349, -0.3017633855, 0.0902374163, -0.1508257836, -0.0031720363, 0.1290085614, -0.4052058756, -0.3348172307, -0.0826363415, -0.1171634346, -0.0509095974, 0.0296202935, 0.3479801714, -0.0709964782, -0.1315672994, 0.0349302441, 0.1996857822, -0.0084866779, -0.1756475568, -0.2219953686, 0.0693950206, -0.0239415169, -0.0740996227, -0.0412874706, -0.1026532948, -0.0720539242, 0.2207167894, -0.047566995, -0.1042256579, 0.0458892994, -0.0511511527, -0.135699302, 0.0019163191, 0.4835406244, 0.2026076913, -0.0861566812, -0.0192562453, 0.2933410704, 0.0328772627, -0.1085206419, -0.2172899544, 0.3303788602, -0.2242422998, -0.0797753632, -0.0526932701, 0.4048781395, 0.1722879857, 0.2607539892, 0.2372876257, 0.1530281156, -0.1554991007, -0.1858927608, 0.1608019471, 0.0239325166, -0.1835128665, 0.4393492937, -0.0966397822, 0.3170115352, -0.2066837549, -0.055437468, -0.5749290586, 0.1027131677, 0.1962309033, -0.2680194974, 0.1372487843, -0.1810087264, 0.1022188067, 0.0909453481, 0.4181431532, -0.1886613667, 0.3962571025, -0.1188274622, -0.0018161535, -0.1924291253, 0.1012448892, -0.0004209988, 0.1354099065, -0.229012087, 0.2973605394, 0.4049988985, 0.3552606404, 0.1729695201, -0.2654718459, 0.0930188522, 0.2175479084, -0.2079218328, 0.0469515026, -0.4969525933, 0.4309391081, -0.0962752327, -0.2155317664, 0.2567343712, -0.0382615253, -0.040800266, -0.0768254325, 0.040742889, 0.3610335886, 0.079158932, 0.009105444, 0.2970996499, 0.1525091827, -0.1799488068, 0.3189998567, -0.0694287568, -0.0266429484, -0.5007229447, 0.2509753704, 0.2622112036, 0.1316748261, -0.3571839929, -0.3711138964, -0.1261774153, 0.3362699747, 0.0409441292, -0.1161232591, 0.2225251794, 0.0758976564, 0.4533269405, -0.1562905759, 0.3627396822, 0.6081725359, 0.0636256486, -0.1379098594, -0.3992079496, -0.2314002216, 0.1343286484, -0.1640172303, -0.183318615, 0.2519250512, -0.0357958227, 0.1729254723, 0.1860668808, -0.4305517077, 0.1040733308, 0.2373619676, -0.1121481061, -0.0187771209, 0.3154480457, 0.2885212302, -0.0782673955, -0.2783443928, 0.2762379348, 0.2643616199, -0.0876060575, -0.1760578603, -0.2279144228 ]
https://github.com/huggingface/datasets/issues/2131
When training with Multi-Node Multi-GPU the worker 2 has TypeError: 'NoneType' object
Hi ! Thanks for reporting I was able to reproduce this issue. This was caused by missing split infos if a worker reloads the cache of the other worker. I just opened https://github.com/huggingface/datasets/pull/2137 to fix this issue
version: 1.5.0 met a very strange error, I am training large scale language model, and need train on 2 machines(workers). And sometimes I will get this error `TypeError: 'NoneType' object is not iterable` This is traceback ``` 71 |   | Traceback (most recent call last): -- | -- | -- 72 |   | File "run_gpt.py", line 316, in <module> 73 |   | main() 74 |   | File "run_gpt.py", line 222, in main 75 |   | delimiter="\t", column_names=["input_ids", "attention_mask", "chinese_ref"]) 76 |   | File "/data/miniconda3/lib/python3.7/site-packages/datasets/load.py", line 747, in load_dataset 77 |   | use_auth_token=use_auth_token, 78 |   | File "/data/miniconda3/lib/python3.7/site-packages/datasets/builder.py", line 513, in download_and_prepare 79 |   | self.download_post_processing_resources(dl_manager) 80 |   | File "/data/miniconda3/lib/python3.7/site-packages/datasets/builder.py", line 673, in download_post_processing_resources 81 |   | for split in self.info.splits: 82 |   | TypeError: 'NoneType' object is not iterable 83 |   | WARNING:datasets.builder:Reusing dataset csv (/usr/local/app/.cache/huggingface/datasets/csv/default-1c257ebd48e225e7/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2) 84 |   | Traceback (most recent call last): 85 |   | File "/data/miniconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main 86 |   | "__main__", mod_spec) 87 |   | File "/data/miniconda3/lib/python3.7/runpy.py", line 85, in _run_code 88 |   | exec(code, run_globals) 89 |   | File "/data/miniconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 340, in <module> 90 |   | main() 91 |   | File "/data/miniconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 326, in main 92 |   | sigkill_handler(signal.SIGTERM, None) # not coming back 93 |   | File "/data/miniconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 301, in sigkill_handler 94 |   | raise subprocess.CalledProcessError(returncode=last_return_code, cmd=cmd) ``` On worker 1 it loads the dataset well, however on worker 2 will get this error. And I will meet this error from time to time, sometimes it just goes well.
37
When training with Multi-Node Multi-GPU the worker 2 has TypeError: 'NoneType' object version: 1.5.0 met a very strange error, I am training large scale language model, and need train on 2 machines(workers). And sometimes I will get this error `TypeError: 'NoneType' object is not iterable` This is traceback ``` 71 |   | Traceback (most recent call last): -- | -- | -- 72 |   | File "run_gpt.py", line 316, in <module> 73 |   | main() 74 |   | File "run_gpt.py", line 222, in main 75 |   | delimiter="\t", column_names=["input_ids", "attention_mask", "chinese_ref"]) 76 |   | File "/data/miniconda3/lib/python3.7/site-packages/datasets/load.py", line 747, in load_dataset 77 |   | use_auth_token=use_auth_token, 78 |   | File "/data/miniconda3/lib/python3.7/site-packages/datasets/builder.py", line 513, in download_and_prepare 79 |   | self.download_post_processing_resources(dl_manager) 80 |   | File "/data/miniconda3/lib/python3.7/site-packages/datasets/builder.py", line 673, in download_post_processing_resources 81 |   | for split in self.info.splits: 82 |   | TypeError: 'NoneType' object is not iterable 83 |   | WARNING:datasets.builder:Reusing dataset csv (/usr/local/app/.cache/huggingface/datasets/csv/default-1c257ebd48e225e7/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2) 84 |   | Traceback (most recent call last): 85 |   | File "/data/miniconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main 86 |   | "__main__", mod_spec) 87 |   | File "/data/miniconda3/lib/python3.7/runpy.py", line 85, in _run_code 88 |   | exec(code, run_globals) 89 |   | File "/data/miniconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 340, in <module> 90 |   | main() 91 |   | File "/data/miniconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 326, in main 92 |   | sigkill_handler(signal.SIGTERM, None) # not coming back 93 |   | File "/data/miniconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 301, in sigkill_handler 94 |   | raise subprocess.CalledProcessError(returncode=last_return_code, cmd=cmd) ``` On worker 1 it loads the dataset well, however on worker 2 will get this error. And I will meet this error from time to time, sometimes it just goes well. Hi ! Thanks for reporting I was able to reproduce this issue. This was caused by missing split infos if a worker reloads the cache of the other worker. I just opened https://github.com/huggingface/datasets/pull/2137 to fix this issue
[ -0.1806097776, -0.446809113, 0.0129235722, 0.5495144725, 0.1124854833, -0.0091342479, 0.5815145373, 0.2967014313, 0.1129246205, 0.2367110103, 0.338028729, 0.0173760988, -0.1162158772, 0.1675732285, -0.0424103551, -0.2821590304, -0.1764216572, 0.0434677973, -0.2278057337, -0.2145928293, -0.3433730602, 0.1396663934, -0.1313171089, 0.1889917701, -0.5063362718, -0.4234542847, -0.1063824967, -0.0327258371, 0.2665304244, -0.2152223736, 0.2046151161, -0.3352000117, 0.1856165528, 0.8994954824, -0.0001186402, 0.14836061, 0.1208231002, 0.0624537617, -0.1442177147, -0.4792485237, 0.0836347491, -0.3793367445, 0.0438948199, -0.3725202084, -0.1640228927, -0.1153092012, 0.2508280575, 0.0683691055, 0.0381291211, 0.2097055018, 0.1652571261, 0.3379756808, 0.1185290813, -0.0910868645, -0.1230917871, -0.0781750977, -0.1245810241, -0.0570692457, -0.1463323832, 0.2151982188, 0.1408525407, 0.3001520336, 0.0600434542, 0.0522122271, -0.094740212, -0.0429645292, 0.5682380795, -0.4400094748, 0.0403895006, 0.3434170187, 0.0855884254, 0.0078649633, -0.2014047801, -0.1323601454, 0.1542742252, -0.118224144, 0.184736982, 0.3629117012, -0.0531052314, 0.1500603259, -0.1300463378, -0.0676268563, -0.2308020294, 0.053400252, -0.1115094349, 0.0901559293, -0.1316497177, 0.4046879411, 0.1569738984, 0.0425378382, 0.1446682513, -0.1151815355, 0.1561762393, 0.0373051949, -0.4768409729, -0.266748786, 0.0841665268, -0.1505965889, -0.1545932442, -0.1207948774, 0.121186614, -0.1792516559, -0.1328289062, 0.3402725756, 0.2215325981, -0.2089684755, -0.028037183, 0.0667776987, 0.1572732627, -0.1440429389, -0.3448978961, 0.0656589717, -0.123423472, -0.3975608945, 0.067215845, 0.3313919902, 0.550983727, 0.0814335495, -0.2558074594, -0.3254729211, -0.4844893813, 0.0634809732, 0.159197703, 0.0716000646, -0.0215618592, 0.7668602467, -0.1380040944, 0.1425333321, -0.2015485764, -0.4433030486, -0.1509105563, 0.2117181569, -0.2316480875, 0.0988812149, -0.0608810633, 0.0209043846, -0.0537673496, 0.0669299364, 0.006623826, -0.0675474256, 0.254997462, -0.6412527561, 0.0265089776, 0.2047789246, 0.1866107583, 0.1211188808, 0.1911760271, -0.0848487839, -0.1786594391, 0.0570019819, -0.4990593493, -0.2644452453, -0.0435093455, 0.0713153407, 0.1389941126, 0.2218962163, 0.0635316744, 0.1517142206, 0.5338411927, -0.0446070619, 0.041408699, -0.3242379427, -0.3369703591, -0.3063196242, -0.3215334713, 0.4540398419, 0.085360527, -0.0651731417, 0.2063798904, -0.0580660589, 0.3713686466, 0.4545203149, 0.000599023, 0.0837390795, -0.1234111637, 0.0138954222, 0.2660520673, -0.2399115711, 0.0215654187, 0.4763098359, -0.4028790891, 0.0788716152, 0.3922179341, -0.0496556759, -0.2771500647, -0.0372725241, 0.1895171851, 0.342394799, -0.0628309697, 0.0093410462, -0.2271401286, -0.0792753547, 0.4815941453, -0.1569288224, 0.3270477653, 0.0703965053, -0.0276758708, -0.1134375185, 0.2275327444, -0.3470683098, -0.0631327927, 0.1020134836, 0.2154048383, -0.1462944001, 0.0686945841, -0.1687207669, -0.2463457435, 0.0542072654, -0.1364751458, 0.1516543925, 0.2225853354, -0.0803483501, 0.2349832356, -0.2266498804, -0.2233914733, 0.0553603843, 0.0752303451, 0.3720036447, -0.2636726201, 0.1632024497, 0.024580285, 0.0021452755, -0.3904487491, -0.275941968, -0.1010343656, 0.2078494579, -0.0291657262, -0.1070367396, -0.0839112103, 0.2642503679, 0.4416564703, -0.2129091173, 0.2406531274, 0.1404101402, -0.1080906391, 0.049444396, -0.0524044782, 0.1803084463, 0.3580480516, -0.1872617602, -0.1409418434, 0.2008782327, 0.1346989721, -0.1484240592, 0.3699091077, 0.4953469634, 0.090521127, 0.2097526044, 0.0449274257, 0.0786123723, 0.1215228066, 0.0240476802, -0.0164275989, 0.082793951, 0.0056438674, 0.1275953203, -0.1125178263, 0.0920486227, -0.647639811, 0.0956627876, 0.8060963154, 0.1173808277, 0.4062262475, 0.008644498, 0.1291958988, 0.0277585685, -0.154480949, -0.0285172462, 0.4229156375, -0.0422856994, 0.246556282, -0.0392973572, -0.0626193136, -0.1413777471, 0.0522280782, -0.1825523078, 0.716627121, 0.2830471694, 0.1327202618, -0.0022641215, -0.0056483969, -0.2538820505, 0.2736295164, 0.45052737, -0.3334291875, 0.350201875, -0.3673315048, -0.0159904137, -0.2581935227, 0.2661484182, -0.0938294902, -0.0245774053, -0.2472629249, 0.186403662, 0.1503833532, 0.1223213971, 0.3589177132, 0.1457661986, 0.107199274, 0.2317181826, 0.2299323082, 0.011164736, -0.2177335769, -0.0725531802, 0.2922360599, -0.3358944654, 0.0090650544, -0.122659713, -0.5176736712, -0.3514279127, -0.0638253614, 0.0656745136, 0.0135682803, 0.0029364936, 0.2864253819, 0.078525871, -0.012097232, -0.0619987547, 0.1552057415, -0.4553329647, -0.1128281355, 0.2476544678, -0.3855647743, 0.1096367761, -0.1286383122, -0.2845996916, -0.2985164523, -0.1682437658, 0.6335544586, 0.0361017212, 0.4326663613, 0.1627976894, 0.1140319407, 0.1608605087, 0.1367162466, 0.0956067517, -0.1563304365, -0.4536631703, 0.1469084322, 0.0463186316, -0.2639674544, -0.0813129619, 0.0779388845, 0.3259365559, 0.1940155029, -0.3016441464, -0.2473766953, 0.0698909014, -0.0073890463, -0.0802940875, 0.0436057001, 0.3106850684, -0.081747584, -0.0795651525, 0.104936868, 0.1663472056, 0.1308561265, 0.2061454505, 0.2597745061, 0.2158595622, 0.2530965209, 0.2540293932, 0.5351134539, 0.2206321061, -0.067446053, 0.2258818746, -0.152295351, -0.0044799019, 0.1564435363, -0.3594616354, 0.1473370343, -0.2330270112, -0.1332303584, -0.0466541797, -0.4417171776, -0.5093240738, -0.1664880216, -0.1738310009, -0.3591650128, -0.1715166867, 0.229011476, -0.2058071941, 0.3189737797, -0.2008251846, -0.0663316846, -0.2482413054, 0.0208233371, -0.0461253524, 0.2327268571, -0.0202388354, -0.0802518725, -0.4130922854, -0.565793097, -0.044171378, 0.2615537047, 0.0113743991, 0.440189898, -0.1060477868, 0.019314073, 0.1748597175, -0.0069009773, 0.8240171075, -0.2342890501, 0.0243169107, 0.2899027467, -0.5752906799, -0.0847983062, -0.0399574563, -0.2760020196, 0.4216435552, 0.502240777, 0.3049762845, -0.1920863837, -0.3170816898, 0.2327644527, -0.1730203629, -0.1513352394, -0.0994564146, -0.2681993246, -0.1267524064, 0.0031303689, 0.0991748273, 0.0423638076, 0.4196648598, -0.4223136902, -0.0110671744, -0.3594003916, 0.1035603434, 0.099243395, 0.0183775723, -0.0220205002, -0.0157829151, -0.2933521867, 0.0666066632, 0.4181611836, 0.3456066549, 0.1352542341, 0.1237928122, -0.2220496684, 0.386636287, -0.2193983197, 0.3998538256, 0.4414468408, -0.068904765, 0.2593990862, 0.0464293547, 0.3088766634, 0.0099544041, -0.2134134024, 0.5013943315, 0.0964827761, -0.3567270637, -0.4405713677, 0.2417841554, 0.2308718264, 0.1443295181, 0.0753161162, -0.3131644726, -0.0920785815, -0.0364315212, -0.0348869748, 0.8628462553, 0.1303192675, 0.1319113374, 0.2637450993, 0.0648117512, 0.7199363112, -0.4422342777, 0.3917687833, -0.2568789721, -0.1663821042, -0.1640913188, -0.0817656815, 0.3914419115, 0.2064571977, -0.2381403148, 0.3658709824, -0.1030775309, -0.1616388708, -0.1580768526, 0.1148330718, -0.2505121231, -0.0613887236, -0.1496536434, -0.049614381, 0.0577674173, 0.1704435647, -0.1470059156, -0.3725345731, 0.3594640791, -0.0050595775, -0.219594717, -0.0886682868, -0.3248026967, 0.2875600755, 0.412496537, -0.4293585718, 0.2377709895, 0.2076028734, 0.3087038398, -0.2606231868, -0.1220988333, -0.2071403712, -0.2024773955, -0.0072195642, -0.2808030248, -0.1926895678, 0.534776628, -0.101408802, -0.5287345648, 0.2500189841, -0.0031344816, -0.0043284222, 0.0241578221, 0.0992155522, -0.4970462024, 0.2518160343, -0.0458345935, 0.1943406761, -0.1678855419, -0.2178985775, 0.0715452731, -0.0830304474, -0.6331079602, -0.0050319396, -0.0159769617, -0.4066502452, 0.1884666979, 0.3562636375, 0.566185534, 0.4459784329, 0.4622503817, 0.3645577431, -0.0835474581, -0.3533835411, 0.2155155241, 0.3437521458, -0.3580480218, 0.2269234657, -0.013458211, 0.054598704, 0.033312697, 0.1038377136, 0.0438439809, 0.5941751003, -0.1677765846, -0.2888615131, 0.1138360873, -0.1244139522, -0.2211532295, -0.191472441, 0.0318115354, 0.4678595364, 0.3696140945, 0.1560432315, -0.2256107181, 0.1832113266, -0.6862769723, 0.1564277112, -0.2976361513, -0.1875290424, 0.0351735167, 0.2281865031, 0.0112760887, 0.0311038494, -0.0151208043, -0.1135716289, -0.1084551364, 0.1914587617, 0.0762738585, 0.207723856, 0.2191422731, 0.0013005957, -0.2629856169, 0.0861247778, 0.1031457558, 0.0263840407, -0.0127821863, 0.3347824216, -0.1318497211, 0.1470618844, -0.0516890213, 0.016081702, -0.1663553268, -0.0264432281, 0.0684206858, 0.2599077523, 0.2681326866, 0.1051005274, -0.2012487352, -0.0905272216, -0.1690202057, 0.1310453862, -0.0031563919, -0.3379542232, -0.153752625, -0.0610400662, -0.1287469566, 0.0786520839, -0.2081066072, 0.1642846167, -0.0082762651, 0.0751905367, -0.1720367968, 0.0160500407, 0.3984801173, 0.0401433595, -0.0545230284, 0.3129580617, 0.1964588314, -0.0147885382, -0.2255488038, 0.0989415795, -0.1798564792, -0.5493918657, 0.1987310797, 0.0789994299, -0.1725548804, 0.1692456901, 0.234023422, 0.1941284537, -0.0107984841, 0.1986321211, 0.1553975344, 0.2505668402, 0.0114462022, 0.0647497326, 0.1874618828, -0.3419454396, -0.1851763725, 0.1027244702, -0.1878151447, -0.0758215487, -0.2439707965, 0.1061947942, -0.3426974714, -0.2329876125, -0.1344068199, 0.1067930683, -0.3716105223, -0.0758962855, -0.4822941422, -0.0338255763, -0.2222222537, -0.0620703809, 0.1131881922, 0.078495875, 0.3637965322, 0.2248342633, -0.1549202204, -0.3011436462, 0.0974637717, 0.1635613889, 0.2713887393, -0.2227357626, 0.0118841939, 0.1044880599, -0.0192576982, -0.2971430719, 0.4542779326, 0.3316580057, 0.3410499096, -0.2278931588, -0.1521064341, 0.1208088398, -0.1401270628, 0.0169087723, -0.0865083784, 0.1232795715, 0.2424122393, 0.2065564841, 0.0007889271, -0.0508253276, 0.3772301078, 0.1411719322, 0.0152804554, -0.3947425783, 0.499774009, -0.3795512319, 0.0404790044, -0.0975970477, 0.3181053102, -0.5076956749, 0.1147273779, 0.6606999636, -0.2035872936, 0.2390408218, 0.0054491721, 0.0247680619, -0.1507305503, 0.4882807732, 0.0556454509, -0.0264798775, -0.2904708982, 0.1216701418, -0.116974093, 0.5847660899, -0.3455075026, 0.2629431188, -0.038188491, 0.6029920578, -0.0786871165, -0.07410229, 0.1273522973, 0.157484889, 0.1948417127, 0.3991424143, -0.4147587717, -0.2249615341, -0.3403021097, -0.1307872236, 0.163324222, -0.3058511615, 0.1660933793, -0.1133300662, 0.016328074, -0.0395119265, 0.0059386343, -0.2246297002, 0.0200875141, 0.2809773386, 0.1872591674, 0.2327944338, 0.0099964589, -0.0424152575, 0.0101230722, -0.1967512369, -0.2997448146, 0.5487578511, 0.0568800606, 0.0997762457, -0.1939614117, 0.2067072392, -0.1505217105, 0.260065347, -0.0193503201, 0.096350491, 0.0100750327, 0.2616028786, -0.0259612873, -0.0744593963, 0.0825504065, 0.0806279182, 0.1278174669, -0.2672432363, -0.1667003185, -0.0958618447, 0.3261495829, -0.3049178421, -0.3767559528, -0.4874203801, 0.3538345397, 0.0580239445, 0.1417585164, -0.478916496, -0.149480477, 0.3774831295, -0.0684733838, -0.3998475969, -0.0441302806, -0.0841490701, -0.1253636181, 0.0760099441, -0.2112777531, -0.1244164258, -0.2668002844, 0.123094961, -0.3076861203 ]
https://github.com/huggingface/datasets/issues/2130
wikiann dataset is missing columns
Here please find TFDS format of this dataset: https://www.tensorflow.org/datasets/catalog/wikiann where there is a span column, this is really necessary to be able to use the data, and I appreciate your help @lhoestq
Hi Wikiann dataset needs to have "spans" columns, which is necessary to be able to use this dataset, but this column is missing from huggingface datasets, could you please have a look? thank you @lhoestq
32
wikiann dataset is missing columns Hi Wikiann dataset needs to have "spans" columns, which is necessary to be able to use this dataset, but this column is missing from huggingface datasets, could you please have a look? thank you @lhoestq Here please find TFDS format of this dataset: https://www.tensorflow.org/datasets/catalog/wikiann where there is a span column, this is really necessary to be able to use the data, and I appreciate your help @lhoestq
[ 0.0038928315, -0.4387933612, -0.094745338, 0.2763383687, 0.3197286129, 0.1833389997, 0.3208169639, 0.0807617307, 0.0531265959, 0.2570091486, 0.010992948, -0.2380870879, 0.0703104064, 0.4205828905, 0.3480721712, -0.8203636408, 0.1133001596, 0.3876082003, -0.2301763743, -0.1201593429, -0.2421351075, 0.3445681632, -0.413723588, -0.1726709008, -0.2490336597, -0.1022258773, -0.1513456106, -0.089681834, -0.0339641795, -0.0308073685, 0.3040223718, -0.2934642136, 0.3014790416, 0.1141970307, -0.0001120765, 0.1079273745, 0.0134251369, -0.1143510789, 0.0769591555, 0.2684707046, -0.030569233, -0.321762979, 0.0123328716, -0.3968161941, -0.3583131731, -0.182705462, -0.1768912673, 0.1160641909, 0.1129550934, 0.2176229805, 0.1882000864, 0.733435452, 0.3261471391, -0.0215927772, 0.0738952681, -0.2582472265, -0.2434682995, -0.3627044559, 0.2368406057, -0.0988851264, 0.2397649884, 0.3428515196, -0.0141156502, -0.1902943701, 0.2873821855, 0.1529559493, -0.2721417546, -0.5023334026, 0.2927864194, 0.7253637314, 0.8114987612, 0.0970161036, 0.1451939642, -0.1972340047, 0.0165989809, 0.0472857207, 0.0804861784, 0.1341170371, -0.0196679048, 0.2952951193, -0.0729853213, -0.0781829283, -0.269476831, 0.2836080194, -0.3395293653, 0.3484336734, -0.0432371944, -0.0545716099, -0.1588186324, -0.011113191, -0.0922964513, 0.173928082, 0.0884338766, 0.1710794419, -0.393989265, -0.2244470865, -0.0804375112, 0.2654077113, 0.1304724216, -0.0493791737, -0.2567351162, -0.263761729, 0.0772434399, -0.0034747319, -0.0845327526, 0.0864011496, -0.0976356789, 0.1400863081, 0.033921618, 0.1944783628, 0.1251027435, -0.1460149884, -0.1888660789, 0.040903043, -0.100160785, -0.2774038017, -0.1225063354, 0.0023715869, 0.1778179854, 0.0947623402, 0.1200574115, 0.0799392313, 0.0292141736, 0.2910703421, -0.0344537012, 0.573372364, -0.0184939653, 0.0801496953, 0.0728819221, -0.1036662161, -0.315101862, 0.1644502133, 0.174606204, 0.0665310845, 0.145810172, -0.2616473436, 0.4494471252, 0.0023811571, -0.1679138243, 0.219025135, -0.0388752744, 0.0814908445, -0.0857504308, 0.5386381745, 0.0207413211, 0.040184021, 0.1553895772, 0.0984408706, -0.0684102178, 0.0521575883, -0.3235920072, -0.0773138553, -0.376929462, 0.1812783033, -0.002947025, -0.3248751163, -0.1078689769, 0.1064672321, 0.0755223185, -0.2321735322, 0.2516079843, -0.036010325, -0.122053735, -0.1593223512, 0.4439873099, -0.0531384498, -0.3692469299, -0.2977437973, 0.2755211592, -0.1768388748, 0.2126061171, 0.3860511184, 0.1058010459, 0.170432359, -0.0902449116, 0.435647577, 0.2490226775, -0.2292728424, -0.2811495662, -0.1234216541, 0.1889756322, 0.1803060025, 0.0494900793, -0.0701635256, 0.3523238599, 0.1053998172, -0.0712122843, 0.2468879223, -0.154971227, 0.0208387971, -0.0559572503, -0.2708708942, 0.1583363116, 0.1909638643, 0.3186044693, 0.119571954, -0.2315594852, 0.141223371, 0.2170292735, -0.3112368882, 0.0945753157, 0.3153344989, 0.1052560359, 0.2595469952, 0.1662835628, -0.162992537, -0.7005298138, 0.1809137613, 0.1923978627, 0.131007731, 0.2885636389, -0.1591425389, -0.0884895548, -0.161485374, -0.1323770583, -0.1435144842, 0.1459514201, -0.1655982733, 0.0570092052, 0.260668695, -0.2820783257, -0.2286589891, -0.3409324884, 0.111445114, -0.170702517, 0.2989848256, -0.008516768, 0.1448131651, 0.0420195162, 0.3530826569, 0.091726169, 0.0065469146, 0.2474444509, 0.033943072, -0.3063536286, 0.1176374257, -0.1642910242, 0.3263199627, 0.2306767404, -0.2691123188, -0.2675726116, -0.1782523394, -0.0008582547, -0.3207312226, -0.0369401127, 0.0625265613, 0.0201673619, 0.2263793796, 0.0898455083, 0.3009008169, 0.0966820493, -0.2566104531, 0.0848555416, -0.2246656865, 0.1342728138, -0.5700143576, 0.238330096, -0.1081246287, -0.5302513838, 0.1398992389, 0.5346273184, -0.1347514391, 0.2633163631, -0.0109230205, -0.3155103624, 0.1827803999, 0.1891463101, -0.0476076342, 0.1203830913, 0.1958455741, 0.2573871613, -0.0189909525, 0.0233981833, -0.200291276, 0.1523868442, -0.1309061348, 0.2438165247, 0.2309397161, -0.0889768153, 0.1434016824, -0.1445160806, 0.3678424358, -0.1947113425, 0.3326026499, -0.1929796934, -0.2458494008, -0.2023403347, -0.2728342116, 0.1774607301, 0.0141588598, -0.0482393503, -0.2429252267, -0.0138838552, -0.0451262705, 0.0773346797, 0.1221309751, -0.1163479984, 0.275680542, -0.0069525987, 0.1026898175, -0.4535598159, -0.0234314129, -0.2051281035, 0.1776484251, 0.0050379299, -0.1009428352, 0.165372014, -0.2824867368, -0.0113937333, -0.4114504457, -0.3987841606, 0.1531443745, -0.2570133507, -0.1782174259, 0.22224769, 0.776081264, -0.1808810234, -0.1068494469, 0.2203477323, -0.3107444644, -0.1329944283, 0.0850411728, -0.2469330877, -0.0271143466, -0.1479101181, -0.0456995852, -0.2469080389, -0.0544397086, 0.0063216817, -0.1434305608, -0.0331373811, 0.0108502023, -0.0731808841, 0.238252461, 0.0096789412, -0.0223691408, -0.1764642894, -0.3380382061, 0.4421733618, -0.1514670402, -0.4279814363, 0.1477314532, -0.133993715, 0.4414246678, 0.1018828154, -0.4725303948, -0.2244142741, -0.0765633136, 0.1601534039, -0.033757098, 0.0460726991, 0.5994673967, -0.290712893, 0.1441125572, -0.3438051343, 0.246512562, -0.1237937659, -0.2274722904, 0.3126410544, -0.1842315346, 0.2806171477, 0.119621627, 0.4372527301, 0.1340359896, 0.2335826308, 0.1642500162, -0.3273265362, 0.3505506516, -0.0554360822, -0.1419947296, 0.3357427716, 0.0569068678, 0.3127405047, 0.3495139778, 0.0804629922, -0.1397723109, -0.189539507, -0.1385487765, -0.3253614306, -0.0360934399, 0.0056715645, 0.3305633664, 0.3602114916, -0.0667296872, 0.1412795037, -0.0958655924, -0.2964456081, 0.1164374948, 0.435115546, 0.1846983433, 0.0768584013, -0.2016158998, 0.0425067842, -0.5353745222, -0.1199574471, -0.0783547759, 0.1430696696, -0.1610946208, 0.2194126099, 0.0153739527, 0.1239081919, 0.5483192801, -0.4586715102, -0.2511319518, -0.1514676213, 0.0694240332, -0.2658081353, 0.1500853598, -0.1759613752, -0.6598412395, 0.0633216947, 0.5552467704, -0.1945564151, -0.0761138797, 0.4672184587, 0.1109072417, -0.2404938638, -0.3276112676, -0.217573911, -0.5198202133, -0.0598059371, -0.2966895103, 0.2284465879, 0.1514731348, 0.0812750161, 0.0186426491, -0.1038899049, 0.0722676516, -0.0559471771, 0.1264347434, 0.1970185041, 0.2099632621, -0.1462198794, 0.3026450574, 0.1411454678, 0.0228797551, 0.1872925162, -0.1113174856, -0.266818583, -0.0893917307, -0.1148819178, 0.3527821004, -0.0293576643, -0.0428980179, 0.1596735865, 0.1022234336, 0.1611075997, -0.1556324959, 0.1408911645, 0.4840657115, 0.0306432396, -0.3259812891, -0.2197623849, 0.3390572965, 0.0310098156, 0.2772325873, 0.3194667399, 0.6091134548, -0.2198729217, -0.0713715777, 0.0882643461, 0.6027917862, -0.0808498934, 0.2150679231, 0.6387688518, 0.107847929, 0.5061594248, -0.1738473028, 0.0813752562, -0.1399827898, -0.2035209835, -0.2088131309, 0.1178933457, 0.1535356194, -0.1363838166, -0.1380756497, 0.2302027345, 0.1945407987, 0.6590548754, 0.2112265378, 0.020619683, 0.1981077194, -0.3410155475, 0.0037910137, 0.0509998053, -0.1828629524, 0.2289460003, -0.1815903783, 0.0274272636, 0.1095732003, -0.0521219559, -0.3887441158, -0.046769239, -0.302800566, 0.0837234706, 0.2496720254, -0.4280471504, 0.0260980278, 0.5828903317, 0.2919090092, 0.0749521106, -0.4588285983, 0.3391943872, -0.2899717093, -0.1697788835, -0.1052602381, -0.0187038034, 0.1468977034, -0.3607318997, -0.2569967508, 0.0887838304, -0.1979542077, 0.1123603731, -0.5468315482, -0.1329648495, -0.231888935, -0.1394215971, -0.2019579113, 0.0286688842, 0.205131188, -0.1704580337, 0.1036361605, -0.2340828627, 0.031170778, 0.0023115836, -0.0145667903, 0.1151168346, -0.0465861112, -0.0088066198, 0.1513917297, -0.1076867208, 0.5726295114, 0.2279134691, -0.2019622028, -0.2096694857, 0.1586484909, 0.3235659599, -0.1113514975, -0.2232870758, 0.3407528996, 0.0636781454, -0.2243643403, 0.4084560573, 0.054528892, -0.3415666223, -0.0959713012, -0.2599240243, -0.3298789561, 0.2840153575, -0.0095754992, 0.0850337148, -0.0457579233, 0.3730966151, 0.0390130132, -0.0064164419, -0.2616870403, 0.0534339398, -0.1529503912, -0.0701641291, 0.1162128747, -0.0758843273, 0.2101151049, -0.0620274059, 0.0646234825, 0.0621432997, 0.1470191032, -0.1799548268, -0.1612074971, 0.0971435979, 0.132524848, 0.0819810778, 0.1157548279, 0.0776535422, -0.3033303618, -0.0377342887, 0.2392122149, -0.0650350749, 0.1242357939, 0.413726449, 0.2629141808, 0.1006627232, -0.4023757875, 0.0708326697, 0.0459396839, 0.050292246, -0.0766863674, -0.0175247341, 0.3782875538, 0.0034458861, 0.3644514084, 0.1347180307, -0.0263646245, -0.010521654, 0.4533816874, -0.0718132332, 0.1905423999, -0.0129269883, 0.004608877, -0.1390440166, -0.1504268646, 0.2139182389, 0.1837685704, 0.1791432947, -0.344006598, -0.0165622178, 0.6128945351, 0.2153340131, 0.0547350347, 0.0826411396, 0.0124049932, -0.2125089914, -0.0821576715, -0.0622270256, 0.3721989095, -0.2494947314, 0.116954565, 0.2945455611, 0.1688922942, -0.0569904149, -0.1070460528, 0.0550776236, -0.1166195571, 0.0124529591, 0.155219093, 0.1546727121, -0.3471731246, 0.089611873, 0.3072938323, -0.2104280591, -0.1748604476, -0.1847707033, -0.1456415653, 0.0071292054, -0.2843006551, 0.1226415187, 0.2596563697, -0.1760375798, -0.1146960258, 0.2897745669, -0.4225582778, -0.0365373343, -0.5136739016, -0.0949566513, 0.4643174112, -0.0115998909, 0.2184687853, -0.0701202974, -0.2975370586, 0.035833627, -0.1305197477, 0.063289836, -0.1309071481, 0.3346390426, 0.2443822622, 0.0962919295, 0.1649876237, 0.5131891966, -0.0827162638, -0.0653139129, 0.1417790502, 0.1540220976, -0.1301612556, 0.203857258, 0.042388577, -0.0868408084, -0.2127308398, 0.1242758483, 0.1656412631, 0.3661206663, 0.0714523867, 0.203133747, 0.0916304588, -0.1607855558, 0.1727113575, -0.3102755547, 0.062736854, -0.2525843978, -0.4314891994, -0.4790426493, -0.3664099276, -0.3255730867, 0.0700913519, -0.3667889237, 0.4393814504, 0.3142421842, 0.1522529274, 0.0496206172, 0.0120734014, 0.0408183262, -0.0565608367, 0.533655405, 0.375323385, 0.0652273521, -0.0631977245, -0.5100793839, -0.4604111314, 0.1406424046, -0.3310750425, -0.280960381, 0.3991976976, 0.0121898949, 0.2246186435, -0.112097472, 0.0712402388, 0.1818886995, -0.0611510202, -0.0849651992, -0.3626078367, -0.3241227269, -0.2102885395, 0.1575202197, -0.0781007111, 0.0994560495, 0.3338731527, 0.2336708903, 0.0444553494, -0.0549852252, 0.5272192359, -0.2992137969, -0.2561642826, -0.2594652176, 0.1792300195, 0.4275268316, -0.2012319714, 0.1252472401, 0.006484421, -0.0552081987, -0.2133352607, 0.2091842443, -0.0420501381, 0.2689843178, -0.0863780901, -0.3895612955, -0.0416732244, 0.0830230415, 0.2297481, 0.1148255467, -0.252139926, 0.1560747325, 0.2910844684, -0.1661328077, 0.5159577727, 0.2352434993, -0.3428996801, -0.1456558704, -0.1788380146, -0.4296725392, 0.3856589198, -0.3516279161, -0.0709294081, -0.1147501916, -0.324847728, 0.1656798422, 0.1717690378, -0.6097329855, -0.0852117836, 0.2544308901, -0.0300875865, -0.1170114428, 0.2773384452, 0.2003669441, 0.1367272139, 0.0131962597, -0.1779352725, 0.0776453987, -0.176899761, -0.1311737746, -0.1422073543 ]
https://github.com/huggingface/datasets/issues/2130
wikiann dataset is missing columns
Hi ! Apparently you can get the spans from the NER tags using `tags_to_spans` defined here: https://github.com/tensorflow/datasets/blob/c7096bd38e86ed240b8b2c11ecab9893715a7d55/tensorflow_datasets/text/wikiann/wikiann.py#L81-L126 It would be nice to include the `spans` field in this dataset as in TFDS. This could be a good first issue for new contributors ! The objective is to use `tags_to_spans` in the `_generate_examples` method [here](https://github.com/huggingface/nlp/blob/c98e4b8f23e3770c401c6d9326e243e1ffd599ec/datasets/wikiann/wikiann.py#L292-L316) to create he `spans` for each example.
Hi Wikiann dataset needs to have "spans" columns, which is necessary to be able to use this dataset, but this column is missing from huggingface datasets, could you please have a look? thank you @lhoestq
61
wikiann dataset is missing columns Hi Wikiann dataset needs to have "spans" columns, which is necessary to be able to use this dataset, but this column is missing from huggingface datasets, could you please have a look? thank you @lhoestq Hi ! Apparently you can get the spans from the NER tags using `tags_to_spans` defined here: https://github.com/tensorflow/datasets/blob/c7096bd38e86ed240b8b2c11ecab9893715a7d55/tensorflow_datasets/text/wikiann/wikiann.py#L81-L126 It would be nice to include the `spans` field in this dataset as in TFDS. This could be a good first issue for new contributors ! The objective is to use `tags_to_spans` in the `_generate_examples` method [here](https://github.com/huggingface/nlp/blob/c98e4b8f23e3770c401c6d9326e243e1ffd599ec/datasets/wikiann/wikiann.py#L292-L316) to create he `spans` for each example.
[ 0.0096026286, -0.3400488496, -0.0416718647, 0.2219899446, 0.2957081795, 0.1506410837, 0.346960485, 0.0389459059, 0.0920509547, 0.2753709555, 0.0485682562, -0.0450659432, -0.0080627929, 0.3632447422, 0.3476261795, -0.7035682797, 0.0311785825, 0.2775574923, -0.1697650254, 0.0125469863, -0.238645345, 0.4350680709, -0.3131061196, -0.1572516561, -0.4427958727, -0.0176233351, -0.2585737705, -0.0887649506, -0.0000617169, -0.2098567188, 0.3393799961, -0.2286442518, 0.2572217584, -0.1111911163, -0.0001127702, 0.013566725, 0.0615052991, -0.078771092, 0.0453727245, -0.0841389298, 0.0922177732, -0.2578550577, -0.0348373652, -0.2561396956, -0.3284047842, -0.0753948689, -0.1517590135, 0.095174104, -0.0247505344, 0.2180270851, 0.1504639089, 0.7661391497, 0.1667827517, -0.0779859275, 0.3054934442, -0.1118117422, -0.3342804313, -0.2091896236, 0.1571558863, -0.150228858, 0.0648352504, 0.4155138731, 0.1755712777, -0.2107821703, 0.3825213611, 0.3127261996, -0.3683204055, -0.4562546909, 0.0013717366, 0.7677550316, 0.4328103065, 0.0056350646, -0.0264451765, -0.4336351752, 0.0105296969, -0.0954039097, 0.0216442868, 0.1007573232, -0.1240710169, 0.2177968472, -0.0346530825, -0.0619391054, -0.2247720957, 0.1798864603, -0.2414660752, 0.2327043265, 0.0405293442, -0.0485336334, 0.0854123384, -0.0204811282, -0.2247579992, 0.1801456213, 0.1715922505, 0.1254054606, -0.4294278622, -0.0337392762, -0.0181056261, 0.3601996005, 0.2100781053, 0.050382562, -0.0640606284, -0.2628417611, 0.0568877421, 0.1270201057, -0.155583784, 0.052305676, 0.0083032195, 0.1369300038, -0.0462959632, 0.2109605968, 0.0836110115, -0.1855954528, -0.0599283203, 0.0971121117, -0.3002234101, -0.3053975105, -0.1432875991, 0.043489784, 0.004230395, 0.1945305318, 0.0694301799, 0.1005567759, 0.0134354644, 0.2938940525, -0.0275054146, 0.4606288671, -0.0773589462, 0.2148901522, 0.025565818, -0.0853915587, -0.3643149436, 0.1905196309, 0.0240064859, 0.1809858084, 0.2539697886, -0.3256502151, 0.4710209668, -0.0390248373, -0.0434679277, 0.1570564806, -0.0526105613, 0.0993088335, -0.1652288437, 0.4395030141, -0.0349985622, 0.0834422931, 0.1697856486, -0.1075865477, -0.0663322732, -0.0548296683, -0.2166236043, -0.0040972233, -0.2454872131, 0.1436573863, -0.1251898408, -0.2313671261, -0.0372503102, 0.2354416251, 0.1080501005, -0.2084844708, 0.0712390691, 0.0248906873, -0.3170247078, -0.1683146954, 0.5056079626, 0.0399221443, -0.3781885207, -0.3986587524, 0.2939235866, -0.1754313409, 0.1552595347, 0.2094494402, 0.0846957788, 0.1171685085, -0.1244228035, 0.6250926256, 0.1958316565, -0.2356549203, -0.1009485796, -0.1965228915, 0.182989642, 0.2725663185, 0.0235279314, -0.0120198354, 0.4229516387, 0.1425530314, -0.0457175337, 0.3367979825, -0.2082442492, -0.0657009855, -0.100047864, -0.1101308167, 0.2190693468, 0.1781909317, 0.1841686368, 0.1768701673, -0.2432330996, 0.2072169185, 0.1569549292, -0.3025967479, 0.199922353, 0.2825665772, 0.0229868237, 0.2774755955, 0.1182468683, -0.238850981, -0.6610703468, 0.2167612463, -0.0592282936, 0.4719747305, 0.2986934483, -0.2056800574, -0.1835256219, -0.1310996711, 0.0069144699, -0.3616111279, 0.1088553593, -0.0447662808, 0.0705670714, 0.2840747237, -0.2449752688, -0.1201993376, -0.4714964926, 0.2484920323, -0.5372624993, 0.3105764985, -0.0796098635, 0.0625526756, -0.0304806568, 0.4805233777, -0.0285156555, 0.0097294338, 0.1863794029, 0.0043972726, -0.2089274824, 0.2935679257, -0.1489436775, 0.3889605701, 0.2140198052, -0.3447875977, -0.1804738492, -0.0957650989, -0.0777005702, -0.2883731425, -0.0209820457, 0.2886340618, 0.0869848654, 0.4630936086, 0.1234811842, 0.3386547565, -0.0108274892, -0.1775803268, -0.0193866268, -0.278806746, 0.1496563852, -0.5367226005, 0.136572063, -0.0645933896, -0.4196058214, 0.2042812556, 0.4279753864, 0.0633512884, 0.0718593746, 0.0658704489, -0.4009695351, 0.1018073857, 0.0327861682, 0.0492319763, 0.1975304186, 0.1843509376, 0.3715711236, 0.0923896506, -0.0590710752, -0.205507189, 0.2382937521, -0.000100283, 0.1313724518, 0.2200175226, -0.0017092526, 0.0597873963, -0.1700549722, 0.1733986586, -0.2498635948, 0.3950410187, -0.3663574457, -0.0438928679, -0.1436813474, -0.2902813256, 0.0288749672, -0.0873046666, -0.1415220648, -0.4789792001, 0.0346716419, -0.0348252803, 0.0401359499, 0.171226427, -0.1327499002, 0.2457699925, -0.1171807051, 0.1424686164, -0.4899619222, -0.128246516, -0.1769986749, 0.1487134546, -0.0496284254, -0.0152701475, 0.0834247172, -0.2558936179, 0.060629189, -0.2867175341, -0.5384835005, 0.1535820216, -0.2546759248, -0.0277705379, 0.2747761011, 0.6557902098, -0.2294673622, -0.2044860274, 0.2566317022, -0.3007083535, -0.177906692, 0.1082171947, -0.263954699, 0.1515254527, -0.2519558668, -0.2615916729, -0.2821849585, -0.2204406857, 0.1646000743, -0.0915770531, -0.0129059665, 0.2366131842, -0.0878044292, 0.2831339836, -0.169229731, 0.0539391711, -0.1425022632, -0.2312060297, 0.4616045356, -0.2854108214, -0.2608578801, 0.0807003826, -0.305796206, 0.5293775797, 0.0693491623, -0.3885042667, -0.1409015059, 0.1390135139, 0.1803543121, 0.0790945143, 0.0125413369, 0.4569821656, -0.3402536213, 0.1417893469, -0.3257478178, 0.3169380128, -0.0234829709, -0.2708431482, 0.1427457631, -0.1591112614, 0.1861768216, 0.1096411198, 0.2882343233, 0.2257872522, 0.0538422242, 0.2514746487, -0.4117178321, 0.2570098639, 0.0497904047, -0.1021383405, 0.3323720098, -0.0246806145, 0.3655770123, 0.3398319483, 0.1039028242, -0.0304457303, -0.1205992177, -0.0682412833, -0.2416816354, -0.1490651071, 0.0589578822, 0.2387776971, 0.3836189508, -0.0671870112, -0.0412843972, -0.0111010522, -0.3337472379, 0.0258440152, 0.2859097421, 0.2306167483, 0.088238731, -0.2942483425, 0.1608678252, -0.4955255091, -0.1271620989, -0.0355286561, 0.1020805836, -0.0938197002, -0.0358864591, 0.010350205, 0.1439751089, 0.6889341474, -0.4194599092, -0.4454329014, -0.1986943185, 0.1826642454, -0.4102360606, 0.1526101083, -0.1578062028, -0.6618090272, 0.1869553775, 0.5838922858, -0.2288832068, -0.0369235612, 0.4610931873, 0.2755674422, -0.1745370328, -0.1738998741, -0.2141487896, -0.3961093128, -0.2489794791, -0.3374049962, 0.1674870551, 0.2511647344, -0.1050629318, -0.0483420603, 0.0309323352, 0.1877809912, 0.05577977, 0.1609739661, 0.2917235494, -0.0202623308, -0.005404368, 0.2812901139, 0.0475021414, 0.009625772, 0.3408077955, -0.1727466881, -0.3893280625, 0.0165144727, -0.0480981283, 0.3733417988, -0.0120249391, -0.0054976903, 0.2215062976, 0.180039987, 0.1133568585, -0.2292874008, 0.2550822794, 0.4812561274, -0.0678879395, -0.0369298682, -0.2190567851, 0.3981317282, 0.1039306596, 0.2893249393, 0.2170246243, 0.5756607652, -0.2040621191, -0.0088242218, 0.00433743, 0.6888930798, 0.0431722142, 0.2604461312, 0.6488652825, 0.1300826669, 0.6366936564, -0.1697507501, -0.0247281417, -0.3252648711, -0.1908982396, -0.1308864951, 0.0493109971, 0.1411258876, -0.0547628291, -0.1942636669, 0.1737315953, 0.2398357987, 0.6364045739, 0.1294535995, 0.0132687092, -0.0044815242, -0.4697112739, 0.0351216048, 0.0425629616, -0.1734477878, 0.2748548985, -0.0885681435, 0.0530237369, -0.0597694479, -0.1742846072, -0.3034949899, 0.1209155321, -0.1696869433, -0.0543453582, 0.4672958255, -0.2665228844, 0.088800475, 0.569634676, 0.288865149, -0.0574185289, -0.4292494655, 0.3164283931, -0.3440195918, -0.1321988553, 0.1689971685, -0.0002474971, 0.3026666343, -0.2705129385, -0.2358098179, -0.0012533925, -0.058109384, 0.2543414831, -0.496527791, -0.2070839852, -0.2827216685, -0.1058982462, -0.079250142, 0.1633310169, 0.196247384, -0.2985825539, 0.1102308482, -0.1691221297, -0.1328529119, -0.0437235497, -0.0769514591, 0.1435174942, -0.0132539105, -0.0233260505, 0.0821138173, -0.2183975875, 0.4074657857, 0.354524076, -0.2506162524, -0.1042834371, 0.0408610776, 0.3909343481, -0.425509274, -0.1830888987, 0.3778048456, 0.1231883615, -0.1935779303, 0.4957164228, -0.0833095312, -0.261208415, -0.0919971094, -0.2706174552, -0.3745498657, 0.3178091347, 0.0038882475, 0.1583865881, -0.1975407302, 0.3579546511, 0.0004277006, 0.1056277305, -0.2790940106, -0.0142359436, -0.1662762612, 0.0083160345, 0.1782572269, -0.1054555625, 0.2839038074, 0.0324825086, 0.0307686552, 0.181455344, 0.0852226093, -0.1257598698, -0.2736718059, 0.0976112932, 0.1399456561, 0.1397402585, 0.0373194255, 0.3310204446, -0.2330462337, -0.1823268533, 0.280922085, -0.0835620016, 0.0644368008, 0.3747582734, 0.1335433424, 0.2256378084, -0.1648499966, 0.077808708, 0.060314469, 0.1051199436, 0.0486094281, 0.0451045483, 0.111306414, -0.033451803, 0.1679164916, 0.2166941613, -0.0283968113, -0.0299928747, 0.3547179699, 0.0130246226, 0.0453355908, -0.1104089469, 0.1945457906, -0.2014465332, -0.0422598347, 0.3111614585, 0.1811487526, 0.1537885964, -0.2879521549, 0.0950943232, 0.5618878603, 0.0091568045, 0.166035533, 0.2860008776, 0.2187123001, -0.1394684613, -0.2600669265, -0.1360287964, 0.366194725, -0.2573712766, 0.0548409782, 0.3716140389, 0.0797656924, -0.0221907273, -0.0395521745, -0.0004073549, 0.0410139747, -0.0287887007, 0.0501170047, 0.3103124499, -0.5167759061, -0.016504623, 0.4140042067, -0.2651937902, -0.2028975338, -0.1084453464, -0.0689840168, -0.0224913098, -0.3505363464, 0.30231601, 0.301386714, -0.1437643766, -0.138469249, 0.3903591335, -0.3028218746, -0.1124034226, -0.5327315927, -0.1758510917, 0.1697008461, -0.1144696251, 0.2899703085, -0.0980347916, -0.1407260597, -0.0042726621, -0.0231501684, 0.0454272479, -0.1444654763, 0.263533771, 0.1723182201, 0.0440607667, 0.1336943954, 0.4879324138, 0.0019560885, -0.1372492611, 0.046945028, 0.2296808809, -0.1872313172, 0.2690656185, 0.0805299506, -0.0810467228, -0.1450400203, 0.1178020388, 0.2352015227, 0.3659516573, 0.0038213972, 0.2268043011, 0.0050575323, -0.1607358009, 0.0690553039, -0.1922187209, 0.0795903951, -0.1604683697, -0.1012968644, -0.3562689722, -0.2814126909, -0.3153091073, 0.1010261625, -0.4224945903, 0.3207926452, 0.3138851821, 0.0636069775, 0.0019103251, -0.0168929771, 0.0447770432, -0.0498583093, 0.5095521808, 0.2807851136, 0.2484709322, -0.1566558778, -0.4722028375, -0.5128247738, 0.1290949285, -0.2937473357, -0.1378594041, 0.2778894305, 0.0712925345, 0.1493515074, 0.0080826674, -0.1277736425, 0.1497376859, 0.0351926759, -0.0261978656, -0.3916729391, -0.3891704977, -0.2848651409, -0.0568102896, -0.0499064773, 0.2799984813, 0.1806736588, 0.1084943935, -0.0296751484, -0.1062724888, 0.5135324001, -0.1903238297, -0.2412334681, -0.2446428835, 0.0120440144, 0.4205493033, -0.1620689481, -0.0037238076, -0.0436838791, -0.101622656, -0.2380418926, 0.1657153219, -0.1277559102, 0.4387218356, -0.0151889697, -0.4770477414, -0.081294924, -0.0144444257, 0.3587685227, -0.0919229537, -0.2852699757, 0.2698578835, 0.1301116496, 0.0226350427, 0.4985998869, 0.2061761916, -0.1455756873, -0.031354636, -0.0372555852, -0.5985196233, 0.4953222871, -0.1852772534, 0.0062364116, -0.1610577703, -0.29581815, 0.2354768813, 0.1117395163, -0.8591642976, -0.0685660541, 0.288336426, -0.0015765103, 0.065196991, 0.2277213037, 0.1733225733, 0.064734824, -0.0727825686, -0.4401550889, 0.0614164658, 0.0164778531, 0.0301132649, -0.1097398773 ]
https://github.com/huggingface/datasets/issues/2130
wikiann dataset is missing columns
Hi @lhoestq thank you very much for the help, it would be very nice to have it included, here is the full code, one need to also convert tags to string first: ``` import datasets from datasets import load_dataset def tags_to_spans(tags): """Convert tags to spans.""" spans = set() span_start = 0 span_end = 0 active_conll_tag = None for index, string_tag in enumerate(tags): # Actual BIO tag. bio_tag = string_tag[0] assert bio_tag in ["B", "I", "O"], "Invalid Tag" conll_tag = string_tag[2:] if bio_tag == "O": # The span has ended. if active_conll_tag: spans.add((active_conll_tag, (span_start, span_end))) active_conll_tag = None # We don't care about tags we are # told to ignore, so we do nothing. continue elif bio_tag == "B": # We are entering a new span; reset indices and active tag to new span. if active_conll_tag: spans.add((active_conll_tag, (span_start, span_end))) active_conll_tag = conll_tag span_start = index span_end = index elif bio_tag == "I" and conll_tag == active_conll_tag: # We're inside a span. span_end += 1 else: # This is the case the bio label is an "I", but either: # 1) the span hasn't started - i.e. an ill formed span. # 2) We have IOB1 tagging scheme. # We'll process the previous span if it exists, but also include this # span. This is important, because otherwise, a model may get a perfect # F1 score whilst still including false positive ill-formed spans. if active_conll_tag: spans.add((active_conll_tag, (span_start, span_end))) active_conll_tag = conll_tag span_start = index span_end = index # Last token might have been a part of a valid span. if active_conll_tag: spans.add((active_conll_tag, (span_start, span_end))) # Return sorted list of spans return sorted(list(spans), key=lambda x: x[1][0]) dataset = load_dataset('wikiann', 'en', split="train") ner_tags = { 0:"O", 1:"B-PER", 2:"I-PER", 3:"B-ORG", 4:"I-ORG", 5:"B-LOC", 6:"I-LOC" } def get_spans(tokens, tags): """Convert tags to textspans.""" spans = tags_to_spans(tags) text_spans = [ x[0] + ": " + " ".join([tokens[i] for i in range(x[1][0], x[1][1] + 1)]) for x in spans ] if not text_spans: text_spans = ["None"] return text_spans for i, d in enumerate(dataset): tokens = d['tokens'] tags = d['ner_tags'] tags = [ner_tags[i] for i in tags] spans = get_spans(tokens, tags) print("spans ", spans) print(d) if i > 10: break; ``` I am not sure how to contribute to the repository and how things work, could you let me know how one can access the datasets to be able to contribute to the repository? Maybe I could do it then thanks
Hi Wikiann dataset needs to have "spans" columns, which is necessary to be able to use this dataset, but this column is missing from huggingface datasets, could you please have a look? thank you @lhoestq
402
wikiann dataset is missing columns Hi Wikiann dataset needs to have "spans" columns, which is necessary to be able to use this dataset, but this column is missing from huggingface datasets, could you please have a look? thank you @lhoestq Hi @lhoestq thank you very much for the help, it would be very nice to have it included, here is the full code, one need to also convert tags to string first: ``` import datasets from datasets import load_dataset def tags_to_spans(tags): """Convert tags to spans.""" spans = set() span_start = 0 span_end = 0 active_conll_tag = None for index, string_tag in enumerate(tags): # Actual BIO tag. bio_tag = string_tag[0] assert bio_tag in ["B", "I", "O"], "Invalid Tag" conll_tag = string_tag[2:] if bio_tag == "O": # The span has ended. if active_conll_tag: spans.add((active_conll_tag, (span_start, span_end))) active_conll_tag = None # We don't care about tags we are # told to ignore, so we do nothing. continue elif bio_tag == "B": # We are entering a new span; reset indices and active tag to new span. if active_conll_tag: spans.add((active_conll_tag, (span_start, span_end))) active_conll_tag = conll_tag span_start = index span_end = index elif bio_tag == "I" and conll_tag == active_conll_tag: # We're inside a span. span_end += 1 else: # This is the case the bio label is an "I", but either: # 1) the span hasn't started - i.e. an ill formed span. # 2) We have IOB1 tagging scheme. # We'll process the previous span if it exists, but also include this # span. This is important, because otherwise, a model may get a perfect # F1 score whilst still including false positive ill-formed spans. if active_conll_tag: spans.add((active_conll_tag, (span_start, span_end))) active_conll_tag = conll_tag span_start = index span_end = index # Last token might have been a part of a valid span. if active_conll_tag: spans.add((active_conll_tag, (span_start, span_end))) # Return sorted list of spans return sorted(list(spans), key=lambda x: x[1][0]) dataset = load_dataset('wikiann', 'en', split="train") ner_tags = { 0:"O", 1:"B-PER", 2:"I-PER", 3:"B-ORG", 4:"I-ORG", 5:"B-LOC", 6:"I-LOC" } def get_spans(tokens, tags): """Convert tags to textspans.""" spans = tags_to_spans(tags) text_spans = [ x[0] + ": " + " ".join([tokens[i] for i in range(x[1][0], x[1][1] + 1)]) for x in spans ] if not text_spans: text_spans = ["None"] return text_spans for i, d in enumerate(dataset): tokens = d['tokens'] tags = d['ner_tags'] tags = [ner_tags[i] for i in tags] spans = get_spans(tokens, tags) print("spans ", spans) print(d) if i > 10: break; ``` I am not sure how to contribute to the repository and how things work, could you let me know how one can access the datasets to be able to contribute to the repository? Maybe I could do it then thanks
[ 0.0544693172, -0.3270136714, -0.0403903872, 0.1326312125, 0.2911989391, 0.2451726198, 0.4067167342, 0.1009383872, 0.3828303516, 0.155616641, -0.0446800366, -0.2178343982, 0.0227381401, 0.5038778782, 0.3199461401, -0.5506708622, 0.1787429452, 0.2836461365, 0.0272958372, -0.1717301011, -0.3373778164, 0.4151012897, -0.3747097254, -0.0913584679, -0.4198635817, -0.0521618277, -0.1558327377, 0.058463145, -0.2034340501, -0.4034019709, 0.3294116557, -0.2170114517, 0.3202043772, -0.115467526, -0.000112541, -0.1020316035, 0.1146139652, -0.0741279796, -0.035227038, 0.1029127911, -0.0024701431, -0.300540626, -0.0322348624, -0.2677301168, -0.2919104099, -0.1271561682, -0.3608502746, -0.0884255692, -0.169905737, 0.1173603833, 0.1594197154, 0.4930121899, 0.1872769445, -0.0216505695, 0.3861586452, -0.3597492576, -0.2000509202, -0.223743245, 0.2682067752, -0.1672687531, 0.2621861696, 0.5828678012, -0.0686726645, -0.2373126894, 0.3806411028, 0.1863372028, -0.0965010375, -0.354298234, 0.1478400081, 0.488411516, 0.4684247673, -0.1065141261, -0.144952774, -0.2883476317, 0.0657665357, -0.3216190934, 0.0381793678, 0.1077187583, 0.0494385362, 0.273778677, -0.0201077387, 0.0279786922, -0.0424057171, 0.050882034, -0.2102713287, 0.5055121183, 0.0122652054, -0.0037944671, 0.027037872, 0.0542169064, -0.2672325969, 0.0604034439, -0.0002395918, 0.180832386, -0.4676633179, -0.0149634853, -0.063784413, 0.7178285718, 0.3234870732, 0.127893731, -0.2642259896, -0.4074226618, 0.2040251493, 0.0630207062, 0.0163021944, 0.2194531411, 0.0177546255, 0.1384572983, -0.1093441695, 0.2411258668, 0.1371104568, -0.1718850732, 0.1250829101, 0.0112151764, 0.0479667187, -0.0958265662, -0.04062007, -0.1761167794, -0.1931810677, 0.1283473372, -0.0858136117, 0.0573208593, 0.1037843227, 0.3675777912, 0.0357898474, 0.4057354331, -0.0181980208, 0.2109330148, 0.0414990336, -0.1849018186, -0.3456234336, 0.1723769009, -0.0278712735, 0.0412089825, 0.2061504871, -0.2425576299, 0.4308031797, -0.0141541287, -0.1144157797, 0.1334281266, -0.1852983683, -0.1513621211, 0.0604237467, 0.4951550961, -0.1300830096, 0.20439592, 0.1434559971, -0.2034407109, -0.0840796679, 0.0595365651, -0.2339164764, 0.020157665, -0.402079314, 0.1664364934, -0.1108933315, -0.2205125093, -0.0506510325, 0.1065467894, 0.0239954554, -0.2974379361, 0.1126542315, -0.0470754839, -0.201553762, -0.0306951478, 0.5745875835, 0.1898588836, -0.1930188835, -0.4148736596, 0.436080873, -0.0263606645, 0.2025564313, 0.2573498487, 0.2017432153, 0.1720212102, -0.1324972361, 0.4924695194, 0.0134954304, -0.4078333378, -0.2425950766, -0.345808655, 0.2205598354, 0.3580067158, 0.1147090495, 0.0673443079, 0.3221622109, 0.0256255604, 0.0146006308, 0.3263652921, -0.0976219624, -0.0204216577, -0.2326062173, -0.1400737315, 0.2369295955, 0.1449743807, 0.0888516679, 0.024597561, -0.2037451714, -0.0059463046, 0.2381316125, -0.3163131475, 0.1725290865, 0.2288782746, 0.0828213245, 0.2735073268, 0.2326696217, -0.3583382368, -0.5895219445, 0.2272503674, 0.1954201311, 0.2556384206, 0.1291144341, -0.2900446057, -0.3728680015, -0.0594470873, -0.125444904, -0.3232946694, 0.1320795715, 0.0530794039, 0.0084880963, 0.18623209, -0.2948438525, -0.1074061096, -0.2357057929, 0.2480612695, -0.3208344579, 0.2400352806, -0.1686613262, -0.0328182504, 0.0763438195, 0.5403308868, 0.2565370202, 0.1897565573, 0.222833693, 0.0916350037, -0.1450526714, 0.027949594, -0.0130789205, 0.3257299066, 0.1200419143, -0.3045976758, -0.1943527907, -0.1095430404, 0.170019567, -0.200299561, 0.0100837564, 0.0964762717, -0.0876423568, 0.3575110137, -0.0103020743, 0.2266383767, 0.144218564, -0.3177840114, -0.058705356, -0.2331504822, 0.1952025443, -0.5777385235, 0.1849354506, -0.1640563011, -0.246476531, 0.1813760698, 0.4493900836, -0.0985959172, 0.0781159699, -0.1623224616, -0.4065581262, 0.1908219755, 0.0960351601, 0.0082345009, 0.201785937, 0.2465302646, 0.1954311132, -0.0871234983, -0.023571223, -0.0434325226, 0.200027138, -0.0140682384, 0.0008669272, 0.2576186657, 0.0426493995, 0.0836305171, -0.1842700541, 0.1168388203, -0.3363687396, 0.2314847112, -0.3505464196, -0.0540646613, -0.0917512625, -0.1673776954, 0.0889811218, -0.404090941, -0.0554511212, -0.3870822787, 0.1263014376, -0.2790805995, 0.0139317438, 0.2027007341, -0.2238696963, 0.3222596049, -0.0865766034, 0.0373747423, -0.5950978994, -0.1842695773, -0.1742399931, 0.0743243694, -0.1024551094, 0.1173359379, 0.0428955853, -0.4117195308, -0.0802081972, -0.2833997905, -0.4494694769, 0.1166325063, -0.2666518688, 0.1625021249, 0.3171647191, 0.4674129188, -0.092089504, -0.1513971537, 0.3166528344, -0.1866428256, -0.0389573164, 0.1505759656, -0.0790560842, 0.0194667391, -0.1821570098, -0.1631702632, -0.3570206761, -0.0780602098, 0.1331020296, -0.0158122703, -0.1398489922, 0.1193092316, -0.0854910463, 0.1214033365, -0.1633445621, 0.1551130712, -0.1893160343, -0.3184944689, 0.3573023677, -0.0028753169, -0.2122383565, 0.0864415541, -0.2347601801, 0.3610836565, -0.0930040255, -0.3724880517, -0.1330971122, 0.2365109622, 0.1786494404, 0.068166405, 0.0832071602, 0.4093668759, -0.1339918971, 0.1313057393, -0.3668017387, 0.0353032649, -0.180609718, -0.4232718647, 0.2840660214, -0.3843837976, 0.2557320297, 0.0164646357, 0.1918071955, 0.2065473199, 0.2342863232, 0.2982036173, -0.2027377337, 0.2933229804, -0.0803183317, -0.3152865767, 0.2866959572, -0.1873612851, 0.1270023882, 0.3359541595, 0.0512874275, -0.0133391842, -0.1811531782, -0.1329343021, -0.2979296744, -0.1639048308, -0.0078744832, 0.4573521912, 0.2752794623, -0.0486614518, -0.0057231486, -0.1397505254, -0.1836078167, 0.2187123001, 0.4127667248, 0.2451677769, 0.0993104503, -0.2173626572, 0.0696445704, -0.4181897044, -0.0287406594, 0.033962369, 0.0534691848, 0.1074628085, -0.0410087928, 0.0089008138, 0.077793099, 0.3949429989, -0.4277155399, -0.1420180947, -0.0859802142, 0.2854677737, -0.1988034695, 0.0394263715, -0.2738190293, -0.5508036613, 0.2807577848, 0.5836248398, -0.3903932273, -0.0757062286, 0.7279964685, 0.3608463407, -0.0763677508, -0.2026700377, -0.4303676784, -0.4182765186, -0.2724164426, -0.1223148927, 0.3240905106, 0.2643381953, -0.0167253725, -0.0465231165, -0.15712744, 0.0003975853, 0.0761726201, 0.2137706578, 0.3229748011, -0.1104358956, -0.056189239, 0.2773349285, 0.0006002281, 0.0057454053, 0.4690232277, -0.3493477106, -0.5048448443, -0.1113383025, -0.0512562469, 0.4775036275, -0.0490509793, 0.0255592279, 0.1722624749, 0.1563804299, 0.0661830902, -0.2490696013, -0.0385928042, 0.4647091627, 0.1458497643, -0.0820626244, -0.1797791123, 0.4675610662, 0.1549691856, 0.1091685146, 0.268705368, 0.694123745, -0.2821180224, 0.133961305, -0.0013890192, 0.8452183008, -0.0397441015, 0.1042333394, 0.4053998888, -0.0132360086, 0.3032665253, 0.0281626135, 0.1390978247, -0.3000717163, -0.2921205461, -0.0908369496, 0.1666677594, 0.1481088698, -0.1318235397, -0.2458904833, 0.2755981088, 0.0452361852, 0.6778354645, 0.0746097192, -0.1033953875, -0.0017686207, -0.4012654722, -0.2720256746, 0.0822914392, -0.131052807, 0.1844049692, -0.2015083134, 0.1920026243, 0.0872271881, -0.2494222522, -0.2389716804, 0.0637117922, -0.2709907293, -0.1070004255, 0.3383778036, -0.3196051419, -0.0449288897, 0.4351572394, 0.2685518265, 0.0004195138, -0.2788119018, 0.2626274526, -0.2549907863, -0.097398445, -0.0191495419, -0.1352156997, 0.3243162334, -0.2111024112, -0.3843374848, 0.0903835297, -0.1274333596, 0.0182263851, -0.2287191153, -0.0358414128, -0.0269988663, -0.2296766639, 0.0142787658, 0.1640331298, 0.3964561224, -0.3822670281, 0.0931845009, -0.140621677, -0.1895357966, 0.0779168904, -0.0804075077, 0.0065080673, -0.094113484, 0.0342354253, 0.0110290367, 0.0023248494, 0.5822213888, 0.135550037, -0.320478797, -0.1524464339, -0.1715672165, 0.3862133026, -0.2608522475, -0.0786109492, 0.274474442, -0.0822323486, -0.0807964653, 0.5901313424, 0.1658881158, -0.3848464191, -0.0733301789, -0.4468896091, -0.1905548573, 0.4615366757, 0.0596766621, 0.1075815856, -0.0156421512, 0.2550134063, -0.0372400768, 0.1408180296, -0.3331300318, -0.1739233434, -0.3433171511, 0.091741845, 0.0483107083, -0.1085372865, 0.2005743384, 0.0188454464, 0.104067333, 0.0480878539, 0.2977728546, -0.166576162, -0.2269821167, 0.1043345779, 0.0997511968, 0.2559481263, -0.0327716433, 0.1996016502, -0.1600092649, -0.2049889416, 0.3374838829, 0.0187263861, 0.1683522165, 0.230544284, 0.1863617301, 0.1055733711, -0.3049563169, -0.0217057243, -0.0400152989, -0.0664833039, -0.0186128691, 0.0228278544, 0.1278032213, 0.0514720753, 0.5048709512, 0.2136391699, 0.0830895305, 0.2258838117, 0.5083486438, -0.0964580327, 0.0130086616, 0.1635411233, 0.1499211043, -0.1923557967, -0.067906633, 0.1851626933, 0.0591691621, 0.2319488078, -0.4967128336, 0.0002577193, 0.4716872573, -0.038890034, 0.2034627646, 0.2427158356, 0.2596537471, -0.2499646246, -0.1458478272, -0.1017300934, 0.4809441566, 0.0282894894, -0.0263645891, 0.3083888292, 0.0784661844, -0.0630012304, 0.1078333929, 0.0511319824, 0.1140612066, 0.0823960602, -0.0422183387, 0.3785282671, -0.2654444277, 0.2412339151, 0.0684906542, -0.0437597856, -0.0139461635, -0.1738173515, 0.0251184367, -0.1282298118, -0.3254921138, 0.2293960452, 0.1202788875, -0.1393977255, -0.2085938305, 0.3673753738, -0.220118463, -0.0590571165, -0.5520493984, -0.1504023671, 0.1835424453, -0.2491616756, 0.0816262886, 0.0153161492, 0.0778466314, 0.093984589, 0.0406755432, -0.001769362, -0.4534666836, 0.3404271603, 0.3654013574, -0.0818673447, 0.1732185036, 0.6445080042, 0.0751831532, -0.0365175232, 0.3512729406, 0.2951741815, 0.0236938521, 0.2055942714, -0.1491782665, -0.1340321451, -0.2938411534, 0.0907441378, 0.3199097514, 0.2083320767, 0.0336416475, 0.1736570001, 0.0767552927, -0.1981585622, 0.0633974075, -0.2220888287, 0.1091495901, -0.2279444039, -0.2378137708, -0.3912307024, -0.3179880977, -0.465973556, 0.0299819857, -0.3282487988, 0.3707673848, 0.1707826257, 0.0695132911, 0.0342904478, 0.1300936937, 0.059345223, 0.1057747379, 0.4426102638, 0.2982800901, 0.0838680714, -0.3084411025, -0.3819871843, -0.523891449, -0.0934579372, -0.3235945106, -0.4068907797, 0.2137566358, -0.0177836195, 0.1535541713, -0.0101388805, 0.101721935, 0.359603405, 0.1713933647, -0.0809159875, -0.423636198, -0.2975743711, 0.0174141005, -0.051801499, -0.0253846534, 0.0251307115, 0.2179339975, 0.1491936296, 0.0173832625, 0.1136091202, 0.2490442842, -0.1416782588, -0.2748276591, -0.0798645616, 0.1748217642, 0.5028144717, -0.2660529912, -0.0049168095, -0.0348541774, -0.1281796396, -0.2321839929, 0.14826563, -0.0469662324, 0.2544283271, 0.0553982928, -0.3131452799, -0.0385000221, 0.1561459005, 0.3408405483, -0.0530778319, -0.4521445036, 0.197932899, 0.0803282261, -0.0011353642, 0.3005702794, 0.2109131515, -0.1628836989, 0.1323052198, -0.1846250445, -0.5597350597, 0.6108744144, -0.2102540731, -0.1114957631, -0.2517184019, -0.0512030795, 0.3974968791, 0.131494239, -0.8236063123, 0.0154706687, 0.1567983776, 0.1745759249, -0.072751984, 0.3572428823, 0.1974400282, 0.1512196064, 0.0224469975, -0.462921232, 0.2020680308, 0.0254846215, -0.101410903, -0.0472728051 ]
https://github.com/huggingface/datasets/issues/2130
wikiann dataset is missing columns
Cool ! Let me give you some context: #### Contribution guide You can find the contribution guide here: https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md It explains how to set up your dev environment in a few steps. #### Dataset loading Each Dataset is defined by a Table that have many rows (one row = one example) and columns (one column = one feature). To change how a dataset is constructed, you have to modify its dataset script that you can find here: https://github.com/huggingface/datasets/blob/master/datasets/wikiann/wikiann.py It includes everything needed to load the WikiANN dataset. You can load locally a modified version of `wikiann.py` with `load_dataset("path/to/wikiann.py")`. #### Define a new column Each column has a name and a type. You can see how the features of WikiANN are defined here: https://github.com/huggingface/datasets/blob/c98e4b8f23e3770c401c6d9326e243e1ffd599ec/datasets/wikiann/wikiann.py#L245-L263 Ideally we would have one additional feature "spans": ```python "spans": datasets.Sequence(datasets.Value("string")), ``` #### Compute the content of each row To build the WikiANN rows, the _generate_examples method from [here](https://github.com/huggingface/nlp/blob/c98e4b8f23e3770c401c6d9326e243e1ffd599ec/datasets/wikiann/wikiann.py#L292-L316) is used. This function `yield` one python dictionary for each example: ```python yield guid_index, {"tokens": tokens, "ner_tags": ner_tags, "langs": langs} ``` The objective would be to return instead something like ```python spans = spans = get_spans(tokens, tags) yield guid_index, {"tokens": tokens, "ner_tags": ner_tags, "langs": langs, "spans": spans} ``` Let me know if you have questions !
Hi Wikiann dataset needs to have "spans" columns, which is necessary to be able to use this dataset, but this column is missing from huggingface datasets, could you please have a look? thank you @lhoestq
208
wikiann dataset is missing columns Hi Wikiann dataset needs to have "spans" columns, which is necessary to be able to use this dataset, but this column is missing from huggingface datasets, could you please have a look? thank you @lhoestq Cool ! Let me give you some context: #### Contribution guide You can find the contribution guide here: https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md It explains how to set up your dev environment in a few steps. #### Dataset loading Each Dataset is defined by a Table that have many rows (one row = one example) and columns (one column = one feature). To change how a dataset is constructed, you have to modify its dataset script that you can find here: https://github.com/huggingface/datasets/blob/master/datasets/wikiann/wikiann.py It includes everything needed to load the WikiANN dataset. You can load locally a modified version of `wikiann.py` with `load_dataset("path/to/wikiann.py")`. #### Define a new column Each column has a name and a type. You can see how the features of WikiANN are defined here: https://github.com/huggingface/datasets/blob/c98e4b8f23e3770c401c6d9326e243e1ffd599ec/datasets/wikiann/wikiann.py#L245-L263 Ideally we would have one additional feature "spans": ```python "spans": datasets.Sequence(datasets.Value("string")), ``` #### Compute the content of each row To build the WikiANN rows, the _generate_examples method from [here](https://github.com/huggingface/nlp/blob/c98e4b8f23e3770c401c6d9326e243e1ffd599ec/datasets/wikiann/wikiann.py#L292-L316) is used. This function `yield` one python dictionary for each example: ```python yield guid_index, {"tokens": tokens, "ner_tags": ner_tags, "langs": langs} ``` The objective would be to return instead something like ```python spans = spans = get_spans(tokens, tags) yield guid_index, {"tokens": tokens, "ner_tags": ner_tags, "langs": langs, "spans": spans} ``` Let me know if you have questions !
[ 0.0056951195, -0.2647257447, -0.0400680006, 0.0995709673, 0.390770793, 0.1089817137, 0.2883937061, 0.1041572094, 0.0132619143, 0.145370096, -0.0328591168, -0.0127280988, 0.0221512355, 0.42865026, 0.2620584965, -0.7255474329, 0.1374140829, 0.2676773369, -0.2057018429, 0.0645833164, -0.3263522387, 0.3927431107, -0.3106455505, -0.1321282983, -0.3484145999, 0.0134390015, -0.2690924704, 0.1206344143, -0.094851017, -0.2926416397, 0.3413374424, -0.224330917, 0.1851858497, -0.0907960534, -0.0001031631, -0.0195616782, 0.1880478412, -0.0933685079, -0.1129949391, 0.1042857617, 0.0963931382, -0.3275562227, -0.0058890432, -0.3028341532, -0.3155609965, -0.1220749915, -0.3141631484, -0.0753204599, 0.0279853977, 0.0826018006, 0.2585153282, 0.7911581397, 0.3671272397, -0.1308147162, 0.1523734331, -0.1912457347, -0.2992331386, -0.144231379, 0.1775326282, -0.1432339549, 0.0846132487, 0.4101112485, -0.064280875, -0.1549714059, 0.3905907869, 0.1574984491, -0.35827443, -0.2313542664, 0.1976916641, 0.5012366772, 0.4747829437, -0.1316248775, -0.1059162319, -0.3632466197, 0.0720394477, 0.0136850327, 0.123083666, 0.136177063, 0.0144164152, 0.2254356891, -0.0582174361, 0.0265034437, -0.0693992972, 0.1189298928, -0.2114750445, 0.2074500918, -0.1068046167, 0.0620143712, 0.0106158555, -0.068467848, -0.2683205605, 0.1802327633, -0.0499181934, 0.1471555233, -0.3356838822, -0.004959479, 0.0384216793, 0.6451609135, 0.3114067912, 0.1609734744, -0.1400149763, -0.1313832402, 0.1271447241, 0.0326536149, 0.023020938, 0.12199229, -0.0616223551, 0.0901369303, -0.1017373353, 0.4083094597, 0.1303039342, -0.2530059814, 0.0655365288, -0.0008750558, -0.2312631905, -0.2843500376, 0.0263557956, -0.0653641075, 0.0867275968, 0.0201111697, 0.2051497102, 0.1149982214, 0.0867083222, 0.4324634075, 0.021424368, 0.4151432812, -0.0994242132, 0.2552133203, -0.0415617228, -0.1355651021, -0.3723389804, 0.1453409195, -0.0185187608, 0.143132478, 0.2540240288, -0.2808763683, 0.5359506607, 0.0414319001, 0.0351258591, 0.0959894508, -0.1034574211, 0.0935245305, -0.2193457037, 0.3652417064, -0.0746772662, 0.0697430521, 0.2229990065, 0.0003277361, -0.1197450384, -0.1145028323, -0.1494787335, -0.1088826954, -0.2668519318, 0.2236600667, -0.1043156236, -0.1133726686, -0.0867221951, 0.0667775646, 0.029100474, -0.3127826154, 0.101702258, 0.0485591292, -0.0921486989, -0.2088677734, 0.6047568321, 0.1654422581, -0.1434137523, -0.3574484587, 0.2727653086, -0.0880974904, 0.1259168237, 0.146576941, 0.07176999, -0.0579959936, -0.1217664704, 0.3233641386, -0.0336218551, -0.1268148869, -0.2349394262, -0.178137809, 0.1438902318, 0.2943352461, 0.1185502484, -0.0268245693, 0.2524351478, 0.0249337889, -0.0260239951, 0.2677816749, -0.0522511899, 0.0685674772, -0.1652990878, -0.2542305887, -0.1006452143, 0.1149616987, 0.0070874938, 0.0217568595, -0.1243228838, 0.0791166276, 0.1917810887, -0.282420814, 0.2072333097, 0.250626862, 0.0283804778, 0.3811194897, 0.1086610109, -0.1813732982, -0.5586459637, 0.199414596, 0.1036453322, 0.2183464319, 0.1075800881, -0.3085535467, -0.2711725831, -0.0610955283, -0.15225631, -0.3668557107, 0.1992109418, 0.0398294851, 0.2403291166, 0.2699041367, -0.210619241, 0.0198989641, -0.1637938619, 0.1998685598, -0.5162342787, 0.2422399074, -0.1443818659, 0.1127642095, 0.2207104117, 0.5053963065, 0.1098284572, 0.0956475288, 0.2538808286, 0.2179432809, -0.2460690737, 0.2443441153, -0.0961793065, 0.1683004498, 0.2036245018, -0.2858157754, 0.0485562533, -0.0938985646, 0.1242397577, -0.1547207087, -0.072682634, 0.3829084337, -0.1319554597, 0.368070662, 0.0671641156, 0.3307342529, 0.1689671576, -0.2372764498, -0.1055499092, -0.2722430527, 0.1091719717, -0.4910505414, 0.1773589253, -0.1322769821, -0.3371235728, 0.1953540444, 0.284811914, 0.0254271328, 0.118290484, -0.2042377293, -0.4753553271, 0.1389714926, 0.1840973943, 0.0435800776, 0.27434057, 0.3023235202, 0.2259212434, 0.0136572309, -0.0735487118, -0.1543085873, 0.1365190148, 0.0112467911, -0.0455767289, 0.1225964427, 0.0138393566, -0.0227477327, -0.1749587059, 0.1751217544, -0.3515152931, 0.2264763266, -0.2688480914, -0.1025940925, -0.1479929388, -0.189160645, 0.0874363407, -0.2197572589, -0.0882475823, -0.365193814, -0.0417303741, -0.1194721833, -0.0319995731, 0.170579046, -0.2978863716, 0.1058903858, -0.1315857172, -0.0018023886, -0.4364799261, -0.1045145392, -0.1432971954, 0.1892445087, -0.0223209709, 0.0549123287, 0.1327006072, -0.2095162123, 0.0066547245, -0.3827696145, -0.4155874848, 0.0275884848, -0.3513257802, 0.0488559231, 0.3115399778, 0.5177797675, -0.1577759832, -0.248232916, 0.4025251567, -0.2532043457, -0.0400606133, 0.1358627826, -0.0422105305, 0.0660643056, -0.1633739322, -0.154583022, -0.1375992596, -0.2262217999, 0.2925012112, -0.0385330096, -0.1350612938, 0.0658269972, 0.0675546676, 0.2127572, -0.2418705374, 0.0338911414, -0.213743329, -0.3011056185, 0.3603345156, -0.2365946174, -0.3118938804, 0.1141380817, -0.2673546076, 0.4330874979, 0.0052812323, -0.3415948153, -0.2719320655, 0.0759830177, 0.1883360744, 0.0712451637, 0.1267052293, 0.4980591238, -0.078017056, 0.0473269001, -0.3099204898, 0.0694152117, -0.1727187634, -0.351726383, 0.2287161201, -0.280821979, 0.255826354, -0.0000864938, 0.2596425116, 0.2716816366, 0.3824597299, 0.3410161734, -0.2625610232, 0.4241217971, -0.0869304985, -0.2107982635, 0.313996315, -0.2213086933, 0.3367095292, 0.3756848276, 0.2335916758, 0.0158643853, -0.2065975964, -0.2852894962, -0.2803177536, -0.2121933103, 0.0474608392, 0.2853035629, 0.4106865525, -0.1406691074, -0.0192022026, -0.1328482926, -0.1860245466, 0.0182930157, 0.4052117467, 0.0905308574, 0.0928513408, -0.3699906468, 0.108380422, -0.5568271279, 0.019875899, -0.1077681333, 0.0017432533, 0.1339832246, -0.144043535, 0.0111702718, -0.0008231699, 0.4261735678, -0.1615867466, -0.3184939027, -0.1017037481, 0.1523299515, -0.4004544616, 0.1023610681, -0.1053799689, -0.3845582306, 0.0582223609, 0.4981090426, -0.2920538187, -0.014146775, 0.5848614573, 0.3693962097, -0.1100340933, -0.1800229847, -0.3422318399, -0.5269815326, -0.2619639337, -0.3119796515, 0.050100781, 0.2887434065, 0.0004592091, 0.0406165197, -0.0858596787, -0.109691754, 0.0057954639, 0.1932649612, 0.3751418591, -0.0855220109, 0.0837986171, 0.3181835711, 0.1286629587, 0.0276871342, 0.4846260548, -0.1169973165, -0.286242485, -0.2341114432, -0.0015347488, 0.3049424291, -0.0503743216, -0.0121489465, 0.2031049877, 0.1640187949, 0.1740401983, -0.2772320211, 0.0653347671, 0.4079396725, 0.0161237679, -0.121190846, -0.3104068041, 0.4774593115, -0.0909734666, 0.2345763296, 0.1480850279, 0.6963044405, -0.1908764839, 0.0257108919, -0.037463218, 0.6728913188, -0.0156474747, 0.2137643397, 0.522844255, 0.1378847361, 0.4920895398, 0.0322050974, 0.1136463732, -0.1365512013, -0.1244292855, -0.0557652935, 0.1319319606, 0.1979289949, -0.2405103147, -0.3001885712, 0.2108464241, 0.1302978545, 0.4815491736, -0.0115636177, -0.0840539113, -0.2299469709, -0.4589119852, -0.2244803309, 0.1763318181, -0.13109456, 0.1835680902, -0.0612321496, 0.0835071653, -0.062018726, -0.2151124179, -0.2962893248, 0.0489888489, -0.1781809777, 0.0015895255, 0.2778373361, -0.3197652698, 0.0429983288, 0.3772464395, 0.2068172693, 0.080854103, -0.3791576922, 0.2942672074, -0.331892252, -0.3013338745, -0.0808050781, 0.0272309482, 0.1504331678, -0.2005127668, -0.3311752677, -0.017572578, -0.1538345814, 0.0748690143, -0.4822946787, -0.0550793037, -0.0164408498, -0.2165942192, -0.1426628381, 0.0882915556, 0.2669073343, -0.3419038653, 0.1730667502, -0.2297581136, -0.0707628429, 0.0559883229, -0.064673081, 0.1425489187, -0.1878100038, 0.1235516965, -0.0277570672, -0.1479177326, 0.5038403869, 0.2157178074, -0.2083936334, -0.1833310723, -0.0420923308, 0.3237202764, -0.3441508412, -0.1837066412, 0.3745027184, 0.0978189111, -0.0480917953, 0.4815379083, 0.0797586739, -0.3061768115, -0.1033127755, -0.2695040703, -0.3904178739, 0.4605472386, 0.0443818867, 0.0814253092, -0.0559591874, 0.4622195363, 0.0489016548, 0.1277225018, -0.3721939027, -0.1049905121, -0.1650710106, 0.0057258513, 0.3218868375, -0.1305426359, 0.2574724555, 0.0498014577, 0.1919074953, 0.0773088485, 0.0629750341, -0.208051905, -0.1677066982, 0.0626082122, 0.0104985796, 0.1252634823, -0.0322179496, 0.2193453908, -0.1892021447, -0.2381413579, 0.3489738107, 0.0091075525, 0.048081845, 0.1124825627, 0.1010194719, 0.1393236369, -0.2098070681, 0.052564241, -0.0510029793, -0.0601738654, -0.0357956253, -0.0229460169, 0.0929100141, -0.0398607254, 0.453470856, 0.2300548702, -0.0618666969, 0.1680836082, 0.4504092038, 0.0778941587, -0.0724390373, -0.0130136721, 0.1794341207, -0.029594101, 0.0005948767, 0.2428058684, 0.2090384513, 0.2586456239, -0.3936883211, -0.0178882126, 0.332626611, 0.0186037198, 0.2908477187, 0.239327088, 0.0945369229, -0.279214263, -0.1221791804, -0.0453508459, 0.5128670931, -0.0647642016, 0.0349018276, 0.3482364416, 0.1782115549, -0.1240449473, 0.0959936604, 0.1547136605, 0.2134791911, 0.0423699506, -0.1238434985, 0.2358172834, -0.4316963851, 0.1954886019, 0.2507396638, -0.2044871897, -0.1044673324, -0.1691029221, -0.040526595, -0.014434889, -0.3837432265, 0.4010227025, 0.0296538621, -0.010831248, -0.1622747034, 0.3016042411, -0.2187896967, -0.1499930322, -0.3768315315, -0.2381188422, 0.2273074239, -0.1794092655, 0.190857619, -0.024698209, 0.0561870262, -0.0710710883, -0.0403260663, -0.1101827994, -0.0587494373, 0.3492383957, 0.1889839619, 0.0533252582, 0.1089643389, 0.6260307431, 0.1344874203, -0.0055443756, 0.0823426545, 0.3404812813, -0.1085738838, 0.2931346297, -0.0031078421, -0.1426033974, -0.1822575927, 0.0227756239, 0.1597886682, 0.2254236341, 0.0273292139, 0.1800416708, 0.1658461988, -0.2506606579, -0.0107027516, -0.3270641565, 0.0899443179, -0.2241418064, -0.1398082376, -0.4170126319, -0.344707638, -0.2472240627, 0.0605843179, -0.5223693252, 0.3943900764, 0.1322870851, 0.069992885, -0.0346824825, 0.0318936296, 0.1035731137, 0.1147836149, 0.475818783, 0.3135996461, 0.0263632685, -0.0811812058, -0.59448874, -0.5643671155, -0.0804431811, -0.3559881151, -0.3042841852, 0.1598598808, 0.0643120408, 0.2171024233, -0.0359671488, -0.020905897, 0.2259671539, -0.0324344486, -0.161032334, -0.2761784196, -0.3786726892, 0.0112645002, -0.0282946732, -0.0162162594, 0.0763000101, 0.1975307167, 0.1973194778, 0.0702493712, -0.0398603007, 0.4521844685, -0.2078344822, -0.4676825404, -0.2300961167, 0.1423253715, 0.2826930881, -0.1948660761, -0.011449255, -0.2692464292, -0.0511220843, -0.1538992971, 0.1939669847, -0.0471215583, 0.4537033141, -0.0226638764, -0.4011213481, -0.0338798314, 0.2450489402, 0.3972957134, 0.0373379961, -0.2113556862, 0.22956568, 0.1738655269, -0.0869548619, 0.2598583102, 0.3310910463, -0.2241021395, 0.0792577043, -0.1126660407, -0.6037772298, 0.4661976695, -0.2314511389, -0.1007009, -0.0388122573, -0.0909452513, 0.0995391309, 0.0423089787, -0.7625929117, 0.1274691224, 0.2277513742, 0.1664810032, 0.0087282211, 0.2390072644, 0.0062221624, -0.0185782537, -0.0361019783, -0.2505778074, 0.1227643639, -0.0009981096, 0.0648503751, -0.0154445991 ]
https://github.com/huggingface/datasets/issues/2129
How to train BERT model with next sentence prediction?
Hi ! We're not using `TextDatasetForNextSentencePrediction` in `datasets`. Although you can probably use the `TextDatasetForNextSentencePrediction.create_examples_from_document` on a dataset to prepare it for next sentence prediction.
Hello. I'm trying to pretrain the BERT model with next sentence prediction. Is there any function that supports next sentence prediction like ` TextDatasetForNextSentencePrediction` of `huggingface/transformers` ?
25
How to train BERT model with next sentence prediction? Hello. I'm trying to pretrain the BERT model with next sentence prediction. Is there any function that supports next sentence prediction like ` TextDatasetForNextSentencePrediction` of `huggingface/transformers` ? Hi ! We're not using `TextDatasetForNextSentencePrediction` in `datasets`. Although you can probably use the `TextDatasetForNextSentencePrediction.create_examples_from_document` on a dataset to prepare it for next sentence prediction.
[ 0.1917074025, -0.4076446891, -0.0147697218, -0.2003291249, 0.0005588923, -0.2783759236, 0.14220649, -0.0127170514, -0.0256619379, 0.1647022069, 0.155600816, 0.0493725315, -0.1548089236, 0.0617541298, 0.3285053968, -0.6952243447, 0.1574009806, 0.2188374996, 0.0097453706, -0.1505313516, -0.117878966, 0.0806166083, -0.4232555926, 0.3682827652, -0.2839280367, 0.200821355, -0.3334323466, -0.3163954616, 0.0460604504, -0.3753813207, 0.4582473934, 0.407034725, 0.4587985575, 0.215074122, -0.0001232347, -0.2639682293, 0.2025313973, -0.2711348832, 0.1549266577, -0.3970155716, -0.2493353486, -0.0373747349, 0.2242990583, -0.1815945506, -0.2838990092, 0.599452436, 0.3069365919, -0.1343755871, 0.5240789056, 0.1173757911, 0.0644793659, -0.2960520089, 0.2634476423, -0.0121572055, 0.1068007648, 0.0945530236, -0.0285037346, -0.1371488273, 0.5605083704, -0.3304394484, -0.214719072, 0.1836274415, 0.0088034272, 0.0330854654, 0.1647520214, 0.233124584, 0.0844852626, -0.3325141072, -0.2616686523, 0.4053134322, 0.6561757326, -0.2457778752, -0.5032139421, -0.1677219272, 0.2668514848, 0.0886336118, 0.0660708919, -0.2455879748, -0.0742207319, 0.172977075, 0.0470757522, -0.375395, -0.4167919755, -0.037332885, -0.189473182, 0.4580945671, -0.0336559638, -0.2123970091, 0.2601469755, -0.2106648237, 0.0755166709, -0.094030425, 0.1235342175, 0.4406598806, -0.2064273953, -0.3648631275, -0.4254555702, 0.1489189863, 0.0206152424, -0.1328348815, -0.1927837729, -0.0155302612, -0.3786576986, -0.1238597482, 0.3669160306, 0.2585486472, -0.148668617, 0.1567351818, -0.2529690564, 0.040198911, -0.2351610065, -0.1876813769, -0.1457652748, 0.0405992568, 0.2635547221, -0.0009321496, -0.2121561915, -0.2638917565, 0.0923201293, -0.0122006517, -0.2975629568, -0.0437658839, -0.0768806413, -0.0495992452, -0.2629685104, 0.3475268483, -0.0341192856, 0.0840815157, 0.0043109283, -0.0952289104, 0.1146304309, -0.2163175493, -0.2744840384, 0.5209568143, 0.0122854784, 0.0309624374, 0.1323939562, -0.1471808702, -0.0324881487, 0.0797840133, -0.3151407838, -0.4305481613, -0.0083034746, -0.1275516748, -0.3998716176, 0.0512891337, -0.1620683819, 0.4676388502, -0.0828438476, -0.0061800051, -0.2025856972, -0.0096683279, -0.0974935666, -0.039380163, -0.0925435126, -0.3396706879, 0.1031368524, 0.5064281821, -0.1084640175, -0.1633832455, 0.1413180083, 0.1575700939, -0.3678389192, 0.1389539093, 0.1589902639, 0.1643916517, -0.492723912, -0.2593483329, 0.0213333145, 0.145570606, 0.1135779321, -0.0017806627, 0.241829738, 0.2236615866, 0.0471892133, 0.1285945624, -0.1216344535, -0.1538397819, 0.0056322068, 0.0265367888, 0.1224368811, 0.3793033957, -0.1333851814, -0.0062226094, 0.0107165016, -0.0767610669, -0.1099486947, 0.1562729031, -0.1232267693, -0.1303876787, 0.2724360824, -0.1773428917, -0.1098017097, -0.0045533478, 0.1601711363, 0.1707353741, -0.2739246786, 0.5601221919, 0.1560772061, -0.0312374942, 0.0705624521, -0.0506205447, 0.1408513188, 0.3964402676, 0.0488681197, -0.3296992183, -0.2331065387, 0.0252211615, 0.0732031465, -0.1738699675, 0.0573340431, 0.1567168832, 0.0682235807, 0.1022697091, -0.0619809926, -0.1537832767, -0.0262000039, 0.0079671256, -0.1567397416, 0.1041980311, -0.3908597827, 0.157205224, 0.1015613228, 0.0780099481, -0.140081659, 0.2063274086, -0.080750227, -0.0708813593, 0.0169517472, 0.1848721951, 0.0469685718, 0.0842282027, 0.1061466038, 0.1018845364, 0.2673930526, 0.1256757528, -0.0165791716, -0.2433179915, 0.0560217202, -0.3695041239, -0.065100342, 0.0415274985, -0.1241790354, -0.072017923, -0.1598880887, 0.0651439801, 0.4588321447, 0.0063851587, -0.0904363841, -0.0213638656, -0.1394983232, 0.0529071838, -0.0706685781, -0.3643363714, 0.1267161369, 0.048170317, 0.2527301908, -0.0866002738, -0.2399298251, -0.4791781902, 0.2228335887, -0.1742819846, 0.1773675233, 0.6320179105, -0.0266933963, 0.0455351174, -0.1115402803, -0.2695043385, -0.03339912, 0.0742162168, -0.0677745566, -0.1553356647, -0.0478102751, 0.0303331874, -0.0855015293, -0.0484032258, 0.1988032907, -0.1507504284, -0.2564576268, 0.1240439564, 0.2082063258, -0.3337570429, -0.1325207204, -0.0418706387, -0.0790852457, -0.0052340701, -0.3815498352, -0.3519107699, -0.0259711817, -0.4334394634, -0.0323949195, 0.2949761152, -0.0653684288, -0.4361503422, 0.1682780534, -0.0546022505, 0.0482199341, 0.3473086357, 0.1947134435, 0.2138709873, -0.2305921018, -0.1608905196, -0.0018190914, 0.0149622113, -0.1995004565, -0.1814264357, -0.3212388754, -0.0026159361, 0.0561577901, -0.1347341537, -0.225050658, 0.3262953162, -0.1361163855, 0.0319763646, 0.2602565289, -0.1232944429, -0.1476176381, 0.0506940447, -0.0717643648, -0.0051314458, -0.0586236194, -0.177061528, 0.2005545795, 0.1248714924, 0.2681865096, -0.0115817264, -0.2322617471, 0.3484323919, 0.257488966, 0.1877580285, -0.0506632775, -0.0934296399, -0.0130331479, 0.1530902535, -0.3353317678, -0.1277407408, 0.1583464593, -0.6027777195, 0.188377589, 0.169508338, 0.0336444825, -0.3637563884, -0.0378945097, -0.1281222552, -0.3695199192, -0.0321029201, -0.230846554, 0.0703086779, -0.112763226, -0.098111853, -0.17995134, -0.0321075432, 0.1058508232, 0.1223225072, -0.1785275042, -0.0347804725, 0.3163147569, -0.0391906798, 0.3434462845, 0.0593000539, 0.0938183963, -0.2042818666, 0.4010344744, 0.103216961, -0.2929143012, 0.3866355717, 0.2231462598, -0.1186929569, -0.0734551996, 0.0201250389, 0.0247446336, 0.0631078556, 0.0930064321, 0.4289288521, -0.115006119, 0.0435723811, -0.1596845388, -0.1794786155, 0.0603451654, -0.0714287013, 0.0728940442, -0.2532199621, 0.2317321301, -0.235570088, -0.1013941392, 0.0414575785, -0.1059640646, -0.0669276342, 0.0172647014, 0.7841861248, -0.1106735542, 0.6015790701, -0.101055555, -0.3486660123, -0.0605148226, 0.2454377115, -0.060160324, -0.1274957955, 0.2383758575, -0.0657187402, 0.121370703, -0.0068477392, -0.0616918951, -0.0566114262, -0.0942692757, -0.3269928098, 0.3027221262, 0.165155232, -0.3013948202, -0.3171465397, 0.1521593481, 0.2069493085, 0.1803200692, -0.1959772706, 0.2799462676, 0.0934668556, -0.1397624463, -0.5285358429, 0.043103382, 0.8037561178, -0.1165575832, 0.0836319253, -0.0647990406, -0.2123403847, 0.0651604459, -0.2847045064, 0.2285284251, 0.1364205927, -0.0540829524, 0.0294558704, -0.0028117746, -0.2884872258, 0.0143230259, 0.3151857853, 0.096236974, 0.2423917651, -0.2252095938, -0.0160931908, -0.2057077438, 0.1425428092, 0.1346215904, 0.4665712118, -0.1037179083, 0.1235331222, 0.4220384359, 0.0214606896, -0.0144516714, -0.1236789674, -0.1614878774, 0.6815997362, 0.3218708932, -0.29976964, -0.2854649127, 0.5634608865, -0.1164378002, -0.2301307917, -0.4375351965, 0.6853528023, -0.3285283744, 0.2281906009, 0.5515838265, 0.7926325798, -0.0096532106, 0.2065886259, -0.3263477087, 0.140492335, 0.5958321691, -0.1239840835, -0.1427015215, 0.033023715, 0.2338632643, -0.3432450294, 0.2214525044, 0.0697832108, 0.2556040287, -0.7860977054, 0.3353567123, 0.1801727414, -0.1527986825, 0.1167708263, -0.0082782358, 0.3885196745, -0.4617993534, -0.0048258398, -0.0076272413, 0.153249234, 0.1993296891, -0.185435921, -0.0329361223, 0.5668461323, 0.1171776801, -0.4333470166, 0.0316883847, -0.258307904, -0.3672168255, 0.07527785, -0.0096675307, 0.7311247587, 0.4217284322, 0.6386287212, 0.2278711796, -0.2766389549, -0.0145206898, 0.1028058678, -0.0718985945, -0.3596813977, -0.0008186996, 0.4709010124, -0.1251449585, -0.3809984326, 0.2287145704, 0.0857180208, -0.268483758, -0.1642095447, -0.2814654708, 0.5577853322, 0.0331194624, 0.0293630809, -0.0116130412, 0.1737588644, -0.1102287248, 0.0694146678, 0.151099354, -0.1651632488, 0.0612508133, 0.2021572292, -0.3422723114, -0.0281579085, 0.0646880791, 0.0919552594, -0.0822278857, 0.5879971385, 0.2623742521, 0.0200400874, -0.1871556193, -0.0087567568, 0.2483518422, -0.1598693877, 0.1676204503, 0.091922611, 0.1605501026, 0.1754571646, 0.6059981585, 0.2905308604, -0.2866262794, -0.2481626868, -0.0358545706, -0.2740084827, -0.1466107666, -0.17257303, 0.1570883244, 0.2134370059, 0.0523276143, 0.4901929796, 0.4139157832, -0.1262049079, -0.2374564707, -0.2027714252, 0.1641661525, 0.082670033, 0.0243982971, -0.1380999237, 0.0424455926, -0.0397879183, 0.2467682809, 0.3000512719, -0.0380168594, -0.1571830511, 0.1104030982, 0.0027837977, 0.0456356108, -0.1846472621, 0.1091513783, -0.0080507807, -0.0272237435, -0.1992295384, 0.0547469556, 0.3115118146, 0.4729120135, 0.430744648, -0.1541299224, -0.3780578971, -0.2686290443, 0.2248029858, 0.047078196, -0.0866401941, -0.0844638348, 0.0088332593, -0.1457203925, 0.0360586531, 0.191205129, 0.5139394403, 0.1459177434, 0.065267846, 0.0956190825, -0.0993865356, -0.1315357834, 0.0460899621, -0.1848788261, 0.1676027477, -0.3008452952, 0.5770236254, 0.0201424807, -0.2226298749, 0.0027384944, 0.0728141069, 0.1160577387, -0.0762044266, 0.0138386637, -0.1462630332, 0.3463765383, 0.3239389956, -0.1283791214, -0.3920297027, 0.2033096999, 0.0426398255, 0.4159963727, 0.2745645344, 0.189227283, 0.2468419969, 0.2012284845, 0.4515759945, 0.5087415576, -0.1123405844, 0.0888399631, -0.2122876197, 0.2115273476, 0.5340948105, -0.1541143954, -0.1312070489, 0.0304424763, -0.012415126, 0.1880622357, -0.011750102, 0.5242722034, 0.2115654647, -0.182155624, -0.3017668426, 0.1600119174, 0.0822910145, -0.4470412433, -0.1828812957, 0.1288454235, 0.2121818066, -0.0828194991, -0.0785349682, 0.0438897647, 0.1241261363, 0.2909133434, 0.335518539, -0.1258832514, -0.0707313567, 0.0368156768, 0.3359085321, -0.0366838053, 0.3192496896, -0.1124020964, 0.1083971262, 0.0926403254, 0.4123353362, -0.0832279772, 0.1506922543, -0.1259785742, 0.146182552, -0.073250711, -0.0132193789, 0.3068971038, 0.0166674927, 0.1719354093, -0.0788675994, 0.3082799315, -0.0208634902, 0.0020847023, 0.3156617582, 0.0452643111, 0.3824549913, -0.3345516026, 0.147863254, 0.3477675617, 0.3879691362, -0.4021083713, 0.3009828925, -0.4886257648, 0.4765600562, -0.3405270278, -0.3245192468, -0.1606908143, 0.2350731194, -0.0235533938, 0.06137361, 0.4114911854, 0.5823989511, 0.2130088508, -0.0491892323, -0.2652748227, -0.1193494052, -0.1415774822, 0.0590274408, 0.0451790318, 0.0604437031, -0.2913479507, -0.0414709263, 0.0329304188, -0.0440396443, 0.0037749894, -0.6597329974, 0.2102499306, -0.2647414505, -0.0164888687, -0.0986362323, 0.2552070618, -0.0948322266, 0.2848756313, 0.0068676062, 0.2559462488, -0.1820855439, 0.2368065119, 0.066424787, -0.1656372845, 0.1881762743, 0.1926780045, -0.198017329, 0.1864914745, -0.1682224274, 0.363827467, 0.0152521869, 0.0624063015, -0.2151350826, -0.2940661609, 0.170227319, 0.2356834263, -0.1999233365, 0.2335376143, -0.0017078072, -0.1841317564, 0.103658855, -0.0436889231, -0.5682259202, 0.0535765812, 0.1174617559, -0.2165208906, 0.1294321418, 0.1187784895, -0.158774361, -0.0105823539, -0.3842245936, 0.0522069857, 0.3020172119, -0.0924396589, -0.1122984365, -0.3752430677, -0.3578151464, 0.2979229391, -0.2171182334, -1.1201760769, 0.148817867, 0.3090507686, 0.3505094051, -0.1097137481, 0.2135538012, 0.1350745559, 0.1876413375, -0.3854334354, 0.5604230165, 0.342128098, 0.0988508984, -0.3323816359, -0.2206932157 ]
https://github.com/huggingface/datasets/issues/2129
How to train BERT model with next sentence prediction?
Thanks. Do you mean that `TextDatasetForNextSentencePrediction.create_exapmles_from_document` can be applied to dataset object other than `TextDatasetForNextSentencePrediction` e.g. a `Dataset` object which is loaded by `datasets.load_dataset`?
Hello. I'm trying to pretrain the BERT model with next sentence prediction. Is there any function that supports next sentence prediction like ` TextDatasetForNextSentencePrediction` of `huggingface/transformers` ?
24
How to train BERT model with next sentence prediction? Hello. I'm trying to pretrain the BERT model with next sentence prediction. Is there any function that supports next sentence prediction like ` TextDatasetForNextSentencePrediction` of `huggingface/transformers` ? Thanks. Do you mean that `TextDatasetForNextSentencePrediction.create_exapmles_from_document` can be applied to dataset object other than `TextDatasetForNextSentencePrediction` e.g. a `Dataset` object which is loaded by `datasets.load_dataset`?
[ 0.1056431085, -0.4607718885, 0.0155631527, -0.0898424536, 0.0474330634, -0.2899063826, 0.1532110274, -0.0051717898, 0.0640041977, 0.1214189529, 0.1853310466, 0.1281925887, -0.1547517031, 0.1282218695, 0.3845978677, -0.6245180964, 0.1314672828, 0.2932184637, -0.051488284, -0.2433329821, -0.1696442962, 0.0733771548, -0.3516559601, 0.3405377269, -0.2001277655, 0.2702140808, -0.2841585875, -0.2478069961, 0.0087695755, -0.3340135217, 0.4047502875, 0.3907678127, 0.425832212, 0.1643715352, -0.0001291847, -0.2329466939, 0.1147397757, -0.3273887634, 0.1137859225, -0.2843591571, -0.3555466533, -0.1060970873, 0.26434201, -0.2460020185, -0.2422991544, 0.5384495854, 0.3581977189, -0.3058196902, 0.5242073536, 0.2908452451, 0.0144021362, -0.2546211183, 0.3124651313, -0.020818457, 0.2348682135, 0.1671462357, -0.0251937062, -0.2216220945, 0.5485688448, -0.2986631095, -0.1138823181, 0.144274056, -0.0018346235, 0.0014027897, 0.2522636354, 0.228170678, 0.1782480627, -0.4217780828, -0.1953307539, 0.3760997355, 0.8002334237, -0.3221178651, -0.4739652574, -0.2419865578, 0.337128371, 0.0954878777, 0.125540629, -0.3030331731, -0.1238538027, 0.1631257087, 0.0612538308, -0.5166053176, -0.4674111605, -0.000579793, -0.1490330398, 0.4557169974, 0.0035354495, -0.1510751247, 0.2814889252, -0.1666588187, 0.0924607068, -0.0972436816, 0.0533189289, 0.4821874201, -0.1632687151, -0.3454051018, -0.4761658013, 0.0677621141, 0.0529342219, -0.0808995962, -0.1527081728, -0.0065810811, -0.3215613961, -0.0709304363, 0.3516065478, 0.2880747616, -0.0382886305, 0.191459924, -0.2848032415, 0.0197164342, -0.268178165, -0.1537957937, -0.2019641101, 0.0399127714, 0.2256611139, -0.0506860912, -0.2289216518, -0.2590070963, 0.0584816784, 0.0120566264, -0.337500751, -0.0117461942, -0.0488630161, -0.0032533407, -0.1972687542, 0.3654837608, 0.0605770051, 0.1042162403, -0.0432595983, -0.1118824482, 0.1542613059, -0.1464898884, -0.3213077188, 0.5611476898, 0.0152225047, 0.0879945606, 0.1360873878, -0.2572858632, -0.0913070813, 0.0353684425, -0.2435014695, -0.4149813652, -0.0002138801, -0.0694690049, -0.3622318804, 0.0641428679, -0.1449040771, 0.4078871906, -0.1863525808, 0.0402225703, -0.1744340807, -0.0844529346, -0.1815865487, -0.0750281587, -0.0413933732, -0.2907973528, 0.0477496833, 0.5946678519, -0.0108277872, -0.203938663, 0.2527198195, 0.0989335403, -0.463622719, 0.1473244727, 0.1507646441, 0.2339983284, -0.5984506011, -0.3204488158, -0.135089159, -0.0203734897, 0.0243381951, -0.1360593736, 0.2206615508, 0.355230242, 0.0420455262, 0.1495950818, -0.1622885615, -0.2258409858, -0.0467958115, 0.0574621893, 0.1385164708, 0.3321614265, 0.0013425797, 0.0143065564, 0.1212001145, -0.0726610646, -0.1335148364, 0.1792030185, -0.0856365263, -0.1414665729, 0.3205605745, -0.138438642, -0.2136107683, 0.03851033, 0.2292425334, 0.2022789866, -0.2451475412, 0.5747002959, 0.1156555563, -0.1170087457, 0.1535996199, 0.0178290904, 0.0713088885, 0.41000247, 0.0239030607, -0.3240315914, -0.3736847341, -0.0477181636, 0.0286676884, -0.1072703749, 0.1274759173, 0.1054650545, 0.0121551864, 0.1328710467, -0.0856344551, -0.1218088865, -0.0996614024, 0.0531058498, -0.1422733516, 0.0766889006, -0.3936299086, 0.186878562, 0.1223070472, 0.109206751, -0.1749435961, 0.1587535739, 0.0218496602, -0.0378622338, -0.0522039086, 0.1195596159, -0.0094302949, 0.1290658414, 0.0670818239, 0.0998979658, 0.2876984775, 0.1083296239, -0.0522973649, -0.0948842913, 0.0758773685, -0.3679949641, -0.0043352656, 0.0837581009, -0.0230586026, -0.0889419466, -0.0869563967, 0.091665715, 0.5599460006, -0.0662255511, 0.0157280415, -0.0259141512, -0.1526128054, 0.0673016757, -0.0987568498, -0.4773170054, 0.0501065291, 0.1455092877, 0.3399931788, -0.122624062, -0.1897746921, -0.4507784545, 0.2656004429, -0.12634857, 0.2417238057, 0.6629157066, -0.0783077702, -0.0234729685, -0.1915442199, -0.3000424504, 0.070190616, 0.0617020801, -0.0527051389, -0.0462214649, 0.0219265185, 0.0213556588, 0.0432410836, -0.0637597144, 0.2537961304, -0.0874788463, -0.3057599962, 0.0475675538, 0.1360558569, -0.3302099705, -0.1117596254, -0.0098609943, -0.1607448012, 0.0375851914, -0.2359710634, -0.2540567219, -0.1496948451, -0.4255622923, -0.0812165514, 0.3417153955, -0.003580003, -0.3079099953, 0.1087583303, -0.0709211677, 0.0714119077, 0.4477213621, 0.1611573398, 0.1817817837, -0.2483633161, -0.1266451925, -0.0054877363, -0.0562204532, -0.1853320152, -0.1140362918, -0.27348876, -0.00502453, 0.0911664367, -0.1832858026, -0.2373601794, 0.2947243452, -0.1008457243, 0.0405862778, 0.3184699118, -0.2300726175, -0.1163908914, -0.0433316752, -0.0805318803, -0.0763997212, -0.1201318651, -0.325927645, 0.1578610241, 0.1687267274, 0.2795045972, -0.0727306753, -0.2464630008, 0.2916786373, 0.222822547, 0.2209521234, 0.0110417008, -0.1808914095, -0.043218106, 0.1967172325, -0.2912326753, -0.0663996562, 0.1601239443, -0.5610359907, 0.1195916831, 0.0951547176, 0.0408796221, -0.4551676214, -0.0261341259, -0.1833865643, -0.2468455434, -0.1003962457, -0.2364135385, 0.0273857694, -0.2666939199, -0.0847501308, -0.071129024, 0.1564665288, 0.136282295, 0.1602433324, -0.1897274852, -0.1324952096, 0.4403705895, -0.0629497319, 0.2673966289, -0.0151512567, 0.0811429322, -0.2939188182, 0.3493480086, 0.0586958975, -0.2686466575, 0.4846494496, 0.2132167965, -0.0882053971, -0.1651720852, -0.0161854289, -0.0867069513, 0.0082971826, 0.0832562819, 0.4489498138, -0.1140030175, -0.0129829943, -0.2246314883, -0.2117000818, -0.0043845475, -0.0787048489, 0.0240182336, -0.2155965865, 0.2518777251, -0.2402085662, -0.0373712257, -0.0661786273, -0.0609554015, -0.0766061842, -0.0004377253, 0.7021430731, -0.2040723264, 0.4300754666, -0.152326569, -0.3472483754, 0.043621283, 0.2906056345, -0.0336055309, -0.1176430061, 0.1695073545, -0.0170065239, 0.1150398105, 0.1491368264, -0.1024863273, -0.1103023142, -0.0607237779, -0.3613395095, 0.3181831837, 0.1899961829, -0.2744685709, -0.3287585378, 0.1643836796, 0.2621645629, 0.0494753569, -0.1573310196, 0.2379764766, 0.0778617412, -0.1574309617, -0.4162980318, 0.1044442803, 0.6891821027, -0.148759231, 0.1067000553, -0.1123586893, -0.1162265614, 0.1644565165, -0.1982580274, 0.0921161324, 0.1108337492, -0.0500882007, 0.0315723084, -0.0258046612, -0.2509805858, 0.0666439384, 0.2289299071, 0.1841467768, 0.3121166825, -0.1100037247, -0.1405962259, -0.2539542913, 0.0768572092, 0.1306899637, 0.5098467469, 0.0191490613, 0.1812544465, 0.3650158048, 0.0297455676, -0.0710017234, -0.1195958257, -0.0747352391, 0.659529984, 0.2114692032, -0.3762812912, -0.3568401039, 0.5436474681, -0.0196713768, -0.2051058114, -0.2914200127, 0.6835461259, -0.4077723026, 0.25349769, 0.5497311354, 0.9744485617, -0.037459217, 0.2863143682, -0.2648162246, 0.1990036666, 0.569748044, -0.1444057822, -0.0742440075, -0.0938631296, 0.1445076317, -0.3599351943, 0.1986394525, 0.1488522887, 0.3245764673, -0.707269311, 0.2890153527, 0.1858673692, -0.0824413151, 0.0933628455, 0.0756098852, 0.3367233276, -0.5600146651, -0.1659634262, -0.08314538, 0.1920497268, 0.1824830472, -0.1349287927, -0.0879467428, 0.5826051235, -0.0210050344, -0.4990071356, 0.0452834591, -0.2814258039, -0.2888809443, 0.0005387552, -0.0347597227, 0.6878590584, 0.3567860723, 0.6128687263, 0.2255892754, -0.2492447793, -0.0071976176, 0.1721434891, -0.1504904479, -0.2652728856, -0.076486215, 0.5720116496, -0.1382043064, -0.3254818618, 0.279530853, 0.101545617, -0.3372759223, -0.0818869099, -0.3989436328, 0.584271431, -0.0144155435, -0.123987183, 0.0598438866, 0.1022563279, -0.19709149, 0.0016730386, 0.0871963799, -0.1682987213, 0.1306880116, 0.1620143354, -0.3973868489, -0.0814886689, 0.1589449346, 0.093204163, -0.0849236101, 0.6222243309, 0.2137707919, 0.0519976541, -0.2164437026, 0.0564526767, 0.3421689272, -0.3368004858, 0.2119739205, 0.1599099934, -0.020100683, 0.1936510503, 0.5828648806, 0.2529813051, -0.1969831884, -0.2264261544, -0.1262503266, -0.2213072926, -0.1293240637, -0.1437804252, 0.2000529021, 0.2188763022, 0.0399120897, 0.4216787219, 0.3823932409, -0.0677025765, -0.2510088682, -0.1276620775, 0.1136753261, 0.2548125684, 0.1491667628, -0.0394454375, 0.098188974, -0.0617552102, 0.2860830426, 0.2141279876, 0.0348788723, -0.1573131979, 0.2046242654, 0.0016037747, 0.0094382949, -0.17038697, -0.0169739947, -0.1362682879, -0.11412476, -0.1313112378, 0.0985912085, 0.2123114169, 0.4492027164, 0.3921930194, -0.0584695712, -0.2855449319, -0.1886837482, 0.2176956236, 0.0627678931, -0.0851582438, -0.0332637131, -0.0541751534, -0.1285974532, -0.0343863666, 0.2448505461, 0.555109024, 0.1981612742, 0.1298581958, 0.156327337, -0.1594552696, -0.0969206542, 0.0731715858, -0.0511521399, 0.1640902907, -0.2559707165, 0.592289567, -0.0524083748, -0.2567975521, -0.0770828649, 0.1780082881, -0.0581966788, -0.0812221393, 0.0298101306, -0.1027335823, 0.3521800637, 0.2211386859, -0.1163536906, -0.4240362048, 0.281340152, 0.0834193751, 0.5365973711, 0.2504787445, 0.1899953485, 0.1743188351, 0.3043943048, 0.5802149177, 0.5396012664, -0.0946697295, 0.1569248438, -0.1880415976, 0.2627657056, 0.5272644162, -0.1657826304, -0.04900942, 0.0662340596, 0.0509970523, 0.1888044626, 0.0240653008, 0.4067956209, 0.1684360206, -0.1346405298, -0.4231343269, 0.2094095349, 0.1448746771, -0.4133071601, -0.1138604954, 0.0826576352, 0.2206774503, -0.0743777901, -0.1168400049, 0.0290400833, 0.1580928415, 0.2191919982, 0.3983958066, -0.0463252887, -0.0783950984, -0.054713957, 0.2943124473, -0.0852541327, 0.2956567407, -0.2421525568, 0.1789082438, 0.1489419639, 0.4170615971, -0.1188829392, 0.2679031491, -0.15685004, 0.087733686, -0.1292560399, 0.0478325114, 0.1877612472, 0.0604901873, 0.232423231, -0.0659113452, 0.3413059711, -0.0977268815, 0.0566997044, 0.2536100447, 0.1228325963, 0.3264484406, -0.2582112253, 0.2013040781, 0.3605729342, 0.3606326282, -0.382997334, 0.3268385828, -0.4427745342, 0.3775325716, -0.2477122396, -0.2968664467, -0.1504549682, 0.229105249, -0.0632222965, 0.0447388291, 0.4278224707, 0.5208463669, 0.2311285883, -0.057415273, -0.2300028205, -0.2174290717, -0.0294764414, 0.1514999866, -0.1182576716, 0.0844169855, -0.2819283903, 0.0597908683, 0.0168074034, 0.0466316752, 0.0233678706, -0.5602834225, 0.1847175211, -0.15491651, 0.0030541541, -0.1352069378, 0.3056131303, -0.0823097229, 0.0896473229, -0.0146750286, 0.2100077868, -0.2170940936, 0.1330137402, 0.0821463168, -0.1845584959, 0.2250218689, 0.285187304, -0.1943354607, 0.2990403473, -0.2385919392, 0.3976639211, 0.0766033679, 0.0586294755, -0.3067618608, -0.1804478168, 0.3098558486, 0.1983599067, -0.2711745203, 0.2806541324, -0.0728110746, -0.1415167749, 0.1355857253, 0.0400569327, -0.601218164, 0.1438584924, 0.0292282552, -0.2243854403, 0.1326211244, 0.1417183578, -0.1705305576, -0.0256200284, -0.3078811467, 0.0602426231, 0.3240750432, -0.1584218442, -0.1222108155, -0.3839443624, -0.2924032211, 0.2498102784, -0.3335629404, -1.1292831898, 0.158637166, 0.340526998, 0.2833713293, -0.2243622541, 0.1930169761, 0.0710290074, 0.1255244017, -0.356533587, 0.5560404658, 0.2431779057, 0.1063829362, -0.3350407481, -0.2991439104 ]
https://github.com/huggingface/datasets/issues/2129
How to train BERT model with next sentence prediction?
It would probably require a bit of tweaking, but you can apply it to a dataset, yes. This should give you a new dataset with sentence pairs you can train a model on. You can find the documentation about dataset processing here: https://huggingface.co./docs/datasets/processing.html#processing-data-with-map
Hello. I'm trying to pretrain the BERT model with next sentence prediction. Is there any function that supports next sentence prediction like ` TextDatasetForNextSentencePrediction` of `huggingface/transformers` ?
43
How to train BERT model with next sentence prediction? Hello. I'm trying to pretrain the BERT model with next sentence prediction. Is there any function that supports next sentence prediction like ` TextDatasetForNextSentencePrediction` of `huggingface/transformers` ? It would probably require a bit of tweaking, but you can apply it to a dataset, yes. This should give you a new dataset with sentence pairs you can train a model on. You can find the documentation about dataset processing here: https://huggingface.co./docs/datasets/processing.html#processing-data-with-map
[ 0.2216069996, -0.4078704119, 0.0245912373, -0.124258846, 0.0343490019, -0.1844582856, 0.0904133171, 0.022120297, -0.0510084108, 0.003879264, 0.032925874, 0.0937431008, -0.1882502735, 0.1736753881, 0.3407393396, -0.6513746977, 0.1297620088, 0.1553864628, -0.0457979515, -0.0744867474, -0.0303961895, 0.1138738096, -0.2975051403, 0.386628896, -0.2856274843, 0.1675775796, -0.3479518592, -0.1773995459, 0.0666725263, -0.295129329, 0.4142341614, 0.4732447863, 0.4460684657, 0.2521962225, -0.0001230383, -0.2152749002, 0.1302852035, -0.3177435994, 0.2301829904, -0.4261968136, -0.2667487264, 0.0393677354, 0.2027442902, -0.1260905117, -0.3113479912, 0.5966160297, 0.2558299303, -0.2117689401, 0.6537804008, 0.0716561824, 0.045186881, -0.1689052284, 0.2814645171, -0.0095189512, 0.1461715698, 0.1682043076, 0.0512080342, -0.0751748756, 0.6243175268, -0.3600691557, -0.2291105092, 0.1985411346, 0.0063696876, -0.0540353134, 0.2797684371, 0.2602437437, -0.0144231357, -0.3843039572, -0.2895088494, 0.4200863838, 0.5511061549, -0.3132857978, -0.4524233639, -0.2447675169, 0.2225975841, 0.1461896002, 0.0692785159, -0.2382966876, -0.1358790845, 0.2170274258, 0.0773825794, -0.4006279409, -0.3453341722, -0.0312483981, -0.1051408648, 0.3863506317, -0.0517029464, -0.1975741088, 0.3232113421, -0.1545150578, -0.0387741551, -0.0306088198, 0.0835929215, 0.5048014522, -0.2043060809, -0.4376603365, -0.3445558846, 0.2067998797, 0.0553344041, -0.1207952797, -0.2273677438, 0.0705551356, -0.4263333082, -0.1015721336, 0.4228079617, 0.2061457038, -0.0779851452, 0.1655610502, -0.2637425661, 0.0322182588, -0.2298647165, -0.1523412317, -0.0986557007, 0.02673259, 0.0893842131, -0.0812664628, -0.2630627751, -0.246957913, 0.1177516133, -0.0168833844, -0.253095448, -0.0311102234, -0.0024539474, -0.0078826956, -0.2393767834, 0.3082725108, 0.0032432824, 0.1589821279, -0.027388908, -0.0793849975, 0.1286915243, -0.2796346545, -0.2976552248, 0.5216558576, -0.0006238893, 0.0101390928, 0.1354132593, -0.1380978823, -0.0575403273, 0.0933880582, -0.3288876712, -0.3122949004, -0.1033509225, -0.1362433732, -0.402810812, 0.1046487615, -0.0766846314, 0.4250040054, -0.0973896608, -0.0141921248, -0.2520746589, -0.0286159441, -0.1406523287, -0.0588147268, -0.1818670332, -0.3151634634, 0.1049208343, 0.5339117646, -0.048067607, -0.2282015234, 0.082286343, 0.2302293777, -0.4096051157, 0.1246808022, 0.1977959573, 0.2521820664, -0.4910139441, -0.3078063428, 0.0736437067, 0.1320022047, 0.0859720036, 0.0172372311, 0.1739121228, 0.1844779998, 0.0657803193, 0.1815823019, -0.1284926236, -0.124184981, 0.0365562737, 0.0787440687, 0.0417458266, 0.4049215615, -0.1343841106, 0.0324973688, 0.0313706025, -0.1705058515, -0.0235560723, 0.114654094, -0.1572641283, -0.1915020049, 0.1869985461, -0.1793526709, -0.0607710108, -0.0713657737, 0.0958516151, 0.2079957724, -0.3159269094, 0.5599301457, 0.1924263984, -0.0377028361, 0.0784756616, 0.0126637183, 0.0805471539, 0.4914737344, -0.004199557, -0.3462730646, -0.1972343326, 0.0738095045, -0.0434003845, -0.086188443, 0.0072637647, 0.0966251791, 0.02378143, 0.0962054431, -0.0591678508, -0.2067827582, -0.0411679298, -0.1293236315, -0.1154086739, 0.0758731887, -0.3743760586, 0.1479422003, 0.1461744756, 0.1246054769, -0.1697933674, 0.2056622803, -0.0149310604, -0.0443591699, -0.0572471879, 0.1798473001, 0.0025716266, 0.0809474438, 0.1336022615, 0.1328282654, 0.1827091277, 0.1997075677, 0.0009615293, -0.1804952621, 0.1244326681, -0.3619663715, -0.1211432293, 0.0214709118, -0.1050131246, -0.1291609406, -0.131561473, 0.1197170764, 0.4141704738, 0.0427777618, -0.1037673056, 0.013847366, -0.1520472765, 0.0279946774, -0.0964471698, -0.3477112055, 0.0861942545, 0.0540063977, 0.2589621544, -0.0506211445, -0.1999682039, -0.3999043107, 0.2041915208, -0.0999376774, 0.0958665833, 0.6327775121, -0.1422078311, 0.0661652535, -0.1307599396, -0.2718038857, -0.0148978382, 0.1047481298, -0.0653659105, -0.0913265049, -0.0169510022, 0.0341923498, -0.1671376973, 0.0311098769, 0.190568462, -0.2052600831, -0.2006826252, 0.1428111792, 0.209374696, -0.2070283592, -0.1485773921, -0.0194255412, -0.1435664445, 0.0612081289, -0.3151902556, -0.4285088181, -0.1279740334, -0.4911923409, -0.1034006327, 0.258275032, -0.0149433399, -0.3871538341, 0.1514903158, -0.0499116369, 0.151023373, 0.2841982841, 0.1946392357, 0.1277811378, -0.2070505917, -0.2238792032, 0.0237688646, 0.0494992584, -0.0592210852, -0.1773700118, -0.2605480254, -0.0906508714, -0.0399957225, -0.0956392884, -0.3120402396, 0.2897359133, -0.2499189377, 0.1297584921, 0.2941757441, -0.0759725422, -0.2079922557, 0.0435943864, -0.018634038, -0.0096071735, -0.0767074525, -0.2290387899, 0.2426134646, 0.2458163649, 0.1850923598, -0.0338906571, -0.2169886976, 0.3477906287, 0.3525300324, 0.144489646, -0.0369677059, -0.1149629802, 0.0262420475, 0.1613726616, -0.3884994388, -0.1641852111, 0.1081549674, -0.5920631886, 0.1830577403, 0.1576793492, -0.0129235536, -0.3662765026, 0.0132031813, -0.1370262206, -0.3882234097, -0.0276669115, -0.3468875885, 0.0962838978, -0.0810800344, -0.0687435716, -0.1157949716, 0.0456659868, 0.1158962548, 0.143484056, -0.176722765, 0.0795532167, 0.3418135941, -0.0882981718, 0.3423989713, 0.0596095733, 0.125282675, -0.1889260113, 0.4627276659, 0.1235031709, -0.2810500264, 0.3817257285, 0.174273476, -0.015312016, -0.1077783033, -0.0047322623, -0.0573108792, -0.058473967, 0.1513928324, 0.3700023592, 0.0191864111, 0.055875659, -0.1386032403, -0.1250241399, 0.0858010352, -0.136790961, 0.0801762938, -0.2657973468, 0.151485458, -0.1907015145, -0.1260729134, 0.0377776176, -0.1597578973, -0.0473717079, -0.0175880454, 0.7697458863, -0.1035645381, 0.5713798404, -0.0400642902, -0.4635262489, -0.0110368505, 0.3162867725, -0.1676736176, -0.1123737693, 0.1219647303, 0.0061178915, 0.171280697, 0.1437923312, 0.0257676858, -0.0948603451, -0.1573240161, -0.3071126342, 0.2070151269, 0.2726222277, -0.2748068571, -0.3259217441, 0.2437616885, 0.221295163, 0.1280034184, -0.1737731397, 0.2057462633, 0.0735682547, -0.0985618308, -0.463093698, 0.0339650661, 0.7298445106, -0.1961897314, 0.0703770593, 0.0374594033, -0.1456702352, 0.1276287735, -0.2202308923, 0.2877979577, 0.0883475542, 0.0621095859, 0.0453330129, -0.0263221506, -0.2703907788, 0.0158028305, 0.3881343007, 0.0416402742, 0.1126371101, -0.0956167728, -0.00248273, -0.2261901349, 0.0859417245, 0.133931309, 0.4489897788, -0.0524887592, 0.1700173467, 0.4762186706, 0.0810796395, -0.0187654309, -0.2345956862, -0.0024604648, 0.6682594419, 0.3292626143, -0.4029556215, -0.2895731926, 0.5090531111, -0.1143746674, -0.2380092889, -0.4068029523, 0.6209008098, -0.3231638074, 0.1940324903, 0.4422949553, 0.8429120779, -0.0886932313, 0.3112944365, -0.3545755148, 0.062465623, 0.7213711143, -0.1341115236, -0.1559298635, 0.0058308467, 0.2178888917, -0.3336974978, 0.2488537431, 0.0343312435, 0.219434157, -0.6571429968, 0.3025608957, 0.1946094781, 0.0111525459, 0.1594285965, -0.0642631799, 0.4093569517, -0.4654173851, -0.0820050016, -0.0213495102, 0.1665688902, 0.2705446482, -0.1455816627, -0.1580580175, 0.4408816099, 0.0572812557, -0.5037372112, -0.0270971544, -0.2786694467, -0.4037695825, 0.0886405408, 0.0015836954, 0.6850597858, 0.42003721, 0.5400066376, 0.296240747, -0.358351022, -0.0038297484, 0.0752430931, -0.0949679017, -0.2911289036, -0.0247937124, 0.5104462504, -0.1082376093, -0.3413868845, 0.2263131887, 0.0795210674, -0.3061782122, -0.2628551126, -0.243548274, 0.5197246075, -0.0082628392, -0.0014376193, 0.0698677301, 0.1954889894, -0.1484986842, 0.056469433, 0.1474276483, -0.2316267192, 0.0120890513, 0.1262308508, -0.2625082731, -0.0406862311, 0.1699936688, 0.0744206011, -0.1156330779, 0.5515827537, 0.3813835979, 0.0235722512, -0.1429360807, -0.0415316448, 0.2874450088, -0.3117373586, 0.1730520427, 0.1424447447, 0.1089017391, 0.1196544617, 0.5604646802, 0.3167200089, -0.2096675038, -0.1709754914, -0.0789635479, -0.4202403426, -0.1521322727, -0.1382851303, 0.0889519528, 0.201893881, 0.2262873352, 0.4319853485, 0.4812994599, -0.133581087, -0.1865677238, -0.1568320096, 0.1854758561, 0.1668440551, 0.050720457, -0.0354781896, -0.0340180397, -0.0489808246, 0.3479300141, 0.2405828834, -0.0315076932, -0.1657155901, 0.11711137, -0.0828167349, -0.0193188209, -0.1044517159, 0.1295061409, 0.0014498346, -0.0560877696, -0.1370189786, 0.1237349287, 0.3126102388, 0.3356463015, 0.4685326517, -0.1630623639, -0.3651547432, -0.2355745286, 0.253302902, 0.0607487336, -0.0653113127, -0.1176356822, -0.0481866077, -0.1056727543, 0.057690464, 0.2247026265, 0.5772358775, 0.0416001827, 0.0999541581, 0.1000927985, -0.1463626772, -0.0793779492, 0.145674929, -0.1524338275, 0.2749131322, -0.2594352663, 0.6059510112, 0.0132497074, -0.2488039732, 0.1219423264, 0.1560311764, 0.0712457225, -0.0755535737, 0.0563124865, -0.1663431227, 0.4083590508, 0.3118742704, -0.1110294461, -0.3372119665, 0.1957025826, 0.0659354851, 0.3942148089, 0.2462236285, 0.1359487623, 0.2396057099, 0.1566775739, 0.4447752833, 0.4075513482, -0.2255686522, 0.1009692252, -0.2790299356, 0.2017894536, 0.5044292808, -0.1668918729, -0.2003412247, 0.1333301961, 0.1274660528, 0.2278029919, -0.0769987255, 0.7284394503, 0.1680296659, -0.2433645576, -0.2203658521, 0.3128042817, 0.0742325783, -0.4544352889, -0.1270720959, -0.0152983516, 0.193359524, -0.1192287952, -0.0843898356, -0.0199445896, 0.1979463398, 0.2530483305, 0.3101104498, -0.1850708425, -0.1399118006, -0.0365397111, 0.3561719954, -0.0465295054, 0.2955492735, -0.1366996765, 0.0691888407, 0.2079567611, 0.3479251266, -0.0785519183, 0.1551562101, -0.0947594345, 0.1725800633, -0.1646716893, 0.06958507, 0.2889026105, 0.0571304001, 0.1896818578, -0.0453450829, 0.2990152538, -0.0403400622, -0.0271159373, 0.254943192, 0.0124205286, 0.4369235635, -0.3256869316, 0.1549675316, 0.2438471317, 0.3556315899, -0.3943243027, 0.3008923531, -0.4989356995, 0.4902076423, -0.3825583756, -0.3178113401, -0.1649125963, 0.2318495363, -0.0218924917, 0.0985027403, 0.4464308023, 0.606598258, 0.1910274923, -0.1123103499, -0.244086653, -0.2296122611, -0.1221579537, 0.1418815255, 0.0993728936, -0.0558674075, -0.3151007891, 0.0122432653, 0.076161176, -0.0800180286, -0.0388822667, -0.7266441584, 0.122967422, -0.2297173738, 0.0446919985, -0.2524688244, 0.2073400021, -0.0367167778, 0.3225856721, -0.0386122204, 0.2700697184, -0.1861474067, 0.1864186376, 0.040176332, -0.2238376439, 0.0726810992, 0.1357153654, -0.116521053, 0.1795516461, -0.1516771019, 0.3388020992, -0.0210341588, -0.0172182396, -0.2530868351, -0.3071557581, 0.1226310208, 0.2526156902, -0.2492693067, 0.1780517697, -0.0967135504, -0.1678789556, 0.1459290534, -0.0184513498, -0.603793025, 0.0245387331, 0.0723757893, -0.2292449027, 0.1054957882, 0.2302973568, -0.1658847332, 0.0361461416, -0.3356170654, 0.0039454028, 0.3455246091, -0.2045923322, -0.0846928135, -0.2976563275, -0.366068542, 0.3209732473, -0.2705563903, -1.1808879375, 0.0807426721, 0.268093586, 0.3806759119, -0.0940280557, 0.1979691833, 0.0488508567, 0.0961836576, -0.399548173, 0.5143037438, 0.333717674, 0.110334076, -0.2128123939, -0.2657094598 ]