html_url
stringlengths
48
51
title
stringlengths
5
268
comments
stringlengths
63
51.8k
body
stringlengths
0
36.2k
⌀
comment_length
int64
16
1.52k
text
stringlengths
164
54.1k
embeddings
sequence
https://github.com/huggingface/datasets/issues/534
`list_datasets()` is broken.
What you can do instead to get the list of the datasets is call ```python print([dataset.id for dataset in nlp.list_datasets()]) ```
version = '0.4.0' `list_datasets()` is broken. It results in the following error : ``` In [3]: nlp.list_datasets() Out[3]: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj) 700 type_pprinters=self.type_printers, 701 deferred_pprinters=self.deferred_printers) --> 702 printer.pretty(obj) 703 printer.flush() 704 return stream.getvalue() ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/lib/pretty.py in pretty(self, obj) 375 if cls in self.type_pprinters: 376 # printer registered in self.type_pprinters --> 377 return self.type_pprinters[cls](obj, self, cycle) 378 else: 379 # deferred printer ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/lib/pretty.py in inner(obj, p, cycle) 553 p.text(',') 554 p.breakable() --> 555 p.pretty(x) 556 if len(obj) == 1 and type(obj) is tuple: 557 # Special case for 1-item tuples. ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/lib/pretty.py in pretty(self, obj) 392 if cls is not object \ 393 and callable(cls.__dict__.get('__repr__')): --> 394 return _repr_pprint(obj, self, cycle) 395 396 return _default_pprint(obj, self, cycle) ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle) 698 """A pprint that just redirects to the normal repr function.""" 699 # Find newlines and replace them with p.break_() --> 700 output = repr(obj) 701 lines = output.splitlines() 702 with p.group(): ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/nlp/hf_api.py in __repr__(self) 110 111 def __repr__(self): --> 112 single_line_description = self.description.replace("\n", "") 113 return f"nlp.ObjectInfo(id='{self.id}', description='{single_line_description}', files={self.siblings})" 114 AttributeError: 'NoneType' object has no attribute 'replace' ```
21
`list_datasets()` is broken. version = '0.4.0' `list_datasets()` is broken. It results in the following error : ``` In [3]: nlp.list_datasets() Out[3]: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj) 700 type_pprinters=self.type_printers, 701 deferred_pprinters=self.deferred_printers) --> 702 printer.pretty(obj) 703 printer.flush() 704 return stream.getvalue() ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/lib/pretty.py in pretty(self, obj) 375 if cls in self.type_pprinters: 376 # printer registered in self.type_pprinters --> 377 return self.type_pprinters[cls](obj, self, cycle) 378 else: 379 # deferred printer ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/lib/pretty.py in inner(obj, p, cycle) 553 p.text(',') 554 p.breakable() --> 555 p.pretty(x) 556 if len(obj) == 1 and type(obj) is tuple: 557 # Special case for 1-item tuples. ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/lib/pretty.py in pretty(self, obj) 392 if cls is not object \ 393 and callable(cls.__dict__.get('__repr__')): --> 394 return _repr_pprint(obj, self, cycle) 395 396 return _default_pprint(obj, self, cycle) ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle) 698 """A pprint that just redirects to the normal repr function.""" 699 # Find newlines and replace them with p.break_() --> 700 output = repr(obj) 701 lines = output.splitlines() 702 with p.group(): ~/.virtualenvs/san-lgUCsFg_/lib/python3.8/site-packages/nlp/hf_api.py in __repr__(self) 110 111 def __repr__(self): --> 112 single_line_description = self.description.replace("\n", "") 113 return f"nlp.ObjectInfo(id='{self.id}', description='{single_line_description}', files={self.siblings})" 114 AttributeError: 'NoneType' object has no attribute 'replace' ``` What you can do instead to get the list of the datasets is call ```python print([dataset.id for dataset in nlp.list_datasets()]) ```
[ -0.292550683, 0.1287723631, -0.1103175357, 0.2530121505, 0.1547409296, 0.0697495937, 0.3828647435, 0.4221463203, -0.0766395479, -0.0494418666, -0.1751875281, 0.4431256652, -0.2499772906, -0.0311815515, -0.0670694932, -0.4052232802, -0.0786971152, 0.3645732403, 0.0530653261, 0.1719870567, -0.1775275171, 0.3013062179, -0.291524291, 0.1099653021, 0.0032131479, -0.3575333059, -0.0393835306, -0.0953140184, -0.273858875, -0.610193193, 0.205048725, 0.0413201973, 0.145760864, 0.1917884499, -0.0001070091, -0.1000375003, 0.346698761, 0.1209743544, -0.4599770904, -0.1070155278, -0.3484741747, -0.1636980921, 0.1541842073, -0.1577062011, 0.2177174687, -0.2989482284, 0.0492457263, -0.0324084833, 0.1428058594, 0.4736913443, 0.2920954823, 0.138335973, 0.3362932503, -0.0987471342, 0.1389922053, 0.1220618114, -0.2137823403, 0.1378367394, 0.2005368173, -0.1644204408, 0.1876339763, 0.315654099, -0.1838982552, 0.0428844094, 0.0808461308, -0.102685973, -0.0092915101, -0.2145708352, 0.1760113388, 0.0995603725, 0.416428715, -0.2796167433, -0.3078490198, 0.0164624751, 0.0589694381, -0.777423799, 0.1081925482, 0.0224130563, 0.0358128846, 0.0199042149, -0.3528315723, -0.0658770949, -0.2318229973, 0.4673490226, -0.0962118879, 0.2898915708, -0.1140294299, 0.0171308778, -0.0981985331, -0.0868969187, 0.0178057533, 0.1038974598, -0.2775533199, -0.0063254279, -0.1692343056, -0.1642159969, 0.2114343047, 0.0902844295, -0.0042498861, 0.4375267029, -0.0416293517, -0.1178214476, 0.0063491492, 0.1518928558, 0.1883149296, 0.1584149748, 0.2687663138, 0.3543736637, 0.1175394356, 0.2619755268, 0.1657693237, -0.0674193576, 0.1508340687, -0.2813037634, 0.1861240268, 0.0103147849, 0.3496008813, -0.1106454507, -0.2098478377, 0.2666288912, -0.1843721122, -0.0758719891, 0.0960811004, 0.2046854347, -0.0793878958, 0.2663103044, 0.1156047955, -0.0302527137, -0.1726290435, -0.0930824503, 0.0089964774, 0.0878816321, -0.0294363461, -0.0644477978, 0.0349585749, -0.0605722964, 0.2429810613, -0.1208944172, 0.1779671013, 0.0197550431, 0.1838930249, -0.400000155, 0.1542437822, 0.2231270373, -0.1593793035, 0.1788140088, 0.2923765779, -0.4119536877, -0.1074467003, -0.1714622527, -0.0767475665, -0.2104941458, -0.4990204871, 0.2266944945, 0.1809666604, -0.0194097124, -0.0961712822, -0.1299236566, 0.3491955996, -0.2621614337, 0.0378679894, -0.5697959661, -0.0991157368, -0.133920908, 0.1721041352, 0.3000337183, -0.3002200127, 0.1677256078, -0.2391220182, -0.0513176322, 0.0095718391, 0.223917976, -0.1983067542, 0.2528693676, -0.1809738278, -0.0589217581, 0.2944366336, -0.1372352093, -0.2301750481, 0.27957654, 0.2491777241, -0.0680247545, -0.2227921337, -0.0755550191, 0.2689785957, 0.0481588207, 0.2397183329, 0.1333483458, 0.0076560075, -0.1522698402, -0.1668645293, -0.0934462398, 0.3813961446, -0.1442018002, 0.1337891668, 0.1369583905, -0.0157833938, 0.1134744361, 0.146821484, -0.1264297515, -0.0556390695, 0.1905203462, 0.2522131503, 0.1714026332, 0.0542702898, -0.3509207666, -0.4462582171, -0.07970085, -0.2040192634, 0.0652358383, -0.2956982553, 0.1840092391, -0.2299053669, 0.159849152, -0.1872380674, -0.2770088911, 0.1992531568, 0.2211045027, 0.0691296607, -0.056017898, -0.1147576571, -0.0540780574, -0.0689446107, 0.0815346316, -0.420245707, 0.3430922329, -0.2603979707, -0.2390128076, 0.0644558519, 0.0965770558, 0.1995358169, -0.1361993104, -0.2320536971, 0.4403237998, 0.1650059223, -0.2004154772, -0.1622930318, 0.0771137327, 0.1574231982, -0.1858453751, 0.0220005494, 0.3202286065, 0.0983405784, 0.05786011, -0.0076148538, 0.2805490196, -0.1693373621, 0.1688175052, 0.2262056321, 0.3731295466, 0.260748893, 0.1023364142, -0.0886058956, -0.2534462512, 0.4879235029, 0.033973068, 0.2914640903, -0.2156838924, -0.5336607099, 0.0760329813, 0.3073707819, 0.1480704099, 0.1422272027, -0.0100680152, -0.1057597175, 0.076960288, 0.2739709914, 0.1093879417, 0.3183997571, 0.0714439452, -0.2827414274, -0.0664323196, -0.2687222362, -0.1903398037, 0.2828249037, 0.0425261818, 0.1601822376, 0.1422438771, 0.26644665, 0.0376955569, -0.3858788311, -0.4234344065, -0.0569501184, 0.3714590669, -0.1407546401, 0.2643478513, -0.3491426408, -0.4249198437, -0.2960481346, -0.2388044149, -0.2406000793, -0.3623482287, -0.0960668325, 0.1309019178, 0.0306270607, 0.2354483604, -0.1495062262, -0.0630284697, 0.1627137959, 0.1025075987, -0.0452507734, -0.1686991304, -0.2626590729, 0.1136496663, 0.1955719739, -0.0830840766, 0.3767891824, -0.0422198661, -0.1625643671, -0.2199974656, -0.4036243558, 0.1120403111, -0.068063736, 0.1988326907, 0.5051584244, 0.094980076, -0.043577835, -0.1564035863, 0.4378064275, -0.0563664697, 0.1829485744, 0.1709960699, -0.0545082614, -0.3030059338, -0.1642801017, -0.4381232858, -0.1721547991, -0.1750887334, 0.1431860477, 0.3657177985, 0.3671049476, 0.5672652125, 0.0486724153, 0.1627243012, -0.149838835, 0.1697801948, -0.0384771377, 0.0926326588, 0.182780236, -0.2975684106, -0.403300792, -0.205091849, 0.1107114106, 0.0534854978, -0.0109258788, -0.4335920215, -0.1561720967, -0.2316405028, 0.2016342729, -0.0561203174, 0.0157572236, 0.2922448516, 0.1445402503, -0.0896595791, -0.0230037458, -0.0041050469, -0.0687814951, -0.1858177185, 0.1621864587, 0.0248010196, 0.2922297418, -0.0115638487, 0.2237013578, 0.3424479365, -0.2151798159, 0.1279713064, -0.1084779203, 0.451420784, -0.1578468829, -0.4963948131, 0.2596534789, -0.0834076852, -0.0708968863, 0.111799933, -0.0996083468, -0.2902063727, -0.133814007, 0.3741462827, -0.008920501, -0.0709919557, 0.0830766186, -0.1850360632, 0.3181609213, 0.0026356475, 0.2742581367, -0.1590849012, -0.2411729693, -0.1272427589, 0.1199280024, -0.0098039471, -0.1198806688, -0.589368999, -0.3102941811, -0.2474392802, 0.3407366276, 0.1813261211, 0.7312634587, -0.0435705222, 0.1915239096, -0.2322874814, -0.0519200414, 0.2175544649, -0.3263437152, -0.1254755557, 0.5302119851, -0.0307002962, -0.1185705289, -0.1065542847, -0.4047204554, 0.3956197798, 0.1058987901, 0.2219058871, -0.0387295336, -0.0528823696, 0.362588197, 0.17712152, -0.1430917531, 0.0908256844, -0.0623477101, -0.0892772898, -0.1557318121, -0.1180959269, -0.1927642226, 0.146625191, -0.0049090348, 0.1919083446, -0.1392065585, -0.125769034, -0.0748904422, 0.1233943105, 0.1236949787, 0.0033258863, -0.0421624444, -0.0984142423, 0.2123968154, 0.1988956481, 0.1118149534, -0.3817195594, -0.2204661518, -0.1041046083, -0.0807113349, 0.2407716811, 0.0738157928, -0.2533873022, 0.0336981453, -0.0934981853, 0.1150832176, -0.0288714003, -0.2338209748, 0.5240262151, 0.0251875333, -0.3135380447, -0.4343085587, 0.206692934, 0.0136047732, 0.1050094068, 0.3896684051, -0.2068132013, -0.3086206615, 0.1892785579, 0.1139306575, 0.6405628324, 0.08514864, 0.0652172863, 0.2540675104, -0.0935596675, 0.6293441057, 0.1546672434, 0.2402298748, -0.3571698368, -0.2086233944, -0.0803111196, -0.1555121541, 0.473354578, 0.0507896021, -0.313117981, 0.2505072355, -0.0391838849, 0.138523683, 0.035981942, 0.2781998813, 0.0778181478, -0.1967807859, -0.5601498485, 0.1838224977, -0.232407406, -0.0873939395, -0.3194411099, 0.0811046511, 0.1707181334, -0.1656274945, -0.4413455129, 0.1346511245, -0.1211193278, 0.3450766206, 0.326159209, -0.3975537121, 0.1371129453, 0.1328669339, -0.0263586342, 0.2817957401, -0.1486686468, -0.0861461759, -0.0451031178, -0.1509837657, 0.0990661904, 0.1168280467, 0.4106482267, -0.0275181048, 0.0686403364, 0.1827413589, 0.0321694948, -0.1284326911, -0.0911367834, -0.0259141941, 0.1404956579, -0.2732410133, -0.1399979442, -0.0654587299, -0.1451388448, -0.3277776241, 0.1606898308, 0.1787604392, -0.1430870295, 0.2235410959, -0.0640175939, 0.0266120322, -0.0206708126, 0.1997918487, 0.0545464307, -0.0542284846, 0.4666303992, 0.4435591698, -0.2183810771, -0.3694681525, 0.0551779233, -0.1608372182, -0.3175578415, 0.2667814195, -0.1879155785, 0.191915229, -0.0624179468, 0.185502544, -0.1084149927, 0.2329242826, 0.0201101881, -0.6296337247, -0.1027127877, 0.0046858699, 0.1599677652, 0.1682861298, 0.021127075, 0.1633481532, 0.062362358, 0.1665313095, -0.3393384516, -0.0928666964, -0.2718740404, 0.1751076132, 0.0623885728, 0.0062932642, 0.0212404765, -0.0425847769, 0.1828921139, 0.1107408553, -0.0693011433, -0.2771649063, -0.2256087065, 0.074348852, 0.1718116403, -0.5074115396, 0.0664313585, -0.0953750238, -0.2018555403, -0.2209297121, -0.1938801557, 0.006028648, -0.1222522184, 0.3884961009, -0.091798164, -0.019553503, 0.0311301257, 0.0888620242, -0.0639945716, 0.1822515428, 0.090690583, 0.3359932005, 0.1552696675, -0.022311423, -0.4787730575, 0.088157542, -0.1612366438, 0.0551171452, 0.4794060886, -0.5633707643, -0.0244877655, -0.0482901186, 0.5955434442, 0.3907881081, -0.2083753645, 0.0840867534, 0.2443301529, 0.2077736259, -0.3391137421, -0.1119451821, 0.2847106457, 0.1861763149, 0.045492813, 0.0799685717, 0.0038468146, -0.0595145077, -0.1182620078, 0.0298664328, 0.1543692648, -0.5287252069, 0.2331760228, 0.3293744028, 0.1726527661, -0.0026451317, 0.1662860811, 0.1339377016, 0.1855649948, 0.3369791508, 0.0011743638, 0.2679283917, 0.2355295867, 0.0644424558, 0.2363327146, -0.1297553033, 0.0706020445, 0.1460009068, 0.2153233141, 0.2068514526, 0.0903033093, 0.3038615584, -0.3223172724, -0.0923503563, 0.0277671274, 0.220709607, -0.1179726422, -0.0328401774, -0.2226661891, -0.068245858, -0.1485170871, 0.0043876721, -0.2459125668, -0.0806658268, 0.5146120787, 0.1833413839, -0.1658655703, -0.8891288638, 0.2164248824, 0.1544317901, 0.064714931, -0.314719528, 0.2495399863, 0.1710822731, 0.0437221602, -0.2234829068, 0.7008237839, 0.5018439293, 0.3941645026, 0.1825341582, -0.0488639884, -0.268222779, -0.1042501479, 0.041957207, 0.1700416803, 0.1123282984, 0.0595857054, 0.3015961647, 0.1333014071, -0.1490453184, 0.2988526821, 0.2556345761, 0.0375604592, -0.0993070453, 0.4731218815, -0.0470737442, -0.246526897, -0.1355570257, -0.030110335, -0.3524825573, 0.1153912842, 0.5406102538, 0.2814169526, 0.0571112968, -0.0885854438, 0.1267948449, 0.1267554164, 0.4031399786, 0.475553453, 0.3269428313, -0.1795828193, -0.1937527657, -0.2992212772, 0.157597959, -0.2197693884, -0.0460956693, 0.1135373265, 0.0597481094, -0.0773710161, 0.2345737368, 0.027412761, 0.0945410356, -0.0248966962, 0.0568599403, -0.3780336082, -0.1162495986, 0.2867144644, 0.0270564016, -0.0278432257, -0.1964134723, 0.151207462, -0.1286521405, 0.112616457, -0.3674302399, -0.0651417896, -0.1094163358, 0.2097262442, 0.0312759466, 0.4317314625, 0.2470489442, -0.030963188, -0.2971611321, -0.288320303, -0.4377292991, -0.1834000647, 0.5462130904, 0.1380327791, 0.5336265564, -0.1627796292, -0.2439769506, -0.4112976491, 0.4331108034, -0.3177210391, -0.0555911139, -0.2225958854, 0.2077827305, -0.201059714, -0.0666393191, 0.0329130739, 0.2839015126, -0.0416874401, 0.2112437636, -0.4552669823, -0.2773832977, 0.2597215474, -0.7163980603, -0.3755803108, -0.13820149, 0.100065209, -0.033319138, -0.1368526667, -0.3827463388, -0.0606801361, 0.3364994824, -0.1395789534, -0.2957064807, 0.0730350539, 0.1560715735, 0.1417678744, -0.0939194858, 0.618277669, 0.0997408852, -0.3169440925, 0.099876292, -0.0598641671 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
Could you try to run `dataset = load_dataset("text", data_files=file_path, split="train")` once before calling the script ? It looks like several processes try to create the dataset in arrow format at the same time. If the dataset is already created it should be fine
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
43
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` Could you try to run `dataset = load_dataset("text", data_files=file_path, split="train")` once before calling the script ? It looks like several processes try to create the dataset in arrow format at the same time. If the dataset is already created it should be fine
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
Thanks! I tested on 328MB text data on `n1-standard-8 (8 vCPUs, 30 GB memory)`. The main script ran without any issue, but it seems to require a huge space in the drive. As suggested, I ran the following script before running the pre-training command with `xla_spawn.py`. ```python from nlp import load_dataset file_path="your_file_name" load_dataset("text", data_files=file_path, split="train") ``` This will create `text-train.arrow` under the default cache directory. Then, I run the script with `xla_spawn.py`. It will load data from the cached file. My understanding is that there's no other way but to do this two-step process with the current version (0.4) of `nlp`. During another caching process that happens in the main script: ``` 08/26/2020 09:19:51 - INFO - nlp.utils.info_utils - All the checksums matched successfully for post processing resources 08/26/2020 09:19:53 - INFO - nlp.arrow_dataset - Caching processed dataset at /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d/cache-f90f341e5308a7469 8d872bcc88f9c0e.arrow ``` `nlp` generates a temporary file per core, each of which is three times larger than the original text data. If each process is actually writing on the disk, you will need a huge amount of space in your drive. (Maybe I'm missing something.) ``` -rw-r--r-- 1 ***** ***** 674 Aug 26 09:19 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 09:19 LICENSE -rw-r--r-- 1 ***** ***** 332M Aug 26 09:10 text-train.arrow -rw------- 1 ***** ***** 940M Aug 26 09:31 tmp0k43sazw -rw------- 1 ***** ***** 940M Aug 26 09:31 tmp7sxs9mj5 -rw------- 1 ***** ***** 939M Aug 26 09:31 tmpbbiqw2vp -rw------- 1 ***** ***** 937M Aug 26 09:31 tmpjxb5ptyu -rw------- 1 ***** ***** 933M Aug 26 09:31 tmpk3hkdh0e -rw------- 1 ***** ***** 944M Aug 26 09:31 tmpnoalwftz -rw------- 1 ***** ***** 931M Aug 26 09:31 tmpuxdr_dz3 -rw------- 1 ***** ***** 945M Aug 26 09:31 tmpxjyuy6dk ``` After the caching process, they seem to be merged into one file. ``` -rw------- 1 ***** ***** 989M Aug 26 09:32 cache-f90f341e5308a74698d872bcc88f9c0e.arrow -rw-r--r-- 1 ***** ***** 674 Aug 26 09:19 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 09:19 LICENSE -rw-r--r-- 1 ***** ***** 332M Aug 26 09:10 text-train.arrow ```
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
336
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` Thanks! I tested on 328MB text data on `n1-standard-8 (8 vCPUs, 30 GB memory)`. The main script ran without any issue, but it seems to require a huge space in the drive. As suggested, I ran the following script before running the pre-training command with `xla_spawn.py`. ```python from nlp import load_dataset file_path="your_file_name" load_dataset("text", data_files=file_path, split="train") ``` This will create `text-train.arrow` under the default cache directory. Then, I run the script with `xla_spawn.py`. It will load data from the cached file. My understanding is that there's no other way but to do this two-step process with the current version (0.4) of `nlp`. During another caching process that happens in the main script: ``` 08/26/2020 09:19:51 - INFO - nlp.utils.info_utils - All the checksums matched successfully for post processing resources 08/26/2020 09:19:53 - INFO - nlp.arrow_dataset - Caching processed dataset at /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d/cache-f90f341e5308a7469 8d872bcc88f9c0e.arrow ``` `nlp` generates a temporary file per core, each of which is three times larger than the original text data. If each process is actually writing on the disk, you will need a huge amount of space in your drive. (Maybe I'm missing something.) ``` -rw-r--r-- 1 ***** ***** 674 Aug 26 09:19 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 09:19 LICENSE -rw-r--r-- 1 ***** ***** 332M Aug 26 09:10 text-train.arrow -rw------- 1 ***** ***** 940M Aug 26 09:31 tmp0k43sazw -rw------- 1 ***** ***** 940M Aug 26 09:31 tmp7sxs9mj5 -rw------- 1 ***** ***** 939M Aug 26 09:31 tmpbbiqw2vp -rw------- 1 ***** ***** 937M Aug 26 09:31 tmpjxb5ptyu -rw------- 1 ***** ***** 933M Aug 26 09:31 tmpk3hkdh0e -rw------- 1 ***** ***** 944M Aug 26 09:31 tmpnoalwftz -rw------- 1 ***** ***** 931M Aug 26 09:31 tmpuxdr_dz3 -rw------- 1 ***** ***** 945M Aug 26 09:31 tmpxjyuy6dk ``` After the caching process, they seem to be merged into one file. ``` -rw------- 1 ***** ***** 989M Aug 26 09:32 cache-f90f341e5308a74698d872bcc88f9c0e.arrow -rw-r--r-- 1 ***** ***** 674 Aug 26 09:19 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 09:19 LICENSE -rw-r--r-- 1 ***** ***** 332M Aug 26 09:10 text-train.arrow ```
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
Again it looks like every process tries to tokenize the full dataset at the same time. If you do the tokenization before calling `xla_spawn.py` once, then each process will then use the tokenized cached file `cache-f90f341e5308a74698d872bcc88f9c0e.arrow` and not recompute it. Not sure if there's a better way to do that cc @julien-c @thomwolf
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
53
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` Again it looks like every process tries to tokenize the full dataset at the same time. If you do the tokenization before calling `xla_spawn.py` once, then each process will then use the tokenized cached file `cache-f90f341e5308a74698d872bcc88f9c0e.arrow` and not recompute it. Not sure if there's a better way to do that cc @julien-c @thomwolf
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
I wrote a separate script just for preparing a cached file, including tokenization. Each process did use the tokenized cached file. Currently I'm testing the pipeline on 24GB text data. It took about 1.5 hour to create a cached file on `n1-highmem-16 (16 vCPUs, 104 GB memory)`. I assume loading this cached file in the main script with `xla_spawn.py` won't be an issue (even if there are 8 processes). ``` total 98G drwxr-xr-x 2 ***** ***** 4.0K Aug 26 13:38 . drwxr-xr-x 3 ***** ***** 4.0K Aug 26 12:24 .. -rw------- 1 ***** ***** 74G Aug 26 13:38 cache-a7aa04134ba7b1aff5d9710f14a4e334.arrow -rw-r--r-- 1 ***** ***** 681 Aug 26 12:24 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 12:24 LICENSE -rw-r--r-- 1 ***** ***** 25G Aug 26 12:24 text-train.arrow ```
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
127
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` I wrote a separate script just for preparing a cached file, including tokenization. Each process did use the tokenized cached file. Currently I'm testing the pipeline on 24GB text data. It took about 1.5 hour to create a cached file on `n1-highmem-16 (16 vCPUs, 104 GB memory)`. I assume loading this cached file in the main script with `xla_spawn.py` won't be an issue (even if there are 8 processes). ``` total 98G drwxr-xr-x 2 ***** ***** 4.0K Aug 26 13:38 . drwxr-xr-x 3 ***** ***** 4.0K Aug 26 12:24 .. -rw------- 1 ***** ***** 74G Aug 26 13:38 cache-a7aa04134ba7b1aff5d9710f14a4e334.arrow -rw-r--r-- 1 ***** ***** 681 Aug 26 12:24 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 12:24 LICENSE -rw-r--r-- 1 ***** ***** 25G Aug 26 12:24 text-train.arrow ```
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
Sorry, I thought it was working, but actually the second call doesn't use the cached file that was generated separately, and it will generate another cache-****.arrorw file with a different name. If I run the training script again (with `xla_spawn.py`), it will use the second cached file, which was generated by the training script itself in the previous run. ``` drwxr-xr-x 2 ***** ***** 4.0K Aug 26 15:35 . drwxr-xr-x 3 ***** ***** 4.0K Aug 26 15:29 .. -rw------- 1 ***** ***** 99M Aug 26 15:35 cache-0d77dfce704493dbe63f071eed6a5431.arrow -rw------- 1 ***** ***** 99M Aug 26 15:29 cache-69633651476e943b93c89ace715f9487.arrow -rw-r--r-- 1 ***** ***** 670 Aug 26 15:33 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 15:33 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 26 15:29 text-train.arrow ```
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
124
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` Sorry, I thought it was working, but actually the second call doesn't use the cached file that was generated separately, and it will generate another cache-****.arrorw file with a different name. If I run the training script again (with `xla_spawn.py`), it will use the second cached file, which was generated by the training script itself in the previous run. ``` drwxr-xr-x 2 ***** ***** 4.0K Aug 26 15:35 . drwxr-xr-x 3 ***** ***** 4.0K Aug 26 15:29 .. -rw------- 1 ***** ***** 99M Aug 26 15:35 cache-0d77dfce704493dbe63f071eed6a5431.arrow -rw------- 1 ***** ***** 99M Aug 26 15:29 cache-69633651476e943b93c89ace715f9487.arrow -rw-r--r-- 1 ***** ***** 670 Aug 26 15:33 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 15:33 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 26 15:29 text-train.arrow ```
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
So if I understand correctly it means that the cached file generated by your separated script is different by the one used by the training script ?
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
27
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` So if I understand correctly it means that the cached file generated by your separated script is different by the one used by the training script ?
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
Yes. 1. `cache-69633651476e943b93c89ace715f9487.arrow` was generated with a separate script. 2. I ran the entire script with `xla_spawn.py`. 3. `cache-69633651476e943b93c89ace715f9487.arrow` is not used. 4. `cache-0d77dfce704493dbe63f071eed6a5431.arrow` is created. 5. training starts... Now, if I kill the process at step 5, and do the step 2 again, it will use `cache-0d77dfce704493dbe63f071eed6a5431.arrow` (cached file created at step 4) without any issue. I used the following to generate the first cached file. ```python dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) ```
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
85
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` Yes. 1. `cache-69633651476e943b93c89ace715f9487.arrow` was generated with a separate script. 2. I ran the entire script with `xla_spawn.py`. 3. `cache-69633651476e943b93c89ace715f9487.arrow` is not used. 4. `cache-0d77dfce704493dbe63f071eed6a5431.arrow` is created. 5. training starts... Now, if I kill the process at step 5, and do the step 2 again, it will use `cache-0d77dfce704493dbe63f071eed6a5431.arrow` (cached file created at step 4) without any issue. I used the following to generate the first cached file. ```python dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) ```
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
1. Here's the log from the first step. ``` Downloading and preparing dataset text/default-e84dd29acc4ad9ef (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Dataset text downloaded and prepared to /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d. Subsequent calls will reuse this data. ``` There's a file named `cache-7b1440ba7077af0f0d9035b5a55d01fc.arrow`, so it did create a cached file. ``` drwxr-xr-x 2 ***** ***** 4.0K Aug 26 15:59 . drwxr-xr-x 3 ***** ***** 4.0K Aug 26 15:58 .. -rw------- 1 ***** ***** 99M Aug 26 15:59 cache-7b1440ba7077af0f0d9035b5a55d01fc.arrow -rw-r--r-- 1 ***** ***** 670 Aug 26 15:58 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 15:58 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 26 15:58 text-train.arrow ``` 2. Ideally, `cache-7b1440ba7077af0f0d9035b5a55d01fc.arrow` should be used in `run_language_modeling.py` (modified version using `nlp`) with `xla_spawn.py`. But it looks like it's creating a new cached file. ``` 08/26/2020 16:13:03 - INFO - filelock - Lock 139635836351096 released on /home/*****/.cache/huggingface/datasets/3e34209a2741375a1db1ff03bf1abba1a9bd0e6016912d3ead0114b9d1ca2685.202fa4f84f552bff1f5400ae012663839c61efb3de068c6c8722d34ac0ea6192 .py.lock 08/26/2020 16:13:03 - WARNING - nlp.builder - Using custom data configuration default 08/26/2020 16:13:03 - INFO - nlp.builder - Overwrite dataset info from restored data version. 08/26/2020 16:13:03 - INFO - nlp.info - Loading Dataset info from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:13:03 - INFO - nlp.builder - Reusing dataset text (/home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/26/2020 16:13:03 - INFO - nlp.builder - Constructing Dataset for split train, from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:13:03 - INFO - nlp.utils.info_utils - All the checksums matched successfully for post processing resources 08/26/2020 16:13:03 - INFO - nlp.builder - Overwrite dataset info from restored data version. 08/26/2020 16:13:03 - INFO - nlp.info - Loading Dataset info from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:13:03 - INFO - nlp.builder - Reusing dataset text (/home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/26/2020 16:13:03 - INFO - nlp.builder - Constructing Dataset for split train, from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:13:03 - INFO - nlp.utils.info_utils - All the checksums matched successfully for post processing resources 08/26/2020 16:13:05 - INFO - nlp.arrow_dataset - Caching processed dataset at /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d/cache-0d77dfce704493dbe 63f071eed6a5431.arrow ^M 0%| | 0/100 [00:00<?, ?it/s]08/26/2020 16:13:05 - INFO - nlp.arrow_dataset - Caching processed dataset at /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6 fe661fe4d070d380d/cache-0d77dfce704493dbe63f071eed6a5431.arrow ``` There are two cached files in the directory: ``` drwxr-xr-x 2 ***** ***** 4.0K Aug 26 16:14 . drwxr-xr-x 3 ***** ***** 4.0K Aug 26 15:58 .. -rw------- 1 ***** ***** 99M Aug 26 16:14 cache-0d77dfce704493dbe63f071eed6a5431.arrow -rw------- 1 ***** ***** 99M Aug 26 15:59 cache-7b1440ba7077af0f0d9035b5a55d01fc.arrow -rw-r--r-- 1 ***** ***** 670 Aug 26 16:13 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 16:13 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 26 15:58 text-train.arrow ``` If I kill the process, and run it again, it will use the second cached file. ``` 08/26/2020 16:19:52 - WARNING - nlp.builder - Using custom data configuration default 08/26/2020 16:19:52 - INFO - nlp.builder - Overwrite dataset info from restored data version. 08/26/2020 16:19:52 - INFO - nlp.info - Loading Dataset info from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:19:52 - INFO - nlp.builder - Reusing dataset text (/home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/26/2020 16:19:52 - INFO - nlp.builder - Constructing Dataset for split train, from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:19:52 - INFO - nlp.utils.info_utils - All the checksums matched successfully for post processing resources 08/26/2020 16:19:53 - INFO - nlp.arrow_dataset - Loading cached processed dataset at /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d/cache-0d77dfce70 4493dbe63f071eed6a5431.arrow 08/26/2020 16:19:53 - INFO - nlp.arrow_dataset - Set __getitem__(key) output type to torch for ['input_ids'] columns (when key is int or slice) and don't output other (un-formatted) columns. ```
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
539
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` 1. Here's the log from the first step. ``` Downloading and preparing dataset text/default-e84dd29acc4ad9ef (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Dataset text downloaded and prepared to /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d. Subsequent calls will reuse this data. ``` There's a file named `cache-7b1440ba7077af0f0d9035b5a55d01fc.arrow`, so it did create a cached file. ``` drwxr-xr-x 2 ***** ***** 4.0K Aug 26 15:59 . drwxr-xr-x 3 ***** ***** 4.0K Aug 26 15:58 .. -rw------- 1 ***** ***** 99M Aug 26 15:59 cache-7b1440ba7077af0f0d9035b5a55d01fc.arrow -rw-r--r-- 1 ***** ***** 670 Aug 26 15:58 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 15:58 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 26 15:58 text-train.arrow ``` 2. Ideally, `cache-7b1440ba7077af0f0d9035b5a55d01fc.arrow` should be used in `run_language_modeling.py` (modified version using `nlp`) with `xla_spawn.py`. But it looks like it's creating a new cached file. ``` 08/26/2020 16:13:03 - INFO - filelock - Lock 139635836351096 released on /home/*****/.cache/huggingface/datasets/3e34209a2741375a1db1ff03bf1abba1a9bd0e6016912d3ead0114b9d1ca2685.202fa4f84f552bff1f5400ae012663839c61efb3de068c6c8722d34ac0ea6192 .py.lock 08/26/2020 16:13:03 - WARNING - nlp.builder - Using custom data configuration default 08/26/2020 16:13:03 - INFO - nlp.builder - Overwrite dataset info from restored data version. 08/26/2020 16:13:03 - INFO - nlp.info - Loading Dataset info from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:13:03 - INFO - nlp.builder - Reusing dataset text (/home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/26/2020 16:13:03 - INFO - nlp.builder - Constructing Dataset for split train, from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:13:03 - INFO - nlp.utils.info_utils - All the checksums matched successfully for post processing resources 08/26/2020 16:13:03 - INFO - nlp.builder - Overwrite dataset info from restored data version. 08/26/2020 16:13:03 - INFO - nlp.info - Loading Dataset info from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:13:03 - INFO - nlp.builder - Reusing dataset text (/home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/26/2020 16:13:03 - INFO - nlp.builder - Constructing Dataset for split train, from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:13:03 - INFO - nlp.utils.info_utils - All the checksums matched successfully for post processing resources 08/26/2020 16:13:05 - INFO - nlp.arrow_dataset - Caching processed dataset at /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d/cache-0d77dfce704493dbe 63f071eed6a5431.arrow ^M 0%| | 0/100 [00:00<?, ?it/s]08/26/2020 16:13:05 - INFO - nlp.arrow_dataset - Caching processed dataset at /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6 fe661fe4d070d380d/cache-0d77dfce704493dbe63f071eed6a5431.arrow ``` There are two cached files in the directory: ``` drwxr-xr-x 2 ***** ***** 4.0K Aug 26 16:14 . drwxr-xr-x 3 ***** ***** 4.0K Aug 26 15:58 .. -rw------- 1 ***** ***** 99M Aug 26 16:14 cache-0d77dfce704493dbe63f071eed6a5431.arrow -rw------- 1 ***** ***** 99M Aug 26 15:59 cache-7b1440ba7077af0f0d9035b5a55d01fc.arrow -rw-r--r-- 1 ***** ***** 670 Aug 26 16:13 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 26 16:13 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 26 15:58 text-train.arrow ``` If I kill the process, and run it again, it will use the second cached file. ``` 08/26/2020 16:19:52 - WARNING - nlp.builder - Using custom data configuration default 08/26/2020 16:19:52 - INFO - nlp.builder - Overwrite dataset info from restored data version. 08/26/2020 16:19:52 - INFO - nlp.info - Loading Dataset info from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:19:52 - INFO - nlp.builder - Reusing dataset text (/home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/26/2020 16:19:52 - INFO - nlp.builder - Constructing Dataset for split train, from /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d 08/26/2020 16:19:52 - INFO - nlp.utils.info_utils - All the checksums matched successfully for post processing resources 08/26/2020 16:19:53 - INFO - nlp.arrow_dataset - Loading cached processed dataset at /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d/cache-0d77dfce70 4493dbe63f071eed6a5431.arrow 08/26/2020 16:19:53 - INFO - nlp.arrow_dataset - Set __getitem__(key) output type to torch for ['input_ids'] columns (when key is int or slice) and don't output other (un-formatted) columns. ```
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
Thanks for all the details. The two cached files are supposed to be the same. I suspect that the caching has a problem with the tokenizer. Which tokenizer did you use ?
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
32
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` Thanks for all the details. The two cached files are supposed to be the same. I suspect that the caching has a problem with the tokenizer. Which tokenizer did you use ?
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
I trained a byte-level BPE tokenizer on my data with `tokenziers` library following this [example](https://github.com/huggingface/tokenizers/blob/master/bindings/python/examples/train_bytelevel_bpe.py). And I put these model files in a directory named `"model_name"`. I also put config.json, which is the original RoBERTa config file. ```bash %ls model_name config.json merges.txt vocab.json ``` [This](https://github.com/huggingface/transformers/blob/4bd7be9a4268221d2a0000c7e8033aaeb365c03b/examples/language-modeling/run_language_modeling.py#L196) is the line where `run_language_modeling.py` loads the tokenier. ```python tokenizer = AutoTokenizer.from_pretrained(model_args.tokenizer_name, cache_dir=model_args.cache_dir) ``` I use `"model_name"` for `model_args.tokenizer_name`. I don't specify `model_args.cache_dir`. It is 'None' by default.
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
73
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` I trained a byte-level BPE tokenizer on my data with `tokenziers` library following this [example](https://github.com/huggingface/tokenizers/blob/master/bindings/python/examples/train_bytelevel_bpe.py). And I put these model files in a directory named `"model_name"`. I also put config.json, which is the original RoBERTa config file. ```bash %ls model_name config.json merges.txt vocab.json ``` [This](https://github.com/huggingface/transformers/blob/4bd7be9a4268221d2a0000c7e8033aaeb365c03b/examples/language-modeling/run_language_modeling.py#L196) is the line where `run_language_modeling.py` loads the tokenier. ```python tokenizer = AutoTokenizer.from_pretrained(model_args.tokenizer_name, cache_dir=model_args.cache_dir) ``` I use `"model_name"` for `model_args.tokenizer_name`. I don't specify `model_args.cache_dir`. It is 'None' by default.
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
In my separated script for caching, I'm using `use_fast=True` when initializing a tokenizer. ```python tokenizer = AutoTokenizer.from_pretrained(args.config_name, use_fast=True) ``` I wasn't using that option in the main script. That could be the reason...
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
33
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` In my separated script for caching, I'm using `use_fast=True` when initializing a tokenizer. ```python tokenizer = AutoTokenizer.from_pretrained(args.config_name, use_fast=True) ``` I wasn't using that option in the main script. That could be the reason...
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
Yea it could definitely explain why you have two different cache files. Let me know if using the same tokenizers on both sides fixes the issue
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
26
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` Yea it could definitely explain why you have two different cache files. Let me know if using the same tokenizers on both sides fixes the issue
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
It still creates a new file even if I remove `use_fast=True`... Here's the script used to create a cached file. ```python #!/usr/bin/env python3 import argparse from transformers import AutoTokenizer from nlp import load_dataset def main(): parser = argparse.ArgumentParser(description='description') parser.add_argument('--config_name', type=str, help='Pretrained config name or path if not the same as model_name') parser.add_argument('--data_file', type=str, help='The input data file (a text file).') parser.add_argument('--block_size', type=int, default=-1, help='The training dataset will be truncated in block of this size for training') args = parser.parse_args() tokenizer = AutoTokenizer.from_pretrained(args.config_name) dataset = load_dataset("text", data_files=args.data_file, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) if __name__ == "__main__": main() ``` Here's how the data is loaded in the modified `run_language_modeling.py`. [[original function](https://github.com/huggingface/transformers/blob/971d1802d009d9996b36a34a34477cee849ef39f/examples/language-modeling/run_language_modeling.py#L128-L135)] ```python def get_dataset(args: DataTrainingArguments, tokenizer: PreTrainedTokenizer, evaluate=False): file_path = args.eval_data_file if evaluate else args.train_data_file split = "validation" if evaluate else "train" if args.line_by_line: # return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset else: return TextDataset( tokenizer=tokenizer, file_path=file_path, block_size=args.block_size, overwrite_cache=args.overwrite_cache ) ``` Probably I don't need this part in the main script, ```python dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) ``` and simply do this? ```python dataset = load_dataset("text", data_files=file_path, split="train") return dataset ```
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
207
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` It still creates a new file even if I remove `use_fast=True`... Here's the script used to create a cached file. ```python #!/usr/bin/env python3 import argparse from transformers import AutoTokenizer from nlp import load_dataset def main(): parser = argparse.ArgumentParser(description='description') parser.add_argument('--config_name', type=str, help='Pretrained config name or path if not the same as model_name') parser.add_argument('--data_file', type=str, help='The input data file (a text file).') parser.add_argument('--block_size', type=int, default=-1, help='The training dataset will be truncated in block of this size for training') args = parser.parse_args() tokenizer = AutoTokenizer.from_pretrained(args.config_name) dataset = load_dataset("text", data_files=args.data_file, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) if __name__ == "__main__": main() ``` Here's how the data is loaded in the modified `run_language_modeling.py`. [[original function](https://github.com/huggingface/transformers/blob/971d1802d009d9996b36a34a34477cee849ef39f/examples/language-modeling/run_language_modeling.py#L128-L135)] ```python def get_dataset(args: DataTrainingArguments, tokenizer: PreTrainedTokenizer, evaluate=False): file_path = args.eval_data_file if evaluate else args.train_data_file split = "validation" if evaluate else "train" if args.line_by_line: # return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset else: return TextDataset( tokenizer=tokenizer, file_path=file_path, block_size=args.block_size, overwrite_cache=args.overwrite_cache ) ``` Probably I don't need this part in the main script, ```python dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) ``` and simply do this? ```python dataset = load_dataset("text", data_files=file_path, split="train") return dataset ```
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
You need this part in the main script or it will use the dataset that is not tokenized
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
18
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` You need this part in the main script or it will use the dataset that is not tokenized
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
I can see that the tokenizer in `run_language_modeling.py` is not instantiated the same way as in your separated script. Indeed we can see L196: ```python tokenizer = AutoTokenizer.from_pretrained(model_args.tokenizer_name, cache_dir=model_args.cache_dir) ``` Could you try to make it so they are instantiated the exact same way please ?
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
46
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` I can see that the tokenizer in `run_language_modeling.py` is not instantiated the same way as in your separated script. Indeed we can see L196: ```python tokenizer = AutoTokenizer.from_pretrained(model_args.tokenizer_name, cache_dir=model_args.cache_dir) ``` Could you try to make it so they are instantiated the exact same way please ?
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
I updated my separated script, but it's creating a cached file again. If I don't use the `model_args.cache_dir`, both will get `None`, so they should be the same. ```python #!/usr/bin/env python3 import argparse from transformers import AutoTokenizer from nlp import load_dataset def main(): parser = argparse.ArgumentParser(description='description') parser.add_argument('--tokenizer_name', type=str, help='Pretrained tokenizer name or path if not the same as model_name') parser.add_argument('--data_file', type=str, help='The input data file (a text file).') parser.add_argument('--cache_dir', type=str, default=None, help='Where do you want to store the pretrained models downloaded from s3') parser.add_argument('--block_size', type=int, default=-1, help='The training dataset will be truncated in block of this size for training') model_args = parser.parse_args() tokenizer = AutoTokenizer.from_pretrained(model_args.tokenizer_name, cache_dir=model_args.cache_dir) dataset = load_dataset("text", data_files=model_args.data_file, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=model_args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) if __name__ == "__main__": main() ``` Is there a way to specify the cache file to load, and skip the re-computation?
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
143
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` I updated my separated script, but it's creating a cached file again. If I don't use the `model_args.cache_dir`, both will get `None`, so they should be the same. ```python #!/usr/bin/env python3 import argparse from transformers import AutoTokenizer from nlp import load_dataset def main(): parser = argparse.ArgumentParser(description='description') parser.add_argument('--tokenizer_name', type=str, help='Pretrained tokenizer name or path if not the same as model_name') parser.add_argument('--data_file', type=str, help='The input data file (a text file).') parser.add_argument('--cache_dir', type=str, default=None, help='Where do you want to store the pretrained models downloaded from s3') parser.add_argument('--block_size', type=int, default=-1, help='The training dataset will be truncated in block of this size for training') model_args = parser.parse_args() tokenizer = AutoTokenizer.from_pretrained(model_args.tokenizer_name, cache_dir=model_args.cache_dir) dataset = load_dataset("text", data_files=model_args.data_file, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=model_args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) if __name__ == "__main__": main() ``` Is there a way to specify the cache file to load, and skip the re-computation?
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
Could you also check that the `args.block_size` used in the lambda function is the same as well ?
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
18
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` Could you also check that the `args.block_size` used in the lambda function is the same as well ?
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
Here's a minimal working example to reproduce this issue. Assumption: - You have access to TPU. - You have installed `transformers` and `nlp`. - You have tokenizer files (`config.json`, `merges.txt`, `vocab.json`) under the directory named `model_name`. - You have `xla_spawn.py` (Download from https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py). - You have saved the following script as `prepare_cached_dataset.py`. ```python #!/usr/bin/env python3 import argparse from transformers import AutoTokenizer from nlp import load_dataset def main(): parser = argparse.ArgumentParser(description='description') parser.add_argument('--tokenizer_name', type=str, help='Pretrained tokenizer name or path if not the same as model_name') parser.add_argument('--data_file', type=str, help='The input data file (a text file).') parser.add_argument('--cache_dir', type=str, default=None, help='Where do you want to store the pretrained models downloaded from s3') parser.add_argument('--block_size', type=int, default=-1, help='The training dataset will be truncated in block of this size for training') parser.add_argument('--tpu_num_cores', type=int, default=1, help='Number of TPU cores to use (1 or 8). For xla_apwan.py') model_args = parser.parse_args() tokenizer = AutoTokenizer.from_pretrained(model_args.tokenizer_name, cache_dir=model_args.cache_dir, use_fast=True) dataset = load_dataset("text", data_files=model_args.data_file, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=model_args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) def _mp_fn(index): # For xla_spawn (TPUs) main() if __name__ == "__main__": main() ``` - Run the following command. Replace `your_training_data` with some text file. ```bash export TRAIN_DATA=your_training_data python prepare_cached_dataset.py \ --tokenizer_name=model_name \ --block_size=512 \ --data_file=$TRAIN_DATA ``` - Check the cached directory. ```bash ls -lha /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d total 132M drwxr-xr-x 2 ***** ***** 4.0K Aug 28 13:08 . drwxr-xr-x 3 ***** ***** 4.0K Aug 28 13:08 .. -rw------- 1 ***** ***** 99M Aug 28 13:08 cache-bfc7cb0702426d19242db5e8c079f04b.arrow -rw-r--r-- 1 ***** ***** 670 Aug 28 13:08 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 28 13:08 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 28 13:08 text-train.arrow ``` - Run the same script again. (The output should be just `Using custom data configuration default`.) ``` python prepare_cached_dataset.py \ --tokenizer_name=model_name \ --block_size=512 \ --data_file=$TRAIN_DATA ``` - Check the cached directory. ```bash ls -lha /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d total 132M drwxr-xr-x 2 ***** ***** 4.0K Aug 28 13:08 . drwxr-xr-x 3 ***** ***** 4.0K Aug 28 13:08 .. -rw------- 1 ***** ***** 99M Aug 28 13:08 cache-bfc7cb0702426d19242db5e8c079f04b.arrow -rw-r--r-- 1 ***** ***** 670 Aug 28 13:20 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 28 13:20 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 28 13:08 text-train.arrow ``` - The cached file (`cache-bfc7cb0702426d19242db5e8c079f04b.arrow`) is reused. - Now, run this script with `xla_spawn.py`. Ideally, it should reuse the cached file, however, you will see each process is creating a cache file again. ```bash python xla_spawn.py --num_cores 8 \ prepare_cached_dataset.py \ --tokenizer_name=model_name \ --block_size=512 \ --data_file=$TRAIN_DATA ``` - Check the cached directory. There are two arrrow files. ```bash ls -lha /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d total 230M drwxr-xr-x 2 ***** ***** 4.0K Aug 28 13:25 . drwxr-xr-x 3 ***** ***** 4.0K Aug 28 13:08 .. -rw------- 1 ***** ***** 99M Aug 28 13:08 cache-bfc7cb0702426d19242db5e8c079f04b.arrow -rw------- 1 ***** ***** 99M Aug 28 13:25 cache-e0e2313e49c8a110aafcc8133154c19a.arrow -rw-r--r-- 1 ***** ***** 670 Aug 28 13:24 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 28 13:24 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 28 13:08 text-train.arrow ```
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
482
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` Here's a minimal working example to reproduce this issue. Assumption: - You have access to TPU. - You have installed `transformers` and `nlp`. - You have tokenizer files (`config.json`, `merges.txt`, `vocab.json`) under the directory named `model_name`. - You have `xla_spawn.py` (Download from https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py). - You have saved the following script as `prepare_cached_dataset.py`. ```python #!/usr/bin/env python3 import argparse from transformers import AutoTokenizer from nlp import load_dataset def main(): parser = argparse.ArgumentParser(description='description') parser.add_argument('--tokenizer_name', type=str, help='Pretrained tokenizer name or path if not the same as model_name') parser.add_argument('--data_file', type=str, help='The input data file (a text file).') parser.add_argument('--cache_dir', type=str, default=None, help='Where do you want to store the pretrained models downloaded from s3') parser.add_argument('--block_size', type=int, default=-1, help='The training dataset will be truncated in block of this size for training') parser.add_argument('--tpu_num_cores', type=int, default=1, help='Number of TPU cores to use (1 or 8). For xla_apwan.py') model_args = parser.parse_args() tokenizer = AutoTokenizer.from_pretrained(model_args.tokenizer_name, cache_dir=model_args.cache_dir, use_fast=True) dataset = load_dataset("text", data_files=model_args.data_file, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=model_args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) def _mp_fn(index): # For xla_spawn (TPUs) main() if __name__ == "__main__": main() ``` - Run the following command. Replace `your_training_data` with some text file. ```bash export TRAIN_DATA=your_training_data python prepare_cached_dataset.py \ --tokenizer_name=model_name \ --block_size=512 \ --data_file=$TRAIN_DATA ``` - Check the cached directory. ```bash ls -lha /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d total 132M drwxr-xr-x 2 ***** ***** 4.0K Aug 28 13:08 . drwxr-xr-x 3 ***** ***** 4.0K Aug 28 13:08 .. -rw------- 1 ***** ***** 99M Aug 28 13:08 cache-bfc7cb0702426d19242db5e8c079f04b.arrow -rw-r--r-- 1 ***** ***** 670 Aug 28 13:08 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 28 13:08 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 28 13:08 text-train.arrow ``` - Run the same script again. (The output should be just `Using custom data configuration default`.) ``` python prepare_cached_dataset.py \ --tokenizer_name=model_name \ --block_size=512 \ --data_file=$TRAIN_DATA ``` - Check the cached directory. ```bash ls -lha /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d total 132M drwxr-xr-x 2 ***** ***** 4.0K Aug 28 13:08 . drwxr-xr-x 3 ***** ***** 4.0K Aug 28 13:08 .. -rw------- 1 ***** ***** 99M Aug 28 13:08 cache-bfc7cb0702426d19242db5e8c079f04b.arrow -rw-r--r-- 1 ***** ***** 670 Aug 28 13:20 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 28 13:20 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 28 13:08 text-train.arrow ``` - The cached file (`cache-bfc7cb0702426d19242db5e8c079f04b.arrow`) is reused. - Now, run this script with `xla_spawn.py`. Ideally, it should reuse the cached file, however, you will see each process is creating a cache file again. ```bash python xla_spawn.py --num_cores 8 \ prepare_cached_dataset.py \ --tokenizer_name=model_name \ --block_size=512 \ --data_file=$TRAIN_DATA ``` - Check the cached directory. There are two arrrow files. ```bash ls -lha /home/*****/.cache/huggingface/datasets/text/default-e84dd29acc4ad9ef/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d total 230M drwxr-xr-x 2 ***** ***** 4.0K Aug 28 13:25 . drwxr-xr-x 3 ***** ***** 4.0K Aug 28 13:08 .. -rw------- 1 ***** ***** 99M Aug 28 13:08 cache-bfc7cb0702426d19242db5e8c079f04b.arrow -rw------- 1 ***** ***** 99M Aug 28 13:25 cache-e0e2313e49c8a110aafcc8133154c19a.arrow -rw-r--r-- 1 ***** ***** 670 Aug 28 13:24 dataset_info.json -rw-r--r-- 1 ***** ***** 0 Aug 28 13:24 LICENSE -rw-r--r-- 1 ***** ***** 33M Aug 28 13:08 text-train.arrow ```
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/532
File exists error when used with TPU
I ended up specifying the `cache_file_name` argument when I call `map` function. ```python dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True, cache_file_name=cache_file_name) ``` Note: - `text` dataset in `nlp` does not strip `"\n"`. If you want the same output as in [`LineByLineTextDataset`](https://github.com/huggingface/transformers/blob/afc4ece462ad83a090af620ff4da099a0272e171/src/transformers/data/datasets/language_modeling.py#L88-L111), you would need to create your own dataset class where you replace `line` to `line.strip()` [here](https://github.com/huggingface/nlp/blob/master/datasets/text/text.py#L35).
Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ```
59
File exists error when used with TPU Hi, I'm getting a "File exists" error when I use [text dataset](https://github.com/huggingface/nlp/tree/master/datasets/text) for pre-training a RoBERTa model using `transformers` (3.0.2) and `nlp`(0.4.0) on a VM with TPU (v3-8). I modified [line 131 in the original `run_language_modeling.py`](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L131) as follows: ```python # line 131: return LineByLineTextDataset(tokenizer=tokenizer, file_path=file_path, block_size=args.block_size) dataset = load_dataset("text", data_files=file_path, split="train") dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) dataset.set_format(type='torch', columns=['input_ids']) return dataset ``` When I run this with [`xla_spawn.py`](https://github.com/huggingface/transformers/blob/master/examples/xla_spawn.py), I get the following error (it produces one message per core in TPU, which I believe is fine). It seems the current version doesn't take into account distributed training processes as in [this example](https://github.com/huggingface/transformers/blob/a573777901e662ec2e565be312ffaeedef6effec/src/transformers/data/datasets/language_modeling.py#L35-L38)? ``` 08/25/2020 13:59:41 - WARNING - nlp.builder - Using custom data configuration default 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) 08/25/2020 13:59:43 - INFO - nlp.builder - Generating dataset text (/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d) Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:6: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:4: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:1: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:7: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:3: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Downloading and preparing dataset text/default-b0932b2bdbb63283 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/ 447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d... Exception in device=TPU:2: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Exception in device=TPU:0: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) Traceback (most recent call last): FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' Traceback (most recent call last): File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 231, in _start_fn fn(gindex, *args) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/*****/huggingface_roberta/run_language_modeling.py", line 300, in _mp_fn main() File "/home/*****/huggingface_roberta/run_language_modeling.py", line 240, in main train_dataset = get_dataset(data_args, tokenizer=tokenizer) if training_args.do_train else None File "/home/*****/huggingface_roberta/run_language_modeling.py", line 134, in get_dataset dataset = load_dataset("text", data_files=file_path, split="train") File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/load.py", line 546, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 450, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/*****/.cache/huggingface/datasets/text/default-b0932b2bdbb63283/0.0.0/447f2bcfa2a721a37bc8fdf23800eade1523cf07f7eada6fe661fe4d070d380d.incomplete' ``` I ended up specifying the `cache_file_name` argument when I call `map` function. ```python dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True, cache_file_name=cache_file_name) ``` Note: - `text` dataset in `nlp` does not strip `"\n"`. If you want the same output as in [`LineByLineTextDataset`](https://github.com/huggingface/transformers/blob/afc4ece462ad83a090af620ff4da099a0272e171/src/transformers/data/datasets/language_modeling.py#L88-L111), you would need to create your own dataset class where you replace `line` to `line.strip()` [here](https://github.com/huggingface/nlp/blob/master/datasets/text/text.py#L35).
[ -0.0798373818, -0.144233346, 0.1469174325, 0.1047479585, 0.2392240465, -0.1830262393, 0.5247989297, 0.2587524951, -0.2769029438, 0.1412052661, 0.1099316254, -0.2591765523, -0.0396562144, -0.2304335833, 0.2745445371, -0.1979209036, 0.1962259263, 0.3209772408, -0.1909583509, -0.0990928635, -0.0947271883, 0.2928029299, -0.0418692902, 0.1614838988, -0.6791220307, 0.141316995, -0.1830787361, 0.2864961028, 0.1081078649, -0.3061457872, 0.1703539342, 0.0626988709, 0.2858561277, 0.5413046479, -0.0001269419, 0.3936149478, 0.1948047876, -0.2527727783, -0.0595973767, -0.1641451269, 0.3079850078, -0.0324926823, 0.0716106594, -0.1129937395, -0.1293353438, 0.1014446169, 0.3417713344, 0.0041013286, 0.4713270962, 0.2538045049, -0.0111972969, 0.7012688518, 0.0628256723, -0.1866247803, -0.0218897667, 0.279673934, -0.1007431448, 0.1228489801, 0.3792982697, -0.2468178272, 0.0520925708, 0.0928168595, 0.2208896428, -0.2092367858, -0.0801466703, 0.2455783188, 0.4375521243, -0.0800734535, 0.0164042898, 0.2247601897, 0.2114130557, -0.2419930845, -0.4570936263, -0.4064102769, -0.0087265577, -0.3136436641, 0.5325063467, 0.1597995311, -0.2045146674, 0.2758422792, -0.0676134378, -0.0035866906, -0.0381932892, -0.0560378991, 0.1150070727, 0.2927227616, 0.1143161058, -0.019800758, -0.0402776748, 0.0766946152, -0.2098600715, -0.0897776634, 0.1380932778, 0.378531754, -0.2391118109, -0.253088057, -0.1679149419, -0.5764261484, -0.139908582, 0.0170648172, -0.0117711844, -0.3582888246, -0.2725014389, 0.0793671757, 0.5551717877, 0.1752216667, -0.1873039901, 0.0450790301, 0.0471252128, 0.1027876511, -0.1314993948, -0.084047161, -0.34465307, -0.2317399979, -0.2921252549, -0.0994023755, 0.0419312492, 0.0865660608, -0.0301301368, -0.1701417565, -0.3134410381, 0.088742964, 0.1542659253, 0.09399762, 0.1844564676, 0.3348246217, 0.4495034814, 0.0126923975, -0.5675526857, -0.326512903, -0.1946421117, -0.1032907739, -0.3978536129, -0.0439433791, 0.2442616373, -0.1168974563, 0.288348645, -0.2603867948, 0.2765443921, -0.0780457482, -0.1356097311, -0.0873276368, 0.0491118319, 0.3619851172, -0.0605047308, -0.1039421037, 0.049595274, -0.3493098617, -0.1817702502, 0.3404090106, -0.1699379385, -0.359252274, 0.0314718969, 0.018452229, -0.1031048521, 0.0612262301, 0.1891772002, 0.0949121565, 0.5039545298, -0.541641593, -0.0628857091, 0.0121026207, -0.3074618876, 0.1219959483, 0.1785233766, 0.5345861316, -0.0081320936, -0.1637233943, -0.1448526829, -0.3543259501, 0.0238797143, 0.4770061672, -0.1161617935, 0.421715647, -0.2756724656, 0.1975221932, 0.2805544138, -0.3485554755, -0.0487578884, 0.2919349968, -0.2538608015, -0.1722115576, 0.1669986397, -0.2795716822, -0.2911921144, -0.3079815805, 0.0637211204, 0.0510636345, -0.0008889415, 0.0401971824, -0.2602466047, -0.119379729, -0.4364040494, 0.1627900302, 0.0766467452, 0.1036472917, -0.0920428783, 0.6391342282, 0.2819695771, 0.0595624112, 0.2897181213, -0.0073053283, 0.1470347643, 0.1178079024, -0.0899868235, 0.1348540783, 0.0085599991, 0.1045292243, -0.0317754894, 0.3992011249, -0.0099069644, -0.0652452931, 0.2647106051, 0.1742209345, 0.0090643112, -0.3494708538, -0.0604714118, 0.0241232682, -0.1790011078, 0.149003163, -0.3081001341, 0.0328932516, -0.178824544, 0.081959106, -0.2277281135, 0.2888805568, -0.123749502, -0.2570457458, -0.1084304303, 0.3896349072, -0.4102820754, 0.0260166377, -0.0665691495, 0.3695503473, -0.1494662464, 0.2167466879, 0.0701968744, 0.2750687301, 0.4112747312, 0.1022069082, -0.1609388888, 0.2704147696, 0.0733854473, -0.027739577, -0.1982138008, 0.2000834197, 0.0843486264, -0.0878725871, 0.4576551914, -0.1464756727, 0.185796842, -0.0860165432, -0.011556603, -0.1726844311, 0.1585265547, 0.3137047887, 0.0797692388, 0.2871514261, -0.2362149209, -0.3226617277, 0.485142976, -0.1081837416, 0.0846823528, 0.1235768571, 0.0567584932, 0.004567035, -0.099644877, 0.1038166955, 0.7618490458, 0.0303733125, 0.0746841654, 0.2042747736, 0.0024265426, -0.4016210437, 0.3145742714, 0.01997016, 0.1478988677, 0.3603562415, 0.045646809, 0.1358234733, -0.2201708406, -0.2086427361, 0.0125133451, 0.1076702848, -0.3380919993, -0.0305707958, -0.1294815391, -0.2260117978, -0.6135117412, 0.3738874495, -0.2147587836, 0.0300704874, 0.1859936267, -0.1521372795, -0.3798165619, 0.2276352346, 0.2427494228, 0.412045151, -0.0400347002, -0.1004718468, 0.231281653, -0.2532878816, -0.4138088822, -0.0716314092, 0.1834114343, -0.1839826107, -0.1943472326, -0.1855918765, 0.0516957343, 0.1973860115, -0.2839444876, 0.2684098482, 0.1496332437, 0.0128649026, 0.0611012541, -0.0220945626, -0.0020250755, -0.3388449848, 0.3798141181, -0.3485736549, -0.3173535466, -0.0116599919, 0.2363852262, -0.1102098823, -0.3155272007, -0.3423833847, -0.0144646373, -0.2746012211, 0.1298455447, -0.0374872647, 0.2161979675, 0.4914864004, 0.3568273485, 0.1663621664, -0.1525254548, -0.1984068602, 0.1535746902, -0.2659074962, 0.0295197107, -0.2206697911, -0.2314791232, 0.0058997059, -0.2214412689, 0.3120175898, 0.0577065498, -0.2935743332, -0.2030820698, 0.1279263645, -0.1166288927, 0.1098141968, 0.3292248249, 0.530207634, 0.0346472524, -0.092484504, -0.0594453886, -0.012163572, 0.4074870944, -0.0231231935, 0.3068992496, 0.018184578, 0.2183342874, 0.1459242702, 0.7025520802, 0.2315591872, -0.0831466019, 0.119037807, -0.0345184095, 0.3092691898, -0.253087312, 0.0555538535, 0.0235937331, 0.2866983116, -0.059413977, 0.5606925488, 0.1877890676, -0.0019275363, -0.219211489, 0.0443914831, -0.1045407429, -0.3789370358, 0.3051454425, 0.0155061102, 0.5026896596, -0.1064484343, -0.2906702757, 0.1097943038, 0.0504856408, -0.1646968871, 0.4930085838, 0.1573977619, 0.0962496325, 0.0156963561, 0.0435920134, -0.1954206824, -0.0942170545, 0.1772778183, 0.5306161046, -0.2424411923, -0.2974811494, 0.1551132798, 0.1365342736, 0.1886737645, -0.0277826954, -0.1924496442, -0.0162192006, -0.3138191402, -0.1919989288, 0.0206930153, -0.0190277193, -0.2417087853, 0.4024549127, 0.5562254786, -0.1023860946, -0.4468137622, 0.0831840709, -0.2228114009, -0.1595279127, -0.2530990541, -0.4939976335, -0.2606783211, -0.4263842404, -0.0009279748, 0.1753770262, 0.0783520117, -0.0456293449, 0.4315592051, -0.1151516438, -0.0214899592, -0.0176859237, -0.0781203732, 0.0555079058, -0.2289351225, 0.1036135182, 0.2859185338, 0.0224684123, -0.1199816987, 0.2650683224, -0.0706764981, -0.1486150771, 0.0402936749, 0.0924249589, 0.303966403, 0.5088424087, -0.0222057588, -0.0461166613, 0.3289165795, -0.033122424, -0.3946834207, -0.0668154061, 0.1291233301, -0.2472634315, -0.0779909045, -0.2480992973, 0.284638077, -0.0126134437, 0.0781784058, -0.0091101797, -0.1303604245, -0.3914086223, 0.3210027516, -0.0969046503, 1.0393942595, -0.0084025105, 0.6120115519, 0.3818510771, 0.1126776636, 0.3598694503, -0.4737110436, 0.3548024595, -0.2686953247, -0.2874264717, -0.0151408147, -0.0034193234, 0.2282912135, 0.5558612347, -0.1965658367, 0.0478177108, 0.5781379342, 0.1090813354, 0.2679473162, 0.1211236492, -0.1075654253, -0.3451636136, -0.3952371478, -0.1394960731, 0.2283515781, 0.4478594363, -0.1105583683, -0.2278491706, -0.0749550015, -0.0793945193, -0.060949441, 0.0613095984, -0.22407116, 0.0624812506, 0.5027499199, 0.0188722927, 0.297508806, 0.3734673858, 0.1682240665, 0.1691640764, -0.0724181458, 0.4037237167, -0.1006249562, -0.024204893, -0.1672067344, 0.0561545864, 0.3336465657, -0.1572694033, -0.1032643691, -0.267070502, -0.2405528128, -0.2115935534, -0.0652292669, -0.1552082598, -0.1209755614, -0.0391941294, -0.0970683247, 0.3202846348, -0.3403381407, 0.0686925054, 0.03457186, 0.0811046138, -0.368298769, -0.3365432322, -0.1137614474, -0.158622086, 0.0343489014, 0.4634483457, 0.0143186869, -0.0709292442, 0.5357792974, 0.1047845632, 0.0940946043, -0.1901984662, 0.0638119206, 0.1296216995, -0.8252723813, 0.2144872546, 0.1549893767, -0.2786584496, 0.1183842346, 0.3002383709, 0.2092140764, -0.2025869042, 0.043822512, -0.2727168202, -0.4122873247, 0.1511338204, -0.2708777487, 0.0814899728, 0.2648312449, 0.6853191853, 0.3507695198, 0.0534954518, -0.1497530192, -0.0178970601, -0.2738276422, 0.1723218113, 0.171713531, -0.1761117131, 0.2574410439, -0.0473737232, -0.1264455467, 0.225791648, -0.2392767817, 0.0320568606, -0.079801634, 0.2339299768, 0.323317945, -0.0893466473, 0.2869091332, 0.1396992803, -0.1093265414, -0.1490413696, 0.1398928165, -0.1106198803, -0.148166731, 0.2082501948, 0.2583066821, 0.2423360795, -0.3391039073, -0.1234731674, -0.0613600165, 0.087039955, 0.3047027588, -0.1691262871, -0.1774097979, -0.0503031276, -0.036733713, 0.1991206557, -0.0548996404, 0.166312322, 0.1998898685, -0.3054783344, -0.0036393311, -0.0824467689, 0.2388523668, -0.1146258786, -0.2289886177, -0.1010643691, 0.465487361, 0.0056848815, -0.2708632946, 0.3376210928, 0.0864604264, -0.1025361046, -0.1397996843, 0.2574535012, 0.1826210469, 0.0094578359, -0.0797458142, 0.4228535295, 0.0686200038, -0.5925223827, 0.2610254884, 0.5560621619, 0.1700555384, 0.4229315817, -0.0492204577, -0.106088832, 0.1530780792, 0.308247745, -0.1963420212, 0.1678282768, -0.0404758863, 0.1585054845, 0.1119919494, -0.5258699059, -0.2627845109, 0.2734744549, 0.0412895866, -0.0313572735, -0.23075293, 0.4621378481, -0.4583753347, 0.2152921706, -0.2082636058, 0.246086657, -0.1853478402, -0.2498942465, -0.0668500066, -0.0791249797, -0.2840772271, 0.0345466323, 0.0929382592, 0.1996174902, -0.1173851863, 0.1672763526, 0.1528888941, -0.391110003, -0.2510304451, -0.0109406877, 0.2041034102, -0.1220550835, 0.4520689845, 0.1890479475, -0.0954338759, 0.2551530302, 0.4810506701, 0.2450397313, 0.2664686143, 0.16094473, -0.0054428661, -0.2634570301, 0.1757066697, 0.0320557989, 0.3873578608, 0.4976800084, 0.3165104389, 0.0717504174, -0.1194693744, -0.0642401576, -0.0427796915, 0.1871773005, -0.1899291724, -0.3418014944, 0.826185286, -0.1091236621, -0.1319713295, -0.0133556835, 0.1182518601, -0.4318696558, 0.3141442835, 0.3554555178, -0.0011690694, 0.1497470886, -0.1496790349, -0.0445800498, 0.2240777314, 0.4062025249, 0.2843136787, -0.3281781971, -0.2428977638, -0.2061026245, -0.5585108995, 0.027014479, 0.0461115688, 0.2493059933, -0.0349740759, 0.0079348926, -0.0681049898, 0.049721811, -0.3419692218, -0.3155046701, 0.0513188429, -0.1820664257, -0.1156258509, -0.1244634166, -0.2046037465, 0.0460721552, 0.065391317, -0.270229876, -0.2537831366, 0.0498041771, -0.026444478, 0.0422572419, 0.1493170708, 0.1925272197, 0.18141523, -0.0711634904, 0.0884157568, 0.0676685125, 0.231080547, 0.0728292316, -0.3985943496, -0.1142987385, -0.3612945676, 0.0032338765, 0.0695549026, 0.4953393042, -0.4000499845, 0.047414396, -0.2902716994, -0.2899897993, -0.0752149373, -0.2781925797, -0.2372092307, -0.0139885666, -0.0827317238, 0.1222540587, 0.4128882587, 0.4169908166, -0.1042445004, -0.107624568, -0.5772278905, -0.3603632152, 0.3100018501, -0.5592366457, -0.087406151, 0.1202497035, -0.0655825138, 0.025223203, 0.1328889281, -0.6424121261, 0.0706516281, 0.1075027958, 0.1937762499, -0.3184124529, 0.0537421852, 0.0611679368, -0.2190912813, 0.1069520712, 0.3757639229, 0.0110930922, -0.4208606184, 0.1000858471, -0.1757012755 ]
https://github.com/huggingface/datasets/issues/525
wmt download speed example
Thanks for creating the issue :) The download link for wmt-en-de raw looks like a mirror. We should use that instead of the current url. Is this mirror official ? Also it looks like for `ro-en` it tried to download other languages. If we manage to only download the one that is asked it'd be cool Also cc @patrickvonplaten
Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 )
59
wmt download speed example Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 ) Thanks for creating the issue :) The download link for wmt-en-de raw looks like a mirror. We should use that instead of the current url. Is this mirror official ? Also it looks like for `ro-en` it tried to download other languages. If we manage to only download the one that is asked it'd be cool Also cc @patrickvonplaten
[ -0.0366920009, -0.2923783064, 0.0385639854, 0.2077880055, 0.0263426378, -0.1215781197, 0.1395125985, 0.1727901995, 0.1227243468, -0.0240064487, 0.1071397141, 0.4486669898, -0.0746834502, 0.0759547725, 0.2661069036, -0.0970807672, -0.0178979635, -0.0835175589, -0.5572077036, -0.2656838, 0.0741954669, 0.313508749, -0.1048665047, 0.0379500054, 0.0109726433, 0.1809779555, -0.0905233398, 0.0128721381, -0.4572178423, -0.2325666249, 0.0901374668, 0.1737001091, -0.0498703383, 0.1833203584, -0.0001086785, -0.1280475706, 0.4216494262, -0.0375628434, -0.4472948313, -0.317525059, -0.5728067756, -0.5532031655, -0.1477103233, -0.0608188659, 0.1857574135, -0.0601898879, 0.003949278, 0.0888582394, 0.1687778682, 0.0085923523, 0.2087498754, 0.2460334897, -0.3822529316, -0.1306511611, 0.521864295, 0.0253500827, -0.2318372279, 0.4863922, 0.393106252, 0.1596076936, 0.0922667757, 0.4000580907, -0.154428184, 0.2864336967, 0.112864159, 0.0945440084, 0.3612881303, -0.1099047288, 0.0165798552, 0.5688595176, 0.3632158339, 0.1589248329, -0.3924890459, -0.2711541951, -0.0051725688, -0.2193636447, 0.1053977385, 0.333530128, -0.3128450513, 0.0895098522, -0.6589962244, -0.0388942137, 0.0859430209, 0.2939274013, 0.0006858794, 0.6809972525, -0.0953051448, 0.0456331074, 0.0898194611, -0.0484641343, 0.0121700615, -0.3499278128, 0.0040095164, 0.0348172933, 0.0384130776, -0.0830789804, 0.1507283449, -0.0253082458, 0.0151576325, 0.0298285857, -0.1212168857, 0.2414700985, 0.2694709897, -0.0043599945, 0.2079115808, 0.3571497798, -0.1800068021, -0.1756754071, 0.1628444791, 0.0752706528, 0.2268755287, 0.2538918555, -0.2276641577, -0.0677332804, -0.4933924377, -0.0276073981, -0.0981752276, -0.0790220052, -0.2791448832, -0.2397161275, 0.0282088518, -0.1965025961, -0.1278359443, 0.1890400499, -0.2532847524, 0.2782044709, -0.1491138041, 0.045209378, -0.2284112871, -0.106747292, -0.0300924517, -0.0015245094, -0.2437843531, 0.0051835915, 0.3144954443, 0.2160781026, 0.3192484379, 0.1389926821, -0.2071333677, -0.0875618979, 0.0687249303, 0.1165935397, -0.0168888923, -0.015576358, -0.1657677591, 0.4662280381, -0.1186366901, 0.1973179579, -0.3519093394, 0.1186807379, -0.3961487114, -0.182197839, 0.0933934674, 0.1816111654, -0.3348970115, -0.2620612085, -0.03941245, 0.3635924757, -0.3202870786, 0.2390500009, -0.0523412861, -0.0484771766, -0.2543559074, -0.0335066617, 0.0671496764, 0.4082646966, -0.1602659971, -0.1924748719, -0.2034653723, 0.1912581623, 0.4898459017, 0.4522070587, -0.2085850537, 0.0941870958, -0.2111016959, 0.0376089737, 0.1644470096, -0.1547365338, -0.2068757862, 0.6244183779, -0.4453573227, 0.1312567741, 0.1468585879, 0.021251753, 0.1801607162, -0.1096655503, 0.1793664843, 0.5182014108, 0.0115400013, 0.1022069976, -0.4862096906, -0.405929476, 0.289536953, 0.0118253948, -0.1852212399, -0.1393263936, -0.0287490506, 0.1552167684, 0.324195087, -0.067867659, 0.0529372841, 0.0178251918, -0.1040145084, -0.361774981, -0.0266505908, 0.2734880149, -0.20591712, 0.3234941959, -0.0726448298, 0.3090574443, 0.2307604253, 0.2014815211, -0.2200479805, -0.1866344661, 0.0362696052, -0.0985001698, 0.1168613061, 0.0804221258, -0.0565656051, 0.0912409648, 0.1351666152, 0.0237792674, 0.013343866, 0.0601710565, 0.3700856268, -0.1242328137, 0.0169893131, -0.0740820244, 0.2616156936, -0.0662718266, 0.1205183938, -0.0700984597, -0.1816134751, 0.117689833, -0.0839944184, 0.7728489637, 0.2703161836, 0.0602897406, 0.2631714046, -0.3408565819, 0.4670613408, 0.4881792963, 0.1534878612, -0.0567408092, -0.2976082861, 0.6317290664, -0.0665881634, 0.1452823281, 0.2575869262, 0.0677094534, 0.0057374877, -0.0056527206, -0.245709002, -0.0185154472, 0.4764828086, 0.1203885823, -0.0962070227, 0.1273313463, 0.1313000172, 0.2547522783, 0.635476172, -0.1735522896, 0.054327257, 0.2032870352, -0.3028749526, -0.4658339918, 0.2684462368, 0.3569933176, 0.2943990827, 0.134041205, 0.5332391262, 0.1486280411, -0.0177148599, -0.2474838495, 0.4499844611, 0.0999941379, -0.343003422, 0.0635734797, -0.01059034, -0.0121999783, -0.2686418593, 0.2848037779, 0.0428781621, 0.0149842491, -0.1176052168, 0.0720370337, -0.493404597, -0.2570086718, -0.3033088446, -0.2698557377, -0.2456464916, -0.3047165573, 0.0502166562, -0.1831914186, -0.1301475167, 0.030114593, 0.3293046057, 0.0620108023, -0.3602297008, 0.1799548417, -0.1737008989, -0.1028608531, -0.4780777693, 0.0354306959, 0.2430088669, 0.1615808755, 0.3787634373, -0.3717290759, -0.1113353446, -0.0512097403, -0.3588240445, 0.1746948659, -0.0494211838, 0.2054582387, 0.0113349222, -0.0139567964, -0.2444419265, 0.0717153177, -0.0249674022, -0.3179237247, 0.1241821945, 0.0388135463, -0.2473673224, -0.0790556148, -0.2507553101, -0.5002612472, -0.2906686068, -0.0813753679, 0.263407141, -0.1414360106, 0.1935472637, 0.292219907, -0.1513797641, 0.3148868084, -0.0831445381, 0.185222581, -0.1199268773, -0.4302174747, 0.3204387724, -0.060275048, -0.2669698298, 0.3288853467, 0.1126203761, 0.0716879591, 0.0390772596, -0.4180580676, 0.3023875952, -0.0928384587, -0.0431096852, 0.4418204725, 0.1617445946, 0.1722647399, -0.0778146833, -0.0293382835, -0.0650476068, -0.3291346133, -0.0873753801, 0.350110054, 0.2656295598, -0.2338149399, -0.0085863797, 0.335873425, 0.5412424803, 0.1123499423, 0.3109043241, 0.0478653274, 0.1983860284, -0.1089460701, 0.2531494796, 0.0189190768, 0.3179725707, -0.2049615234, -0.0589670055, 0.3475883305, 0.2113374919, -0.3529016674, -0.1316324025, 0.1703732759, 0.0732095912, -0.2385870367, -0.0146643557, -0.0693896413, -0.1037627533, 0.1401765943, 0.0954220444, -0.1875469536, -0.2585600019, 0.0589294285, 0.3068725765, -0.0914941505, 0.1234383881, 0.0384723768, 0.040001262, -0.4884062409, -0.1577080935, 0.0374627113, 0.3167339563, 0.0552036017, 0.0052321325, 0.1884699315, -0.1565468758, 0.0461761057, -0.2120103687, 0.1149504259, -0.0534555018, -0.2566130161, -0.4716097414, -0.3695566058, -0.3273008466, -0.4731155038, 0.4219288826, 0.0111077949, -0.1668891907, -0.1243623942, 0.1625124365, 0.1825752109, 0.0208011493, 0.0075456402, 0.0194827095, -0.5261371732, -0.0277473964, -0.1128445715, -0.2303448021, -0.168861419, -0.0842979103, 0.082632415, 0.3962225914, 0.361458689, -0.0180387329, -0.0073243561, 0.0085880281, 0.0437606201, 0.1732920259, 0.1010832414, 0.3227286339, -0.2572557926, 0.4116532803, 0.251483649, 0.1263491809, -0.0851505175, -0.0144901434, 0.096261315, 0.6376786232, 0.141015321, 0.1147586852, -0.1640265137, 0.1280244887, -0.2174062878, 0.1239236742, 0.4413778186, -0.0589337759, -0.0277079567, -0.2384823561, 0.3543866575, -0.0186972991, -0.1848834008, 0.0306655709, -0.4643348455, -0.106164597, -0.1553109139, 0.165010497, 1.2208112478, -0.0829155967, 0.2892376781, 0.2155919969, -0.4171025157, 0.5484621525, -0.1115169823, -0.1139386967, 0.1213185862, 0.416041255, 0.0257533491, 0.0816483498, 0.1442886591, 0.093032971, -0.4381768703, 0.2913719118, 0.2732536197, 0.2148755193, 0.2208141685, 0.3266224563, -0.1780339032, -0.2599668205, 0.0081867659, 0.1460520327, -0.0396312885, 0.404894352, -0.016523784, -0.1932683736, -0.1302767247, -0.1470466256, -0.5490789413, 0.0887482986, -0.145157367, -0.1727002561, -0.3821455538, -0.3444069624, 0.1687266976, -0.2724868059, -0.1259729713, 0.1509996355, -0.2945031822, 0.2049815953, -0.3947579563, 0.2506481111, 0.3349377215, -0.1652315408, -0.1220943034, -0.3081342876, -0.1625579, -0.2768589556, 0.0607701838, 0.2732265592, -0.2541183829, -0.2172360569, -0.1065585911, 0.5261736512, 0.0016010988, 0.3198694885, -0.0687210038, -0.2394002825, 0.1680699885, 0.1484867185, -0.216990158, 0.3404958248, 0.0559048578, -0.2652061582, -0.3284944892, 0.455943346, -0.1275829971, -0.0958757699, 0.2058306187, 0.2329423577, -0.1831434965, -0.2538066208, -0.0710102692, -0.3330272734, -0.2490781099, 0.0377654396, -0.2313554585, -0.0287277326, -0.0312698483, 0.2239941359, 0.4230273664, 0.0452818386, -0.0434644893, -0.1492176503, -0.0193063151, 0.1178321168, 0.0930558741, 0.0369653441, -0.523183465, -0.2003668994, 0.1825504601, 0.1160080135, -0.3140278459, 0.1554561108, -0.0174042918, -0.0162279792, 0.1054591537, -0.1625567526, 0.1020605862, 0.1132233962, 0.0575038828, -0.2987833619, -0.1324886233, -0.1951032281, -0.0476423018, 0.1375062317, 0.0506285131, -0.6086691618, 0.4174444675, -0.15789482, -0.010383009, 0.0280095525, 0.0612627752, 0.0869585574, -0.1946709603, 0.2316182405, 0.0213862937, 0.1268000603, -0.1131835952, 0.1549942493, -0.0874432996, 0.4376249611, 0.1472376287, 0.0859623924, 0.4909370244, -0.0760239065, 0.0008736866, -0.086742118, -0.085429363, 0.3044657409, 0.601409018, -0.0512757041, 0.3350890875, -0.0219936427, 0.1548389643, 0.3572499454, -0.0120533081, -0.1645051837, 0.3825441301, 0.1769102663, -0.0047855782, -0.2509569824, 0.022497844, 0.1511776596, -0.117437914, 0.0811754018, 0.2170943916, 0.1162600964, -0.1577134579, -0.126821667, 0.181975916, 0.0390516706, 0.0071630995, 0.3407667279, 0.0460040607, 0.2685062885, -0.2568448484, -0.0754602551, 0.0026272614, -0.1139531806, -0.0525699779, 0.2767497003, 0.1438091248, 0.6271644235, -0.0396354571, -0.1890071183, -0.0726460442, 0.4148306251, -0.1195017695, 0.2051078528, 0.1833912432, -0.1066179052, -0.0427800864, -0.1508682072, -0.3581851125, 0.3616625965, 0.06240426, -0.3463207781, -0.1909936965, -0.1027356237, -0.3462979496, 0.3681489229, -0.3697713614, 0.0707772374, -0.002718973, 0.3390327692, 0.0976688862, -0.358630985, -0.3370802402, -0.4636332691, 0.1683697999, -0.2557737231, 0.1014710367, -0.1461807638, 0.0710592121, -0.1298067421, 0.1876081973, 0.0947513208, 0.2715926468, -0.1966739893, -0.1296515614, 0.1028223932, 0.0874676555, -0.1183482334, 0.4209773839, 0.1580830514, 0.1502565145, 0.1274961084, 0.0148600759, -0.2582023144, 0.1020782739, -0.2203730792, -0.8334546089, -0.2312730402, 0.3081341684, -0.0655828863, 0.0679112151, -0.3168428838, 0.038859304, -0.2322289497, -0.0714518875, 0.4818232954, 0.0246455055, 0.1847482473, -0.057971634, 0.0740563273, -0.1456456035, 0.5916481614, 0.2572509944, 0.2669021487, -0.3744658828, -0.2374790907, -0.3805501759, 0.0291999448, -0.2586586475, 0.0700793788, 0.0953942984, 0.0681462809, -0.0346761793, 0.4211769402, -0.0340848491, 0.6065480113, -0.1240186989, 0.0428496674, -0.113750644, -0.1234535202, 0.1284445077, 0.0653606057, -0.1536685675, -0.219508633, 0.2254100144, -0.0676793978, -0.0850572661, -0.1279169321, 0.2348799855, 0.153058216, 0.2696567178, 0.1503948122, 0.0401463136, 0.3597564995, 0.0910032988, -0.3492454588, -0.4259169102, -0.0400485247, -0.0875406042, 0.0470680706, -0.4361444712, -0.042179469, 0.1169769317, 0.2007250339, -0.2572182715, 0.0876620933, -0.0860951096, 0.1506074965, -0.1392782778, 0.0463108867, -0.2297100574, 0.1670977324, 0.0448348597, 0.2075981647, -0.1309167892, -0.0254996419, -0.3452732861, -0.0338520557, 0.2426207513, -0.2107733637, -0.1762982458, -0.3393883407, 0.2527181208, -0.2134814113, 0.1959015131, -0.0284392219, -0.001770972, 0.1980075091, -0.0186707135, -0.2138501555, 0.3829642534, 0.2446405888, -0.2085782737, 0.0527315848, 0.3852640986, 0.0374386087, -0.223434791, -0.1060093492, -0.2093633711 ]
https://github.com/huggingface/datasets/issues/525
wmt download speed example
Shall we host the files ourselves or it is fine to use this mirror in your opinion ?
Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 )
18
wmt download speed example Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 ) Shall we host the files ourselves or it is fine to use this mirror in your opinion ?
[ -0.0970186889, -0.2302698344, 0.0760001317, 0.2327992469, -0.1930160373, -0.1516973078, 0.4099263251, 0.066061914, 0.2584862709, 0.0476583876, -0.0551421084, 0.2684984505, -0.168104291, 0.0384289511, 0.2093769908, 0.0515973568, 0.0763441175, 0.0341626294, -0.6077145934, -0.262824744, 0.1051906273, 0.1649489552, -0.0395842493, -0.0544993617, -0.0968904793, 0.2049507201, -0.0659125149, 0.0196055695, -0.3745268583, -0.1257736981, 0.1418086588, 0.2571885884, 0.0026763233, 0.3433764577, -0.0001119774, 0.0217484534, 0.3440233469, -0.0119889313, -0.3946135342, -0.1340293139, -0.5043621659, -0.5133452415, -0.0980626345, -0.0678516328, 0.0444888026, -0.1336169094, -0.0031024772, 0.0976152718, 0.2608040273, -0.1199487373, 0.153133601, 0.3764329255, -0.553996563, -0.0628615692, 0.528830111, 0.0120591456, -0.1928015649, 0.7287993431, 0.4486646056, 0.2702365816, 0.0053200806, 0.3857809901, -0.2627514601, 0.2417167574, 0.2182660699, 0.143761754, 0.3119068444, 0.0835659429, -0.204093799, 0.45651564, 0.3446307778, 0.1195580289, -0.5175533891, -0.3979911804, -0.0086079137, -0.0808488503, 0.1689210832, 0.3056763113, -0.1893413216, 0.3014275134, -0.6494132876, -0.2435513884, 0.0007558711, 0.2693095505, -0.0311492477, 0.5902032256, -0.0753810331, 0.1342080832, -0.1156804934, 0.0863806456, 0.1333894432, -0.3744550645, 0.0500810631, -0.1554640383, 0.134635374, -0.2157565355, 0.0398160145, -0.2851401269, -0.1335165054, 0.2030918002, 0.0032352549, 0.0864802822, 0.1260715723, 0.0952771306, 0.1827126741, 0.3722533882, -0.3179152608, -0.1064500809, 0.1842974722, 0.0189923588, 0.2428282648, 0.1555789262, -0.1604379267, -0.0409254842, -0.5879232287, -0.0868916884, -0.1165796891, -0.1082950011, -0.1772288978, -0.1111121401, 0.139807418, -0.1824856102, -0.0964269638, 0.1045274585, -0.1154749244, 0.3642385006, -0.0578077883, 0.043413993, -0.1267213672, -0.1380357742, -0.0077104429, -0.066588439, -0.0935046971, 0.0864181146, 0.3612860441, 0.155696556, 0.3075781167, 0.0156516936, 0.0400043577, 0.1399881691, 0.1401408464, 0.1032530516, -0.0399016775, 0.1006247103, -0.1518376023, 0.3922109902, -0.2451859862, 0.3385667801, -0.3105311394, 0.0323684588, -0.3393030465, -0.339211911, 0.0903840214, 0.1400927454, -0.2683835626, -0.1725409329, -0.1806354225, 0.1373315454, -0.3919084668, 0.0645888671, -0.0769555345, -0.007026725, -0.2558454573, -0.0696704984, -0.0326820202, 0.3766860068, -0.1034615859, 0.0147954337, -0.0211648345, 0.2590465844, 0.4362415671, 0.5246805549, -0.2769944668, 0.1391406655, -0.1622255892, 0.0690061525, 0.0558939092, -0.2430536002, -0.2646180689, 0.6330520511, -0.5914660096, -0.0062273946, 0.3196913302, 0.0374977179, 0.2989467978, -0.2110327035, 0.2449944317, 0.5267233849, 0.1126666889, 0.0809038877, -0.4941199124, -0.4558442533, 0.2412896305, 0.1632139683, -0.208690837, -0.1027115732, -0.0507311933, 0.2361126542, 0.2248371691, -0.1360492259, -0.0092617888, -0.1300796121, -0.0910943449, -0.3411985636, -0.1972527653, 0.2972260714, -0.1848717481, 0.281655103, 0.0172873456, 0.250207752, 0.3418702781, 0.0803095177, -0.0942329094, -0.2476300597, 0.0873018205, -0.031580843, 0.0378061235, 0.1351811737, -0.0566877089, -0.0686645657, 0.0052514039, 0.1243493631, -0.0264910292, 0.1590864509, 0.3992735744, -0.0466009639, 0.0200522617, 0.0172211435, 0.2545694113, -0.0975962877, 0.0373169854, -0.140478164, -0.0191657096, 0.1281845272, -0.227266252, 0.8664547205, 0.3883675337, -0.009144268, 0.4069116712, -0.3548853695, 0.5632674694, 0.4918876886, 0.09385214, -0.0801297501, -0.3097837567, 0.5304617882, -0.0195398051, 0.1419156343, 0.247745201, -0.0110154087, -0.1525165588, 0.0978007019, -0.250664115, -0.0653888136, 0.4053532183, 0.1671308726, 0.0045258268, 0.2160788924, 0.0775752887, 0.1888604462, 0.4810031056, -0.1825459003, -0.0097447755, 0.0617798269, -0.1871861517, -0.3809095621, 0.3489968479, 0.3133144975, 0.4159399271, 0.2065534294, 0.4286358654, 0.1747939587, 0.0932023525, -0.2560549676, 0.4070366919, 0.0821525306, -0.3458170593, 0.138035208, 0.0604518093, 0.0187937319, -0.2305565774, 0.1780950129, 0.0391163304, -0.1586551964, -0.1597522497, 0.0542651489, -0.2796343863, -0.1378207207, -0.38628757, -0.1363771856, -0.2332432419, -0.2318858802, 0.0297002289, -0.0364916995, -0.209193036, -0.1093642116, 0.3059451282, 0.177564308, -0.5119213462, 0.0521568023, -0.1741000414, -0.0387713648, -0.3981321454, -0.0045327684, 0.2409882694, 0.0839548185, 0.4800806344, -0.2831422985, -0.0959867239, -0.1280895025, -0.2729631364, 0.1172755808, 0.0654703379, 0.1425894201, 0.0450696312, 0.020990001, -0.1486744583, 0.0222844929, -0.058536496, -0.2918949723, 0.1592783779, -0.0876684487, -0.2113157213, -0.0501285419, -0.2477100939, -0.5144857168, -0.2921960652, -0.1058583036, 0.163471967, -0.197787255, 0.2133411467, 0.1712709665, -0.1417770833, 0.1947846711, -0.1191125587, 0.1587195098, -0.05976253, -0.5474858284, 0.2177074552, -0.0215539411, -0.2499403208, 0.1782259494, 0.2267055809, -0.0758670121, 0.1330332905, -0.4908932745, 0.2066098452, 0.0889604762, -0.0867543221, 0.5087789893, 0.2504210472, 0.1344646811, -0.0427320749, -0.0128220329, -0.0286971461, -0.2431732118, -0.0593143329, 0.4615965486, 0.0892490745, -0.0717800036, -0.0344241783, 0.2145274431, 0.7158353329, 0.1123101786, 0.2709054649, 0.0734362677, 0.1690087169, -0.0442202538, 0.1032897756, -0.0450688638, 0.3228220344, -0.0915732682, -0.198136881, 0.3320975304, 0.1605143249, -0.3140476644, -0.2965776324, -0.0691009834, -0.0836939588, -0.2231551707, -0.0285989419, 0.0346234553, -0.0391560383, 0.2152926326, 0.0351674594, -0.1530731022, -0.1862275153, 0.0510195531, 0.2082630992, 0.0232880209, 0.1214369759, 0.1869954467, 0.0174500123, -0.5837158561, -0.1514391154, -0.0604087524, 0.4268852174, 0.1196801439, -0.0053087887, 0.2003972977, -0.1578147709, 0.1050108224, -0.1754294634, 0.1773992777, -0.2610223889, -0.2920269072, -0.509114325, -0.2712904215, -0.2293031067, -0.4954595864, 0.3333486617, 0.1774185598, -0.2093190402, -0.0772736669, 0.1002499685, 0.1798797101, -0.0299486388, -0.0471301526, 0.090333879, -0.4981133044, -0.0542900227, -0.2347118556, -0.2449139357, -0.235981524, 0.1032375246, 0.1892077327, 0.3253813088, 0.3559901714, 0.0577485338, 0.0654739812, -0.1120629758, 0.0077315201, 0.183193773, 0.1641876101, 0.5088051558, -0.2714177072, 0.5144895315, 0.3122366369, 0.2775200009, -0.1294932961, -0.0580589026, 0.109176375, 0.7778981924, 0.1361855865, -0.0957428217, -0.2226420194, 0.0911439657, -0.2652905285, 0.0761788487, 0.2636012435, -0.1587103605, 0.0467040688, -0.1856401712, 0.4024966955, 0.0445794389, -0.1112495065, -0.1283765286, -0.325979501, -0.0579228215, 0.0264301095, 0.1786334068, 1.2413953543, -0.0512665957, 0.5479648709, 0.3398544192, -0.3731057942, 0.6129071116, -0.3549624979, -0.2105881721, 0.1111224666, 0.4099708498, -0.0888913572, 0.0101737678, 0.1415469199, 0.1383722723, -0.1926464438, 0.3214411438, 0.3675508201, 0.2141023129, 0.1016230509, 0.4243978858, -0.1762023866, -0.2723136842, 0.1168754324, 0.0460685305, -0.0769594237, 0.3433994651, -0.0870348737, -0.2236351073, -0.158271268, -0.1783518046, -0.3901976943, 0.0252666846, 0.0243974198, -0.0944941938, -0.4595498443, -0.3507032692, 0.1282485723, -0.4450740516, -0.2020016611, 0.1782256216, -0.277497679, 0.0638346449, -0.411368221, 0.2809461355, 0.3688466847, -0.1442649066, -0.0672984645, -0.3414595425, -0.1593785882, -0.243957907, 0.1144460961, 0.091448769, -0.1264484227, -0.1907730252, -0.1291675717, 0.4585460126, -0.142193988, 0.3873197734, -0.140536353, -0.1438748688, 0.1080985144, 0.0851508081, -0.2322064787, 0.2715296447, 0.0208106432, -0.2724520862, -0.3984048069, 0.5281149149, 0.0161828659, 0.022514319, 0.1650773734, 0.2041154206, -0.1229284182, -0.2184976488, -0.0596869513, -0.3233781159, -0.2938449681, -0.0270118546, -0.2106586546, -0.0880989432, -0.1055648848, 0.1250368208, 0.559165895, 0.0456969067, -0.070609808, -0.0698533505, -0.0359767042, 0.1490235329, 0.1137290373, 0.1139962003, -0.2447699904, -0.157065019, 0.0539070144, -0.0921539217, -0.2827052772, 0.0909491107, 0.0752788484, -0.0176337138, 0.1012664512, -0.1367359906, 0.0663046241, 0.0776913092, 0.0151348468, -0.2517246008, -0.1639627665, -0.1377806962, 0.0428202339, 0.1708699316, 0.1362428963, -0.5324262977, 0.3317976892, -0.2287674099, -0.1382035166, 0.1105388328, 0.1144322082, 0.1019742638, -0.143972367, 0.1564759761, 0.0012162493, 0.0148288179, -0.2591872513, 0.4146897197, -0.0019634962, 0.3680514097, -0.0486136973, 0.0644156262, 0.4446602464, -0.049510099, -0.0428197086, -0.0697859675, -0.1663293839, 0.4053021669, 0.6680961847, -0.0827414468, 0.3558433652, 0.0900746882, 0.2813592553, 0.3420076072, -0.0242600255, -0.2278637439, 0.3319768608, 0.1144140586, -0.0572642349, -0.2742272913, 0.113665171, 0.2460721582, -0.1159611121, 0.1479766965, 0.3108560443, 0.1180342659, -0.4081665277, -0.0566991009, 0.1665657461, 0.2172144055, -0.0733054951, 0.328807503, 0.0730557367, 0.2956295907, -0.2882791758, 0.0651039183, -0.0272112768, 0.0072314003, -0.0644329712, 0.3254028857, 0.1335480213, 0.5295645595, -0.0152423745, -0.2173380703, -0.0067765345, 0.3404940665, 0.0472746342, 0.1829465628, 0.1153548658, -0.1629118621, -0.0913250074, -0.168131426, -0.318459928, 0.3788326085, 0.0995468646, -0.2279992104, -0.1665635705, 0.0182780307, -0.2023861259, 0.4663449824, -0.4102464318, -0.0335330218, -0.0610462651, 0.4058501124, 0.1479466856, -0.2261378169, -0.1839339137, -0.4843291938, 0.1700110883, -0.2348320782, 0.0972102955, -0.1264780015, 0.0262410622, 0.0391525887, 0.4013298154, 0.0752621368, 0.1574715972, -0.1435386091, -0.0534455068, -0.0087838946, 0.0822142065, -0.2174325734, 0.2964997292, 0.0206263233, 0.0996233821, 0.1984226555, 0.0122813685, -0.1984617114, 0.0293005444, -0.2606434822, -0.7364002466, -0.295145303, 0.2905284166, -0.103631407, -0.0496592261, -0.222522974, 0.0644871891, -0.3825049996, -0.0347699672, 0.6124907136, 0.1132047251, 0.2108598202, -0.0199695528, 0.0322236009, -0.2134576142, 0.6463638544, 0.2980591059, 0.2459904253, -0.3212288916, -0.1414686441, -0.3462897241, 0.0655434281, -0.2151901722, 0.1030265614, 0.0468516052, 0.0800825357, 0.0053182757, 0.4956418872, -0.0943778753, 0.6934794188, -0.3345605433, 0.0004037177, 0.0100862412, -0.1352154613, 0.0052143009, 0.098165229, -0.1735398024, -0.2624406219, 0.199880898, 0.039198108, -0.1149830073, -0.0844619349, 0.2595460415, 0.1401651055, 0.1990090013, 0.2034510821, -0.0767746493, 0.2250241339, 0.1066276357, -0.3222241104, -0.4003609717, -0.0525873601, -0.1452838331, -0.042583324, -0.3721708357, -0.0040717344, 0.0323503166, 0.3106037974, -0.1983380914, -0.0282452106, -0.0853509679, 0.1447117478, -0.1080790833, 0.0099681476, -0.4353296757, 0.0790131018, 0.1022069231, 0.2661632299, -0.1070323288, -0.2484217435, -0.3806072176, -0.0880280733, 0.3034051657, -0.2912919521, -0.0510535389, -0.2912945747, 0.3219889104, -0.1367407888, 0.1849549562, -0.0974547118, 0.0435682759, 0.1183544621, -0.104017511, -0.1707697511, 0.2843354046, 0.2103102058, -0.2942460179, 0.0086485194, 0.3904813826, -0.167949006, -0.2728066146, -0.2695900202, -0.1056654826 ]
https://github.com/huggingface/datasets/issues/525
wmt download speed example
Should we add an argument in `load_dataset` to override some URL with a custom URL (e.g. mirror) or a local path? This could also be used to provide local files instead of the original files as requested by some users (e.g. when you made a dataset with the same format than SQuAD and what to use it instead of the official dataset files).
Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 )
63
wmt download speed example Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 ) Should we add an argument in `load_dataset` to override some URL with a custom URL (e.g. mirror) or a local path? This could also be used to provide local files instead of the original files as requested by some users (e.g. when you made a dataset with the same format than SQuAD and what to use it instead of the official dataset files).
[ -0.1401738524, -0.0430656299, 0.0662448704, 0.0506723598, 0.0602066889, -0.1812297553, 0.2489058971, 0.1119346991, 0.1134403646, -0.0137723908, 0.0660709962, 0.5972366929, -0.0576727651, 0.0454577208, 0.2306547761, 0.0531795509, -0.1269129664, -0.0680234581, -0.5435422063, -0.1649614573, -0.0084482366, 0.1539153904, -0.0286865644, -0.0853235424, -0.0160793755, 0.1635006219, -0.0522697233, 0.1442736685, -0.3232901394, -0.422385633, 0.1229840219, 0.2223756909, 0.0290665701, 0.2388715893, -0.0001091673, -0.0348558091, 0.3812174201, -0.0277622603, -0.5606549382, -0.2062462568, -0.5388456583, -0.5287120938, -0.0515059233, -0.1500377059, 0.1338905394, 0.0201803427, 0.029465314, -0.0525282398, 0.2164443731, 0.0395456925, 0.1784766465, 0.3661825061, -0.5167110562, -0.093847841, 0.4847781062, 0.0027494382, -0.22343117, 0.4499019384, 0.4752112031, 0.1483809203, -0.013992928, 0.3062312603, -0.2024826854, 0.3198316395, 0.250479877, 0.0922965407, 0.2866602242, 0.0172407422, -0.0795297474, 0.5750322342, 0.4227977395, 0.0624038391, -0.5002787113, -0.3649968803, 0.1189359874, -0.1521319449, 0.1861511171, 0.2799282074, -0.3316591978, 0.1248507574, -0.5772379637, -0.0171524901, -0.0086233011, 0.3052996397, 0.0751179382, 0.6365683079, -0.029803019, 0.0889756083, 0.0519582517, 0.0231269393, 0.0600559227, -0.3546410501, 0.1290397644, 0.0254483745, -0.0640968084, -0.1827633828, 0.1450036317, -0.1434673518, 0.0556558818, 0.0483116955, 0.0375731327, 0.2358701527, 0.2863414288, 0.0416202992, 0.2809548974, 0.1880234778, -0.2490610629, -0.1966476291, 0.1953297853, -0.064745836, 0.1743029505, 0.1942550093, -0.1582809836, -0.099594757, -0.402515322, -0.1299948841, 0.00499732, 0.0445325486, -0.2315446287, -0.3442464173, 0.1634340286, -0.154337883, -0.0295564681, 0.2383633405, -0.231964618, 0.2009650171, -0.2369830608, 0.0273461696, -0.2427756339, -0.0867124945, -0.0774692371, -0.0758915395, -0.1686363667, 0.1335098892, 0.4017015398, 0.1725014448, 0.3206162751, -0.0123996204, -0.2200239748, 0.0505859628, 0.1651199013, 0.1433418244, -0.0575470626, -0.0479818247, -0.0609801002, 0.3564447463, -0.1713733375, 0.1529393792, -0.3698183894, 0.1584869027, -0.4505819678, -0.3000794649, 0.0098982984, 0.1790205091, -0.3993911147, -0.3566007912, -0.1363362074, 0.3336696923, -0.4130514264, 0.1365328133, -0.1254843622, 0.0593282692, -0.3018196523, -0.0340455361, 0.0507968925, 0.4687488377, -0.2249722779, -0.1960880011, -0.1931685507, 0.2358483672, 0.3037903607, 0.4155171514, -0.3779419959, 0.1080227941, -0.1842556, 0.0571969263, 0.3586403131, -0.3323925436, -0.2837772965, 0.5307897925, -0.5233166218, 0.0617461801, 0.202464506, 0.1216155961, 0.2539981604, -0.1279944032, 0.0827526301, 0.6500005126, -0.0270977523, 0.1977934539, -0.458914727, -0.4428385198, 0.2827782035, 0.1533720791, -0.2588039935, -0.077605024, 0.0641295984, 0.2633572221, 0.2396989614, -0.0735430643, 0.0113800419, -0.0566635616, -0.0633370578, -0.3452428281, -0.13621521, 0.338670373, -0.4280270934, 0.3024759591, -0.0730888918, 0.3111577928, 0.1986287683, 0.0526194535, -0.1303731203, -0.2048600912, -0.0220028814, -0.0455685295, 0.0781747997, 0.208710447, -0.0010315278, -0.0329718478, 0.0532726683, -0.0190538093, -0.0692306012, 0.1288837492, 0.3759297729, -0.0387994312, 0.033779379, -0.080942668, 0.3571796417, -0.0392468832, 0.1040325016, -0.0517287329, -0.1456836015, 0.2341831625, -0.1372873187, 0.7774733901, 0.3542417586, 0.0056491015, 0.2782478929, -0.2661020458, 0.480173707, 0.450813055, 0.090347752, -0.0047087003, -0.4777364135, 0.5367772579, -0.1658909619, 0.205107376, 0.2896354795, -0.0087827137, 0.0856240243, 0.027764041, -0.3223412633, -0.0495688207, 0.2209583372, 0.1809860021, 0.062355604, 0.1957707703, 0.1109706089, 0.3044627905, 0.6227396131, -0.171856761, 0.0422485135, 0.2157828808, -0.2499337643, -0.5171296597, 0.3028020263, 0.3569073081, 0.4761765897, 0.2474782467, 0.4310212135, 0.0737209022, -0.0636573583, -0.271291405, 0.3826602399, 0.1265354306, -0.3748048544, 0.0553992502, 0.1359219849, -0.0237428658, -0.2967225015, 0.1882193387, 0.084145315, 0.022842193, -0.1887818575, 0.0943801999, -0.4816098511, -0.2449494302, -0.3461509347, -0.1799570471, -0.2855327129, -0.3380045593, 0.0620545037, -0.1093808189, -0.1883794367, 0.0807610378, 0.2616905272, 0.2746520936, -0.3171335161, -0.0398596227, -0.1123807132, -0.121393472, -0.3910531104, 0.025341671, 0.2653008699, 0.2031012326, 0.3739596903, -0.2555415034, -0.0685696825, -0.1352080703, -0.3251981735, 0.1363383681, 0.0960098654, 0.3435522318, 0.1109581515, 0.1049075574, -0.150876388, -0.0654416978, 0.0444718003, -0.2533890009, 0.170656085, -0.107608825, -0.2372183949, -0.0109762773, -0.1955931485, -0.5634588599, -0.3295456469, -0.2169275135, 0.1890611351, -0.0816297755, 0.1998164058, 0.3314263523, -0.0365299135, 0.360394299, -0.1359025091, 0.0994871929, -0.1641946733, -0.5906576514, 0.3921247125, -0.1721303761, -0.2118633538, 0.2214896828, 0.0735788047, 0.1024073735, 0.0603682026, -0.48763448, 0.147314921, 0.0086396197, 0.0074476758, 0.3440038264, 0.2092835009, 0.1979777813, -0.1226311177, -0.0196430925, -0.0573194735, -0.3735267818, -0.0599365532, 0.4258567393, 0.2736263871, -0.1724297851, 0.0042300285, 0.2495697141, 0.6213099957, 0.0086261379, 0.2401252687, 0.1506209373, 0.0887306854, 0.0395379998, 0.2544416785, 0.0111289369, 0.4417017996, -0.0943872333, 0.009734109, 0.3715402782, 0.2294645309, -0.3094243109, -0.1197520643, 0.0856710896, 0.0413756333, -0.3028290272, 0.0665810108, 0.0872151032, -0.1653723866, 0.2036623359, 0.1021774933, -0.3788697124, -0.2287274152, 0.000972743, 0.3664318025, -0.0112817865, 0.1826779693, -0.153488338, 0.1495298892, -0.5660689473, -0.110604167, 0.0032999148, 0.2913617194, 0.1697707474, -0.0129301343, 0.0722884089, -0.0817570165, 0.1548690796, -0.2576474547, 0.0838658214, -0.1553104073, -0.1887226403, -0.5956741571, -0.2519660294, -0.109741427, -0.3701532185, 0.3256335557, 0.1633914858, -0.1536769122, -0.254347682, 0.2115941495, 0.0952995792, 0.0143090598, -0.0936375335, 0.0478194691, -0.5150455236, -0.1141295135, -0.1453861445, -0.2715371549, -0.1408788264, 0.0269032978, -0.0670616925, 0.2952197492, 0.3303212523, -0.0917470157, 0.0781195983, 0.0124167446, 0.2065199465, 0.2116667926, 0.1049584374, 0.3575662374, -0.2163474709, 0.4708111286, 0.1069052592, 0.0359310433, -0.0078179035, -0.0741851926, 0.1217954308, 0.6792546511, 0.1438568383, 0.0894056708, -0.1710983664, 0.0827871859, -0.2717100382, 0.2893839777, 0.3266995251, -0.1793210208, 0.0642345548, -0.3848213553, 0.3439783156, -0.0726117417, -0.1075433865, 0.1265310943, -0.3777020574, -0.1238894239, -0.0549104773, 0.2150654644, 1.1090856791, -0.1453067958, 0.3599410355, 0.3286303282, -0.3125866354, 0.6720411181, -0.1128689423, -0.1041186154, 0.1323555261, 0.3963901401, 0.0688301995, 0.0030710655, 0.1413908154, 0.3241015971, -0.314312309, 0.3108193278, 0.3265372813, 0.2781631947, 0.1273647994, 0.5954553485, -0.1624188423, -0.4131711721, -0.1340102702, 0.1710876375, -0.1431821436, 0.231787771, 0.0013284549, -0.1586712599, -0.0011413945, -0.1303227693, -0.3256801069, -0.0010126007, -0.2405776232, -0.1992857456, -0.3163982928, -0.3503410518, 0.1740938574, -0.177769199, -0.2547171712, 0.1785104573, -0.3482359946, 0.2497156709, -0.4957493544, 0.2895108759, 0.2319343239, -0.147220701, -0.069279097, -0.2525032759, -0.1565078795, -0.2393179536, 0.0925186276, -0.0974794924, -0.0912380517, -0.2452709824, -0.0557975471, 0.3949803114, -0.1176539361, 0.2038956285, -0.15659374, -0.249296546, 0.1574813873, 0.1143657342, -0.1629765779, 0.396042943, 0.1069387272, -0.2614463866, -0.3413654566, 0.4885402918, -0.2765489817, -0.0615251102, 0.2336362898, 0.1557387263, -0.1110067591, -0.2471164316, -0.0362694897, -0.24580203, -0.1622364521, 0.0235785916, -0.2357711643, -0.0581382029, 0.0265011489, 0.2130109817, 0.3274290562, 0.1567625999, -0.0255360715, -0.1540928334, -0.0428746417, 0.1159025952, 0.1328274757, 0.0901322514, -0.3304203153, -0.1285470128, 0.0739915818, 0.0358346179, -0.3404175341, 0.133142978, 0.0018465025, 0.0540980436, 0.0885093957, -0.1253243387, 0.1922054291, 0.075835526, 0.0379018821, -0.2574369609, -0.1625722051, -0.2088868022, -0.1289767474, 0.1288842857, 0.0279289223, -0.5542565584, 0.2583651841, -0.2547997534, -0.0465642996, -0.0423142537, 0.1137968749, 0.0943848863, -0.2149706036, 0.1778301746, -0.0196651928, 0.0237754993, -0.1117228046, 0.1866173595, -0.0113711162, 0.3861467242, 0.1349963397, 0.216628626, 0.3578082323, -0.033559531, 0.0262247771, -0.0344989635, -0.0337326787, 0.4142053127, 0.5385563374, -0.0902965516, 0.210346207, 0.1377087086, 0.1006857976, 0.3548390269, -0.0678972453, -0.1434861869, 0.3465024233, 0.1763028204, 0.0150447963, -0.3085131049, 0.049649857, 0.1041299179, 0.0153581314, 0.1124410704, 0.1885600537, 0.107668221, -0.2401632518, -0.1056160852, 0.3327110708, 0.0869319364, -0.0052423924, 0.2966093719, -0.1117815226, 0.1312165111, -0.1709474176, 0.0042503709, 0.0453567281, -0.0272478145, -0.0770830959, 0.2865385413, 0.088154234, 0.5736839175, -0.1039938331, -0.15353854, -0.0302678198, 0.4111754, -0.1179986969, 0.231750071, 0.1915979236, -0.0341951661, -0.0863345042, -0.1675746292, -0.1613705307, 0.2868330479, 0.0892393887, -0.3066064119, -0.3026068509, -0.1101240814, -0.2407026589, 0.341642797, -0.3660487533, -0.0802690461, -0.0530523174, 0.2778144479, 0.1537458003, -0.2622273266, -0.1393932849, -0.3666599095, 0.0990123302, -0.2527458072, 0.0838491917, -0.1308986098, 0.1243990809, 0.0224082638, 0.1503724158, 0.1136516258, 0.2444441617, -0.1679366976, -0.0952025279, 0.0947593078, 0.0610179603, -0.226065591, 0.2288853377, 0.0501585826, -0.0193013903, 0.2327533364, 0.0663525537, -0.2215144485, 0.0119336499, -0.1773618013, -0.7652968764, -0.2818597257, 0.2427920103, 0.089527458, 0.0186089762, -0.2629154325, 0.1194322631, -0.1581220031, -0.0575798042, 0.5074002743, 0.0057015438, 0.2013275921, -0.0759596899, 0.0824250579, -0.1424694359, 0.6969803572, 0.1067083478, 0.1756346226, -0.3695187569, -0.1531879008, -0.5551540256, 0.0202677548, -0.1759876311, 0.043942567, 0.1819247454, 0.2019899189, -0.0927355811, 0.5005366802, -0.0832170621, 0.5214189887, -0.0795300901, -0.0151402578, -0.1287300885, -0.2067310363, 0.0540202707, 0.1199584678, -0.0565967262, -0.2893301249, 0.164491564, 0.0172602907, -0.1056065708, -0.1385485977, 0.1957021207, 0.1395483166, 0.1905778795, 0.1874490231, -0.0867072642, 0.296843946, 0.0934022367, -0.2792482078, -0.4411058724, -0.10138762, -0.2070909888, -0.0262074489, -0.4229456782, -0.0029905348, 0.0609509461, 0.2148263752, -0.3219363093, 0.0542617477, -0.0594870001, 0.148198694, -0.0824298635, 0.1172233671, -0.2113015354, 0.1959908605, -0.0120273493, 0.1964809448, -0.090424262, -0.0009055476, -0.2757563889, 0.0070150131, 0.2989309728, -0.2603604496, -0.1206922084, -0.3642935455, 0.2702485621, -0.2071136385, 0.2036069781, -0.1141018346, 0.0322823785, 0.2379380614, -0.0222252812, -0.1997592449, 0.3995939791, 0.1431196928, -0.1232108921, 0.0237855017, 0.2609977126, 0.0480976403, -0.1497208327, -0.1654861569, -0.1931342334 ]
https://github.com/huggingface/datasets/issues/525
wmt download speed example
@lhoestq I think we should host it ourselves. I'll put the subset of wmt (without preprocessed files) that we need on s3 and post a link over the weekend.
Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 )
29
wmt download speed example Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 ) @lhoestq I think we should host it ourselves. I'll put the subset of wmt (without preprocessed files) that we need on s3 and post a link over the weekend.
[ -0.2155660689, -0.120622769, -0.0204933863, 0.1300847828, 0.0658164695, -0.1955838501, 0.2002229244, 0.1801559776, 0.143398568, 0.1119241789, -0.0341101252, 0.4751237035, -0.1775704622, 0.2044600993, 0.2067528814, 0.0962957516, -0.00707315, 0.0183813944, -0.5470454097, -0.1375177801, 0.0861988515, 0.2179209739, -0.0510409363, -0.1955762357, -0.0300692376, 0.1657572538, -0.1316437125, 0.0727208182, -0.4188371003, -0.2630720139, 0.1180557907, 0.2656255662, 0.0648000613, 0.3028048277, -0.0001020328, -0.1106324643, 0.2632770538, -0.0324821807, -0.4443928897, -0.1743229926, -0.5166608691, -0.5105952621, -0.2215473354, 0.0091435052, -0.0608069375, -0.0149901332, -0.0065325256, -0.0132249082, 0.2297483087, 0.004442744, 0.2328478843, 0.3598413765, -0.4252636731, -0.0844931081, 0.4815311134, 0.0049269805, -0.2498242855, 0.4009499252, 0.3564257324, 0.0796064958, 0.0113520594, 0.4700134099, -0.2561068535, 0.2787463069, 0.2031781375, 0.0228025615, 0.2285641879, -0.0028509882, -0.1551724821, 0.560880661, 0.3373491466, 0.1065415666, -0.517788887, -0.290938437, 0.0493707508, -0.2340980023, 0.1028874069, 0.299449563, -0.3247202933, 0.1200972572, -0.5581644177, -0.0929769278, -0.0255203322, 0.2339280099, 0.0102103017, 0.7001998425, -0.1331141889, -0.008421951, -0.0204181597, -0.0180140454, 0.0947137922, -0.1942600459, 0.0571601726, -0.076982677, 0.0418053009, -0.2353387773, 0.1806430221, -0.129410699, -0.0580372103, 0.1132813618, -0.1338839233, 0.1659894288, 0.4308973253, 0.0214830246, 0.1853032261, 0.1846228242, -0.2198335826, -0.3102082312, 0.2138500512, 0.1062675342, 0.2071758807, 0.19355461, -0.221650511, -0.0671726242, -0.4991377294, -0.0334163904, -0.0477717631, -0.0327215716, -0.1735000759, -0.2733839154, 0.1939502358, -0.1617196798, -0.1389788091, 0.2310476899, -0.2283912003, 0.2743048966, -0.1372371018, 0.0448947512, -0.1253166497, -0.1350655109, -0.0852318928, 0.0259632766, -0.1604277492, 0.0628021806, 0.4178488851, 0.1151153594, 0.2968904376, 0.04820548, -0.1270539016, 0.0623153597, 0.1218129173, 0.2479026318, 0.0074635702, 0.0301756505, -0.0424834043, 0.236386016, -0.2150468528, 0.2390696406, -0.347738713, -0.0609672628, -0.200308919, -0.2398065776, -0.0375852585, 0.2353382409, -0.3309753835, -0.2809255719, -0.0166016817, 0.2984886467, -0.3401364088, 0.2245848924, -0.0754441395, 0.0480986051, -0.2222737521, -0.0174946785, 0.0495949574, 0.3618357778, -0.0601065047, -0.0221715756, -0.1672597378, 0.3471522033, 0.411524415, 0.3610857427, -0.1718592644, -0.0356689543, -0.1001423001, 0.1138965115, 0.1149028912, -0.2124210298, -0.1597552001, 0.5290460587, -0.4272658527, -0.051252041, 0.198079437, 0.037726976, 0.1451047659, -0.1989156604, 0.1015515924, 0.6101765037, 0.0147081744, 0.0896478295, -0.4038209319, -0.40238446, 0.2538381815, 0.1133941114, -0.2388012409, -0.2257613689, -0.0191054996, 0.2652854621, 0.2038479894, -0.0947932824, 0.0399128571, -0.0602308959, -0.000427282, -0.3014580607, -0.2138357162, 0.1486182213, -0.1586671621, 0.2525815368, 0.031803336, 0.3712975979, 0.2999789119, 0.0660212412, -0.0779221654, -0.1569647491, 0.0843522772, -0.0943667516, 0.1866601706, 0.264654994, 0.070915252, -0.0910294279, -0.0194467157, -0.1746231467, 0.1247933209, 0.0471180677, 0.3464388251, -0.2572756708, -0.0442041978, -0.0858552158, 0.4426566958, -0.028597638, -0.0212583002, 0.0165664256, -0.0540231764, 0.1077196598, -0.1630093902, 0.721981883, 0.2625409067, 0.0902176127, 0.1276447028, -0.1887955815, 0.408460319, 0.3476680815, 0.0464665294, 0.0551670007, -0.346750766, 0.5725200772, -0.0478213243, 0.1236317828, 0.1868000776, 0.1262734979, 0.0195047017, 0.0551025793, -0.2233823538, -0.0770522431, 0.3090644777, 0.0208187196, -0.1342976391, 0.1040954664, 0.0351865143, 0.2854645848, 0.6748988628, -0.1631390452, 0.1368695945, 0.1020007059, -0.2426295578, -0.5028502345, 0.3370275795, 0.2667830586, 0.2922966778, 0.2082757056, 0.5471043587, 0.1239028722, 0.1133710071, -0.2837969959, 0.4416499138, 0.0307942946, -0.2400394678, 0.052026663, 0.0643799081, 0.0097812386, -0.2793462873, 0.2093323618, -0.0416764952, -0.0475104153, -0.0696108043, 0.1332088113, -0.3933754861, -0.2082936317, -0.1213199273, -0.2465980053, -0.2604212463, -0.2351294756, 0.1347338706, -0.0801399797, -0.1687467098, -0.0055047055, 0.3391523361, 0.1928296387, -0.3416616619, 0.0859151855, -0.208018139, -0.1062612683, -0.3279312849, 0.135503456, 0.259531498, 0.0796538591, 0.4632076621, -0.2562023103, -0.0677860156, 0.0012312229, -0.3010242879, 0.1154057309, -0.0636521727, 0.2974291444, 0.1763877273, 0.0849846825, -0.2226351947, 0.0782183111, -0.037887089, -0.2860150337, 0.0537932068, -0.0335328095, -0.1982925236, -0.1498123258, -0.2401800752, -0.4638534784, -0.2347117364, -0.1960784644, 0.2384763211, -0.145749405, 0.1154225171, 0.1634501219, -0.1321241111, 0.2078085095, -0.088871181, 0.1999315023, -0.1722768545, -0.5507377982, 0.3365274072, -0.122658059, -0.2967383862, 0.2950409949, 0.180397585, 0.1631670147, 0.0276238248, -0.4810866416, 0.2160254866, 0.0755475834, -0.0122782299, 0.4312323332, 0.1811035573, 0.2614406049, -0.0525122508, -0.1331842095, -0.1169031784, -0.2547281981, -0.1903388351, 0.3488101363, 0.0875856951, -0.2828312516, -0.0525929071, 0.3150903881, 0.4403004646, 0.0352593623, 0.2692221701, 0.1453134567, 0.1900501996, 0.0205957182, 0.1813971251, 0.0188442226, 0.4231964946, -0.0633484721, -0.0132917669, 0.3236266375, 0.1291986853, -0.3245404959, -0.291439712, 0.0539337583, 0.0542901456, -0.1991475523, 0.0365900472, 0.0328367129, -0.082502313, 0.2604837716, 0.1136522666, -0.1314817071, -0.2285271585, 0.1083635017, 0.2110734135, 0.0231595151, 0.1771337092, 0.0534083731, 0.0787192583, -0.6460817456, -0.1111495346, -0.0496116653, 0.2459916174, 0.0804357231, -0.1045288369, 0.0938569531, -0.2556419075, 0.0522536151, -0.2582130134, 0.1134899184, -0.0836112723, -0.2604783475, -0.4620928764, -0.2324959189, -0.3129478097, -0.4964565635, 0.2788299024, 0.1503122151, -0.1244365126, -0.2181073725, 0.0399513468, 0.0615076609, 0.0328093469, -0.0039066724, 0.0036900225, -0.5525987744, -0.100924775, -0.0875204504, -0.1910012066, -0.1118557677, 0.1091225073, 0.1032060832, 0.2399273664, 0.4019559026, -0.0059455512, 0.1635181755, -0.14075993, 0.1461708099, 0.1538023502, 0.0355159305, 0.3521106839, -0.2427488416, 0.4205361307, 0.2550268769, 0.1332936436, -0.0100999055, 0.0425596759, 0.1045060158, 0.5606143475, 0.1336905658, 0.0361019783, -0.1573226452, 0.1971203685, -0.4761062264, 0.1635748446, 0.3196148574, -0.0963662714, 0.1028661653, -0.2305856645, 0.2454121262, -0.1227340773, -0.0561034679, -0.0822790638, -0.4199790359, -0.0470855795, -0.0305170417, 0.3228857517, 1.0876448154, -0.0548612364, 0.4298870265, 0.4172222316, -0.2629697323, 0.6519910693, -0.1784103215, -0.0568829179, 0.0626898482, 0.42597875, 0.0377705321, 0.1224649847, -0.0300476048, 0.1886980534, -0.3363743722, 0.280685842, 0.3932971954, 0.1404635012, 0.0706054717, 0.4829431772, -0.2904085815, -0.3686586618, -0.1312059909, 0.2164673656, -0.1190490052, 0.3661713004, -0.0052991454, -0.2352270931, -0.0096470974, -0.0482904091, -0.3888449669, 0.1304736137, -0.0251824986, -0.1556478739, -0.4032445252, -0.205935359, 0.1470161825, -0.2993982136, -0.1754351258, 0.2969132364, -0.3061264455, 0.1365484744, -0.3737157285, 0.1065818369, 0.347237289, -0.1877133995, -0.0940728188, -0.3946021497, -0.0860475227, -0.3269332647, 0.1791286469, 0.097424224, -0.0737684816, -0.2169007808, -0.0856581405, 0.4046722054, 0.0004225448, 0.2502939999, -0.0447828472, -0.2648871541, 0.2145470381, 0.1384791732, -0.2282406241, 0.3342365324, 0.076371491, -0.1768037975, -0.3621091545, 0.4076472819, -0.1357072741, -0.0548257753, 0.1094945967, 0.3518757224, -0.1896473616, -0.3585043848, -0.0407098867, -0.2579797804, -0.1610670537, 0.0826612413, -0.0515571944, -0.1386895031, 0.0447671488, 0.1471684724, 0.421854645, -0.0638569817, -0.025434956, -0.107777454, -0.00390111, 0.0178715941, 0.1565532535, 0.1169298589, -0.2704853117, -0.2178095877, 0.0143180387, 0.1008336321, -0.4075271785, 0.0065377057, -0.0030575003, -0.0312980488, -0.0204132758, -0.240610823, 0.1910776943, 0.123906903, 0.106153354, -0.2774293721, -0.1806875318, -0.2569987476, -0.0778444782, 0.1051140577, 0.0400193855, -0.5048246384, 0.4163047373, -0.1469416916, -0.2252710611, -0.0622459054, 0.1531936675, 0.0653290749, -0.1851453483, 0.1893162131, 0.0106252618, 0.0315575935, -0.1294828951, 0.1555295289, 0.0254079439, 0.3431402743, -0.0174623709, 0.1370590329, 0.4984190464, -0.1367762089, 0.0979610011, -0.0604099408, -0.139235422, 0.3413680196, 0.6376526952, -0.0923818201, 0.1332417578, 0.0038226738, 0.2270392329, 0.3653768301, 0.0729361326, -0.1053439975, 0.3341252506, 0.2490955144, -0.0806622058, -0.2883704305, -0.1841812432, 0.1503631771, -0.0476042181, 0.0749276057, 0.1278430223, 0.0845276192, -0.248945415, -0.0464622714, 0.0413437821, 0.1420659423, -0.088227354, 0.2352519482, -0.0408433229, 0.0806748867, -0.2251594365, 0.0038355109, 0.002238824, -0.0712821484, 0.049723275, 0.2862337828, 0.075781703, 0.5007494092, -0.1257103533, -0.1692753136, -0.0077237003, 0.3311447203, -0.0134001793, 0.2483820766, 0.1064844131, -0.1253098994, -0.1222497895, -0.1940725744, -0.2696335018, 0.4114993215, 0.0255448651, -0.2943878174, -0.1661925167, -0.0054864995, -0.2019101232, 0.4600013494, -0.2653141618, -0.0194638558, -0.0762195587, 0.3743439615, 0.1899856478, -0.1610188186, -0.2972485125, -0.3647534847, 0.1751008183, -0.2916705012, 0.0634525046, -0.0151320733, 0.0053438465, -0.1055817679, 0.1762615591, 0.2219750732, 0.1720625609, -0.2952432334, -0.0167613737, 0.021341268, 0.0078682052, -0.2192860991, 0.3557499051, 0.068677932, 0.1814697832, 0.182915777, 0.0935286656, -0.2586449981, 0.0309435744, -0.2813489735, -0.695227623, -0.0633431301, 0.1894438863, 0.0416123942, 0.0927130803, -0.3185551465, 0.2004054189, -0.2808117867, -0.0347287729, 0.4659150839, 0.0250450484, 0.1504025459, -0.1765356511, 0.1219728291, -0.1205241829, 0.7277302742, 0.2135391682, 0.2480606437, -0.2198003829, -0.2019879669, -0.359208405, -0.0052025509, -0.1304275542, 0.0303928964, -0.043607235, 0.234409824, 0.0169189833, 0.480186671, -0.252445668, 0.5650543571, -0.1560817063, 0.1449368298, -0.0684494451, 0.033408653, 0.1315193921, 0.0886436999, -0.0565042272, -0.2338402569, 0.1833182126, -0.0248791743, -0.0018762089, -0.1556952447, 0.2322491109, 0.1646088958, 0.228487432, 0.1511098295, -0.0296818372, 0.1483924687, -0.0339801423, -0.4519456327, -0.4413383603, 0.0062542618, -0.1830949187, -0.0221668538, -0.2848104537, 0.0437060185, 0.1046819612, 0.2613088787, -0.2944238186, 0.0885811225, -0.1664043218, 0.2771455944, 0.0126285981, 0.0509110577, -0.3258065283, 0.2498878837, 0.0871122703, 0.1541565061, -0.0772975162, -0.1914646775, -0.4286548495, -0.1590396315, 0.3215026855, -0.3492078781, -0.1736403555, -0.3517515063, 0.1742371768, -0.179132089, 0.1163304076, -0.1438179463, 0.1457781792, 0.0896574631, 0.0786115453, -0.1525876224, 0.4270350635, 0.1251836717, -0.190088436, -0.0135041345, 0.4377384186, -0.0389461406, -0.1823371649, -0.2686680853, -0.2382284701 ]
https://github.com/huggingface/datasets/issues/525
wmt download speed example
Is there a solution yet? The download speed is still too slow. 60-70kbps download for wmt16 and around 100kbps for wmt19. @sshleifer
Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 )
22
wmt download speed example Continuing from the slack 1.0 roadmap thread w @lhoestq , I realized the slow downloads is only a thing sometimes. Here are a few examples, I suspect there are multiple issues. All commands were run from the same gcp us-central-1f machine. ``` import nlp nlp.load_dataset('wmt16', 'de-en') ``` Downloads at 49.1 KB/S Whereas ``` pip install gdown # download from google drive !gdown https://drive.google.com/uc?id=1iO7um-HWoNoRKDtw27YUSgyeubn9uXqj ``` Downloads at 127 MB/s. (The file is a copy of wmt-en-de raw). ``` nlp.load_dataset('wmt16', 'ro-en') ``` goes at 27 MB/s, much faster. if we wget the same data from s3 is the same download speed, but ¼ the file size: ``` wget https://s3.amazonaws.com/datasets.huggingface.co/translation/wmt_en_ro_packed_200_rand.tgz ``` Finally, ``` nlp.load_dataset('wmt19', 'zh-en') ``` Starts fast, but broken. (duplicate of #493 ) Is there a solution yet? The download speed is still too slow. 60-70kbps download for wmt16 and around 100kbps for wmt19. @sshleifer
[ -0.19230479, -0.2106528282, 0.0381692611, 0.161149323, 0.0975150242, -0.1585474014, 0.1904046088, 0.1533404291, 0.1204151809, 0.0007967273, 0.0680535585, 0.4522776902, -0.1424294263, 0.1149547473, 0.1379801482, -0.0190715082, -0.031607151, -0.0164661948, -0.5539654493, -0.1806610823, 0.1243807226, 0.2241036594, -0.0454685204, -0.1134558395, 0.0132559724, 0.1571441591, -0.0064905751, -0.0526822694, -0.4414258301, -0.2438794076, 0.170095861, 0.2271820903, -0.0814937875, 0.2266279608, -0.0001094717, -0.1007322073, 0.3573344052, 0.0219914652, -0.471912235, -0.2320850194, -0.4433199465, -0.5319789648, -0.185185045, 0.0123839853, 0.0689450875, -0.0021640076, -0.0070841415, 0.102632992, 0.1497530043, -0.0618958585, 0.1908744127, 0.3501648009, -0.3927137554, -0.0803050697, 0.529024899, 0.0538760051, -0.3179959357, 0.4086424708, 0.4026593268, 0.0647771433, 0.0284355469, 0.3826526701, -0.2017958909, 0.3520323634, 0.155058831, 0.1255155951, 0.331412375, 0.0501094274, -0.0919990242, 0.5831672549, 0.3131951392, 0.1831503808, -0.497156322, -0.3578056693, 0.0633995906, -0.2700962126, 0.0803163424, 0.2856507301, -0.4243177474, 0.0002225576, -0.67667979, -0.0099587319, 0.0651908144, 0.2772797644, -0.04812181, 0.666228354, -0.1206483021, 0.0215347987, 0.111791417, -0.0764696598, 0.0303590577, -0.2781361043, 0.0698557571, -0.0057145143, -0.0622208565, -0.1293955892, 0.1594762057, -0.0302637815, -0.0472638495, 0.0339745097, -0.0991022661, 0.2560758591, 0.3124376833, -0.047432784, 0.2130235732, 0.3228135109, -0.2606374025, -0.1927298456, 0.2396690547, 0.1491975039, 0.1560315788, 0.2299154401, -0.1587983519, -0.0781510621, -0.4115290046, -0.11844033, -0.0473965593, 0.0037348226, -0.3469017148, -0.2562143207, 0.1056703553, -0.1855092943, -0.0941442475, 0.2317568809, -0.2538496554, 0.3382100463, -0.1181779131, 0.003246645, -0.2547433674, -0.1260491312, -0.0535421483, -0.0828832984, -0.1512468308, 0.0678524449, 0.402818054, 0.1526070386, 0.2217161059, 0.1495411694, -0.2563753128, 0.0244265851, 0.1367166042, 0.1140656471, -0.0522735044, 0.0211515203, -0.14386563, 0.4553881884, -0.1439697444, 0.2233113796, -0.3718619347, 0.0244954713, -0.3538337052, -0.0992956609, 0.0683533847, 0.1765668988, -0.3633998036, -0.3125866652, -0.077495046, 0.3425290883, -0.3256637752, 0.2113516331, -0.1457197964, -0.0741147548, -0.3165704012, -0.008863721, 0.0709338263, 0.3774986565, -0.0508104786, -0.1849672794, -0.2460457981, 0.2898677886, 0.483340919, 0.4508230388, -0.1895448118, 0.0414338745, -0.1766332686, 0.0714005902, 0.1194599941, -0.1618260443, -0.246779263, 0.58460325, -0.3631800115, 0.102623336, 0.227295205, 0.0897729546, 0.1548351198, -0.1884675622, 0.126032725, 0.5456568599, -0.0167234112, 0.143302545, -0.4377730787, -0.4620155692, 0.4027628005, 0.0353229567, -0.2536875606, -0.1711741835, -0.0318976566, 0.1660174429, 0.2982516289, -0.0939550474, 0.0602231808, -0.0077170031, -0.0792511702, -0.4218613803, -0.1064631417, 0.25716874, -0.3071238101, 0.315671742, -0.0298684575, 0.2846216559, 0.2721894979, 0.141825363, -0.1290595531, -0.199524641, 0.0606612712, -0.0541771203, 0.1089609936, 0.182148695, -0.014148117, 0.0092425672, 0.1536198109, -0.070528619, 0.127756536, 0.0534543693, 0.3099105358, -0.1456313729, 0.0676013529, -0.0970410258, 0.3784596324, -0.0925217792, 0.0166751035, 0.0030212414, -0.1428598166, 0.0351031609, -0.1620596647, 0.8205003142, 0.1636325568, 0.0556998253, 0.2263665646, -0.2033574134, 0.4189575911, 0.461484164, 0.1375055164, -0.0583208315, -0.3883255422, 0.6559357643, -0.0334870443, 0.2081571668, 0.2344061136, 0.0253947787, -0.0108920392, 0.0331266075, -0.1978801638, -0.0266735461, 0.4525544643, 0.0287110563, -0.0495551787, 0.1335158199, 0.1221131757, 0.3372901678, 0.6990529299, -0.0764463544, 0.080249548, 0.1611665487, -0.2440986782, -0.4479449093, 0.2832090259, 0.3346198797, 0.4011622369, 0.1236731932, 0.479391098, 0.0982858092, 0.0149976602, -0.2614249587, 0.4538693726, 0.0683600456, -0.3148661852, 0.0691410899, 0.0558244437, -0.040756695, -0.3203515708, 0.313885808, 0.0323733091, 0.0395364873, -0.1711006463, 0.1068436429, -0.5006796122, -0.2801335752, -0.2517409325, -0.2207891941, -0.2238323539, -0.318121016, 0.0076522697, -0.0296564102, -0.1530617774, -0.026114542, 0.3023249209, 0.0973886698, -0.3252886832, 0.198079437, -0.2525206208, -0.0247698594, -0.361787796, 0.0325187929, 0.2561214566, 0.136350736, 0.3704489768, -0.2708317339, -0.1832278967, -0.013191306, -0.3252642751, 0.0813810006, -0.0044516008, 0.309969306, 0.0869935974, 0.0535681024, -0.244878158, 0.0258569568, 0.044131685, -0.3550922275, 0.0461034849, -0.0059968899, -0.2256912142, -0.0581977889, -0.2201523632, -0.4104793966, -0.2594749033, -0.1429175735, 0.2594438791, -0.143910259, 0.1373717189, 0.2676989436, -0.2405002862, 0.215484187, -0.0677713528, 0.1764877886, -0.1195024401, -0.407512635, 0.3521413207, -0.0469387025, -0.2553837895, 0.2142442018, 0.1334392726, 0.0773061886, 0.0538563579, -0.3868006766, 0.3585600555, -0.1362271458, -0.0413574949, 0.4282894433, 0.2188337594, 0.1871517748, -0.1434070617, -0.0398894474, -0.0842349231, -0.330911845, -0.1504517496, 0.3599238694, 0.1746118665, -0.2924569547, -0.0139139937, 0.3336582482, 0.4254921377, 0.1031931192, 0.2084676027, 0.1242860705, 0.1685884297, -0.0807221681, 0.2745332718, -0.0265405104, 0.3414585292, -0.1584326476, -0.0061025233, 0.3130584955, 0.1314869374, -0.2813424766, -0.1579691768, 0.15093638, 0.1522670388, -0.261218518, -0.0356048271, 0.0205145534, -0.1144810989, 0.2356669754, 0.1436477154, -0.1943286955, -0.354848206, 0.0296810791, 0.1559302211, -0.0876218751, 0.1247207224, 0.0522005111, 0.1158503443, -0.6414425969, -0.1147344783, 0.0603271984, 0.3419024646, 0.1826670468, -0.0428261198, 0.1333039999, -0.1815698147, 0.0717391893, -0.1534900069, 0.202965349, -0.038370844, -0.2917602062, -0.5185973644, -0.3812618554, -0.2496385872, -0.4734685123, 0.3450016677, 0.1263524145, -0.1400878578, -0.1853708625, 0.1125076711, 0.1654153466, 0.0232463237, -0.0432437398, -0.0088313343, -0.4730162621, 0.040526513, -0.137801066, -0.2883768082, -0.1090495512, -0.0272750147, -0.0055791205, 0.3268515468, 0.2950001657, -0.0195188746, 0.0309065394, -0.0148202116, 0.1408238262, 0.282456696, 0.0278674345, 0.3156509995, -0.2493623495, 0.4222187102, 0.2564001679, 0.138832584, 0.0171248429, 0.0414953791, 0.065340668, 0.6348187923, 0.1393072605, 0.1914890707, -0.1340217739, 0.204890117, -0.3286895454, 0.0856202319, 0.4198351502, -0.0922777057, 0.03151289, -0.1679936647, 0.3272446692, -0.0432741567, -0.0682047084, -0.0195678063, -0.4723747671, -0.0389500223, -0.1813565642, 0.1990232021, 1.0325305462, -0.1032292992, 0.3606830537, 0.2462726682, -0.326729387, 0.6611085534, -0.0010683686, -0.0463625379, 0.079313226, 0.3475845754, 0.0780698359, 0.0713931322, 0.1006940007, 0.0853022113, -0.3384710848, 0.3028821349, 0.2931594551, 0.2341821045, 0.1250126958, 0.3649466932, -0.2309810966, -0.3035395145, -0.003990877, 0.1476071626, -0.1462849081, 0.4384978116, 0.0112075927, -0.2127481699, -0.0808171704, -0.0827345923, -0.496140182, 0.0781482607, -0.1791176945, -0.132270515, -0.3198832273, -0.3072761297, 0.1382163316, -0.3125724494, -0.1823173016, 0.1593793631, -0.306356281, 0.2015747428, -0.4997560382, 0.322851181, 0.354826659, -0.2214930356, -0.1207585186, -0.3069573343, -0.0201908648, -0.367364645, 0.1121912748, 0.1790432483, -0.1402605027, -0.1554660946, -0.1174488813, 0.4760376215, 0.0256159436, 0.2536866665, 0.0014988707, -0.2755518854, 0.1603969038, 0.1830125451, -0.1511208564, 0.4249058366, 0.0306920614, -0.2530902922, -0.3022614419, 0.5446178913, -0.1712574512, -0.0762040243, 0.2353500426, 0.2378667891, -0.201839745, -0.2567596436, -0.0353073478, -0.2382569909, -0.2796827853, 0.1312978715, -0.2013621479, 0.0162846129, 0.1016574949, 0.2791965008, 0.2899508178, -0.0184436832, -0.0281560663, -0.150191322, 0.025422249, 0.0378248058, 0.0631624758, 0.0463947579, -0.4493819177, -0.2314696014, 0.0730351433, 0.1662112325, -0.3018161952, 0.0727958828, 0.053425733, -0.0370062143, 0.0468183458, -0.2304475307, 0.1648779064, 0.098326914, 0.0627444908, -0.2889102399, -0.1000975743, -0.2096281797, -0.0944983065, 0.142227903, 0.0093971118, -0.6041983962, 0.4268812537, -0.1209511906, -0.0704813749, -0.0491628349, 0.0633512661, 0.1322063357, -0.1895679981, 0.191733852, 0.0043711239, 0.1408359855, -0.1195364594, 0.1781886965, -0.0502232499, 0.372097075, 0.1173599884, 0.1187565997, 0.5305387378, -0.0467232019, 0.0031675664, -0.1742537469, -0.1299124807, 0.2519769967, 0.6152688861, -0.1011677757, 0.2166443616, 0.0312858075, 0.1953370273, 0.4234864414, 0.0186630953, -0.1360410601, 0.3578151762, 0.1634843349, -0.0076252129, -0.3044869602, -0.0711649433, 0.1949171871, -0.1436066628, 0.0686584637, 0.2110056132, 0.1086741388, -0.2150645405, -0.1451812685, 0.201615423, 0.0481321439, 0.0283957813, 0.3459686637, 0.039086476, 0.1616563797, -0.2308828086, -0.0689181164, 0.0217669681, -0.0943100303, -0.0131876273, 0.2198144048, 0.0897098854, 0.6077307463, -0.1097397581, -0.2152640224, -0.0743064061, 0.4268312454, -0.1261550039, 0.2197948694, 0.2022064924, -0.1172498688, -0.0472149812, -0.2399029136, -0.2813335955, 0.3914323449, 0.0404248834, -0.3339935243, -0.1844966859, -0.0089884391, -0.3252815604, 0.4570531547, -0.3683611751, 0.0556632504, -0.0124793537, 0.3678564727, 0.1208805591, -0.330373615, -0.3447904587, -0.4250263274, 0.2262215763, -0.2514732778, 0.0538899228, -0.136318922, 0.0155506618, -0.1111813635, 0.2048872411, 0.1433779001, 0.2517201602, -0.1315742284, -0.1068136096, 0.0552501194, 0.051746726, -0.1826303452, 0.3563988209, 0.1094767228, 0.1614316404, 0.1396196783, 0.0032214606, -0.2617655396, 0.050464157, -0.2575355768, -0.7597658634, -0.2148529142, 0.2591417432, -0.0997465774, 0.1027270332, -0.3110261858, 0.1342180669, -0.1453997791, -0.0192844048, 0.4423727393, -0.0146615002, 0.2050584555, -0.1046234518, 0.0775278732, -0.1276622564, 0.6228080392, 0.1438280791, 0.1733988523, -0.3027558327, -0.2098254561, -0.4360934198, -0.0435044728, -0.2079171389, 0.1201575547, 0.0933165923, 0.1345237643, -0.0540954657, 0.4037420154, -0.0514871962, 0.612637043, -0.0678339377, 0.047684636, -0.1062776074, -0.1528728157, 0.1337753087, -0.052877523, -0.0957041085, -0.3004838824, 0.2328523397, -0.1057127193, -0.098573193, -0.1785944402, 0.2746796906, 0.0828840062, 0.3282958269, 0.1484967619, 0.0690781176, 0.3220794201, 0.0548949502, -0.3768771589, -0.4569471776, -0.0288916584, -0.1553300768, 0.0526763275, -0.3676454127, -0.0331749953, 0.1107919514, 0.2575418353, -0.3100860119, 0.0315035321, -0.1456473172, 0.2497523725, -0.0561202839, 0.1214536503, -0.262832582, 0.2197062075, 0.0760229602, 0.0962250829, -0.0901900455, -0.0787440538, -0.4243403077, -0.0582293235, 0.2731252611, -0.2771431208, -0.0997498259, -0.4166157842, 0.2395463586, -0.1594288647, 0.1861552894, -0.0203020126, 0.0482704863, 0.156170249, 0.0054628132, -0.1677880287, 0.4472100139, 0.2200206965, -0.2076550722, 0.0784492493, 0.4788641036, 0.0905836746, -0.2312944978, -0.1678172499, -0.1623740196 ]
https://github.com/huggingface/datasets/issues/519
[BUG] Metrics throwing new error on master since 0.4.0
Update - maybe this is only failing on bleu because I was not tokenizing inputs to the metric
The following error occurs when passing in references of type `List[List[str]]` to metrics like bleu. Wasn't happening on 0.4.0 but happening now on master. ``` File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 226, in compute self.add_batch(predictions=predictions, references=references) File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 242, in add_batch batch = self.info.features.encode_batch(batch) File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in encode_batch encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column] File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in <listcomp> encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column] File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 456, in encode_nested_example raise ValueError("Got a string but expected a list instead: '{}'".format(obj)) ```
18
[BUG] Metrics throwing new error on master since 0.4.0 The following error occurs when passing in references of type `List[List[str]]` to metrics like bleu. Wasn't happening on 0.4.0 but happening now on master. ``` File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 226, in compute self.add_batch(predictions=predictions, references=references) File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 242, in add_batch batch = self.info.features.encode_batch(batch) File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in encode_batch encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column] File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in <listcomp> encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column] File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 456, in encode_nested_example raise ValueError("Got a string but expected a list instead: '{}'".format(obj)) ``` Update - maybe this is only failing on bleu because I was not tokenizing inputs to the metric
[ -0.1062733904, -0.0072904108, 0.0222177841, 0.2218199819, 0.319983542, -0.0804266185, 0.1759802252, 0.3901974559, 0.0343043953, 0.1756985188, -0.0845414698, 0.2548735738, -0.4288853407, 0.0719980001, -0.0287584532, -0.081646435, -0.0013921424, 0.0024744486, -0.0758357719, -0.0748342201, -0.4520994425, 0.1437273622, -0.1970939189, 0.0110388091, 0.0288928617, 0.0917714983, -0.1796930134, 0.0378204659, -0.227013886, -0.6951413155, 0.0842946321, -0.1058673486, 0.0286653712, 0.5098219514, -0.0001164396, 0.0048179575, 0.5615228415, -0.0969977677, -0.2757413089, -0.6296265721, -0.1194720715, -0.3785983324, 0.2123193592, -0.0551588349, -0.1251199394, -0.421182394, -0.1600917429, -0.0245707147, -0.2853535712, 0.5097925663, 0.1826966554, 0.3170954287, -0.1970275939, -0.3702694476, 0.1295920312, -0.4435135126, -0.0542089492, 0.2791593075, 0.0688029304, 0.0893617421, -0.3565911055, 0.2778957188, -0.1672199368, 0.0977167636, 0.4126307666, -0.0599433333, 0.7112178206, -0.0169464275, -0.0244267453, 0.068305105, 0.2693005204, -0.059406437, -0.3265317678, 0.1645628065, -0.012403734, -0.5957027674, 0.1381161064, -0.0336661637, -0.1020846516, -0.2063248903, -0.3794079125, -0.1562570781, -0.0071803192, 0.2209168226, -0.2712136209, 0.387017101, -0.1360197514, -0.0998501182, 0.5003243685, -0.0388080701, 0.1800911874, -0.0616368055, -0.3171214461, -0.055231262, -0.2707424164, -0.1092250496, 0.0949799716, 0.2227655351, -0.0316817984, -0.0119900033, 0.0349356197, -0.0800454095, 0.052204106, 0.138429448, 0.3684636652, 0.4071956575, 0.2165304124, -0.1421268731, 0.2275407612, 0.2707018852, 0.0833954737, -0.0756213292, 0.2968890667, -0.2845105529, -0.0679678321, 0.3694415689, 0.0975968838, -0.2575010359, -0.3548734188, 0.1660372317, -0.2789392769, -0.0550795272, 0.4045330584, 0.4178313613, -0.3578873575, 0.2668996751, 0.2166233659, 0.3325395882, -0.0326592326, -0.0041469694, -0.1672388911, 0.0001239789, -0.3007434607, -0.15980497, -0.1282814294, -0.3283576667, 0.3711371422, 0.10494937, 0.493842274, -0.1525181085, -0.1196288764, -0.0951242968, 0.0839675963, 0.1391265541, 0.0361176841, -0.1184329391, 0.2583680153, -0.4067992568, 0.0937796682, 0.1375782639, -0.3253020942, -0.1255242527, -0.0380002074, 0.1357336342, -0.1714641452, 0.1331060678, -0.2497184873, 0.151928246, 0.1851926446, 0.0763436332, -0.2300546467, -0.2365291119, -0.2112006843, -0.2743981481, 0.0838537961, -0.0675429329, -0.0719908625, -0.0643366054, -0.0047452799, 0.258030802, 0.0987975895, 0.1628795713, 0.0601907745, 0.194744274, -0.1199282333, -0.4076302052, 0.2281284034, -0.4222309589, -0.0846990794, 0.0330413282, -0.1003819704, -0.1777203232, 0.0184923206, -0.0879655555, 0.1359379292, -0.205813095, 0.5759730935, -0.2368003726, -0.0427047126, -0.1251957119, -0.3218887746, -0.2253405303, 0.0200863946, -0.1174826324, 0.4351540208, 0.3503578007, 0.0471100472, 0.429874301, 0.0101368641, -0.3278264105, -0.0130374311, 0.2420767248, 0.3168125153, -0.2888852358, 0.2373012453, -0.058906585, -0.0143642584, -0.0380505472, -0.1371422708, 0.2937999964, 0.0554155782, 0.0134862158, -0.1908237338, 0.0431650318, 0.055289939, 0.2678286731, 0.125925228, -0.0428626314, -0.2989126444, 0.2762338817, 0.0067478279, -0.3360524774, -0.2650055587, 0.0583854914, 0.2053064108, 0.09221147, -0.1258652508, -0.2059829533, 0.1046520025, 0.396045357, 0.3106921911, 0.0560851023, -0.1756464094, 0.1178616732, 0.2674863935, -0.2520057857, -0.0785715207, 0.4476382136, 0.4362250865, -0.0137382941, 0.0325250737, 0.4991463721, 0.0985600799, -0.1266162843, 0.2538799047, 0.4040436447, 0.0748694167, 0.1763367504, 0.087889187, 0.2562079132, 0.0964247361, 0.0888751, 0.046280317, -0.2134588659, 0.3034290969, -0.2395792603, -0.0124711916, -0.334128499, -0.0273538977, -0.06802468, 0.4389279783, 0.1797917634, 0.1811551303, 0.082363762, -0.046151381, -0.0485801399, -0.14819704, -0.0649200156, 0.3559919, 0.0830438361, 0.1323613375, 0.3042525947, 0.0315917656, -0.2434706986, 0.2299398929, 0.1900540441, -0.2009669244, -0.0143524148, 0.1885911971, -0.1266465038, 0.158946678, 0.1349480301, -0.0589857027, 0.3524663746, -0.3869654238, -0.0252724476, -0.3195976317, 0.2235093564, -0.0465927608, -0.2895767689, -0.2419311851, -0.383918792, 0.0785664618, 0.5633409023, -0.1721505225, 0.2836772203, 0.2250234187, 0.2812376618, 0.0664491355, 0.427282095, 0.2186662257, -0.3022625148, -0.1205077171, 0.0455395095, 0.200776577, -0.3718585074, 0.1317171752, 0.062105231, 0.0519474968, -0.3125458062, -0.4706141055, 0.0956866741, 0.0487278253, 0.5173869133, 0.3060546815, -0.167426452, -0.1922734082, 0.0310937054, 0.2899301052, -0.0361483581, -0.0908921286, 0.2110299021, -0.2417315394, -0.0862909257, -0.3249901831, -0.0833850503, -0.0758276582, -0.4211906791, -0.0845592245, 0.1301459223, 0.1021900326, 0.1177105233, 0.0031331962, 0.3794731796, 0.3393114507, -0.2537637651, -0.1313801706, 0.0278127044, -0.1283527911, -0.2453271449, -0.5491187572, -0.073110655, 0.2241434902, 0.2258107066, -0.0659756437, -0.3508491516, -0.7318809032, 0.3000253737, -0.003286629, 0.1589719206, 0.1296350658, -0.0681938156, 0.1262822896, -0.1781276613, -0.2250602096, -0.0352246128, 0.1025234759, 0.0331364088, 0.2410039008, 0.1788250506, -0.0349805579, 0.3686442077, 0.7059165239, 0.2269940525, -0.2379548103, 0.3036685884, 0.1353713274, 0.4072171152, -0.0264268853, -0.3088989854, -0.1735410541, 0.1025476605, -0.1601962596, 0.3309650719, -0.1620678455, -0.1369141787, -0.0541627184, -0.0518585667, 0.2931029797, -0.0336516947, -0.046855256, -0.4473404884, 0.0542359501, -0.0050662546, 0.1837349981, -0.1927817762, -0.2258316875, -0.0249953419, 0.1985558867, -0.0877371058, -0.1020566747, -0.0756953061, -0.5518882871, -0.2223024666, 0.4270268083, 0.2587657869, 0.3232921064, -0.2660309672, 0.1894874424, -0.1109077111, -0.0832204297, 0.4132603705, -0.3680099249, -0.2397204936, 0.0916129723, 0.0217399281, -0.1438003927, 0.1161423847, -0.1778072417, 0.166071564, 0.3169515729, 0.3760709763, -0.0251743048, -0.2788377404, -0.0359643884, -0.0113215977, -0.0535286665, 0.1029183939, -0.1676890403, -0.4124307036, 0.0450771414, 0.2923708856, -0.0652452782, 0.2904182673, -0.1708577573, 0.062664181, 0.0301396847, 0.1009009406, -0.0013063389, -0.1361407042, 0.1180525795, -0.1802486479, 0.0078085307, 0.0204728711, 0.0319025405, 0.4550202489, 0.0060107238, -0.2917802036, -0.1813066453, 0.130801782, -0.1310534775, 0.2443944961, 0.2665785253, -0.2280218452, 0.1538260877, 0.0599577688, 0.1282741576, -0.032625787, -0.2780755758, 0.1886829734, 0.1657048017, -0.2918078303, -0.289051801, 0.2140420377, 0.192114532, 0.0039767064, 0.333795011, -0.145944491, -0.3020853996, 0.2901755273, 0.2580896318, 0.7199826241, 0.1772866547, 0.0621617846, 0.2678114176, -0.0248083994, 0.3369647861, -0.0011281738, 0.2272088081, -0.3251260221, -0.1819220334, -0.0510064103, -0.0912295505, 0.0903945342, -0.2549569309, -0.4692078233, 0.3571287096, -0.338645488, 0.0684281141, -0.0027006974, -0.0616371036, 0.0340329707, -0.1055296659, -0.1815976202, 0.1450162083, -0.0471084937, -0.0551433377, -0.1813330948, -0.1496155709, -0.1351153851, -0.2093957216, -0.224406749, 0.0030924813, -0.0500721186, 0.0792429596, 0.0922345221, -0.1890148968, 0.015930986, 0.0483716689, 0.6843816042, 0.1389762908, -0.1221341714, -0.0896776617, -0.3120185137, 0.360288471, 0.1824050099, 0.0228050239, 0.1903820485, -0.1521886587, -0.1710990667, -0.0263633355, 0.0382210016, -0.2362464666, 0.2422466278, 0.1380506754, -0.5968796015, 0.0490748361, -0.0457349978, -0.1342940927, 0.0736133978, -0.1502984315, 0.1262631863, 0.0150176641, -0.3940705359, 0.1426138282, 0.0255687945, -0.1432812214, 0.1711680442, 0.4133881927, 0.3825068176, -0.0730058327, 0.282630682, 0.0793983787, -0.0198941696, -0.1597784311, -0.1873873621, -0.1054574847, -0.1161092818, 0.5724228621, -0.0795716941, -0.1791673303, 0.0564349182, 0.5587019324, 0.062502563, 0.4060671329, -0.2007860839, -0.2350218594, -0.2174001634, 0.1329993606, -0.3143026233, -0.042098999, -0.3033982813, 0.0969730318, 0.0013457028, -0.006605221, -0.282790184, 0.029147286, -0.5816068649, 0.2390805185, 0.0347585194, -0.0798222497, 0.2138293386, 0.1546039432, -0.0672047883, -0.0371854454, -0.5296416283, -0.1155346781, -0.2056085467, 0.1222662851, 0.2622718513, -0.0186742395, -0.0507428274, 0.0401777774, -0.0510657616, 0.0489724763, 0.0812330768, 0.2357847691, -0.1211949736, 0.1747648269, 0.0279376339, 0.2638653517, 0.4427060485, 0.1367005408, 0.174211368, 0.0412110463, -0.1324889958, 0.2207815796, -0.0025747034, -0.0217302684, 0.0557334088, 0.0362121835, 0.0179561023, 0.1621976048, 0.1982881427, -0.2473772764, -0.0484851152, 0.1497213244, 0.240590632, -0.1302976012, -0.037473686, -0.0905086175, 0.0600296706, 0.1330467612, -0.1818069816, -0.2732085884, 0.1540731043, 0.2661510706, 0.0918543786, 0.1680224538, 0.5722923279, -0.1812608838, 0.4379869401, -0.0577978753, 0.2492555231, -0.5429467559, 0.2392247766, 0.2238962352, 0.2023126185, 0.2100300938, 0.2175001502, -0.0853960887, 0.0664064884, 0.3406584263, 0.0033980093, 0.3295255303, 0.498505801, -0.229892835, 0.0517688841, -0.2210609913, 0.166842863, 0.1557109505, 0.1768078953, -0.0390929095, -0.2176528424, 0.1408509612, -0.2812757492, -0.3672320247, -0.0805911571, 0.0971921608, -0.2728291452, -0.013638299, -0.2616150677, -0.2562116981, 0.0258019678, -0.1278200597, 0.1950096041, 0.090167433, 0.1426082402, 0.0604191236, 0.2087848037, -0.12840119, -0.7600821257, 0.3565039635, 0.0087326057, -0.1113045737, 0.0361030363, 0.1557187587, 0.1052643135, 0.112983726, 0.4749212861, 0.5415936112, 0.4865359962, -0.1846360713, -0.2029484063, -0.0598557852, -0.0964690447, 0.0054019769, 0.3943557739, 0.286970228, -0.2051618546, 0.0358298719, 0.023796251, -0.1001322716, 0.6779956222, 0.0031576518, -0.17386657, -0.0836859941, 0.6400130987, 0.1307486147, -0.1503637582, -0.205158323, -0.2563602626, -0.3835416436, 0.2625058293, 0.6904426217, -0.1350449473, 0.1891412288, -0.0441589169, 0.079502292, 0.1670889556, 0.2144991755, 0.2570819557, 0.1379098743, -0.4199149311, 0.0936603472, -0.2452677339, 0.1963990033, -0.0202854797, 0.6180791259, 0.0736085773, 0.0504821017, -0.0926955789, 0.0622619987, -0.1004866883, -0.0657916293, 0.1433023065, -0.0475097969, -0.6162132621, -0.0039122314, 0.1456245333, -0.2014157772, -0.0295914579, -0.1896530986, -0.282802403, -0.1986451894, 0.0802239776, -0.1811146438, 0.0271705147, -0.0432732105, 0.3224052787, 0.1463052034, 0.1675936431, 0.5402652621, 0.1617101133, -0.3007184267, -0.2196443975, -0.3226029277, -0.3023868799, -0.0873757228, 0.028248895, 0.4219990671, -0.2259737849, -0.1336129308, -0.358319521, 0.8097122312, 0.0864822716, 0.0152095631, -0.2573970258, 0.4139164388, -0.274787724, -0.0174312145, 0.103404142, 0.1995462924, 0.2240751386, 0.3738700449, -0.3511287868, -0.1526464671, 0.6073248982, -0.6849964261, -0.2127242088, -0.0282144174, 0.4172561467, -0.0590862259, -0.4034629464, -0.5686314106, -0.2560311854, 0.2383514047, 0.0717153251, -0.2924546897, 0.0656687021, 0.0870309174, 0.1815020293, -0.0582494177, -0.5435274839, 0.0497680493, -0.3589712977, 0.1848372668, -0.2681569159 ]
https://github.com/huggingface/datasets/issues/519
[BUG] Metrics throwing new error on master since 0.4.0
Closing - seems to be just forgetting to tokenize. And found the helpful discussion in #137
The following error occurs when passing in references of type `List[List[str]]` to metrics like bleu. Wasn't happening on 0.4.0 but happening now on master. ``` File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 226, in compute self.add_batch(predictions=predictions, references=references) File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 242, in add_batch batch = self.info.features.encode_batch(batch) File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in encode_batch encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column] File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in <listcomp> encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column] File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 456, in encode_nested_example raise ValueError("Got a string but expected a list instead: '{}'".format(obj)) ```
16
[BUG] Metrics throwing new error on master since 0.4.0 The following error occurs when passing in references of type `List[List[str]]` to metrics like bleu. Wasn't happening on 0.4.0 but happening now on master. ``` File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 226, in compute self.add_batch(predictions=predictions, references=references) File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 242, in add_batch batch = self.info.features.encode_batch(batch) File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in encode_batch encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column] File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in <listcomp> encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column] File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 456, in encode_nested_example raise ValueError("Got a string but expected a list instead: '{}'".format(obj)) ``` Closing - seems to be just forgetting to tokenize. And found the helpful discussion in #137
[ -0.102583088, 0.0307525825, 0.0034684266, 0.1723008603, 0.2973580658, -0.0995549709, 0.1647167504, 0.366982162, -0.0618153736, 0.1189629808, -0.0670210719, 0.3194745779, -0.3788499534, 0.0334372893, 0.0053102383, -0.0455290191, 0.0488769226, 0.0500887483, -0.0283141062, -0.0415439457, -0.433814913, 0.1561397165, -0.2037518024, 0.0674391538, -0.0014886212, 0.0320698582, -0.2056002319, 0.0124586215, -0.2085186094, -0.7494329214, -0.0237539858, -0.0226649642, 0.0487860367, 0.4582443535, -0.0001134856, -0.0649085194, 0.5408960581, -0.0713074878, -0.2891860604, -0.5700898767, -0.0161663033, -0.4225822985, 0.2314774543, -0.102617465, -0.0931409523, -0.4966783226, -0.094411999, -0.0052618342, -0.1745484173, 0.4718378782, 0.2129919827, 0.3863582909, -0.1674004346, -0.3329544961, 0.0664211661, -0.4447818995, -0.0540232845, 0.2632978261, 0.0874250159, 0.0430791192, -0.3499206305, 0.2789093554, -0.1636088341, 0.067425482, 0.3732297122, -0.0351288691, 0.6463180184, -0.0362079553, -0.01755202, -0.0167520344, 0.2616896629, -0.0798288882, -0.3455687165, 0.0525414683, -0.0400221311, -0.6671742797, 0.1051288247, -0.0665210485, -0.1253448278, -0.2333728075, -0.3577311039, -0.1747196913, 0.017590683, 0.1906613708, -0.2718414068, 0.4762354493, -0.1664232612, -0.0759522617, 0.3964945376, -0.0569943897, 0.1194902733, -0.0522870719, -0.2902084887, -0.0657730997, -0.1954230815, -0.1534586996, 0.1102751791, 0.1753437668, -0.0519046523, 0.0104952538, -0.0231146794, -0.0207916759, 0.0387965143, 0.0917938948, 0.3847598732, 0.4587343037, 0.2474340796, -0.1352369189, 0.230512619, 0.2567485869, 0.1074837074, -0.1054222435, 0.2179352939, -0.199168995, -0.1020572186, 0.3530692756, 0.0771287382, -0.1486463845, -0.3942012787, 0.1839556992, -0.2494340539, -0.0700130612, 0.3418895304, 0.4307644367, -0.3583084047, 0.2780347168, 0.1595153213, 0.2922855616, -0.037339326, -0.0542073026, -0.1841021925, 0.0287251417, -0.3161762655, -0.1576247811, -0.1969666481, -0.2060834765, 0.4018803537, 0.0567915402, 0.4840885997, -0.1494251341, -0.0577868186, -0.0592003651, 0.1026941761, 0.1377505809, 0.0340528302, -0.0404241569, 0.2528169453, -0.465285182, 0.0712758154, 0.1340928227, -0.242103532, -0.1026693881, -0.0363443755, 0.1629740149, -0.2597142458, 0.1191633865, -0.2604866028, 0.1404053122, 0.20974648, 0.1001918614, -0.2383137792, -0.2353685796, -0.193216309, -0.2761629522, 0.0805804878, -0.0998492986, -0.0549946465, -0.059291441, 0.0014288129, 0.2687457502, 0.173439309, 0.2330850363, 0.0622670315, 0.2976830006, -0.1386232823, -0.2723985016, 0.2804915309, -0.389146924, -0.0451331586, 0.0075007691, -0.1507261693, -0.1308653355, -0.0063749431, -0.1555445641, 0.274307102, -0.2414911836, 0.6387081146, -0.2098978907, -0.0234918632, -0.0919859484, -0.3614306152, -0.1873824149, 0.0221893322, -0.1704646349, 0.3997807503, 0.279389441, -0.0004806937, 0.4381350875, 0.0573236607, -0.3086837232, 0.0102449162, 0.1429017484, 0.3598022461, -0.2083676904, 0.2066049874, 0.0043906434, 0.0301523786, -0.0903611705, -0.1430302411, 0.2886416614, 0.0005856089, -0.0534159243, -0.1537871212, 0.0622513406, 0.0656033307, 0.2067130804, 0.168772459, -0.0656764209, -0.3247306049, 0.2614590228, -0.077701591, -0.3801075518, -0.2696730196, 0.0930509567, 0.1923232079, 0.0451430194, -0.1129507795, -0.1805782914, 0.1130100936, 0.4350061417, 0.3111205399, -0.0321295187, -0.1447535306, 0.1643625647, 0.2113061398, -0.232655257, -0.0815257803, 0.4597381651, 0.4157811105, 0.0603645816, 0.0278821345, 0.4788336456, 0.0670261532, -0.1000906974, 0.2037340403, 0.4495796859, 0.1506352127, 0.1320399046, 0.1151871085, 0.2695249021, 0.1095166653, 0.1239702404, -0.0123747764, -0.2585498989, 0.2444451004, -0.2514764369, -0.0599756129, -0.3223248124, -0.036845807, -0.0281213429, 0.4343466163, 0.1495000869, 0.1949958503, 0.05550256, -0.0568948388, -0.0892999098, -0.0794317126, -0.1411328018, 0.3704997599, 0.1090403199, 0.1751408279, 0.2766389847, 0.0335930251, -0.2884183824, 0.2643553615, 0.2360636592, -0.2386015058, -0.0717690066, 0.2106544673, -0.0873402953, 0.1041121632, 0.121827282, -0.0150991241, 0.3402751088, -0.3700838089, -0.0135861356, -0.3047519624, 0.1540880948, -0.046473965, -0.2822911739, -0.2647286057, -0.4586751759, 0.125371635, 0.53656739, -0.20355995, 0.3060355783, 0.2197272182, 0.3430371284, -0.0040900251, 0.4481118321, 0.2011852562, -0.2738153636, -0.1592063606, 0.060799703, 0.216176331, -0.4423587918, 0.1926901788, 0.0231075771, 0.0449753962, -0.3382917643, -0.5410552025, 0.1346269399, 0.0187819581, 0.5171118975, 0.309127003, -0.1555644721, -0.2226474434, 0.049430389, 0.2618089616, -0.0502669178, -0.0712889135, 0.1240145266, -0.2022918612, -0.0897507742, -0.3304170966, -0.1338534504, -0.0362835154, -0.4213834405, -0.0046857544, 0.1267532259, 0.1458477229, 0.1624975055, -0.0917064175, 0.3000641167, 0.2218310535, -0.2381517142, -0.1674543768, 0.0321860127, -0.1012241766, -0.2741952538, -0.5269028544, -0.0320387743, 0.1731413007, 0.2774200141, -0.1411884129, -0.2662641406, -0.7050457597, 0.2729974687, 0.0149006778, 0.1656218618, 0.1455551535, -0.073635377, 0.1229064763, -0.2186596692, -0.1856950074, -0.0137088541, 0.0625973046, 0.0388247147, 0.2608801723, 0.118624188, -0.026542604, 0.3920224309, 0.7582393289, 0.2077146918, -0.2172785699, 0.225067094, 0.0890224725, 0.4650038183, -0.0440360978, -0.2433437407, -0.1683036685, 0.0978556499, -0.1787168831, 0.410587579, -0.1375830024, -0.1326861382, 0.0024822969, -0.0907586217, 0.2721267939, -0.1075219885, -0.0025520625, -0.4442730546, 0.0620430447, 0.0377652906, 0.2141905874, -0.1999804974, -0.2447486669, -0.0738616884, 0.1722291261, -0.0853310972, -0.1359673738, -0.1858637482, -0.53568995, -0.2991841733, 0.4534086883, 0.142795518, 0.4406172931, -0.191241473, 0.1218820065, -0.077624023, -0.0754079074, 0.4426036775, -0.2954182923, -0.322155565, 0.0678029507, 0.0504133701, -0.1277245879, 0.0715707168, -0.1836456805, 0.2224710733, 0.3943435848, 0.4560621977, -0.0618279614, -0.3682312965, -0.0891577825, -0.0150085352, -0.0613365881, 0.1047877371, -0.191354692, -0.4135423899, 0.0008694456, 0.3236666024, -0.0232240874, 0.2896872759, -0.1676884443, 0.0767331049, 0.0855689347, -0.024872629, 0.0633712038, -0.1107608527, 0.0915860087, -0.1242248416, -0.008821045, 0.0352124684, 0.0975969657, 0.4031941295, -0.0614818782, -0.2436501682, -0.1201556996, 0.1217567772, -0.0821399242, 0.3428158462, 0.3620162308, -0.2411070913, 0.1716367304, -0.0573204048, 0.219619289, -0.0515444279, -0.189441368, 0.1967511624, 0.1235135943, -0.3297776878, -0.2535514832, 0.1763494611, 0.1899459511, -0.05825793, 0.3350795805, -0.1732223034, -0.3365856111, 0.3295779228, 0.2607651949, 0.7838842869, 0.1587834805, 0.1453652978, 0.224197045, 0.0076919813, 0.4496665001, -0.0851001069, 0.2854069471, -0.3297615647, -0.1069129705, -0.0175766628, -0.0283370651, 0.076531291, -0.2744090557, -0.4212643802, 0.3958393335, -0.3130152225, 0.1119683459, 0.0476607382, -0.0193150043, 0.0017606595, -0.1346188039, -0.1763062775, 0.1434060037, -0.0509915687, -0.0638148114, -0.1985663623, -0.1533885449, -0.0887425765, -0.2491590083, -0.2029887289, -0.046508234, 0.0008167443, 0.0500566028, 0.1021752879, -0.1325034499, 0.0101590678, -0.0453760177, 0.6511392593, 0.2024534196, -0.0967985988, -0.0861033723, -0.3375155032, 0.3422828615, 0.1619881541, 0.0377238244, 0.2105179131, -0.1257283092, -0.0671118498, 0.0216032676, 0.0543296672, -0.1683904529, 0.1029613167, 0.1180802137, -0.4745996594, -0.0123661468, 0.0147309666, -0.1293438226, 0.0227096919, -0.1549340189, 0.14512299, 0.0443021469, -0.427136898, 0.2010447532, -0.0083814552, -0.1178947762, 0.1374216974, 0.3740794659, 0.3873319626, -0.1296366006, 0.3213076591, 0.0294980574, -0.0242386777, -0.1934432387, -0.158730939, -0.1021227911, -0.0283011757, 0.5267843008, -0.0159638003, -0.1582408994, 0.039352946, 0.610891521, 0.0679976121, 0.3737491965, -0.2151810378, -0.2402607948, -0.2137259096, 0.1524184346, -0.3421462178, 0.0357889347, -0.2687767744, 0.15984568, -0.0483094864, -0.0675326586, -0.3256033063, -0.0053276978, -0.5822660327, 0.2281894684, 0.0019553418, -0.0447114259, 0.1777947545, 0.167275399, -0.0269952361, 0.0087782666, -0.516307056, -0.1283083707, -0.1641363204, 0.1332288235, 0.2568811774, 0.0015648413, -0.0337986648, 0.0868804902, -0.0358157679, 0.0137621276, 0.0513420366, 0.2249253243, -0.1380154788, 0.1345110387, 0.0531318001, 0.3093574345, 0.4541189373, 0.0168515276, 0.211428687, 0.1103703156, -0.1310705245, 0.2171843797, -0.0491005927, -0.0213714913, 0.0826738924, 0.0668933913, 0.0013302173, 0.2075708956, 0.1935933381, -0.2006031722, -0.1441449374, 0.1552372128, 0.2286745459, 0.0008652955, -0.0579908155, -0.1737775654, 0.111739926, 0.1524030268, -0.1537356973, -0.256084621, 0.0828695819, 0.2873783708, 0.0435163416, 0.2376536578, 0.6414467096, -0.1512836516, 0.3893933892, -0.0593384989, 0.3311493695, -0.5056808591, 0.2554983497, 0.1255852133, 0.175237447, 0.2068279833, 0.2748242021, -0.1083729565, 0.0928034708, 0.366581589, -0.0058929124, 0.4253590703, 0.5238866806, -0.1939543039, 0.0416301191, -0.2242095768, 0.1587410718, 0.1086471453, 0.2729485631, -0.0232507922, -0.2108724862, 0.0915463492, -0.2629573941, -0.3100193739, -0.1211333871, 0.1296382397, -0.3028591871, -0.0189113989, -0.2903175354, -0.2848829627, 0.0099472413, -0.1718783528, 0.1598355919, 0.0589967333, 0.0714218542, -0.0249301102, 0.1933346391, -0.0902364701, -0.6897418499, 0.2785595059, 0.0477240346, -0.1806767583, 0.0971989781, 0.0878417566, 0.1024546027, 0.0077936365, 0.4235360026, 0.5571832061, 0.5265237689, -0.1513026506, -0.2116868496, -0.1038864926, -0.0789821595, 0.0074872817, 0.4405223131, 0.2474872321, -0.2089954019, 0.0488185659, 0.0464875102, -0.1254560649, 0.6335601211, 0.0618404225, -0.2150240093, -0.0572171547, 0.691778481, 0.116963163, -0.1868627816, -0.152478084, -0.2617039382, -0.4149160981, 0.2753248811, 0.7080236077, -0.0909694135, 0.1992948204, -0.1455475092, 0.1045817062, 0.178486824, 0.2287333757, 0.2525072694, 0.1226941049, -0.4430890083, 0.0635413378, -0.2749472558, 0.2051920742, -0.0078024738, 0.56624192, 0.0571241528, 0.0373442806, -0.0386764146, 0.0657404289, -0.1301497519, -0.0293791052, 0.0640197545, -0.111469239, -0.5865783095, 0.0228966568, 0.1776904017, -0.1765090823, -0.0187859926, -0.166143477, -0.2150131315, -0.2838037014, 0.090825364, -0.2027357668, 0.0361500084, 0.0451818742, 0.3070931137, 0.1492674351, 0.2019897699, 0.4724557698, 0.1372268051, -0.2625912428, -0.1933423728, -0.2765472233, -0.3023961782, -0.068893306, 0.0031625547, 0.3741802573, -0.2008823305, -0.1248793229, -0.366810143, 0.6668751836, 0.0820668265, 0.0217172839, -0.2482244968, 0.4603609145, -0.3204935789, -0.0269623566, 0.0846238881, 0.240933165, 0.172937423, 0.3077317476, -0.3895664811, -0.2265734971, 0.6256465316, -0.7567943335, -0.3048577011, -0.0389307439, 0.427952975, -0.0262923334, -0.3801740706, -0.5356046557, -0.2704556882, 0.290535152, 0.0874242187, -0.3660974503, 0.0387881361, 0.0568864606, 0.1276493073, -0.0671718642, -0.4462126493, -0.0022063602, -0.393963784, 0.1510465741, -0.3153621852 ]
https://github.com/huggingface/datasets/issues/517
add MLDoc dataset
This request is still an open issue waiting to be addressed by any community member, @GuillemGSubies.
Hi, I am recommending that someone add MLDoc, a multilingual news topic classification dataset. - Here's a link to the Github: https://github.com/facebookresearch/MLDoc - and the paper: http://www.lrec-conf.org/proceedings/lrec2018/pdf/658.pdf Looks like the dataset contains news stories in multiple languages that can be classified into four hierarchical groups: CCAT (Corporate/Industrial), ECAT (Economics), GCAT (Government/Social) and MCAT (Markets). There are 13 languages: Dutch, French, German, Chinese, Japanese, Russian, Portuguese, Spanish, Latin American Spanish, Italian, Danish, Norwegian, and Swedish
16
add MLDoc dataset Hi, I am recommending that someone add MLDoc, a multilingual news topic classification dataset. - Here's a link to the Github: https://github.com/facebookresearch/MLDoc - and the paper: http://www.lrec-conf.org/proceedings/lrec2018/pdf/658.pdf Looks like the dataset contains news stories in multiple languages that can be classified into four hierarchical groups: CCAT (Corporate/Industrial), ECAT (Economics), GCAT (Government/Social) and MCAT (Markets). There are 13 languages: Dutch, French, German, Chinese, Japanese, Russian, Portuguese, Spanish, Latin American Spanish, Italian, Danish, Norwegian, and Swedish This request is still an open issue waiting to be addressed by any community member, @GuillemGSubies.
[ -0.3504600525, 0.0476951525, -0.1798269302, 0.1780565381, -0.0401051864, 0.0907022581, 0.2102558017, 0.0325843133, -0.2079455554, -0.0521606654, -0.0914576352, 0.2889951468, -0.386035502, 0.2393021584, 0.008176974, -0.2751592696, 0.0485755689, -0.1197367013, -0.0523766279, -0.1522305906, -0.2527981997, 0.239445582, -0.0691753402, -0.3075846136, -0.1811060458, -0.0353650674, -0.3153687119, 0.0952791348, -0.0668418556, -0.2999735475, -0.0394036621, 0.062655732, 0.0979469568, 0.2279054075, -0.0001061797, -0.2723766565, -0.0213431809, -0.0787593573, -0.0399522446, -0.342012316, -0.1925266981, -0.5444476604, -0.1018268839, -0.076777339, -0.3466023803, -0.0490745343, 0.0083700698, -0.3613843918, 0.0605381727, 0.5007578731, 0.2565389872, 0.0859355554, 0.1024276242, -0.0976421311, 0.272701174, 0.1102408543, -0.2241945416, 0.4792914093, 0.3978054225, -0.0129566304, -0.1251176149, 0.3853281438, 0.0855682343, -0.1745481044, -0.2359007597, -0.1055126414, 0.3037678897, -0.4347403347, 0.2402414083, 0.4121543169, 0.4717879295, -0.057859581, -0.0302901622, 0.0187113136, 0.2011544555, -0.1232531145, -0.1241773888, 0.4248025119, -0.1183527261, 0.2057822198, 0.2912897468, -0.2708719373, -0.1782761216, 0.2673751414, 0.0062589804, 0.590461731, -0.09485659, -0.0398362763, 0.0286296718, 0.0630984157, 0.0894314945, -0.0559798926, 0.0216118228, 0.0299717374, -0.006994002, -0.1323747784, 0.1900780052, 0.033890821, -0.0118480427, -0.5495746732, -0.2824373245, 0.1264009923, 0.0002328989, 0.2171894163, 0.1047805846, -0.1002690047, -0.0895596519, -0.1077378541, 0.0900662541, -0.6283727288, -0.0414239801, 0.1344915479, -0.0186326597, 0.2106269896, -0.20730941, 0.2827200294, 0.0501628108, 0.0374761187, -0.1497851759, 0.020248048, -0.0945358202, -0.1005711257, -0.0626531839, -0.0025817878, 0.2395416796, 0.3365657628, -0.2852635086, 0.4120231867, -0.0436527692, -0.2059770525, -0.0120768119, 0.2986412644, -0.467250526, 0.2174862027, 0.2671690285, 0.3142029345, -0.1296132803, 0.0681925043, -0.1805100292, -0.0437335484, -0.0008032292, -0.0104819341, 0.0942154527, -0.2559864223, -0.1792083532, -0.1735662222, 0.1549896747, 0.0668149069, -0.3196914792, 0.1501155645, -0.2282115817, -0.1416858286, -0.4731709361, 0.1578962803, 0.2616533041, -0.2436590195, 0.064213343, 0.863278389, 0.0825071037, 0.0251893867, 0.1984638721, 0.1562653631, -0.344994545, -0.0244765654, -0.315110743, 0.3379442692, -0.2713028789, 0.0985438079, -0.3621902168, 0.1460315436, 0.4985354245, -0.1491978467, -0.2632511556, -0.0646695793, -0.0307395067, 0.1373832077, 0.0982735381, -0.182075724, -0.1346077174, -0.0635984391, -0.2748341858, -0.1773217469, 0.3722851872, 0.3560858369, -0.0993724987, 0.0530078113, -0.2976568341, 0.1973386407, -0.164375633, 0.18647632, -0.2438935041, 0.0223283265, 0.3751322031, 0.2322482616, 0.1834987253, -0.15143466, 0.3337678909, -0.111068882, 0.1882600635, -0.0859176591, 0.0978524387, 0.0397927202, 0.3091087341, -0.2474256903, 0.0880565941, -0.1876772195, -0.4251467288, -0.1957607418, 0.0680514574, 0.527748704, 0.0006937048, -0.2496937364, -0.1992040426, -0.1998841614, -0.0813730881, -0.2588812113, 0.2315973938, 0.2079891115, -0.1649479866, 0.3441868126, 0.0444371626, -0.145708397, -0.1748244315, -0.1963100731, 0.0520575047, 0.3023569584, -0.1225668713, 0.1410600394, 0.2456605583, 0.3988871872, 0.0367085785, -0.0794375613, -0.0863956958, -0.0437922589, -0.1423497796, 0.12769638, 0.4605622888, 0.3530477285, 0.2352761477, -0.5769768953, 0.0520047061, 0.0045330077, -0.0322565064, -0.0442242846, -0.131645456, 0.5089735985, 0.2918945253, -0.0439193919, -0.1299794614, 0.0080994964, 0.2802170515, 0.1063906029, 0.1076648012, -0.2521215975, 0.196137175, 0.222968623, 0.223180145, 0.0003108637, -0.2700795829, 0.3575140834, 0.4288191497, 0.2195138484, 0.4198084772, 0.1980834156, -0.1720622778, -0.1587090939, 0.1949119568, 0.3316397071, 0.320674181, 0.2881240547, 0.2182107568, -0.1101258323, 0.1997352242, -0.2270749807, 0.0574109554, -0.2346521318, 0.0194470994, 0.1496642232, 0.29772228, -0.0787326545, -0.3853928447, -0.0284577999, 0.1682718992, 0.1194264814, 0.2478953898, 0.0757955834, 0.0107711283, -0.3028209805, -0.1325545758, -0.0371496342, -0.3319293261, -0.0881229416, 0.2266664803, -0.1962449998, 0.0135378186, 0.1910297871, 0.0738740787, 0.6659821272, -0.2408092767, 0.3134455383, 0.0946906731, -0.3747075498, -0.1084232852, 0.187262401, 0.3665884137, 0.0572731681, 0.4213939011, -0.0802010596, 0.0244265031, -0.1391050667, -0.3946221173, 0.1376086622, -0.1326624602, 0.0045508435, -0.2764540613, -0.2783459425, -0.2011670917, -0.2879022956, 0.0679924563, 0.2422076613, 0.0488179401, 0.0968867019, -0.2544697821, -0.0422846153, -0.0170376226, -0.5840317011, -0.5971539021, -0.3213186264, 0.1237820387, -0.4896153212, 0.0652241558, -0.1523710936, -0.1793898493, -0.0761268064, -0.1064794511, 0.0808063149, -0.1429603994, -0.1013495252, 0.1082432121, -0.4424517453, -0.294885397, -0.2282620817, -0.1236577556, 0.3014537394, -0.11302156, -0.3047881722, -0.0105101382, 0.0000253868, 0.2592219412, 0.2193442434, -0.1279333234, 0.3854501843, 0.1799129695, -0.220476523, 0.1150018126, 0.1998906434, -0.0299934298, 0.1024779975, 0.1932314187, -0.1513637751, 0.1441394389, 0.2045752257, 0.67414397, -0.2040859163, -0.2150017917, 0.3979613781, 0.0647446513, 0.275273174, -0.1986931562, -0.4880428612, 0.0617457591, -0.1468406469, 0.1192883402, 0.434921205, 0.1452077478, -0.6007017493, -0.1493841559, -0.0440623537, -0.2372517735, -0.1192615032, 0.4779382646, -0.119241029, 0.489343673, -0.0604410209, -0.4806215763, -0.1466919184, -0.4637527466, -0.0524484292, 0.3658187687, -0.0979319289, -0.2127045542, -0.3793242276, -0.2370934337, -0.4760769606, 0.1658678949, 0.2960686386, -0.0070886309, -0.2773672044, 0.1327594221, -0.0535998903, 0.1378531605, -0.047115054, -0.2517941296, -0.2112854719, 0.2253710926, 0.1360318065, 0.2857649028, 0.1675660014, -0.2783944905, 0.3581991792, 0.3128787279, 0.0537662357, -0.1441450715, 0.0092227943, 0.1048771739, -0.1199765429, -0.0164659526, -0.2579376996, 0.2546907067, 0.2651934624, 0.0405314676, 0.206028387, 0.0771800354, 0.0131417932, -0.057499107, -0.079552345, 0.2969718575, -0.1456533521, 0.1984929889, -0.023326477, -0.2609377503, 0.4214571118, -0.0801086724, -0.4275276661, 0.0767886862, 0.47646752, 0.344479382, -0.3277986944, -0.3228879869, 0.0872001424, -0.6639156342, 0.4696890712, 0.157040447, 0.2391200066, 0.2240028977, -0.0443973355, -0.1164846942, -0.128698498, 0.1328665912, -0.0400879122, 0.1218545586, -0.2763404548, -0.0844314247, 0.3336794674, -0.1783898324, -0.1271011829, 0.0463327095, 0.0429405607, -0.1024373248, 0.1454384327, -0.1845740825, 0.9991679192, 0.0421382785, -0.0390666835, -0.1620029211, 0.0415902361, 0.3682963252, -0.4186355174, 0.0810638294, 0.0249308925, 0.2886127234, -0.0106034111, 0.2014369965, 0.0217227619, 0.4167998731, -0.259411484, -0.1328704059, -0.0949496627, -0.3697194457, -0.12943618, 0.3930037618, 0.1445161104, -0.3100062311, -0.0702933297, 0.1513937414, 0.1585782617, -0.0640834197, -0.0977441072, -0.0784077197, 0.1131888554, -0.0263165589, -0.5851587057, -0.1633248776, -0.140444532, -0.0010683922, -0.3791236579, -0.4034352899, 0.4643146992, 0.1088786349, 0.1197961941, -0.0816848278, -0.0747468024, -0.0481379963, 0.0761644989, -0.0824097469, 0.1130243614, -0.2577241361, 0.151716426, -0.1179751977, -0.145661667, 0.3262197971, 0.0533523895, -0.2974794805, -0.1739798188, -0.0022873362, 0.3571197689, 0.1794330925, 0.2065736949, 0.4325196147, -0.1237899065, -0.1778425425, 0.2551516891, 0.0903267339, -0.0567391738, -0.0667490736, 0.0631641299, -0.0904909149, -0.2605325878, 0.1119600013, 0.358951062, 0.0481437407, -0.054359749, 0.3596838117, -0.1761042625, -0.3980859518, 0.2156862617, 0.4703178406, -0.3415984511, -0.264313072, 0.0983723849, -0.2792688906, 0.0947735086, 0.1272611171, 0.0722856298, -0.0761641935, -0.0338221118, -0.2948747873, 0.0781949237, -0.1039996594, -0.1449817717, -0.0626107529, -0.144817993, -0.0697876513, 0.1207154691, 0.5719765425, -0.3960480094, 0.0132711269, -0.1148025617, 0.3371840119, 0.3385545015, 0.1901920736, 0.1771302223, 0.1263931096, 0.0809033588, -0.2876847684, -0.1552658081, -0.2474002987, 0.0746278167, 0.1263088435, 0.0042048176, 0.15448457, 0.2634315491, -0.1682386398, -0.1326879263, 0.0997381061, -0.0896563008, -0.0885655135, -0.200629577, 0.2484875023, -0.024249658, 0.1026358455, 0.1923002601, 0.0701180622, -0.0605509728, 0.4121598005, 0.1102797985, 0.3135124147, 0.2025723755, 0.0406650081, -0.2264909744, 0.0480806157, 0.1162046716, -0.0264300574, 0.0195071474, 0.3126186728, 0.0909893513, 0.2852867544, -0.0029833235, -0.3067892194, -0.1718092859, 0.2622523606, 0.1899767518, 0.2933300138, -0.2764182687, -0.1160562634, -0.012324255, -0.1363572776, 0.3736112118, 0.2231891751, 0.5580360889, 0.0558354668, 0.3407671452, -0.1281917542, 0.2126193047, -0.1000775471, 0.1407823563, -0.2668407559, 0.0731990337, 0.1450915188, 0.2389806956, 0.0224508289, 0.1655884832, 0.0073099909, 0.1722317785, 0.4492500126, 0.5488789678, 0.0749436542, 0.1833156347, 0.2571965158, 0.4761043489, -0.0145538133, -0.1138033643, 0.1058376878, 0.1011009067, 0.5873671174, -0.0996634364, -0.2136489153, 0.0050925403, 0.264149785, 0.0209780578, 0.1223191619, 0.1888945103, -0.1931832433, -0.2949825227, -0.1077045724, -0.0582860075, -0.0591633879, 0.3235076368, 0.1896042675, -0.0172166415, -0.0435146093, -0.182518363, 0.0981009305, 0.1939059198, -0.2571989, 0.2715387642, -0.0609118976, -0.1142501086, 0.0420163088, 0.2911753953, 0.0636652559, 0.1521027237, -0.1244270504, 0.0080014933, -0.205122605, -0.0687011927, -0.0833029747, 0.1853267103, 0.222143352, 0.1677639186, 0.0907908231, 0.1673063785, -0.0428928062, 0.1316726208, 0.4447265267, -0.1616387963, -0.1065650955, -0.2647455335, 0.0569035038, 0.0685200915, -0.380006671, 0.0482382886, -0.1828313768, -0.0134941852, 0.3872524202, -0.2341008931, -0.0111232512, -0.2185673565, 0.101993233, 0.0592906401, 0.2190642208, 0.1313595772, 0.1556180418, -0.2932219803, -0.3325884938, -0.3342853785, 0.1244105771, 0.0433669649, 0.1419536024, -0.2438903153, 0.0919462144, 0.3528182507, 0.4291574657, -0.2348553687, -0.0953564122, -0.0262034293, 0.0503736325, -0.607915163, 0.1129187718, -0.1610677838, 0.1781866401, -0.0642763376, 0.0717877969, -0.0605340824, 0.0821431056, 0.0979240984, -0.3729563057, -0.2880817354, -0.0017772939, 0.3894967735, 0.3264066577, 0.0986554995, 0.5398355126, -0.1891205311, -0.2432232052, 0.0601161048, -0.2482289076, -0.0344023518, 0.0884416029, 0.280852735, 0.078421101, -0.4056000113, -0.3906469643, 0.2368118018, 0.1843075305, -0.1191082671, -0.1633125991, -0.3069268167, 0.1217957139, 0.2452246249, -0.0172460061, -0.088631317, 0.2369785011, 0.1804030985, -0.2136700451, -0.0545988455, -0.1283071041, -0.0078330804, -0.1371268481, -0.1735515893, -0.1268009543, 0.2104528099, 0.0174020939, 0.170017764, -0.2431246787, -0.2548583746, 0.2900342941, 0.114830777, 0.079913266, 0.2578095198, 0.124919042, -0.2490222752, -0.182518065, -0.2241449058, -0.0429612771, -0.1331421137, -0.0737079829, -0.4327379465 ]
https://github.com/huggingface/datasets/issues/514
dataset.shuffle(keep_in_memory=True) is never allowed
This seems to be fixed in #513 for the filter function, replacing `cache_file_name` with `indices_cache_file_name` in the assert. Although not for the `map()` function @thomwolf
As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`.
25
dataset.shuffle(keep_in_memory=True) is never allowed As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`. This seems to be fixed in #513 for the filter function, replacing `cache_file_name` with `indices_cache_file_name` in the assert. Although not for the `map()` function @thomwolf
[ -0.1573923975, 0.1101284251, -0.0568152219, 0.1280071884, 0.1705857068, -0.0684824362, -0.1548944861, 0.2861289978, 0.0338807367, 0.2117180377, 0.0658881068, 0.5071396232, -0.3157265186, -0.4159285128, -0.0771166384, 0.1456122994, 0.0106629664, 0.0505588129, 0.0162346438, -0.1306302547, -0.3281733394, -0.1376925558, -0.4366669357, -0.2426395416, -0.2989767492, -0.1640271842, 0.005283257, 0.0470129699, -0.227496922, -0.4783441424, 0.0199872013, 0.3617691994, -0.4792946875, 0.4746548533, -0.0001162967, -0.2271995693, 0.2232827246, -0.0738838837, -0.2772014737, -0.0804561302, -0.3944140971, 0.1710918695, -0.029430531, -0.1011725068, 0.2029479742, -0.1530761868, 0.0347532779, -0.4851995111, 0.2687034309, 0.2786894143, 0.1599707901, 0.0159431975, 0.00017019, 0.0008202319, 0.4894803464, 0.1501083672, -0.1416636407, 0.1507808119, 0.1773031503, -0.2589052618, 0.0207062438, 0.2994832695, -0.2331484854, 0.2211964875, 0.2024495602, -0.2042768896, -0.205948472, -0.2288381904, 0.3310021758, 0.2132775038, 0.2408331633, -0.3785223067, -0.3012784421, -0.1053986698, -0.037106812, -0.2631696165, 0.3107367158, 0.2316161096, -0.0896453038, -0.1278475672, -0.2277659178, -0.1627271622, 0.1554197669, -0.0969650745, 0.1520403922, 0.3311279416, 0.0854252279, 0.0750737637, 0.543808341, -0.0434679128, 0.1729152501, -0.1118269637, -0.2220361382, 0.3620206714, -0.4009710848, -0.0684150755, 0.116438508, 0.1214046776, 0.2701940835, 0.0775754675, 0.2510641515, -0.018215118, 0.0698500127, 0.2189763486, 0.1172194853, 0.3911764622, -0.0454114787, 0.229188785, 0.2023366392, -0.0665104464, -0.1798819304, 0.064379476, 0.0984604657, -0.2280790657, 0.0362018347, -0.1349883229, 0.0791309103, -0.2575397789, -0.1493144184, 0.145517081, -0.2016399503, -0.2749115825, 0.1139303595, 0.5352529287, 0.2145728916, -0.0850822181, 0.0486495085, 0.0245819744, -0.0372561179, 0.130348295, -0.3592343628, 0.1180868372, -0.2858395278, 0.0910925642, 0.3312161267, 0.0103799356, 0.4083405733, -0.0821993053, -0.0767395273, 0.142770648, 0.3175207675, -0.2982521355, 0.492713511, 0.3478176296, -0.2853667736, 0.0245103072, 0.023366712, 0.0859987587, -0.1818949282, 0.4057042897, -0.1047063917, -0.3154544532, 0.3535187542, 0.1046304554, -0.0984293669, -0.037205223, 0.0105706509, -0.0325793102, 0.4915997386, -0.3913597763, 0.3386235237, -0.2468026727, -0.0318352208, -0.3389359713, 0.0756421909, 0.1905239224, -0.299428314, 0.0468249545, -0.3101511896, 0.0093933223, 0.1475355178, 0.4033977389, -0.0408290923, -0.3672425449, -0.2317582518, 0.1196083128, 0.277931571, -0.1551207304, -0.5335749388, -0.2240507156, -0.0394641869, 0.1237247512, 0.1481852084, -0.0203217342, -0.0424620248, -0.1730811447, 0.5085963607, 0.037999291, -0.0126270447, 0.1150692254, -0.2760387361, -0.0769599974, 0.3453754485, -0.1851586699, -0.2285195738, -0.1318753809, 0.1136800274, -0.1366755664, 0.3384541869, 0.067230396, -0.0678050518, -0.084884502, 0.5236658454, -0.2864763737, -0.1019461676, -0.0956444442, -0.0910898149, 0.1867517084, 0.1332994252, -0.1971723139, -0.0885404423, -0.2106114924, -0.0276729781, -0.0563782416, -0.1452714801, -0.3837922812, 0.068906799, 0.1018487066, 0.1232280061, 0.078352727, -0.1650177687, 0.1610038877, -0.4800160229, -0.1713839918, -0.0109558068, 0.14752312, -0.0071874214, -0.2062905878, 0.0499242097, 0.1624587923, -0.084524408, 0.0634024292, -0.3319531977, 0.3970720172, 0.2695001662, 0.0723537132, 0.0935899988, 0.1672176123, -0.094398208, -0.1139782891, 0.2701926827, -0.1726674736, 0.1205781326, -0.0815215707, -0.1144954339, 0.2229021788, -0.249985978, 0.0974670649, 0.253813833, -0.1576069593, 0.3299960196, 0.2417399138, -0.1405290663, -0.2411242276, 0.3591742814, 0.1679521948, 0.3795501888, 0.2267789096, -0.2383547276, -0.0708892345, 0.6992046237, 0.2837003469, 0.1699569225, 0.0535838678, 0.0313555449, -0.314579308, 0.2185155302, 0.4217037261, 0.532752037, 0.1507368535, 0.1366882771, -0.0458079949, -0.0098618781, -0.0731762126, 0.3802343309, 0.048899442, 0.0775543228, 0.1109740958, 0.2988070846, -0.1855208427, -0.5816819668, -0.1974035501, 0.3076072335, 0.184389919, -0.1164078191, -0.1214053407, -0.3387996554, -0.1370218247, -0.0874950141, -0.1034929529, -0.2300512642, -0.1256724447, 0.1022123918, 0.4080300033, -0.1954041719, 0.3857198358, -0.3336472809, 0.5002208352, -0.0102243284, -0.1942365915, -0.2881379128, -0.2212343067, 0.1334692538, 0.07460244, 0.187798053, 0.1455858499, 0.390383929, 0.3359341919, -0.178764686, -0.0312283803, -0.2958878577, 0.0691656023, -0.1598303318, 0.1165885404, 0.0000161489, 0.085665293, -0.0761805251, -0.3799357712, -0.0507461205, -0.3272207975, -0.2472832352, 0.1441960186, 0.1873335987, -0.1622853428, -0.3767653406, -0.3460098207, -0.2578060031, -0.4631391168, 0.3171483576, -0.0848917812, 0.1214854345, 0.4202856421, 0.0141145233, 0.0793086439, -0.4065111279, 0.126260221, -0.4711135328, -0.3016930521, 0.151307106, -0.1811850667, -0.0848977119, -0.0582173988, -0.1400676072, 0.2091389447, 0.3899397552, -0.1939366162, -0.061789766, -0.4313778579, -0.1898047626, 0.0714058056, 0.1114424095, 0.4826929867, 0.1092971414, -0.1300195754, -0.207276985, -0.1935292631, 0.2210788727, 0.3850803673, 0.1657593399, 0.0406264514, 0.0668138638, 0.3262483776, 0.6937777996, 0.0598501973, 0.2929895222, 0.2368307859, 0.1813689172, 0.3728827536, -0.3469644487, -0.1049738079, 0.361242801, 0.1402892172, -0.3288642764, 0.0948680714, -0.2270586193, -0.3511340022, -0.0471119694, 0.2294054031, 0.0816843808, -0.1761451513, 0.0910458043, -0.1346188933, 0.028018469, 0.2118987888, 0.097867839, -0.2013150901, -0.1443092525, -0.174539417, -0.0612668805, 0.2783506811, -0.1113699004, -0.5371747613, -0.3369064033, -0.4133482277, 0.3385952413, 0.0732976422, 0.7409526706, -0.1150700301, -0.2570545971, 0.1130613908, 0.0311744101, 0.5424147248, -0.1315327585, 0.0703381151, 0.286082387, 0.1088638455, -0.1734211445, 0.0428577214, -0.3285352886, 0.1347730309, -0.2887088954, -0.227504313, -0.2670067847, -0.1154421121, -0.0717204213, 0.0076807183, 0.0275267139, 0.1575456411, -0.3131510317, 0.1189610362, -0.3537302911, 0.2048880309, 0.222388953, -0.1562039405, -0.4568427205, 0.0531485975, 0.0876475647, -0.0443661995, -0.0011115787, 0.1839972585, 0.6027071476, 0.0668464229, 0.065424569, 0.212133944, -0.3203268945, 0.2301210016, 0.3122934103, -0.1689049155, 0.2302584052, -0.0336303264, -0.0269167647, 0.3270860612, 0.4371740222, -0.0666525885, 0.2152834237, 0.0755507126, -0.0700166151, -0.1579743028, -0.0572545379, 0.2989971638, -0.1464775801, 0.0034276631, -0.6915035844, 0.2409238666, 0.4322817624, -0.1686564684, 0.8573558927, 0.0784566328, -0.1668888032, 0.3656114042, -0.0356804468, 1.1166884899, 0.1091568545, 0.0970482528, 0.1437732875, 0.0438760556, 0.0899270996, -0.0661744252, 0.29100582, -0.072525695, -0.5402417779, 0.1124227569, -0.3357087672, 0.215523228, -0.1074572578, -0.3066193759, 0.2703740299, 0.1088065207, -0.0759079382, -0.0636952743, 0.027835276, -0.3591053784, 0.0095767723, -0.0428427272, 0.0767821744, -0.039209608, -0.0215321835, -0.0597065017, 0.0223247316, 0.0490407683, -0.2968661785, -0.1549025774, 0.0383193269, -0.2098947167, 0.1892453879, -0.2458470464, -0.0086612478, 0.0586983897, -0.1383514106, -0.1002731994, 0.2575940788, -0.0381108038, 0.4269349277, 0.5315420628, 0.2869333923, 0.0922333598, 0.2054480016, 0.3232615292, 0.0497435778, -0.1855176836, 0.0617487617, -0.1750717312, -0.5215668678, -0.0882996544, 0.0091210818, 0.2101270556, 0.210457325, -0.3420526087, 0.2466961592, -0.3974886239, -0.2043133974, 0.1140343323, 0.0952133089, -0.1253780574, 0.4969867468, 0.0045317593, -0.2676777244, -0.0105165867, 0.4765640497, 0.0281227417, 0.2652393579, 0.4883909225, -0.1547875553, -0.1877837628, -0.2324954867, -0.3721446097, -0.0979961678, -0.1788609773, 0.2387906313, -0.1320290864, -0.3678794801, 0.1020921618, 0.2141323388, 0.0809841529, 0.4203982949, -0.1530861706, -0.3298026621, -0.321072489, 0.4822470844, -0.1216566265, 0.4010068476, -0.2554948628, 0.1152672991, -0.1312909573, 0.2543553412, -0.3306413591, 0.0438499935, -0.0866947249, 0.2975470424, -0.0985952392, -0.0719029903, 0.0443642102, -0.1761742085, 0.0815107822, 0.3535403609, -0.3803094029, -0.1887716055, 0.1281246543, 0.1591945589, 0.0792165324, 0.031946715, -0.1188535839, -0.5915082693, -0.0735409707, -0.2292184532, 0.1576599032, 0.1029230356, -0.0979310125, 0.2407463342, 0.3533523083, -0.0703483075, 0.3893805146, 0.2689371109, -0.1864768267, -0.4986570477, 0.004750933, 0.0578372404, -0.1854457408, -0.1271497756, -0.1210959032, -0.0699627548, -0.3378581703, 0.2191348374, 0.0398982614, 0.0895156562, -0.2619168162, -0.1121974513, 0.3521635234, 0.6336428523, -0.0485650264, -0.2793467641, 0.3481559753, 0.1860113144, -0.3188644648, -0.2030694038, 0.0778351724, 0.3197864592, 0.2016326189, -0.0069374507, -0.0450204983, -0.2190850377, -0.0726036504, 0.3098426759, 0.2485367209, -0.5961523652, 0.2809726298, 0.1141276956, 0.0162177607, -0.1505067945, 0.1792105883, 0.2326968312, 0.3400188684, 0.3597920835, 0.0004892465, 0.3931154907, 0.4816119969, 0.0684744939, 0.0877683461, -0.2693359554, 0.1169810668, 0.5212518573, -0.095521301, 0.3057993352, 0.256949991, 0.2468517721, 0.099605985, -0.2025587857, -0.2280269563, -0.0831029788, -0.1025748849, 0.0028622905, 0.1434672922, -0.3137083054, 0.0395570807, -0.1121041998, -0.0068380316, 0.1534909159, 0.6984444857, 0.1048739105, 0.0598902032, -0.3550286591, 0.2080315053, 0.117792353, 0.2147828639, -0.2703755498, 0.1793625653, 0.165755704, -0.0415785126, 0.3765406609, 0.27362746, 0.2136912048, 0.3082118332, -0.1811727881, 0.1040923148, -0.0340611003, -0.1599437892, -0.1944902837, 0.3913167417, 0.3522194624, -0.1744027138, 0.143554762, 0.1338281482, -0.1224545315, 0.0188089199, 0.1264180392, 0.1370449811, -0.289732337, 0.2310369909, 0.2666769326, -0.0323877744, 0.1337472945, -0.0725201443, -0.4232141376, 0.0295781717, -0.0952583775, -0.290354073, 0.0419532992, 0.0068692383, 0.060953822, -0.0908787474, 0.2384780645, 0.1523759961, -0.1010505185, -0.1375356019, -0.2638492584, -0.8945608735, 0.1401768178, 0.1064958498, 0.1123241708, -0.0922297537, 0.3892571032, 0.0441302694, -0.1401147693, 0.0965883732, -0.1807505935, -0.0234660227, 0.1317149401, -0.4472529292, 0.026688626, -0.0620255098, -0.0675664768, 0.1009896472, -0.258566618, 0.0665584579, -0.1518154293, 0.0168737303, 0.0684264451, -0.1055903658, 0.1257432699, 0.4385495484, 0.3916811347, 0.058867339, 0.3196923435, -0.0921981111, 0.156884551, -0.3073199987, -0.2492429912, 0.0389404558, -0.3124739826, 0.025838688, 0.5218634009, -0.2367618233, -0.1749368459, -0.2347988933, 0.3725394309, -0.2896843255, 0.0679832771, -0.3461993039, 0.2034959346, -0.0127019985, 0.4027404189, -0.3385982215, 0.009315799, -0.0445305854, 0.1489068121, -0.2840519249, -0.3808189631, 0.8212565184, -0.3352945149, -0.2349308729, -0.1738762408, 0.5242080092, 0.0427512228, -0.4556317329, -0.2740302682, -0.0482043512, 0.1213059202, -0.0840215087, -0.2470398247, 0.0919979438, -0.3285838366, 0.1826311499, -0.0695372522, 0.5346602201, -0.104664579, -0.2599050403, 0.0749411434, -0.1796702445 ]
https://github.com/huggingface/datasets/issues/514
dataset.shuffle(keep_in_memory=True) is never allowed
Maybe I'm a bit tired but I fail to see the issue here. Since `cache_file_name` is `None` by default, if you set `keep_in_memory` to `True`, the assert should pass, no?
As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`.
30
dataset.shuffle(keep_in_memory=True) is never allowed As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`. Maybe I'm a bit tired but I fail to see the issue here. Since `cache_file_name` is `None` by default, if you set `keep_in_memory` to `True`, the assert should pass, no?
[ -0.0392353497, 0.0279579945, -0.0443968698, 0.2410495281, 0.1197208911, -0.0215088278, -0.2454707772, 0.2770645022, -0.0534346923, 0.2102238387, 0.2128323019, 0.3744445443, -0.2902280986, -0.56642133, -0.0628237575, 0.2306990921, 0.0152334766, 0.0731295198, 0.1307363659, -0.1656003743, -0.4095742702, -0.1315800101, -0.5240514278, -0.1571466774, -0.4287534654, -0.157380864, -0.0444143489, 0.1171567962, -0.2388194203, -0.5017876029, 0.0678522289, 0.265494436, -0.4624954164, 0.4916146398, -0.0001249819, -0.3131682575, 0.2609164417, -0.0434021875, -0.1833147556, -0.0600505136, -0.4701535702, 0.3102068007, -0.1049669757, -0.1583370268, 0.3272445202, -0.1766210347, 0.0549894162, -0.4825306535, 0.1730249673, 0.2994131744, 0.0882782713, -0.0590316541, -0.0274078399, 0.0266639851, 0.3734092116, 0.0743082911, -0.0033934785, 0.2121798545, 0.0776691511, -0.1164058372, 0.1800210327, 0.176678896, -0.3082762063, 0.2287975699, 0.1727748513, -0.2034929544, -0.2115483284, -0.1800231338, 0.3078242838, 0.2102490962, 0.1988277584, -0.3202572167, -0.1344999969, 0.0092538949, -0.078213647, -0.2021754086, 0.3165805638, 0.2868346572, -0.0235547666, -0.0521014445, -0.1797535717, -0.2429486066, 0.1060217097, -0.0864027143, 0.038579084, 0.2909686267, 0.0322966948, 0.2232927084, 0.51009655, 0.1254255921, 0.044949349, -0.1143686622, -0.2260146439, 0.3378565609, -0.4495311081, -0.0888594538, 0.1479337215, 0.1570465416, 0.3375704885, 0.0762880892, 0.1617085338, -0.007240531, 0.0201303232, 0.1431002319, 0.153242588, 0.4152945876, 0.057830099, 0.172706753, 0.1973048151, -0.0983937457, -0.1155523285, 0.1021903157, 0.0477521047, -0.2676828206, 0.0527641922, -0.0756468773, 0.2449694127, -0.294706285, -0.1255387068, 0.1726627648, -0.3767857254, -0.3416081369, 0.040868476, 0.5163072944, 0.2582123578, -0.1329903901, -0.041968368, 0.0868414044, 0.0162563287, 0.0719359592, -0.3517905772, 0.1759073585, -0.2351173013, 0.0944052935, 0.2889088094, -0.0556470938, 0.282893002, -0.1205165759, -0.0619890131, 0.1201133505, 0.2415630668, -0.3670424819, 0.508492589, 0.2985738516, -0.3389810026, 0.0358221829, 0.0677107424, 0.1633681208, -0.1894765943, 0.47580266, -0.0540283285, -0.3840190768, 0.4273477793, 0.0068678269, -0.2204319984, 0.0482816249, 0.0162271895, -0.0989366993, 0.3985984921, -0.4084581733, 0.4869123399, -0.1724500507, 0.0578268319, -0.3036770821, 0.069000192, 0.170765698, -0.2531927824, 0.0957377329, -0.2667096853, 0.0407609828, 0.0872286856, 0.3894155324, 0.0169784185, -0.2980730832, -0.3070945144, 0.1243025213, 0.1682264805, -0.2866535187, -0.4500912726, -0.2724570334, -0.0869327635, 0.0789936185, 0.2291225791, -0.0798648968, -0.1744347662, -0.1958569735, 0.47200948, -0.0606686957, 0.0313484631, -0.0138746463, -0.2720585167, -0.0306102391, 0.3783477545, -0.2080348134, -0.2740471065, -0.113851428, 0.0983332023, -0.1043223962, 0.3244954646, 0.0963461027, -0.1518215239, -0.1861669868, 0.4907177687, -0.3960990012, -0.1179608405, -0.0278685819, -0.0874460638, 0.2058201879, 0.1571323574, -0.1732326746, -0.1034320295, -0.1785055995, -0.0762261599, -0.0115156965, -0.1123680621, -0.3707541823, -0.038570784, 0.1194326803, 0.1440198421, 0.1694183201, -0.1760575473, 0.1061042026, -0.5986759067, -0.224427253, 0.0427493826, 0.1040753871, 0.0717409626, -0.0567058772, -0.0475696288, 0.1452860832, -0.0732134134, -0.0363400094, -0.2680028975, 0.4468202591, 0.2502596676, 0.0327752642, 0.0547508337, 0.1621984243, -0.179276526, -0.1653309017, 0.2657488585, -0.2976215482, 0.1159588769, -0.1690283567, -0.0656773597, 0.1331107914, -0.3098518252, 0.1112018153, 0.1109438241, -0.1791753322, 0.2296431959, 0.2283747345, -0.175638929, -0.152600497, 0.3091275394, 0.2405742407, 0.4722816646, 0.2488892525, -0.191938892, -0.18721205, 0.6576308012, 0.2042259574, 0.1307447553, 0.0229939148, 0.0130416602, -0.2385836095, 0.2374878526, 0.3303773999, 0.6330353022, 0.0619601458, 0.1140249074, -0.017282553, 0.025426954, -0.0293960422, 0.3783990145, 0.083283022, -0.0130595313, 0.047179956, 0.2299643606, -0.201145187, -0.5206316113, -0.1508072615, 0.3162105381, 0.2098183781, -0.1740721315, -0.1102671623, -0.3141035438, -0.0405465737, -0.1490081847, -0.188791886, -0.2578427196, -0.1310341656, -0.0023848442, 0.318566829, -0.0844663903, 0.3169510663, -0.3148089051, 0.6230224967, -0.0225865263, -0.2276212573, -0.245803237, -0.1571440846, 0.1797523648, 0.008606351, 0.1364537328, 0.1759323925, 0.3079747558, 0.2266800106, -0.2091944516, 0.0181864984, -0.2771202326, 0.1260360777, -0.3050534427, 0.0277293995, 0.1027248427, 0.0826681927, 0.0702015981, -0.3488433659, -0.0780073628, -0.2902076542, -0.2417973727, 0.1993189305, 0.2402348816, -0.256210655, -0.3174751103, -0.3330115676, -0.1823945343, -0.3930697441, 0.4581947327, -0.0623166002, 0.1128846258, 0.3934788406, -0.0587175153, 0.1582949907, -0.4475109279, 0.1244436204, -0.4678839743, -0.3296846747, 0.1020306274, -0.0584396534, 0.0074498341, 0.0205650404, -0.0924888924, 0.2599038482, 0.2751395106, -0.2820499837, -0.0737172887, -0.3988439739, -0.1644541174, -0.0563470498, 0.0964502245, 0.4778027833, 0.0493488461, -0.0785900056, -0.1939100176, -0.2167295665, 0.2699857354, 0.514061749, 0.0867327079, 0.1301530153, -0.11056225, 0.3138840199, 0.576135695, 0.0391610675, 0.2408777028, 0.1803647429, 0.1420126259, 0.4015876055, -0.2043004483, -0.1414286047, 0.4393423796, 0.2179213613, -0.409155786, 0.0728609934, -0.3133543134, -0.1283573359, -0.0502657108, 0.2174620926, 0.1644689888, -0.1821400523, 0.1009647772, -0.238257587, -0.0050918716, 0.2078189999, 0.1116479486, -0.1473653764, -0.0391800478, -0.1153482348, -0.0875029415, 0.341039747, -0.1243543625, -0.5923788548, -0.3487130404, -0.3278661668, 0.4281816483, 0.1119033024, 0.830755353, -0.1152661517, -0.1735563576, 0.1640822887, 0.0619444102, 0.5362945199, -0.1172740757, 0.0954476446, 0.260638088, 0.089661628, -0.1401680112, 0.0434229709, -0.3344215751, 0.1724484414, -0.3914504051, -0.2697238922, -0.3254365027, -0.1192423478, 0.0361479111, 0.06634067, 0.0753055438, 0.1080308706, -0.3208335638, 0.1973253042, -0.2422353178, 0.2051681131, 0.2163417637, -0.186293155, -0.4946202636, 0.1055213809, 0.0382706784, 0.0400775932, 0.0240706354, 0.0755529925, 0.5680776238, 0.0298868679, -0.0848732069, 0.2088940144, -0.3640567958, 0.2437748909, 0.3006783724, -0.0664610341, 0.2759124637, -0.0423173644, -0.0690602586, 0.4477424622, 0.4921622276, -0.048148483, 0.206958428, 0.072431244, -0.1094596013, -0.287322998, -0.0450785607, 0.4593097568, -0.0728085786, 0.0014988369, -0.5875290036, 0.2001545876, 0.4760894477, -0.1860664189, 0.8500694036, 0.2287770957, -0.1439660043, 0.2142055035, -0.1160351187, 1.2216172218, 0.2491053194, 0.0933461189, 0.1263589114, 0.1488141567, 0.1581909955, -0.0590584204, 0.2269842625, -0.0439816378, -0.5896134377, 0.0094668586, -0.3999627233, 0.2146923393, -0.1705572009, -0.3709155321, 0.2024339437, 0.1345632374, -0.0681875125, 0.0204464663, -0.0177288707, -0.3314564824, 0.1697224975, -0.0034242172, -0.0226271488, -0.0847360939, 0.0079062404, -0.0950066075, 0.0382415354, 0.0030145489, -0.3511698544, -0.164181754, -0.0277093779, -0.1303078532, 0.1225658804, -0.2093461156, 0.0389282592, 0.1519822329, -0.1092840582, 0.0015475262, 0.2733679414, -0.0448901355, 0.3576458395, 0.5594893694, 0.2490702718, 0.1969083548, 0.1581670046, 0.2421550155, 0.132776469, -0.2835874557, 0.1540614218, -0.2534994185, -0.5219042301, -0.1789196134, 0.1445880681, 0.2153959721, 0.187657699, -0.4879380167, 0.3411856592, -0.4025753438, -0.1266576797, 0.0396499448, 0.124420464, -0.1550621539, 0.520970881, -0.0555497929, -0.4595398605, 0.0229395777, 0.4400494397, -0.0654217303, 0.2711243331, 0.4940774739, -0.2664986253, -0.0770589635, -0.1505244672, -0.3368164003, -0.1000724658, -0.2525238693, 0.0732147545, -0.1508962363, -0.2655439377, 0.0139126284, 0.345086664, 0.2159374207, 0.4373984337, -0.1543655246, -0.2863984406, -0.2581790388, 0.5522170067, -0.110336557, 0.3832836449, -0.2081241161, 0.1962576956, -0.103454411, 0.2826243341, -0.2426849604, 0.0834271163, -0.1535307914, 0.2829122543, -0.0633062571, -0.0240062643, 0.0130652655, -0.2674836218, 0.0173159353, 0.3564040363, -0.3901502788, -0.0926476642, 0.1129370704, 0.2374345064, 0.166558817, 0.1201585382, -0.0711924359, -0.645288229, 0.0608294569, -0.1305810511, 0.0980866328, 0.1315956116, -0.0744964182, 0.2508107126, 0.3897622824, 0.0260036103, 0.1697995365, 0.2967476547, -0.1825958937, -0.5086311102, -0.0112059126, 0.0410151184, -0.2855358124, -0.1894864291, -0.1129685715, -0.0598162487, -0.3204416037, 0.2510896027, -0.0417913981, 0.1318590492, -0.2278372943, -0.2504898012, 0.3681553006, 0.6540331244, -0.102620028, -0.3410203457, 0.3324917257, 0.0743096918, -0.2177840322, -0.1193659604, 0.0007173755, 0.3264863789, 0.1794406474, 0.0963229313, -0.0658259466, -0.2668127418, -0.0725483075, 0.2635923624, 0.2529502511, -0.5686267614, 0.2056438178, 0.0314372554, -0.1529377997, -0.139341563, 0.249261409, 0.2507660985, 0.3166513145, 0.162058562, 0.0046586404, 0.3221438825, 0.527482748, -0.0197698604, 0.1290697306, -0.1776992828, 0.1891236156, 0.5614774227, 0.0008473372, 0.1952775419, 0.3151611388, 0.4734130204, -0.0253535677, -0.158859849, -0.1766505092, -0.1852625608, -0.0416793153, 0.147796765, 0.1525011957, -0.2881447077, 0.1304532886, -0.2304119468, 0.001815785, 0.1126256064, 0.7740175128, 0.2041042298, 0.030805571, -0.3100681007, 0.1341640353, 0.0680978969, 0.2156363279, -0.2797540724, 0.2032617033, 0.2326893061, -0.0048194588, 0.4367748499, 0.4031176865, 0.2432022244, 0.3272055387, -0.1946518868, 0.0895841271, -0.0154557833, -0.0866338685, -0.1136949137, 0.3165298104, 0.2770951092, -0.1894358993, 0.1903128624, 0.097012572, -0.06694635, 0.0287211649, 0.1334052831, 0.1350355744, -0.3762668669, 0.3123153746, 0.2819027305, -0.0252999347, 0.1395073831, -0.0156966727, -0.4565901458, 0.0715073571, -0.2928661108, -0.4036082327, -0.0115448376, 0.0796279758, 0.0128476545, -0.1003052518, 0.1913978308, 0.2416293621, -0.0139171872, -0.2232579589, -0.2436425537, -0.8886804581, 0.2838241458, 0.2331375182, 0.0113432864, -0.0413216799, 0.2859717906, 0.0587557442, -0.1878685355, 0.09550374, -0.2109873146, -0.1159204394, 0.166045934, -0.4591840208, 0.1372928619, 0.0080652861, -0.1652604192, 0.0057894546, -0.1957206577, 0.1736649573, -0.0851029977, -0.0832154676, 0.1616664082, -0.0848579705, 0.0822804943, 0.4686517715, 0.4728083313, 0.0355507694, 0.4646647871, -0.0505962819, 0.1603974849, -0.2282308787, -0.1636152565, 0.1063531265, -0.2522866428, -0.0127327004, 0.4332022667, -0.2395882457, -0.1472661644, -0.1908492744, 0.4235979319, -0.2601757646, 0.0941419005, -0.3972090483, 0.1711036563, -0.183019504, 0.3910828829, -0.2500677705, -0.0073044579, 0.0230883025, 0.1512429565, -0.2764290869, -0.3034209907, 0.8547513485, -0.197651118, -0.270747304, -0.0604358651, 0.6034944654, 0.0362269022, -0.5679730177, -0.1976688951, -0.1313984841, 0.1464743316, -0.0189042855, -0.3351225853, 0.0778696239, -0.4213604331, 0.148284927, -0.0130737247, 0.5897582769, -0.1565412283, -0.2910609841, 0.1241460443, -0.1826508194 ]
https://github.com/huggingface/datasets/issues/514
dataset.shuffle(keep_in_memory=True) is never allowed
I failed to realise that this only applies to `shuffle()`. Whenever `keep_in_memory` is set to True, this is passed on to the `select()` function. However, if `cache_file_name` is None, it will be defined in the `shuffle()` function before it is passed on to `select()`. Thus, `select()` is called with `keep_in_memory=True` and a not None value for `cache_file_name`. This is essentially fixed in #513 Easily reproducible: ```python >>> import nlp >>> data = nlp.load_dataset("cosmos_qa", split="train") Using custom data configuration default >>> data.shuffle(keep_in_memory=True) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/nlp/arrow_dataset.py", line 1398, in shuffle verbose=verbose, File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/nlp/arrow_dataset.py", line 1178, in select ), "Please use either `keep_in_memory` or `cache_file_name` but not both." AssertionError: Please use either `keep_in_memory` or `cache_file_name` but not both. >>>data.select([0], keep_in_memory=True) # No error ```
As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`.
131
dataset.shuffle(keep_in_memory=True) is never allowed As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`. I failed to realise that this only applies to `shuffle()`. Whenever `keep_in_memory` is set to True, this is passed on to the `select()` function. However, if `cache_file_name` is None, it will be defined in the `shuffle()` function before it is passed on to `select()`. Thus, `select()` is called with `keep_in_memory=True` and a not None value for `cache_file_name`. This is essentially fixed in #513 Easily reproducible: ```python >>> import nlp >>> data = nlp.load_dataset("cosmos_qa", split="train") Using custom data configuration default >>> data.shuffle(keep_in_memory=True) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/nlp/arrow_dataset.py", line 1398, in shuffle verbose=verbose, File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/nlp/arrow_dataset.py", line 1178, in select ), "Please use either `keep_in_memory` or `cache_file_name` but not both." AssertionError: Please use either `keep_in_memory` or `cache_file_name` but not both. >>>data.select([0], keep_in_memory=True) # No error ```
[ 0.0582521893, 0.1715383828, 0.0236406531, 0.1729351878, 0.1541410983, -0.1635664403, -0.3068187237, 0.3015696108, -0.1271580309, 0.2035997659, 0.1368855089, 0.5172114372, -0.3025809526, -0.4314016104, 0.0418819711, 0.1355718672, 0.0163558908, -0.0274760127, 0.0766999424, -0.1642750055, -0.4050560892, -0.0679784119, -0.5050225258, -0.2724936008, -0.3539697528, -0.0422092043, -0.0651144609, 0.0619973056, -0.2063216865, -0.5102363229, 0.0461512059, 0.3633303642, -0.3701826334, 0.3270516694, -0.0001268262, -0.2589107752, 0.3602532148, -0.0730156675, -0.3363348246, -0.0587589145, -0.3150103688, 0.2423153371, -0.087623693, -0.1639827341, 0.2200228125, -0.1693584621, 0.0512557328, -0.4195260704, 0.1856562793, 0.3109854758, 0.0398747325, -0.0168225337, -0.0427037403, 0.053965006, 0.4000211656, 0.0502959378, -0.0710291639, 0.1810719818, 0.0258241836, -0.1065651998, 0.1176694781, 0.1653532535, -0.2495702952, 0.0350747444, 0.1981941164, -0.1733991206, -0.1578304321, -0.1440364867, 0.2231004983, 0.2262677401, 0.1969541758, -0.3949066997, -0.1448998749, -0.1585543305, 0.0652293339, -0.3188781738, 0.3673403859, 0.2271050513, -0.0369680151, -0.1411618292, -0.2817865312, -0.1317585409, 0.0459678285, 0.0505827144, 0.1565725356, 0.4199056029, 0.0662544593, 0.2579329014, 0.5411179662, 0.053242296, 0.1429490894, -0.120549731, -0.1223397776, 0.3546849191, -0.4297559857, -0.1071820781, 0.1272519678, 0.2284682989, 0.3260553777, 0.1716282219, 0.2923563421, -0.0018563325, 0.0666190311, 0.1755292267, 0.1559854448, 0.4208343327, 0.0823544785, 0.0897040293, 0.2520475388, -0.0248581991, -0.0233358238, 0.1855765879, 0.008934564, -0.2514483631, -0.059905991, 0.0283954479, 0.1699503213, -0.2244923413, -0.1456382275, 0.1323851943, -0.4279552102, -0.296387285, 0.0615712963, 0.4393815994, 0.2439155728, -0.0363112353, -0.0334250107, 0.0826518536, 0.0316744447, -0.0285779014, -0.2911152542, 0.189047128, -0.3774470985, 0.185550645, 0.4148965478, 0.0236337371, 0.4221939445, -0.1622271389, -0.0405373462, 0.1626262963, 0.0964485705, -0.3839092255, 0.4567763805, 0.278670907, -0.2528739274, 0.0173065588, -0.0764115751, 0.1386787593, -0.252491653, 0.4537697434, -0.0491762049, -0.2829816341, 0.3743939698, -0.0348974131, -0.2979338169, -0.0340027027, -0.1033729017, 0.0014513048, 0.3998070061, -0.3425257802, 0.5083597898, -0.2778916657, -0.0489261635, -0.3168386519, 0.1293802559, 0.2588361204, -0.1447187513, 0.0277003553, -0.2785169482, 0.0615408085, 0.1749750674, 0.3470169306, -0.0739550665, -0.0982234105, -0.3033790886, 0.0451325811, 0.247251153, -0.2331340164, -0.5170557499, -0.4015236199, -0.0577960685, 0.150093779, 0.1228234619, -0.0361851454, -0.0466814116, -0.2397121042, 0.5691526532, 0.1230768338, 0.0507957153, 0.0702163577, -0.2244808674, -0.1442091018, 0.3917489648, -0.1554685682, -0.2716073096, -0.1668287367, 0.1186870039, 0.0079843085, 0.336779356, 0.0780104101, -0.0938454345, -0.0691633597, 0.3975319266, -0.2684623003, -0.1448490471, -0.0017917897, -0.2628356814, 0.1890725642, 0.1500022113, -0.0776877627, -0.0046194098, -0.1408886462, 0.0069596414, -0.1317947656, -0.0786308423, -0.4655656517, -0.0289580971, 0.2572418153, 0.2690213025, 0.167477116, -0.1987802684, 0.1474256665, -0.6084166169, -0.1418688446, -0.0942375511, 0.1213891357, 0.140778631, -0.2250760943, -0.0015509404, 0.2883161008, 0.0494452678, 0.0084298458, -0.2568843961, 0.421099931, 0.2343771905, 0.0555307046, -0.0846198276, 0.2513118386, -0.0905507728, -0.1039314047, 0.2546404898, -0.2272122353, 0.1112730801, -0.1098300368, -0.1313949376, 0.179195717, -0.327639848, 0.095653303, 0.1494390219, -0.2250340879, 0.1931089759, 0.2141466588, -0.346721679, -0.075597845, 0.3512638807, 0.2432073802, 0.3952656984, 0.2722060978, -0.2244193703, -0.0795435011, 0.7486108541, 0.1755334139, 0.1091258675, -0.0206406154, 0.0418240875, -0.2721835971, 0.2493069023, 0.3991540372, 0.6660166979, 0.0948136598, 0.0460689068, -0.008515412, -0.106319122, -0.1277069896, 0.365398258, 0.1909223199, 0.1163281277, 0.0705740526, 0.3453727067, -0.1046398282, -0.5839586854, -0.2935900986, 0.2861482501, 0.1273400784, -0.1608410925, -0.1700654924, -0.355951041, -0.0956453234, -0.1971932501, -0.196146667, -0.191437453, -0.1775630563, -0.0734648779, 0.4637478292, -0.1138136089, 0.3132781684, -0.304490149, 0.5873442292, -0.1263482273, -0.3305930793, -0.2006736696, -0.1024092734, 0.0209170897, -0.0236812551, 0.0142459897, 0.0744801015, 0.2375771999, 0.2396817654, -0.1397292167, 0.0067295246, -0.4025408328, 0.1071231738, -0.2851746678, 0.0803084746, -0.0229943749, -0.0686066151, 0.0633819103, -0.3273160458, -0.0840855315, -0.348541826, -0.1023633108, 0.1290640682, 0.2106662095, -0.1978336573, -0.3947790861, -0.3335368633, -0.1437161565, -0.4087191522, 0.4085218012, -0.1294221133, 0.106349729, 0.4895440936, -0.0700022057, 0.2074606717, -0.5142787695, 0.0601188615, -0.3819691539, -0.3399349153, 0.2264352739, -0.1062783301, -0.0376656838, -0.0557110757, -0.1253293753, 0.3742885292, 0.3618136346, -0.1126945913, 0.0698798969, -0.3953329623, -0.1428848654, -0.0798912719, 0.0358972177, 0.5086122751, 0.011170892, 0.0101620751, -0.1552388072, -0.3371171057, 0.273579061, 0.5556551814, 0.1936829537, 0.1405682266, -0.1279439181, 0.3053505421, 0.6116022468, 0.0180628989, 0.2218024582, 0.2513355911, 0.1985744387, 0.3103547096, -0.1589481682, -0.0326580741, 0.5106629729, 0.2174624801, -0.3428010941, 0.1145194471, -0.2571845055, -0.1489798725, -0.0304281935, 0.1263508797, 0.0973010957, -0.2774020433, 0.1408426613, -0.0972371623, 0.0415065438, 0.1747032404, 0.1695739776, -0.0600337237, -0.1153499186, -0.1410130113, -0.0297325626, 0.3056159019, -0.0441635065, -0.6732628942, -0.3755863309, -0.4721685052, 0.3012933731, 0.0652727559, 0.8658412695, -0.0815703273, -0.1442960352, 0.227611497, 0.0985192284, 0.6172945499, -0.0488357879, 0.0754872188, 0.2543053925, 0.1052028537, -0.2266449332, 0.0009143364, -0.290542841, 0.0431486145, -0.3057162464, -0.1708197594, -0.3268432021, -0.1532397717, -0.0169357862, -0.0528797209, 0.1032334864, 0.110065423, -0.2144610435, 0.0156568903, -0.2628637552, 0.1524924785, 0.2070519328, -0.0559041314, -0.5712479353, 0.103574641, 0.0509468541, -0.0004638771, 0.0421869084, 0.0900686234, 0.4630869031, 0.091573514, 0.0178622026, 0.2473660409, -0.4582464695, 0.2574880719, 0.138106823, -0.0138700865, 0.2481121272, -0.0344713964, 0.0659721494, 0.4264146984, 0.5325859785, -0.0090932082, 0.1813392937, -0.0978789777, -0.082409665, -0.1879820228, -0.0353318714, 0.3640074432, -0.1816083789, 0.0448920317, -0.6824073792, 0.3029801548, 0.5967736244, -0.1900644004, 0.753608048, 0.2377083153, -0.2059600502, 0.1781205833, -0.0468188636, 1.3120799065, 0.2189845443, 0.1824338138, 0.2494000643, 0.1198641807, 0.3375505209, -0.152034685, 0.3163946569, -0.0312288105, -0.3117735386, 0.0648638979, -0.356933713, 0.2322402894, -0.2951765954, -0.2881938517, 0.333024472, 0.1268986911, -0.1023209468, 0.083505854, -0.019515153, -0.4196307659, -0.0224892423, -0.0607592091, -0.0592129007, -0.2439981103, 0.0793124512, -0.0112401601, -0.0675596073, -0.0331190974, -0.2414552569, -0.0576563478, 0.1237726212, -0.1919858307, 0.0547808893, -0.1553826332, 0.1071049422, 0.1933683753, -0.0190595426, 0.0026659586, 0.2434744835, -0.0744906142, 0.3823255599, 0.4298537672, 0.260459125, 0.1087381393, 0.0632608533, 0.2432440221, 0.1503247619, -0.3025842905, 0.1687010378, -0.1743141264, -0.4241253436, -0.3541194201, 0.0664162338, 0.3193893731, 0.2247797847, -0.2856482863, 0.3518817425, -0.4087073803, -0.1726909131, 0.0172251705, 0.0574398488, 0.0024691473, 0.4494125843, -0.1175220311, -0.3633414209, 0.0476158299, 0.5570682883, 0.0076235649, 0.3624721169, 0.4736930132, -0.331175983, -0.0371006243, -0.0683415234, -0.4076803327, -0.2367176414, -0.2916006744, 0.0075125857, -0.1156883314, -0.2336657196, -0.0219093561, 0.3400224447, -0.0292223524, 0.2901127934, -0.0539477915, -0.2933699787, -0.1853292882, 0.5183560848, -0.226845935, 0.3059212565, -0.0526919663, 0.3073263764, -0.082091406, 0.1352660954, -0.1991173476, 0.0094817895, -0.0242255665, 0.2965017259, 0.061671067, -0.0675208345, -0.0440091416, -0.2257983983, -0.0656409487, 0.4734468162, -0.3245002031, -0.041541975, 0.0081999777, 0.2415739894, 0.2567051053, 0.051808171, -0.0856157839, -0.6488204002, 0.0862815231, -0.1840723157, 0.139501065, 0.1251876801, 0.0484999381, 0.3103799224, 0.3236566186, 0.1338426024, 0.3690100312, 0.3317423761, -0.1376084089, -0.547177732, -0.0068298993, 0.0681184009, -0.3414594531, -0.1721710265, -0.2888049483, -0.07653597, -0.2675986588, 0.3461116552, -0.0858971477, 0.1340375543, -0.3176962137, -0.3257195055, 0.1708035767, 0.6224972606, -0.1092255414, -0.4840926528, 0.3311728537, 0.0048596077, -0.0928250924, -0.043499805, -0.175901264, 0.3503391743, 0.1592324525, 0.110009037, -0.0759281665, -0.3464378119, -0.1687954068, 0.1526180208, 0.2878941894, -0.5417858362, 0.2586517334, 0.123713389, -0.1214042529, -0.1668013483, 0.251412183, 0.1404765397, 0.3174530566, 0.2154065669, 0.0999709889, 0.3795161843, 0.5215624571, -0.00198007, 0.1691205502, -0.1758659333, -0.0089275194, 0.6253477931, -0.0551836267, 0.2040561438, 0.2317166924, 0.3403339088, 0.1078283563, -0.0912873074, -0.1490225494, -0.143420741, -0.0192736927, 0.0140523696, -0.0285810735, -0.2736733556, 0.0153438458, -0.1142724007, -0.0629805401, 0.0013234882, 0.6738677621, 0.0799122676, -0.0938672349, -0.4253216088, 0.1122412235, 0.1956028044, 0.1990809739, -0.3041786849, 0.2550563514, 0.1390108615, -0.1476668119, 0.2324564159, 0.2578602731, 0.2080411613, 0.3255347311, -0.0578253753, 0.0516763665, 0.0448111929, -0.0683913678, -0.0784832314, 0.2672587931, 0.3868576288, -0.2032080889, 0.1780523211, 0.0537288673, -0.043927215, -0.0059591676, 0.2202220261, 0.292468369, -0.370978266, 0.3863033652, 0.3180398941, 0.1202208474, 0.2458049059, -0.0817094669, -0.4959748983, -0.1071972549, -0.2609365582, -0.2421965003, 0.0345701687, -0.0283224955, -0.0033037534, -0.1313527077, 0.237621218, 0.1642876714, -0.2725540102, -0.208989501, -0.2560696602, -0.7737236619, 0.0829083174, 0.188056767, 0.0842096061, -0.0520198606, 0.2948657572, -0.0397690833, -0.1835630238, -0.0507862158, -0.0545092598, -0.0149621321, 0.074004136, -0.401829809, 0.0929488912, -0.0839925557, -0.075155586, 0.0935692713, -0.3197192252, 0.1027960926, -0.1501592398, -0.1391861439, 0.0401842557, -0.0025000232, 0.1477477252, 0.471380353, 0.4296170473, 0.0616025999, 0.3756869733, -0.0348589718, 0.0771451667, -0.3971295357, -0.0284059662, 0.0693796501, -0.3193963766, -0.0903023407, 0.4964283109, -0.2031981051, -0.0359868892, -0.1933770776, 0.4085066319, -0.297817111, 0.1286790669, -0.2891925573, 0.1979863197, -0.1864557117, 0.4920984209, -0.2932483852, -0.003586781, 0.0226557255, 0.2047997415, -0.3808236122, -0.2601335645, 0.8820678592, -0.3497812152, -0.2414846122, -0.1135064363, 0.5502933264, 0.0787508562, -0.4763633609, -0.1970199347, -0.0315152258, 0.1201936454, -0.0565548241, -0.3065266013, 0.2336233258, -0.3561184704, 0.0286805108, -0.0238202717, 0.4381563067, -0.1030243859, -0.2813261747, 0.1388043463, -0.2105049789 ]
https://github.com/huggingface/datasets/issues/514
dataset.shuffle(keep_in_memory=True) is never allowed
Oh yes ok got it thanks. Should be fixed if we are happy with #513 indeed.
As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`.
16
dataset.shuffle(keep_in_memory=True) is never allowed As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`. Oh yes ok got it thanks. Should be fixed if we are happy with #513 indeed.
[ -0.107872434, 0.031477768, -0.0592157245, 0.1798338443, 0.2271605879, -0.0569599718, -0.0781592056, 0.3618612885, -0.0172983203, 0.3102034926, 0.061766956, 0.5769483447, -0.2770044804, -0.4012128711, -0.0302099958, 0.0821130499, 0.0426669158, 0.0644071549, -0.0605757236, -0.1543070972, -0.4035512805, -0.1343419552, -0.4251639247, -0.1685623229, -0.2936733067, -0.1476832032, -0.0694249719, 0.1123732328, -0.2651755512, -0.4221329093, -0.0507325642, 0.275295347, -0.4287704229, 0.4618904591, -0.0001105258, -0.2425430566, 0.2252237201, -0.0732621104, -0.216571793, -0.0847063959, -0.3749555647, 0.1029446349, -0.0625900552, -0.1702318639, 0.1931011081, -0.1649803966, 0.0508300252, -0.4214198291, 0.2389519662, 0.212986201, 0.2309738845, 0.0795899853, -0.0047131875, -0.0425945297, 0.5332523584, 0.0685252398, -0.1711268872, 0.1763262153, 0.1607524455, -0.2377844006, 0.0212519895, 0.2817616463, -0.158800602, 0.2197415531, 0.2054116726, -0.0789852217, -0.13509579, -0.1896863431, 0.3096532524, 0.179354161, 0.2681084275, -0.3994343579, -0.2405279875, -0.1129990071, 0.0084615164, -0.3494418263, 0.3002125323, 0.228176862, -0.0264048092, -0.1879422069, -0.1457694769, -0.1070001945, 0.1632735878, -0.093822293, 0.2004602402, 0.2594090998, 0.0756178349, 0.0720267519, 0.49292925, -0.087678194, 0.2041459084, -0.049483709, -0.2196620256, 0.3118330538, -0.4002450705, -0.0920266807, 0.161493212, 0.0744831711, 0.2304910868, 0.0756536052, 0.2575990558, 0.0067210966, 0.013254106, 0.2516727746, 0.2001264542, 0.3784680068, -0.0654057339, 0.2134315372, 0.1905720234, -0.0800727159, -0.1731539518, 0.0880873427, 0.0415700525, -0.3028282821, 0.074925825, -0.0800299793, 0.1167869866, -0.2463715672, -0.1012337431, 0.1318373531, -0.135784924, -0.2121962011, 0.0453830324, 0.5516229868, 0.1866029948, -0.0767673999, 0.0147759682, 0.0687276945, -0.0587005205, 0.0963962749, -0.3627191484, 0.115364641, -0.3626094759, 0.0938811377, 0.2376079112, 0.1213923618, 0.3731116652, -0.1051932424, -0.0658722147, 0.1102134511, 0.2735161781, -0.2634015381, 0.3925340772, 0.2290442586, -0.2552444637, 0.0241907984, 0.0206687469, 0.1493786871, -0.2203024328, 0.4370919764, -0.1299476624, -0.2776747644, 0.2739731371, 0.1745287925, -0.0480161011, -0.0379783772, -0.0036671688, -0.0730227008, 0.4460798204, -0.3608435392, 0.3171113431, -0.2089281827, -0.0279091112, -0.3870055079, 0.0059968606, 0.1643786132, -0.222955063, 0.0757544935, -0.2734277844, -0.0148446579, 0.1948699653, 0.4441375434, -0.0910408944, -0.358469069, -0.2399043888, 0.1730917245, 0.2468243241, -0.1380797774, -0.5333730578, -0.2369208634, -0.1584786326, 0.0361690298, 0.0879134089, 0.0584417731, -0.0627001822, -0.1163542271, 0.4518161714, 0.021028433, 0.0183448866, 0.1343854219, -0.3099239171, -0.1400607675, 0.3697390258, -0.152081117, -0.2401823997, -0.1730972528, 0.1195151731, -0.1781291813, 0.380741626, 0.0413309745, -0.0308137313, -0.0349829271, 0.484126091, -0.2198281735, -0.0847404525, -0.0747507587, -0.1592671275, 0.1509008557, 0.0692171007, -0.1282045543, -0.1019472852, -0.216198653, -0.050065618, -0.0720345676, -0.1936578304, -0.3217901587, 0.1400493979, 0.0551045649, 0.0714578852, 0.0553193204, -0.1687678844, 0.0928116292, -0.4236604869, -0.1620370299, -0.088797912, 0.1601251066, -0.1244970858, -0.200905472, 0.0920646861, 0.200238958, -0.051434461, 0.0513803214, -0.304592371, 0.4380544722, 0.2062821984, 0.0823623314, 0.0751083568, 0.0988029763, -0.1049176306, -0.1015244871, 0.264321208, -0.1814332902, 0.1131374836, -0.1391749978, -0.0818580911, 0.2396373898, -0.2278601974, 0.0760874748, 0.1914031208, -0.2140290141, 0.2335224897, 0.1947779655, -0.0763358101, -0.189279303, 0.3093518317, 0.2143835276, 0.374864012, 0.2533473372, -0.239537254, -0.073086001, 0.752476275, 0.220695585, 0.1499159336, 0.0220458638, 0.0211722199, -0.3006107807, 0.1650641412, 0.413122654, 0.4986059368, 0.1892418116, 0.1480912864, -0.0028857265, 0.0206918959, -0.0762025341, 0.3187274635, 0.0252009183, 0.1475013494, 0.0877846032, 0.276910156, -0.2225175649, -0.5638149977, -0.1646710187, 0.3080354631, 0.2424911857, -0.0820211098, -0.2388598174, -0.359918803, -0.1361259222, -0.1408327073, -0.106000565, -0.2128337324, -0.129973501, 0.0927541703, 0.372508496, -0.2125668377, 0.3739691079, -0.2482067347, 0.4168656766, -0.0222024359, -0.1171977594, -0.2320806086, -0.2177789211, 0.1436153948, 0.1165101677, 0.1697314382, 0.0945717245, 0.3899739087, 0.2874007821, -0.1426671147, -0.0584667102, -0.215810135, 0.0347243585, -0.1650776863, -0.0293393955, 0.0274550803, 0.0614135377, -0.1137502193, -0.3544993401, 0.0075108875, -0.3451035023, -0.2569628656, 0.1152631864, 0.2479770482, -0.1941599399, -0.3728397489, -0.410746485, -0.2554982305, -0.4678594768, 0.4274531305, -0.0421123989, 0.1697330326, 0.4122063518, 0.026855953, 0.0871613175, -0.3679886162, 0.0467262417, -0.4801110029, -0.3200537562, 0.1664247066, -0.2421018332, -0.127479881, -0.0509106293, -0.0797986165, 0.2987232804, 0.2556760907, -0.1701512486, -0.01439982, -0.4049579799, -0.0595427677, 0.0206533279, 0.1705159992, 0.5260151625, 0.1508599371, -0.1882627159, -0.1759502739, -0.167291373, 0.2345250398, 0.399156183, 0.1976083219, 0.030670343, -0.0013972397, 0.2786435485, 0.6611918211, 0.0348752961, 0.265037775, 0.2444595695, 0.1208594069, 0.3795445263, -0.3707636595, -0.0451819524, 0.3426940441, 0.1007095426, -0.3421358168, 0.0898478106, -0.192003876, -0.3663148284, -0.0647843555, 0.2407469749, 0.0730639845, -0.1817741394, 0.0891744718, -0.0761929825, -0.0610051304, 0.2142042667, 0.0979064927, -0.2363513559, -0.1197241023, -0.0830199197, -0.1502344012, 0.2026253343, -0.1722980142, -0.5896503329, -0.2854013741, -0.4158498943, 0.2997021377, 0.0219849963, 0.6304899454, -0.0462443903, -0.2750853896, 0.1421260983, -0.013684392, 0.4843631685, -0.122375533, 0.0978709459, 0.2757169306, 0.2364536673, -0.1469788253, 0.0225874595, -0.3153304458, 0.1052419394, -0.2829585969, -0.2083062232, -0.2535834014, -0.0792954415, -0.0413051918, -0.016631877, 0.0280890446, 0.0557621457, -0.3222197592, 0.1323813349, -0.3599128127, 0.1306758225, 0.2097447962, -0.1717755049, -0.4578044415, 0.0188159645, 0.0959856212, 0.0022871296, -0.050848309, 0.1427772939, 0.5783634186, 0.0532348566, 0.0800338313, 0.2153641135, -0.2208367735, 0.2404066771, 0.3562559187, -0.1803621203, 0.2077953517, -0.0196918789, -0.1094744727, 0.3237192631, 0.4031086564, -0.008754665, 0.2421168983, 0.041307088, -0.0269216597, -0.1610464901, -0.0898620561, 0.369546175, -0.1644630879, 0.0096179908, -0.699932456, 0.2722674012, 0.3819768131, -0.1795825809, 0.7695525289, 0.0342339389, -0.0926488414, 0.3315491974, -0.0772519782, 1.1195509434, 0.0339704454, 0.1771060526, 0.1755616665, -0.0159262531, 0.114878796, -0.0396804512, 0.2906039357, -0.2378375828, -0.521114409, 0.160473004, -0.2698271275, 0.176230371, -0.07106594, -0.2536159158, 0.2452202141, 0.0929340869, -0.0444946773, -0.1727014482, 0.0078680627, -0.3439276218, -0.0405511968, -0.0429270044, 0.132255137, -0.0335358903, 0.0299755484, -0.0586015806, 0.0137801981, -0.0630805418, -0.2973029017, -0.0944354534, 0.135288462, -0.2044689208, 0.2324855775, -0.2904860377, 0.0062021879, 0.010941498, -0.0547463037, -0.1283717752, 0.254083693, -0.048144348, 0.4096055031, 0.5715175271, 0.231473878, 0.0768470541, 0.2145593315, 0.2458199114, 0.025563363, -0.2269498408, 0.0539181121, -0.1483023912, -0.4766715467, -0.1591787636, 0.0363246575, 0.2632271349, 0.1623259038, -0.3679367602, 0.2486217916, -0.3597950041, -0.2111902386, 0.1669827104, 0.1270516068, -0.1322496384, 0.4700601399, 0.0142769301, -0.2295577824, -0.0009838393, 0.5051693916, 0.0864669532, 0.2383113205, 0.5237417817, -0.0726725012, -0.170012176, -0.2872990072, -0.2536236942, -0.036013037, -0.2044706345, 0.1837616861, -0.0554692671, -0.283988893, 0.0688749775, 0.2643092573, 0.1066327021, 0.4070762098, -0.0948495194, -0.2292088419, -0.4201830924, 0.4437670708, -0.0992574766, 0.4140262902, -0.2612750232, 0.0826347768, -0.1215062514, 0.1916922331, -0.3876180053, 0.093835555, -0.083689861, 0.2934553623, 0.015756119, -0.1119344309, 0.0230326541, -0.1707739979, 0.1524878144, 0.3507137597, -0.3724937439, -0.243020907, 0.1457936466, 0.1175747588, 0.0835482106, 0.0592064038, -0.0896506384, -0.5925155878, -0.1081835553, -0.1836384386, 0.0946237445, 0.1458486766, -0.0578485206, 0.3071141541, 0.3662768006, -0.0061753439, 0.3721615672, 0.2892753184, -0.1997233033, -0.3840438128, -0.046663966, -0.0214118715, -0.1907103062, -0.1097670346, -0.0990032405, -0.0674086437, -0.2541640401, 0.2214463204, 0.0556140356, -0.0175465904, -0.219925195, -0.0980803147, 0.4295178354, 0.6297248602, -0.0764324516, -0.3640530407, 0.4069701731, 0.2642081976, -0.3455338776, -0.1629192084, 0.0464288816, 0.2752841413, 0.1474656761, 0.0083064204, -0.0759515092, -0.1910995692, -0.1815367043, 0.2896528244, 0.2205361128, -0.6552200913, 0.2770578861, 0.1268351227, 0.0210316628, -0.1786504388, 0.2017374337, 0.2562086582, 0.3099996448, 0.3726302981, -0.0460219234, 0.3559652269, 0.4608310461, 0.0659660548, 0.1170853972, -0.2425630391, 0.1153913811, 0.5658170581, -0.0811999962, 0.2766990066, 0.2415813208, 0.3678362966, 0.061221227, -0.1463449597, -0.1686164737, -0.0449323058, -0.1831550598, 0.0117366035, 0.171004653, -0.2913223505, -0.0583174042, -0.0793403238, -0.0683770403, 0.1755076945, 0.6497917771, 0.1210017726, 0.0610484742, -0.3677775264, 0.2369811088, 0.1279890537, 0.2782154083, -0.3036891222, 0.1446886063, 0.1185058504, -0.0752009377, 0.323433429, 0.2481109798, 0.1816095561, 0.3829049766, -0.200811401, 0.0689978227, -0.0505169332, -0.1265685111, -0.1566109508, 0.3311421871, 0.3847039044, -0.1390634179, 0.198566854, 0.1633260399, -0.1767993271, 0.0143266777, 0.2011548579, 0.1655362695, -0.1903314441, 0.2306906432, 0.1728615612, -0.1504599452, 0.0427809767, -0.1037801951, -0.4727162421, -0.0383890197, -0.1418857872, -0.2031339109, 0.0378005095, -0.0849465653, 0.0919963941, -0.0921621621, 0.3033489585, 0.1568578929, -0.1262313575, -0.1780656427, -0.2676554918, -0.9151126742, 0.224561736, 0.0515015647, 0.0624055453, -0.1349490881, 0.3846206963, 0.0082028834, -0.2036103308, 0.1121901497, -0.0982708037, -0.0396635272, 0.223272562, -0.4372611642, 0.0702404603, -0.0814529508, -0.0988086686, 0.1465445906, -0.2478384376, 0.0311281029, -0.1147614568, 0.0479397848, 0.0072396318, -0.0380122326, 0.0359302536, 0.369740963, 0.4667227268, 0.0161224082, 0.2574403286, -0.0802937374, 0.0422935858, -0.2977571487, -0.2828943431, 0.0245157555, -0.2185551077, 0.0709482431, 0.47692433, -0.1603507251, -0.1255035698, -0.2700120807, 0.29123348, -0.2710496783, 0.118395634, -0.3323077857, 0.2123017162, 0.0901178941, 0.3516819179, -0.2855340242, -0.0280277561, -0.0366685018, 0.1451436728, -0.293161124, -0.3934073746, 0.7955744267, -0.2120287865, -0.2552546859, -0.1243003979, 0.5379703045, 0.0219983961, -0.4403074682, -0.3389932513, -0.0300065447, 0.1150769293, 0.0005137799, -0.2319954932, 0.1029691845, -0.389449805, 0.051876016, -0.0874024332, 0.5879088044, -0.1065411493, -0.2709550858, 0.1191220507, -0.2413648069 ]
https://github.com/huggingface/datasets/issues/514
dataset.shuffle(keep_in_memory=True) is never allowed
My bad. This is actually not fixed in #513. Sorry about that... The new `indices_cache_file_name` is set to a non-None value in the new `shuffle()` as well. The buffer and caching mechanisms used in the `select()` function are too intricate for me to understand why the check is there at all. I've removed it in my local build and it seems to be working fine for my project, without really considering other implications of the change.
As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`.
76
dataset.shuffle(keep_in_memory=True) is never allowed As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`. My bad. This is actually not fixed in #513. Sorry about that... The new `indices_cache_file_name` is set to a non-None value in the new `shuffle()` as well. The buffer and caching mechanisms used in the `select()` function are too intricate for me to understand why the check is there at all. I've removed it in my local build and it seems to be working fine for my project, without really considering other implications of the change.
[ -0.1627904326, 0.1008971557, -0.0472363047, 0.1413050294, 0.1969877034, -0.0894876048, -0.072468631, 0.3746207356, 0.0284972545, 0.3297641873, 0.0540857501, 0.5689101219, -0.2949668765, -0.4070607424, -0.0630830452, 0.1825317293, 0.0914551169, 0.0464379415, -0.064042151, -0.1149821281, -0.4023234248, -0.1355524808, -0.3807734847, -0.2072241604, -0.2809178531, -0.1180850342, -0.0617818609, 0.0914646536, -0.2582838237, -0.4361537993, -0.0063435403, 0.3478770852, -0.4093190432, 0.4160301387, -0.0001099763, -0.1791146845, 0.207314387, -0.0738752112, -0.2709135413, -0.09894941, -0.3752162755, 0.1104815081, -0.0958125889, -0.0919571742, 0.1756298393, -0.1854458004, 0.0588806309, -0.5130764246, 0.1786989123, 0.2128082514, 0.2111127079, 0.0499817953, -0.0335805267, -0.0293105561, 0.5861100554, 0.0566135086, -0.189040795, 0.1663570106, 0.1492812186, -0.1905909181, -0.0007992128, 0.2823549211, -0.2549175024, 0.2575416863, 0.261125654, -0.090502277, -0.1236080825, -0.1846338063, 0.3069355488, 0.2646514773, 0.2544337511, -0.3675502837, -0.2848786116, -0.1775662601, -0.0083231647, -0.3538302481, 0.3373941779, 0.1521796435, 0.003576844, -0.176980719, -0.1892119199, -0.0270586591, 0.231964156, -0.0966162011, 0.2491222471, 0.2606118619, 0.0594694354, 0.0409912094, 0.5399265885, -0.0905900374, 0.2658840418, -0.1224405468, -0.2388854772, 0.2838871181, -0.3870705962, -0.1137688085, 0.1962218285, 0.0459891185, 0.2212803513, 0.0704400167, 0.2729626298, 0.0708097368, 0.0240047425, 0.2028406709, 0.1022176817, 0.4053636193, -0.0894305184, 0.1724647582, 0.1995567232, -0.0315995589, -0.1409445256, 0.0801542699, 0.0051486101, -0.2488577366, 0.0470428988, -0.0482763797, 0.0999422371, -0.2141383141, -0.1254857033, 0.1203751564, -0.1201377362, -0.2233010828, 0.0901404545, 0.5079165697, 0.1808762252, -0.0202659816, -0.0539893508, 0.0603303686, -0.0707250014, 0.1533779651, -0.3479060829, 0.0679388791, -0.3014750779, 0.1446824521, 0.2900345027, 0.0929106176, 0.3374700546, -0.0530473776, -0.0744540766, 0.1677110791, 0.2409873307, -0.2988537252, 0.4511576593, 0.2090825289, -0.3277806938, 0.0116755841, 0.0305167586, 0.0661877096, -0.2713432014, 0.4143101871, -0.1308397651, -0.2582528591, 0.2951093316, 0.1685983688, -0.0781641155, -0.0627120957, -0.0282897707, 0.0004498789, 0.4258087277, -0.3920402229, 0.3442206681, -0.2152248174, -0.073405616, -0.3512367308, 0.0223537944, 0.1592850685, -0.2199884653, 0.0661385506, -0.264898628, 0.0545590781, 0.1390302032, 0.4122771025, -0.0707725361, -0.3986480534, -0.1971274614, 0.0905977711, 0.2141711116, -0.1521363258, -0.5648217797, -0.2408743501, -0.1316462308, 0.0403595939, 0.1658998132, 0.0475498587, -0.0199211016, -0.1683566421, 0.4874162972, 0.0159760416, 0.0379030034, 0.1605654359, -0.2867966592, -0.2108652145, 0.2988805175, -0.1238560155, -0.252210319, -0.190881595, 0.1199977174, -0.173668921, 0.3175566792, 0.046270363, -0.0111075267, -0.0337358005, 0.4648877382, -0.2766037583, -0.0674638003, -0.1012835801, -0.1785646379, 0.1913275421, 0.0686777458, -0.209609881, -0.1075911596, -0.1848170161, 0.0236454085, -0.1183175072, -0.2057341039, -0.3201957047, 0.1141913012, 0.1147766411, 0.1583023071, 0.0917554945, -0.153944537, 0.0645100847, -0.379557699, -0.1858311146, -0.0621415004, 0.1152371988, -0.0434532613, -0.2422353923, 0.0461179577, 0.2248342484, -0.0923195779, 0.0642545745, -0.3035537302, 0.4044663608, 0.2118752748, 0.065441899, 0.0497320816, 0.2067210823, -0.0972361341, -0.0455044024, 0.3066759109, -0.2456497699, 0.1084037274, -0.0401803665, -0.0883613154, 0.2758997083, -0.2985675335, 0.1285168529, 0.193715781, -0.3063238859, 0.2506430447, 0.1813519448, -0.0775221661, -0.2378537357, 0.276493758, 0.2271322906, 0.4078921974, 0.2792387903, -0.1685369313, -0.0030661093, 0.8022277951, 0.2215920687, 0.1226187274, 0.0282465331, -0.0099237589, -0.3311356008, 0.1510763913, 0.4368931055, 0.5458803773, 0.2066424936, 0.1391756833, -0.0523492694, 0.0427907556, -0.1248242185, 0.3032717407, -0.0051010172, 0.099885188, 0.1477359831, 0.2927752137, -0.1784617603, -0.5660674572, -0.1174684167, 0.3162509203, 0.1801417321, -0.046813976, -0.1696548909, -0.3915606439, -0.1134421006, -0.1453727335, -0.1362471282, -0.2019048631, -0.1397086233, 0.1181990504, 0.4280187786, -0.2240032405, 0.403080076, -0.2191068977, 0.3761202395, -0.0820554197, -0.2009867132, -0.2323861122, -0.2473510504, 0.11350438, 0.1071828678, 0.1801323593, 0.0349475183, 0.3226131797, 0.2647102177, -0.1561776847, -0.1072740108, -0.2211649269, 0.0503200106, -0.1555041373, -0.0216470361, -0.0479001924, 0.0101213045, -0.0882756412, -0.3869803548, 0.0086912951, -0.3831770122, -0.2412016839, 0.1789946407, 0.1787714213, -0.1435182244, -0.401812762, -0.3335205615, -0.2333355993, -0.452996701, 0.374129504, -0.0639916509, 0.0997937992, 0.4208824039, 0.050192982, 0.1192929298, -0.3703493774, 0.0566272959, -0.5147153735, -0.3384055793, 0.1441303194, -0.1881357133, -0.0859256312, -0.1079166979, -0.1023707166, 0.2616955638, 0.3022655845, -0.1528602242, 0.0201324541, -0.4135580063, -0.0220305324, 0.0647841021, 0.0957223251, 0.5864396691, 0.1653223187, -0.2120556086, -0.192295447, -0.1380126625, 0.1789359748, 0.3718594611, 0.1798123121, 0.0572609492, 0.018241303, 0.2684487402, 0.7134549022, -0.0110723833, 0.2548041642, 0.2837662101, 0.1679669172, 0.4330674708, -0.4372285903, -0.0121133318, 0.3658878505, 0.0932755247, -0.3274996579, 0.10780292, -0.200923115, -0.4239676297, -0.0702932999, 0.253644526, 0.0882733986, -0.1928748339, 0.1146660075, -0.1082743481, -0.0777745545, 0.2088021934, 0.1254797131, -0.2121363878, -0.1972232312, -0.0898096859, -0.1305540353, 0.2053194344, -0.1757031977, -0.5716444254, -0.3005230427, -0.4015975595, 0.3316800594, 0.0836054981, 0.6012488604, -0.0574418753, -0.3226550519, 0.0937579125, 0.0277694277, 0.4177293181, -0.1002549753, 0.0553208739, 0.286608398, 0.2566705644, -0.1767858118, -0.0243484061, -0.2983765602, 0.0748020783, -0.3461557925, -0.1568788886, -0.2713360488, -0.1051127166, -0.0974848941, 0.0260275938, 0.0498910099, 0.1094597429, -0.406712383, 0.164953649, -0.3717480302, 0.1544073373, 0.1667534709, -0.1572789401, -0.4636015892, -0.0095959371, 0.116911523, -0.0204660948, -0.0727095902, 0.1309041381, 0.5553307533, 0.1349184364, 0.0567919202, 0.2547771931, -0.2617734969, 0.2977278829, 0.2745449841, -0.2015115917, 0.2483655661, 0.0267157219, -0.0410490222, 0.2491197735, 0.4222627282, -0.0195997972, 0.2453922927, 0.1159085408, -0.0461065248, -0.2090004534, -0.0855993703, 0.3329143226, -0.1725006998, 0.0061699548, -0.726631999, 0.2700079083, 0.4216603339, -0.2021496445, 0.8089624643, -0.0263062213, -0.0745423287, 0.3130100667, -0.0293329302, 1.0826157331, 0.0523931347, 0.1845883429, 0.1523941457, -0.0149460239, 0.1152191013, -0.0274767186, 0.3338969648, -0.1610727161, -0.5241384506, 0.1641456187, -0.2412726432, 0.1434493214, -0.0853698552, -0.2555904686, 0.243574664, 0.1431553066, -0.0014058636, -0.1848621517, -0.0017582149, -0.4116511047, -0.0602564625, -0.0149679529, 0.1189693213, -0.0288366303, 0.0215759296, 0.0040091826, 0.0507695004, -0.0561806485, -0.214941293, -0.0922037736, 0.087736927, -0.2132851928, 0.2512761056, -0.2927489877, 0.0120274937, -0.0775294602, -0.0794103965, -0.1324294209, 0.2365806103, -0.0912312418, 0.4156895876, 0.567307353, 0.2921690047, 0.0902458057, 0.1129869819, 0.2711989284, 0.0623781905, -0.2033887655, 0.0321934149, -0.1376543045, -0.4710271955, -0.1352296025, -0.0016212411, 0.2588438094, 0.165299356, -0.281490773, 0.2102951705, -0.3044536114, -0.2140782923, 0.1672842056, 0.0760879591, -0.0154469423, 0.4147463739, -0.0723186955, -0.2643077075, -0.0479851738, 0.545050323, 0.0525800623, 0.297549963, 0.4717651606, -0.17051965, -0.1695045084, -0.2284465432, -0.2198899984, -0.0372737497, -0.1842300147, 0.1633376479, -0.0290570054, -0.3322979212, 0.1018247008, 0.2536394, 0.0716210157, 0.4311784506, -0.1206998006, -0.1742144376, -0.388882488, 0.4864372611, -0.106934242, 0.3767166138, -0.2589106262, 0.0121103013, -0.1251519769, 0.119854629, -0.3764691055, 0.0512260534, -0.0563944876, 0.2495509684, -0.0418031886, -0.1335868388, 0.0659221932, -0.2019757479, 0.1232353523, 0.292011559, -0.3878262937, -0.2230165601, 0.1272721291, 0.1292954534, 0.0517724678, 0.0483961739, -0.1183354184, -0.6028358936, -0.075403668, -0.2451001853, 0.1326663345, 0.1149457023, -0.0639120117, 0.2569665611, 0.3623214364, 0.0208957363, 0.3932000101, 0.2849185169, -0.2523908615, -0.3889374137, -0.0620702989, 0.001840399, -0.1961844116, -0.0952347443, -0.0886578411, -0.0619135983, -0.2578050792, 0.1668857336, 0.0387531593, 0.0319142416, -0.2349718213, -0.0317922831, 0.3383497596, 0.6381782293, 0.0150664533, -0.4197874963, 0.3746502995, 0.2426557988, -0.2449925989, -0.1985413283, 0.0005008625, 0.2810863554, 0.1674735844, -0.0375038236, -0.0309758149, -0.2451086491, -0.0940178707, 0.3114638329, 0.252722621, -0.6664283276, 0.2603014708, 0.1166737303, 0.0619480833, -0.1633706391, 0.242220059, 0.1889890134, 0.307987988, 0.3570046425, -0.0369511805, 0.3194254041, 0.4252530932, 0.1109744534, 0.0593807064, -0.2671720386, 0.1472589821, 0.5640751719, -0.1756103784, 0.2904320657, 0.2577307224, 0.3387805521, 0.0252396222, -0.0847708657, -0.1462692022, -0.0492822714, -0.1576876789, -0.0292047113, 0.1933456957, -0.2965601981, -0.0216363389, -0.0534905121, -0.0778492764, 0.2190318108, 0.6823835373, 0.0787300989, 0.0228162594, -0.3085375428, 0.2365973443, 0.1222052872, 0.3123135865, -0.2915607691, 0.1540492922, 0.1867465526, -0.092655234, 0.330453217, 0.2505861223, 0.1957374811, 0.3371887505, -0.2278549969, 0.0878955349, -0.0286825933, -0.1443090141, -0.2209821641, 0.3758555353, 0.3537638783, -0.1627028883, 0.1452499032, 0.1758387536, -0.1829486638, -0.0167656653, 0.1404101551, 0.2012847662, -0.1829664558, 0.1995006949, 0.2446164787, -0.085571155, 0.1097934768, -0.0666059926, -0.4104934931, -0.0136308251, -0.1664499789, -0.2242800742, 0.0342137739, -0.0789878666, 0.0903614014, -0.0353061669, 0.3293507397, 0.1339184046, -0.158081606, -0.1349674165, -0.2358574271, -0.8640739918, 0.1818522662, 0.0682400092, 0.1568339467, -0.0889475122, 0.395722717, 0.0190334376, -0.165441528, 0.0644153282, -0.0863240287, -0.0428876318, 0.1791068465, -0.4435936511, 0.0902754366, -0.0850218832, -0.1068329811, 0.1295186132, -0.294693321, 0.0467501469, -0.1034766287, 0.0325060934, 0.004984518, -0.0208947677, 0.0711632669, 0.421941191, 0.4397476912, 0.0415285677, 0.2196605206, -0.100573346, 0.0349755175, -0.2901999056, -0.2234971523, 0.0042940965, -0.2173176557, 0.0332009904, 0.4783432782, -0.190058738, -0.1743459851, -0.2300858647, 0.345698446, -0.2509294748, 0.1229723543, -0.35720101, 0.1816214472, 0.0742467344, 0.3774431348, -0.3227165341, 0.0056158267, 0.0328292213, 0.1458387077, -0.2736544013, -0.3756459355, 0.7129784226, -0.2250521034, -0.2088697851, -0.1358779967, 0.4948711991, 0.0398078226, -0.3910283148, -0.2560966611, 0.0281630736, 0.1448636949, 0.0447649173, -0.2136397511, 0.097276412, -0.3613097668, 0.1303618103, -0.1091752052, 0.5722793937, -0.0723561198, -0.2772232294, 0.1097423136, -0.211976707 ]
https://github.com/huggingface/datasets/issues/514
dataset.shuffle(keep_in_memory=True) is never allowed
Ok I'll investigate and add a series of tests on the `keep_in_memory=True` settings which is under-tested atm
As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`.
17
dataset.shuffle(keep_in_memory=True) is never allowed As of commit ef4aac2, the usage of the parameter `keep_in_memory=True` is never possible: `dataset.select(keep_in_memory=True)` The commit added the lines ```python # lines 994-996 in src/nlp/arrow_dataset.py assert ( not keep_in_memory or cache_file_name is None ), "Please use either `keep_in_memory` or `cache_file_name` but not both." ``` This affects both `shuffle()` as `select()` is a sub-routine, and `map()` that has the same check. I'd love to fix this myself, but unsure what the intention of the assert is given the rest of the logic in the function concerning `ccache_file_name` and `keep_in_memory`. Ok I'll investigate and add a series of tests on the `keep_in_memory=True` settings which is under-tested atm
[ -0.164539814, 0.0470641293, -0.0645132363, 0.1816316694, 0.2262284458, -0.0658220798, -0.0984031558, 0.332051456, -0.0075617963, 0.3399211168, 0.0444226153, 0.5816401243, -0.2912330627, -0.428625524, -0.0763503388, 0.1383527517, 0.043693725, 0.0938875079, -0.0431256853, -0.1475757509, -0.3487339914, -0.1134751961, -0.4357576668, -0.1966107786, -0.3342383504, -0.1588748395, -0.0248813219, 0.1103739366, -0.2372036576, -0.3972377777, -0.0687007159, 0.2789516151, -0.4423449039, 0.4937440753, -0.0001106297, -0.2429221869, 0.1797089428, -0.0578647889, -0.2435779423, -0.1217866912, -0.3575275838, 0.1902094036, -0.0383540541, -0.1658546031, 0.1627752781, -0.1657256186, 0.0624611787, -0.4391318858, 0.2739273012, 0.1919246018, 0.2325711548, 0.0483620167, -0.0108649498, -0.0708408877, 0.5057002902, 0.0983682573, -0.1865061373, 0.2023805231, 0.0994286686, -0.1826701611, -0.0003845266, 0.262264818, -0.1502904892, 0.2361278683, 0.2072391957, -0.0669973642, -0.1666727215, -0.1825501621, 0.3554883301, 0.1823659241, 0.2292559147, -0.4242459238, -0.2238122076, -0.1083012074, 0.0063933204, -0.2964935303, 0.2984440029, 0.1853242218, -0.0228905231, -0.1757452041, -0.1930442154, -0.0560921244, 0.1507159323, -0.0823622644, 0.206992507, 0.2619943321, 0.0504165217, 0.0567101985, 0.5261256695, -0.0970137119, 0.187724486, -0.0374600738, -0.236127466, 0.302949816, -0.423067838, -0.0624214821, 0.1713788211, 0.0872754604, 0.2205874473, 0.061353799, 0.3008517027, 0.0446181707, 0.0128951184, 0.2106888443, 0.1390133053, 0.3808430433, -0.072035417, 0.1835350245, 0.1963308454, -0.0748432353, -0.2012491971, 0.0494453833, 0.0088460417, -0.2748489082, 0.0845527276, -0.1342387646, 0.1005306095, -0.257694751, -0.1026126742, 0.1227496564, -0.1149027497, -0.19203417, 0.0423771441, 0.6033257246, 0.1603025347, -0.117007263, 0.0255681723, 0.0903492495, -0.0460832864, 0.1373940706, -0.3694562912, 0.0849426761, -0.3214625418, 0.138346076, 0.2982783616, 0.15028736, 0.3950696588, -0.0642241538, -0.0251955874, 0.1381613165, 0.2827375829, -0.2803498507, 0.3846615255, 0.2303173095, -0.2404921502, 0.0470301658, -0.0196591504, 0.1189515516, -0.1882031858, 0.4020311534, -0.0872792006, -0.2613457739, 0.3605816364, 0.1778234094, -0.1003842801, -0.0343160033, -0.010385409, -0.0915903747, 0.4123305678, -0.3571666479, 0.2896512151, -0.1929020882, -0.0031735459, -0.3660289049, 0.0472138673, 0.1411510557, -0.1684119254, 0.0470235832, -0.2436844558, 0.023643557, 0.1621583998, 0.4457207322, -0.0874057487, -0.3389567137, -0.2185920477, 0.1965605766, 0.2297676504, -0.1487366557, -0.5433410406, -0.2355116755, -0.1417673081, 0.0443006605, 0.1115819812, 0.0318913236, -0.0390051231, -0.1002298892, 0.4659565091, 0.0601354353, 0.0381387621, 0.1441457272, -0.3020870686, -0.131288588, 0.3288305402, -0.1144822538, -0.2394288778, -0.1633701622, 0.0918084532, -0.1207452789, 0.3615781665, 0.065369904, -0.0403919853, -0.062086843, 0.4602641761, -0.2890094221, -0.0927341357, -0.0882568732, -0.1043705046, 0.1592433155, 0.0940955132, -0.1410195976, -0.150384903, -0.2046491802, -0.0333180018, -0.1032900065, -0.2423357219, -0.3282052875, 0.1548520774, 0.1008482501, 0.1014072746, 0.0617166422, -0.1063411161, 0.0867822319, -0.4196278453, -0.1925982535, -0.0756416693, 0.1260685325, -0.0884512886, -0.2383365631, 0.0605840161, 0.2049892247, -0.0931286812, 0.0096159345, -0.3148373961, 0.4407115579, 0.1878858805, 0.0636859834, 0.0666091815, 0.0964370668, -0.1263602674, -0.1158676371, 0.2639686763, -0.2141446769, 0.1109960005, -0.1265971065, -0.1125409231, 0.2180499882, -0.2423680425, 0.096888274, 0.2393682897, -0.2473141253, 0.2639486492, 0.1885924935, -0.0416331179, -0.207791537, 0.2843485773, 0.169162333, 0.4292958081, 0.2045127451, -0.227852419, -0.0814932883, 0.7257266045, 0.2631529272, 0.1692698896, -0.0289145503, -0.0314215571, -0.2949006259, 0.1342019737, 0.3861590028, 0.5165141821, 0.2118198127, 0.1496455967, -0.0296346527, 0.0169994216, -0.0878011286, 0.2908545732, -0.0056399512, 0.1365727931, 0.1303858161, 0.2946322262, -0.2110140622, -0.5754867196, -0.1763487011, 0.3066596985, 0.2283552289, -0.0538046733, -0.2455103099, -0.3411332965, -0.0883904323, -0.0771431699, -0.1125579178, -0.1919272691, -0.1004241258, 0.1275380403, 0.3741232455, -0.1871350259, 0.3885907233, -0.217539385, 0.3834328055, -0.0255775452, -0.168504253, -0.2406042069, -0.1994391084, 0.1248653382, 0.1316697001, 0.1653925627, 0.1222232059, 0.3936083913, 0.3040717542, -0.1854710281, -0.06359303, -0.1819152683, 0.0548923202, -0.1391018778, -0.007385069, -0.0143500846, 0.0617335923, -0.1076502576, -0.3901996017, 0.0434614681, -0.3487755954, -0.2571064234, 0.1572524607, 0.222551778, -0.2505584061, -0.401353687, -0.4012820721, -0.2319546342, -0.4734948277, 0.4063262939, -0.025074061, 0.1216364056, 0.4188089669, 0.0301111713, 0.1068953499, -0.3666162789, 0.1007184684, -0.4784907997, -0.2979616821, 0.1623968631, -0.250895828, -0.1209592596, -0.044663053, -0.0964057446, 0.2673753798, 0.3345430791, -0.1974525154, 0.0018106244, -0.4214381576, -0.0430030972, 0.0390929691, 0.1247499511, 0.5532549024, 0.1390645653, -0.1910766959, -0.1802100092, -0.1579674929, 0.2839005589, 0.4101513922, 0.1807180196, -0.0001551189, -0.0088668391, 0.244709909, 0.6376881003, -0.0267477538, 0.2307048738, 0.2228115201, 0.0709283054, 0.3748376071, -0.3868436813, -0.0213326272, 0.3736646771, 0.1293521672, -0.3258841634, 0.1407593191, -0.2224762142, -0.3538875878, -0.0805681199, 0.2327488661, 0.0461793952, -0.1897003204, 0.0882819965, -0.0363680758, -0.049411349, 0.1891165078, 0.1329144388, -0.1916754097, -0.1098932028, -0.0942803025, -0.1530973613, 0.1881773919, -0.1836774796, -0.5609348416, -0.270407021, -0.4111950397, 0.3094629049, -0.0331860296, 0.6306985021, -0.0860470235, -0.2973999679, 0.122901015, -0.0088541461, 0.4743198156, -0.1237046644, 0.0845306814, 0.2729367614, 0.1821278185, -0.1336547434, 0.013096041, -0.3547094166, 0.0956470445, -0.2860814929, -0.1827210933, -0.2694421709, -0.0852588117, -0.0830342695, 0.0075154076, 0.0365674868, 0.0690898076, -0.3085597754, 0.1819416732, -0.3635667264, 0.1643830091, 0.151468575, -0.1472989023, -0.4272032678, 0.0078231534, 0.0576614887, 0.015303432, -0.0405131616, 0.2390464395, 0.6286554337, 0.0407692827, 0.1030659005, 0.2285553813, -0.1970314085, 0.271987468, 0.3310121596, -0.1418699622, 0.2264737338, 0.004424687, -0.1267074049, 0.2463162988, 0.4111559391, -0.060057532, 0.2025135309, 0.0487424247, -0.0015601505, -0.1360404044, -0.0408389159, 0.3589113951, -0.1728655696, 0.0083103087, -0.653093338, 0.222059235, 0.3576477468, -0.181507811, 0.7226058841, -0.0072311671, -0.11785575, 0.3815125525, -0.0998149291, 1.0839066505, 0.0566595495, 0.1469867378, 0.1830809265, 0.0449308082, 0.0791686773, -0.0625475869, 0.2574711144, -0.1825031191, -0.5199659467, 0.1725638211, -0.2586372495, 0.1509539634, -0.0197497215, -0.2885989249, 0.2232108414, 0.0881946459, -0.0452226363, -0.226603806, 0.0252867509, -0.3053606153, -0.0573657453, -0.0778178945, 0.1446905583, 0.0186367482, 0.0033213622, -0.0188237373, 0.0113275386, -0.0692390949, -0.278013587, -0.0984089077, 0.1322057545, -0.2228200287, 0.1897663623, -0.2956101298, 0.0582381971, 0.0306885298, -0.076763466, -0.1113332435, 0.2837207317, -0.0794102848, 0.4060232639, 0.5098743439, 0.2248023152, 0.0827044621, 0.1829492599, 0.2328512967, 0.0048797773, -0.1908228993, 0.0659305826, -0.131379649, -0.4533766806, -0.1187157854, 0.0302376207, 0.2131250799, 0.1467331052, -0.381190002, 0.2422218025, -0.3799880445, -0.2048639506, 0.1745130867, 0.1023663953, -0.1270201206, 0.4684287012, 0.0316043831, -0.2463267744, -0.0167557206, 0.4644199312, 0.0397440158, 0.2125468552, 0.4721180797, -0.1330168992, -0.1437510401, -0.3098315597, -0.3066725135, -0.0307119321, -0.2263914347, 0.1833346039, -0.0311107188, -0.3075296283, 0.0913112536, 0.2305913717, 0.1141954139, 0.4145867825, -0.1433434486, -0.2366755456, -0.3798680604, 0.434746325, -0.0309178028, 0.3997689188, -0.2919091284, 0.1168437675, -0.1029948145, 0.222092241, -0.388245523, 0.0621823743, -0.0940009281, 0.3419763148, -0.1091261059, -0.1284659356, 0.0838779882, -0.1945874542, 0.1724510938, 0.3311294019, -0.3868030608, -0.2547594011, 0.1303524673, 0.1155682653, 0.0742468759, 0.0859086961, -0.1114681363, -0.5825695992, -0.1071044207, -0.2249595076, 0.153294459, 0.1011647582, -0.0949434116, 0.2292369604, 0.4127993584, 0.0002146076, 0.3605824113, 0.2648468912, -0.2013712674, -0.3913642764, -0.0288561881, -0.0226959195, -0.214507699, -0.1246573031, -0.0870047957, -0.0855235383, -0.2674266696, 0.209145993, 0.0080304192, 0.0110767037, -0.2223531455, -0.0892883837, 0.4202601314, 0.6356107593, -0.0435016081, -0.3844487369, 0.3709196448, 0.2683918774, -0.3369070888, -0.1750695556, 0.0392259695, 0.2460406125, 0.2021854818, 0.0122520039, -0.1007215902, -0.215427056, -0.181718573, 0.2678738534, 0.2236955762, -0.625120163, 0.2195987999, 0.1022548452, 0.0065354235, -0.1585649252, 0.1950761378, 0.233810991, 0.2964687347, 0.3898301125, -0.0963084549, 0.3289059997, 0.4681849182, 0.0587375909, 0.1087260917, -0.2375673205, 0.1286788434, 0.539804399, -0.0786894262, 0.2875318825, 0.2556867301, 0.3370888233, 0.0629015043, -0.1188621894, -0.1814392805, -0.0543748811, -0.1782622933, 0.0336607434, 0.204149425, -0.2808975875, -0.0744926184, -0.0966938138, -0.0654539391, 0.187665835, 0.6637598276, 0.114974834, 0.0587374233, -0.3534993231, 0.2141944468, 0.1243330538, 0.2556315362, -0.2843034863, 0.189860478, 0.137390703, -0.0432812944, 0.3281436563, 0.2436448783, 0.177501902, 0.3849613369, -0.2102646977, 0.1273865551, -0.0378349759, -0.122470744, -0.211844638, 0.342982769, 0.4248507023, -0.1512332857, 0.1944695413, 0.1775665879, -0.1910857707, -0.020414684, 0.1460636556, 0.1708223373, -0.170923084, 0.1695913523, 0.1908315867, -0.1284257472, 0.0399027765, -0.0729861706, -0.4594968557, 0.0175566357, -0.1854103059, -0.2413071841, 0.0444921367, -0.0420020483, 0.0901078284, -0.0942578614, 0.3228234649, 0.1217256486, -0.0727367476, -0.1752488166, -0.2853655219, -0.8999337554, 0.2128527761, 0.0689446926, 0.0817751288, -0.1407220811, 0.4141229391, 0.0608883798, -0.2042652965, 0.1164668873, -0.0787593424, -0.0535234138, 0.2270150483, -0.4681151509, 0.1060834378, -0.0831531063, -0.0797102004, 0.1405970901, -0.2543371618, 0.0337204747, -0.07851246, 0.0557510406, 0.0533096977, -0.0191889722, 0.0217643157, 0.3450398445, 0.4877481461, 0.0153715052, 0.2486279607, -0.1103378162, 0.0711967722, -0.2749643624, -0.2630711496, 0.0476428829, -0.2343210876, 0.146132201, 0.4901224375, -0.1151403934, -0.1558487266, -0.2355591059, 0.2968494296, -0.2419133335, 0.1062013283, -0.3029259443, 0.2135644704, 0.0751415044, 0.3843676746, -0.3215221763, -0.0135815525, -0.070005171, 0.0796149373, -0.273380965, -0.3939669728, 0.7890164256, -0.2005456388, -0.2381668538, -0.1327883452, 0.5532746315, -0.0033606319, -0.4281304181, -0.3254094422, -0.0058575347, 0.1068149582, 0.0033220523, -0.238847658, 0.0915661529, -0.36294806, 0.0831771567, -0.0804673061, 0.6088452935, -0.0973443538, -0.268315345, 0.0887291282, -0.2417258173 ]
https://github.com/huggingface/datasets/issues/511
dataset.shuffle() and select() resets format. Intended?
Hi @vegarab yes feel free to open a discussion here. This design choice was not very much thought about. Since `dataset.select()` (like all the method without a trailing underscore) is non-destructive and returns a new dataset it has most of its properties initialized from scratch (except the table and infos). Thinking about it I don't see a strong reason against transmitting the format from the parent dataset to its newly created child. It's probably what's expected by the user in most cases. What do you think @lhoestq? By the way, I've been working today on a refactoring of all the samples re-ordering/selection methods (`select`, `sort`, `shuffle`, `shard`, `train_test_split`). The idea is to speed them up by a lot (like, really a lot) by working as much as possible with an indices mapping table instead of doing a deep copy of the full dataset as we've been doing currently. You can give it a look and try it here: https://github.com/huggingface/nlp/pull/513 Feedbacks are very much welcome
Calling `dataset.shuffle()` or `dataset.select()` on a dataset resets its format set by `dataset.set_format()`. Is this intended or an oversight? When working on quite large datasets that require a lot of preprocessing I find it convenient to save the processed dataset to file using `torch.save("dataset.pt")`. Later loading the dataset object using `torch.load("dataset.pt")`, which conserves the defined format before saving. I do shuffling and selecting (for controlling dataset size) after loading the data from .pt-file, as it's convenient whenever you train multiple models with varying sizes of the same dataset. The obvious workaround for this is to set the format again after using `dataset.select()` or `dataset.shuffle()`. _I guess this is more of a discussion on the design philosophy of the functions. Please let me know if this is not the right channel for these kinds of discussions or if they are not wanted at all!_ #### How to reproduce: ```python import nlp from transformers import T5Tokenizer tokenizer = T5Tokenizer.from_pretrained("t5-base") def create_features(batch): context_encoding = tokenizer.batch_encode_plus(batch["context"]) return {"input_ids": context_encoding["input_ids"]} dataset = nlp.load_dataset("cosmos_qa", split="train") dataset = dataset.map(create_features, batched=True) dataset.set_format(type="torch", columns=["input_ids"]) dataset[0] # {'input_ids': tensor([ 1804, 3525, 1602, ... 0, 0])} dataset = dataset.shuffle() dataset[0] # {'id': '3Q9(...)20', 'context': "Good Old War an (...) play ?', 'answer0': 'None of the above choices .', 'answer1': 'This person likes music and likes to see the show , they will see other bands play .', (...) 'input_ids': [1804, 3525, 1602, ... , 0, 0]} ```
164
dataset.shuffle() and select() resets format. Intended? Calling `dataset.shuffle()` or `dataset.select()` on a dataset resets its format set by `dataset.set_format()`. Is this intended or an oversight? When working on quite large datasets that require a lot of preprocessing I find it convenient to save the processed dataset to file using `torch.save("dataset.pt")`. Later loading the dataset object using `torch.load("dataset.pt")`, which conserves the defined format before saving. I do shuffling and selecting (for controlling dataset size) after loading the data from .pt-file, as it's convenient whenever you train multiple models with varying sizes of the same dataset. The obvious workaround for this is to set the format again after using `dataset.select()` or `dataset.shuffle()`. _I guess this is more of a discussion on the design philosophy of the functions. Please let me know if this is not the right channel for these kinds of discussions or if they are not wanted at all!_ #### How to reproduce: ```python import nlp from transformers import T5Tokenizer tokenizer = T5Tokenizer.from_pretrained("t5-base") def create_features(batch): context_encoding = tokenizer.batch_encode_plus(batch["context"]) return {"input_ids": context_encoding["input_ids"]} dataset = nlp.load_dataset("cosmos_qa", split="train") dataset = dataset.map(create_features, batched=True) dataset.set_format(type="torch", columns=["input_ids"]) dataset[0] # {'input_ids': tensor([ 1804, 3525, 1602, ... 0, 0])} dataset = dataset.shuffle() dataset[0] # {'id': '3Q9(...)20', 'context': "Good Old War an (...) play ?', 'answer0': 'None of the above choices .', 'answer1': 'This person likes music and likes to see the show , they will see other bands play .', (...) 'input_ids': [1804, 3525, 1602, ... , 0, 0]} ``` Hi @vegarab yes feel free to open a discussion here. This design choice was not very much thought about. Since `dataset.select()` (like all the method without a trailing underscore) is non-destructive and returns a new dataset it has most of its properties initialized from scratch (except the table and infos). Thinking about it I don't see a strong reason against transmitting the format from the parent dataset to its newly created child. It's probably what's expected by the user in most cases. What do you think @lhoestq? By the way, I've been working today on a refactoring of all the samples re-ordering/selection methods (`select`, `sort`, `shuffle`, `shard`, `train_test_split`). The idea is to speed them up by a lot (like, really a lot) by working as much as possible with an indices mapping table instead of doing a deep copy of the full dataset as we've been doing currently. You can give it a look and try it here: https://github.com/huggingface/nlp/pull/513 Feedbacks are very much welcome
[ -0.1382125616, -0.2247208804, 0.0239641313, 0.247674033, 0.1281204373, -0.1362014413, 0.2032126039, 0.0824568793, -0.6032930017, -0.0022732411, -0.2842713594, 0.3227505386, -0.1951237023, 0.1738315821, 0.1398985386, -0.1447515488, 0.1145584881, 0.2089666277, -0.0435800143, -0.1156107932, -0.1563792527, -0.2866492271, -0.2859781384, -0.0606172979, -0.4345372915, 0.026099734, 0.0050067469, 0.1478998661, -0.0802040249, 0.0760355368, 0.0442325547, 0.2561855614, -0.1987254471, 0.5789403915, -0.0001289723, -0.1655298471, 0.0554000214, -0.2835811675, -0.2924963534, 0.0555676296, -0.0595306009, 0.2450535595, 0.0335683264, -0.1791681051, 0.0966273472, -0.3774509728, -0.0920627788, -0.1147693917, 0.1890462339, 0.1550747305, 0.0798438489, 0.3368450403, -0.2491131574, 0.2438394576, 0.3745867908, 0.5576680899, -0.131313324, 0.2056201994, 0.1018674448, 0.3548142612, 0.4095387459, 0.126822263, -0.2900160849, -0.2419891506, 0.2838993073, 0.0142173236, -0.2483237833, -0.2783830166, 0.1692026258, 0.0764761418, 0.7366985679, -0.5577981472, -0.1140445694, -0.4305657446, 0.1685491204, -0.3902668357, 0.071951896, 0.1549597532, 0.0929495469, -0.0118968049, -0.4119158983, -0.0944790989, 0.1351483613, 0.0751213133, 0.2118794322, 0.2510278821, -0.1262820363, 0.221487999, -0.2606825829, 0.3279383183, 0.2481326908, -0.3805219829, -0.0002250939, -0.0308667738, -0.1849078834, -0.0945180953, -0.0433807224, 0.0452789143, -0.070491679, 0.3731215596, 0.5257029533, 0.2177649587, -0.1684403569, 0.1170974523, 0.3756846189, 0.1648922861, 0.1534627378, 0.0623676926, 0.0424033143, -0.3042165041, 0.0391025841, 0.0110791074, 0.2551577985, -0.043304231, 0.3766872287, -0.03462727, -0.0403551124, -0.1273491234, -0.021883266, 0.0662860125, -0.2807995677, -0.3609568179, -0.1409436613, 0.1119956672, 0.0275997166, 0.3346140385, -0.2615428269, 0.2003477216, -0.3364674747, 0.0672374889, -0.1536250859, -0.1003372446, -0.2305384129, 0.1230603606, 0.177946195, -0.341763556, 0.2291341126, 0.0857956558, -0.0553180464, 0.0410850979, 0.1837371141, -0.3757713735, 0.4564965367, 0.2302482724, -0.1737117171, 0.1937040389, 0.0566019528, 0.2335438728, -0.2558580935, 0.497836113, -0.2411562055, -0.2049873173, 0.2311904877, 0.0342096984, -0.1543438584, -0.0228705015, -0.2087957561, 0.1444381624, 0.4477298856, -0.3578275144, 0.2071653157, -0.586868763, -0.2272825986, -0.4626277387, 0.0286327787, 0.2016873509, -0.3084817827, -0.0998900831, 0.533556819, -0.1290864199, 0.2292512208, 0.2242172807, -0.3500422537, 0.3968577981, -0.1544258744, -0.0633992404, 0.5925034881, 0.0699076056, -0.2872905731, -0.3488509953, -0.079189539, 0.3577807248, -0.1115626097, 0.1525214314, -0.1749600321, -0.080071196, 0.2018080354, 0.1149847433, -0.0569890775, 0.1131263897, -0.2052195221, 0.0311103221, 0.4739534259, 0.1160250679, -0.0859152749, -0.0094831064, -0.0761847794, 0.1589437425, 0.1887996048, -0.0295023844, -0.2351532131, 0.0499475822, -0.1133160666, 0.1867135465, -0.0154644689, -0.1854671687, -0.2254037112, -0.1526828855, 0.1799519509, -0.3040949404, 0.3576208055, 0.0391091667, 0.0106457723, -0.3328682482, -0.4570796192, -0.3931133747, -0.0499447286, 0.4065031111, 0.0490473434, 0.1186687574, -0.3195300996, 0.06144711, -0.2063671649, -0.0083993226, -0.4115724564, 0.124852486, 0.1170987934, -0.2123426497, -0.3896252215, 0.1242082715, -0.1243452355, -0.0857830346, -0.2129511982, 0.3616207838, 0.1442990899, -0.2647685707, -0.3784196079, 0.4010249674, 0.1274125129, 0.2065182924, 0.1345850378, -0.1895992309, 0.3265338838, -0.1915591061, -0.2690972686, 0.3493040502, -0.6575783491, -0.1802589297, -0.1800182164, -0.6270245314, -0.0393620394, 0.2436848432, -0.385366261, 0.0459834076, 0.0531653129, 0.3270127475, 0.1938662976, 0.3799909949, -0.5700511336, -0.0476528406, 0.7285051942, -0.2212720215, 0.0553404167, 0.0533638746, -0.171744734, -0.3505658805, -0.1845951676, -0.0203248132, 0.7820938826, -0.0153637351, -0.0367373712, 0.0553938523, 0.0814556852, -0.351912111, 0.0955267027, 0.2491501868, 0.0069552739, 0.4411147535, 0.3575186133, 0.1117630228, -0.4882295728, 0.1302796006, 0.1637690812, -0.0803557336, -0.3349175155, 0.0944052264, -0.1556545347, 0.0596319623, -0.3772049248, -0.0254958998, 0.0446694568, -0.0599997602, -0.0811632499, 0.0489457138, 0.1002307981, -0.0627606884, 0.2464331985, 0.2244513184, -0.0175594594, -0.3098868132, 0.3108997643, -0.071258083, -0.1993417442, -0.114727281, 0.0123944432, -0.0295998547, 0.3543700278, -0.0558915883, -0.2055741698, -0.1391871721, -0.1954612583, 0.2927091718, -0.0928989053, -0.0006687108, 0.0193674155, -0.0350415744, 0.0142720575, -0.198037222, 0.1020730734, 0.1147158369, 0.1975731105, 0.0408128388, 0.1796194911, 0.1345437914, -0.199323073, -0.2912896574, -0.0313385725, 0.0881654844, 0.2162626684, -0.1674564034, -0.0139828939, 0.4659081995, -0.0845904276, -0.1470180899, -0.6666822433, 0.1076660007, -0.3695809841, -0.5208802819, 0.1293287724, -0.0555756129, -0.2137968987, -0.2652084827, 0.1450389922, -0.0572916903, 0.5463923216, -0.2382083088, -0.1953878254, -0.1374085993, -0.0648623854, -0.0691307336, 0.4167661667, 0.3020017445, 0.0571571253, 0.1945848614, 0.0385169834, -0.0434042625, 0.1414676309, 0.3747739494, 0.0798516646, 0.0951740742, 0.1910053045, -0.0178645067, 0.5995121598, -0.1991275847, -0.1613335907, 0.1348067373, 0.1795825511, 0.3882861435, -0.472230643, -0.1041783988, 0.4822197556, -0.0516311675, -0.0903249756, 0.2900754511, -0.2437632829, 0.0153199555, -0.118170172, 0.15897277, -0.2877340317, -0.2249054611, 0.4279426336, -0.0042330115, 0.21488747, 0.0903221518, 0.3507177532, -0.1093764678, 0.0532985628, -0.1550859213, 0.1416813731, 0.4043021798, 0.0007883552, -0.5444183946, -0.2212266773, -0.1243488565, 0.0089224381, 0.1123215482, 0.531748414, 0.0306652226, -0.1736355573, 0.1770093888, 0.2656617165, 0.5368551612, -0.0887494832, -0.0582988299, 0.1731207371, -0.3876773715, -0.1465545893, -0.3178414106, -0.2131339163, 0.0677268654, -0.2510712147, 0.2636964023, -0.203009367, -0.0140724555, -0.0744816363, 0.4079807699, -0.1185538918, 0.0340830646, -0.0952486172, -0.0083032455, -0.1466763765, 0.0440276749, -0.1954732686, -0.1743858755, -0.3775609136, 0.3725060523, -0.0666092932, 0.2309619635, -0.0352431834, -0.1375809759, 0.2652427852, 0.1389311254, -0.1037345305, 0.1086482927, 0.0686225742, 0.0677358955, 0.0991385803, -0.0500397347, -0.0214674938, 0.2940169275, -0.343662858, 0.1544416696, 0.4693877101, 0.0623108484, 0.0337496363, -0.4204910398, 0.0856412053, -0.2320629358, 0.0723926574, 0.3479064703, -0.0806319937, -0.2999907732, -1.0697370768, 0.2451430112, 0.1815056205, 0.0347044468, 0.1759746373, -0.2191981524, -0.0421900749, 0.2608633041, 0.1543844342, 1.0892901421, -0.0507259257, 0.521843195, 0.3229362667, -0.0731949136, 0.3819905519, -0.3416105211, 0.1129657701, -0.2447148412, -0.4424587488, 0.0531471632, -0.284635365, -0.0072028432, 0.007824216, -0.1367422044, 0.3234069943, -0.2796404362, -0.0524000153, -0.0252829045, 0.0340556763, -0.1102771387, -0.0948151648, -0.0633680671, -0.0598192997, -0.1997701228, 0.1812170297, -0.0717720687, 0.1181942821, -0.1108605564, 0.0298049487, -0.0448216237, -0.1666142941, -0.0512367338, 0.0092824427, -0.3341163993, -0.6155844331, 0.2836141288, 0.3402104378, 0.0996387675, 0.1792658418, 0.0534416623, 0.0836943239, 0.245182097, 0.4168069959, -0.0029477738, -0.0521088801, 0.4235515893, 0.0652487278, 0.0677941963, 0.252488941, -0.0190393478, -0.0969827548, -0.8286115527, 0.1709132195, 0.3791938722, -0.2473126203, -0.4441281855, 0.0542821847, -0.0023440302, 0.0265491903, -0.04083528, 0.1820118278, 0.1740788072, 0.4315122068, -0.2256631702, -0.4154628813, -0.1995775998, 0.2852523029, 0.200392887, -0.0452265628, 0.4193188548, -0.0519282743, -0.2008046508, -0.0527363308, 0.2371237427, -0.0974295735, -0.4542704821, -0.1012881845, -0.0841006562, 0.1255543828, -0.0190061815, 0.2705136538, -0.2472783327, 0.0637080669, -0.2091897726, -0.0291789472, 0.103812024, 0.0176787972, 0.4277179241, 0.3437691629, 0.364726305, 0.3129194081, 0.0152426818, -0.0564862341, -0.1305904835, 0.0297765806, 0.3241153061, 0.3977799714, 0.0183636863, 0.0064168903, -0.3131079972, -0.0604930297, -0.1109375209, 0.1440346092, -0.1140711308, -0.0874802694, -0.1520569623, 0.2300266773, 0.0748608857, -0.0025265082, -0.1695275903, -0.1676242054, -0.1742764711, -0.2396646589, 0.297601074, 0.2611994147, 0.02102427, 0.1257656217, 0.4362258017, 0.0285322517, 0.1622671783, 0.1904213727, -0.1589648426, -0.2615147829, 0.1234547347, 0.016478667, -0.2788669169, -0.0519072115, -0.5990060568, 0.1433500201, 0.2141147852, 0.3800848722, 0.0123021239, -0.3274236023, 0.3317850232, -0.1678716838, 0.4022539854, 0.5396654606, 0.0275576133, -0.4948885739, 0.2594492137, -0.0720314458, 0.225341469, -0.1419829875, -0.0395639092, 0.1817881018, -0.1139531061, 0.1323441714, -0.1584560424, 0.3500944078, -0.5146566033, -0.0992889553, 0.1379050165, -0.1613044739, 0.2236175835, 0.4979372919, 0.0465981141, -0.0668177232, 0.1828079075, -0.0771137625, -0.1445319206, 0.2808187008, 0.7301183939, 0.5393792391, 0.4825176299, 0.0395526551, -0.0672644898, -0.4697546065, -0.2155255675, 0.1976957619, 0.0375330262, 0.5161760449, 0.2281161845, 0.0463419706, 0.1134194434, -0.0799596086, 0.127046302, 0.3366567492, -0.1223195419, -0.0420720316, 0.2104705423, -0.3991296887, 0.0812122598, 0.1484829485, -0.4271038175, 0.2103957683, 0.1051129922, 0.1707055867, -0.185676679, -0.1114177331, 0.2426231951, -0.1366684884, 0.1284891963, -0.1080197096, -0.0554127954, 0.176776737, 0.0271322522, 0.189820841, 0.1285139322, -0.0513709709, 0.3518343568, -0.1466551423, 0.0571049303, -0.1032777876, 0.1627275497, 0.0270889867, 0.0942608193, 0.3115410209, -0.3098681271, 0.4923088253, 0.0618407801, -0.0126401521, -0.1264347285, 0.3408859968, 0.2179021239, -0.588776052, -0.0272436682, 0.1398260146, 0.0593103617, 0.0964891389, 0.1066814288, -0.4906990528, 0.0379793867, 0.0147473505, 0.4293688834, 0.183574602, -0.0085616661, -0.0065230131, 0.1072585359, 0.4353661239, 0.0826551765, -0.1552225649, -0.0474480912, 0.0259120166, -0.4284967482, 0.0506526157, 0.3247933686, 0.1212256327, 0.2492527366, -0.110071376, 0.2826695442, 0.1380499601, -0.1708900034, 0.2173685282, -0.0020118312, 0.4330168366, -0.3053790629, -0.0873092934, -0.4109704196, 0.1781346947, -0.1709598154, -0.1909287274, 0.1201004833, 0.1029169038, 0.0281697828, -0.2006622851, -0.1350136399, -0.0147141926, 0.3194842339, 0.215191856, 0.0709727034, 0.275259763, 0.0149042383, 0.0139684156, -0.1395521313, 0.0865889713, -0.0084385658, 0.2101178169, -0.2170506418, 0.3956199288, -0.1571720541, 0.1808831394, -0.3153145015, 0.2677331865, -0.1786734015, 0.2012964785, -0.2949553728, -0.0618331097, 0.3227123022, 0.0421419926, 0.0804625303, 0.568616271, -0.0181751996, 0.2659774721, -0.2791576684, 0.2963320613, 0.4934825599, 0.1330402195, -0.2201576084, -0.2162210047, -0.0268434361, 0.1314432323, 0.0620844774, -0.3097266853, 0.0052932636, 0.2125545144, -0.2343693525, -0.3316031396, 0.2053732872, -0.0543341264, -0.2618585825, -0.1250598133, 0.5423795581, -0.0547789969, -0.0949314088, -0.0436527319, -0.0387110189 ]
https://github.com/huggingface/datasets/issues/511
dataset.shuffle() and select() resets format. Intended?
I think it's ok to keep the format. If we want to have this behavior for `.map` too we just have to make sure it doesn't keep a column that's been removed.
Calling `dataset.shuffle()` or `dataset.select()` on a dataset resets its format set by `dataset.set_format()`. Is this intended or an oversight? When working on quite large datasets that require a lot of preprocessing I find it convenient to save the processed dataset to file using `torch.save("dataset.pt")`. Later loading the dataset object using `torch.load("dataset.pt")`, which conserves the defined format before saving. I do shuffling and selecting (for controlling dataset size) after loading the data from .pt-file, as it's convenient whenever you train multiple models with varying sizes of the same dataset. The obvious workaround for this is to set the format again after using `dataset.select()` or `dataset.shuffle()`. _I guess this is more of a discussion on the design philosophy of the functions. Please let me know if this is not the right channel for these kinds of discussions or if they are not wanted at all!_ #### How to reproduce: ```python import nlp from transformers import T5Tokenizer tokenizer = T5Tokenizer.from_pretrained("t5-base") def create_features(batch): context_encoding = tokenizer.batch_encode_plus(batch["context"]) return {"input_ids": context_encoding["input_ids"]} dataset = nlp.load_dataset("cosmos_qa", split="train") dataset = dataset.map(create_features, batched=True) dataset.set_format(type="torch", columns=["input_ids"]) dataset[0] # {'input_ids': tensor([ 1804, 3525, 1602, ... 0, 0])} dataset = dataset.shuffle() dataset[0] # {'id': '3Q9(...)20', 'context': "Good Old War an (...) play ?', 'answer0': 'None of the above choices .', 'answer1': 'This person likes music and likes to see the show , they will see other bands play .', (...) 'input_ids': [1804, 3525, 1602, ... , 0, 0]} ```
32
dataset.shuffle() and select() resets format. Intended? Calling `dataset.shuffle()` or `dataset.select()` on a dataset resets its format set by `dataset.set_format()`. Is this intended or an oversight? When working on quite large datasets that require a lot of preprocessing I find it convenient to save the processed dataset to file using `torch.save("dataset.pt")`. Later loading the dataset object using `torch.load("dataset.pt")`, which conserves the defined format before saving. I do shuffling and selecting (for controlling dataset size) after loading the data from .pt-file, as it's convenient whenever you train multiple models with varying sizes of the same dataset. The obvious workaround for this is to set the format again after using `dataset.select()` or `dataset.shuffle()`. _I guess this is more of a discussion on the design philosophy of the functions. Please let me know if this is not the right channel for these kinds of discussions or if they are not wanted at all!_ #### How to reproduce: ```python import nlp from transformers import T5Tokenizer tokenizer = T5Tokenizer.from_pretrained("t5-base") def create_features(batch): context_encoding = tokenizer.batch_encode_plus(batch["context"]) return {"input_ids": context_encoding["input_ids"]} dataset = nlp.load_dataset("cosmos_qa", split="train") dataset = dataset.map(create_features, batched=True) dataset.set_format(type="torch", columns=["input_ids"]) dataset[0] # {'input_ids': tensor([ 1804, 3525, 1602, ... 0, 0])} dataset = dataset.shuffle() dataset[0] # {'id': '3Q9(...)20', 'context': "Good Old War an (...) play ?', 'answer0': 'None of the above choices .', 'answer1': 'This person likes music and likes to see the show , they will see other bands play .', (...) 'input_ids': [1804, 3525, 1602, ... , 0, 0]} ``` I think it's ok to keep the format. If we want to have this behavior for `.map` too we just have to make sure it doesn't keep a column that's been removed.
[ -0.1382125616, -0.2247208804, 0.0239641313, 0.247674033, 0.1281204373, -0.1362014413, 0.2032126039, 0.0824568793, -0.6032930017, -0.0022732411, -0.2842713594, 0.3227505386, -0.1951237023, 0.1738315821, 0.1398985386, -0.1447515488, 0.1145584881, 0.2089666277, -0.0435800143, -0.1156107932, -0.1563792527, -0.2866492271, -0.2859781384, -0.0606172979, -0.4345372915, 0.026099734, 0.0050067469, 0.1478998661, -0.0802040249, 0.0760355368, 0.0442325547, 0.2561855614, -0.1987254471, 0.5789403915, -0.0001289723, -0.1655298471, 0.0554000214, -0.2835811675, -0.2924963534, 0.0555676296, -0.0595306009, 0.2450535595, 0.0335683264, -0.1791681051, 0.0966273472, -0.3774509728, -0.0920627788, -0.1147693917, 0.1890462339, 0.1550747305, 0.0798438489, 0.3368450403, -0.2491131574, 0.2438394576, 0.3745867908, 0.5576680899, -0.131313324, 0.2056201994, 0.1018674448, 0.3548142612, 0.4095387459, 0.126822263, -0.2900160849, -0.2419891506, 0.2838993073, 0.0142173236, -0.2483237833, -0.2783830166, 0.1692026258, 0.0764761418, 0.7366985679, -0.5577981472, -0.1140445694, -0.4305657446, 0.1685491204, -0.3902668357, 0.071951896, 0.1549597532, 0.0929495469, -0.0118968049, -0.4119158983, -0.0944790989, 0.1351483613, 0.0751213133, 0.2118794322, 0.2510278821, -0.1262820363, 0.221487999, -0.2606825829, 0.3279383183, 0.2481326908, -0.3805219829, -0.0002250939, -0.0308667738, -0.1849078834, -0.0945180953, -0.0433807224, 0.0452789143, -0.070491679, 0.3731215596, 0.5257029533, 0.2177649587, -0.1684403569, 0.1170974523, 0.3756846189, 0.1648922861, 0.1534627378, 0.0623676926, 0.0424033143, -0.3042165041, 0.0391025841, 0.0110791074, 0.2551577985, -0.043304231, 0.3766872287, -0.03462727, -0.0403551124, -0.1273491234, -0.021883266, 0.0662860125, -0.2807995677, -0.3609568179, -0.1409436613, 0.1119956672, 0.0275997166, 0.3346140385, -0.2615428269, 0.2003477216, -0.3364674747, 0.0672374889, -0.1536250859, -0.1003372446, -0.2305384129, 0.1230603606, 0.177946195, -0.341763556, 0.2291341126, 0.0857956558, -0.0553180464, 0.0410850979, 0.1837371141, -0.3757713735, 0.4564965367, 0.2302482724, -0.1737117171, 0.1937040389, 0.0566019528, 0.2335438728, -0.2558580935, 0.497836113, -0.2411562055, -0.2049873173, 0.2311904877, 0.0342096984, -0.1543438584, -0.0228705015, -0.2087957561, 0.1444381624, 0.4477298856, -0.3578275144, 0.2071653157, -0.586868763, -0.2272825986, -0.4626277387, 0.0286327787, 0.2016873509, -0.3084817827, -0.0998900831, 0.533556819, -0.1290864199, 0.2292512208, 0.2242172807, -0.3500422537, 0.3968577981, -0.1544258744, -0.0633992404, 0.5925034881, 0.0699076056, -0.2872905731, -0.3488509953, -0.079189539, 0.3577807248, -0.1115626097, 0.1525214314, -0.1749600321, -0.080071196, 0.2018080354, 0.1149847433, -0.0569890775, 0.1131263897, -0.2052195221, 0.0311103221, 0.4739534259, 0.1160250679, -0.0859152749, -0.0094831064, -0.0761847794, 0.1589437425, 0.1887996048, -0.0295023844, -0.2351532131, 0.0499475822, -0.1133160666, 0.1867135465, -0.0154644689, -0.1854671687, -0.2254037112, -0.1526828855, 0.1799519509, -0.3040949404, 0.3576208055, 0.0391091667, 0.0106457723, -0.3328682482, -0.4570796192, -0.3931133747, -0.0499447286, 0.4065031111, 0.0490473434, 0.1186687574, -0.3195300996, 0.06144711, -0.2063671649, -0.0083993226, -0.4115724564, 0.124852486, 0.1170987934, -0.2123426497, -0.3896252215, 0.1242082715, -0.1243452355, -0.0857830346, -0.2129511982, 0.3616207838, 0.1442990899, -0.2647685707, -0.3784196079, 0.4010249674, 0.1274125129, 0.2065182924, 0.1345850378, -0.1895992309, 0.3265338838, -0.1915591061, -0.2690972686, 0.3493040502, -0.6575783491, -0.1802589297, -0.1800182164, -0.6270245314, -0.0393620394, 0.2436848432, -0.385366261, 0.0459834076, 0.0531653129, 0.3270127475, 0.1938662976, 0.3799909949, -0.5700511336, -0.0476528406, 0.7285051942, -0.2212720215, 0.0553404167, 0.0533638746, -0.171744734, -0.3505658805, -0.1845951676, -0.0203248132, 0.7820938826, -0.0153637351, -0.0367373712, 0.0553938523, 0.0814556852, -0.351912111, 0.0955267027, 0.2491501868, 0.0069552739, 0.4411147535, 0.3575186133, 0.1117630228, -0.4882295728, 0.1302796006, 0.1637690812, -0.0803557336, -0.3349175155, 0.0944052264, -0.1556545347, 0.0596319623, -0.3772049248, -0.0254958998, 0.0446694568, -0.0599997602, -0.0811632499, 0.0489457138, 0.1002307981, -0.0627606884, 0.2464331985, 0.2244513184, -0.0175594594, -0.3098868132, 0.3108997643, -0.071258083, -0.1993417442, -0.114727281, 0.0123944432, -0.0295998547, 0.3543700278, -0.0558915883, -0.2055741698, -0.1391871721, -0.1954612583, 0.2927091718, -0.0928989053, -0.0006687108, 0.0193674155, -0.0350415744, 0.0142720575, -0.198037222, 0.1020730734, 0.1147158369, 0.1975731105, 0.0408128388, 0.1796194911, 0.1345437914, -0.199323073, -0.2912896574, -0.0313385725, 0.0881654844, 0.2162626684, -0.1674564034, -0.0139828939, 0.4659081995, -0.0845904276, -0.1470180899, -0.6666822433, 0.1076660007, -0.3695809841, -0.5208802819, 0.1293287724, -0.0555756129, -0.2137968987, -0.2652084827, 0.1450389922, -0.0572916903, 0.5463923216, -0.2382083088, -0.1953878254, -0.1374085993, -0.0648623854, -0.0691307336, 0.4167661667, 0.3020017445, 0.0571571253, 0.1945848614, 0.0385169834, -0.0434042625, 0.1414676309, 0.3747739494, 0.0798516646, 0.0951740742, 0.1910053045, -0.0178645067, 0.5995121598, -0.1991275847, -0.1613335907, 0.1348067373, 0.1795825511, 0.3882861435, -0.472230643, -0.1041783988, 0.4822197556, -0.0516311675, -0.0903249756, 0.2900754511, -0.2437632829, 0.0153199555, -0.118170172, 0.15897277, -0.2877340317, -0.2249054611, 0.4279426336, -0.0042330115, 0.21488747, 0.0903221518, 0.3507177532, -0.1093764678, 0.0532985628, -0.1550859213, 0.1416813731, 0.4043021798, 0.0007883552, -0.5444183946, -0.2212266773, -0.1243488565, 0.0089224381, 0.1123215482, 0.531748414, 0.0306652226, -0.1736355573, 0.1770093888, 0.2656617165, 0.5368551612, -0.0887494832, -0.0582988299, 0.1731207371, -0.3876773715, -0.1465545893, -0.3178414106, -0.2131339163, 0.0677268654, -0.2510712147, 0.2636964023, -0.203009367, -0.0140724555, -0.0744816363, 0.4079807699, -0.1185538918, 0.0340830646, -0.0952486172, -0.0083032455, -0.1466763765, 0.0440276749, -0.1954732686, -0.1743858755, -0.3775609136, 0.3725060523, -0.0666092932, 0.2309619635, -0.0352431834, -0.1375809759, 0.2652427852, 0.1389311254, -0.1037345305, 0.1086482927, 0.0686225742, 0.0677358955, 0.0991385803, -0.0500397347, -0.0214674938, 0.2940169275, -0.343662858, 0.1544416696, 0.4693877101, 0.0623108484, 0.0337496363, -0.4204910398, 0.0856412053, -0.2320629358, 0.0723926574, 0.3479064703, -0.0806319937, -0.2999907732, -1.0697370768, 0.2451430112, 0.1815056205, 0.0347044468, 0.1759746373, -0.2191981524, -0.0421900749, 0.2608633041, 0.1543844342, 1.0892901421, -0.0507259257, 0.521843195, 0.3229362667, -0.0731949136, 0.3819905519, -0.3416105211, 0.1129657701, -0.2447148412, -0.4424587488, 0.0531471632, -0.284635365, -0.0072028432, 0.007824216, -0.1367422044, 0.3234069943, -0.2796404362, -0.0524000153, -0.0252829045, 0.0340556763, -0.1102771387, -0.0948151648, -0.0633680671, -0.0598192997, -0.1997701228, 0.1812170297, -0.0717720687, 0.1181942821, -0.1108605564, 0.0298049487, -0.0448216237, -0.1666142941, -0.0512367338, 0.0092824427, -0.3341163993, -0.6155844331, 0.2836141288, 0.3402104378, 0.0996387675, 0.1792658418, 0.0534416623, 0.0836943239, 0.245182097, 0.4168069959, -0.0029477738, -0.0521088801, 0.4235515893, 0.0652487278, 0.0677941963, 0.252488941, -0.0190393478, -0.0969827548, -0.8286115527, 0.1709132195, 0.3791938722, -0.2473126203, -0.4441281855, 0.0542821847, -0.0023440302, 0.0265491903, -0.04083528, 0.1820118278, 0.1740788072, 0.4315122068, -0.2256631702, -0.4154628813, -0.1995775998, 0.2852523029, 0.200392887, -0.0452265628, 0.4193188548, -0.0519282743, -0.2008046508, -0.0527363308, 0.2371237427, -0.0974295735, -0.4542704821, -0.1012881845, -0.0841006562, 0.1255543828, -0.0190061815, 0.2705136538, -0.2472783327, 0.0637080669, -0.2091897726, -0.0291789472, 0.103812024, 0.0176787972, 0.4277179241, 0.3437691629, 0.364726305, 0.3129194081, 0.0152426818, -0.0564862341, -0.1305904835, 0.0297765806, 0.3241153061, 0.3977799714, 0.0183636863, 0.0064168903, -0.3131079972, -0.0604930297, -0.1109375209, 0.1440346092, -0.1140711308, -0.0874802694, -0.1520569623, 0.2300266773, 0.0748608857, -0.0025265082, -0.1695275903, -0.1676242054, -0.1742764711, -0.2396646589, 0.297601074, 0.2611994147, 0.02102427, 0.1257656217, 0.4362258017, 0.0285322517, 0.1622671783, 0.1904213727, -0.1589648426, -0.2615147829, 0.1234547347, 0.016478667, -0.2788669169, -0.0519072115, -0.5990060568, 0.1433500201, 0.2141147852, 0.3800848722, 0.0123021239, -0.3274236023, 0.3317850232, -0.1678716838, 0.4022539854, 0.5396654606, 0.0275576133, -0.4948885739, 0.2594492137, -0.0720314458, 0.225341469, -0.1419829875, -0.0395639092, 0.1817881018, -0.1139531061, 0.1323441714, -0.1584560424, 0.3500944078, -0.5146566033, -0.0992889553, 0.1379050165, -0.1613044739, 0.2236175835, 0.4979372919, 0.0465981141, -0.0668177232, 0.1828079075, -0.0771137625, -0.1445319206, 0.2808187008, 0.7301183939, 0.5393792391, 0.4825176299, 0.0395526551, -0.0672644898, -0.4697546065, -0.2155255675, 0.1976957619, 0.0375330262, 0.5161760449, 0.2281161845, 0.0463419706, 0.1134194434, -0.0799596086, 0.127046302, 0.3366567492, -0.1223195419, -0.0420720316, 0.2104705423, -0.3991296887, 0.0812122598, 0.1484829485, -0.4271038175, 0.2103957683, 0.1051129922, 0.1707055867, -0.185676679, -0.1114177331, 0.2426231951, -0.1366684884, 0.1284891963, -0.1080197096, -0.0554127954, 0.176776737, 0.0271322522, 0.189820841, 0.1285139322, -0.0513709709, 0.3518343568, -0.1466551423, 0.0571049303, -0.1032777876, 0.1627275497, 0.0270889867, 0.0942608193, 0.3115410209, -0.3098681271, 0.4923088253, 0.0618407801, -0.0126401521, -0.1264347285, 0.3408859968, 0.2179021239, -0.588776052, -0.0272436682, 0.1398260146, 0.0593103617, 0.0964891389, 0.1066814288, -0.4906990528, 0.0379793867, 0.0147473505, 0.4293688834, 0.183574602, -0.0085616661, -0.0065230131, 0.1072585359, 0.4353661239, 0.0826551765, -0.1552225649, -0.0474480912, 0.0259120166, -0.4284967482, 0.0506526157, 0.3247933686, 0.1212256327, 0.2492527366, -0.110071376, 0.2826695442, 0.1380499601, -0.1708900034, 0.2173685282, -0.0020118312, 0.4330168366, -0.3053790629, -0.0873092934, -0.4109704196, 0.1781346947, -0.1709598154, -0.1909287274, 0.1201004833, 0.1029169038, 0.0281697828, -0.2006622851, -0.1350136399, -0.0147141926, 0.3194842339, 0.215191856, 0.0709727034, 0.275259763, 0.0149042383, 0.0139684156, -0.1395521313, 0.0865889713, -0.0084385658, 0.2101178169, -0.2170506418, 0.3956199288, -0.1571720541, 0.1808831394, -0.3153145015, 0.2677331865, -0.1786734015, 0.2012964785, -0.2949553728, -0.0618331097, 0.3227123022, 0.0421419926, 0.0804625303, 0.568616271, -0.0181751996, 0.2659774721, -0.2791576684, 0.2963320613, 0.4934825599, 0.1330402195, -0.2201576084, -0.2162210047, -0.0268434361, 0.1314432323, 0.0620844774, -0.3097266853, 0.0052932636, 0.2125545144, -0.2343693525, -0.3316031396, 0.2053732872, -0.0543341264, -0.2618585825, -0.1250598133, 0.5423795581, -0.0547789969, -0.0949314088, -0.0436527319, -0.0387110189 ]
https://github.com/huggingface/datasets/issues/511
dataset.shuffle() and select() resets format. Intended?
Since datasets 1.0.0 the format is not reset anymore. Closing this one, but feel free to re-open if you have other questions
Calling `dataset.shuffle()` or `dataset.select()` on a dataset resets its format set by `dataset.set_format()`. Is this intended or an oversight? When working on quite large datasets that require a lot of preprocessing I find it convenient to save the processed dataset to file using `torch.save("dataset.pt")`. Later loading the dataset object using `torch.load("dataset.pt")`, which conserves the defined format before saving. I do shuffling and selecting (for controlling dataset size) after loading the data from .pt-file, as it's convenient whenever you train multiple models with varying sizes of the same dataset. The obvious workaround for this is to set the format again after using `dataset.select()` or `dataset.shuffle()`. _I guess this is more of a discussion on the design philosophy of the functions. Please let me know if this is not the right channel for these kinds of discussions or if they are not wanted at all!_ #### How to reproduce: ```python import nlp from transformers import T5Tokenizer tokenizer = T5Tokenizer.from_pretrained("t5-base") def create_features(batch): context_encoding = tokenizer.batch_encode_plus(batch["context"]) return {"input_ids": context_encoding["input_ids"]} dataset = nlp.load_dataset("cosmos_qa", split="train") dataset = dataset.map(create_features, batched=True) dataset.set_format(type="torch", columns=["input_ids"]) dataset[0] # {'input_ids': tensor([ 1804, 3525, 1602, ... 0, 0])} dataset = dataset.shuffle() dataset[0] # {'id': '3Q9(...)20', 'context': "Good Old War an (...) play ?', 'answer0': 'None of the above choices .', 'answer1': 'This person likes music and likes to see the show , they will see other bands play .', (...) 'input_ids': [1804, 3525, 1602, ... , 0, 0]} ```
22
dataset.shuffle() and select() resets format. Intended? Calling `dataset.shuffle()` or `dataset.select()` on a dataset resets its format set by `dataset.set_format()`. Is this intended or an oversight? When working on quite large datasets that require a lot of preprocessing I find it convenient to save the processed dataset to file using `torch.save("dataset.pt")`. Later loading the dataset object using `torch.load("dataset.pt")`, which conserves the defined format before saving. I do shuffling and selecting (for controlling dataset size) after loading the data from .pt-file, as it's convenient whenever you train multiple models with varying sizes of the same dataset. The obvious workaround for this is to set the format again after using `dataset.select()` or `dataset.shuffle()`. _I guess this is more of a discussion on the design philosophy of the functions. Please let me know if this is not the right channel for these kinds of discussions or if they are not wanted at all!_ #### How to reproduce: ```python import nlp from transformers import T5Tokenizer tokenizer = T5Tokenizer.from_pretrained("t5-base") def create_features(batch): context_encoding = tokenizer.batch_encode_plus(batch["context"]) return {"input_ids": context_encoding["input_ids"]} dataset = nlp.load_dataset("cosmos_qa", split="train") dataset = dataset.map(create_features, batched=True) dataset.set_format(type="torch", columns=["input_ids"]) dataset[0] # {'input_ids': tensor([ 1804, 3525, 1602, ... 0, 0])} dataset = dataset.shuffle() dataset[0] # {'id': '3Q9(...)20', 'context': "Good Old War an (...) play ?', 'answer0': 'None of the above choices .', 'answer1': 'This person likes music and likes to see the show , they will see other bands play .', (...) 'input_ids': [1804, 3525, 1602, ... , 0, 0]} ``` Since datasets 1.0.0 the format is not reset anymore. Closing this one, but feel free to re-open if you have other questions
[ -0.1382125616, -0.2247208804, 0.0239641313, 0.247674033, 0.1281204373, -0.1362014413, 0.2032126039, 0.0824568793, -0.6032930017, -0.0022732411, -0.2842713594, 0.3227505386, -0.1951237023, 0.1738315821, 0.1398985386, -0.1447515488, 0.1145584881, 0.2089666277, -0.0435800143, -0.1156107932, -0.1563792527, -0.2866492271, -0.2859781384, -0.0606172979, -0.4345372915, 0.026099734, 0.0050067469, 0.1478998661, -0.0802040249, 0.0760355368, 0.0442325547, 0.2561855614, -0.1987254471, 0.5789403915, -0.0001289723, -0.1655298471, 0.0554000214, -0.2835811675, -0.2924963534, 0.0555676296, -0.0595306009, 0.2450535595, 0.0335683264, -0.1791681051, 0.0966273472, -0.3774509728, -0.0920627788, -0.1147693917, 0.1890462339, 0.1550747305, 0.0798438489, 0.3368450403, -0.2491131574, 0.2438394576, 0.3745867908, 0.5576680899, -0.131313324, 0.2056201994, 0.1018674448, 0.3548142612, 0.4095387459, 0.126822263, -0.2900160849, -0.2419891506, 0.2838993073, 0.0142173236, -0.2483237833, -0.2783830166, 0.1692026258, 0.0764761418, 0.7366985679, -0.5577981472, -0.1140445694, -0.4305657446, 0.1685491204, -0.3902668357, 0.071951896, 0.1549597532, 0.0929495469, -0.0118968049, -0.4119158983, -0.0944790989, 0.1351483613, 0.0751213133, 0.2118794322, 0.2510278821, -0.1262820363, 0.221487999, -0.2606825829, 0.3279383183, 0.2481326908, -0.3805219829, -0.0002250939, -0.0308667738, -0.1849078834, -0.0945180953, -0.0433807224, 0.0452789143, -0.070491679, 0.3731215596, 0.5257029533, 0.2177649587, -0.1684403569, 0.1170974523, 0.3756846189, 0.1648922861, 0.1534627378, 0.0623676926, 0.0424033143, -0.3042165041, 0.0391025841, 0.0110791074, 0.2551577985, -0.043304231, 0.3766872287, -0.03462727, -0.0403551124, -0.1273491234, -0.021883266, 0.0662860125, -0.2807995677, -0.3609568179, -0.1409436613, 0.1119956672, 0.0275997166, 0.3346140385, -0.2615428269, 0.2003477216, -0.3364674747, 0.0672374889, -0.1536250859, -0.1003372446, -0.2305384129, 0.1230603606, 0.177946195, -0.341763556, 0.2291341126, 0.0857956558, -0.0553180464, 0.0410850979, 0.1837371141, -0.3757713735, 0.4564965367, 0.2302482724, -0.1737117171, 0.1937040389, 0.0566019528, 0.2335438728, -0.2558580935, 0.497836113, -0.2411562055, -0.2049873173, 0.2311904877, 0.0342096984, -0.1543438584, -0.0228705015, -0.2087957561, 0.1444381624, 0.4477298856, -0.3578275144, 0.2071653157, -0.586868763, -0.2272825986, -0.4626277387, 0.0286327787, 0.2016873509, -0.3084817827, -0.0998900831, 0.533556819, -0.1290864199, 0.2292512208, 0.2242172807, -0.3500422537, 0.3968577981, -0.1544258744, -0.0633992404, 0.5925034881, 0.0699076056, -0.2872905731, -0.3488509953, -0.079189539, 0.3577807248, -0.1115626097, 0.1525214314, -0.1749600321, -0.080071196, 0.2018080354, 0.1149847433, -0.0569890775, 0.1131263897, -0.2052195221, 0.0311103221, 0.4739534259, 0.1160250679, -0.0859152749, -0.0094831064, -0.0761847794, 0.1589437425, 0.1887996048, -0.0295023844, -0.2351532131, 0.0499475822, -0.1133160666, 0.1867135465, -0.0154644689, -0.1854671687, -0.2254037112, -0.1526828855, 0.1799519509, -0.3040949404, 0.3576208055, 0.0391091667, 0.0106457723, -0.3328682482, -0.4570796192, -0.3931133747, -0.0499447286, 0.4065031111, 0.0490473434, 0.1186687574, -0.3195300996, 0.06144711, -0.2063671649, -0.0083993226, -0.4115724564, 0.124852486, 0.1170987934, -0.2123426497, -0.3896252215, 0.1242082715, -0.1243452355, -0.0857830346, -0.2129511982, 0.3616207838, 0.1442990899, -0.2647685707, -0.3784196079, 0.4010249674, 0.1274125129, 0.2065182924, 0.1345850378, -0.1895992309, 0.3265338838, -0.1915591061, -0.2690972686, 0.3493040502, -0.6575783491, -0.1802589297, -0.1800182164, -0.6270245314, -0.0393620394, 0.2436848432, -0.385366261, 0.0459834076, 0.0531653129, 0.3270127475, 0.1938662976, 0.3799909949, -0.5700511336, -0.0476528406, 0.7285051942, -0.2212720215, 0.0553404167, 0.0533638746, -0.171744734, -0.3505658805, -0.1845951676, -0.0203248132, 0.7820938826, -0.0153637351, -0.0367373712, 0.0553938523, 0.0814556852, -0.351912111, 0.0955267027, 0.2491501868, 0.0069552739, 0.4411147535, 0.3575186133, 0.1117630228, -0.4882295728, 0.1302796006, 0.1637690812, -0.0803557336, -0.3349175155, 0.0944052264, -0.1556545347, 0.0596319623, -0.3772049248, -0.0254958998, 0.0446694568, -0.0599997602, -0.0811632499, 0.0489457138, 0.1002307981, -0.0627606884, 0.2464331985, 0.2244513184, -0.0175594594, -0.3098868132, 0.3108997643, -0.071258083, -0.1993417442, -0.114727281, 0.0123944432, -0.0295998547, 0.3543700278, -0.0558915883, -0.2055741698, -0.1391871721, -0.1954612583, 0.2927091718, -0.0928989053, -0.0006687108, 0.0193674155, -0.0350415744, 0.0142720575, -0.198037222, 0.1020730734, 0.1147158369, 0.1975731105, 0.0408128388, 0.1796194911, 0.1345437914, -0.199323073, -0.2912896574, -0.0313385725, 0.0881654844, 0.2162626684, -0.1674564034, -0.0139828939, 0.4659081995, -0.0845904276, -0.1470180899, -0.6666822433, 0.1076660007, -0.3695809841, -0.5208802819, 0.1293287724, -0.0555756129, -0.2137968987, -0.2652084827, 0.1450389922, -0.0572916903, 0.5463923216, -0.2382083088, -0.1953878254, -0.1374085993, -0.0648623854, -0.0691307336, 0.4167661667, 0.3020017445, 0.0571571253, 0.1945848614, 0.0385169834, -0.0434042625, 0.1414676309, 0.3747739494, 0.0798516646, 0.0951740742, 0.1910053045, -0.0178645067, 0.5995121598, -0.1991275847, -0.1613335907, 0.1348067373, 0.1795825511, 0.3882861435, -0.472230643, -0.1041783988, 0.4822197556, -0.0516311675, -0.0903249756, 0.2900754511, -0.2437632829, 0.0153199555, -0.118170172, 0.15897277, -0.2877340317, -0.2249054611, 0.4279426336, -0.0042330115, 0.21488747, 0.0903221518, 0.3507177532, -0.1093764678, 0.0532985628, -0.1550859213, 0.1416813731, 0.4043021798, 0.0007883552, -0.5444183946, -0.2212266773, -0.1243488565, 0.0089224381, 0.1123215482, 0.531748414, 0.0306652226, -0.1736355573, 0.1770093888, 0.2656617165, 0.5368551612, -0.0887494832, -0.0582988299, 0.1731207371, -0.3876773715, -0.1465545893, -0.3178414106, -0.2131339163, 0.0677268654, -0.2510712147, 0.2636964023, -0.203009367, -0.0140724555, -0.0744816363, 0.4079807699, -0.1185538918, 0.0340830646, -0.0952486172, -0.0083032455, -0.1466763765, 0.0440276749, -0.1954732686, -0.1743858755, -0.3775609136, 0.3725060523, -0.0666092932, 0.2309619635, -0.0352431834, -0.1375809759, 0.2652427852, 0.1389311254, -0.1037345305, 0.1086482927, 0.0686225742, 0.0677358955, 0.0991385803, -0.0500397347, -0.0214674938, 0.2940169275, -0.343662858, 0.1544416696, 0.4693877101, 0.0623108484, 0.0337496363, -0.4204910398, 0.0856412053, -0.2320629358, 0.0723926574, 0.3479064703, -0.0806319937, -0.2999907732, -1.0697370768, 0.2451430112, 0.1815056205, 0.0347044468, 0.1759746373, -0.2191981524, -0.0421900749, 0.2608633041, 0.1543844342, 1.0892901421, -0.0507259257, 0.521843195, 0.3229362667, -0.0731949136, 0.3819905519, -0.3416105211, 0.1129657701, -0.2447148412, -0.4424587488, 0.0531471632, -0.284635365, -0.0072028432, 0.007824216, -0.1367422044, 0.3234069943, -0.2796404362, -0.0524000153, -0.0252829045, 0.0340556763, -0.1102771387, -0.0948151648, -0.0633680671, -0.0598192997, -0.1997701228, 0.1812170297, -0.0717720687, 0.1181942821, -0.1108605564, 0.0298049487, -0.0448216237, -0.1666142941, -0.0512367338, 0.0092824427, -0.3341163993, -0.6155844331, 0.2836141288, 0.3402104378, 0.0996387675, 0.1792658418, 0.0534416623, 0.0836943239, 0.245182097, 0.4168069959, -0.0029477738, -0.0521088801, 0.4235515893, 0.0652487278, 0.0677941963, 0.252488941, -0.0190393478, -0.0969827548, -0.8286115527, 0.1709132195, 0.3791938722, -0.2473126203, -0.4441281855, 0.0542821847, -0.0023440302, 0.0265491903, -0.04083528, 0.1820118278, 0.1740788072, 0.4315122068, -0.2256631702, -0.4154628813, -0.1995775998, 0.2852523029, 0.200392887, -0.0452265628, 0.4193188548, -0.0519282743, -0.2008046508, -0.0527363308, 0.2371237427, -0.0974295735, -0.4542704821, -0.1012881845, -0.0841006562, 0.1255543828, -0.0190061815, 0.2705136538, -0.2472783327, 0.0637080669, -0.2091897726, -0.0291789472, 0.103812024, 0.0176787972, 0.4277179241, 0.3437691629, 0.364726305, 0.3129194081, 0.0152426818, -0.0564862341, -0.1305904835, 0.0297765806, 0.3241153061, 0.3977799714, 0.0183636863, 0.0064168903, -0.3131079972, -0.0604930297, -0.1109375209, 0.1440346092, -0.1140711308, -0.0874802694, -0.1520569623, 0.2300266773, 0.0748608857, -0.0025265082, -0.1695275903, -0.1676242054, -0.1742764711, -0.2396646589, 0.297601074, 0.2611994147, 0.02102427, 0.1257656217, 0.4362258017, 0.0285322517, 0.1622671783, 0.1904213727, -0.1589648426, -0.2615147829, 0.1234547347, 0.016478667, -0.2788669169, -0.0519072115, -0.5990060568, 0.1433500201, 0.2141147852, 0.3800848722, 0.0123021239, -0.3274236023, 0.3317850232, -0.1678716838, 0.4022539854, 0.5396654606, 0.0275576133, -0.4948885739, 0.2594492137, -0.0720314458, 0.225341469, -0.1419829875, -0.0395639092, 0.1817881018, -0.1139531061, 0.1323441714, -0.1584560424, 0.3500944078, -0.5146566033, -0.0992889553, 0.1379050165, -0.1613044739, 0.2236175835, 0.4979372919, 0.0465981141, -0.0668177232, 0.1828079075, -0.0771137625, -0.1445319206, 0.2808187008, 0.7301183939, 0.5393792391, 0.4825176299, 0.0395526551, -0.0672644898, -0.4697546065, -0.2155255675, 0.1976957619, 0.0375330262, 0.5161760449, 0.2281161845, 0.0463419706, 0.1134194434, -0.0799596086, 0.127046302, 0.3366567492, -0.1223195419, -0.0420720316, 0.2104705423, -0.3991296887, 0.0812122598, 0.1484829485, -0.4271038175, 0.2103957683, 0.1051129922, 0.1707055867, -0.185676679, -0.1114177331, 0.2426231951, -0.1366684884, 0.1284891963, -0.1080197096, -0.0554127954, 0.176776737, 0.0271322522, 0.189820841, 0.1285139322, -0.0513709709, 0.3518343568, -0.1466551423, 0.0571049303, -0.1032777876, 0.1627275497, 0.0270889867, 0.0942608193, 0.3115410209, -0.3098681271, 0.4923088253, 0.0618407801, -0.0126401521, -0.1264347285, 0.3408859968, 0.2179021239, -0.588776052, -0.0272436682, 0.1398260146, 0.0593103617, 0.0964891389, 0.1066814288, -0.4906990528, 0.0379793867, 0.0147473505, 0.4293688834, 0.183574602, -0.0085616661, -0.0065230131, 0.1072585359, 0.4353661239, 0.0826551765, -0.1552225649, -0.0474480912, 0.0259120166, -0.4284967482, 0.0506526157, 0.3247933686, 0.1212256327, 0.2492527366, -0.110071376, 0.2826695442, 0.1380499601, -0.1708900034, 0.2173685282, -0.0020118312, 0.4330168366, -0.3053790629, -0.0873092934, -0.4109704196, 0.1781346947, -0.1709598154, -0.1909287274, 0.1201004833, 0.1029169038, 0.0281697828, -0.2006622851, -0.1350136399, -0.0147141926, 0.3194842339, 0.215191856, 0.0709727034, 0.275259763, 0.0149042383, 0.0139684156, -0.1395521313, 0.0865889713, -0.0084385658, 0.2101178169, -0.2170506418, 0.3956199288, -0.1571720541, 0.1808831394, -0.3153145015, 0.2677331865, -0.1786734015, 0.2012964785, -0.2949553728, -0.0618331097, 0.3227123022, 0.0421419926, 0.0804625303, 0.568616271, -0.0181751996, 0.2659774721, -0.2791576684, 0.2963320613, 0.4934825599, 0.1330402195, -0.2201576084, -0.2162210047, -0.0268434361, 0.1314432323, 0.0620844774, -0.3097266853, 0.0052932636, 0.2125545144, -0.2343693525, -0.3316031396, 0.2053732872, -0.0543341264, -0.2618585825, -0.1250598133, 0.5423795581, -0.0547789969, -0.0949314088, -0.0436527319, -0.0387110189 ]
https://github.com/huggingface/datasets/issues/509
Converting TensorFlow dataset example
Do you want to convert a dataset script to the tfds format ? If so, we currently have a comversion script nlp/commands/convert.py but it is a conversion script that goes from tfds to nlp. I think it shouldn't be too hard to do the changes in reverse (at some manual adjustments). If you manage to make it work in reverse, feel free to open a PR to share it with the community :)
Hi, I want to use TensorFlow datasets with this repo, I noticed you made some conversion script, can you give a simple example of using it? Thanks
73
Converting TensorFlow dataset example Hi, I want to use TensorFlow datasets with this repo, I noticed you made some conversion script, can you give a simple example of using it? Thanks Do you want to convert a dataset script to the tfds format ? If so, we currently have a comversion script nlp/commands/convert.py but it is a conversion script that goes from tfds to nlp. I think it shouldn't be too hard to do the changes in reverse (at some manual adjustments). If you manage to make it work in reverse, feel free to open a PR to share it with the community :)
[ -0.1354897171, -0.0565533265, -0.1098583639, -0.196932748, 0.1657160968, 0.0915983692, 0.334038645, 0.4940678477, -0.1472648382, 0.1399838775, 0.0302083436, 0.342610687, 0.0195340198, 0.3617252707, 0.3380127549, -0.3144349158, 0.0504775159, 0.27958709, -0.3302761018, -0.1137342378, -0.0358067378, 0.108373411, -0.1115268469, 0.068593502, 0.1368518621, -0.0301686283, -0.0850050151, 0.250757724, 0.1226195693, 0.0422675796, 0.1680344939, 0.1560599655, 0.3117434084, 0.7285919785, -0.0001057782, -0.0028076447, 0.0753044784, -0.0946942568, -0.0748349652, -0.3386339247, -0.1552296877, -0.2183428854, 0.0090975985, -0.3499973416, -0.226417169, 0.0812487528, 0.1151309684, -0.1407833844, 0.5385850072, 0.5260943174, 0.2700378001, 0.1933606416, -0.0691370666, 0.1015989855, 0.0665850639, 0.1731283069, -0.2012016773, 0.0446692482, 0.3796445429, -0.1914271861, 0.2758766413, 0.2336081862, -0.0874221101, -0.1543226689, 0.3159396946, 0.0481564589, 0.131105274, -0.4717637897, 0.0087441485, 0.5226514339, 0.5459263921, -0.439865768, -0.0945538804, -0.1390539259, 0.0545599386, -0.3348770142, -0.4834914804, 0.1121080369, -0.139292717, 0.2684395313, -0.5411637425, -0.2216575444, -0.4027034342, 0.1094904542, -0.0812654346, 0.0930474624, 0.0270114671, 0.0200879555, -0.0979303867, -0.2529071569, 0.0744435564, -0.0001649564, 0.2594027817, 0.1288956404, -0.1298976541, -0.323794961, -0.0438239463, -0.4010477364, 0.0947275162, 0.0584127717, -0.0523549914, 0.2425810695, -0.3122435212, 0.1642353088, -0.1862477958, 0.2841513157, 0.1887124479, 0.2639869153, 0.1826597005, -0.2470730245, 0.0311291628, 0.1899618655, -0.2797750533, -0.1054206565, -0.1855313629, -0.0917768553, 0.3033266664, -0.1337189674, -0.1332104504, -0.2010022402, -0.0339621603, -0.0861754045, -0.1275319457, 0.2554563582, -0.0343335606, 0.0971730649, 0.2132084668, 0.2463806868, 0.0076524899, 0.0132318363, -0.0899325088, 0.183504194, -0.2858376503, -0.195955202, 0.0537289642, 0.1041619182, 0.0944257528, -0.1755783111, 0.0349988863, 0.3055782616, 0.3406417072, 0.3691465557, 0.1823939234, 0.0859624669, 0.1540003419, -0.0796309486, 0.2377061248, -0.1891966611, -0.3463332057, 0.3555153906, -0.3057292998, -0.1236110181, -0.1417660266, 0.2352067381, -0.2167692184, -0.4702013433, -0.2125681639, 0.4416576326, 0.0098986793, 0.0000362347, 0.1393336058, -0.2634070218, -0.2979618013, -0.2006850541, 0.0635971949, 0.2533063293, -0.6270148158, 0.0087206848, 0.0280466788, -0.3241327703, 0.2353957742, 0.0472909696, -0.0420392305, 0.1241587177, 0.1520133764, -0.0321767889, 0.8314982057, -0.4936858118, 0.0705595165, 0.3750868738, -0.1823390573, -0.1454542726, -0.1348913014, 0.0472493246, 0.1545653194, -0.1671395898, -0.2246345729, 0.4862652719, -0.3266910017, 0.2609778345, -0.0088492427, -0.1877931505, 0.3314789236, 0.1990184188, 0.057309512, 0.2233082354, -0.0590549521, 0.0614015609, 0.3003414273, -0.3258717656, 0.047920052, -0.0598339774, 0.1043671593, -0.0128768403, 0.1901643872, -0.2196416408, -0.3102653027, 0.0512254387, 0.0617601462, 0.1311342567, 0.242563352, -0.1107348204, -0.2938147485, -0.1632143706, 0.1098194793, 0.0496340245, 0.1978269368, -0.2180910558, 0.0811860263, -0.1274273098, -0.4316335917, -0.0382886194, -0.0973469764, 0.0361175388, -0.1963024884, 0.3646837771, 0.1487561166, -0.1214118078, -0.0107460683, 0.2152697295, -0.0853616893, -0.524953723, -0.0451357774, 0.3602921963, -0.2417015284, 0.3648480773, 0.2504192591, 0.3131825924, 0.2691743374, -0.1689708978, 0.2763990462, 0.1496813297, -0.08017952, -0.0926616415, -0.3937802911, 0.403162092, 0.0032229424, 0.2461514175, 0.0937028825, 0.1271242499, 0.3030196726, -0.3468948603, -0.2369306982, 0.0371234044, 0.0832645744, -0.0511139855, -0.2927995026, -0.182113871, -0.4421227872, 0.4492574036, 0.4657907188, -0.4190253317, -0.0151992515, 0.3167188764, -0.0855059847, -0.0136619015, 0.108068414, 0.2586345673, 0.0216839463, 0.1125840396, 0.0199201349, 0.2573531866, -0.1341614425, -0.0874178633, 0.184642598, -0.0575618185, 0.4302838445, -0.2699304521, 0.0184532925, 0.0372078083, 0.0475735813, -0.2376664728, 0.0429769792, 0.3551800251, -0.156198591, 0.1930072904, -0.4067864418, -0.4654603004, -0.231865108, 0.0395093113, 0.2529286444, -0.1253549606, 0.0527367219, 0.0213935599, -0.0492600352, 0.1367941499, 0.2264108211, 0.2378946543, 0.103007488, 0.0996950939, -0.2383310944, -0.2714829147, -0.3784900308, 0.2252316177, 0.3144752979, 0.1246519461, 0.3925197721, -0.3350907266, -0.0369044244, -0.4471806586, -0.3675509393, 0.179702118, -0.3059437573, -0.1407954246, 0.1060349867, 0.1329556704, -0.0322538279, 0.0568585582, -0.1369749904, -0.016906973, 0.0253217686, 0.2052122355, -0.234815836, -0.2529454529, -0.3389121592, -0.2970336378, -0.2056211829, -0.1967362016, 0.1507050246, 0.3304750621, 0.3571400344, 0.1313920021, 0.2177330554, 0.4648517966, 0.2672099173, -0.1147539616, 0.1104002744, -0.1542226821, 0.2004642338, -0.3984223306, -0.4548293352, 0.2888483405, 0.0177485272, 0.1205377877, 0.1832212806, -0.2387786061, -0.2569134235, -0.1529289931, 0.0101190293, 0.029691495, 0.1653308719, 0.2616769671, -0.0988903716, -0.1023723707, -0.1688300669, -0.0462652668, 0.1744610369, -0.032642398, 0.1593565643, 0.0931046531, 0.509434104, 0.0120585961, 0.5736188889, 0.0804750323, -0.4635080993, -0.1816732436, -0.3495342135, 0.1099513248, 0.2126191109, 0.0766796991, 0.2035271376, 0.1046322808, 0.1543194056, 0.2083735913, -0.0070086895, -0.2179467082, -0.0320744589, -0.0371240824, -0.157147333, -0.1940517575, 0.0228556376, -0.3748557568, 0.0867136568, 0.0973368958, -0.2412241548, -0.2570765018, -0.0799962729, -0.0409284271, 0.2149729282, 0.203299582, 0.0429554656, -0.5349577069, -0.1642124653, -0.4318331778, 0.2228111029, -0.2035097331, -0.0520598814, -0.0591829978, 0.1090999544, 0.015242001, -0.1294462234, 0.5048214793, -0.235555321, 0.0115835555, 0.2057326734, -0.1228230074, -0.389115572, -0.0865113959, -0.5830416679, 0.4415956438, 0.1200189963, 0.2497491837, -0.095640339, -0.2873215973, 0.3748549521, -0.0280566383, -0.1595229357, 0.0119606405, 0.1875295788, -0.4287965894, -0.3779331744, -0.1595685184, 0.0658509284, -0.2024732679, -0.4159742594, -0.2461672723, 0.1638125926, 0.2247574627, 0.3919682503, 0.2527737916, -0.0790425166, 0.354832381, -0.1536439359, -0.1274598986, 0.0106801409, 0.038604904, -0.0318939947, 0.0507645905, -0.24217695, 0.0336727612, 0.037234135, 0.3352761269, 0.2374721915, 0.0662431493, -0.1106175631, -0.0915657952, 0.1527938247, 0.0967045799, 0.1496432275, 0.2475591749, 0.1688020974, -0.475745827, -0.530138433, 0.3401373923, -0.0074002366, -0.1359577328, 0.0993591323, 0.0928992257, -0.2327268273, 0.1926205605, 0.2273745835, 0.94392097, -0.2948634624, 0.1038289517, 0.5949641466, -0.0607056618, 0.7162034512, -0.4931624532, -0.1701775789, -0.2644361854, -0.0217542965, -0.0256890059, -0.1684121639, -0.0368601792, 0.2574605942, -0.642468214, 0.2470127344, 0.0667687878, -0.1334490627, 0.2724009752, 0.2310864478, 0.1183701828, -0.1616882682, -0.128745839, 0.268484503, 0.0740971193, -0.0578407422, -0.1091942936, -0.2582224309, -0.1783967614, 0.2283306718, -0.240215078, 0.2407477945, -0.0256200749, -0.2215589136, 0.1087244079, -0.110674955, 0.4480560422, 0.3364576101, 0.666010499, 0.1680410802, -0.3463959098, 0.0017300332, -0.0454416648, 0.1112884134, 0.058702223, -0.0112943184, 0.469201088, -0.2207795531, -0.2251428515, 0.2291726023, 0.1137776524, 0.0434797741, -0.194965139, -0.1645004898, -0.0549057052, 0.0029231489, -0.1764400601, 0.4043124318, -0.4062634706, 0.2102761865, 0.1911527514, 0.1750525683, -0.2124243975, 0.1991518885, 0.009546929, -0.1557263136, 0.1329835653, -0.2656421363, 0.2591840923, -0.2787064016, 0.388055563, 0.3272637725, 0.0369455926, -0.217943117, -0.113380596, 0.1392154694, -0.0868157595, 0.1708606631, -0.0673047602, -0.0607717186, 0.183700189, -0.0260009505, -0.1884331256, 0.1745705009, -0.3014697433, -0.2322061658, -0.132087782, -0.1107660383, 0.1990895867, 0.0888257325, -0.100372836, 0.2689451575, 0.0134300953, -0.244442448, -0.4105582237, 0.2353581786, -0.0595583171, 0.2885018885, 0.433681041, 0.1194701865, -0.1040643677, -0.1778857112, 0.0551255159, -0.0050949492, -0.1838558614, -0.3351589441, -0.1824341565, 0.1167360246, -0.0160742924, -0.492632091, 0.3430457115, 0.0909260511, -0.1951272637, -0.0338492505, 0.1562357247, 0.0174519029, -0.0989516973, 0.4800693691, 0.2818796933, -0.0314352997, 0.2551216185, -0.2463387549, 0.103611894, 0.2019970119, -0.1880027503, 0.4242718816, 0.1399916559, -0.1804621816, -0.263830632, 0.1186976507, 0.2879512906, 0.2130424231, 0.4271520972, -0.098688297, 0.277820915, -0.0777333751, 0.2292591631, 0.0675174817, -0.3842886686, 0.185220629, 0.2729558349, 0.2478895038, -0.1421964616, 0.1829956621, 0.2702977359, -0.1790207177, 0.0693479404, 0.1512635052, -0.1563563049, 0.3313255608, 0.2594585419, -0.1847726852, 0.2648239136, -0.3637620211, 0.1419526041, 0.2273327708, -0.322360605, -0.0151455831, -0.3122265041, 0.1277265996, 0.0570513941, -0.1197217479, 0.1553032249, 0.3168903887, 0.1523033231, -0.0843116194, 0.3610112667, -0.0898131803, -0.0412832052, 0.122887589, -0.1211333498, 0.3119428158, 0.2081072181, 0.1741916239, 0.1185052991, 0.0702545941, -0.039179381, 0.3936654329, 0.1287220418, -0.0405919589, -0.2223964036, 0.0770247951, -0.1651803404, -0.209395811, -0.3505536318, -0.1053748205, -0.1378689855, 0.1823374331, 0.0087056281, 0.117100358, 0.3869176209, -0.1468650103, 0.0901408792, 0.0904912353, -0.0567423739, -0.0716626793, -0.0677579045, -0.1516685039, 0.2467566878, 0.2833398283, 0.2651732862, 0.0742940754, 0.4210434854, 0.0679797456, -0.1373469234, 0.2447866052, 0.1359489709, 0.0686763376, -0.0924706236, -0.1591883451, 0.1929428279, -0.137696892, 0.1138625965, -0.0290907528, -0.2743698359, -0.2508378327, 0.2464632988, 0.1080309525, -0.2730610073, -0.2436654419, -0.0376398452, -0.2719660103, -0.1385138184, 0.5426122546, 0.1232785434, 0.1378568262, -0.1872282624, 0.1152627543, 0.0063549345, 0.5613738894, 0.0490062721, 0.3272162974, 0.0605116524, -0.0555821359, -0.3118554354, 0.1494042426, 0.0035062439, -0.1453917772, 0.0505330339, -0.0098458072, 0.2392956913, 0.1602762789, 0.0475230478, -0.4620170593, -0.2005772442, 0.1359281242, -0.1267748624, -0.301620394, -0.2518889606, 0.3050576746, 0.0338141248, -0.2266814858, 0.2748782933, -0.0354945138, 0.0481881201, -0.2989723682, 0.3004083037, 0.2310103029, 0.0054134657, -0.0243234858, 0.0861261785, 0.2654090524, -0.1187250614, 0.0633612201, 0.0004629054, -0.0467339158, -0.4390633702, 0.1593444943, -0.176825583, -0.1780132204, -0.0915695503, -0.2608183026, -0.0369737111, -0.2370560914, 0.0015798227, -0.2869721651, -0.2905571461, 0.1905444115, -0.0497280769, -0.0407308266, 0.2042836547, 0.2939431071, -0.0183231905, 0.1006950885, -0.3634258211, 0.0011140406, 0.4306079447, -0.071741581, -0.3922427297, 0.0657985061, -0.0065417434, -0.1159205139, -0.0193989147, -0.3849150538, -0.0626807585, 0.1641977727, -0.0941299349, -0.1247691438, 0.2935927808, 0.1921741664, -0.0533425547, -0.2185539901, 0.1653591245, 0.0157193523, -0.2285494953, -0.2731186748, -0.3632559776 ]
https://github.com/huggingface/datasets/issues/508
TypeError: Receiver() takes no arguments
Which version of Apache Beam do you have (can you copy your full environment info here)?
I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump.
16
TypeError: Receiver() takes no arguments I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump. Which version of Apache Beam do you have (can you copy your full environment info here)?
[ -0.0946542546, 0.3181287348, 0.0874953046, 0.3629246056, 0.2740799487, -0.0989539996, 0.2871835232, 0.2369657159, -0.0286743008, 0.0688420087, 0.2388483882, 0.3297020793, -0.0908721015, -0.3363240957, 0.1751253307, -0.5368739963, -0.2141878307, 0.1947946101, -0.2329529226, -0.185087949, -0.1442272663, 0.3994990289, -0.3325725496, -0.0724645853, -0.1412281096, 0.1027453244, -0.0761771575, 0.1753537506, -0.1184645742, -0.3360362649, 0.1966994405, -0.0673624203, 0.0733792707, 0.2750077248, -0.0001245086, 0.330424577, 0.638014257, -0.1410856545, -0.541077733, -0.0631844252, -0.0811772197, -0.2349258363, 0.1993420571, -0.2498534024, -0.2083237469, -0.2352614701, 0.1023958176, -0.0581366718, 0.3563392162, 0.2815557122, 0.0985948592, 0.1995156407, 0.1826246679, -0.1368425936, 0.504362464, 0.0432152152, 0.0561956167, 0.0361744128, -0.227419734, 0.2372245789, -0.2068565637, 0.045931235, -0.2663236856, -0.0578699373, 0.33067137, -0.2204920202, 0.0874129608, 0.1752307117, -0.0942772925, -0.0104461052, 0.8057678342, 0.0052632308, 0.0640942976, -0.2012138069, 0.0806408748, -0.1908855289, 0.2383201718, 0.071560964, -0.4543536305, -0.1370186657, 0.1143338829, -0.1281689703, -0.3413944244, 0.3352713585, -0.0335041694, 0.4075172544, -0.0230085477, 0.3289751709, 0.1422495693, 0.1264766902, 0.207271859, -0.2324919254, -0.1268546283, 0.1452390552, -0.380857259, 0.1748376936, 0.1763765812, 0.2966891825, -0.0637694895, 0.1829949468, 0.0932280272, -0.1865078807, 0.0735039636, 0.1276493818, 0.3398443758, 0.1209280342, 0.1319723874, 0.012715145, 0.0047447993, -0.0747595653, 0.0249650385, 0.0320720263, -0.0236139931, -0.3605450094, -0.2406124175, 0.2245737463, 0.2357543409, -0.0485626385, 0.045268327, -0.2116840184, -0.3131859899, -0.2082334608, 0.1694273204, 0.4560172558, 0.0537247583, 0.4907972813, 0.3138802946, 0.1613338441, -0.1267466396, -0.5722315907, -0.1803700477, 0.3171549439, -0.1612579376, -0.163742885, 0.3268585801, 0.0613696761, 0.286521852, -0.2762344778, 0.1872424334, 0.173467055, -0.0168005712, -0.1587235183, -0.2288748473, 0.1743651927, 0.1935790181, 0.2789792717, 0.2141340971, -0.2745318115, 0.0189147424, 0.2086555213, -0.2223851234, -0.1689474136, 0.2648109198, 0.0425681137, 0.1071550697, -0.138430059, -0.5075435042, 0.1115978882, -0.1357538402, -0.2659595311, -0.2610869706, -0.2019344419, -0.0996061862, -0.2297556996, 0.3767794967, 0.5294710398, -0.0989684388, -0.029180225, -0.0063147522, 0.135422349, 0.0829522461, 0.035779275, -0.3114124238, 0.4921749234, -0.1760829687, -0.1047419906, 0.8686538935, -0.5204974413, -0.0506763421, 0.3639995754, 0.1172984391, -0.0718866736, 0.3070548177, 0.0618701242, 0.1170747727, -0.0958947167, 0.0317525081, 0.4021976292, -0.0465442128, 0.0234554671, -0.1533481032, 0.0390012823, 0.2969611883, 0.3607650101, 0.0934305936, 0.2212413847, -0.2734819651, 0.494769156, 0.2071566731, 0.0037383672, 0.0605675578, 0.512398243, -0.3901428282, -0.0827328414, 0.0390271805, 0.1130778864, 0.0266658347, -0.0488631204, -0.1335095167, 0.1562321186, 0.1626264304, 0.1614466459, -0.4275043011, 0.0230149366, -0.0830784068, 0.0427630842, 0.0567393228, 0.28403759, -0.1937212795, 0.258031249, 0.0285488237, 0.3317641914, 0.017510375, -0.0234071333, -0.3775365949, 0.2045924217, -0.1200193912, -0.255477339, 0.2829673886, -0.0228368938, 0.4561703205, 0.042088002, -0.173432678, 0.1393240094, 0.179944247, -0.020908365, 0.0413394496, -0.2081556171, 0.0283870474, -0.1349174082, -0.0474720225, 0.5747936368, 0.2473164797, -0.1931288838, 0.0073985741, -0.0563838705, -0.0950332284, 0.2234854698, -0.0520736277, 0.1890358478, 0.0732780769, 0.2233696878, -0.0849315822, 0.2273706496, 0.2046998143, 0.1990076452, 0.2141202986, -0.0926082507, -0.068681553, -0.2286663502, 0.2874104381, 0.2148694396, 0.0324278697, -0.0144206956, -0.2963917851, 0.0025038882, 0.2251096964, -0.063852109, 0.2678776085, 0.1726973951, -0.1246887594, -0.0075491564, 0.0018161145, -0.1072779447, 0.4460031986, 0.0564809218, 0.2611204684, -0.0166312288, -0.1084316, -0.0197840985, -0.2426252812, -0.254563123, 0.0278429892, 0.2242687047, -0.4247312546, 0.0356794149, -0.2087246925, -0.6600083113, -0.2359620035, -0.0494452938, -0.1605996341, -0.5055605769, -0.1612765938, 0.3273541927, 0.0146427816, 0.1275830418, -0.1205849424, 0.2305703163, 0.3319923282, -0.2339311093, -0.4185197651, -0.1734270304, -0.2996529639, -0.0336429738, 0.1122231856, 0.1323730648, 0.1385986507, 0.1139133945, -0.0306636281, -0.0660981312, -0.0057058516, 0.2152481675, -0.1090569124, 0.1235096529, 0.2650187314, 0.3777044713, -0.238956511, -0.0974706709, 0.3813404739, 0.0026625576, 0.1714809537, 0.3198916912, 0.0355913527, -0.0754794106, -0.1061439812, -0.2500556409, 0.0514180698, -0.6115216017, -0.1775639504, 0.2373061031, 0.0000522403, 0.1542860866, 0.2415063083, 0.1805426627, 0.1287684292, 0.3176608086, 0.016924141, -0.2387427688, 0.3329904675, -0.1693133712, -0.3372405171, -0.1376381963, 0.1169655398, 0.2338882983, 0.2198899537, -0.4601661265, -0.3833649457, 0.2961045206, -0.0347960182, 0.00652987, 0.1694480181, 0.3062466383, 0.0171282198, 0.0924847648, -0.2547694147, -0.1989656985, 0.0468886457, -0.22227332, 0.2826956809, 0.2882095277, 0.3215002716, -0.0384763293, 0.912262857, 0.2374218106, 0.1430848837, 0.5309516191, 0.1021702066, 0.2991390526, -0.0367713496, -0.2422953248, 0.2306569368, 0.1812366247, 0.1366698295, 0.2091350853, -0.2492396384, -0.2554644346, -0.4086241424, -0.2131761014, -0.2362275571, -0.3552212119, 0.1634071916, -0.3094646037, 0.2537304759, -0.1385106593, 0.2027331442, -0.3603170812, -0.0995284319, 0.149417311, 0.1440063417, 0.1602015644, 0.113049835, -0.0752255395, -0.0607113838, -0.3460043967, 0.3344670832, -0.1206777915, 0.3733889759, -0.0566633865, 0.0655355901, 0.0389601514, -0.0580293313, 0.7135972381, -0.301006496, -0.0036399656, 0.2482844889, 0.2207378596, -0.6750040054, 0.1139071956, -0.1122871116, 0.2548103333, 0.0049679996, -0.3782779276, -0.4797841311, -0.1921131015, 0.1742550135, -0.0723282024, -0.165267542, -0.0882530063, -0.220190376, -0.3247160912, -0.3097017705, -0.1059834361, -0.044405207, 0.4491246343, 0.2301393896, 0.2729757428, -0.1422615349, 0.0037107884, -0.0231207646, -0.1272254437, 0.144897908, -0.0203224085, -0.2366640717, -0.1947480887, 0.5161570311, -0.5861030817, 0.3650778234, 0.2983982265, -0.6307680011, -0.0487277918, -0.0185209345, 0.2841162682, 0.2116643637, -0.3109890819, 0.0528072305, -0.04902808, -0.1705603451, -0.0002034932, 0.2304154336, 0.4107172191, -0.3813048005, -0.0521864407, -0.562924087, 0.4374680817, -0.1350969374, -0.0104102585, 0.274297893, -0.1294573992, -0.1884311885, 0.6053572297, -0.0318604894, 0.9742009044, 0.2021540254, 0.1885176897, 0.4231549501, -0.1277763098, 0.622762084, -0.1243741661, 0.3219044507, -0.3893949091, 0.0414473377, -0.0638145432, -0.1746108383, -0.0930559486, 0.133276388, -0.2606725991, 0.2774875164, 0.0704493597, -0.0549798049, 0.0889612436, 0.1255861074, 0.1116453633, -0.1067720503, -0.5512533784, 0.05779697, -0.4502735734, 0.0162894335, -0.0729946569, -0.1618125588, 0.0773975402, -0.5212680697, -0.1029230058, 0.1655474901, -0.2402708381, 0.1557010412, -0.0565360337, -0.254773736, 0.1854228973, 0.3622990251, -0.0209174547, 0.0569431409, -0.1994662732, 0.3114800751, -0.5459029078, -0.0695612133, -0.1593799591, 0.3023841083, 0.284866184, -0.02512924, -0.1467427611, 0.3340934515, -0.1659711152, -0.6099504828, -0.0495169833, -0.0853258222, 0.4431833625, -0.0368479416, -0.2056545764, 0.0775684193, -0.1524200737, 0.0355421491, 0.0395074673, 0.0244934037, -0.2060185522, 0.0688499138, -0.0528985634, 0.0025281364, 0.1737149805, 0.4771816134, 0.0580931157, 0.0253525842, 0.5821678042, 0.2740312219, -0.0257173553, -0.1586010158, -0.2322814465, -0.3409318626, -0.6085489988, 0.1990736127, 0.3044448197, 0.0621340647, 0.0874246135, 0.2038393617, -0.0779728666, 0.1705037504, 0.0560895577, -0.3049577177, 0.1134140044, 0.2060198784, -0.2436186671, -0.0629765391, 0.4305718541, -0.0323968045, 0.3100136817, -0.1491772532, -0.185806632, -0.1241251975, -0.1878903061, 0.1358190179, 0.1600107104, -0.2263961285, -0.1157581508, 0.259205848, 0.0706709772, -0.2440283895, -0.2439686656, -0.0603576675, -0.1667722315, 0.2002599686, 0.2243480831, 0.1214101389, -0.1290197372, -0.4042980373, -0.1237502322, -0.1816292107, 0.0225902442, -0.1426828057, -0.2429103851, 0.055744011, 0.1504146159, 0.3674408495, -0.5081478357, 0.1975686103, 0.0760389492, -0.0926695541, 0.2132939249, 0.1916123033, 0.262457937, -0.0496925414, -0.4662690759, 0.1615189612, 0.2004977316, -0.0344549492, 0.529545188, -0.1840268672, -0.1134773269, -0.1094236523, -0.0806767493, 0.0807785466, -0.1513765305, 0.0117968032, 0.0692102686, 0.0332742557, -0.1537943482, 0.0494462773, 0.3225934803, 0.2039950788, -0.0651855022, 0.0736160427, -0.0870866477, -0.3661148548, 0.2096336931, 0.1163532957, 0.3633615375, -0.1511387676, -0.1119755283, 0.1339501441, -0.03495875, -0.0854379982, -0.0527977124, 0.227028206, 0.053739205, 0.2903498709, -0.1444789469, 0.0543754809, -0.0564409196, -0.3188202679, -0.04710434, -0.1534539312, 0.2008988708, 0.4862775803, 0.1516946554, 0.1443452686, -0.1632328629, 0.1997065395, 0.0482340306, 0.1141900718, -0.2721177638, 0.1604947895, 0.0182798635, 0.0310196094, -0.6282174587, -0.015781099, -0.4327568114, -0.1448915601, -0.0049459552, -0.1630239189, -0.0300583467, 0.2119426578, -0.116998598, -0.3793841004, 0.2154735923, 0.1218476072, -0.0333383754, -0.1512888521, 0.2037801445, 0.0854868293, 0.1178440154, 0.1998901963, 0.2706094086, 0.3540653884, 0.417027235, -0.2698947489, -0.1693298221, 0.2886008322, 0.0005998352, -0.2072158456, -0.0614675879, 0.0971704274, 0.3210932314, 0.3959817886, 0.0738286823, 0.0143994251, -0.0085140783, 0.1275814921, -0.0613213629, -0.2382628918, 0.4723806679, -0.0463521853, -0.0918836072, -0.3303667009, 0.0329028815, -0.5663155317, 0.3297738433, 0.0595322847, 0.3573004603, -0.0106481267, -0.2045568973, -0.0199388918, -0.0656268448, 0.3586012423, 0.3856933117, 0.3740834892, -0.3091629446, -0.4248060584, -0.4309861064, 0.1581876427, 0.1639746726, -0.2411169261, 0.1070590541, 0.199896723, 0.2831843197, 0.2404056042, -0.1074828506, -0.2510269284, -0.0557260625, 0.1786379665, -0.2189368308, -0.2895004451, 0.2064398974, 0.0696632043, -0.1936568916, -0.2178904563, -0.1419937611, 0.0083855288, 0.0918040872, -0.1656749099, -0.3625208139, 0.147717163, 0.0822411701, -0.0218153968, -0.0256657898, 0.4474617541, 0.0580899641, -0.0019748651, -0.1832550317, -0.07431712, -0.1690217257, -0.2816381752, -0.1547073126, 0.5438708663, -0.2213324606, 0.2525570989, -0.3257878721, 0.2445083261, -0.133482486, 0.3438499272, -0.146602422, 0.0648298189, -0.4684083462, 0.3983725011, -0.1344811767, -0.0675859153, -0.0255530626, 0.1462188214, -0.4820400774, -0.2730075121, 0.5664796233, -0.5063452721, -0.2313734591, 0.0063173133, 0.215786919, -0.4116666913, 0.3354257047, -0.3584125042, -0.0386063345, 0.2855787277, -0.0673241392, -0.1444847435, 0.1655160487, -0.047609929, 0.1122500226, -0.0831058547, -0.5315560102, 0.0437984541, -0.1335094571, -0.1396401078, -0.2604456842 ]
https://github.com/huggingface/datasets/issues/508
TypeError: Receiver() takes no arguments
apache-beam==2.23.0 nlp==0.4.0 For me this was resolved by running the same python script on Linux (or really WSL).
I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump.
18
TypeError: Receiver() takes no arguments I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump. apache-beam==2.23.0 nlp==0.4.0 For me this was resolved by running the same python script on Linux (or really WSL).
[ -0.0946542546, 0.3181287348, 0.0874953046, 0.3629246056, 0.2740799487, -0.0989539996, 0.2871835232, 0.2369657159, -0.0286743008, 0.0688420087, 0.2388483882, 0.3297020793, -0.0908721015, -0.3363240957, 0.1751253307, -0.5368739963, -0.2141878307, 0.1947946101, -0.2329529226, -0.185087949, -0.1442272663, 0.3994990289, -0.3325725496, -0.0724645853, -0.1412281096, 0.1027453244, -0.0761771575, 0.1753537506, -0.1184645742, -0.3360362649, 0.1966994405, -0.0673624203, 0.0733792707, 0.2750077248, -0.0001245086, 0.330424577, 0.638014257, -0.1410856545, -0.541077733, -0.0631844252, -0.0811772197, -0.2349258363, 0.1993420571, -0.2498534024, -0.2083237469, -0.2352614701, 0.1023958176, -0.0581366718, 0.3563392162, 0.2815557122, 0.0985948592, 0.1995156407, 0.1826246679, -0.1368425936, 0.504362464, 0.0432152152, 0.0561956167, 0.0361744128, -0.227419734, 0.2372245789, -0.2068565637, 0.045931235, -0.2663236856, -0.0578699373, 0.33067137, -0.2204920202, 0.0874129608, 0.1752307117, -0.0942772925, -0.0104461052, 0.8057678342, 0.0052632308, 0.0640942976, -0.2012138069, 0.0806408748, -0.1908855289, 0.2383201718, 0.071560964, -0.4543536305, -0.1370186657, 0.1143338829, -0.1281689703, -0.3413944244, 0.3352713585, -0.0335041694, 0.4075172544, -0.0230085477, 0.3289751709, 0.1422495693, 0.1264766902, 0.207271859, -0.2324919254, -0.1268546283, 0.1452390552, -0.380857259, 0.1748376936, 0.1763765812, 0.2966891825, -0.0637694895, 0.1829949468, 0.0932280272, -0.1865078807, 0.0735039636, 0.1276493818, 0.3398443758, 0.1209280342, 0.1319723874, 0.012715145, 0.0047447993, -0.0747595653, 0.0249650385, 0.0320720263, -0.0236139931, -0.3605450094, -0.2406124175, 0.2245737463, 0.2357543409, -0.0485626385, 0.045268327, -0.2116840184, -0.3131859899, -0.2082334608, 0.1694273204, 0.4560172558, 0.0537247583, 0.4907972813, 0.3138802946, 0.1613338441, -0.1267466396, -0.5722315907, -0.1803700477, 0.3171549439, -0.1612579376, -0.163742885, 0.3268585801, 0.0613696761, 0.286521852, -0.2762344778, 0.1872424334, 0.173467055, -0.0168005712, -0.1587235183, -0.2288748473, 0.1743651927, 0.1935790181, 0.2789792717, 0.2141340971, -0.2745318115, 0.0189147424, 0.2086555213, -0.2223851234, -0.1689474136, 0.2648109198, 0.0425681137, 0.1071550697, -0.138430059, -0.5075435042, 0.1115978882, -0.1357538402, -0.2659595311, -0.2610869706, -0.2019344419, -0.0996061862, -0.2297556996, 0.3767794967, 0.5294710398, -0.0989684388, -0.029180225, -0.0063147522, 0.135422349, 0.0829522461, 0.035779275, -0.3114124238, 0.4921749234, -0.1760829687, -0.1047419906, 0.8686538935, -0.5204974413, -0.0506763421, 0.3639995754, 0.1172984391, -0.0718866736, 0.3070548177, 0.0618701242, 0.1170747727, -0.0958947167, 0.0317525081, 0.4021976292, -0.0465442128, 0.0234554671, -0.1533481032, 0.0390012823, 0.2969611883, 0.3607650101, 0.0934305936, 0.2212413847, -0.2734819651, 0.494769156, 0.2071566731, 0.0037383672, 0.0605675578, 0.512398243, -0.3901428282, -0.0827328414, 0.0390271805, 0.1130778864, 0.0266658347, -0.0488631204, -0.1335095167, 0.1562321186, 0.1626264304, 0.1614466459, -0.4275043011, 0.0230149366, -0.0830784068, 0.0427630842, 0.0567393228, 0.28403759, -0.1937212795, 0.258031249, 0.0285488237, 0.3317641914, 0.017510375, -0.0234071333, -0.3775365949, 0.2045924217, -0.1200193912, -0.255477339, 0.2829673886, -0.0228368938, 0.4561703205, 0.042088002, -0.173432678, 0.1393240094, 0.179944247, -0.020908365, 0.0413394496, -0.2081556171, 0.0283870474, -0.1349174082, -0.0474720225, 0.5747936368, 0.2473164797, -0.1931288838, 0.0073985741, -0.0563838705, -0.0950332284, 0.2234854698, -0.0520736277, 0.1890358478, 0.0732780769, 0.2233696878, -0.0849315822, 0.2273706496, 0.2046998143, 0.1990076452, 0.2141202986, -0.0926082507, -0.068681553, -0.2286663502, 0.2874104381, 0.2148694396, 0.0324278697, -0.0144206956, -0.2963917851, 0.0025038882, 0.2251096964, -0.063852109, 0.2678776085, 0.1726973951, -0.1246887594, -0.0075491564, 0.0018161145, -0.1072779447, 0.4460031986, 0.0564809218, 0.2611204684, -0.0166312288, -0.1084316, -0.0197840985, -0.2426252812, -0.254563123, 0.0278429892, 0.2242687047, -0.4247312546, 0.0356794149, -0.2087246925, -0.6600083113, -0.2359620035, -0.0494452938, -0.1605996341, -0.5055605769, -0.1612765938, 0.3273541927, 0.0146427816, 0.1275830418, -0.1205849424, 0.2305703163, 0.3319923282, -0.2339311093, -0.4185197651, -0.1734270304, -0.2996529639, -0.0336429738, 0.1122231856, 0.1323730648, 0.1385986507, 0.1139133945, -0.0306636281, -0.0660981312, -0.0057058516, 0.2152481675, -0.1090569124, 0.1235096529, 0.2650187314, 0.3777044713, -0.238956511, -0.0974706709, 0.3813404739, 0.0026625576, 0.1714809537, 0.3198916912, 0.0355913527, -0.0754794106, -0.1061439812, -0.2500556409, 0.0514180698, -0.6115216017, -0.1775639504, 0.2373061031, 0.0000522403, 0.1542860866, 0.2415063083, 0.1805426627, 0.1287684292, 0.3176608086, 0.016924141, -0.2387427688, 0.3329904675, -0.1693133712, -0.3372405171, -0.1376381963, 0.1169655398, 0.2338882983, 0.2198899537, -0.4601661265, -0.3833649457, 0.2961045206, -0.0347960182, 0.00652987, 0.1694480181, 0.3062466383, 0.0171282198, 0.0924847648, -0.2547694147, -0.1989656985, 0.0468886457, -0.22227332, 0.2826956809, 0.2882095277, 0.3215002716, -0.0384763293, 0.912262857, 0.2374218106, 0.1430848837, 0.5309516191, 0.1021702066, 0.2991390526, -0.0367713496, -0.2422953248, 0.2306569368, 0.1812366247, 0.1366698295, 0.2091350853, -0.2492396384, -0.2554644346, -0.4086241424, -0.2131761014, -0.2362275571, -0.3552212119, 0.1634071916, -0.3094646037, 0.2537304759, -0.1385106593, 0.2027331442, -0.3603170812, -0.0995284319, 0.149417311, 0.1440063417, 0.1602015644, 0.113049835, -0.0752255395, -0.0607113838, -0.3460043967, 0.3344670832, -0.1206777915, 0.3733889759, -0.0566633865, 0.0655355901, 0.0389601514, -0.0580293313, 0.7135972381, -0.301006496, -0.0036399656, 0.2482844889, 0.2207378596, -0.6750040054, 0.1139071956, -0.1122871116, 0.2548103333, 0.0049679996, -0.3782779276, -0.4797841311, -0.1921131015, 0.1742550135, -0.0723282024, -0.165267542, -0.0882530063, -0.220190376, -0.3247160912, -0.3097017705, -0.1059834361, -0.044405207, 0.4491246343, 0.2301393896, 0.2729757428, -0.1422615349, 0.0037107884, -0.0231207646, -0.1272254437, 0.144897908, -0.0203224085, -0.2366640717, -0.1947480887, 0.5161570311, -0.5861030817, 0.3650778234, 0.2983982265, -0.6307680011, -0.0487277918, -0.0185209345, 0.2841162682, 0.2116643637, -0.3109890819, 0.0528072305, -0.04902808, -0.1705603451, -0.0002034932, 0.2304154336, 0.4107172191, -0.3813048005, -0.0521864407, -0.562924087, 0.4374680817, -0.1350969374, -0.0104102585, 0.274297893, -0.1294573992, -0.1884311885, 0.6053572297, -0.0318604894, 0.9742009044, 0.2021540254, 0.1885176897, 0.4231549501, -0.1277763098, 0.622762084, -0.1243741661, 0.3219044507, -0.3893949091, 0.0414473377, -0.0638145432, -0.1746108383, -0.0930559486, 0.133276388, -0.2606725991, 0.2774875164, 0.0704493597, -0.0549798049, 0.0889612436, 0.1255861074, 0.1116453633, -0.1067720503, -0.5512533784, 0.05779697, -0.4502735734, 0.0162894335, -0.0729946569, -0.1618125588, 0.0773975402, -0.5212680697, -0.1029230058, 0.1655474901, -0.2402708381, 0.1557010412, -0.0565360337, -0.254773736, 0.1854228973, 0.3622990251, -0.0209174547, 0.0569431409, -0.1994662732, 0.3114800751, -0.5459029078, -0.0695612133, -0.1593799591, 0.3023841083, 0.284866184, -0.02512924, -0.1467427611, 0.3340934515, -0.1659711152, -0.6099504828, -0.0495169833, -0.0853258222, 0.4431833625, -0.0368479416, -0.2056545764, 0.0775684193, -0.1524200737, 0.0355421491, 0.0395074673, 0.0244934037, -0.2060185522, 0.0688499138, -0.0528985634, 0.0025281364, 0.1737149805, 0.4771816134, 0.0580931157, 0.0253525842, 0.5821678042, 0.2740312219, -0.0257173553, -0.1586010158, -0.2322814465, -0.3409318626, -0.6085489988, 0.1990736127, 0.3044448197, 0.0621340647, 0.0874246135, 0.2038393617, -0.0779728666, 0.1705037504, 0.0560895577, -0.3049577177, 0.1134140044, 0.2060198784, -0.2436186671, -0.0629765391, 0.4305718541, -0.0323968045, 0.3100136817, -0.1491772532, -0.185806632, -0.1241251975, -0.1878903061, 0.1358190179, 0.1600107104, -0.2263961285, -0.1157581508, 0.259205848, 0.0706709772, -0.2440283895, -0.2439686656, -0.0603576675, -0.1667722315, 0.2002599686, 0.2243480831, 0.1214101389, -0.1290197372, -0.4042980373, -0.1237502322, -0.1816292107, 0.0225902442, -0.1426828057, -0.2429103851, 0.055744011, 0.1504146159, 0.3674408495, -0.5081478357, 0.1975686103, 0.0760389492, -0.0926695541, 0.2132939249, 0.1916123033, 0.262457937, -0.0496925414, -0.4662690759, 0.1615189612, 0.2004977316, -0.0344549492, 0.529545188, -0.1840268672, -0.1134773269, -0.1094236523, -0.0806767493, 0.0807785466, -0.1513765305, 0.0117968032, 0.0692102686, 0.0332742557, -0.1537943482, 0.0494462773, 0.3225934803, 0.2039950788, -0.0651855022, 0.0736160427, -0.0870866477, -0.3661148548, 0.2096336931, 0.1163532957, 0.3633615375, -0.1511387676, -0.1119755283, 0.1339501441, -0.03495875, -0.0854379982, -0.0527977124, 0.227028206, 0.053739205, 0.2903498709, -0.1444789469, 0.0543754809, -0.0564409196, -0.3188202679, -0.04710434, -0.1534539312, 0.2008988708, 0.4862775803, 0.1516946554, 0.1443452686, -0.1632328629, 0.1997065395, 0.0482340306, 0.1141900718, -0.2721177638, 0.1604947895, 0.0182798635, 0.0310196094, -0.6282174587, -0.015781099, -0.4327568114, -0.1448915601, -0.0049459552, -0.1630239189, -0.0300583467, 0.2119426578, -0.116998598, -0.3793841004, 0.2154735923, 0.1218476072, -0.0333383754, -0.1512888521, 0.2037801445, 0.0854868293, 0.1178440154, 0.1998901963, 0.2706094086, 0.3540653884, 0.417027235, -0.2698947489, -0.1693298221, 0.2886008322, 0.0005998352, -0.2072158456, -0.0614675879, 0.0971704274, 0.3210932314, 0.3959817886, 0.0738286823, 0.0143994251, -0.0085140783, 0.1275814921, -0.0613213629, -0.2382628918, 0.4723806679, -0.0463521853, -0.0918836072, -0.3303667009, 0.0329028815, -0.5663155317, 0.3297738433, 0.0595322847, 0.3573004603, -0.0106481267, -0.2045568973, -0.0199388918, -0.0656268448, 0.3586012423, 0.3856933117, 0.3740834892, -0.3091629446, -0.4248060584, -0.4309861064, 0.1581876427, 0.1639746726, -0.2411169261, 0.1070590541, 0.199896723, 0.2831843197, 0.2404056042, -0.1074828506, -0.2510269284, -0.0557260625, 0.1786379665, -0.2189368308, -0.2895004451, 0.2064398974, 0.0696632043, -0.1936568916, -0.2178904563, -0.1419937611, 0.0083855288, 0.0918040872, -0.1656749099, -0.3625208139, 0.147717163, 0.0822411701, -0.0218153968, -0.0256657898, 0.4474617541, 0.0580899641, -0.0019748651, -0.1832550317, -0.07431712, -0.1690217257, -0.2816381752, -0.1547073126, 0.5438708663, -0.2213324606, 0.2525570989, -0.3257878721, 0.2445083261, -0.133482486, 0.3438499272, -0.146602422, 0.0648298189, -0.4684083462, 0.3983725011, -0.1344811767, -0.0675859153, -0.0255530626, 0.1462188214, -0.4820400774, -0.2730075121, 0.5664796233, -0.5063452721, -0.2313734591, 0.0063173133, 0.215786919, -0.4116666913, 0.3354257047, -0.3584125042, -0.0386063345, 0.2855787277, -0.0673241392, -0.1444847435, 0.1655160487, -0.047609929, 0.1122500226, -0.0831058547, -0.5315560102, 0.0437984541, -0.1335094571, -0.1396401078, -0.2604456842 ]
https://github.com/huggingface/datasets/issues/508
TypeError: Receiver() takes no arguments
Do you manage to run a dummy beam pipeline with python on windows ? You can test a dummy pipeline with [this code](https://github.com/apache/beam/blob/master/sdks/python/apache_beam/examples/wordcount_minimal.py) If you get the same error, it means that the issue comes from apache beam. Otherwise we'll investigate what went wrong here
I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump.
45
TypeError: Receiver() takes no arguments I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump. Do you manage to run a dummy beam pipeline with python on windows ? You can test a dummy pipeline with [this code](https://github.com/apache/beam/blob/master/sdks/python/apache_beam/examples/wordcount_minimal.py) If you get the same error, it means that the issue comes from apache beam. Otherwise we'll investigate what went wrong here
[ -0.0946542546, 0.3181287348, 0.0874953046, 0.3629246056, 0.2740799487, -0.0989539996, 0.2871835232, 0.2369657159, -0.0286743008, 0.0688420087, 0.2388483882, 0.3297020793, -0.0908721015, -0.3363240957, 0.1751253307, -0.5368739963, -0.2141878307, 0.1947946101, -0.2329529226, -0.185087949, -0.1442272663, 0.3994990289, -0.3325725496, -0.0724645853, -0.1412281096, 0.1027453244, -0.0761771575, 0.1753537506, -0.1184645742, -0.3360362649, 0.1966994405, -0.0673624203, 0.0733792707, 0.2750077248, -0.0001245086, 0.330424577, 0.638014257, -0.1410856545, -0.541077733, -0.0631844252, -0.0811772197, -0.2349258363, 0.1993420571, -0.2498534024, -0.2083237469, -0.2352614701, 0.1023958176, -0.0581366718, 0.3563392162, 0.2815557122, 0.0985948592, 0.1995156407, 0.1826246679, -0.1368425936, 0.504362464, 0.0432152152, 0.0561956167, 0.0361744128, -0.227419734, 0.2372245789, -0.2068565637, 0.045931235, -0.2663236856, -0.0578699373, 0.33067137, -0.2204920202, 0.0874129608, 0.1752307117, -0.0942772925, -0.0104461052, 0.8057678342, 0.0052632308, 0.0640942976, -0.2012138069, 0.0806408748, -0.1908855289, 0.2383201718, 0.071560964, -0.4543536305, -0.1370186657, 0.1143338829, -0.1281689703, -0.3413944244, 0.3352713585, -0.0335041694, 0.4075172544, -0.0230085477, 0.3289751709, 0.1422495693, 0.1264766902, 0.207271859, -0.2324919254, -0.1268546283, 0.1452390552, -0.380857259, 0.1748376936, 0.1763765812, 0.2966891825, -0.0637694895, 0.1829949468, 0.0932280272, -0.1865078807, 0.0735039636, 0.1276493818, 0.3398443758, 0.1209280342, 0.1319723874, 0.012715145, 0.0047447993, -0.0747595653, 0.0249650385, 0.0320720263, -0.0236139931, -0.3605450094, -0.2406124175, 0.2245737463, 0.2357543409, -0.0485626385, 0.045268327, -0.2116840184, -0.3131859899, -0.2082334608, 0.1694273204, 0.4560172558, 0.0537247583, 0.4907972813, 0.3138802946, 0.1613338441, -0.1267466396, -0.5722315907, -0.1803700477, 0.3171549439, -0.1612579376, -0.163742885, 0.3268585801, 0.0613696761, 0.286521852, -0.2762344778, 0.1872424334, 0.173467055, -0.0168005712, -0.1587235183, -0.2288748473, 0.1743651927, 0.1935790181, 0.2789792717, 0.2141340971, -0.2745318115, 0.0189147424, 0.2086555213, -0.2223851234, -0.1689474136, 0.2648109198, 0.0425681137, 0.1071550697, -0.138430059, -0.5075435042, 0.1115978882, -0.1357538402, -0.2659595311, -0.2610869706, -0.2019344419, -0.0996061862, -0.2297556996, 0.3767794967, 0.5294710398, -0.0989684388, -0.029180225, -0.0063147522, 0.135422349, 0.0829522461, 0.035779275, -0.3114124238, 0.4921749234, -0.1760829687, -0.1047419906, 0.8686538935, -0.5204974413, -0.0506763421, 0.3639995754, 0.1172984391, -0.0718866736, 0.3070548177, 0.0618701242, 0.1170747727, -0.0958947167, 0.0317525081, 0.4021976292, -0.0465442128, 0.0234554671, -0.1533481032, 0.0390012823, 0.2969611883, 0.3607650101, 0.0934305936, 0.2212413847, -0.2734819651, 0.494769156, 0.2071566731, 0.0037383672, 0.0605675578, 0.512398243, -0.3901428282, -0.0827328414, 0.0390271805, 0.1130778864, 0.0266658347, -0.0488631204, -0.1335095167, 0.1562321186, 0.1626264304, 0.1614466459, -0.4275043011, 0.0230149366, -0.0830784068, 0.0427630842, 0.0567393228, 0.28403759, -0.1937212795, 0.258031249, 0.0285488237, 0.3317641914, 0.017510375, -0.0234071333, -0.3775365949, 0.2045924217, -0.1200193912, -0.255477339, 0.2829673886, -0.0228368938, 0.4561703205, 0.042088002, -0.173432678, 0.1393240094, 0.179944247, -0.020908365, 0.0413394496, -0.2081556171, 0.0283870474, -0.1349174082, -0.0474720225, 0.5747936368, 0.2473164797, -0.1931288838, 0.0073985741, -0.0563838705, -0.0950332284, 0.2234854698, -0.0520736277, 0.1890358478, 0.0732780769, 0.2233696878, -0.0849315822, 0.2273706496, 0.2046998143, 0.1990076452, 0.2141202986, -0.0926082507, -0.068681553, -0.2286663502, 0.2874104381, 0.2148694396, 0.0324278697, -0.0144206956, -0.2963917851, 0.0025038882, 0.2251096964, -0.063852109, 0.2678776085, 0.1726973951, -0.1246887594, -0.0075491564, 0.0018161145, -0.1072779447, 0.4460031986, 0.0564809218, 0.2611204684, -0.0166312288, -0.1084316, -0.0197840985, -0.2426252812, -0.254563123, 0.0278429892, 0.2242687047, -0.4247312546, 0.0356794149, -0.2087246925, -0.6600083113, -0.2359620035, -0.0494452938, -0.1605996341, -0.5055605769, -0.1612765938, 0.3273541927, 0.0146427816, 0.1275830418, -0.1205849424, 0.2305703163, 0.3319923282, -0.2339311093, -0.4185197651, -0.1734270304, -0.2996529639, -0.0336429738, 0.1122231856, 0.1323730648, 0.1385986507, 0.1139133945, -0.0306636281, -0.0660981312, -0.0057058516, 0.2152481675, -0.1090569124, 0.1235096529, 0.2650187314, 0.3777044713, -0.238956511, -0.0974706709, 0.3813404739, 0.0026625576, 0.1714809537, 0.3198916912, 0.0355913527, -0.0754794106, -0.1061439812, -0.2500556409, 0.0514180698, -0.6115216017, -0.1775639504, 0.2373061031, 0.0000522403, 0.1542860866, 0.2415063083, 0.1805426627, 0.1287684292, 0.3176608086, 0.016924141, -0.2387427688, 0.3329904675, -0.1693133712, -0.3372405171, -0.1376381963, 0.1169655398, 0.2338882983, 0.2198899537, -0.4601661265, -0.3833649457, 0.2961045206, -0.0347960182, 0.00652987, 0.1694480181, 0.3062466383, 0.0171282198, 0.0924847648, -0.2547694147, -0.1989656985, 0.0468886457, -0.22227332, 0.2826956809, 0.2882095277, 0.3215002716, -0.0384763293, 0.912262857, 0.2374218106, 0.1430848837, 0.5309516191, 0.1021702066, 0.2991390526, -0.0367713496, -0.2422953248, 0.2306569368, 0.1812366247, 0.1366698295, 0.2091350853, -0.2492396384, -0.2554644346, -0.4086241424, -0.2131761014, -0.2362275571, -0.3552212119, 0.1634071916, -0.3094646037, 0.2537304759, -0.1385106593, 0.2027331442, -0.3603170812, -0.0995284319, 0.149417311, 0.1440063417, 0.1602015644, 0.113049835, -0.0752255395, -0.0607113838, -0.3460043967, 0.3344670832, -0.1206777915, 0.3733889759, -0.0566633865, 0.0655355901, 0.0389601514, -0.0580293313, 0.7135972381, -0.301006496, -0.0036399656, 0.2482844889, 0.2207378596, -0.6750040054, 0.1139071956, -0.1122871116, 0.2548103333, 0.0049679996, -0.3782779276, -0.4797841311, -0.1921131015, 0.1742550135, -0.0723282024, -0.165267542, -0.0882530063, -0.220190376, -0.3247160912, -0.3097017705, -0.1059834361, -0.044405207, 0.4491246343, 0.2301393896, 0.2729757428, -0.1422615349, 0.0037107884, -0.0231207646, -0.1272254437, 0.144897908, -0.0203224085, -0.2366640717, -0.1947480887, 0.5161570311, -0.5861030817, 0.3650778234, 0.2983982265, -0.6307680011, -0.0487277918, -0.0185209345, 0.2841162682, 0.2116643637, -0.3109890819, 0.0528072305, -0.04902808, -0.1705603451, -0.0002034932, 0.2304154336, 0.4107172191, -0.3813048005, -0.0521864407, -0.562924087, 0.4374680817, -0.1350969374, -0.0104102585, 0.274297893, -0.1294573992, -0.1884311885, 0.6053572297, -0.0318604894, 0.9742009044, 0.2021540254, 0.1885176897, 0.4231549501, -0.1277763098, 0.622762084, -0.1243741661, 0.3219044507, -0.3893949091, 0.0414473377, -0.0638145432, -0.1746108383, -0.0930559486, 0.133276388, -0.2606725991, 0.2774875164, 0.0704493597, -0.0549798049, 0.0889612436, 0.1255861074, 0.1116453633, -0.1067720503, -0.5512533784, 0.05779697, -0.4502735734, 0.0162894335, -0.0729946569, -0.1618125588, 0.0773975402, -0.5212680697, -0.1029230058, 0.1655474901, -0.2402708381, 0.1557010412, -0.0565360337, -0.254773736, 0.1854228973, 0.3622990251, -0.0209174547, 0.0569431409, -0.1994662732, 0.3114800751, -0.5459029078, -0.0695612133, -0.1593799591, 0.3023841083, 0.284866184, -0.02512924, -0.1467427611, 0.3340934515, -0.1659711152, -0.6099504828, -0.0495169833, -0.0853258222, 0.4431833625, -0.0368479416, -0.2056545764, 0.0775684193, -0.1524200737, 0.0355421491, 0.0395074673, 0.0244934037, -0.2060185522, 0.0688499138, -0.0528985634, 0.0025281364, 0.1737149805, 0.4771816134, 0.0580931157, 0.0253525842, 0.5821678042, 0.2740312219, -0.0257173553, -0.1586010158, -0.2322814465, -0.3409318626, -0.6085489988, 0.1990736127, 0.3044448197, 0.0621340647, 0.0874246135, 0.2038393617, -0.0779728666, 0.1705037504, 0.0560895577, -0.3049577177, 0.1134140044, 0.2060198784, -0.2436186671, -0.0629765391, 0.4305718541, -0.0323968045, 0.3100136817, -0.1491772532, -0.185806632, -0.1241251975, -0.1878903061, 0.1358190179, 0.1600107104, -0.2263961285, -0.1157581508, 0.259205848, 0.0706709772, -0.2440283895, -0.2439686656, -0.0603576675, -0.1667722315, 0.2002599686, 0.2243480831, 0.1214101389, -0.1290197372, -0.4042980373, -0.1237502322, -0.1816292107, 0.0225902442, -0.1426828057, -0.2429103851, 0.055744011, 0.1504146159, 0.3674408495, -0.5081478357, 0.1975686103, 0.0760389492, -0.0926695541, 0.2132939249, 0.1916123033, 0.262457937, -0.0496925414, -0.4662690759, 0.1615189612, 0.2004977316, -0.0344549492, 0.529545188, -0.1840268672, -0.1134773269, -0.1094236523, -0.0806767493, 0.0807785466, -0.1513765305, 0.0117968032, 0.0692102686, 0.0332742557, -0.1537943482, 0.0494462773, 0.3225934803, 0.2039950788, -0.0651855022, 0.0736160427, -0.0870866477, -0.3661148548, 0.2096336931, 0.1163532957, 0.3633615375, -0.1511387676, -0.1119755283, 0.1339501441, -0.03495875, -0.0854379982, -0.0527977124, 0.227028206, 0.053739205, 0.2903498709, -0.1444789469, 0.0543754809, -0.0564409196, -0.3188202679, -0.04710434, -0.1534539312, 0.2008988708, 0.4862775803, 0.1516946554, 0.1443452686, -0.1632328629, 0.1997065395, 0.0482340306, 0.1141900718, -0.2721177638, 0.1604947895, 0.0182798635, 0.0310196094, -0.6282174587, -0.015781099, -0.4327568114, -0.1448915601, -0.0049459552, -0.1630239189, -0.0300583467, 0.2119426578, -0.116998598, -0.3793841004, 0.2154735923, 0.1218476072, -0.0333383754, -0.1512888521, 0.2037801445, 0.0854868293, 0.1178440154, 0.1998901963, 0.2706094086, 0.3540653884, 0.417027235, -0.2698947489, -0.1693298221, 0.2886008322, 0.0005998352, -0.2072158456, -0.0614675879, 0.0971704274, 0.3210932314, 0.3959817886, 0.0738286823, 0.0143994251, -0.0085140783, 0.1275814921, -0.0613213629, -0.2382628918, 0.4723806679, -0.0463521853, -0.0918836072, -0.3303667009, 0.0329028815, -0.5663155317, 0.3297738433, 0.0595322847, 0.3573004603, -0.0106481267, -0.2045568973, -0.0199388918, -0.0656268448, 0.3586012423, 0.3856933117, 0.3740834892, -0.3091629446, -0.4248060584, -0.4309861064, 0.1581876427, 0.1639746726, -0.2411169261, 0.1070590541, 0.199896723, 0.2831843197, 0.2404056042, -0.1074828506, -0.2510269284, -0.0557260625, 0.1786379665, -0.2189368308, -0.2895004451, 0.2064398974, 0.0696632043, -0.1936568916, -0.2178904563, -0.1419937611, 0.0083855288, 0.0918040872, -0.1656749099, -0.3625208139, 0.147717163, 0.0822411701, -0.0218153968, -0.0256657898, 0.4474617541, 0.0580899641, -0.0019748651, -0.1832550317, -0.07431712, -0.1690217257, -0.2816381752, -0.1547073126, 0.5438708663, -0.2213324606, 0.2525570989, -0.3257878721, 0.2445083261, -0.133482486, 0.3438499272, -0.146602422, 0.0648298189, -0.4684083462, 0.3983725011, -0.1344811767, -0.0675859153, -0.0255530626, 0.1462188214, -0.4820400774, -0.2730075121, 0.5664796233, -0.5063452721, -0.2313734591, 0.0063173133, 0.215786919, -0.4116666913, 0.3354257047, -0.3584125042, -0.0386063345, 0.2855787277, -0.0673241392, -0.1444847435, 0.1655160487, -0.047609929, 0.1122500226, -0.0831058547, -0.5315560102, 0.0437984541, -0.1335094571, -0.1396401078, -0.2604456842 ]
https://github.com/huggingface/datasets/issues/508
TypeError: Receiver() takes no arguments
Still, same error, so I guess it is on apache beam then. Thanks for the investigation.
I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump.
16
TypeError: Receiver() takes no arguments I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump. Still, same error, so I guess it is on apache beam then. Thanks for the investigation.
[ -0.0946542546, 0.3181287348, 0.0874953046, 0.3629246056, 0.2740799487, -0.0989539996, 0.2871835232, 0.2369657159, -0.0286743008, 0.0688420087, 0.2388483882, 0.3297020793, -0.0908721015, -0.3363240957, 0.1751253307, -0.5368739963, -0.2141878307, 0.1947946101, -0.2329529226, -0.185087949, -0.1442272663, 0.3994990289, -0.3325725496, -0.0724645853, -0.1412281096, 0.1027453244, -0.0761771575, 0.1753537506, -0.1184645742, -0.3360362649, 0.1966994405, -0.0673624203, 0.0733792707, 0.2750077248, -0.0001245086, 0.330424577, 0.638014257, -0.1410856545, -0.541077733, -0.0631844252, -0.0811772197, -0.2349258363, 0.1993420571, -0.2498534024, -0.2083237469, -0.2352614701, 0.1023958176, -0.0581366718, 0.3563392162, 0.2815557122, 0.0985948592, 0.1995156407, 0.1826246679, -0.1368425936, 0.504362464, 0.0432152152, 0.0561956167, 0.0361744128, -0.227419734, 0.2372245789, -0.2068565637, 0.045931235, -0.2663236856, -0.0578699373, 0.33067137, -0.2204920202, 0.0874129608, 0.1752307117, -0.0942772925, -0.0104461052, 0.8057678342, 0.0052632308, 0.0640942976, -0.2012138069, 0.0806408748, -0.1908855289, 0.2383201718, 0.071560964, -0.4543536305, -0.1370186657, 0.1143338829, -0.1281689703, -0.3413944244, 0.3352713585, -0.0335041694, 0.4075172544, -0.0230085477, 0.3289751709, 0.1422495693, 0.1264766902, 0.207271859, -0.2324919254, -0.1268546283, 0.1452390552, -0.380857259, 0.1748376936, 0.1763765812, 0.2966891825, -0.0637694895, 0.1829949468, 0.0932280272, -0.1865078807, 0.0735039636, 0.1276493818, 0.3398443758, 0.1209280342, 0.1319723874, 0.012715145, 0.0047447993, -0.0747595653, 0.0249650385, 0.0320720263, -0.0236139931, -0.3605450094, -0.2406124175, 0.2245737463, 0.2357543409, -0.0485626385, 0.045268327, -0.2116840184, -0.3131859899, -0.2082334608, 0.1694273204, 0.4560172558, 0.0537247583, 0.4907972813, 0.3138802946, 0.1613338441, -0.1267466396, -0.5722315907, -0.1803700477, 0.3171549439, -0.1612579376, -0.163742885, 0.3268585801, 0.0613696761, 0.286521852, -0.2762344778, 0.1872424334, 0.173467055, -0.0168005712, -0.1587235183, -0.2288748473, 0.1743651927, 0.1935790181, 0.2789792717, 0.2141340971, -0.2745318115, 0.0189147424, 0.2086555213, -0.2223851234, -0.1689474136, 0.2648109198, 0.0425681137, 0.1071550697, -0.138430059, -0.5075435042, 0.1115978882, -0.1357538402, -0.2659595311, -0.2610869706, -0.2019344419, -0.0996061862, -0.2297556996, 0.3767794967, 0.5294710398, -0.0989684388, -0.029180225, -0.0063147522, 0.135422349, 0.0829522461, 0.035779275, -0.3114124238, 0.4921749234, -0.1760829687, -0.1047419906, 0.8686538935, -0.5204974413, -0.0506763421, 0.3639995754, 0.1172984391, -0.0718866736, 0.3070548177, 0.0618701242, 0.1170747727, -0.0958947167, 0.0317525081, 0.4021976292, -0.0465442128, 0.0234554671, -0.1533481032, 0.0390012823, 0.2969611883, 0.3607650101, 0.0934305936, 0.2212413847, -0.2734819651, 0.494769156, 0.2071566731, 0.0037383672, 0.0605675578, 0.512398243, -0.3901428282, -0.0827328414, 0.0390271805, 0.1130778864, 0.0266658347, -0.0488631204, -0.1335095167, 0.1562321186, 0.1626264304, 0.1614466459, -0.4275043011, 0.0230149366, -0.0830784068, 0.0427630842, 0.0567393228, 0.28403759, -0.1937212795, 0.258031249, 0.0285488237, 0.3317641914, 0.017510375, -0.0234071333, -0.3775365949, 0.2045924217, -0.1200193912, -0.255477339, 0.2829673886, -0.0228368938, 0.4561703205, 0.042088002, -0.173432678, 0.1393240094, 0.179944247, -0.020908365, 0.0413394496, -0.2081556171, 0.0283870474, -0.1349174082, -0.0474720225, 0.5747936368, 0.2473164797, -0.1931288838, 0.0073985741, -0.0563838705, -0.0950332284, 0.2234854698, -0.0520736277, 0.1890358478, 0.0732780769, 0.2233696878, -0.0849315822, 0.2273706496, 0.2046998143, 0.1990076452, 0.2141202986, -0.0926082507, -0.068681553, -0.2286663502, 0.2874104381, 0.2148694396, 0.0324278697, -0.0144206956, -0.2963917851, 0.0025038882, 0.2251096964, -0.063852109, 0.2678776085, 0.1726973951, -0.1246887594, -0.0075491564, 0.0018161145, -0.1072779447, 0.4460031986, 0.0564809218, 0.2611204684, -0.0166312288, -0.1084316, -0.0197840985, -0.2426252812, -0.254563123, 0.0278429892, 0.2242687047, -0.4247312546, 0.0356794149, -0.2087246925, -0.6600083113, -0.2359620035, -0.0494452938, -0.1605996341, -0.5055605769, -0.1612765938, 0.3273541927, 0.0146427816, 0.1275830418, -0.1205849424, 0.2305703163, 0.3319923282, -0.2339311093, -0.4185197651, -0.1734270304, -0.2996529639, -0.0336429738, 0.1122231856, 0.1323730648, 0.1385986507, 0.1139133945, -0.0306636281, -0.0660981312, -0.0057058516, 0.2152481675, -0.1090569124, 0.1235096529, 0.2650187314, 0.3777044713, -0.238956511, -0.0974706709, 0.3813404739, 0.0026625576, 0.1714809537, 0.3198916912, 0.0355913527, -0.0754794106, -0.1061439812, -0.2500556409, 0.0514180698, -0.6115216017, -0.1775639504, 0.2373061031, 0.0000522403, 0.1542860866, 0.2415063083, 0.1805426627, 0.1287684292, 0.3176608086, 0.016924141, -0.2387427688, 0.3329904675, -0.1693133712, -0.3372405171, -0.1376381963, 0.1169655398, 0.2338882983, 0.2198899537, -0.4601661265, -0.3833649457, 0.2961045206, -0.0347960182, 0.00652987, 0.1694480181, 0.3062466383, 0.0171282198, 0.0924847648, -0.2547694147, -0.1989656985, 0.0468886457, -0.22227332, 0.2826956809, 0.2882095277, 0.3215002716, -0.0384763293, 0.912262857, 0.2374218106, 0.1430848837, 0.5309516191, 0.1021702066, 0.2991390526, -0.0367713496, -0.2422953248, 0.2306569368, 0.1812366247, 0.1366698295, 0.2091350853, -0.2492396384, -0.2554644346, -0.4086241424, -0.2131761014, -0.2362275571, -0.3552212119, 0.1634071916, -0.3094646037, 0.2537304759, -0.1385106593, 0.2027331442, -0.3603170812, -0.0995284319, 0.149417311, 0.1440063417, 0.1602015644, 0.113049835, -0.0752255395, -0.0607113838, -0.3460043967, 0.3344670832, -0.1206777915, 0.3733889759, -0.0566633865, 0.0655355901, 0.0389601514, -0.0580293313, 0.7135972381, -0.301006496, -0.0036399656, 0.2482844889, 0.2207378596, -0.6750040054, 0.1139071956, -0.1122871116, 0.2548103333, 0.0049679996, -0.3782779276, -0.4797841311, -0.1921131015, 0.1742550135, -0.0723282024, -0.165267542, -0.0882530063, -0.220190376, -0.3247160912, -0.3097017705, -0.1059834361, -0.044405207, 0.4491246343, 0.2301393896, 0.2729757428, -0.1422615349, 0.0037107884, -0.0231207646, -0.1272254437, 0.144897908, -0.0203224085, -0.2366640717, -0.1947480887, 0.5161570311, -0.5861030817, 0.3650778234, 0.2983982265, -0.6307680011, -0.0487277918, -0.0185209345, 0.2841162682, 0.2116643637, -0.3109890819, 0.0528072305, -0.04902808, -0.1705603451, -0.0002034932, 0.2304154336, 0.4107172191, -0.3813048005, -0.0521864407, -0.562924087, 0.4374680817, -0.1350969374, -0.0104102585, 0.274297893, -0.1294573992, -0.1884311885, 0.6053572297, -0.0318604894, 0.9742009044, 0.2021540254, 0.1885176897, 0.4231549501, -0.1277763098, 0.622762084, -0.1243741661, 0.3219044507, -0.3893949091, 0.0414473377, -0.0638145432, -0.1746108383, -0.0930559486, 0.133276388, -0.2606725991, 0.2774875164, 0.0704493597, -0.0549798049, 0.0889612436, 0.1255861074, 0.1116453633, -0.1067720503, -0.5512533784, 0.05779697, -0.4502735734, 0.0162894335, -0.0729946569, -0.1618125588, 0.0773975402, -0.5212680697, -0.1029230058, 0.1655474901, -0.2402708381, 0.1557010412, -0.0565360337, -0.254773736, 0.1854228973, 0.3622990251, -0.0209174547, 0.0569431409, -0.1994662732, 0.3114800751, -0.5459029078, -0.0695612133, -0.1593799591, 0.3023841083, 0.284866184, -0.02512924, -0.1467427611, 0.3340934515, -0.1659711152, -0.6099504828, -0.0495169833, -0.0853258222, 0.4431833625, -0.0368479416, -0.2056545764, 0.0775684193, -0.1524200737, 0.0355421491, 0.0395074673, 0.0244934037, -0.2060185522, 0.0688499138, -0.0528985634, 0.0025281364, 0.1737149805, 0.4771816134, 0.0580931157, 0.0253525842, 0.5821678042, 0.2740312219, -0.0257173553, -0.1586010158, -0.2322814465, -0.3409318626, -0.6085489988, 0.1990736127, 0.3044448197, 0.0621340647, 0.0874246135, 0.2038393617, -0.0779728666, 0.1705037504, 0.0560895577, -0.3049577177, 0.1134140044, 0.2060198784, -0.2436186671, -0.0629765391, 0.4305718541, -0.0323968045, 0.3100136817, -0.1491772532, -0.185806632, -0.1241251975, -0.1878903061, 0.1358190179, 0.1600107104, -0.2263961285, -0.1157581508, 0.259205848, 0.0706709772, -0.2440283895, -0.2439686656, -0.0603576675, -0.1667722315, 0.2002599686, 0.2243480831, 0.1214101389, -0.1290197372, -0.4042980373, -0.1237502322, -0.1816292107, 0.0225902442, -0.1426828057, -0.2429103851, 0.055744011, 0.1504146159, 0.3674408495, -0.5081478357, 0.1975686103, 0.0760389492, -0.0926695541, 0.2132939249, 0.1916123033, 0.262457937, -0.0496925414, -0.4662690759, 0.1615189612, 0.2004977316, -0.0344549492, 0.529545188, -0.1840268672, -0.1134773269, -0.1094236523, -0.0806767493, 0.0807785466, -0.1513765305, 0.0117968032, 0.0692102686, 0.0332742557, -0.1537943482, 0.0494462773, 0.3225934803, 0.2039950788, -0.0651855022, 0.0736160427, -0.0870866477, -0.3661148548, 0.2096336931, 0.1163532957, 0.3633615375, -0.1511387676, -0.1119755283, 0.1339501441, -0.03495875, -0.0854379982, -0.0527977124, 0.227028206, 0.053739205, 0.2903498709, -0.1444789469, 0.0543754809, -0.0564409196, -0.3188202679, -0.04710434, -0.1534539312, 0.2008988708, 0.4862775803, 0.1516946554, 0.1443452686, -0.1632328629, 0.1997065395, 0.0482340306, 0.1141900718, -0.2721177638, 0.1604947895, 0.0182798635, 0.0310196094, -0.6282174587, -0.015781099, -0.4327568114, -0.1448915601, -0.0049459552, -0.1630239189, -0.0300583467, 0.2119426578, -0.116998598, -0.3793841004, 0.2154735923, 0.1218476072, -0.0333383754, -0.1512888521, 0.2037801445, 0.0854868293, 0.1178440154, 0.1998901963, 0.2706094086, 0.3540653884, 0.417027235, -0.2698947489, -0.1693298221, 0.2886008322, 0.0005998352, -0.2072158456, -0.0614675879, 0.0971704274, 0.3210932314, 0.3959817886, 0.0738286823, 0.0143994251, -0.0085140783, 0.1275814921, -0.0613213629, -0.2382628918, 0.4723806679, -0.0463521853, -0.0918836072, -0.3303667009, 0.0329028815, -0.5663155317, 0.3297738433, 0.0595322847, 0.3573004603, -0.0106481267, -0.2045568973, -0.0199388918, -0.0656268448, 0.3586012423, 0.3856933117, 0.3740834892, -0.3091629446, -0.4248060584, -0.4309861064, 0.1581876427, 0.1639746726, -0.2411169261, 0.1070590541, 0.199896723, 0.2831843197, 0.2404056042, -0.1074828506, -0.2510269284, -0.0557260625, 0.1786379665, -0.2189368308, -0.2895004451, 0.2064398974, 0.0696632043, -0.1936568916, -0.2178904563, -0.1419937611, 0.0083855288, 0.0918040872, -0.1656749099, -0.3625208139, 0.147717163, 0.0822411701, -0.0218153968, -0.0256657898, 0.4474617541, 0.0580899641, -0.0019748651, -0.1832550317, -0.07431712, -0.1690217257, -0.2816381752, -0.1547073126, 0.5438708663, -0.2213324606, 0.2525570989, -0.3257878721, 0.2445083261, -0.133482486, 0.3438499272, -0.146602422, 0.0648298189, -0.4684083462, 0.3983725011, -0.1344811767, -0.0675859153, -0.0255530626, 0.1462188214, -0.4820400774, -0.2730075121, 0.5664796233, -0.5063452721, -0.2313734591, 0.0063173133, 0.215786919, -0.4116666913, 0.3354257047, -0.3584125042, -0.0386063345, 0.2855787277, -0.0673241392, -0.1444847435, 0.1655160487, -0.047609929, 0.1122500226, -0.0831058547, -0.5315560102, 0.0437984541, -0.1335094571, -0.1396401078, -0.2604456842 ]
https://github.com/huggingface/datasets/issues/508
TypeError: Receiver() takes no arguments
Thanks for trying Let us know if you find clues of what caused this issue, or if you find a fix
I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump.
21
TypeError: Receiver() takes no arguments I am trying to load a wikipedia data set ``` import nlp from nlp import load_dataset dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=data_path, beam_runner='DirectRunner') #dataset = load_dataset('wikipedia', '20200501.sv', cache_dir=data_path, beam_runner='DirectRunner') ``` This fails in the apache beam runner. ``` Traceback (most recent call last): File "D:/ML/wikiembedding/gpt2_sv.py", line 36, in <module> dataset = load_dataset("wikipedia", "20200501.en", split="train", cache_dir=my_cache_dir, beam_runner='DirectRunner') File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 462, in download_and_prepare self._download_and_prepare( File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\nlp\builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) .... File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\apache_beam\runners\worker\operations.py", line 332, in output cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value) File "C:\Users\seto\AppData\Local\Programs\Python\Python38\lib\site-packages\Cython\Shadow.py", line 167, in cast return type(*args) TypeError: Receiver() takes no arguments ``` This is run on a Windows 10 machine with python 3.8. I get the same error loading the swedish wikipedia dump. Thanks for trying Let us know if you find clues of what caused this issue, or if you find a fix
[ -0.0946542546, 0.3181287348, 0.0874953046, 0.3629246056, 0.2740799487, -0.0989539996, 0.2871835232, 0.2369657159, -0.0286743008, 0.0688420087, 0.2388483882, 0.3297020793, -0.0908721015, -0.3363240957, 0.1751253307, -0.5368739963, -0.2141878307, 0.1947946101, -0.2329529226, -0.185087949, -0.1442272663, 0.3994990289, -0.3325725496, -0.0724645853, -0.1412281096, 0.1027453244, -0.0761771575, 0.1753537506, -0.1184645742, -0.3360362649, 0.1966994405, -0.0673624203, 0.0733792707, 0.2750077248, -0.0001245086, 0.330424577, 0.638014257, -0.1410856545, -0.541077733, -0.0631844252, -0.0811772197, -0.2349258363, 0.1993420571, -0.2498534024, -0.2083237469, -0.2352614701, 0.1023958176, -0.0581366718, 0.3563392162, 0.2815557122, 0.0985948592, 0.1995156407, 0.1826246679, -0.1368425936, 0.504362464, 0.0432152152, 0.0561956167, 0.0361744128, -0.227419734, 0.2372245789, -0.2068565637, 0.045931235, -0.2663236856, -0.0578699373, 0.33067137, -0.2204920202, 0.0874129608, 0.1752307117, -0.0942772925, -0.0104461052, 0.8057678342, 0.0052632308, 0.0640942976, -0.2012138069, 0.0806408748, -0.1908855289, 0.2383201718, 0.071560964, -0.4543536305, -0.1370186657, 0.1143338829, -0.1281689703, -0.3413944244, 0.3352713585, -0.0335041694, 0.4075172544, -0.0230085477, 0.3289751709, 0.1422495693, 0.1264766902, 0.207271859, -0.2324919254, -0.1268546283, 0.1452390552, -0.380857259, 0.1748376936, 0.1763765812, 0.2966891825, -0.0637694895, 0.1829949468, 0.0932280272, -0.1865078807, 0.0735039636, 0.1276493818, 0.3398443758, 0.1209280342, 0.1319723874, 0.012715145, 0.0047447993, -0.0747595653, 0.0249650385, 0.0320720263, -0.0236139931, -0.3605450094, -0.2406124175, 0.2245737463, 0.2357543409, -0.0485626385, 0.045268327, -0.2116840184, -0.3131859899, -0.2082334608, 0.1694273204, 0.4560172558, 0.0537247583, 0.4907972813, 0.3138802946, 0.1613338441, -0.1267466396, -0.5722315907, -0.1803700477, 0.3171549439, -0.1612579376, -0.163742885, 0.3268585801, 0.0613696761, 0.286521852, -0.2762344778, 0.1872424334, 0.173467055, -0.0168005712, -0.1587235183, -0.2288748473, 0.1743651927, 0.1935790181, 0.2789792717, 0.2141340971, -0.2745318115, 0.0189147424, 0.2086555213, -0.2223851234, -0.1689474136, 0.2648109198, 0.0425681137, 0.1071550697, -0.138430059, -0.5075435042, 0.1115978882, -0.1357538402, -0.2659595311, -0.2610869706, -0.2019344419, -0.0996061862, -0.2297556996, 0.3767794967, 0.5294710398, -0.0989684388, -0.029180225, -0.0063147522, 0.135422349, 0.0829522461, 0.035779275, -0.3114124238, 0.4921749234, -0.1760829687, -0.1047419906, 0.8686538935, -0.5204974413, -0.0506763421, 0.3639995754, 0.1172984391, -0.0718866736, 0.3070548177, 0.0618701242, 0.1170747727, -0.0958947167, 0.0317525081, 0.4021976292, -0.0465442128, 0.0234554671, -0.1533481032, 0.0390012823, 0.2969611883, 0.3607650101, 0.0934305936, 0.2212413847, -0.2734819651, 0.494769156, 0.2071566731, 0.0037383672, 0.0605675578, 0.512398243, -0.3901428282, -0.0827328414, 0.0390271805, 0.1130778864, 0.0266658347, -0.0488631204, -0.1335095167, 0.1562321186, 0.1626264304, 0.1614466459, -0.4275043011, 0.0230149366, -0.0830784068, 0.0427630842, 0.0567393228, 0.28403759, -0.1937212795, 0.258031249, 0.0285488237, 0.3317641914, 0.017510375, -0.0234071333, -0.3775365949, 0.2045924217, -0.1200193912, -0.255477339, 0.2829673886, -0.0228368938, 0.4561703205, 0.042088002, -0.173432678, 0.1393240094, 0.179944247, -0.020908365, 0.0413394496, -0.2081556171, 0.0283870474, -0.1349174082, -0.0474720225, 0.5747936368, 0.2473164797, -0.1931288838, 0.0073985741, -0.0563838705, -0.0950332284, 0.2234854698, -0.0520736277, 0.1890358478, 0.0732780769, 0.2233696878, -0.0849315822, 0.2273706496, 0.2046998143, 0.1990076452, 0.2141202986, -0.0926082507, -0.068681553, -0.2286663502, 0.2874104381, 0.2148694396, 0.0324278697, -0.0144206956, -0.2963917851, 0.0025038882, 0.2251096964, -0.063852109, 0.2678776085, 0.1726973951, -0.1246887594, -0.0075491564, 0.0018161145, -0.1072779447, 0.4460031986, 0.0564809218, 0.2611204684, -0.0166312288, -0.1084316, -0.0197840985, -0.2426252812, -0.254563123, 0.0278429892, 0.2242687047, -0.4247312546, 0.0356794149, -0.2087246925, -0.6600083113, -0.2359620035, -0.0494452938, -0.1605996341, -0.5055605769, -0.1612765938, 0.3273541927, 0.0146427816, 0.1275830418, -0.1205849424, 0.2305703163, 0.3319923282, -0.2339311093, -0.4185197651, -0.1734270304, -0.2996529639, -0.0336429738, 0.1122231856, 0.1323730648, 0.1385986507, 0.1139133945, -0.0306636281, -0.0660981312, -0.0057058516, 0.2152481675, -0.1090569124, 0.1235096529, 0.2650187314, 0.3777044713, -0.238956511, -0.0974706709, 0.3813404739, 0.0026625576, 0.1714809537, 0.3198916912, 0.0355913527, -0.0754794106, -0.1061439812, -0.2500556409, 0.0514180698, -0.6115216017, -0.1775639504, 0.2373061031, 0.0000522403, 0.1542860866, 0.2415063083, 0.1805426627, 0.1287684292, 0.3176608086, 0.016924141, -0.2387427688, 0.3329904675, -0.1693133712, -0.3372405171, -0.1376381963, 0.1169655398, 0.2338882983, 0.2198899537, -0.4601661265, -0.3833649457, 0.2961045206, -0.0347960182, 0.00652987, 0.1694480181, 0.3062466383, 0.0171282198, 0.0924847648, -0.2547694147, -0.1989656985, 0.0468886457, -0.22227332, 0.2826956809, 0.2882095277, 0.3215002716, -0.0384763293, 0.912262857, 0.2374218106, 0.1430848837, 0.5309516191, 0.1021702066, 0.2991390526, -0.0367713496, -0.2422953248, 0.2306569368, 0.1812366247, 0.1366698295, 0.2091350853, -0.2492396384, -0.2554644346, -0.4086241424, -0.2131761014, -0.2362275571, -0.3552212119, 0.1634071916, -0.3094646037, 0.2537304759, -0.1385106593, 0.2027331442, -0.3603170812, -0.0995284319, 0.149417311, 0.1440063417, 0.1602015644, 0.113049835, -0.0752255395, -0.0607113838, -0.3460043967, 0.3344670832, -0.1206777915, 0.3733889759, -0.0566633865, 0.0655355901, 0.0389601514, -0.0580293313, 0.7135972381, -0.301006496, -0.0036399656, 0.2482844889, 0.2207378596, -0.6750040054, 0.1139071956, -0.1122871116, 0.2548103333, 0.0049679996, -0.3782779276, -0.4797841311, -0.1921131015, 0.1742550135, -0.0723282024, -0.165267542, -0.0882530063, -0.220190376, -0.3247160912, -0.3097017705, -0.1059834361, -0.044405207, 0.4491246343, 0.2301393896, 0.2729757428, -0.1422615349, 0.0037107884, -0.0231207646, -0.1272254437, 0.144897908, -0.0203224085, -0.2366640717, -0.1947480887, 0.5161570311, -0.5861030817, 0.3650778234, 0.2983982265, -0.6307680011, -0.0487277918, -0.0185209345, 0.2841162682, 0.2116643637, -0.3109890819, 0.0528072305, -0.04902808, -0.1705603451, -0.0002034932, 0.2304154336, 0.4107172191, -0.3813048005, -0.0521864407, -0.562924087, 0.4374680817, -0.1350969374, -0.0104102585, 0.274297893, -0.1294573992, -0.1884311885, 0.6053572297, -0.0318604894, 0.9742009044, 0.2021540254, 0.1885176897, 0.4231549501, -0.1277763098, 0.622762084, -0.1243741661, 0.3219044507, -0.3893949091, 0.0414473377, -0.0638145432, -0.1746108383, -0.0930559486, 0.133276388, -0.2606725991, 0.2774875164, 0.0704493597, -0.0549798049, 0.0889612436, 0.1255861074, 0.1116453633, -0.1067720503, -0.5512533784, 0.05779697, -0.4502735734, 0.0162894335, -0.0729946569, -0.1618125588, 0.0773975402, -0.5212680697, -0.1029230058, 0.1655474901, -0.2402708381, 0.1557010412, -0.0565360337, -0.254773736, 0.1854228973, 0.3622990251, -0.0209174547, 0.0569431409, -0.1994662732, 0.3114800751, -0.5459029078, -0.0695612133, -0.1593799591, 0.3023841083, 0.284866184, -0.02512924, -0.1467427611, 0.3340934515, -0.1659711152, -0.6099504828, -0.0495169833, -0.0853258222, 0.4431833625, -0.0368479416, -0.2056545764, 0.0775684193, -0.1524200737, 0.0355421491, 0.0395074673, 0.0244934037, -0.2060185522, 0.0688499138, -0.0528985634, 0.0025281364, 0.1737149805, 0.4771816134, 0.0580931157, 0.0253525842, 0.5821678042, 0.2740312219, -0.0257173553, -0.1586010158, -0.2322814465, -0.3409318626, -0.6085489988, 0.1990736127, 0.3044448197, 0.0621340647, 0.0874246135, 0.2038393617, -0.0779728666, 0.1705037504, 0.0560895577, -0.3049577177, 0.1134140044, 0.2060198784, -0.2436186671, -0.0629765391, 0.4305718541, -0.0323968045, 0.3100136817, -0.1491772532, -0.185806632, -0.1241251975, -0.1878903061, 0.1358190179, 0.1600107104, -0.2263961285, -0.1157581508, 0.259205848, 0.0706709772, -0.2440283895, -0.2439686656, -0.0603576675, -0.1667722315, 0.2002599686, 0.2243480831, 0.1214101389, -0.1290197372, -0.4042980373, -0.1237502322, -0.1816292107, 0.0225902442, -0.1426828057, -0.2429103851, 0.055744011, 0.1504146159, 0.3674408495, -0.5081478357, 0.1975686103, 0.0760389492, -0.0926695541, 0.2132939249, 0.1916123033, 0.262457937, -0.0496925414, -0.4662690759, 0.1615189612, 0.2004977316, -0.0344549492, 0.529545188, -0.1840268672, -0.1134773269, -0.1094236523, -0.0806767493, 0.0807785466, -0.1513765305, 0.0117968032, 0.0692102686, 0.0332742557, -0.1537943482, 0.0494462773, 0.3225934803, 0.2039950788, -0.0651855022, 0.0736160427, -0.0870866477, -0.3661148548, 0.2096336931, 0.1163532957, 0.3633615375, -0.1511387676, -0.1119755283, 0.1339501441, -0.03495875, -0.0854379982, -0.0527977124, 0.227028206, 0.053739205, 0.2903498709, -0.1444789469, 0.0543754809, -0.0564409196, -0.3188202679, -0.04710434, -0.1534539312, 0.2008988708, 0.4862775803, 0.1516946554, 0.1443452686, -0.1632328629, 0.1997065395, 0.0482340306, 0.1141900718, -0.2721177638, 0.1604947895, 0.0182798635, 0.0310196094, -0.6282174587, -0.015781099, -0.4327568114, -0.1448915601, -0.0049459552, -0.1630239189, -0.0300583467, 0.2119426578, -0.116998598, -0.3793841004, 0.2154735923, 0.1218476072, -0.0333383754, -0.1512888521, 0.2037801445, 0.0854868293, 0.1178440154, 0.1998901963, 0.2706094086, 0.3540653884, 0.417027235, -0.2698947489, -0.1693298221, 0.2886008322, 0.0005998352, -0.2072158456, -0.0614675879, 0.0971704274, 0.3210932314, 0.3959817886, 0.0738286823, 0.0143994251, -0.0085140783, 0.1275814921, -0.0613213629, -0.2382628918, 0.4723806679, -0.0463521853, -0.0918836072, -0.3303667009, 0.0329028815, -0.5663155317, 0.3297738433, 0.0595322847, 0.3573004603, -0.0106481267, -0.2045568973, -0.0199388918, -0.0656268448, 0.3586012423, 0.3856933117, 0.3740834892, -0.3091629446, -0.4248060584, -0.4309861064, 0.1581876427, 0.1639746726, -0.2411169261, 0.1070590541, 0.199896723, 0.2831843197, 0.2404056042, -0.1074828506, -0.2510269284, -0.0557260625, 0.1786379665, -0.2189368308, -0.2895004451, 0.2064398974, 0.0696632043, -0.1936568916, -0.2178904563, -0.1419937611, 0.0083855288, 0.0918040872, -0.1656749099, -0.3625208139, 0.147717163, 0.0822411701, -0.0218153968, -0.0256657898, 0.4474617541, 0.0580899641, -0.0019748651, -0.1832550317, -0.07431712, -0.1690217257, -0.2816381752, -0.1547073126, 0.5438708663, -0.2213324606, 0.2525570989, -0.3257878721, 0.2445083261, -0.133482486, 0.3438499272, -0.146602422, 0.0648298189, -0.4684083462, 0.3983725011, -0.1344811767, -0.0675859153, -0.0255530626, 0.1462188214, -0.4820400774, -0.2730075121, 0.5664796233, -0.5063452721, -0.2313734591, 0.0063173133, 0.215786919, -0.4116666913, 0.3354257047, -0.3584125042, -0.0386063345, 0.2855787277, -0.0673241392, -0.1444847435, 0.1655160487, -0.047609929, 0.1122500226, -0.0831058547, -0.5315560102, 0.0437984541, -0.1335094571, -0.1396401078, -0.2604456842 ]
https://github.com/huggingface/datasets/issues/507
Errors when I use
Looks like an issue with 3.0.2 transformers version. Works fine when I use "master" version of transformers.
I tried the following example code from https://huggingface.co/deepset/roberta-base-squad2 and got errors I am using **transformers 3.0.2** code . from transformers.pipelines import pipeline from transformers.modeling_auto import AutoModelForQuestionAnswering from transformers.tokenization_auto import AutoTokenizer model_name = "deepset/roberta-base-squad2" nlp = pipeline('question-answering', model=model_name, tokenizer=model_name) QA_input = { 'question': 'Why is model conversion important?', 'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.' } res = nlp(QA_input) The errors are : res = nlp(QA_input) File ".local/lib/python3.6/site-packages/transformers/pipelines.py", line 1316, in __call__ for s, e, score in zip(starts, ends, scores) File ".local/lib/python3.6/site-packages/transformers/pipelines.py", line 1316, in <listcomp> for s, e, score in zip(starts, ends, scores) KeyError: 0
17
Errors when I use I tried the following example code from https://huggingface.co/deepset/roberta-base-squad2 and got errors I am using **transformers 3.0.2** code . from transformers.pipelines import pipeline from transformers.modeling_auto import AutoModelForQuestionAnswering from transformers.tokenization_auto import AutoTokenizer model_name = "deepset/roberta-base-squad2" nlp = pipeline('question-answering', model=model_name, tokenizer=model_name) QA_input = { 'question': 'Why is model conversion important?', 'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.' } res = nlp(QA_input) The errors are : res = nlp(QA_input) File ".local/lib/python3.6/site-packages/transformers/pipelines.py", line 1316, in __call__ for s, e, score in zip(starts, ends, scores) File ".local/lib/python3.6/site-packages/transformers/pipelines.py", line 1316, in <listcomp> for s, e, score in zip(starts, ends, scores) KeyError: 0 Looks like an issue with 3.0.2 transformers version. Works fine when I use "master" version of transformers.
[ 0.1425897181, -0.3862658441, 0.1019001007, 0.2882792056, -0.0408771634, -0.0037297166, 0.3607889712, 0.2866318524, -0.232670635, -0.0361644551, 0.1111191735, 0.1749107689, -0.302010566, -0.1347764134, -0.1869152337, -0.2722382247, 0.2231003195, 0.164870277, -0.2249955982, -0.0755630061, -0.0981414318, 0.4294787943, -0.5823255777, 0.3994287848, -0.6540246606, 0.0634837225, -0.0976938829, -0.0882226303, 0.2179894894, -0.4048300683, 0.1664739996, -0.1379937381, 0.4408763349, 0.4950662851, -0.0001128557, 0.0662931874, 0.5166268349, 0.0034336958, -0.1831672788, -0.4616502523, -0.0958663896, -0.0216795169, 0.2401291877, -0.1488669068, 0.1099357754, -0.0095905978, 0.1123633161, 0.1161489487, 0.6158464551, 0.2604494393, 0.2036687136, 0.5679877996, 0.1606731266, -0.1586022079, 0.0386508368, 0.06511987, -0.1622347534, -0.2532222569, -0.0711852238, -0.1541244239, 0.0513455942, 0.3433676064, -0.1545830816, -0.319506824, 0.1965099275, -0.0248659533, 0.3771716654, -0.6403253078, 0.1768133938, 0.3447145522, -0.0220761932, 0.0297092292, -0.4338785708, -0.3709908426, -0.0477739014, 0.0846330523, 0.0715651438, -0.0575926267, -0.1082191244, -0.0320370942, -0.3570266366, 0.1110914648, -0.2577053905, -0.038713228, -0.0056883688, 0.729046464, -0.0043146322, 0.1154192537, 0.0263560358, -0.3988367021, 0.1119358763, -0.0886759162, -0.1108074933, 0.2810792625, -0.462384522, -0.4678978622, -0.1054502949, -0.0141508067, -0.1258595437, 0.1329766363, -0.0476351231, -0.0400706269, 0.1146947443, 0.0505963266, 0.2708026171, 0.3776749969, 0.3136992157, 0.3700651526, 0.3415609002, -0.0040864456, 0.1595463008, -0.0196937267, -0.488784641, -0.0226211101, 0.0947433189, 0.1682706475, 0.2845748961, -0.0403796546, 0.069582969, -0.0889550149, -0.2725495398, 0.030896971, 0.2877452672, 0.3125798404, 0.1607082933, 0.4081324935, -0.0442816764, 0.3618609607, -0.154091984, -0.4788371027, -0.048245322, -0.0248205885, -0.1305384636, 0.0259037018, 0.183268398, 0.3635362387, 0.2959644794, -0.3133233488, 0.1574113369, 0.1929112375, 0.0696850419, -0.2652226985, -0.1392059773, 0.2221941948, 0.0477909036, 0.1235281825, 0.273222208, -0.1546165794, -0.0269146357, 0.2888834178, -0.1526697725, -0.0730928034, 0.0382681452, 0.128095746, -0.1564270407, -0.2049595863, -0.1068507656, 0.1424415112, 0.2601507008, -0.0196883176, -0.1511560678, -0.2680459321, -0.0712297335, -0.0273504127, 0.0152342599, 0.4272626042, 0.1217840239, -0.2629702091, -0.0074935029, 0.1439886838, -0.105312936, 0.1660330296, -0.0594259873, 0.2397535145, -0.0067091673, 0.3142333627, 0.3387303352, -0.2347958982, 0.0610832013, 0.1511662155, -0.0109124957, -0.2349628508, 0.0558946319, -0.1820522994, 0.118311204, -0.2271659821, -0.0724465623, -0.140199393, 0.0083087888, 0.1611098349, -0.0977459252, -0.2160190046, -0.0398634337, 0.2065846771, 0.1662978828, 0.1019941121, -0.3797036111, 0.5313242674, -0.1683852822, -0.190780282, 0.1780087799, -0.0916160345, 0.4059319496, -0.2418595701, 0.0768682882, -0.1072883904, -0.2731472552, 0.2203313708, -0.4980216622, 0.1964554936, -0.0521729402, 0.2371753007, -0.1382564455, 0.0803375319, -0.1817129403, -0.0770960897, 0.1701810956, -0.0776245818, 0.159917593, 0.1136877164, -0.2996758819, -0.0866932794, 0.4864610434, 0.0755583346, -0.3800068796, 0.2390678376, -0.2562906742, -0.3221543133, -0.1728243381, 0.1800200343, 0.4133437276, 0.1605980247, -0.0603639744, 0.2198887169, -0.2134709656, -0.0920356065, -0.1008519679, 0.3315401077, 0.2418498993, -0.3857058287, 0.1534546912, 0.4965136051, 0.1735296994, 0.1489473134, 0.1390585303, 0.4117437601, 0.0490883961, 0.1475323439, 0.0893395469, 0.1436108202, 0.027317727, -0.1975851357, -0.1786640584, -0.0489500761, 0.0124959359, 0.0653673559, -0.0209298581, -0.308886081, 0.0854298323, -0.1901087612, 0.4991105497, -0.0220074784, 0.1619539708, 0.1475795209, -0.4284464121, 0.0409906469, -0.1600480676, 0.2272352427, 0.3109730184, 0.1093929932, -0.1593062282, 0.1008154973, -0.0423446782, -0.0339868739, 0.3302761018, 0.0721159279, 0.2826167941, 0.1288802177, 0.1914829165, 0.1401966959, 0.1415279806, -0.2043959945, -0.0989472717, 0.2039452195, -0.3245396614, 0.1887788475, 0.0387537479, 0.0697254315, -0.1371349394, -0.2431546748, -0.2385836691, -0.3978782296, 0.0922369733, 0.0347955674, 0.0489943512, 0.2307591885, 0.0914830118, 0.2400472909, 0.220337972, 0.4928337038, -0.0906586051, -0.0119177653, -0.4879198372, -0.0100957947, 0.0699661598, -0.5400472283, -0.0604564026, 0.0447767228, -0.0678850338, 0.294770211, -0.3794870973, 0.3721457124, -0.1519844979, 0.0831868872, 0.1768325567, -0.1078040823, -0.0183154847, -0.3880956471, 0.4292584658, -0.3619119823, -0.0171322338, 0.3871999681, 0.042326808, -0.1268578619, -0.2220816016, -0.0811969414, 0.0566206165, -0.1438730061, -0.0924248472, -0.1342324317, 0.1725475639, 0.4180764258, 0.0220333729, 0.4735863507, -0.2557697594, -0.1696811318, 0.1678783, 0.1819524914, 0.5343098044, -0.0216975156, -0.3780201077, 0.1458334178, -0.2738335729, -0.0258695204, -0.5093510151, -0.0553692095, -0.2531598806, -0.1245509461, -0.1565583944, 0.1502876878, 0.0557687096, 0.251553148, 0.0170896146, 0.00738212, 0.0466908887, -0.184088096, 0.1286098659, 0.2061228007, 0.3723757863, -0.0267046802, 0.4878304303, 0.1048068032, 0.6293375492, 0.3555672765, -0.0857292041, 0.1341521293, 0.0791090578, -0.2296401113, 0.0292941593, -0.2251011431, -0.3233568668, 0.0312586538, -0.0029997402, 0.1798374951, 0.0321978629, -0.2912759185, -0.1782680154, -0.1114206985, -0.1802409887, -0.2081421316, -0.1353159249, -0.1797331721, 0.1601635367, -0.2067036927, 0.2087402642, -0.2168800086, 0.0219855513, -0.0253863949, -0.0939735025, 0.0660039261, -0.1992715448, -0.4379246533, -0.1425549537, -0.2592297196, 0.4074146152, -0.120533295, 0.3221701682, -0.0108913975, -0.357421875, -0.0811125785, -0.1580726802, 0.6426006556, -0.1390681565, -0.17911461, 0.0867584497, -0.2970713377, -0.4907179177, -0.1606562585, -0.3340061903, 0.0472244807, 0.4098541737, 0.3750630319, -0.2564999461, -0.0656046718, 0.0633753091, -0.5187550187, -0.1749590784, 0.0412301719, -0.2884530127, 0.0803989545, -0.1542814076, -0.153499946, -0.0503886044, 0.1225496083, -0.1448914856, 0.1505255699, 0.1205115691, -0.2101486772, 0.0912975222, 0.4907371402, 0.0812811181, 0.0005750161, 0.0183104966, 0.2177859694, -0.0035040476, -0.1578534096, 0.0480021201, 0.2946723104, -0.3666608036, 0.2672852874, 0.195507437, 0.2901583314, 0.1951656938, -0.0157658979, 0.016765384, 0.0211581141, 0.2260187566, 0.1106334627, -0.3405203223, 0.3545122445, -0.01228505, -0.1532624066, 0.0581079125, 0.1402444392, -0.3238537312, 0.1420627981, -0.4734604061, 0.109842822, -0.1724623442, 0.6164480448, 0.0426821373, 0.9207698107, 0.1358616054, 0.0129353553, 0.0848220065, -0.0169214737, 0.5575107932, 0.1966556162, 0.1872055829, -0.4816448987, 0.21599105, 0.0224240627, 0.0545213744, 0.0828112215, 0.1604757756, -0.5252498984, 0.2450695187, -0.007060871, 0.1365508437, -0.0562596247, 0.158865869, 0.1024964303, -0.1845775396, -0.3168303668, 0.1592112035, 0.036369592, 0.2058603466, -0.0185141955, -0.2774509192, -0.1049806029, -0.3572993577, -0.1582357138, 0.3035013676, -0.1292399466, -0.0857650712, 0.70802176, 0.2028638124, 0.619736433, 0.5606235862, 0.5166891217, 0.0533595495, -0.401136905, -0.115120396, 0.0267617349, -0.0420549549, -0.1256859452, 0.0420055762, -0.0431938544, -0.1279366314, -0.2508963346, 0.0883572251, 0.1080322042, 0.1712241024, -0.1111460775, -0.0848676637, 0.1050738692, -0.1521770358, 0.0199647024, -0.1242934316, -0.0758297145, 0.0386435427, 0.1679321229, -0.0929524153, -0.3017588854, -0.2810384929, 0.1419223249, -0.0742098913, 0.2143647224, 0.3510376215, -0.0347988717, 0.3840598166, 0.6542610526, 0.0626150221, 0.1027647331, -0.1921771169, 0.2396256328, 0.0520181917, -0.6680753231, 0.1615443826, 0.0713286847, -0.403116256, 0.2372424453, 0.3277622759, 0.2234093547, 0.1068713292, -0.1623991281, 0.0089590019, -0.3093211651, 0.2055790126, 0.0101805292, -0.193335861, -0.1214147136, 0.0279888343, 0.1757920086, 0.1185591295, -0.3084102273, -0.1066323295, -0.4146067798, 0.0186442267, -0.400193572, -0.6514689922, 0.092246823, 0.040149726, 0.0978697017, -0.0025702962, -0.2797644734, -0.1697241962, -0.1700247824, 0.126395151, 0.3313118815, -0.2610853612, -0.2167738825, 0.0373910889, -0.0854639858, -0.147811994, 0.0160995573, 0.0890382379, 0.1297553331, 0.4998905659, 0.3431234062, 0.1461975873, -0.3304531574, 0.0130645679, -0.000932012, -0.1115223542, 0.3274610043, 0.1754571348, 0.0722926259, -0.0946315676, -0.3950278759, 0.2633701265, 0.2868725955, -0.0506986789, 0.3815040886, -0.4005307853, -0.0263226107, 0.0040736273, -0.1270410419, -0.0061294576, -0.1277552098, 0.0248197224, 0.0619148724, 0.1099876538, -0.2524787784, 0.1654845327, -0.1811101139, -0.1280917823, -0.1367942691, 0.2108072639, 0.0977660045, -0.0270174854, 0.2516926825, 0.1957517415, 0.5039553046, 0.1116126031, 0.2541822195, 0.2503439486, -0.1214848682, 0.1640227586, 0.3342101872, -0.4417218566, -0.0433262587, -0.2629716992, -0.1226978227, 0.2609669864, -0.2051961124, 0.2217998803, 0.3339411318, 0.0073815719, 0.002056855, 0.1150234416, 0.3605117202, -0.0688446686, -0.3044216633, -0.0567801557, 0.025882896, 0.1380684227, -0.5615829229, 0.1502881199, -0.1157251075, -0.4203843772, -0.2101981193, -0.1604301035, -0.3518051803, -0.2396865934, -0.1430503875, -0.1945391595, -0.2422722727, 0.0659593418, -0.2627653778, 0.0042385636, -0.0832626894, 0.4153213203, 0.1173381507, -0.1198252589, 0.3166151047, 0.2233850509, 0.1095569357, -0.0748656467, 0.33910954, 0.4798997343, 0.5285979509, -0.5117017627, 0.133742854, 0.0446160771, -0.1574284285, 0.3019143343, 0.1640597135, 0.1410886049, 0.3766637146, -0.0836732835, 0.0264849942, -0.1202348247, -0.0275305398, -0.3470246196, 0.3050812781, -0.0769745559, 0.6026286483, -0.1700720042, 0.0705298856, -0.0380330347, 0.0176380035, -0.6420900822, 0.2209083736, 0.2818740904, -0.0080036549, -0.0216584504, -0.0877610147, 0.0681823343, -0.1623541564, 0.3674946427, 0.3344618082, -0.2495414913, -0.3301181197, 0.0222447496, -0.2358271629, 0.1758075058, 0.0205821432, 0.2468531132, 0.17019099, 0.1396845877, 0.0877762213, 0.0432498418, -0.2119875699, -0.2127484232, -0.3202989399, 0.2325868905, -0.2264477015, 0.1626769304, 0.0917379186, 0.1630989313, 0.097038433, -0.1210402474, -0.0209504627, 0.1817313582, -0.041223418, 0.1883675009, 0.0586957745, 0.0324423239, 0.1596481353, -0.0109969778, 0.1578502357, 0.410209924, 0.1294572204, -0.1036413535, -0.1486012191, -0.219063133, -0.3594356775, -0.2469451874, -0.0665296614, 0.4473224282, -0.0367659628, -0.0715217516, -0.211365357, -0.2242803723, 0.0165896714, -0.1691883355, -0.3869923949, 0.161782667, -0.1489505917, 0.0543513894, -0.0128802899, -0.0906095058, -0.0042412956, -0.0085156448, -0.3282027245, 0.0023108174, 0.5907207131, -0.5755990148, -0.2532938421, -0.2007430494, 0.0924839601, -0.1720799357, -0.0598421209, -0.4238317311, -0.2063876688, 0.3250180483, -0.1363997608, -0.2507223189, 0.1785619259, 0.1819872856, -0.1021630913, -0.0824740753, 0.1303394586, 0.1093226299, -0.067694895, -0.0570606776, -0.0815464482 ]
https://github.com/huggingface/datasets/issues/501
Caching doesn't work for map (non-deterministic)
Thanks for reporting ! To store the cache file, we compute a hash of the function given in `.map`, using our own hashing function. The hash doesn't seem to stay the same over sessions for the tokenizer. Apparently this is because of the regex at `tokenizer.pat` is not well supported by our hashing function. I'm working on a fix
The caching functionality doesn't work reliably when tokenizing a dataset. Here's a small example to reproduce it. ```python import nlp import transformers def main(): ds = nlp.load_dataset("reddit", split="train[:500]") tokenizer = transformers.AutoTokenizer.from_pretrained("gpt2") def convert_to_features(example_batch): input_str = example_batch["body"] encodings = tokenizer(input_str, add_special_tokens=True, truncation=True) return encodings ds = ds.map(convert_to_features, batched=True) if __name__ == "__main__": main() ``` Roughly 3/10 times, this example recomputes the tokenization. Is this expected behaviour?
59
Caching doesn't work for map (non-deterministic) The caching functionality doesn't work reliably when tokenizing a dataset. Here's a small example to reproduce it. ```python import nlp import transformers def main(): ds = nlp.load_dataset("reddit", split="train[:500]") tokenizer = transformers.AutoTokenizer.from_pretrained("gpt2") def convert_to_features(example_batch): input_str = example_batch["body"] encodings = tokenizer(input_str, add_special_tokens=True, truncation=True) return encodings ds = ds.map(convert_to_features, batched=True) if __name__ == "__main__": main() ``` Roughly 3/10 times, this example recomputes the tokenization. Is this expected behaviour? Thanks for reporting ! To store the cache file, we compute a hash of the function given in `.map`, using our own hashing function. The hash doesn't seem to stay the same over sessions for the tokenizer. Apparently this is because of the regex at `tokenizer.pat` is not well supported by our hashing function. I'm working on a fix
[ -0.0136869382, 0.0475987457, 0.0673071817, -0.0456756279, 0.0919944346, -0.1835208386, 0.2613240778, 0.1327960491, 0.0008187375, -0.3439307809, 0.0885018408, 0.2487125397, -0.1410468817, -0.2732979357, 0.1312420219, 0.1709651798, 0.3097133636, 0.0441304967, 0.3055783212, -0.0806425065, -0.0654458925, -0.0272674374, -0.3542218804, -0.0297062509, -0.5633120537, 0.0520044304, -0.1355011463, -0.4004318118, 0.282710582, -0.391195029, 0.0991085842, 0.1787098944, -0.013468747, 0.2490126044, -0.0001165723, -0.1295523643, 0.3142707646, -0.0642246231, 0.2027626336, -0.1374648511, -0.1056157723, -0.3216924369, -0.1589990109, -0.0220345631, -0.0848208144, -0.2071924657, 0.2631584406, -0.1060146615, 0.5493525863, 0.0068811723, 0.1311335117, 0.1737996936, -0.1037610397, 0.3160277903, 0.0371428877, 0.0110692196, -0.1272768676, -0.2586754262, -0.1081208438, -0.3813348114, -0.4259676337, 0.1791104823, -0.1774555147, -0.1869014502, 0.2517659664, 0.2371277064, -0.059267845, -0.1703380644, 0.23430942, -0.1654308885, 0.4319825172, -0.2239156663, -0.2962218523, -0.0784380957, -0.279797703, -0.156718269, 0.4439509213, -0.086038433, -0.0714856312, 0.0591571741, -0.480079174, 0.1590325087, 0.1002614647, 0.0925735682, 0.0439991876, 0.5301561356, 0.08887887, 0.1097638309, -0.1824954301, -0.2295013964, -0.0440580621, -0.2285470068, -0.1261463612, 0.4742997885, -0.1523887664, -0.2847384214, 0.0262273774, -0.0800773278, 0.0544601604, 0.294821471, 0.0504118316, 0.2815189362, -0.0299814511, 0.2159365863, 0.0078934487, 0.5478120446, 0.1964377314, 0.4425429106, 0.1908516586, -0.558888495, -0.4889090955, -0.0812602788, -0.0298009384, 0.0343141332, 0.6790274978, 0.056127429, -0.3889098167, 0.0341379084, 0.1852827966, 0.0584527031, -0.3547097743, -0.1792826355, 0.0523777492, 0.2285992503, -0.1112919673, 0.0362102091, -0.5301238298, 0.0330119878, 0.0699479878, -0.1227096915, -0.2177217901, -0.1649402976, -0.4442879558, 0.2580899596, 0.1851160973, 0.4816354215, 0.2829697132, -0.1187249273, -0.1610898674, -0.1224142313, 0.1046065092, -0.2712717652, 0.4402399659, -0.0034611691, -0.3136522472, 0.1900180429, -0.0267267246, -0.0141047658, -0.3247201145, -0.0082998704, -0.0187004842, -0.0847290009, 0.4318653643, 0.0427010246, -0.2380243689, -0.1347655207, -0.0299304929, 0.2931548059, 0.5849563479, -0.2344620824, -0.0222433321, -0.0523845628, -0.3115319014, -0.3348664045, 0.1609576941, 0.2611805797, 0.2704749703, -0.2919741571, 0.4862924218, 0.3912272751, 0.3023073375, 0.5853937864, -0.1874111146, 0.1277574748, -0.078888379, 0.6074696183, 0.2261337787, -0.1387713104, -0.5778238773, 0.0163232107, 0.0931184068, 0.0922376662, -0.0854180902, -0.0514960811, 0.3476943076, -0.2769734561, 0.0319775119, 0.3163945973, 0.0487546958, 0.0056756916, -0.3302252293, -0.0635457188, 0.4362437725, -0.2102125883, 0.1992404014, -0.0479145311, -0.0353890918, 0.1872392893, -0.2263917923, 0.090761289, 0.2284287363, -0.049125988, 0.1635671854, -0.1805585325, 0.1260126382, -0.0757403821, -0.1877247691, 0.192046687, -0.1871372163, -0.1807709038, 0.0339367874, -0.1134049967, 0.1624482125, -0.1431270838, -0.0662778765, -0.2908812463, 0.1051157787, 0.111652866, 0.3874666393, 0.1515065134, -0.1465885192, 0.1243402138, 0.4645557106, 0.0119357966, 0.1125249416, -0.0979795381, 0.0455767401, -0.2353744656, -0.3090815544, 0.1631502807, 0.2418069839, 0.057264436, -0.1184215173, 0.162599206, -0.028849287, 0.214163959, -0.0700812489, 0.4044358432, 0.0787221491, -0.0859916583, 0.0643274114, 0.3019319475, -0.1264506429, -0.279617697, 0.0359571502, 0.4145943224, 0.5003684759, -0.0235093366, -0.1423832476, 0.055734124, 0.3090837598, -0.1524007767, -0.116899848, -0.1637312472, -0.0872416794, -0.0906471759, 0.1349385679, 0.0935458913, 0.0902765542, 0.1426399648, 0.398275584, -0.0260451417, 0.0850622281, 0.0565831289, -0.3832196593, -0.5182851553, 0.1002305225, -0.0206211694, 0.0375778265, 0.0057197777, 0.266020149, -0.0137694255, -0.1720895469, -0.1545708776, 0.1181880981, -0.0653093606, -0.2103813142, 0.1019192338, 0.1604082882, 0.3006860614, -0.1281340867, -0.1357729584, 0.2475645542, 0.0077800853, -0.053692624, 0.0689050853, -0.2456954867, 0.000573282, 0.2347133756, -0.0898357257, -0.2250189632, -0.217269212, -0.1392382383, 0.2956092358, 0.0359280221, 0.4442129731, -0.1402325034, 0.0842034966, -0.0456856377, -0.1548351943, -0.1630382091, -0.3049255908, -0.2561383247, -0.0947616771, 0.2327446193, -0.2959225774, 0.2157172859, -0.0149196927, 0.049557928, -0.1273158342, -0.3565972447, 0.1648928374, 0.0026209136, -0.08096762, -0.1507012248, -0.3412353992, -0.5605165362, -0.0347064324, 0.2581994832, -0.4532197118, -0.1404505968, 0.2224095166, 0.1876202971, -0.1044219509, 0.0156458747, 0.142836988, -0.0484268144, 0.0104426639, 0.1698829234, -0.0645510033, 0.0911722928, 0.4004302323, -0.2932041585, 0.0047203945, -0.4901484549, -0.1463359445, -0.3706043065, -0.2366396189, 0.7362603545, -0.1105462685, -0.0800714046, -0.0261623189, -0.1154208556, 0.2398851663, 0.5107489824, -0.1860036254, 0.1623385549, -0.0766510442, 0.1053573191, 0.0962622166, -0.3081245124, 0.3067165017, -0.0934619382, -0.0706833005, 0.0511957854, -0.1466672421, 0.143020317, 0.2608573437, 0.304993391, 0.2392118126, 0.0911073014, 0.3536168635, 0.8350925446, 0.0838099644, -0.1541403681, 0.1790554523, 0.2011923045, 0.0561242215, -0.1676304191, 0.0182381161, -0.0649662465, -0.1081263199, -0.0374110229, 0.1951101124, 0.1247865483, -0.4296414554, -0.075256981, -0.2870826721, -0.0773972645, -0.3653157949, 0.2314306647, -0.5263301134, 0.3536963165, 0.2522391677, 0.4212905467, -0.5082789063, -0.3702869117, 0.0515366308, -0.1205793992, 0.3768259585, 0.0275492333, -0.6036427617, 0.1598293334, -0.6390219331, 0.2254870087, -0.0314552151, 0.6086578369, -0.0492966399, -0.1263484061, -0.1125273854, -0.027352022, 0.3081947863, -0.3621613085, 0.1180665717, 0.1659588814, -0.2614372373, 0.0024890162, -0.1347979158, 0.036508739, 0.1394207925, 0.3713925779, 0.6505628228, -0.1984952092, -0.1003760546, -0.600076139, -0.0540399402, 0.064879939, -0.2873959243, 0.073463656, 0.3018552065, -0.1909437329, 0.0821540952, 0.191718176, -0.0974148139, 0.2428386658, -0.0313897915, -0.1940698475, -0.1073341519, 0.2325009406, 0.0415736958, 0.3474741876, -0.009896026, 0.2071542293, 0.2720627189, 0.1065755039, -0.2526547313, -0.3211754858, 0.2206670642, -0.2290357202, -0.0693347603, -0.0051420047, 0.2123203129, 0.1209625602, -0.0375124551, 0.0440715663, -0.148895666, -0.0146024339, -0.2373545915, 0.1671668738, 0.0833696201, 0.1954215914, -0.3794455826, -0.3263630271, 0.125812307, 0.1384030432, -0.1807433367, 0.2266243845, -0.3775850236, -0.446023047, 0.6914545894, 0.2273263037, 0.9793088436, 0.1366846114, 0.4066053331, -0.2610697448, 0.2454628944, 0.3961775303, -0.2034372389, 0.2705399692, -0.2106604129, 0.0620777309, -0.0508619472, -0.1326844841, 0.0091231978, 0.3172044158, -0.279760778, 0.3796658516, 0.1443433613, 0.8239809871, 0.1463344842, 0.0589599274, 0.0857707039, -0.2330420613, 0.2865397036, 0.1325598955, -0.0268877428, 0.2350764722, 0.0284592584, -0.091046378, 0.0394460484, 0.0768706203, -0.188970089, 0.0690725818, -0.2721971571, 0.1723410487, 0.1990003139, 0.0919736922, -0.0357409306, 0.1271829307, 0.3098223805, 0.1635273695, -0.2802835405, 0.0749829039, 0.3586247861, 0.201819241, -0.0096239261, -0.3221389353, 0.2645991743, 0.0702608824, 0.0540561192, -0.0745436028, -0.0545704179, -0.4214328229, -0.5006970763, -0.0484705605, 0.1182111949, -0.0697835088, 0.1867565215, 0.0447829477, -0.2054714113, -0.1329452991, 0.1166349053, 0.1708299816, -0.0546878316, 0.4148548245, -0.1348784268, -0.0356565528, 0.0283782836, 0.4033696353, -0.0007587051, -0.1859469861, 0.4934469759, -0.4574661255, -0.3638174534, -0.1566361934, -0.1653166711, -0.2013353854, -0.2225386798, -0.0625699684, -0.3878859878, -0.1972302049, 0.0375347622, 0.0448246971, 0.1629533023, 0.1089464277, -0.0389687717, -0.2716582417, -0.4200653136, -0.0641963407, -0.0288736969, 0.0158563312, -0.0422419123, 0.2786880136, -0.0310843382, 0.2577910125, -0.2614100873, -0.2017785162, 0.0711541921, 0.1786178946, -0.3131331801, -0.2629749179, 0.1178489402, -0.0698961169, -0.004026799, 0.3412353396, -0.3315978646, -0.1127352118, -0.0775686204, 0.1665164679, 0.3449390233, -0.182827726, -0.2137659043, 0.1694698036, 0.0159767382, -0.5175474882, -0.1979541481, 0.3084914386, 0.0102926455, 0.0097130528, 0.1756761521, 0.2858938575, 0.1375934631, -0.097506471, -0.0166269764, 0.0885633752, -0.0466826409, 0.2704512477, 0.0063901716, 0.028555382, -0.2647023201, 0.1746235341, 0.1920978725, -0.0426925644, 0.4463928342, -0.0728394166, -0.1335799247, 0.1615472585, -0.1888236851, 0.1849875897, 0.0214433409, -0.4864818156, 0.7638766766, 0.151097253, -0.0162993949, -0.0525912531, 0.3405268192, 0.1530587375, -0.0649228469, 0.0520947799, 0.4691826999, -0.0986260921, 0.0058946405, 0.0498069189, 0.578346014, -0.404741317, 0.1436865777, -0.1437253207, 0.0994395092, 0.1940863132, 0.3811709285, 0.076394774, 0.0855781808, 0.0542609282, 0.3561932445, 0.2328815907, 0.1432286352, 0.2286991179, -0.3098293841, -0.2425923645, -0.2123387009, 0.46491763, 0.0333406106, 0.5086619854, -0.1132325083, 0.2447831184, 0.1591771096, -0.1347515732, -0.2319494486, 0.3039995432, -0.2283732742, -0.2894880474, 0.1007911637, -0.0436236821, -0.150499925, 0.1539196521, -0.1167203188, 0.1253164262, 0.1442429423, -0.0083630923, -0.0354180597, 0.0300402846, 0.1455739886, -0.0579561591, 0.366691798, -0.3213553429, 0.2709103525, -0.4509085417, -0.1322084963, -0.183326751, 0.1297282428, 0.2746246159, 0.3292089701, -0.3230867386, 0.1327790171, -0.0697844028, 0.0578022785, -0.1904815435, 0.6730790138, 0.0656596646, -0.4936019778, 0.0241807848, -0.0414924175, -0.0289020352, -0.0774158761, 0.072883673, 0.0147571834, 0.1996297687, 0.4930049181, 0.0454483628, -0.1382015198, 0.2667307258, 0.0464600399, -0.2540114522, -0.0944357216, 0.1564906985, -0.0249840878, 0.2481472939, -0.252753526, 0.0736774355, -0.0742080063, 0.3581217229, 0.3809098601, -0.170943141, -0.2639421225, -0.0646265969, -0.4245132506, 0.4025981128, -0.0921911448, 0.2847804427, -0.232480526, 0.2075218409, -0.1105877161, -0.0049813092, -0.1382382959, 0.0578963198, -0.3202582598, 0.0850497484, -0.1461157501, 0.420227319, -0.1469529271, 0.2991519868, 0.1546773463, -0.3179662824, 0.2920419574, -0.0085771699, 0.1318595409, -0.0959045812, -0.0870147124, 0.0377330706, 0.2726811469, 0.5620135069, 0.2327576578, 0.0872581676, 0.0696964562, 0.1894725859, -0.3747024536, 0.0216691457, -0.0565684438, -0.0297163017, -0.1354916543, 0.1955699623, -0.3513375223, 0.1786047071, -0.1632317454, 0.002596095, 0.044998724, -0.4295821786, -0.0499904938, -0.050692413, -0.1909505278, -0.0292213298, 0.0003643878, 0.3448745608, -0.1746666133, 0.2510062456, -0.3981538117, -0.2146266848, 0.2298821956, -0.6583092809, -0.4971137345, -0.0440976769, 0.0841890424, 0.4080102146, 0.0069482462, -0.296682775, -0.215778023, 0.276168406, 0.0777905956, -0.2484918237, -0.1016387567, 0.0264707301, -0.1246339455, -0.2842132747, 0.2960051298, -0.0015486341, -0.2540476024, 0.0405077338, -0.0360092297 ]
https://github.com/huggingface/datasets/issues/492
nlp.Features does not distinguish between nullable and non-nullable types in PyArrow schema
In 0.4.0, the assertion in `concatenate_datasets ` is on the features, and not the schema. Could you try to update `nlp` ? Also, since 0.4.0, you can use `dset_wikipedia.cast_(dset_books.features)` to avoid the schema cast hack.
Here's the code I'm trying to run: ```python dset_wikipedia = nlp.load_dataset("wikipedia", "20200501.en", split="train", cache_dir=args.cache_dir) dset_wikipedia.drop(columns=["title"]) dset_wikipedia.features.pop("title") dset_books = nlp.load_dataset("bookcorpus", split="train", cache_dir=args.cache_dir) dset = nlp.concatenate_datasets([dset_wikipedia, dset_books]) ``` This fails because they have different schemas, despite having identical features. ```python assert dset_wikipedia.features == dset_books.features # True assert dset_wikipedia._data.schema == dset_books._data.schema # False ``` The Wikipedia dataset has 'text: string', while the BookCorpus dataset has 'text: string not null'. Currently I hack together a working schema match with the following line, but it would be better if this was handled in Features themselves. ```python dset_wikipedia._data = dset_wikipedia.data.cast(dset_books._data.schema) ```
35
nlp.Features does not distinguish between nullable and non-nullable types in PyArrow schema Here's the code I'm trying to run: ```python dset_wikipedia = nlp.load_dataset("wikipedia", "20200501.en", split="train", cache_dir=args.cache_dir) dset_wikipedia.drop(columns=["title"]) dset_wikipedia.features.pop("title") dset_books = nlp.load_dataset("bookcorpus", split="train", cache_dir=args.cache_dir) dset = nlp.concatenate_datasets([dset_wikipedia, dset_books]) ``` This fails because they have different schemas, despite having identical features. ```python assert dset_wikipedia.features == dset_books.features # True assert dset_wikipedia._data.schema == dset_books._data.schema # False ``` The Wikipedia dataset has 'text: string', while the BookCorpus dataset has 'text: string not null'. Currently I hack together a working schema match with the following line, but it would be better if this was handled in Features themselves. ```python dset_wikipedia._data = dset_wikipedia.data.cast(dset_books._data.schema) ``` In 0.4.0, the assertion in `concatenate_datasets ` is on the features, and not the schema. Could you try to update `nlp` ? Also, since 0.4.0, you can use `dset_wikipedia.cast_(dset_books.features)` to avoid the schema cast hack.
[ -0.0643966347, 0.117325291, 0.0268086866, 0.125269264, 0.1567069739, -0.0773079544, 0.3404871821, 0.1692481488, -0.3219613731, -0.3533985317, 0.0765750334, 0.3673613966, -0.0683542341, 0.3275822699, 0.0926478654, -0.0278014205, 0.2022664398, 0.2302503884, 0.0969585627, -0.0026241145, -0.0930331349, 0.1811446697, -0.3965626955, 0.0402222797, -0.59026438, 0.2065487951, -0.0333004333, -0.0195062608, -0.1387541294, -0.5088024735, 0.3443302214, 0.2019739896, -0.1002951786, 0.3447963595, -0.0001246, -0.1214664578, 0.5814360976, -0.1061939597, -0.1357244104, -0.1315977275, -0.1061728969, -0.3342745304, 0.1451297402, -0.1840591282, 0.0441185012, -0.1426274776, -0.0075731799, 0.3041885495, -0.5539481044, 0.2694934309, 0.0474010557, 0.5145811439, 0.4430458844, 0.2505993545, 0.3381247818, 0.0039451611, -0.163337931, 0.0774530545, -0.2217180878, -0.2308961302, 0.2946070731, -0.0040898523, -0.3032650352, -0.286206007, 0.1892204434, 0.0053236913, 0.0360978357, -0.1486216635, -0.132795155, 0.4225977659, 0.4490502179, -0.2722760439, -0.3485790193, -0.2052142173, 0.0249234904, -0.2226938903, 0.3266035914, 0.4107819796, 0.0495450981, 0.0445896946, -0.4404839277, 0.1101493314, -0.1068294123, 0.2732966244, -0.3308848739, 0.3821589947, 0.4234021902, 0.1096608639, 0.0128079467, -0.1292209029, 0.2586252689, -0.3746067882, -0.0194231942, 0.1626720577, -0.2908120453, -0.1841999292, -0.2253863662, 0.0221125614, 0.430544585, -0.0290176962, -0.1455559582, 0.0746989548, -0.1401954442, 0.1076272577, 0.1945331097, 0.2544100881, 0.223978579, -0.104213573, 0.0038689545, 0.0767959654, -0.2166543305, 0.2659809291, 0.2274273485, -0.2757503986, 0.0893797427, -0.0405188985, 0.5651301742, -0.0694722831, -0.3042341173, 0.0565478988, -0.7364639044, -0.1235803589, 0.1029143333, -0.0402495787, -0.0763520151, 0.449123174, 0.0586434305, 0.3635566831, -0.1976959407, -0.3798346817, -0.0722628385, 0.0145609211, 0.0162054207, 0.0611522794, 0.1437863111, 0.0790430233, 0.1670466214, -0.0208610017, -0.410207659, 0.2052232623, -0.2113886774, -0.1676450074, -0.148906365, 0.0289781876, -0.2191666216, -0.360261023, 0.0156738162, -0.3502401412, -0.2368438244, 0.1533396542, -0.0034026853, -0.3047696352, -0.2618935704, 0.0320936479, -0.3846156299, -0.1074058339, -0.0526563227, 0.3227862716, 0.2190195173, -0.0189927835, 0.0711324587, -0.1152547672, -0.0018660476, -0.2445028424, 0.1468637735, 0.1550917923, -0.0509334728, -0.0164898001, 0.1121344939, -0.1654555053, -0.0499181747, 0.2630228698, -0.0839522928, 0.0946981534, -0.167056486, 0.439861089, 0.3568459153, -0.0073684938, -0.0031483378, 0.0458447933, 0.268974781, 0.0852904767, 0.1107115373, 0.0083124293, -0.3739367723, 0.0349343121, -0.0445478559, 0.3406246603, -0.0643278137, -0.1324492097, -0.2004014254, -0.3290830255, 0.6721144319, -0.1642892808, -0.0742962211, 0.1388434768, -0.0933731273, 0.2371651083, 0.3771463633, -0.239336133, -0.1351752579, -0.032039158, 0.2976108193, 0.2248857617, -0.3573705852, -0.324531585, -0.6215190291, 0.115312852, -0.2744534016, 0.5649374127, -0.0713172406, -0.3467868865, -0.022643473, 0.1168042049, 0.1842118204, 0.0491240881, 0.050241299, 0.132067427, 0.0034756612, 0.2040453404, -0.017224554, -0.0341619439, -0.0021857203, 0.0743369907, -0.1543971151, 0.5079222322, -0.0508014709, -0.2447683811, 0.011601354, 0.5782470703, 0.2310596555, 0.0018773883, 0.0209860727, 0.2861754596, -0.0210090596, 0.0169909485, -0.1841737181, 0.3597713709, 0.0103444178, -0.1082134172, -0.1197344959, 0.2958288491, 0.0824740082, -0.0362321362, 0.1069774032, 0.5403357148, 0.0890616924, -0.127482608, 0.2386866361, -0.0310111195, 0.0641217157, -0.1456840485, -0.0917195156, -0.0687634498, 0.1033112407, -0.0297113154, -0.3782559335, 0.4686180651, -0.5818826556, -0.1038342714, 0.4880425036, -0.1803922951, 0.2012022883, -0.1890500933, -0.1980809718, 0.0216360725, 0.3691529632, -0.3686347306, 0.164269805, 0.1738227904, 0.0248237643, 0.0485815592, -0.3041327298, 0.0645629987, 0.3759590685, -0.0363255478, 0.1276260465, -0.0101233739, 0.2944432497, -0.2063153535, -0.3622221649, 0.1404732466, 0.1248607263, -0.0001578869, -0.3340364993, -0.008838987, -0.364141196, -0.0675909594, -0.439920336, -0.2286159694, -0.5033981204, -0.431835115, -0.1480877995, 0.7034395933, 0.004324683, 0.2784733176, -0.6784131527, -0.2246827483, 0.0438680984, -0.2637730837, -0.0135058956, 0.0479041077, -0.193264991, -0.089190565, 0.2925308347, 0.1887555122, -0.2067159712, 0.0206947662, -0.1609642506, -0.2025877535, -0.7249016166, 0.0783891752, -0.3375946879, 0.0019907143, 0.2957774699, -0.0846199021, 0.1590904295, -0.3467278183, 0.1459012479, 0.1718693972, -0.4136031568, 0.4664399028, 0.0333243385, -0.2877025008, -0.0089314049, -0.2185088396, -0.0588836595, -0.2434384078, 0.2334794998, -0.0135716638, 0.0751472786, 0.4313395619, 0.0159303229, 0.0507931672, -0.147309795, -0.0440621898, 0.0670359284, 0.4366899729, 0.4299980402, 0.2493713498, -0.1570455581, 0.1447860599, -0.2302630246, -0.1630173773, 0.2447803319, 0.0009892584, -0.1102874652, -0.1580322832, 0.5572420359, 0.2054719329, -0.5082902908, 0.3505128622, 0.4187278152, 0.0752615109, 0.0139181996, -0.2324430197, -0.0090984497, 0.4431093037, 0.2931429744, 0.0866401196, -0.1674502939, 0.1715908498, 0.0524890721, -0.0354900062, -0.2688117623, 0.5545905232, -0.1980313659, -0.0067359009, 0.1651453376, -0.0011851949, -0.1469269842, 0.0155077958, 0.2795689404, 0.1951108724, -0.2452468425, -0.2343915403, 0.1371358931, 0.1229930744, -0.1862457395, -0.1444646269, 0.1335588545, -0.3576016128, 0.3650504053, -0.0697128177, -0.1677853614, -0.1720569879, -0.424606055, -0.0249863304, 0.1461026371, -0.0582431667, 0.1105494723, -0.6636126041, -0.0515172966, -0.0062468555, 0.3996483386, 0.1919799596, 0.5644323826, 0.2260038108, -0.4211958647, -0.1715792418, -0.1437279433, 0.5449908972, 0.0099100033, -0.1428055614, 0.2944712937, 0.2399407774, -0.2892708778, -0.278544873, 0.0273510367, 0.1203588769, 0.3569136858, 0.2400013655, -0.5941352844, -0.2463476658, 0.3794513941, 0.282028228, 0.0303243529, -0.0314475819, -0.1235700548, 0.0520264544, 0.0594212897, -0.1702726483, -0.0757286549, 0.3546293974, -0.383692205, 0.0351623744, -0.3101993799, -0.0964164212, 0.1639786512, 0.3305375576, 0.3377701044, -0.316493094, 0.0744249895, -0.3892458379, 0.1455590874, 0.1262892783, 0.3810681701, 0.3967330754, -0.4478459358, -0.4655649066, 0.115903534, 0.3578380942, -0.027673861, 0.1747051179, 0.288618058, -0.2007166594, -0.2645503879, -0.1983754635, -0.0289642196, 0.413341701, -0.0997609869, -0.1146217957, -0.0649422854, 0.5096232891, 0.0212693103, 0.1219206601, -0.5886439681, 0.2646945417, -0.4755286574, 0.2535639107, -0.1144698784, 0.9977650642, 0.1156836525, 0.1002286077, 0.2691832483, 0.1657367051, 0.5099567771, 0.0075565875, 0.1577659696, -0.3320661783, 0.2349309325, -0.1403215975, -0.2033419311, 0.1893981546, 0.2155362219, -0.2847734094, 0.209984988, -0.0445334837, 0.0899681598, -0.0312904492, 0.2504956722, 0.0605232194, 0.2865280807, -0.3072866201, -0.0948878154, -0.0923761055, 0.0832218677, 0.063409254, -0.2093323022, -0.3941884041, -0.1552626491, 0.0115260789, 0.1810256392, 0.0728997663, 0.0601831935, 0.4171119034, -0.2120635808, -0.031806048, 0.2774351537, -0.0092722429, -0.2507451773, -0.0398265719, -0.0581837371, 0.2255806923, -0.1509781778, 0.1982781142, -0.1155574545, 0.2459986657, 0.1325126886, -0.3227515519, -0.1154308766, -0.1396712214, -0.1983370185, -0.1088743806, -0.1120207161, 0.0315252021, -0.1432554424, -0.1874488592, 0.0321698114, -0.0815729201, -0.0831204727, -0.0252199247, -0.2151886523, -0.0778529719, 0.0383993201, 0.0380340964, -0.1525836885, 0.0448343717, 0.2418370396, 0.2376708239, 0.5448002815, 0.463774085, 0.0376264751, -0.0040661739, 0.0038766917, -0.2874628901, -0.2303061634, -0.3807948232, -0.1140154973, -0.0650246292, -0.1488630772, -0.1858002096, 0.6646894813, 0.0446057469, 0.2915355861, 0.0867568552, -0.1546984017, -0.0842447802, 0.3814485967, 0.2085343599, 0.2213027179, 0.0042424113, 0.5544478297, 0.151705265, 0.0485914946, -0.1127221733, -0.0973061249, -0.3818843365, 0.2463038564, 0.1525015533, -0.073793292, -0.1864910722, -0.3309206963, 0.0815939158, -0.2978517413, 0.1310171038, 0.0108478041, -0.0611112528, 0.2071422487, 0.3853250444, 0.0462935679, 0.043472793, 0.0189265292, 0.301946938, -0.1228422672, -0.1633670181, 0.1167984903, -0.1509328038, 0.3340254426, 0.3067085743, 0.2679738104, -0.3899147809, 0.0454357676, -0.1173836663, -0.0730446279, -0.0132275, 0.3408550918, 0.019568814, 0.1627983749, -0.0384200811, 0.1229010001, -0.0323860198, 0.092969276, -0.0094259558, -0.1149351895, -0.3325375915, -0.0618075691, -0.0192696936, 0.419944644, -0.0150181586, -0.2145323008, 0.3441825211, 0.0217386391, -0.4045165479, -0.0563259535, 0.1963020861, -0.3276657462, 0.0297583956, 0.14096798, 0.4163489342, 0.2480726838, -0.3645543456, 0.1151565164, 0.0950259641, 0.0422366634, 0.2047932595, 0.2129473835, -0.015564614, 0.1771937162, 0.4805327654, -0.0208507478, 0.0870035663, -0.1591029763, 0.4040465653, 0.1797992736, 0.0218495727, -0.1859678477, 0.431891799, 0.1254312396, -0.3001897037, 0.1034144834, 0.4830493629, 0.0874409005, 0.1706006974, 0.3680463135, 0.0489861071, -0.2632357478, -0.164634645, 0.0922514647, -0.118209146, -0.1279557347, -0.2326813042, -0.2687023878, -0.1262547374, -0.1826535463, 0.0351068303, -0.1847103685, 0.5446305871, 0.0857568383, -0.0871321708, -0.3670358062, 0.3395571113, 0.2477975339, 0.1671563983, -0.2275748849, 0.0550817885, 0.0380384512, -0.2480459511, 0.2264215052, 0.3592939973, 0.2917851508, 0.326356262, -0.3158449233, -0.3911435604, 0.019301625, 0.0295351949, 0.0963334665, 0.0056228372, -0.0832958296, 0.1238267645, 0.1970172524, -0.0187275484, 0.0856878161, -0.0020506021, -0.0753248036, -0.2528960109, -0.3066675365, 0.5929839611, -0.0182350148, -0.3518258035, 0.0388036147, 0.0725443363, -0.0117433947, -0.1955388486, 0.1793351322, 0.2753737867, 0.2146022469, 0.0860149413, 0.0115740085, 0.1936457604, 0.159018904, 0.095880881, 0.1392927915, -0.0169130638, 0.1692792326, -0.4543946683, 0.024960734, -0.0521978103, -0.2102269381, 0.0804067105, 0.3008456528, 0.0454500504, 0.0251689944, -0.3979480565, -0.0292958897, 0.2426879257, -0.025051346, -0.2467200309, -0.1098272204, 0.2442294061, -0.3090699911, -0.2742751837, -0.300370127, 0.378336966, -0.2326953113, -0.0584373176, -0.0080523854, 0.1860942394, 0.4821603596, 0.3097613156, -0.0155441687, -0.0004677814, 0.7240968347, 0.0777881518, -0.0391621888, -0.276391238, -0.143150419, -0.4282416999, 0.2060938776, -0.2975786626, 0.2209626734, -0.0779447854, 0.5272227526, 0.0625875741, 0.514811635, -0.1245447546, -0.2223354429, 0.0077807684, 0.2017614841, -0.374904573, 0.0519042537, 0.1074223295, 0.0230159797, -0.0262649301, 0.0595198087, -0.0937539265, -0.4693760872, 0.1555231065, -0.1344611943, -0.2337855697, 0.0266511813, -0.0185008626, 0.1400678903, 0.0730232, -0.4839622676, -0.2024588138, 0.3920608163, 0.0701856241, 0.0771595463, 0.1648247391, 0.1535688937, -0.1244246289, -0.1648195833, -0.0260822009, -0.2262388766, -0.0990438536, -0.0559798181, -0.0403769016 ]
https://github.com/huggingface/datasets/issues/492
nlp.Features does not distinguish between nullable and non-nullable types in PyArrow schema
I'm using the master branch. The assertion failure comes from the underlying `pa.concat_tables()`, which is in the pyarrow package. That method does check schemas. Since `features.type` does not contain information about nullable vs non-nullable features, the `cast_()` method won't resolve the schema mismatch. There is information in a schema which is not stored in features.
Here's the code I'm trying to run: ```python dset_wikipedia = nlp.load_dataset("wikipedia", "20200501.en", split="train", cache_dir=args.cache_dir) dset_wikipedia.drop(columns=["title"]) dset_wikipedia.features.pop("title") dset_books = nlp.load_dataset("bookcorpus", split="train", cache_dir=args.cache_dir) dset = nlp.concatenate_datasets([dset_wikipedia, dset_books]) ``` This fails because they have different schemas, despite having identical features. ```python assert dset_wikipedia.features == dset_books.features # True assert dset_wikipedia._data.schema == dset_books._data.schema # False ``` The Wikipedia dataset has 'text: string', while the BookCorpus dataset has 'text: string not null'. Currently I hack together a working schema match with the following line, but it would be better if this was handled in Features themselves. ```python dset_wikipedia._data = dset_wikipedia.data.cast(dset_books._data.schema) ```
55
nlp.Features does not distinguish between nullable and non-nullable types in PyArrow schema Here's the code I'm trying to run: ```python dset_wikipedia = nlp.load_dataset("wikipedia", "20200501.en", split="train", cache_dir=args.cache_dir) dset_wikipedia.drop(columns=["title"]) dset_wikipedia.features.pop("title") dset_books = nlp.load_dataset("bookcorpus", split="train", cache_dir=args.cache_dir) dset = nlp.concatenate_datasets([dset_wikipedia, dset_books]) ``` This fails because they have different schemas, despite having identical features. ```python assert dset_wikipedia.features == dset_books.features # True assert dset_wikipedia._data.schema == dset_books._data.schema # False ``` The Wikipedia dataset has 'text: string', while the BookCorpus dataset has 'text: string not null'. Currently I hack together a working schema match with the following line, but it would be better if this was handled in Features themselves. ```python dset_wikipedia._data = dset_wikipedia.data.cast(dset_books._data.schema) ``` I'm using the master branch. The assertion failure comes from the underlying `pa.concat_tables()`, which is in the pyarrow package. That method does check schemas. Since `features.type` does not contain information about nullable vs non-nullable features, the `cast_()` method won't resolve the schema mismatch. There is information in a schema which is not stored in features.
[ -0.0000325803, 0.0538681895, 0.0309729651, 0.1527774632, 0.1315413713, -0.0097020632, 0.2905563712, 0.1126791313, -0.4240896404, -0.3221019208, 0.1324172765, 0.3009295166, 0.0746789351, 0.2184076607, 0.0105954148, 0.0620800629, 0.1866664439, 0.1985079646, 0.1221267879, 0.0144805778, -0.0328485258, 0.1648803651, -0.3214722574, 0.0625458136, -0.619638741, 0.2229528278, 0.0357410461, -0.0196783748, -0.1147864386, -0.4618892968, 0.3706982434, 0.1314746439, -0.1188881323, 0.3580965996, -0.0001218364, -0.0039293538, 0.448420167, -0.1272721887, -0.0842165425, -0.0493641123, -0.1476017088, -0.3369846046, 0.0708869472, -0.150624603, 0.067857109, -0.0325275511, -0.0610251762, 0.3406125605, -0.4604621828, 0.1814391464, 0.0470485426, 0.5140044689, 0.4450062811, 0.2114942223, 0.396432519, -0.0114497738, -0.1496788412, 0.1629149318, -0.2344383597, -0.1761413515, 0.3071683049, -0.044736959, -0.335534364, -0.246884793, 0.0919779316, -0.002242509, 0.0193525963, -0.0927106738, -0.215449214, 0.4014586806, 0.3250854015, -0.3767763674, -0.3620738089, -0.2539633512, -0.0721922144, -0.0025717048, 0.3222018778, 0.4332792759, -0.0434093438, 0.0893692747, -0.390694201, 0.1698398292, -0.0055580991, 0.0199998654, -0.3756795526, 0.2791658044, 0.4180592, 0.1256666332, -0.0578125305, -0.0325819701, 0.2527776957, -0.3134332299, 0.0239156913, 0.0500919484, -0.4031195939, -0.1911040843, -0.1240609288, -0.1303991973, 0.4479849637, -0.0571688786, 0.0196363013, 0.048737064, -0.0874168575, 0.1509540379, 0.1608292609, 0.2469572872, 0.0690923631, -0.0032205535, -0.0491847731, 0.0776771083, -0.2310603708, 0.2671503127, 0.2664993703, -0.2722823918, 0.1462373435, 0.0156127866, 0.5298163891, -0.1942781061, -0.3017011285, 0.156792596, -0.7380691767, -0.1070709974, 0.0951362699, -0.0827219933, -0.0859726667, 0.437561959, 0.0231686439, 0.375118494, -0.1258004904, -0.3113955557, -0.0775918663, -0.0183431692, 0.018544171, 0.0074304249, 0.1500351578, 0.1472896636, 0.1175244898, -0.0058651888, -0.389293313, 0.2003888041, -0.2125387043, -0.1689076126, -0.0529311411, 0.112757273, -0.1986382902, -0.342456013, 0.074859038, -0.2692536712, -0.2956695557, 0.1489870101, -0.0504912063, -0.2925232053, -0.0487851836, 0.0491825081, -0.4548961818, -0.0138570955, -0.0014936851, 0.1368767172, 0.1710844487, -0.0737833157, 0.1213527694, -0.1454530656, 0.0488347411, -0.3303681314, 0.2274911255, 0.0074433535, -0.1383930594, 0.0149262743, 0.2834968567, -0.2184306681, -0.0481669642, 0.285407871, 0.0083050104, 0.1808184832, -0.1705976874, 0.5086683035, 0.2644162476, 0.0803470835, -0.0301597472, -0.0841614306, 0.24822025, 0.1521852463, 0.1921497434, 0.0378293209, -0.4064252675, -0.0462311506, -0.0138712432, 0.3398265541, -0.1373072267, -0.1272160262, -0.2157676071, -0.2559674084, 0.5326585174, -0.0319035724, -0.172197789, 0.0755650848, -0.0281261597, 0.2179976702, 0.277977556, -0.22563155, -0.2787723243, 0.0033529031, 0.188836813, 0.1972594857, -0.3089709878, -0.2877030671, -0.4605284631, 0.1879185885, -0.3435060978, 0.5599390864, -0.2155991048, -0.3793884516, -0.021596957, 0.2495397627, 0.2796551287, 0.154274568, 0.0767218396, 0.183929354, 0.1065374613, 0.1507074833, 0.043337848, -0.0635330006, -0.0650917515, 0.0893570259, -0.237257123, 0.4350222647, -0.0643315986, -0.2545844018, -0.0205402263, 0.5571243763, 0.1251187474, 0.0465454012, 0.0292412154, 0.2860118151, -0.0419968404, -0.0050190296, -0.2008780092, 0.2961167991, -0.1280409694, -0.1656190902, -0.2111012191, 0.2149005085, 0.0744986013, -0.0052276175, 0.1057889313, 0.4875391126, 0.0662073269, -0.0467138588, 0.215747714, -0.1068634614, -0.0017401089, -0.0956155658, -0.0844759792, 0.0191744175, 0.2111938, 0.2053702027, -0.5470693707, 0.5216994286, -0.4695623815, -0.0886456147, 0.5151797533, -0.2779281437, 0.2281653285, -0.2124316543, -0.134604156, 0.1312164068, 0.3989613652, -0.3695646822, 0.1940737665, 0.1023910493, 0.0288282689, 0.0448636524, -0.3958708644, 0.0651666448, 0.2654563487, 0.0423329212, 0.0381111838, 0.0511462316, 0.2779502571, -0.1112805456, -0.2664991021, 0.18187958, 0.0312791429, -0.1044892967, -0.370256722, 0.0883169174, -0.364700228, -0.0115044573, -0.3589562774, -0.2359386384, -0.5129184127, -0.3944702148, -0.0359415002, 0.5990915298, -0.0506063178, 0.2528382242, -0.69565624, -0.2696458399, 0.0114536295, -0.4257436991, 0.051118046, -0.0740271136, -0.1123213172, -0.059515357, 0.2943380177, 0.1861013621, -0.2042572647, -0.1255380511, -0.1582054943, -0.1919831485, -0.6355778575, 0.1859966069, -0.4187496603, 0.0109840082, 0.3473017812, -0.1060536653, 0.1912699938, -0.3261115253, 0.1868240237, 0.1711117029, -0.411740005, 0.5654466748, 0.066907458, -0.3507684469, 0.0160051752, -0.1678056121, -0.0840316787, -0.2349207699, 0.2703925073, -0.0993291065, 0.0352935269, 0.2802295983, 0.0138520356, 0.0089080436, -0.2474103719, 0.1114725173, 0.0248689204, 0.3900653422, 0.3563612998, 0.3765405416, -0.1372018307, 0.1883706301, -0.3040184379, -0.1588795334, 0.2909481525, -0.0703082606, -0.1315321326, -0.1706428677, 0.6069603562, 0.1364934295, -0.453155607, 0.323997587, 0.4185803533, 0.0673284456, 0.0007435443, -0.1860944927, -0.0540758036, 0.4165588617, 0.2537943721, 0.03504676, -0.1258541793, 0.1467142254, 0.059012305, -0.0642357916, -0.225723654, 0.5036703348, -0.2651816905, 0.0297762416, 0.1756279767, 0.066186294, -0.1662022769, -0.0177923311, 0.0821507871, 0.1531199068, -0.2464073449, -0.1709889174, 0.0917297378, 0.1066621616, -0.1533647627, -0.278604269, 0.2364922464, -0.2413660437, 0.3538046181, -0.040127553, -0.1589077115, -0.1880382001, -0.3680247366, -0.0109518291, 0.0784582496, -0.0820760131, 0.0958490297, -0.6450896263, -0.3294064999, 0.0752368048, 0.3648805022, 0.2579320967, 0.5744529366, 0.1310129166, -0.4348480403, -0.2196395993, -0.0917119235, 0.5359677076, -0.0084522683, -0.0384455509, 0.2916203439, 0.2740375698, -0.2739706635, -0.2968041003, -0.0802818686, 0.0834853798, 0.2472428828, 0.1379488111, -0.6362395883, -0.1290539205, 0.2843504846, 0.3965993822, 0.100020431, 0.0278413985, -0.2355177701, 0.01231464, -0.0486453362, -0.1425989419, 0.0284252334, 0.2278538644, -0.3272437751, 0.0632215217, -0.3245686889, 0.021355696, 0.1703503877, 0.480537802, 0.2850092053, -0.3363885581, 0.0398549139, -0.4539274871, 0.2034313232, 0.1072441489, 0.5703109503, 0.5020773411, -0.5287027359, -0.3886255324, 0.1841166019, 0.3425621986, -0.0465762727, 0.0925027356, 0.1649520397, -0.1543334723, -0.2554901838, -0.2398648113, -0.0500077121, 0.3597531319, -0.030898096, -0.1070576683, 0.0278354511, 0.4318612516, 0.1585472375, 0.0956576765, -0.6823592186, 0.2394421399, -0.4008051455, 0.2723212838, -0.0476906374, 0.9379636049, 0.1299597919, 0.0923515409, 0.3337063193, 0.2017403394, 0.4809493423, -0.0183208995, 0.1827782989, -0.2460652888, -0.011340471, -0.1870482862, -0.2756963372, 0.073389031, 0.1745607853, -0.2565913796, 0.3026056886, 0.0013166515, 0.1466768831, 0.0686988458, 0.1166918129, -0.0081485026, 0.3080257773, -0.3076502383, -0.0825602561, -0.0876130238, 0.0282525644, 0.1045907289, -0.1090519056, -0.5096396804, -0.1694667041, 0.0002235875, 0.1846587658, -0.0328264274, 0.0137884561, 0.3616640866, -0.1149209812, -0.1352646202, 0.1706982106, -0.0022500688, -0.2959180772, 0.0176627655, -0.0759265274, 0.2719799876, -0.0784946457, 0.304795295, -0.0825137347, 0.3430139124, 0.1229276881, -0.3146331012, -0.0677115545, -0.2235834002, -0.1790148169, -0.0821910575, -0.153321743, 0.0760865882, -0.2540958524, -0.1125235632, -0.1276059598, -0.1201349795, -0.0320298709, -0.0108246095, -0.1855924875, -0.0641233772, 0.146343559, -0.0642078891, -0.1906721145, 0.0457103513, 0.1047871113, 0.1875717193, 0.6064355969, 0.3791363537, -0.0399998799, 0.0133005641, 0.0572320111, -0.3177098036, -0.3002565205, -0.4511319399, -0.1510188729, -0.1692899615, -0.2728015482, -0.2661793828, 0.6759352684, 0.215792194, 0.2065013647, 0.0587776937, -0.1873877943, -0.0219805855, 0.4642729163, 0.3379495144, 0.1834040731, 0.0576508529, 0.6058553457, 0.1056453511, -0.014396226, -0.1383230686, -0.1891866475, -0.5123185515, 0.2607534826, -0.0032220574, -0.0168846957, -0.1995468587, -0.3552441001, 0.0996780023, -0.1902482212, 0.1187714487, -0.0018303642, 0.0799267665, 0.2026243508, 0.3011370003, 0.1307025999, 0.0292956885, 0.0590958931, 0.3133090734, -0.0863569975, -0.1691773981, 0.04083924, -0.0871464536, 0.2083615065, 0.2513519526, 0.2837483883, -0.4437424541, 0.1296734512, -0.1673195809, -0.093604058, -0.0200450644, 0.3436532021, -0.1722467244, 0.1508531421, 0.011137167, 0.1842430234, -0.0037245918, 0.0908712447, 0.0047094519, -0.027297698, -0.3770061135, -0.0851903334, 0.0857566595, 0.3486762643, -0.0090898676, -0.1660285741, 0.3011487722, 0.0432869717, -0.3755927384, -0.0223312713, 0.2652485073, -0.3256576061, 0.1198401302, 0.2465087026, 0.4056600034, 0.2672127187, -0.2461309433, 0.1336131096, 0.1941644102, 0.1927345693, 0.0810907632, 0.3828414679, -0.0625905395, 0.2826987803, 0.4963555932, -0.0428275578, 0.1783231199, -0.2052477747, 0.3776832521, 0.2292223573, -0.0082835173, -0.254343152, 0.4671544135, 0.1503638625, -0.2536221445, -0.0102300057, 0.5429747105, 0.0719741434, 0.091578491, 0.3733731508, -0.0238433238, -0.2738281786, -0.2085318863, 0.0868317708, -0.0629946068, -0.0161907654, -0.2711745501, -0.1961760521, -0.0899879336, -0.2310899794, 0.0117075918, -0.1769194156, 0.5453143716, 0.0538269691, -0.0699239299, -0.2815671563, 0.2920911312, 0.2002322227, 0.1837661564, -0.2117908299, 0.0637999773, 0.1046719849, -0.323730737, 0.3169932365, 0.3942152262, 0.360856235, 0.2614825964, -0.2633312345, -0.339425087, -0.0505211689, 0.0534344278, 0.0293794069, 0.0123520661, -0.2310140729, -0.0348659232, 0.1708759665, 0.0397928208, 0.0614804029, -0.1119550392, -0.1979032308, -0.2635837793, -0.2899725437, 0.5647652149, -0.0532338172, -0.3765742779, 0.0905215517, 0.0299440287, -0.0413338915, -0.1076731011, 0.1239439845, 0.2545180917, 0.199342072, 0.1536211967, 0.0158995073, 0.1261710674, 0.1948057711, 0.1311798841, 0.1723547429, 0.0539713092, 0.2657203674, -0.5592803359, 0.0607556999, -0.03142111, -0.3658489883, 0.2509439588, 0.2590927482, 0.1226246133, 0.1718993783, -0.3156029284, 0.0229116734, 0.0584222749, 0.0001739179, -0.1930543929, -0.224037677, 0.1051741242, -0.3982797861, -0.2957426906, -0.2477909774, 0.42068699, -0.1910122931, -0.0056663598, 0.0953531265, 0.0705784932, 0.4648589194, 0.2801657319, 0.0737537965, 0.0240756758, 0.6520788074, 0.0565080382, -0.0289482586, -0.1964111924, -0.1625686586, -0.4249635339, 0.2250289321, -0.3275973201, 0.1831677109, -0.0568537489, 0.5732344985, 0.0306405593, 0.3586797416, 0.0138113573, -0.2656755447, 0.0224260632, 0.247553125, -0.3517125249, 0.1354186088, 0.1260948479, 0.0590380095, 0.0177514516, 0.1408077329, -0.0773070231, -0.5094181895, 0.1611294597, -0.0186843611, -0.1912280172, 0.0852578804, -0.0545712113, -0.0550152883, 0.0704412609, -0.4616410434, -0.134553954, 0.3279926181, 0.0959779397, 0.0850064009, 0.0883448645, 0.1363300532, -0.0962658748, -0.0946109742, 0.0125522371, -0.3227335513, -0.0914962515, -0.0260313191, 0.067021355 ]
https://github.com/huggingface/datasets/issues/492
nlp.Features does not distinguish between nullable and non-nullable types in PyArrow schema
I'm doing a refactor of type inference in #363 . Both text fields should match after that
Here's the code I'm trying to run: ```python dset_wikipedia = nlp.load_dataset("wikipedia", "20200501.en", split="train", cache_dir=args.cache_dir) dset_wikipedia.drop(columns=["title"]) dset_wikipedia.features.pop("title") dset_books = nlp.load_dataset("bookcorpus", split="train", cache_dir=args.cache_dir) dset = nlp.concatenate_datasets([dset_wikipedia, dset_books]) ``` This fails because they have different schemas, despite having identical features. ```python assert dset_wikipedia.features == dset_books.features # True assert dset_wikipedia._data.schema == dset_books._data.schema # False ``` The Wikipedia dataset has 'text: string', while the BookCorpus dataset has 'text: string not null'. Currently I hack together a working schema match with the following line, but it would be better if this was handled in Features themselves. ```python dset_wikipedia._data = dset_wikipedia.data.cast(dset_books._data.schema) ```
17
nlp.Features does not distinguish between nullable and non-nullable types in PyArrow schema Here's the code I'm trying to run: ```python dset_wikipedia = nlp.load_dataset("wikipedia", "20200501.en", split="train", cache_dir=args.cache_dir) dset_wikipedia.drop(columns=["title"]) dset_wikipedia.features.pop("title") dset_books = nlp.load_dataset("bookcorpus", split="train", cache_dir=args.cache_dir) dset = nlp.concatenate_datasets([dset_wikipedia, dset_books]) ``` This fails because they have different schemas, despite having identical features. ```python assert dset_wikipedia.features == dset_books.features # True assert dset_wikipedia._data.schema == dset_books._data.schema # False ``` The Wikipedia dataset has 'text: string', while the BookCorpus dataset has 'text: string not null'. Currently I hack together a working schema match with the following line, but it would be better if this was handled in Features themselves. ```python dset_wikipedia._data = dset_wikipedia.data.cast(dset_books._data.schema) ``` I'm doing a refactor of type inference in #363 . Both text fields should match after that
[ -0.0161188561, 0.0418331623, 0.0497547127, 0.1791475266, 0.2209601104, -0.155137375, 0.3485467732, 0.1771947742, -0.2337825, -0.2496899515, 0.0528564304, 0.2427446693, 0.041850742, 0.3009525537, -0.0142644653, -0.0392466448, 0.1369884312, 0.1927272677, 0.0573504753, -0.0133015504, 0.0279206038, 0.2128111571, -0.432697773, 0.0798529983, -0.6052956581, 0.2832009792, 0.1217155606, -0.0815340951, -0.172473833, -0.3538150191, 0.3396437466, 0.0633925274, -0.1273943484, 0.2941181362, -0.0001230619, -0.0787973925, 0.471128732, -0.1221956238, 0.0056542824, -0.154183194, 0.0033245177, -0.2184464782, 0.1188606918, -0.1594700813, -0.0122467289, 0.0787843764, 0.0574800037, 0.2655120492, -0.4857581854, 0.2143757343, 0.0313539617, 0.5556201339, 0.3611122072, 0.2949575782, 0.482065171, 0.1081081331, -0.1640469432, -0.0403707288, -0.1488460153, -0.2206765711, 0.3500576615, 0.0233768597, -0.3031668365, -0.248875156, 0.2104119211, 0.1371806562, 0.0132310092, -0.1658139825, -0.2161864191, 0.3846074939, 0.378490448, -0.2721753418, -0.2982417345, -0.2871521413, -0.0636590049, -0.1074372828, 0.3144470751, 0.2532115579, -0.0958041847, 0.0034742113, -0.2865938842, 0.1025462449, -0.0919409394, 0.1352299154, -0.3512833416, 0.3031045198, 0.4236582518, 0.0838384777, -0.1090578511, -0.058107432, 0.2037525624, -0.3682912886, 0.182145074, 0.1974298656, -0.3036395609, -0.2578522563, -0.1963277161, -0.1283042282, 0.3435288072, -0.0971284136, -0.1011331007, 0.0921990573, -0.1799587756, 0.2135978937, 0.216467008, 0.1940204352, 0.0921863616, -0.0466755591, 0.0324379839, 0.0155875636, -0.2754160166, 0.1777699143, 0.2533293366, -0.357994318, 0.2222447246, -0.0222094245, 0.5951609015, -0.2146409452, -0.3581428528, 0.1046302244, -0.653796494, -0.0292840917, 0.1376778185, -0.1245903149, -0.1058190912, 0.4346595109, -0.0013264501, 0.396807313, -0.2712624967, -0.3631322384, -0.0425493717, -0.0084457975, 0.0379896536, -0.0114991199, 0.1196711734, 0.2067751884, 0.1114210337, 0.0167974904, -0.3512591422, 0.2169020474, -0.167595759, -0.2053924799, -0.0912243202, 0.0087317061, -0.2506657243, -0.3312961161, 0.1384342462, -0.3670905828, -0.2213855237, 0.1448274702, 0.0643100142, -0.1541719735, -0.1422814578, 0.0524086021, -0.4513301253, -0.1260320991, -0.162942484, 0.3355962932, 0.2153678536, 0.0086007752, 0.0566012561, -0.1638468355, -0.0104537886, -0.2158826292, 0.2360281944, 0.1352064312, -0.0815291032, -0.0126468828, 0.1752242297, -0.2601313591, -0.0406290069, 0.2410740256, -0.0236212239, 0.0674881041, -0.1356773674, 0.5942893624, 0.3529725969, 0.0254982561, 0.1012029797, 0.0385648236, 0.2206335515, 0.0668070018, 0.0872132555, 0.0233997367, -0.3188515306, 0.0589520074, -0.0854753479, 0.3682381213, -0.1921681613, -0.0841460079, -0.2003955841, -0.2794536352, 0.5485413074, -0.1183056906, -0.0097654322, 0.0945070535, -0.1517412513, 0.2460003942, 0.265645206, -0.2121188194, -0.1468267441, -0.0330818407, 0.3460651338, 0.3285524845, -0.425126642, -0.4670065045, -0.5462669134, 0.1526120007, -0.3511543572, 0.5649887323, -0.0926043019, -0.3628212214, -0.0444887392, 0.095775798, 0.2239726186, 0.194045946, 0.0716375783, 0.0665748641, -0.0451183133, 0.1773068756, -0.0164551791, -0.146097213, 0.02932759, 0.1820037812, -0.1878124326, 0.5039502978, -0.0505503751, -0.2504656613, -0.0486589633, 0.50683254, 0.2212620676, 0.0639990345, 0.0746510774, 0.1706353873, 0.0844887942, 0.0274594203, -0.2565708458, 0.2689787745, -0.0357394814, -0.0927108377, -0.1811235845, 0.2658528984, 0.1443211734, -0.0504332073, 0.0820588097, 0.4781082869, 0.1191558316, -0.1683796346, 0.204289645, -0.1395612657, -0.0092685558, -0.1187088937, -0.0515524969, -0.0625140071, 0.0655581877, 0.0588729903, -0.5917349458, 0.5582196712, -0.6158362627, -0.1362633854, 0.4373217821, -0.1705743819, 0.1929082423, -0.2389009297, -0.118784368, 0.077620618, 0.2546368837, -0.4221936464, 0.1173962727, 0.1194534078, 0.0485798605, -0.0174207035, -0.354296118, 0.1041500941, 0.2996138632, 0.0059599276, 0.1607750058, -0.0010493792, 0.202942118, -0.0292643793, -0.3321917057, 0.161055699, 0.1127515435, -0.0855798572, -0.3652040362, -0.0516854711, -0.2765155137, -0.0831770152, -0.493062675, -0.1210076436, -0.3591439128, -0.403629601, -0.0751152709, 0.7243291736, -0.0182255432, 0.1753559411, -0.6069014668, -0.2430245578, -0.0019764011, -0.3426100314, -0.0480911918, 0.0056588957, -0.1899305582, -0.0440213531, 0.3493370414, 0.2407255173, -0.2683977783, -0.0032675744, -0.2104716599, -0.2128612697, -0.8254591227, 0.0923084989, -0.3423713446, 0.0749226511, 0.2931858003, -0.0475145467, 0.2073673755, -0.2992774546, 0.1691264659, 0.1805767566, -0.4905544519, 0.4479925036, 0.0758829638, -0.289455235, -0.0016760215, -0.1718770564, 0.0003846622, -0.1767750382, 0.0933613554, -0.0921219438, -0.0221565701, 0.3520942926, -0.006356895, -0.0300375242, -0.1265922785, 0.0043457402, 0.1129129231, 0.4491638839, 0.4396441877, 0.324872613, -0.0922381207, 0.197549209, -0.2271226794, -0.2233733535, 0.1804771572, 0.0070678648, -0.1562499851, -0.2261992395, 0.5512504578, 0.2355546951, -0.4834792316, 0.305818975, 0.4202594757, 0.0774815306, 0.0824683756, -0.2298173904, -0.0179773998, 0.3961811364, 0.3203350008, -0.0228164531, -0.1455745548, 0.1353578717, 0.0627215728, -0.1255174726, -0.2235630751, 0.5573556423, -0.1932651401, -0.1299393475, 0.1700900793, 0.0713229924, -0.1176918447, -0.0582737736, 0.1083230451, 0.1492450684, -0.2013480663, -0.215762049, 0.0845841393, 0.0908727124, -0.2214395553, -0.2729879916, 0.163974449, -0.302072376, 0.2303423285, -0.0404954813, -0.1805937886, -0.2284919024, -0.3759219348, -0.0044905897, 0.1142401472, 0.0032657632, 0.1018864885, -0.6307581663, -0.0709883124, 0.0868610367, 0.3399064839, 0.1385788918, 0.3695650101, 0.1523777097, -0.5020944476, -0.1680769324, -0.0866930485, 0.471475482, 0.0638900027, -0.0974174589, 0.1335677803, 0.1817170531, -0.1957002282, -0.2683582604, -0.0107411379, 0.0082234256, 0.3010811508, 0.2705414891, -0.6396728754, -0.1791682988, 0.3811223805, 0.3375138938, 0.014551945, -0.0312187318, -0.1594939828, 0.0915167481, 0.0923594236, -0.1257301867, 0.0637992322, 0.2886253595, -0.3415794075, 0.0139585519, -0.3368561566, -0.0377888568, 0.2842561603, 0.4143278301, 0.2234790474, -0.3767013252, 0.082805194, -0.4237991571, 0.187151581, -0.0236260146, 0.4478931725, 0.4763244987, -0.5722711086, -0.4386942685, 0.1377782375, 0.3645657003, -0.101865463, 0.2148090154, 0.2886380255, -0.1515349746, -0.2807992995, -0.1809928268, 0.0132282469, 0.3981316686, -0.0156290978, -0.0768468678, -0.0258179009, 0.5186471939, -0.022581419, 0.0883839875, -0.6236912608, 0.3999244273, -0.2987962365, 0.3228166997, -0.0470070876, 0.8656994104, 0.0237570219, 0.0476170182, 0.2893194556, 0.1270739734, 0.506701529, 0.0078465901, 0.1557165533, -0.2817581296, 0.1701715589, -0.1489226073, -0.2062645555, 0.1013191417, 0.2628423274, -0.1684439629, 0.1422246695, 0.0898131877, 0.2186551392, 0.0041728802, 0.1318734586, -0.0253720116, 0.3312388361, -0.2488346994, -0.0895866901, -0.0604132712, 0.1597782224, 0.1583166867, -0.1786233485, -0.48716712, -0.0729663372, 0.0176846888, 0.2338151187, 0.0173139852, 0.0315412581, 0.4748317003, -0.1961061656, 0.0424906351, 0.3946959376, 0.0842885375, -0.307005614, -0.0172495637, -0.0754971802, 0.2429915071, -0.1359571069, 0.2157040238, -0.2212690115, 0.2682468295, 0.1090968922, -0.3341181576, -0.1193561405, -0.0863953307, -0.1597207338, -0.0778873116, -0.1271841526, 0.1667787582, -0.1795397103, -0.2407256365, -0.0648116767, -0.0542013533, -0.0677199215, -0.0305902399, -0.2076227963, -0.0698589236, 0.0501650646, 0.0153966118, -0.1575434357, 0.0998775959, 0.1503843814, 0.22141397, 0.6293481588, 0.4565289617, 0.0286154244, -0.0017690789, 0.0247230139, -0.2843745053, -0.2169722617, -0.3930868804, -0.1469139755, -0.044810608, -0.2518892884, -0.1806899756, 0.7333981395, 0.1308616996, 0.1295648515, 0.0895380303, -0.1842824072, -0.0429356545, 0.3645336628, 0.1538842618, 0.2513920069, 0.0819069147, 0.5773447752, 0.118679449, -0.0448269695, -0.1121122241, -0.0954187512, -0.3992851973, 0.2623729408, 0.0613638125, -0.0556966402, -0.191627726, -0.402649045, 0.1119804084, -0.2577457726, 0.2308491766, -0.0068081124, -0.0338364877, 0.202818349, 0.313806802, 0.0887996927, 0.0690880492, 0.1050523371, 0.3505171537, -0.0829093307, -0.0861675441, 0.1872447282, -0.0784429014, 0.3959696293, 0.1823228151, 0.2939938903, -0.4679493606, 0.0343057215, -0.188180089, -0.0878019482, 0.0834838375, 0.2765670121, -0.0083834184, 0.1889642179, -0.0700785667, 0.1228086427, -0.0136321457, -0.0546034388, -0.0650931001, -0.0648846328, -0.356844306, -0.00249924, -0.0747430846, 0.4072777927, 0.0618502274, -0.1671940535, 0.2969162166, 0.0530838482, -0.3996774852, 0.0795947015, 0.1522874832, -0.4152294397, 0.0922968239, 0.1816765219, 0.3825951517, 0.4038795233, -0.309664607, 0.0723770186, 0.1195052639, 0.1604402363, 0.1794633716, 0.2838932872, 0.0302708354, 0.158747986, 0.4817336798, 0.0031787499, 0.064849183, -0.1722459942, 0.4451206028, 0.1695607007, -0.2485003173, -0.1077874526, 0.4351512194, 0.0730047077, -0.2572183907, 0.1032344252, 0.4207420945, 0.0211804211, 0.173453629, 0.2988910079, 0.1028891355, -0.1919418722, -0.2126992792, 0.0856520906, -0.1438969225, -0.1289999634, -0.2481291294, -0.3373123705, -0.0672619417, -0.1897698194, 0.0088831075, -0.1929851472, 0.4818562865, 0.0361583941, -0.1371834725, -0.2450813204, 0.378554076, 0.1929196715, 0.2649737597, -0.1939347535, 0.0645453259, -0.0002827157, -0.3305134177, 0.3294855058, 0.3417550027, 0.2270212173, 0.3470467925, -0.3818874061, -0.3901886642, 0.0075488095, -0.024356978, 0.0469742604, -0.1039169058, -0.2061829567, 0.155730024, 0.2123421729, 0.0250738189, 0.104411833, -0.0466438457, -0.1971738935, -0.2442260236, -0.2792164981, 0.5544180274, -0.003010575, -0.1924308538, -0.0728181824, -0.0142639037, -0.0339001678, -0.3230064809, 0.1046117097, 0.2030604184, 0.1489589959, 0.0625694618, 0.0109980302, 0.1575794667, 0.0550225154, 0.1844742149, 0.0528040193, -0.0444114096, 0.3143444955, -0.4968895614, 0.0585789196, -0.0200466886, -0.288911432, 0.1667106748, 0.3873145282, 0.0609075874, 0.0682780743, -0.3706537485, -0.0068577006, 0.1168920398, 0.0606202297, -0.0962381214, -0.1325854212, 0.0162219834, -0.3778548241, -0.2371814549, -0.241946891, 0.3659836352, -0.1840186417, -0.0142633272, -0.0643139705, 0.2227295637, 0.4342675507, 0.3516324162, -0.0617969222, 0.0468499996, 0.7053895593, 0.1270474046, -0.0117471274, -0.0867321268, -0.039537143, -0.51434654, 0.2094187886, -0.2973787785, 0.221236214, -0.0026687514, 0.6017213464, 0.1248427182, 0.3921007216, -0.0645235255, -0.3328496516, -0.0212386865, 0.1732378751, -0.3336333036, 0.1193785965, 0.1856160462, 0.0193987601, 0.0606359802, 0.0533926152, -0.088233918, -0.4543744922, 0.097927317, -0.0631976947, -0.1480970681, -0.0222424194, -0.1345863044, 0.1181331724, 0.1067833006, -0.5811045766, -0.1921423078, 0.3485526443, 0.0206626691, 0.1605141014, 0.1254467666, 0.2556874156, -0.1377925277, -0.1797769219, 0.0106501458, -0.2607835829, 0.0892701373, -0.1012817621, -0.0876176953 ]
https://github.com/huggingface/datasets/issues/492
nlp.Features does not distinguish between nullable and non-nullable types in PyArrow schema
It should be good now. I was able to run ```python >>> from nlp import concatenate_datasets, load_dataset >>> >>> bookcorpus = load_dataset("bookcorpus", split="train") >>> wiki = load_dataset("wikipedia", "20200501.en", split="train") >>> wiki.remove_columns_("title") # only keep the text >>> >>> assert bookcorpus.features.type == wiki.features.type >>> bert_dataset = concatenate_datasets([bookcorpus, wiki]) ```
Here's the code I'm trying to run: ```python dset_wikipedia = nlp.load_dataset("wikipedia", "20200501.en", split="train", cache_dir=args.cache_dir) dset_wikipedia.drop(columns=["title"]) dset_wikipedia.features.pop("title") dset_books = nlp.load_dataset("bookcorpus", split="train", cache_dir=args.cache_dir) dset = nlp.concatenate_datasets([dset_wikipedia, dset_books]) ``` This fails because they have different schemas, despite having identical features. ```python assert dset_wikipedia.features == dset_books.features # True assert dset_wikipedia._data.schema == dset_books._data.schema # False ``` The Wikipedia dataset has 'text: string', while the BookCorpus dataset has 'text: string not null'. Currently I hack together a working schema match with the following line, but it would be better if this was handled in Features themselves. ```python dset_wikipedia._data = dset_wikipedia.data.cast(dset_books._data.schema) ```
48
nlp.Features does not distinguish between nullable and non-nullable types in PyArrow schema Here's the code I'm trying to run: ```python dset_wikipedia = nlp.load_dataset("wikipedia", "20200501.en", split="train", cache_dir=args.cache_dir) dset_wikipedia.drop(columns=["title"]) dset_wikipedia.features.pop("title") dset_books = nlp.load_dataset("bookcorpus", split="train", cache_dir=args.cache_dir) dset = nlp.concatenate_datasets([dset_wikipedia, dset_books]) ``` This fails because they have different schemas, despite having identical features. ```python assert dset_wikipedia.features == dset_books.features # True assert dset_wikipedia._data.schema == dset_books._data.schema # False ``` The Wikipedia dataset has 'text: string', while the BookCorpus dataset has 'text: string not null'. Currently I hack together a working schema match with the following line, but it would be better if this was handled in Features themselves. ```python dset_wikipedia._data = dset_wikipedia.data.cast(dset_books._data.schema) ``` It should be good now. I was able to run ```python >>> from nlp import concatenate_datasets, load_dataset >>> >>> bookcorpus = load_dataset("bookcorpus", split="train") >>> wiki = load_dataset("wikipedia", "20200501.en", split="train") >>> wiki.remove_columns_("title") # only keep the text >>> >>> assert bookcorpus.features.type == wiki.features.type >>> bert_dataset = concatenate_datasets([bookcorpus, wiki]) ```
[ 0.019575661, 0.1014372706, 0.0100494158, 0.1525079459, 0.2617859244, -0.0262446031, 0.3992978036, 0.1835874766, -0.2757073343, -0.3310970664, 0.0578913912, 0.2993275523, -0.0961163267, 0.3490907252, -0.0248576123, -0.0886692479, 0.2123330683, 0.2151870281, 0.0904195309, -0.0006232007, -0.0216913167, 0.1471000761, -0.4190043509, 0.0407253653, -0.5618264079, 0.1993516237, 0.0091328314, -0.0635870695, -0.1321007609, -0.3558356166, 0.3598957956, 0.1632290184, -0.0964085609, 0.3494224548, -0.000123727, -0.0465316772, 0.4617716968, -0.0944591612, -0.1142687425, -0.1229415089, -0.0468564108, -0.226163581, 0.1428208649, -0.2239895165, 0.0660101399, 0.0396811217, -0.0237120967, 0.2180904746, -0.482717216, 0.3005029261, 0.0497985631, 0.6041241288, 0.3216880262, 0.2887703776, 0.4325881302, 0.0260211192, -0.2378445268, 0.057117179, -0.286639154, -0.2400388718, 0.3646001518, -0.003035123, -0.4224069715, -0.2776356936, 0.1704857498, 0.0321024358, 0.0139939245, -0.1811417043, -0.132682398, 0.3763583302, 0.3835638165, -0.3270165622, -0.2761543989, -0.2740530968, -0.0383332893, -0.1471805722, 0.2313627601, 0.3422132134, 0.0426285304, 0.0377750657, -0.3583472669, 0.1332841218, -0.0611011535, 0.1729689687, -0.3576497436, 0.2891925275, 0.4066444337, 0.1265056133, -0.0574193522, -0.0956977159, 0.2397032231, -0.3863390386, 0.1325588524, 0.1334774494, -0.3427970409, -0.1534191966, -0.2158364803, -0.1752316803, 0.4142797887, -0.1013135836, -0.068436332, 0.0484884791, -0.1178587154, 0.1581599861, 0.1803006381, 0.3018609285, 0.1722833216, -0.0425047502, -0.0473932028, 0.0539676286, -0.2548184991, 0.2683301568, 0.2783732414, -0.2501657903, 0.1644538045, -0.0081231631, 0.5877901316, -0.1211647615, -0.3953980505, 0.1054597646, -0.6579979062, -0.0653716102, 0.1158043221, -0.0750872567, -0.0164888166, 0.432929337, -0.0250335876, 0.4224489629, -0.2510070205, -0.2912807763, -0.1103084683, 0.0483361632, -0.0065326085, -0.0288016163, 0.1892844737, 0.096944876, 0.1741941124, -0.0417578444, -0.3898361623, 0.2016261518, -0.1408275366, -0.2009077668, -0.0840661153, 0.0512066931, -0.1916182339, -0.2432674468, 0.1291822195, -0.4263624847, -0.2597582936, 0.1686257124, 0.0584447682, -0.2287466377, -0.1498565823, 0.068594031, -0.4282657206, -0.1048148274, -0.0640076771, 0.2332177758, 0.2305508703, -0.0454131663, 0.0735661089, -0.1591986269, 0.0216619205, -0.262665391, 0.1199829504, 0.2031267434, -0.0939799398, 0.0117669385, 0.1568471491, -0.2104031146, 0.0052218297, 0.2258633077, -0.0269046314, 0.1159322038, -0.1868225336, 0.5118380785, 0.3278875351, -0.0432589538, 0.0168933608, 0.0380691811, 0.2024354935, 0.096559003, 0.1285848916, 0.0444149077, -0.2982773781, -0.0274751112, -0.0779009014, 0.308724314, -0.0985608026, -0.0781476572, -0.1820746511, -0.2565663159, 0.6591674089, -0.0943209305, -0.0564060435, 0.1404180378, -0.1382978112, 0.3328258693, 0.3180727959, -0.1969289333, -0.1213605702, 0.0179035291, 0.1878580004, 0.220866397, -0.4277661741, -0.3764052689, -0.6329755783, 0.1295934469, -0.2952992022, 0.5714241266, -0.0909824818, -0.3621646762, -0.1214410588, 0.1148452759, 0.1560098827, 0.0661059916, 0.0689283386, 0.1525990218, 0.01955471, 0.173379004, -0.0632710382, -0.0691421404, -0.0001667218, 0.1299987882, -0.3026864231, 0.4794205129, -0.0680714101, -0.2394229025, 0.0380314142, 0.5497892499, 0.2630759478, 0.0291558746, 0.0447434932, 0.2267817259, -0.0474288613, -0.0320526771, -0.1848870665, 0.3059108853, -0.0065516159, -0.0952605978, -0.1367532164, 0.2938751578, 0.1112042442, -0.1022118628, 0.0039690491, 0.5206983685, -0.0201631747, -0.0484415889, 0.1878581047, -0.0610091425, 0.0482265428, -0.1584980041, -0.0894817188, -0.1095930636, 0.1126951203, 0.0823303759, -0.495749563, 0.5330726504, -0.5667440295, -0.1811653078, 0.4938712716, -0.1976946145, 0.1824944019, -0.20207192, -0.1289621741, 0.091081351, 0.3797801137, -0.4210349023, 0.207030192, 0.1284209937, 0.1107254699, 0.0249744654, -0.3196207285, 0.081259571, 0.3331663609, -0.029122524, 0.1114734262, -0.0383762084, 0.2469995171, -0.1389684081, -0.3223756552, 0.0981642976, 0.1357908696, -0.047668606, -0.3277386725, 0.0029743328, -0.3342835903, -0.1165995896, -0.3874279261, -0.2271282375, -0.4085306227, -0.4292831123, -0.126410231, 0.6499423981, -0.0563763343, 0.281740576, -0.654840529, -0.2946582139, 0.0785268396, -0.4065555632, -0.0109407259, 0.0041678557, -0.1255189031, -0.0674330741, 0.3089808226, 0.2916698754, -0.1843715608, -0.0413817093, -0.2161369175, -0.1620105356, -0.7112452388, 0.1253077686, -0.4536362588, 0.0261322167, 0.297493428, -0.0095081152, 0.1389732808, -0.3155117035, 0.1860708594, 0.1755692959, -0.3917916119, 0.4901825786, 0.1041635349, -0.2944886386, -0.0321601741, -0.1916295886, -0.0293729994, -0.2649883032, 0.1147539839, -0.0891407803, 0.0408564582, 0.3860735297, 0.0211113822, 0.0487827174, -0.0745107755, 0.0348822623, 0.1042639837, 0.4250565171, 0.4264546931, 0.2812416255, -0.1241300628, 0.1868459582, -0.2605316043, -0.2054005265, 0.2208202779, -0.0510111041, -0.1454125941, -0.2333433628, 0.5366601348, 0.2374634147, -0.3884626925, 0.2863417864, 0.4431608319, 0.0826119632, 0.0101799285, -0.3189226687, -0.0405622013, 0.384085834, 0.2121478319, 0.0399055704, -0.1200200245, 0.1387340128, 0.0387933291, -0.086496152, -0.2054847479, 0.5309773684, -0.2393930405, -0.0613696091, 0.1415787786, -0.0320222341, -0.1077440977, -0.0494656749, 0.1545823812, 0.1559001058, -0.2657796443, -0.251839906, 0.1059897244, 0.1672796309, -0.2113858312, -0.1778415293, 0.2012263089, -0.3051596582, 0.3195039332, -0.0406073928, -0.1985888332, -0.1919312328, -0.3699117899, 0.0338115878, 0.1395126581, -0.0981303677, 0.1026445925, -0.6497276425, 0.0017367868, 0.0208794735, 0.3767077327, 0.1342529058, 0.4731307328, 0.1460253, -0.4508697987, -0.1902364939, -0.0615377799, 0.5640015602, 0.0612316653, -0.064572677, 0.3183956742, 0.2116882503, -0.2911328375, -0.2674369216, -0.0787034929, 0.0937381163, 0.3564353287, 0.2167790383, -0.6534016728, -0.2309088409, 0.367749393, 0.3814469576, 0.0330670439, 0.0042819432, -0.1924689114, -0.061293032, 0.0153522464, -0.1625399292, 0.0129423905, 0.3118938804, -0.4172184765, 0.0344119221, -0.3534697592, -0.1319496632, 0.2542103529, 0.3573927283, 0.3443434536, -0.3219573498, 0.0954730064, -0.4758374393, 0.1821273118, -0.0383872166, 0.5125543475, 0.4208612144, -0.4859172404, -0.3728667498, 0.1200301945, 0.3413622677, -0.0079412358, 0.1713607907, 0.2588385046, -0.2045015544, -0.2189020514, -0.1618317813, 0.0314356275, 0.3969660699, -0.1037937552, -0.1424657851, -0.0794333369, 0.4981074035, 0.0853007957, 0.1210732013, -0.6400696039, 0.2907294333, -0.3826372921, 0.3815764487, -0.1184936464, 0.9706951976, 0.0344260745, 0.1159853414, 0.3479287922, 0.1673339605, 0.5139725208, 0.072190322, 0.1802607179, -0.3007272482, 0.1964892745, -0.1293438375, -0.2213264257, 0.1310352385, 0.197133109, -0.2321763635, 0.2325963378, -0.0664608032, 0.1716501266, -0.0171468873, 0.2490389347, 0.0054720105, 0.2760458291, -0.3180596828, -0.1031708866, -0.1124359593, 0.0892088488, 0.1288128942, -0.1908583194, -0.4532466531, -0.140372619, 0.083198294, 0.1300482899, 0.0804382712, 0.0620404743, 0.3610140979, -0.2321575582, -0.0285357796, 0.3560192585, 0.0499163643, -0.306299597, 0.0172608923, -0.0950054377, 0.2784453928, -0.1184561774, 0.2219922543, -0.1196758151, 0.3196142018, 0.1337709278, -0.2596153617, -0.0831989869, -0.1216641739, -0.144996196, -0.1609417498, -0.1105657369, 0.0658312365, -0.2531044483, -0.1635766774, -0.0241692048, -0.1154228747, -0.0930650085, -0.0350699611, -0.2148528099, -0.0962177217, 0.0768124461, 0.0298717543, -0.1528109759, 0.0419530049, 0.125747785, 0.2709088326, 0.6052501798, 0.5042904019, 0.0361744352, -0.0084299967, 0.0055015464, -0.2731564343, -0.297639668, -0.3696174324, -0.0714035556, -0.1066272408, -0.2701563835, -0.2218776345, 0.6855998039, 0.0500295572, 0.2579540312, 0.1075879484, -0.1760198325, -0.0886619091, 0.3262965977, 0.2517031133, 0.2726498842, 0.0120917736, 0.5588988066, 0.1151676327, -0.0451638624, -0.1183431521, -0.094150804, -0.450189054, 0.2993202507, 0.1259326488, -0.0273818541, -0.1964681894, -0.3474906683, 0.1052608639, -0.2562191784, 0.1677027494, -0.0052707014, -0.0697111785, 0.2226894647, 0.2814823091, 0.0629890412, 0.0083438996, 0.0771829039, 0.3129277229, -0.1115407869, -0.1160239428, 0.1301072538, -0.1095884666, 0.3613772988, 0.1909684986, 0.2876522839, -0.3854853809, 0.0116553055, -0.1146791354, -0.0839903504, 0.0384312794, 0.3189915419, 0.0250518247, 0.1879184544, -0.0126739359, 0.078396976, -0.0395020805, 0.0791224241, -0.0052775261, -0.1448145956, -0.3106227815, -0.0418729149, 0.0175046325, 0.4356743395, -0.0573865585, -0.2004942596, 0.3062953651, 0.0385016017, -0.3957903385, 0.0481882282, 0.2331671715, -0.3720860183, 0.0785648301, 0.1954510063, 0.348513931, 0.2989063263, -0.3653686941, 0.089337036, 0.1632991582, 0.1465242803, 0.1509816349, 0.2636656761, -0.0648989826, 0.1604723036, 0.4644601345, -0.0115039274, 0.0504283383, -0.1111410558, 0.4408940375, 0.2518627048, -0.1169423461, -0.1243630126, 0.4053170085, 0.1224787161, -0.2539816499, 0.1131928042, 0.4421785176, 0.1059338078, 0.1297669709, 0.3113711476, 0.0384410918, -0.2267452478, -0.1211203039, 0.1179407686, -0.0931439698, -0.0873485282, -0.2757019103, -0.2565479577, -0.0810904801, -0.1800362617, 0.0243242662, -0.1540015936, 0.5543490052, 0.0592054054, -0.1635775268, -0.2852015793, 0.4014178216, 0.1921865195, 0.1359361261, -0.1995631307, 0.0366870016, 0.0967629999, -0.2490330935, 0.2249768823, 0.3008886278, 0.2749758959, 0.2934955359, -0.4081042409, -0.3811702132, 0.0252952855, 0.0026774793, 0.0431608073, 0.0289612003, -0.1680410802, 0.1478978395, 0.2348802239, 0.0013727397, 0.063858673, -0.0405186377, -0.1047830209, -0.2817611098, -0.2665735781, 0.5761912465, -0.0518484563, -0.2904804349, -0.0145226484, -0.0229910053, -0.0898445249, -0.1888554096, 0.2122811973, 0.2419331372, 0.2618584633, 0.1101137474, 0.0030345269, 0.1769431829, 0.1449161321, 0.1025811806, 0.1341082156, -0.0417921618, 0.279609859, -0.5538764, 0.0183842182, -0.0415443182, -0.3055502474, 0.1791531742, 0.2813611925, 0.0639949515, 0.0571323335, -0.4404068887, -0.0674699023, 0.154876247, 0.0214461703, -0.1898564994, -0.1347697824, 0.1254253685, -0.3303123116, -0.2333501875, -0.3570849597, 0.3794098794, -0.1839246899, -0.0159746818, -0.0201079752, 0.2072881609, 0.4881542623, 0.2732686996, -0.0220353603, 0.069633387, 0.7188737988, 0.1258997023, -0.0476646386, -0.2302095145, -0.0618917011, -0.4107396007, 0.157161653, -0.2478827089, 0.2414241135, -0.0675198585, 0.5831834674, 0.0085767163, 0.4599256516, -0.0380413197, -0.2560946941, 0.0078375284, 0.1765656024, -0.3624721467, 0.1571974754, 0.1328829825, 0.1275195032, -0.0200872514, 0.1368734837, -0.1184489653, -0.4956019223, 0.2262372971, -0.1183768585, -0.2952270508, 0.1455469131, -0.1058935598, 0.1077496037, 0.0919095203, -0.5134957433, -0.1520469636, 0.3226171732, -0.0144656682, 0.0524427071, 0.0765092745, 0.2326274663, -0.1332785636, -0.0963047668, -0.0525511615, -0.2394362241, -0.0427297018, -0.0583460853, -0.050711412 ]
https://github.com/huggingface/datasets/issues/488
issues with downloading datasets for wmt16 and wmt19
I found `UNv1.0.en-ru.tar.gz` here: https://conferences.unite.un.org/uncorpus/en/downloadoverview, so it can be reconstructed with: ``` wget -c https://stuncorpusprod.blob.core.windows.net/corpusfiles/UNv1.0.en-ru.tar.gz.00 wget -c https://stuncorpusprod.blob.core.windows.net/corpusfiles/UNv1.0.en-ru.tar.gz.01 wget -c https://stuncorpusprod.blob.core.windows.net/corpusfiles/UNv1.0.en-ru.tar.gz.02 cat UNv1.0.en-ru.tar.gz.0* > UNv1.0.en-ru.tar.gz ``` it has other languages as well, in case https://storage.googleapis.com/tfdataset-data/downloadataset/uncorpus/ is gone
I have encountered multiple issues while trying to: ``` import nlp dataset = nlp.load_dataset('wmt16', 'ru-en') metric = nlp.load_metric('wmt16') ``` 1. I had to do `pip install -e ".[dev]" ` on master, currently released nlp didn't work (sorry, didn't save the error) - I went back to the released version and now it worked. So it must have been some outdated dependencies that `pip install -e ".[dev]" ` fixed. 2. it was downloading at 60kbs - almost 5 hours to get the dataset. It was downloading all pairs and not just the one I asked for. I tried the same code with `wmt19` in parallel and it took a few secs to download and it only fetched data for the requested pair. (but it failed too, see below) 3. my machine has crushed and when I retried I got: ``` Traceback (most recent call last): File "./download.py", line 9, in <module> dataset = nlp.load_dataset('wmt16', 'ru-en') File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/builder.py", line 449, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/stas/anaconda3/envs/main/lib/python3.7/contextlib.py", line 112, in __enter__ return next(self.gen) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/stas/anaconda3/envs/main/lib/python3.7/os.py", line 221, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/stas/.cache/huggingface/datasets/wmt16/ru-en/1.0.0/4d8269cdd971ed26984a9c0e4a158e0c7afc8135fac8fb8ee43ceecf38fd422d.incomplete' ``` it can't handle resumes. but neither allows a new start. Had to delete it manually. 4. and finally when it downloaded the dataset, it then failed to fetch the metrics: ``` Traceback (most recent call last): File "./download.py", line 15, in <module> metric = nlp.load_metric('wmt16') File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 442, in load_metric module_path, hash = prepare_module(path, download_config=download_config, dataset=False) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 258, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/utils/file_utils.py", line 198, in cached_path local_files_only=download_config.local_files_only, File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/utils/file_utils.py", line 356, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://s3.amazonaws.com/datasets.huggingface.co/nlp/metrics/wmt16/wmt16.py ``` 5. If I run the same code with `wmt19`, it fails too: ``` ConnectionError: Couldn't reach https://storage.googleapis.com/tfdataset-data/downloadataset/uncorpus/UNv1.0.en-ru.tar.gz ```
37
issues with downloading datasets for wmt16 and wmt19 I have encountered multiple issues while trying to: ``` import nlp dataset = nlp.load_dataset('wmt16', 'ru-en') metric = nlp.load_metric('wmt16') ``` 1. I had to do `pip install -e ".[dev]" ` on master, currently released nlp didn't work (sorry, didn't save the error) - I went back to the released version and now it worked. So it must have been some outdated dependencies that `pip install -e ".[dev]" ` fixed. 2. it was downloading at 60kbs - almost 5 hours to get the dataset. It was downloading all pairs and not just the one I asked for. I tried the same code with `wmt19` in parallel and it took a few secs to download and it only fetched data for the requested pair. (but it failed too, see below) 3. my machine has crushed and when I retried I got: ``` Traceback (most recent call last): File "./download.py", line 9, in <module> dataset = nlp.load_dataset('wmt16', 'ru-en') File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/builder.py", line 449, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/stas/anaconda3/envs/main/lib/python3.7/contextlib.py", line 112, in __enter__ return next(self.gen) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/stas/anaconda3/envs/main/lib/python3.7/os.py", line 221, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/stas/.cache/huggingface/datasets/wmt16/ru-en/1.0.0/4d8269cdd971ed26984a9c0e4a158e0c7afc8135fac8fb8ee43ceecf38fd422d.incomplete' ``` it can't handle resumes. but neither allows a new start. Had to delete it manually. 4. and finally when it downloaded the dataset, it then failed to fetch the metrics: ``` Traceback (most recent call last): File "./download.py", line 15, in <module> metric = nlp.load_metric('wmt16') File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 442, in load_metric module_path, hash = prepare_module(path, download_config=download_config, dataset=False) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 258, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/utils/file_utils.py", line 198, in cached_path local_files_only=download_config.local_files_only, File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/utils/file_utils.py", line 356, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://s3.amazonaws.com/datasets.huggingface.co/nlp/metrics/wmt16/wmt16.py ``` 5. If I run the same code with `wmt19`, it fails too: ``` ConnectionError: Couldn't reach https://storage.googleapis.com/tfdataset-data/downloadataset/uncorpus/UNv1.0.en-ru.tar.gz ``` I found `UNv1.0.en-ru.tar.gz` here: https://conferences.unite.un.org/uncorpus/en/downloadoverview, so it can be reconstructed with: ``` wget -c https://stuncorpusprod.blob.core.windows.net/corpusfiles/UNv1.0.en-ru.tar.gz.00 wget -c https://stuncorpusprod.blob.core.windows.net/corpusfiles/UNv1.0.en-ru.tar.gz.01 wget -c https://stuncorpusprod.blob.core.windows.net/corpusfiles/UNv1.0.en-ru.tar.gz.02 cat UNv1.0.en-ru.tar.gz.0* > UNv1.0.en-ru.tar.gz ``` it has other languages as well, in case https://storage.googleapis.com/tfdataset-data/downloadataset/uncorpus/ is gone
[ -0.2756032646, -0.0938133299, -0.0165135507, 0.5474311113, 0.0739605203, -0.0815913752, 0.0184083302, 0.1925771534, 0.180172801, -0.0740144625, -0.0608426593, 0.022961434, -0.1682557166, 0.0706975088, 0.1812845916, -0.0102872066, -0.0982713848, 0.0546426512, -0.5839900374, -0.106612727, -0.251978904, 0.1597540379, -0.1889989972, 0.0316228233, 0.0291602127, -0.1472723037, -0.0056705922, 0.033885099, -0.422670126, -0.3919169605, 0.4446609318, 0.1778903753, 0.0486655571, 0.2788917422, -0.0001182758, -0.2390264869, 0.228801474, 0.0146838529, -0.3021409512, -0.1883608252, -0.2656502724, -0.541665554, 0.1796255708, 0.0793974623, 0.1905766129, -0.2577369511, -0.096332401, -0.1201573461, 0.3336130083, 0.154108882, 0.1808845997, 0.4754364192, 0.1862676144, 0.0183087811, 0.146319896, 0.1829879135, -0.0161831081, 0.0414136313, 0.3683443666, -0.1451098472, 0.3042301536, 0.2626514435, -0.1972894222, 0.3405378759, 0.2254596502, 0.0342917591, 0.2514486611, -0.3291009068, -0.0104289073, 0.3739079833, 0.0919396207, -0.0189395882, -0.2833078504, -0.3328357935, -0.0607210845, -0.5919567347, 0.0915091634, 0.3554452658, -0.3222124279, -0.0712232813, -0.51800704, 0.0008274867, 0.094512701, 0.3394877911, -0.1083700508, 0.3477391005, 0.0328621306, 0.1435944736, 0.1835632026, -0.3430738151, -0.1032524034, -0.3144377768, 0.2530843616, 0.2212259918, -0.2552488446, 0.0872772932, 0.0101170018, 0.0087075336, 0.0032322162, -0.0976790935, -0.0223416463, 0.1039453968, -0.138657093, 0.035780441, 0.1094087958, 0.2143314183, -0.0763304159, -0.0989685655, 0.2642333508, -0.034821827, 0.2747760415, 0.2433938831, 0.1871810108, -0.1478898078, -0.3470748365, 0.0696833432, 0.1543292999, -0.2491887957, -0.3024493158, -0.0835246518, 0.0652419478, -0.2730256617, 0.0408263579, 0.0257638413, -0.2994417846, 0.2130641639, 0.0610917211, 0.1647906005, -0.2455626279, -0.1874855161, -0.1245098412, -0.2107741833, -0.0994958431, 0.1155643761, 0.6232810616, 0.0698021203, 0.2070061266, 0.1056847274, -0.1488352865, 0.1095467284, -0.0190163478, -0.1189082414, 0.1222631633, 0.2221131772, 0.0451028831, 0.4238991141, -0.1189092994, 0.0161674805, -0.1315834969, -0.1299054325, -0.0583826862, 0.0434743427, 0.2906780839, 0.2067488581, -0.3159321845, -0.0533834025, -0.2992138863, 0.0907551423, -0.1152078137, -0.03388118, -0.1886042356, -0.2438193858, -0.3752390742, -0.2526578009, 0.376717329, 0.2799051702, -0.1666075587, -0.1649062783, -0.0837729201, 0.0289436821, 0.3123577535, 0.4445022941, -0.2286303341, 0.0464230031, -0.1588804126, -0.0510552451, 0.3584416211, -0.3500112295, -0.1459338069, 0.0142126624, -0.0908054337, 0.2117910236, -0.0302684959, 0.0880926326, 0.2926702797, -0.1595734209, 0.2096132934, 0.4093493223, -0.0834694505, -0.1281997114, -0.2435816824, -0.4912776053, 0.6207735538, 0.0323618762, 0.1447011679, -0.3409755826, -0.0999756753, -0.1594638377, 0.4071717262, 0.1020297334, 0.1387521327, -0.0597011633, -0.0496112145, -0.0825744346, -0.0716121271, -0.0022223559, -0.4874588251, 0.3761880398, -0.2441597432, 0.1380984634, 0.0267381836, 0.2019914687, -0.0252640247, -0.1451211572, -0.109334603, -0.1639740765, 0.0372415446, 0.0199690778, 0.0985343978, -0.0397356041, 0.0781111568, 0.0820712596, -0.0402478613, 0.1321013719, -0.2335658818, 0.2222176492, 0.0546638295, -0.0288111623, 0.3562950492, 0.283198446, 0.1775621623, -0.0596049726, -0.0277687889, -0.0303029064, -0.0066435118, 0.4922425151, -0.1041980907, -0.0141535439, 0.339463532, -0.4042291045, 0.1655756086, 0.2719748914, 0.2212738395, -0.3597030342, 0.017089989, 0.2387667447, -0.0915701538, 0.3743445873, 0.1100304797, 0.0123178959, 0.011361884, 0.0139468918, -0.089154087, -0.0341479219, 0.4079686999, -0.0964394733, 0.0220887046, 0.0996987522, -0.0303345602, 0.2387857288, 0.2519141734, 0.1178978384, 0.0268233772, -0.0370241143, -0.1333162636, -0.137072131, -0.1800832152, 0.2379727513, 0.5232090354, 0.1820148826, 0.1907967031, 0.090906024, 0.0877680108, -0.4019683897, 0.3726391494, 0.2383789122, -0.0019472515, 0.1320959777, 0.0430690013, -0.0163698439, -0.1104835421, 0.4184348881, 0.0917635038, 0.1791214645, -0.2323915362, -0.24925524, -0.581091404, -0.4634238482, -0.4940528274, -0.3730905652, -0.3810459673, -0.3317368329, -0.1937680542, -0.0642360374, -0.0816403031, 0.1759491712, 0.1689739227, 0.0007636669, -0.3557636738, 0.4598481655, -0.0278812461, -0.0493742451, -0.3101086915, 0.017224703, 0.4009832144, 0.1410497427, 0.4067271948, 0.0004273241, -0.0131985834, 0.0081043523, -0.3204091787, -0.0419830568, -0.0738796368, 0.2629975677, 0.1375834495, 0.2869310081, 0.2675926387, -0.0940292105, 0.1489827633, -0.2181364894, -0.051485911, -0.1704598665, -0.0215498284, 0.0187395867, -0.2237057984, -0.4680874944, -0.7113642693, -0.3568281233, 0.1662412882, 0.0643552765, 0.0964023769, 0.3763367534, -0.2669000626, -0.0048243115, -0.0431200229, 0.1872793734, -0.1405702978, 0.1058703735, 0.3484725356, -0.0433362275, -0.4463670552, 0.0350137092, 0.1576627642, 0.2508547306, 0.1007581949, -0.4295146465, 0.3669920564, -0.1442828327, -0.1073543876, 0.2240203619, 0.1611542106, 0.1435948312, -0.0059769396, -0.0148709388, -0.038559746, -0.2719135582, -0.0486938655, -0.0559321344, 0.2735079825, 0.0550434999, 0.1221249029, 0.0208202787, 0.5913624167, 0.2570455372, -0.0870675966, 0.1685412824, 0.223955065, 0.0688811094, 0.3214882612, -0.5713627934, 0.0624388866, 0.014921315, 0.2643274665, 0.2561018765, -0.0245563425, -0.0789707452, -0.3335883021, 0.0456078053, -0.2322386503, -0.3285509348, -0.0424313582, 0.2228121758, 0.2037611604, 0.3823131919, 0.1332702935, -0.0036636607, -0.3344186544, -0.1921595782, -0.0713422075, -0.0795904025, 0.141065374, -0.3056294322, -0.3055721521, -0.3390578628, 0.185380742, 0.0123059107, 0.6306857467, -0.1004619151, 0.0602538213, 0.0003579604, 0.053595975, 0.2863096297, -0.0149865774, 0.2238219082, -0.0550032705, 0.0418631211, -0.707555294, -0.0788407475, -0.1490832269, -0.1024420038, 0.3979473114, 0.2676808834, -0.3344469666, -0.3497640193, 0.12868765, 0.4699043632, -0.3002050221, -0.0902624801, -0.0001841009, -0.1544872373, -0.1256389618, -0.1509197354, -0.2789452672, 0.1925429106, -0.3451685607, 0.0452709123, 0.180113852, 0.0680587813, 0.3399453759, -0.0267141666, 0.0946662799, 0.1880124211, 0.4270005524, 0.3394293189, 0.1034898013, 0.0907358229, 0.3604838848, -0.0748464689, 0.3105949461, -0.1079983413, -0.0581992604, 0.2565921545, 0.5723102689, -0.0812101737, 0.2673698068, 0.0279870126, 0.0784471557, -0.4492249191, 0.0794502795, 0.3588107228, -0.1368250549, -0.2159992456, -0.2861743271, 0.3259079754, 0.2019694895, -0.1109419689, 0.2802772224, -0.1149720177, -0.3127883971, -0.1978131086, 0.0408773832, 0.9505412579, 0.2387177497, 0.2275000513, -0.0095484694, -0.4000633359, 0.4883538783, 0.4271090925, -0.1436376721, -0.0481960289, 0.3191525042, -0.0039903526, -0.1169139072, 0.0799547508, -0.0163565576, -0.1558756381, 0.5566449165, 0.3277595043, 0.1902879775, 0.0671358258, 0.3798568249, 0.0089372285, -0.3773044646, -0.2538489997, 0.0673444644, -0.359387815, 0.2783209383, -0.1393685639, -0.3252617121, 0.0053059012, -0.2072426379, -0.3205972016, 0.0383540913, -0.4705601335, 0.1999382526, -0.1084300354, -0.048495058, 0.19131203, -0.0939291418, 0.023355186, 0.1939816475, -0.3421662152, 0.0471422859, -0.4583494067, 0.2351855338, 0.0417988636, 0.0699068978, -0.0019242037, -0.1840398014, -0.1144268066, -0.2535885274, 0.0115258005, 0.337092042, -0.0575815178, 0.0259476099, 0.1794766039, 0.1735762358, -0.0933970958, 0.1255259514, 0.1240274608, -0.137656197, 0.1038089767, 0.2577847838, -0.0941022262, 0.5929931402, 0.1446929872, -0.0829001591, -0.1528958082, 0.5256069303, 0.0521146804, -0.146619007, 0.4898710251, 0.5510687828, -0.1143533587, -0.2417031229, -0.0041619306, -0.3494574428, -0.484570235, -0.0105191981, 0.0329331867, 0.3049018085, 0.0559950545, 0.5251324773, 0.2182417661, -0.2787427008, 0.157030195, -0.4990169704, -0.1411264092, 0.3006082475, 0.0930177271, 0.0704480186, -0.113818571, 0.0523061603, 0.0783455297, 0.3154847622, -0.2897269428, 0.1905989051, -0.0451219566, 0.1344131082, 0.2483337969, -0.2423755378, 0.1088933498, -0.0465252101, -0.0645427704, -0.1267764121, -0.4485757351, -0.1471535712, -0.2247589231, 0.1452783048, -0.0036858174, -0.4742393792, 0.059028469, -0.3070830405, 0.0487827733, 0.0607668161, -0.1974307597, 0.0964795202, 0.0146514624, 0.1217677221, 0.1369762272, 0.1712832749, 0.0307992958, 0.4250538945, -0.053261742, 0.2902284861, 0.1436615139, 0.1730930954, 0.2801124752, -0.1230008826, -0.1648174524, -0.1834214777, -0.0149281193, -0.2281157523, 0.2769262195, -0.2383160591, -0.0286651216, 0.184367612, 0.3846006393, 0.5537834167, 0.1585489362, 0.0089074718, -0.066409938, 0.1120339409, -0.1739785224, 0.0375585034, 0.201029554, 0.4397955835, -0.1216783524, 0.1304984689, 0.3467441201, -0.2371854931, -0.1927651763, 0.1611761004, 0.4595686197, -0.136692822, 0.03590573, 0.1399312019, 0.0546212383, -0.0069568604, -0.140350908, 0.1283729374, 0.0266116988, 0.0465464815, -0.2296458632, 0.4097220004, 0.1429581493, -0.0815552026, 0.1501867771, -0.347533226, 0.0019551818, 0.341055274, -0.1524553448, -0.0454497449, 0.1050021127, 0.6036854386, -0.0399987586, -0.3411640823, -0.0343073532, 0.5274826884, 0.1017360464, -0.1091588065, -0.3369091153, -0.2871398628, -0.2651318014, 0.0117882639, -0.1132320687, -0.2011547536, 0.1153096035, 0.2378167063, -0.2011549622, -0.6774238944, -0.2983497381, 0.0227557514, -0.1241077781, -0.1449489444, 0.2098423094, 0.4280456007, -0.0640470013, 0.0502664894, 0.5844967961, 0.3379956782, 0.3474578261, -0.2088451385, -0.0027255681, 0.1122177765, 0.011593624, -0.2457559705, 0.3455429077, 0.0748103261, -0.060315989, 0.3822261989, 0.0945060849, -0.145935446, -0.2766557634, 0.1253265291, -0.2008282989, -0.1304688603, 0.4320133924, -0.2141464949, 0.0450591519, -0.2039668411, 0.0448369011, -0.3329180181, 0.1637922376, 0.5231641531, 0.054901801, 0.1952823699, -0.3426961303, 0.059301246, -0.0701015517, 0.7746465802, 0.3278966546, 0.1063386649, -0.3810440302, -0.2430897951, -0.9569470882, -0.2136805356, -0.1736373007, 0.2115758508, -0.0691614002, 0.2186158001, 0.1369338185, 0.23082003, 0.0730832592, 0.495624572, 0.0183100235, -0.0512790643, -0.4442254007, 0.0265101995, 0.1034281328, -0.1029868722, -0.021180708, -0.1284391731, 0.3681437075, -0.5790625811, -0.0293165036, -0.3203985095, 0.0675374568, -0.1546666473, 0.5107827187, 0.1049055904, 0.2914257348, 0.4872879088, 0.1722445786, -0.1365395039, -0.2456261814, -0.1868421137, 0.0769093633, 0.2122346014, -0.1695900261, 0.2420996726, -0.1548056006, 0.0563739538, -0.2551071942, -0.0378179289, -0.2682904899, -0.0143332584, -0.0254047383, 0.0842682123, -0.081028983, 0.0937444717, 0.1031431481, 0.1714036763, -0.1260122657, 0.1677506119, -0.3540553451, -0.4014781117, 0.4523611069, -0.2661022842, -0.190933764, -0.2678647041, 0.2520735562, 0.1884663999, 0.0888338313, -0.5078630447, -0.0687040091, 0.3283727169, -0.2275224328, -0.1473041922, 0.2823517323, -0.1936615705, -0.3195129931, -0.0002879479, 0.1741589755, 0.2486368567, -0.369025737, 0.0640238225, -0.08805684 ]
https://github.com/huggingface/datasets/issues/488
issues with downloading datasets for wmt16 and wmt19
Further, `nlp.load_dataset('wmt19', 'ru-en')` has only the `train` and `val` datasets. `test` is missing. Fixed locally for summarization needs, by running: ``` pip install sacrebleu sacrebleu -t wmt19 -l ru-en --echo src > test.source sacrebleu -t wmt19 -l ru-en --echo ref > test.target ``` h/t @sshleifer
I have encountered multiple issues while trying to: ``` import nlp dataset = nlp.load_dataset('wmt16', 'ru-en') metric = nlp.load_metric('wmt16') ``` 1. I had to do `pip install -e ".[dev]" ` on master, currently released nlp didn't work (sorry, didn't save the error) - I went back to the released version and now it worked. So it must have been some outdated dependencies that `pip install -e ".[dev]" ` fixed. 2. it was downloading at 60kbs - almost 5 hours to get the dataset. It was downloading all pairs and not just the one I asked for. I tried the same code with `wmt19` in parallel and it took a few secs to download and it only fetched data for the requested pair. (but it failed too, see below) 3. my machine has crushed and when I retried I got: ``` Traceback (most recent call last): File "./download.py", line 9, in <module> dataset = nlp.load_dataset('wmt16', 'ru-en') File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/builder.py", line 449, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/stas/anaconda3/envs/main/lib/python3.7/contextlib.py", line 112, in __enter__ return next(self.gen) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/stas/anaconda3/envs/main/lib/python3.7/os.py", line 221, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/stas/.cache/huggingface/datasets/wmt16/ru-en/1.0.0/4d8269cdd971ed26984a9c0e4a158e0c7afc8135fac8fb8ee43ceecf38fd422d.incomplete' ``` it can't handle resumes. but neither allows a new start. Had to delete it manually. 4. and finally when it downloaded the dataset, it then failed to fetch the metrics: ``` Traceback (most recent call last): File "./download.py", line 15, in <module> metric = nlp.load_metric('wmt16') File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 442, in load_metric module_path, hash = prepare_module(path, download_config=download_config, dataset=False) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 258, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/utils/file_utils.py", line 198, in cached_path local_files_only=download_config.local_files_only, File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/utils/file_utils.py", line 356, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://s3.amazonaws.com/datasets.huggingface.co/nlp/metrics/wmt16/wmt16.py ``` 5. If I run the same code with `wmt19`, it fails too: ``` ConnectionError: Couldn't reach https://storage.googleapis.com/tfdataset-data/downloadataset/uncorpus/UNv1.0.en-ru.tar.gz ```
45
issues with downloading datasets for wmt16 and wmt19 I have encountered multiple issues while trying to: ``` import nlp dataset = nlp.load_dataset('wmt16', 'ru-en') metric = nlp.load_metric('wmt16') ``` 1. I had to do `pip install -e ".[dev]" ` on master, currently released nlp didn't work (sorry, didn't save the error) - I went back to the released version and now it worked. So it must have been some outdated dependencies that `pip install -e ".[dev]" ` fixed. 2. it was downloading at 60kbs - almost 5 hours to get the dataset. It was downloading all pairs and not just the one I asked for. I tried the same code with `wmt19` in parallel and it took a few secs to download and it only fetched data for the requested pair. (but it failed too, see below) 3. my machine has crushed and when I retried I got: ``` Traceback (most recent call last): File "./download.py", line 9, in <module> dataset = nlp.load_dataset('wmt16', 'ru-en') File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/builder.py", line 449, in download_and_prepare with incomplete_dir(self._cache_dir) as tmp_data_dir: File "/home/stas/anaconda3/envs/main/lib/python3.7/contextlib.py", line 112, in __enter__ return next(self.gen) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/builder.py", line 422, in incomplete_dir os.makedirs(tmp_dir) File "/home/stas/anaconda3/envs/main/lib/python3.7/os.py", line 221, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists: '/home/stas/.cache/huggingface/datasets/wmt16/ru-en/1.0.0/4d8269cdd971ed26984a9c0e4a158e0c7afc8135fac8fb8ee43ceecf38fd422d.incomplete' ``` it can't handle resumes. but neither allows a new start. Had to delete it manually. 4. and finally when it downloaded the dataset, it then failed to fetch the metrics: ``` Traceback (most recent call last): File "./download.py", line 15, in <module> metric = nlp.load_metric('wmt16') File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 442, in load_metric module_path, hash = prepare_module(path, download_config=download_config, dataset=False) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/load.py", line 258, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/utils/file_utils.py", line 198, in cached_path local_files_only=download_config.local_files_only, File "/mnt/nvme1/code/huggingface/nlp-master/src/nlp/utils/file_utils.py", line 356, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://s3.amazonaws.com/datasets.huggingface.co/nlp/metrics/wmt16/wmt16.py ``` 5. If I run the same code with `wmt19`, it fails too: ``` ConnectionError: Couldn't reach https://storage.googleapis.com/tfdataset-data/downloadataset/uncorpus/UNv1.0.en-ru.tar.gz ``` Further, `nlp.load_dataset('wmt19', 'ru-en')` has only the `train` and `val` datasets. `test` is missing. Fixed locally for summarization needs, by running: ``` pip install sacrebleu sacrebleu -t wmt19 -l ru-en --echo src > test.source sacrebleu -t wmt19 -l ru-en --echo ref > test.target ``` h/t @sshleifer
[ -0.2756032646, -0.0938133299, -0.0165135507, 0.5474311113, 0.0739605203, -0.0815913752, 0.0184083302, 0.1925771534, 0.180172801, -0.0740144625, -0.0608426593, 0.022961434, -0.1682557166, 0.0706975088, 0.1812845916, -0.0102872066, -0.0982713848, 0.0546426512, -0.5839900374, -0.106612727, -0.251978904, 0.1597540379, -0.1889989972, 0.0316228233, 0.0291602127, -0.1472723037, -0.0056705922, 0.033885099, -0.422670126, -0.3919169605, 0.4446609318, 0.1778903753, 0.0486655571, 0.2788917422, -0.0001182758, -0.2390264869, 0.228801474, 0.0146838529, -0.3021409512, -0.1883608252, -0.2656502724, -0.541665554, 0.1796255708, 0.0793974623, 0.1905766129, -0.2577369511, -0.096332401, -0.1201573461, 0.3336130083, 0.154108882, 0.1808845997, 0.4754364192, 0.1862676144, 0.0183087811, 0.146319896, 0.1829879135, -0.0161831081, 0.0414136313, 0.3683443666, -0.1451098472, 0.3042301536, 0.2626514435, -0.1972894222, 0.3405378759, 0.2254596502, 0.0342917591, 0.2514486611, -0.3291009068, -0.0104289073, 0.3739079833, 0.0919396207, -0.0189395882, -0.2833078504, -0.3328357935, -0.0607210845, -0.5919567347, 0.0915091634, 0.3554452658, -0.3222124279, -0.0712232813, -0.51800704, 0.0008274867, 0.094512701, 0.3394877911, -0.1083700508, 0.3477391005, 0.0328621306, 0.1435944736, 0.1835632026, -0.3430738151, -0.1032524034, -0.3144377768, 0.2530843616, 0.2212259918, -0.2552488446, 0.0872772932, 0.0101170018, 0.0087075336, 0.0032322162, -0.0976790935, -0.0223416463, 0.1039453968, -0.138657093, 0.035780441, 0.1094087958, 0.2143314183, -0.0763304159, -0.0989685655, 0.2642333508, -0.034821827, 0.2747760415, 0.2433938831, 0.1871810108, -0.1478898078, -0.3470748365, 0.0696833432, 0.1543292999, -0.2491887957, -0.3024493158, -0.0835246518, 0.0652419478, -0.2730256617, 0.0408263579, 0.0257638413, -0.2994417846, 0.2130641639, 0.0610917211, 0.1647906005, -0.2455626279, -0.1874855161, -0.1245098412, -0.2107741833, -0.0994958431, 0.1155643761, 0.6232810616, 0.0698021203, 0.2070061266, 0.1056847274, -0.1488352865, 0.1095467284, -0.0190163478, -0.1189082414, 0.1222631633, 0.2221131772, 0.0451028831, 0.4238991141, -0.1189092994, 0.0161674805, -0.1315834969, -0.1299054325, -0.0583826862, 0.0434743427, 0.2906780839, 0.2067488581, -0.3159321845, -0.0533834025, -0.2992138863, 0.0907551423, -0.1152078137, -0.03388118, -0.1886042356, -0.2438193858, -0.3752390742, -0.2526578009, 0.376717329, 0.2799051702, -0.1666075587, -0.1649062783, -0.0837729201, 0.0289436821, 0.3123577535, 0.4445022941, -0.2286303341, 0.0464230031, -0.1588804126, -0.0510552451, 0.3584416211, -0.3500112295, -0.1459338069, 0.0142126624, -0.0908054337, 0.2117910236, -0.0302684959, 0.0880926326, 0.2926702797, -0.1595734209, 0.2096132934, 0.4093493223, -0.0834694505, -0.1281997114, -0.2435816824, -0.4912776053, 0.6207735538, 0.0323618762, 0.1447011679, -0.3409755826, -0.0999756753, -0.1594638377, 0.4071717262, 0.1020297334, 0.1387521327, -0.0597011633, -0.0496112145, -0.0825744346, -0.0716121271, -0.0022223559, -0.4874588251, 0.3761880398, -0.2441597432, 0.1380984634, 0.0267381836, 0.2019914687, -0.0252640247, -0.1451211572, -0.109334603, -0.1639740765, 0.0372415446, 0.0199690778, 0.0985343978, -0.0397356041, 0.0781111568, 0.0820712596, -0.0402478613, 0.1321013719, -0.2335658818, 0.2222176492, 0.0546638295, -0.0288111623, 0.3562950492, 0.283198446, 0.1775621623, -0.0596049726, -0.0277687889, -0.0303029064, -0.0066435118, 0.4922425151, -0.1041980907, -0.0141535439, 0.339463532, -0.4042291045, 0.1655756086, 0.2719748914, 0.2212738395, -0.3597030342, 0.017089989, 0.2387667447, -0.0915701538, 0.3743445873, 0.1100304797, 0.0123178959, 0.011361884, 0.0139468918, -0.089154087, -0.0341479219, 0.4079686999, -0.0964394733, 0.0220887046, 0.0996987522, -0.0303345602, 0.2387857288, 0.2519141734, 0.1178978384, 0.0268233772, -0.0370241143, -0.1333162636, -0.137072131, -0.1800832152, 0.2379727513, 0.5232090354, 0.1820148826, 0.1907967031, 0.090906024, 0.0877680108, -0.4019683897, 0.3726391494, 0.2383789122, -0.0019472515, 0.1320959777, 0.0430690013, -0.0163698439, -0.1104835421, 0.4184348881, 0.0917635038, 0.1791214645, -0.2323915362, -0.24925524, -0.581091404, -0.4634238482, -0.4940528274, -0.3730905652, -0.3810459673, -0.3317368329, -0.1937680542, -0.0642360374, -0.0816403031, 0.1759491712, 0.1689739227, 0.0007636669, -0.3557636738, 0.4598481655, -0.0278812461, -0.0493742451, -0.3101086915, 0.017224703, 0.4009832144, 0.1410497427, 0.4067271948, 0.0004273241, -0.0131985834, 0.0081043523, -0.3204091787, -0.0419830568, -0.0738796368, 0.2629975677, 0.1375834495, 0.2869310081, 0.2675926387, -0.0940292105, 0.1489827633, -0.2181364894, -0.051485911, -0.1704598665, -0.0215498284, 0.0187395867, -0.2237057984, -0.4680874944, -0.7113642693, -0.3568281233, 0.1662412882, 0.0643552765, 0.0964023769, 0.3763367534, -0.2669000626, -0.0048243115, -0.0431200229, 0.1872793734, -0.1405702978, 0.1058703735, 0.3484725356, -0.0433362275, -0.4463670552, 0.0350137092, 0.1576627642, 0.2508547306, 0.1007581949, -0.4295146465, 0.3669920564, -0.1442828327, -0.1073543876, 0.2240203619, 0.1611542106, 0.1435948312, -0.0059769396, -0.0148709388, -0.038559746, -0.2719135582, -0.0486938655, -0.0559321344, 0.2735079825, 0.0550434999, 0.1221249029, 0.0208202787, 0.5913624167, 0.2570455372, -0.0870675966, 0.1685412824, 0.223955065, 0.0688811094, 0.3214882612, -0.5713627934, 0.0624388866, 0.014921315, 0.2643274665, 0.2561018765, -0.0245563425, -0.0789707452, -0.3335883021, 0.0456078053, -0.2322386503, -0.3285509348, -0.0424313582, 0.2228121758, 0.2037611604, 0.3823131919, 0.1332702935, -0.0036636607, -0.3344186544, -0.1921595782, -0.0713422075, -0.0795904025, 0.141065374, -0.3056294322, -0.3055721521, -0.3390578628, 0.185380742, 0.0123059107, 0.6306857467, -0.1004619151, 0.0602538213, 0.0003579604, 0.053595975, 0.2863096297, -0.0149865774, 0.2238219082, -0.0550032705, 0.0418631211, -0.707555294, -0.0788407475, -0.1490832269, -0.1024420038, 0.3979473114, 0.2676808834, -0.3344469666, -0.3497640193, 0.12868765, 0.4699043632, -0.3002050221, -0.0902624801, -0.0001841009, -0.1544872373, -0.1256389618, -0.1509197354, -0.2789452672, 0.1925429106, -0.3451685607, 0.0452709123, 0.180113852, 0.0680587813, 0.3399453759, -0.0267141666, 0.0946662799, 0.1880124211, 0.4270005524, 0.3394293189, 0.1034898013, 0.0907358229, 0.3604838848, -0.0748464689, 0.3105949461, -0.1079983413, -0.0581992604, 0.2565921545, 0.5723102689, -0.0812101737, 0.2673698068, 0.0279870126, 0.0784471557, -0.4492249191, 0.0794502795, 0.3588107228, -0.1368250549, -0.2159992456, -0.2861743271, 0.3259079754, 0.2019694895, -0.1109419689, 0.2802772224, -0.1149720177, -0.3127883971, -0.1978131086, 0.0408773832, 0.9505412579, 0.2387177497, 0.2275000513, -0.0095484694, -0.4000633359, 0.4883538783, 0.4271090925, -0.1436376721, -0.0481960289, 0.3191525042, -0.0039903526, -0.1169139072, 0.0799547508, -0.0163565576, -0.1558756381, 0.5566449165, 0.3277595043, 0.1902879775, 0.0671358258, 0.3798568249, 0.0089372285, -0.3773044646, -0.2538489997, 0.0673444644, -0.359387815, 0.2783209383, -0.1393685639, -0.3252617121, 0.0053059012, -0.2072426379, -0.3205972016, 0.0383540913, -0.4705601335, 0.1999382526, -0.1084300354, -0.048495058, 0.19131203, -0.0939291418, 0.023355186, 0.1939816475, -0.3421662152, 0.0471422859, -0.4583494067, 0.2351855338, 0.0417988636, 0.0699068978, -0.0019242037, -0.1840398014, -0.1144268066, -0.2535885274, 0.0115258005, 0.337092042, -0.0575815178, 0.0259476099, 0.1794766039, 0.1735762358, -0.0933970958, 0.1255259514, 0.1240274608, -0.137656197, 0.1038089767, 0.2577847838, -0.0941022262, 0.5929931402, 0.1446929872, -0.0829001591, -0.1528958082, 0.5256069303, 0.0521146804, -0.146619007, 0.4898710251, 0.5510687828, -0.1143533587, -0.2417031229, -0.0041619306, -0.3494574428, -0.484570235, -0.0105191981, 0.0329331867, 0.3049018085, 0.0559950545, 0.5251324773, 0.2182417661, -0.2787427008, 0.157030195, -0.4990169704, -0.1411264092, 0.3006082475, 0.0930177271, 0.0704480186, -0.113818571, 0.0523061603, 0.0783455297, 0.3154847622, -0.2897269428, 0.1905989051, -0.0451219566, 0.1344131082, 0.2483337969, -0.2423755378, 0.1088933498, -0.0465252101, -0.0645427704, -0.1267764121, -0.4485757351, -0.1471535712, -0.2247589231, 0.1452783048, -0.0036858174, -0.4742393792, 0.059028469, -0.3070830405, 0.0487827733, 0.0607668161, -0.1974307597, 0.0964795202, 0.0146514624, 0.1217677221, 0.1369762272, 0.1712832749, 0.0307992958, 0.4250538945, -0.053261742, 0.2902284861, 0.1436615139, 0.1730930954, 0.2801124752, -0.1230008826, -0.1648174524, -0.1834214777, -0.0149281193, -0.2281157523, 0.2769262195, -0.2383160591, -0.0286651216, 0.184367612, 0.3846006393, 0.5537834167, 0.1585489362, 0.0089074718, -0.066409938, 0.1120339409, -0.1739785224, 0.0375585034, 0.201029554, 0.4397955835, -0.1216783524, 0.1304984689, 0.3467441201, -0.2371854931, -0.1927651763, 0.1611761004, 0.4595686197, -0.136692822, 0.03590573, 0.1399312019, 0.0546212383, -0.0069568604, -0.140350908, 0.1283729374, 0.0266116988, 0.0465464815, -0.2296458632, 0.4097220004, 0.1429581493, -0.0815552026, 0.1501867771, -0.347533226, 0.0019551818, 0.341055274, -0.1524553448, -0.0454497449, 0.1050021127, 0.6036854386, -0.0399987586, -0.3411640823, -0.0343073532, 0.5274826884, 0.1017360464, -0.1091588065, -0.3369091153, -0.2871398628, -0.2651318014, 0.0117882639, -0.1132320687, -0.2011547536, 0.1153096035, 0.2378167063, -0.2011549622, -0.6774238944, -0.2983497381, 0.0227557514, -0.1241077781, -0.1449489444, 0.2098423094, 0.4280456007, -0.0640470013, 0.0502664894, 0.5844967961, 0.3379956782, 0.3474578261, -0.2088451385, -0.0027255681, 0.1122177765, 0.011593624, -0.2457559705, 0.3455429077, 0.0748103261, -0.060315989, 0.3822261989, 0.0945060849, -0.145935446, -0.2766557634, 0.1253265291, -0.2008282989, -0.1304688603, 0.4320133924, -0.2141464949, 0.0450591519, -0.2039668411, 0.0448369011, -0.3329180181, 0.1637922376, 0.5231641531, 0.054901801, 0.1952823699, -0.3426961303, 0.059301246, -0.0701015517, 0.7746465802, 0.3278966546, 0.1063386649, -0.3810440302, -0.2430897951, -0.9569470882, -0.2136805356, -0.1736373007, 0.2115758508, -0.0691614002, 0.2186158001, 0.1369338185, 0.23082003, 0.0730832592, 0.495624572, 0.0183100235, -0.0512790643, -0.4442254007, 0.0265101995, 0.1034281328, -0.1029868722, -0.021180708, -0.1284391731, 0.3681437075, -0.5790625811, -0.0293165036, -0.3203985095, 0.0675374568, -0.1546666473, 0.5107827187, 0.1049055904, 0.2914257348, 0.4872879088, 0.1722445786, -0.1365395039, -0.2456261814, -0.1868421137, 0.0769093633, 0.2122346014, -0.1695900261, 0.2420996726, -0.1548056006, 0.0563739538, -0.2551071942, -0.0378179289, -0.2682904899, -0.0143332584, -0.0254047383, 0.0842682123, -0.081028983, 0.0937444717, 0.1031431481, 0.1714036763, -0.1260122657, 0.1677506119, -0.3540553451, -0.4014781117, 0.4523611069, -0.2661022842, -0.190933764, -0.2678647041, 0.2520735562, 0.1884663999, 0.0888338313, -0.5078630447, -0.0687040091, 0.3283727169, -0.2275224328, -0.1473041922, 0.2823517323, -0.1936615705, -0.3195129931, -0.0002879479, 0.1741589755, 0.2486368567, -0.369025737, 0.0640238225, -0.08805684 ]
https://github.com/huggingface/datasets/issues/486
Bookcorpus data contains pretokenized text
Yes indeed it looks like some `'` and spaces are missing (for example in `dont` or `didnt`). Do you know if there exist some copies without this issue ? How would you fix this issue on the current data exactly ? I can see that the data is raw text (not tokenized) so I'm not sure I understand how you would do it. Could you provide more details ?
It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575
69
Bookcorpus data contains pretokenized text It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575 Yes indeed it looks like some `'` and spaces are missing (for example in `dont` or `didnt`). Do you know if there exist some copies without this issue ? How would you fix this issue on the current data exactly ? I can see that the data is raw text (not tokenized) so I'm not sure I understand how you would do it. Could you provide more details ?
[ 0.1711835116, 0.225409016, -0.0682412758, 0.348398, -0.1143137068, -0.2559942603, -0.1209408641, 0.2354476005, -0.4317489266, 0.1244579107, -0.0878596976, 0.226624921, 0.3232101202, -0.1945854723, -0.0046417536, 0.1363855898, 0.2212242782, 0.3154222965, 0.1631607413, -0.2263964117, -0.1609850675, 0.2912673056, 0.1281991452, -0.0333509259, -0.2382830828, -0.3374489844, -0.2922903895, 0.2494610101, -0.1388569772, -0.4692249298, 0.0219639391, 0.3137598038, -0.0443145446, 0.3362242579, -0.0001108157, -0.2952581942, -0.0561968051, -0.0524775125, -0.2681583166, -0.0142239677, 0.2646718621, -0.0555805489, 0.3515129685, -0.4346839786, -0.3570384383, 0.0960465297, -0.1705734879, -0.0543899164, 0.3019438386, 0.1815720052, 0.2007732987, 0.222960338, -0.1164248139, 0.2234888524, 0.2198397666, -0.0061345729, -0.1732556969, 0.1943600774, 0.5178597569, 0.2606928647, -0.0824629441, 0.3769720495, -0.1626884937, -0.1177664399, 0.0906070843, 0.0341894887, 0.0038018613, -0.1884815246, 0.1414441168, 0.1694198251, 0.2140864134, -0.160731405, -0.1241178736, -0.1997770071, 0.0149028283, -0.1498395205, 0.3236135244, -0.0014167138, 0.1347052455, 0.0760393515, -0.2752537429, -0.1492273659, -0.0142614134, 0.3484379351, -0.0572863296, 0.3520624638, -0.0388948433, -0.038191285, -0.1972889453, -0.1449822783, -0.2161724716, 0.1024224311, -0.3670475483, -0.0338460021, -0.0150922658, -0.1852910668, -0.105325602, 0.3172924519, -0.0513034388, 0.1927741021, 0.1294379234, 0.1439671665, -0.1002327129, -0.0902266577, 0.0809146091, 0.1594157517, 0.1486369818, 0.2822787762, 0.0600121878, 0.0032296851, -0.3305778503, -0.1897462457, 0.0025670663, -0.0278816894, -0.0324559249, 0.0732344314, -0.0350144133, -0.4501478672, 0.2254944593, 0.1886161119, -0.0430537499, 0.2807796299, -0.0074397633, 0.1009570882, -0.0965369493, 0.0122184418, 0.2783245742, 0.1033929139, -0.160513103, -0.1804707646, -0.1714457572, -0.0501715243, -0.30320099, 0.0928245187, 0.1805255115, 0.0485843308, 0.1871945709, 0.0892736986, -0.0540960655, 0.0202349462, -0.1291191131, -0.1583364755, 0.2625415027, 0.0551410355, -0.0162990093, 0.2405932248, -0.0453126952, -0.0048083197, -0.1340313703, 0.0975833982, -0.33436957, 0.2123456299, -0.381257534, 0.1735199094, -0.3609198332, -0.2368097901, -0.0987070501, -0.0088431844, 0.3678666949, -0.3480276465, 0.3336297274, 0.0685062036, -0.0781442001, -0.0212077163, -0.1076177359, 0.2046420574, -0.1081338599, -0.1003819779, -0.1654624194, 0.2421966791, 0.4265680313, 0.1452923119, -0.0860857293, 0.0135069173, 0.1440581679, 0.8647391796, 0.1361807585, -0.1356699318, -0.475800246, 0.3001531363, 0.0183857847, 0.0494006164, -0.0647801235, -0.1640852839, 0.3293263614, 0.0272320751, -0.1755459905, 0.1206778958, 0.4675884247, 0.1378511041, -0.636767745, -0.1789666265, 0.3183294535, 0.0800498873, -0.0470184349, -0.0316238999, 0.1690010577, 0.0419173613, 0.0185093004, -0.2328215092, 0.2899688482, 0.4480452538, 0.277297765, 0.347307682, 0.1860029995, -0.0661410987, 0.147070244, -0.0265918151, -0.6945602894, 0.5669016838, -0.2257547379, -0.3093991876, 0.0004436689, -0.3298886418, -0.0985440314, 0.0407632254, 0.2374934703, 0.2225189358, -0.0592684224, 0.331553638, 0.1590391099, -0.0570656583, 0.1234895661, 0.2014556378, -0.2365749627, 0.1906154156, -0.10246934, -0.309956789, -0.0879071057, 0.4058860242, 0.4630974233, -0.0385713167, -0.2972508967, 0.6062343121, -0.3367237449, 0.2219973803, -0.2077531964, 0.1725815237, 0.3421443999, 0.0432180464, 0.1004516333, 0.6402655244, 0.2788158655, -0.0066328086, 0.1500729918, 0.5099728107, 0.322512418, -0.084119767, 0.0058407206, -0.0700924918, 0.1578991264, -0.3809229732, 0.2004099637, -0.12491671, 0.2203352004, -0.0428412445, 0.123330228, 0.3034805357, -0.2406615913, 0.2080424577, 0.4111533761, -0.0495022759, 0.1402170658, 0.1452305168, -0.2254825681, -0.3757795691, 0.096760489, 0.0503881611, 0.1027320474, 0.1209967434, -0.0806207135, -0.0165553335, 0.3039056063, -0.3542490602, 0.2387604117, 0.1112501547, -0.2931631505, 0.0804679841, 0.297873795, 0.3431167006, -0.3636701405, 0.0125108939, -0.0580735169, 0.1891940087, -0.1028235182, 0.2186202854, -0.316539526, -0.7242130041, 0.0452751555, 0.0116357338, -0.1649996787, -0.2254278362, 0.3410965502, -0.0040558479, -0.146143496, 0.0730764866, 0.2235152423, 0.3386719227, -0.3230763078, -0.1607567072, -0.2665174901, -0.3520280719, -0.7646340728, 0.1563432515, 0.13348037, 0.0910891071, -0.0997747108, -0.2050938904, 0.0495029688, -0.2066181004, -0.2803928256, 0.0593724437, -0.1930375248, -0.1592745185, 0.0604400523, -0.0513258576, -0.3704756498, -0.306361258, -0.0696581304, -0.2150731832, -0.1219451576, 0.2372481227, -0.2543060184, -0.4921057224, -0.4656762481, -0.4422763586, -0.0322483853, -0.1254856288, 0.2829439342, 0.1891656071, 0.010901195, 0.301192522, -0.3569282293, 0.0509783253, 0.1335723847, 0.393969208, -0.2407730818, -0.4349058568, 0.3319371641, -0.0415876321, -0.3880457878, -0.0198516566, 0.1343085915, 0.0125373602, -0.0809673294, -0.4142768085, 0.2543447614, -0.2746358514, 0.0899760053, 0.0099537857, -0.0172473881, 0.3932930529, 0.0561426617, -0.2075249404, -0.0990404114, -0.0020557595, 0.2808194757, 0.3053600788, 0.3586890101, -0.3069499135, -0.1700131148, 0.0090946639, -0.0627480522, -0.1406327039, -0.1806910336, 0.4801080823, -0.1187061891, 0.2573771477, -0.1555953473, -0.026078308, 0.1532065719, -0.174657926, -0.0243707243, 0.7594630718, 0.0098682679, -0.3053727448, -0.0623556264, -0.4967705011, -0.6557120085, -0.5054523349, -0.0710998327, -0.1472119093, 0.1028706208, 0.0756937712, -0.0286355428, 0.065507628, -0.5048431754, 0.0048911506, 0.1783987284, -0.0184359904, -0.030323552, -0.4487184286, 0.2572934628, -0.3311731517, 0.3807837367, -0.0455914922, 0.0179858226, -0.1406439096, 0.1126988679, 0.2615388632, -0.1235289276, 0.1620298624, 0.0080638062, 0.0107143885, 0.1937719285, -0.152654618, -0.0026584982, -0.0676653758, -0.153968364, 0.1622392386, 0.3666578531, 0.2105139643, -0.3340783119, -0.0206139144, -0.3664177656, 0.1761317849, -0.1587234586, 0.3018682003, -0.0259895027, -0.0875349268, -0.3132630289, 0.0464816019, 0.1347438842, 0.5419650674, 0.1058680341, -0.0064763115, 0.0495661795, 0.1654444486, 0.2462301403, 0.235347569, 0.5685105324, -0.2812578678, -0.1022605449, -0.0955819488, 0.1699772924, 0.0980620831, 0.3154862821, 0.0730682909, -0.007116646, -0.0959684625, -0.3180463016, -0.107263878, 0.379450798, 0.0490492024, 0.320869118, 0.1861804873, -0.0182294399, 0.0914767832, 0.1371530592, -0.0602617338, -0.0930711627, -0.0335598812, 0.0151791722, 0.1516721398, 0.0272317305, -0.0395203829, -0.0180928372, 0.1867927909, -0.5031012893, 0.620418489, -0.0008973875, 1.2612764835, 0.1932476014, 0.2816485763, 0.0721576363, 0.0877827555, 0.2446511388, -0.51476264, -0.117167443, -0.2032098174, 0.2356711179, -0.0472662672, 0.4142563939, -0.0621233433, 0.044315841, -0.3159230351, 0.1781925112, -0.1872998774, 0.195523873, -0.0353264362, -0.0026301427, 0.1325232983, -0.3006357849, 0.0733421668, 0.1304014474, -0.1342478842, 0.0691552684, 0.0287465993, -0.3014599383, -0.3858852386, -0.1688600779, -0.3367709219, 0.1540474147, -0.0842111483, -0.0488002934, 0.2964712083, -0.0255131423, -0.0934051201, 0.2621547878, 0.4480491281, 0.355702728, -0.3563839197, 0.2410062551, 0.0586007982, 0.0303224772, 0.1675304621, 0.2808724344, 0.2103385329, -0.1832423061, 0.0490229875, -0.2144333571, -0.1476319134, -0.144390747, -0.1899317801, -0.0150398351, 0.0474709384, -0.3482374847, -0.1098543257, 0.1363227069, -0.3647048473, -0.3153706491, 0.1473478824, -0.1926614791, -0.1967437863, -0.0320673957, 0.0646403208, -0.2907953858, -0.1841213703, 0.3845703304, 0.1932664663, -0.0776366219, 0.3896777034, -0.0795746818, -0.1772790551, -0.3628854454, -0.0967233256, 0.3678475022, -0.518849194, 0.2787395716, -0.0351922885, -0.2901852131, 0.2774505019, 0.7058489323, 0.0832635835, 0.3054119349, -0.1391420662, -0.3576369584, 0.0650568604, 0.0816207826, 0.0107037285, 0.1169684455, 0.3884269893, 0.4844402671, -0.0018328596, -0.226923123, -0.3512559235, 0.2829186916, -0.3311581612, 0.2968037426, -0.1983088106, -0.0599050075, -0.1090956032, -0.1000982523, 0.0295818467, 0.2926208675, 0.0739405602, -0.2269207984, -0.3539004326, 0.1085513458, 0.2140669972, 0.0486707799, -0.0785531849, 0.0373881646, 0.0986026078, -0.1802547425, -0.0454195999, -0.0931110606, 0.0363426954, 0.4058868885, 0.1728238165, 0.1893000305, -0.4371962845, -0.0833617747, -0.1115267351, -0.0858325362, -0.1863232404, 0.0574383736, -0.1623053253, -0.1390862614, 0.0167728905, 0.0274891704, 0.0644908398, 0.3385528326, 0.2382495403, 0.1366111189, 0.0127725955, 0.2071965933, 0.1874640435, 0.2976182997, -0.0923379213, -0.393864125, 0.2880006731, 0.2218120545, -0.1930509061, -0.3196575344, -0.0593455508, -0.3006490767, -0.0258532558, -0.005721835, 0.5143332481, -0.2840703726, 0.0530100614, 0.0542978793, 0.3861447871, -0.0326832347, 0.2601009905, 0.3640582561, -0.0215336438, 0.0841230154, 0.1158100739, -0.0529194213, -0.2634903193, 0.4093242288, 0.0434785597, 0.4805606008, 0.4735280573, 0.2181145549, 0.009259372, 0.1857918203, 0.3121899962, 0.0123446975, 0.2001439482, 0.3483905196, 0.0653684512, 0.1877522767, -0.0765119568, -0.4006660283, -0.0514734015, 0.1714375317, -0.4195894003, 0.0145129049, -0.279168427, -0.0921411067, -0.1563066095, -0.137453109, -0.2533434033, 0.1310719848, 0.0345612131, -0.0306949485, -0.0264233872, -0.3715113103, -0.1213359684, -0.2162145674, 0.2671532035, -0.2426276803, 0.4080795646, 0.1121293306, -0.0916346088, 0.0142586287, 0.1875008643, 0.2888579369, 0.2417784631, -0.0892019272, -0.0316662565, -0.0248266608, -0.102805309, 0.1605054885, 0.2988032997, 0.2712017, 0.0629225448, -0.0137732411, 0.043095544, -0.1788428575, 0.2997132242, -0.134192273, 0.183720991, 0.157205537, 0.1254207045, 0.1399513781, -0.2528883517, -0.2671346962, -0.2466675192, -0.3726021647, 0.0224105492, 0.0989461541, 0.0139142033, 0.1304582953, -0.2182957977, 0.1071202084, 0.1318564117, 0.6128297448, 0.3352700174, -0.1319622397, -0.1983518004, -0.2101866603, -0.3865145445, 0.2486064881, 0.1450931728, -0.2164660096, -0.0558158159, -0.1605851352, 0.0225552469, -0.08820609, -0.3286336958, 0.283156842, -0.1476365477, -0.2638460994, -0.4621171355, 0.3192758262, 0.1612539142, -0.1303878129, -0.0027053228, -0.0093034189, 0.157031253, -0.0393294953, 0.0818502381, -0.0957189426, -0.5678965449, -0.0521933623, 0.2463183254, 0.1098826379, 0.3386010528, 0.0294408593, -0.297224164, 0.1576797664, 0.030102361, -0.2671938241, -0.0897212848, 0.0611119345, 0.2313503027, 0.2754621506, 0.074269183, 0.3054206669, -0.1224618629, 0.1058150902, 0.1703938693, 0.2043981105, -0.2765967846, -0.0157864653, -0.0840038359, -0.0624203086, 0.103612788, 0.5216318965, 0.0051863906, -0.0991421938, -0.381359607, -0.5017679334, 0.4677008688, -0.4028333127, -0.2314209342, -0.0074710511, 0.1788393259, 0.5742585659, -0.0790819526, -0.6015177369, -0.0861020684, 0.2420421243, -0.0026646499, -0.4625404179, 0.2797017992, -0.0554504432, -0.0989713967, -0.0140886568, 0.3603188694, 0.4206546247, -0.095274806, 0.1268049479, -0.2433049679 ]
https://github.com/huggingface/datasets/issues/486
Bookcorpus data contains pretokenized text
I'm afraid that I don't know how to obtain the original BookCorpus data. I believe this version came from an anonymous Google Drive link posted in another issue. Going through the raw text in this version, it's apparent that NLTK's TreebankWordTokenizer was applied on it (I gave some examples in my original post), followed by: `' '.join(tokens)` You can retrieve the tokenization by splitting on whitespace. You can then "detokenize" it with TreebankWordDetokenizer class of NLTK (though, as I suggested, use the fixed version in my repo). This will bring the text closer to its original form, but some steps of TreebankWordTokenizer are destructive, so it wouldn't be one-to-one. Something along the lines of the following should work: ``` treebank_detokenizer = nltk.tokenize.treebank.TreebankWordDetokenizer() db = nlp.load_dataset('bookcorpus', split=nlp.Split.TRAIN) db = db.map(lambda x: treebank_detokenizer.detokenize(x['text'].split())) ``` Regarding other issues beyond the above, I'm afraid that I can't help with that.
It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575
146
Bookcorpus data contains pretokenized text It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575 I'm afraid that I don't know how to obtain the original BookCorpus data. I believe this version came from an anonymous Google Drive link posted in another issue. Going through the raw text in this version, it's apparent that NLTK's TreebankWordTokenizer was applied on it (I gave some examples in my original post), followed by: `' '.join(tokens)` You can retrieve the tokenization by splitting on whitespace. You can then "detokenize" it with TreebankWordDetokenizer class of NLTK (though, as I suggested, use the fixed version in my repo). This will bring the text closer to its original form, but some steps of TreebankWordTokenizer are destructive, so it wouldn't be one-to-one. Something along the lines of the following should work: ``` treebank_detokenizer = nltk.tokenize.treebank.TreebankWordDetokenizer() db = nlp.load_dataset('bookcorpus', split=nlp.Split.TRAIN) db = db.map(lambda x: treebank_detokenizer.detokenize(x['text'].split())) ``` Regarding other issues beyond the above, I'm afraid that I can't help with that.
[ 0.0502683148, 0.3206239045, -0.0320777707, 0.285623461, -0.1109391376, -0.3141339719, 0.0659821928, 0.2292080671, -0.3773544431, 0.1320858151, -0.1504073143, 0.3783099949, 0.2091659456, -0.0847187713, -0.0539453067, 0.0576008521, 0.1612682641, 0.1827617288, 0.1995271593, -0.0846718326, -0.1270085871, 0.3466218412, 0.0968653113, 0.0985276178, -0.2559475899, -0.3039922714, -0.1721382439, 0.2106493115, -0.1130993366, -0.2921230495, -0.0514740981, 0.2297890186, -0.0205981489, 0.3393050134, -0.0001025469, -0.2117825449, -0.0415512957, 0.0248816051, -0.2459975779, -0.0421915166, 0.3318285346, -0.0583667681, 0.3199640512, -0.3479759395, -0.3073748946, 0.0060195471, -0.1507443488, 0.0970789567, 0.2878763974, 0.2866072357, 0.2562168241, 0.1728056669, -0.1479439735, 0.2911147475, 0.2293520123, -0.2285567969, -0.1792050898, 0.1154583916, 0.3404251337, 0.1576984376, -0.1479933709, 0.3168504238, -0.1120617315, -0.0993602127, 0.0107638836, 0.0866042152, -0.0468525998, -0.1749298722, 0.1741345525, 0.1410863549, 0.2253866941, -0.2929342389, -0.1760391146, -0.2555310726, 0.0676852912, -0.0627084523, 0.3575007319, 0.1597672254, 0.1797011048, 0.0991524532, -0.3076470196, -0.1184085682, 0.0067066997, 0.1861814708, -0.1890390515, 0.3517372012, -0.0275463406, -0.0521569066, -0.0401725769, -0.1671880782, -0.2302845865, 0.0457762517, -0.2839509845, 0.0290544536, -0.0194796175, -0.2148331404, -0.0329768546, 0.2633590996, 0.0583549067, 0.2064038664, 0.1382034421, 0.2117532343, -0.1937953681, 0.0104681579, 0.1419467926, 0.2237102091, 0.0722245723, 0.1600137502, 0.1111712977, 0.089361988, -0.2414985448, -0.0320881531, -0.0146007575, -0.0237489808, 0.0396704189, 0.0728733242, -0.0326368585, -0.3373936415, 0.0546513423, 0.1993585825, -0.2055112123, 0.3033293188, -0.0416622385, 0.165854156, -0.0549800843, -0.0120553682, 0.2828992009, 0.0206978396, -0.1756385714, -0.1595059782, -0.1973600984, 0.0380615629, -0.3233498335, 0.108354263, 0.2031531036, 0.0035497127, 0.1434017569, 0.0539376922, -0.1815327406, -0.0433265753, 0.005220985, -0.1907521337, 0.1267914623, -0.07005319, 0.0332464091, 0.1602682173, -0.0991465673, -0.1501461715, -0.2041983455, 0.0204511229, -0.3056626618, 0.1298172772, -0.3631922603, 0.2384641767, -0.3120621145, -0.2469174564, -0.09512683, 0.1402453929, 0.2168127894, -0.212663874, 0.208240062, 0.0645195469, -0.1796924174, -0.0139369806, -0.0532152317, 0.2223668993, -0.1891809255, -0.1539738178, -0.0387750342, 0.0368670225, 0.2192964554, 0.204496637, -0.1398215592, 0.1316279918, 0.0368636958, 0.7144050598, 0.0238878876, -0.1102677435, -0.6006364226, 0.2778590322, -0.1638281494, 0.0712634772, -0.1692002714, -0.2280034572, 0.1500807405, 0.1093696728, 0.0111977002, 0.3238185048, 0.4763901234, 0.1905880272, -0.5679764152, -0.2778165638, 0.2300938815, 0.0829988122, -0.1315533072, -0.0157733038, 0.1510695219, -0.003550007, 0.0716411546, -0.1447982788, 0.2080219835, 0.4561252296, 0.1945453733, 0.2754326761, 0.1379222125, -0.1083598435, -0.003531921, -0.0280954987, -0.6072431207, 0.5558738708, -0.2705800831, -0.3538450897, -0.0436142161, -0.3035728037, -0.0848916769, -0.0426056646, 0.3206099272, 0.2068599015, -0.063600339, 0.326326102, 0.1955291033, -0.0546720698, 0.0610972419, 0.0985156447, -0.4020550251, 0.0388388969, -0.157295078, -0.241664052, -0.0188539587, 0.2859686315, 0.2576764226, 0.0964295417, -0.1627964377, 0.5122169852, -0.4067947567, 0.3954562843, -0.1029732376, 0.2249747664, 0.2453069389, 0.0368540846, 0.1425614655, 0.5524888039, 0.2463423163, -0.0202525165, -0.0108898366, 0.5778495669, 0.3246230185, -0.0902368277, 0.0885413513, -0.1160362884, 0.1845519394, -0.3483376503, 0.0513698906, -0.1625525802, 0.1203028262, 0.2504856288, 0.1890163124, 0.1793295294, -0.2093160003, 0.3624857664, 0.4404110312, -0.0698242188, 0.1454108655, 0.1719344705, -0.3168786168, -0.2977500856, 0.0184555221, 0.1694019586, 0.0166360997, 0.1354275942, 0.0464464463, 0.0763098374, 0.1118472144, -0.2814234197, 0.2418964803, 0.081367217, -0.2202341259, 0.1963640749, 0.3998716176, 0.1825361699, -0.4641730487, -0.0631452724, -0.0252161678, 0.1623712927, -0.1716698408, 0.3289463818, -0.3300449848, -0.6390393972, -0.1327871382, 0.0547673069, -0.1161166579, -0.1989360303, 0.2469793409, 0.2347545475, -0.1379943937, 0.0465456918, 0.324582994, 0.3713595271, -0.2469569147, -0.1417900622, -0.2285064161, -0.3313559294, -0.6871264577, 0.187860623, 0.1113767102, 0.0861143842, 0.0377120487, -0.1410931498, 0.0160119049, -0.3592770994, -0.3051674366, 0.0756577179, -0.2178703845, 0.0663702041, 0.0628793314, -0.0984488279, -0.3571201861, -0.2685875893, -0.0248325653, -0.1988768578, -0.1679220498, 0.0876095444, -0.211187467, -0.2750480771, -0.3888931572, -0.4716974795, -0.0215846337, -0.1205597594, 0.3580134809, 0.2281887531, 0.0478285737, 0.2902408242, -0.2424390018, 0.1059381813, 0.3240023851, 0.3039760292, -0.3152659833, -0.3232304752, 0.3678922057, -0.0866245329, -0.4257176816, -0.0392810069, 0.0964044929, -0.0240299907, -0.0096906172, -0.3700833321, 0.1711197048, -0.2685029507, 0.0882918462, 0.0754074231, -0.0319825038, 0.3750683665, 0.153784737, -0.2389877886, -0.0523224249, -0.1377876848, 0.2527931333, 0.286901325, 0.3607078493, -0.2157281488, -0.046031639, 0.0932907909, 0.1086270586, -0.2304870337, -0.1206872389, 0.3998343349, -0.1271841526, 0.1041409522, -0.1783700436, 0.0119411116, 0.0047447034, -0.2672376037, -0.058000654, 0.7442839742, -0.0562025756, -0.3819235563, -0.0194864627, -0.4110417068, -0.6470891237, -0.4519210458, -0.058859542, -0.131907478, 0.0151590556, 0.0825076178, 0.0060696397, 0.1075697467, -0.4360055029, 0.0010977401, 0.067248255, -0.0700571537, 0.0234592129, -0.2529756129, 0.2467829585, -0.4832000434, 0.2708825469, -0.0280912984, 0.0848311186, 0.0159989614, 0.0260650348, 0.2659098506, -0.3306409121, 0.1358570755, 0.0492854565, 0.0616588891, 0.2379516512, -0.2220129222, 0.067527093, -0.0936079323, -0.2850674987, 0.0268583782, 0.3058535159, 0.2077634335, -0.4310357869, -0.0104457168, -0.2550188005, 0.129518047, -0.2020733207, 0.3922216296, -0.0559090711, -0.2724835575, -0.4281615615, 0.0885958821, 0.0837260336, 0.5127237439, 0.0020351592, 0.0375508964, 0.0914574414, 0.0699013174, 0.2828257978, 0.2051467746, 0.5005568266, -0.3195249736, -0.0289349593, -0.0867306665, 0.2290777713, 0.1046171561, 0.3962089419, 0.1842534095, 0.0687596351, -0.0918967426, -0.2497074008, -0.1034453437, 0.4508928955, 0.0933602303, 0.2989099324, 0.1022297814, -0.0504255779, 0.0568540432, 0.0936960056, -0.0392995439, -0.0523021333, -0.0866834149, -0.0688018799, 0.2607878149, 0.0625126064, -0.1282547116, 0.0160363447, 0.1689431518, -0.529727459, 0.6358748078, 0.0817723796, 1.2664071321, 0.1259851903, 0.2774370611, 0.1221763864, 0.1035665795, 0.2423627526, -0.4548505843, 0.0130383288, -0.3154568076, 0.1917824, -0.0502262563, 0.3567127585, -0.1773015261, 0.189102143, -0.2983834743, 0.1576020271, -0.1464831382, 0.0954733118, 0.1002282053, 0.2019845843, 0.0555559471, -0.2359239757, 0.0622627623, 0.2006783932, -0.1212723404, 0.0999660715, -0.0230807699, -0.2644633055, -0.2481751293, -0.1299497485, -0.3037824929, 0.2492031306, -0.1399759948, 0.0072496599, 0.1680196822, -0.1097240224, -0.1510291696, 0.2088518292, 0.3138304055, 0.2617880404, -0.3833236396, 0.3085213602, 0.0770518184, -0.1476068348, 0.2204046696, 0.160880059, 0.394551456, -0.1488296986, -0.0294077788, -0.235410437, 0.0630313754, -0.2344518453, -0.129011482, -0.0519684851, -0.0692104846, -0.283161819, -0.1294766068, 0.1722295731, -0.398448348, -0.2890191972, 0.195706144, -0.2353201509, -0.141845569, -0.1430523098, 0.0883560702, -0.3133047521, -0.174640581, 0.4973694384, 0.2756561637, -0.0691615716, 0.4139430523, 0.0083498433, -0.1509478241, -0.3615686893, -0.2265954465, 0.2644396126, -0.2990569472, 0.1890542954, -0.1237005293, -0.327919066, 0.253206104, 0.6107336879, -0.0646062568, 0.3288614452, -0.127334401, -0.3482034504, -0.038899228, 0.0796700567, -0.0323106945, 0.1915736049, 0.3719383478, 0.368150115, -0.0934032723, -0.1438859105, -0.4209376872, 0.2488285601, -0.3923135102, 0.2334462702, -0.1301631182, -0.0854214281, -0.0414086692, 0.0143726487, 0.100448072, 0.3575177491, 0.0731339306, -0.3187496066, -0.2988662124, 0.0751723275, 0.168457076, -0.0097895944, -0.1823961288, 0.065628089, 0.0205030479, -0.1436795443, 0.1260127872, 0.0330821648, 0.1086089313, 0.3633996844, 0.1074024364, 0.2064944804, -0.2905066907, -0.2369411886, -0.0867217407, 0.0155249499, -0.1578540504, 0.1750104576, -0.1986193061, -0.0538296215, -0.1889483631, 0.0618185587, 0.1741077602, 0.517696321, 0.2648684382, 0.1763465255, -0.0339083262, 0.022254074, 0.1865948886, 0.2837534249, -0.2215486467, -0.4664623141, 0.3147240579, 0.2928296626, -0.1725578308, -0.2323793322, -0.0907034427, -0.5723100901, -0.0013673678, 0.089300178, 0.4483963251, -0.0740142986, -0.0162082128, 0.0517582744, 0.4621601105, -0.1148691401, 0.0219645649, 0.3347057998, -0.046841044, 0.0239962172, 0.2213384658, 0.0655297711, -0.0683631748, 0.419732064, 0.0771016851, 0.3663988709, 0.4050019979, 0.2621217966, -0.0193111543, 0.1859978735, 0.2309222519, 0.0941109508, 0.2074231505, 0.3001115322, 0.0419665724, 0.1585605741, -0.2035881281, -0.2547901571, -0.0800385773, 0.3237067163, -0.3548710942, -0.1016117334, -0.277646482, -0.217257157, -0.2227422893, 0.0889214054, -0.1792000085, 0.1237815917, -0.0473925993, -0.0068241791, -0.0887008235, -0.3339601755, -0.0968104228, -0.2567664385, 0.3450838029, -0.3081304729, 0.3353686035, -0.0239984319, -0.0117404759, 0.0344987474, 0.2444017678, 0.228029862, 0.1660613269, -0.2368104756, 0.0084656356, -0.2022773921, -0.0699960366, 0.0739984512, 0.3090717494, 0.2560390234, -0.0349523909, 0.1519610435, 0.1186423376, -0.2021939009, 0.1569800228, -0.0205566976, 0.0906978175, 0.0912728235, -0.006820519, 0.0685006231, -0.1779573411, -0.2704568505, -0.2943281829, -0.2106182724, -0.102715008, 0.1102602407, 0.0450011753, 0.2079066783, -0.2224058062, 0.1511448622, 0.2386323512, 0.5989452004, 0.3897714913, 0.0290975403, -0.1135461405, -0.1662547588, -0.437708497, 0.2282617986, 0.1493014097, -0.2425404787, -0.0323456898, 0.0235696491, -0.0043584113, -0.0257834215, -0.4523446858, 0.3621740639, -0.1675105691, -0.1839090288, -0.3424541354, 0.3002202213, 0.1295797974, -0.1052913293, -0.0413143486, -0.1630314589, 0.0921322927, -0.0677635372, 0.166281268, -0.1584757119, -0.4944359362, -0.0925907046, 0.2201496661, 0.1942612082, 0.3134511709, -0.0123510472, -0.3465573788, 0.0573732592, -0.0488119759, -0.0741132945, -0.2141725421, 0.0072929352, 0.1437651217, 0.2346392721, 0.2637172639, 0.3825129271, -0.1025279835, 0.2364630252, 0.1843266338, 0.1577818841, -0.3397211134, -0.0682813227, -0.0784964412, -0.0010875844, -0.0723827258, 0.691763401, 0.0642038509, 0.0776450858, -0.3717280626, -0.422644347, 0.4227739275, -0.331635505, -0.2500545979, 0.1223130673, 0.1393046379, 0.456115514, -0.0476740599, -0.6378760934, -0.0586779602, 0.1106197536, -0.0203515887, -0.6066348553, 0.2190053761, -0.0008712435, -0.087074466, -0.1062998474, 0.2862387598, 0.4174632728, 0.0130851828, -0.0244567227, -0.1725815833 ]
https://github.com/huggingface/datasets/issues/486
Bookcorpus data contains pretokenized text
Ok I get it, that would be very cool indeed What kinds of patterns the detokenizer can't retrieve ?
It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575
19
Bookcorpus data contains pretokenized text It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575 Ok I get it, that would be very cool indeed What kinds of patterns the detokenizer can't retrieve ?
[ 0.0604029074, 0.2112901956, 0.0049696458, 0.4674898088, -0.1865661889, -0.3642662168, 0.0308457445, 0.2487039119, -0.4858068824, 0.1431299448, -0.1751268655, 0.4655148387, 0.1896485984, -0.1176309735, -0.1269879788, 0.2603911459, 0.0707708448, 0.2080195099, 0.0444154702, -0.1715230048, -0.0605967306, 0.3185586333, 0.0735050961, -0.0343130045, -0.3340621889, -0.2613658607, -0.172305122, 0.2871147394, -0.1565573215, -0.3885433376, 0.0394662544, 0.2147517502, -0.0296004936, 0.309227556, -0.0001112136, -0.1212929338, 0.0267073698, -0.1100274771, -0.1816279739, -0.090924561, 0.1232387796, -0.018554477, 0.3582623303, -0.5265985131, -0.2822775245, 0.2261687964, -0.1437606066, 0.1404651403, 0.2870268226, 0.4154458642, 0.187060982, 0.2642736137, -0.153208971, 0.168810308, 0.3264144957, -0.0386345796, -0.2777246535, 0.0013344516, 0.386443764, 0.3084562719, -0.1662814319, 0.2464143187, -0.1460223049, 0.0169745386, 0.1081541777, -0.0495127328, 0.1588053405, -0.2349083275, 0.255326122, 0.3478803635, 0.2573382854, -0.0386261977, 0.0085573718, -0.2316288799, -0.1399813443, 0.203091532, 0.2722405791, 0.127851963, 0.0821161121, 0.1513770372, -0.1062147319, -0.071078293, -0.049927678, 0.1270303279, -0.1186062172, 0.3517420888, 0.0026368347, -0.0285528842, -0.0115613183, 0.0066977087, -0.1764367372, 0.0958931446, -0.3348133862, 0.0043225386, -0.0044848863, -0.2323171496, 0.0973935425, 0.252746433, -0.0452656373, 0.4082652628, 0.3445387483, 0.2949661911, -0.1966409832, 0.0793918371, 0.0403272212, 0.1573098451, 0.0555433221, 0.2430895865, 0.1665278673, 0.0107504427, -0.3805955648, -0.0743015185, 0.0317921117, 0.0189552996, 0.0036562621, 0.0611770228, 0.037483301, -0.4832126498, 0.16326572, 0.1853302419, -0.2136847526, 0.1784507483, 0.0564471446, 0.0898107886, -0.0515365154, 0.0880346447, 0.0918421373, -0.0330607295, -0.0517974459, -0.199009344, -0.1495577246, -0.1054223403, -0.3613605499, 0.0929123908, 0.2237265557, 0.0348398872, 0.1418285519, -0.0173506979, -0.1725221425, 0.0216434393, 0.0202188287, -0.270673573, 0.4571626484, -0.0256432556, -0.1910112947, 0.0324012935, 0.0236857235, -0.1179530323, -0.303106755, -0.0246069841, -0.3003567755, 0.1305871755, -0.2167599797, 0.1804510355, -0.3390058875, -0.1201600581, 0.0040065171, 0.2269222438, 0.114416115, -0.1300052851, 0.2640651464, -0.007767559, -0.1130758822, -0.0804778039, -0.1571691185, 0.2868359089, -0.29106161, -0.1324336529, -0.0729085505, -0.0038544924, 0.2922709584, 0.1737482101, -0.0803823322, 0.0385200642, 0.0571065769, 0.8963900208, -0.0338543914, -0.0474753454, -0.5306513309, 0.2030207366, -0.0835099444, 0.1309685856, 0.0783683211, -0.1008265465, 0.2333671153, -0.0387081206, -0.1269482523, 0.1347049922, 0.5446135402, -0.0159926973, -0.5618399382, -0.2940209508, 0.2203255892, 0.0523370765, 0.0197999403, 0.1336617768, 0.2531475127, -0.0214611553, 0.0830841362, -0.2307127714, 0.1561268717, 0.3136555254, 0.359384805, 0.4066241384, 0.249466911, -0.1262721419, 0.1709290743, 0.0855902508, -0.797593236, 0.4854719043, -0.1100429744, -0.2766065001, 0.0316402353, -0.2976917326, -0.1390502155, -0.0308802128, 0.2581127882, 0.2348938584, 0.0465357415, 0.4342813492, 0.1588790864, 0.0390873142, 0.1868073642, 0.0412401259, -0.4006344378, 0.1447035223, -0.1005986184, -0.2781330049, -0.0628801584, 0.3709408939, 0.2360567153, 0.0312167816, -0.0716287866, 0.289059639, -0.3318713903, 0.1124546677, -0.2324204147, 0.1594910771, 0.1141448766, 0.0137153165, -0.0172764435, 0.6242742538, 0.2798288465, -0.1008124128, 0.3238970041, 0.4158971906, 0.3776712418, 0.0362375788, -0.0003743687, -0.1702013016, 0.1261229366, -0.3321748078, 0.0453587472, -0.2139386088, 0.2807054818, 0.1363817602, 0.280071348, 0.1733035594, -0.2103451192, 0.2834627926, 0.3500043154, -0.0286060907, 0.1028477103, 0.2167859226, -0.2407599092, -0.2014990151, 0.0918722749, 0.1266490668, 0.1089742035, 0.0998074636, 0.0215666927, 0.0722227022, 0.0722116381, -0.3865077794, 0.1687374264, 0.2188985199, -0.2239869833, 0.1296432465, 0.3718088567, 0.1892755032, -0.4481158853, -0.2308840156, -0.1116982698, 0.080501914, 0.0273709372, 0.2684748769, -0.5430809259, -0.6649034023, 0.0325667374, 0.0656291842, -0.0501056835, -0.2324707806, 0.2761964798, 0.147247836, -0.1875770837, -0.203376621, 0.2906613946, 0.3883589506, -0.2766054571, -0.0873174891, -0.400184989, -0.4707963467, -0.6657466888, 0.1560483426, 0.1820806414, -0.0244101882, -0.0165225174, -0.1729425937, 0.0603352636, -0.1272504926, -0.270611614, 0.0668477938, -0.0042663915, -0.0731113479, 0.0747511834, -0.1444063634, -0.4029601216, -0.2654489875, -0.0277516022, -0.1547916681, -0.2307015806, 0.2833874822, -0.2646174133, -0.3121788502, -0.3437872529, -0.4522249699, -0.1565514952, -0.1983983666, 0.516741991, 0.3702401817, 0.048146043, 0.4064436257, -0.3484721482, 0.1662018001, -0.0078287935, 0.4200565219, -0.2951849699, -0.2476707846, 0.449469924, -0.0966079608, -0.4395466149, -0.0071631465, 0.0947205201, 0.1041145548, -0.0838210657, -0.4395296574, 0.2352151871, -0.4147756696, 0.2214819491, 0.0919786617, -0.0054010218, 0.414124012, 0.1176140159, -0.1854996979, -0.0184926465, 0.0200536363, 0.3892365396, 0.2683615983, 0.1220121756, -0.1243887916, -0.185247153, 0.2529533803, -0.0080479374, -0.1544072777, -0.0834848583, 0.5354870558, -0.0166318361, 0.1233317107, -0.2894325256, 0.0808496475, 0.0365821011, -0.3634638488, -0.018133007, 0.6952672601, -0.0387202352, -0.4206860363, -0.1525161266, -0.362670064, -0.3947037756, -0.5091344714, -0.0947223976, -0.0894459859, -0.110357821, 0.1220050007, 0.1227144673, 0.1484939158, -0.3748821914, -0.0294183008, 0.0291143041, -0.0574427545, 0.1015721634, -0.2822040617, 0.1459387243, -0.5896183848, 0.2196616977, -0.1175743341, -0.0568125136, -0.1042476594, -0.013298722, 0.2554577887, -0.1549899727, 0.0596976578, 0.0823836774, 0.157188639, 0.3531689644, -0.4536795914, 0.0466432348, -0.1597647965, -0.3209370375, 0.0148515003, 0.2243999094, 0.1983935088, -0.4008463621, 0.2173607796, -0.4708299041, 0.2582645714, -0.1026700139, 0.3557086587, -0.0527285822, -0.184411943, -0.4908765256, 0.0296218153, 0.1442101449, 0.4182723463, 0.0507549495, 0.0131220566, -0.0075452696, 0.0741121471, 0.2711831033, 0.3257132769, 0.4172255695, -0.3802877665, -0.0506036654, 0.0162396859, 0.2785225809, -0.0386805125, 0.3240655065, 0.1429879218, -0.0012644235, -0.1450139284, -0.265517354, -0.2225729525, 0.4299735725, 0.1031811461, 0.3510278165, 0.1296647787, -0.0288922712, 0.0275589228, 0.2613202035, -0.2476957142, -0.164769724, -0.1122040227, -0.0371274203, 0.2096108794, 0.0568738393, -0.0862637684, -0.0101328492, 0.083375819, -0.44780761, 0.5934389234, 0.1470456272, 1.3137546778, 0.25812307, 0.3736341894, 0.1208670512, 0.0678044334, 0.1194816753, -0.4052531719, -0.0135768773, -0.2606817782, 0.1679500043, -0.0823445171, 0.235316664, -0.10767553, 0.200022459, -0.4066711366, 0.1032234058, -0.1559082419, 0.2173661143, 0.101072602, -0.0092819817, 0.0906758234, -0.1309901625, 0.2300189883, 0.1524742842, -0.0055047758, 0.1577047557, -0.0476446599, -0.3615916967, -0.3194210231, -0.0812909231, -0.2802690268, 0.1858307123, -0.1443209946, 0.116068624, 0.3002599776, -0.0802204162, -0.2489446551, 0.2821156085, 0.3190875351, 0.248500824, -0.4652881026, 0.1221019924, 0.0649995431, -0.1323267668, 0.3016615808, -0.0218501277, 0.4099274278, -0.2100419253, -0.0312504657, -0.0809150115, -0.0453296974, -0.2504411936, -0.250515759, 0.2192788273, -0.1018665582, -0.0866018459, -0.1273268461, 0.1625172347, -0.5676116347, -0.227583006, 0.129980579, -0.1229788139, -0.2572295666, 0.0325818695, 0.0439506546, -0.2969925404, -0.2175338566, 0.4929181337, 0.1279949397, 0.1437838823, 0.2659581304, 0.0155058354, -0.2118876427, -0.319981873, -0.0646490082, 0.3073031306, -0.4513331056, 0.3142536879, -0.0529315993, -0.3912537396, 0.2202435136, 0.6401064396, -0.0648359805, 0.2356959581, -0.3432991505, -0.3344877064, -0.1428494304, 0.0723185018, -0.0759884119, 0.1215201318, 0.3601949215, 0.3767554462, -0.1318207085, -0.1066309139, -0.3545944095, 0.2168207318, -0.4204815626, 0.2378811538, -0.3747775853, -0.2061498016, -0.1499352455, 0.0259235594, 0.0081205862, 0.506890595, 0.0129049672, -0.2600455284, -0.3013980389, 0.1099211574, 0.2588218749, -0.0234447625, -0.1358156204, 0.0719741657, 0.0002932365, -0.1304664314, 0.1453936845, 0.1555185765, 0.0607333556, 0.3466274142, 0.1490334421, 0.1122616827, -0.4103753567, -0.015256796, -0.1684702933, -0.048525773, -0.2342361212, 0.1298632324, -0.24546884, -0.0972142071, -0.0906307772, 0.1664321274, 0.1093837544, 0.3238172233, 0.2405937463, 0.2146873325, 0.0495449491, 0.0479719825, 0.0919285342, 0.2279500961, 0.0072847847, -0.4190813303, 0.456371069, 0.2205509245, -0.2072083652, -0.3670641184, 0.0264970679, -0.3992230594, 0.1342367232, 0.1030329391, 0.4256848395, -0.3307787478, 0.0443647914, 0.0788628832, 0.2585691214, -0.0978072733, 0.2458580732, 0.5149006248, 0.0579989068, 0.0307018496, 0.2223692983, -0.073978588, -0.0304961856, 0.4679297209, 0.1013528332, 0.5709167123, 0.492590934, 0.158223033, 0.1754170954, 0.250292331, 0.2761951089, 0.2544512749, 0.3463716507, 0.440105617, -0.0277229864, 0.087745674, -0.1820443124, -0.1817066669, -0.1663599014, 0.1184733137, -0.4020211697, -0.0162041467, -0.2048481405, -0.231194675, -0.1976765841, 0.0143794892, -0.2363506705, 0.2180001289, -0.1012024358, -0.0192652699, -0.1090382636, -0.1648953259, -0.0554533489, -0.3457094729, 0.3126300275, -0.2368155271, 0.2367736995, -0.0280489828, -0.0491222814, 0.1689564735, 0.1625013947, 0.1855439395, 0.268732518, -0.167534709, -0.0098343296, -0.1640841812, -0.2072375715, -0.0074247168, 0.4367582202, 0.1841112226, -0.0729755238, 0.2002140433, 0.0352903567, -0.1615732312, 0.2720960081, -0.0540758222, 0.0946177691, 0.0394380651, -0.0451989137, 0.1204201803, -0.2497220784, -0.1459225267, -0.1833532304, -0.2593673766, 0.0367668644, 0.0272676367, -0.026410304, 0.1567187309, -0.184061259, 0.0957188755, 0.0984389931, 0.547563076, 0.3088119924, -0.0921850875, -0.0028421616, -0.0847652406, -0.3762497306, 0.2123697102, 0.056920629, -0.3298701644, -0.0072314213, -0.0174501371, 0.0328909494, 0.097270593, -0.3886373341, 0.2236616015, -0.1885611564, -0.16681768, -0.3574566543, 0.2894042134, 0.1753383428, -0.1492223293, -0.0366453081, -0.2643887699, 0.139612481, 0.0647703931, 0.1435917765, -0.0932578519, -0.6359951496, -0.1098386496, 0.3305196166, 0.1894246042, 0.3885253072, -0.0265481044, -0.2530364692, 0.0473790653, -0.063292101, -0.0674685016, -0.0986118689, -0.1176720485, 0.1615010947, 0.2237385809, 0.0077376273, 0.402238816, 0.0059397169, 0.3810949922, 0.1957577765, 0.3764243722, -0.2912953794, -0.0638093054, -0.2182697952, 0.034762729, -0.0692659169, 0.5324452519, 0.0608735792, -0.222644195, -0.2715647221, -0.4242269099, 0.5321038961, -0.3395157754, -0.2588925064, -0.0994961411, 0.012507786, 0.3902789652, 0.0195653848, -0.4431237578, -0.1875344366, 0.1218616962, -0.0762580335, -0.5258946419, 0.1829122156, 0.0751641616, -0.1372606009, -0.1607269049, 0.2755142748, 0.4468673766, 0.031640552, 0.0359918773, -0.2550363839 ]
https://github.com/huggingface/datasets/issues/486
Bookcorpus data contains pretokenized text
The TreebankTokenizer makes some assumptions about whitespace, parentheses, quotation marks, etc. For instance, while tokenizing the following text: ``` Dwayne "The Rock" Johnson ``` will result in: ``` Dwayne `` The Rock '' Johnson ``` where the left and right quotation marks are turned into distinct symbols. Upon reconstruction, we can attach the left part to its token on the right, and respectively for the right part. However, the following texts would be tokenized exactly the same: ``` Dwayne " The Rock " Johnson Dwayne " The Rock" Johnson Dwayne " The Rock" Johnson ... ``` In the above examples, the detokenizer would correct these inputs into the canonical text ``` Dwayne "The Rock" Johnson ``` However, there are cases where there the solution cannot easily be inferred (at least without a true LM - this tokenizer is just a bunch of regexes). For instance, in cases where you have a fragment that contains the end of quote, but not its beginning, plus an accidental space: ``` ... and it sounds fantastic, " he said. ``` In the above case, the tokenizer would assume that the quotes refer to the next token, and so upon detokenization it will result in the following mistake: ``` ... and it sounds fantastic, "he said. ``` While these are all odd edge cases (the basic assumptions do make sense), in noisy data they can occur, which is why I mentioned that the detokenizer cannot restore the original perfectly.
It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575
244
Bookcorpus data contains pretokenized text It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575 The TreebankTokenizer makes some assumptions about whitespace, parentheses, quotation marks, etc. For instance, while tokenizing the following text: ``` Dwayne "The Rock" Johnson ``` will result in: ``` Dwayne `` The Rock '' Johnson ``` where the left and right quotation marks are turned into distinct symbols. Upon reconstruction, we can attach the left part to its token on the right, and respectively for the right part. However, the following texts would be tokenized exactly the same: ``` Dwayne " The Rock " Johnson Dwayne " The Rock" Johnson Dwayne " The Rock" Johnson ... ``` In the above examples, the detokenizer would correct these inputs into the canonical text ``` Dwayne "The Rock" Johnson ``` However, there are cases where there the solution cannot easily be inferred (at least without a true LM - this tokenizer is just a bunch of regexes). For instance, in cases where you have a fragment that contains the end of quote, but not its beginning, plus an accidental space: ``` ... and it sounds fantastic, " he said. ``` In the above case, the tokenizer would assume that the quotes refer to the next token, and so upon detokenization it will result in the following mistake: ``` ... and it sounds fantastic, "he said. ``` While these are all odd edge cases (the basic assumptions do make sense), in noisy data they can occur, which is why I mentioned that the detokenizer cannot restore the original perfectly.
[ -0.013096936, 0.2090142518, -0.0026561455, 0.3173746467, -0.1956932396, -0.2996237576, -0.0173015464, 0.2006193548, -0.4918518662, 0.0816213116, -0.1720972508, 0.284273833, 0.1636682302, -0.2349404991, -0.1071665287, 0.2111708373, 0.1792733222, 0.2823950052, 0.2202472836, -0.1536701322, -0.182328254, 0.2915745676, 0.1904963404, -0.0035165998, -0.2633258402, -0.2643784583, -0.1785984635, 0.3562454879, -0.1762150377, -0.3386280835, -0.1300119758, 0.2864888906, -0.0567627251, 0.3584985733, -0.0001062125, -0.2521671653, -0.0237554014, -0.0865367949, -0.3363090456, -0.079945907, 0.267351985, -0.0649405196, 0.2785301208, -0.3779520094, -0.3191956282, 0.0946911648, -0.1585105807, 0.0207608994, 0.2960729003, 0.2338733524, 0.2192091793, 0.1864216477, -0.119373478, 0.2506965995, 0.3235377967, -0.1017345563, -0.1702124625, 0.0435541831, 0.3703983128, 0.3260974884, -0.1662235409, 0.3166055679, -0.1516396403, 0.0288452394, 0.0620671138, -0.1197542101, 0.0588297471, -0.1836255193, 0.1840666682, 0.2314484268, 0.2577365339, -0.1910744756, -0.1388307512, -0.2062945664, -0.0055128951, -0.0866997242, 0.2901035249, 0.162665382, 0.1006432027, 0.1169621944, -0.2036012262, -0.1254276633, 0.1330467463, 0.2178185731, -0.0939432159, 0.3291181326, -0.0937990099, -0.0315527096, -0.0638478026, -0.0639028773, -0.2752231956, 0.0771326274, -0.3466395438, -0.0471423343, -0.0716824234, -0.2270145863, 0.0099336728, 0.3180499077, -0.0523341708, 0.2914676666, 0.1656624228, 0.2068199962, -0.1103690043, 0.0022942072, 0.1428861469, 0.1520640701, 0.095101811, 0.2186256051, 0.1616232246, 0.054711163, -0.2744167745, -0.0449895822, 0.0262062959, 0.0409516506, 0.0673128366, 0.11758136, -0.0945216566, -0.4092072845, 0.1104819626, 0.1627935022, -0.1755582094, 0.3513495028, 0.0304974243, 0.171164155, -0.1282081455, 0.10950014, 0.2333880812, 0.0160874613, -0.1464368552, -0.1457030475, -0.1949326396, -0.0282436442, -0.3139034212, 0.1749851853, 0.2165555805, -0.024981942, 0.1767990887, 0.0159946326, -0.0900458172, -0.0779915303, -0.0937321931, -0.1390451044, 0.2256882936, -0.0904375687, 0.0073017529, 0.2255375534, -0.0670431405, -0.0109521188, -0.2728833258, 0.0048360191, -0.3288043141, 0.1000961959, -0.2406039536, 0.249217391, -0.3356080949, -0.1833830625, -0.133633405, 0.0967793092, 0.2495668381, -0.2057881653, 0.2461415678, 0.09526328, -0.0845147222, 0.0397760645, -0.1700639427, 0.1673568636, -0.176499635, -0.1662344635, -0.0244438928, 0.2212651968, 0.2749221027, 0.1089545041, -0.142091766, -0.0086040152, 0.0813518241, 0.7183498144, -0.0174183957, -0.0456806943, -0.5037997365, 0.2438365072, -0.0503257625, 0.0734825954, -0.0498396903, -0.1478777528, 0.2721969783, -0.0256972369, -0.1284985542, 0.1694664955, 0.5301478505, 0.1767305434, -0.5494859219, -0.2097417861, 0.163721934, 0.0617381893, -0.1836183071, -0.0272411536, 0.2119203508, 0.1857923567, 0.0499814674, -0.2376081795, 0.2587558329, 0.3918688595, 0.3059104979, 0.3005810678, 0.2135977894, -0.1132966056, 0.1385642886, -0.0084677152, -0.5750664473, 0.554872632, -0.1922530681, -0.3250689507, 0.0255881902, -0.3308910728, -0.1080775857, -0.0202901866, 0.2663988173, 0.2701420188, -0.0265751984, 0.2296952009, 0.1098187789, -0.0887288824, 0.0138869891, 0.1445508599, -0.2879340053, 0.0096702399, -0.1162085533, -0.2436328828, -0.0913949162, 0.3883037567, 0.3055766225, 0.0095234821, -0.1216301769, 0.588653028, -0.2743596137, 0.2116330266, -0.3422015905, 0.1967357993, 0.2266286463, 0.0910282284, 0.104590252, 0.6204186082, 0.3134614825, -0.0619518161, 0.1241833121, 0.4847059846, 0.5381140709, -0.0348017588, 0.1357637048, -0.2097645104, 0.1407641023, -0.277854383, 0.0349248499, -0.1607514769, 0.1870880425, 0.2222886086, 0.2258033901, 0.2511375546, -0.1797743142, 0.3216663599, 0.3824762404, -0.1144577488, 0.1248017401, 0.1802485287, -0.3248032928, -0.317258954, 0.0615759008, 0.0733920708, 0.0257056318, 0.1317723393, 0.0768519416, 0.0449814163, 0.1044770703, -0.3250131607, 0.216633901, 0.0959458351, -0.3224862516, 0.1516515613, 0.3414753079, 0.1739850491, -0.4222619832, -0.0884150416, -0.0366611592, 0.0930632353, -0.1447467506, 0.2682284713, -0.4251956642, -0.6615484953, -0.0893081874, -0.0604746565, -0.1013161987, -0.2474471927, 0.3624102771, 0.2117524743, -0.1529857516, -0.0137809599, 0.2746281624, 0.3462326825, -0.3052077889, -0.1405729502, -0.1333604604, -0.369867444, -0.6063696742, 0.1722468585, 0.0836452767, 0.0029905762, -0.1088612303, -0.2052446455, 0.0304432716, -0.3144637644, -0.2817364931, 0.1259753406, -0.1332971454, -0.0618761703, 0.0989269167, -0.2075007558, -0.2802495658, -0.3656507134, -0.0915761143, -0.1999158859, -0.2207588851, 0.2158225626, -0.2644091845, -0.3948632181, -0.3731860518, -0.4336091876, 0.0073936051, -0.1918856204, 0.3253252506, 0.3003257513, 0.0158030074, 0.3178787827, -0.3654295802, 0.0570115447, 0.294715941, 0.4680437446, -0.273864001, -0.3697007, 0.379750818, -0.0870074481, -0.3737557232, 0.0451310314, 0.1064177454, 0.1011916324, 0.0062335175, -0.3513373137, 0.2975460291, -0.2787441909, 0.1182225868, 0.1003808752, 0.0857109725, 0.3026744425, 0.1589624882, -0.2422175556, -0.0651041567, 0.0182354469, 0.2500403225, 0.3025483489, 0.333381325, -0.2154235989, -0.1298259795, 0.0965184793, 0.0774970725, -0.1745658517, -0.2244545668, 0.4646264911, -0.0560803004, 0.151981622, -0.1868852973, 0.0825464204, 0.1256969124, -0.2974064946, -0.0397854745, 0.7535393238, 0.0184614621, -0.4435170591, -0.0814060941, -0.307173878, -0.526557982, -0.4649652541, -0.1181863472, -0.0913818032, -0.0362735428, 0.0899663791, 0.0348159857, 0.1896206737, -0.439171195, -0.0119336043, 0.1453508735, -0.0218621641, 0.0675535724, -0.2452218384, 0.2796761096, -0.3746810853, 0.2867273092, -0.0188876428, -0.0390881225, 0.0734120682, -0.0693436563, 0.1641742438, -0.2702217698, -0.0470541492, 0.112920925, 0.12111862, 0.1840787679, -0.2732981741, 0.0120057976, -0.0459971949, -0.2533961236, 0.0440191999, 0.2973745763, 0.2621646821, -0.4981845915, 0.0783737972, -0.3845173419, 0.1832409799, -0.0779350847, 0.2510424852, -0.061387755, -0.128037557, -0.4437139332, 0.0530304797, 0.139963299, 0.4243903756, 0.0537540875, -0.030647967, 0.0338708274, 0.0521033742, 0.3206894696, 0.2767495215, 0.4186457396, -0.3349756896, -0.0093225483, -0.1058885753, 0.3103253841, 0.136946857, 0.3233546615, 0.0445085578, 0.0566170141, -0.1323211193, -0.2381840646, -0.1703964025, 0.4261043966, 0.0424847677, 0.3148790598, 0.0364559852, -0.0454362445, 0.0617159903, 0.1312961131, -0.2217710465, -0.0027024464, -0.0312760808, -0.1476115733, 0.1463031173, 0.103194043, -0.0746625438, -0.0035030185, 0.2231928855, -0.4792091548, 0.5465055108, 0.0245951544, 1.2696266174, 0.3159295619, 0.3267773092, 0.0482161678, 0.1233341172, 0.2043082565, -0.5028332472, 0.0450371914, -0.2049017996, 0.2078600228, -0.0692747086, 0.3685304523, -0.1507877558, 0.2397284359, -0.3311700821, 0.2369765937, -0.2088414431, 0.076066643, -0.0275170822, 0.0753914863, 0.0834390223, -0.3084033132, 0.0370024294, 0.2059898674, -0.1129738763, 0.0470509529, 0.0031085173, -0.1953647286, -0.2502889931, -0.1169702634, -0.2816463709, 0.2171150893, -0.1992189288, -0.0228739306, 0.2414245903, -0.0237629265, -0.1717051566, 0.1255426556, 0.2219233811, 0.3128903806, -0.2807664275, 0.1846369058, 0.1854191273, -0.0429590046, 0.2363815904, 0.0808085874, 0.430632025, -0.1359006166, 0.0029212888, -0.1516211331, -0.0207543988, -0.2704407573, -0.0228741989, -0.0337701961, -0.05818481, -0.2406966239, -0.0833916888, 0.2814622223, -0.4552399218, -0.2789027393, 0.1790004373, -0.2404045165, -0.2246224433, -0.1254338026, 0.0349244028, -0.3544526398, -0.2354167998, 0.4743596613, 0.0659204498, -0.0302717686, 0.2621461749, -0.0482766293, -0.240983665, -0.309968859, -0.1786746234, 0.3008832633, -0.3326340318, 0.1876681894, -0.0916173235, -0.386352241, 0.3450785279, 0.7153208256, 0.0183651801, 0.3967467844, -0.1848095357, -0.3267112374, -0.0301634036, 0.0570700094, -0.0381059907, 0.1439879388, 0.2901442349, 0.3565284908, -0.1229694262, -0.1283665597, -0.4049933255, 0.2145228386, -0.3362369537, 0.2910218835, -0.2069050521, -0.1521970034, -0.0805535987, -0.0220078696, 0.0823573917, 0.4147501588, -0.020556435, -0.2648277581, -0.3594222963, 0.0865643546, 0.2694784701, -0.0352666676, -0.2333407402, 0.0358314887, 0.0373578891, -0.2132279426, 0.0954041928, 0.0174133498, 0.084722586, 0.3056305647, 0.1444257647, 0.1671497673, -0.3926970959, -0.0462918021, -0.038390059, 0.0012804548, -0.3028195202, 0.1512007564, -0.2068939209, -0.0710864738, -0.0749297291, 0.1925042272, 0.2182451636, 0.4009812772, 0.2719071209, 0.2186345607, 0.0163991284, 0.0890209153, 0.2961803079, 0.2918318808, -0.0262055583, -0.4860497713, 0.3494086862, 0.2846326232, -0.1590371281, -0.264370054, -0.0835701078, -0.4274363518, 0.1194315329, 0.1845213622, 0.4698521495, -0.2557894588, 0.0934510604, 0.0261176061, 0.4078747034, -0.1422621459, 0.1201974005, 0.3639903367, -0.0351200104, 0.0599592701, 0.2685971856, 0.0387331806, -0.053502284, 0.4079727829, 0.0812919214, 0.4704855382, 0.5988801718, 0.2576115131, 0.0574813969, 0.2749408484, 0.3712728918, 0.0921040252, 0.2998259664, 0.3460759819, -0.0133699523, 0.178026557, -0.2248469591, -0.2335678786, -0.0808881968, 0.2483654022, -0.3571587801, -0.1191973612, -0.2130064666, -0.2445841581, -0.259375155, -0.0840540603, -0.2889247835, 0.0619461536, -0.079087317, -0.0274675582, -0.0294484179, -0.2832813561, -0.1334620863, -0.2766895294, 0.3692995906, -0.2943419516, 0.308344841, 0.07622087, -0.0538070276, 0.1717825532, 0.0994594917, 0.1822338849, 0.2157619298, -0.2081106752, 0.0303520039, -0.1222164333, -0.131647557, 0.0349158682, 0.3396189213, 0.1013620794, -0.093732208, 0.1128105223, 0.1167639121, -0.2326499671, 0.2023672909, -0.06299375, 0.1703377813, 0.0302387476, -0.0107640997, 0.0460678115, -0.1949510276, -0.2688477039, -0.1722624153, -0.2579215765, -0.0288862213, 0.1489241272, -0.1003093347, 0.1757889539, -0.2235440314, 0.1416842788, 0.2162237763, 0.5997517109, 0.264531672, -0.1004311889, -0.0401844569, -0.1288248897, -0.4038024843, 0.2358364761, 0.2191650122, -0.3714698851, -0.0989224613, -0.0245525967, 0.0847207531, 0.127822727, -0.4963515103, 0.3194308877, -0.2276886255, -0.1976347715, -0.3477383256, 0.3086853921, 0.134307012, -0.1725868732, 0.0300981794, -0.1894380599, 0.0174395591, 0.0781253725, 0.1550012529, -0.0839313418, -0.6021876335, -0.0343672968, 0.1993200928, 0.1280792654, 0.2976605296, 0.0557809845, -0.3549654782, 0.0256134048, 0.0023076234, -0.1479886621, -0.263610214, -0.0502678864, 0.0962546095, 0.2191594094, 0.1750771105, 0.4257459641, -0.1178934202, 0.2641665041, 0.2795374393, 0.0778626353, -0.3049062788, -0.0054788664, -0.2572003901, -0.0134133836, -0.0083369305, 0.656262219, 0.028847063, -0.03798813, -0.266549021, -0.490316987, 0.4548586011, -0.2702221274, -0.1678288132, -0.011059382, 0.1426569223, 0.4260189533, -0.0236696452, -0.5835838914, -0.1032111496, 0.1385840476, -0.0550480895, -0.5959928632, 0.1988400817, -0.082913734, -0.1592068821, -0.1237686872, 0.3169109523, 0.4044701159, -0.0247503147, 0.0226827767, -0.2333717346 ]
https://github.com/huggingface/datasets/issues/486
Bookcorpus data contains pretokenized text
To confirm, since this is preprocessed, this was not the exact version of the Book Corpus used to actually train the models described here (particularly Distilbert)? https://huggingface.co/datasets/bookcorpus Or does this preprocessing exactly match that of the papers?
It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575
37
Bookcorpus data contains pretokenized text It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575 To confirm, since this is preprocessed, this was not the exact version of the Book Corpus used to actually train the models described here (particularly Distilbert)? https://huggingface.co/datasets/bookcorpus Or does this preprocessing exactly match that of the papers?
[ 0.0296661053, 0.1984408498, -0.0193815045, 0.3028749526, -0.0800800547, -0.2216100395, 0.1067401171, 0.1523846537, -0.3669324815, -0.0078901425, -0.2142252922, 0.3167913556, 0.2326783985, -0.1111377254, 0.0192021634, 0.0697401389, 0.2531402409, 0.2138078958, 0.0349263139, -0.217189312, -0.1444738805, 0.2366249114, 0.0563931279, 0.1152127311, -0.0726906508, -0.3140860498, -0.2279931158, 0.3609325588, -0.2332172096, -0.3183437884, 0.1385846883, 0.3533367515, 0.0491578504, 0.4791385531, -0.0001063632, -0.0733192265, -0.1108099744, -0.0216152035, -0.1269201189, 0.1278881431, 0.270247072, 0.0159017202, 0.3585574329, -0.4776170254, -0.3692619205, 0.178127259, -0.2240696996, 0.191819638, 0.2211264521, 0.3104525506, 0.2462921888, 0.0918430388, 0.0222307425, 0.2674806416, 0.1596524715, -0.1338943094, -0.2298509628, 0.087711513, 0.5446928144, 0.216347307, -0.1553094089, 0.3055980206, -0.1081153005, -0.0444405042, 0.025359096, -0.0049127839, 0.1899773329, -0.3225921094, 0.1490075737, 0.269764483, 0.2777185142, -0.1194735989, -0.1294751912, -0.0601969138, -0.0922964141, 0.1277789623, 0.2424375266, 0.0890644938, 0.0441508666, 0.2080001533, -0.1743237972, -0.1435813457, -0.0047820788, 0.0986921191, -0.1490661949, 0.3915130794, -0.0701677799, -0.0638667867, -0.0509069338, -0.0633307323, -0.318063885, -0.0380535536, -0.2157050818, -0.0351227857, -0.0073077846, -0.2191762179, -0.0236470234, 0.4003378451, -0.1009499058, 0.211739853, 0.157635808, 0.1187423542, -0.0770308822, -0.1793922037, 0.1342782676, 0.2484537363, 0.1051768064, 0.2507031262, 0.0362859443, 0.3239162564, -0.2562927008, 0.0412145145, -0.1305708736, -0.0480501764, -0.103960447, -0.0861101374, -0.097271733, -0.4910895824, 0.0703445375, 0.2772709727, 0.0333308838, 0.3170374632, 0.058380343, 0.086569488, -0.2092939764, 0.0372136422, 0.2322643846, 0.018361738, -0.1913562417, -0.2068757862, -0.2237012833, 0.0077760057, -0.3948840201, 0.0062470119, 0.1177477762, -0.0474418029, 0.2660804093, -0.0383914635, -0.2094126344, -0.1035204902, -0.0289999023, -0.1996836513, 0.2668501437, 0.0191407446, -0.1366974562, 0.2283186764, 0.0493180156, -0.1478089541, -0.1507509351, 0.0246910248, -0.3962162435, 0.0323200561, -0.1493204534, 0.232612744, -0.2601952851, -0.2491974831, -0.0344617032, 0.281306982, 0.4073369205, -0.1509706527, 0.3375010788, -0.0243919138, -0.1385212094, 0.0281360783, 0.0209935009, 0.4135783613, -0.2282399088, -0.1458943188, -0.0486669838, 0.0728445128, 0.3752901256, 0.088320367, -0.2509766221, 0.0617541075, 0.2696672082, 0.6624367833, 0.186611861, -0.0779509693, -0.4325425625, 0.2136230469, -0.0138361715, 0.2117450535, -0.1904442906, -0.1700179279, 0.1801303625, -0.0564441793, -0.0000728981, 0.0359710827, 0.4290824234, 0.1707169414, -0.6041296721, -0.3096038103, 0.3253691494, 0.2513687909, -0.12554878, -0.0189414136, 0.0184533019, 0.0625679046, 0.1516379416, -0.1676376909, 0.1570030004, 0.4770157039, 0.180464223, 0.3032193482, 0.2585034966, -0.0054157525, 0.2384946793, -0.0026989067, -0.463409692, 0.6628249884, 0.0335820466, -0.2584096193, -0.0643424913, -0.2789321542, -0.1723702997, -0.2421185374, 0.27399382, 0.0556418113, 0.0018352905, 0.283508271, 0.0382653065, -0.1210396737, -0.2297668308, 0.1404663622, -0.506547153, -0.069898136, -0.228645727, -0.0394805297, -0.2563896179, 0.3594435751, 0.1786548048, 0.0626101047, -0.1487025172, 0.4577596188, -0.3280337751, 0.0037435119, -0.0326192304, 0.2570514083, 0.1916279495, -0.0837774575, 0.0840337425, 0.4635958672, 0.2697110474, -0.0392535776, 0.2076294571, 0.3762257695, 0.4181042314, 0.035830196, 0.0566479862, -0.116163902, 0.0447983891, -0.2119199932, 0.0115557471, -0.1377197206, 0.2113894671, 0.1241785735, 0.1486056447, 0.2420844138, -0.2317485362, 0.3815654516, 0.2590776682, -0.1092304215, 0.0798088089, 0.1837252825, -0.350671351, -0.349626869, -0.0154660866, 0.1806977242, 0.102182515, 0.0754513666, 0.0075749182, 0.076602757, -0.045308847, -0.3259963989, 0.285486877, 0.1510802805, -0.2582573891, 0.0437839553, 0.2345245034, 0.2017496228, -0.4386014342, -0.1384999603, -0.0466302782, 0.1867869645, -0.1489840448, 0.3591694534, -0.2862593234, -0.435679853, -0.151241526, 0.0486519448, -0.0093043046, -0.1176726818, 0.2985786498, 0.1213741973, -0.0993097723, 0.0566706136, 0.1491347849, 0.5113172531, -0.2363130301, -0.0650572851, -0.1264050752, -0.2729803026, -0.7907339931, 0.1810277104, 0.1005469114, -0.0117972651, -0.1401485205, -0.3721143007, -0.1473335624, -0.1202431992, -0.4255816936, 0.0287549291, -0.1445325464, 0.0502937101, 0.1586816758, -0.1826366186, -0.2583868206, -0.1930642873, -0.0241112914, -0.1113953069, -0.1810622662, 0.1034458876, -0.2522013783, -0.4218703806, -0.3365124762, -0.5817196965, -0.0893884674, 0.0237448998, 0.2863695621, 0.2327513546, 0.0077168788, 0.4235410094, -0.1916828454, -0.0140364617, 0.1494738013, 0.4524555504, -0.2753588259, -0.2926749587, 0.3957184255, -0.0382813215, -0.4434624314, -0.1504342705, 0.0747853816, 0.0841897279, -0.0416629054, -0.3317264915, 0.1113497764, -0.3541254401, -0.0893000662, 0.0395527184, 0.0816081911, 0.2867455184, 0.0311785378, -0.2125947922, -0.1179543808, -0.014080599, 0.5295314789, 0.2311034054, 0.2775561213, -0.3133276105, -0.0607116297, -0.0815422013, 0.0009639636, -0.0211238097, -0.2409223765, 0.3181603551, 0.0015799447, 0.0636588261, -0.1606695652, -0.0324057117, 0.0874613896, -0.2342913896, -0.1427821368, 0.6714077592, -0.0063175485, -0.3302324712, -0.1265487373, -0.2998777032, -0.4062514901, -0.3436610997, -0.1450316906, -0.0818754286, 0.0542495809, 0.1594570279, 0.0565785319, 0.1285170615, -0.3857203424, 0.0279504247, 0.2911818624, -0.2177025974, 0.0844202563, -0.0557051823, 0.2240011096, -0.5900641084, 0.1102208123, -0.1178843528, -0.0061594374, -0.0074459277, -0.0192111898, 0.2219083309, -0.2553710938, 0.1108379439, -0.0913906917, 0.0196138807, 0.1842549741, -0.4195017219, 0.0429300703, -0.1706501991, -0.3483813107, -0.0167407952, 0.2624336481, 0.2193244994, -0.3960914314, 0.025902221, -0.2092826217, -0.0174240209, -0.1271576136, 0.3416577876, -0.0376447625, -0.300045073, -0.2775601745, 0.1199880168, 0.0643889904, 0.3676754832, -0.1024149954, -0.0005580886, 0.0976182371, 0.4271936715, 0.2771633565, 0.3257226944, 0.3162810206, -0.3522462249, 0.0334270336, -0.1422743499, 0.2826831043, 0.2115711868, 0.3943053186, -0.0231349487, 0.0652969256, -0.0599546432, -0.2926260233, -0.3611952066, 0.3583036959, -0.0039001044, 0.3576032519, 0.2419639826, -0.0357152373, 0.0211487599, 0.1509304196, 0.0977674052, 0.0407653153, -0.1922479123, -0.2394358814, 0.2312877774, 0.0902268812, -0.1045802608, -0.017159963, 0.2092263252, -0.5008427501, 0.5596807003, 0.1802475154, 1.1709778309, 0.1551647931, 0.410820961, 0.2056060433, 0.1132095158, 0.1977673322, -0.5068721771, -0.0735531673, -0.3077661097, 0.1728135794, -0.0555337667, 0.4235357046, -0.0200593751, 0.2493425608, -0.26798895, 0.1992615014, -0.296390444, 0.2366591394, 0.0645621493, -0.1335397363, 0.2405453175, -0.0945096686, 0.036356125, 0.2081567347, 0.0397818126, 0.1289010346, 0.0057342765, -0.2461299449, -0.2890441716, -0.0531961434, -0.2310488373, 0.2454655021, -0.0331806205, 0.0494033284, 0.2079698592, -0.1106895059, 0.1575106978, 0.1382417679, 0.471807003, 0.1743506342, -0.3955403864, 0.2477909923, 0.1785714775, -0.1037529185, 0.2984573245, 0.0512134358, 0.513137877, -0.0922017545, -0.0203276556, -0.2224055231, -0.1007064134, -0.1466461718, -0.0992620662, -0.0249891225, 0.1355513483, -0.4075532854, -0.0080803726, 0.3327296972, -0.3182330728, -0.3199117482, 0.1742995381, -0.2192233503, -0.1999281049, 0.0848744735, 0.1321091652, -0.2795992792, -0.105883427, 0.3580373526, 0.2552375495, -0.0036919247, 0.4213993847, -0.0478949472, -0.2383197844, -0.3894928992, -0.3604235649, 0.5178195238, -0.4499709904, 0.2662648261, -0.0771511942, -0.3334920108, 0.3360661566, 0.7329292893, -0.014091338, 0.1992587149, -0.3125983179, -0.256011188, -0.0607899278, -0.0324198008, -0.0447009653, 0.1747518331, 0.2742786109, 0.3117229939, -0.1441119909, -0.1182432026, -0.3982655406, 0.2483278513, -0.3359960318, 0.1890867949, -0.163118422, -0.0982185975, -0.1337664574, 0.0796325728, 0.0410762094, 0.2587134242, -0.0245961994, -0.2936256826, -0.3275230527, 0.0688282028, 0.2236125022, -0.2142413706, -0.0723754987, -0.0335413255, -0.1770565361, -0.1123385131, -0.005561952, -0.0022378261, 0.2331562042, 0.226603359, 0.0625117272, 0.1165822744, -0.4161806107, -0.0662279204, -0.1230778247, -0.0774653181, -0.1583361626, 0.0727250353, -0.2133880258, -0.120927766, -0.1550261974, 0.3376785517, 0.1640609205, 0.4420243502, 0.3606301844, 0.0693644136, 0.1109359786, 0.1151176393, 0.2891582847, 0.3181859553, -0.1142820716, -0.4719843566, 0.3100066483, 0.280436784, -0.1817850471, -0.3593285382, 0.0826417059, -0.5128980279, 0.0000176931, 0.1591276526, 0.4305148423, -0.1177243441, 0.1454431862, 0.0505664572, 0.3363842368, 0.0239163879, 0.2004480809, 0.4209348857, 0.064042449, 0.101403214, 0.2356195599, -0.0335276946, -0.0871533155, 0.4698126316, 0.1750520915, 0.5409209132, 0.4480158389, 0.2250313014, -0.010108483, 0.1249663085, 0.4259966016, 0.0221625399, 0.1973185688, 0.290627569, -0.0926226154, 0.2536982, -0.3461322784, -0.3160282075, -0.3414963782, 0.2313449532, -0.4401257038, -0.2124316692, -0.2084480822, -0.2706872821, -0.0848740563, -0.0113783572, -0.2570592463, 0.2090296596, 0.0766113028, -0.234741509, -0.1947252303, -0.4968028069, -0.130617097, -0.1331723034, 0.4301263094, -0.1012998894, 0.4015230238, 0.1030495763, -0.1810587049, 0.0290286783, 0.3175077438, 0.0872922689, 0.1963392347, 0.0133623425, -0.1889032423, 0.0431265831, -0.119152993, 0.072383143, 0.317927897, 0.2134421021, -0.0753749236, 0.1678414345, 0.0687645003, -0.1467100978, 0.2038978785, -0.0412292257, 0.2431821823, 0.0998826474, 0.0278645065, 0.1857537031, -0.0540200211, -0.3054510653, -0.14820005, -0.2258321047, 0.0509598069, 0.2498963624, -0.008111422, 0.1863154769, -0.2863771021, 0.1335958093, 0.135771066, 0.6176179647, 0.2860670388, -0.1427044868, -0.1430065185, -0.1510524154, -0.3049139082, 0.3031996787, 0.1856850237, -0.3401729763, -0.0325695351, -0.0787373856, 0.0555836111, -0.0671913847, -0.3388932049, 0.1711835414, -0.0554584302, -0.1162090153, -0.239993304, 0.3016029894, -0.1026962474, -0.0256434362, -0.0212992504, -0.0838334411, 0.0958453044, 0.0370115079, 0.1094704941, -0.0381376259, -0.4150056839, 0.0061347042, -0.0140304351, 0.1681958884, 0.2728514075, -0.0538943745, -0.2741575241, 0.0648499876, -0.0640593544, -0.1224149168, -0.2482180744, -0.1093811169, 0.0175885521, 0.1900930554, 0.1669215709, 0.2837263942, -0.0647188276, 0.0451711491, 0.3557332754, 0.0490445718, -0.3398379385, -0.0906767324, -0.0053018541, -0.1250113398, 0.2342025936, 0.6557597518, 0.0375271589, -0.000767442, -0.2772576809, -0.5082750916, 0.5603702664, -0.3009026349, -0.1876612753, -0.0994003117, 0.1073845699, 0.4117279649, -0.0702463686, -0.7056640387, -0.1818269938, 0.1257764399, -0.1075636819, -0.5928037763, 0.3088392019, -0.0592664592, -0.0610287599, -0.1592837572, 0.2810199261, 0.1327218115, 0.0317784026, -0.0160773434, -0.2202397883 ]
https://github.com/huggingface/datasets/issues/486
Bookcorpus data contains pretokenized text
I believe these are just artifacts of this particular source. It might be better to crawl it again, or use another preprocessed source, as found here: https://github.com/soskek/bookcorpus
It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575
27
Bookcorpus data contains pretokenized text It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575 I believe these are just artifacts of this particular source. It might be better to crawl it again, or use another preprocessed source, as found here: https://github.com/soskek/bookcorpus
[ 0.0448167138, 0.1466451436, -0.0626624078, 0.3189457059, -0.048128061, -0.2803269625, -0.0028584732, 0.2543210089, -0.4264054298, 0.0911978856, -0.135417372, 0.3492500484, 0.2933693826, -0.1151343733, -0.0640322194, 0.206919238, 0.2553401887, 0.2440312058, 0.0813037455, -0.1928591132, -0.175733164, 0.3218997717, 0.1353743821, 0.1295605451, -0.1914878339, -0.2316985875, -0.1364848316, 0.2966262102, -0.1697289199, -0.368537128, 0.0418672822, 0.237315461, -0.0457460582, 0.420037657, -0.0001042967, -0.19997482, -0.0085522411, -0.0008110498, -0.2220439911, 0.0396468416, 0.2418954372, -0.1047129631, 0.331656307, -0.4221563339, -0.2050878853, 0.0990940779, -0.1921878904, 0.1155715361, 0.1336492151, 0.2984399199, 0.2685510814, 0.2499954551, -0.1447292566, 0.2405896932, 0.2765300274, -0.1052289009, -0.268032968, 0.1541528851, 0.480815798, 0.2871723175, -0.1176711023, 0.325273037, -0.1483823508, -0.0550988317, 0.0139529221, -0.0682796314, 0.1332596689, -0.2030376196, 0.2449138463, 0.1743476987, 0.1978157163, -0.1787819266, -0.037416447, -0.0773185715, -0.0317804553, -0.0305364504, 0.3331259787, 0.1972818375, 0.1977315098, 0.0857231542, -0.2289129943, -0.1092083305, 0.0344106741, 0.1787556559, -0.0696733519, 0.3172314167, -0.1269732565, -0.0139593473, -0.0726936385, -0.1028294861, -0.2077138722, 0.0291777905, -0.3983157873, 0.0002940759, -0.031008618, -0.1343759, -0.0526117161, 0.3532703817, -0.0294967163, 0.1897889525, 0.1584521085, 0.2260872275, -0.1797979325, -0.0180141013, 0.1203736961, 0.1379708499, 0.1127826124, 0.2411133498, 0.0682668537, 0.0640389174, -0.2253689766, -0.0351155959, 0.0394889377, 0.0142926434, 0.0254289303, 0.0347912498, -0.0737024918, -0.4883921444, 0.192217201, 0.208352536, -0.0955338031, 0.2945860028, 0.016628325, 0.0861298814, -0.1078065038, 0.029052427, 0.2102759331, 0.0138789909, -0.1805819124, -0.1609926075, -0.1973941773, -0.0833953246, -0.316727072, 0.0978534445, 0.1498285383, -0.0653668568, 0.2154065669, 0.0616457686, -0.1452437937, -0.0833909065, 0.0132531589, -0.2287240922, 0.2126798481, -0.0081227506, -0.0353081934, 0.2613687515, 0.0131317237, 0.0074575525, -0.1886084378, 0.0436920822, -0.370269537, 0.0749155954, -0.2921419442, 0.2618965209, -0.2681959271, -0.2209359705, -0.0918351635, 0.0528983176, 0.2958085239, -0.2276178002, 0.3187197447, 0.0037580251, -0.0961415917, 0.0139310714, -0.2106837332, 0.2404084653, -0.1392855048, -0.1497937143, -0.0291266069, 0.0125166392, 0.2761660516, 0.107272543, -0.2123288065, -0.0086451173, 0.1043877304, 0.732560575, 0.043335598, -0.0778364092, -0.4785209298, 0.286270082, -0.0392541625, 0.07498312, -0.180236578, -0.1213597059, 0.1312686503, 0.044912044, -0.1406107992, 0.151167661, 0.6003321409, 0.2346286625, -0.6044290066, -0.2423950285, 0.2666246295, 0.1318974793, -0.1301938593, -0.0382734872, 0.1433160305, -0.008330036, 0.0949672833, -0.2224238962, 0.2434530705, 0.4617541134, 0.1976676583, 0.3330713809, 0.2323131114, -0.0787153542, 0.1970965713, -0.0055600116, -0.6133105755, 0.6089823246, -0.058999978, -0.2922887504, -0.0787852183, -0.3615650237, -0.1525608748, -0.0115267206, 0.2970632911, 0.1812445223, -0.1170867383, 0.3826628625, 0.169154793, -0.0269449446, -0.0533160754, 0.0236410405, -0.3362287581, 0.043103192, -0.168178454, -0.1970748603, -0.1390395761, 0.2937303483, 0.2984580398, 0.0936223641, -0.26252231, 0.5021241903, -0.4160386622, 0.2466993928, -0.1689232886, 0.1719900221, 0.232218504, -0.0092719207, 0.1116820648, 0.5388674736, 0.3786892295, -0.0529739186, 0.2159279287, 0.3990840912, 0.4482701421, -0.0155957034, 0.0430603102, -0.1934473664, 0.147088632, -0.2783165872, 0.1191445887, -0.1288463622, 0.2308625579, 0.0909618065, 0.094511725, 0.2028738558, -0.1953775585, 0.3303447664, 0.328751564, -0.0927829295, 0.09695521, 0.2161507308, -0.2830909491, -0.257610172, 0.0114529775, 0.1333328336, 0.0847557187, 0.0552716479, -0.0330927595, 0.0875940621, 0.0944515243, -0.3282379508, 0.2330364734, 0.1454982311, -0.2436210662, 0.064276509, 0.2809624672, 0.2006415874, -0.4732762575, -0.0961565375, -0.0593897142, 0.1325762868, -0.1590370089, 0.3321846426, -0.3209880888, -0.6278650165, -0.0989342928, 0.0389646254, -0.1498232484, -0.2108940035, 0.2689702213, 0.1829664707, -0.117047675, -0.024207199, 0.1855787933, 0.3524076343, -0.2660959661, -0.0416391231, -0.150988251, -0.3491878211, -0.7120475769, 0.1918044686, 0.0732698515, 0.0796466544, -0.041074086, -0.2622718215, 0.0435617492, -0.302893281, -0.3058650196, 0.0577229001, -0.1697435677, -0.081070669, 0.0272013545, -0.1541400403, -0.378110975, -0.2736582458, -0.00238041, -0.1636533141, -0.1409660876, 0.1180330068, -0.287358731, -0.4336167872, -0.4267376661, -0.4536304772, -0.0530870222, -0.141670078, 0.3145367205, 0.2562345862, 0.0632838532, 0.3353788853, -0.3295734823, 0.0930115357, 0.2780517638, 0.4002051651, -0.3519274592, -0.409927547, 0.3584454954, -0.1365949214, -0.4528924227, -0.0235647764, 0.1484943479, 0.0834878609, -0.0692306757, -0.4910206795, 0.2069646269, -0.2885847986, 0.0113302646, 0.1198526025, 0.026763143, 0.2422290742, 0.1011982486, -0.258120954, -0.0639288872, -0.0957719758, 0.2960178256, 0.2582883835, 0.2977916896, -0.2564225793, -0.2517828047, -0.0318350606, -0.0260696169, -0.1021023393, -0.1441983432, 0.4561550021, -0.044237338, 0.187722519, -0.1615411192, -0.039188154, 0.0314301625, -0.3032162189, -0.0150899598, 0.7271084785, 0.0212645866, -0.4289528131, -0.033235088, -0.3933040798, -0.5735103488, -0.4311955273, -0.1001487076, -0.0432980992, 0.0939050913, 0.1236361042, -0.0178423822, 0.1207754165, -0.4445357323, 0.0327544175, 0.1532093138, -0.1836448014, 0.0478670299, -0.3420098126, 0.1687643379, -0.3717236519, 0.2553084195, 0.0052621299, -0.0013446769, -0.0451654084, 0.05862578, 0.2602805197, -0.2168097496, 0.1064087003, 0.0102946172, 0.0653240308, 0.2743197381, -0.3003891706, -0.0027096476, -0.1228682324, -0.2420936376, 0.1531209201, 0.3913674951, 0.1850693822, -0.312265873, 0.0835666135, -0.3329971731, 0.1282999963, -0.168028608, 0.3180052936, -0.059293773, -0.212467894, -0.3637365997, 0.0656475574, 0.0530693941, 0.4273859262, -0.1115670577, -0.0455709584, 0.0330483094, 0.2324435562, 0.2790346742, 0.2280364484, 0.4632433057, -0.2713530958, 0.0324242227, -0.1344937384, 0.182701692, 0.1138170585, 0.4114050269, 0.0695165247, 0.0734403357, -0.0852294043, -0.4019818902, -0.2859324515, 0.397033155, 0.1608571112, 0.291751653, 0.2020863295, -0.0327832848, 0.0800197721, 0.1323828697, -0.0058358181, -0.0144793885, -0.0985421687, -0.0809306204, 0.1879969984, 0.0858461931, -0.0652612001, -0.0130619761, 0.1561302543, -0.3943967819, 0.4994820654, 0.0091066426, 1.2245502472, 0.1914114952, 0.2473147213, 0.1475097984, 0.0828836933, 0.1094571948, -0.5010137558, -0.0462771207, -0.3080054522, 0.1485586911, -0.0597314537, 0.3675074577, -0.0961660594, 0.1176998243, -0.3358369768, 0.1413774937, -0.2380870432, 0.0940170437, 0.0226751957, -0.0210824776, 0.1031461582, -0.1923016906, 0.1085879058, 0.2364025861, -0.065432623, 0.1071671918, 0.0198923685, -0.2630673051, -0.2315974832, -0.1430667043, -0.2902029157, 0.2394073904, 0.050356891, 0.0529959127, 0.2848294973, -0.0000991313, -0.112158522, 0.1071237847, 0.3068517745, 0.2490317822, -0.3617754877, 0.2733414471, 0.2050229311, -0.1065806001, 0.2486872524, 0.1970614642, 0.3249381781, -0.1391121596, -0.1275560856, -0.1675463021, -0.045894891, -0.1557642221, -0.0518639833, 0.0214325972, 0.0463714153, -0.3336117268, -0.0767350867, 0.2401323766, -0.3926161826, -0.2628388703, 0.1982801408, -0.1990272701, -0.159206599, -0.0691772625, 0.1285281926, -0.3441815376, -0.1976014376, 0.4220586419, 0.2594237328, -0.1140968651, 0.2870841324, -0.0380650498, -0.245044291, -0.3479489386, -0.159073174, 0.2692505419, -0.4661868513, 0.1822969764, -0.0721395016, -0.3561224639, 0.2949462831, 0.6725559235, -0.080481559, 0.359321624, -0.2375116646, -0.3537042141, 0.0164921451, -0.0583340004, -0.0230597761, 0.1235372722, 0.3605513871, 0.2287784666, -0.0449988991, -0.1231184304, -0.4092462659, 0.3093143106, -0.4030049443, 0.2577028871, -0.1985127032, -0.0855368301, -0.1081541404, -0.0206874534, 0.051003404, 0.3924660087, -0.0547481589, -0.3172295392, -0.3506038189, 0.0725567713, 0.2348157465, -0.141684249, -0.1793184578, 0.011717068, 0.0772335827, -0.1079201773, 0.0482685901, 0.0659533665, 0.0420018099, 0.3306062222, 0.0579713993, 0.1590733677, -0.3384088278, -0.0257625543, -0.0776409283, 0.0079832114, -0.1462880969, 0.0645455196, -0.2116556317, -0.0769070014, -0.1116121933, 0.1302299798, 0.1451042145, 0.4586121142, 0.2783310413, 0.1129998192, 0.1690621972, 0.1006910428, 0.1460393369, 0.2584139109, -0.2015938312, -0.4826546609, 0.2902130187, 0.2997665405, -0.0947843269, -0.374823004, -0.0598172881, -0.4852976799, -0.0221100803, 0.0629763529, 0.4774011075, -0.2948592305, 0.2269396186, 0.0935661271, 0.3392338455, -0.0036563671, 0.2050053179, 0.3165461719, -0.0829434693, 0.0184576288, 0.1893010736, -0.0224327669, -0.1535356939, 0.4744415879, 0.1242652908, 0.425340414, 0.5266214609, 0.2677661479, -0.0496026427, 0.2188427746, 0.355084002, 0.0118996995, 0.1806086749, 0.3160145879, 0.0988194421, 0.2178559601, -0.2701138556, -0.3222950101, -0.1784775257, 0.179180786, -0.3917806745, -0.0441021658, -0.1466632336, -0.1504087597, -0.1310459226, -0.030556431, -0.2464740723, 0.1594864428, 0.0352634527, -0.0778795481, -0.1439425051, -0.3957462609, -0.1519309729, -0.1954063922, 0.3066392541, -0.1740103513, 0.2878360748, 0.0850269347, -0.0048501892, 0.0827035531, 0.2119257152, 0.1977033466, 0.2964373827, -0.1173012406, -0.0388402008, -0.0374281406, -0.0987749696, 0.1580718011, 0.2782497704, 0.1883055121, -0.0295790434, 0.1161465719, 0.1148044467, -0.2072362453, 0.2041775882, -0.1279339492, 0.2416417152, 0.1335807145, 0.1190792024, 0.0195863303, -0.1260527223, -0.3083533049, -0.2294475883, -0.2746401727, 0.0670800135, 0.2077345848, -0.0519189574, 0.1856832802, -0.2875627577, 0.1513200104, 0.1411019564, 0.6888768077, 0.2781016827, -0.0805137604, -0.0842654034, -0.1521545947, -0.3064152598, 0.3324436247, 0.1166922078, -0.2755003572, -0.0252466183, -0.0877107307, -0.0442932025, 0.0128352214, -0.3822121322, 0.2271619886, -0.1277781725, -0.2840724885, -0.359786272, 0.3236964643, 0.1303899735, -0.1133333519, 0.0209484939, -0.1534525156, 0.1544736326, -0.0766034499, 0.1796653122, -0.1036647335, -0.5949345827, -0.1030549929, 0.1579016894, 0.1936386973, 0.2918349504, 0.0025176157, -0.2615237534, 0.043496225, 0.020494068, -0.2243356854, -0.0426710844, 0.0278208517, 0.169295907, 0.1975402236, 0.1363654435, 0.3651081324, -0.0719057471, 0.2666305006, 0.2732155621, 0.1929306537, -0.1848859936, -0.0891331658, -0.165814057, -0.0525438897, -0.0295558069, 0.5959389806, 0.0899260566, -0.0072153523, -0.2557161748, -0.4805972576, 0.5174429417, -0.2570450306, -0.1837043613, -0.029739121, 0.1526864469, 0.4775866568, -0.0879563391, -0.6576776505, -0.1006936505, 0.1419466585, -0.0659028143, -0.5773203969, 0.2950587571, -0.1587461978, -0.0939944014, -0.0757436007, 0.2928364277, 0.3342241347, -0.0027446144, 0.126153335, -0.1822182089 ]
https://github.com/huggingface/datasets/issues/486
Bookcorpus data contains pretokenized text
Yes actually the BookCorpus on hugginface is based on [this](https://github.com/soskek/bookcorpus/issues/24#issuecomment-643933352). And I kind of regret naming it as "BookCorpus" instead of something like "BookCorpusLike". But there is a good news ! @shawwn has replicated BookCorpus in his way, and also provided a link to download the plain text files. see [here](https://github.com/soskek/bookcorpus/issues/27). There is chance we can have a "OpenBookCorpus" !
It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575
60
Bookcorpus data contains pretokenized text It seem that the bookcoprus data downloaded through the library was pretokenized with NLTK's Treebank tokenizer, which changes the text in incompatible ways to how, for instance, BERT's wordpiece tokenizer works. For example, "didn't" becomes "did" + "n't", and double quotes are changed to `` and '' for start and end quotes, respectively. On my own projects, I just run the data through NLTK's TreebankWordDetokenizer to reverse the tokenization (as best as possible). I think it would be beneficial to apply this transformation directly on your remote cached copy of the dataset. If you choose to do so, I would also suggest to use my fork of NLTK that fixes several bugs in their detokenizer (I've opened a pull-request, but they've yet to respond): https://github.com/nltk/nltk/pull/2575 Yes actually the BookCorpus on hugginface is based on [this](https://github.com/soskek/bookcorpus/issues/24#issuecomment-643933352). And I kind of regret naming it as "BookCorpus" instead of something like "BookCorpusLike". But there is a good news ! @shawwn has replicated BookCorpus in his way, and also provided a link to download the plain text files. see [here](https://github.com/soskek/bookcorpus/issues/27). There is chance we can have a "OpenBookCorpus" !
[ 0.0938440338, -0.120726496, 0.0057474095, 0.3477259874, -0.0450498164, -0.2574843168, 0.0231197737, 0.1923967749, -0.3466639519, 0.1204393134, -0.2318459153, 0.0498439409, 0.250826478, 0.2811336219, 0.0633643344, 0.1325373799, 0.28798455, 0.1430954486, -0.0784864351, -0.1598725021, -0.2173704803, 0.4336138964, 0.1166466922, 0.1677406132, -0.038890224, -0.1268423647, -0.2003346384, 0.4001176357, -0.207802698, -0.2791160345, 0.1527043581, 0.2251888961, -0.1080718189, 0.4011822939, -0.0001066821, -0.1593560576, -0.1229975224, -0.0155404434, -0.322963357, 0.0267892051, 0.3888087273, -0.1011465862, 0.1833068579, -0.3243452907, -0.3408611417, 0.1802245528, -0.1350855231, 0.0620261729, 0.1249143779, 0.1039680094, 0.2136241794, 0.3086168766, 0.0371992327, 0.2225583643, 0.0696241409, -0.037563391, -0.3527916968, 0.2101966739, 0.491291523, 0.220524624, -0.0633486658, 0.2900326848, -0.127696529, -0.111872606, 0.0393990055, -0.0221191756, 0.2333826125, -0.1150670499, 0.2039379627, 0.3186211884, -0.0194094125, -0.259966433, -0.1064575016, -0.1943800896, -0.0760998428, -0.0726008341, 0.3364340067, 0.2846117318, 0.2253693789, 0.096883066, -0.3741989136, -0.2277469188, 0.0811934173, 0.1313808411, -0.040546868, 0.0361633003, -0.1846027672, -0.0237985831, 0.0744446218, 0.0134655377, -0.4898000658, 0.0269409176, -0.3042085171, 0.0350655094, -0.0974977911, -0.1498349607, -0.0538873039, 0.7010752559, 0.0746983439, 0.0693674013, 0.0530724116, 0.1078741848, -0.3359388113, -0.0265542101, 0.0820745602, 0.1007656679, 0.1369505525, 0.0156086246, 0.0678852424, 0.1843395233, -0.0453089699, 0.0362811387, 0.0438414589, 0.1020606309, -0.16392757, -0.020933792, -0.0724794716, -0.3996303678, 0.1268751472, 0.1415818036, -0.1334971786, 0.3642198145, 0.0879588202, 0.0076307305, -0.2582372427, -0.0210709367, 0.2964794338, -0.0102807367, -0.2136098891, -0.2217780948, -0.1615479589, -0.095871374, -0.3191135526, 0.2264874727, 0.1464721709, -0.3952272236, 0.1858625561, 0.044476252, -0.3081521392, -0.0185633339, -0.0056981635, -0.090286918, 0.1193650216, -0.1410990953, -0.0466801561, 0.1980329007, 0.0333117209, 0.0604280606, -0.230429098, -0.0702005252, -0.2735204995, 0.0120780813, -0.3084299564, 0.2019416392, -0.3340654075, -0.1973949075, -0.2077861428, 0.0061913333, 0.1389765143, -0.247793749, 0.3023016751, 0.1350103766, -0.1767830551, 0.0876916125, -0.1400108933, 0.2940986753, -0.0604804195, -0.2447985709, 0.2254451215, 0.0317280628, 0.1518549472, 0.1032100916, -0.1967703998, -0.0480702445, 0.0697818249, 0.6613707542, -0.1448672712, -0.1817839146, -0.4148920476, 0.1682779044, -0.1120373234, 0.1598675698, -0.1114612222, -0.1683020443, -0.0464655049, 0.0063898438, -0.2677539885, 0.1824933738, 0.5105291605, 0.2303017229, -0.5244212747, -0.3914474249, 0.2984266877, 0.1271820962, -0.2067020833, -0.0531214587, -0.0020294746, 0.0140402215, 0.1554813385, -0.2145638168, 0.1634926349, 0.3532805741, 0.2083566636, 0.3966574371, 0.2448126078, -0.0061979359, 0.1457245052, -0.0089486828, -0.6330723763, 0.5566459298, 0.1423983574, -0.3734452724, -0.1040412709, -0.3479044735, -0.0915619656, -0.1056641191, 0.2224727273, 0.1875251979, 0.0559779257, 0.2985980809, 0.1524912864, 0.2028595656, 0.0043207579, 0.1445836872, -0.6349847913, -0.0340981521, -0.1526806355, -0.0318962038, -0.1222348064, 0.3136817217, 0.1959504634, 0.0005568358, -0.0889046565, 0.5558326244, -0.5106655955, 0.2036435604, -0.1912868172, 0.2680998743, 0.2760773003, 0.1986155659, 0.0812511295, 0.4749920368, 0.3740748763, 0.0067572678, 0.1219973341, 0.3797281384, 0.4839080274, -0.0598702915, 0.1076588184, -0.1555412263, 0.0351830795, -0.2817845345, 0.000400667, 0.0369275138, 0.2631744146, -0.1114643887, 0.2040321976, 0.1861054748, -0.3016121984, 0.2576790452, 0.4086391926, -0.1320691109, 0.0894850791, 0.1542827934, -0.3398967683, -0.1776926219, 0.0346417986, -0.1265436113, 0.0189013984, 0.0660444424, -0.0793131217, 0.1490279585, 0.1661368608, -0.2313830703, 0.3121629059, 0.1072963476, -0.2484964132, -0.0338418521, 0.2163284719, 0.1573525369, -0.4162902236, -0.0698960349, -0.1470283419, -0.0663297474, -0.1102838814, 0.2880488038, -0.2646134198, -0.5740512013, -0.1406422704, -0.0019308323, -0.1594646424, -0.1174939051, 0.3127174079, 0.3862803876, -0.0017170198, -0.1491291821, 0.1377096921, 0.4958687425, -0.3587919772, -0.0933328271, -0.121211037, -0.2203115374, -0.640042901, 0.1287745982, 0.0795241594, -0.1360810697, 0.0171537977, -0.2981891036, 0.0103077162, -0.3268691301, -0.3456940651, 0.1376443654, -0.2445942163, -0.1988654137, 0.0822717324, -0.1902068257, -0.4083918631, -0.1923139244, 0.0181796793, -0.1432585716, -0.2758735716, 0.1623868942, -0.1835000217, -0.3752994537, -0.388489455, -0.3572838008, -0.0505762585, -0.1736680716, 0.5705417991, 0.1918962449, -0.0065139499, 0.5147131085, -0.3683892488, 0.1496381611, 0.2725294828, 0.3947569728, -0.3479955792, -0.4685352743, 0.3225314617, -0.0649404302, -0.4029200673, -0.0109297642, 0.0989054739, 0.0454924554, -0.0920306817, -0.4073902369, 0.0923258811, -0.211983636, -0.0158267058, 0.1361185759, 0.1005617753, 0.4459449649, 0.126624614, -0.2117585391, -0.0010534979, -0.2075611651, 0.3247995079, 0.3419707716, 0.3122249544, -0.1932133287, -0.3087398708, 0.0377809852, -0.1208563894, -0.068381384, -0.0469394065, 0.4255402982, -0.0183444079, 0.2324013114, -0.2110126168, -0.094340153, -0.0144862141, -0.3801889122, 0.0313820466, 0.6702113152, 0.1985560507, -0.13692303, -0.0599776246, -0.3689664602, -0.6417500377, -0.4424599111, -0.2246519178, 0.171025902, 0.0653162822, 0.0593961515, 0.0653528273, 0.1679579467, -0.452316761, 0.2160942256, 0.1880339086, -0.1169767007, 0.1536767185, -0.1043579131, 0.1665079147, -0.3501744568, 0.3285303414, -0.1217256859, -0.1349209249, -0.0923758149, -0.0829188749, 0.2527402937, -0.2515932322, 0.3255560398, 0.1049827337, 0.0539810024, 0.1783374697, -0.4626269341, -0.0315129161, -0.1001412794, -0.1385667175, 0.1359021217, 0.4657759964, 0.2852057517, -0.465267688, 0.0571999587, -0.2035701424, 0.2359099835, -0.1319595277, 0.2894383073, -0.0765413716, -0.2617915571, -0.3590091169, 0.0714079738, -0.0027962537, 0.4658588767, -0.0614631139, 0.0881538987, 0.0423535332, 0.0759938359, 0.3209172487, 0.1585342139, 0.3812204599, -0.1816036701, 0.1032799929, -0.007786063, 0.258240968, -0.0194942001, 0.4296956956, 0.2879307568, 0.0334301777, -0.08159291, -0.2895694673, -0.3119291067, 0.4915585816, 0.1787161678, 0.1890119314, 0.3776549101, -0.0836759284, -0.0504908711, 0.11218182, -0.0673041567, 0.0549026169, -0.1972082853, 0.028463725, 0.0690329298, 0.1082101166, -0.0777714178, 0.0953312516, 0.3547430038, -0.3693215847, 0.3874284625, -0.1326043606, 1.2466688156, 0.0610320605, 0.3273181319, 0.2324028611, 0.2237144858, 0.0517904796, -0.4737738073, 0.0959864706, -0.338162154, 0.2183777988, -0.0965204015, 0.4169149399, -0.1062446982, 0.040630538, -0.2432556599, 0.1963573247, -0.0930291638, 0.1904978752, -0.0916996151, -0.0072290427, -0.1202441528, -0.3448233604, 0.0097189145, 0.1911435723, 0.0145951081, 0.3203693032, 0.1459581405, -0.3317461014, -0.2183898389, -0.0407764539, -0.154641971, 0.3159373105, -0.0854475573, -0.081743367, 0.4184538722, 0.0431343019, -0.107443139, 0.1573024094, 0.4088447094, 0.2863366306, -0.4062108994, 0.0659091398, 0.0239763781, -0.1914272606, 0.2301289737, 0.079236567, 0.3603212237, -0.0542961508, -0.0340520628, -0.1631663591, 0.0012093302, -0.1712645441, 0.0285215657, 0.0273658838, 0.1606480032, -0.3978773952, -0.0255058352, 0.2487515062, -0.3316327333, -0.2336687297, 0.1452808231, -0.211029157, -0.1632933766, -0.1514056176, 0.1720245034, -0.2713443935, -0.1732176691, 0.4485716224, 0.1804520041, -0.1976038218, 0.2521139383, -0.0242789593, -0.230077669, -0.2597090602, -0.1339483708, 0.3980847299, -0.3519409597, 0.0863051042, 0.0551350601, -0.3697425425, 0.1973041296, 0.7515904903, -0.0260747541, 0.1744611561, -0.2122738957, -0.2387895137, 0.0217943173, 0.0409231596, 0.0566869453, 0.1364222318, 0.6430283189, 0.2666283846, -0.0395215526, -0.2141704112, -0.3800366223, 0.2778606415, -0.3200719059, 0.1124016866, 0.0029337436, -0.0667312965, 0.0916442126, -0.089667961, 0.0401450135, 0.3479636014, -0.0852562487, -0.2581968904, -0.4077642262, 0.0772904754, 0.230694145, -0.2337165028, -0.0889584124, 0.0437884852, 0.0584509, -0.108464323, 0.0704259872, 0.1037858352, 0.1214170232, 0.1209269613, -0.1024183258, 0.2657804787, -0.4172897041, -0.1044718847, 0.0169199947, 0.054270193, -0.0603358299, -0.014916881, -0.2595125735, -0.0674868599, -0.0660632774, 0.2184061855, 0.3321197629, 0.436609, 0.3683237731, 0.1369673461, 0.0183148924, 0.1096077785, 0.2874647379, 0.185190618, -0.1328525394, -0.3547145128, 0.3443645835, 0.2502985299, 0.0044987248, -0.2905495465, 0.1117965952, -0.5064705014, 0.0177645739, 0.1481599212, 0.4995013773, -0.0700214058, 0.3091271222, 0.0297118854, 0.2923953831, 0.1236855015, 0.1615946293, 0.2556518316, -0.1314314306, 0.0687178969, 0.2706288695, -0.0009668504, -0.0322647765, 0.2306299955, 0.0727451667, 0.3118821383, 0.3543473184, 0.371240288, -0.0912478566, 0.1493472755, 0.3343860805, -0.199326992, 0.2292360663, 0.2483121604, -0.0521306209, 0.446384877, -0.4679371119, -0.3230537176, -0.2296720892, 0.2725283206, -0.3189401329, -0.0621684045, -0.167669341, -0.0924038365, -0.1426835954, 0.076787293, -0.2698044181, -0.0065295151, 0.1894797087, -0.1842356622, -0.0856519639, -0.4537180066, -0.3113761544, -0.1692999601, 0.3823493421, -0.1074149311, 0.2846628129, 0.0380349346, 0.0034094658, -0.0238400232, 0.3346514106, 0.0962043405, 0.1980907619, -0.0604442731, 0.0217163432, -0.1130575016, -0.0072516571, 0.0356865823, 0.2513352931, 0.1394228339, 0.0043516271, 0.0718948394, 0.0843118802, -0.1742600501, 0.2088596374, -0.2105253935, 0.2519861758, 0.0795353204, -0.0590309501, 0.0023221772, -0.0617114902, -0.4243811369, -0.2515655756, -0.2580958605, 0.137736842, 0.244686231, 0.0673520565, 0.1199315414, -0.3152998388, 0.1366770267, 0.2973251939, 0.4903906584, 0.2618114352, -0.0695899129, -0.0861521736, 0.0290584378, -0.1447816193, 0.2138182968, 0.1083107367, -0.34953776, -0.1055350378, -0.0777623653, 0.0742028132, 0.1447280347, -0.49004668, 0.0882464796, 0.0159527734, -0.2991986275, -0.1523763537, 0.2757624686, 0.2243057638, -0.1155277044, 0.1021836251, -0.1675848067, 0.2022667825, -0.0899584964, 0.0990947634, -0.094720386, -0.507353127, -0.2690565586, 0.0019004913, 0.1711941957, 0.2324008793, -0.2298647612, -0.2758560181, -0.046046108, 0.0296139959, -0.0929937214, -0.1754734516, -0.0921417102, 0.0415048189, 0.1299180686, 0.1022344902, 0.0525232069, -0.0641559809, 0.3429867923, 0.3477365077, 0.1908774376, -0.1066460237, 0.0014483448, -0.2416456193, -0.1074559987, 0.0510744862, 0.7210323811, -0.0177647844, -0.0027943149, -0.2597803473, -0.38870579, 0.5166322589, -0.2793807387, -0.0613866374, 0.0027975352, 0.1745123565, 0.6265726686, -0.1433504075, -0.6584721208, 0.0154639985, -0.0379903652, 0.0367274657, -0.3834744096, 0.3062702119, -0.271751821, -0.068911925, -0.0705544129, 0.2927139699, 0.333376646, -0.1025819853, 0.1612817943, -0.1487856507 ]
https://github.com/huggingface/datasets/issues/482
Bugs : dataset.map() is frozen on ELI5
This comes from an overflow in pyarrow's array. It is stuck inside the loop that reduces the batch size to avoid the overflow. I'll take a look
Hi Huggingface Team! Thank you guys once again for this amazing repo. I have tried to prepare ELI5 to train with T5, based on [this wonderful notebook of Suraj Patil](https://github.com/patil-suraj/exploring-T5/blob/master/T5_on_TPU.ipynb) However, when I run `dataset.map()` on ELI5 to prepare `input_text, target_text`, `dataset.map` is **frozen** in the first hundreds examples. On the contrary, this works totally fine on SQUAD (80,000 examples). Both `nlp` version 0.3.0 and 0.4.0 cause frozen process . Also try various `pyarrow` versions from 0.16.0 / 0.17.0 / 1.0.0 also have the same frozen process. Reproducible code can be found on [this colab notebook ](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing), where I also show that the same mapping function works fine on SQUAD, so the problem is likely due to ELI5 somehow. ---------------------------------------- **More Info :** instead of `map`, if I run `for` loop and apply function by myself, there's no error and can finish within 10 seconds. However, `nlp dataset` is immutable (I couldn't manually assign a new key-value to `dataset `object) I also notice that SQUAD texts are quite clean while ELI5 texts contain many special characters, not sure if this is the cause ?
27
Bugs : dataset.map() is frozen on ELI5 Hi Huggingface Team! Thank you guys once again for this amazing repo. I have tried to prepare ELI5 to train with T5, based on [this wonderful notebook of Suraj Patil](https://github.com/patil-suraj/exploring-T5/blob/master/T5_on_TPU.ipynb) However, when I run `dataset.map()` on ELI5 to prepare `input_text, target_text`, `dataset.map` is **frozen** in the first hundreds examples. On the contrary, this works totally fine on SQUAD (80,000 examples). Both `nlp` version 0.3.0 and 0.4.0 cause frozen process . Also try various `pyarrow` versions from 0.16.0 / 0.17.0 / 1.0.0 also have the same frozen process. Reproducible code can be found on [this colab notebook ](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing), where I also show that the same mapping function works fine on SQUAD, so the problem is likely due to ELI5 somehow. ---------------------------------------- **More Info :** instead of `map`, if I run `for` loop and apply function by myself, there's no error and can finish within 10 seconds. However, `nlp dataset` is immutable (I couldn't manually assign a new key-value to `dataset `object) I also notice that SQUAD texts are quite clean while ELI5 texts contain many special characters, not sure if this is the cause ? This comes from an overflow in pyarrow's array. It is stuck inside the loop that reduces the batch size to avoid the overflow. I'll take a look
[ 0.0050864057, -0.2545408905, -0.097588174, 0.1058629677, 0.1502093524, -0.1698084623, 0.4342985749, 0.1180540696, -0.2856819034, 0.2499660105, -0.1675372273, 0.4118994772, 0.1468529552, 0.1485168934, -0.0885318145, 0.1992191374, -0.1245992631, -0.0692448542, -0.1046524048, -0.0854029357, 0.0994062051, 0.1942097545, -0.2547447681, 0.0946519896, -0.1753013283, 0.1913973689, -0.0475020073, 0.0138267968, -0.139434889, -0.3484274745, 0.102687858, -0.0013408826, -0.0601915419, 0.0998521894, -0.0001287397, 0.066696316, 0.0852748081, 0.0151903927, -0.0321883485, 0.1148893908, 0.3419379294, -0.092485778, 0.2941779792, -0.2267784327, 0.299403131, 0.2010619938, 0.3933570683, 0.2928214073, 0.5463501215, -0.113190867, 0.0042867521, 0.2285587937, 0.0229935478, 0.5134863257, 0.3447034955, -0.1565414816, -0.2626554668, 0.0360518359, 0.4549469054, -0.2447687238, 0.0202711709, -0.1735133529, -0.1445726454, -0.130960986, 0.1657723933, 0.3925583959, 0.0644611046, -0.6248463392, 0.0050569354, 0.1813288927, 0.3918076158, -0.2195326388, -0.0531339683, -0.248440221, 0.0206693113, -0.3290590942, 0.4384991229, -0.0801221877, -0.1662217081, 0.021537723, -0.219991222, -0.0387937501, -0.0763661042, 0.3075371385, -0.0092368135, 0.0896170437, 0.104429014, 0.139065057, 0.0363293737, 0.0282409452, -0.1358952075, -0.1827150434, 0.0109644486, 0.3332876265, -0.5986671448, -0.1634163857, -0.0271217674, -0.0691169649, 0.2069696635, -0.0307871755, 0.1467565, 0.1431545615, 0.1338287294, 0.0912329853, 0.4436791241, 0.0077231377, 0.1604894102, 0.0440576337, 0.2785818279, -0.1372032613, -0.3210591376, 0.1931505501, -0.0700885132, -0.2468798757, 0.0818447471, -0.2111312002, 0.0528817959, -0.2320254594, 0.2022605091, 0.1252007633, -0.6203747392, 0.0176216271, 0.01828067, 0.2910582125, -0.0792117044, -0.0218284801, -0.0857142881, 0.0450757705, -0.4482835829, -0.1256741136, 0.0942524672, -0.3879893422, -0.1894800067, -0.0087154442, 0.2495262772, -0.2611219585, 0.1432358474, -0.1522929817, 0.3228124678, 0.1161512285, 0.1629847437, -0.068268694, 0.2398325354, 0.0830463767, 0.1794319451, 0.1534904391, -0.2191046476, -0.0566179678, -0.0779644325, 0.4114332497, 0.0235467665, -0.0727851316, 0.0412018523, -0.0273829717, -0.2359689325, -0.0660010278, -0.0888219923, 0.1308399886, 0.4844258726, -0.3778196871, 0.0910024866, -0.2624388337, -0.0215130933, -0.095027931, 0.3381758928, 0.1944523752, -0.1940378249, -0.0274674129, -0.0265712403, -0.0410611555, -0.119507283, 0.4236695766, 0.0039513293, 0.1033087596, -0.0318869986, 0.2316197604, 0.3955102563, -0.2058111727, -0.7310904264, 0.0396428779, -0.2763491273, -0.136284098, -0.2522526979, 0.0629158989, 0.2470754236, -0.0630354658, 0.1072484627, 0.4468324184, -0.2058175653, 0.0618834123, -0.4313602448, -0.2683359981, -0.0633395761, 0.0862642229, -0.1417802572, -0.347304374, -0.1305567175, 0.1829260737, -0.0755518004, 0.0349515006, 0.2099799663, 0.2865864336, 0.20293203, 0.0456463024, -0.0300458167, -0.143975541, -0.4601619244, 0.0268318523, -0.0586411767, 0.2615789473, -0.1202888265, 0.0648180246, 0.2349445969, 0.0113876276, -0.2129580379, 0.0243548341, -0.0730480477, -0.228471145, 0.0837189183, 0.2112514079, -0.0019164612, -0.2065969706, -0.0059792879, 0.1431185156, -0.4388467371, 0.2543534935, -0.1280644983, -0.4770110548, -0.2971016169, -0.0658226088, -0.3881658912, -0.1865553111, -0.119670935, 0.1069657654, -0.3498889208, -0.1667898148, -0.1609003395, 0.4271226227, 0.2303898335, -0.3507651389, 0.1343251914, -0.2931651175, -0.0293530803, -0.084227331, -0.0780699179, 0.2284288108, -0.1594277024, 0.1833507121, 0.0703864843, -0.0162780806, -0.0938536525, 0.0467915311, -0.1287909746, 0.1275013387, 0.1001784727, 0.315977484, 0.3469287157, -0.0476951115, -0.0876374096, 0.3985708952, 0.8972323537, 0.1478901953, 0.0494404659, 0.1409238428, -0.0217284188, -0.120245941, -0.3746708035, -0.2797935903, 0.2434235066, 0.0051105022, 0.0252672434, -0.0428302772, -0.0932138935, -0.016467439, 0.1810831428, 0.2945490181, 0.0239811055, 0.1551364958, 0.4825341702, 0.067775622, -0.113149561, -0.0568578206, 0.1012777835, 0.1829894483, -0.177693978, 0.1054921076, 0.0243344568, -0.1170360222, 0.1892226934, -0.0143278334, -0.3084708452, -0.3321071565, 0.2306244522, 0.1722473949, -0.0961342975, 0.2171563059, 0.3602738678, -0.0538765267, 0.1465308666, -0.2379710823, -0.0116183963, -0.39896065, -0.4639270306, -0.0646317229, 0.5152742863, -0.0921800435, -0.1529769897, 0.1284044832, -0.4225046635, 0.0034482961, -0.5699738264, 0.2885663509, -0.2367335111, 0.3893535137, -0.0867009461, 0.27805233, -0.4414616525, -0.1928230822, 0.2745801508, -0.344804436, -0.3394559622, 0.1445185393, 0.044854939, 0.0084370803, -0.2066282034, -0.5001220107, -0.0840340182, -0.1841685325, 0.3770568371, -0.0746721551, 0.0755595714, 0.0847935379, 0.0967237726, 0.3439750969, -0.0327093564, -0.3106959164, 0.0395303257, -0.1168306246, 0.3748587668, -0.2084473968, -0.3211793602, -0.1357549131, 0.1308457851, -0.1553771496, 0.0252424907, -0.4053168297, -0.2954769433, -0.3072524667, 0.5448829532, -0.1725354642, 0.0388631597, 0.3364678323, 0.2721450925, 0.1090767756, 0.0871003121, -0.2881273329, 0.3796560168, 0.6361580491, 0.0603711121, -0.1144974753, 0.5326628685, 0.1268235296, 0.8650524616, 0.0501331985, -0.0962902382, 0.1846012026, 0.0508206487, -0.052421689, -0.4184013009, 0.1097521409, 0.1593180001, -0.0444965102, -0.051026091, 0.2817855775, -0.0252393149, -0.2723647654, -0.0099889096, 0.1290399581, -0.2740387619, -0.3053350747, 0.2833795547, -0.1501800418, -0.1847426295, 0.2023889124, -0.1284488738, -0.2675515711, -0.3865618408, -0.2657361031, -0.2626974285, 0.3266681433, -0.0310013276, -0.5268409252, -0.1693624705, -0.45382303, 0.3003254533, 0.2017196417, 0.1829951853, -0.3149503469, -0.0796468034, 0.2595864534, -0.3560301363, 0.5623477101, -0.2501100004, -0.0077964808, 0.0664593801, 0.1660587341, -0.3364863098, -0.1052747369, -0.1529740542, 0.1791737378, 0.5655252337, -0.206489712, -0.384806931, -0.1788009107, 0.3843321502, 0.0949747413, -0.1083511785, 0.094903037, -0.3024911582, -0.195683375, -0.3143539429, -0.0694739819, 0.3912864625, -0.0088342326, -0.1087368727, 0.0084653562, 0.2198884487, 0.1827402115, -0.0794841275, 0.2370212525, -0.1183428839, -0.1753091663, 0.3294098079, 0.2528046072, -0.1059925556, -0.1877213418, 0.2943144143, -0.0627309978, -0.2948414087, 0.4838993251, -0.1536407918, 0.355801791, 0.3829168081, 0.2371376157, -0.081795916, -0.0177957639, 0.1487635374, 0.3896477222, -0.0745606199, 0.4932510555, 0.3155471087, -0.0177192166, -0.1626806855, 0.1486383528, -0.1034398749, 0.0189359672, 0.4798076749, -0.145577997, -0.0643192381, 0.6060297489, -0.0395094603, 0.987285614, -0.443849206, 0.3768616319, 0.2483163029, 0.1166123897, 0.3669240177, -0.2621613443, 0.2863930166, -0.39739573, -0.2996113598, 0.2397464067, -0.2731795907, -0.2487071604, 0.3163548708, -0.1144675314, 0.0510350168, -0.0501098149, 0.2295384109, 0.0140192928, 0.2362154126, 0.1502758712, -0.1015114486, -0.4429036081, -0.0289849136, 0.0388888121, 0.0606172904, -0.072419174, -0.1615417451, -0.2318306565, -0.131878823, -0.2155956775, 0.2171112895, -0.1324207187, 0.0900547057, 0.3183255792, 0.004181942, 0.2054661512, 0.6948337555, 0.0254572928, -0.0103640705, 0.069270201, 0.1160049886, 0.0554087348, 0.0455112793, 0.3793326914, 0.0686988831, 0.2638887763, -0.1732292324, -0.237049669, 0.1212744638, 0.169242844, -0.2451240569, -0.1821863949, 0.090548493, 0.2008382678, -0.1988247335, 0.0886795148, -0.0004923507, -0.5018951893, 0.0365957469, -0.0460097343, -0.0520536564, -0.0365064405, 0.384383291, -0.0595831499, -0.1122866943, 0.0794157162, 0.6717551351, -0.1674193293, -0.143926397, 0.7501499653, 0.2646191716, -0.0452820994, -0.0137438802, 0.1758431941, -0.2018991858, -0.5593952537, 0.0608631894, -0.3067261875, -0.1109317392, 0.148719877, 0.2183100432, -0.2155748159, -0.2242219448, -0.2134022266, -0.3311449587, -0.3069343865, 0.24944444, 0.0512154773, -0.0429655127, 0.0193404499, 0.3812386394, 0.1493998915, -0.0937481746, -0.1093999445, -0.0954767913, -0.297012955, 0.2460078746, 0.0471743643, -0.4202584624, 0.3659623861, -0.1423820555, -0.045359768, 0.2743966877, -0.2231200486, -0.0985880494, 0.1066612974, 0.2159392089, -0.0818300173, -0.0772703886, -0.2459409684, 0.0146406312, -0.008958918, -0.2189129591, 0.2781190574, -0.2800685763, -0.0316738151, -0.0328375138, -0.0027316201, 0.2612270117, 0.0019771825, 0.0846835449, -0.0318552181, 0.0304131713, 0.3323299289, 0.3044151962, 0.0692908093, -0.0151134841, -0.2690471411, -0.0072409622, 0.1001593992, 0.0877483711, 0.2753632069, -0.4385762811, -0.1707716435, -0.2107212543, -0.1101353243, 0.5926235318, -0.1895663142, -0.3875774145, 0.2923754156, 0.0179402083, 0.0572983772, 0.121667482, 0.5638595819, 0.047848966, -0.0091145849, -0.0947177559, -0.0207892433, -0.089674592, 0.0290760156, 0.2730594575, 0.3346318305, -0.5037520528, -0.0086341351, 0.3587888181, -0.0602077283, 0.0653518289, 0.0825374648, -0.0608054437, 0.1784906387, 0.303940624, 0.1708101481, -0.2196981013, -0.502355814, 0.4505330324, 0.2428026795, -0.2482263297, -0.3020807207, 0.5325149298, 0.3196108937, 0.5286596417, 0.2846614718, 0.3522032797, 0.1508637071, -0.2730668783, -0.2414686233, 0.3165409267, -0.0552546009, -0.0754423887, -0.0673507974, -0.0525945015, 0.0400398187, 0.3657521009, -0.2580024898, 0.0849260315, 0.4335432947, 0.4367711544, 0.0632364079, -0.2560559511, -0.1521416456, -0.0732761398, 0.3150064051, -0.0367239453, 0.3979532123, -0.0304548014, -0.1338929981, -0.3677637875, 0.2811621428, 0.2063675821, 0.3232463598, -0.560747087, 0.4288632572, 0.0544945672, 0.0278190617, -0.0197820142, 0.1850553751, 0.2880259752, 0.0756826773, 0.0303502195, -0.0751663595, 0.0033644871, -0.2747896612, 0.1871063113, 0.3222307265, 0.1376532018, -0.2230947465, 0.2568220198, -0.3423521519, 0.1055422202, -0.1402104497, -0.4819664061, 0.2016894072, -0.0350151695, 0.0202043131, 0.036841549, -0.0110754613, -0.0054087397, 0.095595926, 0.6279259324, 0.3679852784, 0.238638863, -0.0641039312, 0.0885588601, -0.4655946791, 0.2648673952, -0.0297679305, 0.1389423609, 0.3166322112, 0.3369344175, 0.1583120078, 0.3255509436, 0.221391812, -0.2028586417, -0.4033806622, 0.5688688159, -0.5948471427, -0.1591481864, 0.0863335505, 0.1069520116, -0.1165291443, -0.2735639513, 0.0781194046, -0.224949345, -0.1005939171, -0.2130754441, -0.0973999277, -0.0582078919, 0.161388725, 0.2476560175, 0.2895668149, 0.1646664888, 0.0070550768, -0.1617267728, -0.1248113737, -0.1267133653, -0.0711516961, 0.0957815945, 0.0410700254, 0.0500343516, -0.254911989, 0.2613505423, -0.2735888958, 0.0168300159, -0.0059979288, 0.2123405486, 0.0228469968, -0.3081656694, 0.4737377167, 0.2139339745, -0.0859782994, 0.5660753846, -0.0658093244, -0.08027336, -0.6256955862, 0.1396765411, 0.278737545, -0.4091792107, -0.1944171041, 0.1413305104, 0.1041901112, 0.2522993088, -0.0474652573, -0.4054486752, -0.0626422837, 0.1113281175, -0.1385062337, -0.6580842733, 0.1909585744, 0.354512006, 0.1391702145, -0.218225047, 0.0990579948, -0.0152472891, -0.1090779379, -0.1203647554, -0.2823942304 ]
https://github.com/huggingface/datasets/issues/482
Bugs : dataset.map() is frozen on ELI5
I created a PR to fix the issue. It was due to an overflow check that handled badly an empty list. You can try the changes by using ``` !pip install git+https://github.com/huggingface/nlp.git@fix-bad-type-in-overflow-check ``` Also I noticed that the first 1000 examples have an empty list in the `title_urls` field. The feature type inference in `.map` will consider it `null` because of that, and it will crash when it encounter the next example with a `title_urls` that is not empty. Therefore to fix that, what you can do for now is increase the writer batch size so that the feature inference will take into account at least one example with a non-empty `title_urls`: ```python # default batch size is 1_000 and it's not enough for feature type inference because of empty lists valid_dataset = valid_dataset.map(make_input_target, writer_batch_size=3_000) ``` I was able to run the frozen cell with these changes.
Hi Huggingface Team! Thank you guys once again for this amazing repo. I have tried to prepare ELI5 to train with T5, based on [this wonderful notebook of Suraj Patil](https://github.com/patil-suraj/exploring-T5/blob/master/T5_on_TPU.ipynb) However, when I run `dataset.map()` on ELI5 to prepare `input_text, target_text`, `dataset.map` is **frozen** in the first hundreds examples. On the contrary, this works totally fine on SQUAD (80,000 examples). Both `nlp` version 0.3.0 and 0.4.0 cause frozen process . Also try various `pyarrow` versions from 0.16.0 / 0.17.0 / 1.0.0 also have the same frozen process. Reproducible code can be found on [this colab notebook ](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing), where I also show that the same mapping function works fine on SQUAD, so the problem is likely due to ELI5 somehow. ---------------------------------------- **More Info :** instead of `map`, if I run `for` loop and apply function by myself, there's no error and can finish within 10 seconds. However, `nlp dataset` is immutable (I couldn't manually assign a new key-value to `dataset `object) I also notice that SQUAD texts are quite clean while ELI5 texts contain many special characters, not sure if this is the cause ?
147
Bugs : dataset.map() is frozen on ELI5 Hi Huggingface Team! Thank you guys once again for this amazing repo. I have tried to prepare ELI5 to train with T5, based on [this wonderful notebook of Suraj Patil](https://github.com/patil-suraj/exploring-T5/blob/master/T5_on_TPU.ipynb) However, when I run `dataset.map()` on ELI5 to prepare `input_text, target_text`, `dataset.map` is **frozen** in the first hundreds examples. On the contrary, this works totally fine on SQUAD (80,000 examples). Both `nlp` version 0.3.0 and 0.4.0 cause frozen process . Also try various `pyarrow` versions from 0.16.0 / 0.17.0 / 1.0.0 also have the same frozen process. Reproducible code can be found on [this colab notebook ](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing), where I also show that the same mapping function works fine on SQUAD, so the problem is likely due to ELI5 somehow. ---------------------------------------- **More Info :** instead of `map`, if I run `for` loop and apply function by myself, there's no error and can finish within 10 seconds. However, `nlp dataset` is immutable (I couldn't manually assign a new key-value to `dataset `object) I also notice that SQUAD texts are quite clean while ELI5 texts contain many special characters, not sure if this is the cause ? I created a PR to fix the issue. It was due to an overflow check that handled badly an empty list. You can try the changes by using ``` !pip install git+https://github.com/huggingface/nlp.git@fix-bad-type-in-overflow-check ``` Also I noticed that the first 1000 examples have an empty list in the `title_urls` field. The feature type inference in `.map` will consider it `null` because of that, and it will crash when it encounter the next example with a `title_urls` that is not empty. Therefore to fix that, what you can do for now is increase the writer batch size so that the feature inference will take into account at least one example with a non-empty `title_urls`: ```python # default batch size is 1_000 and it's not enough for feature type inference because of empty lists valid_dataset = valid_dataset.map(make_input_target, writer_batch_size=3_000) ``` I was able to run the frozen cell with these changes.
[ 0.1289254874, -0.3091132045, -0.0682562813, 0.1572482139, 0.2135085315, -0.1734553576, 0.3533765674, 0.1509892046, -0.1582412124, 0.1141944155, -0.2389453202, 0.4564893544, 0.1083216295, 0.1284252405, -0.0192700084, 0.1580438018, -0.1359724551, 0.021666538, -0.1383990645, -0.1211570427, 0.128272593, 0.309268117, -0.2475367934, 0.0375251547, -0.1744520813, 0.2080098838, -0.1016791388, 0.0072082132, -0.1468412578, -0.3405947387, 0.1364496052, 0.045499675, -0.1865523607, 0.1471100152, -0.0001257587, 0.0547155142, 0.046349436, -0.0335170291, -0.0842949748, -0.072003372, 0.3044873774, -0.1794090718, 0.3073301017, -0.1446632147, 0.1273198873, 0.3064395487, 0.352668047, 0.2476815134, 0.6475166082, -0.1010443792, 0.0140078515, 0.341314137, 0.0202769823, 0.5116376281, 0.2437879741, -0.0982788801, -0.3499835432, 0.0335916057, 0.3750883639, -0.1832285076, 0.1367814541, -0.060827259, -0.0739212707, -0.0898050889, 0.1925574541, 0.4039261639, -0.0741318837, -0.6528962255, -0.0021791114, 0.2572255135, 0.2794767916, -0.1696972698, -0.1200201511, -0.3368321359, 0.0148049202, -0.4079926312, 0.4944003224, -0.0794705525, -0.1530280709, 0.0317085162, -0.1824895889, -0.065221101, -0.0135255205, 0.2793023884, 0.0590096265, 0.1251695156, -0.0725420043, 0.0867163166, 0.0587757044, 0.004024833, -0.379796654, -0.1810684651, -0.0119342376, 0.3528052866, -0.5798324347, -0.2715926766, -0.0327339433, 0.0594737381, 0.125358209, 0.0762942508, 0.1430135816, 0.1827673763, 0.0188215915, 0.0414594151, 0.4148795605, 0.001727491, 0.2859445214, 0.0397365801, 0.2681474388, -0.0332964063, -0.2699635029, 0.1644414812, -0.0023883285, -0.1432307363, -0.1291368157, -0.2096811086, 0.144316867, -0.333888948, 0.2238598317, 0.1400536448, -0.5295667648, -0.0235965624, 0.045112621, 0.348033458, -0.164506495, -0.0118467286, -0.015461822, 0.0286527686, -0.4626113474, -0.0920966491, 0.0960531533, -0.400587678, -0.1462285817, 0.0067685409, 0.2733540237, -0.3486695886, 0.2713475823, -0.1475230157, 0.2598329782, 0.1013623998, 0.1670905203, -0.0870443434, 0.2051350474, 0.0524540432, 0.1002825648, 0.1181940213, -0.1334884018, -0.1894538105, -0.0926410183, 0.2097845674, 0.149068445, 0.0154648861, 0.0886510238, -0.04083772, -0.2455912381, -0.0535609238, -0.0409293808, 0.270398289, 0.3567352295, -0.3351743817, 0.0605807304, -0.1100201309, -0.1654801369, 0.0336642563, 0.3799242079, 0.2518184185, 0.0483138599, -0.2410933822, 0.0075255367, -0.0359110534, -0.2282186598, 0.4138222039, 0.0667630136, -0.023256883, 0.0048589995, 0.1988447607, 0.4201339483, -0.2138727009, -0.5843526125, 0.1227921098, -0.2901562154, -0.0611702278, -0.3185211122, 0.0572844855, 0.1865839958, -0.113251999, 0.1086198017, 0.3744204938, -0.1522413939, 0.0520583838, -0.477055788, -0.2232019752, -0.0265084822, 0.0327685177, -0.1929166317, -0.2336607575, -0.1907963455, 0.2977529764, -0.0531564914, 0.0488934442, 0.1820816696, 0.3569730818, 0.1773024648, 0.1362029463, -0.1015438065, -0.1310838163, -0.5059304833, 0.0301138889, -0.0826805234, 0.436883539, -0.0742788017, 0.0415671244, 0.2162151635, -0.0862873793, -0.20924896, -0.0907134488, -0.0478547662, -0.1511385143, 0.0789053887, 0.2883450687, -0.0765573978, -0.1462701559, -0.0684962273, 0.229439199, -0.5454390645, 0.2303232253, -0.1101198643, -0.3616026938, -0.2829394341, 0.0522339232, -0.3480923176, -0.1953462958, -0.1199695691, 0.0457643047, -0.4057113528, -0.1182205826, -0.0787373781, 0.39961344, 0.3000271916, -0.2792614996, 0.0288000181, -0.1769138873, 0.0589300171, -0.0994165316, -0.1693899632, 0.300050348, -0.1911526918, 0.1421568096, 0.0937404558, 0.0221829768, -0.0751486942, 0.0131153744, -0.1991497874, 0.0291855894, 0.2271129787, 0.3052904606, 0.3777761757, 0.0039164457, -0.2030637264, 0.2866194248, 0.8647707701, 0.2128258795, 0.091522947, 0.1407785714, 0.0420253873, -0.1311240196, -0.3347012699, -0.2349749357, 0.2353042513, -0.0368024632, 0.010397519, 0.047123298, -0.0723185986, 0.0022590971, 0.2268693894, 0.2180666924, -0.0744220093, 0.1118379235, 0.4056483209, 0.1075130478, -0.17482014, 0.0449035577, 0.0736122653, 0.1916545331, -0.2182612568, 0.0064425347, -0.073502332, -0.1446316093, 0.1790858209, 0.0557616577, -0.4943909645, -0.3087978661, 0.1794395596, 0.0868466869, -0.0174650475, 0.2599861324, 0.3050743937, -0.0461212955, 0.0266663563, -0.162686035, -0.0823713169, -0.3713198602, -0.3768123388, -0.0614231862, 0.4895647764, 0.0645247027, -0.1084216014, 0.0187370609, -0.5041588545, -0.0094819162, -0.6358896494, 0.3481924236, -0.3971450627, 0.4128520191, -0.0781827793, 0.2758354247, -0.4864448905, -0.0928508714, 0.3476951718, -0.3571273685, -0.3248542845, 0.0642937124, 0.0845775232, 0.0274518654, -0.2390640229, -0.5075420141, -0.0715254769, -0.2004794627, 0.6052663326, 0.0293332394, 0.0404657312, 0.2019646466, -0.0366264991, 0.4214387834, -0.1367388815, -0.1317186356, -0.0288178399, -0.1558271348, 0.3360876739, -0.1849848777, -0.3257569075, -0.1265588105, 0.1665832251, -0.1240954474, -0.1564630121, -0.3962711096, -0.4087888598, -0.3515102863, 0.4195169508, -0.0856776088, 0.0416095555, 0.3636344969, 0.2145564109, 0.0893891454, 0.076914452, -0.359480828, 0.4156855047, 0.5649591684, 0.081152685, -0.0618201308, 0.5869221687, 0.1258979738, 0.763254106, 0.1647184193, -0.0777331442, 0.2583013177, 0.0622729994, 0.0986938849, -0.3876318634, -0.0207064003, 0.1824164093, 0.0286726486, 0.1055803522, 0.262031585, 0.049495101, -0.1202007607, -0.1215323359, 0.1444300115, -0.2589600384, -0.3341292739, 0.1795341522, -0.1171998978, -0.1604576707, 0.2035465389, -0.0725465044, -0.2123000324, -0.4061675668, -0.2326291502, -0.0760393292, 0.3426360786, -0.1049860343, -0.6462797523, -0.0349219628, -0.5429959893, 0.2988605201, 0.1454879045, 0.1586164236, -0.3372983336, -0.0721186176, 0.2224737108, -0.2879295349, 0.411473453, -0.1915260404, -0.0516272523, 0.0511151068, -0.0398449115, -0.2840803564, 0.1139927879, -0.1935248226, 0.1324242949, 0.6303719282, -0.0946359634, -0.5235409737, -0.3121540546, 0.3164808154, 0.0571210496, -0.0688861236, 0.1559968144, -0.3152290583, -0.1021757424, -0.4176953733, -0.0969292074, 0.3561072946, -0.0781291127, -0.0542627722, 0.1125814766, 0.198589921, 0.1470998526, 0.0097375214, 0.2579272091, -0.1269591451, -0.0956372172, 0.3598085642, 0.2257262617, -0.0573018603, -0.3894451857, 0.4335388541, -0.1299568713, -0.376660943, 0.3981062174, -0.1200796813, 0.2812708914, 0.4696207345, 0.2516356409, 0.0401979908, -0.0422496498, 0.2157252133, 0.3636835814, -0.0476305895, 0.5195012093, 0.3840843737, 0.0357615985, -0.1599830091, 0.1930096298, -0.1579409689, 0.0557069369, 0.4740777612, -0.0046685967, 0.010170429, 0.4886055887, -0.0979202688, 1.0059649944, -0.3302903771, 0.4059491158, 0.2713975012, 0.0539783388, 0.5820284486, -0.1612090766, 0.2256223112, -0.4188753366, -0.3026840687, 0.2059724331, -0.1448081583, -0.1869808137, 0.2278213352, -0.1691360027, 0.1528989077, 0.0752880275, 0.1367155015, -0.0368944705, 0.2807766795, 0.038346041, -0.197774902, -0.6501988769, 0.0040083025, -0.030605752, 0.2507353127, -0.0437816754, -0.2037799358, -0.2344391197, -0.1280353218, -0.1990258843, 0.236814633, -0.1423744112, 0.0358920544, 0.3933477402, -0.0302771386, 0.2490169257, 0.7023192048, 0.151383549, 0.0587398037, -0.0325751193, 0.1326151937, -0.1110472828, 0.0730694011, 0.3623226583, 0.0922648832, 0.2442236543, -0.1902025044, -0.1516872048, 0.0013159678, 0.1061451584, -0.2138438672, -0.1322257966, 0.0358186811, 0.0391894095, -0.1144881323, -0.0518019237, 0.1280816644, -0.4593140483, 0.0096016731, -0.0241174307, -0.0343453176, -0.052256573, 0.1823455095, 0.1109323278, -0.1212473065, 0.08079914, 0.6947205663, -0.3671647906, -0.1893381923, 0.7166756988, 0.2581759989, -0.0477394387, -0.0592701435, 0.179499954, -0.243833378, -0.602519393, 0.0786591172, -0.1984284669, -0.2134572417, 0.1613490433, 0.3437257111, -0.1560999155, -0.1773864776, -0.0807452276, -0.2184282988, -0.3117405474, 0.2542217672, -0.0011974198, -0.0305784587, -0.0276498795, 0.3899830878, 0.2204926908, -0.0599079803, -0.1270698607, -0.0305318944, -0.4184254408, 0.2184301168, 0.2104667425, -0.5042176247, 0.4190066457, -0.1174020767, -0.0263553895, 0.2935333252, -0.2947072089, -0.0972056016, 0.0434846319, 0.1996436864, -0.0416941121, -0.0970214009, -0.2538351715, 0.0925871059, -0.0653592646, -0.2937571108, 0.2045025229, -0.2466243505, 0.0194891337, 0.0361425579, -0.0797323436, 0.3411547244, 0.0247638188, 0.0372036211, -0.0388085954, -0.0269215871, 0.3201968074, 0.1649172157, -0.0070518884, 0.0222638082, -0.2711973786, 0.0372971445, 0.0745583922, 0.0469812788, 0.2867675126, -0.328499645, -0.1481306404, -0.1287608892, -0.0638730824, 0.5036647916, -0.0933880061, -0.2509552538, 0.2977611423, 0.0191160217, -0.0197153948, 0.1968261451, 0.5825093985, 0.1026283503, 0.0625447035, -0.0672756657, -0.0154114589, -0.0110472124, 0.0916272476, 0.2495031506, 0.2788558006, -0.617531538, 0.0525373891, 0.2572180927, -0.0248936322, 0.0649419874, 0.0557320975, -0.0471887961, 0.1620466262, 0.1522077769, 0.1121231243, -0.1864192188, -0.5657684803, 0.5901628137, 0.3083996773, -0.2395472974, -0.2778963149, 0.4732441008, 0.3027634025, 0.5327270627, 0.2283581793, 0.4041004777, -0.028582992, -0.3256966472, -0.2354798913, 0.4408734441, -0.0501161478, -0.1448833048, -0.0015080986, -0.0594527051, -0.0572993383, 0.2851232588, -0.2409453243, 0.0650760755, 0.3318476975, 0.4306079745, 0.0960695297, -0.3528821468, -0.2499441653, -0.0605904609, 0.4490510523, 0.0333406739, 0.410271883, -0.0495206416, -0.0978209451, -0.3445426822, 0.3547850251, 0.1537969708, 0.2586192787, -0.448489964, 0.4428226352, 0.0477020703, 0.0321000405, 0.0469626375, 0.2841464579, 0.2792508006, 0.0861322582, 0.042620793, -0.081256032, -0.0264659859, -0.2729157209, 0.0337475128, 0.2761286199, 0.0765257403, -0.0008552677, 0.1916520149, -0.2293900847, -0.0552540384, -0.1104442105, -0.5082322955, 0.2749864757, -0.1005488262, 0.066535905, 0.0339577235, -0.093246825, 0.0029776371, 0.1635857821, 0.4926816821, 0.2839580178, 0.1227544323, 0.010010046, 0.0288745817, -0.6039534211, 0.1588703096, 0.1284501851, 0.1115103438, 0.2243484557, 0.2920472622, 0.2114550173, 0.3512559831, 0.0846397355, -0.2181586772, -0.2167148739, 0.3210613728, -0.5578283072, -0.0757727697, 0.0069502089, 0.0788912401, -0.0357014723, -0.1501210034, -0.0647812858, -0.0872543156, -0.1353289336, -0.2084429115, -0.03886161, -0.2230316401, 0.1890408993, 0.0953549594, 0.331929177, 0.0939930901, -0.0453674756, -0.3141000867, -0.0758103281, -0.1758024693, -0.09343642, 0.1746332347, 0.0095014516, 0.1047800854, -0.233582437, 0.2436618507, -0.3363449574, 0.0289931949, -0.0339801311, 0.2507982552, -0.0553376973, -0.2667056918, 0.4273792803, 0.265797466, -0.0795617029, 0.6648865938, -0.0860895663, -0.0889238492, -0.5790920258, 0.1271742731, 0.3910952508, -0.4176438749, -0.0960394219, 0.122700654, 0.1189786717, 0.3112987876, -0.1813848764, -0.5510275364, -0.1144212112, 0.0826354772, -0.2009818256, -0.5723954439, 0.1652615964, 0.2652089, 0.095554024, -0.2220438123, 0.0918628424, 0.0356682092, -0.0469324924, 0.0217828099, -0.2249054015 ]
https://github.com/huggingface/datasets/issues/482
Bugs : dataset.map() is frozen on ELI5
@lhoestq mapping the function `make_input_target` was passed by your fixing. However, there is another error in the final step of `valid_dataset.map(convert_to_features, batched=True)` `ArrowInvalid: Could not convert Thepiratebay.vg with type str: converting to null type` (The [same colab notebook above with new error message](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing#scrollTo=5sRrJ3_C8rLt)) Do you have some ideas? (I am really sorry I could not debug it by myself since I never used `pyarrow` before) Note that `train_dataset.map(convert_to_features, batched=True)` can be run successfully even though train_dataset is 27x bigger than `valid_dataset` so I believe the problem lies in some field of `valid_dataset` again .
Hi Huggingface Team! Thank you guys once again for this amazing repo. I have tried to prepare ELI5 to train with T5, based on [this wonderful notebook of Suraj Patil](https://github.com/patil-suraj/exploring-T5/blob/master/T5_on_TPU.ipynb) However, when I run `dataset.map()` on ELI5 to prepare `input_text, target_text`, `dataset.map` is **frozen** in the first hundreds examples. On the contrary, this works totally fine on SQUAD (80,000 examples). Both `nlp` version 0.3.0 and 0.4.0 cause frozen process . Also try various `pyarrow` versions from 0.16.0 / 0.17.0 / 1.0.0 also have the same frozen process. Reproducible code can be found on [this colab notebook ](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing), where I also show that the same mapping function works fine on SQUAD, so the problem is likely due to ELI5 somehow. ---------------------------------------- **More Info :** instead of `map`, if I run `for` loop and apply function by myself, there's no error and can finish within 10 seconds. However, `nlp dataset` is immutable (I couldn't manually assign a new key-value to `dataset `object) I also notice that SQUAD texts are quite clean while ELI5 texts contain many special characters, not sure if this is the cause ?
94
Bugs : dataset.map() is frozen on ELI5 Hi Huggingface Team! Thank you guys once again for this amazing repo. I have tried to prepare ELI5 to train with T5, based on [this wonderful notebook of Suraj Patil](https://github.com/patil-suraj/exploring-T5/blob/master/T5_on_TPU.ipynb) However, when I run `dataset.map()` on ELI5 to prepare `input_text, target_text`, `dataset.map` is **frozen** in the first hundreds examples. On the contrary, this works totally fine on SQUAD (80,000 examples). Both `nlp` version 0.3.0 and 0.4.0 cause frozen process . Also try various `pyarrow` versions from 0.16.0 / 0.17.0 / 1.0.0 also have the same frozen process. Reproducible code can be found on [this colab notebook ](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing), where I also show that the same mapping function works fine on SQUAD, so the problem is likely due to ELI5 somehow. ---------------------------------------- **More Info :** instead of `map`, if I run `for` loop and apply function by myself, there's no error and can finish within 10 seconds. However, `nlp dataset` is immutable (I couldn't manually assign a new key-value to `dataset `object) I also notice that SQUAD texts are quite clean while ELI5 texts contain many special characters, not sure if this is the cause ? @lhoestq mapping the function `make_input_target` was passed by your fixing. However, there is another error in the final step of `valid_dataset.map(convert_to_features, batched=True)` `ArrowInvalid: Could not convert Thepiratebay.vg with type str: converting to null type` (The [same colab notebook above with new error message](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing#scrollTo=5sRrJ3_C8rLt)) Do you have some ideas? (I am really sorry I could not debug it by myself since I never used `pyarrow` before) Note that `train_dataset.map(convert_to_features, batched=True)` can be run successfully even though train_dataset is 27x bigger than `valid_dataset` so I believe the problem lies in some field of `valid_dataset` again .
[ 0.0539374612, -0.1870066673, -0.0742783844, 0.0692923516, 0.1881323457, -0.0918404981, 0.4278535843, 0.2430596054, -0.3870013654, 0.1208234802, -0.2542552054, 0.4724352062, 0.1759659052, 0.2033964843, -0.1053900719, 0.1071928367, -0.1148367003, 0.0579194836, -0.0958419293, -0.0491203032, 0.1031024978, 0.3184984326, -0.2580776215, 0.1650636196, -0.3105029166, 0.1500940174, -0.0909854248, -0.0632392317, -0.2213093191, -0.3299461901, 0.0668835416, -0.0400811881, -0.0191352107, 0.13876912, -0.0001242538, 0.0448899232, 0.0489345789, -0.0396051779, -0.117218405, 0.051508002, 0.2815467417, -0.0927223489, 0.3024717867, -0.1993809938, 0.1215283647, 0.1908760518, 0.3395659328, 0.1250126213, 0.6102428436, 0.0073208893, 0.0559757464, 0.269626528, -0.033320345, 0.4009646475, 0.2310599983, -0.1057361737, -0.4094344378, -0.0279102158, 0.3057387769, -0.0737646073, 0.0937423408, -0.0345544778, -0.0047440948, -0.0890351534, 0.2041343004, 0.4473017752, 0.0543923043, -0.7332026362, 0.0954588875, 0.1459835321, 0.4292943478, -0.163677901, -0.0888442695, -0.1996160597, 0.0285850875, -0.4379119575, 0.4338603616, -0.0437151007, -0.1576815099, 0.0147965932, -0.0896566361, -0.0634035245, -0.0821781009, 0.1596630514, 0.0451032408, 0.0821532533, -0.0101993969, 0.0811631158, -0.0007757656, -0.0306910668, -0.2821883261, -0.1224426627, -0.0369158536, 0.3129154444, -0.6525635719, -0.2602997422, -0.2111931592, -0.0127826277, 0.0090757329, 0.0486086197, 0.1738578975, 0.145413816, 0.0982823372, 0.0378657766, 0.3953725696, -0.0234732162, 0.2744029164, 0.1286574155, 0.2145038247, -0.1013746709, -0.3396116197, 0.1972132474, -0.0063052084, -0.2773446441, -0.004183183, -0.1296570301, 0.2134011239, -0.3412666321, 0.2097337842, 0.0644891337, -0.6048838496, 0.0543595366, -0.0302815139, 0.2907119393, -0.0818567425, -0.0012983313, 0.000366218, 0.1126071289, -0.4264138937, -0.1001873761, 0.0938719362, -0.3189899027, -0.1659361422, 0.025395561, 0.2953770161, -0.3251471817, 0.1266681999, -0.1675279438, 0.2411946058, 0.0676403418, 0.2005024552, -0.0495286584, 0.1837719083, 0.0253386348, 0.0428988151, 0.1298455149, -0.2254212201, -0.1423175335, -0.0521086119, 0.3205448389, 0.102171354, 0.0004595377, 0.0579672344, -0.0064165671, -0.1158363745, -0.1142977849, -0.0920278728, 0.277623266, 0.3569952548, -0.3189863861, 0.0056367251, -0.3019962907, -0.0978621766, 0.0077759135, 0.4229871929, 0.2221722901, -0.0393861122, -0.1806020439, 0.0099338582, -0.0670612007, -0.1639227569, 0.3881366849, 0.0671417639, -0.0684326589, 0.0487902127, 0.2698662877, 0.5018538833, -0.2360269576, -0.5605531335, 0.0842081755, -0.3151649237, -0.2124066353, -0.370089978, 0.0882239863, 0.2761767507, -0.1064586788, 0.0501356423, 0.3990453184, -0.1892985702, 0.1165636629, -0.4404368699, -0.2546898425, 0.0071922489, 0.0387987792, -0.033572372, -0.2508605719, -0.1457508951, 0.3366513848, -0.1375257224, 0.0508824438, 0.2727855444, 0.2217578888, 0.1935018748, -0.070233956, -0.012520643, -0.0654195473, -0.5470223427, 0.034695629, -0.0950000137, 0.4290869832, -0.0072943773, 0.091343157, 0.1463080198, -0.0574685596, -0.2194215804, -0.1102262586, 0.0015854092, -0.2296860665, -0.0181350783, 0.1705191135, -0.0965171829, -0.1747610718, 0.0136871878, 0.2303231955, -0.4198414087, 0.2105487734, -0.2102125436, -0.4316300452, -0.2027973384, -0.1207084358, -0.2658184767, -0.1366967112, -0.2471276671, 0.0317467451, -0.293716073, -0.0242925454, -0.0219215583, 0.4465959072, 0.3535355031, -0.4185459912, 0.0960636586, -0.2039043009, 0.0543001294, -0.0944244415, -0.1779816896, 0.1937717944, -0.265529722, 0.2218671143, 0.0622496121, 0.0845488831, -0.0982312635, 0.0846855715, -0.2007939667, 0.0403163135, 0.0268416796, 0.2826346457, 0.2617362142, -0.0307283755, -0.164080292, 0.3843753934, 0.7712836862, 0.2200626433, 0.0041622669, 0.1855040044, 0.0684935153, -0.1383882612, -0.2919834852, -0.2560809851, 0.1829892397, -0.07922858, 0.0277562439, 0.0691762865, -0.1116230041, 0.0367191434, 0.2313180417, 0.2731526196, -0.0039717159, 0.0878644139, 0.3924005628, 0.1269480139, -0.0596856438, -0.0752701759, 0.1465490907, 0.1641421914, -0.2193273455, 0.0125428364, -0.1379267126, -0.0650573373, 0.0902585611, 0.0596546829, -0.3185705245, -0.3496061265, 0.2223764956, 0.1179310903, -0.0026538132, 0.3269678354, 0.1722246855, -0.0225337334, 0.0529188327, -0.1150834486, -0.0832120925, -0.3923433423, -0.4076899886, -0.0095230723, 0.4277977943, 0.1665219963, -0.0966349393, -0.0519468151, -0.2906080484, -0.1139913723, -0.6097025275, 0.3551806509, -0.373860389, 0.4278283715, -0.1368177682, 0.2860459983, -0.4543644786, -0.0607181378, 0.3598075509, -0.3194218576, -0.2685779631, 0.0863336548, -0.0198579058, -0.0580555461, -0.1565554291, -0.604472816, -0.1301188618, -0.171637401, 0.3883107901, 0.0377667472, 0.0577210784, 0.1623961926, 0.1000991017, 0.4368858933, 0.0836396813, -0.1327850819, 0.0724739879, -0.0684207976, 0.3780963421, -0.2309397906, -0.3176392913, -0.0995135382, 0.2158454061, -0.1500913203, -0.1090742052, -0.3428518474, -0.3040426373, -0.3614270985, 0.3931965828, -0.0801544189, -0.0459435433, 0.33954072, 0.2874935269, 0.057597369, 0.1020126566, -0.4317055643, 0.4576953351, 0.7315327525, 0.0766992718, -0.0183512252, 0.5675568581, 0.0997233763, 0.8816776276, 0.1115860045, -0.1668652445, 0.2578696907, 0.0367082171, 0.0419229232, -0.4832921028, 0.0303246789, 0.2113537788, -0.0642779693, 0.0273591802, 0.1935279816, -0.0152924182, -0.194504723, -0.1208989322, 0.1814961582, -0.2288672626, -0.3178034425, 0.1604897529, -0.2234326899, -0.1628767848, 0.1666609496, -0.0731885359, -0.1899706572, -0.3545714617, -0.1877990961, -0.0863399953, 0.3585194051, -0.029126348, -0.6207339764, -0.1096362472, -0.4323068559, 0.3310407996, 0.1397511959, 0.2593171597, -0.3684084713, -0.0728357732, 0.2251540422, -0.2911626399, 0.2268963754, -0.2127641886, -0.0970881283, 0.1606957167, 0.0468075126, -0.2511031628, -0.075072892, -0.1435163021, 0.1912959814, 0.4949716032, -0.1217663661, -0.3668161035, -0.2991459072, 0.3354329467, 0.1143843234, -0.0547580793, 0.2381701469, -0.262511909, -0.0675505325, -0.4722183645, -0.0732917786, 0.4041704237, -0.116811946, -0.0586254373, 0.0688987449, 0.1878004968, 0.1327373385, 0.0061503444, 0.3224440217, -0.0995455012, -0.0768676177, 0.4044605196, 0.2092094421, -0.0673904717, -0.3526376486, 0.3883756697, -0.061033491, -0.4078304172, 0.499402076, -0.1445930004, 0.3027718663, 0.4482414424, 0.1930814087, -0.1404142529, -0.0068504284, 0.1819934398, 0.3776974976, 0.0128546907, 0.5262820721, 0.2901240587, -0.0197926033, -0.1219249591, 0.1650857925, -0.1874385327, 0.0183327124, 0.4783315957, -0.0286267977, 0.0383421294, 0.5677280426, 0.0381435789, 0.975856185, -0.2699211836, 0.274384588, 0.1987366825, 0.0093002301, 0.4218443036, -0.1443622857, 0.2698316872, -0.5266176462, -0.2899626791, 0.2433765084, -0.2169336975, -0.2555159032, 0.1828205287, -0.2217987776, 0.0740425661, 0.0077105239, 0.1622265726, -0.0115709044, 0.2984125912, 0.1152763367, -0.2819031477, -0.4721387327, 0.0487286299, -0.1049389392, 0.2490478903, -0.0030686436, -0.1782488227, -0.3353843093, -0.0918076038, -0.2292084396, 0.2933660448, -0.1197619364, 0.1047528982, 0.2387638688, -0.0602761358, 0.1600345969, 0.6947135329, 0.1500715613, -0.0886846334, 0.0165480934, 0.1643886417, -0.0444905981, 0.0688970014, 0.4028809071, 0.0373275951, 0.2904091775, -0.2089942545, -0.2103513032, 0.0769349933, 0.151714921, -0.1790324748, -0.156560868, -0.1059655026, 0.0931831524, -0.0638354719, 0.0012963527, 0.0256596077, -0.5122879148, 0.0354585461, 0.015443109, -0.1162631512, 0.0667454824, 0.2826853693, 0.1746969819, -0.1020617336, 0.1229654923, 0.635588944, -0.350325644, -0.1124670208, 0.7513546348, 0.227139011, -0.0329825468, -0.1053859293, 0.2558534741, -0.301170975, -0.576854527, 0.0415048301, -0.3038912714, -0.2306890786, 0.1752124429, 0.3404958248, -0.1392196268, -0.2399089038, -0.0772820562, -0.2000790834, -0.3080740571, 0.2129830122, -0.089999035, 0.0486357957, -0.1046151146, 0.3674405217, 0.1863697469, -0.041243609, -0.1533664912, 0.0126691591, -0.3003514409, 0.2798072696, 0.175885722, -0.456735611, 0.2779484689, -0.0599136315, -0.0336160548, 0.3118649423, -0.2465888262, -0.1095212772, 0.0179147236, 0.1941848844, -0.0406495221, -0.0990185887, -0.3305048048, 0.0980901644, -0.1401505917, -0.2644595504, 0.2234962881, -0.2495935112, -0.0252181236, 0.1089906171, -0.1077735499, 0.2229653895, 0.0980563089, 0.0241525061, 0.0800203681, 0.0913209543, 0.3303564191, 0.2263109833, 0.0073870579, -0.0227948539, -0.3700706661, 0.0525561832, 0.0209174659, 0.0719653592, 0.2483476549, -0.3310931027, -0.0387909003, -0.1785293669, -0.17309843, 0.5225909352, -0.1272381991, -0.2101667672, 0.2399606854, 0.0557607263, 0.0225932654, 0.1883439869, 0.543441534, -0.0400636792, -0.0050352635, -0.0892437622, 0.0082851434, 0.0305792857, 0.1435266882, 0.2447314262, 0.3117626011, -0.613740027, 0.0980035812, 0.2173492014, -0.0661799535, 0.1176310033, 0.0674414635, -0.073272042, 0.1785865426, 0.1344177276, -0.0379488505, -0.2305819839, -0.4712125361, 0.5559193492, 0.420678407, -0.1522449255, -0.3123296201, 0.4449596405, 0.285559386, 0.478965342, 0.3186173737, 0.3901509047, -0.0537830107, -0.3576961458, -0.3769513965, 0.3257187307, -0.09975674, -0.0764377043, -0.0174456909, -0.1103935614, -0.1150762886, 0.2794768512, -0.3362811804, 0.1715203226, 0.3045939505, 0.5075870752, 0.0787334666, -0.2455798388, -0.2372637242, -0.0703526065, 0.420848608, 0.0386337712, 0.4022469223, -0.1057448834, -0.1016262397, -0.3066694736, 0.3072878718, 0.1976904869, 0.2935116887, -0.6400920749, 0.3875579834, 0.1321144551, -0.0059111472, 0.2638387382, 0.2280208468, 0.2538407147, -0.059562061, 0.1545855999, -0.0592813976, -0.024889797, -0.3027148545, -0.0009211215, 0.278311342, 0.0832827613, -0.0609322786, 0.2151129097, -0.2164376825, 0.0376055799, -0.1263163835, -0.3947073817, 0.1769411564, -0.1372810602, -0.0508240312, -0.0380621441, -0.0798350424, 0.0224107169, 0.1355582029, 0.5751468539, 0.1674956977, 0.1027366966, -0.0704301447, 0.1621201932, -0.609641552, 0.2065858543, 0.2451086491, 0.102808848, 0.2863226235, 0.3193440735, 0.2587867081, 0.4257706404, 0.2457887083, -0.2119679302, -0.1558286548, 0.4385858476, -0.5146778822, -0.0335093662, 0.0834737346, 0.1615604013, -0.0992896855, -0.2035088539, -0.0254347045, -0.1245814934, -0.0927734897, -0.2628906667, -0.2807006836, -0.0632412881, 0.1414944828, 0.2277924418, 0.2979301214, 0.122462213, -0.0314633921, -0.2810342312, -0.1568279415, -0.2138567567, -0.0536392629, 0.0513224527, -0.0312873386, 0.1245362833, -0.0799801126, 0.3601017892, -0.4278180003, -0.0401998088, -0.0839042589, 0.2810069323, -0.0773704648, -0.2369511575, 0.3989084363, 0.2445235848, -0.0396411791, 0.5937417746, -0.052108191, -0.0306177214, -0.6759064198, 0.0881919786, 0.3299511075, -0.3246210217, -0.1571730524, 0.1668065488, 0.0793764517, 0.338303417, 0.0851816088, -0.456779778, -0.0500470325, 0.0678005517, -0.2592577934, -0.5594133735, 0.1471493691, 0.4032057822, 0.1689866334, -0.2204863429, 0.1316609234, -0.0463546887, 0.0522676185, -0.2600907087, -0.2189252824 ]
https://github.com/huggingface/datasets/issues/482
Bugs : dataset.map() is frozen on ELI5
I got this issue too and fixed it by specifying `writer_batch_size=3_000` in `.map`. This is because Arrow didn't expect `Thepiratebay.vg` in `title_urls `, as all previous examples have empty lists in `title_urls `
Hi Huggingface Team! Thank you guys once again for this amazing repo. I have tried to prepare ELI5 to train with T5, based on [this wonderful notebook of Suraj Patil](https://github.com/patil-suraj/exploring-T5/blob/master/T5_on_TPU.ipynb) However, when I run `dataset.map()` on ELI5 to prepare `input_text, target_text`, `dataset.map` is **frozen** in the first hundreds examples. On the contrary, this works totally fine on SQUAD (80,000 examples). Both `nlp` version 0.3.0 and 0.4.0 cause frozen process . Also try various `pyarrow` versions from 0.16.0 / 0.17.0 / 1.0.0 also have the same frozen process. Reproducible code can be found on [this colab notebook ](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing), where I also show that the same mapping function works fine on SQUAD, so the problem is likely due to ELI5 somehow. ---------------------------------------- **More Info :** instead of `map`, if I run `for` loop and apply function by myself, there's no error and can finish within 10 seconds. However, `nlp dataset` is immutable (I couldn't manually assign a new key-value to `dataset `object) I also notice that SQUAD texts are quite clean while ELI5 texts contain many special characters, not sure if this is the cause ?
33
Bugs : dataset.map() is frozen on ELI5 Hi Huggingface Team! Thank you guys once again for this amazing repo. I have tried to prepare ELI5 to train with T5, based on [this wonderful notebook of Suraj Patil](https://github.com/patil-suraj/exploring-T5/blob/master/T5_on_TPU.ipynb) However, when I run `dataset.map()` on ELI5 to prepare `input_text, target_text`, `dataset.map` is **frozen** in the first hundreds examples. On the contrary, this works totally fine on SQUAD (80,000 examples). Both `nlp` version 0.3.0 and 0.4.0 cause frozen process . Also try various `pyarrow` versions from 0.16.0 / 0.17.0 / 1.0.0 also have the same frozen process. Reproducible code can be found on [this colab notebook ](https://colab.research.google.com/drive/14wttOTv3ky74B_c0kv5WrbgQjCF2fYQk?usp=sharing), where I also show that the same mapping function works fine on SQUAD, so the problem is likely due to ELI5 somehow. ---------------------------------------- **More Info :** instead of `map`, if I run `for` loop and apply function by myself, there's no error and can finish within 10 seconds. However, `nlp dataset` is immutable (I couldn't manually assign a new key-value to `dataset `object) I also notice that SQUAD texts are quite clean while ELI5 texts contain many special characters, not sure if this is the cause ? I got this issue too and fixed it by specifying `writer_batch_size=3_000` in `.map`. This is because Arrow didn't expect `Thepiratebay.vg` in `title_urls `, as all previous examples have empty lists in `title_urls `
[ 0.0882879794, -0.0822168589, -0.0899113342, 0.1087929308, 0.1185982302, -0.0889241397, 0.4757876694, 0.2081896812, -0.2753666937, 0.1408066899, -0.2147414684, 0.471583128, 0.1646788418, 0.0616818555, -0.1162423491, 0.153786391, -0.1585140228, 0.0361107588, -0.0435177572, -0.0942481905, 0.0881528929, 0.306497395, -0.3244804144, 0.1371067017, -0.2413131893, 0.2019753158, -0.0675990209, -0.049233593, -0.1338673979, -0.3987388909, 0.0902894139, 0.0110532492, -0.0539943129, 0.1521508396, -0.0001268104, 0.0641146228, 0.1259066015, -0.0447381996, -0.0788738877, 0.0518750548, 0.2480291128, -0.0301097371, 0.3839223385, -0.2232055664, 0.1997665614, 0.2042777538, 0.3820061386, 0.0985119119, 0.5644936562, -0.0939928219, 0.0145406388, 0.268162787, -0.0877725706, 0.4349065721, 0.290671289, -0.1680426747, -0.351919055, -0.0400070027, 0.3742508888, -0.092334047, 0.0832195133, -0.0479503572, -0.0200903434, -0.0459485576, 0.1264985651, 0.4776399136, 0.0331441462, -0.7292942405, 0.1101481467, 0.2397383004, 0.4590665102, -0.1601785421, -0.0912278071, -0.1838961989, 0.0088332258, -0.357907325, 0.4505924881, -0.0299413409, -0.0901350901, 0.0185385663, -0.0743218809, -0.0404010043, -0.0883395895, 0.2276091427, 0.1097405031, 0.117981866, 0.0200541206, 0.1539660245, -0.0590441488, 0.0156817921, -0.1864433885, -0.205779478, -0.1096618995, 0.3239534199, -0.6241597533, -0.2234710604, -0.1515565217, -0.0737282634, 0.0315624513, 0.0660681501, 0.2326868623, 0.2130042911, 0.1060308442, 0.0576224588, 0.4097146094, -0.0594156161, 0.3594403267, 0.1525258273, 0.2901146412, -0.0899541155, -0.3181608319, 0.19088085, -0.0522587337, -0.2366311252, 0.0019141097, -0.1777713001, 0.1045408025, -0.2911323011, 0.2693873942, 0.0756651685, -0.6122700572, -0.0127220852, -0.0352847092, 0.3106817305, -0.1387453824, -0.0190656018, -0.0420422368, 0.0441929251, -0.3719223142, -0.059858039, 0.0867926478, -0.4458228946, -0.1268519312, 0.0292035732, 0.28453511, -0.277323693, 0.2217055857, -0.2348584086, 0.2051867843, 0.0649388954, 0.2884625793, -0.0199455172, 0.1899874806, 0.0648312196, 0.1371376216, 0.2041115463, -0.2799102068, -0.1149777249, -0.0912583843, 0.3285957277, 0.0530042723, -0.0008446116, 0.0881714374, -0.0615694709, -0.1474289745, -0.0972121432, -0.0326790661, 0.158148706, 0.3567200899, -0.2990532219, 0.0931834131, -0.1606670171, -0.0742570981, -0.0157864243, 0.3695380688, 0.2457430065, -0.0112888217, -0.1803423315, -0.0644403771, -0.0077457577, -0.2145558447, 0.3933410645, 0.0173162576, -0.0514568649, 0.0583469309, 0.2661233544, 0.4861608148, -0.2209084183, -0.5594334602, 0.1241094247, -0.2801665366, -0.2539253831, -0.3275472224, 0.0745497122, 0.2965097427, -0.1045868769, 0.0722664818, 0.3634411693, -0.0934675783, 0.0332763791, -0.4079682231, -0.3176829219, -0.0736906007, 0.0167573337, -0.1066102237, -0.3347573578, -0.1468247175, 0.2155675292, -0.0763268918, 0.0471525565, 0.2931106687, 0.3203016818, 0.1911581159, -0.0128343441, 0.0090578506, -0.0042150938, -0.5717050433, 0.090139173, -0.0780274943, 0.3007614613, -0.0624997243, 0.0468622707, 0.2347543538, -0.0451567881, -0.2232612967, -0.1361988783, -0.0694332719, -0.2399133593, -0.01091995, 0.2301582098, -0.0736904517, -0.3139736056, -0.0080875652, 0.1840163767, -0.3748848438, 0.1614418328, -0.1260192096, -0.3616602123, -0.2581926286, -0.0989926383, -0.3698387742, -0.165694505, -0.1613463014, 0.063262932, -0.3258744776, -0.0153217232, 0.0269872341, 0.4164499044, 0.2937583923, -0.4194703996, 0.1238846406, -0.1380819529, 0.0972237363, -0.0955068842, -0.1869755089, 0.1891406029, -0.2533552945, 0.2792418599, 0.0949695185, 0.0388383269, -0.0884371847, 0.0600589067, -0.1594148427, -0.0119245378, 0.0588181429, 0.303499639, 0.38377738, 0.0009232371, -0.0879838616, 0.353854686, 0.8066473603, 0.2237538248, 0.0310287476, 0.1539031714, -0.0020596413, -0.1163451597, -0.3227664828, -0.2487760335, 0.1705661565, -0.0870793313, 0.0229924228, -0.0028442156, -0.0616030693, -0.0714262128, 0.252310127, 0.3050377667, 0.0414585881, 0.0712848231, 0.3709096909, 0.1204284132, -0.0578710064, -0.1169273481, 0.1672041714, 0.1258958727, -0.1920572072, 0.0119046615, -0.0655371025, 0.0032773053, 0.1812364906, 0.0310359653, -0.3219737113, -0.2996350825, 0.2012773156, 0.0419377796, -0.0665792972, 0.2993479073, 0.1596488357, -0.0770489722, 0.0552628003, -0.1453842372, -0.0574792363, -0.4903119504, -0.3879299164, -0.0461065657, 0.4349367917, 0.06950818, -0.1548337042, -0.0031808193, -0.3482359946, -0.0557770953, -0.6003724933, 0.3452952802, -0.3194229603, 0.3828047514, -0.1645489633, 0.2790257037, -0.4631019533, -0.036703404, 0.310987711, -0.3287282586, -0.2486946583, 0.0650764331, 0.0176020898, -0.0721573457, -0.1847456694, -0.5815079212, -0.0476910286, -0.153978914, 0.4527024925, -0.004160441, 0.0596411005, 0.1243082285, 0.0747019276, 0.4305663407, 0.0298447069, -0.1916428655, 0.1210585833, -0.1054960489, 0.4008396268, -0.2193353176, -0.3028167784, -0.0781510696, 0.1628533602, -0.1272924691, -0.098495245, -0.3735529184, -0.198585242, -0.3790391088, 0.3669740558, -0.0718741566, -0.016755037, 0.3793859482, 0.3064505458, 0.0722278208, 0.0580985658, -0.3891446888, 0.5050681829, 0.6757680774, 0.0092981821, -0.0089655938, 0.5026324391, 0.0709110722, 0.9094952941, 0.1167575344, -0.0880287439, 0.2245066017, 0.0675018057, 0.0284250583, -0.3903770149, 0.1601772308, 0.1316403896, -0.0401242971, 0.0388071053, 0.2364290208, 0.0380493067, -0.2484052181, -0.1227402985, 0.195114553, -0.2875276208, -0.3168263733, 0.1847687215, -0.2551833987, -0.1688252091, 0.174037382, -0.076598227, -0.1780085117, -0.3751819432, -0.1998486668, -0.1906102747, 0.3779652119, -0.1055293828, -0.6005116105, -0.0463043712, -0.4620147645, 0.3174312711, 0.1200264692, 0.2238005698, -0.295545131, -0.0564068034, 0.2446456403, -0.3228538036, 0.2590307891, -0.2851575613, -0.0492566526, 0.1612731367, 0.0685208142, -0.3726621568, -0.0046679941, -0.1773081422, 0.1747202724, 0.4599047601, -0.2281536311, -0.3975751996, -0.3105404973, 0.2359523922, 0.0375092998, -0.0658998489, 0.173364833, -0.2594775259, -0.0183645636, -0.4175831378, -0.1261867881, 0.3429455161, -0.165098086, -0.0610803887, 0.0112271141, 0.1740146428, 0.13274391, -0.0599051751, 0.2988526523, -0.1146557704, -0.1276051849, 0.4424629807, 0.3040944338, -0.0618841313, -0.3205316365, 0.3552512825, -0.0954779312, -0.3660572469, 0.4882133305, -0.2189041674, 0.315954864, 0.4747323692, 0.2133299857, -0.0357877761, -0.0234066788, 0.1447726935, 0.4186309874, -0.0603996813, 0.5418789387, 0.2795416415, -0.0161214173, -0.1286269873, 0.1725664735, -0.1708380878, -0.0355187245, 0.6318178773, -0.1137911752, 0.0038763194, 0.5671445727, 0.0636703074, 0.937364459, -0.2821108997, 0.3562497497, 0.1291277409, -0.0394514613, 0.4074741006, -0.1294273436, 0.2650203407, -0.4918097556, -0.2174850702, 0.2199115306, -0.214968428, -0.2647091746, 0.274720192, -0.1567382514, 0.050697796, -0.0032421187, 0.1992226392, -0.0261161625, 0.2922623158, 0.1135439724, -0.2582211494, -0.3926381171, -0.0101968246, -0.0051291748, 0.1710564643, -0.0618745796, -0.1705609709, -0.3496140838, -0.0965967029, -0.1793382019, 0.2796677947, -0.1814921796, 0.1445916891, 0.2455635518, -0.0341222323, 0.1703041643, 0.717861712, 0.0609150492, -0.0505998358, -0.030788634, 0.2548996806, -0.0124061629, 0.0887363181, 0.3964912295, 0.0344575979, 0.2211811841, -0.180150941, -0.2398805916, 0.0477492251, 0.1024102047, -0.233788684, -0.1609705091, 0.0478168055, 0.1398227662, 0.0227073673, -0.0623247586, 0.0740204975, -0.5765272379, 0.0539224222, -0.0186327528, -0.054705292, 0.0997098312, 0.2908631265, 0.1346253306, -0.1707371324, 0.1136575043, 0.6775929928, -0.3244544268, -0.1086261049, 0.7458805442, 0.1795632541, 0.0014096226, -0.094916679, 0.2476832122, -0.2478712797, -0.6283718944, 0.0337575488, -0.2483890057, -0.2120058835, 0.2343790233, 0.308036834, -0.199998647, -0.1975631416, -0.1469416171, -0.2412349433, -0.242395699, 0.2498524785, -0.0583462268, 0.0068159755, -0.17255418, 0.2741124928, 0.2016077489, -0.0881676823, -0.1053355262, 0.0764524341, -0.2692140639, 0.2743496001, 0.1036965176, -0.3691772223, 0.4151688814, -0.1232331097, -0.0757552907, 0.2767159343, -0.2741015553, -0.0830470398, -0.0163444541, 0.2227385044, -0.0710496008, -0.105435133, -0.3280330002, 0.0408847407, -0.1428188533, -0.2872321308, 0.2128674984, -0.2900472879, -0.0448153354, 0.0042102803, -0.0880880952, 0.2888961732, -0.0618683696, 0.1017445922, -0.0217919312, 0.0768533871, 0.3140349686, 0.1966611892, 0.0544645935, -0.0076147509, -0.2682601213, 0.0105348807, -0.0505146757, 0.0935517251, 0.2986555696, -0.33370772, -0.0411004201, -0.1884243488, -0.1477079391, 0.5953750014, -0.097681269, -0.3353037536, 0.2371453792, 0.0260589328, 0.0823240727, 0.2001848966, 0.5208041668, 0.0638966337, 0.0121353855, -0.1359044611, -0.0063773869, -0.0324635841, 0.1020550579, 0.3046663702, 0.2812547982, -0.6254974008, 0.0814247504, 0.255840838, -0.0214994624, 0.1413774341, 0.0449637249, -0.0664561391, 0.2502109408, 0.1468689889, 0.096978806, -0.2232924253, -0.3549114764, 0.5749952197, 0.3272978663, -0.2109613568, -0.2955943346, 0.3983945251, 0.2951464951, 0.5204437971, 0.3410265744, 0.4236571491, 0.0308461804, -0.293463558, -0.3252939582, 0.2823754251, -0.0197913516, -0.1260680407, -0.0459985733, -0.1114297435, -0.0530714281, 0.2995020747, -0.3030315042, 0.1652936786, 0.3224516511, 0.4959097803, 0.0424022377, -0.3634291887, -0.1948478967, -0.0675647035, 0.4407278001, 0.0173917022, 0.3731262088, -0.1021295562, -0.1070424765, -0.3444985151, 0.2899488807, 0.1152355224, 0.2705463171, -0.5767053962, 0.4279713035, 0.1324664354, 0.0330879651, 0.1897373796, 0.2066239119, 0.3099295199, -0.1102642119, 0.097473219, -0.0849165916, -0.002061266, -0.2866071165, 0.0705496818, 0.3329072595, 0.1678401232, -0.1049033329, 0.2067903578, -0.2799984515, 0.0762468576, -0.0978535265, -0.4134723842, 0.2258624285, -0.1182278916, -0.1113107651, -0.0520901345, -0.1324938685, -0.0013125144, 0.127661854, 0.6129342318, 0.1930648237, 0.1246227026, -0.0267080404, 0.0825604945, -0.5853533149, 0.1925192475, 0.1387234628, 0.2084902972, 0.2797994614, 0.3135424852, 0.2333825678, 0.3741553426, 0.244637996, -0.1770493835, -0.2462219596, 0.4191218913, -0.6102463603, 0.0101737063, 0.0743524134, 0.1879317611, -0.1064254791, -0.2250777632, -0.0230041072, -0.1562495977, -0.1390533894, -0.2743951082, -0.268237412, -0.023182366, 0.1495166868, 0.3450474143, 0.236364916, 0.0682360232, -0.0300125219, -0.272179693, -0.1444949955, -0.2129714787, 0.0134781338, 0.0994293317, 0.0685309693, 0.057565853, -0.1969739348, 0.2913997471, -0.351069659, -0.0179673731, -0.1465967596, 0.3190269768, -0.0336717479, -0.3093470931, 0.4059656262, 0.2705380917, -0.0823315531, 0.5921957493, -0.115692623, -0.0927960798, -0.607229054, 0.1054434627, 0.313218683, -0.3774883449, -0.1397369355, 0.1671627462, 0.1499503702, 0.3385232389, 0.049834989, -0.4270490408, -0.0275150482, 0.1106720492, -0.2297037542, -0.6133560538, 0.0610754341, 0.4153717458, 0.1881697923, -0.2335268706, 0.1861011684, -0.0459268801, -0.030169813, -0.2157279402, -0.2437679023 ]
https://github.com/huggingface/datasets/issues/478
Export TFRecord to GCP bucket
Nevermind, I restarted my python session and it worked fine... --- I had an authentification error, and I authenticated from another terminal. After that, no more error but it was not working. Restarting the sessions makes it work :)
Previously, I was writing TFRecords manually to GCP bucket with : `with tf.io.TFRecordWriter('gs://my_bucket/x.tfrecord')` Since `0.4.0` is out with the `export()` function, I tried it. But it seems TFRecords cannot be directly written to GCP bucket. `dataset.export('local.tfrecord')` works fine, but `dataset.export('gs://my_bucket/x.tfrecord')` does not work. There is no error message, I just can't find the file on my bucket... --- Looking at the code, `nlp` is using `tf.data.experimental.TFRecordWriter`, while I was using `tf.io.TFRecordWriter`. **What's the difference between those 2 ? How can I write TFRecords files directly to GCP bucket ?** @jarednielsen @lhoestq
39
Export TFRecord to GCP bucket Previously, I was writing TFRecords manually to GCP bucket with : `with tf.io.TFRecordWriter('gs://my_bucket/x.tfrecord')` Since `0.4.0` is out with the `export()` function, I tried it. But it seems TFRecords cannot be directly written to GCP bucket. `dataset.export('local.tfrecord')` works fine, but `dataset.export('gs://my_bucket/x.tfrecord')` does not work. There is no error message, I just can't find the file on my bucket... --- Looking at the code, `nlp` is using `tf.data.experimental.TFRecordWriter`, while I was using `tf.io.TFRecordWriter`. **What's the difference between those 2 ? How can I write TFRecords files directly to GCP bucket ?** @jarednielsen @lhoestq Nevermind, I restarted my python session and it worked fine... --- I had an authentification error, and I authenticated from another terminal. After that, no more error but it was not working. Restarting the sessions makes it work :)
[ 0.1043086424, -0.0196553953, 0.0418731309, 0.1138936356, 0.0320828892, -0.1475580037, 0.1983273327, 0.1378268152, -0.4294385016, 0.108621113, -0.2599082291, 0.2367111593, -0.2770298123, 0.1902204007, 0.4431501031, 0.0458827876, -0.1624471992, -0.0884751678, -0.0613614582, -0.2464278787, -0.2078003287, 0.3399338722, -0.1633236408, 0.1298567504, -0.1636380255, -0.3291426599, -0.1392058879, 0.0100799194, 0.2158969641, -0.0817752406, 0.1531292647, -0.1572725773, 0.2936231494, 0.3548461497, -0.0001241776, 0.0557238944, 0.0362492763, -0.2642900944, -0.1004717052, -0.1585781276, -0.3611403406, 0.0675942153, 0.0743404329, -0.2352461815, 0.0370033309, 0.1353319585, 0.5893599987, 0.2575765252, -0.1871165633, 0.4628815651, 0.1116086394, 0.4620778561, 0.1533127576, 0.171333164, -0.1146623045, -0.2406712621, -0.3874956071, 0.0566436723, -0.1590550989, 0.1580325514, 0.1433650851, -0.1098375246, 0.0033529764, -0.2057417035, 0.3163115382, 0.1110547483, -0.1072747558, -0.3120265603, -0.0031495292, 0.1946423352, 0.6180033088, -0.5000044107, -0.5036103725, 0.0647537857, -0.0492014699, -0.203989327, 0.3115360439, 0.4222561717, 0.3510525525, 0.1510545015, -0.2972367108, -0.1687380672, -0.3058374524, 0.1791096032, -0.0949264839, 0.6592952609, -0.0630758479, 0.0978818834, -0.2444777042, 0.0606239513, 0.166268751, -0.048549816, -0.1336775422, 0.3695761263, -0.1432873011, -0.3499164581, 0.2528572381, 0.4646785855, -0.5515577197, 0.3166108429, 0.3559391797, -0.1943404377, -0.0089946184, 0.0084281135, -0.0087085906, 0.0439144261, 0.3559091985, 0.445959717, 0.0651983395, -0.3567679226, 0.0706169307, -0.1742616147, -0.0649128482, -0.2846613526, -0.1426879764, 0.0446224138, 0.037939176, -0.137483418, 0.0949023888, -0.1490453035, -0.0987587497, 0.1095616445, -0.3324379027, 0.0881569833, 0.0784249082, -0.2568154037, 0.277199626, -0.0266953707, -0.6436516643, 0.0527904257, -0.0495503061, 0.1958489418, 0.1571633518, -0.0411072075, -0.0443773381, 0.0338041894, 0.0224752352, -0.229105249, 0.0509850718, 0.2616705298, 0.3601634204, -0.0454378128, -0.1735638082, 0.2035631239, 0.039008677, 0.2462251633, 0.0227714442, -0.1490440071, -0.286627382, 0.1152701303, -0.2529260814, -0.3067851365, -0.0610650629, 0.0415604822, -0.1484235227, -0.3995210528, -0.2166470289, 0.001940563, 0.1232055575, -0.3684221208, 0.2590972185, -0.3070384264, -0.0856944099, -0.3298637569, -0.0941886306, 0.1332680583, -0.4248125851, -0.079120189, -0.0175603088, 0.0383082218, 0.2924701571, 0.2817420363, 0.1365849078, 0.1832990199, 0.0643901303, 0.3293117881, 0.3842250705, -0.5604010224, 0.035869237, 0.3170736134, -0.3729990423, -0.1465912908, -0.2245296836, -0.0009615264, 0.3030168712, -0.2277838886, -0.0363672934, 0.3661174178, 0.0217804071, 0.173636511, -0.2771189809, -0.1050426885, 0.0246055275, -0.277939111, -0.0159464199, -0.131043613, 0.4008928537, 0.1757669896, 0.1823633164, -0.0711173117, 0.2193004638, 0.4072644413, 0.3658872545, 0.0230927169, -0.083625555, 0.0767633021, -0.5317687988, 0.0073545184, -0.228179276, 0.1830496937, 0.3466964662, 0.0587601364, 0.1974605471, -0.2921520174, 0.1712455302, -0.1641822308, -0.0951041579, 0.1215178221, 0.1402534246, 0.3574542701, -0.0441085398, 0.2640910447, -0.1312348694, -0.1229354367, -0.2632276416, 0.3617300987, 0.1286931336, -0.3282949924, 0.0945414156, -0.1186136454, 0.0846153721, -0.2326746732, -0.2019332349, 0.3773417175, -0.2473885715, 0.5208192468, 0.0495076701, 0.6487166882, 0.131340161, -0.2497119606, -0.1034748852, 0.3585963249, -0.053164456, 0.2756615579, -0.1737520099, 0.5877631903, 0.1556876302, -0.1525969207, 0.386910975, 0.0487795547, -0.2978127301, -0.1340874285, -0.0127203772, 0.1818128526, 0.1251282245, -0.1221781075, 0.0884686932, -0.129349485, -0.3697160482, 0.3899161816, 0.6853577495, -0.129241854, 0.0035884699, -0.109748669, 0.0905123353, -0.0675533414, 0.5124894381, 0.0625752956, 0.2000595927, 0.0357433856, 0.1346184462, -0.1173055023, -0.2365720868, -0.1088178679, 0.3869111538, -0.1922737956, -0.2225835174, -0.0102995643, -0.0086943852, 0.2564801574, -0.1329464018, -0.060257107, 0.0856533796, 0.3868994117, -0.4979802072, 0.0702471584, -0.4411143363, -0.1988402754, -0.1071164012, 0.3426580429, -0.3205321729, -0.327309221, 0.0365762301, 0.040110603, -0.1647714823, -0.0049516037, -0.1151254699, 0.0103285238, 0.0407162756, -0.1432959586, -0.1063832492, 0.0423577726, -0.2163065374, -0.0144214155, 0.0300441403, 0.1656529307, 0.2882617712, -0.0380333588, -0.1832352728, -0.0969580114, -0.3768309355, 0.0041226973, -0.1586949825, 0.1078703105, 0.0106574697, 0.0450567603, -0.5808391571, -0.1346588135, -0.181005165, -0.4385964274, -0.2040459365, 0.0246810615, -0.0895998031, -0.0534388795, -0.2532159984, -0.1335132569, -0.2370139956, -0.3757141531, 0.2796501517, 0.2792014182, 0.3979221582, 0.4036664963, -0.4649419188, 0.2192779183, 0.1281312853, -0.2627944648, 0.2719513178, -0.1234671175, 0.4003705978, -0.553955555, -0.3774172664, 0.1360995173, 0.1978217959, -0.009577034, 0.0663507432, -0.2033834457, 0.0864784196, -0.3496913016, -0.0653624758, 0.132546857, 0.2524748147, 0.4491384029, -0.2184732556, 0.1617975235, -0.1543952078, -0.1096279994, 0.0963790491, 0.9362362623, 0.0234152395, -0.0219116267, 0.1153819934, 0.0580702871, 0.3341712058, 0.043501664, 0.0677083954, 0.0357965603, -0.3759588897, 0.1903026402, -0.2492438555, -0.1469092667, 0.6196634769, 0.4616969228, -0.1018356904, 0.3610277176, 0.0375997908, 0.2365514338, 0.17184636, 0.0989679694, -0.0671916083, -0.2950975299, -0.0060201376, 0.2981248498, 0.3115375936, -0.0430108383, -0.0540911295, -0.4550200403, -0.356012702, -0.3157882988, 0.3434745073, 0.5764548779, 0.4297192097, 0.1184363291, 0.2611115575, -0.5747964978, 0.241606161, 0.0991281196, -0.0526560098, -0.1630297601, -0.164091453, 0.1973081082, -0.0980383605, 0.0605769381, -0.311129421, -0.0378792807, 0.2995848358, -0.1518818736, -0.5790772438, 0.0650470704, -0.118583791, 0.083332628, 0.3748460114, 0.1614404917, -0.0566269122, -0.153047815, -0.0001293716, -0.1339463443, -0.2941283882, 0.0789089501, -0.1295742542, -0.3237825036, -0.0456329361, -0.2065197825, -0.0002372158, 0.1084333882, 0.0292207245, 0.3305553198, 0.34281376, 0.0191643033, 0.2844890058, -0.0925666317, 0.0921059176, 0.2597311139, -0.0445695147, 0.141648367, -0.1034709513, 0.0686073005, 0.0790595859, 0.1394547671, 0.266769886, 0.3338946998, -0.0150519693, 0.1412461996, 0.3176977634, 0.1359122694, 0.1435524076, -0.318710357, 0.2108194977, 0.0707106665, -0.0898430869, -0.1369030625, -0.2198535502, -0.5876247883, -0.1534554958, 0.2062442005, -0.149135381, 0.0905932337, 0.4807759821, 0.2448590845, -0.4734288752, 0.0507446229, 0.0618904531, 0.9134722948, -0.3971924484, 0.314484477, 0.4593324959, -0.0659245104, 0.6889107823, -0.2493768632, 0.2878424525, -0.2602440715, 0.0969929546, -0.0046332735, 0.0240999572, 0.1859909296, 0.2977375388, -0.3869920075, 0.2436875403, 0.0800648034, 0.0783288181, -0.1010476574, 0.1207979098, 0.0740610585, -0.0537052266, -0.0044609997, 0.038708806, 0.148015812, 0.1679361165, -0.1008346602, -0.2626410425, -0.1506687999, 0.0975855216, -0.0364319384, 0.1077660769, -0.0858726948, 0.012595688, 0.115386948, -0.2285210639, 0.1785608679, 0.044707913, 0.229564786, 0.1742634177, -0.1165142059, -0.1177855879, 0.1121455356, 0.0951124728, 0.047778327, 0.2640110254, 0.058813937, -0.1901765615, 0.0238818284, -0.0143232867, -0.0229322556, -0.6582656503, -0.2425997853, -0.0195064452, -0.338309586, 0.0406941734, -0.1690114737, 0.1314936429, -0.3500056565, 0.0776487291, 0.0422846191, -0.031706512, -0.0073301978, 0.1334019005, -0.3764160872, -0.1055551916, -0.0696595907, 0.3178859353, -0.1067603305, 0.026058536, 0.293084085, 0.1390783489, -0.1154674888, -0.1924815178, 0.1168995798, 0.2639496624, -0.3442686796, 0.3508821726, -0.0911655277, 0.38977018, 0.245941028, 0.4746274054, -0.192261979, 0.1166068986, -0.2697851956, 0.1351474822, -0.2463659793, 0.1444520801, 0.1061555892, -0.0853373557, -0.241474092, 0.808724165, 0.2888927162, -0.1660508364, -0.2104359716, 0.1199411079, -0.2968471348, 0.2891425192, 0.4651018083, 0.0027300827, 0.1073271483, 0.1166566089, -0.0226149, -0.0354598761, -0.1430861056, -0.0093738958, -0.4408378899, 0.2326543629, 0.3971709609, -0.2790673077, 0.0164313205, -0.2374550253, -0.307277739, -0.0352572612, 0.1781385094, 0.3160153627, -0.1167778, 0.2806135416, 0.3236217201, 0.0424044915, -0.1924268901, -0.0534698628, 0.2104377449, 0.3997376561, -0.0866996571, 0.2149669081, -0.0377440453, 0.0833411366, -0.1107137278, 0.2121828645, -0.1812832505, 0.2066606879, 0.1498606652, -0.2446234822, 0.0587376989, -0.2719558179, 0.0709204227, -0.0187379587, -0.1596564054, -0.1105745807, 0.2401587665, -0.0146165192, 0.2646246254, 0.1981234998, 0.1586771607, 0.1647422761, -0.1007739529, 0.2378635854, -0.1556212306, -0.1299572736, 0.0340240002, 0.1847242266, 0.1766385883, -0.3030104935, 0.0437075384, 0.2135514021, -0.0956344083, 0.0900671259, -0.0498675741, -0.3752330244, 0.093605727, -0.1414037347, 0.0692958757, -0.0426436067, -0.0184854846, -0.0263288468, 0.2260891795, -0.7964647412, -0.4338703156, -0.1880561709, 0.2785820365, 0.4275819957, 0.4440073967, -0.1418631822, -0.2345517278, -0.1608280241, -0.1247887835, 0.5020840764, -0.1063784882, 0.0345153399, -0.3078823686, -0.0675119758, 0.1722891033, 0.2360776514, -0.1693924218, 0.0225639027, -0.0608974509, 0.4165675342, 0.2164752036, -0.0459023044, -0.2489144504, -0.1122571081, 0.2209975272, -0.0683112293, 0.4019660652, -0.4644501209, -0.1036419496, -0.3935955763, 0.1805750579, 0.1125630438, 0.033211723, 0.2970169187, 0.5219266415, 0.1952513009, 0.1929663271, 0.2672561407, 0.2638757825, 0.0262865443, 0.3219054043, 0.1198596731, -0.0960357711, -0.0178402141, 0.0783528462, 0.1745675653, -0.000481669, -0.1113830209, 0.5997074246, 0.0313791893, -0.0041406257, -0.1581808925, 0.1655306816, -0.3940225244, 0.1993965805, 0.1589347273, 0.0326427221, 0.032883089, -0.0332192481, 0.0036346104, 0.075484097, 0.2761545181, 0.4486452043, 0.2513765693, -0.2495193481, -0.2027415186, -0.2581020892, 0.3710935712, -0.0538539365, 0.1372665614, -0.0615193546, 0.3472933471, -0.0496518537, -0.288867861, 0.1055764705, -0.0285972487, -0.0261401124, 0.0440636016, -0.0828723833, -0.069006525, -0.3028966486, 0.0072685275, -0.1658412516, -0.4282775819, 0.0905361027, -0.0716684908, -0.0630939305, -0.2350928187, 0.0287551824, 0.2469122112, 0.1086402237, 0.2696190774, 0.1132545844, 0.0510672443, -0.0816523209, -0.0887760967, -0.3101071119, -0.1805021614, -0.3347491026, -0.1682426929, -0.2967460752, 0.5181000829, -0.0839152187, -0.2681002915, -0.309550941, 0.3083865047, -0.3641302288, 0.5591868162, 0.3405434489, 0.1070057601, -0.4990777671, -0.1324355006, 0.0893777609, 0.3456852734, 0.069913201, 0.031337779, -0.4642444849, -0.1810527742, 0.4082534313, -0.8163276315, -0.3400099277, 0.2773923874, 0.2063268572, -0.0303842649, -0.2536891401, -0.2889241874, -0.1075323597, 0.3392098546, -0.072190769, -0.0814976767, 0.076704964, -0.0421539135, 0.1234855875, 0.206771031, 0.1660782695, 0.3275051713, -0.2120839953, -0.0851780474, -0.1489029974 ]
https://github.com/huggingface/datasets/issues/477
Overview.ipynb throws exceptions with nlp 0.4.0
Thanks for reporting this issue There was a bug where numpy arrays would get returned instead of tensorflow tensors. This is fixed on master. I tried to re-run the colab and encountered this error instead: ``` AttributeError: 'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'to_tensor' ``` This is because the dataset returns a Tensor and not a RaggedTensor. But I think we should always return a RaggedTensor unless the length of the sequence is fixed (it that case they can be stack into a Tensor).
with nlp 0.4.0, the TensorFlow example in Overview.ipynb throws the following exceptions: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-5-48907f2ad433> in <module> ----> 1 features = {x: train_tf_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.max_len]) for x in columns[:3]} 2 labels = {"output_1": train_tf_dataset["start_positions"].to_tensor(default_value=0, shape=[None, 1])} 3 labels["output_2"] = train_tf_dataset["end_positions"].to_tensor(default_value=0, shape=[None, 1]) 4 tfdataset = tf.data.Dataset.from_tensor_slices((features, labels)).batch(8) <ipython-input-5-48907f2ad433> in <dictcomp>(.0) ----> 1 features = {x: train_tf_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.max_len]) for x in columns[:3]} 2 labels = {"output_1": train_tf_dataset["start_positions"].to_tensor(default_value=0, shape=[None, 1])} 3 labels["output_2"] = train_tf_dataset["end_positions"].to_tensor(default_value=0, shape=[None, 1]) 4 tfdataset = tf.data.Dataset.from_tensor_slices((features, labels)).batch(8) AttributeError: 'numpy.ndarray' object has no attribute 'to_tensor'
83
Overview.ipynb throws exceptions with nlp 0.4.0 with nlp 0.4.0, the TensorFlow example in Overview.ipynb throws the following exceptions: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-5-48907f2ad433> in <module> ----> 1 features = {x: train_tf_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.max_len]) for x in columns[:3]} 2 labels = {"output_1": train_tf_dataset["start_positions"].to_tensor(default_value=0, shape=[None, 1])} 3 labels["output_2"] = train_tf_dataset["end_positions"].to_tensor(default_value=0, shape=[None, 1]) 4 tfdataset = tf.data.Dataset.from_tensor_slices((features, labels)).batch(8) <ipython-input-5-48907f2ad433> in <dictcomp>(.0) ----> 1 features = {x: train_tf_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.max_len]) for x in columns[:3]} 2 labels = {"output_1": train_tf_dataset["start_positions"].to_tensor(default_value=0, shape=[None, 1])} 3 labels["output_2"] = train_tf_dataset["end_positions"].to_tensor(default_value=0, shape=[None, 1]) 4 tfdataset = tf.data.Dataset.from_tensor_slices((features, labels)).batch(8) AttributeError: 'numpy.ndarray' object has no attribute 'to_tensor' Thanks for reporting this issue There was a bug where numpy arrays would get returned instead of tensorflow tensors. This is fixed on master. I tried to re-run the colab and encountered this error instead: ``` AttributeError: 'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'to_tensor' ``` This is because the dataset returns a Tensor and not a RaggedTensor. But I think we should always return a RaggedTensor unless the length of the sequence is fixed (it that case they can be stack into a Tensor).
[ -0.0391483232, 0.0825120658, -0.0073066265, -0.0530796573, 0.0318032615, -0.0482141115, 0.8157608509, 0.2792402506, -0.0684228018, 0.1789911836, 0.0316704139, 0.2038188875, -0.2970306277, -0.053073708, 0.0210223142, -0.4359813035, -0.1079105288, 0.2862541676, 0.0336869359, -0.0560539179, -0.1683888137, 0.2695778608, -0.4814034402, 0.0699897781, -0.3009615839, -0.2224037498, -0.0034629579, -0.1184038967, 0.1805593222, -0.3218073547, 0.298343271, -0.0853026137, -0.0729663149, 0.2157042474, -0.0001094074, 0.1312537789, 0.2247509509, 0.0399748273, -0.1744725108, -0.3294424415, -0.1835715771, -0.0175783839, -0.04888409, -0.3077403903, 0.1411334574, 0.0695706233, 0.2543086112, 0.2293205857, 0.1875869483, 0.4259966612, 0.2343904376, 0.3789536357, 0.0684158653, 0.0336802788, 0.0507047512, -0.0231375173, -0.0912747458, 0.1140882745, -0.062138591, -0.199799031, -0.2145838141, 0.280905813, -0.0087526515, 0.0915341303, -0.1583669484, 0.0241950639, 0.0742403045, -0.2711645365, -0.0711957067, 0.4140102565, -0.0402942039, -0.0426517799, -0.3928295374, -0.3703235388, 0.0652715862, -0.5704239607, -0.0600385703, 0.1048352718, -0.1118559539, -0.0165608507, -0.1545906067, 0.0957536101, -0.5827882886, 0.3474161327, -0.1908772141, 0.1448998898, 0.0082722092, 0.0810574591, -0.0094357533, -0.0986805335, -0.0254502892, -0.0089678299, 0.1772598922, 0.0017483952, -0.2649015784, -0.2203814536, 0.1818949878, -0.2065803558, -0.1672124118, -0.077576898, 0.0233217496, 0.0268010795, 0.0007514866, 0.3499959707, -0.1220965832, 0.2610675693, 0.1183250919, 0.157666266, 0.3323269486, -0.005689133, -0.1858868301, 0.0312410071, 0.0496796966, -0.1437183022, -0.1408729255, 0.0173161887, 0.346632421, 0.1334186643, -0.5548804998, 0.0387058333, -0.3659701347, 0.1409140825, 0.1920102984, 0.2450776249, -0.0872801989, 0.2586590052, 0.2062356621, 0.1746399254, -0.450601697, -0.0207852684, -0.2161476761, 0.3215354681, -0.0543457121, -0.2499999702, 0.2410529256, 0.327288419, 0.3226421475, -0.0850196034, 0.0863244385, 0.0834724084, 0.3203797936, -0.2739878893, 0.1113804057, 0.2461780906, -0.0800186992, -0.1207125336, 0.0464207418, -0.1517857462, -0.0383196361, -0.0575325601, -0.2080947161, -0.3066110015, -0.0356256627, 0.2675880194, 0.1201594323, -0.0608258471, -0.2594279647, 0.1365098059, 0.0316396505, -0.1947878003, -0.0350830555, -0.3620332778, -0.1259936839, -0.0612784475, 0.0401068851, 0.1906769872, 0.1341357678, -0.1566854417, 0.1043587103, 0.1802006662, 0.2523797154, 0.2696483731, -0.2044542134, 0.2307112068, -0.0361946672, 0.3748852313, 0.3027420342, -0.2861013412, -0.1879551858, 0.1153768972, -0.0510693751, 0.0571819879, -0.0915261731, 0.0197356008, 0.4229822755, -0.0380664244, 0.3864848316, 0.2939308584, -0.2305164486, 0.0985408127, -0.0844678134, 0.1140946224, 0.2922216952, -0.064506188, 0.1169263572, 0.0630714744, -0.1999794245, 0.5250785351, 0.0386195332, -0.1206298023, -0.0273565669, 0.0281607788, 0.0251633544, -0.3499792516, -0.1735029072, -0.1349680275, -0.3476231694, 0.0723293722, 0.0827103853, 0.2156668007, 0.334797591, -0.0584712997, 0.0152781634, 0.1186524779, -0.0774298608, -0.2848460078, 0.251182884, 0.1563902199, -0.1726752073, 0.0747463033, -0.1370525807, 0.0778897628, -0.3810480237, 0.1017818227, -0.1399623007, 0.0689368621, -0.0984522328, -0.1941970736, -0.2610077858, 0.3692514896, -0.0739927441, -0.1785957068, -0.0611254238, 0.2158332616, 0.1814825386, 0.2297653556, -0.23061423, 0.1413955539, 0.3241616488, -0.0578083396, -0.1601212472, 0.208571285, 0.0083810836, -0.1782840937, 0.159443453, 0.4819948375, 0.2851333022, 0.175220266, 0.4278374016, 0.1367619485, 0.2068369091, 0.002374361, -0.1972272843, 0.0887978971, 0.3635754883, -0.0712223649, 0.1973560303, -0.2939552665, -0.7215965986, 0.1118018925, 0.5496825576, 0.1343673915, 0.0659739152, 0.1962780952, -0.0909680873, 0.1029394493, 0.3837307394, -0.2072698027, 0.1110233292, 0.0864471793, 0.2527718842, 0.0789590627, -0.3717408776, -0.2521876693, 0.0808835849, 0.1414929628, -0.1022185236, -0.022834342, 0.2730284035, 0.2171438932, -0.26156497, -0.3487099707, -0.1701575816, 0.2663603425, -0.3354309201, 0.3268647492, -0.1205524504, -0.2741841078, -0.082081385, -0.5632300377, -0.1426299065, -0.324364543, -0.0196136311, 0.6269504428, -0.3355835378, 0.2322809994, 0.1679949611, 0.038532488, 0.07346607, 0.2469549328, 0.1575051993, 0.0089548826, -0.3124399781, 0.1394796073, 0.1999256909, -0.150333479, 0.2847869694, -0.0808446854, -0.3065349758, 0.2594655454, -0.5440359116, 0.1175275594, -0.1258307844, -0.0007881449, 0.2060858607, 0.267690599, -0.2906227112, -0.5785193443, 0.0555493496, -0.1116684824, -0.1575767845, 0.3648536503, -0.0376021899, -0.0444796681, -0.3675982058, -0.5435934663, -0.1716129929, -0.444673568, 0.3616949022, -0.0806768909, 0.3070821166, 0.7853790522, -0.0730392113, 0.5275719762, 0.269594878, 0.1862934381, 0.2173419446, -0.0682447031, -0.0081610885, -0.2857410014, -0.3695432842, -0.1063030437, -0.2888969779, 0.183195442, 0.1218607649, -0.3298077285, -0.0585048981, -0.0348197892, 0.1349249035, 0.1361687928, -0.1742238849, 0.3653980494, -0.0563017279, -0.030221574, -0.0342408791, 0.0573621094, 0.3721609712, 0.2451587766, -0.0622615293, -0.0394694172, 0.2059447318, 0.1754861027, 0.3692197204, 0.0424720421, -0.2425434142, 0.2184518129, 0.0004715258, 0.0349336714, -0.1755882651, -0.2768708766, 0.2389114648, -0.0171982739, -0.0787892193, 0.0796447769, -0.1992205679, -0.2940819263, -0.1044808701, 0.0583735146, -0.2043748796, -0.3995546997, 0.1599550396, -0.3206956387, 0.1283506602, -0.0597036742, 0.0156894624, -0.2150936872, 0.065781869, -0.1475070715, 0.1715197563, 0.0861305743, -0.25962919, -0.0938591361, -0.5862798691, -0.6067794561, 0.2046331316, 0.2464429736, 0.5263923407, -0.0870107338, -0.018824134, -0.114160724, -0.0416839793, 0.4461074769, 0.1069851965, -0.142552942, 0.260831207, -0.1329195797, -0.3578275442, -0.1220484599, -0.3692784607, 0.2719853222, 0.5299986005, 0.3015771806, -0.206393972, 0.0024214627, 0.3558471501, -0.0466871299, 0.1243459657, 0.1750921607, 0.0414710306, -0.0300872196, -0.1414523274, 0.0908920318, 0.1586923748, -0.0416009091, -0.3086982071, -0.0585057102, 0.0238243211, -0.0746736154, 0.1684126854, 0.2123263031, -0.1910573542, -0.0090059079, 0.0770117044, -0.2531860173, -0.1229068488, 0.4033560753, -0.0854443461, -0.161204651, -0.2986451685, -0.0300269071, 0.177233085, 0.0864014551, 0.1985335499, -0.0263534561, 0.0448873006, -0.23023884, -0.0440554768, -0.0860254169, 0.4295453429, 0.5223546028, 0.0664970726, -0.1000387371, -0.1619127542, 0.2714985907, -0.328350395, 0.0714576766, 0.3990156353, -0.0608640984, -0.3527769744, 0.2800025344, -0.2473483086, 0.4753126502, 0.4118619561, 0.2183436304, 0.6721664071, 0.3472310007, 0.6203200221, 0.1277311593, 0.475355655, -0.1620083898, -0.0173954964, -0.1005231515, -0.0788864568, 0.0276139695, 0.109601602, -0.1319762021, 0.0889555886, 0.1767240167, 0.0960329548, 0.0463647135, 0.0985128954, 0.0611856282, -0.2404058874, -0.2900928259, 0.1539501548, -0.1581508964, 0.1574362814, -0.0482133329, -0.1438088715, -0.0824364573, -0.3264622688, -0.2867514193, 0.2754972279, -0.1414871663, 0.1955630481, 0.2045816928, -0.1971868724, -0.0391067751, -0.0287577268, 0.2409321964, -0.0701695755, -0.1455820203, -0.2068725079, -0.0692644864, 0.0280243829, 0.1032119989, -0.1363179386, 0.5273317695, -0.1486340761, -0.1375992298, -0.0097951125, -0.0955039635, -0.2173525691, 0.2621585429, 0.1152559742, 0.0907629132, 0.1473237425, 0.0249877516, 0.118803516, -0.4523479939, -0.2321521342, 0.1703427881, -0.1349197477, -0.3381386995, 0.2134268582, -0.1455638111, -0.0226632897, 0.0562408529, 0.2497801185, -0.0592684262, 0.2341693938, 0.6033887863, -0.0211929958, -0.0915529281, -0.143573463, -0.2165422291, 0.0541516766, -0.1071855724, 0.1656974852, -0.1493015587, 0.0013680184, 0.0525457039, 0.1575046182, 0.0081931278, 0.2858626246, -0.1662967354, -0.3224810362, -0.3871928751, 0.2180492878, -0.1401995569, 0.2134717107, 0.1630475521, 0.6170105338, 0.0856668055, -0.1259978265, -0.3218878508, 0.0321272984, -0.2677124143, 0.3241803944, 0.0389140248, -0.209273234, 0.1503250897, -0.0048053917, 0.1132220253, 0.1361238658, -0.1097705513, -0.258374095, -0.1917407066, 0.0714032352, 0.1857148111, -0.3465096653, 0.1661629975, 0.0046597198, -0.1557180882, -0.1230327934, 0.1172005981, -0.0563099906, -0.2534220815, 0.5090385079, 0.1321462542, 0.6595723033, 0.2523017228, 0.0457535833, -0.1782054752, 0.1686657369, -0.0889488086, 0.197129041, -0.0100231571, -0.0413219221, -0.3386870325, -0.0331776701, -0.417977035, -0.1148276776, 0.2204306275, -0.332847625, -0.0377381556, -0.2488702387, 0.0429368578, 0.1350105107, -0.11346367, 0.0266082846, -0.0060439766, 0.2527719438, -0.0741036087, 0.1623069793, 0.2498595715, -0.0320506878, 0.2161779255, 0.1043510735, 0.1092668101, -0.0902840123, 0.109707132, 0.1391166002, -0.1979448497, -0.311792016, 0.2412806153, 0.3260470033, -0.3616292477, 0.1162671521, -0.1829432696, 0.0854910463, 0.4222064316, -0.051563181, 0.0166012309, 0.2456997037, 0.0994248465, -0.1708699614, 0.2237035334, -0.3996600807, -0.2821902037, -0.031708993, 0.1926876754, 0.277977705, 0.1008705869, 0.0297557376, -0.2888755202, -0.1592282653, -0.0015653705, 0.2095530182, -0.397054702, 0.0147345047, -0.3463863432, 0.1573570073, 0.0574847348, -0.3433607817, -0.03770243, 0.0445322767, 0.1723367572, 0.1850241423, -0.2280979007, -0.094242774, -0.1356525272, 0.015781451, 0.2179111391, -0.0611417666, 0.3229675591, 0.3675955236, -0.0189268384, -0.2765449584, 0.5054777861, 0.4357511103, 0.2400354296, -0.3785278201, 0.0104650408, 0.1237664372, -0.1097797751, -0.0272481479, 0.096838519, 0.1076468453, 0.2009621561, 0.2250177413, 0.1305899918, -0.1786041707, 0.3606994748, 0.1361266524, -0.0453323945, -0.2492054403, 0.3173816204, 0.1219384894, -0.1387659609, -0.1831055731, -0.0519299209, -0.3085250854, 0.1512973011, 0.3084793389, -0.1038087234, 0.1319822967, 0.1568074077, 0.0841484144, -0.0937002301, 0.3824258447, 0.278547287, 0.3412989676, -0.2391837239, -0.0532668009, -0.1395324767, 0.151815623, -0.109163627, 0.3494440615, 0.1335538626, 0.1528651267, -0.2013280541, -0.0554907322, -0.1758028716, -0.4866574705, 0.0382893309, 0.0140969912, -0.5309219956, -0.0677648932, 0.2167235017, -0.2995285988, 0.0809301287, -0.2919172049, 0.1038766876, -0.0216724575, 0.0582706444, -0.0243856683, 0.2547582388, 0.0580757186, 0.4695751965, -0.1598594934, 0.2173871398, 0.3523494005, -0.0399273299, -0.2264607251, 0.0155344848, -0.1288682669, -0.3512551785, 0.0623173416, 0.0021564874, 0.631062448, 0.0308012031, -0.3426462412, -0.0471833497, 0.2966679335, 0.0744637698, -0.2258536667, -0.2897468209, 0.5159015059, -0.3268098533, 0.1209048107, -0.035534285, 0.2257708311, 0.0469697639, 0.1271172762, -0.4208704233, -0.5104087591, 0.4589866102, -0.6723732352, -0.2989537716, -0.1500112414, 0.3177680373, -0.1784151942, 0.1541514546, -0.7014426589, -0.1308531761, 0.3214225471, -0.3068628609, -0.3737615645, 0.1170789748, 0.211043328, 0.0169106871, 0.0359381586, 0.5025032163, 0.0519081168, -0.3045866191, 0.0904339179, -0.3307105601 ]
https://github.com/huggingface/datasets/issues/477
Overview.ipynb throws exceptions with nlp 0.4.0
Hi, I got another error (on Colab): ```python # You can read a few attributes of the datasets before loading them (they are python dataclasses) from dataclasses import asdict for key, value in asdict(datasets[6]).items(): print('👉 ' + key + ': ' + str(value)) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-b8ace6c227a2> in <module>() 2 from dataclasses import asdict 3 ----> 4 for key, value in asdict(datasets[6]).items(): 5 print('👉 ' + key + ': ' + str(value)) /usr/local/lib/python3.6/dist-packages/dataclasses.py in asdict(obj, dict_factory) 1008 """ 1009 if not _is_dataclass_instance(obj): -> 1010 raise TypeError("asdict() should be called on dataclass instances") 1011 return _asdict_inner(obj, dict_factory) 1012 TypeError: asdict() should be called on dataclass instances ```
with nlp 0.4.0, the TensorFlow example in Overview.ipynb throws the following exceptions: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-5-48907f2ad433> in <module> ----> 1 features = {x: train_tf_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.max_len]) for x in columns[:3]} 2 labels = {"output_1": train_tf_dataset["start_positions"].to_tensor(default_value=0, shape=[None, 1])} 3 labels["output_2"] = train_tf_dataset["end_positions"].to_tensor(default_value=0, shape=[None, 1]) 4 tfdataset = tf.data.Dataset.from_tensor_slices((features, labels)).batch(8) <ipython-input-5-48907f2ad433> in <dictcomp>(.0) ----> 1 features = {x: train_tf_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.max_len]) for x in columns[:3]} 2 labels = {"output_1": train_tf_dataset["start_positions"].to_tensor(default_value=0, shape=[None, 1])} 3 labels["output_2"] = train_tf_dataset["end_positions"].to_tensor(default_value=0, shape=[None, 1]) 4 tfdataset = tf.data.Dataset.from_tensor_slices((features, labels)).batch(8) AttributeError: 'numpy.ndarray' object has no attribute 'to_tensor'
110
Overview.ipynb throws exceptions with nlp 0.4.0 with nlp 0.4.0, the TensorFlow example in Overview.ipynb throws the following exceptions: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-5-48907f2ad433> in <module> ----> 1 features = {x: train_tf_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.max_len]) for x in columns[:3]} 2 labels = {"output_1": train_tf_dataset["start_positions"].to_tensor(default_value=0, shape=[None, 1])} 3 labels["output_2"] = train_tf_dataset["end_positions"].to_tensor(default_value=0, shape=[None, 1]) 4 tfdataset = tf.data.Dataset.from_tensor_slices((features, labels)).batch(8) <ipython-input-5-48907f2ad433> in <dictcomp>(.0) ----> 1 features = {x: train_tf_dataset[x].to_tensor(default_value=0, shape=[None, tokenizer.max_len]) for x in columns[:3]} 2 labels = {"output_1": train_tf_dataset["start_positions"].to_tensor(default_value=0, shape=[None, 1])} 3 labels["output_2"] = train_tf_dataset["end_positions"].to_tensor(default_value=0, shape=[None, 1]) 4 tfdataset = tf.data.Dataset.from_tensor_slices((features, labels)).batch(8) AttributeError: 'numpy.ndarray' object has no attribute 'to_tensor' Hi, I got another error (on Colab): ```python # You can read a few attributes of the datasets before loading them (they are python dataclasses) from dataclasses import asdict for key, value in asdict(datasets[6]).items(): print('👉 ' + key + ': ' + str(value)) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-b8ace6c227a2> in <module>() 2 from dataclasses import asdict 3 ----> 4 for key, value in asdict(datasets[6]).items(): 5 print('👉 ' + key + ': ' + str(value)) /usr/local/lib/python3.6/dist-packages/dataclasses.py in asdict(obj, dict_factory) 1008 """ 1009 if not _is_dataclass_instance(obj): -> 1010 raise TypeError("asdict() should be called on dataclass instances") 1011 return _asdict_inner(obj, dict_factory) 1012 TypeError: asdict() should be called on dataclass instances ```
[ -0.0391483232, 0.0825120658, -0.0073066265, -0.0530796573, 0.0318032615, -0.0482141115, 0.8157608509, 0.2792402506, -0.0684228018, 0.1789911836, 0.0316704139, 0.2038188875, -0.2970306277, -0.053073708, 0.0210223142, -0.4359813035, -0.1079105288, 0.2862541676, 0.0336869359, -0.0560539179, -0.1683888137, 0.2695778608, -0.4814034402, 0.0699897781, -0.3009615839, -0.2224037498, -0.0034629579, -0.1184038967, 0.1805593222, -0.3218073547, 0.298343271, -0.0853026137, -0.0729663149, 0.2157042474, -0.0001094074, 0.1312537789, 0.2247509509, 0.0399748273, -0.1744725108, -0.3294424415, -0.1835715771, -0.0175783839, -0.04888409, -0.3077403903, 0.1411334574, 0.0695706233, 0.2543086112, 0.2293205857, 0.1875869483, 0.4259966612, 0.2343904376, 0.3789536357, 0.0684158653, 0.0336802788, 0.0507047512, -0.0231375173, -0.0912747458, 0.1140882745, -0.062138591, -0.199799031, -0.2145838141, 0.280905813, -0.0087526515, 0.0915341303, -0.1583669484, 0.0241950639, 0.0742403045, -0.2711645365, -0.0711957067, 0.4140102565, -0.0402942039, -0.0426517799, -0.3928295374, -0.3703235388, 0.0652715862, -0.5704239607, -0.0600385703, 0.1048352718, -0.1118559539, -0.0165608507, -0.1545906067, 0.0957536101, -0.5827882886, 0.3474161327, -0.1908772141, 0.1448998898, 0.0082722092, 0.0810574591, -0.0094357533, -0.0986805335, -0.0254502892, -0.0089678299, 0.1772598922, 0.0017483952, -0.2649015784, -0.2203814536, 0.1818949878, -0.2065803558, -0.1672124118, -0.077576898, 0.0233217496, 0.0268010795, 0.0007514866, 0.3499959707, -0.1220965832, 0.2610675693, 0.1183250919, 0.157666266, 0.3323269486, -0.005689133, -0.1858868301, 0.0312410071, 0.0496796966, -0.1437183022, -0.1408729255, 0.0173161887, 0.346632421, 0.1334186643, -0.5548804998, 0.0387058333, -0.3659701347, 0.1409140825, 0.1920102984, 0.2450776249, -0.0872801989, 0.2586590052, 0.2062356621, 0.1746399254, -0.450601697, -0.0207852684, -0.2161476761, 0.3215354681, -0.0543457121, -0.2499999702, 0.2410529256, 0.327288419, 0.3226421475, -0.0850196034, 0.0863244385, 0.0834724084, 0.3203797936, -0.2739878893, 0.1113804057, 0.2461780906, -0.0800186992, -0.1207125336, 0.0464207418, -0.1517857462, -0.0383196361, -0.0575325601, -0.2080947161, -0.3066110015, -0.0356256627, 0.2675880194, 0.1201594323, -0.0608258471, -0.2594279647, 0.1365098059, 0.0316396505, -0.1947878003, -0.0350830555, -0.3620332778, -0.1259936839, -0.0612784475, 0.0401068851, 0.1906769872, 0.1341357678, -0.1566854417, 0.1043587103, 0.1802006662, 0.2523797154, 0.2696483731, -0.2044542134, 0.2307112068, -0.0361946672, 0.3748852313, 0.3027420342, -0.2861013412, -0.1879551858, 0.1153768972, -0.0510693751, 0.0571819879, -0.0915261731, 0.0197356008, 0.4229822755, -0.0380664244, 0.3864848316, 0.2939308584, -0.2305164486, 0.0985408127, -0.0844678134, 0.1140946224, 0.2922216952, -0.064506188, 0.1169263572, 0.0630714744, -0.1999794245, 0.5250785351, 0.0386195332, -0.1206298023, -0.0273565669, 0.0281607788, 0.0251633544, -0.3499792516, -0.1735029072, -0.1349680275, -0.3476231694, 0.0723293722, 0.0827103853, 0.2156668007, 0.334797591, -0.0584712997, 0.0152781634, 0.1186524779, -0.0774298608, -0.2848460078, 0.251182884, 0.1563902199, -0.1726752073, 0.0747463033, -0.1370525807, 0.0778897628, -0.3810480237, 0.1017818227, -0.1399623007, 0.0689368621, -0.0984522328, -0.1941970736, -0.2610077858, 0.3692514896, -0.0739927441, -0.1785957068, -0.0611254238, 0.2158332616, 0.1814825386, 0.2297653556, -0.23061423, 0.1413955539, 0.3241616488, -0.0578083396, -0.1601212472, 0.208571285, 0.0083810836, -0.1782840937, 0.159443453, 0.4819948375, 0.2851333022, 0.175220266, 0.4278374016, 0.1367619485, 0.2068369091, 0.002374361, -0.1972272843, 0.0887978971, 0.3635754883, -0.0712223649, 0.1973560303, -0.2939552665, -0.7215965986, 0.1118018925, 0.5496825576, 0.1343673915, 0.0659739152, 0.1962780952, -0.0909680873, 0.1029394493, 0.3837307394, -0.2072698027, 0.1110233292, 0.0864471793, 0.2527718842, 0.0789590627, -0.3717408776, -0.2521876693, 0.0808835849, 0.1414929628, -0.1022185236, -0.022834342, 0.2730284035, 0.2171438932, -0.26156497, -0.3487099707, -0.1701575816, 0.2663603425, -0.3354309201, 0.3268647492, -0.1205524504, -0.2741841078, -0.082081385, -0.5632300377, -0.1426299065, -0.324364543, -0.0196136311, 0.6269504428, -0.3355835378, 0.2322809994, 0.1679949611, 0.038532488, 0.07346607, 0.2469549328, 0.1575051993, 0.0089548826, -0.3124399781, 0.1394796073, 0.1999256909, -0.150333479, 0.2847869694, -0.0808446854, -0.3065349758, 0.2594655454, -0.5440359116, 0.1175275594, -0.1258307844, -0.0007881449, 0.2060858607, 0.267690599, -0.2906227112, -0.5785193443, 0.0555493496, -0.1116684824, -0.1575767845, 0.3648536503, -0.0376021899, -0.0444796681, -0.3675982058, -0.5435934663, -0.1716129929, -0.444673568, 0.3616949022, -0.0806768909, 0.3070821166, 0.7853790522, -0.0730392113, 0.5275719762, 0.269594878, 0.1862934381, 0.2173419446, -0.0682447031, -0.0081610885, -0.2857410014, -0.3695432842, -0.1063030437, -0.2888969779, 0.183195442, 0.1218607649, -0.3298077285, -0.0585048981, -0.0348197892, 0.1349249035, 0.1361687928, -0.1742238849, 0.3653980494, -0.0563017279, -0.030221574, -0.0342408791, 0.0573621094, 0.3721609712, 0.2451587766, -0.0622615293, -0.0394694172, 0.2059447318, 0.1754861027, 0.3692197204, 0.0424720421, -0.2425434142, 0.2184518129, 0.0004715258, 0.0349336714, -0.1755882651, -0.2768708766, 0.2389114648, -0.0171982739, -0.0787892193, 0.0796447769, -0.1992205679, -0.2940819263, -0.1044808701, 0.0583735146, -0.2043748796, -0.3995546997, 0.1599550396, -0.3206956387, 0.1283506602, -0.0597036742, 0.0156894624, -0.2150936872, 0.065781869, -0.1475070715, 0.1715197563, 0.0861305743, -0.25962919, -0.0938591361, -0.5862798691, -0.6067794561, 0.2046331316, 0.2464429736, 0.5263923407, -0.0870107338, -0.018824134, -0.114160724, -0.0416839793, 0.4461074769, 0.1069851965, -0.142552942, 0.260831207, -0.1329195797, -0.3578275442, -0.1220484599, -0.3692784607, 0.2719853222, 0.5299986005, 0.3015771806, -0.206393972, 0.0024214627, 0.3558471501, -0.0466871299, 0.1243459657, 0.1750921607, 0.0414710306, -0.0300872196, -0.1414523274, 0.0908920318, 0.1586923748, -0.0416009091, -0.3086982071, -0.0585057102, 0.0238243211, -0.0746736154, 0.1684126854, 0.2123263031, -0.1910573542, -0.0090059079, 0.0770117044, -0.2531860173, -0.1229068488, 0.4033560753, -0.0854443461, -0.161204651, -0.2986451685, -0.0300269071, 0.177233085, 0.0864014551, 0.1985335499, -0.0263534561, 0.0448873006, -0.23023884, -0.0440554768, -0.0860254169, 0.4295453429, 0.5223546028, 0.0664970726, -0.1000387371, -0.1619127542, 0.2714985907, -0.328350395, 0.0714576766, 0.3990156353, -0.0608640984, -0.3527769744, 0.2800025344, -0.2473483086, 0.4753126502, 0.4118619561, 0.2183436304, 0.6721664071, 0.3472310007, 0.6203200221, 0.1277311593, 0.475355655, -0.1620083898, -0.0173954964, -0.1005231515, -0.0788864568, 0.0276139695, 0.109601602, -0.1319762021, 0.0889555886, 0.1767240167, 0.0960329548, 0.0463647135, 0.0985128954, 0.0611856282, -0.2404058874, -0.2900928259, 0.1539501548, -0.1581508964, 0.1574362814, -0.0482133329, -0.1438088715, -0.0824364573, -0.3264622688, -0.2867514193, 0.2754972279, -0.1414871663, 0.1955630481, 0.2045816928, -0.1971868724, -0.0391067751, -0.0287577268, 0.2409321964, -0.0701695755, -0.1455820203, -0.2068725079, -0.0692644864, 0.0280243829, 0.1032119989, -0.1363179386, 0.5273317695, -0.1486340761, -0.1375992298, -0.0097951125, -0.0955039635, -0.2173525691, 0.2621585429, 0.1152559742, 0.0907629132, 0.1473237425, 0.0249877516, 0.118803516, -0.4523479939, -0.2321521342, 0.1703427881, -0.1349197477, -0.3381386995, 0.2134268582, -0.1455638111, -0.0226632897, 0.0562408529, 0.2497801185, -0.0592684262, 0.2341693938, 0.6033887863, -0.0211929958, -0.0915529281, -0.143573463, -0.2165422291, 0.0541516766, -0.1071855724, 0.1656974852, -0.1493015587, 0.0013680184, 0.0525457039, 0.1575046182, 0.0081931278, 0.2858626246, -0.1662967354, -0.3224810362, -0.3871928751, 0.2180492878, -0.1401995569, 0.2134717107, 0.1630475521, 0.6170105338, 0.0856668055, -0.1259978265, -0.3218878508, 0.0321272984, -0.2677124143, 0.3241803944, 0.0389140248, -0.209273234, 0.1503250897, -0.0048053917, 0.1132220253, 0.1361238658, -0.1097705513, -0.258374095, -0.1917407066, 0.0714032352, 0.1857148111, -0.3465096653, 0.1661629975, 0.0046597198, -0.1557180882, -0.1230327934, 0.1172005981, -0.0563099906, -0.2534220815, 0.5090385079, 0.1321462542, 0.6595723033, 0.2523017228, 0.0457535833, -0.1782054752, 0.1686657369, -0.0889488086, 0.197129041, -0.0100231571, -0.0413219221, -0.3386870325, -0.0331776701, -0.417977035, -0.1148276776, 0.2204306275, -0.332847625, -0.0377381556, -0.2488702387, 0.0429368578, 0.1350105107, -0.11346367, 0.0266082846, -0.0060439766, 0.2527719438, -0.0741036087, 0.1623069793, 0.2498595715, -0.0320506878, 0.2161779255, 0.1043510735, 0.1092668101, -0.0902840123, 0.109707132, 0.1391166002, -0.1979448497, -0.311792016, 0.2412806153, 0.3260470033, -0.3616292477, 0.1162671521, -0.1829432696, 0.0854910463, 0.4222064316, -0.051563181, 0.0166012309, 0.2456997037, 0.0994248465, -0.1708699614, 0.2237035334, -0.3996600807, -0.2821902037, -0.031708993, 0.1926876754, 0.277977705, 0.1008705869, 0.0297557376, -0.2888755202, -0.1592282653, -0.0015653705, 0.2095530182, -0.397054702, 0.0147345047, -0.3463863432, 0.1573570073, 0.0574847348, -0.3433607817, -0.03770243, 0.0445322767, 0.1723367572, 0.1850241423, -0.2280979007, -0.094242774, -0.1356525272, 0.015781451, 0.2179111391, -0.0611417666, 0.3229675591, 0.3675955236, -0.0189268384, -0.2765449584, 0.5054777861, 0.4357511103, 0.2400354296, -0.3785278201, 0.0104650408, 0.1237664372, -0.1097797751, -0.0272481479, 0.096838519, 0.1076468453, 0.2009621561, 0.2250177413, 0.1305899918, -0.1786041707, 0.3606994748, 0.1361266524, -0.0453323945, -0.2492054403, 0.3173816204, 0.1219384894, -0.1387659609, -0.1831055731, -0.0519299209, -0.3085250854, 0.1512973011, 0.3084793389, -0.1038087234, 0.1319822967, 0.1568074077, 0.0841484144, -0.0937002301, 0.3824258447, 0.278547287, 0.3412989676, -0.2391837239, -0.0532668009, -0.1395324767, 0.151815623, -0.109163627, 0.3494440615, 0.1335538626, 0.1528651267, -0.2013280541, -0.0554907322, -0.1758028716, -0.4866574705, 0.0382893309, 0.0140969912, -0.5309219956, -0.0677648932, 0.2167235017, -0.2995285988, 0.0809301287, -0.2919172049, 0.1038766876, -0.0216724575, 0.0582706444, -0.0243856683, 0.2547582388, 0.0580757186, 0.4695751965, -0.1598594934, 0.2173871398, 0.3523494005, -0.0399273299, -0.2264607251, 0.0155344848, -0.1288682669, -0.3512551785, 0.0623173416, 0.0021564874, 0.631062448, 0.0308012031, -0.3426462412, -0.0471833497, 0.2966679335, 0.0744637698, -0.2258536667, -0.2897468209, 0.5159015059, -0.3268098533, 0.1209048107, -0.035534285, 0.2257708311, 0.0469697639, 0.1271172762, -0.4208704233, -0.5104087591, 0.4589866102, -0.6723732352, -0.2989537716, -0.1500112414, 0.3177680373, -0.1784151942, 0.1541514546, -0.7014426589, -0.1308531761, 0.3214225471, -0.3068628609, -0.3737615645, 0.1170789748, 0.211043328, 0.0169106871, 0.0359381586, 0.5025032163, 0.0519081168, -0.3045866191, 0.0904339179, -0.3307105601 ]
https://github.com/huggingface/datasets/issues/474
test_load_real_dataset when config has BUILDER_CONFIGS that matter
The `data_dir` parameter has been removed. Now the error is `ValueError: Config name is missing` As mentioned in #470 I think we can have one test with the first config of BUILDER_CONFIGS, and another test that runs all of the configs in BUILDER_CONFIGS
It a dataset has custom `BUILDER_CONFIGS` with non-keyword arguments (or keyword arguments with non default values), the config is not loaded during the test and causes an error. I think the problem is that `test_load_real_dataset` calls `load_dataset` with `data_dir=temp_data_dir` ([here](https://github.com/huggingface/nlp/blob/master/tests/test_dataset_common.py#L200)). This causes [this line](https://github.com/huggingface/nlp/blob/master/src/nlp/builder.py#L201) to always be false because `config_kwargs` is not `None`. [This line](https://github.com/huggingface/nlp/blob/master/src/nlp/builder.py#L222) will be run instead, which doesn't use `BUILDER_CONFIGS`. For an example, you can try running the test for lince: ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_real_dataset_lince` which yields > E TypeError: __init__() missing 3 required positional arguments: 'colnames', 'classes', and 'label_column'
43
test_load_real_dataset when config has BUILDER_CONFIGS that matter It a dataset has custom `BUILDER_CONFIGS` with non-keyword arguments (or keyword arguments with non default values), the config is not loaded during the test and causes an error. I think the problem is that `test_load_real_dataset` calls `load_dataset` with `data_dir=temp_data_dir` ([here](https://github.com/huggingface/nlp/blob/master/tests/test_dataset_common.py#L200)). This causes [this line](https://github.com/huggingface/nlp/blob/master/src/nlp/builder.py#L201) to always be false because `config_kwargs` is not `None`. [This line](https://github.com/huggingface/nlp/blob/master/src/nlp/builder.py#L222) will be run instead, which doesn't use `BUILDER_CONFIGS`. For an example, you can try running the test for lince: ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_real_dataset_lince` which yields > E TypeError: __init__() missing 3 required positional arguments: 'colnames', 'classes', and 'label_column' The `data_dir` parameter has been removed. Now the error is `ValueError: Config name is missing` As mentioned in #470 I think we can have one test with the first config of BUILDER_CONFIGS, and another test that runs all of the configs in BUILDER_CONFIGS
[ -0.2808130383, 0.0386489481, 0.016344171, 0.177721411, 0.0583329462, 0.2016590387, 0.0901040211, 0.3195053339, -0.1677363813, 0.0523617268, 0.0420731381, 0.3578430712, -0.1656035781, -0.0654392615, 0.1720554978, 0.0222492721, -0.3066467047, 0.3548322022, 0.1001124233, 0.1028403714, -0.1480748057, 0.1693323255, 0.0237269141, 0.0275578424, -0.1753005832, -0.0250487644, -0.2061966211, 0.3140675128, 0.2690217197, -0.5922116041, 0.4257381856, 0.1297423095, -0.1612461209, 0.1231281981, -0.0001130642, 0.1107811853, 0.2472268045, -0.1157407761, -0.5981780887, -0.137803331, 0.0640316457, -0.2330078632, 0.2686037123, -0.3578182757, -0.2629139423, -0.2691299915, -0.067139186, 0.0914063901, 0.1089664772, 0.3557494581, 0.223987028, 0.2617227435, -0.4300847352, -0.1137191802, -0.1765926927, -0.0511281341, 0.0575866625, 0.3311010897, 0.0536821894, 0.052656468, 0.1169042438, -0.1423465759, -0.0944503248, 0.1072169244, 0.0086368863, -0.0255862195, 0.0688418522, -0.0536701307, -0.0848880187, 0.2826161087, 0.1915073991, -0.4512465894, -0.0090724025, -0.3596469462, 0.2316243201, -0.0907499194, 0.3416332304, -0.1556083858, -0.4267597795, 0.0131682614, -0.4288161099, -0.2629849911, 0.1304964423, 0.092660524, 0.100929901, 0.0209594946, 0.0291007161, 0.2418983728, -0.0891792551, 0.1615595222, -0.1071039736, -0.3283275664, -0.1013362035, 0.0169519056, -0.0456779078, -0.292391032, 0.2084430307, 0.0993101895, 0.280890137, -0.0533517487, -0.03853954, -0.1233900636, 0.2437752336, 0.1774766147, -0.1193951219, 0.3732143044, 0.4342045188, 0.0592532046, 0.1818020493, -0.0008895433, -0.1197537184, 0.0659156069, 0.1539162546, -0.3203547001, -0.1054669768, -0.0126289073, 0.3360985518, -0.3401196301, -0.3468771875, -0.06126149, -0.0623001866, 0.109994337, 0.3181944788, 0.39670223, -0.005703357, -0.1252384186, -0.0159599055, 0.2539607882, -0.0674446002, -0.0837185755, -0.3294445872, -0.0484221131, -0.0665613338, 0.1366144568, 0.4345743954, -0.3286030591, 0.6601084471, 0.2206451446, 0.0609021783, 0.0424174517, 0.0439316742, -0.0425020345, -0.0450804904, 0.3762797415, -0.1378865242, 0.0346908309, 0.0766116679, -0.1368466765, -0.4026349187, 0.2292722613, -0.1443718374, -0.5251877308, 0.3482978344, 0.1790263802, -0.3709742725, 0.0275205448, 0.0139294434, 0.0734272674, 0.0692848414, -0.2042810917, -0.1741869152, -0.3507988453, 0.0237941723, -0.207262218, 0.2525059283, 0.3057612479, -0.1314181685, -0.2009168714, 0.1866977662, -0.099006325, 0.1171107963, -0.1723436862, -0.3042075932, 0.2274878472, -0.278994143, 0.0282067899, 0.6426600814, -0.3164251745, -0.0749777779, 0.3298939168, -0.0031586946, 0.1643637717, 0.0045767273, -0.0373653509, -0.2150313258, -0.1312566698, 0.0781562403, 0.2976286709, -0.0622223802, -0.0454831682, -0.3610288501, -0.1531262398, 0.1661149114, 0.0698525459, -0.2492712438, -0.0340181664, -0.2962560058, -0.0673038363, 0.2288821191, -0.0425870903, -0.2239331454, 0.0862082839, -0.0886951759, -0.1204979271, -0.0062595881, 0.1013943925, -0.6111181974, 0.461247474, 0.051044561, 0.1673365533, 0.1060815528, -0.0808744654, -0.2216367424, -0.0650239959, -0.2754855454, -0.3786343336, 0.1259014308, 0.4341851175, 0.1042220965, -0.208966732, -0.1609919816, -0.0981568843, -0.3174370229, -0.0375045352, -0.0407109633, 0.0693356842, -0.0057056886, -0.0255560502, -0.1366920173, 0.1385817379, 0.1388396919, -0.2931470573, -0.0865144059, 0.5086604953, -0.1005269736, -0.1135222912, 0.0670476556, -0.0492177866, 0.0144280326, -0.0268899836, -0.0401124433, 0.1391651034, -0.0228069238, -0.1525018513, 0.0116875833, 0.4082340896, 0.1521518379, 0.2619358301, -0.0039573633, -0.0580008328, 0.2521713972, -0.2402488887, -0.0883737653, -0.1512283981, 0.4394221008, 0.1059495881, 0.4570344388, 0.0323098041, -0.340921402, -0.0486270785, 0.2273120284, -0.0086176237, -0.1118606254, 0.1671788096, -0.1314899921, 0.0118461968, 0.0743677542, -0.0071036462, 0.6731563807, 0.193610996, 0.0327812992, 0.1103149131, -0.5834097862, -0.2602225244, 0.3016808629, -0.035758689, 0.2742646933, 0.1225181222, 0.203034088, -0.0732067525, -0.4160087407, -0.3327853978, 0.2195358425, 0.2261593193, -0.386954993, 0.1408003867, -0.0801017582, -0.0013912796, -0.2797282636, -0.3139403164, -0.0723810866, -0.3478247225, 0.21411933, -0.0890015215, -0.2131898254, 0.2064435184, -0.0489375442, 0.2271482199, -0.2309507132, -0.5881281495, -0.3020560145, -0.1458091885, -0.4142381251, 0.0414332077, 0.154094547, -0.0204575993, 0.2949225903, -0.1228465065, -0.5448803902, 0.1032906249, -0.3132395148, 0.2091281265, -0.0427241735, 0.7572257519, 0.3080533147, 0.1065724716, 0.4649312198, -0.2761747241, 0.4519261122, 0.121988602, -0.1166917831, 0.2048783749, 0.1077318415, -0.0862265751, -0.3488540947, -0.4813725948, -0.0115975998, -0.2266956419, -0.1176697835, 0.1248537824, 0.1642355025, 0.446490258, 0.1673844159, 0.2023619711, -0.1938330531, 0.4660235345, -0.07983464, -0.194910109, -0.1284495741, -0.0745197535, -0.1809366047, -0.3876856863, -0.1372405738, 0.3511225283, -0.1121398881, -0.4986841679, -0.2527987957, -0.1208138019, 0.4919119775, -0.2137343884, -0.2025672644, 0.2597002387, 0.3100272715, -0.0842042714, -0.1884578317, 0.0413898267, 0.2889184356, 0.111712195, 0.2339571565, 0.002711829, 0.2264723331, -0.1682233065, 0.3377183378, 0.3033349514, -0.2950262129, 0.1454983056, -0.2538926899, 0.2515290678, -0.1826419979, -0.3044294119, 0.1686679572, 0.1307937056, -0.161576435, 0.3201491237, -0.1414805502, -0.044293806, -0.1323333532, 0.0162522625, 0.0394279212, -0.14944534, 0.22985816, -0.1908070147, 0.0086013526, 0.0478126593, 0.0411838181, -0.0809966773, 0.0466444865, 0.042565804, 0.268278718, -0.0543798432, -0.0927185714, -0.2088309228, -0.3003646731, -0.4212276936, 0.1644625366, -0.0991443098, 0.3014187515, -0.046743352, -0.026560653, 0.1795352697, 0.0005330089, 0.4785407782, -0.0032719106, 0.1700182706, 0.4871149659, 0.0659950152, -0.3755955696, -0.1330590993, -0.2954859138, 0.1635186821, 0.3788218498, 0.660426259, -0.3550488353, -0.4132327139, 0.0995788127, 0.4210103452, -0.1064962521, -0.3035878837, -0.2665136755, -0.3496366441, -0.1467335969, 0.0701798648, -0.3176822066, 0.3553072512, -0.3038994968, 0.0568313636, -0.0653929859, -0.0897990614, 0.0434087589, 0.3618538082, 0.2549633682, -0.1290691495, 0.2132922858, 0.0077912877, 0.1998327076, 0.0466913655, 0.4059339166, -0.0683814138, 0.2832717299, -0.0779440999, 0.1865793467, 0.5016235709, 0.277615428, -0.124176614, -0.0561816655, -0.3990891576, 0.1736406684, -0.2655556798, 0.2824917436, 0.3087878823, 0.0439317562, 0.0081726834, -0.2562390566, 0.5897768736, -0.026384484, -0.2228999138, 0.4522735775, -0.0937403813, -0.4636977017, 0.3889219463, -0.0300230086, 0.7602947354, 0.3173416853, 0.2274958193, 0.6086382866, 0.2118724734, 0.1707529277, 0.1247127578, 0.1548671275, -0.2730986476, -0.0845779851, 0.2797226906, -0.1793150604, 0.1964718252, 0.2276956588, -0.2754840553, 0.283762157, -0.0638539568, -0.0449193195, 0.1381046176, 0.2204245925, -0.0480705127, -0.0373603962, -0.4018092155, 0.1581184715, 0.0321191214, 0.2868533432, 0.0300636552, 0.0530520715, 0.0524241775, -0.2552850842, 0.0507867821, 0.1388698369, -0.3315856159, -0.0008887546, 0.1234660894, -0.1947836578, 0.0131059028, 0.1538494676, 0.1285512149, 0.2766212821, -0.1290292591, 0.1358105093, 0.0137005616, 0.1033773571, 0.183908686, -0.0896473899, 0.2951234579, -0.170401454, -0.296497792, 0.0602014884, -0.3801344633, -0.0585324876, 0.2786421776, -0.1615184695, -0.0661647245, -0.3292330205, -0.3309012651, 0.0869206861, 0.1180756092, -0.2144933492, 0.1362000108, -0.0282537416, -0.3646183908, 0.1135281846, -0.076754339, -0.3893275559, -0.0756364912, -0.1069439575, 0.0940750912, 0.2095005363, 0.6270084381, -0.3351728022, 0.2477502227, -0.161822781, 0.0379429981, 0.151200518, -0.1700678021, 0.1599759907, 0.220109418, -0.2147942036, 0.0113862483, 0.4493312836, 0.131052956, 0.1979991794, -0.151999414, -0.2812594175, -0.1871856749, 0.0357021764, 0.223261714, 0.3144433796, -0.0407342501, 0.5240077972, -0.0977954119, 0.2896997929, -0.3693550527, -0.0361140855, -0.4362348914, 0.3607876897, -0.0845117569, 0.2169929743, 0.2612894773, 0.1414244771, 0.1556662917, -0.2430791706, -0.0575822704, -0.2900199294, -0.1918908656, 0.1262518913, 0.044553604, 0.1527553946, 0.0073164692, -0.1333145499, 0.1083944961, -0.1033811867, 0.138195008, -0.3329190612, -0.0064256601, 0.2893797755, 0.247606501, 0.1590153277, -0.0521150008, 0.216599077, -0.2068293691, -0.0528035536, -0.0547470041, 0.2293615341, -0.4055796862, -0.1391331255, -0.0639211684, 0.0480664894, -0.2943246067, 0.1606636345, -0.1572329104, 0.0150284283, 0.0451960601, 0.0703843683, 0.2515389323, 0.502448082, -0.0749000832, 0.056422215, 0.1374616921, 0.230128184, -0.360368371, -0.0501319952, 0.0565459132, -0.1226828769, 0.3516516089, 0.1919917166, 0.1136413738, -0.0524164438, 0.2114170939, -0.1112443507, 0.1173504516, -0.1513702571, -0.0625122264, 0.3782611489, -0.1077269241, 0.137743324, 0.2817501426, -0.0336466618, 0.1510793269, 0.0711002201, -0.2178885937, 0.3636242449, 0.002112075, -0.1638923585, 0.199293375, -0.1242937669, 0.4478605986, 0.0578690283, 0.0850247666, -0.115218237, -0.1663118154, 0.5778755546, -0.5218058228, -0.253731519, -0.0446055941, 0.1963033229, -0.1504122466, -0.2721489966, -0.4087147415, -0.1099319085, 0.0089785466, -0.1395119429, -0.0893712118, -0.2711936235, 0.0749694929, -0.0390521213, -0.1797076613, -0.412612617, -0.0326083861, 0.3341912925, -0.0930390507, -0.1596975625, 0.4812886119, 0.2137867063, -0.0185973458, 0.0896016583, 0.4621694088, 0.5086622834, 0.1307403892, -0.0780736357, -0.188677609, -0.0380980521, 0.0525453724, -0.2050904036, 0.1065385416, 0.0240305085, -0.2988905609, 0.4634023309, 0.2007216662, -0.1836307198, -0.1176312044, 0.1081550047, -0.1675928235, -0.1707925946, 0.5300662518, 0.1958311647, -0.0978411138, -0.0381046422, 0.1672280431, -0.2096354216, 0.0716116056, 0.4497458935, 0.1866223365, 0.1008021086, 0.1261886954, 0.1134095564, -0.1322555393, 0.5245951414, 0.0897296742, -0.0436541699, -0.5897711515, -0.163548246, -0.6522302032, 0.159101367, -0.02948194, -0.2246661782, 0.29346174, 0.0248233993, 0.2001623511, -0.0379633829, -0.1583324671, 0.2733852863, 0.3098798096, -0.1415097564, -0.3142862022, -0.235601142, -0.2642752528, -0.0255268943, 0.0640598908, -0.2706089318, 0.0211013295, -0.1963489354, 0.049455896, 0.1104650572, 0.114559561, 0.5461165905, 0.1187743545, 0.2451622337, -0.005592593, 0.509860754, 0.0337562636, -0.1479349136, -0.0083979657, -0.1826662719, -0.1600972861, -0.1034494713, -0.093094565, 0.0018281864, -0.1612288207, 0.1169152334, -0.2332955599, 0.0622344017, 0.1686072201, -0.2084345222, 0.103831239, 0.1084461883, -0.160090968, 0.2272065431, 0.2255658507, 0.4649651349, -0.1066592112, 0.1099358276, -0.3157239258, -0.3565710783, 0.7502678037, -0.1635052115, -0.201615274, -0.0326657407, 0.1670454144, -0.1902439445, 0.0705954358, -0.3250295222, -0.2004294842, 0.4116538167, -0.1168965995, -0.2372825295, 0.3358037472, 0.1896928698, 0.0820228159, 0.0655163676, 0.3776126504, 0.0757653192, -0.2050294727, -0.1730704457, -0.3017947674 ]
https://github.com/huggingface/datasets/issues/474
test_load_real_dataset when config has BUILDER_CONFIGS that matter
This was fixed in #527 Closing this one, but feel free to re-open if you have other questions
It a dataset has custom `BUILDER_CONFIGS` with non-keyword arguments (or keyword arguments with non default values), the config is not loaded during the test and causes an error. I think the problem is that `test_load_real_dataset` calls `load_dataset` with `data_dir=temp_data_dir` ([here](https://github.com/huggingface/nlp/blob/master/tests/test_dataset_common.py#L200)). This causes [this line](https://github.com/huggingface/nlp/blob/master/src/nlp/builder.py#L201) to always be false because `config_kwargs` is not `None`. [This line](https://github.com/huggingface/nlp/blob/master/src/nlp/builder.py#L222) will be run instead, which doesn't use `BUILDER_CONFIGS`. For an example, you can try running the test for lince: ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_real_dataset_lince` which yields > E TypeError: __init__() missing 3 required positional arguments: 'colnames', 'classes', and 'label_column'
18
test_load_real_dataset when config has BUILDER_CONFIGS that matter It a dataset has custom `BUILDER_CONFIGS` with non-keyword arguments (or keyword arguments with non default values), the config is not loaded during the test and causes an error. I think the problem is that `test_load_real_dataset` calls `load_dataset` with `data_dir=temp_data_dir` ([here](https://github.com/huggingface/nlp/blob/master/tests/test_dataset_common.py#L200)). This causes [this line](https://github.com/huggingface/nlp/blob/master/src/nlp/builder.py#L201) to always be false because `config_kwargs` is not `None`. [This line](https://github.com/huggingface/nlp/blob/master/src/nlp/builder.py#L222) will be run instead, which doesn't use `BUILDER_CONFIGS`. For an example, you can try running the test for lince: ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_real_dataset_lince` which yields > E TypeError: __init__() missing 3 required positional arguments: 'colnames', 'classes', and 'label_column' This was fixed in #527 Closing this one, but feel free to re-open if you have other questions
[ -0.3385565877, -0.0536471941, 0.0424277671, 0.1108631045, 0.1634407192, 0.0783362165, 0.1228832826, 0.3306729794, -0.0973315164, -0.004030101, 0.0537731238, 0.4402482212, -0.1571186632, 0.0414613001, 0.1643653959, 0.0443917476, -0.2682583928, 0.2769704759, 0.0980252773, -0.0319092646, -0.1879015565, 0.1579579115, -0.097307317, 0.0949116498, -0.2986761034, 0.0340306908, -0.1379250139, 0.2986700833, 0.1990149021, -0.5106949806, 0.4461773038, 0.0938679576, -0.085957773, 0.1431891322, -0.0001083159, 0.0801487118, 0.3250585794, -0.0839208141, -0.6371141076, -0.0625697002, 0.1405448765, -0.2929130793, 0.2855111361, -0.3282709718, -0.3212665319, -0.2411283851, -0.1270383447, 0.07364849, 0.0725034326, 0.3807226419, 0.2747091353, 0.3636159003, -0.2297531068, -0.1485882252, -0.1620924473, -0.0258873347, -0.0437101386, 0.3394280076, 0.1688622236, 0.0183411334, 0.0527105592, -0.1217421815, -0.0641048178, 0.0916210115, 0.049526982, -0.1177207232, -0.0773682073, -0.0686179325, -0.0201734044, 0.2787656188, 0.2818545699, -0.432942301, -0.0211794898, -0.2513440549, 0.1684997529, -0.1498255432, 0.3519794643, -0.0812687948, -0.4076192677, 0.0426624194, -0.4676843584, -0.1900425851, 0.0658132061, 0.110430181, 0.0950842425, -0.0414985046, -0.0108465655, 0.2007041723, 0.0036651643, 0.1042255089, -0.1386706531, -0.1761006862, -0.1310177892, 0.1279080659, -0.1391437501, -0.3100567758, 0.2468242496, 0.2167615294, 0.2853586376, 0.0043459823, -0.0273895152, 0.0024011901, 0.2310733646, 0.2241037935, -0.1374671012, 0.3698547781, 0.3622439504, -0.011629466, 0.1981759667, 0.010260745, -0.1906316578, 0.0484404564, 0.1153857633, -0.3490094841, -0.0083672982, -0.0628785565, 0.2651873231, -0.4105988145, -0.3491708934, 0.0293947048, -0.0557916574, 0.1655777544, 0.3375841081, 0.4199338257, -0.0324665606, -0.1970600784, 0.0237552337, 0.3201876283, -0.1912798434, -0.1085970923, -0.3206711411, -0.0218135547, -0.1324211061, 0.0523714982, 0.4688153267, -0.2727923393, 0.6226428151, 0.1460935622, 0.0216840915, 0.0165439397, 0.0746404603, -0.0024731997, -0.0568614453, 0.3785867989, -0.1605928987, -0.0764330626, 0.2329166681, -0.1536599696, -0.3517065048, 0.2044932395, -0.0884959549, -0.5394569039, 0.2401413471, 0.2285761386, -0.302927196, -0.0736226514, 0.0094516398, 0.0187686235, 0.0577060357, -0.125918299, -0.110471867, -0.391974926, 0.0619842708, -0.1528331637, 0.2685031891, 0.2812787294, -0.1850990802, -0.1322149932, 0.1188691407, -0.1435099542, 0.1952686608, -0.0970528647, -0.2381483465, 0.1500054002, -0.1737827957, 0.1072411016, 0.5219542384, -0.2305839062, -0.1180211529, 0.2901420593, -0.0084157055, 0.0573636666, -0.1372816265, 0.0773707554, -0.1516710967, -0.0373836011, 0.0596372597, 0.3409300745, 0.0408537611, 0.0341272391, -0.4409684837, -0.1354337931, 0.1570860595, 0.1454817951, -0.3463738561, -0.0475002527, -0.1469413191, -0.0601770692, 0.1990850568, -0.0826977417, -0.2510529757, 0.0619648173, 0.0419992208, -0.0967453048, 0.0421941876, 0.0955779701, -0.5564900637, 0.4191556871, 0.0833569616, 0.2934089601, 0.1581555307, -0.0835639387, -0.2718796432, 0.0456510298, -0.2793190479, -0.3855574131, 0.1636401564, 0.2197533995, 0.1555462033, -0.1151790321, -0.1425244659, -0.0953571871, -0.3342648447, 0.010868012, -0.0560784377, 0.0678905621, -0.0168091636, -0.0625690296, -0.0748564824, 0.2662243843, 0.1372030973, -0.2954993844, -0.2036427408, 0.4747344255, 0.0138570564, -0.0961079597, 0.1071805209, -0.0413775444, -0.071947217, -0.0976848602, 0.0078975623, 0.1678725034, -0.0173537098, -0.1123137251, -0.0462837778, 0.3852531314, 0.1947694421, 0.1741728634, -0.0817502141, 0.0258382298, 0.3416345716, -0.1674986929, -0.0014198819, -0.1094361618, 0.4954265356, 0.1282525361, 0.4595437944, 0.0573719889, -0.3472213745, 0.0108897509, 0.2799539566, 0.014718743, -0.0306053627, 0.3178577423, -0.1561895013, -0.0745469034, 0.1391989589, -0.0617591031, 0.5611633658, 0.1805538386, -0.0291946232, 0.1363345981, -0.6024135947, -0.2829419971, 0.337574333, -0.1507920325, 0.2357174754, 0.0174276214, 0.179516539, -0.1059577465, -0.5612170696, -0.2691088021, 0.0600527562, 0.3444688022, -0.3191834688, 0.1042441279, -0.1219017506, 0.0684501156, -0.1120395437, -0.2230797857, -0.1525084972, -0.3797399998, 0.2066000849, 0.0192588158, -0.0720105767, 0.2248983085, -0.0645213053, 0.2702754736, -0.1633851826, -0.5609415174, -0.3093767464, -0.2441607565, -0.5122615099, 0.0824073032, 0.1711143553, -0.0119702891, 0.3132202625, -0.0825489536, -0.3603591025, 0.1028654501, -0.3295372427, 0.1290486306, -0.090054512, 0.7290683389, 0.2706765234, 0.1940114796, 0.3838450909, -0.1142289862, 0.5275811553, 0.0100329164, -0.1275106817, 0.2818480134, 0.155006513, -0.1615920812, -0.3950866759, -0.460339874, -0.0449559726, -0.251778841, 0.0392458923, 0.1456490904, 0.0847622752, 0.4176311791, 0.2565795183, 0.2545309663, -0.105937019, 0.3779492974, -0.1628268063, -0.2203240395, -0.0969337001, -0.0557349063, -0.3735413849, -0.306604445, -0.0991490111, 0.3467928171, -0.112531051, -0.480319798, -0.2475798577, -0.2052383125, 0.4086895585, -0.0434771143, -0.2014959455, 0.2554351985, 0.2472824156, -0.1151553094, -0.1670492589, 0.0405258909, 0.2664712667, 0.0364575647, 0.1248782799, -0.0117562953, 0.3133136928, -0.1855171323, 0.2949366868, 0.2942862213, -0.339487046, 0.2867260873, -0.2529632449, 0.3277392983, -0.2344419211, -0.3229251504, 0.2463135272, 0.0871210545, -0.1973432451, 0.2904694974, -0.0703135729, -0.1744454801, -0.1309031397, 0.0823341087, 0.0625957325, -0.145800367, 0.1759448051, -0.05434471, 0.027657304, 0.0180720277, 0.1418782324, -0.0979137421, -0.0989706069, 0.0257285815, 0.2842673063, -0.0789643303, -0.1229357049, -0.256139636, -0.3128243089, -0.466794759, 0.2327459902, -0.1251157522, 0.3888896406, -0.1696742475, -0.0531122684, 0.1999862492, -0.0648230687, 0.466189146, -0.0625411421, 0.1752842218, 0.4553384483, 0.0648051798, -0.4149451256, -0.0980448797, -0.3053011298, 0.1492467672, 0.3097379506, 0.6342875957, -0.2931165695, -0.3505548835, 0.0878178552, 0.3865185678, -0.0853344873, -0.2622835636, -0.2818941772, -0.3366249204, -0.1886927783, 0.151834175, -0.3122464418, 0.3926034868, -0.3093532324, 0.0417597853, -0.0965660512, -0.0768506452, 0.074612394, 0.4339574873, 0.2132891566, -0.1293459088, 0.1532240361, -0.050241977, 0.166006431, 0.0519776493, 0.3848620653, -0.0900924504, 0.2654479444, -0.124342829, 0.0878726691, 0.4876844883, 0.2203257978, -0.1677976549, -0.1108475924, -0.38512519, 0.2015219331, -0.3323498368, 0.214759022, 0.3390146792, 0.1325270683, 0.0496403985, -0.2370405644, 0.5995283127, -0.025544107, -0.1007100567, 0.3754692078, -0.0649460107, -0.3394944072, 0.3482226133, 0.0802408457, 0.7891095877, 0.2262749374, 0.2127136886, 0.6046995521, 0.2290664911, 0.1493355781, 0.0640858635, 0.1478568912, -0.3400284052, -0.0823623538, 0.2297731787, -0.1954123229, 0.2035365552, 0.1853273511, -0.2958571613, 0.1574375778, -0.115438886, -0.1364897192, 0.1325164884, 0.255771637, -0.0615237728, -0.0725662038, -0.3598593175, 0.2513635159, 0.0307872519, 0.3629925251, 0.0453267694, 0.0642539859, 0.0008846275, -0.2537644207, -0.0929716006, 0.1888665706, -0.2171535045, -0.017451236, 0.1472253501, -0.1967604309, 0.0516494773, 0.0782266632, 0.1751748621, 0.2904870808, -0.1754976064, 0.0524092205, 0.0459549949, 0.0707390532, 0.2827409506, 0.0073891641, 0.3172932267, -0.1767941117, -0.2712946832, 0.0527040549, -0.3210824132, -0.0509176217, 0.2848851085, -0.2373486757, -0.0367349796, -0.3911944926, -0.3904462159, -0.0422726534, -0.0068268739, -0.1889246851, 0.1713586152, 0.0257087834, -0.2460058033, 0.1252577901, 0.0336853601, -0.3654952943, -0.0639908165, -0.0301251747, 0.0257305615, 0.2625960112, 0.6146236658, -0.2057127655, 0.1340371221, -0.2302793562, 0.0249841847, 0.1805561036, -0.2168994099, 0.1104893312, 0.2585725784, -0.2201315165, 0.0646211281, 0.4208986759, 0.0896683037, 0.1069261879, -0.1108948439, -0.3891230226, -0.2301582545, 0.0464073718, 0.1363066435, 0.3031692803, -0.054846853, 0.5074742436, 0.0490082949, 0.1555227935, -0.4011348486, -0.0861841142, -0.4393156171, 0.2175885588, -0.0180102885, 0.1239897981, 0.258036077, 0.0669382885, 0.1721223146, -0.1851349324, -0.1733320504, -0.330958575, -0.2168247104, 0.0949628577, 0.1097595468, 0.0917482227, -0.0415182486, -0.1717206836, -0.0249397866, -0.1845978498, -0.0612858087, -0.3775549531, -0.0767605826, 0.2772756219, 0.2682211995, 0.1808110476, -0.0327036195, 0.1179181635, -0.1616003662, -0.0552701689, -0.1441788524, 0.0326437615, -0.3144248724, -0.1329373866, -0.1057780534, 0.0905717984, -0.2027167678, 0.1687096804, -0.064882867, 0.0053158705, 0.0613965988, 0.0235370882, 0.2797965407, 0.4092742503, -0.0631124005, -0.0312698074, 0.2344025671, 0.2600902617, -0.4162309468, -0.0071462891, 0.1063612923, -0.0779237822, 0.3318059444, 0.1322983056, 0.0769865438, -0.0115644149, 0.1614896953, -0.0746059567, 0.1683527678, -0.2032974511, -0.1042966545, 0.3018100262, -0.1390677392, 0.1760899127, 0.3138337135, -0.0177443232, 0.1356626302, 0.125577569, -0.1194800362, 0.3516345918, 0.0769031048, -0.0118930908, 0.0888275877, -0.1562255472, 0.4014151096, 0.0090338476, 0.1210858002, -0.0861210078, -0.1869276166, 0.6330310106, -0.570055902, -0.2774117291, -0.1221754923, 0.187773332, -0.2250173539, -0.166167438, -0.3115476668, -0.0710882545, -0.0374415964, -0.1971277297, -0.0877315775, -0.1883589327, 0.0391740501, -0.0581152104, -0.0882003158, -0.4211506844, -0.1079904959, 0.3032978475, -0.0499657243, -0.0625260025, 0.4666861296, 0.090762794, 0.0665530041, 0.0129101062, 0.4504224956, 0.5012670755, 0.221795857, -0.1015418321, -0.1400889158, -0.1586228609, 0.0515247956, -0.1498552263, 0.2292055637, 0.0469562002, -0.2733749747, 0.4103941321, 0.2153733969, -0.201212123, -0.1290589571, 0.0607397892, -0.0885229409, -0.1209944561, 0.4698432386, 0.2086049169, -0.1601245999, -0.1643498689, 0.0871338472, -0.2041849345, 0.1490509063, 0.4095193446, 0.1968951076, 0.1260687262, -0.0518324412, 0.1399005055, -0.0844634026, 0.6105012894, 0.1193030477, -0.0350405723, -0.5040112734, -0.1553126425, -0.7108896971, 0.1991672814, -0.1437133998, -0.3385181427, 0.264885366, -0.0615066215, 0.201003775, -0.0105594266, -0.1847459376, 0.2963285148, 0.2760753036, -0.1557746828, -0.2949589789, -0.1401153952, -0.2625838816, -0.0780638903, 0.031190468, -0.3317849636, 0.058618769, -0.2389076501, 0.093971841, 0.0648317486, 0.0764859989, 0.4212227464, 0.2143618762, 0.164171055, -0.0429041237, 0.4837388694, 0.0438735001, -0.0726621971, -0.0829005316, -0.2332598865, -0.1337160915, -0.0350035541, -0.1012425497, -0.0198263414, -0.0553850681, 0.0709222406, -0.3084035218, 0.1950899512, 0.1493376493, -0.2064779699, 0.0872711241, 0.1054443941, -0.1367052048, 0.1768000424, 0.2128746361, 0.4557380974, -0.1234279945, 0.1840361357, -0.2646230161, -0.4019246101, 0.748621285, -0.2990205586, -0.1954525262, 0.0654032081, 0.1390288472, -0.1361293942, -0.023207115, -0.2310412228, -0.1156561747, 0.3482370079, -0.1259848028, -0.1509615332, 0.3325614929, 0.1050183102, 0.0815670639, 0.0588988438, 0.4525281489, 0.0271409508, -0.0806579813, -0.11146871, -0.2522570789 ]
https://github.com/huggingface/datasets/issues/469
invalid data type 'str' at _convert_outputs in arrow_dataset.py
Hi ! Did you try to set the output format to pytorch ? (or tensorflow if you're using tensorflow) It can be done with `dataset.set_format("torch", columns=columns)` (or "tensorflow"). Note that for pytorch, string columns can't be converted to `torch.Tensor`, so you have to specify in `columns=` the list of columns you want to keep (`input_ids` for example)
I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str'
57
invalid data type 'str' at _convert_outputs in arrow_dataset.py I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' Hi ! Did you try to set the output format to pytorch ? (or tensorflow if you're using tensorflow) It can be done with `dataset.set_format("torch", columns=columns)` (or "tensorflow"). Note that for pytorch, string columns can't be converted to `torch.Tensor`, so you have to specify in `columns=` the list of columns you want to keep (`input_ids` for example)
[ -0.2228240967, 0.0242495593, 0.1073714495, 0.2303073108, 0.5109527707, -0.107259661, 0.5323301554, 0.0775898322, -0.3410616815, -0.1247762293, 0.0366579518, 0.3864071369, -0.3696955442, 0.0422176197, 0.0443615951, -0.2024639249, -0.0880346149, 0.0099900309, -0.0232526455, -0.0536391288, 0.0482433699, 0.1829805076, -0.1568262279, 0.4144770503, -0.6451315284, -0.1835789531, 0.1746634543, -0.0963928774, -0.0992208868, -0.4487784207, 0.2202741653, -0.1020441726, 0.4976369739, 0.347232163, -0.0001241712, 0.1380355507, 0.1092859805, 0.101694718, -0.2908718586, -0.3016373515, 0.1341148466, -0.0593845211, 0.4149941206, -0.2015387118, -0.057189513, -0.260091424, -0.0606259182, 0.2617688477, 0.3837755322, 0.5016982555, 0.1173221469, 0.1685163528, 0.2464855909, 0.0738127902, 0.2595638037, 0.3155061305, 0.0754770562, 0.2071240097, 0.0168338399, 0.0266054049, -0.0856947824, 0.0748079345, -0.0701287016, -0.1997739971, 0.216658473, 0.2272826284, 0.1745792627, -0.1476222873, -0.2287846357, 0.1198839471, 0.4332153499, -0.321425736, -0.1559450477, 0.0079212999, -0.0111622857, -0.2727993727, -0.0061669433, 0.2483309209, -0.4277769327, 0.1667016149, -0.162260443, -0.0254668761, -0.3792497218, 0.1995562017, -0.0925178155, 0.5032639503, 0.1183699816, 0.1568169445, 0.1842403114, -0.0144357681, 0.3717097938, 0.0876382515, 0.1397548169, 0.06214853, -0.311694026, -0.030463824, -0.4463339746, -0.648362875, -0.2685148716, -0.2125238627, 0.1655775011, -0.0711524189, 0.2047270238, 0.202950567, 0.233322382, 0.13880077, -0.2101231515, 0.564838469, 0.1000926644, -0.1552505344, -0.1335455775, -0.0250886362, -0.3282390237, -0.0922894478, 0.5121243, 0.1628403366, 0.1257425994, -0.0050322264, -0.0550226159, -0.1488327384, -0.2688643336, -0.0882174447, 0.2847146392, 0.1850693822, 0.0958356559, 0.3832220137, 0.2154192775, 0.1111361384, 0.0493784472, -0.1352440417, 0.0353223011, 0.0855560899, -0.2179708481, -0.1198173016, 0.1821130514, 0.3281979263, -0.2699040771, 0.1215014234, -0.1425368637, -0.2085366696, 0.0015719655, -0.2935897708, -0.0053074392, 0.0134969745, -0.2574836612, 0.309787482, 0.0935745165, -0.3035939038, 0.0196344461, 0.4677719772, -0.4638136625, -0.4341676533, -0.4358196259, 0.0899602696, 0.370847553, -0.1129873395, -0.0923097357, 0.0597353019, 0.4520862997, -0.1888258755, 0.1029472351, -0.5797595978, 0.3521026075, -0.015292665, -0.0832997561, 0.0905466452, -0.4035288393, -0.1816477329, 0.1696707755, -0.1533035189, 0.3111131489, 0.4423997104, -0.3827601373, 0.2947914302, 0.0795271546, 0.016693132, 0.8023686409, -0.3571898043, -0.2179585248, 0.1322550774, -0.1704490185, -0.3259193003, -0.0770722032, 0.2736979127, 0.0906305611, 0.0717986152, -0.0094028264, 0.3914261162, -0.0933150947, 0.2531608939, -0.3342477083, -0.0749925748, 0.3700164855, 0.332087785, 0.2507387102, -0.0335380211, 0.0665315241, 0.3422167003, 0.2596167624, -0.1454963237, 0.2384004742, 0.1618343741, 0.0183554348, -0.1759247929, -0.1052250415, -0.1606464088, -0.3050884902, -0.2020209879, -0.3353255689, 0.4843746722, -0.2394972742, 0.0809494555, -0.1629108638, -0.0729376823, -0.1123220474, 0.2390535921, 0.1080782861, 0.0814390555, -0.1436552405, -0.0689879879, -0.1000486612, -0.0618883967, -0.0523721911, 0.1880999804, 0.0251374617, 0.2732269466, -0.1691004038, -0.1986373365, -0.2601748109, 0.0564329736, 0.255816102, 0.0960626602, -0.2582112551, 0.2561085522, -0.1447918862, -0.258123368, -0.3088115454, 0.3103089333, 0.1554097831, -0.5250988603, 0.0369421802, 0.1614517868, 0.1663212478, -0.0896119177, 0.1419674754, 0.1363631189, 0.0686426386, 0.1380072683, -0.0040353239, 0.3693377674, 0.2155337334, -0.0409566015, 0.2696604729, 0.0495532975, -0.1201176196, -0.1636267453, 0.1193024367, 0.0317244008, -0.2905443609, -0.019627478, 0.4356474876, -0.1525556892, 0.2414224893, 0.4414304793, -0.1187741607, -0.0253545027, -0.1871618032, 0.2185590863, 0.1407993585, -0.0268118996, -0.0851378664, -0.0053835795, -0.253885448, -0.0652511939, 0.3296321929, -0.1268231571, 0.4315136671, 0.1532037109, 0.2892072201, -0.0184705388, -0.0514068864, -0.2919020653, 0.2905477285, 0.2543338239, -0.2341016978, 0.4157404602, -0.102525115, -0.2135274261, -0.6377745271, -0.3706789315, -0.083739467, -0.1330628395, -0.0448595658, -0.0630306453, 0.1643535346, 0.0614361838, 0.0771601498, -0.0667611584, 0.2787643373, -0.1845622808, 0.1062297896, -0.3318831027, -0.399028182, -0.0193081778, 0.2381193638, 0.018272955, -0.1148813814, 0.0174304564, -0.0464679375, -0.0756028444, -0.1490139663, 0.1128376052, -0.0141114593, -0.1526149064, 0.1377332211, -0.0253320429, -0.2624070346, -0.2278357893, 0.3238838911, -0.3288732767, 0.00455443, 0.4567358494, -0.1896834821, -0.0553342476, -0.0512935594, -0.3140721321, -0.5814597011, -0.053909909, 0.0172907468, 0.0343013927, 0.3296329379, 0.3480424881, 0.0307738055, 0.1842595041, 0.0340056829, -0.0597994253, 0.0854179114, 0.1192032844, 0.3146254122, -0.0384520106, -0.2886622548, -0.3471455276, -0.1107912883, 0.0709792227, 0.0762150213, -0.3193143606, 0.1262017339, -0.1260371804, 0.0512027368, -0.2906245887, 0.022035012, 0.448099494, 0.1102448925, -0.0087919021, 0.2124653757, 0.0139714107, 0.3060881495, 0.0416651256, 0.2144848853, -0.0346942768, 0.1787260622, -0.0456409007, 0.6495578289, -0.1418002844, -0.3859344423, 0.1767012626, -0.1262177378, -0.1793364286, -0.0094062882, -0.300276041, -0.0031255512, -0.258731544, -0.0353838615, 0.0021559882, -0.2854908407, -0.3254141212, -0.181138292, 0.1342675388, -0.1632560492, -0.3281489909, 0.3672780395, -0.2507418692, 0.2550689876, -0.1565137953, -0.1447719485, -0.1669238061, -0.436498642, -0.0302335601, 0.1978235096, -0.2999421656, 0.0271619819, -0.5152035952, -0.2360683233, -0.1595629305, 0.0845981091, 0.3666799366, 0.5396201611, 0.0303008333, 0.0349532515, 0.0805859417, 0.1010699868, 0.410641551, 0.1839824021, -0.0750320852, 0.1855863333, 0.1655877233, -0.3579365611, -0.2835208774, -0.5400992632, -0.0822041854, 0.2528800368, 0.0967265815, -0.2896075845, -0.2426506281, 0.222534433, 0.041428905, -0.2890587747, -0.0435759686, 0.017208742, -0.2311727703, -0.2042599767, 0.1062255129, 0.2091032714, 0.3887907565, -0.2306032032, -0.1089196429, 0.0180642717, 0.206056267, 0.1758809835, -0.0173784588, 0.1210727915, -0.1272637397, -0.2719095051, -0.2843089998, 0.2212006599, 0.1246747747, 0.4509958327, 0.1175307557, -0.3715091646, 0.1879757941, -0.0572563782, 0.3409126997, 0.0074070278, -0.1104090735, 0.3472833931, 0.1715256125, 0.317676574, 0.099358514, -0.0289536454, 0.2658731043, -0.077132225, -0.4949769676, -0.0418627784, 0.2745335102, -0.0730240569, -0.0733688399, -0.0241514351, -0.209479019, -0.2615413368, 0.4185968041, 0.3421196938, 1.0206485987, -0.2603802681, 0.3446718752, 0.1092102453, -0.0606014766, 0.4950569868, -0.1539971679, 0.1934899688, -0.5524519682, 0.0472405031, -0.111691542, -0.1971726269, -0.1783651859, 0.3437052965, -0.3830962181, 0.1329992712, -0.0964831635, 0.1960598826, 0.142227605, 0.3196293116, 0.2093945146, -0.2090148926, -0.2368240058, -0.003560581, -0.4814990759, -0.0990893394, -0.0379735306, -0.2874807715, -0.0001370848, -0.3918531239, -0.2000367343, 0.1904891282, -0.2922777534, 0.3384349942, 0.5059809685, -0.106443271, 0.2228135914, 0.1987269074, 0.3068523705, -0.0456336513, 0.0611891039, -0.2703240514, -0.062603958, 0.1166032478, -0.057285022, -0.0534288548, 0.4100271761, -0.0476828478, -0.3138557374, 0.3178366721, 0.0144370897, -0.1757710427, 0.1572690457, -0.0672014579, 0.0875043496, -0.4117053449, 0.2714479566, -0.218857348, -0.3185108304, -0.2686833441, 0.0039162659, 0.0189208351, -0.1227039397, 0.1043700799, 0.3181699812, 0.0148006864, 0.142925337, 0.1666362137, 0.2979537845, 0.2228276283, 0.5636557341, 0.3159724772, 0.0117536075, -0.2083150893, 0.1311720014, 0.0069091055, -0.883816421, 0.1976178139, -0.031380333, -0.2637524903, 0.212391451, 0.3753278255, 0.1270442903, 0.4987854958, -0.1740798354, -0.4247025847, -0.3973775506, 0.0065998165, 0.1742636859, 0.0011970839, 0.0514225662, 0.5306838751, 0.1982194185, 0.1547176242, -0.2049757838, 0.1831800342, -0.339990586, 0.2554390132, -0.1108252928, -0.4195619226, -0.038152203, 0.1254321933, 0.043873366, 0.0017528143, 0.0914920568, -0.0549669676, -0.1826649904, 0.1793142706, 0.2735619843, -0.2096079886, -0.2047401369, -0.0046511758, -0.0219299346, 0.1029740274, -0.0729961321, 0.0078970259, -0.1585483551, 0.5496967435, -0.096837081, -0.0782950968, -0.3212502003, 0.03207146, -0.232945919, -0.0552971028, 0.1789359003, 0.2310498953, 0.1414342225, -0.1671891659, -0.7330245376, 0.1469235271, 0.2807040811, -0.0789484456, 0.2824500799, -0.6361714005, -0.2515560091, -0.1240688637, 0.0589366928, 0.0178229548, -0.2906438112, -0.1190242171, 0.1500849873, 0.0792079121, -0.2228346616, -0.2199817002, -0.0071267961, -0.1568066776, -0.1895319521, 0.438834101, 0.0504116006, -0.1781734377, -0.0951463655, 0.0208670553, 0.1502609551, -0.1083433032, 0.0020462233, 0.5980400443, -0.1331813782, -0.0291011091, 0.4560697377, -0.0017090919, -0.0808270946, 0.0111112064, -0.2403191626, 0.1064089462, -0.1864719242, 0.0284159575, 0.2730591297, 0.0053154388, -0.1614435166, 0.1116661951, 0.0180338416, -0.1406104118, -0.208578974, 0.5285698175, -0.1294043362, -0.1111316606, -0.2098497003, 0.2522191405, -0.2701116204, 0.0049775047, -0.139152661, -0.0752417743, -0.1743356138, -0.2161694467, -0.1959979683, 0.1043633968, 0.2675893009, 0.2678264976, 0.1731940955, -0.292314142, 0.01072489, 0.4745836258, 0.085741289, -0.2254721373, 0.4008433223, 0.3285627067, -0.0989186019, 0.0243503619, 0.341024965, 0.5116846561, 0.5268765688, -0.2755405903, 0.0296223927, 0.0998528078, -0.1723220348, 0.3009313643, 0.1220270172, 0.5902813673, 0.1589996666, 0.1322442144, -0.0237081517, -0.0250821821, 0.233064577, -0.0365250595, 0.190965116, 0.0803817213, 0.624930203, 0.2398195416, -0.3591582775, -0.1490707695, 0.08431831, -0.4341337681, 0.0055401451, 0.4604843259, -0.0493660495, 0.2879997194, -0.0646261275, -0.0263438951, 0.1581726819, 0.6270231009, 0.2333029956, 0.2689684331, -0.3417341709, 0.1156058237, -0.3256516159, 0.3007264435, -0.0014745994, -0.0898731202, 0.0791965201, 0.0009107321, 0.0593977757, 0.1766048968, 0.1285299361, 0.0768043622, -0.1470920295, 0.2389509678, -0.169142589, 0.0240432918, 0.0808031708, 0.2279129177, -0.059403751, -0.3299916387, 0.2175321281, 0.107131809, -0.0194473062, -0.0732564107, 0.0540490858, 0.1230194271, 0.1730817109, 0.1039055437, 0.0345199443, 0.5826874375, 0.1241593957, -0.0638275594, 0.3305566311, -0.1148172617, -0.1746620089, 0.1645623595, 0.2476194501, 0.6241384745, -0.0343468785, 0.2556887567, -0.4483468831, -0.2127870917, -0.026163809, 0.0727968141, -0.258046329, 0.2388152331, -0.2617350519, -0.0323140696, 0.3202944696, -0.0063780677, 0.2982016802, 0.0939635262, -0.42007339, -0.4641219378, 0.3670325875, -0.2881054878, -0.2306283116, -0.1451695263, 0.1122813225, 0.0307798889, 0.0831522197, -0.6610736251, -0.009856143, 0.3323139846, -0.0263020769, -0.2213641256, -0.1205213219, 0.0122636342, 0.185101971, -0.0976042897, 0.2706554532, -0.0960785151, -0.064667277, -0.4541106224, -0.1759289652 ]
https://github.com/huggingface/datasets/issues/469
invalid data type 'str' at _convert_outputs in arrow_dataset.py
Hello . Yes, I did set the output format as below for the two columns `train_dataset.set_format('torch',columns=['Text','Label'])`
I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str'
16
invalid data type 'str' at _convert_outputs in arrow_dataset.py I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' Hello . Yes, I did set the output format as below for the two columns `train_dataset.set_format('torch',columns=['Text','Label'])`
[ -0.2228240967, 0.0242495593, 0.1073714495, 0.2303073108, 0.5109527707, -0.107259661, 0.5323301554, 0.0775898322, -0.3410616815, -0.1247762293, 0.0366579518, 0.3864071369, -0.3696955442, 0.0422176197, 0.0443615951, -0.2024639249, -0.0880346149, 0.0099900309, -0.0232526455, -0.0536391288, 0.0482433699, 0.1829805076, -0.1568262279, 0.4144770503, -0.6451315284, -0.1835789531, 0.1746634543, -0.0963928774, -0.0992208868, -0.4487784207, 0.2202741653, -0.1020441726, 0.4976369739, 0.347232163, -0.0001241712, 0.1380355507, 0.1092859805, 0.101694718, -0.2908718586, -0.3016373515, 0.1341148466, -0.0593845211, 0.4149941206, -0.2015387118, -0.057189513, -0.260091424, -0.0606259182, 0.2617688477, 0.3837755322, 0.5016982555, 0.1173221469, 0.1685163528, 0.2464855909, 0.0738127902, 0.2595638037, 0.3155061305, 0.0754770562, 0.2071240097, 0.0168338399, 0.0266054049, -0.0856947824, 0.0748079345, -0.0701287016, -0.1997739971, 0.216658473, 0.2272826284, 0.1745792627, -0.1476222873, -0.2287846357, 0.1198839471, 0.4332153499, -0.321425736, -0.1559450477, 0.0079212999, -0.0111622857, -0.2727993727, -0.0061669433, 0.2483309209, -0.4277769327, 0.1667016149, -0.162260443, -0.0254668761, -0.3792497218, 0.1995562017, -0.0925178155, 0.5032639503, 0.1183699816, 0.1568169445, 0.1842403114, -0.0144357681, 0.3717097938, 0.0876382515, 0.1397548169, 0.06214853, -0.311694026, -0.030463824, -0.4463339746, -0.648362875, -0.2685148716, -0.2125238627, 0.1655775011, -0.0711524189, 0.2047270238, 0.202950567, 0.233322382, 0.13880077, -0.2101231515, 0.564838469, 0.1000926644, -0.1552505344, -0.1335455775, -0.0250886362, -0.3282390237, -0.0922894478, 0.5121243, 0.1628403366, 0.1257425994, -0.0050322264, -0.0550226159, -0.1488327384, -0.2688643336, -0.0882174447, 0.2847146392, 0.1850693822, 0.0958356559, 0.3832220137, 0.2154192775, 0.1111361384, 0.0493784472, -0.1352440417, 0.0353223011, 0.0855560899, -0.2179708481, -0.1198173016, 0.1821130514, 0.3281979263, -0.2699040771, 0.1215014234, -0.1425368637, -0.2085366696, 0.0015719655, -0.2935897708, -0.0053074392, 0.0134969745, -0.2574836612, 0.309787482, 0.0935745165, -0.3035939038, 0.0196344461, 0.4677719772, -0.4638136625, -0.4341676533, -0.4358196259, 0.0899602696, 0.370847553, -0.1129873395, -0.0923097357, 0.0597353019, 0.4520862997, -0.1888258755, 0.1029472351, -0.5797595978, 0.3521026075, -0.015292665, -0.0832997561, 0.0905466452, -0.4035288393, -0.1816477329, 0.1696707755, -0.1533035189, 0.3111131489, 0.4423997104, -0.3827601373, 0.2947914302, 0.0795271546, 0.016693132, 0.8023686409, -0.3571898043, -0.2179585248, 0.1322550774, -0.1704490185, -0.3259193003, -0.0770722032, 0.2736979127, 0.0906305611, 0.0717986152, -0.0094028264, 0.3914261162, -0.0933150947, 0.2531608939, -0.3342477083, -0.0749925748, 0.3700164855, 0.332087785, 0.2507387102, -0.0335380211, 0.0665315241, 0.3422167003, 0.2596167624, -0.1454963237, 0.2384004742, 0.1618343741, 0.0183554348, -0.1759247929, -0.1052250415, -0.1606464088, -0.3050884902, -0.2020209879, -0.3353255689, 0.4843746722, -0.2394972742, 0.0809494555, -0.1629108638, -0.0729376823, -0.1123220474, 0.2390535921, 0.1080782861, 0.0814390555, -0.1436552405, -0.0689879879, -0.1000486612, -0.0618883967, -0.0523721911, 0.1880999804, 0.0251374617, 0.2732269466, -0.1691004038, -0.1986373365, -0.2601748109, 0.0564329736, 0.255816102, 0.0960626602, -0.2582112551, 0.2561085522, -0.1447918862, -0.258123368, -0.3088115454, 0.3103089333, 0.1554097831, -0.5250988603, 0.0369421802, 0.1614517868, 0.1663212478, -0.0896119177, 0.1419674754, 0.1363631189, 0.0686426386, 0.1380072683, -0.0040353239, 0.3693377674, 0.2155337334, -0.0409566015, 0.2696604729, 0.0495532975, -0.1201176196, -0.1636267453, 0.1193024367, 0.0317244008, -0.2905443609, -0.019627478, 0.4356474876, -0.1525556892, 0.2414224893, 0.4414304793, -0.1187741607, -0.0253545027, -0.1871618032, 0.2185590863, 0.1407993585, -0.0268118996, -0.0851378664, -0.0053835795, -0.253885448, -0.0652511939, 0.3296321929, -0.1268231571, 0.4315136671, 0.1532037109, 0.2892072201, -0.0184705388, -0.0514068864, -0.2919020653, 0.2905477285, 0.2543338239, -0.2341016978, 0.4157404602, -0.102525115, -0.2135274261, -0.6377745271, -0.3706789315, -0.083739467, -0.1330628395, -0.0448595658, -0.0630306453, 0.1643535346, 0.0614361838, 0.0771601498, -0.0667611584, 0.2787643373, -0.1845622808, 0.1062297896, -0.3318831027, -0.399028182, -0.0193081778, 0.2381193638, 0.018272955, -0.1148813814, 0.0174304564, -0.0464679375, -0.0756028444, -0.1490139663, 0.1128376052, -0.0141114593, -0.1526149064, 0.1377332211, -0.0253320429, -0.2624070346, -0.2278357893, 0.3238838911, -0.3288732767, 0.00455443, 0.4567358494, -0.1896834821, -0.0553342476, -0.0512935594, -0.3140721321, -0.5814597011, -0.053909909, 0.0172907468, 0.0343013927, 0.3296329379, 0.3480424881, 0.0307738055, 0.1842595041, 0.0340056829, -0.0597994253, 0.0854179114, 0.1192032844, 0.3146254122, -0.0384520106, -0.2886622548, -0.3471455276, -0.1107912883, 0.0709792227, 0.0762150213, -0.3193143606, 0.1262017339, -0.1260371804, 0.0512027368, -0.2906245887, 0.022035012, 0.448099494, 0.1102448925, -0.0087919021, 0.2124653757, 0.0139714107, 0.3060881495, 0.0416651256, 0.2144848853, -0.0346942768, 0.1787260622, -0.0456409007, 0.6495578289, -0.1418002844, -0.3859344423, 0.1767012626, -0.1262177378, -0.1793364286, -0.0094062882, -0.300276041, -0.0031255512, -0.258731544, -0.0353838615, 0.0021559882, -0.2854908407, -0.3254141212, -0.181138292, 0.1342675388, -0.1632560492, -0.3281489909, 0.3672780395, -0.2507418692, 0.2550689876, -0.1565137953, -0.1447719485, -0.1669238061, -0.436498642, -0.0302335601, 0.1978235096, -0.2999421656, 0.0271619819, -0.5152035952, -0.2360683233, -0.1595629305, 0.0845981091, 0.3666799366, 0.5396201611, 0.0303008333, 0.0349532515, 0.0805859417, 0.1010699868, 0.410641551, 0.1839824021, -0.0750320852, 0.1855863333, 0.1655877233, -0.3579365611, -0.2835208774, -0.5400992632, -0.0822041854, 0.2528800368, 0.0967265815, -0.2896075845, -0.2426506281, 0.222534433, 0.041428905, -0.2890587747, -0.0435759686, 0.017208742, -0.2311727703, -0.2042599767, 0.1062255129, 0.2091032714, 0.3887907565, -0.2306032032, -0.1089196429, 0.0180642717, 0.206056267, 0.1758809835, -0.0173784588, 0.1210727915, -0.1272637397, -0.2719095051, -0.2843089998, 0.2212006599, 0.1246747747, 0.4509958327, 0.1175307557, -0.3715091646, 0.1879757941, -0.0572563782, 0.3409126997, 0.0074070278, -0.1104090735, 0.3472833931, 0.1715256125, 0.317676574, 0.099358514, -0.0289536454, 0.2658731043, -0.077132225, -0.4949769676, -0.0418627784, 0.2745335102, -0.0730240569, -0.0733688399, -0.0241514351, -0.209479019, -0.2615413368, 0.4185968041, 0.3421196938, 1.0206485987, -0.2603802681, 0.3446718752, 0.1092102453, -0.0606014766, 0.4950569868, -0.1539971679, 0.1934899688, -0.5524519682, 0.0472405031, -0.111691542, -0.1971726269, -0.1783651859, 0.3437052965, -0.3830962181, 0.1329992712, -0.0964831635, 0.1960598826, 0.142227605, 0.3196293116, 0.2093945146, -0.2090148926, -0.2368240058, -0.003560581, -0.4814990759, -0.0990893394, -0.0379735306, -0.2874807715, -0.0001370848, -0.3918531239, -0.2000367343, 0.1904891282, -0.2922777534, 0.3384349942, 0.5059809685, -0.106443271, 0.2228135914, 0.1987269074, 0.3068523705, -0.0456336513, 0.0611891039, -0.2703240514, -0.062603958, 0.1166032478, -0.057285022, -0.0534288548, 0.4100271761, -0.0476828478, -0.3138557374, 0.3178366721, 0.0144370897, -0.1757710427, 0.1572690457, -0.0672014579, 0.0875043496, -0.4117053449, 0.2714479566, -0.218857348, -0.3185108304, -0.2686833441, 0.0039162659, 0.0189208351, -0.1227039397, 0.1043700799, 0.3181699812, 0.0148006864, 0.142925337, 0.1666362137, 0.2979537845, 0.2228276283, 0.5636557341, 0.3159724772, 0.0117536075, -0.2083150893, 0.1311720014, 0.0069091055, -0.883816421, 0.1976178139, -0.031380333, -0.2637524903, 0.212391451, 0.3753278255, 0.1270442903, 0.4987854958, -0.1740798354, -0.4247025847, -0.3973775506, 0.0065998165, 0.1742636859, 0.0011970839, 0.0514225662, 0.5306838751, 0.1982194185, 0.1547176242, -0.2049757838, 0.1831800342, -0.339990586, 0.2554390132, -0.1108252928, -0.4195619226, -0.038152203, 0.1254321933, 0.043873366, 0.0017528143, 0.0914920568, -0.0549669676, -0.1826649904, 0.1793142706, 0.2735619843, -0.2096079886, -0.2047401369, -0.0046511758, -0.0219299346, 0.1029740274, -0.0729961321, 0.0078970259, -0.1585483551, 0.5496967435, -0.096837081, -0.0782950968, -0.3212502003, 0.03207146, -0.232945919, -0.0552971028, 0.1789359003, 0.2310498953, 0.1414342225, -0.1671891659, -0.7330245376, 0.1469235271, 0.2807040811, -0.0789484456, 0.2824500799, -0.6361714005, -0.2515560091, -0.1240688637, 0.0589366928, 0.0178229548, -0.2906438112, -0.1190242171, 0.1500849873, 0.0792079121, -0.2228346616, -0.2199817002, -0.0071267961, -0.1568066776, -0.1895319521, 0.438834101, 0.0504116006, -0.1781734377, -0.0951463655, 0.0208670553, 0.1502609551, -0.1083433032, 0.0020462233, 0.5980400443, -0.1331813782, -0.0291011091, 0.4560697377, -0.0017090919, -0.0808270946, 0.0111112064, -0.2403191626, 0.1064089462, -0.1864719242, 0.0284159575, 0.2730591297, 0.0053154388, -0.1614435166, 0.1116661951, 0.0180338416, -0.1406104118, -0.208578974, 0.5285698175, -0.1294043362, -0.1111316606, -0.2098497003, 0.2522191405, -0.2701116204, 0.0049775047, -0.139152661, -0.0752417743, -0.1743356138, -0.2161694467, -0.1959979683, 0.1043633968, 0.2675893009, 0.2678264976, 0.1731940955, -0.292314142, 0.01072489, 0.4745836258, 0.085741289, -0.2254721373, 0.4008433223, 0.3285627067, -0.0989186019, 0.0243503619, 0.341024965, 0.5116846561, 0.5268765688, -0.2755405903, 0.0296223927, 0.0998528078, -0.1723220348, 0.3009313643, 0.1220270172, 0.5902813673, 0.1589996666, 0.1322442144, -0.0237081517, -0.0250821821, 0.233064577, -0.0365250595, 0.190965116, 0.0803817213, 0.624930203, 0.2398195416, -0.3591582775, -0.1490707695, 0.08431831, -0.4341337681, 0.0055401451, 0.4604843259, -0.0493660495, 0.2879997194, -0.0646261275, -0.0263438951, 0.1581726819, 0.6270231009, 0.2333029956, 0.2689684331, -0.3417341709, 0.1156058237, -0.3256516159, 0.3007264435, -0.0014745994, -0.0898731202, 0.0791965201, 0.0009107321, 0.0593977757, 0.1766048968, 0.1285299361, 0.0768043622, -0.1470920295, 0.2389509678, -0.169142589, 0.0240432918, 0.0808031708, 0.2279129177, -0.059403751, -0.3299916387, 0.2175321281, 0.107131809, -0.0194473062, -0.0732564107, 0.0540490858, 0.1230194271, 0.1730817109, 0.1039055437, 0.0345199443, 0.5826874375, 0.1241593957, -0.0638275594, 0.3305566311, -0.1148172617, -0.1746620089, 0.1645623595, 0.2476194501, 0.6241384745, -0.0343468785, 0.2556887567, -0.4483468831, -0.2127870917, -0.026163809, 0.0727968141, -0.258046329, 0.2388152331, -0.2617350519, -0.0323140696, 0.3202944696, -0.0063780677, 0.2982016802, 0.0939635262, -0.42007339, -0.4641219378, 0.3670325875, -0.2881054878, -0.2306283116, -0.1451695263, 0.1122813225, 0.0307798889, 0.0831522197, -0.6610736251, -0.009856143, 0.3323139846, -0.0263020769, -0.2213641256, -0.1205213219, 0.0122636342, 0.185101971, -0.0976042897, 0.2706554532, -0.0960785151, -0.064667277, -0.4541106224, -0.1759289652 ]
https://github.com/huggingface/datasets/issues/469
invalid data type 'str' at _convert_outputs in arrow_dataset.py
I think you're having this issue because you try to format strings as pytorch tensors, which is not possible. Indeed by having "Text" in `columns=['Text','Label']`, you try to convert the text values to pytorch tensors. Instead I recommend you to first tokenize your dataset using a tokenizer from transformers. For example ```python from transformers import BertTokenizer tokenizer = BertTokenizer.from_pretrained("bert-base-uncased") train_dataset.map(lambda x: tokenizer(x["Text"]), batched=True) train_dataset.set_format("torch", column=["input_ids"]) ``` Another way to fix your issue would be to not set the format to pytorch, and leave the dataset as it is by default. In that case, the strings are returned normally when you get examples from your dataloader. It means that you would have to tokenize the examples in the training loop (or using a data collator) though. Let me know if you have other questions
I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str'
133
invalid data type 'str' at _convert_outputs in arrow_dataset.py I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I think you're having this issue because you try to format strings as pytorch tensors, which is not possible. Indeed by having "Text" in `columns=['Text','Label']`, you try to convert the text values to pytorch tensors. Instead I recommend you to first tokenize your dataset using a tokenizer from transformers. For example ```python from transformers import BertTokenizer tokenizer = BertTokenizer.from_pretrained("bert-base-uncased") train_dataset.map(lambda x: tokenizer(x["Text"]), batched=True) train_dataset.set_format("torch", column=["input_ids"]) ``` Another way to fix your issue would be to not set the format to pytorch, and leave the dataset as it is by default. In that case, the strings are returned normally when you get examples from your dataloader. It means that you would have to tokenize the examples in the training loop (or using a data collator) though. Let me know if you have other questions
[ -0.2228240967, 0.0242495593, 0.1073714495, 0.2303073108, 0.5109527707, -0.107259661, 0.5323301554, 0.0775898322, -0.3410616815, -0.1247762293, 0.0366579518, 0.3864071369, -0.3696955442, 0.0422176197, 0.0443615951, -0.2024639249, -0.0880346149, 0.0099900309, -0.0232526455, -0.0536391288, 0.0482433699, 0.1829805076, -0.1568262279, 0.4144770503, -0.6451315284, -0.1835789531, 0.1746634543, -0.0963928774, -0.0992208868, -0.4487784207, 0.2202741653, -0.1020441726, 0.4976369739, 0.347232163, -0.0001241712, 0.1380355507, 0.1092859805, 0.101694718, -0.2908718586, -0.3016373515, 0.1341148466, -0.0593845211, 0.4149941206, -0.2015387118, -0.057189513, -0.260091424, -0.0606259182, 0.2617688477, 0.3837755322, 0.5016982555, 0.1173221469, 0.1685163528, 0.2464855909, 0.0738127902, 0.2595638037, 0.3155061305, 0.0754770562, 0.2071240097, 0.0168338399, 0.0266054049, -0.0856947824, 0.0748079345, -0.0701287016, -0.1997739971, 0.216658473, 0.2272826284, 0.1745792627, -0.1476222873, -0.2287846357, 0.1198839471, 0.4332153499, -0.321425736, -0.1559450477, 0.0079212999, -0.0111622857, -0.2727993727, -0.0061669433, 0.2483309209, -0.4277769327, 0.1667016149, -0.162260443, -0.0254668761, -0.3792497218, 0.1995562017, -0.0925178155, 0.5032639503, 0.1183699816, 0.1568169445, 0.1842403114, -0.0144357681, 0.3717097938, 0.0876382515, 0.1397548169, 0.06214853, -0.311694026, -0.030463824, -0.4463339746, -0.648362875, -0.2685148716, -0.2125238627, 0.1655775011, -0.0711524189, 0.2047270238, 0.202950567, 0.233322382, 0.13880077, -0.2101231515, 0.564838469, 0.1000926644, -0.1552505344, -0.1335455775, -0.0250886362, -0.3282390237, -0.0922894478, 0.5121243, 0.1628403366, 0.1257425994, -0.0050322264, -0.0550226159, -0.1488327384, -0.2688643336, -0.0882174447, 0.2847146392, 0.1850693822, 0.0958356559, 0.3832220137, 0.2154192775, 0.1111361384, 0.0493784472, -0.1352440417, 0.0353223011, 0.0855560899, -0.2179708481, -0.1198173016, 0.1821130514, 0.3281979263, -0.2699040771, 0.1215014234, -0.1425368637, -0.2085366696, 0.0015719655, -0.2935897708, -0.0053074392, 0.0134969745, -0.2574836612, 0.309787482, 0.0935745165, -0.3035939038, 0.0196344461, 0.4677719772, -0.4638136625, -0.4341676533, -0.4358196259, 0.0899602696, 0.370847553, -0.1129873395, -0.0923097357, 0.0597353019, 0.4520862997, -0.1888258755, 0.1029472351, -0.5797595978, 0.3521026075, -0.015292665, -0.0832997561, 0.0905466452, -0.4035288393, -0.1816477329, 0.1696707755, -0.1533035189, 0.3111131489, 0.4423997104, -0.3827601373, 0.2947914302, 0.0795271546, 0.016693132, 0.8023686409, -0.3571898043, -0.2179585248, 0.1322550774, -0.1704490185, -0.3259193003, -0.0770722032, 0.2736979127, 0.0906305611, 0.0717986152, -0.0094028264, 0.3914261162, -0.0933150947, 0.2531608939, -0.3342477083, -0.0749925748, 0.3700164855, 0.332087785, 0.2507387102, -0.0335380211, 0.0665315241, 0.3422167003, 0.2596167624, -0.1454963237, 0.2384004742, 0.1618343741, 0.0183554348, -0.1759247929, -0.1052250415, -0.1606464088, -0.3050884902, -0.2020209879, -0.3353255689, 0.4843746722, -0.2394972742, 0.0809494555, -0.1629108638, -0.0729376823, -0.1123220474, 0.2390535921, 0.1080782861, 0.0814390555, -0.1436552405, -0.0689879879, -0.1000486612, -0.0618883967, -0.0523721911, 0.1880999804, 0.0251374617, 0.2732269466, -0.1691004038, -0.1986373365, -0.2601748109, 0.0564329736, 0.255816102, 0.0960626602, -0.2582112551, 0.2561085522, -0.1447918862, -0.258123368, -0.3088115454, 0.3103089333, 0.1554097831, -0.5250988603, 0.0369421802, 0.1614517868, 0.1663212478, -0.0896119177, 0.1419674754, 0.1363631189, 0.0686426386, 0.1380072683, -0.0040353239, 0.3693377674, 0.2155337334, -0.0409566015, 0.2696604729, 0.0495532975, -0.1201176196, -0.1636267453, 0.1193024367, 0.0317244008, -0.2905443609, -0.019627478, 0.4356474876, -0.1525556892, 0.2414224893, 0.4414304793, -0.1187741607, -0.0253545027, -0.1871618032, 0.2185590863, 0.1407993585, -0.0268118996, -0.0851378664, -0.0053835795, -0.253885448, -0.0652511939, 0.3296321929, -0.1268231571, 0.4315136671, 0.1532037109, 0.2892072201, -0.0184705388, -0.0514068864, -0.2919020653, 0.2905477285, 0.2543338239, -0.2341016978, 0.4157404602, -0.102525115, -0.2135274261, -0.6377745271, -0.3706789315, -0.083739467, -0.1330628395, -0.0448595658, -0.0630306453, 0.1643535346, 0.0614361838, 0.0771601498, -0.0667611584, 0.2787643373, -0.1845622808, 0.1062297896, -0.3318831027, -0.399028182, -0.0193081778, 0.2381193638, 0.018272955, -0.1148813814, 0.0174304564, -0.0464679375, -0.0756028444, -0.1490139663, 0.1128376052, -0.0141114593, -0.1526149064, 0.1377332211, -0.0253320429, -0.2624070346, -0.2278357893, 0.3238838911, -0.3288732767, 0.00455443, 0.4567358494, -0.1896834821, -0.0553342476, -0.0512935594, -0.3140721321, -0.5814597011, -0.053909909, 0.0172907468, 0.0343013927, 0.3296329379, 0.3480424881, 0.0307738055, 0.1842595041, 0.0340056829, -0.0597994253, 0.0854179114, 0.1192032844, 0.3146254122, -0.0384520106, -0.2886622548, -0.3471455276, -0.1107912883, 0.0709792227, 0.0762150213, -0.3193143606, 0.1262017339, -0.1260371804, 0.0512027368, -0.2906245887, 0.022035012, 0.448099494, 0.1102448925, -0.0087919021, 0.2124653757, 0.0139714107, 0.3060881495, 0.0416651256, 0.2144848853, -0.0346942768, 0.1787260622, -0.0456409007, 0.6495578289, -0.1418002844, -0.3859344423, 0.1767012626, -0.1262177378, -0.1793364286, -0.0094062882, -0.300276041, -0.0031255512, -0.258731544, -0.0353838615, 0.0021559882, -0.2854908407, -0.3254141212, -0.181138292, 0.1342675388, -0.1632560492, -0.3281489909, 0.3672780395, -0.2507418692, 0.2550689876, -0.1565137953, -0.1447719485, -0.1669238061, -0.436498642, -0.0302335601, 0.1978235096, -0.2999421656, 0.0271619819, -0.5152035952, -0.2360683233, -0.1595629305, 0.0845981091, 0.3666799366, 0.5396201611, 0.0303008333, 0.0349532515, 0.0805859417, 0.1010699868, 0.410641551, 0.1839824021, -0.0750320852, 0.1855863333, 0.1655877233, -0.3579365611, -0.2835208774, -0.5400992632, -0.0822041854, 0.2528800368, 0.0967265815, -0.2896075845, -0.2426506281, 0.222534433, 0.041428905, -0.2890587747, -0.0435759686, 0.017208742, -0.2311727703, -0.2042599767, 0.1062255129, 0.2091032714, 0.3887907565, -0.2306032032, -0.1089196429, 0.0180642717, 0.206056267, 0.1758809835, -0.0173784588, 0.1210727915, -0.1272637397, -0.2719095051, -0.2843089998, 0.2212006599, 0.1246747747, 0.4509958327, 0.1175307557, -0.3715091646, 0.1879757941, -0.0572563782, 0.3409126997, 0.0074070278, -0.1104090735, 0.3472833931, 0.1715256125, 0.317676574, 0.099358514, -0.0289536454, 0.2658731043, -0.077132225, -0.4949769676, -0.0418627784, 0.2745335102, -0.0730240569, -0.0733688399, -0.0241514351, -0.209479019, -0.2615413368, 0.4185968041, 0.3421196938, 1.0206485987, -0.2603802681, 0.3446718752, 0.1092102453, -0.0606014766, 0.4950569868, -0.1539971679, 0.1934899688, -0.5524519682, 0.0472405031, -0.111691542, -0.1971726269, -0.1783651859, 0.3437052965, -0.3830962181, 0.1329992712, -0.0964831635, 0.1960598826, 0.142227605, 0.3196293116, 0.2093945146, -0.2090148926, -0.2368240058, -0.003560581, -0.4814990759, -0.0990893394, -0.0379735306, -0.2874807715, -0.0001370848, -0.3918531239, -0.2000367343, 0.1904891282, -0.2922777534, 0.3384349942, 0.5059809685, -0.106443271, 0.2228135914, 0.1987269074, 0.3068523705, -0.0456336513, 0.0611891039, -0.2703240514, -0.062603958, 0.1166032478, -0.057285022, -0.0534288548, 0.4100271761, -0.0476828478, -0.3138557374, 0.3178366721, 0.0144370897, -0.1757710427, 0.1572690457, -0.0672014579, 0.0875043496, -0.4117053449, 0.2714479566, -0.218857348, -0.3185108304, -0.2686833441, 0.0039162659, 0.0189208351, -0.1227039397, 0.1043700799, 0.3181699812, 0.0148006864, 0.142925337, 0.1666362137, 0.2979537845, 0.2228276283, 0.5636557341, 0.3159724772, 0.0117536075, -0.2083150893, 0.1311720014, 0.0069091055, -0.883816421, 0.1976178139, -0.031380333, -0.2637524903, 0.212391451, 0.3753278255, 0.1270442903, 0.4987854958, -0.1740798354, -0.4247025847, -0.3973775506, 0.0065998165, 0.1742636859, 0.0011970839, 0.0514225662, 0.5306838751, 0.1982194185, 0.1547176242, -0.2049757838, 0.1831800342, -0.339990586, 0.2554390132, -0.1108252928, -0.4195619226, -0.038152203, 0.1254321933, 0.043873366, 0.0017528143, 0.0914920568, -0.0549669676, -0.1826649904, 0.1793142706, 0.2735619843, -0.2096079886, -0.2047401369, -0.0046511758, -0.0219299346, 0.1029740274, -0.0729961321, 0.0078970259, -0.1585483551, 0.5496967435, -0.096837081, -0.0782950968, -0.3212502003, 0.03207146, -0.232945919, -0.0552971028, 0.1789359003, 0.2310498953, 0.1414342225, -0.1671891659, -0.7330245376, 0.1469235271, 0.2807040811, -0.0789484456, 0.2824500799, -0.6361714005, -0.2515560091, -0.1240688637, 0.0589366928, 0.0178229548, -0.2906438112, -0.1190242171, 0.1500849873, 0.0792079121, -0.2228346616, -0.2199817002, -0.0071267961, -0.1568066776, -0.1895319521, 0.438834101, 0.0504116006, -0.1781734377, -0.0951463655, 0.0208670553, 0.1502609551, -0.1083433032, 0.0020462233, 0.5980400443, -0.1331813782, -0.0291011091, 0.4560697377, -0.0017090919, -0.0808270946, 0.0111112064, -0.2403191626, 0.1064089462, -0.1864719242, 0.0284159575, 0.2730591297, 0.0053154388, -0.1614435166, 0.1116661951, 0.0180338416, -0.1406104118, -0.208578974, 0.5285698175, -0.1294043362, -0.1111316606, -0.2098497003, 0.2522191405, -0.2701116204, 0.0049775047, -0.139152661, -0.0752417743, -0.1743356138, -0.2161694467, -0.1959979683, 0.1043633968, 0.2675893009, 0.2678264976, 0.1731940955, -0.292314142, 0.01072489, 0.4745836258, 0.085741289, -0.2254721373, 0.4008433223, 0.3285627067, -0.0989186019, 0.0243503619, 0.341024965, 0.5116846561, 0.5268765688, -0.2755405903, 0.0296223927, 0.0998528078, -0.1723220348, 0.3009313643, 0.1220270172, 0.5902813673, 0.1589996666, 0.1322442144, -0.0237081517, -0.0250821821, 0.233064577, -0.0365250595, 0.190965116, 0.0803817213, 0.624930203, 0.2398195416, -0.3591582775, -0.1490707695, 0.08431831, -0.4341337681, 0.0055401451, 0.4604843259, -0.0493660495, 0.2879997194, -0.0646261275, -0.0263438951, 0.1581726819, 0.6270231009, 0.2333029956, 0.2689684331, -0.3417341709, 0.1156058237, -0.3256516159, 0.3007264435, -0.0014745994, -0.0898731202, 0.0791965201, 0.0009107321, 0.0593977757, 0.1766048968, 0.1285299361, 0.0768043622, -0.1470920295, 0.2389509678, -0.169142589, 0.0240432918, 0.0808031708, 0.2279129177, -0.059403751, -0.3299916387, 0.2175321281, 0.107131809, -0.0194473062, -0.0732564107, 0.0540490858, 0.1230194271, 0.1730817109, 0.1039055437, 0.0345199443, 0.5826874375, 0.1241593957, -0.0638275594, 0.3305566311, -0.1148172617, -0.1746620089, 0.1645623595, 0.2476194501, 0.6241384745, -0.0343468785, 0.2556887567, -0.4483468831, -0.2127870917, -0.026163809, 0.0727968141, -0.258046329, 0.2388152331, -0.2617350519, -0.0323140696, 0.3202944696, -0.0063780677, 0.2982016802, 0.0939635262, -0.42007339, -0.4641219378, 0.3670325875, -0.2881054878, -0.2306283116, -0.1451695263, 0.1122813225, 0.0307798889, 0.0831522197, -0.6610736251, -0.009856143, 0.3323139846, -0.0263020769, -0.2213641256, -0.1205213219, 0.0122636342, 0.185101971, -0.0976042897, 0.2706554532, -0.0960785151, -0.064667277, -0.4541106224, -0.1759289652 ]
https://github.com/huggingface/datasets/issues/469
invalid data type 'str' at _convert_outputs in arrow_dataset.py
Hi, actually the thing is I am getting the same error and even after tokenizing them I am passing them through batch_encode_plus. I dont know what seems to be the problem is. I even converted it into 'pt' while passing them through batch_encode_plus but when I am evaluating my model , i am getting this error --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-145-ca218223c9fc> in <module>() ----> 1 val_loss, predictions, true_val = evaluate(dataloader_validation) 2 val_f1 = f1_score_func(predictions, true_val) 3 tqdm.write(f'Validation loss: {val_loss}') 4 tqdm.write(f'F1 Score (Weighted): {val_f1}') 6 frames /usr/local/lib/python3.6/dist-packages/torch/utils/data/dataset.py in <genexpr>(.0) 160 161 def __getitem__(self, index): --> 162 return tuple(tensor[index] for tensor in self.tensors) 163 164 def __len__(self): TypeError: new(): invalid data type 'str'
I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str'
115
invalid data type 'str' at _convert_outputs in arrow_dataset.py I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' Hi, actually the thing is I am getting the same error and even after tokenizing them I am passing them through batch_encode_plus. I dont know what seems to be the problem is. I even converted it into 'pt' while passing them through batch_encode_plus but when I am evaluating my model , i am getting this error --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-145-ca218223c9fc> in <module>() ----> 1 val_loss, predictions, true_val = evaluate(dataloader_validation) 2 val_f1 = f1_score_func(predictions, true_val) 3 tqdm.write(f'Validation loss: {val_loss}') 4 tqdm.write(f'F1 Score (Weighted): {val_f1}') 6 frames /usr/local/lib/python3.6/dist-packages/torch/utils/data/dataset.py in <genexpr>(.0) 160 161 def __getitem__(self, index): --> 162 return tuple(tensor[index] for tensor in self.tensors) 163 164 def __len__(self): TypeError: new(): invalid data type 'str'
[ -0.2228240967, 0.0242495593, 0.1073714495, 0.2303073108, 0.5109527707, -0.107259661, 0.5323301554, 0.0775898322, -0.3410616815, -0.1247762293, 0.0366579518, 0.3864071369, -0.3696955442, 0.0422176197, 0.0443615951, -0.2024639249, -0.0880346149, 0.0099900309, -0.0232526455, -0.0536391288, 0.0482433699, 0.1829805076, -0.1568262279, 0.4144770503, -0.6451315284, -0.1835789531, 0.1746634543, -0.0963928774, -0.0992208868, -0.4487784207, 0.2202741653, -0.1020441726, 0.4976369739, 0.347232163, -0.0001241712, 0.1380355507, 0.1092859805, 0.101694718, -0.2908718586, -0.3016373515, 0.1341148466, -0.0593845211, 0.4149941206, -0.2015387118, -0.057189513, -0.260091424, -0.0606259182, 0.2617688477, 0.3837755322, 0.5016982555, 0.1173221469, 0.1685163528, 0.2464855909, 0.0738127902, 0.2595638037, 0.3155061305, 0.0754770562, 0.2071240097, 0.0168338399, 0.0266054049, -0.0856947824, 0.0748079345, -0.0701287016, -0.1997739971, 0.216658473, 0.2272826284, 0.1745792627, -0.1476222873, -0.2287846357, 0.1198839471, 0.4332153499, -0.321425736, -0.1559450477, 0.0079212999, -0.0111622857, -0.2727993727, -0.0061669433, 0.2483309209, -0.4277769327, 0.1667016149, -0.162260443, -0.0254668761, -0.3792497218, 0.1995562017, -0.0925178155, 0.5032639503, 0.1183699816, 0.1568169445, 0.1842403114, -0.0144357681, 0.3717097938, 0.0876382515, 0.1397548169, 0.06214853, -0.311694026, -0.030463824, -0.4463339746, -0.648362875, -0.2685148716, -0.2125238627, 0.1655775011, -0.0711524189, 0.2047270238, 0.202950567, 0.233322382, 0.13880077, -0.2101231515, 0.564838469, 0.1000926644, -0.1552505344, -0.1335455775, -0.0250886362, -0.3282390237, -0.0922894478, 0.5121243, 0.1628403366, 0.1257425994, -0.0050322264, -0.0550226159, -0.1488327384, -0.2688643336, -0.0882174447, 0.2847146392, 0.1850693822, 0.0958356559, 0.3832220137, 0.2154192775, 0.1111361384, 0.0493784472, -0.1352440417, 0.0353223011, 0.0855560899, -0.2179708481, -0.1198173016, 0.1821130514, 0.3281979263, -0.2699040771, 0.1215014234, -0.1425368637, -0.2085366696, 0.0015719655, -0.2935897708, -0.0053074392, 0.0134969745, -0.2574836612, 0.309787482, 0.0935745165, -0.3035939038, 0.0196344461, 0.4677719772, -0.4638136625, -0.4341676533, -0.4358196259, 0.0899602696, 0.370847553, -0.1129873395, -0.0923097357, 0.0597353019, 0.4520862997, -0.1888258755, 0.1029472351, -0.5797595978, 0.3521026075, -0.015292665, -0.0832997561, 0.0905466452, -0.4035288393, -0.1816477329, 0.1696707755, -0.1533035189, 0.3111131489, 0.4423997104, -0.3827601373, 0.2947914302, 0.0795271546, 0.016693132, 0.8023686409, -0.3571898043, -0.2179585248, 0.1322550774, -0.1704490185, -0.3259193003, -0.0770722032, 0.2736979127, 0.0906305611, 0.0717986152, -0.0094028264, 0.3914261162, -0.0933150947, 0.2531608939, -0.3342477083, -0.0749925748, 0.3700164855, 0.332087785, 0.2507387102, -0.0335380211, 0.0665315241, 0.3422167003, 0.2596167624, -0.1454963237, 0.2384004742, 0.1618343741, 0.0183554348, -0.1759247929, -0.1052250415, -0.1606464088, -0.3050884902, -0.2020209879, -0.3353255689, 0.4843746722, -0.2394972742, 0.0809494555, -0.1629108638, -0.0729376823, -0.1123220474, 0.2390535921, 0.1080782861, 0.0814390555, -0.1436552405, -0.0689879879, -0.1000486612, -0.0618883967, -0.0523721911, 0.1880999804, 0.0251374617, 0.2732269466, -0.1691004038, -0.1986373365, -0.2601748109, 0.0564329736, 0.255816102, 0.0960626602, -0.2582112551, 0.2561085522, -0.1447918862, -0.258123368, -0.3088115454, 0.3103089333, 0.1554097831, -0.5250988603, 0.0369421802, 0.1614517868, 0.1663212478, -0.0896119177, 0.1419674754, 0.1363631189, 0.0686426386, 0.1380072683, -0.0040353239, 0.3693377674, 0.2155337334, -0.0409566015, 0.2696604729, 0.0495532975, -0.1201176196, -0.1636267453, 0.1193024367, 0.0317244008, -0.2905443609, -0.019627478, 0.4356474876, -0.1525556892, 0.2414224893, 0.4414304793, -0.1187741607, -0.0253545027, -0.1871618032, 0.2185590863, 0.1407993585, -0.0268118996, -0.0851378664, -0.0053835795, -0.253885448, -0.0652511939, 0.3296321929, -0.1268231571, 0.4315136671, 0.1532037109, 0.2892072201, -0.0184705388, -0.0514068864, -0.2919020653, 0.2905477285, 0.2543338239, -0.2341016978, 0.4157404602, -0.102525115, -0.2135274261, -0.6377745271, -0.3706789315, -0.083739467, -0.1330628395, -0.0448595658, -0.0630306453, 0.1643535346, 0.0614361838, 0.0771601498, -0.0667611584, 0.2787643373, -0.1845622808, 0.1062297896, -0.3318831027, -0.399028182, -0.0193081778, 0.2381193638, 0.018272955, -0.1148813814, 0.0174304564, -0.0464679375, -0.0756028444, -0.1490139663, 0.1128376052, -0.0141114593, -0.1526149064, 0.1377332211, -0.0253320429, -0.2624070346, -0.2278357893, 0.3238838911, -0.3288732767, 0.00455443, 0.4567358494, -0.1896834821, -0.0553342476, -0.0512935594, -0.3140721321, -0.5814597011, -0.053909909, 0.0172907468, 0.0343013927, 0.3296329379, 0.3480424881, 0.0307738055, 0.1842595041, 0.0340056829, -0.0597994253, 0.0854179114, 0.1192032844, 0.3146254122, -0.0384520106, -0.2886622548, -0.3471455276, -0.1107912883, 0.0709792227, 0.0762150213, -0.3193143606, 0.1262017339, -0.1260371804, 0.0512027368, -0.2906245887, 0.022035012, 0.448099494, 0.1102448925, -0.0087919021, 0.2124653757, 0.0139714107, 0.3060881495, 0.0416651256, 0.2144848853, -0.0346942768, 0.1787260622, -0.0456409007, 0.6495578289, -0.1418002844, -0.3859344423, 0.1767012626, -0.1262177378, -0.1793364286, -0.0094062882, -0.300276041, -0.0031255512, -0.258731544, -0.0353838615, 0.0021559882, -0.2854908407, -0.3254141212, -0.181138292, 0.1342675388, -0.1632560492, -0.3281489909, 0.3672780395, -0.2507418692, 0.2550689876, -0.1565137953, -0.1447719485, -0.1669238061, -0.436498642, -0.0302335601, 0.1978235096, -0.2999421656, 0.0271619819, -0.5152035952, -0.2360683233, -0.1595629305, 0.0845981091, 0.3666799366, 0.5396201611, 0.0303008333, 0.0349532515, 0.0805859417, 0.1010699868, 0.410641551, 0.1839824021, -0.0750320852, 0.1855863333, 0.1655877233, -0.3579365611, -0.2835208774, -0.5400992632, -0.0822041854, 0.2528800368, 0.0967265815, -0.2896075845, -0.2426506281, 0.222534433, 0.041428905, -0.2890587747, -0.0435759686, 0.017208742, -0.2311727703, -0.2042599767, 0.1062255129, 0.2091032714, 0.3887907565, -0.2306032032, -0.1089196429, 0.0180642717, 0.206056267, 0.1758809835, -0.0173784588, 0.1210727915, -0.1272637397, -0.2719095051, -0.2843089998, 0.2212006599, 0.1246747747, 0.4509958327, 0.1175307557, -0.3715091646, 0.1879757941, -0.0572563782, 0.3409126997, 0.0074070278, -0.1104090735, 0.3472833931, 0.1715256125, 0.317676574, 0.099358514, -0.0289536454, 0.2658731043, -0.077132225, -0.4949769676, -0.0418627784, 0.2745335102, -0.0730240569, -0.0733688399, -0.0241514351, -0.209479019, -0.2615413368, 0.4185968041, 0.3421196938, 1.0206485987, -0.2603802681, 0.3446718752, 0.1092102453, -0.0606014766, 0.4950569868, -0.1539971679, 0.1934899688, -0.5524519682, 0.0472405031, -0.111691542, -0.1971726269, -0.1783651859, 0.3437052965, -0.3830962181, 0.1329992712, -0.0964831635, 0.1960598826, 0.142227605, 0.3196293116, 0.2093945146, -0.2090148926, -0.2368240058, -0.003560581, -0.4814990759, -0.0990893394, -0.0379735306, -0.2874807715, -0.0001370848, -0.3918531239, -0.2000367343, 0.1904891282, -0.2922777534, 0.3384349942, 0.5059809685, -0.106443271, 0.2228135914, 0.1987269074, 0.3068523705, -0.0456336513, 0.0611891039, -0.2703240514, -0.062603958, 0.1166032478, -0.057285022, -0.0534288548, 0.4100271761, -0.0476828478, -0.3138557374, 0.3178366721, 0.0144370897, -0.1757710427, 0.1572690457, -0.0672014579, 0.0875043496, -0.4117053449, 0.2714479566, -0.218857348, -0.3185108304, -0.2686833441, 0.0039162659, 0.0189208351, -0.1227039397, 0.1043700799, 0.3181699812, 0.0148006864, 0.142925337, 0.1666362137, 0.2979537845, 0.2228276283, 0.5636557341, 0.3159724772, 0.0117536075, -0.2083150893, 0.1311720014, 0.0069091055, -0.883816421, 0.1976178139, -0.031380333, -0.2637524903, 0.212391451, 0.3753278255, 0.1270442903, 0.4987854958, -0.1740798354, -0.4247025847, -0.3973775506, 0.0065998165, 0.1742636859, 0.0011970839, 0.0514225662, 0.5306838751, 0.1982194185, 0.1547176242, -0.2049757838, 0.1831800342, -0.339990586, 0.2554390132, -0.1108252928, -0.4195619226, -0.038152203, 0.1254321933, 0.043873366, 0.0017528143, 0.0914920568, -0.0549669676, -0.1826649904, 0.1793142706, 0.2735619843, -0.2096079886, -0.2047401369, -0.0046511758, -0.0219299346, 0.1029740274, -0.0729961321, 0.0078970259, -0.1585483551, 0.5496967435, -0.096837081, -0.0782950968, -0.3212502003, 0.03207146, -0.232945919, -0.0552971028, 0.1789359003, 0.2310498953, 0.1414342225, -0.1671891659, -0.7330245376, 0.1469235271, 0.2807040811, -0.0789484456, 0.2824500799, -0.6361714005, -0.2515560091, -0.1240688637, 0.0589366928, 0.0178229548, -0.2906438112, -0.1190242171, 0.1500849873, 0.0792079121, -0.2228346616, -0.2199817002, -0.0071267961, -0.1568066776, -0.1895319521, 0.438834101, 0.0504116006, -0.1781734377, -0.0951463655, 0.0208670553, 0.1502609551, -0.1083433032, 0.0020462233, 0.5980400443, -0.1331813782, -0.0291011091, 0.4560697377, -0.0017090919, -0.0808270946, 0.0111112064, -0.2403191626, 0.1064089462, -0.1864719242, 0.0284159575, 0.2730591297, 0.0053154388, -0.1614435166, 0.1116661951, 0.0180338416, -0.1406104118, -0.208578974, 0.5285698175, -0.1294043362, -0.1111316606, -0.2098497003, 0.2522191405, -0.2701116204, 0.0049775047, -0.139152661, -0.0752417743, -0.1743356138, -0.2161694467, -0.1959979683, 0.1043633968, 0.2675893009, 0.2678264976, 0.1731940955, -0.292314142, 0.01072489, 0.4745836258, 0.085741289, -0.2254721373, 0.4008433223, 0.3285627067, -0.0989186019, 0.0243503619, 0.341024965, 0.5116846561, 0.5268765688, -0.2755405903, 0.0296223927, 0.0998528078, -0.1723220348, 0.3009313643, 0.1220270172, 0.5902813673, 0.1589996666, 0.1322442144, -0.0237081517, -0.0250821821, 0.233064577, -0.0365250595, 0.190965116, 0.0803817213, 0.624930203, 0.2398195416, -0.3591582775, -0.1490707695, 0.08431831, -0.4341337681, 0.0055401451, 0.4604843259, -0.0493660495, 0.2879997194, -0.0646261275, -0.0263438951, 0.1581726819, 0.6270231009, 0.2333029956, 0.2689684331, -0.3417341709, 0.1156058237, -0.3256516159, 0.3007264435, -0.0014745994, -0.0898731202, 0.0791965201, 0.0009107321, 0.0593977757, 0.1766048968, 0.1285299361, 0.0768043622, -0.1470920295, 0.2389509678, -0.169142589, 0.0240432918, 0.0808031708, 0.2279129177, -0.059403751, -0.3299916387, 0.2175321281, 0.107131809, -0.0194473062, -0.0732564107, 0.0540490858, 0.1230194271, 0.1730817109, 0.1039055437, 0.0345199443, 0.5826874375, 0.1241593957, -0.0638275594, 0.3305566311, -0.1148172617, -0.1746620089, 0.1645623595, 0.2476194501, 0.6241384745, -0.0343468785, 0.2556887567, -0.4483468831, -0.2127870917, -0.026163809, 0.0727968141, -0.258046329, 0.2388152331, -0.2617350519, -0.0323140696, 0.3202944696, -0.0063780677, 0.2982016802, 0.0939635262, -0.42007339, -0.4641219378, 0.3670325875, -0.2881054878, -0.2306283116, -0.1451695263, 0.1122813225, 0.0307798889, 0.0831522197, -0.6610736251, -0.009856143, 0.3323139846, -0.0263020769, -0.2213641256, -0.1205213219, 0.0122636342, 0.185101971, -0.0976042897, 0.2706554532, -0.0960785151, -0.064667277, -0.4541106224, -0.1759289652 ]
https://github.com/huggingface/datasets/issues/469
invalid data type 'str' at _convert_outputs in arrow_dataset.py
> Hi, actually the thing is I am getting the same error and even after tokenizing them I am passing them through batch_encode_plus. > I dont know what seems to be the problem is. I even converted it into 'pt' while passing them through batch_encode_plus but when I am evaluating my model , i am getting this error > > TypeError Traceback (most recent call last) > in () > ----> 1 val_loss, predictions, true_val = evaluate(dataloader_validation) > 2 val_f1 = f1_score_func(predictions, true_val) > 3 tqdm.write(f'Validation loss: {val_loss}') > 4 tqdm.write(f'F1 Score (Weighted): {val_f1}') > > 6 frames > /usr/local/lib/python3.6/dist-packages/torch/utils/data/dataset.py in (.0) > 160 > 161 def **getitem**(self, index): > --> 162 return tuple(tensor[index] for tensor in self.tensors) > 163 > 164 def **len**(self): > > TypeError: new(): invalid data type 'str' I got the same error and fix it . you can check your input where there may be string contained. such as ``` a = [1,2,3,4,'<unk>'] torch.tensor(a) ```
I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str'
160
invalid data type 'str' at _convert_outputs in arrow_dataset.py I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' > Hi, actually the thing is I am getting the same error and even after tokenizing them I am passing them through batch_encode_plus. > I dont know what seems to be the problem is. I even converted it into 'pt' while passing them through batch_encode_plus but when I am evaluating my model , i am getting this error > > TypeError Traceback (most recent call last) > in () > ----> 1 val_loss, predictions, true_val = evaluate(dataloader_validation) > 2 val_f1 = f1_score_func(predictions, true_val) > 3 tqdm.write(f'Validation loss: {val_loss}') > 4 tqdm.write(f'F1 Score (Weighted): {val_f1}') > > 6 frames > /usr/local/lib/python3.6/dist-packages/torch/utils/data/dataset.py in (.0) > 160 > 161 def **getitem**(self, index): > --> 162 return tuple(tensor[index] for tensor in self.tensors) > 163 > 164 def **len**(self): > > TypeError: new(): invalid data type 'str' I got the same error and fix it . you can check your input where there may be string contained. such as ``` a = [1,2,3,4,'<unk>'] torch.tensor(a) ```
[ -0.2228240967, 0.0242495593, 0.1073714495, 0.2303073108, 0.5109527707, -0.107259661, 0.5323301554, 0.0775898322, -0.3410616815, -0.1247762293, 0.0366579518, 0.3864071369, -0.3696955442, 0.0422176197, 0.0443615951, -0.2024639249, -0.0880346149, 0.0099900309, -0.0232526455, -0.0536391288, 0.0482433699, 0.1829805076, -0.1568262279, 0.4144770503, -0.6451315284, -0.1835789531, 0.1746634543, -0.0963928774, -0.0992208868, -0.4487784207, 0.2202741653, -0.1020441726, 0.4976369739, 0.347232163, -0.0001241712, 0.1380355507, 0.1092859805, 0.101694718, -0.2908718586, -0.3016373515, 0.1341148466, -0.0593845211, 0.4149941206, -0.2015387118, -0.057189513, -0.260091424, -0.0606259182, 0.2617688477, 0.3837755322, 0.5016982555, 0.1173221469, 0.1685163528, 0.2464855909, 0.0738127902, 0.2595638037, 0.3155061305, 0.0754770562, 0.2071240097, 0.0168338399, 0.0266054049, -0.0856947824, 0.0748079345, -0.0701287016, -0.1997739971, 0.216658473, 0.2272826284, 0.1745792627, -0.1476222873, -0.2287846357, 0.1198839471, 0.4332153499, -0.321425736, -0.1559450477, 0.0079212999, -0.0111622857, -0.2727993727, -0.0061669433, 0.2483309209, -0.4277769327, 0.1667016149, -0.162260443, -0.0254668761, -0.3792497218, 0.1995562017, -0.0925178155, 0.5032639503, 0.1183699816, 0.1568169445, 0.1842403114, -0.0144357681, 0.3717097938, 0.0876382515, 0.1397548169, 0.06214853, -0.311694026, -0.030463824, -0.4463339746, -0.648362875, -0.2685148716, -0.2125238627, 0.1655775011, -0.0711524189, 0.2047270238, 0.202950567, 0.233322382, 0.13880077, -0.2101231515, 0.564838469, 0.1000926644, -0.1552505344, -0.1335455775, -0.0250886362, -0.3282390237, -0.0922894478, 0.5121243, 0.1628403366, 0.1257425994, -0.0050322264, -0.0550226159, -0.1488327384, -0.2688643336, -0.0882174447, 0.2847146392, 0.1850693822, 0.0958356559, 0.3832220137, 0.2154192775, 0.1111361384, 0.0493784472, -0.1352440417, 0.0353223011, 0.0855560899, -0.2179708481, -0.1198173016, 0.1821130514, 0.3281979263, -0.2699040771, 0.1215014234, -0.1425368637, -0.2085366696, 0.0015719655, -0.2935897708, -0.0053074392, 0.0134969745, -0.2574836612, 0.309787482, 0.0935745165, -0.3035939038, 0.0196344461, 0.4677719772, -0.4638136625, -0.4341676533, -0.4358196259, 0.0899602696, 0.370847553, -0.1129873395, -0.0923097357, 0.0597353019, 0.4520862997, -0.1888258755, 0.1029472351, -0.5797595978, 0.3521026075, -0.015292665, -0.0832997561, 0.0905466452, -0.4035288393, -0.1816477329, 0.1696707755, -0.1533035189, 0.3111131489, 0.4423997104, -0.3827601373, 0.2947914302, 0.0795271546, 0.016693132, 0.8023686409, -0.3571898043, -0.2179585248, 0.1322550774, -0.1704490185, -0.3259193003, -0.0770722032, 0.2736979127, 0.0906305611, 0.0717986152, -0.0094028264, 0.3914261162, -0.0933150947, 0.2531608939, -0.3342477083, -0.0749925748, 0.3700164855, 0.332087785, 0.2507387102, -0.0335380211, 0.0665315241, 0.3422167003, 0.2596167624, -0.1454963237, 0.2384004742, 0.1618343741, 0.0183554348, -0.1759247929, -0.1052250415, -0.1606464088, -0.3050884902, -0.2020209879, -0.3353255689, 0.4843746722, -0.2394972742, 0.0809494555, -0.1629108638, -0.0729376823, -0.1123220474, 0.2390535921, 0.1080782861, 0.0814390555, -0.1436552405, -0.0689879879, -0.1000486612, -0.0618883967, -0.0523721911, 0.1880999804, 0.0251374617, 0.2732269466, -0.1691004038, -0.1986373365, -0.2601748109, 0.0564329736, 0.255816102, 0.0960626602, -0.2582112551, 0.2561085522, -0.1447918862, -0.258123368, -0.3088115454, 0.3103089333, 0.1554097831, -0.5250988603, 0.0369421802, 0.1614517868, 0.1663212478, -0.0896119177, 0.1419674754, 0.1363631189, 0.0686426386, 0.1380072683, -0.0040353239, 0.3693377674, 0.2155337334, -0.0409566015, 0.2696604729, 0.0495532975, -0.1201176196, -0.1636267453, 0.1193024367, 0.0317244008, -0.2905443609, -0.019627478, 0.4356474876, -0.1525556892, 0.2414224893, 0.4414304793, -0.1187741607, -0.0253545027, -0.1871618032, 0.2185590863, 0.1407993585, -0.0268118996, -0.0851378664, -0.0053835795, -0.253885448, -0.0652511939, 0.3296321929, -0.1268231571, 0.4315136671, 0.1532037109, 0.2892072201, -0.0184705388, -0.0514068864, -0.2919020653, 0.2905477285, 0.2543338239, -0.2341016978, 0.4157404602, -0.102525115, -0.2135274261, -0.6377745271, -0.3706789315, -0.083739467, -0.1330628395, -0.0448595658, -0.0630306453, 0.1643535346, 0.0614361838, 0.0771601498, -0.0667611584, 0.2787643373, -0.1845622808, 0.1062297896, -0.3318831027, -0.399028182, -0.0193081778, 0.2381193638, 0.018272955, -0.1148813814, 0.0174304564, -0.0464679375, -0.0756028444, -0.1490139663, 0.1128376052, -0.0141114593, -0.1526149064, 0.1377332211, -0.0253320429, -0.2624070346, -0.2278357893, 0.3238838911, -0.3288732767, 0.00455443, 0.4567358494, -0.1896834821, -0.0553342476, -0.0512935594, -0.3140721321, -0.5814597011, -0.053909909, 0.0172907468, 0.0343013927, 0.3296329379, 0.3480424881, 0.0307738055, 0.1842595041, 0.0340056829, -0.0597994253, 0.0854179114, 0.1192032844, 0.3146254122, -0.0384520106, -0.2886622548, -0.3471455276, -0.1107912883, 0.0709792227, 0.0762150213, -0.3193143606, 0.1262017339, -0.1260371804, 0.0512027368, -0.2906245887, 0.022035012, 0.448099494, 0.1102448925, -0.0087919021, 0.2124653757, 0.0139714107, 0.3060881495, 0.0416651256, 0.2144848853, -0.0346942768, 0.1787260622, -0.0456409007, 0.6495578289, -0.1418002844, -0.3859344423, 0.1767012626, -0.1262177378, -0.1793364286, -0.0094062882, -0.300276041, -0.0031255512, -0.258731544, -0.0353838615, 0.0021559882, -0.2854908407, -0.3254141212, -0.181138292, 0.1342675388, -0.1632560492, -0.3281489909, 0.3672780395, -0.2507418692, 0.2550689876, -0.1565137953, -0.1447719485, -0.1669238061, -0.436498642, -0.0302335601, 0.1978235096, -0.2999421656, 0.0271619819, -0.5152035952, -0.2360683233, -0.1595629305, 0.0845981091, 0.3666799366, 0.5396201611, 0.0303008333, 0.0349532515, 0.0805859417, 0.1010699868, 0.410641551, 0.1839824021, -0.0750320852, 0.1855863333, 0.1655877233, -0.3579365611, -0.2835208774, -0.5400992632, -0.0822041854, 0.2528800368, 0.0967265815, -0.2896075845, -0.2426506281, 0.222534433, 0.041428905, -0.2890587747, -0.0435759686, 0.017208742, -0.2311727703, -0.2042599767, 0.1062255129, 0.2091032714, 0.3887907565, -0.2306032032, -0.1089196429, 0.0180642717, 0.206056267, 0.1758809835, -0.0173784588, 0.1210727915, -0.1272637397, -0.2719095051, -0.2843089998, 0.2212006599, 0.1246747747, 0.4509958327, 0.1175307557, -0.3715091646, 0.1879757941, -0.0572563782, 0.3409126997, 0.0074070278, -0.1104090735, 0.3472833931, 0.1715256125, 0.317676574, 0.099358514, -0.0289536454, 0.2658731043, -0.077132225, -0.4949769676, -0.0418627784, 0.2745335102, -0.0730240569, -0.0733688399, -0.0241514351, -0.209479019, -0.2615413368, 0.4185968041, 0.3421196938, 1.0206485987, -0.2603802681, 0.3446718752, 0.1092102453, -0.0606014766, 0.4950569868, -0.1539971679, 0.1934899688, -0.5524519682, 0.0472405031, -0.111691542, -0.1971726269, -0.1783651859, 0.3437052965, -0.3830962181, 0.1329992712, -0.0964831635, 0.1960598826, 0.142227605, 0.3196293116, 0.2093945146, -0.2090148926, -0.2368240058, -0.003560581, -0.4814990759, -0.0990893394, -0.0379735306, -0.2874807715, -0.0001370848, -0.3918531239, -0.2000367343, 0.1904891282, -0.2922777534, 0.3384349942, 0.5059809685, -0.106443271, 0.2228135914, 0.1987269074, 0.3068523705, -0.0456336513, 0.0611891039, -0.2703240514, -0.062603958, 0.1166032478, -0.057285022, -0.0534288548, 0.4100271761, -0.0476828478, -0.3138557374, 0.3178366721, 0.0144370897, -0.1757710427, 0.1572690457, -0.0672014579, 0.0875043496, -0.4117053449, 0.2714479566, -0.218857348, -0.3185108304, -0.2686833441, 0.0039162659, 0.0189208351, -0.1227039397, 0.1043700799, 0.3181699812, 0.0148006864, 0.142925337, 0.1666362137, 0.2979537845, 0.2228276283, 0.5636557341, 0.3159724772, 0.0117536075, -0.2083150893, 0.1311720014, 0.0069091055, -0.883816421, 0.1976178139, -0.031380333, -0.2637524903, 0.212391451, 0.3753278255, 0.1270442903, 0.4987854958, -0.1740798354, -0.4247025847, -0.3973775506, 0.0065998165, 0.1742636859, 0.0011970839, 0.0514225662, 0.5306838751, 0.1982194185, 0.1547176242, -0.2049757838, 0.1831800342, -0.339990586, 0.2554390132, -0.1108252928, -0.4195619226, -0.038152203, 0.1254321933, 0.043873366, 0.0017528143, 0.0914920568, -0.0549669676, -0.1826649904, 0.1793142706, 0.2735619843, -0.2096079886, -0.2047401369, -0.0046511758, -0.0219299346, 0.1029740274, -0.0729961321, 0.0078970259, -0.1585483551, 0.5496967435, -0.096837081, -0.0782950968, -0.3212502003, 0.03207146, -0.232945919, -0.0552971028, 0.1789359003, 0.2310498953, 0.1414342225, -0.1671891659, -0.7330245376, 0.1469235271, 0.2807040811, -0.0789484456, 0.2824500799, -0.6361714005, -0.2515560091, -0.1240688637, 0.0589366928, 0.0178229548, -0.2906438112, -0.1190242171, 0.1500849873, 0.0792079121, -0.2228346616, -0.2199817002, -0.0071267961, -0.1568066776, -0.1895319521, 0.438834101, 0.0504116006, -0.1781734377, -0.0951463655, 0.0208670553, 0.1502609551, -0.1083433032, 0.0020462233, 0.5980400443, -0.1331813782, -0.0291011091, 0.4560697377, -0.0017090919, -0.0808270946, 0.0111112064, -0.2403191626, 0.1064089462, -0.1864719242, 0.0284159575, 0.2730591297, 0.0053154388, -0.1614435166, 0.1116661951, 0.0180338416, -0.1406104118, -0.208578974, 0.5285698175, -0.1294043362, -0.1111316606, -0.2098497003, 0.2522191405, -0.2701116204, 0.0049775047, -0.139152661, -0.0752417743, -0.1743356138, -0.2161694467, -0.1959979683, 0.1043633968, 0.2675893009, 0.2678264976, 0.1731940955, -0.292314142, 0.01072489, 0.4745836258, 0.085741289, -0.2254721373, 0.4008433223, 0.3285627067, -0.0989186019, 0.0243503619, 0.341024965, 0.5116846561, 0.5268765688, -0.2755405903, 0.0296223927, 0.0998528078, -0.1723220348, 0.3009313643, 0.1220270172, 0.5902813673, 0.1589996666, 0.1322442144, -0.0237081517, -0.0250821821, 0.233064577, -0.0365250595, 0.190965116, 0.0803817213, 0.624930203, 0.2398195416, -0.3591582775, -0.1490707695, 0.08431831, -0.4341337681, 0.0055401451, 0.4604843259, -0.0493660495, 0.2879997194, -0.0646261275, -0.0263438951, 0.1581726819, 0.6270231009, 0.2333029956, 0.2689684331, -0.3417341709, 0.1156058237, -0.3256516159, 0.3007264435, -0.0014745994, -0.0898731202, 0.0791965201, 0.0009107321, 0.0593977757, 0.1766048968, 0.1285299361, 0.0768043622, -0.1470920295, 0.2389509678, -0.169142589, 0.0240432918, 0.0808031708, 0.2279129177, -0.059403751, -0.3299916387, 0.2175321281, 0.107131809, -0.0194473062, -0.0732564107, 0.0540490858, 0.1230194271, 0.1730817109, 0.1039055437, 0.0345199443, 0.5826874375, 0.1241593957, -0.0638275594, 0.3305566311, -0.1148172617, -0.1746620089, 0.1645623595, 0.2476194501, 0.6241384745, -0.0343468785, 0.2556887567, -0.4483468831, -0.2127870917, -0.026163809, 0.0727968141, -0.258046329, 0.2388152331, -0.2617350519, -0.0323140696, 0.3202944696, -0.0063780677, 0.2982016802, 0.0939635262, -0.42007339, -0.4641219378, 0.3670325875, -0.2881054878, -0.2306283116, -0.1451695263, 0.1122813225, 0.0307798889, 0.0831522197, -0.6610736251, -0.009856143, 0.3323139846, -0.0263020769, -0.2213641256, -0.1205213219, 0.0122636342, 0.185101971, -0.0976042897, 0.2706554532, -0.0960785151, -0.064667277, -0.4541106224, -0.1759289652 ]
https://github.com/huggingface/datasets/issues/469
invalid data type 'str' at _convert_outputs in arrow_dataset.py
I didn't know tokenizers could return strings in the token ids. Which tokenizer are you using to get this @Doragd ?
I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str'
21
invalid data type 'str' at _convert_outputs in arrow_dataset.py I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I didn't know tokenizers could return strings in the token ids. Which tokenizer are you using to get this @Doragd ?
[ -0.2228240967, 0.0242495593, 0.1073714495, 0.2303073108, 0.5109527707, -0.107259661, 0.5323301554, 0.0775898322, -0.3410616815, -0.1247762293, 0.0366579518, 0.3864071369, -0.3696955442, 0.0422176197, 0.0443615951, -0.2024639249, -0.0880346149, 0.0099900309, -0.0232526455, -0.0536391288, 0.0482433699, 0.1829805076, -0.1568262279, 0.4144770503, -0.6451315284, -0.1835789531, 0.1746634543, -0.0963928774, -0.0992208868, -0.4487784207, 0.2202741653, -0.1020441726, 0.4976369739, 0.347232163, -0.0001241712, 0.1380355507, 0.1092859805, 0.101694718, -0.2908718586, -0.3016373515, 0.1341148466, -0.0593845211, 0.4149941206, -0.2015387118, -0.057189513, -0.260091424, -0.0606259182, 0.2617688477, 0.3837755322, 0.5016982555, 0.1173221469, 0.1685163528, 0.2464855909, 0.0738127902, 0.2595638037, 0.3155061305, 0.0754770562, 0.2071240097, 0.0168338399, 0.0266054049, -0.0856947824, 0.0748079345, -0.0701287016, -0.1997739971, 0.216658473, 0.2272826284, 0.1745792627, -0.1476222873, -0.2287846357, 0.1198839471, 0.4332153499, -0.321425736, -0.1559450477, 0.0079212999, -0.0111622857, -0.2727993727, -0.0061669433, 0.2483309209, -0.4277769327, 0.1667016149, -0.162260443, -0.0254668761, -0.3792497218, 0.1995562017, -0.0925178155, 0.5032639503, 0.1183699816, 0.1568169445, 0.1842403114, -0.0144357681, 0.3717097938, 0.0876382515, 0.1397548169, 0.06214853, -0.311694026, -0.030463824, -0.4463339746, -0.648362875, -0.2685148716, -0.2125238627, 0.1655775011, -0.0711524189, 0.2047270238, 0.202950567, 0.233322382, 0.13880077, -0.2101231515, 0.564838469, 0.1000926644, -0.1552505344, -0.1335455775, -0.0250886362, -0.3282390237, -0.0922894478, 0.5121243, 0.1628403366, 0.1257425994, -0.0050322264, -0.0550226159, -0.1488327384, -0.2688643336, -0.0882174447, 0.2847146392, 0.1850693822, 0.0958356559, 0.3832220137, 0.2154192775, 0.1111361384, 0.0493784472, -0.1352440417, 0.0353223011, 0.0855560899, -0.2179708481, -0.1198173016, 0.1821130514, 0.3281979263, -0.2699040771, 0.1215014234, -0.1425368637, -0.2085366696, 0.0015719655, -0.2935897708, -0.0053074392, 0.0134969745, -0.2574836612, 0.309787482, 0.0935745165, -0.3035939038, 0.0196344461, 0.4677719772, -0.4638136625, -0.4341676533, -0.4358196259, 0.0899602696, 0.370847553, -0.1129873395, -0.0923097357, 0.0597353019, 0.4520862997, -0.1888258755, 0.1029472351, -0.5797595978, 0.3521026075, -0.015292665, -0.0832997561, 0.0905466452, -0.4035288393, -0.1816477329, 0.1696707755, -0.1533035189, 0.3111131489, 0.4423997104, -0.3827601373, 0.2947914302, 0.0795271546, 0.016693132, 0.8023686409, -0.3571898043, -0.2179585248, 0.1322550774, -0.1704490185, -0.3259193003, -0.0770722032, 0.2736979127, 0.0906305611, 0.0717986152, -0.0094028264, 0.3914261162, -0.0933150947, 0.2531608939, -0.3342477083, -0.0749925748, 0.3700164855, 0.332087785, 0.2507387102, -0.0335380211, 0.0665315241, 0.3422167003, 0.2596167624, -0.1454963237, 0.2384004742, 0.1618343741, 0.0183554348, -0.1759247929, -0.1052250415, -0.1606464088, -0.3050884902, -0.2020209879, -0.3353255689, 0.4843746722, -0.2394972742, 0.0809494555, -0.1629108638, -0.0729376823, -0.1123220474, 0.2390535921, 0.1080782861, 0.0814390555, -0.1436552405, -0.0689879879, -0.1000486612, -0.0618883967, -0.0523721911, 0.1880999804, 0.0251374617, 0.2732269466, -0.1691004038, -0.1986373365, -0.2601748109, 0.0564329736, 0.255816102, 0.0960626602, -0.2582112551, 0.2561085522, -0.1447918862, -0.258123368, -0.3088115454, 0.3103089333, 0.1554097831, -0.5250988603, 0.0369421802, 0.1614517868, 0.1663212478, -0.0896119177, 0.1419674754, 0.1363631189, 0.0686426386, 0.1380072683, -0.0040353239, 0.3693377674, 0.2155337334, -0.0409566015, 0.2696604729, 0.0495532975, -0.1201176196, -0.1636267453, 0.1193024367, 0.0317244008, -0.2905443609, -0.019627478, 0.4356474876, -0.1525556892, 0.2414224893, 0.4414304793, -0.1187741607, -0.0253545027, -0.1871618032, 0.2185590863, 0.1407993585, -0.0268118996, -0.0851378664, -0.0053835795, -0.253885448, -0.0652511939, 0.3296321929, -0.1268231571, 0.4315136671, 0.1532037109, 0.2892072201, -0.0184705388, -0.0514068864, -0.2919020653, 0.2905477285, 0.2543338239, -0.2341016978, 0.4157404602, -0.102525115, -0.2135274261, -0.6377745271, -0.3706789315, -0.083739467, -0.1330628395, -0.0448595658, -0.0630306453, 0.1643535346, 0.0614361838, 0.0771601498, -0.0667611584, 0.2787643373, -0.1845622808, 0.1062297896, -0.3318831027, -0.399028182, -0.0193081778, 0.2381193638, 0.018272955, -0.1148813814, 0.0174304564, -0.0464679375, -0.0756028444, -0.1490139663, 0.1128376052, -0.0141114593, -0.1526149064, 0.1377332211, -0.0253320429, -0.2624070346, -0.2278357893, 0.3238838911, -0.3288732767, 0.00455443, 0.4567358494, -0.1896834821, -0.0553342476, -0.0512935594, -0.3140721321, -0.5814597011, -0.053909909, 0.0172907468, 0.0343013927, 0.3296329379, 0.3480424881, 0.0307738055, 0.1842595041, 0.0340056829, -0.0597994253, 0.0854179114, 0.1192032844, 0.3146254122, -0.0384520106, -0.2886622548, -0.3471455276, -0.1107912883, 0.0709792227, 0.0762150213, -0.3193143606, 0.1262017339, -0.1260371804, 0.0512027368, -0.2906245887, 0.022035012, 0.448099494, 0.1102448925, -0.0087919021, 0.2124653757, 0.0139714107, 0.3060881495, 0.0416651256, 0.2144848853, -0.0346942768, 0.1787260622, -0.0456409007, 0.6495578289, -0.1418002844, -0.3859344423, 0.1767012626, -0.1262177378, -0.1793364286, -0.0094062882, -0.300276041, -0.0031255512, -0.258731544, -0.0353838615, 0.0021559882, -0.2854908407, -0.3254141212, -0.181138292, 0.1342675388, -0.1632560492, -0.3281489909, 0.3672780395, -0.2507418692, 0.2550689876, -0.1565137953, -0.1447719485, -0.1669238061, -0.436498642, -0.0302335601, 0.1978235096, -0.2999421656, 0.0271619819, -0.5152035952, -0.2360683233, -0.1595629305, 0.0845981091, 0.3666799366, 0.5396201611, 0.0303008333, 0.0349532515, 0.0805859417, 0.1010699868, 0.410641551, 0.1839824021, -0.0750320852, 0.1855863333, 0.1655877233, -0.3579365611, -0.2835208774, -0.5400992632, -0.0822041854, 0.2528800368, 0.0967265815, -0.2896075845, -0.2426506281, 0.222534433, 0.041428905, -0.2890587747, -0.0435759686, 0.017208742, -0.2311727703, -0.2042599767, 0.1062255129, 0.2091032714, 0.3887907565, -0.2306032032, -0.1089196429, 0.0180642717, 0.206056267, 0.1758809835, -0.0173784588, 0.1210727915, -0.1272637397, -0.2719095051, -0.2843089998, 0.2212006599, 0.1246747747, 0.4509958327, 0.1175307557, -0.3715091646, 0.1879757941, -0.0572563782, 0.3409126997, 0.0074070278, -0.1104090735, 0.3472833931, 0.1715256125, 0.317676574, 0.099358514, -0.0289536454, 0.2658731043, -0.077132225, -0.4949769676, -0.0418627784, 0.2745335102, -0.0730240569, -0.0733688399, -0.0241514351, -0.209479019, -0.2615413368, 0.4185968041, 0.3421196938, 1.0206485987, -0.2603802681, 0.3446718752, 0.1092102453, -0.0606014766, 0.4950569868, -0.1539971679, 0.1934899688, -0.5524519682, 0.0472405031, -0.111691542, -0.1971726269, -0.1783651859, 0.3437052965, -0.3830962181, 0.1329992712, -0.0964831635, 0.1960598826, 0.142227605, 0.3196293116, 0.2093945146, -0.2090148926, -0.2368240058, -0.003560581, -0.4814990759, -0.0990893394, -0.0379735306, -0.2874807715, -0.0001370848, -0.3918531239, -0.2000367343, 0.1904891282, -0.2922777534, 0.3384349942, 0.5059809685, -0.106443271, 0.2228135914, 0.1987269074, 0.3068523705, -0.0456336513, 0.0611891039, -0.2703240514, -0.062603958, 0.1166032478, -0.057285022, -0.0534288548, 0.4100271761, -0.0476828478, -0.3138557374, 0.3178366721, 0.0144370897, -0.1757710427, 0.1572690457, -0.0672014579, 0.0875043496, -0.4117053449, 0.2714479566, -0.218857348, -0.3185108304, -0.2686833441, 0.0039162659, 0.0189208351, -0.1227039397, 0.1043700799, 0.3181699812, 0.0148006864, 0.142925337, 0.1666362137, 0.2979537845, 0.2228276283, 0.5636557341, 0.3159724772, 0.0117536075, -0.2083150893, 0.1311720014, 0.0069091055, -0.883816421, 0.1976178139, -0.031380333, -0.2637524903, 0.212391451, 0.3753278255, 0.1270442903, 0.4987854958, -0.1740798354, -0.4247025847, -0.3973775506, 0.0065998165, 0.1742636859, 0.0011970839, 0.0514225662, 0.5306838751, 0.1982194185, 0.1547176242, -0.2049757838, 0.1831800342, -0.339990586, 0.2554390132, -0.1108252928, -0.4195619226, -0.038152203, 0.1254321933, 0.043873366, 0.0017528143, 0.0914920568, -0.0549669676, -0.1826649904, 0.1793142706, 0.2735619843, -0.2096079886, -0.2047401369, -0.0046511758, -0.0219299346, 0.1029740274, -0.0729961321, 0.0078970259, -0.1585483551, 0.5496967435, -0.096837081, -0.0782950968, -0.3212502003, 0.03207146, -0.232945919, -0.0552971028, 0.1789359003, 0.2310498953, 0.1414342225, -0.1671891659, -0.7330245376, 0.1469235271, 0.2807040811, -0.0789484456, 0.2824500799, -0.6361714005, -0.2515560091, -0.1240688637, 0.0589366928, 0.0178229548, -0.2906438112, -0.1190242171, 0.1500849873, 0.0792079121, -0.2228346616, -0.2199817002, -0.0071267961, -0.1568066776, -0.1895319521, 0.438834101, 0.0504116006, -0.1781734377, -0.0951463655, 0.0208670553, 0.1502609551, -0.1083433032, 0.0020462233, 0.5980400443, -0.1331813782, -0.0291011091, 0.4560697377, -0.0017090919, -0.0808270946, 0.0111112064, -0.2403191626, 0.1064089462, -0.1864719242, 0.0284159575, 0.2730591297, 0.0053154388, -0.1614435166, 0.1116661951, 0.0180338416, -0.1406104118, -0.208578974, 0.5285698175, -0.1294043362, -0.1111316606, -0.2098497003, 0.2522191405, -0.2701116204, 0.0049775047, -0.139152661, -0.0752417743, -0.1743356138, -0.2161694467, -0.1959979683, 0.1043633968, 0.2675893009, 0.2678264976, 0.1731940955, -0.292314142, 0.01072489, 0.4745836258, 0.085741289, -0.2254721373, 0.4008433223, 0.3285627067, -0.0989186019, 0.0243503619, 0.341024965, 0.5116846561, 0.5268765688, -0.2755405903, 0.0296223927, 0.0998528078, -0.1723220348, 0.3009313643, 0.1220270172, 0.5902813673, 0.1589996666, 0.1322442144, -0.0237081517, -0.0250821821, 0.233064577, -0.0365250595, 0.190965116, 0.0803817213, 0.624930203, 0.2398195416, -0.3591582775, -0.1490707695, 0.08431831, -0.4341337681, 0.0055401451, 0.4604843259, -0.0493660495, 0.2879997194, -0.0646261275, -0.0263438951, 0.1581726819, 0.6270231009, 0.2333029956, 0.2689684331, -0.3417341709, 0.1156058237, -0.3256516159, 0.3007264435, -0.0014745994, -0.0898731202, 0.0791965201, 0.0009107321, 0.0593977757, 0.1766048968, 0.1285299361, 0.0768043622, -0.1470920295, 0.2389509678, -0.169142589, 0.0240432918, 0.0808031708, 0.2279129177, -0.059403751, -0.3299916387, 0.2175321281, 0.107131809, -0.0194473062, -0.0732564107, 0.0540490858, 0.1230194271, 0.1730817109, 0.1039055437, 0.0345199443, 0.5826874375, 0.1241593957, -0.0638275594, 0.3305566311, -0.1148172617, -0.1746620089, 0.1645623595, 0.2476194501, 0.6241384745, -0.0343468785, 0.2556887567, -0.4483468831, -0.2127870917, -0.026163809, 0.0727968141, -0.258046329, 0.2388152331, -0.2617350519, -0.0323140696, 0.3202944696, -0.0063780677, 0.2982016802, 0.0939635262, -0.42007339, -0.4641219378, 0.3670325875, -0.2881054878, -0.2306283116, -0.1451695263, 0.1122813225, 0.0307798889, 0.0831522197, -0.6610736251, -0.009856143, 0.3323139846, -0.0263020769, -0.2213641256, -0.1205213219, 0.0122636342, 0.185101971, -0.0976042897, 0.2706554532, -0.0960785151, -0.064667277, -0.4541106224, -0.1759289652 ]
https://github.com/huggingface/datasets/issues/469
invalid data type 'str' at _convert_outputs in arrow_dataset.py
> I didn't know tokenizers could return strings in the token ids. Which tokenizer are you using to get this @Doragd ? i'm sorry that i met this issue in another place (not in huggingface repo).
I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str'
36
invalid data type 'str' at _convert_outputs in arrow_dataset.py I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' > I didn't know tokenizers could return strings in the token ids. Which tokenizer are you using to get this @Doragd ? i'm sorry that i met this issue in another place (not in huggingface repo).
[ -0.2228240967, 0.0242495593, 0.1073714495, 0.2303073108, 0.5109527707, -0.107259661, 0.5323301554, 0.0775898322, -0.3410616815, -0.1247762293, 0.0366579518, 0.3864071369, -0.3696955442, 0.0422176197, 0.0443615951, -0.2024639249, -0.0880346149, 0.0099900309, -0.0232526455, -0.0536391288, 0.0482433699, 0.1829805076, -0.1568262279, 0.4144770503, -0.6451315284, -0.1835789531, 0.1746634543, -0.0963928774, -0.0992208868, -0.4487784207, 0.2202741653, -0.1020441726, 0.4976369739, 0.347232163, -0.0001241712, 0.1380355507, 0.1092859805, 0.101694718, -0.2908718586, -0.3016373515, 0.1341148466, -0.0593845211, 0.4149941206, -0.2015387118, -0.057189513, -0.260091424, -0.0606259182, 0.2617688477, 0.3837755322, 0.5016982555, 0.1173221469, 0.1685163528, 0.2464855909, 0.0738127902, 0.2595638037, 0.3155061305, 0.0754770562, 0.2071240097, 0.0168338399, 0.0266054049, -0.0856947824, 0.0748079345, -0.0701287016, -0.1997739971, 0.216658473, 0.2272826284, 0.1745792627, -0.1476222873, -0.2287846357, 0.1198839471, 0.4332153499, -0.321425736, -0.1559450477, 0.0079212999, -0.0111622857, -0.2727993727, -0.0061669433, 0.2483309209, -0.4277769327, 0.1667016149, -0.162260443, -0.0254668761, -0.3792497218, 0.1995562017, -0.0925178155, 0.5032639503, 0.1183699816, 0.1568169445, 0.1842403114, -0.0144357681, 0.3717097938, 0.0876382515, 0.1397548169, 0.06214853, -0.311694026, -0.030463824, -0.4463339746, -0.648362875, -0.2685148716, -0.2125238627, 0.1655775011, -0.0711524189, 0.2047270238, 0.202950567, 0.233322382, 0.13880077, -0.2101231515, 0.564838469, 0.1000926644, -0.1552505344, -0.1335455775, -0.0250886362, -0.3282390237, -0.0922894478, 0.5121243, 0.1628403366, 0.1257425994, -0.0050322264, -0.0550226159, -0.1488327384, -0.2688643336, -0.0882174447, 0.2847146392, 0.1850693822, 0.0958356559, 0.3832220137, 0.2154192775, 0.1111361384, 0.0493784472, -0.1352440417, 0.0353223011, 0.0855560899, -0.2179708481, -0.1198173016, 0.1821130514, 0.3281979263, -0.2699040771, 0.1215014234, -0.1425368637, -0.2085366696, 0.0015719655, -0.2935897708, -0.0053074392, 0.0134969745, -0.2574836612, 0.309787482, 0.0935745165, -0.3035939038, 0.0196344461, 0.4677719772, -0.4638136625, -0.4341676533, -0.4358196259, 0.0899602696, 0.370847553, -0.1129873395, -0.0923097357, 0.0597353019, 0.4520862997, -0.1888258755, 0.1029472351, -0.5797595978, 0.3521026075, -0.015292665, -0.0832997561, 0.0905466452, -0.4035288393, -0.1816477329, 0.1696707755, -0.1533035189, 0.3111131489, 0.4423997104, -0.3827601373, 0.2947914302, 0.0795271546, 0.016693132, 0.8023686409, -0.3571898043, -0.2179585248, 0.1322550774, -0.1704490185, -0.3259193003, -0.0770722032, 0.2736979127, 0.0906305611, 0.0717986152, -0.0094028264, 0.3914261162, -0.0933150947, 0.2531608939, -0.3342477083, -0.0749925748, 0.3700164855, 0.332087785, 0.2507387102, -0.0335380211, 0.0665315241, 0.3422167003, 0.2596167624, -0.1454963237, 0.2384004742, 0.1618343741, 0.0183554348, -0.1759247929, -0.1052250415, -0.1606464088, -0.3050884902, -0.2020209879, -0.3353255689, 0.4843746722, -0.2394972742, 0.0809494555, -0.1629108638, -0.0729376823, -0.1123220474, 0.2390535921, 0.1080782861, 0.0814390555, -0.1436552405, -0.0689879879, -0.1000486612, -0.0618883967, -0.0523721911, 0.1880999804, 0.0251374617, 0.2732269466, -0.1691004038, -0.1986373365, -0.2601748109, 0.0564329736, 0.255816102, 0.0960626602, -0.2582112551, 0.2561085522, -0.1447918862, -0.258123368, -0.3088115454, 0.3103089333, 0.1554097831, -0.5250988603, 0.0369421802, 0.1614517868, 0.1663212478, -0.0896119177, 0.1419674754, 0.1363631189, 0.0686426386, 0.1380072683, -0.0040353239, 0.3693377674, 0.2155337334, -0.0409566015, 0.2696604729, 0.0495532975, -0.1201176196, -0.1636267453, 0.1193024367, 0.0317244008, -0.2905443609, -0.019627478, 0.4356474876, -0.1525556892, 0.2414224893, 0.4414304793, -0.1187741607, -0.0253545027, -0.1871618032, 0.2185590863, 0.1407993585, -0.0268118996, -0.0851378664, -0.0053835795, -0.253885448, -0.0652511939, 0.3296321929, -0.1268231571, 0.4315136671, 0.1532037109, 0.2892072201, -0.0184705388, -0.0514068864, -0.2919020653, 0.2905477285, 0.2543338239, -0.2341016978, 0.4157404602, -0.102525115, -0.2135274261, -0.6377745271, -0.3706789315, -0.083739467, -0.1330628395, -0.0448595658, -0.0630306453, 0.1643535346, 0.0614361838, 0.0771601498, -0.0667611584, 0.2787643373, -0.1845622808, 0.1062297896, -0.3318831027, -0.399028182, -0.0193081778, 0.2381193638, 0.018272955, -0.1148813814, 0.0174304564, -0.0464679375, -0.0756028444, -0.1490139663, 0.1128376052, -0.0141114593, -0.1526149064, 0.1377332211, -0.0253320429, -0.2624070346, -0.2278357893, 0.3238838911, -0.3288732767, 0.00455443, 0.4567358494, -0.1896834821, -0.0553342476, -0.0512935594, -0.3140721321, -0.5814597011, -0.053909909, 0.0172907468, 0.0343013927, 0.3296329379, 0.3480424881, 0.0307738055, 0.1842595041, 0.0340056829, -0.0597994253, 0.0854179114, 0.1192032844, 0.3146254122, -0.0384520106, -0.2886622548, -0.3471455276, -0.1107912883, 0.0709792227, 0.0762150213, -0.3193143606, 0.1262017339, -0.1260371804, 0.0512027368, -0.2906245887, 0.022035012, 0.448099494, 0.1102448925, -0.0087919021, 0.2124653757, 0.0139714107, 0.3060881495, 0.0416651256, 0.2144848853, -0.0346942768, 0.1787260622, -0.0456409007, 0.6495578289, -0.1418002844, -0.3859344423, 0.1767012626, -0.1262177378, -0.1793364286, -0.0094062882, -0.300276041, -0.0031255512, -0.258731544, -0.0353838615, 0.0021559882, -0.2854908407, -0.3254141212, -0.181138292, 0.1342675388, -0.1632560492, -0.3281489909, 0.3672780395, -0.2507418692, 0.2550689876, -0.1565137953, -0.1447719485, -0.1669238061, -0.436498642, -0.0302335601, 0.1978235096, -0.2999421656, 0.0271619819, -0.5152035952, -0.2360683233, -0.1595629305, 0.0845981091, 0.3666799366, 0.5396201611, 0.0303008333, 0.0349532515, 0.0805859417, 0.1010699868, 0.410641551, 0.1839824021, -0.0750320852, 0.1855863333, 0.1655877233, -0.3579365611, -0.2835208774, -0.5400992632, -0.0822041854, 0.2528800368, 0.0967265815, -0.2896075845, -0.2426506281, 0.222534433, 0.041428905, -0.2890587747, -0.0435759686, 0.017208742, -0.2311727703, -0.2042599767, 0.1062255129, 0.2091032714, 0.3887907565, -0.2306032032, -0.1089196429, 0.0180642717, 0.206056267, 0.1758809835, -0.0173784588, 0.1210727915, -0.1272637397, -0.2719095051, -0.2843089998, 0.2212006599, 0.1246747747, 0.4509958327, 0.1175307557, -0.3715091646, 0.1879757941, -0.0572563782, 0.3409126997, 0.0074070278, -0.1104090735, 0.3472833931, 0.1715256125, 0.317676574, 0.099358514, -0.0289536454, 0.2658731043, -0.077132225, -0.4949769676, -0.0418627784, 0.2745335102, -0.0730240569, -0.0733688399, -0.0241514351, -0.209479019, -0.2615413368, 0.4185968041, 0.3421196938, 1.0206485987, -0.2603802681, 0.3446718752, 0.1092102453, -0.0606014766, 0.4950569868, -0.1539971679, 0.1934899688, -0.5524519682, 0.0472405031, -0.111691542, -0.1971726269, -0.1783651859, 0.3437052965, -0.3830962181, 0.1329992712, -0.0964831635, 0.1960598826, 0.142227605, 0.3196293116, 0.2093945146, -0.2090148926, -0.2368240058, -0.003560581, -0.4814990759, -0.0990893394, -0.0379735306, -0.2874807715, -0.0001370848, -0.3918531239, -0.2000367343, 0.1904891282, -0.2922777534, 0.3384349942, 0.5059809685, -0.106443271, 0.2228135914, 0.1987269074, 0.3068523705, -0.0456336513, 0.0611891039, -0.2703240514, -0.062603958, 0.1166032478, -0.057285022, -0.0534288548, 0.4100271761, -0.0476828478, -0.3138557374, 0.3178366721, 0.0144370897, -0.1757710427, 0.1572690457, -0.0672014579, 0.0875043496, -0.4117053449, 0.2714479566, -0.218857348, -0.3185108304, -0.2686833441, 0.0039162659, 0.0189208351, -0.1227039397, 0.1043700799, 0.3181699812, 0.0148006864, 0.142925337, 0.1666362137, 0.2979537845, 0.2228276283, 0.5636557341, 0.3159724772, 0.0117536075, -0.2083150893, 0.1311720014, 0.0069091055, -0.883816421, 0.1976178139, -0.031380333, -0.2637524903, 0.212391451, 0.3753278255, 0.1270442903, 0.4987854958, -0.1740798354, -0.4247025847, -0.3973775506, 0.0065998165, 0.1742636859, 0.0011970839, 0.0514225662, 0.5306838751, 0.1982194185, 0.1547176242, -0.2049757838, 0.1831800342, -0.339990586, 0.2554390132, -0.1108252928, -0.4195619226, -0.038152203, 0.1254321933, 0.043873366, 0.0017528143, 0.0914920568, -0.0549669676, -0.1826649904, 0.1793142706, 0.2735619843, -0.2096079886, -0.2047401369, -0.0046511758, -0.0219299346, 0.1029740274, -0.0729961321, 0.0078970259, -0.1585483551, 0.5496967435, -0.096837081, -0.0782950968, -0.3212502003, 0.03207146, -0.232945919, -0.0552971028, 0.1789359003, 0.2310498953, 0.1414342225, -0.1671891659, -0.7330245376, 0.1469235271, 0.2807040811, -0.0789484456, 0.2824500799, -0.6361714005, -0.2515560091, -0.1240688637, 0.0589366928, 0.0178229548, -0.2906438112, -0.1190242171, 0.1500849873, 0.0792079121, -0.2228346616, -0.2199817002, -0.0071267961, -0.1568066776, -0.1895319521, 0.438834101, 0.0504116006, -0.1781734377, -0.0951463655, 0.0208670553, 0.1502609551, -0.1083433032, 0.0020462233, 0.5980400443, -0.1331813782, -0.0291011091, 0.4560697377, -0.0017090919, -0.0808270946, 0.0111112064, -0.2403191626, 0.1064089462, -0.1864719242, 0.0284159575, 0.2730591297, 0.0053154388, -0.1614435166, 0.1116661951, 0.0180338416, -0.1406104118, -0.208578974, 0.5285698175, -0.1294043362, -0.1111316606, -0.2098497003, 0.2522191405, -0.2701116204, 0.0049775047, -0.139152661, -0.0752417743, -0.1743356138, -0.2161694467, -0.1959979683, 0.1043633968, 0.2675893009, 0.2678264976, 0.1731940955, -0.292314142, 0.01072489, 0.4745836258, 0.085741289, -0.2254721373, 0.4008433223, 0.3285627067, -0.0989186019, 0.0243503619, 0.341024965, 0.5116846561, 0.5268765688, -0.2755405903, 0.0296223927, 0.0998528078, -0.1723220348, 0.3009313643, 0.1220270172, 0.5902813673, 0.1589996666, 0.1322442144, -0.0237081517, -0.0250821821, 0.233064577, -0.0365250595, 0.190965116, 0.0803817213, 0.624930203, 0.2398195416, -0.3591582775, -0.1490707695, 0.08431831, -0.4341337681, 0.0055401451, 0.4604843259, -0.0493660495, 0.2879997194, -0.0646261275, -0.0263438951, 0.1581726819, 0.6270231009, 0.2333029956, 0.2689684331, -0.3417341709, 0.1156058237, -0.3256516159, 0.3007264435, -0.0014745994, -0.0898731202, 0.0791965201, 0.0009107321, 0.0593977757, 0.1766048968, 0.1285299361, 0.0768043622, -0.1470920295, 0.2389509678, -0.169142589, 0.0240432918, 0.0808031708, 0.2279129177, -0.059403751, -0.3299916387, 0.2175321281, 0.107131809, -0.0194473062, -0.0732564107, 0.0540490858, 0.1230194271, 0.1730817109, 0.1039055437, 0.0345199443, 0.5826874375, 0.1241593957, -0.0638275594, 0.3305566311, -0.1148172617, -0.1746620089, 0.1645623595, 0.2476194501, 0.6241384745, -0.0343468785, 0.2556887567, -0.4483468831, -0.2127870917, -0.026163809, 0.0727968141, -0.258046329, 0.2388152331, -0.2617350519, -0.0323140696, 0.3202944696, -0.0063780677, 0.2982016802, 0.0939635262, -0.42007339, -0.4641219378, 0.3670325875, -0.2881054878, -0.2306283116, -0.1451695263, 0.1122813225, 0.0307798889, 0.0831522197, -0.6610736251, -0.009856143, 0.3323139846, -0.0263020769, -0.2213641256, -0.1205213219, 0.0122636342, 0.185101971, -0.0976042897, 0.2706554532, -0.0960785151, -0.064667277, -0.4541106224, -0.1759289652 ]
https://github.com/huggingface/datasets/issues/469
invalid data type 'str' at _convert_outputs in arrow_dataset.py
@akhilkapil do you have strings in your dataset ? When you set the dataset format to "pytorch" you should exclude columns with strings as pytorch can't make tensors out of strings
I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str'
31
invalid data type 'str' at _convert_outputs in arrow_dataset.py I trying to build multi label text classifier model using Transformers lib. I'm using Transformers NLP to load the data set, while calling trainer.train() method. It throws the following error File "C:\***\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' I'm using pyarrow 1.0.0. And I have simple custom data set with Text and Integer Label. Ex: Data Text , Label #Column Header I'm facing an Network issue, 1 I forgot my password, 2 Error StackTrace: File "C:\**\transformers\trainer.py", line 492, in train for step, inputs in enumerate(epoch_iterator): File "C:\**\tqdm\std.py", line 1104, in __iter__ for obj in iterable: File "C:\**\torch\utils\data\dataloader.py", line 345, in __next__ data = self._next_data() File "C:\**\torch\utils\data\dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\**\nlp\arrow_dataset.py", line 414, in __getitem__ output_all_columns=self._output_all_columns, File "C:\**\nlp\arrow_dataset.py", line 403, in _getitem outputs, format_type=format_type, format_columns=format_columns, output_all_columns=output_all_columns File "C:\**\nlp\arrow_dataset.py", line 343, in _convert_outputs v = command(v) TypeError: new(): invalid data type 'str' @akhilkapil do you have strings in your dataset ? When you set the dataset format to "pytorch" you should exclude columns with strings as pytorch can't make tensors out of strings
[ -0.2228240967, 0.0242495593, 0.1073714495, 0.2303073108, 0.5109527707, -0.107259661, 0.5323301554, 0.0775898322, -0.3410616815, -0.1247762293, 0.0366579518, 0.3864071369, -0.3696955442, 0.0422176197, 0.0443615951, -0.2024639249, -0.0880346149, 0.0099900309, -0.0232526455, -0.0536391288, 0.0482433699, 0.1829805076, -0.1568262279, 0.4144770503, -0.6451315284, -0.1835789531, 0.1746634543, -0.0963928774, -0.0992208868, -0.4487784207, 0.2202741653, -0.1020441726, 0.4976369739, 0.347232163, -0.0001241712, 0.1380355507, 0.1092859805, 0.101694718, -0.2908718586, -0.3016373515, 0.1341148466, -0.0593845211, 0.4149941206, -0.2015387118, -0.057189513, -0.260091424, -0.0606259182, 0.2617688477, 0.3837755322, 0.5016982555, 0.1173221469, 0.1685163528, 0.2464855909, 0.0738127902, 0.2595638037, 0.3155061305, 0.0754770562, 0.2071240097, 0.0168338399, 0.0266054049, -0.0856947824, 0.0748079345, -0.0701287016, -0.1997739971, 0.216658473, 0.2272826284, 0.1745792627, -0.1476222873, -0.2287846357, 0.1198839471, 0.4332153499, -0.321425736, -0.1559450477, 0.0079212999, -0.0111622857, -0.2727993727, -0.0061669433, 0.2483309209, -0.4277769327, 0.1667016149, -0.162260443, -0.0254668761, -0.3792497218, 0.1995562017, -0.0925178155, 0.5032639503, 0.1183699816, 0.1568169445, 0.1842403114, -0.0144357681, 0.3717097938, 0.0876382515, 0.1397548169, 0.06214853, -0.311694026, -0.030463824, -0.4463339746, -0.648362875, -0.2685148716, -0.2125238627, 0.1655775011, -0.0711524189, 0.2047270238, 0.202950567, 0.233322382, 0.13880077, -0.2101231515, 0.564838469, 0.1000926644, -0.1552505344, -0.1335455775, -0.0250886362, -0.3282390237, -0.0922894478, 0.5121243, 0.1628403366, 0.1257425994, -0.0050322264, -0.0550226159, -0.1488327384, -0.2688643336, -0.0882174447, 0.2847146392, 0.1850693822, 0.0958356559, 0.3832220137, 0.2154192775, 0.1111361384, 0.0493784472, -0.1352440417, 0.0353223011, 0.0855560899, -0.2179708481, -0.1198173016, 0.1821130514, 0.3281979263, -0.2699040771, 0.1215014234, -0.1425368637, -0.2085366696, 0.0015719655, -0.2935897708, -0.0053074392, 0.0134969745, -0.2574836612, 0.309787482, 0.0935745165, -0.3035939038, 0.0196344461, 0.4677719772, -0.4638136625, -0.4341676533, -0.4358196259, 0.0899602696, 0.370847553, -0.1129873395, -0.0923097357, 0.0597353019, 0.4520862997, -0.1888258755, 0.1029472351, -0.5797595978, 0.3521026075, -0.015292665, -0.0832997561, 0.0905466452, -0.4035288393, -0.1816477329, 0.1696707755, -0.1533035189, 0.3111131489, 0.4423997104, -0.3827601373, 0.2947914302, 0.0795271546, 0.016693132, 0.8023686409, -0.3571898043, -0.2179585248, 0.1322550774, -0.1704490185, -0.3259193003, -0.0770722032, 0.2736979127, 0.0906305611, 0.0717986152, -0.0094028264, 0.3914261162, -0.0933150947, 0.2531608939, -0.3342477083, -0.0749925748, 0.3700164855, 0.332087785, 0.2507387102, -0.0335380211, 0.0665315241, 0.3422167003, 0.2596167624, -0.1454963237, 0.2384004742, 0.1618343741, 0.0183554348, -0.1759247929, -0.1052250415, -0.1606464088, -0.3050884902, -0.2020209879, -0.3353255689, 0.4843746722, -0.2394972742, 0.0809494555, -0.1629108638, -0.0729376823, -0.1123220474, 0.2390535921, 0.1080782861, 0.0814390555, -0.1436552405, -0.0689879879, -0.1000486612, -0.0618883967, -0.0523721911, 0.1880999804, 0.0251374617, 0.2732269466, -0.1691004038, -0.1986373365, -0.2601748109, 0.0564329736, 0.255816102, 0.0960626602, -0.2582112551, 0.2561085522, -0.1447918862, -0.258123368, -0.3088115454, 0.3103089333, 0.1554097831, -0.5250988603, 0.0369421802, 0.1614517868, 0.1663212478, -0.0896119177, 0.1419674754, 0.1363631189, 0.0686426386, 0.1380072683, -0.0040353239, 0.3693377674, 0.2155337334, -0.0409566015, 0.2696604729, 0.0495532975, -0.1201176196, -0.1636267453, 0.1193024367, 0.0317244008, -0.2905443609, -0.019627478, 0.4356474876, -0.1525556892, 0.2414224893, 0.4414304793, -0.1187741607, -0.0253545027, -0.1871618032, 0.2185590863, 0.1407993585, -0.0268118996, -0.0851378664, -0.0053835795, -0.253885448, -0.0652511939, 0.3296321929, -0.1268231571, 0.4315136671, 0.1532037109, 0.2892072201, -0.0184705388, -0.0514068864, -0.2919020653, 0.2905477285, 0.2543338239, -0.2341016978, 0.4157404602, -0.102525115, -0.2135274261, -0.6377745271, -0.3706789315, -0.083739467, -0.1330628395, -0.0448595658, -0.0630306453, 0.1643535346, 0.0614361838, 0.0771601498, -0.0667611584, 0.2787643373, -0.1845622808, 0.1062297896, -0.3318831027, -0.399028182, -0.0193081778, 0.2381193638, 0.018272955, -0.1148813814, 0.0174304564, -0.0464679375, -0.0756028444, -0.1490139663, 0.1128376052, -0.0141114593, -0.1526149064, 0.1377332211, -0.0253320429, -0.2624070346, -0.2278357893, 0.3238838911, -0.3288732767, 0.00455443, 0.4567358494, -0.1896834821, -0.0553342476, -0.0512935594, -0.3140721321, -0.5814597011, -0.053909909, 0.0172907468, 0.0343013927, 0.3296329379, 0.3480424881, 0.0307738055, 0.1842595041, 0.0340056829, -0.0597994253, 0.0854179114, 0.1192032844, 0.3146254122, -0.0384520106, -0.2886622548, -0.3471455276, -0.1107912883, 0.0709792227, 0.0762150213, -0.3193143606, 0.1262017339, -0.1260371804, 0.0512027368, -0.2906245887, 0.022035012, 0.448099494, 0.1102448925, -0.0087919021, 0.2124653757, 0.0139714107, 0.3060881495, 0.0416651256, 0.2144848853, -0.0346942768, 0.1787260622, -0.0456409007, 0.6495578289, -0.1418002844, -0.3859344423, 0.1767012626, -0.1262177378, -0.1793364286, -0.0094062882, -0.300276041, -0.0031255512, -0.258731544, -0.0353838615, 0.0021559882, -0.2854908407, -0.3254141212, -0.181138292, 0.1342675388, -0.1632560492, -0.3281489909, 0.3672780395, -0.2507418692, 0.2550689876, -0.1565137953, -0.1447719485, -0.1669238061, -0.436498642, -0.0302335601, 0.1978235096, -0.2999421656, 0.0271619819, -0.5152035952, -0.2360683233, -0.1595629305, 0.0845981091, 0.3666799366, 0.5396201611, 0.0303008333, 0.0349532515, 0.0805859417, 0.1010699868, 0.410641551, 0.1839824021, -0.0750320852, 0.1855863333, 0.1655877233, -0.3579365611, -0.2835208774, -0.5400992632, -0.0822041854, 0.2528800368, 0.0967265815, -0.2896075845, -0.2426506281, 0.222534433, 0.041428905, -0.2890587747, -0.0435759686, 0.017208742, -0.2311727703, -0.2042599767, 0.1062255129, 0.2091032714, 0.3887907565, -0.2306032032, -0.1089196429, 0.0180642717, 0.206056267, 0.1758809835, -0.0173784588, 0.1210727915, -0.1272637397, -0.2719095051, -0.2843089998, 0.2212006599, 0.1246747747, 0.4509958327, 0.1175307557, -0.3715091646, 0.1879757941, -0.0572563782, 0.3409126997, 0.0074070278, -0.1104090735, 0.3472833931, 0.1715256125, 0.317676574, 0.099358514, -0.0289536454, 0.2658731043, -0.077132225, -0.4949769676, -0.0418627784, 0.2745335102, -0.0730240569, -0.0733688399, -0.0241514351, -0.209479019, -0.2615413368, 0.4185968041, 0.3421196938, 1.0206485987, -0.2603802681, 0.3446718752, 0.1092102453, -0.0606014766, 0.4950569868, -0.1539971679, 0.1934899688, -0.5524519682, 0.0472405031, -0.111691542, -0.1971726269, -0.1783651859, 0.3437052965, -0.3830962181, 0.1329992712, -0.0964831635, 0.1960598826, 0.142227605, 0.3196293116, 0.2093945146, -0.2090148926, -0.2368240058, -0.003560581, -0.4814990759, -0.0990893394, -0.0379735306, -0.2874807715, -0.0001370848, -0.3918531239, -0.2000367343, 0.1904891282, -0.2922777534, 0.3384349942, 0.5059809685, -0.106443271, 0.2228135914, 0.1987269074, 0.3068523705, -0.0456336513, 0.0611891039, -0.2703240514, -0.062603958, 0.1166032478, -0.057285022, -0.0534288548, 0.4100271761, -0.0476828478, -0.3138557374, 0.3178366721, 0.0144370897, -0.1757710427, 0.1572690457, -0.0672014579, 0.0875043496, -0.4117053449, 0.2714479566, -0.218857348, -0.3185108304, -0.2686833441, 0.0039162659, 0.0189208351, -0.1227039397, 0.1043700799, 0.3181699812, 0.0148006864, 0.142925337, 0.1666362137, 0.2979537845, 0.2228276283, 0.5636557341, 0.3159724772, 0.0117536075, -0.2083150893, 0.1311720014, 0.0069091055, -0.883816421, 0.1976178139, -0.031380333, -0.2637524903, 0.212391451, 0.3753278255, 0.1270442903, 0.4987854958, -0.1740798354, -0.4247025847, -0.3973775506, 0.0065998165, 0.1742636859, 0.0011970839, 0.0514225662, 0.5306838751, 0.1982194185, 0.1547176242, -0.2049757838, 0.1831800342, -0.339990586, 0.2554390132, -0.1108252928, -0.4195619226, -0.038152203, 0.1254321933, 0.043873366, 0.0017528143, 0.0914920568, -0.0549669676, -0.1826649904, 0.1793142706, 0.2735619843, -0.2096079886, -0.2047401369, -0.0046511758, -0.0219299346, 0.1029740274, -0.0729961321, 0.0078970259, -0.1585483551, 0.5496967435, -0.096837081, -0.0782950968, -0.3212502003, 0.03207146, -0.232945919, -0.0552971028, 0.1789359003, 0.2310498953, 0.1414342225, -0.1671891659, -0.7330245376, 0.1469235271, 0.2807040811, -0.0789484456, 0.2824500799, -0.6361714005, -0.2515560091, -0.1240688637, 0.0589366928, 0.0178229548, -0.2906438112, -0.1190242171, 0.1500849873, 0.0792079121, -0.2228346616, -0.2199817002, -0.0071267961, -0.1568066776, -0.1895319521, 0.438834101, 0.0504116006, -0.1781734377, -0.0951463655, 0.0208670553, 0.1502609551, -0.1083433032, 0.0020462233, 0.5980400443, -0.1331813782, -0.0291011091, 0.4560697377, -0.0017090919, -0.0808270946, 0.0111112064, -0.2403191626, 0.1064089462, -0.1864719242, 0.0284159575, 0.2730591297, 0.0053154388, -0.1614435166, 0.1116661951, 0.0180338416, -0.1406104118, -0.208578974, 0.5285698175, -0.1294043362, -0.1111316606, -0.2098497003, 0.2522191405, -0.2701116204, 0.0049775047, -0.139152661, -0.0752417743, -0.1743356138, -0.2161694467, -0.1959979683, 0.1043633968, 0.2675893009, 0.2678264976, 0.1731940955, -0.292314142, 0.01072489, 0.4745836258, 0.085741289, -0.2254721373, 0.4008433223, 0.3285627067, -0.0989186019, 0.0243503619, 0.341024965, 0.5116846561, 0.5268765688, -0.2755405903, 0.0296223927, 0.0998528078, -0.1723220348, 0.3009313643, 0.1220270172, 0.5902813673, 0.1589996666, 0.1322442144, -0.0237081517, -0.0250821821, 0.233064577, -0.0365250595, 0.190965116, 0.0803817213, 0.624930203, 0.2398195416, -0.3591582775, -0.1490707695, 0.08431831, -0.4341337681, 0.0055401451, 0.4604843259, -0.0493660495, 0.2879997194, -0.0646261275, -0.0263438951, 0.1581726819, 0.6270231009, 0.2333029956, 0.2689684331, -0.3417341709, 0.1156058237, -0.3256516159, 0.3007264435, -0.0014745994, -0.0898731202, 0.0791965201, 0.0009107321, 0.0593977757, 0.1766048968, 0.1285299361, 0.0768043622, -0.1470920295, 0.2389509678, -0.169142589, 0.0240432918, 0.0808031708, 0.2279129177, -0.059403751, -0.3299916387, 0.2175321281, 0.107131809, -0.0194473062, -0.0732564107, 0.0540490858, 0.1230194271, 0.1730817109, 0.1039055437, 0.0345199443, 0.5826874375, 0.1241593957, -0.0638275594, 0.3305566311, -0.1148172617, -0.1746620089, 0.1645623595, 0.2476194501, 0.6241384745, -0.0343468785, 0.2556887567, -0.4483468831, -0.2127870917, -0.026163809, 0.0727968141, -0.258046329, 0.2388152331, -0.2617350519, -0.0323140696, 0.3202944696, -0.0063780677, 0.2982016802, 0.0939635262, -0.42007339, -0.4641219378, 0.3670325875, -0.2881054878, -0.2306283116, -0.1451695263, 0.1122813225, 0.0307798889, 0.0831522197, -0.6610736251, -0.009856143, 0.3323139846, -0.0263020769, -0.2213641256, -0.1205213219, 0.0122636342, 0.185101971, -0.0976042897, 0.2706554532, -0.0960785151, -0.064667277, -0.4541106224, -0.1759289652 ]
https://github.com/huggingface/datasets/issues/468
UnicodeDecodeError while loading PAN-X task of XTREME dataset
Indeed. Solution 1 is the simplest. This is actually a recurring problem. I think we should scan all the datasets with regexpr to fix the use of `open()` without encodings. And probably add a test in the CI to forbid using this in the future.
Hi 🤗 team! ## Description of the problem I'm running into a `UnicodeDecodeError` while trying to load the PAN-X subset the XTREME dataset: ``` --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-5-1d61f439b843> in <module> ----> 1 dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') /usr/local/lib/python3.6/dist-packages/nlp/load.py in load_dataset(path, name, version, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, save_infos, **config_kwargs) 528 ignore_verifications = ignore_verifications or save_infos 529 # Download/copy dataset processing script --> 530 module_path, hash = prepare_module(path, download_config=download_config, dataset=True) 531 532 # Get dataset builder class from the processing script /usr/local/lib/python3.6/dist-packages/nlp/load.py in prepare_module(path, download_config, dataset, force_local_path, **download_kwargs) 265 266 # Download external imports if needed --> 267 imports = get_imports(local_path) 268 local_imports = [] 269 library_imports = [] /usr/local/lib/python3.6/dist-packages/nlp/load.py in get_imports(file_path) 156 lines = [] 157 with open(file_path, mode="r") as f: --> 158 lines.extend(f.readlines()) 159 160 logger.info("Checking %s for additional imports.", file_path) /usr/lib/python3.6/encodings/ascii.py in decode(self, input, final) 24 class IncrementalDecoder(codecs.IncrementalDecoder): 25 def decode(self, input, final=False): ---> 26 return codecs.ascii_decode(input, self.errors)[0] 27 28 class StreamWriter(Codec,codecs.StreamWriter): UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 111: ordinal not in range(128) ``` ## Steps to reproduce Install from nlp's master branch ```python pip install git+https://github.com/huggingface/nlp.git ``` then run ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') ``` ## OS / platform details - `nlp` version: latest from master - Platform: Linux-4.15.0-72-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.6.9 - PyTorch version (GPU?): 1.4.0 (True) - Tensorflow version (GPU?): 2.1.0 (True) - Using GPU in script?: True - Using distributed or parallel set-up in script?: False ## Proposed solution Either change [line 762](https://github.com/huggingface/nlp/blob/7ada00b1d62f94eee22a7df38c6b01e3f27194b7/datasets/xtreme/xtreme.py#L762) in `xtreme.py` to include UTF-8 encoding: ``` # old with open(filepath) as f # new with open(filepath, encoding='utf-8') as f ``` or raise a warning that suggests setting the locale explicitly, e.g. ```python import locale locale.setlocale(locale.LC_ALL, 'C.UTF-8') ``` I have a preference for the first solution. Let me know if you agree and I'll be happy to implement the simple fix!
45
UnicodeDecodeError while loading PAN-X task of XTREME dataset Hi 🤗 team! ## Description of the problem I'm running into a `UnicodeDecodeError` while trying to load the PAN-X subset the XTREME dataset: ``` --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-5-1d61f439b843> in <module> ----> 1 dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') /usr/local/lib/python3.6/dist-packages/nlp/load.py in load_dataset(path, name, version, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, save_infos, **config_kwargs) 528 ignore_verifications = ignore_verifications or save_infos 529 # Download/copy dataset processing script --> 530 module_path, hash = prepare_module(path, download_config=download_config, dataset=True) 531 532 # Get dataset builder class from the processing script /usr/local/lib/python3.6/dist-packages/nlp/load.py in prepare_module(path, download_config, dataset, force_local_path, **download_kwargs) 265 266 # Download external imports if needed --> 267 imports = get_imports(local_path) 268 local_imports = [] 269 library_imports = [] /usr/local/lib/python3.6/dist-packages/nlp/load.py in get_imports(file_path) 156 lines = [] 157 with open(file_path, mode="r") as f: --> 158 lines.extend(f.readlines()) 159 160 logger.info("Checking %s for additional imports.", file_path) /usr/lib/python3.6/encodings/ascii.py in decode(self, input, final) 24 class IncrementalDecoder(codecs.IncrementalDecoder): 25 def decode(self, input, final=False): ---> 26 return codecs.ascii_decode(input, self.errors)[0] 27 28 class StreamWriter(Codec,codecs.StreamWriter): UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 111: ordinal not in range(128) ``` ## Steps to reproduce Install from nlp's master branch ```python pip install git+https://github.com/huggingface/nlp.git ``` then run ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') ``` ## OS / platform details - `nlp` version: latest from master - Platform: Linux-4.15.0-72-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.6.9 - PyTorch version (GPU?): 1.4.0 (True) - Tensorflow version (GPU?): 2.1.0 (True) - Using GPU in script?: True - Using distributed or parallel set-up in script?: False ## Proposed solution Either change [line 762](https://github.com/huggingface/nlp/blob/7ada00b1d62f94eee22a7df38c6b01e3f27194b7/datasets/xtreme/xtreme.py#L762) in `xtreme.py` to include UTF-8 encoding: ``` # old with open(filepath) as f # new with open(filepath, encoding='utf-8') as f ``` or raise a warning that suggests setting the locale explicitly, e.g. ```python import locale locale.setlocale(locale.LC_ALL, 'C.UTF-8') ``` I have a preference for the first solution. Let me know if you agree and I'll be happy to implement the simple fix! Indeed. Solution 1 is the simplest. This is actually a recurring problem. I think we should scan all the datasets with regexpr to fix the use of `open()` without encodings. And probably add a test in the CI to forbid using this in the future.
[ -0.332601279, -0.0930106416, -0.1336479634, 0.2554298937, 0.3521752954, -0.0277494602, 0.2249826938, 0.3496463597, -0.0286989473, 0.0382287726, -0.0904108137, 0.1502786726, -0.07617452, -0.1970371306, 0.1891058534, -0.2467030138, -0.0738266259, 0.1824580282, 0.1078065261, 0.0069917585, -0.3558881879, 0.1144125015, -0.1869960427, 0.2637091875, -0.3771482408, 0.081082277, 0.2978655994, 0.3204648197, -0.1932806373, -0.6116118431, 0.4130367637, -0.05366401, 0.4325027764, 0.3163449764, -0.0001086041, 0.082585223, 0.3929108679, -0.1319697946, -0.3346781433, -0.1939969808, -0.5915248394, -0.1812519431, -0.0098234611, -0.2595875263, 0.1902400106, 0.0562079065, -0.0642362982, -0.3830468953, 0.1811337769, 0.2071894407, 0.241638571, 0.3705636263, 0.0213383269, 0.0912283361, -0.0455750041, 0.1074258909, -0.1542558968, 0.2494187653, 0.4346243441, 0.0627748221, -0.0191491246, 0.2926938236, -0.0486161895, 0.2481208891, -0.1023555994, 0.1306458563, 0.1399903744, -0.4660045803, 0.1134836376, 0.0036375509, 0.271874845, -0.3664450347, -0.2865586579, -0.2252657413, -0.1094700247, -0.5443435907, 0.2644952238, 0.0905640498, -0.1596594602, -0.0211322978, 0.1131591722, -0.0423875079, -0.1735193431, 0.0391213074, 0.0543593056, 0.3878185749, -0.0600742102, -0.0513225906, -0.0941757187, -0.1786023676, 0.4082854092, -0.1458788961, -0.1436940879, 0.3246293664, -0.2863638401, 0.0724220574, -0.0550465584, -0.3371771872, 0.0668165982, -0.0463104136, -0.0788228586, 0.2744791806, -0.0495556965, 0.0531956032, 0.3093069494, 0.1556753367, 0.2095074058, 0.2245565206, 0.1834985763, 0.1982240379, 0.0829442441, -0.0012048509, -0.175853461, -0.1771318167, 0.3654836714, 0.1934714317, 0.5531743169, -0.31916067, -0.1221155524, 0.0084838448, 0.1728852689, -0.1787240952, 0.0444034189, 0.0144084096, 0.222331062, 0.5070413947, -0.2224071771, 0.2185738087, -0.4622748494, -0.1283478439, -0.1358894706, 0.1796103269, -0.1460781991, -0.0783130899, 0.0963896811, 0.1252890676, 0.1631435305, -0.1422410011, 0.3579079509, -0.0693805888, 0.0396496542, -0.2039280236, -0.2201952636, 0.01378127, 0.1307833642, 0.1039623916, 0.0551504418, -0.1753355116, -0.0369679518, 0.2171099484, -0.1871832907, -0.2070101351, -0.0715537593, 0.2629821897, 0.0267734826, 0.0251534916, -0.4134673476, -0.0887358934, 0.3430744708, 0.0620883703, 0.1139909923, -0.2957780063, 0.0404424444, -0.0858763307, 0.2037116587, 0.3430533409, -0.1321641654, 0.0464634858, 0.1779045761, -0.155011192, 0.2246279567, 0.2967447937, -0.192228049, 0.0937530845, -0.0989214331, 0.5539206862, 0.587988615, -0.4102400839, -0.4520796835, 0.169679001, -0.2588973641, 0.1952017695, -0.116415225, 0.1070557386, 0.3267491758, -0.1174322739, 0.3066208065, 0.6193356514, -0.1105517671, 0.111031048, -0.215863198, 0.0245819055, 0.0014835654, 0.2785249352, 0.2359111756, -0.1938207746, 0.1145047247, 0.2641792595, 0.2436513901, -0.305007875, 0.1434533745, 0.2776196003, 0.099511601, 0.0506756715, -0.1596453786, -0.3252391815, -0.2702026367, 0.2318237424, -0.1383464187, 0.1085470617, -0.3714389205, 0.0401463769, -0.2963202298, 0.0447943658, -0.5638590455, -0.1213939264, 0.1630699933, 0.2012815177, 0.0795096159, 0.0613080524, -0.308508873, 0.2793068886, -0.1050261036, -0.0565540753, -0.5994654894, 0.2591194212, -0.0674928054, -0.3134037852, -0.0747864172, 0.3225339353, 0.0828682557, -0.1350198537, -0.3367398083, 0.2787978053, -0.0855252072, 0.0143847894, 0.0664439127, -0.1704661399, 0.2425210476, -0.4210941195, 0.1616300941, 0.071925953, 0.1278536767, 0.0151308347, 0.1468041688, 0.3288505673, 0.0096396701, 0.0002209738, -0.0022296279, -0.0426437855, 0.4274258614, -0.002031825, 0.086470075, -0.2572607696, 0.2339750677, -0.0238234457, 0.1626574844, -0.0563807748, -0.1947319955, -0.0884139091, 0.5688617826, -0.1365721673, 0.1961639673, 0.127199322, -0.0223116968, 0.0912194327, -0.0803105086, 0.0161401983, 0.2614569664, 0.0181956738, 0.0555700138, 0.0068808692, 0.1075892076, 0.0290951133, 0.1412387937, -0.0843670592, -0.0864135996, -0.071077466, -0.0867035836, -0.0300666243, -0.3335588574, -0.192358464, -0.1055369377, 0.3316012025, -0.1660031825, -0.0535197482, -0.1744427532, -0.1915304959, 0.0373734422, -0.1773096621, -0.1640250683, -0.2362441272, -0.2318592817, 0.0255354419, 0.1254674494, 0.3220965266, -0.4353755414, -0.3569751382, 0.1276555955, -0.3397223353, 0.031621445, -0.2119200379, -0.2546367049, 0.1059964076, 0.3112898171, 0.1780468822, 0.0755409375, -0.3896882832, 0.1155694872, -0.2473889589, -0.0755902007, 0.0593284145, -0.3163182139, 0.1726505607, -0.0393579677, 0.0839219987, -0.0562967807, -0.1811866015, 0.2916715443, -0.2333995849, -0.1716850102, 0.2062583268, 0.0019390116, -0.1965591609, 0.0024224557, -0.1196481138, -0.3280852139, -0.3669330776, 0.0012899827, -0.0777988359, 0.1852786541, 0.1442968994, -0.2602289915, -0.1182347611, 0.114337936, -0.1334740072, -0.1536590159, -0.4095713496, 0.4874742925, -0.3722840846, -0.2143342793, -0.0219014157, -0.1756925285, 0.4781982899, 0.1308038533, -0.2284107357, -0.0028281899, -0.3269364834, 0.2939239144, 0.0070024254, 0.018922694, 0.1398833096, 0.000428223, 0.0058591696, 0.0415180176, -0.0540438183, -0.1960998029, 0.2766463161, 0.1708435416, 0.1009548083, 0.3835440874, -0.1219677851, 0.180129081, -0.0492355563, 0.3242919147, 0.5478321314, 0.0955019668, 0.0651279539, -0.0233802777, -0.4221805036, -0.0489593148, -0.0551073514, 0.0486406572, 0.0079958811, -0.0325142033, -0.1051566675, -0.0710556209, -0.1858094484, -0.1542176306, -0.2681569457, 0.1497886777, -0.2403446138, 0.2449388057, -0.1164385825, 0.0076542557, -0.3299104571, 0.023785213, -0.071319662, 0.1350254864, 0.2146928906, 0.0793463439, -0.195200786, 0.3681938946, -0.4347117245, 0.099815771, 0.3249463737, 0.7038311958, 0.0326969847, 0.0539385714, 0.0414400399, -0.0472926125, -0.0577152446, -0.1116311699, 0.1558758467, 0.1666961461, -0.2209492475, -0.240221709, -0.0395987332, -0.1052685529, 0.300304383, 0.2227610201, -0.035434261, -0.3422703445, -0.1095727086, 0.3165014684, 0.182524398, -0.1780319512, -0.0400576033, -0.4110561013, -0.5928243995, -0.4134849012, 0.0432147384, 0.2406071275, 0.4273457527, 0.3378163278, 0.1650987715, -0.2048254162, -0.2078796029, 0.2217247784, 0.3031237125, 0.0947901979, 0.0685114115, 0.0718199685, -0.2338237613, -0.394234091, 0.1363063008, 0.5306171179, 0.1089844629, -0.709286809, -0.078453362, -0.2032940984, 0.2511306405, 0.0598778278, -0.0541695021, 0.1121878922, -0.1826997548, 0.093862839, 0.0437188558, 0.109184213, 0.1448739916, 0.21288459, -0.6021432281, -0.4522860646, 0.1971880198, 0.0163845755, 0.2952747345, 0.3392183483, -0.1642777324, -0.3164372444, -0.0895481035, 0.1628365666, 0.5518426895, 0.0499164797, 0.1146931574, 0.3466675878, 0.0413424261, 0.0582397245, 0.0459599793, 0.1835667044, -0.2096627206, -0.2382661849, -0.0543800294, -0.0252756886, 0.1658082753, -0.0543143936, 0.0872022733, 0.277522862, 0.073432982, 0.0351332761, 0.2459097803, 0.1984629631, -0.2746992707, -0.4539570808, -0.5819116831, 0.1532523334, -0.3220199049, -0.03099861, -0.1967273802, -0.2522438169, 0.0267227981, -0.2227253467, 0.0441954397, 0.2248591632, -0.1557141989, 0.2739735842, -0.1650169492, -0.5444104075, 0.2062318325, 0.0880708918, 0.301584363, -0.0706011951, 0.1350806952, 0.1731298715, 0.1769679934, -0.0216343161, -0.0828446299, -0.0253755469, 0.0173967797, -0.0310312957, -0.2499280125, 0.0698867887, -0.0188623592, -0.3566618264, -0.2213181555, 0.2003680021, -0.0024189611, -0.0873172209, -0.205395028, -0.199392885, 0.0175071321, -0.1896484792, 0.159420222, 0.0621681623, -0.2342938632, 0.0830630511, 0.0320614576, -0.3447245657, 0.0183397345, 0.0949898809, 0.1793594956, -0.4032030404, 0.5781169534, 0.1079857796, -0.0876558125, -0.1230056286, 0.0509767793, 0.1880124509, -0.5171362162, 0.0444076024, -0.0069698733, 0.0980351418, -0.1275514662, 0.0985040367, 0.0108746709, -0.0961295962, 0.1677367091, -0.416318655, -0.5901712775, 0.1163460836, -0.1201159433, 0.2132864892, 0.0890789554, 0.1483062059, -0.1083182022, -0.0477419831, -0.304250598, 0.1132211387, -0.3167769313, 0.2198823094, 0.2084019184, -0.0789639801, 0.0466102622, 0.05502804, 0.2011431307, 0.3281202912, -0.0766398683, -0.1902381331, 0.0340618081, 0.087311998, -0.086703971, -0.4576304257, -0.0182358213, 0.2222198397, -0.059743017, -0.1353599876, 0.1167748645, 0.1854208112, -0.0626489446, 0.0720704943, 0.1372988373, 0.1072307676, -0.1261374652, 0.29812029, -0.2095624208, 0.4348088503, 0.0386725478, 0.2651923597, 0.0883064643, 0.0721181631, -0.231183663, -0.1048304737, 0.1180977598, 0.1814719588, 0.1432624757, -0.5272974968, 0.1788816005, 0.2601995766, -0.0461182967, 0.3760094941, -0.183552593, -0.0165387336, 0.1208892241, 0.2417025566, -0.1411453485, -0.0686585233, 0.3440245986, -0.2144440264, 0.0001065545, 0.4460251927, 0.1517321169, 0.1151358932, 0.2358344942, 0.1073320657, 0.2825607955, -0.0068990639, 0.2959388494, 0.4751642346, -0.1015862375, -0.0476529263, 0.232284084, 0.134356752, 0.0184184145, 0.6424044371, -0.4427737594, 0.5353499055, -0.0505039468, 0.2583876848, -0.3224717379, -0.3795405328, -0.2869462967, -0.1631640494, -0.0148016782, 0.2366978526, 0.1603485644, -0.3238866031, -0.189129591, 0.0048721912, -0.0439246595, 0.1654583663, -0.2276587933, 0.1310623437, -0.0501658656, -0.0186569951, -0.1377199739, -0.0187569521, 0.0113089001, 0.1884764284, -0.0382183492, 0.2333973497, -0.1012563631, -0.0860913396, 0.1590767801, 0.2796641588, -0.0650408193, -0.264344722, 0.463473618, 0.5010716319, -0.0114837736, -0.0209637806, 0.1890854686, 0.3574214876, 0.4347185194, -0.2235046476, 0.1034592912, 0.0009247987, 0.0185822882, 0.0500134677, 0.1436077207, 0.0140551329, 0.6835592985, 0.178681016, 0.2524064481, -0.1252028644, -0.0167536642, 0.0970187187, -0.2486757338, 0.0330271348, 0.2661144733, 0.1370355189, -0.0323734283, -0.2701377273, -0.0949239507, -0.2792063355, 0.0065418994, 0.3846933544, 0.0213524494, 0.1060539261, -0.1315312982, 0.0763783902, 0.0020455567, 0.4745554924, 0.3403453231, -0.0144476444, -0.3034821451, -0.2072483897, -0.7285959721, 0.1943606585, -0.1984155625, -0.328502655, 0.2497084439, -0.0827104598, -0.0733957663, 0.3360484838, 0.2181291133, 0.3987620473, 0.0736601874, 0.1313436627, -0.3173842132, -0.0350323804, 0.4439383745, 0.0782288164, -0.0843570232, -0.340235889, 0.1098290086, 0.0742682591, 0.1089789197, -0.1935680658, -0.0207892992, -0.0690448433, -0.1324369311, 0.3674145341, 0.2805422544, 0.3930173218, -0.1928328574, -0.1226179972, -0.171455428, -0.3176396489, -0.0810486376, 0.3091647327, 0.0883628577, 0.5725005865, 0.0104071526, -0.0874087289, -0.6893693805, 0.3223952949, -0.1301128864, 0.0926101729, 0.0033729135, 0.1471584737, -0.0745511428, 0.0625719205, 0.0069267177, 0.1489865333, 0.0457483046, 0.4057686329, -0.1709185392, -0.5643859506, 0.3966763914, -0.0855883062, -0.6857154965, -0.1103917807, 0.0107936189, -0.0288262721, -0.0517249927, -0.3539991677, 0.3004594147, 0.2369799912, -0.0079769297, -0.172350049, 0.2072672099, 0.032172624, 0.0402623937, -0.0043206224, 0.4464671314, -0.1106185019, -0.0629548132, 0.1378685683, -0.2023231834 ]
https://github.com/huggingface/datasets/issues/468
UnicodeDecodeError while loading PAN-X task of XTREME dataset
I've created a simple function that seems to do the trick: ```python def apply_encoding_on_file_open(filepath: str): """Apply UTF-8 encoding for all instances where a non-binary file is opened.""" with open(filepath, 'r', encoding='utf-8') as input_file: regexp = re.compile(r""" (?!.*\b(?:encoding|rb|wb|wb+|ab|ab+)\b) (open) \((.*)\) """) input_text = input_file.read() match = regexp.search(input_text) if match: print('Found match!', match.group()) # append utf-8 encoding to matching groups in-place output = regexp.sub(lambda m: m.group()[:-1]+', encoding="utf-8")', input_text) with open(filepath, 'w', encoding='utf-8') as output_file: output_file.write(output) else: print("No match found!") ``` The regexp does a negative lookahead to avoid matching on cases where the encoding is already specified or when binary files are involved. From an implementation perspective: * Would it make sense to include this function in `nlp-cli` so that we can run something like ``` nlp-cli fix_encoding path/to/folder ``` and the command recursively fixes all files in the target? * What is the desired behaviour in the CI test? Here we could either have a simple script that we run as a `job` in the CI and raises an error if a missing encoding is detected. Alternatively we could incorporate this behaviour into the CLI and run that in the CI. Please let me know what you prefer among the alternatives.
Hi 🤗 team! ## Description of the problem I'm running into a `UnicodeDecodeError` while trying to load the PAN-X subset the XTREME dataset: ``` --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-5-1d61f439b843> in <module> ----> 1 dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') /usr/local/lib/python3.6/dist-packages/nlp/load.py in load_dataset(path, name, version, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, save_infos, **config_kwargs) 528 ignore_verifications = ignore_verifications or save_infos 529 # Download/copy dataset processing script --> 530 module_path, hash = prepare_module(path, download_config=download_config, dataset=True) 531 532 # Get dataset builder class from the processing script /usr/local/lib/python3.6/dist-packages/nlp/load.py in prepare_module(path, download_config, dataset, force_local_path, **download_kwargs) 265 266 # Download external imports if needed --> 267 imports = get_imports(local_path) 268 local_imports = [] 269 library_imports = [] /usr/local/lib/python3.6/dist-packages/nlp/load.py in get_imports(file_path) 156 lines = [] 157 with open(file_path, mode="r") as f: --> 158 lines.extend(f.readlines()) 159 160 logger.info("Checking %s for additional imports.", file_path) /usr/lib/python3.6/encodings/ascii.py in decode(self, input, final) 24 class IncrementalDecoder(codecs.IncrementalDecoder): 25 def decode(self, input, final=False): ---> 26 return codecs.ascii_decode(input, self.errors)[0] 27 28 class StreamWriter(Codec,codecs.StreamWriter): UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 111: ordinal not in range(128) ``` ## Steps to reproduce Install from nlp's master branch ```python pip install git+https://github.com/huggingface/nlp.git ``` then run ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') ``` ## OS / platform details - `nlp` version: latest from master - Platform: Linux-4.15.0-72-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.6.9 - PyTorch version (GPU?): 1.4.0 (True) - Tensorflow version (GPU?): 2.1.0 (True) - Using GPU in script?: True - Using distributed or parallel set-up in script?: False ## Proposed solution Either change [line 762](https://github.com/huggingface/nlp/blob/7ada00b1d62f94eee22a7df38c6b01e3f27194b7/datasets/xtreme/xtreme.py#L762) in `xtreme.py` to include UTF-8 encoding: ``` # old with open(filepath) as f # new with open(filepath, encoding='utf-8') as f ``` or raise a warning that suggests setting the locale explicitly, e.g. ```python import locale locale.setlocale(locale.LC_ALL, 'C.UTF-8') ``` I have a preference for the first solution. Let me know if you agree and I'll be happy to implement the simple fix!
200
UnicodeDecodeError while loading PAN-X task of XTREME dataset Hi 🤗 team! ## Description of the problem I'm running into a `UnicodeDecodeError` while trying to load the PAN-X subset the XTREME dataset: ``` --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-5-1d61f439b843> in <module> ----> 1 dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') /usr/local/lib/python3.6/dist-packages/nlp/load.py in load_dataset(path, name, version, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, save_infos, **config_kwargs) 528 ignore_verifications = ignore_verifications or save_infos 529 # Download/copy dataset processing script --> 530 module_path, hash = prepare_module(path, download_config=download_config, dataset=True) 531 532 # Get dataset builder class from the processing script /usr/local/lib/python3.6/dist-packages/nlp/load.py in prepare_module(path, download_config, dataset, force_local_path, **download_kwargs) 265 266 # Download external imports if needed --> 267 imports = get_imports(local_path) 268 local_imports = [] 269 library_imports = [] /usr/local/lib/python3.6/dist-packages/nlp/load.py in get_imports(file_path) 156 lines = [] 157 with open(file_path, mode="r") as f: --> 158 lines.extend(f.readlines()) 159 160 logger.info("Checking %s for additional imports.", file_path) /usr/lib/python3.6/encodings/ascii.py in decode(self, input, final) 24 class IncrementalDecoder(codecs.IncrementalDecoder): 25 def decode(self, input, final=False): ---> 26 return codecs.ascii_decode(input, self.errors)[0] 27 28 class StreamWriter(Codec,codecs.StreamWriter): UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 111: ordinal not in range(128) ``` ## Steps to reproduce Install from nlp's master branch ```python pip install git+https://github.com/huggingface/nlp.git ``` then run ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') ``` ## OS / platform details - `nlp` version: latest from master - Platform: Linux-4.15.0-72-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.6.9 - PyTorch version (GPU?): 1.4.0 (True) - Tensorflow version (GPU?): 2.1.0 (True) - Using GPU in script?: True - Using distributed or parallel set-up in script?: False ## Proposed solution Either change [line 762](https://github.com/huggingface/nlp/blob/7ada00b1d62f94eee22a7df38c6b01e3f27194b7/datasets/xtreme/xtreme.py#L762) in `xtreme.py` to include UTF-8 encoding: ``` # old with open(filepath) as f # new with open(filepath, encoding='utf-8') as f ``` or raise a warning that suggests setting the locale explicitly, e.g. ```python import locale locale.setlocale(locale.LC_ALL, 'C.UTF-8') ``` I have a preference for the first solution. Let me know if you agree and I'll be happy to implement the simple fix! I've created a simple function that seems to do the trick: ```python def apply_encoding_on_file_open(filepath: str): """Apply UTF-8 encoding for all instances where a non-binary file is opened.""" with open(filepath, 'r', encoding='utf-8') as input_file: regexp = re.compile(r""" (?!.*\b(?:encoding|rb|wb|wb+|ab|ab+)\b) (open) \((.*)\) """) input_text = input_file.read() match = regexp.search(input_text) if match: print('Found match!', match.group()) # append utf-8 encoding to matching groups in-place output = regexp.sub(lambda m: m.group()[:-1]+', encoding="utf-8")', input_text) with open(filepath, 'w', encoding='utf-8') as output_file: output_file.write(output) else: print("No match found!") ``` The regexp does a negative lookahead to avoid matching on cases where the encoding is already specified or when binary files are involved. From an implementation perspective: * Would it make sense to include this function in `nlp-cli` so that we can run something like ``` nlp-cli fix_encoding path/to/folder ``` and the command recursively fixes all files in the target? * What is the desired behaviour in the CI test? Here we could either have a simple script that we run as a `job` in the CI and raises an error if a missing encoding is detected. Alternatively we could incorporate this behaviour into the CLI and run that in the CI. Please let me know what you prefer among the alternatives.
[ -0.332601279, -0.0930106416, -0.1336479634, 0.2554298937, 0.3521752954, -0.0277494602, 0.2249826938, 0.3496463597, -0.0286989473, 0.0382287726, -0.0904108137, 0.1502786726, -0.07617452, -0.1970371306, 0.1891058534, -0.2467030138, -0.0738266259, 0.1824580282, 0.1078065261, 0.0069917585, -0.3558881879, 0.1144125015, -0.1869960427, 0.2637091875, -0.3771482408, 0.081082277, 0.2978655994, 0.3204648197, -0.1932806373, -0.6116118431, 0.4130367637, -0.05366401, 0.4325027764, 0.3163449764, -0.0001086041, 0.082585223, 0.3929108679, -0.1319697946, -0.3346781433, -0.1939969808, -0.5915248394, -0.1812519431, -0.0098234611, -0.2595875263, 0.1902400106, 0.0562079065, -0.0642362982, -0.3830468953, 0.1811337769, 0.2071894407, 0.241638571, 0.3705636263, 0.0213383269, 0.0912283361, -0.0455750041, 0.1074258909, -0.1542558968, 0.2494187653, 0.4346243441, 0.0627748221, -0.0191491246, 0.2926938236, -0.0486161895, 0.2481208891, -0.1023555994, 0.1306458563, 0.1399903744, -0.4660045803, 0.1134836376, 0.0036375509, 0.271874845, -0.3664450347, -0.2865586579, -0.2252657413, -0.1094700247, -0.5443435907, 0.2644952238, 0.0905640498, -0.1596594602, -0.0211322978, 0.1131591722, -0.0423875079, -0.1735193431, 0.0391213074, 0.0543593056, 0.3878185749, -0.0600742102, -0.0513225906, -0.0941757187, -0.1786023676, 0.4082854092, -0.1458788961, -0.1436940879, 0.3246293664, -0.2863638401, 0.0724220574, -0.0550465584, -0.3371771872, 0.0668165982, -0.0463104136, -0.0788228586, 0.2744791806, -0.0495556965, 0.0531956032, 0.3093069494, 0.1556753367, 0.2095074058, 0.2245565206, 0.1834985763, 0.1982240379, 0.0829442441, -0.0012048509, -0.175853461, -0.1771318167, 0.3654836714, 0.1934714317, 0.5531743169, -0.31916067, -0.1221155524, 0.0084838448, 0.1728852689, -0.1787240952, 0.0444034189, 0.0144084096, 0.222331062, 0.5070413947, -0.2224071771, 0.2185738087, -0.4622748494, -0.1283478439, -0.1358894706, 0.1796103269, -0.1460781991, -0.0783130899, 0.0963896811, 0.1252890676, 0.1631435305, -0.1422410011, 0.3579079509, -0.0693805888, 0.0396496542, -0.2039280236, -0.2201952636, 0.01378127, 0.1307833642, 0.1039623916, 0.0551504418, -0.1753355116, -0.0369679518, 0.2171099484, -0.1871832907, -0.2070101351, -0.0715537593, 0.2629821897, 0.0267734826, 0.0251534916, -0.4134673476, -0.0887358934, 0.3430744708, 0.0620883703, 0.1139909923, -0.2957780063, 0.0404424444, -0.0858763307, 0.2037116587, 0.3430533409, -0.1321641654, 0.0464634858, 0.1779045761, -0.155011192, 0.2246279567, 0.2967447937, -0.192228049, 0.0937530845, -0.0989214331, 0.5539206862, 0.587988615, -0.4102400839, -0.4520796835, 0.169679001, -0.2588973641, 0.1952017695, -0.116415225, 0.1070557386, 0.3267491758, -0.1174322739, 0.3066208065, 0.6193356514, -0.1105517671, 0.111031048, -0.215863198, 0.0245819055, 0.0014835654, 0.2785249352, 0.2359111756, -0.1938207746, 0.1145047247, 0.2641792595, 0.2436513901, -0.305007875, 0.1434533745, 0.2776196003, 0.099511601, 0.0506756715, -0.1596453786, -0.3252391815, -0.2702026367, 0.2318237424, -0.1383464187, 0.1085470617, -0.3714389205, 0.0401463769, -0.2963202298, 0.0447943658, -0.5638590455, -0.1213939264, 0.1630699933, 0.2012815177, 0.0795096159, 0.0613080524, -0.308508873, 0.2793068886, -0.1050261036, -0.0565540753, -0.5994654894, 0.2591194212, -0.0674928054, -0.3134037852, -0.0747864172, 0.3225339353, 0.0828682557, -0.1350198537, -0.3367398083, 0.2787978053, -0.0855252072, 0.0143847894, 0.0664439127, -0.1704661399, 0.2425210476, -0.4210941195, 0.1616300941, 0.071925953, 0.1278536767, 0.0151308347, 0.1468041688, 0.3288505673, 0.0096396701, 0.0002209738, -0.0022296279, -0.0426437855, 0.4274258614, -0.002031825, 0.086470075, -0.2572607696, 0.2339750677, -0.0238234457, 0.1626574844, -0.0563807748, -0.1947319955, -0.0884139091, 0.5688617826, -0.1365721673, 0.1961639673, 0.127199322, -0.0223116968, 0.0912194327, -0.0803105086, 0.0161401983, 0.2614569664, 0.0181956738, 0.0555700138, 0.0068808692, 0.1075892076, 0.0290951133, 0.1412387937, -0.0843670592, -0.0864135996, -0.071077466, -0.0867035836, -0.0300666243, -0.3335588574, -0.192358464, -0.1055369377, 0.3316012025, -0.1660031825, -0.0535197482, -0.1744427532, -0.1915304959, 0.0373734422, -0.1773096621, -0.1640250683, -0.2362441272, -0.2318592817, 0.0255354419, 0.1254674494, 0.3220965266, -0.4353755414, -0.3569751382, 0.1276555955, -0.3397223353, 0.031621445, -0.2119200379, -0.2546367049, 0.1059964076, 0.3112898171, 0.1780468822, 0.0755409375, -0.3896882832, 0.1155694872, -0.2473889589, -0.0755902007, 0.0593284145, -0.3163182139, 0.1726505607, -0.0393579677, 0.0839219987, -0.0562967807, -0.1811866015, 0.2916715443, -0.2333995849, -0.1716850102, 0.2062583268, 0.0019390116, -0.1965591609, 0.0024224557, -0.1196481138, -0.3280852139, -0.3669330776, 0.0012899827, -0.0777988359, 0.1852786541, 0.1442968994, -0.2602289915, -0.1182347611, 0.114337936, -0.1334740072, -0.1536590159, -0.4095713496, 0.4874742925, -0.3722840846, -0.2143342793, -0.0219014157, -0.1756925285, 0.4781982899, 0.1308038533, -0.2284107357, -0.0028281899, -0.3269364834, 0.2939239144, 0.0070024254, 0.018922694, 0.1398833096, 0.000428223, 0.0058591696, 0.0415180176, -0.0540438183, -0.1960998029, 0.2766463161, 0.1708435416, 0.1009548083, 0.3835440874, -0.1219677851, 0.180129081, -0.0492355563, 0.3242919147, 0.5478321314, 0.0955019668, 0.0651279539, -0.0233802777, -0.4221805036, -0.0489593148, -0.0551073514, 0.0486406572, 0.0079958811, -0.0325142033, -0.1051566675, -0.0710556209, -0.1858094484, -0.1542176306, -0.2681569457, 0.1497886777, -0.2403446138, 0.2449388057, -0.1164385825, 0.0076542557, -0.3299104571, 0.023785213, -0.071319662, 0.1350254864, 0.2146928906, 0.0793463439, -0.195200786, 0.3681938946, -0.4347117245, 0.099815771, 0.3249463737, 0.7038311958, 0.0326969847, 0.0539385714, 0.0414400399, -0.0472926125, -0.0577152446, -0.1116311699, 0.1558758467, 0.1666961461, -0.2209492475, -0.240221709, -0.0395987332, -0.1052685529, 0.300304383, 0.2227610201, -0.035434261, -0.3422703445, -0.1095727086, 0.3165014684, 0.182524398, -0.1780319512, -0.0400576033, -0.4110561013, -0.5928243995, -0.4134849012, 0.0432147384, 0.2406071275, 0.4273457527, 0.3378163278, 0.1650987715, -0.2048254162, -0.2078796029, 0.2217247784, 0.3031237125, 0.0947901979, 0.0685114115, 0.0718199685, -0.2338237613, -0.394234091, 0.1363063008, 0.5306171179, 0.1089844629, -0.709286809, -0.078453362, -0.2032940984, 0.2511306405, 0.0598778278, -0.0541695021, 0.1121878922, -0.1826997548, 0.093862839, 0.0437188558, 0.109184213, 0.1448739916, 0.21288459, -0.6021432281, -0.4522860646, 0.1971880198, 0.0163845755, 0.2952747345, 0.3392183483, -0.1642777324, -0.3164372444, -0.0895481035, 0.1628365666, 0.5518426895, 0.0499164797, 0.1146931574, 0.3466675878, 0.0413424261, 0.0582397245, 0.0459599793, 0.1835667044, -0.2096627206, -0.2382661849, -0.0543800294, -0.0252756886, 0.1658082753, -0.0543143936, 0.0872022733, 0.277522862, 0.073432982, 0.0351332761, 0.2459097803, 0.1984629631, -0.2746992707, -0.4539570808, -0.5819116831, 0.1532523334, -0.3220199049, -0.03099861, -0.1967273802, -0.2522438169, 0.0267227981, -0.2227253467, 0.0441954397, 0.2248591632, -0.1557141989, 0.2739735842, -0.1650169492, -0.5444104075, 0.2062318325, 0.0880708918, 0.301584363, -0.0706011951, 0.1350806952, 0.1731298715, 0.1769679934, -0.0216343161, -0.0828446299, -0.0253755469, 0.0173967797, -0.0310312957, -0.2499280125, 0.0698867887, -0.0188623592, -0.3566618264, -0.2213181555, 0.2003680021, -0.0024189611, -0.0873172209, -0.205395028, -0.199392885, 0.0175071321, -0.1896484792, 0.159420222, 0.0621681623, -0.2342938632, 0.0830630511, 0.0320614576, -0.3447245657, 0.0183397345, 0.0949898809, 0.1793594956, -0.4032030404, 0.5781169534, 0.1079857796, -0.0876558125, -0.1230056286, 0.0509767793, 0.1880124509, -0.5171362162, 0.0444076024, -0.0069698733, 0.0980351418, -0.1275514662, 0.0985040367, 0.0108746709, -0.0961295962, 0.1677367091, -0.416318655, -0.5901712775, 0.1163460836, -0.1201159433, 0.2132864892, 0.0890789554, 0.1483062059, -0.1083182022, -0.0477419831, -0.304250598, 0.1132211387, -0.3167769313, 0.2198823094, 0.2084019184, -0.0789639801, 0.0466102622, 0.05502804, 0.2011431307, 0.3281202912, -0.0766398683, -0.1902381331, 0.0340618081, 0.087311998, -0.086703971, -0.4576304257, -0.0182358213, 0.2222198397, -0.059743017, -0.1353599876, 0.1167748645, 0.1854208112, -0.0626489446, 0.0720704943, 0.1372988373, 0.1072307676, -0.1261374652, 0.29812029, -0.2095624208, 0.4348088503, 0.0386725478, 0.2651923597, 0.0883064643, 0.0721181631, -0.231183663, -0.1048304737, 0.1180977598, 0.1814719588, 0.1432624757, -0.5272974968, 0.1788816005, 0.2601995766, -0.0461182967, 0.3760094941, -0.183552593, -0.0165387336, 0.1208892241, 0.2417025566, -0.1411453485, -0.0686585233, 0.3440245986, -0.2144440264, 0.0001065545, 0.4460251927, 0.1517321169, 0.1151358932, 0.2358344942, 0.1073320657, 0.2825607955, -0.0068990639, 0.2959388494, 0.4751642346, -0.1015862375, -0.0476529263, 0.232284084, 0.134356752, 0.0184184145, 0.6424044371, -0.4427737594, 0.5353499055, -0.0505039468, 0.2583876848, -0.3224717379, -0.3795405328, -0.2869462967, -0.1631640494, -0.0148016782, 0.2366978526, 0.1603485644, -0.3238866031, -0.189129591, 0.0048721912, -0.0439246595, 0.1654583663, -0.2276587933, 0.1310623437, -0.0501658656, -0.0186569951, -0.1377199739, -0.0187569521, 0.0113089001, 0.1884764284, -0.0382183492, 0.2333973497, -0.1012563631, -0.0860913396, 0.1590767801, 0.2796641588, -0.0650408193, -0.264344722, 0.463473618, 0.5010716319, -0.0114837736, -0.0209637806, 0.1890854686, 0.3574214876, 0.4347185194, -0.2235046476, 0.1034592912, 0.0009247987, 0.0185822882, 0.0500134677, 0.1436077207, 0.0140551329, 0.6835592985, 0.178681016, 0.2524064481, -0.1252028644, -0.0167536642, 0.0970187187, -0.2486757338, 0.0330271348, 0.2661144733, 0.1370355189, -0.0323734283, -0.2701377273, -0.0949239507, -0.2792063355, 0.0065418994, 0.3846933544, 0.0213524494, 0.1060539261, -0.1315312982, 0.0763783902, 0.0020455567, 0.4745554924, 0.3403453231, -0.0144476444, -0.3034821451, -0.2072483897, -0.7285959721, 0.1943606585, -0.1984155625, -0.328502655, 0.2497084439, -0.0827104598, -0.0733957663, 0.3360484838, 0.2181291133, 0.3987620473, 0.0736601874, 0.1313436627, -0.3173842132, -0.0350323804, 0.4439383745, 0.0782288164, -0.0843570232, -0.340235889, 0.1098290086, 0.0742682591, 0.1089789197, -0.1935680658, -0.0207892992, -0.0690448433, -0.1324369311, 0.3674145341, 0.2805422544, 0.3930173218, -0.1928328574, -0.1226179972, -0.171455428, -0.3176396489, -0.0810486376, 0.3091647327, 0.0883628577, 0.5725005865, 0.0104071526, -0.0874087289, -0.6893693805, 0.3223952949, -0.1301128864, 0.0926101729, 0.0033729135, 0.1471584737, -0.0745511428, 0.0625719205, 0.0069267177, 0.1489865333, 0.0457483046, 0.4057686329, -0.1709185392, -0.5643859506, 0.3966763914, -0.0855883062, -0.6857154965, -0.1103917807, 0.0107936189, -0.0288262721, -0.0517249927, -0.3539991677, 0.3004594147, 0.2369799912, -0.0079769297, -0.172350049, 0.2072672099, 0.032172624, 0.0402623937, -0.0043206224, 0.4464671314, -0.1106185019, -0.0629548132, 0.1378685683, -0.2023231834 ]
https://github.com/huggingface/datasets/issues/468
UnicodeDecodeError while loading PAN-X task of XTREME dataset
I realised I was overthinking the problem, so decided to just run the regexp over the codebase and make the PR. In other words, we can ignore my comments about using the CLI 😸
Hi 🤗 team! ## Description of the problem I'm running into a `UnicodeDecodeError` while trying to load the PAN-X subset the XTREME dataset: ``` --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-5-1d61f439b843> in <module> ----> 1 dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') /usr/local/lib/python3.6/dist-packages/nlp/load.py in load_dataset(path, name, version, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, save_infos, **config_kwargs) 528 ignore_verifications = ignore_verifications or save_infos 529 # Download/copy dataset processing script --> 530 module_path, hash = prepare_module(path, download_config=download_config, dataset=True) 531 532 # Get dataset builder class from the processing script /usr/local/lib/python3.6/dist-packages/nlp/load.py in prepare_module(path, download_config, dataset, force_local_path, **download_kwargs) 265 266 # Download external imports if needed --> 267 imports = get_imports(local_path) 268 local_imports = [] 269 library_imports = [] /usr/local/lib/python3.6/dist-packages/nlp/load.py in get_imports(file_path) 156 lines = [] 157 with open(file_path, mode="r") as f: --> 158 lines.extend(f.readlines()) 159 160 logger.info("Checking %s for additional imports.", file_path) /usr/lib/python3.6/encodings/ascii.py in decode(self, input, final) 24 class IncrementalDecoder(codecs.IncrementalDecoder): 25 def decode(self, input, final=False): ---> 26 return codecs.ascii_decode(input, self.errors)[0] 27 28 class StreamWriter(Codec,codecs.StreamWriter): UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 111: ordinal not in range(128) ``` ## Steps to reproduce Install from nlp's master branch ```python pip install git+https://github.com/huggingface/nlp.git ``` then run ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') ``` ## OS / platform details - `nlp` version: latest from master - Platform: Linux-4.15.0-72-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.6.9 - PyTorch version (GPU?): 1.4.0 (True) - Tensorflow version (GPU?): 2.1.0 (True) - Using GPU in script?: True - Using distributed or parallel set-up in script?: False ## Proposed solution Either change [line 762](https://github.com/huggingface/nlp/blob/7ada00b1d62f94eee22a7df38c6b01e3f27194b7/datasets/xtreme/xtreme.py#L762) in `xtreme.py` to include UTF-8 encoding: ``` # old with open(filepath) as f # new with open(filepath, encoding='utf-8') as f ``` or raise a warning that suggests setting the locale explicitly, e.g. ```python import locale locale.setlocale(locale.LC_ALL, 'C.UTF-8') ``` I have a preference for the first solution. Let me know if you agree and I'll be happy to implement the simple fix!
34
UnicodeDecodeError while loading PAN-X task of XTREME dataset Hi 🤗 team! ## Description of the problem I'm running into a `UnicodeDecodeError` while trying to load the PAN-X subset the XTREME dataset: ``` --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-5-1d61f439b843> in <module> ----> 1 dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') /usr/local/lib/python3.6/dist-packages/nlp/load.py in load_dataset(path, name, version, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, save_infos, **config_kwargs) 528 ignore_verifications = ignore_verifications or save_infos 529 # Download/copy dataset processing script --> 530 module_path, hash = prepare_module(path, download_config=download_config, dataset=True) 531 532 # Get dataset builder class from the processing script /usr/local/lib/python3.6/dist-packages/nlp/load.py in prepare_module(path, download_config, dataset, force_local_path, **download_kwargs) 265 266 # Download external imports if needed --> 267 imports = get_imports(local_path) 268 local_imports = [] 269 library_imports = [] /usr/local/lib/python3.6/dist-packages/nlp/load.py in get_imports(file_path) 156 lines = [] 157 with open(file_path, mode="r") as f: --> 158 lines.extend(f.readlines()) 159 160 logger.info("Checking %s for additional imports.", file_path) /usr/lib/python3.6/encodings/ascii.py in decode(self, input, final) 24 class IncrementalDecoder(codecs.IncrementalDecoder): 25 def decode(self, input, final=False): ---> 26 return codecs.ascii_decode(input, self.errors)[0] 27 28 class StreamWriter(Codec,codecs.StreamWriter): UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 111: ordinal not in range(128) ``` ## Steps to reproduce Install from nlp's master branch ```python pip install git+https://github.com/huggingface/nlp.git ``` then run ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') ``` ## OS / platform details - `nlp` version: latest from master - Platform: Linux-4.15.0-72-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.6.9 - PyTorch version (GPU?): 1.4.0 (True) - Tensorflow version (GPU?): 2.1.0 (True) - Using GPU in script?: True - Using distributed or parallel set-up in script?: False ## Proposed solution Either change [line 762](https://github.com/huggingface/nlp/blob/7ada00b1d62f94eee22a7df38c6b01e3f27194b7/datasets/xtreme/xtreme.py#L762) in `xtreme.py` to include UTF-8 encoding: ``` # old with open(filepath) as f # new with open(filepath, encoding='utf-8') as f ``` or raise a warning that suggests setting the locale explicitly, e.g. ```python import locale locale.setlocale(locale.LC_ALL, 'C.UTF-8') ``` I have a preference for the first solution. Let me know if you agree and I'll be happy to implement the simple fix! I realised I was overthinking the problem, so decided to just run the regexp over the codebase and make the PR. In other words, we can ignore my comments about using the CLI 😸
[ -0.332601279, -0.0930106416, -0.1336479634, 0.2554298937, 0.3521752954, -0.0277494602, 0.2249826938, 0.3496463597, -0.0286989473, 0.0382287726, -0.0904108137, 0.1502786726, -0.07617452, -0.1970371306, 0.1891058534, -0.2467030138, -0.0738266259, 0.1824580282, 0.1078065261, 0.0069917585, -0.3558881879, 0.1144125015, -0.1869960427, 0.2637091875, -0.3771482408, 0.081082277, 0.2978655994, 0.3204648197, -0.1932806373, -0.6116118431, 0.4130367637, -0.05366401, 0.4325027764, 0.3163449764, -0.0001086041, 0.082585223, 0.3929108679, -0.1319697946, -0.3346781433, -0.1939969808, -0.5915248394, -0.1812519431, -0.0098234611, -0.2595875263, 0.1902400106, 0.0562079065, -0.0642362982, -0.3830468953, 0.1811337769, 0.2071894407, 0.241638571, 0.3705636263, 0.0213383269, 0.0912283361, -0.0455750041, 0.1074258909, -0.1542558968, 0.2494187653, 0.4346243441, 0.0627748221, -0.0191491246, 0.2926938236, -0.0486161895, 0.2481208891, -0.1023555994, 0.1306458563, 0.1399903744, -0.4660045803, 0.1134836376, 0.0036375509, 0.271874845, -0.3664450347, -0.2865586579, -0.2252657413, -0.1094700247, -0.5443435907, 0.2644952238, 0.0905640498, -0.1596594602, -0.0211322978, 0.1131591722, -0.0423875079, -0.1735193431, 0.0391213074, 0.0543593056, 0.3878185749, -0.0600742102, -0.0513225906, -0.0941757187, -0.1786023676, 0.4082854092, -0.1458788961, -0.1436940879, 0.3246293664, -0.2863638401, 0.0724220574, -0.0550465584, -0.3371771872, 0.0668165982, -0.0463104136, -0.0788228586, 0.2744791806, -0.0495556965, 0.0531956032, 0.3093069494, 0.1556753367, 0.2095074058, 0.2245565206, 0.1834985763, 0.1982240379, 0.0829442441, -0.0012048509, -0.175853461, -0.1771318167, 0.3654836714, 0.1934714317, 0.5531743169, -0.31916067, -0.1221155524, 0.0084838448, 0.1728852689, -0.1787240952, 0.0444034189, 0.0144084096, 0.222331062, 0.5070413947, -0.2224071771, 0.2185738087, -0.4622748494, -0.1283478439, -0.1358894706, 0.1796103269, -0.1460781991, -0.0783130899, 0.0963896811, 0.1252890676, 0.1631435305, -0.1422410011, 0.3579079509, -0.0693805888, 0.0396496542, -0.2039280236, -0.2201952636, 0.01378127, 0.1307833642, 0.1039623916, 0.0551504418, -0.1753355116, -0.0369679518, 0.2171099484, -0.1871832907, -0.2070101351, -0.0715537593, 0.2629821897, 0.0267734826, 0.0251534916, -0.4134673476, -0.0887358934, 0.3430744708, 0.0620883703, 0.1139909923, -0.2957780063, 0.0404424444, -0.0858763307, 0.2037116587, 0.3430533409, -0.1321641654, 0.0464634858, 0.1779045761, -0.155011192, 0.2246279567, 0.2967447937, -0.192228049, 0.0937530845, -0.0989214331, 0.5539206862, 0.587988615, -0.4102400839, -0.4520796835, 0.169679001, -0.2588973641, 0.1952017695, -0.116415225, 0.1070557386, 0.3267491758, -0.1174322739, 0.3066208065, 0.6193356514, -0.1105517671, 0.111031048, -0.215863198, 0.0245819055, 0.0014835654, 0.2785249352, 0.2359111756, -0.1938207746, 0.1145047247, 0.2641792595, 0.2436513901, -0.305007875, 0.1434533745, 0.2776196003, 0.099511601, 0.0506756715, -0.1596453786, -0.3252391815, -0.2702026367, 0.2318237424, -0.1383464187, 0.1085470617, -0.3714389205, 0.0401463769, -0.2963202298, 0.0447943658, -0.5638590455, -0.1213939264, 0.1630699933, 0.2012815177, 0.0795096159, 0.0613080524, -0.308508873, 0.2793068886, -0.1050261036, -0.0565540753, -0.5994654894, 0.2591194212, -0.0674928054, -0.3134037852, -0.0747864172, 0.3225339353, 0.0828682557, -0.1350198537, -0.3367398083, 0.2787978053, -0.0855252072, 0.0143847894, 0.0664439127, -0.1704661399, 0.2425210476, -0.4210941195, 0.1616300941, 0.071925953, 0.1278536767, 0.0151308347, 0.1468041688, 0.3288505673, 0.0096396701, 0.0002209738, -0.0022296279, -0.0426437855, 0.4274258614, -0.002031825, 0.086470075, -0.2572607696, 0.2339750677, -0.0238234457, 0.1626574844, -0.0563807748, -0.1947319955, -0.0884139091, 0.5688617826, -0.1365721673, 0.1961639673, 0.127199322, -0.0223116968, 0.0912194327, -0.0803105086, 0.0161401983, 0.2614569664, 0.0181956738, 0.0555700138, 0.0068808692, 0.1075892076, 0.0290951133, 0.1412387937, -0.0843670592, -0.0864135996, -0.071077466, -0.0867035836, -0.0300666243, -0.3335588574, -0.192358464, -0.1055369377, 0.3316012025, -0.1660031825, -0.0535197482, -0.1744427532, -0.1915304959, 0.0373734422, -0.1773096621, -0.1640250683, -0.2362441272, -0.2318592817, 0.0255354419, 0.1254674494, 0.3220965266, -0.4353755414, -0.3569751382, 0.1276555955, -0.3397223353, 0.031621445, -0.2119200379, -0.2546367049, 0.1059964076, 0.3112898171, 0.1780468822, 0.0755409375, -0.3896882832, 0.1155694872, -0.2473889589, -0.0755902007, 0.0593284145, -0.3163182139, 0.1726505607, -0.0393579677, 0.0839219987, -0.0562967807, -0.1811866015, 0.2916715443, -0.2333995849, -0.1716850102, 0.2062583268, 0.0019390116, -0.1965591609, 0.0024224557, -0.1196481138, -0.3280852139, -0.3669330776, 0.0012899827, -0.0777988359, 0.1852786541, 0.1442968994, -0.2602289915, -0.1182347611, 0.114337936, -0.1334740072, -0.1536590159, -0.4095713496, 0.4874742925, -0.3722840846, -0.2143342793, -0.0219014157, -0.1756925285, 0.4781982899, 0.1308038533, -0.2284107357, -0.0028281899, -0.3269364834, 0.2939239144, 0.0070024254, 0.018922694, 0.1398833096, 0.000428223, 0.0058591696, 0.0415180176, -0.0540438183, -0.1960998029, 0.2766463161, 0.1708435416, 0.1009548083, 0.3835440874, -0.1219677851, 0.180129081, -0.0492355563, 0.3242919147, 0.5478321314, 0.0955019668, 0.0651279539, -0.0233802777, -0.4221805036, -0.0489593148, -0.0551073514, 0.0486406572, 0.0079958811, -0.0325142033, -0.1051566675, -0.0710556209, -0.1858094484, -0.1542176306, -0.2681569457, 0.1497886777, -0.2403446138, 0.2449388057, -0.1164385825, 0.0076542557, -0.3299104571, 0.023785213, -0.071319662, 0.1350254864, 0.2146928906, 0.0793463439, -0.195200786, 0.3681938946, -0.4347117245, 0.099815771, 0.3249463737, 0.7038311958, 0.0326969847, 0.0539385714, 0.0414400399, -0.0472926125, -0.0577152446, -0.1116311699, 0.1558758467, 0.1666961461, -0.2209492475, -0.240221709, -0.0395987332, -0.1052685529, 0.300304383, 0.2227610201, -0.035434261, -0.3422703445, -0.1095727086, 0.3165014684, 0.182524398, -0.1780319512, -0.0400576033, -0.4110561013, -0.5928243995, -0.4134849012, 0.0432147384, 0.2406071275, 0.4273457527, 0.3378163278, 0.1650987715, -0.2048254162, -0.2078796029, 0.2217247784, 0.3031237125, 0.0947901979, 0.0685114115, 0.0718199685, -0.2338237613, -0.394234091, 0.1363063008, 0.5306171179, 0.1089844629, -0.709286809, -0.078453362, -0.2032940984, 0.2511306405, 0.0598778278, -0.0541695021, 0.1121878922, -0.1826997548, 0.093862839, 0.0437188558, 0.109184213, 0.1448739916, 0.21288459, -0.6021432281, -0.4522860646, 0.1971880198, 0.0163845755, 0.2952747345, 0.3392183483, -0.1642777324, -0.3164372444, -0.0895481035, 0.1628365666, 0.5518426895, 0.0499164797, 0.1146931574, 0.3466675878, 0.0413424261, 0.0582397245, 0.0459599793, 0.1835667044, -0.2096627206, -0.2382661849, -0.0543800294, -0.0252756886, 0.1658082753, -0.0543143936, 0.0872022733, 0.277522862, 0.073432982, 0.0351332761, 0.2459097803, 0.1984629631, -0.2746992707, -0.4539570808, -0.5819116831, 0.1532523334, -0.3220199049, -0.03099861, -0.1967273802, -0.2522438169, 0.0267227981, -0.2227253467, 0.0441954397, 0.2248591632, -0.1557141989, 0.2739735842, -0.1650169492, -0.5444104075, 0.2062318325, 0.0880708918, 0.301584363, -0.0706011951, 0.1350806952, 0.1731298715, 0.1769679934, -0.0216343161, -0.0828446299, -0.0253755469, 0.0173967797, -0.0310312957, -0.2499280125, 0.0698867887, -0.0188623592, -0.3566618264, -0.2213181555, 0.2003680021, -0.0024189611, -0.0873172209, -0.205395028, -0.199392885, 0.0175071321, -0.1896484792, 0.159420222, 0.0621681623, -0.2342938632, 0.0830630511, 0.0320614576, -0.3447245657, 0.0183397345, 0.0949898809, 0.1793594956, -0.4032030404, 0.5781169534, 0.1079857796, -0.0876558125, -0.1230056286, 0.0509767793, 0.1880124509, -0.5171362162, 0.0444076024, -0.0069698733, 0.0980351418, -0.1275514662, 0.0985040367, 0.0108746709, -0.0961295962, 0.1677367091, -0.416318655, -0.5901712775, 0.1163460836, -0.1201159433, 0.2132864892, 0.0890789554, 0.1483062059, -0.1083182022, -0.0477419831, -0.304250598, 0.1132211387, -0.3167769313, 0.2198823094, 0.2084019184, -0.0789639801, 0.0466102622, 0.05502804, 0.2011431307, 0.3281202912, -0.0766398683, -0.1902381331, 0.0340618081, 0.087311998, -0.086703971, -0.4576304257, -0.0182358213, 0.2222198397, -0.059743017, -0.1353599876, 0.1167748645, 0.1854208112, -0.0626489446, 0.0720704943, 0.1372988373, 0.1072307676, -0.1261374652, 0.29812029, -0.2095624208, 0.4348088503, 0.0386725478, 0.2651923597, 0.0883064643, 0.0721181631, -0.231183663, -0.1048304737, 0.1180977598, 0.1814719588, 0.1432624757, -0.5272974968, 0.1788816005, 0.2601995766, -0.0461182967, 0.3760094941, -0.183552593, -0.0165387336, 0.1208892241, 0.2417025566, -0.1411453485, -0.0686585233, 0.3440245986, -0.2144440264, 0.0001065545, 0.4460251927, 0.1517321169, 0.1151358932, 0.2358344942, 0.1073320657, 0.2825607955, -0.0068990639, 0.2959388494, 0.4751642346, -0.1015862375, -0.0476529263, 0.232284084, 0.134356752, 0.0184184145, 0.6424044371, -0.4427737594, 0.5353499055, -0.0505039468, 0.2583876848, -0.3224717379, -0.3795405328, -0.2869462967, -0.1631640494, -0.0148016782, 0.2366978526, 0.1603485644, -0.3238866031, -0.189129591, 0.0048721912, -0.0439246595, 0.1654583663, -0.2276587933, 0.1310623437, -0.0501658656, -0.0186569951, -0.1377199739, -0.0187569521, 0.0113089001, 0.1884764284, -0.0382183492, 0.2333973497, -0.1012563631, -0.0860913396, 0.1590767801, 0.2796641588, -0.0650408193, -0.264344722, 0.463473618, 0.5010716319, -0.0114837736, -0.0209637806, 0.1890854686, 0.3574214876, 0.4347185194, -0.2235046476, 0.1034592912, 0.0009247987, 0.0185822882, 0.0500134677, 0.1436077207, 0.0140551329, 0.6835592985, 0.178681016, 0.2524064481, -0.1252028644, -0.0167536642, 0.0970187187, -0.2486757338, 0.0330271348, 0.2661144733, 0.1370355189, -0.0323734283, -0.2701377273, -0.0949239507, -0.2792063355, 0.0065418994, 0.3846933544, 0.0213524494, 0.1060539261, -0.1315312982, 0.0763783902, 0.0020455567, 0.4745554924, 0.3403453231, -0.0144476444, -0.3034821451, -0.2072483897, -0.7285959721, 0.1943606585, -0.1984155625, -0.328502655, 0.2497084439, -0.0827104598, -0.0733957663, 0.3360484838, 0.2181291133, 0.3987620473, 0.0736601874, 0.1313436627, -0.3173842132, -0.0350323804, 0.4439383745, 0.0782288164, -0.0843570232, -0.340235889, 0.1098290086, 0.0742682591, 0.1089789197, -0.1935680658, -0.0207892992, -0.0690448433, -0.1324369311, 0.3674145341, 0.2805422544, 0.3930173218, -0.1928328574, -0.1226179972, -0.171455428, -0.3176396489, -0.0810486376, 0.3091647327, 0.0883628577, 0.5725005865, 0.0104071526, -0.0874087289, -0.6893693805, 0.3223952949, -0.1301128864, 0.0926101729, 0.0033729135, 0.1471584737, -0.0745511428, 0.0625719205, 0.0069267177, 0.1489865333, 0.0457483046, 0.4057686329, -0.1709185392, -0.5643859506, 0.3966763914, -0.0855883062, -0.6857154965, -0.1103917807, 0.0107936189, -0.0288262721, -0.0517249927, -0.3539991677, 0.3004594147, 0.2369799912, -0.0079769297, -0.172350049, 0.2072672099, 0.032172624, 0.0402623937, -0.0043206224, 0.4464671314, -0.1106185019, -0.0629548132, 0.1378685683, -0.2023231834 ]
https://github.com/huggingface/datasets/issues/444
Keep loading old file even I specify a new file in load_dataset
This is the only fix I could come up with without touching the repo's code. ```python from nlp.builder import FORCE_REDOWNLOAD dataset = load_dataset('csv', data_file='./a.csv', download_mode=FORCE_REDOWNLOAD, version='0.0.1') ``` You'll have to change the version each time you want to load a different csv file. If you're willing to add a ```print```, you can go to ```nlp.load``` and add ```print(builder_instance.cache_dir)``` right before the ```return ds``` in the ```load_dataset``` method. It'll print the cache folder, and you'll just have to erase it (and then you won't need the change here above).
I used load a file called 'a.csv' by ``` dataset = load_dataset('csv', data_file='./a.csv') ``` And after a while, I tried to load another csv called 'b.csv' ``` dataset = load_dataset('csv', data_file='./b.csv') ``` However, the new dataset seems to remain the old 'a.csv' and not loading new csv file. Even worse, after I load a.csv, the load_dataset function keeps loading the 'a.csv' afterward. Is this a cache problem?
88
Keep loading old file even I specify a new file in load_dataset I used load a file called 'a.csv' by ``` dataset = load_dataset('csv', data_file='./a.csv') ``` And after a while, I tried to load another csv called 'b.csv' ``` dataset = load_dataset('csv', data_file='./b.csv') ``` However, the new dataset seems to remain the old 'a.csv' and not loading new csv file. Even worse, after I load a.csv, the load_dataset function keeps loading the 'a.csv' afterward. Is this a cache problem? This is the only fix I could come up with without touching the repo's code. ```python from nlp.builder import FORCE_REDOWNLOAD dataset = load_dataset('csv', data_file='./a.csv', download_mode=FORCE_REDOWNLOAD, version='0.0.1') ``` You'll have to change the version each time you want to load a different csv file. If you're willing to add a ```print```, you can go to ```nlp.load``` and add ```print(builder_instance.cache_dir)``` right before the ```return ds``` in the ```load_dataset``` method. It'll print the cache folder, and you'll just have to erase it (and then you won't need the change here above).
[ -0.088875562, 0.2823799551, -0.0012340449, 0.1619004607, -0.162547648, 0.0777333006, 0.1432161182, 0.2737465799, 0.3626847267, -0.1133288443, 0.116381824, 0.1898296475, 0.1802765429, -0.0821297839, 0.1950769126, 0.33315593, -0.0630544946, 0.5072546601, 0.1366075277, -0.0146826236, -0.3488636911, 0.110732697, -0.0943151861, -0.0725020841, -0.1926434785, 0.1469482481, -0.0438436456, 0.1396530569, -0.2056971043, -0.4888148308, 0.380918324, 0.3573816717, 0.2581084371, 0.4660643339, -0.0001152982, -0.0119409403, 0.2476481795, 0.0682446212, -0.5148966908, -0.3869972527, 0.0314665809, -0.5372769833, 0.3891554177, -0.1841782629, -0.1016146168, -0.0859779343, 0.1840108037, -0.0501313061, 0.5789196491, 0.2138359994, 0.1951671392, -0.1492289305, 0.0171361156, -0.0130088739, 0.1113951877, -0.2091115117, 0.1625348926, 0.3535638154, 0.1116896942, -0.2694232762, -0.2668688595, 0.034289781, -0.2663345635, 0.2355276942, 0.2771705687, 0.0081728101, 0.2694098353, -0.051689826, 0.0297866389, -0.0389139801, 0.6603612304, -0.0337099954, -0.123148717, -0.2626152337, 0.0286019165, -0.5128678679, 0.134692505, 0.1874414682, -0.0809473693, -0.0461171828, -0.2042679191, -0.4057560563, -0.0188117679, 0.2534581721, 0.1112425327, 0.1234548315, -0.0647202283, 0.228922531, 0.2850902081, 0.1747083664, 0.2771388292, -0.1166694462, -0.2123605758, 0.2447839975, -0.4885703027, -0.0201183204, 0.112306118, 0.12820746, -0.1136156991, 0.1372918487, 0.2320875376, 0.0109714726, -0.1496883482, 0.1623386592, 0.3279623687, 0.304256916, 0.2717227638, -0.1469149441, 0.178735733, 0.1581059545, -0.3821921051, -0.0942421108, -0.0421044976, -0.2711847723, 0.2378883064, -0.1810325384, 0.3370939195, -0.1668265462, -0.0508519784, 0.0400003269, 0.1158589944, -0.2263803631, 0.0172551069, 0.4845028222, -0.1868885309, 0.1356289834, 0.1583126783, 0.0463617742, -0.5059086084, -0.1612836421, -0.0898494422, -0.1798774749, -0.3385743201, 0.0726504102, 0.4552687705, -0.207242772, 0.3022793233, 0.3358886242, -0.2005397379, -0.3571427763, 0.0742676109, 0.1200320125, -0.0250849221, 0.0515101999, 0.0902633369, 0.3180947304, 0.0241421387, -0.5446964502, -0.1738615781, 0.1558581889, -0.5722795129, -0.3847284913, 0.0376879126, 0.1773882359, -0.150834173, -0.1242486984, -0.0813758075, -0.0549608245, 0.1526692212, -0.4405648112, -0.2240800858, -0.1603151262, -0.2302430421, -0.2056117654, -0.0603128821, 0.5919473767, -0.107987009, -0.0069066631, -0.1732042432, 0.107895717, -0.1307269186, 0.1100473925, -0.1966304481, -0.0026774178, -0.2292709053, -0.5279222131, 0.670669198, -0.0909130871, -0.4825631976, 0.2108751684, -0.1627446115, 0.1470751613, 0.1583849341, 0.2092547268, -0.1660040468, -0.1586553156, 0.0442562886, 0.2686129212, 0.1136606038, 0.0111962995, -0.1344204247, -0.2561929524, 0.2314467281, 0.0314550921, -0.1690052897, 0.2235097289, -0.0248485859, 0.1354255676, 0.2736138105, 0.0281254612, 0.0372867025, -0.0211753622, -0.018825151, 0.093878001, -0.0387784094, 0.2074217945, -0.635276854, 0.2108053863, -0.1857464761, -0.3761024177, 0.1938498914, -0.0648835525, -0.2942897677, -0.2255122513, -0.450682193, -0.2055748254, 0.0188854001, 0.3500683904, 0.0924993679, -0.1076357588, -0.1527512223, 0.3722837269, -0.0743820295, -0.0678525195, -0.5102145672, 0.1139074415, 0.0197452363, -0.0636631772, 0.1134540737, 0.297781527, 0.3451759815, -0.0230163727, -0.1121132299, 0.242319271, -0.080244951, 0.3043350577, 0.0062469114, -0.3474617898, 0.0004541843, 0.299479723, 0.1332807243, 0.1017204747, -0.0083979489, -0.0168772396, -0.0799977407, 0.332235992, -0.0560340025, 0.3085151315, 0.0633942038, -0.1673321873, 0.2275236398, -0.3927997351, 0.2067197263, -0.1777364761, 0.2628161311, 0.2479508668, 0.195312649, 0.2646507025, -0.0829102099, 0.0650190115, 0.4671655297, -0.0469819047, -0.2923634648, 0.1642831415, -0.0841174871, -0.1841217875, -0.1236990243, 0.3632377088, 0.42988199, 0.1477506459, -0.181833595, 0.0822672695, -0.0667832047, -0.2304428369, 0.1101653203, -0.2013236284, 0.2853395641, 0.2399769723, 0.2579444945, -0.099996455, -0.350132823, 0.338106811, 0.2240702808, 0.1103268042, -0.0796888992, 0.2068431228, -0.5125060678, -0.1935470253, -0.5543273687, 0.0061856848, -0.2469128817, -0.0969225988, -0.0754553676, 0.624986589, 0.2246182412, 0.1039893329, 0.0526420549, 0.3406597972, -0.1474728435, -0.3065599799, 0.0291030668, -0.33412534, -0.3812092543, -0.0456453785, 0.2931636572, -0.0742159784, 0.2642600834, 0.0402298868, -0.1407393217, -0.2185636461, -0.1337852776, -0.0987230316, 0.1271894425, 0.2915700674, -0.1833295822, 0.1628342867, 0.1383506656, -0.2592160106, 0.1522710025, -0.4241508245, -0.0251136422, 0.1721182317, -0.0859798789, 0.1537035406, -0.0118241869, -0.4226032794, -0.2225032598, -0.2736027837, 0.13907516, 0.1597255915, 0.1519839168, 0.35980317, -0.1087849885, -0.1524826586, -0.1071985364, 0.2338398993, -0.3367555141, -0.2792286873, 0.2858325839, -0.1888989061, -0.2545822859, 0.2504900992, -0.0153041473, 0.2039731443, -0.1013494059, -0.61219877, -0.0707030073, -0.0093098152, -0.0277732983, 0.0958588198, 0.0553383306, 0.1928491592, -0.1464698613, -0.0504264534, -0.039213635, -0.1802837998, -0.0088394266, 0.2555665374, 0.4061007798, 0.2051306218, 0.1547251195, -0.2963930666, 0.5076719522, 0.3996006846, -0.1259079129, 0.4105134308, -0.0076690423, 0.4529299736, -0.3399048746, -0.1743125618, -0.1087412462, -0.1506918073, -0.0775156915, 0.1882667094, 0.0459608808, -0.1770214438, -0.2123093605, -0.085459955, -0.0428784005, -0.3324963748, 0.1021436527, -0.1324267685, 0.0285492465, 0.4036845565, -0.2121607661, -0.2638759613, -0.4108498096, -0.3645508587, 0.3081259131, 0.0857929289, 0.0269672945, -0.0644813776, -0.0304787047, -0.3124129474, 0.2100340724, -0.0334739573, 0.1108686179, 0.1170164794, 0.0738257766, 0.235237658, 0.02461835, 0.6076545715, -0.0361421891, 0.1442115158, 0.1510514021, 0.0563357882, -0.1386022419, -0.0542588867, 0.2957322001, 0.4776969552, 0.2010528892, 0.0684839189, -0.0150317969, -0.4613935053, 0.1272090375, 0.312603116, -0.3689416349, -0.4041789472, -0.4548131824, 0.1523552984, -0.310536772, -0.2186829299, -0.4536336362, 0.1892786771, -0.2344128191, -0.1143863574, -0.1408667415, 0.0339931659, -0.0269312877, 0.0028768789, 0.3091117442, 0.4205062389, -0.0521413684, 0.1925813854, 0.2409771234, -0.1799020618, 0.4959927499, -0.0364600271, 0.0043450473, 0.0109084388, 0.0607555434, 0.2748135328, 0.2771266997, 0.0029779135, 0.1532579511, -0.0888366476, -0.0954787657, -0.1706480384, -0.1272301376, 0.1746070981, -0.0192987397, -0.2430472523, -0.6247797012, 0.5867570043, -0.2281983346, -0.0958016813, 0.0771198496, -0.4297845662, 0.004320099, 0.3284890354, -0.3328559101, 0.7670228481, 0.0136229051, 0.2584231496, 0.068875894, 0.0857945234, 0.7262018323, -0.3534885347, 0.158529073, -0.2406385243, 0.0268777199, 0.0671017244, -0.0156933181, -0.0373697951, 0.0611008443, -0.2364813238, 0.5385797024, 0.1941302121, 0.2164647877, 0.1895299256, 0.5119620562, -0.0139745744, -0.1716062129, -0.388681531, 0.0655357167, -0.113161765, 0.2626151443, -0.1508740485, -0.1621663123, 0.3213566244, -0.0785243735, 0.1230563372, 0.2460943907, 0.0687524453, 0.2204843163, -0.108543776, -0.399133265, -0.0335054956, 0.1864879578, -0.0318298787, -0.0040573105, -0.2104967684, 0.2432615906, 0.0758458972, 0.1048815548, -0.2682755888, -0.0988506377, 0.3014588356, 0.0377520286, -0.3364534676, 0.1117607653, -0.1059240401, -0.4096360207, 0.110247694, 0.331805855, 0.0765400752, -0.1532813907, -0.2351975143, 0.193082273, 0.0814831108, -0.0987384692, 0.1244101226, 0.03878849, -0.0530344136, -0.0413580053, 0.026091937, -0.476390034, 0.0609046817, 0.387244314, 0.2643862069, -0.0910677314, 0.6199368238, -0.0544085279, 0.1009748802, -0.138475582, -0.155315578, 0.003982292, -0.3479212523, 0.0735097751, 0.3034488261, 0.2219398916, 0.3384995759, 0.0701486319, -0.1725634485, 0.1892216951, 0.0229779817, -0.4424043, -0.2097514272, -0.1800864637, -0.2489680648, 0.1425337046, 0.3069706559, -0.0182874352, 0.1766198575, 0.4221712351, -0.2422644049, 0.2179238349, 0.036387708, 0.2837193012, 0.1794679612, -0.145503819, -0.2760012746, -0.2238449305, -0.0397575647, -0.1276074797, -0.3365158141, -0.2114665806, -0.2694690824, 0.1738516837, 0.056082312, 0.2405855805, -0.3486258984, -0.3961255252, 0.2473446727, -0.167086482, 0.1138699502, -0.2556157708, 0.0519937016, 0.0567373894, 0.027337648, 0.1373140663, -0.1126862243, 0.1204756126, -0.2819400728, 0.3032253087, 0.1721114218, 0.0267840736, -0.2301594168, 0.2022950649, -0.4627677798, -0.106890671, -0.049671229, 0.0468471721, 0.1288541555, -0.3395736814, -0.0416401215, 0.013372275, 0.1993757188, 0.5579799414, 0.0093696387, -0.0509724952, 0.2949976623, 0.135196805, -0.2785675824, 0.1379587501, 0.4374044538, 0.0619374253, -0.0489479527, 0.1274024695, 0.2259241641, -0.2998076677, 0.2056146711, 0.2648713291, 0.3571158051, -0.4329584539, 0.3450420499, 0.15106529, 0.2942139506, -0.0452231988, 0.4577879608, 0.2673686445, -0.0011885631, 0.3178559542, -0.1151008829, -0.0553439967, 0.0897952914, 0.2091724277, -0.2968599796, -0.3625846505, 0.109671317, 0.5631207824, -0.0496522598, 0.1745136827, 0.1760571748, 0.5881571174, -0.0891450718, -0.1031948328, -0.4032124579, 0.4081043899, -0.1066973433, -0.2956747115, -0.1100804955, -0.0177411605, -0.1267822683, 0.2605082095, -0.0965155512, 0.0007643584, 0.0547180474, 0.1165262982, -0.2532087564, -0.6731387973, 0.1490392536, 0.0911908001, 0.0718465224, -0.1221194491, 0.3966832161, -0.1008653417, 0.001558387, 0.1063884646, 0.1515474916, 0.2985386848, 0.2616483271, -0.0261191279, 0.2150195539, 0.0984300002, -0.0990654752, -0.2725054324, 0.1522104144, 0.1588629931, 0.0735249892, 0.0737248808, 0.1271309704, -0.1456317604, 0.1910414249, 0.2808288038, 0.0177972429, -0.4239730835, 0.2723132968, 0.4910109937, -0.1004145145, -0.1347144842, 0.150185734, -0.5083789825, 0.0870219171, 0.2666012049, -0.0274718814, 0.1571954787, -0.2614783049, 0.0647617579, -0.0993390754, 0.4398812354, -0.0613911264, 0.0301486459, -0.2412988991, -0.2117663622, -1.0339400768, 0.110842295, -0.0859862268, 0.0675169975, 0.0298558231, 0.1638644189, -0.1324922889, -0.0199048575, -0.0333395787, -0.0068986593, 0.2087879777, -0.0633896291, -0.2428738922, -0.1244172901, 0.1882932633, 0.1633123904, -0.158217445, -0.1272717416, 0.0362092853, -0.2769179344, -0.0169721246, 0.0682015568, 0.04505606, 0.2270133942, 0.3052161038, 0.4869485497, -0.0479956083, 0.1529430002, -0.0526884161, 0.1403112113, -0.401855886, -0.1542679369, -0.1185612157, -0.2395340949, 0.0146926567, 0.2092725337, -0.3926821053, 0.3989510238, -0.3408298194, 0.0581691675, -0.1670539081, -0.1050889641, 0.0883127451, -0.1183827072, 0.0023446353, 0.3344600201, 0.0544686168, 0.5390547514, -0.0718652681, 0.2023705542, -0.3011861742, 0.0192575604, 0.3384819627, -0.4451623857, -0.2249623388, 0.1939321607, 0.3209459782, -0.0809388608, -0.0111821815, -0.2096018046, 0.1600853205, 0.2623904943, 0.0497746803, -0.1716383845, 0.3985253572, -0.1940019578, 0.0339894667, -0.0756102949, 0.2051554769, 0.4144528806, -0.4878884554, 0.0202209018, -0.2616916299 ]
https://github.com/huggingface/datasets/issues/443
Cannot unpickle saved .pt dataset with torch.save()/load()
This seems to be fixed in a non-released version. Installing nlp from source ``` git clone https://github.com/huggingface/nlp cd nlp pip install . ``` solves the issue.
Saving a formatted torch dataset to file using `torch.save()`. Loading the same file fails during unpickling: ```python >>> import torch >>> import nlp >>> squad = nlp.load_dataset("squad.py", split="train") >>> squad Dataset(features: {'source_text': Value(dtype='string', id=None), 'target_text': Value(dtype='string', id=None)}, num_rows: 87599) >>> squad = squad.map(create_features, batched=True) >>> squad.set_format(type="torch", columns=["source_ids", "target_ids", "attention_mask"]) >>> torch.save(squad, "squad.pt") >>> squad_pt = torch.load("squad.pt") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/torch/serialization.py", line 593, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/torch/serialization.py", line 773, in _legacy_load result = unpickler.load() File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/nlp/splits.py", line 493, in __setitem__ raise ValueError("Cannot add elem. Use .add() instead.") ValueError: Cannot add elem. Use .add() instead. ``` where `create_features` is a function that tokenizes the data using `batch_encode_plus` and returns a Dict with `input_ids`, `target_ids` and `attention_mask`. ```python def create_features(batch): source_text_encoding = tokenizer.batch_encode_plus( batch["source_text"], max_length=max_source_length, pad_to_max_length=True, truncation=True) target_text_encoding = tokenizer.batch_encode_plus( batch["target_text"], max_length=max_target_length, pad_to_max_length=True, truncation=True) features = { "source_ids": source_text_encoding["input_ids"], "target_ids": target_text_encoding["input_ids"], "attention_mask": source_text_encoding["attention_mask"] } return features ``` I found a similar issue in [issue 5267 in the huggingface/transformers repo](https://github.com/huggingface/transformers/issues/5267) which was solved by downgrading to `nlp==0.2.0`. That did not solve this problem, however.
26
Cannot unpickle saved .pt dataset with torch.save()/load() Saving a formatted torch dataset to file using `torch.save()`. Loading the same file fails during unpickling: ```python >>> import torch >>> import nlp >>> squad = nlp.load_dataset("squad.py", split="train") >>> squad Dataset(features: {'source_text': Value(dtype='string', id=None), 'target_text': Value(dtype='string', id=None)}, num_rows: 87599) >>> squad = squad.map(create_features, batched=True) >>> squad.set_format(type="torch", columns=["source_ids", "target_ids", "attention_mask"]) >>> torch.save(squad, "squad.pt") >>> squad_pt = torch.load("squad.pt") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/torch/serialization.py", line 593, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/torch/serialization.py", line 773, in _legacy_load result = unpickler.load() File "/home/vegarab/.conda/envs/torch/lib/python3.7/site-packages/nlp/splits.py", line 493, in __setitem__ raise ValueError("Cannot add elem. Use .add() instead.") ValueError: Cannot add elem. Use .add() instead. ``` where `create_features` is a function that tokenizes the data using `batch_encode_plus` and returns a Dict with `input_ids`, `target_ids` and `attention_mask`. ```python def create_features(batch): source_text_encoding = tokenizer.batch_encode_plus( batch["source_text"], max_length=max_source_length, pad_to_max_length=True, truncation=True) target_text_encoding = tokenizer.batch_encode_plus( batch["target_text"], max_length=max_target_length, pad_to_max_length=True, truncation=True) features = { "source_ids": source_text_encoding["input_ids"], "target_ids": target_text_encoding["input_ids"], "attention_mask": source_text_encoding["attention_mask"] } return features ``` I found a similar issue in [issue 5267 in the huggingface/transformers repo](https://github.com/huggingface/transformers/issues/5267) which was solved by downgrading to `nlp==0.2.0`. That did not solve this problem, however. This seems to be fixed in a non-released version. Installing nlp from source ``` git clone https://github.com/huggingface/nlp cd nlp pip install . ``` solves the issue.
[ -0.1386733651, -0.1840368211, 0.1423231214, 0.2854888737, 0.3872587085, 0.0739869177, 0.4242341816, 0.1544947475, -0.181862548, 0.0088985031, -0.2541095614, 0.7546943426, -0.342929244, -0.1627206355, -0.008775536, -0.2707041204, -0.0224569775, -0.0999826416, 0.1635406464, 0.0048667425, -0.1239806637, 0.171048969, -0.2978939414, -0.0645305738, -0.2080973089, -0.2048986256, -0.0015915596, 0.3980630934, 0.0651098192, -0.3406357467, 0.1945503801, -0.1563010216, 0.0915549845, 0.4689868689, -0.0001217698, -0.0382244289, 0.1266159713, -0.2294038683, -0.4221747816, -0.1044336855, 0.4167322814, -0.164872095, 0.279409796, -0.3884230852, -0.0467771366, 0.1305864304, 0.0142892106, -0.3021168411, 0.1780149639, 0.0991780683, 0.1452196687, 0.67364645, 0.0289200712, -0.0280884951, 0.2441468239, 0.1641829461, -0.248675108, 0.2910865843, 0.104137443, 0.0843061954, -0.1918401122, 0.063260451, -0.3168007135, -0.1475128978, 0.1134289429, -0.0622912273, -0.6752685308, -0.2057638615, 0.2055132687, 0.1767501682, 0.2703264952, -0.3025208712, -0.3350051939, -0.1799493432, 0.1947432011, -0.3114595711, 0.1561124474, 0.3004494011, -0.1158857048, -0.0864391923, -0.1456925124, -0.0299987234, 0.025890002, 0.2111270279, 0.4304870069, -0.0353292972, -0.0998984203, 0.3880560398, 0.0998012349, -0.0481596179, 0.0078424551, -0.1047173515, 0.1041183993, 0.0092726313, -0.2710998356, 0.0964371562, -0.0364195444, -0.0696301609, -0.0793859437, 0.3811098635, 0.5383773446, 0.1145915389, 0.2311059684, 0.2259288728, 0.2127767652, 0.05712552, 0.2554363906, 0.3450382948, 0.0177331436, -0.3164450228, -0.0845253393, 0.0598804988, 0.1468536109, -0.2113461047, 0.1873694062, 0.0921167582, 0.0115662934, -0.0737665743, -0.2611564696, -0.0732764304, -0.1164810807, -0.2230286896, -0.0387121029, 0.1521583498, -0.0074686641, 0.088571243, 0.0037151184, 0.3209426105, -0.3440075219, -0.0227741655, -0.0524147563, 0.0857809633, -0.1722239703, -0.0538867675, 0.3327814043, -0.4329435527, 0.2967667878, -0.0294858497, -0.1854738295, -0.0706738085, -0.0606142208, -0.2570722699, 0.1994284987, -0.1585467607, 0.2861683369, 0.1599563658, 0.1073980853, 0.0266730059, -0.0570052005, 0.1278262734, -0.2086868584, -0.2174159288, -0.2217050046, 0.0641508773, -0.1422484517, -0.1611876786, -0.1856590956, -0.0741372481, 0.152124688, -0.1553195566, 0.1956332922, -0.1929908544, -0.1605008245, -0.3936682642, 0.056231793, 0.3869011402, -0.2387970537, -0.1330623925, 0.4711279571, -0.1688481271, 0.1827654541, 0.2557336986, -0.2038460225, 0.2076243311, -0.2920517623, 0.1300197393, 0.5466676354, -0.4901283681, -0.2935793102, 0.1681382805, 0.0104875239, 0.0890495107, -0.0081727123, 0.1268038154, 0.0117184799, -0.0303254798, 0.1082634851, 0.3592547476, -0.0240154024, -0.1920453161, -0.3910907805, -0.0672136843, 0.5623107553, 0.1039691493, -0.0450831614, 0.0051227598, 0.1489917189, 0.1643618941, 0.2806613147, -0.1335192919, 0.0790416226, 0.2275402248, 0.0479262136, -0.047930032, -0.0614273883, -0.1117486581, -0.7583847046, 0.1425737739, -0.4217596054, -0.2041577548, 0.0460044071, 0.0194341727, -0.0096859382, -0.269963026, -0.4672888815, -0.253590554, -0.0701946169, 0.0350565314, -0.0027190668, -0.1018662527, -0.2882671654, -0.0586995445, 0.017072916, 0.0949502736, -0.4358218014, 0.0351116545, -0.1008362919, -0.6016010046, 0.0788975209, 0.3346040547, 0.199221611, -0.2135370523, -0.1547769904, 0.5112802982, -0.187847659, 0.0458428822, -0.0911483541, -0.3962247372, -0.0257684719, -0.3873718977, -0.1387776583, 0.3057428598, 0.1651028246, -0.1439480782, -0.4406926632, 0.4739772379, -0.1370312124, -0.0694071129, 0.1428316832, -0.1771288216, -0.0402116589, -0.1298945993, -0.0850231573, -0.0074810358, 0.0441753007, 0.2500829697, 0.4493279755, -0.0599439852, -0.4387774169, -0.0666088611, 0.2690040171, 0.1827788204, 0.15105097, 0.0907958597, -0.0865503624, -0.1462572366, -0.0994366705, -0.5965250134, 0.4699758589, 0.007956394, -0.0964354053, -0.0773336068, 0.1617989987, -0.162353009, 0.0246820506, 0.0292417016, 0.0215613414, 0.5249427557, 0.3105398417, 0.1777421236, -0.3436542451, 0.0938973948, -0.0082978541, -0.015436233, -0.2287287861, 0.2008436769, -0.2161108106, -0.0077682519, -0.2932493687, 0.0225313585, -0.4134547114, -0.2659108043, -0.0204122774, 0.4188210964, 0.1691664755, 0.213191852, 0.0327041596, 0.0886701941, 0.1502595395, -0.287394315, 0.0878556296, -0.1656801403, -0.1369887441, -0.0366177, 0.0988968909, -0.13913019, 0.5425938964, 0.2488515228, 0.0985455737, -0.254000932, 0.1322927326, 0.1986369044, 0.0405147187, 0.0283314139, 0.158302933, 0.0773259401, -0.2481869459, -0.2664536536, 0.2911869586, -0.1191455871, -0.1861181408, 0.0801181942, 0.010900896, -0.022456659, -0.0050232103, -0.6097729802, -0.2246842831, -0.2241444886, 0.227032125, -0.0491172187, 0.0815529153, 0.1741752028, 0.0048659779, 0.260194093, 0.0624347888, -0.100180015, -0.0126522761, -0.2533336282, 0.2158102989, -0.1460839212, -0.4376558661, 0.027398644, 0.0929993019, -0.101662457, 0.1142237261, -0.0406719223, 0.0233943071, 0.1410517693, 0.2924293578, -0.2655850351, 0.1149231568, 0.34433496, 0.0430165082, 0.077884391, -0.0306633413, -0.2457074225, 0.0596968792, 0.1554536521, 0.3513273001, -0.0206243861, 0.0392362736, 0.1629588753, 0.8619160056, 0.1855267882, -0.2794862986, 0.3941232264, -0.0292289816, 0.2752985656, -0.2377855927, -0.4469310641, 0.4460180104, -0.1733703911, 0.3204525113, 0.0607321262, -0.2573388219, -0.0113227302, -0.0635863543, 0.2717906535, -0.149232164, -0.2496080548, 0.2806571722, -0.2385173738, 0.1049521938, -0.1814572662, 0.2275058776, -0.0711086988, -0.3509439826, -0.0032616467, 0.1643669158, 0.4109747708, 0.1616710275, -0.4156164229, 0.0040467423, -0.4042150676, 0.3957032859, 0.1615814716, 0.4010525644, -0.0990787596, -0.2193688899, 0.1332556605, 0.1180995554, 0.4137420356, 0.0096635642, -0.0607225858, 0.306122452, -0.162825495, -0.5174529552, 0.0127819153, 0.02201619, 0.4153407216, 0.1618520617, 0.2548159063, -0.1388518214, -0.1510860175, 0.163600117, 0.3699418306, -0.19340536, -0.1140025556, -0.0574987903, -0.1429004222, -0.4427397251, -0.0616742186, -0.0853107795, 0.2670447528, -0.0017046727, 0.249230206, -0.1672133207, -0.2109504044, 0.0936305299, -0.3807398379, 0.2851108611, -0.0029863631, 0.0652357787, 0.0234205574, 0.4080889225, 0.0373503789, 0.2515794337, -0.2945901752, 0.274248898, 0.1988429129, -0.0704244152, 0.169157207, 0.2372219712, 0.0521402992, 0.1120993197, -0.3705206513, -0.066793099, 0.1262666881, -0.0717887059, 0.0833368525, -0.3304265141, -0.2719470263, -0.0292308033, 0.2321577966, 0.0300720744, 0.236270681, 0.1166315675, -0.5146976709, -0.0924149752, 0.5315944552, 0.0563524999, 0.9179933071, -0.1772385985, 0.3260870576, -0.0321266986, 0.1401224136, 0.2217608243, 0.0599847846, 0.1831365973, -0.5430378914, 0.18568407, 0.07395982, -0.0524221212, 0.0743605644, 0.1941402704, -0.106402494, 0.3549281955, -0.2108064443, 0.0285266452, -0.1503783464, 0.3296604455, 0.0767177045, -0.2352465093, -0.2108259797, 0.007741699, -0.2141858935, 0.4785350561, 0.1097304374, -0.0900825784, 0.0994526967, -0.1806676984, -0.0863745958, 0.1381822526, -0.1973133087, 0.5574910045, 0.1291617751, -0.8781000376, -0.0591269732, 0.6718177199, -0.0118322382, -0.2320769429, 0.0549746417, 0.1600877196, 0.2959394455, -0.12298242, -0.2097714245, 0.1190072373, 0.4859685302, -0.0989250466, 0.0646482408, 0.1770042926, -0.1137922779, -0.3283303082, -0.1556129456, 0.2993593812, 0.3328757882, -0.4707868099, -0.4273252189, -0.2204253972, -0.2364570796, -0.1510199606, -0.0215645675, 0.0950371474, 0.1787852794, 0.1700584292, 0.1484198868, -0.1462185681, 0.015676599, 0.8382957578, -0.2344835252, -0.3432262838, 0.5526182652, 0.2660034001, -0.1367073506, -0.2085972428, 0.1926611662, 0.0007455031, -0.328069061, 0.125088498, -0.0769783035, 0.3351721168, 0.1462389678, 0.2212706059, -0.0975731909, -0.0387975313, 0.012082546, -0.0563088357, -0.4843294919, -0.184666127, 0.1859752238, 0.0648799837, 0.0486845113, 0.4098494947, 0.3081648648, 0.0342075303, -0.1843405515, 0.3117744625, -0.0307662878, 0.2121685594, 0.4773924053, -0.1358633935, -0.0903610885, -0.0063377428, 0.0305296239, 0.0770377591, -0.1119333208, -0.144726932, -0.2219720185, 0.1734952927, 0.1860114336, -0.2156839818, -0.2647042871, -0.0095410571, 0.1922618151, -0.2260736674, 0.1810256094, 0.3889674842, 0.0224128831, 0.159382537, -0.2167815417, 0.2523556352, -0.0527841151, -0.075229682, -0.1053137854, 0.1062315777, 0.1237956285, -0.0736684501, 0.0280341953, -0.0351496637, -0.2667632997, -0.1414225549, 0.4792153537, 0.2084567547, 0.0186063386, -0.3838418424, -0.0946762711, -0.3431566358, 0.0114341974, 0.1630904973, -0.2923072875, -0.1363116801, 0.1053911, 0.0154876197, 0.0025629813, 0.0211567506, 0.2502374947, 0.0474838912, -0.0992149934, 0.0905931592, -0.0050883549, 0.0905452222, -0.2394493818, 0.0969278961, 0.2744240165, -0.3339275718, 0.1398564577, 0.1069495827, 0.0865374431, -0.0021411821, 0.1351286918, -0.1257364005, 0.2360790074, 0.1482806057, -0.0117648486, 0.6780452132, 0.1148016006, 0.0790784135, 0.2390660048, -0.4852784872, -0.2917053103, -0.067266956, 0.2548887134, 0.3690401018, 0.0166795217, 0.8710452318, -0.4937475622, -0.4484516084, 0.2343615294, 0.5710667372, -0.1630050689, -0.2334984094, -0.1191928983, -0.0569723547, 0.0392916538, 0.2150211483, -0.4183962643, 0.1941185892, 0.2040618509, 0.2310213447, -0.2608082294, -0.1571812779, 0.0455938615, 0.0524483956, 0.0539755188, 0.0109282238, -0.0749024823, -0.0152895479, -0.0038116397, -0.0421994403, 0.2800782919, 0.2520420849, 0.2627364695, -0.2105846554, 0.0034332846, 0.059367463, 0.1137886867, 0.0121134175, -0.0418465622, -0.023741642, -0.2986749709, 0.3994518816, 0.0088038528, -0.0923210829, 0.0307799764, 0.2637256086, 0.1043350995, -0.1144671813, -0.006139935, -0.0696772262, -0.3914432824, -0.2446208298, -0.0146357706, -0.0980906785, 0.0952304751, 0.2605695426, 0.4064263999, 0.1591135263, -0.0513001047, 0.0466477461, 0.0826472342, 0.5026727319, 0.1973204464, -0.4350138605, -0.2800351679, 0.1274704784, -0.4370202124, 0.0792030543, 0.1688423455, 0.1076083183, -0.0158125963, 0.2462880462, -0.0497193485, 0.1373992413, -0.0568727925, -0.0229412392, 0.4012256861, 0.3032228053, -0.356168896, -0.0688746497, -0.1765709221, 0.1089239419, 0.1225909218, -0.3322436213, -0.0499975085, 0.1990324408, 0.0644451454, -0.3312886059, -0.5067589283, 0.0539671294, 0.2614975274, 0.2660624385, -0.0659693778, 0.3709568977, -0.0439626761, -0.326020956, 0.0345069468, -0.166618228, 0.1727514714, 0.113242574, 0.1573902518, 0.4533777535, 0.0161142498, 0.1369043291, -0.4455271363, 0.5350666046, -0.0519477874, 0.1240377873, -0.1002098694, 0.1667047739, 0.0770303756, 0.2301459759, 0.0832029954, 0.5846361518, -0.1828311384, 0.3271813393, -0.6916028261, -0.322006017, 0.5005272031, -0.2176020294, -0.1631493866, 0.0246393494, 0.132357344, 0.2069168687, 0.18322061, -0.6202582717, -0.0762671158, 0.2132002562, -0.2426443398, -0.1637170315, -0.0185503047, -0.3184695244, -0.0223405529, 0.0580590181, 0.3536973596, 0.2758467495, -0.0369551815, 0.0476073772, -0.1522232294 ]
https://github.com/huggingface/datasets/issues/439
Issues: Adding a FAISS or Elastic Search index to a Dataset
`DPRContextEncoder` and `DPRContextEncoderTokenizer` will be available in the next release of `transformers`. Right now you can experiment with it by installing `transformers` from the master branch. You can also check the docs of DPR [here](https://huggingface.co/transformers/master/model_doc/dpr.html). Moreover all the indexing features will also be available in the next release of `nlp`.
It seems the DPRContextEncoder, DPRContextEncoderTokenizer cited[ in this documentation](https://huggingface.co/nlp/faiss_and_ea.html) is not implemented ? It didnot work with the standard nlp installation . Also, I couldn't find or use it with the latest nlp install from github in Colab. Is there any dependency on the latest PyArrow 1.0.0 ? Is it yet to be made generally available ?
50
Issues: Adding a FAISS or Elastic Search index to a Dataset It seems the DPRContextEncoder, DPRContextEncoderTokenizer cited[ in this documentation](https://huggingface.co/nlp/faiss_and_ea.html) is not implemented ? It didnot work with the standard nlp installation . Also, I couldn't find or use it with the latest nlp install from github in Colab. Is there any dependency on the latest PyArrow 1.0.0 ? Is it yet to be made generally available ? `DPRContextEncoder` and `DPRContextEncoderTokenizer` will be available in the next release of `transformers`. Right now you can experiment with it by installing `transformers` from the master branch. You can also check the docs of DPR [here](https://huggingface.co/transformers/master/model_doc/dpr.html). Moreover all the indexing features will also be available in the next release of `nlp`.
[ 0.0365024842, -0.1409252882, -0.0793722123, -0.1369623393, -0.1559904963, -0.3242333829, -0.1591324955, 0.1821871698, -0.3461939692, 0.0158339981, -0.0663877726, 0.3206753731, -0.1125185937, -0.044296775, 0.0447905213, -0.2458749115, 0.2475956976, 0.4139314592, 0.1482364535, -0.1551827788, -0.05327617, 0.219111979, -0.2554687262, 0.0467055552, -0.4506126046, 0.1217015237, -0.4123179913, -0.2625601292, -0.1536481082, -0.51975739, 0.4782426655, 0.1243589446, 0.2678397894, 0.0743240416, -0.0001179494, -0.0224405397, 0.5727152824, 0.064208962, -0.1099310666, 0.1077399105, 0.0450591817, -0.0126226805, 0.5089786053, -0.0682093501, -0.0491534099, -0.3134185374, 0.2057963908, 0.5061597228, 0.3378711641, 0.0675187856, 0.1206033602, -0.0178220533, 0.3498008251, -0.0210932866, 0.4944707453, 0.1088034585, -0.1879490167, -0.0602933355, 0.4111689031, 0.0164820869, -0.0369283222, 0.0635467172, 0.1623755693, -0.2319168448, 0.1169100031, 0.219407469, 0.1412900835, -0.370034188, -0.010380486, 0.1250044107, 0.2487773448, -0.1683011651, -0.4690059423, -0.1358832419, 0.0131435152, -0.3554196656, 0.3728209138, -0.2848746181, -0.1211847886, 0.163674444, -0.0299987514, -0.2509262562, -0.1611310393, 0.3247069716, -0.1813228577, 0.5299858451, 0.0605143569, -0.2540729344, 0.231019482, -0.241574198, 0.1807149053, 0.1000639945, 0.0172250904, 0.3674334586, -0.138193354, -0.2774772346, 0.2277395874, 0.1133944318, -0.1607006192, 0.0322504826, -0.4091069698, 0.1459733844, 0.145976454, 0.0879993141, -0.1691190153, 0.2571029961, 0.108583279, -0.08994551, 0.245900169, -0.4051271975, 0.1125743911, 0.1378310174, 0.0466921479, 0.162292853, -0.3634462953, -0.3564533889, -0.1548926085, -0.1499222219, 0.0551366992, -0.2625108063, -0.2247929722, -0.3351932466, -0.1180673242, 0.2978422344, 0.1253292412, -0.3970755339, 0.0724132806, 0.184165597, -0.1341169477, 0.0026783471, -0.0640866235, -0.156998083, -0.1755446047, 0.2645489872, 0.2724645734, -0.3028461635, 0.1628211737, -0.1974895895, -0.2274574041, 0.2945094705, -0.2795906663, 0.1216634512, -0.0080277873, 0.2258049399, -0.1684643477, -0.1023587734, -0.4655603766, -0.1620360911, -0.2403615564, 0.0633196682, -0.0646848455, -0.2811253071, -0.332385987, 0.1153731123, -0.2723727524, -0.2752389312, 0.3653652966, 0.6273085475, -0.1054334939, -0.1463756263, 0.0370825417, 0.1117177308, 0.2649066448, -0.090831697, 0.12790142, -0.0669749081, -0.2392734736, -0.3873829544, -0.1192890778, 0.1379835755, 0.0270559322, 0.2212780416, -0.2794345915, 0.2451285273, 0.0291391145, 0.5474953055, 0.6518899798, -0.2099924982, -0.1275745779, 0.0607614703, 0.1220450923, -0.2443282157, -0.0022638428, -0.183894679, 0.1356988251, -0.0307521671, -0.0200371202, 0.2575928867, 0.057600718, -0.3025500476, -0.2730577886, -0.3634372056, 0.3274669051, 0.3770820796, 0.1571438313, -0.0795034617, 0.2327449471, -0.3032663167, -0.0990578979, -0.0700984597, -0.0342258215, 0.1696011126, 0.1677805036, 0.0799387917, 0.3260692656, -0.2400517762, -0.1048391983, -0.0388669148, -0.6121019125, 0.5534068942, -0.1013177335, 0.0261406116, 0.0357755348, 0.0137111228, 0.005805131, -0.3206294179, 0.0161507372, -0.1123408079, 0.2814394236, 0.1460612416, -0.3020930886, -0.0639568418, 0.3813223839, 0.0859740973, -0.2923625112, 0.4071859121, -0.2209592909, -0.5338460803, 0.04976153, 0.2604352534, 0.0968720913, -0.1464818269, -0.0170065369, 0.1078796089, -0.3001842797, -0.1210718304, 0.2546687126, 0.1851673722, 0.2065513581, -0.4720924795, 0.0112441331, 0.0818921402, -0.0036513496, -0.0161534287, -0.0921352729, 0.2416181862, 0.4846395254, 0.0955205187, 0.2377488762, -0.1293531209, 0.2788258791, -0.1929998696, 0.0459289402, 0.0898494795, 0.153940618, -0.0809658542, 0.2004222721, 0.0485233255, -0.2047706246, 0.1411317587, 0.2866162658, -0.2145593762, 0.0336790979, 0.5055495501, -0.2039588839, -0.2953156531, 0.0027820836, -0.4623139203, 0.214407742, 0.3736828566, -0.0918908939, -0.1253001839, -0.2086355537, -0.2770305574, 0.2586475611, 0.0922294036, -0.0739521086, -0.0727839544, 0.3840744793, 0.1688702404, -0.2430409491, -0.4180776179, -0.0768431649, -0.0994063243, -0.0273016337, -0.0034202321, -0.25127846, -0.4178163409, 0.0691035613, -0.1639866084, -0.4351184368, -0.1990759969, 0.4360974133, -0.2216427177, -0.067354776, 0.4732998312, 0.1288904995, 0.2370732576, -0.1431435347, 0.0071051735, -0.4106121659, -0.2103329301, -0.5618733764, 0.0192084871, -0.1001332626, 0.2254373282, 0.001215097, 0.064646028, 0.2162148058, 0.2121964544, -0.7024003863, 0.3988601267, -0.0864365324, 0.262784332, -0.1488775611, -0.5324488878, -0.2267729789, -0.4946580231, 0.0077943578, -0.1952168345, -0.102065824, 0.0882288739, -0.060255345, -0.2269317508, -0.1090348363, -0.3814072311, -0.5280773044, -0.1570466459, 0.2040131688, -0.0679100528, 0.1073895469, 0.3181128204, -0.0506506972, 0.11002215, -0.2128943056, 0.0045777047, -0.0235257298, 0.3745416105, 0.6374517679, -0.0600388199, -0.3186367452, -0.2763062716, -0.3181281686, -0.0593606755, 0.1465303898, -0.1140687838, 0.1144092903, -0.2133483142, 0.0933071226, 0.2897823453, 0.2270315737, 0.5762735009, 0.1408130527, -0.1108592153, 0.0571629331, -0.242983371, 0.1431851089, 0.1934716254, 0.3914707601, -0.1920496523, -0.0581867434, -0.2578211129, 0.7521787882, -0.1656469852, -0.3004692495, 0.3863735795, 0.0796527416, 0.1235763729, 0.0249823388, -0.1162037179, 0.2011025697, 0.0311027393, 0.0922006592, 0.4274148047, 0.0600243881, -0.7173539996, -0.209135294, -0.0713738129, -0.3607712388, -0.0738186762, 0.0101718474, 0.2364363074, 0.3325142562, -0.0094522787, 0.0543702655, -0.1251542866, -0.2496005446, 0.0913430303, 0.0156427827, 0.0475949422, -0.1001984328, 0.0703955591, -0.3965112865, -0.2799777091, 0.3130532801, 0.2775227726, 0.1295529008, -0.0985508934, 0.0140921818, 0.3031614721, 0.0464338399, 0.4732941389, -0.0971065238, -0.2817869484, 0.3034752309, 0.1876390576, -0.3634348512, -0.0693609118, -0.4106267691, 0.1294395328, 0.4587596655, 0.2216701359, -0.2273667455, -0.0255948994, 0.1146297753, -0.3202497959, -0.1248121411, -0.350826174, -0.1368909925, -0.1614024788, -0.0480226316, 0.0086913258, -0.0388682224, 0.1223485842, -0.1172252223, -0.1230456084, -0.1439415812, -0.0151908901, -0.0530880094, 0.3789567649, -0.0107014012, -0.2664446831, 0.0614035875, 0.1220489219, -0.0638586208, 0.0691419989, 0.066753909, 0.1088243648, 0.0550578386, 0.2126856148, 0.0544393659, 0.4107648432, 0.289861083, 0.0406303592, 0.3420210183, -0.196422711, 0.0381484181, -0.0950249434, -0.1867625117, 0.3242315054, -0.0163461789, -0.073403582, 0.1530244499, 0.6108983755, 0.0410074033, -0.2492135018, -0.2941949069, 0.494892776, -0.202175349, 0.9087722898, 0.0170330964, 1.133374691, 0.1396926343, 0.0611039586, 0.2462552488, -0.0842121989, 0.6033167839, -0.4079707861, 0.3965843916, -0.187384069, 0.1477984637, 0.0454423837, -0.1510639042, 0.0959804505, 0.1272278577, -0.4280602634, 0.270624727, 0.5491981506, -0.3083287477, 0.1935082674, 0.4062752128, 0.271334976, -0.1410005689, -0.3117107153, 0.0427424125, 0.1393651366, 0.3951962888, 0.0157008823, -0.4653588235, -0.1814558357, -0.169420898, -0.1713799238, 0.2771307528, 0.1936980337, 0.1036173552, 0.6412373781, -0.0107710566, 0.3417342007, -0.1403706968, 0.1461079568, -0.2261621952, -0.3170705736, 0.3154674172, -0.1712605506, -0.0721537247, 0.1493685097, 0.0974320844, 0.428227663, -0.0895458609, -0.2788537443, 0.1490695924, 0.0220955834, -0.1760273725, -0.231478408, -0.2273620069, -0.4244581759, -0.0597066022, 0.3894447386, 0.1086546034, -0.0448742062, -0.0818958208, 0.1337122768, 0.0657281727, -0.0608473346, 0.3853736222, 0.1624209732, 0.1091585383, -0.1178532094, 0.4234653413, 0.1116661727, -0.0448561981, 0.2996018231, 0.0848902613, -0.3486422002, 0.0073484578, -0.5456366539, -0.0168501325, -0.4922620952, -0.0559062921, 0.0285596345, -0.2865241766, 0.0879116878, 0.2721904516, 0.1671659648, -0.0502022468, -0.4117508531, 0.0614251979, -0.1304933578, 0.45499897, 0.0094226077, 0.1388651133, -0.0578335412, 0.2327503562, 0.2530174553, 0.4221579134, -0.2839446664, -0.1441481858, -0.1475259662, 0.2386001498, -0.2370138764, -0.4023134708, 0.1479161084, 0.0238201208, 0.0114105707, 0.081942752, -0.0960621089, -0.074232839, -0.0392618813, 0.1350000054, 0.2621520758, -0.1402867734, -0.3260720372, -0.0002276603, 0.1000277176, -0.0954459384, -0.0983681306, -0.2853770852, 0.0039759427, 0.2688606083, 0.31016469, -0.1968744993, 0.2346116751, 0.1285113841, 0.1994064897, 0.4068382978, 0.2551557124, 0.2564766407, -0.1416206807, -0.0747374967, 0.1387982219, 0.1374051124, 0.1261005849, 0.058917515, 0.2528764606, -0.3256133795, -0.2401999384, -0.262583524, 0.1354921013, 0.2462043613, -0.1196287796, -0.1188755631, 0.428691417, 0.0911407769, -0.3163750172, -0.0043918369, 0.3697549403, 0.2083337307, -0.0783287287, -0.0964373201, 0.5143990517, 0.0273680594, 0.1132031307, 0.1560066193, 0.1627742946, 0.3030818403, -0.3191555142, -0.0194683392, 0.0985655114, 0.0524449199, 0.4392339587, 0.0536861755, 0.1793844104, 0.1957716346, -0.1282254308, 0.2207375765, -0.2564576864, 0.2605251074, 0.2463693023, 0.0980715379, 0.0292848535, 0.0417113788, 0.6925808191, 0.0133148916, 0.1029678434, 0.3768162727, 0.404640168, -0.1469329745, -0.1315662712, 0.3730298579, 0.0391931646, -0.3156323433, 0.3761721253, -0.0364098214, -0.2104443312, -0.0256735831, -0.0667569786, -0.1785057336, 0.0451074056, 0.0448328853, -0.1364882886, -0.2802777886, 0.1971088499, 0.118731752, 0.3354721963, 0.1892701089, 0.3666152954, -0.2245604247, -0.2313599885, 0.0424577259, 0.4983379245, 0.2246088237, 0.1280283332, -0.6307684779, 0.0605748892, -0.0917689651, -0.1626631618, -0.0357748196, 0.3476498723, 0.1403849423, 0.2971371114, -0.1498183608, -0.0090173623, -0.0943764001, -0.1213885173, 0.0095821703, 0.2688102424, -0.0016038718, 0.1707887352, 0.2349535525, -0.2277477831, 0.0978333279, -0.1615010351, -0.4631529152, 0.2085969746, 0.2134367228, -0.1320756525, -0.0596514754, 0.0094562564, 0.061069306, 0.1110364646, 0.4639389217, 0.5046032071, 0.4634209275, 0.0534518324, -0.1097840369, -0.0632173866, 0.0661505014, -0.0042867134, 0.0065693073, 0.2461322844, 0.1695413589, -0.0130823301, 0.0458687767, -0.0164378397, 0.2242893726, 0.009721051, -0.0279514678, -0.3346087635, 0.203865096, -0.3020476401, -0.0616790764, -0.1221165285, 0.2529069483, 0.0435540676, -0.1262923181, -0.0740374923, -0.2473903149, -0.0063573443, 0.1367201954, 0.0700309798, 0.4863365293, 0.2643498778, 0.2858442366, -0.1685401946, 0.3572317362, -0.1491304487, -0.2684082687, -0.0369236656, -0.094407253, -0.0409677997, -0.0880126953, -0.2358719707, -0.2033031583, -0.1965108216, 0.0558080412, -0.2785724401, -0.0634655952, -0.1141149849, -0.0547992103, -0.2686131895, 0.032120008, -0.0386709906, 0.0790923238, -0.0798291191, 0.1704726368, -0.2691619694, -0.2769071162, 0.4201647043, -0.42253232, 0.0081148548, 0.0434493683, 0.0265989713, 0.6671046019, 0.1105665788, -0.5503880978, -0.2402532548, 0.080797188, 0.0238997154, -0.1151853055, 0.087650016, 0.3364039958, -0.1965497732, -0.2017679363, 0.0055699511, 0.2425365597, 0.0938604251, -0.3759278357, -0.2207049876 ]
https://github.com/huggingface/datasets/issues/439
Issues: Adding a FAISS or Elastic Search index to a Dataset
@lhoestq I tried installing transformer from the master branch. Python imports for DPR again didnt' work. Anyways, Looking forward to trying it in the next release of nlp
It seems the DPRContextEncoder, DPRContextEncoderTokenizer cited[ in this documentation](https://huggingface.co/nlp/faiss_and_ea.html) is not implemented ? It didnot work with the standard nlp installation . Also, I couldn't find or use it with the latest nlp install from github in Colab. Is there any dependency on the latest PyArrow 1.0.0 ? Is it yet to be made generally available ?
28
Issues: Adding a FAISS or Elastic Search index to a Dataset It seems the DPRContextEncoder, DPRContextEncoderTokenizer cited[ in this documentation](https://huggingface.co/nlp/faiss_and_ea.html) is not implemented ? It didnot work with the standard nlp installation . Also, I couldn't find or use it with the latest nlp install from github in Colab. Is there any dependency on the latest PyArrow 1.0.0 ? Is it yet to be made generally available ? @lhoestq I tried installing transformer from the master branch. Python imports for DPR again didnt' work. Anyways, Looking forward to trying it in the next release of nlp
[ 0.0592438541, -0.0141793946, -0.1230470091, -0.17468445, -0.2136998475, -0.3094343543, -0.2024401128, 0.1878231764, -0.2731277347, -0.0180023778, 0.1258616894, 0.4488860667, -0.1200057864, 0.0128092598, 0.0272125062, -0.2012904882, 0.2756507993, 0.4141332805, 0.1880779266, -0.1802969426, -0.0639465675, 0.2660615444, -0.3757486939, 0.1084292755, -0.3733388484, 0.119513005, -0.4001508951, -0.1794676036, -0.2072294652, -0.5200279355, 0.4982816875, 0.1200130433, 0.1677701622, -0.0054160343, -0.0001168645, -0.0834378004, 0.5949627161, 0.0467752442, -0.0684178919, 0.052008085, 0.0475997999, -0.1152836308, 0.501039803, -0.047823187, 0.0164518878, -0.3274893165, 0.2020205706, 0.4445809722, 0.2767578065, 0.1424151659, 0.1396360695, -0.1405021101, 0.3247389495, -0.0397443436, 0.4015785456, -0.0442503877, -0.1242004931, -0.0819103271, 0.4457005262, -0.0774321929, 0.0063585653, -0.044044815, 0.0988060459, -0.1819068193, 0.1066217795, 0.1319277138, 0.2320649177, -0.3828478456, -0.0229042135, 0.0497767627, 0.1373977065, -0.0845370442, -0.3730430305, -0.1281930059, 0.1072310656, -0.4572899342, 0.4009218514, -0.2419736087, -0.2164804786, 0.1059383452, -0.0273044948, -0.3213630021, -0.2079932541, 0.3174877763, -0.2134220302, 0.4697515965, 0.0514703467, -0.220069021, 0.2339063585, -0.2200534493, 0.2091202736, 0.1614213288, 0.0046578934, 0.3524920642, -0.0736417323, -0.2080269754, 0.2646900415, 0.2331193686, -0.1770543903, 0.0817956328, -0.4286394417, 0.1595921814, 0.0953153893, 0.0815043226, -0.1969237179, 0.2000456303, 0.0850958601, -0.1773303449, 0.2752023935, -0.319164753, 0.0964026898, 0.2266247272, -0.0213945378, 0.0757580176, -0.4990971386, -0.3258015811, -0.1640275419, -0.1835734248, -0.0718303919, -0.1695809662, -0.3082044423, -0.2747520208, -0.1742532998, 0.2096714079, 0.0724699721, -0.211613223, 0.200526163, 0.2056863904, -0.1665837318, -0.0948195606, -0.0224239156, -0.0403509662, -0.2784217596, 0.2005557716, 0.2567536533, -0.2662535012, 0.2235691249, -0.1683191806, -0.2347906083, 0.3373527229, -0.2714015245, 0.1439445168, -0.0348652974, 0.1348386407, -0.1238648742, -0.1286253035, -0.4871388376, -0.2091957033, -0.1740939617, 0.0499710143, -0.0126800556, -0.1684692353, -0.3270563185, 0.1455114633, -0.2288086712, -0.3878190815, 0.4384031892, 0.6058793664, -0.1549183428, -0.0916510299, 0.0036914239, 0.000842151, 0.314856559, -0.1032304093, 0.1083214059, -0.1296105236, -0.3205523491, -0.3506692052, -0.1114014313, 0.1302197129, 0.0836700872, 0.2001712322, -0.2039765269, 0.2088034004, 0.0842564479, 0.5598308444, 0.713758111, -0.249404639, -0.0825685561, 0.0901599228, 0.1399412602, -0.2311056256, 0.0015102846, -0.1959899962, 0.1299802959, -0.0348635726, 0.0693846121, 0.3618212342, 0.0850707144, -0.385150224, -0.2908702195, -0.4074506164, 0.3496375382, 0.3368125856, 0.235815376, -0.0990300402, 0.14160344, -0.2938736081, -0.0359725989, -0.1276394278, 0.0053383419, 0.0921123177, 0.093486473, 0.1497267485, 0.2479843497, -0.2244761437, 0.0610381477, -0.0596712604, -0.5969666243, 0.5358671546, 0.0315450355, 0.1064156219, 0.0217188224, -0.0304882918, -0.0421890058, -0.3593740165, 0.0465149656, -0.0584431961, 0.3487761915, 0.2340878993, -0.2853092253, -0.0835982934, 0.2847380936, 0.049226962, -0.2090055048, 0.318923384, -0.2638426721, -0.5850798488, 0.135911867, 0.373418808, 0.0751916021, -0.0719691068, 0.0612217225, 0.0764648095, -0.36009112, -0.1545645446, 0.1580305696, 0.0245529227, 0.2197671831, -0.3405788541, 0.0494573526, 0.0365093239, -0.0102006244, 0.0282031558, 0.0433061533, 0.2037337422, 0.5271432996, 0.042954348, 0.2765479088, -0.0150385145, 0.3046873212, -0.2103613466, 0.0834924579, 0.1226690561, 0.1765887886, -0.15016298, 0.1475789994, -0.0668567121, -0.3327260017, 0.2287940979, 0.291963011, -0.1852940023, 0.006952405, 0.4050533772, -0.1685331315, -0.3128302395, 0.0323311239, -0.5013380051, 0.3017616272, 0.3670203984, -0.1285232753, -0.0740582719, -0.3326499462, -0.3564534187, 0.2985064983, 0.0053435578, -0.1035918593, -0.1053145453, 0.3690223098, 0.152714029, -0.2460768372, -0.3854294121, -0.0478540547, -0.0822340399, -0.023409415, -0.0061433613, -0.4174495637, -0.5681113601, 0.0978689268, -0.1454335004, -0.3099066615, -0.2747798562, 0.4315382838, -0.1552890539, -0.0024640013, 0.4569205642, 0.0884079188, 0.2736099064, -0.15152134, 0.1012926027, -0.4035412967, -0.2560893893, -0.5996540785, 0.0461746901, -0.0070877061, 0.2701752484, 0.0883503705, 0.0279434565, 0.123009257, 0.1659337729, -0.6194006205, 0.3482747674, -0.1487368494, 0.2856456935, -0.0940538421, -0.5511429906, -0.20576711, -0.4268228412, -0.0547475331, -0.2271086723, -0.1468819231, 0.0188630205, -0.0572918132, -0.3229560554, -0.1480234712, -0.4084333479, -0.435157001, -0.1401527673, 0.2142417431, 0.0395384803, 0.0588512458, 0.1975743175, -0.075711377, 0.1870773584, -0.179019466, 0.0774520114, -0.0484723002, 0.408597976, 0.5637871623, -0.0856353492, -0.4115512371, -0.1669466347, -0.2422401905, 0.0285184104, 0.1471632123, -0.18285124, 0.0580343343, -0.1403614432, 0.1632644832, 0.2589230537, 0.2589215636, 0.5880925655, 0.0734347627, -0.1134549454, 0.0305125974, -0.2120326608, 0.1438655406, 0.0883482173, 0.3923085928, -0.1175514311, -0.0221721884, -0.2029245049, 0.6386979222, -0.1549404413, -0.3184790015, 0.3930823505, 0.0697891563, 0.129881978, 0.0054900432, -0.0838116109, 0.2943468094, 0.0505583994, 0.2066072524, 0.383600533, -0.021629259, -0.6913452148, -0.2100386322, -0.0116652334, -0.3025423586, 0.0077628624, -0.1039870605, 0.0614933483, 0.3284474015, 0.0121211717, 0.0533965752, 0.0074180206, -0.2160621434, 0.098476328, -0.0119183697, 0.0943684131, -0.0891463235, 0.0429692641, -0.4413602054, -0.2340091616, 0.3478422165, 0.1716232896, 0.1526614577, -0.1299133301, -0.0009563001, 0.2992294133, -0.0243389141, 0.3316759765, -0.124946475, -0.3391500115, 0.4021449387, 0.3033950031, -0.3724466562, -0.1119723693, -0.3990402818, 0.1747431606, 0.4907317162, 0.2035348713, -0.1172673777, -0.0463111289, 0.1898664385, -0.3391608, -0.0570780113, -0.2467091233, -0.1130191833, -0.2649119794, -0.0847263336, 0.007449952, -0.0721186772, 0.133693397, -0.1844213605, -0.0550444126, -0.1349463314, -0.0150634898, -0.0477614142, 0.3356501162, -0.1110274121, -0.2225154489, 0.0734510645, 0.01249127, 0.0551689826, 0.0320753343, 0.0116988951, 0.1928334683, 0.1264008582, 0.2378140241, -0.0401197188, 0.4711703062, 0.315834552, 0.0417377874, 0.3017107844, -0.3949325979, 0.0374772437, -0.0748538524, -0.1443203241, 0.3766116202, -0.0541480035, -0.0129252039, 0.1214610487, 0.4406948686, 0.1119293869, -0.2288442403, -0.2961522639, 0.4306165576, -0.207100749, 0.8095926046, 0.0416992903, 1.0631245375, 0.2075319588, 0.1021278724, 0.3214926422, -0.0776379183, 0.6415961385, -0.3527670205, 0.3848256469, -0.2034811974, 0.3640376925, 0.0502681993, -0.1063915864, 0.2313317955, 0.0651070178, -0.4607391357, 0.3050265908, 0.6316833496, -0.5515393615, 0.238744691, 0.2986892462, 0.2288756073, -0.1000687629, -0.3262161314, 0.0651115626, 0.1458826661, 0.3255531192, 0.0299459379, -0.3902044594, -0.2425751984, -0.1544921249, -0.182827279, 0.3070864379, 0.2162065059, 0.0256643947, 0.5504889488, -0.0480520055, 0.34290573, -0.1830752939, 0.2019943297, -0.2214520127, -0.2795248628, 0.2059275061, -0.1806640327, -0.1863909662, 0.2789826095, 0.110855937, 0.4783036411, -0.1785260141, -0.2471666187, 0.2273511738, -0.0119850924, -0.1021620557, -0.410890907, -0.1723777801, -0.3801225722, 0.0314515792, 0.2445611805, 0.1389167905, 0.076369673, -0.0390642323, 0.1476030648, 0.0275732484, -0.0304050911, 0.4520758986, 0.0978589877, 0.146263659, -0.0796442628, 0.3522553742, 0.082805112, -0.1016988307, 0.3360195756, 0.0391183943, -0.3150660694, -0.0359502621, -0.5736920238, -0.0591388866, -0.3388134539, -0.1081743166, 0.0787253529, -0.2951439321, 0.0935454518, 0.2771794796, 0.0542382523, -0.0378453508, -0.2932755649, 0.0016483872, -0.0085249348, 0.4036151767, -0.0916768387, 0.0483512767, -0.0371698178, 0.322955966, 0.3199602365, 0.3426151276, -0.2777294517, -0.0734338686, -0.1637002528, 0.2091830522, -0.1636304855, -0.347116679, -0.0160347577, 0.046044711, 0.0319348648, 0.0929895267, -0.028879106, -0.0872121453, -0.0063759154, 0.1165389195, 0.3504098058, -0.1507748216, -0.1828803718, -0.0751942545, 0.0393702239, 0.0581015311, -0.11206498, -0.3036645651, -0.1069653034, 0.320875138, 0.20558092, -0.0668429062, 0.3638150096, 0.1654620022, 0.1632004678, 0.4954354167, 0.1743811518, 0.2557826042, -0.0062729595, -0.0377168022, 0.1178351045, 0.1068404615, -0.0002792173, 0.1137577519, 0.2845737338, -0.3544378281, -0.2378750443, -0.3208031356, 0.1212213337, 0.3710857928, -0.1773020029, -0.1021058857, 0.5498791337, 0.1040198654, -0.3391271234, 0.0448365733, 0.3776488602, 0.1836223751, -0.1782503575, -0.1613055319, 0.5033270717, -0.1237192005, 0.0655728728, 0.1693846881, 0.0281036701, 0.1925700903, -0.3202223182, -0.1176672131, 0.1280381083, -0.025660133, 0.2917710841, 0.0684880838, 0.1458536237, 0.2214781493, -0.0340510979, 0.1699713767, -0.1314252168, 0.2671310008, 0.2083173096, 0.1047531813, -0.0451945402, 0.0180855375, 0.643656373, -0.0035916329, 0.0994981453, 0.4499207735, 0.3544282019, -0.191055268, -0.0970867053, 0.4414841831, 0.0177575611, -0.3282757998, 0.2047423571, -0.0465882756, -0.2082739323, -0.0006452115, -0.047201179, -0.1011462882, 0.1203367561, 0.0842987895, -0.1994645745, -0.3489929736, 0.1437584162, 0.0285492223, 0.348212719, 0.2354933769, 0.3813446164, -0.2906365395, -0.2081054449, 0.0629170835, 0.5100590587, 0.3198825717, 0.248194769, -0.6800210476, -0.0642882437, -0.1547395736, -0.1307307631, -0.1188485399, 0.4470878839, 0.2539404631, 0.3018109798, -0.1008318439, 0.0009344322, -0.0910385028, 0.0122660333, 0.0730975792, 0.1565637738, -0.1025146097, 0.1844876558, 0.2533716857, -0.1798572838, 0.0738391578, -0.1097608507, -0.5304477215, 0.2042803466, 0.1903682351, -0.0047529987, -0.0675145909, -0.1293382794, 0.0647716373, 0.0852477103, 0.4504700899, 0.5197358727, 0.39639768, 0.1408577263, -0.2211328596, -0.0473364741, 0.1154525056, -0.0504345447, -0.1142698228, 0.1308118701, 0.2489544153, 0.0097398274, 0.0486929864, -0.0511358194, 0.250056535, 0.0309250858, -0.0090075266, -0.3527624309, 0.2127010077, -0.1986588985, -0.0564959347, -0.117187649, 0.2376616299, 0.0571974292, -0.2142337412, -0.0326865278, -0.1692966521, 0.0233711842, 0.1450862139, 0.2061758786, 0.477219671, 0.3472391367, 0.3181163073, -0.0800694749, 0.2827459276, -0.2654672861, -0.2303611934, -0.1008697078, -0.0156667084, -0.0727607533, -0.1788677573, -0.1909884959, -0.1551171094, -0.1508612484, 0.0801040232, -0.3075985014, 0.0304203238, -0.1123347357, -0.0618694201, -0.2379009575, 0.1116113663, -0.1198268309, 0.1063625067, -0.1496863812, 0.2067835182, -0.3719470501, -0.2287931144, 0.3346480727, -0.4912218451, -0.0291732177, 0.0613740981, 0.0329637863, 0.5240917206, 0.0522618219, -0.4273993671, -0.3150722086, 0.0883798599, 0.0220302716, -0.1135815457, 0.1176475361, 0.2750377059, -0.2203361243, -0.1301642656, -0.0367374532, 0.1877405643, 0.0569217987, -0.2648133934, -0.2374385595 ]
https://github.com/huggingface/datasets/issues/438
New Datasets: IWSLT15+, ITTB
Thanks Sam, we now have a very detailed tutorial and template on how to add a new dataset to the library. It typically take 1-2 hours to add one. Do you want to give it a try ? The tutorial on writing a new dataset loading script is here: https://huggingface.co/nlp/add_dataset.html And the part on how to share a new dataset is here: https://huggingface.co/nlp/share_dataset.html
**Links:** [iwslt](https://pytorchnlp.readthedocs.io/en/latest/_modules/torchnlp/datasets/iwslt.html) Don't know if that link is up to date. [ittb](http://www.cfilt.iitb.ac.in/iitb_parallel/) **Motivation**: replicate mbart finetuning results (table below) ![image](https://user-images.githubusercontent.com/6045025/88490093-0c1c8c00-cf67-11ea-960d-8dcaad2aa8eb.png) For future readers, we already have the following language pairs in the wmt namespaces: ``` wmt14: ['cs-en', 'de-en', 'fr-en', 'hi-en', 'ru-en'] wmt15: ['cs-en', 'de-en', 'fi-en', 'fr-en', 'ru-en'] wmt16: ['cs-en', 'de-en', 'fi-en', 'ro-en', 'ru-en', 'tr-en'] wmt17: ['cs-en', 'de-en', 'fi-en', 'lv-en', 'ru-en', 'tr-en', 'zh-en'] wmt18: ['cs-en', 'de-en', 'et-en', 'fi-en', 'kk-en', 'ru-en', 'tr-en', 'zh-en'] wmt19: ['cs-en', 'de-en', 'fi-en', 'gu-en', 'kk-en', 'lt-en', 'ru-en', 'zh-en', 'fr-de'] ```
63
New Datasets: IWSLT15+, ITTB **Links:** [iwslt](https://pytorchnlp.readthedocs.io/en/latest/_modules/torchnlp/datasets/iwslt.html) Don't know if that link is up to date. [ittb](http://www.cfilt.iitb.ac.in/iitb_parallel/) **Motivation**: replicate mbart finetuning results (table below) ![image](https://user-images.githubusercontent.com/6045025/88490093-0c1c8c00-cf67-11ea-960d-8dcaad2aa8eb.png) For future readers, we already have the following language pairs in the wmt namespaces: ``` wmt14: ['cs-en', 'de-en', 'fr-en', 'hi-en', 'ru-en'] wmt15: ['cs-en', 'de-en', 'fi-en', 'fr-en', 'ru-en'] wmt16: ['cs-en', 'de-en', 'fi-en', 'ro-en', 'ru-en', 'tr-en'] wmt17: ['cs-en', 'de-en', 'fi-en', 'lv-en', 'ru-en', 'tr-en', 'zh-en'] wmt18: ['cs-en', 'de-en', 'et-en', 'fi-en', 'kk-en', 'ru-en', 'tr-en', 'zh-en'] wmt19: ['cs-en', 'de-en', 'fi-en', 'gu-en', 'kk-en', 'lt-en', 'ru-en', 'zh-en', 'fr-de'] ``` Thanks Sam, we now have a very detailed tutorial and template on how to add a new dataset to the library. It typically take 1-2 hours to add one. Do you want to give it a try ? The tutorial on writing a new dataset loading script is here: https://huggingface.co/nlp/add_dataset.html And the part on how to share a new dataset is here: https://huggingface.co/nlp/share_dataset.html
[ -0.3334828615, -0.3722022772, -0.092476882, 0.0178871378, -0.1826997697, 0.1093529314, 0.3688519895, 0.2643734217, -0.1256049573, 0.3148257434, -0.4613341689, -0.0776400268, -0.0648032278, 0.1805540472, 0.1016526371, 0.1559134722, 0.0136738, -0.0235784799, -0.1810164899, -0.0543647297, -0.2652777731, 0.2664158642, -0.1272369176, -0.1815756857, -0.3280389309, 0.0483209416, -0.3616864681, 0.1481477767, -0.1781798154, -0.3179268837, -0.0962832868, 0.2018678933, 0.0043575619, 0.236844942, -0.0001070355, -0.1905525625, -0.076282002, -0.0908375159, -0.3510017395, 0.1006619111, -0.2646729946, -0.2651145756, -0.1263944209, -0.2893663943, -0.3872864246, -0.0671800151, -0.1151144281, -0.3258392215, 0.0424563177, 0.200076431, 0.2592929304, 0.2519879341, -0.3639662862, -0.2319179475, 0.0204406437, -0.1725868732, -0.198318705, -0.0694198236, 0.5608636141, 0.2720469832, -0.2547253966, 0.2221034765, -0.0003467833, 0.1921165287, -0.0048927125, 0.1211782694, 0.3246235847, -0.0065180156, -0.1593533456, 0.4086938202, 0.3740613759, -0.1164145842, -0.2830062211, -0.0593640171, -0.1900770664, -0.2303510904, -0.2105082273, 0.0816255882, -0.1196679175, 0.1249302477, -0.0415160768, 0.0868017226, -0.2472941428, 0.1161826104, -0.0923118517, 0.9784517288, -0.009004714, -0.0894225985, -0.0342593305, -0.2545592487, -0.0455785282, -0.1130448878, 0.0165106803, -0.0601291656, -0.0861635655, -0.2744804323, 0.2924727499, 0.0434689336, -0.0622246079, 0.0590406023, 0.1029749513, 0.0711522028, 0.3325048685, -0.0934901386, -0.2517018318, 0.0551238358, -0.1344217062, -0.4063022435, 0.0929869264, -0.1309959888, 0.0491632968, 0.138320446, 0.1221537292, -0.1984281838, -0.5016502738, 0.0056258696, -0.1008064896, 0.0083087878, -0.1851603538, -0.0633361265, 0.15198493, -0.2173838764, -0.0983584449, 0.1566028744, 0.0331039466, 0.0121341664, 0.1411258578, -0.0101373279, -0.2406611443, -0.2322078347, -0.1520593911, 0.1009302959, -0.202644825, 0.0283983573, 0.3800958991, 0.5238034129, -0.04189872, -0.0189719573, 0.219550699, 0.4000493884, -0.0696535483, 0.1028328389, 0.7088278532, 0.1578482091, -0.0999299809, 0.0830125213, -0.0932009965, 0.1064209864, -0.2886229753, -0.0697039291, 0.2261245102, -0.1155597046, -0.0921944678, 0.2713845074, -0.178469047, -0.2367868423, 0.5732967257, 0.4183843732, -0.0948930979, -0.0091868704, -0.0527611896, 0.0809449852, -0.3100984693, -0.1258618087, 0.0837471932, 0.2288595736, -0.5910981297, -0.1100829691, -0.1314500421, 0.2189660668, 0.2230558395, 0.1125309318, -0.043024119, 0.1650476009, -0.2222633958, 0.3110170662, -0.0164758116, 0.010654795, 0.1134818196, -0.0392745845, -0.1310181767, -0.1334375888, 0.4240179658, 0.1913642436, 0.2322639525, -0.113651827, -0.1647870392, 0.2035280615, -0.2517413795, 0.0421082862, -0.245138377, -0.2300684601, 0.5268053412, 0.1110178679, 0.1924540401, -0.3725349903, 0.0999877676, 0.1659070849, 0.4689547718, -0.2773908973, 0.1345429569, -0.1531639844, 0.3069566488, -0.0678337067, 0.1636536568, -0.2083518803, -0.0154859573, 0.1424133778, -0.1754939407, 0.6150255203, 0.2148752809, 0.3419878483, 0.0176723823, -0.0650307313, -0.2481765598, -0.2017677873, 0.2806342542, 0.2754364908, -0.1205323562, -0.2836518884, -0.1200034842, -0.0141043607, -0.0794234052, -0.1126093045, -0.3751187623, 0.0413338691, -0.1244364902, -0.0230783653, 0.1100061014, 0.4384025335, 0.0560681298, -0.1176028252, -0.0888799578, 0.091653429, -0.2073231041, 0.280641824, 0.2597601116, 0.5066598058, 0.179917112, -0.3302952051, 0.2640104294, -0.0370447934, 0.0020616541, -0.1470851004, 0.2458807379, 0.4308544397, -0.1414054632, 0.2891124785, 0.0322200768, -0.1204732433, 0.1530537605, -0.140721038, -0.1774054468, -0.2646365464, 0.2876597941, -0.0283268187, 0.0307484008, -0.0372506976, 0.3311647475, 0.3989810944, 0.4106971025, 0.1012398005, 0.0374422669, -0.1233826876, -0.085672535, -0.1140096188, 0.1963429302, -0.148139596, 0.1982421577, 0.3941271305, 0.2930687964, -0.0063038068, -0.0081454823, -0.2674535513, 0.3682320714, 0.0831601173, -0.0806124434, 0.3035694659, -0.1025724486, -0.0797004104, -0.3303619027, 0.0464311019, 0.0004445569, -0.0467909016, 0.0490887314, 0.0173671693, -0.2349146307, -0.1608107388, -0.2334727049, -0.3551644981, -0.0800623, -0.3991768956, 0.2940738499, -0.009190633, -0.2574591935, 0.1491000056, 0.0934518352, 0.5956986547, -0.1647155285, 0.3882246315, -0.2031997889, -0.2412427217, -0.2354212105, 0.303473115, 0.1065900326, 0.033332333, 0.5829259157, -0.2871759236, 0.1692099571, -0.0815073028, -0.4728699028, 0.1743195802, 0.015184015, 0.0840857103, 0.224630788, 0.0063929148, 0.1907296479, -0.268040359, 0.1473172605, -0.1281913519, -0.0734210014, -0.0660987124, -0.2781066597, -0.3567062616, -0.0101306271, -0.8072673082, -0.466809392, -0.22721681, -0.001244503, -0.2746873498, 0.0771185681, 0.2422077954, -0.1127376482, 0.1935004294, -0.1483844519, 0.1213303506, -0.2372913063, -0.0725687742, 0.2338349968, -0.3333697617, -0.1917579025, 0.0768795088, -0.0045272708, 0.3215012252, -0.139231503, -0.0256989803, 0.4002656639, 0.0484404415, 0.2887955904, 0.3326584697, 0.4452302158, 0.212441504, 0.2143186927, -0.2785194218, -0.3447281718, -0.0780807436, 0.0277501512, 0.187992081, 0.2707403898, 0.1232827529, -0.0448737964, 0.136517778, 0.4299831986, 0.1162666231, -0.1589790434, 0.2109698504, 0.0902183503, -0.0171171818, 0.0547474623, -0.460901767, 0.4322127104, -0.0753145218, -0.0908727124, 0.6659477353, -0.0355999023, -0.077880688, -0.1606564224, 0.4709330797, -0.0669512898, -0.2566489875, 0.0866396502, -0.0473855101, 0.2723076642, 0.1539360732, -0.3449327052, -0.3575872481, -0.2558022738, 0.0479978174, 0.0553066693, -0.1811758727, -0.1124145538, 0.0172272306, 0.0508791357, -0.448672384, 0.174811855, 0.2414568812, 0.3168322146, -0.2165373266, -0.118185088, -0.0517668501, 0.1543854177, 0.1541741192, -0.3376964629, -0.0922998488, 0.1863253713, -0.1468840539, -0.0556479692, 0.0642164275, -0.4884226024, 0.0165667832, 0.4068897665, 0.0029174224, -0.0957784578, -0.2474063635, 0.083954148, 0.3582585156, -0.2509702146, -0.059271723, 0.0600355007, -0.0164424926, -0.058067698, 0.0867890343, 0.0004027682, 0.1273498982, 0.0102263577, 0.0821222216, 0.1796138436, -0.0833233893, 0.2549473941, 0.1805138588, -0.1419230849, 0.2616841495, -0.0194863863, 0.0551653728, 0.3926157951, 0.1041794643, 0.2982868552, -0.2377617359, -0.0168036446, 0.1231902689, -0.2735188901, 0.3650425673, 0.5031778812, 0.0542167649, 0.0683701783, 0.1348577887, 0.0356108174, -0.3472727835, 0.1898888499, -0.1537940055, 0.2292505354, -0.1234717518, 0.1608447284, 0.0043978263, -0.1318330169, -0.1393217444, 0.1764629036, 0.0369969681, -0.41770491, 0.0813199058, 0.2697204351, 0.9081617594, 0.1166391522, 0.1585990041, 0.247941643, -0.1069558784, -0.1235681996, -0.0871866718, 0.0164082814, -0.2227158397, 0.0723862499, -0.0025102941, 0.0884087682, -0.0037569904, 0.4009151161, -0.0551582836, 0.1393930465, 0.5569096208, 0.1016308963, 0.1585953981, 0.2449043691, 0.1326385587, -0.420319587, -0.010384161, 0.2484361976, -0.0707785264, -0.1553054303, -0.1357746422, -0.11431472, 0.0853030384, 0.0539996624, -0.2807553709, -0.0407028571, -0.5479022264, 0.1362302005, -0.4296945333, -0.1737635136, 0.1124767661, -0.2767390907, 0.3626979589, -0.0050138547, -0.1961691827, -0.0884708092, -0.1599102914, 0.144428432, -0.2347545177, -0.0022886265, 0.3436668813, -0.2297107428, -0.2189770639, -0.1852140129, 0.1544436961, -0.1659738868, 0.0369705372, 0.0560203791, 0.4264518619, -0.1247679591, 0.2401203811, 0.3004260659, -0.1864311397, -0.2889264226, 0.1699923873, 0.053019505, -0.466204524, 0.4557074606, 0.0103965849, -0.1018571556, -0.2058901936, 0.1422105581, 0.1639941633, 0.1020242199, 0.0889321268, 0.4726660848, -0.2444576621, -0.3337054849, 0.1085774451, 0.2642264962, -0.212259531, 0.0464466065, 0.2941994369, -0.2451593578, 0.0327762291, 0.5464958549, 0.4080555737, 0.0927017182, -0.230790019, -0.0631738082, -0.1403224915, 0.1981207132, 0.0118736718, 0.5117024183, -0.0265917145, 0.2004823536, -0.1185654104, -0.0341288075, -0.4652319252, -0.0402005427, 0.0808378682, 0.0937290862, -0.1019300595, -0.2751198113, -0.1194092855, 0.1739663184, 0.1288013607, -0.1284707487, -0.2571575046, -0.2986705005, -0.260507077, 0.0846716911, 0.081029959, -0.2016495466, 0.0910662636, 0.0473578013, -0.0333051495, -0.1721802205, 0.1191199645, -0.0243667942, -0.0794990659, 0.3310464025, 0.3911226392, -0.4266446531, -0.0646513104, 0.0187308099, 0.3707017004, 0.0060198773, 0.1250882745, 0.2350398451, 0.1173314825, -0.197115615, 0.3461292982, 0.2029718757, 0.1662790924, -0.098064594, 0.11627388, -0.0107703162, -0.1371081471, 0.2711567581, 0.2495610714, 0.0644427314, 0.0991467834, -0.375410825, 0.0503891036, 0.2874404788, -0.4011576474, -0.0783395544, -0.0078470437, -0.017826641, 0.3304078877, 0.2903862596, 0.4299239218, -0.0786552504, 0.178813681, -0.0167875141, -0.2648404837, -0.1244056001, 0.0836111456, 0.1068070233, -0.0598886125, 0.1551774889, 0.1306483001, -0.1934783459, 0.0083457027, 0.0659055933, -0.0772135332, 0.9309543967, -0.0250182059, 0.0329418704, 0.2934622169, -0.0905069932, 0.1361295283, -0.3587464392, 0.103076905, 0.2292916924, 0.1388235241, 0.2720466554, 0.0696393028, -0.3048449159, -0.2312243283, 0.2099306136, -0.3689032197, -0.0648866743, 0.047106877, -0.2788590193, -0.245999828, -0.1239401698, -0.07924328, 0.0644880757, 0.3866285384, 0.0630616024, 0.1302511245, -0.1684918106, -0.0924482271, -0.0843958035, 0.0218425933, -0.1803234518, 0.3002911508, 0.4029868245, -0.246487543, -0.0792391747, 0.4237110019, 0.0625784099, -0.0248852372, -0.1714932173, 0.1750066876, -0.2262556702, -0.1402632445, -0.1907266676, 0.2400521636, -0.0189458653, -0.2605826557, 0.2505829334, 0.1317292303, -0.1262592077, -0.1668639928, 0.1634864062, -0.573374033, -0.0259808525, 0.0337550342, 0.1563692242, -0.0879804492, -0.1432313621, 0.2840708494, -0.3045534492, 0.027931124, 0.2656627297, -0.3911349773, 0.045273114, 0.0023917034, 0.1117326468, -0.0416817069, 0.747410655, 0.1417999119, -0.1485964656, -0.3499347568, -0.2589433491, -0.372082293, -0.0815168023, 0.1000941917, 0.3815599978, -0.3538078666, 0.1064776555, 0.2908459604, 0.1203454733, 0.1783048511, 0.1155847386, -0.1099236235, 0.1122639254, -0.5181726813, -0.004155884, 0.3043668568, 0.2814524472, -0.0202700943, 0.0776095912, 0.0000653723, -0.0739579275, 0.1314822882, -0.1722525209, -0.1767569929, 0.3135389686, 0.2274089158, -0.0641393512, 0.2742759883, 0.3530698717, -0.3639172912, -0.1765120327, -0.2551379502, -0.1928963363, -0.0312148575, 0.2922403812, 0.0906789303, 0.3055386841, 0.0111887297, -0.1774163991, -0.046042081, -0.2982515693, -0.0074246107, -0.0276956782, -0.2427571714, 0.2052914202, -0.1747416854, 0.3201977611, 0.0931887999, 0.5315688848, -0.0653214082, 0.2351935804, -0.1621198505, -0.3991538584, 0.3055489361, 0.0906885788, -0.3430289924, -0.2722947896, 0.1945737004, -0.0463959873, 0.2940965295, -0.3802622259, -0.1947212517, 0.1568623185, 0.0015751154, 0.1056378707, 0.522100091, 0.3171328306, -0.1515060514, -0.1247109249, -0.0763129741, 0.4320124388, -0.2402194291, -0.3114913404, -0.2136414498 ]
https://github.com/huggingface/datasets/issues/438
New Datasets: IWSLT15+, ITTB
Hi @sshleifer, I'm trying to add IWSLT using the link you provided but the download urls are not working. Only `[en, de]` pair is working. For others language pairs it throws a `404` error.
**Links:** [iwslt](https://pytorchnlp.readthedocs.io/en/latest/_modules/torchnlp/datasets/iwslt.html) Don't know if that link is up to date. [ittb](http://www.cfilt.iitb.ac.in/iitb_parallel/) **Motivation**: replicate mbart finetuning results (table below) ![image](https://user-images.githubusercontent.com/6045025/88490093-0c1c8c00-cf67-11ea-960d-8dcaad2aa8eb.png) For future readers, we already have the following language pairs in the wmt namespaces: ``` wmt14: ['cs-en', 'de-en', 'fr-en', 'hi-en', 'ru-en'] wmt15: ['cs-en', 'de-en', 'fi-en', 'fr-en', 'ru-en'] wmt16: ['cs-en', 'de-en', 'fi-en', 'ro-en', 'ru-en', 'tr-en'] wmt17: ['cs-en', 'de-en', 'fi-en', 'lv-en', 'ru-en', 'tr-en', 'zh-en'] wmt18: ['cs-en', 'de-en', 'et-en', 'fi-en', 'kk-en', 'ru-en', 'tr-en', 'zh-en'] wmt19: ['cs-en', 'de-en', 'fi-en', 'gu-en', 'kk-en', 'lt-en', 'ru-en', 'zh-en', 'fr-de'] ```
34
New Datasets: IWSLT15+, ITTB **Links:** [iwslt](https://pytorchnlp.readthedocs.io/en/latest/_modules/torchnlp/datasets/iwslt.html) Don't know if that link is up to date. [ittb](http://www.cfilt.iitb.ac.in/iitb_parallel/) **Motivation**: replicate mbart finetuning results (table below) ![image](https://user-images.githubusercontent.com/6045025/88490093-0c1c8c00-cf67-11ea-960d-8dcaad2aa8eb.png) For future readers, we already have the following language pairs in the wmt namespaces: ``` wmt14: ['cs-en', 'de-en', 'fr-en', 'hi-en', 'ru-en'] wmt15: ['cs-en', 'de-en', 'fi-en', 'fr-en', 'ru-en'] wmt16: ['cs-en', 'de-en', 'fi-en', 'ro-en', 'ru-en', 'tr-en'] wmt17: ['cs-en', 'de-en', 'fi-en', 'lv-en', 'ru-en', 'tr-en', 'zh-en'] wmt18: ['cs-en', 'de-en', 'et-en', 'fi-en', 'kk-en', 'ru-en', 'tr-en', 'zh-en'] wmt19: ['cs-en', 'de-en', 'fi-en', 'gu-en', 'kk-en', 'lt-en', 'ru-en', 'zh-en', 'fr-de'] ``` Hi @sshleifer, I'm trying to add IWSLT using the link you provided but the download urls are not working. Only `[en, de]` pair is working. For others language pairs it throws a `404` error.
[ -0.3510956168, -0.4201570153, -0.055475764, 0.0014693509, -0.205213964, 0.1677959114, 0.3096145391, 0.2312009335, -0.1078789681, 0.3268693089, -0.4746789932, -0.0717085004, -0.053031113, 0.0761436149, 0.1126483828, 0.2031460553, -0.0415976867, 0.0062064081, -0.2050029933, -0.0367568508, -0.2811894417, 0.296684444, -0.1565785408, -0.1628476232, -0.3049372435, 0.1075597107, -0.3232408464, 0.1289976686, -0.0864091218, -0.2628645599, -0.071003519, 0.1811728179, -0.0486799777, 0.0939842314, -0.0001127129, -0.1136947274, 0.011659571, -0.1016760617, -0.3240741193, 0.0458123349, -0.3665429652, -0.2639518082, -0.2142891139, -0.3062395751, -0.4367866516, 0.0272238683, -0.1831999868, -0.3564965129, -0.0052962806, 0.1945137233, 0.2235886902, 0.3457290828, -0.3143996894, -0.2822667956, 0.0567386225, -0.2643663883, -0.1838620901, -0.0266634263, 0.4762518108, 0.3321310878, -0.0531216897, 0.2584947348, 0.0270023011, 0.1334303468, -0.0349093936, 0.1428127438, 0.3649306595, 0.0173947345, -0.0727358162, 0.3325250447, 0.4082351327, -0.0555604473, -0.2953056395, 0.0243600253, -0.1866714805, -0.183640942, -0.165677309, -0.0150445867, -0.069091171, 0.1800315678, -0.08244697, 0.0707490966, -0.2317939997, 0.2495975643, -0.0581960306, 0.9896838665, 0.0268572345, -0.0273062382, 0.0627435446, -0.2822174132, -0.1278498024, -0.101894483, 0.0349728763, -0.0535461716, -0.0472450033, -0.1655717194, 0.3346605897, 0.1215330437, -0.11511264, 0.0373835564, 0.0262789801, 0.0181200951, 0.3821305931, -0.1026368886, -0.3399943411, 0.1468215734, -0.1371393353, -0.3576859534, 0.0676689893, -0.0888855532, 0.0849979967, 0.1274544746, 0.0989744961, -0.2352351099, -0.5490626097, -0.027497666, -0.1431758106, -0.0249169469, -0.314584434, -0.0480165705, 0.0230619162, -0.2022249997, -0.083516255, 0.227754578, 0.074465543, -0.0106371725, 0.295471102, 0.0556019992, -0.2634868026, -0.1860878021, -0.156822294, 0.221424371, -0.1861120313, 0.0067127133, 0.3576881588, 0.5407779217, -0.0904791802, -0.0771080628, 0.2304045409, 0.3313211799, -0.2134873867, 0.088109985, 0.6882420778, 0.1761723757, -0.0530855842, 0.1961778253, -0.1271328032, 0.1290379018, -0.2528001964, 0.03500982, 0.1868710369, -0.1165914387, -0.0831105933, 0.2308926433, -0.18850182, -0.2557543218, 0.6013922095, 0.2973759472, 0.0287983809, -0.0596830472, -0.081499964, 0.0976900905, -0.3347743452, -0.0301048718, 0.180095464, 0.233352989, -0.657220304, -0.16652821, -0.2068190575, 0.2950185537, 0.3693426847, 0.1796914041, -0.045351278, 0.292435348, -0.2584976554, 0.4198895097, 0.0101493318, -0.0049060513, -0.0069704903, -0.1160336286, -0.1494865119, -0.0744257122, 0.4314529002, 0.2410667241, 0.1457804441, -0.0348598622, -0.1443376243, 0.1764110178, -0.1311488599, -0.0318324491, -0.2274166942, -0.1784519553, 0.5984969735, 0.1068544239, 0.1780118346, -0.3074265122, 0.1291627586, 0.2362656146, 0.4651767313, -0.3246691823, 0.2200805247, -0.1310894489, 0.3670406342, -0.0452759303, 0.157196328, -0.168823272, 0.0765761808, 0.1846998036, -0.1489457339, 0.6234949827, 0.1539905518, 0.3873574734, -0.0878155455, -0.0449771956, -0.3361418247, -0.1787452847, 0.2085511237, 0.3206885457, -0.1827823967, -0.3383506835, -0.0287234448, -0.039056614, -0.0480927676, -0.2065081298, -0.4026570022, 0.1354039907, -0.2129510194, -0.0521700084, 0.1030205861, 0.5125252604, 0.1033758819, -0.0699646175, -0.1244541705, 0.0962447971, -0.3203603327, 0.3039586246, 0.2060095966, 0.3942101002, 0.1310863644, -0.3835147917, 0.1998652816, 0.0237835702, 0.0238177273, -0.154952094, 0.3204903007, 0.344152689, -0.0772994682, 0.3010516167, -0.0337892994, -0.1454751492, 0.141785562, -0.1534953713, -0.1454748511, -0.3616618514, 0.3138566017, -0.0337949358, 0.0471858941, -0.1138968617, 0.3828151226, 0.4016876817, 0.3852695525, 0.1135989949, 0.1079317108, -0.0844483748, -0.0436762497, -0.0492630042, 0.2282624841, -0.2101130784, 0.2338314801, 0.3430883288, 0.2765452564, 0.01832995, -0.0082966741, -0.2246361822, 0.3973411024, 0.0774705112, -0.1221396625, 0.2896921933, -0.1076157168, -0.045697961, -0.2772289217, 0.104843162, 0.0116618387, -0.0693209544, -0.1093096435, -0.041632358, -0.3411890268, -0.2628671825, -0.2388811409, -0.334697485, -0.0919715986, -0.403073132, 0.2417892665, -0.0480082072, -0.2613847256, 0.2518021464, 0.1039009392, 0.5412727594, -0.1396015882, 0.2570073903, -0.2098886669, -0.1634469926, -0.335036844, 0.2615448534, 0.0714805201, -0.0096896142, 0.6337124705, -0.2877259552, 0.228516221, -0.0371138379, -0.4671829641, 0.1131045595, 0.0834077299, 0.0288719796, 0.2216668725, 0.0138425855, 0.201731503, -0.3470591009, 0.221379444, -0.0603056923, -0.0653208122, -0.1738293171, -0.2651664913, -0.4449756444, -0.0321837887, -0.7677304149, -0.4418916106, -0.2651732266, -0.0865016878, -0.3642120957, 0.0767291337, 0.2934865057, -0.1501423717, 0.219566375, -0.0729876459, 0.1199760139, -0.2860832214, 0.099472858, 0.3871658742, -0.2667454779, -0.2149747014, 0.1425022483, 0.0106072472, 0.3104968369, -0.1521058083, 0.001557703, 0.4561626613, 0.0843992159, 0.2617934048, 0.3264420629, 0.5436176062, 0.1978022158, 0.1510167569, -0.2413119674, -0.3730677664, -0.1842396259, 0.1567746103, 0.1619579345, 0.4169943035, 0.1445748508, 0.0645278022, 0.151170969, 0.4219458997, 0.1103282794, -0.1442941427, 0.2931167483, 0.0483065546, -0.0265366603, -0.0388945229, -0.5767920613, 0.4208676815, -0.0256163329, -0.1082329601, 0.6724066138, -0.0665038377, -0.0511073247, -0.2036521286, 0.4617721736, -0.0509657711, -0.2799991369, -0.0089731943, 0.0442186743, 0.2523648739, 0.1876970977, -0.3371655345, -0.3310943544, -0.3479613662, 0.1593682021, 0.0800978914, -0.224238947, -0.0849361941, 0.0612808168, -0.071092017, -0.4463780224, 0.2790631354, 0.3362532258, 0.342972815, -0.2130682319, -0.1520628035, -0.0080820071, 0.1516466588, 0.2631422877, -0.3619675934, 0.038728103, 0.193598032, -0.0585501902, -0.0356012136, -0.0033467731, -0.4417618215, 0.0097290166, 0.5186337829, -0.051732216, -0.1301387101, -0.0895860195, 0.1040929556, 0.279353857, -0.2680602074, -0.1181623638, 0.0353959017, -0.0534728803, -0.0841065571, -0.0106596146, 0.0163346492, 0.2835980654, 0.0665001348, 0.1180794612, 0.202633217, -0.2388777733, 0.2810305655, 0.0962100103, -0.0650154576, 0.3816203475, -0.0399198644, 0.065570116, 0.3526308835, 0.0206246227, 0.2904704809, -0.3022008538, 0.0148080159, 0.1298610866, -0.3256891668, 0.3235580623, 0.5054847002, -0.0188409183, 0.0247141346, 0.1384243965, -0.0317914635, -0.2004710138, 0.2371167094, -0.1519354284, 0.2129077464, -0.0947298035, 0.1840763539, 0.0550778359, -0.1166443378, -0.1040550321, 0.1748669446, 0.1363048553, -0.4941787124, -0.0732409284, 0.2296173871, 0.9664265513, 0.1904886514, 0.1384125799, 0.2758409083, -0.0335018337, -0.0657844692, 0.0482108258, 0.0508118756, -0.1869105548, 0.1847469807, -0.0306971241, 0.0752528906, -0.0217726678, 0.4314564168, -0.0369337536, 0.1354799569, 0.515627563, 0.1383626461, 0.2337651849, 0.2205381095, 0.2501478493, -0.4087948501, -0.0756473318, 0.17379646, -0.0941093042, -0.0286716968, -0.1461781114, -0.1536183804, 0.0346107483, -0.0042650774, -0.2722616792, 0.0789711326, -0.5890010595, 0.2749346197, -0.4028263688, -0.1198010072, 0.174723193, -0.3142211437, 0.3008860946, 0.0565461405, -0.226976797, -0.0626105592, -0.155457601, 0.0963049904, -0.2385853976, 0.0207431801, 0.292378217, -0.3063318431, -0.1959641129, -0.1612963378, 0.1649284661, -0.2451205105, 0.0903509706, 0.0248100329, 0.3714931905, -0.0985413715, 0.1155399308, 0.3394881189, -0.0872314051, -0.2886784077, 0.1070466861, -0.0192581955, -0.5331575871, 0.3946988881, -0.0765469074, -0.0747833326, -0.1277844459, 0.2739505172, 0.0700788051, 0.1094872132, 0.2058130801, 0.4449133575, -0.2676797211, -0.2178167403, 0.0435208157, 0.2048491538, -0.2141148299, 0.0088802725, 0.3181267083, -0.2386742085, -0.0540530644, 0.6365107298, 0.406829983, 0.1738207042, -0.1967403293, -0.1519630104, -0.1225921661, 0.1349277943, 0.0622539781, 0.4929791987, -0.0479076318, 0.2813068032, -0.0494196378, -0.1467209309, -0.3966433704, -0.1032468453, 0.0390233807, 0.1037642732, -0.0148995752, -0.2560126781, -0.0667770356, 0.2031359076, 0.0904707834, -0.1550722569, -0.2829787135, -0.2200039029, -0.2144644707, 0.0886422768, 0.1174130589, -0.2440494746, 0.1041123196, -0.0271592047, 0.0535266958, -0.1022973731, 0.141394645, -0.12613675, -0.1579965055, 0.2246875614, 0.3801623583, -0.512062192, -0.1245449781, 0.0705393851, 0.334487468, -0.0049784486, 0.1500239521, 0.2852226794, 0.1169426665, -0.164213106, 0.383592248, 0.1137949824, 0.1523496211, -0.0438060611, 0.1136316881, -0.1248557568, -0.171181649, 0.2598098516, 0.3023607433, 0.0808530673, 0.0230444148, -0.4058655798, -0.0352057852, 0.2159337848, -0.4422447681, -0.0763634592, -0.0454622097, -0.0431356207, 0.2890427709, 0.2946325541, 0.383394599, -0.0936122835, 0.2146471143, 0.0091504576, -0.2317996323, -0.1063121408, -0.0498085469, 0.1242770031, -0.127380535, 0.2068744153, 0.0705612227, -0.2522336543, -0.0125625897, 0.0357786864, -0.0393281281, 0.9443348646, 0.0554243922, 0.1277290434, 0.2607842386, -0.1525977105, 0.1444083154, -0.4156578481, 0.0907362178, 0.2228735536, 0.0885285437, 0.165900901, 0.105140008, -0.3098654449, -0.1888137013, 0.3234909475, -0.3527393043, -0.1041435301, 0.0336168073, -0.2721531689, -0.2560220659, -0.1753171533, -0.048517473, 0.0755499303, 0.3166669011, 0.0322545096, 0.1280555725, -0.1600307077, -0.1547186524, -0.1163783595, 0.009621487, -0.2166686505, 0.2953332663, 0.3576920331, -0.2117866129, -0.0517918281, 0.3719339669, 0.115651615, 0.027774265, -0.050783854, 0.1282893866, -0.2201647907, -0.1960469633, -0.1785312295, 0.3015794158, 0.0281734839, -0.2969713509, 0.2875294685, 0.0589092113, -0.1092374548, -0.1599851996, 0.1798596233, -0.4980973005, -0.0589875653, 0.0835052207, 0.0308132991, -0.1172931939, -0.1961734444, 0.2696996331, -0.2349767089, 0.0529691465, 0.2362527102, -0.439624846, 0.0057424782, 0.026364496, 0.0801034197, -0.0749601722, 0.7365743518, 0.0980664641, -0.1362929791, -0.3667145073, -0.2292542756, -0.4123724103, -0.116325967, 0.1767961681, 0.3161047399, -0.3612352312, 0.0795735195, 0.2017932981, -0.032930132, 0.2464618534, 0.1410081536, -0.057346113, 0.095329538, -0.4217141867, -0.0286550391, 0.2718576193, 0.2104885429, -0.0182137135, 0.0703181326, -0.0346258432, -0.0834255666, 0.0849487931, -0.1449536383, -0.2116882801, 0.2417706698, 0.2613488734, -0.0441509373, 0.2784499526, 0.4927445948, -0.3866876662, -0.0587784611, -0.2552832961, -0.2277171612, 0.0211430881, 0.2991323173, 0.0188774783, 0.3166450262, 0.0603141151, -0.1228146777, -0.0644248575, -0.323299557, 0.0511763617, -0.0216292385, -0.2860192657, 0.2448616326, -0.2956739664, 0.3996625245, 0.1211718395, 0.4754554033, -0.0391978063, 0.255738914, -0.2701255977, -0.4410146177, 0.3719324172, 0.0036642195, -0.3797161579, -0.309581846, 0.2952939272, -0.102962777, 0.2130258828, -0.4063838124, -0.3061916232, 0.2061429471, 0.0328863934, 0.0601147749, 0.5993669033, 0.3119819164, -0.0803836659, -0.0860493332, -0.1394551694, 0.4770438373, -0.2324856967, -0.2941693664, -0.2447912395 ]
https://github.com/huggingface/datasets/issues/436
Google Colab - load_dataset - PyArrow exception
+1! this is the reason our tests are failing at [TextAttack](https://github.com/QData/TextAttack) (Though it's worth noting if we fixed the version number of pyarrow to 0.16.0 that would fix our problem too. But in this case we'll just wait for you all to update)
With latest PyArrow 1.0.0 installed, I get the following exception . Restarting colab has the same issue ImportWarning: To use `nlp`, the module `pyarrow>=0.16.0` is required, and the current version of `pyarrow` doesn't match this condition. If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`. The error goes only when I install version 0.16.0 i.e. !pip install pyarrow==0.16.0
43
Google Colab - load_dataset - PyArrow exception With latest PyArrow 1.0.0 installed, I get the following exception . Restarting colab has the same issue ImportWarning: To use `nlp`, the module `pyarrow>=0.16.0` is required, and the current version of `pyarrow` doesn't match this condition. If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`. The error goes only when I install version 0.16.0 i.e. !pip install pyarrow==0.16.0 +1! this is the reason our tests are failing at [TextAttack](https://github.com/QData/TextAttack) (Though it's worth noting if we fixed the version number of pyarrow to 0.16.0 that would fix our problem too. But in this case we'll just wait for you all to update)
[ -0.362981081, 0.2522224188, 0.029283002, 0.0668663755, -0.0656064674, -0.3179531991, 0.3687327504, 0.1455650479, -0.137786448, 0.1537565291, -0.0934413746, 0.422970593, -0.1183704287, 0.0239223447, 0.1916112453, -0.0460922085, 0.0454056747, 0.3213038743, -0.1009333208, 0.2128736675, -0.1327810884, 0.3483657241, -0.5873016715, 0.2542974949, -0.2375741303, -0.0698927864, -0.0117017897, -0.0221685655, -0.1265801042, -0.7411339283, 0.3176329434, -0.0789566264, 0.076413326, 0.3993421793, -0.0001173493, 0.0144254453, 0.4822441936, 0.0728604048, -0.2069345266, -0.3872156143, 0.03867542, -0.2277510613, 0.3138642609, 0.0373716205, 0.0358880237, 0.1512118727, 0.2212146819, 0.4453003407, 0.3842618465, 0.4977120757, 0.1408519894, 0.146323815, 0.2370874435, 0.0650932044, 0.5099895, -0.281086117, -0.1513428539, 0.4955286384, 0.3179703355, -0.1587514281, -0.0368674174, 0.1034918502, -0.1534601003, 0.0865595862, 0.0030837536, 0.1041213796, -0.2000458241, -0.1258923113, -0.0360219218, 0.2756788731, 0.3768592477, -0.4508687556, -0.2491981089, -0.0131759811, 0.1185372919, -0.6331676245, 0.2870849073, 0.1160993353, -0.299582988, 0.2648497522, -0.1115238741, 0.0107539417, -0.1450328231, 0.1135523692, -0.0236420892, 0.6451186538, 0.0126206083, 0.128613323, 0.1633942425, -0.0405532531, 0.4524588287, 0.195284009, -0.0274377614, 0.1291083694, -0.0782349259, 0.0992478877, -0.1888788342, 0.0984959677, 0.1803098768, -0.1165360138, 0.0249171536, 0.0484945104, -0.0032617091, 0.3548351824, -0.0418047234, 0.1982092708, 0.1764469296, -0.0754627287, 0.400011003, 0.2195629627, -0.1564376652, 0.1064230427, 0.0805542096, -0.3143376112, 0.0116778398, -0.0923804417, 0.2431231737, -0.334220767, -0.4480618536, -0.2376205325, -0.5925034285, -0.0588283874, -0.005786058, 0.3084498644, -0.1026287302, -0.2543332279, 0.0440538526, 0.3627561927, -0.3065456748, -0.1034829393, -0.0444492921, 0.1358829439, -0.1913897097, 0.0998172164, 0.3135400116, -0.1987224966, 0.2418409437, 0.0600403845, -0.0656105801, 0.111726135, -0.1427793503, -0.1940476596, -0.0809839666, 0.2763285935, 0.129120186, -0.1630798727, -0.1771035194, -0.4345961213, -0.1928695589, 0.3411625922, -0.1402746886, -0.2219146639, 0.0338346548, 0.1234435886, -0.3155338466, -0.2954390645, -0.2915062606, 0.2421061248, -0.1154171899, -0.3325149119, 0.005154917, -0.338324815, -0.2549368143, -0.0052290484, 0.1019863784, 0.3170404434, -0.3384146094, -0.0378378294, -0.0716532394, -0.1312974691, 0.1759168804, 0.119530417, -0.1356283277, 0.0528885983, -0.0810476169, 0.3707366884, 0.1033158451, -0.0800417438, -0.3151875436, -0.1095571816, -0.0785586312, -0.1270703077, -0.0561671443, -0.2193423957, -0.2982595563, -0.0450607464, 0.2091314495, 0.2197276503, 0.0764504969, 0.0485544465, -0.3125258386, -0.2832559943, 0.2770355642, 0.136628896, 0.0436746292, -0.237675041, -0.0044843871, -0.3707579672, 0.0189564899, -0.172255829, -0.251460135, -0.0375156775, 0.3037079871, -0.2670267522, -0.0709288716, -0.0049369419, -0.2513350248, 0.0999909788, -0.1986757666, 0.3306254148, -0.2112035304, -0.1016848981, -0.3360032439, 0.2426897287, 0.1568356752, -0.0757179782, 0.053742867, 0.0139938667, 0.1294902265, 0.4455620646, -0.0342874415, 0.1879515499, -0.0059920531, 0.1484076828, 0.2585424483, 0.1822600216, -0.3008646667, -0.5154076219, 0.2087286413, 0.1776777208, 0.0894745067, 0.0034555083, -0.0724014714, 0.1765436083, -0.0092753889, 0.0763940141, -0.2671251595, -0.284668088, 0.1067421883, -0.4681558013, -0.0044741044, 0.0258457344, -0.0397187434, 0.0368183404, 0.3439413607, 0.1939013898, 0.0860985667, -0.0027804067, 0.1075398847, -0.0836932063, 0.1214534417, -0.102541104, 0.1862476319, 0.1555067301, 0.1888845712, 0.180446133, 0.3516589701, -0.0817366838, -0.1929059774, 0.0209463686, 0.50047189, -0.010415636, 0.3968642354, 0.2594715059, -0.139199391, -0.2249692529, 0.1984295845, -0.2625115216, 0.3533535898, 0.1530499756, -0.0697850138, 0.3267529309, -0.2691051066, -0.3553438187, 0.1939436048, 0.0401573814, 0.2229404002, -0.0164991617, 0.3850227296, -0.0000719145, -0.4463834465, -0.215868488, -0.0241146777, 0.2902514637, -0.195781976, 0.2333465964, -0.278898865, -0.4786581397, -0.3216553628, -0.3746158779, -0.2644886672, -0.1139182597, 0.1861757636, 0.0875780582, 0.0209139436, 0.2171658278, 0.306568712, 0.2534184158, -0.2405570745, -0.2795979977, -0.2933274806, -0.2630260289, -0.6036443114, 0.0401454642, 0.3904752731, 0.1700225472, 0.1620037854, -0.1685166955, -0.0609381236, 0.4120287895, -0.5072562099, 0.0628775582, -0.1883172393, 0.3759168684, 0.0254063811, -0.1615850478, -0.4956680536, -0.4668340981, 0.0776247606, -0.3616188169, -0.2719079256, 0.0947324187, -0.0823629424, -0.0533251315, -0.2126678675, -0.4288897812, -0.4334757328, -0.1762182713, 0.2912444174, 0.1114312261, 0.0875864178, 0.432145834, 0.1826330125, 0.3838967383, -0.0788136944, -0.0156475361, 0.056873817, 0.1579795629, 0.1709012687, -0.1130352542, -0.2863184512, 0.0840016678, -0.0555577539, 0.1250374615, -0.1318467706, -0.5317520499, -0.281596899, -0.0561029278, 0.1225522757, 0.253872931, 0.0234749522, 0.3396732807, 0.0629492998, -0.031977877, 0.073218599, -0.4039272666, 0.0338626839, -0.0514899977, -0.0284922924, 0.0802507102, 0.1063991934, -0.0677921101, 0.7185683846, -0.1301940829, -0.1091860235, 0.3972302377, -0.1039801836, 0.1648679972, -0.236056, -0.0234852489, 0.1025645584, -0.0177808125, -0.1606338024, 0.274905473, -0.162276879, -0.4740836024, -0.1905347705, -0.1989639103, -0.2541111708, -0.2911299765, 0.1263342798, 0.3540948629, 0.0426923409, 0.0501412973, -0.1241016462, 0.1096645817, -0.3338996172, -0.0762938038, -0.0461397804, -0.1030332223, -0.0380761288, 0.0496417545, -0.465598315, -0.4565824866, 0.3200001121, 0.4237253368, 0.2264303416, -0.0685276985, 0.0034591618, -0.0761090294, -0.2204845399, -0.0725473836, 0.0178989731, -0.0144483708, 0.3299286962, 0.129198283, -0.0789634511, -0.172733441, -0.3289533854, -0.0892147273, 0.304703027, -0.0836105347, -0.3240819573, 0.153742522, 0.4683856368, 0.3481387794, 0.2129238099, 0.1987856179, -0.3215833604, -0.3988631964, -0.1383433193, 0.2397522628, 0.0547616035, 0.3466662169, -0.175749734, 0.2279437631, 0.0948214903, -0.1361166984, 0.0270532314, 0.4200959504, -0.0073743309, -0.0413124822, -0.0127855409, -0.1898572594, -0.4006468654, 0.1230428815, 0.6168134212, 0.1352258623, -0.2412732393, -0.2904061973, 0.1564191133, 0.4171554446, 0.1968604177, -0.0951198936, 0.0853087157, -0.2908747196, -0.1272573918, 0.1797148883, 0.0900783986, 0.1424270719, 0.1347002387, -0.0143322265, 0.1334297508, 0.6629951596, 0.060598243, -0.0195607506, 0.1840838045, -0.0039890292, -0.3596172631, 0.4945671856, -0.0165606178, 0.9023057222, 0.0052777203, 0.1025134474, 0.5774898529, -0.0107108578, 0.3412153721, 0.0877748579, 0.2345594466, -0.4027550817, -0.0981081501, 0.0909470618, -0.1632785052, 0.1461850256, -0.1311169565, -0.5301916003, 0.2345526069, 0.3508249819, 0.0767905563, 0.3780787289, 0.1693216264, -0.1686769277, -0.0086119352, -0.4974404573, 0.0724885091, -0.0794618279, 0.1858569086, -0.2010642886, 0.0256025083, 0.012618226, -0.2772425115, -0.4413924515, 0.3447720408, -0.4248201549, -0.1189625785, 0.4366096556, -0.234528929, 0.2927361727, 0.1134288758, 0.2366978228, 0.1430515647, -0.1989371181, 0.2038394809, -0.179008022, -0.2164799571, 0.1933831871, 0.1081498861, 0.2353773713, -0.1960168928, -0.2463549823, 0.1433787644, 0.0282350685, -0.2993826568, 0.2750103176, 0.0317361318, -0.0479602218, -0.0497145802, 0.0818245783, 0.129148528, 0.1013897806, -0.1726247817, 0.0994525105, -0.0143508613, -0.0968639329, 0.1849936992, 0.0256234631, -0.2739040256, -0.0856634974, 0.3191242814, -0.1160253063, 0.1227004603, 0.6109801531, 0.3582259119, -0.0135364654, -0.143974781, -0.1954407692, -0.1976331025, -0.3472590446, 0.1349242032, -0.0893483832, -0.082955353, 0.2065327317, 0.6358377934, 0.0321332403, 0.0342596769, 0.032236211, -0.4378577173, -0.1001104414, 0.2935985625, 0.3192723691, 0.0036184669, 0.3327150047, 0.2987148166, 0.2375249863, -0.0031665757, -0.2429557443, 0.1284068525, -0.2802470028, 0.1713703871, -0.2991988659, -0.1453396231, 0.2783920765, 0.0976637527, 0.0292561948, 0.2056999207, -0.0773142427, -0.2213221937, -0.1646215469, 0.1092193276, 0.1179897338, -0.2578454316, -0.0989031494, -0.0665438846, 0.2309482247, 0.0404100344, 0.0834897384, -0.1175382733, -0.222459048, 0.2460854352, 0.0818293393, 0.3629995883, -0.172877714, -0.0356270559, -0.4094321728, 0.3783411086, 0.2551010847, 0.227832064, 0.1126708761, -0.0049373652, 0.198279947, -0.0532479696, -0.1598258764, 0.0588529259, 0.0549329482, -0.4088422954, -0.0978533253, -0.3386642635, 0.16938214, 0.3265038133, -0.1732737124, -0.1791541874, 0.4539532959, 0.1184347197, -0.4062665999, -0.004290258, 0.1541661471, 0.1295664907, -0.0078926133, 0.2604047358, 0.2204560041, -0.1430952102, 0.0729007423, 0.2042340636, 0.2934798002, 0.0710896403, -0.1808235496, 0.2278169394, -0.2106998116, 0.0991224945, 0.1873728037, 0.0473177172, 0.4222981036, 0.1560614109, -0.2856242657, 0.2094256133, -0.274192661, 0.2412855476, 0.1257188469, -0.1985055506, 0.096461989, 0.4508844316, 0.2907313108, -0.101161927, 0.21075131, 0.5228332281, -0.1316388994, 0.0980874076, -0.1857363731, 0.2679850757, -0.0171090625, -0.1236457005, -0.0688002557, 0.0355307572, -0.1854601204, 0.1501879692, -0.1470807344, -0.0095155416, 0.3960520327, 0.2103191912, -0.2445911765, -0.0783882514, 0.014614, 0.1155375391, 0.0676934719, -0.1753291488, 0.3981391191, 0.0947020873, -0.1871604621, -0.0908765346, 0.6913029552, 0.5602605939, 0.1460423172, -0.3398175538, -0.1216660589, -0.3152952492, 0.0107181203, -0.1049773544, 0.2884891331, 0.3598894477, 0.4698311985, 0.250515312, 0.0743762553, -0.0902577788, 0.3026507497, 0.164470464, -0.1791977733, -0.0782846436, 0.031125946, 0.1242984533, -0.1412471831, -0.3082650602, 0.0276747756, -0.1040880084, 0.382843703, 0.1828324944, -0.0276298467, -0.0220519435, -0.1087614447, 0.0421988405, 0.2338197976, 0.5969295502, 0.4660426676, 0.5083937645, -0.3644015789, -0.1765922904, -0.5498260856, 0.1105111614, -0.3375612497, -0.0191145539, 0.0430707745, -0.1309382617, -0.1224303544, 0.3655654192, -0.2373733222, 0.4322907329, -0.3409906924, -0.1812255979, -0.4165716767, 0.0285936575, 0.0152046885, -0.2957242727, -0.1329242587, -0.2455765903, 0.2400433123, -0.6261115074, -0.0680846125, -0.1121464074, -0.2224590033, 0.1780540645, 0.1108795926, 0.4410931766, 0.1155423149, 0.5288134813, 0.0060330657, 0.099159345, -0.115632534, -0.3268687129, -0.1695924699, 0.1565984637, 0.0898525864, 0.1825834513, 0.002996325, 0.2266043723, -0.0841834322, 0.5815635324, -0.0408004858, 0.242108345, 0.2631014287, 0.0312381256, -0.0804890394, -0.0827913657, -0.0333434977, 0.200012967, -0.0544322506, -0.1092601046, -0.5326638818, -0.4132598042, 0.3147662282, -0.515057981, -0.0720607266, -0.2050055712, 0.0867945701, 0.2675556242, -0.3100771606, -0.6111453176, 0.050303366, 0.2234051824, 0.0954610258, -0.4149086177, 0.1335824579, 0.2899446189, 0.0462745465, -0.0948521569, 0.430321008, 0.0408822969, -0.0606980212, -0.2343920171, -0.2921998203 ]
https://github.com/huggingface/datasets/issues/436
Google Colab - load_dataset - PyArrow exception
Came to raise this issue, great to see other already have and it's being fixed so soon! As an aside, since no one wrote this already, it seems like the version check only looks at the second part of the version number making sure it is >16, but pyarrow newest version is 1.0.0 so the second past is 0!
With latest PyArrow 1.0.0 installed, I get the following exception . Restarting colab has the same issue ImportWarning: To use `nlp`, the module `pyarrow>=0.16.0` is required, and the current version of `pyarrow` doesn't match this condition. If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`. The error goes only when I install version 0.16.0 i.e. !pip install pyarrow==0.16.0
59
Google Colab - load_dataset - PyArrow exception With latest PyArrow 1.0.0 installed, I get the following exception . Restarting colab has the same issue ImportWarning: To use `nlp`, the module `pyarrow>=0.16.0` is required, and the current version of `pyarrow` doesn't match this condition. If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`. The error goes only when I install version 0.16.0 i.e. !pip install pyarrow==0.16.0 Came to raise this issue, great to see other already have and it's being fixed so soon! As an aside, since no one wrote this already, it seems like the version check only looks at the second part of the version number making sure it is >16, but pyarrow newest version is 1.0.0 so the second past is 0!
[ -0.35635975, 0.2692832351, 0.0403541178, 0.0255091041, -0.1082256362, -0.2124163806, 0.169840619, 0.2209275812, -0.1462262273, 0.1146728396, 0.0956546515, 0.558781743, -0.2984773815, 0.0380703136, 0.0623068325, -0.0809184462, 0.1304244846, 0.385869056, 0.0610736534, 0.1696226895, -0.2576373518, 0.3070939779, -0.4419915676, 0.2494819164, -0.2984102666, 0.0139224436, 0.0193616692, 0.0773461014, -0.3677999079, -0.6848933101, 0.463711977, -0.1372095495, 0.2255124003, 0.3252450228, -0.000117499, -0.0126846246, 0.4980807602, 0.109035179, -0.194844529, -0.4525273144, 0.0962287039, -0.4826616943, 0.387571007, 0.00974946, 0.0457869172, -0.0264523253, 0.3028814495, 0.6757783294, 0.2657586932, 0.2176845372, 0.1667813659, 0.2213873714, 0.4098852873, 0.0257348269, 0.4948374033, -0.2362095863, -0.1034500599, 0.7628587484, 0.2007294297, -0.3635475338, 0.0591912456, 0.1609631628, -0.2842777073, 0.0079970201, 0.0868150145, -0.0093613584, -0.0282803141, -0.280356437, -0.070424147, 0.2334548384, 0.2786680758, -0.3727607727, -0.2139852345, -0.0369419493, 0.1685260832, -0.5201521516, 0.2031878084, 0.2061317712, -0.2479263246, 0.2166701257, 0.0423115604, -0.0363258272, -0.1677532196, 0.1888072491, -0.1594610661, 0.7550780773, 0.0910480767, 0.1258874983, 0.2515867651, -0.059555389, 0.564676702, 0.261005193, -0.0171778593, 0.1957463175, -0.0181444846, 0.0440119281, 0.0082145473, 0.5163201094, 0.029362468, -0.3448950648, 0.0096515818, -0.0534600392, 0.1265423298, 0.4474960268, 0.0249657687, -0.0634337962, 0.0032088656, -0.1259060949, 0.3919044435, 0.0218873527, 0.1578953713, 0.1030365303, 0.0269261301, -0.3716893196, -0.0051645068, -0.0394147187, 0.3415206075, -0.2093356997, -0.302834332, -0.256716758, -0.5051159263, -0.008798412, 0.0819452479, 0.1959880441, -0.1884275526, -0.0456598997, -0.0135041587, 0.1332431138, -0.2568024695, -0.1132040992, -0.0069236187, 0.1749411374, -0.2337507904, 0.0082894592, 0.2488785535, -0.1568793505, 0.2385911494, 0.1839188635, -0.1583382189, 0.1740048081, -0.0879793018, -0.1543873101, -0.1690748036, 0.3463724852, 0.0948098227, -0.0689555258, -0.1549710184, -0.4418062866, -0.276537627, 0.3989021182, -0.2178520113, -0.377951324, -0.2776355147, 0.1390900314, -0.414224267, -0.1977524757, -0.2286475301, 0.1975181252, -0.0626466125, -0.51854074, -0.1106969565, -0.4185704291, -0.2588011026, -0.2167459875, -0.0355003178, 0.2313153893, -0.421317488, -0.0013214869, -0.2052947879, -0.1577326506, 0.2029191256, 0.1241730303, -0.2396297753, 0.0035146785, -0.0710431412, 0.2006301731, 0.3293650746, -0.1011557132, -0.3482892215, 0.0037730981, -0.1243554428, -0.0796838477, -0.050357718, -0.0146262385, -0.2075433582, -0.1026687771, 0.1115062237, 0.219184041, -0.062892206, 0.0518533923, -0.3201494813, -0.2822305262, 0.2409398109, 0.1795419902, 0.0290732346, -0.132224679, 0.1251464337, -0.0511678308, 0.150690794, -0.1088013798, -0.1956819296, -0.0068311389, 0.3765250146, -0.1861535907, -0.1213010475, -0.0252114963, -0.424626112, 0.1397028267, -0.2081701159, 0.2105349451, -0.1813573837, -0.1387982517, -0.1585409641, 0.2024339586, 0.0917204171, 0.0864928812, 0.0574881621, -0.0538416468, 0.1482988298, 0.2236871719, 0.0374073833, 0.0488238409, 0.0423657075, 0.1162124053, -0.007512087, 0.2853105962, -0.3939154446, -0.5148022771, 0.1104201674, 0.1565468311, 0.144673124, 0.0030891129, 0.0473884232, 0.0985334888, 0.0302922353, 0.1519057453, -0.4095865488, -0.1629499048, 0.1721083671, -0.4360498488, 0.0903435349, -0.0005211715, -0.0892999247, 0.1381735653, 0.3890039027, 0.2938118875, 0.1787321419, -0.0771887228, -0.0478578508, 0.0068732095, 0.0108244773, -0.0219764858, 0.0616078153, 0.0079059787, 0.1270698011, 0.3067645431, 0.116550386, 0.0130091151, -0.3182850778, 0.1458010674, 0.4736979008, 0.0787651539, 0.1612203568, 0.1202905476, -0.0150473714, -0.2019605339, 0.2824193239, -0.2004909962, 0.2364269644, 0.2488379925, -0.0791957676, 0.2862410247, -0.347499758, -0.246396482, 0.0662199408, 0.0795553476, 0.2478338629, 0.0545605607, 0.2800651193, 0.0440858975, -0.3395347595, -0.0405010395, -0.0013773738, 0.3130808771, -0.1538747847, 0.2280434221, -0.3657150865, -0.5152047873, -0.2934383154, -0.3485785127, -0.4190296531, -0.0455739684, 0.0744506121, 0.3852238953, 0.0903390646, 0.2260419279, 0.3749236763, 0.0267464202, -0.2834902704, -0.2804324925, -0.1622312367, -0.3187164366, -0.5653553009, 0.0051586679, 0.2741719186, 0.1464022696, 0.1834052056, -0.1747497469, -0.0374333598, 0.1914407611, -0.6024132967, 0.0411878042, -0.2708109319, 0.3899644017, 0.1654328704, -0.075617373, -0.4261090457, -0.3029899597, 0.0499663688, -0.2672175467, -0.231103003, -0.0775557086, -0.3112012446, 0.1056582853, -0.2025437951, -0.0183188729, -0.5836760998, -0.2559038699, 0.0728110746, 0.0824737698, 0.1966980547, 0.3112361431, 0.2778769433, 0.2048360705, 0.0999179706, -0.1780399978, 0.0744474605, 0.0728749856, 0.2003841251, -0.1788433939, -0.241031006, 0.217235148, -0.1202079356, 0.0211117361, -0.0540611483, -0.4464505017, -0.4577821493, 0.0401117466, 0.3177599311, 0.1763347983, -0.0380548872, 0.4169326723, 0.0920340046, 0.0213223025, 0.0110070026, -0.4104075432, -0.2225301564, 0.030743422, 0.195092693, 0.1226698756, 0.2151464522, -0.0781217963, 0.6302809119, -0.2324966043, -0.1335866898, 0.410828352, -0.1130620092, 0.2641093135, -0.0445306301, -0.0441886485, 0.0038073396, 0.0769341439, -0.076254636, 0.2126751542, -0.1427688301, -0.538187027, -0.2042011321, -0.2447573543, -0.215671435, -0.1774831861, 0.0836954415, 0.4492427707, 0.1635317802, 0.1125487685, -0.1237434149, 0.0148289148, -0.3518208265, -0.1838132888, 0.0659227595, -0.10471192, 0.0882327333, 0.3130836487, -0.5570732355, -0.3975994289, 0.3536088765, 0.426061511, 0.0035990593, 0.0674593374, -0.0581375957, 0.0563076474, -0.1231956109, 0.0949188098, -0.0509750843, -0.0039709313, 0.2375793457, 0.1718689799, -0.2469354123, -0.1955093592, -0.1156433001, 0.0992513373, 0.2949612141, -0.0017339677, -0.2660155296, 0.0775736123, 0.5640846491, 0.4030724764, 0.086518079, 0.0418522581, -0.450818181, -0.4398841858, 0.0007967941, 0.0757178441, -0.0469192117, 0.2802648246, -0.1493749619, 0.1977665275, 0.1838615537, -0.132486701, -0.11312069, 0.4778265357, 0.0720000044, 0.0505934693, -0.0745618641, -0.1453445852, -0.2305832356, 0.3679275811, 0.493519038, 0.1361132562, -0.054500185, -0.1077050045, 0.3420844972, 0.2212442756, 0.1268021166, -0.0517874993, 0.0296377465, -0.1030544937, -0.2111227214, 0.2338951826, -0.0035013852, 0.089707762, -0.0347040556, -0.2627057135, 0.1297744066, 0.6660520434, 0.2021788657, -0.0882267058, 0.0257417802, -0.0114511633, -0.1990586966, 0.3481170237, 0.0743565261, 0.8326455355, -0.0258946344, 0.0767492875, 0.6967657208, -0.1195190325, 0.6577320099, 0.2338549048, 0.3234877586, -0.3517782986, 0.0525327474, 0.0392551608, -0.0763086751, 0.1141753569, -0.1606548131, -0.4357737899, 0.2853178978, 0.2705796659, 0.0429764092, 0.3506115675, 0.1500795186, -0.0647962764, 0.0263773147, -0.3548263013, 0.0793815628, -0.1717133373, 0.2368307561, -0.3579494059, -0.098994486, 0.0726471841, -0.3737097681, -0.4061585069, 0.1980189383, -0.3119513392, -0.0859906897, 0.2118488401, -0.4263007343, 0.0714572966, 0.0048072501, -0.0199052542, 0.0301704668, -0.1736847013, 0.2135379463, 0.0277874507, -0.2682162821, -0.0950965807, 0.1593033224, 0.1995506734, -0.1809953302, -0.1806913912, 0.114197582, -0.0766465813, -0.1602272242, 0.1103008166, 0.2179475278, -0.1576021463, 0.2590271235, 0.0707156956, 0.0208600704, 0.2043579221, -0.1548303962, 0.1161689162, -0.0316251703, 0.0968474001, 0.1447458863, -0.1322199702, -0.2569981813, -0.1296865493, 0.2917927802, 0.0648806021, 0.1338760406, 0.417850554, 0.2300008684, -0.0808646902, -0.0924582034, -0.1907212734, -0.2852123976, -0.3821772039, 0.0474344119, 0.1602158099, 0.1208625659, 0.2363417149, 0.4325951338, 0.1759970337, 0.034969341, -0.0027748996, -0.3610959947, -0.1583455354, 0.3478938937, 0.1118845865, -0.0918345675, 0.2412365377, 0.4302345216, 0.2563734949, -0.2707999647, -0.2438819855, 0.2088712007, -0.0774835199, 0.199598074, -0.1697113067, -0.0384778753, 0.0325777158, 0.0321035162, 0.03912884, 0.103498131, -0.0770383552, -0.1986406446, -0.1042042151, 0.1216510534, 0.1287730038, -0.2363008857, -0.111776568, -0.101182647, 0.0765412003, 0.1567934304, 0.071591787, 0.003139755, -0.1735083461, 0.1497433186, 0.1444462389, 0.2842686772, 0.0129265403, 0.1131562144, -0.2149541229, 0.4630053639, 0.2806183696, 0.3607986271, 0.1898020208, 0.0785509273, 0.2958897948, -0.1503780484, -0.2741988301, -0.1127206162, 0.0156948846, -0.3167329133, -0.0584831648, -0.3318291605, 0.2149786949, 0.3215718567, -0.0776573792, -0.187449351, 0.5202893019, 0.1215228215, -0.4359511733, 0.0913804322, 0.1915855259, 0.1452506781, -0.0492453203, 0.2615137696, 0.231193006, -0.0020171539, 0.213494733, 0.2170175761, 0.2639147639, 0.2480229884, -0.0180774294, 0.2537198067, -0.1021508574, 0.1275250763, 0.213323459, 0.1908533573, 0.3731147647, 0.0213818382, -0.2727660835, 0.1267825216, -0.2584777176, 0.0701356232, 0.0152739817, -0.4455841184, -0.061262615, 0.329721272, 0.2798147798, -0.2126591057, 0.2182134986, 0.3516297042, -0.0680859908, -0.0510079041, -0.1703101993, 0.3314246535, -0.1020057127, -0.0153343622, -0.0075722891, 0.0484618321, -0.1511903107, 0.2374207228, -0.0631152838, -0.0850851685, 0.1830563992, 0.2144215554, -0.292942524, -0.1625158489, 0.0525898039, 0.2145334035, -0.0869382545, -0.0650167316, 0.3325574398, -0.1309386641, -0.3034469485, -0.2252882123, 0.4857277274, 0.5330041647, 0.3011165857, -0.26129058, -0.2222591043, -0.2724910676, 0.0934621543, -0.1609719098, 0.0910237655, 0.4010380208, 0.4848849475, 0.2285536677, 0.0634375736, -0.1281145066, 0.3109256923, 0.1588609219, -0.0454523973, -0.087286599, 0.0489244163, 0.087937355, -0.0846334025, -0.1388155669, 0.1435380578, -0.2690295279, 0.4802118838, 0.1894147843, 0.2815271318, -0.0888152122, -0.1190421358, 0.033463683, 0.1205504835, 0.5594962239, 0.4931656718, 0.5704360008, -0.1983356476, -0.2719709575, -0.6176347733, 0.1832294762, -0.5359069705, 0.2179706246, 0.0753013119, -0.0515667349, -0.2211534083, 0.3695656061, -0.2084880918, 0.1653891057, -0.1704198867, -0.191879198, -0.2623124421, -0.0385396853, 0.0660195798, -0.3587388992, -0.0989602059, -0.277178973, 0.1449615806, -0.760283947, -0.0124443434, -0.3348179162, -0.2329119742, 0.0799497664, 0.1844253391, 0.5588231087, 0.1272922158, 0.4683965445, 0.139747709, 0.0165384728, -0.2916194201, -0.2619527578, -0.3168055415, 0.2344325632, 0.0930425897, 0.2211834192, -0.1172398254, 0.1349561661, -0.2433463484, 0.4795068204, -0.1296810508, 0.1860695183, 0.26577425, 0.0335794576, -0.1438552886, -0.0505994968, -0.2359082401, 0.0007023025, 0.0278321505, 0.0293658935, -0.5606937408, -0.3480980694, 0.3855325878, -0.4710200131, 0.029595837, -0.206892103, 0.10317377, 0.1791049987, -0.3120690286, -0.396476984, 0.1284192801, 0.2803567052, 0.108189702, -0.3001506031, 0.1338802576, 0.0364999622, -0.0632794499, -0.0691588446, 0.2066376805, -0.0287695993, -0.2944737673, -0.1139803156, -0.2467908114 ]
https://github.com/huggingface/datasets/issues/436
Google Colab - load_dataset - PyArrow exception
> Indeed, we’ll make a new PyPi release next week to solve this. Cc @lhoestq Yes definitely
With latest PyArrow 1.0.0 installed, I get the following exception . Restarting colab has the same issue ImportWarning: To use `nlp`, the module `pyarrow>=0.16.0` is required, and the current version of `pyarrow` doesn't match this condition. If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`. The error goes only when I install version 0.16.0 i.e. !pip install pyarrow==0.16.0
17
Google Colab - load_dataset - PyArrow exception With latest PyArrow 1.0.0 installed, I get the following exception . Restarting colab has the same issue ImportWarning: To use `nlp`, the module `pyarrow>=0.16.0` is required, and the current version of `pyarrow` doesn't match this condition. If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`. The error goes only when I install version 0.16.0 i.e. !pip install pyarrow==0.16.0 > Indeed, we’ll make a new PyPi release next week to solve this. Cc @lhoestq Yes definitely
[ -0.3427737057, 0.2993349135, 0.0278660916, 0.0008247875, -0.0533738546, -0.2322781831, 0.2582431734, 0.1790956706, -0.2328971028, 0.1098068953, -0.003500388, 0.634798944, -0.2590233386, 0.110695295, 0.1111482754, -0.0966257155, 0.1224779189, 0.3842330277, 0.0320783183, 0.1150274873, -0.2321146578, 0.3013066053, -0.4014843106, 0.2736144066, -0.3001113534, -0.0178911947, -0.0336272307, 0.0969624966, -0.286727041, -0.6638884544, 0.4799573123, -0.0461137965, 0.2491192371, 0.2177295387, -0.0001120963, 0.0018573595, 0.4446172118, 0.0588438213, -0.1980582029, -0.4029645026, 0.0341190025, -0.4738251865, 0.4145333469, -0.0984018967, 0.0098399622, -0.0233777631, 0.2621850073, 0.6624277234, 0.3113108873, 0.2026090473, 0.2112781405, 0.2363435924, 0.3234765828, 0.0074098925, 0.422724098, -0.1575137824, -0.0963935927, 0.764811039, 0.1429356635, -0.3419245481, 0.0089761605, 0.1031949744, -0.2788569033, 0.0289602671, 0.021921996, 0.0070114704, -0.1472039223, -0.3071443141, -0.0639111325, 0.2735511065, 0.2462306917, -0.3698070943, -0.1704453826, -0.0098759513, 0.1577401906, -0.5250216722, 0.1430393606, 0.2469920963, -0.3028106391, 0.205875203, 0.1286189556, -0.1188327968, -0.1860570908, 0.1715103686, -0.1171360835, 0.7375594974, 0.1335551888, 0.1152552292, 0.2805884778, -0.0567425191, 0.5407665968, 0.3088675141, -0.0792703703, 0.1202859804, -0.0427253842, 0.0211690385, 0.0225464404, 0.3409100473, 0.0249085017, -0.2473074943, 0.025586281, 0.0225669295, 0.125621736, 0.4503287077, 0.0599615723, -0.0484910198, -0.0453351289, -0.0046338392, 0.4267907739, -0.006643889, 0.1369572431, 0.0808407962, -0.0122740688, -0.284760803, -0.0170378648, -0.0676543191, 0.2775864005, -0.1611775011, -0.3963501155, -0.2821991444, -0.4359751642, 0.0238581114, 0.0372935086, 0.1950221062, -0.1200189367, -0.1023526341, 0.0121810604, 0.1517194957, -0.2696359158, -0.0800236315, -0.0334362425, 0.1952787191, -0.2237412333, 0.0621653348, 0.23171404, -0.1511157155, 0.2136741728, 0.1638041139, -0.106226474, 0.2310117483, -0.0294302478, -0.1341702491, -0.1386494339, 0.2887900174, 0.1331015974, -0.0839097872, -0.172468856, -0.3421239853, -0.2602790594, 0.3834968209, -0.2810296118, -0.34865731, -0.3057539165, 0.1715803742, -0.3623224497, -0.2298500389, -0.2415511757, 0.192508176, -0.1000902429, -0.5023198724, -0.1039681286, -0.352139771, -0.0717574134, -0.2018386722, -0.0292970035, 0.2034840882, -0.35297212, -0.0353137553, -0.1182199419, -0.1545046568, 0.2850586772, 0.2002336979, -0.2665145099, 0.0042174864, -0.1132772937, 0.2782341838, 0.2827669084, -0.0782018676, -0.3504199982, -0.0246287305, -0.0884433538, -0.1190677434, -0.056546852, -0.0112742744, -0.0793266073, -0.0798387825, 0.1883731931, 0.2289941907, -0.0206914041, 0.0899545029, -0.3444251418, -0.3358956575, 0.2805464268, 0.1920298487, 0.0722374618, -0.178954348, 0.0699493065, -0.0459713414, 0.157460928, -0.1699225754, -0.1814157367, 0.0086770356, 0.4186851382, -0.1727125496, -0.1212953404, 0.0149608031, -0.3636225164, 0.0653887615, -0.2499880195, 0.3446653485, -0.1689763367, -0.1383540034, -0.0968621895, 0.1540223956, -0.0032699334, 0.0448439531, 0.1141755506, -0.069219254, 0.0930162072, 0.2307725698, 0.0139852352, 0.070030883, 0.0974469036, 0.0902945474, 0.0755293295, 0.3200629056, -0.3432149291, -0.5013922453, 0.1558915973, 0.1919504106, 0.0954930112, -0.0152712548, 0.0595762767, 0.0701607317, -0.0414921008, 0.1012138352, -0.3247617781, -0.1853405088, 0.2462165654, -0.4993382692, 0.0803942233, 0.0131683582, -0.0752409026, 0.1265435666, 0.4028691947, 0.3070374131, 0.1803320944, -0.0566329919, -0.0034644592, 0.0601748824, 0.1596660614, -0.0279672556, 0.0723466426, 0.034191817, 0.1038169488, 0.3129442632, 0.1196284965, -0.02238065, -0.3551900685, 0.183810696, 0.4711066186, 0.062361218, 0.2583272159, 0.2070451677, -0.0968043357, -0.1911536455, 0.2963225842, -0.2238921523, 0.2534523308, 0.2617911994, -0.076861158, 0.250348717, -0.3105472326, -0.3091454804, 0.0943919495, 0.0421277806, 0.1733681262, 0.0248517245, 0.3159976304, 0.0110517088, -0.3823559284, -0.0541485734, 0.0020074677, 0.2897808552, -0.1607691646, 0.2292200029, -0.3812183142, -0.5844125748, -0.2033058405, -0.3761791885, -0.3669309914, -0.0743167624, 0.0838025957, 0.3103743196, 0.0543876365, 0.2557637393, 0.4026349783, 0.0697184727, -0.2327949256, -0.2434327155, -0.2093126327, -0.4130919874, -0.5413902402, 0.0675748438, 0.2533712387, 0.149905324, 0.2001347989, -0.1714406461, 0.0169507004, 0.1043808013, -0.5898127556, 0.1002966836, -0.2247342914, 0.3380074799, 0.1060063541, -0.0794157684, -0.3944556117, -0.3828271925, 0.1079259887, -0.2567719519, -0.1813481897, 0.0085918764, -0.3333748877, 0.0928749144, -0.2160845995, -0.1032109857, -0.6534886956, -0.2656673789, 0.1510528624, 0.1169585809, 0.1299254894, 0.3539071977, 0.2291956842, 0.1824575067, 0.0490743592, -0.1751547903, -0.0114476141, 0.0290604439, 0.2000274062, -0.2042185068, -0.2945660651, 0.1472580582, -0.1673743874, 0.0931810588, -0.04296178, -0.4215467572, -0.4417281747, 0.085579209, 0.384021759, 0.154304415, -0.0067447172, 0.3419801593, 0.0956136882, -0.0341993608, 0.0839709938, -0.3151021302, -0.0966733098, 0.1171038747, 0.1417523175, 0.043458458, 0.1518183649, -0.1093010455, 0.6300573349, -0.2139456719, -0.1077206433, 0.4509526789, -0.1072048247, 0.3438113332, -0.0944144726, -0.0752922446, 0.0480074808, 0.0440239869, -0.0963850617, 0.1973455548, -0.2002141625, -0.5494315028, -0.1968809813, -0.2261256576, -0.1790664047, -0.2719098628, 0.0905907825, 0.4456665516, 0.1552734673, 0.1197675616, -0.1132983491, -0.0142350383, -0.3394669294, -0.1343713403, 0.0364558436, -0.1016607359, 0.0346688293, 0.2814472914, -0.5303830504, -0.524749279, 0.250290215, 0.3806581795, 0.0215021521, 0.0081425644, -0.0626111031, 0.0872105062, -0.1062909439, 0.0684466511, 0.0922204256, -0.0971358642, 0.2445693612, 0.2222720981, -0.2340101451, -0.1920473576, -0.193492502, 0.1639663428, 0.3089673817, 0.004729155, -0.3216295838, 0.0847142413, 0.5238487124, 0.3645203412, 0.0546268411, 0.0535175763, -0.380959183, -0.5595185757, -0.0602216944, 0.0733548999, -0.0392753147, 0.2775352895, -0.1530000269, 0.1538328975, 0.1033135653, -0.1528432965, -0.1043695658, 0.4947181046, 0.0936843306, -0.0129778497, -0.0004544503, -0.1389579177, -0.2887957394, 0.3949981332, 0.4543974698, 0.1464978904, -0.0440172143, -0.0468859822, 0.2194837481, 0.2195371538, 0.0662070811, -0.0709816068, 0.1114897579, -0.2176204771, -0.1598271728, 0.1562423408, 0.0562019609, 0.0816565603, -0.0320804864, -0.2292522788, 0.0558030829, 0.6698862314, 0.1846266538, -0.0693127736, -0.0279193688, -0.0430283844, -0.2264949977, 0.3169514537, 0.1045503244, 0.8228833079, -0.0489419289, 0.1441757828, 0.7622261047, -0.0296682511, 0.6805465221, 0.1497794986, 0.3072378933, -0.3835255206, 0.058802221, 0.0728256479, -0.0609900877, 0.0731469393, -0.1455002874, -0.393055588, 0.2606295645, 0.2867898345, -0.026476413, 0.2877856195, 0.1419991702, -0.0269436762, -0.0531502515, -0.3452914059, 0.1084246337, -0.177722156, 0.2079710066, -0.3530267477, -0.1281893402, 0.0871095136, -0.3031853735, -0.3591161668, 0.2581677139, -0.2969035506, 0.0468786694, 0.174272418, -0.4596211016, 0.01659525, -0.078451328, -0.0620593801, -0.0371712521, -0.1562339664, 0.1665724814, 0.0004106943, -0.3037154377, -0.0537540019, 0.2256670147, 0.218904227, -0.2000869364, -0.1893270612, 0.1877376288, -0.0495269075, -0.1875086278, 0.106125921, 0.2045487761, -0.1142985672, 0.1869374961, 0.0794340298, 0.0730264187, 0.1906562299, -0.1356146336, 0.1421959549, 0.0207577832, 0.0778239295, 0.1563088745, -0.053574264, -0.1859851629, -0.1643832475, 0.2252757996, 0.096702911, 0.1861313879, 0.4558212161, 0.1741261482, -0.0832390487, -0.1470932364, -0.1463323832, -0.3217687309, -0.3653515577, 0.0773964226, 0.2588825822, 0.1288864762, 0.2183810472, 0.3914043009, 0.1139285117, 0.0233523175, -0.0448610596, -0.3423524201, -0.2197381854, 0.327667743, 0.0574600101, -0.0691527426, 0.2971718013, 0.4240753651, 0.1978619695, -0.2634894252, -0.2902500629, 0.1804886311, -0.1675819457, 0.1667111367, -0.1106208414, -0.1134628728, 0.0569195561, 0.071306847, 0.0857153237, 0.106040068, -0.0339436717, -0.2348018736, -0.0859389156, 0.0918137804, 0.1614659578, -0.2099701464, -0.1105783507, -0.1162213013, 0.0552263148, 0.1327281743, 0.0840237141, -0.0290762167, -0.2390404791, 0.1647337079, 0.137728408, 0.2250224948, -0.000516947, 0.1514250636, -0.1787544191, 0.4222079813, 0.2305239886, 0.3370658457, 0.1093787923, 0.0982593819, 0.3143340051, -0.1214888766, -0.1571284533, -0.1349672973, 0.040111538, -0.3493870199, -0.0280441325, -0.3854213953, 0.1530692875, 0.3556879163, -0.0881110132, -0.18752262, 0.5486344695, 0.1611546874, -0.4660821557, 0.0523328073, 0.0850412697, 0.0544779822, -0.0468840711, 0.2423156053, 0.2471879423, -0.0384109803, 0.2116463929, 0.1933158189, 0.2679804265, 0.2615715861, 0.0040843398, 0.2276210338, -0.1358463466, 0.1243589967, 0.2575093806, 0.1837986261, 0.3727379739, 0.0371417142, -0.3018251956, 0.2114647031, -0.2427954376, 0.0761607066, 0.0475602485, -0.4293704927, -0.1298656464, 0.2108361721, 0.284098953, -0.1893674284, 0.1755262166, 0.4341076314, -0.1155913696, 0.0032044277, -0.1722660661, 0.416143477, -0.1437198818, -0.0262855832, 0.0578349195, 0.0214266721, -0.0630156845, 0.22762537, -0.1368115544, -0.1164048314, 0.2230811268, 0.1955062598, -0.194045499, -0.1434905231, 0.0630191565, 0.2389403284, -0.1176959053, -0.0176227447, 0.2848541737, -0.0744713917, -0.3305773437, -0.2518535852, 0.5178360939, 0.5570285916, 0.2944160402, -0.3138179481, -0.2281094193, -0.2676800787, 0.0981901288, -0.1367555112, 0.0734225363, 0.4513368607, 0.4381736219, 0.1812366098, 0.1011427045, -0.1797258407, 0.2612930834, 0.201324299, -0.036817845, -0.0303332023, 0.0452715866, 0.0853584036, -0.1082075685, -0.1608339399, 0.0098688481, -0.2683595419, 0.4186894, 0.2106875926, 0.2166279703, -0.1077709123, -0.1446013004, 0.0757286251, 0.1124671176, 0.658721149, 0.415235281, 0.526705265, -0.2332033366, -0.2329097986, -0.5888138413, 0.206811443, -0.4867606461, 0.0917185619, 0.0359306, -0.0490404591, -0.1855455041, 0.3980051279, -0.2160431892, 0.3255217671, -0.1239702925, -0.2867912948, -0.3391117752, -0.0271017905, 0.0189100094, -0.3432716131, -0.096009627, -0.2429415733, 0.1460618973, -0.6712960005, 0.0536421128, -0.3101528287, -0.1983036101, 0.0495859124, 0.1595616341, 0.5663315058, 0.1240324527, 0.5083732605, 0.1158209816, 0.0103750518, -0.1272681206, -0.380597204, -0.2422289997, 0.2114139795, 0.1376101524, 0.128782168, -0.0762548074, 0.0794653967, -0.2455943972, 0.431728363, -0.1461813599, 0.1392711699, 0.2135460526, 0.100648582, -0.0860766247, -0.09817864, -0.2094151974, 0.0486904085, -0.0006398815, -0.0257485341, -0.5031927228, -0.3479790092, 0.3578093052, -0.4954043031, 0.0160118826, -0.1722185314, 0.075172618, 0.0758843571, -0.2522553504, -0.3977368474, 0.1655830443, 0.2635035217, 0.0735246912, -0.2914823294, 0.1351569295, 0.0072119026, -0.0872239247, -0.1138577238, 0.2276301086, 0.0252947249, -0.2854985297, -0.1105774716, -0.1900270879 ]
https://github.com/huggingface/datasets/issues/435
ImportWarning for pyarrow 1.0.0
This was fixed in #434 We'll do a release later this week to include this fix. Thanks for reporting
The following PR raised ImportWarning at `pyarrow ==1.0.0` https://github.com/huggingface/nlp/pull/265/files
19
ImportWarning for pyarrow 1.0.0 The following PR raised ImportWarning at `pyarrow ==1.0.0` https://github.com/huggingface/nlp/pull/265/files This was fixed in #434 We'll do a release later this week to include this fix. Thanks for reporting
[ -0.083075203, -0.1102308556, -0.0867729113, -0.1396403164, 0.2431191802, -0.2674663663, 0.3366215229, 0.3281984627, -0.1044743657, 0.1609232724, -0.0459905975, 0.2184551656, -0.1111825332, 0.0628341362, 0.0275805015, -0.256803751, 0.0977711678, 0.2359912992, 0.0056410707, -0.0169461239, 0.0004629469, 0.2912734747, -0.194728151, 0.3621999919, -0.2395527959, 0.0270071682, 0.0885713995, 0.1242647991, -0.2790330648, -0.5286543369, 0.1933573782, -0.163190037, -0.073205024, -0.0040343106, -0.0001010639, 0.1438983828, 0.4179387093, 0.17098324, 0.1610469222, -0.0188637301, 0.476513952, -0.3481639028, 0.3162205517, 0.0011415702, -0.2127270401, -0.3874779642, 0.2012824863, 0.6739888191, 0.2996213734, 0.0531940907, 0.3520936966, 0.5651535988, 0.306794852, 0.2126059681, 0.3988426328, -0.1721244156, -0.0575683527, 0.2334619462, 0.0991276428, -0.4453288317, -0.221132502, 0.106356658, -0.0244037025, -0.0982081592, 0.014800257, -0.0480629429, 0.048746936, -0.1012411863, -0.2533308566, 0.0315615498, -0.1268712431, -0.2548310161, -0.1118742526, -0.0782759041, 0.0606311113, -0.4917187989, 0.2599358857, 0.2389288843, -0.0639471114, 0.2154643834, 0.0959482417, 0.0326448679, -0.1715608537, 0.1390213519, 0.0803397223, 0.5061994791, 0.0320005901, -0.0365812071, 0.1415234953, -0.1213113144, -0.0105363447, 0.1806746125, -0.0656801686, -0.015071271, -0.0555663966, -0.0517713837, 0.2417271286, 0.259807229, 0.1269376278, -0.1598719954, -0.0539519452, 0.1668391675, 0.1308999062, 0.2279285938, 0.0629452839, 0.0282734614, 0.1008226126, -0.3034646809, 0.3983904123, 0.079147771, 0.1498908997, 0.0987929627, 0.1599192768, -0.3288705647, 0.0572978221, -0.0595710836, 0.2322984338, -0.1589361876, -0.1830838025, -0.1484584957, -0.2489199787, 0.0096770041, -0.0996642485, 0.2695371211, -0.097309202, -0.0196079277, 0.0986448377, 0.2622403204, -0.3504638076, -0.2332782894, -0.2548337281, 0.0658040047, -0.3251519501, -0.0997656062, 0.1824346483, -0.0633448064, 0.3893647492, 0.2999077439, -0.0197894685, 0.1312522888, -0.0293195825, 0.225811556, -0.0064858696, 0.2267416567, 0.0049192924, -0.0279852524, -0.0467880517, -0.1139085442, -0.0660100952, 0.0741587281, 0.056860067, -0.1301459372, -0.383926779, 0.3116227686, -0.2090822756, -0.1045196801, 0.0282639563, 0.0513057858, 0.1286737472, -0.0548701063, -0.0117078321, -0.1456808746, 0.0393038914, -0.1020549089, -0.0698952302, 0.0730502903, -0.1338867843, -0.1944649667, 0.2042917609, -0.4161698818, 0.2749917209, 0.3692955673, -0.2970251441, -0.0789091066, -0.2009681612, 0.324788779, -0.0235639345, -0.0966950655, -0.1888201684, 0.0235764887, -0.2668338716, -0.0348271094, 0.0754942372, -0.1217663363, -0.2040689886, 0.0721505955, 0.0707328543, 0.3919308782, 0.1285735816, 0.2569901943, -0.4870687127, -0.2503655553, 0.1534608305, 0.0033285157, -0.0707068145, -0.2464266121, -0.0404126607, -0.1909305751, 0.3194947839, -0.1372531354, -0.0349238366, 0.0468541011, 0.0672130138, 0.0690261871, -0.0961692706, 0.0366539881, -0.1779852062, 0.0214933045, -0.3616142273, 0.3930594325, -0.1452843249, -0.3226927817, -0.0786101893, 0.0359090306, -0.1544841975, -0.1556720734, 0.3084647059, -0.0589614548, -0.0215103962, 0.2313107103, 0.0603005439, -0.1698938161, -0.0058381483, 0.1254485101, 0.0518527105, 0.1411392689, -0.3814888895, -0.3911995888, 0.1973904818, -0.0112608671, 0.1413130909, 0.0031074889, 0.113129966, 0.0895701647, -0.1998308003, 0.3266765177, -0.3180727959, -0.050188411, 0.134268865, -0.3729343414, 0.023429038, 0.0651893169, -0.1765623689, -0.0148426006, 0.2517151535, 0.4727602303, 0.2811139226, -0.1402594447, -0.0036961574, -0.1384205818, 0.1402436197, -0.1233885139, 0.094248116, -0.0179689582, 0.0567538142, 0.1691509038, 0.0611513443, -0.1107050031, -0.3336113691, 0.0328677334, 0.3761785626, 0.0379980579, 0.1958342642, 0.0069670998, -0.0281110294, -0.1388168931, 0.2378652841, -0.4669156075, -0.0157594569, 0.2753903866, 0.0200039204, 0.2059601843, -0.2243598998, -0.4125034511, 0.0481903814, 0.0607327819, -0.0026751806, 0.1401380897, 0.4111929536, -0.2279911488, -0.7777085304, 0.235370487, -0.0812939629, 0.0095218141, -0.2907806933, 0.0664653331, -0.2939154208, -0.3391764462, -0.0755751878, -0.2050063163, -0.3589579761, -0.0981445983, 0.3100821376, 0.1755023897, -0.2631777227, 0.3151646554, 0.3475990891, -0.0642476901, -0.0756793171, -0.1202400401, -0.1154793724, -0.2051044554, -0.266313374, 0.1959459931, 0.06247041, 0.0458272099, 0.1699757278, -0.1139841154, -0.0664580986, 0.0129903676, -0.5971788764, 0.0656020865, -0.2121936977, 0.1207146794, 0.1933071315, 0.1167021394, -0.0155747216, -0.2416050881, 0.2296313792, -0.3196703196, -0.4370693266, -0.0598570965, -0.1593147963, 0.1028263643, -0.3726231754, -0.1548136175, -0.1904672682, -0.3148062825, 0.1847974211, 0.0559414513, 0.0161649641, 0.3104849756, 0.1640839279, 0.093373552, -0.3175967634, 0.0469767712, -0.0244123321, -0.1549778134, 0.1693424433, -0.2249408811, -0.4008029401, 0.0334065594, 0.01066346, 0.0975721255, -0.3147258162, -0.4104326665, -0.3181371987, -0.0403933711, 0.5853020549, 0.3685544729, -0.0770057142, 0.2899481952, 0.1316102296, -0.2970890701, -0.0523830466, -0.3068108261, 0.0330356471, -0.1884209067, 0.0231341738, -0.1692149043, 0.088259846, -0.0709630027, 0.6686912775, -0.3755655289, -0.1222005785, 0.5347420573, -0.0492615364, 0.3575076163, 0.0169340391, -0.016253259, 0.0615126677, 0.0671217442, 0.266138792, 0.1894722134, -0.1099520847, -0.4191838205, -0.0454812907, -0.4166469872, -0.0361578651, -0.2257387191, -0.0053760163, 0.5628574491, -0.0140686901, 0.1647194624, 0.0120682651, 0.017397169, -0.2695159614, 0.2594311535, 0.0008520572, -0.1660769582, -0.0606489889, -0.1289084703, -0.0638434812, -0.3101233542, 0.0570143983, 0.2350650281, -0.0570892543, -0.024571972, -0.258380115, 0.1342055798, -0.1056806371, 0.400503695, 0.2934620082, 0.1665642262, 0.2135398984, 0.0701529533, -0.2036423534, -0.170490995, -0.155684948, -0.0211957917, 0.3835708201, 0.0528603606, -0.4389581084, -0.175442338, 0.3004760742, 0.2820100188, 0.0027459865, -0.015314701, -0.5284619331, -0.2185238153, -0.1631641388, 0.1246434525, 0.0985193327, 0.2308524698, -0.1832677573, 0.06241991, 0.0380949341, -0.1195349917, -0.1824249476, 0.3710532188, 0.0309958719, -0.1367568076, -0.0074478234, -0.0881538093, -0.0357665494, -0.0579180308, 0.3514463305, 0.0464074798, -0.2605164945, -0.1223317981, 0.223165825, 0.0523234941, 0.1710094362, 0.0057619861, 0.1916312873, -0.1243807152, 0.0281497631, 0.1198756993, 0.1390534341, 0.34975335, -0.0350484774, 0.2092649192, 0.2415167391, 0.3253231645, -0.0578266717, 0.0641009733, -0.0339832529, 0.2301050574, -0.1437180787, 0.2209852934, 0.0451650918, 0.8207977414, 0.0330352001, 0.2702249587, 0.6261535287, -0.2362235487, 0.3250903189, 0.1172433943, 0.2000280023, -0.3581175208, 0.0033054503, 0.2600870132, -0.0228623729, 0.0847515687, -0.1178091392, 0.0181822553, 0.0287805889, 0.1112655848, -0.0092796711, 0.0248553324, 0.1781782061, 0.1207868531, -0.0127580697, -0.3865139186, 0.1847658008, -0.0098460941, 0.2434544563, -0.1725934148, -0.3018136919, 0.2809737027, -0.3456580937, 0.0044911727, 0.3744014204, 0.0178191066, 0.1027277857, 0.2606957257, -0.2044040114, -0.1182840466, 0.0858621895, -0.0166331436, -0.0952289328, -0.1101047397, 0.305087626, 0.0727005675, -0.2583872378, -0.1442804039, 0.3166055977, 0.056027364, -0.2428622693, -0.3549965918, 0.2014133036, 0.0469355807, -0.0237468034, -0.1675530672, 0.0315037519, -0.0152525697, -0.0413668342, 0.1499979794, -0.0467617176, 0.1018390581, -0.2062679976, 0.2574654818, 0.0557674952, -0.0219872296, -0.031620089, 0.2130372971, -0.1793030351, -0.2644486427, 0.4202329218, -0.1042943969, 0.0694811791, 0.3385530114, 0.3837929368, -0.3116827309, -0.2122028172, -0.227796331, 0.0619234405, -0.5709694624, -0.0075391578, 0.2905113101, -0.116924949, 0.0515383035, 0.3112247884, -0.0189902503, -0.0013939879, 0.0555657595, -0.0304723941, -0.1131909862, 0.1001548022, -0.057381507, -0.0165948886, 0.439937979, 0.4364565611, 0.1472836286, -0.1039575711, -0.411329627, 0.0673327446, -0.1125502139, 0.1381010264, -0.2909932733, -0.2318253517, 0.2360016108, 0.1290107369, 0.2740167677, 0.0868182778, -0.1110766083, -0.338496089, -0.1322936118, 0.0018456219, -0.0048814104, -0.0717095882, 0.1792272776, 0.225589335, 0.0820275247, 0.1244026497, 0.3096893728, -0.029508492, -0.1503887922, 0.2898206711, 0.1425183713, 0.0353095792, 0.1465830207, -0.2073167711, -0.1482467651, 0.2773079872, 0.1130541712, -0.0286235865, -0.1440725476, 0.0268371105, 0.2978823483, -0.0621421598, -0.1109966412, 0.1789120287, 0.1344167292, -0.2298989147, -0.3243171275, -0.225720495, 0.2501015365, 0.1445130557, -0.2257970273, -0.1727879047, 0.3819533288, 0.3430961072, -0.494342804, -0.0907825306, -0.0316526927, 0.1363238692, 0.0802177489, 0.0350170322, -0.0199274477, -0.0952977613, 0.1967454106, 0.3701379299, 0.1514440924, 0.0223530959, -0.228471756, 0.0744999275, -0.2980051637, -0.1211716458, 0.4549671412, 0.1497990787, 0.2490100861, 0.024707973, -0.1215820163, 0.0598125122, -0.2983395755, 0.1750701219, -0.1613070071, -0.1363921016, -0.1171569303, 0.379314363, 0.2954331636, -0.1782367676, 0.1823406816, 0.4003163576, 0.2745027244, -0.136053741, -0.0515779033, 0.6059236526, -0.1846618503, -0.0462746248, -0.0622540005, 0.1243798956, 0.0385913812, 0.2332671732, -0.031923119, 0.0491470434, 0.2032893747, 0.0685301945, -0.182164669, -0.358214587, 0.0103543168, 0.0803230554, 0.2148053497, -0.0225482695, 0.2984034717, 0.21420829, -0.1925634742, -0.1964104176, 0.2984683216, 0.4337423146, 0.183555454, -0.0543596819, -0.1605571657, -0.2027056962, 0.0328566432, -0.2084277272, 0.1702625006, 0.22158584, 0.5038291812, 0.1546587944, 0.1907961816, -0.3705565929, 0.0332403742, 0.1691543013, -0.0247027501, 0.062913999, 0.0638837367, -0.0297710951, -0.2653667331, -0.3680840433, -0.1542307734, -0.3825883269, 0.2647893131, 0.0980388671, 0.2649371028, -0.0150409816, -0.4861192107, 0.1417194009, 0.1846014708, 0.6637269258, 0.2069658488, 0.268461436, -0.1088386327, -0.0998880938, -0.4346325397, 0.311491996, -0.3065358996, 0.04217989, -0.0522694848, 0.0214558542, -0.1013638899, 0.2282586247, 0.0045614499, 0.0757818371, -0.0998054743, -0.2323071063, -0.3131773472, 0.3172434866, 0.087618351, -0.2602440715, 0.104886286, -0.1456596255, 0.2333255857, -0.4985123575, 0.2598395944, -0.2432782203, -0.0090717012, -0.1888143122, 0.3120507598, 0.2228730619, 0.1276968867, 0.1513317376, -0.0133229932, -0.0628323108, -0.1417476833, -0.377404362, -0.2469455153, 0.1444802284, -0.0085266028, 0.16544649, 0.0690768659, -0.1187743098, -0.2045988292, 0.4295692146, -0.0040785386, 0.0780157819, 0.1664196998, 0.2578723729, 0.117577754, -0.0706558526, -0.2239869684, 0.0518486835, 0.0200977866, -0.2055511177, -0.4341715276, -0.5926017761, 0.347640872, -0.4550388753, 0.0570189767, 0.0646058843, 0.1482397765, 0.1230562255, -0.3943466842, -0.4716581106, 0.3042542934, 0.1011685729, 0.1949093044, -0.2898899913, 0.1886672229, 0.000585055, -0.0815228298, -0.0591253377, 0.1133670211, 0.2314943522, -0.2264799476, 0.089316152, -0.1714509875 ]
https://github.com/huggingface/datasets/issues/435
ImportWarning for pyarrow 1.0.0
I dont know if the fix was made but the problem is still present : Instaled with pip : NLP 0.3.0 // pyarrow 1.0.0 OS : archlinux with kernel zen 5.8.5
The following PR raised ImportWarning at `pyarrow ==1.0.0` https://github.com/huggingface/nlp/pull/265/files
31
ImportWarning for pyarrow 1.0.0 The following PR raised ImportWarning at `pyarrow ==1.0.0` https://github.com/huggingface/nlp/pull/265/files I dont know if the fix was made but the problem is still present : Instaled with pip : NLP 0.3.0 // pyarrow 1.0.0 OS : archlinux with kernel zen 5.8.5
[ -0.1463130563, -0.0825238004, -0.0497648679, -0.0821144804, 0.1566721648, -0.2191775441, 0.1178101972, 0.4189061821, -0.2502534091, 0.1290671825, 0.0764927492, 0.2807854712, -0.2030649483, -0.1170994341, 0.0609495565, -0.176726982, 0.1294214427, 0.261392951, -0.0432573035, -0.0118177617, -0.1181317195, 0.3794070482, -0.3579396009, 0.4410783648, -0.1741459817, 0.0080257794, 0.1847311109, 0.1068228781, -0.2745456696, -0.7176747918, 0.3703354299, -0.2556541264, 0.1187359616, -0.145318076, -0.0001122298, 0.1098700464, 0.4844832122, 0.1264276206, 0.2048351318, -0.2869176567, 0.3934239745, -0.727304697, 0.3218922913, -0.0929810777, -0.0015565302, -0.3426618576, 0.2967851162, 0.7822846174, 0.3996648788, 0.1758711189, 0.2156396657, 0.530610621, 0.3595179915, 0.3860239685, 0.338144511, -0.2313629985, -0.0678989664, 0.2951613069, 0.0531933494, -0.5167251825, -0.0443867706, 0.1509314328, -0.1811771393, -0.119270511, 0.0169100538, -0.1557048708, 0.2961477339, -0.2603825927, -0.381411314, 0.0868635774, -0.2023054361, -0.2443889976, -0.190042749, -0.0965143889, 0.2009543777, -0.4492751062, 0.3753637373, 0.2514257729, -0.0926632732, 0.2638777494, 0.102049537, 0.1437646002, -0.2070806921, 0.2501846254, 0.1616185606, 0.7215542793, 0.1772344708, 0.1274003088, 0.1793177426, -0.0906530544, 0.2533277571, 0.1564492434, -0.1677649766, 0.2413885742, -0.0913617536, -0.1201787665, 0.1022299901, 0.3962028921, 0.0492237695, -0.1726310849, -0.1069481969, -0.0338305607, 0.2005788982, 0.1612655967, 0.1280687451, -0.0260973927, 0.2030238956, -0.2324661762, 0.2462064773, 0.1590735614, 0.1445093751, 0.0729049221, -0.0251890477, -0.3879303634, 0.1451654136, -0.0661640391, 0.3707579672, -0.1980350316, -0.2538054883, -0.263926506, -0.3639075756, 0.0195964761, -0.0219471753, 0.1275432408, -0.116219461, 0.1894864142, 0.0578528382, 0.1939164698, -0.3054688275, -0.1874006987, -0.0425396673, 0.1129767224, -0.3520487547, -0.0135480156, 0.0832812935, -0.1224772409, 0.4979560375, 0.2246411145, -0.1518142074, 0.0297391713, 0.0791249275, 0.1071714535, 0.036860574, 0.2614902258, -0.0684243664, -0.0179728754, 0.0009732782, -0.0820256397, -0.2350459695, 0.263875246, -0.0133770825, -0.2735420465, -0.4603399038, 0.2024454772, -0.3389337361, -0.1279257238, 0.1861554086, 0.0615640096, 0.1776738018, -0.3524861932, 0.041945491, -0.3899521232, 0.1260897815, 0.013642122, -0.1244789287, -0.0413491726, -0.0070415316, -0.1972958893, -0.0320974961, -0.4223333597, 0.3923662007, 0.3698947132, -0.3251796663, -0.0223596226, -0.0978618711, 0.2279029638, 0.2245866209, -0.3489609063, -0.3137608469, 0.0563644879, -0.1993919462, -0.1143460348, 0.2462940067, -0.0272545554, -0.1828133017, -0.019140562, -0.0409664176, 0.3157665431, 0.0823568627, 0.1319955289, -0.4862549901, -0.2567750514, 0.1407624185, -0.0223902203, 0.0237174332, -0.1570113152, -0.044181332, -0.0445418619, 0.3431512415, -0.0166792944, 0.033964172, -0.0141073791, 0.0175170787, 0.1112065837, -0.1198916584, 0.0779936761, -0.0134684462, -0.0226793233, -0.5015800595, 0.3683544993, -0.1919386834, -0.3551449478, -0.1008393988, -0.0070901308, -0.0447305441, -0.100691922, 0.1612115353, -0.1429771185, 0.0715138093, 0.2534144521, -0.0067577371, -0.3259922862, -0.0255913362, 0.1006075814, 0.0014618529, 0.1108680889, -0.3691414297, -0.507037282, 0.0286355596, 0.2058617026, 0.2018126696, 0.1119774356, 0.098195672, -0.0303255394, -0.3082162142, 0.2859079838, -0.4791698456, -0.1952310652, 0.1172277033, -0.4769582748, 0.0436515883, -0.0142157516, -0.1687177867, 0.1005287096, 0.4360942245, 0.4499979019, 0.1965038329, -0.0531024784, -0.1498877853, -0.0545804165, 0.140652135, -0.1640531421, 0.0259625148, -0.0036244714, 0.1470003426, 0.1947020888, 0.1001415104, -0.0109532215, -0.1298134476, -0.1207542792, 0.3967890441, 0.0622105524, 0.0553402826, 0.0301929284, 0.0124041373, -0.1178831011, 0.3387465179, -0.3547404408, 0.0835557729, 0.3039248288, -0.071804747, 0.3368050158, -0.1803066134, -0.2905811071, 0.1546370685, 0.1677265167, 0.0824360177, 0.2134033442, 0.4092851579, -0.1627025008, -0.6508200765, 0.1368488967, -0.0687038228, 0.1575959921, -0.1914118528, 0.0635444075, -0.277679652, -0.4018158317, -0.1863514632, -0.2930061817, -0.3364790678, -0.1061577573, 0.1684436351, 0.3411309719, -0.0711148381, 0.3280321062, 0.3384560347, -0.1754706502, -0.2444175631, -0.0481762663, -0.1508710235, -0.2504647374, -0.3752192855, 0.0670827776, 0.2000454515, 0.1900667995, 0.1615680158, -0.145031333, -0.2201221734, 0.0846731663, -0.4907341301, 0.0075795334, -0.2482958436, 0.1981130838, 0.1954681128, -0.0094682518, -0.1259323657, -0.2910659313, 0.1533658653, -0.3169589341, -0.3713763058, -0.145678252, -0.3450289369, 0.2003513724, -0.3035594523, -0.0370837674, -0.4336916506, -0.2729844451, 0.1849342287, 0.0883676931, 0.0782105625, 0.3221368194, 0.092308782, 0.1517426968, -0.278113842, -0.1642435789, 0.1256396621, -0.0698492527, 0.1968343407, -0.0362188928, -0.2200053632, 0.1404721588, -0.0261148252, 0.1026242301, -0.2304702699, -0.4257997572, -0.2739188969, -0.028199207, 0.6165577769, 0.2406507879, -0.106980592, 0.4314074516, 0.0798533857, -0.1554448456, 0.0156346466, -0.1081205159, -0.0195613075, -0.2196579725, 0.1145344675, -0.0134999435, 0.1643053293, 0.0284328144, 0.7524284124, -0.2021984905, -0.0865357071, 0.5082697868, -0.0427487716, 0.250654161, 0.1585093141, 0.0116209816, -0.0751905963, 0.2429632545, 0.1551573128, 0.0164739862, -0.1186717153, -0.31673792, 0.1006590948, -0.4192095101, 0.0081106834, -0.0788079277, -0.0037514488, 0.4223540127, 0.1017467976, 0.2647042572, -0.1091938242, -0.0516464226, -0.4151853323, 0.1822404712, 0.1336544454, -0.1440276951, -0.0040653427, -0.0660973415, -0.3085957468, -0.438986212, 0.0151169784, 0.3585348129, -0.0007143084, 0.0156408735, -0.1333146393, 0.2848253548, -0.0649416372, 0.2460814863, 0.1447224915, 0.0827084258, 0.2315775454, 0.1617180258, -0.2495645881, -0.1933172047, -0.1135944054, -0.0307921506, 0.4878685176, 0.0340220034, -0.3158231974, -0.1914644837, 0.6278871894, 0.2776323259, 0.007831133, -0.1595435441, -0.5531590581, -0.3403336406, -0.0945024714, 0.1357288212, 0.0595892146, 0.2282242775, -0.0856162459, 0.1425571442, -0.0233295616, 0.1138454229, -0.2402731925, 0.2719137371, 0.0305835251, -0.1417432278, -0.0802139118, -0.1551509798, -0.2209055126, 0.0045705494, 0.2699085474, 0.2285872847, -0.2923703194, -0.2940794826, 0.3749377131, 0.0400974452, 0.0891683027, 0.076260142, 0.1906945407, -0.1389034539, 0.0279944073, 0.190988183, 0.0107701616, 0.3302232325, 0.0095628006, 0.2052784413, 0.2049916834, 0.3583039641, 0.075907819, 0.02030503, 0.1160154417, 0.0630371571, -0.3131760061, 0.189379245, 0.1192527488, 0.7727373242, 0.0468876809, 0.2768119872, 0.780810535, 0.038120918, 0.3821665347, 0.2557759881, 0.1406749636, -0.3187009096, 0.0656814054, 0.177650705, -0.0057659633, 0.1608766615, -0.1035432667, -0.0871679336, 0.150662899, 0.3170356452, -0.1086106747, 0.1454942971, 0.1781950146, -0.1200658977, 0.0131123569, -0.4551365077, 0.0432025567, -0.0728660971, 0.3411373496, -0.1738135368, -0.3098096251, 0.2617656291, -0.2420979738, -0.0631486177, 0.2948919237, 0.0729025751, 0.1800817102, 0.1867467165, -0.0979665965, -0.0169629548, 0.2230794281, -0.0047037047, -0.1608379185, -0.0243570041, 0.2252330333, 0.0777620375, -0.3879622519, -0.0755177215, 0.3331819177, 0.0539721288, -0.2730440795, -0.3842214346, 0.116278328, 0.0047673383, 0.0226520095, -0.053064201, -0.0094611375, 0.0467626974, 0.090452835, 0.0458835177, -0.0603075363, 0.052845452, -0.1239374951, 0.1723187715, -0.0085581522, -0.070971638, -0.0210493989, 0.0537555031, -0.3723714054, -0.101308316, 0.3956668675, 0.0173614752, 0.0825558156, 0.5533750653, 0.1342073232, -0.1725981832, -0.1685626656, 0.0888209343, -0.120493181, -0.5595665574, -0.0649081692, 0.39158988, 0.0053682257, 0.0524309129, 0.3142741621, 0.1729960591, 0.0728256777, -0.1409642696, -0.1577623934, -0.1599020511, 0.2311979383, -0.0303481668, -0.2218042463, 0.3306162059, 0.4356180727, 0.1888483465, -0.245416835, -0.297118634, 0.024344584, -0.1334155649, 0.2212603092, -0.247128889, -0.1050410196, 0.057660494, 0.0880893245, 0.1166142747, 0.0358035602, -0.0557490923, -0.2365220487, -0.1890361011, 0.0993036926, 0.0874450207, -0.1711907089, 0.0329069383, 0.1443333924, 0.1743556559, 0.1258204281, -0.0252648368, 0.0263155364, -0.0780581534, 0.3505368531, 0.1515220255, 0.1835600585, -0.0883226395, -0.0433658212, -0.3393917382, 0.2155551314, 0.0755555034, 0.1742347777, 0.0559473485, 0.0806269273, 0.1038273349, -0.2235939354, -0.1362445354, 0.0465386547, 0.0684805363, -0.2091188133, -0.3051458001, -0.1213174984, 0.1599953175, 0.226836279, -0.2400152087, -0.219330281, 0.3959603012, 0.2351079732, -0.3919546902, 0.0256279949, -0.05907996, 0.0732117146, -0.117332615, -0.0312864818, 0.0447251797, -0.2196571231, 0.2954953313, 0.2880699039, 0.1427747011, -0.1183971614, -0.1173935533, 0.200296104, -0.062743701, -0.0369546898, 0.4063511491, 0.0467902273, 0.3146164119, -0.1146051809, -0.129618898, 0.2657224834, -0.2911002636, 0.2943761945, -0.3425345719, -0.1696185023, -0.2282961458, 0.3689382672, 0.2435630858, -0.2419523746, 0.2854419351, 0.3730120063, 0.2542884052, -0.1198337153, 0.0358057432, 0.6180186272, -0.1489039809, -0.1216966212, -0.2572512031, 0.2055369616, 0.0619050153, 0.2556099296, 0.0212981869, 0.1901592761, 0.2496863455, 0.2022264898, -0.2579722703, -0.3524661958, -0.0519882105, 0.3320545256, 0.2005599588, -0.1307683438, 0.2552770078, 0.1283189207, -0.1924659312, -0.2567718327, 0.4530800283, 0.616324842, 0.2657217383, 0.103202574, -0.2209655195, -0.2673632205, 0.0752576366, -0.1873039007, 0.2475881428, 0.2774343789, 0.7746673226, -0.0107693439, 0.0944807082, -0.2811929584, -0.0117220711, 0.1550170183, -0.2454234213, -0.0142717026, -0.0159775056, 0.0552085191, -0.3199709356, -0.2273921669, 0.1110949144, -0.3247714043, 0.3930574656, 0.091408439, 0.3334453702, -0.0036916633, -0.4467834532, 0.068593502, 0.0960259587, 0.4824586213, 0.2509273291, 0.1322209537, -0.2348388284, -0.1713161319, -0.5863736272, 0.238871336, -0.4293250442, -0.0694375187, 0.1120381057, -0.1098492295, -0.3579767942, 0.2536032796, -0.121365495, 0.1574552655, -0.1195030883, -0.2146403491, -0.1870659292, 0.3027910292, 0.2191268802, -0.2342185527, -0.0289156418, -0.2543506324, 0.2548308074, -0.5901119113, 0.0814794153, -0.2319287062, -0.0342662521, -0.069083564, 0.5230585337, 0.1959623694, 0.1945031583, 0.3007864952, 0.08615762, 0.1274978071, -0.1984218508, -0.3919110596, -0.3851030469, 0.220519796, -0.0796591118, 0.1576742083, -0.1454692185, -0.0824463814, -0.2672023177, 0.4386241436, -0.1976335049, 0.0326673687, 0.2748297453, 0.1524992585, 0.0448476821, 0.0765508041, -0.1438391805, -0.0142236874, 0.0946590528, -0.1970761865, -0.5314705372, -0.4598425627, 0.2082964033, -0.5019981265, 0.0528520308, 0.020666616, 0.2318799794, 0.1214510426, -0.4393999577, -0.403578192, 0.1622242481, 0.2716175318, 0.2200745642, -0.1676879227, 0.2431370616, 0.1953089833, 0.0246983152, -0.012545309, -0.1446715593, 0.1201962307, -0.3154450059, 0.1479806155, -0.2379944921 ]
https://github.com/huggingface/datasets/issues/433
How to reuse functionality of a (generic) dataset?
Hi @ArneBinder, we have a few "generic" datasets which are intended to load data files with a predefined format: - csv: https://github.com/huggingface/nlp/tree/master/datasets/csv - json: https://github.com/huggingface/nlp/tree/master/datasets/json - text: https://github.com/huggingface/nlp/tree/master/datasets/text You can find more details about this way to load datasets here in the documentation: https://huggingface.co/nlp/loading_datasets.html#from-local-files Maybe your brat loading script could be shared in a similar fashion?
I have written a generic dataset for corpora created with the Brat annotation tool ([specification](https://brat.nlplab.org/standoff.html), [dataset code](https://github.com/ArneBinder/nlp/blob/brat/datasets/brat/brat.py)). Now I wonder how to use that to create specific dataset instances. What's the recommended way to reuse formats and loading functionality for datasets with a common format? In my case, it took a bit of time to create the Brat dataset and I think others would appreciate to not have to think about that again. Also, I assume there are other formats (e.g. conll) that are widely used, so having this would really ease dataset onboarding and adoption of the library.
56
How to reuse functionality of a (generic) dataset? I have written a generic dataset for corpora created with the Brat annotation tool ([specification](https://brat.nlplab.org/standoff.html), [dataset code](https://github.com/ArneBinder/nlp/blob/brat/datasets/brat/brat.py)). Now I wonder how to use that to create specific dataset instances. What's the recommended way to reuse formats and loading functionality for datasets with a common format? In my case, it took a bit of time to create the Brat dataset and I think others would appreciate to not have to think about that again. Also, I assume there are other formats (e.g. conll) that are widely used, so having this would really ease dataset onboarding and adoption of the library. Hi @ArneBinder, we have a few "generic" datasets which are intended to load data files with a predefined format: - csv: https://github.com/huggingface/nlp/tree/master/datasets/csv - json: https://github.com/huggingface/nlp/tree/master/datasets/json - text: https://github.com/huggingface/nlp/tree/master/datasets/text You can find more details about this way to load datasets here in the documentation: https://huggingface.co/nlp/loading_datasets.html#from-local-files Maybe your brat loading script could be shared in a similar fashion?
[ -0.1659953594, -0.1904751062, 0.1139430255, 0.3808881938, 0.2183724493, -0.0047781533, 0.1885102987, 0.1122670993, -0.1110896394, -0.2132681608, -0.1955654472, 0.28855142, -0.0397955142, 0.5394513011, 0.1926316619, -0.1346117258, -0.2117360681, 0.2186620235, -0.1162289083, -0.0262852889, 0.0394085683, -0.1943165511, 0.0686827451, -0.1159502715, -0.3702633381, 0.1318924576, -0.2384282947, -0.0179268848, 0.2592285573, -0.2346274406, 0.544293344, 0.3445180655, 0.4595023096, 0.2523491681, -0.0001251961, 0.0330158584, -0.0391848832, -0.1448284984, -0.2924481928, -0.1255925, -0.2134354115, -0.2233889103, 0.0898033082, -0.2437827289, -0.3222343624, -0.3877211511, 0.1589095891, -0.5658192635, 0.4574592412, -0.0978453606, 0.0306624398, -0.0806690082, -0.2010449469, -0.1027777046, -0.1274461448, 0.3995324671, -0.0048827059, 0.4021580517, 0.6236611009, 0.3071168959, 0.1142587289, 0.0186164435, 0.1892264783, 0.0923047066, 0.2961038947, -0.1304038763, -0.0321155153, 0.0373831242, 0.0351921134, 0.3731412292, 0.9288993478, -0.3871009946, -0.0573189221, -0.1039506793, -0.0022319388, -0.29162696, -0.2740900218, 0.1782109439, 0.1706529707, 0.1169879958, -0.2853217125, -0.3464593887, -0.2974860966, 0.1213211268, 0.2955726981, 0.0247340333, -0.0860803872, 0.2227663845, -0.2029817104, -0.0876894519, 0.0028407688, -0.2409486175, -0.1546611935, 0.0481969751, 0.1250666976, -0.1266932935, -0.4318875372, 0.1242781579, 0.3226210773, 0.4385859072, 0.3070450723, 0.2488362044, -0.3475720882, 0.0543899238, 0.4337317646, 0.0727872923, 0.3920844495, 0.275516361, 0.0898747593, 0.2174172997, -0.4256952107, -0.160503298, -0.4732803404, 0.4096370339, 0.2828015983, -0.0478398427, 0.0258607101, -0.2413187027, -0.005771914, -0.0553796776, -0.3146701157, -0.1710859686, 0.2200732529, 0.0787811056, -0.1268194169, 0.194323197, -0.0760901794, 0.25407812, -0.0605481528, -0.3372293115, 0.0072379671, 0.0385019481, -0.3324477971, 0.170618102, 0.3277176321, -0.4035723209, 0.2055004686, 0.3074685335, -0.1498453915, -0.1152976602, 0.3684358597, 0.1104315668, -0.2815549374, -0.5091329813, -0.1593070924, 0.0936784223, 0.2187214792, 0.1501328796, -0.3380337059, 0.0335501172, -0.1240275726, -0.3322887123, -0.1301240921, 0.0158545896, -0.2962244749, 0.0313487276, -0.1064656004, 0.4295431376, -0.001211083, -0.3559828997, -0.2109798044, -0.1043996513, -0.2914378643, -0.0680790022, 0.1657020748, 0.2590588033, -0.521217227, -0.128689453, -0.115143232, 0.0005087666, 0.4149291515, 0.2499227673, -0.4169628918, 0.2172118723, -0.1238053739, -0.1836064011, 0.4553331733, -0.0797953084, -0.0108390246, -0.1229193583, 0.2009916902, 0.1629832983, 0.0826166943, 0.0667769089, 0.1893802732, -0.2476026714, -0.3442699015, 0.5017464161, 0.1047517061, -0.2457325757, -0.0767719522, -0.2122575939, 0.118349731, 0.0398366489, -0.2308103889, 0.130129233, 0.0850554258, 0.2706216574, 0.0201237947, -0.2445562333, 0.1147239283, -0.1340277195, 0.0210208464, 0.3941365778, 0.1071009934, -0.2427258641, -0.5016252995, 0.1725224406, -0.3441223204, -0.2779965699, 0.5025933981, -0.5051970482, -0.3756365776, -0.2438971251, -0.1494170129, -0.0231219456, 0.0117690787, 0.5268943906, 0.107581079, -0.0793847442, -0.1046641767, 0.1127331182, -0.1162446737, -0.0206029005, -0.0946501121, 0.2827683687, 0.1337834895, 0.0327416733, 0.0808498189, 0.5369930267, 0.0391519852, -0.0522328578, 0.1695102602, 0.2841656804, 0.1377081722, 0.1723062545, 0.0890178457, 0.1135611534, 0.1253345162, 0.12432459, 0.415735513, -0.0623390041, 0.3338621557, -0.1436807811, -0.4933610559, 0.2344051003, 0.0853984877, 0.0032412796, 0.094228521, -0.0990343764, 0.1269901246, -0.1194885746, -0.1638170332, -0.1160497963, -0.1618514955, 0.1668629795, -0.0490618721, 0.3370726407, -0.3186075687, -0.0587681048, 0.2334956676, -0.1676666439, 0.2127048671, -0.124830015, -0.1789677143, -0.1150687635, 0.3755523264, -0.1696301252, 0.0814924091, 0.0510556139, 0.2505187392, -0.0093401661, -0.0731734931, 0.0596742481, 0.2454488277, -0.1996546984, 0.1939687431, -0.203810066, 0.1229525656, 0.0725700483, 0.0402919464, -0.0532921664, 0.2882683575, 0.0353524014, -0.1095574126, 0.1736061275, -0.7263828516, -0.2955489457, -0.3641790748, 0.0308193546, 0.0220961273, 0.0343481004, -0.2832488418, 0.0523055643, 0.1293507516, 0.151051417, 0.1038260162, 0.5219675899, -0.3055051863, -0.0818179995, 0.0544116721, -0.3273840845, -0.3867364228, 0.013374527, 0.4593728185, 0.385651052, 0.4869642556, -0.0203827173, 0.0797764659, -0.4213523865, -0.2247266322, 0.200858593, 0.2226726413, -0.0748153552, 0.1745200306, 0.0166827999, -0.3718518019, -0.2864751816, 0.1982577741, 0.1177977845, 0.2160827368, -0.1023505926, -0.4804202616, 0.1640376151, -0.1767151356, -0.0417492464, -0.0790917128, -0.2007601261, 0.2851943374, -0.0058265068, -0.0302389096, 0.3705191612, -0.279882133, 0.2028849721, -0.1104380712, 0.2872951925, -0.2397324741, -0.247444883, 0.2628939152, -0.1447515488, -0.1490289867, -0.1419074982, -0.3319852352, 0.1567607522, 0.53564924, -0.246881336, -0.393258214, -0.1005753055, -0.2145653069, 0.2922898531, 0.2270692736, 0.0891078189, 0.0088778725, 0.163380146, -0.0381373055, -0.1159498021, 0.2437334657, -0.0833874792, 0.1644113213, 0.4508981407, 0.042425938, 0.2239996642, 0.3212422132, 0.2181170285, -0.4716589749, 0.4767278731, -0.104003273, 0.4264329374, 0.032202825, 0.0494236797, 0.2493750006, -0.0998956189, 0.1182434186, 0.2240379602, 0.0198332947, 0.1488360316, -0.1424519718, 0.083224006, -0.0674773902, -0.4802443087, 0.1267700046, -0.2630291581, 0.5065649748, 0.2004100978, -0.1666419953, -0.2821272314, 0.011812456, 0.2048149556, 0.1115637943, 0.1518701464, 0.1114139482, -0.3922576606, 0.1145915613, 0.1744353473, 0.5108853579, 0.0906026661, 0.0278528351, 0.2118859887, 0.000136991, -0.0055029145, 0.0644412339, -0.0107166767, -0.2585108578, 0.0617624819, 0.0170501303, -0.2340940833, -0.3129957318, 0.0051869685, -0.1482113302, 0.215667963, 0.0613825098, 0.0937311277, -0.5858939886, -0.1134346575, 0.305680722, 0.4081916809, -0.1027641296, 0.1559307724, 0.2447595, -0.0840717554, -0.34235847, -0.1207060888, -0.2220965028, 0.1091592386, 0.0774845928, 0.1068611145, -0.406051755, 0.178998068, 0.3230231404, 0.1436013728, 0.5515429974, 0.1673410684, 0.1025036201, 0.1422674209, 0.0629675537, 0.1254570186, 0.5182177424, -0.2743422389, -0.4875462651, -0.112332128, 0.0527321994, 0.3552324772, 0.1335098743, 0.268671304, -0.2644349933, -0.2075333297, -0.3050479591, -0.2465969324, 0.2815005481, -0.0214467254, -0.0089539215, -0.4367783964, -1.003655076, 0.1773265898, 0.2341753691, -0.0221637581, 0.1960072815, 0.0442958362, -0.0561626293, 0.0839706212, 0.1482162178, 0.818590343, -0.2342248708, 0.2623121738, 0.2913030982, 0.2999871671, 0.6729307771, -0.1592319608, -0.2336212546, -0.3155061603, 0.0776639506, 0.0124221398, -0.0548908524, 0.4027070999, 0.2620366812, -0.1770493984, 0.3238633871, 0.2328762263, 0.4149170816, 0.0472154021, 0.2062344849, -0.4215629995, -0.2640069723, 0.0007391305, -0.0266650654, -0.310762316, -0.0222591534, -0.222369954, 0.1319065988, 0.1768974215, 0.1092701554, -0.2893410027, -0.0679774135, -0.2111094147, 0.0153957941, -0.1433984339, -0.4598440826, 0.4378586113, 0.4143337905, 0.2606967092, 0.2978546321, -0.1250859648, 0.0351936743, -0.1367512494, -0.0574590452, -0.2723385096, 0.059876278, 0.2151691765, 0.1179763004, -0.0462157652, 0.123195827, 0.3675066233, 0.1501082033, -0.1939931065, -0.2078892738, 0.3192485273, -0.3471473157, -0.208049044, 0.1136158407, 0.0116935549, -0.0000475521, -0.0354512259, 0.2170707285, -0.0585962459, 0.0365926623, -0.0799800083, 0.0506314263, -0.0118119773, -0.2164822668, 0.2862479985, -0.2448285073, 0.3801531196, 0.053438928, 0.0960258394, -0.12397632, 0.1542888433, 0.2004524171, -0.3535529375, -0.0472874418, 0.04814649, -0.2010810673, 0.1257609576, 0.2455197871, -0.1104495525, 0.041625578, 0.1067189872, -0.2709896863, -0.0621908493, 0.2552555203, 0.0847930089, 0.3913348019, 0.0335183553, -0.0114198206, -0.2339342833, -0.0763870776, -0.1716612428, 0.2520008981, 0.2532116175, 0.202098608, -0.0755687058, 0.0658909082, -0.087356396, -0.0437434278, -0.035981521, 0.1191645116, -0.104586646, -0.0319880247, -0.5068328977, 0.2202413976, -0.020825753, -0.1808734536, -0.0664783493, -0.3200272322, 0.0748324841, -0.4403785765, 0.1769109964, 0.0493835434, -0.0720400214, 0.2194670737, 0.5647689104, 0.057019528, -0.209733367, 0.0016653419, 0.1266693473, 0.4100198746, 0.3731325567, 0.0852252543, -0.1460327953, -0.1167682856, 0.0035767893, 0.2336937636, 0.8808069229, -0.0425564647, 0.2894620299, 0.1379087865, 0.0667547658, 0.1670598835, 0.3605264127, 0.4735854864, -0.0906053632, 0.2389073521, 0.3097980917, 0.002391825, -0.0827838331, 0.0948004723, 0.1694339663, -0.0890066028, -0.1327606142, 0.353659302, 0.184062317, 0.2066233754, -0.1526349038, -0.3317938745, 0.1710799485, 0.0503299125, 0.4426063299, 0.2776347101, 0.0129946992, -0.3771147132, -0.0332408324, 0.3894675374, 0.2786750495, -0.4481980503, 0.2374074757, 0.2064730972, 0.0597751699, 0.2543242276, 0.3961916864, -0.5807133317, -0.0108074229, 0.3840745986, 0.2369928062, 0.352537483, -0.098266542, 0.2982099652, 0.1065693796, 0.0288064983, -0.0740947202, 0.1353555471, -0.0243055131, -0.1885048449, -0.2255787849, -0.3066184819, -0.2714522481, 0.0051428205, -0.2844658494, -0.0392598994, -0.2430736274, -0.0055702175, 0.0913800523, -0.4289429486, 0.0885231271, 0.1282110661, 0.1109811515, -0.027295962, 0.1762392372, 0.2643398643, -0.277235359, 0.304017961, 0.346922636, 0.1574384123, 0.0013450888, -0.0784209594, 0.203794539, -0.2044151425, 0.1393669993, -0.1719985902, 0.0842118561, 0.1782956272, -0.3458365798, 0.2469348013, -0.0179184768, 0.0593673214, -0.0808811113, -0.094252564, -0.2252893448, -0.5750339627, 0.4838288724, 0.2467939407, -0.176669389, 0.1953530759, 0.1366724223, -0.2376326323, -0.4150590003, 0.3314508498, 0.3181429207, -0.0127966953, -0.1789321601, -0.0029141488, 0.1667661816, 0.2657190263, 0.1069094613, -0.1033227146, -0.0076271845, -0.32087937, -0.7505283952, 0.2008837312, -0.1550967693, -0.5894005299, 0.2148177475, -0.1606932729, 0.2775505185, 0.1601596177, -0.2683604956, -0.0050948388, 0.111524649, -0.1754326671, -0.1335080117, -0.5121634603, -0.0151767386, -0.0363658071, -0.1568965018, -0.3666358888, -0.0744641721, 0.0146497618, -0.1392390728, -0.0253696814, -0.1672611535, 0.1073857769, -0.4111956954, 0.0796098262, 0.0811211541, 0.313266933, 0.2124058753, -0.1055361331, -0.2097654939, 0.0714218095, 0.0201072861, 0.3408661783, -0.1046822369, 0.094291389, -0.5658503175, -0.0598276332, -0.2669116259, -0.1238189563, 0.0861119553, 0.1740021408, -0.1259277612, -0.0274493042, -0.354794085, -0.1046490446, 0.3244486153, 0.6672959924, -0.2203668654, 0.0389134809, -0.0882801488, 0.2342379093, 0.3661121428, -0.214735508, -0.3655220866, -0.1902383566, 0.0704677179, -0.2707991004, 0.0472454503, -0.3562131822, 0.1222975552, 0.2829149365, -0.0311341472, -0.1060801446, -0.0718565285, 0.1953956038, -0.1844018996, -0.1983388215, 0.4595989883, 0.1070045382, -0.1265897602, -0.0130086141, -0.1345303357 ]
https://github.com/huggingface/datasets/issues/433
How to reuse functionality of a (generic) dataset?
> Maybe your brat loading script could be shared in a similar fashion? @thomwolf that was also my first idea and I think I will tackle that in the next days. I separated the code and created a real abstract class `AbstractBrat` to allow to inherit from that (I've just seen that the dataset_loader loads the first non abstract class), now `Brat` is very similar in its functionality to https://github.com/huggingface/nlp/tree/master/datasets/text but inherits from `AbstractBrat`. However, it is still not clear to me how to add a specific dataset (as explained in https://huggingface.co/nlp/add_dataset.html) to your repo that uses this format/abstract class, i.e. re-using the `features` entry of the `DatasetInfo` object and `_generate_examples()`. Again, by doing so, the only remaining entries/functions to define would be `_DESCRIPTION`, `_CITATION`, `homepage` and `_URL` (which is all copy-paste stuff) and `_split_generators()`. In a lack of better ideas, I tried sth like below, but of course it does not work outside `nlp` (`AbstractBrat` is currently defined in [datasets/brat.py](https://github.com/ArneBinder/nlp/blob/5e81fb8710546ee7be3353a7f02a3045e9a8351e/datasets/brat/brat.py)): ```python from __future__ import absolute_import, division, print_function import os import nlp from datasets.brat.brat import AbstractBrat _CITATION = """ @inproceedings{lauscher2018b, title = {An argument-annotated corpus of scientific publications}, booktitle = {Proceedings of the 5th Workshop on Mining Argumentation}, publisher = {Association for Computational Linguistics}, author = {Lauscher, Anne and Glava\v{s}, Goran and Ponzetto, Simone Paolo}, address = {Brussels, Belgium}, year = {2018}, pages = {40–46} } """ _DESCRIPTION = """\ This dataset is an extension of the Dr. Inventor corpus (Fisas et al., 2015, 2016) with an annotation layer containing fine-grained argumentative components and relations. It is the first argument-annotated corpus of scientific publications (in English), which allows for joint analyses of argumentation and other rhetorical dimensions of scientific writing. """ _URL = "http://data.dws.informatik.uni-mannheim.de/sci-arg/compiled_corpus.zip" class Sciarg(AbstractBrat): VERSION = nlp.Version("1.0.0") def _info(self): brat_features = super()._info().features return nlp.DatasetInfo( # This is the description that will appear on the datasets page. description=_DESCRIPTION, # nlp.features.FeatureConnectors features=brat_features, # If there's a common (input, target) tuple from the features, # specify them here. They'll be used if as_supervised=True in # builder.as_dataset. #supervised_keys=None, # Homepage of the dataset for documentation homepage="https://github.com/anlausch/ArguminSci", citation=_CITATION, ) def _split_generators(self, dl_manager): """Returns SplitGenerators.""" # TODO: Downloads the data and defines the splits # dl_manager is a nlp.download.DownloadManager that can be used to # download and extract URLs dl_dir = dl_manager.download_and_extract(_URL) data_dir = os.path.join(dl_dir, "compiled_corpus") print(f'data_dir: {data_dir}') return [ nlp.SplitGenerator( name=nlp.Split.TRAIN, # These kwargs will be passed to _generate_examples gen_kwargs={ "directory": data_dir, }, ), ] ``` Nevertheless, many thanks for tackling the dataset accessibility problem with this great library!
I have written a generic dataset for corpora created with the Brat annotation tool ([specification](https://brat.nlplab.org/standoff.html), [dataset code](https://github.com/ArneBinder/nlp/blob/brat/datasets/brat/brat.py)). Now I wonder how to use that to create specific dataset instances. What's the recommended way to reuse formats and loading functionality for datasets with a common format? In my case, it took a bit of time to create the Brat dataset and I think others would appreciate to not have to think about that again. Also, I assume there are other formats (e.g. conll) that are widely used, so having this would really ease dataset onboarding and adoption of the library.
416
How to reuse functionality of a (generic) dataset? I have written a generic dataset for corpora created with the Brat annotation tool ([specification](https://brat.nlplab.org/standoff.html), [dataset code](https://github.com/ArneBinder/nlp/blob/brat/datasets/brat/brat.py)). Now I wonder how to use that to create specific dataset instances. What's the recommended way to reuse formats and loading functionality for datasets with a common format? In my case, it took a bit of time to create the Brat dataset and I think others would appreciate to not have to think about that again. Also, I assume there are other formats (e.g. conll) that are widely used, so having this would really ease dataset onboarding and adoption of the library. > Maybe your brat loading script could be shared in a similar fashion? @thomwolf that was also my first idea and I think I will tackle that in the next days. I separated the code and created a real abstract class `AbstractBrat` to allow to inherit from that (I've just seen that the dataset_loader loads the first non abstract class), now `Brat` is very similar in its functionality to https://github.com/huggingface/nlp/tree/master/datasets/text but inherits from `AbstractBrat`. However, it is still not clear to me how to add a specific dataset (as explained in https://huggingface.co/nlp/add_dataset.html) to your repo that uses this format/abstract class, i.e. re-using the `features` entry of the `DatasetInfo` object and `_generate_examples()`. Again, by doing so, the only remaining entries/functions to define would be `_DESCRIPTION`, `_CITATION`, `homepage` and `_URL` (which is all copy-paste stuff) and `_split_generators()`. In a lack of better ideas, I tried sth like below, but of course it does not work outside `nlp` (`AbstractBrat` is currently defined in [datasets/brat.py](https://github.com/ArneBinder/nlp/blob/5e81fb8710546ee7be3353a7f02a3045e9a8351e/datasets/brat/brat.py)): ```python from __future__ import absolute_import, division, print_function import os import nlp from datasets.brat.brat import AbstractBrat _CITATION = """ @inproceedings{lauscher2018b, title = {An argument-annotated corpus of scientific publications}, booktitle = {Proceedings of the 5th Workshop on Mining Argumentation}, publisher = {Association for Computational Linguistics}, author = {Lauscher, Anne and Glava\v{s}, Goran and Ponzetto, Simone Paolo}, address = {Brussels, Belgium}, year = {2018}, pages = {40–46} } """ _DESCRIPTION = """\ This dataset is an extension of the Dr. Inventor corpus (Fisas et al., 2015, 2016) with an annotation layer containing fine-grained argumentative components and relations. It is the first argument-annotated corpus of scientific publications (in English), which allows for joint analyses of argumentation and other rhetorical dimensions of scientific writing. """ _URL = "http://data.dws.informatik.uni-mannheim.de/sci-arg/compiled_corpus.zip" class Sciarg(AbstractBrat): VERSION = nlp.Version("1.0.0") def _info(self): brat_features = super()._info().features return nlp.DatasetInfo( # This is the description that will appear on the datasets page. description=_DESCRIPTION, # nlp.features.FeatureConnectors features=brat_features, # If there's a common (input, target) tuple from the features, # specify them here. They'll be used if as_supervised=True in # builder.as_dataset. #supervised_keys=None, # Homepage of the dataset for documentation homepage="https://github.com/anlausch/ArguminSci", citation=_CITATION, ) def _split_generators(self, dl_manager): """Returns SplitGenerators.""" # TODO: Downloads the data and defines the splits # dl_manager is a nlp.download.DownloadManager that can be used to # download and extract URLs dl_dir = dl_manager.download_and_extract(_URL) data_dir = os.path.join(dl_dir, "compiled_corpus") print(f'data_dir: {data_dir}') return [ nlp.SplitGenerator( name=nlp.Split.TRAIN, # These kwargs will be passed to _generate_examples gen_kwargs={ "directory": data_dir, }, ), ] ``` Nevertheless, many thanks for tackling the dataset accessibility problem with this great library!
[ -0.052775871, -0.0183875933, 0.1475319266, 0.4042399526, 0.2143376321, -0.0373160057, 0.1315055639, 0.1071479619, -0.2023022771, -0.2372690141, -0.1918664575, 0.4055894315, -0.0635217503, 0.5268571973, 0.4249490499, -0.2587215006, -0.1975935251, 0.1804037839, 0.0004198938, -0.0935177281, -0.0021079201, -0.1374594122, 0.1369737685, -0.0939149931, -0.2226285934, 0.1669852883, -0.2874786854, -0.032390397, 0.1107131839, -0.2528283894, 0.5313691497, 0.3521876037, 0.4683419466, 0.2782883048, -0.0001250765, 0.0179281104, -0.0833464637, -0.1071612164, -0.2715200484, -0.1662045419, -0.2018952817, -0.2514975369, 0.0697828978, -0.2622407973, -0.3338692188, -0.2891655564, 0.083243452, -0.4201814532, 0.4280590713, 0.0142239286, 0.0128907934, -0.133183971, -0.1333250999, -0.1284094602, 0.0282255523, 0.4498722255, -0.1006873846, 0.3456860185, 0.5528989434, 0.2936874032, 0.1292900294, 0.0283970404, 0.1609410495, 0.1065393239, 0.3837429285, -0.0584123358, -0.0705619454, -0.0389486514, 0.0189954266, 0.263891995, 0.8025804758, -0.4108224511, -0.0872107893, -0.1729801744, 0.0247672033, -0.4295552671, -0.2573291361, 0.0599817634, 0.1624981612, 0.0851938054, -0.309995234, -0.3607080579, -0.3834713399, 0.2709828615, 0.3352553546, 0.0396567397, -0.0566549376, 0.2215606719, -0.1515269876, -0.0298042595, -0.0301855803, -0.1971118599, -0.1586643904, 0.1109789833, 0.1712028831, -0.1918717474, -0.3047833443, 0.0230148919, 0.4192992449, 0.4918845296, 0.1451485455, 0.208178103, -0.3522255123, -0.0213295165, 0.4007334709, 0.1259272695, 0.2779958844, 0.3652258813, 0.0427371413, 0.1957388818, -0.3644950688, -0.1703825444, -0.449054271, 0.5557590127, 0.2351503074, -0.1451737732, 0.0688072816, -0.2394081652, 0.1407323629, -0.1055008471, -0.3880718648, -0.1388136297, 0.2200805992, 0.0473228507, 0.0224385541, 0.0921761245, 0.0555786565, 0.2978410423, -0.0114642261, -0.2726377249, -0.004947796, 0.0923362598, -0.418928951, 0.2664706111, 0.3285479844, -0.310305059, 0.16517061, 0.3441129923, -0.0810414329, -0.1708166599, 0.3620075285, 0.1349382102, -0.3155711293, -0.4831868112, -0.233671695, 0.2006832957, 0.2484112233, 0.2031097412, -0.2982755601, -0.0437861532, -0.0155713484, -0.3951827586, -0.1822110265, 0.0121253263, -0.3710016012, -0.0800736248, -0.215222612, 0.4285042882, -0.0043481193, -0.33845824, -0.1976389736, -0.0232476071, -0.3284013867, -0.0783781707, 0.1933832616, 0.273384124, -0.3810254633, -0.1718322933, -0.2532711327, 0.0059723933, 0.4354265928, 0.1614463627, -0.4003019631, 0.287546277, -0.1048992723, -0.1292137057, 0.498453021, -0.0334247723, -0.0209876094, -0.0589338019, 0.1858073175, 0.1797675341, 0.0416483469, 0.0760739669, 0.2536149919, -0.174320966, -0.3745343685, 0.5141626, 0.0862224922, -0.2672064006, -0.0373790003, -0.1952517331, 0.1279141903, 0.0897821933, -0.1702142656, 0.1609875411, -0.0314323343, 0.2894899845, -0.0177520756, -0.2148414999, 0.120002836, -0.1749358177, 0.1473777294, 0.3941199481, 0.1085901186, -0.3249783218, -0.4225758612, 0.1913676709, -0.2947508097, -0.0480473898, 0.4472072423, -0.4088851511, -0.4264882505, -0.1843520254, -0.1645276546, -0.1849023402, 0.0076963371, 0.5292383432, 0.0993564278, -0.1695845723, -0.1643249542, 0.1189450175, -0.1181556061, -0.0168598611, -0.1055912971, 0.253826499, 0.0643547028, 0.0435817726, 0.0140847908, 0.5441200733, 0.1163565964, -0.0754589885, 0.1564704031, 0.1206883714, 0.0370997787, 0.0826742277, 0.1455657929, 0.1017806306, 0.1178468093, 0.1147300079, 0.4078248441, 0.0088950852, 0.3467356861, -0.1688861847, -0.4644252658, 0.1340489239, 0.2337528169, 0.0326773897, 0.0612456538, -0.1139333397, 0.1701097041, -0.1843963116, -0.0612343475, -0.1180029139, -0.0761754885, 0.2510492206, -0.0876888707, 0.3345284462, -0.2914964259, 0.1417695731, 0.1410659254, -0.2346034646, 0.1524759084, 0.0045162123, -0.2224811912, -0.1769359112, 0.3832339048, 0.0758578479, 0.1644234061, 0.0378482491, 0.2431354225, 0.0694825649, -0.1100003719, 0.0444387048, 0.2112405747, -0.1673853844, 0.1849933416, -0.2379213572, 0.1198143512, 0.1696003377, 0.0800334141, -0.0412704386, 0.3497785032, 0.1414007097, -0.1712507904, 0.2018590271, -0.6481920481, -0.3009235263, -0.3514767289, -0.0437038913, 0.0139786461, 0.0545265116, -0.1946784407, 0.0467866771, 0.1307187825, 0.1342967898, 0.1131122857, 0.4815164208, -0.3766596019, -0.1216215938, 0.0801851675, -0.2995165586, -0.3330662847, 0.0063180411, 0.4122458696, 0.3769207001, 0.5545409918, 0.0870393142, 0.0290550794, -0.4986232221, -0.2839492857, 0.2014662921, 0.0905629396, -0.0397650637, 0.1327046603, -0.0485135466, -0.3301450312, -0.3042163849, 0.1590517759, 0.0961803272, 0.1809403598, -0.0600808598, -0.4992726445, 0.121142745, -0.1876281798, -0.1224417016, -0.1508994102, -0.1992625147, 0.2833752632, 0.0598631054, 0.0701043159, 0.3311741054, -0.3769754767, 0.2394534647, -0.045057144, 0.2134192586, -0.3368491232, -0.1046839207, 0.2901273072, -0.1467798054, -0.1852175146, -0.0646870583, -0.332831651, 0.1002840996, 0.5816043615, -0.1899225861, -0.43330881, -0.0709263906, -0.1931770891, 0.3352113962, 0.2023749352, 0.1774219871, -0.0302753877, 0.1482477337, -0.024656577, -0.22927472, 0.3347117305, -0.0698231682, 0.2151488364, 0.3179882765, 0.1364472359, 0.1477783322, 0.4958409965, 0.1994639188, -0.3975555897, 0.4418988228, -0.0755605847, 0.2939327359, 0.0919932127, -0.027579166, 0.2489296496, -0.1203067675, 0.0949378014, 0.1931626201, 0.0448028408, 0.025068203, -0.0283335317, 0.0092361197, -0.0035295885, -0.436378181, 0.1996439397, -0.1517347693, 0.5237366557, 0.1381768882, -0.2355801314, -0.3791065216, 0.0496141016, 0.1934672147, 0.1337410361, 0.0738769323, 0.1643585563, -0.4970506728, 0.0758114979, 0.1406283081, 0.4142274857, 0.0856037289, -0.0225957613, 0.1782040745, 0.0315712467, 0.0914834812, 0.0926707983, -0.048135031, -0.2960967422, 0.0075227804, 0.1244783252, -0.3474842906, -0.2607430518, 0.0564994477, -0.1145012155, 0.1813012064, 0.1208534911, -0.0085929623, -0.6265864968, -0.0859771147, 0.4911958873, 0.3378352821, -0.1173984781, 0.0225376748, 0.3983535171, -0.1619605124, -0.4426511526, -0.1478759795, -0.167422533, 0.0900757909, 0.1807972491, 0.120010823, -0.3284374774, 0.2297535539, 0.3346862197, 0.1229013279, 0.4285552502, 0.2178944051, 0.085956946, 0.0995594785, 0.0065949704, 0.0419077612, 0.4521705806, -0.286328584, -0.4647591412, -0.1230598912, 0.043988023, 0.2652991116, 0.1608946174, 0.3431628048, -0.0893262252, -0.222725749, -0.501960516, -0.2145174742, 0.2109345496, -0.0418745354, -0.0549858175, -0.3572918773, -1.0777641535, 0.3356915116, 0.1809640974, -0.0971046314, 0.1761039644, 0.1328939945, -0.1349575222, 0.1247947589, 0.0295262188, 0.9321959019, -0.1772609651, 0.2380484343, 0.3661993444, 0.2965843678, 0.7135196328, -0.1419454962, -0.2076851279, -0.3434432149, 0.2142760307, 0.0496632047, -0.0595828407, 0.2961930335, 0.2053503841, -0.1560037136, 0.2518340647, 0.2036560327, 0.4291244745, 0.1284232736, 0.2230033875, -0.2504244149, -0.3115477264, -0.132267341, 0.0115680955, -0.320679903, 0.0376145206, -0.173849076, -0.0039350255, 0.01704471, 0.1563146412, -0.4413563609, 0.0136804767, -0.2030916512, 0.0191738345, -0.0973054692, -0.4997604787, 0.4716841578, 0.1864796132, 0.3057286739, 0.2079539299, -0.1851715147, 0.0395432785, -0.2062276602, -0.0801258758, -0.2003693879, 0.0007409226, 0.2439533919, 0.0106171975, -0.0298101548, 0.098159261, 0.3809090555, -0.0212845076, -0.1528526098, -0.2496741116, 0.3948432207, -0.3585498333, -0.2738019824, 0.2733775675, 0.0186457597, -0.081173934, -0.0242215823, 0.3156312108, -0.1783572882, -0.0747335106, -0.1993065178, 0.1323684156, -0.0118838772, -0.3328547478, 0.318777442, -0.2915683985, 0.3401267827, 0.1281150877, 0.112278156, -0.0593237728, 0.0284578539, 0.2757188976, -0.4038212299, -0.1267393678, 0.1086641997, -0.2364015281, 0.0819725394, 0.1765654236, -0.1015784144, 0.0840266943, 0.0360076427, -0.2625138164, -0.1277979016, 0.1553675681, 0.0030011646, 0.3532755375, 0.0457552522, -0.0100790337, -0.1774008274, 0.0435954891, -0.1735629588, 0.1767266244, 0.160153389, 0.1843807101, 0.2037212849, 0.057677675, -0.101583384, -0.1093996763, -0.0787589327, 0.070125483, -0.1479989886, -0.0097601907, -0.5596264005, 0.2132186294, 0.0571900159, -0.1296144426, -0.0371963121, -0.264562279, 0.1283727884, -0.348279804, 0.2246415317, -0.0293613859, -0.0460955799, 0.1597708911, 0.5605435371, -0.0127614951, -0.2915022969, 0.0097552016, 0.1320860535, 0.4077636302, 0.4412095547, 0.0612203032, -0.1038740128, -0.1245041117, -0.0271415953, 0.2084719092, 0.7593999505, 0.0702520534, 0.3213882148, 0.1391650438, 0.1181172132, 0.2112983465, 0.1848991811, 0.4557940364, -0.0918234661, 0.2779636979, 0.2086735964, -0.0071701678, -0.0895721763, 0.1609559804, 0.2544288933, -0.1813841015, -0.1500154287, 0.3750500083, 0.1749407053, 0.2845787108, -0.1489907354, -0.2645765543, 0.2097460926, 0.0274870545, 0.3904094696, 0.1939254701, -0.01204067, -0.2825768292, -0.0412244685, 0.4000238478, 0.2880564928, -0.4512825608, 0.2234054208, 0.2511084676, 0.1872940063, 0.1809878945, 0.5107918382, -0.4333376884, -0.0405470617, 0.4104093611, 0.3606263399, 0.2895862162, -0.0849083662, 0.2871321738, 0.1232730746, 0.0652576908, 0.0793493688, 0.2252431959, 0.0982777253, -0.0702172443, -0.2390364259, -0.2490397692, -0.3212158084, -0.0558159463, -0.3482564092, -0.1666559428, -0.1457806677, -0.0525198579, -0.0341504999, -0.4228684306, 0.0582166575, 0.1503517628, -0.0318880156, -0.0337350219, 0.1851817816, 0.1267453134, -0.3633871973, 0.225513801, 0.3972000182, 0.1097614914, 0.0152249457, -0.0066317827, 0.2950597107, -0.1489103884, 0.1632120907, -0.1375660598, 0.0216870252, 0.1722300351, -0.2595816851, 0.135803476, -0.0716032609, 0.0557164885, -0.1894649565, -0.012652358, -0.1854282469, -0.4377537072, 0.6592111588, 0.2342059612, -0.2106865942, 0.1065579131, 0.2138051689, -0.1598931104, -0.3499534726, 0.4518505335, 0.3653379977, -0.0347415544, -0.2207173407, -0.0010923068, 0.1904410422, 0.2138691097, 0.0775151104, -0.1051168963, -0.0865744203, -0.2625460923, -0.719250083, 0.2276404798, -0.1733564436, -0.6922211051, 0.2622717023, -0.1413421482, 0.3419551253, 0.1014136896, -0.2939866781, -0.0348931737, 0.0552135967, -0.2313893735, -0.1737841517, -0.4438752532, 0.0258594882, 0.0515153445, -0.1029372811, -0.2471004277, -0.0737906545, 0.0714301467, -0.1363352686, 0.0353094749, -0.1981963962, 0.1184597239, -0.4753555059, 0.1128878444, 0.1332098842, 0.2694588006, 0.1883932203, -0.0659007356, -0.2441362441, 0.0553752519, -0.1352281868, 0.2859679759, -0.1012536213, 0.0479668938, -0.5305738449, 0.0068746293, -0.2922242284, -0.1701010466, -0.0079451799, 0.0704061016, -0.1326499879, 0.1036818996, -0.3454539776, -0.0599827021, 0.3603954911, 0.5799031258, -0.2321650237, 0.0223562159, -0.1516488492, 0.193975091, 0.3261487484, -0.2340168059, -0.4163008928, -0.062205974, 0.0432803817, -0.2508487403, 0.0315814316, -0.5333892107, 0.0338165984, 0.2631512284, -0.0209531784, -0.1001887769, -0.0299170371, 0.2262380272, -0.2082660049, -0.1614113152, 0.4423398674, 0.0793695673, -0.0737433806, 0.0107917245, -0.1659827083 ]
https://github.com/huggingface/datasets/issues/426
[FEATURE REQUEST] Multiprocessing with for dataset.map, dataset.filter
Yes, that would be nice. We could take a look at what tensorflow `tf.data` does under the hood for instance.
It would be nice to be able to speed up `dataset.map` or `dataset.filter`. Perhaps this is as easy as sharding the dataset sending each shard to a process/thread/dask pool and using the new `nlp.concatenate_dataset()` function to join them all together?
20
[FEATURE REQUEST] Multiprocessing with for dataset.map, dataset.filter It would be nice to be able to speed up `dataset.map` or `dataset.filter`. Perhaps this is as easy as sharding the dataset sending each shard to a process/thread/dask pool and using the new `nlp.concatenate_dataset()` function to join them all together? Yes, that would be nice. We could take a look at what tensorflow `tf.data` does under the hood for instance.
[ -0.275944382, -0.2842457891, -0.2022301257, -0.1166618764, -0.2691854537, 0.1010131091, 0.2325938344, 0.3550626338, -0.0165042989, 0.061669495, -0.1445137411, 0.3324526548, -0.1353508532, 0.4115585089, 0.0130814957, -0.2661807537, 0.0175814647, 0.103248097, -0.1281685829, 0.1098900437, 0.0762667879, -0.0655459538, -0.1153078377, -0.0926847309, -0.1322971433, -0.102455087, -0.0975713506, -0.2020662576, 0.1825311035, -0.0591967367, 0.081919089, 0.4362560511, -0.1955321729, 0.3209601343, -0.0001035186, -0.0330525264, 0.0230350345, 0.1411821544, 0.0554774962, 0.1950993389, -0.2407265604, -0.3496340811, 0.0154762967, -0.2446848601, 0.1141091436, 0.1449300349, 0.2296796441, -0.2520438433, 0.151098758, -0.1482695937, 0.1650044918, 0.3244564533, -0.1013419852, 0.3549085259, -0.1160895973, 0.2881201506, -0.1332562864, -0.273955524, 0.4300306439, -0.1658627242, -0.1933046728, 0.4834127724, -0.2048954964, 0.184104979, 0.1868391037, -0.0659239963, 0.0773280263, -0.4097802639, -0.1818063855, 0.4087256491, -0.0675884113, -0.2307182401, -0.4504496157, -0.2789042294, -0.1264074892, -0.4070109725, -0.2271302342, 0.0858732015, -0.2099239379, -0.0233109221, -0.4120799899, -0.3114107847, 0.1997832656, -0.0812530667, 0.1616560817, 0.361392349, 0.2724674642, 0.1311333477, 0.191937089, -0.1969309151, -0.056466382, -0.2537737191, 0.3110476434, 0.0066750282, -0.6924259663, -0.1842932999, 0.0167127308, -0.2867715955, -0.0392808169, -0.0706893727, 0.1534596086, 0.3635828793, 0.0018449632, 0.2756718397, 0.009638519, -0.3759274483, 0.0630588159, -0.0125333704, 0.1332937628, -0.4187015891, -0.2308539003, 0.2932200134, 0.1267776936, -0.0834782049, -0.2717576027, 0.0474014841, -0.0980957001, 0.2626231015, 0.0492145345, -0.4000425637, 0.0890795663, -0.1915700734, 0.1827961951, -0.036447458, -0.0701017901, 0.3581656218, -0.1625252813, -0.2483625263, -0.1925840229, -0.1561346352, -0.0763624534, -0.0069031552, 0.062629953, 0.1361533105, 0.1571870893, 0.1219407022, -0.1967087686, 0.0479607955, 0.1393325031, 0.3047914505, 0.3225726783, -0.1254655719, 0.0392490551, 0.1707833111, -0.1373327076, -0.1019913703, -0.145403713, 0.085971877, -0.3219798207, -0.0447810218, -0.3592562675, -0.2022034526, -0.0783007368, 0.1522817761, 0.1580554992, -0.0834567472, -0.2392238081, 0.7270878553, 0.1221744567, -0.0139262537, -0.3829066157, -0.1173574328, -0.5056694746, -0.2212934643, 0.3403015137, -0.0071710902, -0.0925391391, -0.0244391244, -0.2103012949, -0.0364558548, 0.2022961676, 0.3431307077, -0.1650480479, 0.2029749602, -0.0161114354, 0.4196081758, 0.5856342316, -0.1346534938, 0.1360910535, 0.3772717118, -0.1753327996, 0.0519079231, 0.23914361, 0.1840673685, 0.150653556, -0.1263087839, 0.1601601094, 0.4892567396, -0.3131013811, 0.2583974004, 0.0568522327, -0.221428737, 0.1675421298, 0.163731873, 0.0658375323, 0.0036607126, -0.1034324393, -0.3204092979, 0.3190240264, -0.3128891587, 0.0569214113, 0.0483361222, -0.1053902656, -0.0348552577, -0.125904575, -0.3479109704, -0.3173055649, 0.1093391106, 0.0865778327, -0.0670086518, 0.1533924639, -0.3714463115, 0.4874789417, 0.12219394, 0.1755739003, 0.2396431863, 0.1801890582, 0.2371762246, 0.0878022984, -0.2353841662, -0.2851776779, 0.1088110134, -0.1383733004, -0.1427969933, -0.1061127484, 0.24675937, 0.2857476175, -0.1014982089, -0.0214308463, 0.133170262, -0.1547441185, -0.1268596649, 0.1578130722, -0.0227403436, -0.0729567781, 0.3669100702, 0.4954013824, 0.5253914595, 0.1801846176, 0.1083615273, -0.1301072538, -0.2087200433, -0.1430886984, -0.2054136395, -0.1446281672, 0.4666018486, -0.066856809, 0.3619407713, 0.1625887156, -0.0146637522, 0.2380343676, 0.0549204163, -0.0770052597, 0.233334735, 0.0734030977, -0.1057647094, -0.039708335, 0.1877187937, -0.4425650835, 0.3263514042, 0.5805600286, 0.1085755974, -0.0362416394, 0.1326856613, 0.2328306735, -0.0102919545, 0.1181015223, 0.1348210126, 0.1647723764, 0.1919314116, 0.1233763173, -0.092678614, -0.0140283359, 0.00753533, 0.1509766132, 0.2267987728, 0.2975919247, 0.0732769445, 0.0710347444, -0.1913867593, -0.116714038, -0.3844874799, 0.242283985, 0.0336245671, 0.022234695, -0.0753340274, -0.2187238783, -0.083965227, 0.0200216286, 0.1564753503, -0.1084874719, -0.279620707, 0.037579257, 0.2110375464, -0.1723946184, 0.1639952958, 0.1517232656, 0.1216599494, -0.0795262456, -0.0444305763, -0.173115775, -0.1128003746, 0.1154031456, 0.0780868754, 0.3604660928, 0.2093340456, 0.4150374532, 0.2297144383, 0.1016196385, -0.3085977137, -0.3013167679, -0.0605729707, -0.2326069474, 0.0706914887, -0.0197262727, 0.0140116103, -0.2078685313, -0.4240693152, 0.1349759102, 0.1233985424, -0.1107924432, -0.1494639367, 0.0558031127, 0.0630634725, -0.074237451, -0.2053209096, -0.5143826008, -0.4376355708, 0.366953522, -0.3244443834, 0.3497664034, -0.1991968304, 0.0240950435, -0.0096493196, -0.1741123945, 0.083780475, 0.1551626027, -0.4178403616, 0.1165354997, -0.0766956881, -0.116913259, -0.3409132659, -0.0333877318, 0.0715976432, 0.4641478956, -0.2137115449, -0.0585737899, -0.2273507118, 0.1493424624, 0.1650556922, -0.0818078965, 0.1073485464, -0.0158897415, -0.1121383309, 0.0774197131, -0.1644627452, 0.0516898483, -0.0614814088, -0.295974046, 0.2579025626, 0.3612659872, 0.1235008091, 0.7081289887, 0.114364095, -0.2318824977, -0.0408287644, 0.0727381855, -0.2688435316, 0.2038411796, -0.4948341548, -0.0708802193, -0.1688324511, 0.108511202, 0.093162626, -0.1084736958, -0.419706285, -0.0343334861, 0.2127262354, -0.1820171177, -0.1730897278, 0.2890792787, -0.3016252816, 0.3059793711, 0.0404461436, -0.2821752131, -0.4290572405, 0.0758816078, -0.153570056, 0.000131165, 0.2750861943, -0.1826772094, -0.3942540586, -0.2149476558, -0.4903291762, 0.3338409662, 0.1873452663, 0.1052180976, -0.0175467953, 0.0272646658, -0.0534175038, -0.1533873975, 0.5795544386, -0.3685049713, -0.2850636542, 0.253796488, -0.4896869957, -0.0196861699, 0.222805202, -0.0259725861, 0.4166380763, 0.3337049782, 0.4109072089, -0.2376558781, -0.4871218204, 0.1558927596, 0.0219493695, -0.0720125139, 0.0266815852, -0.0253531877, -0.0449183434, -0.1176819429, -0.0097692972, -0.0658999085, -0.0280596577, -0.0187598504, -0.1868539602, -0.1646325141, 0.0536766946, 0.3366569877, 0.0215824004, -0.1456779838, 0.3455347121, 0.2921153605, -0.2915529311, 0.1141728088, -0.087481007, -0.1014221311, -0.1853516847, -0.1297589689, -0.0313218497, -0.0368647352, 0.522208333, 0.093092978, 0.1535839289, 0.3920104504, -0.1096462235, 0.4256866872, -0.2488380969, 0.1663351953, 0.3916358948, 0.2579732835, -0.2799406052, -0.3690030277, 0.2246361226, 0.2787814438, 0.0205802172, 0.5443373919, -0.2962473333, -0.0203336254, 0.2075712532, 0.0824857354, 0.5658167005, -0.3810485005, 0.0208448526, -0.2761301696, 0.1997948736, 0.4320566654, -0.4796615839, 0.196735099, 0.0666372553, -0.3153506517, 0.0637310669, -0.005826442, 0.1173133254, 0.4264533222, -0.1951822937, 0.0736682042, 0.3178192675, -0.036403928, -0.0825516135, 0.4622342885, 0.2771172523, -0.3780422807, -0.0919995457, 0.1073800176, -0.0745100603, -0.3487041593, 0.0642074347, -0.2750184536, 0.160348773, 0.3369334936, -0.3123576343, -0.1006101966, -0.0329275988, 0.4128577709, -0.2716253698, -0.0356822871, -0.0980778709, 0.1445016861, -0.0621918365, -0.0515227839, -0.0887070224, 0.0366986506, -0.140647009, 0.3195924163, -0.2093700171, -0.3096980155, 0.2303261459, -0.1214027777, -0.1893569678, 0.0026278724, 0.1380225271, -0.5908480287, -0.1397264451, 0.0934134796, 0.0945590287, 0.4548112452, 0.1122353449, 0.3758342862, -0.3117883503, -0.0755105242, 0.1418021321, 0.2096755952, -0.1527108401, 0.5664058328, 0.0669872388, -0.1376769394, 0.0543280058, 0.0388535112, 0.3187231719, 0.0386624113, 0.2706736624, 0.154133141, -0.137808755, -0.2728895545, -0.1065817103, -0.2155001462, 0.0848815516, 0.2780232728, -0.1531940848, -0.1919222176, 0.1020033583, -0.1520499736, -0.1595100611, 0.1164392903, -0.2900215685, -0.152367115, -0.1031882018, 0.099868834, -0.1188061386, 0.2155809253, -0.079477936, 0.1791787744, -0.0537460111, 0.5050321817, -0.3481151462, -0.1349556744, -0.164722085, 0.1981511116, 0.3397385478, 0.0221189223, -0.0613249615, 0.2210674733, 0.1781974882, 0.1315310001, -0.1826764494, -0.3112727702, 0.1795540452, 0.0597394221, -0.1320134401, 0.0578906536, 0.1754209846, 0.1522130668, -0.3791619837, -0.3611778021, 0.0145176901, -0.0904417038, -0.0286885835, 0.0797054991, 0.1471129954, -0.2112825811, 0.2349595726, -0.0554061607, 0.1310698241, -0.0193429179, -0.138555631, 0.3766927421, 0.1650498509, -0.1514665782, 0.1522015482, -0.0971622095, 0.1188128963, -0.1742066294, 0.2069411278, 0.063536264, -0.2430645972, -0.0912083611, 0.2783662081, 0.3514908552, 0.1390750855, 0.2302771509, 0.0571814589, 0.1735035479, -0.1607591808, -0.1503106803, 0.5617012978, 0.0002525711, 0.3441426158, -0.0869363844, 0.111255452, 0.4852908552, 0.1047266498, -0.068694979, -0.1232323647, -0.3425773978, 0.0975729451, 0.0001645968, 0.2361602783, -0.0399692617, -0.1033607125, 0.0276409537, 0.1377209276, 0.1111186296, 0.0776179805, 0.7436552644, -0.1332690567, 0.1466139704, 0.2358625382, -0.2185105383, 0.1554217637, 0.1508917212, 0.0706596747, 0.2849659026, 0.1042454541, 0.083624132, 0.1157594621, -0.5258512497, -0.162217021, 0.6554818153, -0.0517865196, -0.3350933194, -0.0595476851, -0.0637190714, -0.055397667, 0.0772390068, 0.189080596, 0.1039633751, 0.5785469413, 0.0631637424, 0.4233324528, 0.0217111856, 0.1380326301, -0.1756116301, 0.3721529245, -0.0519325733, -0.1600176394, 0.1439989209, -0.2131200433, -0.2313864529, 0.3223556876, 0.1182819828, 0.2578310966, -0.0606110692, 0.342115283, -0.257909596, -0.0363842212, -0.2379800826, 0.2340900153, -0.021660896, 0.0199266989, 0.4125622809, 0.1230831817, -0.1453163475, -0.2635043859, -0.0451858714, 0.0962262154, -0.411208123, 0.0877634883, 0.1337745339, -0.1602257788, 0.0140000917, 0.0020579444, -0.3977245986, -0.2798149586, 0.7091531157, -0.5511263609, -0.0335207246, 0.0124388002, 0.1236991212, -0.2153755277, 0.6456467509, 0.0827540606, 0.3928981125, 0.0056271092, -0.1644992977, -0.4179257751, -0.262940228, -0.0663556606, 0.1159652844, 0.1230999529, 0.4917398393, 0.2183326036, 0.3176272511, 0.0032262928, -0.4619166851, 0.0243652184, 0.0811447874, -0.4527284503, 0.118648544, -0.3704133928, -0.0622873269, 0.1752676219, -0.3342030942, 0.2675735354, 0.1106447801, 0.1272593886, -0.212743178, 0.1328649521, 0.493816942, 0.15213193, 0.0125988303, 0.0098243272, 0.3086355627, -0.3062483072, 0.0071036639, -0.114812091, 0.096217148, -0.1907645613, 0.0032969119, -0.043302279, 0.3226055205, -0.2178198993, 0.0597905554, -0.0545968674, 0.103894107, -0.1082259417, -0.1784220487, 0.1569594741, 0.0113974242, 0.1666018516, 0.1770831198, -0.0151794562, 0.3487411439, -0.0062883203, 0.0953627005, -0.104533039, -0.0823693722, 0.242010057, -0.455522269, -0.223168537, -0.2831245065, 0.0669718012, -0.034916535, 0.4219540954, -0.3687782884, -0.3382133245, 0.2574602664, -0.0874075517, -0.0455558747, 0.5557898879, 0.0016173163, -0.2452809811, -0.1554077417, -0.2612408698, -0.0094333058, -0.3534401655, -0.1483713835, -0.2303102911 ]
https://github.com/huggingface/datasets/issues/426
[FEATURE REQUEST] Multiprocessing with for dataset.map, dataset.filter
So `tf.data.Dataset.map()` returns a `ParallelMapDataset` if `num_parallel_calls is not None` [link](https://github.com/tensorflow/tensorflow/blob/2b96f3662bd776e277f86997659e61046b56c315/tensorflow/python/data/ops/dataset_ops.py#L1623). There, `num_parallel_calls` is turned into a tensor and and fed to `gen_dataset_ops.parallel_map_dataset` where it looks like tensorflow takes over. We could start with something simple like a thread or process pool that `imap`s over some shards.
It would be nice to be able to speed up `dataset.map` or `dataset.filter`. Perhaps this is as easy as sharding the dataset sending each shard to a process/thread/dask pool and using the new `nlp.concatenate_dataset()` function to join them all together?
47
[FEATURE REQUEST] Multiprocessing with for dataset.map, dataset.filter It would be nice to be able to speed up `dataset.map` or `dataset.filter`. Perhaps this is as easy as sharding the dataset sending each shard to a process/thread/dask pool and using the new `nlp.concatenate_dataset()` function to join them all together? So `tf.data.Dataset.map()` returns a `ParallelMapDataset` if `num_parallel_calls is not None` [link](https://github.com/tensorflow/tensorflow/blob/2b96f3662bd776e277f86997659e61046b56c315/tensorflow/python/data/ops/dataset_ops.py#L1623). There, `num_parallel_calls` is turned into a tensor and and fed to `gen_dataset_ops.parallel_map_dataset` where it looks like tensorflow takes over. We could start with something simple like a thread or process pool that `imap`s over some shards.
[ -0.3959477246, -0.3589048088, -0.1633281559, -0.1043199748, -0.2803542912, 0.1315264553, 0.2860784531, 0.2982308269, 0.0233870875, 0.0550605319, -0.1639015675, 0.327960819, -0.0940096527, 0.3442828059, -0.1141018569, -0.1108683273, -0.0506922305, 0.0559119321, -0.0223452672, 0.0690452978, -0.070098117, -0.0351479687, -0.110268414, -0.2142753899, -0.1099676117, -0.1081891656, -0.03030256, -0.12129125, 0.2324786335, -0.0245665405, 0.1026776135, 0.461317718, -0.2688800693, 0.3424683511, -0.0001032941, 0.0418284014, -0.0300087444, 0.0868737027, 0.0992647782, 0.1611693054, -0.2120831758, -0.2810766399, -0.0511216223, -0.2975958288, 0.0698214471, 0.1315264106, 0.2037039697, -0.2799983323, 0.2039439231, -0.120309785, 0.144079417, 0.422590822, -0.0239605382, 0.2986966968, -0.2356482595, 0.1569114625, -0.1393169463, -0.1624263972, 0.3427732289, -0.2062585354, -0.1268125027, 0.4884386659, -0.259321034, 0.2763181031, 0.1230533198, -0.0430889577, 0.0226267688, -0.4618025422, -0.1920103878, 0.3221646249, -0.1607880145, -0.1975749433, -0.4645855725, -0.3551501334, -0.1647724658, -0.3611131907, -0.1993352473, 0.0582984947, -0.2181826532, -0.0167479236, -0.3532602489, -0.2185587138, 0.1069771051, -0.1390844434, 0.0176802985, 0.3166689575, 0.3593287468, 0.1542654335, 0.2229838073, -0.1610964835, -0.1056810468, -0.1764622033, 0.3239943087, 0.1019217297, -0.712408483, -0.2153792977, 0.0315664001, -0.3484633267, -0.0871073976, -0.0917286649, 0.0713716298, 0.3659611642, 0.0206587389, 0.2957698703, -0.0312646665, -0.4160399735, 0.0468206517, 0.0443537757, 0.1093432009, -0.4134152532, -0.1735184193, 0.2978518605, 0.0914850384, -0.086381413, -0.2096261382, 0.0468083397, -0.0589464493, 0.2689777911, -0.0146426372, -0.3458237648, 0.0569182336, -0.11129006, 0.1320362836, -0.0379310213, -0.0666669011, 0.2931642532, -0.0731021911, -0.2985050678, -0.3626378477, -0.0711500645, -0.1218413636, -0.0188443717, -0.0068020183, 0.1827819645, 0.1765121818, 0.1731297374, -0.2708666623, 0.0147010144, 0.1303202063, 0.3093436956, 0.3430286348, -0.1882892698, -0.0362691507, 0.2379076183, -0.1522755325, -0.1348415166, -0.0187119003, 0.10122177, -0.2487322837, -0.0216226149, -0.3682626784, -0.2509815395, 0.0032872749, 0.161847502, 0.0316620395, -0.1213389412, -0.2477228343, 0.6351501346, 0.1733303815, 0.0539811552, -0.4437560439, -0.1052970439, -0.6214119196, -0.2067535669, 0.3430371881, 0.0838771462, -0.1477433145, 0.0057000876, -0.1197174191, -0.0573703088, 0.1628469825, 0.3418939114, -0.0894844532, 0.079634808, 0.0038425408, 0.4780184627, 0.36858055, -0.1520615369, 0.020993948, 0.3077547848, -0.2115902454, 0.0637926981, 0.2098009288, 0.1910683066, 0.2824667096, -0.2052376866, 0.1804118603, 0.5076909661, -0.253885597, 0.2780779898, -0.0517070256, -0.2002610713, -0.0244692415, 0.3239070773, 0.1461586207, -0.0261236783, -0.1242438629, -0.3164180517, 0.3325300515, -0.1800849736, 0.0445957892, 0.0815768689, 0.0334729366, 0.0663520992, -0.0954743028, -0.3216048479, -0.3459462821, 0.2422726303, 0.1438237578, 0.082545355, 0.0948248208, -0.3457755744, 0.4237270057, 0.1098071635, 0.1453586221, 0.2596763372, 0.2118770331, 0.1120653525, -0.0073612412, -0.2629690766, -0.2826954126, 0.2408763766, -0.2067617923, -0.1024323255, -0.1578763574, 0.332416594, 0.2522997856, -0.154769361, -0.1125106812, 0.1080855429, -0.096147418, -0.1481084526, 0.1552658379, 0.0421343781, 0.0071302024, 0.4032180011, 0.3985294402, 0.5866166353, 0.2142300755, 0.1764785647, -0.1187570095, -0.2487889379, -0.1447887272, -0.1825560331, -0.0806524232, 0.4537779689, 0.0177680682, 0.427516818, 0.1542968005, 0.0031852724, 0.1733979732, 0.0105934413, -0.027599819, 0.2379274666, 0.1078170761, -0.1230464354, -0.062701188, 0.1927462965, -0.2868268192, 0.3883139789, 0.5061118603, 0.1174508408, -0.1138853803, 0.0805553645, 0.2276956439, 0.024080554, 0.0678066611, 0.251111269, 0.2452668697, 0.1791778803, 0.1480734944, -0.0011039681, -0.0717214942, 0.0195030961, 0.1289647818, 0.2748678923, 0.3190975785, -0.0208058991, 0.0697429031, -0.1868712455, -0.12359, -0.420042932, 0.299780935, 0.1124174371, 0.0483124331, -0.0575495213, -0.1074937955, 0.1269657165, 0.0162724853, 0.1375829428, -0.0727733821, -0.304138571, 0.0181807224, 0.366722703, -0.0663112774, 0.1369047463, 0.1925065964, 0.0463772379, -0.0803008527, -0.1121405363, -0.1769387573, -0.2440681905, 0.2080888748, 0.0885314569, 0.3739581406, 0.1900402755, 0.4317305982, 0.1747725308, -0.0021739749, -0.1536820829, -0.2592749298, -0.0543095917, -0.2863564789, -0.0191689935, -0.0316724405, 0.1141082197, -0.2228769213, -0.3058833778, 0.172451213, 0.0046107946, -0.0688406974, -0.1139104888, -0.012707361, 0.0893528163, -0.0477355123, -0.2503354549, -0.5684006214, -0.4092233777, 0.3266500235, -0.2324374765, 0.3775834441, -0.0547008999, 0.0361393951, -0.0018445174, -0.1080200747, -0.0059895013, 0.0841722414, -0.2796822488, 0.1081385985, -0.0342622958, -0.1321189553, -0.2544579506, -0.0246626325, 0.079669863, 0.5135450363, -0.1619198322, -0.1321911961, -0.2244547904, 0.11937958, 0.1274668872, -0.0757752731, 0.1937648207, 0.023846617, -0.1134343073, 0.0619438775, -0.0049562482, 0.1277588308, -0.0798964351, -0.3843891323, 0.2287477553, 0.3610132933, 0.1952296197, 0.7414988875, 0.1890398264, -0.317826122, -0.0958653986, 0.0290845074, -0.2857872546, 0.1605230421, -0.4328311086, -0.081465967, -0.0768271536, 0.0475001149, 0.0460654125, -0.1417331994, -0.4039616883, -0.0671353415, 0.1964143962, -0.2161606699, -0.2535505593, 0.2536225021, -0.1575147063, 0.2934394181, 0.0309126619, -0.245630756, -0.4624834657, 0.0370785296, -0.1610602289, 0.0008600953, 0.3101626635, -0.2374070585, -0.303689003, -0.1044950858, -0.5077471733, 0.3355197906, 0.0779228657, 0.1264088899, 0.0412264913, -0.0216401741, 0.0204039365, -0.1583375782, 0.618436873, -0.3220214546, -0.2553035021, 0.2162013203, -0.4241092503, -0.1754308939, 0.1810814887, -0.0449715666, 0.3480900526, 0.3188769519, 0.4349923134, -0.3314709961, -0.4567175806, 0.1255398542, -0.028090002, -0.0977557749, -0.0610610731, -0.1144475043, -0.074312076, -0.1976044625, 0.0487016104, -0.0044868728, -0.045344796, -0.0092504025, -0.1380379498, -0.1529383659, 0.0189390648, 0.2857367396, 0.1053524092, -0.107766144, 0.2979786098, 0.3880725205, -0.1602470279, -0.0859045982, 0.0324032083, -0.0230685119, -0.0851469189, -0.1626369953, -0.0577275567, 0.0524094403, 0.4032557011, 0.0532750152, 0.1544160098, 0.2574467957, -0.1386050582, 0.4407036901, -0.2465183288, 0.1414555758, 0.2674776018, 0.2806444764, -0.216759637, -0.4176125824, 0.228366822, 0.2824578583, 0.0356750563, 0.5328615904, -0.2536227107, 0.0068782642, 0.3022964299, 0.109884195, 0.5154479742, -0.4857496917, -0.0372981317, -0.2026860714, 0.3226900697, 0.393073231, -0.558809042, 0.2324301749, -0.0293803532, -0.3676803112, 0.0822342932, -0.0416129455, 0.1130398065, 0.4261125922, -0.1032330543, 0.0577917509, 0.3466843963, -0.0036738713, -0.0781663284, 0.3455247283, 0.2027907521, -0.3903522193, -0.0352288745, 0.1311017424, -0.0206059199, -0.2782937288, 0.0426179692, -0.1541852355, 0.1644087136, 0.3133024573, -0.3648082316, -0.1199441403, -0.1013828516, 0.3564147055, -0.2605821192, 0.0154461106, -0.119308576, 0.1340243071, -0.0776549056, -0.0452140272, -0.0682605579, 0.0828443989, -0.0709708482, 0.2556938529, -0.0639363751, -0.3214078844, 0.2498636395, -0.1251496971, -0.2517111003, -0.0653515831, 0.1504543722, -0.4629353285, -0.1572734118, 0.0920547545, 0.1018478274, 0.4866554439, 0.1113805845, 0.4011412561, -0.3141963184, -0.0329848751, 0.1462135613, 0.1290737391, -0.1824347377, 0.6450843811, -0.1432970762, -0.1451509893, 0.0570270978, 0.1164400727, 0.3842926621, -0.0462185405, 0.2132510692, 0.1516081691, -0.1438691914, -0.2672668099, -0.1400872469, -0.1376986951, 0.0716606677, 0.2139725983, -0.1158776879, -0.1828249544, 0.1562100947, -0.2269119769, -0.1832347959, 0.1615787148, -0.3105663359, -0.2790355086, -0.1183370203, 0.1062588096, -0.0522754304, 0.2375907153, -0.0872711241, 0.1804926991, -0.0868487507, 0.4261002243, -0.3705819547, -0.0214439724, -0.1634512693, 0.1651093811, 0.3253670037, -0.0246268194, 0.0152844144, 0.1470463872, 0.1758814603, 0.1975682229, -0.1980701387, -0.3065065145, 0.1562502086, 0.0477568544, -0.1228809282, 0.0148315197, 0.1809359044, 0.0875285566, -0.4422794878, -0.3774243593, 0.1015637442, -0.0086370762, -0.0991131514, 0.0038006678, 0.3627699018, -0.0334004425, 0.1455198675, -0.0058684, 0.0634085461, -0.0765854716, -0.124417983, 0.3410063386, 0.193890661, -0.1175999492, 0.1448974013, -0.1172140464, 0.1600014865, -0.1159838513, 0.2434903234, 0.0448681414, -0.2600497901, -0.0980296507, 0.4227249026, 0.3529421389, 0.2267611027, 0.0967408121, 0.0720933452, 0.2289397568, -0.173894003, -0.1163847521, 0.6512266397, 0.0166979656, 0.4703915417, -0.0157639217, 0.0851166621, 0.5125297308, -0.0365241393, 0.0038918776, 0.0008234912, -0.3297492862, 0.0768739954, -0.068879813, 0.2154849619, -0.107374534, -0.0540694743, -0.0920070037, 0.1457467675, 0.1421990395, -0.0178029928, 0.8452950716, -0.13183631, 0.0542047657, 0.1747167408, -0.2661343515, 0.1045224294, 0.1242597774, 0.0783948079, 0.3264679015, 0.0545979291, 0.0771178678, 0.0885591805, -0.4675464928, -0.1652885228, 0.6315924525, -0.0764266029, -0.2411171794, -0.0466094799, -0.0262715481, -0.0856412575, -0.0103625664, 0.2047716826, 0.0620878227, 0.5979959965, 0.0851116106, 0.4313572347, 0.0676746517, -0.0179101322, -0.0940604284, 0.3815837801, -0.0917868987, -0.1464931667, 0.1808088869, -0.2079187632, -0.2164738923, 0.2328565419, 0.1020293087, 0.1816221029, -0.0667531267, 0.4536269009, -0.2325472087, -0.0095974235, -0.2429829091, 0.2401321232, -0.1555419415, 0.1196108386, 0.3448846638, 0.1126713678, -0.1828779727, -0.3477287292, -0.0873993561, 0.0183533765, -0.2619006038, 0.1596794724, 0.0909976065, -0.2678847313, 0.0224007685, 0.0659282804, -0.3229216337, -0.2946972251, 0.5998606086, -0.5497959852, -0.0602736697, 0.0782752559, 0.1313942522, -0.2361157089, 0.6309196949, 0.0459253155, 0.3957275748, -0.0325091444, -0.0984343886, -0.4964115322, -0.1413849592, -0.1640999913, 0.0614773668, 0.0978117958, 0.4516781867, 0.2257588357, 0.3760366738, 0.0037352243, -0.3737082183, 0.0093111163, 0.1776869595, -0.4579308927, 0.1084484309, -0.4192534387, -0.2052962929, 0.1998192519, -0.3315636218, 0.2484561354, 0.0671998039, 0.1189688966, -0.1650648862, 0.1183109432, 0.5072965622, 0.0071779238, 0.0685005039, 0.0069125551, 0.3343527913, -0.2495894283, 0.0270457268, -0.1677879542, 0.1200657338, -0.2708986402, 0.0119974669, -0.0357052833, 0.3253619671, -0.1558248401, -0.1059399843, -0.0696619675, -0.0041539338, -0.1198498309, -0.2138367295, 0.0823438838, 0.0179493539, 0.1702775508, 0.276676476, -0.1018974632, 0.4429576993, 0.0640809685, 0.1211883575, -0.1146945506, -0.1287368238, 0.3002877235, -0.4690987468, -0.2409885228, -0.3412491083, 0.0718251094, -0.1741066575, 0.3793013692, -0.3779058456, -0.2622276843, 0.2299675196, -0.0829024911, -0.0809900388, 0.500737071, 0.1311316937, -0.3234912157, -0.1377527863, -0.2630753517, -0.0466937833, -0.3111961484, -0.0874405876, -0.1657188088 ]
https://github.com/huggingface/datasets/issues/426
[FEATURE REQUEST] Multiprocessing with for dataset.map, dataset.filter
Multiprocessing was added in #552 . You can set the number of processes with `.map(..., num_proc=...)`. It also works for `filter` Closing this one, but feel free to reo-open if you have other questions
It would be nice to be able to speed up `dataset.map` or `dataset.filter`. Perhaps this is as easy as sharding the dataset sending each shard to a process/thread/dask pool and using the new `nlp.concatenate_dataset()` function to join them all together?
34
[FEATURE REQUEST] Multiprocessing with for dataset.map, dataset.filter It would be nice to be able to speed up `dataset.map` or `dataset.filter`. Perhaps this is as easy as sharding the dataset sending each shard to a process/thread/dask pool and using the new `nlp.concatenate_dataset()` function to join them all together? Multiprocessing was added in #552 . You can set the number of processes with `.map(..., num_proc=...)`. It also works for `filter` Closing this one, but feel free to reo-open if you have other questions
[ -0.3118086755, -0.208080247, -0.1779322475, -0.1730469316, -0.3436499536, -0.1113173068, 0.1971543878, 0.2835275531, 0.0392578319, 0.0792982057, -0.0767447948, 0.3925558031, -0.0509050079, 0.3508173227, -0.040817827, -0.1657482833, 0.0791810304, 0.1307996213, -0.1149895266, 0.064801462, -0.0683185533, 0.0558373295, -0.1673118472, -0.0710987225, -0.1849100292, -0.1321125627, -0.1406543255, -0.0166993048, 0.0662527084, -0.2419359684, 0.0318650678, 0.4328874648, -0.1755044907, 0.0703961775, -0.0000980988, -0.2013363093, 0.2006985098, 0.1778136939, -0.10141702, 0.3299800456, -0.2782134116, -0.4332962036, 0.0383696258, -0.2476122081, 0.1491228044, 0.2048671842, 0.267497927, -0.2454676479, 0.192269966, -0.1812829971, 0.2317158729, 0.2043158561, -0.1151813194, 0.2320503145, -0.1050489247, 0.1807962805, -0.0922976211, -0.2746461928, 0.3728885055, -0.1693912596, -0.3322257996, 0.5420419574, -0.2429715991, 0.1591805965, 0.138030827, -0.0897843316, 0.1310692132, -0.3727105558, -0.1179903597, 0.2599783242, -0.0539141558, -0.1353919506, -0.3391515911, -0.2734781504, -0.205640316, -0.4567806423, -0.2121409625, 0.0896803439, -0.2025435418, -0.1186681837, -0.3784818947, -0.2798647583, 0.2643017471, -0.1941071749, 0.2318019271, 0.3839835227, 0.2291880697, 0.068846941, 0.1787993163, -0.2928028107, -0.1345085949, -0.2245153189, 0.0903647467, 0.0094028208, -0.5751146078, -0.1305835843, 0.0920883343, 0.0742392689, 0.0772547945, 0.0394543707, 0.0862810686, 0.3419401646, 0.175699845, 0.2525440156, 0.03411939, -0.3420074582, 0.2699640095, -0.0482740141, 0.0975596905, -0.267749697, -0.2028669715, 0.3006491959, 0.1756906211, -0.1166883558, -0.1895581931, 0.069039315, -0.0817728713, 0.1161871701, 0.05311561, -0.3807052076, 0.1933647543, -0.1785686612, 0.1173212081, 0.1244459078, 0.0175261386, 0.2864508331, -0.2257847488, -0.2121168226, -0.2677028477, -0.2029418051, -0.1525215209, 0.0074561206, -0.0609151423, 0.0846335292, 0.1458337009, 0.2318814695, -0.0329229869, 0.0872345418, 0.0680529028, 0.3604521453, 0.2550829947, -0.0851558968, 0.0856153071, 0.1747232974, -0.0497542657, -0.1048842296, -0.1860292554, 0.0050044782, -0.3372873664, -0.0475949235, -0.2184203863, -0.0954540148, -0.0260660499, 0.2172267735, 0.129077673, -0.0312367175, -0.1767541766, 0.5951275826, 0.011326259, -0.1451154202, -0.3826848269, -0.0607043467, -0.3916879594, -0.2338742316, 0.2800221145, 0.1081849411, 0.0472643822, 0.0406410582, -0.287850827, -0.0283802282, 0.3236937225, 0.259979248, -0.1431950331, -0.0149889318, -0.0436380878, 0.5232228041, 0.516982317, -0.0268267598, 0.0530012101, 0.4043425918, -0.1324664503, -0.0553307086, 0.2862444818, 0.227793172, 0.2258699834, -0.0635010898, 0.0482453108, 0.5034409165, -0.2482093871, 0.2910605669, -0.0909453556, -0.1039721444, 0.0981244296, 0.1033188179, 0.0272240639, 0.0312674455, 0.027979007, -0.2089793831, 0.4157720506, -0.2304134667, 0.170915544, 0.0214933902, -0.0577123985, -0.1529517174, -0.1221988276, -0.3011991084, -0.2843004465, 0.0986699909, -0.179496929, -0.0079393126, 0.1824818552, -0.3726185858, 0.33921808, 0.1165098101, 0.0980500877, 0.1306408793, 0.2733263969, 0.3272750974, 0.0731172711, -0.3091554642, -0.1573941261, 0.1696810871, 0.0174954031, -0.191655755, -0.1207503751, 0.2065017372, 0.0937880725, -0.1517456472, 0.1674116552, 0.1059088409, 0.0496888533, -0.0346127227, 0.19245857, 0.0169883557, -0.0459610671, 0.3286034465, 0.6206994653, 0.2523434162, 0.1050925627, 0.1744487882, -0.0091991415, -0.1313979626, -0.0103492746, -0.1294959486, -0.1501307338, 0.4955797493, 0.0422687382, 0.3763099909, 0.2261741608, 0.0779597461, 0.2708157003, -0.0474648699, -0.0896142945, 0.1630672067, 0.1636179388, -0.0212114733, -0.1145575643, 0.2652320862, -0.4278350472, 0.3981332779, 0.4963065386, 0.1293106377, -0.0425889753, 0.0880844072, 0.2510956526, -0.1494487077, 0.1889100969, 0.1442230046, 0.2122190595, 0.2962413728, 0.1868579388, -0.1414691806, -0.108162649, -0.0351196975, 0.1874667853, 0.1344644129, 0.2369906157, 0.0746930018, 0.1096189022, -0.2849854231, -0.2190054059, -0.3890278339, 0.1656531096, -0.061708156, 0.0815393105, -0.0809906498, -0.2183190584, -0.1557604373, -0.0316576324, 0.2191958278, -0.2191596776, -0.3372047544, 0.1016320288, 0.1640125364, -0.2236172855, 0.1987192929, 0.1181519479, 0.1623241603, -0.1838799119, 0.1328250021, -0.1803709418, -0.117670022, -0.0076288879, 0.1361315846, 0.3037856519, 0.3785466254, 0.466498822, 0.1868598312, 0.0707411617, -0.3563060462, -0.1830934733, -0.0595967174, -0.1524495929, 0.092186965, -0.0250978526, -0.0386613123, -0.2330758125, -0.3906511366, 0.1592655778, 0.0492814258, -0.1521445215, -0.1326259226, 0.0165967867, -0.035267517, -0.0512724742, -0.2436920851, -0.4269720614, -0.4275345206, 0.3586696088, -0.1808322668, 0.3601449132, -0.3318044841, -0.0743728206, -0.0303600319, -0.2477467954, 0.0795425177, 0.0881252587, -0.2829638422, 0.0857496634, -0.0766465589, -0.1964254528, -0.292612344, -0.0988130346, 0.0426920354, 0.346336484, -0.0847768486, -0.0028072672, -0.2195992023, 0.1538801342, 0.2612431049, -0.058814317, 0.1657881737, 0.051034905, -0.2215291262, 0.1123751104, -0.2412111461, 0.150389269, -0.1320763677, -0.1409628391, 0.144039318, 0.3033940494, -0.0152790071, 0.5315756798, 0.1151200533, -0.1121071577, 0.0215541106, 0.1098570824, -0.1857663095, 0.1743284762, -0.4403366745, 0.0002035313, -0.1181216985, 0.0327631049, 0.131100595, -0.1172967851, -0.5028033257, -0.0272686556, 0.0582267195, -0.1981554627, -0.1705221981, 0.2018121034, -0.1989320219, 0.2783458233, 0.0801801682, -0.3016010523, -0.3575441539, 0.0743293986, -0.268096, -0.0270332918, 0.2139934599, -0.1887506247, -0.4772758484, -0.1842849255, -0.5468440056, 0.3180506229, 0.1374519616, 0.1132430434, -0.0543638542, -0.0037847552, -0.0591739155, -0.1751535386, 0.4736831188, -0.3019972146, -0.1694517881, 0.2956011593, -0.3368088603, 0.0315156542, 0.2125360072, -0.0706276298, 0.4595474005, 0.4683874846, 0.261739254, -0.3323931992, -0.3635449111, 0.1668348908, 0.0684037358, -0.0942509919, 0.0202642735, -0.129343912, -0.0694133118, -0.2078353614, 0.1128198281, -0.08659973, 0.1333024204, -0.0364209861, -0.1267879605, -0.1307300627, 0.0079301586, 0.3029814959, 0.0826521888, -0.0328121744, 0.2658086121, 0.2377578467, -0.3488393724, 0.2270437032, -0.1522960216, -0.0199716408, -0.1843566, 0.1344463974, -0.0626535863, -0.069274947, 0.556253314, 0.250216186, 0.1834812611, 0.3105381727, -0.0753910989, 0.4139230251, -0.1532607675, 0.0114475833, 0.3346477747, 0.1599071622, -0.2039084584, -0.2229420096, 0.276901722, 0.2694519162, -0.1253662258, 0.3823760152, -0.242109552, -0.0711113513, 0.2561420798, 0.1250005811, 0.6941609979, -0.2547993958, 0.0451465063, -0.2514950037, 0.1451067775, 0.3248783648, -0.2804258168, 0.2194979489, -0.0586195365, -0.1863629371, 0.1432300508, 0.0192235038, 0.1909984648, 0.468585372, -0.2656114995, 0.1729699224, 0.2839289904, -0.1742919236, -0.0782827586, 0.4526755214, 0.1473707855, -0.4094931781, -0.1683622003, 0.160910055, -0.0478141084, -0.3570649922, 0.0380353071, -0.2977584302, 0.1869592667, 0.1704109311, -0.3053104281, -0.0162862688, 0.1349387765, 0.3702850044, -0.263510555, -0.0103283534, -0.2282406986, 0.0804495364, -0.1640234739, 0.0282279383, 0.0138417352, 0.1121843904, -0.1329810768, 0.2483467907, -0.172841996, -0.2532653809, 0.1958272159, -0.2532752752, -0.1808154583, -0.0334780253, 0.0669212341, -0.5287502408, -0.1446631104, 0.1538775414, 0.0937532187, 0.3899874091, 0.0303078666, 0.362077713, -0.4090332389, -0.1828262061, 0.1932814866, 0.2313533276, -0.2200435251, 0.5411825776, 0.1586211175, -0.1013463065, -0.0034011276, 0.0832244903, 0.2891549766, 0.0061693438, 0.248087123, 0.0655297786, -0.2069127113, -0.3257485032, -0.2069139332, -0.2269089222, 0.0533733219, 0.3017611802, -0.1378847957, -0.2142486572, 0.0612092577, -0.1285809875, -0.1259342581, 0.1365893781, -0.2172746807, -0.1887902468, -0.1422332078, 0.0968126208, -0.2331412435, 0.1975515783, -0.0019943109, 0.0519080162, 0.0366590843, 0.4807836413, -0.4344333708, -0.1275336295, -0.3187757134, 0.2330362946, 0.27375108, -0.0472055264, -0.1861443073, 0.2489389926, 0.2355583608, 0.122507602, -0.1975657791, -0.3529150188, 0.2140959352, 0.0386997983, -0.15224953, 0.068836011, 0.0761160478, 0.1387802213, -0.3181968033, -0.3029016852, -0.131564945, -0.1898016781, -0.0796306208, 0.0764663219, 0.2217511386, -0.2593084872, 0.3350774944, 0.0214416161, 0.0840645581, -0.136771813, -0.221294567, 0.3479638696, 0.1634100825, -0.2223723084, 0.2342486233, -0.0871863663, 0.0017212471, -0.1312720329, 0.2663226426, 0.0407942347, -0.2608653605, -0.0193500686, 0.3714658618, 0.3568589985, 0.2390732765, 0.1567322761, 0.0942211598, 0.2489314079, -0.324903965, -0.1693694443, 0.5596205592, -0.0339077227, 0.3383584619, -0.1567269117, 0.2189144343, 0.2402933389, 0.0832248479, 0.0472284593, -0.0850991234, -0.3423671126, -0.0223669652, -0.0906852782, 0.3015964031, -0.0777261481, 0.1149757653, 0.1227802336, 0.1877330244, 0.1768871993, -0.0169620868, 0.7731487751, -0.0536656082, 0.2881839871, 0.1529934108, -0.1293535084, 0.1669362485, 0.1924276799, 0.0711642206, 0.1993344426, 0.1327950209, 0.1543231755, 0.0372754559, -0.4504741728, -0.2149817795, 0.6825031042, -0.1505437195, -0.3235417008, -0.0915460363, -0.1169139668, -0.1602391303, 0.0944652036, 0.1278130114, 0.1765396595, 0.6568730474, 0.0150623946, 0.3660640717, -0.0714493245, 0.1660767198, -0.1578211337, 0.3040831983, -0.205264017, -0.2164438814, 0.1420260519, -0.1892102808, -0.0655163452, 0.3563250005, 0.2488281876, 0.2848225534, -0.144109726, 0.2726019621, -0.2956686318, -0.059436202, -0.3789014816, 0.2486139387, 0.0145974718, 0.0457057953, 0.4520923495, 0.15371041, -0.2073937654, -0.2555701137, 0.0529310443, 0.0108490447, -0.2308034301, 0.1999272853, 0.1541866213, -0.1907088161, -0.0611728616, 0.0579443872, -0.4901554585, -0.2592762411, 0.5490928292, -0.4322647154, -0.0196174402, -0.175562039, 0.1528596729, -0.2001217604, 0.6736974716, 0.0027890978, 0.3433561027, -0.0264597461, -0.2550085485, -0.5719374418, -0.3019397855, -0.0900589749, -0.0563818775, 0.1824566573, 0.5611234903, 0.1624624878, 0.2724915743, -0.1371916682, -0.2531247139, -0.0721481889, 0.0583385788, -0.4192559719, 0.2377563864, -0.1238057986, -0.0789517835, 0.1540432423, -0.3220897615, 0.3157335222, 0.0160882976, 0.2028989792, -0.0945672095, 0.0261443015, 0.4906810522, 0.1940528601, -0.1569815427, 0.14602606, 0.3112100959, -0.3373525441, -0.002602696, -0.1494637579, 0.1065342277, -0.1662213057, -0.0949636847, 0.0439928211, 0.3311819732, -0.1619599313, 0.2568047047, -0.0441045798, 0.2164630592, -0.2096706927, -0.0430670269, 0.1807120889, 0.0299116801, 0.1488727331, 0.2463068217, -0.1401853114, 0.2737382352, -0.0078092958, 0.033741422, -0.1430571824, -0.2125966102, 0.2409759909, -0.3951696455, -0.2428912222, -0.3473041058, 0.2190296054, 0.0408533737, 0.3273251355, -0.2465284169, -0.3446033895, 0.2122890353, -0.0348667875, -0.0191139728, 0.4801188409, -0.1346849799, -0.2861377895, -0.1634637564, -0.2962389588, 0.0462737679, -0.2897839248, -0.1670206189, -0.2816141248 ]
https://github.com/huggingface/datasets/issues/426
[FEATURE REQUEST] Multiprocessing with for dataset.map, dataset.filter
@lhoestq Great feature implemented! Do you have plans to add it to official tutorials [Processing data in a Dataset](https://huggingface.co/docs/datasets/processing.html?highlight=save#augmenting-the-dataset)? It took me sometime to find this parallel processing api.
It would be nice to be able to speed up `dataset.map` or `dataset.filter`. Perhaps this is as easy as sharding the dataset sending each shard to a process/thread/dask pool and using the new `nlp.concatenate_dataset()` function to join them all together?
29
[FEATURE REQUEST] Multiprocessing with for dataset.map, dataset.filter It would be nice to be able to speed up `dataset.map` or `dataset.filter`. Perhaps this is as easy as sharding the dataset sending each shard to a process/thread/dask pool and using the new `nlp.concatenate_dataset()` function to join them all together? @lhoestq Great feature implemented! Do you have plans to add it to official tutorials [Processing data in a Dataset](https://huggingface.co/docs/datasets/processing.html?highlight=save#augmenting-the-dataset)? It took me sometime to find this parallel processing api.
[ -0.2608761489, -0.4052205384, -0.1671195179, 0.0242643133, -0.3476992846, 0.1083789691, 0.0958694071, 0.1001093984, 0.0097755715, 0.0779819489, -0.1297874302, 0.2687846422, 0.0288042836, 0.567956388, 0.0352189094, -0.3084891737, 0.0757970363, 0.1260468215, -0.047758095, 0.1972434521, 0.01976352, 0.1598395258, -0.2788160145, -0.1252329499, -0.2452908158, -0.1634079218, -0.1911026984, -0.0196518097, -0.059497878, -0.1503466815, 0.0461669527, 0.4871737659, -0.2316056043, 0.2361284196, -0.0001079078, -0.2029749006, 0.1503317803, 0.2298717201, -0.0537672304, 0.200702399, -0.1934657246, -0.4777648747, -0.014705441, -0.0763370022, 0.0592209324, 0.1195814535, 0.1778101921, -0.2691316009, 0.190429315, -0.3726124763, 0.1244619936, 0.3582192063, -0.0545267127, 0.2704069614, -0.2098026723, 0.4645995796, -0.0739305317, -0.1920113713, 0.4698047936, -0.1441963464, -0.190662697, 0.551361382, -0.2167664915, 0.1467214674, 0.2011541724, -0.0467659868, -0.1824135482, -0.4495764077, -0.15063034, 0.3538200855, -0.0240541007, -0.1382971257, -0.5037170649, -0.4508945048, -0.1339047402, -0.4086398482, -0.1706857681, 0.1109531, -0.1954038441, 0.0309993755, -0.4884884059, -0.3645782471, 0.2795681953, -0.1878641248, 0.2982876301, 0.211187467, 0.004194512, 0.0964185745, 0.2584790289, -0.1932648122, -0.2565286458, -0.2772125006, 0.1194254607, 0.033772815, -0.6784651875, -0.0603896342, -0.0065605314, 0.1300595552, 0.1923824549, 0.1290125996, 0.1012565941, 0.3147674501, -0.0229618475, 0.2253414243, 0.1074022502, -0.3512953222, 0.1750335395, -0.1152897626, 0.1311008185, -0.1904401183, -0.0298141297, 0.2025750726, 0.2138278037, -0.051817473, -0.4135624468, 0.0292812977, 0.0277363192, 0.1004155055, 0.0746325627, -0.3755647242, 0.1856491715, -0.2991416752, 0.1410413086, 0.0419947542, -0.0095862765, 0.3397316635, -0.1418081969, -0.1332839131, -0.2340057492, -0.238211289, -0.0971704125, -0.0516248867, -0.0331979319, 0.2781028152, 0.1204999834, 0.044282116, -0.0506826863, 0.1477284282, 0.1439826936, 0.2672170103, 0.2075038254, -0.1242550835, 0.0695266202, 0.1833893955, -0.072691232, -0.0383959115, -0.1169661507, 0.2222466022, -0.2571865022, -0.0959704667, -0.2205808461, -0.2075158209, -0.1869582683, 0.0773485005, 0.1048260778, -0.1092594489, -0.4787706137, 0.7779141068, 0.0713087618, -0.0115010319, -0.29457739, 0.0227481946, -0.5353249311, -0.1817251593, 0.3416644633, 0.1284203678, -0.0485661067, -0.0365401618, -0.2228353173, -0.1078435928, 0.2403543591, 0.4414245188, -0.2017017007, 0.1292134523, -0.1785439551, 0.4836605787, 0.5142174959, -0.1295249909, 0.0830007941, 0.3742533326, -0.1477963328, 0.0708049089, 0.314275831, 0.1900287122, 0.2082637995, 0.0276135691, 0.1444730461, 0.5401503444, -0.1980231851, 0.2230970562, 0.0059552463, -0.1897814721, 0.2261705548, 0.162299931, -0.1524644941, 0.0858477578, -0.0761105716, -0.5189330578, 0.4866411388, -0.2974569798, 0.1562605202, 0.0589021072, -0.1313955188, 0.0926600173, -0.0669749677, -0.3271735907, -0.3598517179, 0.0688543245, -0.0417774431, -0.0491080992, 0.0830472261, -0.3939553201, 0.4155667722, 0.0981718972, 0.0268568415, 0.0086588841, 0.1069584489, 0.1812458187, 0.1519801021, -0.236093834, -0.3061080575, 0.3358494341, -0.079967767, -0.0123660527, -0.3526890576, 0.213833645, 0.2508555949, -0.0553253889, 0.0419048592, 0.1212066859, -0.0514609925, -0.1264778227, 0.1427653283, -0.0031845861, -0.0493053645, 0.2550178468, 0.6550813317, 0.2654033005, 0.2627615035, 0.0785564482, 0.0230957214, -0.2753276229, 0.0382473283, -0.2153047621, -0.1683974564, 0.5540854931, -0.0410234854, 0.4023040831, 0.0917557478, -0.0131628253, 0.2349598557, 0.073300913, -0.0701761469, 0.2105982751, 0.1526690722, -0.0811326057, 0.0270826835, 0.1431893259, -0.4629768133, 0.3415275514, 0.4402226508, 0.0058710426, -0.2078664452, 0.0840374231, 0.1872194558, -0.1110779792, 0.1967879385, 0.023821095, 0.1881490052, 0.1884750426, 0.0503348149, -0.0454427078, 0.1028475687, -0.0663724542, 0.1176736578, 0.3205145001, 0.2168474197, -0.0265255682, 0.1670741588, -0.2363260835, -0.2827823758, -0.2901489139, 0.1736859828, -0.1077103019, 0.0196600519, -0.0615281388, -0.1852203012, -0.1912409365, -0.0461946651, 0.0478870608, -0.3056801856, -0.3041769564, -0.0812804997, 0.3092375696, -0.0518719107, 0.0761978924, 0.2212896794, 0.2130074203, -0.1976545453, -0.0081334263, -0.2818011045, 0.0124896578, 0.1285526305, 0.0313924402, 0.3022119403, 0.3320899606, 0.455543071, 0.1232952923, 0.091032736, -0.445569098, -0.2040766031, -0.0179644283, -0.2767623365, 0.1366853565, 0.1226215586, 0.1201802567, -0.1607807726, -0.2790881991, 0.1972416043, 0.1088808328, -0.2122078687, -0.2680939734, 0.0608800501, -0.0249818452, -0.0241123568, -0.149021104, -0.4795733988, -0.3343914747, 0.5942106843, -0.287660569, 0.2276883423, -0.3308072984, -0.1193305403, -0.0027465664, -0.3504947126, 0.0665275902, 0.0190507155, -0.4718953371, 0.0208823383, 0.0118576093, -0.1137490943, -0.2490849197, -0.0198606886, -0.0645402893, 0.2378329933, -0.0836322531, -0.100600034, -0.358882457, 0.2384419292, 0.2121085376, 0.0981800035, 0.2778331637, -0.0796128288, -0.0705578849, 0.133859694, -0.4800578952, 0.0397938192, -0.0009143744, -0.1605333388, 0.2632175982, 0.3609157205, 0.0008576596, 0.7097069025, 0.2304418087, -0.047403384, 0.1350749135, 0.1280043572, -0.166610077, 0.056813702, -0.551041007, -0.0351175033, -0.1622914523, 0.0703056827, 0.0248752888, -0.0346965827, -0.249203071, -0.090088293, 0.0162706114, -0.3376846611, -0.0910867527, 0.0867469907, -0.047154326, 0.2308439612, 0.0760258213, -0.310087502, -0.2607220411, 0.0541559607, -0.2018710077, 0.1385470927, 0.3485729992, -0.1705936491, -0.5018060803, -0.1323039979, -0.6374373436, 0.4433450699, 0.2480608076, 0.0398770198, 0.0086303996, 0.0663431808, 0.1311943382, -0.1964476407, 0.7243827581, -0.2557789385, -0.360091418, 0.2271152884, -0.5849373341, 0.0872300491, 0.1974898577, 0.0706142187, 0.4089246988, 0.4323521554, 0.43986094, -0.3128745258, -0.450279057, 0.2078810781, 0.102250278, -0.0641264543, -0.0108837504, -0.1586313844, -0.0743904188, -0.267354399, 0.1051842347, -0.0429939851, 0.077049695, 0.0950402543, -0.0455874652, -0.0707238019, 0.0183446668, 0.1913141608, -0.0161741972, -0.0698354542, 0.2421739995, 0.2998713255, -0.0922840014, 0.094618924, -0.0691816583, 0.1599668115, -0.1237232834, -0.1960050464, -0.0725320652, -0.0338150002, 0.6675155163, 0.2453342229, 0.2298671901, 0.3670386076, 0.0978974253, 0.3856649101, -0.4025584459, 0.0253542997, 0.4367713928, 0.2292356342, -0.3920322657, -0.305498749, 0.3532454371, 0.3055292666, -0.0169569068, 0.5018379092, -0.0144237196, 0.0041290368, 0.13297759, -0.0142770186, 0.7471273541, -0.3258098066, 0.1332370788, -0.301709801, 0.0463986509, 0.3842145801, -0.3119766414, 0.2014100105, -0.1073826551, -0.2371869683, 0.0442393459, 0.0127996793, 0.3001086116, 0.264727205, -0.1261514872, 0.312853545, 0.2669261992, -0.0907425284, -0.1210805774, 0.4641553462, 0.166195631, -0.4408359528, -0.2453462034, 0.0730638802, -0.0293261129, -0.1736720502, 0.0485471599, -0.2938823402, 0.2022455335, 0.1478759646, -0.3816896677, -0.0909403265, -0.0811213925, 0.2681492865, -0.1340633333, -0.1242269725, -0.0441484191, 0.0612482354, -0.0484496914, -0.0556649305, -0.0568907224, 0.0340334438, -0.247451961, 0.2347685248, -0.247590974, -0.2561886311, 0.1087354645, -0.1369174868, -0.1850031018, -0.122784555, 0.1235469058, -0.5898907185, -0.2854609787, 0.2059536129, 0.0049391878, 0.2578456104, -0.0189391561, 0.3219513595, -0.1504005641, -0.1649794877, 0.0669942498, 0.3953621387, -0.1820902526, 0.4212402403, 0.1083270758, -0.103790015, -0.0464998148, 0.1154733747, 0.1658522934, -0.1708623171, 0.1820624471, 0.1965956688, -0.1834614724, -0.2009715587, -0.1537407935, -0.1337399185, 0.0466587022, 0.2491379082, -0.0046175797, -0.0908900648, 0.0093671605, 0.0312434621, -0.1258030385, -0.0645909086, -0.1487534344, -0.3159018159, -0.1274638176, 0.1000359282, -0.2690618336, 0.138045907, 0.0921470821, 0.0871017799, 0.0886877626, 0.5282356739, -0.2911816239, 0.0323015414, -0.0600158125, 0.131188795, 0.4815718234, -0.0207303111, -0.0286111217, 0.2252861261, 0.1107014641, 0.1718192548, -0.2150520235, -0.2530893981, 0.2104919404, 0.0922303125, -0.0867487192, 0.0380463712, 0.0912616253, 0.1559920758, -0.2978250682, -0.3565598726, 0.0225434378, -0.0821362585, 0.0193820167, 0.0203432646, 0.1683954895, -0.2722151577, 0.1822593659, 0.0320928618, 0.1487874091, -0.0859449357, -0.1620507538, 0.2506085634, 0.0997247398, -0.1601607352, 0.183300972, -0.0429134406, 0.3144594133, -0.2085178494, 0.202705428, -0.0107517634, -0.2946521938, -0.0723329186, 0.4625980258, 0.3377597034, 0.2870200276, 0.2620432377, 0.0770762935, 0.1131527871, -0.2261072546, -0.1419250965, 0.6985283494, 0.0277235471, 0.2345365733, -0.0287049469, 0.2569654584, 0.5741372705, 0.0210930184, -0.0488773026, -0.0279531777, -0.2640928924, 0.0817643255, -0.2153851539, 0.2547772825, -0.0206001475, 0.2107730508, 0.2571157217, 0.1407171935, 0.1333986372, -0.0400632955, 0.7664593458, -0.1230492666, 0.2914153934, 0.1756438762, -0.337715596, 0.2382448316, 0.159697324, 0.1308978647, 0.1412184536, 0.0603821799, 0.3576040864, -0.0241963994, -0.5762880445, -0.2208378315, 0.7770310044, -0.0992095396, -0.2864766121, 0.1479818672, -0.0764128491, -0.0093330191, 0.1394118369, 0.1587350518, 0.0367024764, 0.8322873712, -0.1424621046, 0.3206213415, -0.1860070378, 0.0500834994, -0.0696890801, 0.3375320435, -0.0912107602, -0.1996353269, 0.0603375323, -0.1561438739, -0.1357200593, 0.4773378372, 0.2478216887, 0.133982107, -0.0934021845, 0.257524848, -0.4307616353, 0.0304972716, -0.1887448132, 0.3448913693, -0.1604805589, 0.0238780472, 0.4507908225, 0.0561623126, -0.1108668223, -0.2868129909, -0.0931767821, 0.1409199834, -0.4509790838, 0.1636557579, -0.1376703531, -0.1064953804, -0.1212153956, 0.0233023502, -0.4255392849, -0.1750426739, 0.6109220982, -0.5048497915, -0.1179583222, -0.0576430373, 0.0909234136, -0.1598992646, 0.5806364417, 0.3098264337, 0.2996734083, -0.0502880961, -0.1927749813, -0.53793782, -0.4539735317, -0.0166789517, 0.084762238, 0.1283781976, 0.4404752254, 0.236476928, 0.3570867777, 0.0451308303, -0.3217490017, 0.0870716572, 0.0873020962, -0.3887605965, 0.2369846404, -0.174533084, -0.1542675197, 0.1626610607, -0.2101678699, 0.3319188356, 0.0708287507, 0.0122050494, -0.1752079427, 0.2532280385, 0.254922539, -0.0906020701, -0.1170516312, 0.2109994441, 0.3174998462, -0.2899766862, -0.0238900874, -0.0814292356, 0.0624878481, -0.1937702149, 0.0704772249, -0.021517545, 0.4209696352, -0.2175204009, 0.1094511673, -0.0596673079, 0.2623105049, -0.1140563414, -0.0923535824, 0.0659225285, 0.1022788286, 0.045119863, 0.1289892048, -0.0045117904, 0.3254565597, 0.0358525179, 0.0831918046, -0.1544275582, -0.0935173482, 0.2818123102, -0.4838244617, -0.2623060644, -0.3023209274, 0.0809224918, 0.1815186292, 0.2234051377, -0.5047797561, -0.2906192541, 0.1853738129, 0.0037674527, -0.0025367264, 0.6374949813, -0.1342751533, -0.342238754, -0.1719224155, -0.1800536364, 0.0303832702, -0.3091048002, -0.0335457474, -0.1872974038 ]
https://github.com/huggingface/datasets/issues/425
Correct data structure for PAN-X task in XTREME dataset?
Hi @lhoestq I made the proposed changes to the `xtreme.py` script. I noticed that I also need to change the schema in the `dataset_infos.json` file. More specifically the `"features"` part of the PAN-X.LANG dataset: ```json "features":{ "word":{ "dtype":"string", "id":null, "_type":"Value" }, "ner_tag":{ "dtype":"string", "id":null, "_type":"Value" }, "lang":{ "dtype":"string", "id":null, "_type":"Value" } } ``` To fit the code above the fields `"word"`, `"ner_tag"`, and `"lang"` would become `"words"`, `ner_tags"` and `"langs"`. In addition the `dtype` should be changed from `"string"` to `"list"`. I made this changes but when trying to test this locally with `dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data')` I face the issue that the `dataset_info.json` file is always overwritten by a downloaded version with the old settings, which then throws an error because the schema does not match. This makes it hard to test the changes locally. Do you have any suggestions on how to deal with that?
Hi 🤗 team! ## Description of the problem Thanks to the fix from #416 I am now able to load the NER task in the XTREME dataset as follows: ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') dataset_train = dataset['train'] ``` However, I am not sure that `load_dataset()` is returning the correct data structure for NER. Currently, every row in `dataset_train` is of the form ```python {'word': str, 'ner_tag': str, 'lang': str} ``` but I think we actually want something like ```python {'words': List[str], 'ner_tags': List[str], 'langs': List[str]} ``` so that each row corresponds to a _sequence_ of words associated with each example. With the current data structure I do not think it is possible to transform `dataset_train` into a form suitable for training because we do not know the boundaries between examples. Indeed, [this line](https://github.com/google-research/xtreme/blob/522434d1aece34131d997a97ce7e9242a51a688a/third_party/utils_tag.py#L58) in the XTREME repo, processes the texts as lists of sentences, tags, and languages. ## Proposed solution Replace ```python with open(filepath) as f: data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE) for id_, row in enumerate(data): if row: lang, word = row[0].split(":")[0], row[0].split(":")[1] tag = row[1] yield id_, {"word": word, "ner_tag": tag, "lang": lang} ``` from [these lines](https://github.com/huggingface/nlp/blob/ce7d3a1d630b78fe27188d1706f3ea980e8eec43/datasets/xtreme/xtreme.py#L881-L887) of the `_generate_examples()` function with something like ```python guid_index = 1 with open(filepath, encoding="utf-8") as f: words = [] ner_tags = [] langs = [] for line in f: if line.startswith("-DOCSTART-") or line == "" or line == "\n": if words: yield guid_index, {"words": words, "ner_tags": ner_tags, "langs": langs} guid_index += 1 words = [] ner_tags = [] else: # pan-x data is tab separated splits = line.split("\t") # strip out en: prefix langs.append(splits[0][:2]) words.append(splits[0][3:]) if len(splits) > 1: labels.append(splits[-1].replace("\n", "")) else: # examples have no label in test set labels.append("O") ``` If you agree, me or @lvwerra would be happy to implement this and create a PR.
148
Correct data structure for PAN-X task in XTREME dataset? Hi 🤗 team! ## Description of the problem Thanks to the fix from #416 I am now able to load the NER task in the XTREME dataset as follows: ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') dataset_train = dataset['train'] ``` However, I am not sure that `load_dataset()` is returning the correct data structure for NER. Currently, every row in `dataset_train` is of the form ```python {'word': str, 'ner_tag': str, 'lang': str} ``` but I think we actually want something like ```python {'words': List[str], 'ner_tags': List[str], 'langs': List[str]} ``` so that each row corresponds to a _sequence_ of words associated with each example. With the current data structure I do not think it is possible to transform `dataset_train` into a form suitable for training because we do not know the boundaries between examples. Indeed, [this line](https://github.com/google-research/xtreme/blob/522434d1aece34131d997a97ce7e9242a51a688a/third_party/utils_tag.py#L58) in the XTREME repo, processes the texts as lists of sentences, tags, and languages. ## Proposed solution Replace ```python with open(filepath) as f: data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE) for id_, row in enumerate(data): if row: lang, word = row[0].split(":")[0], row[0].split(":")[1] tag = row[1] yield id_, {"word": word, "ner_tag": tag, "lang": lang} ``` from [these lines](https://github.com/huggingface/nlp/blob/ce7d3a1d630b78fe27188d1706f3ea980e8eec43/datasets/xtreme/xtreme.py#L881-L887) of the `_generate_examples()` function with something like ```python guid_index = 1 with open(filepath, encoding="utf-8") as f: words = [] ner_tags = [] langs = [] for line in f: if line.startswith("-DOCSTART-") or line == "" or line == "\n": if words: yield guid_index, {"words": words, "ner_tags": ner_tags, "langs": langs} guid_index += 1 words = [] ner_tags = [] else: # pan-x data is tab separated splits = line.split("\t") # strip out en: prefix langs.append(splits[0][:2]) words.append(splits[0][3:]) if len(splits) > 1: labels.append(splits[-1].replace("\n", "")) else: # examples have no label in test set labels.append("O") ``` If you agree, me or @lvwerra would be happy to implement this and create a PR. Hi @lhoestq I made the proposed changes to the `xtreme.py` script. I noticed that I also need to change the schema in the `dataset_infos.json` file. More specifically the `"features"` part of the PAN-X.LANG dataset: ```json "features":{ "word":{ "dtype":"string", "id":null, "_type":"Value" }, "ner_tag":{ "dtype":"string", "id":null, "_type":"Value" }, "lang":{ "dtype":"string", "id":null, "_type":"Value" } } ``` To fit the code above the fields `"word"`, `"ner_tag"`, and `"lang"` would become `"words"`, `ner_tags"` and `"langs"`. In addition the `dtype` should be changed from `"string"` to `"list"`. I made this changes but when trying to test this locally with `dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data')` I face the issue that the `dataset_info.json` file is always overwritten by a downloaded version with the old settings, which then throws an error because the schema does not match. This makes it hard to test the changes locally. Do you have any suggestions on how to deal with that?
[ -0.0446427278, -0.1960522234, -0.0213917997, 0.3716608882, 0.0390403457, -0.2763309777, -0.0206369758, 0.157951355, -0.071780622, -0.0662425384, -0.161353007, 0.2627064884, 0.0014277752, 0.1680825502, 0.4264351726, -0.1467024237, 0.0484423041, -0.0699054077, 0.2786859572, -0.0526145585, -0.1090930626, 0.1506101638, -0.3253746033, 0.0544693321, -0.3497872949, 0.0837274864, -0.0678213611, 0.346239835, -0.275839299, -0.4933687747, 0.5901549459, 0.0610430464, 0.3375475705, 0.3253482878, -0.0001185824, 0.0073941094, 0.0491499938, -0.2976796329, 0.0629999414, -0.5153079033, -0.2116062641, -0.6882326603, -0.0707504675, -0.1863515228, -0.2494242042, -0.0691497847, 0.2359092385, 0.1613157243, 0.3286875486, 0.4041300714, 0.0667554438, 0.1186722666, -0.0112287104, 0.1646236926, 0.406904608, 0.391261071, -0.2984110713, -0.0554718301, 0.5836412907, 0.1500934958, -0.200723961, 0.2261364907, 0.0665779114, -0.0957409441, 0.2168320119, 0.3117487431, 0.1106215715, -0.458388716, -0.2030347884, 0.2828918993, 0.230435282, -0.2553839386, -0.2035079151, -0.27793172, -0.0572836995, -0.2900473475, -0.0280276984, 0.3609625995, -0.0808848813, -0.0090990355, 0.2543645501, -0.0029823852, -0.1114810929, 0.2031375468, -0.0105204023, 0.4096218646, -0.0134638967, -0.1075180918, -0.1396068931, -0.1162078902, 0.701856792, -0.0104259066, 0.1576863527, 0.1197109818, -0.6041289568, 0.0803793371, -0.1363221705, -0.2818923295, 0.1663051248, -0.0484370962, 0.2098661065, 0.1589149088, 0.1485236585, 0.0145869944, 0.3213758767, 0.2003956288, 0.2381375432, 0.0310103986, -0.1307128817, 0.0734809935, 0.0858035386, -0.0963583961, -0.318375051, 0.0653055012, 0.2368325442, -0.0228068549, 0.2889069021, -0.1962371022, -0.3680241704, -0.0199918188, -0.1284304559, 0.0725801587, 0.141478762, 0.061180193, 0.0080608455, 0.5874382257, -0.0742887408, 0.1787088513, -0.253834039, 0.0291408636, -0.1472997218, 0.169409737, -0.6243600249, -0.1061868072, 0.2582581341, 0.0919620246, 0.1970394403, -0.0064031417, 0.1218203828, -0.3322490156, 0.1758815497, -0.2791434824, 0.2651099563, -0.0158672649, 0.2457382679, -0.1295720637, -0.3093242645, -0.0095197419, -0.1647401303, 0.2194372565, -0.7123693824, -0.0245732255, 0.0450957865, 0.0754592121, -0.2141941786, 0.1435737163, -0.504322648, 0.0322592966, 0.0630440786, 0.2181686908, 0.1069046184, -0.3306137621, -0.2142897695, -0.0720487833, 0.0830699205, 0.1326567531, -0.1291508824, 0.0973816738, 0.063099049, 0.0002565257, 0.1041970327, 0.2162795961, -0.0109666931, 0.2841814458, -0.1886345595, 0.5723384619, 0.4195817709, -0.803727746, -0.3378545046, 0.0875090808, -0.1656144559, 0.0018319889, -0.0777147934, 0.299970746, 0.2168300003, -0.1097092181, 0.2860380411, 0.4717786908, -0.0601556636, 0.1129641086, -0.1055826545, 0.2662769854, -0.1180939749, 0.3215995729, 0.0420975909, -0.2685295939, -0.1594627202, 0.0751416609, 0.1948618442, -0.1158281565, 0.0870856121, 0.4314537644, 0.0892731249, -0.0513845123, -0.0506237522, 0.0383253694, -0.7624905705, 0.1141010821, -0.4289599061, 0.3793444335, 0.0106571624, -0.0671950951, -0.1728421748, -0.0510761961, -0.296261996, -0.1906543374, 0.1071609929, -0.1209992543, -0.1237813979, -0.3034521341, -0.0762855262, 0.3974153399, -0.2260979116, 0.0737623796, -0.5780184269, 0.3407833874, 0.1180049926, -0.066484876, -0.0123105831, 0.4472563267, 0.1922498792, -0.0482968092, 0.1684597731, 0.2209219635, 0.2148897499, -0.1571742296, -0.0612337142, -0.0020259316, 0.1334933043, -0.5777856112, 0.0659278557, 0.2230993956, -0.0014227685, -0.2143049985, -0.1243549362, 0.5517564416, 0.1847703755, 0.2072840929, 0.0289731026, 0.0707498938, 0.2122235745, -0.1713617742, -0.2344334275, -0.103904739, 0.1545493901, 0.123317495, 0.030547291, 0.0995656848, -0.5023414493, 0.0200130492, 0.3077194989, 0.0274301395, 0.1898183972, 0.2047272623, -0.1531091183, -0.0791651681, 0.037457712, 0.3701201379, 0.3590866029, 0.0914273858, 0.1098856702, 0.1304073632, -0.0329411849, 0.0724883303, -0.0358843245, 0.0617540814, 0.1510176361, 0.2119650096, 0.1785158366, -0.0841949955, -0.085896492, -0.2191503793, 0.0321779102, 0.1521632224, -0.3295001984, 0.0780692771, 0.036821641, -0.4502651691, -0.1473740488, 0.0441723317, -0.1361574978, -0.3193360865, -0.0379221328, -0.0571563095, 0.2387745976, 0.0840667039, -0.4746883214, -0.2150862366, -0.1986019313, -0.3406286836, -0.0583146177, 0.0742932856, -0.1382386684, -0.0267541558, 0.2119733989, 0.5459079742, -0.0312717967, -0.4353147745, 0.390160799, -0.3872417808, -0.2023116499, 0.3016566038, -0.2638223171, 0.3121580184, 0.2171544731, -0.1040854007, -0.4046022892, 0.1959169209, 0.1874916255, -0.3214800656, -0.3141257763, 0.3168615103, -0.1772631407, -0.0916749239, -0.0264437646, -0.406345427, -0.5237721205, -0.2054874897, 0.011993818, 0.2230314016, 0.3162437379, 0.2151382416, -0.2596665323, -0.1451506466, -0.1321805865, -0.1955114156, 0.0069591696, -0.5726140738, 0.4568422139, -0.2441943884, -0.2051523775, -0.0859806687, -0.2658783495, 0.4713196754, 0.378029108, -0.0684936121, -0.0375404917, 0.1413384229, 0.035182029, 0.1777089536, -0.0622193515, 0.2964115739, -0.2141356915, 0.0457051843, -0.0277898367, -0.0081240581, 0.0785254315, 0.3201450408, 0.2304377407, -0.0265186429, -0.2571677268, 0.1103470922, 0.0635771379, 0.1552903354, 0.0463341251, 0.4367931783, 0.0053787678, 0.1145690531, 0.0847836584, 0.0224085152, -0.1640298665, 0.0601462424, 0.2332694232, -0.0009897219, 0.2357879579, -0.154772833, -0.0720981359, 0.1263709217, -0.1329990178, -0.2151204199, 0.5398621559, -0.1397539973, 0.410523355, -0.1709617525, 0.0268175602, -0.0614329875, -0.4580695033, -0.2571297884, 0.0861497, 0.179715693, 0.1554050446, -0.6861749887, 0.3985427022, -0.3888290823, -0.0206330754, 0.1728509068, 0.5378319621, 0.2120257467, 0.0804058835, 0.1571724564, -0.0373992063, 0.311224997, -0.2897292078, -0.1462425441, 0.1092608497, 0.1001144871, -0.3250237703, -0.0430729352, -0.2508809268, 0.0265301894, 0.4807167053, 0.4030669034, -0.3020351827, -0.448857367, -0.0142153036, 0.0474352241, -0.2095986903, -0.1977832764, -0.2662701607, -0.4505194724, -0.0922013447, -0.0910783634, 0.5540917516, -0.011968025, 0.2859901786, 0.028919749, -0.2357486635, 0.2654162347, 0.3301908374, -0.0371143222, 0.5644022226, -0.2395818383, 0.0057375585, -0.0657552332, -0.0843300968, 0.290147543, 0.4803260267, -0.1859406531, -0.150452897, 0.1800045967, -0.2238452286, 0.4223895967, 0.1663807482, 0.188503623, 0.0188957863, -0.29500857, -0.0011860448, -0.1358926147, 0.1362025291, 0.3885797262, -0.1082976833, -0.4188083112, -0.3653251529, 0.1768364757, 0.3088773191, 0.1055982411, -0.2310435921, -0.1721606702, -0.2617762387, -0.1415584534, 0.466368705, 1.016680479, 0.0301854946, 0.4335706234, 0.1726905853, 0.0897264555, 0.0607271194, -0.4444867671, 0.2049940377, -0.3482038975, -0.3285881579, -0.2036453038, -0.2574142814, -0.0620908923, 0.202615574, 0.0319125392, 0.6626027226, 0.2256911695, -0.0447898321, 0.0229515862, 0.2159699798, 0.0093683377, -0.3867394924, -0.3745245934, 0.0040316037, -0.2863348722, 0.0149859441, -0.1535771489, -0.2083835751, -0.0591488183, 0.1994760782, 0.139966473, 0.2819464505, 0.0934469849, -0.1829061806, 0.4239275753, -0.5605941415, -0.0533473864, 0.2428724766, 0.0773039609, -0.3221908212, 0.0031520156, 0.2361229062, 0.4050419033, 0.1009968892, 0.3913240731, -0.3321993351, 0.2601027489, 0.0498279035, 0.1221914217, -0.2428604513, 0.1581603438, -0.037263155, -0.4174324572, 0.0479723066, -0.1750264019, -0.2749731541, -0.208798945, 0.0269384757, -0.1443695277, -0.0497384518, 0.0549407825, 0.2594360113, -0.0902869329, 0.1481013596, 0.1132919788, -0.2592059672, 0.1990917921, 0.0831906796, 0.2976745665, -0.3125317395, 0.0376103409, 0.2482127249, 0.0151348505, -0.0992359743, 0.1805817485, 0.4821509421, -0.6173614264, 0.033747986, -0.2434503287, -0.0137990471, -0.0163006019, 0.1851168722, 0.0020550445, -0.2624996603, 0.1627748311, -0.2828573585, -0.3409925401, 0.3751991689, 0.1163777336, 0.2782914639, -0.1979854256, 0.0098257745, 0.1509939581, -0.2200444043, -0.2390499711, 0.1753159463, -0.1794704497, 0.1961243898, -0.1157645807, -0.096291557, 0.0804040283, -0.0942010507, -0.0249696225, 0.2664696276, -0.1458446532, -0.0578537472, 0.0179339554, 0.1243914887, 0.1327525228, -0.1157702953, 0.1248916537, 0.1200046539, -0.0515409447, -0.1373375356, -0.113568075, 0.1800016612, 0.0228337981, 0.2303532958, -0.2976278961, 0.0392740294, -0.1231657714, 0.2310593277, 0.1895390302, 0.1202055961, 0.0657508895, 0.2072516233, -0.0511192381, 0.0248661097, -0.5182060599, 0.2064266652, 0.1967261434, 0.3688438237, 0.2152001262, -0.1553563029, 0.1056381389, -0.0322780013, 0.1498686522, 0.3083647192, -0.2699720263, -0.0058443975, 0.2419039458, 0.1483671963, -0.1588441879, -0.0049724015, 0.3671053946, 0.0078913039, 0.0080683846, 0.4790735543, 0.3525026143, 0.1368153542, -0.1463457644, 0.0633270666, 0.2355750352, -0.253526926, 0.0676124915, 0.4052128792, -0.0051034992, 0.1394569427, 0.5995877385, 0.033287935, -0.1143289655, 0.6000964642, 0.3011857271, 0.7809860706, 0.1995598972, 0.1787549555, -0.0658111572, -0.1044645533, -0.4129894376, 0.2548291385, 0.1273965687, 0.1769530177, 0.0383531526, 0.1432870328, 0.1453570873, -0.1860470623, -0.0964768752, 0.1134998649, -0.3404926062, 0.0229306072, -0.331787169, -0.2342437655, -0.1217744276, -0.1177005842, -0.1722742766, 0.0367379189, 0.061489176, 0.1339389831, -0.0074613397, -0.0612119511, 0.0823543221, 0.2852356136, 0.0478240587, -0.1977072954, 0.5288455486, 0.033901304, -0.0469574369, -0.1587119251, 0.2742473185, 0.2531480491, 0.2315031588, -0.0519733541, -0.1070038155, 0.3387275934, -0.1102280691, -0.0296933986, 0.1004740819, 0.2005060017, 0.2549167871, 0.1804340929, 0.0651819706, -0.0043521901, 0.3010005653, 0.0695357993, -0.1928669214, 0.2435856014, 0.2801608145, 0.186145395, -0.2890455425, -0.1294614822, -0.2241022438, -0.3388959169, -0.1642102897, 0.3142122328, -0.1428409219, 0.2404809445, -0.1308151335, 0.0508457273, 0.0420493893, 0.1968672425, 0.1187226325, 0.1140163317, -0.4945982099, -0.0885236338, -0.7457129955, 0.2005532831, -0.3096918166, -0.2826578021, 0.2355700582, 0.0266046468, -0.0474612005, 0.3023000062, -0.2346743494, 0.2289669961, 0.0685478672, 0.3347984552, -0.6064156294, 0.0685798079, 0.2317824364, 0.3589983284, 0.0531914718, -0.1249812767, -0.2764686048, 0.2186532766, -0.0702892765, -0.0727588385, -0.068544358, -0.1896738559, -0.0558260791, 0.2673412263, -0.2124232501, 0.1567766368, -0.0746059716, -0.1744634658, -0.2747465074, -0.0597103275, -0.1644855738, 0.0210560095, 0.1005385146, 0.3167755306, 0.0033467624, 0.1547868997, -0.3915069699, -0.2984789014, 0.0132770455, 0.0827493668, -0.3641845286, 0.4328106046, -0.2321624309, 0.1437951177, 0.0377222784, 0.2259717435, 0.0746320784, -0.0033207415, -0.1593917608, -0.4455849826, 0.2613029778, 0.2699011862, -0.1986568272, -0.119501844, 0.0043352814, 0.1073931754, 0.1258694977, -0.4479654729, 0.1364088356, 0.1799705029, -0.0451218672, -0.0945754424, 0.0839961693, -0.0237166304, -0.0781786218, -0.1301056743, 0.1238040254, -0.0262832958, -0.1145849153, -0.2040124089, -0.1585309207 ]
https://github.com/huggingface/datasets/issues/425
Correct data structure for PAN-X task in XTREME dataset?
Hi ! You have to point to your local script. First clone the repo and then: ```python dataset = load_dataset("./datasets/xtreme", "PAN-X.en") ``` The "xtreme" directory contains "xtreme.py". You also have to change the features definition in the `_info` method. You could use: ```python features = nlp.Features({ "words": [nlp.Value("string")], "ner_tags": [nlp.Value("string")], "langs": [nlp.Value("string")], }) ``` Hope this helps ! Let me know if you have other questions.
Hi 🤗 team! ## Description of the problem Thanks to the fix from #416 I am now able to load the NER task in the XTREME dataset as follows: ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') dataset_train = dataset['train'] ``` However, I am not sure that `load_dataset()` is returning the correct data structure for NER. Currently, every row in `dataset_train` is of the form ```python {'word': str, 'ner_tag': str, 'lang': str} ``` but I think we actually want something like ```python {'words': List[str], 'ner_tags': List[str], 'langs': List[str]} ``` so that each row corresponds to a _sequence_ of words associated with each example. With the current data structure I do not think it is possible to transform `dataset_train` into a form suitable for training because we do not know the boundaries between examples. Indeed, [this line](https://github.com/google-research/xtreme/blob/522434d1aece34131d997a97ce7e9242a51a688a/third_party/utils_tag.py#L58) in the XTREME repo, processes the texts as lists of sentences, tags, and languages. ## Proposed solution Replace ```python with open(filepath) as f: data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE) for id_, row in enumerate(data): if row: lang, word = row[0].split(":")[0], row[0].split(":")[1] tag = row[1] yield id_, {"word": word, "ner_tag": tag, "lang": lang} ``` from [these lines](https://github.com/huggingface/nlp/blob/ce7d3a1d630b78fe27188d1706f3ea980e8eec43/datasets/xtreme/xtreme.py#L881-L887) of the `_generate_examples()` function with something like ```python guid_index = 1 with open(filepath, encoding="utf-8") as f: words = [] ner_tags = [] langs = [] for line in f: if line.startswith("-DOCSTART-") or line == "" or line == "\n": if words: yield guid_index, {"words": words, "ner_tags": ner_tags, "langs": langs} guid_index += 1 words = [] ner_tags = [] else: # pan-x data is tab separated splits = line.split("\t") # strip out en: prefix langs.append(splits[0][:2]) words.append(splits[0][3:]) if len(splits) > 1: labels.append(splits[-1].replace("\n", "")) else: # examples have no label in test set labels.append("O") ``` If you agree, me or @lvwerra would be happy to implement this and create a PR.
66
Correct data structure for PAN-X task in XTREME dataset? Hi 🤗 team! ## Description of the problem Thanks to the fix from #416 I am now able to load the NER task in the XTREME dataset as follows: ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') dataset_train = dataset['train'] ``` However, I am not sure that `load_dataset()` is returning the correct data structure for NER. Currently, every row in `dataset_train` is of the form ```python {'word': str, 'ner_tag': str, 'lang': str} ``` but I think we actually want something like ```python {'words': List[str], 'ner_tags': List[str], 'langs': List[str]} ``` so that each row corresponds to a _sequence_ of words associated with each example. With the current data structure I do not think it is possible to transform `dataset_train` into a form suitable for training because we do not know the boundaries between examples. Indeed, [this line](https://github.com/google-research/xtreme/blob/522434d1aece34131d997a97ce7e9242a51a688a/third_party/utils_tag.py#L58) in the XTREME repo, processes the texts as lists of sentences, tags, and languages. ## Proposed solution Replace ```python with open(filepath) as f: data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE) for id_, row in enumerate(data): if row: lang, word = row[0].split(":")[0], row[0].split(":")[1] tag = row[1] yield id_, {"word": word, "ner_tag": tag, "lang": lang} ``` from [these lines](https://github.com/huggingface/nlp/blob/ce7d3a1d630b78fe27188d1706f3ea980e8eec43/datasets/xtreme/xtreme.py#L881-L887) of the `_generate_examples()` function with something like ```python guid_index = 1 with open(filepath, encoding="utf-8") as f: words = [] ner_tags = [] langs = [] for line in f: if line.startswith("-DOCSTART-") or line == "" or line == "\n": if words: yield guid_index, {"words": words, "ner_tags": ner_tags, "langs": langs} guid_index += 1 words = [] ner_tags = [] else: # pan-x data is tab separated splits = line.split("\t") # strip out en: prefix langs.append(splits[0][:2]) words.append(splits[0][3:]) if len(splits) > 1: labels.append(splits[-1].replace("\n", "")) else: # examples have no label in test set labels.append("O") ``` If you agree, me or @lvwerra would be happy to implement this and create a PR. Hi ! You have to point to your local script. First clone the repo and then: ```python dataset = load_dataset("./datasets/xtreme", "PAN-X.en") ``` The "xtreme" directory contains "xtreme.py". You also have to change the features definition in the `_info` method. You could use: ```python features = nlp.Features({ "words": [nlp.Value("string")], "ner_tags": [nlp.Value("string")], "langs": [nlp.Value("string")], }) ``` Hope this helps ! Let me know if you have other questions.
[ -0.0446427278, -0.1960522234, -0.0213917997, 0.3716608882, 0.0390403457, -0.2763309777, -0.0206369758, 0.157951355, -0.071780622, -0.0662425384, -0.161353007, 0.2627064884, 0.0014277752, 0.1680825502, 0.4264351726, -0.1467024237, 0.0484423041, -0.0699054077, 0.2786859572, -0.0526145585, -0.1090930626, 0.1506101638, -0.3253746033, 0.0544693321, -0.3497872949, 0.0837274864, -0.0678213611, 0.346239835, -0.275839299, -0.4933687747, 0.5901549459, 0.0610430464, 0.3375475705, 0.3253482878, -0.0001185824, 0.0073941094, 0.0491499938, -0.2976796329, 0.0629999414, -0.5153079033, -0.2116062641, -0.6882326603, -0.0707504675, -0.1863515228, -0.2494242042, -0.0691497847, 0.2359092385, 0.1613157243, 0.3286875486, 0.4041300714, 0.0667554438, 0.1186722666, -0.0112287104, 0.1646236926, 0.406904608, 0.391261071, -0.2984110713, -0.0554718301, 0.5836412907, 0.1500934958, -0.200723961, 0.2261364907, 0.0665779114, -0.0957409441, 0.2168320119, 0.3117487431, 0.1106215715, -0.458388716, -0.2030347884, 0.2828918993, 0.230435282, -0.2553839386, -0.2035079151, -0.27793172, -0.0572836995, -0.2900473475, -0.0280276984, 0.3609625995, -0.0808848813, -0.0090990355, 0.2543645501, -0.0029823852, -0.1114810929, 0.2031375468, -0.0105204023, 0.4096218646, -0.0134638967, -0.1075180918, -0.1396068931, -0.1162078902, 0.701856792, -0.0104259066, 0.1576863527, 0.1197109818, -0.6041289568, 0.0803793371, -0.1363221705, -0.2818923295, 0.1663051248, -0.0484370962, 0.2098661065, 0.1589149088, 0.1485236585, 0.0145869944, 0.3213758767, 0.2003956288, 0.2381375432, 0.0310103986, -0.1307128817, 0.0734809935, 0.0858035386, -0.0963583961, -0.318375051, 0.0653055012, 0.2368325442, -0.0228068549, 0.2889069021, -0.1962371022, -0.3680241704, -0.0199918188, -0.1284304559, 0.0725801587, 0.141478762, 0.061180193, 0.0080608455, 0.5874382257, -0.0742887408, 0.1787088513, -0.253834039, 0.0291408636, -0.1472997218, 0.169409737, -0.6243600249, -0.1061868072, 0.2582581341, 0.0919620246, 0.1970394403, -0.0064031417, 0.1218203828, -0.3322490156, 0.1758815497, -0.2791434824, 0.2651099563, -0.0158672649, 0.2457382679, -0.1295720637, -0.3093242645, -0.0095197419, -0.1647401303, 0.2194372565, -0.7123693824, -0.0245732255, 0.0450957865, 0.0754592121, -0.2141941786, 0.1435737163, -0.504322648, 0.0322592966, 0.0630440786, 0.2181686908, 0.1069046184, -0.3306137621, -0.2142897695, -0.0720487833, 0.0830699205, 0.1326567531, -0.1291508824, 0.0973816738, 0.063099049, 0.0002565257, 0.1041970327, 0.2162795961, -0.0109666931, 0.2841814458, -0.1886345595, 0.5723384619, 0.4195817709, -0.803727746, -0.3378545046, 0.0875090808, -0.1656144559, 0.0018319889, -0.0777147934, 0.299970746, 0.2168300003, -0.1097092181, 0.2860380411, 0.4717786908, -0.0601556636, 0.1129641086, -0.1055826545, 0.2662769854, -0.1180939749, 0.3215995729, 0.0420975909, -0.2685295939, -0.1594627202, 0.0751416609, 0.1948618442, -0.1158281565, 0.0870856121, 0.4314537644, 0.0892731249, -0.0513845123, -0.0506237522, 0.0383253694, -0.7624905705, 0.1141010821, -0.4289599061, 0.3793444335, 0.0106571624, -0.0671950951, -0.1728421748, -0.0510761961, -0.296261996, -0.1906543374, 0.1071609929, -0.1209992543, -0.1237813979, -0.3034521341, -0.0762855262, 0.3974153399, -0.2260979116, 0.0737623796, -0.5780184269, 0.3407833874, 0.1180049926, -0.066484876, -0.0123105831, 0.4472563267, 0.1922498792, -0.0482968092, 0.1684597731, 0.2209219635, 0.2148897499, -0.1571742296, -0.0612337142, -0.0020259316, 0.1334933043, -0.5777856112, 0.0659278557, 0.2230993956, -0.0014227685, -0.2143049985, -0.1243549362, 0.5517564416, 0.1847703755, 0.2072840929, 0.0289731026, 0.0707498938, 0.2122235745, -0.1713617742, -0.2344334275, -0.103904739, 0.1545493901, 0.123317495, 0.030547291, 0.0995656848, -0.5023414493, 0.0200130492, 0.3077194989, 0.0274301395, 0.1898183972, 0.2047272623, -0.1531091183, -0.0791651681, 0.037457712, 0.3701201379, 0.3590866029, 0.0914273858, 0.1098856702, 0.1304073632, -0.0329411849, 0.0724883303, -0.0358843245, 0.0617540814, 0.1510176361, 0.2119650096, 0.1785158366, -0.0841949955, -0.085896492, -0.2191503793, 0.0321779102, 0.1521632224, -0.3295001984, 0.0780692771, 0.036821641, -0.4502651691, -0.1473740488, 0.0441723317, -0.1361574978, -0.3193360865, -0.0379221328, -0.0571563095, 0.2387745976, 0.0840667039, -0.4746883214, -0.2150862366, -0.1986019313, -0.3406286836, -0.0583146177, 0.0742932856, -0.1382386684, -0.0267541558, 0.2119733989, 0.5459079742, -0.0312717967, -0.4353147745, 0.390160799, -0.3872417808, -0.2023116499, 0.3016566038, -0.2638223171, 0.3121580184, 0.2171544731, -0.1040854007, -0.4046022892, 0.1959169209, 0.1874916255, -0.3214800656, -0.3141257763, 0.3168615103, -0.1772631407, -0.0916749239, -0.0264437646, -0.406345427, -0.5237721205, -0.2054874897, 0.011993818, 0.2230314016, 0.3162437379, 0.2151382416, -0.2596665323, -0.1451506466, -0.1321805865, -0.1955114156, 0.0069591696, -0.5726140738, 0.4568422139, -0.2441943884, -0.2051523775, -0.0859806687, -0.2658783495, 0.4713196754, 0.378029108, -0.0684936121, -0.0375404917, 0.1413384229, 0.035182029, 0.1777089536, -0.0622193515, 0.2964115739, -0.2141356915, 0.0457051843, -0.0277898367, -0.0081240581, 0.0785254315, 0.3201450408, 0.2304377407, -0.0265186429, -0.2571677268, 0.1103470922, 0.0635771379, 0.1552903354, 0.0463341251, 0.4367931783, 0.0053787678, 0.1145690531, 0.0847836584, 0.0224085152, -0.1640298665, 0.0601462424, 0.2332694232, -0.0009897219, 0.2357879579, -0.154772833, -0.0720981359, 0.1263709217, -0.1329990178, -0.2151204199, 0.5398621559, -0.1397539973, 0.410523355, -0.1709617525, 0.0268175602, -0.0614329875, -0.4580695033, -0.2571297884, 0.0861497, 0.179715693, 0.1554050446, -0.6861749887, 0.3985427022, -0.3888290823, -0.0206330754, 0.1728509068, 0.5378319621, 0.2120257467, 0.0804058835, 0.1571724564, -0.0373992063, 0.311224997, -0.2897292078, -0.1462425441, 0.1092608497, 0.1001144871, -0.3250237703, -0.0430729352, -0.2508809268, 0.0265301894, 0.4807167053, 0.4030669034, -0.3020351827, -0.448857367, -0.0142153036, 0.0474352241, -0.2095986903, -0.1977832764, -0.2662701607, -0.4505194724, -0.0922013447, -0.0910783634, 0.5540917516, -0.011968025, 0.2859901786, 0.028919749, -0.2357486635, 0.2654162347, 0.3301908374, -0.0371143222, 0.5644022226, -0.2395818383, 0.0057375585, -0.0657552332, -0.0843300968, 0.290147543, 0.4803260267, -0.1859406531, -0.150452897, 0.1800045967, -0.2238452286, 0.4223895967, 0.1663807482, 0.188503623, 0.0188957863, -0.29500857, -0.0011860448, -0.1358926147, 0.1362025291, 0.3885797262, -0.1082976833, -0.4188083112, -0.3653251529, 0.1768364757, 0.3088773191, 0.1055982411, -0.2310435921, -0.1721606702, -0.2617762387, -0.1415584534, 0.466368705, 1.016680479, 0.0301854946, 0.4335706234, 0.1726905853, 0.0897264555, 0.0607271194, -0.4444867671, 0.2049940377, -0.3482038975, -0.3285881579, -0.2036453038, -0.2574142814, -0.0620908923, 0.202615574, 0.0319125392, 0.6626027226, 0.2256911695, -0.0447898321, 0.0229515862, 0.2159699798, 0.0093683377, -0.3867394924, -0.3745245934, 0.0040316037, -0.2863348722, 0.0149859441, -0.1535771489, -0.2083835751, -0.0591488183, 0.1994760782, 0.139966473, 0.2819464505, 0.0934469849, -0.1829061806, 0.4239275753, -0.5605941415, -0.0533473864, 0.2428724766, 0.0773039609, -0.3221908212, 0.0031520156, 0.2361229062, 0.4050419033, 0.1009968892, 0.3913240731, -0.3321993351, 0.2601027489, 0.0498279035, 0.1221914217, -0.2428604513, 0.1581603438, -0.037263155, -0.4174324572, 0.0479723066, -0.1750264019, -0.2749731541, -0.208798945, 0.0269384757, -0.1443695277, -0.0497384518, 0.0549407825, 0.2594360113, -0.0902869329, 0.1481013596, 0.1132919788, -0.2592059672, 0.1990917921, 0.0831906796, 0.2976745665, -0.3125317395, 0.0376103409, 0.2482127249, 0.0151348505, -0.0992359743, 0.1805817485, 0.4821509421, -0.6173614264, 0.033747986, -0.2434503287, -0.0137990471, -0.0163006019, 0.1851168722, 0.0020550445, -0.2624996603, 0.1627748311, -0.2828573585, -0.3409925401, 0.3751991689, 0.1163777336, 0.2782914639, -0.1979854256, 0.0098257745, 0.1509939581, -0.2200444043, -0.2390499711, 0.1753159463, -0.1794704497, 0.1961243898, -0.1157645807, -0.096291557, 0.0804040283, -0.0942010507, -0.0249696225, 0.2664696276, -0.1458446532, -0.0578537472, 0.0179339554, 0.1243914887, 0.1327525228, -0.1157702953, 0.1248916537, 0.1200046539, -0.0515409447, -0.1373375356, -0.113568075, 0.1800016612, 0.0228337981, 0.2303532958, -0.2976278961, 0.0392740294, -0.1231657714, 0.2310593277, 0.1895390302, 0.1202055961, 0.0657508895, 0.2072516233, -0.0511192381, 0.0248661097, -0.5182060599, 0.2064266652, 0.1967261434, 0.3688438237, 0.2152001262, -0.1553563029, 0.1056381389, -0.0322780013, 0.1498686522, 0.3083647192, -0.2699720263, -0.0058443975, 0.2419039458, 0.1483671963, -0.1588441879, -0.0049724015, 0.3671053946, 0.0078913039, 0.0080683846, 0.4790735543, 0.3525026143, 0.1368153542, -0.1463457644, 0.0633270666, 0.2355750352, -0.253526926, 0.0676124915, 0.4052128792, -0.0051034992, 0.1394569427, 0.5995877385, 0.033287935, -0.1143289655, 0.6000964642, 0.3011857271, 0.7809860706, 0.1995598972, 0.1787549555, -0.0658111572, -0.1044645533, -0.4129894376, 0.2548291385, 0.1273965687, 0.1769530177, 0.0383531526, 0.1432870328, 0.1453570873, -0.1860470623, -0.0964768752, 0.1134998649, -0.3404926062, 0.0229306072, -0.331787169, -0.2342437655, -0.1217744276, -0.1177005842, -0.1722742766, 0.0367379189, 0.061489176, 0.1339389831, -0.0074613397, -0.0612119511, 0.0823543221, 0.2852356136, 0.0478240587, -0.1977072954, 0.5288455486, 0.033901304, -0.0469574369, -0.1587119251, 0.2742473185, 0.2531480491, 0.2315031588, -0.0519733541, -0.1070038155, 0.3387275934, -0.1102280691, -0.0296933986, 0.1004740819, 0.2005060017, 0.2549167871, 0.1804340929, 0.0651819706, -0.0043521901, 0.3010005653, 0.0695357993, -0.1928669214, 0.2435856014, 0.2801608145, 0.186145395, -0.2890455425, -0.1294614822, -0.2241022438, -0.3388959169, -0.1642102897, 0.3142122328, -0.1428409219, 0.2404809445, -0.1308151335, 0.0508457273, 0.0420493893, 0.1968672425, 0.1187226325, 0.1140163317, -0.4945982099, -0.0885236338, -0.7457129955, 0.2005532831, -0.3096918166, -0.2826578021, 0.2355700582, 0.0266046468, -0.0474612005, 0.3023000062, -0.2346743494, 0.2289669961, 0.0685478672, 0.3347984552, -0.6064156294, 0.0685798079, 0.2317824364, 0.3589983284, 0.0531914718, -0.1249812767, -0.2764686048, 0.2186532766, -0.0702892765, -0.0727588385, -0.068544358, -0.1896738559, -0.0558260791, 0.2673412263, -0.2124232501, 0.1567766368, -0.0746059716, -0.1744634658, -0.2747465074, -0.0597103275, -0.1644855738, 0.0210560095, 0.1005385146, 0.3167755306, 0.0033467624, 0.1547868997, -0.3915069699, -0.2984789014, 0.0132770455, 0.0827493668, -0.3641845286, 0.4328106046, -0.2321624309, 0.1437951177, 0.0377222784, 0.2259717435, 0.0746320784, -0.0033207415, -0.1593917608, -0.4455849826, 0.2613029778, 0.2699011862, -0.1986568272, -0.119501844, 0.0043352814, 0.1073931754, 0.1258694977, -0.4479654729, 0.1364088356, 0.1799705029, -0.0451218672, -0.0945754424, 0.0839961693, -0.0237166304, -0.0781786218, -0.1301056743, 0.1238040254, -0.0262832958, -0.1145849153, -0.2040124089, -0.1585309207 ]
https://github.com/huggingface/datasets/issues/425
Correct data structure for PAN-X task in XTREME dataset?
Thanks, I am making progress. I got a new error `NonMatchingSplitsSizesError ` (see traceback below), which I suspect is due to the fact that number of rows in the dataset changed (one row per word --> one row per sentence) as well as the number of bytes due to the slightly updated data structure. ```python NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='validation', num_bytes=1756492, num_examples=80536, dataset_name='xtreme'), 'recorded': SplitInfo(name='validation', num_bytes=1837109, num_examples=10000, dataset_name='xtreme')}, {'expected': SplitInfo(name='test', num_bytes=1752572, num_examples=80326, dataset_name='xtreme'), 'recorded': SplitInfo(name='test', num_bytes=1833214, num_examples=10000, dataset_name='xtreme')}, {'expected': SplitInfo(name='train', num_bytes=3496832, num_examples=160394, dataset_name='xtreme'), 'recorded': SplitInfo(name='train', num_bytes=3658428, num_examples=20000, dataset_name='xtreme')}] ``` I can fix the error by replacing the values in the `datasets_infos.json` file, which I tested for English. However, to update this for all 40 datasets manually is slightly painful. Is there a better way to update the expected values for all datasets?
Hi 🤗 team! ## Description of the problem Thanks to the fix from #416 I am now able to load the NER task in the XTREME dataset as follows: ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') dataset_train = dataset['train'] ``` However, I am not sure that `load_dataset()` is returning the correct data structure for NER. Currently, every row in `dataset_train` is of the form ```python {'word': str, 'ner_tag': str, 'lang': str} ``` but I think we actually want something like ```python {'words': List[str], 'ner_tags': List[str], 'langs': List[str]} ``` so that each row corresponds to a _sequence_ of words associated with each example. With the current data structure I do not think it is possible to transform `dataset_train` into a form suitable for training because we do not know the boundaries between examples. Indeed, [this line](https://github.com/google-research/xtreme/blob/522434d1aece34131d997a97ce7e9242a51a688a/third_party/utils_tag.py#L58) in the XTREME repo, processes the texts as lists of sentences, tags, and languages. ## Proposed solution Replace ```python with open(filepath) as f: data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE) for id_, row in enumerate(data): if row: lang, word = row[0].split(":")[0], row[0].split(":")[1] tag = row[1] yield id_, {"word": word, "ner_tag": tag, "lang": lang} ``` from [these lines](https://github.com/huggingface/nlp/blob/ce7d3a1d630b78fe27188d1706f3ea980e8eec43/datasets/xtreme/xtreme.py#L881-L887) of the `_generate_examples()` function with something like ```python guid_index = 1 with open(filepath, encoding="utf-8") as f: words = [] ner_tags = [] langs = [] for line in f: if line.startswith("-DOCSTART-") or line == "" or line == "\n": if words: yield guid_index, {"words": words, "ner_tags": ner_tags, "langs": langs} guid_index += 1 words = [] ner_tags = [] else: # pan-x data is tab separated splits = line.split("\t") # strip out en: prefix langs.append(splits[0][:2]) words.append(splits[0][3:]) if len(splits) > 1: labels.append(splits[-1].replace("\n", "")) else: # examples have no label in test set labels.append("O") ``` If you agree, me or @lvwerra would be happy to implement this and create a PR.
130
Correct data structure for PAN-X task in XTREME dataset? Hi 🤗 team! ## Description of the problem Thanks to the fix from #416 I am now able to load the NER task in the XTREME dataset as follows: ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') dataset_train = dataset['train'] ``` However, I am not sure that `load_dataset()` is returning the correct data structure for NER. Currently, every row in `dataset_train` is of the form ```python {'word': str, 'ner_tag': str, 'lang': str} ``` but I think we actually want something like ```python {'words': List[str], 'ner_tags': List[str], 'langs': List[str]} ``` so that each row corresponds to a _sequence_ of words associated with each example. With the current data structure I do not think it is possible to transform `dataset_train` into a form suitable for training because we do not know the boundaries between examples. Indeed, [this line](https://github.com/google-research/xtreme/blob/522434d1aece34131d997a97ce7e9242a51a688a/third_party/utils_tag.py#L58) in the XTREME repo, processes the texts as lists of sentences, tags, and languages. ## Proposed solution Replace ```python with open(filepath) as f: data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE) for id_, row in enumerate(data): if row: lang, word = row[0].split(":")[0], row[0].split(":")[1] tag = row[1] yield id_, {"word": word, "ner_tag": tag, "lang": lang} ``` from [these lines](https://github.com/huggingface/nlp/blob/ce7d3a1d630b78fe27188d1706f3ea980e8eec43/datasets/xtreme/xtreme.py#L881-L887) of the `_generate_examples()` function with something like ```python guid_index = 1 with open(filepath, encoding="utf-8") as f: words = [] ner_tags = [] langs = [] for line in f: if line.startswith("-DOCSTART-") or line == "" or line == "\n": if words: yield guid_index, {"words": words, "ner_tags": ner_tags, "langs": langs} guid_index += 1 words = [] ner_tags = [] else: # pan-x data is tab separated splits = line.split("\t") # strip out en: prefix langs.append(splits[0][:2]) words.append(splits[0][3:]) if len(splits) > 1: labels.append(splits[-1].replace("\n", "")) else: # examples have no label in test set labels.append("O") ``` If you agree, me or @lvwerra would be happy to implement this and create a PR. Thanks, I am making progress. I got a new error `NonMatchingSplitsSizesError ` (see traceback below), which I suspect is due to the fact that number of rows in the dataset changed (one row per word --> one row per sentence) as well as the number of bytes due to the slightly updated data structure. ```python NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='validation', num_bytes=1756492, num_examples=80536, dataset_name='xtreme'), 'recorded': SplitInfo(name='validation', num_bytes=1837109, num_examples=10000, dataset_name='xtreme')}, {'expected': SplitInfo(name='test', num_bytes=1752572, num_examples=80326, dataset_name='xtreme'), 'recorded': SplitInfo(name='test', num_bytes=1833214, num_examples=10000, dataset_name='xtreme')}, {'expected': SplitInfo(name='train', num_bytes=3496832, num_examples=160394, dataset_name='xtreme'), 'recorded': SplitInfo(name='train', num_bytes=3658428, num_examples=20000, dataset_name='xtreme')}] ``` I can fix the error by replacing the values in the `datasets_infos.json` file, which I tested for English. However, to update this for all 40 datasets manually is slightly painful. Is there a better way to update the expected values for all datasets?
[ -0.0446427278, -0.1960522234, -0.0213917997, 0.3716608882, 0.0390403457, -0.2763309777, -0.0206369758, 0.157951355, -0.071780622, -0.0662425384, -0.161353007, 0.2627064884, 0.0014277752, 0.1680825502, 0.4264351726, -0.1467024237, 0.0484423041, -0.0699054077, 0.2786859572, -0.0526145585, -0.1090930626, 0.1506101638, -0.3253746033, 0.0544693321, -0.3497872949, 0.0837274864, -0.0678213611, 0.346239835, -0.275839299, -0.4933687747, 0.5901549459, 0.0610430464, 0.3375475705, 0.3253482878, -0.0001185824, 0.0073941094, 0.0491499938, -0.2976796329, 0.0629999414, -0.5153079033, -0.2116062641, -0.6882326603, -0.0707504675, -0.1863515228, -0.2494242042, -0.0691497847, 0.2359092385, 0.1613157243, 0.3286875486, 0.4041300714, 0.0667554438, 0.1186722666, -0.0112287104, 0.1646236926, 0.406904608, 0.391261071, -0.2984110713, -0.0554718301, 0.5836412907, 0.1500934958, -0.200723961, 0.2261364907, 0.0665779114, -0.0957409441, 0.2168320119, 0.3117487431, 0.1106215715, -0.458388716, -0.2030347884, 0.2828918993, 0.230435282, -0.2553839386, -0.2035079151, -0.27793172, -0.0572836995, -0.2900473475, -0.0280276984, 0.3609625995, -0.0808848813, -0.0090990355, 0.2543645501, -0.0029823852, -0.1114810929, 0.2031375468, -0.0105204023, 0.4096218646, -0.0134638967, -0.1075180918, -0.1396068931, -0.1162078902, 0.701856792, -0.0104259066, 0.1576863527, 0.1197109818, -0.6041289568, 0.0803793371, -0.1363221705, -0.2818923295, 0.1663051248, -0.0484370962, 0.2098661065, 0.1589149088, 0.1485236585, 0.0145869944, 0.3213758767, 0.2003956288, 0.2381375432, 0.0310103986, -0.1307128817, 0.0734809935, 0.0858035386, -0.0963583961, -0.318375051, 0.0653055012, 0.2368325442, -0.0228068549, 0.2889069021, -0.1962371022, -0.3680241704, -0.0199918188, -0.1284304559, 0.0725801587, 0.141478762, 0.061180193, 0.0080608455, 0.5874382257, -0.0742887408, 0.1787088513, -0.253834039, 0.0291408636, -0.1472997218, 0.169409737, -0.6243600249, -0.1061868072, 0.2582581341, 0.0919620246, 0.1970394403, -0.0064031417, 0.1218203828, -0.3322490156, 0.1758815497, -0.2791434824, 0.2651099563, -0.0158672649, 0.2457382679, -0.1295720637, -0.3093242645, -0.0095197419, -0.1647401303, 0.2194372565, -0.7123693824, -0.0245732255, 0.0450957865, 0.0754592121, -0.2141941786, 0.1435737163, -0.504322648, 0.0322592966, 0.0630440786, 0.2181686908, 0.1069046184, -0.3306137621, -0.2142897695, -0.0720487833, 0.0830699205, 0.1326567531, -0.1291508824, 0.0973816738, 0.063099049, 0.0002565257, 0.1041970327, 0.2162795961, -0.0109666931, 0.2841814458, -0.1886345595, 0.5723384619, 0.4195817709, -0.803727746, -0.3378545046, 0.0875090808, -0.1656144559, 0.0018319889, -0.0777147934, 0.299970746, 0.2168300003, -0.1097092181, 0.2860380411, 0.4717786908, -0.0601556636, 0.1129641086, -0.1055826545, 0.2662769854, -0.1180939749, 0.3215995729, 0.0420975909, -0.2685295939, -0.1594627202, 0.0751416609, 0.1948618442, -0.1158281565, 0.0870856121, 0.4314537644, 0.0892731249, -0.0513845123, -0.0506237522, 0.0383253694, -0.7624905705, 0.1141010821, -0.4289599061, 0.3793444335, 0.0106571624, -0.0671950951, -0.1728421748, -0.0510761961, -0.296261996, -0.1906543374, 0.1071609929, -0.1209992543, -0.1237813979, -0.3034521341, -0.0762855262, 0.3974153399, -0.2260979116, 0.0737623796, -0.5780184269, 0.3407833874, 0.1180049926, -0.066484876, -0.0123105831, 0.4472563267, 0.1922498792, -0.0482968092, 0.1684597731, 0.2209219635, 0.2148897499, -0.1571742296, -0.0612337142, -0.0020259316, 0.1334933043, -0.5777856112, 0.0659278557, 0.2230993956, -0.0014227685, -0.2143049985, -0.1243549362, 0.5517564416, 0.1847703755, 0.2072840929, 0.0289731026, 0.0707498938, 0.2122235745, -0.1713617742, -0.2344334275, -0.103904739, 0.1545493901, 0.123317495, 0.030547291, 0.0995656848, -0.5023414493, 0.0200130492, 0.3077194989, 0.0274301395, 0.1898183972, 0.2047272623, -0.1531091183, -0.0791651681, 0.037457712, 0.3701201379, 0.3590866029, 0.0914273858, 0.1098856702, 0.1304073632, -0.0329411849, 0.0724883303, -0.0358843245, 0.0617540814, 0.1510176361, 0.2119650096, 0.1785158366, -0.0841949955, -0.085896492, -0.2191503793, 0.0321779102, 0.1521632224, -0.3295001984, 0.0780692771, 0.036821641, -0.4502651691, -0.1473740488, 0.0441723317, -0.1361574978, -0.3193360865, -0.0379221328, -0.0571563095, 0.2387745976, 0.0840667039, -0.4746883214, -0.2150862366, -0.1986019313, -0.3406286836, -0.0583146177, 0.0742932856, -0.1382386684, -0.0267541558, 0.2119733989, 0.5459079742, -0.0312717967, -0.4353147745, 0.390160799, -0.3872417808, -0.2023116499, 0.3016566038, -0.2638223171, 0.3121580184, 0.2171544731, -0.1040854007, -0.4046022892, 0.1959169209, 0.1874916255, -0.3214800656, -0.3141257763, 0.3168615103, -0.1772631407, -0.0916749239, -0.0264437646, -0.406345427, -0.5237721205, -0.2054874897, 0.011993818, 0.2230314016, 0.3162437379, 0.2151382416, -0.2596665323, -0.1451506466, -0.1321805865, -0.1955114156, 0.0069591696, -0.5726140738, 0.4568422139, -0.2441943884, -0.2051523775, -0.0859806687, -0.2658783495, 0.4713196754, 0.378029108, -0.0684936121, -0.0375404917, 0.1413384229, 0.035182029, 0.1777089536, -0.0622193515, 0.2964115739, -0.2141356915, 0.0457051843, -0.0277898367, -0.0081240581, 0.0785254315, 0.3201450408, 0.2304377407, -0.0265186429, -0.2571677268, 0.1103470922, 0.0635771379, 0.1552903354, 0.0463341251, 0.4367931783, 0.0053787678, 0.1145690531, 0.0847836584, 0.0224085152, -0.1640298665, 0.0601462424, 0.2332694232, -0.0009897219, 0.2357879579, -0.154772833, -0.0720981359, 0.1263709217, -0.1329990178, -0.2151204199, 0.5398621559, -0.1397539973, 0.410523355, -0.1709617525, 0.0268175602, -0.0614329875, -0.4580695033, -0.2571297884, 0.0861497, 0.179715693, 0.1554050446, -0.6861749887, 0.3985427022, -0.3888290823, -0.0206330754, 0.1728509068, 0.5378319621, 0.2120257467, 0.0804058835, 0.1571724564, -0.0373992063, 0.311224997, -0.2897292078, -0.1462425441, 0.1092608497, 0.1001144871, -0.3250237703, -0.0430729352, -0.2508809268, 0.0265301894, 0.4807167053, 0.4030669034, -0.3020351827, -0.448857367, -0.0142153036, 0.0474352241, -0.2095986903, -0.1977832764, -0.2662701607, -0.4505194724, -0.0922013447, -0.0910783634, 0.5540917516, -0.011968025, 0.2859901786, 0.028919749, -0.2357486635, 0.2654162347, 0.3301908374, -0.0371143222, 0.5644022226, -0.2395818383, 0.0057375585, -0.0657552332, -0.0843300968, 0.290147543, 0.4803260267, -0.1859406531, -0.150452897, 0.1800045967, -0.2238452286, 0.4223895967, 0.1663807482, 0.188503623, 0.0188957863, -0.29500857, -0.0011860448, -0.1358926147, 0.1362025291, 0.3885797262, -0.1082976833, -0.4188083112, -0.3653251529, 0.1768364757, 0.3088773191, 0.1055982411, -0.2310435921, -0.1721606702, -0.2617762387, -0.1415584534, 0.466368705, 1.016680479, 0.0301854946, 0.4335706234, 0.1726905853, 0.0897264555, 0.0607271194, -0.4444867671, 0.2049940377, -0.3482038975, -0.3285881579, -0.2036453038, -0.2574142814, -0.0620908923, 0.202615574, 0.0319125392, 0.6626027226, 0.2256911695, -0.0447898321, 0.0229515862, 0.2159699798, 0.0093683377, -0.3867394924, -0.3745245934, 0.0040316037, -0.2863348722, 0.0149859441, -0.1535771489, -0.2083835751, -0.0591488183, 0.1994760782, 0.139966473, 0.2819464505, 0.0934469849, -0.1829061806, 0.4239275753, -0.5605941415, -0.0533473864, 0.2428724766, 0.0773039609, -0.3221908212, 0.0031520156, 0.2361229062, 0.4050419033, 0.1009968892, 0.3913240731, -0.3321993351, 0.2601027489, 0.0498279035, 0.1221914217, -0.2428604513, 0.1581603438, -0.037263155, -0.4174324572, 0.0479723066, -0.1750264019, -0.2749731541, -0.208798945, 0.0269384757, -0.1443695277, -0.0497384518, 0.0549407825, 0.2594360113, -0.0902869329, 0.1481013596, 0.1132919788, -0.2592059672, 0.1990917921, 0.0831906796, 0.2976745665, -0.3125317395, 0.0376103409, 0.2482127249, 0.0151348505, -0.0992359743, 0.1805817485, 0.4821509421, -0.6173614264, 0.033747986, -0.2434503287, -0.0137990471, -0.0163006019, 0.1851168722, 0.0020550445, -0.2624996603, 0.1627748311, -0.2828573585, -0.3409925401, 0.3751991689, 0.1163777336, 0.2782914639, -0.1979854256, 0.0098257745, 0.1509939581, -0.2200444043, -0.2390499711, 0.1753159463, -0.1794704497, 0.1961243898, -0.1157645807, -0.096291557, 0.0804040283, -0.0942010507, -0.0249696225, 0.2664696276, -0.1458446532, -0.0578537472, 0.0179339554, 0.1243914887, 0.1327525228, -0.1157702953, 0.1248916537, 0.1200046539, -0.0515409447, -0.1373375356, -0.113568075, 0.1800016612, 0.0228337981, 0.2303532958, -0.2976278961, 0.0392740294, -0.1231657714, 0.2310593277, 0.1895390302, 0.1202055961, 0.0657508895, 0.2072516233, -0.0511192381, 0.0248661097, -0.5182060599, 0.2064266652, 0.1967261434, 0.3688438237, 0.2152001262, -0.1553563029, 0.1056381389, -0.0322780013, 0.1498686522, 0.3083647192, -0.2699720263, -0.0058443975, 0.2419039458, 0.1483671963, -0.1588441879, -0.0049724015, 0.3671053946, 0.0078913039, 0.0080683846, 0.4790735543, 0.3525026143, 0.1368153542, -0.1463457644, 0.0633270666, 0.2355750352, -0.253526926, 0.0676124915, 0.4052128792, -0.0051034992, 0.1394569427, 0.5995877385, 0.033287935, -0.1143289655, 0.6000964642, 0.3011857271, 0.7809860706, 0.1995598972, 0.1787549555, -0.0658111572, -0.1044645533, -0.4129894376, 0.2548291385, 0.1273965687, 0.1769530177, 0.0383531526, 0.1432870328, 0.1453570873, -0.1860470623, -0.0964768752, 0.1134998649, -0.3404926062, 0.0229306072, -0.331787169, -0.2342437655, -0.1217744276, -0.1177005842, -0.1722742766, 0.0367379189, 0.061489176, 0.1339389831, -0.0074613397, -0.0612119511, 0.0823543221, 0.2852356136, 0.0478240587, -0.1977072954, 0.5288455486, 0.033901304, -0.0469574369, -0.1587119251, 0.2742473185, 0.2531480491, 0.2315031588, -0.0519733541, -0.1070038155, 0.3387275934, -0.1102280691, -0.0296933986, 0.1004740819, 0.2005060017, 0.2549167871, 0.1804340929, 0.0651819706, -0.0043521901, 0.3010005653, 0.0695357993, -0.1928669214, 0.2435856014, 0.2801608145, 0.186145395, -0.2890455425, -0.1294614822, -0.2241022438, -0.3388959169, -0.1642102897, 0.3142122328, -0.1428409219, 0.2404809445, -0.1308151335, 0.0508457273, 0.0420493893, 0.1968672425, 0.1187226325, 0.1140163317, -0.4945982099, -0.0885236338, -0.7457129955, 0.2005532831, -0.3096918166, -0.2826578021, 0.2355700582, 0.0266046468, -0.0474612005, 0.3023000062, -0.2346743494, 0.2289669961, 0.0685478672, 0.3347984552, -0.6064156294, 0.0685798079, 0.2317824364, 0.3589983284, 0.0531914718, -0.1249812767, -0.2764686048, 0.2186532766, -0.0702892765, -0.0727588385, -0.068544358, -0.1896738559, -0.0558260791, 0.2673412263, -0.2124232501, 0.1567766368, -0.0746059716, -0.1744634658, -0.2747465074, -0.0597103275, -0.1644855738, 0.0210560095, 0.1005385146, 0.3167755306, 0.0033467624, 0.1547868997, -0.3915069699, -0.2984789014, 0.0132770455, 0.0827493668, -0.3641845286, 0.4328106046, -0.2321624309, 0.1437951177, 0.0377222784, 0.2259717435, 0.0746320784, -0.0033207415, -0.1593917608, -0.4455849826, 0.2613029778, 0.2699011862, -0.1986568272, -0.119501844, 0.0043352814, 0.1073931754, 0.1258694977, -0.4479654729, 0.1364088356, 0.1799705029, -0.0451218672, -0.0945754424, 0.0839961693, -0.0237166304, -0.0781786218, -0.1301056743, 0.1238040254, -0.0262832958, -0.1145849153, -0.2040124089, -0.1585309207 ]
https://github.com/huggingface/datasets/issues/425
Correct data structure for PAN-X task in XTREME dataset?
One more thing about features. I mentioned ```python features = nlp.Features({ "words": [nlp.Value("string")], "ner_tags": [nlp.Value("string")], "langs": [nlp.Value("string")], }) ``` but it's actually not consistent with the way we write datasets. Something like this is simpler to read and more consistent with the way we define datasets: ```python features = nlp.Features({ "words": nlp.Sequence(nlp.Value("string")), "ner_tags": nlp.Sequence(nlp.Value("string")), "langs": nlp.Sequence(nlp.Value("string")), }) ``` Sorry about that
Hi 🤗 team! ## Description of the problem Thanks to the fix from #416 I am now able to load the NER task in the XTREME dataset as follows: ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') dataset_train = dataset['train'] ``` However, I am not sure that `load_dataset()` is returning the correct data structure for NER. Currently, every row in `dataset_train` is of the form ```python {'word': str, 'ner_tag': str, 'lang': str} ``` but I think we actually want something like ```python {'words': List[str], 'ner_tags': List[str], 'langs': List[str]} ``` so that each row corresponds to a _sequence_ of words associated with each example. With the current data structure I do not think it is possible to transform `dataset_train` into a form suitable for training because we do not know the boundaries between examples. Indeed, [this line](https://github.com/google-research/xtreme/blob/522434d1aece34131d997a97ce7e9242a51a688a/third_party/utils_tag.py#L58) in the XTREME repo, processes the texts as lists of sentences, tags, and languages. ## Proposed solution Replace ```python with open(filepath) as f: data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE) for id_, row in enumerate(data): if row: lang, word = row[0].split(":")[0], row[0].split(":")[1] tag = row[1] yield id_, {"word": word, "ner_tag": tag, "lang": lang} ``` from [these lines](https://github.com/huggingface/nlp/blob/ce7d3a1d630b78fe27188d1706f3ea980e8eec43/datasets/xtreme/xtreme.py#L881-L887) of the `_generate_examples()` function with something like ```python guid_index = 1 with open(filepath, encoding="utf-8") as f: words = [] ner_tags = [] langs = [] for line in f: if line.startswith("-DOCSTART-") or line == "" or line == "\n": if words: yield guid_index, {"words": words, "ner_tags": ner_tags, "langs": langs} guid_index += 1 words = [] ner_tags = [] else: # pan-x data is tab separated splits = line.split("\t") # strip out en: prefix langs.append(splits[0][:2]) words.append(splits[0][3:]) if len(splits) > 1: labels.append(splits[-1].replace("\n", "")) else: # examples have no label in test set labels.append("O") ``` If you agree, me or @lvwerra would be happy to implement this and create a PR.
61
Correct data structure for PAN-X task in XTREME dataset? Hi 🤗 team! ## Description of the problem Thanks to the fix from #416 I am now able to load the NER task in the XTREME dataset as follows: ```python from nlp import load_dataset # AmazonPhotos.zip is located in data/ dataset = load_dataset("xtreme", "PAN-X.en", data_dir='./data') dataset_train = dataset['train'] ``` However, I am not sure that `load_dataset()` is returning the correct data structure for NER. Currently, every row in `dataset_train` is of the form ```python {'word': str, 'ner_tag': str, 'lang': str} ``` but I think we actually want something like ```python {'words': List[str], 'ner_tags': List[str], 'langs': List[str]} ``` so that each row corresponds to a _sequence_ of words associated with each example. With the current data structure I do not think it is possible to transform `dataset_train` into a form suitable for training because we do not know the boundaries between examples. Indeed, [this line](https://github.com/google-research/xtreme/blob/522434d1aece34131d997a97ce7e9242a51a688a/third_party/utils_tag.py#L58) in the XTREME repo, processes the texts as lists of sentences, tags, and languages. ## Proposed solution Replace ```python with open(filepath) as f: data = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE) for id_, row in enumerate(data): if row: lang, word = row[0].split(":")[0], row[0].split(":")[1] tag = row[1] yield id_, {"word": word, "ner_tag": tag, "lang": lang} ``` from [these lines](https://github.com/huggingface/nlp/blob/ce7d3a1d630b78fe27188d1706f3ea980e8eec43/datasets/xtreme/xtreme.py#L881-L887) of the `_generate_examples()` function with something like ```python guid_index = 1 with open(filepath, encoding="utf-8") as f: words = [] ner_tags = [] langs = [] for line in f: if line.startswith("-DOCSTART-") or line == "" or line == "\n": if words: yield guid_index, {"words": words, "ner_tags": ner_tags, "langs": langs} guid_index += 1 words = [] ner_tags = [] else: # pan-x data is tab separated splits = line.split("\t") # strip out en: prefix langs.append(splits[0][:2]) words.append(splits[0][3:]) if len(splits) > 1: labels.append(splits[-1].replace("\n", "")) else: # examples have no label in test set labels.append("O") ``` If you agree, me or @lvwerra would be happy to implement this and create a PR. One more thing about features. I mentioned ```python features = nlp.Features({ "words": [nlp.Value("string")], "ner_tags": [nlp.Value("string")], "langs": [nlp.Value("string")], }) ``` but it's actually not consistent with the way we write datasets. Something like this is simpler to read and more consistent with the way we define datasets: ```python features = nlp.Features({ "words": nlp.Sequence(nlp.Value("string")), "ner_tags": nlp.Sequence(nlp.Value("string")), "langs": nlp.Sequence(nlp.Value("string")), }) ``` Sorry about that
[ -0.0446427278, -0.1960522234, -0.0213917997, 0.3716608882, 0.0390403457, -0.2763309777, -0.0206369758, 0.157951355, -0.071780622, -0.0662425384, -0.161353007, 0.2627064884, 0.0014277752, 0.1680825502, 0.4264351726, -0.1467024237, 0.0484423041, -0.0699054077, 0.2786859572, -0.0526145585, -0.1090930626, 0.1506101638, -0.3253746033, 0.0544693321, -0.3497872949, 0.0837274864, -0.0678213611, 0.346239835, -0.275839299, -0.4933687747, 0.5901549459, 0.0610430464, 0.3375475705, 0.3253482878, -0.0001185824, 0.0073941094, 0.0491499938, -0.2976796329, 0.0629999414, -0.5153079033, -0.2116062641, -0.6882326603, -0.0707504675, -0.1863515228, -0.2494242042, -0.0691497847, 0.2359092385, 0.1613157243, 0.3286875486, 0.4041300714, 0.0667554438, 0.1186722666, -0.0112287104, 0.1646236926, 0.406904608, 0.391261071, -0.2984110713, -0.0554718301, 0.5836412907, 0.1500934958, -0.200723961, 0.2261364907, 0.0665779114, -0.0957409441, 0.2168320119, 0.3117487431, 0.1106215715, -0.458388716, -0.2030347884, 0.2828918993, 0.230435282, -0.2553839386, -0.2035079151, -0.27793172, -0.0572836995, -0.2900473475, -0.0280276984, 0.3609625995, -0.0808848813, -0.0090990355, 0.2543645501, -0.0029823852, -0.1114810929, 0.2031375468, -0.0105204023, 0.4096218646, -0.0134638967, -0.1075180918, -0.1396068931, -0.1162078902, 0.701856792, -0.0104259066, 0.1576863527, 0.1197109818, -0.6041289568, 0.0803793371, -0.1363221705, -0.2818923295, 0.1663051248, -0.0484370962, 0.2098661065, 0.1589149088, 0.1485236585, 0.0145869944, 0.3213758767, 0.2003956288, 0.2381375432, 0.0310103986, -0.1307128817, 0.0734809935, 0.0858035386, -0.0963583961, -0.318375051, 0.0653055012, 0.2368325442, -0.0228068549, 0.2889069021, -0.1962371022, -0.3680241704, -0.0199918188, -0.1284304559, 0.0725801587, 0.141478762, 0.061180193, 0.0080608455, 0.5874382257, -0.0742887408, 0.1787088513, -0.253834039, 0.0291408636, -0.1472997218, 0.169409737, -0.6243600249, -0.1061868072, 0.2582581341, 0.0919620246, 0.1970394403, -0.0064031417, 0.1218203828, -0.3322490156, 0.1758815497, -0.2791434824, 0.2651099563, -0.0158672649, 0.2457382679, -0.1295720637, -0.3093242645, -0.0095197419, -0.1647401303, 0.2194372565, -0.7123693824, -0.0245732255, 0.0450957865, 0.0754592121, -0.2141941786, 0.1435737163, -0.504322648, 0.0322592966, 0.0630440786, 0.2181686908, 0.1069046184, -0.3306137621, -0.2142897695, -0.0720487833, 0.0830699205, 0.1326567531, -0.1291508824, 0.0973816738, 0.063099049, 0.0002565257, 0.1041970327, 0.2162795961, -0.0109666931, 0.2841814458, -0.1886345595, 0.5723384619, 0.4195817709, -0.803727746, -0.3378545046, 0.0875090808, -0.1656144559, 0.0018319889, -0.0777147934, 0.299970746, 0.2168300003, -0.1097092181, 0.2860380411, 0.4717786908, -0.0601556636, 0.1129641086, -0.1055826545, 0.2662769854, -0.1180939749, 0.3215995729, 0.0420975909, -0.2685295939, -0.1594627202, 0.0751416609, 0.1948618442, -0.1158281565, 0.0870856121, 0.4314537644, 0.0892731249, -0.0513845123, -0.0506237522, 0.0383253694, -0.7624905705, 0.1141010821, -0.4289599061, 0.3793444335, 0.0106571624, -0.0671950951, -0.1728421748, -0.0510761961, -0.296261996, -0.1906543374, 0.1071609929, -0.1209992543, -0.1237813979, -0.3034521341, -0.0762855262, 0.3974153399, -0.2260979116, 0.0737623796, -0.5780184269, 0.3407833874, 0.1180049926, -0.066484876, -0.0123105831, 0.4472563267, 0.1922498792, -0.0482968092, 0.1684597731, 0.2209219635, 0.2148897499, -0.1571742296, -0.0612337142, -0.0020259316, 0.1334933043, -0.5777856112, 0.0659278557, 0.2230993956, -0.0014227685, -0.2143049985, -0.1243549362, 0.5517564416, 0.1847703755, 0.2072840929, 0.0289731026, 0.0707498938, 0.2122235745, -0.1713617742, -0.2344334275, -0.103904739, 0.1545493901, 0.123317495, 0.030547291, 0.0995656848, -0.5023414493, 0.0200130492, 0.3077194989, 0.0274301395, 0.1898183972, 0.2047272623, -0.1531091183, -0.0791651681, 0.037457712, 0.3701201379, 0.3590866029, 0.0914273858, 0.1098856702, 0.1304073632, -0.0329411849, 0.0724883303, -0.0358843245, 0.0617540814, 0.1510176361, 0.2119650096, 0.1785158366, -0.0841949955, -0.085896492, -0.2191503793, 0.0321779102, 0.1521632224, -0.3295001984, 0.0780692771, 0.036821641, -0.4502651691, -0.1473740488, 0.0441723317, -0.1361574978, -0.3193360865, -0.0379221328, -0.0571563095, 0.2387745976, 0.0840667039, -0.4746883214, -0.2150862366, -0.1986019313, -0.3406286836, -0.0583146177, 0.0742932856, -0.1382386684, -0.0267541558, 0.2119733989, 0.5459079742, -0.0312717967, -0.4353147745, 0.390160799, -0.3872417808, -0.2023116499, 0.3016566038, -0.2638223171, 0.3121580184, 0.2171544731, -0.1040854007, -0.4046022892, 0.1959169209, 0.1874916255, -0.3214800656, -0.3141257763, 0.3168615103, -0.1772631407, -0.0916749239, -0.0264437646, -0.406345427, -0.5237721205, -0.2054874897, 0.011993818, 0.2230314016, 0.3162437379, 0.2151382416, -0.2596665323, -0.1451506466, -0.1321805865, -0.1955114156, 0.0069591696, -0.5726140738, 0.4568422139, -0.2441943884, -0.2051523775, -0.0859806687, -0.2658783495, 0.4713196754, 0.378029108, -0.0684936121, -0.0375404917, 0.1413384229, 0.035182029, 0.1777089536, -0.0622193515, 0.2964115739, -0.2141356915, 0.0457051843, -0.0277898367, -0.0081240581, 0.0785254315, 0.3201450408, 0.2304377407, -0.0265186429, -0.2571677268, 0.1103470922, 0.0635771379, 0.1552903354, 0.0463341251, 0.4367931783, 0.0053787678, 0.1145690531, 0.0847836584, 0.0224085152, -0.1640298665, 0.0601462424, 0.2332694232, -0.0009897219, 0.2357879579, -0.154772833, -0.0720981359, 0.1263709217, -0.1329990178, -0.2151204199, 0.5398621559, -0.1397539973, 0.410523355, -0.1709617525, 0.0268175602, -0.0614329875, -0.4580695033, -0.2571297884, 0.0861497, 0.179715693, 0.1554050446, -0.6861749887, 0.3985427022, -0.3888290823, -0.0206330754, 0.1728509068, 0.5378319621, 0.2120257467, 0.0804058835, 0.1571724564, -0.0373992063, 0.311224997, -0.2897292078, -0.1462425441, 0.1092608497, 0.1001144871, -0.3250237703, -0.0430729352, -0.2508809268, 0.0265301894, 0.4807167053, 0.4030669034, -0.3020351827, -0.448857367, -0.0142153036, 0.0474352241, -0.2095986903, -0.1977832764, -0.2662701607, -0.4505194724, -0.0922013447, -0.0910783634, 0.5540917516, -0.011968025, 0.2859901786, 0.028919749, -0.2357486635, 0.2654162347, 0.3301908374, -0.0371143222, 0.5644022226, -0.2395818383, 0.0057375585, -0.0657552332, -0.0843300968, 0.290147543, 0.4803260267, -0.1859406531, -0.150452897, 0.1800045967, -0.2238452286, 0.4223895967, 0.1663807482, 0.188503623, 0.0188957863, -0.29500857, -0.0011860448, -0.1358926147, 0.1362025291, 0.3885797262, -0.1082976833, -0.4188083112, -0.3653251529, 0.1768364757, 0.3088773191, 0.1055982411, -0.2310435921, -0.1721606702, -0.2617762387, -0.1415584534, 0.466368705, 1.016680479, 0.0301854946, 0.4335706234, 0.1726905853, 0.0897264555, 0.0607271194, -0.4444867671, 0.2049940377, -0.3482038975, -0.3285881579, -0.2036453038, -0.2574142814, -0.0620908923, 0.202615574, 0.0319125392, 0.6626027226, 0.2256911695, -0.0447898321, 0.0229515862, 0.2159699798, 0.0093683377, -0.3867394924, -0.3745245934, 0.0040316037, -0.2863348722, 0.0149859441, -0.1535771489, -0.2083835751, -0.0591488183, 0.1994760782, 0.139966473, 0.2819464505, 0.0934469849, -0.1829061806, 0.4239275753, -0.5605941415, -0.0533473864, 0.2428724766, 0.0773039609, -0.3221908212, 0.0031520156, 0.2361229062, 0.4050419033, 0.1009968892, 0.3913240731, -0.3321993351, 0.2601027489, 0.0498279035, 0.1221914217, -0.2428604513, 0.1581603438, -0.037263155, -0.4174324572, 0.0479723066, -0.1750264019, -0.2749731541, -0.208798945, 0.0269384757, -0.1443695277, -0.0497384518, 0.0549407825, 0.2594360113, -0.0902869329, 0.1481013596, 0.1132919788, -0.2592059672, 0.1990917921, 0.0831906796, 0.2976745665, -0.3125317395, 0.0376103409, 0.2482127249, 0.0151348505, -0.0992359743, 0.1805817485, 0.4821509421, -0.6173614264, 0.033747986, -0.2434503287, -0.0137990471, -0.0163006019, 0.1851168722, 0.0020550445, -0.2624996603, 0.1627748311, -0.2828573585, -0.3409925401, 0.3751991689, 0.1163777336, 0.2782914639, -0.1979854256, 0.0098257745, 0.1509939581, -0.2200444043, -0.2390499711, 0.1753159463, -0.1794704497, 0.1961243898, -0.1157645807, -0.096291557, 0.0804040283, -0.0942010507, -0.0249696225, 0.2664696276, -0.1458446532, -0.0578537472, 0.0179339554, 0.1243914887, 0.1327525228, -0.1157702953, 0.1248916537, 0.1200046539, -0.0515409447, -0.1373375356, -0.113568075, 0.1800016612, 0.0228337981, 0.2303532958, -0.2976278961, 0.0392740294, -0.1231657714, 0.2310593277, 0.1895390302, 0.1202055961, 0.0657508895, 0.2072516233, -0.0511192381, 0.0248661097, -0.5182060599, 0.2064266652, 0.1967261434, 0.3688438237, 0.2152001262, -0.1553563029, 0.1056381389, -0.0322780013, 0.1498686522, 0.3083647192, -0.2699720263, -0.0058443975, 0.2419039458, 0.1483671963, -0.1588441879, -0.0049724015, 0.3671053946, 0.0078913039, 0.0080683846, 0.4790735543, 0.3525026143, 0.1368153542, -0.1463457644, 0.0633270666, 0.2355750352, -0.253526926, 0.0676124915, 0.4052128792, -0.0051034992, 0.1394569427, 0.5995877385, 0.033287935, -0.1143289655, 0.6000964642, 0.3011857271, 0.7809860706, 0.1995598972, 0.1787549555, -0.0658111572, -0.1044645533, -0.4129894376, 0.2548291385, 0.1273965687, 0.1769530177, 0.0383531526, 0.1432870328, 0.1453570873, -0.1860470623, -0.0964768752, 0.1134998649, -0.3404926062, 0.0229306072, -0.331787169, -0.2342437655, -0.1217744276, -0.1177005842, -0.1722742766, 0.0367379189, 0.061489176, 0.1339389831, -0.0074613397, -0.0612119511, 0.0823543221, 0.2852356136, 0.0478240587, -0.1977072954, 0.5288455486, 0.033901304, -0.0469574369, -0.1587119251, 0.2742473185, 0.2531480491, 0.2315031588, -0.0519733541, -0.1070038155, 0.3387275934, -0.1102280691, -0.0296933986, 0.1004740819, 0.2005060017, 0.2549167871, 0.1804340929, 0.0651819706, -0.0043521901, 0.3010005653, 0.0695357993, -0.1928669214, 0.2435856014, 0.2801608145, 0.186145395, -0.2890455425, -0.1294614822, -0.2241022438, -0.3388959169, -0.1642102897, 0.3142122328, -0.1428409219, 0.2404809445, -0.1308151335, 0.0508457273, 0.0420493893, 0.1968672425, 0.1187226325, 0.1140163317, -0.4945982099, -0.0885236338, -0.7457129955, 0.2005532831, -0.3096918166, -0.2826578021, 0.2355700582, 0.0266046468, -0.0474612005, 0.3023000062, -0.2346743494, 0.2289669961, 0.0685478672, 0.3347984552, -0.6064156294, 0.0685798079, 0.2317824364, 0.3589983284, 0.0531914718, -0.1249812767, -0.2764686048, 0.2186532766, -0.0702892765, -0.0727588385, -0.068544358, -0.1896738559, -0.0558260791, 0.2673412263, -0.2124232501, 0.1567766368, -0.0746059716, -0.1744634658, -0.2747465074, -0.0597103275, -0.1644855738, 0.0210560095, 0.1005385146, 0.3167755306, 0.0033467624, 0.1547868997, -0.3915069699, -0.2984789014, 0.0132770455, 0.0827493668, -0.3641845286, 0.4328106046, -0.2321624309, 0.1437951177, 0.0377222784, 0.2259717435, 0.0746320784, -0.0033207415, -0.1593917608, -0.4455849826, 0.2613029778, 0.2699011862, -0.1986568272, -0.119501844, 0.0043352814, 0.1073931754, 0.1258694977, -0.4479654729, 0.1364088356, 0.1799705029, -0.0451218672, -0.0945754424, 0.0839961693, -0.0237166304, -0.0781786218, -0.1301056743, 0.1238040254, -0.0262832958, -0.1145849153, -0.2040124089, -0.1585309207 ]
https://github.com/huggingface/datasets/issues/418
Addition of google drive links to dl_manager
I think the problem is the way you wrote your urls. Try the following structure to see `https://drive.google.com/uc?export=download&id=your_file_id` . @lhoestq
Hello there, I followed the template to create a download script of my own, which works fine for me, although I had to shun the dl_manager because it was downloading nothing from the drive links and instead use gdown. This is the script for me: ```python class EmoConfig(nlp.BuilderConfig): """BuilderConfig for SQUAD.""" def __init__(self, **kwargs): """BuilderConfig for EmoContext. Args: **kwargs: keyword arguments forwarded to super. """ super(EmoConfig, self).__init__(**kwargs) _TEST_URL = "https://drive.google.com/file/d/1Hn5ytHSSoGOC4sjm3wYy0Dh0oY_oXBbb/view?usp=sharing" _TRAIN_URL = "https://drive.google.com/file/d/12Uz59TYg_NtxOy7SXraYeXPMRT7oaO7X/view?usp=sharing" class EmoDataset(nlp.GeneratorBasedBuilder): """ SemEval-2019 Task 3: EmoContext Contextual Emotion Detection in Text. Version 1.0.0 """ VERSION = nlp.Version("1.0.0") force = False def _info(self): return nlp.DatasetInfo( description=_DESCRIPTION, features=nlp.Features( { "text": nlp.Value("string"), "label": nlp.features.ClassLabel(names=["others", "happy", "sad", "angry"]), } ), supervised_keys=None, homepage="https://www.aclweb.org/anthology/S19-2005/", citation=_CITATION, ) def _get_drive_url(self, url): base_url = 'https://drive.google.com/uc?id=' split_url = url.split('/') return base_url + split_url[5] def _split_generators(self, dl_manager): """Returns SplitGenerators.""" if(not os.path.exists("emo-train.json") or self.force): gdown.download(self._get_drive_url(_TRAIN_URL), "emo-train.json", quiet = True) if(not os.path.exists("emo-test.json") or self.force): gdown.download(self._get_drive_url(_TEST_URL), "emo-test.json", quiet = True) return [ nlp.SplitGenerator( name=nlp.Split.TRAIN, gen_kwargs={ "filepath": "emo-train.json", "split": "train", }, ), nlp.SplitGenerator( name=nlp.Split.TEST, gen_kwargs={"filepath": "emo-test.json", "split": "test"}, ), ] def _generate_examples(self, filepath, split): """ Yields examples. """ with open(filepath, 'rb') as f: data = json.load(f) for id_, text, label in zip(data["text"].keys(), data["text"].values(), data["Label"].values()): yield id_, { "text": text, "label": label, } ``` Can someone help me in adding gdrive links to be used with default dl_manager or adding gdown as another dl_manager, because I'd like to add this dataset to nlp's official database.
20
Addition of google drive links to dl_manager Hello there, I followed the template to create a download script of my own, which works fine for me, although I had to shun the dl_manager because it was downloading nothing from the drive links and instead use gdown. This is the script for me: ```python class EmoConfig(nlp.BuilderConfig): """BuilderConfig for SQUAD.""" def __init__(self, **kwargs): """BuilderConfig for EmoContext. Args: **kwargs: keyword arguments forwarded to super. """ super(EmoConfig, self).__init__(**kwargs) _TEST_URL = "https://drive.google.com/file/d/1Hn5ytHSSoGOC4sjm3wYy0Dh0oY_oXBbb/view?usp=sharing" _TRAIN_URL = "https://drive.google.com/file/d/12Uz59TYg_NtxOy7SXraYeXPMRT7oaO7X/view?usp=sharing" class EmoDataset(nlp.GeneratorBasedBuilder): """ SemEval-2019 Task 3: EmoContext Contextual Emotion Detection in Text. Version 1.0.0 """ VERSION = nlp.Version("1.0.0") force = False def _info(self): return nlp.DatasetInfo( description=_DESCRIPTION, features=nlp.Features( { "text": nlp.Value("string"), "label": nlp.features.ClassLabel(names=["others", "happy", "sad", "angry"]), } ), supervised_keys=None, homepage="https://www.aclweb.org/anthology/S19-2005/", citation=_CITATION, ) def _get_drive_url(self, url): base_url = 'https://drive.google.com/uc?id=' split_url = url.split('/') return base_url + split_url[5] def _split_generators(self, dl_manager): """Returns SplitGenerators.""" if(not os.path.exists("emo-train.json") or self.force): gdown.download(self._get_drive_url(_TRAIN_URL), "emo-train.json", quiet = True) if(not os.path.exists("emo-test.json") or self.force): gdown.download(self._get_drive_url(_TEST_URL), "emo-test.json", quiet = True) return [ nlp.SplitGenerator( name=nlp.Split.TRAIN, gen_kwargs={ "filepath": "emo-train.json", "split": "train", }, ), nlp.SplitGenerator( name=nlp.Split.TEST, gen_kwargs={"filepath": "emo-test.json", "split": "test"}, ), ] def _generate_examples(self, filepath, split): """ Yields examples. """ with open(filepath, 'rb') as f: data = json.load(f) for id_, text, label in zip(data["text"].keys(), data["text"].values(), data["Label"].values()): yield id_, { "text": text, "label": label, } ``` Can someone help me in adding gdrive links to be used with default dl_manager or adding gdown as another dl_manager, because I'd like to add this dataset to nlp's official database. I think the problem is the way you wrote your urls. Try the following structure to see `https://drive.google.com/uc?export=download&id=your_file_id` . @lhoestq
[ -0.0986937806, 0.0516562499, -0.1309201866, -0.0558965728, 0.063940607, -0.0953547359, 0.3679335713, 0.2208106965, 0.2062921226, 0.2249777764, -0.0750642493, 0.3655761778, -0.2819622159, 0.1416773498, 0.1477239132, 0.1173322722, -0.2243513763, 0.2025328726, 0.275634706, -0.1639438719, -0.2751328051, 0.3278070986, -0.0318779014, -0.0081285518, 0.0502307341, 0.0505593494, -0.1391223073, 0.1980682164, -0.1188959256, -0.2999537885, -0.4197378159, 0.1671043485, 0.1602400392, -0.0974566862, -0.0001042657, -0.1480784714, 0.2225691974, -0.2084537446, -0.4087233543, -0.293666631, 0.2981949151, -0.1724280715, 0.1073082536, -0.2651380002, -0.0045759855, -0.0983254015, 0.2041179389, 0.1354037225, 0.2655148208, 0.303234309, 0.2717004716, 0.0790490434, 0.1134709045, 0.0298929326, 0.3312549293, -0.0354893617, -0.0682808906, 0.3527143896, 0.3344673812, -0.3054538667, -0.1618670225, 0.2883865535, -0.005473163, -0.0109914355, 0.219513312, 0.111340858, 0.5780609846, -0.3311682343, 0.1066151857, 0.0327493884, 0.023619419, -0.0413234085, -0.0850505307, -0.2842148244, 0.0838140175, -0.2874572575, 0.2766533792, 0.1495649666, -0.2334840298, -0.054357402, -0.129478842, -0.0255046543, -0.0154688759, 0.0540597476, -0.088927567, 0.4138540626, -0.0389395133, -0.2830848396, 0.386126101, -0.0381518416, -0.097157374, -0.1532618701, -0.0394701734, 0.0766007602, -0.037477009, -0.2887776494, 0.1567478925, 0.046639964, 0.0937974006, 0.2489914894, 0.0460647866, 0.032891266, 0.2356234938, 0.0752923265, 0.1630283892, 0.4459601343, -0.0003143964, 0.0400673673, 0.3538968563, 0.4176516533, 0.1608999372, 0.1501171142, -0.1202335283, -0.1861606538, -0.1416517198, 0.1408617347, -0.157578975, 0.0906012133, -0.4310441613, -0.1330973506, -0.3732344508, 0.0073384685, -0.0343622491, 0.4378282726, -0.0487493016, -0.1396608055, 0.2441131473, 0.2374015898, -0.0423723347, 0.0900180489, -0.1254784763, 0.2556157708, -0.2168088704, -0.0520230718, 0.3310389221, 0.0770798847, 0.4212232232, -0.2571608424, -0.121339865, -0.2241328657, 0.138893947, 0.0859964937, -0.0139241833, -0.0641110539, 0.4167027771, 0.0155227417, -0.1533246189, -0.4158215523, -0.0712254122, 0.0388117805, 0.0347076207, -0.0371071845, -0.1740765125, 0.3355268836, -0.0862291232, -0.0942454711, -0.0037769512, 0.2271475494, -0.1502159536, 0.043601241, 0.0858766511, 0.3182859123, -0.0827771798, -0.0009885405, 0.1685231775, 0.2986228764, -0.0949453712, -0.2877131104, -0.1839940995, 0.1673677266, -0.1132550612, -0.0632705688, -0.0449297912, 0.2455675304, -0.3794006705, 0.2419204563, 0.3043462038, -0.2896391451, -0.2050281465, 0.2148447633, -0.3752189875, -0.174903065, 0.0302695986, 0.0142995985, 0.4108040631, -0.0042553288, -0.1432297081, 0.4827904701, 0.0771706179, 0.2428659648, -0.3040136099, -0.4660174847, -0.1829137951, 0.2075027376, 0.1516648531, -0.1184459627, 0.1088403463, -0.0877447277, 0.3002709448, -0.1562738419, 0.186559692, 0.1028919891, 0.0824308842, 0.0962021723, 0.0902653709, 0.1277572066, -0.4553064406, -0.0245842505, -0.1491095871, 0.2400399446, -0.3181628883, -0.1654347032, -0.2285122573, -0.1823611706, -0.2087038606, -0.3032358587, 0.2976226509, 0.2181789279, 0.0589154586, 0.2489141822, 0.0791667923, -0.0783370361, 0.1662932783, 0.1352359056, 0.0483057462, 0.3308410347, -0.3822059333, -0.1154452637, 0.1777765304, 0.0533853769, 0.1627698243, -0.0097971717, 0.0177792627, 0.2022306472, -0.2338354439, 0.4560255408, 0.0342992656, -0.0184879042, 0.2643817067, -0.0018943587, 0.3286044598, 0.3785976768, 0.1253686696, -0.0423224457, -0.1335391104, 0.399320811, 0.2978735864, 0.1315350831, 0.1984392703, 0.1492632926, -0.0345824882, -0.3092210591, -0.0366152935, -0.1750034988, 0.1060319096, 0.4917030334, 0.3812163472, -0.1171898469, -0.1798557043, 0.2268594205, 0.3522839248, -0.0431042053, 0.2884166241, 0.0797793567, -0.3493874669, -0.1552884132, -0.117249012, 0.3525730968, 0.1629649103, 0.2543207109, 0.1712720543, 0.0493352264, -0.0080081113, -0.3064471483, 0.3992124498, 0.065561451, 0.1062253788, 0.355427742, 0.112255007, -0.1241624355, -0.3668965399, -0.0078182193, -0.0030907039, -0.0519340336, -0.2809714377, -0.035977155, -0.2021116018, -0.1673543006, -0.0404170156, 0.1189080179, -0.0453861728, -0.1994876266, 0.241571784, 0.2851103246, -0.2777341008, 0.1271889657, 0.167578727, 0.3435672224, -0.0704193786, -0.0517405979, -0.109321095, 0.0156290922, -0.331397146, 0.1907474846, 0.2792064548, 0.0847771317, 0.166862905, 0.0353544764, 0.0824099109, -0.4212258458, -0.1966776997, 0.2405077815, -0.1467301846, 0.0396609418, 0.1082567573, -0.0911809653, -0.0478257798, -0.3472118378, 0.0503747128, -0.2066100538, -0.2028837502, -0.3251748979, 0.1594581902, 0.062949501, -0.4881838858, -0.3987681568, -0.2369149029, -0.3800841272, 0.1677401513, 0.1598065943, 0.1822993904, 0.1246551871, -0.054826349, 0.1800565869, 0.2231408209, -0.160607487, -0.1476716995, 0.2775506377, 0.4198611677, -0.409594357, -0.3190639913, 0.0439115614, -0.3232086897, 0.0133836437, -0.2990262508, -0.2501086295, -0.4383625388, 0.15373151, -0.177799806, -0.0845338255, -0.0026809166, 0.2986175418, 0.1873590797, -0.2003105581, 0.0265889969, -0.1110699177, 0.207054615, 0.0882990956, 0.3847720623, -0.1615371406, 0.406722784, 0.1174866036, 0.2566289306, -0.2691878974, 0.0335369594, 0.3619188666, -0.0506728403, 0.1701949984, 0.1592023075, -0.086352095, 0.1363564581, 0.0409466997, -0.0944345966, 0.5336620808, -0.0854695141, -0.48649773, -0.182667315, 0.0532185622, -0.2736864686, -0.2679209709, -0.1089558452, 0.2660419941, -0.1956837922, 0.0115902042, 0.2149550915, 0.0052228686, -0.0608395897, 0.2059179097, 0.2196900696, -0.0772172511, -0.120615162, 0.118584618, 0.1042682007, -0.3951483369, 0.1117486656, 0.1043820083, -0.4041222036, 0.1074391976, -0.2256137133, 0.2036410123, -0.3195443749, 0.3587412834, -0.1209612042, 0.2662652731, -0.0143703856, 0.216437906, 0.1093022674, -0.099338226, -0.2988062501, -0.321182251, 0.4507476389, -0.047875829, -0.2656047642, -0.1441641599, 0.3384919763, -0.2589461505, 0.0323874801, -0.0962956399, -0.019114444, -0.5297092795, -0.542252481, 0.077239491, 0.1260938346, 0.0979747921, -0.1870060712, -0.1639555395, 0.2704378664, -0.2099727839, -0.112227641, 0.0596683919, 0.1827884167, 0.1411257386, -0.0469048396, 0.2014990747, 0.4859795272, -0.0863522887, 0.0502428748, 0.0887131244, 0.1350987256, 0.3584618568, -0.2915492952, -0.012051695, 0.4303934574, 0.0423832349, -0.1449912786, -0.3378116488, 0.1312000602, -0.0050205742, 0.0262092333, 0.352330029, -0.0076963278, 0.3189740479, -0.1285666227, 0.3718144298, -0.1149386093, -0.1495707333, -0.1133223698, 0.1379418671, -0.489156276, 0.2023630291, 0.249479264, 1.0095969439, 0.1828904748, 0.1841593087, 0.3770167232, -0.1828774363, 0.2244260758, -0.2048052847, 0.2420449257, -0.2759123147, 0.2594018281, 0.027056016, 0.1235550344, -0.2554804683, 0.2857078016, -0.3485202193, 0.2226645947, 0.191833958, -0.0550933965, 0.0397400446, 0.5254421234, -0.4147656262, -0.3550723493, -0.0840060189, 0.2253389955, 0.2074781954, 0.3336937129, -0.0224047489, -0.3262497187, 0.0230253134, -0.3689985871, -0.1200432628, 0.2228098661, -0.6562030315, 0.0811415166, -0.4205801487, -0.2054659128, 0.0714980587, 0.121639058, 0.1825932413, 0.1002612039, -0.0640582666, 0.2806991041, 0.0451344177, -0.0464381315, -0.0050445423, -0.1170367673, 0.2287958562, -0.2543816566, -0.2008147687, -0.0529558174, 0.1507781744, -0.2844578922, 0.049413994, -0.0253134128, -0.2893361449, 0.1632660925, 0.0008360891, 0.0888022482, -0.4070389867, -0.1701178849, 0.2157661319, -0.2228650749, -0.0063024247, -0.0420259163, 0.0753561482, -0.1657579839, -0.1717544943, 0.4114313722, -0.1920538247, -0.3257522285, 0.5842945576, 0.0643737689, -0.1504259706, -0.3654354513, -0.2140040845, 0.0150124235, -0.1508515775, 0.1102014109, -0.1128667369, -0.2562161684, -0.0146314371, 0.5000478625, -0.0012306349, 0.2679026425, 0.0265189763, -0.0871423408, -0.0991813391, 0.2623233199, -0.1346050203, 0.2985245883, -0.0751187503, 0.0820538402, 0.1869877726, -0.1457144767, -0.4634032845, 0.0790764838, -0.1712542623, -0.1405718923, 0.1250740737, -0.2987323999, 0.3095210791, 0.170426175, 0.2733667195, 0.2205570489, -0.0772568658, -0.2663615346, -0.0304334722, 0.0700642169, 0.047300715, -0.1006333008, 0.0123661226, -0.1115101501, -0.2185091227, 0.1263174266, 0.2010792643, -0.1831628531, 0.0833368152, -0.1032223552, -0.2481859922, 0.0976702198, 0.2554212809, -0.1850831062, -0.0976004824, 0.4207085371, 0.0166872125, 0.107595101, 0.0078060795, 0.0033928144, 0.043122977, 0.1411654353, 0.0564507619, 0.3387710452, 0.2962434888, 0.0672249198, -0.5515543818, 0.0619443767, 0.2637965977, 0.0785371065, -0.2515685856, -0.1156085655, 0.222831592, 0.3556101024, -0.2594173253, 0.173217833, -0.162311092, -0.4482298791, 0.3617486656, 0.2996285558, 0.1987315714, 0.0672524124, 0.0475774854, 0.1538341343, 0.404625684, -0.0747886598, -0.0928395316, -0.0525273681, -0.1224943548, 0.1339277178, 0.185081467, 0.0674028173, 0.3257804811, -0.1616301537, -0.1871491075, 0.0087998668, 0.0235792343, 0.2640462816, 0.2166270912, 0.0519342534, 0.038368132, 0.0814640746, -0.2451708317, 0.0961865485, -0.0673367307, 0.2200666666, -0.3235001266, 0.0240177494, -0.3409783542, 0.4161135852, -0.0618106984, -0.0085473824, -0.2516658306, -0.3260460496, -0.6693038344, 0.1929430366, 0.0450477824, -0.1420248002, -0.4067168534, 0.1091225073, -0.0436599813, 0.048874855, -0.2354438305, -0.0959130004, 0.3324646056, -0.4127461314, 0.1486724466, 0.0149961906, 0.122397624, -0.1983053386, 0.3227460086, 0.2554572523, 0.2159600407, -0.3102446795, -0.2035479993, -0.0794244111, -0.060155198, -0.1442168355, 0.0371101163, 0.3265763819, -0.169457078, 0.1500539035, 0.2160782069, -0.3853531778, -0.0577884838, 0.2834992707, -0.2225656956, 0.2526808083, 0.1624028534, 0.271872133, 0.0135585815, -0.3872140646, -0.3066832423, -0.5732125044, -0.1348944157, -0.2507287264, -0.1008887291, 0.2407358736, -0.3101223707, 0.1533885747, 0.117405802, 0.1802913249, 0.3067572117, -0.0013956535, -0.1100463346, -0.235751152, -0.4394382238, 0.0553812087, 0.2680013776, -0.1324961782, -0.2193134725, 0.4046545923, -0.0119784679, -0.0210185703, 0.0093865022, 0.5449492931, 0.2535099685, 0.0710762069, -0.186858952, 0.1759402007, 0.1250488311, 0.114530161, 0.0818907768, -0.1827894598, -0.1159718782, -0.2869516611, 0.2148596346, -0.1342401505, 0.1613275856, -0.3132973611, 0.0037506483, 0.4126845002, -0.245964393, 0.2662290037, -0.2862209678, -0.1534481645, -0.1860762984, 0.2085222751, -0.2952426374, -0.3550873697, 0.2407323718, 0.1949658841, 0.0700789988, 0.066966787, -0.269187063, 0.2615858614, 0.0445119441, 0.004922979, -0.1911265552, 0.1149074808, -0.0623385496, 0.0978204384, 0.0315191783, 0.2053172588, -0.1249732375, 0.0482876785, -0.4952872992, -0.5152051449, 0.1610217392, -0.0524532236, -0.0868818983, -0.0676094666, 0.3968175948, 0.2529715896, 0.1593206972, -0.2931995988, 0.1256084889, -0.0083495583, 0.182300806, -0.1703493148, 0.137327075, 0.1382036507, -0.1351920664, -0.0715939626, -0.2012003958, 0.3138324618, 0.0080848094, -0.2065827847, -0.3480611145 ]